UNPKG

@ckeditor/ckeditor5-collaboration-core

Version:

Base utilities used by CKEditor 5 collaboration features to support multiple users working together in a rich text editor.

23 lines 4.1 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ function _0x17c0(){const _0x5428e0=['...','1611873cjDmvn','8rQhqUt','pop','join','startsWith','length','45518oNchnn','slice','436955tlLyCw','362973XNKVPe','push','3057544ZhaJlv','substring','replace','4wTpJQT','indexOf','match','94263AyrqhI','split','315702rhKKfx'];_0x17c0=function(){return _0x5428e0;};return _0x17c0();}const _0x5131f1=_0x1228;function _0x1228(_0x2a56d4,_0x5af80a){const _0x17c01a=_0x17c0();return _0x1228=function(_0x122819,_0x728e42){_0x122819=_0x122819-0x81;let _0x5d0802=_0x17c01a[_0x122819];return _0x5d0802;},_0x1228(_0x2a56d4,_0x5af80a);}(function(_0x323aee,_0x4ce820){const _0x4bf630=_0x1228,_0x96260a=_0x323aee();while(!![]){try{const _0xf130a9=parseInt(_0x4bf630(0x87))/0x1+-parseInt(_0x4bf630(0x84))/0x2+parseInt(_0x4bf630(0x8f))/0x3+parseInt(_0x4bf630(0x8c))/0x4*(parseInt(_0x4bf630(0x86))/0x5)+parseInt(_0x4bf630(0x91))/0x6+-parseInt(_0x4bf630(0x89))/0x7+-parseInt(_0x4bf630(0x94))/0x8*(-parseInt(_0x4bf630(0x93))/0x9);if(_0xf130a9===_0x4ce820)break;else _0x96260a['push'](_0x96260a['shift']());}catch(_0x4546a9){_0x96260a['push'](_0x96260a['shift']());}}}(_0x17c0,0x3dffc));export function trimHtml(_0x281ac3,{limit:_0x35f632,suffix:_0xc68887=_0x5131f1(0x92)}){const _0x589be5=_0x5131f1,_0x57bf2d=[];let _0x2d9fe9=0x0;const _0x5bddef=_0x281ac3[_0x589be5(0x8b)](/</g,'\x0a<')[_0x589be5(0x8b)](/>/g,'>\x0a')[_0x589be5(0x8b)](/^\n/g,'')[_0x589be5(0x8b)](/\n$/g,'')[_0x589be5(0x90)]('\x0a');for(let _0x1a2bed=0x0;_0x1a2bed<_0x5bddef[_0x589be5(0x83)];_0x1a2bed++){let _0x429123=_0x5bddef[_0x1a2bed];const _0x4eb3dc=z(_0x429123);if(_0x429123[_0x589be5(0x82)]('<')){if(_0x2d9fe9>=_0x35f632){const _0x3f5217=_0x429123[_0x589be5(0x8e)](/[a-zA-Z]+/);if(!_0x3f5217){_0x5bddef[_0x1a2bed]='';continue;}const _0xdf4fb4=_0x3f5217[0x0];_0x429123[_0x589be5(0x82)]('</')?(_0x57bf2d[_0x589be5(0x83)]&&(_0x429123=''),_0x57bf2d[_0x589be5(0x95)]()):(_0x57bf2d[_0x589be5(0x88)](_0xdf4fb4),_0x429123='');}}else{if(_0x2d9fe9>=_0x35f632)_0x429123='';else{if(_0x2d9fe9+_0x4eb3dc[_0x589be5(0x83)]>=_0x35f632){let _0x465cc2=_0x35f632-_0x2d9fe9;if('\x20'===_0x4eb3dc[_0x465cc2-0x1])_0x465cc2--;else{const _0x2cf7e8=_0x4eb3dc[_0x589be5(0x85)](_0x465cc2)[_0x589be5(0x8d)]('\x20');-0x1!==_0x2cf7e8?_0x465cc2+=_0x2cf7e8:_0x465cc2=_0x429123[_0x589be5(0x83)];}_0x429123=_0x4eb3dc[_0x589be5(0x85)](0x0,_0x465cc2)[_0x589be5(0x81)]('')+_0xc68887,_0x2d9fe9=_0x35f632;}else _0x2d9fe9+=_0x4eb3dc[_0x589be5(0x83)];}}_0x5bddef[_0x1a2bed]=_0x429123;}return _0x5bddef[_0x589be5(0x81)]('\x0a')[_0x589be5(0x8b)](/\n/g,'');}function z(_0xe6f378){const _0x2fc1d5=_0x5131f1,_0x7984a2=[];for(let _0x2716b=0x0;_0x2716b<_0xe6f378[_0x2fc1d5(0x83)];_0x2716b++){const _0x5969e6=_0xe6f378[_0x2fc1d5(0x8a)](_0x2716b)[_0x2fc1d5(0x8e)](/^&[a-z0-9#]+;/);if(_0x5969e6){const _0x4f8421=_0x5969e6[0x0];_0x7984a2[_0x2fc1d5(0x88)](_0x4f8421),_0x2716b+=_0x4f8421[_0x2fc1d5(0x83)]-0x1;}else _0x7984a2[_0x2fc1d5(0x88)](_0xe6f378[_0x2716b]);}return _0x7984a2;}