@ckeditor/ckeditor5-revision-history 49.0.0-alpha.9 → 49.0.1
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/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- 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
|
-
_0x57c0bb();var yt=class extends pt{['id'];creator;authors;diffData;toVersion;['fromVersion'];['model'];constructor(_0x2d881c){super(),this['id']=_0x2d881c['id']||_0x5289a7(),this['creator']=_0x2d881c['creator']||null,this['authors']=_0x2d881c['authors']||[],this['diffData']=_0x2d881c['diffData']||null,this['toVersion']=_0x2d881c['toVersion']||0x0,this['fromVersion']=_0x2d881c['fromVersion']||0x0,this['set']('name',_0x2d881c['name']||''),this['set']('createdAt',_0x2d881c['createdAt']||new Date()),this['set']('attributes',_0x2d881c['attributes']||{});}setName(_0x2e7d63){this['_update']({'name':_0x2e7d63});}setAttribute(_0x536a23,_0x342934){const _0xf3bc6d=_0x144f08(this['attributes']);_0x4968aa(_0xf3bc6d,_0x536a23,_0x342934),this['_update']({'attributes':_0xf3bc6d});}removeAttribute(_0x59e59b){const _0x194d9f=_0x144f08(this['attributes']);_0xc0e3c(_0x194d9f,_0x59e59b),this['_update']({'attributes':_0x194d9f});}_update(_0x5c2d36,_0x5a95f3=!0x1){let _0x5812e7=!0x1;const _0x4795fa={'id':this['id']};for(const _0x1d16b4 of['name','createdAt','diffData','authors','attributes','toVersion','fromVersion','creatorId']){const _0x1d7ecc=_0x5c2d36[_0x1d16b4];void 0x0!==_0x1d7ecc&&_0x1d7ecc!==this[_0x1d16b4]&&(this[_0x1d16b4]=_0x1d7ecc,_0x4795fa[_0x1d16b4]=_0x1d7ecc,_0x5812e7=!0x0);}_0x5812e7&&(_0x4795fa['authors']&&(_0x4795fa['authorsIds']=_0x4795fa['authors']['map'](_0x32fa42=>_0x32fa42['id']),delete _0x4795fa['authors']),this['fire']('_update',_0x4795fa,_0x5a95f3));}toJSON(){return{'id':this['id'],'name':this['name'],'creatorId':this['creator']?this['creator']['id']:null,'authorsIds':this['authors']['map'](_0x4f3c33=>_0x4f3c33['id']),'diffData':this['diffData'],'createdAt':this['createdAt'],'attributes':this['attributes'],'fromVersion':this['fromVersion'],'toVersion':this['toVersion']};}},bt=class extends _0x3ccb16{['_revisions'];static get requires(){return[_0x312567];}static get['pluginName'](){return'RevisionsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get length(){return this['_revisions']['length'];}constructor(_0x405b1f){super(_0x405b1f),this['_revisions']=new _0x520f62();}afterInit(){!async function(_0x5d3103){const _0x44eba8='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x49574b=0xeb829,_0x3d9cb3=0x797b8,_0x23fdc4={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x2fc968(_0x55c3da){const _0x5effa8=new window['Promise'](_0x4e2494=>{_0x55c3da['once']('ready',_0x4e2494);}),_0x46dead=window['Date']['now'](),_0x3e3791=_0x55c3da['config']['get']('licenseKey');async function _0x23d7b6(){let _0x205ac9,_0x340a20=null,_0x3e0dd1=null;try{return'GPL'==_0x3e3791?'NotAllowed':(_0x205ac9=_0x459193(),_0x205ac9?(_0x205ac9['usageEndpoint']&&(_0x3e0dd1=_0x4bc903(_0x205ac9['usageEndpoint'],_0x205ac9['jti'])),await _0x3cb8bd()?_0x5a3096()?_0x4648df()?'Expired':_0x1e202b()?('evaluation'==_0x205ac9['licenseType']&&(_0x340a20=_0x3fcae4('EvaluationLimit')),await _0x5c54a9()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x4648df(){const _0x2f56f7=['evaluation','trial']['includes'](_0x205ac9['licenseType'])?_0x46dead/0x3e8:0xe10*_0x3d9cb3;return _0x205ac9['exp']<_0x2f56f7;}function _0x5a3096(){const _0x21a57=_0x205ac9['features'];if(!_0x21a57)return!0x1;if(_0x21a57['includes']('*'))return!0x0;if(_0x21a57['includes']('RH'))return!0x0;if(_0x21a57['includes']('RRH')){if(_0x188ec7())return!0x0;if(_0x20125b()||_0x17e957())return!0x0;}return!0x1;}function _0x1e202b(){const _0x570773=_0x205ac9['licensedHosts'];if(!_0x570773||0x0==_0x570773['length'])return!0x0;const {hostname:_0x306ddd}=new URL(window['location']['href']);if(_0x570773['includes'](_0x306ddd))return!0x0;const _0x111790=_0x306ddd['split']('.');return _0x570773['filter'](_0x4cf020=>_0x4cf020['includes']('*'))['map'](_0x3e7676=>_0x3e7676['split']('.'))['filter'](_0x301826=>_0x301826['length']<=_0x111790['length'])['map'](_0x36576a=>Array(_0x111790['length']-_0x36576a['length'])['fill']('*'===_0x36576a[0x0]?'*':'')['concat'](_0x36576a))['some'](_0x5ebccc=>_0x111790['every']((_0x32a90e,_0x922d0)=>_0x5ebccc[_0x922d0]===_0x32a90e||'*'===_0x5ebccc[_0x922d0]));}function _0x5c54a9(){return _0x340a20&&_0x3e0dd1?new window['Promise']((_0x49343f,_0x333cdd)=>{_0x340a20['then'](_0x49343f,_0x333cdd),_0x3e0dd1['then'](_0x498b66=>{'Valid'!=_0x498b66&&_0x49343f(_0x498b66);},_0x333cdd);}):_0x340a20||_0x3e0dd1||'Valid';}}function _0x4bc903(_0x5edd18,_0x320b15){return new window['Promise'](_0x426553=>{if(_0x22258a())return _0x426553('Valid');_0x16761d(),_0x55c3da['decorate']('_sendUsageRequest');let _0x22e731=!0x1;const _0x78fb9b=_0x5289a7();function _0x103109(_0x1637f3){return!!_0x1637f3&&('object'==typeof _0x1637f3||'function'==typeof _0x1637f3)&&'function'==typeof _0x1637f3['then']&&'function'==typeof _0x1637f3['catch'];}function _0x565a8c(_0x492f2c){_0x57c7f1(_0x492f2c)['then'](_0x1ef500=>_0x1ef500&&'ok'==_0x1ef500['status']?_0x36bac0(_0x411190(_0x78fb9b+_0x320b15))!=_0x1ef500['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x4b8b96=>(_0x15db3b(),_0x4b8b96),()=>{const _0x353dd9=_0x1f81b5();return null==_0x353dd9?(_0x15db3b(),'Valid'):_0x46dead-_0x353dd9>0x240c8400?'UsageLimit':'Valid';})['then'](_0x426553)['catch'](()=>{_0x426553('UsageLimit');});const _0xd5d92f=0x36ee80;function _0x15db3b(){const _0x141f70='llct-'+_0x36bac0(_0x411190(_0x5edd18)),_0x210bcf=_0x10d043(_0x36bac0(window['Math']['ceil'](_0x46dead/_0xd5d92f)));window['localStorage']['setItem'](_0x141f70,_0x210bcf);}function _0x1f81b5(){const _0x661d06='llct-'+_0x36bac0(_0x411190(_0x5edd18)),_0x1e44af=window['localStorage']['getItem'](_0x661d06);return _0x1e44af?window['parseInt'](_0x10d043(_0x1e44af),0x10)*_0xd5d92f:null;}function _0x57c7f1(_0x452e66){return new window['Promise']((_0x307b5f,_0x26cb78)=>{_0x452e66['then'](_0x307b5f,_0x26cb78),window['setTimeout'](_0x26cb78,0x1d4c0);});}}_0x55c3da['on']('_sendUsageRequest',(_0x2ec327,_0x4ca0c6)=>{if(_0x4ca0c6[0x0]!=_0x5edd18)return _0x426553('UsageLimit');_0x4ca0c6[0x1]={..._0x4ca0c6[0x1],'requestId':_0x78fb9b};},{'priority':'high'}),_0x55c3da['on']('_sendUsageRequest',_0x3c9c41=>{_0x103109(_0x3c9c41['return'])&&(_0x22e731=!0x0,_0x565a8c(_0x3c9c41['return']));},{'priority':'low'}),_0x5effa8['then'](()=>{_0x22e731||_0x426553('UsageLimit');});});function _0x22258a(){return'auto'==_0x55c3da['editing']['view']['_overlayModeHint'];}function _0x16761d(){_0x55c3da['editing']['view']['_overlayModeHint']='auto';}}function _0x3fcae4(_0xd17412){const _0x33c371=[new window['Promise'](_0x3e0cee=>setTimeout(_0x3e0cee,0x93ecc)),_0x5effa8['then'](()=>new window['Promise'](_0x35de56=>{const _0x4cb35e=0x7,_0x52b708=_0x5d3103['_revisions'];function _0x3d0d53(){_0x52b708['length']>=_0x4cb35e&&_0x35de56();}_0x3d0d53(),_0x52b708['on']('add',_0x3d0d53);})),new window['Promise'](_0x5854c3=>{function _0x5eab0b(){for(const _0x4a5bec in window)if(window['Number']['isNaN'](window['Number'](_0x4a5bec))&&window[_0x4a5bec]==_0x49574b)return _0x5854c3();'destroyed'!=_0x55c3da['state']&&window['setTimeout'](_0x5eab0b,0x1388);}_0x169a2a('RevisionViewer')&&_0x5eab0b();})];return window['Promise']['race'](_0x33c371)['then'](()=>_0xd17412);}async function _0x52d941(){if(await _0x5effa8,_0x169a2a('RevisionViewer')){const _0x13c7c2=_0x5d3103['getRevision'](0x0),_0x3a54f8=_0x5d3103['getEarlierVisibleRevision'](_0x13c7c2['id']),_0x4dcaa1=_0x3658c1('RevisionViewer');return await _0x4dcaa1['compare'](_0x13c7c2['id'],_0x3a54f8?_0x3a54f8['id']:null,!0x0),_0x4dcaa1['unbind']('isEnabled'),_0x4dcaa1['isEnabled']=!0x1,_0x4dcaa1['compare']=_0x21df41,void(_0x4dcaa1['_getDiff']=_0x21df41);}if(_0x169a2a('RevisionTracker')){const _0x24baf2=_0x3658c1('RevisionTracker');_0x24baf2['unbind']('isEnabled'),_0x24baf2['isEnabled']=!0x1,_0x24baf2['update']=_0x21df41,_0x24baf2['saveRevision']=_0x21df41;}_0x55c3da['model']['change']=_0x21df41,_0x55c3da['model']['enqueueChange']=_0x21df41,_0x55c3da['enableReadOnlyMode']('model');}function _0x188ec7(){return _0x169a2a('WebSocketGateway')&&'connected'==_0x3658c1('WebSocketGateway')['state'];}function _0x20125b(){return _0x169a2a('RevisionViewerIntegration');}function _0x17e957(){return _0x169a2a('TrackChangesDataGetter');}function _0x26bc3c(_0x142915){const _0x42918d=_0x5c6ceb();_0x55c3da[_0x42918d]='revisionHistoryLicenseKey'+_0x142915,_0x142915['endsWith']('Limit')&&(window[_0x5c6ceb()]=_0x49574b),'Valid'!=_0x142915&&_0x52d941();}function _0x5c6ceb(){const _0x4fdaab=window['String'](window['performance']['now']())['replace']('.','');let _0x47720b='N';for(let _0x9a7332=0x0;_0x9a7332<_0x4fdaab['length'];_0x9a7332+=0x2){let _0x13eaf6=window['parseInt'](_0x4fdaab['substring'](_0x9a7332,_0x9a7332+0x2));_0x13eaf6>=0x3e&&(_0x13eaf6-=0x3e),_0x47720b+=_0x44eba8[_0x13eaf6];}return _0x47720b;}function _0x459193(){const _0x194edf=_0x3e3791['split']('.');if(0x3!=_0x194edf['length'])return null;return _0x161df1(_0x194edf[0x1]);function _0x161df1(_0x1394ea){const _0x4765d2=_0x5e0779(_0x1394ea);return _0x4765d2&&_0x4e9675()?_0x4765d2:null;function _0x4e9675(){const _0xcf4676=_0x4765d2['jti'],_0x52c9eb=window['parseInt'](_0xcf4676['substring'](_0xcf4676['length']-0x8),0x10),_0x1a3d8e={..._0x4765d2,'jti':_0xcf4676['substring'](0x0,_0xcf4676['length']-0x8)};return delete _0x1a3d8e['vc'],_0x411190(_0x1a3d8e)==_0x52c9eb;}}}async function _0x3cb8bd(){let _0x5468f3=!0x0;try{const [_0x2821b6,_0x1cc77c,_0x5521ac]=_0x3e3791['split']('.');return _0x2c1693(_0x2821b6),await _0x22448c(_0x2821b6,_0x1cc77c,_0x5521ac),_0x5468f3;}catch{return!0x1;}function _0x2c1693(_0x39f86a){const _0x1e2304=_0x5e0779(_0x39f86a);_0x1e2304&&'ES256'==_0x1e2304['alg']||(_0x5468f3=!0x1);}async function _0x22448c(_0x5cb688,_0x1cab3c,_0x1121d2){const _0x1139a4=window['Uint8Array']['from'](_0x1b6d3c(_0x1121d2),_0x102006=>_0x102006['charCodeAt'](0x0)),_0x6dc372=new window['TextEncoder']()['encode'](_0x5cb688+'.'+_0x1cab3c),_0x24d049=window['crypto']['subtle'];if(!_0x24d049)return;const _0x50ec3e=await _0x24d049['importKey']('jwk',_0x23fdc4,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x24d049['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x50ec3e,_0x1139a4,_0x6dc372)||(_0x5468f3=!0x1);}}function _0x5e0779(_0x55157c){return _0x55157c['startsWith']('ey')?JSON['parse'](_0x1b6d3c(_0x55157c)):null;}function _0x1b6d3c(_0x526731){return window['atob'](_0x526731['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x411190(_0x4e1585){let _0x5462fc=0x1505;function _0x18ff81(_0x27ea9f){for(let _0x5724bc=0x0;_0x5724bc<_0x27ea9f['length'];_0x5724bc++){const _0x188268=_0x27ea9f['charCodeAt'](_0x5724bc);_0x5462fc=(_0x5462fc<<0x5)+_0x5462fc+_0x188268,_0x5462fc&=_0x5462fc;}}function _0x19c06f(_0x407db5){Array['isArray'](_0x407db5)?_0x407db5['forEach'](_0x19c06f):_0x407db5&&'object'==typeof _0x407db5?Object['entries'](_0x407db5)['sort']()['forEach'](([_0x5659ff,_0x569fd0])=>{_0x18ff81(_0x5659ff),_0x19c06f(_0x569fd0);}):_0x18ff81(window['String'](_0x407db5));}return _0x19c06f(_0x4e1585),_0x5462fc>>>0x0;}function _0x36bac0(_0x4471ed){return _0x4471ed['toString'](0x10)['padStart'](0x8,'0');}function _0x10d043(_0x1dadd6){return _0x1dadd6['split']('')['reverse']()['join']('');}function _0x169a2a(_0x26e35f){return _0x55c3da['plugins']['has'](_0x26e35f);}function _0x3658c1(_0x469e33){return _0x55c3da['plugins']['get'](_0x469e33);}function _0x21df41(){}_0x26bc3c(await _0x23d7b6());}_0x2fc968(_0x5d3103['editor']);}(this);}createRevision(_0x2a0f82){const _0x1ac7a7=this['editor']['plugins']['get']('Users');return new yt({'id':_0x2a0f82['id'],'name':_0x2a0f82['name'],'creator':_0x2a0f82['creatorId']?_0x1ac7a7['getUser'](_0x2a0f82['creatorId']):null,'diffData':_0x2a0f82['diffData']||_0x2a0f82['data'],'authors':_0x2a0f82['authorsIds']['map'](_0x902fac=>_0x1ac7a7['getUser'](_0x902fac)),'createdAt':new Date(_0x2a0f82['createdAt']),'attributes':_0x2a0f82['attributes'],'fromVersion':_0x2a0f82['fromVersion'],'toVersion':_0x2a0f82['toVersion']});}['addRevision'](_0x162eb2,_0x1090cf=0x0){this['_revisions']['add'](_0x162eb2,_0x1090cf);}getRevision(_0x4ae708){return this['_revisions']['get'](_0x4ae708);}getRevisions(_0x19f9d7={'toJSON':!0x1}){const _0x125b02=Array['from'](this['_revisions']);return _0x125b02['reverse'](),_0x19f9d7['toJSON']?_0x125b02['map'](_0x4ceef8=>_0x4ceef8['toJSON']()):_0x125b02;}getIndex(_0x1be798){return this['_revisions']['getIndex'](_0x1be798);}getEarlierVisibleRevision(_0x3d5fe7){const [,_0x1f7d3d]=this['getRevisionsIterator'](_0x3d5fe7,{'direction':'earlier'});return _0x1f7d3d;}getLaterVisibleRevision(_0x5be0cf){const [,_0x57a562]=this['getRevisionsIterator'](_0x5be0cf,{'direction':'later'});return _0x57a562;}getRevisionsInDiff(_0xf435d2){const _0x457ebf=[];for(const _0x5a1610 of this['getRevisionsIterator'](_0xf435d2['newRevisionId']))if(_0x457ebf['push'](_0x5a1610),_0x5a1610['id']===_0xf435d2['oldRevisionId'])break;return _0x457ebf;}*getRevisionsIterator(_0x48da3e,{direction:_0x50239d='earlier',filter:_0x51e20e=()=>!0x0}={}){const _0x50a11f='earlier'===_0x50239d?0x1:-0x1;let _0x43e68e=this['_revisions']['get'](_0x48da3e),_0x15b221=this['getIndex'](_0x43e68e);for(yield _0x43e68e;_0x43e68e;){if(_0x15b221+=_0x50a11f,_0x43e68e=this['getRevision'](_0x15b221),!_0x43e68e)return;_0x51e20e(_0x43e68e)&&(yield _0x43e68e);}}},Rt=class extends _0x3ccb16{static get['pluginName'](){return'RevisionHistoryUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_viewClassToTypeChar']=new Map([[_0x524a1a,'c'],[_0x28d884,'a'],[_0x5569aa,'e'],[_0x17020d,'r'],[_0x26f24c,'u']]);_typeCharToViewClass=new Map([['c',_0x524a1a],['a',_0x28d884],['e',_0x5569aa],['r',_0x17020d],['u',_0x26f24c]]);async loadRevisionData(_0x223a1d,_0x17dffa){if(_0x223a1d['diffData']||!_0x17dffa)return;const _0x599b43=this['editor']['config']['get']('collaboration.channelId');_0x223a1d['diffData']=(await _0x17dffa['getRevision']({'channelId':_0x599b43,'revisionId':_0x223a1d['id']}))['diffData'];}getRevisionDocumentData(_0x44fe6f){const _0x4af8d6={};for(const _0x990803 in _0x44fe6f['diffData']){if(_0x44fe6f['diffData'][_0x990803]['attachChange']&&!_0x44fe6f['diffData'][_0x990803]['attachChange']['isAttached'])continue;const _0x2eebce=this['_removeRevisionMarkers'](JSON['parse'](_0x44fe6f['diffData'][_0x990803]['insertions'])),_0x1a879a=this['editor']['editing']['view']['document'],_0x1e8274=new _0xabc291(_0x1a879a,_0x2eebce['map'](_0x145ac8=>this['_getViewFromDiffObj'](_0x145ac8,!0x1)));this['editor']['data']['processor']['useFillerType']('marked'),_0x4af8d6[_0x990803]=this['editor']['data']['processor']['toData'](_0x1e8274),this['editor']['data']['processor']['useFillerType']('default');}return _0x4af8d6;}getRevisionRootsAttributes(_0x279c42){const _0x4d0d82={};for(const _0x16282f in _0x279c42['diffData'])_0x279c42['diffData'][_0x16282f]['attachChange']&&!_0x279c42['diffData'][_0x16282f]['attachChange']['isAttached']||(_0x4d0d82[_0x16282f]=_0x279c42['diffData'][_0x16282f]['attributesAfter']||{});return _0x4d0d82;}getRevisionRootsModelElements(_0x4e2b1b){const _0x1481c0={};for(const _0x3a9c9c in _0x4e2b1b['diffData']){if(_0x4e2b1b['diffData'][_0x3a9c9c]['attachChange']&&!_0x4e2b1b['diffData'][_0x3a9c9c]['attachChange']['isAttached'])continue;const _0xa93616=_0x4e2b1b['diffData'][_0x3a9c9c]['rootElementName'];_0xa93616&&(_0x1481c0[_0x3a9c9c]=_0xa93616);}return _0x1481c0;}_getTypeCharForViewElement(_0x3ea5b6){return this['_viewClassToTypeChar']['get'](_0x3ea5b6['constructor']);}_getViewFromDiffObj(_0x539e0f,_0x52fca2){const _0x1b1e70=this['editor']['editing']['view']['document'];if('string'==typeof _0x539e0f)return new _0x383b5e(_0x1b1e70,_0x539e0f);{let _0x5f1837,_0x565bab;_0x565bab='u'==_0x539e0f['type']||'r'==_0x539e0f['type']?[]:_0x539e0f['children']['map'](_0x4c2e0b=>this['_getViewFromDiffObj'](_0x4c2e0b,_0x52fca2));const _0x364963=this['_typeCharToViewClass']['get'](_0x539e0f['type'])||_0x2d3953,_0x3e6808=this['editor']['data']['htmlProcessor']['domConverter'];if(_0x5f1837=new _0x364963(_0x1b1e70,_0x539e0f['name'],_0x539e0f['attributes'],_0x565bab),'u'==_0x539e0f['type']&&_0x539e0f['children'][0x0]){const _0x331e0b=_0x539e0f['children'][0x0];if(_0x5f1837['render']=function(_0xbb05e1){const _0x189dab=_0xbb05e1['createElement']('div');return _0x189dab['innerHTML']=_0xe4f10(_0x331e0b),_0x189dab['childNodes'][0x0];},_0x52fca2){const _0x2b5cca=new _0xabc291(_0x1b1e70);_0x2b5cca['_appendChild'](_0x5f1837);const _0x5e650d=Array['from'](_0x3e6808['viewChildrenToDom'](_0x2b5cca,{'bind':!0x1})),_0x1747d0=_0x3e6808['domDocument']['createElement']('div');_0x1747d0['append'](..._0x5e650d),_0x5f1837=Array['from'](_0x3e6808['domChildrenToView'](_0x1747d0))[0x0];}}else{if('r'==_0x539e0f['type']&&_0x539e0f['children'][0x0]){const _0x1ded38=_0x539e0f['children'][0x0];if(_0x5f1837['render']=function(_0x3c016f){_0x3c016f['innerHTML']=_0xe4f10(_0x1ded38);},_0x52fca2){const _0x7be2b9=new _0xabc291(_0x1b1e70);_0x7be2b9['_appendChild'](_0x5f1837);const _0x4cae31=Array['from'](_0x3e6808['viewChildrenToDom'](_0x7be2b9,{'bind':!0x1})),_0x48930c=_0x3e6808['domDocument']['createElement']('div');_0x48930c['append'](..._0x4cae31);const _0x1e2783=Array['from'](_0x3e6808['domChildrenToView'](_0x48930c));_0x1e2783['length']>0x1?_0x5f1837['_appendChild'](_0x1e2783):_0x5f1837=_0x1e2783[0x0];}}}if(_0x539e0f['customProperties']){for(const [_0x1ae583,_0x417084]of _0x539e0f['customProperties'])_0x5f1837['_setCustomProperty'](_0x1ae583,_0x417084);}const _0x54ba6a=void 0x0===_0x539e0f['fillerOffset']?null:_0x539e0f['fillerOffset'];return null!==_0x54ba6a&&(_0x5f1837['getFillerOffset']=()=>_0x54ba6a),_0x5f1837;}}_makeModelFromViewString(_0x45bde7,_0xfb0c99){const _0xc020e7=JSON['parse'](_0x45bde7),_0x1cd224=this['editor']['editing']['view']['document'],_0x135430=new _0xabc291(_0x1cd224,_0xc020e7['map'](_0x2fddf1=>this['_getViewFromDiffObj'](_0x2fddf1,!0x0))),_0xfc96c5=this['editor']['data']['toModel'](_0x135430,_0xfb0c99);return _0xfc96c5['name']=_0xfb0c99,_0xfc96c5;}['_removeRevisionMarkers'](_0x2954f5){return(_0x2954f5=_0x2954f5['filter'](_0x65f21f=>!_0x65f21f['name']||'revision-start'!==_0x65f21f['name']&&'revision-end'!==_0x65f21f['name']))['forEach'](_0x50b327=>{'string'!=typeof _0x50b327&&(_0x50b327['children']=this['_removeRevisionMarkers'](_0x50b327['children']),_0x50b327['attributes']=_0x50b327['attributes']['filter'](_0x1c85c8=>!_0x1c85c8[0x0]['startsWith']('data-revision-')));}),_0x2954f5;}};function kt(_0x3e6fd7,_0x2ed7f8,_0x1722ec){const t=_0x3e6fd7['t'];switch(_0x2ed7f8){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'},_0x1722ec);case'X_OF_Y_CHANGES':return t({'string':'%0\x20of\x20%1','id':'X_OF_Y_CHANGES'},_0x1722ec);case'Show\x20previous\x20change':return t('Show\x20previous\x20change');case'Show\x20next\x20change':return t('Show\x20next\x20change');case'EDIT_X_OF_Y_REVISIONS':return t({'string':'Edit','id':'EDIT_X_OF_Y_REVISIONS'});case'Total':return t('Total');case'Revision\x20creator':return t('Revision\x20creator');case'Revision\x20author':return t('Revision\x20author');case'Revision\x20name':return t('Revision\x20name');case'Save\x20current\x20revision':return t('Save\x20current\x20revision');case'Accept':return t('Accept');case'Save':return t('Save');case'Cancel':return t('Cancel');case'Name\x20of\x20the\x20revision':return t('Name\x20of\x20the\x20revision');case'optional':return t('optional');case'PENDING_ACTION_REVISION_HISTORY':return t({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'The\x20revision\x20name\x20cannot\x20be\x20empty.':return t('The\x20revision\x20name\x20cannot\x20be\x20empty.');case'Enter\x20the\x20revision\x20name':return t('Enter\x20the\x20revision\x20name');case'REVISION_AI_SOURCE_PILL_LABEL':return t({'string':'Includes\x20AI\x20suggestions','id':'REVISION_AI_SOURCE_PILL_LABEL'});case'AI_SOURCE_REVISION_TOOLTIP':return t({'string':'This\x20revision\x20contains\x20AI-assisted\x20suggestions.','id':'AI_SOURCE_REVISION_TOOLTIP'});case'AI_SOURCE_CHANGE_TOOLTIP':return t({'string':'This\x20change\x20was\x20suggested\x20using\x20AI.','id':'AI_SOURCE_CHANGE_TOOLTIP'});case'AI_SOURCE_ADDED_BY':return t({'string':'Added\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_ADDED_BY'},_0x1722ec);case'AI_SOURCE_REMOVED_BY':return t({'string':'Removed\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_REMOVED_BY'},_0x1722ec);case'AI_SOURCE_SUGGESTED_BY':return t({'string':'Suggested\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_SUGGESTED_BY'},_0x1722ec);case'AI_SOURCE_AI':return t({'string':'AI','id':'AI_SOURCE_AI'});default:return'';}}var At=class extends _0x3ccb16{['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[_0x312567,bt,Rt,_0x55fafd];}constructor(_0x4bc2a9){super(_0x4bc2a9),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['_revisionDataBuilder']=new It(this['editor']),this['_initialRevisionId']=this['editor']['config']['get']('collaboration.channelId')||'initial',this['_bufferedUpdates']=new Map(),this['_loadedStateData']=null;const _0x2e1c5d=_0x5289a7();this['_source']={'history':this['editor']['model']['document']['history'],'getLatestVersion':()=>Promise['resolve'](this['editor']['model']['document']['version']),'getCurrentRevisionId':()=>_0x2e1c5d},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 _0x400e6a=this['repository']['getRevision'](0x0),_0xe84c79=_0x400e6a&&null===_0x400e6a['creator']?_0x400e6a:null;if(this['_continueCurrentRevision']=!!_0xe84c79&&this['editor']['config']['get']('revisionHistory.resumeUnsavedRevision'),this['editor']['plugins']['has']('RealTimeCollaborationClient')){const _0x1ada1e=this['_source']['getCurrentRevisionId'](),_0x4f7561=this['repository']['getRevision'](_0x1ada1e);if(_0x4f7561)this['_startingVersion']=_0x4f7561['fromVersion'],this['_continueCurrentRevision']=!0x1;else{const _0x54ff83=this['_source']['history']['_operations']['find'](_0x8bff9f=>!_0x8bff9f['_isInit']),_0x2b2ec5=_0x54ff83?_0x54ff83['baseVersion']:this['_source']['history']['version'];_0x400e6a?(_0x400e6a['toVersion']<_0x2b2ec5&&_0x400e6a['_update']({'toVersion':_0x2b2ec5}),this['_continueCurrentRevision']?(this['_source']['getCurrentRevisionId']=()=>_0xe84c79['id'],this['_startingVersion']=_0xe84c79['fromVersion']):(this['_startingVersion']=_0x400e6a['toVersion'],this['_continueCurrentRevision']=!0x1)):(this['_startingVersion']=_0x2b2ec5,this['_continueCurrentRevision']=!0x1);}}else _0xe84c79&&(this['editor']['model']['document']['history']['version']=Math['max'](_0xe84c79['toVersion'],this['editor']['model']['document']['history']['version']),_0xe84c79['fromVersion']===_0xe84c79['toVersion']?(0x0!==_0xe84c79['fromVersion']&&(this['_source']['getCurrentRevisionId']=()=>_0xe84c79['id']),this['_continueCurrentRevision']=!0x1):this['_continueCurrentRevision']&&(this['_source']['getCurrentRevisionId']=()=>_0xe84c79['id'],this['_startingVersion']=_0xe84c79['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',_0x4d3b46=>!_0x4d3b46),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x178ea0=[this['editor']];for(const _0x287368 of _0x178ea0){let _0x327ea7;for(const _0x3a0298 in _0x287368){const _0x490647=_0x3a0298,_0x272f9c=_0x287368[_0x490647];if('revisionHistoryLicenseKeyValid'==_0x272f9c||'revisionHistoryLicenseKeyInvalid'==_0x272f9c||'revisionHistoryLicenseKeyExpired'==_0x272f9c||'revisionHistoryLicenseKeyDomainLimit'==_0x272f9c||'revisionHistoryLicenseKeyNotAllowed'==_0x272f9c||'revisionHistoryLicenseKeyEvaluationLimit'==_0x272f9c||'revisionHistoryLicenseKeyUsageLimit'==_0x272f9c){delete _0x287368[_0x490647],_0x327ea7=_0x272f9c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'revisionHistoryLicenseKeyInvalid'==_0x327ea7&&_0x287368['_showLicenseError']('invalid'),'revisionHistoryLicenseKeyExpired'==_0x327ea7&&_0x287368['_showLicenseError']('expired'),'revisionHistoryLicenseKeyDomainLimit'==_0x327ea7&&_0x287368['_showLicenseError']('domainLimit'),'revisionHistoryLicenseKeyNotAllowed'==_0x327ea7&&_0x287368['_showLicenseError']('featureNotAllowed','RevisionHistory'),'revisionHistoryLicenseKeyEvaluationLimit'==_0x327ea7&&_0x287368['_showLicenseError']('evaluationLimit'),'revisionHistoryLicenseKeyUsageLimit'==_0x327ea7&&_0x287368['_showLicenseError']('usageLimit');}},0x3e8);}async afterInit(){if(this['repository']['length']>0x0){const _0x4e250c=this['repository']['getRevision'](0x0),_0x47c924=await this['getRevisionDocumentData'](_0x4e250c),_0x2a9da8=await this['getRevisionRootsAttributes'](_0x4e250c),_0x351da7=this['_utils']['getRevisionRootsModelElements'](_0x4e250c);this['_replaceEditorDataWithRevisionData'](_0x47c924,_0x2a9da8,_0x351da7);}}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}setSource(_0x22db48){this['_source']=_0x22db48;}async update(){const _0x65957c=await this['_source']['getLatestVersion']();if(_0x65957c>this['currentRevision']['toVersion']){await this['_loadState']();const _0x31b567=this['buildRevisionData']({'revision':this['currentRevision'],'to':_0x65957c});_0x31b567['authors']=_0x31b567['authorsIds']['map'](_0x1262d1=>this['editor']['plugins']['get']('Users')['getUser'](_0x1262d1)),this['currentRevision']['_update'](_0x31b567);}}async['saveRevision'](_0x1b9b59={},_0x19f076=null){const _0x3a67dd=[];await this['_loadState'](),this['_continueCurrentRevision']=!0x1,_0x19f076>this['currentRevision']['toVersion']&&(_0x19f076=null),null===_0x19f076&&(_0x19f076=await this['_source']['getLatestVersion']());const _0x361398=this['_getFromVersion'](_0x19f076),_0x4a9d3a=this['buildRevisionData']({'from':_0x361398,'to':_0x19f076});if(this['currentRevision']['toVersion']<_0x19f076){const _0x226f52=this['buildRevisionData']({'revision':this['currentRevision'],'from':_0x19f076,'to':_0x19f076});_0x226f52['authors']=[],_0x226f52['authorsIds']=[],_0x226f52['id']=this['currentRevision']['id'],this['currentRevision']['_update'](_0x226f52,!0x0),delete _0x226f52['authors'],_0x3a67dd['push'](_0x226f52);}const _0x2adbf5={..._0x1b9b59,'creatorId':this['editor']['plugins']['get']('Users')['me']['id'],'name':_0x1b9b59['name']||null,'id':_0x1b9b59['id']||_0x5289a7(),..._0x4a9d3a,'attributes':{..._0x1b9b59['attributes'],..._0x4a9d3a['attributes']}},_0x1a3e6e=this['addRevisionData'](_0x2adbf5);_0x3a67dd['push'](_0x2adbf5);const _0xae41d=this['repository']['getIndex'](_0x1a3e6e);if(0x0!==_0xae41d){const _0x627b85=this['repository']['getRevision'](_0xae41d-0x1);if(_0x627b85['fromVersion']!==_0x19f076){const _0x31425b=this['_revisionDataBuilder']['getData'](_0x19f076,_0x627b85['toVersion']),_0x5de086={'id':_0x627b85['id'],'diffData':_0x31425b['diffData'],'authorsIds':_0x31425b['authorsIds'],'authors':_0x31425b['authorsIds']['map'](_0x4eb8b2=>this['editor']['plugins']['get']('Users')['getUser'](_0x4eb8b2)),'fromVersion':_0x19f076};this['_stampAiAttribute'](_0x5de086,_0x627b85,!!_0x31425b['hasAIChanges']),_0x627b85===this['currentRevision']&&(_0x5de086['createdAt']=new Date(_0x2adbf5['createdAt']['getTime']()+0xa)),_0x627b85['_update'](_0x5de086,!0x0),delete _0x5de086['authors'],_0x3a67dd['push'](_0x5de086);}}if(this['adapter']){for(const _0x194bb1 of _0x3a67dd)this['_bufferUpdate'](_0x194bb1['id'],_0x194bb1,!0x0);this['sendBufferedUpdates']();}return _0x1a3e6e;}addRevisionData(_0xc87ba6){const _0x1a3328=this['repository']['createRevision'](_0xc87ba6);return this['adapter']&&_0x1a3328['on']('_update',(_0x4144a4,_0x1c44d7,_0x5082ad)=>{_0x5082ad||(this['_bufferUpdate'](_0x1c44d7['id'],_0x1c44d7,!0x0),this['sendBufferedUpdates']());}),this['repository']['addRevision'](_0x1a3328,this['_findInsertionIndex'](_0x1a3328)),_0x1a3328;}async getRevisionDocumentData(_0xae8512){return await this['_utils']['loadRevisionData'](_0xae8512,this['adapter']),this['_utils']['getRevisionDocumentData'](_0xae8512);}async getRevisionRootsAttributes(_0x1112c8){return await this['_utils']['loadRevisionData'](_0x1112c8,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x1112c8);}sendBufferedUpdates(){if(0x0===this['_bufferedUpdates']['size'])return;if(this['_isPendingUpdate'])return;let _0x40fa55=Array['from'](this['_bufferedUpdates']['values']());this['_bufferedUpdates']['clear']();for(let _0x4c0eb6=0x0;_0x4c0eb6<_0x40fa55['length'];_0x4c0eb6++){const _0x5852ad=_0x40fa55[_0x4c0eb6];let _0x4f3078=!0x1;for(const _0x25e1d3 of Object['keys'](_0x5852ad))void 0x0===_0x5852ad[_0x25e1d3]?delete _0x5852ad[_0x25e1d3]:'id'!==_0x25e1d3&&(_0x4f3078=!0x0);_0x4f3078||(_0x40fa55[_0x4c0eb6]=null);}if(_0x40fa55=_0x40fa55['filter'](_0x480734=>null!==_0x480734),!_0x40fa55['length'])return;for(let _0x26b7a2=0x0;_0x26b7a2<_0x40fa55['length'];_0x26b7a2++){const _0xe8a914=_0x40fa55[_0x26b7a2];void 0x0!==_0xe8a914['fromVersion']&&void 0x0===_0xe8a914['toVersion']&&(_0xe8a914['toVersion']=this['repository']['getRevision'](_0xe8a914['id'])['toVersion']),void 0x0!==_0xe8a914['toVersion']&&void 0x0===_0xe8a914['fromVersion']&&(_0xe8a914['fromVersion']=this['repository']['getRevision'](_0xe8a914['id'])['fromVersion']);}const _0x4366de=this['editor']['config']['get']('collaboration.channelId');this['_isPendingUpdate']=!0x0,this['_addPendingAction'](),this['adapter']['updateRevisions'](_0x40fa55,_0x4366de)['finally'](()=>{this['_isPendingUpdate']=!0x1;})['then'](_0x14825f=>{if(_0x14825f){for(const _0x41ef84 of _0x14825f)this['setRevisionData']({'id':_0x41ef84['id'],'createdAt':_0x41ef84['createdAt']});}this['_removePendingAction'](),this['sendBufferedUpdates']();});}_stampAiAttribute(_0x237111,_0x239349,_0x37fce1){if(_0x37fce1===(!!_0x239349&&!!_0x239349['attributes']['@ai']))return;const _0x4130bb={..._0x239349?_0x239349['attributes']:{},..._0x237111['attributes']};_0x37fce1?_0x4130bb['@ai']=!0x0:delete _0x4130bb['@ai'],_0x237111['attributes']=_0x4130bb;}buildRevisionData({revision:_0x58e20a=null,from:_0xe51299=null,to:_0x3355fe=null}){_0xe51299=null!==_0xe51299?_0xe51299:_0x58e20a['fromVersion'],_0x3355fe=null!==_0x3355fe?_0x3355fe:_0x58e20a['toVersion'];const _0x41aeb5=this['_revisionDataBuilder']['getData'](_0xe51299,_0x3355fe),_0x2fa54f={'diffData':_0x41aeb5['diffData'],'authorsIds':_0x41aeb5['authorsIds'],'fromVersion':_0xe51299,'toVersion':_0x3355fe};if(this['_stampAiAttribute'](_0x2fa54f,_0x58e20a,!!_0x41aeb5['hasAIChanges']),!_0x58e20a||_0x3355fe!==_0x58e20a['toVersion']){const _0x12a42b=_0x3355fe-0x1,_0x526f17=this['_source']['history']['getOperation'](_0x12a42b);_0x2fa54f['createdAt']=_0x526f17&&_0x526f17['createdAt']||new Date();}if(this['_loadedStateData']&&_0xe51299===this['_loadedStateData']['fromVersion']){for(const _0x4907d6 of this['_loadedStateData']['authors'])_0x2fa54f['authorsIds']['includes'](_0x4907d6['id'])||_0x2fa54f['authorsIds']['push'](_0x4907d6['id']);}return _0x2fa54f;}_bufferUpdate(_0x2eebe9,_0xf5d722,_0x5861f9){if(this['_bufferedUpdates']['has'](_0x2eebe9)){const _0x3525b3=this['_bufferedUpdates']['get'](_0x2eebe9);_0xf5d722=_0x5861f9?{..._0x3525b3,..._0xf5d722}:{..._0xf5d722,..._0x3525b3};}this['_bufferedUpdates']['set'](_0x2eebe9,_0xf5d722);}setRevisionData(_0x55acfa){const _0x297f96=this['repository']['getRevision'](_0x55acfa['id']);if(_0x55acfa['createdAt']&&(_0x55acfa['createdAt']=new Date(_0x55acfa['createdAt'])),_0x55acfa['authorsIds']){const _0x468bba=this['editor']['plugins']['get']('Users');_0x55acfa['authors']=_0x55acfa['authorsIds']['map'](_0x375b0d=>_0x468bba['getUser'](_0x375b0d));}_0x297f96['_update'](_0x55acfa,!0x0);}_createInitialRevision(_0x5b6afc){const _0x4d3133=this['repository']['getRevision'](this['repository']['length']-0x1);if(_0x4d3133)this['_initialRevisionId']=_0x4d3133['id'];else{const _0x27d171=!this['editor']['model']['document']['roots']['find'](_0x1836db=>this['editor']['model']['hasContent'](_0x1836db)),_0x3c986a=this['editor']['plugins']['get']('Users')['me']['id'],_0xd41ce9=kt(this['editor']['locale'],_0x27d171?'Empty\x20document':'Initial\x20revision');this['_makeRevision']({'from':_0x5b6afc,'to':_0x5b6afc,'id':this['_initialRevisionId'],'name':_0xd41ce9,'creatorId':_0x3c986a});}}_createCurrentRevision(_0x10fbf3){const _0x2b4e7c=this['_source']['getCurrentRevisionId']();this['currentRevision']=this['repository']['getRevision'](_0x2b4e7c),this['currentRevision']||(this['currentRevision']=this['_makeRevision']({'from':_0x10fbf3,'to':_0x10fbf3,'id':_0x2b4e7c,'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(_0x4465df,_0x163c17,_0x1d25a8){const _0x15be32={},_0x181ad1={},_0x1bb0cd={},_0xa18adf=this['editor']['config']['get']('roots')||{};for(const [_0x3f70b0,_0x5dfdea]of Object['entries'](_0xa18adf))_0x5dfdea['lazyLoad']||(_0x15be32[_0x3f70b0]=_0x5dfdea['initialData']??'',_0x181ad1[_0x3f70b0]=_0x5dfdea['modelAttributes']||{},_0x5dfdea['modelElement']&&(_0x1bb0cd[_0x3f70b0]=_0x5dfdea['modelElement']));for(const _0x496a3a of this['editor']['model']['document']['getRootNames']())_0x15be32[_0x496a3a]??='',_0x181ad1[_0x496a3a]??={};let _0x4b5374=!0x1;const _0x1180aa=Object['keys'](_0x15be32),_0x11daf4=Object['keys'](_0x4465df);for(const _0x12385e of _0x1180aa){if(_0x15be32[_0x12385e]!==_0x4465df[_0x12385e]&&''!==_0x15be32[_0x12385e]['trim']()){_0x4b5374=!0x0;break;}if(!_0x538fa0(_0x181ad1[_0x12385e],_0x163c17[_0x12385e])&&Object['keys'](_0x181ad1[_0x12385e])['length']>0x0){_0x4b5374=!0x0;break;}const _0x2ee8a8=_0x1bb0cd[_0x12385e],_0x21c663=_0x1d25a8[_0x12385e];if(_0x2ee8a8&&_0x21c663&&_0x2ee8a8!==_0x21c663){_0x4b5374=!0x0;break;}}_0x4b5374||(_0x4b5374=_0x11daf4['some'](_0x293388=>!this['editor']['model']['document']['getRoot'](_0x293388))),_0x4b5374&&_0x3905c1('editor-initial-data-replaced-with-revision-data',{'editorData':_0x15be32,'editorRootsAttributes':_0x181ad1,'editorRootsModelElements':_0x1bb0cd,'revisionData':_0x4465df,'revisionRootsAttributes':_0x163c17,'revisionRootsModelElements':_0x1d25a8});for(const [_0x3ccd87,_0x28836d]of Object['entries'](_0x4465df))this['editor']['config']['set']('roots.'+_0x3ccd87+'.initialData',_0x28836d);for(const [_0x30d8ea,_0xd46164]of Object['entries'](_0x163c17))this['editor']['config']['set']('roots.'+_0x30d8ea+'.modelAttributes',_0xd46164);const _0x2076fd=this['editor']['model']['document'];for(const [_0x41bc24,_0x396c15]of Object['entries'](_0x1d25a8)){this['editor']['config']['set']('roots.'+_0x41bc24+'.modelElement',_0x396c15);const _0x23556c=_0x2076fd['getRoot'](_0x41bc24);_0x23556c&&_0x23556c['name']!==_0x396c15&&(_0x2076fd['roots']['remove'](_0x41bc24),_0x2076fd['createRoot'](_0x396c15,_0x41bc24));}}_addPendingAction(){if(!this['_pendingAction']){const _0x2e6af2=this['editor']['plugins']['get']('PendingActions');this['_pendingAction']=_0x2e6af2['add'](kt(this['editor']['locale'],'PENDING_ACTION_REVISION_HISTORY'));}}_removePendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get']('PendingActions')['remove'](this['_pendingAction']),this['_pendingAction']=null);}_findInsertionIndex(_0x1d542a){const _0x4fb1ad=this['repository']['getRevisions']();_0x4fb1ad['reverse']();let _0x26e3e9=0x0;for(;_0x26e3e9<_0x4fb1ad['length'];){const _0x207da7=_0x4fb1ad[_0x26e3e9];if(_0x207da7===this['currentRevision']){_0x26e3e9++;continue;}if(_0x207da7['id']===this['_initialRevisionId'])break;const _0x709ac8=_0x1d542a['toVersion']-_0x207da7['toVersion']||_0x1d542a['fromVersion']-_0x207da7['fromVersion'];if(_0x709ac8>0x0)break;if(_0x709ac8<0x0)_0x26e3e9++;else{if(!_0x1d542a['creator']&&_0x207da7['creator'])break;if(_0x207da7['creator']||!_0x1d542a['creator']){if(_0x1d542a['createdAt']>_0x207da7['createdAt'])break;_0x26e3e9++;}else _0x26e3e9++;}}return _0x26e3e9;}_getFromVersion(_0x1e97ca){const _0x2f2c3f=this['repository']['getRevisions']();_0x2f2c3f['reverse'](),_0x2f2c3f['shift']();const _0x328672=_0x2f2c3f['find'](_0x3adffa=>_0x3adffa['toVersion']<=_0x1e97ca)['toVersion'];return _0x328672<this['_startingVersion']?this['_startingVersion']:_0x328672;}['_makeRevision']({name:_0x219496,from:_0x1a2910,to:_0x53a2e1,creatorId:_0x49f438,id:_0x55bdc6}){const _0x139d0f=this['buildRevisionData']({'from':_0x1a2910,'to':_0x53a2e1});_0x139d0f['name']=_0x219496,_0x139d0f['creatorId']=_0x49f438,_0x139d0f['id']=_0x55bdc6;const _0x9c9a34=this['addRevisionData'](_0x139d0f);return this['adapter']&&this['_bufferUpdate'](_0x139d0f['id'],_0x139d0f,!0x0),_0x9c9a34;}_setConversion(){this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'});}},It=class{editor;['source'];_savedMetaData;_lastFrom;_lastTo;['_markers'];_diffRoots;_diffRootsAttributes;_baseRoots;_baseRootsAttributes;_idsRoots;_baseIdsRoots;_touched;_touchedMarkers;['_aiTouchedMarkers'];_touchedRoots;['_revisionId'];_startingRevisionId;constructor(_0x561d0d){this['editor']=_0x561d0d,this['_savedMetaData']=new Map(),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_markers']=new Map(),this['_diffRoots']=new Map(),this['_diffRootsAttributes']=new Map(),this['_baseRoots']=new Map(),this['_baseRootsAttributes']=new Map(),this['_idsRoots']=new Map(),this['_baseIdsRoots']=new Map(),this['_touched']=new Map(),this['_touchedMarkers']=new Map(),this['_aiTouchedMarkers']=new Map(),this['_touchedRoots']=new Map(),this['_revisionId']=0x1;}init(_0x34936f){this['source']=_0x34936f;const _0x34e79f=new Map(),_0x1af8d6=new Map(),_0xbad2c0=this['editor']['model']['document']['roots']['map'](_0x2b65f0=>_0x2b65f0['rootName']);for(const _0x4f7481 of _0xbad2c0){const _0x28cf2d=this['editor']['model']['document']['getRoot'](_0x4f7481),_0x32a344=St(_0x28cf2d);_0x34e79f['set'](_0x4f7481,_0x32a344),_0x1af8d6['set'](_0x4f7481,Object['fromEntries'](_0x28cf2d['getAttributes']()));}const _0x247873=Array['from'](this['editor']['model']['markers'])['map'](_0x5a82b9=>[_0x5a82b9['name'],_0x5a82b9['getRange']()]),_0x1bef46=this['source']['version'];this['_saveMetaData'](_0x1bef46,_0x34e79f,_0x247873,_0x1af8d6),this['_startingRevisionId']=this['_revisionId'];const _0x3c94a1=new Map(),_0x407c60=new Map();for(const _0x2fa461 of _0xbad2c0){const _0x58a453=Et(_0x2fa461,this['editor']['model']['document']['getRoot'](_0x2fa461)['name']);_0x3c94a1['set'](_0x2fa461,_0x58a453),_0x407c60['set'](_0x2fa461,{});}this['_saveMetaData'](Number['NEGATIVE_INFINITY'],_0x3c94a1,[],_0x407c60);}getData(_0x35f582,_0x4fe200){if(this['_lastFrom']===_0x35f582&&this['_lastTo']<=_0x4fe200)this['_savedMetaData']['size']>0x1&&this['_removeMetaData'](this['_lastTo']),this['_applyOperations'](this['_lastTo'],_0x4fe200,!0x0);else{if(!this['_savedMetaData']['has'](_0x35f582)){const _0x2e5084=this['_getPreviousFrom'](_0x35f582);this['_calculateMetaData'](_0x2e5084,_0x35f582,!0x1);}this['_calculateMetaData'](_0x35f582,_0x4fe200,!0x0);}return this['_lastFrom']=_0x35f582,this['_lastTo']=_0x4fe200,this['_getState']();}loadState(_0x3af0b9){if(!this['_savedMetaData']['has'](_0x3af0b9['fromVersion'])){const _0x239c29=this['_getPreviousFrom'](_0x3af0b9['fromVersion']);this['_calculateMetaData'](_0x239c29,_0x3af0b9['fromVersion'],!0x1);}this['_calculateMetaData'](_0x3af0b9['fromVersion'],_0x3af0b9['toVersion'],!0x1);const _0xf41104=this['editor']['plugins']['get']('RevisionHistoryUtils');this['_reset'](),this['_lastFrom']=_0x3af0b9['fromVersion'],this['_lastTo']=_0x3af0b9['toVersion'];for(const _0x2d3840 in _0x3af0b9['diffData']){const _0x3dbc43=_0x3af0b9['diffData'][_0x2d3840]['attachChange'],_0x5e956d=_0x144f08(_0x3af0b9['diffData'][_0x2d3840]['attributesBefore'])||{},_0x4a19ea=_0x3af0b9['diffData'][_0x2d3840],_0x37532f=_0xf41104['_makeModelFromViewString'](_0x4a19ea['deletions'],_0x4a19ea['rootElementName']||'$root');_0x37532f['rootName']=_0x2d3840,_0x37532f['_isAttached']=!_0x3dbc43||!_0x3dbc43['isAttached'],_0x37532f['isAttached']=()=>_0x37532f['_isAttached'],this['_baseRoots']['set'](_0x2d3840,_0x37532f),this['_baseRootsAttributes']['set'](_0x2d3840,_0x5e956d),_0x3dbc43&&this['_touchedRoots']['set'](_0x2d3840,_0x3dbc43);const _0x183ac9=this['_makeIdsRoot'](_0x37532f);this['_baseIdsRoots']['set'](_0x2d3840,_0x183ac9);for(const [_0x204a26,_0x1b6245]of _0x37532f['markers']){if(!_0x204a26['startsWith']('revision:'))continue;const _0x19d3ba=_0x204a26['split'](':')[0x2],_0x2fcd5e=_0x4a19ea['aiSources']?.[_0x204a26]||null;for(const _0xe8d32d of _0x1b6245['getWalker']({'singleCharacters':!0x0})){const _0x2c517b=this['_getVidAttributeName'](_0xe8d32d),_0x437281='elementEnd'==_0xe8d32d['type']?_0xe8d32d['previousPosition']['path']['slice'](0x0,-0x1):_0xe8d32d['previousPosition']['path'],_0x49fbcd=_0x183ac9['getNodeByPath'](_0x437281)['getAttribute'](_0x2c517b);this['_touched']['set'](_0x49fbcd,{'userId':_0x19d3ba,'aiSource':_0x2fcd5e});}_0x37532f['markers']['delete'](_0x204a26);}}this['_startingRevisionId']=this['_revisionId'];const _0x2eb5dd=[...Array(this['_revisionId'])['keys']()]['slice'](0x1)['filter'](_0x35cdff=>!this['_touched']['has'](_0x35cdff));let _0x3bc09c=0x0;const _0x30555e=new Map();for(const _0x23e6c2 in _0x3af0b9['diffData']){const _0x3af82e=_0x3af0b9['diffData'][_0x23e6c2]['attachChange'],_0x1c9df5=_0x144f08(_0x3af0b9['diffData'][_0x23e6c2]['attributesAfter'])||{},_0x285ebc=_0x3af0b9['diffData'][_0x23e6c2],_0x5f170b=_0xf41104['_makeModelFromViewString'](_0x285ebc['insertions'],_0x285ebc['rootElementName']||'$root');_0x5f170b['rootName']=_0x23e6c2,_0x5f170b['_isAttached']=!_0x3af82e||_0x3af82e['isAttached'],_0x5f170b['isAttached']=()=>_0x5f170b['_isAttached'],this['_diffRoots']['set'](_0x23e6c2,_0x5f170b),this['_diffRootsAttributes']['set'](_0x23e6c2,_0x1c9df5);const _0x1daaf4=this['_makeIdsRoot'](_0x5f170b,Number['NEGATIVE_INFINITY']);this['_idsRoots']['set'](_0x23e6c2,_0x1daaf4),_0x30555e['set'](_0x23e6c2,_0x5f170b['isAttached']()?_0x1c9df5:{});for(const [_0x1c916c,_0xc8202f]of _0x5f170b['markers']){if(!_0x1c916c['startsWith']('revision:'))continue;const _0x2d6832=_0x1c916c['split'](':')[0x2],_0x3cbe93=_0x285ebc['aiSources']?.[_0x1c916c]||null;for(const _0x181cab of _0xc8202f['getWalker']({'singleCharacters':!0x0})){const _0x580345=this['_getVidAttributeName'](_0x181cab),_0x1dbdf9=this['_revisionId']++,_0x3ce121='elementEnd'==_0x181cab['type']?_0x181cab['previousPosition']['path']['slice'](0x0,-0x1):_0x181cab['previousPosition']['path'];_0x1daaf4['getNodeByPath'](_0x3ce121)['_setAttribute'](_0x580345,_0x1dbdf9),this['_touched']['set'](_0x1dbdf9,{'userId':_0x2d6832,'aiSource':_0x3cbe93});}_0x5f170b['markers']['delete'](_0x1c916c);}for(const _0xfe0ddb of this['editor']['model']['createRangeIn'](_0x5f170b)['getWalker']({'singleCharacters':!0x0})){const _0xdd2aa4=this['_getVidAttributeName'](_0xfe0ddb),_0x33fc89='elementEnd'==_0xfe0ddb['type']?_0xfe0ddb['previousPosition']['path']['slice'](0x0,-0x1):_0xfe0ddb['previousPosition']['path'],_0x45e32e=_0x1daaf4['getNodeByPath'](_0x33fc89);_0x45e32e['getAttribute'](_0xdd2aa4)>0x0||_0x45e32e['_setAttribute'](_0xdd2aa4,_0x2eb5dd[_0x3bc09c++]);}for(const [_0x3ae353,_0x4e1ffb]of _0x5f170b['markers'])_0x3ae353['startsWith']('revision:')||this['_markers']['set'](_0x3ae353,_0x4e1ffb);}const {roots:_0xa94598}=this['_savedMetaData']['get'](_0x3af0b9['fromVersion']),{roots:_0xeaa17f}=this['_savedMetaData']['get'](_0x3af0b9['toVersion']),_0x182b13=St(_0xa94598['get']('$graveyard'));this['_baseRoots']['set']('$graveyard',_0x182b13),this['_baseIdsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x182b13,Number['NEGATIVE_INFINITY']));const _0x630beb=St(_0xeaa17f['get']('$graveyard'));this['_diffRoots']['set']('$graveyard',_0x630beb),this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x630beb));const _0xa302df=Array['from'](this['_diffRoots'])['map'](([_0x2941e5,_0x47813f])=>[_0x2941e5,St(_0x47813f)]);this['_saveMetaData'](this['_lastTo'],_0xa302df,this['_markers'],_0x30555e);}reInit(){this['_reset'](),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_savedMetaData']['clear'](),this['init'](this['source']);}_saveMetaData(_0x456754,_0x3cd7de,_0x5cee19,_0x237280){const _0x2edc73=new Map(_0x3cd7de),_0x11eeda=new Map(_0x144f08(_0x237280)),_0x3a73e3=new Map();for(const [_0x5290be,_0x536c11]of _0x5cee19)_0x3a73e3['set'](_0x5290be,{'start':_0x536c11['start']['clone'](),'end':_0x536c11['end']['clone'](),'rootName':_0x536c11['root']['rootName']});this['_savedMetaData']['set'](_0x456754,{'roots':_0x2edc73,'markers':_0x3a73e3,'rootsAttributes':_0x11eeda});}_removeMetaData(_0x2e53fe){this['_savedMetaData']['delete'](_0x2e53fe);}_reset(){this['_touched']['clear'](),this['_touchedMarkers']['clear'](),this['_aiTouchedMarkers']['clear'](),this['_touchedRoots']['clear'](),this['_diffRoots']['clear'](),this['_diffRootsAttributes']['clear'](),this['_baseRoots']['clear'](),this['_baseRootsAttributes']['clear'](),this['_idsRoots']['clear'](),this['_baseIdsRoots']['clear'](),this['_markers']['clear'](),this['_revisionId']=0x1,this['_startingRevisionId']=this['_revisionId'];}_makeIdsRoot(_0x20e88e,_0x114afd=null){let _0x2bf4de=null;_0x20e88e['is']('documentFragment')||(_0x2bf4de=new _0x28c730(_0x20e88e['name'],{'vid_start':null===_0x114afd?this['_revisionId']++:_0x114afd++}));const _0x15fd67=[];for(const _0x43cabb of _0x20e88e['getChildren']())if(_0x43cabb['is']('element')){_0x15fd67['push'](this['_makeIdsRoot'](_0x43cabb,_0x114afd));const _0x36c422=_0x15fd67[_0x15fd67['length']-0x1];null!==_0x114afd&&(_0x114afd=_0x36c422['is']('element','$text')?_0x36c422['getAttribute']('vid')+0x1:_0x36c422['getAttribute']('vid_end')+0x1);}else{for(let _0x48e7fc=0x0;_0x48e7fc<_0x43cabb['offsetSize'];_0x48e7fc++)_0x15fd67['push'](new _0x28c730('$text',{'vid':null===_0x114afd?this['_revisionId']++:_0x114afd++}));}if(_0x20e88e['is']('documentFragment')){const _0x717f95=Et(_0x20e88e['rootName'],_0x20e88e['name']);return _0x717f95['_insertChild'](0x0,_0x15fd67),_0x717f95;}return _0x2bf4de['_setAttribute']('vid_end',null===_0x114afd?this['_revisionId']++:_0x114afd),_0x2bf4de['_insertChild'](0x0,_0x15fd67),_0x2bf4de;}_calculateMetaData(_0x5e32fc,_0x150401,_0x113ee1){this['_reset']();const {roots:_0xef9b73,markers:_0x87ea9c,rootsAttributes:_0x274651}=this['_savedMetaData']['get'](_0x5e32fc);this['_baseRoots']=new Map(_0xef9b73),this['_baseRootsAttributes']=new Map(_0x144f08(_0x274651));for(const [_0x41f08b,_0x5d7aa8]of this['_baseRoots'])if('$graveyard'!==_0x41f08b&&(this['_diffRoots']['set'](_0x41f08b,St(_0x5d7aa8)),this['_diffRootsAttributes']=new Map(_0x144f08(_0x274651)),_0x113ee1)){const _0x5f3a06=this['_revisionId'];this['_idsRoots']['set'](_0x41f08b,this['_makeIdsRoot'](_0x5d7aa8)),this['_baseIdsRoots']['set'](_0x41f08b,this['_makeIdsRoot'](_0x5d7aa8,_0x5f3a06));}this['_startingRevisionId']=this['_revisionId'],this['_diffRoots']['set']('$graveyard',St(this['_baseRoots']['get']('$graveyard'))),_0x113ee1&&this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](this['_baseRoots']['get']('$graveyard')));for(const [_0x1cdb26,_0xe73eb7]of _0x87ea9c){const _0x502fa7=this['_baseRoots']['get'](_0xe73eb7['rootName']),_0x4f899d=this['_diffRoots']['get'](_0xe73eb7['rootName']),_0x230775=new _0x390c0d(_0x289722(_0xe73eb7['start'],_0x502fa7),_0x289722(_0xe73eb7['end'],_0x502fa7)),_0xa049a4=_0x3c9bdd(_0x230775,_0x4f899d);_0x502fa7['markers']['set'](_0x1cdb26,_0x230775),this['_markers']['set'](_0x1cdb26,_0xa049a4);}this['_applyOperations'](_0x5e32fc,_0x150401,_0x113ee1);}_applyOperations(_0x198742,_0x3558ee,_0x29cf44){for(const _0x5a8b3d of this['source']['getOperations'](_0x198742,_0x3558ee))this['_handleOperation'](_0x5a8b3d,_0x29cf44);for(const _0x576e86 of this['_diffRoots']['values']())_0x576e86['markers']['clear']();for(const [_0x36e3af,_0x165e4e]of this['_markers'])this['_diffRoots']['get'](_0x165e4e['root']['rootName'])['markers']['set'](_0x36e3af,_0x165e4e['clone']());const _0x22f97a=new Map(),_0x427185=new Map();for(const [_0xc9c66d,_0x5a5611]of this['_diffRoots'])_0x22f97a['set'](_0xc9c66d,St(_0x5a5611)),_0x427185['set'](_0xc9c66d,this['_diffRootsAttributes']['get'](_0xc9c66d));this['_saveMetaData'](_0x3558ee,_0x22f97a,this['_markers'],_0x427185);}_getPreviousFrom(_0x5ab4d4){const _0x27990c=Array['from'](this['_savedMetaData']['keys']());_0x27990c['sort']((_0x5de164,_0x3ee46c)=>_0x5de164-_0x3ee46c),_0x27990c['reverse']();for(const _0x31be91 of _0x27990c)if(_0x31be91<_0x5ab4d4)return _0x31be91;return Number['NEGATIVE_INFINITY'];}['_copyMarkers'](_0x4b278f,_0x2bbe05){const _0x436362=Array['from'](_0x2bbe05['markers'])['map'](([_0x63b139,_0x5e037c])=>[_0x63b139,_0x3c9bdd(_0x5e037c,_0x4b278f)]);_0x4b278f['markers']=new Map(_0x436362);}_transformMarkers(_0x2bb28a){for(const _0x5c094f of this['_markers']['values']()){const _0xd4af9b=_0x5c094f['getTransformedByOperation'](_0x2bb28a),_0x54eeca=_0x390c0d['_createFromRanges'](_0xd4af9b);_0x5c094f['start']=_0x54eeca['start'],_0x5c094f['end']=_0x54eeca['end'];}}_handleOperation(_0x4028a2,_0x58252e){if('addRoot'!=_0x4028a2['type']&&'detachRoot'!=_0x4028a2['type']){if('insert'==_0x4028a2['type']){const _0x3b7085=_0x4028a2['position']['root'],_0x71f2b=_0x3b7085['rootName'],_0x230ba3=_0x3b7085['name'];this['_diffRoots']['has'](_0x71f2b)||(this['_diffRoots']['set'](_0x71f2b,Et(_0x71f2b,_0x230ba3,!0x0)),this['_diffRootsAttributes']['set'](_0x71f2b,{}),_0x58252e&&this['_idsRoots']['set'](_0x71f2b,Et(_0x71f2b,_0x230ba3,!0x0)));}else{if('addRootAttribute'==_0x4028a2['type']||'removeRootAttribute'==_0x4028a2['type']||'changeRootAttribute'==_0x4028a2['type'])return void this['_handleRootAttributeOperation'](_0x4028a2);'marker'==_0x4028a2['type']&&this['_handleMarkerOperation'](_0x4028a2);}if('marker'!==_0x4028a2['type']){const _0x4b720a=this['_cloneOperation'](_0x4028a2,this['_diffRoots']);_0x4b720a['_execute'](),this['_transformMarkers'](_0x4b720a);}if(_0x58252e)switch(_0x4028a2['type']){case'insert':this['_handleInsertOperation'](_0x4028a2);break;case'move':case'remove':case'reinsert':this['_handleMoveOperation'](_0x4028a2);break;case'merge':this['_handleMergeOperation'](_0x4028a2);break;case'split':this['_handleSplitOperation'](_0x4028a2);}}else this['_handleRootOperation'](_0x4028a2,_0x58252e);}_cloneOperation(_0x464461,_0x1b8e59){const _0x359bbf=_0x464461['clone']();return _0x359bbf['_authorId']=_0x464461['_authorId'],_0x359bbf['_aiSource']=_0x464461['_aiSource'],_0x359bbf['baseVersion']=null,_0x51ed69(_0x359bbf,_0x1b8e59),_0x359bbf;}_getBaseVids(_0xbe4dbc){return _0xbe4dbc['map'](_0x28a8b2=>{const _0x306ae2=this['_getVidAttributeName'](_0x28a8b2);return Number(_0x28a8b2['item']['getAttribute'](_0x306ae2));});}_generateTape(_0x5159a9,_0x38b1ee){if(_0x5159a9['is']('element','$text'))_0x38b1ee['push']({'item':_0x5159a9,'type':'text'});else{_0x5159a9['is']('element')&&_0x38b1ee['push']({'item':_0x5159a9,'type':'elementStart'});for(const _0x11282b of _0x5159a9['getChildren']())this['_generateTape'](_0x11282b,_0x38b1ee);_0x5159a9['is']('element')&&_0x38b1ee['push']({'item':_0x5159a9,'type':'elementEnd'});}return _0x38b1ee;}_getState(){const _0x4e9f4f=new Map(this['_touched']),_0x24023c=new Map(_0x4e9f4f),_0x40ee3e=new Map(),_0x5a1178={'insertions':{},'deletions':{}},_0x1bd158={'insertions':{},'deletions':{}},_0x36d154=new Map(),_0x518d67=new Set([...this['_baseRoots']['keys'](),...this['_diffRoots']['keys']()]),_0x5e64c6=new Map();_0x518d67['delete']('$graveyard');for(const _0xc60760 of _0x518d67){const _0x4df9e6=(this['_diffRoots']['get'](_0xc60760)??this['_baseRoots']['get'](_0xc60760))['name'],_0x59fe49=this['_diffRoots']['get'](_0xc60760)||Et(_0xc60760,_0x4df9e6,!0x1),_0x2fe637=this['_baseRoots']['get'](_0xc60760)||Et(_0xc60760,_0x4df9e6,!0x1);_0x59fe49['isAttached']()||_0x2fe637['isAttached']()?(_0x5e64c6['set'](_0xc60760,_0x4df9e6),_0x5a1178['insertions'][_0xc60760]=St(_0x59fe49),_0x5a1178['deletions'][_0xc60760]=St(_0x2fe637),this['_copyMarkers'](_0x5a1178['deletions'][_0xc60760],_0x2fe637),this['_copyMarkers'](_0x5a1178['insertions'][_0xc60760],_0x59fe49),_0x1bd158['insertions'][_0xc60760]=this['_generateTape'](this['_idsRoots']['get'](_0xc60760),[]),_0x1bd158['deletions'][_0xc60760]=this['_generateTape'](this['_baseIdsRoots']['get'](_0xc60760)||Et(_0xc60760,_0x4df9e6,!0x1),[])):_0x518d67['delete'](_0xc60760);}for(const _0x44277f of _0x518d67){const _0x11eda5=_0x1bd158['insertions'][_0x44277f];for(const _0x11fa81 of _0x11eda5){const _0x14a6b9=this['_getVidAttributeName'](_0x11fa81),_0x502fe0=_0x11fa81['item']['getAttribute'](_0x14a6b9);_0x24023c['delete'](_0x502fe0),_0x502fe0>=this['_startingRevisionId']&&_0x40ee3e['set'](_0x502fe0,_0x4e9f4f['get'](_0x502fe0));}}for(const _0x455de7 of _0x518d67){const _0x5a6b37=_0x1bd158['insertions'][_0x455de7],_0x2d98a3=this['_getBaseVids'](_0x1bd158['deletions'][_0x455de7]);let _0x15e2a3=0x0;for(const _0x2ee9e0 of _0x5a6b37){const _0x3e4d7d=this['_getVidAttributeName'](_0x2ee9e0),_0x13b357=_0x2ee9e0['item']['getAttribute'](_0x3e4d7d);if(!_0x40ee3e['has'](_0x13b357)&&!_0x36d154['has'](_0x13b357)){if(_0x24023c['has'](_0x13b357))_0x15e2a3++;else{if(_0x13b357!=_0x2d98a3[_0x15e2a3]){const _0x9deba1=_0x4e9f4f['get'](_0x13b357)||_0x4e9f4f['get'](_0x2d98a3[_0x15e2a3]);for(;_0x13b357!=_0x2d98a3[_0x15e2a3];)_0x24023c['has'](_0x2d98a3[_0x15e2a3])||(_0x36d154['set'](_0x2d98a3[_0x15e2a3],_0x9deba1),_0x4e9f4f['set'](_0x2d98a3[_0x15e2a3],_0x9deba1)),_0x15e2a3++;}_0x15e2a3++;}}}}for(const _0x2d503b of _0x518d67){const _0x1fbcf7=_0x1bd158['insertions'][_0x2d503b];for(const _0x568996 of _0x1fbcf7){const _0x24a9f2=this['_getVidAttributeName'](_0x568996),_0x1d442f=_0x568996['item']['getAttribute'](_0x24a9f2);if(_0x36d154['has'](_0x1d442f)){const _0x28cd17=_0x36d154['get'](_0x1d442f);_0x24023c['has'](_0x1d442f)||_0x24023c['set'](_0x1d442f,{..._0x28cd17}),_0x40ee3e['set'](_0x1d442f,{..._0x28cd17});}}}for(const _0x3c78da of _0x24023c['keys']())_0x3c78da>=this['_startingRevisionId']&&_0x24023c['delete'](_0x3c78da);const _0x5389fe=new Map();for(const _0x30a782 of _0x518d67){let _0x3c1eaa=_0x1bd158['insertions'][_0x30a782];for(const _0x1addb3 of _0x3c1eaa)if(_0x1addb3['item']['is']('element','tableCell')){const _0x300b6a=this['_getVidAttributeName'](_0x1addb3),_0x19f6b1=_0x1addb3['item']['getAttribute'](_0x300b6a);if(_0x40ee3e['has'](_0x19f6b1)){const _0x4384be=_0x1addb3['item']['parent']['parent']['getAttribute']('vid_start'),_0x4b93d1=_0x40ee3e['get'](_0x19f6b1),_0x496ec6=_0x5389fe['get'](_0x4384be)||{'users':new Set(),'aiSource':null};_0x496ec6['users']['add'](_0x4b93d1['userId']),_0x496ec6['aiSource']=_0x496ec6['aiSource']||_0x4b93d1['aiSource']||null,_0x5389fe['set'](_0x4384be,_0x496ec6);}}_0x3c1eaa=_0x1bd158['deletions'][_0x30a782];for(const _0x501d92 of _0x3c1eaa)if(_0x501d92['item']['is']('element','tableCell')){const _0x16ea4a=this['_getVidAttributeName'](_0x501d92),_0x17afc0=_0x501d92['item']['getAttribute'](_0x16ea4a);if(_0x24023c['has'](_0x17afc0)){const _0x2cdd0d=_0x501d92['item']['parent']['parent']['getAttribute']('vid_start'),_0x46a7bc=_0x24023c['get'](_0x17afc0),_0x414de0=_0x5389fe['get'](_0x2cdd0d)||{'users':new Set(),'aiSource':null};_0x414de0['users']['add'](_0x46a7bc['userId']),_0x414de0['aiSource']=_0x414de0['aiSource']||_0x46a7bc['aiSource']||null,_0x5389fe['set'](_0x2cdd0d,_0x414de0);}}for(const _0x391faf of _0x5389fe['keys']())(_0x40ee3e['has'](_0x391faf)||_0x24023c['has'](_0x391faf))&&_0x5389fe['delete'](_0x391faf);}for(const _0x114c4e of _0x518d67){const _0x47e259=_0x1bd158['insertions'][_0x114c4e];let _0x51cb5a=null,_0x2d21c7=null,_0x4c46a5=null;for(const _0x170342 of _0x47e259){const _0x1c5e24=this['_getVidAttributeName'](_0x170342),_0x35d51f=_0x170342['item']['getAttribute'](_0x1c5e24),_0x275e89=_0x5389fe['get'](_0x35d51f);if(_0x275e89&&'elementStart'==_0x170342['type']&&(_0x51cb5a=Array['from'](_0x275e89['users'])[0x0],_0x2d21c7=_0x275e89['aiSource'],_0x4c46a5=_0x170342['item']['getAttribute']('vid_end')),_0x51cb5a){const _0x4fe191=_0x2d21c7||_0x24023c['get'](_0x35d51f)?.['aiSource']||null,_0x100791=_0x2d21c7||_0x40ee3e['get'](_0x35d51f)?.['aiSource']||null;_0x24023c['set'](_0x35d51f,{'userId':_0x51cb5a,'aiSource':_0x4fe191}),_0x40ee3e['set'](_0x35d51f,{'userId':_0x51cb5a,'aiSource':_0x100791});}_0x35d51f==_0x4c46a5&&(_0x51cb5a=null,_0x4c46a5=null);}}const _0x16ba18={},_0x3aceab=new Set();for(const _0x501865 of _0x518d67){const _0x163e43=_0x5a1178['deletions'][_0x501865],_0x708316=_0x5a1178['insertions'][_0x501865];for(const {userId:_0x2f861c}of this['_touchedMarkers']['values']())null!==_0x2f861c&&_0x3aceab['add'](_0x2f861c);for(const {userId:_0x24757d}of this['_touchedRoots']['values']())null!==_0x24757d&&_0x3aceab['add'](_0x24757d);const _0x3578c0={};this['_markChanges'](_0x708316,_0x1bd158['insertions'][_0x501865],_0x40ee3e,'insertion',_0x3aceab,_0x3578c0),this['_markChanges'](_0x163e43,_0x1bd158['deletions'][_0x501865],_0x24023c,'deletion',_0x3aceab,_0x3578c0),this['_collectSuggestionAiSources'](_0x708316,_0x3578c0),this['_collectSuggestionAiSources'](_0x163e43,_0x3578c0),_0x16ba18[_0x501865]={'insertions':this['_prepareViewToSave'](_0x708316),'deletions':this['_prepareViewToSave'](_0x163e43),'attachChange':this['_touchedRoots']['get'](_0x501865)||null,'attributesBefore':_0x144f08(this['_baseRootsAttributes']['get'](_0x501865))||{},'attributesAfter':_0x144f08(this['_diffRootsAttributes']['get'](_0x501865)),'rootElementName':_0x5e64c6['get'](_0x501865),'aiSources':_0x3578c0};}const _0x20146b=Array['from'](_0x40ee3e['values']())['some'](_0x1e5429=>!(!_0x1e5429||!_0x1e5429['aiSource']))||Array['from'](_0x24023c['values']())['some'](_0x13a76f=>!(!_0x13a76f||!_0x13a76f['aiSource']))||Array['from'](this['_touchedMarkers']['keys']())['some'](_0x273210=>this['_aiTouchedMarkers']['has'](_0x273210));return{'diffData':_0x16ba18,'authorsIds':Array['from'](_0x3aceab),'hasAIChanges':_0x20146b};}_collectSuggestionAiSources(_0x1ad9fa,_0x2fffef){const _0x222ee4=_0x1ad9fa['markers'];for(const _0x1b5968 of _0x222ee4['keys']()){if(!_0x1b5968['startsWith']('suggestion:'))continue;if(!this['_touchedMarkers']['has'](_0x1b5968))continue;const _0x13c1ba=this['_aiTouchedMarkers']['get'](_0x1b5968);_0x13c1ba&&(_0x2fffef[_0x1b5968]=_0x13c1ba);}}_processRootBeforeSave(_0x21c2df){for(const [,_0x172d6b]of _0x21c2df['markers']){const _0x402a07=_0x172d6b['start']['getAncestors']()['filter'](_0x49b13e=>'tableCell'==_0x49b13e['name']);for(const _0x5c21c0 of _0x402a07)0x1==_0x5c21c0['childCount']&&_0x5c21c0['getChild'](0x0)['is']('element','paragraph')&&_0x5c21c0['getChild'](0x0)['_setAttribute']('keepParagraph',!0x0);}}['_prepareViewToSave'](_0x34b23f){this['_processRootBeforeSave'](_0x34b23f);const _0x420399=this['editor']['data']['toView'](_0x34b23f,{}),_0x314e8b=Array['from'](_0x420399['getChildren']())['map'](_0xfc2f8d=>this['_getViewJson'](_0xfc2f8d));return JSON['stringify'](_0x314e8b);}_getViewJson(_0x3db8c1){if(_0x3db8c1['is']('$text'))return _0x3db8c1['data'];{const _0x1e0d0c=this['editor']['plugins']['get']('RevisionHistoryUtils'),_0x5691a0=_0x3db8c1,_0x3fc017=this['editor']['data']['htmlProcessor']['domConverter'],_0x4b3b9e={'type':_0x1e0d0c['_getTypeCharForViewElement'](_0x5691a0),'name':_0x5691a0['name'],'attributes':Array['from'](_0x5691a0['getAttributes']()),'children':Array['from'](_0x5691a0['getChildren']())['map'](_0x58b8c3=>this['_getViewJson'](_0x58b8c3))};if(_0x3db8c1['is']('uiElement')&&'$comment'!=_0x3db8c1['name']){const _0x2bead4=_0x3db8c1['render'](_0x3fc017['domDocument'],_0x3fc017);_0x4b3b9e['children']['push'](_0x2bead4['outerHTML']);}else{if(_0x3db8c1['is']('rawElement')){const _0x5ae06d=_0x3fc017['domDocument']['createElement'](_0x5691a0['name']);_0x3db8c1['render'](_0x5ae06d,_0x3fc017),_0x4b3b9e['children']['push'](_0x5ae06d['innerHTML']);}}const _0x23d490=Array['from'](_0x5691a0['getCustomProperties']());_0x23d490['length']>0x0&&(_0x4b3b9e['customProperties']=_0x23d490);const _0x315294=_0x5691a0['getFillerOffset']();return null!==_0x315294&&(_0x4b3b9e['fillerOffset']=_0x315294),_0x4b3b9e;}}['_markChanges'](_0x5e8e46,_0x237007,_0x31a179,_0x6de0f8,_0x48875f,_0x3863bf){let _0x3f8558=null,_0x23baaa=null,_0x5cccca=0x0;const _0x84e60b=this['editor']['model'];for(let _0x143651=0x0;_0x143651<_0x237007['length'];_0x143651++){const _0x485e5b=this['_getVidAttributeName'](_0x237007[_0x143651]),_0x137fd3=_0x237007[_0x143651]['item']['getAttribute'](_0x485e5b),_0x448ec3=_0x31a179['get'](_0x137fd3),_0x21fb0f=_0x143651==_0x237007['length']-0x1;!_0x3f8558&&_0x448ec3&&(_0x3f8558=_0x448ec3,_0x23baaa=_0x237007[_0x143651]);const _0x45e9de=!!_0x3f8558&&!!_0x448ec3&&_0x448ec3['userId']!=_0x3f8558['userId'],_0x5c5d07=!!_0x3f8558&&!!_0x448ec3&&_0x448ec3['aiSource']!=_0x3f8558['aiSource'];_0x3f8558&&(!_0x448ec3||_0x45e9de||_0x5c5d07)&&(_0x138ff5(_0x448ec3,Ot(_0x23baaa,_0x5e8e46,_0x84e60b),Ot(_0x237007[_0x143651],_0x5e8e46,_0x84e60b)),_0x3f8558=_0x448ec3||null,_0x23baaa=_0x448ec3?_0x237007[_0x143651]:null),_0x3f8558&&_0x21fb0f&&_0x138ff5(_0x448ec3,Ot(_0x23baaa,_0x5e8e46,_0x84e60b),Ct(_0x237007[_0x143651],_0x5e8e46,_0x84e60b));}function _0x138ff5(_0x10b518,_0x2ee86f,_0x5d54e8){const _0x42c349=_0x3f8558['userId'],_0x4c8d8a=_0x3f8558['aiSource'],_0x3ecfb3='revision:'+_0x6de0f8+':'+_0x42c349+':'+_0x5cccca++,_0xd56f84=_0x84e60b['createRange'](_0x2ee86f,_0x5d54e8);_0x5e8e46['markers']['set'](_0x3ecfb3,_0xd56f84),_0x4c8d8a&&(_0x3863bf[_0x3ecfb3]=_0x4c8d8a),null!==_0x42c349&&_0x48875f['add'](_0x42c349);}}_getVidAttributeName(_0x5ca80b){switch(_0x5ca80b['type']){case'elementStart':return'vid_start';case'elementEnd':return'vid_end';default:return'vid';}}_handleInsertOperation(_0x44c101){const _0x86551a=this['_idsRoots']['get'](_0x44c101['position']['root']['rootName']),_0x5918d8=_0x289722(_0x44c101['position'],_0x86551a),_0x767c79=null===_0x44c101['_authorId']?null:_0x44c101['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x4d3b68=_0x44c101['_aiSource']||null,_0x183946=_0x5918d8['parent'],_0x5a5f74=this['_revisionId'],_0x3a33a6=[];for(const _0x3b9c47 of _0x44c101['nodes'])if(_0x3b9c47['is']('element'))_0x3a33a6['push'](this['_makeIdsRoot'](_0x3b9c47));else{for(let _0x13dadd=0x0;_0x13dadd<_0x3b9c47['offsetSize'];_0x13dadd++)_0x3a33a6['push'](new _0x28c730('$text',{'vid':this['_revisionId']++}));}const _0xb3c3f8=this['_revisionId'];for(let _0x52387e=_0x5a5f74;_0x52387e<_0xb3c3f8;_0x52387e++)this['_touched']['set'](_0x52387e,{'userId':_0x767c79,'aiSource':_0x4d3b68});_0x183946['_insertChild'](_0x5918d8['offset'],_0x3a33a6);}_setTouched(_0x2ee003,_0x209544,_0x39ac0f){this['_touched']['set'](_0x2ee003,{'userId':_0x209544,'aiSource':_0x39ac0f||this['_touched']['get'](_0x2ee003)?.['aiSource']||null});}_handleMoveOperation(_0x2b49f0){(_0x2b49f0=this['_cloneOperation'](_0x2b49f0,this['_idsRoots']))['_execute']();const _0x16a2d6=null===_0x2b49f0['_authorId']?null:_0x2b49f0['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x116a01=_0x2b49f0['_aiSource']||null,_0x1e8b83=_0x2b49f0['getMovedRangeStart'](),_0x4f7b4c=_0x1e8b83['parent'],_0x46c142=_0x1e8b83['offset'],_0xbf0a88=(_0x1a8488,_0x109f9e,_0x5a8760)=>{for(let _0x2065d5=_0x109f9e;_0x2065d5<_0x5a8760;_0x2065d5++){const _0x1040c1=_0x1a8488['getChild'](_0x2065d5);_0x1040c1['is']('element','$text')?this['_setTouched'](_0x1040c1['getAttribute']('vid'),_0x16a2d6,_0x116a01):(this['_setTouched'](_0x1040c1['getAttribute']('vid_start'),_0x16a2d6,_0x116a01),_0xbf0a88(_0x1040c1,0x0,_0x1040c1['childCount']),this['_setTouched'](_0x1040c1['getAttribute']('vid_end'),_0x16a2d6,_0x116a01));}};_0xbf0a88(_0x4f7b4c,_0x46c142,_0x46c142+_0x2b49f0['howMany']);}_handleMergeOperation(_0x4e5647){const _0x5c4ec2=null===(_0x4e5647=this['_cloneOperation'](_0x4e5647,this['_idsRoots']))['_authorId']?null:_0x4e5647['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x4a8bbf=_0x4e5647['_aiSource']||null,_0x65a552=_0x4e5647['targetPosition']['parent'],_0x854fe5=_0x4e5647['sourcePosition']['parent'],_0x4e3b6f=_0x65a552['getAttribute']('vid_end'),_0x4dee27=_0x854fe5['getAttribute']('vid_start');_0x65a552['_setAttribute']('vid_end',_0x854fe5['getAttribute']('vid_end')),_0x854fe5['_setAttribute']('vid_end',_0x4e3b6f),this['_setTouched'](_0x4dee27,_0x5c4ec2,_0x4a8bbf),this['_setTouched'](_0x4e3b6f,_0x5c4ec2,_0x4a8bbf),_0x4e5647['_execute']();}_handleSplitOperation(_0x26eda0){const _0x249258=null===(_0x26eda0=this['_cloneOperation'](_0x26eda0,this['_idsRoots']))['_authorId']?null:_0x26eda0['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x48a760=_0x26eda0['_aiSource']||null,_0x242121=_0x26eda0['graveyardPosition'],_0x45f6d2=_0x26eda0['splitPosition']['parent'];_0x26eda0['_execute']();const _0x4a74cf=_0x45f6d2['getAttribute']('vid_end'),_0x371e07=_0x26eda0['insertionPosition']['nodeAfter'];if(_0x242121){const _0x299327=_0x371e07['getAttribute']('vid_end'),_0x548501=_0x45f6d2['getAttribute']('vid_end');_0x45f6d2['_setAttribute']('vid_end',_0x299327),_0x371e07['_setAttribute']('vid_end',_0x548501),this['_setTouched'](_0x45f6d2['getAttribute']('vid_end'),_0x249258,_0x48a760),this['_setTouched'](_0x371e07['getAttribute']('vid_start'),_0x249258,_0x48a760);}else{const _0x177831=this['_revisionId']++,_0x583e05=this['_revisionId']++;_0x45f6d2['_setAttribute']('vid_end',_0x177831),_0x371e07['_setAttribute']('vid_start',_0x583e05),_0x371e07['_setAttribute']('vid_end',_0x4a74cf),this['_setTouched'](_0x177831,_0x249258,_0x48a760),this['_setTouched'](_0x583e05,_0x249258,_0x48a760);}}_handleMarkerOperation(_0x5e4bad){if(!_0x5e4bad['affectsData'])return;const _0x255efd=(_0x5e4bad=this['_cloneOperation'](_0x5e4bad,this['_diffRoots']))['oldRange']?_0x5e4bad['oldRange']['root']:null,_0x65a1aa=_0x5e4bad['newRange']?_0x5e4bad['newRange']['root']:null;_0x255efd&&this['_markers']['delete'](_0x5e4bad['name']),_0x65a1aa&&this['_markers']['set'](_0x5e4bad['name'],_0x5e4bad['newRange']['clone']());const _0x1c5236=null===_0x5e4bad['_authorId']?null:_0x5e4bad['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x396d98=_0x5e4bad['name'];if(_0x5e4bad['_aiSource']&&this['_aiTouchedMarkers']['set'](_0x396d98,_0x5e4bad['_aiSource']),!this['_touchedMarkers']['has'](_0x396d98))return void this['_touchedMarkers']['set'](_0x396d98,{'range':_0x5e4bad['oldRange'],'userId':_0x1c5236});const _0x3f9c74=this['_touchedMarkers']['get'](_0x396d98),_0x1d78b6=_0x3f9c74['range'],_0x3aec5b=_0x5e4bad['newRange'];null==_0x1d78b6&&null==_0x3aec5b||_0x1d78b6&&_0x3aec5b&&_0x1d78b6['isEqual'](_0x3aec5b)?this['_touchedMarkers']['delete'](_0x5e4bad['name']):_0x3f9c74['userId']=_0x1c5236;}_handleRootOperation(_0x30befd,_0x38e144){this['_diffRoots']['has'](_0x30befd['rootName'])?this['_diffRoots']['get'](_0x30befd['rootName'])['_isAttached']=_0x30befd['isAdd']:(this['_diffRoots']['set'](_0x30befd['rootName'],Et(_0x30befd['rootName'],_0x30befd['elementName'],!0x0)),this['_diffRootsAttributes']['set'](_0x30befd['rootName'],{}),_0x38e144&&this['_idsRoots']['set'](_0x30befd['rootName'],Et(_0x30befd['rootName'],_0x30befd['elementName'],!0x0)));const _0x2cd72a=null===_0x30befd['_authorId']?null:_0x30befd['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x2772bb=this['_touchedRoots']['get'](_0x30befd['rootName']);_0x2772bb&&_0x2772bb['userId']===_0x2cd72a?this['_touchedRoots']['delete'](_0x30befd['rootName']):this['_touchedRoots']['set'](_0x30befd['rootName'],{'userId':_0x2cd72a,'isAttached':_0x30befd['isAdd']});}_handleRootAttributeOperation(_0x14a676){const _0x2f7e6d=this['_diffRootsAttributes']['get'](_0x14a676['root']['rootName']);null===_0x14a676['newValue']?delete _0x2f7e6d[_0x14a676['key']]:_0x2f7e6d[_0x14a676['key']]=_0x14a676['newValue'];}};function St(_0x5990bc){const _0x1f9605=Et(_0x5990bc['rootName'],_0x5990bc['name'],_0x5990bc['isAttached']());for(const _0x5521a2 of _0x5990bc['getChildren']()){const _0x4da94c=_0x5521a2['_clone'](!0x0);_0x1f9605['_appendChild'](_0x4da94c);}return _0x1f9605;}function Et(_0x2b6500,_0x1f8ddf,_0x52b115=!0x0){const _0x402f05=new _0x4acbd6();return _0x402f05['rootName']=_0x2b6500,_0x402f05['name']=_0x1f8ddf,_0x402f05['_isAttached']=_0x52b115,_0x402f05['isAttached']=()=>_0x402f05['_isAttached'],_0x402f05;}function Ot(_0x1a7667,_0x517b5b,_0x58e493){const _0x116357='elementEnd'==_0x1a7667['type']?_0x58e493['createPositionAt'](_0x1a7667['item'],'end'):_0x58e493['createPositionBefore'](_0x1a7667['item']);return _0x58e493['createPositionFromPath'](_0x517b5b,_0x116357['path'],_0x116357['stickiness']);}function Ct(_0x575c94,_0x10db76,_0x36944a){const _0x57008b='elementStart'==_0x575c94['type']?_0x36944a['createPositionAt'](_0x575c94['item'],0x0):_0x36944a['createPositionAfter'](_0x575c94['item']);return _0x36944a['createPositionFromPath'](_0x10db76,_0x57008b['path'],_0x57008b['stickiness']);}const Nt=/* #__PURE__ -- @preserve */
|
|
25
|
-
|
|
26
|
-
_0x57c0bb();var Mt=class extends Tt{['id'];author;type;data;rootName;constructor(_0x5bbf4d){super(),this['id']=_0x5bbf4d['id']||_0x5289a7(),this['author']=_0x5bbf4d['author'],this['type']=_0x5bbf4d['type'],this['data']=_0x5bbf4d['data']||{},this['rootName']=_0x5bbf4d['rootName'],this['set']('createdAt',_0x5bbf4d['createdAt']);}toJSON(){return{'id':this['id'],'authorId':this['author']['id'],'type':this['type'],'data':this['data'],'createdAt':this['createdAt']};}},Ht=class{['newRevisionId'];['oldRevisionId'];['changes'];constructor(_0x1354ab,_0x330bd8){this['newRevisionId']=_0x1354ab,this['oldRevisionId']=_0x330bd8,this['changes']=new _0x520f62();}_setChanges(_0xd948e7){for(const _0x2e1c23 of _0xd948e7)this['changes']['add'](_0x2e1c23);}},Pt=class extends _0x3ccb16{repository;adapter=null;_getVisibleCommentThreadIds=null;_utils;_activeViewTarget;['_changeView'];['_changeIdToChange'];['_balloon'];_showCommentHighlights;static get['pluginName'](){return'RevisionViewer';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x312567,_0x300371,bt,Rt];}constructor(_0x4f7b14){super(_0x4f7b14),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',(_0x6ab1ff,_0x393d7a,_0x181072)=>{this['activeChange']=null,this['activeView']=null,this['editor']['editing']['view']['change'](_0x45c23b=>{for(const _0x4d611f of this['editor']['editing']['view']['document']['roots'])_0x181072?_0x45c23b['removeClass']('ck-editor__editable__overlay',_0x4d611f):_0x45c23b['addClass']('ck-editor__editable__overlay',_0x4d611f);});}),this['bind']('isNavigationMode')['to'](this,'activeChange',_0x57b56f=>null!==_0x57b56f),this['bind']('currentChangeNumber')['to'](this,'isReady',this,'diff',this,'activeChange',(_0x42ade3,_0x1e2a59,_0x4bb0c2)=>_0x42ade3&&_0x4bb0c2?_0x1e2a59['changes']['getIndex'](_0x4bb0c2):0x0),this['bind']('numberOfChanges')['to'](this,'isReady',this,'diff',(_0x44d005,_0x599bcf)=>_0x44d005?_0x599bcf['changes']['length']:0x0),this['_changeView']=null,this['_changeIdToChange']=new Map(),this['_balloon']=this['editor']['plugins']['get'](_0x300371),this['_showCommentHighlights']=this['editor']['config']['get']('revisionHistory.showCommentHighlights');}init(){const _0x416e0d=this['editor'],_0x2b8094=new $t(_0x416e0d,{'direction':'backward'}),_0x466b55=new $t(_0x416e0d,{'direction':'forward'});_0x416e0d['commands']['add']('showPreviousChange',_0x2b8094),_0x416e0d['commands']['add']('showNextChange',_0x466b55),_0x416e0d['commands']['add']('restoreRevision',new Ft(_0x416e0d)),this['on']('change:numberOfChanges',()=>{_0x2b8094['refresh'](),_0x466b55['refresh']();}),this['_setConversion'](),this['_initInteractions'](),_0x416e0d['enableReadOnlyMode']('revision-viewer'),_0x416e0d['plugins']['has']('WidgetToolbarRepository')&&_0x416e0d['plugins']['get']('WidgetToolbarRepository')['forceDisabled']('revision-viewer');}async getRevisionDocumentData(_0x12b329){return await this['_utils']['loadRevisionData'](_0x12b329,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x12b329);}async getRevisionRootsAttributes(_0x39eed8){return await this['_utils']['loadRevisionData'](_0x39eed8,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x39eed8);}async['compare'](_0x3545d5,_0x3632c8,_0x3eb166=!0x1){if(!this['isEnabled'])return;const _0x377f51=this['diff'],_0x5eae7d=this['repository'],_0x14340f='string'==typeof _0x3545d5?_0x5eae7d['getRevision'](_0x3545d5):_0x3545d5,_0x5a1b31='string'==typeof _0x3632c8?_0x5eae7d['getRevision'](_0x3632c8):_0x3632c8,_0x1c6f4f=_0x14340f['id'],_0x79667b=_0x5a1b31?_0x5a1b31['id']:null;if(!_0x3eb166&&this['diff']&&this['diff']['newRevisionId']===_0x1c6f4f&&this['diff']['oldRevisionId']===_0x79667b)return Promise['resolve']();this['isReady']=!0x1,this['activeView']=null,this['activeChange']=null,this['diff']=new Ht(_0x1c6f4f,_0x79667b);const _0x3bdfbf=this['_getRevisionsRange'](_0x14340f,_0x5a1b31,!0x0)['map'](_0x2a51b7=>this['_utils']['loadRevisionData'](_0x2a51b7,this['adapter']));return _0x3bdfbf['push'](new Promise(_0x2b36af=>{setTimeout(_0x2b36af,0x14);})),Promise['all'](_0x3bdfbf)['then'](()=>{if(!this['isEnabled'])return;this['_cleanUp']();const _0x2191a0=this['_getDiff'](_0x1c6f4f,_0x79667b);this['_cleanUpCommentMarkers'](_0x2191a0);for(const _0x2097c4 of _0x2191a0['changes'])this['_changeIdToChange']['set'](_0x2097c4['id'],_0x2097c4);this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x5cf956=>{for(const _0x135b9b of this['editor']['model']['document']['getRootNames']())_0x5cf956['detachRoot'](_0x135b9b);for(const _0x10d770 of Object['keys'](_0x2191a0['model'])){const _0xa1893a=_0x2191a0['model'][_0x10d770]['name'],_0x478667=_0x5cf956['addRoot'](_0x10d770,_0xa1893a);for(const _0x4f0107 of Object['keys'](_0x2191a0['attributes'][_0x10d770]))_0x5cf956['setAttribute'](_0x4f0107,_0x2191a0['attributes'][_0x10d770][_0x4f0107],_0x478667);_0x5cf956['insert'](_0x2191a0['model'][_0x10d770],_0x478667,0x0);}}),this['diff']['_setChanges'](this['_sortAndFilterDiffChanges'](_0x2191a0['changes'])),this['isReady']=!0x0;})['catch'](_0x1598f6=>{console['error'](_0x1598f6),this['_cleanUp'](),_0x377f51&&(this['diff']=_0x377f51),this['isReady']=!0x0;});}addRevisionData(_0x579f5e,_0xaca35a){const _0x350fb9=this['repository']['createRevision'](_0x579f5e);return _0x350fb9['on']('_update',(_0x33cd96,_0x39fae6,_0x3db29e)=>_0xaca35a(_0x39fae6,_0x3db29e,_0x350fb9)),this['repository']['addRevision'](_0x350fb9),_0x350fb9;}['_cleanUp'](){this['activeChange']=null,this['_cleanMarkers'](),this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=null,this['_changeIdToChange']['clear'](),this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x3f4478=>{for(const _0x426053 of this['editor']['model']['document']['getRootNames']())_0x3f4478['detachRoot'](_0x426053);});}_cleanUpCommentMarkers(_0x7c73f7){if(!this['_showCommentHighlights']||!this['_getVisibleCommentThreadIds'])return;const _0x5ddc77=this['_getVisibleCommentThreadIds']();for(const _0xa78cf9 of Object['values'](_0x7c73f7['model']))for(const _0x1ce0a7 of Array['from'](_0xa78cf9['markers']['keys']()))_0x1ce0a7['startsWith']('revision-comment:')&&!_0x5ddc77['has'](Ut(_0x1ce0a7))&&_0xa78cf9['markers']['delete'](_0x1ce0a7);}_sortAndFilterDiffChanges(_0x9bc8d9){const _0x3ed016=[],_0xa2c906=new Map();for(const _0x279104 of this['editor']['model']['document']['getRootNames']()){const _0x271991=this['editor']['editing']['view']['getDomRoot'](_0x279104);if(!_0x271991)continue;const _0x17c5df=_0x271991['getClientRects']()['item'](0x0);_0x17c5df&&(_0x3ed016['push'](_0x279104),_0xa2c906['set'](_0x279104,_0x17c5df));}return _0x3ed016['sort']((_0x3eece9,_0x3bdfd0)=>{const _0x1e843d=_0xa2c906['get'](_0x3eece9),_0x13c10e=_0xa2c906['get'](_0x3bdfd0);return _0x1e843d['y']-_0x13c10e['y']||_0x1e843d['x']-_0x13c10e['x'];}),(_0x9bc8d9=_0x9bc8d9['filter'](_0xe9ffa1=>_0x3ed016['includes'](_0xe9ffa1['rootName'])))['sort']((_0x53c7f0,_0x2c0f2a)=>_0x3ed016['indexOf'](_0x53c7f0['rootName'])-_0x3ed016['indexOf'](_0x2c0f2a['rootName'])),_0x9bc8d9;}['_makeTape'](_0x5b387b,_0x197dc2={}){const _0x4224f5=Array['from'](_0x5b387b['markers'])['filter'](([_0x1831bb,_0x1c1bbc])=>_0x1831bb['startsWith']('revision:')&&!_0x1c1bbc['isCollapsed']),_0x53fb94=Array['from'](this['editor']['model']['createRangeIn'](_0x5b387b)['getWalker']({'singleCharacters':!0x0}));if(0x0!=_0x4224f5['length'])for(const _0x540970 of _0x53fb94){const [_0xae4fe8,_0x2d22f9]=_0x4224f5[0x0],[,_0x941cba,_0x226aa8]=_0xae4fe8['split'](':'),_0x34aa19=_0x197dc2[_0xae4fe8]||null;if(_0x2d22f9['end']['isEqual'](_0x540970['nextPosition'])&&_0x4224f5['shift'](),(_0x540970['previousPosition']['isEqual'](_0x2d22f9['start'])||_0x540970['previousPosition']['isAfter'](_0x2d22f9['start']))&&('insertion'==_0x941cba?_0x540970['isAdded']={'userId':_0x226aa8,'aiSource':_0x34aa19}:'deletion'==_0x941cba&&(_0x540970['isRemoved']={'userId':_0x226aa8,'aiSource':_0x34aa19})),0x0==_0x4224f5['length'])break;}return _0x53fb94;}_refreshStartEndIndex(_0xd88482){const _0x30bbd6=new Map();for(let _0x3d5c81=0x0;_0x3d5c81<_0xd88482['length'];_0x3d5c81++)'text'===_0xd88482[_0x3d5c81]['type']?(_0xd88482[_0x3d5c81]['item']['startIndex']=_0x3d5c81,_0xd88482[_0x3d5c81]['item']['endIndex']=_0x3d5c81):('elementStart'===_0xd88482[_0x3d5c81]['type']?_0xd88482[_0x3d5c81]['item']['startIndex']=_0x3d5c81:'elementEnd'===_0xd88482[_0x3d5c81]['type']&&(_0xd88482[_0x3d5c81]['item']['endIndex']=_0x3d5c81),_0x30bbd6['set'](_0xd88482[_0x3d5c81]['id'],_0x3d5c81));for(const _0xa25a3e of _0x30bbd6['values']())'elementStart'===_0xd88482[_0xa25a3e]['type']?_0xd88482[_0xa25a3e]['item']['endIndex']=_0x30bbd6['get'](_0xd88482[_0xa25a3e]['pairId']):'elementEnd'===_0xd88482[_0xa25a3e]['type']&&(_0xd88482[_0xa25a3e]['item']['startIndex']=_0x30bbd6['get'](_0xd88482[_0xa25a3e]['pairId']));}['_processTape'](_0x2b9983){for(let _0x15bbd2=0x0;_0x15bbd2<_0x2b9983['length'];_0x15bbd2++){if('elementStart'===_0x2b9983[_0x15bbd2]['type'])_0x2b9983[_0x15bbd2]['item']['startIndex']=_0x15bbd2;else{if('elementEnd'===_0x2b9983[_0x15bbd2]['type']){_0x2b9983[_0x15bbd2]['item']['endIndex']=_0x15bbd2;const _0x7282a=_0x2b9983[_0x15bbd2]['item']['startIndex'];_0x2b9983[_0x7282a]['pairId']=_0x2b9983[_0x15bbd2]['id'],_0x2b9983[_0x15bbd2]['pairId']=_0x2b9983[_0x7282a]['id'];}else _0x2b9983[_0x15bbd2]['item']['startIndex']=_0x15bbd2,_0x2b9983[_0x15bbd2]['item']['endIndex']=_0x15bbd2,_0x2b9983[_0x15bbd2]['pairId']=null;}_0x2b9983[_0x15bbd2]['markersStart']||(_0x2b9983[_0x15bbd2]['markersStart']=[],_0x2b9983[_0x15bbd2]['markersEnd']=[]);}}_markInsertions(_0x4a92e7,_0x4f4162){const _0x214c30=_0x4a92e7['filter'](_0x40834f=>!_0x40834f['isAdded']);for(let _0x81d4b7=0x0;_0x81d4b7<_0x4f4162['length'];_0x81d4b7++)_0x4f4162[_0x81d4b7]['isAdded']&&(_0x214c30[_0x81d4b7]['isAdded']=_0x4f4162[_0x81d4b7]['isAdded']);}_getDiff(_0x1e8c3c,_0x28586d=null){const _0x200fa7=this['repository']['getRevision'](_0x1e8c3c),_0x21a9b2=_0x28586d?this['repository']['getRevision'](_0x28586d):null,_0xf84dbd=this['_getRevisionsRange'](_0x200fa7,_0x21a9b2),_0x4d59fa=_0xf84dbd[_0xf84dbd['length']-0x1],_0x15c9b4=new Map(),_0x1b4bc4={'model':{},'attributes':{},'changes':[]},_0x5304a4=new Set(),_0x1cadd5=new Map();for(let _0x2f967f=_0xf84dbd['length']-0x1;_0x2f967f>=0x0;_0x2f967f--){const _0x5181ec=_0xf84dbd[_0x2f967f];for(const _0x102f0f of Object['keys'](_0x5181ec['diffData']))if(_0x5181ec['diffData'][_0x102f0f]['attachChange']){const _0x29473f=_0x5181ec['diffData'][_0x102f0f]['attachChange'];_0x29473f['isAttached']?(_0x5304a4['add'](_0x102f0f),_0x1cadd5['has'](_0x102f0f)&&_0x1cadd5['get'](_0x102f0f)['userId']==_0x29473f['userId']?_0x1cadd5['delete'](_0x102f0f):_0x1cadd5['set'](_0x102f0f,_0x29473f)):_0x1cadd5['has'](_0x102f0f)?(_0x5304a4['delete'](_0x102f0f),_0x1cadd5['delete'](_0x102f0f)):(_0x5304a4['add'](_0x102f0f),_0x1cadd5['set'](_0x102f0f,_0x29473f));}else _0x5304a4['add'](_0x102f0f);}for(const _0x1edd16 of _0x5304a4){const _0x3a2cc1=_0x1cadd5['has'](_0x1edd16)&&!_0x1cadd5['get'](_0x1edd16)['isAttached'];let _0x21d8ef=_0x3a2cc1?_0xf84dbd['length']-0x1:0x0;const _0x5dcafd=_0x3a2cc1?-0x1:0x1;for(;_0xf84dbd[_0x21d8ef];){const _0x582105=_0xf84dbd[_0x21d8ef];if(_0x582105['diffData'][_0x1edd16]){const _0x51720b=_0x3a2cc1?_0x582105['diffData'][_0x1edd16]['attributesBefore']:_0x582105['diffData'][_0x1edd16]['attributesAfter'];_0x1b4bc4['attributes'][_0x1edd16]=_0x51720b?_0x144f08(_0x51720b):{};break;}_0x21d8ef+=_0x5dcafd;}}for(const _0x9a5fd9 of _0xf84dbd){_0x9a5fd9['model']={};for(const _0x566785 of _0x9a5fd9['authors'])_0x15c9b4['set'](_0x566785['id'],_0x566785);for(const _0x1c1475 of _0x5304a4){const _0x32958b=_0x9a5fd9['diffData'][_0x1c1475]?_0x9a5fd9['diffData'][_0x1c1475]['insertions']:'[]',_0x47fc86=_0x9a5fd9['diffData'][_0x1c1475]?_0x9a5fd9['diffData'][_0x1c1475]['deletions']:'[]',_0x4000a1=_0x9a5fd9['diffData'][_0x1c1475]?.['rootElementName']||'$root';_0x9a5fd9['model'][_0x1c1475]={'insertions':this['_utils']['_makeModelFromViewString'](_0x32958b,_0x4000a1),'deletions':this['_utils']['_makeModelFromViewString'](_0x47fc86,_0x4000a1)};}}for(const _0x56ccbd of _0x5304a4){let _0x3f7bd9=null,_0x155a94=0x0;const _0x3622fc=_0xf84dbd['map'](_0x1d54ac=>_0x1d54ac['diffData'][_0x56ccbd]?.['rootElementName'])['find'](_0x479b9b=>void 0x0!==_0x479b9b)||'$root',_0x5ed84b=new Map(Array['from'](_0x200fa7['model'][_0x56ccbd]['insertions']['markers'])['filter'](([_0x9c8357])=>!_0x9c8357['startsWith']('revision:')));let _0x5ea7a5=0x0;for(const _0x3426d7 of _0xf84dbd){const _0x501988=_0x3426d7['diffData'][_0x56ccbd]?.['aiSources']||{},_0x1e2d70=this['_makeTape'](_0x3426d7['model'][_0x56ccbd]['insertions'],_0x501988);_0x3426d7==_0x200fa7?(_0x3f7bd9=_0x1e2d70,_0x155a94=_0x3f7bd9['length'],_0x3f7bd9['forEach'](_0x236a70=>{_0x236a70['id']=_0x5ea7a5++;}),this['_processTape'](_0x3f7bd9)):this['_markInsertions'](_0x3f7bd9,_0x1e2d70);const _0x463080=_0x3f7bd9['filter'](_0x167a61=>!_0x167a61['isAdded'])['map'](_0x42d54e=>_0x42d54e['id']);let _0x1ac205=0x0;const _0x10ea08=this['_makeTape'](_0x3426d7['model'][_0x56ccbd]['deletions'],_0x501988);_0x10ea08['forEach'](_0x30aedb=>{_0x30aedb['isRemoved']?_0x30aedb['id']=_0x155a94++:_0x30aedb['id']=_0x463080[_0x1ac205++];}),this['_processTape'](_0x10ea08),this['_setDistance'](_0x3f7bd9,'isAdded'),this['_setDistance'](_0x10ea08,'isRemoved'),_0x3426d7==_0x200fa7&&this['_markMarkers'](_0x3f7bd9,_0x5ed84b),_0x3f7bd9=this['_joinTapes'](_0x3f7bd9,_0x10ea08),this['_refreshStartEndIndex'](_0x3f7bd9),this['_setDistance'](_0x3f7bd9,'isRemoved');}_0x3f7bd9=_0x3f7bd9['filter'](_0x1c3de0=>!(_0x1c3de0['isAdded']&&_0x1c3de0['isRemoved']));const _0x4868c6=new Map(_0x4d59fa['model'][_0x56ccbd]['deletions']['markers']),_0xb15a55=new Set(_0x5ed84b['keys']());for(const _0x37e0f3 of _0x4868c6['keys']())_0xb15a55['delete'](_0x37e0f3);const _0x4ae334=Object['assign']({},..._0xf84dbd['map'](_0x4ed3c1=>_0x4ed3c1['diffData'][_0x56ccbd]?.['aiSources']));this['_markSuggestions'](_0x3f7bd9,_0xb15a55,_0x4ae334),this['_fixObsoleteTags'](_0x3f7bd9),_0x3f7bd9=this['_removeMissingPairs'](_0x3f7bd9),_0x3f7bd9=this['_markMismatchedRemovedTags'](_0x3f7bd9),_0x3f7bd9=this['_removeUnsupportedChanges'](_0x3f7bd9);const {root:_0x2cd3d1,changes:_0x1ce5c5}=this['_makeModelFromTape'](_0x3f7bd9,_0x15c9b4,_0x56ccbd,_0x3622fc);_0x1b4bc4['model'][_0x56ccbd]=_0x2cd3d1;const _0x5b3f2d=_0x1cadd5['get'](_0x56ccbd);if(_0x5b3f2d){const _0x370741=_0x15c9b4['get'](_0x5b3f2d['userId']),_0x5c8b70=new Mt({'author':_0x370741,'type':_0x5b3f2d['isAttached']?'add':'remove','data':{'isOnRoot':!0x0},'createdAt':new Date(),'rootName':_0x56ccbd});_0x1ce5c5['unshift'](_0x5c8b70),_0x1b4bc4['attributes'][_0x56ccbd]['revisionHistoryAttachChange']=_0x5c8b70['id'];}_0x1b4bc4['changes']=_0x1b4bc4['changes']['concat'](_0x1ce5c5);}return _0x1b4bc4;}['_markMarkers'](_0x4652ef,_0x166f1e){for(let _0x39af44=0x0;_0x39af44<_0x4652ef['length'];_0x39af44++)for(const [_0x4b179d,_0x2ce0db]of _0x166f1e)!_0x2ce0db['isCollapsed']&&_0x2ce0db['start']['isEqual'](_0x4652ef[_0x39af44]['previousPosition'])&&_0x4652ef[_0x39af44]['markersStart']['push'](_0x4b179d),_0x2ce0db['end']['isEqual'](_0x4652ef[_0x39af44]['nextPosition'])&&_0x4652ef[_0x39af44]['markersEnd']['push'](_0x4b179d);}['_joinTapes'](_0x36d53c,_0x1197ea){let _0x44219e=[],_0x2f1097=0x0,_0x1eb919=0x0;for(;_0x2f1097<_0x36d53c['length']||_0x1eb919<_0x1197ea['length'];){const _0x1c241a=_0x36d53c[_0x2f1097]||{},_0x4f5803=_0x1197ea[_0x1eb919]||{};if(_0x1c241a['id']==_0x4f5803['id'])_0x2f1097++,_0x1eb919++,_0x44219e['push'](_0x1c241a);else{if(_0x4f5803['isRemoved']&&_0x1c241a['isAdded']){const {commonTape:_0x4292e9,iEnd:_0x3956f2,jEnd:_0x59bb49}=this['_threeWayMerge'](_0x36d53c,_0x2f1097,_0x1197ea,_0x1eb919);_0x44219e=_0x44219e['concat'](_0x4292e9),_0x2f1097=_0x3956f2,_0x1eb919=_0x59bb49;}else _0x4f5803['isRemoved']?(_0x1eb919++,_0x44219e['push'](_0x4f5803)):(_0x2f1097++,_0x44219e['push'](_0x1c241a));}}return _0x44219e;}_markSuggestions(_0x1e5a79,_0x400174,_0x3281aa){const _0x2237f6=[];for(let _0x19e952=0x0;_0x19e952<_0x1e5a79['length'];_0x19e952++){for(let _0x3bbbca=0x0;_0x3bbbca<_0x1e5a79[_0x19e952]['markersStart']['length'];_0x3bbbca++){const _0x3e674e=_0x1e5a79[_0x19e952]['markersStart'][_0x3bbbca];if(!_0x400174['has'](_0x3e674e))continue;const {group:_0x3795ae,type:_0x28e8d2,authorId:_0x4d17e2}=_0x58c95b(_0x3e674e);if('revision-suggestion'!=_0x3795ae||'insertion'!=_0x28e8d2&&'deletion'!=_0x28e8d2)continue;const _0x34da04=_0x3281aa['suggestion:'+_0x3e674e['slice'](0x14)]||null;_0x2237f6['unshift']({'type':_0x28e8d2,'name':_0x3e674e,'userId':_0x4d17e2,'aiSource':_0x34da04}),_0x1e5a79[_0x19e952]['markersStart']['splice'](_0x3bbbca,0x1),_0x3bbbca--;}_0x99fa64(_0x1e5a79[_0x19e952]);for(let _0x18349a=0x0;_0x18349a<_0x1e5a79[_0x19e952]['markersEnd']['length'];_0x18349a++){const _0x480691=_0x1e5a79[_0x19e952]['markersEnd'][_0x18349a];if(!_0x400174['has'](_0x480691))continue;const {group:_0x243841,type:_0x13facc}=_0x58c95b(_0x480691);if('revision-suggestion'!=_0x243841||'insertion'!=_0x13facc&&'deletion'!=_0x13facc)continue;_0x1e5a79[_0x19e952]['markersEnd']['splice'](_0x18349a,0x1),_0x18349a--;const _0x2336a9=_0x2237f6['findIndex'](_0x3940c7=>_0x3940c7['name']==_0x480691);_0x2336a9>-0x1&&_0x2237f6['splice'](_0x2336a9,0x1);}}function _0x58c95b(_0x5c669d){const _0x3036e5=_0x5c669d['split'](':');return{'group':_0x3036e5[0x0],'type':_0x3036e5[0x1],'subType':_0x3036e5['length']>=0x5?_0x3036e5[0x2]:null,'id':_0x3036e5['length']<0x5?_0x3036e5[0x2]:_0x3036e5[0x3],'authorId':_0x3036e5['length']<0x5?_0x3036e5[0x3]:_0x3036e5[0x4],'markerCount':0x6==_0x3036e5['length']?_0x3036e5[0x5]:null};}function _0x99fa64(_0x2c67d3){for(let _0x467f5b=0x0;_0x467f5b<_0x2237f6['length'];_0x467f5b++){if(_0x2c67d3['isAdded']&&'insertion'==_0x2237f6[_0x467f5b]['type']&&_0x2c67d3['isAdded']['userId']==_0x2237f6[_0x467f5b]['userId'])return _0x2c67d3['isAddSuggestion']={..._0x2237f6[_0x467f5b],'aiSource':_0x2c67d3['isAdded']['aiSource']||_0x2237f6[_0x467f5b]['aiSource']},void delete _0x2c67d3['isAdded'];if(!_0x2c67d3['isAdded']&&!_0x2c67d3['isRemoved']&&'deletion'==_0x2237f6[_0x467f5b]['type'])return void(_0x2c67d3['isRemoveSuggestion']=_0x2237f6[_0x467f5b]);}}}_setDistance(_0x4f5e5b,_0x5916bb){let _0xdffdb3=0x0,_0x12bdf0=!0x1;const _0x3e62fc=new Map();for(const _0x8a48a8 of _0x4f5e5b)_0x8a48a8[_0x5916bb]?_0x12bdf0&&(_0xdffdb3++,_0x12bdf0=!0x1):(_0xdffdb3++,_0x12bdf0=!0x0),_0x3e62fc['set'](_0x8a48a8['id'],_0xdffdb3);for(let _0x482adf=0x0;_0x482adf<_0x4f5e5b['length'];_0x482adf++){if('isRemoved'==_0x5916bb&&_0x4f5e5b[_0x482adf]['isAdded']||'isAdded'==_0x5916bb&&_0x4f5e5b[_0x482adf]['isRemoved'])continue;if('text'==_0x4f5e5b[_0x482adf]['type']){_0x4f5e5b[_0x482adf]['distance']=0x0;continue;}const _0x3f49a0=_0x3e62fc['get'](_0x4f5e5b[_0x482adf]['pairId']),_0x510b98=_0x3e62fc['get'](_0x4f5e5b[_0x482adf]['id']);_0x4f5e5b[_0x482adf]['distance']=_0x3f49a0-_0x510b98;}}_getRevisionsRange(_0x5ac608,_0xf4c226,_0x4e3afd=!0x1){const _0x38c875=[];let _0x25b2c7=this['repository']['getIndex'](_0x5ac608),_0x11dc95=this['repository']['getIndex'](_0xf4c226);for(-0x1==_0x11dc95&&(_0x11dc95=this['repository']['_revisions']['length'],_0x4e3afd=!0x1);_0x25b2c7<_0x11dc95;)_0x38c875['push'](this['repository']['getRevision'](_0x25b2c7)),_0x25b2c7++;return _0x4e3afd&&_0x38c875['push'](this['repository']['getRevision'](_0x25b2c7)),_0x38c875;}_threeWayMerge(_0x19dfcd,_0x516759,_0xa27330,_0x44504a){const _0x1f09d8=this['editor']['model']['schema'];let _0x3a610d=_0x516759;for(;_0x19dfcd[_0x3a610d]&&_0x19dfcd[_0x3a610d]['isAdded'];)_0x3a610d++;let _0x1f8682=_0x44504a;for(;_0xa27330[_0x1f8682]&&_0xa27330[_0x1f8682]['isRemoved'];)_0x1f8682++;_0x336cf3(_0x19dfcd,_0x516759,_0x3a610d),_0x336cf3(_0xa27330,_0x44504a,_0x1f8682);const _0x1c30f6=_0xa27330['slice'](_0x44504a,_0x1f8682)['concat'](_0x19dfcd['slice'](_0x516759,_0x3a610d));return _0x1c30f6['sort']((_0x202cb5,_0x5f27fc)=>_0x202cb5['side']!=_0x5f27fc['side']?_0x202cb5['side']-_0x5f27fc['side']:_0x202cb5['level']!=_0x5f27fc['level']?_0x202cb5['level']-_0x5f27fc['level']:_0x202cb5['distance']!=_0x5f27fc['distance']?_0x5f27fc['distance']-_0x202cb5['distance']:!!_0x202cb5['isAdded']!=!!_0x5f27fc['isAdded']?-0x1==_0x202cb5['side']||0x0==_0x202cb5['side']?_0x202cb5['isAdded']?-0x1:0x1:_0x202cb5['isAdded']?0x1:-0x1:_0x202cb5['index']-_0x5f27fc['index']),{'commonTape':_0x1c30f6,'iEnd':_0x3a610d,'jEnd':_0x1f8682};function _0x336cf3(_0x2b13a8,_0x272c45,_0x311b6e){let _0x4d0ef1=-0x1,_0x59d63b=Number['POSITIVE_INFINITY'],_0x5502cb=!0x0;for(let _0x2e0cbc=_0x272c45;_0x2e0cbc<_0x311b6e;_0x2e0cbc++)if(_0x1f09d8['isInline'](_0x2b13a8[_0x2e0cbc]['item'])||(_0x5502cb=!0x1),_0x2b13a8[_0x2e0cbc]['item']['startIndex']<_0x272c45&&(_0x4d0ef1=_0x2e0cbc),_0x2b13a8[_0x2e0cbc]['item']['endIndex']>=_0x311b6e){_0x59d63b=_0x2e0cbc;break;}_0x5502cb&&(_0x4d0ef1=_0x311b6e-0x1);for(let _0x57f09d=_0x272c45;_0x57f09d<_0x311b6e;_0x57f09d++)_0x2b13a8[_0x57f09d]['side']=_0x57f09d<=_0x4d0ef1?-0x1:_0x57f09d<_0x59d63b?0x0:0x1,_0x2b13a8[_0x57f09d]['index']=_0x57f09d;let _0xf11629=0x0;for(let _0x3823e0=_0x272c45;_0x3823e0<=_0x4d0ef1;_0x3823e0++)0x0==_0x2b13a8[_0x3823e0]['distance']?_0x2b13a8[_0x3823e0]['level']=_0xf11629:(_0xf11629++,_0x2b13a8[_0x3823e0]['level']=_0xf11629,_0xf11629++);for(let _0x33cd7a=_0x272c45;_0x33cd7a<_0x311b6e;_0x33cd7a++)0x0==_0x2b13a8[_0x33cd7a]['side']&&(_0x2b13a8[_0x33cd7a]['level']=_0xf11629);_0xf11629=0x0;for(let _0x142b37=_0x311b6e-0x1;_0x142b37>=_0x59d63b;_0x142b37--)0x0==_0x2b13a8[_0x142b37]['distance']?_0x2b13a8[_0x142b37]['level']=_0xf11629:(_0xf11629--,_0x2b13a8[_0x142b37]['level']=_0xf11629,_0xf11629--);}}_fixObsoleteTags(_0x3ed486){const _0x107cea=new Map(),_0xa35022=this['editor']['model']['schema'];for(let _0x50ec15=0x1;_0x50ec15<_0x3ed486['length'];_0x50ec15++){let _0x118ddb,_0x144373,_0x2d0f43;const _0x3168e3=_0x3ed486[_0x50ec15],_0x21fc21=_0x3ed486[_0x50ec15-0x1];if('text'==_0x3168e3['type'])continue;if(_0x3168e3['type']!=_0x21fc21['type'])continue;if(!_0xa35022['isBlock'](_0x21fc21['item'])||_0xa35022['isLimit'](_0x21fc21['item']))continue;if(!_0xa35022['isBlock'](_0x3168e3['item'])||_0xa35022['isLimit'](_0x3168e3['item']))continue;if((_0x3ed486[_0x50ec15]['isAdded']||_0x3ed486[_0x50ec15]['isAddSuggestion'])&&_0x3ed486[_0x50ec15-0x1]['isRemoved'])_0x118ddb=_0x3ed486[_0x50ec15],_0x144373=_0x3ed486[_0x50ec15-0x1],_0x2d0f43=_0x50ec15-0x1;else{if(!_0x3ed486[_0x50ec15]['isRemoved']||!_0x3ed486[_0x50ec15-0x1]['isAdded']&&!_0x3ed486[_0x50ec15-0x1]['isAddSuggestion'])continue;_0x118ddb=_0x3ed486[_0x50ec15-0x1],_0x144373=_0x3ed486[_0x50ec15],_0x2d0f43=_0x50ec15;}const _0x1fedec=_0x118ddb['level']==_0x144373['level'],_0x1189cd=Math['abs'](_0x118ddb['level'])<Math['abs'](_0x144373['level'])&&0x0==_0x144373['distance'];(_0x1fedec||_0x1189cd)&&(_0x107cea['set'](_0x144373['id'],_0x118ddb['id']),_0x3ed486['splice'](_0x2d0f43,0x1),_0x50ec15--,_0x118ddb['isAdded']=!0x1);}for(let _0x88044e=0x0;_0x88044e<_0x3ed486['length'];_0x88044e++)_0x107cea['has'](_0x3ed486[_0x88044e]['pairId'])&&(_0x3ed486[_0x88044e]['pairId']=_0x107cea['get'](_0x3ed486[_0x88044e]['pairId']));}['_removeMissingPairs'](_0xa03661){const _0x4940a0=new Set(_0xa03661['map'](_0x598c8d=>_0x598c8d['id']));for(let _0x5c95e3=0x0;_0x5c95e3<_0xa03661['length'];_0x5c95e3++)_0x4940a0['has'](_0xa03661[_0x5c95e3]['pairId'])||0x0==_0xa03661[_0x5c95e3]['distance']||(_0xa03661[_0x5c95e3]['isIncorrect']=!0x0);return _0xa03661['filter'](_0x2b7538=>!_0x2b7538['isIncorrect']);}_markMismatchedRemovedTags(_0x378936){const _0x5c09b3=new Set();for(let _0x39c81a=0x0;_0x39c81a<_0x378936['length'];_0x39c81a++){if(_0x5c09b3['has'](_0x378936[_0x39c81a]['id'])&&_0x378936[_0x39c81a]['isRemoved']&&(_0x378936[_0x39c81a]['isIncorrect']=!0x0),_0x378936[_0x39c81a]['isIncorrect'])continue;if(0x0==_0x378936[_0x39c81a]['distance'])continue;if('elementStart'!=_0x378936[_0x39c81a]['type'])continue;if(null==_0x378936[_0x39c81a]['pairId'])continue;let _0x3270ef=_0x39c81a+0x1,_0x22e99e=0x0;for(;_0x378936[_0x3270ef]['id']!=_0x378936[_0x39c81a]['pairId'];)'elementStart'==_0x378936[_0x3270ef]['type']?_0x22e99e++:'elementEnd'==_0x378936[_0x3270ef]['type']&&_0x22e99e--,_0x3270ef++;if(0x0!=_0x22e99e){if(_0x378936[_0x39c81a]['isRemoved'])_0x378936[_0x39c81a]['isIncorrect']=!0x0;else{for(;_0x3270ef!=_0x39c81a;)_0x378936[_0x3270ef]['isRemoved']&&0x0!=_0x378936[_0x3270ef]['distance']&&(_0x378936[_0x3270ef]['isIncorrect']=!0x0,_0x5c09b3['add'](_0x378936[_0x3270ef]['pairId'])),_0x3270ef--;}}}return _0x378936['filter'](_0x266ff6=>!_0x266ff6['isIncorrect']);}_removeUnsupportedChanges(_0x160d54){const _0x27a501=this['editor']['model']['schema'];for(let _0x513791=0x0;_0x513791<_0x160d54['length'];_0x513791++){if(!(_0x160d54[_0x513791]['isAdded']||_0x160d54[_0x513791]['isAddSuggestion']||_0x160d54[_0x513791]['isRemoved']||_0x160d54[_0x513791]['isRemoveSuggestion']))continue;if(0x0==_0x160d54[_0x513791]['distance'])continue;const _0x2f2db5=_0x160d54[_0x513791]['item'];_0x27a501['isBlock'](_0x2f2db5)||_0x27a501['isLimit'](_0x2f2db5)||(_0x160d54[_0x513791]['isAdded']&&delete _0x160d54[_0x513791]['isAdded'],_0x160d54[_0x513791]['isAddSuggestion']&&delete _0x160d54[_0x513791]['isAddSuggestion'],_0x160d54[_0x513791]['isRemoveSuggestion']&&delete _0x160d54[_0x513791]['isRemoveSuggestion'],_0x160d54[_0x513791]['isRemoved']&&(_0x160d54[_0x513791]['isIncorrect']=!0x0));}return _0x160d54['filter'](_0x5876ae=>!_0x5876ae['isIncorrect']);}['_makeModelFromTape'](_0x2e2918,_0x2ec99f,_0x5e2b20,_0x1056a2){const _0x156acc=new _0x4acbd6(),_0x264172=[],_0x21d6cc=new Map(),_0x56b1be=this['editor']['model'],_0x3edc86=_0x56b1be['schema'],_0x303829=[_0x156acc],_0x206601={},_0x4f5f80={'isAdded':[],'isRemoved':[],'isAddSuggestion':[],'isRemoveSuggestion':[]};_0x156acc['name']=_0x1056a2;let _0x476aaa=null;const _0x33dd7f=[0x0];for(let _0x2f60b6=0x0;_0x2f60b6<_0x2e2918['length'];_0x2f60b6++)if('elementStart'===_0x2e2918[_0x2f60b6]['type']){_0x2e2918[_0x2f60b6]['previousPosition']=_0x56b1be['createPositionFromPath'](_0x156acc,_0x33dd7f);const _0x1debae=new _0x28c730(_0x2e2918[_0x2f60b6]['item']['name'],_0x2e2918[_0x2f60b6]['item']['getAttributes']());_0x303829[0x0]['_appendChild'](_0x1debae),_0x33dd7f['push'](0x0),_0x303829['unshift'](_0x1debae),_0x2e2918[_0x2f60b6]['nextPosition']=_0x56b1be['createPositionFromPath'](_0x156acc,_0x33dd7f);}else'elementEnd'===_0x2e2918[_0x2f60b6]['type']?(_0x303829['shift'](),_0x2e2918[_0x2f60b6]['previousPosition']=_0x56b1be['createPositionFromPath'](_0x156acc,_0x33dd7f),_0x33dd7f['pop'](),_0x33dd7f[_0x33dd7f['length']-0x1]++,_0x2e2918[_0x2f60b6]['nextPosition']=_0x56b1be['createPositionFromPath'](_0x156acc,_0x33dd7f)):(_0x2e2918[_0x2f60b6]['previousPosition']=_0x56b1be['createPositionFromPath'](_0x156acc,_0x33dd7f),_0x476aaa?_0x476aaa['_data']+=_0x2e2918[_0x2f60b6]['item']['data']:_0x476aaa=new _0x42becd(_0x2e2918[_0x2f60b6]['item']['data'],_0x2e2918[_0x2f60b6]['item']['getAttributes']()),_0x2e2918[_0x2f60b6+0x1]&&'text'===_0x2e2918[_0x2f60b6+0x1]['type']&&_0x4668f7(_0x476aaa,_0x2e2918[_0x2f60b6+0x1]['item'])||(_0x303829[0x0]['_appendChild'](_0x476aaa),_0x476aaa=null),_0x33dd7f[_0x33dd7f['length']-0x1]+=_0x2e2918[_0x2f60b6]['item']['offsetSize'],_0x2e2918[_0x2f60b6]['nextPosition']=_0x56b1be['createPositionFromPath'](_0x156acc,_0x33dd7f));for(let _0x380b44=0x0;_0x380b44<_0x2e2918['length'];_0x380b44++){const _0x58e7e8=_0x2e2918[_0x380b44]['previousPosition'],_0x22b0d5=_0x2e2918[_0x380b44]['nextPosition'];for(const _0x55dfd4 of _0x2e2918[_0x380b44]['markersStart'])_0x21d6cc['set'](_0x55dfd4,{'start':_0x58e7e8,'end':null});_0x4c2137('isRemoveSuggestion',_0x380b44,_0x58e7e8,_0x22b0d5),_0x4c2137('isAddSuggestion',_0x380b44,_0x58e7e8,_0x22b0d5),_0x4c2137('isRemoved',_0x380b44,_0x58e7e8,_0x22b0d5),_0x4c2137('isAdded',_0x380b44,_0x58e7e8,_0x22b0d5);for(const _0x423d9b of _0x2e2918[_0x380b44]['markersEnd']){const _0x146a85=_0x21d6cc['get'](_0x423d9b);_0x146a85?_0x146a85['end']=_0x22b0d5:_0x21d6cc['set'](_0x423d9b,{'start':_0x22b0d5,'end':_0x22b0d5});}}for(const [_0x2f9def,_0x243957]of _0x21d6cc){const _0x4957cc=this['editor']['model']['createRange'](_0x243957['start'],_0x243957['end']);_0x156acc['markers']['set'](_0x2f9def,_0x4957cc);}return _0x264172['sort']((_0x4e5b92,_0x466903)=>{const _0x41ac70=_0x156acc['markers']['get']('revision:'+_0x4e5b92['id']),_0x40fefa=_0x156acc['markers']['get']('revision:'+_0x466903['id']);return _0x41ac70['start']['isBefore'](_0x40fefa['start'])?-0x1:_0x41ac70['start']['isAfter'](_0x40fefa['start'])?0x1:_0x41ac70['end']['isBefore'](_0x40fefa['end'])?-0x1:_0x41ac70['end']['isAfter'](_0x40fefa['end'])?0x1:'add'===_0x4e5b92['type']?-0x1:0x1;}),{'root':_0x156acc,'changes':_0x264172};function _0x4c2137(_0x3b7ad7,_0x25666c,_0x55fe1f,_0x540746){const _0x12aab8=!!_0x2e2918[_0x25666c][_0x3b7ad7],_0x3efdb4=_0x12aab8?_0x2e2918[_0x25666c][_0x3b7ad7]['userId']:null,_0x5b9227=_0x12aab8&&_0x2e2918[_0x25666c][_0x3b7ad7]['aiSource']||null,_0x5114ba=_0x25666c===_0x2e2918['length']-0x1,_0x3e13b4=_0x4f5f80[_0x3b7ad7][0x0],_0x3f6b50=_0x3edc86['isObject'](_0x2e2918[_0x25666c]['item']);!_0x206601[_0x3b7ad7]&&_0x12aab8?_0x206601[_0x3b7ad7]={'start':_0x55fe1f,'tapeItem':_0x2e2918[_0x25666c],'userId':_0x3efdb4,'aiSource':_0x5b9227,'type':_0x3b7ad7}:_0x206601[_0x3b7ad7]&&!_0x12aab8?(_0x206601[_0x3b7ad7]['end']=_0x55fe1f,_0x3da67f(_0x206601[_0x3b7ad7]),_0x206601[_0x3b7ad7]=null):_0x206601[_0x3b7ad7]&&_0x12aab8&&(_0x206601[_0x3b7ad7]['userId']!==_0x3efdb4||_0x206601[_0x3b7ad7]['aiSource']!==_0x5b9227)&&(_0x206601[_0x3b7ad7]['end']=_0x55fe1f,_0x3e13b4&&_0x3e13b4['userId']===_0x206601[_0x3b7ad7]['userId']?_0x3e13b4['change']['aiSource']=_0x3e13b4['change']['aiSource']||_0x206601[_0x3b7ad7]['aiSource']:_0x3da67f(_0x206601[_0x3b7ad7]),_0x206601[_0x3b7ad7]={'start':_0x55fe1f,'tapeItem':_0x2e2918[_0x25666c],'userId':_0x3efdb4,'aiSource':_0x5b9227,'type':_0x3b7ad7}),_0x206601[_0x3b7ad7]&&_0x3f6b50&&('elementStart'!==_0x2e2918[_0x25666c]['type']||_0x3e13b4&&_0x3e13b4['userId']===_0x3efdb4||_0x4f5f80[_0x3b7ad7]['unshift']({'userId':_0x3efdb4,'object':_0x2e2918[_0x25666c]['item'],'change':_0x206601[_0x3b7ad7]}),'elementEnd'===_0x2e2918[_0x25666c]['type']&&_0x3e13b4&&_0x3e13b4['object']===_0x2e2918[_0x25666c]['item']&&(_0x4f5f80[_0x3b7ad7]['shift'](),_0x206601[_0x3b7ad7]=_0x3e13b4['change'])),_0x206601[_0x3b7ad7]&&_0x5114ba&&(_0x206601[_0x3b7ad7]['end']=_0x540746,_0x3da67f(_0x206601[_0x3b7ad7]),_0x206601[_0x3b7ad7]=null);}function _0x3da67f({start:_0x475d09,end:_0x1ad0b5,tapeItem:_0x57916f,userId:_0x5544bf,aiSource:_0x11766d,type:_0x2afeaf}){const _0x356edc=_0x57916f['item'],_0x365a31=_0x56b1be['schema']['isBlock'](_0x356edc)&&!_0x56b1be['schema']['isLimit'](_0x356edc),_0x3cdf3e=_0x475d09['nodeAfter']==_0x1ad0b5['parent']&&_0x1ad0b5['isAtStart'];if(_0x365a31&&_0x3cdf3e)return;const _0xe20150=_0x56b1be['createRange'](_0x475d09,_0x1ad0b5),_0x4aa45e=_0x2ec99f['get'](_0x5544bf),_0x31253c=new Mt({'author':_0x4aa45e,'type':'isAdded'==_0x2afeaf||'isAddSuggestion'==_0x2afeaf?'add':'remove','data':{'isSuggestion':'isAddSuggestion'==_0x2afeaf||'isRemoveSuggestion'==_0x2afeaf,'aiSource':_0x11766d||null},'createdAt':new Date(),'rootName':_0x5e2b20});_0x264172['push'](_0x31253c),_0x156acc['markers']['set']('revision:'+_0x31253c['id'],_0xe20150);}function _0x4668f7(_0x3823a9,_0x5642c4){const _0x46a4f4=_0x3823a9['getAttributes'](),_0x32aa9a=_0x5642c4['getAttributes']();for(const _0x12ef2d of _0x46a4f4){if(_0x12ef2d[0x1]!==_0x5642c4['getAttribute'](_0x12ef2d[0x0]))return!0x1;_0x32aa9a['next']();}return _0x32aa9a['next']()['done'];}}_setConversion(){this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision','view':_0x1d8ce6=>{const _0x5ab55f=_0x1d8ce6['markerName']['split'](':')[0x1],_0xf2c957=this['_getChangeFromId'](_0x5ab55f);if(!_0xf2c957)return null;const _0x212cb2='add'==_0xf2c957['type']?'insertion':'deletion',_0x4780a3=['ck-suggestion-marker','ck-suggestion-marker-'+_0x212cb2];return _0xf2c957['data']['isSuggestion']&&_0x4780a3['push']('ck-suggestion-marker-'+_0x212cb2+'-new'),this['activeChange']==_0xf2c957&&_0x4780a3['push']('ck-suggestion-marker--active'),{'classes':_0x4780a3,'attributes':{'data-change-id':_0x5ab55f}};}}),this['editor']['conversion']['for']('upcast')['add'](_0x24718d=>{_0x24718d['on']('element:pre',(_0x311d35,_0x430d93,_0x19f76b)=>{const _0x246f90=_0x430d93['viewItem']['getChild'](0x0);if(!_0x246f90||!_0x246f90['is']('element','code'))return;if(!_0x19f76b['consumable']['consume'](_0x246f90,{'attributes':['vid_start','vid_end']}))return;const _0xc5bee9=_0x430d93['modelRange']['start']['nodeAfter'];_0x19f76b['writer']['setAttribute']('vid_start',_0x246f90['getAttribute']('vid_start'),_0xc5bee9),_0x19f76b['writer']['setAttribute']('vid_end',_0x246f90['getAttribute']('vid_end'),_0xc5bee9);},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['add'](_0x36a1d4=>{_0x36a1d4['on']('element',(_0x508a47,_0x4d22c9,_0x41d3e3)=>{if(!_0x41d3e3['consumable']['consume'](_0x4d22c9['viewItem'],{'attributes':['vid_start','vid_end']}))return;if(_0x4d22c9['modelRange']['isCollapsed'])return;const _0x23a3a4=_0x4d22c9['modelRange']['start']['nodeAfter'];_0x23a3a4['hasAttribute']('vid_start')||_0x23a3a4['hasAttribute']('vid')||(_0x41d3e3['writer']['setAttribute']('vid_start',_0x4d22c9['viewItem']['getAttribute']('vid_start'),_0x23a3a4),_0x41d3e3['writer']['setAttribute']('vid_end',_0x4d22c9['viewItem']['getAttribute']('vid_end'),_0x23a3a4));},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['elementToAttribute']({'view':{'name':'span','attributes':{'vid':!0x0}},'model':{'key':'vid','value':_0x5e062d=>_0x5e062d['getAttribute']('vid')}}),this['editor']['model']['schema']['on']('checkAttribute',(_0x1e91c2,[,_0xc96aed])=>{['vid_start','vid_end','vid']['includes'](_0xc96aed)&&(_0x1e91c2['return']=!0x0,_0x1e91c2['stop']());},{'priority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x644204=>{_0x644204['on']('attribute:vid',(_0x434cb3,_0x479384,_0x3b0861)=>{if('\x20'!=_0x479384['item']['data']||_0x479384['item']['parent']['maxOffset']>0x1)return;if(!_0x3b0861['consumable']['consume'](_0x479384['item'],_0x434cb3['name']))return;const _0x44fd08=_0x3b0861['writer'],_0x1c1a58=_0x3b0861['mapper']['toViewRange'](_0x479384['range']);_0x44fd08['wrap'](_0x1c1a58,_0x44fd08['createAttributeElement']('span'));});}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',function(_0x387f54){const _0x17ea6b=_0x387f54['plugins']['get']('RevisionViewer');return(_0x1602bf,_0x6483a4,_0x517d94)=>{const _0x4e3748=_0x6483a4['markerName']['split'](':')[0x1],_0x272b68=_0x17ea6b['_getChangeFromId'](_0x4e3748);if(!_0x272b68)return null;const _0x2f2933='add'==_0x272b68['type']?'split':'merge';if(!_0x517d94['consumable']['test'](_0x6483a4['markerRange'],_0x1602bf['name']))return;const _0x3e87aa=_0x6483a4['markerRange']['getWalker'](),_0x1c9d6f=_0x6483a4['markerRange']['start'],_0x12fd7c=_0x387f54['model']['schema'];let _0x388f48=null,_0x37082c=null,_0x1c6a23=!0x1,_0x68462d=!0x1;for(const _0x4b5a64 of _0x3e87aa){const _0x4891b7=_0x4b5a64['item'];_0x1c6a23=_0x1c6a23||_0x12fd7c['isContent'](_0x4891b7);const _0x18d41c=_0x517d94['mapper']['toViewElement'](_0x4891b7);if(_0x18d41c&&_0x18d41c['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x4b5a64['type']&&(_0x12fd7c['isBlock'](_0x4891b7)&&!_0x12fd7c['isLimit'](_0x4891b7)&&(_0x4891b7['nextSibling']||_0x1c9d6f['isAtEnd']?_0x388f48&&_0x388f48['parent']==_0x4891b7||(_0x388f48=_0x4891b7,_0x73243f(_0x4b5a64['previousPosition']),_0x68462d=!0x0):_0x37082c=_0x37082c||_0x4b5a64['previousPosition']));}function _0x73243f(_0x212508){const _0x5befad=_0x517d94['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x2f2933}),_0x53fab5=_0x517d94['mapper']['toViewPosition'](_0x212508);_0x272b68['data']['isSuggestion']&&_0x517d94['writer']['addClass']('ck-suggestion-marker-'+_0x2f2933+'-new',_0x5befad),_0x17ea6b['activeChange']==_0x272b68&&_0x517d94['writer']['addClass']('ck-suggestion-marker--active',_0x5befad),_0x517d94['writer']['insert'](_0x53fab5,_0x5befad),_0x517d94['mapper']['bindElementToMarker'](_0x5befad,_0x6483a4['markerName']);}_0x1c6a23||_0x68462d||!_0x37082c||_0x73243f(_0x37082c);};}(this['editor']),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision',(_0x2aca78,_0x166930,_0x2bfe6d)=>{const _0x56db6e=_0x2bfe6d['mapper']['markerNameToElements'](_0x166930['markerName']);if(_0x56db6e){for(const _0x44579e of _0x56db6e)(_0x44579e['hasClass']('ck-suggestion-marker-split')||_0x44579e['hasClass']('ck-suggestion-marker-merge'))&&(_0x2bfe6d['mapper']['unbindElementFromMarkerName'](_0x44579e,_0x166930['markerName']),_0x2bfe6d['writer']['remove'](_0x44579e));}},{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',(_0x3852da,_0x4b4249,_0x130569)=>{const _0x456418=_0x4b4249['markerName']['split'](':')[0x1],_0x585d5a=this['_getChangeFromId'](_0x456418);if(!_0x585d5a)return null;const _0x2769ec='add'==_0x585d5a['type']?'split':'merge';if(_0x130569['consumable']['test'](_0x4b4249['markerRange'],_0x3852da['name']))for(const _0x2a49a9 of _0x4b4249['markerRange']['getItems']()){if(!_0x2a49a9['is']('element','softBreak'))continue;const _0x3de75c=_0x130569['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x2769ec}),_0x5c2314=_0x130569['mapper']['toViewPosition'](this['editor']['model']['createPositionBefore'](_0x2a49a9));_0x585d5a['data']['isSuggestion']&&_0x130569['writer']['addClass']('ck-suggestion-marker-'+_0x2769ec+'-new',_0x3de75c),this['activeChange']==_0x585d5a&&_0x130569['writer']['addClass']('ck-suggestion-marker--active',_0x3de75c),_0x130569['writer']['insert'](_0x5c2314,_0x3de75c),_0x130569['mapper']['bindElementToMarker'](_0x3de75c,_0x4b4249['markerName']);}},{'priority':'high'}),this['editor']['model']['document']['on']('change',()=>{this['editor']['editing']['view']['change'](_0x8714cb=>{for(const _0x113a91 of this['editor']['model']['document']['getRootNames']()){const _0x90992a=this['editor']['model']['document']['getRoot'](_0x113a91),_0x41932c=this['editor']['editing']['view']['document']['getRoot'](_0x113a91);if(_0x41932c){const _0x1b4f86=_0x90992a['getAttribute']('revisionHistoryAttachChange');if(_0x8714cb['removeAttribute']('data-change-id',_0x41932c),_0x8714cb['removeClass']('ck-revision-history-root-add',_0x41932c),_0x8714cb['removeClass']('ck-revision-history-root-remove',_0x41932c),_0x8714cb['removeClass']('ck-revision-history-root--active',_0x41932c),_0x1b4f86){const _0x29fbd6=this['_getChangeFromId'](_0x1b4f86);if(!_0x29fbd6)return null;_0x8714cb['setAttribute']('data-change-id',_0x1b4f86,_0x41932c),_0x8714cb['addClass']('ck-revision-history-root-'+_0x29fbd6['type'],_0x41932c),this['activeChange']==_0x29fbd6&&_0x8714cb['addClass']('ck-revision-history-root--active',_0x41932c);}}}});}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'comment','model':_0x441ef9=>'revision-comment:'+_0x441ef9,'converterPriority':'highest'}),this['_showCommentHighlights']&&this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-comment','view':_0x4801ec=>({'classes':['ck-comment-marker'],'attributes':{'data-comment':Ut(_0x4801ec['markerName'])}})}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'suggestion','model':_0x225bc4=>'revision-suggestion:'+_0x225bc4,'converterPriority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision-suggestion','view':_0x3f9819=>({'name':'suggestion:'+_0x3f9819,'group':'revision-suggestion'}),'converterPriority':'highest'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-suggestion','view':_0x117962=>{const _0x88e71e=_0x117962['markerName']['split'](':')[0x1];return'insertion'!=_0x88e71e&&'deletion'!=_0x88e71e?null:{'classes':['ck-suggestion-preview-marker','ck-suggestion-preview-marker-'+_0x88e71e]};}}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:deletion',Lt(this['editor'],'merge'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:insertion',Lt(this['editor'],'split'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision-suggestion',(_0x46e891,_0xb67791,_0xc03b5b)=>{const _0x5da6c5=_0xc03b5b['mapper']['markerNameToElements'](_0xb67791['markerName']);if(_0x5da6c5){for(const _0x9b7941 of _0x5da6c5)_0x9b7941['is']('uiElement')&&(_0xc03b5b['mapper']['unbindElementFromMarkerName'](_0x9b7941,_0xb67791['markerName']),_0xc03b5b['writer']['remove'](_0x9b7941));}},{'priority':'high'});}_getChangeFromId(_0x1c205d){return this['_changeIdToChange']['get'](_0x1c205d);}_getViewForChange(_0x34baea){return this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=new Vt(this['editor']['locale'],_0x34baea,'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_changeView'];}_initInteractions(){this['editor']['model']['document']['selection']['observeMarkers']('revision'),this['on']('change:activeView',(_0x39b3d3,_0x2b5c66,_0x30483e,_0x199054)=>{_0x199054&&this['_balloon']['remove'](_0x199054),_0x30483e&&(this['_balloon']['add']({'view':_0x30483e,'stackId':'revisionHistoryLabel','position':{'target':()=>{const _0x39554b=this['editor']['editing'],_0x1bac95=this['_getChangeFromId'](_0x30483e['changeId']);let _0x2d536a;if(_0x1bac95['data']['isOnRoot']){const _0x42e69b=_0x39554b['view']['getDomRoot'](_0x1bac95['rootName']);_0x2d536a=Array['from'](_0x42e69b['getClientRects']());}else{const _0x765865=this['editor']['model']['markers']['get']('revision:'+_0x30483e['changeId']);_0x2d536a=Array['from'](_0x39554b['mapper']['markerNameToElements'](_0x765865['name']))['map'](_0x1f41bc=>_0x39554b['view']['domConverter']['mapViewToDom'](_0x1f41bc))['map'](_0x301391=>Array['from'](_0x301391['getClientRects']()))['flat']();}return this['_activeViewTarget']&&_0x2d536a['find'](_0x2a53fb=>_0x2a53fb['top']-0x3<=this['_activeViewTarget']['y']&&_0x2a53fb['bottom']+0x3>=this['_activeViewTarget']['y']&&_0x2a53fb['left']-0x3<=this['_activeViewTarget']['x']&&_0x2a53fb['right']+0x3>=this['_activeViewTarget']['x'])||_0x2d536a[0x0];}}}),this['_balloon']['showStack']('revisionHistoryLabel'));}),this['on']('change:activeChange',(_0x12afc3,_0x29fe70,_0x521f29,_0x24b674)=>{this['activeView']=_0x521f29?this['_getViewForChange'](_0x521f29):null,this['editor']['model']['change'](()=>{const _0x2b7f29=this['editor']['editing'];_0x24b674&&(_0x24b674['data']['isOnRoot']?_0x2b7f29['view']['change'](_0x5a4dd5=>{_0x5a4dd5['removeClass']('ck-revision-history-root--active',_0x2b7f29['view']['document']['getRoot'](_0x24b674['rootName']));}):_0x2b7f29['reconvertMarker']('revision:'+_0x24b674['id'])),_0x521f29&&(_0x521f29['data']['isOnRoot']?_0x2b7f29['view']['change'](_0x7b5600=>{_0x7b5600['addClass']('ck-revision-history-root--active',_0x2b7f29['view']['document']['getRoot'](_0x521f29['rootName']));}):_0x2b7f29['reconvertMarker']('revision:'+_0x521f29['id']));});}),this['listenTo'](this['editor']['editing']['view']['document'],'mouseover',(_0x16fa6b,_0x162991)=>{if(this['activeChange'])return;const _0xee9608=this['_findChangeIdFromDomTarget'](_0x162991['target']),_0x25380e=this['_changeIdToChange']['get'](_0xee9608);_0x25380e?(this['_activeViewTarget']={'x':_0x162991['domEvent']['x'],'y':_0x162991['domEvent']['y']},this['activeView']=this['_getViewForChange'](_0x25380e)):(this['_activeViewTarget']=null,this['activeView']=null);}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',(_0x4a0aaf,_0x5620a3)=>{const _0x412a8a=this['_findChangeIdFromDomTarget'](_0x5620a3['target']),_0x582805=this['_changeIdToChange']['get'](_0x412a8a);_0x582805?(this['_activeViewTarget']={'x':_0x5620a3['domEvent']['x'],'y':_0x5620a3['domEvent']['y']},_0x582805===this['activeChange']?this['_balloon']['updatePosition']():this['activeChange']=_0x582805):(this['_activeViewTarget']=null,this['activeChange']=null);});}_findChangeIdFromDomTarget(_0x5c514f){do{const _0x2d8898=_0x5c514f['getAttribute']('data-change-id');if(_0x2d8898)return _0x2d8898;_0x5c514f=_0x5c514f['parent'];}while(_0x5c514f);return null;}['_cleanMarkers'](){this['editor']['model']['change'](_0x390869=>{for(const _0x3af693 of this['editor']['model']['markers'])_0x390869['removeMarker'](_0x3af693);});}};function Ut(_0x32d48f){return _0x32d48f['split'](':')[0x1];}function Lt(_0x1a5a54,_0x2d5eac){return(_0x403176,_0x31f940,_0x2d6b4c)=>{if(!_0x2d6b4c['consumable']['test'](_0x31f940['markerRange'],_0x403176['name']))return;const _0xbbc7e1=_0x31f940['markerRange']['getWalker'](),_0x455a35=_0x31f940['markerRange']['start'],_0x1e3048=_0x1a5a54['model']['schema'];let _0xa4ac18=null,_0x3abd9e=null,_0x5ea654=!0x1,_0x5ab850=!0x1;for(const _0x4a90bb of _0xbbc7e1){const _0x1e8bc8=_0x4a90bb['item'];_0x5ea654=_0x5ea654||_0x1e3048['isContent'](_0x1e8bc8);const _0x4988fa=_0x2d6b4c['mapper']['toViewElement'](_0x1e8bc8);if(_0x4988fa&&_0x4988fa['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x4a90bb['type']&&(_0x1e3048['isBlock'](_0x1e8bc8)&&!_0x1e3048['isLimit'](_0x1e8bc8)&&(_0x1e8bc8['nextSibling']||_0x455a35['isAtEnd']?_0xa4ac18&&_0xa4ac18['parent']==_0x1e8bc8||(_0xa4ac18=_0x1e8bc8,_0x4ea578(_0x4a90bb['previousPosition']),_0x5ab850=!0x0):_0x3abd9e=_0x3abd9e||_0x4a90bb['previousPosition']));}function _0x4ea578(_0x42e75e){const _0x155599=_0x2d6b4c['mapper']['toViewPosition'](_0x42e75e),_0x3af25a=_0x2d6b4c['writer']['createUIElement']('span',{'class':'ck-suggestion-preview-marker-'+_0x2d5eac});_0x2d6b4c['writer']['insert'](_0x155599,_0x3af25a),_0x2d6b4c['mapper']['bindElementToMarker'](_0x3af25a,_0x31f940['markerName']);}_0x5ea654||_0x5ab850||!_0x3abd9e||_0x4ea578(_0x3abd9e);};}var Ft=class extends _0x1ddd1c{constructor(_0x55eafb){super(_0x55eafb);const _0x94bfb3=_0x55eafb['plugins']['get'](Pt);this['affectsData']=!0x1,this['listenTo'](_0x94bfb3,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x94bfb3,'change:isEnabled',()=>this['refresh']());}execute(){const _0x3dfd4c=this['editor'],_0x2debda=_0x3dfd4c['plugins']['get'](Pt),_0x22e5aa=_0x2debda['isReady']?_0x2debda['diff']['newRevisionId']:null;_0x3dfd4c['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x22e5aa);}['refresh'](){const {isReady:_0x590ab4,isEnabled:_0x3160a0,repository:_0x1fbf19,diff:_0x560e5a}=this['editor']['plugins']['get'](Pt),_0x145a16=_0x560e5a&&_0x1fbf19['getLaterVisibleRevision'](_0x560e5a['newRevisionId']);this['isEnabled']=_0x590ab4&&_0x3160a0&&Boolean(_0x145a16);}},$t=class extends _0x1ddd1c{_step;constructor(_0x1874c5,{direction:_0x517533}){super(_0x1874c5);const _0x5a714f=_0x1874c5['plugins']['get'](Pt);this['affectsData']=!0x1,this['_step']='forward'===_0x517533?0x1:-0x1,this['listenTo'](_0x5a714f,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x5a714f,'change:isEnabled',()=>this['refresh']()),this['listenTo'](_0x5a714f,'change:activeChange',()=>this['refresh']());}execute(){const _0x26835a=this['editor'],_0x362ac2=_0x26835a['plugins']['get'](Pt),{isNavigationMode:_0x2f921f,currentChangeNumber:_0x36797f}=_0x362ac2;let _0x4ab517;if(_0x362ac2['activeChange']=_0x2f921f?_0x362ac2['diff']['changes']['get'](_0x36797f+this['_step']):_0x362ac2['diff']['changes']['first'],_0x362ac2['activeChange']['data']['isOnRoot'])_0x4ab517=_0x26835a['editing']['view']['getDomRoot'](_0x362ac2['activeChange']['rootName']);else{const _0x48a896=_0x26835a['model']['markers']['get']('revision:'+_0x362ac2['activeChange']['id']);_0x4ab517=_0x3ec3b7(_0x26835a['editing'],_0x48a896);}_0x98e9d6({'target':_0x4ab517,'viewportOffset':0x28});}['refresh'](){const {isNavigationMode:_0x37987b,currentChangeNumber:_0x2d48c0,numberOfChanges:_0x5f26a2,isReady:_0x434610,isEnabled:_0x1259ed}=this['editor']['plugins']['get'](Pt);this['isEnabled']=!!(_0x1259ed&&_0x434610&&_0x5f26a2)&&(!_0x37987b||(0x1===this['_step']?_0x2d48c0<_0x5f26a2-0x1:_0x2d48c0>0x0));}},Bt=class extends dt{constructor(_0x2027d9){super(_0x2027d9);const _0x310704=this['bindTemplate'],_0x321334=new _0xfa6b1(_0x2027d9),_0x54a452=new _0xfa6b1(_0x2027d9);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',(_0x52ecfa,_0xaeb4c2)=>_0x52ecfa&&_0xaeb4c2>0x0),this['bind']('_statusText')['to'](this,'isReady',this,'currentChangeNumber',this,'numberOfChanges',this,'isNavigationMode',(_0x585848,_0x43798b,_0x260b64,_0x31d975)=>{if(!_0x585848)return kt(_0x2027d9,'Loading...');if(!_0x260b64)return kt(_0x2027d9,'No\x20changes');const _0x1ccf4c=kt(_0x2027d9,'NUMBER_OF_CHANGES',_0x260b64);return _0x31d975?kt(_0x2027d9,'X_OF_Y_CHANGES',[_0x43798b+0x1,_0x260b64]):_0x1ccf4c;}),_0x321334['set']({'label':kt(_0x2027d9,'Show\x20previous\x20change'),'tooltip':!0x0,'icon':_0x343c90}),_0x54a452['set']({'label':kt(_0x2027d9,'Show\x20next\x20change'),'tooltip':!0x0,'icon':_0x4a149a}),_0x321334['bind']('isEnabled')['to'](this,'isBackwardNavigationEnabled'),_0x54a452['bind']('isEnabled')['to'](this,'isForwardNavigationEnabled'),_0x321334['on']('execute',()=>this['fire']('execute','backward')),_0x54a452['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',_0x310704['if']('_isStatusLabelVisible','ck-hidden',_0x36cc7a=>!_0x36cc7a)]},'children':[{'text':_0x310704['to']('isNavigationMode',_0x20196a=>_0x20196a?kt(_0x2027d9,'EDIT_X_OF_Y_REVISIONS')+':\x20':kt(_0x2027d9,'Total')+':\x20')}]},{'text':_0x310704['to']('_statusText')}]},new ct(),{'tag':'div','attributes':{'class':['ck-revision-history-ui__changes-navigation__navigation']},'children':[_0x321334,_0x54a452]}]});}};const jt='ck-editor__editable__loading-overlay';var Gt=class extends _0x3ccb16{static get['pluginName'](){return'RevisionViewerLoadingOverlay';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['show'](){const _0x1845c8=this['editor']['editing']['view'];_0x1845c8['change'](_0x1afb52=>{for(const _0x48037a of _0x1845c8['document']['roots'])_0x1afb52['addClass'](jt,_0x48037a);});}['hide'](){const _0x2c8e25=this['editor']['editing']['view'];_0x2c8e25['change'](_0x1ef3b7=>{for(const _0xe3c171 of _0x2c8e25['document']['roots'])_0x1ef3b7['removeClass'](jt,_0xe3c171);});}},Kt=class extends _0x3ccb16{static get['pluginName'](){return'RevisionViewerUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt,Gt];}init(){const _0x50d73d=this['editor'],_0x112858=_0x50d73d['plugins']['get'](Pt),_0x3fba4f=_0x50d73d['plugins']['get'](Gt);_0x50d73d['ui']['componentFactory']['add']('exitToEditing',_0x535b67=>{const _0x3335a2=new _0xfa6b1(_0x535b67);return _0x3335a2['set']({'label':kt(_0x535b67,'Back\x20to\x20editing'),'icon':_0x2a5c35,'withText':!0x0,'tooltip':!0x0,'class':'ck-revision-history-ui__back-to-editing'}),this['listenTo'](_0x3335a2,'execute',()=>{_0x50d73d['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}),_0x3335a2;}),_0x50d73d['ui']['componentFactory']['add']('restoreRevision',_0x14b59f=>{const _0x239c11=new _0xfa6b1(_0x14b59f);return _0x239c11['set']({'label':kt(_0x14b59f,'Restore\x20this\x20revision'),'withText':!0x0,'tooltip':!0x0}),_0x239c11['bind']('isEnabled')['to'](_0x50d73d['commands']['get']('restoreRevision')),this['listenTo'](_0x239c11,'execute',()=>_0x50d73d['execute']('restoreRevision')),_0x239c11;}),_0x50d73d['ui']['componentFactory']['add']('changesNavigation',_0x42bcf6=>{const _0x4b75e7=new Bt(_0x42bcf6),_0x47c20d=_0x50d73d['commands']['get']('showPreviousChange'),_0x14288f=_0x50d73d['commands']['get']('showNextChange');return _0x4b75e7['bind']('isBackwardNavigationEnabled')['to'](_0x47c20d,'isEnabled'),_0x4b75e7['bind']('isForwardNavigationEnabled')['to'](_0x14288f,'isEnabled'),_0x4b75e7['bind']('isReady','currentChangeNumber','numberOfChanges','isNavigationMode')['to'](_0x112858),this['listenTo'](_0x4b75e7,'execute',(_0x2d4632,_0x15524)=>{_0x50d73d['execute']('forward'===_0x15524?'showNextChange':'showPreviousChange');}),_0x4b75e7;}),_0x3fba4f['show'](),_0x112858['on']('change:isReady',(_0x2ca756,_0x181877,_0x4b0d7f)=>{_0x4b0d7f?_0x3fba4f['hide']():_0x3fba4f['show']();});}},qt=class extends it{['_resizeObserver']=null;constructor(_0x60b761,_0x26ec76){super(_0x60b761,_0x26ec76);const _0x240262=this['bindTemplate'];this['set']({'label':kt(_0x60b761,'Revision\x20name'),'_tooltipString':''}),this['fieldView']['placeholder']=kt(_0x60b761,'Enter\x20the\x20revision\x20name'),this['extendTemplate']({'tag':'span','attributes':{'class':['ck-revision-history-sidebar__revision-name'],'data-cke-tooltip-text':_0x240262['to']('_tooltipString'),'data-cke-tooltip-position':'s','data-cke-tooltip-class':'ck-tooltip_multi-line'}});}['render'](){super['render'](),this['_resizeObserver']=new _0x354550(this['fieldView']['element'],()=>this['_updateTooltipText']()),this['listenTo'](this['fieldView'],'input',()=>this['_updateTooltipText']());}destroy(){super['destroy'](),this['_resizeObserver']&&this['_resizeObserver']['destroy']();}_updateTooltipText(){const _0x115e66=this['fieldView']['element'];this['_tooltipString']=_0x115e66['scrollWidth']>_0x115e66['clientWidth']&&_0x115e66['value']||'';}},Yt=class extends dt{constructor(_0xb584c4,_0x516e6b,_0x45ab60){super(_0xb584c4);const _0x52a001=new _0x4c1208();_0x52a001['set']({'content':_0xac3ad6,'viewBox':'0\x200\x2011\x2010'});const _0x1c2569=['ck','ck-revision-history-sidebar__revision-author'];_0x45ab60&&_0x1c2569['push']('ck-revision-history-sidebar__revision-author_creator');const _0x188339=[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision-author__name'],'title':kt(_0xb584c4,_0x45ab60?'Revision\x20creator':'Revision\x20author')},'children':[_0x52a001,_0x516e6b['name']]}];this['setTemplate']({'tag':'li','attributes':{'class':_0x1c2569},'children':_0x188339});}};function Jt(_0x190944,_0x46c3ea){const _0x344fe0=_0x190944['bindTemplate'],_0xde079a=_0x190944['locale'],_0x46e7fc=vt(_0xde079a);_0x46e7fc['panelPosition']='sw';const _0x31f369=function(_0x4a60fd,_0xd268f2){const _0x15e9d7=function(_0x2d6a97,_0x1635dd){const _0x466d8c=_0x2d6a97['locale'],_0x1b58d6={'Compare\x20against\x20selected':kt(_0x466d8c,'Compare\x20against\x20selected'),'Name\x20this\x20revision':kt(_0x466d8c,'Name\x20this\x20revision'),'Restore\x20this\x20revision':kt(_0x466d8c,'Restore\x20this\x20revision')};return _0x1635dd['map'](_0x3f9c17=>{const _0x34425e=_0x1b58d6[_0x3f9c17['name']];return _0x34425e&&_0x34425e!==_0x3f9c17['name']&&(_0x3f9c17['name']=_0x34425e),_0x3f9c17;});}(_0x4a60fd,_0xd268f2),_0x13f3d8=new _0x520f62();for(const _0x1b91d2 of _0x15e9d7){const _0x2b5e85={'type':'button','model':new ut({'label':_0x1b91d2['name'],'class':_0x1b91d2['class'],'withText':!0x0,'role':'menuitem','_action':_0x1b91d2['action']})};_0x2b5e85['model']['bind']('isEnabled')['to'](_0x4a60fd,'isActionsDropdownOpen',_0x5f4ad9=>'function'!=typeof _0x1b91d2['isEnabled']||(!_0x5f4ad9||_0x1b91d2['isEnabled'](_0x4a60fd))),_0x13f3d8['add'](_0x2b5e85);}return _0x13f3d8;}(_0x190944,_0x46c3ea);return _0x190944['bind']('isActionsDropdownOpen')['to'](_0x46e7fc,'isOpen'),_0x46e7fc['buttonView']['set']({'label':kt(_0xde079a,'Show\x20more\x20items'),'tooltip':!0x0,'tooltipPosition':'sw','icon':_0x467e7d}),_0x46e7fc['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision__actions',_0x344fe0['if']('isActionsDropdownOpen','ck-on')]},'on':{'click':_0x344fe0['to'](_0x354c11=>_0x354c11['stopPropagation']())}}),_0x46e7fc['on']('execute',_0x2039f5=>{_0x190944['isReady']&&'function'==typeof _0x2039f5['source']['_action']&&_0x2039f5['source']['_action'](_0x190944);}),ft(_0x46e7fc,_0x31f369,{'role':'menu'}),_0x46e7fc['listenTo'](_0x190944,'change:isActionsDropdownOpen',(_0x3a4031,_0x2bd758,_0x39af69)=>{if(_0x39af69)for(const _0xf53b87 of _0x46e7fc['listView']['items']){const _0xec71e5=_0xf53b87['children']['first'],_0x5ef007=_0x46c3ea['find'](_0x58a5e1=>_0x58a5e1['action']===_0xec71e5['_action'])['isVisible'];_0xf53b87['isVisible']=void 0x0===_0x5ef007||_0x5ef007(_0x190944);}}),_0x46e7fc;}const Wt=/* #__PURE__ -- @preserve */
|
|
27
|
-
|
|
23
|
+
import{CKEditorError as _0x3d550e,Collection as _0x32a4f2,ElementReplacer as _0x19597b,FocusTracker as _0x4e4794,KeystrokeHandler as _0x53888f,ObservableMixin as _0x135b6a,ResizeObserver as _0x5c360a,logWarning as _0x11b5c9,scrollViewportToShowTarget as _0x60056,trustedHtml as _0x5c60d8,uid as _0x240cc1}from'@ckeditor/ckeditor5-utils';import{cloneDeep as _0x346ba8,isEqual as _0x235614,set as _0x1d4419,unset as _0x309af8}from'es-toolkit/compat';import{Command as _0x2158cb,Editor as _0x27c387,ElementApiMixin as _0x5ed66b,PendingActions as _0x3f141d,Plugin as _0x544bf8}from'@ckeditor/ckeditor5-core';import{ConfirmMixin as _0x3e5ba7,PillView as _0x30468e,Users as _0x157f26,getMarkerDomElement as _0x4df91e,reRootOperation as _0x1c16f5,reRootPosition as _0x3e4f67,reRootRange as _0x146304,sanitizeEditorConfig as _0x1db4df}from'@ckeditor/ckeditor5-collaboration-core';import{ModelDocumentFragment as _0x3bdc31,ModelElement as _0x19c548,ModelRange as _0x31969d,ModelText as _0x7943a3,ViewAttributeElement as _0x23c0b4,ViewContainerElement as _0x32bc61,ViewDocumentFragment as _0x443d07,ViewElement as _0x2eab9a,ViewEmptyElement as _0x147194,ViewRawElement as _0x2f30ee,ViewText as _0x1f997e,ViewUIElement as _0x26cf79}from'@ckeditor/ckeditor5-engine';import{IconChevronDown as _0x4c5074,IconChevronUp as _0x194704,IconHistory as _0x1cebb3,IconSparkle as _0x237d30,IconThreeVerticalDots as _0x500df1,IconUndo as _0x53c7c8,IconUser as _0x5a8ed6}from'@ckeditor/ckeditor5-icons';import{BoxedEditorUIView as _0x121443,ButtonView as _0xefa108,ContextualBalloon as _0x25d16b,CssTransitionDisablerMixin as _0x1dd50d,EditorUI as _0x108803,IconView as _0x1d6039,InlineEditableUIView as tt,LabeledFieldView as it,ListItemView as et,ListView as st,MenuBarMenuListItemButtonView as nt,MenuBarMenuListItemView as ot,MenuBarMenuListView as rt,MenuBarMenuView as at,StickyPanelView as ht,ToolbarSeparatorView as ct,ToolbarView as lt,UIModel as ut,View as dt,addListToDropdown as ft,createDropdown as vt,createLabeledInputText as gt,normalizeToolbarConfig as mt,submitHandler as _t}from'@ckeditor/ckeditor5-ui';import{DateTime as wt}from'luxon';const pt=/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x135b6a();var yt=class extends pt{['id'];creator;authors;diffData;toVersion;['fromVersion'];['model'];constructor(_0x29617a){super(),this['id']=_0x29617a['id']||_0x240cc1(),this['creator']=_0x29617a['creator']||null,this['authors']=_0x29617a['authors']||[],this['diffData']=_0x29617a['diffData']||null,this['toVersion']=_0x29617a['toVersion']||0x0,this['fromVersion']=_0x29617a['fromVersion']||0x0,this['set']('name',_0x29617a['name']||''),this['set']('createdAt',_0x29617a['createdAt']||new Date()),this['set']('attributes',_0x29617a['attributes']||{});}setName(_0x41a6fe){this['_update']({'name':_0x41a6fe});}setAttribute(_0xe962ba,_0x39bc2c){const _0xb828a8=_0x346ba8(this['attributes']);_0x1d4419(_0xb828a8,_0xe962ba,_0x39bc2c),this['_update']({'attributes':_0xb828a8});}removeAttribute(_0x605124){const _0x1a127b=_0x346ba8(this['attributes']);_0x309af8(_0x1a127b,_0x605124),this['_update']({'attributes':_0x1a127b});}_update(_0x5cb0a2,_0x162817=!0x1){let _0xae0ceb=!0x1;const _0x495526={'id':this['id']};for(const _0x55ee8f of['name','createdAt','diffData','authors','attributes','toVersion','fromVersion','creatorId']){const _0x148d5a=_0x5cb0a2[_0x55ee8f];void 0x0!==_0x148d5a&&_0x148d5a!==this[_0x55ee8f]&&(this[_0x55ee8f]=_0x148d5a,_0x495526[_0x55ee8f]=_0x148d5a,_0xae0ceb=!0x0);}_0xae0ceb&&(_0x495526['authors']&&(_0x495526['authorsIds']=_0x495526['authors']['map'](_0x221d43=>_0x221d43['id']),delete _0x495526['authors']),this['fire']('_update',_0x495526,_0x162817));}toJSON(){return{'id':this['id'],'name':this['name'],'creatorId':this['creator']?this['creator']['id']:null,'authorsIds':this['authors']['map'](_0x2908e8=>_0x2908e8['id']),'diffData':this['diffData'],'createdAt':this['createdAt'],'attributes':this['attributes'],'fromVersion':this['fromVersion'],'toVersion':this['toVersion']};}},bt=class extends _0x544bf8{['_revisions'];static get requires(){return[_0x157f26];}static get['pluginName'](){return'RevisionsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get length(){return this['_revisions']['length'];}constructor(_0x16ea63){super(_0x16ea63),this['_revisions']=new _0x32a4f2();}afterInit(){!async function(_0x343bf3){const _0xe4580f='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x5747a1=0xeb829,_0xa705f5=0x79998,_0x4a0d25={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x1c71d9(_0x36e1ee){const _0x49d942=new window['Promise'](_0x15a6a9=>{_0x36e1ee['once']('ready',_0x15a6a9);}),_0x4ef59e=window['Date']['now'](),_0x485ed4=_0x36e1ee['config']['get']('licenseKey');async function _0x186a5c(){let _0x3d2ac9,_0x431690=null,_0x177de6=null;try{return'GPL'==_0x485ed4?'NotAllowed':(_0x3d2ac9=_0x175133(),_0x3d2ac9?(_0x3d2ac9['usageEndpoint']&&(_0x177de6=_0x113528(_0x3d2ac9['usageEndpoint'],_0x3d2ac9['jti'])),await _0x3af323()?_0xa692d0()?_0x3059b9()?'Expired':_0x376eb1()?('evaluation'==_0x3d2ac9['licenseType']&&(_0x431690=_0x2f1f8d('EvaluationLimit')),await _0x4c776a()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3059b9(){const _0x1cfe8e=['evaluation','trial']['includes'](_0x3d2ac9['licenseType'])?_0x4ef59e/0x3e8:0xe10*_0xa705f5;return _0x3d2ac9['exp']<_0x1cfe8e;}function _0xa692d0(){const _0x265dfe=_0x3d2ac9['features'];if(!_0x265dfe)return!0x1;if(_0x265dfe['includes']('*'))return!0x0;if(_0x265dfe['includes']('RH'))return!0x0;if(_0x265dfe['includes']('RRH')){if(_0x14d7d2())return!0x0;if(_0x3af8c1()||_0x482f45())return!0x0;}return!0x1;}function _0x376eb1(){const _0x51c001=_0x3d2ac9['licensedHosts'];if(!_0x51c001||0x0==_0x51c001['length'])return!0x0;const {hostname:_0x26c2d0}=new URL(window['location']['href']);if(_0x51c001['includes'](_0x26c2d0))return!0x0;const _0x42a057=_0x26c2d0['split']('.');return _0x51c001['filter'](_0x237fce=>_0x237fce['includes']('*'))['map'](_0x37b848=>_0x37b848['split']('.'))['filter'](_0x3547e1=>_0x3547e1['length']<=_0x42a057['length'])['map'](_0x2b60fc=>Array(_0x42a057['length']-_0x2b60fc['length'])['fill']('*'===_0x2b60fc[0x0]?'*':'')['concat'](_0x2b60fc))['some'](_0x2eca76=>_0x42a057['every']((_0xc3667d,_0x1bb347)=>_0x2eca76[_0x1bb347]===_0xc3667d||'*'===_0x2eca76[_0x1bb347]));}function _0x4c776a(){return _0x431690&&_0x177de6?new window['Promise']((_0x1a01ab,_0x198844)=>{_0x431690['then'](_0x1a01ab,_0x198844),_0x177de6['then'](_0x548e43=>{'Valid'!=_0x548e43&&_0x1a01ab(_0x548e43);},_0x198844);}):_0x431690||_0x177de6||'Valid';}}function _0x113528(_0x350150,_0x409a22){return new window['Promise'](_0x595ce0=>{if(_0x42f0df())return _0x595ce0('Valid');_0x2cd756(),_0x36e1ee['decorate']('_sendUsageRequest');let _0x371e12=!0x1;const _0x2c4f7c=_0x240cc1();function _0x2268f4(_0x16142f){return!!_0x16142f&&('object'==typeof _0x16142f||'function'==typeof _0x16142f)&&'function'==typeof _0x16142f['then']&&'function'==typeof _0x16142f['catch'];}function _0x29fd73(_0x424026){_0x177893(_0x424026)['then'](_0x3ee003=>_0x3ee003&&'ok'==_0x3ee003['status']?_0x331cf7(_0x2d001a(_0x2c4f7c+_0x409a22))!=_0x3ee003['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x2b71ec=>(_0x25882a(),_0x2b71ec),()=>{const _0x4cab9c=_0x269c8b();return null==_0x4cab9c?(_0x25882a(),'Valid'):_0x4ef59e-_0x4cab9c>0x240c8400?'UsageLimit':'Valid';})['then'](_0x595ce0)['catch'](()=>{_0x595ce0('UsageLimit');});const _0x455261=0x36ee80;function _0x25882a(){const _0x4a581b='llct-'+_0x331cf7(_0x2d001a(_0x350150)),_0x2d44eb=_0x235871(_0x331cf7(window['Math']['ceil'](_0x4ef59e/_0x455261)));window['localStorage']['setItem'](_0x4a581b,_0x2d44eb);}function _0x269c8b(){const _0x4de932='llct-'+_0x331cf7(_0x2d001a(_0x350150)),_0x43df4e=window['localStorage']['getItem'](_0x4de932);return _0x43df4e?window['parseInt'](_0x235871(_0x43df4e),0x10)*_0x455261:null;}function _0x177893(_0xaff3a3){return new window['Promise']((_0x3ae2be,_0x27284)=>{_0xaff3a3['then'](_0x3ae2be,_0x27284),window['setTimeout'](_0x27284,0x1d4c0);});}}_0x36e1ee['on']('_sendUsageRequest',(_0x556acb,_0x27bd1b)=>{if(_0x27bd1b[0x0]!=_0x350150)return _0x595ce0('UsageLimit');_0x27bd1b[0x1]={..._0x27bd1b[0x1],'requestId':_0x2c4f7c};},{'priority':'high'}),_0x36e1ee['on']('_sendUsageRequest',_0x4a871e=>{_0x2268f4(_0x4a871e['return'])&&(_0x371e12=!0x0,_0x29fd73(_0x4a871e['return']));},{'priority':'low'}),_0x49d942['then'](()=>{_0x371e12||_0x595ce0('UsageLimit');});});function _0x42f0df(){return'auto'==_0x36e1ee['editing']['view']['_overlayModeHint'];}function _0x2cd756(){_0x36e1ee['editing']['view']['_overlayModeHint']='auto';}}function _0x2f1f8d(_0xd77f96){const _0x3587eb=[new window['Promise'](_0x4b3851=>setTimeout(_0x4b3851,0x93ecc)),_0x49d942['then'](()=>new window['Promise'](_0x3b7dcc=>{const _0x3cb083=0x7,_0x2c213f=_0x343bf3['_revisions'];function _0x4af154(){_0x2c213f['length']>=_0x3cb083&&_0x3b7dcc();}_0x4af154(),_0x2c213f['on']('add',_0x4af154);})),new window['Promise'](_0x5833c4=>{function _0x1848f0(){for(const _0x266f12 in window)if(window['Number']['isNaN'](window['Number'](_0x266f12))&&window[_0x266f12]==_0x5747a1)return _0x5833c4();'destroyed'!=_0x36e1ee['state']&&window['setTimeout'](_0x1848f0,0x1388);}_0x14b5f7('RevisionViewer')&&_0x1848f0();})];return window['Promise']['race'](_0x3587eb)['then'](()=>_0xd77f96);}async function _0x45c11f(){if(await _0x49d942,_0x14b5f7('RevisionViewer')){const _0x477588=_0x343bf3['getRevision'](0x0),_0x5d4d4f=_0x343bf3['getEarlierVisibleRevision'](_0x477588['id']),_0x414916=_0xa43825('RevisionViewer');return await _0x414916['compare'](_0x477588['id'],_0x5d4d4f?_0x5d4d4f['id']:null,!0x0),_0x414916['unbind']('isEnabled'),_0x414916['isEnabled']=!0x1,_0x414916['compare']=_0x138f10,void(_0x414916['_getDiff']=_0x138f10);}if(_0x14b5f7('RevisionTracker')){const _0x3668c0=_0xa43825('RevisionTracker');_0x3668c0['unbind']('isEnabled'),_0x3668c0['isEnabled']=!0x1,_0x3668c0['update']=_0x138f10,_0x3668c0['saveRevision']=_0x138f10;}_0x36e1ee['model']['change']=_0x138f10,_0x36e1ee['model']['enqueueChange']=_0x138f10,_0x36e1ee['enableReadOnlyMode']('model');}function _0x14d7d2(){return _0x14b5f7('WebSocketGateway')&&'connected'==_0xa43825('WebSocketGateway')['state'];}function _0x3af8c1(){return _0x14b5f7('RevisionViewerIntegration');}function _0x482f45(){return _0x14b5f7('TrackChangesDataGetter');}function _0x248f36(_0x43adb5){const _0x9d672f=_0x5b1389();_0x36e1ee[_0x9d672f]='revisionHistoryLicenseKey'+_0x43adb5,_0x43adb5['endsWith']('Limit')&&(window[_0x5b1389()]=_0x5747a1),'Valid'!=_0x43adb5&&_0x45c11f();}function _0x5b1389(){const _0x1e7c47=window['String'](window['performance']['now']())['replace']('.','');let _0x2adc98='N';for(let _0x4ba0d7=0x0;_0x4ba0d7<_0x1e7c47['length'];_0x4ba0d7+=0x2){let _0x4153b6=window['parseInt'](_0x1e7c47['substring'](_0x4ba0d7,_0x4ba0d7+0x2));_0x4153b6>=0x3e&&(_0x4153b6-=0x3e),_0x2adc98+=_0xe4580f[_0x4153b6];}return _0x2adc98;}function _0x175133(){const _0x5a1aef=_0x485ed4['split']('.');if(0x3!=_0x5a1aef['length'])return null;return _0x4d7bb9(_0x5a1aef[0x1]);function _0x4d7bb9(_0x3d578c){const _0x4afe81=_0x4a1879(_0x3d578c);return _0x4afe81&&_0xc11b40()?_0x4afe81:null;function _0xc11b40(){const _0x542586=_0x4afe81['jti'],_0x3051a2=window['parseInt'](_0x542586['substring'](_0x542586['length']-0x8),0x10),_0x5e9bcd={..._0x4afe81,'jti':_0x542586['substring'](0x0,_0x542586['length']-0x8)};return delete _0x5e9bcd['vc'],_0x2d001a(_0x5e9bcd)==_0x3051a2;}}}async function _0x3af323(){let _0x4003ad=!0x0;try{const [_0x2db9ce,_0x4b2883,_0x275c80]=_0x485ed4['split']('.');return _0x2507cc(_0x2db9ce),await _0x1145fe(_0x2db9ce,_0x4b2883,_0x275c80),_0x4003ad;}catch{return!0x1;}function _0x2507cc(_0x236eb6){const _0x41743d=_0x4a1879(_0x236eb6);_0x41743d&&'ES256'==_0x41743d['alg']||(_0x4003ad=!0x1);}async function _0x1145fe(_0x20b598,_0x4bb56f,_0x2e5789){const _0x4adce8=window['Uint8Array']['from'](_0x1a4368(_0x2e5789),_0x53bbcb=>_0x53bbcb['charCodeAt'](0x0)),_0x20cdcc=new window['TextEncoder']()['encode'](_0x20b598+'.'+_0x4bb56f),_0x505909=window['crypto']['subtle'];if(!_0x505909)return;const _0xb32150=await _0x505909['importKey']('jwk',_0x4a0d25,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x505909['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0xb32150,_0x4adce8,_0x20cdcc)||(_0x4003ad=!0x1);}}function _0x4a1879(_0x2e2de9){return _0x2e2de9['startsWith']('ey')?JSON['parse'](_0x1a4368(_0x2e2de9)):null;}function _0x1a4368(_0x2f57f8){return window['atob'](_0x2f57f8['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2d001a(_0x41f0ab){let _0x1dd4fa=0x1505;function _0x4780b4(_0x1e71fb){for(let _0x3ed205=0x0;_0x3ed205<_0x1e71fb['length'];_0x3ed205++){const _0x1fae52=_0x1e71fb['charCodeAt'](_0x3ed205);_0x1dd4fa=(_0x1dd4fa<<0x5)+_0x1dd4fa+_0x1fae52,_0x1dd4fa&=_0x1dd4fa;}}function _0xa002db(_0x4a5756){Array['isArray'](_0x4a5756)?_0x4a5756['forEach'](_0xa002db):_0x4a5756&&'object'==typeof _0x4a5756?Object['entries'](_0x4a5756)['sort']()['forEach'](([_0x410454,_0x420143])=>{_0x4780b4(_0x410454),_0xa002db(_0x420143);}):_0x4780b4(window['String'](_0x4a5756));}return _0xa002db(_0x41f0ab),_0x1dd4fa>>>0x0;}function _0x331cf7(_0x545467){return _0x545467['toString'](0x10)['padStart'](0x8,'0');}function _0x235871(_0x333af1){return _0x333af1['split']('')['reverse']()['join']('');}function _0x14b5f7(_0x38ea90){return _0x36e1ee['plugins']['has'](_0x38ea90);}function _0xa43825(_0x152f16){return _0x36e1ee['plugins']['get'](_0x152f16);}function _0x138f10(){}_0x248f36(await _0x186a5c());}_0x1c71d9(_0x343bf3['editor']);}(this);}createRevision(_0xed96f9){const _0x1df3f5=this['editor']['plugins']['get']('Users');return new yt({'id':_0xed96f9['id'],'name':_0xed96f9['name'],'creator':_0xed96f9['creatorId']?_0x1df3f5['getUser'](_0xed96f9['creatorId']):null,'diffData':_0xed96f9['diffData']||_0xed96f9['data'],'authors':_0xed96f9['authorsIds']['map'](_0x3c42bf=>_0x1df3f5['getUser'](_0x3c42bf)),'createdAt':new Date(_0xed96f9['createdAt']),'attributes':_0xed96f9['attributes'],'fromVersion':_0xed96f9['fromVersion'],'toVersion':_0xed96f9['toVersion']});}['addRevision'](_0x23fdcc,_0x2287cc=0x0){this['_revisions']['add'](_0x23fdcc,_0x2287cc);}getRevision(_0x3ea385){return this['_revisions']['get'](_0x3ea385);}getRevisions(_0x34c6be={'toJSON':!0x1}){const _0x4048c2=Array['from'](this['_revisions']);return _0x4048c2['reverse'](),_0x34c6be['toJSON']?_0x4048c2['map'](_0x4a0411=>_0x4a0411['toJSON']()):_0x4048c2;}getIndex(_0x1c2f7f){return this['_revisions']['getIndex'](_0x1c2f7f);}getEarlierVisibleRevision(_0x4343a6){const [,_0x28a3a3]=this['getRevisionsIterator'](_0x4343a6,{'direction':'earlier'});return _0x28a3a3;}getLaterVisibleRevision(_0x5a3bec){const [,_0x1364a7]=this['getRevisionsIterator'](_0x5a3bec,{'direction':'later'});return _0x1364a7;}getRevisionsInDiff(_0x45c956){const _0x27a745=[];for(const _0x59598b of this['getRevisionsIterator'](_0x45c956['newRevisionId']))if(_0x27a745['push'](_0x59598b),_0x59598b['id']===_0x45c956['oldRevisionId'])break;return _0x27a745;}*getRevisionsIterator(_0x24acea,{direction:_0x5dc7bd='earlier',filter:_0x1c10fc=()=>!0x0}={}){const _0x1662d9='earlier'===_0x5dc7bd?0x1:-0x1;let _0x1c0238=this['_revisions']['get'](_0x24acea),_0x3ea865=this['getIndex'](_0x1c0238);for(yield _0x1c0238;_0x1c0238;){if(_0x3ea865+=_0x1662d9,_0x1c0238=this['getRevision'](_0x3ea865),!_0x1c0238)return;_0x1c10fc(_0x1c0238)&&(yield _0x1c0238);}}},Rt=class extends _0x544bf8{static get['pluginName'](){return'RevisionHistoryUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_viewClassToTypeChar']=new Map([[_0x32bc61,'c'],[_0x23c0b4,'a'],[_0x147194,'e'],[_0x2f30ee,'r'],[_0x26cf79,'u']]);_typeCharToViewClass=new Map([['c',_0x32bc61],['a',_0x23c0b4],['e',_0x147194],['r',_0x2f30ee],['u',_0x26cf79]]);async loadRevisionData(_0x2a86cb,_0xc71fb4){if(_0x2a86cb['diffData']||!_0xc71fb4)return;const _0x38c483=this['editor']['config']['get']('collaboration.channelId');_0x2a86cb['diffData']=(await _0xc71fb4['getRevision']({'channelId':_0x38c483,'revisionId':_0x2a86cb['id']}))['diffData'];}getRevisionDocumentData(_0x2dc053){const _0x59b7e1={};for(const _0x395c17 in _0x2dc053['diffData']){if(_0x2dc053['diffData'][_0x395c17]['attachChange']&&!_0x2dc053['diffData'][_0x395c17]['attachChange']['isAttached'])continue;const _0x5cb966=this['_removeRevisionMarkers'](JSON['parse'](_0x2dc053['diffData'][_0x395c17]['insertions'])),_0x3ca10d=this['editor']['editing']['view']['document'],_0x209efa=new _0x443d07(_0x3ca10d,_0x5cb966['map'](_0xa15510=>this['_getViewFromDiffObj'](_0xa15510,!0x1)));this['editor']['data']['processor']['useFillerType']('marked'),_0x59b7e1[_0x395c17]=this['editor']['data']['processor']['toData'](_0x209efa),this['editor']['data']['processor']['useFillerType']('default');}return _0x59b7e1;}getRevisionRootsAttributes(_0x8a0453){const _0x77f074={};for(const _0x578059 in _0x8a0453['diffData'])_0x8a0453['diffData'][_0x578059]['attachChange']&&!_0x8a0453['diffData'][_0x578059]['attachChange']['isAttached']||(_0x77f074[_0x578059]=_0x8a0453['diffData'][_0x578059]['attributesAfter']||{});return _0x77f074;}getRevisionRootsModelElements(_0x59153a){const _0x4217f1={};for(const _0x39a8a2 in _0x59153a['diffData']){if(_0x59153a['diffData'][_0x39a8a2]['attachChange']&&!_0x59153a['diffData'][_0x39a8a2]['attachChange']['isAttached'])continue;const _0x26612c=_0x59153a['diffData'][_0x39a8a2]['rootElementName'];_0x26612c&&(_0x4217f1[_0x39a8a2]=_0x26612c);}return _0x4217f1;}_getTypeCharForViewElement(_0x80f4f){return this['_viewClassToTypeChar']['get'](_0x80f4f['constructor']);}_getViewFromDiffObj(_0x38f2f3,_0x5e86b6){const _0x1662a0=this['editor']['editing']['view']['document'];if('string'==typeof _0x38f2f3)return new _0x1f997e(_0x1662a0,_0x38f2f3);{let _0x46cd5a,_0x28c762;_0x28c762='u'==_0x38f2f3['type']||'r'==_0x38f2f3['type']?[]:_0x38f2f3['children']['map'](_0x58030c=>this['_getViewFromDiffObj'](_0x58030c,_0x5e86b6));const _0x59a619=this['_typeCharToViewClass']['get'](_0x38f2f3['type'])||_0x2eab9a,_0xdff69b=this['editor']['data']['htmlProcessor']['domConverter'];if(_0x46cd5a=new _0x59a619(_0x1662a0,_0x38f2f3['name'],_0x38f2f3['attributes'],_0x28c762),'u'==_0x38f2f3['type']&&_0x38f2f3['children'][0x0]){const _0x42f548=_0x38f2f3['children'][0x0];if(_0x46cd5a['render']=function(_0x3e18a0){const _0x20f41c=_0x3e18a0['createElement']('div');return _0x20f41c['innerHTML']=_0x5c60d8(_0x42f548),_0x20f41c['childNodes'][0x0];},_0x5e86b6){const _0x22f4ff=new _0x443d07(_0x1662a0);_0x22f4ff['_appendChild'](_0x46cd5a);const _0x21d7c3=Array['from'](_0xdff69b['viewChildrenToDom'](_0x22f4ff,{'bind':!0x1})),_0x26e870=_0xdff69b['domDocument']['createElement']('div');_0x26e870['append'](..._0x21d7c3),_0x46cd5a=Array['from'](_0xdff69b['domChildrenToView'](_0x26e870))[0x0];}}else{if('r'==_0x38f2f3['type']&&_0x38f2f3['children'][0x0]){const _0x31badc=_0x38f2f3['children'][0x0];if(_0x46cd5a['render']=function(_0xb11d1f){_0xb11d1f['innerHTML']=_0x5c60d8(_0x31badc);},_0x5e86b6){const _0x211b11=new _0x443d07(_0x1662a0);_0x211b11['_appendChild'](_0x46cd5a);const _0x1a7c97=Array['from'](_0xdff69b['viewChildrenToDom'](_0x211b11,{'bind':!0x1})),_0x22c0cf=_0xdff69b['domDocument']['createElement']('div');_0x22c0cf['append'](..._0x1a7c97);const _0x3ddd85=Array['from'](_0xdff69b['domChildrenToView'](_0x22c0cf));_0x3ddd85['length']>0x1?_0x46cd5a['_appendChild'](_0x3ddd85):_0x46cd5a=_0x3ddd85[0x0];}}}if(_0x38f2f3['customProperties']){for(const [_0x47539b,_0x400edf]of _0x38f2f3['customProperties'])_0x46cd5a['_setCustomProperty'](_0x47539b,_0x400edf);}const _0x57975d=void 0x0===_0x38f2f3['fillerOffset']?null:_0x38f2f3['fillerOffset'];return null!==_0x57975d&&(_0x46cd5a['getFillerOffset']=()=>_0x57975d),_0x46cd5a;}}_makeModelFromViewString(_0xe8f0ca,_0x39ff31){const _0x371e70=JSON['parse'](_0xe8f0ca),_0x27a409=this['editor']['editing']['view']['document'],_0xc9cb44=new _0x443d07(_0x27a409,_0x371e70['map'](_0x19b949=>this['_getViewFromDiffObj'](_0x19b949,!0x0))),_0x43995a=this['editor']['data']['toModel'](_0xc9cb44,_0x39ff31);return _0x43995a['name']=_0x39ff31,_0x43995a;}['_removeRevisionMarkers'](_0x1f9195){return(_0x1f9195=_0x1f9195['filter'](_0x1dbcf5=>!_0x1dbcf5['name']||'revision-start'!==_0x1dbcf5['name']&&'revision-end'!==_0x1dbcf5['name']))['forEach'](_0x217dff=>{'string'!=typeof _0x217dff&&(_0x217dff['children']=this['_removeRevisionMarkers'](_0x217dff['children']),_0x217dff['attributes']=_0x217dff['attributes']['filter'](_0x185731=>!_0x185731[0x0]['startsWith']('data-revision-')));}),_0x1f9195;}};function kt(_0x403f21,_0x34f475,_0x3c10ca){const t=_0x403f21['t'];switch(_0x34f475){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'},_0x3c10ca);case'X_OF_Y_CHANGES':return t({'string':'%0\x20of\x20%1','id':'X_OF_Y_CHANGES'},_0x3c10ca);case'Show\x20previous\x20change':return t('Show\x20previous\x20change');case'Show\x20next\x20change':return t('Show\x20next\x20change');case'EDIT_X_OF_Y_REVISIONS':return t({'string':'Edit','id':'EDIT_X_OF_Y_REVISIONS'});case'Total':return t('Total');case'Revision\x20creator':return t('Revision\x20creator');case'Revision\x20author':return t('Revision\x20author');case'Revision\x20name':return t('Revision\x20name');case'Save\x20current\x20revision':return t('Save\x20current\x20revision');case'Accept':return t('Accept');case'Save':return t('Save');case'Cancel':return t('Cancel');case'Name\x20of\x20the\x20revision':return t('Name\x20of\x20the\x20revision');case'optional':return t('optional');case'PENDING_ACTION_REVISION_HISTORY':return t({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'The\x20revision\x20name\x20cannot\x20be\x20empty.':return t('The\x20revision\x20name\x20cannot\x20be\x20empty.');case'Enter\x20the\x20revision\x20name':return t('Enter\x20the\x20revision\x20name');case'REVISION_AI_SOURCE_PILL_LABEL':return t({'string':'Includes\x20AI\x20suggestions','id':'REVISION_AI_SOURCE_PILL_LABEL'});case'AI_SOURCE_REVISION_TOOLTIP':return t({'string':'This\x20revision\x20contains\x20AI-assisted\x20suggestions.','id':'AI_SOURCE_REVISION_TOOLTIP'});case'AI_SOURCE_CHANGE_TOOLTIP':return t({'string':'This\x20change\x20was\x20suggested\x20using\x20AI.','id':'AI_SOURCE_CHANGE_TOOLTIP'});case'AI_SOURCE_ADDED_BY':return t({'string':'Added\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_ADDED_BY'},_0x3c10ca);case'AI_SOURCE_REMOVED_BY':return t({'string':'Removed\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_REMOVED_BY'},_0x3c10ca);case'AI_SOURCE_SUGGESTED_BY':return t({'string':'Suggested\x20by\x20%0\x20using\x20%1','id':'AI_SOURCE_SUGGESTED_BY'},_0x3c10ca);case'AI_SOURCE_AI':return t({'string':'AI','id':'AI_SOURCE_AI'});default:return'';}}var At=class extends _0x544bf8{['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[_0x157f26,bt,Rt,_0x3f141d];}constructor(_0x4e4da4){super(_0x4e4da4),this['repository']=this['editor']['plugins']['get']('RevisionsRepository'),this['_utils']=this['editor']['plugins']['get']('RevisionHistoryUtils'),this['_revisionDataBuilder']=new It(this['editor']),this['_initialRevisionId']=this['editor']['config']['get']('collaboration.channelId')||'initial',this['_bufferedUpdates']=new Map(),this['_loadedStateData']=null;const _0x5e51fa=_0x240cc1();this['_source']={'history':this['editor']['model']['document']['history'],'getLatestVersion':()=>Promise['resolve'](this['editor']['model']['document']['version']),'getCurrentRevisionId':()=>_0x5e51fa},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 _0x58f4f0=this['repository']['getRevision'](0x0),_0x1cd97e=_0x58f4f0&&null===_0x58f4f0['creator']?_0x58f4f0:null;if(this['_continueCurrentRevision']=!!_0x1cd97e&&this['editor']['config']['get']('revisionHistory.resumeUnsavedRevision'),this['editor']['plugins']['has']('RealTimeCollaborationClient')){const _0x5308b2=this['_source']['getCurrentRevisionId'](),_0x59ebe3=this['repository']['getRevision'](_0x5308b2);if(_0x59ebe3)this['_startingVersion']=_0x59ebe3['fromVersion'],this['_continueCurrentRevision']=!0x1;else{const _0xd2f94c=this['_source']['history']['_operations']['find'](_0xb7011b=>!_0xb7011b['_isInit']),_0x2aff48=_0xd2f94c?_0xd2f94c['baseVersion']:this['_source']['history']['version'];_0x58f4f0?(_0x58f4f0['toVersion']<_0x2aff48&&_0x58f4f0['_update']({'toVersion':_0x2aff48}),this['_continueCurrentRevision']?(this['_source']['getCurrentRevisionId']=()=>_0x1cd97e['id'],this['_startingVersion']=_0x1cd97e['fromVersion']):(this['_startingVersion']=_0x58f4f0['toVersion'],this['_continueCurrentRevision']=!0x1)):(this['_startingVersion']=_0x2aff48,this['_continueCurrentRevision']=!0x1);}}else _0x1cd97e&&(this['editor']['model']['document']['history']['version']=Math['max'](_0x1cd97e['toVersion'],this['editor']['model']['document']['history']['version']),_0x1cd97e['fromVersion']===_0x1cd97e['toVersion']?(0x0!==_0x1cd97e['fromVersion']&&(this['_source']['getCurrentRevisionId']=()=>_0x1cd97e['id']),this['_continueCurrentRevision']=!0x1):this['_continueCurrentRevision']&&(this['_source']['getCurrentRevisionId']=()=>_0x1cd97e['id'],this['_startingVersion']=_0x1cd97e['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',_0x166deb=>!_0x166deb),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x5a10a5=[this['editor']];for(const _0x2321c3 of _0x5a10a5){let _0x433bb6;for(const _0x4ebb3b in _0x2321c3){const _0x3fc7bf=_0x4ebb3b,_0x3b6348=_0x2321c3[_0x3fc7bf];if('revisionHistoryLicenseKeyValid'==_0x3b6348||'revisionHistoryLicenseKeyInvalid'==_0x3b6348||'revisionHistoryLicenseKeyExpired'==_0x3b6348||'revisionHistoryLicenseKeyDomainLimit'==_0x3b6348||'revisionHistoryLicenseKeyNotAllowed'==_0x3b6348||'revisionHistoryLicenseKeyEvaluationLimit'==_0x3b6348||'revisionHistoryLicenseKeyUsageLimit'==_0x3b6348){delete _0x2321c3[_0x3fc7bf],_0x433bb6=_0x3b6348,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'revisionHistoryLicenseKeyInvalid'==_0x433bb6&&_0x2321c3['_showLicenseError']('invalid'),'revisionHistoryLicenseKeyExpired'==_0x433bb6&&_0x2321c3['_showLicenseError']('expired'),'revisionHistoryLicenseKeyDomainLimit'==_0x433bb6&&_0x2321c3['_showLicenseError']('domainLimit'),'revisionHistoryLicenseKeyNotAllowed'==_0x433bb6&&_0x2321c3['_showLicenseError']('featureNotAllowed','RevisionHistory'),'revisionHistoryLicenseKeyEvaluationLimit'==_0x433bb6&&_0x2321c3['_showLicenseError']('evaluationLimit'),'revisionHistoryLicenseKeyUsageLimit'==_0x433bb6&&_0x2321c3['_showLicenseError']('usageLimit');}},0x3e8);}async afterInit(){if(this['repository']['length']>0x0){const _0x58f5f7=this['repository']['getRevision'](0x0),_0x6b10d3=await this['getRevisionDocumentData'](_0x58f5f7),_0x21d928=await this['getRevisionRootsAttributes'](_0x58f5f7),_0x1c82d2=this['_utils']['getRevisionRootsModelElements'](_0x58f5f7);this['_replaceEditorDataWithRevisionData'](_0x6b10d3,_0x21d928,_0x1c82d2);}}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}setSource(_0x5dd816){this['_source']=_0x5dd816;}async update(){const _0x39cb05=await this['_source']['getLatestVersion']();if(_0x39cb05>this['currentRevision']['toVersion']){await this['_loadState']();const _0x37b3a8=this['buildRevisionData']({'revision':this['currentRevision'],'to':_0x39cb05});_0x37b3a8['authors']=_0x37b3a8['authorsIds']['map'](_0x34caa8=>this['editor']['plugins']['get']('Users')['getUser'](_0x34caa8)),this['currentRevision']['_update'](_0x37b3a8);}}async['saveRevision'](_0x189476={},_0x3f07b4=null){const _0x14524b=[];await this['_loadState'](),this['_continueCurrentRevision']=!0x1,_0x3f07b4>this['currentRevision']['toVersion']&&(_0x3f07b4=null),null===_0x3f07b4&&(_0x3f07b4=await this['_source']['getLatestVersion']());const _0xd05603=this['_getFromVersion'](_0x3f07b4),_0x56ddaa=this['buildRevisionData']({'from':_0xd05603,'to':_0x3f07b4});if(this['currentRevision']['toVersion']<_0x3f07b4){const _0x7b2353=this['buildRevisionData']({'revision':this['currentRevision'],'from':_0x3f07b4,'to':_0x3f07b4});_0x7b2353['authors']=[],_0x7b2353['authorsIds']=[],_0x7b2353['id']=this['currentRevision']['id'],this['currentRevision']['_update'](_0x7b2353,!0x0),delete _0x7b2353['authors'],_0x14524b['push'](_0x7b2353);}const _0x62d760={..._0x189476,'creatorId':this['editor']['plugins']['get']('Users')['me']['id'],'name':_0x189476['name']||null,'id':_0x189476['id']||_0x240cc1(),..._0x56ddaa,'attributes':{..._0x189476['attributes'],..._0x56ddaa['attributes']}},_0x3591d9=this['addRevisionData'](_0x62d760);_0x14524b['push'](_0x62d760);const _0x2aff4a=this['repository']['getIndex'](_0x3591d9);if(0x0!==_0x2aff4a){const _0x507f97=this['repository']['getRevision'](_0x2aff4a-0x1);if(_0x507f97['fromVersion']!==_0x3f07b4){const _0x12ca78=this['_revisionDataBuilder']['getData'](_0x3f07b4,_0x507f97['toVersion']),_0x29ec8b={'id':_0x507f97['id'],'diffData':_0x12ca78['diffData'],'authorsIds':_0x12ca78['authorsIds'],'authors':_0x12ca78['authorsIds']['map'](_0x5e158b=>this['editor']['plugins']['get']('Users')['getUser'](_0x5e158b)),'fromVersion':_0x3f07b4};this['_stampAiAttribute'](_0x29ec8b,_0x507f97,!!_0x12ca78['hasAIChanges']),_0x507f97===this['currentRevision']&&(_0x29ec8b['createdAt']=new Date(_0x62d760['createdAt']['getTime']()+0xa)),_0x507f97['_update'](_0x29ec8b,!0x0),delete _0x29ec8b['authors'],_0x14524b['push'](_0x29ec8b);}}if(this['adapter']){for(const _0x2747b7 of _0x14524b)this['_bufferUpdate'](_0x2747b7['id'],_0x2747b7,!0x0);this['sendBufferedUpdates']();}return _0x3591d9;}addRevisionData(_0x47f244){const _0x36a6eb=this['repository']['createRevision'](_0x47f244);return this['adapter']&&_0x36a6eb['on']('_update',(_0x375c89,_0xfc28f7,_0x1a3d2b)=>{_0x1a3d2b||(this['_bufferUpdate'](_0xfc28f7['id'],_0xfc28f7,!0x0),this['sendBufferedUpdates']());}),this['repository']['addRevision'](_0x36a6eb,this['_findInsertionIndex'](_0x36a6eb)),_0x36a6eb;}async getRevisionDocumentData(_0x3b1539){return await this['_utils']['loadRevisionData'](_0x3b1539,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x3b1539);}async getRevisionRootsAttributes(_0xae9886){return await this['_utils']['loadRevisionData'](_0xae9886,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0xae9886);}sendBufferedUpdates(){if(0x0===this['_bufferedUpdates']['size'])return;if(this['_isPendingUpdate'])return;let _0x4e1534=Array['from'](this['_bufferedUpdates']['values']());this['_bufferedUpdates']['clear']();for(let _0x59d855=0x0;_0x59d855<_0x4e1534['length'];_0x59d855++){const _0x185f97=_0x4e1534[_0x59d855];let _0x235640=!0x1;for(const _0x3422c2 of Object['keys'](_0x185f97))void 0x0===_0x185f97[_0x3422c2]?delete _0x185f97[_0x3422c2]:'id'!==_0x3422c2&&(_0x235640=!0x0);_0x235640||(_0x4e1534[_0x59d855]=null);}if(_0x4e1534=_0x4e1534['filter'](_0x38eb8f=>null!==_0x38eb8f),!_0x4e1534['length'])return;for(let _0x3c95ac=0x0;_0x3c95ac<_0x4e1534['length'];_0x3c95ac++){const _0x4b19c8=_0x4e1534[_0x3c95ac];void 0x0!==_0x4b19c8['fromVersion']&&void 0x0===_0x4b19c8['toVersion']&&(_0x4b19c8['toVersion']=this['repository']['getRevision'](_0x4b19c8['id'])['toVersion']),void 0x0!==_0x4b19c8['toVersion']&&void 0x0===_0x4b19c8['fromVersion']&&(_0x4b19c8['fromVersion']=this['repository']['getRevision'](_0x4b19c8['id'])['fromVersion']);}const _0x326917=this['editor']['config']['get']('collaboration.channelId');this['_isPendingUpdate']=!0x0,this['_addPendingAction'](),this['adapter']['updateRevisions'](_0x4e1534,_0x326917)['finally'](()=>{this['_isPendingUpdate']=!0x1;})['then'](_0x4d40ce=>{if(_0x4d40ce){for(const _0x321ebc of _0x4d40ce)this['setRevisionData']({'id':_0x321ebc['id'],'createdAt':_0x321ebc['createdAt']});}this['_removePendingAction'](),this['sendBufferedUpdates']();});}_stampAiAttribute(_0x30dd60,_0x273b65,_0x131a38){if(_0x131a38===(!!_0x273b65&&!!_0x273b65['attributes']['@ai']))return;const _0xe83619={..._0x273b65?_0x273b65['attributes']:{},..._0x30dd60['attributes']};_0x131a38?_0xe83619['@ai']=!0x0:delete _0xe83619['@ai'],_0x30dd60['attributes']=_0xe83619;}buildRevisionData({revision:_0x9beaed=null,from:_0x3c0c90=null,to:_0x31fa0d=null}){_0x3c0c90=null!==_0x3c0c90?_0x3c0c90:_0x9beaed['fromVersion'],_0x31fa0d=null!==_0x31fa0d?_0x31fa0d:_0x9beaed['toVersion'];const _0x219761=this['_revisionDataBuilder']['getData'](_0x3c0c90,_0x31fa0d),_0x2bacda={'diffData':_0x219761['diffData'],'authorsIds':_0x219761['authorsIds'],'fromVersion':_0x3c0c90,'toVersion':_0x31fa0d};if(this['_stampAiAttribute'](_0x2bacda,_0x9beaed,!!_0x219761['hasAIChanges']),!_0x9beaed||_0x31fa0d!==_0x9beaed['toVersion']){const _0x842257=_0x31fa0d-0x1,_0x439461=this['_source']['history']['getOperation'](_0x842257);_0x2bacda['createdAt']=_0x439461&&_0x439461['createdAt']||new Date();}if(this['_loadedStateData']&&_0x3c0c90===this['_loadedStateData']['fromVersion']){for(const _0x36d85f of this['_loadedStateData']['authors'])_0x2bacda['authorsIds']['includes'](_0x36d85f['id'])||_0x2bacda['authorsIds']['push'](_0x36d85f['id']);}return _0x2bacda;}_bufferUpdate(_0x1c2ce5,_0x2a3383,_0x2b20b2){if(this['_bufferedUpdates']['has'](_0x1c2ce5)){const _0x4bbaa2=this['_bufferedUpdates']['get'](_0x1c2ce5);_0x2a3383=_0x2b20b2?{..._0x4bbaa2,..._0x2a3383}:{..._0x2a3383,..._0x4bbaa2};}this['_bufferedUpdates']['set'](_0x1c2ce5,_0x2a3383);}setRevisionData(_0x2065ec){const _0x2e07b6=this['repository']['getRevision'](_0x2065ec['id']);if(_0x2065ec['createdAt']&&(_0x2065ec['createdAt']=new Date(_0x2065ec['createdAt'])),_0x2065ec['authorsIds']){const _0x4d97d7=this['editor']['plugins']['get']('Users');_0x2065ec['authors']=_0x2065ec['authorsIds']['map'](_0x36bc26=>_0x4d97d7['getUser'](_0x36bc26));}_0x2e07b6['_update'](_0x2065ec,!0x0);}_createInitialRevision(_0x59c331){const _0x5e8ce4=this['repository']['getRevision'](this['repository']['length']-0x1);if(_0x5e8ce4)this['_initialRevisionId']=_0x5e8ce4['id'];else{const _0x29c10c=!this['editor']['model']['document']['roots']['find'](_0x2b0938=>this['editor']['model']['hasContent'](_0x2b0938)),_0x3ce312=this['editor']['plugins']['get']('Users')['me']['id'],_0x2eab13=kt(this['editor']['locale'],_0x29c10c?'Empty\x20document':'Initial\x20revision');this['_makeRevision']({'from':_0x59c331,'to':_0x59c331,'id':this['_initialRevisionId'],'name':_0x2eab13,'creatorId':_0x3ce312});}}_createCurrentRevision(_0x8c762c){const _0xe4809e=this['_source']['getCurrentRevisionId']();this['currentRevision']=this['repository']['getRevision'](_0xe4809e),this['currentRevision']||(this['currentRevision']=this['_makeRevision']({'from':_0x8c762c,'to':_0x8c762c,'id':_0xe4809e,'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(_0x51e608,_0x18bce3,_0x247513){const _0x4b9535={},_0x2939ff={},_0x2945af={},_0x209878=this['editor']['config']['get']('roots')||{};for(const [_0xd64f5d,_0x4bae7f]of Object['entries'](_0x209878))_0x4bae7f['lazyLoad']||(_0x4b9535[_0xd64f5d]=_0x4bae7f['initialData']??'',_0x2939ff[_0xd64f5d]=_0x4bae7f['modelAttributes']||{},_0x4bae7f['modelElement']&&(_0x2945af[_0xd64f5d]=_0x4bae7f['modelElement']));for(const _0x28cb01 of this['editor']['model']['document']['getRootNames']())_0x4b9535[_0x28cb01]??='',_0x2939ff[_0x28cb01]??={};let _0x1efe70=!0x1;const _0x3c5f79=Object['keys'](_0x4b9535),_0x5ce580=Object['keys'](_0x51e608);for(const _0x2786de of _0x3c5f79){if(_0x4b9535[_0x2786de]!==_0x51e608[_0x2786de]&&''!==_0x4b9535[_0x2786de]['trim']()){_0x1efe70=!0x0;break;}if(!_0x235614(_0x2939ff[_0x2786de],_0x18bce3[_0x2786de])&&Object['keys'](_0x2939ff[_0x2786de])['length']>0x0){_0x1efe70=!0x0;break;}const _0x2d99e8=_0x2945af[_0x2786de],_0x4a6e13=_0x247513[_0x2786de];if(_0x2d99e8&&_0x4a6e13&&_0x2d99e8!==_0x4a6e13){_0x1efe70=!0x0;break;}}_0x1efe70||(_0x1efe70=_0x5ce580['some'](_0x36935b=>!this['editor']['model']['document']['getRoot'](_0x36935b))),_0x1efe70&&_0x11b5c9('editor-initial-data-replaced-with-revision-data',{'editorData':_0x4b9535,'editorRootsAttributes':_0x2939ff,'editorRootsModelElements':_0x2945af,'revisionData':_0x51e608,'revisionRootsAttributes':_0x18bce3,'revisionRootsModelElements':_0x247513});for(const [_0x1ead3a,_0x7e98d2]of Object['entries'](_0x51e608))this['editor']['config']['set']('roots.'+_0x1ead3a+'.initialData',_0x7e98d2);for(const [_0x2b7cfb,_0x3bc9b3]of Object['entries'](_0x18bce3))this['editor']['config']['set']('roots.'+_0x2b7cfb+'.modelAttributes',_0x3bc9b3);const _0x3deb60=this['editor']['model']['document'];for(const [_0x906be1,_0xebccb2]of Object['entries'](_0x247513)){this['editor']['config']['set']('roots.'+_0x906be1+'.modelElement',_0xebccb2);const _0x345272=_0x3deb60['getRoot'](_0x906be1);_0x345272&&_0x345272['name']!==_0xebccb2&&(_0x3deb60['roots']['remove'](_0x906be1),_0x3deb60['createRoot'](_0xebccb2,_0x906be1));}}_addPendingAction(){if(!this['_pendingAction']){const _0x45f321=this['editor']['plugins']['get']('PendingActions');this['_pendingAction']=_0x45f321['add'](kt(this['editor']['locale'],'PENDING_ACTION_REVISION_HISTORY'));}}_removePendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get']('PendingActions')['remove'](this['_pendingAction']),this['_pendingAction']=null);}_findInsertionIndex(_0x266780){const _0x451456=this['repository']['getRevisions']();_0x451456['reverse']();let _0x3d343c=0x0;for(;_0x3d343c<_0x451456['length'];){const _0x4ddfe4=_0x451456[_0x3d343c];if(_0x4ddfe4===this['currentRevision']){_0x3d343c++;continue;}if(_0x4ddfe4['id']===this['_initialRevisionId'])break;const _0x56f3ae=_0x266780['toVersion']-_0x4ddfe4['toVersion']||_0x266780['fromVersion']-_0x4ddfe4['fromVersion'];if(_0x56f3ae>0x0)break;if(_0x56f3ae<0x0)_0x3d343c++;else{if(!_0x266780['creator']&&_0x4ddfe4['creator'])break;if(_0x4ddfe4['creator']||!_0x266780['creator']){if(_0x266780['createdAt']>_0x4ddfe4['createdAt'])break;_0x3d343c++;}else _0x3d343c++;}}return _0x3d343c;}_getFromVersion(_0x39c3bb){const _0x24ff05=this['repository']['getRevisions']();_0x24ff05['reverse'](),_0x24ff05['shift']();const _0x107eb2=_0x24ff05['find'](_0x14b848=>_0x14b848['toVersion']<=_0x39c3bb)['toVersion'];return _0x107eb2<this['_startingVersion']?this['_startingVersion']:_0x107eb2;}['_makeRevision']({name:_0x499e0b,from:_0x1b2bf9,to:_0x10ef18,creatorId:_0x37b5f6,id:_0x3e8c91}){const _0x3e4c39=this['buildRevisionData']({'from':_0x1b2bf9,'to':_0x10ef18});_0x3e4c39['name']=_0x499e0b,_0x3e4c39['creatorId']=_0x37b5f6,_0x3e4c39['id']=_0x3e8c91;const _0x3eacf7=this['addRevisionData'](_0x3e4c39);return this['adapter']&&this['_bufferUpdate'](_0x3e4c39['id'],_0x3e4c39,!0x0),_0x3eacf7;}_setConversion(){this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'});}},It=class{editor;['source'];_savedMetaData;_lastFrom;_lastTo;['_markers'];_diffRoots;_diffRootsAttributes;_baseRoots;_baseRootsAttributes;_idsRoots;_baseIdsRoots;_touched;_touchedMarkers;['_aiTouchedMarkers'];_touchedRoots;['_revisionId'];_startingRevisionId;constructor(_0x9e06b5){this['editor']=_0x9e06b5,this['_savedMetaData']=new Map(),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_markers']=new Map(),this['_diffRoots']=new Map(),this['_diffRootsAttributes']=new Map(),this['_baseRoots']=new Map(),this['_baseRootsAttributes']=new Map(),this['_idsRoots']=new Map(),this['_baseIdsRoots']=new Map(),this['_touched']=new Map(),this['_touchedMarkers']=new Map(),this['_aiTouchedMarkers']=new Map(),this['_touchedRoots']=new Map(),this['_revisionId']=0x1;}init(_0x3226fc){this['source']=_0x3226fc;const _0x4d8a4c=new Map(),_0x5217dc=new Map(),_0xd518f5=this['editor']['model']['document']['roots']['map'](_0x317a41=>_0x317a41['rootName']);for(const _0xca0a6 of _0xd518f5){const _0x13c497=this['editor']['model']['document']['getRoot'](_0xca0a6),_0x3667b4=St(_0x13c497);_0x4d8a4c['set'](_0xca0a6,_0x3667b4),_0x5217dc['set'](_0xca0a6,Object['fromEntries'](_0x13c497['getAttributes']()));}const _0x2f6732=Array['from'](this['editor']['model']['markers'])['map'](_0x5d8ffc=>[_0x5d8ffc['name'],_0x5d8ffc['getRange']()]),_0x456911=this['source']['version'];this['_saveMetaData'](_0x456911,_0x4d8a4c,_0x2f6732,_0x5217dc),this['_startingRevisionId']=this['_revisionId'];const _0x17691f=new Map(),_0x3f24cb=new Map();for(const _0x395503 of _0xd518f5){const _0x5bde14=Et(_0x395503,this['editor']['model']['document']['getRoot'](_0x395503)['name']);_0x17691f['set'](_0x395503,_0x5bde14),_0x3f24cb['set'](_0x395503,{});}this['_saveMetaData'](Number['NEGATIVE_INFINITY'],_0x17691f,[],_0x3f24cb);}getData(_0x237fa1,_0x2973fc){if(this['_lastFrom']===_0x237fa1&&this['_lastTo']<=_0x2973fc)this['_savedMetaData']['size']>0x1&&this['_removeMetaData'](this['_lastTo']),this['_applyOperations'](this['_lastTo'],_0x2973fc,!0x0);else{if(!this['_savedMetaData']['has'](_0x237fa1)){const _0x36b6be=this['_getPreviousFrom'](_0x237fa1);this['_calculateMetaData'](_0x36b6be,_0x237fa1,!0x1);}this['_calculateMetaData'](_0x237fa1,_0x2973fc,!0x0);}return this['_lastFrom']=_0x237fa1,this['_lastTo']=_0x2973fc,this['_getState']();}loadState(_0x820279){if(!this['_savedMetaData']['has'](_0x820279['fromVersion'])){const _0x11b4d7=this['_getPreviousFrom'](_0x820279['fromVersion']);this['_calculateMetaData'](_0x11b4d7,_0x820279['fromVersion'],!0x1);}this['_calculateMetaData'](_0x820279['fromVersion'],_0x820279['toVersion'],!0x1);const _0xed68fa=this['editor']['plugins']['get']('RevisionHistoryUtils');this['_reset'](),this['_lastFrom']=_0x820279['fromVersion'],this['_lastTo']=_0x820279['toVersion'];for(const _0x548399 in _0x820279['diffData']){const _0x349361=_0x820279['diffData'][_0x548399]['attachChange'],_0x56a693=_0x346ba8(_0x820279['diffData'][_0x548399]['attributesBefore'])||{},_0x112418=_0x820279['diffData'][_0x548399],_0x23e99b=_0xed68fa['_makeModelFromViewString'](_0x112418['deletions'],_0x112418['rootElementName']||'$root');_0x23e99b['rootName']=_0x548399,_0x23e99b['_isAttached']=!_0x349361||!_0x349361['isAttached'],_0x23e99b['isAttached']=()=>_0x23e99b['_isAttached'],this['_baseRoots']['set'](_0x548399,_0x23e99b),this['_baseRootsAttributes']['set'](_0x548399,_0x56a693),_0x349361&&this['_touchedRoots']['set'](_0x548399,_0x349361);const _0x1b4e8d=this['_makeIdsRoot'](_0x23e99b);this['_baseIdsRoots']['set'](_0x548399,_0x1b4e8d);for(const [_0x916544,_0xacf40d]of _0x23e99b['markers']){if(!_0x916544['startsWith']('revision:'))continue;const _0x54c7bd=_0x916544['split'](':')[0x2],_0xee82bf=_0x112418['aiSources']?.[_0x916544]||null;for(const _0x377923 of _0xacf40d['getWalker']({'singleCharacters':!0x0})){const _0x18868e=this['_getVidAttributeName'](_0x377923),_0x532e80='elementEnd'==_0x377923['type']?_0x377923['previousPosition']['path']['slice'](0x0,-0x1):_0x377923['previousPosition']['path'],_0x49d7e9=_0x1b4e8d['getNodeByPath'](_0x532e80)['getAttribute'](_0x18868e);this['_touched']['set'](_0x49d7e9,{'userId':_0x54c7bd,'aiSource':_0xee82bf});}_0x23e99b['markers']['delete'](_0x916544);}}this['_startingRevisionId']=this['_revisionId'];const _0xe758d9=[...Array(this['_revisionId'])['keys']()]['slice'](0x1)['filter'](_0x5cc23c=>!this['_touched']['has'](_0x5cc23c));let _0x45b0f7=0x0;const _0x37c4c6=new Map();for(const _0x449d35 in _0x820279['diffData']){const _0x586bbd=_0x820279['diffData'][_0x449d35]['attachChange'],_0x455b2f=_0x346ba8(_0x820279['diffData'][_0x449d35]['attributesAfter'])||{},_0x5eafdb=_0x820279['diffData'][_0x449d35],_0x32b3f6=_0xed68fa['_makeModelFromViewString'](_0x5eafdb['insertions'],_0x5eafdb['rootElementName']||'$root');_0x32b3f6['rootName']=_0x449d35,_0x32b3f6['_isAttached']=!_0x586bbd||_0x586bbd['isAttached'],_0x32b3f6['isAttached']=()=>_0x32b3f6['_isAttached'],this['_diffRoots']['set'](_0x449d35,_0x32b3f6),this['_diffRootsAttributes']['set'](_0x449d35,_0x455b2f);const _0x941c68=this['_makeIdsRoot'](_0x32b3f6,Number['NEGATIVE_INFINITY']);this['_idsRoots']['set'](_0x449d35,_0x941c68),_0x37c4c6['set'](_0x449d35,_0x32b3f6['isAttached']()?_0x455b2f:{});for(const [_0x214af4,_0x3a7cdb]of _0x32b3f6['markers']){if(!_0x214af4['startsWith']('revision:'))continue;const _0x1fc3bc=_0x214af4['split'](':')[0x2],_0x3bb6d5=_0x5eafdb['aiSources']?.[_0x214af4]||null;for(const _0x490f45 of _0x3a7cdb['getWalker']({'singleCharacters':!0x0})){const _0x1db6a6=this['_getVidAttributeName'](_0x490f45),_0x5d89be=this['_revisionId']++,_0x121e34='elementEnd'==_0x490f45['type']?_0x490f45['previousPosition']['path']['slice'](0x0,-0x1):_0x490f45['previousPosition']['path'];_0x941c68['getNodeByPath'](_0x121e34)['_setAttribute'](_0x1db6a6,_0x5d89be),this['_touched']['set'](_0x5d89be,{'userId':_0x1fc3bc,'aiSource':_0x3bb6d5});}_0x32b3f6['markers']['delete'](_0x214af4);}for(const _0x341899 of this['editor']['model']['createRangeIn'](_0x32b3f6)['getWalker']({'singleCharacters':!0x0})){const _0x46b573=this['_getVidAttributeName'](_0x341899),_0x5d59ff='elementEnd'==_0x341899['type']?_0x341899['previousPosition']['path']['slice'](0x0,-0x1):_0x341899['previousPosition']['path'],_0xd3ef2f=_0x941c68['getNodeByPath'](_0x5d59ff);_0xd3ef2f['getAttribute'](_0x46b573)>0x0||_0xd3ef2f['_setAttribute'](_0x46b573,_0xe758d9[_0x45b0f7++]);}for(const [_0x31a0e5,_0xa9c0dd]of _0x32b3f6['markers'])_0x31a0e5['startsWith']('revision:')||this['_markers']['set'](_0x31a0e5,_0xa9c0dd);}const {roots:_0x2ae2a8}=this['_savedMetaData']['get'](_0x820279['fromVersion']),{roots:_0x2cab53}=this['_savedMetaData']['get'](_0x820279['toVersion']),_0x6da703=St(_0x2ae2a8['get']('$graveyard'));this['_baseRoots']['set']('$graveyard',_0x6da703),this['_baseIdsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x6da703,Number['NEGATIVE_INFINITY']));const _0x55bf98=St(_0x2cab53['get']('$graveyard'));this['_diffRoots']['set']('$graveyard',_0x55bf98),this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](_0x55bf98));const _0x381ed0=Array['from'](this['_diffRoots'])['map'](([_0x375b49,_0x5e1673])=>[_0x375b49,St(_0x5e1673)]);this['_saveMetaData'](this['_lastTo'],_0x381ed0,this['_markers'],_0x37c4c6);}reInit(){this['_reset'](),this['_lastFrom']=-0x1,this['_lastTo']=-0x1,this['_savedMetaData']['clear'](),this['init'](this['source']);}_saveMetaData(_0x2e99ad,_0x4f1daa,_0x52bdfd,_0x4221ab){const _0x77584a=new Map(_0x4f1daa),_0x56a978=new Map(_0x346ba8(_0x4221ab)),_0x138134=new Map();for(const [_0x5d3002,_0x2a667e]of _0x52bdfd)_0x138134['set'](_0x5d3002,{'start':_0x2a667e['start']['clone'](),'end':_0x2a667e['end']['clone'](),'rootName':_0x2a667e['root']['rootName']});this['_savedMetaData']['set'](_0x2e99ad,{'roots':_0x77584a,'markers':_0x138134,'rootsAttributes':_0x56a978});}_removeMetaData(_0x18e1a9){this['_savedMetaData']['delete'](_0x18e1a9);}_reset(){this['_touched']['clear'](),this['_touchedMarkers']['clear'](),this['_aiTouchedMarkers']['clear'](),this['_touchedRoots']['clear'](),this['_diffRoots']['clear'](),this['_diffRootsAttributes']['clear'](),this['_baseRoots']['clear'](),this['_baseRootsAttributes']['clear'](),this['_idsRoots']['clear'](),this['_baseIdsRoots']['clear'](),this['_markers']['clear'](),this['_revisionId']=0x1,this['_startingRevisionId']=this['_revisionId'];}_makeIdsRoot(_0x1dcb0b,_0xda10d=null){let _0x399ab1=null;_0x1dcb0b['is']('documentFragment')||(_0x399ab1=new _0x19c548(_0x1dcb0b['name'],{'vid_start':null===_0xda10d?this['_revisionId']++:_0xda10d++}));const _0x3e3cbc=[];for(const _0xfd073f of _0x1dcb0b['getChildren']())if(_0xfd073f['is']('element')){_0x3e3cbc['push'](this['_makeIdsRoot'](_0xfd073f,_0xda10d));const _0x1efa36=_0x3e3cbc[_0x3e3cbc['length']-0x1];null!==_0xda10d&&(_0xda10d=_0x1efa36['is']('element','$text')?_0x1efa36['getAttribute']('vid')+0x1:_0x1efa36['getAttribute']('vid_end')+0x1);}else{for(let _0x513322=0x0;_0x513322<_0xfd073f['offsetSize'];_0x513322++)_0x3e3cbc['push'](new _0x19c548('$text',{'vid':null===_0xda10d?this['_revisionId']++:_0xda10d++}));}if(_0x1dcb0b['is']('documentFragment')){const _0x5f516d=Et(_0x1dcb0b['rootName'],_0x1dcb0b['name']);return _0x5f516d['_insertChild'](0x0,_0x3e3cbc),_0x5f516d;}return _0x399ab1['_setAttribute']('vid_end',null===_0xda10d?this['_revisionId']++:_0xda10d),_0x399ab1['_insertChild'](0x0,_0x3e3cbc),_0x399ab1;}_calculateMetaData(_0x3ea2de,_0x4ccdb9,_0x5eeb4f){this['_reset']();const {roots:_0x3f1304,markers:_0x25bc0d,rootsAttributes:_0x5bfee8}=this['_savedMetaData']['get'](_0x3ea2de);this['_baseRoots']=new Map(_0x3f1304),this['_baseRootsAttributes']=new Map(_0x346ba8(_0x5bfee8));for(const [_0x343a3d,_0x3f47ef]of this['_baseRoots'])if('$graveyard'!==_0x343a3d&&(this['_diffRoots']['set'](_0x343a3d,St(_0x3f47ef)),this['_diffRootsAttributes']=new Map(_0x346ba8(_0x5bfee8)),_0x5eeb4f)){const _0x29b692=this['_revisionId'];this['_idsRoots']['set'](_0x343a3d,this['_makeIdsRoot'](_0x3f47ef)),this['_baseIdsRoots']['set'](_0x343a3d,this['_makeIdsRoot'](_0x3f47ef,_0x29b692));}this['_startingRevisionId']=this['_revisionId'],this['_diffRoots']['set']('$graveyard',St(this['_baseRoots']['get']('$graveyard'))),_0x5eeb4f&&this['_idsRoots']['set']('$graveyard',this['_makeIdsRoot'](this['_baseRoots']['get']('$graveyard')));for(const [_0x1776fd,_0x22b162]of _0x25bc0d){const _0x596004=this['_baseRoots']['get'](_0x22b162['rootName']),_0x456849=this['_diffRoots']['get'](_0x22b162['rootName']),_0x54714f=new _0x31969d(_0x3e4f67(_0x22b162['start'],_0x596004),_0x3e4f67(_0x22b162['end'],_0x596004)),_0x1c0b3d=_0x146304(_0x54714f,_0x456849);_0x596004['markers']['set'](_0x1776fd,_0x54714f),this['_markers']['set'](_0x1776fd,_0x1c0b3d);}this['_applyOperations'](_0x3ea2de,_0x4ccdb9,_0x5eeb4f);}_applyOperations(_0x1dee82,_0x1b13c0,_0x18007f){for(const _0x2fa478 of this['source']['getOperations'](_0x1dee82,_0x1b13c0))this['_handleOperation'](_0x2fa478,_0x18007f);for(const _0x5480ef of this['_diffRoots']['values']())_0x5480ef['markers']['clear']();for(const [_0x163fb8,_0x250e29]of this['_markers'])this['_diffRoots']['get'](_0x250e29['root']['rootName'])['markers']['set'](_0x163fb8,_0x250e29['clone']());const _0x3aca41=new Map(),_0x48bdcb=new Map();for(const [_0xddc765,_0x39859f]of this['_diffRoots'])_0x3aca41['set'](_0xddc765,St(_0x39859f)),_0x48bdcb['set'](_0xddc765,this['_diffRootsAttributes']['get'](_0xddc765));this['_saveMetaData'](_0x1b13c0,_0x3aca41,this['_markers'],_0x48bdcb);}_getPreviousFrom(_0x4ee88c){const _0x4bb947=Array['from'](this['_savedMetaData']['keys']());_0x4bb947['sort']((_0x38c8e1,_0x3ae8b8)=>_0x38c8e1-_0x3ae8b8),_0x4bb947['reverse']();for(const _0x24eddb of _0x4bb947)if(_0x24eddb<_0x4ee88c)return _0x24eddb;return Number['NEGATIVE_INFINITY'];}['_copyMarkers'](_0x5c8c73,_0x535a64){const _0x53c60f=Array['from'](_0x535a64['markers'])['map'](([_0x25a775,_0x3ae813])=>[_0x25a775,_0x146304(_0x3ae813,_0x5c8c73)]);_0x5c8c73['markers']=new Map(_0x53c60f);}_transformMarkers(_0x24f8f6){for(const _0x3c9576 of this['_markers']['values']()){const _0x32cb7b=_0x3c9576['getTransformedByOperation'](_0x24f8f6),_0x30c39b=_0x31969d['_createFromRanges'](_0x32cb7b);_0x3c9576['start']=_0x30c39b['start'],_0x3c9576['end']=_0x30c39b['end'];}}_handleOperation(_0xb419fb,_0x1ffe83){if('addRoot'!=_0xb419fb['type']&&'detachRoot'!=_0xb419fb['type']){if('insert'==_0xb419fb['type']){const _0x3eeb65=_0xb419fb['position']['root'],_0x5e119c=_0x3eeb65['rootName'],_0x33d78f=_0x3eeb65['name'];this['_diffRoots']['has'](_0x5e119c)||(this['_diffRoots']['set'](_0x5e119c,Et(_0x5e119c,_0x33d78f,!0x0)),this['_diffRootsAttributes']['set'](_0x5e119c,{}),_0x1ffe83&&this['_idsRoots']['set'](_0x5e119c,Et(_0x5e119c,_0x33d78f,!0x0)));}else{if('addRootAttribute'==_0xb419fb['type']||'removeRootAttribute'==_0xb419fb['type']||'changeRootAttribute'==_0xb419fb['type'])return void this['_handleRootAttributeOperation'](_0xb419fb);'marker'==_0xb419fb['type']&&this['_handleMarkerOperation'](_0xb419fb);}if('marker'!==_0xb419fb['type']){const _0xc66f4b=this['_cloneOperation'](_0xb419fb,this['_diffRoots']);_0xc66f4b['_execute'](),this['_transformMarkers'](_0xc66f4b);}if(_0x1ffe83)switch(_0xb419fb['type']){case'insert':this['_handleInsertOperation'](_0xb419fb);break;case'move':case'remove':case'reinsert':this['_handleMoveOperation'](_0xb419fb);break;case'merge':this['_handleMergeOperation'](_0xb419fb);break;case'split':this['_handleSplitOperation'](_0xb419fb);}}else this['_handleRootOperation'](_0xb419fb,_0x1ffe83);}_cloneOperation(_0x4e8155,_0x1a3338){const _0x448ee0=_0x4e8155['clone']();return _0x448ee0['_authorId']=_0x4e8155['_authorId'],_0x448ee0['_aiSource']=_0x4e8155['_aiSource'],_0x448ee0['baseVersion']=null,_0x1c16f5(_0x448ee0,_0x1a3338),_0x448ee0;}_getBaseVids(_0x4d3f46){return _0x4d3f46['map'](_0x3c1862=>{const _0x2c00a4=this['_getVidAttributeName'](_0x3c1862);return Number(_0x3c1862['item']['getAttribute'](_0x2c00a4));});}_generateTape(_0x2e01b2,_0x1d3d50){if(_0x2e01b2['is']('element','$text'))_0x1d3d50['push']({'item':_0x2e01b2,'type':'text'});else{_0x2e01b2['is']('element')&&_0x1d3d50['push']({'item':_0x2e01b2,'type':'elementStart'});for(const _0x2588f0 of _0x2e01b2['getChildren']())this['_generateTape'](_0x2588f0,_0x1d3d50);_0x2e01b2['is']('element')&&_0x1d3d50['push']({'item':_0x2e01b2,'type':'elementEnd'});}return _0x1d3d50;}_getState(){const _0x45a73a=new Map(this['_touched']),_0x2868fd=new Map(_0x45a73a),_0x2b8cdb=new Map(),_0x37d9cb={'insertions':{},'deletions':{}},_0x5759c0={'insertions':{},'deletions':{}},_0x544568=new Map(),_0x38ca98=new Set([...this['_baseRoots']['keys'](),...this['_diffRoots']['keys']()]),_0x28c0e7=new Map();_0x38ca98['delete']('$graveyard');for(const _0x3b08ac of _0x38ca98){const _0x26b6ec=(this['_diffRoots']['get'](_0x3b08ac)??this['_baseRoots']['get'](_0x3b08ac))['name'],_0x50079c=this['_diffRoots']['get'](_0x3b08ac)||Et(_0x3b08ac,_0x26b6ec,!0x1),_0x36f75c=this['_baseRoots']['get'](_0x3b08ac)||Et(_0x3b08ac,_0x26b6ec,!0x1);_0x50079c['isAttached']()||_0x36f75c['isAttached']()?(_0x28c0e7['set'](_0x3b08ac,_0x26b6ec),_0x37d9cb['insertions'][_0x3b08ac]=St(_0x50079c),_0x37d9cb['deletions'][_0x3b08ac]=St(_0x36f75c),this['_copyMarkers'](_0x37d9cb['deletions'][_0x3b08ac],_0x36f75c),this['_copyMarkers'](_0x37d9cb['insertions'][_0x3b08ac],_0x50079c),_0x5759c0['insertions'][_0x3b08ac]=this['_generateTape'](this['_idsRoots']['get'](_0x3b08ac),[]),_0x5759c0['deletions'][_0x3b08ac]=this['_generateTape'](this['_baseIdsRoots']['get'](_0x3b08ac)||Et(_0x3b08ac,_0x26b6ec,!0x1),[])):_0x38ca98['delete'](_0x3b08ac);}for(const _0x1dc7f6 of _0x38ca98){const _0x53bba1=_0x5759c0['insertions'][_0x1dc7f6];for(const _0x36375f of _0x53bba1){const _0x5231e9=this['_getVidAttributeName'](_0x36375f),_0x3693e7=_0x36375f['item']['getAttribute'](_0x5231e9);_0x2868fd['delete'](_0x3693e7),_0x3693e7>=this['_startingRevisionId']&&_0x2b8cdb['set'](_0x3693e7,_0x45a73a['get'](_0x3693e7));}}for(const _0x15111c of _0x38ca98){const _0x2cab99=_0x5759c0['insertions'][_0x15111c],_0xa8f2e2=this['_getBaseVids'](_0x5759c0['deletions'][_0x15111c]);let _0x22b219=0x0;for(const _0x5e5268 of _0x2cab99){const _0x3ad70e=this['_getVidAttributeName'](_0x5e5268),_0x2ddf14=_0x5e5268['item']['getAttribute'](_0x3ad70e);if(!_0x2b8cdb['has'](_0x2ddf14)&&!_0x544568['has'](_0x2ddf14)){if(_0x2868fd['has'](_0x2ddf14))_0x22b219++;else{if(_0x2ddf14!=_0xa8f2e2[_0x22b219]){const _0x4b5e3b=_0x45a73a['get'](_0x2ddf14)||_0x45a73a['get'](_0xa8f2e2[_0x22b219]);for(;_0x2ddf14!=_0xa8f2e2[_0x22b219];)_0x2868fd['has'](_0xa8f2e2[_0x22b219])||(_0x544568['set'](_0xa8f2e2[_0x22b219],_0x4b5e3b),_0x45a73a['set'](_0xa8f2e2[_0x22b219],_0x4b5e3b)),_0x22b219++;}_0x22b219++;}}}}for(const _0x38e034 of _0x38ca98){const _0xe07abd=_0x5759c0['insertions'][_0x38e034];for(const _0x24bf7a of _0xe07abd){const _0xba73b9=this['_getVidAttributeName'](_0x24bf7a),_0x512c81=_0x24bf7a['item']['getAttribute'](_0xba73b9);if(_0x544568['has'](_0x512c81)){const _0x11d6e2=_0x544568['get'](_0x512c81);_0x2868fd['has'](_0x512c81)||_0x2868fd['set'](_0x512c81,{..._0x11d6e2}),_0x2b8cdb['set'](_0x512c81,{..._0x11d6e2});}}}for(const _0x6a1bf1 of _0x2868fd['keys']())_0x6a1bf1>=this['_startingRevisionId']&&_0x2868fd['delete'](_0x6a1bf1);const _0xaf0ec3=new Map();for(const _0x1cbc27 of _0x38ca98){let _0x127764=_0x5759c0['insertions'][_0x1cbc27];for(const _0x39798c of _0x127764)if(_0x39798c['item']['is']('element','tableCell')){const _0x4100df=this['_getVidAttributeName'](_0x39798c),_0x1ae1b5=_0x39798c['item']['getAttribute'](_0x4100df);if(_0x2b8cdb['has'](_0x1ae1b5)){const _0x50bce9=_0x39798c['item']['parent']['parent']['getAttribute']('vid_start'),_0x205ca0=_0x2b8cdb['get'](_0x1ae1b5),_0x59c2d7=_0xaf0ec3['get'](_0x50bce9)||{'users':new Set(),'aiSource':null};_0x59c2d7['users']['add'](_0x205ca0['userId']),_0x59c2d7['aiSource']=_0x59c2d7['aiSource']||_0x205ca0['aiSource']||null,_0xaf0ec3['set'](_0x50bce9,_0x59c2d7);}}_0x127764=_0x5759c0['deletions'][_0x1cbc27];for(const _0x4e8413 of _0x127764)if(_0x4e8413['item']['is']('element','tableCell')){const _0x2a1571=this['_getVidAttributeName'](_0x4e8413),_0x5d9724=_0x4e8413['item']['getAttribute'](_0x2a1571);if(_0x2868fd['has'](_0x5d9724)){const _0x52274c=_0x4e8413['item']['parent']['parent']['getAttribute']('vid_start'),_0x479754=_0x2868fd['get'](_0x5d9724),_0x396d00=_0xaf0ec3['get'](_0x52274c)||{'users':new Set(),'aiSource':null};_0x396d00['users']['add'](_0x479754['userId']),_0x396d00['aiSource']=_0x396d00['aiSource']||_0x479754['aiSource']||null,_0xaf0ec3['set'](_0x52274c,_0x396d00);}}for(const _0x339bbe of _0xaf0ec3['keys']())(_0x2b8cdb['has'](_0x339bbe)||_0x2868fd['has'](_0x339bbe))&&_0xaf0ec3['delete'](_0x339bbe);}for(const _0x5d46de of _0x38ca98){const _0x2124bd=_0x5759c0['insertions'][_0x5d46de];let _0x275322=null,_0x281cc5=null,_0x4afb3f=null;for(const _0x5e6f9e of _0x2124bd){const _0x195f57=this['_getVidAttributeName'](_0x5e6f9e),_0x5f467c=_0x5e6f9e['item']['getAttribute'](_0x195f57),_0x526b43=_0xaf0ec3['get'](_0x5f467c);if(_0x526b43&&'elementStart'==_0x5e6f9e['type']&&(_0x275322=Array['from'](_0x526b43['users'])[0x0],_0x281cc5=_0x526b43['aiSource'],_0x4afb3f=_0x5e6f9e['item']['getAttribute']('vid_end')),_0x275322){const _0xe740bc=_0x281cc5||_0x2868fd['get'](_0x5f467c)?.['aiSource']||null,_0x271707=_0x281cc5||_0x2b8cdb['get'](_0x5f467c)?.['aiSource']||null;_0x2868fd['set'](_0x5f467c,{'userId':_0x275322,'aiSource':_0xe740bc}),_0x2b8cdb['set'](_0x5f467c,{'userId':_0x275322,'aiSource':_0x271707});}_0x5f467c==_0x4afb3f&&(_0x275322=null,_0x4afb3f=null);}}const _0x107a93={},_0x14fbba=new Set();for(const _0x30c622 of _0x38ca98){const _0x5f716b=_0x37d9cb['deletions'][_0x30c622],_0x389bb7=_0x37d9cb['insertions'][_0x30c622];for(const {userId:_0x51f7fd}of this['_touchedMarkers']['values']())null!==_0x51f7fd&&_0x14fbba['add'](_0x51f7fd);for(const {userId:_0x3bd4b9}of this['_touchedRoots']['values']())null!==_0x3bd4b9&&_0x14fbba['add'](_0x3bd4b9);const _0x3ce816={};this['_markChanges'](_0x389bb7,_0x5759c0['insertions'][_0x30c622],_0x2b8cdb,'insertion',_0x14fbba,_0x3ce816),this['_markChanges'](_0x5f716b,_0x5759c0['deletions'][_0x30c622],_0x2868fd,'deletion',_0x14fbba,_0x3ce816),this['_collectSuggestionAiSources'](_0x389bb7,_0x3ce816),this['_collectSuggestionAiSources'](_0x5f716b,_0x3ce816),_0x107a93[_0x30c622]={'insertions':this['_prepareViewToSave'](_0x389bb7),'deletions':this['_prepareViewToSave'](_0x5f716b),'attachChange':this['_touchedRoots']['get'](_0x30c622)||null,'attributesBefore':_0x346ba8(this['_baseRootsAttributes']['get'](_0x30c622))||{},'attributesAfter':_0x346ba8(this['_diffRootsAttributes']['get'](_0x30c622)),'rootElementName':_0x28c0e7['get'](_0x30c622),'aiSources':_0x3ce816};}const _0x1e2a6d=Array['from'](_0x2b8cdb['values']())['some'](_0x30008f=>!(!_0x30008f||!_0x30008f['aiSource']))||Array['from'](_0x2868fd['values']())['some'](_0xbf060e=>!(!_0xbf060e||!_0xbf060e['aiSource']))||Array['from'](this['_touchedMarkers']['keys']())['some'](_0x1193cd=>this['_aiTouchedMarkers']['has'](_0x1193cd));return{'diffData':_0x107a93,'authorsIds':Array['from'](_0x14fbba),'hasAIChanges':_0x1e2a6d};}_collectSuggestionAiSources(_0x3ca32b,_0x215484){const _0x39d065=_0x3ca32b['markers'];for(const _0x88dce6 of _0x39d065['keys']()){if(!_0x88dce6['startsWith']('suggestion:'))continue;if(!this['_touchedMarkers']['has'](_0x88dce6))continue;const _0x4e321e=this['_aiTouchedMarkers']['get'](_0x88dce6);_0x4e321e&&(_0x215484[_0x88dce6]=_0x4e321e);}}_processRootBeforeSave(_0x5b0b46){for(const [,_0x2ba3c5]of _0x5b0b46['markers']){const _0x5cf961=_0x2ba3c5['start']['getAncestors']()['filter'](_0x2c3c24=>'tableCell'==_0x2c3c24['name']);for(const _0x7c0e88 of _0x5cf961)0x1==_0x7c0e88['childCount']&&_0x7c0e88['getChild'](0x0)['is']('element','paragraph')&&_0x7c0e88['getChild'](0x0)['_setAttribute']('keepParagraph',!0x0);}}['_prepareViewToSave'](_0x477532){this['_processRootBeforeSave'](_0x477532);const _0x310a45=this['editor']['data']['toView'](_0x477532,{}),_0x10da7f=Array['from'](_0x310a45['getChildren']())['map'](_0x153400=>this['_getViewJson'](_0x153400));return JSON['stringify'](_0x10da7f);}_getViewJson(_0x3d11b5){if(_0x3d11b5['is']('$text'))return _0x3d11b5['data'];{const _0x245ba8=this['editor']['plugins']['get']('RevisionHistoryUtils'),_0x330b64=_0x3d11b5,_0x36e0b5=this['editor']['data']['htmlProcessor']['domConverter'],_0x399ad6={'type':_0x245ba8['_getTypeCharForViewElement'](_0x330b64),'name':_0x330b64['name'],'attributes':Array['from'](_0x330b64['getAttributes']()),'children':Array['from'](_0x330b64['getChildren']())['map'](_0x1b2cb6=>this['_getViewJson'](_0x1b2cb6))};if(_0x3d11b5['is']('uiElement')&&'$comment'!=_0x3d11b5['name']){const _0x4c93d7=_0x3d11b5['render'](_0x36e0b5['domDocument'],_0x36e0b5);_0x399ad6['children']['push'](_0x4c93d7['outerHTML']);}else{if(_0x3d11b5['is']('rawElement')){const _0xa670e1=_0x36e0b5['domDocument']['createElement'](_0x330b64['name']);_0x3d11b5['render'](_0xa670e1,_0x36e0b5),_0x399ad6['children']['push'](_0xa670e1['innerHTML']);}}const _0xd279de=Array['from'](_0x330b64['getCustomProperties']());_0xd279de['length']>0x0&&(_0x399ad6['customProperties']=_0xd279de);const _0x1b6e8d=_0x330b64['getFillerOffset']();return null!==_0x1b6e8d&&(_0x399ad6['fillerOffset']=_0x1b6e8d),_0x399ad6;}}['_markChanges'](_0x1a3da9,_0x57a0d5,_0x3e1b4f,_0x264bc2,_0x43d25d,_0x9ff15){let _0x4c6598=null,_0x327877=null,_0x3e727c=0x0;const _0x171012=this['editor']['model'];for(let _0x468640=0x0;_0x468640<_0x57a0d5['length'];_0x468640++){const _0x9f0304=this['_getVidAttributeName'](_0x57a0d5[_0x468640]),_0x419557=_0x57a0d5[_0x468640]['item']['getAttribute'](_0x9f0304),_0x4a78f8=_0x3e1b4f['get'](_0x419557),_0x3eff9d=_0x468640==_0x57a0d5['length']-0x1;!_0x4c6598&&_0x4a78f8&&(_0x4c6598=_0x4a78f8,_0x327877=_0x57a0d5[_0x468640]);const _0x212d23=!!_0x4c6598&&!!_0x4a78f8&&_0x4a78f8['userId']!=_0x4c6598['userId'],_0x35ab32=!!_0x4c6598&&!!_0x4a78f8&&_0x4a78f8['aiSource']!=_0x4c6598['aiSource'];_0x4c6598&&(!_0x4a78f8||_0x212d23||_0x35ab32)&&(_0x873e73(_0x4a78f8,Ot(_0x327877,_0x1a3da9,_0x171012),Ot(_0x57a0d5[_0x468640],_0x1a3da9,_0x171012)),_0x4c6598=_0x4a78f8||null,_0x327877=_0x4a78f8?_0x57a0d5[_0x468640]:null),_0x4c6598&&_0x3eff9d&&_0x873e73(_0x4a78f8,Ot(_0x327877,_0x1a3da9,_0x171012),Ct(_0x57a0d5[_0x468640],_0x1a3da9,_0x171012));}function _0x873e73(_0xf9b43f,_0x3edfb3,_0x45eaa9){const _0x252deb=_0x4c6598['userId'],_0xf859f8=_0x4c6598['aiSource'],_0x4024d0='revision:'+_0x264bc2+':'+_0x252deb+':'+_0x3e727c++,_0x17282e=_0x171012['createRange'](_0x3edfb3,_0x45eaa9);_0x1a3da9['markers']['set'](_0x4024d0,_0x17282e),_0xf859f8&&(_0x9ff15[_0x4024d0]=_0xf859f8),null!==_0x252deb&&_0x43d25d['add'](_0x252deb);}}_getVidAttributeName(_0x4d15a6){switch(_0x4d15a6['type']){case'elementStart':return'vid_start';case'elementEnd':return'vid_end';default:return'vid';}}_handleInsertOperation(_0x1b6625){const _0x5b5c85=this['_idsRoots']['get'](_0x1b6625['position']['root']['rootName']),_0x3de03a=_0x3e4f67(_0x1b6625['position'],_0x5b5c85),_0x50feaa=null===_0x1b6625['_authorId']?null:_0x1b6625['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x8d775=_0x1b6625['_aiSource']||null,_0x2f7075=_0x3de03a['parent'],_0x3893fa=this['_revisionId'],_0x4601c0=[];for(const _0x4be8ba of _0x1b6625['nodes'])if(_0x4be8ba['is']('element'))_0x4601c0['push'](this['_makeIdsRoot'](_0x4be8ba));else{for(let _0x3c2783=0x0;_0x3c2783<_0x4be8ba['offsetSize'];_0x3c2783++)_0x4601c0['push'](new _0x19c548('$text',{'vid':this['_revisionId']++}));}const _0x2fa530=this['_revisionId'];for(let _0x433669=_0x3893fa;_0x433669<_0x2fa530;_0x433669++)this['_touched']['set'](_0x433669,{'userId':_0x50feaa,'aiSource':_0x8d775});_0x2f7075['_insertChild'](_0x3de03a['offset'],_0x4601c0);}_setTouched(_0x34c2e7,_0x582004,_0x4254c7){this['_touched']['set'](_0x34c2e7,{'userId':_0x582004,'aiSource':_0x4254c7||this['_touched']['get'](_0x34c2e7)?.['aiSource']||null});}_handleMoveOperation(_0x3eb1a4){(_0x3eb1a4=this['_cloneOperation'](_0x3eb1a4,this['_idsRoots']))['_execute']();const _0x39a781=null===_0x3eb1a4['_authorId']?null:_0x3eb1a4['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0xe3a71e=_0x3eb1a4['_aiSource']||null,_0x113906=_0x3eb1a4['getMovedRangeStart'](),_0x89ed2e=_0x113906['parent'],_0x4703f2=_0x113906['offset'],_0x5901ba=(_0x402721,_0x1a054b,_0x2626b9)=>{for(let _0x1dbd75=_0x1a054b;_0x1dbd75<_0x2626b9;_0x1dbd75++){const _0x487fc0=_0x402721['getChild'](_0x1dbd75);_0x487fc0['is']('element','$text')?this['_setTouched'](_0x487fc0['getAttribute']('vid'),_0x39a781,_0xe3a71e):(this['_setTouched'](_0x487fc0['getAttribute']('vid_start'),_0x39a781,_0xe3a71e),_0x5901ba(_0x487fc0,0x0,_0x487fc0['childCount']),this['_setTouched'](_0x487fc0['getAttribute']('vid_end'),_0x39a781,_0xe3a71e));}};_0x5901ba(_0x89ed2e,_0x4703f2,_0x4703f2+_0x3eb1a4['howMany']);}_handleMergeOperation(_0x1e4b66){const _0x331986=null===(_0x1e4b66=this['_cloneOperation'](_0x1e4b66,this['_idsRoots']))['_authorId']?null:_0x1e4b66['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x55ccaf=_0x1e4b66['_aiSource']||null,_0xfba969=_0x1e4b66['targetPosition']['parent'],_0x4ed0fa=_0x1e4b66['sourcePosition']['parent'],_0x4dfaaf=_0xfba969['getAttribute']('vid_end'),_0x29d89d=_0x4ed0fa['getAttribute']('vid_start');_0xfba969['_setAttribute']('vid_end',_0x4ed0fa['getAttribute']('vid_end')),_0x4ed0fa['_setAttribute']('vid_end',_0x4dfaaf),this['_setTouched'](_0x29d89d,_0x331986,_0x55ccaf),this['_setTouched'](_0x4dfaaf,_0x331986,_0x55ccaf),_0x1e4b66['_execute']();}_handleSplitOperation(_0x31c3de){const _0x134b4d=null===(_0x31c3de=this['_cloneOperation'](_0x31c3de,this['_idsRoots']))['_authorId']?null:_0x31c3de['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x2a45df=_0x31c3de['_aiSource']||null,_0xca235b=_0x31c3de['graveyardPosition'],_0x16cac5=_0x31c3de['splitPosition']['parent'];_0x31c3de['_execute']();const _0x55aebb=_0x16cac5['getAttribute']('vid_end'),_0x27d7d9=_0x31c3de['insertionPosition']['nodeAfter'];if(_0xca235b){const _0x56ad5c=_0x27d7d9['getAttribute']('vid_end'),_0x58e212=_0x16cac5['getAttribute']('vid_end');_0x16cac5['_setAttribute']('vid_end',_0x56ad5c),_0x27d7d9['_setAttribute']('vid_end',_0x58e212),this['_setTouched'](_0x16cac5['getAttribute']('vid_end'),_0x134b4d,_0x2a45df),this['_setTouched'](_0x27d7d9['getAttribute']('vid_start'),_0x134b4d,_0x2a45df);}else{const _0x401f3a=this['_revisionId']++,_0x2ace6e=this['_revisionId']++;_0x16cac5['_setAttribute']('vid_end',_0x401f3a),_0x27d7d9['_setAttribute']('vid_start',_0x2ace6e),_0x27d7d9['_setAttribute']('vid_end',_0x55aebb),this['_setTouched'](_0x401f3a,_0x134b4d,_0x2a45df),this['_setTouched'](_0x2ace6e,_0x134b4d,_0x2a45df);}}_handleMarkerOperation(_0x498a43){if(!_0x498a43['affectsData'])return;const _0x2d0f39=(_0x498a43=this['_cloneOperation'](_0x498a43,this['_diffRoots']))['oldRange']?_0x498a43['oldRange']['root']:null,_0x58bcd3=_0x498a43['newRange']?_0x498a43['newRange']['root']:null;_0x2d0f39&&this['_markers']['delete'](_0x498a43['name']),_0x58bcd3&&this['_markers']['set'](_0x498a43['name'],_0x498a43['newRange']['clone']());const _0x4ac08e=null===_0x498a43['_authorId']?null:_0x498a43['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x3ccffe=_0x498a43['name'];if(_0x498a43['_aiSource']&&this['_aiTouchedMarkers']['set'](_0x3ccffe,_0x498a43['_aiSource']),!this['_touchedMarkers']['has'](_0x3ccffe))return void this['_touchedMarkers']['set'](_0x3ccffe,{'range':_0x498a43['oldRange'],'userId':_0x4ac08e});const _0x3868e5=this['_touchedMarkers']['get'](_0x3ccffe),_0x498cec=_0x3868e5['range'],_0x530eb6=_0x498a43['newRange'];null==_0x498cec&&null==_0x530eb6||_0x498cec&&_0x530eb6&&_0x498cec['isEqual'](_0x530eb6)?this['_touchedMarkers']['delete'](_0x498a43['name']):_0x3868e5['userId']=_0x4ac08e;}_handleRootOperation(_0x2bf07c,_0x5a5834){this['_diffRoots']['has'](_0x2bf07c['rootName'])?this['_diffRoots']['get'](_0x2bf07c['rootName'])['_isAttached']=_0x2bf07c['isAdd']:(this['_diffRoots']['set'](_0x2bf07c['rootName'],Et(_0x2bf07c['rootName'],_0x2bf07c['elementName'],!0x0)),this['_diffRootsAttributes']['set'](_0x2bf07c['rootName'],{}),_0x5a5834&&this['_idsRoots']['set'](_0x2bf07c['rootName'],Et(_0x2bf07c['rootName'],_0x2bf07c['elementName'],!0x0)));const _0x167e79=null===_0x2bf07c['_authorId']?null:_0x2bf07c['_authorId']||this['editor']['plugins']['get']('Users')['me']['id'],_0x5abb66=this['_touchedRoots']['get'](_0x2bf07c['rootName']);_0x5abb66&&_0x5abb66['userId']===_0x167e79?this['_touchedRoots']['delete'](_0x2bf07c['rootName']):this['_touchedRoots']['set'](_0x2bf07c['rootName'],{'userId':_0x167e79,'isAttached':_0x2bf07c['isAdd']});}_handleRootAttributeOperation(_0x5937ac){const _0x3d302c=this['_diffRootsAttributes']['get'](_0x5937ac['root']['rootName']);null===_0x5937ac['newValue']?delete _0x3d302c[_0x5937ac['key']]:_0x3d302c[_0x5937ac['key']]=_0x5937ac['newValue'];}};function St(_0x1feeeb){const _0x186626=Et(_0x1feeeb['rootName'],_0x1feeeb['name'],_0x1feeeb['isAttached']());for(const _0x1de001 of _0x1feeeb['getChildren']()){const _0x27d0c4=_0x1de001['_clone'](!0x0);_0x186626['_appendChild'](_0x27d0c4);}return _0x186626;}function Et(_0x28772e,_0x949fff,_0x36601c=!0x0){const _0x85e067=new _0x3bdc31();return _0x85e067['rootName']=_0x28772e,_0x85e067['name']=_0x949fff,_0x85e067['_isAttached']=_0x36601c,_0x85e067['isAttached']=()=>_0x85e067['_isAttached'],_0x85e067;}function Ot(_0x2462a9,_0x4b14f9,_0x62ef08){const _0x82a28='elementEnd'==_0x2462a9['type']?_0x62ef08['createPositionAt'](_0x2462a9['item'],'end'):_0x62ef08['createPositionBefore'](_0x2462a9['item']);return _0x62ef08['createPositionFromPath'](_0x4b14f9,_0x82a28['path'],_0x82a28['stickiness']);}function Ct(_0x5e1da2,_0x1643c3,_0x2e2d47){const _0x14287d='elementStart'==_0x5e1da2['type']?_0x2e2d47['createPositionAt'](_0x5e1da2['item'],0x0):_0x2e2d47['createPositionAfter'](_0x5e1da2['item']);return _0x2e2d47['createPositionFromPath'](_0x1643c3,_0x14287d['path'],_0x14287d['stickiness']);}const Nt=/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x1dd50d(dt);var xt=class extends Nt{['focusTracker'];keystrokes;revisionNameInputView;constructor(_0xda416c,_0x5da1e5){super(_0xda416c),this['focusTracker']=new _0x4e4794(),this['keystrokes']=new _0x53888f(),this['set']('revisionNameInputValue',''),this['revisionNameInputView']=this['_createRevisionNameInput'](_0x5da1e5),this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-revision-history-save-revision-form','ck-responsive-form'],'tabindex':'-1'},'children':[this['revisionNameInputView']]}),this['initializeCssTransitionDisablerMixin']();}['render'](){super['render'](),_t({'view':this}),this['focusTracker']['add'](this['revisionNameInputView']['element']),this['keystrokes']['listenTo'](this['element']);const _0x22419a=_0x2bf4fc=>_0x2bf4fc['stopPropagation']();this['keystrokes']['set']('arrowright',_0x22419a),this['keystrokes']['set']('arrowleft',_0x22419a),this['keystrokes']['set']('arrowup',_0x22419a),this['keystrokes']['set']('arrowdown',_0x22419a);}['focus'](){this['revisionNameInputView']['focus']();}get['revisionName'](){return this['revisionNameInputView']['fieldView']['element']['value']['trim']();}set['revisionName'](_0x5e061b){this['revisionNameInputView']['fieldView']['element']['value']=_0x5e061b['trim']();}reset(){this['revisionNameInputView']['fieldView']['element']['value']='',this['revisionNameInputView']['errorText']=null;}_createRevisionNameInput(_0x19a134){const _0x572cf6=new it(this['locale'],gt),_0x31e001=_0x572cf6['fieldView'];_0x31e001['extendTemplate']({'attributes':{'maxlength':'220'}});let _0x315378=kt(this['locale'],'Name\x20of\x20the\x20revision');return!_0x19a134&&(_0x315378+='\x20('+kt(this['locale'],'optional')+')'),(_0x572cf6['label']=_0x315378,_0x31e001['on']('input',()=>{this['revisionNameInputValue']=_0x31e001['element']['value']['trim']();}),_0x572cf6);}},Dt=class extends _0x544bf8{static get['pluginName'](){return'RevisionHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At];}['_saveRevisionFormView'];init(){const _0x676b8e=this['editor'],_0x67a427=_0x676b8e['plugins']['get']('RevisionTracker');_0x676b8e['ui']['componentFactory']['add']('revisionHistory',_0x35d2a3=>{const _0x1673fc=vt(_0x35d2a3),_0x23b037=_0x1673fc['panelView']['children'],_0x101e47=new st(_0x35d2a3),_0x4cfde0=new et(_0x35d2a3),_0x51af70=this['_createSaveRevisionButton'](_0xefa108),_0x296928=new et(_0x35d2a3),_0x27f533=this['_createOpenRevisionButton'](_0xefa108);return _0x1673fc['bind']('isEnabled')['to'](_0x67a427,'isReady',_0x67a427,'isEnabled',_0x676b8e,'isReadOnly',(_0x1feac3,_0xbc7ecd,_0x129426)=>_0x1feac3&&_0xbc7ecd&&!_0x129426),_0x1673fc['buttonView']['set']({'icon':_0x1cebb3,'label':kt(_0x35d2a3,'Revision\x20history'),'tooltip':!0x0}),_0x51af70['set']({'withText':!0x0,'role':'menuitem'}),_0x27f533['set']({'withText':!0x0,'role':'menuitem'}),this['listenTo'](_0x27f533,'execute',()=>{_0x1673fc['isOpen']=!0x1,_0x676b8e['editing']['view']['focus']();},{'priority':'low'}),_0x4cfde0['children']['add'](_0x51af70),_0x296928['children']['add'](_0x27f533),_0x101e47['role']='menu',_0x101e47['items']['addMany']([_0x4cfde0,_0x296928]),_0x23b037['add'](_0x101e47),_0x1673fc;}),_0x676b8e['ui']['componentFactory']['add']('menuBar:revisionHistory',()=>this['_registerMenuComponent']());}_registerMenuComponent(){const _0x221a8a=this['editor'],_0x131f9c=_0x221a8a['locale'],_0x2aa5ae=_0x221a8a['plugins']['get']('RevisionTracker'),_0x542ce7=new at(_0x131f9c),_0x5098f5=new rt(_0x131f9c);_0x542ce7['bind']('isEnabled')['to'](_0x2aa5ae,'isReady',_0x2aa5ae,'isEnabled',_0x221a8a,'isReadOnly',(_0x140c13,_0x5312c8,_0x14cfa6)=>_0x140c13&&_0x5312c8&&!_0x14cfa6),_0x542ce7['buttonView']['set']({'icon':_0x1cebb3,'label':kt(_0x131f9c,'Revision\x20history')});const _0x51f85f=new ot(_0x131f9c,_0x542ce7),_0x6b83c0=this['_createSaveRevisionButton'](nt);_0x6b83c0['delegate']('execute')['to'](_0x542ce7),_0x51f85f['children']['add'](_0x6b83c0),_0x5098f5['items']['add'](_0x51f85f);const _0x29da1c=new ot(_0x131f9c,_0x542ce7),_0x1b2007=this['_createOpenRevisionButton'](nt);return _0x1b2007['delegate']('execute')['to'](_0x542ce7),_0x29da1c['children']['add'](_0x1b2007),_0x5098f5['items']['add'](_0x29da1c),_0x542ce7['panelView']['children']['add'](_0x5098f5),_0x542ce7;}_createSaveRevisionButton(_0xb2d989){const _0x2e7619=this['editor'],_0x1d081d=_0x2e7619['plugins']['get']('RevisionTracker'),_0x57a79c=new _0xb2d989(_0x2e7619['locale']);return _0x57a79c['set']({'label':kt(_0x2e7619['locale'],'Save\x20current\x20revision')}),_0x57a79c['bind']('isEnabled')['to'](_0x1d081d,'isReady',_0x1d081d,'isEnabled',_0x2e7619,'isReadOnly',(_0x95a641,_0x31e4e6,_0x198f81)=>_0x95a641&&_0x31e4e6&&!_0x198f81),this['listenTo'](_0x57a79c,'execute',()=>{this['_showDialog']();}),_0x57a79c;}_createOpenRevisionButton(_0x9cf5d2){const _0x14dbe7=this['editor'],_0x418840=_0x14dbe7['plugins']['get']('RevisionTracker'),_0x5bfde3=new _0x9cf5d2(_0x14dbe7['locale']);return _0x5bfde3['set']({'label':kt(_0x14dbe7['locale'],'Open\x20revision\x20history')}),_0x5bfde3['bind']('isEnabled')['to'](_0x418840,'isReady',_0x14dbe7,'isReadOnly',(_0x49cfae,_0x59569c)=>_0x49cfae&&!_0x59569c),this['listenTo'](_0x5bfde3,'execute',()=>{_0x14dbe7['config']['get']('revisionHistory')['showRevisionViewerCallback']();}),_0x5bfde3;}['_showDialog'](){const _0x2b58c4=this['editor'],_0x4906e3=_0x2b58c4['locale'],_0x2be0c2=_0x2b58c4['plugins']['get']('Dialog'),_0x435371=_0x2b58c4['plugins']['get']('RevisionTracker');function _0x5410d5(_0x378bb1){_0x2b58c4['config']['get']('revisionHistory.requireRevisionName')&&''===_0x378bb1['revisionName']?_0x378bb1['revisionNameInputView']['errorText']=kt(_0x4906e3,'The\x20revision\x20name\x20cannot\x20be\x20empty.'):(_0x2b58c4['plugins']['get'](At)['saveRevision']({'name':_0x378bb1['revisionName']}),_0x2be0c2['hide']());}this['_saveRevisionFormView']||(this['_createSaveRevisionFormView'](),this['_saveRevisionFormView']['on']('submit',()=>_0x5410d5(this['_saveRevisionFormView']))),this['_saveRevisionFormView']['reset'](),_0x2be0c2['show']({'id':'revisionSave','title':kt(_0x4906e3,'Save\x20current\x20revision'),'isModal':!0x0,'content':this['_saveRevisionFormView'],'actionButtons':[{'label':kt(_0x2b58c4['locale'],'Cancel'),'withText':!0x0,'onExecute':()=>_0x2be0c2['hide']()},{'label':kt(_0x2b58c4['locale'],'Accept'),'class':'ck-button-action','withText':!0x0,'onCreate'(_0xb7f7bf){_0xb7f7bf['bind']('isEnabled')['to'](_0x435371,'isReady',_0x435371,'isEnabled',_0x2b58c4,'isReadOnly',(_0x11a87f,_0x32d675,_0x25243f)=>_0x11a87f&&_0x32d675&&!_0x25243f);},'onExecute':()=>_0x5410d5(this['_saveRevisionFormView'])}]});}_createSaveRevisionFormView(){const _0xda876=this['editor'],_0x47ef1d=_0xda876['locale'];this['_saveRevisionFormView']=new xt(_0x47ef1d,_0xda876['config']['get']('revisionHistory.requireRevisionName')),this['_saveRevisionFormView']['render']();}},Vt=class extends dt{['changeId'];['_model'];constructor(_0x363a98,_0x1b8245,_0x5b2b7f=!0x1){super(_0x363a98),this['_model']=_0x1b8245,this['changeId']=_0x1b8245['id'];const _0x4f7256=this['bindTemplate'],_0x3b325c=_0x5b2b7f&&!!_0x1b8245['data']['aiSource'],_0x22e39b=_0x3b325c?this['_createAiIconView'](_0x363a98):null;this['set']('type',_0x1b8245['type']),this['setTemplate']({'tag':'div','attributes':{'class':['ck-annotation','ck-revision-change',_0x4f7256['to']('type',_0x4634fb=>'ck-revision-change__'+_0x4634fb),..._0x3b325c?['ck-revision-change_ai']:[]],'tabindex':-0x1},'children':[{'tag':'span','children':_0x3b325c?[this['_createAiDescriptionView'](_0x363a98,_0x1b8245),_0x22e39b]:this['_getDescriptionChildren'](_0x363a98,_0x1b8245)}]});}_getDescriptionChildren(_0x139134,_0x224ebf){let _0x37eba1='Removed\x20by';return _0x224ebf['data']['isSuggestion']?_0x37eba1='Suggested\x20by':'add'==_0x224ebf['type']&&(_0x37eba1='Added\x20by'),[this['_createLabel'](kt(_0x139134,_0x37eba1)),{'text':'\x20'+_0x224ebf['author']['name']}];}_createAiDescriptionView(_0x429d67,_0x3ff71f){let _0x5a2c58='AI_SOURCE_REMOVED_BY';_0x3ff71f['data']['isSuggestion']?_0x5a2c58='AI_SOURCE_SUGGESTED_BY':'add'==_0x3ff71f['type']&&(_0x5a2c58='AI_SOURCE_ADDED_BY');const _0x150091=new dt(_0x429d67);return _0x150091['setTemplate']({'tag':'span','attributes':{'class':['ck-revision-change__label']}}),_0x150091['render'](),_0x150091['element']['innerHTML']=_0x5c60d8(kt(_0x429d67,_0x5a2c58,['<span\x20class=\x22ck-revision-change__author\x22></span>','<span\x20class=\x22ck-revision-change__ai-note\x22>'+kt(_0x429d67,'AI_SOURCE_AI')+'</span>'])),_0x150091['element']['querySelector']('.ck-revision-change__author')['textContent']=_0x3ff71f['author']['name'],_0x150091;}_createLabel(_0x5b1a20){return{'tag':'span','attributes':{'class':['ck-revision-change__label']},'children':[{'text':_0x5b1a20}]};}_createAiIconView(_0x36b397){const _0x3232a9=new _0x1d6039();return _0x3232a9['content']=_0x237d30,_0x3232a9['extendTemplate']({'attributes':{'class':['ck-revision-change__ai-icon'],'data-cke-tooltip-text':kt(_0x36b397,'AI_SOURCE_CHANGE_TOOLTIP'),'data-cke-tooltip-position':'s'}}),_0x3232a9;}['focus'](){this['element']['focus']();}};const Tt=/* #__PURE__ -- @preserve */
|
|
26
|
+
_0x135b6a();var Mt=class extends Tt{['id'];author;type;data;rootName;constructor(_0x46873d){super(),this['id']=_0x46873d['id']||_0x240cc1(),this['author']=_0x46873d['author'],this['type']=_0x46873d['type'],this['data']=_0x46873d['data']||{},this['rootName']=_0x46873d['rootName'],this['set']('createdAt',_0x46873d['createdAt']);}toJSON(){return{'id':this['id'],'authorId':this['author']['id'],'type':this['type'],'data':this['data'],'createdAt':this['createdAt']};}},Ht=class{['newRevisionId'];['oldRevisionId'];['changes'];constructor(_0x246bdf,_0x522efe){this['newRevisionId']=_0x246bdf,this['oldRevisionId']=_0x522efe,this['changes']=new _0x32a4f2();}_setChanges(_0xfbdbfa){for(const _0x37d24d of _0xfbdbfa)this['changes']['add'](_0x37d24d);}},Pt=class extends _0x544bf8{repository;adapter=null;_getVisibleCommentThreadIds=null;_utils;_activeViewTarget;['_changeView'];['_changeIdToChange'];['_balloon'];_showCommentHighlights;static get['pluginName'](){return'RevisionViewer';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x157f26,_0x25d16b,bt,Rt];}constructor(_0x1c3fd7){super(_0x1c3fd7),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',(_0x3e9318,_0x43be07,_0x3a6613)=>{this['activeChange']=null,this['activeView']=null,this['editor']['editing']['view']['change'](_0x4e46ef=>{for(const _0x5b540b of this['editor']['editing']['view']['document']['roots'])_0x3a6613?_0x4e46ef['removeClass']('ck-editor__editable__overlay',_0x5b540b):_0x4e46ef['addClass']('ck-editor__editable__overlay',_0x5b540b);});}),this['bind']('isNavigationMode')['to'](this,'activeChange',_0x25a48c=>null!==_0x25a48c),this['bind']('currentChangeNumber')['to'](this,'isReady',this,'diff',this,'activeChange',(_0x3bfef3,_0x5b6f2d,_0x301349)=>_0x3bfef3&&_0x301349?_0x5b6f2d['changes']['getIndex'](_0x301349):0x0),this['bind']('numberOfChanges')['to'](this,'isReady',this,'diff',(_0x4160e5,_0x2f3a15)=>_0x4160e5?_0x2f3a15['changes']['length']:0x0),this['_changeView']=null,this['_changeIdToChange']=new Map(),this['_balloon']=this['editor']['plugins']['get'](_0x25d16b),this['_showCommentHighlights']=this['editor']['config']['get']('revisionHistory.showCommentHighlights');}init(){const _0x3b3002=this['editor'],_0x48bdff=new $t(_0x3b3002,{'direction':'backward'}),_0x37f2cd=new $t(_0x3b3002,{'direction':'forward'});_0x3b3002['commands']['add']('showPreviousChange',_0x48bdff),_0x3b3002['commands']['add']('showNextChange',_0x37f2cd),_0x3b3002['commands']['add']('restoreRevision',new Ft(_0x3b3002)),this['on']('change:numberOfChanges',()=>{_0x48bdff['refresh'](),_0x37f2cd['refresh']();}),this['_setConversion'](),this['_initInteractions'](),_0x3b3002['enableReadOnlyMode']('revision-viewer'),_0x3b3002['plugins']['has']('WidgetToolbarRepository')&&_0x3b3002['plugins']['get']('WidgetToolbarRepository')['forceDisabled']('revision-viewer');}async getRevisionDocumentData(_0x184c71){return await this['_utils']['loadRevisionData'](_0x184c71,this['adapter']),this['_utils']['getRevisionDocumentData'](_0x184c71);}async getRevisionRootsAttributes(_0x445131){return await this['_utils']['loadRevisionData'](_0x445131,this['adapter']),this['_utils']['getRevisionRootsAttributes'](_0x445131);}async['compare'](_0x38d48b,_0x5ced3d,_0x56d7f9=!0x1){if(!this['isEnabled'])return;const _0x1b9546=this['diff'],_0x470004=this['repository'],_0x26b628='string'==typeof _0x38d48b?_0x470004['getRevision'](_0x38d48b):_0x38d48b,_0x140b4f='string'==typeof _0x5ced3d?_0x470004['getRevision'](_0x5ced3d):_0x5ced3d,_0x4ab7c8=_0x26b628['id'],_0x24bf05=_0x140b4f?_0x140b4f['id']:null;if(!_0x56d7f9&&this['diff']&&this['diff']['newRevisionId']===_0x4ab7c8&&this['diff']['oldRevisionId']===_0x24bf05)return Promise['resolve']();this['isReady']=!0x1,this['activeView']=null,this['activeChange']=null,this['diff']=new Ht(_0x4ab7c8,_0x24bf05);const _0x5490fd=this['_getRevisionsRange'](_0x26b628,_0x140b4f,!0x0)['map'](_0x2ef36c=>this['_utils']['loadRevisionData'](_0x2ef36c,this['adapter']));return _0x5490fd['push'](new Promise(_0x4cfde=>{setTimeout(_0x4cfde,0x14);})),Promise['all'](_0x5490fd)['then'](()=>{if(!this['isEnabled'])return;this['_cleanUp']();const _0x397826=this['_getDiff'](_0x4ab7c8,_0x24bf05);this['_cleanUpCommentMarkers'](_0x397826);for(const _0x2e8f04 of _0x397826['changes'])this['_changeIdToChange']['set'](_0x2e8f04['id'],_0x2e8f04);this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x4a680e=>{for(const _0x2f9f98 of this['editor']['model']['document']['getRootNames']())_0x4a680e['detachRoot'](_0x2f9f98);for(const _0x4c25db of Object['keys'](_0x397826['model'])){const _0x57217a=_0x397826['model'][_0x4c25db]['name'],_0x2f5310=_0x4a680e['addRoot'](_0x4c25db,_0x57217a);for(const _0x4e28e8 of Object['keys'](_0x397826['attributes'][_0x4c25db]))_0x4a680e['setAttribute'](_0x4e28e8,_0x397826['attributes'][_0x4c25db][_0x4e28e8],_0x2f5310);_0x4a680e['insert'](_0x397826['model'][_0x4c25db],_0x2f5310,0x0);}}),this['diff']['_setChanges'](this['_sortAndFilterDiffChanges'](_0x397826['changes'])),this['isReady']=!0x0;})['catch'](_0x5f5350=>{console['error'](_0x5f5350),this['_cleanUp'](),_0x1b9546&&(this['diff']=_0x1b9546),this['isReady']=!0x0;});}addRevisionData(_0x4abd38,_0x1c94b5){const _0x4220b4=this['repository']['createRevision'](_0x4abd38);return _0x4220b4['on']('_update',(_0xf5b10f,_0x32c16d,_0x100680)=>_0x1c94b5(_0x32c16d,_0x100680,_0x4220b4)),this['repository']['addRevision'](_0x4220b4),_0x4220b4;}['_cleanUp'](){this['activeChange']=null,this['_cleanMarkers'](),this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=null,this['_changeIdToChange']['clear'](),this['editor']['model']['enqueueChange']({'isUndoable':!0x1},_0x16989b=>{for(const _0x4674ad of this['editor']['model']['document']['getRootNames']())_0x16989b['detachRoot'](_0x4674ad);});}_cleanUpCommentMarkers(_0x537e0a){if(!this['_showCommentHighlights']||!this['_getVisibleCommentThreadIds'])return;const _0x1f5fec=this['_getVisibleCommentThreadIds']();for(const _0x687437 of Object['values'](_0x537e0a['model']))for(const _0x35ca79 of Array['from'](_0x687437['markers']['keys']()))_0x35ca79['startsWith']('revision-comment:')&&!_0x1f5fec['has'](Ut(_0x35ca79))&&_0x687437['markers']['delete'](_0x35ca79);}_sortAndFilterDiffChanges(_0x101ba8){const _0x2ecf35=[],_0x3235dd=new Map();for(const _0xb7aca of this['editor']['model']['document']['getRootNames']()){const _0x46d2dc=this['editor']['editing']['view']['getDomRoot'](_0xb7aca);if(!_0x46d2dc)continue;const _0x2817a9=_0x46d2dc['getClientRects']()['item'](0x0);_0x2817a9&&(_0x2ecf35['push'](_0xb7aca),_0x3235dd['set'](_0xb7aca,_0x2817a9));}return _0x2ecf35['sort']((_0x2138b9,_0x513d88)=>{const _0x383725=_0x3235dd['get'](_0x2138b9),_0x486e7d=_0x3235dd['get'](_0x513d88);return _0x383725['y']-_0x486e7d['y']||_0x383725['x']-_0x486e7d['x'];}),(_0x101ba8=_0x101ba8['filter'](_0x429f8b=>_0x2ecf35['includes'](_0x429f8b['rootName'])))['sort']((_0xf69d53,_0x2adef1)=>_0x2ecf35['indexOf'](_0xf69d53['rootName'])-_0x2ecf35['indexOf'](_0x2adef1['rootName'])),_0x101ba8;}['_makeTape'](_0x56375c,_0x11c2e7={}){const _0x37a39a=Array['from'](_0x56375c['markers'])['filter'](([_0x1e201e,_0x40f1cd])=>_0x1e201e['startsWith']('revision:')&&!_0x40f1cd['isCollapsed']),_0x3b638a=Array['from'](this['editor']['model']['createRangeIn'](_0x56375c)['getWalker']({'singleCharacters':!0x0}));if(0x0!=_0x37a39a['length'])for(const _0x3c441d of _0x3b638a){const [_0x5dbe3f,_0x3997df]=_0x37a39a[0x0],[,_0x5345e4,_0x9f8496]=_0x5dbe3f['split'](':'),_0xe023a3=_0x11c2e7[_0x5dbe3f]||null;if(_0x3997df['end']['isEqual'](_0x3c441d['nextPosition'])&&_0x37a39a['shift'](),(_0x3c441d['previousPosition']['isEqual'](_0x3997df['start'])||_0x3c441d['previousPosition']['isAfter'](_0x3997df['start']))&&('insertion'==_0x5345e4?_0x3c441d['isAdded']={'userId':_0x9f8496,'aiSource':_0xe023a3}:'deletion'==_0x5345e4&&(_0x3c441d['isRemoved']={'userId':_0x9f8496,'aiSource':_0xe023a3})),0x0==_0x37a39a['length'])break;}return _0x3b638a;}_refreshStartEndIndex(_0x474857){const _0x341f61=new Map();for(let _0x58e973=0x0;_0x58e973<_0x474857['length'];_0x58e973++)'text'===_0x474857[_0x58e973]['type']?(_0x474857[_0x58e973]['item']['startIndex']=_0x58e973,_0x474857[_0x58e973]['item']['endIndex']=_0x58e973):('elementStart'===_0x474857[_0x58e973]['type']?_0x474857[_0x58e973]['item']['startIndex']=_0x58e973:'elementEnd'===_0x474857[_0x58e973]['type']&&(_0x474857[_0x58e973]['item']['endIndex']=_0x58e973),_0x341f61['set'](_0x474857[_0x58e973]['id'],_0x58e973));for(const _0x299399 of _0x341f61['values']())'elementStart'===_0x474857[_0x299399]['type']?_0x474857[_0x299399]['item']['endIndex']=_0x341f61['get'](_0x474857[_0x299399]['pairId']):'elementEnd'===_0x474857[_0x299399]['type']&&(_0x474857[_0x299399]['item']['startIndex']=_0x341f61['get'](_0x474857[_0x299399]['pairId']));}['_processTape'](_0x1aad7f){for(let _0x1586d6=0x0;_0x1586d6<_0x1aad7f['length'];_0x1586d6++){if('elementStart'===_0x1aad7f[_0x1586d6]['type'])_0x1aad7f[_0x1586d6]['item']['startIndex']=_0x1586d6;else{if('elementEnd'===_0x1aad7f[_0x1586d6]['type']){_0x1aad7f[_0x1586d6]['item']['endIndex']=_0x1586d6;const _0x27e8c7=_0x1aad7f[_0x1586d6]['item']['startIndex'];_0x1aad7f[_0x27e8c7]['pairId']=_0x1aad7f[_0x1586d6]['id'],_0x1aad7f[_0x1586d6]['pairId']=_0x1aad7f[_0x27e8c7]['id'];}else _0x1aad7f[_0x1586d6]['item']['startIndex']=_0x1586d6,_0x1aad7f[_0x1586d6]['item']['endIndex']=_0x1586d6,_0x1aad7f[_0x1586d6]['pairId']=null;}_0x1aad7f[_0x1586d6]['markersStart']||(_0x1aad7f[_0x1586d6]['markersStart']=[],_0x1aad7f[_0x1586d6]['markersEnd']=[]);}}_markInsertions(_0x1878cd,_0x711575){const _0x38fe53=_0x1878cd['filter'](_0x377a81=>!_0x377a81['isAdded']);for(let _0x5a76c0=0x0;_0x5a76c0<_0x711575['length'];_0x5a76c0++)_0x711575[_0x5a76c0]['isAdded']&&(_0x38fe53[_0x5a76c0]['isAdded']=_0x711575[_0x5a76c0]['isAdded']);}_getDiff(_0x1c05b8,_0x2c31e6=null){const _0x131006=this['repository']['getRevision'](_0x1c05b8),_0x290355=_0x2c31e6?this['repository']['getRevision'](_0x2c31e6):null,_0x489d2b=this['_getRevisionsRange'](_0x131006,_0x290355),_0x3df9d4=_0x489d2b[_0x489d2b['length']-0x1],_0x1897c4=new Map(),_0x25cfb1={'model':{},'attributes':{},'changes':[]},_0x2fa7b0=new Set(),_0xe216cc=new Map();for(let _0x3042ef=_0x489d2b['length']-0x1;_0x3042ef>=0x0;_0x3042ef--){const _0x12c3d5=_0x489d2b[_0x3042ef];for(const _0x4e27a0 of Object['keys'](_0x12c3d5['diffData']))if(_0x12c3d5['diffData'][_0x4e27a0]['attachChange']){const _0x38508e=_0x12c3d5['diffData'][_0x4e27a0]['attachChange'];_0x38508e['isAttached']?(_0x2fa7b0['add'](_0x4e27a0),_0xe216cc['has'](_0x4e27a0)&&_0xe216cc['get'](_0x4e27a0)['userId']==_0x38508e['userId']?_0xe216cc['delete'](_0x4e27a0):_0xe216cc['set'](_0x4e27a0,_0x38508e)):_0xe216cc['has'](_0x4e27a0)?(_0x2fa7b0['delete'](_0x4e27a0),_0xe216cc['delete'](_0x4e27a0)):(_0x2fa7b0['add'](_0x4e27a0),_0xe216cc['set'](_0x4e27a0,_0x38508e));}else _0x2fa7b0['add'](_0x4e27a0);}for(const _0x3f645f of _0x2fa7b0){const _0x511471=_0xe216cc['has'](_0x3f645f)&&!_0xe216cc['get'](_0x3f645f)['isAttached'];let _0x14203b=_0x511471?_0x489d2b['length']-0x1:0x0;const _0x401977=_0x511471?-0x1:0x1;for(;_0x489d2b[_0x14203b];){const _0x551f20=_0x489d2b[_0x14203b];if(_0x551f20['diffData'][_0x3f645f]){const _0x8b185a=_0x511471?_0x551f20['diffData'][_0x3f645f]['attributesBefore']:_0x551f20['diffData'][_0x3f645f]['attributesAfter'];_0x25cfb1['attributes'][_0x3f645f]=_0x8b185a?_0x346ba8(_0x8b185a):{};break;}_0x14203b+=_0x401977;}}for(const _0x199e6f of _0x489d2b){_0x199e6f['model']={};for(const _0x9fe7c2 of _0x199e6f['authors'])_0x1897c4['set'](_0x9fe7c2['id'],_0x9fe7c2);for(const _0x52d0e1 of _0x2fa7b0){const _0x568502=_0x199e6f['diffData'][_0x52d0e1]?_0x199e6f['diffData'][_0x52d0e1]['insertions']:'[]',_0x36c730=_0x199e6f['diffData'][_0x52d0e1]?_0x199e6f['diffData'][_0x52d0e1]['deletions']:'[]',_0x4c80ec=_0x199e6f['diffData'][_0x52d0e1]?.['rootElementName']||'$root';_0x199e6f['model'][_0x52d0e1]={'insertions':this['_utils']['_makeModelFromViewString'](_0x568502,_0x4c80ec),'deletions':this['_utils']['_makeModelFromViewString'](_0x36c730,_0x4c80ec)};}}for(const _0xa7482e of _0x2fa7b0){let _0x31417c=null,_0x4864a8=0x0;const _0x460f19=_0x489d2b['map'](_0x2827ac=>_0x2827ac['diffData'][_0xa7482e]?.['rootElementName'])['find'](_0x3cc4d7=>void 0x0!==_0x3cc4d7)||'$root',_0x301a4b=new Map(Array['from'](_0x131006['model'][_0xa7482e]['insertions']['markers'])['filter'](([_0x4604df])=>!_0x4604df['startsWith']('revision:')));let _0x358287=0x0;for(const _0x44e921 of _0x489d2b){const _0x168996=_0x44e921['diffData'][_0xa7482e]?.['aiSources']||{},_0x1542f8=this['_makeTape'](_0x44e921['model'][_0xa7482e]['insertions'],_0x168996);_0x44e921==_0x131006?(_0x31417c=_0x1542f8,_0x4864a8=_0x31417c['length'],_0x31417c['forEach'](_0x58432a=>{_0x58432a['id']=_0x358287++;}),this['_processTape'](_0x31417c)):this['_markInsertions'](_0x31417c,_0x1542f8);const _0x33aaa0=_0x31417c['filter'](_0x253657=>!_0x253657['isAdded'])['map'](_0x17b470=>_0x17b470['id']);let _0x36f07d=0x0;const _0x5809fa=this['_makeTape'](_0x44e921['model'][_0xa7482e]['deletions'],_0x168996);_0x5809fa['forEach'](_0x4349b7=>{_0x4349b7['isRemoved']?_0x4349b7['id']=_0x4864a8++:_0x4349b7['id']=_0x33aaa0[_0x36f07d++];}),this['_processTape'](_0x5809fa),this['_setDistance'](_0x31417c,'isAdded'),this['_setDistance'](_0x5809fa,'isRemoved'),_0x44e921==_0x131006&&this['_markMarkers'](_0x31417c,_0x301a4b),_0x31417c=this['_joinTapes'](_0x31417c,_0x5809fa),this['_refreshStartEndIndex'](_0x31417c),this['_setDistance'](_0x31417c,'isRemoved');}_0x31417c=_0x31417c['filter'](_0x2b4802=>!(_0x2b4802['isAdded']&&_0x2b4802['isRemoved']));const _0x30eef7=new Map(_0x3df9d4['model'][_0xa7482e]['deletions']['markers']),_0x193ad3=new Set(_0x301a4b['keys']());for(const _0x3681e8 of _0x30eef7['keys']())_0x193ad3['delete'](_0x3681e8);const _0x42fdd3=Object['assign']({},..._0x489d2b['map'](_0x66cf0b=>_0x66cf0b['diffData'][_0xa7482e]?.['aiSources']));this['_markSuggestions'](_0x31417c,_0x193ad3,_0x42fdd3),this['_fixObsoleteTags'](_0x31417c),_0x31417c=this['_removeMissingPairs'](_0x31417c),_0x31417c=this['_markMismatchedRemovedTags'](_0x31417c),_0x31417c=this['_removeUnsupportedChanges'](_0x31417c);const {root:_0x140157,changes:_0x1cf70c}=this['_makeModelFromTape'](_0x31417c,_0x1897c4,_0xa7482e,_0x460f19);_0x25cfb1['model'][_0xa7482e]=_0x140157;const _0x98db1f=_0xe216cc['get'](_0xa7482e);if(_0x98db1f){const _0x5abf0a=_0x1897c4['get'](_0x98db1f['userId']),_0x55b049=new Mt({'author':_0x5abf0a,'type':_0x98db1f['isAttached']?'add':'remove','data':{'isOnRoot':!0x0},'createdAt':new Date(),'rootName':_0xa7482e});_0x1cf70c['unshift'](_0x55b049),_0x25cfb1['attributes'][_0xa7482e]['revisionHistoryAttachChange']=_0x55b049['id'];}_0x25cfb1['changes']=_0x25cfb1['changes']['concat'](_0x1cf70c);}return _0x25cfb1;}['_markMarkers'](_0x351391,_0x4e1cd4){for(let _0x16c280=0x0;_0x16c280<_0x351391['length'];_0x16c280++)for(const [_0x448afc,_0x551072]of _0x4e1cd4)!_0x551072['isCollapsed']&&_0x551072['start']['isEqual'](_0x351391[_0x16c280]['previousPosition'])&&_0x351391[_0x16c280]['markersStart']['push'](_0x448afc),_0x551072['end']['isEqual'](_0x351391[_0x16c280]['nextPosition'])&&_0x351391[_0x16c280]['markersEnd']['push'](_0x448afc);}['_joinTapes'](_0x22fcbd,_0x41851c){let _0x370620=[],_0x13a8b4=0x0,_0x56aa0d=0x0;for(;_0x13a8b4<_0x22fcbd['length']||_0x56aa0d<_0x41851c['length'];){const _0x4e8b11=_0x22fcbd[_0x13a8b4]||{},_0x2dfb2d=_0x41851c[_0x56aa0d]||{};if(_0x4e8b11['id']==_0x2dfb2d['id'])_0x13a8b4++,_0x56aa0d++,_0x370620['push'](_0x4e8b11);else{if(_0x2dfb2d['isRemoved']&&_0x4e8b11['isAdded']){const {commonTape:_0xb7ec1f,iEnd:_0x404578,jEnd:_0x398456}=this['_threeWayMerge'](_0x22fcbd,_0x13a8b4,_0x41851c,_0x56aa0d);_0x370620=_0x370620['concat'](_0xb7ec1f),_0x13a8b4=_0x404578,_0x56aa0d=_0x398456;}else _0x2dfb2d['isRemoved']?(_0x56aa0d++,_0x370620['push'](_0x2dfb2d)):(_0x13a8b4++,_0x370620['push'](_0x4e8b11));}}return _0x370620;}_markSuggestions(_0xfd6d67,_0x17bf81,_0x2f85f7){const _0x977d6a=[];for(let _0x15d8a6=0x0;_0x15d8a6<_0xfd6d67['length'];_0x15d8a6++){for(let _0x411e8c=0x0;_0x411e8c<_0xfd6d67[_0x15d8a6]['markersStart']['length'];_0x411e8c++){const _0x19da1d=_0xfd6d67[_0x15d8a6]['markersStart'][_0x411e8c];if(!_0x17bf81['has'](_0x19da1d))continue;const {group:_0x409270,type:_0x4e52e8,authorId:_0xf86bdc}=_0x419c98(_0x19da1d);if('revision-suggestion'!=_0x409270||'insertion'!=_0x4e52e8&&'deletion'!=_0x4e52e8)continue;const _0xe0f399=_0x2f85f7['suggestion:'+_0x19da1d['slice'](0x14)]||null;_0x977d6a['unshift']({'type':_0x4e52e8,'name':_0x19da1d,'userId':_0xf86bdc,'aiSource':_0xe0f399}),_0xfd6d67[_0x15d8a6]['markersStart']['splice'](_0x411e8c,0x1),_0x411e8c--;}_0x2130fa(_0xfd6d67[_0x15d8a6]);for(let _0x3258a0=0x0;_0x3258a0<_0xfd6d67[_0x15d8a6]['markersEnd']['length'];_0x3258a0++){const _0x22a76f=_0xfd6d67[_0x15d8a6]['markersEnd'][_0x3258a0];if(!_0x17bf81['has'](_0x22a76f))continue;const {group:_0x4c51d7,type:_0x43ae05}=_0x419c98(_0x22a76f);if('revision-suggestion'!=_0x4c51d7||'insertion'!=_0x43ae05&&'deletion'!=_0x43ae05)continue;_0xfd6d67[_0x15d8a6]['markersEnd']['splice'](_0x3258a0,0x1),_0x3258a0--;const _0x3911aa=_0x977d6a['findIndex'](_0x4d2210=>_0x4d2210['name']==_0x22a76f);_0x3911aa>-0x1&&_0x977d6a['splice'](_0x3911aa,0x1);}}function _0x419c98(_0x412e9f){const _0x2e92e7=_0x412e9f['split'](':');return{'group':_0x2e92e7[0x0],'type':_0x2e92e7[0x1],'subType':_0x2e92e7['length']>=0x5?_0x2e92e7[0x2]:null,'id':_0x2e92e7['length']<0x5?_0x2e92e7[0x2]:_0x2e92e7[0x3],'authorId':_0x2e92e7['length']<0x5?_0x2e92e7[0x3]:_0x2e92e7[0x4],'markerCount':0x6==_0x2e92e7['length']?_0x2e92e7[0x5]:null};}function _0x2130fa(_0xde4857){for(let _0x16976f=0x0;_0x16976f<_0x977d6a['length'];_0x16976f++){if(_0xde4857['isAdded']&&'insertion'==_0x977d6a[_0x16976f]['type']&&_0xde4857['isAdded']['userId']==_0x977d6a[_0x16976f]['userId'])return _0xde4857['isAddSuggestion']={..._0x977d6a[_0x16976f],'aiSource':_0xde4857['isAdded']['aiSource']||_0x977d6a[_0x16976f]['aiSource']},void delete _0xde4857['isAdded'];if(!_0xde4857['isAdded']&&!_0xde4857['isRemoved']&&'deletion'==_0x977d6a[_0x16976f]['type'])return void(_0xde4857['isRemoveSuggestion']=_0x977d6a[_0x16976f]);}}}_setDistance(_0x54955f,_0x29bf18){let _0x710aa5=0x0,_0x241685=!0x1;const _0x2b91ec=new Map();for(const _0x12fab7 of _0x54955f)_0x12fab7[_0x29bf18]?_0x241685&&(_0x710aa5++,_0x241685=!0x1):(_0x710aa5++,_0x241685=!0x0),_0x2b91ec['set'](_0x12fab7['id'],_0x710aa5);for(let _0x5f1ea1=0x0;_0x5f1ea1<_0x54955f['length'];_0x5f1ea1++){if('isRemoved'==_0x29bf18&&_0x54955f[_0x5f1ea1]['isAdded']||'isAdded'==_0x29bf18&&_0x54955f[_0x5f1ea1]['isRemoved'])continue;if('text'==_0x54955f[_0x5f1ea1]['type']){_0x54955f[_0x5f1ea1]['distance']=0x0;continue;}const _0x9813b2=_0x2b91ec['get'](_0x54955f[_0x5f1ea1]['pairId']),_0x397233=_0x2b91ec['get'](_0x54955f[_0x5f1ea1]['id']);_0x54955f[_0x5f1ea1]['distance']=_0x9813b2-_0x397233;}}_getRevisionsRange(_0x12c045,_0x8d51f4,_0x1e6d36=!0x1){const _0x1313a9=[];let _0x39d84e=this['repository']['getIndex'](_0x12c045),_0x3c2c30=this['repository']['getIndex'](_0x8d51f4);for(-0x1==_0x3c2c30&&(_0x3c2c30=this['repository']['_revisions']['length'],_0x1e6d36=!0x1);_0x39d84e<_0x3c2c30;)_0x1313a9['push'](this['repository']['getRevision'](_0x39d84e)),_0x39d84e++;return _0x1e6d36&&_0x1313a9['push'](this['repository']['getRevision'](_0x39d84e)),_0x1313a9;}_threeWayMerge(_0x199078,_0x2f51d9,_0x3e19d6,_0x139ba5){const _0x268a2c=this['editor']['model']['schema'];let _0x46ea54=_0x2f51d9;for(;_0x199078[_0x46ea54]&&_0x199078[_0x46ea54]['isAdded'];)_0x46ea54++;let _0x1c472f=_0x139ba5;for(;_0x3e19d6[_0x1c472f]&&_0x3e19d6[_0x1c472f]['isRemoved'];)_0x1c472f++;_0xfd06d4(_0x199078,_0x2f51d9,_0x46ea54),_0xfd06d4(_0x3e19d6,_0x139ba5,_0x1c472f);const _0x4ea9ec=_0x3e19d6['slice'](_0x139ba5,_0x1c472f)['concat'](_0x199078['slice'](_0x2f51d9,_0x46ea54));return _0x4ea9ec['sort']((_0x9f1c8b,_0xc6c951)=>_0x9f1c8b['side']!=_0xc6c951['side']?_0x9f1c8b['side']-_0xc6c951['side']:_0x9f1c8b['level']!=_0xc6c951['level']?_0x9f1c8b['level']-_0xc6c951['level']:_0x9f1c8b['distance']!=_0xc6c951['distance']?_0xc6c951['distance']-_0x9f1c8b['distance']:!!_0x9f1c8b['isAdded']!=!!_0xc6c951['isAdded']?-0x1==_0x9f1c8b['side']||0x0==_0x9f1c8b['side']?_0x9f1c8b['isAdded']?-0x1:0x1:_0x9f1c8b['isAdded']?0x1:-0x1:_0x9f1c8b['index']-_0xc6c951['index']),{'commonTape':_0x4ea9ec,'iEnd':_0x46ea54,'jEnd':_0x1c472f};function _0xfd06d4(_0x1354f6,_0x1dd81e,_0x287dca){let _0x5cda02=-0x1,_0x103064=Number['POSITIVE_INFINITY'],_0x3f4ea3=!0x0;for(let _0x2b6b3e=_0x1dd81e;_0x2b6b3e<_0x287dca;_0x2b6b3e++)if(_0x268a2c['isInline'](_0x1354f6[_0x2b6b3e]['item'])||(_0x3f4ea3=!0x1),_0x1354f6[_0x2b6b3e]['item']['startIndex']<_0x1dd81e&&(_0x5cda02=_0x2b6b3e),_0x1354f6[_0x2b6b3e]['item']['endIndex']>=_0x287dca){_0x103064=_0x2b6b3e;break;}_0x3f4ea3&&(_0x5cda02=_0x287dca-0x1);for(let _0x109d97=_0x1dd81e;_0x109d97<_0x287dca;_0x109d97++)_0x1354f6[_0x109d97]['side']=_0x109d97<=_0x5cda02?-0x1:_0x109d97<_0x103064?0x0:0x1,_0x1354f6[_0x109d97]['index']=_0x109d97;let _0x2f9e5d=0x0;for(let _0xd88be=_0x1dd81e;_0xd88be<=_0x5cda02;_0xd88be++)0x0==_0x1354f6[_0xd88be]['distance']?_0x1354f6[_0xd88be]['level']=_0x2f9e5d:(_0x2f9e5d++,_0x1354f6[_0xd88be]['level']=_0x2f9e5d,_0x2f9e5d++);for(let _0x11403b=_0x1dd81e;_0x11403b<_0x287dca;_0x11403b++)0x0==_0x1354f6[_0x11403b]['side']&&(_0x1354f6[_0x11403b]['level']=_0x2f9e5d);_0x2f9e5d=0x0;for(let _0x3b9ab7=_0x287dca-0x1;_0x3b9ab7>=_0x103064;_0x3b9ab7--)0x0==_0x1354f6[_0x3b9ab7]['distance']?_0x1354f6[_0x3b9ab7]['level']=_0x2f9e5d:(_0x2f9e5d--,_0x1354f6[_0x3b9ab7]['level']=_0x2f9e5d,_0x2f9e5d--);}}_fixObsoleteTags(_0x9fb815){const _0x3e87b8=new Map(),_0x383a20=this['editor']['model']['schema'];for(let _0x421525=0x1;_0x421525<_0x9fb815['length'];_0x421525++){let _0x2ad0f9,_0x552755,_0x8ca2b5;const _0x41efc6=_0x9fb815[_0x421525],_0x18d51d=_0x9fb815[_0x421525-0x1];if('text'==_0x41efc6['type'])continue;if(_0x41efc6['type']!=_0x18d51d['type'])continue;if(!_0x383a20['isBlock'](_0x18d51d['item'])||_0x383a20['isLimit'](_0x18d51d['item']))continue;if(!_0x383a20['isBlock'](_0x41efc6['item'])||_0x383a20['isLimit'](_0x41efc6['item']))continue;if((_0x9fb815[_0x421525]['isAdded']||_0x9fb815[_0x421525]['isAddSuggestion'])&&_0x9fb815[_0x421525-0x1]['isRemoved'])_0x2ad0f9=_0x9fb815[_0x421525],_0x552755=_0x9fb815[_0x421525-0x1],_0x8ca2b5=_0x421525-0x1;else{if(!_0x9fb815[_0x421525]['isRemoved']||!_0x9fb815[_0x421525-0x1]['isAdded']&&!_0x9fb815[_0x421525-0x1]['isAddSuggestion'])continue;_0x2ad0f9=_0x9fb815[_0x421525-0x1],_0x552755=_0x9fb815[_0x421525],_0x8ca2b5=_0x421525;}const _0x24f070=_0x2ad0f9['level']==_0x552755['level'],_0xb28b7c=Math['abs'](_0x2ad0f9['level'])<Math['abs'](_0x552755['level'])&&0x0==_0x552755['distance'];(_0x24f070||_0xb28b7c)&&(_0x3e87b8['set'](_0x552755['id'],_0x2ad0f9['id']),_0x9fb815['splice'](_0x8ca2b5,0x1),_0x421525--,_0x2ad0f9['isAdded']=!0x1);}for(let _0x1bb1de=0x0;_0x1bb1de<_0x9fb815['length'];_0x1bb1de++)_0x3e87b8['has'](_0x9fb815[_0x1bb1de]['pairId'])&&(_0x9fb815[_0x1bb1de]['pairId']=_0x3e87b8['get'](_0x9fb815[_0x1bb1de]['pairId']));}['_removeMissingPairs'](_0x11cd4e){const _0x437d2e=new Set(_0x11cd4e['map'](_0x307d6b=>_0x307d6b['id']));for(let _0x913647=0x0;_0x913647<_0x11cd4e['length'];_0x913647++)_0x437d2e['has'](_0x11cd4e[_0x913647]['pairId'])||0x0==_0x11cd4e[_0x913647]['distance']||(_0x11cd4e[_0x913647]['isIncorrect']=!0x0);return _0x11cd4e['filter'](_0x394a63=>!_0x394a63['isIncorrect']);}_markMismatchedRemovedTags(_0x4a4961){const _0xf76fd9=new Set();for(let _0x1e5269=0x0;_0x1e5269<_0x4a4961['length'];_0x1e5269++){if(_0xf76fd9['has'](_0x4a4961[_0x1e5269]['id'])&&_0x4a4961[_0x1e5269]['isRemoved']&&(_0x4a4961[_0x1e5269]['isIncorrect']=!0x0),_0x4a4961[_0x1e5269]['isIncorrect'])continue;if(0x0==_0x4a4961[_0x1e5269]['distance'])continue;if('elementStart'!=_0x4a4961[_0x1e5269]['type'])continue;if(null==_0x4a4961[_0x1e5269]['pairId'])continue;let _0x12b69d=_0x1e5269+0x1,_0x478841=0x0;for(;_0x4a4961[_0x12b69d]['id']!=_0x4a4961[_0x1e5269]['pairId'];)'elementStart'==_0x4a4961[_0x12b69d]['type']?_0x478841++:'elementEnd'==_0x4a4961[_0x12b69d]['type']&&_0x478841--,_0x12b69d++;if(0x0!=_0x478841){if(_0x4a4961[_0x1e5269]['isRemoved'])_0x4a4961[_0x1e5269]['isIncorrect']=!0x0;else{for(;_0x12b69d!=_0x1e5269;)_0x4a4961[_0x12b69d]['isRemoved']&&0x0!=_0x4a4961[_0x12b69d]['distance']&&(_0x4a4961[_0x12b69d]['isIncorrect']=!0x0,_0xf76fd9['add'](_0x4a4961[_0x12b69d]['pairId'])),_0x12b69d--;}}}return _0x4a4961['filter'](_0x36716c=>!_0x36716c['isIncorrect']);}_removeUnsupportedChanges(_0x1f18bc){const _0x629b6f=this['editor']['model']['schema'];for(let _0x5135e1=0x0;_0x5135e1<_0x1f18bc['length'];_0x5135e1++){if(!(_0x1f18bc[_0x5135e1]['isAdded']||_0x1f18bc[_0x5135e1]['isAddSuggestion']||_0x1f18bc[_0x5135e1]['isRemoved']||_0x1f18bc[_0x5135e1]['isRemoveSuggestion']))continue;if(0x0==_0x1f18bc[_0x5135e1]['distance'])continue;const _0x376d59=_0x1f18bc[_0x5135e1]['item'];_0x629b6f['isBlock'](_0x376d59)||_0x629b6f['isLimit'](_0x376d59)||(_0x1f18bc[_0x5135e1]['isAdded']&&delete _0x1f18bc[_0x5135e1]['isAdded'],_0x1f18bc[_0x5135e1]['isAddSuggestion']&&delete _0x1f18bc[_0x5135e1]['isAddSuggestion'],_0x1f18bc[_0x5135e1]['isRemoveSuggestion']&&delete _0x1f18bc[_0x5135e1]['isRemoveSuggestion'],_0x1f18bc[_0x5135e1]['isRemoved']&&(_0x1f18bc[_0x5135e1]['isIncorrect']=!0x0));}return _0x1f18bc['filter'](_0x46710e=>!_0x46710e['isIncorrect']);}['_makeModelFromTape'](_0x3028f0,_0x49b1cd,_0x2ba6cc,_0xd681ef){const _0x5a483c=new _0x3bdc31(),_0x8da001=[],_0x1b1c21=new Map(),_0x27b577=this['editor']['model'],_0x3ff698=_0x27b577['schema'],_0x8ecf1f=[_0x5a483c],_0x2d8820={},_0x147eea={'isAdded':[],'isRemoved':[],'isAddSuggestion':[],'isRemoveSuggestion':[]};_0x5a483c['name']=_0xd681ef;let _0x34b968=null;const _0x56eafd=[0x0];for(let _0x5d05d2=0x0;_0x5d05d2<_0x3028f0['length'];_0x5d05d2++)if('elementStart'===_0x3028f0[_0x5d05d2]['type']){_0x3028f0[_0x5d05d2]['previousPosition']=_0x27b577['createPositionFromPath'](_0x5a483c,_0x56eafd);const _0x5cb14b=new _0x19c548(_0x3028f0[_0x5d05d2]['item']['name'],_0x3028f0[_0x5d05d2]['item']['getAttributes']());_0x8ecf1f[0x0]['_appendChild'](_0x5cb14b),_0x56eafd['push'](0x0),_0x8ecf1f['unshift'](_0x5cb14b),_0x3028f0[_0x5d05d2]['nextPosition']=_0x27b577['createPositionFromPath'](_0x5a483c,_0x56eafd);}else'elementEnd'===_0x3028f0[_0x5d05d2]['type']?(_0x8ecf1f['shift'](),_0x3028f0[_0x5d05d2]['previousPosition']=_0x27b577['createPositionFromPath'](_0x5a483c,_0x56eafd),_0x56eafd['pop'](),_0x56eafd[_0x56eafd['length']-0x1]++,_0x3028f0[_0x5d05d2]['nextPosition']=_0x27b577['createPositionFromPath'](_0x5a483c,_0x56eafd)):(_0x3028f0[_0x5d05d2]['previousPosition']=_0x27b577['createPositionFromPath'](_0x5a483c,_0x56eafd),_0x34b968?_0x34b968['_data']+=_0x3028f0[_0x5d05d2]['item']['data']:_0x34b968=new _0x7943a3(_0x3028f0[_0x5d05d2]['item']['data'],_0x3028f0[_0x5d05d2]['item']['getAttributes']()),_0x3028f0[_0x5d05d2+0x1]&&'text'===_0x3028f0[_0x5d05d2+0x1]['type']&&_0x3bd842(_0x34b968,_0x3028f0[_0x5d05d2+0x1]['item'])||(_0x8ecf1f[0x0]['_appendChild'](_0x34b968),_0x34b968=null),_0x56eafd[_0x56eafd['length']-0x1]+=_0x3028f0[_0x5d05d2]['item']['offsetSize'],_0x3028f0[_0x5d05d2]['nextPosition']=_0x27b577['createPositionFromPath'](_0x5a483c,_0x56eafd));for(let _0x2ba97b=0x0;_0x2ba97b<_0x3028f0['length'];_0x2ba97b++){const _0x32bec6=_0x3028f0[_0x2ba97b]['previousPosition'],_0x2d14d1=_0x3028f0[_0x2ba97b]['nextPosition'];for(const _0x344c99 of _0x3028f0[_0x2ba97b]['markersStart'])_0x1b1c21['set'](_0x344c99,{'start':_0x32bec6,'end':null});_0x597304('isRemoveSuggestion',_0x2ba97b,_0x32bec6,_0x2d14d1),_0x597304('isAddSuggestion',_0x2ba97b,_0x32bec6,_0x2d14d1),_0x597304('isRemoved',_0x2ba97b,_0x32bec6,_0x2d14d1),_0x597304('isAdded',_0x2ba97b,_0x32bec6,_0x2d14d1);for(const _0x35456e of _0x3028f0[_0x2ba97b]['markersEnd']){const _0x431c91=_0x1b1c21['get'](_0x35456e);_0x431c91?_0x431c91['end']=_0x2d14d1:_0x1b1c21['set'](_0x35456e,{'start':_0x2d14d1,'end':_0x2d14d1});}}for(const [_0x4a24d9,_0x3c5163]of _0x1b1c21){const _0x4377de=this['editor']['model']['createRange'](_0x3c5163['start'],_0x3c5163['end']);_0x5a483c['markers']['set'](_0x4a24d9,_0x4377de);}return _0x8da001['sort']((_0x2b59af,_0xeaf05b)=>{const _0x561206=_0x5a483c['markers']['get']('revision:'+_0x2b59af['id']),_0x101c5b=_0x5a483c['markers']['get']('revision:'+_0xeaf05b['id']);return _0x561206['start']['isBefore'](_0x101c5b['start'])?-0x1:_0x561206['start']['isAfter'](_0x101c5b['start'])?0x1:_0x561206['end']['isBefore'](_0x101c5b['end'])?-0x1:_0x561206['end']['isAfter'](_0x101c5b['end'])?0x1:'add'===_0x2b59af['type']?-0x1:0x1;}),{'root':_0x5a483c,'changes':_0x8da001};function _0x597304(_0x1687a9,_0x59cdf4,_0x19aebe,_0x53477f){const _0x179c02=!!_0x3028f0[_0x59cdf4][_0x1687a9],_0x283e57=_0x179c02?_0x3028f0[_0x59cdf4][_0x1687a9]['userId']:null,_0xc90e0d=_0x179c02&&_0x3028f0[_0x59cdf4][_0x1687a9]['aiSource']||null,_0x3bb3f6=_0x59cdf4===_0x3028f0['length']-0x1,_0x3ab1b9=_0x147eea[_0x1687a9][0x0],_0x43fd8d=_0x3ff698['isObject'](_0x3028f0[_0x59cdf4]['item']);!_0x2d8820[_0x1687a9]&&_0x179c02?_0x2d8820[_0x1687a9]={'start':_0x19aebe,'tapeItem':_0x3028f0[_0x59cdf4],'userId':_0x283e57,'aiSource':_0xc90e0d,'type':_0x1687a9}:_0x2d8820[_0x1687a9]&&!_0x179c02?(_0x2d8820[_0x1687a9]['end']=_0x19aebe,_0x4a7e65(_0x2d8820[_0x1687a9]),_0x2d8820[_0x1687a9]=null):_0x2d8820[_0x1687a9]&&_0x179c02&&(_0x2d8820[_0x1687a9]['userId']!==_0x283e57||_0x2d8820[_0x1687a9]['aiSource']!==_0xc90e0d)&&(_0x2d8820[_0x1687a9]['end']=_0x19aebe,_0x3ab1b9&&_0x3ab1b9['userId']===_0x2d8820[_0x1687a9]['userId']?_0x3ab1b9['change']['aiSource']=_0x3ab1b9['change']['aiSource']||_0x2d8820[_0x1687a9]['aiSource']:_0x4a7e65(_0x2d8820[_0x1687a9]),_0x2d8820[_0x1687a9]={'start':_0x19aebe,'tapeItem':_0x3028f0[_0x59cdf4],'userId':_0x283e57,'aiSource':_0xc90e0d,'type':_0x1687a9}),_0x2d8820[_0x1687a9]&&_0x43fd8d&&('elementStart'!==_0x3028f0[_0x59cdf4]['type']||_0x3ab1b9&&_0x3ab1b9['userId']===_0x283e57||_0x147eea[_0x1687a9]['unshift']({'userId':_0x283e57,'object':_0x3028f0[_0x59cdf4]['item'],'change':_0x2d8820[_0x1687a9]}),'elementEnd'===_0x3028f0[_0x59cdf4]['type']&&_0x3ab1b9&&_0x3ab1b9['object']===_0x3028f0[_0x59cdf4]['item']&&(_0x147eea[_0x1687a9]['shift'](),_0x2d8820[_0x1687a9]=_0x3ab1b9['change'])),_0x2d8820[_0x1687a9]&&_0x3bb3f6&&(_0x2d8820[_0x1687a9]['end']=_0x53477f,_0x4a7e65(_0x2d8820[_0x1687a9]),_0x2d8820[_0x1687a9]=null);}function _0x4a7e65({start:_0x2497ff,end:_0x3bb505,tapeItem:_0x1ce21d,userId:_0x5aa7e1,aiSource:_0x4a9884,type:_0x1fc896}){const _0x63798e=_0x1ce21d['item'],_0x139ec0=_0x27b577['schema']['isBlock'](_0x63798e)&&!_0x27b577['schema']['isLimit'](_0x63798e),_0x5c0a9c=_0x2497ff['nodeAfter']==_0x3bb505['parent']&&_0x3bb505['isAtStart'];if(_0x139ec0&&_0x5c0a9c)return;const _0x3b4070=_0x27b577['createRange'](_0x2497ff,_0x3bb505),_0x5a88be=_0x49b1cd['get'](_0x5aa7e1),_0x3c85f4=new Mt({'author':_0x5a88be,'type':'isAdded'==_0x1fc896||'isAddSuggestion'==_0x1fc896?'add':'remove','data':{'isSuggestion':'isAddSuggestion'==_0x1fc896||'isRemoveSuggestion'==_0x1fc896,'aiSource':_0x4a9884||null},'createdAt':new Date(),'rootName':_0x2ba6cc});_0x8da001['push'](_0x3c85f4),_0x5a483c['markers']['set']('revision:'+_0x3c85f4['id'],_0x3b4070);}function _0x3bd842(_0x10d663,_0x2382d5){const _0xd95345=_0x10d663['getAttributes'](),_0xfeb5ce=_0x2382d5['getAttributes']();for(const _0x2ff98c of _0xd95345){if(_0x2ff98c[0x1]!==_0x2382d5['getAttribute'](_0x2ff98c[0x0]))return!0x1;_0xfeb5ce['next']();}return _0xfeb5ce['next']()['done'];}}_setConversion(){this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'revision'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision','view':_0x57276a=>{const _0x36fd1b=_0x57276a['markerName']['split'](':')[0x1],_0x38c6dc=this['_getChangeFromId'](_0x36fd1b);if(!_0x38c6dc)return null;const _0x213dc7='add'==_0x38c6dc['type']?'insertion':'deletion',_0x41c74a=['ck-suggestion-marker','ck-suggestion-marker-'+_0x213dc7];return _0x38c6dc['data']['isSuggestion']&&_0x41c74a['push']('ck-suggestion-marker-'+_0x213dc7+'-new'),this['activeChange']==_0x38c6dc&&_0x41c74a['push']('ck-suggestion-marker--active'),{'classes':_0x41c74a,'attributes':{'data-change-id':_0x36fd1b}};}}),this['editor']['conversion']['for']('upcast')['add'](_0x2466f0=>{_0x2466f0['on']('element:pre',(_0x15a6bf,_0x28d296,_0x38446f)=>{const _0x87f684=_0x28d296['viewItem']['getChild'](0x0);if(!_0x87f684||!_0x87f684['is']('element','code'))return;if(!_0x38446f['consumable']['consume'](_0x87f684,{'attributes':['vid_start','vid_end']}))return;const _0x1e18fb=_0x28d296['modelRange']['start']['nodeAfter'];_0x38446f['writer']['setAttribute']('vid_start',_0x87f684['getAttribute']('vid_start'),_0x1e18fb),_0x38446f['writer']['setAttribute']('vid_end',_0x87f684['getAttribute']('vid_end'),_0x1e18fb);},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['add'](_0x3e9861=>{_0x3e9861['on']('element',(_0x224895,_0x940b,_0x10e53f)=>{if(!_0x10e53f['consumable']['consume'](_0x940b['viewItem'],{'attributes':['vid_start','vid_end']}))return;if(_0x940b['modelRange']['isCollapsed'])return;const _0xd25257=_0x940b['modelRange']['start']['nodeAfter'];_0xd25257['hasAttribute']('vid_start')||_0xd25257['hasAttribute']('vid')||(_0x10e53f['writer']['setAttribute']('vid_start',_0x940b['viewItem']['getAttribute']('vid_start'),_0xd25257),_0x10e53f['writer']['setAttribute']('vid_end',_0x940b['viewItem']['getAttribute']('vid_end'),_0xd25257));},{'priority':'low'});}),this['editor']['conversion']['for']('upcast')['elementToAttribute']({'view':{'name':'span','attributes':{'vid':!0x0}},'model':{'key':'vid','value':_0x92659f=>_0x92659f['getAttribute']('vid')}}),this['editor']['model']['schema']['on']('checkAttribute',(_0x208410,[,_0x38f245])=>{['vid_start','vid_end','vid']['includes'](_0x38f245)&&(_0x208410['return']=!0x0,_0x208410['stop']());},{'priority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x106fad=>{_0x106fad['on']('attribute:vid',(_0x500838,_0x5257bc,_0x4b2067)=>{if('\x20'!=_0x5257bc['item']['data']||_0x5257bc['item']['parent']['maxOffset']>0x1)return;if(!_0x4b2067['consumable']['consume'](_0x5257bc['item'],_0x500838['name']))return;const _0x3986d2=_0x4b2067['writer'],_0x7054fd=_0x4b2067['mapper']['toViewRange'](_0x5257bc['range']);_0x3986d2['wrap'](_0x7054fd,_0x3986d2['createAttributeElement']('span'));});}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',function(_0x4b9340){const _0x1482b7=_0x4b9340['plugins']['get']('RevisionViewer');return(_0x10b4b7,_0x4c2eb9,_0x267625)=>{const _0x2f31b1=_0x4c2eb9['markerName']['split'](':')[0x1],_0x3615bd=_0x1482b7['_getChangeFromId'](_0x2f31b1);if(!_0x3615bd)return null;const _0x45bd14='add'==_0x3615bd['type']?'split':'merge';if(!_0x267625['consumable']['test'](_0x4c2eb9['markerRange'],_0x10b4b7['name']))return;const _0x394b6b=_0x4c2eb9['markerRange']['getWalker'](),_0x22cdc0=_0x4c2eb9['markerRange']['start'],_0x1058ac=_0x4b9340['model']['schema'];let _0x1cae96=null,_0x30b6f4=null,_0x2552fe=!0x1,_0x4494c0=!0x1;for(const _0x3743bb of _0x394b6b){const _0x54f292=_0x3743bb['item'];_0x2552fe=_0x2552fe||_0x1058ac['isContent'](_0x54f292);const _0x2a0fde=_0x267625['mapper']['toViewElement'](_0x54f292);if(_0x2a0fde&&_0x2a0fde['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x3743bb['type']&&(_0x1058ac['isBlock'](_0x54f292)&&!_0x1058ac['isLimit'](_0x54f292)&&(_0x54f292['nextSibling']||_0x22cdc0['isAtEnd']?_0x1cae96&&_0x1cae96['parent']==_0x54f292||(_0x1cae96=_0x54f292,_0x5e4099(_0x3743bb['previousPosition']),_0x4494c0=!0x0):_0x30b6f4=_0x30b6f4||_0x3743bb['previousPosition']));}function _0x5e4099(_0x22088f){const _0x4063b4=_0x267625['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x45bd14}),_0x286cae=_0x267625['mapper']['toViewPosition'](_0x22088f);_0x3615bd['data']['isSuggestion']&&_0x267625['writer']['addClass']('ck-suggestion-marker-'+_0x45bd14+'-new',_0x4063b4),_0x1482b7['activeChange']==_0x3615bd&&_0x267625['writer']['addClass']('ck-suggestion-marker--active',_0x4063b4),_0x267625['writer']['insert'](_0x286cae,_0x4063b4),_0x267625['mapper']['bindElementToMarker'](_0x4063b4,_0x4c2eb9['markerName']);}_0x2552fe||_0x4494c0||!_0x30b6f4||_0x5e4099(_0x30b6f4);};}(this['editor']),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision',(_0x318f97,_0x20d816,_0x39d18b)=>{const _0x2f4f57=_0x39d18b['mapper']['markerNameToElements'](_0x20d816['markerName']);if(_0x2f4f57){for(const _0x18b749 of _0x2f4f57)(_0x18b749['hasClass']('ck-suggestion-marker-split')||_0x18b749['hasClass']('ck-suggestion-marker-merge'))&&(_0x39d18b['mapper']['unbindElementFromMarkerName'](_0x18b749,_0x20d816['markerName']),_0x39d18b['writer']['remove'](_0x18b749));}},{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision',(_0x2c01b7,_0x2593d7,_0x4b9383)=>{const _0x1e65e1=_0x2593d7['markerName']['split'](':')[0x1],_0xd302a8=this['_getChangeFromId'](_0x1e65e1);if(!_0xd302a8)return null;const _0x23269d='add'==_0xd302a8['type']?'split':'merge';if(_0x4b9383['consumable']['test'](_0x2593d7['markerRange'],_0x2c01b7['name']))for(const _0x309f95 of _0x2593d7['markerRange']['getItems']()){if(!_0x309f95['is']('element','softBreak'))continue;const _0x274580=_0x4b9383['writer']['createUIElement']('span',{'class':'ck-suggestion-marker-'+_0x23269d}),_0x285250=_0x4b9383['mapper']['toViewPosition'](this['editor']['model']['createPositionBefore'](_0x309f95));_0xd302a8['data']['isSuggestion']&&_0x4b9383['writer']['addClass']('ck-suggestion-marker-'+_0x23269d+'-new',_0x274580),this['activeChange']==_0xd302a8&&_0x4b9383['writer']['addClass']('ck-suggestion-marker--active',_0x274580),_0x4b9383['writer']['insert'](_0x285250,_0x274580),_0x4b9383['mapper']['bindElementToMarker'](_0x274580,_0x2593d7['markerName']);}},{'priority':'high'}),this['editor']['model']['document']['on']('change',()=>{this['editor']['editing']['view']['change'](_0x207b0d=>{for(const _0x3b638e of this['editor']['model']['document']['getRootNames']()){const _0x552d25=this['editor']['model']['document']['getRoot'](_0x3b638e),_0x410a27=this['editor']['editing']['view']['document']['getRoot'](_0x3b638e);if(_0x410a27){const _0x14ad3b=_0x552d25['getAttribute']('revisionHistoryAttachChange');if(_0x207b0d['removeAttribute']('data-change-id',_0x410a27),_0x207b0d['removeClass']('ck-revision-history-root-add',_0x410a27),_0x207b0d['removeClass']('ck-revision-history-root-remove',_0x410a27),_0x207b0d['removeClass']('ck-revision-history-root--active',_0x410a27),_0x14ad3b){const _0x1eb6d6=this['_getChangeFromId'](_0x14ad3b);if(!_0x1eb6d6)return null;_0x207b0d['setAttribute']('data-change-id',_0x14ad3b,_0x410a27),_0x207b0d['addClass']('ck-revision-history-root-'+_0x1eb6d6['type'],_0x410a27),this['activeChange']==_0x1eb6d6&&_0x207b0d['addClass']('ck-revision-history-root--active',_0x410a27);}}}});}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'comment','model':_0x3d5f09=>'revision-comment:'+_0x3d5f09,'converterPriority':'highest'}),this['_showCommentHighlights']&&this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-comment','view':_0x397dab=>({'classes':['ck-comment-marker'],'attributes':{'data-comment':Ut(_0x397dab['markerName'])}})}),this['editor']['conversion']['for']('upcast')['dataToMarker']({'view':'suggestion','model':_0xd94fd=>'revision-suggestion:'+_0xd94fd,'converterPriority':'highest'}),this['editor']['conversion']['for']('dataDowncast')['markerToData']({'model':'revision-suggestion','view':_0x41a97a=>({'name':'suggestion:'+_0x41a97a,'group':'revision-suggestion'}),'converterPriority':'highest'}),this['editor']['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'revision-suggestion','view':_0x140fd1=>{const _0x24746b=_0x140fd1['markerName']['split'](':')[0x1];return'insertion'!=_0x24746b&&'deletion'!=_0x24746b?null:{'classes':['ck-suggestion-preview-marker','ck-suggestion-preview-marker-'+_0x24746b]};}}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:deletion',Lt(this['editor'],'merge'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('addMarker:revision-suggestion:insertion',Lt(this['editor'],'split'),{'priority':'high'}),this['editor']['editing']['downcastDispatcher']['on']('removeMarker:revision-suggestion',(_0xf43999,_0x3efac2,_0x35af24)=>{const _0x44902a=_0x35af24['mapper']['markerNameToElements'](_0x3efac2['markerName']);if(_0x44902a){for(const _0x66a15c of _0x44902a)_0x66a15c['is']('uiElement')&&(_0x35af24['mapper']['unbindElementFromMarkerName'](_0x66a15c,_0x3efac2['markerName']),_0x35af24['writer']['remove'](_0x66a15c));}},{'priority':'high'});}_getChangeFromId(_0x17db62){return this['_changeIdToChange']['get'](_0x17db62);}_getViewForChange(_0x44484f){return this['_changeView']&&this['_changeView']['destroy'](),this['_changeView']=new Vt(this['editor']['locale'],_0x44484f,'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_changeView'];}_initInteractions(){this['editor']['model']['document']['selection']['observeMarkers']('revision'),this['on']('change:activeView',(_0x1eecf6,_0x4e3fbc,_0x576aba,_0xab11d4)=>{_0xab11d4&&this['_balloon']['remove'](_0xab11d4),_0x576aba&&(this['_balloon']['add']({'view':_0x576aba,'stackId':'revisionHistoryLabel','position':{'target':()=>{const _0x4c4886=this['editor']['editing'],_0x2bd6ee=this['_getChangeFromId'](_0x576aba['changeId']);let _0x17b921;if(_0x2bd6ee['data']['isOnRoot']){const _0x3f1832=_0x4c4886['view']['getDomRoot'](_0x2bd6ee['rootName']);_0x17b921=Array['from'](_0x3f1832['getClientRects']());}else{const _0x51b6f1=this['editor']['model']['markers']['get']('revision:'+_0x576aba['changeId']);_0x17b921=Array['from'](_0x4c4886['mapper']['markerNameToElements'](_0x51b6f1['name']))['map'](_0x4f0ead=>_0x4c4886['view']['domConverter']['mapViewToDom'](_0x4f0ead))['map'](_0x5c9510=>Array['from'](_0x5c9510['getClientRects']()))['flat']();}return this['_activeViewTarget']&&_0x17b921['find'](_0x277300=>_0x277300['top']-0x3<=this['_activeViewTarget']['y']&&_0x277300['bottom']+0x3>=this['_activeViewTarget']['y']&&_0x277300['left']-0x3<=this['_activeViewTarget']['x']&&_0x277300['right']+0x3>=this['_activeViewTarget']['x'])||_0x17b921[0x0];}}}),this['_balloon']['showStack']('revisionHistoryLabel'));}),this['on']('change:activeChange',(_0x3d9822,_0x3a12f9,_0x1482aa,_0xae8039)=>{this['activeView']=_0x1482aa?this['_getViewForChange'](_0x1482aa):null,this['editor']['model']['change'](()=>{const _0x5ea9d8=this['editor']['editing'];_0xae8039&&(_0xae8039['data']['isOnRoot']?_0x5ea9d8['view']['change'](_0x35c39d=>{_0x35c39d['removeClass']('ck-revision-history-root--active',_0x5ea9d8['view']['document']['getRoot'](_0xae8039['rootName']));}):_0x5ea9d8['reconvertMarker']('revision:'+_0xae8039['id'])),_0x1482aa&&(_0x1482aa['data']['isOnRoot']?_0x5ea9d8['view']['change'](_0x2e7714=>{_0x2e7714['addClass']('ck-revision-history-root--active',_0x5ea9d8['view']['document']['getRoot'](_0x1482aa['rootName']));}):_0x5ea9d8['reconvertMarker']('revision:'+_0x1482aa['id']));});}),this['listenTo'](this['editor']['editing']['view']['document'],'mouseover',(_0x5c17da,_0x2b9dda)=>{if(this['activeChange'])return;const _0x25ccc1=this['_findChangeIdFromDomTarget'](_0x2b9dda['target']),_0x3093f2=this['_changeIdToChange']['get'](_0x25ccc1);_0x3093f2?(this['_activeViewTarget']={'x':_0x2b9dda['domEvent']['x'],'y':_0x2b9dda['domEvent']['y']},this['activeView']=this['_getViewForChange'](_0x3093f2)):(this['_activeViewTarget']=null,this['activeView']=null);}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',(_0x5995e2,_0x54c49c)=>{const _0x2e8524=this['_findChangeIdFromDomTarget'](_0x54c49c['target']),_0x5e4000=this['_changeIdToChange']['get'](_0x2e8524);_0x5e4000?(this['_activeViewTarget']={'x':_0x54c49c['domEvent']['x'],'y':_0x54c49c['domEvent']['y']},_0x5e4000===this['activeChange']?this['_balloon']['updatePosition']():this['activeChange']=_0x5e4000):(this['_activeViewTarget']=null,this['activeChange']=null);});}_findChangeIdFromDomTarget(_0x18a4e9){do{const _0x47225f=_0x18a4e9['getAttribute']('data-change-id');if(_0x47225f)return _0x47225f;_0x18a4e9=_0x18a4e9['parent'];}while(_0x18a4e9);return null;}['_cleanMarkers'](){this['editor']['model']['change'](_0x1d3a84=>{for(const _0x6d1d25 of this['editor']['model']['markers'])_0x1d3a84['removeMarker'](_0x6d1d25);});}};function Ut(_0x3677b9){return _0x3677b9['split'](':')[0x1];}function Lt(_0x46ba00,_0x389278){return(_0x5744c8,_0x3dd766,_0x5bea18)=>{if(!_0x5bea18['consumable']['test'](_0x3dd766['markerRange'],_0x5744c8['name']))return;const _0x2be4be=_0x3dd766['markerRange']['getWalker'](),_0x2e3d55=_0x3dd766['markerRange']['start'],_0x57a205=_0x46ba00['model']['schema'];let _0x3deda0=null,_0xee7465=null,_0x2b6839=!0x1,_0x4bc246=!0x1;for(const _0x2cf264 of _0x2be4be){const _0x50159d=_0x2cf264['item'];_0x2b6839=_0x2b6839||_0x57a205['isContent'](_0x50159d);const _0x42c4c7=_0x5bea18['mapper']['toViewElement'](_0x50159d);if(_0x42c4c7&&_0x42c4c7['getCustomProperty']('addHighlight'))return;'elementEnd'==_0x2cf264['type']&&(_0x57a205['isBlock'](_0x50159d)&&!_0x57a205['isLimit'](_0x50159d)&&(_0x50159d['nextSibling']||_0x2e3d55['isAtEnd']?_0x3deda0&&_0x3deda0['parent']==_0x50159d||(_0x3deda0=_0x50159d,_0x4ce0c4(_0x2cf264['previousPosition']),_0x4bc246=!0x0):_0xee7465=_0xee7465||_0x2cf264['previousPosition']));}function _0x4ce0c4(_0x30a094){const _0x16f23e=_0x5bea18['mapper']['toViewPosition'](_0x30a094),_0x345680=_0x5bea18['writer']['createUIElement']('span',{'class':'ck-suggestion-preview-marker-'+_0x389278});_0x5bea18['writer']['insert'](_0x16f23e,_0x345680),_0x5bea18['mapper']['bindElementToMarker'](_0x345680,_0x3dd766['markerName']);}_0x2b6839||_0x4bc246||!_0xee7465||_0x4ce0c4(_0xee7465);};}var Ft=class extends _0x2158cb{constructor(_0x3743cf){super(_0x3743cf);const _0x3c642a=_0x3743cf['plugins']['get'](Pt);this['affectsData']=!0x1,this['listenTo'](_0x3c642a,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x3c642a,'change:isEnabled',()=>this['refresh']());}execute(){const _0x321535=this['editor'],_0xaf0b80=_0x321535['plugins']['get'](Pt),_0x41850a=_0xaf0b80['isReady']?_0xaf0b80['diff']['newRevisionId']:null;_0x321535['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x41850a);}['refresh'](){const {isReady:_0x5480f9,isEnabled:_0x3dce5b,repository:_0x1402a3,diff:_0x2428f4}=this['editor']['plugins']['get'](Pt),_0xd6e26c=_0x2428f4&&_0x1402a3['getLaterVisibleRevision'](_0x2428f4['newRevisionId']);this['isEnabled']=_0x5480f9&&_0x3dce5b&&Boolean(_0xd6e26c);}},$t=class extends _0x2158cb{_step;constructor(_0x59515a,{direction:_0x341f1a}){super(_0x59515a);const _0x574122=_0x59515a['plugins']['get'](Pt);this['affectsData']=!0x1,this['_step']='forward'===_0x341f1a?0x1:-0x1,this['listenTo'](_0x574122,'change:isReady',()=>this['refresh']()),this['listenTo'](_0x574122,'change:isEnabled',()=>this['refresh']()),this['listenTo'](_0x574122,'change:activeChange',()=>this['refresh']());}execute(){const _0x37e0b1=this['editor'],_0x114a29=_0x37e0b1['plugins']['get'](Pt),{isNavigationMode:_0x54b147,currentChangeNumber:_0xeb2a4b}=_0x114a29;let _0x5c6e9e;if(_0x114a29['activeChange']=_0x54b147?_0x114a29['diff']['changes']['get'](_0xeb2a4b+this['_step']):_0x114a29['diff']['changes']['first'],_0x114a29['activeChange']['data']['isOnRoot'])_0x5c6e9e=_0x37e0b1['editing']['view']['getDomRoot'](_0x114a29['activeChange']['rootName']);else{const _0x2bbc19=_0x37e0b1['model']['markers']['get']('revision:'+_0x114a29['activeChange']['id']);_0x5c6e9e=_0x4df91e(_0x37e0b1['editing'],_0x2bbc19);}_0x60056({'target':_0x5c6e9e,'viewportOffset':0x28});}['refresh'](){const {isNavigationMode:_0x348efb,currentChangeNumber:_0x4a9d91,numberOfChanges:_0x50c112,isReady:_0x1b8305,isEnabled:_0xa777da}=this['editor']['plugins']['get'](Pt);this['isEnabled']=!!(_0xa777da&&_0x1b8305&&_0x50c112)&&(!_0x348efb||(0x1===this['_step']?_0x4a9d91<_0x50c112-0x1:_0x4a9d91>0x0));}},Bt=class extends dt{constructor(_0x1d4c33){super(_0x1d4c33);const _0xed2dd2=this['bindTemplate'],_0x52adab=new _0xefa108(_0x1d4c33),_0x1ec8de=new _0xefa108(_0x1d4c33);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',(_0x2bef3d,_0x5705ff)=>_0x2bef3d&&_0x5705ff>0x0),this['bind']('_statusText')['to'](this,'isReady',this,'currentChangeNumber',this,'numberOfChanges',this,'isNavigationMode',(_0x3f85cb,_0x1f5166,_0x3f022e,_0x33e21b)=>{if(!_0x3f85cb)return kt(_0x1d4c33,'Loading...');if(!_0x3f022e)return kt(_0x1d4c33,'No\x20changes');const _0xd037de=kt(_0x1d4c33,'NUMBER_OF_CHANGES',_0x3f022e);return _0x33e21b?kt(_0x1d4c33,'X_OF_Y_CHANGES',[_0x1f5166+0x1,_0x3f022e]):_0xd037de;}),_0x52adab['set']({'label':kt(_0x1d4c33,'Show\x20previous\x20change'),'tooltip':!0x0,'icon':_0x194704}),_0x1ec8de['set']({'label':kt(_0x1d4c33,'Show\x20next\x20change'),'tooltip':!0x0,'icon':_0x4c5074}),_0x52adab['bind']('isEnabled')['to'](this,'isBackwardNavigationEnabled'),_0x1ec8de['bind']('isEnabled')['to'](this,'isForwardNavigationEnabled'),_0x52adab['on']('execute',()=>this['fire']('execute','backward')),_0x1ec8de['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',_0xed2dd2['if']('_isStatusLabelVisible','ck-hidden',_0x34d529=>!_0x34d529)]},'children':[{'text':_0xed2dd2['to']('isNavigationMode',_0x50f4ed=>_0x50f4ed?kt(_0x1d4c33,'EDIT_X_OF_Y_REVISIONS')+':\x20':kt(_0x1d4c33,'Total')+':\x20')}]},{'text':_0xed2dd2['to']('_statusText')}]},new ct(),{'tag':'div','attributes':{'class':['ck-revision-history-ui__changes-navigation__navigation']},'children':[_0x52adab,_0x1ec8de]}]});}};const jt='ck-editor__editable__loading-overlay';var Gt=class extends _0x544bf8{static get['pluginName'](){return'RevisionViewerLoadingOverlay';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['show'](){const _0x1210f9=this['editor']['editing']['view'];_0x1210f9['change'](_0x25147e=>{for(const _0x36fcd1 of _0x1210f9['document']['roots'])_0x25147e['addClass'](jt,_0x36fcd1);});}['hide'](){const _0x3d806d=this['editor']['editing']['view'];_0x3d806d['change'](_0x216df6=>{for(const _0x11da95 of _0x3d806d['document']['roots'])_0x216df6['removeClass'](jt,_0x11da95);});}},Kt=class extends _0x544bf8{static get['pluginName'](){return'RevisionViewerUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt,Gt];}init(){const _0x4e65b1=this['editor'],_0x3c464c=_0x4e65b1['plugins']['get'](Pt),_0x5163c9=_0x4e65b1['plugins']['get'](Gt);_0x4e65b1['ui']['componentFactory']['add']('exitToEditing',_0x5da2bf=>{const _0x4025db=new _0xefa108(_0x5da2bf);return _0x4025db['set']({'label':kt(_0x5da2bf,'Back\x20to\x20editing'),'icon':_0x53c7c8,'withText':!0x0,'tooltip':!0x0,'class':'ck-revision-history-ui__back-to-editing'}),this['listenTo'](_0x4025db,'execute',()=>{_0x4e65b1['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}),_0x4025db;}),_0x4e65b1['ui']['componentFactory']['add']('restoreRevision',_0x4b1bb5=>{const _0x293cf8=new _0xefa108(_0x4b1bb5);return _0x293cf8['set']({'label':kt(_0x4b1bb5,'Restore\x20this\x20revision'),'withText':!0x0,'tooltip':!0x0}),_0x293cf8['bind']('isEnabled')['to'](_0x4e65b1['commands']['get']('restoreRevision')),this['listenTo'](_0x293cf8,'execute',()=>_0x4e65b1['execute']('restoreRevision')),_0x293cf8;}),_0x4e65b1['ui']['componentFactory']['add']('changesNavigation',_0x58b204=>{const _0x2bfd9e=new Bt(_0x58b204),_0xdf8566=_0x4e65b1['commands']['get']('showPreviousChange'),_0x39b0df=_0x4e65b1['commands']['get']('showNextChange');return _0x2bfd9e['bind']('isBackwardNavigationEnabled')['to'](_0xdf8566,'isEnabled'),_0x2bfd9e['bind']('isForwardNavigationEnabled')['to'](_0x39b0df,'isEnabled'),_0x2bfd9e['bind']('isReady','currentChangeNumber','numberOfChanges','isNavigationMode')['to'](_0x3c464c),this['listenTo'](_0x2bfd9e,'execute',(_0xc3b977,_0x1fd178)=>{_0x4e65b1['execute']('forward'===_0x1fd178?'showNextChange':'showPreviousChange');}),_0x2bfd9e;}),_0x5163c9['show'](),_0x3c464c['on']('change:isReady',(_0x2c7b1c,_0x3acef7,_0x5f5abe)=>{_0x5f5abe?_0x5163c9['hide']():_0x5163c9['show']();});}},qt=class extends it{['_resizeObserver']=null;constructor(_0x3f1a59,_0x5d9ebb){super(_0x3f1a59,_0x5d9ebb);const _0x3bcd4a=this['bindTemplate'];this['set']({'label':kt(_0x3f1a59,'Revision\x20name'),'_tooltipString':''}),this['fieldView']['placeholder']=kt(_0x3f1a59,'Enter\x20the\x20revision\x20name'),this['extendTemplate']({'tag':'span','attributes':{'class':['ck-revision-history-sidebar__revision-name'],'data-cke-tooltip-text':_0x3bcd4a['to']('_tooltipString'),'data-cke-tooltip-position':'s','data-cke-tooltip-class':'ck-tooltip_multi-line'}});}['render'](){super['render'](),this['_resizeObserver']=new _0x5c360a(this['fieldView']['element'],()=>this['_updateTooltipText']()),this['listenTo'](this['fieldView'],'input',()=>this['_updateTooltipText']());}destroy(){super['destroy'](),this['_resizeObserver']&&this['_resizeObserver']['destroy']();}_updateTooltipText(){const _0x21ec22=this['fieldView']['element'];this['_tooltipString']=_0x21ec22['scrollWidth']>_0x21ec22['clientWidth']&&_0x21ec22['value']||'';}},Yt=class extends dt{constructor(_0x2a20bf,_0x555a24,_0x5d5f8f){super(_0x2a20bf);const _0x4ba438=new _0x1d6039();_0x4ba438['set']({'content':_0x5a8ed6,'viewBox':'0\x200\x2011\x2010'});const _0xe27e6a=['ck','ck-revision-history-sidebar__revision-author'];_0x5d5f8f&&_0xe27e6a['push']('ck-revision-history-sidebar__revision-author_creator');const _0x192dd5=[{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__revision-author__name'],'title':kt(_0x2a20bf,_0x5d5f8f?'Revision\x20creator':'Revision\x20author')},'children':[_0x4ba438,_0x555a24['name']]}];this['setTemplate']({'tag':'li','attributes':{'class':_0xe27e6a},'children':_0x192dd5});}};function Jt(_0x206e90,_0x32288e){const _0x1d4376=_0x206e90['bindTemplate'],_0x4eb3da=_0x206e90['locale'],_0x477c7e=vt(_0x4eb3da);_0x477c7e['panelPosition']='sw';const _0x5a5509=function(_0x5df6aa,_0x2d1981){const _0x21cbfd=function(_0x2f984a,_0x17354e){const _0x4c0c30=_0x2f984a['locale'],_0x20d852={'Compare\x20against\x20selected':kt(_0x4c0c30,'Compare\x20against\x20selected'),'Name\x20this\x20revision':kt(_0x4c0c30,'Name\x20this\x20revision'),'Restore\x20this\x20revision':kt(_0x4c0c30,'Restore\x20this\x20revision')};return _0x17354e['map'](_0x128a3d=>{const _0xac4d76=_0x20d852[_0x128a3d['name']];return _0xac4d76&&_0xac4d76!==_0x128a3d['name']&&(_0x128a3d['name']=_0xac4d76),_0x128a3d;});}(_0x5df6aa,_0x2d1981),_0xab6a8=new _0x32a4f2();for(const _0x41538f of _0x21cbfd){const _0x58cfca={'type':'button','model':new ut({'label':_0x41538f['name'],'class':_0x41538f['class'],'withText':!0x0,'role':'menuitem','_action':_0x41538f['action']})};_0x58cfca['model']['bind']('isEnabled')['to'](_0x5df6aa,'isActionsDropdownOpen',_0x5dcc21=>'function'!=typeof _0x41538f['isEnabled']||(!_0x5dcc21||_0x41538f['isEnabled'](_0x5df6aa))),_0xab6a8['add'](_0x58cfca);}return _0xab6a8;}(_0x206e90,_0x32288e);return _0x206e90['bind']('isActionsDropdownOpen')['to'](_0x477c7e,'isOpen'),_0x477c7e['buttonView']['set']({'label':kt(_0x4eb3da,'Show\x20more\x20items'),'tooltip':!0x0,'tooltipPosition':'sw','icon':_0x500df1}),_0x477c7e['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision__actions',_0x1d4376['if']('isActionsDropdownOpen','ck-on')]},'on':{'click':_0x1d4376['to'](_0x3f1f82=>_0x3f1f82['stopPropagation']())}}),_0x477c7e['on']('execute',_0x475702=>{_0x206e90['isReady']&&'function'==typeof _0x475702['source']['_action']&&_0x475702['source']['_action'](_0x206e90);}),ft(_0x477c7e,_0x5a5509,{'role':'menu'}),_0x477c7e['listenTo'](_0x206e90,'change:isActionsDropdownOpen',(_0x234a6b,_0x2e082b,_0x3c0604)=>{if(_0x3c0604)for(const _0x1664fa of _0x477c7e['listView']['items']){const _0x46c746=_0x1664fa['children']['first'],_0x22ccfa=_0x32288e['find'](_0xeb72b8=>_0xeb72b8['action']===_0x46c746['_action'])['isVisible'];_0x1664fa['isVisible']=void 0x0===_0x22ccfa||_0x22ccfa(_0x206e90);}}),_0x477c7e;}const Wt=/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x3e5ba7(dt);var Xt=class extends Wt{['id'];['revisionNameView'];revisionActionsView;['_revision'];_requireRevisionName;['_aiPillView'];constructor(_0x315a6f,_0x19a2fa,_0x2e9800,_0x4b13cc,_0x917632=!0x1){super(_0x315a6f);const _0x45bb89=this['bindTemplate'],_0x2b394a=function(_0x12d98e,_0x3fb935){const _0x408b48=Array['from'](_0x3fb935['authors'])['filter'](_0x36763c=>_0x36763c!=_0x3fb935['creator']);return _0x3fb935['creator']&&_0x408b48['unshift'](_0x3fb935['creator']),_0x408b48['map'](_0x545f7c=>new Yt(_0x12d98e,_0x545f7c,_0x545f7c==_0x3fb935['creator']));}(_0x315a6f,_0x19a2fa);this['id']=_0x19a2fa['id'],this['_revision']=_0x19a2fa,this['_requireRevisionName']=_0x4b13cc,this['bind']('_isAiGenerated')['to'](_0x19a2fa,'attributes',_0x2354a1=>!(!_0x2354a1||!_0x2354a1['@ai'])),this['bind']('name','createdAt')['to'](_0x19a2fa),this['bind']('_createdAtFormatted')['to'](this,'createdAt',_0x7b483a=>{return _0x47003b=_0x315a6f['uiLanguage'],(_0x3f79e5=_0x7b483a)['toLocaleDateString'](_0x47003b,{'month':'long','day':'numeric'})+',\x20'+_0x3f79e5['toLocaleTimeString'](_0x47003b,{'hour':'numeric','minute':'numeric'});var _0x47003b,_0x3f79e5;}),this['set']('isSelected',!0x1),this['set']('isHighlighted',!0x1),this['set']('isActionsDropdownOpen',!0x1),this['set']('isReady',!0x1),this['set']('isEnabled',!0x1),this['revisionNameView']=new qt(_0x315a6f,gt),this['revisionNameView']['fieldView']['extendTemplate']({'attributes':{'maxlength':'220'}}),this['revisionNameView']['fieldView']['bind']('value')['to'](this,'name',_0x254da5=>_0x254da5||this['_createdAtFormatted']),this['revisionNameView']['bind']('isEnabled')['to'](this,'isSelected',this,'isEnabled',(_0x1e7ccf,_0x22a166)=>_0x1e7ccf&&_0x22a166),this['revisionActionsView']=_0x2e9800&&_0x2e9800['length']?Jt(this,_0x2e9800):'',this['revisionActionsView']&&this['revisionActionsView']['bind']('isEnabled')['to'](this),this['_aiPillView']=_0x917632?this['_createAiPillView'](_0x315a6f):null,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision-wrapper',_0x45bb89['if']('isConfirm','ck-revision-history-sidebar__revision-wrapper_confirmation_visible')]},'children':[{'tag':'div','attributes':{'class':['ck','ck-reset','ck-revision-history-sidebar__revision',_0x45bb89['if']('isEnabled','ck-disabled',_0x298498=>!_0x298498),_0x45bb89['if']('isSelected','ck-revision-history-sidebar__revision_selected'),_0x45bb89['if']('isHighlighted','ck-revision-history-sidebar__revision_highlighted'),_0x45bb89['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':_0x45bb89['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':_0x2b394a}]},..._0x917632?[{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__revision-ai-pill-row',_0x45bb89['if']('_isAiGenerated','ck-hidden',_0x38a8a4=>!_0x38a8a4)]},'children':[this['_aiPillView']]}]:[],this['revisionActionsView']],'on':{'click':_0x45bb89['to'](_0x3a52a2=>{_0x3a52a2['srcElement']['closest']('.ck-confirm-view')||this['isReady']&&this['isEnabled']&&this['fire']('select',{'id':this['id']});})}}]});}_createAiPillView(_0x33f862){const _0x1bbd29=new _0x30468e(_0x33f862);return _0x1bbd29['set']({'icon':_0x237d30,'label':kt(_0x33f862,'REVISION_AI_SOURCE_PILL_LABEL'),'tooltip':kt(_0x33f862,'AI_SOURCE_REVISION_TOOLTIP'),'tooltipPosition':'s','size':'small','class':'ck-pill_ai'}),_0x1bbd29['extendTemplate']({'attributes':{'class':['ck-revision-history-sidebar__revision-ai-pill']}}),_0x1bbd29;}['render'](){super['render']();const _0x45d69d=this['revisionNameView']['fieldView']['element'];this['listenTo'](_0x45d69d,'change',()=>{this['_requireRevisionName']&&!_0x45d69d['value']||this['fire']('setName',{'id':this['id'],'name':_0x45d69d['value']}),_0x45d69d['value']||(_0x45d69d['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(_0x49cb1d,_0x42a145){const _0x197459=wt['fromJSDate'](_0x49cb1d)['setLocale'](_0x42a145),_0x46705f=wt['local'](),_0x1de78c=_0x46705f['minus']({'days':0x1})['startOf']('day');let _0x470ad7,_0x3f3ef3;return _0x197459['hasSame'](_0x46705f,'day')?(_0x470ad7=_0x197459['startOf']('day')['toJSDate'](),_0x3f3ef3=_0x197459['toRelativeCalendar']()):_0x197459['hasSame'](_0x1de78c,'day')?(_0x470ad7=_0x1de78c['toJSDate'](),_0x3f3ef3=_0x197459['toRelativeCalendar']()):_0x197459['hasSame'](_0x46705f,'week')?(_0x470ad7=_0x197459['startOf']('week')['toJSDate'](),_0x3f3ef3=_0x197459['weekdayLong']||''):_0x197459['hasSame'](_0x46705f,'year')?(_0x470ad7=_0x197459['startOf']('month')['toJSDate'](),_0x3f3ef3=_0x197459['monthLong']||''):(_0x470ad7=_0x197459['startOf']('year')['toJSDate'](),_0x3f3ef3=String(_0x197459['year'])),{'startDate':_0x470ad7,'localizedPeriodName':_0x3f3ef3};}var zt=class extends dt{startDate;['revisionViews'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x28ec24,_0x146d87,_0x2196cb,_0x51949a,_0x241022){super(_0x28ec24);const _0x2504be=Qt(_0x146d87,this['locale']['uiLanguage'])['localizedPeriodName'];this['startDate']=_0x146d87,this['revisionViews']=this['createCollection'](),this['_revisionActions']=_0x2196cb,this['_requireRevisionName']=_0x51949a,this['_showAISource']=_0x241022,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':_0x2504be}]},{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__time-period__revisions']},'children':this['revisionViews']}]});}['addRevision'](_0x23a897){const _0x35f601=new Xt(this['locale'],_0x23a897,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']);this['revisionViews']['add'](_0x35f601);}['removeRevision'](_0x838e8f){const _0x3fb4a3=this['revisionViews']['find'](_0x1595b4=>_0x1595b4['id']===_0x838e8f['id']);this['revisionViews']['remove'](_0x3fb4a3);}},Zt=class extends dt{constructor(_0x2ccf2d){super(_0x2ccf2d);const _0x437da6=new _0x1d6039();_0x437da6['content']=_0x1cebb3,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-revision-history-sidebar__header']},'children':[_0x437da6,{'tag':'span','attributes':{'class':['ck','ck-revision-history-sidebar__header__label']},'children':[kt(_0x2ccf2d,'Revision\x20history')]}]});}},ti=class extends dt{timePeriodViews;['_revisions'];_revisionActions;_requireRevisionName;['_showAISource'];constructor(_0x4df72d,_0x27bc47,_0x54e93e,_0x589d37,_0x4dd2ed){super(_0x4df72d);const _0x3b04c4=this['bindTemplate'];this['timePeriodViews']=this['createCollection'](),this['timePeriodViews']['delegate']('select')['to'](this),this['timePeriodViews']['delegate']('setName')['to'](this),this['_revisions']=_0x27bc47,this['_revisionActions']=_0x54e93e,this['_requireRevisionName']=_0x589d37,this['_showAISource']=_0x4dd2ed,this['on']('select',(_0x37db6a,_0x4d5933)=>{this['fire']('revisionSelected',_0x4d5933);}),this['on']('setName',(_0x499bbf,_0x50938f)=>{this['fire']('revisionSetName',_0x50938f);}),this['set']('isEnabled',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-rounded-corners','ck-revision-history-sidebar']},'children':[new Zt(_0x4df72d),{'tag':'div','attributes':{'class':['ck','ck-revision-history-sidebar__timeline',_0x3b04c4['if']('isEnabled','ck-disabled',_0x152b22=>!_0x152b22)]},'children':this['timePeriodViews']}]});}['render'](){super['render']();for(const _0xf9fcad of this['_revisions'])this['_addRevision'](_0xf9fcad);this['_revisions']['on']('add',(_0x2496e6,_0x3cc51a)=>{this['_addRevision'](_0x3cc51a);}),this['_revisions']['on']('remove',(_0x45aefc,_0x170a4a)=>{this['_removeRevision'](_0x170a4a);});}get['revisionViews'](){return this['timePeriodViews']['map'](_0x24ec5a=>_0x24ec5a['revisionViews']['map'](_0x4caaef=>_0x4caaef))['flat']();}selectRevision(_0x15c953){for(const _0x2a0b4f of this['revisionViews'])_0x15c953&&_0x15c953['id']===_0x2a0b4f['id']?_0x2a0b4f['select']():_0x2a0b4f['deselect']();}highlightRevisions(_0x426042){for(const _0x1add07 of this['revisionViews'])_0x426042['some'](({id:_0x59c59a})=>_0x59c59a===_0x1add07['id'])?_0x1add07['highlight']():_0x1add07['unhighlight']();}['_addRevision'](_0x3bcb20){const _0x2865a6=Qt(_0x3bcb20['createdAt'],this['locale']['uiLanguage'])['startDate'];let _0x26a441=this['_getTimePeriodViewByStartDate'](_0x2865a6);_0x26a441||(_0x26a441=new zt(this['locale'],_0x2865a6,this['_revisionActions'],this['_requireRevisionName'],this['_showAISource']),this['timePeriodViews']['add'](_0x26a441)),_0x26a441['addRevision'](_0x3bcb20);}['_removeRevision'](_0x21cc4a){const _0x1e510f=Qt(_0x21cc4a['createdAt'],this['locale']['uiLanguage'])['startDate'];this['_getTimePeriodViewByStartDate'](_0x1e510f)['removeRevision'](_0x21cc4a);}_getTimePeriodViewByStartDate(_0x47fbfa){return this['timePeriodViews']['find'](_0x115cb9=>_0x115cb9['startDate']['getTime']()===_0x47fbfa['getTime']());}},ii=class RevisionsSidebar extends _0x544bf8{['_revisionViewer'];_revisionsRepository;['_sidebarView'];static defaultRevisionActions=/* #__PURE__ -- @preserve */
|
|
28
28
|
((()=>['compareAgainstSelected','restoreRevision','nameRevision'])());static availableRevisionActions=/* #__PURE__ -- @preserve */
|
|
29
|
-
ei();static get['pluginName'](){return'RevisionsSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt];}constructor(
|
|
30
|
-
_0x4c30f1(_0x3a29f8);var ri=class extends oi{['_ui'];get['ui'](){return this['_ui'];}constructor(_0x16c097,_0x48771c){super(_0x48771c),this['sourceElement']=_0x16c097,this['model']['document']['createRoot']();const _0x228d92=new ni(this['locale'],this['editing']['view'],{'shouldToolbarGroupWhenFull':!0x0});this['_ui']=new si(this,_0x228d92);}destroy(){return this['updateSourceElement'](),this['ui']['destroy'](),super['destroy']();}static async create(_0x48ef14,_0x363dc7){const _0x19d298=new this(_0x48ef14,_0x363dc7);return await _0x19d298['initPlugins'](),await _0x19d298['ui']['init'](_0x48ef14),await _0x19d298['data']['init'](_0x19d298['config']['get']('initialData')||''),_0x19d298['fire']('ready'),_0x19d298;}};const ai=['RevisionHistoryUI','RestrictedEditingMode'];var hi=class extends _0x3ccb16{result;static get['pluginName'](){return'RevisionViewerIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4f842d){super(_0x4f842d),this['result']='end',_0x4f842d['editing']['view']['_overlayModeHint']='auto',_0x4f842d['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}},ci=class extends _0x3ccb16{_viewerEditor;static get['pluginName'](){return'RevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At,Dt];}constructor(_0xcb1678){if(super(_0xcb1678),!this['editor']['config']['get']('revisionHistory'))throw new _0x24e679('revision-history-missing-configuration',this);this['_viewerEditor']=null,this['set']('isRevisionViewerOpen',!0x1),this['editor']['config']['define']('revisionHistory.showRevisionViewerCallback',_0x36050d=>this['_showRevisionViewer']({..._0x36050d,'translations':this['editor']['locale']['translations']})),this['editor']['config']['define']('revisionHistory.closeRevisionViewerCallback',_0x34ccca=>this['_closeRevisionViewer'](_0x34ccca)),this['editor']['config']['define']('revisionHistory.restoreRevisionCallback',_0x3852dd=>this['_restoreRevision'](_0x3852dd)),this['editor']['config']['define']('revisionHistory.requireRevisionName',!0x1),this['editor']['config']['define']('revisionHistory.showCommentHighlights',!0x1),this['_enhanceShowRevisionViewerCallback'](),this['_enhanceCloseRevisionViewerCallback']();}set adapter(_0x501aa4){this['editor']['plugins']['get']('RevisionTracker')['adapter']=_0x501aa4;}get adapter(){return this['editor']['plugins']['get']('RevisionTracker')['adapter'];}addRevisionData(_0xeb7e72){return this['editor']['plugins']['get']('RevisionTracker')['addRevisionData'](_0xeb7e72);}getRevision(_0x51e869){return this['editor']['plugins']['get']('RevisionsRepository')['getRevision'](_0x51e869);}getRevisions(_0x5a36a6){return this['editor']['plugins']['get']('RevisionsRepository')['getRevisions'](_0x5a36a6||{'toJSON':!0x1});}_getRevisionViewerEditorConfig(){const _0x11e8d6=this['editor'],_0x50efee=_0x1d9224(_0x11e8d6,ai),_0x1affb0=_0x11e8d6['plugins']['get']('RevisionTracker'),_0x208337=_0x11e8d6['plugins']['get'](_0x312567)['users'];return _0x50efee['toolbar']=['exitToEditing','restoreRevision','changesNavigation'],delete _0x50efee['lazyRoots'],(_0x50efee['plugins']['push'](hi,Pt,Kt,class RevisionViewerInit extends _0x3ccb16{static get requires(){return[Pt,_0x312567];}init(){const _0x7c2282=this['editor']['plugins']['get'](_0x312567);for(const _0x270442 of _0x208337)_0x270442['isAnonymous']||_0x7c2282['getUser'](_0x270442['id'])||_0x7c2282['addUser'](_0x270442);const _0x5caa6d=_0x1affb0['repository']['getRevisions']();let _0x3d6209=null;const _0x26e74f=this['editor']['plugins']['get']('RevisionViewer');if(_0x26e74f['adapter']=_0x1affb0['adapter'],_0x26e74f['bind']('isEnabled')['to'](_0x1affb0),_0x11e8d6['plugins']['has']('CommentsRepository')){const _0x139c31=_0x11e8d6['plugins']['get']('CommentsRepository');_0x26e74f['_getVisibleCommentThreadIds']=()=>new Set(_0x139c31['getCommentThreads']()['filter'](_0x8afde2=>!_0x8afde2['isResolved'])['map'](_0x1fd5aa=>_0x1fd5aa['id']));}this['editor']['commands']['get']('restoreRevision')['bind']('isEnabled')['to'](_0x11e8d6,'isReadOnly',_0x93d2de=>!_0x93d2de);for(const _0x1c6577 of _0x5caa6d){const _0x60e1df=null===_0x1c6577['creator'];if(_0x60e1df&&_0x1c6577['toVersion']===_0x1c6577['fromVersion'])continue;const _0x5c0057=_0x1c6577['toJSON']();_0x26e74f['addRevisionData'](_0x5c0057,(_0x5c15a2,_0x4d65fd,_0x3fff0a)=>{if(_0x60e1df){if(_0x3d6209)_0x3d6209['_update'](_0x5c15a2,_0x4d65fd);else{if(!_0x4d65fd){const _0x1ce953=_0x3fff0a['toJSON']();_0x1ce953['id']=_0x5289a7(),_0x1affb0['saveRevision'](_0x1ce953,_0x3fff0a['toVersion'])['then'](_0x16fa81=>{_0x3d6209=_0x16fa81;});}}}else _0x1c6577['_update'](_0x5c15a2,_0x4d65fd);});}}},ii),_0x50efee);}['_enhanceShowRevisionViewerCallback'](){const _0x3420a8=this['editor']['config']['get']('revisionHistory')['showRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.showRevisionViewerCallback',async()=>{this['editor']['enableReadOnlyMode']('revision-history-viewer-opened');const _0x4bec2a=this['editor']['plugins']['get']('RevisionTracker');if(this['editor']['plugins']['has']('Autosave')?await this['editor']['plugins']['get']('Autosave')['save']():await _0x4bec2a['update'](),this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('Dialog')){const _0x26da66=this['editor']['plugins']['get']('Dialog');_0x26da66['isOpen']&&_0x26da66['hide']();}if(this['editor']['plugins']['has']('AITabs')){const _0xcdfe39=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x3e7208 of _0xcdfe39)_0x3e7208['class']=_0x3e7208['class']?_0x3e7208['class']+'\x20ck-tab-panel_disabled':'ck-tab-panel_disabled';if(this['editor']['plugins']['has']('AIChat')){const _0x29f3b9=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x29f3b9&&_0x29f3b9['setAttribute']('tabindex','-1');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x3301a5=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x3301a5&&_0x3301a5['setAttribute']('tabindex','-1');}}const _0x195849=this['_getRevisionViewerEditorConfig']();return _0x3420a8(_0x195849)['then'](_0x1015db=>(this['_viewerEditor']=_0x1015db,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'),_0x1015db))['catch'](_0x385bc7=>(console['error'](_0x385bc7),this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x5256fa=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 _0x359149=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x526aa1 of _0x359149)_0x526aa1['class']='ck-tab-panel_disabled'===_0x526aa1['class']?'':_0x526aa1['class']['replace']('\x20ck-tab-panel_disabled','');if(this['editor']['plugins']['has']('AIChat')){const _0x34ff4d=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x34ff4d&&_0x34ff4d['removeAttribute']('tabindex');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x1a0a48=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x1a0a48&&_0x1a0a48['removeAttribute']('tabindex');}}return this['_viewerEditor']['plugins']['get']('RevisionViewer')['_cleanUp'](),_0x5256fa(this['_viewerEditor'])['then'](()=>{if(this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),this['_viewerEditor']=null,this['editor']['plugins']['has']('Annotations')){const _0x4a1b76=this['editor']['plugins']['get']('Annotations');_0x4a1b76['refreshVisibility'](),_0x4a1b76['refreshPositioning']();}});});}['_showRevisionViewer'](_0x3a03e8){const _0x3b8389=this['editor']['config']['get']('revisionHistory.editorContainer'),_0x3426fb=this['editor']['config']['get']('revisionHistory.viewerContainer'),_0x19da3e=this['editor']['config']['get']('revisionHistory.viewerEditorElement');return ri['create'](_0x19da3e,_0x3a03e8)['then'](_0x204ef3=>(_0x3426fb['style']['display']='block',_0x3b8389['style']['display']='none',this['isRevisionViewerOpen']=!0x0,_0x204ef3));}['_closeRevisionViewer'](_0x571df8){const _0x54664b=this['editor']['config']['get']('revisionHistory.editorContainer');return this['editor']['config']['get']('revisionHistory.viewerContainer')['style']['display']='none',_0x54664b['style']['display']='',this['isRevisionViewerOpen']=!0x1,_0x571df8['destroy']();}async _restoreRevision(_0x75776f){const _0x6470d7=this['editor'],_0x38d488=this['_viewerEditor']['plugins']['get']('RevisionViewer'),_0x2a448c=_0x6470d7['plugins']['get']('RevisionTracker'),_0x534141=_0x6470d7['plugins']['get']('RevisionHistoryUtils'),_0x4c3549=_0x38d488['repository']['getRevision'](_0x75776f);let _0x283d44,_0x30e38d,_0x2bd41e;try{await _0x534141['loadRevisionData'](_0x4c3549,this['adapter']),_0x283d44=_0x534141['getRevisionDocumentData'](_0x4c3549),_0x30e38d=_0x534141['getRevisionRootsAttributes'](_0x4c3549);}catch(_0x298811){return void console['error'](_0x298811);}_0x6470d7['model']['change'](_0x2b4b9d=>{for(const _0x48a31e of Array['from'](_0x6470d7['model']['markers']['getMarkersGroup']('restrictedEditingException')))_0x2b4b9d['removeMarker'](_0x48a31e);}),_0x38d488['isReady']=!0x1,_0x6470d7['model']['enqueueChange'](_0x49cf49=>{_0x49cf49['setSelection'](null),_0x49cf49['removeSelectionAttribute'](_0x6470d7['model']['document']['selection']['getAttributeKeys']());const _0x169d64=Object['keys'](_0x283d44);for(const _0x4991b1 of _0x6470d7['model']['document']['roots'])'$graveyard'!=_0x4991b1['rootName']&&_0x4991b1['isAttached']()&&!_0x169d64['includes'](_0x4991b1['rootName'])&&_0x49cf49['detachRoot'](_0x4991b1);for(const _0x46aad4 of _0x169d64){let _0x148e2f=_0x6470d7['model']['document']['getRoot'](_0x46aad4);if(!_0x148e2f||!_0x148e2f['isAttached']()){const _0x408359=_0x4c3549['diffData']?.[_0x46aad4]?.['rootElementName']||'$root';_0x148e2f=_0x49cf49['addRoot'](_0x46aad4,_0x408359);}const _0x3ec03b=_0x30e38d[_0x46aad4],_0x2380ac=Object['keys'](_0x3ec03b),_0x404a51=_0x283d44[_0x46aad4];for(const _0x1106aa of _0x148e2f['getAttributeKeys']())_0x2380ac['includes'](_0x1106aa)||_0x49cf49['removeAttribute'](_0x1106aa,_0x148e2f);for(const _0x27abf8 of _0x2380ac)_0x49cf49['setAttribute'](_0x27abf8,_0x30e38d[_0x46aad4][_0x27abf8],_0x148e2f);_0x49cf49['remove'](_0x49cf49['createRangeIn'](_0x148e2f)),_0x49cf49['insert'](_0x6470d7['data']['parse'](_0x404a51,_0x148e2f),_0x148e2f,0x0);}});const _0x58611a=kt(_0x6470d7['locale'],'Restored');if(_0x4c3549['name'])_0x2bd41e=-0x1==_0x4c3549['name']['indexOf'](_0x58611a)?_0x58611a+':\x20'+_0x4c3549['name']:_0x4c3549['name'];else _0x2bd41e=_0x58611a+':\x20'+(_0x4c3549['createdAt']['toLocaleDateString'](_0x6470d7['locale']['uiLanguage'],{'month':'long','day':'numeric'})+',\x20'+_0x4c3549['createdAt']['toLocaleTimeString'](_0x6470d7['locale']['uiLanguage'],{'hour':'numeric','minute':'numeric'}));return await _0x2a448c['saveRevision']({'name':_0x2bd41e}),_0x38d488['isReady']=!0x0,_0x6470d7['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}};export{Ft as RestoreRevisionCommand,yt as Revision,ci as RevisionHistory,Dt as RevisionHistoryUI,Rt as RevisionHistoryUtils,At as RevisionTracker,Pt as RevisionViewer,ri as RevisionViewerEditor,hi as RevisionViewerIntegration,Gt as RevisionViewerLoadingOverlay,Kt as RevisionViewerUI,bt as RevisionsRepository,ii as RevisionsSidebar,$t as ShowChangeCommand};
|
|
29
|
+
ei();static get['pluginName'](){return'RevisionsSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Pt];}constructor(_0xa45d7f){super(_0xa45d7f),this['_revisionViewer']=_0xa45d7f['plugins']['get'](Pt),this['_revisionsRepository']=this['_revisionViewer']['repository'],this['_sidebarView']=null;}init(){const _0x175d4d=this['_revisionsRepository']['_revisions'],_0xd9c64f=this['_createRevisionActions'](),_0x5c4383=this['editor']['config']['get']('revisionHistory.viewerSidebarContainer');this['_sidebarView']=new ti(this['editor']['locale'],_0x175d4d,_0xd9c64f,this['editor']['config']['get']('revisionHistory.requireRevisionName'),'pill'===this['editor']['config']['get']('revisionHistory.showAISource')),this['_sidebarView']['on']('revisionSelected',this['_handleRevisionSelected']['bind'](this)),this['_sidebarView']['on']('revisionSetName',this['_handleRevisionSetName']['bind'](this)),this['_sidebarView']['bind']('isEnabled')['to'](this['_revisionViewer']),this['_sidebarView']['timePeriodViews']['on']('add',(_0x23b8fe,_0x27e35d)=>{_0x27e35d['revisionViews']['on']('add',(_0x597d5b,_0x1569dc)=>{_0x1569dc['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)),_0x5c4383['appendChild'](this['_sidebarView']['element']);}destroy(){this['_sidebarView']['element']['remove'](),this['_sidebarView']['destroy']();}_handleEditorDataReady(){const _0x4d1d4e=this['_revisionsRepository']['getRevision'](0x0);if(_0x4d1d4e){const _0x9ae245=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x4d1d4e['id']);this['_revisionViewer']['compare'](_0x4d1d4e,_0x9ae245);}}_handleRevisionSelected(_0x1f3947,_0x18eaa8){const _0x39ddbc=this['_revisionsRepository']['getRevision'](_0x18eaa8['id']),_0x50a902=this['_revisionsRepository']['getEarlierVisibleRevision'](_0x39ddbc['id']);this['_revisionViewer']['compare'](_0x39ddbc,_0x50a902);}_handleRevisionSetName(_0x309aea,_0x761fcb){this['_revisionsRepository']['getRevision'](_0x761fcb['id'])['setName'](_0x761fcb['name']);}['_handleDiffChange'](_0x326e1b,_0x3d15bc,_0x1b7ccd){const _0x51358f=this['_revisionsRepository']['getRevisionsInDiff'](_0x1b7ccd);_0x51358f['length']>0x2?(this['_sidebarView']['highlightRevisions'](_0x51358f),this['_sidebarView']['selectRevision'](null)):(this['_sidebarView']['highlightRevisions']([]),this['_sidebarView']['selectRevision'](_0x51358f[0x0]));}_createRevisionActions(){const _0xc92f4d=this['editor'],_0x50bacf=RevisionsSidebar['availableRevisionActions'],_0x56a40f=_0xc92f4d['config']['get']('revisionHistory.revisionActions')||RevisionsSidebar['defaultRevisionActions'];if(_0x56a40f['length'])return _0x56a40f['map'](_0x4fba6b=>{const _0x4ded90='string'==typeof _0x4fba6b?Object['assign']({},_0x50bacf[_0x4fba6b]):_0x4fba6b;return _0x4ded90['action']=_0x4ded90['action']['bind'](this,_0xc92f4d),_0x4ded90['isVisible']&&(_0x4ded90['isVisible']=_0x4ded90['isVisible']['bind'](this,_0xc92f4d)),_0x4ded90;});}};function ei(){return{'compareAgainstSelected':{'name':'Compare\x20against\x20selected','action':({plugins:_0x57b899},_0x3bcf76)=>{const _0x52b70a=_0x57b899['get'](Pt),_0x12bb80=_0x52b70a['repository'];let _0xdb596c=_0x52b70a['diff']['newRevisionId'],_0x540eeb=_0x3bcf76['id'];_0x12bb80['getIndex'](_0xdb596c)>_0x12bb80['getIndex'](_0x540eeb)&&([_0xdb596c,_0x540eeb]=[_0x540eeb,_0xdb596c]),_0x52b70a['compare'](_0xdb596c,_0x540eeb);},'isVisible':({plugins:_0x2a2014},_0x459fbe)=>{const _0x9eea6b=_0x2a2014['get'](Pt);return!(_0x9eea6b['repository']['getRevisionsInDiff'](_0x9eea6b['diff'])['length']>0x2)&&!_0x459fbe['isSelected'];}},'restoreRevision':{'name':'Restore\x20this\x20revision','action':(_0x19fa75,{id:_0x1b41eb})=>{_0x19fa75['config']['get']('revisionHistory')['restoreRevisionCallback'](_0x1b41eb);},'isVisible':({plugins:_0xd83de2},_0x1582ff)=>!!_0xd83de2['get'](Pt)['repository']['getLaterVisibleRevision'](_0x1582ff['id'])},'nameRevision':{'name':'Name\x20this\x20revision','action':({plugins:_0x507edf},{id:_0x357d42,revisionNameView:_0x4a14e4})=>{const _0x4919c6=_0x507edf['get'](Pt),_0x3ca7bc=_0x4919c6['repository']['getEarlierVisibleRevision'](_0x357d42);_0x4919c6['compare'](_0x357d42,_0x3ca7bc),_0x4a14e4['focus'](),_0x4a14e4['fieldView']['select']();}}};}var si=class extends _0x108803{['_view'];_toolbarConfig;_elementReplacer;get['view'](){return this['_view'];}constructor(_0x4e4a59,_0x485b1b){super(_0x4e4a59),this['_view']=_0x485b1b,this['_toolbarConfig']=mt(_0x4e4a59['config']['get']('toolbar')),this['_elementReplacer']=new _0x19597b();}get element(){return this['view']['element'];}init(_0x478463){const _0x482ab1=this['editor'],_0x2dd587=this['view'],_0x400693=_0x482ab1['editing']['view'],_0x5f1774=_0x2dd587['editable'];_0x5f1774['name']=_0x400693['document']['getRoot']()['rootName'],_0x5f1774['isMainFrameEditingRoot']=!0x0,_0x2dd587['render']();const _0x2a8f03=_0x5f1774['element'];this['setEditableElement'](_0x5f1774['name'],_0x2a8f03),_0x2dd587['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x400693['attachDomRoot'](_0x2a8f03),this['_elementReplacer']['replace'](_0x478463,this['element']),this['_initToolbar'](),this['fire']('ready');}destroy(){super['destroy']();const _0x1bfc38=this['view'],_0x258246=this['editor']['editing']['view'];this['_elementReplacer']['restore'](),_0x258246['detachDomRoot'](_0x1bfc38['editable']['name']),_0x1bfc38['destroy']();}_initToolbar(){const _0x2f62de=this['view'];_0x2f62de['stickyPanel']['bind']('isActive')['to'](this['focusTracker'],'isFocused'),_0x2f62de['stickyPanel']['limiterElement']=_0x2f62de['element'],_0x2f62de['stickyPanel']['bind']('viewportTopOffset')['to'](this,'viewportOffset',({top:_0x1127d8})=>_0x1127d8),_0x2f62de['toolbar']['fillFromConfig'](this['_toolbarConfig'],this['componentFactory']),this['addToolbar'](_0x2f62de['toolbar']);}},ni=class extends _0x121443{_editable;stickyPanel;toolbar;get editable(){return this['_editable'];}constructor(_0x3aa1a2,_0x23fb8a,_0x2343f0={}){super(_0x3aa1a2),this['stickyPanel']=new ht(_0x3aa1a2),this['toolbar']=new lt(_0x3aa1a2,{'shouldGroupWhenFull':_0x2343f0['shouldToolbarGroupWhenFull']}),this['_editable']=new tt(_0x3aa1a2,_0x23fb8a);}['render'](){super['render'](),this['stickyPanel']['content']['add'](this['toolbar']),this['top']['add'](this['stickyPanel']),this['main']['add'](this['editable']);}};const oi=/* #__PURE__ -- @preserve */
|
|
30
|
+
_0x5ed66b(_0x27c387);var ri=class extends oi{['_ui'];get['ui'](){return this['_ui'];}constructor(_0x5ea6c9,_0x1bcf6f){super(_0x1bcf6f),this['sourceElement']=_0x5ea6c9,this['model']['document']['createRoot']();const _0x2a498d=new ni(this['locale'],this['editing']['view'],{'shouldToolbarGroupWhenFull':!0x0});this['_ui']=new si(this,_0x2a498d);}destroy(){return this['updateSourceElement'](),this['ui']['destroy'](),super['destroy']();}static async create(_0x5792cf,_0x1cec9f){const _0x285610=new this(_0x5792cf,_0x1cec9f);return await _0x285610['initPlugins'](),await _0x285610['ui']['init'](_0x5792cf),await _0x285610['data']['init'](_0x285610['config']['get']('initialData')||''),_0x285610['fire']('ready'),_0x285610;}};const ai=['RevisionHistoryUI','RestrictedEditingMode'];var hi=class extends _0x544bf8{result;static get['pluginName'](){return'RevisionViewerIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x11d676){super(_0x11d676),this['result']='end',_0x11d676['editing']['view']['_overlayModeHint']='auto',_0x11d676['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}},ci=class extends _0x544bf8{_viewerEditor;static get['pluginName'](){return'RevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[At,Dt];}constructor(_0x241a7b){if(super(_0x241a7b),!this['editor']['config']['get']('revisionHistory'))throw new _0x3d550e('revision-history-missing-configuration',this);this['_viewerEditor']=null,this['set']('isRevisionViewerOpen',!0x1),this['editor']['config']['define']('revisionHistory.showRevisionViewerCallback',_0x295495=>this['_showRevisionViewer']({..._0x295495,'translations':this['editor']['locale']['translations']})),this['editor']['config']['define']('revisionHistory.closeRevisionViewerCallback',_0x407501=>this['_closeRevisionViewer'](_0x407501)),this['editor']['config']['define']('revisionHistory.restoreRevisionCallback',_0x43649b=>this['_restoreRevision'](_0x43649b)),this['editor']['config']['define']('revisionHistory.requireRevisionName',!0x1),this['editor']['config']['define']('revisionHistory.showCommentHighlights',!0x1),this['_enhanceShowRevisionViewerCallback'](),this['_enhanceCloseRevisionViewerCallback']();}set adapter(_0x388631){this['editor']['plugins']['get']('RevisionTracker')['adapter']=_0x388631;}get adapter(){return this['editor']['plugins']['get']('RevisionTracker')['adapter'];}addRevisionData(_0x232b25){return this['editor']['plugins']['get']('RevisionTracker')['addRevisionData'](_0x232b25);}getRevision(_0x1a5174){return this['editor']['plugins']['get']('RevisionsRepository')['getRevision'](_0x1a5174);}getRevisions(_0x5c5924){return this['editor']['plugins']['get']('RevisionsRepository')['getRevisions'](_0x5c5924||{'toJSON':!0x1});}_getRevisionViewerEditorConfig(){const _0x4adbbd=this['editor'],_0x481f36=_0x1db4df(_0x4adbbd,ai),_0x223178=_0x4adbbd['plugins']['get']('RevisionTracker'),_0x250604=_0x4adbbd['plugins']['get'](_0x157f26)['users'];return _0x481f36['toolbar']=['exitToEditing','restoreRevision','changesNavigation'],delete _0x481f36['lazyRoots'],(_0x481f36['plugins']['push'](hi,Pt,Kt,class RevisionViewerInit extends _0x544bf8{static get requires(){return[Pt,_0x157f26];}init(){const _0x5b680b=this['editor']['plugins']['get'](_0x157f26);for(const _0x5f127d of _0x250604)_0x5f127d['isAnonymous']||_0x5b680b['getUser'](_0x5f127d['id'])||_0x5b680b['addUser'](_0x5f127d);const _0xff34eb=_0x223178['repository']['getRevisions']();let _0x20e7f4=null;const _0x2d4dbc=this['editor']['plugins']['get']('RevisionViewer');if(_0x2d4dbc['adapter']=_0x223178['adapter'],_0x2d4dbc['bind']('isEnabled')['to'](_0x223178),_0x4adbbd['plugins']['has']('CommentsRepository')){const _0x4313ce=_0x4adbbd['plugins']['get']('CommentsRepository');_0x2d4dbc['_getVisibleCommentThreadIds']=()=>new Set(_0x4313ce['getCommentThreads']()['filter'](_0x468ffb=>!_0x468ffb['isResolved'])['map'](_0x4b45d9=>_0x4b45d9['id']));}this['editor']['commands']['get']('restoreRevision')['bind']('isEnabled')['to'](_0x4adbbd,'isReadOnly',_0x4487aa=>!_0x4487aa);for(const _0x58be12 of _0xff34eb){const _0x502db1=null===_0x58be12['creator'];if(_0x502db1&&_0x58be12['toVersion']===_0x58be12['fromVersion'])continue;const _0x1e62b0=_0x58be12['toJSON']();_0x2d4dbc['addRevisionData'](_0x1e62b0,(_0x3b45ce,_0x6e033f,_0xc58d96)=>{if(_0x502db1){if(_0x20e7f4)_0x20e7f4['_update'](_0x3b45ce,_0x6e033f);else{if(!_0x6e033f){const _0x187543=_0xc58d96['toJSON']();_0x187543['id']=_0x240cc1(),_0x223178['saveRevision'](_0x187543,_0xc58d96['toVersion'])['then'](_0x37ee6f=>{_0x20e7f4=_0x37ee6f;});}}}else _0x58be12['_update'](_0x3b45ce,_0x6e033f);});}}},ii),_0x481f36);}['_enhanceShowRevisionViewerCallback'](){const _0x52ae95=this['editor']['config']['get']('revisionHistory')['showRevisionViewerCallback'];this['editor']['config']['set']('revisionHistory.showRevisionViewerCallback',async()=>{this['editor']['enableReadOnlyMode']('revision-history-viewer-opened');const _0x6bc29a=this['editor']['plugins']['get']('RevisionTracker');if(this['editor']['plugins']['has']('Autosave')?await this['editor']['plugins']['get']('Autosave')['save']():await _0x6bc29a['update'](),this['editor']['plugins']['has']('PaginationLookup')&&this['editor']['plugins']['get']('PaginationLookup')['_recalculatePageBreaks'](),this['editor']['plugins']['has']('Dialog')){const _0x1d5915=this['editor']['plugins']['get']('Dialog');_0x1d5915['isOpen']&&_0x1d5915['hide']();}if(this['editor']['plugins']['has']('AITabs')){const _0x5b03c7=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x319ff5 of _0x5b03c7)_0x319ff5['class']=_0x319ff5['class']?_0x319ff5['class']+'\x20ck-tab-panel_disabled':'ck-tab-panel_disabled';if(this['editor']['plugins']['has']('AIChat')){const _0x275023=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x275023&&_0x275023['setAttribute']('tabindex','-1');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0x53d119=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0x53d119&&_0x53d119['setAttribute']('tabindex','-1');}}const _0x48fa5d=this['_getRevisionViewerEditorConfig']();return _0x52ae95(_0x48fa5d)['then'](_0x397e0f=>(this['_viewerEditor']=_0x397e0f,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'),_0x397e0f))['catch'](_0x105473=>(console['error'](_0x105473),this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x2e988f=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 _0x5c998c=this['editor']['plugins']['get']('AITabs')['view']['panelViews'];for(const _0x252ffb of _0x5c998c)_0x252ffb['class']='ck-tab-panel_disabled'===_0x252ffb['class']?'':_0x252ffb['class']['replace']('\x20ck-tab-panel_disabled','');if(this['editor']['plugins']['has']('AIChat')){const _0x3badb5=document['querySelector']('.ck-ai-chat__prompt-input\x20.ck-textarea');_0x3badb5&&_0x3badb5['removeAttribute']('tabindex');}if(this['editor']['plugins']['has']('AIChatHistory')){const _0xc5ff2b=document['querySelector']('.ck-ai-chat-history\x20.ck-input');_0xc5ff2b&&_0xc5ff2b['removeAttribute']('tabindex');}}return this['_viewerEditor']['plugins']['get']('RevisionViewer')['_cleanUp'](),_0x2e988f(this['_viewerEditor'])['then'](()=>{if(this['editor']['disableReadOnlyMode']('revision-history-viewer-opened'),this['_viewerEditor']=null,this['editor']['plugins']['has']('Annotations')){const _0x2c5867=this['editor']['plugins']['get']('Annotations');_0x2c5867['refreshVisibility'](),_0x2c5867['refreshPositioning']();}});});}['_showRevisionViewer'](_0x548c89){const _0x52674b=this['editor']['config']['get']('revisionHistory.editorContainer'),_0x1c8b46=this['editor']['config']['get']('revisionHistory.viewerContainer'),_0x47c980=this['editor']['config']['get']('revisionHistory.viewerEditorElement');return ri['create'](_0x47c980,_0x548c89)['then'](_0x53e1bd=>(_0x1c8b46['style']['display']='block',_0x52674b['style']['display']='none',this['isRevisionViewerOpen']=!0x0,_0x53e1bd));}['_closeRevisionViewer'](_0x2fd714){const _0x204cc6=this['editor']['config']['get']('revisionHistory.editorContainer');return this['editor']['config']['get']('revisionHistory.viewerContainer')['style']['display']='none',_0x204cc6['style']['display']='',this['isRevisionViewerOpen']=!0x1,_0x2fd714['destroy']();}async _restoreRevision(_0x50c780){const _0x4c441f=this['editor'],_0x2ce0a8=this['_viewerEditor']['plugins']['get']('RevisionViewer'),_0x21cfb3=_0x4c441f['plugins']['get']('RevisionTracker'),_0x2cb25a=_0x4c441f['plugins']['get']('RevisionHistoryUtils'),_0x45a163=_0x2ce0a8['repository']['getRevision'](_0x50c780);let _0x5d291d,_0x5a6851,_0x42d70a;try{await _0x2cb25a['loadRevisionData'](_0x45a163,this['adapter']),_0x5d291d=_0x2cb25a['getRevisionDocumentData'](_0x45a163),_0x5a6851=_0x2cb25a['getRevisionRootsAttributes'](_0x45a163);}catch(_0x15cf14){return void console['error'](_0x15cf14);}_0x4c441f['model']['change'](_0x2e3770=>{for(const _0x2ae94f of Array['from'](_0x4c441f['model']['markers']['getMarkersGroup']('restrictedEditingException')))_0x2e3770['removeMarker'](_0x2ae94f);}),_0x2ce0a8['isReady']=!0x1,_0x4c441f['model']['enqueueChange'](_0x42b0e6=>{_0x42b0e6['setSelection'](null),_0x42b0e6['removeSelectionAttribute'](_0x4c441f['model']['document']['selection']['getAttributeKeys']());const _0x4428ac=Object['keys'](_0x5d291d);for(const _0x5478a2 of _0x4c441f['model']['document']['roots'])'$graveyard'!=_0x5478a2['rootName']&&_0x5478a2['isAttached']()&&!_0x4428ac['includes'](_0x5478a2['rootName'])&&_0x42b0e6['detachRoot'](_0x5478a2);for(const _0x17dc43 of _0x4428ac){let _0x2469e6=_0x4c441f['model']['document']['getRoot'](_0x17dc43);if(!_0x2469e6||!_0x2469e6['isAttached']()){const _0x52afad=_0x45a163['diffData']?.[_0x17dc43]?.['rootElementName']||'$root';_0x2469e6=_0x42b0e6['addRoot'](_0x17dc43,_0x52afad);}const _0x497a98=_0x5a6851[_0x17dc43],_0xc83379=Object['keys'](_0x497a98),_0x414282=_0x5d291d[_0x17dc43];for(const _0x670482 of _0x2469e6['getAttributeKeys']())_0xc83379['includes'](_0x670482)||_0x42b0e6['removeAttribute'](_0x670482,_0x2469e6);for(const _0x1ec9e9 of _0xc83379)_0x42b0e6['setAttribute'](_0x1ec9e9,_0x5a6851[_0x17dc43][_0x1ec9e9],_0x2469e6);_0x42b0e6['remove'](_0x42b0e6['createRangeIn'](_0x2469e6)),_0x42b0e6['insert'](_0x4c441f['data']['parse'](_0x414282,_0x2469e6),_0x2469e6,0x0);}});const _0x29b7da=kt(_0x4c441f['locale'],'Restored');if(_0x45a163['name'])_0x42d70a=-0x1==_0x45a163['name']['indexOf'](_0x29b7da)?_0x29b7da+':\x20'+_0x45a163['name']:_0x45a163['name'];else _0x42d70a=_0x29b7da+':\x20'+(_0x45a163['createdAt']['toLocaleDateString'](_0x4c441f['locale']['uiLanguage'],{'month':'long','day':'numeric'})+',\x20'+_0x45a163['createdAt']['toLocaleTimeString'](_0x4c441f['locale']['uiLanguage'],{'hour':'numeric','minute':'numeric'}));return await _0x21cfb3['saveRevision']({'name':_0x42d70a}),_0x2ce0a8['isReady']=!0x0,_0x4c441f['config']['get']('revisionHistory')['closeRevisionViewerCallback']();}};export{Ft as RestoreRevisionCommand,yt as Revision,ci as RevisionHistory,Dt as RevisionHistoryUI,Rt as RevisionHistoryUtils,At as RevisionTracker,Pt as RevisionViewer,ri as RevisionViewerEditor,hi as RevisionViewerIntegration,Gt as RevisionViewerLoadingOverlay,Kt as RevisionViewerUI,bt as RevisionsRepository,ii as RevisionsSidebar,$t as ShowChangeCommand};
|