@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
23 lines • 7.91 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. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
const _0x555038=_0x15ef;(function(_0x553bb9,_0x3308ad){const _0x4ba93c=_0x15ef,_0x437cf7=_0x553bb9();while(!![]){try{const _0x7992bf=-parseInt(_0x4ba93c(0x1c3))/0x1+parseInt(_0x4ba93c(0x1b3))/0x2+-parseInt(_0x4ba93c(0x1c0))/0x3*(-parseInt(_0x4ba93c(0x1b6))/0x4)+-parseInt(_0x4ba93c(0x1b9))/0x5*(-parseInt(_0x4ba93c(0x1a6))/0x6)+parseInt(_0x4ba93c(0x1d6))/0x7*(parseInt(_0x4ba93c(0x1aa))/0x8)+-parseInt(_0x4ba93c(0x1da))/0x9*(-parseInt(_0x4ba93c(0x1c8))/0xa)+parseInt(_0x4ba93c(0x1b4))/0xb*(-parseInt(_0x4ba93c(0x1d4))/0xc);if(_0x7992bf===_0x3308ad)break;else _0x437cf7['push'](_0x437cf7['shift']());}catch(_0x1a09dd){_0x437cf7['push'](_0x437cf7['shift']());}}}(_0x3ebd,0x1d696));import{ButtonView as _0x4c844e,IconView as _0x101fc3}from'ckeditor5/src/ui.js';function _0x15ef(_0x3f6c13,_0x246afd){const _0x3ebdc5=_0x3ebd();return _0x15ef=function(_0x15ef21,_0x5b7392){_0x15ef21=_0x15ef21-0x198;let _0x279c61=_0x3ebdc5[_0x15ef21];return _0x279c61;},_0x15ef(_0x3f6c13,_0x246afd);}function _0x3ebd(){const _0x449416=['653000lgqwMg','_initializeProperties','isVisible','lastIndexOf','removeEventListener','setTemplate','fire','small','isLoading','328164YSRjUS','1441Stjigk','execute','4HQSpQG','label','_handleAnimationEndOnce','5dvGcRY','element','ck-ai-chat-context-chip_new-chip','locale','ck-ai-chat-context-chip__type-icon','tooltip','add','81318ceEJfx','_createRemoveButton','itemType','143315nTqdHK','selection','_setupRemoveButtonEvent','slice','_createLoaderIcon','470pEbsKR','ck-ai-chat-context-chip__label','ck-ai-chat-context-controls__chip-tooltip','bind','classList','uiId','ck-ai-chat-context-chip_wide','render','webkitAnimationEnd','readonly','bindTemplate','AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','30396HUIhxT','ck-ai-chat-context-chip','7TZmhLw','type','_isAnimationOnEnterEnabled','_createIconView','21591mQFzyn','document','ck-ai-chat-context-chip_document','removeContextItemChip','content','addEventListener','length','animationend','_createTemplateChildren','_createLabelElement','span','remove','disableAnimationOnEnter','div','ck-hidden','extendTemplate','1260252YHgSQO','set','_setupTemplate','_createTemplateAttributes'];_0x3ebd=function(){return _0x449416;};return _0x3ebd();}import{IconClose as _0x35776a,IconDocument as _0x21681a,IconFileUpload as _0x25d78d,IconLink as _0x20ca3b,IconSelection as _0x43fa46}from'@ckeditor/ckeditor5-icons';import{getTranslation as _0x34d30f}from'../../../aicore/utils/common-translations.js';import{AISpinnerView as _0x3dff25}from'../../../aicore/ui/aispinner.js';const xn={'file':_0x25d78d,'document':_0x21681a,'web-resource':_0x20ca3b,'text':_0x25d78d,'selection':_0x43fa46},bn=_0x555038(0x1d5),wn=_0x555038(0x1ce),Tn=_0x555038(0x198),En=_0x555038(0x1c9),fn=_0x555038(0x1bd),An=_0x555038(0x1ca),Cn='n';export class AIChatContextItemButtonView extends _0x4c844e{constructor(_0x3b0e26,_0x12814f,_0x4ba47e,_0x4fc3f9,_0x659b0b=!0x1){const _0xb99868=_0x555038;super(_0x3b0e26),this[_0xb99868(0x1d8)]=_0x4fc3f9,this[_0xb99868(0x1ab)](_0x12814f,_0x4ba47e,_0x659b0b),this[_0xb99868(0x1a8)]();}[_0x555038(0x1cf)](){const _0x28b2f0=_0x555038;super[_0x28b2f0(0x1cf)](),this[_0x28b2f0(0x1d8)]&&this[_0x28b2f0(0x1ba)]&&(this[_0x28b2f0(0x1ba)][_0x28b2f0(0x1cc)][_0x28b2f0(0x1bf)](_0x28b2f0(0x1bb)),this[_0x28b2f0(0x1b8)](this[_0x28b2f0(0x1ba)],()=>{const _0x4303ca=_0x28b2f0;this[_0x4303ca(0x1ba)]&&this[_0x4303ca(0x1ba)][_0x4303ca(0x1cc)][_0x4303ca(0x1a1)](_0x4303ca(0x1bb));}));}[_0x555038(0x1a2)](){const _0x254284=_0x555038;this[_0x254284(0x1d8)]=!0x1,this[_0x254284(0x1ba)]&&this[_0x254284(0x1ba)][_0x254284(0x1cc)][_0x254284(0x1a1)](_0x254284(0x1bb));}[_0x555038(0x1ab)](_0x113daa,_0x5e4825,_0x30c950){const _0x5b2321=_0x555038;this[_0x5b2321(0x1a7)](_0x5b2321(0x1b7),_0x113daa[_0x5b2321(0x1b7)]),this[_0x5b2321(0x1a7)](_0x5b2321(0x1be),!0x0),this[_0x5b2321(0x1a7)](_0x5b2321(0x1c2),_0x113daa[_0x5b2321(0x1d7)]),this[_0x5b2321(0x1a7)]('id',_0x113daa[_0x5b2321(0x1cd)]),this[_0x5b2321(0x1a7)](_0x5b2321(0x1d1),_0x5e4825),this[_0x5b2321(0x1a7)](_0x5b2321(0x1b2),_0x30c950);}[_0x555038(0x1a8)](){const _0x5a4b9a=_0x555038,_0x1dd372=this[_0x5a4b9a(0x1d9)](),_0x28c508=this[_0x5a4b9a(0x1c1)](),_0x531540=this[_0x5a4b9a(0x1d2)];this[_0x5a4b9a(0x1af)]({'tag':_0x5a4b9a(0x1a3),'attributes':this[_0x5a4b9a(0x1a9)](_0x531540),'children':this[_0x5a4b9a(0x19e)](_0x1dd372,_0x28c508,_0x531540)});}[_0x555038(0x1a9)](_0x501baa){const _0x26eeca=_0x555038;return{'class':[bn,_0x501baa['if'](_0x26eeca(0x1c2),Tn,_0x3a88fe=>_0x26eeca(0x1db)==_0x3a88fe),_0x501baa['if'](_0x26eeca(0x1c2),wn,_0x1cbf0f=>_0x26eeca(0x1c4)==_0x1cbf0f)],'data-cke-tooltip-text':_0x501baa['to'](_0x26eeca(0x1b7),In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':An};}[_0x555038(0x19e)](_0x31cef9,_0x47a323,_0x3201cf){const _0x5eff0c=_0x555038,_0x4286d8=this[_0x5eff0c(0x19f)](_0x3201cf),_0x13b27d=this[_0x5eff0c(0x1c7)]();return this[_0x5eff0c(0x1d1)]?[_0x31cef9,_0x4286d8]:[_0x31cef9,_0x13b27d,_0x4286d8,_0x47a323];}[_0x555038(0x19f)](_0x3195b9){const _0x2da849=_0x555038;return{'tag':_0x2da849(0x1a0),'attributes':{'class':En},'children':[{'text':_0x3195b9['to'](_0x2da849(0x1b7))}]};}[_0x555038(0x1c1)](){const _0x363e2e=_0x555038,_0x47f855=new _0x4c844e(this[_0x363e2e(0x1bc)]);return _0x47f855[_0x363e2e(0x1a7)]({'label':_0x34d30f(this[_0x363e2e(0x1bc)],_0x363e2e(0x1d3)),'icon':_0x35776a}),this[_0x363e2e(0x1c5)](_0x47f855),_0x47f855;}[_0x555038(0x1c5)](_0x5f2ff6){const _0x29bc23=_0x555038;_0x5f2ff6['on'](_0x29bc23(0x1b5),()=>{const _0x154890=_0x29bc23;this[_0x154890(0x1b0)](_0x154890(0x199),this['id']);});}[_0x555038(0x1d9)](){const _0x55d35e=_0x555038,_0x323a0a=this[_0x55d35e(0x1d2)],_0x31c5cd=new _0x101fc3();return _0x31c5cd[_0x55d35e(0x19a)]=xn[this[_0x55d35e(0x1c2)]],_0x31c5cd[_0x55d35e(0x1a5)]({'attributes':{'class':[fn,_0x323a0a['if'](_0x55d35e(0x1b2),_0x55d35e(0x1a4),_0x5ce6b7=>_0x5ce6b7)]}}),_0x31c5cd;}[_0x555038(0x1b8)](_0x54499d,_0x24cbce){const _0x2f9a06=_0x555038;if(!_0x54499d)return;const _0x420463=()=>{const _0xd9ec0e=_0x15ef;_0x24cbce(),_0x54499d[_0xd9ec0e(0x1ae)](_0xd9ec0e(0x19d),_0x420463),_0x54499d[_0xd9ec0e(0x1ae)](_0xd9ec0e(0x1d0),_0x420463);};_0x54499d[_0x2f9a06(0x19b)](_0x2f9a06(0x19d),_0x420463),_0x54499d[_0x2f9a06(0x19b)](_0x2f9a06(0x1d0),_0x420463);}[_0x555038(0x1c7)](){const _0x922102=_0x555038,_0x274d90=new _0x3dff25(_0x922102(0x1b1));return _0x274d90[_0x922102(0x1cb)](_0x922102(0x1ac))['to'](this,_0x922102(0x1b2),_0x51208e=>_0x51208e),_0x274d90;}}function In(_0x278f86){const _0x3f0987=_0x555038;if(!_0x278f86)return _0x278f86;if(_0x278f86[_0x3f0987(0x19c)]<=0x78)return _0x278f86;const _0x358bc=_0x278f86[_0x3f0987(0x1c6)](0x0,0x78),_0x51fdf1=_0x358bc[_0x3f0987(0x1ad)]('\x20');return(_0x51fdf1>0x0?_0x358bc[_0x3f0987(0x1c6)](0x0,_0x51fdf1):_0x358bc)+'…';}