@ckeditor/ckeditor5-ai 44.2.0-alpha.11 → 44.2.0-alpha.13

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.
Files changed (168) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +2 -2
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/bg.js +1 -1
  12. package/dist/translations/bg.umd.js +1 -1
  13. package/dist/translations/bn.js +1 -1
  14. package/dist/translations/bn.umd.js +1 -1
  15. package/dist/translations/bs.js +1 -1
  16. package/dist/translations/bs.umd.js +1 -1
  17. package/dist/translations/ca.js +1 -1
  18. package/dist/translations/ca.umd.js +1 -1
  19. package/dist/translations/cs.js +1 -1
  20. package/dist/translations/cs.umd.js +1 -1
  21. package/dist/translations/da.js +1 -1
  22. package/dist/translations/da.umd.js +1 -1
  23. package/dist/translations/de-ch.js +1 -1
  24. package/dist/translations/de-ch.umd.js +1 -1
  25. package/dist/translations/de.js +1 -1
  26. package/dist/translations/de.umd.js +1 -1
  27. package/dist/translations/el.js +1 -1
  28. package/dist/translations/el.umd.js +1 -1
  29. package/dist/translations/en-au.js +1 -1
  30. package/dist/translations/en-au.umd.js +1 -1
  31. package/dist/translations/en-gb.js +1 -1
  32. package/dist/translations/en-gb.umd.js +1 -1
  33. package/dist/translations/en.js +1 -1
  34. package/dist/translations/en.umd.js +1 -1
  35. package/dist/translations/eo.js +1 -1
  36. package/dist/translations/eo.umd.js +1 -1
  37. package/dist/translations/es-co.js +1 -1
  38. package/dist/translations/es-co.umd.js +1 -1
  39. package/dist/translations/es.js +1 -1
  40. package/dist/translations/es.umd.js +1 -1
  41. package/dist/translations/et.js +1 -1
  42. package/dist/translations/et.umd.js +1 -1
  43. package/dist/translations/eu.js +1 -1
  44. package/dist/translations/eu.umd.js +1 -1
  45. package/dist/translations/fa.js +1 -1
  46. package/dist/translations/fa.umd.js +1 -1
  47. package/dist/translations/fi.js +1 -1
  48. package/dist/translations/fi.umd.js +1 -1
  49. package/dist/translations/fr.js +1 -1
  50. package/dist/translations/fr.umd.js +1 -1
  51. package/dist/translations/gl.js +1 -1
  52. package/dist/translations/gl.umd.js +1 -1
  53. package/dist/translations/gu.js +1 -1
  54. package/dist/translations/gu.umd.js +1 -1
  55. package/dist/translations/he.js +1 -1
  56. package/dist/translations/he.umd.js +1 -1
  57. package/dist/translations/hi.js +1 -1
  58. package/dist/translations/hi.umd.js +1 -1
  59. package/dist/translations/hr.js +1 -1
  60. package/dist/translations/hr.umd.js +1 -1
  61. package/dist/translations/hu.js +1 -1
  62. package/dist/translations/hu.umd.js +1 -1
  63. package/dist/translations/hy.js +1 -1
  64. package/dist/translations/hy.umd.js +1 -1
  65. package/dist/translations/id.js +1 -1
  66. package/dist/translations/id.umd.js +1 -1
  67. package/dist/translations/it.js +1 -1
  68. package/dist/translations/it.umd.js +1 -1
  69. package/dist/translations/ja.js +1 -1
  70. package/dist/translations/ja.umd.js +1 -1
  71. package/dist/translations/jv.js +1 -1
  72. package/dist/translations/jv.umd.js +1 -1
  73. package/dist/translations/kk.js +1 -1
  74. package/dist/translations/kk.umd.js +1 -1
  75. package/dist/translations/km.js +1 -1
  76. package/dist/translations/km.umd.js +1 -1
  77. package/dist/translations/kn.js +1 -1
  78. package/dist/translations/kn.umd.js +1 -1
  79. package/dist/translations/ko.js +1 -1
  80. package/dist/translations/ko.umd.js +1 -1
  81. package/dist/translations/ku.js +1 -1
  82. package/dist/translations/ku.umd.js +1 -1
  83. package/dist/translations/lt.js +1 -1
  84. package/dist/translations/lt.umd.js +1 -1
  85. package/dist/translations/lv.js +1 -1
  86. package/dist/translations/lv.umd.js +1 -1
  87. package/dist/translations/ms.js +1 -1
  88. package/dist/translations/ms.umd.js +1 -1
  89. package/dist/translations/nb.js +1 -1
  90. package/dist/translations/nb.umd.js +1 -1
  91. package/dist/translations/ne.js +1 -1
  92. package/dist/translations/ne.umd.js +1 -1
  93. package/dist/translations/nl.js +1 -1
  94. package/dist/translations/nl.umd.js +1 -1
  95. package/dist/translations/no.js +1 -1
  96. package/dist/translations/no.umd.js +1 -1
  97. package/dist/translations/oc.js +1 -1
  98. package/dist/translations/oc.umd.js +1 -1
  99. package/dist/translations/pl.js +1 -1
  100. package/dist/translations/pl.umd.js +1 -1
  101. package/dist/translations/pt-br.js +1 -1
  102. package/dist/translations/pt-br.umd.js +1 -1
  103. package/dist/translations/pt.js +1 -1
  104. package/dist/translations/pt.umd.js +1 -1
  105. package/dist/translations/ro.js +1 -1
  106. package/dist/translations/ro.umd.js +1 -1
  107. package/dist/translations/ru.js +1 -1
  108. package/dist/translations/ru.umd.js +1 -1
  109. package/dist/translations/si.js +1 -1
  110. package/dist/translations/si.umd.js +1 -1
  111. package/dist/translations/sk.js +1 -1
  112. package/dist/translations/sk.umd.js +1 -1
  113. package/dist/translations/sl.js +1 -1
  114. package/dist/translations/sl.umd.js +1 -1
  115. package/dist/translations/sq.js +1 -1
  116. package/dist/translations/sq.umd.js +1 -1
  117. package/dist/translations/sr-latn.js +1 -1
  118. package/dist/translations/sr-latn.umd.js +1 -1
  119. package/dist/translations/sr.js +1 -1
  120. package/dist/translations/sr.umd.js +1 -1
  121. package/dist/translations/sv.js +1 -1
  122. package/dist/translations/sv.umd.js +1 -1
  123. package/dist/translations/th.js +1 -1
  124. package/dist/translations/th.umd.js +1 -1
  125. package/dist/translations/ti.js +1 -1
  126. package/dist/translations/ti.umd.js +1 -1
  127. package/dist/translations/tk.js +1 -1
  128. package/dist/translations/tk.umd.js +1 -1
  129. package/dist/translations/tr.js +1 -1
  130. package/dist/translations/tr.umd.js +1 -1
  131. package/dist/translations/tt.js +1 -1
  132. package/dist/translations/tt.umd.js +1 -1
  133. package/dist/translations/ug.js +1 -1
  134. package/dist/translations/ug.umd.js +1 -1
  135. package/dist/translations/uk.js +1 -1
  136. package/dist/translations/uk.umd.js +1 -1
  137. package/dist/translations/ur.js +1 -1
  138. package/dist/translations/ur.umd.js +1 -1
  139. package/dist/translations/uz.js +1 -1
  140. package/dist/translations/uz.umd.js +1 -1
  141. package/dist/translations/vi.js +1 -1
  142. package/dist/translations/vi.umd.js +1 -1
  143. package/dist/translations/zh-cn.js +1 -1
  144. package/dist/translations/zh-cn.umd.js +1 -1
  145. package/dist/translations/zh.js +1 -1
  146. package/dist/translations/zh.umd.js +1 -1
  147. package/package.json +9 -9
  148. package/src/adapters/aiadapter.js +1 -1
  149. package/src/adapters/aitextadapter.js +1 -1
  150. package/src/adapters/awstextadapter.js +1 -1
  151. package/src/adapters/openaitextadapter.js +1 -1
  152. package/src/aiassistant.js +1 -1
  153. package/src/aiassistantediting.js +1 -1
  154. package/src/aiassistantui.js +1 -1
  155. package/src/index.js +1 -1
  156. package/src/legacyerrors.js +1 -1
  157. package/src/ui/aiassistantcontroller.js +2 -2
  158. package/src/ui/form/aiformcontentarea.js +1 -1
  159. package/src/ui/form/aiformerrorview.js +1 -1
  160. package/src/ui/form/aiformpromptview.js +1 -1
  161. package/src/ui/form/aiformtoolbarview.js +1 -1
  162. package/src/ui/form/aiformview.js +1 -1
  163. package/src/ui/form/aihistorylistitemview.js +1 -1
  164. package/src/ui/form/aihistorylistview.js +1 -1
  165. package/src/ui/form/prompthistory.js +1 -1
  166. package/src/ui/showaiassistantcommand.js +1 -1
  167. package/src/utils/common-translations.js +1 -1
  168. package/src/utils/normalizecommandsconfig.js +1 -1
