@ckeditor/ckeditor5-pagination 49.0.0-alpha.3 → 49.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x36fc84}from'@ckeditor/ckeditor5-core';import{ButtonView as _0x408562,InputNumberView as _0x41ccf8,View as _0x4b6bbf}from'@ckeditor/ckeditor5-ui';import{Rect as _0x28c4f2,ResizeObserver as _0x471439,env as _0x3d02c4,findClosestScrollableAncestor as _0x1172bf,first as _0x2b15b6,getParentElement as _0x261bed,getParentNode as _0xebc1a5,getPositionedAncestor as _0x4ba23b,global as _0x1dbfac,keyCodes as _0x502e90,logWarning as _0x41a087,toUnit as _0x3adac8,uid as _0x513d17}from'@ckeditor/ckeditor5-utils';import{debounce as _0x46256f}from'es-toolkit/compat';import{IconArrowDown as _0x2e77e2,IconArrowUp as _0x2e76dc}from'@ckeditor/ckeditor5-icons';var v=class extends _0x36fc84{_recalculatePageBreaksDebounced=_0x46256f(()=>this['_recalculatePageBreaks'](),0xc8);_pagesContainer=null;static get['pluginName'](){return'PaginationLookup';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){if(this['set']({'pageBreaks':[]}),!this['editor']['config']['get']('pagination'))return void _0x41a087('pagination-config-not-found',this['editor']['config']);const _0x106b0f=this['editor']['plugins']['get']('PaginationEditing');this['bind']('isEnabled')['to'](_0x106b0f),this['editor']['ui']['once']('ready',()=>this['_onUiReady']()),this['on']('change:isEnabled',(_0x5623a6,_0x17e0a6,_0x1f8246)=>{_0x1f8246&&this['_recalculatePageBreaksDebounced']();});}afterInit(){!async function(_0x52610c){const _0xc00162='vsmL4TPpuR53MlqSj2VXwH9oEAN8FxJtGUOdbDCZ01ihyfkBQY6acgz7rIeWKn',_0x3a1147=0x79758,_0x15f1f5={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x950d77(_0x48a894){const _0x3da3cd=new window['Promise'](_0x376d6e=>{_0x48a894['once']('ready',_0x376d6e);}),_0x4ac539=window['Date']['now'](),_0x5400f3=_0x48a894['config']['get']('licenseKey');async function _0x571017(){let _0x27e2ba,_0x58a850=null,_0x1d128f=null;try{return'GPL'==_0x5400f3?'NotAllowed':(_0x27e2ba=_0x40f0a2(),_0x27e2ba?(_0x27e2ba['usageEndpoint']&&(_0x1d128f=_0x31094e(_0x27e2ba['usageEndpoint'],_0x27e2ba['jti'])),await _0x1bc54b()?_0x576fc2()?_0xb0a57f()?'Expired':_0x17cbe3()?('evaluation'==_0x27e2ba['licenseType']&&(_0x58a850=_0x52970f('EvaluationLimit')),await _0x3b15fb()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0xb0a57f(){const _0xca384=['evaluation','trial']['includes'](_0x27e2ba['licenseType'])?_0x4ac539/0x3e8:0xe10*_0x3a1147;return _0x27e2ba['exp']<_0xca384;}function _0x576fc2(){const _0x4e34b4=_0x27e2ba['features'];return!!_0x4e34b4&&(!!_0x4e34b4['includes']('*')||!!_0x4e34b4['includes']('PAG'));}function _0x17cbe3(){const _0xcd991e=_0x27e2ba['licensedHosts'];if(!_0xcd991e||0x0==_0xcd991e['length'])return!0x0;const {hostname:_0x39a712}=new URL(window['location']['href']);if(_0xcd991e['includes'](_0x39a712))return!0x0;const _0x517c33=_0x39a712['split']('.');return _0xcd991e['filter'](_0x4f00d=>_0x4f00d['includes']('*'))['map'](_0x3f8b9f=>_0x3f8b9f['split']('.'))['filter'](_0x26fe3c=>_0x26fe3c['length']<=_0x517c33['length'])['map'](_0x20cd5f=>Array(_0x517c33['length']-_0x20cd5f['length'])['fill']('*'===_0x20cd5f[0x0]?'*':'')['concat'](_0x20cd5f))['some'](_0xf34d9=>_0x517c33['every']((_0x37b851,_0x16abf4)=>_0xf34d9[_0x16abf4]===_0x37b851||'*'===_0xf34d9[_0x16abf4]));}function _0x3b15fb(){return _0x58a850&&_0x1d128f?new window['Promise']((_0x5960df,_0x325ff2)=>{_0x58a850['then'](_0x5960df,_0x325ff2),_0x1d128f['then'](_0x2e855b=>{'Valid'!=_0x2e855b&&_0x5960df(_0x2e855b);},_0x325ff2);}):_0x58a850||_0x1d128f||'Valid';}}function _0x31094e(_0x5bb19e,_0x15794f){return new window['Promise'](_0x13f0d9=>{if(_0x74751())return _0x13f0d9('Valid');_0x2cdc5f(),_0x48a894['decorate']('_sendUsageRequest');let _0x340349=!0x1;const _0x3d221f=_0x513d17();function _0x1dfa85(_0x1c2427){return!!_0x1c2427&&('object'==typeof _0x1c2427||'function'==typeof _0x1c2427)&&'function'==typeof _0x1c2427['then']&&'function'==typeof _0x1c2427['catch'];}function _0x13d9b4(_0x598095){_0x23e406(_0x598095)['then'](_0xba52d3=>_0xba52d3&&'ok'==_0xba52d3['status']?_0x1c9e8c(_0x1a098a(_0x3d221f+_0x15794f))!=_0xba52d3['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x100f21=>(_0x134dce(),_0x100f21),()=>{const _0x1fdd4c=_0x1c6c1e();return null==_0x1fdd4c?(_0x134dce(),'Valid'):_0x4ac539-_0x1fdd4c>0x240c8400?'UsageLimit':'Valid';})['then'](_0x13f0d9)['catch'](()=>{_0x13f0d9('UsageLimit');});const _0x45a148=0x36ee80;function _0x134dce(){const _0x3490f4='llct-'+_0x1c9e8c(_0x1a098a(_0x5bb19e)),_0x430ff1=_0x46c9a9(_0x1c9e8c(window['Math']['ceil'](_0x4ac539/_0x45a148)));window['localStorage']['setItem'](_0x3490f4,_0x430ff1);}function _0x1c6c1e(){const _0x4fd89a='llct-'+_0x1c9e8c(_0x1a098a(_0x5bb19e)),_0x34acd2=window['localStorage']['getItem'](_0x4fd89a);return _0x34acd2?window['parseInt'](_0x46c9a9(_0x34acd2),0x10)*_0x45a148:null;}function _0x23e406(_0x4df195){return new window['Promise']((_0x4be6b5,_0x54cf3f)=>{_0x4df195['then'](_0x4be6b5,_0x54cf3f),window['setTimeout'](_0x54cf3f,0x1d4c0);});}}_0x48a894['on']('_sendUsageRequest',(_0x45a98c,_0x2143d2)=>{if(_0x2143d2[0x0]!=_0x5bb19e)return _0x13f0d9('UsageLimit');_0x2143d2[0x1]={..._0x2143d2[0x1],'requestId':_0x3d221f};},{'priority':'high'}),_0x48a894['on']('_sendUsageRequest',_0x2d7172=>{_0x1dfa85(_0x2d7172['return'])&&(_0x340349=!0x0,_0x13d9b4(_0x2d7172['return']));},{'priority':'low'}),_0x3da3cd['then'](()=>{_0x340349||_0x13f0d9('UsageLimit');});});function _0x74751(){return'auto'==_0x48a894['editing']['view']['_overlayModeHint'];}function _0x2cdc5f(){_0x48a894['editing']['view']['_overlayModeHint']='auto';}}function _0x52970f(_0x397fa0){const _0x4669dd=[new window['Promise'](_0x4fd666=>setTimeout(_0x4fd666,0x93ecc)),_0x3da3cd['then'](()=>new window['Promise'](_0x338eee=>{let _0x20d67e=0x0;_0x48a894['model']['on']('applyOperation',(_0x1b84f6,_0x44d164)=>{_0x44d164[0x0]['isDocumentOperation']&&_0x20d67e++,0x5e8==_0x20d67e&&(_0x338eee(),_0x1b84f6['off']());});}))];return window['Promise']['race'](_0x4669dd)['then'](()=>_0x397fa0);}async function _0x5808f5(){await _0x3da3cd,_0x48a894['model']['change']=_0x163b5f,_0x48a894['model']['enqueueChange']=_0x163b5f,_0x48a894['enableReadOnlyMode']('model');}function _0xcc1d06(_0x4d4cf3){const _0x454352=_0x485d0f();_0x48a894[_0x454352]='paginationLicenseKey'+_0x4d4cf3,'Valid'!=_0x4d4cf3&&_0x5808f5();}function _0x485d0f(){const _0x28188c=window['String'](window['performance']['now']())['replace']('.','');let _0x1be040='v';for(let _0x49d51c=0x0;_0x49d51c<_0x28188c['length'];_0x49d51c+=0x2){let _0x5b8f43=window['parseInt'](_0x28188c['substring'](_0x49d51c,_0x49d51c+0x2));_0x5b8f43>=0x3e&&(_0x5b8f43-=0x3e),_0x1be040+=_0xc00162[_0x5b8f43];}return _0x1be040;}function _0x40f0a2(){const _0x58477e=_0x5400f3['split']('.');if(0x3!=_0x58477e['length'])return null;return _0x4fa90e(_0x58477e[0x1]);function _0x4fa90e(_0x1b5c4d){const _0x47d1ab=_0x5a7da2(_0x1b5c4d);return _0x47d1ab&&_0x254a6e()?_0x47d1ab:null;function _0x254a6e(){const _0xa523cf=_0x47d1ab['jti'],_0x359080=window['parseInt'](_0xa523cf['substring'](_0xa523cf['length']-0x8),0x10),_0x26230a={..._0x47d1ab,'jti':_0xa523cf['substring'](0x0,_0xa523cf['length']-0x8)};return delete _0x26230a['vc'],_0x1a098a(_0x26230a)==_0x359080;}}}async function _0x1bc54b(){let _0x28abd3=!0x0;try{const [_0x2df935,_0x51bf02,_0x55ada6]=_0x5400f3['split']('.');return _0x3c254e(_0x2df935),await _0x5091dc(_0x2df935,_0x51bf02,_0x55ada6),_0x28abd3;}catch{return!0x1;}function _0x3c254e(_0x174dee){const _0x4add1f=_0x5a7da2(_0x174dee);_0x4add1f&&'ES256'==_0x4add1f['alg']||(_0x28abd3=!0x1);}async function _0x5091dc(_0xa06246,_0x4f2f48,_0x1e89a3){const _0x51f3c5=window['Uint8Array']['from'](_0x4739e5(_0x1e89a3),_0x53d9b6=>_0x53d9b6['charCodeAt'](0x0)),_0x324bfd=new window['TextEncoder']()['encode'](_0xa06246+'.'+_0x4f2f48),_0x3b058d=window['crypto']['subtle'];if(!_0x3b058d)return;const _0x43e883=await _0x3b058d['importKey']('jwk',_0x15f1f5,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3b058d['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x43e883,_0x51f3c5,_0x324bfd)||(_0x28abd3=!0x1);}}function _0x5a7da2(_0x22d9d4){return _0x22d9d4['startsWith']('ey')?JSON['parse'](_0x4739e5(_0x22d9d4)):null;}function _0x4739e5(_0x2c7e1c){return window['atob'](_0x2c7e1c['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x1a098a(_0x2fac28){let _0x19b7ef=0x1505;function _0x3f52d1(_0x4c3437){for(let _0x5e74b8=0x0;_0x5e74b8<_0x4c3437['length'];_0x5e74b8++){const _0x36d2ac=_0x4c3437['charCodeAt'](_0x5e74b8);_0x19b7ef=(_0x19b7ef<<0x5)+_0x19b7ef+_0x36d2ac,_0x19b7ef&=_0x19b7ef;}}function _0x3a0006(_0x121e9a){Array['isArray'](_0x121e9a)?_0x121e9a['forEach'](_0x3a0006):_0x121e9a&&'object'==typeof _0x121e9a?Object['entries'](_0x121e9a)['sort']()['forEach'](([_0x37f823,_0x1127d2])=>{_0x3f52d1(_0x37f823),_0x3a0006(_0x1127d2);}):_0x3f52d1(window['String'](_0x121e9a));}return _0x3a0006(_0x2fac28),_0x19b7ef>>>0x0;}function _0x1c9e8c(_0x3bc64){return _0x3bc64['toString'](0x10)['padStart'](0x8,'0');}function _0x46c9a9(_0x5dc29c){return _0x5dc29c['split']('')['reverse']()['join']('');}function _0x163b5f(){}_0xcc1d06(await _0x571017());}_0x950d77(_0x52610c['editor']);}(this);}destroy(){super['destroy'](),this['_recalculatePageBreaksDebounced']['cancel'](),this['_pagesContainer']&&(this['_pagesContainer']['destroy'](),this['_pagesContainer']['element']['remove']());}['_onUiReady'](){const _0x57f1e1=this['editor'],_0x4f439c=_0x57f1e1['editing']['view'],_0x39344d=this['_getAttachedDomRoot']();if(!_0x39344d||!_0x39344d['hasChildNodes']())return void _0x57f1e1['ui']['once']('update',()=>this['_onUiReady']());const {pageWidth:_0x324209,pageHeight:_0x340dba}=_0x57f1e1['config']['get']('pagination'),{top:_0x56b866,left:_0x4196e6,bottom:_0x595f73,right:_0x1a107c}=this['_configuredPaddings'];this['_pagesContainer']=new _0x4b6bbf(_0x57f1e1['locale']);const _0x3b8e74=this['_pagesContainer'];_0x3b8e74['set']('class',''),_0x3b8e74['setTemplate']({'tag':'div','attributes':{'style':{'columnWidth':_0x324209,'width':_0x324209,'height':'calc(\x20'+_0x340dba+'\x20-\x20'+_0x56b866+'\x20-\x20'+_0x595f73+'\x20+\x200.5mm\x20)','minWidth':'auto','minHeight':'auto','padding':'0\x20'+_0x1a107c+'\x200\x20'+_0x4196e6,'columnGap':'calc('+_0x4196e6+'\x20+\x20'+_0x1a107c+'\x20+\x20100px)','border':0x0,'boxSizing':'border-box','columnCount':'auto','columnFill':'auto','overflow':'hidden','position':'absolute','top':'-99999px','left':'-99999px'},'class':_0x3b8e74['bindTemplate']['to']('class')}}),_0x3b8e74['render'](),_0xebc1a5(_0x39344d)['insertBefore'](_0x3b8e74['element'],_0x39344d['nextSibling']),this['listenTo'](_0x4f439c,'render',()=>this['_recalculatePageBreaksDebounced'](),{'priority':'low'}),this['_recalculatePageBreaksDebounced']();}_getAttachedDomRoot(){for(const _0x395aa6 of this['editor']['editing']['view']['domRoots']['values']())if(_0x395aa6['isConnected'])return _0x395aa6;return null;}_recalculatePageBreaks(){if(!this['isEnabled'])return Promise['resolve']();const _0x2e5edd=this['editor']['editing']['view'],_0x1b930e=this['_pagesContainer'],_0x597912=this['_getAttachedDomRoot']();if(!_0x597912||!_0x1b930e)return Promise['resolve']();for(_0x1b930e['class']=['ck-reset','ck-pagination-view',..._0x597912['classList']]['join']('\x20');_0x1b930e['element']['firstChild'];)_0x1b930e['element']['firstChild']['remove']();const _0x1d6e02=Array['from'](_0x2e5edd['domRoots']);_0x1d6e02['sort'](([,_0xdb215d],[,_0x5d97cb])=>_0xdb215d['compareDocumentPosition'](_0x5d97cb)==Node['DOCUMENT_POSITION_PRECEDING']?0x1:-0x1);for(const [_0x5650f4,_0x53fb80]of _0x1d6e02){const _0xed074c=_0x53fb80['cloneNode'](!0x0);'attributeStyleMap'in _0xed074c&&_0xed074c['attributeStyleMap']['clear'](),_0xed074c['dataset']['rootName']=_0x5650f4,_0xed074c['className']='ck-content\x20ck-pagination_enabled',_0xed074c['removeAttribute']('id'),_0xed074c['tabIndex']=-0x1,_0x1b930e['element']['append'](_0xed074c);}const _0x461794=Array['from'](_0x1b930e['element']['querySelectorAll']('img'));return function(_0x274542){return Promise['all'](_0x274542['map'](_0x132836=>Promise['race']([N(_0x132836),_(0x3e8)])));}(_0x461794)['then'](()=>{for(const _0x433473 of _0x461794['filter'](_0x51ff14=>!_0x51ff14['closest']('table')))if(_0x433473['offsetParent']){const _0x3e845c=_0x1dbfac['window']['getComputedStyle'](_0x433473),_0x5534d7=_0x1dbfac['document']['createElement']('span');for(const _0x39ec3f of _0x3e845c)_0x5534d7['style']['setProperty'](_0x39ec3f,_0x3e845c[_0x39ec3f]);_0x5534d7['style']['backgroundImage']='url(\x20'+_0x433473['src']+'\x20)',_0x5534d7['style']['breakInside']='avoid','PICTURE'==_0x433473['parentElement']?.['tagName']?_0x433473['parentElement']['replaceWith'](_0x5534d7):_0x433473['replaceWith'](_0x5534d7);}return new Promise(_0x18f438=>_0x1dbfac['window']['requestAnimationFrame'](()=>_0x18f438()));})['then'](()=>{this['_updatePageBreaksData']();});}_updatePageBreaksData(){const _0x2c0e45=this['_pagesContainer']['element'];if(!_0x2c0e45['isConnected'])return;const _0x2d287c=new _0x28c4f2(_0x2c0e45)['excludeScrollbarsAndBorders'](),_0x4a6f6a=Math['floor'](_0x2d287c['width']+0x64),_0x2b4fe7=I(_0x2c0e45,Math['floor'](_0x2d287c['left']-_0x2c0e45['scrollLeft']),_0x4a6f6a,_0x2d287c['height'])['map'](_0x258586=>this['_mapPageStarterInfoToPageBreakInfo'](_0x258586))['filter'](_0x2cacf0=>!0x1!==_0x2cacf0);_0x2b4fe7['every'](_0x28c7c6=>!!_0x28c7c6)&&(this['pageBreaks']=_0x2b4fe7);}_mapPageStarterInfoToPageBreakInfo(_0x2ea9fc){const _0x37b610=this['editor']['editing']['view'],_0x566244=this['editor']['editing']['mapper'],_0x4482d7=_0x37b610['domConverter'],_0x275b6e=_0x2ea9fc['path']['shift'](),_0x3ef506=this['_pagesContainer']['element']['childNodes'][_0x275b6e]['dataset']['rootName'],_0x25ec28=_0x37b610['getDomRoot'](_0x3ef506);if(!_0x25ec28)return null;const _0x287251=function(_0x32d4b4,_0x39c00a){let _0x5c733c=_0x32d4b4;for(const _0x17f2b of _0x39c00a['path']){if(!_0x5c733c)return null;_0x5c733c=_0x5c733c['childNodes'][_0x17f2b];}return _0x5c733c;}(_0x25ec28,_0x2ea9fc);if(!_0x287251)return null;const _0x29f356=_0x4482d7['domPositionToView'](_0x287251,_0x2ea9fc['textOffset']||0x0);return _0x29f356?'manual'==_0x2ea9fc['type']?this['_mapManualPageStarterInfoToPageBreakInfo'](_0x29f356,_0x287251):'text'==_0x2ea9fc['type']&&_0x566244['toModelPosition'](_0x29f356)['offset']?this['_mapTextPageStarterInfoToPageBreakInfo'](_0x29f356,_0x287251,_0x2ea9fc['textOffset']):this['_mapElementPageStarterInfoToPageBreakInfo'](_0x29f356,_0x287251,_0x2ea9fc['offset']):null;}_mapManualPageStarterInfoToPageBreakInfo(_0x5f0b41,_0x41b916){const _0x3be512=this['editor']['model'],_0x42423a=this['editor']['editing']['mapper']['toModelElement'](_0x5f0b41['parent']),_0x339042=_0x3be512['createRangeOn'](_0x42423a);return new k({'type':'manual','modelRange':_0x339042,'domNode':_0x41b916,'offset':0x0});}_mapTextPageStarterInfoToPageBreakInfo(_0xc82eb2,_0x293bb3,_0x4df9c3){const _0x48db0b=this['editor']['model'],_0xa62035=this['editor']['editing']['mapper'],_0x2be015=this['editor']['editing']['view']['domConverter'];if(_0x4df9c3>=_0x293bb3['length'])return null;const _0x2c4e4b=_0xa62035['toModelPosition'](_0xc82eb2),_0x153ca7=_0x48db0b['createRange'](_0x2c4e4b),_0x4381b6=_0xa62035['findMappedViewAncestor'](_0xc82eb2),_0xb65685=_0x2be015['mapViewToDom'](_0x4381b6);return new k({'type':'text','modelRange':_0x153ca7,'domNode':_0x293bb3,'offset':L(_0x293bb3,_0x4df9c3,_0xb65685)});}_mapElementPageStarterInfoToPageBreakInfo(_0x3f8307,_0x5261e7,_0x340f2d){const _0xd485e1=this['editor']['model'],_0x418b9e=this['editor']['editing'],_0x11daef=_0x418b9e['mapper'],_0x15b950=_0x418b9e['view']['domConverter'],_0x29c3aa=_0x11daef['findMappedViewAncestor'](_0x3f8307),_0x4cf7f4=_0x11daef['toModelElement'](_0x29c3aa);if(!_0x4cf7f4||_0x4cf7f4['is']('rootElement'))return!0x1;const _0x5f4f97=function(_0x27a6b3){const _0x2f22f6=_0x27a6b3['parent'],_0x2c19ad=_0x2f22f6['root']['document']['model'],_0x34a38f=_0x2f22f6['getAncestors']({'parentFirst':!0x0,'includeSelf':!0x0});let _0x928c05=null;for(const _0x3e5992 of _0x34a38f){if(_0x3e5992['is']('rootElement'))return _0x928c05;if(!_0x2c19ad['createPositionBefore'](_0x3e5992)['isTouching'](_0x27a6b3))return _0x928c05;_0x928c05=_0x3e5992;}}(_0xd485e1['createPositionBefore'](_0x4cf7f4))||_0x4cf7f4;let _0x19ad5c=_0x11daef['toViewElement'](_0x5f4f97),_0x1f011a=_0xd485e1['createRangeOn'](_0x5f4f97);const _0x3895fa=_0xd485e1['createPositionBefore'](_0x5f4f97)['nodeBefore'];if(_0x3895fa&&_0x3895fa['is']('element','imageBlock')){const _0xdc016=_0x11daef['toViewElement'](_0x3895fa),_0x5c15f0=_0x15b950['mapViewToDom'](_0xdc016),_0x52701e=_0x1dbfac['window']['getComputedStyle'](_0x5c15f0)['float'];'left'!=_0x52701e&&'right'!=_0x52701e||(_0x1f011a=_0xd485e1['createRangeOn'](_0x3895fa));}for(;_0x19ad5c['parent']!==_0x19ad5c['root']&&0x0===_0x19ad5c['index'];)_0x19ad5c=_0x19ad5c['parent'];const _0x2d519c=new _0x28c4f2(C(_0x5261e7)?_0x5261e7:E(_0x5261e7)),_0x199fcd=_0x340f2d?_0x2d519c['height']-_0x340f2d:0x0,_0x2dd93b=_0x15b950['mapViewToDom'](_0x19ad5c),_0x2bcdc6=new _0x28c4f2(_0x2dd93b);return new k({'type':'element','modelRange':_0x1f011a,'domNode':_0x2dd93b,'offset':Math['round'](_0x199fcd)||_0x29c3aa!=x(_0x3f8307)?_0x199fcd+_0x2d519c['top']-_0x2bcdc6['top']:0x0});}get['_configuredPaddings'](){const _0x3196e2=this['editor']['config']['get']('pagination.pageMargins');return Object['assign']({'top':'10mm','bottom':'10mm','left':'10mm','right':'10mm'},_0x3196e2);}static _findPageStarterInfos(_0x43a5e5,_0x4dec19,_0x28656b,_0x53f3c2,_0x20c8f6){return I(_0x43a5e5,_0x4dec19,_0x28656b,_0x53f3c2,_0x20c8f6);}},k=class{type;['modelRange'];['_domNode'];_offset;constructor({type:_0x1141f5,modelRange:_0x4e0c8f,domNode:_0x285cc0,offset:_0x3e6229}){this['type']=_0x1141f5,this['modelRange']=_0x4e0c8f,this['_domNode']=_0x285cc0,this['_offset']=_0x3e6229;}get offset(){if(!this['_domNode']['isConnected'])return 0x0;const _0x375901=new _0x28c4f2(C(this['_domNode'])?this['_domNode']:E(this['_domNode']));return'manual'==this['type']?_0x375901['top']+_0x375901['height']/0x2:_0x375901['top']+this['_offset'];}};function L(_0x4aecbf,_0x58129c,_0x1afe1a){const _0x4101ae=E(_0x4aecbf),_0x5b3c2a=function(_0x2d98a5){const _0x3f0f2b=_0x1dbfac['document']['createRange']();return _0x3f0f2b['selectNodeContents'](_0x2d98a5),_0x3f0f2b;}(_0x1afe1a);let _0x18cb8d;if(0x0==_0x58129c){const _0x534c0f=_0xebc1a5(_0x4aecbf);_0x18cb8d=R(_0x5b3c2a['startContainer'],_0x5b3c2a['startOffset'],_0x534c0f,Array['from'](_0x534c0f['childNodes'])['indexOf'](_0x4aecbf));}else _0x18cb8d=R(_0x5b3c2a['startContainer'],_0x5b3c2a['startOffset'],_0x4aecbf,_0x58129c);const _0x59659b=R(_0x4aecbf,_0x58129c,_0x5b3c2a['endContainer'],_0x5b3c2a['endOffset']),_0x1c9aa0=new _0x28c4f2(_0x18cb8d)['bottom'];return(new _0x28c4f2(_0x59659b)['top']+_0x1c9aa0)/0x2-new _0x28c4f2(_0x4101ae)['top'];}function x(_0x498b90){let _0x12e275=_0x498b90['parent'];for(;_0x12e275['is']('$text')||_0x12e275['is']('attributeElement');)_0x12e275=_0x12e275['parent'];return _0x12e275;}function N(_0x5eded9){return _0x5eded9['hasAttribute']('width')&&_0x5eded9['hasAttribute']('height')?Promise['resolve']():new Promise(_0x343764=>{function _0x1c36f0(){_0x5eded9['removeEventListener']('load',_0x1c36f0),_0x5eded9['removeEventListener']('error',_0x1c36f0),_0x343764();}_0x5eded9['complete']?_0x343764():(_0x5eded9['addEventListener']('load',_0x1c36f0),_0x5eded9['addEventListener']('error',_0x1c36f0));});}function _(_0x28cc63){return new Promise(_0x55dfd0=>setTimeout(_0x55dfd0,_0x28cc63));}function E(_0x4d6d7e){const _0x515a06=_0x1dbfac['document']['createRange']();return _0x515a06['selectNode'](_0x4d6d7e),_0x515a06;}function S(_0x3b279d,_0x5c571d,_0x34cbfa){const _0x5de5d2=_0x1dbfac['document']['createRange']();return _0x5de5d2['setStart'](_0x3b279d,_0x5c571d),_0x5de5d2['setEnd'](_0x3b279d,_0x34cbfa),_0x5de5d2;}function R(_0xe299d0,_0x595b09,_0x4d6cdc,_0x4aee1c){const _0x4aa4a1=_0x1dbfac['document']['createRange']();return _0x4aa4a1['setStart'](_0xe299d0,_0x595b09),_0x4aa4a1['setEnd'](_0x4d6cdc,_0x4aee1c),_0x4aa4a1;}function I(_0x103e1d,_0x264989,_0x7e69a3,_0x22b0fa,_0x1ba3c0){const _0x190da6=[];for(const [_0x42aaf3,_0x112928]of _0x103e1d['childNodes']['entries']()){let _0xbf35fe=[];C(_0x112928)&&_0x112928['offsetParent']&&['static','relative']['includes'](_0x1dbfac['window']['getComputedStyle'](_0x112928)['position'])?_0xbf35fe=K(_0x112928,_0x42aaf3,_0x264989,_0x7e69a3,_0x22b0fa,_0x1ba3c0):D(_0x112928)&&(_0xbf35fe=A(_0x112928,_0x42aaf3,_0x264989,_0x7e69a3,_0x1ba3c0)),_0xbf35fe['length']&&(_0x190da6['push'](..._0xbf35fe),_0x264989+=_0xbf35fe['length']*_0x7e69a3,_0x1ba3c0=!0x1);}return _0x190da6;}function K(_0x4f16f1,_0x11e262,_0x3c9a7a,_0x2dda2e,_0x551010,_0x20311b){const _0x333cc3=[];var _0x4049e5;if((_0x4049e5=_0x4f16f1['previousSibling'])&&C(_0x4049e5)&&Boolean(_0x4049e5['classList']['contains']('page-break')||_0x4049e5['closest']('.page-break'))&&(_0x333cc3['push']({'type':'manual','offset':0x0,'path':[_0x11e262-0x1]}),_0x20311b=!0x0),'table-row'==_0x1dbfac['window']['getComputedStyle'](_0x4f16f1)['display']){let _0x20b16e=0x0,_0x20a569=!0x1;for(const _0xf6c12a of _0x4f16f1['getClientRects']())_0x20b16e+=_0xf6c12a['height'],_0xf6c12a['left']>=_0x3c9a7a&&(_0x20a569=!0x0);if(_0x20b16e<_0x551010&&_0x20a569)return _0x20311b||_0x333cc3['push']({'type':'element','offset':0x0,'path':[_0x11e262]}),_0x333cc3;}const _0x27a8d2=_0x4f16f1['closest']('figure.image');if(_0x27a8d2&&function(_0x58dc10){let _0x5de178=!0x1;const _0x2b04ef=_0x261bed(_0x58dc10)['dataset']['rootName'],_0x43fb60=_0x58dc10['nextElementSibling'],_0x53c5b0=_0x58dc10['previousElementSibling'],_0x3c330d=_0x43fb60&&_0x1dbfac['window']['getComputedStyle'](_0x43fb60)['float'],_0x5390d1=_0x43fb60&&'ck-fake-selection-container'===_0x43fb60['className'];return!_0x2b04ef||_0x43fb60||_0x53c5b0||(_0x5de178=!0x0),_0x2b04ef&&!_0x53c5b0&&_0x5390d1&&(_0x5de178=!0x0),_0x2b04ef&&!_0x53c5b0&&'none'!==_0x3c330d&&(_0x5de178=!0x0),!_0x5de178;}(_0x27a8d2)){const _0x465e4e=_0x1dbfac['window']['getComputedStyle'](_0x27a8d2)['float'];if('left'==_0x465e4e||'right'==_0x465e4e)return _0x333cc3;}const _0x4f133f=I(_0x4f16f1,_0x3c9a7a,_0x2dda2e,_0x551010,_0x20311b);if(_0x4f133f['length']){for(const _0x1da14f of _0x4f133f)_0x333cc3['push']({'type':_0x1da14f['type'],'offset':_0x1da14f['offset'],'textOffset':_0x1da14f['textOffset'],'path':[_0x11e262,..._0x1da14f['path']]}),_0x3c9a7a+=_0x2dda2e;return _0x333cc3;}return _0x333cc3['push'](...function(_0x4aeb02,_0x2480bf,_0x18101,_0x8f9bd2,_0x5e3ab7){const _0x211594=[];if('table-cell'==_0x1dbfac['window']['getComputedStyle'](_0x4aeb02)['display'])return[];const _0x19c7c9=[];for(const _0x3014b0 of _0x4aeb02['getClientRects']())if(_0x3014b0['left']>=_0x18101){for(const _0x1f2b4b of _0x19c7c9)_0x1f2b4b['height']+=_0x3014b0['height'];_0x19c7c9['push']({'height':_0x3014b0['height']}),_0x18101+=_0x8f9bd2;}for(const _0x3625b1 of _0x19c7c9)_0x5e3ab7||_0x211594['push']({'type':'element','offset':_0x3625b1['height'],'textOffset':0x0,'path':[_0x2480bf]}),_0x5e3ab7=!0x1;return _0x211594;}(_0x4f16f1,_0x11e262,_0x3c9a7a,_0x2dda2e,_0x20311b)),_0x333cc3;}function A(_0x5eb435,_0x3e0bfc,_0x17f9a5,_0x5e28cb,_0x904b63){const _0x14e79b=E(_0x5eb435),_0x3c30a3=[];let _0x53454a=0x0;for(const _0x1503f9 of _0x14e79b['getClientRects']())if(_0x1503f9['left']>=_0x17f9a5){const _0x151028=O(_0x5eb435,_0x53454a,_0x17f9a5,_0x5e28cb);_0x904b63||_0x3c30a3['push']({'type':'text','path':[_0x3e0bfc],'textOffset':_0x151028}),_0x53454a=_0x151028,_0x17f9a5+=_0x5e28cb,_0x904b63=!0x1;}return _0x3c30a3;}function O(_0x5d80a4,_0x423cb3,_0x57887f,_0x10759c){let _0x4939ff=_0x423cb3,_0x209241=_0x5d80a4['length'];for(;_0x209241-_0x4939ff>0x1;){const _0x5a5f37=Math['ceil']((_0x4939ff+_0x209241)/0x2);U(S(_0x5d80a4,_0x4939ff,_0x5a5f37),_0x57887f,_0x10759c)?_0x209241=_0x5a5f37:_0x4939ff=_0x5a5f37;}return _0x4939ff;}function U(_0x37fce7,_0x3d0528,_0x38dcf0){for(const _0x3cc1bc of _0x37fce7['getClientRects']())if(_0x3cc1bc['left']>=_0x3d0528&&_0x3cc1bc['left']<_0x3d0528+_0x38dcf0)return!0x0;return!0x1;}function C(_0x5a677c){return _0x5a677c['nodeType']==Node['ELEMENT_NODE'];}function D(_0x4556e3){return _0x4556e3['nodeType']==Node['TEXT_NODE'];}const T=/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x3adac8('px');var B=class extends _0x4b6bbf{constructor(){super();const _0x542bea=this['bindTemplate'];this['set']({'isVisible':!0x1,'left':null,'top':null,'width':null,'pageNumber':null}),this['setTemplate']({'tag':'div','attributes':{'data-page-number':_0x542bea['to']('pageNumber'),'class':['ck','ck-pagination-view-line',_0x542bea['if']('isVisible','ck-hidden',_0x29e352=>!_0x29e352)],'style':{'left':_0x542bea['to']('left',_0x37483e=>T(_0x37483e)),'top':_0x542bea['to']('top',_0x1eb7b3=>T(_0x1eb7b3)),'width':_0x542bea['to']('width',_0x435eef=>T(_0x435eef))}}});}},G=class{_viewCollection;['_visibleLines']=new Set();['_hiddenLines']=new Set();constructor(_0x1ba25d){this['_viewCollection']=_0x1ba25d['ui']['view']['body'];}get containerElement(){return this['_viewCollection']['bodyCollectionContainer'];}destroy(){for(const _0x3cd0f7 of this['_hiddenLines'])_0x3cd0f7['destroy']();}['cleanLines'](){for(const _0xbfea6 of this['_visibleLines'])_0xbfea6['isVisible']=!0x1,this['_hiddenLines']['add'](_0xbfea6);this['_visibleLines']['clear']();}['showLine'](_0x414170,_0x3e1be0,_0x2d7d43,_0x4b3394){let _0x51508a;this['_hiddenLines']['size']?(_0x51508a=_0x2b15b6(this['_hiddenLines']['values']()),this['_hiddenLines']['delete'](_0x51508a)):_0x51508a=new B(),_0x51508a['set']({'pageNumber':_0x4b3394,'left':_0x414170,'top':_0x3e1be0,'width':_0x2d7d43}),_0x51508a['isVisible']=!0x0,this['_viewCollection']['has'](_0x51508a)||this['_viewCollection']['add'](_0x51508a),this['_visibleLines']['add'](_0x51508a);}setViewCollection(_0x5c5080){for(const _0x1f47c8 of[...this['_visibleLines'],...this['_hiddenLines']])this['_viewCollection']['has'](_0x1f47c8)&&this['_viewCollection']['remove'](_0x1f47c8);this['_viewCollection']=_0x5c5080;}};const V='ck-pagination_enabled';var M=class extends _0x36fc84{linesRepository;_scrollableEditingRootDomAncestor=null;['_resizeObserver']=null;_paginationLookupPlugin;static get['pluginName'](){return'PaginationRenderer';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['set']({'pageNumber':0x1}),this['linesRepository']=new G(this['editor']),this['_scrollableEditingRootDomAncestor']=null,this['_resizeObserver']=null,this['_paginationLookupPlugin']=this['editor']['plugins']['get']('PaginationLookup'),this['bind']('isEnabled')['to'](this['editor']['plugins']['get']('PaginationEditing')),this['editor']['ui']['once']('ready',()=>this['_onUiReady']()),this['_toggleEditingRootsClass'](V),this['on']('change:isEnabled',(_0x5edeb0,_0x1a420e,_0x54fd9c)=>{_0x54fd9c||this['linesRepository']['cleanLines'](),this['_toggleEditingRootsClass'](V,_0x54fd9c);});}destroy(){this['_toggleEditingRootsClass'](V,!0x1),this['linesRepository']['destroy'](),this['_scrollableEditingRootDomAncestor']=null,this['_resizeObserver']&&this['_resizeObserver']['destroy']();}['scrollToPage'](_0x56770f){if(!this['isEnabled'])return;const _0x5d341e=_0x56770f>0x1?this['_getPageBreakLineOffset'](_0x56770f-0x1):0x0;this['_scrollableEditingRootDomAncestor']['scrollTo']({'top':_0x5d341e-0xa,'left':this['_scrollableEditingRootDomAncestor']['scrollLeft'],'behavior':_0x3d02c4['isMotionReduced']?'instant':'smooth'});}setupScrollableAncestor(){const _0x40f7ec=this['editor'],_0xfa6ecb=this['_getAttachedDomRoot']();_0xfa6ecb?(this['_scrollableEditingRootDomAncestor']&&_0x40f7ec['ui']['view']['stopListening'](this['_scrollableEditingRootDomAncestor'],'scroll'),this['_scrollableEditingRootDomAncestor']=_0x1172bf(_0xfa6ecb),_0x40f7ec['ui']['view']['listenTo'](this['_scrollableEditingRootDomAncestor'],'scroll',()=>{this['_updatePageBreakLines']();},{'usePassive':!0x0}),this['_resizeObserver']&&this['_resizeObserver']['destroy'](),this['_resizeObserver']=new _0x471439(this['_scrollableEditingRootDomAncestor'],()=>{this['_updatePageBreakLines']();})):_0x40f7ec['ui']['once']('update',()=>this['setupScrollableAncestor']());}['_onUiReady'](){const _0x466dc5=this['editor'];this['_getAttachedDomRoot']()?(this['setupScrollableAncestor'](),_0x466dc5['ui']['view']['listenTo'](_0x1dbfac['window'],'resize',()=>this['_updatePageBreakLines']()),this['listenTo'](this['_paginationLookupPlugin'],'change:pageBreaks',()=>this['_updatePageBreakLines']())):_0x466dc5['ui']['once']('update',()=>this['_onUiReady']());}_getAttachedDomRoot(){for(const _0x20fd00 of this['editor']['editing']['view']['domRoots']['values']())if(_0x20fd00['isConnected'])return _0x20fd00;return null;}_updatePageBreakLines(){if(!this['isEnabled'])return;const _0x2a783e=this['_getAttachedDomRoot'](),_0x496a5f=this['_paginationLookupPlugin']['pageBreaks'];if(this['linesRepository']['cleanLines'](),!_0x2a783e||0x1==_0x496a5f['length'])return void(this['pageNumber']=0x1);const _0x1c08ad=new _0x28c4f2(_0x2a783e)['excludeScrollbarsAndBorders'](),_0x405ac3=new _0x28c4f2(this['_scrollableEditingRootDomAncestor'])['excludeScrollbarsAndBorders'](),_0x5d0d0a=_0x405ac3['top']+_0x405ac3['height']/0x3;let _0x5bddf2=!0x1;const _0x5b51ae=[];for(let _0x132493=0x1;_0x132493<_0x496a5f['length'];_0x132493++){const _0xb32162=this['_getPageBreakLineOffset'](_0x132493,_0x405ac3);if(!_0xb32162)continue;const _0xee9d4e=_0x405ac3['top']+_0xb32162-this['_scrollableEditingRootDomAncestor']['scrollTop'];_0x5b51ae['push']({'pageOffsetTop':_0xee9d4e,'domRootRect':_0x1c08ad,'domScrollableRect':_0x405ac3,'pageNumber':_0x132493}),_0xee9d4e>_0x5d0d0a&&!_0x5bddf2&&(this['pageNumber']=_0x132493,_0x5bddf2=!0x0);}this['_renderPageBreakLines'](_0x5b51ae),_0x5bddf2||(this['pageNumber']=_0x496a5f['length']);}['_renderPageBreakLines'](_0x54d1aa){if(!_0x54d1aa['length'])return;const {scrollX:_0x356c5e,scrollY:_0x4678ca}=_0x1dbfac['window'],_0x49e62d=_0x4ba23b(this['linesRepository']['containerElement']);let _0x4e3293,_0x1803f5;if(_0x49e62d){const _0x298f9d=new _0x28c4f2(_0x49e62d);_0x4e3293=_0x298f9d['top']+_0x49e62d['clientTop']-_0x49e62d['scrollTop'],_0x1803f5=_0x298f9d['left']+_0x49e62d['clientLeft']-_0x49e62d['scrollLeft'];}else _0x4e3293=-_0x4678ca,_0x1803f5=-_0x356c5e;for(const {domScrollableRect:_0x2db0f0,pageOffsetTop:_0xd37ea9,domRootRect:_0xebab6,pageNumber:_0x1002ab}of _0x54d1aa)_0x2db0f0['top']<_0xd37ea9&&_0xd37ea9<_0x2db0f0['bottom']&&this['linesRepository']['showLine'](_0xebab6['left']-_0x1803f5,_0xd37ea9-_0x4e3293,_0xebab6['width'],_0x1002ab+0x1);}_getPageBreakLineOffset(_0x2f4424,_0x291ace=null){const _0x5aaf81=this['_paginationLookupPlugin']['pageBreaks'][_0x2f4424]['offset'];return _0x5aaf81?(_0x291ace||(_0x291ace=new _0x28c4f2(this['_scrollableEditingRootDomAncestor'])['excludeScrollbarsAndBorders']()),_0x5aaf81-_0x291ace['top']+this['_scrollableEditingRootDomAncestor']['scrollTop']):0x0;}_toggleEditingRootsClass(_0x12ed88,_0x5e220b=!0x0){const _0x2e9a6f=this['editor']['editing']['view'];_0x2e9a6f['change'](_0x37985f=>{for(const _0x1e3a54 of _0x2e9a6f['document']['roots'])_0x5e220b?_0x37985f['addClass'](_0x12ed88,_0x1e3a54):_0x37985f['removeClass'](_0x12ed88,_0x1e3a54);});}};function $(_0x23c821,_0x35fb7e,..._0x3ee562){const t=_0x23c821['t'];switch(_0x35fb7e){case'Go\x20to\x20next\x20page':return t('Go\x20to\x20next\x20page');case'Go\x20to\x20previous\x20page':return t('Go\x20to\x20previous\x20page');case'Current\x20page\x20number\x20(from\x201\x20to\x20%0)':return t('Current\x20page\x20number\x20(from\x201\x20to\x20%0)',..._0x3ee562);case'Keystrokes\x20for\x20navigating\x20through\x20documents':return t('Keystrokes\x20for\x20navigating\x20through\x20documents');case'Go\x20to\x20the\x20previous\x20page\x20(also\x20move\x20selection)':return t('Go\x20to\x20the\x20previous\x20page\x20(also\x20move\x20selection)');case'Go\x20to\x20the\x20next\x20page\x20(also\x20move\x20selection)':return t('Go\x20to\x20the\x20next\x20page\x20(also\x20move\x20selection)');default:return _0x35fb7e;}}var j=class extends _0x36fc84{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'PaginationEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[v,M];}init(){this['set']({'pageNumber':0x1,'totalPages':0x1});const _0x2e98a5=this['editor']['plugins']['get']('Pagination'),_0x4ee7ac=this['editor']['plugins']['get'](v),_0x42bc7f=this['editor']['plugins']['get'](M);this['bind']('isEnabled')['to'](_0x2e98a5),this['_setUpDataDowncastConversion'](),this['bind']('pageNumber')['to'](_0x42bc7f),this['listenTo'](_0x4ee7ac,'change:pageBreaks',(_0x1eefd2,_0x3c9c00,_0x511527,_0x2c322b)=>{this['totalPages']=_0x511527['length'],this['_updatePageBreakMarkers'](_0x511527,_0x2c322b);}),this['_setupKeystrokes'](),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x208ebe=[this['editor']];for(const _0x1a3cd8 of _0x208ebe){let _0xc796f9;for(const _0xcea8ef in _0x1a3cd8){const _0x2ce6a4=_0xcea8ef,_0x26efda=_0x1a3cd8[_0x2ce6a4];if('paginationLicenseKeyValid'==_0x26efda||'paginationLicenseKeyInvalid'==_0x26efda||'paginationLicenseKeyExpired'==_0x26efda||'paginationLicenseKeyDomainLimit'==_0x26efda||'paginationLicenseKeyNotAllowed'==_0x26efda||'paginationLicenseKeyEvaluationLimit'==_0x26efda||'paginationLicenseKeyUsageLimit'==_0x26efda){delete _0x1a3cd8[_0x2ce6a4],_0xc796f9=_0x26efda,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'paginationLicenseKeyInvalid'==_0xc796f9&&_0x1a3cd8['_showLicenseError']('invalid'),'paginationLicenseKeyExpired'==_0xc796f9&&_0x1a3cd8['_showLicenseError']('expired'),'paginationLicenseKeyDomainLimit'==_0xc796f9&&_0x1a3cd8['_showLicenseError']('domainLimit'),'paginationLicenseKeyNotAllowed'==_0xc796f9&&_0x1a3cd8['_showLicenseError']('featureNotAllowed','Pagination'),'paginationLicenseKeyEvaluationLimit'==_0xc796f9&&_0x1a3cd8['_showLicenseError']('evaluationLimit'),'paginationLicenseKeyUsageLimit'==_0xc796f9&&_0x1a3cd8['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['scrollToPage'](_0x231b6c){this['isEnabled']&&this['editor']['plugins']['get'](M)['scrollToPage'](this['_validatePageNumber'](_0x231b6c));}moveSelectionToPage(_0x2c0443){if(!this['isEnabled'])return;const _0x57114c=this['editor'],_0x9e950b=this['editor']['plugins']['get'](v)['pageBreaks'][_0x2c0443-0x1];_0x9e950b&&_0x57114c['model']['change'](_0x170bb8=>{switch(_0x9e950b['type']){case'manual':{const _0x25293b=_0x57114c['model']['schema']['getNearestSelectionRange'](_0x9e950b['modelRange']['end'],'forward');_0x170bb8['setSelection'](_0x25293b);break;}case'element':{const _0x38e1bd=_0x57114c['model']['schema']['getNearestSelectionRange'](_0x9e950b['modelRange']['start'],'forward');_0x170bb8['setSelection'](_0x38e1bd);break;}case'text':{const _0x2798df=_0x9e950b['modelRange']['start'];if(_0x2798df['textNode']&&'\x20'===_0x2798df['textNode']['data'][_0x2798df['offset']]){const _0x499f47=_0x170bb8['createPositionAt'](_0x2798df['parent'],_0x2798df['offset']+0x1);_0x170bb8['setSelection'](_0x499f47);}else _0x170bb8['setSelection'](_0x9e950b['modelRange']);}}_0x57114c['editing']['view']['focus']();});}goToNextPage(){const _0x1f41be=this['_validatePageNumber'](this['pageNumber']+0x1);this['moveSelectionToPage'](_0x1f41be),this['scrollToPage'](_0x1f41be);}['goToPreviousPage'](){const _0x3cb1d6=this['_validatePageNumber'](this['pageNumber']-0x1);this['moveSelectionToPage'](_0x3cb1d6),this['scrollToPage'](_0x3cb1d6);}_updatePageBreakMarkers(_0x4e4121,_0x4b5fdc){const _0x39be0c=this['editor']['model'];this['isEnabled']&&_0x39be0c['change'](_0x2140af=>{for(let _0x4333b1=0x1;_0x4333b1<_0x4e4121['length'];_0x4333b1++){const _0x2d5383=_0x4e4121[_0x4333b1]['modelRange'],_0x7e3d6e='pagination:'+(_0x4333b1+0x1);_0x39be0c['markers']['has'](_0x7e3d6e)?_0x2140af['updateMarker'](_0x7e3d6e,{'range':_0x2d5383}):_0x2140af['addMarker'](_0x7e3d6e,{'range':_0x2d5383,'usingOperation':!0x1,'affectsData':!0x0});}for(let _0x5ef496=_0x4e4121['length'];_0x5ef496<_0x4b5fdc['length'];_0x5ef496++){const _0x5d9f61='pagination:'+(_0x5ef496+0x1);_0x39be0c['markers']['has'](_0x5d9f61)&&_0x2140af['removeMarker'](_0x5d9f61);}});}_setUpDataDowncastConversion(){this['editor']['conversion']['for']('dataDowncast')['add'](_0x5e3446=>{_0x5e3446['on']('addMarker:pagination',(_0x41ac39,{markerRange:_0x5ae779,markerName:_0x2fea7a},_0x42b55b)=>{if(!_0x42b55b['options']['pagination'])return;if(!_0x42b55b['consumable']['consume'](_0x5ae779,_0x41ac39['name']))return;const _0x5c6c1d=_0x5ae779['getContainedElement']();let _0x526db3=_0x5c6c1d?_0x42b55b['mapper']['toViewElement'](_0x5c6c1d):null;if(!_0x526db3){const _0x31c225=_0x5ae779['start'];if(_0x42b55b['schema']['checkChild'](_0x31c225,'$text')){const _0x117321=_0x42b55b['mapper']['toViewPosition'](_0x31c225);_0x526db3=_0x42b55b['writer']['createContainerElement']('span'),_0x526db3['getFillerOffset']=()=>null,_0x42b55b['writer']['insert'](_0x117321,_0x526db3);}else{const _0xdbd54f=_0x31c225['nodeAfter'];_0x526db3=_0x42b55b['mapper']['toViewElement'](_0xdbd54f);}}for(;_0x526db3['parent']!==_0x526db3['root']&&0x0===_0x526db3['index'];)_0x526db3=_0x526db3['parent'];const _0x14af58=_0x2fea7a['substring'](0xb);_0x526db3['hasClass']('page-break')||(_0x42b55b['writer']['setStyle']('page-break-before','always',_0x526db3),_0x42b55b['writer']['setAttribute']('data-pagination-page',_0x14af58,_0x526db3),_0x42b55b['mapper']['bindElementToMarker'](_0x526db3,_0x2fea7a)),_0x41ac39['stop']();});});}_setupKeystrokes(){const _0x5832ba=this['editor'];_0x5832ba['keystrokes']['set']('Shift+Pageup',(_0x3dbda6,_0x256f44)=>{this['goToPreviousPage'](),_0x256f44();}),_0x5832ba['keystrokes']['set']('Shift+Pagedown',(_0x163367,_0x184b0e)=>{this['goToNextPage'](),_0x184b0e();}),_0x5832ba['accessibility']['addKeystrokeInfoGroup']({'id':'pagination','label':$(_0x5832ba['locale'],'Keystrokes\x20for\x20navigating\x20through\x20documents'),'keystrokes':[{'label':$(_0x5832ba['locale'],'Go\x20to\x20the\x20previous\x20page\x20(also\x20move\x20selection)'),'keystroke':'Shift+Pageup','mayRequireFn':!0x0},{'label':$(_0x5832ba['locale'],'Go\x20to\x20the\x20next\x20page\x20(also\x20move\x20selection)'),'keystroke':'Shift+Pagedown','mayRequireFn':!0x0}]});}_validatePageNumber(_0x462a0d){return _0x462a0d<0x1&&(_0x462a0d=0x1),_0x462a0d>this['totalPages']&&(_0x462a0d=this['totalPages']),_0x462a0d;}},q=class extends _0x4b6bbf{['pageNumberView'];constructor(_0x3c97b6){super(_0x3c97b6);const _0x72ecb4=this['bindTemplate'];this['set']({'pageNumber':0x1,'totalPages':0x1,'isEnabled':!0x0}),this['pageNumberView']=new _0x41ccf8(_0x3c97b6,{'min':0x1,'step':0x1}),this['pageNumberView']['set']({'inputMode':'numeric','tabIndex':-0x1}),this['pageNumberView']['bind']('ariaLabel')['to'](this,'totalPages',_0x7ec8e8=>$(_0x3c97b6,'Current\x20page\x20number\x20(from\x201\x20to\x20%0)',_0x7ec8e8)),this['pageNumberView']['bind']('max')['to'](this,'totalPages'),this['pageNumberView']['bind']('isReadOnly')['to'](this,'isEnabled',_0x545cbd=>!_0x545cbd),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-page-navigator',_0x72ecb4['if']('isEnabled','ck-disabled',_0x2f18c8=>!_0x2f18c8)]},'children':[this['pageNumberView'],{'tag':'span','children':[{'text':_0x72ecb4['to']('totalPages')}]}]});}['render'](){super['render']();const _0x21a7de=this['pageNumberView']['element'],_0x16c8cb=_0x4c04c2=>{this['pageNumberView']['element']['value']=String(_0x4c04c2);};_0x16c8cb(this['pageNumber']),this['on']('change:pageNumber',(_0x5eab45,_0x4303bd,_0x319318)=>{_0x16c8cb(_0x319318);}),this['listenTo'](_0x21a7de,'keydown',(_0x29b82a,_0x2e977e)=>{if('ArrowUp'===_0x2e977e['key']||'ArrowDown'===_0x2e977e['key'])return void _0x2e977e['stopPropagation']();if(_0x2e977e['keyCode']!==_0x502e90['enter'])return;_0x2e977e['preventDefault']();const _0x1bc8e4=_0x21a7de['valueAsNumber'];Number['isNaN'](_0x1bc8e4)?_0x21a7de['value']=String(this['pageNumber']):(_0x21a7de['checkValidity']()?this['pageNumber']=_0x1bc8e4:_0x1bc8e4>this['totalPages']?(this['pageNumber']=this['totalPages'],_0x21a7de['value']=String(this['totalPages'])):(this['pageNumber']=0x1,_0x21a7de['value']='1'),this['fire']('navigation',this['pageNumber']));}),this['listenTo'](_0x21a7de,'blur',()=>{_0x21a7de['value']=String(this['pageNumber']);}),this['listenTo'](_0x21a7de,'focus',()=>{this['pageNumberView']['select']();});}['focus'](){this['pageNumberView']['element']['focus']();}},F=class extends _0x36fc84{static get['pluginName'](){return'PaginationUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x1a3d7c=this['editor'],_0x4f9574=_0x1a3d7c['plugins']['get']('PaginationEditing');_0x1a3d7c['ui']['componentFactory']['add']('pageNavigation',_0x3d5255=>{const _0x462b55=new q(_0x3d5255);return _0x462b55['bind']('pageNumber')['to'](_0x4f9574),_0x462b55['bind']('totalPages')['to'](_0x4f9574),_0x462b55['bind']('isEnabled')['to'](_0x4f9574),_0x462b55['on']('navigation',(_0x1f59ed,_0x567025)=>{_0x4f9574['moveSelectionToPage'](_0x567025),_0x4f9574['scrollToPage'](_0x567025);}),_0x462b55;}),_0x1a3d7c['ui']['componentFactory']['add']('nextPage',_0x3fae08=>{const _0xef12a4=new _0x408562(_0x3fae08);return _0xef12a4['isEnabled']=!0x0,_0xef12a4['label']=$(_0x1a3d7c['locale'],'Go\x20to\x20next\x20page'),_0xef12a4['icon']=_0x2e77e2,_0xef12a4['tooltip']=!0x0,_0xef12a4['keystroke']='Shift+PageDown',_0xef12a4['bind']('isEnabled')['to'](_0x4f9574),this['listenTo'](_0xef12a4,'execute',()=>{_0x4f9574['goToNextPage']();}),_0xef12a4;}),_0x1a3d7c['ui']['componentFactory']['add']('previousPage',_0x598920=>{const _0x31a006=new _0x408562(_0x598920);return _0x31a006['isEnabled']=!0x0,_0x31a006['label']=$(_0x1a3d7c['locale'],'Go\x20to\x20previous\x20page'),_0x31a006['icon']=_0x2e76dc,_0x31a006['tooltip']=!0x0,_0x31a006['keystroke']='Shift+PageUp',_0x31a006['bind']('isEnabled')['to'](_0x4f9574),this['listenTo'](_0x31a006,'execute',()=>{_0x4f9574['goToPreviousPage']();}),_0x31a006;});}},H=class extends _0x36fc84{static get['pluginName'](){return'Pagination';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[j,F];}constructor(_0x4a984a){super(_0x4a984a),this['isEnabled']=!0x1;}init(){this['set']({'pageNumber':0x1,'totalPages':0x1});const _0x3d9f4d=this['editor']['plugins']['get'](j);this['bind']('pageNumber')['to'](_0x3d9f4d),this['bind']('totalPages')['to'](_0x3d9f4d),_0x3d02c4['isBlink']||this['editor']['config']['get']('pagination.enableOnUnsupportedBrowsers')?this['editor']['on']('ready',()=>{this['isEnabled']=!0x0;}):this['forceDisabled']('browserCheck');}['scrollToPage'](_0x241bdc){this['editor']['plugins']['get'](j)['scrollToPage'](_0x241bdc);}};export{H as Pagination,M as PaginationRenderer};
|
|
23
|
+
import{Plugin as _0x1bd894}from'@ckeditor/ckeditor5-core';import{ButtonView as _0x13f1c6,InputNumberView as _0x4a3fb3,View as _0x13c7e2}from'@ckeditor/ckeditor5-ui';import{Rect as _0x3f915f,ResizeObserver as _0x1313b1,env as _0x2dcecc,findClosestScrollableAncestor as _0x124803,first as _0x4a7337,getParentElement as _0x142b49,getParentNode as _0x2622b2,getPositionedAncestor as _0x37a75b,global as _0x3d873,keyCodes as _0x2ffa8b,logWarning as _0x1477b3,toUnit as _0x18af12,uid as _0x5f35e2}from'@ckeditor/ckeditor5-utils';import{debounce as _0x2ade6d}from'es-toolkit/compat';import{IconArrowDown as _0x30bf85,IconArrowUp as _0x52a062}from'@ckeditor/ckeditor5-icons';var v=class extends _0x1bd894{_recalculatePageBreaksDebounced=_0x2ade6d(()=>this['_recalculatePageBreaks'](),0xc8);_pagesContainer=null;static get['pluginName'](){return'PaginationLookup';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){if(this['set']({'pageBreaks':[]}),!this['editor']['config']['get']('pagination'))return void _0x1477b3('pagination-config-not-found',this['editor']['config']);const _0x1421ed=this['editor']['plugins']['get']('PaginationEditing');this['bind']('isEnabled')['to'](_0x1421ed),this['editor']['ui']['once']('ready',()=>this['_onUiReady']()),this['on']('change:isEnabled',(_0x32a0e1,_0x4b4b18,_0x1e6172)=>{_0x1e6172&&this['_recalculatePageBreaksDebounced']();});}afterInit(){!async function(_0x251a44){const _0x300629='vsmL4TPpuR53MlqSj2VXwH9oEAN8FxJtGUOdbDCZ01ihyfkBQY6acgz7rIeWKn',_0x44bd7a=0x79770,_0x2cbcc2={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x225f23(_0x1a803d){const _0xf65e49=new window['Promise'](_0x3e519d=>{_0x1a803d['once']('ready',_0x3e519d);}),_0x527585=window['Date']['now'](),_0x202b05=_0x1a803d['config']['get']('licenseKey');async function _0x1f9267(){let _0xd9dd55,_0x504d81=null,_0x144c61=null;try{return'GPL'==_0x202b05?'NotAllowed':(_0xd9dd55=_0x1e8628(),_0xd9dd55?(_0xd9dd55['usageEndpoint']&&(_0x144c61=_0x541834(_0xd9dd55['usageEndpoint'],_0xd9dd55['jti'])),await _0x5c4694()?_0x355f34()?_0x29da57()?'Expired':_0x32c905()?('evaluation'==_0xd9dd55['licenseType']&&(_0x504d81=_0x387399('EvaluationLimit')),await _0x142f7()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x29da57(){const _0x78f1e8=['evaluation','trial']['includes'](_0xd9dd55['licenseType'])?_0x527585/0x3e8:0xe10*_0x44bd7a;return _0xd9dd55['exp']<_0x78f1e8;}function _0x355f34(){const _0x3a6527=_0xd9dd55['features'];return!!_0x3a6527&&(!!_0x3a6527['includes']('*')||!!_0x3a6527['includes']('PAG'));}function _0x32c905(){const _0x38fb2d=_0xd9dd55['licensedHosts'];if(!_0x38fb2d||0x0==_0x38fb2d['length'])return!0x0;const {hostname:_0x11cf18}=new URL(window['location']['href']);if(_0x38fb2d['includes'](_0x11cf18))return!0x0;const _0x513702=_0x11cf18['split']('.');return _0x38fb2d['filter'](_0x467ec8=>_0x467ec8['includes']('*'))['map'](_0x299154=>_0x299154['split']('.'))['filter'](_0x270a8e=>_0x270a8e['length']<=_0x513702['length'])['map'](_0x462e67=>Array(_0x513702['length']-_0x462e67['length'])['fill']('*'===_0x462e67[0x0]?'*':'')['concat'](_0x462e67))['some'](_0x3e132a=>_0x513702['every']((_0x592c0c,_0x58f6f8)=>_0x3e132a[_0x58f6f8]===_0x592c0c||'*'===_0x3e132a[_0x58f6f8]));}function _0x142f7(){return _0x504d81&&_0x144c61?new window['Promise']((_0x5a54af,_0x4cd93b)=>{_0x504d81['then'](_0x5a54af,_0x4cd93b),_0x144c61['then'](_0x5108b3=>{'Valid'!=_0x5108b3&&_0x5a54af(_0x5108b3);},_0x4cd93b);}):_0x504d81||_0x144c61||'Valid';}}function _0x541834(_0x161e9e,_0x4511ab){return new window['Promise'](_0x2ea309=>{if(_0x1d797f())return _0x2ea309('Valid');_0x481ed0(),_0x1a803d['decorate']('_sendUsageRequest');let _0x17f481=!0x1;const _0x206bd7=_0x5f35e2();function _0x545189(_0x450e49){return!!_0x450e49&&('object'==typeof _0x450e49||'function'==typeof _0x450e49)&&'function'==typeof _0x450e49['then']&&'function'==typeof _0x450e49['catch'];}function _0x5ad30f(_0x1af684){_0x5b4d3d(_0x1af684)['then'](_0x417f10=>_0x417f10&&'ok'==_0x417f10['status']?_0xfbe5a6(_0x4d822b(_0x206bd7+_0x4511ab))!=_0x417f10['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3f9cd2=>(_0x21feca(),_0x3f9cd2),()=>{const _0x5808e7=_0x593478();return null==_0x5808e7?(_0x21feca(),'Valid'):_0x527585-_0x5808e7>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2ea309)['catch'](()=>{_0x2ea309('UsageLimit');});const _0xf13806=0x36ee80;function _0x21feca(){const _0x42aeb9='llct-'+_0xfbe5a6(_0x4d822b(_0x161e9e)),_0x567c44=_0x4a3ef5(_0xfbe5a6(window['Math']['ceil'](_0x527585/_0xf13806)));window['localStorage']['setItem'](_0x42aeb9,_0x567c44);}function _0x593478(){const _0x392b94='llct-'+_0xfbe5a6(_0x4d822b(_0x161e9e)),_0xee387e=window['localStorage']['getItem'](_0x392b94);return _0xee387e?window['parseInt'](_0x4a3ef5(_0xee387e),0x10)*_0xf13806:null;}function _0x5b4d3d(_0x45f2f8){return new window['Promise']((_0x11377a,_0x4f8272)=>{_0x45f2f8['then'](_0x11377a,_0x4f8272),window['setTimeout'](_0x4f8272,0x1d4c0);});}}_0x1a803d['on']('_sendUsageRequest',(_0x345172,_0x3e78ac)=>{if(_0x3e78ac[0x0]!=_0x161e9e)return _0x2ea309('UsageLimit');_0x3e78ac[0x1]={..._0x3e78ac[0x1],'requestId':_0x206bd7};},{'priority':'high'}),_0x1a803d['on']('_sendUsageRequest',_0x104709=>{_0x545189(_0x104709['return'])&&(_0x17f481=!0x0,_0x5ad30f(_0x104709['return']));},{'priority':'low'}),_0xf65e49['then'](()=>{_0x17f481||_0x2ea309('UsageLimit');});});function _0x1d797f(){return'auto'==_0x1a803d['editing']['view']['_overlayModeHint'];}function _0x481ed0(){_0x1a803d['editing']['view']['_overlayModeHint']='auto';}}function _0x387399(_0x375008){const _0x536c00=[new window['Promise'](_0x4f52fc=>setTimeout(_0x4f52fc,0x93ecc)),_0xf65e49['then'](()=>new window['Promise'](_0x4da896=>{let _0x27d0ca=0x0;_0x1a803d['model']['on']('applyOperation',(_0x1a9930,_0x519090)=>{_0x519090[0x0]['isDocumentOperation']&&_0x27d0ca++,0x5e8==_0x27d0ca&&(_0x4da896(),_0x1a9930['off']());});}))];return window['Promise']['race'](_0x536c00)['then'](()=>_0x375008);}async function _0x234620(){await _0xf65e49,_0x1a803d['model']['change']=_0x3399b6,_0x1a803d['model']['enqueueChange']=_0x3399b6,_0x1a803d['enableReadOnlyMode']('model');}function _0x4666dd(_0x502acd){const _0x56f890=_0x562032();_0x1a803d[_0x56f890]='paginationLicenseKey'+_0x502acd,'Valid'!=_0x502acd&&_0x234620();}function _0x562032(){const _0x5c01a9=window['String'](window['performance']['now']())['replace']('.','');let _0x2dbe33='v';for(let _0xddd4bb=0x0;_0xddd4bb<_0x5c01a9['length'];_0xddd4bb+=0x2){let _0x4621bb=window['parseInt'](_0x5c01a9['substring'](_0xddd4bb,_0xddd4bb+0x2));_0x4621bb>=0x3e&&(_0x4621bb-=0x3e),_0x2dbe33+=_0x300629[_0x4621bb];}return _0x2dbe33;}function _0x1e8628(){const _0x5b8337=_0x202b05['split']('.');if(0x3!=_0x5b8337['length'])return null;return _0xa510bd(_0x5b8337[0x1]);function _0xa510bd(_0x34c368){const _0x5cc2d5=_0x29e447(_0x34c368);return _0x5cc2d5&&_0x296b8a()?_0x5cc2d5:null;function _0x296b8a(){const _0x89cb68=_0x5cc2d5['jti'],_0x2abb75=window['parseInt'](_0x89cb68['substring'](_0x89cb68['length']-0x8),0x10),_0x5b92e3={..._0x5cc2d5,'jti':_0x89cb68['substring'](0x0,_0x89cb68['length']-0x8)};return delete _0x5b92e3['vc'],_0x4d822b(_0x5b92e3)==_0x2abb75;}}}async function _0x5c4694(){let _0xe1285d=!0x0;try{const [_0x22a1e2,_0xdda4b3,_0xc7229a]=_0x202b05['split']('.');return _0x32bb97(_0x22a1e2),await _0x91f083(_0x22a1e2,_0xdda4b3,_0xc7229a),_0xe1285d;}catch{return!0x1;}function _0x32bb97(_0x2e8e89){const _0x33b578=_0x29e447(_0x2e8e89);_0x33b578&&'ES256'==_0x33b578['alg']||(_0xe1285d=!0x1);}async function _0x91f083(_0x503b04,_0x290a14,_0x371b6e){const _0x3b5265=window['Uint8Array']['from'](_0xf3c1c1(_0x371b6e),_0x5b4d9e=>_0x5b4d9e['charCodeAt'](0x0)),_0xe37172=new window['TextEncoder']()['encode'](_0x503b04+'.'+_0x290a14),_0x33b130=window['crypto']['subtle'];if(!_0x33b130)return;const _0x59185c=await _0x33b130['importKey']('jwk',_0x2cbcc2,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x33b130['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x59185c,_0x3b5265,_0xe37172)||(_0xe1285d=!0x1);}}function _0x29e447(_0x221ded){return _0x221ded['startsWith']('ey')?JSON['parse'](_0xf3c1c1(_0x221ded)):null;}function _0xf3c1c1(_0x253150){return window['atob'](_0x253150['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x4d822b(_0x2f2d84){let _0x34e70b=0x1505;function _0x389078(_0x54f9ac){for(let _0x17508d=0x0;_0x17508d<_0x54f9ac['length'];_0x17508d++){const _0x8eeb7b=_0x54f9ac['charCodeAt'](_0x17508d);_0x34e70b=(_0x34e70b<<0x5)+_0x34e70b+_0x8eeb7b,_0x34e70b&=_0x34e70b;}}function _0x74cc8d(_0x2456b9){Array['isArray'](_0x2456b9)?_0x2456b9['forEach'](_0x74cc8d):_0x2456b9&&'object'==typeof _0x2456b9?Object['entries'](_0x2456b9)['sort']()['forEach'](([_0x203720,_0x57070d])=>{_0x389078(_0x203720),_0x74cc8d(_0x57070d);}):_0x389078(window['String'](_0x2456b9));}return _0x74cc8d(_0x2f2d84),_0x34e70b>>>0x0;}function _0xfbe5a6(_0x246bc4){return _0x246bc4['toString'](0x10)['padStart'](0x8,'0');}function _0x4a3ef5(_0x57c901){return _0x57c901['split']('')['reverse']()['join']('');}function _0x3399b6(){}_0x4666dd(await _0x1f9267());}_0x225f23(_0x251a44['editor']);}(this);}destroy(){super['destroy'](),this['_recalculatePageBreaksDebounced']['cancel'](),this['_pagesContainer']&&(this['_pagesContainer']['destroy'](),this['_pagesContainer']['element']['remove']());}['_onUiReady'](){const _0x48c57a=this['editor'],_0x1a653f=_0x48c57a['editing']['view'],_0x581926=this['_getAttachedDomRoot']();if(!_0x581926||!_0x581926['hasChildNodes']())return void _0x48c57a['ui']['once']('update',()=>this['_onUiReady']());const {pageWidth:_0x3b34b0,pageHeight:_0x19205c}=_0x48c57a['config']['get']('pagination'),{top:_0x4c97aa,left:_0x2e921f,bottom:_0x1abe66,right:_0x55740a}=this['_configuredPaddings'];this['_pagesContainer']=new _0x13c7e2(_0x48c57a['locale']);const _0x18f8b3=this['_pagesContainer'];_0x18f8b3['set']('class',''),_0x18f8b3['setTemplate']({'tag':'div','attributes':{'style':{'columnWidth':_0x3b34b0,'width':_0x3b34b0,'height':'calc(\x20'+_0x19205c+'\x20-\x20'+_0x4c97aa+'\x20-\x20'+_0x1abe66+'\x20+\x200.5mm\x20)','minWidth':'auto','minHeight':'auto','padding':'0\x20'+_0x55740a+'\x200\x20'+_0x2e921f,'columnGap':'calc('+_0x2e921f+'\x20+\x20'+_0x55740a+'\x20+\x20100px)','border':0x0,'boxSizing':'border-box','columnCount':'auto','columnFill':'auto','overflow':'hidden','position':'absolute','top':'-99999px','left':'-99999px'},'class':_0x18f8b3['bindTemplate']['to']('class')}}),_0x18f8b3['render'](),_0x2622b2(_0x581926)['insertBefore'](_0x18f8b3['element'],_0x581926['nextSibling']),this['listenTo'](_0x1a653f,'render',()=>this['_recalculatePageBreaksDebounced'](),{'priority':'low'}),this['_recalculatePageBreaksDebounced']();}_getAttachedDomRoot(){for(const _0x2f0cc9 of this['editor']['editing']['view']['domRoots']['values']())if(_0x2f0cc9['isConnected'])return _0x2f0cc9;return null;}_recalculatePageBreaks(){if(!this['isEnabled'])return Promise['resolve']();const _0x37b3b9=this['editor']['editing']['view'],_0x1700cd=this['_pagesContainer'],_0x3a9d13=this['_getAttachedDomRoot']();if(!_0x3a9d13||!_0x1700cd)return Promise['resolve']();for(_0x1700cd['class']=['ck-reset','ck-pagination-view',..._0x3a9d13['classList']]['join']('\x20');_0x1700cd['element']['firstChild'];)_0x1700cd['element']['firstChild']['remove']();const _0x1b9ccf=Array['from'](_0x37b3b9['domRoots']);_0x1b9ccf['sort'](([,_0x325756],[,_0xec514b])=>_0x325756['compareDocumentPosition'](_0xec514b)==Node['DOCUMENT_POSITION_PRECEDING']?0x1:-0x1);for(const [_0x226746,_0x250341]of _0x1b9ccf){const _0x179a9d=_0x250341['cloneNode'](!0x0);'attributeStyleMap'in _0x179a9d&&_0x179a9d['attributeStyleMap']['clear'](),_0x179a9d['dataset']['rootName']=_0x226746,_0x179a9d['className']='ck-content\x20ck-pagination_enabled',_0x179a9d['removeAttribute']('id'),_0x179a9d['tabIndex']=-0x1,_0x1700cd['element']['append'](_0x179a9d);}const _0x113da7=Array['from'](_0x1700cd['element']['querySelectorAll']('img'));return function(_0x4fa3cf){return Promise['all'](_0x4fa3cf['map'](_0x57ad19=>Promise['race']([N(_0x57ad19),_(0x3e8)])));}(_0x113da7)['then'](()=>{for(const _0x34083d of _0x113da7['filter'](_0x5118a0=>!_0x5118a0['closest']('table')))if(_0x34083d['offsetParent']){const _0xd4c079=_0x3d873['window']['getComputedStyle'](_0x34083d),_0x450cfc=_0x3d873['document']['createElement']('span');for(const _0x19b227 of _0xd4c079)_0x450cfc['style']['setProperty'](_0x19b227,_0xd4c079[_0x19b227]);_0x450cfc['style']['backgroundImage']='url(\x20'+_0x34083d['src']+'\x20)',_0x450cfc['style']['breakInside']='avoid','PICTURE'==_0x34083d['parentElement']?.['tagName']?_0x34083d['parentElement']['replaceWith'](_0x450cfc):_0x34083d['replaceWith'](_0x450cfc);}return new Promise(_0x5ec1e7=>_0x3d873['window']['requestAnimationFrame'](()=>_0x5ec1e7()));})['then'](()=>{this['_updatePageBreaksData']();});}_updatePageBreaksData(){const _0x29a85a=this['_pagesContainer']['element'];if(!_0x29a85a['isConnected'])return;const _0x57940b=new _0x3f915f(_0x29a85a)['excludeScrollbarsAndBorders'](),_0x21335a=Math['floor'](_0x57940b['width']+0x64),_0x24d5ed=I(_0x29a85a,Math['floor'](_0x57940b['left']-_0x29a85a['scrollLeft']),_0x21335a,_0x57940b['height'])['map'](_0x5ea084=>this['_mapPageStarterInfoToPageBreakInfo'](_0x5ea084))['filter'](_0x43cbce=>!0x1!==_0x43cbce);_0x24d5ed['every'](_0x52756d=>!!_0x52756d)&&(this['pageBreaks']=_0x24d5ed);}_mapPageStarterInfoToPageBreakInfo(_0x282a90){const _0x1a59f8=this['editor']['editing']['view'],_0x26b0ed=this['editor']['editing']['mapper'],_0x2861ba=_0x1a59f8['domConverter'],_0x2423fc=_0x282a90['path']['shift'](),_0x5f16dc=this['_pagesContainer']['element']['childNodes'][_0x2423fc]['dataset']['rootName'],_0x2e7e35=_0x1a59f8['getDomRoot'](_0x5f16dc);if(!_0x2e7e35)return null;const _0x5eef41=function(_0x309b8d,_0x5d8a5b){let _0x54eb9e=_0x309b8d;for(const _0xb4c505 of _0x5d8a5b['path']){if(!_0x54eb9e)return null;_0x54eb9e=_0x54eb9e['childNodes'][_0xb4c505];}return _0x54eb9e;}(_0x2e7e35,_0x282a90);if(!_0x5eef41)return null;const _0x3b6116=_0x2861ba['domPositionToView'](_0x5eef41,_0x282a90['textOffset']||0x0);return _0x3b6116?'manual'==_0x282a90['type']?this['_mapManualPageStarterInfoToPageBreakInfo'](_0x3b6116,_0x5eef41):'text'==_0x282a90['type']&&_0x26b0ed['toModelPosition'](_0x3b6116)['offset']?this['_mapTextPageStarterInfoToPageBreakInfo'](_0x3b6116,_0x5eef41,_0x282a90['textOffset']):this['_mapElementPageStarterInfoToPageBreakInfo'](_0x3b6116,_0x5eef41,_0x282a90['offset']):null;}_mapManualPageStarterInfoToPageBreakInfo(_0x15d522,_0x4cc506){const _0x1a60e5=this['editor']['model'],_0xc024da=this['editor']['editing']['mapper']['toModelElement'](_0x15d522['parent']),_0x28ad12=_0x1a60e5['createRangeOn'](_0xc024da);return new k({'type':'manual','modelRange':_0x28ad12,'domNode':_0x4cc506,'offset':0x0});}_mapTextPageStarterInfoToPageBreakInfo(_0x286d8c,_0x2668f1,_0x2bf5e3){const _0x409d19=this['editor']['model'],_0x19974d=this['editor']['editing']['mapper'],_0x4b8458=this['editor']['editing']['view']['domConverter'];if(_0x2bf5e3>=_0x2668f1['length'])return null;const _0x1af850=_0x19974d['toModelPosition'](_0x286d8c),_0xdf6770=_0x409d19['createRange'](_0x1af850),_0x401441=_0x19974d['findMappedViewAncestor'](_0x286d8c),_0x57fd43=_0x4b8458['mapViewToDom'](_0x401441);return new k({'type':'text','modelRange':_0xdf6770,'domNode':_0x2668f1,'offset':L(_0x2668f1,_0x2bf5e3,_0x57fd43)});}_mapElementPageStarterInfoToPageBreakInfo(_0x5e66bb,_0x5cc84f,_0x150d11){const _0x1e4520=this['editor']['model'],_0x56e336=this['editor']['editing'],_0x30add7=_0x56e336['mapper'],_0x3a5d9b=_0x56e336['view']['domConverter'],_0x2a1ebb=_0x30add7['findMappedViewAncestor'](_0x5e66bb),_0x7ef549=_0x30add7['toModelElement'](_0x2a1ebb);if(!_0x7ef549||_0x7ef549['is']('rootElement'))return!0x1;const _0x403b2a=function(_0x565034){const _0x561f48=_0x565034['parent'],_0xcfb184=_0x561f48['root']['document']['model'],_0x39edf5=_0x561f48['getAncestors']({'parentFirst':!0x0,'includeSelf':!0x0});let _0x2f313f=null;for(const _0x4bf072 of _0x39edf5){if(_0x4bf072['is']('rootElement'))return _0x2f313f;if(!_0xcfb184['createPositionBefore'](_0x4bf072)['isTouching'](_0x565034))return _0x2f313f;_0x2f313f=_0x4bf072;}}(_0x1e4520['createPositionBefore'](_0x7ef549))||_0x7ef549;let _0x31e447=_0x30add7['toViewElement'](_0x403b2a),_0x2b2558=_0x1e4520['createRangeOn'](_0x403b2a);const _0xf88a8c=_0x1e4520['createPositionBefore'](_0x403b2a)['nodeBefore'];if(_0xf88a8c&&_0xf88a8c['is']('element','imageBlock')){const _0x4679a6=_0x30add7['toViewElement'](_0xf88a8c),_0x5bf3b7=_0x3a5d9b['mapViewToDom'](_0x4679a6),_0x1c6935=_0x3d873['window']['getComputedStyle'](_0x5bf3b7)['float'];'left'!=_0x1c6935&&'right'!=_0x1c6935||(_0x2b2558=_0x1e4520['createRangeOn'](_0xf88a8c));}for(;_0x31e447['parent']!==_0x31e447['root']&&0x0===_0x31e447['index'];)_0x31e447=_0x31e447['parent'];const _0x1ab51a=new _0x3f915f(C(_0x5cc84f)?_0x5cc84f:E(_0x5cc84f)),_0x576e7f=_0x150d11?_0x1ab51a['height']-_0x150d11:0x0,_0x372674=_0x3a5d9b['mapViewToDom'](_0x31e447),_0x1ea8ef=new _0x3f915f(_0x372674);return new k({'type':'element','modelRange':_0x2b2558,'domNode':_0x372674,'offset':Math['round'](_0x576e7f)||_0x2a1ebb!=x(_0x5e66bb)?_0x576e7f+_0x1ab51a['top']-_0x1ea8ef['top']:0x0});}get['_configuredPaddings'](){const _0x57afa8=this['editor']['config']['get']('pagination.pageMargins');return Object['assign']({'top':'10mm','bottom':'10mm','left':'10mm','right':'10mm'},_0x57afa8);}static _findPageStarterInfos(_0x463757,_0x5c8e15,_0x506694,_0x2e9dcb,_0x57b4d6){return I(_0x463757,_0x5c8e15,_0x506694,_0x2e9dcb,_0x57b4d6);}},k=class{type;['modelRange'];['_domNode'];_offset;constructor({type:_0x564fa5,modelRange:_0x5553c3,domNode:_0x217478,offset:_0xcb8542}){this['type']=_0x564fa5,this['modelRange']=_0x5553c3,this['_domNode']=_0x217478,this['_offset']=_0xcb8542;}get offset(){if(!this['_domNode']['isConnected'])return 0x0;const _0x3af3ad=new _0x3f915f(C(this['_domNode'])?this['_domNode']:E(this['_domNode']));return'manual'==this['type']?_0x3af3ad['top']+_0x3af3ad['height']/0x2:_0x3af3ad['top']+this['_offset'];}};function L(_0x5ba3c0,_0x11135e,_0x1ddef6){const _0x545fe7=E(_0x5ba3c0),_0x43e581=function(_0x36c47f){const _0x5d14cc=_0x3d873['document']['createRange']();return _0x5d14cc['selectNodeContents'](_0x36c47f),_0x5d14cc;}(_0x1ddef6);let _0x49106e;if(0x0==_0x11135e){const _0x9cc99c=_0x2622b2(_0x5ba3c0);_0x49106e=R(_0x43e581['startContainer'],_0x43e581['startOffset'],_0x9cc99c,Array['from'](_0x9cc99c['childNodes'])['indexOf'](_0x5ba3c0));}else _0x49106e=R(_0x43e581['startContainer'],_0x43e581['startOffset'],_0x5ba3c0,_0x11135e);const _0x2ed2dd=R(_0x5ba3c0,_0x11135e,_0x43e581['endContainer'],_0x43e581['endOffset']),_0x670a09=new _0x3f915f(_0x49106e)['bottom'];return(new _0x3f915f(_0x2ed2dd)['top']+_0x670a09)/0x2-new _0x3f915f(_0x545fe7)['top'];}function x(_0x20fcef){let _0x3f9ef7=_0x20fcef['parent'];for(;_0x3f9ef7['is']('$text')||_0x3f9ef7['is']('attributeElement');)_0x3f9ef7=_0x3f9ef7['parent'];return _0x3f9ef7;}function N(_0x50fbb7){return _0x50fbb7['hasAttribute']('width')&&_0x50fbb7['hasAttribute']('height')?Promise['resolve']():new Promise(_0x4e1390=>{function _0x53abe4(){_0x50fbb7['removeEventListener']('load',_0x53abe4),_0x50fbb7['removeEventListener']('error',_0x53abe4),_0x4e1390();}_0x50fbb7['complete']?_0x4e1390():(_0x50fbb7['addEventListener']('load',_0x53abe4),_0x50fbb7['addEventListener']('error',_0x53abe4));});}function _(_0x17422e){return new Promise(_0x173fbd=>setTimeout(_0x173fbd,_0x17422e));}function E(_0x12f5d9){const _0x10388e=_0x3d873['document']['createRange']();return _0x10388e['selectNode'](_0x12f5d9),_0x10388e;}function S(_0x55829e,_0xc68a8c,_0x24094e){const _0x4dfb7f=_0x3d873['document']['createRange']();return _0x4dfb7f['setStart'](_0x55829e,_0xc68a8c),_0x4dfb7f['setEnd'](_0x55829e,_0x24094e),_0x4dfb7f;}function R(_0x20931c,_0x54609d,_0x3e4809,_0x5c9b7c){const _0x15d24c=_0x3d873['document']['createRange']();return _0x15d24c['setStart'](_0x20931c,_0x54609d),_0x15d24c['setEnd'](_0x3e4809,_0x5c9b7c),_0x15d24c;}function I(_0x10bc32,_0x12b0c5,_0x44657a,_0x5c7f0b,_0x486050){const _0x2e3d99=[];for(const [_0x3ed117,_0xf5d4bf]of _0x10bc32['childNodes']['entries']()){let _0x2ee26c=[];C(_0xf5d4bf)&&_0xf5d4bf['offsetParent']&&['static','relative']['includes'](_0x3d873['window']['getComputedStyle'](_0xf5d4bf)['position'])?_0x2ee26c=K(_0xf5d4bf,_0x3ed117,_0x12b0c5,_0x44657a,_0x5c7f0b,_0x486050):D(_0xf5d4bf)&&(_0x2ee26c=A(_0xf5d4bf,_0x3ed117,_0x12b0c5,_0x44657a,_0x486050)),_0x2ee26c['length']&&(_0x2e3d99['push'](..._0x2ee26c),_0x12b0c5+=_0x2ee26c['length']*_0x44657a,_0x486050=!0x1);}return _0x2e3d99;}function K(_0x55d63e,_0x3b2d90,_0x49465c,_0x187463,_0x1498d0,_0x4eaeec){const _0x298e22=[];var _0x44a7ad;if((_0x44a7ad=_0x55d63e['previousSibling'])&&C(_0x44a7ad)&&Boolean(_0x44a7ad['classList']['contains']('page-break')||_0x44a7ad['closest']('.page-break'))&&(_0x298e22['push']({'type':'manual','offset':0x0,'path':[_0x3b2d90-0x1]}),_0x4eaeec=!0x0),'table-row'==_0x3d873['window']['getComputedStyle'](_0x55d63e)['display']){let _0x567977=0x0,_0xd4627=!0x1;for(const _0x4b4d3f of _0x55d63e['getClientRects']())_0x567977+=_0x4b4d3f['height'],_0x4b4d3f['left']>=_0x49465c&&(_0xd4627=!0x0);if(_0x567977<_0x1498d0&&_0xd4627)return _0x4eaeec||_0x298e22['push']({'type':'element','offset':0x0,'path':[_0x3b2d90]}),_0x298e22;}const _0x1f7536=_0x55d63e['closest']('figure.image');if(_0x1f7536&&function(_0x589ba1){let _0x7414e8=!0x1;const _0x2d625d=_0x142b49(_0x589ba1)['dataset']['rootName'],_0x5018bf=_0x589ba1['nextElementSibling'],_0x37fc9b=_0x589ba1['previousElementSibling'],_0x3fbca7=_0x5018bf&&_0x3d873['window']['getComputedStyle'](_0x5018bf)['float'],_0x2c4fbd=_0x5018bf&&'ck-fake-selection-container'===_0x5018bf['className'];return!_0x2d625d||_0x5018bf||_0x37fc9b||(_0x7414e8=!0x0),_0x2d625d&&!_0x37fc9b&&_0x2c4fbd&&(_0x7414e8=!0x0),_0x2d625d&&!_0x37fc9b&&'none'!==_0x3fbca7&&(_0x7414e8=!0x0),!_0x7414e8;}(_0x1f7536)){const _0xf1d28c=_0x3d873['window']['getComputedStyle'](_0x1f7536)['float'];if('left'==_0xf1d28c||'right'==_0xf1d28c)return _0x298e22;}const _0x3c4e3a=I(_0x55d63e,_0x49465c,_0x187463,_0x1498d0,_0x4eaeec);if(_0x3c4e3a['length']){for(const _0x2915ca of _0x3c4e3a)_0x298e22['push']({'type':_0x2915ca['type'],'offset':_0x2915ca['offset'],'textOffset':_0x2915ca['textOffset'],'path':[_0x3b2d90,..._0x2915ca['path']]}),_0x49465c+=_0x187463;return _0x298e22;}return _0x298e22['push'](...function(_0x2ea13a,_0x2e25db,_0x5cb86b,_0x29090d,_0x399004){const _0x17426a=[];if('table-cell'==_0x3d873['window']['getComputedStyle'](_0x2ea13a)['display'])return[];const _0x440bf7=[];for(const _0x4d6e0d of _0x2ea13a['getClientRects']())if(_0x4d6e0d['left']>=_0x5cb86b){for(const _0x5d8984 of _0x440bf7)_0x5d8984['height']+=_0x4d6e0d['height'];_0x440bf7['push']({'height':_0x4d6e0d['height']}),_0x5cb86b+=_0x29090d;}for(const _0x38b524 of _0x440bf7)_0x399004||_0x17426a['push']({'type':'element','offset':_0x38b524['height'],'textOffset':0x0,'path':[_0x2e25db]}),_0x399004=!0x1;return _0x17426a;}(_0x55d63e,_0x3b2d90,_0x49465c,_0x187463,_0x4eaeec)),_0x298e22;}function A(_0x20bd5a,_0x1ddea4,_0x3e9c39,_0x5a15f7,_0x245753){const _0x545167=E(_0x20bd5a),_0x462967=[];let _0x2e563a=0x0;for(const _0x5c155d of _0x545167['getClientRects']())if(_0x5c155d['left']>=_0x3e9c39){const _0x3b376d=O(_0x20bd5a,_0x2e563a,_0x3e9c39,_0x5a15f7);_0x245753||_0x462967['push']({'type':'text','path':[_0x1ddea4],'textOffset':_0x3b376d}),_0x2e563a=_0x3b376d,_0x3e9c39+=_0x5a15f7,_0x245753=!0x1;}return _0x462967;}function O(_0x50372c,_0x3f1b83,_0x494834,_0x71a346){let _0x25c00c=_0x3f1b83,_0xed1676=_0x50372c['length'];for(;_0xed1676-_0x25c00c>0x1;){const _0x30c89d=Math['ceil']((_0x25c00c+_0xed1676)/0x2);U(S(_0x50372c,_0x25c00c,_0x30c89d),_0x494834,_0x71a346)?_0xed1676=_0x30c89d:_0x25c00c=_0x30c89d;}return _0x25c00c;}function U(_0x174938,_0x3bba32,_0x1b4141){for(const _0x38da8c of _0x174938['getClientRects']())if(_0x38da8c['left']>=_0x3bba32&&_0x38da8c['left']<_0x3bba32+_0x1b4141)return!0x0;return!0x1;}function C(_0x26ccee){return _0x26ccee['nodeType']==Node['ELEMENT_NODE'];}function D(_0x4fef86){return _0x4fef86['nodeType']==Node['TEXT_NODE'];}const T=/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x18af12('px');var B=class extends _0x13c7e2{constructor(){super();const _0x5c59a0=this['bindTemplate'];this['set']({'isVisible':!0x1,'left':null,'top':null,'width':null,'pageNumber':null}),this['setTemplate']({'tag':'div','attributes':{'data-page-number':_0x5c59a0['to']('pageNumber'),'class':['ck','ck-pagination-view-line',_0x5c59a0['if']('isVisible','ck-hidden',_0xe79dd5=>!_0xe79dd5)],'style':{'left':_0x5c59a0['to']('left',_0x5b7462=>T(_0x5b7462)),'top':_0x5c59a0['to']('top',_0x38e0c8=>T(_0x38e0c8)),'width':_0x5c59a0['to']('width',_0x1db869=>T(_0x1db869))}}});}},G=class{_viewCollection;['_visibleLines']=new Set();['_hiddenLines']=new Set();constructor(_0x48db4a){this['_viewCollection']=_0x48db4a['ui']['view']['body'];}get containerElement(){return this['_viewCollection']['bodyCollectionContainer'];}destroy(){for(const _0x48cc69 of this['_hiddenLines'])_0x48cc69['destroy']();}['cleanLines'](){for(const _0x17c47e of this['_visibleLines'])_0x17c47e['isVisible']=!0x1,this['_hiddenLines']['add'](_0x17c47e);this['_visibleLines']['clear']();}['showLine'](_0x5ceb2f,_0x4337d3,_0x342f22,_0x168660){let _0x588149;this['_hiddenLines']['size']?(_0x588149=_0x4a7337(this['_hiddenLines']['values']()),this['_hiddenLines']['delete'](_0x588149)):_0x588149=new B(),_0x588149['set']({'pageNumber':_0x168660,'left':_0x5ceb2f,'top':_0x4337d3,'width':_0x342f22}),_0x588149['isVisible']=!0x0,this['_viewCollection']['has'](_0x588149)||this['_viewCollection']['add'](_0x588149),this['_visibleLines']['add'](_0x588149);}setViewCollection(_0x27219b){for(const _0x228ab6 of[...this['_visibleLines'],...this['_hiddenLines']])this['_viewCollection']['has'](_0x228ab6)&&this['_viewCollection']['remove'](_0x228ab6);this['_viewCollection']=_0x27219b;}};const V='ck-pagination_enabled';var M=class extends _0x1bd894{linesRepository;_scrollableEditingRootDomAncestor=null;['_resizeObserver']=null;_paginationLookupPlugin;static get['pluginName'](){return'PaginationRenderer';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['set']({'pageNumber':0x1}),this['linesRepository']=new G(this['editor']),this['_scrollableEditingRootDomAncestor']=null,this['_resizeObserver']=null,this['_paginationLookupPlugin']=this['editor']['plugins']['get']('PaginationLookup'),this['bind']('isEnabled')['to'](this['editor']['plugins']['get']('PaginationEditing')),this['editor']['ui']['once']('ready',()=>this['_onUiReady']()),this['_toggleEditingRootsClass'](V),this['on']('change:isEnabled',(_0x11d062,_0x323280,_0x5e9e04)=>{_0x5e9e04||this['linesRepository']['cleanLines'](),this['_toggleEditingRootsClass'](V,_0x5e9e04);});}destroy(){this['_toggleEditingRootsClass'](V,!0x1),this['linesRepository']['destroy'](),this['_scrollableEditingRootDomAncestor']=null,this['_resizeObserver']&&this['_resizeObserver']['destroy']();}['scrollToPage'](_0x4d14d8){if(!this['isEnabled'])return;const _0x49f632=_0x4d14d8>0x1?this['_getPageBreakLineOffset'](_0x4d14d8-0x1):0x0;this['_scrollableEditingRootDomAncestor']['scrollTo']({'top':_0x49f632-0xa,'left':this['_scrollableEditingRootDomAncestor']['scrollLeft'],'behavior':_0x2dcecc['isMotionReduced']?'instant':'smooth'});}setupScrollableAncestor(){const _0xe48a05=this['editor'],_0x539105=this['_getAttachedDomRoot']();_0x539105?(this['_scrollableEditingRootDomAncestor']&&_0xe48a05['ui']['view']['stopListening'](this['_scrollableEditingRootDomAncestor'],'scroll'),this['_scrollableEditingRootDomAncestor']=_0x124803(_0x539105),_0xe48a05['ui']['view']['listenTo'](this['_scrollableEditingRootDomAncestor'],'scroll',()=>{this['_updatePageBreakLines']();},{'usePassive':!0x0}),this['_resizeObserver']&&this['_resizeObserver']['destroy'](),this['_resizeObserver']=new _0x1313b1(this['_scrollableEditingRootDomAncestor'],()=>{this['_updatePageBreakLines']();})):_0xe48a05['ui']['once']('update',()=>this['setupScrollableAncestor']());}['_onUiReady'](){const _0x201aab=this['editor'];this['_getAttachedDomRoot']()?(this['setupScrollableAncestor'](),_0x201aab['ui']['view']['listenTo'](_0x3d873['window'],'resize',()=>this['_updatePageBreakLines']()),this['listenTo'](this['_paginationLookupPlugin'],'change:pageBreaks',()=>this['_updatePageBreakLines']())):_0x201aab['ui']['once']('update',()=>this['_onUiReady']());}_getAttachedDomRoot(){for(const _0x141a80 of this['editor']['editing']['view']['domRoots']['values']())if(_0x141a80['isConnected'])return _0x141a80;return null;}_updatePageBreakLines(){if(!this['isEnabled'])return;const _0x49a74d=this['_getAttachedDomRoot'](),_0x4cc56b=this['_paginationLookupPlugin']['pageBreaks'];if(this['linesRepository']['cleanLines'](),!_0x49a74d||0x1==_0x4cc56b['length'])return void(this['pageNumber']=0x1);const _0x5c6007=new _0x3f915f(_0x49a74d)['excludeScrollbarsAndBorders'](),_0x2fadd5=new _0x3f915f(this['_scrollableEditingRootDomAncestor'])['excludeScrollbarsAndBorders'](),_0x4cf92a=_0x2fadd5['top']+_0x2fadd5['height']/0x3;let _0x4d3160=!0x1;const _0x58429a=[];for(let _0x563141=0x1;_0x563141<_0x4cc56b['length'];_0x563141++){const _0x3c09bd=this['_getPageBreakLineOffset'](_0x563141,_0x2fadd5);if(!_0x3c09bd)continue;const _0x190940=_0x2fadd5['top']+_0x3c09bd-this['_scrollableEditingRootDomAncestor']['scrollTop'];_0x58429a['push']({'pageOffsetTop':_0x190940,'domRootRect':_0x5c6007,'domScrollableRect':_0x2fadd5,'pageNumber':_0x563141}),_0x190940>_0x4cf92a&&!_0x4d3160&&(this['pageNumber']=_0x563141,_0x4d3160=!0x0);}this['_renderPageBreakLines'](_0x58429a),_0x4d3160||(this['pageNumber']=_0x4cc56b['length']);}['_renderPageBreakLines'](_0x4ebc8c){if(!_0x4ebc8c['length'])return;const {scrollX:_0xcb1ba7,scrollY:_0x681cf1}=_0x3d873['window'],_0x2423e9=_0x37a75b(this['linesRepository']['containerElement']);let _0x515309,_0x28a8e8;if(_0x2423e9){const _0x3f8d48=new _0x3f915f(_0x2423e9);_0x515309=_0x3f8d48['top']+_0x2423e9['clientTop']-_0x2423e9['scrollTop'],_0x28a8e8=_0x3f8d48['left']+_0x2423e9['clientLeft']-_0x2423e9['scrollLeft'];}else _0x515309=-_0x681cf1,_0x28a8e8=-_0xcb1ba7;for(const {domScrollableRect:_0x546285,pageOffsetTop:_0x46389f,domRootRect:_0x174bfa,pageNumber:_0x41ab51}of _0x4ebc8c)_0x546285['top']<_0x46389f&&_0x46389f<_0x546285['bottom']&&this['linesRepository']['showLine'](_0x174bfa['left']-_0x28a8e8,_0x46389f-_0x515309,_0x174bfa['width'],_0x41ab51+0x1);}_getPageBreakLineOffset(_0x3cacd9,_0x35f135=null){const _0x3e5344=this['_paginationLookupPlugin']['pageBreaks'][_0x3cacd9]['offset'];return _0x3e5344?(_0x35f135||(_0x35f135=new _0x3f915f(this['_scrollableEditingRootDomAncestor'])['excludeScrollbarsAndBorders']()),_0x3e5344-_0x35f135['top']+this['_scrollableEditingRootDomAncestor']['scrollTop']):0x0;}_toggleEditingRootsClass(_0x8db266,_0x7d8f32=!0x0){const _0x3ed932=this['editor']['editing']['view'];_0x3ed932['change'](_0xc5bf4f=>{for(const _0x1ae132 of _0x3ed932['document']['roots'])_0x7d8f32?_0xc5bf4f['addClass'](_0x8db266,_0x1ae132):_0xc5bf4f['removeClass'](_0x8db266,_0x1ae132);});}};function $(_0x36ec86,_0xd8560b,..._0x3f4e1d){const t=_0x36ec86['t'];switch(_0xd8560b){case'Go\x20to\x20next\x20page':return t('Go\x20to\x20next\x20page');case'Go\x20to\x20previous\x20page':return t('Go\x20to\x20previous\x20page');case'Current\x20page\x20number\x20(from\x201\x20to\x20%0)':return t('Current\x20page\x20number\x20(from\x201\x20to\x20%0)',..._0x3f4e1d);case'Keystrokes\x20for\x20navigating\x20through\x20documents':return t('Keystrokes\x20for\x20navigating\x20through\x20documents');case'Go\x20to\x20the\x20previous\x20page\x20(also\x20move\x20selection)':return t('Go\x20to\x20the\x20previous\x20page\x20(also\x20move\x20selection)');case'Go\x20to\x20the\x20next\x20page\x20(also\x20move\x20selection)':return t('Go\x20to\x20the\x20next\x20page\x20(also\x20move\x20selection)');default:return _0xd8560b;}}var j=class extends _0x1bd894{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'PaginationEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[v,M];}init(){this['set']({'pageNumber':0x1,'totalPages':0x1});const _0x47cbfc=this['editor']['plugins']['get']('Pagination'),_0x9d2a21=this['editor']['plugins']['get'](v),_0x31adcc=this['editor']['plugins']['get'](M);this['bind']('isEnabled')['to'](_0x47cbfc),this['_setUpDataDowncastConversion'](),this['bind']('pageNumber')['to'](_0x31adcc),this['listenTo'](_0x9d2a21,'change:pageBreaks',(_0x70db91,_0x52d298,_0x1f7f89,_0x1aa220)=>{this['totalPages']=_0x1f7f89['length'],this['_updatePageBreakMarkers'](_0x1f7f89,_0x1aa220);}),this['_setupKeystrokes'](),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x7b3ae4=[this['editor']];for(const _0x345dd1 of _0x7b3ae4){let _0x1e272b;for(const _0x376ef5 in _0x345dd1){const _0x26750b=_0x376ef5,_0x20cc09=_0x345dd1[_0x26750b];if('paginationLicenseKeyValid'==_0x20cc09||'paginationLicenseKeyInvalid'==_0x20cc09||'paginationLicenseKeyExpired'==_0x20cc09||'paginationLicenseKeyDomainLimit'==_0x20cc09||'paginationLicenseKeyNotAllowed'==_0x20cc09||'paginationLicenseKeyEvaluationLimit'==_0x20cc09||'paginationLicenseKeyUsageLimit'==_0x20cc09){delete _0x345dd1[_0x26750b],_0x1e272b=_0x20cc09,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'paginationLicenseKeyInvalid'==_0x1e272b&&_0x345dd1['_showLicenseError']('invalid'),'paginationLicenseKeyExpired'==_0x1e272b&&_0x345dd1['_showLicenseError']('expired'),'paginationLicenseKeyDomainLimit'==_0x1e272b&&_0x345dd1['_showLicenseError']('domainLimit'),'paginationLicenseKeyNotAllowed'==_0x1e272b&&_0x345dd1['_showLicenseError']('featureNotAllowed','Pagination'),'paginationLicenseKeyEvaluationLimit'==_0x1e272b&&_0x345dd1['_showLicenseError']('evaluationLimit'),'paginationLicenseKeyUsageLimit'==_0x1e272b&&_0x345dd1['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['scrollToPage'](_0x3059d8){this['isEnabled']&&this['editor']['plugins']['get'](M)['scrollToPage'](this['_validatePageNumber'](_0x3059d8));}moveSelectionToPage(_0x56167d){if(!this['isEnabled'])return;const _0x2de633=this['editor'],_0x24768d=this['editor']['plugins']['get'](v)['pageBreaks'][_0x56167d-0x1];_0x24768d&&_0x2de633['model']['change'](_0x51e1ed=>{switch(_0x24768d['type']){case'manual':{const _0x5afbee=_0x2de633['model']['schema']['getNearestSelectionRange'](_0x24768d['modelRange']['end'],'forward');_0x51e1ed['setSelection'](_0x5afbee);break;}case'element':{const _0x436c27=_0x2de633['model']['schema']['getNearestSelectionRange'](_0x24768d['modelRange']['start'],'forward');_0x51e1ed['setSelection'](_0x436c27);break;}case'text':{const _0x302a17=_0x24768d['modelRange']['start'];if(_0x302a17['textNode']&&'\x20'===_0x302a17['textNode']['data'][_0x302a17['offset']]){const _0x5d318f=_0x51e1ed['createPositionAt'](_0x302a17['parent'],_0x302a17['offset']+0x1);_0x51e1ed['setSelection'](_0x5d318f);}else _0x51e1ed['setSelection'](_0x24768d['modelRange']);}}_0x2de633['editing']['view']['focus']();});}goToNextPage(){const _0x5a8539=this['_validatePageNumber'](this['pageNumber']+0x1);this['moveSelectionToPage'](_0x5a8539),this['scrollToPage'](_0x5a8539);}['goToPreviousPage'](){const _0x55366b=this['_validatePageNumber'](this['pageNumber']-0x1);this['moveSelectionToPage'](_0x55366b),this['scrollToPage'](_0x55366b);}_updatePageBreakMarkers(_0x33b01e,_0xcc0629){const _0x3a9a9e=this['editor']['model'];this['isEnabled']&&_0x3a9a9e['change'](_0x1b3e52=>{for(let _0x64ba92=0x1;_0x64ba92<_0x33b01e['length'];_0x64ba92++){const _0x50d59f=_0x33b01e[_0x64ba92]['modelRange'],_0x170afe='pagination:'+(_0x64ba92+0x1);_0x3a9a9e['markers']['has'](_0x170afe)?_0x1b3e52['updateMarker'](_0x170afe,{'range':_0x50d59f}):_0x1b3e52['addMarker'](_0x170afe,{'range':_0x50d59f,'usingOperation':!0x1,'affectsData':!0x0});}for(let _0x187204=_0x33b01e['length'];_0x187204<_0xcc0629['length'];_0x187204++){const _0x42437a='pagination:'+(_0x187204+0x1);_0x3a9a9e['markers']['has'](_0x42437a)&&_0x1b3e52['removeMarker'](_0x42437a);}});}_setUpDataDowncastConversion(){this['editor']['conversion']['for']('dataDowncast')['add'](_0x25dccf=>{_0x25dccf['on']('addMarker:pagination',(_0x47e839,{markerRange:_0x2c350a,markerName:_0x3b4d45},_0x275313)=>{if(!_0x275313['options']['pagination'])return;if(!_0x275313['consumable']['consume'](_0x2c350a,_0x47e839['name']))return;const _0x32d727=_0x2c350a['getContainedElement']();let _0x45bca9=_0x32d727?_0x275313['mapper']['toViewElement'](_0x32d727):null;if(!_0x45bca9){const _0x270bf5=_0x2c350a['start'];if(_0x275313['schema']['checkChild'](_0x270bf5,'$text')){const _0xde6e5c=_0x275313['mapper']['toViewPosition'](_0x270bf5);_0x45bca9=_0x275313['writer']['createContainerElement']('span'),_0x45bca9['getFillerOffset']=()=>null,_0x275313['writer']['insert'](_0xde6e5c,_0x45bca9);}else{const _0x36d67e=_0x270bf5['nodeAfter'];_0x45bca9=_0x275313['mapper']['toViewElement'](_0x36d67e);}}for(;_0x45bca9['parent']!==_0x45bca9['root']&&0x0===_0x45bca9['index'];)_0x45bca9=_0x45bca9['parent'];const _0xc355b8=_0x3b4d45['substring'](0xb);_0x45bca9['hasClass']('page-break')||(_0x275313['writer']['setStyle']('page-break-before','always',_0x45bca9),_0x275313['writer']['setAttribute']('data-pagination-page',_0xc355b8,_0x45bca9),_0x275313['mapper']['bindElementToMarker'](_0x45bca9,_0x3b4d45)),_0x47e839['stop']();});});}_setupKeystrokes(){const _0x2953cb=this['editor'];_0x2953cb['keystrokes']['set']('Shift+Pageup',(_0x5774f7,_0xa9225d)=>{this['goToPreviousPage'](),_0xa9225d();}),_0x2953cb['keystrokes']['set']('Shift+Pagedown',(_0x3e774a,_0x3aacab)=>{this['goToNextPage'](),_0x3aacab();}),_0x2953cb['accessibility']['addKeystrokeInfoGroup']({'id':'pagination','label':$(_0x2953cb['locale'],'Keystrokes\x20for\x20navigating\x20through\x20documents'),'keystrokes':[{'label':$(_0x2953cb['locale'],'Go\x20to\x20the\x20previous\x20page\x20(also\x20move\x20selection)'),'keystroke':'Shift+Pageup','mayRequireFn':!0x0},{'label':$(_0x2953cb['locale'],'Go\x20to\x20the\x20next\x20page\x20(also\x20move\x20selection)'),'keystroke':'Shift+Pagedown','mayRequireFn':!0x0}]});}_validatePageNumber(_0x578f67){return _0x578f67<0x1&&(_0x578f67=0x1),_0x578f67>this['totalPages']&&(_0x578f67=this['totalPages']),_0x578f67;}},q=class extends _0x13c7e2{['pageNumberView'];constructor(_0x414bdd){super(_0x414bdd);const _0xcc86c5=this['bindTemplate'];this['set']({'pageNumber':0x1,'totalPages':0x1,'isEnabled':!0x0}),this['pageNumberView']=new _0x4a3fb3(_0x414bdd,{'min':0x1,'step':0x1}),this['pageNumberView']['set']({'inputMode':'numeric','tabIndex':-0x1}),this['pageNumberView']['bind']('ariaLabel')['to'](this,'totalPages',_0x4fa22c=>$(_0x414bdd,'Current\x20page\x20number\x20(from\x201\x20to\x20%0)',_0x4fa22c)),this['pageNumberView']['bind']('max')['to'](this,'totalPages'),this['pageNumberView']['bind']('isReadOnly')['to'](this,'isEnabled',_0xa379ab=>!_0xa379ab),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-page-navigator',_0xcc86c5['if']('isEnabled','ck-disabled',_0x191277=>!_0x191277)]},'children':[this['pageNumberView'],{'tag':'span','children':[{'text':_0xcc86c5['to']('totalPages')}]}]});}['render'](){super['render']();const _0x46e6a6=this['pageNumberView']['element'],_0x4c47bd=_0x1c84ee=>{this['pageNumberView']['element']['value']=String(_0x1c84ee);};_0x4c47bd(this['pageNumber']),this['on']('change:pageNumber',(_0x52f872,_0x3fedd1,_0xcfc200)=>{_0x4c47bd(_0xcfc200);}),this['listenTo'](_0x46e6a6,'keydown',(_0x4e9020,_0xdb3d1d)=>{if('ArrowUp'===_0xdb3d1d['key']||'ArrowDown'===_0xdb3d1d['key'])return void _0xdb3d1d['stopPropagation']();if(_0xdb3d1d['keyCode']!==_0x2ffa8b['enter'])return;_0xdb3d1d['preventDefault']();const _0x3131b3=_0x46e6a6['valueAsNumber'];Number['isNaN'](_0x3131b3)?_0x46e6a6['value']=String(this['pageNumber']):(_0x46e6a6['checkValidity']()?this['pageNumber']=_0x3131b3:_0x3131b3>this['totalPages']?(this['pageNumber']=this['totalPages'],_0x46e6a6['value']=String(this['totalPages'])):(this['pageNumber']=0x1,_0x46e6a6['value']='1'),this['fire']('navigation',this['pageNumber']));}),this['listenTo'](_0x46e6a6,'blur',()=>{_0x46e6a6['value']=String(this['pageNumber']);}),this['listenTo'](_0x46e6a6,'focus',()=>{this['pageNumberView']['select']();});}['focus'](){this['pageNumberView']['element']['focus']();}},F=class extends _0x1bd894{static get['pluginName'](){return'PaginationUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x5a06ec=this['editor'],_0x2c7b79=_0x5a06ec['plugins']['get']('PaginationEditing');_0x5a06ec['ui']['componentFactory']['add']('pageNavigation',_0x1fd09f=>{const _0x4c7e11=new q(_0x1fd09f);return _0x4c7e11['bind']('pageNumber')['to'](_0x2c7b79),_0x4c7e11['bind']('totalPages')['to'](_0x2c7b79),_0x4c7e11['bind']('isEnabled')['to'](_0x2c7b79),_0x4c7e11['on']('navigation',(_0x1530a3,_0x2fc76c)=>{_0x2c7b79['moveSelectionToPage'](_0x2fc76c),_0x2c7b79['scrollToPage'](_0x2fc76c);}),_0x4c7e11;}),_0x5a06ec['ui']['componentFactory']['add']('nextPage',_0x5d0cc5=>{const _0x52e653=new _0x13f1c6(_0x5d0cc5);return _0x52e653['isEnabled']=!0x0,_0x52e653['label']=$(_0x5a06ec['locale'],'Go\x20to\x20next\x20page'),_0x52e653['icon']=_0x30bf85,_0x52e653['tooltip']=!0x0,_0x52e653['keystroke']='Shift+PageDown',_0x52e653['bind']('isEnabled')['to'](_0x2c7b79),this['listenTo'](_0x52e653,'execute',()=>{_0x2c7b79['goToNextPage']();}),_0x52e653;}),_0x5a06ec['ui']['componentFactory']['add']('previousPage',_0x374939=>{const _0x22a6ef=new _0x13f1c6(_0x374939);return _0x22a6ef['isEnabled']=!0x0,_0x22a6ef['label']=$(_0x5a06ec['locale'],'Go\x20to\x20previous\x20page'),_0x22a6ef['icon']=_0x52a062,_0x22a6ef['tooltip']=!0x0,_0x22a6ef['keystroke']='Shift+PageUp',_0x22a6ef['bind']('isEnabled')['to'](_0x2c7b79),this['listenTo'](_0x22a6ef,'execute',()=>{_0x2c7b79['goToPreviousPage']();}),_0x22a6ef;});}},H=class extends _0x1bd894{static get['pluginName'](){return'Pagination';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[j,F];}constructor(_0x13417b){super(_0x13417b),this['isEnabled']=!0x1;}init(){this['set']({'pageNumber':0x1,'totalPages':0x1});const _0x245f8e=this['editor']['plugins']['get'](j);this['bind']('pageNumber')['to'](_0x245f8e),this['bind']('totalPages')['to'](_0x245f8e),_0x2dcecc['isBlink']||this['editor']['config']['get']('pagination.enableOnUnsupportedBrowsers')?this['editor']['on']('ready',()=>{this['isEnabled']=!0x0;}):this['forceDisabled']('browserCheck');}['scrollToPage'](_0x389d30){this['editor']['plugins']['get'](j)['scrollToPage'](_0x389d30);}};export{H as Pagination,M as PaginationRenderer};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-pagination",
|
|
3
|
-
"version": "49.0.0-alpha.
|
|
3
|
+
"version": "49.0.0-alpha.4",
|
|
4
4
|
"description": "Pagination feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"./package.json": "./package.json"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ckeditor/ckeditor5-core": "49.0.0-alpha.
|
|
25
|
-
"@ckeditor/ckeditor5-engine": "49.0.0-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-icons": "49.0.0-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-ui": "49.0.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-utils": "49.0.0-alpha.
|
|
24
|
+
"@ckeditor/ckeditor5-core": "49.0.0-alpha.4",
|
|
25
|
+
"@ckeditor/ckeditor5-engine": "49.0.0-alpha.4",
|
|
26
|
+
"@ckeditor/ckeditor5-icons": "49.0.0-alpha.4",
|
|
27
|
+
"@ckeditor/ckeditor5-ui": "49.0.0-alpha.4",
|
|
28
|
+
"@ckeditor/ckeditor5-utils": "49.0.0-alpha.4",
|
|
29
29
|
"es-toolkit": "1.52.0"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|