UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

23 lines 6.55 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. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x2858d6=_0x5d9f;(function(_0xd350d,_0x297046){const _0x2b4aee=_0x5d9f,_0x3fe6ab=_0xd350d();while(!![]){try{const _0x4fdc1d=parseInt(_0x2b4aee(0x1be))/0x1+parseInt(_0x2b4aee(0x1b3))/0x2*(-parseInt(_0x2b4aee(0x1c2))/0x3)+-parseInt(_0x2b4aee(0x1b6))/0x4*(parseInt(_0x2b4aee(0x1bf))/0x5)+parseInt(_0x2b4aee(0x1a5))/0x6+parseInt(_0x2b4aee(0x1c1))/0x7*(-parseInt(_0x2b4aee(0x1b0))/0x8)+-parseInt(_0x2b4aee(0x1c4))/0x9+parseInt(_0x2b4aee(0x1c3))/0xa;if(_0x4fdc1d===_0x297046)break;else _0x3fe6ab['push'](_0x3fe6ab['shift']());}catch(_0xbf7ed6){_0x3fe6ab['push'](_0x3fe6ab['shift']());}}}(_0x7116,0x380c4));import{CKEditorError as _0x277a54,compareArrays as _0x473c96}from'ckeditor5/src/utils.js';import{getNodePath as _0x5f1e09,isText as _0x163521,getChildren as _0x1de14c,isDocument as _0x56aa4e,getParent as _0x22379e,textContent as _0x51eedf,hasChildren as _0xbacf1}from'./htmlparser.js';function _0x5d9f(_0x42a638,_0x1cf81d){const _0x71168d=_0x7116();return _0x5d9f=function(_0x5d9f82,_0xe182c9){_0x5d9f82=_0x5d9f82-0x1a5;let _0xb7e1b1=_0x71168d[_0x5d9f82];return _0xb7e1b1;},_0x5d9f(_0x42a638,_0x1cf81d);}export class DocumentPosition{[_0x2858d6(0x1c0)];[_0x2858d6(0x1b4)];[_0x2858d6(0x1b7)];constructor(_0x252f05,_0x2fa295,_0x81d7b1){const _0x254356=_0x2858d6;if(_0x163521(_0x2fa295)&&_0x81d7b1>_0x2fa295[_0x254356(0x1bd)][_0x254356(0x1a9)])throw new _0x277a54(_0x254356(0x1bb),null,{'index':_0x81d7b1,'parent':_0x2fa295});if(_0xbacf1(_0x2fa295)&&_0x81d7b1>_0x1de14c(_0x2fa295)[_0x254356(0x1a9)])throw new _0x277a54(_0x254356(0x1bb),null,{'index':_0x81d7b1,'parent':_0x2fa295});if(_0x81d7b1<0x0)throw new _0x277a54(_0x254356(0x1bb),null,{'index':_0x81d7b1,'parent':_0x2fa295});this[_0x254356(0x1c0)]=_0x2fa295,this[_0x254356(0x1b4)]=_0x81d7b1,this[_0x254356(0x1b7)]=_0x252f05;}get[_0x2858d6(0x1ae)](){const _0xb8206f=_0x2858d6;return[..._0x5f1e09(this[_0xb8206f(0x1c0)]),this[_0xb8206f(0x1b4)]];}[_0x2858d6(0x1ba)](_0xacc6bd){const _0x2018c0=_0x2858d6;return this[_0x2018c0(0x1b7)]==_0xacc6bd[_0x2018c0(0x1b7)]&&_0x2018c0(0x1a6)===_0x473c96(this[_0x2018c0(0x1ae)],_0xacc6bd[_0x2018c0(0x1ae)]);}get[_0x2858d6(0x1b1)](){const _0x1f343b=_0x2858d6;if(_0xbacf1(this[_0x1f343b(0x1c0)])){const _0x23da48=_0x1de14c(this[_0x1f343b(0x1c0)])[this[_0x1f343b(0x1b4)]];if(_0x23da48)return _0x23da48;{const _0x44e795=DocumentPosition[_0x1f343b(0x1ad)](this[_0x1f343b(0x1b7)],this[_0x1f343b(0x1c0)]);if(_0x44e795)return _0x44e795[_0x1f343b(0x1b1)];}}return null;}get[_0x2858d6(0x1af)](){const _0x5375ca=_0x2858d6;if(_0xbacf1(this[_0x5375ca(0x1c0)])){const _0x286588=_0x1de14c(this[_0x5375ca(0x1c0)])[this[_0x5375ca(0x1b4)]-0x1];if(_0x286588)return _0x286588;{const _0x40bb54=DocumentPosition[_0x5375ca(0x1c5)](this[_0x5375ca(0x1b7)],this[_0x5375ca(0x1c0)]);if(_0x40bb54)return _0x40bb54[_0x5375ca(0x1af)];}}return null;}[_0x2858d6(0x1b9)](_0x5d7599=_0x2858d6(0x1ac)){const _0x33ee32=_0x2858d6;if(!_0x163521(this[_0x33ee32(0x1c0)]))return this;const _0x22c9f9=this[_0x33ee32(0x1ae)][this[_0x33ee32(0x1ae)][_0x33ee32(0x1a9)]-0x1],_0x3ef6cd=_0x51eedf(this[_0x33ee32(0x1c0)])[_0x33ee32(0x1b2)](/(?:\s*\S+\s*)/g);let _0x3ca8db=0x0,_0x4df483=_0x22c9f9;for(const _0x39b62a of _0x3ef6cd){if(_0x3ca8db+_0x39b62a[_0x33ee32(0x1a9)]===_0x22c9f9)return this;if(_0x3ca8db+_0x39b62a[_0x33ee32(0x1a9)]>_0x22c9f9){_0x4df483=_0x33ee32(0x1ac)===_0x5d7599?_0x3ca8db:_0x3ca8db+_0x39b62a[_0x33ee32(0x1a9)];break;}_0x3ca8db+=_0x39b62a[_0x33ee32(0x1a9)];}return DocumentPosition[_0x33ee32(0x1bc)](this[_0x33ee32(0x1b7)],this[_0x33ee32(0x1c0)],_0x4df483);}static[_0x2858d6(0x1ad)](_0x3c75ba,_0xe3aa9c){const _0x59b51c=_0x2858d6;if(_0x56aa4e(_0xe3aa9c))return null;const _0x45c702=_0x22379e(_0xe3aa9c);return DocumentPosition[_0x59b51c(0x1bc)](_0x3c75ba,_0x45c702,_0x1de14c(_0x45c702)[_0x59b51c(0x1aa)](_0xe3aa9c)+0x1);}static[_0x2858d6(0x1c5)](_0x19e3c3,_0x52c2d2){const _0x136b89=_0x2858d6;if(_0x56aa4e(_0x52c2d2))return null;const _0x59d14b=_0x22379e(_0x52c2d2);return DocumentPosition[_0x136b89(0x1bc)](_0x19e3c3,_0x59d14b,_0x1de14c(_0x59d14b)[_0x136b89(0x1aa)](_0x52c2d2));}static[_0x2858d6(0x1bc)](_0x4f7480,_0x24f041,_0x109469=_0x2858d6(0x1ac)){const _0x5ba70d=_0x2858d6;return new DocumentPosition(_0x4f7480,_0x24f041,_0x5ba70d(0x1ac)===_0x109469?0x0:_0x5ba70d(0x1b8)===_0x109469?_0x163521(_0x24f041)?_0x24f041[_0x5ba70d(0x1bd)][_0x5ba70d(0x1a9)]:_0x1de14c(_0x24f041)[_0x5ba70d(0x1a9)]:_0x109469);}static[_0x2858d6(0x1ab)](_0x22918a,_0x26ef4e){const _0x5b9ef0=_0x2858d6;if(!_0x26ef4e[_0x5b9ef0(0x1a9)])throw new _0x277a54(_0x5b9ef0(0x1a7),null,{'path':_0x26ef4e});const _0xcd8c0d=_0x26ef4e[_0x5b9ef0(0x1b5)](0x0,-0x1)[_0x5b9ef0(0x1a8)]((_0x2a6e4d,_0x20f018)=>_0x163521(_0x2a6e4d)?_0x2a6e4d:_0x1de14c(_0x2a6e4d)[_0x20f018],_0x22918a);return DocumentPosition[_0x5b9ef0(0x1bc)](_0x22918a,_0xcd8c0d,_0x26ef4e[_0x26ef4e[_0x5b9ef0(0x1a9)]-0x1]);}}function _0x7116(){const _0x46aa88=['createBefore','2081142LMMNpv','same','ai-documentposition-createfrompath-path-cannot-be-empty','reduce','length','indexOf','createFromPath','start','createAfter','path','previousNode','8gHNWpR','nextNode','match','2zsQlvz','index','slice','124XWwwtK','document','end','getNudgedToWordBoundary','isEqual','ai-documentposition-index-out-of-bounds','createAt','data','147320JKIKmP','39635toqcGq','parent','1132089sqLRiv','866805cgyzMO','5850390SlZRPF','1379205NgmpMy'];_0x7116=function(){return _0x46aa88;};return _0x7116();}