@ckeditor/ckeditor5-ai 44.2.0-alpha.14 → 44.2.0-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +9 -9
- package/src/adapters/aiadapter.js +1 -1
- package/src/adapters/aitextadapter.js +1 -1
- package/src/adapters/awstextadapter.js +1 -1
- package/src/adapters/openaitextadapter.js +1 -1
- package/src/aiassistant.js +1 -1
- package/src/aiassistantediting.js +1 -1
- package/src/aiassistantui.js +1 -1
- package/src/index.js +1 -1
- package/src/legacyerrors.js +1 -1
- package/src/ui/aiassistantcontroller.js +2 -2
- package/src/ui/form/aiformcontentarea.js +1 -1
- package/src/ui/form/aiformerrorview.js +1 -1
- package/src/ui/form/aiformpromptview.js +1 -1
- package/src/ui/form/aiformtoolbarview.js +1 -1
- package/src/ui/form/aiformview.js +1 -1
- package/src/ui/form/aihistorylistitemview.js +1 -1
- package/src/ui/form/aihistorylistview.js +1 -1
- package/src/ui/form/prompthistory.js +1 -1
- package/src/ui/showaiassistantcommand.js +1 -1
- package/src/utils/common-translations.js +1 -1
- package/src/utils/normalizecommandsconfig.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x210901,Command as _0x27a995,icons as _0x2b54b3}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x1be020,CKEditorError as _0x5d7528,ObservableMixin as _0x5a5c66,global as _0x41a13f,isVisible as it,Rect as st,Collection as _0x230f7b,FocusTracker as _0x2985fb,KeystrokeHandler as ts,first as _0x5285cf}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0xac8519,View as _0x56b163,SpinnerView as _0x30c0b6,IconView as _0x50dca6,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x1a34ed,ButtonLabelView as te,FocusCycler as _0x203c09,createLabeledTextarea as _0x46c6e4,Dialog as _0x4d751f,createDropdown as _0x498b2b,addMenuToDropdown as _0x52357e,MenuBarMenuView as _0x3da5d8,MenuBarMenuListItemButtonView as _0x1d9b4c,DialogViewPosition as _0x1b6130,MenuBarMenuListView as _0x2c2810,MenuBarMenuListItemView as _0x541696}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0xbee4a5,ClipboardMarkersUtils as _0x458b6e}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x84b76e,DataTransfer as _0xb09230,UpcastWriter as _0x4ad0e3,Matcher as _0x4edb91}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x324dad,escape as _0xe9a49d}from'lodash-es';import{BedrockRuntimeClient as _0x3051df,InvokeModelWithResponseStreamCommand as _0x51aa2b,InvokeModelCommand as _0xf4fed9}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x3bf62b,_0x2d0ba8){const _0x381263=(0x0,_0x2d0ba8['t'])('Other');return _0x3bf62b['length']?'groupId'in _0x3bf62b[0x0]?_0x3bf62b:[{'groupId':x,'groupLabel':_0x381263,'order':0x1/0x0,'commands':_0x3bf62b}]:[{'groupId':x,'groupLabel':_0x381263,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x210901{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3569d4}=this,_0x1cc2dd=['ck-fake-ai-selection'];_0x3569d4['config']['get']('ai.useTheme')&&_0x1cc2dd['push']('ck-ai-assistant-ui_theme'),_0x3569d4['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x1cc2dd,'priority':0xc}}),_0x3569d4['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x515369,{writer:_0x266921})=>{if(!_0x515369['markerRange']['isCollapsed'])return null;const _0x128573=_0x266921['createUIElement']('span');return _0x266921['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x128573),_0x128573;}});}['afterInit'](){!async function(_0x3b52e2){const _0x7461d2=_0x4b3a82([0x46,0x75,0x6d,0x54,0x65,0x4a,0x63,0x32,0x34,0x52,0x74,0x72,0x71,0x69,0x4f,0x56,0x6c,0x47,0x49,0x35,0x77,0x36,0x4c,0x78,0x57,0x50,0x4e,0x6b,0x39,0x67,0x61,0x42,0x38,0x64,0x79,0x58,0x30,0x55,0x4d,0x73,0x37,0x76,0x41,0x7a,0x48,0x45,0x53,0x33,0x70,0x6f,0x31,0x51,0x43,0x68,0x66,0x6a,0x62,0x5a,0x4b,0x6e,0x59,0x44]),_0x303560=0x60dce3f3,_0x5cca9a=0x60dbbceb^_0x303560,_0x139bdb=window[_0x4b3a82([0x44,0x61,0x74,0x65])][_0x4b3a82([0x6e,0x6f,0x77])](),_0x27c7f1=_0x3b52e2[_0x4b3a82([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1609cd=new window[(_0x4b3a82([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x59a332=>{_0x27c7f1[_0x4b3a82([0x6f,0x6e,0x63,0x65])](_0x4b3a82([0x72,0x65,0x61,0x64,0x79]),_0x59a332);}),_0x30b51={[_0x4b3a82([0x6b,0x74,0x79])]:_0x4b3a82([0x45,0x43]),[_0x4b3a82([0x75,0x73,0x65])]:_0x4b3a82([0x73,0x69,0x67]),[_0x4b3a82([0x63,0x72,0x76])]:_0x4b3a82([0x50,0x2d,0x32,0x35,0x36]),[_0x4b3a82([0x78])]:_0x4b3a82([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x4b3a82([0x79])]:_0x4b3a82([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x4b3a82([0x61,0x6c,0x67])]:_0x4b3a82([0x45,0x53,0x32,0x35,0x36])},_0x3d0ec9=_0x27c7f1[_0x4b3a82([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4b3a82([0x67,0x65,0x74])](_0x4b3a82([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1decb7(){let _0x2d70ed,_0x348de5=null,_0x2172b8=null;try{if(_0x3d0ec9==_0x4b3a82([0x47,0x50,0x4c]))return _0x4b3a82([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x2d70ed=_0x205b45(),!_0x2d70ed)return _0x4b3a82([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x2d70ed[_0x4b3a82([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2172b8=_0xdf100c(_0x2d70ed[_0x4b3a82([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x2d70ed[_0x4b3a82([0x6a,0x74,0x69])])),await _0x1affe7()?_0x3f6443()?_0x56bd74()?_0x4b3a82([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xa89d3e()?(_0x2d70ed[_0x4b3a82([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4b3a82([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x348de5=_0x2f8a5a(_0x4b3a82([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x2d70ed[_0x4b3a82([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4b3a82([0x74,0x72,0x69,0x61,0x6c])&&(_0x348de5=_0x2f8a5a(_0x4b3a82([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x40e324()):_0x4b3a82([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4b3a82([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4b3a82([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x9e2483){return _0x4b3a82([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x56bd74(){const _0x32b31b=[_0x4b3a82([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4b3a82([0x74,0x72,0x69,0x61,0x6c])][_0x4b3a82([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d70ed[_0x4b3a82([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x139bdb/0x3e8:0xe10*_0x5cca9a;return _0x2d70ed[_0x4b3a82([0x65,0x78,0x70])]<_0x32b31b;}function _0x3f6443(){const _0x116306=_0x2d70ed[_0x4b3a82([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x116306&&(!!_0x116306[_0x4b3a82([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4b3a82([0x2a]))||!!_0x116306[_0x4b3a82([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4b3a82([0x41,0x49])));}function _0xa89d3e(){const _0xf30443=_0x2d70ed[_0x4b3a82([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0xf30443||0x0==_0xf30443[_0x4b3a82([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1d4025}=new URL(window[_0x4b3a82([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0xf30443[_0x4b3a82([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1d4025))return!0x0;const _0x554432=_0x1d4025[_0x4b3a82([0x73,0x70,0x6c,0x69,0x74])](_0x4b3a82([0x2e]));return _0xf30443[_0x4b3a82([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x26e007=>_0x26e007[_0x4b3a82([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4b3a82([0x2a])))[_0x4b3a82([0x6d,0x61,0x70])](_0x5a823d=>_0x5a823d[_0x4b3a82([0x73,0x70,0x6c,0x69,0x74])](_0x4b3a82([0x2e])))[_0x4b3a82([0x73,0x6f,0x6d,0x65])](_0x3eb26a=>_0x554432[_0x4b3a82([0x65,0x76,0x65,0x72,0x79])]((_0x18b272,_0x5184c8)=>_0x3eb26a[_0x5184c8]===_0x18b272||_0x3eb26a[_0x5184c8]===_0x4b3a82([0x2a])));}function _0x40e324(){return _0x348de5&&_0x2172b8?new window[(_0x4b3a82([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x57671a,_0x23e35a)=>{_0x348de5[_0x4b3a82([0x74,0x68,0x65,0x6e])](_0x57671a,_0x23e35a),_0x2172b8[_0x4b3a82([0x74,0x68,0x65,0x6e])](_0x4ad37a=>{_0x4ad37a!=_0x4b3a82([0x56,0x61,0x6c,0x69,0x64])&&_0x57671a(_0x4ad37a);},_0x23e35a);}):_0x348de5||_0x2172b8||_0x4b3a82([0x56,0x61,0x6c,0x69,0x64]);}}function _0xdf100c(_0x4ff671,_0x11cac1){return new window[(_0x4b3a82([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4a9171=>{if(_0x4f58c3())return _0x4a9171(_0x4b3a82([0x56,0x61,0x6c,0x69,0x64]));_0x3b20b7(),_0x27c7f1[_0x4b3a82([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4b3a82([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x512b37=!0x1;const _0xf2fd0c=_0x1be020();function _0x3b8c9f(_0x77733f){return!!_0x77733f&&(typeof _0x77733f===_0x4b3a82([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x77733f===_0x4b3a82([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x77733f[_0x4b3a82([0x74,0x68,0x65,0x6e])]===_0x4b3a82([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x77733f[_0x4b3a82([0x63,0x61,0x74,0x63,0x68])]===_0x4b3a82([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x54029a(_0x133d4b){_0x385b64(_0x133d4b)[_0x4b3a82([0x74,0x68,0x65,0x6e])](_0x34e3c3=>{if(!_0x34e3c3||_0x34e3c3[_0x4b3a82([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4b3a82([0x6f,0x6b]))return _0x4b3a82([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x598cce(_0x32e474(_0xf2fd0c+_0x11cac1))!=_0x34e3c3[_0x4b3a82([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4b3a82([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4b3a82([0x56,0x61,0x6c,0x69,0x64]);})[_0x4b3a82([0x74,0x68,0x65,0x6e])](_0xc2801b=>(_0x22c9c6(),_0xc2801b),()=>{const _0x3f67cf=_0x1278e6();return null==_0x3f67cf?(_0x22c9c6(),_0x4b3a82([0x56,0x61,0x6c,0x69,0x64])):_0x4b3a82(_0x139bdb-_0x3f67cf>(0x44d067f3^_0x303560)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4b3a82([0x74,0x68,0x65,0x6e])](_0x4a9171)[_0x4b3a82([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4a9171(_0x4b3a82([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x381c69=0x60ea0d73^_0x303560;function _0x22c9c6(){const _0x32de04=_0x4b3a82([0x6c,0x6c,0x63,0x74,0x2d])+_0x598cce(_0x32e474(_0x4ff671)),_0x4dbf45=_0x3a8f55(_0x598cce(window[_0x4b3a82([0x4d,0x61,0x74,0x68])][_0x4b3a82([0x63,0x65,0x69,0x6c])](_0x139bdb/_0x381c69)));window[_0x4b3a82([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4b3a82([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x32de04,_0x4dbf45);}function _0x1278e6(){const _0x8a9f03=_0x4b3a82([0x6c,0x6c,0x63,0x74,0x2d])+_0x598cce(_0x32e474(_0x4ff671)),_0xca9fd7=window[_0x4b3a82([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4b3a82([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x8a9f03);return _0xca9fd7?window[_0x4b3a82([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3a8f55(_0xca9fd7),0x10)*_0x381c69:null;}function _0x385b64(_0x2017cd){return new window[(_0x4b3a82([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x21da45,_0x28b9ee)=>{_0x2017cd[_0x4b3a82([0x74,0x68,0x65,0x6e])](_0x21da45,_0x28b9ee),window[_0x4b3a82([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x28b9ee,0x60dd3733^_0x303560);});}}_0x27c7f1[_0x4b3a82([0x6f,0x6e])](_0x4b3a82([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5afd05,_0x8af12e)=>{if(_0x8af12e[0x0]!=_0x4ff671)return _0x4a9171(_0x4b3a82([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x8af12e[0x1]={..._0x8af12e[0x1],[_0x4b3a82([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0xf2fd0c};},{[_0x4b3a82([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4b3a82([0x68,0x69,0x67,0x68])}),_0x27c7f1[_0x4b3a82([0x6f,0x6e])](_0x4b3a82([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4c7792=>{_0x3b8c9f(_0x4c7792[_0x4b3a82([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x512b37=!0x0,_0x54029a(_0x4c7792[_0x4b3a82([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4b3a82([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4b3a82([0x6c,0x6f,0x77])}),_0x1609cd[_0x4b3a82([0x74,0x68,0x65,0x6e])](()=>{_0x512b37||_0x4a9171(_0x4b3a82([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4f58c3(){return _0x27c7f1[_0x4b3a82([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4b3a82([0x76,0x69,0x65,0x77])][_0x4b3a82([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4b3a82([0x61,0x75,0x74,0x6f]);}function _0x3b20b7(){_0x27c7f1[_0x4b3a82([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4b3a82([0x76,0x69,0x65,0x77])][_0x4b3a82([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4b3a82([0x61,0x75,0x74,0x6f]);}}function _0x2f8a5a(_0x4e4049){const _0x2918ab=[new window[(_0x4b3a82([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x50b0f1=>setTimeout(_0x50b0f1,0x60d5dd3f^_0x303560)),_0x1609cd[_0x4b3a82([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4b3a82([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x526d07=>{let _0xc11c82=0x0;_0x27c7f1[_0x4b3a82([0x6d,0x6f,0x64,0x65,0x6c])][_0x4b3a82([0x6f,0x6e])](_0x4b3a82([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x5cb515,_0x7fed9)=>{_0x7fed9[0x0][_0x4b3a82([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0xc11c82++,_0xc11c82==(0x60dce20b^_0x303560)&&(_0x526d07(),_0x5cb515[_0x4b3a82([0x6f,0x66,0x66])]());});}))];return window[_0x4b3a82([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4b3a82([0x72,0x61,0x63,0x65])](_0x2918ab)[_0x4b3a82([0x74,0x68,0x65,0x6e])](()=>_0x4e4049);}async function _0x26dd94(){await _0x1609cd,_0x27c7f1[_0x4b3a82([0x6d,0x6f,0x64,0x65,0x6c])][_0x4b3a82([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x435e4c,_0x27c7f1[_0x4b3a82([0x6d,0x6f,0x64,0x65,0x6c])][_0x4b3a82([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x435e4c,_0x27c7f1[_0x4b3a82([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4b3a82([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x22360c(_0x483b19){const _0x354b53=_0x31e8f4();_0x27c7f1[_0x354b53]=_0x4b3a82([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x483b19,_0x483b19!=_0x4b3a82([0x56,0x61,0x6c,0x69,0x64])&&_0x26dd94();}function _0x31e8f4(){const _0x4b0bb8=window[_0x4b3a82([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4b3a82([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4b3a82([0x6e,0x6f,0x77])]())[_0x4b3a82([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4b3a82([0x2e]),'');let _0x232e04=_0x4b3a82([0x46]);for(let _0x2987ad=0x0;_0x2987ad<_0x4b0bb8[_0x4b3a82([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2987ad+=0x2){let _0x1f02da=window[_0x4b3a82([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4b0bb8[_0x4b3a82([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2987ad,_0x2987ad+0x2));_0x1f02da>=_0x7461d2[_0x4b3a82([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1f02da-=_0x7461d2[_0x4b3a82([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x232e04+=_0x7461d2[_0x1f02da];}return _0x232e04;}function _0x205b45(){const _0xd3f7e6=_0x3d0ec9[_0x4b3a82([0x73,0x70,0x6c,0x69,0x74])](_0x4b3a82([0x2e]));if(0x3!=_0xd3f7e6[_0x4b3a82([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x9bbf78(_0xd3f7e6[0x1]);function _0x9bbf78(_0x473eda){const _0x140f68=_0x15d14e(_0x473eda);return _0x140f68&&_0x5c538e()?_0x140f68:null;function _0x5c538e(){const _0x579942=_0x140f68[_0x4b3a82([0x6a,0x74,0x69])],_0x2b397e=window[_0x4b3a82([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x579942[_0x4b3a82([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x579942[_0x4b3a82([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x316342={..._0x140f68,[_0x4b3a82([0x6a,0x74,0x69])]:_0x579942[_0x4b3a82([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x579942[_0x4b3a82([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x316342[_0x4b3a82([0x76,0x63])],_0x32e474(_0x316342)==_0x2b397e;}}}async function _0x1affe7(){let _0x571f6e=!0x0;try{const _0x2cba4b=_0x3d0ec9[_0x4b3a82([0x73,0x70,0x6c,0x69,0x74])](_0x4b3a82([0x2e])),[_0x227910,_0x1790e3,_0xe3f780]=_0x2cba4b;return _0x31a32d(_0x227910),await _0x5228e1(_0x227910,_0x1790e3,_0xe3f780),_0x571f6e;}catch(_0x24f363){return!0x1;}function _0x31a32d(_0x433700){const _0xc9685a=_0x15d14e(_0x433700);_0xc9685a&&_0xc9685a[_0x4b3a82([0x61,0x6c,0x67])]==_0x4b3a82([0x45,0x53,0x32,0x35,0x36])||(_0x571f6e=!0x1);}async function _0x5228e1(_0x37030d,_0x237bce,_0x4530af){const _0x26f644=window[_0x4b3a82([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4b3a82([0x66,0x72,0x6f,0x6d])](_0x36823b(_0x4530af),_0x3d9dfc=>_0x3d9dfc[_0x4b3a82([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x221b36=new window[(_0x4b3a82([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4b3a82([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x37030d+_0x4b3a82([0x2e])+_0x237bce),_0x19e674=window[_0x4b3a82([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4b3a82([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x19e674)return;const _0x22466f=await _0x19e674[_0x4b3a82([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4b3a82([0x6a,0x77,0x6b]),_0x30b51,{[_0x4b3a82([0x6e,0x61,0x6d,0x65])]:_0x4b3a82([0x45,0x43,0x44,0x53,0x41]),[_0x4b3a82([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4b3a82([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4b3a82([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x19e674[_0x4b3a82([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4b3a82([0x6e,0x61,0x6d,0x65])]:_0x4b3a82([0x45,0x43,0x44,0x53,0x41]),[_0x4b3a82([0x68,0x61,0x73,0x68])]:{[_0x4b3a82([0x6e,0x61,0x6d,0x65])]:_0x4b3a82([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x22466f,_0x26f644,_0x221b36)||(_0x571f6e=!0x1);}}function _0x15d14e(_0x163896){return _0x163896[_0x4b3a82([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4b3a82([0x65,0x79]))?JSON[_0x4b3a82([0x70,0x61,0x72,0x73,0x65])](_0x36823b(_0x163896)):null;}function _0x36823b(_0x220cab){return window[_0x4b3a82([0x61,0x74,0x6f,0x62])](_0x220cab[_0x4b3a82([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4b3a82([0x2b]))[_0x4b3a82([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4b3a82([0x2f])));}function _0x32e474(_0x1261d5){let _0x294bd5=0x1505;function _0x2007cf(_0x15a12b){for(let _0x2723fa=0x0;_0x2723fa<_0x15a12b[_0x4b3a82([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2723fa++){const _0x793a71=_0x15a12b[_0x4b3a82([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2723fa);_0x294bd5=(_0x294bd5<<0x5)+_0x294bd5+_0x793a71,_0x294bd5&=_0x294bd5;}}function _0x299621(_0x38d2f8){Array[_0x4b3a82([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x38d2f8)?_0x38d2f8[_0x4b3a82([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x299621):_0x38d2f8&&typeof _0x38d2f8==_0x4b3a82([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4b3a82([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x38d2f8)[_0x4b3a82([0x73,0x6f,0x72,0x74])]()[_0x4b3a82([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3175e7,_0x4b2119])=>{_0x2007cf(_0x3175e7),_0x299621(_0x4b2119);}):_0x2007cf(window[_0x4b3a82([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x38d2f8));}return _0x299621(_0x1261d5),_0x294bd5>>>0x0;}function _0x598cce(_0x41d03b){return _0x41d03b[_0x4b3a82([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4b3a82([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4b3a82([0x30]));}function _0x3a8f55(_0x39813e){return _0x39813e[_0x4b3a82([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4b3a82([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4b3a82([0x6a,0x6f,0x69,0x6e])]('');}function _0x435e4c(){}function _0x4b3a82(_0x35d6c7){return _0x35d6c7['map'](_0x29beb4=>String['fromCharCode'](_0x29beb4))['join']('');}_0x22360c(await _0x1decb7());}(this);}['showFakeVisualSelection'](){const _0x3f56bc=this['editor']['model'];_0x3f56bc['change'](_0x14d728=>{const _0x590c01=_0x3f56bc['document']['selection']['getRanges']();let _0x59a769=0x0;for(const _0x177756 of _0x590c01){const _0x4e7a38=f+':'+_0x59a769;if(_0x3f56bc['markers']['has'](_0x4e7a38))_0x14d728['updateMarker'](_0x4e7a38,{'range':_0x177756});else{if(_0x177756['start']['isAtEnd']){const _0x53db7c=_0x177756['start']['getLastMatchingPosition'](({item:_0x108599})=>!_0x3f56bc['schema']['isContent'](_0x108599),{'boundaries':_0x177756});_0x14d728['addMarker'](_0x4e7a38,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x14d728['createRange'](_0x53db7c,_0x177756['end'])});}else _0x14d728['addMarker'](_0x4e7a38,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x177756});}_0x59a769++;}});}['hideFakeVisualSelection'](){const _0x1ac1b4=this['editor']['model'],_0x3b6e4f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x3b6e4f['length']&&_0x1ac1b4['change'](_0x12d164=>{_0x3b6e4f['forEach'](_0x5d9b60=>{_0x12d164['removeMarker'](_0x5d9b60);});});}['insertContent'](_0x49f82a,_0x2e3243){const _0x9f36e1=this['_getAISelection'](),_0x57e721=_0x2e3243||_0x9f36e1['getFirstRange']();this['editor']['model']['canEditAt'](_0x57e721)&&this['editor']['model']['change'](_0x3c2e8a=>{this['hideFakeVisualSelection'](),_0x2e3243||this['_resetContentOfSelectedTableCells'](_0x3c2e8a,_0x9f36e1),this['_pasteHTMLUsingClipboard']({'insertAt':_0x57e721,'writer':_0x3c2e8a,'html':_0x49f82a});});}['insertContentBelow'](_0x1e1823){const {model:_0x494650}=this['editor'],_0xfd4a44=this['_getAISelection']();_0x494650['change'](()=>{const _0x3ccc22=this['_prepareTableInsertBelowPosition'](_0x1e1823,_0xfd4a44)||this['_getDefaultInsertBelowPosition'](_0xfd4a44);this['insertContent'](_0x1e1823,_0x3ccc22);});}['_getAISelection'](){const _0x4a961e=this['editor']['model'],_0x4111fa=Array['from'](_0x4a961e['markers']['getMarkersGroup'](f))['map'](_0x408d22=>_0x408d22['getRange']());return _0x4a961e['createSelection'](_0x4111fa);}['_pasteHTMLUsingClipboard']({writer:_0x84d44c,html:_0x39cd4f,insertAt:_0x1914ef}){const {view:_0xccfc6f}=this['editor']['editing'],_0x5997aa=this['editor']['plugins']['get'](_0xbee4a5),_0x13286e=new dt();_0x13286e['setData']('text/html',_0x39cd4f);const _0xb44d16=new ClipboardEvent('paste',{'clipboardData':_0x13286e}),_0x2c963e=new _0x84b76e(_0xccfc6f,_0xb44d16,{'dataTransfer':new _0xb09230(_0x13286e)});_0x84d44c['setSelection'](_0x1914ef);const _0x5c08d0=(_0x54ed13,_0xf559ba)=>{_0xf559ba['resultRange']&&_0x84d44c['setSelection'](_0xf559ba['resultRange']);};_0x5997aa['once']('contentInsertion',_0x5c08d0,{'priority':'lowest'}),_0xccfc6f['document']['fire']('paste',_0x2c963e),_0x5997aa['off']('contentInsertion',_0x5c08d0);}['_getDefaultInsertBelowPosition'](_0x1be900){const {model:_0x38882b}=this['editor'],_0x3348fa=Array['from'](_0x1be900['getSelectedBlocks']());return _0x3348fa['length']?_0x38882b['createPositionAfter'](_0x3348fa['pop']()):_0x1be900['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1830c1,_0x57eb82){const {model:_0x50601a,plugins:_0x2b03de}=this['editor'];if(_0x2b03de['has']('TableUtils')){const _0x3df8f8=_0x2b03de['get']('TableUtils')['getSelectedTableCells'](_0x57eb82);if(_0x3df8f8['length']){const _0x120bed=this['_getTableRowCountFromContent'](_0x1830c1),_0x692b6d=this['_createEmptyTableRows'](_0x3df8f8,_0x120bed);return _0x50601a['createPositionAt'](_0x692b6d,0x0);}}return null;}['_getTableRowCountFromContent'](_0xa5582c){const _0x53fe45=this['editor']['plugins']['get']('TableUtils'),_0x5cd0ff=this['editor']['data']['parse'](_0xa5582c),_0x12977b=Array['from'](_0x5cd0ff['getChildren']())['filter'](_0x4bfa35=>_0x4bfa35['is']('element','table'));let _0x3b565e=0x0;return _0x12977b['forEach'](_0x4fdc42=>{_0x3b565e+=_0x53fe45['getRows'](_0x4fdc42);}),_0x3b565e;}['_createEmptyTableRows'](_0x2daf2e,_0x1d25fa){const _0x4bb0d0=this['editor']['plugins']['get']('TableUtils'),_0x546329=_0x4bb0d0['getRowIndexes'](_0x2daf2e),_0x2ed419=_0x4bb0d0['getColumnIndexes'](_0x2daf2e),_0x5d02d2=_0x546329['last']+0x1,_0x357e1b=_0x2ed419['first'],_0x339338=_0x2daf2e[0x0]['findAncestor']('table');for(let _0xe6dc95=0x0;_0xe6dc95<_0x1d25fa;_0xe6dc95++)_0x4bb0d0['insertRows'](_0x339338,{'at':_0x5d02d2});return _0x339338['getChild'](_0x5d02d2)['getChild'](_0x357e1b);}['_resetContentOfSelectedTableCells'](_0x191283,_0x467ea4){const {plugins:_0x4331f7}=this['editor'],{model:_0x3e2fd9}=_0x191283;if(!_0x4331f7['has']('TableUtils'))return;_0x4331f7['get']('TableUtils')['getSelectedTableCells'](_0x467ea4)['length']&&_0x3e2fd9['deleteContent'](_0x467ea4);}}class K extends _0x210901{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x5d7528('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x59297b){super(_0x59297b),this['name']='AIRequestError';}}function i(_0x414ea0,_0x4d3dad,_0x33ce10){const t=_0x414ea0['t'];switch(_0x4d3dad){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x33ce10);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x33ce10);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x33ce10);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x4d3dad;}}class E extends _0x27a995{['_commandDefinitions'];constructor(_0x4741a2,_0x51dda7){super(_0x4741a2),this['_commandDefinitions']=_0x51dda7,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3dc74b,_0x51a566,_0x295aeb)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x295aeb));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2b1783,_0x3c2673,_0x243f2c)=>{this['enabledCommandsIds']=_0x243f2c?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x47ce5a=this['editor']['model'];this['_hasContext']=function(_0x56c60f){const _0x22638c=_0x56c60f['document']['selection'];return _0x22638c['isCollapsed']?0x0!==[..._0x22638c['getSelectedBlocks']()]['length']&&![..._0x22638c['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x56c60f['hasContent'](_0x22638c['getFirstRange']());}(_0x47ce5a);const _0x54ee41=_0x47ce5a['document']['selection'],_0x22e547=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x27d52a of _0x54ee41['getRanges']())for(const _0x16fae5 of _0x27d52a['getItems']())if(_0x16fae5['is']('element')&&_0x22e547['includes'](_0x16fae5['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x27d815='',_0x3bd8ed='',_0x50ac17='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x27d815,_0x3bd8ed,_0x50ac17);}}function G(_0x2318d5,_0x5c95b0){const _0x1f77f1=new Set();for(const _0x2fa745 of _0x2318d5['values']())(_0x5c95b0||!0x1===_0x2fa745['requiresContent'])&&_0x1f77f1['add'](_0x2fa745['id']);return Array['from'](_0x1f77f1);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x5a5c66(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x5cc6c6,_0x596839,_0x236bf6){super(),this['editor']=_0x5cc6c6,this['textAdapter']=_0x596839,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x236bf6,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x5a8c6c,_0x10d895,_0x300ce8)=>{this['view']['value']=this['_sanitizeHTML'](_0x300ce8);}),this['listenTo'](this['view'],'submitPrompt',(_0x5daefe,_0x2f1f9c)=>{const _0xa36a45=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2f1f9c,_0xa36a45,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x4ffa3b,query:_0x5d1d37,htmlContent:_0x997598,label:_0x6eea71,mainActionLabel:_0x38694c}){this['view']['prompt']=_0x6eea71,this['view']['mainAction']=_0x38694c,this['initialContext']=_0x997598,_0x5d1d37&&(this['view']['isRendered']?this['_handleQuery'](_0x5d1d37,_0x997598,_0x4ffa3b,_0x6eea71):this['view']['once']('render',()=>{this['_handleQuery'](_0x5d1d37,_0x997598,_0x4ffa3b,_0x6eea71);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x21c173,_0x105794,_0x54f679,_0x49922f){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x105794,this['previousQuery']=_0x21c173,this['previousLabel']=_0x49922f||_0x21c173,this['previousActionId']=_0x54f679,new Promise(_0xdfeee2=>{this['textAdapter']['makeRequest']({'query':_0x21c173,'context':_0x105794,'onData':_0x395eb3=>{this['currentResponse']=_0x395eb3,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x54f679})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1eedf3=>{_0x1eedf3 instanceof R?this['view']['handleError'](_0x1eedf3['message']):this['view']['handleError'](),_0xdfeee2();})['finally'](()=>{this['stopProcessing'](),_0xdfeee2();});});}['_parseAndNormalizeContent'](_0x32d559,_0x37082a=!0x1){const _0x4cc179=Z['exec'](_0x32d559);_0x32d559=_0x4cc179?_0x32d559['substring'](_0x4cc179[0x1]['length']):_0x32d559['length']<0x64&&!_0x37082a?'':this['_stripMarkdownSyntax'](_0x32d559);const _0x4867c9=this['_domParser']['parseFromString'](_0x32d559,'text/html');if(_0x4cc179){const _0x35f2bd=Array['from'](_0x4867c9['body']['childNodes']);_0x35f2bd['reverse']();for(const _0xeaa013 of _0x35f2bd){if(_0xeaa013['nodeType']==Node['ELEMENT_NODE'])break;_0xeaa013['remove']();}}const _0x4c46b2=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4867c9['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4c46b2);const _0x3376d0=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x3fe064=this['editor']['data']['toModel'](_0x4c46b2);return _0x3376d0||_0x3fe064['markers']['clear'](),this['editor']['data']['stringify'](_0x3fe064);}['_normalizeResponseHeadings'](_0x11a45c){const _0x581a39=new _0x4ad0e3(this['editor']['editing']['view']['document']),_0x5b1663=new _0x4edb91({'name':/^h[1-5]$/}),_0x4dcfee=[];let _0x2e10f8=!0x1;for(const _0x4e159f of _0x11a45c)_0x4e159f['is']('element')&&_0x5b1663['match'](_0x4e159f)&&(_0x4dcfee['push'](_0x4e159f),'h1'==_0x4e159f['name']&&(_0x2e10f8=!0x0));if(_0x2e10f8){for(const _0x16e00a of _0x4dcfee)_0x581a39['rename']('h'+(parseInt(_0x16e00a['name'][0x1])+0x1),_0x16e00a);}}['_isH1TagSupportEnabled'](){const {data:_0x295e56,editing:_0x503a83}=this['editor'],_0x312aff=_0x295e56['htmlProcessor']['toView']('<h1></h1>'),_0x38af67=_0x295e56['toView'](_0x295e56['toModel'](_0x312aff));return!!_0x503a83['view']['domConverter']['viewToDom'](_0x38af67)['querySelector']('h1');}['_sanitizeHTML'](_0x3db1bf){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3db1bf),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x364330){const _0x19db49=_0x364330['trim']();return _0x19db49['startsWith']('```html')?_0x19db49['endsWith']('```')?_0x19db49['substring'](0x7,_0x19db49['length']-0x3):_0x19db49['substring'](0x7):_0x364330;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x108e86){super(_0x108e86),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4e68a1=>i(_0x108e86,'AI_'+_0x4e68a1['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x108e86,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x108e86,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x108e86,'Stop'));const _0x5144f4=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5144f4['if']('isVisible','ck-hidden',_0x577f95=>!_0x577f95)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4f895d,_0x4b01e6){const _0x3895da=new _0xac8519(this['locale']);return _0x3895da['set']({'label':_0x4f895d,'class':_0x4b01e6||'','isVisible':!0x0,'withText':!0x0}),_0x3895da;}}var W='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class X extends _0x56b163{['contentFieldView'];['copyButtonView'];constructor(_0x398e13,_0x5b2f02=''){super(_0x398e13),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x21a5d=this['bindTemplate'];this['contentFieldView']=new mt(_0x398e13,_0x5b2f02),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x21a5d['if']('isVisible','ck-hidden',_0x83aa0e=>!_0x83aa0e)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x21a5d['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x27bc0f=!0x1;this['on']('change:value',(_0x2035c2,_0x51c452,_0x3ee826)=>{const _0x5fa63f=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3ee826),this['isProcessing']&&_0x5fa63f&&!_0x27bc0f&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1f1b36,_0x4c0d17,_0x16ff01)=>{_0x27bc0f=!0x1,_0x16ff01?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x27bc0f=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x27bc0f=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x495db0=this['locale'],_0x290687=new _0xac8519(this['locale']),_0x3ed68d='ck-ai-form__copy-button';return _0x290687['set']({'label':i(_0x495db0,'Copy'),'icon':W,'class':_0x3ed68d,'tooltip':!0x0}),_0x290687['bind']('isVisible')['to'](this,'value',_0x43bcc0=>!!_0x43bcc0),_0x290687['bind']('isEnabled')['to'](this,'isProcessing',_0x446214=>!_0x446214),_0x290687['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x290687['icon']=_0x2b54b3['check'],_0x290687['class']=_0x3ed68d+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x290687['icon']=W,_0x290687['class']=_0x3ed68d;},0x3e8);}),_0x290687;}['_copyHTMLToClipboard'](_0x141527){const {window:_0x32b857,document:_0x5831eb}=_0x41a13f;if(_0x32b857['ClipboardItem']){const {Blob:_0x609268,ClipboardItem:_0x5ecece}=_0x32b857,_0x51c022=[new _0x5ecece({'text/html':new _0x609268([_0x141527['innerHTML']],{'type':'text/html'}),'text/plain':new _0x609268([_0x141527['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x51c022);}else{const _0x29e86c=_0x5831eb['createElement']('div');_0x29e86c['style']['position']='absolute',_0x29e86c['style']['left']='-9999px',_0x29e86c['innerHTML']='<span>[</span>'+_0x141527['innerHTML']+'<span>]</span>',_0x5831eb['body']['appendChild'](_0x29e86c);const _0x5d643b=_0x5831eb['createRange']();_0x5d643b['setStartAfter'](_0x29e86c['firstElementChild']),_0x5d643b['setEndBefore'](_0x29e86c['lastElementChild']);const _0x1d369a=_0x32b857['getSelection']();_0x1d369a['removeAllRanges'](),_0x1d369a['addRange'](_0x5d643b),_0x5831eb['execCommand']('copy'),_0x29e86c['remove']();}}}class mt extends _0x56b163{constructor(_0x45d5b1,_0x4d11f9=''){super(_0x45d5b1),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4d11f9,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x564496){this['element']['innerHTML']=_0x564496;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x21a0f5=new _0x56b163(),_0x8e38b4=this['locale'],_0x5759d5=new _0x30c0b6();return _0x5759d5['isVisible']=!0x0,_0x21a0f5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x5759d5,{'text':i(_0x8e38b4,'AI\x20is\x20writing...')}]}),_0x21a0f5['render'](),_0x21a0f5;}}class rt extends _0x56b163{constructor(_0x48371b,_0x50a329=''){super(_0x48371b);const _0x29ff2c=new _0x50dca6(),_0x4851b9=this['bindTemplate'];this['set']('text',_0x50a329),_0x29ff2c['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x29ff2c,{'text':_0x4851b9['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x19babc,_0x8bd463){super(_0x19babc,_0x8bd463),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x637fc1,_0x4a87d5)=>{_0x637fc1['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4a87d5());});}['_createSubmitButton'](){const _0x2cea54=new _0xac8519(this['locale']),_0x502fc1=this['locale'];return _0x2cea54['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x502fc1,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x2cea54['on']('execute',()=>{this['submit']();}),_0x2cea54['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x44c415,_0x3f0f2f)=>!_0x44c415&&_0x3f0f2f),_0x2cea54;}['_createShowHistoryButton'](){const _0x170b0d=new _0xac8519(this['locale']),_0x4e40f6=this['resultsView'],_0x4d04a5=this['locale'];_0x170b0d['set']({'label':i(_0x4d04a5,'History'),'withText':!0x1,'icon':_0x2b54b3['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x170b0d['bind']('isOn')['to'](_0x4e40f6,'isVisible'),_0x170b0d['bind']('isEnabled')['to'](this,'isEnabled'),_0x170b0d['on']('execute',()=>{_0x4e40f6['isVisible']=!_0x4e40f6['isVisible'],_0x4e40f6['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3965d9=()=>{_0x41a13f['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x28ef83=new st(this['queryView']['fieldView']['element']),_0x9f711d=_0x28ef83['width'],_0x6f0957='rtl'===_0x4d04a5['uiLanguageDirection']?'left':'right';_0x28ef83['excludeScrollbarsAndBorders'](),_0x170b0d['element']['style'][_0x6f0957]=_0x9f711d-_0x28ef83['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3965d9),this['on']('render',_0x3965d9),_0x170b0d;}['submit'](){const _0x4ae3ca=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4ae3ca);}['focus'](_0x5f251d){-0x1===_0x5f251d?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x27f4c9){super(_0x27f4c9),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x27f4c9,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x1ffc07=0x0;for(const _0x18d383 of this['items'])_0x1ffc07+=_0x18d383['items']['length'];return{'resultsCount':_0x1ffc07,'totalItemsCount':_0x1ffc07};}['_createClearHistoryButton'](){const _0x343db9=this['locale'],_0x52f692=new _0xac8519(this['locale']);return _0x52f692['set']({'label':'('+i(_0x343db9,'Clear')+')','withText':!0x0}),_0x52f692['on']('execute',()=>this['fire']('clearHistory')),_0x52f692;}}class hs extends _0x1a34ed{constructor(_0x2f8ea5){super();const _0x1eb602=new te(),_0x87ac86=new _0xac8519(this['locale'],_0x1eb602);this['children']['add'](_0x87ac86),_0x87ac86['set']({'label':_0x2f8ea5['prompt'],'withText':!0x0}),_0x87ac86['on']('execute',()=>{this['fire']('execute',{'value':_0x324dad(_0x2f8ea5['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x230f7b{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x281f59,_0x5e9b1d)=>{const _0x1ef4a7=Ss(_0x5e9b1d['prompt']);for(const _0x35837a of this)if(_0x35837a!=_0x5e9b1d&&Ss(_0x35837a['prompt'])===_0x1ef4a7){this['remove'](_0x35837a);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2f6fa5=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x2f6fa5));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x55feb7=>_0x55feb7)));}}function Ss(_0x2d8cf3){return _0x2d8cf3['toLowerCase']()['trim']();}class k extends _0x56b163{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x47db2a,_0x2f1547,_0x2943dc=''){super(_0x47db2a),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new rt(_0x47db2a),this['contentArea']=new X(_0x47db2a,_0x2943dc),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new _0x2985fb(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x203c09({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x2a0011=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2f1547],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x2a0011['if']('isError','ck-hidden',_0x1c4461=>!_0x1c4461)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x5d032f=0x1){-0x1===_0x5d032f?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x554aea=this['locale'],_0x910346=new ht(_0x554aea,{'queryView':{'label':i(_0x554aea,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x46c6e4,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x554aea,'Empty\x20history'),'secondary':i(_0x554aea,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x910346['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x417750,_0x30f051)=>_0x417750&&!_0x30f051),this['listenTo'](_0x910346,'submit',(_0x35965a,_0x1c8719)=>{this['prompt']=_0x1c8719;const _0x556bdb=_0xe9a49d(_0x1c8719);this['fire']('submitPrompt',_0x556bdb),_0x1c8719['trim']()&&this['_promptHistory']['add']({'prompt':_0x556bdb},0x0);},{'priority':'high'}),_0x910346;}['_createHistoryView'](){const _0x201667=new rs(this['locale']);return _0x201667['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x201667['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x201667;}['_createToolbar'](){const _0x31101d=new at(this['locale']);return _0x31101d['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1184af,_0x361540,_0x55a440)=>_0x1184af&&!_0x361540&&!!_0x55a440),_0x31101d['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x31101d['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x32ebff,_0xb83530,_0x59e9cf)=>_0x32ebff&&!_0xb83530&&!!_0x59e9cf),_0x31101d['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x31101d['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x49e0de,_0x1bd88b)=>_0x49e0de&&!_0x1bd88b),_0x31101d['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x31101d['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x31101d['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x31101d;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xb11870=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0xb11870,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0xe2ff2d){const _0x478d23=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0xe2ff2d||i(_0x478d23,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const w=globalThis['DataTransfer'];class n extends _0x210901{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x458b6e,a,K,_0x4d751f];}constructor(_0x1280ab){super(_0x1280ab),_0x1280ab['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1280ab['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x1280ab['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1280ab['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x47f587}=this;this['_aiAdapter']=_0x47f587['plugins']['get'](K),this['_dialog']=_0x47f587['plugins']['get'](_0x4d751f),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1c4b18=new E(_0x47f587,Array['from'](this['_commandDefinitions']['values']()));_0x47f587['commands']['add']('showAIAssistant',_0x1c4b18),_0x47f587['ui']['componentFactory']['add']('aiCommands',_0x27b430=>{const _0x462330=_0x498b2b(_0x27b430);return _0x462330['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x462330['buttonView']['set']({'label':i(_0x27b430,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x462330['on']('execute',_0x54dc5e=>this['_onExecute'](_0x54dc5e['source']['id'])),_0x52357e(_0x462330,_0x47f587['ui']['view']['body'],function(_0x371b75){const _0x5b2de3=o(_0x371b75['config']['get']('ai.aiAssistant.commands'),_0x371b75['locale']),_0x7b0343=U(_0x371b75,_0x5b2de3)['filter'](_0x3671ff=>_0x3671ff['commands']['length']);if(0x1===_0x7b0343['length'])return U(_0x371b75,_0x7b0343[0x0]['commands'])['map'](_0x4b3832=>({'id':_0x4b3832['id'],'label':_0x4b3832['label']}));return _0x7b0343['map'](_0x1f71fe=>{const {groupId:_0xe68322,groupLabel:_0x3cf9fd,commands:_0x473806}=_0x1f71fe,_0x226f2c=U(_0x371b75,_0x473806)['map'](_0x53b06a=>({'id':_0x53b06a['id'],'label':_0x53b06a['label']}));return{'id':_0xe68322,'menu':_0x3cf9fd||_0xe68322,'children':_0x226f2c};});}(_0x47f587),{'ariaLabel':i(_0x27b430,'AI\x20Commands')}),_0x462330['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1c4b18['on']('change:enabledCommandsIds',_0x574975),_0x462330['menuView']['once']('render',_0x574975),_0x462330;function _0x574975(){_0x462330['isEnabled']=_0x1c4b18['enabledCommandsIds']['length']>0x0;for(const _0x46c5b1 of _0x462330['menuView']['buttons'])_0x46c5b1['isEnabled']=_0x1c4b18['enabledCommandsIds']['includes'](_0x46c5b1['id']);}}),_0x47f587['ui']['componentFactory']['add']('menuBar:aiCommands',_0x373b63=>{const _0x48bbbe=new _0x3da5d8(_0x373b63);_0x48bbbe['buttonView']['set']({'label':i(_0x373b63,'AI\x20Commands'),'icon':T}),_0x48bbbe['bind']('isEnabled')['to'](_0x1c4b18,'enabledCommandsIds',_0x5c34b6=>_0x5c34b6['length']>0x0);const _0x49e07a=o(_0x47f587['config']['get']('ai.aiAssistant.commands'),_0x373b63);return this['_populateMenuBarMenu'](_0x1c4b18,_0x48bbbe,_0x49e07a,_0x2672f0=>this['_onExecute'](_0x2672f0)),_0x48bbbe;}),_0x47f587['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x440fe2=this['_createAIAssistantUIButton'](_0xac8519);return _0x440fe2['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x440fe2;}),_0x47f587['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x29e948=this['_createAIAssistantUIButton'](_0x1d9b4c);return _0x29e948['set']({'role':'menuitemcheckbox'}),_0x29e948;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x26c603=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x5a1879;for(const _0x4995fe in _0x26c603){const _0x4177ce=_0x4995fe,_0x325b60=_0x26c603[_0x4177ce];if('aiLicenseKeyValid'==_0x325b60||'aiLicenseKeyInvalid'==_0x325b60||'aiLicenseKeyExpired'==_0x325b60||'aiLicenseKeyDomainLimit'==_0x325b60||'aiLicenseKeyNotAllowed'==_0x325b60||'aiLicenseKeyEvaluationLimit'==_0x325b60||'aiLicenseKeyTrialLimit'==_0x325b60||'aiLicenseKeyUsageLimit'==_0x325b60){delete _0x26c603[_0x4177ce],_0x5a1879=_0x325b60,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x5a1879&&_0x26c603['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x5a1879&&_0x26c603['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x5a1879&&_0x26c603['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x5a1879&&_0x26c603['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x5a1879&&_0x26c603['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x5a1879&&_0x26c603['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x5a1879&&_0x26c603['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x21a872='',_0x5c9a2e='',_0x13db55='custom'){const _0x5313b5=this['editor'],_0x277c60=_0x5313b5['editing']['view'],_0x205d79=_0x5313b5['plugins']['get'](a),_0x393c74=_0x5313b5['plugins']['get'](_0x458b6e);_0x205d79['showFakeVisualSelection']();const _0x333437=new w(),_0x3befb9=new ClipboardEvent('copy',{'clipboardData':_0x333437}),_0x51045c=new _0xb09230(_0x333437),_0x2136f1=new _0x84b76e(_0x277c60,_0x3befb9,{'dataTransfer':_0x51045c});_0x393c74['_forceMarkersCopy']('comment',()=>{_0x277c60['document']['fire']('copy',_0x2136f1);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x5313b5,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x6921f5=_0x51045c['getData']('text/html');const _0x557e97=_0x5313b5['model']['document']['selection'],_0x4804f6=Array['from'](_0x557e97['getRanges']());0x1===_0x4804f6['length']&&_0x4804f6[0x0]['isFlat']&&!_0x557e97['getSelectedElement']()&&''!==_0x6921f5['replace'](/ /g,'')['trim']()&&(_0x6921f5='<p>'+_0x6921f5+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x13db55,'query':_0x21a872,'htmlContent':_0x6921f5,'label':_0x5c9a2e,'mainActionLabel':M[_0x5313b5['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x1b6130['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x205d79['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x425c78=new Map(),_0x10859e=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x2d1845 of _0x10859e)for(const _0x215ca9 of _0x2d1845['commands'])_0x425c78['set'](_0x215ca9['id'],{..._0x215ca9,'groupId':_0x2d1845['groupId'],'groupLabel':_0x2d1845['groupLabel']||_0x2d1845['groupId']});return _0x425c78;}['_createAIAssistantUIButton'](_0x537239){const _0x475c76=this['editor'],_0x4efd13=_0x475c76['commands']['get']('showAIAssistant'),_0x5ed59e=new _0x537239(_0x475c76['locale']);return _0x5ed59e['set']({'label':i(_0x475c76['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x5ed59e['bind']('isEnabled')['to'](_0x4efd13),_0x5ed59e['bind']('isOn')['to'](this['_dialog'],'id',_0x3d9ff3=>'aiAssistant'===_0x3d9ff3),this['listenTo'](_0x5ed59e,'execute',()=>{_0x5ed59e['isOn']?this['hideUI']():_0x4efd13['execute']();}),_0x5ed59e;}['_initView'](){const _0x2ee06=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x2ee06['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x2ee06['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x192436,ui:{ariaLiveAnnouncer:_0x33d2de}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x13d16a,_0x4ac14a,_0x320fa8)=>{const _0x318cfc=this['_aiAssistantController']['currentContext'];_0x320fa8?_0x33d2de['announce'](i(_0x192436,'AI\x20is\x20writing')):_0x318cfc&&_0x33d2de['announce'](i(_0x192436,'Generated\x20content:\x20%0',_0x318cfc),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x2b834c,_0x2c8b9c,_0xc2571d)=>{if(_0xc2571d){const _0x194893=this['_formView']['errorView']['text'];_0x33d2de['announce'](i(_0x192436,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x194893));}});}['_onExecute'](_0x3ea4b1){const _0x270d99=this['_commandDefinitions']['get'](_0x3ea4b1),_0x90f167=this['editor'],_0x533738=_0x90f167['model']['document']['selection'],_0x580a63=_0x90f167['commands']['get']('showAIAssistant'),_0x4b640e=_0x90f167['plugins']['get'](a),_0x3f1770=''+(_0x270d99['groupId']!==x?_0x270d99['groupLabel']+':\x20':'')+_0x270d99['label'];if(!0x1!==_0x270d99['requiresContent']&&_0x533738['isCollapsed']){const _0x62c618=_0x5285cf(_0x533738['getSelectedBlocks']())||_0x90f167['model']['schema']['getLimitElement'](_0x533738);_0x90f167['model']['change'](_0x5c28b4=>{_0x5c28b4['setSelection'](_0x62c618,'in');});}_0x4b640e['showFakeVisualSelection'](),_0x580a63['execute'](_0x270d99['prompt'],_0x3f1770,'command:'+_0x3ea4b1);}['_populateMenuBarMenu'](_0x2ec0d3,_0x1585b3,_0x406a50,_0x313d6b){const _0x39e7f7=this['editor'],_0x231f52=_0x39e7f7['locale'],_0x4d7d8f=new _0x2c2810(_0x231f52),_0x4f2ca9=U(_0x39e7f7,_0x406a50)['filter'](_0x5444e5=>_0x5444e5['commands']['length']);0x1===_0x4f2ca9['length']?this['_getMenuBarGroupButtons']({'command':_0x2ec0d3,'commands':_0x4f2ca9[0x0]['commands'],'parentMenuView':_0x1585b3,'onExecute':_0x313d6b})['forEach'](_0x17d642=>_0x4d7d8f['items']['add'](_0x17d642)):_0x4f2ca9['forEach'](({groupId:_0xaa15f9,groupLabel:_0x47c656,commands:_0x6f7d73})=>{const _0x256a6d=new _0x541696(_0x231f52,_0x1585b3),_0x2c57cd=new _0x3da5d8(_0x231f52),_0x5b8aba=new _0x2c2810(_0x231f52),_0x33bf0b=this['_getMenuBarGroupButtons']({'command':_0x2ec0d3,'commands':_0x6f7d73,'parentMenuView':_0x2c57cd,'onExecute':_0x313d6b});_0x2c57cd['buttonView']['set']({'label':_0x47c656||_0xaa15f9}),_0x2c57cd['delegate']('execute')['to'](_0x1585b3),_0x5b8aba['items']['addMany'](_0x33bf0b),_0x2c57cd['panelView']['children']['add'](_0x5b8aba),_0x256a6d['children']['add'](_0x2c57cd),_0x4d7d8f['items']['add'](_0x256a6d);}),_0x1585b3['panelView']['children']['add'](_0x4d7d8f);}['_getMenuBarGroupButtons']({command:_0x2043b1,commands:_0x1e2cbf,parentMenuView:_0x21f985,onExecute:_0x3a2476}){const _0xb7e861=this['editor'],_0x4f218d=_0xb7e861['locale'];return U(_0xb7e861,_0x1e2cbf)['map'](_0x49d815=>{const _0x11efbc=new _0x541696(_0x4f218d,_0x21f985),_0x395b19=new _0x1d9b4c(_0x4f218d);return _0x395b19['set']({'label':_0x49d815['label']}),_0x395b19['delegate']('execute')['to'](_0x21f985),_0x395b19['on']('execute',()=>_0x3a2476(_0x49d815['id'])),_0x395b19['bind']('isEnabled')['to'](_0x2043b1,'enabledCommandsIds',_0x45e0c6=>_0x45e0c6['includes'](_0x49d815['id'])),_0x11efbc['children']['add'](_0x395b19),_0x11efbc;});}}function B(_0x20e27c,_0x2ac256){return void 0x0!==_0x20e27c['order']&&void 0x0===_0x2ac256['order']?0x1:void 0x0===_0x20e27c['order']&&void 0x0!==_0x2ac256['order']?-0x1:void 0x0!==_0x20e27c['order']&&void 0x0!==_0x2ac256['order']?_0x20e27c['order']-_0x2ac256['order']:0x0;}function U(_0xe9b1a4,_0x1116d2){_0x1116d2['sort'](B);const _0x5d6e5a={},_0x18d856=[];for(const _0x33e109 of _0x1116d2)if(void 0x0!==_0x33e109['order']){if(_0x33e109['order']in _0x5d6e5a)throw new _0x5d7528('ai-commands-config-order-collision',_0xe9b1a4,{'conflictingDefinitions':[_0x33e109,_0x5d6e5a[_0x33e109['order']]]});_0x5d6e5a[_0x33e109['order']]=_0x33e109,_0x18d856['splice'](_0x33e109['order'],0x0,_0x33e109);}else _0x18d856['push'](_0x33e109);return _0x18d856;}class r extends _0x210901{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x312f09){super(_0x312f09);const _0x206750=_0x312f09['config'],_0x415172=_0x312f09['locale'];_0x206750['define']('ai.aiAssistant.preserveComments',!0x0),_0x206750['define']('ai.aiAssistant.commands',function(_0x307591){return[{'groupId':'editOrReview','groupLabel':i(_0x307591,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x307591,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x307591,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':i(_0x307591,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x307591,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':i(_0x307591,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x307591,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':i(_0x307591,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':i(_0x307591,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x307591,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x307591,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x307591,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x307591,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x307591,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x307591,'Change\x20style'),'commands':[{'id':'business','label':i(_0x307591,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x307591,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x307591,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x307591,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x307591,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x307591,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x307591,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x307591,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x307591,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x307591,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x307591,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x307591,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x307591,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x415172)),_0x206750['define']('ai.aiAssistant.extraCommandGroups',[]),_0x206750['define']('ai.aiAssistant.removeCommands',[]);let _0x32fd3f=o(_0x206750['get']('ai.aiAssistant.commands'),_0x415172);const _0x2050ab=_0x206750['get']('ai.aiAssistant.extraCommandGroups'),_0x4540e8=_0x206750['get']('ai.aiAssistant.removeCommands');_0x2050ab['forEach'](_0x57e591=>{const _0x10d02b=_0x32fd3f['find'](_0x2c74ee=>_0x2c74ee['groupId']===_0x57e591['groupId']);_0x10d02b?_0x10d02b['commands']=_0x10d02b['commands']['concat'](_0x57e591['commands']):_0x32fd3f['push'](_0x57e591);}),_0x32fd3f=_0x32fd3f['filter'](_0x43d8cb=>!_0x4540e8['includes'](_0x43d8cb['groupId'])),_0x32fd3f['forEach'](_0x283862=>{_0x283862['commands']=_0x283862['commands']['filter'](_0x42721c=>!_0x4540e8['includes'](_0x42721c['id']));}),_0x206750['set']('ai.aiAssistant.commands',_0x32fd3f);}}class P extends _0x210901{['abortController'];static get['requires'](){return[K];}constructor(_0x361c3c){super(_0x361c3c),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0xf3b760){return this['sendRequest'](_0xf3b760)['catch'](_0x3953a4=>{if(_0x3953a4 instanceof R)return Promise['reject'](_0x3953a4);if('AbortError'==_0x3953a4['name'])return Promise['resolve']();throw console['error'](_0x3953a4),new _0x5d7528('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x81c29b,_0x2ec70b){const _0xff7604=this['editor']['locale'],_0x1dcd3e={'Content-Type':'application/json'};if('object'==typeof _0x81c29b)Object['assign'](_0x1dcd3e,_0x81c29b);else{if(_0x81c29b)try{const _0x5eb8ec=await _0x81c29b(_0x2ec70b);Object['assign'](_0x1dcd3e,_0x5eb8ec);}catch(_0x144962){return Promise['reject'](new R(i(_0xff7604,'AI_ERROR_GET_HEADERS')));}}return _0x1dcd3e;}async['_prepareRequestParameters'](_0x47145f,_0x5d5e37){const _0x33fb39=this['editor']['locale'];if('object'==typeof _0x47145f)return _0x47145f;try{return await _0x47145f(_0x5d5e37);}catch(_0x1f9ec0){return Promise['reject'](new R(i(_0x33fb39,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x48d2f2){super(_0x48d2f2),_0x48d2f2['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x48d2f2['config']['get']('ai.openAI.requestParameters')||_0x48d2f2['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x48d2f2['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x48d2f2['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x48d2f2['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x137baf,context:_0x4cfa32,onData:_0x2be328,actionId:_0x1e09be}){const _0x5c0134=this['editor']['locale'],_0x5d4b15=await this['prepareMessages'](_0x137baf,_0x4cfa32,_0x1e09be),_0x420b1c=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1e09be),_0x38ebc3=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1e09be),_0x67ea5c={'messages':_0x5d4b15,..._0x38ebc3},_0xe84548={'method':'POST','headers':_0x420b1c,'body':JSON['stringify'](_0x67ea5c),'signal':this['abortController']['signal']},_0x374746=await fetch(this['_apiUrl'],_0xe84548);if(_0x374746['ok'])return _0x38ebc3['stream']?await this['_readStreamableResponse'](_0x374746,_0x2be328):await this['_readStaticResponse'](_0x374746,_0x2be328),Promise['resolve']();{const _0x3955ea=await _0x374746['text']();return _0x3955ea['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x5c0134,'AI_ERROR_CONTEXT_LENGTH'))):_0x3955ea['includes']('Moderation')?Promise['reject'](new R(i(_0x5c0134,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3955ea));}}async['prepareMessages'](_0x5e9d42,_0x2560aa,_0xa38346){let _0x15a352,_0x53d581;return _0x2560aa?(_0x15a352='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x53d581='Instruction:\x0a'+_0x5e9d42+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2560aa):(_0x15a352='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x53d581=_0x5e9d42),[{'role':'system','content':_0x15a352},{'role':'user','content':_0x53d581}];}async['_readStreamableResponse'](_0x333c10,_0x58b52b){const _0x51a25f=_0x333c10['body']['getReader'](),_0x139e5a=new TextDecoder();let _0xaba4aa='',_0xba6669='',_0x1eb5a1='',_0x394bb5=!0x1;for(;!_0x394bb5;){const {done:_0x4908bb,value:_0x340c08}=await _0x51a25f['read'](),_0x3a0809=_0xaba4aa+_0x139e5a['decode'](_0x340c08);let _0x55bddc='';_0x394bb5=_0x4908bb;try{_0x55bddc=this['_cleanUpData'](_0x3a0809),_0xaba4aa='';}catch(_0x201db5){_0xaba4aa=_0x3a0809;continue;}_0xba6669+=_0x55bddc,!_0x394bb5&&this['_isBufferIncomplete'](_0xba6669)||_0xba6669&&(_0x1eb5a1+=_0xba6669,_0xba6669='',_0x58b52b(_0x1eb5a1));}return Promise['resolve']();}async['_readStaticResponse'](_0x28e3d0,_0x522693){return _0x522693((await _0x28e3d0['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x5c59e3){const _0x3d5d21=_0x5c59e3['split']('<')['length']!==_0x5c59e3['split']('>')['length'],_0x3e3824=_0x5c59e3['length']<0x1e;return _0x3d5d21&&_0x3e3824;}['_cleanUpData'](_0x9fd570){return _0x9fd570['split'](/\n(?![^{]*\})/g)['map'](_0x2183d0=>_0x2183d0['replace']('data:\x20',''))['filter'](_0x20a3d0=>_0x20a3d0&&_0x20a3d0['length']>0x0&&'[DONE]'!==_0x20a3d0)['map'](_0x3ef835=>{const {choices:_0x9bbe23}=JSON['parse'](_0x3ef835);if(_0x9bbe23[0x0]&&_0x9bbe23[0x0]['delta']&&_0x9bbe23[0x0]['delta']['content'])return _0x9bbe23[0x0]['delta']['content'];})['filter'](_0x4cfb4e=>_0x4cfb4e)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x294660){super(_0x294660),_0x294660['config']['get']('ai.aws.requestParameters')||_0x294660['config']['define']('ai.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x294660['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x294660['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x294660['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x294660['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x62f508,context:_0xa1448b,onData:_0x3b7a1f,actionId:_0x1f37cf}){const {model:_0x3baefa,stream:_0x418a61,..._0xe780d2}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1f37cf),_0x51cce9={'prompt':await this['preparePrompt'](_0x62f508,_0xa1448b,_0x3baefa,_0x1f37cf),..._0xe780d2};this['_apiUrl']?await this['_processProxyRequest'](_0x51cce9,_0x3baefa,_0x418a61,_0x3b7a1f,_0x1f37cf):await this['_processAWSRequest'](_0x51cce9,_0x3baefa,_0x418a61,_0x3b7a1f);}async['preparePrompt'](_0xb085b0,_0x32797e,_0x21f0c0,_0x517dc7){let _0x51ba0b,_0x2b164c;return _0x32797e?(_0x51ba0b='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x2b164c='Instruction:\x0a'+_0xb085b0+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x32797e):(_0x51ba0b='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x2b164c=_0xb085b0),'meta.llama'==this['getModelFamily'](_0x21f0c0)?'<<SYS>>\x0a'+_0x51ba0b+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2b164c+'\x0a[/INST]':'Human:\x0a'+_0x51ba0b+'\x0a'+_0x2b164c+'\x0a\x0aAssistant:';}['getModelFamily'](_0x5bc099){if(/^anthropic\.claude/['test'](_0x5bc099))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x5bc099))return'ai21.j2';if(/^cohere\.command/['test'](_0x5bc099))return'cohere.command';if(/^meta\.llama/['test'](_0x5bc099))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x5bc099));}async['_processProxyRequest'](_0x496e97,_0x505159,_0x38c4bf,_0x35c808,_0x4332df){const _0x344df5={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4332df),'body':JSON['stringify']({..._0x496e97,'model':_0x505159,'stream':_0x38c4bf}),'signal':this['abortController']['signal']},_0x4b3647=await fetch(this['_apiUrl'],_0x344df5);_0x38c4bf?await this['_readStreamableResponse'](_0x4b3647,_0x505159,_0x35c808):await this['_readStaticResponse'](_0x4b3647,_0x505159,_0x35c808);}async['_processAWSRequest'](_0x7af468,_0x49ecaf,_0x40f7db,_0x4e7742){const _0x43ad2c=new _0x3051df(this['_bedrockClientConfig']),_0x466687={'body':JSON['stringify'](_0x7af468),'contentType':'application/json','accept':'application/json','modelId':_0x49ecaf};let _0x31c793;if(_0x40f7db){const _0x4042ea=new _0x51aa2b(_0x466687);_0x31c793=await _0x43ad2c['send'](_0x4042ea,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x31c793,_0x49ecaf,_0x4e7742);}else{const _0x5e5181=new _0xf4fed9(_0x466687);_0x31c793=await _0x43ad2c['send'](_0x5e5181,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x31c793,_0x49ecaf,_0x4e7742);}}async['_readAsyncIterableResponse'](_0x5858ad,_0x5d1292,_0xc9e963){const _0x5cdc84=_0x5858ad['body'],_0x36353d=new TextDecoder('utf-8');let _0x478c77='';for await(const _0x4b83ef of _0x5cdc84)if(_0x4b83ef['chunk']){const _0x2b2183=_0x36353d['decode'](_0x4b83ef['chunk']['bytes']),_0x5956f0=JSON['parse'](_0x2b2183);_0x478c77+=this['_getGeneratedText'](_0x5956f0,_0x5d1292),_0xc9e963(_0x478c77);}return Promise['resolve']();}async['_readStreamableResponse'](_0x59f94c,_0xf31406,_0x322a5e){const _0x4f8475=_0x59f94c['body'],_0x7cd069=new TextDecoder('utf-8'),_0x19a78b=_0x4f8475['getReader']();let _0x3737c0='',_0x16d130='',_0xa0c312=!0x1;for(;!_0xa0c312;){const {done:_0x1686db,value:_0x21a6aa}=await _0x19a78b['read']();if(_0xa0c312=_0x1686db,_0xa0c312)break;const _0x37d7e1=(_0x3737c0+_0x7cd069['decode'](_0x21a6aa))['split']('\x0a')['map'](_0x43eeb5=>{try{return _0x3737c0='',JSON['parse'](_0x43eeb5);}catch(_0x2bf2b1){return _0x3737c0=_0x43eeb5,null;}})['filter'](_0x5e1c7e=>null!==_0x5e1c7e);_0x37d7e1['length']&&(_0x16d130+=_0x37d7e1['map'](_0xdf17cd=>this['_getGeneratedText'](_0xdf17cd,_0xf31406))['join'](''),_0x322a5e(_0x16d130));}return Promise['resolve']();}async['_readStaticResponse'](_0x26fe71,_0x557852,_0xd25589){let _0x27446b;return _0x27446b=_0x26fe71 instanceof Response?await _0x26fe71['json']():JSON['parse'](Buffer['from'](_0x26fe71['body'])['toString']('utf8')),(_0xd25589(this['_getGeneratedText'](_0x27446b,_0x557852)),Promise['resolve']());}['_getGeneratedText'](_0x52eee5,_0x3ba663){switch(this['getModelFamily'](_0x3ba663)){case'anthropic.claude':return _0x52eee5['completion'];case'ai21.j2':return _0x52eee5['completions'][0x0]['data']['text'];case'cohere.command':return _0x52eee5['generations'][0x0]['text'];case'meta.llama':return _0x52eee5['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0x15375e,Command as _0x33a6a5,icons as _0x26603f}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x2c4a4b,CKEditorError as _0x3c6290,ObservableMixin as _0x1bf658,global as _0x5548ba,isVisible as it,Rect as st,Collection as _0x20079b,FocusTracker as _0x370795,KeystrokeHandler as ts,first as _0x249773}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x151ffe,View as _0x592667,SpinnerView as _0x48d7db,IconView as _0x530997,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x2d9c8f,ButtonLabelView as te,FocusCycler as _0x2cc4aa,createLabeledTextarea as _0x328161,Dialog as _0x312400,createDropdown as _0x57b979,addMenuToDropdown as _0x2ce31a,MenuBarMenuView as _0xf24ba4,MenuBarMenuListItemButtonView as _0x58300a,DialogViewPosition as _0x2448b4,MenuBarMenuListView as _0x2e3e37,MenuBarMenuListItemView as _0x4f67cd}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x375a68,ClipboardMarkersUtils as _0x3c3431}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x3978c8,DataTransfer as _0x566e20,UpcastWriter as _0x2ce7d7,Matcher as _0x4c5826}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x30a2cf,escape as _0x2c5250}from'lodash-es';import{BedrockRuntimeClient as _0x246855,InvokeModelWithResponseStreamCommand as _0x154cd6,InvokeModelCommand as _0x52c848}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x2aefa2,_0x41a07a){const _0x1b1131=(0x0,_0x41a07a['t'])('Other');return _0x2aefa2['length']?'groupId'in _0x2aefa2[0x0]?_0x2aefa2:[{'groupId':x,'groupLabel':_0x1b1131,'order':0x1/0x0,'commands':_0x2aefa2}]:[{'groupId':x,'groupLabel':_0x1b1131,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x15375e{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3dd7f3}=this,_0x3c29c0=['ck-fake-ai-selection'];_0x3dd7f3['config']['get']('ai.useTheme')&&_0x3c29c0['push']('ck-ai-assistant-ui_theme'),_0x3dd7f3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x3c29c0,'priority':0xc}}),_0x3dd7f3['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x1d53d7,{writer:_0x39b1c1})=>{if(!_0x1d53d7['markerRange']['isCollapsed'])return null;const _0x5edda5=_0x39b1c1['createUIElement']('span');return _0x39b1c1['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5edda5),_0x5edda5;}});}['afterInit'](){!async function(_0x44e249){const _0x36d3f8=_0x4a3bb9([0x62,0x66,0x41,0x31,0x59,0x37,0x65,0x67,0x4e,0x79,0x4d,0x78,0x34,0x69,0x6d,0x53,0x4a,0x54,0x71,0x46,0x64,0x76,0x42,0x48,0x6a,0x75,0x55,0x77,0x7a,0x63,0x43,0x73,0x35,0x44,0x58,0x51,0x6f,0x61,0x6c,0x32,0x4f,0x68,0x33,0x52,0x72,0x4b,0x5a,0x6b,0x36,0x4c,0x56,0x70,0x50,0x30,0x57,0x39,0x47,0x45,0x74,0x49,0x38,0x6e]),_0x1151dd=0x629a7a6a,_0x511a86=0x629d255a^_0x1151dd,_0x47af83=window[_0x4a3bb9([0x44,0x61,0x74,0x65])][_0x4a3bb9([0x6e,0x6f,0x77])](),_0x4d78d8=_0x44e249[_0x4a3bb9([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1a449f=new window[(_0x4a3bb9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2ae250=>{_0x4d78d8[_0x4a3bb9([0x6f,0x6e,0x63,0x65])](_0x4a3bb9([0x72,0x65,0x61,0x64,0x79]),_0x2ae250);}),_0x1489a7={[_0x4a3bb9([0x6b,0x74,0x79])]:_0x4a3bb9([0x45,0x43]),[_0x4a3bb9([0x75,0x73,0x65])]:_0x4a3bb9([0x73,0x69,0x67]),[_0x4a3bb9([0x63,0x72,0x76])]:_0x4a3bb9([0x50,0x2d,0x32,0x35,0x36]),[_0x4a3bb9([0x78])]:_0x4a3bb9([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x4a3bb9([0x79])]:_0x4a3bb9([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x4a3bb9([0x61,0x6c,0x67])]:_0x4a3bb9([0x45,0x53,0x32,0x35,0x36])},_0x3919fc=_0x4d78d8[_0x4a3bb9([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4a3bb9([0x67,0x65,0x74])](_0x4a3bb9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x408731(){let _0xa34959,_0x35d894=null,_0x265e5e=null;try{if(_0x3919fc==_0x4a3bb9([0x47,0x50,0x4c]))return _0x4a3bb9([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0xa34959=_0x240914(),!_0xa34959)return _0x4a3bb9([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0xa34959[_0x4a3bb9([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x265e5e=_0x78004c(_0xa34959[_0x4a3bb9([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0xa34959[_0x4a3bb9([0x6a,0x74,0x69])])),await _0x4daa7a()?_0x2e127e()?_0x441800()?_0x4a3bb9([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4c3902()?(_0xa34959[_0x4a3bb9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4a3bb9([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x35d894=_0x1ad26f(_0x4a3bb9([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0xa34959[_0x4a3bb9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4a3bb9([0x74,0x72,0x69,0x61,0x6c])&&(_0x35d894=_0x1ad26f(_0x4a3bb9([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x444d00()):_0x4a3bb9([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4a3bb9([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4a3bb9([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x204cfc){return _0x4a3bb9([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x441800(){const _0x5bb708=[_0x4a3bb9([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4a3bb9([0x74,0x72,0x69,0x61,0x6c])][_0x4a3bb9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xa34959[_0x4a3bb9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x47af83/0x3e8:0xe10*_0x511a86;return _0xa34959[_0x4a3bb9([0x65,0x78,0x70])]<_0x5bb708;}function _0x2e127e(){const _0x1bdc1c=_0xa34959[_0x4a3bb9([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1bdc1c&&(!!_0x1bdc1c[_0x4a3bb9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4a3bb9([0x2a]))||!!_0x1bdc1c[_0x4a3bb9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4a3bb9([0x41,0x49])));}function _0x4c3902(){const _0x36ba5e=_0xa34959[_0x4a3bb9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x36ba5e||0x0==_0x36ba5e[_0x4a3bb9([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x5f0211}=new URL(window[_0x4a3bb9([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x36ba5e[_0x4a3bb9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5f0211))return!0x0;const _0x27d4b4=_0x5f0211[_0x4a3bb9([0x73,0x70,0x6c,0x69,0x74])](_0x4a3bb9([0x2e]));return _0x36ba5e[_0x4a3bb9([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1d3954=>_0x1d3954[_0x4a3bb9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4a3bb9([0x2a])))[_0x4a3bb9([0x6d,0x61,0x70])](_0x474232=>_0x474232[_0x4a3bb9([0x73,0x70,0x6c,0x69,0x74])](_0x4a3bb9([0x2e])))[_0x4a3bb9([0x73,0x6f,0x6d,0x65])](_0x2f3413=>_0x27d4b4[_0x4a3bb9([0x65,0x76,0x65,0x72,0x79])]((_0x109acd,_0x4d06dd)=>_0x2f3413[_0x4d06dd]===_0x109acd||_0x2f3413[_0x4d06dd]===_0x4a3bb9([0x2a])));}function _0x444d00(){return _0x35d894&&_0x265e5e?new window[(_0x4a3bb9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x59678d,_0x3999d7)=>{_0x35d894[_0x4a3bb9([0x74,0x68,0x65,0x6e])](_0x59678d,_0x3999d7),_0x265e5e[_0x4a3bb9([0x74,0x68,0x65,0x6e])](_0x1ac0f3=>{_0x1ac0f3!=_0x4a3bb9([0x56,0x61,0x6c,0x69,0x64])&&_0x59678d(_0x1ac0f3);},_0x3999d7);}):_0x35d894||_0x265e5e||_0x4a3bb9([0x56,0x61,0x6c,0x69,0x64]);}}function _0x78004c(_0x291c87,_0xe50e10){return new window[(_0x4a3bb9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x594bea=>{if(_0x502410())return _0x594bea(_0x4a3bb9([0x56,0x61,0x6c,0x69,0x64]));_0x1982eb(),_0x4d78d8[_0x4a3bb9([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4a3bb9([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x405774=!0x1;const _0xfe13ae=_0x2c4a4b();function _0x2b6aa5(_0x13e471){return!!_0x13e471&&(typeof _0x13e471===_0x4a3bb9([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x13e471===_0x4a3bb9([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x13e471[_0x4a3bb9([0x74,0x68,0x65,0x6e])]===_0x4a3bb9([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x13e471[_0x4a3bb9([0x63,0x61,0x74,0x63,0x68])]===_0x4a3bb9([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x440579(_0x2739b7){_0xb75f67(_0x2739b7)[_0x4a3bb9([0x74,0x68,0x65,0x6e])](_0x41bdee=>{if(!_0x41bdee||_0x41bdee[_0x4a3bb9([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4a3bb9([0x6f,0x6b]))return _0x4a3bb9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x516d82(_0x5888f4(_0xfe13ae+_0xe50e10))!=_0x41bdee[_0x4a3bb9([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4a3bb9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4a3bb9([0x56,0x61,0x6c,0x69,0x64]);})[_0x4a3bb9([0x74,0x68,0x65,0x6e])](_0x3f92a1=>(_0x3e3a85(),_0x3f92a1),()=>{const _0xc8ef74=_0x2ff3c2();return null==_0xc8ef74?(_0x3e3a85(),_0x4a3bb9([0x56,0x61,0x6c,0x69,0x64])):_0x4a3bb9(_0x47af83-_0xc8ef74>(0x4696fe6a^_0x1151dd)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4a3bb9([0x74,0x68,0x65,0x6e])](_0x594bea)[_0x4a3bb9([0x63,0x61,0x74,0x63,0x68])](()=>{_0x594bea(_0x4a3bb9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x253fab=0x62ac94ea^_0x1151dd;function _0x3e3a85(){const _0x574058=_0x4a3bb9([0x6c,0x6c,0x63,0x74,0x2d])+_0x516d82(_0x5888f4(_0x291c87)),_0x5061c9=_0x3a57cd(_0x516d82(window[_0x4a3bb9([0x4d,0x61,0x74,0x68])][_0x4a3bb9([0x63,0x65,0x69,0x6c])](_0x47af83/_0x253fab)));window[_0x4a3bb9([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4a3bb9([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x574058,_0x5061c9);}function _0x2ff3c2(){const _0x54fa6c=_0x4a3bb9([0x6c,0x6c,0x63,0x74,0x2d])+_0x516d82(_0x5888f4(_0x291c87)),_0x180af6=window[_0x4a3bb9([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4a3bb9([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x54fa6c);return _0x180af6?window[_0x4a3bb9([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3a57cd(_0x180af6),0x10)*_0x253fab:null;}function _0xb75f67(_0x3d375c){return new window[(_0x4a3bb9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x167d66,_0x28333a)=>{_0x3d375c[_0x4a3bb9([0x74,0x68,0x65,0x6e])](_0x167d66,_0x28333a),window[_0x4a3bb9([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x28333a,0x629baeaa^_0x1151dd);});}}_0x4d78d8[_0x4a3bb9([0x6f,0x6e])](_0x4a3bb9([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x13dbd8,_0x2f3a91)=>{if(_0x2f3a91[0x0]!=_0x291c87)return _0x594bea(_0x4a3bb9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x2f3a91[0x1]={..._0x2f3a91[0x1],[_0x4a3bb9([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0xfe13ae};},{[_0x4a3bb9([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4a3bb9([0x68,0x69,0x67,0x68])}),_0x4d78d8[_0x4a3bb9([0x6f,0x6e])](_0x4a3bb9([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xbcaef4=>{_0x2b6aa5(_0xbcaef4[_0x4a3bb9([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x405774=!0x0,_0x440579(_0xbcaef4[_0x4a3bb9([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4a3bb9([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4a3bb9([0x6c,0x6f,0x77])}),_0x1a449f[_0x4a3bb9([0x74,0x68,0x65,0x6e])](()=>{_0x405774||_0x594bea(_0x4a3bb9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x502410(){return _0x4d78d8[_0x4a3bb9([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4a3bb9([0x76,0x69,0x65,0x77])][_0x4a3bb9([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4a3bb9([0x61,0x75,0x74,0x6f]);}function _0x1982eb(){_0x4d78d8[_0x4a3bb9([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4a3bb9([0x76,0x69,0x65,0x77])][_0x4a3bb9([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4a3bb9([0x61,0x75,0x74,0x6f]);}}function _0x1ad26f(_0x45720c){const _0x439f52=[new window[(_0x4a3bb9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x90e9ee=>setTimeout(_0x90e9ee,0x629344a6^_0x1151dd)),_0x1a449f[_0x4a3bb9([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4a3bb9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4ef398=>{let _0x1bb9ef=0x0;_0x4d78d8[_0x4a3bb9([0x6d,0x6f,0x64,0x65,0x6c])][_0x4a3bb9([0x6f,0x6e])](_0x4a3bb9([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x485e32,_0x2e0bde)=>{_0x2e0bde[0x0][_0x4a3bb9([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1bb9ef++,_0x1bb9ef==(0x629a7b92^_0x1151dd)&&(_0x4ef398(),_0x485e32[_0x4a3bb9([0x6f,0x66,0x66])]());});}))];return window[_0x4a3bb9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4a3bb9([0x72,0x61,0x63,0x65])](_0x439f52)[_0x4a3bb9([0x74,0x68,0x65,0x6e])](()=>_0x45720c);}async function _0x6aef4c(){await _0x1a449f,_0x4d78d8[_0x4a3bb9([0x6d,0x6f,0x64,0x65,0x6c])][_0x4a3bb9([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x8ec026,_0x4d78d8[_0x4a3bb9([0x6d,0x6f,0x64,0x65,0x6c])][_0x4a3bb9([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x8ec026,_0x4d78d8[_0x4a3bb9([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4a3bb9([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x1319f2(_0x5cb4a7){const _0x5e9048=_0xf96094();_0x4d78d8[_0x5e9048]=_0x4a3bb9([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5cb4a7,_0x5cb4a7!=_0x4a3bb9([0x56,0x61,0x6c,0x69,0x64])&&_0x6aef4c();}function _0xf96094(){const _0xd14951=window[_0x4a3bb9([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4a3bb9([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4a3bb9([0x6e,0x6f,0x77])]())[_0x4a3bb9([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4a3bb9([0x2e]),'');let _0x268d4a=_0x4a3bb9([0x62]);for(let _0x395066=0x0;_0x395066<_0xd14951[_0x4a3bb9([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x395066+=0x2){let _0x13fe85=window[_0x4a3bb9([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xd14951[_0x4a3bb9([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x395066,_0x395066+0x2));_0x13fe85>=_0x36d3f8[_0x4a3bb9([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x13fe85-=_0x36d3f8[_0x4a3bb9([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x268d4a+=_0x36d3f8[_0x13fe85];}return _0x268d4a;}function _0x240914(){const _0x1ef3f3=_0x3919fc[_0x4a3bb9([0x73,0x70,0x6c,0x69,0x74])](_0x4a3bb9([0x2e]));if(0x3!=_0x1ef3f3[_0x4a3bb9([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x522509(_0x1ef3f3[0x1]);function _0x522509(_0x56a3e5){const _0x554429=_0x4b2fc8(_0x56a3e5);return _0x554429&&_0xb0c1a8()?_0x554429:null;function _0xb0c1a8(){const _0x3cdce6=_0x554429[_0x4a3bb9([0x6a,0x74,0x69])],_0x5d0a39=window[_0x4a3bb9([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3cdce6[_0x4a3bb9([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3cdce6[_0x4a3bb9([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2de75f={..._0x554429,[_0x4a3bb9([0x6a,0x74,0x69])]:_0x3cdce6[_0x4a3bb9([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3cdce6[_0x4a3bb9([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2de75f[_0x4a3bb9([0x76,0x63])],_0x5888f4(_0x2de75f)==_0x5d0a39;}}}async function _0x4daa7a(){let _0x34b2dc=!0x0;try{const _0x1ac4ff=_0x3919fc[_0x4a3bb9([0x73,0x70,0x6c,0x69,0x74])](_0x4a3bb9([0x2e])),[_0x25cd6d,_0xf5fed,_0x26ed34]=_0x1ac4ff;return _0x4fde94(_0x25cd6d),await _0xc89d2e(_0x25cd6d,_0xf5fed,_0x26ed34),_0x34b2dc;}catch(_0xdc2267){return!0x1;}function _0x4fde94(_0x399138){const _0x32799a=_0x4b2fc8(_0x399138);_0x32799a&&_0x32799a[_0x4a3bb9([0x61,0x6c,0x67])]==_0x4a3bb9([0x45,0x53,0x32,0x35,0x36])||(_0x34b2dc=!0x1);}async function _0xc89d2e(_0x59d360,_0x4e0ac0,_0xc6f39f){const _0x1ab07e=window[_0x4a3bb9([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4a3bb9([0x66,0x72,0x6f,0x6d])](_0x43e439(_0xc6f39f),_0x312539=>_0x312539[_0x4a3bb9([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2f1ced=new window[(_0x4a3bb9([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4a3bb9([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x59d360+_0x4a3bb9([0x2e])+_0x4e0ac0),_0x4c87b1=window[_0x4a3bb9([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4a3bb9([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x4c87b1)return;const _0x2f67fe=await _0x4c87b1[_0x4a3bb9([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4a3bb9([0x6a,0x77,0x6b]),_0x1489a7,{[_0x4a3bb9([0x6e,0x61,0x6d,0x65])]:_0x4a3bb9([0x45,0x43,0x44,0x53,0x41]),[_0x4a3bb9([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4a3bb9([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4a3bb9([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x4c87b1[_0x4a3bb9([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4a3bb9([0x6e,0x61,0x6d,0x65])]:_0x4a3bb9([0x45,0x43,0x44,0x53,0x41]),[_0x4a3bb9([0x68,0x61,0x73,0x68])]:{[_0x4a3bb9([0x6e,0x61,0x6d,0x65])]:_0x4a3bb9([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2f67fe,_0x1ab07e,_0x2f1ced)||(_0x34b2dc=!0x1);}}function _0x4b2fc8(_0x4aa217){return _0x4aa217[_0x4a3bb9([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4a3bb9([0x65,0x79]))?JSON[_0x4a3bb9([0x70,0x61,0x72,0x73,0x65])](_0x43e439(_0x4aa217)):null;}function _0x43e439(_0x5bb66a){return window[_0x4a3bb9([0x61,0x74,0x6f,0x62])](_0x5bb66a[_0x4a3bb9([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4a3bb9([0x2b]))[_0x4a3bb9([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4a3bb9([0x2f])));}function _0x5888f4(_0xdafd14){let _0x45ca70=0x1505;function _0x47af61(_0xa3b21f){for(let _0x40a53c=0x0;_0x40a53c<_0xa3b21f[_0x4a3bb9([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x40a53c++){const _0x4e628a=_0xa3b21f[_0x4a3bb9([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x40a53c);_0x45ca70=(_0x45ca70<<0x5)+_0x45ca70+_0x4e628a,_0x45ca70&=_0x45ca70;}}function _0x32f1e5(_0x3f5897){Array[_0x4a3bb9([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3f5897)?_0x3f5897[_0x4a3bb9([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x32f1e5):_0x3f5897&&typeof _0x3f5897==_0x4a3bb9([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4a3bb9([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3f5897)[_0x4a3bb9([0x73,0x6f,0x72,0x74])]()[_0x4a3bb9([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x435a8b,_0x321312])=>{_0x47af61(_0x435a8b),_0x32f1e5(_0x321312);}):_0x47af61(window[_0x4a3bb9([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3f5897));}return _0x32f1e5(_0xdafd14),_0x45ca70>>>0x0;}function _0x516d82(_0x556ea1){return _0x556ea1[_0x4a3bb9([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4a3bb9([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4a3bb9([0x30]));}function _0x3a57cd(_0x58b9b7){return _0x58b9b7[_0x4a3bb9([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4a3bb9([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4a3bb9([0x6a,0x6f,0x69,0x6e])]('');}function _0x8ec026(){}function _0x4a3bb9(_0x138aa2){return _0x138aa2['map'](_0x1d1599=>String['fromCharCode'](_0x1d1599))['join']('');}_0x1319f2(await _0x408731());}(this);}['showFakeVisualSelection'](){const _0x4480bb=this['editor']['model'];_0x4480bb['change'](_0x35ae48=>{const _0x142a24=_0x4480bb['document']['selection']['getRanges']();let _0xdffd3d=0x0;for(const _0x46eada of _0x142a24){const _0x358d03=f+':'+_0xdffd3d;if(_0x4480bb['markers']['has'](_0x358d03))_0x35ae48['updateMarker'](_0x358d03,{'range':_0x46eada});else{if(_0x46eada['start']['isAtEnd']){const _0xd0c5d9=_0x46eada['start']['getLastMatchingPosition'](({item:_0xdfad74})=>!_0x4480bb['schema']['isContent'](_0xdfad74),{'boundaries':_0x46eada});_0x35ae48['addMarker'](_0x358d03,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x35ae48['createRange'](_0xd0c5d9,_0x46eada['end'])});}else _0x35ae48['addMarker'](_0x358d03,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x46eada});}_0xdffd3d++;}});}['hideFakeVisualSelection'](){const _0x5f310d=this['editor']['model'],_0x109e8c=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x109e8c['length']&&_0x5f310d['change'](_0x1d6232=>{_0x109e8c['forEach'](_0xbe63b2=>{_0x1d6232['removeMarker'](_0xbe63b2);});});}['insertContent'](_0x97d101,_0xd83528){const _0xe40035=this['_getAISelection'](),_0x41a34e=_0xd83528||_0xe40035['getFirstRange']();this['editor']['model']['canEditAt'](_0x41a34e)&&this['editor']['model']['change'](_0x206820=>{this['hideFakeVisualSelection'](),_0xd83528||this['_resetContentOfSelectedTableCells'](_0x206820,_0xe40035),this['_pasteHTMLUsingClipboard']({'insertAt':_0x41a34e,'writer':_0x206820,'html':_0x97d101});});}['insertContentBelow'](_0x3084dc){const {model:_0x3c3d40}=this['editor'],_0xd7e0d5=this['_getAISelection']();_0x3c3d40['change'](()=>{const _0x4c4889=this['_prepareTableInsertBelowPosition'](_0x3084dc,_0xd7e0d5)||this['_getDefaultInsertBelowPosition'](_0xd7e0d5);this['insertContent'](_0x3084dc,_0x4c4889);});}['_getAISelection'](){const _0x125558=this['editor']['model'],_0xd40ad6=Array['from'](_0x125558['markers']['getMarkersGroup'](f))['map'](_0x458c7d=>_0x458c7d['getRange']());return _0x125558['createSelection'](_0xd40ad6);}['_pasteHTMLUsingClipboard']({writer:_0x4b31de,html:_0x2f9643,insertAt:_0x4ae5d1}){const {view:_0x180a2c}=this['editor']['editing'],_0x5c33c8=this['editor']['plugins']['get'](_0x375a68),_0x9b6b7e=new dt();_0x9b6b7e['setData']('text/html',_0x2f9643);const _0x51eea8=new ClipboardEvent('paste',{'clipboardData':_0x9b6b7e}),_0x55e69e=new _0x3978c8(_0x180a2c,_0x51eea8,{'dataTransfer':new _0x566e20(_0x9b6b7e)});_0x4b31de['setSelection'](_0x4ae5d1);const _0x57fad7=(_0x246223,_0x59b4a2)=>{_0x59b4a2['resultRange']&&_0x4b31de['setSelection'](_0x59b4a2['resultRange']);};_0x5c33c8['once']('contentInsertion',_0x57fad7,{'priority':'lowest'}),_0x180a2c['document']['fire']('paste',_0x55e69e),_0x5c33c8['off']('contentInsertion',_0x57fad7);}['_getDefaultInsertBelowPosition'](_0x302306){const {model:_0x4e9c56}=this['editor'],_0x2d1e94=Array['from'](_0x302306['getSelectedBlocks']());return _0x2d1e94['length']?_0x4e9c56['createPositionAfter'](_0x2d1e94['pop']()):_0x302306['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x5c5128,_0x4e384d){const {model:_0xa3c50,plugins:_0x54478b}=this['editor'];if(_0x54478b['has']('TableUtils')){const _0x5f017b=_0x54478b['get']('TableUtils')['getSelectedTableCells'](_0x4e384d);if(_0x5f017b['length']){const _0x1ef8b8=this['_getTableRowCountFromContent'](_0x5c5128),_0x5701ac=this['_createEmptyTableRows'](_0x5f017b,_0x1ef8b8);return _0xa3c50['createPositionAt'](_0x5701ac,0x0);}}return null;}['_getTableRowCountFromContent'](_0x60b30e){const _0x2f53da=this['editor']['plugins']['get']('TableUtils'),_0xface6d=this['editor']['data']['parse'](_0x60b30e),_0x5008ee=Array['from'](_0xface6d['getChildren']())['filter'](_0x2d882d=>_0x2d882d['is']('element','table'));let _0x2ece1e=0x0;return _0x5008ee['forEach'](_0xd316ea=>{_0x2ece1e+=_0x2f53da['getRows'](_0xd316ea);}),_0x2ece1e;}['_createEmptyTableRows'](_0x3f8893,_0x1264b7){const _0x38c41d=this['editor']['plugins']['get']('TableUtils'),_0x11dffb=_0x38c41d['getRowIndexes'](_0x3f8893),_0x1da6b5=_0x38c41d['getColumnIndexes'](_0x3f8893),_0x234624=_0x11dffb['last']+0x1,_0x122259=_0x1da6b5['first'],_0x270d97=_0x3f8893[0x0]['findAncestor']('table');for(let _0x26df2d=0x0;_0x26df2d<_0x1264b7;_0x26df2d++)_0x38c41d['insertRows'](_0x270d97,{'at':_0x234624});return _0x270d97['getChild'](_0x234624)['getChild'](_0x122259);}['_resetContentOfSelectedTableCells'](_0x5e2f0b,_0x5229f8){const {plugins:_0x4b6917}=this['editor'],{model:_0x72c978}=_0x5e2f0b;if(!_0x4b6917['has']('TableUtils'))return;_0x4b6917['get']('TableUtils')['getSelectedTableCells'](_0x5229f8)['length']&&_0x72c978['deleteContent'](_0x5229f8);}}class K extends _0x15375e{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x3c6290('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x519464){super(_0x519464),this['name']='AIRequestError';}}function i(_0x2aa600,_0x43ccf9,_0x47e305){const t=_0x2aa600['t'];switch(_0x43ccf9){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x47e305);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x47e305);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x47e305);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x43ccf9;}}class E extends _0x33a6a5{['_commandDefinitions'];constructor(_0x490804,_0x5b5be3){super(_0x490804),this['_commandDefinitions']=_0x5b5be3,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x501c7e,_0x263e4c,_0x182836)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x182836));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x1c4ca1,_0x3a92cd,_0x45847b)=>{this['enabledCommandsIds']=_0x45847b?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x32173f=this['editor']['model'];this['_hasContext']=function(_0x186f19){const _0x37cf43=_0x186f19['document']['selection'];return _0x37cf43['isCollapsed']?0x0!==[..._0x37cf43['getSelectedBlocks']()]['length']&&![..._0x37cf43['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x186f19['hasContent'](_0x37cf43['getFirstRange']());}(_0x32173f);const _0x924727=_0x32173f['document']['selection'],_0x53ce7e=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x5dcea4 of _0x924727['getRanges']())for(const _0x21c812 of _0x5dcea4['getItems']())if(_0x21c812['is']('element')&&_0x53ce7e['includes'](_0x21c812['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x307f85='',_0x1ca67f='',_0x21b5f9='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x307f85,_0x1ca67f,_0x21b5f9);}}function G(_0x246ac6,_0x3ee690){const _0x11dc36=new Set();for(const _0x2bcc35 of _0x246ac6['values']())(_0x3ee690||!0x1===_0x2bcc35['requiresContent'])&&_0x11dc36['add'](_0x2bcc35['id']);return Array['from'](_0x11dc36);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x1bf658(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x27516f,_0x173208,_0x1c76eb){super(),this['editor']=_0x27516f,this['textAdapter']=_0x173208,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1c76eb,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4d5f21,_0x17ffe4,_0x14c4ae)=>{this['view']['value']=this['_sanitizeHTML'](_0x14c4ae);}),this['listenTo'](this['view'],'submitPrompt',(_0xb51160,_0xd1240f)=>{const _0x4e2a59=this['currentContext']||this['initialContext'];this['_handleQuery'](_0xd1240f,_0x4e2a59,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x45d8f4,query:_0x361bf7,htmlContent:_0x38f3a3,label:_0x1f8b61,mainActionLabel:_0x2e2b9c}){this['view']['prompt']=_0x1f8b61,this['view']['mainAction']=_0x2e2b9c,this['initialContext']=_0x38f3a3,_0x361bf7&&(this['view']['isRendered']?this['_handleQuery'](_0x361bf7,_0x38f3a3,_0x45d8f4,_0x1f8b61):this['view']['once']('render',()=>{this['_handleQuery'](_0x361bf7,_0x38f3a3,_0x45d8f4,_0x1f8b61);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x3234d2,_0x223b8e,_0x43b568,_0x1646d0){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x223b8e,this['previousQuery']=_0x3234d2,this['previousLabel']=_0x1646d0||_0x3234d2,this['previousActionId']=_0x43b568,new Promise(_0x507498=>{this['textAdapter']['makeRequest']({'query':_0x3234d2,'context':_0x223b8e,'onData':_0x87f735=>{this['currentResponse']=_0x87f735,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x43b568})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x52ee30=>{_0x52ee30 instanceof R?this['view']['handleError'](_0x52ee30['message']):this['view']['handleError'](),_0x507498();})['finally'](()=>{this['stopProcessing'](),_0x507498();});});}['_parseAndNormalizeContent'](_0x23d2c1,_0x4f733c=!0x1){const _0x1853eb=Z['exec'](_0x23d2c1);_0x23d2c1=_0x1853eb?_0x23d2c1['substring'](_0x1853eb[0x1]['length']):_0x23d2c1['length']<0x64&&!_0x4f733c?'':this['_stripMarkdownSyntax'](_0x23d2c1);const _0x50d19e=this['_domParser']['parseFromString'](_0x23d2c1,'text/html');if(_0x1853eb){const _0x147ab1=Array['from'](_0x50d19e['body']['childNodes']);_0x147ab1['reverse']();for(const _0x4f7720 of _0x147ab1){if(_0x4f7720['nodeType']==Node['ELEMENT_NODE'])break;_0x4f7720['remove']();}}const _0x5cb1c2=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x50d19e['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x5cb1c2);const _0x565e4e=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x266a2c=this['editor']['data']['toModel'](_0x5cb1c2);return _0x565e4e||_0x266a2c['markers']['clear'](),this['editor']['data']['stringify'](_0x266a2c);}['_normalizeResponseHeadings'](_0x2a2cb2){const _0x1a35be=new _0x2ce7d7(this['editor']['editing']['view']['document']),_0x4cafcc=new _0x4c5826({'name':/^h[1-5]$/}),_0x310b26=[];let _0x45ef10=!0x1;for(const _0x536a27 of _0x2a2cb2)_0x536a27['is']('element')&&_0x4cafcc['match'](_0x536a27)&&(_0x310b26['push'](_0x536a27),'h1'==_0x536a27['name']&&(_0x45ef10=!0x0));if(_0x45ef10){for(const _0x2ce28d of _0x310b26)_0x1a35be['rename']('h'+(parseInt(_0x2ce28d['name'][0x1])+0x1),_0x2ce28d);}}['_isH1TagSupportEnabled'](){const {data:_0x335ae1,editing:_0x366046}=this['editor'],_0x9d8218=_0x335ae1['htmlProcessor']['toView']('<h1></h1>'),_0x5051f8=_0x335ae1['toView'](_0x335ae1['toModel'](_0x9d8218));return!!_0x366046['view']['domConverter']['viewToDom'](_0x5051f8)['querySelector']('h1');}['_sanitizeHTML'](_0x3050c7){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3050c7),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4f1f6a){const _0x1734c5=_0x4f1f6a['trim']();return _0x1734c5['startsWith']('```html')?_0x1734c5['endsWith']('```')?_0x1734c5['substring'](0x7,_0x1734c5['length']-0x3):_0x1734c5['substring'](0x7):_0x4f1f6a;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0xdb8955){super(_0xdb8955),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x57d1c5=>i(_0xdb8955,'AI_'+_0x57d1c5['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0xdb8955,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0xdb8955,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0xdb8955,'Stop'));const _0x5e12e6=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5e12e6['if']('isVisible','ck-hidden',_0x582d15=>!_0x582d15)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2b4a8d,_0x47d6c1){const _0xad2447=new _0x151ffe(this['locale']);return _0xad2447['set']({'label':_0x2b4a8d,'class':_0x47d6c1||'','isVisible':!0x0,'withText':!0x0}),_0xad2447;}}var W='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class X extends _0x592667{['contentFieldView'];['copyButtonView'];constructor(_0x3148c0,_0x3634e1=''){super(_0x3148c0),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x496d24=this['bindTemplate'];this['contentFieldView']=new mt(_0x3148c0,_0x3634e1),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x496d24['if']('isVisible','ck-hidden',_0x2a53d5=>!_0x2a53d5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x496d24['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x218c3a=!0x1;this['on']('change:value',(_0x10993c,_0x4f6eb2,_0x1c7835)=>{const _0x293da9=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1c7835),this['isProcessing']&&_0x293da9&&!_0x218c3a&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0xde5c23,_0x438333,_0x5ca5e8)=>{_0x218c3a=!0x1,_0x5ca5e8?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x218c3a=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x218c3a=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2c50c0=this['locale'],_0xacbb57=new _0x151ffe(this['locale']),_0x62c3d2='ck-ai-form__copy-button';return _0xacbb57['set']({'label':i(_0x2c50c0,'Copy'),'icon':W,'class':_0x62c3d2,'tooltip':!0x0}),_0xacbb57['bind']('isVisible')['to'](this,'value',_0xbb1ea2=>!!_0xbb1ea2),_0xacbb57['bind']('isEnabled')['to'](this,'isProcessing',_0x4bcd9d=>!_0x4bcd9d),_0xacbb57['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xacbb57['icon']=_0x26603f['check'],_0xacbb57['class']=_0x62c3d2+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xacbb57['icon']=W,_0xacbb57['class']=_0x62c3d2;},0x3e8);}),_0xacbb57;}['_copyHTMLToClipboard'](_0x29c98b){const {window:_0x4cfda5,document:_0x2d06e3}=_0x5548ba;if(_0x4cfda5['ClipboardItem']){const {Blob:_0x3ea63f,ClipboardItem:_0x1d53cf}=_0x4cfda5,_0x43f35e=[new _0x1d53cf({'text/html':new _0x3ea63f([_0x29c98b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3ea63f([_0x29c98b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x43f35e);}else{const _0x19d61f=_0x2d06e3['createElement']('div');_0x19d61f['style']['position']='absolute',_0x19d61f['style']['left']='-9999px',_0x19d61f['innerHTML']='<span>[</span>'+_0x29c98b['innerHTML']+'<span>]</span>',_0x2d06e3['body']['appendChild'](_0x19d61f);const _0x291f1f=_0x2d06e3['createRange']();_0x291f1f['setStartAfter'](_0x19d61f['firstElementChild']),_0x291f1f['setEndBefore'](_0x19d61f['lastElementChild']);const _0x5b0404=_0x4cfda5['getSelection']();_0x5b0404['removeAllRanges'](),_0x5b0404['addRange'](_0x291f1f),_0x2d06e3['execCommand']('copy'),_0x19d61f['remove']();}}}class mt extends _0x592667{constructor(_0x276742,_0x24bb5d=''){super(_0x276742),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x24bb5d,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x444560){this['element']['innerHTML']=_0x444560;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x93dcbd=new _0x592667(),_0x58692e=this['locale'],_0x1a9c5e=new _0x48d7db();return _0x1a9c5e['isVisible']=!0x0,_0x93dcbd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1a9c5e,{'text':i(_0x58692e,'AI\x20is\x20writing...')}]}),_0x93dcbd['render'](),_0x93dcbd;}}class rt extends _0x592667{constructor(_0x20c119,_0x316eb8=''){super(_0x20c119);const _0x56d97e=new _0x530997(),_0x51db7e=this['bindTemplate'];this['set']('text',_0x316eb8),_0x56d97e['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x56d97e,{'text':_0x51db7e['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x284a6e,_0x2e0d32){super(_0x284a6e,_0x2e0d32),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x437a59,_0x2f940b)=>{_0x437a59['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2f940b());});}['_createSubmitButton'](){const _0x31c52b=new _0x151ffe(this['locale']),_0x4cd35a=this['locale'];return _0x31c52b['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x4cd35a,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x31c52b['on']('execute',()=>{this['submit']();}),_0x31c52b['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2eed33,_0x48a943)=>!_0x2eed33&&_0x48a943),_0x31c52b;}['_createShowHistoryButton'](){const _0x1ffabe=new _0x151ffe(this['locale']),_0x5d81a8=this['resultsView'],_0x35193e=this['locale'];_0x1ffabe['set']({'label':i(_0x35193e,'History'),'withText':!0x1,'icon':_0x26603f['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x1ffabe['bind']('isOn')['to'](_0x5d81a8,'isVisible'),_0x1ffabe['bind']('isEnabled')['to'](this,'isEnabled'),_0x1ffabe['on']('execute',()=>{_0x5d81a8['isVisible']=!_0x5d81a8['isVisible'],_0x5d81a8['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2857c9=()=>{_0x5548ba['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x17ec37=new st(this['queryView']['fieldView']['element']),_0x2073aa=_0x17ec37['width'],_0x4386ac='rtl'===_0x35193e['uiLanguageDirection']?'left':'right';_0x17ec37['excludeScrollbarsAndBorders'](),_0x1ffabe['element']['style'][_0x4386ac]=_0x2073aa-_0x17ec37['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2857c9),this['on']('render',_0x2857c9),_0x1ffabe;}['submit'](){const _0xb78f5f=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0xb78f5f);}['focus'](_0x434f64){-0x1===_0x434f64?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x550757){super(_0x550757),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x550757,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4e0f4f=0x0;for(const _0x3af9ed of this['items'])_0x4e0f4f+=_0x3af9ed['items']['length'];return{'resultsCount':_0x4e0f4f,'totalItemsCount':_0x4e0f4f};}['_createClearHistoryButton'](){const _0x3d5aff=this['locale'],_0x192b98=new _0x151ffe(this['locale']);return _0x192b98['set']({'label':'('+i(_0x3d5aff,'Clear')+')','withText':!0x0}),_0x192b98['on']('execute',()=>this['fire']('clearHistory')),_0x192b98;}}class hs extends _0x2d9c8f{constructor(_0x5f4609){super();const _0x144cf8=new te(),_0x4113bd=new _0x151ffe(this['locale'],_0x144cf8);this['children']['add'](_0x4113bd),_0x4113bd['set']({'label':_0x5f4609['prompt'],'withText':!0x0}),_0x4113bd['on']('execute',()=>{this['fire']('execute',{'value':_0x30a2cf(_0x5f4609['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x20079b{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x28f50d,_0x44f901)=>{const _0x13dfbf=Ss(_0x44f901['prompt']);for(const _0x1050e6 of this)if(_0x1050e6!=_0x44f901&&Ss(_0x1050e6['prompt'])===_0x13dfbf){this['remove'](_0x1050e6);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x208b63=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x208b63));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x1929de=>_0x1929de)));}}function Ss(_0x4271d4){return _0x4271d4['toLowerCase']()['trim']();}class k extends _0x592667{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2e35e8,_0x3b13c5,_0x4290d8=''){super(_0x2e35e8),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new rt(_0x2e35e8),this['contentArea']=new X(_0x2e35e8,_0x4290d8),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new _0x370795(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x2cc4aa({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x2a2f6a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x3b13c5],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x2a2f6a['if']('isError','ck-hidden',_0x5b7e5f=>!_0x5b7e5f)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x2b777e=0x1){-0x1===_0x2b777e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x54d45e=this['locale'],_0x172dc3=new ht(_0x54d45e,{'queryView':{'label':i(_0x54d45e,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x328161,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x54d45e,'Empty\x20history'),'secondary':i(_0x54d45e,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x172dc3['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4d7ff6,_0x398c1a)=>_0x4d7ff6&&!_0x398c1a),this['listenTo'](_0x172dc3,'submit',(_0x397e82,_0x17e98f)=>{this['prompt']=_0x17e98f;const _0x5b1cb3=_0x2c5250(_0x17e98f);this['fire']('submitPrompt',_0x5b1cb3),_0x17e98f['trim']()&&this['_promptHistory']['add']({'prompt':_0x5b1cb3},0x0);},{'priority':'high'}),_0x172dc3;}['_createHistoryView'](){const _0x2f6ba7=new rs(this['locale']);return _0x2f6ba7['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x2f6ba7['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2f6ba7;}['_createToolbar'](){const _0x9395d9=new at(this['locale']);return _0x9395d9['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5177c2,_0xe30c16,_0x395082)=>_0x5177c2&&!_0xe30c16&&!!_0x395082),_0x9395d9['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x9395d9['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xd641b,_0x170a49,_0x452cd5)=>_0xd641b&&!_0x170a49&&!!_0x452cd5),_0x9395d9['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x9395d9['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x35eae6,_0x20bca8)=>_0x35eae6&&!_0x20bca8),_0x9395d9['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x9395d9['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x9395d9['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x9395d9;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x422131=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x422131,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x39c586){const _0x3ca0b4=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x39c586||i(_0x3ca0b4,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const w=globalThis['DataTransfer'];class n extends _0x15375e{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x3c3431,a,K,_0x312400];}constructor(_0x575bcc){super(_0x575bcc),_0x575bcc['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x575bcc['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x575bcc['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x575bcc['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x33563a}=this;this['_aiAdapter']=_0x33563a['plugins']['get'](K),this['_dialog']=_0x33563a['plugins']['get'](_0x312400),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x23b578=new E(_0x33563a,Array['from'](this['_commandDefinitions']['values']()));_0x33563a['commands']['add']('showAIAssistant',_0x23b578),_0x33563a['ui']['componentFactory']['add']('aiCommands',_0x44dc68=>{const _0x4af7e3=_0x57b979(_0x44dc68);return _0x4af7e3['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4af7e3['buttonView']['set']({'label':i(_0x44dc68,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x4af7e3['on']('execute',_0x4d5644=>this['_onExecute'](_0x4d5644['source']['id'])),_0x2ce31a(_0x4af7e3,_0x33563a['ui']['view']['body'],function(_0x1a0f16){const _0x5ec890=o(_0x1a0f16['config']['get']('ai.aiAssistant.commands'),_0x1a0f16['locale']),_0x1c9568=U(_0x1a0f16,_0x5ec890)['filter'](_0x1db5a1=>_0x1db5a1['commands']['length']);if(0x1===_0x1c9568['length'])return U(_0x1a0f16,_0x1c9568[0x0]['commands'])['map'](_0x17a847=>({'id':_0x17a847['id'],'label':_0x17a847['label']}));return _0x1c9568['map'](_0x5b8361=>{const {groupId:_0x295d64,groupLabel:_0x52e932,commands:_0x47cbae}=_0x5b8361,_0x451037=U(_0x1a0f16,_0x47cbae)['map'](_0x4aeda4=>({'id':_0x4aeda4['id'],'label':_0x4aeda4['label']}));return{'id':_0x295d64,'menu':_0x52e932||_0x295d64,'children':_0x451037};});}(_0x33563a),{'ariaLabel':i(_0x44dc68,'AI\x20Commands')}),_0x4af7e3['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x23b578['on']('change:enabledCommandsIds',_0x1db5fc),_0x4af7e3['menuView']['once']('render',_0x1db5fc),_0x4af7e3;function _0x1db5fc(){_0x4af7e3['isEnabled']=_0x23b578['enabledCommandsIds']['length']>0x0;for(const _0x3824bd of _0x4af7e3['menuView']['buttons'])_0x3824bd['isEnabled']=_0x23b578['enabledCommandsIds']['includes'](_0x3824bd['id']);}}),_0x33563a['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2d38cb=>{const _0x2054df=new _0xf24ba4(_0x2d38cb);_0x2054df['buttonView']['set']({'label':i(_0x2d38cb,'AI\x20Commands'),'icon':T}),_0x2054df['bind']('isEnabled')['to'](_0x23b578,'enabledCommandsIds',_0x156f93=>_0x156f93['length']>0x0);const _0x442d02=o(_0x33563a['config']['get']('ai.aiAssistant.commands'),_0x2d38cb);return this['_populateMenuBarMenu'](_0x23b578,_0x2054df,_0x442d02,_0x2694b5=>this['_onExecute'](_0x2694b5)),_0x2054df;}),_0x33563a['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x27c33f=this['_createAIAssistantUIButton'](_0x151ffe);return _0x27c33f['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x27c33f;}),_0x33563a['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x51d7e8=this['_createAIAssistantUIButton'](_0x58300a);return _0x51d7e8['set']({'role':'menuitemcheckbox'}),_0x51d7e8;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4dc37f=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x141509;for(const _0x9feede in _0x4dc37f){const _0x1ee2ad=_0x9feede,_0x5bc38b=_0x4dc37f[_0x1ee2ad];if('aiLicenseKeyValid'==_0x5bc38b||'aiLicenseKeyInvalid'==_0x5bc38b||'aiLicenseKeyExpired'==_0x5bc38b||'aiLicenseKeyDomainLimit'==_0x5bc38b||'aiLicenseKeyNotAllowed'==_0x5bc38b||'aiLicenseKeyEvaluationLimit'==_0x5bc38b||'aiLicenseKeyTrialLimit'==_0x5bc38b||'aiLicenseKeyUsageLimit'==_0x5bc38b){delete _0x4dc37f[_0x1ee2ad],_0x141509=_0x5bc38b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x141509&&_0x4dc37f['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x141509&&_0x4dc37f['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x141509&&_0x4dc37f['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x141509&&_0x4dc37f['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x141509&&_0x4dc37f['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x141509&&_0x4dc37f['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x141509&&_0x4dc37f['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x4bfbc2='',_0x47a907='',_0x5dc1a3='custom'){const _0x529446=this['editor'],_0x35fc7d=_0x529446['editing']['view'],_0x296693=_0x529446['plugins']['get'](a),_0x8ac48a=_0x529446['plugins']['get'](_0x3c3431);_0x296693['showFakeVisualSelection']();const _0x2ffec8=new w(),_0x3a6b71=new ClipboardEvent('copy',{'clipboardData':_0x2ffec8}),_0x136fb6=new _0x566e20(_0x2ffec8),_0x2e6718=new _0x3978c8(_0x35fc7d,_0x3a6b71,{'dataTransfer':_0x136fb6});_0x8ac48a['_forceMarkersCopy']('comment',()=>{_0x35fc7d['document']['fire']('copy',_0x2e6718);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x529446,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3b4fb6=_0x136fb6['getData']('text/html');const _0x57b566=_0x529446['model']['document']['selection'],_0x155947=Array['from'](_0x57b566['getRanges']());0x1===_0x155947['length']&&_0x155947[0x0]['isFlat']&&!_0x57b566['getSelectedElement']()&&''!==_0x3b4fb6['replace'](/ /g,'')['trim']()&&(_0x3b4fb6='<p>'+_0x3b4fb6+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5dc1a3,'query':_0x4bfbc2,'htmlContent':_0x3b4fb6,'label':_0x47a907,'mainActionLabel':M[_0x529446['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2448b4['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x296693['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x257466=new Map(),_0x487371=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x2d2c4f of _0x487371)for(const _0x3b03da of _0x2d2c4f['commands'])_0x257466['set'](_0x3b03da['id'],{..._0x3b03da,'groupId':_0x2d2c4f['groupId'],'groupLabel':_0x2d2c4f['groupLabel']||_0x2d2c4f['groupId']});return _0x257466;}['_createAIAssistantUIButton'](_0x5272db){const _0x30e610=this['editor'],_0x307ff7=_0x30e610['commands']['get']('showAIAssistant'),_0x16d065=new _0x5272db(_0x30e610['locale']);return _0x16d065['set']({'label':i(_0x30e610['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x16d065['bind']('isEnabled')['to'](_0x307ff7),_0x16d065['bind']('isOn')['to'](this['_dialog'],'id',_0x43d06f=>'aiAssistant'===_0x43d06f),this['listenTo'](_0x16d065,'execute',()=>{_0x16d065['isOn']?this['hideUI']():_0x307ff7['execute']();}),_0x16d065;}['_initView'](){const _0x3878ef=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x3878ef['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3878ef['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x3526d6,ui:{ariaLiveAnnouncer:_0x12e17d}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x37cec8,_0x253907,_0x296359)=>{const _0x23f483=this['_aiAssistantController']['currentContext'];_0x296359?_0x12e17d['announce'](i(_0x3526d6,'AI\x20is\x20writing')):_0x23f483&&_0x12e17d['announce'](i(_0x3526d6,'Generated\x20content:\x20%0',_0x23f483),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x253bfe,_0x555c07,_0x4b6fab)=>{if(_0x4b6fab){const _0x3730b7=this['_formView']['errorView']['text'];_0x12e17d['announce'](i(_0x3526d6,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3730b7));}});}['_onExecute'](_0x45d00a){const _0x34542e=this['_commandDefinitions']['get'](_0x45d00a),_0x5acde2=this['editor'],_0x263775=_0x5acde2['model']['document']['selection'],_0x5b6524=_0x5acde2['commands']['get']('showAIAssistant'),_0x169afc=_0x5acde2['plugins']['get'](a),_0x57f4c6=''+(_0x34542e['groupId']!==x?_0x34542e['groupLabel']+':\x20':'')+_0x34542e['label'];if(!0x1!==_0x34542e['requiresContent']&&_0x263775['isCollapsed']){const _0x4bb844=_0x249773(_0x263775['getSelectedBlocks']())||_0x5acde2['model']['schema']['getLimitElement'](_0x263775);_0x5acde2['model']['change'](_0x2c278e=>{_0x2c278e['setSelection'](_0x4bb844,'in');});}_0x169afc['showFakeVisualSelection'](),_0x5b6524['execute'](_0x34542e['prompt'],_0x57f4c6,'command:'+_0x45d00a);}['_populateMenuBarMenu'](_0x533437,_0x387dc7,_0x12f27e,_0x5ea75f){const _0x51cea7=this['editor'],_0x457a13=_0x51cea7['locale'],_0x4ae1cc=new _0x2e3e37(_0x457a13),_0x2fa4c7=U(_0x51cea7,_0x12f27e)['filter'](_0x1b2a16=>_0x1b2a16['commands']['length']);0x1===_0x2fa4c7['length']?this['_getMenuBarGroupButtons']({'command':_0x533437,'commands':_0x2fa4c7[0x0]['commands'],'parentMenuView':_0x387dc7,'onExecute':_0x5ea75f})['forEach'](_0x33396f=>_0x4ae1cc['items']['add'](_0x33396f)):_0x2fa4c7['forEach'](({groupId:_0x3ed5b4,groupLabel:_0x164b5d,commands:_0x2416cb})=>{const _0x345ce3=new _0x4f67cd(_0x457a13,_0x387dc7),_0x845efa=new _0xf24ba4(_0x457a13),_0x2257cb=new _0x2e3e37(_0x457a13),_0x37022d=this['_getMenuBarGroupButtons']({'command':_0x533437,'commands':_0x2416cb,'parentMenuView':_0x845efa,'onExecute':_0x5ea75f});_0x845efa['buttonView']['set']({'label':_0x164b5d||_0x3ed5b4}),_0x845efa['delegate']('execute')['to'](_0x387dc7),_0x2257cb['items']['addMany'](_0x37022d),_0x845efa['panelView']['children']['add'](_0x2257cb),_0x345ce3['children']['add'](_0x845efa),_0x4ae1cc['items']['add'](_0x345ce3);}),_0x387dc7['panelView']['children']['add'](_0x4ae1cc);}['_getMenuBarGroupButtons']({command:_0x1b08dd,commands:_0x27ed6b,parentMenuView:_0x5e745f,onExecute:_0xd7eb0a}){const _0xa580c2=this['editor'],_0x5286c0=_0xa580c2['locale'];return U(_0xa580c2,_0x27ed6b)['map'](_0x5e1b55=>{const _0x13c6cc=new _0x4f67cd(_0x5286c0,_0x5e745f),_0x38e7a7=new _0x58300a(_0x5286c0);return _0x38e7a7['set']({'label':_0x5e1b55['label']}),_0x38e7a7['delegate']('execute')['to'](_0x5e745f),_0x38e7a7['on']('execute',()=>_0xd7eb0a(_0x5e1b55['id'])),_0x38e7a7['bind']('isEnabled')['to'](_0x1b08dd,'enabledCommandsIds',_0x88165b=>_0x88165b['includes'](_0x5e1b55['id'])),_0x13c6cc['children']['add'](_0x38e7a7),_0x13c6cc;});}}function B(_0x125819,_0x33123e){return void 0x0!==_0x125819['order']&&void 0x0===_0x33123e['order']?0x1:void 0x0===_0x125819['order']&&void 0x0!==_0x33123e['order']?-0x1:void 0x0!==_0x125819['order']&&void 0x0!==_0x33123e['order']?_0x125819['order']-_0x33123e['order']:0x0;}function U(_0x34046b,_0x82a11){_0x82a11['sort'](B);const _0x30752f={},_0x333bf3=[];for(const _0x5b3688 of _0x82a11)if(void 0x0!==_0x5b3688['order']){if(_0x5b3688['order']in _0x30752f)throw new _0x3c6290('ai-commands-config-order-collision',_0x34046b,{'conflictingDefinitions':[_0x5b3688,_0x30752f[_0x5b3688['order']]]});_0x30752f[_0x5b3688['order']]=_0x5b3688,_0x333bf3['splice'](_0x5b3688['order'],0x0,_0x5b3688);}else _0x333bf3['push'](_0x5b3688);return _0x333bf3;}class r extends _0x15375e{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ab595){super(_0x4ab595);const _0x17a0ba=_0x4ab595['config'],_0x5e04fa=_0x4ab595['locale'];_0x17a0ba['define']('ai.aiAssistant.preserveComments',!0x0),_0x17a0ba['define']('ai.aiAssistant.commands',function(_0x1cc05b){return[{'groupId':'editOrReview','groupLabel':i(_0x1cc05b,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x1cc05b,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x1cc05b,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':i(_0x1cc05b,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x1cc05b,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':i(_0x1cc05b,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x1cc05b,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':i(_0x1cc05b,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':i(_0x1cc05b,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x1cc05b,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x1cc05b,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x1cc05b,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x1cc05b,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x1cc05b,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x1cc05b,'Change\x20style'),'commands':[{'id':'business','label':i(_0x1cc05b,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x1cc05b,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x1cc05b,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x1cc05b,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x1cc05b,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x1cc05b,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x1cc05b,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x1cc05b,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x1cc05b,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x1cc05b,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x1cc05b,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x1cc05b,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x1cc05b,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x5e04fa)),_0x17a0ba['define']('ai.aiAssistant.extraCommandGroups',[]),_0x17a0ba['define']('ai.aiAssistant.removeCommands',[]);let _0x258d39=o(_0x17a0ba['get']('ai.aiAssistant.commands'),_0x5e04fa);const _0x17fe6b=_0x17a0ba['get']('ai.aiAssistant.extraCommandGroups'),_0x4a67bc=_0x17a0ba['get']('ai.aiAssistant.removeCommands');_0x17fe6b['forEach'](_0x3d9f56=>{const _0x2ed81d=_0x258d39['find'](_0x10b26f=>_0x10b26f['groupId']===_0x3d9f56['groupId']);_0x2ed81d?_0x2ed81d['commands']=_0x2ed81d['commands']['concat'](_0x3d9f56['commands']):_0x258d39['push'](_0x3d9f56);}),_0x258d39=_0x258d39['filter'](_0x664902=>!_0x4a67bc['includes'](_0x664902['groupId'])),_0x258d39['forEach'](_0x4f8b21=>{_0x4f8b21['commands']=_0x4f8b21['commands']['filter'](_0x3f2a5b=>!_0x4a67bc['includes'](_0x3f2a5b['id']));}),_0x17a0ba['set']('ai.aiAssistant.commands',_0x258d39);}}class P extends _0x15375e{['abortController'];static get['requires'](){return[K];}constructor(_0x2a5eae){super(_0x2a5eae),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0xb10007){return this['sendRequest'](_0xb10007)['catch'](_0x12f106=>{if(_0x12f106 instanceof R)return Promise['reject'](_0x12f106);if('AbortError'==_0x12f106['name'])return Promise['resolve']();throw console['error'](_0x12f106),new _0x3c6290('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x44d630,_0x3c178a){const _0x4b8d85=this['editor']['locale'],_0x4bcc12={'Content-Type':'application/json'};if('object'==typeof _0x44d630)Object['assign'](_0x4bcc12,_0x44d630);else{if(_0x44d630)try{const _0x3fbc47=await _0x44d630(_0x3c178a);Object['assign'](_0x4bcc12,_0x3fbc47);}catch(_0x398e79){return Promise['reject'](new R(i(_0x4b8d85,'AI_ERROR_GET_HEADERS')));}}return _0x4bcc12;}async['_prepareRequestParameters'](_0x5de591,_0x1ec9e7){const _0x89a981=this['editor']['locale'];if('object'==typeof _0x5de591)return _0x5de591;try{return await _0x5de591(_0x1ec9e7);}catch(_0x46c803){return Promise['reject'](new R(i(_0x89a981,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5455a1){super(_0x5455a1),_0x5455a1['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5455a1['config']['get']('ai.openAI.requestParameters')||_0x5455a1['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5455a1['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x5455a1['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x5455a1['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x224c42,context:_0x53c64e,onData:_0x667a00,actionId:_0x5bf34f}){const _0x569a8d=this['editor']['locale'],_0x55b40b=await this['prepareMessages'](_0x224c42,_0x53c64e,_0x5bf34f),_0xe45fef=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5bf34f),_0xf8a091=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5bf34f),_0x2eb706={'messages':_0x55b40b,..._0xf8a091},_0x1c3f7b={'method':'POST','headers':_0xe45fef,'body':JSON['stringify'](_0x2eb706),'signal':this['abortController']['signal']},_0x2056d7=await fetch(this['_apiUrl'],_0x1c3f7b);if(_0x2056d7['ok'])return _0xf8a091['stream']?await this['_readStreamableResponse'](_0x2056d7,_0x667a00):await this['_readStaticResponse'](_0x2056d7,_0x667a00),Promise['resolve']();{const _0x2e4fe3=await _0x2056d7['text']();return _0x2e4fe3['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x569a8d,'AI_ERROR_CONTEXT_LENGTH'))):_0x2e4fe3['includes']('Moderation')?Promise['reject'](new R(i(_0x569a8d,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x2e4fe3));}}async['prepareMessages'](_0x37d5f0,_0xd5aef6,_0x4e6313){let _0x142472,_0x2fb570;return _0xd5aef6?(_0x142472='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x2fb570='Instruction:\x0a'+_0x37d5f0+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xd5aef6):(_0x142472='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x2fb570=_0x37d5f0),[{'role':'system','content':_0x142472},{'role':'user','content':_0x2fb570}];}async['_readStreamableResponse'](_0x3ac468,_0x36f8da){const _0x3ff624=_0x3ac468['body']['getReader'](),_0x35c2df=new TextDecoder();let _0x523a56='',_0x1b07f0='',_0x212571='',_0x5cb4f1=!0x1;for(;!_0x5cb4f1;){const {done:_0x16d52b,value:_0x2da00c}=await _0x3ff624['read'](),_0x3ffd14=_0x523a56+_0x35c2df['decode'](_0x2da00c);let _0x276f4d='';_0x5cb4f1=_0x16d52b;try{_0x276f4d=this['_cleanUpData'](_0x3ffd14),_0x523a56='';}catch(_0x8daa58){_0x523a56=_0x3ffd14;continue;}_0x1b07f0+=_0x276f4d,!_0x5cb4f1&&this['_isBufferIncomplete'](_0x1b07f0)||_0x1b07f0&&(_0x212571+=_0x1b07f0,_0x1b07f0='',_0x36f8da(_0x212571));}return Promise['resolve']();}async['_readStaticResponse'](_0x2d8da4,_0x3b4232){return _0x3b4232((await _0x2d8da4['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x34c167){const _0x2ec7da=_0x34c167['split']('<')['length']!==_0x34c167['split']('>')['length'],_0x4310fe=_0x34c167['length']<0x1e;return _0x2ec7da&&_0x4310fe;}['_cleanUpData'](_0x2ef418){return _0x2ef418['split'](/\n(?![^{]*\})/g)['map'](_0x4354b4=>_0x4354b4['replace']('data:\x20',''))['filter'](_0x38be6e=>_0x38be6e&&_0x38be6e['length']>0x0&&'[DONE]'!==_0x38be6e)['map'](_0x549210=>{const {choices:_0x94770c}=JSON['parse'](_0x549210);if(_0x94770c[0x0]&&_0x94770c[0x0]['delta']&&_0x94770c[0x0]['delta']['content'])return _0x94770c[0x0]['delta']['content'];})['filter'](_0x1b1ed7=>_0x1b1ed7)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x3df6ff){super(_0x3df6ff),_0x3df6ff['config']['get']('ai.aws.requestParameters')||_0x3df6ff['config']['define']('ai.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x3df6ff['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x3df6ff['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x3df6ff['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x3df6ff['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x2768b8,context:_0x2623ef,onData:_0x1df97b,actionId:_0x561f92}){const {model:_0x40dcec,stream:_0x2abcae,..._0x499098}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x561f92),_0x27d05f={'prompt':await this['preparePrompt'](_0x2768b8,_0x2623ef,_0x40dcec,_0x561f92),..._0x499098};this['_apiUrl']?await this['_processProxyRequest'](_0x27d05f,_0x40dcec,_0x2abcae,_0x1df97b,_0x561f92):await this['_processAWSRequest'](_0x27d05f,_0x40dcec,_0x2abcae,_0x1df97b);}async['preparePrompt'](_0x222a3a,_0x3f1fdb,_0x64d0db,_0x20c96d){let _0x223e9e,_0xa81d63;return _0x3f1fdb?(_0x223e9e='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0xa81d63='Instruction:\x0a'+_0x222a3a+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3f1fdb):(_0x223e9e='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0xa81d63=_0x222a3a),'meta.llama'==this['getModelFamily'](_0x64d0db)?'<<SYS>>\x0a'+_0x223e9e+'\x0a<</SYS>>\x0a[INST]\x0a'+_0xa81d63+'\x0a[/INST]':'Human:\x0a'+_0x223e9e+'\x0a'+_0xa81d63+'\x0a\x0aAssistant:';}['getModelFamily'](_0x7324ae){if(/^anthropic\.claude/['test'](_0x7324ae))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x7324ae))return'ai21.j2';if(/^cohere\.command/['test'](_0x7324ae))return'cohere.command';if(/^meta\.llama/['test'](_0x7324ae))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x7324ae));}async['_processProxyRequest'](_0x374086,_0x372763,_0x497d90,_0x3be02b,_0x58ff18){const _0x5a77f9={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x58ff18),'body':JSON['stringify']({..._0x374086,'model':_0x372763,'stream':_0x497d90}),'signal':this['abortController']['signal']},_0xfaf6ae=await fetch(this['_apiUrl'],_0x5a77f9);_0x497d90?await this['_readStreamableResponse'](_0xfaf6ae,_0x372763,_0x3be02b):await this['_readStaticResponse'](_0xfaf6ae,_0x372763,_0x3be02b);}async['_processAWSRequest'](_0x207827,_0x5675c0,_0x4e7dd1,_0x5b5223){const _0x14618a=new _0x246855(this['_bedrockClientConfig']),_0xbfea74={'body':JSON['stringify'](_0x207827),'contentType':'application/json','accept':'application/json','modelId':_0x5675c0};let _0x23aafd;if(_0x4e7dd1){const _0x15013f=new _0x154cd6(_0xbfea74);_0x23aafd=await _0x14618a['send'](_0x15013f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x23aafd,_0x5675c0,_0x5b5223);}else{const _0x2353ad=new _0x52c848(_0xbfea74);_0x23aafd=await _0x14618a['send'](_0x2353ad,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x23aafd,_0x5675c0,_0x5b5223);}}async['_readAsyncIterableResponse'](_0x457ed5,_0x4a2343,_0x6aec7d){const _0x1047a5=_0x457ed5['body'],_0x17bc8a=new TextDecoder('utf-8');let _0x72525c='';for await(const _0x53c942 of _0x1047a5)if(_0x53c942['chunk']){const _0x3c11ce=_0x17bc8a['decode'](_0x53c942['chunk']['bytes']),_0x1c2aa0=JSON['parse'](_0x3c11ce);_0x72525c+=this['_getGeneratedText'](_0x1c2aa0,_0x4a2343),_0x6aec7d(_0x72525c);}return Promise['resolve']();}async['_readStreamableResponse'](_0x3f6f7f,_0x2cdbbb,_0x2142cf){const _0x262424=_0x3f6f7f['body'],_0x8ff6c2=new TextDecoder('utf-8'),_0x1d4132=_0x262424['getReader']();let _0x3acd48='',_0x16eb2b='',_0x2a4fb0=!0x1;for(;!_0x2a4fb0;){const {done:_0x10d0f9,value:_0x31f693}=await _0x1d4132['read']();if(_0x2a4fb0=_0x10d0f9,_0x2a4fb0)break;const _0x5cb6b7=(_0x3acd48+_0x8ff6c2['decode'](_0x31f693))['split']('\x0a')['map'](_0xce2678=>{try{return _0x3acd48='',JSON['parse'](_0xce2678);}catch(_0x527fb7){return _0x3acd48=_0xce2678,null;}})['filter'](_0x574aed=>null!==_0x574aed);_0x5cb6b7['length']&&(_0x16eb2b+=_0x5cb6b7['map'](_0x316298=>this['_getGeneratedText'](_0x316298,_0x2cdbbb))['join'](''),_0x2142cf(_0x16eb2b));}return Promise['resolve']();}async['_readStaticResponse'](_0x5193a0,_0x4403c3,_0x16e835){let _0x46247e;return _0x46247e=_0x5193a0 instanceof Response?await _0x5193a0['json']():JSON['parse'](Buffer['from'](_0x5193a0['body'])['toString']('utf8')),(_0x16e835(this['_getGeneratedText'](_0x46247e,_0x4403c3)),Promise['resolve']());}['_getGeneratedText'](_0xf9599b,_0x35f9a6){switch(this['getModelFamily'](_0x35f9a6)){case'anthropic.claude':return _0xf9599b['completion'];case'ai21.j2':return _0xf9599b['completions'][0x0]['data']['text'];case'cohere.command':return _0xf9599b['generations'][0x0]['text'];case'meta.llama':return _0xf9599b['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x4a0f9d=>0x1!=_0x4a0f9d}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x32d478=>{const {af:{dictionary:_0x2f2d64,getPluralForm:_0x413e0c}}={'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x108f95=>0x1!=_0x108f95}};_0x32d478['af']||={'dictionary':{},'getPluralForm':null},_0x32d478['af']['dictionary']=Object['assign'](_0x32d478['af']['dictionary'],_0x2f2d64),_0x32d478['af']['getPluralForm']=_0x413e0c;})(window['CKEDITOR_TRANSLATIONS']||={});
|
package/dist/translations/ar.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':
|
|
23
|
+
export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x292a56=>0x0==_0x292a56?0x0:0x1==_0x292a56?0x1:0x2==_0x292a56?0x2:_0x292a56%0x64>=0x3&&_0x292a56%0x64<=0xa?0x3:_0x292a56%0x64>=0xb?0x4:0x5}};
|