@ckeditor/ckeditor5-ai 45.0.0-alpha.9 → 45.0.0

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 (170) 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.js +1 -1
  154. package/src/aiassistant.js +1 -1
  155. package/src/aiassistantediting.js +1 -1
  156. package/src/aiassistantui.js +1 -1
  157. package/src/index.js +1 -1
  158. package/src/legacyerrors.js +1 -1
  159. package/src/ui/aiassistantcontroller.js +2 -2
  160. package/src/ui/form/aiformcontentarea.js +1 -1
  161. package/src/ui/form/aiformerrorview.js +1 -1
  162. package/src/ui/form/aiformpromptview.js +1 -1
  163. package/src/ui/form/aiformtoolbarview.js +1 -1
  164. package/src/ui/form/aiformview.js +1 -1
  165. package/src/ui/form/aihistorylistitemview.js +1 -1
  166. package/src/ui/form/aihistorylistview.js +1 -1
  167. package/src/ui/form/prompthistory.js +1 -1
  168. package/src/ui/showaiassistantcommand.js +1 -1
  169. package/src/utils/common-translations.js +1 -1
  170. 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 _0x11703a,Command as _0x235cc6}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2c4ba2,IconCheck as _0x17a43d,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x2fd707,IconRobotPencil as _0x147493}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x54714e,CKEditorError as _0x5e153c,ObservableMixin as _0x2d288d,global as _0x3ca616,isVisible as ot,Rect as it,Collection as _0x494c54,FocusTracker as mt,KeystrokeHandler as ut,first as _0xbc1f83}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x260786,View as _0x38ffe9,SpinnerView as _0x33570f,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x4f70a2,createDropdown as _0xd3519e,addMenuToDropdown as _0x5baf95,MenuBarMenuView as _0x49fd2d,MenuBarMenuListItemButtonView as _0x7cd0bd,DialogViewPosition as _0x32ed05,MenuBarMenuListView as _0x18244a,MenuBarMenuListItemView as _0x3b2b48}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x40f32a,ClipboardMarkersUtils as _0x5e9943}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x404349,DataTransfer as _0x226ef5,UpcastWriter as _0x410430,Matcher as _0x1f744a}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0xe2e5c4,InvokeModelWithResponseStreamCommand as _0xe8b23,InvokeModelCommand as _0x51ff0f}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x26fa7f,_0x489e1c){const _0x2c7802=(0x0,_0x489e1c['t'])('Other');return _0x26fa7f['length']?'groupId'in _0x26fa7f[0x0]?_0x26fa7f:[{'groupId':x,'groupLabel':_0x2c7802,'order':0x1/0x0,'commands':_0x26fa7f}]:[{'groupId':x,'groupLabel':_0x2c7802,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x11703a{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4f9cca}=this,_0x29f49c=['ck-fake-ai-selection'];_0x4f9cca['config']['get']('ai.useTheme')&&_0x29f49c['push']('ck-ai-assistant-ui_theme'),_0x4f9cca['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x29f49c,'priority':0xc}}),_0x4f9cca['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x45b2d6,{writer:_0x323d58})=>{if(!_0x45b2d6['markerRange']['isCollapsed'])return null;const _0x18a68f=_0x323d58['createUIElement']('span');return _0x323d58['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x18a68f),_0x18a68f;}});}['afterInit'](){!async function(_0x1cd272){const _0x36746a=_0x51646c([0x41,0x54,0x74,0x33,0x75,0x42,0x48,0x62,0x51,0x4a,0x52,0x32,0x55,0x4f,0x35,0x79,0x38,0x36,0x77,0x37,0x65,0x53,0x34,0x4e,0x4b,0x44,0x50,0x46,0x6e,0x76,0x69,0x5a,0x68,0x71,0x45,0x72,0x61,0x66,0x56,0x64,0x67,0x31,0x70,0x47,0x57,0x6d,0x4d,0x59,0x39,0x6c,0x4c,0x78,0x30,0x6b,0x43,0x49,0x63,0x58,0x6a,0x6f,0x73,0x7a]),_0x2e84cf=0x5501ce6d,_0x1c0e72=0x5506aa7d^_0x2e84cf,_0x2d997b=window[_0x51646c([0x44,0x61,0x74,0x65])][_0x51646c([0x6e,0x6f,0x77])](),_0x20b2ff=_0x1cd272[_0x51646c([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x432c0a=new window[(_0x51646c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x185e30=>{_0x20b2ff[_0x51646c([0x6f,0x6e,0x63,0x65])](_0x51646c([0x72,0x65,0x61,0x64,0x79]),_0x185e30);}),_0x3cb5d3={[_0x51646c([0x6b,0x74,0x79])]:_0x51646c([0x45,0x43]),[_0x51646c([0x75,0x73,0x65])]:_0x51646c([0x73,0x69,0x67]),[_0x51646c([0x63,0x72,0x76])]:_0x51646c([0x50,0x2d,0x32,0x35,0x36]),[_0x51646c([0x78])]:_0x51646c([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]),[_0x51646c([0x79])]:_0x51646c([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]),[_0x51646c([0x61,0x6c,0x67])]:_0x51646c([0x45,0x53,0x32,0x35,0x36])},_0x59511f=_0x20b2ff[_0x51646c([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x51646c([0x67,0x65,0x74])](_0x51646c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x251c0a(){let _0x9b780c,_0x3eadc8=null,_0x382ebc=null;try{if(_0x59511f==_0x51646c([0x47,0x50,0x4c]))return _0x51646c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x9b780c=_0x2c9d95(),!_0x9b780c)return _0x51646c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x9b780c[_0x51646c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x382ebc=_0x1dd804(_0x9b780c[_0x51646c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x9b780c[_0x51646c([0x6a,0x74,0x69])])),await _0x39c8d3()?_0x46a0ed()?_0x3ad93f()?_0x51646c([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3c33b3()?(_0x9b780c[_0x51646c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x51646c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x3eadc8=_0x542062(_0x51646c([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x9b780c[_0x51646c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x51646c([0x74,0x72,0x69,0x61,0x6c])&&(_0x3eadc8=_0x542062(_0x51646c([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x72118d()):_0x51646c([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x51646c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x51646c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x343b49){return _0x51646c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3ad93f(){const _0x75c844=[_0x51646c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x51646c([0x74,0x72,0x69,0x61,0x6c])][_0x51646c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x9b780c[_0x51646c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x2d997b/0x3e8:0xe10*_0x1c0e72;return _0x9b780c[_0x51646c([0x65,0x78,0x70])]<_0x75c844;}function _0x46a0ed(){const _0x316e61=_0x9b780c[_0x51646c([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x316e61&&(!!_0x316e61[_0x51646c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x51646c([0x2a]))||!!_0x316e61[_0x51646c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x51646c([0x41,0x49])));}function _0x3c33b3(){const _0x2c9632=_0x9b780c[_0x51646c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2c9632||0x0==_0x2c9632[_0x51646c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0xcea3a9}=new URL(window[_0x51646c([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2c9632[_0x51646c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xcea3a9))return!0x0;const _0x5ef084=_0xcea3a9[_0x51646c([0x73,0x70,0x6c,0x69,0x74])](_0x51646c([0x2e]));return _0x2c9632[_0x51646c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xa6a08f=>_0xa6a08f[_0x51646c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x51646c([0x2a])))[_0x51646c([0x6d,0x61,0x70])](_0x50153c=>_0x50153c[_0x51646c([0x73,0x70,0x6c,0x69,0x74])](_0x51646c([0x2e])))[_0x51646c([0x73,0x6f,0x6d,0x65])](_0x242ef5=>_0x5ef084[_0x51646c([0x65,0x76,0x65,0x72,0x79])]((_0x464736,_0x15ad0e)=>_0x242ef5[_0x15ad0e]===_0x464736||_0x242ef5[_0x15ad0e]===_0x51646c([0x2a])));}function _0x72118d(){return _0x3eadc8&&_0x382ebc?new window[(_0x51646c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1152fa,_0x32c1cf)=>{_0x3eadc8[_0x51646c([0x74,0x68,0x65,0x6e])](_0x1152fa,_0x32c1cf),_0x382ebc[_0x51646c([0x74,0x68,0x65,0x6e])](_0x1bc9c1=>{_0x1bc9c1!=_0x51646c([0x56,0x61,0x6c,0x69,0x64])&&_0x1152fa(_0x1bc9c1);},_0x32c1cf);}):_0x3eadc8||_0x382ebc||_0x51646c([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1dd804(_0x5c5e63,_0x201aa6){return new window[(_0x51646c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xb9f7a4=>{if(_0x629de6())return _0xb9f7a4(_0x51646c([0x56,0x61,0x6c,0x69,0x64]));_0x6d4006(),_0x20b2ff[_0x51646c([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x51646c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3cf057=!0x1;const _0x451360=_0x54714e();function _0x99e527(_0x186ca5){return!!_0x186ca5&&(typeof _0x186ca5===_0x51646c([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x186ca5===_0x51646c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x186ca5[_0x51646c([0x74,0x68,0x65,0x6e])]===_0x51646c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x186ca5[_0x51646c([0x63,0x61,0x74,0x63,0x68])]===_0x51646c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x522bb5(_0x3e7b85){_0x4c04ad(_0x3e7b85)[_0x51646c([0x74,0x68,0x65,0x6e])](_0x53b6c2=>{if(!_0x53b6c2||_0x53b6c2[_0x51646c([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x51646c([0x6f,0x6b]))return _0x51646c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x513954(_0x593fb9(_0x451360+_0x201aa6))!=_0x53b6c2[_0x51646c([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x51646c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x51646c([0x56,0x61,0x6c,0x69,0x64]);})[_0x51646c([0x74,0x68,0x65,0x6e])](_0x517d15=>(_0x101e6d(),_0x517d15),()=>{const _0x14d066=_0x9752f7();return null==_0x14d066?(_0x101e6d(),_0x51646c([0x56,0x61,0x6c,0x69,0x64])):_0x51646c(_0x2d997b-_0x14d066>(0x710d4a6d^_0x2e84cf)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x51646c([0x74,0x68,0x65,0x6e])](_0xb9f7a4)[_0x51646c([0x63,0x61,0x74,0x63,0x68])](()=>{_0xb9f7a4(_0x51646c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x443905=0x553720ed^_0x2e84cf;function _0x101e6d(){const _0x21faf1=_0x51646c([0x6c,0x6c,0x63,0x74,0x2d])+_0x513954(_0x593fb9(_0x5c5e63)),_0x3659fa=_0x2becdb(_0x513954(window[_0x51646c([0x4d,0x61,0x74,0x68])][_0x51646c([0x63,0x65,0x69,0x6c])](_0x2d997b/_0x443905)));window[_0x51646c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x51646c([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x21faf1,_0x3659fa);}function _0x9752f7(){const _0x30c204=_0x51646c([0x6c,0x6c,0x63,0x74,0x2d])+_0x513954(_0x593fb9(_0x5c5e63)),_0x35cff5=window[_0x51646c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x51646c([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x30c204);return _0x35cff5?window[_0x51646c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2becdb(_0x35cff5),0x10)*_0x443905:null;}function _0x4c04ad(_0x2ba306){return new window[(_0x51646c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3187f7,_0x3ce6b4)=>{_0x2ba306[_0x51646c([0x74,0x68,0x65,0x6e])](_0x3187f7,_0x3ce6b4),window[_0x51646c([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3ce6b4,0x55001aad^_0x2e84cf);});}}_0x20b2ff[_0x51646c([0x6f,0x6e])](_0x51646c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x129ca8,_0x1fc705)=>{if(_0x1fc705[0x0]!=_0x5c5e63)return _0xb9f7a4(_0x51646c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x1fc705[0x1]={..._0x1fc705[0x1],[_0x51646c([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x451360};},{[_0x51646c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x51646c([0x68,0x69,0x67,0x68])}),_0x20b2ff[_0x51646c([0x6f,0x6e])](_0x51646c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x59a391=>{_0x99e527(_0x59a391[_0x51646c([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3cf057=!0x0,_0x522bb5(_0x59a391[_0x51646c([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x51646c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x51646c([0x6c,0x6f,0x77])}),_0x432c0a[_0x51646c([0x74,0x68,0x65,0x6e])](()=>{_0x3cf057||_0xb9f7a4(_0x51646c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x629de6(){return _0x20b2ff[_0x51646c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x51646c([0x76,0x69,0x65,0x77])][_0x51646c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x51646c([0x61,0x75,0x74,0x6f]);}function _0x6d4006(){_0x20b2ff[_0x51646c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x51646c([0x76,0x69,0x65,0x77])][_0x51646c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x51646c([0x61,0x75,0x74,0x6f]);}}function _0x542062(_0x449652){const _0x54e5a3=[new window[(_0x51646c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2b21c4=>setTimeout(_0x2b21c4,0x5508f0a1^_0x2e84cf)),_0x432c0a[_0x51646c([0x74,0x68,0x65,0x6e])](()=>new window[(_0x51646c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5ab1b7=>{let _0x10cb30=0x0;_0x20b2ff[_0x51646c([0x6d,0x6f,0x64,0x65,0x6c])][_0x51646c([0x6f,0x6e])](_0x51646c([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3bea63,_0xdbf1b0)=>{_0xdbf1b0[0x0][_0x51646c([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x10cb30++,_0x10cb30==(0x5501cf95^_0x2e84cf)&&(_0x5ab1b7(),_0x3bea63[_0x51646c([0x6f,0x66,0x66])]());});}))];return window[_0x51646c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x51646c([0x72,0x61,0x63,0x65])](_0x54e5a3)[_0x51646c([0x74,0x68,0x65,0x6e])](()=>_0x449652);}async function _0x4e3198(){await _0x432c0a,_0x20b2ff[_0x51646c([0x6d,0x6f,0x64,0x65,0x6c])][_0x51646c([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3885c6,_0x20b2ff[_0x51646c([0x6d,0x6f,0x64,0x65,0x6c])][_0x51646c([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3885c6,_0x20b2ff[_0x51646c([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x51646c([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xbea023(_0x357a){const _0x19fe9a=_0x4776b3();_0x20b2ff[_0x19fe9a]=_0x51646c([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x357a,_0x357a!=_0x51646c([0x56,0x61,0x6c,0x69,0x64])&&_0x4e3198();}function _0x4776b3(){const _0x43eb14=window[_0x51646c([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x51646c([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x51646c([0x6e,0x6f,0x77])]())[_0x51646c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x51646c([0x2e]),'');let _0x4f04ca=_0x51646c([0x41]);for(let _0x452058=0x0;_0x452058<_0x43eb14[_0x51646c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x452058+=0x2){let _0x49bea5=window[_0x51646c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x43eb14[_0x51646c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x452058,_0x452058+0x2));_0x49bea5>=_0x36746a[_0x51646c([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x49bea5-=_0x36746a[_0x51646c([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4f04ca+=_0x36746a[_0x49bea5];}return _0x4f04ca;}function _0x2c9d95(){const _0x48b245=_0x59511f[_0x51646c([0x73,0x70,0x6c,0x69,0x74])](_0x51646c([0x2e]));if(0x3!=_0x48b245[_0x51646c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x684e22(_0x48b245[0x1]);function _0x684e22(_0x38f7f7){const _0x229952=_0x5c4580(_0x38f7f7);return _0x229952&&_0x333fc3()?_0x229952:null;function _0x333fc3(){const _0xe69fee=_0x229952[_0x51646c([0x6a,0x74,0x69])],_0x37aed8=window[_0x51646c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xe69fee[_0x51646c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xe69fee[_0x51646c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x346009={..._0x229952,[_0x51646c([0x6a,0x74,0x69])]:_0xe69fee[_0x51646c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0xe69fee[_0x51646c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x346009[_0x51646c([0x76,0x63])],_0x593fb9(_0x346009)==_0x37aed8;}}}async function _0x39c8d3(){let _0x5c47d8=!0x0;try{const _0xaaa85a=_0x59511f[_0x51646c([0x73,0x70,0x6c,0x69,0x74])](_0x51646c([0x2e])),[_0x45fb4e,_0x9effe3,_0x540ac6]=_0xaaa85a;return _0x2bc0f1(_0x45fb4e),await _0x5e2445(_0x45fb4e,_0x9effe3,_0x540ac6),_0x5c47d8;}catch(_0x15d8af){return!0x1;}function _0x2bc0f1(_0x25efa0){const _0x3508d9=_0x5c4580(_0x25efa0);_0x3508d9&&_0x3508d9[_0x51646c([0x61,0x6c,0x67])]==_0x51646c([0x45,0x53,0x32,0x35,0x36])||(_0x5c47d8=!0x1);}async function _0x5e2445(_0x2939a2,_0x1377b2,_0x496bf4){const _0x47c4d4=window[_0x51646c([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x51646c([0x66,0x72,0x6f,0x6d])](_0x12e6dc(_0x496bf4),_0x244829=>_0x244829[_0x51646c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4b8fb6=new window[(_0x51646c([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x51646c([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x2939a2+_0x51646c([0x2e])+_0x1377b2),_0xb8b4d0=window[_0x51646c([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x51646c([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0xb8b4d0)return;const _0x9de401=await _0xb8b4d0[_0x51646c([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x51646c([0x6a,0x77,0x6b]),_0x3cb5d3,{[_0x51646c([0x6e,0x61,0x6d,0x65])]:_0x51646c([0x45,0x43,0x44,0x53,0x41]),[_0x51646c([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x51646c([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x51646c([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0xb8b4d0[_0x51646c([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x51646c([0x6e,0x61,0x6d,0x65])]:_0x51646c([0x45,0x43,0x44,0x53,0x41]),[_0x51646c([0x68,0x61,0x73,0x68])]:{[_0x51646c([0x6e,0x61,0x6d,0x65])]:_0x51646c([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x9de401,_0x47c4d4,_0x4b8fb6)||(_0x5c47d8=!0x1);}}function _0x5c4580(_0x34d941){return _0x34d941[_0x51646c([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x51646c([0x65,0x79]))?JSON[_0x51646c([0x70,0x61,0x72,0x73,0x65])](_0x12e6dc(_0x34d941)):null;}function _0x12e6dc(_0x5d1b7a){return window[_0x51646c([0x61,0x74,0x6f,0x62])](_0x5d1b7a[_0x51646c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x51646c([0x2b]))[_0x51646c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x51646c([0x2f])));}function _0x593fb9(_0x583aa5){let _0x5cad47=0x1505;function _0x473e19(_0x19dd2f){for(let _0x23a096=0x0;_0x23a096<_0x19dd2f[_0x51646c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x23a096++){const _0x3e3bc6=_0x19dd2f[_0x51646c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x23a096);_0x5cad47=(_0x5cad47<<0x5)+_0x5cad47+_0x3e3bc6,_0x5cad47&=_0x5cad47;}}function _0xf45a98(_0x580a7e){Array[_0x51646c([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x580a7e)?_0x580a7e[_0x51646c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0xf45a98):_0x580a7e&&typeof _0x580a7e==_0x51646c([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x51646c([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x580a7e)[_0x51646c([0x73,0x6f,0x72,0x74])]()[_0x51646c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x584db8,_0x592f49])=>{_0x473e19(_0x584db8),_0xf45a98(_0x592f49);}):_0x473e19(window[_0x51646c([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x580a7e));}return _0xf45a98(_0x583aa5),_0x5cad47>>>0x0;}function _0x513954(_0x297cb8){return _0x297cb8[_0x51646c([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x51646c([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x51646c([0x30]));}function _0x2becdb(_0x4d81d5){return _0x4d81d5[_0x51646c([0x73,0x70,0x6c,0x69,0x74])]('')[_0x51646c([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x51646c([0x6a,0x6f,0x69,0x6e])]('');}function _0x3885c6(){}function _0x51646c(_0x4e4114){return _0x4e4114['map'](_0x103eb7=>String['fromCharCode'](_0x103eb7))['join']('');}_0xbea023(await _0x251c0a());}(this);}['showFakeVisualSelection'](){const _0x2c66b3=this['editor']['model'];_0x2c66b3['change'](_0x134938=>{const _0x439c0a=_0x2c66b3['document']['selection']['getRanges']();let _0x4013b5=0x0;for(const _0x36bb21 of _0x439c0a){const _0x368437=f+':'+_0x4013b5;if(_0x2c66b3['markers']['has'](_0x368437))_0x134938['updateMarker'](_0x368437,{'range':_0x36bb21});else{if(_0x36bb21['start']['isAtEnd']){const _0x23f4f7=_0x36bb21['start']['getLastMatchingPosition'](({item:_0x3a6079})=>!_0x2c66b3['schema']['isContent'](_0x3a6079),{'boundaries':_0x36bb21});_0x134938['addMarker'](_0x368437,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x134938['createRange'](_0x23f4f7,_0x36bb21['end'])});}else _0x134938['addMarker'](_0x368437,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x36bb21});}_0x4013b5++;}});}['hideFakeVisualSelection'](){const _0x14f6d3=this['editor']['model'],_0x2bacca=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x2bacca['length']&&_0x14f6d3['change'](_0x226a9d=>{_0x2bacca['forEach'](_0xe2b5b1=>{_0x226a9d['removeMarker'](_0xe2b5b1);});});}['insertContent'](_0x2a73a4,_0xe5b570){const _0x2e7444=this['_getAISelection'](),_0x5699f2=_0xe5b570||_0x2e7444['getFirstRange']();this['editor']['model']['canEditAt'](_0x5699f2)&&this['editor']['model']['change'](_0x22fe55=>{this['hideFakeVisualSelection'](),_0xe5b570||this['_resetContentOfSelectedTableCells'](_0x22fe55,_0x2e7444),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5699f2,'writer':_0x22fe55,'html':_0x2a73a4});});}['insertContentBelow'](_0x21a89d){const {model:_0x53d1c9}=this['editor'],_0x33e1b1=this['_getAISelection']();_0x53d1c9['change'](()=>{const _0xca706d=this['_prepareTableInsertBelowPosition'](_0x21a89d,_0x33e1b1)||this['_getDefaultInsertBelowPosition'](_0x33e1b1);this['insertContent'](_0x21a89d,_0xca706d);});}['_getAISelection'](){const _0x2f93bb=this['editor']['model'],_0x1bd59f=Array['from'](_0x2f93bb['markers']['getMarkersGroup'](f))['map'](_0x4129be=>_0x4129be['getRange']());return _0x2f93bb['createSelection'](_0x1bd59f);}['_pasteHTMLUsingClipboard']({writer:_0x257854,html:_0x36778b,insertAt:_0x3bbc3b}){const {view:_0x172f55}=this['editor']['editing'],_0xb751fd=this['editor']['plugins']['get'](_0x40f32a),_0x194bcd=new gt();_0x194bcd['setData']('text/html',_0x36778b);const _0x442ecf=new ClipboardEvent('paste',{'clipboardData':_0x194bcd}),_0x258f7d=new _0x404349(_0x172f55,_0x442ecf,{'dataTransfer':new _0x226ef5(_0x194bcd)});_0x257854['setSelection'](_0x3bbc3b);const _0x3a95dc=(_0x3aafc6,_0x5b4902)=>{_0x5b4902['resultRange']&&_0x257854['setSelection'](_0x5b4902['resultRange']);};_0xb751fd['once']('contentInsertion',_0x3a95dc,{'priority':'lowest'}),_0x172f55['document']['fire']('paste',_0x258f7d),_0xb751fd['off']('contentInsertion',_0x3a95dc);}['_getDefaultInsertBelowPosition'](_0x206c51){const {model:_0xea5023}=this['editor'],_0x48ff9c=Array['from'](_0x206c51['getSelectedBlocks']());return _0x48ff9c['length']?_0xea5023['createPositionAfter'](_0x48ff9c['pop']()):_0x206c51['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x42a9ad,_0x11d5a5){const {model:_0x2690e4,plugins:_0x341736}=this['editor'];if(_0x341736['has']('TableUtils')){const _0x510e3e=_0x341736['get']('TableUtils')['getSelectedTableCells'](_0x11d5a5);if(_0x510e3e['length']){const _0x1668de=this['_getTableRowCountFromContent'](_0x42a9ad),_0x233c15=this['_createEmptyTableRows'](_0x510e3e,_0x1668de);return _0x2690e4['createPositionAt'](_0x233c15,0x0);}}return null;}['_getTableRowCountFromContent'](_0x419167){const _0x2befc1=this['editor']['plugins']['get']('TableUtils'),_0x4f0028=this['editor']['data']['parse'](_0x419167),_0x10d096=Array['from'](_0x4f0028['getChildren']())['filter'](_0x5f01b9=>_0x5f01b9['is']('element','table'));let _0x5aed7a=0x0;return _0x10d096['forEach'](_0x7b293=>{_0x5aed7a+=_0x2befc1['getRows'](_0x7b293);}),_0x5aed7a;}['_createEmptyTableRows'](_0x511244,_0x4daf3a){const _0x9ddbcf=this['editor']['plugins']['get']('TableUtils'),_0xd61bdd=_0x9ddbcf['getRowIndexes'](_0x511244),_0x9204c4=_0x9ddbcf['getColumnIndexes'](_0x511244),_0x946e38=_0xd61bdd['last']+0x1,_0x5e0915=_0x9204c4['first'],_0x599946=_0x511244[0x0]['findAncestor']('table');for(let _0x5e9e9b=0x0;_0x5e9e9b<_0x4daf3a;_0x5e9e9b++)_0x9ddbcf['insertRows'](_0x599946,{'at':_0x946e38});return _0x599946['getChild'](_0x946e38)['getChild'](_0x5e0915);}['_resetContentOfSelectedTableCells'](_0x56680e,_0x34ecd1){const {plugins:_0xc2c44b}=this['editor'],{model:_0x579249}=_0x56680e;if(!_0xc2c44b['has']('TableUtils'))return;_0xc2c44b['get']('TableUtils')['getSelectedTableCells'](_0x34ecd1)['length']&&_0x579249['deleteContent'](_0x34ecd1);}}class E extends _0x11703a{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x5e153c('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1ca147){super(_0x1ca147),this['name']='AIRequestError';}}function i(_0x2382b3,_0x416acb,_0x660b92){const t=_0x2382b3['t'];switch(_0x416acb){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',_0x660b92);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x660b92);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'},_0x660b92);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 _0x416acb;}}class j extends _0x235cc6{['_commandDefinitions'];constructor(_0x53ae0,_0x1a4cce){super(_0x53ae0),this['_commandDefinitions']=_0x1a4cce,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x2c5ab4,_0x57c19c,_0x14cf72)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x14cf72));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2de216,_0xaedaba,_0x46c2fe)=>{this['enabledCommandsIds']=_0x46c2fe?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x82f2a8=this['editor']['model'];this['_hasContext']=function(_0x578004){const _0x117a38=_0x578004['document']['selection'];return _0x117a38['isCollapsed']?0x0!==[..._0x117a38['getSelectedBlocks']()]['length']&&![..._0x117a38['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x578004['hasContent'](_0x117a38['getFirstRange']());}(_0x82f2a8);const _0x43aaea=_0x82f2a8['document']['selection'],_0x3ddc1f=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0xb7bee6 of _0x43aaea['getRanges']())for(const _0x404b26 of _0xb7bee6['getItems']())if(_0x404b26['is']('element')&&_0x3ddc1f['includes'](_0x404b26['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x25a946='',_0x1891ca='',_0x1fd726='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x25a946,_0x1891ca,_0x1fd726);}}function G(_0x26516a,_0x511eaf){const _0x41be08=new Set();for(const _0x260fd0 of _0x26516a['values']())(_0x511eaf||!0x1===_0x260fd0['requiresContent'])&&_0x41be08['add'](_0x260fd0['id']);return Array['from'](_0x41be08);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
- _0x2d288d(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3f85b4,_0x2501cb,_0xf954c5){super(),this['editor']=_0x3f85b4,this['textAdapter']=_0x2501cb,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xf954c5,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x117ac1,_0x499b5c,_0x58fcec)=>{this['view']['value']=this['_sanitizeHTML'](_0x58fcec);}),this['listenTo'](this['view'],'submitPrompt',(_0x32e639,_0x341b0a)=>{const _0x3ab774=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x341b0a,_0x3ab774,'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:_0x3455bc,query:_0x420a64,htmlContent:_0x2108ac,label:_0x5df86e,mainActionLabel:_0x46dd4d}){this['view']['prompt']=_0x5df86e,this['view']['mainAction']=_0x46dd4d,this['initialContext']=_0x2108ac,_0x420a64&&(this['view']['isRendered']?this['_handleQuery'](_0x420a64,_0x2108ac,_0x3455bc,_0x5df86e):this['view']['once']('render',()=>{this['_handleQuery'](_0x420a64,_0x2108ac,_0x3455bc,_0x5df86e);}));}['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'](_0x14a8ad,_0x5205d4,_0x347e41,_0x3667ab){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5205d4,this['previousQuery']=_0x14a8ad,this['previousLabel']=_0x3667ab||_0x14a8ad,this['previousActionId']=_0x347e41,new Promise(_0x119c94=>{this['textAdapter']['makeRequest']({'query':_0x14a8ad,'context':_0x5205d4,'onData':_0x34caab=>{this['currentResponse']=_0x34caab,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x347e41})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x2aafd9=>{_0x2aafd9 instanceof R?this['view']['handleError'](_0x2aafd9['message']):this['view']['handleError'](),_0x119c94();})['finally'](()=>{this['stopProcessing'](),_0x119c94();});});}['_parseAndNormalizeContent'](_0x1cb6b9,_0x527758=!0x1){const _0x3aed77=Z['exec'](_0x1cb6b9);_0x1cb6b9=_0x3aed77?_0x1cb6b9['substring'](_0x3aed77[0x1]['length']):_0x1cb6b9['length']<0x64&&!_0x527758?'':this['_stripMarkdownSyntax'](_0x1cb6b9);const _0x2195ce=this['_domParser']['parseFromString'](_0x1cb6b9,'text/html');if(_0x3aed77){const _0x5d0422=Array['from'](_0x2195ce['body']['childNodes']);_0x5d0422['reverse']();for(const _0x36734f of _0x5d0422){if(_0x36734f['nodeType']==Node['ELEMENT_NODE'])break;_0x36734f['remove']();}}const _0x4737b4=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2195ce['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4737b4);const _0x5d1406=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x397c01=this['editor']['data']['toModel'](_0x4737b4);return _0x5d1406||_0x397c01['markers']['clear'](),this['editor']['data']['stringify'](_0x397c01);}['_normalizeResponseHeadings'](_0x3bf5d8){const _0x2c6c37=new _0x410430(this['editor']['editing']['view']['document']),_0x3592f2=new _0x1f744a({'name':/^h[1-5]$/}),_0xf4e1f6=[];let _0x132711=!0x1;for(const _0x4d844a of _0x3bf5d8)_0x4d844a['is']('element')&&_0x3592f2['match'](_0x4d844a)&&(_0xf4e1f6['push'](_0x4d844a),'h1'==_0x4d844a['name']&&(_0x132711=!0x0));if(_0x132711){for(const _0x160e90 of _0xf4e1f6)_0x2c6c37['rename']('h'+(parseInt(_0x160e90['name'][0x1])+0x1),_0x160e90);}}['_isH1TagSupportEnabled'](){const {data:_0xdcab7,editing:_0x3b7e20}=this['editor'],_0x4f89de=_0xdcab7['htmlProcessor']['toView']('<h1></h1>'),_0x45fd62=_0xdcab7['toView'](_0xdcab7['toModel'](_0x4f89de));return!!_0x3b7e20['view']['domConverter']['viewToDom'](_0x45fd62)['querySelector']('h1');}['_sanitizeHTML'](_0x264e6){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x264e6),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x2387ee){const _0x5c96e3=_0x2387ee['trim']();return _0x5c96e3['startsWith']('```html')?_0x5c96e3['endsWith']('```')?_0x5c96e3['substring'](0x7,_0x5c96e3['length']-0x3):_0x5c96e3['substring'](0x7):_0x2387ee;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x3e07b6){super(_0x3e07b6),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x18936e=>i(_0x3e07b6,'AI_'+_0x18936e['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x3e07b6,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x3e07b6,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x3e07b6,'Stop'));const _0x3dc1e3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3dc1e3['if']('isVisible','ck-hidden',_0x33bae3=>!_0x33bae3)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x423be7,_0x4f8d92){const _0x3b0a4a=new _0x260786(this['locale']);return _0x3b0a4a['set']({'label':_0x423be7,'class':_0x4f8d92||'','isVisible':!0x0,'withText':!0x0}),_0x3b0a4a;}}class Y extends _0x38ffe9{['contentFieldView'];['copyButtonView'];constructor(_0x38e6d1,_0x3589e1=''){super(_0x38e6d1),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1b3034=this['bindTemplate'];this['contentFieldView']=new At(_0x38e6d1,_0x3589e1),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1b3034['if']('isVisible','ck-hidden',_0x2328df=>!_0x2328df)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1b3034['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 _0xd4279=!0x1;this['on']('change:value',(_0x12f4bf,_0x3fbee9,_0x353f56)=>{const _0x4e53d6=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x353f56),this['isProcessing']&&_0x4e53d6&&!_0xd4279&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1faf92,_0x489a8c,_0x2450ef)=>{_0xd4279=!0x1,_0x2450ef?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0xd4279=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0xd4279=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4db2f1=this['locale'],_0x48793b=new _0x260786(this['locale']),_0x37aa91='ck-ai-form__copy-button';return _0x48793b['set']({'label':i(_0x4db2f1,'Copy'),'icon':_0x2c4ba2,'class':_0x37aa91,'tooltip':!0x0}),_0x48793b['bind']('isVisible')['to'](this,'value',_0x2d4fa0=>!!_0x2d4fa0),_0x48793b['bind']('isEnabled')['to'](this,'isProcessing',_0xb3d5f4=>!_0xb3d5f4),_0x48793b['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x48793b['icon']=_0x17a43d,_0x48793b['class']=_0x37aa91+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x48793b['icon']=_0x2c4ba2,_0x48793b['class']=_0x37aa91;},0x3e8);}),_0x48793b;}['_copyHTMLToClipboard'](_0x2a8aca){const {window:_0x2d114f,document:_0x55ca4a}=_0x3ca616;if(_0x2d114f['ClipboardItem']){const {Blob:_0x219e49,ClipboardItem:_0x1b0550}=_0x2d114f,_0xaf6d51=[new _0x1b0550({'text/html':new _0x219e49([_0x2a8aca['innerHTML']],{'type':'text/html'}),'text/plain':new _0x219e49([_0x2a8aca['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xaf6d51);}else{const _0x25350c=_0x55ca4a['createElement']('div');_0x25350c['style']['position']='absolute',_0x25350c['style']['left']='-9999px',_0x25350c['innerHTML']='<span>[</span>'+_0x2a8aca['innerHTML']+'<span>]</span>',_0x55ca4a['body']['appendChild'](_0x25350c);const _0x555f11=_0x55ca4a['createRange']();_0x555f11['setStartAfter'](_0x25350c['firstElementChild']),_0x555f11['setEndBefore'](_0x25350c['lastElementChild']);const _0x435060=_0x2d114f['getSelection']();_0x435060['removeAllRanges'](),_0x435060['addRange'](_0x555f11),_0x55ca4a['execCommand']('copy'),_0x25350c['remove']();}}}class At extends _0x38ffe9{constructor(_0x4fa6ba,_0x5b1c33=''){super(_0x4fa6ba),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5b1c33,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x5935c6){this['element']['innerHTML']=_0x5935c6;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x57cef7=new _0x38ffe9(),_0x994771=this['locale'],_0x546929=new _0x33570f();return _0x546929['isVisible']=!0x0,_0x57cef7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x546929,{'text':i(_0x994771,'AI\x20is\x20writing...')}]}),_0x57cef7['render'](),_0x57cef7;}}class st extends _0x38ffe9{constructor(_0x139854,_0x1a5497=''){super(_0x139854);const _0x206720=new rt(),_0x3e8f87=this['bindTemplate'];this['set']('text',_0x1a5497),_0x206720['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x206720,{'text':_0x3e8f87['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x1d826e,_0x4bda0f){super(_0x1d826e,_0x4bda0f),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',(_0xd76e0b,_0x13c32d)=>{_0xd76e0b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x13c32d());});}['_createSubmitButton'](){const _0x2c96ad=new _0x260786(this['locale']),_0x55cb19=this['locale'];return _0x2c96ad['set']({'icon':ht,'label':i(_0x55cb19,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x2c96ad['on']('execute',()=>{this['submit']();}),_0x2c96ad['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x5a6bda,_0x415f12)=>!_0x5a6bda&&_0x415f12),_0x2c96ad;}['_createShowHistoryButton'](){const _0x16e195=new _0x260786(this['locale']),_0x38ea25=this['resultsView'],_0x15b216=this['locale'];_0x16e195['set']({'label':i(_0x15b216,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x16e195['bind']('isOn')['to'](_0x38ea25,'isVisible'),_0x16e195['bind']('isEnabled')['to'](this,'isEnabled'),_0x16e195['on']('execute',()=>{_0x38ea25['isVisible']=!_0x38ea25['isVisible'],_0x38ea25['isVisible']?this['filteredView']['focus']():this['focus']();});const _0xcfac36=()=>{_0x3ca616['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x4f649b=new it(this['queryView']['fieldView']['element']),_0x189d7b=_0x4f649b['width'],_0x592cec='rtl'===_0x15b216['uiLanguageDirection']?'left':'right';_0x4f649b['excludeScrollbarsAndBorders'](),_0x16e195['element']['style'][_0x592cec]=_0x189d7b-_0x4f649b['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0xcfac36),this['on']('render',_0xcfac36),_0x16e195;}['submit'](){const _0x11a4f2=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x11a4f2);}['focus'](_0xf48f04){-0x1===_0xf48f04?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x4f66e6){super(_0x4f66e6),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x4f66e6,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5ab423=0x0;for(const _0x3df429 of this['items'])_0x5ab423+=_0x3df429['items']['length'];return{'resultsCount':_0x5ab423,'totalItemsCount':_0x5ab423};}['_createClearHistoryButton'](){const _0x28cbe6=this['locale'],_0x1f631a=new _0x260786(this['locale']);return _0x1f631a['set']({'label':'('+i(_0x28cbe6,'Clear')+')','withText':!0x0}),_0x1f631a['on']('execute',()=>this['fire']('clearHistory')),_0x1f631a;}}class bt extends xt{constructor(_0x35eb10){super();const _0x1e0a68=new kt(),_0x272140=new _0x260786(this['locale'],_0x1e0a68);this['children']['add'](_0x272140),_0x272140['set']({'label':_0x35eb10['prompt'],'withText':!0x0}),_0x272140['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x35eb10['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x494c54{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x29a241,_0x1060b9)=>{const _0x1f7552=os(_0x1060b9['prompt']);for(const _0x4f2871 of this)if(_0x4f2871!=_0x1060b9&&os(_0x4f2871['prompt'])===_0x1f7552){this['remove'](_0x4f2871);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2dcd79=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x2dcd79));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0xe540dd=>_0xe540dd)));}}function os(_0x285004){return _0x285004['toLowerCase']()['trim']();}class _ extends _0x38ffe9{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x3df449,_0x666ee7,_0x3c3f19=''){super(_0x3df449),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0x3df449),this['contentArea']=new Y(_0x3df449,_0x3c3f19),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 mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'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 _0x50fc04=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x666ee7],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x50fc04['if']('isError','ck-hidden',_0x303a95=>!_0x303a95)]},'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'](_0x47796e=0x1){-0x1===_0x47796e?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 _0x2c5356=this['locale'],_0x310486=new ct(_0x2c5356,{'queryView':{'label':i(_0x2c5356,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x2c5356,'Empty\x20history'),'secondary':i(_0x2c5356,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x310486['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xc87924,_0x466250)=>_0xc87924&&!_0x466250),this['listenTo'](_0x310486,'submit',(_0xbf4988,_0x42fab2)=>{this['prompt']=_0x42fab2;const _0x3d181d=yt(_0x42fab2);this['fire']('submitPrompt',_0x3d181d),_0x42fab2['trim']()&&this['_promptHistory']['add']({'prompt':_0x3d181d},0x0);},{'priority':'high'}),_0x310486;}['_createHistoryView'](){const _0x41b934=new ft(this['locale']);return _0x41b934['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x41b934['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x41b934;}['_createToolbar'](){const _0x3fdb1c=new lt(this['locale']);return _0x3fdb1c['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3b4d89,_0x5788fd,_0x3dcf44)=>_0x3b4d89&&!_0x5788fd&&!!_0x3dcf44),_0x3fdb1c['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x3fdb1c['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2d17d5,_0x134550,_0x5d2d69)=>_0x2d17d5&&!_0x134550&&!!_0x5d2d69),_0x3fdb1c['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x3fdb1c['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x226c7d,_0x437f23)=>_0x226c7d&&!_0x437f23),_0x3fdb1c['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x3fdb1c['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x3fdb1c['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x3fdb1c;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xe2ed94=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0xe2ed94,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x27d24e){const _0x4062b4=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x27d24e||i(_0x4062b4,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x11703a{['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[_0x5e9943,a,E,_0x4f70a2];}constructor(_0x4b7f43){super(_0x4b7f43),_0x4b7f43['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x4b7f43['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x4b7f43['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x4b7f43['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1690dc}=this;this['_aiAdapter']=_0x1690dc['plugins']['get'](E),this['_dialog']=_0x1690dc['plugins']['get'](_0x4f70a2),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3f89ad=new j(_0x1690dc,Array['from'](this['_commandDefinitions']['values']()));_0x1690dc['commands']['add']('showAIAssistant',_0x3f89ad),_0x1690dc['ui']['componentFactory']['add']('aiCommands',_0x163294=>{const _0x4b46b0=_0xd3519e(_0x163294);return _0x4b46b0['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4b46b0['buttonView']['set']({'label':i(_0x163294,'AI\x20Commands'),'icon':_0x2fd707,'tooltip':!0x0}),_0x4b46b0['on']('execute',_0x4c589e=>this['_onExecute'](_0x4c589e['source']['id'])),_0x5baf95(_0x4b46b0,_0x1690dc['ui']['view']['body'],function(_0x55fb02){const _0x1a91ad=o(_0x55fb02['config']['get']('ai.aiAssistant.commands'),_0x55fb02['locale']),_0x38efb6=U(_0x55fb02,_0x1a91ad)['filter'](_0x7d8b39=>_0x7d8b39['commands']['length']);if(0x1===_0x38efb6['length'])return U(_0x55fb02,_0x38efb6[0x0]['commands'])['map'](_0x2982af=>({'id':_0x2982af['id'],'label':_0x2982af['label']}));return _0x38efb6['map'](_0x1603a2=>{const {groupId:_0x3d1933,groupLabel:_0x1d5cdf,commands:_0x129ce2}=_0x1603a2,_0x1ffb79=U(_0x55fb02,_0x129ce2)['map'](_0x4e1bd0=>({'id':_0x4e1bd0['id'],'label':_0x4e1bd0['label']}));return{'id':_0x3d1933,'menu':_0x1d5cdf||_0x3d1933,'children':_0x1ffb79};});}(_0x1690dc),{'ariaLabel':i(_0x163294,'AI\x20Commands')}),_0x4b46b0['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3f89ad['on']('change:enabledCommandsIds',_0x15988d),_0x4b46b0['menuView']['once']('render',_0x15988d),_0x4b46b0;function _0x15988d(){_0x4b46b0['isEnabled']=_0x3f89ad['enabledCommandsIds']['length']>0x0;for(const _0x3c2cbd of _0x4b46b0['menuView']['buttons'])_0x3c2cbd['isEnabled']=_0x3f89ad['enabledCommandsIds']['includes'](_0x3c2cbd['id']);}}),_0x1690dc['ui']['componentFactory']['add']('menuBar:aiCommands',_0x25381f=>{const _0x6586e5=new _0x49fd2d(_0x25381f);_0x6586e5['buttonView']['set']({'label':i(_0x25381f,'AI\x20Commands'),'icon':_0x2fd707}),_0x6586e5['bind']('isEnabled')['to'](_0x3f89ad,'enabledCommandsIds',_0x3bad24=>_0x3bad24['length']>0x0);const _0x5cbd4a=o(_0x1690dc['config']['get']('ai.aiAssistant.commands'),_0x25381f);return this['_populateMenuBarMenu'](_0x3f89ad,_0x6586e5,_0x5cbd4a,_0x57d18b=>this['_onExecute'](_0x57d18b)),_0x6586e5;}),_0x1690dc['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x29acc9=this['_createAIAssistantUIButton'](_0x260786);return _0x29acc9['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x29acc9;}),_0x1690dc['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4ca86a=this['_createAIAssistantUIButton'](_0x7cd0bd);return _0x4ca86a['set']({'role':'menuitemcheckbox'}),_0x4ca86a;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5d592e=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4b5c20;for(const _0x10072b in _0x5d592e){const _0x299537=_0x10072b,_0x8f50d4=_0x5d592e[_0x299537];if('aiLicenseKeyValid'==_0x8f50d4||'aiLicenseKeyInvalid'==_0x8f50d4||'aiLicenseKeyExpired'==_0x8f50d4||'aiLicenseKeyDomainLimit'==_0x8f50d4||'aiLicenseKeyNotAllowed'==_0x8f50d4||'aiLicenseKeyEvaluationLimit'==_0x8f50d4||'aiLicenseKeyTrialLimit'==_0x8f50d4||'aiLicenseKeyUsageLimit'==_0x8f50d4){delete _0x5d592e[_0x299537],_0x4b5c20=_0x8f50d4,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x4b5c20&&_0x5d592e['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x4b5c20&&_0x5d592e['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x4b5c20&&_0x5d592e['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x4b5c20&&_0x5d592e['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x4b5c20&&_0x5d592e['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x4b5c20&&_0x5d592e['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x4b5c20&&_0x5d592e['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5a52d7='',_0x51ae7e='',_0x5014c9='custom'){const _0x37fb4d=this['editor'],_0x2c5ab3=_0x37fb4d['editing']['view'],_0x4e2b66=_0x37fb4d['plugins']['get'](a),_0x2f5c38=_0x37fb4d['plugins']['get'](_0x5e9943);_0x4e2b66['showFakeVisualSelection']();const _0x5d88dd=new w(),_0x4ea956=new ClipboardEvent('copy',{'clipboardData':_0x5d88dd}),_0x3be5e6=new _0x226ef5(_0x5d88dd),_0x1c7a94=new _0x404349(_0x2c5ab3,_0x4ea956,{'dataTransfer':_0x3be5e6});_0x2f5c38['_forceMarkersCopy']('comment',()=>{_0x2c5ab3['document']['fire']('copy',_0x1c7a94);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x37fb4d,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x17d268=_0x3be5e6['getData']('text/html');const _0x25ed45=_0x37fb4d['model']['document']['selection'],_0x3a7459=Array['from'](_0x25ed45['getRanges']());0x1===_0x3a7459['length']&&_0x3a7459[0x0]['isFlat']&&!_0x25ed45['getSelectedElement']()&&''!==_0x17d268['replace'](/&nbsp;/g,'')['trim']()&&(_0x17d268='<p>'+_0x17d268+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5014c9,'query':_0x5a52d7,'htmlContent':_0x17d268,'label':_0x51ae7e,'mainActionLabel':M[_0x37fb4d['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x147493,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x32ed05['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4e2b66['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x1af841=new Map(),_0x3d5ea9=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x24dac4 of _0x3d5ea9)for(const _0x424163 of _0x24dac4['commands'])_0x1af841['set'](_0x424163['id'],{..._0x424163,'groupId':_0x24dac4['groupId'],'groupLabel':_0x24dac4['groupLabel']||_0x24dac4['groupId']});return _0x1af841;}['_createAIAssistantUIButton'](_0x22a05e){const _0x1b824b=this['editor'],_0x121994=_0x1b824b['commands']['get']('showAIAssistant'),_0x5d8132=new _0x22a05e(_0x1b824b['locale']);return _0x5d8132['set']({'label':i(_0x1b824b['locale'],'AI\x20Assistant'),'icon':_0x147493,'isToggleable':!0x0}),_0x5d8132['bind']('isEnabled')['to'](_0x121994),_0x5d8132['bind']('isOn')['to'](this['_dialog'],'id',_0x3429a7=>'aiAssistant'===_0x3429a7),this['listenTo'](_0x5d8132,'execute',()=>{_0x5d8132['isOn']?this['hideUI']():_0x121994['execute']();}),_0x5d8132;}['_initView'](){const _0x4770d0=this['editor']['plugins']['get'](a);this['_formView']=new _(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',()=>{_0x4770d0['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4770d0['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1c8a09,ui:{ariaLiveAnnouncer:_0x2e8e51}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5ad663,_0x447349,_0x1898c4)=>{const _0x16a77f=this['_aiAssistantController']['currentContext'];_0x1898c4?_0x2e8e51['announce'](i(_0x1c8a09,'AI\x20is\x20writing')):_0x16a77f&&_0x2e8e51['announce'](i(_0x1c8a09,'Generated\x20content:\x20%0',_0x16a77f),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1ee7d9,_0x32b013,_0x5ca5a4)=>{if(_0x5ca5a4){const _0x3e3103=this['_formView']['errorView']['text'];_0x2e8e51['announce'](i(_0x1c8a09,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3e3103));}});}['_onExecute'](_0x55f244){const _0x34bc1e=this['_commandDefinitions']['get'](_0x55f244),_0x12d76c=this['editor'],_0x1d2950=_0x12d76c['model']['document']['selection'],_0x17c674=_0x12d76c['commands']['get']('showAIAssistant'),_0x892167=_0x12d76c['plugins']['get'](a),_0x838f56=''+(_0x34bc1e['groupId']!==x?_0x34bc1e['groupLabel']+':\x20':'')+_0x34bc1e['label'];if(!0x1!==_0x34bc1e['requiresContent']&&_0x1d2950['isCollapsed']){const _0x5c3113=_0xbc1f83(_0x1d2950['getSelectedBlocks']())||_0x12d76c['model']['schema']['getLimitElement'](_0x1d2950);_0x12d76c['model']['change'](_0x58bfdd=>{_0x58bfdd['setSelection'](_0x5c3113,'in');});}_0x892167['showFakeVisualSelection'](),_0x17c674['execute'](_0x34bc1e['prompt'],_0x838f56,'command:'+_0x55f244);}['_populateMenuBarMenu'](_0x5437de,_0x42f5b6,_0x5eaaf8,_0x1f2f39){const _0x4826d1=this['editor'],_0x97d559=_0x4826d1['locale'],_0x4f0233=new _0x18244a(_0x97d559),_0x5d2c6a=U(_0x4826d1,_0x5eaaf8)['filter'](_0x278469=>_0x278469['commands']['length']);0x1===_0x5d2c6a['length']?this['_getMenuBarGroupButtons']({'command':_0x5437de,'commands':_0x5d2c6a[0x0]['commands'],'parentMenuView':_0x42f5b6,'onExecute':_0x1f2f39})['forEach'](_0x6222c6=>_0x4f0233['items']['add'](_0x6222c6)):_0x5d2c6a['forEach'](({groupId:_0x3c325b,groupLabel:_0x14540c,commands:_0x84af39})=>{const _0x28b39d=new _0x3b2b48(_0x97d559,_0x42f5b6),_0x3b0ac1=new _0x49fd2d(_0x97d559),_0x1e8ee4=new _0x18244a(_0x97d559),_0x1b96d9=this['_getMenuBarGroupButtons']({'command':_0x5437de,'commands':_0x84af39,'parentMenuView':_0x3b0ac1,'onExecute':_0x1f2f39});_0x3b0ac1['buttonView']['set']({'label':_0x14540c||_0x3c325b}),_0x3b0ac1['delegate']('execute')['to'](_0x42f5b6),_0x1e8ee4['items']['addMany'](_0x1b96d9),_0x3b0ac1['panelView']['children']['add'](_0x1e8ee4),_0x28b39d['children']['add'](_0x3b0ac1),_0x4f0233['items']['add'](_0x28b39d);}),_0x42f5b6['panelView']['children']['add'](_0x4f0233);}['_getMenuBarGroupButtons']({command:_0x4d278b,commands:_0x1aef70,parentMenuView:_0x2cc085,onExecute:_0x27d1ec}){const _0x17b4b8=this['editor'],_0x1061f7=_0x17b4b8['locale'];return U(_0x17b4b8,_0x1aef70)['map'](_0x1f7475=>{const _0x5092f2=new _0x3b2b48(_0x1061f7,_0x2cc085),_0x4593bd=new _0x7cd0bd(_0x1061f7);return _0x4593bd['set']({'label':_0x1f7475['label']}),_0x4593bd['delegate']('execute')['to'](_0x2cc085),_0x4593bd['on']('execute',()=>_0x27d1ec(_0x1f7475['id'])),_0x4593bd['bind']('isEnabled')['to'](_0x4d278b,'enabledCommandsIds',_0x45afde=>_0x45afde['includes'](_0x1f7475['id'])),_0x5092f2['children']['add'](_0x4593bd),_0x5092f2;});}}function B(_0x2acf78,_0x4a82cd){return void 0x0!==_0x2acf78['order']&&void 0x0===_0x4a82cd['order']?0x1:void 0x0===_0x2acf78['order']&&void 0x0!==_0x4a82cd['order']?-0x1:void 0x0!==_0x2acf78['order']&&void 0x0!==_0x4a82cd['order']?_0x2acf78['order']-_0x4a82cd['order']:0x0;}function U(_0x122b66,_0x4982d5){_0x4982d5['sort'](B);const _0x15fb91={},_0x5ee2dd=[];for(const _0x160d94 of _0x4982d5)if(void 0x0!==_0x160d94['order']){if(_0x160d94['order']in _0x15fb91)throw new _0x5e153c('ai-commands-config-order-collision',_0x122b66,{'conflictingDefinitions':[_0x160d94,_0x15fb91[_0x160d94['order']]]});_0x15fb91[_0x160d94['order']]=_0x160d94,_0x5ee2dd['splice'](_0x160d94['order'],0x0,_0x160d94);}else _0x5ee2dd['push'](_0x160d94);return _0x5ee2dd;}class r extends _0x11703a{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x655d36){super(_0x655d36);const _0x971499=_0x655d36['config'],_0x2ce61d=_0x655d36['locale'];_0x971499['define']('ai.aiAssistant.preserveComments',!0x0),_0x971499['define']('ai.aiAssistant.commands',function(_0x290878){return[{'groupId':'editOrReview','groupLabel':i(_0x290878,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x290878,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x290878,'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(_0x290878,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x290878,'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(_0x290878,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x290878,'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(_0x290878,'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(_0x290878,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x290878,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x290878,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x290878,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x290878,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x290878,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x290878,'Change\x20style'),'commands':[{'id':'business','label':i(_0x290878,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x290878,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x290878,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x290878,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x290878,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x290878,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x290878,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x290878,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x290878,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x290878,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x290878,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x290878,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x290878,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x2ce61d)),_0x971499['define']('ai.aiAssistant.extraCommandGroups',[]),_0x971499['define']('ai.aiAssistant.removeCommands',[]);let _0x12a898=o(_0x971499['get']('ai.aiAssistant.commands'),_0x2ce61d);const _0x3c2ab8=_0x971499['get']('ai.aiAssistant.extraCommandGroups'),_0x1768a3=_0x971499['get']('ai.aiAssistant.removeCommands');_0x3c2ab8['forEach'](_0xf2e2d8=>{const _0x1bdf01=_0x12a898['find'](_0x40fa5f=>_0x40fa5f['groupId']===_0xf2e2d8['groupId']);_0x1bdf01?_0x1bdf01['commands']=_0x1bdf01['commands']['concat'](_0xf2e2d8['commands']):_0x12a898['push'](_0xf2e2d8);}),_0x12a898=_0x12a898['filter'](_0x4fa71a=>!_0x1768a3['includes'](_0x4fa71a['groupId'])),_0x12a898['forEach'](_0x3a63a6=>{_0x3a63a6['commands']=_0x3a63a6['commands']['filter'](_0xc4c3e8=>!_0x1768a3['includes'](_0xc4c3e8['id']));}),_0x971499['set']('ai.aiAssistant.commands',_0x12a898);}}class P extends _0x11703a{['abortController'];static get['requires'](){return[E];}constructor(_0x71d5be){super(_0x71d5be),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x521917){return this['sendRequest'](_0x521917)['catch'](_0x58bf77=>{if(_0x58bf77 instanceof R)return Promise['reject'](_0x58bf77);if('AbortError'==_0x58bf77['name'])return Promise['resolve']();throw console['error'](_0x58bf77),new _0x5e153c('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1e2720,_0x51af71){const _0x27bdb7=this['editor']['locale'],_0x1ee206={'Content-Type':'application/json'};if('object'==typeof _0x1e2720)Object['assign'](_0x1ee206,_0x1e2720);else{if(_0x1e2720)try{const _0x41fdea=await _0x1e2720(_0x51af71);Object['assign'](_0x1ee206,_0x41fdea);}catch(_0x1430f1){return Promise['reject'](new R(i(_0x27bdb7,'AI_ERROR_GET_HEADERS')));}}return _0x1ee206;}async['_prepareRequestParameters'](_0x17cc68,_0xf3f1c){const _0x43496e=this['editor']['locale'];if('object'==typeof _0x17cc68)return _0x17cc68;try{return await _0x17cc68(_0xf3f1c);}catch(_0x2bee1d){return Promise['reject'](new R(i(_0x43496e,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x1978b9){super(_0x1978b9),_0x1978b9['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x1978b9['config']['get']('ai.openAI.requestParameters')||_0x1978b9['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x1978b9['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x1978b9['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x1978b9['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x47e9ff,context:_0x38f973,onData:_0x384560,actionId:_0x4c6c2e}){const _0x2ef5a9=this['editor']['locale'],_0x388305=await this['prepareMessages'](_0x47e9ff,_0x38f973,_0x4c6c2e),_0xf9a305=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4c6c2e),_0x100ce3=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4c6c2e),_0x34690f={'messages':_0x388305,..._0x100ce3},_0x5e45d3={'method':'POST','headers':_0xf9a305,'body':JSON['stringify'](_0x34690f),'signal':this['abortController']['signal']},_0x127138=await fetch(this['_apiUrl'],_0x5e45d3);if(_0x127138['ok'])return _0x100ce3['stream']?await this['_readStreamableResponse'](_0x127138,_0x384560):await this['_readStaticResponse'](_0x127138,_0x384560),Promise['resolve']();{const _0x4373f1=await _0x127138['text']();return _0x4373f1['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x2ef5a9,'AI_ERROR_CONTEXT_LENGTH'))):_0x4373f1['includes']('Moderation')?Promise['reject'](new R(i(_0x2ef5a9,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x4373f1));}}async['prepareMessages'](_0x4a94f1,_0x3698a5,_0x41d541){let _0x5d6f84,_0x142730;return _0x3698a5?(_0x5d6f84='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.',_0x142730='Instruction:\x0a'+_0x4a94f1+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3698a5):(_0x5d6f84='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.',_0x142730=_0x4a94f1),[{'role':'system','content':_0x5d6f84},{'role':'user','content':_0x142730}];}async['_readStreamableResponse'](_0x290ee2,_0x57ecad){const _0x20e1ce=_0x290ee2['body']['getReader'](),_0x18f406=new TextDecoder();let _0x3b351c='',_0x24231a='',_0x1c19cf='',_0x53998c=!0x1;for(;!_0x53998c;){const {done:_0x5b2761,value:_0x362f10}=await _0x20e1ce['read'](),_0x449320=_0x3b351c+_0x18f406['decode'](_0x362f10);let _0x24c09d='';_0x53998c=_0x5b2761;try{_0x24c09d=this['_cleanUpData'](_0x449320),_0x3b351c='';}catch(_0x333e2a){_0x3b351c=_0x449320;continue;}_0x24231a+=_0x24c09d,!_0x53998c&&this['_isBufferIncomplete'](_0x24231a)||_0x24231a&&(_0x1c19cf+=_0x24231a,_0x24231a='',_0x57ecad(_0x1c19cf));}return Promise['resolve']();}async['_readStaticResponse'](_0xbcb13b,_0x45d351){return _0x45d351((await _0xbcb13b['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x5a306e){const _0x2274b0=_0x5a306e['split']('<')['length']!==_0x5a306e['split']('>')['length'],_0xb92e7f=_0x5a306e['length']<0x1e;return _0x2274b0&&_0xb92e7f;}['_cleanUpData'](_0xe4529){return _0xe4529['split'](/\n(?![^{]*\})/g)['map'](_0x181cec=>_0x181cec['replace']('data:\x20',''))['filter'](_0xff88b0=>_0xff88b0&&_0xff88b0['length']>0x0&&'[DONE]'!==_0xff88b0)['map'](_0x1a6a5a=>{const {choices:_0x327bc9}=JSON['parse'](_0x1a6a5a);if(_0x327bc9[0x0]?.['delta']?.['content'])return _0x327bc9[0x0]['delta']['content'];})['filter'](_0x5b951f=>_0x5b951f)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x48f141){super(_0x48f141),_0x48f141['config']['get']('ai.aws.requestParameters')||_0x48f141['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']=_0x48f141['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x48f141['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x48f141['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x48f141['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x29a40c,context:_0x1996fd,onData:_0xd5c42a,actionId:_0x2d6b76}){const {model:_0x4e5bd7,stream:_0x44990c,..._0x117faa}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2d6b76),_0x1c60f3={'prompt':await this['preparePrompt'](_0x29a40c,_0x1996fd,_0x4e5bd7,_0x2d6b76),..._0x117faa};this['_apiUrl']?await this['_processProxyRequest'](_0x1c60f3,_0x4e5bd7,_0x44990c,_0xd5c42a,_0x2d6b76):await this['_processAWSRequest'](_0x1c60f3,_0x4e5bd7,_0x44990c,_0xd5c42a);}async['preparePrompt'](_0x2e3867,_0x2cae15,_0xefced2,_0x5609da){let _0x5e0033,_0x468187;return _0x2cae15?(_0x5e0033='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.',_0x468187='Instruction:\x0a'+_0x2e3867+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2cae15):(_0x5e0033='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.',_0x468187=_0x2e3867),'meta.llama'==this['getModelFamily'](_0xefced2)?'<<SYS>>\x0a'+_0x5e0033+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x468187+'\x0a[/INST]':'Human:\x0a'+_0x5e0033+'\x0a'+_0x468187+'\x0a\x0aAssistant:';}['getModelFamily'](_0x236908){if(/^anthropic\.claude/['test'](_0x236908))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x236908))return'ai21.j2';if(/^cohere\.command/['test'](_0x236908))return'cohere.command';if(/^meta\.llama/['test'](_0x236908))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x236908));}async['_processProxyRequest'](_0x5dd9c4,_0x9e007d,_0x303894,_0x282e63,_0x4c47cd){const _0x1e0ec9={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4c47cd),'body':JSON['stringify']({..._0x5dd9c4,'model':_0x9e007d,'stream':_0x303894}),'signal':this['abortController']['signal']},_0x1c92ea=await fetch(this['_apiUrl'],_0x1e0ec9);_0x303894?await this['_readStreamableResponse'](_0x1c92ea,_0x9e007d,_0x282e63):await this['_readStaticResponse'](_0x1c92ea,_0x9e007d,_0x282e63);}async['_processAWSRequest'](_0x3096a9,_0x57da0b,_0x4b5f11,_0x11923e){const _0x481fdc=new _0xe2e5c4(this['_bedrockClientConfig']),_0x88d7b6={'body':JSON['stringify'](_0x3096a9),'contentType':'application/json','accept':'application/json','modelId':_0x57da0b};let _0x5a5eb1;if(_0x4b5f11){const _0x5791dc=new _0xe8b23(_0x88d7b6);_0x5a5eb1=await _0x481fdc['send'](_0x5791dc,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x5a5eb1,_0x57da0b,_0x11923e);}else{const _0x1852c3=new _0x51ff0f(_0x88d7b6);_0x5a5eb1=await _0x481fdc['send'](_0x1852c3,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x5a5eb1,_0x57da0b,_0x11923e);}}async['_readAsyncIterableResponse'](_0x53ebe4,_0x22aa96,_0x2ed220){const _0x5d56b1=_0x53ebe4['body'],_0x58b31e=new TextDecoder('utf-8');let _0x21fa5e='';for await(const _0x53f0a7 of _0x5d56b1)if(_0x53f0a7['chunk']){const _0x3ab223=_0x58b31e['decode'](_0x53f0a7['chunk']['bytes']),_0x4f87b8=JSON['parse'](_0x3ab223);_0x21fa5e+=this['_getGeneratedText'](_0x4f87b8,_0x22aa96),_0x2ed220(_0x21fa5e);}return Promise['resolve']();}async['_readStreamableResponse'](_0x57beb1,_0x25a47a,_0x3a4aa7){const _0x1ff80d=_0x57beb1['body'],_0x220ef0=new TextDecoder('utf-8'),_0x58b2db=_0x1ff80d['getReader']();let _0x4a6d75='',_0x28ba88='',_0x614a7a=!0x1;for(;!_0x614a7a;){const {done:_0x4bb125,value:_0x14caf9}=await _0x58b2db['read']();if(_0x614a7a=_0x4bb125,_0x614a7a)break;const _0x207016=(_0x4a6d75+_0x220ef0['decode'](_0x14caf9))['split']('\x0a')['map'](_0x11abd4=>{try{return _0x4a6d75='',JSON['parse'](_0x11abd4);}catch(_0x4bbcda){return _0x4a6d75=_0x11abd4,null;}})['filter'](_0x4ccf43=>null!==_0x4ccf43);_0x207016['length']&&(_0x28ba88+=_0x207016['map'](_0x28424e=>this['_getGeneratedText'](_0x28424e,_0x25a47a))['join'](''),_0x3a4aa7(_0x28ba88));}return Promise['resolve']();}async['_readStaticResponse'](_0x265705,_0x4a44dc,_0x348449){let _0x43de23;return _0x43de23=_0x265705 instanceof Response?await _0x265705['json']():JSON['parse'](Buffer['from'](_0x265705['body'])['toString']('utf8')),(_0x348449(this['_getGeneratedText'](_0x43de23,_0x4a44dc)),Promise['resolve']());}['_getGeneratedText'](_0x4fbd18,_0x210fee){switch(this['getModelFamily'](_0x210fee)){case'anthropic.claude':return _0x4fbd18['completion'];case'ai21.j2':return _0x4fbd18['completions'][0x0]['data']['text'];case'cohere.command':return _0x4fbd18['generations'][0x0]['text'];case'meta.llama':return _0x4fbd18['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
23
+ import{Plugin as _0x28fa44,Command as _0x1b4e17}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x4c87f5,IconCheck as _0x18de84,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x522dcb,IconRobotPencil as _0x33d1a4}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x11e7fb,CKEditorError as _0x360bab,ObservableMixin as _0x3552d4,global as _0x4aa064,isVisible as ot,Rect as it,Collection as _0x2f8d6f,FocusTracker as mt,KeystrokeHandler as ut,first as _0x42f680}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x499fc4,View as _0x5d0c42,SpinnerView as _0x433f18,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x46dd7f,createDropdown as _0x242a15,addMenuToDropdown as _0x1eaac7,MenuBarMenuView as _0x3cd897,MenuBarMenuListItemButtonView as _0x267bb5,DialogViewPosition as _0x39e61d,MenuBarMenuListView as _0x2af723,MenuBarMenuListItemView as _0xb56018}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x1224ca,ClipboardMarkersUtils as _0x4a2c85}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0xb9891c,DataTransfer as _0x9a2b22,UpcastWriter as _0xf6c6e9,Matcher as _0x57fd1e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x46e7ee,InvokeModelWithResponseStreamCommand as _0x1be286,InvokeModelCommand as _0x71c2}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x2df034,_0x1b8f24){const _0x47bdc8=(0x0,_0x1b8f24['t'])('Other');return _0x2df034['length']?'groupId'in _0x2df034[0x0]?_0x2df034:[{'groupId':x,'groupLabel':_0x47bdc8,'order':0x1/0x0,'commands':_0x2df034}]:[{'groupId':x,'groupLabel':_0x47bdc8,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x28fa44{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x586921}=this,_0x30bce3=['ck-fake-ai-selection'];_0x586921['config']['get']('ai.useTheme')&&_0x30bce3['push']('ck-ai-assistant-ui_theme'),_0x586921['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x30bce3,'priority':0xc}}),_0x586921['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x445210,{writer:_0x3a1bbf})=>{if(!_0x445210['markerRange']['isCollapsed'])return null;const _0x1639e9=_0x3a1bbf['createUIElement']('span');return _0x3a1bbf['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1639e9),_0x1639e9;}});}['afterInit'](){!async function(_0x4f6497){const _0x46c614=_0xd506cb([0x70,0x41,0x4d,0x43,0x6c,0x37,0x45,0x4f,0x32,0x74,0x49,0x65,0x71,0x57,0x51,0x64,0x59,0x6e,0x6a,0x6f,0x44,0x52,0x69,0x61,0x48,0x66,0x36,0x35,0x34,0x31,0x63,0x42,0x67,0x54,0x39,0x7a,0x73,0x46,0x55,0x33,0x75,0x77,0x72,0x4a,0x4c,0x62,0x53,0x30,0x4e,0x50,0x6b,0x79,0x38,0x5a,0x47,0x76,0x56,0x6d,0x4b,0x78,0x68,0x58]),_0x40ad5c=0xe75b58c,_0x2792fe=0xe72d1d4^_0x40ad5c,_0xf311a6=window[_0xd506cb([0x44,0x61,0x74,0x65])][_0xd506cb([0x6e,0x6f,0x77])](),_0x39f0af=_0x4f6497[_0xd506cb([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4c2d15=new window[(_0xd506cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x233f04=>{_0x39f0af[_0xd506cb([0x6f,0x6e,0x63,0x65])](_0xd506cb([0x72,0x65,0x61,0x64,0x79]),_0x233f04);}),_0x14e1a4={[_0xd506cb([0x6b,0x74,0x79])]:_0xd506cb([0x45,0x43]),[_0xd506cb([0x75,0x73,0x65])]:_0xd506cb([0x73,0x69,0x67]),[_0xd506cb([0x63,0x72,0x76])]:_0xd506cb([0x50,0x2d,0x32,0x35,0x36]),[_0xd506cb([0x78])]:_0xd506cb([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]),[_0xd506cb([0x79])]:_0xd506cb([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]),[_0xd506cb([0x61,0x6c,0x67])]:_0xd506cb([0x45,0x53,0x32,0x35,0x36])},_0x54d665=_0x39f0af[_0xd506cb([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xd506cb([0x67,0x65,0x74])](_0xd506cb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x10babd(){let _0x1d5c76,_0x2a8d4a=null,_0x48ab48=null;try{if(_0x54d665==_0xd506cb([0x47,0x50,0x4c]))return _0xd506cb([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1d5c76=_0x1e43a0(),!_0x1d5c76)return _0xd506cb([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1d5c76[_0xd506cb([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x48ab48=_0x28f04b(_0x1d5c76[_0xd506cb([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1d5c76[_0xd506cb([0x6a,0x74,0x69])])),await _0x2d41d1()?_0x677331()?_0x2fec60()?_0xd506cb([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x55b160()?(_0x1d5c76[_0xd506cb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xd506cb([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2a8d4a=_0x1221d0(_0xd506cb([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x1d5c76[_0xd506cb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xd506cb([0x74,0x72,0x69,0x61,0x6c])&&(_0x2a8d4a=_0x1221d0(_0xd506cb([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4f6b35()):_0xd506cb([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xd506cb([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xd506cb([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x4b2ce1){return _0xd506cb([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2fec60(){const _0x592d25=[_0xd506cb([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xd506cb([0x74,0x72,0x69,0x61,0x6c])][_0xd506cb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1d5c76[_0xd506cb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xf311a6/0x3e8:0xe10*_0x2792fe;return _0x1d5c76[_0xd506cb([0x65,0x78,0x70])]<_0x592d25;}function _0x677331(){const _0x977c3f=_0x1d5c76[_0xd506cb([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x977c3f&&(!!_0x977c3f[_0xd506cb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xd506cb([0x2a]))||!!_0x977c3f[_0xd506cb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xd506cb([0x41,0x49])));}function _0x55b160(){const _0x1a9dcb=_0x1d5c76[_0xd506cb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1a9dcb||0x0==_0x1a9dcb[_0xd506cb([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x150efc}=new URL(window[_0xd506cb([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1a9dcb[_0xd506cb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x150efc))return!0x0;const _0x1b05b8=_0x150efc[_0xd506cb([0x73,0x70,0x6c,0x69,0x74])](_0xd506cb([0x2e]));return _0x1a9dcb[_0xd506cb([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1e395d=>_0x1e395d[_0xd506cb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xd506cb([0x2a])))[_0xd506cb([0x6d,0x61,0x70])](_0xf3c960=>_0xf3c960[_0xd506cb([0x73,0x70,0x6c,0x69,0x74])](_0xd506cb([0x2e])))[_0xd506cb([0x73,0x6f,0x6d,0x65])](_0x25a000=>_0x1b05b8[_0xd506cb([0x65,0x76,0x65,0x72,0x79])]((_0xd07039,_0xd4195d)=>_0x25a000[_0xd4195d]===_0xd07039||_0x25a000[_0xd4195d]===_0xd506cb([0x2a])));}function _0x4f6b35(){return _0x2a8d4a&&_0x48ab48?new window[(_0xd506cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4baec8,_0x3df377)=>{_0x2a8d4a[_0xd506cb([0x74,0x68,0x65,0x6e])](_0x4baec8,_0x3df377),_0x48ab48[_0xd506cb([0x74,0x68,0x65,0x6e])](_0x38a670=>{_0x38a670!=_0xd506cb([0x56,0x61,0x6c,0x69,0x64])&&_0x4baec8(_0x38a670);},_0x3df377);}):_0x2a8d4a||_0x48ab48||_0xd506cb([0x56,0x61,0x6c,0x69,0x64]);}}function _0x28f04b(_0x455428,_0x477e2a){return new window[(_0xd506cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x150b75=>{if(_0x3d0e34())return _0x150b75(_0xd506cb([0x56,0x61,0x6c,0x69,0x64]));_0x128542(),_0x39f0af[_0xd506cb([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xd506cb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x370595=!0x1;const _0x2e2da3=_0x11e7fb();function _0x5be59a(_0x47689c){return!!_0x47689c&&(typeof _0x47689c===_0xd506cb([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x47689c===_0xd506cb([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x47689c[_0xd506cb([0x74,0x68,0x65,0x6e])]===_0xd506cb([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x47689c[_0xd506cb([0x63,0x61,0x74,0x63,0x68])]===_0xd506cb([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x215e35(_0x3b08c1){_0x5f4d40(_0x3b08c1)[_0xd506cb([0x74,0x68,0x65,0x6e])](_0x3dd5de=>{if(!_0x3dd5de||_0x3dd5de[_0xd506cb([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xd506cb([0x6f,0x6b]))return _0xd506cb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x169547(_0xaa90ab(_0x2e2da3+_0x477e2a))!=_0x3dd5de[_0xd506cb([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xd506cb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xd506cb([0x56,0x61,0x6c,0x69,0x64]);})[_0xd506cb([0x74,0x68,0x65,0x6e])](_0x4b36a9=>(_0x52d73f(),_0x4b36a9),()=>{const _0x472a09=_0x2a3d10();return null==_0x472a09?(_0x52d73f(),_0xd506cb([0x56,0x61,0x6c,0x69,0x64])):_0xd506cb(_0xf311a6-_0x472a09>(0x2a79318c^_0x40ad5c)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xd506cb([0x74,0x68,0x65,0x6e])](_0x150b75)[_0xd506cb([0x63,0x61,0x74,0x63,0x68])](()=>{_0x150b75(_0xd506cb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1c76ae=0xe435b0c^_0x40ad5c;function _0x52d73f(){const _0x446ee9=_0xd506cb([0x6c,0x6c,0x63,0x74,0x2d])+_0x169547(_0xaa90ab(_0x455428)),_0xcdce49=_0x3bb6f3(_0x169547(window[_0xd506cb([0x4d,0x61,0x74,0x68])][_0xd506cb([0x63,0x65,0x69,0x6c])](_0xf311a6/_0x1c76ae)));window[_0xd506cb([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xd506cb([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x446ee9,_0xcdce49);}function _0x2a3d10(){const _0x2b2bb9=_0xd506cb([0x6c,0x6c,0x63,0x74,0x2d])+_0x169547(_0xaa90ab(_0x455428)),_0x5bc648=window[_0xd506cb([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xd506cb([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2b2bb9);return _0x5bc648?window[_0xd506cb([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3bb6f3(_0x5bc648),0x10)*_0x1c76ae:null;}function _0x5f4d40(_0x3ee991){return new window[(_0xd506cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x575f92,_0x1c31b8)=>{_0x3ee991[_0xd506cb([0x74,0x68,0x65,0x6e])](_0x575f92,_0x1c31b8),window[_0xd506cb([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1c31b8,0xe74614c^_0x40ad5c);});}}_0x39f0af[_0xd506cb([0x6f,0x6e])](_0xd506cb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x41ba95,_0x545341)=>{if(_0x545341[0x0]!=_0x455428)return _0x150b75(_0xd506cb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x545341[0x1]={..._0x545341[0x1],[_0xd506cb([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2e2da3};},{[_0xd506cb([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xd506cb([0x68,0x69,0x67,0x68])}),_0x39f0af[_0xd506cb([0x6f,0x6e])](_0xd506cb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x19ae1d=>{_0x5be59a(_0x19ae1d[_0xd506cb([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x370595=!0x0,_0x215e35(_0x19ae1d[_0xd506cb([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xd506cb([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xd506cb([0x6c,0x6f,0x77])}),_0x4c2d15[_0xd506cb([0x74,0x68,0x65,0x6e])](()=>{_0x370595||_0x150b75(_0xd506cb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3d0e34(){return _0x39f0af[_0xd506cb([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xd506cb([0x76,0x69,0x65,0x77])][_0xd506cb([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xd506cb([0x61,0x75,0x74,0x6f]);}function _0x128542(){_0x39f0af[_0xd506cb([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xd506cb([0x76,0x69,0x65,0x77])][_0xd506cb([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xd506cb([0x61,0x75,0x74,0x6f]);}}function _0x1221d0(_0x15252c){const _0x3d793d=[new window[(_0xd506cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3e19fb=>setTimeout(_0x3e19fb,0xe7c8b40^_0x40ad5c)),_0x4c2d15[_0xd506cb([0x74,0x68,0x65,0x6e])](()=>new window[(_0xd506cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xb1caa2=>{let _0x59535e=0x0;_0x39f0af[_0xd506cb([0x6d,0x6f,0x64,0x65,0x6c])][_0xd506cb([0x6f,0x6e])](_0xd506cb([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x322be1,_0x2d9ac3)=>{_0x2d9ac3[0x0][_0xd506cb([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x59535e++,_0x59535e==(0xe75b474^_0x40ad5c)&&(_0xb1caa2(),_0x322be1[_0xd506cb([0x6f,0x66,0x66])]());});}))];return window[_0xd506cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xd506cb([0x72,0x61,0x63,0x65])](_0x3d793d)[_0xd506cb([0x74,0x68,0x65,0x6e])](()=>_0x15252c);}async function _0x194c0f(){await _0x4c2d15,_0x39f0af[_0xd506cb([0x6d,0x6f,0x64,0x65,0x6c])][_0xd506cb([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x53cf61,_0x39f0af[_0xd506cb([0x6d,0x6f,0x64,0x65,0x6c])][_0xd506cb([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x53cf61,_0x39f0af[_0xd506cb([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xd506cb([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x53a59f(_0x2d1870){const _0x3332c1=_0x55b221();_0x39f0af[_0x3332c1]=_0xd506cb([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2d1870,_0x2d1870!=_0xd506cb([0x56,0x61,0x6c,0x69,0x64])&&_0x194c0f();}function _0x55b221(){const _0x2decbf=window[_0xd506cb([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xd506cb([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xd506cb([0x6e,0x6f,0x77])]())[_0xd506cb([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xd506cb([0x2e]),'');let _0x105bdb=_0xd506cb([0x70]);for(let _0x3c53da=0x0;_0x3c53da<_0x2decbf[_0xd506cb([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3c53da+=0x2){let _0xaae716=window[_0xd506cb([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2decbf[_0xd506cb([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3c53da,_0x3c53da+0x2));_0xaae716>=_0x46c614[_0xd506cb([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xaae716-=_0x46c614[_0xd506cb([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x105bdb+=_0x46c614[_0xaae716];}return _0x105bdb;}function _0x1e43a0(){const _0x51a8d7=_0x54d665[_0xd506cb([0x73,0x70,0x6c,0x69,0x74])](_0xd506cb([0x2e]));if(0x3!=_0x51a8d7[_0xd506cb([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x54f719(_0x51a8d7[0x1]);function _0x54f719(_0x39fcda){const _0x17c5f6=_0x346c86(_0x39fcda);return _0x17c5f6&&_0x57f09c()?_0x17c5f6:null;function _0x57f09c(){const _0x96aa8d=_0x17c5f6[_0xd506cb([0x6a,0x74,0x69])],_0x1584d5=window[_0xd506cb([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x96aa8d[_0xd506cb([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x96aa8d[_0xd506cb([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x150ce8={..._0x17c5f6,[_0xd506cb([0x6a,0x74,0x69])]:_0x96aa8d[_0xd506cb([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x96aa8d[_0xd506cb([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x150ce8[_0xd506cb([0x76,0x63])],_0xaa90ab(_0x150ce8)==_0x1584d5;}}}async function _0x2d41d1(){let _0x21de1a=!0x0;try{const _0x1638ae=_0x54d665[_0xd506cb([0x73,0x70,0x6c,0x69,0x74])](_0xd506cb([0x2e])),[_0x57f2d4,_0x4ecb8f,_0x293536]=_0x1638ae;return _0x2a4cbc(_0x57f2d4),await _0x113e4c(_0x57f2d4,_0x4ecb8f,_0x293536),_0x21de1a;}catch(_0xf7427f){return!0x1;}function _0x2a4cbc(_0x4981e9){const _0xdc138a=_0x346c86(_0x4981e9);_0xdc138a&&_0xdc138a[_0xd506cb([0x61,0x6c,0x67])]==_0xd506cb([0x45,0x53,0x32,0x35,0x36])||(_0x21de1a=!0x1);}async function _0x113e4c(_0x4039f0,_0x3c50c6,_0x162ea1){const _0x523c12=window[_0xd506cb([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xd506cb([0x66,0x72,0x6f,0x6d])](_0x5c8b30(_0x162ea1),_0x31d522=>_0x31d522[_0xd506cb([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5d52ff=new window[(_0xd506cb([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xd506cb([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4039f0+_0xd506cb([0x2e])+_0x3c50c6),_0x49e454=window[_0xd506cb([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xd506cb([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x49e454)return;const _0x2538bb=await _0x49e454[_0xd506cb([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xd506cb([0x6a,0x77,0x6b]),_0x14e1a4,{[_0xd506cb([0x6e,0x61,0x6d,0x65])]:_0xd506cb([0x45,0x43,0x44,0x53,0x41]),[_0xd506cb([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xd506cb([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xd506cb([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x49e454[_0xd506cb([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xd506cb([0x6e,0x61,0x6d,0x65])]:_0xd506cb([0x45,0x43,0x44,0x53,0x41]),[_0xd506cb([0x68,0x61,0x73,0x68])]:{[_0xd506cb([0x6e,0x61,0x6d,0x65])]:_0xd506cb([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2538bb,_0x523c12,_0x5d52ff)||(_0x21de1a=!0x1);}}function _0x346c86(_0x2cdba2){return _0x2cdba2[_0xd506cb([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xd506cb([0x65,0x79]))?JSON[_0xd506cb([0x70,0x61,0x72,0x73,0x65])](_0x5c8b30(_0x2cdba2)):null;}function _0x5c8b30(_0x339ec0){return window[_0xd506cb([0x61,0x74,0x6f,0x62])](_0x339ec0[_0xd506cb([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xd506cb([0x2b]))[_0xd506cb([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xd506cb([0x2f])));}function _0xaa90ab(_0xe81d20){let _0x1a859e=0x1505;function _0x5d916f(_0xeb00cc){for(let _0x1aac30=0x0;_0x1aac30<_0xeb00cc[_0xd506cb([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1aac30++){const _0x57a8ef=_0xeb00cc[_0xd506cb([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1aac30);_0x1a859e=(_0x1a859e<<0x5)+_0x1a859e+_0x57a8ef,_0x1a859e&=_0x1a859e;}}function _0x3fece7(_0x574c27){Array[_0xd506cb([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x574c27)?_0x574c27[_0xd506cb([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3fece7):_0x574c27&&typeof _0x574c27==_0xd506cb([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xd506cb([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x574c27)[_0xd506cb([0x73,0x6f,0x72,0x74])]()[_0xd506cb([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1a12b5,_0x1cd117])=>{_0x5d916f(_0x1a12b5),_0x3fece7(_0x1cd117);}):_0x5d916f(window[_0xd506cb([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x574c27));}return _0x3fece7(_0xe81d20),_0x1a859e>>>0x0;}function _0x169547(_0x46216c){return _0x46216c[_0xd506cb([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xd506cb([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xd506cb([0x30]));}function _0x3bb6f3(_0xdf2208){return _0xdf2208[_0xd506cb([0x73,0x70,0x6c,0x69,0x74])]('')[_0xd506cb([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xd506cb([0x6a,0x6f,0x69,0x6e])]('');}function _0x53cf61(){}function _0xd506cb(_0x58b5d9){return _0x58b5d9['map'](_0x2edb85=>String['fromCharCode'](_0x2edb85))['join']('');}_0x53a59f(await _0x10babd());}(this);}['showFakeVisualSelection'](){const _0x1957c4=this['editor']['model'];_0x1957c4['change'](_0x2fbe2f=>{const _0x5a4337=_0x1957c4['document']['selection']['getRanges']();let _0x4060a9=0x0;for(const _0x337a6b of _0x5a4337){const _0x20a6ef=f+':'+_0x4060a9;if(_0x1957c4['markers']['has'](_0x20a6ef))_0x2fbe2f['updateMarker'](_0x20a6ef,{'range':_0x337a6b});else{if(_0x337a6b['start']['isAtEnd']){const _0x36ab11=_0x337a6b['start']['getLastMatchingPosition'](({item:_0x5c32c7})=>!_0x1957c4['schema']['isContent'](_0x5c32c7),{'boundaries':_0x337a6b});_0x2fbe2f['addMarker'](_0x20a6ef,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2fbe2f['createRange'](_0x36ab11,_0x337a6b['end'])});}else _0x2fbe2f['addMarker'](_0x20a6ef,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x337a6b});}_0x4060a9++;}});}['hideFakeVisualSelection'](){const _0x8e12eb=this['editor']['model'],_0x264bde=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x264bde['length']&&_0x8e12eb['change'](_0xbbe1b0=>{_0x264bde['forEach'](_0x42691d=>{_0xbbe1b0['removeMarker'](_0x42691d);});});}['insertContent'](_0x40b670,_0x54e509){const _0x589c6f=this['_getAISelection'](),_0x2f8fbf=_0x54e509||_0x589c6f['getFirstRange']();this['editor']['model']['canEditAt'](_0x2f8fbf)&&this['editor']['model']['change'](_0x1649a2=>{this['hideFakeVisualSelection'](),_0x54e509||this['_resetContentOfSelectedTableCells'](_0x1649a2,_0x589c6f),this['_pasteHTMLUsingClipboard']({'insertAt':_0x2f8fbf,'writer':_0x1649a2,'html':_0x40b670});});}['insertContentBelow'](_0x1fc124){const {model:_0x5b3d49}=this['editor'],_0x4cea41=this['_getAISelection']();_0x5b3d49['change'](()=>{const _0x3772bb=this['_prepareTableInsertBelowPosition'](_0x1fc124,_0x4cea41)||this['_getDefaultInsertBelowPosition'](_0x4cea41);this['insertContent'](_0x1fc124,_0x3772bb);});}['_getAISelection'](){const _0x289453=this['editor']['model'],_0x2a6404=Array['from'](_0x289453['markers']['getMarkersGroup'](f))['map'](_0x55801b=>_0x55801b['getRange']());return _0x289453['createSelection'](_0x2a6404);}['_pasteHTMLUsingClipboard']({writer:_0x1cee90,html:_0x4b046d,insertAt:_0xfba17a}){const {view:_0x536755}=this['editor']['editing'],_0x246da1=this['editor']['plugins']['get'](_0x1224ca),_0x57ebac=new gt();_0x57ebac['setData']('text/html',_0x4b046d);const _0x4b3837=new ClipboardEvent('paste',{'clipboardData':_0x57ebac}),_0x33db22=new _0xb9891c(_0x536755,_0x4b3837,{'dataTransfer':new _0x9a2b22(_0x57ebac)});_0x1cee90['setSelection'](_0xfba17a);const _0x3bd107=(_0x54b5ef,_0x51569e)=>{_0x51569e['resultRange']&&_0x1cee90['setSelection'](_0x51569e['resultRange']);};_0x246da1['once']('contentInsertion',_0x3bd107,{'priority':'lowest'}),_0x536755['document']['fire']('paste',_0x33db22),_0x246da1['off']('contentInsertion',_0x3bd107);}['_getDefaultInsertBelowPosition'](_0x36617e){const {model:_0x2751c5}=this['editor'],_0x45d97e=Array['from'](_0x36617e['getSelectedBlocks']());return _0x45d97e['length']?_0x2751c5['createPositionAfter'](_0x45d97e['pop']()):_0x36617e['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x5c3a2c,_0x44bdcb){const {model:_0x2ebad2,plugins:_0x1e565a}=this['editor'];if(_0x1e565a['has']('TableUtils')){const _0x3a0765=_0x1e565a['get']('TableUtils')['getSelectedTableCells'](_0x44bdcb);if(_0x3a0765['length']){const _0x58fbda=this['_getTableRowCountFromContent'](_0x5c3a2c),_0x5ad8c8=this['_createEmptyTableRows'](_0x3a0765,_0x58fbda);return _0x2ebad2['createPositionAt'](_0x5ad8c8,0x0);}}return null;}['_getTableRowCountFromContent'](_0xd49ac){const _0x52121b=this['editor']['plugins']['get']('TableUtils'),_0x21b65b=this['editor']['data']['parse'](_0xd49ac),_0x364ead=Array['from'](_0x21b65b['getChildren']())['filter'](_0xde231=>_0xde231['is']('element','table'));let _0xb361cd=0x0;return _0x364ead['forEach'](_0x50d7f2=>{_0xb361cd+=_0x52121b['getRows'](_0x50d7f2);}),_0xb361cd;}['_createEmptyTableRows'](_0x1d18f8,_0x2bbac6){const _0x17aa0d=this['editor']['plugins']['get']('TableUtils'),_0x29ce6b=_0x17aa0d['getRowIndexes'](_0x1d18f8),_0x4492e0=_0x17aa0d['getColumnIndexes'](_0x1d18f8),_0x40f8f4=_0x29ce6b['last']+0x1,_0x27bc04=_0x4492e0['first'],_0x26ae38=_0x1d18f8[0x0]['findAncestor']('table');for(let _0x2c008b=0x0;_0x2c008b<_0x2bbac6;_0x2c008b++)_0x17aa0d['insertRows'](_0x26ae38,{'at':_0x40f8f4});return _0x26ae38['getChild'](_0x40f8f4)['getChild'](_0x27bc04);}['_resetContentOfSelectedTableCells'](_0x4fa791,_0x4a4069){const {plugins:_0x5e5c89}=this['editor'],{model:_0x1a7330}=_0x4fa791;if(!_0x5e5c89['has']('TableUtils'))return;_0x5e5c89['get']('TableUtils')['getSelectedTableCells'](_0x4a4069)['length']&&_0x1a7330['deleteContent'](_0x4a4069);}}class E extends _0x28fa44{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x360bab('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x51fb6f){super(_0x51fb6f),this['name']='AIRequestError';}}function i(_0x58dfc7,_0x1dd32c,_0x574cd5){const t=_0x58dfc7['t'];switch(_0x1dd32c){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',_0x574cd5);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x574cd5);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'},_0x574cd5);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 _0x1dd32c;}}class j extends _0x1b4e17{['_commandDefinitions'];constructor(_0x519181,_0xdd1459){super(_0x519181),this['_commandDefinitions']=_0xdd1459,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3ce3f7,_0x3c82c0,_0x402ef7)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x402ef7));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x51c492,_0x1c3744,_0x56805b)=>{this['enabledCommandsIds']=_0x56805b?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x46718d=this['editor']['model'];this['_hasContext']=function(_0x254e8e){const _0x13afc9=_0x254e8e['document']['selection'];return _0x13afc9['isCollapsed']?0x0!==[..._0x13afc9['getSelectedBlocks']()]['length']&&![..._0x13afc9['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x254e8e['hasContent'](_0x13afc9['getFirstRange']());}(_0x46718d);const _0x20d94b=_0x46718d['document']['selection'],_0x59357e=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x5ec4e8 of _0x20d94b['getRanges']())for(const _0x19e7a4 of _0x5ec4e8['getItems']())if(_0x19e7a4['is']('element')&&_0x59357e['includes'](_0x19e7a4['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x315e84='',_0x52bf92='',_0x2e55ba='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x315e84,_0x52bf92,_0x2e55ba);}}function G(_0x11d5c0,_0x14b81b){const _0x2a4372=new Set();for(const _0x52e0ef of _0x11d5c0['values']())(_0x14b81b||!0x1===_0x52e0ef['requiresContent'])&&_0x2a4372['add'](_0x52e0ef['id']);return Array['from'](_0x2a4372);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
+ _0x3552d4(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3013c8,_0x442b7d,_0xd35f73){super(),this['editor']=_0x3013c8,this['textAdapter']=_0x442b7d,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xd35f73,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x5b0243,_0x393dfa,_0x2ca97b)=>{this['view']['value']=this['_sanitizeHTML'](_0x2ca97b);}),this['listenTo'](this['view'],'submitPrompt',(_0x33de15,_0x4a2683)=>{const _0x20a02b=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4a2683,_0x20a02b,'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:_0x3a2496,query:_0x16f7d3,htmlContent:_0xee8834,label:_0x3b46f9,mainActionLabel:_0x6bf721}){this['view']['prompt']=_0x3b46f9,this['view']['mainAction']=_0x6bf721,this['initialContext']=_0xee8834,_0x16f7d3&&(this['view']['isRendered']?this['_handleQuery'](_0x16f7d3,_0xee8834,_0x3a2496,_0x3b46f9):this['view']['once']('render',()=>{this['_handleQuery'](_0x16f7d3,_0xee8834,_0x3a2496,_0x3b46f9);}));}['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'](_0x3b1e5f,_0x552442,_0x4f488c,_0x11c9fd){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x552442,this['previousQuery']=_0x3b1e5f,this['previousLabel']=_0x11c9fd||_0x3b1e5f,this['previousActionId']=_0x4f488c,new Promise(_0x1bb790=>{this['textAdapter']['makeRequest']({'query':_0x3b1e5f,'context':_0x552442,'onData':_0x200cc6=>{this['currentResponse']=_0x200cc6,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4f488c})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x5e557d=>{_0x5e557d instanceof R?this['view']['handleError'](_0x5e557d['message']):this['view']['handleError'](),_0x1bb790();})['finally'](()=>{this['stopProcessing'](),_0x1bb790();});});}['_parseAndNormalizeContent'](_0x4f64f1,_0x52c784=!0x1){const _0x4f7b28=Z['exec'](_0x4f64f1);_0x4f64f1=_0x4f7b28?_0x4f64f1['substring'](_0x4f7b28[0x1]['length']):_0x4f64f1['length']<0x64&&!_0x52c784?'':this['_stripMarkdownSyntax'](_0x4f64f1);const _0x280347=this['_domParser']['parseFromString'](_0x4f64f1,'text/html');if(_0x4f7b28){const _0x473f63=Array['from'](_0x280347['body']['childNodes']);_0x473f63['reverse']();for(const _0x2f9609 of _0x473f63){if(_0x2f9609['nodeType']==Node['ELEMENT_NODE'])break;_0x2f9609['remove']();}}const _0x120611=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x280347['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x120611);const _0x22498f=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x1c41a8=this['editor']['data']['toModel'](_0x120611);return _0x22498f||_0x1c41a8['markers']['clear'](),this['editor']['data']['stringify'](_0x1c41a8);}['_normalizeResponseHeadings'](_0x4dfc89){const _0x4838c4=new _0xf6c6e9(this['editor']['editing']['view']['document']),_0x5d6a45=new _0x57fd1e({'name':/^h[1-5]$/}),_0x5e1631=[];let _0x531c8c=!0x1;for(const _0x52f93f of _0x4dfc89)_0x52f93f['is']('element')&&_0x5d6a45['match'](_0x52f93f)&&(_0x5e1631['push'](_0x52f93f),'h1'==_0x52f93f['name']&&(_0x531c8c=!0x0));if(_0x531c8c){for(const _0x14eccf of _0x5e1631)_0x4838c4['rename']('h'+(parseInt(_0x14eccf['name'][0x1])+0x1),_0x14eccf);}}['_isH1TagSupportEnabled'](){const {data:_0x2145a0,editing:_0x137c79}=this['editor'],_0x5b3e32=_0x2145a0['htmlProcessor']['toView']('<h1></h1>'),_0x2fa9ef=_0x2145a0['toView'](_0x2145a0['toModel'](_0x5b3e32));return!!_0x137c79['view']['domConverter']['viewToDom'](_0x2fa9ef)['querySelector']('h1');}['_sanitizeHTML'](_0x41f556){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x41f556),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x111ed2){const _0x3a0a72=_0x111ed2['trim']();return _0x3a0a72['startsWith']('```html')?_0x3a0a72['endsWith']('```')?_0x3a0a72['substring'](0x7,_0x3a0a72['length']-0x3):_0x3a0a72['substring'](0x7):_0x111ed2;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x11ca67){super(_0x11ca67),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4a347f=>i(_0x11ca67,'AI_'+_0x4a347f['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x11ca67,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x11ca67,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x11ca67,'Stop'));const _0xb3f184=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xb3f184['if']('isVisible','ck-hidden',_0x7c607b=>!_0x7c607b)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x40f829,_0x59d619){const _0x2621e0=new _0x499fc4(this['locale']);return _0x2621e0['set']({'label':_0x40f829,'class':_0x59d619||'','isVisible':!0x0,'withText':!0x0}),_0x2621e0;}}class Y extends _0x5d0c42{['contentFieldView'];['copyButtonView'];constructor(_0x549d39,_0x36bb7e=''){super(_0x549d39),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1593c2=this['bindTemplate'];this['contentFieldView']=new At(_0x549d39,_0x36bb7e),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1593c2['if']('isVisible','ck-hidden',_0x5890e7=>!_0x5890e7)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1593c2['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 _0x2ebe24=!0x1;this['on']('change:value',(_0x53dcd2,_0x3e256b,_0x1d21b5)=>{const _0x429393=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1d21b5),this['isProcessing']&&_0x429393&&!_0x2ebe24&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x31240b,_0x13d3ad,_0x194796)=>{_0x2ebe24=!0x1,_0x194796?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2ebe24=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2ebe24=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x440691=this['locale'],_0x224583=new _0x499fc4(this['locale']),_0x2a518e='ck-ai-form__copy-button';return _0x224583['set']({'label':i(_0x440691,'Copy'),'icon':_0x4c87f5,'class':_0x2a518e,'tooltip':!0x0}),_0x224583['bind']('isVisible')['to'](this,'value',_0x54524d=>!!_0x54524d),_0x224583['bind']('isEnabled')['to'](this,'isProcessing',_0x563d99=>!_0x563d99),_0x224583['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x224583['icon']=_0x18de84,_0x224583['class']=_0x2a518e+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x224583['icon']=_0x4c87f5,_0x224583['class']=_0x2a518e;},0x3e8);}),_0x224583;}['_copyHTMLToClipboard'](_0x31a27b){const {window:_0x52067a,document:_0x2a935c}=_0x4aa064;if(_0x52067a['ClipboardItem']){const {Blob:_0x3e6cb3,ClipboardItem:_0x1b20d1}=_0x52067a,_0x333da1=[new _0x1b20d1({'text/html':new _0x3e6cb3([_0x31a27b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3e6cb3([_0x31a27b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x333da1);}else{const _0x42f5f2=_0x2a935c['createElement']('div');_0x42f5f2['style']['position']='absolute',_0x42f5f2['style']['left']='-9999px',_0x42f5f2['innerHTML']='<span>[</span>'+_0x31a27b['innerHTML']+'<span>]</span>',_0x2a935c['body']['appendChild'](_0x42f5f2);const _0x50e2bd=_0x2a935c['createRange']();_0x50e2bd['setStartAfter'](_0x42f5f2['firstElementChild']),_0x50e2bd['setEndBefore'](_0x42f5f2['lastElementChild']);const _0x13aa5e=_0x52067a['getSelection']();_0x13aa5e['removeAllRanges'](),_0x13aa5e['addRange'](_0x50e2bd),_0x2a935c['execCommand']('copy'),_0x42f5f2['remove']();}}}class At extends _0x5d0c42{constructor(_0x4fe548,_0x172d50=''){super(_0x4fe548),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x172d50,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x474fd3){this['element']['innerHTML']=_0x474fd3;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2ab29d=new _0x5d0c42(),_0x40652b=this['locale'],_0x39bb28=new _0x433f18();return _0x39bb28['isVisible']=!0x0,_0x2ab29d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x39bb28,{'text':i(_0x40652b,'AI\x20is\x20writing...')}]}),_0x2ab29d['render'](),_0x2ab29d;}}class st extends _0x5d0c42{constructor(_0xc3a4b1,_0x57394d=''){super(_0xc3a4b1);const _0x14223e=new rt(),_0x2fc23f=this['bindTemplate'];this['set']('text',_0x57394d),_0x14223e['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x14223e,{'text':_0x2fc23f['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0xa4e4c5,_0x1a952d){super(_0xa4e4c5,_0x1a952d),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',(_0x2ef36c,_0x2cdb96)=>{_0x2ef36c['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2cdb96());});}['_createSubmitButton'](){const _0x537172=new _0x499fc4(this['locale']),_0x2a1f0b=this['locale'];return _0x537172['set']({'icon':ht,'label':i(_0x2a1f0b,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x537172['on']('execute',()=>{this['submit']();}),_0x537172['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x352dc4,_0xc04e8b)=>!_0x352dc4&&_0xc04e8b),_0x537172;}['_createShowHistoryButton'](){const _0x588a01=new _0x499fc4(this['locale']),_0x2b9246=this['resultsView'],_0x141af9=this['locale'];_0x588a01['set']({'label':i(_0x141af9,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x588a01['bind']('isOn')['to'](_0x2b9246,'isVisible'),_0x588a01['bind']('isEnabled')['to'](this,'isEnabled'),_0x588a01['on']('execute',()=>{_0x2b9246['isVisible']=!_0x2b9246['isVisible'],_0x2b9246['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x55bdd4=()=>{_0x4aa064['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x3b6469=new it(this['queryView']['fieldView']['element']),_0x28a123=_0x3b6469['width'],_0x3bf6da='rtl'===_0x141af9['uiLanguageDirection']?'left':'right';_0x3b6469['excludeScrollbarsAndBorders'](),_0x588a01['element']['style'][_0x3bf6da]=_0x28a123-_0x3b6469['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x55bdd4),this['on']('render',_0x55bdd4),_0x588a01;}['submit'](){const _0x1e7bb0=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1e7bb0);}['focus'](_0x31216a){-0x1===_0x31216a?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x4f3807){super(_0x4f3807),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x4f3807,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2f7cdb=0x0;for(const _0xdded5d of this['items'])_0x2f7cdb+=_0xdded5d['items']['length'];return{'resultsCount':_0x2f7cdb,'totalItemsCount':_0x2f7cdb};}['_createClearHistoryButton'](){const _0x42a886=this['locale'],_0x47b106=new _0x499fc4(this['locale']);return _0x47b106['set']({'label':'('+i(_0x42a886,'Clear')+')','withText':!0x0}),_0x47b106['on']('execute',()=>this['fire']('clearHistory')),_0x47b106;}}class bt extends xt{constructor(_0x2b1102){super();const _0x332118=new kt(),_0x13f763=new _0x499fc4(this['locale'],_0x332118);this['children']['add'](_0x13f763),_0x13f763['set']({'label':_0x2b1102['prompt'],'withText':!0x0}),_0x13f763['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x2b1102['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x2f8d6f{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4938c2,_0x18a288)=>{const _0x10996c=os(_0x18a288['prompt']);for(const _0x132a50 of this)if(_0x132a50!=_0x18a288&&os(_0x132a50['prompt'])===_0x10996c){this['remove'](_0x132a50);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x377031=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x377031));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x4e0cdc=>_0x4e0cdc)));}}function os(_0x1b4e28){return _0x1b4e28['toLowerCase']()['trim']();}class _ extends _0x5d0c42{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x36ca65,_0x3f0368,_0x2eeb9b=''){super(_0x36ca65),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0x36ca65),this['contentArea']=new Y(_0x36ca65,_0x2eeb9b),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 mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'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 _0x4ecbdd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x3f0368],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4ecbdd['if']('isError','ck-hidden',_0x44a35c=>!_0x44a35c)]},'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'](_0x2a15d6=0x1){-0x1===_0x2a15d6?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 _0x34e814=this['locale'],_0x38bc2c=new ct(_0x34e814,{'queryView':{'label':i(_0x34e814,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x34e814,'Empty\x20history'),'secondary':i(_0x34e814,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x38bc2c['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x329991,_0x4e0943)=>_0x329991&&!_0x4e0943),this['listenTo'](_0x38bc2c,'submit',(_0x2e65cc,_0xb4d25f)=>{this['prompt']=_0xb4d25f;const _0x13a5b5=yt(_0xb4d25f);this['fire']('submitPrompt',_0x13a5b5),_0xb4d25f['trim']()&&this['_promptHistory']['add']({'prompt':_0x13a5b5},0x0);},{'priority':'high'}),_0x38bc2c;}['_createHistoryView'](){const _0x58f6e5=new ft(this['locale']);return _0x58f6e5['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x58f6e5['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x58f6e5;}['_createToolbar'](){const _0x13512b=new lt(this['locale']);return _0x13512b['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xac5f9d,_0x564966,_0x1183d5)=>_0xac5f9d&&!_0x564966&&!!_0x1183d5),_0x13512b['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x13512b['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x58092c,_0x3fc45e,_0x16ffe5)=>_0x58092c&&!_0x3fc45e&&!!_0x16ffe5),_0x13512b['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x13512b['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1d12c3,_0x570fa2)=>_0x1d12c3&&!_0x570fa2),_0x13512b['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x13512b['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x13512b['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x13512b;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1604ed=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x1604ed,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2f921a){const _0x593df9=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2f921a||i(_0x593df9,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x28fa44{['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[_0x4a2c85,a,E,_0x46dd7f];}constructor(_0x4f3f61){super(_0x4f3f61),_0x4f3f61['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x4f3f61['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x4f3f61['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x4f3f61['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4e8a7a}=this;this['_aiAdapter']=_0x4e8a7a['plugins']['get'](E),this['_dialog']=_0x4e8a7a['plugins']['get'](_0x46dd7f),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1db4a7=new j(_0x4e8a7a,Array['from'](this['_commandDefinitions']['values']()));_0x4e8a7a['commands']['add']('showAIAssistant',_0x1db4a7),_0x4e8a7a['ui']['componentFactory']['add']('aiCommands',_0x4be9df=>{const _0x54d3f1=_0x242a15(_0x4be9df);return _0x54d3f1['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x54d3f1['buttonView']['set']({'label':i(_0x4be9df,'AI\x20Commands'),'icon':_0x522dcb,'tooltip':!0x0}),_0x54d3f1['on']('execute',_0x581211=>this['_onExecute'](_0x581211['source']['id'])),_0x1eaac7(_0x54d3f1,_0x4e8a7a['ui']['view']['body'],function(_0x262397){const _0x10395f=o(_0x262397['config']['get']('ai.aiAssistant.commands'),_0x262397['locale']),_0x47ea56=U(_0x262397,_0x10395f)['filter'](_0x34aa41=>_0x34aa41['commands']['length']);if(0x1===_0x47ea56['length'])return U(_0x262397,_0x47ea56[0x0]['commands'])['map'](_0xf29a16=>({'id':_0xf29a16['id'],'label':_0xf29a16['label']}));return _0x47ea56['map'](_0x439938=>{const {groupId:_0x36b169,groupLabel:_0x50877,commands:_0xb68911}=_0x439938,_0x5eea8d=U(_0x262397,_0xb68911)['map'](_0x2ddb59=>({'id':_0x2ddb59['id'],'label':_0x2ddb59['label']}));return{'id':_0x36b169,'menu':_0x50877||_0x36b169,'children':_0x5eea8d};});}(_0x4e8a7a),{'ariaLabel':i(_0x4be9df,'AI\x20Commands')}),_0x54d3f1['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1db4a7['on']('change:enabledCommandsIds',_0x4a53fd),_0x54d3f1['menuView']['once']('render',_0x4a53fd),_0x54d3f1;function _0x4a53fd(){_0x54d3f1['isEnabled']=_0x1db4a7['enabledCommandsIds']['length']>0x0;for(const _0x7f08f9 of _0x54d3f1['menuView']['buttons'])_0x7f08f9['isEnabled']=_0x1db4a7['enabledCommandsIds']['includes'](_0x7f08f9['id']);}}),_0x4e8a7a['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1edb0b=>{const _0x59ae7b=new _0x3cd897(_0x1edb0b);_0x59ae7b['buttonView']['set']({'label':i(_0x1edb0b,'AI\x20Commands'),'icon':_0x522dcb}),_0x59ae7b['bind']('isEnabled')['to'](_0x1db4a7,'enabledCommandsIds',_0x3f226e=>_0x3f226e['length']>0x0);const _0x1622dc=o(_0x4e8a7a['config']['get']('ai.aiAssistant.commands'),_0x1edb0b);return this['_populateMenuBarMenu'](_0x1db4a7,_0x59ae7b,_0x1622dc,_0x1c6fb8=>this['_onExecute'](_0x1c6fb8)),_0x59ae7b;}),_0x4e8a7a['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x845f61=this['_createAIAssistantUIButton'](_0x499fc4);return _0x845f61['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x845f61;}),_0x4e8a7a['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x49fdc9=this['_createAIAssistantUIButton'](_0x267bb5);return _0x49fdc9['set']({'role':'menuitemcheckbox'}),_0x49fdc9;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1180cb=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xf41ec7;for(const _0x590c18 in _0x1180cb){const _0x3f0d=_0x590c18,_0x5e9b0a=_0x1180cb[_0x3f0d];if('aiLicenseKeyValid'==_0x5e9b0a||'aiLicenseKeyInvalid'==_0x5e9b0a||'aiLicenseKeyExpired'==_0x5e9b0a||'aiLicenseKeyDomainLimit'==_0x5e9b0a||'aiLicenseKeyNotAllowed'==_0x5e9b0a||'aiLicenseKeyEvaluationLimit'==_0x5e9b0a||'aiLicenseKeyTrialLimit'==_0x5e9b0a||'aiLicenseKeyUsageLimit'==_0x5e9b0a){delete _0x1180cb[_0x3f0d],_0xf41ec7=_0x5e9b0a,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xf41ec7&&_0x1180cb['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xf41ec7&&_0x1180cb['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xf41ec7&&_0x1180cb['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xf41ec7&&_0x1180cb['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xf41ec7&&_0x1180cb['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0xf41ec7&&_0x1180cb['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0xf41ec7&&_0x1180cb['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x351bd2='',_0x55a50a='',_0x27edc7='custom'){const _0x3b9b27=this['editor'],_0x26063c=_0x3b9b27['editing']['view'],_0x1a54a9=_0x3b9b27['plugins']['get'](a),_0x29d51d=_0x3b9b27['plugins']['get'](_0x4a2c85);_0x1a54a9['showFakeVisualSelection']();const _0x532505=new w(),_0x4a560d=new ClipboardEvent('copy',{'clipboardData':_0x532505}),_0x476858=new _0x9a2b22(_0x532505),_0x421927=new _0xb9891c(_0x26063c,_0x4a560d,{'dataTransfer':_0x476858});_0x29d51d['_forceMarkersCopy']('comment',()=>{_0x26063c['document']['fire']('copy',_0x421927);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x3b9b27,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x5bfb5c=_0x476858['getData']('text/html');const _0x17700a=_0x3b9b27['model']['document']['selection'],_0x5a2812=Array['from'](_0x17700a['getRanges']());0x1===_0x5a2812['length']&&_0x5a2812[0x0]['isFlat']&&!_0x17700a['getSelectedElement']()&&''!==_0x5bfb5c['replace'](/&nbsp;/g,'')['trim']()&&(_0x5bfb5c='<p>'+_0x5bfb5c+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x27edc7,'query':_0x351bd2,'htmlContent':_0x5bfb5c,'label':_0x55a50a,'mainActionLabel':M[_0x3b9b27['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x33d1a4,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x39e61d['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x1a54a9['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x1de6a8=new Map(),_0xc1eced=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x54e2f8 of _0xc1eced)for(const _0x45dc50 of _0x54e2f8['commands'])_0x1de6a8['set'](_0x45dc50['id'],{..._0x45dc50,'groupId':_0x54e2f8['groupId'],'groupLabel':_0x54e2f8['groupLabel']||_0x54e2f8['groupId']});return _0x1de6a8;}['_createAIAssistantUIButton'](_0x4b0742){const _0x3f30e8=this['editor'],_0x462724=_0x3f30e8['commands']['get']('showAIAssistant'),_0x4fd68b=new _0x4b0742(_0x3f30e8['locale']);return _0x4fd68b['set']({'label':i(_0x3f30e8['locale'],'AI\x20Assistant'),'icon':_0x33d1a4,'isToggleable':!0x0}),_0x4fd68b['bind']('isEnabled')['to'](_0x462724),_0x4fd68b['bind']('isOn')['to'](this['_dialog'],'id',_0x3f3a74=>'aiAssistant'===_0x3f3a74),this['listenTo'](_0x4fd68b,'execute',()=>{_0x4fd68b['isOn']?this['hideUI']():_0x462724['execute']();}),_0x4fd68b;}['_initView'](){const _0x49f020=this['editor']['plugins']['get'](a);this['_formView']=new _(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',()=>{_0x49f020['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x49f020['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2973be,ui:{ariaLiveAnnouncer:_0x51aee1}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x9159c9,_0xca03e6,_0x218510)=>{const _0x280646=this['_aiAssistantController']['currentContext'];_0x218510?_0x51aee1['announce'](i(_0x2973be,'AI\x20is\x20writing')):_0x280646&&_0x51aee1['announce'](i(_0x2973be,'Generated\x20content:\x20%0',_0x280646),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3fc821,_0x745f9c,_0x466c3a)=>{if(_0x466c3a){const _0x2263bc=this['_formView']['errorView']['text'];_0x51aee1['announce'](i(_0x2973be,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2263bc));}});}['_onExecute'](_0x2fb206){const _0x49c2fc=this['_commandDefinitions']['get'](_0x2fb206),_0x26fef1=this['editor'],_0x4d5293=_0x26fef1['model']['document']['selection'],_0x58e605=_0x26fef1['commands']['get']('showAIAssistant'),_0x5b74d6=_0x26fef1['plugins']['get'](a),_0x2cd3ac=''+(_0x49c2fc['groupId']!==x?_0x49c2fc['groupLabel']+':\x20':'')+_0x49c2fc['label'];if(!0x1!==_0x49c2fc['requiresContent']&&_0x4d5293['isCollapsed']){const _0x48d054=_0x42f680(_0x4d5293['getSelectedBlocks']())||_0x26fef1['model']['schema']['getLimitElement'](_0x4d5293);_0x26fef1['model']['change'](_0x13b14a=>{_0x13b14a['setSelection'](_0x48d054,'in');});}_0x5b74d6['showFakeVisualSelection'](),_0x58e605['execute'](_0x49c2fc['prompt'],_0x2cd3ac,'command:'+_0x2fb206);}['_populateMenuBarMenu'](_0x557e8f,_0x34c478,_0x15dc11,_0x11c434){const _0x3cca57=this['editor'],_0x37c7c0=_0x3cca57['locale'],_0x579ca3=new _0x2af723(_0x37c7c0),_0x2c36f7=U(_0x3cca57,_0x15dc11)['filter'](_0x21a402=>_0x21a402['commands']['length']);0x1===_0x2c36f7['length']?this['_getMenuBarGroupButtons']({'command':_0x557e8f,'commands':_0x2c36f7[0x0]['commands'],'parentMenuView':_0x34c478,'onExecute':_0x11c434})['forEach'](_0x1cb10d=>_0x579ca3['items']['add'](_0x1cb10d)):_0x2c36f7['forEach'](({groupId:_0x37f36e,groupLabel:_0x3695b5,commands:_0x41bb71})=>{const _0xe95921=new _0xb56018(_0x37c7c0,_0x34c478),_0x3e3fa9=new _0x3cd897(_0x37c7c0),_0x4a28f9=new _0x2af723(_0x37c7c0),_0x38e47d=this['_getMenuBarGroupButtons']({'command':_0x557e8f,'commands':_0x41bb71,'parentMenuView':_0x3e3fa9,'onExecute':_0x11c434});_0x3e3fa9['buttonView']['set']({'label':_0x3695b5||_0x37f36e}),_0x3e3fa9['delegate']('execute')['to'](_0x34c478),_0x4a28f9['items']['addMany'](_0x38e47d),_0x3e3fa9['panelView']['children']['add'](_0x4a28f9),_0xe95921['children']['add'](_0x3e3fa9),_0x579ca3['items']['add'](_0xe95921);}),_0x34c478['panelView']['children']['add'](_0x579ca3);}['_getMenuBarGroupButtons']({command:_0x16b246,commands:_0x45293a,parentMenuView:_0x1fd392,onExecute:_0x5894a3}){const _0xe141f7=this['editor'],_0x2f30ce=_0xe141f7['locale'];return U(_0xe141f7,_0x45293a)['map'](_0xbc6d5f=>{const _0x3865f7=new _0xb56018(_0x2f30ce,_0x1fd392),_0x2c6bbf=new _0x267bb5(_0x2f30ce);return _0x2c6bbf['set']({'label':_0xbc6d5f['label']}),_0x2c6bbf['delegate']('execute')['to'](_0x1fd392),_0x2c6bbf['on']('execute',()=>_0x5894a3(_0xbc6d5f['id'])),_0x2c6bbf['bind']('isEnabled')['to'](_0x16b246,'enabledCommandsIds',_0x2201f7=>_0x2201f7['includes'](_0xbc6d5f['id'])),_0x3865f7['children']['add'](_0x2c6bbf),_0x3865f7;});}}function B(_0x53dd5a,_0x1bd821){return void 0x0!==_0x53dd5a['order']&&void 0x0===_0x1bd821['order']?0x1:void 0x0===_0x53dd5a['order']&&void 0x0!==_0x1bd821['order']?-0x1:void 0x0!==_0x53dd5a['order']&&void 0x0!==_0x1bd821['order']?_0x53dd5a['order']-_0x1bd821['order']:0x0;}function U(_0x488f49,_0x5c3edc){_0x5c3edc['sort'](B);const _0x27cbc3={},_0xc6b23b=[];for(const _0x3fdb02 of _0x5c3edc)if(void 0x0!==_0x3fdb02['order']){if(_0x3fdb02['order']in _0x27cbc3)throw new _0x360bab('ai-commands-config-order-collision',_0x488f49,{'conflictingDefinitions':[_0x3fdb02,_0x27cbc3[_0x3fdb02['order']]]});_0x27cbc3[_0x3fdb02['order']]=_0x3fdb02,_0xc6b23b['splice'](_0x3fdb02['order'],0x0,_0x3fdb02);}else _0xc6b23b['push'](_0x3fdb02);return _0xc6b23b;}class r extends _0x28fa44{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3a4620){super(_0x3a4620);const _0x18bc53=_0x3a4620['config'],_0x2f414e=_0x3a4620['locale'];_0x18bc53['define']('ai.aiAssistant.preserveComments',!0x0),_0x18bc53['define']('ai.aiAssistant.commands',function(_0x1df5a6){return[{'groupId':'editOrReview','groupLabel':i(_0x1df5a6,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x1df5a6,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x1df5a6,'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(_0x1df5a6,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x1df5a6,'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(_0x1df5a6,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x1df5a6,'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(_0x1df5a6,'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(_0x1df5a6,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x1df5a6,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x1df5a6,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x1df5a6,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x1df5a6,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x1df5a6,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x1df5a6,'Change\x20style'),'commands':[{'id':'business','label':i(_0x1df5a6,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x1df5a6,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x1df5a6,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x1df5a6,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x1df5a6,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x1df5a6,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x1df5a6,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x1df5a6,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x1df5a6,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x1df5a6,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x1df5a6,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x1df5a6,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x1df5a6,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x2f414e)),_0x18bc53['define']('ai.aiAssistant.extraCommandGroups',[]),_0x18bc53['define']('ai.aiAssistant.removeCommands',[]);let _0x5f36a0=o(_0x18bc53['get']('ai.aiAssistant.commands'),_0x2f414e);const _0x5c8000=_0x18bc53['get']('ai.aiAssistant.extraCommandGroups'),_0x343fd=_0x18bc53['get']('ai.aiAssistant.removeCommands');_0x5c8000['forEach'](_0x3f3e95=>{const _0x4b7b70=_0x5f36a0['find'](_0x3ebc90=>_0x3ebc90['groupId']===_0x3f3e95['groupId']);_0x4b7b70?_0x4b7b70['commands']=_0x4b7b70['commands']['concat'](_0x3f3e95['commands']):_0x5f36a0['push'](_0x3f3e95);}),_0x5f36a0=_0x5f36a0['filter'](_0x4f5b23=>!_0x343fd['includes'](_0x4f5b23['groupId'])),_0x5f36a0['forEach'](_0x56db3c=>{_0x56db3c['commands']=_0x56db3c['commands']['filter'](_0x40ff5d=>!_0x343fd['includes'](_0x40ff5d['id']));}),_0x18bc53['set']('ai.aiAssistant.commands',_0x5f36a0);}}class P extends _0x28fa44{['abortController'];static get['requires'](){return[E];}constructor(_0x4e524e){super(_0x4e524e),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x17d356){return this['sendRequest'](_0x17d356)['catch'](_0x569228=>{if(_0x569228 instanceof R)return Promise['reject'](_0x569228);if('AbortError'==_0x569228['name'])return Promise['resolve']();throw console['error'](_0x569228),new _0x360bab('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2c6456,_0x137aa5){const _0x5960fb=this['editor']['locale'],_0x20b149={'Content-Type':'application/json'};if('object'==typeof _0x2c6456)Object['assign'](_0x20b149,_0x2c6456);else{if(_0x2c6456)try{const _0x5c5b2d=await _0x2c6456(_0x137aa5);Object['assign'](_0x20b149,_0x5c5b2d);}catch(_0xee1a4d){return Promise['reject'](new R(i(_0x5960fb,'AI_ERROR_GET_HEADERS')));}}return _0x20b149;}async['_prepareRequestParameters'](_0x5296f8,_0x300ef7){const _0x380c11=this['editor']['locale'];if('object'==typeof _0x5296f8)return _0x5296f8;try{return await _0x5296f8(_0x300ef7);}catch(_0x1dbb97){return Promise['reject'](new R(i(_0x380c11,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x579318){super(_0x579318),_0x579318['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x579318['config']['get']('ai.openAI.requestParameters')||_0x579318['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x579318['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x579318['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x579318['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x4f72ad,context:_0x1afd39,onData:_0x28788c,actionId:_0x2ce104}){const _0x470842=this['editor']['locale'],_0x4f4c34=await this['prepareMessages'](_0x4f72ad,_0x1afd39,_0x2ce104),_0xec16ce=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2ce104),_0x2c3592=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2ce104),_0x2145b4={'messages':_0x4f4c34,..._0x2c3592},_0x5b940e={'method':'POST','headers':_0xec16ce,'body':JSON['stringify'](_0x2145b4),'signal':this['abortController']['signal']},_0x458e41=await fetch(this['_apiUrl'],_0x5b940e);if(_0x458e41['ok'])return _0x2c3592['stream']?await this['_readStreamableResponse'](_0x458e41,_0x28788c):await this['_readStaticResponse'](_0x458e41,_0x28788c),Promise['resolve']();{const _0x56927b=await _0x458e41['text']();return _0x56927b['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x470842,'AI_ERROR_CONTEXT_LENGTH'))):_0x56927b['includes']('Moderation')?Promise['reject'](new R(i(_0x470842,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x56927b));}}async['prepareMessages'](_0x3084fc,_0x226d06,_0x3263fd){let _0x200195,_0x1277c1;return _0x226d06?(_0x200195='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.',_0x1277c1='Instruction:\x0a'+_0x3084fc+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x226d06):(_0x200195='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.',_0x1277c1=_0x3084fc),[{'role':'system','content':_0x200195},{'role':'user','content':_0x1277c1}];}async['_readStreamableResponse'](_0x5a3553,_0x14d1bb){const _0x2da9a5=_0x5a3553['body']['getReader'](),_0x26d489=new TextDecoder();let _0x350f94='',_0x2967ff='',_0x438a88='',_0x77366b=!0x1;for(;!_0x77366b;){const {done:_0x2d9062,value:_0x4d5ae3}=await _0x2da9a5['read'](),_0x523249=_0x350f94+_0x26d489['decode'](_0x4d5ae3);let _0x6b5cf7='';_0x77366b=_0x2d9062;try{_0x6b5cf7=this['_cleanUpData'](_0x523249),_0x350f94='';}catch(_0x4779e7){_0x350f94=_0x523249;continue;}_0x2967ff+=_0x6b5cf7,!_0x77366b&&this['_isBufferIncomplete'](_0x2967ff)||_0x2967ff&&(_0x438a88+=_0x2967ff,_0x2967ff='',_0x14d1bb(_0x438a88));}return Promise['resolve']();}async['_readStaticResponse'](_0x4df0f2,_0x52c419){return _0x52c419((await _0x4df0f2['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3bc541){const _0x347c65=_0x3bc541['split']('<')['length']!==_0x3bc541['split']('>')['length'],_0x322d2d=_0x3bc541['length']<0x1e;return _0x347c65&&_0x322d2d;}['_cleanUpData'](_0x827747){return _0x827747['split'](/\n(?![^{]*\})/g)['map'](_0x101958=>_0x101958['replace']('data:\x20',''))['filter'](_0x6c3379=>_0x6c3379&&_0x6c3379['length']>0x0&&'[DONE]'!==_0x6c3379)['map'](_0x9bc326=>{const {choices:_0x1d7b58}=JSON['parse'](_0x9bc326);if(_0x1d7b58[0x0]?.['delta']?.['content'])return _0x1d7b58[0x0]['delta']['content'];})['filter'](_0x45c1ba=>_0x45c1ba)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x9f520d){super(_0x9f520d),_0x9f520d['config']['get']('ai.aws.requestParameters')||_0x9f520d['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']=_0x9f520d['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x9f520d['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x9f520d['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x9f520d['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x23d6b7,context:_0x4556f2,onData:_0x45965d,actionId:_0x43b89b}){const {model:_0x5994df,stream:_0x317b05,..._0x34adef}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x43b89b),_0x2a6ef8={'prompt':await this['preparePrompt'](_0x23d6b7,_0x4556f2,_0x5994df,_0x43b89b),..._0x34adef};this['_apiUrl']?await this['_processProxyRequest'](_0x2a6ef8,_0x5994df,_0x317b05,_0x45965d,_0x43b89b):await this['_processAWSRequest'](_0x2a6ef8,_0x5994df,_0x317b05,_0x45965d);}async['preparePrompt'](_0x305b18,_0x228dc4,_0xbe60,_0x2bb266){let _0x325362,_0x54a34f;return _0x228dc4?(_0x325362='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.',_0x54a34f='Instruction:\x0a'+_0x305b18+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x228dc4):(_0x325362='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.',_0x54a34f=_0x305b18),'meta.llama'==this['getModelFamily'](_0xbe60)?'<<SYS>>\x0a'+_0x325362+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x54a34f+'\x0a[/INST]':'Human:\x0a'+_0x325362+'\x0a'+_0x54a34f+'\x0a\x0aAssistant:';}['getModelFamily'](_0x4e1ac0){if(/^anthropic\.claude/['test'](_0x4e1ac0))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x4e1ac0))return'ai21.j2';if(/^cohere\.command/['test'](_0x4e1ac0))return'cohere.command';if(/^meta\.llama/['test'](_0x4e1ac0))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x4e1ac0));}async['_processProxyRequest'](_0x5b9771,_0x4f72c0,_0x4724f7,_0x41d7a2,_0x2a33ab){const _0x36ac70={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2a33ab),'body':JSON['stringify']({..._0x5b9771,'model':_0x4f72c0,'stream':_0x4724f7}),'signal':this['abortController']['signal']},_0x17789c=await fetch(this['_apiUrl'],_0x36ac70);_0x4724f7?await this['_readStreamableResponse'](_0x17789c,_0x4f72c0,_0x41d7a2):await this['_readStaticResponse'](_0x17789c,_0x4f72c0,_0x41d7a2);}async['_processAWSRequest'](_0x147a6a,_0x549b11,_0x14c5b7,_0xb0617c){const _0xdb6e3c=new _0x46e7ee(this['_bedrockClientConfig']),_0x513115={'body':JSON['stringify'](_0x147a6a),'contentType':'application/json','accept':'application/json','modelId':_0x549b11};let _0x5d4693;if(_0x14c5b7){const _0x19a6c7=new _0x1be286(_0x513115);_0x5d4693=await _0xdb6e3c['send'](_0x19a6c7,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x5d4693,_0x549b11,_0xb0617c);}else{const _0x27adf0=new _0x71c2(_0x513115);_0x5d4693=await _0xdb6e3c['send'](_0x27adf0,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x5d4693,_0x549b11,_0xb0617c);}}async['_readAsyncIterableResponse'](_0x3fc3a3,_0x153682,_0x533ae2){const _0x303d56=_0x3fc3a3['body'],_0x3e2d4a=new TextDecoder('utf-8');let _0x4ef8e8='';for await(const _0x79c51b of _0x303d56)if(_0x79c51b['chunk']){const _0x3c9e1f=_0x3e2d4a['decode'](_0x79c51b['chunk']['bytes']),_0x2fb8aa=JSON['parse'](_0x3c9e1f);_0x4ef8e8+=this['_getGeneratedText'](_0x2fb8aa,_0x153682),_0x533ae2(_0x4ef8e8);}return Promise['resolve']();}async['_readStreamableResponse'](_0x2adb23,_0x408117,_0x27d53d){const _0x22779d=_0x2adb23['body'],_0x4c7be4=new TextDecoder('utf-8'),_0x215cc1=_0x22779d['getReader']();let _0x12fc30='',_0x2b0b75='',_0x43f728=!0x1;for(;!_0x43f728;){const {done:_0x33d212,value:_0xe7108e}=await _0x215cc1['read']();if(_0x43f728=_0x33d212,_0x43f728)break;const _0x1319b2=(_0x12fc30+_0x4c7be4['decode'](_0xe7108e))['split']('\x0a')['map'](_0x1b9681=>{try{return _0x12fc30='',JSON['parse'](_0x1b9681);}catch(_0x3f4974){return _0x12fc30=_0x1b9681,null;}})['filter'](_0x5b22a9=>null!==_0x5b22a9);_0x1319b2['length']&&(_0x2b0b75+=_0x1319b2['map'](_0x1dabd2=>this['_getGeneratedText'](_0x1dabd2,_0x408117))['join'](''),_0x27d53d(_0x2b0b75));}return Promise['resolve']();}async['_readStaticResponse'](_0x35fd85,_0x5cab9d,_0x4522d2){let _0xa55166;return _0xa55166=_0x35fd85 instanceof Response?await _0x35fd85['json']():JSON['parse'](Buffer['from'](_0x35fd85['body'])['toString']('utf8')),(_0x4522d2(this['_getGeneratedText'](_0xa55166,_0x5cab9d)),Promise['resolve']());}['_getGeneratedText'](_0x45ab8c,_0x14f679){switch(this['getModelFamily'](_0x14f679)){case'anthropic.claude':return _0x45ab8c['completion'];case'ai21.j2':return _0x45ab8c['completions'][0x0]['data']['text'];case'cohere.command':return _0x45ab8c['generations'][0x0]['text'];case'meta.llama':return _0x45ab8c['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x40ccbb=>0x1!=_0x40ccbb}};
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':_0x726346=>0x1!=_0x726346}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x450d46=>{const {af:{dictionary:_0x312283,getPluralForm:_0x3b59b9}}={'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':_0x257d6a=>0x1!=_0x257d6a}};_0x450d46['af']||={'dictionary':{},'getPluralForm':null},_0x450d46['af']['dictionary']=Object['assign'](_0x450d46['af']['dictionary'],_0x312283),_0x450d46['af']['getPluralForm']=_0x3b59b9;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x432297=>{const {af:{dictionary:_0x18158a,getPluralForm:_0xbe927b}}={'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':_0x5b7387=>0x1!=_0x5b7387}};_0x432297['af']||={'dictionary':{},'getPluralForm':null},_0x432297['af']['dictionary']=Object['assign'](_0x432297['af']['dictionary'],_0x18158a),_0x432297['af']['getPluralForm']=_0xbe927b;})(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':_0x5b5341=>0x0==_0x5b5341?0x0:0x1==_0x5b5341?0x1:0x2==_0x5b5341?0x2:_0x5b5341%0x64>=0x3&&_0x5b5341%0x64<=0xa?0x3:_0x5b5341%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':_0x498c91=>0x0==_0x498c91?0x0:0x1==_0x498c91?0x1:0x2==_0x498c91?0x2:_0x498c91%0x64>=0x3&&_0x498c91%0x64<=0xa?0x3:_0x498c91%0x64>=0xb?0x4:0x5}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x6f8d07=>{const {ar:{dictionary:_0x5741b3,getPluralForm:_0x507444}}={'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':_0x132559=>0x0==_0x132559?0x0:0x1==_0x132559?0x1:0x2==_0x132559?0x2:_0x132559%0x64>=0x3&&_0x132559%0x64<=0xa?0x3:_0x132559%0x64>=0xb?0x4:0x5}};_0x6f8d07['ar']||={'dictionary':{},'getPluralForm':null},_0x6f8d07['ar']['dictionary']=Object['assign'](_0x6f8d07['ar']['dictionary'],_0x5741b3),_0x6f8d07['ar']['getPluralForm']=_0x507444;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x570483=>{const {ar:{dictionary:_0x2e7de6,getPluralForm:_0x3c1a45}}={'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':_0x5f4568=>0x0==_0x5f4568?0x0:0x1==_0x5f4568?0x1:0x2==_0x5f4568?0x2:_0x5f4568%0x64>=0x3&&_0x5f4568%0x64<=0xa?0x3:_0x5f4568%0x64>=0xb?0x4:0x5}};_0x570483['ar']||={'dictionary':{},'getPluralForm':null},_0x570483['ar']['dictionary']=Object['assign'](_0x570483['ar']['dictionary'],_0x2e7de6),_0x570483['ar']['getPluralForm']=_0x3c1a45;})(window['CKEDITOR_TRANSLATIONS']||={});