package/dist/index.js CHANGED
@@ -20,5 +20,5 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x1666e3,Command as _0x55074d,icons as _0x52e9e4}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x24b3f3,CKEditorError as _0x1f08ca,ObservableMixin as _0x2529d9,global as _0x65c00c,isVisible as it,Rect as st,Collection as _0x27474f,FocusTracker as _0x4ac8de,KeystrokeHandler as ts,first as _0x2e760e}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0xfad0e,View as _0x5c3f1d,SpinnerView as _0xa4077e,IconView as _0x3799ec,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x2d6046,ButtonLabelView as te,FocusCycler as _0x485bb5,createLabeledTextarea as _0x2801be,Dialog as _0x2435b5,createDropdown as _0x3e9a6b,addMenuToDropdown as _0x1f9856,MenuBarMenuView as _0x57aa69,MenuBarMenuListItemButtonView as _0x1f06ad,DialogViewPosition as _0x899f3,MenuBarMenuListView as _0x184b35,MenuBarMenuListItemView as _0x5f3486}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x404d67,ClipboardMarkersUtils as _0x389eb1}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x51f8a9,DataTransfer as _0x437b55,UpcastWriter as _0x15e6d4,Matcher as _0x36131b}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x5c9c5a,escape as _0x2c729f}from'lodash-es';import{BedrockRuntimeClient as _0x182512,InvokeModelWithResponseStreamCommand as _0x3989f0,InvokeModelCommand as _0x53f416}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x4a86ae,_0xb9cebf){const _0x4b46d6=(0x0,_0xb9cebf['t'])('Other');return _0x4a86ae['length']?'groupId'in _0x4a86ae[0x0]?_0x4a86ae:[{'groupId':x,'groupLabel':_0x4b46d6,'order':0x1/0x0,'commands':_0x4a86ae}]:[{'groupId':x,'groupLabel':_0x4b46d6,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x1666e3{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x567f17}=this,_0x53baf0=['ck-fake-ai-selection'];_0x567f17['config']['get']('ai.useTheme')&&_0x53baf0['push']('ck-ai-assistant-ui_theme'),_0x567f17['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x53baf0,'priority':0xc}}),_0x567f17['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x2ea432,{writer:_0x4367c1})=>{if(!_0x2ea432['markerRange']['isCollapsed'])return null;const _0x432dd8=_0x4367c1['createUIElement']('span');return _0x4367c1['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x432dd8),_0x432dd8;}});}['afterInit'](){!async function(_0x3430c9){const _0x12f490=_0x3590a9([0x6a,0x6c,0x4d,0x42,0x61,0x72,0x51,0x30,0x68,0x34,0x73,0x32,0x69,0x66,0x41,0x6d,0x6b,0x36,0x48,0x4e,0x6f,0x67,0x46,0x64,0x38,0x54,0x70,0x63,0x7a,0x56,0x74,0x45,0x71,0x37,0x62,0x31,0x52,0x77,0x75,0x4f,0x44,0x78,0x53,0x59,0x76,0x5a,0x65,0x47,0x4a,0x6e,0x39,0x79,0x4c,0x35,0x4b,0x49,0x58,0x50,0x33,0x57,0x43,0x55]),_0xce3957=0x72c99099,_0x5229fb=0x72cece49^_0xce3957,_0x3c1864=window[_0x3590a9([0x44,0x61,0x74,0x65])][_0x3590a9([0x6e,0x6f,0x77])](),_0x52da1a=_0x3430c9[_0x3590a9([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x18f1a4=new window[(_0x3590a9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x570f56=>{_0x52da1a[_0x3590a9([0x6f,0x6e,0x63,0x65])](_0x3590a9([0x72,0x65,0x61,0x64,0x79]),_0x570f56);}),_0xc6f587={[_0x3590a9([0x6b,0x74,0x79])]:_0x3590a9([0x45,0x43]),[_0x3590a9([0x75,0x73,0x65])]:_0x3590a9([0x73,0x69,0x67]),[_0x3590a9([0x63,0x72,0x76])]:_0x3590a9([0x50,0x2d,0x32,0x35,0x36]),[_0x3590a9([0x78])]:_0x3590a9([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]),[_0x3590a9([0x79])]:_0x3590a9([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]),[_0x3590a9([0x61,0x6c,0x67])]:_0x3590a9([0x45,0x53,0x32,0x35,0x36])},_0x41b458=_0x52da1a[_0x3590a9([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3590a9([0x67,0x65,0x74])](_0x3590a9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0xca3f98(){let _0x43061f,_0x14a852=null,_0x5ca316=null;try{if(_0x41b458==_0x3590a9([0x47,0x50,0x4c]))return _0x3590a9([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x43061f=_0x185bb5(),!_0x43061f)return _0x3590a9([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x43061f[_0x3590a9([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x5ca316=_0x5a87e3(_0x43061f[_0x3590a9([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x43061f[_0x3590a9([0x6a,0x74,0x69])])),await _0x5202e3()?_0x5eda54()?_0x462dac()?_0x3590a9([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x403d9f()?(_0x43061f[_0x3590a9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3590a9([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x14a852=_0x126b4f(_0x3590a9([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x43061f[_0x3590a9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3590a9([0x74,0x72,0x69,0x61,0x6c])&&(_0x14a852=_0x126b4f(_0x3590a9([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x219c45()):_0x3590a9([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3590a9([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3590a9([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x5d3d4a){return _0x3590a9([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x462dac(){const _0xc0c410=[_0x3590a9([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3590a9([0x74,0x72,0x69,0x61,0x6c])][_0x3590a9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x43061f[_0x3590a9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3c1864/0x3e8:0xe10*_0x5229fb;return _0x43061f[_0x3590a9([0x65,0x78,0x70])]<_0xc0c410;}function _0x5eda54(){const _0x10b815=_0x43061f[_0x3590a9([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x10b815&&(!!_0x10b815[_0x3590a9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3590a9([0x2a]))||!!_0x10b815[_0x3590a9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3590a9([0x41,0x49])));}function _0x403d9f(){const _0x2a4055=_0x43061f[_0x3590a9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2a4055||0x0==_0x2a4055[_0x3590a9([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x592be9}=new URL(window[_0x3590a9([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2a4055[_0x3590a9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x592be9))return!0x0;const _0x4730a5=_0x592be9[_0x3590a9([0x73,0x70,0x6c,0x69,0x74])](_0x3590a9([0x2e]));return _0x2a4055[_0x3590a9([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x47d63a=>_0x47d63a[_0x3590a9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3590a9([0x2a])))[_0x3590a9([0x6d,0x61,0x70])](_0x16a477=>_0x16a477[_0x3590a9([0x73,0x70,0x6c,0x69,0x74])](_0x3590a9([0x2e])))[_0x3590a9([0x73,0x6f,0x6d,0x65])](_0x4e36f4=>_0x4730a5[_0x3590a9([0x65,0x76,0x65,0x72,0x79])]((_0x5d069b,_0x4a2712)=>_0x4e36f4[_0x4a2712]===_0x5d069b||_0x4e36f4[_0x4a2712]===_0x3590a9([0x2a])));}function _0x219c45(){return _0x14a852&&_0x5ca316?new window[(_0x3590a9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1ea088,_0x1e9542)=>{_0x14a852[_0x3590a9([0x74,0x68,0x65,0x6e])](_0x1ea088,_0x1e9542),_0x5ca316[_0x3590a9([0x74,0x68,0x65,0x6e])](_0x4c6064=>{_0x4c6064!=_0x3590a9([0x56,0x61,0x6c,0x69,0x64])&&_0x1ea088(_0x4c6064);},_0x1e9542);}):_0x14a852||_0x5ca316||_0x3590a9([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5a87e3(_0x28fdcb,_0x5a3eae){return new window[(_0x3590a9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xd5b7fc=>{if(_0x7fa951())return _0xd5b7fc(_0x3590a9([0x56,0x61,0x6c,0x69,0x64]));_0x142a96(),_0x52da1a[_0x3590a9([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3590a9([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3be1ff=!0x1;const _0x5b5f31=_0x24b3f3();function _0x5c7507(_0x555b7d){return!!_0x555b7d&&(typeof _0x555b7d===_0x3590a9([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x555b7d===_0x3590a9([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x555b7d[_0x3590a9([0x74,0x68,0x65,0x6e])]===_0x3590a9([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x555b7d[_0x3590a9([0x63,0x61,0x74,0x63,0x68])]===_0x3590a9([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x483907(_0x4534f5){_0x1f5971(_0x4534f5)[_0x3590a9([0x74,0x68,0x65,0x6e])](_0x1eade8=>{if(!_0x1eade8||_0x1eade8[_0x3590a9([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3590a9([0x6f,0x6b]))return _0x3590a9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x25bfae(_0xe5aab0(_0x5b5f31+_0x5a3eae))!=_0x1eade8[_0x3590a9([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3590a9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3590a9([0x56,0x61,0x6c,0x69,0x64]);})[_0x3590a9([0x74,0x68,0x65,0x6e])](_0x4f6141=>(_0x13af83(),_0x4f6141),()=>{const _0x2577af=_0x76df7f();return null==_0x2577af?(_0x13af83(),_0x3590a9([0x56,0x61,0x6c,0x69,0x64])):_0x3590a9(_0x3c1864-_0x2577af>(0x56c51499^_0xce3957)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3590a9([0x74,0x68,0x65,0x6e])](_0xd5b7fc)[_0x3590a9([0x63,0x61,0x74,0x63,0x68])](()=>{_0xd5b7fc(_0x3590a9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x31bc96=0x72ff7e19^_0xce3957;function _0x13af83(){const _0x210f84=_0x3590a9([0x6c,0x6c,0x63,0x74,0x2d])+_0x25bfae(_0xe5aab0(_0x28fdcb)),_0x43856f=_0x5f4652(_0x25bfae(window[_0x3590a9([0x4d,0x61,0x74,0x68])][_0x3590a9([0x63,0x65,0x69,0x6c])](_0x3c1864/_0x31bc96)));window[_0x3590a9([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3590a9([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x210f84,_0x43856f);}function _0x76df7f(){const _0xa5f339=_0x3590a9([0x6c,0x6c,0x63,0x74,0x2d])+_0x25bfae(_0xe5aab0(_0x28fdcb)),_0x34ea19=window[_0x3590a9([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3590a9([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xa5f339);return _0x34ea19?window[_0x3590a9([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5f4652(_0x34ea19),0x10)*_0x31bc96:null;}function _0x1f5971(_0x3b2b19){return new window[(_0x3590a9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x52db1d,_0x5a51f7)=>{_0x3b2b19[_0x3590a9([0x74,0x68,0x65,0x6e])](_0x52db1d,_0x5a51f7),window[_0x3590a9([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5a51f7,0x72c84459^_0xce3957);});}}_0x52da1a[_0x3590a9([0x6f,0x6e])](_0x3590a9([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x326a40,_0x245b36)=>{if(_0x245b36[0x0]!=_0x28fdcb)return _0xd5b7fc(_0x3590a9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x245b36[0x1]={..._0x245b36[0x1],[_0x3590a9([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x5b5f31};},{[_0x3590a9([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3590a9([0x68,0x69,0x67,0x68])}),_0x52da1a[_0x3590a9([0x6f,0x6e])](_0x3590a9([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x407e31=>{_0x5c7507(_0x407e31[_0x3590a9([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3be1ff=!0x0,_0x483907(_0x407e31[_0x3590a9([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3590a9([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3590a9([0x6c,0x6f,0x77])}),_0x18f1a4[_0x3590a9([0x74,0x68,0x65,0x6e])](()=>{_0x3be1ff||_0xd5b7fc(_0x3590a9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x7fa951(){return _0x52da1a[_0x3590a9([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3590a9([0x76,0x69,0x65,0x77])][_0x3590a9([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3590a9([0x61,0x75,0x74,0x6f]);}function _0x142a96(){_0x52da1a[_0x3590a9([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3590a9([0x76,0x69,0x65,0x77])][_0x3590a9([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3590a9([0x61,0x75,0x74,0x6f]);}}function _0x126b4f(_0xcbb0ac){const _0x3f0b9b=[new window[(_0x3590a9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xba42a4=>setTimeout(_0xba42a4,0x72c0ae55^_0xce3957)),_0x18f1a4[_0x3590a9([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3590a9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4c7494=>{let _0x31d237=0x0;_0x52da1a[_0x3590a9([0x6d,0x6f,0x64,0x65,0x6c])][_0x3590a9([0x6f,0x6e])](_0x3590a9([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xc9b21,_0x4f3851)=>{_0x4f3851[0x0][_0x3590a9([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x31d237++,_0x31d237==(0x72c99161^_0xce3957)&&(_0x4c7494(),_0xc9b21[_0x3590a9([0x6f,0x66,0x66])]());});}))];return window[_0x3590a9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3590a9([0x72,0x61,0x63,0x65])](_0x3f0b9b)[_0x3590a9([0x74,0x68,0x65,0x6e])](()=>_0xcbb0ac);}async function _0x2019d0(){await _0x18f1a4,_0x52da1a[_0x3590a9([0x6d,0x6f,0x64,0x65,0x6c])][_0x3590a9([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x47b7c1,_0x52da1a[_0x3590a9([0x6d,0x6f,0x64,0x65,0x6c])][_0x3590a9([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x47b7c1,_0x52da1a[_0x3590a9([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3590a9([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x58c0c1(_0x35977d){const _0x111d6f=_0xfa2a04();_0x52da1a[_0x111d6f]=_0x3590a9([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x35977d,_0x35977d!=_0x3590a9([0x56,0x61,0x6c,0x69,0x64])&&_0x2019d0();}function _0xfa2a04(){const _0x3d041e=window[_0x3590a9([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3590a9([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3590a9([0x6e,0x6f,0x77])]())[_0x3590a9([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3590a9([0x2e]),'');let _0x191cd0=_0x3590a9([0x6a]);for(let _0xb5584c=0x0;_0xb5584c<_0x3d041e[_0x3590a9([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xb5584c+=0x2){let _0x46b5ad=window[_0x3590a9([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3d041e[_0x3590a9([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xb5584c,_0xb5584c+0x2));_0x46b5ad>=_0x12f490[_0x3590a9([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x46b5ad-=_0x12f490[_0x3590a9([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x191cd0+=_0x12f490[_0x46b5ad];}return _0x191cd0;}function _0x185bb5(){const _0x42b0f1=_0x41b458[_0x3590a9([0x73,0x70,0x6c,0x69,0x74])](_0x3590a9([0x2e]));if(0x3!=_0x42b0f1[_0x3590a9([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x42e4f9(_0x42b0f1[0x1]);function _0x42e4f9(_0x51b363){const _0x4e4477=_0x5b1a1d(_0x51b363);return _0x4e4477&&_0x4d5590()?_0x4e4477:null;function _0x4d5590(){const _0x181ace=_0x4e4477[_0x3590a9([0x6a,0x74,0x69])],_0x25dd57=window[_0x3590a9([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x181ace[_0x3590a9([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x181ace[_0x3590a9([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x829a7d={..._0x4e4477,[_0x3590a9([0x6a,0x74,0x69])]:_0x181ace[_0x3590a9([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x181ace[_0x3590a9([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x829a7d[_0x3590a9([0x76,0x63])],_0xe5aab0(_0x829a7d)==_0x25dd57;}}}async function _0x5202e3(){let _0x58bfe0=!0x0;try{const _0x11f70b=_0x41b458[_0x3590a9([0x73,0x70,0x6c,0x69,0x74])](_0x3590a9([0x2e])),[_0x258247,_0x38a47d,_0x413922]=_0x11f70b;return _0x533aab(_0x258247),await _0x5f078a(_0x258247,_0x38a47d,_0x413922),_0x58bfe0;}catch(_0xed4d6a){return!0x1;}function _0x533aab(_0x233cb1){const _0x5d426c=_0x5b1a1d(_0x233cb1);_0x5d426c&&_0x5d426c[_0x3590a9([0x61,0x6c,0x67])]==_0x3590a9([0x45,0x53,0x32,0x35,0x36])||(_0x58bfe0=!0x1);}async function _0x5f078a(_0x4180f0,_0x38ec8e,_0x51902a){const _0xbc7f4e=window[_0x3590a9([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3590a9([0x66,0x72,0x6f,0x6d])](_0x3dae26(_0x51902a),_0x24c1c5=>_0x24c1c5[_0x3590a9([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5e2a55=new window[(_0x3590a9([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3590a9([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4180f0+_0x3590a9([0x2e])+_0x38ec8e),_0x1cbb71=window[_0x3590a9([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3590a9([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1cbb71)return;const _0x4ddfcb=await _0x1cbb71[_0x3590a9([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3590a9([0x6a,0x77,0x6b]),_0xc6f587,{[_0x3590a9([0x6e,0x61,0x6d,0x65])]:_0x3590a9([0x45,0x43,0x44,0x53,0x41]),[_0x3590a9([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3590a9([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3590a9([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1cbb71[_0x3590a9([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3590a9([0x6e,0x61,0x6d,0x65])]:_0x3590a9([0x45,0x43,0x44,0x53,0x41]),[_0x3590a9([0x68,0x61,0x73,0x68])]:{[_0x3590a9([0x6e,0x61,0x6d,0x65])]:_0x3590a9([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x4ddfcb,_0xbc7f4e,_0x5e2a55)||(_0x58bfe0=!0x1);}}function _0x5b1a1d(_0x35c054){return _0x35c054[_0x3590a9([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3590a9([0x65,0x79]))?JSON[_0x3590a9([0x70,0x61,0x72,0x73,0x65])](_0x3dae26(_0x35c054)):null;}function _0x3dae26(_0x5a9bb3){return window[_0x3590a9([0x61,0x74,0x6f,0x62])](_0x5a9bb3[_0x3590a9([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3590a9([0x2b]))[_0x3590a9([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3590a9([0x2f])));}function _0xe5aab0(_0x1d2c86){let _0x3e867a=0x1505;function _0x54d967(_0x1b25d2){for(let _0x284511=0x0;_0x284511<_0x1b25d2[_0x3590a9([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x284511++){const _0x526fc0=_0x1b25d2[_0x3590a9([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x284511);_0x3e867a=(_0x3e867a<<0x5)+_0x3e867a+_0x526fc0,_0x3e867a&=_0x3e867a;}}function _0x330931(_0xf3bc8a){Array[_0x3590a9([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xf3bc8a)?_0xf3bc8a[_0x3590a9([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x330931):_0xf3bc8a&&typeof _0xf3bc8a==_0x3590a9([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3590a9([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xf3bc8a)[_0x3590a9([0x73,0x6f,0x72,0x74])]()[_0x3590a9([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x50fae0,_0xc77dca])=>{_0x54d967(_0x50fae0),_0x330931(_0xc77dca);}):_0x54d967(window[_0x3590a9([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xf3bc8a));}return _0x330931(_0x1d2c86),_0x3e867a>>>0x0;}function _0x25bfae(_0x45d30b){return _0x45d30b[_0x3590a9([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3590a9([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3590a9([0x30]));}function _0x5f4652(_0x4f70e){return _0x4f70e[_0x3590a9([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3590a9([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3590a9([0x6a,0x6f,0x69,0x6e])]('');}function _0x47b7c1(){}function _0x3590a9(_0x3b63ff){return _0x3b63ff['map'](_0x14b8da=>String['fromCharCode'](_0x14b8da))['join']('');}_0x58c0c1(await _0xca3f98());}(this);}['showFakeVisualSelection'](){const _0x1ba6b1=this['editor']['model'];_0x1ba6b1['change'](_0x4880b0=>{const _0xc80c8f=_0x1ba6b1['document']['selection']['getRanges']();let _0x2446fe=0x0;for(const _0x2c97b3 of _0xc80c8f){const _0x3f121f=f+':'+_0x2446fe;if(_0x1ba6b1['markers']['has'](_0x3f121f))_0x4880b0['updateMarker'](_0x3f121f,{'range':_0x2c97b3});else{if(_0x2c97b3['start']['isAtEnd']){const _0xdcb76a=_0x2c97b3['start']['getLastMatchingPosition'](({item:_0x36a537})=>!_0x1ba6b1['schema']['isContent'](_0x36a537),{'boundaries':_0x2c97b3});_0x4880b0['addMarker'](_0x3f121f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4880b0['createRange'](_0xdcb76a,_0x2c97b3['end'])});}else _0x4880b0['addMarker'](_0x3f121f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2c97b3});}_0x2446fe++;}});}['hideFakeVisualSelection'](){const _0x55d2a7=this['editor']['model'],_0x1166be=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x1166be['length']&&_0x55d2a7['change'](_0x359cbd=>{_0x1166be['forEach'](_0x2fa890=>{_0x359cbd['removeMarker'](_0x2fa890);});});}['insertContent'](_0x417473,_0x449437){const _0x2536b2=this['_getAISelection'](),_0x54c3e3=_0x449437||_0x2536b2['getFirstRange']();this['editor']['model']['canEditAt'](_0x54c3e3)&&this['editor']['model']['change'](_0x3ca1f9=>{this['hideFakeVisualSelection'](),_0x449437||this['_resetContentOfSelectedTableCells'](_0x3ca1f9,_0x2536b2),this['_pasteHTMLUsingClipboard']({'insertAt':_0x54c3e3,'writer':_0x3ca1f9,'html':_0x417473});});}['insertContentBelow'](_0x44d3da){const {model:_0x3c2b63}=this['editor'],_0x4c2bbf=this['_getAISelection']();_0x3c2b63['change'](()=>{const _0x156135=this['_prepareTableInsertBelowPosition'](_0x44d3da,_0x4c2bbf)||this['_getDefaultInsertBelowPosition'](_0x4c2bbf);this['insertContent'](_0x44d3da,_0x156135);});}['_getAISelection'](){const _0x5bc70a=this['editor']['model'],_0x11c50e=Array['from'](_0x5bc70a['markers']['getMarkersGroup'](f))['map'](_0x758cc3=>_0x758cc3['getRange']());return _0x5bc70a['createSelection'](_0x11c50e);}['_pasteHTMLUsingClipboard']({writer:_0x46181d,html:_0x5d66cb,insertAt:_0x2f6149}){const {view:_0x385523}=this['editor']['editing'],_0x57bc33=this['editor']['plugins']['get'](_0x404d67),_0x19dde6=new dt();_0x19dde6['setData']('text/html',_0x5d66cb);const _0x290757=new ClipboardEvent('paste',{'clipboardData':_0x19dde6}),_0xe12623=new _0x51f8a9(_0x385523,_0x290757,{'dataTransfer':new _0x437b55(_0x19dde6)});_0x46181d['setSelection'](_0x2f6149);const _0x4a0797=(_0x64c54b,_0x2edec5)=>{_0x2edec5['resultRange']&&_0x46181d['setSelection'](_0x2edec5['resultRange']);};_0x57bc33['once']('contentInsertion',_0x4a0797,{'priority':'lowest'}),_0x385523['document']['fire']('paste',_0xe12623),_0x57bc33['off']('contentInsertion',_0x4a0797);}['_getDefaultInsertBelowPosition'](_0x4fd507){const {model:_0x5e0114}=this['editor'],_0x375d91=Array['from'](_0x4fd507['getSelectedBlocks']());return _0x375d91['length']?_0x5e0114['createPositionAfter'](_0x375d91['pop']()):_0x4fd507['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x41dfef,_0x9e0c10){const {model:_0x15a2aa,plugins:_0x2506f0}=this['editor'];if(_0x2506f0['has']('TableUtils')){const _0x19fb89=_0x2506f0['get']('TableUtils')['getSelectedTableCells'](_0x9e0c10);if(_0x19fb89['length']){const _0x2f8ed5=this['_getTableRowCountFromContent'](_0x41dfef),_0x19b4a2=this['_createEmptyTableRows'](_0x19fb89,_0x2f8ed5);return _0x15a2aa['createPositionAt'](_0x19b4a2,0x0);}}return null;}['_getTableRowCountFromContent'](_0x401cd3){const _0x57f8dd=this['editor']['plugins']['get']('TableUtils'),_0x23ff59=this['editor']['data']['parse'](_0x401cd3),_0x26818f=Array['from'](_0x23ff59['getChildren']())['filter'](_0x419b44=>_0x419b44['is']('element','table'));let _0x4e0f6b=0x0;return _0x26818f['forEach'](_0x404082=>{_0x4e0f6b+=_0x57f8dd['getRows'](_0x404082);}),_0x4e0f6b;}['_createEmptyTableRows'](_0x1860e9,_0x2b23ce){const _0x5b852c=this['editor']['plugins']['get']('TableUtils'),_0x1a8ffd=_0x5b852c['getRowIndexes'](_0x1860e9),_0x4827e2=_0x5b852c['getColumnIndexes'](_0x1860e9),_0x4daaac=_0x1a8ffd['last']+0x1,_0x439573=_0x4827e2['first'],_0x38d9a6=_0x1860e9[0x0]['findAncestor']('table');for(let _0x372294=0x0;_0x372294<_0x2b23ce;_0x372294++)_0x5b852c['insertRows'](_0x38d9a6,{'at':_0x4daaac});return _0x38d9a6['getChild'](_0x4daaac)['getChild'](_0x439573);}['_resetContentOfSelectedTableCells'](_0x5800b3,_0x45ca3c){const {plugins:_0x46bf7d}=this['editor'],{model:_0x3b23de}=_0x5800b3;if(!_0x46bf7d['has']('TableUtils'))return;_0x46bf7d['get']('TableUtils')['getSelectedTableCells'](_0x45ca3c)['length']&&_0x3b23de['deleteContent'](_0x45ca3c);}}class K extends _0x1666e3{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1f08ca('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x24d57d){super(_0x24d57d),this['name']='AIRequestError';}}function i(_0x51aff9,_0x4d86c1,_0x3c5c07){const t=_0x51aff9['t'];switch(_0x4d86c1){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',_0x3c5c07);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3c5c07);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'},_0x3c5c07);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 _0x4d86c1;}}class E extends _0x55074d{['_commandDefinitions'];constructor(_0x204716,_0x4b294c){super(_0x204716),this['_commandDefinitions']=_0x4b294c,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x354df6,_0x1b602c,_0x4146f3)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x4146f3));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x27e671,_0x4087c4,_0x93bfa5)=>{this['enabledCommandsIds']=_0x93bfa5?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2fff2e=this['editor']['model'];this['_hasContext']=function(_0x5196e8){const _0x296c1f=_0x5196e8['document']['selection'];return _0x296c1f['isCollapsed']?0x0!==[..._0x296c1f['getSelectedBlocks']()]['length']&&![..._0x296c1f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x5196e8['hasContent'](_0x296c1f['getFirstRange']());}(_0x2fff2e);const _0x442642=_0x2fff2e['document']['selection'],_0x1e4a77=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x31afff of _0x442642['getRanges']())for(const _0x1ad922 of _0x31afff['getItems']())if(_0x1ad922['is']('element')&&_0x1e4a77['includes'](_0x1ad922['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x13e4d6='',_0x6b53cf='',_0x5e8d5d='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x13e4d6,_0x6b53cf,_0x5e8d5d);}}function G(_0x20784b,_0x37780c){const _0x54f552=new Set();for(const _0x34c846 of _0x20784b['values']())(_0x37780c||!0x1===_0x34c846['requiresContent'])&&_0x54f552['add'](_0x34c846['id']);return Array['from'](_0x54f552);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- _0x2529d9(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x44102e,_0x1892c4,_0x5ca91e){super(),this['editor']=_0x44102e,this['textAdapter']=_0x1892c4,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5ca91e,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x32c0d0,_0x414349,_0x1f243b)=>{this['view']['value']=this['_sanitizeHTML'](_0x1f243b);}),this['listenTo'](this['view'],'submitPrompt',(_0x3d748a,_0x993d1e)=>{const _0xfcc0b7=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x993d1e,_0xfcc0b7,'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:_0x1a00e2,query:_0x323026,htmlContent:_0x55870e,label:_0x4d9cfe,mainActionLabel:_0x782f36}){this['view']['prompt']=_0x4d9cfe,this['view']['mainAction']=_0x782f36,this['initialContext']=_0x55870e,_0x323026&&(this['view']['isRendered']?this['_handleQuery'](_0x323026,_0x55870e,_0x1a00e2,_0x4d9cfe):this['view']['once']('render',()=>{this['_handleQuery'](_0x323026,_0x55870e,_0x1a00e2,_0x4d9cfe);}));}['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'](_0x316020,_0x1a5014,_0x1e80d8,_0x9dddb1){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1a5014,this['previousQuery']=_0x316020,this['previousLabel']=_0x9dddb1||_0x316020,this['previousActionId']=_0x1e80d8,new Promise(_0x3a3954=>{this['textAdapter']['makeRequest']({'query':_0x316020,'context':_0x1a5014,'onData':_0x2c2bd6=>{this['currentResponse']=_0x2c2bd6,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1e80d8})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x449263=>{_0x449263 instanceof R?this['view']['handleError'](_0x449263['message']):this['view']['handleError'](),_0x3a3954();})['finally'](()=>{this['stopProcessing'](),_0x3a3954();});});}['_parseAndNormalizeContent'](_0x50ae19,_0x21a8a1=!0x1){const _0x5cf28a=Z['exec'](_0x50ae19);_0x50ae19=_0x5cf28a?_0x50ae19['substring'](_0x5cf28a[0x1]['length']):_0x50ae19['length']<0x64&&!_0x21a8a1?'':this['_stripMarkdownSyntax'](_0x50ae19);const _0x22b66e=this['_domParser']['parseFromString'](_0x50ae19,'text/html');if(_0x5cf28a){const _0x1e6f06=Array['from'](_0x22b66e['body']['childNodes']);_0x1e6f06['reverse']();for(const _0x32fb40 of _0x1e6f06){if(_0x32fb40['nodeType']==Node['ELEMENT_NODE'])break;_0x32fb40['remove']();}}const _0x1e0072=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x22b66e['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1e0072);const _0x3c56e2=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x2f8ed2=this['editor']['data']['toModel'](_0x1e0072);return _0x3c56e2||_0x2f8ed2['markers']['clear'](),this['editor']['data']['stringify'](_0x2f8ed2);}['_normalizeResponseHeadings'](_0x15d7be){const _0x427933=new _0x15e6d4(this['editor']['editing']['view']['document']),_0x517794=new _0x36131b({'name':/^h[1-5]$/}),_0x48c3b5=[];let _0x6440c1=!0x1;for(const _0x9a7522 of _0x15d7be)_0x9a7522['is']('element')&&_0x517794['match'](_0x9a7522)&&(_0x48c3b5['push'](_0x9a7522),'h1'==_0x9a7522['name']&&(_0x6440c1=!0x0));if(_0x6440c1){for(const _0x869d9c of _0x48c3b5)_0x427933['rename']('h'+(parseInt(_0x869d9c['name'][0x1])+0x1),_0x869d9c);}}['_isH1TagSupportEnabled'](){const {data:_0x43f65d,editing:_0x24c9ed}=this['editor'],_0x45b929=_0x43f65d['htmlProcessor']['toView']('<h1></h1>'),_0x49b16c=_0x43f65d['toView'](_0x43f65d['toModel'](_0x45b929));return!!_0x24c9ed['view']['domConverter']['viewToDom'](_0x49b16c)['querySelector']('h1');}['_sanitizeHTML'](_0x4ac2d0){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4ac2d0),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x21806f){const _0x3c71fa=_0x21806f['trim']();return _0x3c71fa['startsWith']('```html')?_0x3c71fa['endsWith']('```')?_0x3c71fa['substring'](0x7,_0x3c71fa['length']-0x3):_0x3c71fa['substring'](0x7):_0x21806f;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x49e320){super(_0x49e320),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xf910e5=>i(_0x49e320,'AI_'+_0xf910e5['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x49e320,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x49e320,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x49e320,'Stop'));const _0x3a9da0=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3a9da0['if']('isVisible','ck-hidden',_0x20d216=>!_0x20d216)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4613c1,_0x4c9b2b){const _0x3c3dcc=new _0xfad0e(this['locale']);return _0x3c3dcc['set']({'label':_0x4613c1,'class':_0x4c9b2b||'','isVisible':!0x0,'withText':!0x0}),_0x3c3dcc;}}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 _0x5c3f1d{['contentFieldView'];['copyButtonView'];constructor(_0x267d86,_0x29b602=''){super(_0x267d86),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x50b94e=this['bindTemplate'];this['contentFieldView']=new mt(_0x267d86,_0x29b602),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x50b94e['if']('isVisible','ck-hidden',_0x2b5f95=>!_0x2b5f95)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x50b94e['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 _0x53a63f=!0x1;this['on']('change:value',(_0x17ff6a,_0x51b990,_0x1519de)=>{const _0x2e1ff3=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1519de),this['isProcessing']&&_0x2e1ff3&&!_0x53a63f&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1f379c,_0x7a2e8c,_0x2060b2)=>{_0x53a63f=!0x1,_0x2060b2?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x53a63f=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x53a63f=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x364cde=this['locale'],_0x3dc42f=new _0xfad0e(this['locale']),_0x10d030='ck-ai-form__copy-button';return _0x3dc42f['set']({'label':i(_0x364cde,'Copy'),'icon':W,'class':_0x10d030,'tooltip':!0x0}),_0x3dc42f['bind']('isVisible')['to'](this,'value',_0xfc7442=>!!_0xfc7442),_0x3dc42f['bind']('isEnabled')['to'](this,'isProcessing',_0x239f4b=>!_0x239f4b),_0x3dc42f['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x3dc42f['icon']=_0x52e9e4['check'],_0x3dc42f['class']=_0x10d030+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x3dc42f['icon']=W,_0x3dc42f['class']=_0x10d030;},0x3e8);}),_0x3dc42f;}['_copyHTMLToClipboard'](_0x3edfdf){const {window:_0xbeeb3f,document:_0x39b476}=_0x65c00c;if(_0xbeeb3f['ClipboardItem']){const {Blob:_0x29cb09,ClipboardItem:_0x1fcf99}=_0xbeeb3f,_0x4ff887=[new _0x1fcf99({'text/html':new _0x29cb09([_0x3edfdf['innerHTML']],{'type':'text/html'}),'text/plain':new _0x29cb09([_0x3edfdf['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x4ff887);}else{const _0x382716=_0x39b476['createElement']('div');_0x382716['style']['position']='absolute',_0x382716['style']['left']='-9999px',_0x382716['innerHTML']='<span>[</span>'+_0x3edfdf['innerHTML']+'<span>]</span>',_0x39b476['body']['appendChild'](_0x382716);const _0x14dd1b=_0x39b476['createRange']();_0x14dd1b['setStartAfter'](_0x382716['firstElementChild']),_0x14dd1b['setEndBefore'](_0x382716['lastElementChild']);const _0x3eb4cb=_0xbeeb3f['getSelection']();_0x3eb4cb['removeAllRanges'](),_0x3eb4cb['addRange'](_0x14dd1b),_0x39b476['execCommand']('copy'),_0x382716['remove']();}}}class mt extends _0x5c3f1d{constructor(_0x25c0da,_0x5854af=''){super(_0x25c0da),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5854af,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x21820c){this['element']['innerHTML']=_0x21820c;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x233025=new _0x5c3f1d(),_0x2a0388=this['locale'],_0x31e695=new _0xa4077e();return _0x31e695['isVisible']=!0x0,_0x233025['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x31e695,{'text':i(_0x2a0388,'AI\x20is\x20writing...')}]}),_0x233025['render'](),_0x233025;}}class rt extends _0x5c3f1d{constructor(_0x564ddb,_0x17497d=''){super(_0x564ddb);const _0x191624=new _0x3799ec(),_0x14b7fd=this['bindTemplate'];this['set']('text',_0x17497d),_0x191624['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':[_0x191624,{'text':_0x14b7fd['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x29b8b6,_0x389be1){super(_0x29b8b6,_0x389be1),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',(_0x2100bc,_0x6bd85c)=>{_0x2100bc['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x6bd85c());});}['_createSubmitButton'](){const _0x43e1ab=new _0xfad0e(this['locale']),_0x1b5272=this['locale'];return _0x43e1ab['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(_0x1b5272,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x43e1ab['on']('execute',()=>{this['submit']();}),_0x43e1ab['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x16dd69,_0x578db1)=>!_0x16dd69&&_0x578db1),_0x43e1ab;}['_createShowHistoryButton'](){const _0x567f0b=new _0xfad0e(this['locale']),_0x376383=this['resultsView'],_0x5ce7aa=this['locale'];_0x567f0b['set']({'label':i(_0x5ce7aa,'History'),'withText':!0x1,'icon':_0x52e9e4['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x567f0b['bind']('isOn')['to'](_0x376383,'isVisible'),_0x567f0b['bind']('isEnabled')['to'](this,'isEnabled'),_0x567f0b['on']('execute',()=>{_0x376383['isVisible']=!_0x376383['isVisible'],_0x376383['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4d549f=()=>{_0x65c00c['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x1dd507=new st(this['queryView']['fieldView']['element']),_0x4fe776=_0x1dd507['width'],_0x3a376c='rtl'===_0x5ce7aa['uiLanguageDirection']?'left':'right';_0x1dd507['excludeScrollbarsAndBorders'](),_0x567f0b['element']['style'][_0x3a376c]=_0x4fe776-_0x1dd507['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4d549f),this['on']('render',_0x4d549f),_0x567f0b;}['submit'](){const _0x271681=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x271681);}['focus'](_0x171c6e){-0x1===_0x171c6e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x242f17){super(_0x242f17),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x242f17,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5d8fa8=0x0;for(const _0x3e589a of this['items'])_0x5d8fa8+=_0x3e589a['items']['length'];return{'resultsCount':_0x5d8fa8,'totalItemsCount':_0x5d8fa8};}['_createClearHistoryButton'](){const _0x2825e6=this['locale'],_0x1feb7e=new _0xfad0e(this['locale']);return _0x1feb7e['set']({'label':'('+i(_0x2825e6,'Clear')+')','withText':!0x0}),_0x1feb7e['on']('execute',()=>this['fire']('clearHistory')),_0x1feb7e;}}class hs extends _0x2d6046{constructor(_0x5c5b4d){super();const _0x321289=new te(),_0xfb3757=new _0xfad0e(this['locale'],_0x321289);this['children']['add'](_0xfb3757),_0xfb3757['set']({'label':_0x5c5b4d['prompt'],'withText':!0x0}),_0xfb3757['on']('execute',()=>{this['fire']('execute',{'value':_0x5c9c5a(_0x5c5b4d['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x27474f{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x305703,_0x170e7f)=>{const _0x549720=Ss(_0x170e7f['prompt']);for(const _0x1aabef of this)if(_0x1aabef!=_0x170e7f&&Ss(_0x1aabef['prompt'])===_0x549720){this['remove'](_0x1aabef);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x3d76ca=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x3d76ca));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x488f1b=>_0x488f1b)));}}function Ss(_0x45264a){return _0x45264a['toLowerCase']()['trim']();}class k extends _0x5c3f1d{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x448299,_0x417ba1,_0x2fcd99=''){super(_0x448299),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(_0x448299),this['contentArea']=new X(_0x448299,_0x2fcd99),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 _0x4ac8de(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x485bb5({'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 _0x3821e0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x417ba1],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3821e0['if']('isError','ck-hidden',_0x300d84=>!_0x300d84)]},'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'](_0x378247=0x1){-0x1===_0x378247?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 _0x30cf0f=this['locale'],_0x53fe96=new ht(_0x30cf0f,{'queryView':{'label':i(_0x30cf0f,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2801be,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x30cf0f,'Empty\x20history'),'secondary':i(_0x30cf0f,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x53fe96['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x32db25,_0x34c822)=>_0x32db25&&!_0x34c822),this['listenTo'](_0x53fe96,'submit',(_0x451845,_0x95a64e)=>{this['prompt']=_0x95a64e;const _0x3be0bf=_0x2c729f(_0x95a64e);this['fire']('submitPrompt',_0x3be0bf),_0x95a64e['trim']()&&this['_promptHistory']['add']({'prompt':_0x3be0bf},0x0);},{'priority':'high'}),_0x53fe96;}['_createHistoryView'](){const _0x5b3c84=new rs(this['locale']);return _0x5b3c84['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x5b3c84['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x5b3c84;}['_createToolbar'](){const _0x16cfc4=new at(this['locale']);return _0x16cfc4['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x12b5ae,_0x1258a2,_0x31964d)=>_0x12b5ae&&!_0x1258a2&&!!_0x31964d),_0x16cfc4['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x16cfc4['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x85d9b4,_0x4d94a4,_0x51da8)=>_0x85d9b4&&!_0x4d94a4&&!!_0x51da8),_0x16cfc4['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x16cfc4['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x351380,_0x106b34)=>_0x351380&&!_0x106b34),_0x16cfc4['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x16cfc4['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x16cfc4['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x16cfc4;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5ab961=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x5ab961,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x122172){const _0x1fe8bb=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x122172||i(_0x1fe8bb,'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 _0x1666e3{['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[_0x389eb1,a,K,_0x2435b5];}constructor(_0x2ba8fd){super(_0x2ba8fd),_0x2ba8fd['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2ba8fd['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2ba8fd['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2ba8fd['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x31ed84}=this;this['_aiAdapter']=_0x31ed84['plugins']['get'](K),this['_dialog']=_0x31ed84['plugins']['get'](_0x2435b5),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x89197=new E(_0x31ed84,Array['from'](this['_commandDefinitions']['values']()));_0x31ed84['commands']['add']('showAIAssistant',_0x89197),_0x31ed84['ui']['componentFactory']['add']('aiCommands',_0x3f7a18=>{const _0x49b99c=_0x3e9a6b(_0x3f7a18);return _0x49b99c['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x49b99c['buttonView']['set']({'label':i(_0x3f7a18,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x49b99c['on']('execute',_0x2c0cf5=>this['_onExecute'](_0x2c0cf5['source']['id'])),_0x1f9856(_0x49b99c,_0x31ed84['ui']['view']['body'],function(_0x3d3a02){const _0x5d3b9f=o(_0x3d3a02['config']['get']('ai.aiAssistant.commands'),_0x3d3a02['locale']),_0x42a04a=U(_0x3d3a02,_0x5d3b9f)['filter'](_0x117221=>_0x117221['commands']['length']);if(0x1===_0x42a04a['length'])return U(_0x3d3a02,_0x42a04a[0x0]['commands'])['map'](_0x345204=>({'id':_0x345204['id'],'label':_0x345204['label']}));return _0x42a04a['map'](_0x273fe2=>{const {groupId:_0x38401b,groupLabel:_0x53c216,commands:_0x401670}=_0x273fe2,_0x48da2c=U(_0x3d3a02,_0x401670)['map'](_0x3cbc1c=>({'id':_0x3cbc1c['id'],'label':_0x3cbc1c['label']}));return{'id':_0x38401b,'menu':_0x53c216||_0x38401b,'children':_0x48da2c};});}(_0x31ed84),{'ariaLabel':i(_0x3f7a18,'AI\x20Commands')}),_0x49b99c['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x89197['on']('change:enabledCommandsIds',_0x203275),_0x49b99c['menuView']['once']('render',_0x203275),_0x49b99c;function _0x203275(){_0x49b99c['isEnabled']=_0x89197['enabledCommandsIds']['length']>0x0;for(const _0x47face of _0x49b99c['menuView']['buttons'])_0x47face['isEnabled']=_0x89197['enabledCommandsIds']['includes'](_0x47face['id']);}}),_0x31ed84['ui']['componentFactory']['add']('menuBar:aiCommands',_0x50717b=>{const _0x1a842e=new _0x57aa69(_0x50717b);_0x1a842e['buttonView']['set']({'label':i(_0x50717b,'AI\x20Commands'),'icon':T}),_0x1a842e['bind']('isEnabled')['to'](_0x89197,'enabledCommandsIds',_0x5945b0=>_0x5945b0['length']>0x0);const _0x1b11e0=o(_0x31ed84['config']['get']('ai.aiAssistant.commands'),_0x50717b);return this['_populateMenuBarMenu'](_0x89197,_0x1a842e,_0x1b11e0,_0x1c1679=>this['_onExecute'](_0x1c1679)),_0x1a842e;}),_0x31ed84['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x3e70fe=this['_createAIAssistantUIButton'](_0xfad0e);return _0x3e70fe['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x3e70fe;}),_0x31ed84['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x3ab336=this['_createAIAssistantUIButton'](_0x1f06ad);return _0x3ab336['set']({'role':'menuitemcheckbox'}),_0x3ab336;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x59715f=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x12ebe0;for(const _0x374601 in _0x59715f){const _0x2f8e38=_0x374601,_0x3b7881=_0x59715f[_0x2f8e38];if('aiLicenseKeyValid'==_0x3b7881||'aiLicenseKeyInvalid'==_0x3b7881||'aiLicenseKeyExpired'==_0x3b7881||'aiLicenseKeyDomainLimit'==_0x3b7881||'aiLicenseKeyNotAllowed'==_0x3b7881||'aiLicenseKeyEvaluationLimit'==_0x3b7881||'aiLicenseKeyTrialLimit'==_0x3b7881||'aiLicenseKeyUsageLimit'==_0x3b7881){delete _0x59715f[_0x2f8e38],_0x12ebe0=_0x3b7881,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x12ebe0&&_0x59715f['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x12ebe0&&_0x59715f['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x12ebe0&&_0x59715f['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x12ebe0&&_0x59715f['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x12ebe0&&_0x59715f['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x12ebe0&&_0x59715f['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x12ebe0&&_0x59715f['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x243a76='',_0x3fe348='',_0x559eb4='custom'){const _0x18a129=this['editor'],_0x1d414d=_0x18a129['editing']['view'],_0x41d837=_0x18a129['plugins']['get'](a),_0x56a326=_0x18a129['plugins']['get'](_0x389eb1);_0x41d837['showFakeVisualSelection']();const _0x5a6fc7=new w(),_0x5499ef=new ClipboardEvent('copy',{'clipboardData':_0x5a6fc7}),_0x140de2=new _0x437b55(_0x5a6fc7),_0x74265c=new _0x51f8a9(_0x1d414d,_0x5499ef,{'dataTransfer':_0x140de2});_0x56a326['_forceMarkersCopy']('comment',()=>{_0x1d414d['document']['fire']('copy',_0x74265c);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x18a129,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x48e6d6=_0x140de2['getData']('text/html');const _0x16f134=_0x18a129['model']['document']['selection'],_0x14b9fa=Array['from'](_0x16f134['getRanges']());0x1===_0x14b9fa['length']&&_0x14b9fa[0x0]['isFlat']&&!_0x16f134['getSelectedElement']()&&''!==_0x48e6d6['replace'](/&nbsp;/g,'')['trim']()&&(_0x48e6d6='<p>'+_0x48e6d6+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x559eb4,'query':_0x243a76,'htmlContent':_0x48e6d6,'label':_0x3fe348,'mainActionLabel':M[_0x18a129['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':_0x899f3['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x41d837['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x4d1240=new Map(),_0xd1ffcc=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x4b81f2 of _0xd1ffcc)for(const _0x5c8c4c of _0x4b81f2['commands'])_0x4d1240['set'](_0x5c8c4c['id'],{..._0x5c8c4c,'groupId':_0x4b81f2['groupId'],'groupLabel':_0x4b81f2['groupLabel']||_0x4b81f2['groupId']});return _0x4d1240;}['_createAIAssistantUIButton'](_0x4921db){const _0x2205da=this['editor'],_0x2e12d0=_0x2205da['commands']['get']('showAIAssistant'),_0x4e2055=new _0x4921db(_0x2205da['locale']);return _0x4e2055['set']({'label':i(_0x2205da['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x4e2055['bind']('isEnabled')['to'](_0x2e12d0),_0x4e2055['bind']('isOn')['to'](this['_dialog'],'id',_0x459064=>'aiAssistant'===_0x459064),this['listenTo'](_0x4e2055,'execute',()=>{_0x4e2055['isOn']?this['hideUI']():_0x2e12d0['execute']();}),_0x4e2055;}['_initView'](){const _0x22a19a=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',()=>{_0x22a19a['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x22a19a['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4aae4c,ui:{ariaLiveAnnouncer:_0x611fef}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x494e24,_0x419c04,_0x196515)=>{const _0x25e5ef=this['_aiAssistantController']['currentContext'];_0x196515?_0x611fef['announce'](i(_0x4aae4c,'AI\x20is\x20writing')):_0x25e5ef&&_0x611fef['announce'](i(_0x4aae4c,'Generated\x20content:\x20%0',_0x25e5ef),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1ea6b3,_0x10f63c,_0x545294)=>{if(_0x545294){const _0x1708bf=this['_formView']['errorView']['text'];_0x611fef['announce'](i(_0x4aae4c,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1708bf));}});}['_onExecute'](_0x2f5047){const _0x4d92ee=this['_commandDefinitions']['get'](_0x2f5047),_0x23bfa2=this['editor'],_0x8922c6=_0x23bfa2['model']['document']['selection'],_0x5ccab5=_0x23bfa2['commands']['get']('showAIAssistant'),_0x23c3ed=_0x23bfa2['plugins']['get'](a),_0x3ccfb1=''+(_0x4d92ee['groupId']!==x?_0x4d92ee['groupLabel']+':\x20':'')+_0x4d92ee['label'];if(!0x1!==_0x4d92ee['requiresContent']&&_0x8922c6['isCollapsed']){const _0x5c311e=_0x2e760e(_0x8922c6['getSelectedBlocks']())||_0x23bfa2['model']['schema']['getLimitElement'](_0x8922c6);_0x23bfa2['model']['change'](_0x4730f0=>{_0x4730f0['setSelection'](_0x5c311e,'in');});}_0x23c3ed['showFakeVisualSelection'](),_0x5ccab5['execute'](_0x4d92ee['prompt'],_0x3ccfb1,'command:'+_0x2f5047);}['_populateMenuBarMenu'](_0x486439,_0x324455,_0x523eab,_0x1c92fe){const _0x35319f=this['editor'],_0x58dbb7=_0x35319f['locale'],_0x4e95da=new _0x184b35(_0x58dbb7),_0x263f38=U(_0x35319f,_0x523eab)['filter'](_0x28b2e9=>_0x28b2e9['commands']['length']);0x1===_0x263f38['length']?this['_getMenuBarGroupButtons']({'command':_0x486439,'commands':_0x263f38[0x0]['commands'],'parentMenuView':_0x324455,'onExecute':_0x1c92fe})['forEach'](_0x2f6fc5=>_0x4e95da['items']['add'](_0x2f6fc5)):_0x263f38['forEach'](({groupId:_0x3f0ff2,groupLabel:_0x47ca19,commands:_0x2bb96e})=>{const _0xb1cbc2=new _0x5f3486(_0x58dbb7,_0x324455),_0x36bf1c=new _0x57aa69(_0x58dbb7),_0x41210d=new _0x184b35(_0x58dbb7),_0x2629f0=this['_getMenuBarGroupButtons']({'command':_0x486439,'commands':_0x2bb96e,'parentMenuView':_0x36bf1c,'onExecute':_0x1c92fe});_0x36bf1c['buttonView']['set']({'label':_0x47ca19||_0x3f0ff2}),_0x36bf1c['delegate']('execute')['to'](_0x324455),_0x41210d['items']['addMany'](_0x2629f0),_0x36bf1c['panelView']['children']['add'](_0x41210d),_0xb1cbc2['children']['add'](_0x36bf1c),_0x4e95da['items']['add'](_0xb1cbc2);}),_0x324455['panelView']['children']['add'](_0x4e95da);}['_getMenuBarGroupButtons']({command:_0x6d0b17,commands:_0x2c91b7,parentMenuView:_0x30370b,onExecute:_0x50d72b}){const _0x4d6bf8=this['editor'],_0x52ddb6=_0x4d6bf8['locale'];return U(_0x4d6bf8,_0x2c91b7)['map'](_0x3dfd00=>{const _0xba0074=new _0x5f3486(_0x52ddb6,_0x30370b),_0x22187f=new _0x1f06ad(_0x52ddb6);return _0x22187f['set']({'label':_0x3dfd00['label']}),_0x22187f['delegate']('execute')['to'](_0x30370b),_0x22187f['on']('execute',()=>_0x50d72b(_0x3dfd00['id'])),_0x22187f['bind']('isEnabled')['to'](_0x6d0b17,'enabledCommandsIds',_0x3e09bc=>_0x3e09bc['includes'](_0x3dfd00['id'])),_0xba0074['children']['add'](_0x22187f),_0xba0074;});}}function B(_0x228121,_0x2ba99a){return void 0x0!==_0x228121['order']&&void 0x0===_0x2ba99a['order']?0x1:void 0x0===_0x228121['order']&&void 0x0!==_0x2ba99a['order']?-0x1:void 0x0!==_0x228121['order']&&void 0x0!==_0x2ba99a['order']?_0x228121['order']-_0x2ba99a['order']:0x0;}function U(_0x2c4b5a,_0x18a76b){_0x18a76b['sort'](B);const _0x59b0c0={},_0x2c49b1=[];for(const _0x539517 of _0x18a76b)if(void 0x0!==_0x539517['order']){if(_0x539517['order']in _0x59b0c0)throw new _0x1f08ca('ai-commands-config-order-collision',_0x2c4b5a,{'conflictingDefinitions':[_0x539517,_0x59b0c0[_0x539517['order']]]});_0x59b0c0[_0x539517['order']]=_0x539517,_0x2c49b1['splice'](_0x539517['order'],0x0,_0x539517);}else _0x2c49b1['push'](_0x539517);return _0x2c49b1;}class r extends _0x1666e3{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x14e5f7){super(_0x14e5f7);const _0x485378=_0x14e5f7['config'],_0x5d1232=_0x14e5f7['locale'];_0x485378['define']('ai.aiAssistant.preserveComments',!0x0),_0x485378['define']('ai.aiAssistant.commands',function(_0x22ea20){return[{'groupId':'editOrReview','groupLabel':i(_0x22ea20,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x22ea20,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x22ea20,'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(_0x22ea20,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x22ea20,'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(_0x22ea20,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x22ea20,'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(_0x22ea20,'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(_0x22ea20,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x22ea20,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x22ea20,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x22ea20,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x22ea20,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x22ea20,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x22ea20,'Change\x20style'),'commands':[{'id':'business','label':i(_0x22ea20,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x22ea20,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x22ea20,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x22ea20,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x22ea20,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x22ea20,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x22ea20,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x22ea20,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x22ea20,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x22ea20,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x22ea20,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x22ea20,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x22ea20,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x5d1232)),_0x485378['define']('ai.aiAssistant.extraCommandGroups',[]),_0x485378['define']('ai.aiAssistant.removeCommands',[]);let _0x36bdfb=o(_0x485378['get']('ai.aiAssistant.commands'),_0x5d1232);const _0x5db8be=_0x485378['get']('ai.aiAssistant.extraCommandGroups'),_0x2f85f0=_0x485378['get']('ai.aiAssistant.removeCommands');_0x5db8be['forEach'](_0x788a47=>{const _0x1dc699=_0x36bdfb['find'](_0x4862e7=>_0x4862e7['groupId']===_0x788a47['groupId']);_0x1dc699?_0x1dc699['commands']=_0x1dc699['commands']['concat'](_0x788a47['commands']):_0x36bdfb['push'](_0x788a47);}),_0x36bdfb=_0x36bdfb['filter'](_0x5b282f=>!_0x2f85f0['includes'](_0x5b282f['groupId'])),_0x36bdfb['forEach'](_0x1c01e7=>{_0x1c01e7['commands']=_0x1c01e7['commands']['filter'](_0x3ab492=>!_0x2f85f0['includes'](_0x3ab492['id']));}),_0x485378['set']('ai.aiAssistant.commands',_0x36bdfb);}}class P extends _0x1666e3{['abortController'];static get['requires'](){return[K];}constructor(_0x2afa2a){super(_0x2afa2a),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'](_0x252118){return this['sendRequest'](_0x252118)['catch'](_0x433207=>{if(_0x433207 instanceof R)return Promise['reject'](_0x433207);if('AbortError'==_0x433207['name'])return Promise['resolve']();throw console['error'](_0x433207),new _0x1f08ca('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x225bee,_0x28d69c){const _0x4d8ee7=this['editor']['locale'],_0x8f66f9={'Content-Type':'application/json'};if('object'==typeof _0x225bee)Object['assign'](_0x8f66f9,_0x225bee);else{if(_0x225bee)try{const _0x58919d=await _0x225bee(_0x28d69c);Object['assign'](_0x8f66f9,_0x58919d);}catch(_0x2188aa){return Promise['reject'](new R(i(_0x4d8ee7,'AI_ERROR_GET_HEADERS')));}}return _0x8f66f9;}async['_prepareRequestParameters'](_0x396936,_0xf13bf0){const _0x3a74cc=this['editor']['locale'];if('object'==typeof _0x396936)return _0x396936;try{return await _0x396936(_0xf13bf0);}catch(_0x11fd43){return Promise['reject'](new R(i(_0x3a74cc,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x41e42c){super(_0x41e42c),_0x41e42c['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x41e42c['config']['get']('ai.openAI.requestParameters')||_0x41e42c['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x41e42c['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x41e42c['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x41e42c['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3ee657,context:_0x5b1e91,onData:_0x2366fa,actionId:_0x4a9451}){const _0xd3cd26=this['editor']['locale'],_0x1b8966=await this['prepareMessages'](_0x3ee657,_0x5b1e91,_0x4a9451),_0x18be71=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4a9451),_0x210a11=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4a9451),_0x390787={'messages':_0x1b8966,..._0x210a11},_0x3483d0={'method':'POST','headers':_0x18be71,'body':JSON['stringify'](_0x390787),'signal':this['abortController']['signal']},_0x34fb7f=await fetch(this['_apiUrl'],_0x3483d0);if(_0x34fb7f['ok'])return _0x210a11['stream']?await this['_readStreamableResponse'](_0x34fb7f,_0x2366fa):await this['_readStaticResponse'](_0x34fb7f,_0x2366fa),Promise['resolve']();{const _0x5a4348=await _0x34fb7f['text']();return _0x5a4348['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0xd3cd26,'AI_ERROR_CONTEXT_LENGTH'))):_0x5a4348['includes']('Moderation')?Promise['reject'](new R(i(_0xd3cd26,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5a4348));}}async['prepareMessages'](_0x14a7e7,_0x5468b2,_0x43cb3c){let _0x307e2f,_0x3d3c69;return _0x5468b2?(_0x307e2f='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.',_0x3d3c69='Instruction:\x0a'+_0x14a7e7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5468b2):(_0x307e2f='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.',_0x3d3c69=_0x14a7e7),[{'role':'system','content':_0x307e2f},{'role':'user','content':_0x3d3c69}];}async['_readStreamableResponse'](_0x2758e8,_0xc80a76){const _0x3cbb46=_0x2758e8['body']['getReader'](),_0x353edf=new TextDecoder();let _0x556e86='',_0x4793cd='',_0x13b946='',_0x4d9b6a=!0x1;for(;!_0x4d9b6a;){const {done:_0x132cd1,value:_0x4fd1a2}=await _0x3cbb46['read'](),_0x470ceb=_0x556e86+_0x353edf['decode'](_0x4fd1a2);let _0x44cce4='';_0x4d9b6a=_0x132cd1;try{_0x44cce4=this['_cleanUpData'](_0x470ceb),_0x556e86='';}catch(_0x32af86){_0x556e86=_0x470ceb;continue;}_0x4793cd+=_0x44cce4,!_0x4d9b6a&&this['_isBufferIncomplete'](_0x4793cd)||_0x4793cd&&(_0x13b946+=_0x4793cd,_0x4793cd='',_0xc80a76(_0x13b946));}return Promise['resolve']();}async['_readStaticResponse'](_0xc77754,_0x492b77){return _0x492b77((await _0xc77754['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x11da5a){const _0x10b25a=_0x11da5a['split']('<')['length']!==_0x11da5a['split']('>')['length'],_0x4abd88=_0x11da5a['length']<0x1e;return _0x10b25a&&_0x4abd88;}['_cleanUpData'](_0x2868d8){return _0x2868d8['split'](/\n(?![^{]*\})/g)['map'](_0x58d83f=>_0x58d83f['replace']('data:\x20',''))['filter'](_0x33c480=>_0x33c480&&_0x33c480['length']>0x0&&'[DONE]'!==_0x33c480)['map'](_0x2d9ef2=>{const {choices:_0x46fbff}=JSON['parse'](_0x2d9ef2);if(_0x46fbff[0x0]&&_0x46fbff[0x0]['delta']&&_0x46fbff[0x0]['delta']['content'])return _0x46fbff[0x0]['delta']['content'];})['filter'](_0x5df706=>_0x5df706)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x19793c){super(_0x19793c),_0x19793c['config']['get']('ai.aws.requestParameters')||_0x19793c['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']=_0x19793c['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x19793c['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x19793c['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x19793c['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x1d3480,context:_0x447d38,onData:_0x248404,actionId:_0x465cc4}){const {model:_0x1ddab4,stream:_0x58a628,..._0x52d20e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x465cc4),_0x11fa2d={'prompt':await this['preparePrompt'](_0x1d3480,_0x447d38,_0x1ddab4,_0x465cc4),..._0x52d20e};this['_apiUrl']?await this['_processProxyRequest'](_0x11fa2d,_0x1ddab4,_0x58a628,_0x248404,_0x465cc4):await this['_processAWSRequest'](_0x11fa2d,_0x1ddab4,_0x58a628,_0x248404);}async['preparePrompt'](_0x3e736f,_0x2460e5,_0xda1280,_0x25659f){let _0x349fc6,_0x5523bd;return _0x2460e5?(_0x349fc6='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.',_0x5523bd='Instruction:\x0a'+_0x3e736f+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2460e5):(_0x349fc6='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.',_0x5523bd=_0x3e736f),'meta.llama'==this['getModelFamily'](_0xda1280)?'<<SYS>>\x0a'+_0x349fc6+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x5523bd+'\x0a[/INST]':'Human:\x0a'+_0x349fc6+'\x0a'+_0x5523bd+'\x0a\x0aAssistant:';}['getModelFamily'](_0x124705){if(/^anthropic\.claude/['test'](_0x124705))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x124705))return'ai21.j2';if(/^cohere\.command/['test'](_0x124705))return'cohere.command';if(/^meta\.llama/['test'](_0x124705))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x124705));}async['_processProxyRequest'](_0x513e29,_0x3bdaed,_0x4b8343,_0x453ea8,_0x48fa43){const _0x157544={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x48fa43),'body':JSON['stringify']({..._0x513e29,'model':_0x3bdaed,'stream':_0x4b8343}),'signal':this['abortController']['signal']},_0x5d3f6d=await fetch(this['_apiUrl'],_0x157544);_0x4b8343?await this['_readStreamableResponse'](_0x5d3f6d,_0x3bdaed,_0x453ea8):await this['_readStaticResponse'](_0x5d3f6d,_0x3bdaed,_0x453ea8);}async['_processAWSRequest'](_0x3e146a,_0x2270c8,_0x298856,_0x534572){const _0x2d33cc=new _0x182512(this['_bedrockClientConfig']),_0x28cf66={'body':JSON['stringify'](_0x3e146a),'contentType':'application/json','accept':'application/json','modelId':_0x2270c8};let _0x4de076;if(_0x298856){const _0x54421f=new _0x3989f0(_0x28cf66);_0x4de076=await _0x2d33cc['send'](_0x54421f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x4de076,_0x2270c8,_0x534572);}else{const _0x4a6d10=new _0x53f416(_0x28cf66);_0x4de076=await _0x2d33cc['send'](_0x4a6d10,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x4de076,_0x2270c8,_0x534572);}}async['_readAsyncIterableResponse'](_0x2a21d1,_0x115beb,_0x4c1b0c){const _0x43b576=_0x2a21d1['body'],_0xe357c0=new TextDecoder('utf-8');let _0x40a65e='';for await(const _0x1a5ee6 of _0x43b576)if(_0x1a5ee6['chunk']){const _0x4a9126=_0xe357c0['decode'](_0x1a5ee6['chunk']['bytes']),_0x5e702d=JSON['parse'](_0x4a9126);_0x40a65e+=this['_getGeneratedText'](_0x5e702d,_0x115beb),_0x4c1b0c(_0x40a65e);}return Promise['resolve']();}async['_readStreamableResponse'](_0x1e5c34,_0x1a0d61,_0x44c42f){const _0x1d3dea=_0x1e5c34['body'],_0x4a63a0=new TextDecoder('utf-8'),_0x3d79c7=_0x1d3dea['getReader']();let _0x39705e='',_0x10ea52='',_0xfbe0c6=!0x1;for(;!_0xfbe0c6;){const {done:_0x32b9c4,value:_0x289264}=await _0x3d79c7['read']();if(_0xfbe0c6=_0x32b9c4,_0xfbe0c6)break;const _0x5b4e95=(_0x39705e+_0x4a63a0['decode'](_0x289264))['split']('\x0a')['map'](_0x177285=>{try{return _0x39705e='',JSON['parse'](_0x177285);}catch(_0x38b704){return _0x39705e=_0x177285,null;}})['filter'](_0x3fd751=>null!==_0x3fd751);_0x5b4e95['length']&&(_0x10ea52+=_0x5b4e95['map'](_0x196c3c=>this['_getGeneratedText'](_0x196c3c,_0x1a0d61))['join'](''),_0x44c42f(_0x10ea52));}return Promise['resolve']();}async['_readStaticResponse'](_0xa24356,_0x5565bf,_0x152dfb){let _0x1ee478;return _0x1ee478=_0xa24356 instanceof Response?await _0xa24356['json']():JSON['parse'](Buffer['from'](_0xa24356['body'])['toString']('utf8')),(_0x152dfb(this['_getGeneratedText'](_0x1ee478,_0x5565bf)),Promise['resolve']());}['_getGeneratedText'](_0x42c193,_0x1db138){switch(this['getModelFamily'](_0x1db138)){case'anthropic.claude':return _0x42c193['completion'];case'ai21.j2':return _0x42c193['completions'][0x0]['data']['text'];case'cohere.command':return _0x42c193['generations'][0x0]['text'];case'meta.llama':return _0x42c193['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 _0x25032d,Command as _0x3091f0,icons as _0x191c74}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x3ff277,CKEditorError as _0x17367d,ObservableMixin as _0x10b391,global as _0x2b698f,isVisible as it,Rect as st,Collection as _0x553cb0,FocusTracker as _0x4765e3,KeystrokeHandler as ts,first as _0xac57c1}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x440609,View as _0x419f3d,SpinnerView as _0x1a5dfb,IconView as _0x44afea,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x441dee,ButtonLabelView as te,FocusCycler as _0x1d2fca,createLabeledTextarea as _0x40c883,Dialog as _0x4b32b1,createDropdown as _0x1da211,addMenuToDropdown as _0x52b5ee,MenuBarMenuView as _0x5eb759,MenuBarMenuListItemButtonView as _0x3bff52,DialogViewPosition as _0x440cd1,MenuBarMenuListView as _0x2e663f,MenuBarMenuListItemView as _0x3950ea}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x2abfb4,ClipboardMarkersUtils as _0x488ab5}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x175bed,DataTransfer as _0x1fb7bc,UpcastWriter as _0x26dc54,Matcher as _0x382eb1}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x1ea807,escape as _0x42ceca}from'lodash-es';import{BedrockRuntimeClient as _0x13de27,InvokeModelWithResponseStreamCommand as _0x2a5150,InvokeModelCommand as _0x497e16}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x471f06,_0x5524cd){const _0x7d96e5=(0x0,_0x5524cd['t'])('Other');return _0x471f06['length']?'groupId'in _0x471f06[0x0]?_0x471f06:[{'groupId':x,'groupLabel':_0x7d96e5,'order':0x1/0x0,'commands':_0x471f06}]:[{'groupId':x,'groupLabel':_0x7d96e5,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x25032d{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x20486c}=this,_0x5bb5ef=['ck-fake-ai-selection'];_0x20486c['config']['get']('ai.useTheme')&&_0x5bb5ef['push']('ck-ai-assistant-ui_theme'),_0x20486c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x5bb5ef,'priority':0xc}}),_0x20486c['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x31d136,{writer:_0x137e5c})=>{if(!_0x31d136['markerRange']['isCollapsed'])return null;const _0x57463f=_0x137e5c['createUIElement']('span');return _0x137e5c['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x57463f),_0x57463f;}});}['afterInit'](){!async function(_0x2b72df){const _0x4a8f32=_0x3c0128([0x69,0x6f,0x42,0x6e,0x79,0x48,0x39,0x35,0x4f,0x36,0x31,0x41,0x57,0x53,0x37,0x34,0x47,0x43,0x66,0x73,0x77,0x45,0x38,0x4b,0x61,0x4c,0x78,0x56,0x6a,0x5a,0x7a,0x6d,0x58,0x50,0x6c,0x30,0x44,0x65,0x71,0x46,0x76,0x33,0x68,0x52,0x6b,0x54,0x32,0x49,0x64,0x4e,0x55,0x59,0x70,0x63,0x51,0x75,0x4d,0x72,0x62,0x4a,0x74,0x67]),_0xa8842e=0x6e046bbc,_0x2943b0=0x6e0334bc^_0xa8842e,_0xeb8526=window[_0x3c0128([0x44,0x61,0x74,0x65])][_0x3c0128([0x6e,0x6f,0x77])](),_0x434ce6=_0x2b72df[_0x3c0128([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x946c8=new window[(_0x3c0128([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x9fffd6=>{_0x434ce6[_0x3c0128([0x6f,0x6e,0x63,0x65])](_0x3c0128([0x72,0x65,0x61,0x64,0x79]),_0x9fffd6);}),_0x4d6550={[_0x3c0128([0x6b,0x74,0x79])]:_0x3c0128([0x45,0x43]),[_0x3c0128([0x75,0x73,0x65])]:_0x3c0128([0x73,0x69,0x67]),[_0x3c0128([0x63,0x72,0x76])]:_0x3c0128([0x50,0x2d,0x32,0x35,0x36]),[_0x3c0128([0x78])]:_0x3c0128([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]),[_0x3c0128([0x79])]:_0x3c0128([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]),[_0x3c0128([0x61,0x6c,0x67])]:_0x3c0128([0x45,0x53,0x32,0x35,0x36])},_0x156a8d=_0x434ce6[_0x3c0128([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3c0128([0x67,0x65,0x74])](_0x3c0128([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x344497(){let _0x5d67e1,_0x372ed1=null,_0x5c28bd=null;try{if(_0x156a8d==_0x3c0128([0x47,0x50,0x4c]))return _0x3c0128([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5d67e1=_0x544d2c(),!_0x5d67e1)return _0x3c0128([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5d67e1[_0x3c0128([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x5c28bd=_0x4dcebb(_0x5d67e1[_0x3c0128([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5d67e1[_0x3c0128([0x6a,0x74,0x69])])),await _0x59137b()?_0x2c4bb7()?_0x2aab8a()?_0x3c0128([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3a93ba()?(_0x5d67e1[_0x3c0128([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3c0128([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x372ed1=_0x44aa5c(_0x3c0128([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x5d67e1[_0x3c0128([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3c0128([0x74,0x72,0x69,0x61,0x6c])&&(_0x372ed1=_0x44aa5c(_0x3c0128([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x31225d()):_0x3c0128([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3c0128([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3c0128([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x3b8c62){return _0x3c0128([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2aab8a(){const _0x45c8a7=[_0x3c0128([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3c0128([0x74,0x72,0x69,0x61,0x6c])][_0x3c0128([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5d67e1[_0x3c0128([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xeb8526/0x3e8:0xe10*_0x2943b0;return _0x5d67e1[_0x3c0128([0x65,0x78,0x70])]<_0x45c8a7;}function _0x2c4bb7(){const _0x98dd23=_0x5d67e1[_0x3c0128([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x98dd23&&(!!_0x98dd23[_0x3c0128([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c0128([0x2a]))||!!_0x98dd23[_0x3c0128([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c0128([0x41,0x49])));}function _0x3a93ba(){const _0x5b5994=_0x5d67e1[_0x3c0128([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5b5994||0x0==_0x5b5994[_0x3c0128([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x309dbe}=new URL(window[_0x3c0128([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5b5994[_0x3c0128([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x309dbe))return!0x0;const _0x2cc1c4=_0x309dbe[_0x3c0128([0x73,0x70,0x6c,0x69,0x74])](_0x3c0128([0x2e]));return _0x5b5994[_0x3c0128([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x29e64e=>_0x29e64e[_0x3c0128([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c0128([0x2a])))[_0x3c0128([0x6d,0x61,0x70])](_0x24201b=>_0x24201b[_0x3c0128([0x73,0x70,0x6c,0x69,0x74])](_0x3c0128([0x2e])))[_0x3c0128([0x73,0x6f,0x6d,0x65])](_0x1bde5c=>_0x2cc1c4[_0x3c0128([0x65,0x76,0x65,0x72,0x79])]((_0xf0785,_0x2bd547)=>_0x1bde5c[_0x2bd547]===_0xf0785||_0x1bde5c[_0x2bd547]===_0x3c0128([0x2a])));}function _0x31225d(){return _0x372ed1&&_0x5c28bd?new window[(_0x3c0128([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x404dda,_0x610224)=>{_0x372ed1[_0x3c0128([0x74,0x68,0x65,0x6e])](_0x404dda,_0x610224),_0x5c28bd[_0x3c0128([0x74,0x68,0x65,0x6e])](_0x2accb1=>{_0x2accb1!=_0x3c0128([0x56,0x61,0x6c,0x69,0x64])&&_0x404dda(_0x2accb1);},_0x610224);}):_0x372ed1||_0x5c28bd||_0x3c0128([0x56,0x61,0x6c,0x69,0x64]);}}function _0x4dcebb(_0x311183,_0x51137c){return new window[(_0x3c0128([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1e40f2=>{if(_0x41ed94())return _0x1e40f2(_0x3c0128([0x56,0x61,0x6c,0x69,0x64]));_0x103242(),_0x434ce6[_0x3c0128([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3c0128([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x2ff880=!0x1;const _0x156d04=_0x3ff277();function _0x1e5598(_0x4d5db5){return!!_0x4d5db5&&(typeof _0x4d5db5===_0x3c0128([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4d5db5===_0x3c0128([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4d5db5[_0x3c0128([0x74,0x68,0x65,0x6e])]===_0x3c0128([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4d5db5[_0x3c0128([0x63,0x61,0x74,0x63,0x68])]===_0x3c0128([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2fcf7b(_0x4b6bab){_0x34ec6f(_0x4b6bab)[_0x3c0128([0x74,0x68,0x65,0x6e])](_0x1dffe9=>{if(!_0x1dffe9||_0x1dffe9[_0x3c0128([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3c0128([0x6f,0x6b]))return _0x3c0128([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x51a7db(_0x212ff4(_0x156d04+_0x51137c))!=_0x1dffe9[_0x3c0128([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3c0128([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3c0128([0x56,0x61,0x6c,0x69,0x64]);})[_0x3c0128([0x74,0x68,0x65,0x6e])](_0x4602b7=>(_0x73841(),_0x4602b7),()=>{const _0x30b58a=_0x215df4();return null==_0x30b58a?(_0x73841(),_0x3c0128([0x56,0x61,0x6c,0x69,0x64])):_0x3c0128(_0xeb8526-_0x30b58a>(0x4a08efbc^_0xa8842e)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3c0128([0x74,0x68,0x65,0x6e])](_0x1e40f2)[_0x3c0128([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1e40f2(_0x3c0128([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x53d0f3=0x6e32853c^_0xa8842e;function _0x73841(){const _0x5b8fb8=_0x3c0128([0x6c,0x6c,0x63,0x74,0x2d])+_0x51a7db(_0x212ff4(_0x311183)),_0x5c9710=_0xf7e6f3(_0x51a7db(window[_0x3c0128([0x4d,0x61,0x74,0x68])][_0x3c0128([0x63,0x65,0x69,0x6c])](_0xeb8526/_0x53d0f3)));window[_0x3c0128([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c0128([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5b8fb8,_0x5c9710);}function _0x215df4(){const _0x259cbe=_0x3c0128([0x6c,0x6c,0x63,0x74,0x2d])+_0x51a7db(_0x212ff4(_0x311183)),_0x4e5321=window[_0x3c0128([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c0128([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x259cbe);return _0x4e5321?window[_0x3c0128([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xf7e6f3(_0x4e5321),0x10)*_0x53d0f3:null;}function _0x34ec6f(_0x567766){return new window[(_0x3c0128([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x507aa9,_0x55c787)=>{_0x567766[_0x3c0128([0x74,0x68,0x65,0x6e])](_0x507aa9,_0x55c787),window[_0x3c0128([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x55c787,0x6e05bf7c^_0xa8842e);});}}_0x434ce6[_0x3c0128([0x6f,0x6e])](_0x3c0128([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x34bf92,_0x58d24b)=>{if(_0x58d24b[0x0]!=_0x311183)return _0x1e40f2(_0x3c0128([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x58d24b[0x1]={..._0x58d24b[0x1],[_0x3c0128([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x156d04};},{[_0x3c0128([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c0128([0x68,0x69,0x67,0x68])}),_0x434ce6[_0x3c0128([0x6f,0x6e])](_0x3c0128([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1c1f6d=>{_0x1e5598(_0x1c1f6d[_0x3c0128([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x2ff880=!0x0,_0x2fcf7b(_0x1c1f6d[_0x3c0128([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3c0128([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c0128([0x6c,0x6f,0x77])}),_0x946c8[_0x3c0128([0x74,0x68,0x65,0x6e])](()=>{_0x2ff880||_0x1e40f2(_0x3c0128([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x41ed94(){return _0x434ce6[_0x3c0128([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c0128([0x76,0x69,0x65,0x77])][_0x3c0128([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3c0128([0x61,0x75,0x74,0x6f]);}function _0x103242(){_0x434ce6[_0x3c0128([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c0128([0x76,0x69,0x65,0x77])][_0x3c0128([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3c0128([0x61,0x75,0x74,0x6f]);}}function _0x44aa5c(_0xfb4c2b){const _0x1d6a89=[new window[(_0x3c0128([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x55d815=>setTimeout(_0x55d815,0x6e0d5570^_0xa8842e)),_0x946c8[_0x3c0128([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3c0128([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xf7316e=>{let _0x4ae7df=0x0;_0x434ce6[_0x3c0128([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c0128([0x6f,0x6e])](_0x3c0128([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x5b4005,_0x51adf8)=>{_0x51adf8[0x0][_0x3c0128([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4ae7df++,_0x4ae7df==(0x6e046a44^_0xa8842e)&&(_0xf7316e(),_0x5b4005[_0x3c0128([0x6f,0x66,0x66])]());});}))];return window[_0x3c0128([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3c0128([0x72,0x61,0x63,0x65])](_0x1d6a89)[_0x3c0128([0x74,0x68,0x65,0x6e])](()=>_0xfb4c2b);}async function _0xf1c428(){await _0x946c8,_0x434ce6[_0x3c0128([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c0128([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x298363,_0x434ce6[_0x3c0128([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c0128([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x298363,_0x434ce6[_0x3c0128([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3c0128([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xcc0fc5(_0x14f600){const _0x5c3c84=_0x5856a9();_0x434ce6[_0x5c3c84]=_0x3c0128([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x14f600,_0x14f600!=_0x3c0128([0x56,0x61,0x6c,0x69,0x64])&&_0xf1c428();}function _0x5856a9(){const _0x3720a9=window[_0x3c0128([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3c0128([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3c0128([0x6e,0x6f,0x77])]())[_0x3c0128([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3c0128([0x2e]),'');let _0x24a038=_0x3c0128([0x69]);for(let _0x5a9793=0x0;_0x5a9793<_0x3720a9[_0x3c0128([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5a9793+=0x2){let _0x2705b2=window[_0x3c0128([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3720a9[_0x3c0128([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5a9793,_0x5a9793+0x2));_0x2705b2>=_0x4a8f32[_0x3c0128([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2705b2-=_0x4a8f32[_0x3c0128([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x24a038+=_0x4a8f32[_0x2705b2];}return _0x24a038;}function _0x544d2c(){const _0xa1a507=_0x156a8d[_0x3c0128([0x73,0x70,0x6c,0x69,0x74])](_0x3c0128([0x2e]));if(0x3!=_0xa1a507[_0x3c0128([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xa47a0e(_0xa1a507[0x1]);function _0xa47a0e(_0x1502a4){const _0x28c883=_0x4414ae(_0x1502a4);return _0x28c883&&_0x5e05b3()?_0x28c883:null;function _0x5e05b3(){const _0x3c8177=_0x28c883[_0x3c0128([0x6a,0x74,0x69])],_0x67c725=window[_0x3c0128([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3c8177[_0x3c0128([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3c8177[_0x3c0128([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x25b095={..._0x28c883,[_0x3c0128([0x6a,0x74,0x69])]:_0x3c8177[_0x3c0128([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3c8177[_0x3c0128([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x25b095[_0x3c0128([0x76,0x63])],_0x212ff4(_0x25b095)==_0x67c725;}}}async function _0x59137b(){let _0x24fd7d=!0x0;try{const _0xbc420a=_0x156a8d[_0x3c0128([0x73,0x70,0x6c,0x69,0x74])](_0x3c0128([0x2e])),[_0x4eb26b,_0x5c6dea,_0x2f1f22]=_0xbc420a;return _0x38131c(_0x4eb26b),await _0x46f48e(_0x4eb26b,_0x5c6dea,_0x2f1f22),_0x24fd7d;}catch(_0x2d1302){return!0x1;}function _0x38131c(_0xe0d305){const _0x34fb93=_0x4414ae(_0xe0d305);_0x34fb93&&_0x34fb93[_0x3c0128([0x61,0x6c,0x67])]==_0x3c0128([0x45,0x53,0x32,0x35,0x36])||(_0x24fd7d=!0x1);}async function _0x46f48e(_0x171850,_0x485db5,_0x55fde6){const _0x3a79a0=window[_0x3c0128([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3c0128([0x66,0x72,0x6f,0x6d])](_0x449473(_0x55fde6),_0x3f5213=>_0x3f5213[_0x3c0128([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x6bc5d0=new window[(_0x3c0128([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3c0128([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x171850+_0x3c0128([0x2e])+_0x485db5),_0x2beb94=window[_0x3c0128([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3c0128([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2beb94)return;const _0x34ae18=await _0x2beb94[_0x3c0128([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3c0128([0x6a,0x77,0x6b]),_0x4d6550,{[_0x3c0128([0x6e,0x61,0x6d,0x65])]:_0x3c0128([0x45,0x43,0x44,0x53,0x41]),[_0x3c0128([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3c0128([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3c0128([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2beb94[_0x3c0128([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3c0128([0x6e,0x61,0x6d,0x65])]:_0x3c0128([0x45,0x43,0x44,0x53,0x41]),[_0x3c0128([0x68,0x61,0x73,0x68])]:{[_0x3c0128([0x6e,0x61,0x6d,0x65])]:_0x3c0128([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x34ae18,_0x3a79a0,_0x6bc5d0)||(_0x24fd7d=!0x1);}}function _0x4414ae(_0x1b903f){return _0x1b903f[_0x3c0128([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3c0128([0x65,0x79]))?JSON[_0x3c0128([0x70,0x61,0x72,0x73,0x65])](_0x449473(_0x1b903f)):null;}function _0x449473(_0x346b89){return window[_0x3c0128([0x61,0x74,0x6f,0x62])](_0x346b89[_0x3c0128([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3c0128([0x2b]))[_0x3c0128([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3c0128([0x2f])));}function _0x212ff4(_0x5b8aed){let _0x3bad96=0x1505;function _0x1577fc(_0x2d0e1d){for(let _0x257acd=0x0;_0x257acd<_0x2d0e1d[_0x3c0128([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x257acd++){const _0x3d7870=_0x2d0e1d[_0x3c0128([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x257acd);_0x3bad96=(_0x3bad96<<0x5)+_0x3bad96+_0x3d7870,_0x3bad96&=_0x3bad96;}}function _0x513ebe(_0x78f869){Array[_0x3c0128([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x78f869)?_0x78f869[_0x3c0128([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x513ebe):_0x78f869&&typeof _0x78f869==_0x3c0128([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3c0128([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x78f869)[_0x3c0128([0x73,0x6f,0x72,0x74])]()[_0x3c0128([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3e755b,_0x221d95])=>{_0x1577fc(_0x3e755b),_0x513ebe(_0x221d95);}):_0x1577fc(window[_0x3c0128([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x78f869));}return _0x513ebe(_0x5b8aed),_0x3bad96>>>0x0;}function _0x51a7db(_0x81b28d){return _0x81b28d[_0x3c0128([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3c0128([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3c0128([0x30]));}function _0xf7e6f3(_0x33e154){return _0x33e154[_0x3c0128([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3c0128([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3c0128([0x6a,0x6f,0x69,0x6e])]('');}function _0x298363(){}function _0x3c0128(_0xcf4edf){return _0xcf4edf['map'](_0x1b00f0=>String['fromCharCode'](_0x1b00f0))['join']('');}_0xcc0fc5(await _0x344497());}(this);}['showFakeVisualSelection'](){const _0x4cd98c=this['editor']['model'];_0x4cd98c['change'](_0xa502f5=>{const _0x25faa7=_0x4cd98c['document']['selection']['getRanges']();let _0x122607=0x0;for(const _0x97d787 of _0x25faa7){const _0x5ddc99=f+':'+_0x122607;if(_0x4cd98c['markers']['has'](_0x5ddc99))_0xa502f5['updateMarker'](_0x5ddc99,{'range':_0x97d787});else{if(_0x97d787['start']['isAtEnd']){const _0x5b2205=_0x97d787['start']['getLastMatchingPosition'](({item:_0x116b20})=>!_0x4cd98c['schema']['isContent'](_0x116b20),{'boundaries':_0x97d787});_0xa502f5['addMarker'](_0x5ddc99,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xa502f5['createRange'](_0x5b2205,_0x97d787['end'])});}else _0xa502f5['addMarker'](_0x5ddc99,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x97d787});}_0x122607++;}});}['hideFakeVisualSelection'](){const _0x27a0c6=this['editor']['model'],_0x195511=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x195511['length']&&_0x27a0c6['change'](_0x234b8a=>{_0x195511['forEach'](_0x33c1e0=>{_0x234b8a['removeMarker'](_0x33c1e0);});});}['insertContent'](_0x3ad904,_0x55026f){const _0x27b15c=this['_getAISelection'](),_0x3a5435=_0x55026f||_0x27b15c['getFirstRange']();this['editor']['model']['canEditAt'](_0x3a5435)&&this['editor']['model']['change'](_0xbd64d1=>{this['hideFakeVisualSelection'](),_0x55026f||this['_resetContentOfSelectedTableCells'](_0xbd64d1,_0x27b15c),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3a5435,'writer':_0xbd64d1,'html':_0x3ad904});});}['insertContentBelow'](_0xf791d1){const {model:_0x5e2357}=this['editor'],_0x4bbb50=this['_getAISelection']();_0x5e2357['change'](()=>{const _0x25873d=this['_prepareTableInsertBelowPosition'](_0xf791d1,_0x4bbb50)||this['_getDefaultInsertBelowPosition'](_0x4bbb50);this['insertContent'](_0xf791d1,_0x25873d);});}['_getAISelection'](){const _0x36cf71=this['editor']['model'],_0x327060=Array['from'](_0x36cf71['markers']['getMarkersGroup'](f))['map'](_0xdc124=>_0xdc124['getRange']());return _0x36cf71['createSelection'](_0x327060);}['_pasteHTMLUsingClipboard']({writer:_0x50443d,html:_0x326d6a,insertAt:_0x1267c4}){const {view:_0x4cd7d9}=this['editor']['editing'],_0x25cf4e=this['editor']['plugins']['get'](_0x2abfb4),_0x5f3671=new dt();_0x5f3671['setData']('text/html',_0x326d6a);const _0x249e83=new ClipboardEvent('paste',{'clipboardData':_0x5f3671}),_0x30e251=new _0x175bed(_0x4cd7d9,_0x249e83,{'dataTransfer':new _0x1fb7bc(_0x5f3671)});_0x50443d['setSelection'](_0x1267c4);const _0x5cf1eb=(_0x18a877,_0x49d0a6)=>{_0x49d0a6['resultRange']&&_0x50443d['setSelection'](_0x49d0a6['resultRange']);};_0x25cf4e['once']('contentInsertion',_0x5cf1eb,{'priority':'lowest'}),_0x4cd7d9['document']['fire']('paste',_0x30e251),_0x25cf4e['off']('contentInsertion',_0x5cf1eb);}['_getDefaultInsertBelowPosition'](_0x3b70e3){const {model:_0x3f748d}=this['editor'],_0x1a13b7=Array['from'](_0x3b70e3['getSelectedBlocks']());return _0x1a13b7['length']?_0x3f748d['createPositionAfter'](_0x1a13b7['pop']()):_0x3b70e3['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x51df02,_0x42bd55){const {model:_0x3d1b38,plugins:_0x476c}=this['editor'];if(_0x476c['has']('TableUtils')){const _0x235934=_0x476c['get']('TableUtils')['getSelectedTableCells'](_0x42bd55);if(_0x235934['length']){const _0x5b4fd6=this['_getTableRowCountFromContent'](_0x51df02),_0x3ee966=this['_createEmptyTableRows'](_0x235934,_0x5b4fd6);return _0x3d1b38['createPositionAt'](_0x3ee966,0x0);}}return null;}['_getTableRowCountFromContent'](_0x22c620){const _0x514bba=this['editor']['plugins']['get']('TableUtils'),_0x235171=this['editor']['data']['parse'](_0x22c620),_0x145281=Array['from'](_0x235171['getChildren']())['filter'](_0x4fba0b=>_0x4fba0b['is']('element','table'));let _0x48fa73=0x0;return _0x145281['forEach'](_0x5ce189=>{_0x48fa73+=_0x514bba['getRows'](_0x5ce189);}),_0x48fa73;}['_createEmptyTableRows'](_0x49e466,_0x5424db){const _0x1c8a18=this['editor']['plugins']['get']('TableUtils'),_0xb6c08e=_0x1c8a18['getRowIndexes'](_0x49e466),_0x5e15bc=_0x1c8a18['getColumnIndexes'](_0x49e466),_0x30327b=_0xb6c08e['last']+0x1,_0x3514b2=_0x5e15bc['first'],_0x38fd88=_0x49e466[0x0]['findAncestor']('table');for(let _0x2dfab8=0x0;_0x2dfab8<_0x5424db;_0x2dfab8++)_0x1c8a18['insertRows'](_0x38fd88,{'at':_0x30327b});return _0x38fd88['getChild'](_0x30327b)['getChild'](_0x3514b2);}['_resetContentOfSelectedTableCells'](_0x32f262,_0x219efd){const {plugins:_0x34b106}=this['editor'],{model:_0x416af7}=_0x32f262;if(!_0x34b106['has']('TableUtils'))return;_0x34b106['get']('TableUtils')['getSelectedTableCells'](_0x219efd)['length']&&_0x416af7['deleteContent'](_0x219efd);}}class K extends _0x25032d{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x17367d('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x19fc57){super(_0x19fc57),this['name']='AIRequestError';}}function i(_0x3ab8d7,_0x26579c,_0xd8e1a4){const t=_0x3ab8d7['t'];switch(_0x26579c){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',_0xd8e1a4);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xd8e1a4);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'},_0xd8e1a4);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 _0x26579c;}}class E extends _0x3091f0{['_commandDefinitions'];constructor(_0x549a5b,_0x175fa7){super(_0x549a5b),this['_commandDefinitions']=_0x175fa7,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5ea58e,_0x5cb46c,_0x54400e)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x54400e));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x4cee9c,_0xf3c5c4,_0x203e60)=>{this['enabledCommandsIds']=_0x203e60?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x80ce3f=this['editor']['model'];this['_hasContext']=function(_0x2d0ac3){const _0x2a9415=_0x2d0ac3['document']['selection'];return _0x2a9415['isCollapsed']?0x0!==[..._0x2a9415['getSelectedBlocks']()]['length']&&![..._0x2a9415['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2d0ac3['hasContent'](_0x2a9415['getFirstRange']());}(_0x80ce3f);const _0x2d5726=_0x80ce3f['document']['selection'],_0x10e6fb=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x4912cb of _0x2d5726['getRanges']())for(const _0x529eee of _0x4912cb['getItems']())if(_0x529eee['is']('element')&&_0x10e6fb['includes'](_0x529eee['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x346d04='',_0x3e8837='',_0x618fa3='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x346d04,_0x3e8837,_0x618fa3);}}function G(_0x2b38e8,_0x47b0d9){const _0x29221f=new Set();for(const _0x440ea3 of _0x2b38e8['values']())(_0x47b0d9||!0x1===_0x440ea3['requiresContent'])&&_0x29221f['add'](_0x440ea3['id']);return Array['from'](_0x29221f);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0x10b391(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x361abd,_0x14045b,_0x379a6f){super(),this['editor']=_0x361abd,this['textAdapter']=_0x14045b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x379a6f,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x31cf18,_0x5423ad,_0x1732f4)=>{this['view']['value']=this['_sanitizeHTML'](_0x1732f4);}),this['listenTo'](this['view'],'submitPrompt',(_0x545fbf,_0x138104)=>{const _0x253515=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x138104,_0x253515,'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:_0x42f228,query:_0xe261a3,htmlContent:_0x499b2f,label:_0xd2b161,mainActionLabel:_0x2d91b5}){this['view']['prompt']=_0xd2b161,this['view']['mainAction']=_0x2d91b5,this['initialContext']=_0x499b2f,_0xe261a3&&(this['view']['isRendered']?this['_handleQuery'](_0xe261a3,_0x499b2f,_0x42f228,_0xd2b161):this['view']['once']('render',()=>{this['_handleQuery'](_0xe261a3,_0x499b2f,_0x42f228,_0xd2b161);}));}['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'](_0x4a3b15,_0x50a8c3,_0x1e5e02,_0x27d162){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x50a8c3,this['previousQuery']=_0x4a3b15,this['previousLabel']=_0x27d162||_0x4a3b15,this['previousActionId']=_0x1e5e02,new Promise(_0x1528c6=>{this['textAdapter']['makeRequest']({'query':_0x4a3b15,'context':_0x50a8c3,'onData':_0x4bda85=>{this['currentResponse']=_0x4bda85,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1e5e02})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x49ad43=>{_0x49ad43 instanceof R?this['view']['handleError'](_0x49ad43['message']):this['view']['handleError'](),_0x1528c6();})['finally'](()=>{this['stopProcessing'](),_0x1528c6();});});}['_parseAndNormalizeContent'](_0x57349a,_0x3b3c33=!0x1){const _0x45fb79=Z['exec'](_0x57349a);_0x57349a=_0x45fb79?_0x57349a['substring'](_0x45fb79[0x1]['length']):_0x57349a['length']<0x64&&!_0x3b3c33?'':this['_stripMarkdownSyntax'](_0x57349a);const _0x5d1fde=this['_domParser']['parseFromString'](_0x57349a,'text/html');if(_0x45fb79){const _0xfdb9b6=Array['from'](_0x5d1fde['body']['childNodes']);_0xfdb9b6['reverse']();for(const _0x55463d of _0xfdb9b6){if(_0x55463d['nodeType']==Node['ELEMENT_NODE'])break;_0x55463d['remove']();}}const _0x43599e=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5d1fde['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x43599e);const _0x16e911=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x2c80c1=this['editor']['data']['toModel'](_0x43599e);return _0x16e911||_0x2c80c1['markers']['clear'](),this['editor']['data']['stringify'](_0x2c80c1);}['_normalizeResponseHeadings'](_0x5d72e9){const _0x283f36=new _0x26dc54(this['editor']['editing']['view']['document']),_0x355233=new _0x382eb1({'name':/^h[1-5]$/}),_0x278034=[];let _0x4cafed=!0x1;for(const _0x67a1ee of _0x5d72e9)_0x67a1ee['is']('element')&&_0x355233['match'](_0x67a1ee)&&(_0x278034['push'](_0x67a1ee),'h1'==_0x67a1ee['name']&&(_0x4cafed=!0x0));if(_0x4cafed){for(const _0xcb0fda of _0x278034)_0x283f36['rename']('h'+(parseInt(_0xcb0fda['name'][0x1])+0x1),_0xcb0fda);}}['_isH1TagSupportEnabled'](){const {data:_0x549ea2,editing:_0x873dc0}=this['editor'],_0x56bc44=_0x549ea2['htmlProcessor']['toView']('<h1></h1>'),_0x3b0a89=_0x549ea2['toView'](_0x549ea2['toModel'](_0x56bc44));return!!_0x873dc0['view']['domConverter']['viewToDom'](_0x3b0a89)['querySelector']('h1');}['_sanitizeHTML'](_0x169436){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x169436),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x302b47){const _0x3ba207=_0x302b47['trim']();return _0x3ba207['startsWith']('```html')?_0x3ba207['endsWith']('```')?_0x3ba207['substring'](0x7,_0x3ba207['length']-0x3):_0x3ba207['substring'](0x7):_0x302b47;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x409741){super(_0x409741),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x36052d=>i(_0x409741,'AI_'+_0x36052d['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x409741,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x409741,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x409741,'Stop'));const _0x85f552=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x85f552['if']('isVisible','ck-hidden',_0x3fe4fc=>!_0x3fe4fc)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x35f10b,_0x1a27ca){const _0x243758=new _0x440609(this['locale']);return _0x243758['set']({'label':_0x35f10b,'class':_0x1a27ca||'','isVisible':!0x0,'withText':!0x0}),_0x243758;}}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 _0x419f3d{['contentFieldView'];['copyButtonView'];constructor(_0x2804a9,_0x552250=''){super(_0x2804a9),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0xfcb372=this['bindTemplate'];this['contentFieldView']=new mt(_0x2804a9,_0x552250),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0xfcb372['if']('isVisible','ck-hidden',_0x171470=>!_0x171470)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0xfcb372['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 _0x54cda0=!0x1;this['on']('change:value',(_0x885ab1,_0xb3f6a2,_0x2e1f7d)=>{const _0x28c667=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2e1f7d),this['isProcessing']&&_0x28c667&&!_0x54cda0&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x48130a,_0x11a43e,_0x21d5ce)=>{_0x54cda0=!0x1,_0x21d5ce?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x54cda0=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x54cda0=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4593be=this['locale'],_0x19d46c=new _0x440609(this['locale']),_0x542fd4='ck-ai-form__copy-button';return _0x19d46c['set']({'label':i(_0x4593be,'Copy'),'icon':W,'class':_0x542fd4,'tooltip':!0x0}),_0x19d46c['bind']('isVisible')['to'](this,'value',_0x18c98c=>!!_0x18c98c),_0x19d46c['bind']('isEnabled')['to'](this,'isProcessing',_0x61e004=>!_0x61e004),_0x19d46c['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x19d46c['icon']=_0x191c74['check'],_0x19d46c['class']=_0x542fd4+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x19d46c['icon']=W,_0x19d46c['class']=_0x542fd4;},0x3e8);}),_0x19d46c;}['_copyHTMLToClipboard'](_0x26d134){const {window:_0x59942b,document:_0x40d23c}=_0x2b698f;if(_0x59942b['ClipboardItem']){const {Blob:_0x18d9a0,ClipboardItem:_0x13d6ae}=_0x59942b,_0x2b0333=[new _0x13d6ae({'text/html':new _0x18d9a0([_0x26d134['innerHTML']],{'type':'text/html'}),'text/plain':new _0x18d9a0([_0x26d134['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2b0333);}else{const _0x373826=_0x40d23c['createElement']('div');_0x373826['style']['position']='absolute',_0x373826['style']['left']='-9999px',_0x373826['innerHTML']='<span>[</span>'+_0x26d134['innerHTML']+'<span>]</span>',_0x40d23c['body']['appendChild'](_0x373826);const _0x302b75=_0x40d23c['createRange']();_0x302b75['setStartAfter'](_0x373826['firstElementChild']),_0x302b75['setEndBefore'](_0x373826['lastElementChild']);const _0x4784b5=_0x59942b['getSelection']();_0x4784b5['removeAllRanges'](),_0x4784b5['addRange'](_0x302b75),_0x40d23c['execCommand']('copy'),_0x373826['remove']();}}}class mt extends _0x419f3d{constructor(_0x55505c,_0xc6f80d=''){super(_0x55505c),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xc6f80d,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3f0997){this['element']['innerHTML']=_0x3f0997;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5e0ee8=new _0x419f3d(),_0x3e7114=this['locale'],_0x79f0e7=new _0x1a5dfb();return _0x79f0e7['isVisible']=!0x0,_0x5e0ee8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x79f0e7,{'text':i(_0x3e7114,'AI\x20is\x20writing...')}]}),_0x5e0ee8['render'](),_0x5e0ee8;}}class rt extends _0x419f3d{constructor(_0x365d3c,_0x562fb6=''){super(_0x365d3c);const _0x2da2b1=new _0x44afea(),_0x4ce5b9=this['bindTemplate'];this['set']('text',_0x562fb6),_0x2da2b1['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':[_0x2da2b1,{'text':_0x4ce5b9['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3e69d6,_0x157978){super(_0x3e69d6,_0x157978),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',(_0x37710c,_0x9aacb8)=>{_0x37710c['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x9aacb8());});}['_createSubmitButton'](){const _0x1ad63b=new _0x440609(this['locale']),_0x326263=this['locale'];return _0x1ad63b['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(_0x326263,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1ad63b['on']('execute',()=>{this['submit']();}),_0x1ad63b['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x42a9f3,_0x21b033)=>!_0x42a9f3&&_0x21b033),_0x1ad63b;}['_createShowHistoryButton'](){const _0x6d9aae=new _0x440609(this['locale']),_0x11f05c=this['resultsView'],_0x1c88df=this['locale'];_0x6d9aae['set']({'label':i(_0x1c88df,'History'),'withText':!0x1,'icon':_0x191c74['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x6d9aae['bind']('isOn')['to'](_0x11f05c,'isVisible'),_0x6d9aae['bind']('isEnabled')['to'](this,'isEnabled'),_0x6d9aae['on']('execute',()=>{_0x11f05c['isVisible']=!_0x11f05c['isVisible'],_0x11f05c['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4d06f6=()=>{_0x2b698f['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x1a3852=new st(this['queryView']['fieldView']['element']),_0x46e6ce=_0x1a3852['width'],_0x15a864='rtl'===_0x1c88df['uiLanguageDirection']?'left':'right';_0x1a3852['excludeScrollbarsAndBorders'](),_0x6d9aae['element']['style'][_0x15a864]=_0x46e6ce-_0x1a3852['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4d06f6),this['on']('render',_0x4d06f6),_0x6d9aae;}['submit'](){const _0x40fb7c=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x40fb7c);}['focus'](_0x4144ec){-0x1===_0x4144ec?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x36598d){super(_0x36598d),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x36598d,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x3a828a=0x0;for(const _0xb2f6bc of this['items'])_0x3a828a+=_0xb2f6bc['items']['length'];return{'resultsCount':_0x3a828a,'totalItemsCount':_0x3a828a};}['_createClearHistoryButton'](){const _0x44717c=this['locale'],_0x198f1f=new _0x440609(this['locale']);return _0x198f1f['set']({'label':'('+i(_0x44717c,'Clear')+')','withText':!0x0}),_0x198f1f['on']('execute',()=>this['fire']('clearHistory')),_0x198f1f;}}class hs extends _0x441dee{constructor(_0x236f7d){super();const _0x580cc1=new te(),_0x5f4973=new _0x440609(this['locale'],_0x580cc1);this['children']['add'](_0x5f4973),_0x5f4973['set']({'label':_0x236f7d['prompt'],'withText':!0x0}),_0x5f4973['on']('execute',()=>{this['fire']('execute',{'value':_0x1ea807(_0x236f7d['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x553cb0{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x552971,_0x3b2aa1)=>{const _0x1ab587=Ss(_0x3b2aa1['prompt']);for(const _0xcd5b5d of this)if(_0xcd5b5d!=_0x3b2aa1&&Ss(_0xcd5b5d['prompt'])===_0x1ab587){this['remove'](_0xcd5b5d);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4b3084=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x4b3084));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x551620=>_0x551620)));}}function Ss(_0x3ce5de){return _0x3ce5de['toLowerCase']()['trim']();}class k extends _0x419f3d{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x6a28b9,_0x48d026,_0x36ae8f=''){super(_0x6a28b9),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(_0x6a28b9),this['contentArea']=new X(_0x6a28b9,_0x36ae8f),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 _0x4765e3(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x1d2fca({'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 _0x1d17a1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x48d026],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1d17a1['if']('isError','ck-hidden',_0x2da750=>!_0x2da750)]},'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'](_0x6f8ec5=0x1){-0x1===_0x6f8ec5?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 _0x25a572=this['locale'],_0x3b0dcd=new ht(_0x25a572,{'queryView':{'label':i(_0x25a572,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x40c883,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x25a572,'Empty\x20history'),'secondary':i(_0x25a572,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3b0dcd['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x13bb1d,_0x2d87a5)=>_0x13bb1d&&!_0x2d87a5),this['listenTo'](_0x3b0dcd,'submit',(_0x328b4e,_0x1a7488)=>{this['prompt']=_0x1a7488;const _0x4e489f=_0x42ceca(_0x1a7488);this['fire']('submitPrompt',_0x4e489f),_0x1a7488['trim']()&&this['_promptHistory']['add']({'prompt':_0x4e489f},0x0);},{'priority':'high'}),_0x3b0dcd;}['_createHistoryView'](){const _0x530cd7=new rs(this['locale']);return _0x530cd7['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x530cd7['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x530cd7;}['_createToolbar'](){const _0x5a842c=new at(this['locale']);return _0x5a842c['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x996a26,_0x29adb2,_0x420cdf)=>_0x996a26&&!_0x29adb2&&!!_0x420cdf),_0x5a842c['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5a842c['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3ef602,_0x24833c,_0x5335f1)=>_0x3ef602&&!_0x24833c&&!!_0x5335f1),_0x5a842c['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5a842c['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x753084,_0x12c381)=>_0x753084&&!_0x12c381),_0x5a842c['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5a842c['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5a842c['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5a842c;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x111f5e=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x111f5e,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x125e73){const _0x148d5a=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x125e73||i(_0x148d5a,'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 _0x25032d{['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[_0x488ab5,a,K,_0x4b32b1];}constructor(_0x79727){super(_0x79727),_0x79727['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x79727['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x79727['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x79727['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x30ef2c}=this;this['_aiAdapter']=_0x30ef2c['plugins']['get'](K),this['_dialog']=_0x30ef2c['plugins']['get'](_0x4b32b1),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x144914=new E(_0x30ef2c,Array['from'](this['_commandDefinitions']['values']()));_0x30ef2c['commands']['add']('showAIAssistant',_0x144914),_0x30ef2c['ui']['componentFactory']['add']('aiCommands',_0xc771b9=>{const _0x1ba0d3=_0x1da211(_0xc771b9);return _0x1ba0d3['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1ba0d3['buttonView']['set']({'label':i(_0xc771b9,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x1ba0d3['on']('execute',_0x436e9b=>this['_onExecute'](_0x436e9b['source']['id'])),_0x52b5ee(_0x1ba0d3,_0x30ef2c['ui']['view']['body'],function(_0x4c4ba2){const _0x6b7ebd=o(_0x4c4ba2['config']['get']('ai.aiAssistant.commands'),_0x4c4ba2['locale']),_0x4614a4=U(_0x4c4ba2,_0x6b7ebd)['filter'](_0x6c1449=>_0x6c1449['commands']['length']);if(0x1===_0x4614a4['length'])return U(_0x4c4ba2,_0x4614a4[0x0]['commands'])['map'](_0x2569eb=>({'id':_0x2569eb['id'],'label':_0x2569eb['label']}));return _0x4614a4['map'](_0x59dd48=>{const {groupId:_0xed3a6f,groupLabel:_0x499567,commands:_0x1b2345}=_0x59dd48,_0x5aca3c=U(_0x4c4ba2,_0x1b2345)['map'](_0xff5f88=>({'id':_0xff5f88['id'],'label':_0xff5f88['label']}));return{'id':_0xed3a6f,'menu':_0x499567||_0xed3a6f,'children':_0x5aca3c};});}(_0x30ef2c),{'ariaLabel':i(_0xc771b9,'AI\x20Commands')}),_0x1ba0d3['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x144914['on']('change:enabledCommandsIds',_0x30a96e),_0x1ba0d3['menuView']['once']('render',_0x30a96e),_0x1ba0d3;function _0x30a96e(){_0x1ba0d3['isEnabled']=_0x144914['enabledCommandsIds']['length']>0x0;for(const _0x4f0c98 of _0x1ba0d3['menuView']['buttons'])_0x4f0c98['isEnabled']=_0x144914['enabledCommandsIds']['includes'](_0x4f0c98['id']);}}),_0x30ef2c['ui']['componentFactory']['add']('menuBar:aiCommands',_0xcf47d0=>{const _0x26936a=new _0x5eb759(_0xcf47d0);_0x26936a['buttonView']['set']({'label':i(_0xcf47d0,'AI\x20Commands'),'icon':T}),_0x26936a['bind']('isEnabled')['to'](_0x144914,'enabledCommandsIds',_0x287dcb=>_0x287dcb['length']>0x0);const _0x48e19d=o(_0x30ef2c['config']['get']('ai.aiAssistant.commands'),_0xcf47d0);return this['_populateMenuBarMenu'](_0x144914,_0x26936a,_0x48e19d,_0x1746eb=>this['_onExecute'](_0x1746eb)),_0x26936a;}),_0x30ef2c['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2b23c9=this['_createAIAssistantUIButton'](_0x440609);return _0x2b23c9['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2b23c9;}),_0x30ef2c['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4c7488=this['_createAIAssistantUIButton'](_0x3bff52);return _0x4c7488['set']({'role':'menuitemcheckbox'}),_0x4c7488;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x347bd7=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x17b312;for(const _0x3bcd8b in _0x347bd7){const _0x53c640=_0x3bcd8b,_0x35486c=_0x347bd7[_0x53c640];if('aiLicenseKeyValid'==_0x35486c||'aiLicenseKeyInvalid'==_0x35486c||'aiLicenseKeyExpired'==_0x35486c||'aiLicenseKeyDomainLimit'==_0x35486c||'aiLicenseKeyNotAllowed'==_0x35486c||'aiLicenseKeyEvaluationLimit'==_0x35486c||'aiLicenseKeyTrialLimit'==_0x35486c||'aiLicenseKeyUsageLimit'==_0x35486c){delete _0x347bd7[_0x53c640],_0x17b312=_0x35486c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x17b312&&_0x347bd7['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x17b312&&_0x347bd7['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x17b312&&_0x347bd7['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x17b312&&_0x347bd7['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x17b312&&_0x347bd7['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x17b312&&_0x347bd7['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x17b312&&_0x347bd7['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x24de6b='',_0x38234c='',_0x43adbb='custom'){const _0x63a98b=this['editor'],_0x352e15=_0x63a98b['editing']['view'],_0x38a6bf=_0x63a98b['plugins']['get'](a),_0x5cf54b=_0x63a98b['plugins']['get'](_0x488ab5);_0x38a6bf['showFakeVisualSelection']();const _0x6192e4=new w(),_0xcabc25=new ClipboardEvent('copy',{'clipboardData':_0x6192e4}),_0x4981f3=new _0x1fb7bc(_0x6192e4),_0x1e2849=new _0x175bed(_0x352e15,_0xcabc25,{'dataTransfer':_0x4981f3});_0x5cf54b['_forceMarkersCopy']('comment',()=>{_0x352e15['document']['fire']('copy',_0x1e2849);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x63a98b,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3fb72e=_0x4981f3['getData']('text/html');const _0x13f29f=_0x63a98b['model']['document']['selection'],_0x1502f5=Array['from'](_0x13f29f['getRanges']());0x1===_0x1502f5['length']&&_0x1502f5[0x0]['isFlat']&&!_0x13f29f['getSelectedElement']()&&''!==_0x3fb72e['replace'](/&nbsp;/g,'')['trim']()&&(_0x3fb72e='<p>'+_0x3fb72e+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x43adbb,'query':_0x24de6b,'htmlContent':_0x3fb72e,'label':_0x38234c,'mainActionLabel':M[_0x63a98b['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':_0x440cd1['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x38a6bf['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2a0ec4=new Map(),_0xe39c41=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x18ae93 of _0xe39c41)for(const _0x466564 of _0x18ae93['commands'])_0x2a0ec4['set'](_0x466564['id'],{..._0x466564,'groupId':_0x18ae93['groupId'],'groupLabel':_0x18ae93['groupLabel']||_0x18ae93['groupId']});return _0x2a0ec4;}['_createAIAssistantUIButton'](_0x2ea831){const _0x608bd9=this['editor'],_0x3ca251=_0x608bd9['commands']['get']('showAIAssistant'),_0x1f0754=new _0x2ea831(_0x608bd9['locale']);return _0x1f0754['set']({'label':i(_0x608bd9['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x1f0754['bind']('isEnabled')['to'](_0x3ca251),_0x1f0754['bind']('isOn')['to'](this['_dialog'],'id',_0x34d7c1=>'aiAssistant'===_0x34d7c1),this['listenTo'](_0x1f0754,'execute',()=>{_0x1f0754['isOn']?this['hideUI']():_0x3ca251['execute']();}),_0x1f0754;}['_initView'](){const _0x461cf8=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',()=>{_0x461cf8['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x461cf8['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x25ee32,ui:{ariaLiveAnnouncer:_0x1ef52d}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x4bf028,_0x444378,_0x4f7f4e)=>{const _0x466dad=this['_aiAssistantController']['currentContext'];_0x4f7f4e?_0x1ef52d['announce'](i(_0x25ee32,'AI\x20is\x20writing')):_0x466dad&&_0x1ef52d['announce'](i(_0x25ee32,'Generated\x20content:\x20%0',_0x466dad),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x4cd89f,_0x2349c1,_0x2d0937)=>{if(_0x2d0937){const _0x20641c=this['_formView']['errorView']['text'];_0x1ef52d['announce'](i(_0x25ee32,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x20641c));}});}['_onExecute'](_0x25ce58){const _0x5985cf=this['_commandDefinitions']['get'](_0x25ce58),_0x391c94=this['editor'],_0x53abd3=_0x391c94['model']['document']['selection'],_0x5e9030=_0x391c94['commands']['get']('showAIAssistant'),_0x1440e7=_0x391c94['plugins']['get'](a),_0x1ddde3=''+(_0x5985cf['groupId']!==x?_0x5985cf['groupLabel']+':\x20':'')+_0x5985cf['label'];if(!0x1!==_0x5985cf['requiresContent']&&_0x53abd3['isCollapsed']){const _0x217258=_0xac57c1(_0x53abd3['getSelectedBlocks']())||_0x391c94['model']['schema']['getLimitElement'](_0x53abd3);_0x391c94['model']['change'](_0x4c8a5d=>{_0x4c8a5d['setSelection'](_0x217258,'in');});}_0x1440e7['showFakeVisualSelection'](),_0x5e9030['execute'](_0x5985cf['prompt'],_0x1ddde3,'command:'+_0x25ce58);}['_populateMenuBarMenu'](_0x1ad38e,_0x14700d,_0x1263e1,_0x5114b6){const _0x259157=this['editor'],_0x2ca071=_0x259157['locale'],_0x5bd8fe=new _0x2e663f(_0x2ca071),_0x30b943=U(_0x259157,_0x1263e1)['filter'](_0xdb4d44=>_0xdb4d44['commands']['length']);0x1===_0x30b943['length']?this['_getMenuBarGroupButtons']({'command':_0x1ad38e,'commands':_0x30b943[0x0]['commands'],'parentMenuView':_0x14700d,'onExecute':_0x5114b6})['forEach'](_0xc1ff37=>_0x5bd8fe['items']['add'](_0xc1ff37)):_0x30b943['forEach'](({groupId:_0x5a5955,groupLabel:_0x13c198,commands:_0xc98c3a})=>{const _0x19d145=new _0x3950ea(_0x2ca071,_0x14700d),_0x51ec81=new _0x5eb759(_0x2ca071),_0x28d910=new _0x2e663f(_0x2ca071),_0x2d549d=this['_getMenuBarGroupButtons']({'command':_0x1ad38e,'commands':_0xc98c3a,'parentMenuView':_0x51ec81,'onExecute':_0x5114b6});_0x51ec81['buttonView']['set']({'label':_0x13c198||_0x5a5955}),_0x51ec81['delegate']('execute')['to'](_0x14700d),_0x28d910['items']['addMany'](_0x2d549d),_0x51ec81['panelView']['children']['add'](_0x28d910),_0x19d145['children']['add'](_0x51ec81),_0x5bd8fe['items']['add'](_0x19d145);}),_0x14700d['panelView']['children']['add'](_0x5bd8fe);}['_getMenuBarGroupButtons']({command:_0x5a5da5,commands:_0xc14fe1,parentMenuView:_0x3fe6f3,onExecute:_0x42b69a}){const _0x13b172=this['editor'],_0x503ac0=_0x13b172['locale'];return U(_0x13b172,_0xc14fe1)['map'](_0x51c48a=>{const _0x1d6527=new _0x3950ea(_0x503ac0,_0x3fe6f3),_0x303ab2=new _0x3bff52(_0x503ac0);return _0x303ab2['set']({'label':_0x51c48a['label']}),_0x303ab2['delegate']('execute')['to'](_0x3fe6f3),_0x303ab2['on']('execute',()=>_0x42b69a(_0x51c48a['id'])),_0x303ab2['bind']('isEnabled')['to'](_0x5a5da5,'enabledCommandsIds',_0x329aec=>_0x329aec['includes'](_0x51c48a['id'])),_0x1d6527['children']['add'](_0x303ab2),_0x1d6527;});}}function B(_0x209ea8,_0xb15802){return void 0x0!==_0x209ea8['order']&&void 0x0===_0xb15802['order']?0x1:void 0x0===_0x209ea8['order']&&void 0x0!==_0xb15802['order']?-0x1:void 0x0!==_0x209ea8['order']&&void 0x0!==_0xb15802['order']?_0x209ea8['order']-_0xb15802['order']:0x0;}function U(_0x4b92cb,_0x24c601){_0x24c601['sort'](B);const _0x3f15b6={},_0x1b8d88=[];for(const _0x2815b4 of _0x24c601)if(void 0x0!==_0x2815b4['order']){if(_0x2815b4['order']in _0x3f15b6)throw new _0x17367d('ai-commands-config-order-collision',_0x4b92cb,{'conflictingDefinitions':[_0x2815b4,_0x3f15b6[_0x2815b4['order']]]});_0x3f15b6[_0x2815b4['order']]=_0x2815b4,_0x1b8d88['splice'](_0x2815b4['order'],0x0,_0x2815b4);}else _0x1b8d88['push'](_0x2815b4);return _0x1b8d88;}class r extends _0x25032d{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x45097b){super(_0x45097b);const _0x2898dd=_0x45097b['config'],_0x1d7fbd=_0x45097b['locale'];_0x2898dd['define']('ai.aiAssistant.preserveComments',!0x0),_0x2898dd['define']('ai.aiAssistant.commands',function(_0x5e60e4){return[{'groupId':'editOrReview','groupLabel':i(_0x5e60e4,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x5e60e4,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x5e60e4,'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(_0x5e60e4,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x5e60e4,'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(_0x5e60e4,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x5e60e4,'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(_0x5e60e4,'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(_0x5e60e4,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x5e60e4,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x5e60e4,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x5e60e4,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x5e60e4,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x5e60e4,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x5e60e4,'Change\x20style'),'commands':[{'id':'business','label':i(_0x5e60e4,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x5e60e4,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x5e60e4,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x5e60e4,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x5e60e4,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x5e60e4,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x5e60e4,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x5e60e4,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x5e60e4,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x5e60e4,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x5e60e4,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x5e60e4,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x5e60e4,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x1d7fbd)),_0x2898dd['define']('ai.aiAssistant.extraCommandGroups',[]),_0x2898dd['define']('ai.aiAssistant.removeCommands',[]);let _0x1ee60f=o(_0x2898dd['get']('ai.aiAssistant.commands'),_0x1d7fbd);const _0x25bccb=_0x2898dd['get']('ai.aiAssistant.extraCommandGroups'),_0xc84487=_0x2898dd['get']('ai.aiAssistant.removeCommands');_0x25bccb['forEach'](_0xef840a=>{const _0x34ef79=_0x1ee60f['find'](_0x30cbf0=>_0x30cbf0['groupId']===_0xef840a['groupId']);_0x34ef79?_0x34ef79['commands']=_0x34ef79['commands']['concat'](_0xef840a['commands']):_0x1ee60f['push'](_0xef840a);}),_0x1ee60f=_0x1ee60f['filter'](_0x14e4ce=>!_0xc84487['includes'](_0x14e4ce['groupId'])),_0x1ee60f['forEach'](_0x2046fc=>{_0x2046fc['commands']=_0x2046fc['commands']['filter'](_0x9c5f42=>!_0xc84487['includes'](_0x9c5f42['id']));}),_0x2898dd['set']('ai.aiAssistant.commands',_0x1ee60f);}}class P extends _0x25032d{['abortController'];static get['requires'](){return[K];}constructor(_0x3838bf){super(_0x3838bf),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'](_0x2f6ca7){return this['sendRequest'](_0x2f6ca7)['catch'](_0x58845e=>{if(_0x58845e instanceof R)return Promise['reject'](_0x58845e);if('AbortError'==_0x58845e['name'])return Promise['resolve']();throw console['error'](_0x58845e),new _0x17367d('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1dedda,_0x1d80f2){const _0x17d7d6=this['editor']['locale'],_0x32c6cd={'Content-Type':'application/json'};if('object'==typeof _0x1dedda)Object['assign'](_0x32c6cd,_0x1dedda);else{if(_0x1dedda)try{const _0x1556a5=await _0x1dedda(_0x1d80f2);Object['assign'](_0x32c6cd,_0x1556a5);}catch(_0x2268e4){return Promise['reject'](new R(i(_0x17d7d6,'AI_ERROR_GET_HEADERS')));}}return _0x32c6cd;}async['_prepareRequestParameters'](_0x9585a3,_0x2bae01){const _0x36b296=this['editor']['locale'];if('object'==typeof _0x9585a3)return _0x9585a3;try{return await _0x9585a3(_0x2bae01);}catch(_0x46704b){return Promise['reject'](new R(i(_0x36b296,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x98e5cb){super(_0x98e5cb),_0x98e5cb['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x98e5cb['config']['get']('ai.openAI.requestParameters')||_0x98e5cb['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x98e5cb['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x98e5cb['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x98e5cb['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x375f4c,context:_0x38a47a,onData:_0x4596fc,actionId:_0x487bf5}){const _0x2dea4e=this['editor']['locale'],_0x2ae4bf=await this['prepareMessages'](_0x375f4c,_0x38a47a,_0x487bf5),_0x55dd68=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x487bf5),_0x31d31f=await this['_prepareRequestParameters'](this['_requestParameters'],_0x487bf5),_0x5c1d74={'messages':_0x2ae4bf,..._0x31d31f},_0x53dc45={'method':'POST','headers':_0x55dd68,'body':JSON['stringify'](_0x5c1d74),'signal':this['abortController']['signal']},_0x3c7568=await fetch(this['_apiUrl'],_0x53dc45);if(_0x3c7568['ok'])return _0x31d31f['stream']?await this['_readStreamableResponse'](_0x3c7568,_0x4596fc):await this['_readStaticResponse'](_0x3c7568,_0x4596fc),Promise['resolve']();{const _0x4b3bae=await _0x3c7568['text']();return _0x4b3bae['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x2dea4e,'AI_ERROR_CONTEXT_LENGTH'))):_0x4b3bae['includes']('Moderation')?Promise['reject'](new R(i(_0x2dea4e,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x4b3bae));}}async['prepareMessages'](_0x2b2e6f,_0x1fffc1,_0x769f3){let _0x14f1d7,_0x248303;return _0x1fffc1?(_0x14f1d7='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.',_0x248303='Instruction:\x0a'+_0x2b2e6f+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1fffc1):(_0x14f1d7='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.',_0x248303=_0x2b2e6f),[{'role':'system','content':_0x14f1d7},{'role':'user','content':_0x248303}];}async['_readStreamableResponse'](_0x47c634,_0x3a92b8){const _0x278a26=_0x47c634['body']['getReader'](),_0x30d95a=new TextDecoder();let _0x2326a6='',_0x4b0bba='',_0x2084e2='',_0x101836=!0x1;for(;!_0x101836;){const {done:_0x15910c,value:_0x43326b}=await _0x278a26['read'](),_0x304548=_0x2326a6+_0x30d95a['decode'](_0x43326b);let _0x4e5b66='';_0x101836=_0x15910c;try{_0x4e5b66=this['_cleanUpData'](_0x304548),_0x2326a6='';}catch(_0x4af6d9){_0x2326a6=_0x304548;continue;}_0x4b0bba+=_0x4e5b66,!_0x101836&&this['_isBufferIncomplete'](_0x4b0bba)||_0x4b0bba&&(_0x2084e2+=_0x4b0bba,_0x4b0bba='',_0x3a92b8(_0x2084e2));}return Promise['resolve']();}async['_readStaticResponse'](_0x1fa3fe,_0x218a03){return _0x218a03((await _0x1fa3fe['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3bc951){const _0x4a544a=_0x3bc951['split']('<')['length']!==_0x3bc951['split']('>')['length'],_0x105b9d=_0x3bc951['length']<0x1e;return _0x4a544a&&_0x105b9d;}['_cleanUpData'](_0x4e8a8b){return _0x4e8a8b['split'](/\n(?![^{]*\})/g)['map'](_0x519b8f=>_0x519b8f['replace']('data:\x20',''))['filter'](_0x213804=>_0x213804&&_0x213804['length']>0x0&&'[DONE]'!==_0x213804)['map'](_0x45fa88=>{const {choices:_0x44eb31}=JSON['parse'](_0x45fa88);if(_0x44eb31[0x0]&&_0x44eb31[0x0]['delta']&&_0x44eb31[0x0]['delta']['content'])return _0x44eb31[0x0]['delta']['content'];})['filter'](_0x4d5d41=>_0x4d5d41)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2ebc20){super(_0x2ebc20),_0x2ebc20['config']['get']('ai.aws.requestParameters')||_0x2ebc20['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']=_0x2ebc20['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x2ebc20['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2ebc20['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x2ebc20['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x303f3b,context:_0x1b0bde,onData:_0x306474,actionId:_0x2418f7}){const {model:_0x1834f2,stream:_0x5e75df,..._0x499f33}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2418f7),_0x1293c1={'prompt':await this['preparePrompt'](_0x303f3b,_0x1b0bde,_0x1834f2,_0x2418f7),..._0x499f33};this['_apiUrl']?await this['_processProxyRequest'](_0x1293c1,_0x1834f2,_0x5e75df,_0x306474,_0x2418f7):await this['_processAWSRequest'](_0x1293c1,_0x1834f2,_0x5e75df,_0x306474);}async['preparePrompt'](_0x387030,_0x40ec67,_0x17292f,_0x1f7ba1){let _0x3725f3,_0x73d654;return _0x40ec67?(_0x3725f3='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.',_0x73d654='Instruction:\x0a'+_0x387030+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x40ec67):(_0x3725f3='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.',_0x73d654=_0x387030),'meta.llama'==this['getModelFamily'](_0x17292f)?'<<SYS>>\x0a'+_0x3725f3+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x73d654+'\x0a[/INST]':'Human:\x0a'+_0x3725f3+'\x0a'+_0x73d654+'\x0a\x0aAssistant:';}['getModelFamily'](_0x50a23d){if(/^anthropic\.claude/['test'](_0x50a23d))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x50a23d))return'ai21.j2';if(/^cohere\.command/['test'](_0x50a23d))return'cohere.command';if(/^meta\.llama/['test'](_0x50a23d))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x50a23d));}async['_processProxyRequest'](_0x2c4d1f,_0x3983f2,_0x2fa47e,_0x55993a,_0x360e1d){const _0x529d1e={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x360e1d),'body':JSON['stringify']({..._0x2c4d1f,'model':_0x3983f2,'stream':_0x2fa47e}),'signal':this['abortController']['signal']},_0x334f9e=await fetch(this['_apiUrl'],_0x529d1e);_0x2fa47e?await this['_readStreamableResponse'](_0x334f9e,_0x3983f2,_0x55993a):await this['_readStaticResponse'](_0x334f9e,_0x3983f2,_0x55993a);}async['_processAWSRequest'](_0x1fa9b7,_0x3187a0,_0x43fad4,_0xaaabb4){const _0x15a022=new _0x13de27(this['_bedrockClientConfig']),_0x1c2711={'body':JSON['stringify'](_0x1fa9b7),'contentType':'application/json','accept':'application/json','modelId':_0x3187a0};let _0x1ba588;if(_0x43fad4){const _0x414990=new _0x2a5150(_0x1c2711);_0x1ba588=await _0x15a022['send'](_0x414990,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x1ba588,_0x3187a0,_0xaaabb4);}else{const _0x3e3680=new _0x497e16(_0x1c2711);_0x1ba588=await _0x15a022['send'](_0x3e3680,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x1ba588,_0x3187a0,_0xaaabb4);}}async['_readAsyncIterableResponse'](_0x280bcd,_0x5eef24,_0x42be7e){const _0x2b7d86=_0x280bcd['body'],_0x53f8e9=new TextDecoder('utf-8');let _0xb5e671='';for await(const _0x201513 of _0x2b7d86)if(_0x201513['chunk']){const _0x167d52=_0x53f8e9['decode'](_0x201513['chunk']['bytes']),_0x2fa1ed=JSON['parse'](_0x167d52);_0xb5e671+=this['_getGeneratedText'](_0x2fa1ed,_0x5eef24),_0x42be7e(_0xb5e671);}return Promise['resolve']();}async['_readStreamableResponse'](_0x42f924,_0x1824b1,_0x3721bb){const _0x339649=_0x42f924['body'],_0x2cc4fe=new TextDecoder('utf-8'),_0x580122=_0x339649['getReader']();let _0x43ff58='',_0x1e3200='',_0x40d4ad=!0x1;for(;!_0x40d4ad;){const {done:_0x1d50f7,value:_0x367703}=await _0x580122['read']();if(_0x40d4ad=_0x1d50f7,_0x40d4ad)break;const _0x1e8b1c=(_0x43ff58+_0x2cc4fe['decode'](_0x367703))['split']('\x0a')['map'](_0x339d67=>{try{return _0x43ff58='',JSON['parse'](_0x339d67);}catch(_0x3e91bc){return _0x43ff58=_0x339d67,null;}})['filter'](_0x2db575=>null!==_0x2db575);_0x1e8b1c['length']&&(_0x1e3200+=_0x1e8b1c['map'](_0x11be1b=>this['_getGeneratedText'](_0x11be1b,_0x1824b1))['join'](''),_0x3721bb(_0x1e3200));}return Promise['resolve']();}async['_readStaticResponse'](_0x132291,_0x43b1f5,_0x53f72d){let _0x5b9523;return _0x5b9523=_0x132291 instanceof Response?await _0x132291['json']():JSON['parse'](Buffer['from'](_0x132291['body'])['toString']('utf8')),(_0x53f72d(this['_getGeneratedText'](_0x5b9523,_0x43b1f5)),Promise['resolve']());}['_getGeneratedText'](_0x452ad4,_0x444549){switch(this['getModelFamily'](_0x444549)){case'anthropic.claude':return _0x452ad4['completion'];case'ai21.j2':return _0x452ad4['completions'][0x0]['data']['text'];case'cohere.command':return _0x452ad4['generations'][0x0]['text'];case'meta.llama':return _0x452ad4['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0xad2be2=>0x1!=_0xad2be2}};
23
+ export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x5d41e5=>0x1!=_0x5d41e5}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x44ae34=>{const {af:{dictionary:_0x4301a2,getPluralForm:_0x3a116a}}={'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x54ca85=>0x1!=_0x54ca85}};_0x44ae34['af']||={'dictionary':{},'getPluralForm':null},_0x44ae34['af']['dictionary']=Object['assign'](_0x44ae34['af']['dictionary'],_0x4301a2),_0x44ae34['af']['getPluralForm']=_0x3a116a;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x2c2a08=>{const {af:{dictionary:_0x31669d,getPluralForm:_0x20c016}}={'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x11912a=>0x1!=_0x11912a}};_0x2c2a08['af']||={'dictionary':{},'getPluralForm':null},_0x2c2a08['af']['dictionary']=Object['assign'](_0x2c2a08['af']['dictionary'],_0x31669d),_0x2c2a08['af']['getPluralForm']=_0x20c016;})(window['CKEDITOR_TRANSLATIONS']||={});
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x4ec25a=>0x0==_0x4ec25a?0x0:0x1==_0x4ec25a?0x1:0x2==_0x4ec25a?0x2:_0x4ec25a%0x64>=0x3&&_0x4ec25a%0x64<=0xa?0x3:_0x4ec25a%0x64>=0xb?0x4:0x5}};
23
+ export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x184cdd=>0x0==_0x184cdd?0x0:0x1==_0x184cdd?0x1:0x2==_0x184cdd?0x2:_0x184cdd%0x64>=0x3&&_0x184cdd%0x64<=0xa?0x3:_0x184cdd%0x64>=0xb?0x4:0x5}};