@ckeditor/ckeditor5-ai 44.2.0-alpha.4 → 44.2.0-alpha.6

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/dist/index.js CHANGED
@@ -20,5 +20,5 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x5c3869,Command as _0x44947f,icons as _0x50bcb8}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x47d5e5,CKEditorError as _0x50c17c,ObservableMixin as _0x3a2e50,global as _0x4334cb,isVisible as it,Rect as st,Collection as _0xcae739,FocusTracker as _0x5a9f9d,KeystrokeHandler as ts,first as _0x1a913c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x1d3846,View as _0x438a2c,SpinnerView as _0x5549b0,IconView as _0x3d0dc4,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x2c6b63,ButtonLabelView as te,FocusCycler as _0x1f443f,createLabeledTextarea as _0x485039,Dialog as _0x352785,createDropdown as _0x3128ee,addMenuToDropdown as _0x3e5861,MenuBarMenuView as _0x3a2c13,MenuBarMenuListItemButtonView as _0xb92597,DialogViewPosition as _0x5af3cd,MenuBarMenuListView as _0x4c7c75,MenuBarMenuListItemView as _0x5b6d2c}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x33b98b,ClipboardMarkersUtils as _0x4bec40}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x3a4bcc,DataTransfer as _0xba96fd,UpcastWriter as _0x550b21,Matcher as _0x4b14ca}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x518ce3,escape as _0x450af6}from'lodash-es';import{BedrockRuntimeClient as _0x14c587,InvokeModelWithResponseStreamCommand as _0x5dc4c8,InvokeModelCommand as _0x53f45b}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x32d19a,_0x3e5d02){const _0x17e91e=(0x0,_0x3e5d02['t'])('Other');return _0x32d19a['length']?'groupId'in _0x32d19a[0x0]?_0x32d19a:[{'groupId':x,'groupLabel':_0x17e91e,'order':0x1/0x0,'commands':_0x32d19a}]:[{'groupId':x,'groupLabel':_0x17e91e,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x5c3869{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x87a989}=this,_0x6b4bc3=['ck-fake-ai-selection'];_0x87a989['config']['get']('ai.useTheme')&&_0x6b4bc3['push']('ck-ai-assistant-ui_theme'),_0x87a989['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x6b4bc3,'priority':0xc}}),_0x87a989['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0xd32a12,{writer:_0x5a4c0e})=>{if(!_0xd32a12['markerRange']['isCollapsed'])return null;const _0x4655da=_0x5a4c0e['createUIElement']('span');return _0x5a4c0e['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4655da),_0x4655da;}});}['afterInit'](){!async function(_0x1792d6){const _0x58adb5=_0x5c60dc([0x56,0x41,0x58,0x51,0x63,0x73,0x45,0x55,0x74,0x31,0x68,0x42,0x62,0x77,0x76,0x64,0x78,0x4a,0x75,0x61,0x7a,0x35,0x39,0x34,0x54,0x4d,0x69,0x49,0x44,0x6f,0x59,0x71,0x30,0x4f,0x70,0x65,0x4e,0x32,0x33,0x79,0x6b,0x6c,0x50,0x6d,0x53,0x38,0x43,0x66,0x67,0x57,0x46,0x47,0x48,0x4b,0x72,0x52,0x37,0x6a,0x5a,0x36,0x6e,0x4c]),_0x5e12d8=0x3898d9d0,_0x46ddd1=0x389f8790^_0x5e12d8,_0x5ecac2=window[_0x5c60dc([0x44,0x61,0x74,0x65])][_0x5c60dc([0x6e,0x6f,0x77])](),_0x532e46=_0x1792d6[_0x5c60dc([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x60fc0d=new window[(_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x54810c=>{_0x532e46[_0x5c60dc([0x6f,0x6e,0x63,0x65])](_0x5c60dc([0x72,0x65,0x61,0x64,0x79]),_0x54810c);}),_0x1bd8b6={[_0x5c60dc([0x6b,0x74,0x79])]:_0x5c60dc([0x45,0x43]),[_0x5c60dc([0x75,0x73,0x65])]:_0x5c60dc([0x73,0x69,0x67]),[_0x5c60dc([0x63,0x72,0x76])]:_0x5c60dc([0x50,0x2d,0x32,0x35,0x36]),[_0x5c60dc([0x78])]:_0x5c60dc([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]),[_0x5c60dc([0x79])]:_0x5c60dc([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]),[_0x5c60dc([0x61,0x6c,0x67])]:_0x5c60dc([0x45,0x53,0x32,0x35,0x36])},_0x12cf64=_0x532e46[_0x5c60dc([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x5c60dc([0x67,0x65,0x74])](_0x5c60dc([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x40106a(){let _0x461ddb,_0x308e10=null,_0x4df1c1=null;try{if(_0x12cf64==_0x5c60dc([0x47,0x50,0x4c]))return _0x5c60dc([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x461ddb=_0x1df50f(),!_0x461ddb)return _0x5c60dc([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x461ddb[_0x5c60dc([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4df1c1=_0x1f29f9(_0x461ddb[_0x5c60dc([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x461ddb[_0x5c60dc([0x6a,0x74,0x69])])),await _0xc302b5()?_0x216ecd()?_0x5141a3()?_0x5c60dc([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3abbee()?(_0x461ddb[_0x5c60dc([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5c60dc([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x308e10=_0x2ee061(_0x5c60dc([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x461ddb[_0x5c60dc([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5c60dc([0x74,0x72,0x69,0x61,0x6c])&&(_0x308e10=_0x2ee061(_0x5c60dc([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x351246()):_0x5c60dc([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x5c60dc([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x5c60dc([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x53c36f){return _0x5c60dc([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5141a3(){const _0x3aea91=[_0x5c60dc([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x5c60dc([0x74,0x72,0x69,0x61,0x6c])][_0x5c60dc([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x461ddb[_0x5c60dc([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5ecac2/0x3e8:0xe10*_0x46ddd1;return _0x461ddb[_0x5c60dc([0x65,0x78,0x70])]<_0x3aea91;}function _0x216ecd(){const _0xfab6ab=_0x461ddb[_0x5c60dc([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xfab6ab&&(!!_0xfab6ab[_0x5c60dc([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5c60dc([0x2a]))||!!_0xfab6ab[_0x5c60dc([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5c60dc([0x41,0x49])));}function _0x3abbee(){const _0x1535a0=_0x461ddb[_0x5c60dc([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1535a0||0x0==_0x1535a0[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x12ca79}=new URL(window[_0x5c60dc([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1535a0[_0x5c60dc([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x12ca79))return!0x0;const _0x313cd3=_0x12ca79[_0x5c60dc([0x73,0x70,0x6c,0x69,0x74])](_0x5c60dc([0x2e]));return _0x1535a0[_0x5c60dc([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3547e8=>_0x3547e8[_0x5c60dc([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5c60dc([0x2a])))[_0x5c60dc([0x6d,0x61,0x70])](_0x43b22f=>_0x43b22f[_0x5c60dc([0x73,0x70,0x6c,0x69,0x74])](_0x5c60dc([0x2e])))[_0x5c60dc([0x73,0x6f,0x6d,0x65])](_0x137e18=>_0x313cd3[_0x5c60dc([0x65,0x76,0x65,0x72,0x79])]((_0x151e8a,_0x4bad5e)=>_0x137e18[_0x4bad5e]===_0x151e8a||_0x137e18[_0x4bad5e]===_0x5c60dc([0x2a])));}function _0x351246(){return _0x308e10&&_0x4df1c1?new window[(_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xa5424a,_0x34b5c8)=>{_0x308e10[_0x5c60dc([0x74,0x68,0x65,0x6e])](_0xa5424a,_0x34b5c8),_0x4df1c1[_0x5c60dc([0x74,0x68,0x65,0x6e])](_0x3ec80f=>{_0x3ec80f!=_0x5c60dc([0x56,0x61,0x6c,0x69,0x64])&&_0xa5424a(_0x3ec80f);},_0x34b5c8);}):_0x308e10||_0x4df1c1||_0x5c60dc([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1f29f9(_0x58ce82,_0x3e6d1b){return new window[(_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x514826=>{if(_0x1d3794())return _0x514826(_0x5c60dc([0x56,0x61,0x6c,0x69,0x64]));_0x552289(),_0x532e46[_0x5c60dc([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x5c60dc([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x2ba8d9=!0x1;const _0x25a376=_0x47d5e5();function _0x5acd57(_0x190cb6){return!!_0x190cb6&&(typeof _0x190cb6===_0x5c60dc([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x190cb6===_0x5c60dc([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x190cb6[_0x5c60dc([0x74,0x68,0x65,0x6e])]===_0x5c60dc([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x190cb6[_0x5c60dc([0x63,0x61,0x74,0x63,0x68])]===_0x5c60dc([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5a7852(_0x5ec062){_0x3ebad9(_0x5ec062)[_0x5c60dc([0x74,0x68,0x65,0x6e])](_0xc0336b=>{if(!_0xc0336b||_0xc0336b[_0x5c60dc([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x5c60dc([0x6f,0x6b]))return _0x5c60dc([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1c50bb(_0x3dd950(_0x25a376+_0x3e6d1b))!=_0xc0336b[_0x5c60dc([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x5c60dc([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x5c60dc([0x56,0x61,0x6c,0x69,0x64]);})[_0x5c60dc([0x74,0x68,0x65,0x6e])](_0x55ca4f=>(_0x41641a(),_0x55ca4f),()=>{const _0xb7ee18=_0x217ede();return null==_0xb7ee18?(_0x41641a(),_0x5c60dc([0x56,0x61,0x6c,0x69,0x64])):_0x5c60dc(_0x5ecac2-_0xb7ee18>(0x1c945dd0^_0x5e12d8)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x5c60dc([0x74,0x68,0x65,0x6e])](_0x514826)[_0x5c60dc([0x63,0x61,0x74,0x63,0x68])](()=>{_0x514826(_0x5c60dc([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4ec2eb=0x38ae3750^_0x5e12d8;function _0x41641a(){const _0x369ec9=_0x5c60dc([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c50bb(_0x3dd950(_0x58ce82)),_0x566c9f=_0x260d37(_0x1c50bb(window[_0x5c60dc([0x4d,0x61,0x74,0x68])][_0x5c60dc([0x63,0x65,0x69,0x6c])](_0x5ecac2/_0x4ec2eb)));window[_0x5c60dc([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5c60dc([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x369ec9,_0x566c9f);}function _0x217ede(){const _0xbf17eb=_0x5c60dc([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c50bb(_0x3dd950(_0x58ce82)),_0x5f1aeb=window[_0x5c60dc([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5c60dc([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xbf17eb);return _0x5f1aeb?window[_0x5c60dc([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x260d37(_0x5f1aeb),0x10)*_0x4ec2eb:null;}function _0x3ebad9(_0x52088d){return new window[(_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4bf511,_0x13499f)=>{_0x52088d[_0x5c60dc([0x74,0x68,0x65,0x6e])](_0x4bf511,_0x13499f),window[_0x5c60dc([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x13499f,0x38990d10^_0x5e12d8);});}}_0x532e46[_0x5c60dc([0x6f,0x6e])](_0x5c60dc([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x572f1d,_0xdc8934)=>{if(_0xdc8934[0x0]!=_0x58ce82)return _0x514826(_0x5c60dc([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xdc8934[0x1]={..._0xdc8934[0x1],[_0x5c60dc([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x25a376};},{[_0x5c60dc([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5c60dc([0x68,0x69,0x67,0x68])}),_0x532e46[_0x5c60dc([0x6f,0x6e])](_0x5c60dc([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x376416=>{_0x5acd57(_0x376416[_0x5c60dc([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x2ba8d9=!0x0,_0x5a7852(_0x376416[_0x5c60dc([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x5c60dc([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5c60dc([0x6c,0x6f,0x77])}),_0x60fc0d[_0x5c60dc([0x74,0x68,0x65,0x6e])](()=>{_0x2ba8d9||_0x514826(_0x5c60dc([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1d3794(){return _0x532e46[_0x5c60dc([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5c60dc([0x76,0x69,0x65,0x77])][_0x5c60dc([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x5c60dc([0x61,0x75,0x74,0x6f]);}function _0x552289(){_0x532e46[_0x5c60dc([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5c60dc([0x76,0x69,0x65,0x77])][_0x5c60dc([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x5c60dc([0x61,0x75,0x74,0x6f]);}}function _0x2ee061(_0x427961){const _0x76c412=[new window[(_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2d9d97=>setTimeout(_0x2d9d97,0x3891e71c^_0x5e12d8)),_0x60fc0d[_0x5c60dc([0x74,0x68,0x65,0x6e])](()=>new window[(_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x52419b=>{let _0x199e37=0x0;_0x532e46[_0x5c60dc([0x6d,0x6f,0x64,0x65,0x6c])][_0x5c60dc([0x6f,0x6e])](_0x5c60dc([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1f1b61,_0x101ad6)=>{_0x101ad6[0x0][_0x5c60dc([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x199e37++,_0x199e37==(0x3898d828^_0x5e12d8)&&(_0x52419b(),_0x1f1b61[_0x5c60dc([0x6f,0x66,0x66])]());});}))];return window[_0x5c60dc([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x5c60dc([0x72,0x61,0x63,0x65])](_0x76c412)[_0x5c60dc([0x74,0x68,0x65,0x6e])](()=>_0x427961);}async function _0x19e627(){await _0x60fc0d,_0x532e46[_0x5c60dc([0x6d,0x6f,0x64,0x65,0x6c])][_0x5c60dc([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x32e453,_0x532e46[_0x5c60dc([0x6d,0x6f,0x64,0x65,0x6c])][_0x5c60dc([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x32e453,_0x532e46[_0x5c60dc([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x5c60dc([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2b4db8(_0x24a786){const _0x3dc905=_0x429ebc();_0x532e46[_0x3dc905]=_0x5c60dc([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x24a786,_0x24a786!=_0x5c60dc([0x56,0x61,0x6c,0x69,0x64])&&_0x19e627();}function _0x429ebc(){const _0x1a6ed2=window[_0x5c60dc([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x5c60dc([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x5c60dc([0x6e,0x6f,0x77])]())[_0x5c60dc([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x5c60dc([0x2e]),'');let _0x45c078=_0x5c60dc([0x56]);for(let _0x497e77=0x0;_0x497e77<_0x1a6ed2[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x497e77+=0x2){let _0x3bbff4=window[_0x5c60dc([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1a6ed2[_0x5c60dc([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x497e77,_0x497e77+0x2));_0x3bbff4>=_0x58adb5[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3bbff4-=_0x58adb5[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x45c078+=_0x58adb5[_0x3bbff4];}return _0x45c078;}function _0x1df50f(){const _0x345719=_0x12cf64[_0x5c60dc([0x73,0x70,0x6c,0x69,0x74])](_0x5c60dc([0x2e]));if(0x3!=_0x345719[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3ce6df(_0x345719[0x1]);function _0x3ce6df(_0x4ebf9f){const _0x590c97=_0x348862(_0x4ebf9f);return _0x590c97&&_0x2e0fd6()?_0x590c97:null;function _0x2e0fd6(){const _0x574f2b=_0x590c97[_0x5c60dc([0x6a,0x74,0x69])],_0x464175=window[_0x5c60dc([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x574f2b[_0x5c60dc([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x574f2b[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x4338fa={..._0x590c97,[_0x5c60dc([0x6a,0x74,0x69])]:_0x574f2b[_0x5c60dc([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x574f2b[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x4338fa[_0x5c60dc([0x76,0x63])],_0x3dd950(_0x4338fa)==_0x464175;}}}async function _0xc302b5(){let _0x4db5e8=!0x0;try{const _0x5bbafc=_0x12cf64[_0x5c60dc([0x73,0x70,0x6c,0x69,0x74])](_0x5c60dc([0x2e])),[_0x4c47e8,_0x2f4569,_0x1c8c0c]=_0x5bbafc;return _0x43cd2f(_0x4c47e8),await _0x50e32f(_0x4c47e8,_0x2f4569,_0x1c8c0c),_0x4db5e8;}catch(_0x3cdf22){return!0x1;}function _0x43cd2f(_0x4daf6e){const _0x3dd781=_0x348862(_0x4daf6e);_0x3dd781&&_0x3dd781[_0x5c60dc([0x61,0x6c,0x67])]==_0x5c60dc([0x45,0x53,0x32,0x35,0x36])||(_0x4db5e8=!0x1);}async function _0x50e32f(_0x194e4b,_0x531a11,_0x26f841){const _0x5cb867=window[_0x5c60dc([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x5c60dc([0x66,0x72,0x6f,0x6d])](_0x4dbe7e(_0x26f841),_0x43789b=>_0x43789b[_0x5c60dc([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3773e3=new window[(_0x5c60dc([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x5c60dc([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x194e4b+_0x5c60dc([0x2e])+_0x531a11),_0x32ac84=window[_0x5c60dc([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x5c60dc([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x32ac84)return;const _0x523a35=await _0x32ac84[_0x5c60dc([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x5c60dc([0x6a,0x77,0x6b]),_0x1bd8b6,{[_0x5c60dc([0x6e,0x61,0x6d,0x65])]:_0x5c60dc([0x45,0x43,0x44,0x53,0x41]),[_0x5c60dc([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x5c60dc([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x5c60dc([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x32ac84[_0x5c60dc([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x5c60dc([0x6e,0x61,0x6d,0x65])]:_0x5c60dc([0x45,0x43,0x44,0x53,0x41]),[_0x5c60dc([0x68,0x61,0x73,0x68])]:{[_0x5c60dc([0x6e,0x61,0x6d,0x65])]:_0x5c60dc([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x523a35,_0x5cb867,_0x3773e3)||(_0x4db5e8=!0x1);}}function _0x348862(_0x3a4554){return _0x3a4554[_0x5c60dc([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x5c60dc([0x65,0x79]))?JSON[_0x5c60dc([0x70,0x61,0x72,0x73,0x65])](_0x4dbe7e(_0x3a4554)):null;}function _0x4dbe7e(_0xfb6b03){return window[_0x5c60dc([0x61,0x74,0x6f,0x62])](_0xfb6b03[_0x5c60dc([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x5c60dc([0x2b]))[_0x5c60dc([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x5c60dc([0x2f])));}function _0x3dd950(_0x263564){let _0x5a7abd=0x1505;function _0x407e90(_0x2b5121){for(let _0x2d6e7d=0x0;_0x2d6e7d<_0x2b5121[_0x5c60dc([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2d6e7d++){const _0x349aca=_0x2b5121[_0x5c60dc([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2d6e7d);_0x5a7abd=(_0x5a7abd<<0x5)+_0x5a7abd+_0x349aca,_0x5a7abd&=_0x5a7abd;}}function _0x3bc029(_0x3f54be){Array[_0x5c60dc([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3f54be)?_0x3f54be[_0x5c60dc([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3bc029):_0x3f54be&&typeof _0x3f54be==_0x5c60dc([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x5c60dc([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3f54be)[_0x5c60dc([0x73,0x6f,0x72,0x74])]()[_0x5c60dc([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1459d0,_0x164c9c])=>{_0x407e90(_0x1459d0),_0x3bc029(_0x164c9c);}):_0x407e90(window[_0x5c60dc([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3f54be));}return _0x3bc029(_0x263564),_0x5a7abd>>>0x0;}function _0x1c50bb(_0x46108b){return _0x46108b[_0x5c60dc([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x5c60dc([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x5c60dc([0x30]));}function _0x260d37(_0x56513d){return _0x56513d[_0x5c60dc([0x73,0x70,0x6c,0x69,0x74])]('')[_0x5c60dc([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x5c60dc([0x6a,0x6f,0x69,0x6e])]('');}function _0x32e453(){}function _0x5c60dc(_0x5c9239){return _0x5c9239['map'](_0x534b4d=>String['fromCharCode'](_0x534b4d))['join']('');}_0x2b4db8(await _0x40106a());}(this);}['showFakeVisualSelection'](){const _0x4a763d=this['editor']['model'];_0x4a763d['change'](_0x18327c=>{const _0x48f1b2=_0x4a763d['document']['selection']['getRanges']();let _0x3d1b30=0x0;for(const _0xdca27c of _0x48f1b2){const _0x57f20e=f+':'+_0x3d1b30;if(_0x4a763d['markers']['has'](_0x57f20e))_0x18327c['updateMarker'](_0x57f20e,{'range':_0xdca27c});else{if(_0xdca27c['start']['isAtEnd']){const _0x5d1211=_0xdca27c['start']['getLastMatchingPosition'](({item:_0xf71f09})=>!_0x4a763d['schema']['isContent'](_0xf71f09),{'boundaries':_0xdca27c});_0x18327c['addMarker'](_0x57f20e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x18327c['createRange'](_0x5d1211,_0xdca27c['end'])});}else _0x18327c['addMarker'](_0x57f20e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xdca27c});}_0x3d1b30++;}});}['hideFakeVisualSelection'](){const _0x448cf4=this['editor']['model'],_0x363574=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x363574['length']&&_0x448cf4['change'](_0x272d5f=>{_0x363574['forEach'](_0x39118f=>{_0x272d5f['removeMarker'](_0x39118f);});});}['insertContent'](_0x299989,_0x4046dc){const _0x53b0cd=this['_getAISelection'](),_0x4fb7ba=_0x4046dc||_0x53b0cd['getFirstRange']();this['editor']['model']['canEditAt'](_0x4fb7ba)&&this['editor']['model']['change'](_0x59235d=>{this['hideFakeVisualSelection'](),_0x4046dc||this['_resetContentOfSelectedTableCells'](_0x59235d,_0x53b0cd),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4fb7ba,'writer':_0x59235d,'html':_0x299989});});}['insertContentBelow'](_0x4f47eb){const {model:_0x314e6b}=this['editor'],_0x2e0704=this['_getAISelection']();_0x314e6b['change'](()=>{const _0x3fc6b8=this['_prepareTableInsertBelowPosition'](_0x4f47eb,_0x2e0704)||this['_getDefaultInsertBelowPosition'](_0x2e0704);this['insertContent'](_0x4f47eb,_0x3fc6b8);});}['_getAISelection'](){const _0x44af3c=this['editor']['model'],_0x44face=Array['from'](_0x44af3c['markers']['getMarkersGroup'](f))['map'](_0x122a5d=>_0x122a5d['getRange']());return _0x44af3c['createSelection'](_0x44face);}['_pasteHTMLUsingClipboard']({writer:_0x153264,html:_0x329bb6,insertAt:_0x55e394}){const {view:_0x4bcc71}=this['editor']['editing'],_0x3437c0=this['editor']['plugins']['get'](_0x33b98b),_0x1a20b4=new dt();_0x1a20b4['setData']('text/html',_0x329bb6);const _0x72911d=new ClipboardEvent('paste',{'clipboardData':_0x1a20b4}),_0x4da14a=new _0x3a4bcc(_0x4bcc71,_0x72911d,{'dataTransfer':new _0xba96fd(_0x1a20b4)});_0x153264['setSelection'](_0x55e394);const _0x3ef3d0=(_0x12c88b,_0x1a5491)=>{_0x1a5491['resultRange']&&_0x153264['setSelection'](_0x1a5491['resultRange']);};_0x3437c0['once']('contentInsertion',_0x3ef3d0,{'priority':'lowest'}),_0x4bcc71['document']['fire']('paste',_0x4da14a),_0x3437c0['off']('contentInsertion',_0x3ef3d0);}['_getDefaultInsertBelowPosition'](_0x2ee8f1){const {model:_0x24b724}=this['editor'],_0x50c1c1=Array['from'](_0x2ee8f1['getSelectedBlocks']());return _0x50c1c1['length']?_0x24b724['createPositionAfter'](_0x50c1c1['pop']()):_0x2ee8f1['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x43992b,_0x32be55){const {model:_0x1b05ec,plugins:_0x38f36c}=this['editor'];if(_0x38f36c['has']('TableUtils')){const _0x17838d=_0x38f36c['get']('TableUtils')['getSelectedTableCells'](_0x32be55);if(_0x17838d['length']){const _0xe366be=this['_getTableRowCountFromContent'](_0x43992b),_0x22a43a=this['_createEmptyTableRows'](_0x17838d,_0xe366be);return _0x1b05ec['createPositionAt'](_0x22a43a,0x0);}}return null;}['_getTableRowCountFromContent'](_0x499359){const _0x5c51b6=this['editor']['plugins']['get']('TableUtils'),_0x490de1=this['editor']['data']['parse'](_0x499359),_0x46ce80=Array['from'](_0x490de1['getChildren']())['filter'](_0x10ba2e=>_0x10ba2e['is']('element','table'));let _0xb9f4e6=0x0;return _0x46ce80['forEach'](_0x52c568=>{_0xb9f4e6+=_0x5c51b6['getRows'](_0x52c568);}),_0xb9f4e6;}['_createEmptyTableRows'](_0x36f754,_0x363ec1){const _0x1ce947=this['editor']['plugins']['get']('TableUtils'),_0x4380bd=_0x1ce947['getRowIndexes'](_0x36f754),_0x1b7642=_0x1ce947['getColumnIndexes'](_0x36f754),_0x538598=_0x4380bd['last']+0x1,_0x16c881=_0x1b7642['first'],_0x256443=_0x36f754[0x0]['findAncestor']('table');for(let _0xfa5963=0x0;_0xfa5963<_0x363ec1;_0xfa5963++)_0x1ce947['insertRows'](_0x256443,{'at':_0x538598});return _0x256443['getChild'](_0x538598)['getChild'](_0x16c881);}['_resetContentOfSelectedTableCells'](_0x406a6d,_0x1dcd82){const {plugins:_0x265146}=this['editor'],{model:_0xf18739}=_0x406a6d;if(!_0x265146['has']('TableUtils'))return;_0x265146['get']('TableUtils')['getSelectedTableCells'](_0x1dcd82)['length']&&_0xf18739['deleteContent'](_0x1dcd82);}}class K extends _0x5c3869{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x50c17c('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x62e5){super(_0x62e5),this['name']='AIRequestError';}}function i(_0x2b9d13,_0x382147,_0x2f6b8a){const t=_0x2b9d13['t'];switch(_0x382147){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',_0x2f6b8a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2f6b8a);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'},_0x2f6b8a);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 _0x382147;}}class E extends _0x44947f{['_commandDefinitions'];constructor(_0x2e039a,_0x57310e){super(_0x2e039a),this['_commandDefinitions']=_0x57310e,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x10f530,_0xb538a8,_0x39175c)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x39175c));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xfb80d6,_0x40a20b,_0x55c5a3)=>{this['enabledCommandsIds']=_0x55c5a3?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x36bf95=this['editor']['model'];this['_hasContext']=function(_0x21bec6){const _0x22bf99=_0x21bec6['document']['selection'];return _0x22bf99['isCollapsed']?0x0!==[..._0x22bf99['getSelectedBlocks']()]['length']&&![..._0x22bf99['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x21bec6['hasContent'](_0x22bf99['getFirstRange']());}(_0x36bf95);const _0x255800=_0x36bf95['document']['selection'],_0x243286=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x49a063 of _0x255800['getRanges']())for(const _0x4f7cf1 of _0x49a063['getItems']())if(_0x4f7cf1['is']('element')&&_0x243286['includes'](_0x4f7cf1['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x1e20f9='',_0x516cef='',_0x3eb0fd='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x1e20f9,_0x516cef,_0x3eb0fd);}}function G(_0x1feb0c,_0x213ef8){const _0x49430b=new Set();for(const _0x216a52 of _0x1feb0c['values']())(_0x213ef8||!0x1===_0x216a52['requiresContent'])&&_0x49430b['add'](_0x216a52['id']);return Array['from'](_0x49430b);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- _0x3a2e50(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x550a73,_0x482653,_0x37ca8e){super(),this['editor']=_0x550a73,this['textAdapter']=_0x482653,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x37ca8e,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x15f3a4,_0x4a95db,_0x3e6607)=>{this['view']['value']=this['_sanitizeHTML'](_0x3e6607);}),this['listenTo'](this['view'],'submitPrompt',(_0x2099af,_0x4ba920)=>{const _0x2f1029=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4ba920,_0x2f1029,'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:_0x7ce203,query:_0x45cdd7,htmlContent:_0x277892,label:_0x316171,mainActionLabel:_0x1f5a41}){this['view']['prompt']=_0x316171,this['view']['mainAction']=_0x1f5a41,this['initialContext']=_0x277892,_0x45cdd7&&(this['view']['isRendered']?this['_handleQuery'](_0x45cdd7,_0x277892,_0x7ce203,_0x316171):this['view']['once']('render',()=>{this['_handleQuery'](_0x45cdd7,_0x277892,_0x7ce203,_0x316171);}));}['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'](_0x13b133,_0x15a065,_0x5d2b0,_0x50b71d){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x15a065,this['previousQuery']=_0x13b133,this['previousLabel']=_0x50b71d||_0x13b133,this['previousActionId']=_0x5d2b0,new Promise(_0x245e09=>{this['textAdapter']['makeRequest']({'query':_0x13b133,'context':_0x15a065,'onData':_0x2988a5=>{this['currentResponse']=_0x2988a5,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5d2b0})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3cdc33=>{_0x3cdc33 instanceof R?this['view']['handleError'](_0x3cdc33['message']):this['view']['handleError'](),_0x245e09();})['finally'](()=>{this['stopProcessing'](),_0x245e09();});});}['_parseAndNormalizeContent'](_0x3d77ac,_0x179f00=!0x1){const _0x525598=Z['exec'](_0x3d77ac);_0x3d77ac=_0x525598?_0x3d77ac['substring'](_0x525598[0x1]['length']):_0x3d77ac['length']<0x64&&!_0x179f00?'':this['_stripMarkdownSyntax'](_0x3d77ac);const _0x3e5a53=this['_domParser']['parseFromString'](_0x3d77ac,'text/html');if(_0x525598){const _0x198895=Array['from'](_0x3e5a53['body']['childNodes']);_0x198895['reverse']();for(const _0x338abd of _0x198895){if(_0x338abd['nodeType']==Node['ELEMENT_NODE'])break;_0x338abd['remove']();}}const _0x124d1d=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x3e5a53['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x124d1d);const _0x3dd378=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x5b4128=this['editor']['data']['toModel'](_0x124d1d);return _0x3dd378||_0x5b4128['markers']['clear'](),this['editor']['data']['stringify'](_0x5b4128);}['_normalizeResponseHeadings'](_0xe6f4ad){const _0x414b2d=new _0x550b21(this['editor']['editing']['view']['document']),_0x3cca38=new _0x4b14ca({'name':/^h[1-5]$/}),_0x14d827=[];let _0x3fde8f=!0x1;for(const _0xdb1607 of _0xe6f4ad)_0xdb1607['is']('element')&&_0x3cca38['match'](_0xdb1607)&&(_0x14d827['push'](_0xdb1607),'h1'==_0xdb1607['name']&&(_0x3fde8f=!0x0));if(_0x3fde8f){for(const _0x53e9ce of _0x14d827)_0x414b2d['rename']('h'+(parseInt(_0x53e9ce['name'][0x1])+0x1),_0x53e9ce);}}['_isH1TagSupportEnabled'](){const {data:_0xb2bf97,editing:_0x3f6fbc}=this['editor'],_0x270a01=_0xb2bf97['htmlProcessor']['toView']('<h1></h1>'),_0x1a1a19=_0xb2bf97['toView'](_0xb2bf97['toModel'](_0x270a01));return!!_0x3f6fbc['view']['domConverter']['viewToDom'](_0x1a1a19)['querySelector']('h1');}['_sanitizeHTML'](_0x16bedf){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x16bedf),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x588dd6){const _0x10ddb9=_0x588dd6['trim']();return _0x10ddb9['startsWith']('```html')?_0x10ddb9['endsWith']('```')?_0x10ddb9['substring'](0x7,_0x10ddb9['length']-0x3):_0x10ddb9['substring'](0x7):_0x588dd6;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x6e0b0f){super(_0x6e0b0f),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x22d6aa=>i(_0x6e0b0f,'AI_'+_0x22d6aa['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x6e0b0f,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x6e0b0f,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x6e0b0f,'Stop'));const _0x57c4e2=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x57c4e2['if']('isVisible','ck-hidden',_0x1a4331=>!_0x1a4331)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3c204d,_0x29b962){const _0x59dbda=new _0x1d3846(this['locale']);return _0x59dbda['set']({'label':_0x3c204d,'class':_0x29b962||'','isVisible':!0x0,'withText':!0x0}),_0x59dbda;}}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 _0x438a2c{['contentFieldView'];['copyButtonView'];constructor(_0x3b1a0a,_0x3376f6=''){super(_0x3b1a0a),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1c490d=this['bindTemplate'];this['contentFieldView']=new mt(_0x3b1a0a,_0x3376f6),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1c490d['if']('isVisible','ck-hidden',_0x379ef4=>!_0x379ef4)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1c490d['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 _0x4405ac=!0x1;this['on']('change:value',(_0x1c5272,_0x3e0436,_0x49b51c)=>{const _0x318b06=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x49b51c),this['isProcessing']&&_0x318b06&&!_0x4405ac&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0xcbb6ce,_0x5a2e33,_0x44c873)=>{_0x4405ac=!0x1,_0x44c873?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4405ac=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4405ac=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0xae20d6=this['locale'],_0x8b502a=new _0x1d3846(this['locale']),_0x5f3f44='ck-ai-form__copy-button';return _0x8b502a['set']({'label':i(_0xae20d6,'Copy'),'icon':W,'class':_0x5f3f44,'tooltip':!0x0}),_0x8b502a['bind']('isVisible')['to'](this,'value',_0x2a9a13=>!!_0x2a9a13),_0x8b502a['bind']('isEnabled')['to'](this,'isProcessing',_0x212014=>!_0x212014),_0x8b502a['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x8b502a['icon']=_0x50bcb8['check'],_0x8b502a['class']=_0x5f3f44+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x8b502a['icon']=W,_0x8b502a['class']=_0x5f3f44;},0x3e8);}),_0x8b502a;}['_copyHTMLToClipboard'](_0x414d9a){const {window:_0x5c7e69,document:_0x18a32c}=_0x4334cb;if(_0x5c7e69['ClipboardItem']){const {Blob:_0x11113e,ClipboardItem:_0x17870f}=_0x5c7e69,_0x2de7e7=[new _0x17870f({'text/html':new _0x11113e([_0x414d9a['innerHTML']],{'type':'text/html'}),'text/plain':new _0x11113e([_0x414d9a['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2de7e7);}else{const _0x12f9da=_0x18a32c['createElement']('div');_0x12f9da['style']['position']='absolute',_0x12f9da['style']['left']='-9999px',_0x12f9da['innerHTML']='<span>[</span>'+_0x414d9a['innerHTML']+'<span>]</span>',_0x18a32c['body']['appendChild'](_0x12f9da);const _0x342e9e=_0x18a32c['createRange']();_0x342e9e['setStartAfter'](_0x12f9da['firstElementChild']),_0x342e9e['setEndBefore'](_0x12f9da['lastElementChild']);const _0x21d008=_0x5c7e69['getSelection']();_0x21d008['removeAllRanges'](),_0x21d008['addRange'](_0x342e9e),_0x18a32c['execCommand']('copy'),_0x12f9da['remove']();}}}class mt extends _0x438a2c{constructor(_0x2041b1,_0x152ba4=''){super(_0x2041b1),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x152ba4,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x57ba7d){this['element']['innerHTML']=_0x57ba7d;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4894d5=new _0x438a2c(),_0x4883cd=this['locale'],_0x4fb298=new _0x5549b0();return _0x4fb298['isVisible']=!0x0,_0x4894d5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x4fb298,{'text':i(_0x4883cd,'AI\x20is\x20writing...')}]}),_0x4894d5['render'](),_0x4894d5;}}class rt extends _0x438a2c{constructor(_0x187ab5,_0x50faf8=''){super(_0x187ab5);const _0x2d9031=new _0x3d0dc4(),_0x50bd3f=this['bindTemplate'];this['set']('text',_0x50faf8),_0x2d9031['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':[_0x2d9031,{'text':_0x50bd3f['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4bdc78,_0x1d8807){super(_0x4bdc78,_0x1d8807),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',(_0x48bb66,_0x175cff)=>{_0x48bb66['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x175cff());});}['_createSubmitButton'](){const _0x436667=new _0x1d3846(this['locale']),_0x112043=this['locale'];return _0x436667['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(_0x112043,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x436667['on']('execute',()=>{this['submit']();}),_0x436667['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x5b346a,_0x4dec37)=>!_0x5b346a&&_0x4dec37),_0x436667;}['_createShowHistoryButton'](){const _0x4596bf=new _0x1d3846(this['locale']),_0x4d8a1f=this['resultsView'],_0x513f71=this['locale'];_0x4596bf['set']({'label':i(_0x513f71,'History'),'withText':!0x1,'icon':_0x50bcb8['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4596bf['bind']('isOn')['to'](_0x4d8a1f,'isVisible'),_0x4596bf['bind']('isEnabled')['to'](this,'isEnabled'),_0x4596bf['on']('execute',()=>{_0x4d8a1f['isVisible']=!_0x4d8a1f['isVisible'],_0x4d8a1f['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1ecd82=()=>{_0x4334cb['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0xd2d621=new st(this['queryView']['fieldView']['element']),_0xe16426=_0xd2d621['width'],_0x10568c='rtl'===_0x513f71['uiLanguageDirection']?'left':'right';_0xd2d621['excludeScrollbarsAndBorders'](),_0x4596bf['element']['style'][_0x10568c]=_0xe16426-_0xd2d621['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1ecd82),this['on']('render',_0x1ecd82),_0x4596bf;}['submit'](){const _0x2f3fe3=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2f3fe3);}['focus'](_0x180a82){-0x1===_0x180a82?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0xa6e5c8){super(_0xa6e5c8),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0xa6e5c8,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2b0400=0x0;for(const _0x5a86cf of this['items'])_0x2b0400+=_0x5a86cf['items']['length'];return{'resultsCount':_0x2b0400,'totalItemsCount':_0x2b0400};}['_createClearHistoryButton'](){const _0x56e8c4=this['locale'],_0x22d1b9=new _0x1d3846(this['locale']);return _0x22d1b9['set']({'label':'('+i(_0x56e8c4,'Clear')+')','withText':!0x0}),_0x22d1b9['on']('execute',()=>this['fire']('clearHistory')),_0x22d1b9;}}class hs extends _0x2c6b63{constructor(_0x1a0db1){super();const _0x1b5584=new te(),_0x15cf84=new _0x1d3846(this['locale'],_0x1b5584);this['children']['add'](_0x15cf84),_0x15cf84['set']({'label':_0x1a0db1['prompt'],'withText':!0x0}),_0x15cf84['on']('execute',()=>{this['fire']('execute',{'value':_0x518ce3(_0x1a0db1['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0xcae739{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3b05fd,_0x27dd37)=>{const _0xc7b00f=Ss(_0x27dd37['prompt']);for(const _0x30ddd1 of this)if(_0x30ddd1!=_0x27dd37&&Ss(_0x30ddd1['prompt'])===_0xc7b00f){this['remove'](_0x30ddd1);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x42f7b0=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x42f7b0));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x4bc175=>_0x4bc175)));}}function Ss(_0x4431b3){return _0x4431b3['toLowerCase']()['trim']();}class k extends _0x438a2c{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x441692,_0x35ce18,_0x49dd08=''){super(_0x441692),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(_0x441692),this['contentArea']=new X(_0x441692,_0x49dd08),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 _0x5a9f9d(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x1f443f({'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 _0x11e599=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x35ce18],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x11e599['if']('isError','ck-hidden',_0x30c495=>!_0x30c495)]},'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'](_0x438835=0x1){-0x1===_0x438835?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 _0x576032=this['locale'],_0x53b79d=new ht(_0x576032,{'queryView':{'label':i(_0x576032,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x485039,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x576032,'Empty\x20history'),'secondary':i(_0x576032,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x53b79d['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xce42fb,_0x1c4e05)=>_0xce42fb&&!_0x1c4e05),this['listenTo'](_0x53b79d,'submit',(_0x580cab,_0x42b8c4)=>{this['prompt']=_0x42b8c4;const _0x402967=_0x450af6(_0x42b8c4);this['fire']('submitPrompt',_0x402967),_0x42b8c4['trim']()&&this['_promptHistory']['add']({'prompt':_0x402967},0x0);},{'priority':'high'}),_0x53b79d;}['_createHistoryView'](){const _0x566021=new rs(this['locale']);return _0x566021['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x566021['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x566021;}['_createToolbar'](){const _0x520b36=new at(this['locale']);return _0x520b36['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x47c533,_0x444d7c,_0x4335f3)=>_0x47c533&&!_0x444d7c&&!!_0x4335f3),_0x520b36['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x520b36['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x869af,_0x2865d8,_0x193173)=>_0x869af&&!_0x2865d8&&!!_0x193173),_0x520b36['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x520b36['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x26a6da,_0x367d03)=>_0x26a6da&&!_0x367d03),_0x520b36['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x520b36['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x520b36['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x520b36;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x30eb4d=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x30eb4d,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2f9a4d){const _0xbaf9d8=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2f9a4d||i(_0xbaf9d8,'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 _0x5c3869{['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[_0x4bec40,a,K,_0x352785];}constructor(_0x3b4a38){super(_0x3b4a38),_0x3b4a38['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3b4a38['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x3b4a38['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3b4a38['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3bff89}=this;this['_aiAdapter']=_0x3bff89['plugins']['get'](K),this['_dialog']=_0x3bff89['plugins']['get'](_0x352785),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4cca64=new E(_0x3bff89,Array['from'](this['_commandDefinitions']['values']()));_0x3bff89['commands']['add']('showAIAssistant',_0x4cca64),_0x3bff89['ui']['componentFactory']['add']('aiCommands',_0x456a8a=>{const _0x12ecd0=_0x3128ee(_0x456a8a);return _0x12ecd0['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x12ecd0['buttonView']['set']({'label':i(_0x456a8a,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x12ecd0['on']('execute',_0x35cc59=>this['_onExecute'](_0x35cc59['source']['id'])),_0x3e5861(_0x12ecd0,_0x3bff89['ui']['view']['body'],function(_0xdd3491){const _0x3125d5=o(_0xdd3491['config']['get']('ai.aiAssistant.commands'),_0xdd3491['locale']),_0x4d4eea=U(_0xdd3491,_0x3125d5)['filter'](_0x116686=>_0x116686['commands']['length']);if(0x1===_0x4d4eea['length'])return U(_0xdd3491,_0x4d4eea[0x0]['commands'])['map'](_0x1fab4e=>({'id':_0x1fab4e['id'],'label':_0x1fab4e['label']}));return _0x4d4eea['map'](_0x3c54c7=>{const {groupId:_0x2ca971,groupLabel:_0x5a33cd,commands:_0x4fd987}=_0x3c54c7,_0x77035a=U(_0xdd3491,_0x4fd987)['map'](_0x48ea88=>({'id':_0x48ea88['id'],'label':_0x48ea88['label']}));return{'id':_0x2ca971,'menu':_0x5a33cd||_0x2ca971,'children':_0x77035a};});}(_0x3bff89),{'ariaLabel':i(_0x456a8a,'AI\x20Commands')}),_0x12ecd0['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4cca64['on']('change:enabledCommandsIds',_0x49f41a),_0x12ecd0['menuView']['once']('render',_0x49f41a),_0x12ecd0;function _0x49f41a(){_0x12ecd0['isEnabled']=_0x4cca64['enabledCommandsIds']['length']>0x0;for(const _0x5055fd of _0x12ecd0['menuView']['buttons'])_0x5055fd['isEnabled']=_0x4cca64['enabledCommandsIds']['includes'](_0x5055fd['id']);}}),_0x3bff89['ui']['componentFactory']['add']('menuBar:aiCommands',_0x567def=>{const _0x45fcf9=new _0x3a2c13(_0x567def);_0x45fcf9['buttonView']['set']({'label':i(_0x567def,'AI\x20Commands'),'icon':T}),_0x45fcf9['bind']('isEnabled')['to'](_0x4cca64,'enabledCommandsIds',_0x24dcf0=>_0x24dcf0['length']>0x0);const _0x33f69a=o(_0x3bff89['config']['get']('ai.aiAssistant.commands'),_0x567def);return this['_populateMenuBarMenu'](_0x4cca64,_0x45fcf9,_0x33f69a,_0x91cd12=>this['_onExecute'](_0x91cd12)),_0x45fcf9;}),_0x3bff89['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x7aa7ab=this['_createAIAssistantUIButton'](_0x1d3846);return _0x7aa7ab['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x7aa7ab;}),_0x3bff89['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x41e71a=this['_createAIAssistantUIButton'](_0xb92597);return _0x41e71a['set']({'role':'menuitemcheckbox'}),_0x41e71a;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x7f6bf0=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2b0b7e;for(const _0x373f59 in _0x7f6bf0){const _0x39f48a=_0x373f59,_0x4c5796=_0x7f6bf0[_0x39f48a];if('aiLicenseKeyValid'==_0x4c5796||'aiLicenseKeyInvalid'==_0x4c5796||'aiLicenseKeyExpired'==_0x4c5796||'aiLicenseKeyDomainLimit'==_0x4c5796||'aiLicenseKeyNotAllowed'==_0x4c5796||'aiLicenseKeyEvaluationLimit'==_0x4c5796||'aiLicenseKeyTrialLimit'==_0x4c5796||'aiLicenseKeyUsageLimit'==_0x4c5796){delete _0x7f6bf0[_0x39f48a],_0x2b0b7e=_0x4c5796,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x2b0b7e&&_0x7f6bf0['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x57829c='',_0x10436d='',_0x3e23ae='custom'){const _0x299c32=this['editor'],_0x5efaf1=_0x299c32['editing']['view'],_0x5e178c=_0x299c32['plugins']['get'](a),_0x24bc31=_0x299c32['plugins']['get'](_0x4bec40);_0x5e178c['showFakeVisualSelection']();const _0x5b3f11=new w(),_0x41e0d0=new ClipboardEvent('copy',{'clipboardData':_0x5b3f11}),_0x1e5418=new _0xba96fd(_0x5b3f11),_0xa488d6=new _0x3a4bcc(_0x5efaf1,_0x41e0d0,{'dataTransfer':_0x1e5418});_0x24bc31['_forceMarkersCopy']('comment',()=>{_0x5efaf1['document']['fire']('copy',_0xa488d6);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x299c32,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x287ab0=_0x1e5418['getData']('text/html');const _0x4e3b69=_0x299c32['model']['document']['selection'],_0x3d72aa=Array['from'](_0x4e3b69['getRanges']());0x1===_0x3d72aa['length']&&_0x3d72aa[0x0]['isFlat']&&!_0x4e3b69['getSelectedElement']()&&''!==_0x287ab0['replace'](/&nbsp;/g,'')['trim']()&&(_0x287ab0='<p>'+_0x287ab0+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x3e23ae,'query':_0x57829c,'htmlContent':_0x287ab0,'label':_0x10436d,'mainActionLabel':M[_0x299c32['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':_0x5af3cd['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5e178c['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0xb3b9e6=new Map(),_0xd1c009=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x249106 of _0xd1c009)for(const _0x475619 of _0x249106['commands'])_0xb3b9e6['set'](_0x475619['id'],{..._0x475619,'groupId':_0x249106['groupId'],'groupLabel':_0x249106['groupLabel']||_0x249106['groupId']});return _0xb3b9e6;}['_createAIAssistantUIButton'](_0x4ba571){const _0x43557a=this['editor'],_0x386245=_0x43557a['commands']['get']('showAIAssistant'),_0x43e15c=new _0x4ba571(_0x43557a['locale']);return _0x43e15c['set']({'label':i(_0x43557a['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x43e15c['bind']('isEnabled')['to'](_0x386245),_0x43e15c['bind']('isOn')['to'](this['_dialog'],'id',_0x4c4b3a=>'aiAssistant'===_0x4c4b3a),this['listenTo'](_0x43e15c,'execute',()=>{_0x43e15c['isOn']?this['hideUI']():_0x386245['execute']();}),_0x43e15c;}['_initView'](){const _0x6da367=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',()=>{_0x6da367['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x6da367['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2595b2,ui:{ariaLiveAnnouncer:_0x239879}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x21e93e,_0x46b29b,_0x164760)=>{const _0x1aeb24=this['_aiAssistantController']['currentContext'];_0x164760?_0x239879['announce'](i(_0x2595b2,'AI\x20is\x20writing')):_0x1aeb24&&_0x239879['announce'](i(_0x2595b2,'Generated\x20content:\x20%0',_0x1aeb24),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x57f4fc,_0x5429a7,_0x21c979)=>{if(_0x21c979){const _0x46da83=this['_formView']['errorView']['text'];_0x239879['announce'](i(_0x2595b2,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x46da83));}});}['_onExecute'](_0x163d64){const _0x5abe81=this['_commandDefinitions']['get'](_0x163d64),_0x5a8595=this['editor'],_0x175f26=_0x5a8595['model']['document']['selection'],_0x12d130=_0x5a8595['commands']['get']('showAIAssistant'),_0x421d86=_0x5a8595['plugins']['get'](a),_0x2942bc=''+(_0x5abe81['groupId']!==x?_0x5abe81['groupLabel']+':\x20':'')+_0x5abe81['label'];if(!0x1!==_0x5abe81['requiresContent']&&_0x175f26['isCollapsed']){const _0x350abc=_0x1a913c(_0x175f26['getSelectedBlocks']())||_0x5a8595['model']['schema']['getLimitElement'](_0x175f26);_0x5a8595['model']['change'](_0x266f05=>{_0x266f05['setSelection'](_0x350abc,'in');});}_0x421d86['showFakeVisualSelection'](),_0x12d130['execute'](_0x5abe81['prompt'],_0x2942bc,'command:'+_0x163d64);}['_populateMenuBarMenu'](_0x2a003e,_0x1a25a9,_0x317b3f,_0x5d3b9f){const _0x4b753c=this['editor'],_0x1deef7=_0x4b753c['locale'],_0x2ff7bc=new _0x4c7c75(_0x1deef7),_0x8e1674=U(_0x4b753c,_0x317b3f)['filter'](_0x471f60=>_0x471f60['commands']['length']);0x1===_0x8e1674['length']?this['_getMenuBarGroupButtons']({'command':_0x2a003e,'commands':_0x8e1674[0x0]['commands'],'parentMenuView':_0x1a25a9,'onExecute':_0x5d3b9f})['forEach'](_0x40b813=>_0x2ff7bc['items']['add'](_0x40b813)):_0x8e1674['forEach'](({groupId:_0x72e7e2,groupLabel:_0x2d17bc,commands:_0x4ea4ac})=>{const _0x2cb987=new _0x5b6d2c(_0x1deef7,_0x1a25a9),_0x30db9a=new _0x3a2c13(_0x1deef7),_0x5e3cc4=new _0x4c7c75(_0x1deef7),_0x5776fa=this['_getMenuBarGroupButtons']({'command':_0x2a003e,'commands':_0x4ea4ac,'parentMenuView':_0x30db9a,'onExecute':_0x5d3b9f});_0x30db9a['buttonView']['set']({'label':_0x2d17bc||_0x72e7e2}),_0x30db9a['delegate']('execute')['to'](_0x1a25a9),_0x5e3cc4['items']['addMany'](_0x5776fa),_0x30db9a['panelView']['children']['add'](_0x5e3cc4),_0x2cb987['children']['add'](_0x30db9a),_0x2ff7bc['items']['add'](_0x2cb987);}),_0x1a25a9['panelView']['children']['add'](_0x2ff7bc);}['_getMenuBarGroupButtons']({command:_0x2d01ae,commands:_0x4db0a0,parentMenuView:_0x15a707,onExecute:_0x7d0a89}){const _0x371524=this['editor'],_0x4fa7fe=_0x371524['locale'];return U(_0x371524,_0x4db0a0)['map'](_0x58db44=>{const _0x5ca2fe=new _0x5b6d2c(_0x4fa7fe,_0x15a707),_0x4fda70=new _0xb92597(_0x4fa7fe);return _0x4fda70['set']({'label':_0x58db44['label']}),_0x4fda70['delegate']('execute')['to'](_0x15a707),_0x4fda70['on']('execute',()=>_0x7d0a89(_0x58db44['id'])),_0x4fda70['bind']('isEnabled')['to'](_0x2d01ae,'enabledCommandsIds',_0x4de191=>_0x4de191['includes'](_0x58db44['id'])),_0x5ca2fe['children']['add'](_0x4fda70),_0x5ca2fe;});}}function B(_0x2d76f9,_0x59653b){return void 0x0!==_0x2d76f9['order']&&void 0x0===_0x59653b['order']?0x1:void 0x0===_0x2d76f9['order']&&void 0x0!==_0x59653b['order']?-0x1:void 0x0!==_0x2d76f9['order']&&void 0x0!==_0x59653b['order']?_0x2d76f9['order']-_0x59653b['order']:0x0;}function U(_0x37da12,_0x3e76b6){_0x3e76b6['sort'](B);const _0x353ce7={},_0x6957a7=[];for(const _0x17c096 of _0x3e76b6)if(void 0x0!==_0x17c096['order']){if(_0x17c096['order']in _0x353ce7)throw new _0x50c17c('ai-commands-config-order-collision',_0x37da12,{'conflictingDefinitions':[_0x17c096,_0x353ce7[_0x17c096['order']]]});_0x353ce7[_0x17c096['order']]=_0x17c096,_0x6957a7['splice'](_0x17c096['order'],0x0,_0x17c096);}else _0x6957a7['push'](_0x17c096);return _0x6957a7;}class r extends _0x5c3869{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x56f8a5){super(_0x56f8a5);const _0x5de1b4=_0x56f8a5['config'],_0xa638a=_0x56f8a5['locale'];_0x5de1b4['define']('ai.aiAssistant.preserveComments',!0x0),_0x5de1b4['define']('ai.aiAssistant.commands',function(_0x4a57a1){return[{'groupId':'editOrReview','groupLabel':i(_0x4a57a1,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x4a57a1,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x4a57a1,'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(_0x4a57a1,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x4a57a1,'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(_0x4a57a1,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x4a57a1,'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(_0x4a57a1,'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(_0x4a57a1,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x4a57a1,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x4a57a1,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x4a57a1,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x4a57a1,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x4a57a1,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x4a57a1,'Change\x20style'),'commands':[{'id':'business','label':i(_0x4a57a1,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x4a57a1,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x4a57a1,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x4a57a1,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x4a57a1,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x4a57a1,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x4a57a1,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x4a57a1,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x4a57a1,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x4a57a1,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x4a57a1,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x4a57a1,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x4a57a1,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0xa638a)),_0x5de1b4['define']('ai.aiAssistant.extraCommandGroups',[]),_0x5de1b4['define']('ai.aiAssistant.removeCommands',[]);let _0x343072=o(_0x5de1b4['get']('ai.aiAssistant.commands'),_0xa638a);const _0x7f48e7=_0x5de1b4['get']('ai.aiAssistant.extraCommandGroups'),_0x11f6ea=_0x5de1b4['get']('ai.aiAssistant.removeCommands');_0x7f48e7['forEach'](_0x33909f=>{const _0x43b478=_0x343072['find'](_0xe25175=>_0xe25175['groupId']===_0x33909f['groupId']);_0x43b478?_0x43b478['commands']=_0x43b478['commands']['concat'](_0x33909f['commands']):_0x343072['push'](_0x33909f);}),_0x343072=_0x343072['filter'](_0x290b51=>!_0x11f6ea['includes'](_0x290b51['groupId'])),_0x343072['forEach'](_0x47fc60=>{_0x47fc60['commands']=_0x47fc60['commands']['filter'](_0x4df156=>!_0x11f6ea['includes'](_0x4df156['id']));}),_0x5de1b4['set']('ai.aiAssistant.commands',_0x343072);}}class P extends _0x5c3869{['abortController'];static get['requires'](){return[K];}constructor(_0x5679e5){super(_0x5679e5),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'](_0x3e0c53){return this['sendRequest'](_0x3e0c53)['catch'](_0xfbfab1=>{if(_0xfbfab1 instanceof R)return Promise['reject'](_0xfbfab1);if('AbortError'==_0xfbfab1['name'])return Promise['resolve']();throw console['error'](_0xfbfab1),new _0x50c17c('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x29299d,_0x159ccb){const _0x13c1c3=this['editor']['locale'],_0x372ad8={'Content-Type':'application/json'};if('object'==typeof _0x29299d)Object['assign'](_0x372ad8,_0x29299d);else{if(_0x29299d)try{const _0x4bcfde=await _0x29299d(_0x159ccb);Object['assign'](_0x372ad8,_0x4bcfde);}catch(_0x49faf8){return Promise['reject'](new R(i(_0x13c1c3,'AI_ERROR_GET_HEADERS')));}}return _0x372ad8;}async['_prepareRequestParameters'](_0x3becdc,_0x1807c5){const _0x35c010=this['editor']['locale'];if('object'==typeof _0x3becdc)return _0x3becdc;try{return await _0x3becdc(_0x1807c5);}catch(_0x4eecae){return Promise['reject'](new R(i(_0x35c010,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x1cc05c){super(_0x1cc05c),_0x1cc05c['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x1cc05c['config']['get']('ai.openAI.requestParameters')||_0x1cc05c['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x1cc05c['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x1cc05c['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x1cc05c['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x89e400,context:_0x22a144,onData:_0x45dc30,actionId:_0x86f3b1}){const _0x105a7d=this['editor']['locale'],_0x3ebdbb=await this['prepareMessages'](_0x89e400,_0x22a144,_0x86f3b1),_0x2da193=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x86f3b1),_0x239fab=await this['_prepareRequestParameters'](this['_requestParameters'],_0x86f3b1),_0x2e0673={'messages':_0x3ebdbb,..._0x239fab},_0x8d367c={'method':'POST','headers':_0x2da193,'body':JSON['stringify'](_0x2e0673),'signal':this['abortController']['signal']},_0x4dbbe1=await fetch(this['_apiUrl'],_0x8d367c);if(_0x4dbbe1['ok'])return _0x239fab['stream']?await this['_readStreamableResponse'](_0x4dbbe1,_0x45dc30):await this['_readStaticResponse'](_0x4dbbe1,_0x45dc30),Promise['resolve']();{const _0xa1608f=await _0x4dbbe1['text']();return _0xa1608f['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x105a7d,'AI_ERROR_CONTEXT_LENGTH'))):_0xa1608f['includes']('Moderation')?Promise['reject'](new R(i(_0x105a7d,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xa1608f));}}async['prepareMessages'](_0x2bedd8,_0x7a1487,_0xa6beb7){let _0x3c8882,_0x255dfd;return _0x7a1487?(_0x3c8882='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.',_0x255dfd='Instruction:\x0a'+_0x2bedd8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x7a1487):(_0x3c8882='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.',_0x255dfd=_0x2bedd8),[{'role':'system','content':_0x3c8882},{'role':'user','content':_0x255dfd}];}async['_readStreamableResponse'](_0x47b6e6,_0x57c91a){const _0x259572=_0x47b6e6['body']['getReader'](),_0x21cdf7=new TextDecoder();let _0x409943='',_0x53891f='',_0x55d8d4='',_0x3798b2=!0x1;for(;!_0x3798b2;){const {done:_0x3285d3,value:_0x47d2e9}=await _0x259572['read'](),_0x39c777=_0x409943+_0x21cdf7['decode'](_0x47d2e9);let _0x32dd96='';_0x3798b2=_0x3285d3;try{_0x32dd96=this['_cleanUpData'](_0x39c777),_0x409943='';}catch(_0x1d3b57){_0x409943=_0x39c777;continue;}_0x53891f+=_0x32dd96,!_0x3798b2&&this['_isBufferIncomplete'](_0x53891f)||_0x53891f&&(_0x55d8d4+=_0x53891f,_0x53891f='',_0x57c91a(_0x55d8d4));}return Promise['resolve']();}async['_readStaticResponse'](_0x17fff7,_0x9b193b){return _0x9b193b((await _0x17fff7['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x316955){const _0x6cf0d9=_0x316955['split']('<')['length']!==_0x316955['split']('>')['length'],_0x29f2fd=_0x316955['length']<0x1e;return _0x6cf0d9&&_0x29f2fd;}['_cleanUpData'](_0x2e9c9b){return _0x2e9c9b['split'](/\n(?![^{]*\})/g)['map'](_0x4c6d0c=>_0x4c6d0c['replace']('data:\x20',''))['filter'](_0x16014b=>_0x16014b&&_0x16014b['length']>0x0&&'[DONE]'!==_0x16014b)['map'](_0x38f511=>{const {choices:_0x2e3cec}=JSON['parse'](_0x38f511);if(_0x2e3cec[0x0]&&_0x2e3cec[0x0]['delta']&&_0x2e3cec[0x0]['delta']['content'])return _0x2e3cec[0x0]['delta']['content'];})['filter'](_0x14e632=>_0x14e632)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x889b00){super(_0x889b00),_0x889b00['config']['get']('ai.aws.requestParameters')||_0x889b00['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']=_0x889b00['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x889b00['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x889b00['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x889b00['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x39c1ef,context:_0x34fea9,onData:_0x3af186,actionId:_0x112e89}){const {model:_0x1e8aeb,stream:_0x5eee9f,..._0x3405ee}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x112e89),_0x27c0cd={'prompt':await this['preparePrompt'](_0x39c1ef,_0x34fea9,_0x1e8aeb,_0x112e89),..._0x3405ee};this['_apiUrl']?await this['_processProxyRequest'](_0x27c0cd,_0x1e8aeb,_0x5eee9f,_0x3af186,_0x112e89):await this['_processAWSRequest'](_0x27c0cd,_0x1e8aeb,_0x5eee9f,_0x3af186);}async['preparePrompt'](_0x572b18,_0x576a47,_0x1a9576,_0xce4f9e){let _0x4c44ca,_0xab2ebb;return _0x576a47?(_0x4c44ca='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.',_0xab2ebb='Instruction:\x0a'+_0x572b18+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x576a47):(_0x4c44ca='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.',_0xab2ebb=_0x572b18),'meta.llama'==this['getModelFamily'](_0x1a9576)?'<<SYS>>\x0a'+_0x4c44ca+'\x0a<</SYS>>\x0a[INST]\x0a'+_0xab2ebb+'\x0a[/INST]':'Human:\x0a'+_0x4c44ca+'\x0a'+_0xab2ebb+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2a2727){if(/^anthropic\.claude/['test'](_0x2a2727))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2a2727))return'ai21.j2';if(/^cohere\.command/['test'](_0x2a2727))return'cohere.command';if(/^meta\.llama/['test'](_0x2a2727))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2a2727));}async['_processProxyRequest'](_0x140b79,_0x5dd80e,_0x2198c0,_0x199d56,_0x571302){const _0x49723c={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x571302),'body':JSON['stringify']({..._0x140b79,'model':_0x5dd80e,'stream':_0x2198c0}),'signal':this['abortController']['signal']},_0x2c7e1d=await fetch(this['_apiUrl'],_0x49723c);_0x2198c0?await this['_readStreamableResponse'](_0x2c7e1d,_0x5dd80e,_0x199d56):await this['_readStaticResponse'](_0x2c7e1d,_0x5dd80e,_0x199d56);}async['_processAWSRequest'](_0x1f6cf1,_0x4098e2,_0x50feac,_0x3fc837){const _0x118f99=new _0x14c587(this['_bedrockClientConfig']),_0x5f41a7={'body':JSON['stringify'](_0x1f6cf1),'contentType':'application/json','accept':'application/json','modelId':_0x4098e2};let _0x589ecb;if(_0x50feac){const _0x32de96=new _0x5dc4c8(_0x5f41a7);_0x589ecb=await _0x118f99['send'](_0x32de96,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x589ecb,_0x4098e2,_0x3fc837);}else{const _0x78cce8=new _0x53f45b(_0x5f41a7);_0x589ecb=await _0x118f99['send'](_0x78cce8,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x589ecb,_0x4098e2,_0x3fc837);}}async['_readAsyncIterableResponse'](_0x5c58ce,_0x598d00,_0x4a6818){const _0x1790f6=_0x5c58ce['body'],_0x59ebb7=new TextDecoder('utf-8');let _0x35c16f='';for await(const _0x13a258 of _0x1790f6)if(_0x13a258['chunk']){const _0x1838e5=_0x59ebb7['decode'](_0x13a258['chunk']['bytes']),_0xdaa4ee=JSON['parse'](_0x1838e5);_0x35c16f+=this['_getGeneratedText'](_0xdaa4ee,_0x598d00),_0x4a6818(_0x35c16f);}return Promise['resolve']();}async['_readStreamableResponse'](_0x3fe1c0,_0x2975bf,_0x6a0b7a){const _0x24dad9=_0x3fe1c0['body'],_0x3f3d67=new TextDecoder('utf-8'),_0x3b3adf=_0x24dad9['getReader']();let _0x267e78='',_0x45f147='',_0x10efbb=!0x1;for(;!_0x10efbb;){const {done:_0x5e0084,value:_0x1ff00a}=await _0x3b3adf['read']();if(_0x10efbb=_0x5e0084,_0x10efbb)break;const _0x3fdee4=(_0x267e78+_0x3f3d67['decode'](_0x1ff00a))['split']('\x0a')['map'](_0xbdc2e7=>{try{return _0x267e78='',JSON['parse'](_0xbdc2e7);}catch(_0x162aa9){return _0x267e78=_0xbdc2e7,null;}})['filter'](_0x3074d1=>null!==_0x3074d1);_0x3fdee4['length']&&(_0x45f147+=_0x3fdee4['map'](_0x10cce8=>this['_getGeneratedText'](_0x10cce8,_0x2975bf))['join'](''),_0x6a0b7a(_0x45f147));}return Promise['resolve']();}async['_readStaticResponse'](_0x2f72b9,_0x47ec59,_0x34ec3d){let _0x31abe8;return _0x31abe8=_0x2f72b9 instanceof Response?await _0x2f72b9['json']():JSON['parse'](Buffer['from'](_0x2f72b9['body'])['toString']('utf8')),(_0x34ec3d(this['_getGeneratedText'](_0x31abe8,_0x47ec59)),Promise['resolve']());}['_getGeneratedText'](_0x73b55c,_0x457057){switch(this['getModelFamily'](_0x457057)){case'anthropic.claude':return _0x73b55c['completion'];case'ai21.j2':return _0x73b55c['completions'][0x0]['data']['text'];case'cohere.command':return _0x73b55c['generations'][0x0]['text'];case'meta.llama':return _0x73b55c['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 _0x19892a,Command as _0x55b0dd,icons as _0x114f9e}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x3814c9,CKEditorError as _0x1f4698,ObservableMixin as _0xcc1f5a,global as _0x3fd3bf,isVisible as it,Rect as st,Collection as _0x5ae6e5,FocusTracker as _0x657ad6,KeystrokeHandler as ts,first as _0x9a96a}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x45295c,View as _0x3c5f9b,SpinnerView as _0x4ae1ed,IconView as _0x4f615c,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0xbebfcc,ButtonLabelView as te,FocusCycler as _0x59de04,createLabeledTextarea as _0x38b169,Dialog as _0x258a31,createDropdown as _0x511dc7,addMenuToDropdown as _0xf1c518,MenuBarMenuView as _0x1949eb,MenuBarMenuListItemButtonView as _0x2ec39f,DialogViewPosition as _0x32c1e3,MenuBarMenuListView as _0x4b1f30,MenuBarMenuListItemView as _0x187200}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x43f719,ClipboardMarkersUtils as _0x42c981}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x50beeb,DataTransfer as _0x5787c9,UpcastWriter as _0x5db318,Matcher as _0x50b7b2}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x25bca0,escape as _0xbf0178}from'lodash-es';import{BedrockRuntimeClient as _0x2f74e3,InvokeModelWithResponseStreamCommand as _0x1dfcbf,InvokeModelCommand as _0x5ef9b9}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x4efa0c,_0x4e1253){const _0x141661=(0x0,_0x4e1253['t'])('Other');return _0x4efa0c['length']?'groupId'in _0x4efa0c[0x0]?_0x4efa0c:[{'groupId':x,'groupLabel':_0x141661,'order':0x1/0x0,'commands':_0x4efa0c}]:[{'groupId':x,'groupLabel':_0x141661,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x19892a{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2f755e}=this,_0x2f3ce7=['ck-fake-ai-selection'];_0x2f755e['config']['get']('ai.useTheme')&&_0x2f3ce7['push']('ck-ai-assistant-ui_theme'),_0x2f755e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x2f3ce7,'priority':0xc}}),_0x2f755e['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x1f3fbe,{writer:_0xdccd5})=>{if(!_0x1f3fbe['markerRange']['isCollapsed'])return null;const _0x26b5f2=_0xdccd5['createUIElement']('span');return _0xdccd5['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x26b5f2),_0x26b5f2;}});}['afterInit'](){!async function(_0xa1a267){const _0xf21cc=_0x46d5e8([0x56,0x78,0x4e,0x36,0x43,0x6f,0x70,0x59,0x6c,0x75,0x46,0x7a,0x77,0x6b,0x38,0x4a,0x30,0x64,0x6a,0x34,0x5a,0x74,0x4f,0x50,0x4b,0x66,0x73,0x39,0x31,0x37,0x62,0x63,0x6d,0x32,0x49,0x6e,0x79,0x42,0x72,0x33,0x67,0x68,0x35,0x45,0x44,0x4d,0x58,0x53,0x69,0x55,0x4c,0x76,0x71,0x54,0x51,0x57,0x47,0x65,0x52,0x48,0x41,0x61]),_0x206116=0x60428ae1,_0x37dffa=0x6045d491^_0x206116,_0xaabcf1=window[_0x46d5e8([0x44,0x61,0x74,0x65])][_0x46d5e8([0x6e,0x6f,0x77])](),_0x39b8fa=_0xa1a267[_0x46d5e8([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5ea6ba=new window[(_0x46d5e8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x20825e=>{_0x39b8fa[_0x46d5e8([0x6f,0x6e,0x63,0x65])](_0x46d5e8([0x72,0x65,0x61,0x64,0x79]),_0x20825e);}),_0x1653c1={[_0x46d5e8([0x6b,0x74,0x79])]:_0x46d5e8([0x45,0x43]),[_0x46d5e8([0x75,0x73,0x65])]:_0x46d5e8([0x73,0x69,0x67]),[_0x46d5e8([0x63,0x72,0x76])]:_0x46d5e8([0x50,0x2d,0x32,0x35,0x36]),[_0x46d5e8([0x78])]:_0x46d5e8([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]),[_0x46d5e8([0x79])]:_0x46d5e8([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]),[_0x46d5e8([0x61,0x6c,0x67])]:_0x46d5e8([0x45,0x53,0x32,0x35,0x36])},_0x15ae35=_0x39b8fa[_0x46d5e8([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x46d5e8([0x67,0x65,0x74])](_0x46d5e8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5d43bd(){let _0x501e69,_0x1b78f5=null,_0x4e39ee=null;try{if(_0x15ae35==_0x46d5e8([0x47,0x50,0x4c]))return _0x46d5e8([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x501e69=_0x4aa03b(),!_0x501e69)return _0x46d5e8([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x501e69[_0x46d5e8([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4e39ee=_0x14689c(_0x501e69[_0x46d5e8([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x501e69[_0x46d5e8([0x6a,0x74,0x69])])),await _0x4e628()?_0x34e285()?_0x1b1a70()?_0x46d5e8([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x40c464()?(_0x501e69[_0x46d5e8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x46d5e8([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1b78f5=_0x3a9f3e(_0x46d5e8([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x501e69[_0x46d5e8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x46d5e8([0x74,0x72,0x69,0x61,0x6c])&&(_0x1b78f5=_0x3a9f3e(_0x46d5e8([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4acfae()):_0x46d5e8([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x46d5e8([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x46d5e8([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x39d283){return _0x46d5e8([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1b1a70(){const _0x1d9f14=[_0x46d5e8([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x46d5e8([0x74,0x72,0x69,0x61,0x6c])][_0x46d5e8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x501e69[_0x46d5e8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xaabcf1/0x3e8:0xe10*_0x37dffa;return _0x501e69[_0x46d5e8([0x65,0x78,0x70])]<_0x1d9f14;}function _0x34e285(){const _0x48ae2e=_0x501e69[_0x46d5e8([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x48ae2e&&(!!_0x48ae2e[_0x46d5e8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x46d5e8([0x2a]))||!!_0x48ae2e[_0x46d5e8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x46d5e8([0x41,0x49])));}function _0x40c464(){const _0x128e72=_0x501e69[_0x46d5e8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x128e72||0x0==_0x128e72[_0x46d5e8([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2b424a}=new URL(window[_0x46d5e8([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x128e72[_0x46d5e8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2b424a))return!0x0;const _0x5a119b=_0x2b424a[_0x46d5e8([0x73,0x70,0x6c,0x69,0x74])](_0x46d5e8([0x2e]));return _0x128e72[_0x46d5e8([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1cf137=>_0x1cf137[_0x46d5e8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x46d5e8([0x2a])))[_0x46d5e8([0x6d,0x61,0x70])](_0x1986b5=>_0x1986b5[_0x46d5e8([0x73,0x70,0x6c,0x69,0x74])](_0x46d5e8([0x2e])))[_0x46d5e8([0x73,0x6f,0x6d,0x65])](_0x3211da=>_0x5a119b[_0x46d5e8([0x65,0x76,0x65,0x72,0x79])]((_0x12e8a3,_0x46c92b)=>_0x3211da[_0x46c92b]===_0x12e8a3||_0x3211da[_0x46c92b]===_0x46d5e8([0x2a])));}function _0x4acfae(){return _0x1b78f5&&_0x4e39ee?new window[(_0x46d5e8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4dcbdd,_0x5078a8)=>{_0x1b78f5[_0x46d5e8([0x74,0x68,0x65,0x6e])](_0x4dcbdd,_0x5078a8),_0x4e39ee[_0x46d5e8([0x74,0x68,0x65,0x6e])](_0x54b150=>{_0x54b150!=_0x46d5e8([0x56,0x61,0x6c,0x69,0x64])&&_0x4dcbdd(_0x54b150);},_0x5078a8);}):_0x1b78f5||_0x4e39ee||_0x46d5e8([0x56,0x61,0x6c,0x69,0x64]);}}function _0x14689c(_0x1e8978,_0xa37ddd){return new window[(_0x46d5e8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x572f4a=>{if(_0x1f2f39())return _0x572f4a(_0x46d5e8([0x56,0x61,0x6c,0x69,0x64]));_0x51d07e(),_0x39b8fa[_0x46d5e8([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x46d5e8([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x621bbd=!0x1;const _0x33df69=_0x3814c9();function _0x286034(_0x4cbdb0){return!!_0x4cbdb0&&(typeof _0x4cbdb0===_0x46d5e8([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4cbdb0===_0x46d5e8([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4cbdb0[_0x46d5e8([0x74,0x68,0x65,0x6e])]===_0x46d5e8([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4cbdb0[_0x46d5e8([0x63,0x61,0x74,0x63,0x68])]===_0x46d5e8([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2b21de(_0x20d078){_0x5ac379(_0x20d078)[_0x46d5e8([0x74,0x68,0x65,0x6e])](_0x3676aa=>{if(!_0x3676aa||_0x3676aa[_0x46d5e8([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x46d5e8([0x6f,0x6b]))return _0x46d5e8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x33f8b9(_0x5ee19f(_0x33df69+_0xa37ddd))!=_0x3676aa[_0x46d5e8([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x46d5e8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x46d5e8([0x56,0x61,0x6c,0x69,0x64]);})[_0x46d5e8([0x74,0x68,0x65,0x6e])](_0xc75995=>(_0x3283b8(),_0xc75995),()=>{const _0x4a7480=_0x405a42();return null==_0x4a7480?(_0x3283b8(),_0x46d5e8([0x56,0x61,0x6c,0x69,0x64])):_0x46d5e8(_0xaabcf1-_0x4a7480>(0x444e0ee1^_0x206116)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x46d5e8([0x74,0x68,0x65,0x6e])](_0x572f4a)[_0x46d5e8([0x63,0x61,0x74,0x63,0x68])](()=>{_0x572f4a(_0x46d5e8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2f128=0x60746461^_0x206116;function _0x3283b8(){const _0x17824c=_0x46d5e8([0x6c,0x6c,0x63,0x74,0x2d])+_0x33f8b9(_0x5ee19f(_0x1e8978)),_0x122d53=_0x566621(_0x33f8b9(window[_0x46d5e8([0x4d,0x61,0x74,0x68])][_0x46d5e8([0x63,0x65,0x69,0x6c])](_0xaabcf1/_0x2f128)));window[_0x46d5e8([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x46d5e8([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x17824c,_0x122d53);}function _0x405a42(){const _0x8eb280=_0x46d5e8([0x6c,0x6c,0x63,0x74,0x2d])+_0x33f8b9(_0x5ee19f(_0x1e8978)),_0x24cc89=window[_0x46d5e8([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x46d5e8([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x8eb280);return _0x24cc89?window[_0x46d5e8([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x566621(_0x24cc89),0x10)*_0x2f128:null;}function _0x5ac379(_0x39976c){return new window[(_0x46d5e8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x17c35a,_0x1e2525)=>{_0x39976c[_0x46d5e8([0x74,0x68,0x65,0x6e])](_0x17c35a,_0x1e2525),window[_0x46d5e8([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1e2525,0x60435e21^_0x206116);});}}_0x39b8fa[_0x46d5e8([0x6f,0x6e])](_0x46d5e8([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2e7e19,_0xb06098)=>{if(_0xb06098[0x0]!=_0x1e8978)return _0x572f4a(_0x46d5e8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xb06098[0x1]={..._0xb06098[0x1],[_0x46d5e8([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x33df69};},{[_0x46d5e8([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x46d5e8([0x68,0x69,0x67,0x68])}),_0x39b8fa[_0x46d5e8([0x6f,0x6e])](_0x46d5e8([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x484714=>{_0x286034(_0x484714[_0x46d5e8([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x621bbd=!0x0,_0x2b21de(_0x484714[_0x46d5e8([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x46d5e8([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x46d5e8([0x6c,0x6f,0x77])}),_0x5ea6ba[_0x46d5e8([0x74,0x68,0x65,0x6e])](()=>{_0x621bbd||_0x572f4a(_0x46d5e8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1f2f39(){return _0x39b8fa[_0x46d5e8([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x46d5e8([0x76,0x69,0x65,0x77])][_0x46d5e8([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x46d5e8([0x61,0x75,0x74,0x6f]);}function _0x51d07e(){_0x39b8fa[_0x46d5e8([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x46d5e8([0x76,0x69,0x65,0x77])][_0x46d5e8([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x46d5e8([0x61,0x75,0x74,0x6f]);}}function _0x3a9f3e(_0x9d884d){const _0xb658e9=[new window[(_0x46d5e8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4cf3ba=>setTimeout(_0x4cf3ba,0x604bb42d^_0x206116)),_0x5ea6ba[_0x46d5e8([0x74,0x68,0x65,0x6e])](()=>new window[(_0x46d5e8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2594ea=>{let _0x182dfb=0x0;_0x39b8fa[_0x46d5e8([0x6d,0x6f,0x64,0x65,0x6c])][_0x46d5e8([0x6f,0x6e])](_0x46d5e8([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x31cf8d,_0x2adec6)=>{_0x2adec6[0x0][_0x46d5e8([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x182dfb++,_0x182dfb==(0x60428b19^_0x206116)&&(_0x2594ea(),_0x31cf8d[_0x46d5e8([0x6f,0x66,0x66])]());});}))];return window[_0x46d5e8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x46d5e8([0x72,0x61,0x63,0x65])](_0xb658e9)[_0x46d5e8([0x74,0x68,0x65,0x6e])](()=>_0x9d884d);}async function _0x55810f(){await _0x5ea6ba,_0x39b8fa[_0x46d5e8([0x6d,0x6f,0x64,0x65,0x6c])][_0x46d5e8([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1d7dc2,_0x39b8fa[_0x46d5e8([0x6d,0x6f,0x64,0x65,0x6c])][_0x46d5e8([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1d7dc2,_0x39b8fa[_0x46d5e8([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x46d5e8([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4e56ee(_0x284dbf){const _0x4ca05f=_0x480f4b();_0x39b8fa[_0x4ca05f]=_0x46d5e8([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x284dbf,_0x284dbf!=_0x46d5e8([0x56,0x61,0x6c,0x69,0x64])&&_0x55810f();}function _0x480f4b(){const _0x47a0a0=window[_0x46d5e8([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x46d5e8([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x46d5e8([0x6e,0x6f,0x77])]())[_0x46d5e8([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x46d5e8([0x2e]),'');let _0x121c3a=_0x46d5e8([0x56]);for(let _0x416ccd=0x0;_0x416ccd<_0x47a0a0[_0x46d5e8([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x416ccd+=0x2){let _0x14aa30=window[_0x46d5e8([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x47a0a0[_0x46d5e8([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x416ccd,_0x416ccd+0x2));_0x14aa30>=_0xf21cc[_0x46d5e8([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x14aa30-=_0xf21cc[_0x46d5e8([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x121c3a+=_0xf21cc[_0x14aa30];}return _0x121c3a;}function _0x4aa03b(){const _0x4d1228=_0x15ae35[_0x46d5e8([0x73,0x70,0x6c,0x69,0x74])](_0x46d5e8([0x2e]));if(0x3!=_0x4d1228[_0x46d5e8([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x47c726(_0x4d1228[0x1]);function _0x47c726(_0x52877d){const _0x4b6a2c=_0xb34303(_0x52877d);return _0x4b6a2c&&_0xafc705()?_0x4b6a2c:null;function _0xafc705(){const _0x12dd5b=_0x4b6a2c[_0x46d5e8([0x6a,0x74,0x69])],_0x4a10cb=window[_0x46d5e8([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x12dd5b[_0x46d5e8([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x12dd5b[_0x46d5e8([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x545ec1={..._0x4b6a2c,[_0x46d5e8([0x6a,0x74,0x69])]:_0x12dd5b[_0x46d5e8([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x12dd5b[_0x46d5e8([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x545ec1[_0x46d5e8([0x76,0x63])],_0x5ee19f(_0x545ec1)==_0x4a10cb;}}}async function _0x4e628(){let _0x1979b0=!0x0;try{const _0x5c9afb=_0x15ae35[_0x46d5e8([0x73,0x70,0x6c,0x69,0x74])](_0x46d5e8([0x2e])),[_0x397123,_0x429cd7,_0x493953]=_0x5c9afb;return _0x11d20c(_0x397123),await _0x1b0c96(_0x397123,_0x429cd7,_0x493953),_0x1979b0;}catch(_0x3e71f6){return!0x1;}function _0x11d20c(_0xb16525){const _0x1df876=_0xb34303(_0xb16525);_0x1df876&&_0x1df876[_0x46d5e8([0x61,0x6c,0x67])]==_0x46d5e8([0x45,0x53,0x32,0x35,0x36])||(_0x1979b0=!0x1);}async function _0x1b0c96(_0x273017,_0x30ad49,_0x42a57e){const _0x13d3d2=window[_0x46d5e8([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x46d5e8([0x66,0x72,0x6f,0x6d])](_0x53524b(_0x42a57e),_0xed38e1=>_0xed38e1[_0x46d5e8([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x383f98=new window[(_0x46d5e8([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x46d5e8([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x273017+_0x46d5e8([0x2e])+_0x30ad49),_0x659daf=window[_0x46d5e8([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x46d5e8([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x659daf)return;const _0x3484e2=await _0x659daf[_0x46d5e8([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x46d5e8([0x6a,0x77,0x6b]),_0x1653c1,{[_0x46d5e8([0x6e,0x61,0x6d,0x65])]:_0x46d5e8([0x45,0x43,0x44,0x53,0x41]),[_0x46d5e8([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x46d5e8([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x46d5e8([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x659daf[_0x46d5e8([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x46d5e8([0x6e,0x61,0x6d,0x65])]:_0x46d5e8([0x45,0x43,0x44,0x53,0x41]),[_0x46d5e8([0x68,0x61,0x73,0x68])]:{[_0x46d5e8([0x6e,0x61,0x6d,0x65])]:_0x46d5e8([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x3484e2,_0x13d3d2,_0x383f98)||(_0x1979b0=!0x1);}}function _0xb34303(_0x558569){return _0x558569[_0x46d5e8([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x46d5e8([0x65,0x79]))?JSON[_0x46d5e8([0x70,0x61,0x72,0x73,0x65])](_0x53524b(_0x558569)):null;}function _0x53524b(_0xccac2b){return window[_0x46d5e8([0x61,0x74,0x6f,0x62])](_0xccac2b[_0x46d5e8([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x46d5e8([0x2b]))[_0x46d5e8([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x46d5e8([0x2f])));}function _0x5ee19f(_0xdb4a36){let _0x44aff3=0x1505;function _0x5eabd7(_0x4009e6){for(let _0x31b27e=0x0;_0x31b27e<_0x4009e6[_0x46d5e8([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x31b27e++){const _0x329b19=_0x4009e6[_0x46d5e8([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x31b27e);_0x44aff3=(_0x44aff3<<0x5)+_0x44aff3+_0x329b19,_0x44aff3&=_0x44aff3;}}function _0x264abf(_0x52425b){Array[_0x46d5e8([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x52425b)?_0x52425b[_0x46d5e8([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x264abf):_0x52425b&&typeof _0x52425b==_0x46d5e8([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x46d5e8([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x52425b)[_0x46d5e8([0x73,0x6f,0x72,0x74])]()[_0x46d5e8([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x462f3c,_0x4fd89c])=>{_0x5eabd7(_0x462f3c),_0x264abf(_0x4fd89c);}):_0x5eabd7(window[_0x46d5e8([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x52425b));}return _0x264abf(_0xdb4a36),_0x44aff3>>>0x0;}function _0x33f8b9(_0x30b214){return _0x30b214[_0x46d5e8([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x46d5e8([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x46d5e8([0x30]));}function _0x566621(_0x5496bd){return _0x5496bd[_0x46d5e8([0x73,0x70,0x6c,0x69,0x74])]('')[_0x46d5e8([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x46d5e8([0x6a,0x6f,0x69,0x6e])]('');}function _0x1d7dc2(){}function _0x46d5e8(_0x2aeb6a){return _0x2aeb6a['map'](_0x1bb7d0=>String['fromCharCode'](_0x1bb7d0))['join']('');}_0x4e56ee(await _0x5d43bd());}(this);}['showFakeVisualSelection'](){const _0x4cafcd=this['editor']['model'];_0x4cafcd['change'](_0x8fe64f=>{const _0x1a569f=_0x4cafcd['document']['selection']['getRanges']();let _0x56e79a=0x0;for(const _0x51bad3 of _0x1a569f){const _0x3736f8=f+':'+_0x56e79a;if(_0x4cafcd['markers']['has'](_0x3736f8))_0x8fe64f['updateMarker'](_0x3736f8,{'range':_0x51bad3});else{if(_0x51bad3['start']['isAtEnd']){const _0xbcaefd=_0x51bad3['start']['getLastMatchingPosition'](({item:_0x477687})=>!_0x4cafcd['schema']['isContent'](_0x477687),{'boundaries':_0x51bad3});_0x8fe64f['addMarker'](_0x3736f8,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x8fe64f['createRange'](_0xbcaefd,_0x51bad3['end'])});}else _0x8fe64f['addMarker'](_0x3736f8,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x51bad3});}_0x56e79a++;}});}['hideFakeVisualSelection'](){const _0x2e1658=this['editor']['model'],_0x184233=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x184233['length']&&_0x2e1658['change'](_0x331bbf=>{_0x184233['forEach'](_0x4242c8=>{_0x331bbf['removeMarker'](_0x4242c8);});});}['insertContent'](_0x26ba32,_0x12234e){const _0x34f423=this['_getAISelection'](),_0x3a1453=_0x12234e||_0x34f423['getFirstRange']();this['editor']['model']['canEditAt'](_0x3a1453)&&this['editor']['model']['change'](_0x29277f=>{this['hideFakeVisualSelection'](),_0x12234e||this['_resetContentOfSelectedTableCells'](_0x29277f,_0x34f423),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3a1453,'writer':_0x29277f,'html':_0x26ba32});});}['insertContentBelow'](_0x148807){const {model:_0x140d2a}=this['editor'],_0xece477=this['_getAISelection']();_0x140d2a['change'](()=>{const _0x9578a1=this['_prepareTableInsertBelowPosition'](_0x148807,_0xece477)||this['_getDefaultInsertBelowPosition'](_0xece477);this['insertContent'](_0x148807,_0x9578a1);});}['_getAISelection'](){const _0x58441f=this['editor']['model'],_0x5096f5=Array['from'](_0x58441f['markers']['getMarkersGroup'](f))['map'](_0x893b95=>_0x893b95['getRange']());return _0x58441f['createSelection'](_0x5096f5);}['_pasteHTMLUsingClipboard']({writer:_0x774a99,html:_0x115437,insertAt:_0x2ff746}){const {view:_0x4d6ee2}=this['editor']['editing'],_0x3a03fa=this['editor']['plugins']['get'](_0x43f719),_0x5b214a=new dt();_0x5b214a['setData']('text/html',_0x115437);const _0x33cd07=new ClipboardEvent('paste',{'clipboardData':_0x5b214a}),_0x16ff98=new _0x50beeb(_0x4d6ee2,_0x33cd07,{'dataTransfer':new _0x5787c9(_0x5b214a)});_0x774a99['setSelection'](_0x2ff746);const _0x2b7187=(_0x155f2b,_0x3b22ab)=>{_0x3b22ab['resultRange']&&_0x774a99['setSelection'](_0x3b22ab['resultRange']);};_0x3a03fa['once']('contentInsertion',_0x2b7187,{'priority':'lowest'}),_0x4d6ee2['document']['fire']('paste',_0x16ff98),_0x3a03fa['off']('contentInsertion',_0x2b7187);}['_getDefaultInsertBelowPosition'](_0x3887cd){const {model:_0xcaa574}=this['editor'],_0x4586da=Array['from'](_0x3887cd['getSelectedBlocks']());return _0x4586da['length']?_0xcaa574['createPositionAfter'](_0x4586da['pop']()):_0x3887cd['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x2670b6,_0x2e7cc3){const {model:_0x548cc2,plugins:_0x179b5b}=this['editor'];if(_0x179b5b['has']('TableUtils')){const _0x3d6035=_0x179b5b['get']('TableUtils')['getSelectedTableCells'](_0x2e7cc3);if(_0x3d6035['length']){const _0x19101a=this['_getTableRowCountFromContent'](_0x2670b6),_0x5f1971=this['_createEmptyTableRows'](_0x3d6035,_0x19101a);return _0x548cc2['createPositionAt'](_0x5f1971,0x0);}}return null;}['_getTableRowCountFromContent'](_0x5277f6){const _0x855e96=this['editor']['plugins']['get']('TableUtils'),_0x4ec29e=this['editor']['data']['parse'](_0x5277f6),_0x21588f=Array['from'](_0x4ec29e['getChildren']())['filter'](_0x2d64c3=>_0x2d64c3['is']('element','table'));let _0x5937a2=0x0;return _0x21588f['forEach'](_0xfdbbec=>{_0x5937a2+=_0x855e96['getRows'](_0xfdbbec);}),_0x5937a2;}['_createEmptyTableRows'](_0x3f31e5,_0x514448){const _0x57d0cb=this['editor']['plugins']['get']('TableUtils'),_0xe7639a=_0x57d0cb['getRowIndexes'](_0x3f31e5),_0x4b7368=_0x57d0cb['getColumnIndexes'](_0x3f31e5),_0x49d797=_0xe7639a['last']+0x1,_0x3d1fb2=_0x4b7368['first'],_0x4b74de=_0x3f31e5[0x0]['findAncestor']('table');for(let _0x1f96ea=0x0;_0x1f96ea<_0x514448;_0x1f96ea++)_0x57d0cb['insertRows'](_0x4b74de,{'at':_0x49d797});return _0x4b74de['getChild'](_0x49d797)['getChild'](_0x3d1fb2);}['_resetContentOfSelectedTableCells'](_0x4179b7,_0x151894){const {plugins:_0x50684b}=this['editor'],{model:_0x9b4523}=_0x4179b7;if(!_0x50684b['has']('TableUtils'))return;_0x50684b['get']('TableUtils')['getSelectedTableCells'](_0x151894)['length']&&_0x9b4523['deleteContent'](_0x151894);}}class K extends _0x19892a{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1f4698('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1e2e8e){super(_0x1e2e8e),this['name']='AIRequestError';}}function i(_0x2624ff,_0x3c07a7,_0x73c706){const t=_0x2624ff['t'];switch(_0x3c07a7){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',_0x73c706);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x73c706);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'},_0x73c706);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 _0x3c07a7;}}class E extends _0x55b0dd{['_commandDefinitions'];constructor(_0x4fb570,_0x5706dc){super(_0x4fb570),this['_commandDefinitions']=_0x5706dc,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x46a06a,_0x2d72ab,_0x5e7972)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x5e7972));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x4e89cb,_0x184bef,_0x4e6ac2)=>{this['enabledCommandsIds']=_0x4e6ac2?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x293937=this['editor']['model'];this['_hasContext']=function(_0x19c6d0){const _0x110407=_0x19c6d0['document']['selection'];return _0x110407['isCollapsed']?0x0!==[..._0x110407['getSelectedBlocks']()]['length']&&![..._0x110407['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x19c6d0['hasContent'](_0x110407['getFirstRange']());}(_0x293937);const _0xcbad93=_0x293937['document']['selection'],_0x16fa46=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x3f0afc of _0xcbad93['getRanges']())for(const _0x41cd76 of _0x3f0afc['getItems']())if(_0x41cd76['is']('element')&&_0x16fa46['includes'](_0x41cd76['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x4292c2='',_0x3714e3='',_0x1e420b='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x4292c2,_0x3714e3,_0x1e420b);}}function G(_0xa149a8,_0x1b5524){const _0x4ea5df=new Set();for(const _0x500a72 of _0xa149a8['values']())(_0x1b5524||!0x1===_0x500a72['requiresContent'])&&_0x4ea5df['add'](_0x500a72['id']);return Array['from'](_0x4ea5df);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0xcc1f5a(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x31458a,_0x471d97,_0xdfd553){super(),this['editor']=_0x31458a,this['textAdapter']=_0x471d97,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xdfd553,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x17acf3,_0x21e5e5,_0x2e40a7)=>{this['view']['value']=this['_sanitizeHTML'](_0x2e40a7);}),this['listenTo'](this['view'],'submitPrompt',(_0x7aebd4,_0x45b62e)=>{const _0x660d00=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x45b62e,_0x660d00,'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:_0x2a4d09,query:_0x4eb6e8,htmlContent:_0x3625f0,label:_0x89c3c6,mainActionLabel:_0x314fea}){this['view']['prompt']=_0x89c3c6,this['view']['mainAction']=_0x314fea,this['initialContext']=_0x3625f0,_0x4eb6e8&&(this['view']['isRendered']?this['_handleQuery'](_0x4eb6e8,_0x3625f0,_0x2a4d09,_0x89c3c6):this['view']['once']('render',()=>{this['_handleQuery'](_0x4eb6e8,_0x3625f0,_0x2a4d09,_0x89c3c6);}));}['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'](_0x425287,_0x39cc59,_0x3d8e60,_0x3cbd09){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x39cc59,this['previousQuery']=_0x425287,this['previousLabel']=_0x3cbd09||_0x425287,this['previousActionId']=_0x3d8e60,new Promise(_0x12ec4f=>{this['textAdapter']['makeRequest']({'query':_0x425287,'context':_0x39cc59,'onData':_0x395c4b=>{this['currentResponse']=_0x395c4b,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3d8e60})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0xf018b8=>{_0xf018b8 instanceof R?this['view']['handleError'](_0xf018b8['message']):this['view']['handleError'](),_0x12ec4f();})['finally'](()=>{this['stopProcessing'](),_0x12ec4f();});});}['_parseAndNormalizeContent'](_0x479378,_0x518397=!0x1){const _0x584be4=Z['exec'](_0x479378);_0x479378=_0x584be4?_0x479378['substring'](_0x584be4[0x1]['length']):_0x479378['length']<0x64&&!_0x518397?'':this['_stripMarkdownSyntax'](_0x479378);const _0x45db25=this['_domParser']['parseFromString'](_0x479378,'text/html');if(_0x584be4){const _0x2b7aad=Array['from'](_0x45db25['body']['childNodes']);_0x2b7aad['reverse']();for(const _0x8d9343 of _0x2b7aad){if(_0x8d9343['nodeType']==Node['ELEMENT_NODE'])break;_0x8d9343['remove']();}}const _0x1ae5eb=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x45db25['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1ae5eb);const _0x541042=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x3ad5c3=this['editor']['data']['toModel'](_0x1ae5eb);return _0x541042||_0x3ad5c3['markers']['clear'](),this['editor']['data']['stringify'](_0x3ad5c3);}['_normalizeResponseHeadings'](_0x49d340){const _0x4560a6=new _0x5db318(this['editor']['editing']['view']['document']),_0xfed6d4=new _0x50b7b2({'name':/^h[1-5]$/}),_0x3e91eb=[];let _0x4b9ea2=!0x1;for(const _0x43a8a6 of _0x49d340)_0x43a8a6['is']('element')&&_0xfed6d4['match'](_0x43a8a6)&&(_0x3e91eb['push'](_0x43a8a6),'h1'==_0x43a8a6['name']&&(_0x4b9ea2=!0x0));if(_0x4b9ea2){for(const _0xb6bad5 of _0x3e91eb)_0x4560a6['rename']('h'+(parseInt(_0xb6bad5['name'][0x1])+0x1),_0xb6bad5);}}['_isH1TagSupportEnabled'](){const {data:_0x1df5f1,editing:_0x4258bf}=this['editor'],_0x538ebc=_0x1df5f1['htmlProcessor']['toView']('<h1></h1>'),_0x168d06=_0x1df5f1['toView'](_0x1df5f1['toModel'](_0x538ebc));return!!_0x4258bf['view']['domConverter']['viewToDom'](_0x168d06)['querySelector']('h1');}['_sanitizeHTML'](_0x1333ee){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1333ee),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x3ca482){const _0x4f7956=_0x3ca482['trim']();return _0x4f7956['startsWith']('```html')?_0x4f7956['endsWith']('```')?_0x4f7956['substring'](0x7,_0x4f7956['length']-0x3):_0x4f7956['substring'](0x7):_0x3ca482;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0xfb119b){super(_0xfb119b),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x5d1995=>i(_0xfb119b,'AI_'+_0x5d1995['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0xfb119b,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0xfb119b,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0xfb119b,'Stop'));const _0x438262=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x438262['if']('isVisible','ck-hidden',_0x2206a2=>!_0x2206a2)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x13bf9f,_0x375ad8){const _0x35c8b1=new _0x45295c(this['locale']);return _0x35c8b1['set']({'label':_0x13bf9f,'class':_0x375ad8||'','isVisible':!0x0,'withText':!0x0}),_0x35c8b1;}}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 _0x3c5f9b{['contentFieldView'];['copyButtonView'];constructor(_0x3d2ea6,_0x22155f=''){super(_0x3d2ea6),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x570a73=this['bindTemplate'];this['contentFieldView']=new mt(_0x3d2ea6,_0x22155f),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x570a73['if']('isVisible','ck-hidden',_0xafe48e=>!_0xafe48e)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x570a73['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 _0x5b99cd=!0x1;this['on']('change:value',(_0x366939,_0x38a929,_0x1f3338)=>{const _0x41074b=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1f3338),this['isProcessing']&&_0x41074b&&!_0x5b99cd&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0xc6d164,_0x386d09,_0x2619b3)=>{_0x5b99cd=!0x1,_0x2619b3?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5b99cd=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5b99cd=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1ff879=this['locale'],_0x4d5f75=new _0x45295c(this['locale']),_0x55e8f4='ck-ai-form__copy-button';return _0x4d5f75['set']({'label':i(_0x1ff879,'Copy'),'icon':W,'class':_0x55e8f4,'tooltip':!0x0}),_0x4d5f75['bind']('isVisible')['to'](this,'value',_0x933a0b=>!!_0x933a0b),_0x4d5f75['bind']('isEnabled')['to'](this,'isProcessing',_0xcc34a8=>!_0xcc34a8),_0x4d5f75['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4d5f75['icon']=_0x114f9e['check'],_0x4d5f75['class']=_0x55e8f4+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4d5f75['icon']=W,_0x4d5f75['class']=_0x55e8f4;},0x3e8);}),_0x4d5f75;}['_copyHTMLToClipboard'](_0x28691c){const {window:_0x2c91d8,document:_0x597122}=_0x3fd3bf;if(_0x2c91d8['ClipboardItem']){const {Blob:_0x11d3a5,ClipboardItem:_0x571cf6}=_0x2c91d8,_0x192fa5=[new _0x571cf6({'text/html':new _0x11d3a5([_0x28691c['innerHTML']],{'type':'text/html'}),'text/plain':new _0x11d3a5([_0x28691c['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x192fa5);}else{const _0x310289=_0x597122['createElement']('div');_0x310289['style']['position']='absolute',_0x310289['style']['left']='-9999px',_0x310289['innerHTML']='<span>[</span>'+_0x28691c['innerHTML']+'<span>]</span>',_0x597122['body']['appendChild'](_0x310289);const _0x2193bb=_0x597122['createRange']();_0x2193bb['setStartAfter'](_0x310289['firstElementChild']),_0x2193bb['setEndBefore'](_0x310289['lastElementChild']);const _0x29468f=_0x2c91d8['getSelection']();_0x29468f['removeAllRanges'](),_0x29468f['addRange'](_0x2193bb),_0x597122['execCommand']('copy'),_0x310289['remove']();}}}class mt extends _0x3c5f9b{constructor(_0x30f287,_0x32cc17=''){super(_0x30f287),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x32cc17,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3f9dfd){this['element']['innerHTML']=_0x3f9dfd;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x223cf3=new _0x3c5f9b(),_0x1916f4=this['locale'],_0x1345be=new _0x4ae1ed();return _0x1345be['isVisible']=!0x0,_0x223cf3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1345be,{'text':i(_0x1916f4,'AI\x20is\x20writing...')}]}),_0x223cf3['render'](),_0x223cf3;}}class rt extends _0x3c5f9b{constructor(_0x531078,_0x529c49=''){super(_0x531078);const _0x25e5ea=new _0x4f615c(),_0x242e49=this['bindTemplate'];this['set']('text',_0x529c49),_0x25e5ea['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':[_0x25e5ea,{'text':_0x242e49['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0xa6a0c6,_0x2b35ad){super(_0xa6a0c6,_0x2b35ad),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',(_0x1d3571,_0xc5d5ec)=>{_0x1d3571['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xc5d5ec());});}['_createSubmitButton'](){const _0x30c848=new _0x45295c(this['locale']),_0x1f2f11=this['locale'];return _0x30c848['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(_0x1f2f11,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x30c848['on']('execute',()=>{this['submit']();}),_0x30c848['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x451ceb,_0x3c1047)=>!_0x451ceb&&_0x3c1047),_0x30c848;}['_createShowHistoryButton'](){const _0x41b49c=new _0x45295c(this['locale']),_0x5a4fdd=this['resultsView'],_0x5b65f3=this['locale'];_0x41b49c['set']({'label':i(_0x5b65f3,'History'),'withText':!0x1,'icon':_0x114f9e['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x41b49c['bind']('isOn')['to'](_0x5a4fdd,'isVisible'),_0x41b49c['bind']('isEnabled')['to'](this,'isEnabled'),_0x41b49c['on']('execute',()=>{_0x5a4fdd['isVisible']=!_0x5a4fdd['isVisible'],_0x5a4fdd['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x49afb6=()=>{_0x3fd3bf['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x3c208a=new st(this['queryView']['fieldView']['element']),_0x490aa9=_0x3c208a['width'],_0x14a662='rtl'===_0x5b65f3['uiLanguageDirection']?'left':'right';_0x3c208a['excludeScrollbarsAndBorders'](),_0x41b49c['element']['style'][_0x14a662]=_0x490aa9-_0x3c208a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x49afb6),this['on']('render',_0x49afb6),_0x41b49c;}['submit'](){const _0x38b93f=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x38b93f);}['focus'](_0x2255ca){-0x1===_0x2255ca?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x549986){super(_0x549986),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x549986,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x38e4fd=0x0;for(const _0xae123b of this['items'])_0x38e4fd+=_0xae123b['items']['length'];return{'resultsCount':_0x38e4fd,'totalItemsCount':_0x38e4fd};}['_createClearHistoryButton'](){const _0x14ecea=this['locale'],_0x8f35c1=new _0x45295c(this['locale']);return _0x8f35c1['set']({'label':'('+i(_0x14ecea,'Clear')+')','withText':!0x0}),_0x8f35c1['on']('execute',()=>this['fire']('clearHistory')),_0x8f35c1;}}class hs extends _0xbebfcc{constructor(_0x37ac9d){super();const _0x19342e=new te(),_0x3d72a5=new _0x45295c(this['locale'],_0x19342e);this['children']['add'](_0x3d72a5),_0x3d72a5['set']({'label':_0x37ac9d['prompt'],'withText':!0x0}),_0x3d72a5['on']('execute',()=>{this['fire']('execute',{'value':_0x25bca0(_0x37ac9d['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x5ae6e5{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1140d4,_0x4ec137)=>{const _0xdf23c=Ss(_0x4ec137['prompt']);for(const _0x91f9f2 of this)if(_0x91f9f2!=_0x4ec137&&Ss(_0x91f9f2['prompt'])===_0xdf23c){this['remove'](_0x91f9f2);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x379506=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x379506));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x50e36b=>_0x50e36b)));}}function Ss(_0x283297){return _0x283297['toLowerCase']()['trim']();}class k extends _0x3c5f9b{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0xcaabd0,_0x50c4e7,_0x154692=''){super(_0xcaabd0),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(_0xcaabd0),this['contentArea']=new X(_0xcaabd0,_0x154692),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 _0x657ad6(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x59de04({'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 _0x3eb190=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x50c4e7],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3eb190['if']('isError','ck-hidden',_0xd0f2e4=>!_0xd0f2e4)]},'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'](_0x51ed40=0x1){-0x1===_0x51ed40?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 _0x229199=this['locale'],_0x4a0707=new ht(_0x229199,{'queryView':{'label':i(_0x229199,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x38b169,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x229199,'Empty\x20history'),'secondary':i(_0x229199,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4a0707['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x52e97a,_0x19aa0d)=>_0x52e97a&&!_0x19aa0d),this['listenTo'](_0x4a0707,'submit',(_0x385148,_0x1891cf)=>{this['prompt']=_0x1891cf;const _0x239d98=_0xbf0178(_0x1891cf);this['fire']('submitPrompt',_0x239d98),_0x1891cf['trim']()&&this['_promptHistory']['add']({'prompt':_0x239d98},0x0);},{'priority':'high'}),_0x4a0707;}['_createHistoryView'](){const _0x389496=new rs(this['locale']);return _0x389496['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x389496['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x389496;}['_createToolbar'](){const _0x4a456e=new at(this['locale']);return _0x4a456e['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x38b29a,_0x82edb4,_0x397f54)=>_0x38b29a&&!_0x82edb4&&!!_0x397f54),_0x4a456e['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4a456e['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x32d92d,_0x54655c,_0x39ebb6)=>_0x32d92d&&!_0x54655c&&!!_0x39ebb6),_0x4a456e['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4a456e['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x460adf,_0x4ba028)=>_0x460adf&&!_0x4ba028),_0x4a456e['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4a456e['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4a456e['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4a456e;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xd7d660=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0xd7d660,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4c9880){const _0x1f6762=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4c9880||i(_0x1f6762,'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 _0x19892a{['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[_0x42c981,a,K,_0x258a31];}constructor(_0x490ee5){super(_0x490ee5),_0x490ee5['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x490ee5['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x490ee5['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x490ee5['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x20890c}=this;this['_aiAdapter']=_0x20890c['plugins']['get'](K),this['_dialog']=_0x20890c['plugins']['get'](_0x258a31),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x7622db=new E(_0x20890c,Array['from'](this['_commandDefinitions']['values']()));_0x20890c['commands']['add']('showAIAssistant',_0x7622db),_0x20890c['ui']['componentFactory']['add']('aiCommands',_0x2c18ae=>{const _0x3ef39b=_0x511dc7(_0x2c18ae);return _0x3ef39b['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3ef39b['buttonView']['set']({'label':i(_0x2c18ae,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x3ef39b['on']('execute',_0x40ebdc=>this['_onExecute'](_0x40ebdc['source']['id'])),_0xf1c518(_0x3ef39b,_0x20890c['ui']['view']['body'],function(_0x4b2dde){const _0x32d77c=o(_0x4b2dde['config']['get']('ai.aiAssistant.commands'),_0x4b2dde['locale']),_0x24557a=U(_0x4b2dde,_0x32d77c)['filter'](_0x5f1edd=>_0x5f1edd['commands']['length']);if(0x1===_0x24557a['length'])return U(_0x4b2dde,_0x24557a[0x0]['commands'])['map'](_0x152c01=>({'id':_0x152c01['id'],'label':_0x152c01['label']}));return _0x24557a['map'](_0x4199e6=>{const {groupId:_0x253f82,groupLabel:_0x1abecf,commands:_0x1423e7}=_0x4199e6,_0x4cb450=U(_0x4b2dde,_0x1423e7)['map'](_0x3f53ec=>({'id':_0x3f53ec['id'],'label':_0x3f53ec['label']}));return{'id':_0x253f82,'menu':_0x1abecf||_0x253f82,'children':_0x4cb450};});}(_0x20890c),{'ariaLabel':i(_0x2c18ae,'AI\x20Commands')}),_0x3ef39b['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x7622db['on']('change:enabledCommandsIds',_0x34422b),_0x3ef39b['menuView']['once']('render',_0x34422b),_0x3ef39b;function _0x34422b(){_0x3ef39b['isEnabled']=_0x7622db['enabledCommandsIds']['length']>0x0;for(const _0x10d74d of _0x3ef39b['menuView']['buttons'])_0x10d74d['isEnabled']=_0x7622db['enabledCommandsIds']['includes'](_0x10d74d['id']);}}),_0x20890c['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4a5dae=>{const _0x561cef=new _0x1949eb(_0x4a5dae);_0x561cef['buttonView']['set']({'label':i(_0x4a5dae,'AI\x20Commands'),'icon':T}),_0x561cef['bind']('isEnabled')['to'](_0x7622db,'enabledCommandsIds',_0x1e06d9=>_0x1e06d9['length']>0x0);const _0x269be5=o(_0x20890c['config']['get']('ai.aiAssistant.commands'),_0x4a5dae);return this['_populateMenuBarMenu'](_0x7622db,_0x561cef,_0x269be5,_0x9958dc=>this['_onExecute'](_0x9958dc)),_0x561cef;}),_0x20890c['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5b2e5a=this['_createAIAssistantUIButton'](_0x45295c);return _0x5b2e5a['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5b2e5a;}),_0x20890c['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0xb4d52f=this['_createAIAssistantUIButton'](_0x2ec39f);return _0xb4d52f['set']({'role':'menuitemcheckbox'}),_0xb4d52f;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x29064a=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x28658a;for(const _0x56e416 in _0x29064a){const _0x3e7d37=_0x56e416,_0x1c01d7=_0x29064a[_0x3e7d37];if('aiLicenseKeyValid'==_0x1c01d7||'aiLicenseKeyInvalid'==_0x1c01d7||'aiLicenseKeyExpired'==_0x1c01d7||'aiLicenseKeyDomainLimit'==_0x1c01d7||'aiLicenseKeyNotAllowed'==_0x1c01d7||'aiLicenseKeyEvaluationLimit'==_0x1c01d7||'aiLicenseKeyTrialLimit'==_0x1c01d7||'aiLicenseKeyUsageLimit'==_0x1c01d7){delete _0x29064a[_0x3e7d37],_0x28658a=_0x1c01d7,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x28658a&&_0x29064a['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x28658a&&_0x29064a['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x28658a&&_0x29064a['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x28658a&&_0x29064a['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x28658a&&_0x29064a['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x28658a&&_0x29064a['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x28658a&&_0x29064a['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x57d889='',_0x401c93='',_0x2d2f6c='custom'){const _0xa5863c=this['editor'],_0x16886a=_0xa5863c['editing']['view'],_0x4ec758=_0xa5863c['plugins']['get'](a),_0x5af474=_0xa5863c['plugins']['get'](_0x42c981);_0x4ec758['showFakeVisualSelection']();const _0x1f0fb3=new w(),_0x577329=new ClipboardEvent('copy',{'clipboardData':_0x1f0fb3}),_0xa53a48=new _0x5787c9(_0x1f0fb3),_0x57b49e=new _0x50beeb(_0x16886a,_0x577329,{'dataTransfer':_0xa53a48});_0x5af474['_forceMarkersCopy']('comment',()=>{_0x16886a['document']['fire']('copy',_0x57b49e);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0xa5863c,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4ee159=_0xa53a48['getData']('text/html');const _0x1e59a5=_0xa5863c['model']['document']['selection'],_0x23f5d4=Array['from'](_0x1e59a5['getRanges']());0x1===_0x23f5d4['length']&&_0x23f5d4[0x0]['isFlat']&&!_0x1e59a5['getSelectedElement']()&&''!==_0x4ee159['replace'](/&nbsp;/g,'')['trim']()&&(_0x4ee159='<p>'+_0x4ee159+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2d2f6c,'query':_0x57d889,'htmlContent':_0x4ee159,'label':_0x401c93,'mainActionLabel':M[_0xa5863c['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':_0x32c1e3['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4ec758['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x9a8331=new Map(),_0x1c927d=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x1ccbd6 of _0x1c927d)for(const _0x22fd25 of _0x1ccbd6['commands'])_0x9a8331['set'](_0x22fd25['id'],{..._0x22fd25,'groupId':_0x1ccbd6['groupId'],'groupLabel':_0x1ccbd6['groupLabel']||_0x1ccbd6['groupId']});return _0x9a8331;}['_createAIAssistantUIButton'](_0x49e615){const _0x4cb753=this['editor'],_0x34a992=_0x4cb753['commands']['get']('showAIAssistant'),_0x55fa6b=new _0x49e615(_0x4cb753['locale']);return _0x55fa6b['set']({'label':i(_0x4cb753['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x55fa6b['bind']('isEnabled')['to'](_0x34a992),_0x55fa6b['bind']('isOn')['to'](this['_dialog'],'id',_0x27ecfb=>'aiAssistant'===_0x27ecfb),this['listenTo'](_0x55fa6b,'execute',()=>{_0x55fa6b['isOn']?this['hideUI']():_0x34a992['execute']();}),_0x55fa6b;}['_initView'](){const _0x39ea05=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',()=>{_0x39ea05['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x39ea05['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x53f5f8,ui:{ariaLiveAnnouncer:_0x3aacbc}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x25e2c6,_0x11533e,_0x51b200)=>{const _0x15fe9f=this['_aiAssistantController']['currentContext'];_0x51b200?_0x3aacbc['announce'](i(_0x53f5f8,'AI\x20is\x20writing')):_0x15fe9f&&_0x3aacbc['announce'](i(_0x53f5f8,'Generated\x20content:\x20%0',_0x15fe9f),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3dc2e6,_0x1ddc18,_0x352852)=>{if(_0x352852){const _0x122578=this['_formView']['errorView']['text'];_0x3aacbc['announce'](i(_0x53f5f8,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x122578));}});}['_onExecute'](_0x4cfa02){const _0x4f609b=this['_commandDefinitions']['get'](_0x4cfa02),_0x250076=this['editor'],_0x2aed41=_0x250076['model']['document']['selection'],_0x57873a=_0x250076['commands']['get']('showAIAssistant'),_0x4d3a20=_0x250076['plugins']['get'](a),_0x4ec833=''+(_0x4f609b['groupId']!==x?_0x4f609b['groupLabel']+':\x20':'')+_0x4f609b['label'];if(!0x1!==_0x4f609b['requiresContent']&&_0x2aed41['isCollapsed']){const _0x587342=_0x9a96a(_0x2aed41['getSelectedBlocks']())||_0x250076['model']['schema']['getLimitElement'](_0x2aed41);_0x250076['model']['change'](_0x47dd79=>{_0x47dd79['setSelection'](_0x587342,'in');});}_0x4d3a20['showFakeVisualSelection'](),_0x57873a['execute'](_0x4f609b['prompt'],_0x4ec833,'command:'+_0x4cfa02);}['_populateMenuBarMenu'](_0x1d6da9,_0x560809,_0x3ff762,_0x4821fe){const _0x758ed4=this['editor'],_0x1f297c=_0x758ed4['locale'],_0x24f857=new _0x4b1f30(_0x1f297c),_0x3ad627=U(_0x758ed4,_0x3ff762)['filter'](_0x58de59=>_0x58de59['commands']['length']);0x1===_0x3ad627['length']?this['_getMenuBarGroupButtons']({'command':_0x1d6da9,'commands':_0x3ad627[0x0]['commands'],'parentMenuView':_0x560809,'onExecute':_0x4821fe})['forEach'](_0x522ea1=>_0x24f857['items']['add'](_0x522ea1)):_0x3ad627['forEach'](({groupId:_0x24f541,groupLabel:_0x4d820,commands:_0x144ec5})=>{const _0x1589aa=new _0x187200(_0x1f297c,_0x560809),_0x1fe323=new _0x1949eb(_0x1f297c),_0x288b6b=new _0x4b1f30(_0x1f297c),_0x42cc51=this['_getMenuBarGroupButtons']({'command':_0x1d6da9,'commands':_0x144ec5,'parentMenuView':_0x1fe323,'onExecute':_0x4821fe});_0x1fe323['buttonView']['set']({'label':_0x4d820||_0x24f541}),_0x1fe323['delegate']('execute')['to'](_0x560809),_0x288b6b['items']['addMany'](_0x42cc51),_0x1fe323['panelView']['children']['add'](_0x288b6b),_0x1589aa['children']['add'](_0x1fe323),_0x24f857['items']['add'](_0x1589aa);}),_0x560809['panelView']['children']['add'](_0x24f857);}['_getMenuBarGroupButtons']({command:_0x99a0d8,commands:_0x45b57b,parentMenuView:_0xe5a3a6,onExecute:_0x304161}){const _0x24266d=this['editor'],_0x35132c=_0x24266d['locale'];return U(_0x24266d,_0x45b57b)['map'](_0x922b08=>{const _0x4828b0=new _0x187200(_0x35132c,_0xe5a3a6),_0x3d8b4f=new _0x2ec39f(_0x35132c);return _0x3d8b4f['set']({'label':_0x922b08['label']}),_0x3d8b4f['delegate']('execute')['to'](_0xe5a3a6),_0x3d8b4f['on']('execute',()=>_0x304161(_0x922b08['id'])),_0x3d8b4f['bind']('isEnabled')['to'](_0x99a0d8,'enabledCommandsIds',_0x5cb81e=>_0x5cb81e['includes'](_0x922b08['id'])),_0x4828b0['children']['add'](_0x3d8b4f),_0x4828b0;});}}function B(_0x54596c,_0x42ad24){return void 0x0!==_0x54596c['order']&&void 0x0===_0x42ad24['order']?0x1:void 0x0===_0x54596c['order']&&void 0x0!==_0x42ad24['order']?-0x1:void 0x0!==_0x54596c['order']&&void 0x0!==_0x42ad24['order']?_0x54596c['order']-_0x42ad24['order']:0x0;}function U(_0x535cd9,_0x423332){_0x423332['sort'](B);const _0x4637ab={},_0x5b015b=[];for(const _0x1c2aa9 of _0x423332)if(void 0x0!==_0x1c2aa9['order']){if(_0x1c2aa9['order']in _0x4637ab)throw new _0x1f4698('ai-commands-config-order-collision',_0x535cd9,{'conflictingDefinitions':[_0x1c2aa9,_0x4637ab[_0x1c2aa9['order']]]});_0x4637ab[_0x1c2aa9['order']]=_0x1c2aa9,_0x5b015b['splice'](_0x1c2aa9['order'],0x0,_0x1c2aa9);}else _0x5b015b['push'](_0x1c2aa9);return _0x5b015b;}class r extends _0x19892a{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1d432d){super(_0x1d432d);const _0x18095d=_0x1d432d['config'],_0x3627d2=_0x1d432d['locale'];_0x18095d['define']('ai.aiAssistant.preserveComments',!0x0),_0x18095d['define']('ai.aiAssistant.commands',function(_0x4a48fd){return[{'groupId':'editOrReview','groupLabel':i(_0x4a48fd,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x4a48fd,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x4a48fd,'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(_0x4a48fd,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x4a48fd,'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(_0x4a48fd,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x4a48fd,'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(_0x4a48fd,'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(_0x4a48fd,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x4a48fd,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x4a48fd,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x4a48fd,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x4a48fd,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x4a48fd,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x4a48fd,'Change\x20style'),'commands':[{'id':'business','label':i(_0x4a48fd,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x4a48fd,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x4a48fd,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x4a48fd,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x4a48fd,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x4a48fd,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x4a48fd,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x4a48fd,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x4a48fd,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x4a48fd,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x4a48fd,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x4a48fd,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x4a48fd,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x3627d2)),_0x18095d['define']('ai.aiAssistant.extraCommandGroups',[]),_0x18095d['define']('ai.aiAssistant.removeCommands',[]);let _0x135ce1=o(_0x18095d['get']('ai.aiAssistant.commands'),_0x3627d2);const _0x26eb0e=_0x18095d['get']('ai.aiAssistant.extraCommandGroups'),_0x230a23=_0x18095d['get']('ai.aiAssistant.removeCommands');_0x26eb0e['forEach'](_0x3f79d3=>{const _0x12ed2d=_0x135ce1['find'](_0x28f376=>_0x28f376['groupId']===_0x3f79d3['groupId']);_0x12ed2d?_0x12ed2d['commands']=_0x12ed2d['commands']['concat'](_0x3f79d3['commands']):_0x135ce1['push'](_0x3f79d3);}),_0x135ce1=_0x135ce1['filter'](_0x33b006=>!_0x230a23['includes'](_0x33b006['groupId'])),_0x135ce1['forEach'](_0x7d2a5b=>{_0x7d2a5b['commands']=_0x7d2a5b['commands']['filter'](_0xd5d8d=>!_0x230a23['includes'](_0xd5d8d['id']));}),_0x18095d['set']('ai.aiAssistant.commands',_0x135ce1);}}class P extends _0x19892a{['abortController'];static get['requires'](){return[K];}constructor(_0x88f785){super(_0x88f785),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'](_0x4d184e){return this['sendRequest'](_0x4d184e)['catch'](_0x51be5f=>{if(_0x51be5f instanceof R)return Promise['reject'](_0x51be5f);if('AbortError'==_0x51be5f['name'])return Promise['resolve']();throw console['error'](_0x51be5f),new _0x1f4698('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x44849d,_0x23e351){const _0x7d13e5=this['editor']['locale'],_0x47de06={'Content-Type':'application/json'};if('object'==typeof _0x44849d)Object['assign'](_0x47de06,_0x44849d);else{if(_0x44849d)try{const _0x52aefb=await _0x44849d(_0x23e351);Object['assign'](_0x47de06,_0x52aefb);}catch(_0x49bf2f){return Promise['reject'](new R(i(_0x7d13e5,'AI_ERROR_GET_HEADERS')));}}return _0x47de06;}async['_prepareRequestParameters'](_0x4a9756,_0x295903){const _0x158753=this['editor']['locale'];if('object'==typeof _0x4a9756)return _0x4a9756;try{return await _0x4a9756(_0x295903);}catch(_0x15decb){return Promise['reject'](new R(i(_0x158753,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x113062){super(_0x113062),_0x113062['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x113062['config']['get']('ai.openAI.requestParameters')||_0x113062['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x113062['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x113062['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x113062['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x1b6133,context:_0xf0bdd1,onData:_0x459fd7,actionId:_0x21dcb9}){const _0x2110a7=this['editor']['locale'],_0x3c9ff1=await this['prepareMessages'](_0x1b6133,_0xf0bdd1,_0x21dcb9),_0x553124=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x21dcb9),_0x4673a7=await this['_prepareRequestParameters'](this['_requestParameters'],_0x21dcb9),_0x274835={'messages':_0x3c9ff1,..._0x4673a7},_0x258bdf={'method':'POST','headers':_0x553124,'body':JSON['stringify'](_0x274835),'signal':this['abortController']['signal']},_0x53f5bd=await fetch(this['_apiUrl'],_0x258bdf);if(_0x53f5bd['ok'])return _0x4673a7['stream']?await this['_readStreamableResponse'](_0x53f5bd,_0x459fd7):await this['_readStaticResponse'](_0x53f5bd,_0x459fd7),Promise['resolve']();{const _0x10d3f6=await _0x53f5bd['text']();return _0x10d3f6['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x2110a7,'AI_ERROR_CONTEXT_LENGTH'))):_0x10d3f6['includes']('Moderation')?Promise['reject'](new R(i(_0x2110a7,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x10d3f6));}}async['prepareMessages'](_0x7da422,_0x49bece,_0x5a7f69){let _0xa76b30,_0x283cf6;return _0x49bece?(_0xa76b30='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.',_0x283cf6='Instruction:\x0a'+_0x7da422+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x49bece):(_0xa76b30='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.',_0x283cf6=_0x7da422),[{'role':'system','content':_0xa76b30},{'role':'user','content':_0x283cf6}];}async['_readStreamableResponse'](_0x52fa81,_0x58b693){const _0x22a5d7=_0x52fa81['body']['getReader'](),_0x239380=new TextDecoder();let _0x3d0915='',_0x3a7d36='',_0xf72eb4='',_0x5a7fa5=!0x1;for(;!_0x5a7fa5;){const {done:_0x5b3144,value:_0x3837b4}=await _0x22a5d7['read'](),_0x68e70d=_0x3d0915+_0x239380['decode'](_0x3837b4);let _0x36c146='';_0x5a7fa5=_0x5b3144;try{_0x36c146=this['_cleanUpData'](_0x68e70d),_0x3d0915='';}catch(_0x3fcf12){_0x3d0915=_0x68e70d;continue;}_0x3a7d36+=_0x36c146,!_0x5a7fa5&&this['_isBufferIncomplete'](_0x3a7d36)||_0x3a7d36&&(_0xf72eb4+=_0x3a7d36,_0x3a7d36='',_0x58b693(_0xf72eb4));}return Promise['resolve']();}async['_readStaticResponse'](_0x4bbe7e,_0x34aa45){return _0x34aa45((await _0x4bbe7e['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x5098f9){const _0x5460e7=_0x5098f9['split']('<')['length']!==_0x5098f9['split']('>')['length'],_0x1687df=_0x5098f9['length']<0x1e;return _0x5460e7&&_0x1687df;}['_cleanUpData'](_0x1654d2){return _0x1654d2['split'](/\n(?![^{]*\})/g)['map'](_0x554edf=>_0x554edf['replace']('data:\x20',''))['filter'](_0x1071eb=>_0x1071eb&&_0x1071eb['length']>0x0&&'[DONE]'!==_0x1071eb)['map'](_0x306697=>{const {choices:_0x5c85f3}=JSON['parse'](_0x306697);if(_0x5c85f3[0x0]&&_0x5c85f3[0x0]['delta']&&_0x5c85f3[0x0]['delta']['content'])return _0x5c85f3[0x0]['delta']['content'];})['filter'](_0x3197f6=>_0x3197f6)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x4e5997){super(_0x4e5997),_0x4e5997['config']['get']('ai.aws.requestParameters')||_0x4e5997['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']=_0x4e5997['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x4e5997['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x4e5997['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x4e5997['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x46071a,context:_0x9dd8af,onData:_0x5f4a7c,actionId:_0x2575b3}){const {model:_0x264753,stream:_0x315119,..._0xc3c46a}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2575b3),_0x4e1b57={'prompt':await this['preparePrompt'](_0x46071a,_0x9dd8af,_0x264753,_0x2575b3),..._0xc3c46a};this['_apiUrl']?await this['_processProxyRequest'](_0x4e1b57,_0x264753,_0x315119,_0x5f4a7c,_0x2575b3):await this['_processAWSRequest'](_0x4e1b57,_0x264753,_0x315119,_0x5f4a7c);}async['preparePrompt'](_0x42c269,_0x5b95ab,_0x1d661c,_0x572cc1){let _0x2303ea,_0xc7c4a1;return _0x5b95ab?(_0x2303ea='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.',_0xc7c4a1='Instruction:\x0a'+_0x42c269+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5b95ab):(_0x2303ea='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.',_0xc7c4a1=_0x42c269),'meta.llama'==this['getModelFamily'](_0x1d661c)?'<<SYS>>\x0a'+_0x2303ea+'\x0a<</SYS>>\x0a[INST]\x0a'+_0xc7c4a1+'\x0a[/INST]':'Human:\x0a'+_0x2303ea+'\x0a'+_0xc7c4a1+'\x0a\x0aAssistant:';}['getModelFamily'](_0x327583){if(/^anthropic\.claude/['test'](_0x327583))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x327583))return'ai21.j2';if(/^cohere\.command/['test'](_0x327583))return'cohere.command';if(/^meta\.llama/['test'](_0x327583))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x327583));}async['_processProxyRequest'](_0x1c6463,_0x14cbde,_0x34b4ae,_0xaaa7d9,_0x6b696b){const _0x5d7a14={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x6b696b),'body':JSON['stringify']({..._0x1c6463,'model':_0x14cbde,'stream':_0x34b4ae}),'signal':this['abortController']['signal']},_0x216739=await fetch(this['_apiUrl'],_0x5d7a14);_0x34b4ae?await this['_readStreamableResponse'](_0x216739,_0x14cbde,_0xaaa7d9):await this['_readStaticResponse'](_0x216739,_0x14cbde,_0xaaa7d9);}async['_processAWSRequest'](_0x18526f,_0x496c8a,_0x43dbbb,_0x4feadc){const _0x1e646b=new _0x2f74e3(this['_bedrockClientConfig']),_0xb28a1b={'body':JSON['stringify'](_0x18526f),'contentType':'application/json','accept':'application/json','modelId':_0x496c8a};let _0x2a792a;if(_0x43dbbb){const _0x191c4c=new _0x1dfcbf(_0xb28a1b);_0x2a792a=await _0x1e646b['send'](_0x191c4c,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x2a792a,_0x496c8a,_0x4feadc);}else{const _0x277c81=new _0x5ef9b9(_0xb28a1b);_0x2a792a=await _0x1e646b['send'](_0x277c81,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x2a792a,_0x496c8a,_0x4feadc);}}async['_readAsyncIterableResponse'](_0x897996,_0x2a6aea,_0x3c6dd1){const _0x52cbba=_0x897996['body'],_0x4cfe99=new TextDecoder('utf-8');let _0x2cec0e='';for await(const _0x3ed468 of _0x52cbba)if(_0x3ed468['chunk']){const _0x3f3910=_0x4cfe99['decode'](_0x3ed468['chunk']['bytes']),_0x538198=JSON['parse'](_0x3f3910);_0x2cec0e+=this['_getGeneratedText'](_0x538198,_0x2a6aea),_0x3c6dd1(_0x2cec0e);}return Promise['resolve']();}async['_readStreamableResponse'](_0x5280fb,_0x421be7,_0x30f6a0){const _0x140058=_0x5280fb['body'],_0x5bd3f7=new TextDecoder('utf-8'),_0xf90102=_0x140058['getReader']();let _0x46ba0d='',_0x2773b2='',_0x44d868=!0x1;for(;!_0x44d868;){const {done:_0x5197dc,value:_0x822a19}=await _0xf90102['read']();if(_0x44d868=_0x5197dc,_0x44d868)break;const _0x55e24c=(_0x46ba0d+_0x5bd3f7['decode'](_0x822a19))['split']('\x0a')['map'](_0x48d743=>{try{return _0x46ba0d='',JSON['parse'](_0x48d743);}catch(_0xa4dbbf){return _0x46ba0d=_0x48d743,null;}})['filter'](_0x453515=>null!==_0x453515);_0x55e24c['length']&&(_0x2773b2+=_0x55e24c['map'](_0x235963=>this['_getGeneratedText'](_0x235963,_0x421be7))['join'](''),_0x30f6a0(_0x2773b2));}return Promise['resolve']();}async['_readStaticResponse'](_0x5ce2fd,_0x4f4f6c,_0x3bd7eb){let _0x4b08af;return _0x4b08af=_0x5ce2fd instanceof Response?await _0x5ce2fd['json']():JSON['parse'](Buffer['from'](_0x5ce2fd['body'])['toString']('utf8')),(_0x3bd7eb(this['_getGeneratedText'](_0x4b08af,_0x4f4f6c)),Promise['resolve']());}['_getGeneratedText'](_0x4c4354,_0x3000eb){switch(this['getModelFamily'](_0x3000eb)){case'anthropic.claude':return _0x4c4354['completion'];case'ai21.j2':return _0x4c4354['completions'][0x0]['data']['text'];case'cohere.command':return _0x4c4354['generations'][0x0]['text'];case'meta.llama':return _0x4c4354['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-ai",
3
- "version": "44.2.0-alpha.4",
3
+ "version": "44.2.0-alpha.6",
4
4
  "description": "AI Assistant feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -24,14 +24,14 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "@aws-sdk/client-bedrock-runtime": "3.621.0",
27
- "@ckeditor/ckeditor5-clipboard": "44.2.0-alpha.4",
28
- "@ckeditor/ckeditor5-core": "44.2.0-alpha.4",
29
- "@ckeditor/ckeditor5-engine": "44.2.0-alpha.4",
30
- "@ckeditor/ckeditor5-table": "44.2.0-alpha.4",
31
- "@ckeditor/ckeditor5-ui": "44.2.0-alpha.4",
32
- "@ckeditor/ckeditor5-utils": "44.2.0-alpha.4",
33
- "ckeditor5": "44.2.0-alpha.4",
34
- "ckeditor5-collaboration": "44.2.0-alpha.4",
27
+ "@ckeditor/ckeditor5-clipboard": "44.2.0-alpha.6",
28
+ "@ckeditor/ckeditor5-core": "44.2.0-alpha.6",
29
+ "@ckeditor/ckeditor5-engine": "44.2.0-alpha.6",
30
+ "@ckeditor/ckeditor5-table": "44.2.0-alpha.6",
31
+ "@ckeditor/ckeditor5-ui": "44.2.0-alpha.6",
32
+ "@ckeditor/ckeditor5-utils": "44.2.0-alpha.6",
33
+ "ckeditor5": "44.2.0-alpha.6",
34
+ "ckeditor5-collaboration": "44.2.0-alpha.6",
35
35
  "lodash-es": "4.17.21"
36
36
  },
37
37
  "type": "module",