@ckeditor/ckeditor5-ai
Version:
AI Assistant feature for CKEditor 5.
23 lines • 8.63 kB
JavaScript
/*
* 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 _0xe3b8(){const _0x1e4534=['addRange','isProcessing','_createLoader','div','left','10vWPsRh','wheel','textContent','appendChild','isEnabled','change:value','scrollHeight','set','8868xZoXsD','setEndBefore','loaderView','_copyHTMLToClipboard','write','ck-reset_all-excluded','class','listenTo','style','scrollTo','ck-ai-form__copy-button-wrapper','createRange','20038381LEqJYy','change:isProcessing','lastElementChild','<span>]</span>','remove','clipboard','ck-ai-form__content-area--processing','79Jgiqzj','.ck-ai-form__loader','setTemplate','element','innerHTML','\x20ck-ai-form__copy-button--copied','focus','2735SUzSLC','setContent','ck-ai-form__content-area-wrapper','ck-hidden','3UUvvHr','body','appendLoader','ClipboardItem','position','setStartAfter','bind','value','getSelection','render','execute','locale','removeAllRanges','1524904hPUzMA','mousedown','<span>[</span>','AI\x20is\x20writing...','ck-ai-form__content-area','8892468PHIawo','1951576wUWEim','ck-ai-form__loader','icon','ck-content','Copy','text/plain','smooth','createElement','bindTemplate','text/html','isVisible','execCommand','contentFieldView','12320154MkCDVd','ck-ai-form__content-field','copyButtonView','absolute','firstElementChild','-9999px','_createCopyButton','ck-ai-form__copy-button','32444HEpjDH','querySelector','copy'];_0xe3b8=function(){return _0x1e4534;};return _0xe3b8();}const _0x423b3a=_0x34a9;(function(_0x2b481f,_0x36c200){const _0x16e710=_0x34a9,_0x75526e=_0x2b481f();while(!![]){try{const _0x4b0af8=-parseInt(_0x16e710(0x1ef))/0x1*(-parseInt(_0x16e710(0x222))/0x2)+parseInt(_0x16e710(0x1fa))/0x3*(-parseInt(_0x16e710(0x207))/0x4)+-parseInt(_0x16e710(0x1f6))/0x5*(parseInt(_0x16e710(0x232))/0x6)+-parseInt(_0x16e710(0x21a))/0x7+-parseInt(_0x16e710(0x20d))/0x8+parseInt(_0x16e710(0x20c))/0x9+parseInt(_0x16e710(0x22a))/0xa*(parseInt(_0x16e710(0x1e8))/0xb);if(_0x4b0af8===_0x36c200)break;else _0x75526e['push'](_0x75526e['shift']());}catch(_0x40bf9){_0x75526e['push'](_0x75526e['shift']());}}}(_0xe3b8,0xdb240));import{global as _0x44a063}from'ckeditor5/src/utils.js';import{View as _0x334f06,ButtonView as _0x3ed28e,SpinnerView as _0x18b91c}from'ckeditor5/src/ui.js';import{IconCheck as _0x1909f4,IconCopy as _0x4c3da1}from'ckeditor5/src/icons.js';import{getTranslation as _0x3961d3}from'../../utils/common-translations.js';export default class Y extends _0x334f06{[_0x423b3a(0x219)];[_0x423b3a(0x21c)];constructor(_0x4ab6e9,_0x1f3927=''){const _0x55c521=_0x423b3a;super(_0x4ab6e9),this[_0x55c521(0x231)]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3af27=this[_0x55c521(0x215)];this[_0x55c521(0x219)]=new ContentFieldView(_0x4ab6e9,_0x1f3927),this[_0x55c521(0x21c)]=this[_0x55c521(0x220)](),this[_0x55c521(0x1f1)]({'tag':_0x55c521(0x228),'attributes':{'class':['ck',_0x55c521(0x1f8),_0x3af27['if'](_0x55c521(0x217),_0x55c521(0x1f9),_0x16ceda=>!_0x16ceda)],'tabindex':'-1'},'children':[{'tag':_0x55c521(0x228),'attributes':{'class':['ck',_0x55c521(0x20b),_0x3af27['if'](_0x55c521(0x226),_0x55c521(0x1ee))]},'children':[this[_0x55c521(0x219)],{'tag':_0x55c521(0x228),'attributes':{'class':['ck',_0x55c521(0x23c)]},'children':[this[_0x55c521(0x21c)]]}]}]});}[_0x423b3a(0x203)](){const _0x211ec2=_0x423b3a;super[_0x211ec2(0x203)](),this[_0x211ec2(0x201)]&&this[_0x211ec2(0x219)][_0x211ec2(0x1f7)](this[_0x211ec2(0x201)]);let _0x44a164=!0x1;this['on'](_0x211ec2(0x22f),(_0x2af839,_0x780bd1,_0x59f68a)=>{const _0x14f0e9=_0x211ec2,_0x2c622d=!this[_0x14f0e9(0x219)][_0x14f0e9(0x1f2)][_0x14f0e9(0x223)](_0x14f0e9(0x1f0));this[_0x14f0e9(0x219)][_0x14f0e9(0x1f7)](_0x59f68a),this[_0x14f0e9(0x226)]&&_0x2c622d&&!_0x44a164&&this[_0x14f0e9(0x1f2)][_0x14f0e9(0x23b)]({'top':this[_0x14f0e9(0x1f2)][_0x14f0e9(0x230)],'behavior':_0x14f0e9(0x213)});}),this['on'](_0x211ec2(0x1e9),(_0x3bef4b,_0xbe60f8,_0x7397db)=>{const _0x2cebc1=_0x211ec2;_0x44a164=!0x1,_0x7397db?(this[_0x2cebc1(0x201)]=null,this[_0x2cebc1(0x219)][_0x2cebc1(0x1fc)]()):this[_0x2cebc1(0x201)]||this[_0x2cebc1(0x219)][_0x2cebc1(0x1f7)]('');}),this[_0x211ec2(0x239)](this[_0x211ec2(0x1f2)],_0x211ec2(0x22b),()=>{_0x44a164=!0x0;}),this[_0x211ec2(0x239)](this[_0x211ec2(0x1f2)],_0x211ec2(0x208),()=>{_0x44a164=!0x0;});}[_0x423b3a(0x1f5)](){const _0x5b7f57=_0x423b3a;this[_0x5b7f57(0x1f2)][_0x5b7f57(0x1f5)]();}[_0x423b3a(0x220)](){const _0x537896=_0x423b3a,_0x8464cf=this[_0x537896(0x205)],_0x172bef=new _0x3ed28e(this[_0x537896(0x205)]),_0x274696=_0x537896(0x221);return _0x172bef[_0x537896(0x231)]({'label':_0x3961d3(_0x8464cf,_0x537896(0x211)),'icon':_0x4c3da1,'class':_0x274696,'tooltip':!0x0}),_0x172bef[_0x537896(0x200)](_0x537896(0x217))['to'](this,_0x537896(0x201),_0x4e02c5=>!!_0x4e02c5),_0x172bef[_0x537896(0x200)](_0x537896(0x22e))['to'](this,_0x537896(0x226),_0xc5642e=>!_0xc5642e),_0x172bef['on'](_0x537896(0x204),()=>{const _0x41a4b4=_0x537896;this[_0x41a4b4(0x235)](this[_0x41a4b4(0x219)][_0x41a4b4(0x1f2)]),_0x172bef[_0x41a4b4(0x20f)]=_0x1909f4,_0x172bef[_0x41a4b4(0x238)]=_0x274696+_0x41a4b4(0x1f4),this[_0x41a4b4(0x1f5)](),setTimeout(()=>{const _0x2ec01d=_0x41a4b4;_0x172bef[_0x2ec01d(0x20f)]=_0x4c3da1,_0x172bef[_0x2ec01d(0x238)]=_0x274696;},0x3e8);}),_0x172bef;}[_0x423b3a(0x235)](_0x2ecf1c){const _0x2c576e=_0x423b3a,{window:_0x53764b,document:_0x5352f4}=_0x44a063;if(_0x53764b[_0x2c576e(0x1fd)]){const {Blob:_0x2850cd,ClipboardItem:_0x5a0ea7}=_0x53764b,_0x42f19c=[new _0x5a0ea7({'text/html':new _0x2850cd([_0x2ecf1c[_0x2c576e(0x1f3)]],{'type':_0x2c576e(0x216)}),'text/plain':new _0x2850cd([_0x2ecf1c[_0x2c576e(0x22c)]||''],{'type':_0x2c576e(0x212)})})];navigator[_0x2c576e(0x1ed)][_0x2c576e(0x236)](_0x42f19c);}else{const _0x37d967=_0x5352f4[_0x2c576e(0x214)](_0x2c576e(0x228));_0x37d967[_0x2c576e(0x23a)][_0x2c576e(0x1fe)]=_0x2c576e(0x21d),_0x37d967[_0x2c576e(0x23a)][_0x2c576e(0x229)]=_0x2c576e(0x21f),_0x37d967[_0x2c576e(0x1f3)]=_0x2c576e(0x209)+_0x2ecf1c[_0x2c576e(0x1f3)]+_0x2c576e(0x1eb),_0x5352f4[_0x2c576e(0x1fb)][_0x2c576e(0x22d)](_0x37d967);const _0x5a4d14=_0x5352f4[_0x2c576e(0x1e7)]();_0x5a4d14[_0x2c576e(0x1ff)](_0x37d967[_0x2c576e(0x21e)]),_0x5a4d14[_0x2c576e(0x233)](_0x37d967[_0x2c576e(0x1ea)]);const _0x5bd17f=_0x53764b[_0x2c576e(0x202)]();_0x5bd17f[_0x2c576e(0x206)](),_0x5bd17f[_0x2c576e(0x225)](_0x5a4d14),_0x5352f4[_0x2c576e(0x218)](_0x2c576e(0x224)),_0x37d967[_0x2c576e(0x1ec)]();}}}function _0x34a9(_0x3085d0,_0x3b1901){const _0xe3b822=_0xe3b8();return _0x34a9=function(_0x34a952,_0x931126){_0x34a952=_0x34a952-0x1e7;let _0x12d0e6=_0xe3b822[_0x34a952];return _0x12d0e6;},_0x34a9(_0x3085d0,_0x3b1901);}export class ContentFieldView extends _0x334f06{constructor(_0x5788b4,_0x29b89a=''){const _0xcc3ad5=_0x423b3a;super(_0x5788b4),this[_0xcc3ad5(0x234)]=this[_0xcc3ad5(0x227)](),this[_0xcc3ad5(0x1f1)]({'tag':_0xcc3ad5(0x228),'attributes':{'class':['ck',_0xcc3ad5(0x210),_0x29b89a,_0xcc3ad5(0x237),_0xcc3ad5(0x21b)]}});}[_0x423b3a(0x1f7)](_0x5b4587){const _0x48bcf3=_0x423b3a;this[_0x48bcf3(0x1f2)][_0x48bcf3(0x1f3)]=_0x5b4587;}[_0x423b3a(0x1fc)](){const _0xb6c862=_0x423b3a;this[_0xb6c862(0x1f2)][_0xb6c862(0x22d)](this[_0xb6c862(0x234)][_0xb6c862(0x1f2)]);}[_0x423b3a(0x227)](){const _0x21f6c2=_0x423b3a,_0x103df7=new _0x334f06(),_0x530669=this[_0x21f6c2(0x205)],_0x375be7=new _0x18b91c();return _0x375be7[_0x21f6c2(0x217)]=!0x0,_0x103df7[_0x21f6c2(0x1f1)]({'tag':_0x21f6c2(0x228),'attributes':{'class':['ck',_0x21f6c2(0x20e)]},'children':[_0x375be7,{'text':_0x3961d3(_0x530669,_0x21f6c2(0x20a))}]}),_0x103df7[_0x21f6c2(0x203)](),_0x103df7;}}