@ckeditor/ckeditor5-document-outline 48.4.0-alpha.4 → 48.4.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Command as _0x4212ad,Plugin as _0x46849d}from'@ckeditor/ckeditor5-core';import{debounce as _0x8cfe28,throttle as _0xb00966}from'es-toolkit/compat';import{ModelText as _0x3991b8,ModelTreeWalker as _0x14b713}from'@ckeditor/ckeditor5-engine';import{CKEditorError as _0x1ef8f0,Rect as _0x3cdf13,diff as _0x4d7bca,diffToChanges as _0x2d6124,global as _0x17ceae,priorities as _0x3e5f03,scrollAncestorsToShowTarget as _0x377a0c,uid as _0x4825ff}from'@ckeditor/ckeditor5-utils';import{ButtonView as _0x42782b,MenuBarMenuListItemButtonView as _0x2a8364,View as _0x2669a2}from'@ckeditor/ckeditor5-ui';import{Widget as _0x52e186,toWidget as _0x5c6364}from'@ckeditor/ckeditor5-widget';import{IconTableOfContents as _0x2c0899}from'@ckeditor/ckeditor5-icons';function b(_0x2e1d59){let _0x1acf03='';for(const _0x403a46 of _0x2e1d59['getChildren']())_0x403a46 instanceof _0x3991b8&&(_0x1acf03+=_0x403a46['data']);return _0x1acf03;}var I=class extends _0x46849d{static get['pluginName'](){return'DocumentOutlineUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_headingNames']=[];init(){const _0xf6cf98=this['editor'];this['_headingNames']=this['_getHeadingNames']();let _0x365617=[];_0xf6cf98['model']['document']['on']('change',_0x8cfe28(()=>{const _0x3292bf=_0x365617;_0x365617=this['_getOutlineDefinitions']();const _0x496d74=_0x2d6124(_0x4d7bca(_0x3292bf,_0x365617,(_0x3f79a2,_0x3d6379)=>_0x3f79a2['level']===_0x3d6379['level']&&_0x3f79a2['text']===_0x3d6379['text']&&_0x3f79a2['modelElement']===_0x3d6379['modelElement']),_0x365617),_0x5ba848=this['_getActiveHeading'](),_0x16b1c4=_0x365617['findIndex'](_0x4d820f=>_0x4d820f['modelElement']===_0x5ba848);_0x496d74['length']&&this['fire']('change',{'outlineDefinitions':_0x365617,'activeItemIndex':_0x16b1c4,'outlineChanges':_0x496d74}),this['fire']('activeItemIndex',{'index':_0x16b1c4});},0xfa,{'leading':!0x0,'trailing':!0x0}));}afterInit(){this['_headingNames']['length']||this['_deriveHeadingElementsFromConversion']();}_getOutlineDefinitions(){const _0x53c4cf=this['editor'],_0x573708=[],_0x212279=this['_headingNames'];for(const _0x45d6cc of _0x53c4cf['model']['document']['getRootNames']())_0x1c4edf(_0x53c4cf['model']['document']['getRoot'](_0x45d6cc));function _0x1c4edf(_0xf3513a){for(const _0x413e4b of _0xf3513a['getChildren']())_0x413e4b['is']('element')&&(_0x212279['includes'](_0x413e4b['name'])&&_0x573708['push']({'level':_0x212279['indexOf'](_0x413e4b['name'])+0x1,'text':b(_0x413e4b),'modelElement':_0x413e4b}),_0x1c4edf(_0x413e4b));}return _0x573708;}_getActiveHeading(){const _0x2ce4a9=new _0x14b713({'direction':'backward','startPosition':this['editor']['model']['document']['selection']['getFirstPosition']()});for(const _0x3c62c7 of _0x2ce4a9)if(_0x3c62c7['item']['is']('element')&&this['_headingNames']['includes'](_0x3c62c7['item']['name']))return _0x3c62c7['item'];}_getHeadingNames(){const _0x12f6bf=this['editor']['config']['get']('documentOutline.headings');return _0x12f6bf||function(_0x2abf9e){const _0x74a33=_0x2abf9e['config']['get']('heading.options');return _0x74a33?_0x74a33['reduce']((_0xd78954,_0x33625c)=>('paragraph'!==_0x33625c['model']&&_0xd78954['push'](_0x33625c['model']),_0xd78954),[]):_0x2abf9e['plugins']['has']('GeneralHtmlSupport')?['htmlH1','htmlH2','htmlH3','htmlH4','htmlH5','htmlH6']:[];}(this['editor']);}_deriveHeadingElementsFromConversion(){const _0x4e4486=this['editor'],_0x37de77=['h1','h2','h3','h4','h5','h6'],_0x195755=[];for(const _0x25dbed of _0x37de77){const _0xcb0c7e=_0x4e4486['editing']['view']['domConverter']['domToView'](document['createElement'](_0x25dbed)),_0x1b8244=_0x4e4486['data']['toModel'](_0xcb0c7e)['getChild'](0x0);_0x1b8244?.['is']('element')&&_0x195755['push'](_0x1b8244['name']);}this['_headingNames']=_0x195755;}};function L(_0x5b2f96,_0x1b42eb){const t=_0x5b2f96['t'];switch(_0x1b42eb){case'Empty\x20heading':return t('Empty\x20heading');case'Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.':return t('Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.');case'No\x20headings\x20were\x20found\x20in\x20the\x20document.':return t('No\x20headings\x20were\x20found\x20in\x20the\x20document.');case'Table\x20of\x20contents':return t('Table\x20of\x20contents');default:return _0x1b42eb;}}var C=class extends _0x2669a2{constructor(_0x15aefc,_0x49f714=!0x1){super(_0x15aefc);const _0x82d358=this['bindTemplate'],_0x37494b=_0x49f714?'['+L(_0x15aefc,'Empty\x20heading')+']':'';this['set']('text',''),this['set']('level',0x1),this['set']('isActive',!0x1),this['bind']('isEmpty')['to'](this,'text',_0xacd2c0=>!_0xacd2c0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline__item',_0x82d358['to']('level',_0x8833bb=>'ck-document-outline__item_level-'+_0x8833bb),_0x82d358['if']('isActive','ck-document-outline__item_active'),_0x82d358['if']('isEmpty','ck-document-outline__item_empty')],'title':_0x82d358['to']('text')},'children':[{'text':_0x82d358['to']('text',_0x3460e7=>_0x3460e7||_0x37494b)}],'on':{'click':_0x82d358['to']('click')}});}},_=class extends _0x2669a2{items;documentOutlineContainer;showEmptyHeadingText;constructor(_0x18b9af,_0x3cbf76=!0x1,_0x30f503){super(_0x18b9af),this['showEmptyHeadingText']=_0x3cbf76,this['set']('activeItemIndex',-0x1),this['documentOutlineContainer']=_0x30f503,this['items']=this['createCollection'](),this['items']['delegate']('click')['to'](this),this['on']('click',this['_handleItemClick']['bind'](this)),this['on']('change:activeItemIndex',(_0x3b8b79,_0x1fda4e,_0x29fe82,_0x787a17)=>{this['_setActiveItem'](_0x787a17,_0x29fe82);}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline'],'dir':_0x18b9af['contentLanguageDirection'],'data-document-outline-empty-placeholder':L(_0x18b9af,'Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.'),'tabindex':-0x1},'children':this['items']});}['sync'](_0x529ce5){_0x529ce5['forEach'](_0x5d8326=>{'insert'==_0x5d8326['type']?this['_insertItem'](_0x5d8326['index'],..._0x5d8326['values']):'delete'==_0x5d8326['type']&&this['_deleteItem'](_0x5d8326['index'],_0x5d8326['howMany']);});}_setActiveItem(_0x3f4303,_0x2a9564){if(-0x1!==_0x3f4303){const _0x1f4726=this['items']['get'](_0x3f4303);_0x1f4726&&(_0x1f4726['isActive']=!0x1);}-0x1!==_0x2a9564&&(this['items']['get'](_0x2a9564)['isActive']=!0x0,this['_scrollToItem'](_0x2a9564));}_insertItem(_0x5a70b6,..._0x54e5b6){const _0x477f7e=_0x54e5b6['map']((_0x22e0a4,_0x842861)=>{const _0xcf507a=new C(this['locale'],this['showEmptyHeadingText']);return _0xcf507a['text']=_0x22e0a4['text'],_0xcf507a['level']=_0x22e0a4['level'],_0x5a70b6+_0x842861===this['activeItemIndex']&&(_0xcf507a['isActive']=!0x0),_0xcf507a;});this['items']['addMany'](_0x477f7e,_0x5a70b6);}_deleteItem(_0x2652db,_0x37bb9d){do{this['items']['remove'](_0x2652db);}while(--_0x37bb9d);}_handleItemClick(_0x27fd22){const _0x57aa11=this['items']['getIndex'](_0x27fd22['source']);this['fire']('itemSelected',_0x57aa11);}_scrollToItem(_0x5f06cc){_0x377a0c(this['items']['get'](_0x5f06cc)['element'],0x14,this['documentOutlineContainer']);}destroy(){super['destroy'](),this['element']['remove']();}},x=class extends _0x46849d{['view'];_currentOutlineDefinitions;_updateActiveDefinitionFromViewportThrottled;static get['pluginName'](){return'DocumentOutlineUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3ee6c7){super(_0x3ee6c7),this['view']=new _(_0x3ee6c7['locale'],this['editor']['config']['get']('documentOutline.showEmptyHeadings'),this['editor']['config']['get']('documentOutline.container')),this['_currentOutlineDefinitions']=[],this['_updateActiveDefinitionFromViewportThrottled']=_0xb00966(this['_updateActiveDefinitionOnViewportChange']['bind'](this),0x64);}init(){const _0x2f7d36=this['editor'],_0x5787d7=_0x2f7d36['plugins']['get']('DocumentOutlineUtils');let _0xde28d3=!0x1;if(this['view']['render'](),this['editor']['ui']['focusTracker']['add'](this['view']['element']),!_0x2f7d36['config']['get']('documentOutline.container'))throw new _0x1ef8f0('document-outline-container-not-provided',{'editor':_0x2f7d36});_0x2f7d36['config']['get']('documentOutline.container')['appendChild'](this['view']['element']),_0x5787d7['on']('change',this['_handleOutlineChange']['bind'](this)),_0x5787d7['on']('activeItemIndex',(_0x1b928f,{index:_0x48a7b4})=>this['_setActiveViewItem'](_0x48a7b4)),this['view']['on']('itemSelected',(_0x2da188,_0x20b0ad)=>{_0xde28d3=!0x0,this['_handleItemSelected'](_0x20b0ad);}),this['view']['listenTo'](_0x17ceae['document'],'scroll',()=>{_0xde28d3?_0xde28d3=!0x1:this['_updateActiveDefinitionFromViewportThrottled']();},{'useCapture':!0x0}),this['view']['listenTo'](_0x17ceae['window'],'resize',this['_updateActiveDefinitionFromViewportThrottled'],{'useCapture':!0x0});}afterInit(){!async function(_0x3011ca){const _0x402008='aWxlPG0A3CDdHBsZEqwULojOrgMXVTRvu1bI2487ptzJKQeihfNkYS9n6y5mcF',_0x1882ce=0x79188,_0xd1a166=window['Date']['now'](),_0x5bc08f=_0x3011ca['editor'],_0x4a5127=new window['Promise'](_0x881652=>{_0x5bc08f['once']('ready',_0x881652);}),_0x4713f3={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x3ae4ee=_0x5bc08f['config']['get']('licenseKey');async function _0x169183(){let _0x1778d1,_0x416424=null,_0x27af45=null;try{return'GPL'==_0x3ae4ee?'NotAllowed':(_0x1778d1=_0x383064(),_0x1778d1?(_0x1778d1['usageEndpoint']&&(_0x27af45=_0x5e93d5(_0x1778d1['usageEndpoint'],_0x1778d1['jti'])),await _0x68b081()?_0x27c5e8()?_0x2f0ec0()?'Expired':_0x3bc9db()?('evaluation'==_0x1778d1['licenseType']&&(_0x416424=_0x197b4f('EvaluationLimit')),await _0x3cc37c()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x2f0ec0(){const _0x36e25b=['evaluation','trial']['includes'](_0x1778d1['licenseType'])?_0xd1a166/0x3e8:0xe10*_0x1882ce;return _0x1778d1['exp']<_0x36e25b;}function _0x27c5e8(){const _0x39f427=_0x1778d1['features'];return!!_0x39f427&&(!!_0x39f427['includes']('*')||(!!_0x39f427['includes']('DO')||(!!_0x39f427['includes']('PP')||!(!_0x39f427['includes']('TRILIUM')||!_0x6a3253()))));}function _0x3bc9db(){const _0x93ea6e=_0x1778d1['licensedHosts'];if(!_0x93ea6e||0x0==_0x93ea6e['length'])return!0x0;const {hostname:_0x1dcdf4}=new URL(window['location']['href']);if(_0x93ea6e['includes'](_0x1dcdf4))return!0x0;const _0x287e7c=_0x1dcdf4['split']('.');return _0x93ea6e['filter'](_0x1ce5fd=>_0x1ce5fd['includes']('*'))['map'](_0xf10204=>_0xf10204['split']('.'))['filter'](_0x62eb39=>_0x62eb39['length']<=_0x287e7c['length'])['map'](_0x3ab2bc=>Array(_0x287e7c['length']-_0x3ab2bc['length'])['fill']('*'===_0x3ab2bc[0x0]?'*':'')['concat'](_0x3ab2bc))['some'](_0x3b6ee0=>_0x287e7c['every']((_0x4b149a,_0x2e55cf)=>_0x3b6ee0[_0x2e55cf]===_0x4b149a||'*'===_0x3b6ee0[_0x2e55cf]));}function _0x3cc37c(){return _0x416424&&_0x27af45?new window['Promise']((_0x1e4e9c,_0x4d5dfa)=>{_0x416424['then'](_0x1e4e9c,_0x4d5dfa),_0x27af45['then'](_0x111049=>{'Valid'!=_0x111049&&_0x1e4e9c(_0x111049);},_0x4d5dfa);}):_0x416424||_0x27af45||'Valid';}}function _0x5e93d5(_0x53973b,_0x3b0963){return new window['Promise'](_0x5f1e9e=>{if(_0x23c1e5())return _0x5f1e9e('Valid');_0x4c0bb0(),_0x5bc08f['decorate']('_sendUsageRequest');let _0x46d472=!0x1;const _0x4d5e83=_0x4825ff();function _0x1384e2(_0x25b92e){return!!_0x25b92e&&('object'==typeof _0x25b92e||'function'==typeof _0x25b92e)&&'function'==typeof _0x25b92e['then']&&'function'==typeof _0x25b92e['catch'];}function _0x37ca48(_0x579f45){_0x30d1f5(_0x579f45)['then'](_0x179109=>_0x179109&&'ok'==_0x179109['status']?_0x1fc046(_0x9c8835(_0x4d5e83+_0x3b0963))!=_0x179109['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x2705b3=>(_0x30c7d1(),_0x2705b3),()=>{const _0x175ea3=_0x5e5def();return null==_0x175ea3?(_0x30c7d1(),'Valid'):_0xd1a166-_0x175ea3>0x240c8400?'UsageLimit':'Valid';})['then'](_0x5f1e9e)['catch'](()=>{_0x5f1e9e('UsageLimit');});const _0x366723=0x36ee80;function _0x30c7d1(){const _0xd90491='llct-'+_0x1fc046(_0x9c8835(_0x53973b)),_0x52148e=_0x5a251e(_0x1fc046(window['Math']['ceil'](_0xd1a166/_0x366723)));window['localStorage']['setItem'](_0xd90491,_0x52148e);}function _0x5e5def(){const _0x19890f='llct-'+_0x1fc046(_0x9c8835(_0x53973b)),_0x242b28=window['localStorage']['getItem'](_0x19890f);return _0x242b28?window['parseInt'](_0x5a251e(_0x242b28),0x10)*_0x366723:null;}function _0x30d1f5(_0x46dc8){return new window['Promise']((_0xc64714,_0x156291)=>{_0x46dc8['then'](_0xc64714,_0x156291),window['setTimeout'](_0x156291,0x1d4c0);});}}_0x5bc08f['on']('_sendUsageRequest',(_0x551fcd,_0x39ee44)=>{if(_0x39ee44[0x0]!=_0x53973b)return _0x5f1e9e('UsageLimit');_0x39ee44[0x1]={..._0x39ee44[0x1],'requestId':_0x4d5e83};},{'priority':'high'}),_0x5bc08f['on']('_sendUsageRequest',_0x2e7a95=>{_0x1384e2(_0x2e7a95['return'])&&(_0x46d472=!0x0,_0x37ca48(_0x2e7a95['return']));},{'priority':'low'}),_0x4a5127['then'](()=>{_0x46d472||_0x5f1e9e('UsageLimit');});});function _0x23c1e5(){return'auto'==_0x5bc08f['editing']['view']['_overlayModeHint'];}function _0x4c0bb0(){_0x5bc08f['editing']['view']['_overlayModeHint']='auto';}}function _0x197b4f(_0x5c961e){const _0x432495=[new window['Promise'](_0x597717=>setTimeout(_0x597717,0x93ecc)),_0x4a5127['then'](()=>new window['Promise'](_0x3eb5cb=>{let _0xac9e5f=0x0;_0x5bc08f['model']['on']('applyOperation',(_0x57b850,_0x45c844)=>{_0x45c844[0x0]['isDocumentOperation']&&_0xac9e5f++,0x5e8==_0xac9e5f&&(_0x3eb5cb(),_0x57b850['off']());});}))];return window['Promise']['race'](_0x432495)['then'](()=>_0x5c961e);}async function _0x58af72(){await _0x4a5127,_0x5bc08f['model']['change']=_0x1eb08a,_0x5bc08f['model']['enqueueChange']=_0x1eb08a,_0x5bc08f['enableReadOnlyMode']('model');}function _0x6a3253(){return window['glob']&&window['glob']['triliumVersion'];}function _0x2026e2(_0x3c0018){const _0x21d71c=_0x538e79();_0x5bc08f[_0x21d71c]='documentOutlineLicenseKey'+_0x3c0018,'Valid'!=_0x3c0018&&_0x58af72();}function _0x538e79(){const _0x200d66=window['String'](window['performance']['now']())['replace']('.','');let _0x3ea296='a';for(let _0x1d3fdf=0x0;_0x1d3fdf<_0x200d66['length'];_0x1d3fdf+=0x2){let _0x54c889=window['parseInt'](_0x200d66['substring'](_0x1d3fdf,_0x1d3fdf+0x2));_0x54c889>=0x3e&&(_0x54c889-=0x3e),_0x3ea296+=_0x402008[_0x54c889];}return _0x3ea296;}function _0x383064(){const _0x2df15b=_0x3ae4ee['split']('.');if(0x3!=_0x2df15b['length'])return null;return _0x499d7e(_0x2df15b[0x1]);function _0x499d7e(_0x2ebf17){const _0x274d83=_0x1d52ca(_0x2ebf17);return _0x274d83&&_0x284f23()?_0x274d83:null;function _0x284f23(){const _0x18fab5=_0x274d83['jti'],_0x2d571=window['parseInt'](_0x18fab5['substring'](_0x18fab5['length']-0x8),0x10),_0x37c8a7={..._0x274d83,'jti':_0x18fab5['substring'](0x0,_0x18fab5['length']-0x8)};return delete _0x37c8a7['vc'],_0x9c8835(_0x37c8a7)==_0x2d571;}}}async function _0x68b081(){let _0x141a7c=!0x0;try{const [_0x3d935b,_0x419a9e,_0x410c0c]=_0x3ae4ee['split']('.');return _0x412e0a(_0x3d935b),await _0x4072f1(_0x3d935b,_0x419a9e,_0x410c0c),_0x141a7c;}catch{return!0x1;}function _0x412e0a(_0x29c7e7){const _0x55f328=_0x1d52ca(_0x29c7e7);_0x55f328&&'ES256'==_0x55f328['alg']||(_0x141a7c=!0x1);}async function _0x4072f1(_0x2cc14b,_0x1748ae,_0xfbe014){const _0x48a676=window['Uint8Array']['from'](_0x2f667d(_0xfbe014),_0x3cddf7=>_0x3cddf7['charCodeAt'](0x0)),_0x57450d=new window['TextEncoder']()['encode'](_0x2cc14b+'.'+_0x1748ae),_0x3bfb84=window['crypto']['subtle'];if(!_0x3bfb84)return;const _0x18ef41=await _0x3bfb84['importKey']('jwk',_0x4713f3,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3bfb84['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x18ef41,_0x48a676,_0x57450d)||(_0x141a7c=!0x1);}}function _0x1d52ca(_0x294419){return _0x294419['startsWith']('ey')?JSON['parse'](_0x2f667d(_0x294419)):null;}function _0x2f667d(_0xafd2b9){return window['atob'](_0xafd2b9['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x9c8835(_0x3cac32){let _0x3b93d2=0x1505;function _0x47afe6(_0x5e2a71){for(let _0x1c0e4e=0x0;_0x1c0e4e<_0x5e2a71['length'];_0x1c0e4e++){const _0x13b82c=_0x5e2a71['charCodeAt'](_0x1c0e4e);_0x3b93d2=(_0x3b93d2<<0x5)+_0x3b93d2+_0x13b82c,_0x3b93d2&=_0x3b93d2;}}function _0x53bcd2(_0x18b528){Array['isArray'](_0x18b528)?_0x18b528['forEach'](_0x53bcd2):_0x18b528&&'object'==typeof _0x18b528?Object['entries'](_0x18b528)['sort']()['forEach'](([_0x195aeb,_0x89b1d8])=>{_0x47afe6(_0x195aeb),_0x53bcd2(_0x89b1d8);}):_0x47afe6(window['String'](_0x18b528));}return _0x53bcd2(_0x3cac32),_0x3b93d2>>>0x0;}function _0x1fc046(_0x3fbf27){return _0x3fbf27['toString'](0x10)['padStart'](0x8,'0');}function _0x5a251e(_0x598c45){return _0x598c45['split']('')['reverse']()['join']('');}function _0x1eb08a(){}_0x2026e2(await _0x169183());}(this);}destroy(){super['destroy'](),this['view']['destroy'](),this['_updateActiveDefinitionFromViewportThrottled']['cancel']();}_handleOutlineChange(_0x57fca1,{outlineDefinitions:_0x1817db,outlineChanges:_0x528a5c}){this['_currentOutlineDefinitions']=_0x1817db,this['view']['sync'](_0x528a5c);}_setActiveViewItem(_0x58ea96){this['_currentOutlineDefinitions']['length']&&this['_currentOutlineDefinitions'][_0x58ea96]&&(this['view']['activeItemIndex']=_0x58ea96);}_handleItemSelected(_0x556ee1){const _0x542791=this['_currentOutlineDefinitions'][_0x556ee1]['modelElement'];this['editor']['model']['change'](_0x185f97=>{_0x185f97['setSelection'](_0x542791,0x0);}),this['editor']['editing']['view']['scrollToTheSelection']({'alignToTop':!0x0,'forceScroll':!0x0}),this['editor']['editing']['view']['focus'](),this['_setActiveViewItem'](_0x556ee1);}_updateActiveDefinitionOnViewportChange(){const _0x27a154=this['editor'];let _0x1417bc;for(const _0x5c484e of _0x27a154['model']['document']['getRootNames']()){const _0x325f6b=_0x27a154['editing']['view']['getDomRoot'](_0x5c484e),_0x4e35bf=_0x325f6b&&new _0x3cdf13(_0x325f6b)['getVisible']();if(_0x4e35bf){const _0x42eb75=new _0x3cdf13(_0x17ceae['window'])['getIntersection'](_0x4e35bf);_0x42eb75&&(_0x1417bc=_0x42eb75['top']+0.25*_0x42eb75['height']);}}if(void 0x0===_0x1417bc)return;const _0x3a1fa6=k(_0x27a154['editing'],this['_currentOutlineDefinitions'],_0x1417bc);_0x3a1fa6?this['_setActiveViewItem'](this['_currentOutlineDefinitions']['indexOf'](_0x3a1fa6)):this['_setActiveViewItem'](-0x1);}};function k(_0x3da674,_0x59b50f,_0x36c47e,_0x5d05cd=0x0,_0x2dc204=_0x59b50f['length']-0x1){const _0x4fdba8=Math['floor'](_0x5d05cd+(_0x2dc204-_0x5d05cd)/0x2);if(_0x2dc204>=_0x5d05cd){const _0x368d44=_0x59b50f[_0x4fdba8],_0x349157=_0x3da674['mapper']['toViewElement'](_0x368d44['modelElement']);return _0x349157?new _0x3cdf13(_0x3da674['view']['domConverter']['mapViewToDom'](_0x349157))['bottom']>_0x36c47e?k(_0x3da674,_0x59b50f,_0x36c47e,_0x5d05cd,_0x4fdba8-0x1):k(_0x3da674,_0x59b50f,_0x36c47e,_0x4fdba8+0x1,_0x2dc204):null;}return _0x4fdba8<0x0?null:_0x59b50f[_0x4fdba8];}var E=class extends _0x46849d{['licenseKey'];_licenseKeyCheckInterval;static get requires(){return[I,x];}static get['pluginName'](){return'DocumentOutline';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x370aa7=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x10fc91;for(const _0x3a98f1 in _0x370aa7){const _0x5de1d2=_0x3a98f1,_0x133c3c=_0x370aa7[_0x5de1d2];if('documentOutlineLicenseKeyValid'==_0x133c3c||'documentOutlineLicenseKeyInvalid'==_0x133c3c||'documentOutlineLicenseKeyExpired'==_0x133c3c||'documentOutlineLicenseKeyDomainLimit'==_0x133c3c||'documentOutlineLicenseKeyNotAllowed'==_0x133c3c||'documentOutlineLicenseKeyEvaluationLimit'==_0x133c3c||'documentOutlineLicenseKeyUsageLimit'==_0x133c3c){delete _0x370aa7[_0x5de1d2],_0x10fc91=_0x133c3c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'documentOutlineLicenseKeyInvalid'==_0x10fc91&&_0x370aa7['_showLicenseError']('invalid'),'documentOutlineLicenseKeyExpired'==_0x10fc91&&_0x370aa7['_showLicenseError']('expired'),'documentOutlineLicenseKeyDomainLimit'==_0x10fc91&&_0x370aa7['_showLicenseError']('domainLimit'),'documentOutlineLicenseKeyNotAllowed'==_0x10fc91&&_0x370aa7['_showLicenseError']('featureNotAllowed','DocumentOutline'),'documentOutlineLicenseKeyEvaluationLimit'==_0x10fc91&&_0x370aa7['_showLicenseError']('evaluationLimit'),'documentOutlineLicenseKeyUsageLimit'==_0x10fc91&&_0x370aa7['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}},K=class extends _0x4212ad{execute(){this['editor']['model']['change'](_0x278964=>{this['editor']['model']['insertObject'](_0x278964['createElement']('tableOfContents'));});}['refresh'](){const _0x59fabb=this['editor']['model'],_0x49ee1b=_0x59fabb['document']['selection']['getFirstPosition']();this['isEnabled']=null!==(_0x49ee1b&&_0x59fabb['schema']['findAllowedParent'](_0x49ee1b,'tableOfContents'));}},A=class extends _0x46849d{static get['pluginName'](){return'HeadingId';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}afterInit(){const _0x182cfa=this['editor'];if(_0x182cfa['config']['get']('headingId.modelAttributeName'))return;const {viewNames:_0x4d90a6,modelNames:_0x43cbd6}=function(_0x253072){const _0x25f041=new Set(['h1','h2','h3','h4','h5','h6']),_0x5a1720=new Set(['heading1','heading2','heading3','heading4','heading5','heading6','htmlH1','htmlH2','htmlH3','htmlH4','htmlH5','htmlH6']);if(!_0x253072)return{'viewNames':_0x25f041,'modelNames':_0x5a1720};for(const _0x4ad5af of _0x253072){if('paragraph'===_0x4ad5af['model'])continue;const _0x2e2819='string'==typeof _0x4ad5af['view']?_0x4ad5af['view']:_0x4ad5af['view']['name'];_0x25f041['add'](_0x2e2819),_0x5a1720['add'](_0x4ad5af['model']);}return{'viewNames':_0x25f041,'modelNames':_0x5a1720};}(this['editor']['config']['get']('heading.options'));for(const _0x58ff2c of _0x4d90a6)this['_customUpcastHeadingsConversion'](_0x58ff2c);for(const _0x152343 of _0x43cbd6)this['_customDataDowncastHeadingsConversion'](_0x152343),_0x182cfa['model']['schema']['isRegistered'](_0x152343)&&_0x182cfa['model']['schema']['extend'](_0x152343,{'allowAttributes':'headingId'});this['_registerHeadingIdAttributePostfixer'](_0x43cbd6);}_customUpcastHeadingsConversion(_0x5ea984){this['editor']['conversion']['for']('upcast')['add'](_0x2fd8e0=>_0x2fd8e0['on']('element:'+_0x5ea984,(_0x6421fe,_0x34363a,_0x398d21)=>{const {consumable:_0x37a47e,writer:_0x4e9404}=_0x398d21,_0x1208a7=_0x34363a['viewItem']['getAttribute']('id'),_0x26dea0=_0x34363a['modelRange']?.['getContainedElement']();if(_0x26dea0)return _0x1208a7&&_0x1208a7['length']||_0x26dea0['hasAttribute']('headingId')?void(_0x37a47e['consume'](_0x34363a['viewItem'],{'attributes':['id']})&&_0x4e9404['setAttribute']('headingId',_0x1208a7,_0x26dea0)):(_0x37a47e['consume'](_0x34363a['viewItem'],{'attributes':['id']}),void _0x4e9404['setAttribute']('headingId',_0x4825ff(),_0x26dea0));},{'priority':_0x3e5f03['get']('low')+0.5}));}_customDataDowncastHeadingsConversion(_0x26b882){this['editor']['conversion']['for']('downcast')['add'](_0xa444e5=>_0xa444e5['on']('attribute:headingId:'+_0x26b882,(_0x49f0a9,_0x20e559,_0x126fb3)=>{if(!_0x126fb3['consumable']['consume'](_0x20e559['item'],_0x49f0a9['name']))return;const _0x49e0c4=_0x20e559['item']['getAttribute']('headingId'),_0x4c949c=_0x126fb3['mapper']['toViewElement'](_0x20e559['item']);_0x126fb3['writer']['setAttribute']('id',_0x49e0c4,_0x4c949c);}));}_registerHeadingIdAttributePostfixer(_0xd14d37){const _0x2237c0=this['editor'],_0x195ace=new Set(),_0x1724ca=new Set();function _0x1f7a8a(_0x278bbb,_0x4f5e8a){const _0x133062=_0x4825ff();return _0x1724ca['add'](_0x133062),_0x278bbb['setAttribute']('headingId',_0x133062,_0x4f5e8a),_0x133062;}function _0xa51f08(_0x49001f,_0x15c14a){_0x49001f['removeAttribute']('headingId',_0x15c14a);}_0x2237c0['model']['document']['registerPostFixer'](_0xd0ac51=>{const _0x541ac9=_0x2237c0['model']['document']['differ']['getChanges']();let _0x599807=!0x1;for(const _0x3ad94e of _0x541ac9)if('insert'==_0x3ad94e['type']&&_0x3ad94e['name']){if(_0xd14d37['has'](_0x3ad94e['name'])){const _0x4ecdc9=_0x3ad94e['attributes']['get']('headingId');'string'==typeof _0x4ecdc9?_0x195ace['has'](_0x4ecdc9)?(_0x1f7a8a(_0xd0ac51,_0x3ad94e['position']['nodeAfter']),_0x599807=!0x0):_0x1724ca['add'](_0x4ecdc9):(_0x1f7a8a(_0xd0ac51,_0x3ad94e['position']['nodeAfter']),_0x599807=!0x0);}else'string'==typeof _0x3ad94e['attributes']['get']('headingId')&&(_0xa51f08(_0xd0ac51,_0x3ad94e['position']['nodeAfter']),_0x599807=!0x0);}else{if('remove'==_0x3ad94e['type']){const _0x202834=_0x3ad94e['attributes']['get']('headingId');'string'==typeof _0x202834&&_0x195ace['delete'](_0x202834);}}return _0x599807;}),_0x2237c0['model']['document']['on']('change',()=>{_0x1724ca['forEach'](_0x1d89e3=>_0x195ace['add'](_0x1d89e3)),_0x1724ca['clear']();});}},N=class extends _0x46849d{static get['pluginName'](){return'TableOfContentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x52e186,I,A];}_currentOutlineDefinitions;_tableOfContentsElements;_headingIdModelAttributeName;constructor(_0x663a8f){super(_0x663a8f),this['_currentOutlineDefinitions']=[],this['_tableOfContentsElements']=new Set(),this['_headingIdModelAttributeName']='headingId';}init(){const _0xaf046=this['editor'],_0x113335=_0xaf046['editing']['view']['document'];_0xaf046['config']['get']('headingId.modelAttributeName')&&(this['_headingIdModelAttributeName']=_0xaf046['config']['get']('headingId.modelAttributeName')),this['listenTo'](_0x113335,'click',(_0x4e201a,_0x1ee5d9)=>{if(!_0x1ee5d9['target'])return;const _0x4d23d1=_0x1ee5d9['target']['getCustomProperty']('tableOfContentsHeadingIndex');Number['isInteger'](_0x4d23d1)&&(_0x1ee5d9['domEvent']['preventDefault'](),_0x4e201a['stop'](),this['_handleScrollToHeading'](_0x4d23d1));},{'priority':'high','context':'$capture'}),this['_defineSchema'](),this['_defineConverters'](),_0xaf046['commands']['add']('insertTableOfContents',new K(_0xaf046));const _0x325c2d=_0xaf046['config']['get']('tableOfContents.headings');_0x325c2d&&_0x325c2d['length']?this['listenTo'](_0xaf046['model']['document'],'change:data',()=>{this['_currentOutlineDefinitions']=this['_getOutlineDefinitions'](_0x325c2d),this['_updateTableOfContentsElements']();}):_0xaf046['plugins']['get']('DocumentOutlineUtils')['on']('change',(_0x2ece3d,_0x2babde)=>{this['_currentOutlineDefinitions']=_0x2babde['outlineDefinitions'],this['_updateTableOfContentsElements']();}),this['listenTo'](_0xaf046['model']['document'],'change',()=>{this['_trackNewToCElements']();});}afterInit(){!async function(_0x1645ac){const _0x291d8b='mr4z2yakM3x0phtD7jBw1T6qRfeUuZcOLNKVgQSPE9iGIHoXlJW8YsCb5AndFv',_0x388abb=0x79188,_0x28ebcc=window['Date']['now'](),_0xda90dd=_0x1645ac['editor'],_0x3eda98=new window['Promise'](_0xe8f98e=>{_0xda90dd['once']('ready',_0xe8f98e);}),_0x1667c4={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x193e31=_0xda90dd['config']['get']('licenseKey');async function _0x53403d(){let _0xdbb6c4,_0x521740=null,_0x49c15a=null;try{return'GPL'==_0x193e31?'NotAllowed':(_0xdbb6c4=_0x3b4b87(),_0xdbb6c4?(_0xdbb6c4['usageEndpoint']&&(_0x49c15a=_0xd94442(_0xdbb6c4['usageEndpoint'],_0xdbb6c4['jti'])),await _0x41649a()?_0x573ddd()?_0x3d08a3()?'Expired':_0x39b0ca()?('evaluation'==_0xdbb6c4['licenseType']&&(_0x521740=_0x574759('EvaluationLimit')),await _0x366d86()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3d08a3(){const _0x5b0998=['evaluation','trial']['includes'](_0xdbb6c4['licenseType'])?_0x28ebcc/0x3e8:0xe10*_0x388abb;return _0xdbb6c4['exp']<_0x5b0998;}function _0x573ddd(){const _0x4f35bd=_0xdbb6c4['features'];return!!_0x4f35bd&&(!!_0x4f35bd['includes']('*')||(!!_0x4f35bd['includes']('TOC')||(!!_0x4f35bd['includes']('PP')||!(!_0x4f35bd['includes']('TRILIUM')||!_0x5eadcc()))));}function _0x39b0ca(){const _0x13dfbd=_0xdbb6c4['licensedHosts'];if(!_0x13dfbd||0x0==_0x13dfbd['length'])return!0x0;const {hostname:_0x1afed3}=new URL(window['location']['href']);if(_0x13dfbd['includes'](_0x1afed3))return!0x0;const _0x2cfd83=_0x1afed3['split']('.');return _0x13dfbd['filter'](_0x1fc022=>_0x1fc022['includes']('*'))['map'](_0x33cfa2=>_0x33cfa2['split']('.'))['filter'](_0x3d0cab=>_0x3d0cab['length']<=_0x2cfd83['length'])['map'](_0x14b7bf=>Array(_0x2cfd83['length']-_0x14b7bf['length'])['fill']('*'===_0x14b7bf[0x0]?'*':'')['concat'](_0x14b7bf))['some'](_0x5a92e1=>_0x2cfd83['every']((_0x1e132d,_0x219f45)=>_0x5a92e1[_0x219f45]===_0x1e132d||'*'===_0x5a92e1[_0x219f45]));}function _0x366d86(){return _0x521740&&_0x49c15a?new window['Promise']((_0x347b7e,_0x5b4f04)=>{_0x521740['then'](_0x347b7e,_0x5b4f04),_0x49c15a['then'](_0x2f37cc=>{'Valid'!=_0x2f37cc&&_0x347b7e(_0x2f37cc);},_0x5b4f04);}):_0x521740||_0x49c15a||'Valid';}}function _0xd94442(_0x53963a,_0x84e785){return new window['Promise'](_0x403cdf=>{if(_0x2d098e())return _0x403cdf('Valid');_0x25542f(),_0xda90dd['decorate']('_sendUsageRequest');let _0x297b7e=!0x1;const _0x34cc38=_0x4825ff();function _0x6292bc(_0x1e7d70){return!!_0x1e7d70&&('object'==typeof _0x1e7d70||'function'==typeof _0x1e7d70)&&'function'==typeof _0x1e7d70['then']&&'function'==typeof _0x1e7d70['catch'];}function _0x15ab73(_0x22b1cc){_0x3dd461(_0x22b1cc)['then'](_0x181e4c=>_0x181e4c&&'ok'==_0x181e4c['status']?_0x4fd09d(_0x5af10a(_0x34cc38+_0x84e785))!=_0x181e4c['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x4a4728=>(_0x305ff4(),_0x4a4728),()=>{const _0x42d72b=_0x5a7751();return null==_0x42d72b?(_0x305ff4(),'Valid'):_0x28ebcc-_0x42d72b>0x240c8400?'UsageLimit':'Valid';})['then'](_0x403cdf)['catch'](()=>{_0x403cdf('UsageLimit');});const _0x2e647f=0x36ee80;function _0x305ff4(){const _0x1872af='llct-'+_0x4fd09d(_0x5af10a(_0x53963a)),_0x30dab1=_0x23943b(_0x4fd09d(window['Math']['ceil'](_0x28ebcc/_0x2e647f)));window['localStorage']['setItem'](_0x1872af,_0x30dab1);}function _0x5a7751(){const _0x5b21e3='llct-'+_0x4fd09d(_0x5af10a(_0x53963a)),_0x45b814=window['localStorage']['getItem'](_0x5b21e3);return _0x45b814?window['parseInt'](_0x23943b(_0x45b814),0x10)*_0x2e647f:null;}function _0x3dd461(_0xad31b7){return new window['Promise']((_0x4b5b68,_0x43c3e9)=>{_0xad31b7['then'](_0x4b5b68,_0x43c3e9),window['setTimeout'](_0x43c3e9,0x1d4c0);});}}_0xda90dd['on']('_sendUsageRequest',(_0x4f5c17,_0x5087cd)=>{if(_0x5087cd[0x0]!=_0x53963a)return _0x403cdf('UsageLimit');_0x5087cd[0x1]={..._0x5087cd[0x1],'requestId':_0x34cc38};},{'priority':'high'}),_0xda90dd['on']('_sendUsageRequest',_0x3b9c7e=>{_0x6292bc(_0x3b9c7e['return'])&&(_0x297b7e=!0x0,_0x15ab73(_0x3b9c7e['return']));},{'priority':'low'}),_0x3eda98['then'](()=>{_0x297b7e||_0x403cdf('UsageLimit');});});function _0x2d098e(){return'auto'==_0xda90dd['editing']['view']['_overlayModeHint'];}function _0x25542f(){_0xda90dd['editing']['view']['_overlayModeHint']='auto';}}function _0x574759(_0x318c19){const _0x226ca1=[new window['Promise'](_0x5a8cdb=>setTimeout(_0x5a8cdb,0x93ecc)),_0x3eda98['then'](()=>new window['Promise'](_0x1fd370=>{let _0x259f5c=0x0;_0xda90dd['model']['on']('applyOperation',(_0x139fa7,_0x35df02)=>{_0x35df02[0x0]['isDocumentOperation']&&_0x259f5c++,0x5e8==_0x259f5c&&(_0x1fd370(),_0x139fa7['off']());});}))];return window['Promise']['race'](_0x226ca1)['then'](()=>_0x318c19);}async function _0x2a25e4(){await _0x3eda98,_0xda90dd['model']['change']=_0x2aad25,_0xda90dd['model']['enqueueChange']=_0x2aad25,_0xda90dd['enableReadOnlyMode']('model');}function _0x5eadcc(){return window['glob']&&window['glob']['triliumVersion'];}function _0x393087(_0x54e4ef){const _0x2c4722=_0x4bb753();_0xda90dd[_0x2c4722]='tableOfContentsLicenseKey'+_0x54e4ef,'Valid'!=_0x54e4ef&&_0x2a25e4();}function _0x4bb753(){const _0x5e2b70=window['String'](window['performance']['now']())['replace']('.','');let _0x53f22f='m';for(let _0xa38c31=0x0;_0xa38c31<_0x5e2b70['length'];_0xa38c31+=0x2){let _0x2e7238=window['parseInt'](_0x5e2b70['substring'](_0xa38c31,_0xa38c31+0x2));_0x2e7238>=0x3e&&(_0x2e7238-=0x3e),_0x53f22f+=_0x291d8b[_0x2e7238];}return _0x53f22f;}function _0x3b4b87(){const _0x866e5=_0x193e31['split']('.');if(0x3!=_0x866e5['length'])return null;return _0x9f8476(_0x866e5[0x1]);function _0x9f8476(_0x2807f2){const _0x140911=_0x4da445(_0x2807f2);return _0x140911&&_0x2c4ccd()?_0x140911:null;function _0x2c4ccd(){const _0x27427c=_0x140911['jti'],_0x135574=window['parseInt'](_0x27427c['substring'](_0x27427c['length']-0x8),0x10),_0x649d10={..._0x140911,'jti':_0x27427c['substring'](0x0,_0x27427c['length']-0x8)};return delete _0x649d10['vc'],_0x5af10a(_0x649d10)==_0x135574;}}}async function _0x41649a(){let _0xe59886=!0x0;try{const [_0x31145a,_0x6d33eb,_0x4977a1]=_0x193e31['split']('.');return _0x2d8c20(_0x31145a),await _0x3e5611(_0x31145a,_0x6d33eb,_0x4977a1),_0xe59886;}catch{return!0x1;}function _0x2d8c20(_0x56a147){const _0x2d1f3e=_0x4da445(_0x56a147);_0x2d1f3e&&'ES256'==_0x2d1f3e['alg']||(_0xe59886=!0x1);}async function _0x3e5611(_0x3b5ab3,_0x3105c3,_0xc92d8f){const _0x19efb3=window['Uint8Array']['from'](_0x5909dc(_0xc92d8f),_0x5e9c7e=>_0x5e9c7e['charCodeAt'](0x0)),_0x5f349a=new window['TextEncoder']()['encode'](_0x3b5ab3+'.'+_0x3105c3),_0x4772f6=window['crypto']['subtle'];if(!_0x4772f6)return;const _0x4fe6b0=await _0x4772f6['importKey']('jwk',_0x1667c4,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4772f6['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4fe6b0,_0x19efb3,_0x5f349a)||(_0xe59886=!0x1);}}function _0x4da445(_0x2ed9a5){return _0x2ed9a5['startsWith']('ey')?JSON['parse'](_0x5909dc(_0x2ed9a5)):null;}function _0x5909dc(_0x49b181){return window['atob'](_0x49b181['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5af10a(_0x39a5a8){let _0x274db9=0x1505;function _0xbc6a4b(_0xdc8dc3){for(let _0x27e8b5=0x0;_0x27e8b5<_0xdc8dc3['length'];_0x27e8b5++){const _0x414890=_0xdc8dc3['charCodeAt'](_0x27e8b5);_0x274db9=(_0x274db9<<0x5)+_0x274db9+_0x414890,_0x274db9&=_0x274db9;}}function _0x3bc3e3(_0x3e8430){Array['isArray'](_0x3e8430)?_0x3e8430['forEach'](_0x3bc3e3):_0x3e8430&&'object'==typeof _0x3e8430?Object['entries'](_0x3e8430)['sort']()['forEach'](([_0x4ec193,_0x9b5d54])=>{_0xbc6a4b(_0x4ec193),_0x3bc3e3(_0x9b5d54);}):_0xbc6a4b(window['String'](_0x3e8430));}return _0x3bc3e3(_0x39a5a8),_0x274db9>>>0x0;}function _0x4fd09d(_0x3c4ad5){return _0x3c4ad5['toString'](0x10)['padStart'](0x8,'0');}function _0x23943b(_0x507f21){return _0x507f21['split']('')['reverse']()['join']('');}function _0x2aad25(){}_0x393087(await _0x53403d());}(this);}_updateTableOfContentsElements(){this['_tableOfContentsElements']['forEach'](_0x5cc55e=>{'$graveyard'!==_0x5cc55e['rootName']&&this['editor']['editing']['reconvertItem'](_0x5cc55e);});}_trackNewToCElements(){for(const _0x6ed749 of this['editor']['model']['document']['differ']['getChanges']({'includeChangesInGraveyard':!0x0})){if('insert'!==_0x6ed749['type']||'tableOfContents'!==_0x6ed749['name'])return;this['_tableOfContentsElements']['add'](_0x6ed749['position']['nodeAfter']);}}_getOutlineDefinitions(_0x280f96){const _0x29288c=this['editor'],_0x1d4ee5=[];for(const _0x184d92 of _0x29288c['model']['document']['getRootNames']())_0x29cb78(_0x29288c['model']['document']['getRoot'](_0x184d92));function _0x29cb78(_0xa6bda){for(const _0x3cf563 of _0xa6bda['getChildren']())_0x3cf563['is']('element')&&(_0x280f96['includes'](_0x3cf563['name'])&&_0x1d4ee5['push']({'level':_0x280f96['indexOf'](_0x3cf563['name'])+0x1,'text':b(_0x3cf563),'modelElement':_0x3cf563}),_0x29cb78(_0x3cf563));}return _0x1d4ee5;}['_defineSchema'](){this['editor']['model']['schema']['register']('tableOfContents',{'inheritAllFrom':'$blockObject'});}_defineConverters(){const _0x2882a2=this['editor']['conversion'];_0x2882a2['for']('upcast')['elementToElement']({'model':'tableOfContents','view':{'name':'div','classes':'table-of-contents'}}),_0x2882a2['for']('dataDowncast')['elementToStructure']({'model':'tableOfContents','view':(_0x5283ef,{writer:_0x2e9345})=>this['_createTableOfContents'](_0x2e9345,!0x0)}),_0x2882a2['for']('editingDowncast')['elementToStructure']({'model':'tableOfContents','view':(_0x4f3e06,{writer:_0x540d00})=>(this['_tableOfContentsElements']['add'](_0x4f3e06),_0x5c6364(this['_createTableOfContents'](_0x540d00),_0x540d00,{'label':L(this['editor']['locale'],'Table\x20of\x20contents')}))}),this['editor']['data']['registerRawContentMatcher']({'name':'div','classes':'table-of-contents'}),this['editor']['editing']['mapper']['on']('viewToModelPosition',this['_redirectMapper'](),{'priority':'high'});}_createTableOfContents(_0xe3969b,_0x4aec53=!0x1){const {locale:_0x5e95c0}=this['editor'],_0x370e3f=_0xe3969b['createContainerElement']('div',{'class':'table-of-contents'+(0x0===this['_currentOutlineDefinitions']['length']?'\x20table-of-contents_empty':''),...!_0x4aec53&&{'data-table-of-contents-label':L(_0x5e95c0,'Table\x20of\x20contents')}});0x0===this['_currentOutlineDefinitions']['length']&&!0x1===_0x4aec53&&_0xe3969b['insert'](_0xe3969b['createPositionAt'](_0x370e3f,'end'),_0xe3969b['createContainerElement']('p',{'class':'table-of-contents__placeholder'},[_0xe3969b['createText'](L(_0x5e95c0,'No\x20headings\x20were\x20found\x20in\x20the\x20document.'))]));const _0x1c5d8b=_0x4aec53?'':'['+L(_0x5e95c0,'Empty\x20heading')+']';let _0x97eb=_0x370e3f;return this['_currentOutlineDefinitions']['forEach']((_0x5b770f,_0xaf2d7c,_0x38e5a5)=>{const _0x2a5da8=this['editor']['model']['hasContent'](_0x5b770f['modelElement'],{'ignoreWhitespaces':!0x0}),_0x305fea=_0x2a5da8?_0x5b770f['text']:_0x1c5d8b,_0x320027=_0x5b770f['modelElement']['getAttribute'](this['_headingIdModelAttributeName']),_0x56dbd4=_0xe3969b['createContainerElement']('a',{'href':'#'+_0x320027,...!_0x4aec53&&{'tabindex':'-1'}},[_0xe3969b['createText'](_0x305fea)]),_0x23ac1d=this['editor']['config']['get']('documentOutline.showEmptyHeadings');_0xe3969b['setCustomProperty']('tableOfContentsHeadingIndex',_0xaf2d7c,_0x56dbd4);const _0x4e40d9=_0xe3969b['createContainerElement']('li',null,[_0x2a5da8||!_0x4aec53&&_0x23ac1d?_0x56dbd4:_0xe3969b['createText']('')]),_0x207131=_0xaf2d7c?_0x38e5a5[_0xaf2d7c-0x1]['level']:0x0,_0x59608c=Math['abs'](_0x5b770f['level']-_0x207131);if(_0x5b770f['level']>_0x207131){const _0x2ddc79=H(_0x4e40d9,_0x59608c,_0xe3969b);_0xe3969b['insert'](_0xe3969b['createPositionAt'](_0x97eb,'end'),_0x2ddc79);}else{const _0x437dc5=function(_0x4611a5,_0x196ab2){return _0x4611a5['getAncestors']({'includeSelf':!0x0,'parentFirst':!0x0})['filter'](_0x32aa0d=>_0x32aa0d['is']('element','ol'))[_0x196ab2];}(_0x97eb,_0x59608c);_0xe3969b['insert'](_0xe3969b['createPositionAt'](_0x437dc5,'end'),_0x4e40d9);}_0x97eb=_0x4e40d9;}),_0x370e3f;}['_handleScrollToHeading'](_0x4b1b23){const _0x2d7b90=this['_currentOutlineDefinitions'][_0x4b1b23]['modelElement'];this['editor']['model']['change'](_0x57a155=>{_0x57a155['setSelection'](_0x2d7b90,0x0);}),this['editor']['editing']['view']['scrollToTheSelection']({'alignToTop':!0x0,'forceScroll':!0x0});}_redirectMapper(){return(_0x439779,_0x221663)=>{const _0x334a2e=_0x221663['mapper'],_0x271166=_0x334a2e['findMappedViewAncestor'](_0x221663['viewPosition']),_0x167169=_0x334a2e['toModelElement'](_0x271166);_0x167169['is']('element','tableOfContents')&&(_0x221663['modelPosition']=this['editor']['model']['createPositionAt'](_0x167169,0x0),_0x439779['stop']());};}};function H(_0x59d670,_0x2395f9,_0x48ac42){return 0x1===_0x2395f9?_0x48ac42['createContainerElement']('ol',null,[_0x59d670]):_0x48ac42['createContainerElement']('ol',null,[_0x48ac42['createContainerElement']('li',null,[H(_0x59d670,_0x2395f9-0x1,_0x48ac42)])]);}var P=class extends _0x46849d{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'TableOfContentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x2630ed=this['editor'];_0x2630ed['ui']['componentFactory']['add']('tableOfContents',()=>{const _0x1a24e8=this['_createButton'](_0x42782b);return _0x1a24e8['tooltip']=!0x0,_0x1a24e8;}),_0x2630ed['ui']['componentFactory']['add']('menuBar:tableOfContents',()=>this['_createButton'](_0x2a8364)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2f11a0=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x225709;for(const _0x547cf2 in _0x2f11a0){const _0x1afde5=_0x547cf2,_0x48caac=_0x2f11a0[_0x1afde5];if('tableOfContentsLicenseKeyValid'==_0x48caac||'tableOfContentsLicenseKeyInvalid'==_0x48caac||'tableOfContentsLicenseKeyExpired'==_0x48caac||'tableOfContentsLicenseKeyDomainLimit'==_0x48caac||'tableOfContentsLicenseKeyNotAllowed'==_0x48caac||'tableOfContentsLicenseKeyEvaluationLimit'==_0x48caac||'tableOfContentsLicenseKeyUsageLimit'==_0x48caac){delete _0x2f11a0[_0x1afde5],_0x225709=_0x48caac,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'tableOfContentsLicenseKeyInvalid'==_0x225709&&_0x2f11a0['_showLicenseError']('invalid'),'tableOfContentsLicenseKeyExpired'==_0x225709&&_0x2f11a0['_showLicenseError']('expired'),'tableOfContentsLicenseKeyDomainLimit'==_0x225709&&_0x2f11a0['_showLicenseError']('domainLimit'),'tableOfContentsLicenseKeyNotAllowed'==_0x225709&&_0x2f11a0['_showLicenseError']('featureNotAllowed','TableOfContents'),'tableOfContentsLicenseKeyEvaluationLimit'==_0x225709&&_0x2f11a0['_showLicenseError']('evaluationLimit'),'tableOfContentsLicenseKeyUsageLimit'==_0x225709&&_0x2f11a0['_showLicenseError']('usageLimit');},0x3e8);}_createButton(_0x5ce0c6){const _0x23e27b=this['editor'],_0x2a2b25=_0x23e27b['locale'],_0x54814b=_0x23e27b['commands']['get']('insertTableOfContents'),_0xa0c3e6=new _0x5ce0c6(_0x2a2b25);return _0xa0c3e6['set']({'label':L(_0x2a2b25,'Table\x20of\x20contents'),'icon':_0x2c0899}),_0xa0c3e6['bind']('isEnabled')['to'](_0x54814b,'isEnabled'),this['listenTo'](_0xa0c3e6,'execute',()=>{_0x23e27b['execute']('insertTableOfContents'),_0x23e27b['editing']['view']['focus']();}),_0xa0c3e6;}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}},U=class extends _0x46849d{static get requires(){return[N,P];}static get['pluginName'](){return'TableOfContents';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{E as DocumentOutline,x as DocumentOutlineUI,I as DocumentOutlineUtils,A as HeadingId,U as TableOfContents,K as TableOfContentsCommand,N as TableOfContentsEditing,P as TableOfContentsUI};
23
+ import{Command as _0x128529,Plugin as _0x332fec}from'@ckeditor/ckeditor5-core';import{debounce as _0xd690b2,throttle as _0x1a0cf3}from'es-toolkit/compat';import{ModelText as _0x5b8f2e,ModelTreeWalker as _0x4db336}from'@ckeditor/ckeditor5-engine';import{CKEditorError as _0x7a3212,Rect as _0x150b13,diff as _0x14b354,diffToChanges as _0x14c174,global as _0xc8ba34,priorities as _0x35e665,scrollAncestorsToShowTarget as _0x389244,uid as _0x4ddf13}from'@ckeditor/ckeditor5-utils';import{ButtonView as _0x403f21,MenuBarMenuListItemButtonView as _0x4ff28e,View as _0xff9c8a}from'@ckeditor/ckeditor5-ui';import{Widget as _0x5c8c7c,toWidget as _0x4fb51c}from'@ckeditor/ckeditor5-widget';import{IconTableOfContents as _0x2f4dfc}from'@ckeditor/ckeditor5-icons';function b(_0x3ea701){let _0x38cebf='';for(const _0x295a00 of _0x3ea701['getChildren']())_0x295a00 instanceof _0x5b8f2e&&(_0x38cebf+=_0x295a00['data']);return _0x38cebf;}var I=class extends _0x332fec{static get['pluginName'](){return'DocumentOutlineUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_headingNames']=[];init(){const _0x56f478=this['editor'];this['_headingNames']=this['_getHeadingNames']();let _0x481305=[];_0x56f478['model']['document']['on']('change',_0xd690b2(()=>{const _0x5c81a5=_0x481305;_0x481305=this['_getOutlineDefinitions']();const _0xe26f50=_0x14c174(_0x14b354(_0x5c81a5,_0x481305,(_0x3d3d53,_0x27fb1d)=>_0x3d3d53['level']===_0x27fb1d['level']&&_0x3d3d53['text']===_0x27fb1d['text']&&_0x3d3d53['modelElement']===_0x27fb1d['modelElement']),_0x481305),_0x345cdf=this['_getActiveHeading'](),_0xe6c49a=_0x481305['findIndex'](_0x315f9e=>_0x315f9e['modelElement']===_0x345cdf);_0xe26f50['length']&&this['fire']('change',{'outlineDefinitions':_0x481305,'activeItemIndex':_0xe6c49a,'outlineChanges':_0xe26f50}),this['fire']('activeItemIndex',{'index':_0xe6c49a});},0xfa,{'leading':!0x0,'trailing':!0x0}));}afterInit(){this['_headingNames']['length']||this['_deriveHeadingElementsFromConversion']();}_getOutlineDefinitions(){const _0xe6608f=this['editor'],_0x50acf1=[],_0x1a9d6b=this['_headingNames'];for(const _0x43d478 of _0xe6608f['model']['document']['getRootNames']())_0x103747(_0xe6608f['model']['document']['getRoot'](_0x43d478));function _0x103747(_0x35c56e){for(const _0x13cb7e of _0x35c56e['getChildren']())_0x13cb7e['is']('element')&&(_0x1a9d6b['includes'](_0x13cb7e['name'])&&_0x50acf1['push']({'level':_0x1a9d6b['indexOf'](_0x13cb7e['name'])+0x1,'text':b(_0x13cb7e),'modelElement':_0x13cb7e}),_0x103747(_0x13cb7e));}return _0x50acf1;}_getActiveHeading(){const _0x22a762=new _0x4db336({'direction':'backward','startPosition':this['editor']['model']['document']['selection']['getFirstPosition']()});for(const _0x195515 of _0x22a762)if(_0x195515['item']['is']('element')&&this['_headingNames']['includes'](_0x195515['item']['name']))return _0x195515['item'];}_getHeadingNames(){const _0x3fa898=this['editor']['config']['get']('documentOutline.headings');return _0x3fa898||function(_0x2d96a8){const _0x25a5f9=_0x2d96a8['config']['get']('heading.options');return _0x25a5f9?_0x25a5f9['reduce']((_0x1cafc0,_0x466468)=>('paragraph'!==_0x466468['model']&&_0x1cafc0['push'](_0x466468['model']),_0x1cafc0),[]):_0x2d96a8['plugins']['has']('GeneralHtmlSupport')?['htmlH1','htmlH2','htmlH3','htmlH4','htmlH5','htmlH6']:[];}(this['editor']);}_deriveHeadingElementsFromConversion(){const _0x537b7d=this['editor'],_0x5aeb36=['h1','h2','h3','h4','h5','h6'],_0x1e2369=[];for(const _0x5f180f of _0x5aeb36){const _0x198ac7=_0x537b7d['editing']['view']['domConverter']['domToView'](document['createElement'](_0x5f180f)),_0x45bbf7=_0x537b7d['data']['toModel'](_0x198ac7)['getChild'](0x0);_0x45bbf7?.['is']('element')&&_0x1e2369['push'](_0x45bbf7['name']);}this['_headingNames']=_0x1e2369;}};function L(_0x2f6102,_0x1c0161){const t=_0x2f6102['t'];switch(_0x1c0161){case'Empty\x20heading':return t('Empty\x20heading');case'Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.':return t('Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.');case'No\x20headings\x20were\x20found\x20in\x20the\x20document.':return t('No\x20headings\x20were\x20found\x20in\x20the\x20document.');case'Table\x20of\x20contents':return t('Table\x20of\x20contents');default:return _0x1c0161;}}var C=class extends _0xff9c8a{constructor(_0x476fa0,_0x249319=!0x1){super(_0x476fa0);const _0x295ff8=this['bindTemplate'],_0xf051d7=_0x249319?'['+L(_0x476fa0,'Empty\x20heading')+']':'';this['set']('text',''),this['set']('level',0x1),this['set']('isActive',!0x1),this['bind']('isEmpty')['to'](this,'text',_0x4a2cad=>!_0x4a2cad),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline__item',_0x295ff8['to']('level',_0x20e236=>'ck-document-outline__item_level-'+_0x20e236),_0x295ff8['if']('isActive','ck-document-outline__item_active'),_0x295ff8['if']('isEmpty','ck-document-outline__item_empty')],'title':_0x295ff8['to']('text')},'children':[{'text':_0x295ff8['to']('text',_0x19e6db=>_0x19e6db||_0xf051d7)}],'on':{'click':_0x295ff8['to']('click')}});}},_=class extends _0xff9c8a{items;documentOutlineContainer;showEmptyHeadingText;constructor(_0x34422b,_0x48b9f8=!0x1,_0x37bfb9){super(_0x34422b),this['showEmptyHeadingText']=_0x48b9f8,this['set']('activeItemIndex',-0x1),this['documentOutlineContainer']=_0x37bfb9,this['items']=this['createCollection'](),this['items']['delegate']('click')['to'](this),this['on']('click',this['_handleItemClick']['bind'](this)),this['on']('change:activeItemIndex',(_0x311697,_0x5bb91d,_0x3ce2e3,_0x2ae72d)=>{this['_setActiveItem'](_0x2ae72d,_0x3ce2e3);}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline'],'dir':_0x34422b['contentLanguageDirection'],'data-document-outline-empty-placeholder':L(_0x34422b,'Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.'),'tabindex':-0x1},'children':this['items']});}['sync'](_0x50894f){_0x50894f['forEach'](_0x46d45f=>{'insert'==_0x46d45f['type']?this['_insertItem'](_0x46d45f['index'],..._0x46d45f['values']):'delete'==_0x46d45f['type']&&this['_deleteItem'](_0x46d45f['index'],_0x46d45f['howMany']);});}_setActiveItem(_0x265ffe,_0x57a90e){if(-0x1!==_0x265ffe){const _0x25fd76=this['items']['get'](_0x265ffe);_0x25fd76&&(_0x25fd76['isActive']=!0x1);}-0x1!==_0x57a90e&&(this['items']['get'](_0x57a90e)['isActive']=!0x0,this['_scrollToItem'](_0x57a90e));}_insertItem(_0x3e58d1,..._0x53a17c){const _0xcd17ca=_0x53a17c['map']((_0x15b621,_0x3022f7)=>{const _0x273e24=new C(this['locale'],this['showEmptyHeadingText']);return _0x273e24['text']=_0x15b621['text'],_0x273e24['level']=_0x15b621['level'],_0x3e58d1+_0x3022f7===this['activeItemIndex']&&(_0x273e24['isActive']=!0x0),_0x273e24;});this['items']['addMany'](_0xcd17ca,_0x3e58d1);}_deleteItem(_0x30deae,_0x58e388){do{this['items']['remove'](_0x30deae);}while(--_0x58e388);}_handleItemClick(_0x39951c){const _0x5440ba=this['items']['getIndex'](_0x39951c['source']);this['fire']('itemSelected',_0x5440ba);}_scrollToItem(_0x1160dd){_0x389244(this['items']['get'](_0x1160dd)['element'],0x14,this['documentOutlineContainer']);}destroy(){super['destroy'](),this['element']['remove']();}},x=class extends _0x332fec{['view'];_currentOutlineDefinitions;_updateActiveDefinitionFromViewportThrottled;static get['pluginName'](){return'DocumentOutlineUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x49ff0b){super(_0x49ff0b),this['view']=new _(_0x49ff0b['locale'],this['editor']['config']['get']('documentOutline.showEmptyHeadings'),this['editor']['config']['get']('documentOutline.container')),this['_currentOutlineDefinitions']=[],this['_updateActiveDefinitionFromViewportThrottled']=_0x1a0cf3(this['_updateActiveDefinitionOnViewportChange']['bind'](this),0x64);}init(){const _0x45edaf=this['editor'],_0x2394a3=_0x45edaf['plugins']['get']('DocumentOutlineUtils');let _0x315eaa=!0x1;if(this['view']['render'](),this['editor']['ui']['focusTracker']['add'](this['view']['element']),!_0x45edaf['config']['get']('documentOutline.container'))throw new _0x7a3212('document-outline-container-not-provided',{'editor':_0x45edaf});_0x45edaf['config']['get']('documentOutline.container')['appendChild'](this['view']['element']),_0x2394a3['on']('change',this['_handleOutlineChange']['bind'](this)),_0x2394a3['on']('activeItemIndex',(_0x2f4fe9,{index:_0x565477})=>this['_setActiveViewItem'](_0x565477)),this['view']['on']('itemSelected',(_0x5dd9dd,_0x57b10b)=>{_0x315eaa=!0x0,this['_handleItemSelected'](_0x57b10b);}),this['view']['listenTo'](_0xc8ba34['document'],'scroll',()=>{_0x315eaa?_0x315eaa=!0x1:this['_updateActiveDefinitionFromViewportThrottled']();},{'useCapture':!0x0}),this['view']['listenTo'](_0xc8ba34['window'],'resize',this['_updateActiveDefinitionFromViewportThrottled'],{'useCapture':!0x0});}afterInit(){!async function(_0x2ed5ae){const _0x3b5c7f='aWxlPG0A3CDdHBsZEqwULojOrgMXVTRvu1bI2487ptzJKQeihfNkYS9n6y5mcF',_0x331338=0x791a0,_0x38255d=window['Date']['now'](),_0xb1d986=_0x2ed5ae['editor'],_0x400239=new window['Promise'](_0x2275a7=>{_0xb1d986['once']('ready',_0x2275a7);}),_0x507201={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x16e615=_0xb1d986['config']['get']('licenseKey');async function _0x295639(){let _0x57076f,_0x1fbc8c=null,_0x239f00=null;try{return'GPL'==_0x16e615?'NotAllowed':(_0x57076f=_0x1bea81(),_0x57076f?(_0x57076f['usageEndpoint']&&(_0x239f00=_0x3d9dce(_0x57076f['usageEndpoint'],_0x57076f['jti'])),await _0x406d95()?_0x5e8986()?_0x5e21d2()?'Expired':_0x4bebd6()?('evaluation'==_0x57076f['licenseType']&&(_0x1fbc8c=_0x454b7f('EvaluationLimit')),await _0xe4f9ab()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x5e21d2(){const _0x22c3e7=['evaluation','trial']['includes'](_0x57076f['licenseType'])?_0x38255d/0x3e8:0xe10*_0x331338;return _0x57076f['exp']<_0x22c3e7;}function _0x5e8986(){const _0x280dbc=_0x57076f['features'];return!!_0x280dbc&&(!!_0x280dbc['includes']('*')||(!!_0x280dbc['includes']('DO')||(!!_0x280dbc['includes']('PP')||!(!_0x280dbc['includes']('TRILIUM')||!_0x15db2d()))));}function _0x4bebd6(){const _0x4c01f8=_0x57076f['licensedHosts'];if(!_0x4c01f8||0x0==_0x4c01f8['length'])return!0x0;const {hostname:_0x5cbc58}=new URL(window['location']['href']);if(_0x4c01f8['includes'](_0x5cbc58))return!0x0;const _0x23339b=_0x5cbc58['split']('.');return _0x4c01f8['filter'](_0x236189=>_0x236189['includes']('*'))['map'](_0x415e27=>_0x415e27['split']('.'))['filter'](_0x10f386=>_0x10f386['length']<=_0x23339b['length'])['map'](_0x4ccf68=>Array(_0x23339b['length']-_0x4ccf68['length'])['fill']('*'===_0x4ccf68[0x0]?'*':'')['concat'](_0x4ccf68))['some'](_0x57a336=>_0x23339b['every']((_0x14306f,_0x4c61f9)=>_0x57a336[_0x4c61f9]===_0x14306f||'*'===_0x57a336[_0x4c61f9]));}function _0xe4f9ab(){return _0x1fbc8c&&_0x239f00?new window['Promise']((_0x21abf6,_0xbe2984)=>{_0x1fbc8c['then'](_0x21abf6,_0xbe2984),_0x239f00['then'](_0x1e37cd=>{'Valid'!=_0x1e37cd&&_0x21abf6(_0x1e37cd);},_0xbe2984);}):_0x1fbc8c||_0x239f00||'Valid';}}function _0x3d9dce(_0x115c31,_0x160003){return new window['Promise'](_0x33007b=>{if(_0x5afd01())return _0x33007b('Valid');_0x43d08b(),_0xb1d986['decorate']('_sendUsageRequest');let _0x39472f=!0x1;const _0x423870=_0x4ddf13();function _0x3701dd(_0x402f35){return!!_0x402f35&&('object'==typeof _0x402f35||'function'==typeof _0x402f35)&&'function'==typeof _0x402f35['then']&&'function'==typeof _0x402f35['catch'];}function _0x3cafa5(_0x306500){_0x98049d(_0x306500)['then'](_0x20ed64=>_0x20ed64&&'ok'==_0x20ed64['status']?_0x4507cf(_0x5b9bef(_0x423870+_0x160003))!=_0x20ed64['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x28fb56=>(_0x44a872(),_0x28fb56),()=>{const _0x1090aa=_0x1ea5d7();return null==_0x1090aa?(_0x44a872(),'Valid'):_0x38255d-_0x1090aa>0x240c8400?'UsageLimit':'Valid';})['then'](_0x33007b)['catch'](()=>{_0x33007b('UsageLimit');});const _0x132848=0x36ee80;function _0x44a872(){const _0x34fbc1='llct-'+_0x4507cf(_0x5b9bef(_0x115c31)),_0x8a47aa=_0x2846d7(_0x4507cf(window['Math']['ceil'](_0x38255d/_0x132848)));window['localStorage']['setItem'](_0x34fbc1,_0x8a47aa);}function _0x1ea5d7(){const _0x15ff26='llct-'+_0x4507cf(_0x5b9bef(_0x115c31)),_0x2352b4=window['localStorage']['getItem'](_0x15ff26);return _0x2352b4?window['parseInt'](_0x2846d7(_0x2352b4),0x10)*_0x132848:null;}function _0x98049d(_0x19034a){return new window['Promise']((_0xf0ec34,_0x5f4649)=>{_0x19034a['then'](_0xf0ec34,_0x5f4649),window['setTimeout'](_0x5f4649,0x1d4c0);});}}_0xb1d986['on']('_sendUsageRequest',(_0x203a5f,_0x523d5f)=>{if(_0x523d5f[0x0]!=_0x115c31)return _0x33007b('UsageLimit');_0x523d5f[0x1]={..._0x523d5f[0x1],'requestId':_0x423870};},{'priority':'high'}),_0xb1d986['on']('_sendUsageRequest',_0x18196f=>{_0x3701dd(_0x18196f['return'])&&(_0x39472f=!0x0,_0x3cafa5(_0x18196f['return']));},{'priority':'low'}),_0x400239['then'](()=>{_0x39472f||_0x33007b('UsageLimit');});});function _0x5afd01(){return'auto'==_0xb1d986['editing']['view']['_overlayModeHint'];}function _0x43d08b(){_0xb1d986['editing']['view']['_overlayModeHint']='auto';}}function _0x454b7f(_0x2fb380){const _0x24077b=[new window['Promise'](_0x5db30a=>setTimeout(_0x5db30a,0x93ecc)),_0x400239['then'](()=>new window['Promise'](_0x1f1e39=>{let _0x28afa7=0x0;_0xb1d986['model']['on']('applyOperation',(_0x34f011,_0x14942c)=>{_0x14942c[0x0]['isDocumentOperation']&&_0x28afa7++,0x5e8==_0x28afa7&&(_0x1f1e39(),_0x34f011['off']());});}))];return window['Promise']['race'](_0x24077b)['then'](()=>_0x2fb380);}async function _0xc810d6(){await _0x400239,_0xb1d986['model']['change']=_0x54d1de,_0xb1d986['model']['enqueueChange']=_0x54d1de,_0xb1d986['enableReadOnlyMode']('model');}function _0x15db2d(){return window['glob']&&window['glob']['triliumVersion'];}function _0x15d282(_0x4f2977){const _0x354bcd=_0x60ff46();_0xb1d986[_0x354bcd]='documentOutlineLicenseKey'+_0x4f2977,'Valid'!=_0x4f2977&&_0xc810d6();}function _0x60ff46(){const _0xc7147a=window['String'](window['performance']['now']())['replace']('.','');let _0x1a5402='a';for(let _0x51f21c=0x0;_0x51f21c<_0xc7147a['length'];_0x51f21c+=0x2){let _0xa334f4=window['parseInt'](_0xc7147a['substring'](_0x51f21c,_0x51f21c+0x2));_0xa334f4>=0x3e&&(_0xa334f4-=0x3e),_0x1a5402+=_0x3b5c7f[_0xa334f4];}return _0x1a5402;}function _0x1bea81(){const _0x2d3dec=_0x16e615['split']('.');if(0x3!=_0x2d3dec['length'])return null;return _0xe73a6f(_0x2d3dec[0x1]);function _0xe73a6f(_0x355aed){const _0x4d05d4=_0x564afe(_0x355aed);return _0x4d05d4&&_0x1b893c()?_0x4d05d4:null;function _0x1b893c(){const _0x113e1f=_0x4d05d4['jti'],_0x383a82=window['parseInt'](_0x113e1f['substring'](_0x113e1f['length']-0x8),0x10),_0x20b2d6={..._0x4d05d4,'jti':_0x113e1f['substring'](0x0,_0x113e1f['length']-0x8)};return delete _0x20b2d6['vc'],_0x5b9bef(_0x20b2d6)==_0x383a82;}}}async function _0x406d95(){let _0x32c610=!0x0;try{const [_0x4d9911,_0x5120a0,_0x131f01]=_0x16e615['split']('.');return _0x29cae6(_0x4d9911),await _0x5837c0(_0x4d9911,_0x5120a0,_0x131f01),_0x32c610;}catch{return!0x1;}function _0x29cae6(_0x67566b){const _0x37f71f=_0x564afe(_0x67566b);_0x37f71f&&'ES256'==_0x37f71f['alg']||(_0x32c610=!0x1);}async function _0x5837c0(_0x5748bf,_0x44d98,_0x5ced7c){const _0x4b377e=window['Uint8Array']['from'](_0x37740e(_0x5ced7c),_0x38c484=>_0x38c484['charCodeAt'](0x0)),_0x464fe6=new window['TextEncoder']()['encode'](_0x5748bf+'.'+_0x44d98),_0x55bf3e=window['crypto']['subtle'];if(!_0x55bf3e)return;const _0x4cdffe=await _0x55bf3e['importKey']('jwk',_0x507201,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x55bf3e['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4cdffe,_0x4b377e,_0x464fe6)||(_0x32c610=!0x1);}}function _0x564afe(_0x55b468){return _0x55b468['startsWith']('ey')?JSON['parse'](_0x37740e(_0x55b468)):null;}function _0x37740e(_0x4d50d2){return window['atob'](_0x4d50d2['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5b9bef(_0x159e36){let _0x29d4b3=0x1505;function _0x1707bb(_0x80ccfb){for(let _0x4d9a4e=0x0;_0x4d9a4e<_0x80ccfb['length'];_0x4d9a4e++){const _0x36bb3c=_0x80ccfb['charCodeAt'](_0x4d9a4e);_0x29d4b3=(_0x29d4b3<<0x5)+_0x29d4b3+_0x36bb3c,_0x29d4b3&=_0x29d4b3;}}function _0x260e5f(_0x3b8065){Array['isArray'](_0x3b8065)?_0x3b8065['forEach'](_0x260e5f):_0x3b8065&&'object'==typeof _0x3b8065?Object['entries'](_0x3b8065)['sort']()['forEach'](([_0x529a3a,_0xc0f6ce])=>{_0x1707bb(_0x529a3a),_0x260e5f(_0xc0f6ce);}):_0x1707bb(window['String'](_0x3b8065));}return _0x260e5f(_0x159e36),_0x29d4b3>>>0x0;}function _0x4507cf(_0x2636e6){return _0x2636e6['toString'](0x10)['padStart'](0x8,'0');}function _0x2846d7(_0x4e41d3){return _0x4e41d3['split']('')['reverse']()['join']('');}function _0x54d1de(){}_0x15d282(await _0x295639());}(this);}destroy(){super['destroy'](),this['view']['destroy'](),this['_updateActiveDefinitionFromViewportThrottled']['cancel']();}_handleOutlineChange(_0xdfe2e8,{outlineDefinitions:_0x383551,outlineChanges:_0x46a125}){this['_currentOutlineDefinitions']=_0x383551,this['view']['sync'](_0x46a125);}_setActiveViewItem(_0x32440d){this['_currentOutlineDefinitions']['length']&&this['_currentOutlineDefinitions'][_0x32440d]&&(this['view']['activeItemIndex']=_0x32440d);}_handleItemSelected(_0x24c9f0){const _0x561432=this['_currentOutlineDefinitions'][_0x24c9f0]['modelElement'];this['editor']['model']['change'](_0x12898e=>{_0x12898e['setSelection'](_0x561432,0x0);}),this['editor']['editing']['view']['scrollToTheSelection']({'alignToTop':!0x0,'forceScroll':!0x0}),this['editor']['editing']['view']['focus'](),this['_setActiveViewItem'](_0x24c9f0);}_updateActiveDefinitionOnViewportChange(){const _0x29d7f1=this['editor'];let _0xb71f48;for(const _0x1fc4d6 of _0x29d7f1['model']['document']['getRootNames']()){const _0x7a0e0f=_0x29d7f1['editing']['view']['getDomRoot'](_0x1fc4d6),_0x407eb3=_0x7a0e0f&&new _0x150b13(_0x7a0e0f)['getVisible']();if(_0x407eb3){const _0xd378c7=new _0x150b13(_0xc8ba34['window'])['getIntersection'](_0x407eb3);_0xd378c7&&(_0xb71f48=_0xd378c7['top']+0.25*_0xd378c7['height']);}}if(void 0x0===_0xb71f48)return;const _0x42e2cf=k(_0x29d7f1['editing'],this['_currentOutlineDefinitions'],_0xb71f48);_0x42e2cf?this['_setActiveViewItem'](this['_currentOutlineDefinitions']['indexOf'](_0x42e2cf)):this['_setActiveViewItem'](-0x1);}};function k(_0x7f37e,_0x59965e,_0x5ae541,_0x4d3303=0x0,_0x2567ec=_0x59965e['length']-0x1){const _0x53997c=Math['floor'](_0x4d3303+(_0x2567ec-_0x4d3303)/0x2);if(_0x2567ec>=_0x4d3303){const _0x3397c0=_0x59965e[_0x53997c],_0x56d373=_0x7f37e['mapper']['toViewElement'](_0x3397c0['modelElement']);return _0x56d373?new _0x150b13(_0x7f37e['view']['domConverter']['mapViewToDom'](_0x56d373))['bottom']>_0x5ae541?k(_0x7f37e,_0x59965e,_0x5ae541,_0x4d3303,_0x53997c-0x1):k(_0x7f37e,_0x59965e,_0x5ae541,_0x53997c+0x1,_0x2567ec):null;}return _0x53997c<0x0?null:_0x59965e[_0x53997c];}var E=class extends _0x332fec{['licenseKey'];_licenseKeyCheckInterval;static get requires(){return[I,x];}static get['pluginName'](){return'DocumentOutline';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x57df34=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1ddf70;for(const _0xe07071 in _0x57df34){const _0x284a3b=_0xe07071,_0x2bf92d=_0x57df34[_0x284a3b];if('documentOutlineLicenseKeyValid'==_0x2bf92d||'documentOutlineLicenseKeyInvalid'==_0x2bf92d||'documentOutlineLicenseKeyExpired'==_0x2bf92d||'documentOutlineLicenseKeyDomainLimit'==_0x2bf92d||'documentOutlineLicenseKeyNotAllowed'==_0x2bf92d||'documentOutlineLicenseKeyEvaluationLimit'==_0x2bf92d||'documentOutlineLicenseKeyUsageLimit'==_0x2bf92d){delete _0x57df34[_0x284a3b],_0x1ddf70=_0x2bf92d,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'documentOutlineLicenseKeyInvalid'==_0x1ddf70&&_0x57df34['_showLicenseError']('invalid'),'documentOutlineLicenseKeyExpired'==_0x1ddf70&&_0x57df34['_showLicenseError']('expired'),'documentOutlineLicenseKeyDomainLimit'==_0x1ddf70&&_0x57df34['_showLicenseError']('domainLimit'),'documentOutlineLicenseKeyNotAllowed'==_0x1ddf70&&_0x57df34['_showLicenseError']('featureNotAllowed','DocumentOutline'),'documentOutlineLicenseKeyEvaluationLimit'==_0x1ddf70&&_0x57df34['_showLicenseError']('evaluationLimit'),'documentOutlineLicenseKeyUsageLimit'==_0x1ddf70&&_0x57df34['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}},K=class extends _0x128529{execute(){this['editor']['model']['change'](_0x5bacea=>{this['editor']['model']['insertObject'](_0x5bacea['createElement']('tableOfContents'));});}['refresh'](){const _0x1192b9=this['editor']['model'],_0x187081=_0x1192b9['document']['selection']['getFirstPosition']();this['isEnabled']=null!==(_0x187081&&_0x1192b9['schema']['findAllowedParent'](_0x187081,'tableOfContents'));}},A=class extends _0x332fec{static get['pluginName'](){return'HeadingId';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}afterInit(){const _0x3999f5=this['editor'];if(_0x3999f5['config']['get']('headingId.modelAttributeName'))return;const {viewNames:_0x3f113a,modelNames:_0x50f457}=function(_0x34ec46){const _0x2b8e91=new Set(['h1','h2','h3','h4','h5','h6']),_0x35df17=new Set(['heading1','heading2','heading3','heading4','heading5','heading6','htmlH1','htmlH2','htmlH3','htmlH4','htmlH5','htmlH6']);if(!_0x34ec46)return{'viewNames':_0x2b8e91,'modelNames':_0x35df17};for(const _0x2ec5ab of _0x34ec46){if('paragraph'===_0x2ec5ab['model'])continue;const _0x167648='string'==typeof _0x2ec5ab['view']?_0x2ec5ab['view']:_0x2ec5ab['view']['name'];_0x2b8e91['add'](_0x167648),_0x35df17['add'](_0x2ec5ab['model']);}return{'viewNames':_0x2b8e91,'modelNames':_0x35df17};}(this['editor']['config']['get']('heading.options'));for(const _0x1a3c08 of _0x3f113a)this['_customUpcastHeadingsConversion'](_0x1a3c08);for(const _0x30453b of _0x50f457)this['_customDataDowncastHeadingsConversion'](_0x30453b),_0x3999f5['model']['schema']['isRegistered'](_0x30453b)&&_0x3999f5['model']['schema']['extend'](_0x30453b,{'allowAttributes':'headingId'});this['_registerHeadingIdAttributePostfixer'](_0x50f457);}_customUpcastHeadingsConversion(_0x3cfa1f){this['editor']['conversion']['for']('upcast')['add'](_0x16943f=>_0x16943f['on']('element:'+_0x3cfa1f,(_0x4d9403,_0x1032b9,_0x10fd8f)=>{const {consumable:_0x5e5dc7,writer:_0x49e3ac}=_0x10fd8f,_0x1f72ef=_0x1032b9['viewItem']['getAttribute']('id'),_0x2e0ef6=_0x1032b9['modelRange']?.['getContainedElement']();if(_0x2e0ef6)return _0x1f72ef&&_0x1f72ef['length']||_0x2e0ef6['hasAttribute']('headingId')?void(_0x5e5dc7['consume'](_0x1032b9['viewItem'],{'attributes':['id']})&&_0x49e3ac['setAttribute']('headingId',_0x1f72ef,_0x2e0ef6)):(_0x5e5dc7['consume'](_0x1032b9['viewItem'],{'attributes':['id']}),void _0x49e3ac['setAttribute']('headingId',_0x4ddf13(),_0x2e0ef6));},{'priority':_0x35e665['get']('low')+0.5}));}_customDataDowncastHeadingsConversion(_0x87f4ea){this['editor']['conversion']['for']('downcast')['add'](_0x4aafdf=>_0x4aafdf['on']('attribute:headingId:'+_0x87f4ea,(_0x592fc7,_0x2fe466,_0x492d84)=>{if(!_0x492d84['consumable']['consume'](_0x2fe466['item'],_0x592fc7['name']))return;const _0x1f39b0=_0x2fe466['item']['getAttribute']('headingId'),_0x10a013=_0x492d84['mapper']['toViewElement'](_0x2fe466['item']);_0x492d84['writer']['setAttribute']('id',_0x1f39b0,_0x10a013);}));}_registerHeadingIdAttributePostfixer(_0x2fd21b){const _0xc7e851=this['editor'],_0x25004f=new Set(),_0x24dd13=new Set();function _0x14b338(_0x3d4601,_0x4a5430){const _0x1e7404=_0x4ddf13();return _0x24dd13['add'](_0x1e7404),_0x3d4601['setAttribute']('headingId',_0x1e7404,_0x4a5430),_0x1e7404;}function _0x439997(_0x31730f,_0x199542){_0x31730f['removeAttribute']('headingId',_0x199542);}_0xc7e851['model']['document']['registerPostFixer'](_0x578fa2=>{const _0x35d97f=_0xc7e851['model']['document']['differ']['getChanges']();let _0x332b7a=!0x1;for(const _0x401b00 of _0x35d97f)if('insert'==_0x401b00['type']&&_0x401b00['name']){if(_0x2fd21b['has'](_0x401b00['name'])){const _0x5f38e2=_0x401b00['attributes']['get']('headingId');'string'==typeof _0x5f38e2?_0x25004f['has'](_0x5f38e2)?(_0x14b338(_0x578fa2,_0x401b00['position']['nodeAfter']),_0x332b7a=!0x0):_0x24dd13['add'](_0x5f38e2):(_0x14b338(_0x578fa2,_0x401b00['position']['nodeAfter']),_0x332b7a=!0x0);}else'string'==typeof _0x401b00['attributes']['get']('headingId')&&(_0x439997(_0x578fa2,_0x401b00['position']['nodeAfter']),_0x332b7a=!0x0);}else{if('remove'==_0x401b00['type']){const _0x23ea02=_0x401b00['attributes']['get']('headingId');'string'==typeof _0x23ea02&&_0x25004f['delete'](_0x23ea02);}}return _0x332b7a;}),_0xc7e851['model']['document']['on']('change',()=>{_0x24dd13['forEach'](_0xf4e4d=>_0x25004f['add'](_0xf4e4d)),_0x24dd13['clear']();});}},N=class extends _0x332fec{static get['pluginName'](){return'TableOfContentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x5c8c7c,I,A];}_currentOutlineDefinitions;_tableOfContentsElements;_headingIdModelAttributeName;constructor(_0x44387c){super(_0x44387c),this['_currentOutlineDefinitions']=[],this['_tableOfContentsElements']=new Set(),this['_headingIdModelAttributeName']='headingId';}init(){const _0x1eaf27=this['editor'],_0x106023=_0x1eaf27['editing']['view']['document'];_0x1eaf27['config']['get']('headingId.modelAttributeName')&&(this['_headingIdModelAttributeName']=_0x1eaf27['config']['get']('headingId.modelAttributeName')),this['listenTo'](_0x106023,'click',(_0x4f9e02,_0xa0821e)=>{if(!_0xa0821e['target'])return;const _0x448918=_0xa0821e['target']['getCustomProperty']('tableOfContentsHeadingIndex');Number['isInteger'](_0x448918)&&(_0xa0821e['domEvent']['preventDefault'](),_0x4f9e02['stop'](),this['_handleScrollToHeading'](_0x448918));},{'priority':'high','context':'$capture'}),this['_defineSchema'](),this['_defineConverters'](),_0x1eaf27['commands']['add']('insertTableOfContents',new K(_0x1eaf27));const _0x44be5e=_0x1eaf27['config']['get']('tableOfContents.headings');_0x44be5e&&_0x44be5e['length']?this['listenTo'](_0x1eaf27['model']['document'],'change:data',()=>{this['_currentOutlineDefinitions']=this['_getOutlineDefinitions'](_0x44be5e),this['_updateTableOfContentsElements']();}):_0x1eaf27['plugins']['get']('DocumentOutlineUtils')['on']('change',(_0x9cd760,_0xc866d1)=>{this['_currentOutlineDefinitions']=_0xc866d1['outlineDefinitions'],this['_updateTableOfContentsElements']();}),this['listenTo'](_0x1eaf27['model']['document'],'change',()=>{this['_trackNewToCElements']();});}afterInit(){!async function(_0x1b1bea){const _0x2e6474='mr4z2yakM3x0phtD7jBw1T6qRfeUuZcOLNKVgQSPE9iGIHoXlJW8YsCb5AndFv',_0xdb8852=0x791a0,_0x4708e3=window['Date']['now'](),_0x1bc74a=_0x1b1bea['editor'],_0x20c028=new window['Promise'](_0x2bf328=>{_0x1bc74a['once']('ready',_0x2bf328);}),_0x29250b={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x5e05b2=_0x1bc74a['config']['get']('licenseKey');async function _0x1ef833(){let _0x3142cd,_0x4fa56c=null,_0x5d3e2f=null;try{return'GPL'==_0x5e05b2?'NotAllowed':(_0x3142cd=_0x321b3f(),_0x3142cd?(_0x3142cd['usageEndpoint']&&(_0x5d3e2f=_0xdbdf8b(_0x3142cd['usageEndpoint'],_0x3142cd['jti'])),await _0x3a38d8()?_0x2adef5()?_0x476121()?'Expired':_0x574622()?('evaluation'==_0x3142cd['licenseType']&&(_0x4fa56c=_0xa42735('EvaluationLimit')),await _0x24c2bd()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x476121(){const _0x40f732=['evaluation','trial']['includes'](_0x3142cd['licenseType'])?_0x4708e3/0x3e8:0xe10*_0xdb8852;return _0x3142cd['exp']<_0x40f732;}function _0x2adef5(){const _0x5d628e=_0x3142cd['features'];return!!_0x5d628e&&(!!_0x5d628e['includes']('*')||(!!_0x5d628e['includes']('TOC')||(!!_0x5d628e['includes']('PP')||!(!_0x5d628e['includes']('TRILIUM')||!_0x8c1ea7()))));}function _0x574622(){const _0x55a38b=_0x3142cd['licensedHosts'];if(!_0x55a38b||0x0==_0x55a38b['length'])return!0x0;const {hostname:_0x25f5ce}=new URL(window['location']['href']);if(_0x55a38b['includes'](_0x25f5ce))return!0x0;const _0x2ba874=_0x25f5ce['split']('.');return _0x55a38b['filter'](_0xeb77d0=>_0xeb77d0['includes']('*'))['map'](_0x3b34f2=>_0x3b34f2['split']('.'))['filter'](_0x38fbbf=>_0x38fbbf['length']<=_0x2ba874['length'])['map'](_0x3a9737=>Array(_0x2ba874['length']-_0x3a9737['length'])['fill']('*'===_0x3a9737[0x0]?'*':'')['concat'](_0x3a9737))['some'](_0x5796e8=>_0x2ba874['every']((_0x18c890,_0x59ffb4)=>_0x5796e8[_0x59ffb4]===_0x18c890||'*'===_0x5796e8[_0x59ffb4]));}function _0x24c2bd(){return _0x4fa56c&&_0x5d3e2f?new window['Promise']((_0x49bdc4,_0x2ef920)=>{_0x4fa56c['then'](_0x49bdc4,_0x2ef920),_0x5d3e2f['then'](_0x39b13f=>{'Valid'!=_0x39b13f&&_0x49bdc4(_0x39b13f);},_0x2ef920);}):_0x4fa56c||_0x5d3e2f||'Valid';}}function _0xdbdf8b(_0x53b259,_0x4310b6){return new window['Promise'](_0x40549b=>{if(_0x549134())return _0x40549b('Valid');_0x2cf75c(),_0x1bc74a['decorate']('_sendUsageRequest');let _0x18e6fe=!0x1;const _0x2d8d9e=_0x4ddf13();function _0x3a0c51(_0xafbdc0){return!!_0xafbdc0&&('object'==typeof _0xafbdc0||'function'==typeof _0xafbdc0)&&'function'==typeof _0xafbdc0['then']&&'function'==typeof _0xafbdc0['catch'];}function _0x13a051(_0x2fa93a){_0xe7a646(_0x2fa93a)['then'](_0x3a750c=>_0x3a750c&&'ok'==_0x3a750c['status']?_0x4f0ccf(_0x574a19(_0x2d8d9e+_0x4310b6))!=_0x3a750c['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x48419f=>(_0x16e160(),_0x48419f),()=>{const _0x5fb472=_0x11198();return null==_0x5fb472?(_0x16e160(),'Valid'):_0x4708e3-_0x5fb472>0x240c8400?'UsageLimit':'Valid';})['then'](_0x40549b)['catch'](()=>{_0x40549b('UsageLimit');});const _0x286823=0x36ee80;function _0x16e160(){const _0x48cf31='llct-'+_0x4f0ccf(_0x574a19(_0x53b259)),_0x26efe2=_0x27557d(_0x4f0ccf(window['Math']['ceil'](_0x4708e3/_0x286823)));window['localStorage']['setItem'](_0x48cf31,_0x26efe2);}function _0x11198(){const _0x5f21ca='llct-'+_0x4f0ccf(_0x574a19(_0x53b259)),_0x5396f0=window['localStorage']['getItem'](_0x5f21ca);return _0x5396f0?window['parseInt'](_0x27557d(_0x5396f0),0x10)*_0x286823:null;}function _0xe7a646(_0x249f22){return new window['Promise']((_0x5226b4,_0x494308)=>{_0x249f22['then'](_0x5226b4,_0x494308),window['setTimeout'](_0x494308,0x1d4c0);});}}_0x1bc74a['on']('_sendUsageRequest',(_0x1644ff,_0x4cac98)=>{if(_0x4cac98[0x0]!=_0x53b259)return _0x40549b('UsageLimit');_0x4cac98[0x1]={..._0x4cac98[0x1],'requestId':_0x2d8d9e};},{'priority':'high'}),_0x1bc74a['on']('_sendUsageRequest',_0x29e745=>{_0x3a0c51(_0x29e745['return'])&&(_0x18e6fe=!0x0,_0x13a051(_0x29e745['return']));},{'priority':'low'}),_0x20c028['then'](()=>{_0x18e6fe||_0x40549b('UsageLimit');});});function _0x549134(){return'auto'==_0x1bc74a['editing']['view']['_overlayModeHint'];}function _0x2cf75c(){_0x1bc74a['editing']['view']['_overlayModeHint']='auto';}}function _0xa42735(_0x288931){const _0xb7a85f=[new window['Promise'](_0x2fa843=>setTimeout(_0x2fa843,0x93ecc)),_0x20c028['then'](()=>new window['Promise'](_0x101500=>{let _0x3f4df5=0x0;_0x1bc74a['model']['on']('applyOperation',(_0x5473f5,_0x585714)=>{_0x585714[0x0]['isDocumentOperation']&&_0x3f4df5++,0x5e8==_0x3f4df5&&(_0x101500(),_0x5473f5['off']());});}))];return window['Promise']['race'](_0xb7a85f)['then'](()=>_0x288931);}async function _0x5ec1ed(){await _0x20c028,_0x1bc74a['model']['change']=_0x4bf917,_0x1bc74a['model']['enqueueChange']=_0x4bf917,_0x1bc74a['enableReadOnlyMode']('model');}function _0x8c1ea7(){return window['glob']&&window['glob']['triliumVersion'];}function _0xaadbda(_0x4f78eb){const _0x5f74a8=_0x3ecc9f();_0x1bc74a[_0x5f74a8]='tableOfContentsLicenseKey'+_0x4f78eb,'Valid'!=_0x4f78eb&&_0x5ec1ed();}function _0x3ecc9f(){const _0x502426=window['String'](window['performance']['now']())['replace']('.','');let _0x846c0b='m';for(let _0x437ce1=0x0;_0x437ce1<_0x502426['length'];_0x437ce1+=0x2){let _0x16414e=window['parseInt'](_0x502426['substring'](_0x437ce1,_0x437ce1+0x2));_0x16414e>=0x3e&&(_0x16414e-=0x3e),_0x846c0b+=_0x2e6474[_0x16414e];}return _0x846c0b;}function _0x321b3f(){const _0x31866d=_0x5e05b2['split']('.');if(0x3!=_0x31866d['length'])return null;return _0x3aa34d(_0x31866d[0x1]);function _0x3aa34d(_0x12cb10){const _0x4d8cf9=_0x2b247e(_0x12cb10);return _0x4d8cf9&&_0x5c03f9()?_0x4d8cf9:null;function _0x5c03f9(){const _0x3024e7=_0x4d8cf9['jti'],_0x15aa19=window['parseInt'](_0x3024e7['substring'](_0x3024e7['length']-0x8),0x10),_0x3a1dd0={..._0x4d8cf9,'jti':_0x3024e7['substring'](0x0,_0x3024e7['length']-0x8)};return delete _0x3a1dd0['vc'],_0x574a19(_0x3a1dd0)==_0x15aa19;}}}async function _0x3a38d8(){let _0x352843=!0x0;try{const [_0xe88dc1,_0x444964,_0x4aef3d]=_0x5e05b2['split']('.');return _0x5ddc6a(_0xe88dc1),await _0xa8751(_0xe88dc1,_0x444964,_0x4aef3d),_0x352843;}catch{return!0x1;}function _0x5ddc6a(_0x1c3ee2){const _0x305c67=_0x2b247e(_0x1c3ee2);_0x305c67&&'ES256'==_0x305c67['alg']||(_0x352843=!0x1);}async function _0xa8751(_0x19320a,_0x60740c,_0x2d685e){const _0x28f043=window['Uint8Array']['from'](_0x471657(_0x2d685e),_0x6f2a81=>_0x6f2a81['charCodeAt'](0x0)),_0x1222cb=new window['TextEncoder']()['encode'](_0x19320a+'.'+_0x60740c),_0x125d12=window['crypto']['subtle'];if(!_0x125d12)return;const _0x2c425d=await _0x125d12['importKey']('jwk',_0x29250b,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x125d12['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x2c425d,_0x28f043,_0x1222cb)||(_0x352843=!0x1);}}function _0x2b247e(_0x160714){return _0x160714['startsWith']('ey')?JSON['parse'](_0x471657(_0x160714)):null;}function _0x471657(_0x76489d){return window['atob'](_0x76489d['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x574a19(_0x1a965a){let _0x502f81=0x1505;function _0x24344b(_0x4bbc87){for(let _0x202e66=0x0;_0x202e66<_0x4bbc87['length'];_0x202e66++){const _0x2d8197=_0x4bbc87['charCodeAt'](_0x202e66);_0x502f81=(_0x502f81<<0x5)+_0x502f81+_0x2d8197,_0x502f81&=_0x502f81;}}function _0x37df1d(_0x3dd441){Array['isArray'](_0x3dd441)?_0x3dd441['forEach'](_0x37df1d):_0x3dd441&&'object'==typeof _0x3dd441?Object['entries'](_0x3dd441)['sort']()['forEach'](([_0x54be28,_0x1d9f07])=>{_0x24344b(_0x54be28),_0x37df1d(_0x1d9f07);}):_0x24344b(window['String'](_0x3dd441));}return _0x37df1d(_0x1a965a),_0x502f81>>>0x0;}function _0x4f0ccf(_0x3d6698){return _0x3d6698['toString'](0x10)['padStart'](0x8,'0');}function _0x27557d(_0x52d216){return _0x52d216['split']('')['reverse']()['join']('');}function _0x4bf917(){}_0xaadbda(await _0x1ef833());}(this);}_updateTableOfContentsElements(){this['_tableOfContentsElements']['forEach'](_0x330a6d=>{'$graveyard'!==_0x330a6d['rootName']&&this['editor']['editing']['reconvertItem'](_0x330a6d);});}_trackNewToCElements(){for(const _0x3216ac of this['editor']['model']['document']['differ']['getChanges']({'includeChangesInGraveyard':!0x0})){if('insert'!==_0x3216ac['type']||'tableOfContents'!==_0x3216ac['name'])return;this['_tableOfContentsElements']['add'](_0x3216ac['position']['nodeAfter']);}}_getOutlineDefinitions(_0xac7fdd){const _0x946dab=this['editor'],_0x124866=[];for(const _0x5a4a0d of _0x946dab['model']['document']['getRootNames']())_0x678530(_0x946dab['model']['document']['getRoot'](_0x5a4a0d));function _0x678530(_0x117821){for(const _0x4c4b15 of _0x117821['getChildren']())_0x4c4b15['is']('element')&&(_0xac7fdd['includes'](_0x4c4b15['name'])&&_0x124866['push']({'level':_0xac7fdd['indexOf'](_0x4c4b15['name'])+0x1,'text':b(_0x4c4b15),'modelElement':_0x4c4b15}),_0x678530(_0x4c4b15));}return _0x124866;}['_defineSchema'](){this['editor']['model']['schema']['register']('tableOfContents',{'inheritAllFrom':'$blockObject'});}_defineConverters(){const _0x343c45=this['editor']['conversion'];_0x343c45['for']('upcast')['elementToElement']({'model':'tableOfContents','view':{'name':'div','classes':'table-of-contents'}}),_0x343c45['for']('dataDowncast')['elementToStructure']({'model':'tableOfContents','view':(_0x593d54,{writer:_0x89e2c})=>this['_createTableOfContents'](_0x89e2c,!0x0)}),_0x343c45['for']('editingDowncast')['elementToStructure']({'model':'tableOfContents','view':(_0x2b6b02,{writer:_0xe83580})=>(this['_tableOfContentsElements']['add'](_0x2b6b02),_0x4fb51c(this['_createTableOfContents'](_0xe83580),_0xe83580,{'label':L(this['editor']['locale'],'Table\x20of\x20contents')}))}),this['editor']['data']['registerRawContentMatcher']({'name':'div','classes':'table-of-contents'}),this['editor']['editing']['mapper']['on']('viewToModelPosition',this['_redirectMapper'](),{'priority':'high'});}_createTableOfContents(_0x131f87,_0x30fe60=!0x1){const {locale:_0x56da66}=this['editor'],_0x1d1734=_0x131f87['createContainerElement']('div',{'class':'table-of-contents'+(0x0===this['_currentOutlineDefinitions']['length']?'\x20table-of-contents_empty':''),...!_0x30fe60&&{'data-table-of-contents-label':L(_0x56da66,'Table\x20of\x20contents')}});0x0===this['_currentOutlineDefinitions']['length']&&!0x1===_0x30fe60&&_0x131f87['insert'](_0x131f87['createPositionAt'](_0x1d1734,'end'),_0x131f87['createContainerElement']('p',{'class':'table-of-contents__placeholder'},[_0x131f87['createText'](L(_0x56da66,'No\x20headings\x20were\x20found\x20in\x20the\x20document.'))]));const _0x24b725=_0x30fe60?'':'['+L(_0x56da66,'Empty\x20heading')+']';let _0x122814=_0x1d1734;return this['_currentOutlineDefinitions']['forEach']((_0x29176f,_0x5de858,_0x423f64)=>{const _0x21cee6=this['editor']['model']['hasContent'](_0x29176f['modelElement'],{'ignoreWhitespaces':!0x0}),_0x100a68=_0x21cee6?_0x29176f['text']:_0x24b725,_0x2520c8=_0x29176f['modelElement']['getAttribute'](this['_headingIdModelAttributeName']),_0x1afa84=_0x131f87['createContainerElement']('a',{'href':'#'+_0x2520c8,...!_0x30fe60&&{'tabindex':'-1'}},[_0x131f87['createText'](_0x100a68)]),_0x59bd79=this['editor']['config']['get']('documentOutline.showEmptyHeadings');_0x131f87['setCustomProperty']('tableOfContentsHeadingIndex',_0x5de858,_0x1afa84);const _0x41f67a=_0x131f87['createContainerElement']('li',null,[_0x21cee6||!_0x30fe60&&_0x59bd79?_0x1afa84:_0x131f87['createText']('')]),_0x5e2a32=_0x5de858?_0x423f64[_0x5de858-0x1]['level']:0x0,_0x21b5b8=Math['abs'](_0x29176f['level']-_0x5e2a32);if(_0x29176f['level']>_0x5e2a32){const _0x1ffe08=H(_0x41f67a,_0x21b5b8,_0x131f87);_0x131f87['insert'](_0x131f87['createPositionAt'](_0x122814,'end'),_0x1ffe08);}else{const _0x1f1e0a=function(_0x509446,_0xd6c88f){return _0x509446['getAncestors']({'includeSelf':!0x0,'parentFirst':!0x0})['filter'](_0x31955f=>_0x31955f['is']('element','ol'))[_0xd6c88f];}(_0x122814,_0x21b5b8);_0x131f87['insert'](_0x131f87['createPositionAt'](_0x1f1e0a,'end'),_0x41f67a);}_0x122814=_0x41f67a;}),_0x1d1734;}['_handleScrollToHeading'](_0x5253c7){const _0x10631e=this['_currentOutlineDefinitions'][_0x5253c7]['modelElement'];this['editor']['model']['change'](_0x3fe31e=>{_0x3fe31e['setSelection'](_0x10631e,0x0);}),this['editor']['editing']['view']['scrollToTheSelection']({'alignToTop':!0x0,'forceScroll':!0x0});}_redirectMapper(){return(_0x3c7e85,_0x5dd0b5)=>{const _0x11eb3e=_0x5dd0b5['mapper'],_0x1a09a6=_0x11eb3e['findMappedViewAncestor'](_0x5dd0b5['viewPosition']),_0x229e19=_0x11eb3e['toModelElement'](_0x1a09a6);_0x229e19['is']('element','tableOfContents')&&(_0x5dd0b5['modelPosition']=this['editor']['model']['createPositionAt'](_0x229e19,0x0),_0x3c7e85['stop']());};}};function H(_0x4e0a77,_0x1969f0,_0x1f078e){return 0x1===_0x1969f0?_0x1f078e['createContainerElement']('ol',null,[_0x4e0a77]):_0x1f078e['createContainerElement']('ol',null,[_0x1f078e['createContainerElement']('li',null,[H(_0x4e0a77,_0x1969f0-0x1,_0x1f078e)])]);}var P=class extends _0x332fec{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'TableOfContentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0xe17dc9=this['editor'];_0xe17dc9['ui']['componentFactory']['add']('tableOfContents',()=>{const _0x219ed7=this['_createButton'](_0x403f21);return _0x219ed7['tooltip']=!0x0,_0x219ed7;}),_0xe17dc9['ui']['componentFactory']['add']('menuBar:tableOfContents',()=>this['_createButton'](_0x4ff28e)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x515421=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x34b3e7;for(const _0x71d743 in _0x515421){const _0x4b0627=_0x71d743,_0x4e46d8=_0x515421[_0x4b0627];if('tableOfContentsLicenseKeyValid'==_0x4e46d8||'tableOfContentsLicenseKeyInvalid'==_0x4e46d8||'tableOfContentsLicenseKeyExpired'==_0x4e46d8||'tableOfContentsLicenseKeyDomainLimit'==_0x4e46d8||'tableOfContentsLicenseKeyNotAllowed'==_0x4e46d8||'tableOfContentsLicenseKeyEvaluationLimit'==_0x4e46d8||'tableOfContentsLicenseKeyUsageLimit'==_0x4e46d8){delete _0x515421[_0x4b0627],_0x34b3e7=_0x4e46d8,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'tableOfContentsLicenseKeyInvalid'==_0x34b3e7&&_0x515421['_showLicenseError']('invalid'),'tableOfContentsLicenseKeyExpired'==_0x34b3e7&&_0x515421['_showLicenseError']('expired'),'tableOfContentsLicenseKeyDomainLimit'==_0x34b3e7&&_0x515421['_showLicenseError']('domainLimit'),'tableOfContentsLicenseKeyNotAllowed'==_0x34b3e7&&_0x515421['_showLicenseError']('featureNotAllowed','TableOfContents'),'tableOfContentsLicenseKeyEvaluationLimit'==_0x34b3e7&&_0x515421['_showLicenseError']('evaluationLimit'),'tableOfContentsLicenseKeyUsageLimit'==_0x34b3e7&&_0x515421['_showLicenseError']('usageLimit');},0x3e8);}_createButton(_0x5825b1){const _0xd257f6=this['editor'],_0x2638da=_0xd257f6['locale'],_0x2c2707=_0xd257f6['commands']['get']('insertTableOfContents'),_0x1e0bae=new _0x5825b1(_0x2638da);return _0x1e0bae['set']({'label':L(_0x2638da,'Table\x20of\x20contents'),'icon':_0x2f4dfc}),_0x1e0bae['bind']('isEnabled')['to'](_0x2c2707,'isEnabled'),this['listenTo'](_0x1e0bae,'execute',()=>{_0xd257f6['execute']('insertTableOfContents'),_0xd257f6['editing']['view']['focus']();}),_0x1e0bae;}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}},U=class extends _0x332fec{static get requires(){return[N,P];}static get['pluginName'](){return'TableOfContents';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{E as DocumentOutline,x as DocumentOutlineUI,I as DocumentOutlineUtils,A as HeadingId,U as TableOfContents,K as TableOfContentsCommand,N as TableOfContentsEditing,P as TableOfContentsUI};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-document-outline",
3
- "version": "48.4.0-alpha.4",
3
+ "version": "48.4.0-alpha.5",
4
4
  "description": "Document outline feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -21,13 +21,13 @@
21
21
  "./package.json": "./package.json"
22
22
  },
23
23
  "dependencies": {
24
- "@ckeditor/ckeditor5-core": "48.4.0-alpha.4",
25
- "@ckeditor/ckeditor5-engine": "48.4.0-alpha.4",
26
- "@ckeditor/ckeditor5-heading": "48.4.0-alpha.4",
27
- "@ckeditor/ckeditor5-icons": "48.4.0-alpha.4",
28
- "@ckeditor/ckeditor5-ui": "48.4.0-alpha.4",
29
- "@ckeditor/ckeditor5-utils": "48.4.0-alpha.4",
30
- "@ckeditor/ckeditor5-widget": "48.4.0-alpha.4",
24
+ "@ckeditor/ckeditor5-core": "48.4.0-alpha.5",
25
+ "@ckeditor/ckeditor5-engine": "48.4.0-alpha.5",
26
+ "@ckeditor/ckeditor5-heading": "48.4.0-alpha.5",
27
+ "@ckeditor/ckeditor5-icons": "48.4.0-alpha.5",
28
+ "@ckeditor/ckeditor5-ui": "48.4.0-alpha.5",
29
+ "@ckeditor/ckeditor5-utils": "48.4.0-alpha.5",
30
+ "@ckeditor/ckeditor5-widget": "48.4.0-alpha.5",
31
31
  "es-toolkit": "1.45.1"
32
32
  },
33
33
  "files": [