@ckeditor/ckeditor5-ai 46.0.0-alpha.0 → 46.0.0-alpha.2

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 (171) 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/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +9 -9
  150. package/src/adapters/aiadapter.js +1 -1
  151. package/src/adapters/aitextadapter.js +1 -1
  152. package/src/adapters/awstextadapter.js +1 -1
  153. package/src/adapters/openaitextadapter.d.ts +1 -2
  154. package/src/adapters/openaitextadapter.js +1 -1
  155. package/src/aiassistant.js +1 -1
  156. package/src/aiassistantediting.js +1 -1
  157. package/src/aiassistantui.js +1 -1
  158. package/src/index.js +1 -1
  159. package/src/legacyerrors.js +1 -1
  160. package/src/ui/aiassistantcontroller.js +2 -2
  161. package/src/ui/form/aiformcontentarea.js +1 -1
  162. package/src/ui/form/aiformerrorview.js +1 -1
  163. package/src/ui/form/aiformpromptview.js +1 -1
  164. package/src/ui/form/aiformtoolbarview.js +1 -1
  165. package/src/ui/form/aiformview.js +1 -1
  166. package/src/ui/form/aihistorylistitemview.js +1 -1
  167. package/src/ui/form/aihistorylistview.js +1 -1
  168. package/src/ui/form/prompthistory.js +1 -1
  169. package/src/ui/showaiassistantcommand.js +1 -1
  170. package/src/utils/common-translations.js +1 -1
  171. 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 _0x10bc3a,Command as _0x15f716}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2a92e5,IconCheck as _0x1fe880,IconError as _0x4492c5,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x3fba16,IconRobotPencil as _0x13700b}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x4fc4a8,CKEditorError as _0x392644,ObservableMixin as _0xd58f3b,global as _0x330e0d,isVisible as _0xeb7e24,Rect as _0xccd7cf,Collection as _0x316043,FocusTracker as et,KeystrokeHandler as rt,first as _0x44987d}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x4e6ac4,View as _0x23ffe4,SpinnerView as _0x50bc2a,IconView as _0x276037,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x243330,createDropdown as _0x3cb5fc,addMenuToDropdown as _0xd9c24b,MenuBarMenuView as _0x4e7f31,MenuBarMenuListItemButtonView as _0x26a9a5,DialogViewPosition as _0x546376,MenuBarMenuListView as _0x169506,MenuBarMenuListItemView as _0x581f49}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x165414,ClipboardMarkersUtils as _0x480aee}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x546334,ViewDataTransfer as _0x1610c3,ViewUpcastWriter as _0x598e62,Matcher as _0x5b879c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x2f9aa6,InvokeModelWithResponseStreamCommand as _0x8108be,InvokeModelCommand as _0x5e0609}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x35ac57,_0x4ebe1f){const _0x13551b=(0x0,_0x4ebe1f['t'])('Other');return _0x35ac57['length']?'groupId'in _0x35ac57[0x0]?_0x35ac57:[{'groupId':K,'groupLabel':_0x13551b,'order':0x1/0x0,'commands':_0x35ac57}]:[{'groupId':K,'groupLabel':_0x13551b,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x10bc3a{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x527101}=this,_0x2f9ddc=['ck-fake-ai-selection'];_0x527101['config']['get']('ai.useTheme')&&_0x2f9ddc['push']('ck-ai-assistant-ui_theme'),_0x527101['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x2f9ddc,'priority':0xc}}),_0x527101['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x437be3,{writer:_0x46df13})=>{if(!_0x437be3['markerRange']['isCollapsed'])return null;const _0x56ee1f=_0x46df13['createUIElement']('span');return _0x46df13['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x56ee1f),_0x56ee1f;}});}['afterInit'](){!async function(_0x28d872){const _0x579e8e=_0x13ec21([0x53,0x65,0x57,0x5a,0x6f,0x78,0x49,0x4c,0x50,0x35,0x74,0x42,0x68,0x32,0x31,0x58,0x6d,0x79,0x4d,0x6c,0x30,0x4e,0x52,0x64,0x33,0x54,0x51,0x48,0x45,0x73,0x6b,0x72,0x4a,0x76,0x43,0x77,0x47,0x71,0x55,0x61,0x63,0x56,0x44,0x4f,0x4b,0x46,0x37,0x59,0x62,0x67,0x70,0x34,0x38,0x75,0x66,0x36,0x6a,0x7a,0x41,0x6e,0x39,0x69]),_0x50588c=0x23b6d058,_0x344cc3=0x23b1bc08^_0x50588c,_0x56e8e4=window[_0x13ec21([0x44,0x61,0x74,0x65])][_0x13ec21([0x6e,0x6f,0x77])](),_0x146a9e=_0x28d872[_0x13ec21([0x65,0x64,0x69,0x74,0x6f,0x72])],_0xe6d7c6=new window[(_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3eeb78=>{_0x146a9e[_0x13ec21([0x6f,0x6e,0x63,0x65])](_0x13ec21([0x72,0x65,0x61,0x64,0x79]),_0x3eeb78);}),_0x35f492={[_0x13ec21([0x6b,0x74,0x79])]:_0x13ec21([0x45,0x43]),[_0x13ec21([0x75,0x73,0x65])]:_0x13ec21([0x73,0x69,0x67]),[_0x13ec21([0x63,0x72,0x76])]:_0x13ec21([0x50,0x2d,0x32,0x35,0x36]),[_0x13ec21([0x78])]:_0x13ec21([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]),[_0x13ec21([0x79])]:_0x13ec21([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]),[_0x13ec21([0x61,0x6c,0x67])]:_0x13ec21([0x45,0x53,0x32,0x35,0x36])},_0xed7b59=_0x146a9e[_0x13ec21([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x13ec21([0x67,0x65,0x74])](_0x13ec21([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x54d1f0(){let _0x49c81d,_0x4df27a=null,_0x151a01=null;try{if(_0xed7b59==_0x13ec21([0x47,0x50,0x4c]))return _0x13ec21([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x49c81d=_0x2534d1(),!_0x49c81d)return _0x13ec21([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x49c81d[_0x13ec21([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x151a01=_0x237bae(_0x49c81d[_0x13ec21([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x49c81d[_0x13ec21([0x6a,0x74,0x69])])),await _0x378bbb()?_0x367278()?_0x34571c()?_0x13ec21([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2d5dc7()?(_0x49c81d[_0x13ec21([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x13ec21([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4df27a=_0x5e92dd(_0x13ec21([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x49c81d[_0x13ec21([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x13ec21([0x74,0x72,0x69,0x61,0x6c])&&(_0x4df27a=_0x5e92dd(_0x13ec21([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4c3539()):_0x13ec21([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x13ec21([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x13ec21([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x13ec21([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x34571c(){const _0x537fc5=[_0x13ec21([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x13ec21([0x74,0x72,0x69,0x61,0x6c])][_0x13ec21([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x49c81d[_0x13ec21([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x56e8e4/0x3e8:0xe10*_0x344cc3;return _0x49c81d[_0x13ec21([0x65,0x78,0x70])]<_0x537fc5;}function _0x367278(){const _0x58b6f3=_0x49c81d[_0x13ec21([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x58b6f3&&(!!_0x58b6f3[_0x13ec21([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x13ec21([0x2a]))||!!_0x58b6f3[_0x13ec21([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x13ec21([0x41,0x49])));}function _0x2d5dc7(){const _0x5a27b3=_0x49c81d[_0x13ec21([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5a27b3||0x0==_0x5a27b3[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x400b92}=new URL(window[_0x13ec21([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5a27b3[_0x13ec21([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x400b92))return!0x0;const _0x545b89=_0x400b92[_0x13ec21([0x73,0x70,0x6c,0x69,0x74])](_0x13ec21([0x2e]));return _0x5a27b3[_0x13ec21([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x23758b=>_0x23758b[_0x13ec21([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x13ec21([0x2a])))[_0x13ec21([0x6d,0x61,0x70])](_0x491fe2=>_0x491fe2[_0x13ec21([0x73,0x70,0x6c,0x69,0x74])](_0x13ec21([0x2e])))[_0x13ec21([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1273b8=>_0x1273b8[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x545b89[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x13ec21([0x6d,0x61,0x70])](_0x341297=>Array(_0x545b89[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x341297[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x13ec21([0x66,0x69,0x6c,0x6c])](_0x341297[0x0]===_0x13ec21([0x2a])?_0x13ec21([0x2a]):'')[_0x13ec21([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x341297))[_0x13ec21([0x73,0x6f,0x6d,0x65])](_0x59d461=>_0x545b89[_0x13ec21([0x65,0x76,0x65,0x72,0x79])]((_0xc77027,_0x49023e)=>_0x59d461[_0x49023e]===_0xc77027||_0x59d461[_0x49023e]===_0x13ec21([0x2a])));}function _0x4c3539(){return _0x4df27a&&_0x151a01?new window[(_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2ddcd2,_0x537924)=>{_0x4df27a[_0x13ec21([0x74,0x68,0x65,0x6e])](_0x2ddcd2,_0x537924),_0x151a01[_0x13ec21([0x74,0x68,0x65,0x6e])](_0x4e6be7=>{_0x4e6be7!=_0x13ec21([0x56,0x61,0x6c,0x69,0x64])&&_0x2ddcd2(_0x4e6be7);},_0x537924);}):_0x4df27a||_0x151a01||_0x13ec21([0x56,0x61,0x6c,0x69,0x64]);}}function _0x237bae(_0x3ae74b,_0x2e4857){return new window[(_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x169859=>{if(_0xbeb935())return _0x169859(_0x13ec21([0x56,0x61,0x6c,0x69,0x64]));_0x58b53a(),_0x146a9e[_0x13ec21([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x13ec21([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x21d1d4=!0x1;const _0x3079ef=_0x4fc4a8();function _0x30bfca(_0x2cef7b){return!!_0x2cef7b&&(typeof _0x2cef7b===_0x13ec21([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2cef7b===_0x13ec21([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2cef7b[_0x13ec21([0x74,0x68,0x65,0x6e])]===_0x13ec21([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2cef7b[_0x13ec21([0x63,0x61,0x74,0x63,0x68])]===_0x13ec21([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5b4591(_0x3eed83){_0x39de67(_0x3eed83)[_0x13ec21([0x74,0x68,0x65,0x6e])](_0x5fb0a5=>{if(!_0x5fb0a5||_0x5fb0a5[_0x13ec21([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x13ec21([0x6f,0x6b]))return _0x13ec21([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x37cf16(_0x544d61(_0x3079ef+_0x2e4857))!=_0x5fb0a5[_0x13ec21([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x13ec21([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x13ec21([0x56,0x61,0x6c,0x69,0x64]);})[_0x13ec21([0x74,0x68,0x65,0x6e])](_0x208bec=>(_0x10973c(),_0x208bec),()=>{const _0x2a80cd=_0x3b440c();return null==_0x2a80cd?(_0x10973c(),_0x13ec21([0x56,0x61,0x6c,0x69,0x64])):_0x13ec21(_0x56e8e4-_0x2a80cd>(0x7ba5458^_0x50588c)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x13ec21([0x74,0x68,0x65,0x6e])](_0x169859)[_0x13ec21([0x63,0x61,0x74,0x63,0x68])](()=>{_0x169859(_0x13ec21([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2ede29=0x23803ed8^_0x50588c;function _0x10973c(){const _0x33a293=_0x13ec21([0x6c,0x6c,0x63,0x74,0x2d])+_0x37cf16(_0x544d61(_0x3ae74b)),_0x8b5c7e=_0x3f6a23(_0x37cf16(window[_0x13ec21([0x4d,0x61,0x74,0x68])][_0x13ec21([0x63,0x65,0x69,0x6c])](_0x56e8e4/_0x2ede29)));window[_0x13ec21([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x13ec21([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x33a293,_0x8b5c7e);}function _0x3b440c(){const _0x6417af=_0x13ec21([0x6c,0x6c,0x63,0x74,0x2d])+_0x37cf16(_0x544d61(_0x3ae74b)),_0x59f6c6=window[_0x13ec21([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x13ec21([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x6417af);return _0x59f6c6?window[_0x13ec21([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3f6a23(_0x59f6c6),0x10)*_0x2ede29:null;}function _0x39de67(_0x501d97){return new window[(_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x174237,_0x37b621)=>{_0x501d97[_0x13ec21([0x74,0x68,0x65,0x6e])](_0x174237,_0x37b621),window[_0x13ec21([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x37b621,0x23b70498^_0x50588c);});}}_0x146a9e[_0x13ec21([0x6f,0x6e])](_0x13ec21([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x25ada5,_0x24a0bc)=>{if(_0x24a0bc[0x0]!=_0x3ae74b)return _0x169859(_0x13ec21([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x24a0bc[0x1]={..._0x24a0bc[0x1],[_0x13ec21([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3079ef};},{[_0x13ec21([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x13ec21([0x68,0x69,0x67,0x68])}),_0x146a9e[_0x13ec21([0x6f,0x6e])](_0x13ec21([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x276ca1=>{_0x30bfca(_0x276ca1[_0x13ec21([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x21d1d4=!0x0,_0x5b4591(_0x276ca1[_0x13ec21([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x13ec21([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x13ec21([0x6c,0x6f,0x77])}),_0xe6d7c6[_0x13ec21([0x74,0x68,0x65,0x6e])](()=>{_0x21d1d4||_0x169859(_0x13ec21([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0xbeb935(){return _0x146a9e[_0x13ec21([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x13ec21([0x76,0x69,0x65,0x77])][_0x13ec21([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x13ec21([0x61,0x75,0x74,0x6f]);}function _0x58b53a(){_0x146a9e[_0x13ec21([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x13ec21([0x76,0x69,0x65,0x77])][_0x13ec21([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x13ec21([0x61,0x75,0x74,0x6f]);}}function _0x5e92dd(_0x25e2d2){const _0x5ce047=[new window[(_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1f0d54=>setTimeout(_0x1f0d54,0x23bfee94^_0x50588c)),_0xe6d7c6[_0x13ec21([0x74,0x68,0x65,0x6e])](()=>new window[(_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2407d7=>{let _0x1ef850=0x0;_0x146a9e[_0x13ec21([0x6d,0x6f,0x64,0x65,0x6c])][_0x13ec21([0x6f,0x6e])](_0x13ec21([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3dc0ac,_0x4ddbcb)=>{_0x4ddbcb[0x0][_0x13ec21([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1ef850++,_0x1ef850==(0x23b6d1a0^_0x50588c)&&(_0x2407d7(),_0x3dc0ac[_0x13ec21([0x6f,0x66,0x66])]());});}))];return window[_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x13ec21([0x72,0x61,0x63,0x65])](_0x5ce047)[_0x13ec21([0x74,0x68,0x65,0x6e])](()=>_0x25e2d2);}async function _0x23c061(){await _0xe6d7c6,_0x146a9e[_0x13ec21([0x6d,0x6f,0x64,0x65,0x6c])][_0x13ec21([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x13dee9,_0x146a9e[_0x13ec21([0x6d,0x6f,0x64,0x65,0x6c])][_0x13ec21([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x13dee9,_0x146a9e[_0x13ec21([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x13ec21([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x287a06(_0x546fa9){const _0x103f17=_0x1769aa();_0x146a9e[_0x103f17]=_0x13ec21([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x546fa9,_0x546fa9!=_0x13ec21([0x56,0x61,0x6c,0x69,0x64])&&_0x23c061();}function _0x1769aa(){const _0x2cb572=window[_0x13ec21([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x13ec21([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x13ec21([0x6e,0x6f,0x77])]())[_0x13ec21([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x13ec21([0x2e]),'');let _0x272ce7=_0x13ec21([0x53]);for(let _0x2eddfe=0x0;_0x2eddfe<_0x2cb572[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2eddfe+=0x2){let _0x32c114=window[_0x13ec21([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2cb572[_0x13ec21([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2eddfe,_0x2eddfe+0x2));_0x32c114>=_0x579e8e[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x32c114-=_0x579e8e[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x272ce7+=_0x579e8e[_0x32c114];}return _0x272ce7;}function _0x2534d1(){const _0xb34930=_0xed7b59[_0x13ec21([0x73,0x70,0x6c,0x69,0x74])](_0x13ec21([0x2e]));if(0x3!=_0xb34930[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4a4163(_0xb34930[0x1]);function _0x4a4163(_0x447245){const _0x4a6e43=_0x8a5e9b(_0x447245);return _0x4a6e43&&_0x84559d()?_0x4a6e43:null;function _0x84559d(){const _0x5a9bb3=_0x4a6e43[_0x13ec21([0x6a,0x74,0x69])],_0x1cf382=window[_0x13ec21([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5a9bb3[_0x13ec21([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5a9bb3[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2dc805={..._0x4a6e43,[_0x13ec21([0x6a,0x74,0x69])]:_0x5a9bb3[_0x13ec21([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x5a9bb3[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2dc805[_0x13ec21([0x76,0x63])],_0x544d61(_0x2dc805)==_0x1cf382;}}}async function _0x378bbb(){let _0x210070=!0x0;try{const _0x14f88b=_0xed7b59[_0x13ec21([0x73,0x70,0x6c,0x69,0x74])](_0x13ec21([0x2e])),[_0x4d5c23,_0x6ee6f6,_0x27cd70]=_0x14f88b;return _0x445cc9(_0x4d5c23),await _0x488bac(_0x4d5c23,_0x6ee6f6,_0x27cd70),_0x210070;}catch{return!0x1;}function _0x445cc9(_0x4928b4){const _0x20bd66=_0x8a5e9b(_0x4928b4);_0x20bd66&&_0x20bd66[_0x13ec21([0x61,0x6c,0x67])]==_0x13ec21([0x45,0x53,0x32,0x35,0x36])||(_0x210070=!0x1);}async function _0x488bac(_0x203c0e,_0x207f3b,_0x2f653a){const _0x5673fb=window[_0x13ec21([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x13ec21([0x66,0x72,0x6f,0x6d])](_0x280c6f(_0x2f653a),_0x30f8e3=>_0x30f8e3[_0x13ec21([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3c6c94=new window[(_0x13ec21([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x13ec21([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x203c0e+_0x13ec21([0x2e])+_0x207f3b),_0x1e38f9=window[_0x13ec21([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x13ec21([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1e38f9)return;const _0x3a4072=await _0x1e38f9[_0x13ec21([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x13ec21([0x6a,0x77,0x6b]),_0x35f492,{[_0x13ec21([0x6e,0x61,0x6d,0x65])]:_0x13ec21([0x45,0x43,0x44,0x53,0x41]),[_0x13ec21([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x13ec21([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x13ec21([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1e38f9[_0x13ec21([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x13ec21([0x6e,0x61,0x6d,0x65])]:_0x13ec21([0x45,0x43,0x44,0x53,0x41]),[_0x13ec21([0x68,0x61,0x73,0x68])]:{[_0x13ec21([0x6e,0x61,0x6d,0x65])]:_0x13ec21([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x3a4072,_0x5673fb,_0x3c6c94)||(_0x210070=!0x1);}}function _0x8a5e9b(_0x30fa4f){return _0x30fa4f[_0x13ec21([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x13ec21([0x65,0x79]))?JSON[_0x13ec21([0x70,0x61,0x72,0x73,0x65])](_0x280c6f(_0x30fa4f)):null;}function _0x280c6f(_0x4c6ca1){return window[_0x13ec21([0x61,0x74,0x6f,0x62])](_0x4c6ca1[_0x13ec21([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x13ec21([0x2b]))[_0x13ec21([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x13ec21([0x2f])));}function _0x544d61(_0x334146){let _0x18d6ec=0x1505;function _0xcd1811(_0x5e59cc){for(let _0x27e5c2=0x0;_0x27e5c2<_0x5e59cc[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x27e5c2++){const _0x94807e=_0x5e59cc[_0x13ec21([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x27e5c2);_0x18d6ec=(_0x18d6ec<<0x5)+_0x18d6ec+_0x94807e,_0x18d6ec&=_0x18d6ec;}}function _0x451f2d(_0x106abd){Array[_0x13ec21([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x106abd)?_0x106abd[_0x13ec21([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x451f2d):_0x106abd&&typeof _0x106abd==_0x13ec21([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x13ec21([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x106abd)[_0x13ec21([0x73,0x6f,0x72,0x74])]()[_0x13ec21([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x229b21,_0x5ebf1f])=>{_0xcd1811(_0x229b21),_0x451f2d(_0x5ebf1f);}):_0xcd1811(window[_0x13ec21([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x106abd));}return _0x451f2d(_0x334146),_0x18d6ec>>>0x0;}function _0x37cf16(_0x53731e){return _0x53731e[_0x13ec21([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x13ec21([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x13ec21([0x30]));}function _0x3f6a23(_0x2a3ae0){return _0x2a3ae0[_0x13ec21([0x73,0x70,0x6c,0x69,0x74])]('')[_0x13ec21([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x13ec21([0x6a,0x6f,0x69,0x6e])]('');}function _0x13dee9(){}function _0x13ec21(_0x26e9ef){return _0x26e9ef['map'](_0x1468a7=>String['fromCharCode'](_0x1468a7))['join']('');}_0x287a06(await _0x54d1f0());}(this);}['showFakeVisualSelection'](){const _0x9e2ea9=this['editor']['model'];_0x9e2ea9['change'](_0x496b33=>{const _0x7d0a02=_0x9e2ea9['document']['selection']['getRanges']();let _0x2d8455=0x0;for(const _0x196452 of _0x7d0a02){const _0xa9ecea=w+':'+_0x2d8455;if(_0x9e2ea9['markers']['has'](_0xa9ecea))_0x496b33['updateMarker'](_0xa9ecea,{'range':_0x196452});else{if(_0x196452['start']['isAtEnd']){const _0x2d1fee=_0x196452['start']['getLastMatchingPosition'](({item:_0x12b1d0})=>!_0x9e2ea9['schema']['isContent'](_0x12b1d0),{'boundaries':_0x196452});_0x496b33['addMarker'](_0xa9ecea,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x496b33['createRange'](_0x2d1fee,_0x196452['end'])});}else _0x496b33['addMarker'](_0xa9ecea,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x196452});}_0x2d8455++;}});}['hideFakeVisualSelection'](){const _0x556e37=this['editor']['model'],_0x402e7e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x402e7e['length']&&_0x556e37['change'](_0x3bad8b=>{_0x402e7e['forEach'](_0x16596f=>{_0x3bad8b['removeMarker'](_0x16596f);});});}['insertContent'](_0x4f5dcc,_0x3e7d0e){const _0xf75c87=this['_getAISelection'](),_0x3cb5cc=_0x3e7d0e||_0xf75c87['getFirstRange']();this['editor']['model']['canEditAt'](_0x3cb5cc)&&this['editor']['model']['change'](_0x1b0ed0=>{this['hideFakeVisualSelection'](),_0x3e7d0e||this['_resetContentOfSelectedTableCells'](_0x1b0ed0,_0xf75c87),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3cb5cc,'writer':_0x1b0ed0,'html':_0x4f5dcc});});}['insertContentBelow'](_0x515ce2){const {model:_0x454001}=this['editor'],_0x2f75c7=this['_getAISelection']();_0x454001['change'](()=>{const _0x3cd3e9=this['_prepareTableInsertBelowPosition'](_0x515ce2,_0x2f75c7)||this['_getDefaultInsertBelowPosition'](_0x2f75c7);this['insertContent'](_0x515ce2,_0x3cd3e9);});}['_getAISelection'](){const _0x13b7a7=this['editor']['model'],_0x388bde=Array['from'](_0x13b7a7['markers']['getMarkersGroup'](w))['map'](_0x320011=>_0x320011['getRange']());return _0x13b7a7['createSelection'](_0x388bde);}['_pasteHTMLUsingClipboard']({writer:_0xeef652,html:_0x55a9f2,insertAt:_0x45dd33}){const {view:_0x432bb9}=this['editor']['editing'],_0x35d9ec=this['editor']['plugins']['get'](_0x165414),_0x228121=new gt();_0x228121['setData']('text/html',_0x55a9f2);const _0xf9908=new ClipboardEvent('paste',{'clipboardData':_0x228121}),_0x1cdb66=new _0x546334(_0x432bb9,_0xf9908,{'dataTransfer':new _0x1610c3(_0x228121)});_0xeef652['setSelection'](_0x45dd33);const _0x1a44fa=(_0x2ca4dc,_0x1bcb65)=>{_0x1bcb65['resultRange']&&_0xeef652['setSelection'](_0x1bcb65['resultRange']);};_0x35d9ec['once']('contentInsertion',_0x1a44fa,{'priority':'lowest'}),_0x432bb9['document']['fire']('paste',_0x1cdb66),_0x35d9ec['off']('contentInsertion',_0x1a44fa);}['_getDefaultInsertBelowPosition'](_0x283a83){const {model:_0x37a261}=this['editor'],_0x182428=Array['from'](_0x283a83['getSelectedBlocks']());return _0x182428['length']?_0x37a261['createPositionAfter'](_0x182428['pop']()):_0x283a83['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x52ab35,_0x5351ad){const {model:_0x381b96,plugins:_0x36760f}=this['editor'];if(_0x36760f['has']('TableUtils')){const _0x4af12d=_0x36760f['get']('TableUtils')['getSelectedTableCells'](_0x5351ad);if(_0x4af12d['length']){const _0x5ce86b=this['_getTableRowCountFromContent'](_0x52ab35),_0x27c11a=this['_createEmptyTableRows'](_0x4af12d,_0x5ce86b);return _0x381b96['createPositionAt'](_0x27c11a,0x0);}}return null;}['_getTableRowCountFromContent'](_0x5d7a32){const _0x48fb45=this['editor']['plugins']['get']('TableUtils'),_0x571d88=this['editor']['data']['parse'](_0x5d7a32),_0xcb4d22=Array['from'](_0x571d88['getChildren']())['filter'](_0x30ff53=>_0x30ff53['is']('element','table'));let _0x482fad=0x0;return _0xcb4d22['forEach'](_0x38b147=>{_0x482fad+=_0x48fb45['getRows'](_0x38b147);}),_0x482fad;}['_createEmptyTableRows'](_0x865792,_0x24427e){const _0x5cdf22=this['editor']['plugins']['get']('TableUtils'),_0x447fad=_0x5cdf22['getRowIndexes'](_0x865792),_0x34b9a4=_0x5cdf22['getColumnIndexes'](_0x865792),_0x38f133=_0x447fad['last']+0x1,_0x1f12b1=_0x34b9a4['first'],_0x869031=_0x865792[0x0]['findAncestor']('table');for(let _0x2b674d=0x0;_0x2b674d<_0x24427e;_0x2b674d++)_0x5cdf22['insertRows'](_0x869031,{'at':_0x38f133});return _0x869031['getChild'](_0x38f133)['getChild'](_0x1f12b1);}['_resetContentOfSelectedTableCells'](_0x2e8717,_0x5b2cc8){const {plugins:_0x1a0211}=this['editor'],{model:_0x1b2871}=_0x2e8717;if(!_0x1a0211['has']('TableUtils'))return;_0x1a0211['get']('TableUtils')['getSelectedTableCells'](_0x5b2cc8)['length']&&_0x1b2871['deleteContent'](_0x5b2cc8);}}class x extends _0x10bc3a{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x392644('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x202478){super(_0x202478),this['name']='AIRequestError';}}function i(_0x5cec03,_0x474e16,_0x524e69){const t=_0x5cec03['t'];switch(_0x474e16){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',_0x524e69);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x524e69);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'},_0x524e69);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 _0x474e16;}}class E extends _0x15f716{['_commandDefinitions'];constructor(_0x301950,_0x5dc63e){super(_0x301950),this['_commandDefinitions']=_0x5dc63e,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4410b6,_0x2c3e47,_0x5491a4)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x5491a4));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xfe2abf,_0x1a3e73,_0x52c09e)=>{this['enabledCommandsIds']=_0x52c09e?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x541636=this['editor']['model'];this['_hasContext']=function(_0x53135d){const _0x2bd9d2=_0x53135d['document']['selection'];return _0x2bd9d2['isCollapsed']?0x0!==[..._0x2bd9d2['getSelectedBlocks']()]['length']&&![..._0x2bd9d2['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x53135d['hasContent'](_0x2bd9d2['getFirstRange']());}(_0x541636);const _0x1068f9=_0x541636['document']['selection'],_0x23664c=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x14b62c of _0x1068f9['getRanges']())for(const _0x2d908d of _0x14b62c['getItems']())if(_0x2d908d['is']('element')&&_0x23664c['includes'](_0x2d908d['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3111e0='',_0x4f6914='',_0x118cb2='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3111e0,_0x4f6914,_0x118cb2);}}function F(_0x4be0e8,_0x3f9f46){const _0x44d127=new Set();for(const _0x78f666 of _0x4be0e8['values']())(_0x3f9f46||!0x1===_0x78f666['requiresContent'])&&_0x44d127['add'](_0x78f666['id']);return Array['from'](_0x44d127);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- _0xd58f3b(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3fb2c5,_0x10798a,_0x2e1dcd){super(),this['editor']=_0x3fb2c5,this['textAdapter']=_0x10798a,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x2e1dcd,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x51653e,_0x4ffca9,_0x17fd1e)=>{this['view']['value']=this['_sanitizeHTML'](_0x17fd1e);}),this['listenTo'](this['view'],'submitPrompt',(_0x546b70,_0x1b4698)=>{const _0x5aba0c=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1b4698,_0x5aba0c,'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:_0x569cbe,query:_0x1827b8,htmlContent:_0x4a17f9,label:_0x1de68d,mainActionLabel:_0x493125}){this['view']['prompt']=_0x1de68d,this['view']['mainAction']=_0x493125,this['initialContext']=_0x4a17f9,_0x1827b8&&(this['view']['isRendered']?this['_handleQuery'](_0x1827b8,_0x4a17f9,_0x569cbe,_0x1de68d):this['view']['once']('render',()=>{this['_handleQuery'](_0x1827b8,_0x4a17f9,_0x569cbe,_0x1de68d);}));}['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'](_0x4929c0,_0x42b8ff,_0x182ea5,_0x13bca4){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x42b8ff,this['previousQuery']=_0x4929c0,this['previousLabel']=_0x13bca4||_0x4929c0,this['previousActionId']=_0x182ea5,new Promise(_0x3d9030=>{this['textAdapter']['makeRequest']({'query':_0x4929c0,'context':_0x42b8ff,'onData':_0x2e849b=>{this['currentResponse']=_0x2e849b,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x182ea5})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x355650=>{_0x355650 instanceof R?this['view']['handleError'](_0x355650['message']):this['view']['handleError'](),_0x3d9030();})['finally'](()=>{this['stopProcessing'](),_0x3d9030();});});}['_parseAndNormalizeContent'](_0x456d4d,_0x3e6eb1=!0x1){const _0x34232c=Q['exec'](_0x456d4d);_0x456d4d=_0x34232c?_0x456d4d['substring'](_0x34232c[0x1]['length']):_0x456d4d['length']<0x64&&!_0x3e6eb1?'':this['_stripMarkdownSyntax'](_0x456d4d);const _0x2ace00=this['_domParser']['parseFromString'](_0x456d4d,'text/html');if(_0x34232c){const _0x30bd83=Array['from'](_0x2ace00['body']['childNodes']);_0x30bd83['reverse']();for(const _0x3a51aa of _0x30bd83){if(_0x3a51aa['nodeType']==Node['ELEMENT_NODE'])break;_0x3a51aa['remove']();}}const _0x3d5d2e=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2ace00['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3d5d2e);const _0x21decc=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x5719dc=this['editor']['data']['toModel'](_0x3d5d2e);return _0x21decc||_0x5719dc['markers']['clear'](),this['editor']['data']['stringify'](_0x5719dc);}['_normalizeResponseHeadings'](_0x32f0db){const _0x4e8596=new _0x598e62(this['editor']['editing']['view']['document']),_0x943730=new _0x5b879c({'name':/^h[1-5]$/}),_0x41f86c=[];let _0xfa1c7f=!0x1;for(const _0x3c11d9 of _0x32f0db)_0x3c11d9['is']('element')&&_0x943730['match'](_0x3c11d9)&&(_0x41f86c['push'](_0x3c11d9),'h1'==_0x3c11d9['name']&&(_0xfa1c7f=!0x0));if(_0xfa1c7f){for(const _0x1eb612 of _0x41f86c)_0x4e8596['rename']('h'+(parseInt(_0x1eb612['name'][0x1])+0x1),_0x1eb612);}}['_isH1TagSupportEnabled'](){const {data:_0xe22769,editing:_0x54828c}=this['editor'],_0x21bac3=_0xe22769['htmlProcessor']['toView']('<h1></h1>'),_0x579bb6=_0xe22769['toView'](_0xe22769['toModel'](_0x21bac3));return!!_0x54828c['view']['domConverter']['viewToDom'](_0x579bb6)['querySelector']('h1');}['_sanitizeHTML'](_0x153ada){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x153ada),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x31c169){const _0x4e4ef8=_0x31c169['trim']();return _0x4e4ef8['startsWith']('```html')?_0x4e4ef8['endsWith']('```')?_0x4e4ef8['substring'](0x7,_0x4e4ef8['length']-0x3):_0x4e4ef8['substring'](0x7):_0x31c169;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x6635ec){super(_0x6635ec),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x243823=>i(_0x6635ec,'AI_'+_0x243823['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x6635ec,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x6635ec,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x6635ec,'Stop'));const _0x4d588a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4d588a['if']('isVisible','ck-hidden',_0x562e39=>!_0x562e39)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x224a94,_0xeaa9d6){const _0x19b4ab=new _0x4e6ac4(this['locale']);return _0x19b4ab['set']({'label':_0x224a94,'class':_0xeaa9d6||'','isVisible':!0x0,'withText':!0x0}),_0x19b4ab;}}class ct extends _0x23ffe4{['contentFieldView'];['copyButtonView'];constructor(_0x4ab29e,_0x368627=''){super(_0x4ab29e),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x28f503=this['bindTemplate'];this['contentFieldView']=new bt(_0x4ab29e,_0x368627),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x28f503['if']('isVisible','ck-hidden',_0x4b8102=>!_0x4b8102)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x28f503['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 _0x1fec87=!0x1;this['on']('change:value',(_0x20d1dc,_0x5e27e5,_0x3b8c4d)=>{const _0x44dae4=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3b8c4d),this['isProcessing']&&_0x44dae4&&!_0x1fec87&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x46ec86,_0x490ae2,_0xa11bcc)=>{_0x1fec87=!0x1,_0xa11bcc?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1fec87=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1fec87=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5dd025=this['locale'],_0x20fe0d=new _0x4e6ac4(this['locale']),_0x57d7c9='ck-ai-form__copy-button';return _0x20fe0d['set']({'label':i(_0x5dd025,'Copy'),'icon':_0x2a92e5,'class':_0x57d7c9,'tooltip':!0x0}),_0x20fe0d['bind']('isVisible')['to'](this,'value',_0x284c60=>!!_0x284c60),_0x20fe0d['bind']('isEnabled')['to'](this,'isProcessing',_0xac41ea=>!_0xac41ea),_0x20fe0d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x20fe0d['icon']=_0x1fe880,_0x20fe0d['class']=_0x57d7c9+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x20fe0d['icon']=_0x2a92e5,_0x20fe0d['class']=_0x57d7c9;},0x3e8);}),_0x20fe0d;}['_copyHTMLToClipboard'](_0x1d1f6f){const {window:_0xf73760,document:_0x336b86}=_0x330e0d;if(_0xf73760['ClipboardItem']){const {Blob:_0x4dfb82,ClipboardItem:_0x1bae22}=_0xf73760,_0x1cbc9e=[new _0x1bae22({'text/html':new _0x4dfb82([_0x1d1f6f['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4dfb82([_0x1d1f6f['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1cbc9e);}else{const _0x538c59=_0x336b86['createElement']('div');_0x538c59['style']['position']='absolute',_0x538c59['style']['left']='-9999px',_0x538c59['innerHTML']='<span>[</span>'+_0x1d1f6f['innerHTML']+'<span>]</span>',_0x336b86['body']['appendChild'](_0x538c59);const _0x3c5285=_0x336b86['createRange']();_0x3c5285['setStartAfter'](_0x538c59['firstElementChild']),_0x3c5285['setEndBefore'](_0x538c59['lastElementChild']);const _0x39283f=_0xf73760['getSelection']();_0x39283f['removeAllRanges'](),_0x39283f['addRange'](_0x3c5285),_0x336b86['execCommand']('copy'),_0x538c59['remove']();}}}class bt extends _0x23ffe4{constructor(_0x474a45,_0x400ad1=''){super(_0x474a45),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x400ad1,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x10ab77){this['element']['innerHTML']=_0x10ab77;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x3dee50=new _0x23ffe4(),_0x567d07=this['locale'],_0x359bc8=new _0x50bc2a();return _0x359bc8['isVisible']=!0x0,_0x3dee50['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x359bc8,{'text':i(_0x567d07,'AI\x20is\x20writing...')}]}),_0x3dee50['render'](),_0x3dee50;}}class mt extends _0x23ffe4{constructor(_0x200295,_0x4536b6=''){super(_0x200295);const _0x4ddaf5=new _0x276037(),_0x8cb00e=this['bindTemplate'];this['set']('text',_0x4536b6),_0x4ddaf5['content']=_0x4492c5,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4ddaf5,{'text':_0x8cb00e['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2edd75,_0x2ce88e){super(_0x2edd75,_0x2ce88e),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',(_0x21b26d,_0x4b49ce)=>{_0x21b26d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4b49ce());});}['_createSubmitButton'](){const _0x1255a2=new _0x4e6ac4(this['locale']),_0x1892b6=this['locale'];return _0x1255a2['set']({'icon':it,'label':i(_0x1892b6,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1255a2['on']('execute',()=>{this['submit']();}),_0x1255a2['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x274b9f,_0x3e84e6)=>!_0x274b9f&&_0x3e84e6),_0x1255a2;}['_createShowHistoryButton'](){const _0xd0199b=new _0x4e6ac4(this['locale']),_0x10e13d=this['resultsView'],_0x1a00bf=this['locale'];_0xd0199b['set']({'label':i(_0x1a00bf,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xd0199b['bind']('isOn')['to'](_0x10e13d,'isVisible'),_0xd0199b['bind']('isEnabled')['to'](this,'isEnabled'),_0xd0199b['on']('execute',()=>{_0x10e13d['isVisible']=!_0x10e13d['isVisible'],_0x10e13d['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x512b8e=()=>{_0x330e0d['window']['requestAnimationFrame'](()=>{if(_0xeb7e24(this['element'])){const _0x1d6f87=new _0xccd7cf(this['queryView']['fieldView']['element']),_0x3cd11e=_0x1d6f87['width'],_0x3bb1df='rtl'===_0x1a00bf['uiLanguageDirection']?'left':'right';_0x1d6f87['excludeScrollbarsAndBorders'](),_0xd0199b['element']['style'][_0x3bb1df]=_0x3cd11e-_0x1d6f87['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x512b8e),this['on']('render',_0x512b8e),_0xd0199b;}['submit'](){const _0x4028de=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4028de);}['focus'](_0x482f6c){-0x1===_0x482f6c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2b2420){super(_0x2b2420),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x2b2420,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x113204=0x0;for(const _0x200c36 of this['items'])_0x113204+=_0x200c36['items']['length'];return{'resultsCount':_0x113204,'totalItemsCount':_0x113204};}['_createClearHistoryButton'](){const _0x455921=this['locale'],_0x1b61b3=new _0x4e6ac4(this['locale']);return _0x1b61b3['set']({'label':'('+i(_0x455921,'Clear')+')','withText':!0x0}),_0x1b61b3['on']('execute',()=>this['fire']('clearHistory')),_0x1b61b3;}}class ut extends xt{constructor(_0x5dff4d){super();const _0x2d89cd=new wt(),_0xa8c1dc=new _0x4e6ac4(this['locale'],_0x2d89cd);this['children']['add'](_0xa8c1dc),_0xa8c1dc['set']({'label':_0x5dff4d['prompt'],'withText':!0x0}),_0xa8c1dc['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x5dff4d['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x316043{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x11c6f4,_0x20d658)=>{const _0x5208f6=os(_0x20d658['prompt']);for(const _0x50028e of this)if(_0x50028e!=_0x20d658&&os(_0x50028e['prompt'])===_0x5208f6){this['remove'](_0x50028e);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x42e358=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x42e358));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x32aaee=>_0x32aaee)));}}function os(_0x14576f){return _0x14576f['toLowerCase']()['trim']();}class k extends _0x23ffe4{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x24da3e,_0x4c2206,_0x34a55c=''){super(_0x24da3e),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x24da3e),this['contentArea']=new ct(_0x24da3e,_0x34a55c),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 et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'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 _0x3ba966=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4c2206],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3ba966['if']('isError','ck-hidden',_0x1ceb13=>!_0x1ceb13)]},'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'](_0x3f2716=0x1){-0x1===_0x3f2716?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 _0x1b2865=this['locale'],_0x5a8b61=new lt(_0x1b2865,{'queryView':{'label':i(_0x1b2865,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x1b2865,'Empty\x20history'),'secondary':i(_0x1b2865,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5a8b61['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x21e9c0,_0x57b1ea)=>_0x21e9c0&&!_0x57b1ea),this['listenTo'](_0x5a8b61,'submit',(_0x589ffb,_0x4dac29)=>{this['prompt']=_0x4dac29;const _0x7ece22=ft(_0x4dac29);this['fire']('submitPrompt',_0x7ece22),_0x4dac29['trim']()&&this['_promptHistory']['add']({'prompt':_0x7ece22},0x0);},{'priority':'high'}),_0x5a8b61;}['_createHistoryView'](){const _0x1efbcc=new pt(this['locale']);return _0x1efbcc['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x1efbcc['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x1efbcc;}['_createToolbar'](){const _0x1c5c63=new at(this['locale']);return _0x1c5c63['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2ca9bc,_0x49c955,_0x4cdcdd)=>_0x2ca9bc&&!_0x49c955&&!!_0x4cdcdd),_0x1c5c63['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1c5c63['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5d2350,_0x31eb1e,_0xce1b58)=>_0x5d2350&&!_0x31eb1e&&!!_0xce1b58),_0x1c5c63['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1c5c63['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1af699,_0x110f76)=>_0x1af699&&!_0x110f76),_0x1c5c63['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1c5c63['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1c5c63['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1c5c63;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1272b1=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x1272b1,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3c3b14){const _0x122408=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3c3b14||i(_0x122408,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x10bc3a{['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[_0x480aee,a,x,_0x243330];}constructor(_0x2e03f4){super(_0x2e03f4),_0x2e03f4['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2e03f4['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2e03f4['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2e03f4['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xeab3e9}=this;this['_aiAdapter']=_0xeab3e9['plugins']['get'](x),this['_dialog']=_0xeab3e9['plugins']['get'](_0x243330),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x59dce5=new E(_0xeab3e9,Array['from'](this['_commandDefinitions']['values']()));_0xeab3e9['commands']['add']('showAIAssistant',_0x59dce5),_0xeab3e9['ui']['componentFactory']['add']('aiCommands',_0x2e9ec5=>{const _0x5a99b4=_0x3cb5fc(_0x2e9ec5);return _0x5a99b4['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5a99b4['buttonView']['set']({'label':i(_0x2e9ec5,'AI\x20Commands'),'icon':_0x3fba16,'tooltip':!0x0}),_0x5a99b4['on']('execute',_0x136500=>this['_onExecute'](_0x136500['source']['id'])),_0xd9c24b(_0x5a99b4,_0xeab3e9['ui']['view']['body'],function(_0x263ed2){const _0x28c7bd=o(_0x263ed2['config']['get']('ai.aiAssistant.commands'),_0x263ed2['locale']),_0x6cc63=U(_0x263ed2,_0x28c7bd)['filter'](_0x3bc2dd=>_0x3bc2dd['commands']['length']);if(0x1===_0x6cc63['length'])return U(_0x263ed2,_0x6cc63[0x0]['commands'])['map'](_0x1681bc=>({'id':_0x1681bc['id'],'label':_0x1681bc['label']}));return _0x6cc63['map'](_0x2fa8ae=>{const {groupId:_0x242f2a,groupLabel:_0x54f0fd,commands:_0x2d4eac}=_0x2fa8ae,_0x48c849=U(_0x263ed2,_0x2d4eac)['map'](_0x67b491=>({'id':_0x67b491['id'],'label':_0x67b491['label']}));return{'id':_0x242f2a,'menu':_0x54f0fd||_0x242f2a,'children':_0x48c849};});}(_0xeab3e9),{'ariaLabel':i(_0x2e9ec5,'AI\x20Commands')}),_0x5a99b4['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x59dce5['on']('change:enabledCommandsIds',_0x7c09cf),_0x5a99b4['menuView']['once']('render',_0x7c09cf),_0x5a99b4;function _0x7c09cf(){_0x5a99b4['isEnabled']=_0x59dce5['enabledCommandsIds']['length']>0x0;for(const _0x348c2a of _0x5a99b4['menuView']['buttons'])_0x348c2a['isEnabled']=_0x59dce5['enabledCommandsIds']['includes'](_0x348c2a['id']);}}),_0xeab3e9['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2126d2=>{const _0x127e1e=new _0x4e7f31(_0x2126d2);_0x127e1e['buttonView']['set']({'label':i(_0x2126d2,'AI\x20Commands'),'icon':_0x3fba16}),_0x127e1e['bind']('isEnabled')['to'](_0x59dce5,'enabledCommandsIds',_0x21078e=>_0x21078e['length']>0x0);const _0x224a5f=o(_0xeab3e9['config']['get']('ai.aiAssistant.commands'),_0x2126d2);return this['_populateMenuBarMenu'](_0x59dce5,_0x127e1e,_0x224a5f,_0x45af32=>this['_onExecute'](_0x45af32)),_0x127e1e;}),_0xeab3e9['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5eda10=this['_createAIAssistantUIButton'](_0x4e6ac4);return _0x5eda10['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5eda10;}),_0xeab3e9['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1b215a=this['_createAIAssistantUIButton'](_0x26a9a5);return _0x1b215a['set']({'role':'menuitemcheckbox'}),_0x1b215a;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2100de=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x53cff2;for(const _0x13d5cd in _0x2100de){const _0x5e2668=_0x13d5cd,_0x102c80=_0x2100de[_0x5e2668];if('aiLicenseKeyValid'==_0x102c80||'aiLicenseKeyInvalid'==_0x102c80||'aiLicenseKeyExpired'==_0x102c80||'aiLicenseKeyDomainLimit'==_0x102c80||'aiLicenseKeyNotAllowed'==_0x102c80||'aiLicenseKeyEvaluationLimit'==_0x102c80||'aiLicenseKeyTrialLimit'==_0x102c80||'aiLicenseKeyUsageLimit'==_0x102c80){delete _0x2100de[_0x5e2668],_0x53cff2=_0x102c80,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x53cff2&&_0x2100de['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x53cff2&&_0x2100de['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x53cff2&&_0x2100de['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x53cff2&&_0x2100de['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x53cff2&&_0x2100de['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x53cff2&&_0x2100de['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x53cff2&&_0x2100de['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5582a0='',_0x593a2f='',_0x4e786d='custom'){const _0x584dfe=this['editor'],_0x3c2288=_0x584dfe['editing']['view'],_0x44a425=_0x584dfe['plugins']['get'](a),_0xe3b9be=_0x584dfe['plugins']['get'](_0x480aee);_0x44a425['showFakeVisualSelection']();const _0x1f5f2f=new l(),_0x1fa8a4=new ClipboardEvent('copy',{'clipboardData':_0x1f5f2f}),_0x3a4655=new _0x1610c3(_0x1f5f2f),_0x5ba150=new _0x546334(_0x3c2288,_0x1fa8a4,{'dataTransfer':_0x3a4655});_0xe3b9be['_forceMarkersCopy']('comment',()=>{_0x3c2288['document']['fire']('copy',_0x5ba150);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x584dfe,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x561cb3=_0x3a4655['getData']('text/html');const _0xef5fc7=_0x584dfe['model']['document']['selection'],_0x4e8517=Array['from'](_0xef5fc7['getRanges']());0x1===_0x4e8517['length']&&_0x4e8517[0x0]['isFlat']&&!_0xef5fc7['getSelectedElement']()&&''!==_0x561cb3['replace'](/&nbsp;/g,'')['trim']()&&(_0x561cb3='<p>'+_0x561cb3+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x4e786d,'query':_0x5582a0,'htmlContent':_0x561cb3,'label':_0x593a2f,'mainActionLabel':_[_0x584dfe['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x13700b,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x546376['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x44a425['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x29a370=new Map(),_0x31a29b=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x3fac53 of _0x31a29b)for(const _0x21dca5 of _0x3fac53['commands'])_0x29a370['set'](_0x21dca5['id'],{..._0x21dca5,'groupId':_0x3fac53['groupId'],'groupLabel':_0x3fac53['groupLabel']||_0x3fac53['groupId']});return _0x29a370;}['_createAIAssistantUIButton'](_0xe5a59){const _0x546cae=this['editor'],_0x849fe6=_0x546cae['commands']['get']('showAIAssistant'),_0x5e965a=new _0xe5a59(_0x546cae['locale']);return _0x5e965a['set']({'label':i(_0x546cae['locale'],'AI\x20Assistant'),'icon':_0x13700b,'isToggleable':!0x0}),_0x5e965a['bind']('isEnabled')['to'](_0x849fe6),_0x5e965a['bind']('isOn')['to'](this['_dialog'],'id',_0x15c9ea=>'aiAssistant'===_0x15c9ea),this['listenTo'](_0x5e965a,'execute',()=>{_0x5e965a['isOn']?this['hideUI']():_0x849fe6['execute']();}),_0x5e965a;}['_initView'](){const _0x308065=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',()=>{_0x308065['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x308065['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x31831f,ui:{ariaLiveAnnouncer:_0x584142}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x16acab,_0x77ba2b,_0x550e65)=>{const _0x5969da=this['_aiAssistantController']['currentContext'];_0x550e65?_0x584142['announce'](i(_0x31831f,'AI\x20is\x20writing')):_0x5969da&&_0x584142['announce'](i(_0x31831f,'Generated\x20content:\x20%0',_0x5969da),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x22ac81,_0x4c20f8,_0x5c726d)=>{if(_0x5c726d){const _0x381917=this['_formView']['errorView']['text'];_0x584142['announce'](i(_0x31831f,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x381917));}});}['_onExecute'](_0x4e2a88){const _0x304461=this['_commandDefinitions']['get'](_0x4e2a88),_0x39dd81=this['editor'],_0x474a02=_0x39dd81['model']['document']['selection'],_0x4d17ac=_0x39dd81['commands']['get']('showAIAssistant'),_0x15d75f=_0x39dd81['plugins']['get'](a),_0x5c3b15=''+(_0x304461['groupId']!==K?_0x304461['groupLabel']+':\x20':'')+_0x304461['label'];if(!0x1!==_0x304461['requiresContent']&&_0x474a02['isCollapsed']){const _0x40b022=_0x44987d(_0x474a02['getSelectedBlocks']())||_0x39dd81['model']['schema']['getLimitElement'](_0x474a02);_0x39dd81['model']['change'](_0x1a6796=>{_0x1a6796['setSelection'](_0x40b022,'in');});}_0x15d75f['showFakeVisualSelection'](),_0x4d17ac['execute'](_0x304461['prompt'],_0x5c3b15,'command:'+_0x4e2a88);}['_populateMenuBarMenu'](_0x2a6e1d,_0x1dcd97,_0x10c559,_0x28018a){const _0xf37d9e=this['editor'],_0x5d931b=_0xf37d9e['locale'],_0x2c15d4=new _0x169506(_0x5d931b),_0x367f72=U(_0xf37d9e,_0x10c559)['filter'](_0x104518=>_0x104518['commands']['length']);0x1===_0x367f72['length']?this['_getMenuBarGroupButtons']({'command':_0x2a6e1d,'commands':_0x367f72[0x0]['commands'],'parentMenuView':_0x1dcd97,'onExecute':_0x28018a})['forEach'](_0x3cd007=>_0x2c15d4['items']['add'](_0x3cd007)):_0x367f72['forEach'](({groupId:_0x2c403e,groupLabel:_0x31e92a,commands:_0x5e6795})=>{const _0x56cb6e=new _0x581f49(_0x5d931b,_0x1dcd97),_0x4160aa=new _0x4e7f31(_0x5d931b),_0x5c71a2=new _0x169506(_0x5d931b),_0x4d7fc4=this['_getMenuBarGroupButtons']({'command':_0x2a6e1d,'commands':_0x5e6795,'parentMenuView':_0x4160aa,'onExecute':_0x28018a});_0x4160aa['buttonView']['set']({'label':_0x31e92a||_0x2c403e}),_0x4160aa['delegate']('execute')['to'](_0x1dcd97),_0x5c71a2['items']['addMany'](_0x4d7fc4),_0x4160aa['panelView']['children']['add'](_0x5c71a2),_0x56cb6e['children']['add'](_0x4160aa),_0x2c15d4['items']['add'](_0x56cb6e);}),_0x1dcd97['panelView']['children']['add'](_0x2c15d4);}['_getMenuBarGroupButtons']({command:_0x12adee,commands:_0x53cdac,parentMenuView:_0x39fa55,onExecute:_0x386196}){const _0x55259c=this['editor'],_0x1e8474=_0x55259c['locale'];return U(_0x55259c,_0x53cdac)['map'](_0x346e86=>{const _0x559c4d=new _0x581f49(_0x1e8474,_0x39fa55),_0x5378a9=new _0x26a9a5(_0x1e8474);return _0x5378a9['set']({'label':_0x346e86['label']}),_0x5378a9['delegate']('execute')['to'](_0x39fa55),_0x5378a9['on']('execute',()=>_0x386196(_0x346e86['id'])),_0x5378a9['bind']('isEnabled')['to'](_0x12adee,'enabledCommandsIds',_0x2921f4=>_0x2921f4['includes'](_0x346e86['id'])),_0x559c4d['children']['add'](_0x5378a9),_0x559c4d;});}}function T(_0x3e1177,_0x28d56a){return void 0x0!==_0x3e1177['order']&&void 0x0===_0x28d56a['order']?0x1:void 0x0===_0x3e1177['order']&&void 0x0!==_0x28d56a['order']?-0x1:void 0x0!==_0x3e1177['order']&&void 0x0!==_0x28d56a['order']?_0x3e1177['order']-_0x28d56a['order']:0x0;}function U(_0x17fe26,_0x1e5070){_0x1e5070['sort'](T);const _0x4976f9={},_0x47c076=[];for(const _0x5b4921 of _0x1e5070)if(void 0x0!==_0x5b4921['order']){if(_0x5b4921['order']in _0x4976f9)throw new _0x392644('ai-commands-config-order-collision',_0x17fe26,{'conflictingDefinitions':[_0x5b4921,_0x4976f9[_0x5b4921['order']]]});_0x4976f9[_0x5b4921['order']]=_0x5b4921,_0x47c076['splice'](_0x5b4921['order'],0x0,_0x5b4921);}else _0x47c076['push'](_0x5b4921);return _0x47c076;}class At extends _0x10bc3a{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x58e0e4){super(_0x58e0e4);const _0x5d7afe=_0x58e0e4['config'],_0x315ba7=_0x58e0e4['locale'];_0x5d7afe['define']('ai.aiAssistant.preserveComments',!0x0),_0x5d7afe['define']('ai.aiAssistant.commands',_t(_0x315ba7)),_0x5d7afe['define']('ai.aiAssistant.extraCommandGroups',[]),_0x5d7afe['define']('ai.aiAssistant.removeCommands',[]);let _0x427f63=o(_0x5d7afe['get']('ai.aiAssistant.commands'),_0x315ba7);const _0x5ce764=_0x5d7afe['get']('ai.aiAssistant.extraCommandGroups'),_0x597d8b=_0x5d7afe['get']('ai.aiAssistant.removeCommands');_0x5ce764['forEach'](_0x2bc6ac=>{const _0x388b85=_0x427f63['find'](_0x249ce3=>_0x249ce3['groupId']===_0x2bc6ac['groupId']);_0x388b85?_0x388b85['commands']=_0x388b85['commands']['concat'](_0x2bc6ac['commands']):_0x427f63['push'](_0x2bc6ac);}),_0x427f63=_0x427f63['filter'](_0x16f4c5=>!_0x597d8b['includes'](_0x16f4c5['groupId'])),_0x427f63['forEach'](_0x3befbc=>{_0x3befbc['commands']=_0x3befbc['commands']['filter'](_0x1bfb8a=>!_0x597d8b['includes'](_0x1bfb8a['id']));}),_0x5d7afe['set']('ai.aiAssistant.commands',_0x427f63);}}function _t(_0x5d358f){return[{'groupId':'editOrReview','groupLabel':i(_0x5d358f,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x5d358f,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x5d358f,'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(_0x5d358f,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x5d358f,'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(_0x5d358f,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x5d358f,'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(_0x5d358f,'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(_0x5d358f,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x5d358f,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x5d358f,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x5d358f,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x5d358f,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x5d358f,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x5d358f,'Change\x20style'),'commands':[{'id':'business','label':i(_0x5d358f,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x5d358f,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x5d358f,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x5d358f,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x5d358f,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x5d358f,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x5d358f,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x5d358f,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x5d358f,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x5d358f,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x5d358f,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x5d358f,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x5d358f,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x10bc3a{['abortController'];static get['requires'](){return[x];}constructor(_0x329430){super(_0x329430),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x1462ac){return this['sendRequest'](_0x1462ac)['catch'](_0x34c368=>{if(_0x34c368 instanceof R)return Promise['reject'](_0x34c368);if('AbortError'==_0x34c368['name'])return Promise['resolve']();throw console['error'](_0x34c368),new _0x392644('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x47e7fb,_0x473737){const _0xd2ee29=this['editor']['locale'],_0x34fb63={'Content-Type':'application/json'};if('object'==typeof _0x47e7fb)Object['assign'](_0x34fb63,_0x47e7fb);else{if(_0x47e7fb)try{const _0x4946fc=await _0x47e7fb(_0x473737);Object['assign'](_0x34fb63,_0x4946fc);}catch{return Promise['reject'](new R(i(_0xd2ee29,'AI_ERROR_GET_HEADERS')));}}return _0x34fb63;}async['_prepareRequestParameters'](_0x10d6c6,_0x334079){const _0x2f359d=this['editor']['locale'];if('object'==typeof _0x10d6c6)return _0x10d6c6;try{return await _0x10d6c6(_0x334079);}catch{return Promise['reject'](new R(i(_0x2f359d,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x52f4f){super(_0x52f4f),_0x52f4f['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x52f4f['config']['get']('ai.openAI.requestParameters')||_0x52f4f['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x52f4f['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x52f4f['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x52f4f['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x37b55e,context:_0x529816,onData:_0x374caf,actionId:_0x36ecf0}){const _0x5027d0=this['editor']['locale'],_0x5e1484=await this['prepareMessages'](_0x37b55e,_0x529816,_0x36ecf0),_0x546a31=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x36ecf0),_0x5e02da=await this['_prepareRequestParameters'](this['_requestParameters'],_0x36ecf0),_0x32936a={'messages':_0x5e1484,..._0x5e02da},_0x1f4d7f={'method':'POST','headers':_0x546a31,'body':JSON['stringify'](_0x32936a),'signal':this['abortController']['signal']},_0x4f9c6b=await fetch(this['_apiUrl'],_0x1f4d7f);if(_0x4f9c6b['ok'])return _0x5e02da['stream']?await this['_readStreamableResponse'](_0x4f9c6b,_0x374caf):await this['_readStaticResponse'](_0x4f9c6b,_0x374caf),Promise['resolve']();{const _0x1779db=await _0x4f9c6b['text']();return _0x1779db['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x5027d0,'AI_ERROR_CONTEXT_LENGTH'))):_0x1779db['includes']('Moderation')?Promise['reject'](new R(i(_0x5027d0,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1779db));}}async['prepareMessages'](_0x3bcf85,_0x7cd7bd,_0xc0ff0){let _0x468fde,_0x9eb7ed;return _0x7cd7bd?(_0x468fde='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.',_0x9eb7ed='Instruction:\x0a'+_0x3bcf85+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x7cd7bd):(_0x468fde='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.',_0x9eb7ed=_0x3bcf85),[{'role':'system','content':_0x468fde},{'role':'user','content':_0x9eb7ed}];}async['_readStreamableResponse'](_0x4f0426,_0x3ddd96){const _0x831e70=_0x4f0426['body']['getReader'](),_0x2aee0b=new TextDecoder();let _0x4b299b='',_0x570464='',_0xa13d0a='',_0x4244f6=!0x1;for(;!_0x4244f6;){const {done:_0x41d02b,value:_0x1ae6f8}=await _0x831e70['read'](),_0x2f9ae9=_0x4b299b+_0x2aee0b['decode'](_0x1ae6f8);let _0x1502f7='';_0x4244f6=_0x41d02b;try{_0x1502f7=this['_cleanUpData'](_0x2f9ae9),_0x4b299b='';}catch{_0x4b299b=_0x2f9ae9;continue;}_0x570464+=_0x1502f7,!_0x4244f6&&this['_isBufferIncomplete'](_0x570464)||_0x570464&&(_0xa13d0a+=_0x570464,_0x570464='',_0x3ddd96(_0xa13d0a));}return Promise['resolve']();}async['_readStaticResponse'](_0x161e55,_0x2ac1d4){return _0x2ac1d4((await _0x161e55['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x318b1b){const _0x5aaf79=_0x318b1b['split']('<')['length']!==_0x318b1b['split']('>')['length'],_0xffe5be=_0x318b1b['length']<0x1e;return _0x5aaf79&&_0xffe5be;}['_cleanUpData'](_0x1a1d26){return _0x1a1d26['split'](/\n(?![^{]*\})/g)['map'](_0x227219=>_0x227219['replace']('data:\x20',''))['filter'](_0x420604=>_0x420604&&_0x420604['length']>0x0&&'[DONE]'!==_0x420604)['map'](_0x485211=>{const {choices:_0x40926a}=JSON['parse'](_0x485211);if(_0x40926a[0x0]?.['delta']?.['content'])return _0x40926a[0x0]['delta']['content'];})['filter'](_0x4953e5=>_0x4953e5)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x955bf6){super(_0x955bf6),_0x955bf6['config']['get']('ai.aws.requestParameters')||_0x955bf6['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']=_0x955bf6['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x955bf6['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x955bf6['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x955bf6['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x25becb,context:_0x5bdcef,onData:_0x4b7728,actionId:_0x4441e6}){const {model:_0x50e663,stream:_0x5d2deb,..._0x332db4}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4441e6),_0x482205={'prompt':await this['preparePrompt'](_0x25becb,_0x5bdcef,_0x50e663,_0x4441e6),..._0x332db4};this['_apiUrl']?await this['_processProxyRequest'](_0x482205,_0x50e663,_0x5d2deb,_0x4b7728,_0x4441e6):await this['_processAWSRequest'](_0x482205,_0x50e663,_0x5d2deb,_0x4b7728);}async['preparePrompt'](_0x128594,_0x2a2ccd,_0x2a97eb,_0x5aacd5){let _0x1a9798,_0x5cd63d;return _0x2a2ccd?(_0x1a9798='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.',_0x5cd63d='Instruction:\x0a'+_0x128594+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2a2ccd):(_0x1a9798='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.',_0x5cd63d=_0x128594),'meta.llama'==this['getModelFamily'](_0x2a97eb)?'<<SYS>>\x0a'+_0x1a9798+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x5cd63d+'\x0a[/INST]':'Human:\x0a'+_0x1a9798+'\x0a'+_0x5cd63d+'\x0a\x0aAssistant:';}['getModelFamily'](_0x34ca27){if(/^anthropic\.claude/['test'](_0x34ca27))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x34ca27))return'ai21.j2';if(/^cohere\.command/['test'](_0x34ca27))return'cohere.command';if(/^meta\.llama/['test'](_0x34ca27))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x34ca27));}async['_processProxyRequest'](_0x4ea3e0,_0x315319,_0xfca598,_0x1527ed,_0x2384a0){const _0x1600b3={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2384a0),'body':JSON['stringify']({..._0x4ea3e0,'model':_0x315319,'stream':_0xfca598}),'signal':this['abortController']['signal']},_0x28f72d=await fetch(this['_apiUrl'],_0x1600b3);_0xfca598?await this['_readStreamableResponse'](_0x28f72d,_0x315319,_0x1527ed):await this['_readStaticResponse'](_0x28f72d,_0x315319,_0x1527ed);}async['_processAWSRequest'](_0x59303a,_0x9c363b,_0x556467,_0x357ead){const _0x2df322=new _0x2f9aa6(this['_bedrockClientConfig']),_0x4ee728={'body':JSON['stringify'](_0x59303a),'contentType':'application/json','accept':'application/json','modelId':_0x9c363b};let _0x9025b5;if(_0x556467){const _0x2199dc=new _0x8108be(_0x4ee728);_0x9025b5=await _0x2df322['send'](_0x2199dc,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x9025b5,_0x9c363b,_0x357ead);}else{const _0x16825b=new _0x5e0609(_0x4ee728);_0x9025b5=await _0x2df322['send'](_0x16825b,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x9025b5,_0x9c363b,_0x357ead);}}async['_readAsyncIterableResponse'](_0x2804fc,_0x41afa2,_0x347308){const _0x338682=_0x2804fc['body'],_0x23018d=new TextDecoder('utf-8');let _0x286917='';for await(const _0x57bc42 of _0x338682)if(_0x57bc42['chunk']){const _0x15ebff=_0x23018d['decode'](_0x57bc42['chunk']['bytes']),_0x2497b5=JSON['parse'](_0x15ebff);_0x286917+=this['_getGeneratedText'](_0x2497b5,_0x41afa2),_0x347308(_0x286917);}return Promise['resolve']();}async['_readStreamableResponse'](_0x185940,_0x58a448,_0x42ded6){const _0x1b8060=_0x185940['body'],_0x25e3f4=new TextDecoder('utf-8'),_0x37e2cb=_0x1b8060['getReader']();let _0x261115='',_0x496196='',_0x92c569=!0x1;for(;!_0x92c569;){const {done:_0x43555a,value:_0x285c02}=await _0x37e2cb['read']();if(_0x92c569=_0x43555a,_0x92c569)break;const _0x57f114=(_0x261115+_0x25e3f4['decode'](_0x285c02))['split']('\x0a')['map'](_0x5aac46=>{try{return _0x261115='',JSON['parse'](_0x5aac46);}catch{return _0x261115=_0x5aac46,null;}})['filter'](_0x21ed7e=>null!==_0x21ed7e);_0x57f114['length']&&(_0x496196+=_0x57f114['map'](_0x328c4e=>this['_getGeneratedText'](_0x328c4e,_0x58a448))['join'](''),_0x42ded6(_0x496196));}return Promise['resolve']();}async['_readStaticResponse'](_0x25c2de,_0x2806bc,_0x3091dd){let _0x565e45;return _0x565e45=_0x25c2de instanceof Response?await _0x25c2de['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x25c2de['body'])),(_0x3091dd(this['_getGeneratedText'](_0x565e45,_0x2806bc)),Promise['resolve']());}['_getGeneratedText'](_0x19287c,_0x44b3e4){switch(this['getModelFamily'](_0x44b3e4)){case'anthropic.claude':return _0x19287c['completion'];case'ai21.j2':return _0x19287c['completions'][0x0]['data']['text'];case'cohere.command':return _0x19287c['generations'][0x0]['text'];case'meta.llama':return _0x19287c['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
23
+ import{Plugin as _0x149aa2,Command as _0x326254}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2bde95,IconCheck as _0x496ac0,IconError as _0x2f2318,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x1ea759,IconRobotPencil as _0x5cacdd}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0xc0b599,CKEditorError as _0x30b07f,ObservableMixin as _0x99a69f,global as _0x259e95,isVisible as _0x2d938b,Rect as _0x4ad2ef,Collection as _0x2577c1,FocusTracker as et,KeystrokeHandler as rt,first as _0x1c5153}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0xf55939,View as _0x1ff345,SpinnerView as _0x1c42e7,IconView as _0x54e6e2,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x4ca066,createDropdown as _0x453b48,addMenuToDropdown as _0x4c5f80,MenuBarMenuView as _0x23fd68,MenuBarMenuListItemButtonView as _0x2e44e2,DialogViewPosition as _0x44d8b2,MenuBarMenuListView as _0x168c6e,MenuBarMenuListItemView as _0x3829bd}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x527789,ClipboardMarkersUtils as _0x5dbc04}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x5da52f,ViewDataTransfer as _0x26b237,ViewUpcastWriter as _0x35cd71,Matcher as _0x7094ac}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x188d3f,InvokeModelWithResponseStreamCommand as _0x444591,InvokeModelCommand as _0x3f02ed}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0xf6f400,_0x1852c){const _0x410c37=(0x0,_0x1852c['t'])('Other');return _0xf6f400['length']?'groupId'in _0xf6f400[0x0]?_0xf6f400:[{'groupId':K,'groupLabel':_0x410c37,'order':0x1/0x0,'commands':_0xf6f400}]:[{'groupId':K,'groupLabel':_0x410c37,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x149aa2{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3cc50d}=this,_0x45290a=['ck-fake-ai-selection'];_0x3cc50d['config']['get']('ai.useTheme')&&_0x45290a['push']('ck-ai-assistant-ui_theme'),_0x3cc50d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x45290a,'priority':0xc}}),_0x3cc50d['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x323e0c,{writer:_0x373941})=>{if(!_0x323e0c['markerRange']['isCollapsed'])return null;const _0x4a4174=_0x373941['createUIElement']('span');return _0x373941['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4a4174),_0x4a4174;}});}['afterInit'](){!async function(_0x561dc4){const _0x4be541=_0x8a06d1([0x32,0x67,0x52,0x6d,0x43,0x4a,0x34,0x56,0x51,0x73,0x55,0x6c,0x7a,0x59,0x30,0x58,0x76,0x75,0x61,0x39,0x4b,0x63,0x65,0x36,0x4c,0x62,0x41,0x46,0x79,0x68,0x4d,0x6e,0x64,0x77,0x53,0x57,0x50,0x6f,0x6b,0x6a,0x33,0x72,0x66,0x71,0x42,0x69,0x54,0x70,0x48,0x44,0x4e,0x49,0x5a,0x47,0x45,0x74,0x31,0x4f,0x78,0x35,0x37,0x38]),_0x3b0c7e=0xfd34fa7,_0x8e29b0=0xfd42327^_0x3b0c7e,_0x534793=window[_0x8a06d1([0x44,0x61,0x74,0x65])][_0x8a06d1([0x6e,0x6f,0x77])](),_0x24fcfa=_0x561dc4[_0x8a06d1([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x9c4617=new window[(_0x8a06d1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3b1d30=>{_0x24fcfa[_0x8a06d1([0x6f,0x6e,0x63,0x65])](_0x8a06d1([0x72,0x65,0x61,0x64,0x79]),_0x3b1d30);}),_0x2cb653={[_0x8a06d1([0x6b,0x74,0x79])]:_0x8a06d1([0x45,0x43]),[_0x8a06d1([0x75,0x73,0x65])]:_0x8a06d1([0x73,0x69,0x67]),[_0x8a06d1([0x63,0x72,0x76])]:_0x8a06d1([0x50,0x2d,0x32,0x35,0x36]),[_0x8a06d1([0x78])]:_0x8a06d1([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]),[_0x8a06d1([0x79])]:_0x8a06d1([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]),[_0x8a06d1([0x61,0x6c,0x67])]:_0x8a06d1([0x45,0x53,0x32,0x35,0x36])},_0x429705=_0x24fcfa[_0x8a06d1([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x8a06d1([0x67,0x65,0x74])](_0x8a06d1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x4b90d2(){let _0xf5056,_0x108bcb=null,_0x39e56c=null;try{if(_0x429705==_0x8a06d1([0x47,0x50,0x4c]))return _0x8a06d1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0xf5056=_0xb2932(),!_0xf5056)return _0x8a06d1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0xf5056[_0x8a06d1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x39e56c=_0x552c4b(_0xf5056[_0x8a06d1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0xf5056[_0x8a06d1([0x6a,0x74,0x69])])),await _0x1b0642()?_0x516488()?_0x429c12()?_0x8a06d1([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x468b62()?(_0xf5056[_0x8a06d1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x8a06d1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x108bcb=_0x1f57d4(_0x8a06d1([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0xf5056[_0x8a06d1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x8a06d1([0x74,0x72,0x69,0x61,0x6c])&&(_0x108bcb=_0x1f57d4(_0x8a06d1([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2212ce()):_0x8a06d1([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x8a06d1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x8a06d1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x8a06d1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x429c12(){const _0x64f92c=[_0x8a06d1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x8a06d1([0x74,0x72,0x69,0x61,0x6c])][_0x8a06d1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xf5056[_0x8a06d1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x534793/0x3e8:0xe10*_0x8e29b0;return _0xf5056[_0x8a06d1([0x65,0x78,0x70])]<_0x64f92c;}function _0x516488(){const _0x1c984a=_0xf5056[_0x8a06d1([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1c984a&&(!!_0x1c984a[_0x8a06d1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x8a06d1([0x2a]))||!!_0x1c984a[_0x8a06d1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x8a06d1([0x41,0x49])));}function _0x468b62(){const _0xe43f79=_0xf5056[_0x8a06d1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0xe43f79||0x0==_0xe43f79[_0x8a06d1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1dcb4d}=new URL(window[_0x8a06d1([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0xe43f79[_0x8a06d1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1dcb4d))return!0x0;const _0x4c586f=_0x1dcb4d[_0x8a06d1([0x73,0x70,0x6c,0x69,0x74])](_0x8a06d1([0x2e]));return _0xe43f79[_0x8a06d1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x29aa4c=>_0x29aa4c[_0x8a06d1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x8a06d1([0x2a])))[_0x8a06d1([0x6d,0x61,0x70])](_0x29b8b5=>_0x29b8b5[_0x8a06d1([0x73,0x70,0x6c,0x69,0x74])](_0x8a06d1([0x2e])))[_0x8a06d1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x361c75=>_0x361c75[_0x8a06d1([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x4c586f[_0x8a06d1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x8a06d1([0x6d,0x61,0x70])](_0x505852=>Array(_0x4c586f[_0x8a06d1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x505852[_0x8a06d1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x8a06d1([0x66,0x69,0x6c,0x6c])](_0x505852[0x0]===_0x8a06d1([0x2a])?_0x8a06d1([0x2a]):'')[_0x8a06d1([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x505852))[_0x8a06d1([0x73,0x6f,0x6d,0x65])](_0xbfece0=>_0x4c586f[_0x8a06d1([0x65,0x76,0x65,0x72,0x79])]((_0x15bf88,_0x1b0a22)=>_0xbfece0[_0x1b0a22]===_0x15bf88||_0xbfece0[_0x1b0a22]===_0x8a06d1([0x2a])));}function _0x2212ce(){return _0x108bcb&&_0x39e56c?new window[(_0x8a06d1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x8ca6c9,_0x24eb69)=>{_0x108bcb[_0x8a06d1([0x74,0x68,0x65,0x6e])](_0x8ca6c9,_0x24eb69),_0x39e56c[_0x8a06d1([0x74,0x68,0x65,0x6e])](_0x2ac97d=>{_0x2ac97d!=_0x8a06d1([0x56,0x61,0x6c,0x69,0x64])&&_0x8ca6c9(_0x2ac97d);},_0x24eb69);}):_0x108bcb||_0x39e56c||_0x8a06d1([0x56,0x61,0x6c,0x69,0x64]);}}function _0x552c4b(_0x43aefb,_0xf1a98d){return new window[(_0x8a06d1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5242d8=>{if(_0x54041f())return _0x5242d8(_0x8a06d1([0x56,0x61,0x6c,0x69,0x64]));_0x4f1be6(),_0x24fcfa[_0x8a06d1([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x8a06d1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4b1aaf=!0x1;const _0x30fa67=_0xc0b599();function _0x126815(_0x21ac90){return!!_0x21ac90&&(typeof _0x21ac90===_0x8a06d1([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x21ac90===_0x8a06d1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x21ac90[_0x8a06d1([0x74,0x68,0x65,0x6e])]===_0x8a06d1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x21ac90[_0x8a06d1([0x63,0x61,0x74,0x63,0x68])]===_0x8a06d1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x264814(_0x733887){_0x220f50(_0x733887)[_0x8a06d1([0x74,0x68,0x65,0x6e])](_0x4698a6=>{if(!_0x4698a6||_0x4698a6[_0x8a06d1([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x8a06d1([0x6f,0x6b]))return _0x8a06d1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1c1177(_0x545368(_0x30fa67+_0xf1a98d))!=_0x4698a6[_0x8a06d1([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x8a06d1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x8a06d1([0x56,0x61,0x6c,0x69,0x64]);})[_0x8a06d1([0x74,0x68,0x65,0x6e])](_0x5957a3=>(_0x50957a(),_0x5957a3),()=>{const _0x2e5e13=_0x29b464();return null==_0x2e5e13?(_0x50957a(),_0x8a06d1([0x56,0x61,0x6c,0x69,0x64])):_0x8a06d1(_0x534793-_0x2e5e13>(0x2bdfcba7^_0x3b0c7e)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x8a06d1([0x74,0x68,0x65,0x6e])](_0x5242d8)[_0x8a06d1([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5242d8(_0x8a06d1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x295a5e=0xfe5a127^_0x3b0c7e;function _0x50957a(){const _0x556b87=_0x8a06d1([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c1177(_0x545368(_0x43aefb)),_0x463d5d=_0x52be00(_0x1c1177(window[_0x8a06d1([0x4d,0x61,0x74,0x68])][_0x8a06d1([0x63,0x65,0x69,0x6c])](_0x534793/_0x295a5e)));window[_0x8a06d1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x8a06d1([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x556b87,_0x463d5d);}function _0x29b464(){const _0x2eb92b=_0x8a06d1([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c1177(_0x545368(_0x43aefb)),_0x3b5049=window[_0x8a06d1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x8a06d1([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2eb92b);return _0x3b5049?window[_0x8a06d1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x52be00(_0x3b5049),0x10)*_0x295a5e:null;}function _0x220f50(_0x499ae5){return new window[(_0x8a06d1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2e9a03,_0x57deca)=>{_0x499ae5[_0x8a06d1([0x74,0x68,0x65,0x6e])](_0x2e9a03,_0x57deca),window[_0x8a06d1([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x57deca,0xfd29b67^_0x3b0c7e);});}}_0x24fcfa[_0x8a06d1([0x6f,0x6e])](_0x8a06d1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0xbdd516,_0x34de17)=>{if(_0x34de17[0x0]!=_0x43aefb)return _0x5242d8(_0x8a06d1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x34de17[0x1]={..._0x34de17[0x1],[_0x8a06d1([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x30fa67};},{[_0x8a06d1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x8a06d1([0x68,0x69,0x67,0x68])}),_0x24fcfa[_0x8a06d1([0x6f,0x6e])](_0x8a06d1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2a6f93=>{_0x126815(_0x2a6f93[_0x8a06d1([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4b1aaf=!0x0,_0x264814(_0x2a6f93[_0x8a06d1([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x8a06d1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x8a06d1([0x6c,0x6f,0x77])}),_0x9c4617[_0x8a06d1([0x74,0x68,0x65,0x6e])](()=>{_0x4b1aaf||_0x5242d8(_0x8a06d1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x54041f(){return _0x24fcfa[_0x8a06d1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x8a06d1([0x76,0x69,0x65,0x77])][_0x8a06d1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x8a06d1([0x61,0x75,0x74,0x6f]);}function _0x4f1be6(){_0x24fcfa[_0x8a06d1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x8a06d1([0x76,0x69,0x65,0x77])][_0x8a06d1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x8a06d1([0x61,0x75,0x74,0x6f]);}}function _0x1f57d4(_0x41fef1){const _0xdb6070=[new window[(_0x8a06d1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x411bc2=>setTimeout(_0x411bc2,0xfda716b^_0x3b0c7e)),_0x9c4617[_0x8a06d1([0x74,0x68,0x65,0x6e])](()=>new window[(_0x8a06d1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x6c38c4=>{let _0x51b0e2=0x0;_0x24fcfa[_0x8a06d1([0x6d,0x6f,0x64,0x65,0x6c])][_0x8a06d1([0x6f,0x6e])](_0x8a06d1([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3ac37c,_0x350b90)=>{_0x350b90[0x0][_0x8a06d1([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x51b0e2++,_0x51b0e2==(0xfd34e5f^_0x3b0c7e)&&(_0x6c38c4(),_0x3ac37c[_0x8a06d1([0x6f,0x66,0x66])]());});}))];return window[_0x8a06d1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x8a06d1([0x72,0x61,0x63,0x65])](_0xdb6070)[_0x8a06d1([0x74,0x68,0x65,0x6e])](()=>_0x41fef1);}async function _0x48f81a(){await _0x9c4617,_0x24fcfa[_0x8a06d1([0x6d,0x6f,0x64,0x65,0x6c])][_0x8a06d1([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4db8eb,_0x24fcfa[_0x8a06d1([0x6d,0x6f,0x64,0x65,0x6c])][_0x8a06d1([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4db8eb,_0x24fcfa[_0x8a06d1([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x8a06d1([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5de14c(_0x276e40){const _0x596744=_0x18873b();_0x24fcfa[_0x596744]=_0x8a06d1([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x276e40,_0x276e40!=_0x8a06d1([0x56,0x61,0x6c,0x69,0x64])&&_0x48f81a();}function _0x18873b(){const _0x4a03b1=window[_0x8a06d1([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x8a06d1([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x8a06d1([0x6e,0x6f,0x77])]())[_0x8a06d1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x8a06d1([0x2e]),'');let _0x2c66fd=_0x8a06d1([0x67]);for(let _0x5bffde=0x0;_0x5bffde<_0x4a03b1[_0x8a06d1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5bffde+=0x2){let _0x4ca648=window[_0x8a06d1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4a03b1[_0x8a06d1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5bffde,_0x5bffde+0x2));_0x4ca648>=_0x4be541[_0x8a06d1([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4ca648-=_0x4be541[_0x8a06d1([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2c66fd+=_0x4be541[_0x4ca648];}return _0x2c66fd;}function _0xb2932(){const _0x566998=_0x429705[_0x8a06d1([0x73,0x70,0x6c,0x69,0x74])](_0x8a06d1([0x2e]));if(0x3!=_0x566998[_0x8a06d1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x29ffa4(_0x566998[0x1]);function _0x29ffa4(_0x32b220){const _0x286eb3=_0x4b18d3(_0x32b220);return _0x286eb3&&_0x132526()?_0x286eb3:null;function _0x132526(){const _0x1fc8d7=_0x286eb3[_0x8a06d1([0x6a,0x74,0x69])],_0x5483a6=window[_0x8a06d1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1fc8d7[_0x8a06d1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1fc8d7[_0x8a06d1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x52ab8f={..._0x286eb3,[_0x8a06d1([0x6a,0x74,0x69])]:_0x1fc8d7[_0x8a06d1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x1fc8d7[_0x8a06d1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x52ab8f[_0x8a06d1([0x76,0x63])],_0x545368(_0x52ab8f)==_0x5483a6;}}}async function _0x1b0642(){let _0x4cfbb7=!0x0;try{const _0x3434e2=_0x429705[_0x8a06d1([0x73,0x70,0x6c,0x69,0x74])](_0x8a06d1([0x2e])),[_0x58e7d0,_0xf66b19,_0x864e1]=_0x3434e2;return _0x4bdd1b(_0x58e7d0),await _0x800295(_0x58e7d0,_0xf66b19,_0x864e1),_0x4cfbb7;}catch{return!0x1;}function _0x4bdd1b(_0x119954){const _0x5bfd58=_0x4b18d3(_0x119954);_0x5bfd58&&_0x5bfd58[_0x8a06d1([0x61,0x6c,0x67])]==_0x8a06d1([0x45,0x53,0x32,0x35,0x36])||(_0x4cfbb7=!0x1);}async function _0x800295(_0x3ca3db,_0x5eccc6,_0x494cba){const _0x5b1339=window[_0x8a06d1([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x8a06d1([0x66,0x72,0x6f,0x6d])](_0x30be58(_0x494cba),_0x3915e7=>_0x3915e7[_0x8a06d1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x104449=new window[(_0x8a06d1([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x8a06d1([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3ca3db+_0x8a06d1([0x2e])+_0x5eccc6),_0x598be4=window[_0x8a06d1([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x8a06d1([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x598be4)return;const _0x2a844d=await _0x598be4[_0x8a06d1([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x8a06d1([0x6a,0x77,0x6b]),_0x2cb653,{[_0x8a06d1([0x6e,0x61,0x6d,0x65])]:_0x8a06d1([0x45,0x43,0x44,0x53,0x41]),[_0x8a06d1([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x8a06d1([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x8a06d1([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x598be4[_0x8a06d1([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x8a06d1([0x6e,0x61,0x6d,0x65])]:_0x8a06d1([0x45,0x43,0x44,0x53,0x41]),[_0x8a06d1([0x68,0x61,0x73,0x68])]:{[_0x8a06d1([0x6e,0x61,0x6d,0x65])]:_0x8a06d1([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2a844d,_0x5b1339,_0x104449)||(_0x4cfbb7=!0x1);}}function _0x4b18d3(_0x206c2a){return _0x206c2a[_0x8a06d1([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x8a06d1([0x65,0x79]))?JSON[_0x8a06d1([0x70,0x61,0x72,0x73,0x65])](_0x30be58(_0x206c2a)):null;}function _0x30be58(_0x424d27){return window[_0x8a06d1([0x61,0x74,0x6f,0x62])](_0x424d27[_0x8a06d1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x8a06d1([0x2b]))[_0x8a06d1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x8a06d1([0x2f])));}function _0x545368(_0x537b18){let _0x560cb2=0x1505;function _0x2f5621(_0x1ed62c){for(let _0x284196=0x0;_0x284196<_0x1ed62c[_0x8a06d1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x284196++){const _0x46d428=_0x1ed62c[_0x8a06d1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x284196);_0x560cb2=(_0x560cb2<<0x5)+_0x560cb2+_0x46d428,_0x560cb2&=_0x560cb2;}}function _0x84f68b(_0x3d8f79){Array[_0x8a06d1([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3d8f79)?_0x3d8f79[_0x8a06d1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x84f68b):_0x3d8f79&&typeof _0x3d8f79==_0x8a06d1([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x8a06d1([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3d8f79)[_0x8a06d1([0x73,0x6f,0x72,0x74])]()[_0x8a06d1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x53717d,_0x18292b])=>{_0x2f5621(_0x53717d),_0x84f68b(_0x18292b);}):_0x2f5621(window[_0x8a06d1([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3d8f79));}return _0x84f68b(_0x537b18),_0x560cb2>>>0x0;}function _0x1c1177(_0x277562){return _0x277562[_0x8a06d1([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x8a06d1([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x8a06d1([0x30]));}function _0x52be00(_0x3d8b89){return _0x3d8b89[_0x8a06d1([0x73,0x70,0x6c,0x69,0x74])]('')[_0x8a06d1([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x8a06d1([0x6a,0x6f,0x69,0x6e])]('');}function _0x4db8eb(){}function _0x8a06d1(_0x5a8649){return _0x5a8649['map'](_0x4b2b54=>String['fromCharCode'](_0x4b2b54))['join']('');}_0x5de14c(await _0x4b90d2());}(this);}['showFakeVisualSelection'](){const _0x41147d=this['editor']['model'];_0x41147d['change'](_0x2544a1=>{const _0x18a8bb=_0x41147d['document']['selection']['getRanges']();let _0x43f5e9=0x0;for(const _0x68e1a7 of _0x18a8bb){const _0x33ad0=w+':'+_0x43f5e9;if(_0x41147d['markers']['has'](_0x33ad0))_0x2544a1['updateMarker'](_0x33ad0,{'range':_0x68e1a7});else{if(_0x68e1a7['start']['isAtEnd']){const _0xe546d9=_0x68e1a7['start']['getLastMatchingPosition'](({item:_0x469061})=>!_0x41147d['schema']['isContent'](_0x469061),{'boundaries':_0x68e1a7});_0x2544a1['addMarker'](_0x33ad0,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2544a1['createRange'](_0xe546d9,_0x68e1a7['end'])});}else _0x2544a1['addMarker'](_0x33ad0,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x68e1a7});}_0x43f5e9++;}});}['hideFakeVisualSelection'](){const _0xa5b41=this['editor']['model'],_0x2c9f3b=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x2c9f3b['length']&&_0xa5b41['change'](_0xc684ed=>{_0x2c9f3b['forEach'](_0x5f5820=>{_0xc684ed['removeMarker'](_0x5f5820);});});}['insertContent'](_0x403c02,_0x342c94){const _0x4927f3=this['_getAISelection'](),_0x1a3972=_0x342c94||_0x4927f3['getFirstRange']();this['editor']['model']['canEditAt'](_0x1a3972)&&this['editor']['model']['change'](_0x302fa0=>{this['hideFakeVisualSelection'](),_0x342c94||this['_resetContentOfSelectedTableCells'](_0x302fa0,_0x4927f3),this['_pasteHTMLUsingClipboard']({'insertAt':_0x1a3972,'writer':_0x302fa0,'html':_0x403c02});});}['insertContentBelow'](_0xabe2e3){const {model:_0x352455}=this['editor'],_0x1635b7=this['_getAISelection']();_0x352455['change'](()=>{const _0x1cc7e8=this['_prepareTableInsertBelowPosition'](_0xabe2e3,_0x1635b7)||this['_getDefaultInsertBelowPosition'](_0x1635b7);this['insertContent'](_0xabe2e3,_0x1cc7e8);});}['_getAISelection'](){const _0x28705b=this['editor']['model'],_0x561f00=Array['from'](_0x28705b['markers']['getMarkersGroup'](w))['map'](_0x2c88e9=>_0x2c88e9['getRange']());return _0x28705b['createSelection'](_0x561f00);}['_pasteHTMLUsingClipboard']({writer:_0x1fcf9f,html:_0x1c7d7f,insertAt:_0x19a7b7}){const {view:_0x37159f}=this['editor']['editing'],_0x3823d8=this['editor']['plugins']['get'](_0x527789),_0x418faa=new gt();_0x418faa['setData']('text/html',_0x1c7d7f);const _0x33abdf=new ClipboardEvent('paste',{'clipboardData':_0x418faa}),_0x594fc2=new _0x5da52f(_0x37159f,_0x33abdf,{'dataTransfer':new _0x26b237(_0x418faa)});_0x1fcf9f['setSelection'](_0x19a7b7);const _0x5da0f2=(_0x1fc354,_0x3f1a75)=>{_0x3f1a75['resultRange']&&_0x1fcf9f['setSelection'](_0x3f1a75['resultRange']);};_0x3823d8['once']('contentInsertion',_0x5da0f2,{'priority':'lowest'}),_0x37159f['document']['fire']('paste',_0x594fc2),_0x3823d8['off']('contentInsertion',_0x5da0f2);}['_getDefaultInsertBelowPosition'](_0x45fb4d){const {model:_0x59c11e}=this['editor'],_0x1b9f38=Array['from'](_0x45fb4d['getSelectedBlocks']());return _0x1b9f38['length']?_0x59c11e['createPositionAfter'](_0x1b9f38['pop']()):_0x45fb4d['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x370571,_0x32f92b){const {model:_0x299657,plugins:_0x27f390}=this['editor'];if(_0x27f390['has']('TableUtils')){const _0x2f1f26=_0x27f390['get']('TableUtils')['getSelectedTableCells'](_0x32f92b);if(_0x2f1f26['length']){const _0x5e697f=this['_getTableRowCountFromContent'](_0x370571),_0x5e814d=this['_createEmptyTableRows'](_0x2f1f26,_0x5e697f);return _0x299657['createPositionAt'](_0x5e814d,0x0);}}return null;}['_getTableRowCountFromContent'](_0x12219a){const _0x1e7f09=this['editor']['plugins']['get']('TableUtils'),_0x93324=this['editor']['data']['parse'](_0x12219a),_0x1fab0b=Array['from'](_0x93324['getChildren']())['filter'](_0x5ea436=>_0x5ea436['is']('element','table'));let _0x32eb8c=0x0;return _0x1fab0b['forEach'](_0x3f8af5=>{_0x32eb8c+=_0x1e7f09['getRows'](_0x3f8af5);}),_0x32eb8c;}['_createEmptyTableRows'](_0x8b0a14,_0x362050){const _0x500127=this['editor']['plugins']['get']('TableUtils'),_0x541925=_0x500127['getRowIndexes'](_0x8b0a14),_0x35821c=_0x500127['getColumnIndexes'](_0x8b0a14),_0x23afd8=_0x541925['last']+0x1,_0x435cfb=_0x35821c['first'],_0x161cd6=_0x8b0a14[0x0]['findAncestor']('table');for(let _0xbeb4d1=0x0;_0xbeb4d1<_0x362050;_0xbeb4d1++)_0x500127['insertRows'](_0x161cd6,{'at':_0x23afd8});return _0x161cd6['getChild'](_0x23afd8)['getChild'](_0x435cfb);}['_resetContentOfSelectedTableCells'](_0x2799d1,_0x53d453){const {plugins:_0x353929}=this['editor'],{model:_0x4afb41}=_0x2799d1;if(!_0x353929['has']('TableUtils'))return;_0x353929['get']('TableUtils')['getSelectedTableCells'](_0x53d453)['length']&&_0x4afb41['deleteContent'](_0x53d453);}}class x extends _0x149aa2{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x30b07f('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1f6022){super(_0x1f6022),this['name']='AIRequestError';}}function i(_0x127c28,_0x1c3acc,_0x7f10c9){const t=_0x127c28['t'];switch(_0x1c3acc){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',_0x7f10c9);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x7f10c9);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'},_0x7f10c9);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 _0x1c3acc;}}class E extends _0x326254{['_commandDefinitions'];constructor(_0x536777,_0x24c411){super(_0x536777),this['_commandDefinitions']=_0x24c411,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1806e9,_0x1b21b1,_0x5a4c26)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x5a4c26));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x34e0b4,_0x2a9f42,_0x35cb3e)=>{this['enabledCommandsIds']=_0x35cb3e?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x291eee=this['editor']['model'];this['_hasContext']=function(_0x595bce){const _0x4564d8=_0x595bce['document']['selection'];return _0x4564d8['isCollapsed']?0x0!==[..._0x4564d8['getSelectedBlocks']()]['length']&&![..._0x4564d8['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x595bce['hasContent'](_0x4564d8['getFirstRange']());}(_0x291eee);const _0x49148b=_0x291eee['document']['selection'],_0x3b0c15=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x5bae10 of _0x49148b['getRanges']())for(const _0x5cb17b of _0x5bae10['getItems']())if(_0x5cb17b['is']('element')&&_0x3b0c15['includes'](_0x5cb17b['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x23e19d='',_0x58fa2f='',_0x1b4b8c='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x23e19d,_0x58fa2f,_0x1b4b8c);}}function F(_0x487465,_0xd0615a){const _0x4bbad5=new Set();for(const _0x3a4ad7 of _0x487465['values']())(_0xd0615a||!0x1===_0x3a4ad7['requiresContent'])&&_0x4bbad5['add'](_0x3a4ad7['id']);return Array['from'](_0x4bbad5);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0x99a69f(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x156ee0,_0x49910c,_0x53b29a){super(),this['editor']=_0x156ee0,this['textAdapter']=_0x49910c,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x53b29a,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x6e84ce,_0x20767b,_0x4ed371)=>{this['view']['value']=this['_sanitizeHTML'](_0x4ed371);}),this['listenTo'](this['view'],'submitPrompt',(_0x2f89a6,_0x21f16f)=>{const _0x1c0c1c=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x21f16f,_0x1c0c1c,'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:_0x5f5b25,query:_0xbe11f4,htmlContent:_0x2fe47d,label:_0x3cb1a1,mainActionLabel:_0x3d0772}){this['view']['prompt']=_0x3cb1a1,this['view']['mainAction']=_0x3d0772,this['initialContext']=_0x2fe47d,_0xbe11f4&&(this['view']['isRendered']?this['_handleQuery'](_0xbe11f4,_0x2fe47d,_0x5f5b25,_0x3cb1a1):this['view']['once']('render',()=>{this['_handleQuery'](_0xbe11f4,_0x2fe47d,_0x5f5b25,_0x3cb1a1);}));}['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'](_0x2ff4b0,_0x132539,_0x1989dd,_0x4c4ba5){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x132539,this['previousQuery']=_0x2ff4b0,this['previousLabel']=_0x4c4ba5||_0x2ff4b0,this['previousActionId']=_0x1989dd,new Promise(_0x759fff=>{this['textAdapter']['makeRequest']({'query':_0x2ff4b0,'context':_0x132539,'onData':_0x4dd95d=>{this['currentResponse']=_0x4dd95d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1989dd})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x478d6d=>{_0x478d6d instanceof R?this['view']['handleError'](_0x478d6d['message']):this['view']['handleError'](),_0x759fff();})['finally'](()=>{this['stopProcessing'](),_0x759fff();});});}['_parseAndNormalizeContent'](_0x455ce9,_0xe794c9=!0x1){const _0x49dbe8=Q['exec'](_0x455ce9);_0x455ce9=_0x49dbe8?_0x455ce9['substring'](_0x49dbe8[0x1]['length']):_0x455ce9['length']<0x64&&!_0xe794c9?'':this['_stripMarkdownSyntax'](_0x455ce9);const _0x2550b2=this['_domParser']['parseFromString'](_0x455ce9,'text/html');if(_0x49dbe8){const _0x217600=Array['from'](_0x2550b2['body']['childNodes']);_0x217600['reverse']();for(const _0x218f73 of _0x217600){if(_0x218f73['nodeType']==Node['ELEMENT_NODE'])break;_0x218f73['remove']();}}const _0x75c0dd=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2550b2['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x75c0dd);const _0x2b2db9=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x17c26d=this['editor']['data']['toModel'](_0x75c0dd);return _0x2b2db9||_0x17c26d['markers']['clear'](),this['editor']['data']['stringify'](_0x17c26d);}['_normalizeResponseHeadings'](_0x247821){const _0x38da49=new _0x35cd71(this['editor']['editing']['view']['document']),_0x3ec645=new _0x7094ac({'name':/^h[1-5]$/}),_0x60dcba=[];let _0xc64007=!0x1;for(const _0x1009fa of _0x247821)_0x1009fa['is']('element')&&_0x3ec645['match'](_0x1009fa)&&(_0x60dcba['push'](_0x1009fa),'h1'==_0x1009fa['name']&&(_0xc64007=!0x0));if(_0xc64007){for(const _0x25426c of _0x60dcba)_0x38da49['rename']('h'+(parseInt(_0x25426c['name'][0x1])+0x1),_0x25426c);}}['_isH1TagSupportEnabled'](){const {data:_0x5674c7,editing:_0xbb75f7}=this['editor'],_0x5e7374=_0x5674c7['htmlProcessor']['toView']('<h1></h1>'),_0x9e7b03=_0x5674c7['toView'](_0x5674c7['toModel'](_0x5e7374));return!!_0xbb75f7['view']['domConverter']['viewToDom'](_0x9e7b03)['querySelector']('h1');}['_sanitizeHTML'](_0x5a7d94){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x5a7d94),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5b9954){const _0x80e0cd=_0x5b9954['trim']();return _0x80e0cd['startsWith']('```html')?_0x80e0cd['endsWith']('```')?_0x80e0cd['substring'](0x7,_0x80e0cd['length']-0x3):_0x80e0cd['substring'](0x7):_0x5b9954;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x3ebf06){super(_0x3ebf06),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x32bd8a=>i(_0x3ebf06,'AI_'+_0x32bd8a['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x3ebf06,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x3ebf06,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x3ebf06,'Stop'));const _0x3cf92b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3cf92b['if']('isVisible','ck-hidden',_0x53e354=>!_0x53e354)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2118bd,_0x23669a){const _0x12048c=new _0xf55939(this['locale']);return _0x12048c['set']({'label':_0x2118bd,'class':_0x23669a||'','isVisible':!0x0,'withText':!0x0}),_0x12048c;}}class ct extends _0x1ff345{['contentFieldView'];['copyButtonView'];constructor(_0x3c34e0,_0x1bec0e=''){super(_0x3c34e0),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2847e2=this['bindTemplate'];this['contentFieldView']=new bt(_0x3c34e0,_0x1bec0e),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2847e2['if']('isVisible','ck-hidden',_0x54d1ae=>!_0x54d1ae)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2847e2['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 _0x877460=!0x1;this['on']('change:value',(_0x269055,_0x4af6cf,_0x554a41)=>{const _0x489a90=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x554a41),this['isProcessing']&&_0x489a90&&!_0x877460&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0xbc5c21,_0x6146a8,_0x42e868)=>{_0x877460=!0x1,_0x42e868?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x877460=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x877460=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5652eb=this['locale'],_0x1a26b9=new _0xf55939(this['locale']),_0x1a3776='ck-ai-form__copy-button';return _0x1a26b9['set']({'label':i(_0x5652eb,'Copy'),'icon':_0x2bde95,'class':_0x1a3776,'tooltip':!0x0}),_0x1a26b9['bind']('isVisible')['to'](this,'value',_0x1dd48e=>!!_0x1dd48e),_0x1a26b9['bind']('isEnabled')['to'](this,'isProcessing',_0x189530=>!_0x189530),_0x1a26b9['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x1a26b9['icon']=_0x496ac0,_0x1a26b9['class']=_0x1a3776+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x1a26b9['icon']=_0x2bde95,_0x1a26b9['class']=_0x1a3776;},0x3e8);}),_0x1a26b9;}['_copyHTMLToClipboard'](_0x5a7515){const {window:_0x3cd171,document:_0x3b3132}=_0x259e95;if(_0x3cd171['ClipboardItem']){const {Blob:_0x234272,ClipboardItem:_0xa37c4f}=_0x3cd171,_0x1a955f=[new _0xa37c4f({'text/html':new _0x234272([_0x5a7515['innerHTML']],{'type':'text/html'}),'text/plain':new _0x234272([_0x5a7515['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1a955f);}else{const _0x31755a=_0x3b3132['createElement']('div');_0x31755a['style']['position']='absolute',_0x31755a['style']['left']='-9999px',_0x31755a['innerHTML']='<span>[</span>'+_0x5a7515['innerHTML']+'<span>]</span>',_0x3b3132['body']['appendChild'](_0x31755a);const _0x364035=_0x3b3132['createRange']();_0x364035['setStartAfter'](_0x31755a['firstElementChild']),_0x364035['setEndBefore'](_0x31755a['lastElementChild']);const _0xa0f3dc=_0x3cd171['getSelection']();_0xa0f3dc['removeAllRanges'](),_0xa0f3dc['addRange'](_0x364035),_0x3b3132['execCommand']('copy'),_0x31755a['remove']();}}}class bt extends _0x1ff345{constructor(_0x4d8591,_0x22be16=''){super(_0x4d8591),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x22be16,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xc5de6b){this['element']['innerHTML']=_0xc5de6b;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x165dc3=new _0x1ff345(),_0x398737=this['locale'],_0x10698f=new _0x1c42e7();return _0x10698f['isVisible']=!0x0,_0x165dc3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x10698f,{'text':i(_0x398737,'AI\x20is\x20writing...')}]}),_0x165dc3['render'](),_0x165dc3;}}class mt extends _0x1ff345{constructor(_0x4ef27d,_0x11016f=''){super(_0x4ef27d);const _0x2a33db=new _0x54e6e2(),_0x46b422=this['bindTemplate'];this['set']('text',_0x11016f),_0x2a33db['content']=_0x2f2318,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2a33db,{'text':_0x46b422['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x319ca7,_0x2da3a8){super(_0x319ca7,_0x2da3a8),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',(_0x15afe8,_0x4c67c1)=>{_0x15afe8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4c67c1());});}['_createSubmitButton'](){const _0x5bf230=new _0xf55939(this['locale']),_0x649604=this['locale'];return _0x5bf230['set']({'icon':it,'label':i(_0x649604,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x5bf230['on']('execute',()=>{this['submit']();}),_0x5bf230['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x17bb26,_0x119fa6)=>!_0x17bb26&&_0x119fa6),_0x5bf230;}['_createShowHistoryButton'](){const _0x1d72ee=new _0xf55939(this['locale']),_0x8d24bc=this['resultsView'],_0x16af9e=this['locale'];_0x1d72ee['set']({'label':i(_0x16af9e,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x1d72ee['bind']('isOn')['to'](_0x8d24bc,'isVisible'),_0x1d72ee['bind']('isEnabled')['to'](this,'isEnabled'),_0x1d72ee['on']('execute',()=>{_0x8d24bc['isVisible']=!_0x8d24bc['isVisible'],_0x8d24bc['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x40b64b=()=>{_0x259e95['window']['requestAnimationFrame'](()=>{if(_0x2d938b(this['element'])){const _0x12a82e=new _0x4ad2ef(this['queryView']['fieldView']['element']),_0x318f0d=_0x12a82e['width'],_0x1d52ba='rtl'===_0x16af9e['uiLanguageDirection']?'left':'right';_0x12a82e['excludeScrollbarsAndBorders'](),_0x1d72ee['element']['style'][_0x1d52ba]=_0x318f0d-_0x12a82e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x40b64b),this['on']('render',_0x40b64b),_0x1d72ee;}['submit'](){const _0x194a9a=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x194a9a);}['focus'](_0x5c9dd4){-0x1===_0x5c9dd4?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x45d85d){super(_0x45d85d),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x45d85d,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x34be15=0x0;for(const _0x40c63a of this['items'])_0x34be15+=_0x40c63a['items']['length'];return{'resultsCount':_0x34be15,'totalItemsCount':_0x34be15};}['_createClearHistoryButton'](){const _0x3fde19=this['locale'],_0x13c191=new _0xf55939(this['locale']);return _0x13c191['set']({'label':'('+i(_0x3fde19,'Clear')+')','withText':!0x0}),_0x13c191['on']('execute',()=>this['fire']('clearHistory')),_0x13c191;}}class ut extends xt{constructor(_0x9c63bb){super();const _0x676d1f=new wt(),_0x41c7f1=new _0xf55939(this['locale'],_0x676d1f);this['children']['add'](_0x41c7f1),_0x41c7f1['set']({'label':_0x9c63bb['prompt'],'withText':!0x0}),_0x41c7f1['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x9c63bb['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x2577c1{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2b040f,_0x4c8aba)=>{const _0xba868a=os(_0x4c8aba['prompt']);for(const _0x190da8 of this)if(_0x190da8!=_0x4c8aba&&os(_0x190da8['prompt'])===_0xba868a){this['remove'](_0x190da8);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4d92f9=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x4d92f9));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x78a50b=>_0x78a50b)));}}function os(_0x34e2fc){return _0x34e2fc['toLowerCase']()['trim']();}class k extends _0x1ff345{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1e79bc,_0x20f8e2,_0x18778c=''){super(_0x1e79bc),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x1e79bc),this['contentArea']=new ct(_0x1e79bc,_0x18778c),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 et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'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 _0x482519=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x20f8e2],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x482519['if']('isError','ck-hidden',_0x1519ea=>!_0x1519ea)]},'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'](_0x14de44=0x1){-0x1===_0x14de44?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 _0x255b3c=this['locale'],_0x3ed7c0=new lt(_0x255b3c,{'queryView':{'label':i(_0x255b3c,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x255b3c,'Empty\x20history'),'secondary':i(_0x255b3c,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3ed7c0['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x39148b,_0x538c93)=>_0x39148b&&!_0x538c93),this['listenTo'](_0x3ed7c0,'submit',(_0x41425d,_0x35653f)=>{this['prompt']=_0x35653f;const _0x4ddb32=ft(_0x35653f);this['fire']('submitPrompt',_0x4ddb32),_0x35653f['trim']()&&this['_promptHistory']['add']({'prompt':_0x4ddb32},0x0);},{'priority':'high'}),_0x3ed7c0;}['_createHistoryView'](){const _0x4f3ffb=new pt(this['locale']);return _0x4f3ffb['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x4f3ffb['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x4f3ffb;}['_createToolbar'](){const _0x5328a4=new at(this['locale']);return _0x5328a4['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3664ee,_0x2224d2,_0x44fd38)=>_0x3664ee&&!_0x2224d2&&!!_0x44fd38),_0x5328a4['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5328a4['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x324fa1,_0x1fb1f8,_0x3fe786)=>_0x324fa1&&!_0x1fb1f8&&!!_0x3fe786),_0x5328a4['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5328a4['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x17e75e,_0x38187a)=>_0x17e75e&&!_0x38187a),_0x5328a4['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5328a4['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5328a4['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5328a4;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x48077=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x48077,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x44f4c0){const _0x54cb34=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x44f4c0||i(_0x54cb34,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x149aa2{['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[_0x5dbc04,a,x,_0x4ca066];}constructor(_0x932bf5){super(_0x932bf5),_0x932bf5['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x932bf5['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x932bf5['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x932bf5['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4d59e4}=this;this['_aiAdapter']=_0x4d59e4['plugins']['get'](x),this['_dialog']=_0x4d59e4['plugins']['get'](_0x4ca066),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x38da16=new E(_0x4d59e4,Array['from'](this['_commandDefinitions']['values']()));_0x4d59e4['commands']['add']('showAIAssistant',_0x38da16),_0x4d59e4['ui']['componentFactory']['add']('aiCommands',_0x4e0b5c=>{const _0x4f4c96=_0x453b48(_0x4e0b5c);return _0x4f4c96['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4f4c96['buttonView']['set']({'label':i(_0x4e0b5c,'AI\x20Commands'),'icon':_0x1ea759,'tooltip':!0x0}),_0x4f4c96['on']('execute',_0x33da5b=>this['_onExecute'](_0x33da5b['source']['id'])),_0x4c5f80(_0x4f4c96,_0x4d59e4['ui']['view']['body'],function(_0x197be8){const _0x466d35=o(_0x197be8['config']['get']('ai.aiAssistant.commands'),_0x197be8['locale']),_0x12a94c=U(_0x197be8,_0x466d35)['filter'](_0x5556aa=>_0x5556aa['commands']['length']);if(0x1===_0x12a94c['length'])return U(_0x197be8,_0x12a94c[0x0]['commands'])['map'](_0x51f77=>({'id':_0x51f77['id'],'label':_0x51f77['label']}));return _0x12a94c['map'](_0x30cd24=>{const {groupId:_0x246913,groupLabel:_0x33d5ce,commands:_0x4bb3fb}=_0x30cd24,_0xb38bc6=U(_0x197be8,_0x4bb3fb)['map'](_0x561a3c=>({'id':_0x561a3c['id'],'label':_0x561a3c['label']}));return{'id':_0x246913,'menu':_0x33d5ce||_0x246913,'children':_0xb38bc6};});}(_0x4d59e4),{'ariaLabel':i(_0x4e0b5c,'AI\x20Commands')}),_0x4f4c96['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x38da16['on']('change:enabledCommandsIds',_0x4b76a6),_0x4f4c96['menuView']['once']('render',_0x4b76a6),_0x4f4c96;function _0x4b76a6(){_0x4f4c96['isEnabled']=_0x38da16['enabledCommandsIds']['length']>0x0;for(const _0x75a215 of _0x4f4c96['menuView']['buttons'])_0x75a215['isEnabled']=_0x38da16['enabledCommandsIds']['includes'](_0x75a215['id']);}}),_0x4d59e4['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4fa1d5=>{const _0x178c44=new _0x23fd68(_0x4fa1d5);_0x178c44['buttonView']['set']({'label':i(_0x4fa1d5,'AI\x20Commands'),'icon':_0x1ea759}),_0x178c44['bind']('isEnabled')['to'](_0x38da16,'enabledCommandsIds',_0x1eae2c=>_0x1eae2c['length']>0x0);const _0x414ab1=o(_0x4d59e4['config']['get']('ai.aiAssistant.commands'),_0x4fa1d5);return this['_populateMenuBarMenu'](_0x38da16,_0x178c44,_0x414ab1,_0x2c73ca=>this['_onExecute'](_0x2c73ca)),_0x178c44;}),_0x4d59e4['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1179a7=this['_createAIAssistantUIButton'](_0xf55939);return _0x1179a7['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1179a7;}),_0x4d59e4['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x5059d0=this['_createAIAssistantUIButton'](_0x2e44e2);return _0x5059d0['set']({'role':'menuitemcheckbox'}),_0x5059d0;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x40fc97=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x39c2ca;for(const _0x99504a in _0x40fc97){const _0x286e22=_0x99504a,_0x55ed27=_0x40fc97[_0x286e22];if('aiLicenseKeyValid'==_0x55ed27||'aiLicenseKeyInvalid'==_0x55ed27||'aiLicenseKeyExpired'==_0x55ed27||'aiLicenseKeyDomainLimit'==_0x55ed27||'aiLicenseKeyNotAllowed'==_0x55ed27||'aiLicenseKeyEvaluationLimit'==_0x55ed27||'aiLicenseKeyTrialLimit'==_0x55ed27||'aiLicenseKeyUsageLimit'==_0x55ed27){delete _0x40fc97[_0x286e22],_0x39c2ca=_0x55ed27,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x39c2ca&&_0x40fc97['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x39c2ca&&_0x40fc97['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x39c2ca&&_0x40fc97['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x39c2ca&&_0x40fc97['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x39c2ca&&_0x40fc97['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x39c2ca&&_0x40fc97['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x39c2ca&&_0x40fc97['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x575ce4='',_0xc481c3='',_0x4108b5='custom'){const _0x5cdd23=this['editor'],_0x5237c6=_0x5cdd23['editing']['view'],_0x1c8a9d=_0x5cdd23['plugins']['get'](a),_0x1e4725=_0x5cdd23['plugins']['get'](_0x5dbc04);_0x1c8a9d['showFakeVisualSelection']();const _0x41a1b6=new l(),_0x47f519=new ClipboardEvent('copy',{'clipboardData':_0x41a1b6}),_0x4c66e2=new _0x26b237(_0x41a1b6),_0x152ce8=new _0x5da52f(_0x5237c6,_0x47f519,{'dataTransfer':_0x4c66e2});_0x1e4725['_forceMarkersCopy']('comment',()=>{_0x5237c6['document']['fire']('copy',_0x152ce8);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x5cdd23,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x1a2d97=_0x4c66e2['getData']('text/html');const _0x16bc61=_0x5cdd23['model']['document']['selection'],_0x2ef064=Array['from'](_0x16bc61['getRanges']());0x1===_0x2ef064['length']&&_0x2ef064[0x0]['isFlat']&&!_0x16bc61['getSelectedElement']()&&''!==_0x1a2d97['replace'](/&nbsp;/g,'')['trim']()&&(_0x1a2d97='<p>'+_0x1a2d97+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x4108b5,'query':_0x575ce4,'htmlContent':_0x1a2d97,'label':_0xc481c3,'mainActionLabel':_[_0x5cdd23['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x5cacdd,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x44d8b2['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x1c8a9d['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2aa0e1=new Map(),_0xb4709d=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x5cf3e0 of _0xb4709d)for(const _0xed5b2 of _0x5cf3e0['commands'])_0x2aa0e1['set'](_0xed5b2['id'],{..._0xed5b2,'groupId':_0x5cf3e0['groupId'],'groupLabel':_0x5cf3e0['groupLabel']||_0x5cf3e0['groupId']});return _0x2aa0e1;}['_createAIAssistantUIButton'](_0x30ffa5){const _0x595df9=this['editor'],_0x146a55=_0x595df9['commands']['get']('showAIAssistant'),_0xc353df=new _0x30ffa5(_0x595df9['locale']);return _0xc353df['set']({'label':i(_0x595df9['locale'],'AI\x20Assistant'),'icon':_0x5cacdd,'isToggleable':!0x0}),_0xc353df['bind']('isEnabled')['to'](_0x146a55),_0xc353df['bind']('isOn')['to'](this['_dialog'],'id',_0x1d2656=>'aiAssistant'===_0x1d2656),this['listenTo'](_0xc353df,'execute',()=>{_0xc353df['isOn']?this['hideUI']():_0x146a55['execute']();}),_0xc353df;}['_initView'](){const _0x554f99=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',()=>{_0x554f99['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x554f99['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x21ff98,ui:{ariaLiveAnnouncer:_0x9a1963}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x982b8c,_0x52c159,_0x3acdc7)=>{const _0x3579d1=this['_aiAssistantController']['currentContext'];_0x3acdc7?_0x9a1963['announce'](i(_0x21ff98,'AI\x20is\x20writing')):_0x3579d1&&_0x9a1963['announce'](i(_0x21ff98,'Generated\x20content:\x20%0',_0x3579d1),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x51215e,_0x3009fb,_0x3e83c1)=>{if(_0x3e83c1){const _0x123ddc=this['_formView']['errorView']['text'];_0x9a1963['announce'](i(_0x21ff98,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x123ddc));}});}['_onExecute'](_0x3a8c87){const _0x357d5e=this['_commandDefinitions']['get'](_0x3a8c87),_0x4171db=this['editor'],_0x3dd897=_0x4171db['model']['document']['selection'],_0x3de403=_0x4171db['commands']['get']('showAIAssistant'),_0x4854ae=_0x4171db['plugins']['get'](a),_0x469f29=''+(_0x357d5e['groupId']!==K?_0x357d5e['groupLabel']+':\x20':'')+_0x357d5e['label'];if(!0x1!==_0x357d5e['requiresContent']&&_0x3dd897['isCollapsed']){const _0x24b1e9=_0x1c5153(_0x3dd897['getSelectedBlocks']())||_0x4171db['model']['schema']['getLimitElement'](_0x3dd897);_0x4171db['model']['change'](_0x448d08=>{_0x448d08['setSelection'](_0x24b1e9,'in');});}_0x4854ae['showFakeVisualSelection'](),_0x3de403['execute'](_0x357d5e['prompt'],_0x469f29,'command:'+_0x3a8c87);}['_populateMenuBarMenu'](_0x43fb1b,_0x8b6a0c,_0x571260,_0x5e79e0){const _0x88fc9a=this['editor'],_0x24ef82=_0x88fc9a['locale'],_0x420ac8=new _0x168c6e(_0x24ef82),_0x52da5e=U(_0x88fc9a,_0x571260)['filter'](_0x3d28be=>_0x3d28be['commands']['length']);0x1===_0x52da5e['length']?this['_getMenuBarGroupButtons']({'command':_0x43fb1b,'commands':_0x52da5e[0x0]['commands'],'parentMenuView':_0x8b6a0c,'onExecute':_0x5e79e0})['forEach'](_0x20a26a=>_0x420ac8['items']['add'](_0x20a26a)):_0x52da5e['forEach'](({groupId:_0x40f55d,groupLabel:_0x56af58,commands:_0x2d1950})=>{const _0x338fec=new _0x3829bd(_0x24ef82,_0x8b6a0c),_0x307285=new _0x23fd68(_0x24ef82),_0x589cfb=new _0x168c6e(_0x24ef82),_0x1cad15=this['_getMenuBarGroupButtons']({'command':_0x43fb1b,'commands':_0x2d1950,'parentMenuView':_0x307285,'onExecute':_0x5e79e0});_0x307285['buttonView']['set']({'label':_0x56af58||_0x40f55d}),_0x307285['delegate']('execute')['to'](_0x8b6a0c),_0x589cfb['items']['addMany'](_0x1cad15),_0x307285['panelView']['children']['add'](_0x589cfb),_0x338fec['children']['add'](_0x307285),_0x420ac8['items']['add'](_0x338fec);}),_0x8b6a0c['panelView']['children']['add'](_0x420ac8);}['_getMenuBarGroupButtons']({command:_0x3aa6cf,commands:_0x6a78d1,parentMenuView:_0x58477e,onExecute:_0x41d875}){const _0x2eb750=this['editor'],_0x14fa4f=_0x2eb750['locale'];return U(_0x2eb750,_0x6a78d1)['map'](_0x486b17=>{const _0x42898f=new _0x3829bd(_0x14fa4f,_0x58477e),_0x318e8d=new _0x2e44e2(_0x14fa4f);return _0x318e8d['set']({'label':_0x486b17['label']}),_0x318e8d['delegate']('execute')['to'](_0x58477e),_0x318e8d['on']('execute',()=>_0x41d875(_0x486b17['id'])),_0x318e8d['bind']('isEnabled')['to'](_0x3aa6cf,'enabledCommandsIds',_0x5b5b5c=>_0x5b5b5c['includes'](_0x486b17['id'])),_0x42898f['children']['add'](_0x318e8d),_0x42898f;});}}function T(_0x1cec58,_0x5c61f5){return void 0x0!==_0x1cec58['order']&&void 0x0===_0x5c61f5['order']?0x1:void 0x0===_0x1cec58['order']&&void 0x0!==_0x5c61f5['order']?-0x1:void 0x0!==_0x1cec58['order']&&void 0x0!==_0x5c61f5['order']?_0x1cec58['order']-_0x5c61f5['order']:0x0;}function U(_0x4c3663,_0x3da153){_0x3da153['sort'](T);const _0x312176={},_0x444e8a=[];for(const _0x4116a1 of _0x3da153)if(void 0x0!==_0x4116a1['order']){if(_0x4116a1['order']in _0x312176)throw new _0x30b07f('ai-commands-config-order-collision',_0x4c3663,{'conflictingDefinitions':[_0x4116a1,_0x312176[_0x4116a1['order']]]});_0x312176[_0x4116a1['order']]=_0x4116a1,_0x444e8a['splice'](_0x4116a1['order'],0x0,_0x4116a1);}else _0x444e8a['push'](_0x4116a1);return _0x444e8a;}class At extends _0x149aa2{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3adb61){super(_0x3adb61);const _0x5492fb=_0x3adb61['config'],_0x56c933=_0x3adb61['locale'];_0x5492fb['define']('ai.aiAssistant.preserveComments',!0x0),_0x5492fb['define']('ai.aiAssistant.commands',_t(_0x56c933)),_0x5492fb['define']('ai.aiAssistant.extraCommandGroups',[]),_0x5492fb['define']('ai.aiAssistant.removeCommands',[]);let _0x39c001=o(_0x5492fb['get']('ai.aiAssistant.commands'),_0x56c933);const _0x239cbd=_0x5492fb['get']('ai.aiAssistant.extraCommandGroups'),_0x3be7cb=_0x5492fb['get']('ai.aiAssistant.removeCommands');_0x239cbd['forEach'](_0x1dfc67=>{const _0x1faf20=_0x39c001['find'](_0x435d2f=>_0x435d2f['groupId']===_0x1dfc67['groupId']);_0x1faf20?_0x1faf20['commands']=_0x1faf20['commands']['concat'](_0x1dfc67['commands']):_0x39c001['push'](_0x1dfc67);}),_0x39c001=_0x39c001['filter'](_0x5d9844=>!_0x3be7cb['includes'](_0x5d9844['groupId'])),_0x39c001['forEach'](_0x2f6e9f=>{_0x2f6e9f['commands']=_0x2f6e9f['commands']['filter'](_0x12c9be=>!_0x3be7cb['includes'](_0x12c9be['id']));}),_0x5492fb['set']('ai.aiAssistant.commands',_0x39c001);}}function _t(_0x1cc53a){return[{'groupId':'editOrReview','groupLabel':i(_0x1cc53a,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x1cc53a,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x1cc53a,'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(_0x1cc53a,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x1cc53a,'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(_0x1cc53a,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x1cc53a,'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(_0x1cc53a,'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(_0x1cc53a,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x1cc53a,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x1cc53a,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x1cc53a,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x1cc53a,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x1cc53a,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x1cc53a,'Change\x20style'),'commands':[{'id':'business','label':i(_0x1cc53a,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x1cc53a,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x1cc53a,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x1cc53a,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x1cc53a,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x1cc53a,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x1cc53a,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x1cc53a,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x1cc53a,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x1cc53a,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x1cc53a,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x1cc53a,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x1cc53a,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x149aa2{['abortController'];static get['requires'](){return[x];}constructor(_0x4931de){super(_0x4931de),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x594581){return this['sendRequest'](_0x594581)['catch'](_0x4f1400=>{if(_0x4f1400 instanceof R)return Promise['reject'](_0x4f1400);if('AbortError'==_0x4f1400['name'])return Promise['resolve']();throw console['error'](_0x4f1400),new _0x30b07f('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x33e062,_0x5bfe0e){const _0x1fdbdd=this['editor']['locale'],_0x1e0b57={'Content-Type':'application/json'};if('object'==typeof _0x33e062)Object['assign'](_0x1e0b57,_0x33e062);else{if(_0x33e062)try{const _0x40edd6=await _0x33e062(_0x5bfe0e);Object['assign'](_0x1e0b57,_0x40edd6);}catch{return Promise['reject'](new R(i(_0x1fdbdd,'AI_ERROR_GET_HEADERS')));}}return _0x1e0b57;}async['_prepareRequestParameters'](_0x1bb99a,_0x343577){const _0x54b6a0=this['editor']['locale'];if('object'==typeof _0x1bb99a)return _0x1bb99a;try{return await _0x1bb99a(_0x343577);}catch{return Promise['reject'](new R(i(_0x54b6a0,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x43986c){super(_0x43986c),_0x43986c['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x43986c['config']['get']('ai.openAI.requestParameters')||_0x43986c['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x43986c['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x43986c['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x43986c['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x512809,context:_0x3873c3,onData:_0x120ef,actionId:_0x372144}){const _0x24650e=this['editor']['locale'],_0x53c8f2=await this['prepareMessages'](_0x512809,_0x3873c3,_0x372144),_0x3faa50=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x372144),_0x1c9641=await this['_prepareRequestParameters'](this['_requestParameters'],_0x372144),_0x54afed={'messages':_0x53c8f2,..._0x1c9641},_0x21064d={'method':'POST','headers':_0x3faa50,'body':JSON['stringify'](_0x54afed),'signal':this['abortController']['signal']},_0x412df2=await fetch(this['_apiUrl'],_0x21064d);if(_0x412df2['ok'])return _0x1c9641['stream']?await this['_readStreamableResponse'](_0x412df2,_0x120ef):await this['_readStaticResponse'](_0x412df2,_0x120ef),Promise['resolve']();{const _0xe07640=await _0x412df2['text']();return _0xe07640['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x24650e,'AI_ERROR_CONTEXT_LENGTH'))):_0xe07640['includes']('Moderation')?Promise['reject'](new R(i(_0x24650e,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xe07640));}}async['prepareMessages'](_0x57ab8d,_0x4b0b2b,_0x543530){let _0x527ae3,_0x3f67f3;return _0x4b0b2b?(_0x527ae3='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.',_0x3f67f3='Instruction:\x0a'+_0x57ab8d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4b0b2b):(_0x527ae3='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.',_0x3f67f3=_0x57ab8d),[{'role':'system','content':_0x527ae3},{'role':'user','content':_0x3f67f3}];}async['_readStreamableResponse'](_0x93c6dd,_0x1104b9){const _0x26fced=_0x93c6dd['body']['getReader'](),_0x2285d2=new TextDecoder();let _0x20551e='',_0x19a627='',_0x5abc43='',_0x74c630=!0x1;for(;!_0x74c630;){const {done:_0x256ba5,value:_0x359730}=await _0x26fced['read'](),_0x5a8384=_0x20551e+_0x2285d2['decode'](_0x359730);let _0x1194e8='';_0x74c630=_0x256ba5;try{_0x1194e8=this['_cleanUpData'](_0x5a8384),_0x20551e='';}catch{_0x20551e=_0x5a8384;continue;}_0x19a627+=_0x1194e8,!_0x74c630&&this['_isBufferIncomplete'](_0x19a627)||_0x19a627&&(_0x5abc43+=_0x19a627,_0x19a627='',_0x1104b9(_0x5abc43));}return Promise['resolve']();}async['_readStaticResponse'](_0xf55eb3,_0x1daf0d){return _0x1daf0d((await _0xf55eb3['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x34c1c0){const _0x4d021f=_0x34c1c0['split']('<')['length']!==_0x34c1c0['split']('>')['length'],_0x2dfda6=_0x34c1c0['length']<0x1e;return _0x4d021f&&_0x2dfda6;}['_cleanUpData'](_0x22b564){return _0x22b564['split'](/\n(?![^{]*\})/g)['map'](_0x54c542=>_0x54c542['replace']('data:\x20',''))['filter'](_0x502138=>_0x502138&&_0x502138['length']>0x0&&'[DONE]'!==_0x502138)['map'](_0x3f1e3a=>{const {choices:_0x34d05b}=JSON['parse'](_0x3f1e3a);if(_0x34d05b[0x0]?.['delta']?.['content'])return _0x34d05b[0x0]['delta']['content'];})['filter'](_0x4a1397=>_0x4a1397)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x3d6fbd){super(_0x3d6fbd),_0x3d6fbd['config']['get']('ai.aws.requestParameters')||_0x3d6fbd['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']=_0x3d6fbd['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x3d6fbd['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x3d6fbd['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x3d6fbd['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x1938ad,context:_0x3953b1,onData:_0x57b19f,actionId:_0x21be1b}){const {model:_0x185d59,stream:_0x40414d,..._0x5e96f2}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x21be1b),_0x4fced2={'prompt':await this['preparePrompt'](_0x1938ad,_0x3953b1,_0x185d59,_0x21be1b),..._0x5e96f2};this['_apiUrl']?await this['_processProxyRequest'](_0x4fced2,_0x185d59,_0x40414d,_0x57b19f,_0x21be1b):await this['_processAWSRequest'](_0x4fced2,_0x185d59,_0x40414d,_0x57b19f);}async['preparePrompt'](_0x126ea8,_0x24a24f,_0x1f461f,_0x540dbb){let _0x7b8f9,_0x23fba2;return _0x24a24f?(_0x7b8f9='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.',_0x23fba2='Instruction:\x0a'+_0x126ea8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x24a24f):(_0x7b8f9='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.',_0x23fba2=_0x126ea8),'meta.llama'==this['getModelFamily'](_0x1f461f)?'<<SYS>>\x0a'+_0x7b8f9+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x23fba2+'\x0a[/INST]':'Human:\x0a'+_0x7b8f9+'\x0a'+_0x23fba2+'\x0a\x0aAssistant:';}['getModelFamily'](_0x4ff907){if(/^anthropic\.claude/['test'](_0x4ff907))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x4ff907))return'ai21.j2';if(/^cohere\.command/['test'](_0x4ff907))return'cohere.command';if(/^meta\.llama/['test'](_0x4ff907))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x4ff907));}async['_processProxyRequest'](_0xdcc4d9,_0x8ef7ed,_0xee2ab3,_0x417769,_0x2c89c7){const _0x1c5576={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2c89c7),'body':JSON['stringify']({..._0xdcc4d9,'model':_0x8ef7ed,'stream':_0xee2ab3}),'signal':this['abortController']['signal']},_0x51517f=await fetch(this['_apiUrl'],_0x1c5576);_0xee2ab3?await this['_readStreamableResponse'](_0x51517f,_0x8ef7ed,_0x417769):await this['_readStaticResponse'](_0x51517f,_0x8ef7ed,_0x417769);}async['_processAWSRequest'](_0x3158a7,_0x452558,_0x872392,_0x383d90){const _0x4663d1=new _0x188d3f(this['_bedrockClientConfig']),_0x34f02d={'body':JSON['stringify'](_0x3158a7),'contentType':'application/json','accept':'application/json','modelId':_0x452558};let _0x4e566e;if(_0x872392){const _0x188178=new _0x444591(_0x34f02d);_0x4e566e=await _0x4663d1['send'](_0x188178,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x4e566e,_0x452558,_0x383d90);}else{const _0x58e0fe=new _0x3f02ed(_0x34f02d);_0x4e566e=await _0x4663d1['send'](_0x58e0fe,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x4e566e,_0x452558,_0x383d90);}}async['_readAsyncIterableResponse'](_0x8c8ea7,_0x261e3e,_0x266d4a){const _0x329cd1=_0x8c8ea7['body'],_0x429f75=new TextDecoder('utf-8');let _0x3a6d4a='';for await(const _0x4f6d20 of _0x329cd1)if(_0x4f6d20['chunk']){const _0x12487c=_0x429f75['decode'](_0x4f6d20['chunk']['bytes']),_0x15b176=JSON['parse'](_0x12487c);_0x3a6d4a+=this['_getGeneratedText'](_0x15b176,_0x261e3e),_0x266d4a(_0x3a6d4a);}return Promise['resolve']();}async['_readStreamableResponse'](_0x551e15,_0x5a535b,_0x53feba){const _0x4d03d8=_0x551e15['body'],_0x13d8eb=new TextDecoder('utf-8'),_0x524ac9=_0x4d03d8['getReader']();let _0x58fa95='',_0x82c6ba='',_0x268da0=!0x1;for(;!_0x268da0;){const {done:_0x56acb2,value:_0xbc4243}=await _0x524ac9['read']();if(_0x268da0=_0x56acb2,_0x268da0)break;const _0x4f99b8=(_0x58fa95+_0x13d8eb['decode'](_0xbc4243))['split']('\x0a')['map'](_0x4a98cf=>{try{return _0x58fa95='',JSON['parse'](_0x4a98cf);}catch{return _0x58fa95=_0x4a98cf,null;}})['filter'](_0x376e38=>null!==_0x376e38);_0x4f99b8['length']&&(_0x82c6ba+=_0x4f99b8['map'](_0x59fc17=>this['_getGeneratedText'](_0x59fc17,_0x5a535b))['join'](''),_0x53feba(_0x82c6ba));}return Promise['resolve']();}async['_readStaticResponse'](_0x16e55c,_0x50fdb9,_0x35f6ae){let _0x1dff92;return _0x1dff92=_0x16e55c instanceof Response?await _0x16e55c['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x16e55c['body'])),(_0x35f6ae(this['_getGeneratedText'](_0x1dff92,_0x50fdb9)),Promise['resolve']());}['_getGeneratedText'](_0x111b47,_0x35c6e0){switch(this['getModelFamily'](_0x35c6e0)){case'anthropic.claude':return _0x111b47['completion'];case'ai21.j2':return _0x111b47['completions'][0x0]['data']['text'];case'cohere.command':return _0x111b47['generations'][0x0]['text'];case'meta.llama':return _0x111b47['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
@@ -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':_0x2e1427=>0x1!=_0x2e1427}};
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':_0x52560b=>0x1!=_0x52560b}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x93c58f=>{const {af:{dictionary:_0x582206,getPluralForm:_0x33b5f6}}={'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':_0x4c78d4=>0x1!=_0x4c78d4}};_0x93c58f['af']||={'dictionary':{},'getPluralForm':null},_0x93c58f['af']['dictionary']=Object['assign'](_0x93c58f['af']['dictionary'],_0x582206),_0x93c58f['af']['getPluralForm']=_0x33b5f6;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x588035=>{const {af:{dictionary:_0x53b2f9,getPluralForm:_0x2c1a94}}={'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':_0x3f1e9b=>0x1!=_0x3f1e9b}};_0x588035['af']||={'dictionary':{},'getPluralForm':null},_0x588035['af']['dictionary']=Object['assign'](_0x588035['af']['dictionary'],_0x53b2f9),_0x588035['af']['getPluralForm']=_0x2c1a94;})(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':_0x7d8dd1=>0x0==_0x7d8dd1?0x0:0x1==_0x7d8dd1?0x1:0x2==_0x7d8dd1?0x2:_0x7d8dd1%0x64>=0x3&&_0x7d8dd1%0x64<=0xa?0x3:_0x7d8dd1%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':_0x29db55=>0x0==_0x29db55?0x0:0x1==_0x29db55?0x1:0x2==_0x29db55?0x2:_0x29db55%0x64>=0x3&&_0x29db55%0x64<=0xa?0x3:_0x29db55%0x64>=0xb?0x4:0x5}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x998771=>{const {ar:{dictionary:_0x542b5a,getPluralForm:_0x42bc59}}={'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':_0x48e552=>0x0==_0x48e552?0x0:0x1==_0x48e552?0x1:0x2==_0x48e552?0x2:_0x48e552%0x64>=0x3&&_0x48e552%0x64<=0xa?0x3:_0x48e552%0x64>=0xb?0x4:0x5}};_0x998771['ar']||={'dictionary':{},'getPluralForm':null},_0x998771['ar']['dictionary']=Object['assign'](_0x998771['ar']['dictionary'],_0x542b5a),_0x998771['ar']['getPluralForm']=_0x42bc59;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x421a61=>{const {ar:{dictionary:_0x147c65,getPluralForm:_0x5593d1}}={'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':_0x28501f=>0x0==_0x28501f?0x0:0x1==_0x28501f?0x1:0x2==_0x28501f?0x2:_0x28501f%0x64>=0x3&&_0x28501f%0x64<=0xa?0x3:_0x28501f%0x64>=0xb?0x4:0x5}};_0x421a61['ar']||={'dictionary':{},'getPluralForm':null},_0x421a61['ar']['dictionary']=Object['assign'](_0x421a61['ar']['dictionary'],_0x147c65),_0x421a61['ar']['getPluralForm']=_0x5593d1;})(window['CKEDITOR_TRANSLATIONS']||={});