@ckeditor/ckeditor5-ai
Version:
AI Assistant feature for CKEditor 5.
23 lines • 4.58 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 _0x412e(){const _0x1a477b=['13783EISYqM','156SKJcqf','aitextadapter-send-request-failed','AbortError','reject','abortController','error','36795XCfvgL','1734656eYDRHS','plugins','_prepareRequestHeaders','get','364605kgDKHv','application/json','makeRequest','signal','14RuHhXK','resolve','requires','name','AI_ERROR_GET_HEADERS','abort','editor','textAdapter','5XKooGL','aborted','2322189XuOPpj','assign','init','AI_ERROR_GET_PARAMETERS','catch','object','locale','sendRequest','4337420NpjiiB','441436ErYuBm','_prepareRequestParameters'];_0x412e=function(){return _0x1a477b;};return _0x412e();}const _0x484340=_0x4355;(function(_0x4107b8,_0x5e638a){const _0x5605ef=_0x4355,_0x5f4fc5=_0x4107b8();while(!![]){try{const _0x368605=parseInt(_0x5605ef(0xde))/0x1+parseInt(_0x5605ef(0xe2))/0x2*(parseInt(_0x5605ef(0xd9))/0x3)+parseInt(_0x5605ef(0xd0))/0x4*(parseInt(_0x5605ef(0xc5))/0x5)+parseInt(_0x5605ef(0xd3))/0x6*(parseInt(_0x5605ef(0xd2))/0x7)+-parseInt(_0x5605ef(0xda))/0x8+parseInt(_0x5605ef(0xc7))/0x9+-parseInt(_0x5605ef(0xcf))/0xa;if(_0x368605===_0x5e638a)break;else _0x5f4fc5['push'](_0x5f4fc5['shift']());}catch(_0x46ee95){_0x5f4fc5['push'](_0x5f4fc5['shift']());}}}(_0x412e,0x35944));import{Plugin as _0x4c2e0a}from'ckeditor5/src/core.js';function _0x4355(_0x1d4975,_0x2fab86){const _0x412e79=_0x412e();return _0x4355=function(_0x4355f4,_0x22376a){_0x4355f4=_0x4355f4-0xc1;let _0x53cd7a=_0x412e79[_0x4355f4];return _0x53cd7a;},_0x4355(_0x1d4975,_0x2fab86);}import{CKEditorError as _0x13d8e5}from'ckeditor5/src/utils.js';import{default as _0x591009,AIRequestError as _0x452cb8}from'./aiadapter.js';import{getTranslation as _0x456cb2}from'../utils/common-translations.js';export default class P extends _0x4c2e0a{static get[_0x484340(0xe4)](){return[_0x591009];}constructor(_0x256def){const _0xd46a46=_0x484340;super(_0x256def),this[_0xd46a46(0xd7)]=new AbortController();}[_0x484340(0xc9)](){const _0x82c4ac=_0x484340;this[_0x82c4ac(0xc3)][_0x82c4ac(0xdb)][_0x82c4ac(0xdd)](_0x591009)[_0x82c4ac(0xc4)]=this;}[_0x484340(0xc2)](){const _0x1a48bf=_0x484340;this[_0x1a48bf(0xd7)][_0x1a48bf(0xe1)][_0x1a48bf(0xc6)]||(this[_0x1a48bf(0xd7)][_0x1a48bf(0xc2)](),this[_0x1a48bf(0xd7)]=new AbortController());}async[_0x484340(0xe0)](_0x22c488){const _0x369554=_0x484340;return this[_0x369554(0xce)](_0x22c488)[_0x369554(0xcb)](_0x140ee5=>{const _0x1e6db0=_0x369554;if(_0x140ee5 instanceof _0x452cb8)return Promise[_0x1e6db0(0xd6)](_0x140ee5);if(_0x1e6db0(0xd5)==_0x140ee5[_0x1e6db0(0xe5)])return Promise[_0x1e6db0(0xe3)]();throw console[_0x1e6db0(0xd8)](_0x140ee5),new _0x13d8e5(_0x1e6db0(0xd4),null);});}async[_0x484340(0xdc)](_0x3b2f62,_0x4fbadb){const _0x32ca1f=_0x484340,_0x335a9b=this[_0x32ca1f(0xc3)][_0x32ca1f(0xcd)],_0x573f6d={'Content-Type':_0x32ca1f(0xdf)};if(_0x32ca1f(0xcc)==typeof _0x3b2f62)Object[_0x32ca1f(0xc8)](_0x573f6d,_0x3b2f62);else{if(_0x3b2f62)try{const _0x6c3a49=await _0x3b2f62(_0x4fbadb);Object[_0x32ca1f(0xc8)](_0x573f6d,_0x6c3a49);}catch(_0x4cfd10){return Promise[_0x32ca1f(0xd6)](new _0x452cb8(_0x456cb2(_0x335a9b,_0x32ca1f(0xc1))));}}return _0x573f6d;}async[_0x484340(0xd1)](_0x3f1dfb,_0xcc71da){const _0x19e0c7=_0x484340,_0x590461=this[_0x19e0c7(0xc3)][_0x19e0c7(0xcd)];if(_0x19e0c7(0xcc)==typeof _0x3f1dfb)return _0x3f1dfb;try{return await _0x3f1dfb(_0xcc71da);}catch(_0x4b7c82){return Promise[_0x19e0c7(0xd6)](new _0x452cb8(_0x456cb2(_0x590461,_0x19e0c7(0xca))));}}}