iobroker.javascript 9.3.0 → 10.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 (220) hide show
  1. package/README.md +8 -9
  2. package/admin/assets/AiChatPanel-p0KAg6Cs.js +237 -0
  3. package/admin/assets/AiDatapointProvider-DzFpUKkT.js +2 -0
  4. package/admin/assets/AiDiffView-BPTLnNx1.js +1 -0
  5. package/admin/assets/AiInlineProvider-CaHd2G2Q.js +5 -0
  6. package/admin/assets/AiScriptAnalyzer--BHML2rN.js +9 -0
  7. package/admin/assets/BlocklyEditor-CAjVMhYT.js +81 -0
  8. package/admin/assets/ContextWrapper-BVc8wTK_.css +1 -0
  9. package/admin/assets/ContextWrapper-D9CrnNKs.js +127 -0
  10. package/admin/assets/Debugger-SjROokFI.js +15 -0
  11. package/admin/assets/Error-DDfrxAt2.js +1 -0
  12. package/admin/assets/Import-DpTg1Jow.js +1 -0
  13. package/admin/assets/RulesEditor-BSRFWpEm.css +1 -0
  14. package/admin/assets/RulesEditor-D0hgrcBc.js +1 -0
  15. package/admin/assets/ScriptEditor-BGIuoNei.js +2 -0
  16. package/admin/assets/ScriptEditorVanillaMonaco-DyMQtoTQ.js +3 -0
  17. package/admin/assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-DWJotR1B.js +1 -0
  18. package/admin/assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-CxICLr5Z.js +1243 -0
  19. package/admin/assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-BBAXJaqI.js +9 -0
  20. package/admin/assets/aiCodeLensProvider-hyAmut0e.js +4 -0
  21. package/admin/assets/aiPromptBuilder-Bs27qOHT.js +7 -0
  22. package/admin/assets/applyCodeEdit-D3nb7erO.js +1 -0
  23. package/admin/assets/blocklyDarkTheme-DEiAX5DT.js +1 -0
  24. package/admin/assets/cronHoverProvider-pKJkSevo.js +2 -0
  25. package/admin/assets/dist-uw5orDgd.js +4 -0
  26. package/admin/assets/{docs-compact-CKNGiYh2.js → docs-compact-D7rpMc7r.js} +2 -2
  27. package/admin/assets/hostInit-BFg5u9hY.js +1 -0
  28. package/admin/assets/index-B1gICjdq.js +192 -0
  29. package/admin/assets/index-BHhhebRG.css +1 -0
  30. package/admin/assets/inlineChatWidget-ZaisTOLh.js +2 -0
  31. package/admin/assets/inlineDiffController-hTwHHqcc.js +16 -0
  32. package/admin/assets/mf-entry-bootstrap-0-d6052b31.js +36 -0
  33. package/admin/assets/mjs-DWqivHEk.js +90 -0
  34. package/admin/assets/rolldown-runtime-C0FnF6B9.js +1 -0
  35. package/admin/assets/stateHoverProvider-C7DawIs-.js +9 -0
  36. package/admin/assets/virtualExposes-Ed0lGq7k.js +1 -0
  37. package/admin/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BYs71IQF.js +1 -0
  38. package/admin/assets/virtual_mf-exposes___mfe_internal__iobroker_javascript__remoteEntry_js-DnnXQRkG.js +1 -0
  39. package/admin/assets/vite-preload-helper-B7qeedMF.js +1 -0
  40. package/admin/custom/assets/Components-BrDyDHXh.js +1 -0
  41. package/admin/custom/assets/Components-DftM8alF.css +1 -0
  42. package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1-CyYJM2-v.js +1 -0
  43. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-BdzCssLn.js +1 -0
  44. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_styled__loadShare__.js-CGb5Cofy.js +1 -0
  45. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-BVCIAgbo.js +1243 -0
  46. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-BkB0anQX.js +1494 -0
  47. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare__leaflet__loadShare__.js-h-rCw3iz.js +1 -0
  48. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-BotqDuw-.js +9 -0
  49. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__prebuild__date_mf_2_fns__prebuild__-Cb5TR7FB.js +1 -0
  50. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__prebuild__leaflet__prebuild__-DARUoA03.js +1 -0
  51. package/admin/custom/assets/hostInit-DJx2uXXy.js +1 -0
  52. package/admin/custom/assets/index-uEKAoVT7.js +1 -0
  53. package/admin/custom/assets/lib-Yj8cfN0A.js +3 -0
  54. package/admin/custom/assets/mf-entry-bootstrap-0-77793feb.js +36 -0
  55. package/admin/custom/assets/rolldown-runtime-BcKkbAw3.js +1 -0
  56. package/admin/custom/assets/setYear-DJ9FbdkO.js +1 -0
  57. package/admin/custom/assets/virtualExposes-CxDjLoYu.js +1 -0
  58. package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-BU-ugy_7.js +1 -0
  59. package/admin/custom/assets/virtual_mf-exposes-ssr___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-BEfZbrf7.js +2 -0
  60. package/admin/custom/assets/virtual_mf-exposes___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-CTeZ0Jpm.js +2 -0
  61. package/admin/custom/assets/vite-preload-helper-B7qeedMF.js +1 -0
  62. package/admin/custom/customComponents.js +1 -1
  63. package/admin/jsonConfig.json +1 -1
  64. package/admin/mf-manifest.json +1 -1
  65. package/admin/mf-stats.json +1 -0
  66. package/admin/remoteEntry.js +1 -1
  67. package/admin/tab.html +12 -17
  68. package/build/lib/debugger.js +1 -1
  69. package/build/lib/debugger.js.map +1 -1
  70. package/build/lib/eventObj.js.map +1 -1
  71. package/build/lib/inspect.js.map +1 -1
  72. package/build/lib/javascript.d.ts +18 -19
  73. package/build/lib/nodeModulesManagement.js +3 -1
  74. package/build/lib/nodeModulesManagement.js.map +1 -1
  75. package/build/lib/protectFs.js.map +1 -1
  76. package/build/lib/sandbox.js +104 -43
  77. package/build/lib/sandbox.js.map +1 -1
  78. package/build/lib/scheduler.js.map +1 -1
  79. package/build/lib/tools.js +1 -1
  80. package/build/lib/tools.js.map +1 -1
  81. package/build/lib/typescriptSettings.js +16 -10
  82. package/build/lib/typescriptSettings.js.map +1 -1
  83. package/build/lib/typescriptTools.js +2 -2
  84. package/build/lib/typescriptTools.js.map +1 -1
  85. package/build/main.js +41 -29
  86. package/build/main.js.map +1 -1
  87. package/build/src/lib/aiProviderResolver.js +107 -0
  88. package/build/src/lib/aiProviderResolver.js.map +1 -0
  89. package/build/src/lib/anthropicAdapter.js +175 -0
  90. package/build/src/lib/anthropicAdapter.js.map +1 -0
  91. package/build/src/lib/consts.js +346 -0
  92. package/build/src/lib/consts.js.map +1 -0
  93. package/build/src/lib/convert.js +121 -0
  94. package/build/src/lib/convert.js.map +1 -0
  95. package/build/src/lib/crypto.js +32 -0
  96. package/build/src/lib/crypto.js.map +1 -0
  97. package/build/src/lib/debug.js +163 -0
  98. package/build/src/lib/debug.js.map +1 -0
  99. package/build/src/lib/debugger.js +1135 -0
  100. package/build/src/lib/debugger.js.map +1 -0
  101. package/build/src/lib/eventObj.js +194 -0
  102. package/build/src/lib/eventObj.js.map +1 -0
  103. package/build/src/lib/inspect.js +728 -0
  104. package/build/src/lib/inspect.js.map +1 -0
  105. package/build/src/lib/mirror.js +634 -0
  106. package/build/src/lib/mirror.js.map +1 -0
  107. package/build/src/lib/nodeModulesManagement.js +26 -0
  108. package/build/src/lib/nodeModulesManagement.js.map +1 -0
  109. package/build/src/lib/patternCompareFunctions.js +293 -0
  110. package/build/src/lib/patternCompareFunctions.js.map +1 -0
  111. package/build/src/lib/protectFs.js +554 -0
  112. package/build/src/lib/protectFs.js.map +1 -0
  113. package/build/src/lib/sandbox.js +4897 -0
  114. package/build/src/lib/sandbox.js.map +1 -0
  115. package/build/src/lib/scheduler.js +555 -0
  116. package/build/src/lib/scheduler.js.map +1 -0
  117. package/build/src/lib/tools.js +188 -0
  118. package/build/src/lib/tools.js.map +1 -0
  119. package/build/src/lib/typescriptSettings.js +39 -0
  120. package/build/src/lib/typescriptSettings.js.map +1 -0
  121. package/build/src/lib/typescriptTools.js +435 -0
  122. package/build/src/lib/typescriptTools.js.map +1 -0
  123. package/build/src/lib/utils.js +66 -0
  124. package/build/src/lib/utils.js.map +1 -0
  125. package/build/src/lib/words.js +76 -0
  126. package/build/src/lib/words.js.map +1 -0
  127. package/build/src/main.js +3414 -0
  128. package/build/src/main.js.map +1 -0
  129. package/build/types.d.ts +6 -14
  130. package/io-package.json +28 -28
  131. package/package.json +16 -17
  132. package/admin/assets/AiChatPanel-BvND3KNP.js +0 -317
  133. package/admin/assets/AiDatapointProvider-B0i3I5Fm.js +0 -2
  134. package/admin/assets/AiDiffView-RPozjjHf.js +0 -1
  135. package/admin/assets/AiInlineProvider-DkgjVSFQ.js +0 -7
  136. package/admin/assets/Save-CkuNSiWL.js +0 -1
  137. package/admin/assets/ScriptEditor-1BwI9a_X.js +0 -2
  138. package/admin/assets/ScriptEditorVanillaMonaco-BPK75VNu.js +0 -3
  139. package/admin/assets/applyCodeEdit-BdRnbz2g.js +0 -1
  140. package/admin/assets/createSvgIcon-DYs_tNrE.js +0 -8
  141. package/admin/assets/cronHoverProvider-Bg0Vz-1E.js +0 -2
  142. package/admin/assets/hostInit-LzITLWDa.js +0 -1
  143. package/admin/assets/index-45IwpC7_.js +0 -1
  144. package/admin/assets/index-BCK6q-N6.css +0 -1
  145. package/admin/assets/index-BTsjunTt.css +0 -1
  146. package/admin/assets/index-Be9Zg6aF.js +0 -990
  147. package/admin/assets/index-BkyLyaYT.js +0 -8
  148. package/admin/assets/index-CVZSzCXy.js +0 -1
  149. package/admin/assets/index-CxRhXAwi.js +0 -1267
  150. package/admin/assets/index-DUMiVB6k.js +0 -16
  151. package/admin/assets/index-Dsh1HfIY.js +0 -1
  152. package/admin/assets/index-dN73sbyQ.js +0 -193
  153. package/admin/assets/index-fS-54-pB.js +0 -1
  154. package/admin/assets/index-wHNMOf-c.js +0 -5
  155. package/admin/assets/inheritsLoose-CIXm_zPk.js +0 -29
  156. package/admin/assets/inlineChatWidget-Cu6rb4Ar.js +0 -2
  157. package/admin/assets/inlineDiffController-DBLpPOe2.js +0 -16
  158. package/admin/assets/iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js +0 -1
  159. package/admin/assets/iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-CV1_X-Lf.js +0 -1
  160. package/admin/assets/iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js +0 -1
  161. package/admin/assets/iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js +0 -1
  162. package/admin/assets/iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js +0 -1
  163. package/admin/assets/iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js +0 -1
  164. package/admin/assets/iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js +0 -1
  165. package/admin/assets/localSharedImportMap-Cs4ibnCv.js +0 -1
  166. package/admin/assets/preload-helper-BDBacUwf.js +0 -1
  167. package/admin/assets/stateHoverProvider-dvzAyUDH.js +0 -9
  168. package/admin/assets/useTheme-DuTJsNQ-.js +0 -1
  169. package/admin/assets/virtualExposes-BPsCufin.js +0 -1
  170. package/admin/assets/virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-Dus28I2g.js +0 -8
  171. package/admin/custom/assets/Components-BOms95_F.css +0 -1
  172. package/admin/custom/assets/Components-CGiJE5Zh.js +0 -1
  173. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_emotion_mf_1_react__loadShare__.mjs-sg07E3QA.js +0 -1
  174. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_emotion_mf_1_styled__loadShare__.mjs-CwjI4A-J.js +0 -1
  175. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-B7D2xOvV.js +0 -1
  176. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.mjs-ClsgYnEX.js +0 -1
  177. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__.mjs-B551AMx-.js +0 -1
  178. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-KsT5vKjV.js +0 -1
  179. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_x_mf_2_date_mf_2_pickers__loadShare__.mjs-DgHZUNxn.js +0 -1
  180. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__leaflet__loadShare__.mjs-BYONkEgA.js +0 -1
  181. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-BW9Qbxx5.js +0 -1
  182. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-2W2BYT2K.js +0 -1
  183. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs-CL--xmjC.js +0 -1
  184. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-D8zcZsJo.js +0 -1
  185. package/admin/custom/assets/DefaultPropsProvider-CfKHPa-G.js +0 -1
  186. package/admin/custom/assets/TextField-CxPfV5Sr.js +0 -139
  187. package/admin/custom/assets/ThemeProvider-DSTCckLJ.js +0 -29
  188. package/admin/custom/assets/blue-CagzI6CQ.js +0 -1
  189. package/admin/custom/assets/createSvgIcon-b2B2NI3g.js +0 -1
  190. package/admin/custom/assets/createTheme-MsdB8zt7.js +0 -8
  191. package/admin/custom/assets/defaultTheme-CmVP-QNF.js +0 -1
  192. package/admin/custom/assets/emotion-cache.browser.esm-BgJfNZJN.js +0 -1
  193. package/admin/custom/assets/emotion-react.browser.esm-chZAeh_-.js +0 -1
  194. package/admin/custom/assets/emotion-serialize.esm-BUa21YfQ.js +0 -1
  195. package/admin/custom/assets/emotion-styled.browser.esm-Yi13plpH.js +0 -1
  196. package/admin/custom/assets/emotion-use-insertion-effect-with-fallbacks.browser.esm-CEPeBbh9.js +0 -1
  197. package/admin/custom/assets/extends-CF3RwP-h.js +0 -1
  198. package/admin/custom/assets/hostInit-iUL-wyj1.js +0 -1
  199. package/admin/custom/assets/index-17vbGv00.js +0 -1
  200. package/admin/custom/assets/index-B5DqCD_a.js +0 -1
  201. package/admin/custom/assets/index-BVOepGI5.js +0 -1
  202. package/admin/custom/assets/index-Bvwv5H7k.js +0 -1
  203. package/admin/custom/assets/index-C8_qJ4Y6.js +0 -1523
  204. package/admin/custom/assets/index-CzRngQHl.js +0 -31
  205. package/admin/custom/assets/index-DLNtxshy.js +0 -1
  206. package/admin/custom/assets/index-DSGXVHGh.js +0 -964
  207. package/admin/custom/assets/index-DV76KW3-.js +0 -7
  208. package/admin/custom/assets/index-D_5kZmfw.js +0 -1
  209. package/admin/custom/assets/index-DlQbqHom.js +0 -8
  210. package/admin/custom/assets/index-DpJ18x6R.js +0 -1
  211. package/admin/custom/assets/index-FTmk0JJx.js +0 -55
  212. package/admin/custom/assets/isSameWeek-DDsSIa_t.js +0 -1
  213. package/admin/custom/assets/jsx-runtime-BplTyRFk.js +0 -1
  214. package/admin/custom/assets/leaflet-src-B472P7Y1.js +0 -1
  215. package/admin/custom/assets/localSharedImportMap-C-8wOKN2.js +0 -1
  216. package/admin/custom/assets/preload-helper-BDBacUwf.js +0 -1
  217. package/admin/custom/assets/useTheme-BV4xOYIL.js +0 -1
  218. package/admin/custom/assets/useTheme-ldICnlmf.js +0 -1
  219. package/admin/custom/assets/virtualExposes-D402kVGY.js +0 -2
  220. package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-CO2hfDx_.js +0 -8
@@ -1,1523 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-B5DqCD_a.js","./index-D_5kZmfw.js","./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-2W2BYT2K.js","./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-BW9Qbxx5.js"])))=>i.map(i=>d[i]);
2
- import{i as xo,h as $,f as Yl,a as Ql,p as Xl}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-BW9Qbxx5.js";import{c as Ge,r as Ws}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-2W2BYT2K.js";function Zl(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var t=function r(){var o=!1;try{o=this instanceof r}catch{}return o?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};t.prototype=n.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),t}function ql(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{G as ze,p as ve,F as In,i as Pn,M as yt,z as me,r as se,W as js,X as Hs,s as Ie,Y as zs,g as ge,Z as Wi,b as pe,$ as vn,h as Tt,c as fe,d as _e,e as Ne,f as $e,_ as Xn,a as Zt,a0 as _o,Q as On,T as ko,S as ct,R as Ee,V as Fn,k as Lt,l as yn,m as Kt,n as ec,o as Gt,a1 as tc,a2 as nc,D as ic,a3 as Vs,j as Li,E as ji,A as To,B as Us,x as sc,y as rc,a4 as oc,a5 as ac,N as lc,a6 as Lo,a7 as Mo,I as cc,U as hc,a8 as ls,a9 as uc,aa as pc,t as dc,v as fc,w as gc}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-KsT5vKjV.js";import{a7 as zn,W as Jt,k as Mi,aj as mc,ak as Io,al as vc,am as Oo,an as yc,J as bc,S as Vn,u as Fo,ao as Ro,ap as No,c as _t,E as Ks,R as Un,aq as Bo,M as Po,_ as wc,ar as Cc,as as Sc,at as Ec,au as Ac,af as Ii,av as Ai,aw as Di,n as fn,b as Gs,a as ht,ax as Dc,ay as $c,az as xc,q as _c,aA as Wo,w as jo,r as Ho,aB as Js,d as kc,aC as Tc,aD as Lc,a8 as zo,aE as Mc,aF as Ic,aG as Oc,aH as Fc,aI as Rc,aJ as Nc,aK as Bc,aL as Pc,aM as Wc,V as jc,aN as Hc,j as zc,X as Vc,aO as Uc,aP as Kc,aQ as Gc,aR as Jc,G as Br}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__.mjs-B551AMx-.js";import{_ as P,A as Yc}from"./ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-B7D2xOvV.js";import{R as Qc}from"./ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs-CL--xmjC.js";import{b as Xc}from"./blue-CagzI6CQ.js";import{C as Zc,D as Vo}from"./index-CzRngQHl.js";import{d as _s}from"./virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-CO2hfDx_.js";import{b as qc,a as eh}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_x_mf_2_date_mf_2_pickers__loadShare__.mjs-DgHZUNxn.js";import{p as Ys}from"./index-D_5kZmfw.js";import{_ as Uo}from"./preload-helper-BDBacUwf.js";const th=Object.freeze(Object.defineProperty({__proto__:null,get ConfigGeneric(){return V},get ConfigPanel(){return tn},get JsonConfig(){return Ff},get JsonConfigComponent(){return Ti}},Symbol.toStringTag,{value:"Module"}));var nh=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ih=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,sh=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,cs={Space_Separator:nh,ID_Start:ih,ID_Continue:sh},ke={isSpaceSeparator(m){return typeof m=="string"&&cs.Space_Separator.test(m)},isIdStartChar(m){return typeof m=="string"&&(m>="a"&&m<="z"||m>="A"&&m<="Z"||m==="$"||m==="_"||cs.ID_Start.test(m))},isIdContinueChar(m){return typeof m=="string"&&(m>="a"&&m<="z"||m>="A"&&m<="Z"||m>="0"&&m<="9"||m==="$"||m==="_"||m==="‌"||m==="‍"||cs.ID_Continue.test(m))},isDigit(m){return typeof m=="string"&&/[0-9]/.test(m)},isHexDigit(m){return typeof m=="string"&&/[0-9A-Fa-f]/.test(m)}};let ks,je,mt,Oi,Mt,rt,Re,Qs,Wn;var rh=function(e,t){ks=String(e),je="start",mt=[],Oi=0,Mt=1,rt=0,Re=void 0,Qs=void 0,Wn=void 0;do Re=oh(),ch[je]();while(Re.type!=="eof");return typeof t=="function"?Ts({"":Wn},"",t):Wn};function Ts(m,e,t){const n=m[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let h=0;h<n.length;h++){const i=String(h),s=Ts(n,i,t);s===void 0?delete n[i]:Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0})}else for(const h in n){const i=Ts(n,h,t);i===void 0?delete n[h]:Object.defineProperty(n,h,{value:i,writable:!0,enumerable:!0,configurable:!0})}return t.call(m,e,n)}let ce,oe,Rn,gt,he;function oh(){for(ce="default",oe="",Rn=!1,gt=1;;){he=bt();const m=Ko[ce]();if(m)return m}}function bt(){if(ks[Oi])return String.fromCodePoint(ks.codePointAt(Oi))}function Q(){const m=bt();return m===`
3
- `?(Mt++,rt=0):m?rt+=m.length:rt++,m&&(Oi+=m.length),m}const Ko={default(){switch(he){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
4
- `:case"\r":case"\u2028":case"\u2029":Q();return;case"/":Q(),ce="comment";return;case void 0:return Q(),we("eof")}if(ke.isSpaceSeparator(he)){Q();return}return Ko[je]()},comment(){switch(he){case"*":Q(),ce="multiLineComment";return;case"/":Q(),ce="singleLineComment";return}throw Ce(Q())},multiLineComment(){switch(he){case"*":Q(),ce="multiLineCommentAsterisk";return;case void 0:throw Ce(Q())}Q()},multiLineCommentAsterisk(){switch(he){case"*":Q();return;case"/":Q(),ce="default";return;case void 0:throw Ce(Q())}Q(),ce="multiLineComment"},singleLineComment(){switch(he){case`
5
- `:case"\r":case"\u2028":case"\u2029":Q(),ce="default";return;case void 0:return Q(),we("eof")}Q()},value(){switch(he){case"{":case"[":return we("punctuator",Q());case"n":return Q(),Pt("ull"),we("null",null);case"t":return Q(),Pt("rue"),we("boolean",!0);case"f":return Q(),Pt("alse"),we("boolean",!1);case"-":case"+":Q()==="-"&&(gt=-1),ce="sign";return;case".":oe=Q(),ce="decimalPointLeading";return;case"0":oe=Q(),ce="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":oe=Q(),ce="decimalInteger";return;case"I":return Q(),Pt("nfinity"),we("numeric",1/0);case"N":return Q(),Pt("aN"),we("numeric",NaN);case'"':case"'":Rn=Q()==='"',oe="",ce="string";return}throw Ce(Q())},identifierNameStartEscape(){if(he!=="u")throw Ce(Q());Q();const m=Ls();switch(m){case"$":case"_":break;default:if(!ke.isIdStartChar(m))throw Pr();break}oe+=m,ce="identifierName"},identifierName(){switch(he){case"$":case"_":case"‌":case"‍":oe+=Q();return;case"\\":Q(),ce="identifierNameEscape";return}if(ke.isIdContinueChar(he)){oe+=Q();return}return we("identifier",oe)},identifierNameEscape(){if(he!=="u")throw Ce(Q());Q();const m=Ls();switch(m){case"$":case"_":case"‌":case"‍":break;default:if(!ke.isIdContinueChar(m))throw Pr();break}oe+=m,ce="identifierName"},sign(){switch(he){case".":oe=Q(),ce="decimalPointLeading";return;case"0":oe=Q(),ce="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":oe=Q(),ce="decimalInteger";return;case"I":return Q(),Pt("nfinity"),we("numeric",gt*(1/0));case"N":return Q(),Pt("aN"),we("numeric",NaN)}throw Ce(Q())},zero(){switch(he){case".":oe+=Q(),ce="decimalPoint";return;case"e":case"E":oe+=Q(),ce="decimalExponent";return;case"x":case"X":oe+=Q(),ce="hexadecimal";return}return we("numeric",gt*0)},decimalInteger(){switch(he){case".":oe+=Q(),ce="decimalPoint";return;case"e":case"E":oe+=Q(),ce="decimalExponent";return}if(ke.isDigit(he)){oe+=Q();return}return we("numeric",gt*Number(oe))},decimalPointLeading(){if(ke.isDigit(he)){oe+=Q(),ce="decimalFraction";return}throw Ce(Q())},decimalPoint(){switch(he){case"e":case"E":oe+=Q(),ce="decimalExponent";return}if(ke.isDigit(he)){oe+=Q(),ce="decimalFraction";return}return we("numeric",gt*Number(oe))},decimalFraction(){switch(he){case"e":case"E":oe+=Q(),ce="decimalExponent";return}if(ke.isDigit(he)){oe+=Q();return}return we("numeric",gt*Number(oe))},decimalExponent(){switch(he){case"+":case"-":oe+=Q(),ce="decimalExponentSign";return}if(ke.isDigit(he)){oe+=Q(),ce="decimalExponentInteger";return}throw Ce(Q())},decimalExponentSign(){if(ke.isDigit(he)){oe+=Q(),ce="decimalExponentInteger";return}throw Ce(Q())},decimalExponentInteger(){if(ke.isDigit(he)){oe+=Q();return}return we("numeric",gt*Number(oe))},hexadecimal(){if(ke.isHexDigit(he)){oe+=Q(),ce="hexadecimalInteger";return}throw Ce(Q())},hexadecimalInteger(){if(ke.isHexDigit(he)){oe+=Q();return}return we("numeric",gt*Number(oe))},string(){switch(he){case"\\":Q(),oe+=ah();return;case'"':if(Rn)return Q(),we("string",oe);oe+=Q();return;case"'":if(!Rn)return Q(),we("string",oe);oe+=Q();return;case`
6
- `:case"\r":throw Ce(Q());case"\u2028":case"\u2029":hh(he);break;case void 0:throw Ce(Q())}oe+=Q()},start(){switch(he){case"{":case"[":return we("punctuator",Q())}ce="value"},beforePropertyName(){switch(he){case"$":case"_":oe=Q(),ce="identifierName";return;case"\\":Q(),ce="identifierNameStartEscape";return;case"}":return we("punctuator",Q());case'"':case"'":Rn=Q()==='"',ce="string";return}if(ke.isIdStartChar(he)){oe+=Q(),ce="identifierName";return}throw Ce(Q())},afterPropertyName(){if(he===":")return we("punctuator",Q());throw Ce(Q())},beforePropertyValue(){ce="value"},afterPropertyValue(){switch(he){case",":case"}":return we("punctuator",Q())}throw Ce(Q())},beforeArrayValue(){if(he==="]")return we("punctuator",Q());ce="value"},afterArrayValue(){switch(he){case",":case"]":return we("punctuator",Q())}throw Ce(Q())},end(){throw Ce(Q())}};function we(m,e){return{type:m,value:e,line:Mt,column:rt}}function Pt(m){for(const e of m){if(bt()!==e)throw Ce(Q());Q()}}function ah(){switch(bt()){case"b":return Q(),"\b";case"f":return Q(),"\f";case"n":return Q(),`
7
- `;case"r":return Q(),"\r";case"t":return Q()," ";case"v":return Q(),"\v";case"0":if(Q(),ke.isDigit(bt()))throw Ce(Q());return"\0";case"x":return Q(),lh();case"u":return Q(),Ls();case`
8
- `:case"\u2028":case"\u2029":return Q(),"";case"\r":return Q(),bt()===`
9
- `&&Q(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Ce(Q());case void 0:throw Ce(Q())}return Q()}function lh(){let m="",e=bt();if(!ke.isHexDigit(e)||(m+=Q(),e=bt(),!ke.isHexDigit(e)))throw Ce(Q());return m+=Q(),String.fromCodePoint(parseInt(m,16))}function Ls(){let m="",e=4;for(;e-- >0;){const t=bt();if(!ke.isHexDigit(t))throw Ce(Q());m+=Q()}return String.fromCodePoint(parseInt(m,16))}const ch={start(){if(Re.type==="eof")throw Wt();hs()},beforePropertyName(){switch(Re.type){case"identifier":case"string":Qs=Re.value,je="afterPropertyName";return;case"punctuator":ui();return;case"eof":throw Wt()}},afterPropertyName(){if(Re.type==="eof")throw Wt();je="beforePropertyValue"},beforePropertyValue(){if(Re.type==="eof")throw Wt();hs()},beforeArrayValue(){if(Re.type==="eof")throw Wt();if(Re.type==="punctuator"&&Re.value==="]"){ui();return}hs()},afterPropertyValue(){if(Re.type==="eof")throw Wt();switch(Re.value){case",":je="beforePropertyName";return;case"}":ui()}},afterArrayValue(){if(Re.type==="eof")throw Wt();switch(Re.value){case",":je="beforeArrayValue";return;case"]":ui()}},end(){}};function hs(){let m;switch(Re.type){case"punctuator":switch(Re.value){case"{":m={};break;case"[":m=[];break}break;case"null":case"boolean":case"numeric":case"string":m=Re.value;break}if(Wn===void 0)Wn=m;else{const e=mt[mt.length-1];Array.isArray(e)?e.push(m):Object.defineProperty(e,Qs,{value:m,writable:!0,enumerable:!0,configurable:!0})}if(m!==null&&typeof m=="object")mt.push(m),Array.isArray(m)?je="beforeArrayValue":je="beforePropertyName";else{const e=mt[mt.length-1];e==null?je="end":Array.isArray(e)?je="afterArrayValue":je="afterPropertyValue"}}function ui(){mt.pop();const m=mt[mt.length-1];m==null?je="end":Array.isArray(m)?je="afterArrayValue":je="afterPropertyValue"}function Ce(m){return Fi(m===void 0?`JSON5: invalid end of input at ${Mt}:${rt}`:`JSON5: invalid character '${Go(m)}' at ${Mt}:${rt}`)}function Wt(){return Fi(`JSON5: invalid end of input at ${Mt}:${rt}`)}function Pr(){return rt-=5,Fi(`JSON5: invalid identifier character at ${Mt}:${rt}`)}function hh(m){console.warn(`JSON5: '${Go(m)}' in strings is not valid ECMAScript; consider escaping`)}function Go(m){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[m])return e[m];if(m<" "){const t=m.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return m}function Fi(m){const e=new SyntaxError(m);return e.lineNumber=Mt,e.columnNumber=rt,e}var uh=function(e,t,n){const h=[];let i="",s,d,o="",l;if(t!=null&&typeof t=="object"&&!Array.isArray(t)&&(n=t.space,l=t.quote,t=t.replacer),typeof t=="function")d=t;else if(Array.isArray(t)){s=[];for(const f of t){let g;typeof f=="string"?g=f:(typeof f=="number"||f instanceof String||f instanceof Number)&&(g=String(f)),g!==void 0&&s.indexOf(g)<0&&s.push(g)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>0&&(n=Math.min(10,Math.floor(n)),o=" ".substr(0,n)):typeof n=="string"&&(o=n.substr(0,10)),r("",{"":e});function r(f,g){let v=g[f];switch(v!=null&&(typeof v.toJSON5=="function"?v=v.toJSON5(f):typeof v.toJSON=="function"&&(v=v.toJSON(f))),d&&(v=d.call(g,f,v)),v instanceof Number?v=Number(v):v instanceof String?v=String(v):v instanceof Boolean&&(v=v.valueOf()),v){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof v=="string")return a(v);if(typeof v=="number")return String(v);if(typeof v=="object")return Array.isArray(v)?u(v):c(v)}function a(f){const g={"'":.1,'"':.2},v={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let b="";for(let E=0;E<f.length;E++){const w=f[E];switch(w){case"'":case'"':g[w]++,b+=w;continue;case"\0":if(ke.isDigit(f[E+1])){b+="\\x00";continue}}if(v[w]){b+=v[w];continue}if(w<" "){let y=w.charCodeAt(0).toString(16);b+="\\x"+("00"+y).substring(y.length);continue}b+=w}const D=l||Object.keys(g).reduce((E,w)=>g[E]<g[w]?E:w);return b=b.replace(new RegExp(D,"g"),v[D]),D+b+D}function c(f){if(h.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");h.push(f);let g=i;i=i+o;let v=s||Object.keys(f),b=[];for(const E of v){const w=r(E,f);if(w!==void 0){let y=p(E)+":";o!==""&&(y+=" "),y+=w,b.push(y)}}let D;if(b.length===0)D="{}";else{let E;if(o==="")E=b.join(","),D="{"+E+"}";else{let w=`,
10
- `+i;E=b.join(w),D=`{
11
- `+i+E+`,
12
- `+g+"}"}}return h.pop(),i=g,D}function p(f){if(f.length===0)return a(f);const g=String.fromCodePoint(f.codePointAt(0));if(!ke.isIdStartChar(g))return a(f);for(let v=g.length;v<f.length;v++)if(!ke.isIdContinueChar(String.fromCodePoint(f.codePointAt(v))))return a(f);return f}function u(f){if(h.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");h.push(f);let g=i;i=i+o;let v=[];for(let D=0;D<f.length;D++){const E=r(String(D),f);v.push(E!==void 0?E:"null")}let b;if(v.length===0)b="[]";else if(o==="")b="["+v.join(",")+"]";else{let D=`,
13
- `+i,E=v.join(D);b=`[
14
- `+i+E+`,
15
- `+g+"]"}return h.pop(),i=g,b}};const ph={parse:rh,stringify:uh};var Jo=ph,Xs={exports:{}};function dh(m){throw new Error('Could not dynamically require "'+m+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var $i={exports:{}};const fh={},gh=Object.freeze(Object.defineProperty({__proto__:null,default:fh},Symbol.toStringTag,{value:"Module"})),mh=Zl(gh);var vh=$i.exports,Wr;function yh(){return Wr||(Wr=1,(function(m,e){(function(t,n){m.exports=n()})(vh,function(){var t=t||(function(n,h){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof Ge<"u"&&Ge.crypto&&(i=Ge.crypto),!i&&typeof dh=="function")try{i=mh}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},d=Object.create||(function(){function b(){}return function(D){var E;return b.prototype=D,E=new b,b.prototype=null,E}})(),o={},l=o.lib={},r=l.Base=(function(){return{extend:function(b){var D=d(this);return b&&D.mixIn(b),(!D.hasOwnProperty("init")||this.init===D.init)&&(D.init=function(){D.$super.init.apply(this,arguments)}),D.init.prototype=D,D.$super=this,D},create:function(){var b=this.extend();return b.init.apply(b,arguments),b},init:function(){},mixIn:function(b){for(var D in b)b.hasOwnProperty(D)&&(this[D]=b[D]);b.hasOwnProperty("toString")&&(this.toString=b.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),a=l.WordArray=r.extend({init:function(b,D){b=this.words=b||[],D!=h?this.sigBytes=D:this.sigBytes=b.length*4},toString:function(b){return(b||p).stringify(this)},concat:function(b){var D=this.words,E=b.words,w=this.sigBytes,y=b.sigBytes;if(this.clamp(),w%4)for(var A=0;A<y;A++){var T=E[A>>>2]>>>24-A%4*8&255;D[w+A>>>2]|=T<<24-(w+A)%4*8}else for(var x=0;x<y;x+=4)D[w+x>>>2]=E[x>>>2];return this.sigBytes+=y,this},clamp:function(){var b=this.words,D=this.sigBytes;b[D>>>2]&=4294967295<<32-D%4*8,b.length=n.ceil(D/4)},clone:function(){var b=r.clone.call(this);return b.words=this.words.slice(0),b},random:function(b){for(var D=[],E=0;E<b;E+=4)D.push(s());return new a.init(D,b)}}),c=o.enc={},p=c.Hex={stringify:function(b){for(var D=b.words,E=b.sigBytes,w=[],y=0;y<E;y++){var A=D[y>>>2]>>>24-y%4*8&255;w.push((A>>>4).toString(16)),w.push((A&15).toString(16))}return w.join("")},parse:function(b){for(var D=b.length,E=[],w=0;w<D;w+=2)E[w>>>3]|=parseInt(b.substr(w,2),16)<<24-w%8*4;return new a.init(E,D/2)}},u=c.Latin1={stringify:function(b){for(var D=b.words,E=b.sigBytes,w=[],y=0;y<E;y++){var A=D[y>>>2]>>>24-y%4*8&255;w.push(String.fromCharCode(A))}return w.join("")},parse:function(b){for(var D=b.length,E=[],w=0;w<D;w++)E[w>>>2]|=(b.charCodeAt(w)&255)<<24-w%4*8;return new a.init(E,D)}},f=c.Utf8={stringify:function(b){try{return decodeURIComponent(escape(u.stringify(b)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(b){return u.parse(unescape(encodeURIComponent(b)))}},g=l.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(b){typeof b=="string"&&(b=f.parse(b)),this._data.concat(b),this._nDataBytes+=b.sigBytes},_process:function(b){var D,E=this._data,w=E.words,y=E.sigBytes,A=this.blockSize,T=A*4,x=y/T;b?x=n.ceil(x):x=n.max((x|0)-this._minBufferSize,0);var M=x*A,O=n.min(M*4,y);if(M){for(var _=0;_<M;_+=A)this._doProcessBlock(w,_);D=w.splice(0,M),E.sigBytes-=O}return new a.init(D,O)},clone:function(){var b=r.clone.call(this);return b._data=this._data.clone(),b},_minBufferSize:0});l.Hasher=g.extend({cfg:r.extend(),init:function(b){this.cfg=this.cfg.extend(b),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(b){return this._append(b),this._process(),this},finalize:function(b){b&&this._append(b);var D=this._doFinalize();return D},blockSize:16,_createHelper:function(b){return function(D,E){return new b.init(E).finalize(D)}},_createHmacHelper:function(b){return function(D,E){return new v.HMAC.init(b,E).finalize(D)}}});var v=o.algo={};return o})(Math);return t})})($i)),$i.exports}var bh=Xs.exports;(function(m,e){(function(t,n){m.exports=n(yh())})(bh,function(t){return(function(n){var h=t,i=h.lib,s=i.WordArray,d=i.Hasher,o=h.algo,l=[];(function(){for(var f=0;f<64;f++)l[f]=n.abs(n.sin(f+1))*4294967296|0})();var r=o.MD5=d.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(f,g){for(var v=0;v<16;v++){var b=g+v,D=f[b];f[b]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}var E=this._hash.words,w=f[g+0],y=f[g+1],A=f[g+2],T=f[g+3],x=f[g+4],M=f[g+5],O=f[g+6],_=f[g+7],k=f[g+8],S=f[g+9],C=f[g+10],L=f[g+11],I=f[g+12],F=f[g+13],R=f[g+14],B=f[g+15],N=E[0],z=E[1],W=E[2],j=E[3];N=a(N,z,W,j,w,7,l[0]),j=a(j,N,z,W,y,12,l[1]),W=a(W,j,N,z,A,17,l[2]),z=a(z,W,j,N,T,22,l[3]),N=a(N,z,W,j,x,7,l[4]),j=a(j,N,z,W,M,12,l[5]),W=a(W,j,N,z,O,17,l[6]),z=a(z,W,j,N,_,22,l[7]),N=a(N,z,W,j,k,7,l[8]),j=a(j,N,z,W,S,12,l[9]),W=a(W,j,N,z,C,17,l[10]),z=a(z,W,j,N,L,22,l[11]),N=a(N,z,W,j,I,7,l[12]),j=a(j,N,z,W,F,12,l[13]),W=a(W,j,N,z,R,17,l[14]),z=a(z,W,j,N,B,22,l[15]),N=c(N,z,W,j,y,5,l[16]),j=c(j,N,z,W,O,9,l[17]),W=c(W,j,N,z,L,14,l[18]),z=c(z,W,j,N,w,20,l[19]),N=c(N,z,W,j,M,5,l[20]),j=c(j,N,z,W,C,9,l[21]),W=c(W,j,N,z,B,14,l[22]),z=c(z,W,j,N,x,20,l[23]),N=c(N,z,W,j,S,5,l[24]),j=c(j,N,z,W,R,9,l[25]),W=c(W,j,N,z,T,14,l[26]),z=c(z,W,j,N,k,20,l[27]),N=c(N,z,W,j,F,5,l[28]),j=c(j,N,z,W,A,9,l[29]),W=c(W,j,N,z,_,14,l[30]),z=c(z,W,j,N,I,20,l[31]),N=p(N,z,W,j,M,4,l[32]),j=p(j,N,z,W,k,11,l[33]),W=p(W,j,N,z,L,16,l[34]),z=p(z,W,j,N,R,23,l[35]),N=p(N,z,W,j,y,4,l[36]),j=p(j,N,z,W,x,11,l[37]),W=p(W,j,N,z,_,16,l[38]),z=p(z,W,j,N,C,23,l[39]),N=p(N,z,W,j,F,4,l[40]),j=p(j,N,z,W,w,11,l[41]),W=p(W,j,N,z,T,16,l[42]),z=p(z,W,j,N,O,23,l[43]),N=p(N,z,W,j,S,4,l[44]),j=p(j,N,z,W,I,11,l[45]),W=p(W,j,N,z,B,16,l[46]),z=p(z,W,j,N,A,23,l[47]),N=u(N,z,W,j,w,6,l[48]),j=u(j,N,z,W,_,10,l[49]),W=u(W,j,N,z,R,15,l[50]),z=u(z,W,j,N,M,21,l[51]),N=u(N,z,W,j,I,6,l[52]),j=u(j,N,z,W,T,10,l[53]),W=u(W,j,N,z,C,15,l[54]),z=u(z,W,j,N,y,21,l[55]),N=u(N,z,W,j,k,6,l[56]),j=u(j,N,z,W,B,10,l[57]),W=u(W,j,N,z,O,15,l[58]),z=u(z,W,j,N,F,21,l[59]),N=u(N,z,W,j,x,6,l[60]),j=u(j,N,z,W,L,10,l[61]),W=u(W,j,N,z,A,15,l[62]),z=u(z,W,j,N,S,21,l[63]),E[0]=E[0]+N|0,E[1]=E[1]+z|0,E[2]=E[2]+W|0,E[3]=E[3]+j|0},_doFinalize:function(){var f=this._data,g=f.words,v=this._nDataBytes*8,b=f.sigBytes*8;g[b>>>5]|=128<<24-b%32;var D=n.floor(v/4294967296),E=v;g[(b+64>>>9<<4)+15]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,g[(b+64>>>9<<4)+14]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,f.sigBytes=(g.length+1)*4,this._process();for(var w=this._hash,y=w.words,A=0;A<4;A++){var T=y[A];y[A]=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360}return w},clone:function(){var f=d.clone.call(this);return f._hash=this._hash.clone(),f}});function a(f,g,v,b,D,E,w){var y=f+(g&v|~g&b)+D+w;return(y<<E|y>>>32-E)+g}function c(f,g,v,b,D,E,w){var y=f+(g&b|v&~b)+D+w;return(y<<E|y>>>32-E)+g}function p(f,g,v,b,D,E,w){var y=f+(g^v^b)+D+w;return(y<<E|y>>>32-E)+g}function u(f,g,v,b,D,E,w){var y=f+(v^(g|~b))+D+w;return(y<<E|y>>>32-E)+g}h.MD5=d._createHelper(r),h.HmacMD5=d._createHmacHelper(r)})(Math),t.MD5})})(Xs);var wh=Xs.exports;const jr=ql(wh),Ch=window.innerWidth<=600?12:void 0;function pi(m){return Object.prototype.toString.call(m)==="[object Object]"}class V extends xo{static DIFFERENT_VALUE="__different__";static DIFFERENT_LABEL="ra___different__";static NONE_VALUE="";static NONE_LABEL="ra_none";defaultValue;isError;lang;defaultSendToDone;sendToTimeout;noPlaceRequired;reportedHidden=!1;calculateTimeout=null;AsyncFunction;constructor(e){super(e),this.AsyncFunction=Object.getPrototypeOf(async function(){}).constructor,this.state={confirmDialog:!1,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},this.isError={},this.lang=P.I18n.getLanguage(),e.schema&&(e.custom?e.schema.defaultFunc||(this.defaultValue=e.schema.default):e.schema.type!=="state"&&!e.schema.defaultFunc&&(this.defaultValue=e.schema.default))}async getCachedObject(e){return this.props.oContext.getCachedObject?this.props.oContext.getCachedObject(e):await this.props.oContext.socket.getObject(e)||null}async componentDidMount(){var t,n,h;(t=this.props.schema)!=null&&t.defaultFunc&&(this.props.custom?this.defaultValue=await this.executeCustom(this.props.schema.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):this.props.schema.type!=="state"&&(this.defaultValue=await this.execute(this.props.schema.defaultFunc,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData))),(h=(n=this.props.oContext).registerOnForceUpdate)==null||h.call(n,this.props.attr,this.onUpdate);const e=["select","autocomplete","autocompleteSendTo"];if(this.defaultValue!==void 0){const i=V.getValue(this.props.data,this.props.attr);(i===void 0||e.includes(this.props.schema.type)&&(i===""||i===null))&&setTimeout(()=>{this.props.custom?this.props.onChange(this.props.attr,this.defaultValue,()=>setTimeout(()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data),100)):(V.setValue(this.props.data,this.props.attr,this.defaultValue),this.props.onChange(this.props.data,void 0,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data)))},100)}else this.props.schema.defaultSendTo&&this.sendTo().catch(i=>console.error(i))}async sendTo(){if(this.props.alive){this.defaultSendToDone=!0;let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const n=await this.getPatternAsync(this.props.schema.jsonData,null,!0);try{e=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${n}`)}}else e={attr:this.props.attr,value:V.getValue(this.props.data,this.props.attr)};e===void 0&&(e=null);const t=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(t!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){const n=await this.props.oContext.socket.getState(`system.adapter.${t}.alive`);if(!(n!=null&&n.val)){window.alert(P.I18n.t("ra_Instance %s is not alive",t));return}}this.props.oContext.socket.sendTo(t,this.props.schema.defaultSendTo,e).then(n=>{n!=null&&(this.props.custom?this.props.onChange(this.props.attr,n,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data)):(V.setValue(this.props.data,this.props.attr,n),this.props.onChange(this.props.data,void 0,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data))))})}else this.defaultSendToDone=!1,this.props.schema.allowSaveWithError||this.onError(this.props.attr,P.I18n.t("ra_Instance %s is not alive",this.props.oContext.instance.toString()))}componentWillUnmount(){this.props.oContext.registerOnForceUpdate&&this.props.oContext.registerOnForceUpdate(this.props.attr),this.sendToTimeout&&(clearTimeout(this.sendToTimeout),this.sendToTimeout=null),this.calculateTimeout&&(clearTimeout(this.calculateTimeout),this.calculateTimeout=null)}onUpdate=e=>{const t=V.getValue(e||this.props.data,this.props.attr)||"";this.state.value!==t?this.setState({value:t}):this.forceUpdate()};static getValue(e,t){if(typeof t=="string")return V.getValue(e,t.split("."));if(t.length===1)return e[t[0]];const n=t.shift();if(typeof n=="string"&&typeof e[n]=="object")return V.getValue(e[n],t)}static setValue(e,t,n){if(typeof t=="string"){V.setValue(e,t.split("."),n);return}if(t.length===1)n===null?delete e[t[0]]:e[t[0]]=n;else{const h=t.shift();if(typeof h!="string")return;(!e[h]||typeof e[h]=="object")&&(e[h]=e[h]||{}),V.setValue(e[h],t,n)}}getText(e,t){if(!e)return"";if(typeof e=="string"){const n=t?e:P.I18n.t(e);return n.includes("${")?this.getPattern(n,null,t):n}return pi(e)?e.func?typeof e.func=="object"?this.getPattern(e.func[this.lang]||e.func.en||"",null,!0):this.getPattern(e.func,null,t):e[this.lang]||e.en||"":e.toString()}async getTextAsync(e,t){if(!e)return"";if(typeof e=="string"){const n=t?e:P.I18n.t(e);return n.includes("${")?this.getPatternAsync(n,null,t):n}return pi(e)?e.func?typeof e.func=="object"?this.getPatternAsync(e.func[this.lang]||e.func.en||"",null,!0):this.getPatternAsync(e.func,null,t):e[this.lang]||e.en||"":e.toString()}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const e=this.state.confirmData||this.props.schema.confirm;let t=null;return e.type==="warning"?t=$.createElement(zn,null):e.type==="error"?t=$.createElement(Jt,null):e.type==="info"&&(t=$.createElement(Mi,null)),$.createElement(P.DialogConfirm,{title:this.getText(e.title)||P.I18n.t("ra_Please confirm"),text:this.getText(e.text),ok:this.getText(e.ok)||P.I18n.t("ra_Ok"),cancel:this.getText(e.cancel)||P.I18n.t("ra_Cancel"),icon:t||void 0,onClose:n=>this.setState({confirmDialog:!1},()=>{if(n){if(this.state.confirmCallback){const i=this.state.confirmCallback;this.setState({confirmCallback:null},()=>i(!0));return}const h=JSON.parse(JSON.stringify(this.props.data));this.state.confirmDepAttr&&V.setValue(h,this.state.confirmDepAttr,this.state.confirmDepNewValue),V.setValue(h,this.state.confirmAttr,this.state.confirmNewValue),this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null},()=>this.props.onChange(h))}else{const h=this.state.confirmCallback;this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},()=>{h&&h(!1)})}})})}getIcon(e){e=e||this.props.schema.icon;let t=null;return e==="auth"?t=$.createElement(mc,null):e==="send"?t=$.createElement(Io,null):e==="web"?t=$.createElement(vc,null):e==="warning"?t=$.createElement(zn,null):e==="error"?t=$.createElement(Jt,null):e==="info"?t=$.createElement(Mi,null):e==="search"?t=$.createElement(Oo,null):e==="book"?t=$.createElement(yc,null):e==="help"?t=$.createElement(bc,null):e==="upload"?t=$.createElement(Vn,null):e==="edit"?t=$.createElement(Fo,null):e==="user"?t=$.createElement(Ro,null):e==="group"?t=$.createElement(No,null):e==="delete"?t=$.createElement(_t,null):e==="refresh"?t=$.createElement(Ks,null):e==="add"?t=$.createElement(Un,null):e==="unpair"?t=$.createElement(Bo,null):e==="pair"?t=$.createElement(Po,null):e==="save"?t=$.createElement(wc,null):e==="open"?t=$.createElement(Cc,null):e&&((e.endsWith(".png")||e.endsWith(".svg")||e.endsWith(".jpg"))&&!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${this.props.oContext.imagePrefix}/adapter/${this.props.oContext.adapterName}/${e}`),t=$.createElement(P.Icon,{src:e,style:{width:22,height:22}})),t}onChangeAsync(e,t){return new Promise(n=>{const h=this.onChange(e,t,n);h instanceof Promise&&h.catch(i=>console.error(`Cannot set value: ${i}`))})}async onChange(e,t,n){const h=JSON.parse(JSON.stringify(this.props.data));if(V.setValue(h,e,t),this.props.schema.confirm&&await this.execute(this.props.schema.confirm.condition,!1,h,this.props.arrayIndex,this.props.globalData))return new Promise(s=>{this.setState({confirmDialog:!0,confirmNewValue:t,confirmAttr:e,confirmData:null},()=>{typeof n=="function"?n():s()})});if(this.props.schema.confirmDependsOn)for(let s=0;s<this.props.schema.confirmDependsOn.length;s++){const d=this.props.schema.confirmDependsOn[s];if(d.confirm){const o=V.getValue(h,d.attr);if(await this.execute(d.confirm.condition,!1,h,this.props.arrayIndex,this.props.globalData))return new Promise(l=>{this.setState({confirmDialog:!0,confirmNewValue:t,confirmAttr:e,confirmDepNewValue:o,confirmDepAttr:d.attr,confirmData:d.confirm},()=>{typeof n=="function"?n():l()})})}}const i=[];if(this.props.schema.onChangeDependsOn)for(let s=0;s<this.props.schema.onChangeDependsOn.length;s++){const d=this.props.schema.onChangeDependsOn[s];if(d.onChange){const o=V.getValue(h,d.attr);let l;this.props.custom?l=await this.executeCustom(d.onChange.calculateFunc,h,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):l=await this.execute(d.onChange.calculateFunc,o,h,this.props.arrayIndex,this.props.globalData),l!==o&&(V.setValue(h,d.attr,l),i.push(d.attr))}}if(this.props.schema.hiddenDependsOn)for(let s=0;s<this.props.schema.hiddenDependsOn.length;s++){const d=this.props.schema.hiddenDependsOn[s];d.hidden&&i.push(d.attr)}if(this.props.schema.labelDependsOn)for(let s=0;s<this.props.schema.labelDependsOn.length;s++){const d=this.props.schema.labelDependsOn[s];d.hidden&&i.push(d.attr)}if(this.props.schema.helpDependsOn)for(let s=0;s<this.props.schema.helpDependsOn.length;s++){const d=this.props.schema.helpDependsOn[s];d.hidden&&i.push(d.attr)}if(this.props.schema.onChange&&!this.props.schema.onChange.ignoreOwnChanges){const s=V.getValue(h,this.props.attr),d=this.props.custom?await this.executeCustom(this.props.schema.onChange.calculateFunc,h,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):await this.execute(this.props.schema.onChange.calculateFunc,s,h,this.props.arrayIndex,this.props.globalData);d!==s&&V.setValue(h,this.props.attr,d)}return this.props.custom?(this.props.onChange(e,t,()=>n&&n()),i!=null&&i.length&&i.forEach((s,d)=>setTimeout(()=>this.props.onChange(s,V.getValue(h,s)),d*50))):this.props.onChange(h,void 0,()=>{i.length&&this.props.oContext.forceUpdate(i,h),n==null||n()}),Promise.resolve()}static ensureAwaitGetObject(e){return e.replace(/(?<![\w$.])getObject\(/g,(t,n)=>{const h=e.slice(Math.max(0,n-10),n);return/await\s+$/.test(h)?t:`await ${t}`})}async execute(e,t,n,h,i){let s;if(pi(e))s=e.func;else if(typeof e=="string")s=e;else return e;if(!s)return t;s.includes("getObject(")&&(s=V.ensureAwaitGetObject(s));try{return await new this.AsyncFunction("data","originalData","_system","_alive","_common","_socket","_instance","arrayIndex","globalData","_changed","_href","getObject",s.includes("return")?s:`return ${s}`)(n||this.props.data,this.props.originalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.oContext.instance,h,i,this.props.changed,window.location.href,this.getObject)}catch(d){return console.error(`Cannot execute ${JSON.stringify(e)}: ${d}`),t}}async executeCustom(e,t,n,h,i,s){let d;if(pi(e))d=e.func;else if(typeof e=="string")d=e;else return e;if(!d)return null;d.includes("getObject(")&&(d=V.ensureAwaitGetObject(d));try{return await new this.AsyncFunction("data","originalData","_system","instanceObj","customObj","_socket","arrayIndex","globalData","_changed","_href","getObject",d.includes("return")?d:`return ${d}`)(t||this.props.data,this.props.originalData,this.props.oContext.systemConfig,h,n,this.props.oContext.socket,i,s,this.props.changed,window.location.href,this.getObject)}catch(o){return console.error(`Cannot execute ${d}: ${o}`),null}}async calculate(e){let t,n,h,i;return this.props.custom?(t=e.validator?!await this.executeCustom(e.validator,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,e.disabled===!0?n=!0:n=e.disabled?await this.executeCustom(e.disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,e.hidden===!0?h=!0:h=e.hidden?await this.executeCustom(e.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,i=e.defaultFunc?await this.executeCustom(e.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):e.default):(t=e.validator?!await this.execute(e.validator,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,e.disabled===!0?n=!0:n=e.disabled?await this.execute(e.disabled,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,e.hidden===!0?h=!0:h=e.hidden?await this.execute(e.hidden,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,i=e.defaultFunc?await this.execute(e.defaultFunc,e.default,this.props.data,this.props.arrayIndex,this.props.globalData):e.default),{error:t,disabled:n,hidden:h,defaultValue:i}}onError(e,t){t?this.isError[e]=t:delete this.isError[e],this.props.onError&&this.props.onError(e,t)}renderItem(e,t,n){return this.getText(this.props.schema.label)||this.getText(this.props.schema.text)}renderHelp(e,t,n){return t?$.createElement("a",{href:t,target:"_blank",rel:"noreferrer",style:{color:this.props.oContext.themeType==="dark"?"#a147ff":"#5b238f",textDecoration:"underline"}},this.getText(e,n)):(e=this.getText(e,n)||"",e&&(e.includes("<a ")||e.includes("<br")||e.includes("<b>")||e.includes("<i>"))?P.Utils.renderTextWithA(e):e)}async renderHelpAsync(e,t,n){return t?$.createElement("a",{href:t,target:"_blank",rel:"noreferrer",style:{color:this.props.oContext.themeType==="dark"?"#a147ff":"#5b238f",textDecoration:"underline"}},await this.getTextAsync(e,n)):(e=await this.getTextAsync(e,n)||"",e&&(e.includes("<a ")||e.includes("<br")||e.includes("<b>")||e.includes("<i>"))?P.Utils.renderTextWithA(e):e)}static escapeString(e,t){return typeof e!="string"?"":(e=e.replace(/`/g,"\\`"),e=e.replace(/\${([^}]+)}/g,(n,h)=>{if(h&&typeof h=="string"&&h.startsWith("data.")){const i=V.getValue(t,h.replace(/^data\./,""));if(typeof i=="string"&&(i.includes("\\")||i.includes('"')))return`\${${h}.replace(/\\\\/g, '\\\\\\\\').replace(/"/g, '\\\\"')}`}return n}),e)}getObject=async e=>{try{return await this.props.oContext.getCachedObject(e)||null}catch(t){return console.error(t),null}};async getPatternAsync(e,t,n){if(t||=this.props.data,!e)return"";let h;typeof e=="object"?e.func?h=e.func:(console.log(`Object must be stringified: ${JSON.stringify(e)}`),h=JSON.stringify(e)):h=e,h.includes("getObject(")&&(h=V.ensureAwaitGetObject(h));try{if(this.props.custom){const o=await new this.AsyncFunction("data","originalData","arrayIndex","globalData","_system","instanceObj","customObj","_socket","_changed","_href","getObject",`return \`${V.escapeString(h,t)}\``)(t,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.oContext.instanceObj,this.props.customObj,this.props.oContext.socket,this.props.changed,window.location.href,this.getObject);return n?o:P.I18n.t(o)}const s=await new this.AsyncFunction("data","originalData","arrayIndex","globalData","_system","_alive","_common","_socket","_changed","_href","getObject",`return \`${V.escapeString(h,t)}\``)(t,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.changed,window.location.href,this.getObject);return n?s:P.I18n.t(s)}catch(i){return console.error(`Cannot execute ${h}: ${i}`),h}}getPattern(e,t,n){if(t||=this.props.data,!e)return"";let h;typeof e=="object"?e.func?h=e.func:(console.log(`Object must be stringified: ${JSON.stringify(e)}`),h=JSON.stringify(e)):h=e,h.includes("getObject(")&&console.warn(`It is not possible to use getObject function in text patterns: ${h}`);try{if(this.props.custom){const o=new Function("data","originalData","arrayIndex","globalData","_system","instanceObj","customObj","_socket","_changed","_href",`return \`${V.escapeString(h,t)}\``)(t,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.oContext.instanceObj,this.props.customObj,this.props.oContext.socket,this.props.changed,window.location.href,this.getObject);return n?o:P.I18n.t(o)}const s=new Function("data","originalData","arrayIndex","globalData","_system","_alive","_common","_socket","_changed","_href",`return \`${V.escapeString(h,t)}\``)(t,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.changed,window.location.href);return n?s:P.I18n.t(s)}catch(i){return console.error(`Cannot execute ${h}: ${i}`),h}}updateCalculatedValues(){this.calculateTimeout&&clearTimeout(this.calculateTimeout),this.calculateTimeout=setTimeout(async()=>{this.calculateTimeout=null;const e=this.props.schema;if(!e)return null;const{error:t,disabled:n,hidden:h,defaultValue:i}=await this.calculate(e);(!this.state.calculatedValues||this.state.calculatedValues.error!==t||this.state.calculatedValues.disabled!==n||this.state.calculatedValues.hidden!==h||this.state.calculatedValues.defaultValue!==i)&&this.setState({calculatedValues:{error:t,disabled:n,hidden:h,defaultValue:i}})},50)}render(){const e=this.props.schema;if(!e||this.props.expertMode===!1&&e.expertMode||(this.props.alive&&this.defaultSendToDone===!1&&(this.sendToTimeout=setTimeout(async()=>{this.sendToTimeout=null,await this.sendTo()},200)),this.updateCalculatedValues(),!this.state.calculatedValues))return null;if(this.state.calculatedValues.hidden){if(Object.keys(this.isError).length&&(setTimeout(h=>Object.keys(h).forEach(i=>this.props.onError(i)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}),e.hideOnlyControl){const h=$.createElement(ze,{size:{xs:e.xs||Ch,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0},style:{marginBottom:0,textAlign:"left",...e.style,...this.props.oContext.themeType==="dark"?e.darkStyle:{}}});return e.newLine?$.createElement($.Fragment,null,$.createElement("div",{style:{flexBasis:"100%",height:0}}),h):h}return this.props.onHiddenChanged&&!this.reportedHidden&&(this.reportedHidden=!0,setTimeout(()=>this.props.onHiddenChanged(this.props.attr,!0),10)),null}this.props.onHiddenChanged&&this.reportedHidden&&(this.reportedHidden=!1,setTimeout(()=>this.props.onHiddenChanged(this.props.attr,!1),10)),e.validatorNoSaveOnError&&(this.state.calculatedValues.error&&!Object.keys(this.isError).length?(this.isError={[this.props.attr]:e.validatorErrorText?P.I18n.t(e.validatorErrorText):!0},setTimeout(h=>Object.keys(h).forEach(i=>this.props.onError(i,h[i])),100,JSON.parse(JSON.stringify(this.isError)))):!this.state.calculatedValues.error&&Object.keys(this.isError).length&&(setTimeout(h=>Object.keys(h).forEach(i=>this.props.onError(i)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}));const t=this.renderItem(this.state.calculatedValues.error,this.state.calculatedValues.disabled||this.props.commandRunning||this.props.disabled,this.state.calculatedValues.defaultValue);if(this.noPlaceRequired)return t;const n=$.createElement(ze,{title:this.getText(e.tooltip),size:{xs:e.xs||12,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0},style:{marginBottom:0,textAlign:"left",width:e.type==="divider"||e.type==="header"?e.width||"100%":void 0,...e.style,...this.props.oContext.themeType==="dark"?e.darkStyle:{}}},this.props.schema.defaultSendTo&&this.props.schema.button?$.createElement(ze,{container:!0,style:{width:"100%"}},$.createElement(ze,{flex:1},t),$.createElement(ze,null,$.createElement(ve,{disabled:this.state.calculatedValues.disabled,variant:"outlined",onClick:()=>this.sendTo(),title:this.props.schema.buttonTooltip?this.getText(this.props.schema.buttonTooltip,this.props.schema.buttonTooltipNoTranslation):P.I18n.t("ra_Request data by instance")},this.getText(this.props.schema.button)))):t);return e.newLine?$.createElement($.Fragment,null,$.createElement("div",{style:{flexBasis:"100%",height:0}}),this.renderDialogConfirm(),n):this.state.confirmDialog?$.createElement($.Fragment,null,this.renderDialogConfirm(),n):n}}const tt={fullWidth:{width:"100%"},accordionSummary:m=>({backgroundColor:m.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.08)"}),accordionTitle:{},toolbar:m=>({backgroundColor:m.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.08)",borderRadius:"3px"}),tooltip:{pointerEvents:"none"}};class Sh extends V{typingTimer=null;constructor(e){super(e),this.props.schema.items||=[]}async componentDidMount(){await super.componentDidMount();let e=V.getValue(this.props.data,this.props.attr)||[];Array.isArray(e)||(e=[]),this.setState({value:e,activeIndex:-1,iteration:0,accordionErrors:{}})}componentWillUnmount(){this.typingTimer&&(clearTimeout(this.typingTimer),this.typingTimer=null),super.componentWillUnmount()}onAccordionError=e=>(t,n)=>{const h={...this.state.accordionErrors};h[e]||(h[e]={}),n?h[e][t]=n:(delete h[e][t],Object.keys(h[e]).length===0&&delete h[e]),this.setState({accordionErrors:h}),this.props.onError(t,n)};hasAccordionErrors=e=>!!(this.state.accordionErrors[e]&&Object.keys(this.state.accordionErrors[e]).length>0);itemAccordion(e,t){const{value:n}=this.state,{schema:h}=this.props,i={type:"panel",items:h.items.reduce((s,d)=>(s[d.attr]=d,s),{}),style:{marginLeft:"-8px",marginTop:"10px",marginBottom:"10px"}};return $.createElement(tn,{oContext:this.props.oContext,index:t+this.state.iteration,arrayIndex:t,changed:this.props.changed,expertMode:this.props.expertMode,globalData:this.props.data,common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:e,custom:!0,schema:i,originalData:this.props.originalData,onChange:(s,d)=>{const o=JSON.parse(JSON.stringify(n));o[t][s]=d,this.setState({value:o},()=>this.onChangeWrapper(o))},onError:this.onAccordionError(t),onHiddenChanged:this.props.onHiddenChanged,table:this.props.table,customComponents:this.props.customComponents})}onDelete=e=>()=>{const t=JSON.parse(JSON.stringify(this.state.value));t.splice(e,1),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(t))};onClone=e=>()=>{const t=JSON.parse(JSON.stringify(this.state.value)),n=JSON.parse(JSON.stringify(t[e]));if(typeof this.props.schema.clone=="string"&&typeof n[this.props.schema.clone]=="string"){let h=1,i=n[this.props.schema.clone];const s=i.match(/(\d+)$/);for(s?(i=i.replace(s[0],""),h=parseInt(s[0],10)+1):i+="_";t.find(d=>d[this.props.schema.clone]===i+h.toString());)h++;n[this.props.schema.clone]=`${n[this.props.schema.clone]}_${h}`}t.splice(e,0,n),this.setState({value:t,activeIndex:-1,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(t))};onChangeWrapper=e=>{this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout(t=>{this.typingTimer=null;const n=this.onChange(this.props.attr,t);n instanceof Promise&&n.catch(h=>this.onError(h))},300,e)};onAdd=async()=>{const{schema:e}=this.props,t=JSON.parse(JSON.stringify(this.state.value)),n={};if(e.items)for(const h of e.items){let i;h.defaultFunc?this.props.custom?i=h.defaultFunc?await this.executeCustom(h.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,t.length,this.props.data):this.props.schema.default:i=h.defaultFunc?await this.execute(h.defaultFunc,this.props.schema.default,this.props.data,t.length,this.props.data):this.props.schema.default:i=h.default??null,n[h.attr]=i}t.push(n),this.setState({value:t,activeIndex:t.length-1},()=>this.onChangeWrapper(t))};onMoveUp(e){const t=JSON.parse(JSON.stringify(this.state.value)),n=t[e];t.splice(e,1),t.splice(e-1,0,n);const h=this.state.activeIndex-1;this.setState({value:t,activeIndex:h,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(t))}onMoveDown(e){const t=JSON.parse(JSON.stringify(this.state.value)),n=t[e];t.splice(e,1),t.splice(e+1,0,n);const h=this.state.activeIndex+1;this.setState({value:t,activeIndex:h,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(t))}onExport=()=>{const{value:e}=this.state,t=JSON.stringify(e,null,2),n=`data:application/json;charset=utf-8,${encodeURIComponent(t)}`,h=`config_section_${new Date().toISOString().slice(0,19).replace(/:/g,"-")}.json`,i=document.createElement("a");i.setAttribute("href",n),i.setAttribute("download",h),i.click()};onImport=e=>{const t=document.createElement("input");t.type="file",t.accept=".json",t.onchange=n=>{var s;const h=(s=n.target.files)==null?void 0:s[0];if(!h)return;const i=new FileReader;i.onload=d=>{var o;try{const l=JSON.parse((o=d.target)==null?void 0:o.result);if(!Array.isArray(l)){alert(P.I18n.t("ra_Invalid JSON format. Expected an array."));return}let r;e?r=l:r=[...this.state.value,...l],this.setState({value:r,activeIndex:-1},()=>this.onChangeWrapper(r))}catch{alert(P.I18n.t("ra_Invalid JSON file."))}},i.readAsText(h)},t.click()};renderItem(){const{schema:e}=this.props,{value:t}=this.state;return t?$.createElement(In,null,e.label||!e.noDelete?$.createElement(Pn,{variant:"dense"},e.label?$.createElement(yt,{variant:"h6",id:"tableTitle",component:"div"},this.getText(e.label)):null,e.noDelete?null:$.createElement($.Fragment,null,$.createElement(me,{title:P.I18n.t("ra_Export configuration section")},$.createElement(se,{size:"small",color:"primary",onClick:this.onExport},$.createElement(Sc,null))),$.createElement(me,{title:P.I18n.t("ra_Import and replace configuration section")},$.createElement(se,{size:"small",color:"primary",onClick:()=>this.onImport(!0)},$.createElement(Ec,null))),$.createElement(me,{title:P.I18n.t("ra_Import and add configuration section")},$.createElement(se,{size:"small",color:"primary",onClick:()=>this.onImport(!1)},$.createElement(Ac,null))),$.createElement(se,{size:"small",color:"primary",onClick:this.onAdd},$.createElement(Un,null)))):null,t.map((n,h)=>$.createElement(js,{key:`${n}_${h}`,expanded:this.state.activeIndex===h,onChange:(i,s)=>this.setState({activeIndex:s?h:-1})},$.createElement(Hs,{expandIcon:$.createElement(Ii,null),sx:P.Utils.getStyle(this.props.oContext.theme,tt.fullWidth,tt.accordionSummary)},$.createElement(Ie,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"}},$.createElement(yt,{style:tt.accordionTitle},n[e.titleAttr]),this.hasAccordionErrors(h)&&$.createElement(Jt,{sx:{fontSize:20,color:"error.main"}}))),$.createElement(zs,{style:{...e.style,...this.props.oContext.themeType?e.darkStyle:void 0}},this.itemAccordion(t[h],h),$.createElement(Pn,{sx:tt.toolbar},h?$.createElement(me,{title:P.I18n.t("ra_Move up"),slotProps:{popper:{sx:tt.tooltip}}},$.createElement(se,{size:"small",onClick:()=>this.onMoveUp(h)},$.createElement(Ai,null))):$.createElement("div",{style:tt.buttonEmpty}),h<t.length-1?$.createElement(me,{title:P.I18n.t("ra_Move down"),slotProps:{popper:{sx:tt.tooltip}}},$.createElement(se,{size:"small",onClick:()=>this.onMoveDown(h)},$.createElement(Di,null))):$.createElement("div",{style:tt.buttonEmpty}),e.noDelete?null:$.createElement(me,{title:P.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:tt.tooltip}}},$.createElement(se,{size:"small",onClick:this.onDelete(h)},$.createElement(_t,null))),e.clone?$.createElement(me,{title:P.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:tt.tooltip}}},$.createElement(se,{size:"small",onClick:this.onClone(h)},$.createElement(fn,null))):null)))),!e.noDelete&&t.length>0?$.createElement(Pn,{variant:"dense",sx:tt.rootTool},$.createElement(se,{size:"small",color:"primary",onClick:this.onAdd},$.createElement(Un,null))):null,e.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null):null}}const Hr={root:{width:"100%"},notAlive:{color:"#a30000"}};class Eh extends V{aliveId=null;checkTimeout=null;async componentDidMount(){await super.componentDidMount();const e=await this.getInstance();this.aliveId=`${e}.alive`;const t=await this.props.oContext.socket.getState(this.aliveId);this.setState({alive:!!(t&&t.val),instance:e},async()=>{await this.props.oContext.socket.subscribeState(this.aliveId,this.onAliveChanged)})}componentWillUnmount(){this.checkTimeout&&(clearTimeout(this.checkTimeout),this.checkTimeout=null),this.props.oContext.socket.unsubscribeState(this.aliveId,this.onAliveChanged)}onAliveChanged=(e,t)=>{e===this.aliveId&&this.state.alive!==!!(t!=null&&t.val)&&this.setState({alive:!!(t!=null&&t.val)})};async getInstance(){let e=this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`;return e.includes("${")&&(e=await this.getPatternAsync(e,null,!0)),e&&!e.startsWith("system.adapter.")&&(e=`system.adapter.${e}`),e}checkIfInstanceChanged(){this.checkTimeout&&clearTimeout(this.checkTimeout),this.checkTimeout=setTimeout(async()=>{this.checkTimeout=null;const e=await this.getInstance();e!==this.state.instance&&(e?this.props.oContext.socket.getState(`${e}.alive`).then(t=>this.setState({alive:!!(t&&t.val),instance:e})):this.setState({alive:null,instance:e}))},200)}renderItem(){if(this.checkIfInstanceChanged(),this.state.alive!==!1&&this.state.alive!==!0)return null;const e=this.state.instance.replace(/^system\.adapter\./,"");return $.createElement("div",{style:{...Hr.root,...this.state.alive?void 0:Hr.notAlive}},this.state.alive?this.props.schema.textAlive!==void 0?this.props.schema.textAlive?P.I18n.t(this.props.schema.textAlive,e):"":P.I18n.t("ra_Instance %s is alive",e):this.props.schema.textNotAlive!==void 0?this.props.schema.textNotAlive?P.I18n.t(this.props.schema.textNotAlive,e):"":P.I18n.t("ra_Instance %s is not alive",e))}}class Ah extends V{async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr),t=this.props.schema.options.map(n=>typeof n=="string"?{label:n,value:n}:JSON.parse(JSON.stringify(n)));if(this.props.onFilterLabelUpdate&&this.props.table){const n={};for(const h of t)h.value!==V.DIFFERENT_VALUE&&(n[h.value]=h.label);this.props.onFilterLabelUpdate(this.props.attr,n)}Array.isArray(e)?(t.unshift({label:P.I18n.t(V.DIFFERENT_LABEL),value:V.DIFFERENT_VALUE}),this.setState({value:V.DIFFERENT_VALUE,selectOptions:t})):this.setState({value:e,selectOptions:t})}renderItem(e,t){if(!this.state.selectOptions)return null;let n;const h=JSON.parse(JSON.stringify(this.state.selectOptions));return Array.isArray(this.state.value)||this.state.value===V.DIFFERENT_VALUE?([...this.state.value].filter(s=>!h.find(d=>typeof d=="object"?d.value===s:d===s)).forEach(s=>h.push({label:s.toString(),value:s})),n={label:P.I18n.t(V.DIFFERENT_LABEL),value:V.DIFFERENT_VALUE},h.unshift(n)):(n=this.state.value!==null&&this.state.value!==void 0&&h.find(s=>typeof s=="object"?s.value==this.state.value:s==this.state.value),this.state.value!==null&&this.state.value!==void 0&&!n&&this.props.schema.freeSolo&&(n={value:this.state.value,label:this.state.value},h.push(n))),$.createElement(Wi,{fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,value:n,options:h,isOptionEqualToValue:(s,d)=>s.value===d.value,filterOptions:(s,d)=>{const o=s.filter(l=>d.inputValue===""?!0:l.label.toLowerCase().includes(d.inputValue.toLowerCase())||l.value.toLowerCase().includes(d.inputValue.toLowerCase()));return this.props.schema.freeSolo&&d.inputValue!==""&&o.push({label:d.inputValue,value:d.inputValue}),o},onInputChange:s=>{if(!s||!this.props.schema.freeSolo)return;const d=s.target.value;d!==this.state.value&&this.setState({value:d},()=>this.onChange(this.props.attr,d))},onChange:(s,d)=>{const o=typeof d=="object"?d?d.value:"":d;o!==this.state.value&&this.setState({value:o},()=>this.onChange(this.props.attr,o))},getOptionLabel:s=>typeof s=="object"?(s==null?void 0:s.label)??"":"",renderInput:s=>$.createElement(pe,{variant:"standard",...s,error:!!e,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:t})})}}class Dh extends V{initialized=!1;localContext;async askInstance(){const e=V.getValue(this.props.data,this.props.attr),t=this.props.schema.options?this.props.schema.options.map(n=>typeof n=="string"?{label:n,value:n}:JSON.parse(JSON.stringify(n))):[];if(this.props.alive){let n=this.props.schema.data;if(n===void 0&&this.props.schema.jsonData){const i=await this.getPatternAsync(this.props.schema.jsonData,null,!0);try{typeof i=="string"&&(n=JSON.parse(i))}catch{console.error(`Cannot parse json data: ${JSON.stringify(n)}`)}}n===void 0&&(n=null),this.setState({loading:!0});const h=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(h!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){const i=await this.props.oContext.socket.getState(`system.adapter.${h}.alive`);if(!(i!=null&&i.val)){window.alert(P.I18n.t("ra_Instance %s is not alive",h));return}}this.props.oContext.socket.sendTo(h,this.props.schema.command||"send",n).then(i=>{i&&Array.isArray(i)&&i.forEach(s=>t.push(typeof s=="string"?{label:s,value:s}:JSON.parse(JSON.stringify(s)))),this.reportFilterLabels(t),Array.isArray(e)?(t.unshift({label:P.I18n.t(V.DIFFERENT_LABEL),value:V.DIFFERENT_VALUE}),this.setState({value:V.DIFFERENT_VALUE,selectOptions:t,loading:!1})):this.setState({value:e,selectOptions:t,loading:!1})}).catch(i=>{console.error("Error in autocompleteSendTo:",i),this.setState({loading:!1})})}else Array.isArray(e)?(t.unshift({label:P.I18n.t(V.DIFFERENT_LABEL),value:V.DIFFERENT_VALUE}),this.reportFilterLabels(t),this.setState({value:V.DIFFERENT_VALUE,selectOptions:t})):(this.reportFilterLabels(t),this.setState({value:e,selectOptions:t}))}reportFilterLabels(e){if(this.props.onFilterLabelUpdate&&this.props.table){const t={};for(const n of e)n.value!==V.DIFFERENT_VALUE&&(t[n.value]=n.label);this.props.onFilterLabelUpdate(this.props.attr,t)}}getContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=V.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(e,t){if(this.props.alive){const s=this.getContext();(s!==this.localContext||!this.initialized)&&(this.localContext=s,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}let n;const h=this.state.selectOptions?JSON.parse(JSON.stringify(this.state.selectOptions)):[];return Array.isArray(this.state.value)||this.state.value===V.DIFFERENT_LABEL?([...this.state.value].filter(s=>!h.find(d=>d.value===s)).forEach(s=>h.push({label:s.toString(),value:s})),n={label:P.I18n.t(V.DIFFERENT_LABEL),value:V.DIFFERENT_VALUE},h.unshift(n)):(n=this.state.value!==null&&this.state.value!==void 0&&h.find(s=>s.value==this.state.value),this.state.value!==null&&this.state.value!==void 0&&!n&&this.props.schema.freeSolo&&(n={value:this.state.value,label:this.state.value},h.push(n)),n=n||null),h.length?$.createElement(Wi,{value:n,fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,options:h,disabled:t,isOptionEqualToValue:(s,d)=>s.value===d.value,filterOptions:(s,d)=>{const o=s.filter(l=>d.inputValue===""?!0:l.label.toLowerCase().includes(d.inputValue.toLowerCase())||l.value.toLowerCase().includes(d.inputValue.toLowerCase()));return this.props.schema.freeSolo&&d.inputValue!==""&&o.push({label:d.inputValue,value:d.inputValue}),o},getOptionLabel:s=>(s==null?void 0:s.label)??"",onInputChange:s=>{if(!s||!this.props.schema.freeSolo)return;const d=s.target.value;d!==this.state.value&&this.setState({value:d},()=>this.onChange(this.props.attr,d))},onChange:(s,d)=>{const o=typeof d=="object"?d?d.value:"":d;o!==this.state.value&&this.setState({value:o},()=>this.onChange(this.props.attr,o))},renderInput:s=>$.createElement(pe,{variant:"standard",...s,error:!!e,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:t,slotProps:{input:{...s.InputProps,endAdornment:$.createElement($.Fragment,null,this.state.loading?$.createElement(vn,{position:"end"},$.createElement(Tt,{size:20})):null,t?null:s.InputProps.endAdornment)}}})}):$.createElement(pe,{variant:"standard",fullWidth:!0,value:this.state.value??"",error:!!e,disabled:t,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0},input:{endAdornment:this.state.loading?$.createElement(vn,{position:"end"},$.createElement(Tt,{size:20})):null}},onChange:s=>{const d=s.target.value;this.setState({value:d},()=>this.onChange(this.props.attr,(d||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const us={fullWidth:{width:"100%"},flex:{display:"flex"},button:{height:48,marginLeft:4,minWidth:48}};class $h extends V{async componentDidMount(){await super.componentDidMount();const{data:e,attr:t}=this.props,n=V.getValue(e,t)||"";this.setState({value:n,showDialog:!1})}renderItem(e,t){const{schema:n,attr:h}=this.props,{value:i,showDialog:s}=this.state;return $.createElement(fe,{style:us.fullWidth,variant:"standard"},n.label?$.createElement(_e,{shrink:!0},this.getText(n.label)):null,$.createElement("div",{style:us.flex},$.createElement(pe,{variant:"standard",fullWidth:!0,value:i??"",error:!!e,disabled:t,placeholder:this.getText(n.placeholder),label:this.getText(n.label),helperText:this.renderHelp(n.help,n.helpLink,n.noTranslation),onChange:d=>{const o=d.target.value;this.setState({value:o},()=>this.onChange(h,o))}}),$.createElement(ve,{color:"grey",disabled:t,style:us.button,size:"small",variant:"outlined",onClick:()=>this.setState({showDialog:!0})},"...")),s?$.createElement(P.DialogCron,{title:P.I18n.t("ra_Define schedule"),simple:n.simple,complex:n.complex,cron:i,onClose:()=>this.setState({showDialog:!1}),cancel:P.I18n.t("ra_Cancel"),ok:P.I18n.t("ra_Ok"),theme:this.props.oContext.theme,onOk:d=>this.setState({showDialog:!1,value:d},()=>this.onChange(h,d))}):null)}}class xh extends V{async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr),n=(await this.props.oContext.socket.getCertificates()).filter(h=>{const i=this.props.attr.toLowerCase();return i.includes(h.type)||h.type==="public"&&i.includes("cert")||h.type==="private"&&(i.includes("priv")||i.includes("key"))?!0:!!(h.type==="chained"&&(i.includes("chain")||i.includes("ca")))}).map(h=>({label:h.name,value:h.name}));n.unshift({label:P.I18n.t(V.NONE_LABEL),value:V.NONE_VALUE}),this.setState({value:e,selectOptions:n})}renderItem(e,t){var h,i;if(!this.state.selectOptions)return null;const n=(h=this.state.selectOptions)==null?void 0:h.find(s=>s.value===this.state.value);return $.createElement(fe,{style:{width:"100%"},variant:"standard"},this.props.schema.label?$.createElement(_e,{shrink:!0},this.getText(this.props.schema.label)):null,$.createElement(Ne,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:this.state.value,renderValue:()=>this.getText(n==null?void 0:n.label,this.props.schema.noTranslation!==!1),onChange:s=>this.setState({value:s.target.value},()=>this.onChange(this.props.attr,this.state.value))},(i=this.state.selectOptions)==null?void 0:i.map(s=>$.createElement($e,{key:s.value,value:s.value,style:s.value===V.NONE_VALUE?{opacity:.5}:{}},this.getText(s.label,this.props.schema.noTranslation!==!1)))),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Ln={fullWidth:{width:"100%"},leWidth:{width:620,marginBottom:10},certWidth:{width:200,marginRight:10}};class _h extends V{async componentDidMount(){var d;await super.componentDidMount();const e=await this.props.oContext.socket.getCertificates(),t=[],n=[],h=[];let i=[];const s=await this.getCachedObject("system.certificates");(d=s==null?void 0:s.native)!=null&&d.collections?i=Object.keys(s.native.collections):i=null,e.forEach(o=>{o.type==="public"?t.push({label:o.name,value:o.name}):o.type==="private"?n.push({label:o.name,value:o.name}):o.type==="chained"?h.push({label:o.name,value:o.name}):(t.push({label:o.name,value:o.name}),n.push({label:o.name,value:o.name}),h.push({label:o.name,value:o.name}))}),t.unshift({label:P.I18n.t(V.NONE_LABEL),value:V.NONE_VALUE}),n.unshift({label:P.I18n.t(V.NONE_LABEL),value:V.NONE_VALUE}),h.unshift({label:P.I18n.t(V.NONE_LABEL),value:V.NONE_VALUE}),this.setState({certsPublicOptions:t,certsChainOptions:h,certsPrivateOptions:n,collectionsOptions:i})}renderItem(e,t){var r,a,c,p,u,f,g;if(!this.state.certsPublicOptions||!this.state.certsPrivateOptions||!this.state.certsChainOptions)return null;const n=(V.getValue(this.props.data,this.props.schema.leCollectionName||"leCollection")||"false").toString(),h=V.getValue(this.props.data,this.props.schema.certPublicName||"certPublic"),i=V.getValue(this.props.data,this.props.schema.certPrivateName||"certPrivate"),s=V.getValue(this.props.data,this.props.schema.certChainedName||"certChained"),d=(r=this.state.certsPublicOptions)==null?void 0:r.find(v=>v.value===h),o=(a=this.state.certsPrivateOptions)==null?void 0:a.find(v=>v.value===i),l=(c=this.state.certsChainOptions)==null?void 0:c.find(v=>v.value===s);return $.createElement("div",{style:Ln.fullWidth},this.state.collectionsOptions?$.createElement(fe,{style:Ln.leWidth,variant:"standard"},$.createElement(_e,{shrink:!0},"Let's encrypt"),$.createElement(Ne,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:n,onChange:v=>this.onChange(this.props.schema.leCollectionName||"leCollection",v.target.value==="false"?!1:v.target.value==="true"?!0:v.target.value)},$.createElement($e,{key:"_false",value:"false",style:{fontWeight:"bold"}},P.I18n.t("ra_Do not use let's encrypt")),$.createElement($e,{key:"_true",value:"true",style:{fontWeight:"bold"}},P.I18n.t("ra_Use all available let's encrypt certificates")),(p=this.state.collectionsOptions)==null?void 0:p.map(v=>$.createElement($e,{key:v,value:v},v)))):null,this.state.collectionsOptions?$.createElement("br",null):null,this.state.collectionsOptions&&n!=="false"?$.createElement("div",null,P.I18n.t("ra_Fallback custom certificates")):null,$.createElement(fe,{style:Ln.certWidth,variant:"standard"},$.createElement(_e,{shrink:!0},P.I18n.t("ra_Public certificate")),$.createElement(Ne,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:h||"",renderValue:()=>this.getText(d==null?void 0:d.label,!0),onChange:v=>this.onChange(this.props.schema.certPublicName||"certPublic",v.target.value)},(u=this.state.certsPublicOptions)==null?void 0:u.map((v,b)=>$.createElement($e,{key:`${v.value}_${b}`,value:v.value,style:v.value===V.NONE_VALUE?{opacity:.5}:{}},this.getText(v.label,!0))))),$.createElement(fe,{style:Ln.certWidth,variant:"standard"},$.createElement(_e,{shrink:!0},P.I18n.t("ra_Private certificate")),$.createElement(Ne,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:i||"",renderValue:()=>this.getText(o==null?void 0:o.label,!0),onChange:v=>this.onChange(this.props.schema.certPrivateName||"certPrivate",v.target.value)},(f=this.state.certsPrivateOptions)==null?void 0:f.map((v,b)=>$.createElement($e,{key:`${v.value}_${b}`,value:v.value,style:v.value===V.NONE_VALUE?{opacity:.5}:{}},this.getText(v.label,!0))))),$.createElement(fe,{style:Ln.certWidth,variant:"standard"},$.createElement(_e,{shrink:!0},P.I18n.t("ra_Chained certificate")),$.createElement(Ne,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:s||"",renderValue:()=>this.getText(l==null?void 0:l.label,!0),onChange:v=>this.onChange(this.props.schema.certChainedName||"certChained",v.target.value)},(g=this.state.certsChainOptions)==null?void 0:g.map((v,b)=>$.createElement($e,{key:`${v.value}_${b}`,value:v.value,style:v.value===V.NONE_VALUE?{opacity:.5}:{}},this.getText(v.label,!0))))))}}class kh extends V{async componentDidMount(){var n;await super.componentDidMount();let e;const t=await this.getCachedObject("system.certificates");(n=t==null?void 0:t.native)!=null&&n.collections?e=Object.keys(t.native.collections):e=[],this.setState({collectionsOptions:e})}renderItem(e,t){var h;if(!this.state.collectionsOptions)return null;const n=(V.getValue(this.props.data,this.props.schema.leCollectionName||"leCollection")||"false").toString();return $.createElement(fe,{style:{width:"100%"},variant:"standard"},this.props.schema.label?$.createElement(_e,{shrink:!0},this.getText(this.props.schema.label)):null,$.createElement(Ne,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:n,onChange:i=>this.onChange(this.props.schema.leCollectionName||"leCollection",i.target.value==="false"?!1:i.target.value==="true"?!0:i.target.value)},$.createElement($e,{key:"_false",value:"false",style:{fontWeight:"bold"}},P.I18n.t("ra_Do not use let's encrypt")),$.createElement($e,{key:"_true",value:"true",style:{fontWeight:"bold"}},P.I18n.t("ra_Use all available let's encrypt certificates")),(h=this.state.collectionsOptions)==null?void 0:h.map(i=>$.createElement($e,{key:i,value:i},i))),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Th extends V{async componentDidMount(){await super.componentDidMount();const e=await this.props.oContext.socket.getCurrentInstance();this.setState({requesting:!0},async()=>{const t=await this.props.oContext.socket.sendTo(e,"checkDocker",null);this.setState({requesting:!1,version:(t==null?void 0:t.version)||"",errorDocker:t?t.daemonRunning?"":P.I18n.t("ra_Docker is not installed or not running"):P.I18n.t("ra_No response from admin")})})}renderItem(e,t){const n=V.getValue(this.props.data,this.props.attr);return this.state.requesting?$.createElement(Tt,null):this.state.errorDocker&&!n?$.createElement(ge,{style:{color:"orange"}},P.I18n.t("ra_Docker is not available"),": ",P.I18n.t(`ra_${this.state.errorDocker}`).replace(/^ra_/,"")):$.createElement(fe,{style:{width:"100%"},variant:"standard"},$.createElement(Xn,{onClick:h=>{if(h.preventDefault(),h.stopPropagation(),!t){const i=this.onChange(this.props.attr,!n);i instanceof Promise&&i.catch(s=>console.error(`Cannot set value: ${s}`))}},control:$.createElement(Zt,{checked:!!n,onChange:h=>{this.onChange(this.props.attr,h.target.checked)},disabled:t||!!this.state.errorDocker&&!n}),label:this.getText(this.props.schema.label)}),this.props.schema.hideVersion?null:$.createElement(ge,null,this.state.errorDocker?this.state.errorDocker:this.state.version),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const ps="system.credentials.";function zr(m,e,t){return $.createElement("span",{style:{display:"flex",alignItems:"center",gap:8}},m!=null&&m.icon?$.createElement(P.Icon,{src:m.icon,style:{width:20,height:20}}):t?$.createElement("span",{style:{width:20,height:20,flexShrink:0}}):null,e)}class Zs extends V{async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr);let t=[];try{const n=await this.props.oContext.socket.getObjectViewSystem("config",ps,`${ps}香`);t=Object.values(n).filter(h=>{var i;return!!h&&(!this.props.schema.credentialType||((i=h.native)==null?void 0:i.type)===this.props.schema.credentialType)}).map(h=>{var i;return{label:Zs.getCredentialName(h),value:h._id,icon:typeof((i=h.common)==null?void 0:i.icon)=="string"?h.common.icon:void 0}}).sort((h,i)=>h.label.localeCompare(i.label))}catch(n){console.error(`Cannot read credentials: ${n}`)}t.unshift({label:P.I18n.t(V.NONE_LABEL),value:V.NONE_VALUE}),this.setState({value:e,selectOptions:t})}static getCredentialName(e){var h;const t=(h=e.common)==null?void 0:h.name;let n;return t&&typeof t=="object"?n=t[P.I18n.getLanguage()]||t.en||Object.values(t)[0]||"":n=t||"",n||e._id.substring(ps.length)}renderItem(e,t){var s,d;if(!this.state.selectOptions)return null;const n=(s=this.state.selectOptions)==null?void 0:s.find(o=>o.value===this.state.value),h=this.state.value&&this.state.value!==V.NONE_VALUE&&!n?this.state.value:null,i=this.state.selectOptions.some(o=>!!o.icon);return $.createElement(fe,{style:{width:"100%"},variant:"standard"},this.props.schema.label?$.createElement(_e,{shrink:!0},this.getText(this.props.schema.label)):null,$.createElement(Ne,{variant:"standard",error:!!e||!!h,displayEmpty:!0,disabled:!!t,value:this.state.value||V.NONE_VALUE,renderValue:()=>h||zr(n,this.getText(n==null?void 0:n.label,this.props.schema.noTranslation!==!1),i),onChange:o=>this.setState({value:o.target.value===V.NONE_VALUE?"":o.target.value},()=>this.onChange(this.props.attr,this.state.value))},(d=this.state.selectOptions)==null?void 0:d.map(o=>$.createElement($e,{key:o.value,value:o.value,style:o.value===V.NONE_VALUE?{opacity:.5}:{}},zr(o,this.getText(o.label,this.props.schema.noTranslation!==!1),i)))),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Ke={fullWidth:{width:"100%"},licLabel:{fontWeight:"bold",minWidth:100,marginRight:10,textTransform:"capitalize",display:"inline-block"},errorTitle:m=>({color:m.palette.mode==="dark"?"#e39191":"#b62020"}),okTitle:m=>({color:m.palette.mode==="dark"?"#6fd56f":"#007c00"}),errorText:m=>({color:m.palette.mode==="dark"?"#e39191":"#b62020",mb:"30px"})};class $t extends V{async componentDidMount(){await super.componentDidMount(),this.setState({_error:"",running:!1,showLicenseData:null,foundSuitableLicense:!1,licenseOfflineCheck:!1,result:null,allLicenses:null,askForUpdate:!1,showLinkToProfile:!1})}renderErrorDialog(){if(this.state._error&&!this.state.showLicenseData){let e=this.state._error;return this.state.allLicenses&&(e=[$.createElement("div",{key:"error"},e)],e.push($.createElement(ve,{key:"button",variant:"contained",onClick:()=>window.open("https://iobroker.net/www/account/licenses","_blank")},P.I18n.t("iobroker.net"))),this.state.allLicenses.length?e.push($.createElement(_o,{key:"table"},$.createElement(On,{size:"small"},$.createElement(ko,null,$.createElement(ct,null,$.createElement(Ee,null,P.I18n.t("ra_Product")),$.createElement(Ee,null,P.I18n.t("ra_Version")),$.createElement(Ee,null,"UUID"),$.createElement(Ee,null,P.I18n.t("ra_ValidTill")),$.createElement(Ee,null,P.I18n.t("ra_Commercial")),$.createElement(Ee,null,"ID"))),$.createElement(Fn,null,this.state.allLicenses.map(t=>$.createElement(ct,{key:t.id},$.createElement(Ee,{sx:t.validName?null:Ke.errorText},t.license.product),$.createElement(Ee,{sx:t.validVersion?null:Ke.errorText},t.license.version),$.createElement(Ee,{sx:t.validUuid?null:Ke.errorText},t.license.uuid||"--"),$.createElement(Ee,{sx:t.validTill?null:Ke.errorText},t.license.validTill&&t.license.validTill!=="0000-00-00 00:00:00"?new Date(t.license.validTill).toLocaleDateString():"--"),$.createElement(Ee,null,t.license.invoice!=="free"?t.license.invoice==="MANUALLY_CREATED"?"✓":t.license.invoice:"-"),$.createElement(Ee,null,t.id))))))):(e.push($.createElement("div",{key:"text1"},P.I18n.t("ra_No one license found in license manager"))),e.push($.createElement("div",{key:"text2"},P.I18n.t("ra_Please create license"))))),$.createElement(Lt,{open:!0,maxWidth:"xl",fullWidth:this.props.fullWidth!==void 0?this.props.fullWidth:!0,onClick:()=>this.setState({_error:"",allLicenses:null})},$.createElement(yn,null,P.I18n.t("ra_Error")),$.createElement(Kt,null,$.createElement(ec,null,e)),$.createElement(Gt,null,$.createElement(ve,{variant:"contained",onClick:()=>this.setState({_error:"",allLicenses:null}),color:"primary",autoFocus:!0,startIcon:$.createElement(Gs,null)},P.I18n.t("ra_Ok"))))}return null}renderMessageDialog(){if(this.state.showLicenseData){const e=[],t=this.state.showLicenseData;return Object.keys(t).forEach(n=>{if(!(t[n]===null||t[n]===void 0))if(typeof t[n]=="object"){const h=t[n];Object.keys(h).forEach(i=>{h[i]!==null&&h[i]!==void 0&&(typeof h[i]=="object"?e.push($.createElement("div",{key:i},$.createElement("div",{style:Ke.licLabel},i,":"),JSON.stringify(h[i],null,2))):e.push($.createElement("div",{key:i},$.createElement("div",{style:Ke.licLabel},n," -",i,":"),h[i].toString())))})}else e.push($.createElement("div",{key:n},$.createElement("div",{style:Ke.licLabel},n.replace(/_/g," "),":"),t[n].toString()))}),e.push($.createElement("div",{key:"checked"},$.createElement("div",{style:Ke.licLabel},P.I18n.t("ra_Checked"),":"),this.state.licenseOfflineCheck?P.I18n.t("ra_locally"):P.I18n.t("ra_via internet"))),$.createElement(Lt,{open:!0,onClose:()=>this.setState({showLicenseData:null})},$.createElement(yn,null,$.createElement(Ie,{component:"span",sx:this.state.result?Ke.okTitle:Ke.errorTitle},P.I18n.t("ra_License %s",this.state.result?"OK":"INVALID"))),$.createElement(Kt,null,this.state.showLinkToProfile?$.createElement(ve,{variant:"contained",onClick:()=>window.open("https://iobroker.net/www/account/licenses","_blank")},"https://iobroker.net"):null,this.state._error?$.createElement(Ie,{component:"div",sx:Ke.errorText},this.state._error):null,e),$.createElement(Gt,null,$.createElement(ve,{onClick:()=>this.setState({showLicenseData:null,_error:""}),color:"primary",variant:"contained"},P.I18n.t("ra_Close"))))}return null}static parseJwt(e){const n=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),h=decodeURIComponent(atob(n).split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));try{return JSON.parse(h)}catch{return null}}static isVersionValid(e,t,n,h){if(!t||!e)return!0;let i=!0;const[s]=e.split(".");return t.startsWith(">=")?i=parseInt(s,10)>=parseInt(t.substring(2,10)):t.startsWith("<=")?i=parseInt(s,10)<=parseInt(t.substring(2,10)):t.startsWith(">")?i=parseInt(s,10)>parseInt(t.substring(1,10)):t.startsWith("<")?i=parseInt(s,10)<parseInt(t.substring(1,10)):t.startsWith("=")?i=parseInt(s,10)===parseInt(t.substring(1,10)):t.startsWith("==")?i=parseInt(s,10)===parseInt(t.substring(2,10)):t.startsWith("===")&&(i=parseInt(s,10)===parseInt(t.substring(3,10))),!0}async findInLicenseManager(e){var h,i,s,d;const t=await this.getCachedObject("system.licenses"),n=[];if((i=(h=t==null?void 0:t.native)==null?void 0:h.licenses)!=null&&i.length){let o=null;const l=Date.now();let r;if(this.props.schema.uuid){const c=await this.getCachedObject("system.meta.uuid");r=(s=c==null?void 0:c.native)==null?void 0:s.uuid}let a;if(this.props.schema.version){const c=await this.getCachedObject(`system.adapter.${e}`);a=(d=c==null?void 0:c.common)==null?void 0:d.version}t.native.licenses.forEach(c=>{const p=!c.validTill||c.validTill==="0000-00-00 00:00:00"||new Date(c.validTill).getTime()>l,u=(c.product||"").split("."),f=u[1]===e||e==="vis-2"&&u[1]==="vis",g=!r||!c.uuid||c.uuid===r,v=$t.isVersionValid(a,c.version,c.invoice,e);(!o||c.invoice!=="free")&&p&&f&&g&&v&&(o=c),n.push({id:c.id,validName:f,validUuid:g,validVersion:v,validTill:p,license:c})}),o&&(n.find(c=>c.id===o.id).used=!0)}return n}async checkLicense(e,t){var d,o,l;let n;if(this.props.schema.uuid){const r=await this.getCachedObject("system.meta.uuid");n=(d=r==null?void 0:r.native)==null?void 0:d.uuid}let h;if(this.props.schema.version){const r=await this.getCachedObject(`system.adapter.${t}`);h=(o=r==null?void 0:r.common)==null?void 0:o.version}const i=new AbortController;let s=setTimeout(()=>{s=null,i.abort()},5e3);try{const r=await window.fetch("https://iobroker.net/api/v1/public/cert/",{method:"POST",body:JSON.stringify({json:e,uuid:n}),headers:{"Content-Type":"text/plain"},signal:i.signal});s&&clearTimeout(s);const a=await r.text();let c;try{c=JSON.parse(a)}catch{}if(c!=null&&c.error)try{const p=$t.parseJwt(e),u=P.I18n.t(`ra_${p.error||c.error||"Unknown error"}`).replace(/^ra_/,"");return this.setState({_error:u,licenseOfflineCheck:!1,showLicenseData:p,result:!1,running:!1})}catch{return console.log("Cannot parse license"),this.setState({_error:c.error,result:!1,running:!1})}else{let p=null;try{p=$t.parseJwt(e)}catch{}if(c){const u=c.validTill||c.valid_till;if(u&&u!=="0000-00-00 00:00:00"&&new Date(u).getTime()<Date.now())return this.setState({_error:P.I18n.t("ra_License expired on %s",new Date(u).toLocaleString()),licenseOfflineCheck:!1,showLicenseData:p,result:!1,running:!1});const f=(c.name||"").split(".");return f[1]===t||f[1]==="vis"&&t==="vis-2"?n&&!c.uuid&&t==="vis-2"?this.setState({_error:P.I18n.t("ra_License must be converted",c.uuid),showLinkToProfile:!0,licenseOfflineCheck:!1,showLicenseData:p,result:!1,running:!1}):n&&c.uuid&&c.uuid!==n?this.setState({_error:P.I18n.t('ra_Serial number (UUID) "%s" in license is for other device.',c.uuid),licenseOfflineCheck:!1,showLicenseData:p,result:!1,running:!1}):$t.isVersionValid(h,c.version,c.invoice,t)?this.setState({licenseOfflineCheck:!1,showLicenseData:p,result:!0,running:!1}):this.setState({_error:P.I18n.t("ra_License is for version %s, but required version is %s",c.version,this.props.schema.version),licenseOfflineCheck:!1,showLicenseData:p,result:!1,running:!1}):this.setState({_error:P.I18n.t('ra_License for other product "%s"',c.name),licenseOfflineCheck:!1,showLicenseData:p,result:!1,running:!1})}throw new Error("ra_Invalid answer from server")}}catch(r){if(((l=r==null?void 0:r.response)==null?void 0:l.status)===404)return this.setState({_error:P.I18n.t("ra_License does not exist"),result:!1,running:!1});try{const a=$t.parseJwt(e),c=(a.name||"").split(".");return a.valid_till&&a.valid_till!=="0000-00-00 00:00:00"&&new Date(a.valid_till).getTime()<Date.now()?this.setState({_error:P.I18n.t("ra_License expired on %s",new Date(a.valid_till).toLocaleString()),showLicenseData:a,licenseOfflineCheck:!0,running:!1,result:!1}):c[1]===t?n&&a.uuid&&a.uuid!==n?this.setState({_error:P.I18n.t('ra_Serial number (UUID) "%s" in license is for other device.',a.uuid),showLicenseData:a,licenseOfflineCheck:!0,result:!1,running:!1}):$t.isVersionValid(h,a.version,a.invoice,t)?this.setState({running:!1,result:!0,licenseOfflineCheck:!0,showLicenseData:a}):this.setState({_error:P.I18n.t("ra_License is for version %s, but required version is %s",a.version,this.props.schema.version),licenseOfflineCheck:!0,showLicenseData:a,result:!1,running:!1}):this.setState({_error:P.I18n.t('ra_License for other product "%s"',a.name),licenseOfflineCheck:!0,showLicenseData:a,result:!1,running:!1})}catch{return this.setState({_error:P.I18n.t("ra_Cannot decode license"),result:!1,licenseOfflineCheck:!0,running:!1})}}}renderAskForUpdate(){return this.state.askForUpdate?$.createElement(P.DialogConfirm,{text:P.I18n.t("ra_License not found in license manager. Do you want to read licenses from iobroker.net?"),ok:P.I18n.t("ra_Yes"),onClose:async e=>{if(e){this.setState({askForUpdate:!1});try{await this.props.oContext.socket.updateLicenses(null,null)}catch(t){window.alert(P.I18n.t("ra_Cannot read licenses: %s",t));return}await this._onClick(!0)}else this.setState({askForUpdate:!1,running:!1})}}):null}async _onClick(e){const t=this.props.oContext.adapterName==="vis-2"?"vis":this.props.oContext.adapterName;this.setState({running:!0});let n,h;if(this.props.data.useLicenseManager){if(h=await this.findInLicenseManager(t),n=h.find(i=>i.used),n&&(n=n.license.json),!n&&!e){this.setState({askForUpdate:!0});return}}else n=this.props.data.license;n?await this.checkLicense(n,t):this.props.data.useLicenseManager?this.setState({_error:P.I18n.t("ra_Suitable license not found in license manager"),result:!1,running:!1,allLicenses:h}):this.setState({_error:P.I18n.t("ra_Please enter the license"),result:!1,running:!1})}renderItem(){return $.createElement("div",{style:Ke.fullWidth},$.createElement(ve,{variant:this.props.schema.variant||"outlined",color:this.props.schema.color||"primary",style:Ke.fullWidth,disabled:!this.props.data.license&&!this.props.data.useLicenseManager||this.state.running,startIcon:$.createElement(Io,null),onClick:()=>this._onClick()},this.state.running?$.createElement(Tt,{size:20,style:{marginRight:8}}):null,this.getText(this.props.schema.label||"ra_Check license",this.props.schema.noTranslation)),this.renderMessageDialog(),this.renderErrorDialog(),this.renderAskForUpdate())}}class Lh extends V{renderItem(e,t){const n=V.getValue(this.props.data,this.props.attr),h=Array.isArray(n);return $.createElement(fe,{style:{width:"100%"},variant:"standard"},$.createElement(Xn,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),!t){const s=this.onChange(this.props.attr,!n);s instanceof Promise&&s.catch(d=>console.error(`Cannot set value: ${d}`))}},control:$.createElement(Zt,{indeterminate:h,checked:!!n,onChange:i=>{let s;h?s=this.onChange(this.props.attr,!0):s=this.onChange(this.props.attr,i.target.checked),s instanceof Promise&&s.catch(d=>console.error(`Cannot set value: ${d}`))},disabled:t||this.props.schema.readOnly}),label:this.getText(this.props.schema.label)}),$.createElement(ge,{style:{color:"red"}},e?this.props.schema.validatorErrorText?P.I18n.t(this.props.schema.validatorErrorText):P.I18n.t("ra_Error"):null),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Mh={standard:ic,filled:nc,outlined:tc},Ih=m=>{const e=m.palette.mode==="light",t=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return{root:{},inputRoot:{display:"inline-flex",flexWrap:"wrap",flex:1,marginTop:0,minWidth:70,"&.mui-variant-outlined,&.mui-variant-filled":{boxSizing:"border-box"},"&.mui-variant-outlined":{paddingTop:"14px"},"&.mui-variant-filled":{paddingTop:"28px"}},input:{display:"inline-block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",appearance:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",float:"left",flex:1},chipContainer:{display:"flex",flexFlow:"row wrap",alignItems:"center",cursor:"text",marginBottom:"-2px",minHeight:40},outlined:{"& input":{height:16,paddingTop:"4px",paddingBottom:"12px",marginTop:"4px",marginBottom:"4px"}},standard:{marginTop:"18px"},filled:{"& input":{height:22,marginBottom:"4px",marginTop:"4px",paddingTop:0},"$marginDense & input":{height:26}},labeled:{},label:{top:4,"&$outlined&:not($labelShrink)":{top:2,"$marginDense &":{top:5}},"&$filled&:not($labelShrink)":{top:15,"$marginDense &":{top:20}}},labelShrink:{top:0},helperText:{marginBottom:-20},focused:{},disabled:{},underline:{"&:after":{borderBottom:`2px solid ${m.palette.primary[e?"dark":"light"]}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:m.transitions.create("transform",{duration:m.transitions.duration.shorter,easing:m.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:m.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:m.transitions.create("border-bottom-color",{duration:m.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:not($disabled):not($focused):not($error):before":{borderBottom:`2px solid ${m.palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{"&:after":{backgroundColor:m.palette.error.main,transform:"scaleX(1)"}},chip:{margin:"0 8px 8px 0",float:"left"},marginDense:{}}},di={BACKSPACE:8,DELETE:46,LEFT_ARROW:37,RIGHT_ARROW:39},Oh=({value:m,isFocused:e,isDisabled:t,isReadOnly:n,handleClick:h,handleDelete:i,style:s},d)=>$.createElement(Vs,{key:d,style:{...s,pointerEvents:t||n?"none":void 0,backgroundColor:e?Xc[300]:void 0},onClick:h,onDelete:i,label:m});class Fh extends $.Component{labelRef;labelNode=null;input;newChipKeyCodes;newChipKeys;actualInput=null;inputBlurTimeout=null;_keyPressed;_preventChipCreation;styles={};styleTheme=null;constructor(e){super(e),this.state={chips:e.defaultValue||[],focusedChip:null,inputValue:"",isFocused:!1,chipsUpdated:!1,prevPropsValue:[],variant:this.props.variant||"standard"},this.newChipKeyCodes=e.newChipKeyCodes||[13],this.newChipKeys=e.newChipKeys||["Enter"],this.labelRef=$.createRef(),this.input=$.createRef()}componentDidMount(){this.state.variant==="outlined"&&(this.labelNode=Qc.findDOMNode(this.labelRef.current),this.forceUpdate())}componentWillUnmount(){this.inputBlurTimeout&&clearTimeout(this.inputBlurTimeout)}static getDerivedStateFromProps(e,t){let n=null;return e.value&&e.value.length!==t.prevPropsValue.length&&(n={prevPropsValue:e.value},e.clearInputValueOnChange&&(n.inputValue="")),e.clearInputValueOnChange&&e.value&&e.value.length!==t.prevPropsValue.length&&(n={prevPropsValue:e.value,inputValue:""}),e.disabled&&(n={...n,focusedChip:null}),!t.chipsUpdated&&e.defaultValue&&(n={...n,chips:e.defaultValue}),n}focus=()=>{var e;(e=this.actualInput)==null||e.focus(),this.state.focusedChip&&this.setState({focusedChip:null})};handleInputBlur=e=>{this.props.onBlur&&this.props.onBlur(e),this.setState({isFocused:!1}),this.state.focusedChip&&this.setState({focusedChip:null});const t=e.target.value;let n;switch(this.props.blurBehavior||"clear"){case"add-or-clear":n={clearInputOnFail:!0};case"add":if(this.props.delayBeforeAdd){const h=(this.props.value||this.state.chips).length;this.inputBlurTimeout=setTimeout(()=>{const i=(this.props.value||this.state.chips).length;h===i?this.handleAddChip(t,n):this.clearInput()},150)}else this.handleAddChip(t,n);break;case"clear":this.clearInput();break}};handleInputFocus=e=>{var t,n;this.setState({isFocused:!0}),(n=(t=this.props).onFocus)==null||n.call(t,e)};handleKeyDown=e=>{const{focusedChip:t}=this.state;if(this._keyPressed=!1,this._preventChipCreation=!1,this.props.onKeyDown&&(this.props.onKeyDown(e),e.isDefaultPrevented()))return;const n=this.props.value||this.state.chips;if(this.newChipKeyCodes.includes(e.keyCode)||this.newChipKeys.includes(e.key)){this.handleAddChip(e.target.value)!==!1&&e.preventDefault();return}switch(e.keyCode){case di.BACKSPACE:e.target.value===""&&(t?(this.handleDeleteChip(n[t],t),t&&this.setState({focusedChip:t-1})):this.setState({focusedChip:n.length-1}));break;case di.DELETE:e.target.value===""&&t&&(this.handleDeleteChip(n[t],t),t<=n.length-1&&this.setState({focusedChip:t}));break;case di.LEFT_ARROW:t===null&&e.target.value===""&&n.length?this.setState({focusedChip:n.length-1}):t!==null&&t>0&&this.setState({focusedChip:t-1});break;case di.RIGHT_ARROW:t!==null&&t<n.length-1?this.setState({focusedChip:t+1}):this.setState({focusedChip:null});break;default:this.setState({focusedChip:null});break}};handleKeyUp=e=>{!this._preventChipCreation&&(this.newChipKeyCodes.includes(e.keyCode)||this.newChipKeys.includes(e.key))&&this._keyPressed?this.clearInput():this.updateInput(e.target.value),this.props.onKeyUp&&this.props.onKeyUp(e)};handleUpdateInput=e=>{(this.props.inputValue===null||this.props.inputValue===void 0)&&this.updateInput(e.target.value),this.props.onUpdateInput&&this.props.onUpdateInput(e)};handleAddChip(e,t){if(this.props.onBeforeAdd&&!this.props.onBeforeAdd(e))return this._preventChipCreation=!0,t&&t.clearInputOnFail&&this.clearInput(),!1;this.clearInput();const n=this.props.value||this.state.chips;return e.trim().length?((this.props.allowDuplicates||!n.includes(e))&&(this.props.value&&this.props.onAdd?this.props.onAdd(e):this.updateChips([...this.state.chips,e])),!0):!1}handleDeleteChip(e,t){if(this.props.value)this.props.onDelete&&this.props.onDelete(e,t);else{const n=this.state.chips.slice();if(n.splice(t,1)){let i=this.state.focusedChip;this.state.focusedChip===t?i=null:this.state.focusedChip!==null&&this.state.focusedChip>t&&(i=this.state.focusedChip-1),this.updateChips(n,{focusedChip:i})}}}updateChips(e,t={}){this.setState({chips:e,chipsUpdated:!0,...t}),this.props.onChange&&this.props.onChange(e)}clearInput(){this.updateInput("")}updateInput(e){this.setState({inputValue:e})}setActualInputRef=e=>{this.actualInput=e,this.props.inputRef&&this.props.inputRef(e)};render(){const{alwaysShowPlaceholder:e,chipRenderer:t=Oh,className:n,disabled:h,disableUnderline:i,error:s,FormHelperTextProps:d,fullWidth:o,fullWidthInput:l,helperText:r,id:a,InputProps:c={},InputLabelProps:p={},inputValue:u,label:f,placeholder:g,readOnly:v,required:b,rootRef:D,value:E,margin:w}=this.props,y=this.state.variant;this.styleTheme!==this.props.theme.palette.mode&&(this.styleTheme=this.props.theme.palette.mode,this.styles=P.Utils.getStyle(this.props.theme,Ih));let A=E||this.state.chips||[];Array.isArray(A)||(A=(A||"").toString().split(/[,\s]+/).map(S=>S.trim()));const T=u??this.state.inputValue,x=(this.props.value||T).length||T.length,M=typeof p.shrink=="boolean"?p.shrink:f!==null&&(x||this.state.isFocused||A.length),O=A.map((S,C)=>t({value:S,isDisabled:!!h,isReadOnly:!!v,isFocused:this.state.focusedChip===C,handleClick:()=>this.setState({focusedChip:C}),handleDelete:()=>this.handleDeleteChip(S,C),style:this.styles.chip},C.toString())),_={};y==="outlined"&&(_.notched=!!M,_.labelWidth=M&&this.labelNode&&this.labelNode.offsetWidth||0),y!=="standard"?_.startAdornment=O:c.disableUnderline=!0;const k=Mh[y];return $.createElement(fe,{ref:D,fullWidth:o,className:n,sx:{...this.styles.root,...w==="dense"?this.styles.marginDense:{}},error:s,required:A.length>0?void 0:b,onClick:this.focus,disabled:h,variant:y,component:"div",margin:w},f&&$.createElement(_e,{htmlFor:a,sx:{"&.MuiInputLabel-root":this.styles.label,"&.MuiInputLabel-shrink":this.styles.labelShrink},shrink:!!M,focused:this.state.isFocused,variant:y,ref:this.labelRef,required:b,component:"label",...p},f),$.createElement(Ie,{component:"div",id:"input-chip-container",sx:{...this.styles[y],...this.styles.chipContainer,...this.state.isFocused?this.styles.focused:void 0,...!i&&y==="standard"?this.styles.underline:void 0,...h?this.styles.disabled:void 0,...f?this.styles.labeled:void 0,...s?this.styles.error:void 0}},y==="standard"&&O,$.createElement(k,{ref:this.input,className:`mui-variant-${this.styles[y]} ${f?"mui-chip-with-label":"mui-chip-no-label"}`,sx:{"&.MuiInputBase-input":{...this.styles.input,...this.styles[y]},"&.MuiInputBase-root":{...this.styles.inputRoot}},id:a,value:T,onChange:this.handleUpdateInput,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,inputRef:this.setActualInputRef,disabled:h,fullWidth:l,placeholder:!x&&(M||f===null||f===void 0)||e?g:void 0,readOnly:v,...c,..._})),r&&$.createElement(ge,{...d,className:d==null?void 0:d.className,style:this.styles.helperText},r))}}class Vr extends V{async componentDidMount(){await super.componentDidMount();const{data:e,attr:t}=this.props,n=V.getValue(e,t);if(this.props.schema.delimiter&&typeof n=="string"){const h=n.split(this.props.schema.delimiter).map(i=>i.trim()).filter(i=>i);this.setState({value:h})}else this.setState({value:n||[]})}renderItem(e,t){const{attr:n,schema:h}=this.props,{value:i}=this.state;return $.createElement(fe,{fullWidth:!0,variant:"standard"},$.createElement(Fh,{value:i,disabled:!!t,label:this.getText(h.label),error:!!e,onAdd:s=>{const d=JSON.parse(JSON.stringify(i));d.push(s),this.setState({value:d},()=>{let o;this.props.schema.delimiter?o=this.onChange(n,d.join(`${this.props.schema.delimiter} `)):o=this.onChange(n,d),o instanceof Promise&&o.catch(l=>console.error(l))})},theme:this.props.oContext.theme,onDelete:(s,d)=>{const o=JSON.parse(JSON.stringify(i));o.splice(d,1),this.setState({value:o},()=>{let l;this.props.schema.delimiter?l=this.onChange(n,o.join(`${this.props.schema.delimiter} `)):l=this.onChange(n,o),l instanceof Promise&&l.catch(r=>console.error(r))})}}),$.createElement(ge,null,P.I18n.t("ra_Press ENTER Key to add new item")),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Rh extends V{renderColorDialog(){return!!this.state.showColorDialog&&$.createElement(Lt,{onClose:()=>this.setState({showColorDialog:!1}),open:this.state.showColorDialog},$.createElement(Zc,{color:this.state.colorDialogValue,onChange:e=>this.setState({colorDialogValue:e.hex},()=>this.onChange(this.props.attr,this.state.colorDialogValue))}))}renderItem(e,t){const n=V.getValue(this.props.data,this.props.attr);let h=P.Utils.isUseBright(n,null);return h===null&&(h=void 0),$.createElement($.Fragment,null,this.renderColorDialog(),$.createElement(pe,{variant:"standard",disabled:!!t,style:{minWidth:100,width:"calc(100% - 8px)"},label:this.getText(this.props.schema.label),value:n||"",onClick:()=>!this.props.schema.readOnly&&this.setState({showColorDialog:!0,colorDialogValue:n||""}),onChange:i=>{const s=i.target.value,d=this.onChange(this.props.attr,s);d instanceof Promise&&d.catch(o=>console.error(`Cannot set value: ${o}`))},slotProps:{htmlInput:{style:{backgroundColor:n,color:h?"#FFF":"#000"},readOnly:this.props.schema.readOnly||!1},input:{endAdornment:!this.props.schema.readOnly&&n&&!this.props.schema.noClearButton?$.createElement(se,{tabIndex:-1,size:"small",onClick:i=>{i.stopPropagation();const s=this.onChange(this.props.attr,"");s instanceof Promise&&s.catch(d=>console.error(`Cannot set value: ${d}`))}},$.createElement(ht,null)):void 0},inputLabel:{shrink:!0}}}))}}const ds={width:{width:"calc(100% - 85px)"},width50:{width:120,marginRight:5}};class Nh extends V{async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr);this.setState({value:e});const t={};this.props.schema.useSystemName&&(t.useSystem=!!V.getValue(this.props.data,this.props.schema.useSystemName)),this.props.schema.longitudeName&&this.props.schema.latitudeName?(t.longitude=V.getValue(this.props.data,this.props.schema.longitudeName),t.latitude=V.getValue(this.props.data,this.props.schema.latitudeName),!t.longitude&&!t.latitude&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300)):!V.getValue(this.props.data,this.props.attr)&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300),Object.keys(t).length&&setTimeout(()=>this.setState(t),50)}async getSystemCoordinates(){let e;try{this.props.oContext.socket.getCompactSystemConfig?e=await this.props.oContext.socket.getCompactSystemConfig():e=await this.getCachedObject("system.config")}catch(t){console.error(`Cannot get system configuration: ${t}`)}if(e!=null&&e.common&&(e.common.longitude||e.common.latitude))if(window.alert(P.I18n.t("ra_Used system settings")),this.props.schema.longitudeName&&this.props.schema.latitudeName)this.setState({longitude:e.common.longitude,latitude:e.common.latitude},async()=>{await this.onChange(this.props.schema.longitudeName,e.common.longitude),await this.onChange(this.props.schema.latitudeName,e.common.latitude)});else{const t=e.common.latitude+(this.props.schema.divider||",")+e.common.longitude;this.setState({value:t},()=>{const n=this.onChange(this.props.attr,t);n instanceof Promise&&n.catch(h=>console.error(`Cannot set value: ${h}`))})}else window.alert(P.I18n.t("ra_Cannot determine position: System settings are empty and GPS detection is disabled in browser"))}getCoordinates(){navigator.geolocation?navigator.geolocation.getCurrentPosition(async e=>{if(e!=null&&e.coords)if(this.props.schema.longitudeName&&this.props.schema.latitudeName)this.setState({longitude:e.coords.longitude,latitude:e.coords.latitude},async()=>{await this.onChange(this.props.schema.longitudeName,e.coords.longitude||""),await this.onChange(this.props.schema.latitudeName,e.coords.latitude||"")});else{const t=e.coords.latitude+(this.props.schema.divider||",")+e.coords.longitude;this.setState({value:t},()=>{const n=this.onChange(this.props.attr,t);n instanceof Promise&&n.catch(h=>console.error(`Cannot set value: ${h}`))})}else await this.getSystemCoordinates()},async e=>{console.error(`Cannot determine coordinates from browser: ${e.message}`),await this.getSystemCoordinates()}):this.getSystemCoordinates().catch(e=>{console.error(`Cannot determine coordinates: ${e}`)})}renderItem(e,t){return $.createElement($.Fragment,null,this.props.schema.useSystemName?$.createElement(Xn,{control:$.createElement(Zt,{checked:!!this.state.useSystem,onChange:n=>{const h=n.target.checked;h&&this.getSystemCoordinates().catch(i=>console.error(`Cannot determine coordinates: ${i}`)),this.setState({useSystem:h},()=>this.onChange(this.props.schema.useSystemName,h))}}),label:P.I18n.t("ra_Use system settings for position")}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?$.createElement(pe,{variant:"standard",style:ds.width50,value:this.state.longitude??"",error:!!e,disabled:this.state.useSystem||!!t,onChange:n=>{const h=n.target.value;this.setState({longitude:h},()=>{const i=this.onChange(this.props.schema.longitudeName,(h||"").trim());i instanceof Promise&&i.catch(s=>console.error(`Cannot set value: ${s}`))})},label:P.I18n.t("ra_Longitude")}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?$.createElement(pe,{variant:"standard",style:ds.width50,value:this.state.latitude??"",error:!!e,disabled:this.state.useSystem||!!t,onChange:n=>{const h=n.target.value;this.setState({latitude:h},()=>this.onChange(this.props.schema.latitudeName,(h||"").trim()))},label:P.I18n.t("ra_Latitude")}):null,!this.props.schema.longitudeName||!this.props.schema.latitudeName?$.createElement(pe,{variant:"standard",style:ds.width,value:this.state.value??"",error:!!e,disabled:!!t,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.state.useSystem}},onChange:n=>{const h=n.target.value;this.setState({value:h},()=>this.onChange(this.props.attr,(h||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}):null,this.state.useSystem?null:$.createElement(Li,{size:"small",onClick:()=>this.getCoordinates(),title:P.I18n.t("ra_Take browser position"),style:{marginRight:4}},$.createElement(Dc,null)),this.state.useSystem?null:$.createElement(Li,{size:"small",onClick:()=>this.getSystemCoordinates(),title:P.I18n.t("ra_Take position from system settings")},$.createElement($c,null)))}}_s.init({name:"iobroker_admin",shared:{"@iobroker/adapter-react-v5":{lib:()=>Yc,version:"*"},"@mui/icons-material":{lib:()=>xc,version:"*"},"@iobroker/json-config":{lib:()=>th,version:"*"}},remotes:[]});class Kn extends V{static runningLoads={};constructor(e){super(e),Object.assign(this.state,{Component:null,error:""})}async componentDidMount(){if(!this.props.schema.url){console.error("URL is empty. Cannot load custom component!"),this.setState({error:"URL is empty. Cannot load custom component!"});return}let e;this.props.schema.url.startsWith("http:")||this.props.schema.url.startsWith("https:")?e=this.props.schema.url:this.props.schema.url.startsWith("./")?e=`${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\./,"")}`:e=`${window.location.protocol}//${window.location.host}/adapter/${this.props.oContext.adapterName}/${this.props.schema.url}`;const[t,n,...h]=this.props.schema.name.split("/"),i=h.join("/");if(!e){console.error('Cannot find URL for custom component! Please define "url" as "custom/customComponents.js" in the schema');return}if(!t||!n||!i){console.error('Invalid format of "name"! Please define "name" as "ConfigCustomBackItUpSet/Components/AdapterExist" in the schema');return}let s=Kn.runningLoads[`${e}!${n}`];if(!(s instanceof Promise)){let d;if(this.props.schema.i18n===!0){const o=e.lastIndexOf("/");let l;o!==-1?l=e.substring(0,o):l=e;const r=P.I18n.getLanguage(),a=`${l}/i18n/${r}.json`;d=fetch(a).then(c=>c.json()).then(c=>P.I18n.extendTranslations(c,r)).catch(c=>{if(r!=="en"){fetch(`${l}/i18n/en.json`).then(p=>p.json()).then(p=>P.I18n.extendTranslations(p,r)).catch(p=>console.log(`Cannot load i18n "${a}": ${p}`));return}console.log(`Cannot load i18n "${a}": ${c}`)})}else if(this.props.schema.i18n&&typeof this.props.schema.i18n=="object")try{P.I18n.extendTranslations(this.props.schema.i18n)}catch(o){console.error(`Cannot import i18n: ${o}`)}try{console.log(e,t,n,i),_s.registerRemotes([{name:t,entry:e,type:this.props.schema.bundlerType||void 0}]),s=_s.loadRemote(`${t}/${n}`),d instanceof Promise&&(s=Promise.all([s,d]).then(o=>o[0])),Kn.runningLoads[`${e}!${n}`]=s}catch(o){console.error(o),this.setState({error:`Cannot import from ${this.props.schema.url}: ${o}`})}}try{const d=(await s).default;if(d!=null&&d[i])this.setState({Component:d[i]});else{const o=Object.keys(d||{});console.error("URL is empty. Cannot load custom component!"),this.setState({error:`Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${o.join(", ")}`})}}catch(d){console.error(d),this.setState({error:`Cannot import from ${this.props.schema.url}: ${d}`})}}render(){const e=this.state.Component,t=this.props.schema||{},n=e?$.createElement(e,{...this.props,socket:this.props.oContext.socket,theme:this.props.oContext.theme,themeType:this.props.oContext.themeType,instance:this.props.oContext.instance,adapterName:this.props.oContext.adapterName,systemConfig:this.props.oContext.systemConfig,forceUpdate:this.props.oContext.forceUpdate}):this.state.error?$.createElement("div",null,this.state.error):$.createElement(ji,null);return t.newLine?$.createElement($.Fragment,null,$.createElement("div",{style:{flexBasis:"100%",height:0}}),n):n}}class Bh extends V{async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr);if(e)try{const t=new Date(e);this.setState({value:t})}catch{}}renderItem(e,t){return $.createElement(qc,{sx:n=>({width:"100%",borderBottom:`1px solid ${e?"#F00":n.palette.text.primary}`,"& fieldset":{display:"none"},"& input":{padding:`${n.spacing(1.5)} 0 4px 0`},"& .MuiInputAdornment-root":{marginLeft:0,marginTop:1},"& label":{transform:"translate(0px, -9px) scale(0.75)"}}),format:this.props.oContext.systemConfig.dateFormat.toLowerCase().replace("mm","MM"),disabled:!!t,value:this.state.value||null,onChange:n=>this.setState({value:n},()=>{try{const h=this.state.value.toISOString();this.onChange(this.props.attr,h).catch(i=>console.warn(`Error saving value for ${this.props.attr}:`,i))}catch{}}),label:this.getText(this.props.schema.label)})}}class Ph extends V{renderItem(){if(!this.props.schema)return null;if(this.props.oContext.DeviceManager){const t=this.props.oContext.DeviceManager;return $.createElement(t,{uploadImagesToInstance:`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,title:this.getText(this.props.schema.label),socket:this.props.oContext.socket,selectedInstance:`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,themeName:this.props.themeName,theme:this.props.oContext.theme,themeType:this.props.oContext.themeType,isFloatComma:this.props.oContext.isFloatComma,dateFormat:this.props.oContext.dateFormat,smallCards:this.props.schema.smallCards})}return $.createElement("div",null,"DeviceManager not found")}}const nt={fullWidth:{width:"100%"},uploadDiv:{position:"relative",width:"100%"},uploadDivDragging:{opacity:1,background:"rgba(128,255,128,0.1)"},uploadCenterDiv:{margin:5,border:"3px dashed grey",borderRadius:5,width:"100%",height:"100%",position:"absolute",display:"flex"},uploadCenterIcon:{paddingTop:10,width:48,height:48},uploadCenterText:{fontSize:16},uploadCenterTextAndIcon:{textAlign:"center",position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},disabledOpacity:{opacity:.3,cursor:"default"},error:{border:"2px solid red"},deleteButton:{},selectedImage:{height:40,width:40,display:"inline-block",marginRight:8}},Wh=["jpg","jpeg","svg","png","webp","gif","apng","avif","webp"],jh=["mp3","ogg","wav","aac"],Hh=["avi","mp4","mov"],zh=["txt","log","html","htm"],Vh=["json","js","ts"];class Hi extends V{dropzoneRef;imagePrefix;objectID;path;constructor(e){super(e),this.dropzoneRef=$.createRef(),this.imagePrefix=this.props.oContext.imagePrefix??"./files"}async componentDidMount(){await super.componentDidMount(),this.objectID=(this.props.schema.objectID||"0_userdata.0").replace("%INSTANCE%",(this.props.oContext.instance||0).toString()),this.path=this.props.schema.upload,this.path&&(this.path==="/"?this.path="":this.path.endsWith("/")||(this.path=`${this.path}/`)),this.updateFiles().then(()=>{const e=V.getValue(this.props.data,this.props.attr);this.setState({value:e}),this.props.oContext.socket.subscribeFiles(this.objectID,`${this.path}/*`,this.onFolderChanged).catch(t=>console.error(`Cannot subscribe: ${t}`))})}onFolderChanged=(e,t)=>{this.path&&t.startsWith(this.path)&&this.updateFiles().catch(n=>console.error(`Cannot update files: ${n}`))};componentWillUnmount(){this.props.oContext.socket.subscribeFiles(this.objectID,`${this.path}/*`,this.onFolderChanged).catch(e=>console.error(`Cannot subscribe: ${e}`)),super.componentWillUnmount()}async updateFiles(){const e=await this.readFiles(this.props.schema.pattern);await new Promise(t=>this.setState({files:e},t))}async readFolder(e,t,n){try{const h=await this.props.oContext.socket.readDir(this.objectID,e.replace(/^\//,"")||null);for(let i=0;i<h.length;i++){const s=h[i];if(s.isDir)await this.readFolder(`${e+s.file}/`,t,n);else{let d=!1;n==="*.*"&&s.file.includes(".")||!n||n==="*"||n===".*"&&s.file.startsWith(".")?d=!0:d=new RegExp(`^${n.replace(/\./g,"\\.").replace(/\*/g,".*")}$`).test(s.file),d&&t.push({name:e+s.file,size:s.stats?P.Utils.formatBytes(s.stats.size):"--"})}}}catch(h){console.error(`Cannot read "${e}": ${h}`)}return t}async readFiles(e){const t=[];e=e||this.props.schema.pattern,e||(e="**/*.*");let n;const h=e.lastIndexOf("/");if(h===-1?n=e:n=e.substring(h+1),e.startsWith("**"))await this.readFolder("/",t,n);else{const i=e.lastIndexOf("/");if(i===-1)await this.readFolder("/",t,n);else{const s=e.substring(0,i+1);await this.readFolder(s,t,n)}}return t}onDrop(e){const t=e[0],n=new FileReader,h=this.props.schema.maxSize||2*1024*1024;n.onabort=()=>console.log("file reading was aborted"),n.onerror=()=>console.log("file reading has failed"),n.onload=()=>{if(t.size>h){window.alert(P.I18n.t("File is too big. Max %sk allowed. Try use SVG.",Math.round(h/1024)));return}this.props.oContext.socket.writeFile64(this.objectID,this.path+t.name,n.result).then(()=>this.updateFiles()).then(()=>this.setState({value:this.path+t.name},()=>this.onChange(this.props.attr,this.path+t.name))).catch(i=>window.alert(`Cannot upload file: ${i}`))},n.readAsArrayBuffer(t)}renderDeleteDialog(){return this.state.deleteFile?$.createElement(P.DialogConfirm,{title:P.I18n.t("ra_Are you sure?"),text:P.I18n.t("ra_File will be deleted"),ok:P.I18n.t("ra_Delete"),cancel:P.I18n.t("ra_Cancel"),onClose:e=>{const t=this.state.deleteFile;this.setState({deleteFile:""},()=>{e&&this.props.oContext.socket.deleteFile(this.objectID,t).then(()=>this.updateFiles()).catch(n=>window.alert(`Cannot delete file: ${n}`))})}}):null}static base64ToArrayBuffer(e){const t=window.atob(e),n=t.length,h=new Uint8Array(n);for(let i=0;i<n;i++)h[i]=t.charCodeAt(i);return h.buffer}loadFile(){return this.props.oContext.socket.readFile(this.objectID,this.state.value,!0)}play(){this.loadFile().then(e=>{if(typeof AudioContext<"u"){const t=new AudioContext,n=Hi.base64ToArrayBuffer(e.file);t.decodeAudioData(n,h=>{const i=t.createBufferSource();i.buffer=h,i.connect(t.destination),i.start(0)},h=>window.alert(`Cannot play: ${h.message}`))}})}getFileIcon(e){return e!=null&&e.extension?Wh.includes(e.extension)?$.createElement("div",{style:{...nt.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.objectID}/${e.value})`,backgroundSize:"contain",backgroundRepeat:"no-repeat"}}):jh.includes(e.extension)?$.createElement(_c,null):zh.includes(e.extension)?$.createElement(Wo,null):Hh.includes(e.extension)?$.createElement(jo,null):Vh.includes(e.extension)?$.createElement(Ho,null):null:null}renderItem(e,t){if(!this.state.files)return null;const n=[];this.props.schema.withFolder||this.state.files.forEach(r=>{const a=r.name.lastIndexOf("/");if(a===-1)n.includes("/")||n.push("/");else{const c=r.name.substring(0,a+1);n.includes(c)||n.push(c)}});const h=this.state.files.map(r=>({value:r.name,label:!this.props.schema.withFolder&&n.length===1?`${r.name.substring(n[0].length)}`:`${r.name}${this.props.schema.noSize?"":`(${r.size})`}`,extension:r.name.toLowerCase().split(".").pop()}));this.props.schema.noNone||h.unshift({label:P.I18n.t("ra_none"),value:""});const i=h.find(r=>r.value===this.state.value);let s=0;this.props.schema.upload&&s++,this.props.schema.refresh&&s++;const d=this.state.value&&(this.state.value.endsWith(".mp3")||this.state.value.endsWith(".ogg")||this.state.value.endsWith(".wav"));d&&s++;const o=$.createElement("div",{style:nt.fullWidth},$.createElement(fe,{variant:"standard",style:{width:`calc(100% - ${s*42}px)`}},this.props.schema.label?$.createElement(_e,null,this.getText(this.props.schema.label)):null,$.createElement(Ne,{variant:"standard",error:!!e,disabled:!!t,value:this.state.value||"_",renderValue:()=>$.createElement($.Fragment,null,this.getFileIcon(i),$.createElement("span",null,(i==null?void 0:i.label)||"")),onChange:r=>{this.setState({value:r.target.value==="_"?"":r.target.value},()=>this.onChange(this.props.attr,this.state.value))}},h.map(r=>$.createElement($e,{key:r.value,value:r.value},$.createElement(To,null,this.getFileIcon(r)),$.createElement(Us,null,r.label),this.props.schema.delete&&i.value?$.createElement(se,{style:nt.deleteButton,size:"small",onClick:()=>this.setState({deleteFile:i.value})},$.createElement(_t,null)):null))),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null),this.props.schema.refresh&&$.createElement(se,{onClick:()=>this.updateFiles()},$.createElement(Ks,null)),this.props.schema.upload&&$.createElement(se,{onClick:()=>{var r;return(r=this.dropzoneRef.current)==null?void 0:r.open()}},$.createElement(Vn,null)),d&&$.createElement(se,{style:{color:"#00FF00"},onClick:()=>this.play()},$.createElement(Js,null)));if(!this.props.schema.upload)return $.createElement($.Fragment,null,o,this.renderDeleteDialog());let l={"*/*":[]};if(this.props.schema.fileTypes==="image"?l={"image/*":[".png",".jpg",".svg",".gif",".apng",".avif",".webp"]}:this.props.schema.fileTypes==="audio"?l={"audio/*":[".mp3",".ogg",".wav",".mp4"]}:this.props.schema.fileTypes==="text"&&(l={"text/plain":[".txt"]}),this.props.schema.pattern){const r=this.props.schema.pattern.split("/").pop().toLowerCase().replace(/.*\./,"");r==="png"||r==="jpg"||r==="svg"||r==="gif"||r==="apng"||r==="avif"||r==="webp"?l={"image/*":[".png",".jpg",".svg",".gif",".apng",".avif",".webp"]}:r==="mp3"||r==="ogg"||r==="wav"?l={"audio/*":[".mp3",".ogg",".wav",".mp4"]}:r==="ics"?l={"text/calendar":[".ics"]}:r==="txt"?l={"text/plain":[".txt"]}:r==="pem"?l={"text/plain":[".pem"]}:l={"*/*":[`.${r}`]}}return $.createElement(Vo,{ref:this.dropzoneRef,multiple:!1,accept:l,noKeyboard:!0,noClick:!0,maxSize:this.props.schema.maxSize||2*1024*1024,onDragEnter:()=>{this.setState({uploadFile:"dragging"})},onDragLeave:()=>this.setState({uploadFile:!0}),onDrop:(r,a)=>{var c,p,u;this.setState({uploadFile:!1}),r.length?this.onDrop(r):window.alert(((u=(p=(c=a==null?void 0:a[0])==null?void 0:c.errors)==null?void 0:p[0])==null?void 0:u.message)||P.I18n.t("Cannot upload"))}},({getRootProps:r,getInputProps:a})=>$.createElement("div",{style:{...nt.uploadDiv,...this.state.uploadFile==="dragging"?nt.uploadDivDragging:void 0,...t?nt.disabledOpacity:void 0},...r()},$.createElement("input",{...a()}),this.state.uploadFile==="dragging"?$.createElement("div",{style:{...nt.uploadCenterDiv,...this.state.uploadError?nt.error:void 0}},$.createElement("div",{style:nt.uploadCenterTextAndIcon},$.createElement(Vn,{style:nt.uploadCenterIcon}),$.createElement("div",{style:nt.uploadCenterText},this.state.uploadFile==="dragging"?P.I18n.t("ra_Drop file here"):P.I18n.t("ra_Place your files here or click here to open the browse dialog")))):null,o,this.renderDeleteDialog()))}}const fi={fullWidth:{width:"100%"},fullWidthOneButton:{width:"calc(100% - 69px)",marginRight:4},fullWidthIcon:{width:"calc(100% - 119px)",marginRight:4},selectedImage:{height:40,width:40,display:"inline-block",marginRight:8}},Uh=["jpg","jpeg","svg","png","webp","gif","apng","avif","webp"],Kh=["mp3","ogg","wav","aac"],Gh=["avi","mp4","mov"],Jh=["txt","log","html","htm"],Yh=["json","js","ts"];class Qh extends V{imagePrefix="../..";async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr);this.imagePrefix=this.props.oContext.imagePrefix??"./files",this.setState({value:e??""})}static getDerivedStateFromProps(e,t){const n=V.getValue(e.data,e.attr);return n==null||n.toString().trim()!==(t.value||"").toString().trim()?{value:n??""}:null}loadFile(){const e=this.state.value.indexOf("/");if(e!==-1){const t=this.state.value.substring(0,e),n=this.state.value.substring(e+1);return this.props.oContext.socket.readFile(t,n,!0)}return Promise.resolve(null)}play(){this.loadFile().then(e=>{if(typeof AudioContext<"u"&&(e!=null&&e.file)){const t=new AudioContext,n=Hi.base64ToArrayBuffer(e.file);t.decodeAudioData(n,h=>{const i=t.createBufferSource();i.buffer=h,i.connect(t.destination),i.start(0)},h=>window.alert(`Cannot play: ${h.message}`))}})}getIcon(){const e=this.state.value.split(".").pop().toLowerCase();return Uh.includes(e)?$.createElement("div",{style:{...fi.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.state.value})`,backgroundSize:"contain",backgroundRepeat:"no-repeat"}}):Kh.includes(e)?$.createElement(se,{style:{color:"#00FF00"},onClick:()=>this.play()},$.createElement(Js,null)):Jh.includes(e)?$.createElement(Wo,null):Gh.includes(e)?$.createElement(jo,null):Yh.includes(e)?$.createElement(Ho,null):null}renderFileBrowser(){return this.state.showFileBrowser?$.createElement(P.DialogSelectFile,{imagePrefix:this.props.oContext.imagePrefix,socket:this.props.oContext.socket,selected:this.state.value,onClose:()=>this.setState({showFileBrowser:!1}),onOk:e=>{const t=Array.isArray(e)?e[0]:e;this.setState({value:t},()=>this.onChange(this.props.attr,this.props.schema.trim===!1?t:(t||"").trim()))},selectOnlyFolders:this.props.schema.selectOnlyFolders,allowUpload:this.props.schema.allowUpload,allowDownload:this.props.schema.allowDownload,allowCreateFolder:this.props.schema.allowCreateFolder,allowView:this.props.schema.allowView,showToolbar:this.props.schema.showToolbar,limitPath:this.props.schema.limitPath,theme:this.props.oContext.theme}):null}renderItem(e,t){const n=this.getIcon();return $.createElement("div",{style:fi.fullWidth},n,$.createElement(pe,{variant:"standard",style:n?fi.fullWidthIcon:fi.fullWidthOneButton,value:this.state.value??"",error:!!e,disabled:!!t,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:!!this.props.schema.disableEdit}},onChange:h=>{const i=h.target.value;this.setState({value:i},()=>this.onChange(this.props.attr,this.props.schema.trim===!1?i:(i||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}),$.createElement(ve,{disabled:t,variant:"outlined",onClick:()=>this.setState({showFileBrowser:!0})},"..."),this.renderFileBrowser())}}class Xh extends V{async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums("functions").then(t=>{const n=Object.keys(t).map(h=>({value:this.props.schema.short?h.replace("enum.functions.",""):h,label:this.getText(t[h].common.name),obj:t[h]}));this.props.schema.allowDeactivate!==!1&&n.unshift({label:P.I18n.t(V.NONE_LABEL),value:V.NONE_VALUE}),this.setState({value:e,selectOptions:n})})}renderItem(e,t){if(!this.state.selectOptions)return null;const n=this.state.selectOptions.find(h=>h.value===this.state.value);return $.createElement(fe,{variant:"standard",fullWidth:!0},this.props.schema.label?$.createElement(_e,null,this.getText(this.props.schema.label)):null,$.createElement(Ne,{variant:"standard",error:!!e,disabled:!!t,value:this.state.value||"_",renderValue:()=>n?n.obj?$.createElement(P.TextWithIcon,{value:n.obj,themeType:this.props.oContext.themeType,lang:P.I18n.getLanguage()}):n.label:"",onChange:h=>{this.setState({value:h.target.value==="_"?"":h.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(h=>$.createElement($e,{key:h.value,value:h.value,style:h.value===V.DIFFERENT_VALUE?{opacity:.5}:{}},h.obj?$.createElement(P.TextWithIcon,{value:h.obj,themeType:this.props.oContext.themeType,lang:P.I18n.getLanguage()}):h.label))),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Zh extends V{iframeRef=$.createRef();observer=null;async componentDidMount(){await super.componentDidMount(),this.props.schema.reloadOnShow&&(this.observer=new IntersectionObserver(([e])=>{if(e.isIntersecting&&this.state.isVisible===!1&&this.iframeRef.current){const t=this.iframeRef.current.src;this.iframeRef.current.src="",setTimeout(()=>{this.iframeRef.current&&(this.iframeRef.current.src=t)},0)}this.setState({isVisible:e.isIntersecting})}),this.iframeRef.current&&this.observer.observe(this.iframeRef.current))}componentWillUnmount(){var e,t;(e=super.componentWillUnmount)==null||e.call(this),(t=this.observer)==null||t.disconnect()}renderItem(e,t){const n=this.props.schema.url||V.getValue(this.props.data,this.props.attr);return $.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},$.createElement("iframe",{style:{width:"100%",height:"100%",borderWidth:this.props.schema.frameBorder??0,...this.props.schema.innerStyle,border:e?"1px solid red":void 0},ref:this.iframeRef,src:n,allowFullScreen:this.props.schema.allowFullscreen??!1,sandbox:this.props.schema.sandbox,loading:this.props.schema.lazyLoad??"lazy"}),t&&$.createElement("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255, 255, 255, 0.3)",cursor:"not-allowed",zIndex:1}}))}}class qh extends V{initialized=!1;localContext;iframeRef=$.createRef();observer=null;async componentDidMount(){await super.componentDidMount(),this.askInstance().catch(e=>console.error(e)),this.props.schema.reloadOnShow&&(this.observer=new IntersectionObserver(([e])=>{if(e.isIntersecting&&this.state.isVisible===!1&&this.iframeRef.current){const t=this.iframeRef.current.src;this.iframeRef.current.src="",setTimeout(()=>{this.iframeRef.current&&(this.iframeRef.current.src=t)},0)}this.setState({isVisible:e.isIntersecting})}),this.iframeRef.current&&this.observer.observe(this.iframeRef.current))}async askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const n=await this.getPatternAsync(this.props.schema.jsonData,null,!0);if(n)try{e=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${JSON.stringify(e)}`)}}e===void 0&&(e=null);const t=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(t!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){const n=await this.props.oContext.socket.getState(`system.adapter.${t}.alive`);if(!(n!=null&&n.val)){window.alert(P.I18n.t("ra_Instance %s is not alive",t));return}}this.props.oContext.socket.sendTo(t,this.props.schema.command||"send",e).then(n=>this.setState({url:n||""}))}}getContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=V.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(e,t){if(this.props.alive){const n=this.getContext();(n!==this.localContext||!this.initialized)&&(this.localContext=n,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}return this.state.url===void 0?null:$.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},$.createElement("iframe",{style:{width:"100%",height:"100%",borderWidth:this.props.schema.frameBorder??0,...this.props.schema.innerStyle,border:e?"1px solid red":void 0},ref:this.iframeRef,src:this.state.url,allowFullScreen:this.props.schema.allowFullscreen??!1,sandbox:this.props.schema.sandbox,loading:this.props.schema.lazyLoad??"lazy"}),t&&$.createElement("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255, 255, 255, 0.3)",cursor:"not-allowed",zIndex:1}}))}}class eu extends V{async componentDidMount(){await super.componentDidMount(),this.props.oContext.socket.getHostByIp(this.props.common.host).then(e=>{this.props.schema.listenOnAllPorts||(e=e.filter(t=>t.address!=="0.0.0.0"&&t.address!=="::")),this.props.schema.onlyIp4?e=e.filter(t=>t.family==="ipv4"):this.props.schema.onlyIp6&&(e=e.filter(t=>t.family==="ipv6")),this.props.schema.noInternal&&(e=e.filter(t=>!t.internal)),e.forEach(t=>{t.address==="0.0.0.0"?t.name=`[IPv4] 0.0.0.0 - ${P.I18n.t("ra_Listen on all IPs")}`:t.address==="::"&&(t.name=`[IPv6] :: - ${P.I18n.t("ra_Listen on all IPs")}`)}),this.setState({ips:e})}).catch(e=>console.error(e))}renderItem(e,t){var i,s;const n=V.getValue(this.props.data,this.props.attr),h=(i=this.state.ips)==null?void 0:i.find(d=>d.address===n);return $.createElement(fe,{fullWidth:!0,variant:"standard"},this.state.ips&&this.props.schema.label?$.createElement(_e,null,this.getText(this.props.schema.label)):null,this.state.ips?$.createElement(Ne,{variant:"standard",error:!!e,disabled:!!t,value:n,renderValue:d=>(h==null?void 0:h.name)||d,onChange:d=>this.onChange(this.props.attr,d.target.value)},(s=this.state.ips)==null?void 0:s.map((d,o)=>$.createElement($e,{key:o,value:d.address},d.name))):$.createElement(pe,{fullWidth:!0,variant:"standard",error:!!e,disabled:!!t,value:n,onChange:d=>this.onChange(this.props.attr,d.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class tu extends V{initialized=!1;localContext;async componentDidMount(){await super.componentDidMount(),this.props.schema.sendFirstByClick||this.askInstance().catch(e=>console.error(e))}async askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const n=await this.getPatternAsync(this.props.schema.jsonData,null,!0);if(n)try{e=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${JSON.stringify(e)}`)}}e===void 0&&(e=null);const t=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(t!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){const n=await this.props.oContext.socket.getState(`system.adapter.${t}.alive`);if(!(n!=null&&n.val)){window.alert(P.I18n.t("ra_Instance %s is not alive",t));return}}this.setState({loading:!0},()=>this.props.oContext.socket.sendTo(t,this.props.schema.command||"send",e).then(n=>this.setState({image:n||""})))}}getContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=V.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(){if(this.props.alive){const e=this.getContext();(e!==this.localContext||!this.initialized)&&(this.localContext=e,(!this.props.schema.sendFirstByClick||this.state.image!==void 0)&&setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}return!this.state.image&&this.props.schema.sendFirstByClick?$.createElement("div",{style:{width:this.props.schema.width||"100%",height:this.props.schema.height,display:"flex",alignItems:"center",justifyContent:"center",cursor:this.state.loading?"default":"pointer"},onClick:()=>!this.state.loading&&this.askInstance()},this.state.loading?$.createElement(Tt,null):typeof this.props.schema.sendFirstByClick=="boolean"?P.I18n.t("ra_Click to show"):this.getText(this.props.schema.sendFirstByClick,this.props.schema.noTranslation)):this.state.image===void 0?null:$.createElement(P.Icon,{title:this.getText(this.props.schema.tooltip),src:this.state.image,style:{width:this.props.schema.width||"100%",height:this.props.schema.height}})}}class nu extends V{index;constructor(e){super(e),this.index=Date.now()}async componentDidMount(){if(await super.componentDidMount(),this.props.schema.base64){const e=V.getValue(this.props.data,this.props.attr);this.setState({value:e})}else this.props.oContext.socket.fileExists(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr).then(e=>e&&this.loadImage())}_getUrl(e){e&&(this.index=Date.now());let t=`files/${this.props.oContext.adapterName}.${this.props.oContext.instance}/${this.props.attr}?t=${this.index}`;return window.location.port==="3000"&&(t=`${window.location.protocol}//${window.location.hostname}:8081/${t}`),t}loadImage(){fetch(this._getUrl()).then(e=>e.blob()).then(e=>{const t=new FileReader;t.onload=()=>{this.setState({value:t.result})},t.readAsDataURL(e)}).catch(e=>console.error(e))}renderItem(e,t){return $.createElement(fe,{fullWidth:!0,variant:"standard"},this.props.schema.label?$.createElement(_e,{shrink:!0},this.getText(this.props.schema.label)):null,$.createElement(P.UploadImage,{error:!!e,disabled:t,accept:this.props.schema.accept,crop:this.props.schema.crop,maxSize:this.props.schema.maxSize||256*1024,icon:this.state.value||void 0,removeIconFunc:()=>this.setState({value:null},()=>{if(this.props.schema.base64){const n=this.onChange(this.props.attr,this.state.value);n instanceof Promise&&n.catch(h=>console.error(`Cannot set value: ${h}`))}else this.props.oContext.socket.deleteFile(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr).catch(n=>console.error(n))}),onChange:n=>this.setState({value:n},()=>{if(this.props.schema.base64){const h=this.onChange(this.props.attr,this.state.value);h instanceof Promise&&h.catch(i=>console.error(`Cannot set value: ${i}`))}else n.startsWith("data")&&(n=n.split(",")[1]);this.props.oContext.socket.writeFile64(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr,n).catch(h=>console.error(h))})}),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class iu extends V{renderItem(){return $.createElement(P.InfoBox,{type:this.props.schema.boxType||"info",closeable:this.props.schema.closeable!==void 0?this.props.schema.closeable:!0,storeId:this.props.schema.closed!==void 0?void 0:`${!!this.props.oContext.adapterName} ${this.props.attr}`,closed:this.props.schema.closed,style:{width:"100%",...this.props.schema.style}},this.props.schema.title?$.createElement(Ie,{component:"div",sx:{fontWeight:"bold",fontSize:"larger"}},this.getText(this.props.schema.title)):null,this.getText(this.props.schema.text))}}const Ur={icon:{width:20,height:20,marginRight:4}};class su extends V{async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr);let t=this.props.schema.adapter;t==="_dataSources"&&(t=void 0),this.props.oContext.socket.getAdapterInstances(t,!0).then(async n=>{this.props.schema.adapter==="_dataSources"?n=n.filter(i=>{var s;return(s=i==null?void 0:i.common)==null?void 0:s.getHistory}):this.props.schema.adapter?n=n.filter(i=>i==null?void 0:i._id.startsWith(`system.adapter.${this.props.schema.adapter}.`)):this.props.schema.adapters&&Array.isArray(this.props.schema.adapters)&&(n=n.filter(i=>{var s;return this.props.schema.adapters.includes((s=i==null?void 0:i.common)==null?void 0:s.name)})),this.props.schema.onlyEnabled&&(n=n.filter(i=>{var s;return(s=i==null?void 0:i.common)==null?void 0:s.enabled}));const h=n.map(i=>({value:this.props.schema.long?i._id:this.props.schema.short?i._id.split(".").pop():i._id.replace(/^system\.adapter\./,""),label:`${i.common.name} [${i._id.replace(/^system\.adapter\./,"")}]`,icon:`${this.props.oContext.imagePrefix}/adapter/${i.common.name}/${i.common.icon}`}));h.sort((i,s)=>i.value>s.value?1:i.value<s.value?-1:0),this.props.schema.allowDeactivate!==!1&&h.unshift({label:P.I18n.t(V.NONE_LABEL),value:V.NONE_VALUE}),this.props.schema.all&&h.unshift({label:P.I18n.t("sch_all"),value:"*"}),this.setState({value:e||"",selectOptions:h}),await this.props.oContext.socket.subscribeObject(`system.adapter.${t?`${t}.`:""}*`,this.onInstancesUpdate)}).catch(n=>console.error(`Cannot get instances: ${n}`))}componentWillUnmount(){this.props.oContext.socket.unsubscribeObject("system.adapter.*",this.onInstancesUpdate).then(()=>{}),super.componentWillUnmount()}onInstancesUpdate=(e,t)=>{if(!e.match(/^system\.adapter\.[-_a-z\d]+\.\d+$/))return;const n=this.props.schema.long?e:this.props.schema.short?e.split(".").pop():e.replace(/^system\.adapter\./,""),h=this.state.selectOptions.findIndex(i=>i.value===n);if(t){if(this.props.schema.adapter==="_dataSources"&&(!t.common||!t.common.getHistory))return;if(h===-1){const i=JSON.parse(JSON.stringify(this.state.selectOptions)),s=typeof t.common.name=="object"?t.common.name[P.I18n.getLanguage()]||t.common.name.en:t.common.name;i.push({value:this.props.schema.long?t._id:this.props.schema.short?t._id.split(".").pop():t._id.replace(/^system\.adapter\./,""),label:`${s} [${t._id.replace(/^system\.adapter\./,"")}]`,icon:`${this.props.oContext.imagePrefix}/adapter/${s}/${t.common.icon}`}),i.sort((d,o)=>d.label>o.label?1:d.label<o.label?-1:0),this.setState({selectOptions:i})}}else if(h!==-1){const i=JSON.parse(JSON.stringify(this.state.selectOptions)),s={};this.state.value===i[h].value&&(s.value=V.NONE_VALUE),i.splice(h,1),s.selectOptions=i,this.setState(s)}};renderItem(e,t){var h;if(!this.state.selectOptions)return null;const n=(h=this.state.selectOptions)==null?void 0:h.find(i=>i.value===this.state.value);return $.createElement(fe,{fullWidth:!0,key:this.props.attr,variant:"standard"},this.props.schema.label?$.createElement(_e,{shrink:!0},this.getText(this.props.schema.label)):null,$.createElement(Ne,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:this.state.value,renderValue:()=>$.createElement("span",{style:{display:"flex"}},n!=null&&n.icon?$.createElement(P.Icon,{src:`./${n.icon}`,style:Ur.icon}):null,this.getText(n==null?void 0:n.label,!0)),onChange:i=>this.setState({value:i.target.value},()=>this.onChange(this.props.attr,this.state.value))},this.state.selectOptions.map(i=>$.createElement($e,{key:i.value,value:i.value,style:i.value===V.NONE_VALUE?{opacity:.5}:{}},i.icon?$.createElement(P.Icon,{src:`./${i.icon}`,style:Ur.icon}):null,this.getText(i.label,!0)))),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Kr={address:{fontSize:"smaller",opacity:.5,marginLeft:8}};class ru extends V{async componentDidMount(){await super.componentDidMount(),this.props.oContext.getCachedObject(`system.host.${this.props.common.host}`).then(e=>{var n,h;const t=[];if((h=(n=e==null?void 0:e.native)==null?void 0:n.hardware)!=null&&h.networkInterfaces){const i=e.native.hardware.networkInterfaces;Object.keys(i).forEach(s=>{if(this.props.schema.ignoreInternal&&!i[s].find(o=>!o.internal)||this.props.schema.ignoreLoopback&&i[s].find(o=>o.address==="127.0.0.1"||o.address==="::1"))return;let d=i[s].find(o=>o.family==="IPv4");d||=i[s].find(o=>o.family==="IPv6"),t.push({value:s,address:d.address})})}this.setState({interfaces:t})}).catch(e=>window.alert(`Cannot read interfaces: ${e}`))}renderItem(e,t){var i,s,d;const n=V.getValue(this.props.data,this.props.attr),h=(i=this.state.interfaces)==null?void 0:i.find(o=>o.value===n);return $.createElement(fe,{fullWidth:!0,variant:"standard"},(s=this.state.interfaces)!=null&&s.length&&this.props.schema.label?$.createElement(_e,null,this.getText(this.props.schema.label)):null,(d=this.state.interfaces)!=null&&d.length?$.createElement(Ne,{variant:"standard",error:!!e,disabled:!!t,value:n,renderValue:o=>h?$.createElement("span",null,h.value,$.createElement("span",{style:Kr.address},h.address)):o,onChange:o=>this.onChange(this.props.attr,o.target.value)},this.state.interfaces.map((o,l)=>$.createElement($e,{key:l,value:o.value},$.createElement("span",null,o.value,$.createElement("span",{style:Kr.address},o.address))))):$.createElement(pe,{fullWidth:!0,variant:"standard",error:!!e,disabled:!!t,value:n,onChange:o=>this.onChange(this.props.attr,o.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const rn={modalDialog:{minWidth:400,maxWidth:800},overflowHidden:{display:"flex",overflow:"hidden"},titleIcon:{marginRight:5},content:{fontSize:16},languageButton:{position:"absolute",right:8,top:8},languageButtonActive:{color:"primary.main"}},qs=({toggleTranslation:m,noTranslation:e,title:t,fullWidth:n,help:h,maxWidth:i,progress:s,icon:d,applyDisabled:o,applyButton:l,onClose:r,children:a,titleButtonApply:c,titleButtonClose:p,onApply:u,textInput:f,defaultValue:g,overflowHidden:v})=>{const[b,D]=Yl(g);Ql(()=>{D(g)},[g]);const E=sc(),w=rc(E.breakpoints.down("md"));let y=null;return d&&(y=d),$.createElement(Lt,{open:!0,maxWidth:w?!1:i||"md",fullWidth:!!n,fullScreen:w,disableEscapeKeyDown:!1,onClose:r,sx:{"& .MuiPaper-root":w?{}:rn.modalDialog}},t&&$.createElement(yn,null,d?$.createElement(y,{style:rn.titleIcon}):null,t,P.I18n.getLanguage()!=="en"&&m?$.createElement(se,{size:"large",style:{...rn.languageButton,...e?rn.languageButtonActive:{}},onClick:()=>m(),title:P.I18n.t("ra_Disable/Enable translation")},$.createElement(kc,null)):null),$.createElement(Kt,{sx:{...v?rn.overflowHidden:{},...rn.content},style:{paddingTop:8}},f&&$.createElement(pe,{autoComplete:"off",fullWidth:!0,autoFocus:!0,variant:"outlined",size:"medium",multiline:!0,value:b,onChange:A=>D(A.target.value)}),a,h?$.createElement("div",null,h):null),$.createElement(Gt,null,l!==!1&&$.createElement(ve,{startIcon:$.createElement(Gs,null),disabled:s||o&&g===b,onClick:()=>u&&u(f?b:""),variant:"contained",color:"primary"},P.I18n.t(c||"ra_Ok")),$.createElement(ve,{color:"grey",onClick:()=>r&&r(),disabled:s,variant:"contained",startIcon:$.createElement(ht,null)},P.I18n.t(p||"ra_Cancel"))))};var bn={},Yt={},Yo={exports:{}};(function(m,e){(function(){var t="ace",n=(function(){return this})();!n&&typeof window<"u"&&(n=window);var h=function(r,a,c){if(typeof r!="string"){h.original?h.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(c=a),h.modules[r]||(h.payloads[r]=c,h.modules[r]=null)};h.modules={},h.payloads={};var i=function(r,a,c){if(typeof a=="string"){var p=o(r,a);if(p!=null)return c&&c(),p}else if(Object.prototype.toString.call(a)==="[object Array]"){for(var u=[],f=0,g=a.length;f<g;++f){var v=o(r,a[f]);if(v==null&&s.original)return;u.push(v)}return c&&c.apply(null,u)||!0}},s=function(r,a){var c=i("",r,a);return c==null&&s.original?s.original.apply(this,arguments):c},d=function(r,a){if(a.indexOf("!")!==-1){var c=a.split("!");return d(r,c[0])+"!"+d(r,c[1])}if(a.charAt(0)=="."){var p=r.split("/").slice(0,-1).join("/");for(a=p+"/"+a;a.indexOf(".")!==-1&&u!=a;){var u=a;a=a.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return a},o=function(r,a){a=d(r,a);var c=h.modules[a];if(!c){if(c=h.payloads[a],typeof c=="function"){var p={},u={id:a,uri:"",exports:p,packaged:!0},f=function(v,b){return i(a,v,b)},g=c(f,p,u);p=g||u.exports,h.modules[a]=p,delete h.payloads[a]}c=h.modules[a]=p||c}return c};function l(r){var a=n;n[r]||(n[r]={}),a=n[r],(!a.define||!a.define.packaged)&&(h.original=a.define,a.define=h,a.define.packaged=!0),(!a.require||!a.require.packaged)&&(s.original=a.require,a.require=s,a.require.packaged=!0)}l(t)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(t,n,h){function i(s,d,o){Object.defineProperty(s,d,{value:o,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||i(String.prototype,"startsWith",function(s,d){return d=d||0,this.lastIndexOf(s,d)===d}),String.prototype.endsWith||i(String.prototype,"endsWith",function(s,d){var o=this;(d===void 0||d>o.length)&&(d=o.length),d-=s.length;var l=o.indexOf(s,d);return l!==-1&&l===d}),String.prototype.repeat||i(String.prototype,"repeat",function(s){for(var d="",o=this;s>0;)s&1&&(d+=o),(s>>=1)&&(o+=o);return d}),String.prototype.includes||i(String.prototype,"includes",function(s,d){return this.indexOf(s,d)!=-1}),Object.assign||(Object.assign=function(s){if(s==null)throw new TypeError("Cannot convert undefined or null to object");for(var d=Object(s),o=1;o<arguments.length;o++){var l=arguments[o];l!=null&&Object.keys(l).forEach(function(r){d[r]=l[r]})}return d}),Object.values||(Object.values=function(s){return Object.keys(s).map(function(d){return s[d]})}),Array.prototype.find||i(Array.prototype,"find",function(s){for(var d=this.length,o=arguments[1],l=0;l<d;l++){var r=this[l];if(s.call(o,r,l,this))return r}}),Array.prototype.findIndex||i(Array.prototype,"findIndex",function(s){for(var d=this.length,o=arguments[1],l=0;l<d;l++){var r=this[l];if(s.call(o,r,l,this))return l}}),Array.prototype.includes||i(Array.prototype,"includes",function(s,d){return this.indexOf(s,d)!=-1}),Array.prototype.fill||i(Array.prototype,"fill",function(s){for(var d=this,o=d.length>>>0,l=arguments[1],r=l>>0,a=r<0?Math.max(o+r,0):Math.min(r,o),c=arguments[2],p=c===void 0?o:c>>0,u=p<0?Math.max(o+p,0):Math.min(p,o);a<u;)d[a]=s,a++;return d}),Array.of||i(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(t,n,h){t("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(t,n,h){n.deepCopy=function i(s){if(typeof s!="object"||!s)return s;var d;if(Array.isArray(s)){d=[];for(var o=0;o<s.length;o++)d[o]=i(s[o]);return d}if(Object.prototype.toString.call(s)!=="[object Object]")return s;d={};for(var o in s)d[o]=i(s[o]);return d}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(t,n,h){n.last=function(d){return d[d.length-1]},n.stringReverse=function(d){return d.split("").reverse().join("")},n.stringRepeat=function(d,o){for(var l="";o>0;)o&1&&(l+=d),(o>>=1)&&(d+=d);return l};var i=/^\s\s*/,s=/\s\s*$/;n.stringTrimLeft=function(d){return d.replace(i,"")},n.stringTrimRight=function(d){return d.replace(s,"")},n.copyObject=function(d){var o={};for(var l in d)o[l]=d[l];return o},n.copyArray=function(d){for(var o=[],l=0,r=d.length;l<r;l++)d[l]&&typeof d[l]=="object"?o[l]=this.copyObject(d[l]):o[l]=d[l];return o},n.deepCopy=t("./deep_copy").deepCopy,n.arrayToMap=function(d){for(var o={},l=0;l<d.length;l++)o[d[l]]=1;return o},n.createMap=function(d){var o=Object.create(null);for(var l in d)o[l]=d[l];return o},n.arrayRemove=function(d,o){for(var l=0;l<=d.length;l++)o===d[l]&&d.splice(l,1)},n.escapeRegExp=function(d){return d.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},n.escapeHTML=function(d){return(""+d).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},n.getMatchOffsets=function(d,o){var l=[];return d.replace(o,function(r){l.push({offset:arguments[arguments.length-2],length:r.length})}),l},n.deferredCall=function(d){var o=null,l=function(){o=null,d()},r=function(a){return r.cancel(),o=setTimeout(l,a||0),r};return r.schedule=r,r.call=function(){return this.cancel(),d(),r},r.cancel=function(){return clearTimeout(o),o=null,r},r.isPending=function(){return o},r},n.delayedCall=function(d,o){var l=null,r=function(){l=null,d()},a=function(c){l==null&&(l=setTimeout(r,c||o))};return a.delay=function(c){l&&clearTimeout(l),l=setTimeout(r,c||o)},a.schedule=a,a.call=function(){this.cancel(),d()},a.cancel=function(){l&&clearTimeout(l),l=null},a.isPending=function(){return l},a},n.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},n.skipEmptyMatch=function(d,o,l){return l&&d.codePointAt(o)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(t,n,h){n.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},n.getOS=function(){return n.isMac?n.OS.MAC:n.isLinux?n.OS.LINUX:n.OS.WINDOWS};var i=typeof navigator=="object"?navigator:{},s=(/mac|win|linux/i.exec(i.platform)||["other"])[0].toLowerCase(),d=i.userAgent||"",o=i.appName||"";n.isWin=s=="win",n.isMac=s=="mac",n.isLinux=s=="linux",n.isIE=o=="Microsoft Internet Explorer"||o.indexOf("MSAppHost")>=0?parseFloat((d.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((d.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),n.isOldIE=n.isIE&&n.isIE<9,n.isGecko=n.isMozilla=d.match(/ Gecko\/\d+/),n.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",n.isWebKit=parseFloat(d.split("WebKit/")[1])||void 0,n.isChrome=parseFloat(d.split(" Chrome/")[1])||void 0,n.isSafari=parseFloat(d.split(" Safari/")[1])&&!n.isChrome||void 0,n.isEdge=parseFloat(d.split(" Edge/")[1])||void 0,n.isAIR=d.indexOf("AdobeAIR")>=0,n.isAndroid=d.indexOf("Android")>=0,n.isChromeOS=d.indexOf(" CrOS ")>=0,n.isIOS=/iPad|iPhone|iPod/.test(d)&&!window.MSStream,n.isIOS&&(n.isMac=!0),n.isMobile=n.isIOS||n.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(t,n,h){var i=t("./useragent"),s="http://www.w3.org/1999/xhtml";n.buildDom=function c(p,u,f){if(typeof p=="string"&&p){var g=document.createTextNode(p);return u&&u.appendChild(g),g}if(!Array.isArray(p))return p&&p.appendChild&&u&&u.appendChild(p),p;if(typeof p[0]!="string"||!p[0]){for(var v=[],b=0;b<p.length;b++){var D=c(p[b],u,f);D&&v.push(D)}return v}var E=document.createElement(p[0]),w=p[1],y=1;w&&typeof w=="object"&&!Array.isArray(w)&&(y=2);for(var b=y;b<p.length;b++)c(p[b],E,f);return y==2&&Object.keys(w).forEach(function(A){var T=w[A];A==="class"?E.className=Array.isArray(T)?T.join(" "):T:typeof T=="function"||A=="value"||A[0]=="$"?E[A]=T:A==="ref"?f&&(f[T]=E):A==="style"?typeof T=="string"&&(E.style.cssText=T):T!=null&&E.setAttribute(A,T)}),u&&u.appendChild(E),E},n.getDocumentHead=function(c){return c||(c=document),c.head||c.getElementsByTagName("head")[0]||c.documentElement},n.createElement=function(c,p){return document.createElementNS?document.createElementNS(p||s,c):document.createElement(c)},n.removeChildren=function(c){c.innerHTML=""},n.createTextNode=function(c,p){var u=p?p.ownerDocument:document;return u.createTextNode(c)},n.createFragment=function(c){var p=c?c.ownerDocument:document;return p.createDocumentFragment()},n.hasCssClass=function(c,p){var u=(c.className+"").split(/\s+/g);return u.indexOf(p)!==-1},n.addCssClass=function(c,p){n.hasCssClass(c,p)||(c.className+=" "+p)},n.removeCssClass=function(c,p){for(var u=c.className.split(/\s+/g);;){var f=u.indexOf(p);if(f==-1)break;u.splice(f,1)}c.className=u.join(" ")},n.toggleCssClass=function(c,p){for(var u=c.className.split(/\s+/g),f=!0;;){var g=u.indexOf(p);if(g==-1)break;f=!1,u.splice(g,1)}return f&&u.push(p),c.className=u.join(" "),f},n.setCssClass=function(c,p,u){u?n.addCssClass(c,p):n.removeCssClass(c,p)},n.hasCssString=function(c,p){var u=0,f;if(p=p||document,f=p.querySelectorAll("style")){for(;u<f.length;)if(f[u++].id===c)return!0}},n.removeElementById=function(c,p){p=p||document,p.getElementById(c)&&p.getElementById(c).remove()};var d,o=[];n.useStrictCSP=function(c){d=c,c==!1?l():o||(o=[])};function l(){var c=o;o=null,c&&c.forEach(function(p){r(p[0],p[1])})}function r(c,p,u){if(!(typeof document>"u")){if(o){if(u)l();else if(u===!1)return o.push([c,p])}if(!d){var f=u;!u||!u.getRootNode?f=document:(f=u.getRootNode(),(!f||f==u)&&(f=document));var g=f.ownerDocument||f;if(p&&n.hasCssString(p,f))return null;p&&(c+=`
16
- /*# sourceURL=ace/css/`+p+" */");var v=n.createElement("style");v.appendChild(g.createTextNode(c)),p&&(v.id=p),f==g&&(f=n.getDocumentHead(g)),f.insertBefore(v,f.firstChild)}}}if(n.importCssString=r,n.importCssStylsheet=function(c,p){n.buildDom(["link",{rel:"stylesheet",href:c}],n.getDocumentHead(p))},n.$fixPositionBug=function(c){var p=c.getBoundingClientRect();if(c.style.left){var u=parseFloat(c.style.left),f=+p.left;Math.abs(u-f)>1&&(c.style.left=2*u-f+"px")}if(c.style.right){var u=parseFloat(c.style.right),f=window.innerWidth-p.right;Math.abs(u-f)>1&&(c.style.right=2*u-f+"px")}if(c.style.top){var u=parseFloat(c.style.top),f=+p.top;Math.abs(u-f)>1&&(c.style.top=2*u-f+"px")}if(c.style.bottom){var u=parseFloat(c.style.bottom),f=window.innerHeight-p.bottom;Math.abs(u-f)>1&&(c.style.bottom=2*u-f+"px")}},n.scrollbarWidth=function(c){var p=n.createElement("ace_inner");p.style.width="100%",p.style.minWidth="0px",p.style.height="200px",p.style.display="block";var u=n.createElement("ace_outer"),f=u.style;f.position="absolute",f.left="-10000px",f.overflow="hidden",f.width="200px",f.minWidth="0px",f.height="150px",f.display="block",u.appendChild(p);var g=c&&c.documentElement||document&&document.documentElement;if(!g)return 0;g.appendChild(u);var v=p.offsetWidth;f.overflow="scroll";var b=p.offsetWidth;return v===b&&(b=u.clientWidth),g.removeChild(u),v-b},n.computedStyle=function(c,p){return window.getComputedStyle(c,"")||{}},n.setStyle=function(c,p,u){c[p]!==u&&(c[p]=u)},n.HAS_CSS_ANIMATION=!1,n.HAS_CSS_TRANSFORMS=!1,n.HI_DPI=i.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,i.isChromeOS&&(n.HI_DPI=!1),typeof document<"u"){var a=document.createElement("div");n.HI_DPI&&a.style.transform!==void 0&&(n.HAS_CSS_TRANSFORMS=!0),!i.isEdge&&typeof a.style.animationName<"u"&&(n.HAS_CSS_ANIMATION=!0),a=null}n.HAS_CSS_TRANSFORMS?n.translate=function(c,p,u){c.style.transform="translate("+Math.round(p)+"px, "+Math.round(u)+"px)"}:n.translate=function(c,p,u){c.style.top=Math.round(u)+"px",c.style.left=Math.round(p)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(t,n,h){var i=t("./dom");n.get=function(s,d){var o=new XMLHttpRequest;o.open("GET",s,!0),o.onreadystatechange=function(){o.readyState===4&&d(o.responseText)},o.send(null)},n.loadScript=function(s,d){var o=i.getDocumentHead(),l=document.createElement("script");l.src=s,o.appendChild(l),l.onload=l.onreadystatechange=function(r,a){(a||!l.readyState||l.readyState=="loaded"||l.readyState=="complete")&&(l=l.onload=l.onreadystatechange=null,a||d())}},n.qualifyURL=function(s){var d=document.createElement("a");return d.href=s,d.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(t,n,h){n.inherits=function(i,s){i.super_=s,i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}})},n.mixin=function(i,s){for(var d in s)i[d]=s[d];return i},n.implement=function(i,s){n.mixin(i,s)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(t,n,h){var i={},s=function(){this.propagationStopped=!0},d=function(){this.defaultPrevented=!0};i._emit=i._dispatchEvent=function(o,l){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[o]||[],a=this._defaultHandlers[o];if(!(!r.length&&!a)){(typeof l!="object"||!l)&&(l={}),l.type||(l.type=o),l.stopPropagation||(l.stopPropagation=s),l.preventDefault||(l.preventDefault=d),r=r.slice();for(var c=0;c<r.length&&(r[c](l,this),!l.propagationStopped);c++);if(a&&!l.defaultPrevented)return a(l,this)}},i._signal=function(o,l){var r=(this._eventRegistry||{})[o];if(r){r=r.slice();for(var a=0;a<r.length;a++)r[a](l,this)}},i.once=function(o,l){var r=this;if(this.on(o,function a(){r.off(o,a),l.apply(null,arguments)}),!l)return new Promise(function(a){l=a})},i.setDefaultHandler=function(o,l){var r=this._defaultHandlers;if(r||(r=this._defaultHandlers={_disabled_:{}}),r[o]){var a=r[o],c=r._disabled_[o];c||(r._disabled_[o]=c=[]),c.push(a);var p=c.indexOf(l);p!=-1&&c.splice(p,1)}r[o]=l},i.removeDefaultHandler=function(o,l){var r=this._defaultHandlers;if(r){var a=r._disabled_[o];if(r[o]==l)a&&this.setDefaultHandler(o,a.pop());else if(a){var c=a.indexOf(l);c!=-1&&a.splice(c,1)}}},i.on=i.addEventListener=function(o,l,r){this._eventRegistry=this._eventRegistry||{};var a=this._eventRegistry[o];return a||(a=this._eventRegistry[o]=[]),a.indexOf(l)==-1&&a[r?"unshift":"push"](l),l},i.off=i.removeListener=i.removeEventListener=function(o,l){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[o];if(r){var a=r.indexOf(l);a!==-1&&r.splice(a,1)}},i.removeAllListeners=function(o){o||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[o]=void 0),this._defaultHandlers&&(this._defaultHandlers[o]=void 0)},n.EventEmitter=i}),ace.define("ace/lib/report_error",["require","exports","module"],function(t,n,h){n.reportError=function(s,d){var o=new Error(s);o.data=d,typeof console=="object"&&console.error&&console.error(o),setTimeout(function(){throw o})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(t,n,h){var i={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor gutter","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages","gutter.annotation.aria-label.security":"Security finding, read annotations row $0","gutter.annotation.aria-label.hint":"Suggestion, read annotations row $0","gutter-tooltip.aria-label.security.singular":"security finding","gutter-tooltip.aria-label.security.plural":"security findings","gutter-tooltip.aria-label.hint.singular":"suggestion","gutter-tooltip.aria-label.hint.plural":"suggestions","editor.tooltip.disable-editing":"Editing is disabled"};n.defaultEnglishMessages=i}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(t,n,h){"no use strict";var i=t("./oop"),s=t("./event_emitter").EventEmitter,d=t("./report_error").reportError,o=t("./default_english_messages").defaultEnglishMessages,l={setOptions:function(u){Object.keys(u).forEach(function(f){this.setOption(f,u[f])},this)},getOptions:function(u){var f={};if(u)Array.isArray(u)||(u=Object.keys(u));else{var g=this.$options;u=Object.keys(g).filter(function(v){return!g[v].hidden})}return u.forEach(function(v){f[v]=this.getOption(v)},this),f},setOption:function(u,f){if(this["$"+u]!==f){var g=this.$options[u];if(!g)return r('misspelled option "'+u+'"');if(g.forwardTo)return this[g.forwardTo]&&this[g.forwardTo].setOption(u,f);g.handlesSet||(this["$"+u]=f),g&&g.set&&g.set.call(this,f)}},getOption:function(u){var f=this.$options[u];return f?f.forwardTo?this[f.forwardTo]&&this[f.forwardTo].getOption(u):f&&f.get?f.get.call(this):this["$"+u]:r('misspelled option "'+u+'"')}};function r(u){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var a,c,p=(function(){function u(){this.$defaultOptions={},a=o,c="dollarSigns"}return u.prototype.defineOptions=function(f,g,v){return f.$options||(this.$defaultOptions[g]=f.$options={}),Object.keys(v).forEach(function(b){var D=v[b];typeof D=="string"&&(D={forwardTo:D}),D.name||(D.name=b),f.$options[D.name]=D,"initialValue"in D&&(f["$"+D.name]=D.initialValue)}),i.implement(f,l),this},u.prototype.resetOptions=function(f){Object.keys(f.$options).forEach(function(g){var v=f.$options[g];"value"in v&&f.setOption(g,v.value)})},u.prototype.setDefaultValue=function(f,g,v){if(!f){for(f in this.$defaultOptions)if(this.$defaultOptions[f][g])break;if(!this.$defaultOptions[f][g])return!1}var b=this.$defaultOptions[f]||(this.$defaultOptions[f]={});b[g]&&(b.forwardTo?this.setDefaultValue(b.forwardTo,g,v):b[g].value=v)},u.prototype.setDefaultValues=function(f,g){Object.keys(g).forEach(function(v){this.setDefaultValue(f,v,g[v])},this)},u.prototype.setMessages=function(f,g){a=f,g&&g.placeholders&&(c=g.placeholders)},u.prototype.nls=function(f,g,v){a[f]||(r("No message found for the key '"+f+"' in messages with id "+a.$id+", trying to find a translation for the default string '"+g+"'."),a[g]||r("No message found for the default string '"+g+"' in the provided messages. Falling back to the default English message."));var b=a[f]||a[g]||g;return v&&(c==="dollarSigns"&&(b=b.replace(/\$(\$|[\d]+)/g,function(D,E){return E=="$"?"$":v[E]})),c==="curlyBrackets"&&(b=b.replace(/\{([^\}]+)\}/g,function(D,E){return v[E]}))),b},u})();p.prototype.warn=r,p.prototype.reportError=d,i.implement(p.prototype,s),n.AppConfig=p}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(t,n,h){h.exports=`.ace-tm .ace_gutter {
17
- background: #f0f0f0;
18
- color: #333;
19
- }
20
-
21
- .ace-tm .ace_print-margin {
22
- width: 1px;
23
- background: #e8e8e8;
24
- }
25
-
26
- .ace-tm .ace_fold {
27
- background-color: #6B72E6;
28
- }
29
-
30
- .ace-tm {
31
- background-color: #FFFFFF;
32
- color: black;
33
- }
34
-
35
- .ace-tm .ace_cursor {
36
- color: black;
37
- }
38
-
39
- .ace-tm .ace_invisible {
40
- color: rgb(191, 191, 191);
41
- }
42
-
43
- .ace-tm .ace_storage,
44
- .ace-tm .ace_keyword {
45
- color: blue;
46
- }
47
-
48
- .ace-tm .ace_constant {
49
- color: rgb(197, 6, 11);
50
- }
51
-
52
- .ace-tm .ace_constant.ace_buildin {
53
- color: rgb(88, 72, 246);
54
- }
55
-
56
- .ace-tm .ace_constant.ace_language {
57
- color: rgb(88, 92, 246);
58
- }
59
-
60
- .ace-tm .ace_constant.ace_library {
61
- color: rgb(6, 150, 14);
62
- }
63
-
64
- .ace-tm .ace_invalid {
65
- background-color: rgba(255, 0, 0, 0.1);
66
- color: red;
67
- }
68
-
69
- .ace-tm .ace_support.ace_function {
70
- color: rgb(60, 76, 114);
71
- }
72
-
73
- .ace-tm .ace_support.ace_constant {
74
- color: rgb(6, 150, 14);
75
- }
76
-
77
- .ace-tm .ace_support.ace_type,
78
- .ace-tm .ace_support.ace_class {
79
- color: rgb(109, 121, 222);
80
- }
81
-
82
- .ace-tm .ace_keyword.ace_operator {
83
- color: rgb(104, 118, 135);
84
- }
85
-
86
- .ace-tm .ace_string {
87
- color: rgb(3, 106, 7);
88
- }
89
-
90
- .ace-tm .ace_comment {
91
- color: rgb(76, 136, 107);
92
- }
93
-
94
- .ace-tm .ace_comment.ace_doc {
95
- color: rgb(0, 102, 255);
96
- }
97
-
98
- .ace-tm .ace_comment.ace_doc.ace_tag {
99
- color: rgb(128, 159, 191);
100
- }
101
-
102
- .ace-tm .ace_constant.ace_numeric {
103
- color: rgb(0, 0, 205);
104
- }
105
-
106
- .ace-tm .ace_variable {
107
- color: rgb(49, 132, 149);
108
- }
109
-
110
- .ace-tm .ace_xml-pe {
111
- color: rgb(104, 104, 91);
112
- }
113
-
114
- .ace-tm .ace_entity.ace_name.ace_function {
115
- color: #0000A2;
116
- }
117
-
118
-
119
- .ace-tm .ace_heading {
120
- color: rgb(12, 7, 255);
121
- }
122
-
123
- .ace-tm .ace_list {
124
- color:rgb(185, 6, 144);
125
- }
126
-
127
- .ace-tm .ace_meta.ace_tag {
128
- color:rgb(0, 22, 142);
129
- }
130
-
131
- .ace-tm .ace_string.ace_regex {
132
- color: rgb(255, 0, 0)
133
- }
134
-
135
- .ace-tm .ace_marker-layer .ace_selection {
136
- background: rgb(181, 213, 255);
137
- }
138
- .ace-tm.ace_multiselect .ace_selection.ace_start {
139
- box-shadow: 0 0 3px 0px white;
140
- }
141
- .ace-tm .ace_marker-layer .ace_step {
142
- background: rgb(252, 255, 0);
143
- }
144
-
145
- .ace-tm .ace_marker-layer .ace_stack {
146
- background: rgb(164, 229, 101);
147
- }
148
-
149
- .ace-tm .ace_marker-layer .ace_bracket {
150
- margin: -1px 0 0 -1px;
151
- border: 1px solid rgb(192, 192, 192);
152
- }
153
-
154
- .ace-tm .ace_marker-layer .ace_active-line {
155
- background: rgba(0, 0, 0, 0.07);
156
- }
157
-
158
- .ace-tm .ace_gutter-active-line {
159
- background-color : #dcdcdc;
160
- }
161
-
162
- .ace-tm .ace_marker-layer .ace_selected-word {
163
- background: rgb(250, 250, 255);
164
- border: 1px solid rgb(200, 200, 250);
165
- }
166
-
167
- .ace-tm .ace_indent-guide {
168
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
169
- }
170
-
171
- .ace-tm .ace_indent-guide-active {
172
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
173
- }
174
- `}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(t,n,h){n.isDark=!1,n.cssClass="ace-tm",n.cssText=t("./textmate-css"),n.$id="ace/theme/textmate";var i=t("../lib/dom");i.importCssString(n.cssText,n.cssClass,!1)}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(t,n,h){"no use strict";var i=t("./lib/lang"),s=t("./lib/net"),d=t("./lib/dom"),o=t("./lib/app_config").AppConfig;h.exports=n=new o;var l={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};n.get=function(p){if(!l.hasOwnProperty(p))throw new Error("Unknown config key: "+p);return l[p]},n.set=function(p,u){if(l.hasOwnProperty(p))l[p]=u;else if(this.setDefaultValue("",p,u)==!1)throw new Error("Unknown config key: "+p);p=="useStrictCSP"&&d.useStrictCSP(u)},n.all=function(){return i.copyObject(l)},n.$modes={},n.moduleUrl=function(p,u){if(l.$moduleUrls[p])return l.$moduleUrls[p];var f=p.split("/");u=u||f[f.length-2]||"";var g=u=="snippets"?"/":"-",v=f[f.length-1];if(u=="worker"&&g=="-"){var b=new RegExp("^"+u+"[\\-_]|[\\-_]"+u+"$","g");v=v.replace(b,"")}(!v||v==u)&&f.length>1&&(v=f[f.length-2]);var D=l[u+"Path"];return D==null?D=l.basePath:g=="/"&&(u=g=""),D&&D.slice(-1)!="/"&&(D+="/"),D+u+g+v+this.get("suffix")},n.setModuleUrl=function(p,u){return l.$moduleUrls[p]=u};var r=function(p,u){if(p==="ace/theme/textmate"||p==="./theme/textmate")return u(null,t("./theme/textmate"));if(a)return a(p,u);console.error("loader is not configured")},a;n.setLoader=function(p){a=p},n.dynamicModules=Object.create(null),n.$loading={},n.$loaded={},n.loadModule=function(p,u){var f;if(Array.isArray(p))var g=p[0],v=p[1];else if(typeof p=="string")var v=p;var b=function(D){if(D&&!n.$loading[v])return u&&u(D);if(n.$loading[v]||(n.$loading[v]=[]),n.$loading[v].push(u),!(n.$loading[v].length>1)){var E=function(){r(v,function(w,y){y&&(n.$loaded[v]=y),n._emit("load.module",{name:v,module:y});var A=n.$loading[v];n.$loading[v]=null,A.forEach(function(T){T&&T(y)})})};if(!n.get("packaged"))return E();s.loadScript(n.moduleUrl(v,g),E),c()}};if(n.dynamicModules[v])n.dynamicModules[v]().then(function(D){D.default?b(D.default):b(D)});else{try{f=this.$require(v)}catch{}b(f||n.$loaded[v])}},n.$require=function(p){if(typeof h.require=="function"){var u="require";return h[u](p)}},n.setModuleLoader=function(p,u){n.dynamicModules[p]=u};var c=function(){!l.basePath&&!l.workerPath&&!l.modePath&&!l.themePath&&!Object.keys(l.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})};n.version="1.43.4"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(t,n,h){t("./lib/fixoldbrowsers");var i=t("./config");i.setLoader(function(l,r){t([l],function(a){r(null,a)})});var s=(function(){return this||typeof window<"u"&&window})();h.exports=function(l){i.init=d,i.$require=t,l.require=t},d(!0);function d(l){if(!(!s||!s.document)){i.set("packaged",l||t.packaged||h.packaged||s.define&&(void 0).packaged);var r={},a="",c=document.currentScript||document._currentScript,p=c&&c.ownerDocument||document;c&&c.src&&(a=c.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var u=p.getElementsByTagName("script"),f=0;f<u.length;f++){var g=u[f],v=g.src||g.getAttribute("src");if(v){for(var b=g.attributes,D=0,E=b.length;D<E;D++){var w=b[D];w.name.indexOf("data-ace-")===0&&(r[o(w.name.replace(/^data-ace-/,""))]=w.value)}var y=v.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);y&&(a=y[1])}}a&&(r.base=r.base||a,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var A in r)typeof r[A]<"u"&&i.set(A,r[A])}}function o(l){return l.replace(/-(.)/g,function(r,a){return a.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(t,n,h){var i=(function(){function s(d,o,l,r){this.start={row:d,column:o},this.end={row:l,column:r}}return s.prototype.isEqual=function(d){return this.start.row===d.start.row&&this.end.row===d.end.row&&this.start.column===d.start.column&&this.end.column===d.end.column},s.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},s.prototype.contains=function(d,o){return this.compare(d,o)==0},s.prototype.compareRange=function(d){var o,l=d.end,r=d.start;return o=this.compare(l.row,l.column),o==1?(o=this.compare(r.row,r.column),o==1?2:o==0?1:0):o==-1?-2:(o=this.compare(r.row,r.column),o==-1?-1:o==1?42:0)},s.prototype.comparePoint=function(d){return this.compare(d.row,d.column)},s.prototype.containsRange=function(d){return this.comparePoint(d.start)==0&&this.comparePoint(d.end)==0},s.prototype.intersects=function(d){var o=this.compareRange(d);return o==-1||o==0||o==1},s.prototype.isEnd=function(d,o){return this.end.row==d&&this.end.column==o},s.prototype.isStart=function(d,o){return this.start.row==d&&this.start.column==o},s.prototype.setStart=function(d,o){typeof d=="object"?(this.start.column=d.column,this.start.row=d.row):(this.start.row=d,this.start.column=o)},s.prototype.setEnd=function(d,o){typeof d=="object"?(this.end.column=d.column,this.end.row=d.row):(this.end.row=d,this.end.column=o)},s.prototype.inside=function(d,o){return this.compare(d,o)==0?!(this.isEnd(d,o)||this.isStart(d,o)):!1},s.prototype.insideStart=function(d,o){return this.compare(d,o)==0?!this.isEnd(d,o):!1},s.prototype.insideEnd=function(d,o){return this.compare(d,o)==0?!this.isStart(d,o):!1},s.prototype.compare=function(d,o){return!this.isMultiLine()&&d===this.start.row?o<this.start.column?-1:o>this.end.column?1:0:d<this.start.row?-1:d>this.end.row?1:this.start.row===d?o>=this.start.column?0:-1:this.end.row===d?o<=this.end.column?0:1:0},s.prototype.compareStart=function(d,o){return this.start.row==d&&this.start.column==o?-1:this.compare(d,o)},s.prototype.compareEnd=function(d,o){return this.end.row==d&&this.end.column==o?1:this.compare(d,o)},s.prototype.compareInside=function(d,o){return this.end.row==d&&this.end.column==o?1:this.start.row==d&&this.start.column==o?-1:this.compare(d,o)},s.prototype.clipRows=function(d,o){if(this.end.row>o)var l={row:o+1,column:0};else if(this.end.row<d)var l={row:d,column:0};if(this.start.row>o)var r={row:o+1,column:0};else if(this.start.row<d)var r={row:d,column:0};return s.fromPoints(r||this.start,l||this.end)},s.prototype.extend=function(d,o){var l=this.compare(d,o);if(l==0)return this;if(l==-1)var r={row:d,column:o};else var a={row:d,column:o};return s.fromPoints(r||this.start,a||this.end)},s.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},s.prototype.isMultiLine=function(){return this.start.row!==this.end.row},s.prototype.clone=function(){return s.fromPoints(this.start,this.end)},s.prototype.collapseRows=function(){return this.end.column==0?new s(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new s(this.start.row,0,this.end.row,0)},s.prototype.toScreenRange=function(d){var o=d.documentToScreenPosition(this.start),l=d.documentToScreenPosition(this.end);return new s(o.row,o.column,l.row,l.column)},s.prototype.moveBy=function(d,o){this.start.row+=d,this.start.column+=o,this.end.row+=d,this.end.column+=o},s})();i.fromPoints=function(s,d){return new i(s.row,s.column,d.row,d.column)},i.comparePoints=function(s,d){return s.row-d.row||s.column-d.column},n.Range=i}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(t,n,h){for(var i=t("./oop"),s={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},d={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},o=0;o<10;o++)d["Digit"+o]=48+o,d["Numpad"+o]=96+o,s.PRINTABLE_KEYS[48+o]=""+o,s.FUNCTION_KEYS[96+o]="Numpad"+o;for(var o=65;o<91;o++){var l=String.fromCharCode(o+32);d["Key"+l.toUpperCase()]=o,s.PRINTABLE_KEYS[o]=l}for(var o=1;o<13;o++)d["F"+o]=111+o,s.FUNCTION_KEYS[111+o]="F"+o;var r={Shift:16,Control:17,Alt:18,Meta:224};for(var a in r)d[a]=d[a+"Left"]=d[a+"Right"]=r[a];n.$codeToKeyCode=d,s.PRINTABLE_KEYS[173]="-";for(var c in s.FUNCTION_KEYS){var p=s.FUNCTION_KEYS[c].toLowerCase();s[p]=parseInt(c,10)}for(var c in s.PRINTABLE_KEYS){var p=s.PRINTABLE_KEYS[c].toLowerCase();s[p]=parseInt(c,10)}i.mixin(s,s.MODIFIER_KEYS),i.mixin(s,s.PRINTABLE_KEYS),i.mixin(s,s.FUNCTION_KEYS),s.enter=s.return,s.escape=s.esc,s.del=s.delete,(function(){for(var u=["cmd","ctrl","alt","shift"],f=Math.pow(2,u.length);f--;)s.KEY_MODS[f]=u.filter(function(g){return f&s.KEY_MODS[g]}).join("-")+"-"})(),s.KEY_MODS[0]="",s.KEY_MODS[-1]="input-",i.mixin(n,s),n.default=n,n.keyCodeToString=function(u){var f=s[u];return typeof f!="string"&&(f=String.fromCharCode(u)),f.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,h){var i=t("./keys"),s=t("./useragent"),d=null,o=0,l;function r(){l=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return l={passive:!1},!0}})}catch{}}function a(){return l==null&&r(),l}function c(D,E,w){this.elem=D,this.type=E,this.callback=w}c.prototype.destroy=function(){u(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var p=n.addListener=function(D,E,w,y){D.addEventListener(E,w,a()),y&&y.$toDestroy.push(new c(D,E,w))},u=n.removeListener=function(D,E,w){D.removeEventListener(E,w,a())};n.stopEvent=function(D){return n.stopPropagation(D),n.preventDefault(D),!1},n.stopPropagation=function(D){D.stopPropagation&&D.stopPropagation()},n.preventDefault=function(D){D.preventDefault&&D.preventDefault()},n.getButton=function(D){return D.type=="dblclick"?0:D.type=="contextmenu"||s.isMac&&D.ctrlKey&&!D.altKey&&!D.shiftKey?2:D.button},n.capture=function(D,E,w){var y=D&&D.ownerDocument||document;function A(T){E&&E(T),w&&w(T),u(y,"mousemove",E),u(y,"mouseup",A),u(y,"dragstart",A)}return p(y,"mousemove",E),p(y,"mouseup",A),p(y,"dragstart",A),A},n.addMouseWheelListener=function(D,E,w){p(D,"wheel",function(y){var A=.15,T=y.deltaX||0,x=y.deltaY||0;switch(y.deltaMode){case y.DOM_DELTA_PIXEL:y.wheelX=T*A,y.wheelY=x*A;break;case y.DOM_DELTA_LINE:var M=15;y.wheelX=T*M,y.wheelY=x*M;break;case y.DOM_DELTA_PAGE:var O=150;y.wheelX=T*O,y.wheelY=x*O;break}E(y)},w)},n.addMultiMouseDownListener=function(D,E,w,y,A){var T=0,x,M,O,_={2:"dblclick",3:"tripleclick",4:"quadclick"};function k(S){if(n.getButton(S)!==0?T=0:S.detail>1?(T++,T>4&&(T=1)):T=1,s.isIE){var C=Math.abs(S.clientX-x)>5||Math.abs(S.clientY-M)>5;(!O||C)&&(T=1),O&&clearTimeout(O),O=setTimeout(function(){O=null},E[T-1]||600),T==1&&(x=S.clientX,M=S.clientY)}if(S._clicks=T,w[y]("mousedown",S),T>4)T=0;else if(T>1)return w[y](_[T],S)}Array.isArray(D)||(D=[D]),D.forEach(function(S){p(S,"mousedown",k,A)})};function f(D){return 0|(D.ctrlKey?1:0)|(D.altKey?2:0)|(D.shiftKey?4:0)|(D.metaKey?8:0)}n.getModifierString=function(D){return i.KEY_MODS[f(D)]};function g(D,E,w){var y=f(E);if(!w&&E.code&&(w=i.$codeToKeyCode[E.code]||w),!s.isMac&&d){if(E.getModifierState&&(E.getModifierState("OS")||E.getModifierState("Win"))&&(y|=8),d.altGr)if((3&y)!=3)d.altGr=0;else return;if(w===18||w===17){var A=E.location;if(w===17&&A===1)d[w]==1&&(o=E.timeStamp);else if(w===18&&y===3&&A===2){var T=E.timeStamp-o;T<50&&(d.altGr=!0)}}}if(w in i.MODIFIER_KEYS&&(w=-1),!(!y&&w===13&&E.location===3&&(D(E,y,-w),E.defaultPrevented))){if(s.isChromeOS&&y&8){if(D(E,y,w),E.defaultPrevented)return;y&=-9}return!y&&!(w in i.FUNCTION_KEYS)&&!(w in i.PRINTABLE_KEYS)?!1:D(E,y,w)}}n.addCommandKeyListener=function(D,E,w){var y=null;p(D,"keydown",function(A){d[A.keyCode]=(d[A.keyCode]||0)+1;var T=g(E,A,A.keyCode);return y=A.defaultPrevented,T},w),p(D,"keypress",function(A){y&&(A.ctrlKey||A.altKey||A.shiftKey||A.metaKey)&&(n.stopEvent(A),y=null)},w),p(D,"keyup",function(A){d[A.keyCode]=null},w),d||(v(),p(window,"focus",v))};function v(){d=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!s.isOldIE){var b=1;n.nextTick=function(D,E){E=E||window;var w="zero-timeout-message-"+b++,y=function(A){A.data==w&&(n.stopPropagation(A),u(E,"message",y),D())};p(E,"message",y),E.postMessage(w,"*")}}n.$idleBlocked=!1,n.onIdle=function(D,E){return setTimeout(function w(){n.$idleBlocked?setTimeout(w,100):D()},E)},n.$idleBlockId=null,n.blockIdle=function(D){n.$idleBlockId&&clearTimeout(n.$idleBlockId),n.$idleBlocked=!0,n.$idleBlockId=setTimeout(function(){n.$idleBlocked=!1},D||100)},n.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),n.nextFrame?n.nextFrame=n.nextFrame.bind(window):n.nextFrame=function(D){setTimeout(D,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(t,n,h){var i;h.exports={lineMode:!1,pasteCancelled:function(){return i&&i>Date.now()-50?!0:i=!1},cancel:function(){i=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(t,n,h){var i=t("../lib/event"),s=t("../config").nls,d=t("../lib/useragent"),o=t("../lib/dom"),l=t("../lib/lang"),r=t("../clipboard"),a=d.isChrome<18,c=d.isIE,p=d.isChrome>63,u=400,f=t("../lib/keys"),g=f.KEY_MODS,v=d.isIOS,b=v?/\s/:/\n/,D=d.isMobile,E=(function(){function w(y,A){var T=this;this.host=A,this.text=o.createElement("textarea"),this.text.className="ace_text-input",this.text.setAttribute("wrap","off"),this.text.setAttribute("autocomplete","off"),this.text.setAttribute("autocorrect","off"),this.text.setAttribute("autocapitalize","off"),this.text.setAttribute("spellcheck","false"),this.text.style.opacity="0",y.insertBefore(this.text,y.firstChild),this.copied=!1,this.pasted=!1,this.inComposition=!1,this.sendingText=!1,this.tempStyle="",D||(this.text.style.fontSize="1px"),this.commandMode=!1,this.ignoreFocusEvents=!1,this.lastValue="",this.lastSelectionStart=0,this.lastSelectionEnd=0,this.lastRestoreEnd=0,this.rowStart=Number.MAX_SAFE_INTEGER,this.rowEnd=Number.MIN_SAFE_INTEGER,this.numberOfExtraLines=0;try{this.$isFocused=document.activeElement===this.text}catch{}this.cancelComposition=this.cancelComposition.bind(this),this.setAriaOptions({role:"textbox"}),i.addListener(this.text,"blur",function(x){T.ignoreFocusEvents||(A.onBlur(x),T.$isFocused=!1)},A),i.addListener(this.text,"focus",function(x){if(!T.ignoreFocusEvents){if(T.$isFocused=!0,d.isEdge)try{if(!document.hasFocus())return}catch{}A.onFocus(x),d.isEdge?setTimeout(T.resetSelection.bind(T)):T.resetSelection()}},A),this.$focusScroll=!1,A.on("beforeEndOperation",function(){var x=A.curOp,M=x&&x.command&&x.command.name;if(M!="insertstring"){var O=M&&(x.docChanged||x.selectionChanged);T.inComposition&&O&&(T.lastValue=T.text.value="",T.onCompositionEnd()),T.resetSelection()}}),A.on("changeSelection",this.setAriaLabel.bind(this)),this.resetSelection=v?this.$resetSelectionIOS:this.$resetSelection,this.$isFocused&&A.onFocus(),this.inputHandler=null,this.afterContextMenu=!1,i.addCommandKeyListener(this.text,function(x,M,O){if(!T.inComposition)return A.onCommandKey(x,M,O)},A),i.addListener(this.text,"select",this.onSelect.bind(this),A),i.addListener(this.text,"input",this.onInput.bind(this),A),i.addListener(this.text,"cut",this.onCut.bind(this),A),i.addListener(this.text,"copy",this.onCopy.bind(this),A),i.addListener(this.text,"paste",this.onPaste.bind(this),A),(!("oncut"in this.text)||!("oncopy"in this.text)||!("onpaste"in this.text))&&i.addListener(y,"keydown",function(x){if(!(d.isMac&&!x.metaKey||!x.ctrlKey))switch(x.keyCode){case 67:T.onCopy(x);break;case 86:T.onPaste(x);break;case 88:T.onCut(x);break}},A),this.syncComposition=l.delayedCall(this.onCompositionUpdate.bind(this),50).schedule.bind(null,null),i.addListener(this.text,"compositionstart",this.onCompositionStart.bind(this),A),i.addListener(this.text,"compositionupdate",this.onCompositionUpdate.bind(this),A),i.addListener(this.text,"keyup",this.onKeyup.bind(this),A),i.addListener(this.text,"keydown",this.syncComposition.bind(this),A),i.addListener(this.text,"compositionend",this.onCompositionEnd.bind(this),A),this.closeTimeout,i.addListener(this.text,"mouseup",this.$onContextMenu.bind(this),A),i.addListener(this.text,"mousedown",function(x){x.preventDefault(),T.onContextMenuClose()},A),i.addListener(A.renderer.scroller,"contextmenu",this.$onContextMenu.bind(this),A),i.addListener(this.text,"contextmenu",this.$onContextMenu.bind(this),A),v&&this.addIosSelectionHandler(y,A,this.text)}return w.prototype.addIosSelectionHandler=function(y,A,T){var x=this,M=null,O=!1;T.addEventListener("keydown",function(k){M&&clearTimeout(M),O=!0},!0),T.addEventListener("keyup",function(k){M=setTimeout(function(){O=!1},100)},!0);var _=function(k){if(document.activeElement===T&&!(O||x.inComposition||A.$mouseHandler.isMousePressed)&&!x.copied){var S=T.selectionStart,C=T.selectionEnd,L=null,I=0;if(S==0?L=f.up:S==1?L=f.home:C>x.lastSelectionEnd&&x.lastValue[C]==`
175
- `?L=f.end:S<x.lastSelectionStart&&x.lastValue[S-1]==" "?(L=f.left,I=g.option):S<x.lastSelectionStart||S==x.lastSelectionStart&&x.lastSelectionEnd!=x.lastSelectionStart&&S==C?L=f.left:C>x.lastSelectionEnd&&x.lastValue.slice(0,C).split(`
176
- `).length>2?L=f.down:C>x.lastSelectionEnd&&x.lastValue[C-1]==" "?(L=f.right,I=g.option):(C>x.lastSelectionEnd||C==x.lastSelectionEnd&&x.lastSelectionEnd!=x.lastSelectionStart&&S==C)&&(L=f.right),S!==C&&(I|=g.shift),L){var F=A.onCommandKey({},I,L);if(!F&&A.commands){L=f.keyCodeToString(L);var R=A.commands.findKeyCommand(I,L);R&&A.execCommand(R)}x.lastSelectionStart=S,x.lastSelectionEnd=C,x.resetSelection("")}}};document.addEventListener("selectionchange",_),A.on("destroy",function(){document.removeEventListener("selectionchange",_)})},w.prototype.onContextMenuClose=function(){var y=this;clearTimeout(this.closeTimeout),this.closeTimeout=setTimeout(function(){y.tempStyle&&(y.text.style.cssText=y.tempStyle,y.tempStyle=""),y.host.renderer.$isMousePressed=!1,y.host.renderer.$keepTextAreaAtCursor&&y.host.renderer.$moveTextAreaToCursor()},0)},w.prototype.$onContextMenu=function(y){this.host.textInput.onContextMenu(y),this.onContextMenuClose()},w.prototype.onKeyup=function(y){y.keyCode==27&&this.text.value.length<this.text.selectionStart&&(this.inComposition||(this.lastValue=this.text.value),this.lastSelectionStart=this.lastSelectionEnd=-1,this.resetSelection()),this.syncComposition()},w.prototype.cancelComposition=function(){this.ignoreFocusEvents=!0,this.text.blur(),this.text.focus(),this.ignoreFocusEvents=!1},w.prototype.onCompositionStart=function(y){if(!(this.inComposition||!this.host.onCompositionStart||this.host.$readOnly)&&(this.inComposition={},!this.commandMode)){y.data&&(this.inComposition.useTextareaForIME=!1),setTimeout(this.onCompositionUpdate.bind(this),0),this.host._signal("compositionStart"),this.host.on("mousedown",this.cancelComposition);var A=this.host.getSelectionRange();A.end.row=A.start.row,A.end.column=A.start.column,this.inComposition.markerRange=A,this.inComposition.selectionStart=this.lastSelectionStart,this.host.onCompositionStart(this.inComposition),this.inComposition.useTextareaForIME?(this.lastValue=this.text.value="",this.lastSelectionStart=0,this.lastSelectionEnd=0):(this.text.msGetInputContext&&(this.inComposition.context=this.text.msGetInputContext()),this.text.getInputContext&&(this.inComposition.context=this.text.getInputContext()))}},w.prototype.onCompositionUpdate=function(){if(!(!this.inComposition||!this.host.onCompositionUpdate||this.host.$readOnly)){if(this.commandMode)return this.cancelComposition();if(this.inComposition.useTextareaForIME)this.host.onCompositionUpdate(this.text.value);else{var y=this.text.value;this.sendText(y),this.inComposition.markerRange&&(this.inComposition.context&&(this.inComposition.markerRange.start.column=this.inComposition.selectionStart=this.inComposition.context.compositionStartOffset),this.inComposition.markerRange.end.column=this.inComposition.markerRange.start.column+this.lastSelectionEnd-this.inComposition.selectionStart+this.lastRestoreEnd)}}},w.prototype.onCompositionEnd=function(y){!this.host.onCompositionEnd||this.host.$readOnly||(this.inComposition=!1,this.host.onCompositionEnd(),this.host.off("mousedown",this.cancelComposition),y&&this.onInput())},w.prototype.onCut=function(y){this.doCopy(y,!0)},w.prototype.onCopy=function(y){this.doCopy(y,!1)},w.prototype.onPaste=function(y){var A=this.handleClipboardData(y);r.pasteCancelled()||(typeof A=="string"?(A&&this.host.onPaste(A,y),d.isIE&&setTimeout(this.resetSelection),i.preventDefault(y)):(this.text.value="",this.pasted=!0))},w.prototype.doCopy=function(y,A){var T=this,x=this.host.getCopyText();if(!x)return i.preventDefault(y);this.handleClipboardData(y,x)?(v&&(this.resetSelection(x),this.copied=x,setTimeout(function(){T.copied=!1},10)),A?this.host.onCut():this.host.onCopy(),i.preventDefault(y)):(this.copied=!0,this.text.value=x,this.text.select(),setTimeout(function(){T.copied=!1,T.resetSelection(),A?T.host.onCut():T.host.onCopy()}))},w.prototype.handleClipboardData=function(y,A,T){var x=y.clipboardData||window.clipboardData;if(!(!x||a)){var M=c||T?"Text":"text/plain";try{return A?x.setData(M,A)!==!1:x.getData(M)}catch(O){if(!T)return this.handleClipboardData(O,A,!0)}}},w.prototype.onInput=function(y){if(this.inComposition)return this.onCompositionUpdate();if(y&&y.inputType){if(y.inputType=="historyUndo")return this.host.execCommand("undo");if(y.inputType=="historyRedo")return this.host.execCommand("redo")}var A=this.text.value,T=this.sendText(A,!0);(A.length>u+100||b.test(T)||D&&this.lastSelectionStart<1&&this.lastSelectionStart==this.lastSelectionEnd)&&this.resetSelection()},w.prototype.sendText=function(y,A){if(this.afterContextMenu&&(this.afterContextMenu=!1),this.pasted)return this.resetSelection(),y&&this.host.onPaste(y),this.pasted=!1,"";for(var T=this.text.selectionStart,x=this.text.selectionEnd,M=this.lastSelectionStart,O=this.lastValue.length-this.lastSelectionEnd,_=y,k=y.length-T,S=y.length-x,C=0;M>0&&this.lastValue[C]==y[C];)C++,M--;for(_=_.slice(C),C=1;O>0&&this.lastValue.length-C>this.lastSelectionStart-1&&this.lastValue[this.lastValue.length-C]==y[y.length-C];)C++,O--;k-=C-1,S-=C-1;var L=_.length-C+1;if(L<0&&(M=-L,L=0),_=_.slice(0,L),!A&&!_&&!k&&!M&&!O&&!S)return"";this.sendingText=!0;var I=!1;return d.isAndroid&&_==". "&&(_=" ",I=!0),_&&!M&&!O&&!k&&!S||this.commandMode?this.host.onTextInput(_):this.host.onTextInput(_,{extendLeft:M,extendRight:O,restoreStart:k,restoreEnd:S}),this.sendingText=!1,this.lastValue=y,this.lastSelectionStart=T,this.lastSelectionEnd=x,this.lastRestoreEnd=S,I?`
177
- `:_},w.prototype.onSelect=function(y){var A=this;if(!this.inComposition){var T=function(x){return x.selectionStart===0&&x.selectionEnd>=A.lastValue.length&&x.value===A.lastValue&&A.lastValue&&x.selectionEnd!==A.lastSelectionEnd};this.copied?this.copied=!1:T(this.text)?(this.host.selectAll(),this.resetSelection()):D&&this.text.selectionStart!=this.lastSelectionStart&&this.resetSelection()}},w.prototype.$resetSelectionIOS=function(y){if(!(!this.$isFocused||this.copied&&!y||this.sendingText)){y||(y="");var A=`
178
- ab`+y+`cde fg
179
- `;A!=this.text.value&&(this.text.value=this.lastValue=A);var T=4,x=4+(y.length||(this.host.selection.isEmpty()?0:1));(this.lastSelectionStart!=T||this.lastSelectionEnd!=x)&&this.text.setSelectionRange(T,x),this.lastSelectionStart=T,this.lastSelectionEnd=x}},w.prototype.$resetSelection=function(){var y=this;if(!(this.inComposition||this.sendingText)&&!(!this.$isFocused&&!this.afterContextMenu)){this.inComposition=!0;var A=0,T=0,x="",M=function(R,B){for(var N=B,z=1;z<=R-y.rowStart&&z<2*y.numberOfExtraLines+1;z++)N+=y.host.session.getLine(R-z).length+1;return N};if(this.host.session){var O=this.host.selection,_=O.getRange(),k=O.cursor.row;k===this.rowEnd+1?(this.rowStart=this.rowEnd+1,this.rowEnd=this.rowStart+2*this.numberOfExtraLines):k===this.rowStart-1?(this.rowEnd=this.rowStart-1,this.rowStart=this.rowEnd-2*this.numberOfExtraLines):(k<this.rowStart-1||k>this.rowEnd+1)&&(this.rowStart=k>this.numberOfExtraLines?k-this.numberOfExtraLines:0,this.rowEnd=k>this.numberOfExtraLines?k+this.numberOfExtraLines:2*this.numberOfExtraLines);for(var S=[],C=this.rowStart;C<=this.rowEnd;C++)S.push(this.host.session.getLine(C));if(x=S.join(`
180
- `),A=M(_.start.row,_.start.column),T=M(_.end.row,_.end.column),_.start.row<this.rowStart){var L=this.host.session.getLine(this.rowStart-1);A=_.start.row<this.rowStart-1?0:A,T+=L.length+1,x=L+`
181
- `+x}else if(_.end.row>this.rowEnd){var I=this.host.session.getLine(this.rowEnd+1);T=_.end.row>this.rowEnd+1?I.length:_.end.column,T+=x.length+1,x=x+`
182
- `+I}else D&&k>0&&(x=`
183
- `+x,T+=1,A+=1);x.length>u&&(A<u&&T<u?x=x.slice(0,u):(x=`
184
- `,A==T?A=T=0:(A=0,T=1)));var F=x+`
185
-
186
- `;F!=this.lastValue&&(this.text.value=this.lastValue=F,this.lastSelectionStart=this.lastSelectionEnd=F.length)}if(this.afterContextMenu&&(this.lastSelectionStart=this.text.selectionStart,this.lastSelectionEnd=this.text.selectionEnd),this.lastSelectionEnd!=T||this.lastSelectionStart!=A||this.text.selectionEnd!=this.lastSelectionEnd)try{this.text.setSelectionRange(A,T),this.lastSelectionStart=A,this.lastSelectionEnd=T}catch{}this.inComposition=!1}},w.prototype.setHost=function(y){this.host=y},w.prototype.setNumberOfExtraLines=function(y){if(this.rowStart=Number.MAX_SAFE_INTEGER,this.rowEnd=Number.MIN_SAFE_INTEGER,y<0){this.numberOfExtraLines=0;return}this.numberOfExtraLines=y},w.prototype.setAriaLabel=function(){var y="";if(this.host.$textInputAriaLabel&&(y+="".concat(this.host.$textInputAriaLabel,", ")),this.host.session){var A=this.host.session.selection.cursor.row;y+=s("text-input.aria-label","Cursor at row $0",[A+1])}this.text.setAttribute("aria-label",y)},w.prototype.setAriaOptions=function(y){y.activeDescendant?(this.text.setAttribute("aria-haspopup","true"),this.text.setAttribute("aria-autocomplete",y.inline?"both":"list"),this.text.setAttribute("aria-activedescendant",y.activeDescendant)):(this.text.setAttribute("aria-haspopup","false"),this.text.setAttribute("aria-autocomplete","both"),this.text.removeAttribute("aria-activedescendant")),y.role&&this.text.setAttribute("role",y.role),y.setLabel&&(this.text.setAttribute("aria-roledescription",s("text-input.aria-roledescription","editor")),this.setAriaLabel())},w.prototype.focus=function(){var y=this;if(this.setAriaOptions({setLabel:this.host.renderer.enableKeyboardAccessibility}),this.tempStyle||p||this.$focusScroll=="browser")return this.text.focus({preventScroll:!0});var A=this.text.style.top;this.text.style.position="fixed",this.text.style.top="0px";try{var T=this.text.getBoundingClientRect().top!=0}catch{return}var x=[];if(T)for(var M=this.text.parentElement;M&&M.nodeType==1;)x.push(M),M.setAttribute("ace_nocontext","true"),!M.parentElement&&M.getRootNode?M=M.getRootNode().host:M=M.parentElement;this.text.focus({preventScroll:!0}),T&&x.forEach(function(O){O.removeAttribute("ace_nocontext")}),setTimeout(function(){y.text.style.position="",y.text.style.top=="0px"&&(y.text.style.top=A)},0)},w.prototype.blur=function(){this.text.blur()},w.prototype.isFocused=function(){return this.$isFocused},w.prototype.setInputHandler=function(y){this.inputHandler=y},w.prototype.getInputHandler=function(){return this.inputHandler},w.prototype.getElement=function(){return this.text},w.prototype.setCommandMode=function(y){this.commandMode=y,this.text.readOnly=!1},w.prototype.setReadOnly=function(y){this.commandMode||(this.text.readOnly=y)},w.prototype.setCopyWithEmptySelection=function(y){},w.prototype.onContextMenu=function(y){this.afterContextMenu=!0,this.resetSelection(),this.host._emit("nativecontextmenu",{target:this.host,domEvent:y}),this.moveToMouse(y,!0)},w.prototype.moveToMouse=function(y,A){var T=this;this.tempStyle||(this.tempStyle=this.text.style.cssText),this.text.style.cssText=(A?"z-index:100000;":"")+(d.isIE?"opacity:0.1;":"")+"text-indent: -"+(this.lastSelectionStart+this.lastSelectionEnd)*this.host.renderer.characterWidth*.5+"px;";var x=this.host.container.getBoundingClientRect(),M=o.computedStyle(this.host.container),O=x.top+(parseInt(M.borderTopWidth)||0),_=x.left+(parseInt(M.borderLeftWidth)||0),k=x.bottom-O-this.text.clientHeight-2,S=function(C){o.translate(T.text,C.clientX-_-2,Math.min(C.clientY-O-2,k))};S(y),y.type=="mousedown"&&(this.host.renderer.$isMousePressed=!0,clearTimeout(this.closeTimeout),d.isWin&&i.capture(this.host.container,S,this.onContextMenuClose.bind(this)))},w.prototype.destroy=function(){this.text.parentElement&&this.text.parentElement.removeChild(this.text)},w})();n.TextInput=E,n.$setUserAgentForTests=function(w,y){D=w,v=y}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,n,h){var i=t("../lib/useragent"),s=0,d=550,o=(function(){function a(c){c.$clickSelection=null;var p=c.editor;p.setDefaultHandler("mousedown",this.onMouseDown.bind(c)),p.setDefaultHandler("dblclick",this.onDoubleClick.bind(c)),p.setDefaultHandler("tripleclick",this.onTripleClick.bind(c)),p.setDefaultHandler("quadclick",this.onQuadClick.bind(c)),p.setDefaultHandler("mousewheel",this.onMouseWheel.bind(c));var u=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];u.forEach(function(f){c[f]=this[f]},this),c.selectByLines=this.extendSelectionBy.bind(c,"getLineRange"),c.selectByWords=this.extendSelectionBy.bind(c,"getWordRange")}return a.prototype.onMouseDown=function(c){var p=c.inSelection(),u=c.getDocumentPosition();this.mousedownEvent=c;var f=this.editor,g=c.getButton();if(g!==0){var v=f.getSelectionRange(),b=v.isEmpty();(b||g==1)&&f.selection.moveToPosition(u),g==2&&(f.textInput.onContextMenu(c.domEvent),i.isMozilla||c.preventDefault());return}if(this.mousedownEvent.time=Date.now(),p&&!f.isFocused()&&(f.focus(),this.$focusTimeout&&!this.$clickSelection&&!f.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(c);return}return this.captureMouse(c),this.startSelect(u,c.domEvent._clicks>1),c.preventDefault()},a.prototype.startSelect=function(c,p){c=c||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var u=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?u.selection.selectToPosition(c):p||u.selection.moveToPosition(c),p||this.select(),u.setStyle("ace_selecting"),this.setState("select"))},a.prototype.select=function(){var c,p=this.editor,u=p.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var f=this.$clickSelection.comparePoint(u);if(f==-1)c=this.$clickSelection.end;else if(f==1)c=this.$clickSelection.start;else{var g=r(this.$clickSelection,u,p.session);u=g.cursor,c=g.anchor}p.selection.setSelectionAnchor(c.row,c.column)}p.selection.selectToPosition(u),p.renderer.scrollCursorIntoView()},a.prototype.extendSelectionBy=function(c){var p,u=this.editor,f=u.renderer.screenToTextCoordinates(this.x,this.y),g=u.selection[c](f.row,f.column);if(this.$clickSelection){var v=this.$clickSelection.comparePoint(g.start),b=this.$clickSelection.comparePoint(g.end);if(v==-1&&b<=0)p=this.$clickSelection.end,(g.end.row!=f.row||g.end.column!=f.column)&&(f=g.start);else if(b==1&&v>=0)p=this.$clickSelection.start,(g.start.row!=f.row||g.start.column!=f.column)&&(f=g.end);else if(v==-1&&b==1)f=g.end,p=g.start;else{var D=r(this.$clickSelection,f,u.session);f=D.cursor,p=D.anchor}u.selection.setSelectionAnchor(p.row,p.column)}u.selection.selectToPosition(f),u.renderer.scrollCursorIntoView()},a.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},a.prototype.focusWait=function(){var c=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),p=Date.now();(c>s||p-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},a.prototype.onDoubleClick=function(c){var p=c.getDocumentPosition(),u=this.editor,f=u.session,g=f.getBracketRange(p);g?(g.isEmpty()&&(g.start.column--,g.end.column++),this.setState("select")):(g=u.selection.getWordRange(p.row,p.column),this.setState("selectByWords")),this.$clickSelection=g,this.select()},a.prototype.onTripleClick=function(c){var p=c.getDocumentPosition(),u=this.editor;this.setState("selectByLines");var f=u.getSelectionRange();f.isMultiLine()&&f.contains(p.row,p.column)?(this.$clickSelection=u.selection.getLineRange(f.start.row),this.$clickSelection.end=u.selection.getLineRange(f.end.row).end):this.$clickSelection=u.selection.getLineRange(p.row),this.select()},a.prototype.onQuadClick=function(c){var p=this.editor;p.selectAll(),this.$clickSelection=p.getSelectionRange(),this.setState("selectAll")},a.prototype.onMouseWheel=function(c){if(!c.getAccelKey()){c.getShiftKey()&&c.wheelY&&!c.wheelX&&(c.wheelX=c.wheelY,c.wheelY=0);var p=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var u=this.$lastScroll,f=c.domEvent.timeStamp,g=f-u.t,v=g?c.wheelX/g:u.vx,b=g?c.wheelY/g:u.vy;g<d&&(v=(v+u.vx)/2,b=(b+u.vy)/2);var D=Math.abs(v/b),E=!1;if(D>=1&&p.renderer.isScrollableBy(c.wheelX*c.speed,0)&&(E=!0),D<=1&&p.renderer.isScrollableBy(0,c.wheelY*c.speed)&&(E=!0),E)u.allowed=f;else if(f-u.allowed<d){var w=Math.abs(v)<=1.5*Math.abs(u.vx)&&Math.abs(b)<=1.5*Math.abs(u.vy);w?(E=!0,u.allowed=f):u.allowed=0}if(u.t=f,u.vx=v,u.vy=b,E)return p.renderer.scrollBy(c.wheelX*c.speed,c.wheelY*c.speed),c.stop()}},a})();o.prototype.selectEnd=o.prototype.selectByLinesEnd,o.prototype.selectAllEnd=o.prototype.selectByLinesEnd,o.prototype.selectByWordsEnd=o.prototype.selectByLinesEnd,n.DefaultHandlers=o;function l(a,c,p,u){return Math.sqrt(Math.pow(p-a,2)+Math.pow(u-c,2))}function r(a,c,p){if(a.start.row==a.end.row)var u=2*c.column-a.start.column-a.end.column;else if(a.start.row==a.end.row-1&&!a.start.column&&!a.end.column)var u=3*c.column-2*p.getLine(a.start.row).length;else var u=2*c.row-a.start.row-a.end.row;return u<0?{cursor:a.start,anchor:a.end}:{cursor:a.end,anchor:a.start}}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,h){var i=t("../lib/event"),s=t("../lib/useragent"),d=(function(){function o(l,r){this.speed,this.wheelX,this.wheelY,this.domEvent=l,this.editor=r,this.x=this.clientX=l.clientX,this.y=this.clientY=l.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return o.prototype.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},o.prototype.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},o.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},o.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},o.prototype.getGutterRow=function(){var l=this.getDocumentPosition().row,r=this.editor.session.documentToScreenRow(l,0),a=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return r-a},o.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var l=this.editor,r=l.getSelectionRange();if(r.isEmpty())this.$inSelection=!1;else{var a=this.getDocumentPosition();this.$inSelection=r.contains(a.row,a.column)}return this.$inSelection},o.prototype.getButton=function(){return i.getButton(this.domEvent)},o.prototype.getShiftKey=function(){return this.domEvent.shiftKey},o.prototype.getAccelKey=function(){return s.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},o})();n.MouseEvent=d}),ace.define("ace/lib/scroll",["require","exports","module"],function(t,n,h){n.preventParentScroll=function(s){s.stopPropagation();var d=s.currentTarget,o=d.scrollHeight>d.clientHeight;o||s.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(t,n,h){var i=this&&this.__extends||(function(){var f=function(g,v){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,D){b.__proto__=D}||function(b,D){for(var E in D)Object.prototype.hasOwnProperty.call(D,E)&&(b[E]=D[E])},f(g,v)};return function(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");f(g,v);function b(){this.constructor=g}g.prototype=v===null?Object.create(v):(b.prototype=v.prototype,new b)}})(),s=this&&this.__values||function(f){var g=typeof Symbol=="function"&&Symbol.iterator,v=g&&f[g],b=0;if(v)return v.call(f);if(f&&typeof f.length=="number")return{next:function(){return f&&b>=f.length&&(f=void 0),{value:f&&f[b++],done:!f}}};throw new TypeError(g?"Object is not iterable.":"Symbol.iterator is not defined.")},d=t("./lib/dom");t("./lib/event");var o=t("./range").Range,l=t("./lib/scroll").preventParentScroll,r="ace_tooltip",a=(function(){function f(g){this.isOpen=!1,this.$element=null,this.$parentNode=g}return f.prototype.$init=function(){return this.$element=d.createElement("div"),this.$element.className=r,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},f.prototype.getElement=function(){return this.$element||this.$init()},f.prototype.setText=function(g){this.getElement().textContent=g},f.prototype.setHtml=function(g){this.getElement().innerHTML=g},f.prototype.setPosition=function(g,v){this.getElement().style.left=g+"px",this.getElement().style.top=v+"px"},f.prototype.setClassName=function(g){d.addCssClass(this.getElement(),g)},f.prototype.setTheme=function(g){this.theme&&(this.theme.isDark&&d.removeCssClass(this.getElement(),"ace_dark"),this.theme.cssClass&&d.removeCssClass(this.getElement(),this.theme.cssClass)),g.isDark&&d.addCssClass(this.getElement(),"ace_dark"),g.cssClass&&d.addCssClass(this.getElement(),g.cssClass),this.theme={isDark:g.isDark,cssClass:g.cssClass}},f.prototype.show=function(g,v,b){g!=null&&this.setText(g),v!=null&&b!=null&&this.setPosition(v,b),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},f.prototype.hide=function(g){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=r,this.isOpen=!1)},f.prototype.getHeight=function(){return this.getElement().offsetHeight},f.prototype.getWidth=function(){return this.getElement().offsetWidth},f.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},f})(),c=(function(){function f(){this.popups=[]}return f.prototype.addPopup=function(g){this.popups.push(g),this.updatePopups()},f.prototype.removePopup=function(g){var v=this.popups.indexOf(g);v!==-1&&(this.popups.splice(v,1),this.updatePopups())},f.prototype.updatePopups=function(){var g,v,b,D;this.popups.sort(function(_,k){return k.priority-_.priority});var E=[];try{for(var w=s(this.popups),y=w.next();!y.done;y=w.next()){var A=y.value,T=!0;try{for(var x=(b=void 0,s(E)),M=x.next();!M.done;M=x.next()){var O=M.value;if(this.doPopupsOverlap(O,A)){T=!1;break}}}catch(_){b={error:_}}finally{try{M&&!M.done&&(D=x.return)&&D.call(x)}finally{if(b)throw b.error}}T?E.push(A):A.hide()}}catch(_){g={error:_}}finally{try{y&&!y.done&&(v=w.return)&&v.call(w)}finally{if(g)throw g.error}}},f.prototype.doPopupsOverlap=function(g,v){var b=g.getElement().getBoundingClientRect(),D=v.getElement().getBoundingClientRect();return b.left<D.right&&b.right>D.left&&b.top<D.bottom&&b.bottom>D.top},f})(),p=new c;n.popupManager=p,n.Tooltip=a;var u=(function(f){i(g,f);function g(v){v===void 0&&(v=document.body);var b=f.call(this,v)||this;b.timeout=void 0,b.lastT=0,b.idleTime=350,b.lastEvent=void 0,b.onMouseOut=b.onMouseOut.bind(b),b.onMouseMove=b.onMouseMove.bind(b),b.waitForHover=b.waitForHover.bind(b),b.hide=b.hide.bind(b);var D=b.getElement();return D.style.whiteSpace="pre-wrap",D.style.pointerEvents="auto",D.addEventListener("mouseout",b.onMouseOut),D.tabIndex=-1,D.addEventListener("blur",function(){D.contains(document.activeElement)||this.hide()}.bind(b)),D.addEventListener("wheel",l),b}return g.prototype.addToEditor=function(v){v.on("mousemove",this.onMouseMove),v.on("mousedown",this.hide);var b=v.renderer.getMouseEventTarget();b&&typeof b.removeEventListener=="function"&&b.addEventListener("mouseout",this.onMouseOut,!0)},g.prototype.removeFromEditor=function(v){v.off("mousemove",this.onMouseMove),v.off("mousedown",this.hide);var b=v.renderer.getMouseEventTarget();b&&typeof b.removeEventListener=="function"&&b.removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},g.prototype.onMouseMove=function(v,b){this.lastEvent=v,this.lastT=Date.now();var D=b.$mouseHandler.isMousePressed;if(this.isOpen){var E=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(E.row,E.column)||D||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||D||(this.lastEvent=v,this.timeout=setTimeout(this.waitForHover,this.idleTime))},g.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var v=Date.now()-this.lastT;if(this.idleTime-v>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-v);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},g.prototype.isOutsideOfText=function(v){var b=v.editor,D=v.getDocumentPosition(),E=b.session.getLine(D.row);if(D.column==E.length){var w=b.renderer.pixelToScreenCoordinates(v.clientX,v.clientY),y=b.session.documentToScreenPosition(D.row,D.column);if(y.column!=w.column||y.row!=w.row)return!0}return!1},g.prototype.setDataProvider=function(v){this.$gatherData=v},g.prototype.showForRange=function(v,b,D,E){if(!(E&&E!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var w=v.renderer;this.isOpen||(p.addPopup(this),this.$registerCloseEvents(),this.setTheme(w.theme)),this.isOpen=!0,this.range=o.fromPoints(b.start,b.end);var y=w.textToScreenCoordinates(b.start.row,b.start.column),A=w.scroller.getBoundingClientRect();y.pageX<A.left&&(y.pageX=A.left);var T=this.getElement();T.innerHTML="",T.appendChild(D),T.style.maxHeight="",T.style.display="block",this.$setPosition(v,y,!0,b),d.$fixPositionBug(T)}},g.prototype.$setPosition=function(v,b,D,E){var w=10;D&&this.addMarker(E,v.session);var y=v.renderer,A=this.getElement(),T=A.offsetHeight,x=A.offsetWidth,M=b.pageY,O=b.pageX,_=window.innerHeight-M-y.lineHeight,k=this.$shouldPlaceAbove(T,M,_-w);A.style.maxHeight=(k?M:_)-w+"px",A.style.top=k?"":M+y.lineHeight+"px",A.style.bottom=k?window.innerHeight-M+"px":"",A.style.left=Math.min(O,window.innerWidth-x-w)+"px"},g.prototype.$shouldPlaceAbove=function(v,b,D){return!(b-v<0&&b<D)},g.prototype.addMarker=function(v,b){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=b,this.marker=b&&b.addMarker(v,"ace_highlight-marker","text")},g.prototype.hide=function(v){v&&this.$fromKeyboard&&v.type=="keydown"&&v.code=="Escape"||!v&&document.activeElement==this.getElement()||v&&v.target&&(v.type!="keydown"||v.ctrlKey||v.metaKey)&&this.$element.contains(v.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$fromKeyboard=!1,this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,p.removePopup(this)))},g.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},g.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},g.prototype.onMouseOut=function(v){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!v.relatedTarget||this.getElement().contains(v.relatedTarget)||v&&v.currentTarget.contains(v.relatedTarget)||v.relatedTarget.classList.contains("ace_content")||this.hide())},g})(a);n.HoverTooltip=u}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/mouse/mouse_event","ace/tooltip","ace/config","ace/range"],function(t,n,h){var i=this&&this.__extends||(function(){var u=function(f,g){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,b){v.__proto__=b}||function(v,b){for(var D in b)Object.prototype.hasOwnProperty.call(b,D)&&(v[D]=b[D])},u(f,g)};return function(f,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");u(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})(),s=this&&this.__values||function(u){var f=typeof Symbol=="function"&&Symbol.iterator,g=f&&u[f],v=0;if(g)return g.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&v>=u.length&&(u=void 0),{value:u&&u[v++],done:!u}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},d=t("../lib/dom"),o=t("./mouse_event").MouseEvent,l=t("../tooltip").HoverTooltip,r=t("../config").nls,a=t("../range").Range;function c(u){var f=u.editor,g=f.renderer.$gutterLayer;u.$tooltip=new p(f),u.$tooltip.addToEditor(f),u.$tooltip.setDataProvider(function(v,b){var D=v.getDocumentPosition().row;u.$tooltip.showTooltip(D)}),u.editor.setDefaultHandler("guttermousedown",function(v){if(!(!f.isFocused()||v.getButton()!=0)){var b=g.getRegion(v);if(b!="foldWidgets"){var D=v.getDocumentPosition().row,E=f.session.selection;if(v.getShiftKey())E.selectTo(D,0);else{if(v.domEvent.detail==2)return f.selectAll(),v.preventDefault();u.$clickSelection=f.selection.getLineRange(D)}return u.setState("selectByLines"),u.captureMouse(v),v.preventDefault()}}})}n.GutterHandler=c;var p=(function(u){i(f,u);function f(g){var v=u.call(this,g.container)||this;v.id="gt"+ ++f.$uid,v.editor=g,v.visibleTooltipRow;var b=v.getElement();return b.setAttribute("role","tooltip"),b.setAttribute("id",v.id),b.style.pointerEvents="auto",v.idleTime=50,v.onDomMouseMove=v.onDomMouseMove.bind(v),v.onDomMouseOut=v.onDomMouseOut.bind(v),v.setClassName("ace_gutter-tooltip"),v}return f.prototype.onDomMouseMove=function(g){var v=new o(g,this.editor);this.onMouseMove(v,this.editor)},f.prototype.onDomMouseOut=function(g){var v=new o(g,this.editor);this.onMouseOut(v)},f.prototype.addToEditor=function(g){var v=g.renderer.$gutter;v.addEventListener("mousemove",this.onDomMouseMove),v.addEventListener("mouseout",this.onDomMouseOut),u.prototype.addToEditor.call(this,g)},f.prototype.removeFromEditor=function(g){var v=g.renderer.$gutter;v.removeEventListener("mousemove",this.onDomMouseMove),v.removeEventListener("mouseout",this.onDomMouseOut),u.prototype.removeFromEditor.call(this,g)},f.prototype.destroy=function(){this.editor&&this.removeFromEditor(this.editor),u.prototype.destroy.call(this)},Object.defineProperty(f,"annotationLabels",{get:function(){return{error:{singular:r("gutter-tooltip.aria-label.error.singular","error"),plural:r("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:r("gutter-tooltip.aria-label.security.singular","security finding"),plural:r("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:r("gutter-tooltip.aria-label.warning.singular","warning"),plural:r("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:r("gutter-tooltip.aria-label.info.singular","information message"),plural:r("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:r("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:r("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),f.prototype.showTooltip=function(g){var v,b=this.editor.renderer.$gutterLayer,D=b.$annotations[g],E;D?E={displayText:Array.from(D.displayText),type:Array.from(D.type)}:E={displayText:[],type:[]};var w=b.session.getFoldLine(g);if(w&&b.$showFoldedAnnotations){for(var y={error:[],security:[],warning:[],info:[],hint:[]},A={error:1,security:2,warning:3,info:4,hint:5},T,x=g+1;x<=w.end.row;x++)if(b.$annotations[x])for(var M=0;M<b.$annotations[x].text.length;M++){var O=b.$annotations[x].type[M];y[O].push(b.$annotations[x].text[M]),(!T||A[O]<A[T])&&(T=O)}if(["error","security","warning"].includes(T)){var _="".concat(f.annotationsToSummaryString(y)," in folded code.");E.displayText.push(_),E.type.push(T+"_fold")}}if(E.displayText.length===0)return this.hide();for(var k={error:[],security:[],warning:[],info:[],hint:[]},S=b.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",x=0;x<E.displayText.length;x++){var C=d.createElement("span"),L=d.createElement("span");(v=L.classList).add.apply(v,["ace_".concat(E.type[x]),S]),L.setAttribute("aria-label","".concat(f.annotationLabels[E.type[x].replace("_fold","")].singular)),L.setAttribute("role","img"),L.appendChild(d.createTextNode(" ")),C.appendChild(L),C.appendChild(d.createTextNode(E.displayText[x])),C.appendChild(d.createElement("br")),k[E.type[x].replace("_fold","")].push(C)}var I=d.createElement("span");k.error.forEach(function(B){return I.appendChild(B)}),k.security.forEach(function(B){return I.appendChild(B)}),k.warning.forEach(function(B){return I.appendChild(B)}),k.info.forEach(function(B){return I.appendChild(B)}),k.hint.forEach(function(B){return I.appendChild(B)}),I.setAttribute("aria-live","polite");var F=this.$findLinkedAnnotationNode(g);F&&F.setAttribute("aria-describedby",this.id);var R=a.fromPoints({row:g,column:0},{row:g,column:0});this.showForRange(this.editor,R,I),this.visibleTooltipRow=g,this.editor._signal("showGutterTooltip",this)},f.prototype.$setPosition=function(g,v,b,D){var E=this.$findCellByRow(D.start.row);if(E){var w=E&&E.element,y=w&&w.querySelector(".ace_gutter_annotation");if(y){var A=y.getBoundingClientRect();if(A){var T={pageX:A.right,pageY:A.top};return u.prototype.$setPosition.call(this,g,T,!1,D)}}}},f.prototype.$shouldPlaceAbove=function(g,v,b){return b<g},f.prototype.$findLinkedAnnotationNode=function(g){var v=this.$findCellByRow(g);if(v){var b=v.element;if(b.childNodes.length>2)return b.childNodes[2]}},f.prototype.$findCellByRow=function(g){return this.editor.renderer.$gutterLayer.$lines.cells.find(function(v){return v.row===g})},f.prototype.hide=function(g){if(this.isOpen){if(this.$element.removeAttribute("aria-live"),this.visibleTooltipRow!=null){var v=this.$findLinkedAnnotationNode(this.visibleTooltipRow);v&&v.removeAttribute("aria-describedby")}this.visibleTooltipRow=void 0,this.editor._signal("hideGutterTooltip",this),u.prototype.hide.call(this,g)}},f.annotationsToSummaryString=function(g){var v,b,D=[],E=["error","security","warning","info","hint"];try{for(var w=s(E),y=w.next();!y.done;y=w.next()){var A=y.value;if(g[A].length){var T=g[A].length===1?f.annotationLabels[A].singular:f.annotationLabels[A].plural;D.push("".concat(g[A].length," ").concat(T))}}}catch(x){v={error:x}}finally{try{y&&!y.done&&(b=w.return)&&b.call(w)}finally{if(v)throw v.error}}return D.join(", ")},f.prototype.isOutsideOfText=function(g){var v=g.editor,b=v.renderer.$gutter.getBoundingClientRect();return!(g.clientX>=b.left&&g.clientX<=b.right&&g.clientY>=b.top&&g.clientY<=b.bottom)},f})(l);p.$uid=0,n.GutterTooltip=p}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,n,h){var i=t("../lib/dom"),s=t("../lib/event"),d=t("../lib/useragent"),o=200,l=200,r=5;function a(p){var u=p.editor,f=i.createElement("div");f.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",f.textContent=" ";var g=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];g.forEach(function(W){p[W]=this[W]},this),u.on("mousedown",this.onMouseDown.bind(p));var v=u.container,b,D,E,w,y,A,T=0,x,M,O,_,k;this.onDragStart=function(W){if(this.cancelDrag||!v.draggable){var j=this;return setTimeout(function(){j.startSelect(),j.captureMouse(W)},0),W.preventDefault()}y=u.getSelectionRange();var U=W.dataTransfer;U.effectAllowed=u.getReadOnly()?"copy":"copyMove",u.container.appendChild(f),U.setDragImage&&U.setDragImage(f,0,0),setTimeout(function(){u.container.removeChild(f)}),U.clearData(),U.setData("Text",u.session.getTextRange()),M=!0,this.setState("drag")},this.onDragEnd=function(W){if(v.draggable=!1,M=!1,this.setState(null),!u.getReadOnly()){var j=W.dataTransfer.dropEffect;!x&&j=="move"&&u.session.remove(u.getSelectionRange()),u.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(W){if(!(u.getReadOnly()||!N(W.dataTransfer)))return D=W.clientX,E=W.clientY,b||I(),T++,W.dataTransfer.dropEffect=x=z(W),s.preventDefault(W)},this.onDragOver=function(W){if(!(u.getReadOnly()||!N(W.dataTransfer)))return D=W.clientX,E=W.clientY,b||(I(),T++),R!==null&&(R=null),W.dataTransfer.dropEffect=x=z(W),s.preventDefault(W)},this.onDragLeave=function(W){if(T--,T<=0&&b)return F(),x=null,s.preventDefault(W)},this.onDrop=function(W){if(A){var j=W.dataTransfer;if(M)switch(x){case"move":y.contains(A.row,A.column)?y={start:A,end:A}:y=u.moveText(y,A);break;case"copy":y=u.moveText(y,A,!0);break}else{var U=j.getData("Text");y={start:A,end:u.session.insert(A,U)},u.focus(),x=null}return F(),s.preventDefault(W)}},s.addListener(v,"dragstart",this.onDragStart.bind(p),u),s.addListener(v,"dragend",this.onDragEnd.bind(p),u),s.addListener(v,"dragenter",this.onDragEnter.bind(p),u),s.addListener(v,"dragover",this.onDragOver.bind(p),u),s.addListener(v,"dragleave",this.onDragLeave.bind(p),u),s.addListener(v,"drop",this.onDrop.bind(p),u);function S(W,j){var U=Date.now(),K=!j||W.row!=j.row,J=!j||W.column!=j.column;if(!_||K||J)u.moveCursorToPosition(W),_=U,k={x:D,y:E};else{var Y=c(k.x,k.y,D,E);Y>r?_=null:U-_>=l&&(u.renderer.scrollCursorIntoView(),_=null)}}function C(W,j){var U=Date.now(),K=u.renderer.layerConfig.lineHeight,J=u.renderer.layerConfig.characterWidth,Y=u.renderer.scroller.getBoundingClientRect(),X={x:{left:D-Y.left,right:Y.right-D},y:{top:E-Y.top,bottom:Y.bottom-E}},q=Math.min(X.x.left,X.x.right),ne=Math.min(X.y.top,X.y.bottom),ue={row:W.row,column:W.column};q/J<=2&&(ue.column+=X.x.left<X.x.right?-3:2),ne/K<=1&&(ue.row+=X.y.top<X.y.bottom?-1:1);var Se=W.row!=ue.row,Oe=W.column!=ue.column,Ae=!j||W.row!=j.row;Se||Oe&&!Ae?O?U-O>=o&&u.renderer.scrollCursorIntoView(ue):O=U:O=null}function L(){var W=A;A=u.renderer.screenToTextCoordinates(D,E),S(A,W),C(A,W)}function I(){y=u.selection.toOrientedRange(),b=u.session.addMarker(y,"ace_selection",u.getSelectionStyle()),u.clearSelection(),u.isFocused()&&u.renderer.$cursorLayer.setBlinking(!1),clearInterval(w),L(),w=setInterval(L,20),T=0,s.addListener(document,"mousemove",B)}function F(){clearInterval(w),u.session.removeMarker(b),b=null,u.selection.fromOrientedRange(y),u.isFocused()&&!M&&u.$resetCursorStyle(),y=null,A=null,T=0,O=null,_=null,s.removeListener(document,"mousemove",B)}var R=null;function B(){R==null&&(R=setTimeout(function(){R!=null&&b&&F()},20))}function N(W){var j=W.types;return!j||Array.prototype.some.call(j,function(U){return U=="text/plain"||U=="Text"})}function z(W){var j=["copy","copymove","all","uninitialized"],U=["move","copymove","linkmove","all","uninitialized"],K=d.isMac?W.altKey:W.ctrlKey,J="uninitialized";try{J=W.dataTransfer.effectAllowed.toLowerCase()}catch{}var Y="none";return K&&j.indexOf(J)>=0?Y="copy":U.indexOf(J)>=0?Y="move":j.indexOf(J)>=0&&(Y="copy"),Y}}(function(){this.dragWait=function(){var p=Date.now()-this.mousedownEvent.time;p>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var p=this.editor.container;p.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(p){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var p=this.editor,u=p.container;u.draggable=!0,p.renderer.$cursorLayer.setBlinking(!1),p.setStyle("ace_dragging");var f=d.isWin?"default":"move";p.renderer.setCursorStyle(f),this.setState("dragReady")},this.onMouseDrag=function(p){var u=this.editor.container;if(d.isIE&&this.state=="dragReady"){var f=c(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);f>3&&u.dragDrop()}if(this.state==="dragWait"){var f=c(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);f>0&&(u.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(p){if(this.$dragEnabled){this.mousedownEvent=p;var u=this.editor,f=p.inSelection(),g=p.getButton(),v=p.domEvent.detail||1;if(v===1&&g===0&&f){if(p.editor.inMultiSelectMode&&(p.getAccelKey()||p.getShiftKey()))return;this.mousedownEvent.time=Date.now();var b=p.domEvent.target||p.domEvent.srcElement;if("unselectable"in b&&(b.unselectable="on"),u.getDragDelay()){if(d.isWebKit){this.cancelDrag=!0;var D=u.container;D.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(p,this.onMouseDrag.bind(this)),p.defaultPrevented=!0}}}}).call(a.prototype);function c(p,u,f,g){return Math.sqrt(Math.pow(f-p,2)+Math.pow(g-u,2))}n.DragdropHandler=a}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(t,n,h){var i=t("./mouse_event").MouseEvent,s=t("../lib/event"),d=t("../lib/dom");n.addTouchListeners=function(o,l){var r="scroll",a,c,p,u,f,g,v=0,b,D=0,E=0,w=0,y,A;function T(){var S=window.navigator&&window.navigator.clipboard,C=!1,L=function(){var R=l.getCopyText(),B=l.session.getUndoManager().hasUndo();A.replaceChild(d.buildDom(C?["span",!R&&I("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],R&&I("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],R&&I("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],S&&I("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],B&&I("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],I("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],I("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),A.firstChild)},I=function(R){return l.commands.canExecute(R,l)},F=function(R){var B=R.target.getAttribute("action");if(B=="more"||!C)return C=!C,L();B=="paste"?S.readText().then(function(N){l.execCommand(B,N)}):B&&((B=="cut"||B=="copy")&&(S?S.writeText(l.getCopyText()):document.execCommand("copy")),l.execCommand(B)),A.firstChild.style.display="none",C=!1,B!="openCommandPalette"&&l.focus()};A=d.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(R){r="menu",R.stopPropagation(),R.preventDefault(),l.textInput.focus()},ontouchend:function(R){R.stopPropagation(),R.preventDefault(),F(R)},onclick:F},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],l.container)}function x(){if(!l.getOption("enableMobileMenu")){A&&M();return}A||T();var S=l.selection.cursor,C=l.renderer.textToScreenCoordinates(S.row,S.column),L=l.renderer.textToScreenCoordinates(0,0).pageX,I=l.renderer.scrollLeft,F=l.container.getBoundingClientRect();A.style.top=C.pageY-F.top-3+"px",C.pageX-F.left<F.width-70?(A.style.left="",A.style.right="10px"):(A.style.right="",A.style.left=L+I-F.left+"px"),A.style.display="",A.firstChild.style.display="none",l.on("input",M)}function M(S){A&&(A.style.display="none"),l.off("input",M)}function O(){f=null,clearTimeout(f);var S=l.selection.getRange(),C=S.contains(b.row,b.column);(S.isEmpty()||!C)&&(l.selection.moveToPosition(b),l.selection.selectWord()),r="wait",x()}function _(){f=null,clearTimeout(f),l.selection.moveToPosition(b);var S=D>=2?l.selection.getLineRange(b.row):l.session.getBracketRange(b);S&&!S.isEmpty()?l.selection.setRange(S):l.selection.selectWord(),r="wait"}s.addListener(o,"contextmenu",function(S){if(y){var C=l.textInput.getElement();C.focus()}},l),s.addListener(o,"touchstart",function(S){var C=S.touches;if(f||C.length>1){clearTimeout(f),f=null,p=-1,r="zoom";return}y=l.$mouseHandler.isMousePressed=!0;var L=l.renderer.layerConfig.lineHeight,I=l.renderer.layerConfig.lineHeight,F=S.timeStamp;u=F;var R=C[0],B=R.clientX,N=R.clientY;Math.abs(a-B)+Math.abs(c-N)>L&&(p=-1),a=S.clientX=B,c=S.clientY=N,E=w=0;var z=new i(S,l);if(b=z.getDocumentPosition(),F-p<500&&C.length==1&&!v)D++,S.preventDefault(),S.button=0,_();else{D=0;var W=l.selection.cursor,j=l.selection.isEmpty()?W:l.selection.anchor,U=l.renderer.$cursorLayer.getPixelPosition(W,!0),K=l.renderer.$cursorLayer.getPixelPosition(j,!0),J=l.renderer.scroller.getBoundingClientRect(),Y=l.renderer.layerConfig.offset,X=l.renderer.scrollLeft,q=function(Se,Oe){return Se=Se/I,Oe=Oe/L-.75,Se*Se+Oe*Oe};if(S.clientX<J.left){r="zoom";return}var ne=q(S.clientX-J.left-U.left+X,S.clientY-J.top-U.top+Y),ue=q(S.clientX-J.left-K.left+X,S.clientY-J.top-K.top+Y);ne<3.5&&ue<3.5&&(r=ne>ue?"cursor":"anchor"),ue<3.5?r="anchor":ne<3.5?r="cursor":r="scroll",f=setTimeout(O,450)}p=F},l),s.addListener(o,"touchend",function(S){y=l.$mouseHandler.isMousePressed=!1,g&&clearInterval(g),r=="zoom"?(r="",v=0):f?(l.selection.moveToPosition(b),v=0,x()):r=="scroll"?(k(),M()):x(),clearTimeout(f),f=null},l),s.addListener(o,"touchmove",function(S){f&&(clearTimeout(f),f=null);var C=S.touches;if(!(C.length>1||r=="zoom")){var L=C[0],I=a-L.clientX,F=c-L.clientY;if(r=="wait")if(I*I+F*F>4)r="cursor";else return S.preventDefault();a=L.clientX,c=L.clientY,S.clientX=L.clientX,S.clientY=L.clientY;var R=S.timeStamp,B=R-u;if(u=R,r=="scroll"){var N=new i(S,l);N.speed=1,N.wheelX=I,N.wheelY=F,10*Math.abs(I)<Math.abs(F)&&(I=0),10*Math.abs(F)<Math.abs(I)&&(F=0),B!=0&&(E=I/B,w=F/B),l._emit("mousewheel",N),N.propagationStopped||(E=w=0)}else{var z=new i(S,l),W=z.getDocumentPosition();r=="cursor"?l.selection.moveCursorToPosition(W):r=="anchor"&&l.selection.setSelectionAnchor(W.row,W.column),l.renderer.scrollCursorIntoView(W),S.preventDefault()}}},l);function k(){v+=60,g=setInterval(function(){v--<=0&&(clearInterval(g),g=null),Math.abs(E)<.01&&(E=0),Math.abs(w)<.01&&(w=0),v<20&&(E=.9*E),v<20&&(w=.9*w);var S=l.session.getScrollTop();l.renderer.scrollBy(10*E,10*w),S==l.session.getScrollTop()&&(v=0)},10)}}}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(t,n,h){var i=t("../lib/event"),s=t("../lib/useragent"),d=t("./default_handlers").DefaultHandlers,o=t("./default_gutter_handler").GutterHandler,l=t("./mouse_event").MouseEvent,r=t("./dragdrop_handler").DragdropHandler,a=t("./touch_handler").addTouchListeners,c=t("../config"),p=(function(){function u(f){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var g=this;this.editor=f,new d(this),new o(this),new r(this);var v=function(E){var w=!document.hasFocus||!document.hasFocus()||!f.isFocused()&&document.activeElement==(f.textInput&&f.textInput.getElement());w&&window.focus(),f.focus(),setTimeout(function(){f.isFocused()||f.focus()})},b=f.renderer.getMouseEventTarget();i.addListener(b,"click",this.onMouseEvent.bind(this,"click"),f),i.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove"),f),i.addMultiMouseDownListener([b,f.renderer.scrollBarV&&f.renderer.scrollBarV.inner,f.renderer.scrollBarH&&f.renderer.scrollBarH.inner,f.textInput&&f.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",f),i.addMouseWheelListener(f.container,this.onMouseWheel.bind(this,"mousewheel"),f),a(f.container,f);var D=f.renderer.$gutter;i.addListener(D,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),f),i.addListener(D,"click",this.onMouseEvent.bind(this,"gutterclick"),f),i.addListener(D,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),f),i.addListener(D,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),f),i.addListener(b,"mousedown",v,f),i.addListener(D,"mousedown",v,f),s.isIE&&f.renderer.scrollBarV&&(i.addListener(f.renderer.scrollBarV.element,"mousedown",v,f),i.addListener(f.renderer.scrollBarH.element,"mousedown",v,f)),f.on("mousemove",function(E){if(!(g.state||g.$dragDelay||!g.$dragEnabled)){var w=f.renderer.screenToTextCoordinates(E.x,E.y),y=f.session.selection.getRange(),A=f.renderer;!y.isEmpty()&&y.insideStart(w.row,w.column)?A.setCursorStyle("default"):A.setCursorStyle("")}},f)}return u.prototype.onMouseEvent=function(f,g){this.editor.session&&this.editor._emit(f,new l(g,this.editor))},u.prototype.onMouseMove=function(f,g){var v=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!v||!v.length||this.editor._emit(f,new l(g,this.editor))},u.prototype.onMouseWheel=function(f,g){var v=new l(g,this.editor);v.speed=this.$scrollSpeed*2,v.wheelX=g.wheelX,v.wheelY=g.wheelY,this.editor._emit(f,v)},u.prototype.setState=function(f){this.state=f},u.prototype.captureMouse=function(f,g){this.x=f.x,this.y=f.y,this.isMousePressed=!0;var v=this.editor,b=this.editor.renderer;b.$isMousePressed=!0;var D=this,E=!0,w=function(M){if(M){if(s.isWebKit&&!M.which&&D.releaseMouse)return D.releaseMouse();D.x=M.clientX,D.y=M.clientY,g&&g(M),D.mouseEvent=new l(M,D.editor),D.$mouseMoved=!0}},y=function(M){v.off("beforeEndOperation",x),E=!1,v.session&&A(),D[D.state+"End"]&&D[D.state+"End"](M),D.state="",D.isMousePressed=b.$isMousePressed=!1,b.$keepTextAreaAtCursor&&b.$moveTextAreaToCursor(),D.$onCaptureMouseMove=D.releaseMouse=null,M&&D.onMouseEvent("mouseup",M),v.endOperation()},A=function(){D[D.state]&&D[D.state](),D.$mouseMoved=!1},T=function(){E&&(A(),i.nextFrame(T))};if(s.isOldIE&&f.domEvent.type=="dblclick")return setTimeout(function(){y(f)});var x=function(M){D.releaseMouse&&v.curOp.command.name&&v.curOp.selectionChanged&&(D[D.state+"End"]&&D[D.state+"End"](),D.state="",D.releaseMouse())};v.on("beforeEndOperation",x),v.startOperation({command:{name:"mouse"}}),D.$onCaptureMouseMove=w,D.releaseMouse=i.capture(this.editor.container,w,y),T()},u.prototype.cancelContextMenu=function(){var f=function(g){g&&g.domEvent&&g.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",f),g&&g.domEvent&&i.stopEvent(g.domEvent))}.bind(this);setTimeout(f,10),this.editor.on("nativecontextmenu",f)},u.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse(),this.$tooltip&&this.$tooltip.destroy()},u})();p.prototype.releaseMouse=null,c.defineOptions(p.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:s.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0}}),n.MouseHandler=p}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(t,n,h){var i=t("../lib/dom"),s=(function(){function d(o){o.on("click",function(l){var r=l.getDocumentPosition(),a=o.session,c=a.getFoldAt(r.row,r.column,1);c&&(l.getAccelKey()?a.removeFold(c):a.expandFold(c),l.stop());var p=l.domEvent&&l.domEvent.target;p&&i.hasCssClass(p,"ace_inline_button")&&i.hasCssClass(p,"ace_toggle_wrap")&&(a.setOption("wrap",!a.getUseWrapMode()),o.renderer.scrollCursorIntoView())}),o.on("gutterclick",function(l){var r=o.renderer.$gutterLayer.getRegion(l);if(r=="foldWidgets"){var a=l.getDocumentPosition().row,c=o.session;c.foldWidgets&&c.foldWidgets[a]&&o.session.onFoldWidgetClick(a,l),o.isFocused()||o.focus(),l.stop()}}),o.on("gutterdblclick",function(l){var r=o.renderer.$gutterLayer.getRegion(l);if(r=="foldWidgets"){var a=l.getDocumentPosition().row,c=o.session,p=c.getParentFoldRangeData(a,!0),u=p.range||p.firstRange;if(u){a=u.start.row;var f=c.getFoldAt(a,c.getLine(a).length,1);f?c.removeFold(f):(c.addFold("...",u),o.renderer.scrollCursorIntoView({row:u.start.row,column:0}))}l.stop()}})}return d})();n.FoldHandler=s}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(t,n,h){var i=t("../lib/keys"),s=t("../lib/event"),d=(function(){function o(l){this.$editor=l,this.$data={editor:l},this.$handlers=[],this.setDefaultHandler(l.commands)}return o.prototype.setDefaultHandler=function(l){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=l,this.addKeyboardHandler(l,0)},o.prototype.setKeyboardHandler=function(l){var r=this.$handlers;if(r[r.length-1]!=l){for(;r[r.length-1]&&r[r.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(r[r.length-1]);this.addKeyboardHandler(l,1)}},o.prototype.addKeyboardHandler=function(l,r){if(l){typeof l=="function"&&!l.handleKeyboard&&(l.handleKeyboard=l);var a=this.$handlers.indexOf(l);a!=-1&&this.$handlers.splice(a,1),r==null?this.$handlers.push(l):this.$handlers.splice(r,0,l),a==-1&&l.attach&&l.attach(this.$editor)}},o.prototype.removeKeyboardHandler=function(l){var r=this.$handlers.indexOf(l);return r==-1?!1:(this.$handlers.splice(r,1),l.detach&&l.detach(this.$editor),!0)},o.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},o.prototype.getStatusText=function(){var l=this.$data,r=l.editor;return this.$handlers.map(function(a){return a.getStatusText&&a.getStatusText(r,l)||""}).filter(Boolean).join(" ")},o.prototype.$callKeyboardHandlers=function(l,r,a,c){for(var p,u=!1,f=this.$editor.commands,g=this.$handlers.length;g--&&(p=this.$handlers[g].handleKeyboard(this.$data,l,r,a,c),!(!(!p||!p.command)&&(p.command=="null"?u=!0:u=f.exec(p.command,this.$editor,p.args,c),u&&c&&l!=-1&&p.passEvent!=!0&&p.command.passEvent!=!0&&s.stopEvent(c),u))););return!u&&l==-1&&(p={command:"insertstring"},u=f.exec("insertstring",this.$editor,r)),u&&this.$editor._signal&&this.$editor._signal("keyboardActivity",p),u},o.prototype.onCommandKey=function(l,r,a){var c=i.keyCodeToString(a);return this.$callKeyboardHandlers(r,c,a,l)},o.prototype.onTextInput=function(l){return this.$callKeyboardHandlers(-1,l)},o})();n.KeyBinding=d}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(t,n,h){var i=0,s=0,d=!1,o=!1,l=!1,r=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],a=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],c=0,p=1,u=0,f=1,g=2,v=3,b=4,D=5,E=6,w=7,y=8,A=9,T=10,x=11,M=12,O=13,_=14,k=15,S=16,C=17,L=18,I=[L,L,L,L,L,L,L,L,L,E,D,E,y,D,L,L,L,L,L,L,L,L,L,L,L,L,L,L,D,D,D,E,y,b,b,x,x,x,b,b,b,b,b,T,A,T,A,A,g,g,g,g,g,g,g,g,g,g,A,b,b,b,b,b,b,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,b,b,b,b,b,b,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,b,b,b,b,L,L,L,L,L,L,D,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,A,b,x,x,x,x,b,b,b,b,u,b,b,L,b,b,x,x,g,g,b,u,b,b,b,g,u,b,b,b,b,b],F=[y,y,y,y,y,y,y,y,y,y,y,L,L,L,u,f,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,y,D,O,_,k,S,C,A,x,x,x,x,x,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,A,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,y];function R(W,j,U,K){var J=i?a:r,Y=null,X=null,q=null,ne=0,ue=null,Se=null,Oe=-1,Ae=null,Ve=null,ni=[];if(!K)for(Ae=0,K=[];Ae<U;Ae++)K[Ae]=z(W[Ae]);for(s=i,d=!1,o=!1,l=!1,Ve=0;Ve<U;Ve++){if(Y=ne,ni[Ve]=X=N(W,K,ni,Ve),ne=J[Y][X],ue=ne&240,ne&=15,j[Ve]=q=J[ne][5],ue>0)if(ue==16){for(Ae=Oe;Ae<Ve;Ae++)j[Ae]=1;Oe=-1}else Oe=-1;if(Se=J[ne][6],Se)Oe==-1&&(Oe=Ve);else if(Oe>-1){for(Ae=Oe;Ae<Ve;Ae++)j[Ae]=q;Oe=-1}K[Ve]==D&&(j[Ve]=0),s|=q}if(l){for(Ae=0;Ae<U;Ae++)if(K[Ae]==E){j[Ae]=i;for(var nn=Ae-1;nn>=0&&K[nn]==y;nn--)j[nn]=i}}}function B(W,j,U){if(!(s<W)){if(W==1&&i==p&&!o){U.reverse();return}for(var K=U.length,J=0,Y,X,q,ne;J<K;){if(j[J]>=W){for(Y=J+1;Y<K&&j[Y]>=W;)Y++;for(X=J,q=Y-1;X<q;X++,q--)ne=U[X],U[X]=U[q],U[q]=ne;J=Y}J++}}}function N(W,j,U,K){var J=j[K],Y,X,q,ne;switch(J){case u:case f:d=!1;case b:case v:return J;case g:return d?v:g;case w:return d=!0,f;case y:return b;case A:return K<1||K+1>=j.length||(Y=U[K-1])!=g&&Y!=v||(X=j[K+1])!=g&&X!=v?b:(d&&(X=v),X==Y?X:b);case T:return Y=K>0?U[K-1]:D,Y==g&&K+1<j.length&&j[K+1]==g?g:b;case x:if(K>0&&U[K-1]==g)return g;if(d)return b;for(ne=K+1,q=j.length;ne<q&&j[ne]==x;)ne++;return ne<q&&j[ne]==g?g:b;case M:for(q=j.length,ne=K+1;ne<q&&j[ne]==M;)ne++;if(ne<q){var ue=W[K],Se=ue>=1425&&ue<=2303||ue==64286;if(Y=j[ne],Se&&(Y==f||Y==w))return f}return K<1||(Y=j[K-1])==D?b:U[K-1];case D:return d=!1,o=!0,i;case E:return l=!0,b;case O:case _:case S:case C:case k:d=!1;case L:return b}}function z(W){var j=W.charCodeAt(0),U=j>>8;return U==0?j>191?u:I[j]:U==5?/[\u0591-\u05f4]/.test(W)?f:u:U==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(W)?M:/[\u0660-\u0669\u066b-\u066c]/.test(W)?v:j==1642?x:/[\u06f0-\u06f9]/.test(W)?g:w:U==32&&j<=8287?F[j&255]:U==254&&j>=65136?w:b}n.L=u,n.R=f,n.EN=g,n.ON_R=3,n.AN=4,n.R_H=5,n.B=6,n.RLE=7,n.DOT="·",n.doBidiReorder=function(W,j,U){if(W.length<2)return{};var K=W.split(""),J=new Array(K.length),Y=new Array(K.length),X=[];i=U?p:c,R(K,X,K.length,j);for(var q=0;q<J.length;J[q]=q,q++);B(2,X,J),B(1,X,J);for(var q=0;q<J.length-1;q++)j[q]===v?X[q]=n.AN:X[q]===f&&(j[q]>w&&j[q]<O||j[q]===b||j[q]===L)?X[q]=n.ON_R:q>0&&K[q-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(K[q])&&(X[q-1]=X[q]=n.R_H,q++);K[K.length-1]===n.DOT&&(X[K.length-1]=n.B),K[0]==="‫"&&(X[0]=n.RLE);for(var q=0;q<J.length;q++)Y[q]=X[J[q]];return{logicalFromVisual:J,bidiLevels:Y}},n.hasBidiCharacters=function(W,j){for(var U=!1,K=0;K<W.length;K++)j[K]=z(W.charAt(K)),!U&&(j[K]==f||j[K]==w||j[K]==v)&&(U=!0);return U},n.getVisualFromLogicalIdx=function(W,j){for(var U=0;U<j.logicalFromVisual.length;U++)if(j.logicalFromVisual[U]==W)return U;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(t,n,h){var i=t("./lib/bidiutil"),s=t("./lib/lang"),d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,o=(function(){function l(r){this.session=r,this.bidiMap={},this.currentRow=null,this.bidiUtil=i,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=d.test(r.getValue())}return l.prototype.isBidiRow=function(r,a,c){return this.seenBidi?(r!==this.currentRow&&(this.currentRow=r,this.updateRowLine(a,c),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},l.prototype.onChange=function(r){this.seenBidi?this.currentRow=null:r.action=="insert"&&d.test(r.lines.join(`
187
- `))&&(this.seenBidi=!0,this.currentRow=null)},l.prototype.getDocumentRow=function(){var r=0,a=this.session.$screenRowCache;if(a.length){var c=this.session.$getRowCacheIndex(a,this.currentRow);c>=0&&(r=this.session.$docRowCache[c])}return r},l.prototype.getSplitIndex=function(){var r=0,a=this.session.$screenRowCache;if(a.length)for(var c,p=this.session.$getRowCacheIndex(a,this.currentRow);this.currentRow-r>0&&(c=this.session.$getRowCacheIndex(a,this.currentRow-r-1),c===p);)p=c,r++;else r=this.currentRow;return r},l.prototype.updateRowLine=function(r,a){r===void 0&&(r=this.getDocumentRow());var c=r===this.session.getLength()-1,p=c?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(r),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var u=this.session.$wrapData[r];u&&(a===void 0&&(a=this.getSplitIndex()),a>0&&u.length?(this.wrapIndent=u.indent,this.wrapOffset=this.wrapIndent*this.charWidths[i.L],this.line=a<u.length?this.line.substring(u[a-1],u[a]):this.line.substring(u[u.length-1])):this.line=this.line.substring(0,u[a]),a==u.length&&(this.line+=this.showInvisibles?p:i.DOT))}else this.line+=this.showInvisibles?p:i.DOT;var f=this.session,g=0,v;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(b,D){return b===" "||f.isFullWidth(b.charCodeAt(0))?(v=b===" "?f.getScreenTabSize(D+g):2,g+=v-1,s.stringRepeat(i.DOT,v)):b}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==i.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},l.prototype.updateBidiMap=function(){var r=[];i.hasBidiCharacters(this.line,r)||this.isRtlDir?this.bidiMap=i.doBidiReorder(this.line,r,this.isRtlDir):this.bidiMap={}},l.prototype.markAsDirty=function(){this.currentRow=null},l.prototype.updateCharacterWidths=function(r){if(this.characterWidth!==r.$characterSize.width){this.fontMetrics=r;var a=this.characterWidth=r.$characterSize.width,c=r.$measureCharWidth("ה");this.charWidths[i.L]=this.charWidths[i.EN]=this.charWidths[i.ON_R]=a,this.charWidths[i.R]=this.charWidths[i.AN]=c,this.charWidths[i.R_H]=c*.45,this.charWidths[i.B]=this.charWidths[i.RLE]=0,this.currentRow=null}},l.prototype.setShowInvisibles=function(r){this.showInvisibles=r,this.currentRow=null},l.prototype.setEolChar=function(r){this.EOL=r},l.prototype.setContentWidth=function(r){this.contentWidth=r},l.prototype.isRtlLine=function(r){return this.$isRtl?!0:r!=null?this.session.getLine(r).charAt(0)==this.RLE:this.isRtlDir},l.prototype.setRtlDirection=function(r,a){for(var c=r.getCursorPosition(),p=r.selection.getSelectionAnchor().row;p<=c.row;p++)!a&&r.session.getLine(p).charAt(0)===r.session.$bidiHandler.RLE?r.session.doc.removeInLine(p,0,1):a&&r.session.getLine(p).charAt(0)!==r.session.$bidiHandler.RLE&&r.session.doc.insert({column:0,row:p},r.session.$bidiHandler.RLE)},l.prototype.getPosLeft=function(r){r-=this.wrapIndent;var a=this.line.charAt(0)===this.RLE?1:0,c=r>a?this.session.getOverwrite()?r:r-1:a,p=i.getVisualFromLogicalIdx(c,this.bidiMap),u=this.bidiMap.bidiLevels,f=0;!this.session.getOverwrite()&&r<=a&&u[p]%2!==0&&p++;for(var g=0;g<p;g++)f+=this.charWidths[u[g]];return!this.session.getOverwrite()&&r>a&&u[p]%2===0&&(f+=this.charWidths[u[p]]),this.wrapIndent&&(f+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(f+=this.rtlLineOffset),f},l.prototype.getSelections=function(r,a){var c=this.bidiMap,p=c.bidiLevels,u,f=[],g=0,v=Math.min(r,a)-this.wrapIndent,b=Math.max(r,a)-this.wrapIndent,D=!1,E=!1,w=0;this.wrapIndent&&(g+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var y,A=0;A<p.length;A++)y=c.logicalFromVisual[A],u=p[A],D=y>=v&&y<b,D&&!E?w=g:!D&&E&&f.push({left:w,width:g-w}),g+=this.charWidths[u],E=D;if(D&&A===p.length&&f.push({left:w,width:g-w}),this.isRtlDir)for(var T=0;T<f.length;T++)f[T].left+=this.rtlLineOffset;return f},l.prototype.offsetToCol=function(c){this.isRtlDir&&(c-=this.rtlLineOffset);var a=0,c=Math.max(c,0),p=0,u=0,f=this.bidiMap.bidiLevels,g=this.charWidths[f[u]];for(this.wrapIndent&&(c-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);c>p+g/2;){if(p+=g,u===f.length-1){g=0;break}g=this.charWidths[f[++u]]}return u>0&&f[u-1]%2!==0&&f[u]%2===0?(c<p&&u--,a=this.bidiMap.logicalFromVisual[u]):u>0&&f[u-1]%2===0&&f[u]%2!==0?a=1+(c>p?this.bidiMap.logicalFromVisual[u]:this.bidiMap.logicalFromVisual[u-1]):this.isRtlDir&&u===f.length-1&&g===0&&f[u-1]%2===0||!this.isRtlDir&&u===0&&f[u]%2!==0?a=1+this.bidiMap.logicalFromVisual[u]:(u>0&&f[u-1]%2!==0&&g!==0&&u--,a=this.bidiMap.logicalFromVisual[u]),a===0&&this.isRtlDir&&a++,a+this.wrapIndent},l})();n.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(t,n,h){var i=t("./lib/oop"),s=t("./lib/lang"),d=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,l=(function(){function r(a){this.session=a,this.doc=a.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var c=this;this.cursor.on("change",function(p){c.$cursorChanged=!0,c.$silent||c._emit("changeCursor"),!c.$isEmpty&&!c.$silent&&c._emit("changeSelection"),!c.$keepDesiredColumnOnChange&&p.old.column!=p.value.column&&(c.$desiredColumn=null)}),this.anchor.on("change",function(){c.$anchorChanged=!0,!c.$isEmpty&&!c.$silent&&c._emit("changeSelection")})}return r.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},r.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},r.prototype.getCursor=function(){return this.lead.getPosition()},r.prototype.setAnchor=function(a,c){this.$isEmpty=!1,this.anchor.setPosition(a,c)},r.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},r.prototype.getSelectionLead=function(){return this.lead.getPosition()},r.prototype.isBackwards=function(){var a=this.anchor,c=this.lead;return a.row>c.row||a.row==c.row&&a.column>c.column},r.prototype.getRange=function(){var a=this.anchor,c=this.lead;return this.$isEmpty?o.fromPoints(c,c):this.isBackwards()?o.fromPoints(c,a):o.fromPoints(a,c)},r.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},r.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},r.prototype.setRange=function(a,c){var p=c?a.end:a.start,u=c?a.start:a.end;this.$setSelection(p.row,p.column,u.row,u.column)},r.prototype.$setSelection=function(a,c,p,u){if(!this.$silent){var f=this.$isEmpty,g=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(a,c),this.cursor.setPosition(p,u),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||f!=this.$isEmpty||g)&&this._emit("changeSelection")}},r.prototype.$moveSelection=function(a){var c=this.lead;this.$isEmpty&&this.setSelectionAnchor(c.row,c.column),a.call(this)},r.prototype.selectTo=function(a,c){this.$moveSelection(function(){this.moveCursorTo(a,c)})},r.prototype.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},r.prototype.moveTo=function(a,c){this.clearSelection(),this.moveCursorTo(a,c)},r.prototype.moveToPosition=function(a){this.clearSelection(),this.moveCursorToPosition(a)},r.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},r.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},r.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},r.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},r.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},r.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},r.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},r.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},r.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},r.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},r.prototype.getWordRange=function(a,c){if(typeof c>"u"){var p=a||this.lead;a=p.row,c=p.column}return this.session.getWordRange(a,c)},r.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},r.prototype.selectAWord=function(){var a=this.getCursor(),c=this.session.getAWordRange(a.row,a.column);this.setSelectionRange(c)},r.prototype.getLineRange=function(a,c){var p=typeof a=="number"?a:this.lead.row,u,f=this.session.getFoldLine(p);return f?(p=f.start.row,u=f.end.row):u=p,c===!0?new o(p,0,u,this.session.getLine(u).length):new o(p,0,u+1,0)},r.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},r.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},r.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},r.prototype.wouldMoveIntoSoftTab=function(a,c,p){var u=a.column,f=a.column+c;return p<0&&(u=a.column-c,f=a.column),this.session.isTabStop(a)&&this.doc.getLine(a.row).slice(u,f).split(" ").length-1==c},r.prototype.moveCursorLeft=function(){var a=this.lead.getPosition(),c;if(c=this.session.getFoldAt(a.row,a.column,-1))this.moveCursorTo(c.start.row,c.start.column);else if(a.column===0)a.row>0&&this.moveCursorTo(a.row-1,this.doc.getLine(a.row-1).length);else{var p=this.session.getTabSize();this.wouldMoveIntoSoftTab(a,p,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-p):this.moveCursorBy(0,-1)}},r.prototype.moveCursorRight=function(){var a=this.lead.getPosition(),c;if(c=this.session.getFoldAt(a.row,a.column,1))this.moveCursorTo(c.end.row,c.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var p=this.session.getTabSize(),a=this.lead;this.wouldMoveIntoSoftTab(a,p,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,p):this.moveCursorBy(0,1)}},r.prototype.moveCursorLineStart=function(){var a=this.lead.row,c=this.lead.column,p=this.session.documentToScreenRow(a,c),u=this.session.screenToDocumentPosition(p,0),f=this.session.getDisplayLine(a,null,u.row,u.column),g=f.match(/^\s*/);g[0].length!=c&&!this.session.$useEmacsStyleLineStart&&(u.column+=g[0].length),this.moveCursorToPosition(u)},r.prototype.moveCursorLineEnd=function(){var a=this.lead,c=this.session.getDocumentLastRowColumnPosition(a.row,a.column);if(this.lead.column==c.column){var p=this.session.getLine(c.row);if(c.column==p.length){var u=p.search(/\s+$/);u>0&&(c.column=u)}}this.moveCursorTo(c.row,c.column)},r.prototype.moveCursorFileEnd=function(){var a=this.doc.getLength()-1,c=this.doc.getLine(a).length;this.moveCursorTo(a,c)},r.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},r.prototype.moveCursorLongWordRight=function(){var a=this.lead.row,c=this.lead.column,p=this.doc.getLine(a),u=p.substring(c);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var f=this.session.getFoldAt(a,c,1);if(f){this.moveCursorTo(f.end.row,f.end.column);return}if(this.session.nonTokenRe.exec(u)&&(c+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,u=p.substring(c)),c>=p.length){this.moveCursorTo(a,p.length),this.moveCursorRight(),a<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(u)&&(c+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(a,c)},r.prototype.moveCursorLongWordLeft=function(){var a=this.lead.row,c=this.lead.column,p;if(p=this.session.getFoldAt(a,c,-1)){this.moveCursorTo(p.start.row,p.start.column);return}var u=this.session.getFoldStringAt(a,c,-1);u==null&&(u=this.doc.getLine(a).substring(0,c));var f=s.stringReverse(u);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(f)&&(c-=this.session.nonTokenRe.lastIndex,f=f.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),c<=0){this.moveCursorTo(a,0),this.moveCursorLeft(),a>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(f)&&(c-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(a,c)},r.prototype.$shortWordEndIndex=function(a){var c=0,p,u=/\s/,f=this.session.tokenRe;if(f.lastIndex=0,this.session.tokenRe.exec(a))c=this.session.tokenRe.lastIndex;else{for(;(p=a[c])&&u.test(p);)c++;if(c<1){for(f.lastIndex=0;(p=a[c])&&!f.test(p);)if(f.lastIndex=0,c++,u.test(p))if(c>2){c--;break}else{for(;(p=a[c])&&u.test(p);)c++;if(c>2)break}}}return f.lastIndex=0,c},r.prototype.moveCursorShortWordRight=function(){var a=this.lead.row,c=this.lead.column,p=this.doc.getLine(a),u=p.substring(c),f=this.session.getFoldAt(a,c,1);if(f)return this.moveCursorTo(f.end.row,f.end.column);if(c==p.length){var g=this.doc.getLength();do a++,u=this.doc.getLine(a);while(a<g&&/^\s*$/.test(u));/^\s+/.test(u)||(u=""),c=0}var v=this.$shortWordEndIndex(u);this.moveCursorTo(a,c+v)},r.prototype.moveCursorShortWordLeft=function(){var a=this.lead.row,c=this.lead.column,p;if(p=this.session.getFoldAt(a,c,-1))return this.moveCursorTo(p.start.row,p.start.column);var u=this.session.getLine(a).substring(0,c);if(c===0){do a--,u=this.doc.getLine(a);while(a>0&&/^\s*$/.test(u));c=u.length,/\s+$/.test(u)||(u="")}var f=s.stringReverse(u),g=this.$shortWordEndIndex(f);return this.moveCursorTo(a,c-g)},r.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},r.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},r.prototype.moveCursorBy=function(a,c){var p=this.session.documentToScreenPosition(this.lead.row,this.lead.column),u;if(c===0&&(a!==0&&(this.session.$bidiHandler.isBidiRow(p.row,this.lead.row)?(u=this.session.$bidiHandler.getPosLeft(p.column),p.column=Math.round(u/this.session.$bidiHandler.charWidths[0])):u=p.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?p.column=this.$desiredColumn:this.$desiredColumn=p.column),a!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var f=this.session.lineWidgets[this.lead.row];a<0?a-=f.rowsAbove||0:a>0&&(a+=f.rowCount-(f.rowsAbove||0))}var g=this.session.screenToDocumentPosition(p.row+a,p.column,u);a!==0&&c===0&&g.row===this.lead.row&&(g.column,this.lead.column),this.moveCursorTo(g.row,g.column+c,c===0)},r.prototype.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},r.prototype.moveCursorTo=function(a,c,p){var u=this.session.getFoldAt(a,c,1);u&&(a=u.start.row,c=u.start.column),this.$keepDesiredColumnOnChange=!0;var f=this.session.getLine(a);/[\uDC00-\uDFFF]/.test(f.charAt(c))&&f.charAt(c-1)&&(this.lead.row==a&&this.lead.column==c+1?c=c-1:c=c+1),this.lead.setPosition(a,c),this.$keepDesiredColumnOnChange=!1,p||(this.$desiredColumn=null)},r.prototype.moveCursorToScreen=function(a,c,p){var u=this.session.screenToDocumentPosition(a,c);this.moveCursorTo(u.row,u.column,p)},r.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},r.prototype.fromOrientedRange=function(a){this.setSelectionRange(a,a.cursor==a.start),this.$desiredColumn=a.desiredColumn||this.$desiredColumn},r.prototype.toOrientedRange=function(a){var c=this.getRange();return a?(a.start.column=c.start.column,a.start.row=c.start.row,a.end.column=c.end.column,a.end.row=c.end.row):a=c,a.cursor=this.isBackwards()?a.start:a.end,a.desiredColumn=this.$desiredColumn,a},r.prototype.getRangeOfMovements=function(a){var c=this.getCursor();try{a(this);var p=this.getCursor();return o.fromPoints(c,p)}catch{return o.fromPoints(c,c)}finally{this.moveCursorToPosition(c)}},r.prototype.toJSON=function(){if(this.rangeCount)var a=this.ranges.map(function(c){var p=c.clone();return p.isBackwards=c.cursor==c.start,p});else{var a=this.getRange();a.isBackwards=this.isBackwards()}return a},r.prototype.fromJSON=function(a){if(a.start==null)if(this.rangeList&&a.length>1){this.toSingleRange(a[0]);for(var c=a.length;c--;){var p=o.fromPoints(a[c].start,a[c].end);a[c].isBackwards&&(p.cursor=p.start),this.addRange(p,!0)}return}else a=a[0];this.rangeList&&this.toSingleRange(a),this.setSelectionRange(a,a.isBackwards)},r.prototype.isEqual=function(a){if((a.length||this.rangeCount)&&a.length!=this.rangeCount)return!1;if(!a.length||!this.ranges)return this.getRange().isEqual(a);for(var c=this.ranges.length;c--;)if(!this.ranges[c].isEqual(a[c]))return!1;return!0},r})();l.prototype.setSelectionAnchor=l.prototype.setAnchor,l.prototype.getSelectionAnchor=l.prototype.getAnchor,l.prototype.setSelectionRange=l.prototype.setRange,i.implement(l.prototype,d),n.Selection=l}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(t,n,h){var i=t("./lib/report_error").reportError,s=2e3,d=(function(){function o(l){this.splitRegex,this.states=l,this.regExps={},this.matchMappings={};for(var r in this.states){for(var a=this.states[r],c=[],p=0,u=this.matchMappings[r]={defaultToken:"text"},f="g",g=[],v=0;v<a.length;v++){var b=a[v];if(b.defaultToken&&(u.defaultToken=b.defaultToken),b.caseInsensitive&&f.indexOf("i")===-1&&(f+="i"),b.unicode&&f.indexOf("u")===-1&&(f+="u"),b.regex!=null){b.regex instanceof RegExp&&(b.regex=b.regex.toString().slice(1,-1));var D=b.regex,E=new RegExp("(?:("+D+")|(.))").exec("a").length-2;Array.isArray(b.token)?b.token.length==1||E==1?b.token=b.token[0]:E-1!=b.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:b,groupCount:E-1}),b.token=b.token[0]):(b.tokenArray=b.token,b.token=null,b.onMatch=this.$arrayTokens):typeof b.token=="function"&&!b.onMatch&&(E>1?b.onMatch=this.$applyToken:b.onMatch=b.token),E>1&&(/\\\d/.test(b.regex)?D=b.regex.replace(/\\([0-9]+)/g,function(w,y){return"\\"+(parseInt(y,10)+p+1)}):(E=1,D=this.removeCapturingGroups(b.regex)),!b.splitRegex&&typeof b.token!="string"&&g.push(b)),u[p]=v,p+=E,c.push(D),b.onMatch||(b.onMatch=null)}}c.length||(u[0]=0,c.push("$")),g.forEach(function(w){w.splitRegex=this.createSplitterRegexp(w.regex,f)},this),this.regExps[r]=new RegExp("("+c.join(")|(")+")|($)",f)}}return o.prototype.$setMaxTokenCount=function(l){s=l|0},o.prototype.$applyToken=function(l){var r=this.splitRegex.exec(l).slice(1),a=this.token.apply(this,r);if(typeof a=="string")return[{type:a,value:l}];for(var c=[],p=0,u=a.length;p<u;p++)r[p]&&(c[c.length]={type:a[p],value:r[p]});return c},o.prototype.$arrayTokens=function(l){if(!l)return[];var r=this.splitRegex.exec(l);if(!r)return"text";for(var a=[],c=this.tokenArray,p=0,u=c.length;p<u;p++)r[p+1]&&(a[a.length]={type:c[p],value:r[p+1]});return a},o.prototype.removeCapturingGroups=function(l){var r=l.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(a,c){return c?"(?:":a});return r},o.prototype.createSplitterRegexp=function(l,r){if(l.indexOf("(?=")!=-1){var a=0,c=!1,p={};l.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(u,f,g,v,b,D){return c?c=b!="]":b?c=!0:v?(a==p.stack&&(p.end=D+1,p.stack=-1),a--):g&&(a++,g.length!=1&&(p.stack=a,p.start=D)),u}),p.end!=null&&/^\)*$/.test(l.substr(p.end))&&(l=l.substring(0,p.start)+l.substr(p.end))}return l.charAt(0)!="^"&&(l="^"+l),l.charAt(l.length-1)!="$"&&(l+="$"),new RegExp(l,(r||"").replace("g",""))},o.prototype.getLineTokens=function(l,r){if(r&&typeof r!="string"){var a=r.slice(0);r=a[0],r==="#tmp"&&(a.shift(),r=a.shift())}else var a=[];var c=r||"start",p=this.states[c];p||(c="start",p=this.states[c]);var u=this.matchMappings[c],f=this.regExps[c];f.lastIndex=0;for(var g,v=[],b=0,D=0,E={type:null,value:""};g=f.exec(l);){var w=u.defaultToken,y=null,A=g[0],T=f.lastIndex;if(T-A.length>b){var x=l.substring(b,T-A.length);E.type==w?E.value+=x:(E.type&&v.push(E),E={type:w,value:x})}for(var M=0;M<g.length-2;M++)if(g[M+1]!==void 0){y=p[u[M]],y.onMatch?w=y.onMatch(A,c,a,l):w=y.token,y.next&&(typeof y.next=="string"?c=y.next:c=y.next(c,a),p=this.states[c],p||(this.reportError("state doesn't exist",c),c="start",p=this.states[c]),u=this.matchMappings[c],b=T,f=this.regExps[c],f.lastIndex=T),y.consumeLineEnd&&(b=T);break}if(A){if(typeof w=="string")(!y||y.merge!==!1)&&E.type===w?E.value+=A:(E.type&&v.push(E),E={type:w,value:A});else if(w){E.type&&v.push(E),E={type:null,value:""};for(var M=0;M<w.length;M++)v.push(w[M])}}if(b==l.length)break;if(b=T,D++>s){for(D>2*l.length&&this.reportError("infinite loop with in ace tokenizer",{startState:r,line:l});b<l.length;)E.type&&v.push(E),E={value:l.substring(b,b+=500),type:"overflow"};c="start",a=[];break}}return E.type&&v.push(E),a.length>1&&a[0]!==c&&a.unshift("#tmp",c),{tokens:v,state:a.length?a:c}},o})();d.prototype.reportError=i,n.Tokenizer=d}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(t,n,h){var i=t("../lib/deep_copy").deepCopy,s;s=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(l,r){if(!r){for(var a in l)this.$rules[a]=l[a];return}for(var a in l){for(var c=l[a],p=0;p<c.length;p++){var u=c[p];(u.next||u.onMatch)&&(typeof u.next=="string"&&u.next.indexOf(r)!==0&&(u.next=r+u.next),u.nextState&&u.nextState.indexOf(r)!==0&&(u.nextState=r+u.nextState))}this.$rules[r+a]=c}},this.getRules=function(){return this.$rules},this.embedRules=function(l,r,a,c,p){var u=typeof l=="function"?new l().getRules():l;if(c)for(var f=0;f<c.length;f++)c[f]=r+c[f];else{c=[];for(var g in u)c.push(r+g)}if(this.addRules(u,r),a)for(var v=Array.prototype[p?"push":"unshift"],f=0;f<c.length;f++)v.apply(this.$rules[c[f]],i(a));this.$embeds||(this.$embeds=[]),this.$embeds.push(r)},this.getEmbeds=function(){return this.$embeds};var d=function(l,r){return(l!="start"||r.length)&&r.unshift(this.nextState,l),this.nextState},o=function(l,r){return r.shift(),r.shift()||"start"};this.normalizeRules=function(){var l=0,r=this.$rules;function a(c){var p=r[c];p.processed=!0;for(var u=0;u<p.length;u++){var f=p[u],g=null;Array.isArray(f)&&(g=f,f={}),!f.regex&&f.start&&(f.regex=f.start,f.next||(f.next=[]),f.next.push({defaultToken:f.token},{token:f.token+".end",regex:f.end||f.start,next:"pop"}),f.token=f.token+".start",f.push=!0);var v=f.next||f.push;if(v&&Array.isArray(v)){var b=f.stateName;b||(b=f.token,typeof b!="string"&&(b=b[0]||""),r[b]&&(b+=l++)),r[b]=v,f.next=b,a(b)}else v=="pop"&&(f.next=o);if(f.push&&(f.nextState=f.next||f.push,f.next=d,delete f.push),f.rules)for(var D in f.rules)r[D]?r[D].push&&r[D].push.apply(r[D],f.rules[D]):r[D]=f.rules[D];var E=typeof f=="string"?f:f.include;if(E&&(E==="$self"&&(E="start"),Array.isArray(E)?g=E.map(function(y){return r[y]}):g=r[E]),g){var w=[u,1].concat(g);f.noEscape&&(w=w.filter(function(y){return!y.next})),p.splice.apply(p,w),u--}f.keywordMap&&(f.token=this.createKeywordMapper(f.keywordMap,f.defaultToken||"text",f.caseInsensitive),delete f.defaultToken)}}Object.keys(r).forEach(a,this)},this.createKeywordMapper=function(l,r,a,c){var p=Object.create(null);return this.$keywordList=[],Object.keys(l).forEach(function(u){for(var f=l[u],g=f.split(c||"|"),v=g.length;v--;){var b=g[v];this.$keywordList.push(b),a&&(b=b.toLowerCase()),p[b]=u}},this),l=null,a?function(u){return p[u.toLowerCase()]||r}:function(u){return p[u]||r}},this.getKeywords=function(){return this.$keywords}}).call(s.prototype),n.TextHighlightRules=s}),ace.define("ace/mode/behaviour",["require","exports","module"],function(t,n,h){var i;i=function(){this.$behaviours={}},(function(){this.add=function(s,d,o){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[s]:this.$behaviours[s]={}}this.$behaviours[s][d]=o},this.addBehaviours=function(s){for(var d in s)for(var o in s[d])this.add(d,o,s[d][o])},this.remove=function(s){this.$behaviours&&this.$behaviours[s]&&delete this.$behaviours[s]},this.inherit=function(s,d){if(typeof s=="function")var o=new s().getBehaviours(d);else var o=s.getBehaviours(d);this.addBehaviours(o)},this.getBehaviours=function(s){if(s){for(var d={},o=0;o<s.length;o++)this.$behaviours[s[o]]&&(d[s[o]]=this.$behaviours[s[o]]);return d}else return this.$behaviours}}).call(i.prototype),n.Behaviour=i}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(t,n,h){var i=t("./range").Range,s=(function(){function d(o,l,r){this.$session=o,this.$row=l,this.$rowTokens=o.getTokens(l);var a=o.getTokenAt(l,r);this.$tokenIndex=a?a.index:-1}return d.prototype.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},d.prototype.stepForward=function(){this.$tokenIndex+=1;for(var o;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,o||(o=this.$session.getLength()),this.$row>=o)return this.$row=o-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},d.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},d.prototype.getCurrentTokenRow=function(){return this.$row},d.prototype.getCurrentTokenColumn=function(){var o=this.$rowTokens,l=this.$tokenIndex,r=o[l].start;if(r!==void 0)return r;for(r=0;l>0;)l-=1,r+=o[l].value.length;return r},d.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},d.prototype.getCurrentTokenRange=function(){var o=this.$rowTokens[this.$tokenIndex],l=this.getCurrentTokenColumn();return new i(this.$row,l,this.$row,l+o.value.length)},d})();n.TokenIterator=s}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,n,h){var i=t("../../lib/oop"),s=t("../behaviour").Behaviour,d=t("../../token_iterator").TokenIterator,o=t("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],r=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],a,c={},p={'"':'"',"'":"'"},u=function(v){var b=-1;if(v.multiSelect&&(b=v.selection.index,c.rangeCount!=v.multiSelect.rangeCount&&(c={rangeCount:v.multiSelect.rangeCount})),c[b])return a=c[b];a=c[b]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(v,b,D,E){var w=v.end.row-v.start.row;return{text:D+b+E,selection:[0,v.start.column+1,w,v.end.column+(w?0:1)]}},g;g=function(v){v=v||{},this.add("braces","insertion",function(b,D,E,w,y){var A=E.getCursorPosition(),T=w.doc.getLine(A.row);if(y=="{"){u(E);var x=E.getSelectionRange(),M=w.doc.getTextRange(x),O=w.getTokenAt(A.row,A.column);if(M!==""&&M!=="{"&&E.getWrapBehavioursEnabled())return f(x,M,"{","}");if(O&&/(?:string)\.quasi|\.xml/.test(O.type)){var _=[/tag\-(?:open|name)/,/attribute\-name/];return _.some(function(R){return R.test(O.type)})||/(string)\.quasi/.test(O.type)&&O.value[A.column-O.start-1]!=="$"?void 0:(g.recordAutoInsert(E,w,"}"),{text:"{}",selection:[1,1]})}else if(g.isSaneInsertion(E,w))return/[\]\}\)]/.test(T[A.column])||E.inMultiSelectMode||v.braces?(g.recordAutoInsert(E,w,"}"),{text:"{}",selection:[1,1]}):(g.recordMaybeInsert(E,w,"{"),{text:"{",selection:[1,1]})}else if(y=="}"){u(E);var k=T.substring(A.column,A.column+1);if(k=="}"){var S=w.$findOpeningBracket("}",{column:A.column+1,row:A.row});if(S!==null&&g.isAutoInsertedClosing(A,T,y))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(y==`
188
- `||y==`\r
189
- `){u(E);var C="";g.isMaybeInsertedClosing(A,T)&&(C=o.stringRepeat("}",a.maybeInsertedBrackets),g.clearMaybeInsertedClosing());var k=T.substring(A.column,A.column+1);if(k==="}"){var L=w.findMatchingBracket({row:A.row,column:A.column+1},"}");if(!L)return null;var I=this.$getIndent(w.getLine(L.row))}else if(C)var I=this.$getIndent(T);else{g.clearMaybeInsertedClosing();return}var F=I+w.getTabString();return{text:`
190
- `+F+`
191
- `+I+C,selection:[1,F.length,1,F.length]}}else g.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(b,D,E,w,y){var A=w.doc.getTextRange(y);if(!y.isMultiLine()&&A=="{"){u(E);var T=w.doc.getLine(y.start.row),x=T.substring(y.end.column,y.end.column+1);if(x=="}")return y.end.column++,y;a.maybeInsertedBrackets--}}),this.add("parens","insertion",function(b,D,E,w,y){if(y=="("){u(E);var A=E.getSelectionRange(),T=w.doc.getTextRange(A);if(T!==""&&E.getWrapBehavioursEnabled())return f(A,T,"(",")");if(g.isSaneInsertion(E,w))return g.recordAutoInsert(E,w,")"),{text:"()",selection:[1,1]}}else if(y==")"){u(E);var x=E.getCursorPosition(),M=w.doc.getLine(x.row),O=M.substring(x.column,x.column+1);if(O==")"){var _=w.$findOpeningBracket(")",{column:x.column+1,row:x.row});if(_!==null&&g.isAutoInsertedClosing(x,M,y))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(b,D,E,w,y){var A=w.doc.getTextRange(y);if(!y.isMultiLine()&&A=="("){u(E);var T=w.doc.getLine(y.start.row),x=T.substring(y.start.column+1,y.start.column+2);if(x==")")return y.end.column++,y}}),this.add("brackets","insertion",function(b,D,E,w,y){if(y=="["){u(E);var A=E.getSelectionRange(),T=w.doc.getTextRange(A);if(T!==""&&E.getWrapBehavioursEnabled())return f(A,T,"[","]");if(g.isSaneInsertion(E,w))return g.recordAutoInsert(E,w,"]"),{text:"[]",selection:[1,1]}}else if(y=="]"){u(E);var x=E.getCursorPosition(),M=w.doc.getLine(x.row),O=M.substring(x.column,x.column+1);if(O=="]"){var _=w.$findOpeningBracket("]",{column:x.column+1,row:x.row});if(_!==null&&g.isAutoInsertedClosing(x,M,y))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(b,D,E,w,y){var A=w.doc.getTextRange(y);if(!y.isMultiLine()&&A=="["){u(E);var T=w.doc.getLine(y.start.row),x=T.substring(y.start.column+1,y.start.column+2);if(x=="]")return y.end.column++,y}}),this.add("string_dquotes","insertion",function(b,D,E,w,y){var A=w.$mode.$quotes||p;if(y.length==1&&A[y]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(y)!=-1)return;u(E);var T=y,x=E.getSelectionRange(),M=w.doc.getTextRange(x);if(M!==""&&(M.length!=1||!A[M])&&E.getWrapBehavioursEnabled())return f(x,M,T,T);if(!M){var O=E.getCursorPosition(),_=w.doc.getLine(O.row),k=_.substring(O.column-1,O.column),S=_.substring(O.column,O.column+1),C=w.getTokenAt(O.row,O.column),L=w.getTokenAt(O.row,O.column+1);if(k=="\\"&&C&&/escape/.test(C.type))return null;var I=C&&/string|escape/.test(C.type),F=!L||/string|escape/.test(L.type),R;if(S==T)R=I!==F,R&&/string\.end/.test(L.type)&&(R=!1);else{if(I&&!F||I&&F)return null;var B=w.$mode.tokenRe;B.lastIndex=0;var N=B.test(k);B.lastIndex=0;var z=B.test(S),W=w.$mode.$pairQuotesAfter,j=W&&W[T]&&W[T].test(k);if(!j&&N||z||S&&!/[\s;,.})\]\\]/.test(S))return null;var U=_[O.column-2];if(k==T&&(U==T||B.test(U)))return null;R=!0}return{text:R?T+T:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(b,D,E,w,y){var A=w.$mode.$quotes||p,T=w.doc.getTextRange(y);if(!y.isMultiLine()&&A.hasOwnProperty(T)){u(E);var x=w.doc.getLine(y.start.row),M=x.substring(y.start.column+1,y.start.column+2);if(M==T)return y.end.column++,y}}),v.closeDocComment!==!1&&this.add("doc comment end","insertion",function(b,D,E,w,y){if(b==="doc-start"&&(y===`
192
- `||y===`\r
193
- `)&&E.selection.isEmpty()){var A=E.getCursorPosition();if(A.column===0)return;for(var T=w.doc.getLine(A.row),x=w.doc.getLine(A.row+1),M=w.getTokens(A.row),O=0,_=0;_<M.length;_++){O+=M[_].value.length;var k=M[_];if(O>=A.column){if(O===A.column){if(!/\.doc/.test(k.type))return;if(/\*\//.test(k.value)){var S=M[_+1];if(!S||!/\.doc/.test(S.type))return}}var C=A.column-(O-k.value.length),L=k.value.indexOf("*/"),I=k.value.indexOf("/**",L>-1?L+2:0);if(I!==-1&&C>I&&C<I+3||L!==-1&&I!==-1&&C>=L&&C<=I||!/\.doc/.test(k.type))return;break}}var F=this.$getIndent(T);if(/\s*\*/.test(x))return/^\s*\*/.test(T)?{text:y+F+"* ",selection:[1,2+F.length,1,2+F.length]}:{text:y+F+" * ",selection:[1,3+F.length,1,3+F.length]};if(/\/\*\*/.test(T.substring(0,A.column)))return{text:y+F+" * "+y+" "+F+"*/",selection:[1,4+F.length,1,4+F.length]}}})},g.isSaneInsertion=function(v,b){var D=v.getCursorPosition(),E=new d(b,D.row,D.column);if(!this.$matchTokenType(E.getCurrentToken()||"text",l)){if(/[)}\]]/.test(v.session.getLine(D.row)[D.column]))return!0;var w=new d(b,D.row,D.column+1);if(!this.$matchTokenType(w.getCurrentToken()||"text",l))return!1}return E.stepForward(),E.getCurrentTokenRow()!==D.row||this.$matchTokenType(E.getCurrentToken()||"text",r)},g.$matchTokenType=function(v,b){return b.indexOf(v.type||v)>-1},g.recordAutoInsert=function(v,b,D){var E=v.getCursorPosition(),w=b.doc.getLine(E.row);this.isAutoInsertedClosing(E,w,a.autoInsertedLineEnd[0])||(a.autoInsertedBrackets=0),a.autoInsertedRow=E.row,a.autoInsertedLineEnd=D+w.substr(E.column),a.autoInsertedBrackets++},g.recordMaybeInsert=function(v,b,D){var E=v.getCursorPosition(),w=b.doc.getLine(E.row);this.isMaybeInsertedClosing(E,w)||(a.maybeInsertedBrackets=0),a.maybeInsertedRow=E.row,a.maybeInsertedLineStart=w.substr(0,E.column)+D,a.maybeInsertedLineEnd=w.substr(E.column),a.maybeInsertedBrackets++},g.isAutoInsertedClosing=function(v,b,D){return a.autoInsertedBrackets>0&&v.row===a.autoInsertedRow&&D===a.autoInsertedLineEnd[0]&&b.substr(v.column)===a.autoInsertedLineEnd},g.isMaybeInsertedClosing=function(v,b){return a.maybeInsertedBrackets>0&&v.row===a.maybeInsertedRow&&b.substr(v.column)===a.maybeInsertedLineEnd&&b.substr(0,v.column)==a.maybeInsertedLineStart},g.popAutoInsertedClosing=function(){a.autoInsertedLineEnd=a.autoInsertedLineEnd.substr(1),a.autoInsertedBrackets--},g.clearMaybeInsertedClosing=function(){a&&(a.maybeInsertedBrackets=0,a.maybeInsertedRow=-1)},i.inherits(g,s),n.CstyleBehaviour=g}),ace.define("ace/unicode",["require","exports","module"],function(t,n,h){for(var i=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],s=0,d=[],o=0;o<i.length;o+=2)d.push(s+=i[o]),i[o+1]&&d.push(45,s+=i[o+1]);n.wordChars=String.fromCharCode.apply(null,d)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(t,n,h){var i=t("../config"),s=t("../tokenizer").Tokenizer,d=t("./text_highlight_rules").TextHighlightRules,o=t("./behaviour/cstyle").CstyleBehaviour,l=t("../unicode"),r=t("../lib/lang"),a=t("../token_iterator").TokenIterator,c=t("../range").Range,p;p=function(){this.HighlightRules=d},(function(){this.$defaultBehaviour=new o,this.tokenRe=new RegExp("^["+l.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+l.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new s(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(u,f,g,v){var b=f.doc,D=!0,E=!0,w=1/0,y=f.getTabSize(),A=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var M=this.lineCommentStart.map(r.escapeRegExp).join("|"),T=this.lineCommentStart[0];else var M=r.escapeRegExp(this.lineCommentStart),T=this.lineCommentStart;M=new RegExp("^(\\s*)(?:"+M+") ?"),A=f.getUseSoftTabs();var k=function(z,W){var j=z.match(M);if(j){var U=j[1].length,K=j[0].length;!L(z,U,K)&&j[0][K-1]==" "&&K--,b.removeInLine(W,U,K)}},C=T+" ",_=function(z,W){(!D||/\S/.test(z))&&(L(z,w,w)?b.insertInLine({row:W,column:w},C):b.insertInLine({row:W,column:w},T))},S=function(z,W){return M.test(z)},L=function(z,W,j){for(var U=0;W--&&z.charAt(W)==" ";)U++;if(U%y!=0)return!1;for(var U=0;z.charAt(j++)==" ";)U++;return y>2?U%y!=y-1:U%y==0}}else{if(!this.blockComment)return!1;var T=this.blockComment.start,x=this.blockComment.end,M=new RegExp("^(\\s*)(?:"+r.escapeRegExp(T)+")"),O=new RegExp("(?:"+r.escapeRegExp(x)+")\\s*$"),_=function(R,B){S(R,B)||(!D||/\S/.test(R))&&(b.insertInLine({row:B,column:R.length},x),b.insertInLine({row:B,column:w},T))},k=function(R,B){var N;(N=R.match(O))&&b.removeInLine(B,R.length-N[0].length,R.length),(N=R.match(M))&&b.removeInLine(B,N[1].length,N[0].length)},S=function(R,B){if(M.test(R))return!0;for(var N=f.getTokens(B),z=0;z<N.length;z++)if(N[z].type==="comment")return!0}}function I(R){for(var B=g;B<=v;B++)R(b.getLine(B),B)}var F=1/0;I(function(R,B){var N=R.search(/\S/);N!==-1?(N<w&&(w=N),E&&!S(R,B)&&(E=!1)):F>R.length&&(F=R.length)}),w==1/0&&(w=F,D=!1,E=!1),A&&w%y!=0&&(w=Math.floor(w/y)*y),I(E?k:_)},this.toggleBlockComment=function(u,f,g,v){var b=this.blockComment;if(b){!b.start&&b[0]&&(b=b[0]);var D=new a(f,v.row,v.column),E=D.getCurrentToken();f.selection;var w=f.selection.toOrientedRange(),y,A;if(E&&/comment/.test(E.type)){for(var T,x;E&&/comment/.test(E.type);){var M=E.value.indexOf(b.start);if(M!=-1){var O=D.getCurrentTokenRow(),_=D.getCurrentTokenColumn()+M;T=new c(O,_,O,_+b.start.length);break}E=D.stepBackward()}for(var D=new a(f,v.row,v.column),E=D.getCurrentToken();E&&/comment/.test(E.type);){var M=E.value.indexOf(b.end);if(M!=-1){var O=D.getCurrentTokenRow(),_=D.getCurrentTokenColumn()+M;x=new c(O,_,O,_+b.end.length);break}E=D.stepForward()}x&&f.remove(x),T&&(f.remove(T),y=T.start.row,A=-b.start.length)}else A=b.start.length,y=g.start.row,f.insert(g.end,b.end),f.insert(g.start,b.start);w.start.row==y&&(w.start.column+=A),w.end.row==y&&(w.end.column+=A),f.selection.fromOrientedRange(w)}},this.getNextLineIndent=function(u,f,g){return this.$getIndent(f)},this.checkOutdent=function(u,f,g){return!1},this.autoOutdent=function(u,f,g){},this.$getIndent=function(u){return u.match(/^\s*/)[0]},this.createWorker=function(u){return null},this.createModeDelegates=function(u){this.$embeds=[],this.$modes={};for(var f in u)if(u[f]){var g=u[f],v=g.prototype.$id,b=i.$modes[v];b||(i.$modes[v]=b=new g),i.$modes[f]||(i.$modes[f]=b),this.$embeds.push(f),this.$modes[f]=b}for(var D=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],E=function(y){(function(A){var T=D[y],x=A[T];A[D[y]]=function(){return this.$delegator(T,arguments,x)}})(w)},w=this,f=0;f<D.length;f++)E(f)},this.$delegator=function(u,f,g){var v=f[0]||"start";if(typeof v!="string"){if(Array.isArray(v[2])){var b=v[2][v[2].length-1],D=this.$modes[b];if(D)return D[u].apply(D,[v[1]].concat([].slice.call(f,1)))}v=v[0]||"start"}for(var E=0;E<this.$embeds.length;E++)if(this.$modes[this.$embeds[E]]){var w=v.split(this.$embeds[E]);if(!w[0]&&w[1]){f[0]=w[1];var D=this.$modes[this.$embeds[E]];return D[u].apply(D,f)}}var y=g.apply(this,f);return g?y:void 0},this.transformAction=function(u,f,g,v,b){if(this.$behaviour){var D=this.$behaviour.getBehaviours();for(var E in D)if(D[E][f]){var w=D[E][f].apply(this,arguments);if(w)return w}}},this.getKeywords=function(u){if(!this.completionKeywords){var f=this.$tokenizer.rules,g=[];for(var v in f)for(var b=f[v],D=0,E=b.length;D<E;D++)if(typeof b[D].token=="string")/keyword|support|storage/.test(b[D].token)&&g.push(b[D].regex);else if(typeof b[D].token=="object"){for(var w=0,y=b[D].token.length;w<y;w++)if(/keyword|support|storage/.test(b[D].token[w])){var v=b[D].regex.match(/\(.+?\)/g)[w];g.push(v.substr(1,v.length-2))}}this.completionKeywords=g}return u?g.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(u,f,g,v){var b=this.$keywordList||this.$createKeywordList();return b.map(function(D){return{name:D,value:D,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(p.prototype),n.Mode=p}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(t,n,h){var i=t("./lib/dom"),s=(function(){function d(o){this.session=o,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}return d.prototype.getRowLength=function(o){var l;return this.lineWidgets?l=this.lineWidgets[o]&&this.lineWidgets[o].rowCount||0:l=0,!this.$useWrapMode||!this.$wrapData[o]?1+l:this.$wrapData[o].length+1+l},d.prototype.$getWidgetScreenLength=function(){var o=0;return this.lineWidgets.forEach(function(l){l&&l.rowCount&&!l.hidden&&(o+=l.rowCount)}),o},d.prototype.$onChangeEditor=function(o){this.attach(o.editor)},d.prototype.attach=function(o){o&&o.widgetManager&&o.widgetManager!=this&&o.widgetManager.detach(),this.editor!=o&&(this.detach(),this.editor=o,o&&(o.widgetManager=this,o.renderer.on("beforeRender",this.measureWidgets),o.renderer.on("afterRender",this.renderWidgets)))},d.prototype.detach=function(o){var l=this.editor;if(l){this.editor=null,l.widgetManager=null,l.renderer.off("beforeRender",this.measureWidgets),l.renderer.off("afterRender",this.renderWidgets);var r=this.session.lineWidgets;r&&r.forEach(function(a){a&&a.el&&a.el.parentNode&&(a._inDocument=!1,a.el.parentNode.removeChild(a.el))})}},d.prototype.updateOnFold=function(o,l){var r=l.lineWidgets;if(!(!r||!o.action)){for(var a=o.data,c=a.start.row,p=a.end.row,u=o.action=="add",f=c+1;f<p;f++)r[f]&&(r[f].hidden=u);r[p]&&(u?r[c]?r[p].hidden=u:r[c]=r[p]:(r[c]==r[p]&&(r[c]=void 0),r[p].hidden=u))}},d.prototype.updateOnChange=function(o){var l=this.session.lineWidgets;if(l){var r=o.start.row,a=o.end.row-r;if(a!==0)if(o.action=="remove"){var c=l.splice(r+1,a);!l[r]&&c[c.length-1]&&(l[r]=c.pop()),c.forEach(function(u){u&&this.removeLineWidget(u)},this),this.$updateRows()}else{var p=new Array(a);l[r]&&l[r].column!=null&&o.start.column>l[r].column&&r++,p.unshift(r,0),l.splice.apply(l,p),this.$updateRows()}}},d.prototype.$updateRows=function(){var o=this.session.lineWidgets;if(o){var l=!0;o.forEach(function(r,a){if(r)for(l=!1,r.row=a;r.$oldWidget;)r.$oldWidget.row=a,r=r.$oldWidget}),l&&(this.session.lineWidgets=null)}},d.prototype.$registerLineWidget=function(o){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var l=this.session.lineWidgets[o.row];return l&&(o.$oldWidget=l,l.el&&l.el.parentNode&&(l.el.parentNode.removeChild(l.el),l._inDocument=!1)),this.session.lineWidgets[o.row]=o,o},d.prototype.addLineWidget=function(o){if(this.$registerLineWidget(o),o.session=this.session,!this.editor)return o;var l=this.editor.renderer;o.html&&!o.el&&(o.el=i.createElement("div"),o.el.innerHTML=o.html),o.text&&!o.el&&(o.el=i.createElement("div"),o.el.textContent=o.text),o.el&&(i.addCssClass(o.el,"ace_lineWidgetContainer"),o.className&&i.addCssClass(o.el,o.className),o.el.style.position="absolute",o.el.style.zIndex="5",l.container.appendChild(o.el),o._inDocument=!0,o.coverGutter||(o.el.style.zIndex="3"),o.pixelHeight==null&&(o.pixelHeight=o.el.offsetHeight)),o.rowCount==null&&(o.rowCount=o.pixelHeight/l.layerConfig.lineHeight);var r=this.session.getFoldAt(o.row,0);if(o.$fold=r,r){var a=this.session.lineWidgets;o.row==r.end.row&&!a[r.start.row]?a[r.start.row]=o:o.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:o.row}}}),this.$updateRows(),this.renderWidgets(null,l),this.onWidgetChanged(o),o},d.prototype.removeLineWidget=function(o){if(o._inDocument=!1,o.session=null,o.el&&o.el.parentNode&&o.el.parentNode.removeChild(o.el),o.editor&&o.editor.destroy)try{o.editor.destroy()}catch{}if(this.session.lineWidgets){var l=this.session.lineWidgets[o.row];if(l==o)this.session.lineWidgets[o.row]=o.$oldWidget,o.$oldWidget&&this.onWidgetChanged(o.$oldWidget);else for(;l;){if(l.$oldWidget==o){l.$oldWidget=o.$oldWidget;break}l=l.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:o.row}}}),this.$updateRows()},d.prototype.getWidgetsAtRow=function(o){for(var l=this.session.lineWidgets,r=l&&l[o],a=[];r;)a.push(r),r=r.$oldWidget;return a},d.prototype.onWidgetChanged=function(o){this.session._changedWidgets.push(o),this.editor&&this.editor.renderer.updateFull()},d.prototype.measureWidgets=function(o,l){var r=this.session._changedWidgets,a=l.layerConfig;if(!(!r||!r.length)){for(var c=1/0,p=0;p<r.length;p++){var u=r[p];if(!(!u||!u.el)&&u.session==this.session){if(!u._inDocument){if(this.session.lineWidgets[u.row]!=u)continue;u._inDocument=!0,l.container.appendChild(u.el)}u.h=u.el.offsetHeight,u.fixedWidth||(u.w=u.el.offsetWidth,u.screenWidth=Math.ceil(u.w/a.characterWidth));var f=u.h/a.lineHeight;u.coverLine&&(f-=this.session.getRowLineCount(u.row),f<0&&(f=0)),u.rowCount!=f&&(u.rowCount=f,u.row<c&&(c=u.row))}}c!=1/0&&(this.session._emit("changeFold",{data:{start:{row:c}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},d.prototype.renderWidgets=function(o,l){var r=l.layerConfig,a=this.session.lineWidgets;if(a){for(var c=Math.min(this.firstRow,r.firstRow),p=Math.max(this.lastRow,r.lastRow,a.length);c>0&&!a[c];)c--;this.firstRow=r.firstRow,this.lastRow=r.lastRow,l.$cursorLayer.config=r;for(var u=c;u<=p;u++){var f=a[u];if(!(!f||!f.el)){if(f.hidden){f.el.style.top=-100-(f.pixelHeight||0)+"px";continue}f._inDocument||(f._inDocument=!0,l.container.appendChild(f.el));var g=l.$cursorLayer.getPixelPosition({row:u,column:0},!0).top;f.coverLine||(g+=r.lineHeight*this.session.getRowLineCount(f.row)),f.el.style.top=g-r.offset+"px";var v=f.coverGutter?0:l.gutterWidth;f.fixedWidth||(v-=l.scrollLeft),f.el.style.left=v+"px",f.fullWidth&&f.screenWidth&&(f.el.style.minWidth=r.width+2*r.padding+"px"),f.fixedWidth?f.el.style.right=l.scrollBar.getWidth()+"px":f.el.style.right=""}}}},d})();n.LineWidgets=s}),ace.define("ace/apply_delta",["require","exports","module"],function(t,n,h){n.applyDelta=function(i,s,d){var o=s.start.row,l=s.start.column,r=i[o]||"";switch(s.action){case"insert":var a=s.lines;if(a.length===1)i[o]=r.substring(0,l)+s.lines[0]+r.substring(l);else{var c=[o,1].concat(s.lines);i.splice.apply(i,c),i[o]=r.substring(0,l)+i[o],i[o+s.lines.length-1]+=r.substring(l)}break;case"remove":var p=s.end.column,u=s.end.row;o===u?i[o]=r.substring(0,l)+r.substring(p):i.splice(o,u-o+1,r.substring(0,l)+i[u].substring(p));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,h){var i=t("./lib/oop"),s=t("./lib/event_emitter").EventEmitter,d=(function(){function r(a,c,p){this.$onChange=this.onChange.bind(this),this.attach(a),typeof c!="number"?this.setPosition(c.row,c.column):this.setPosition(c,p)}return r.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},r.prototype.getDocument=function(){return this.document},r.prototype.onChange=function(a){if(!(a.start.row==a.end.row&&a.start.row!=this.row)&&!(a.start.row>this.row)){var c=l(a,{row:this.row,column:this.column},this.$insertRight);this.setPosition(c.row,c.column,!0)}},r.prototype.setPosition=function(a,c,p){var u;if(p?u={row:a,column:c}:u=this.$clipPositionToDocument(a,c),!(this.row==u.row&&this.column==u.column)){var f={row:this.row,column:this.column};this.row=u.row,this.column=u.column,this._signal("change",{old:f,value:u})}},r.prototype.detach=function(){this.document.off("change",this.$onChange)},r.prototype.attach=function(a){this.document=a||this.document,this.document.on("change",this.$onChange)},r.prototype.$clipPositionToDocument=function(a,c){var p={};return a>=this.document.getLength()?(p.row=Math.max(0,this.document.getLength()-1),p.column=this.document.getLine(p.row).length):a<0?(p.row=0,p.column=0):(p.row=a,p.column=Math.min(this.document.getLine(p.row).length,Math.max(0,c))),c<0&&(p.column=0),p},r})();d.prototype.$insertRight=!1,i.implement(d.prototype,s);function o(r,a,c){var p=c?r.column<=a.column:r.column<a.column;return r.row<a.row||r.row==a.row&&p}function l(r,a,c){var p=r.action=="insert",u=(p?1:-1)*(r.end.row-r.start.row),f=(p?1:-1)*(r.end.column-r.start.column),g=r.start,v=p?g:r.end;return o(a,g,c)?{row:a.row,column:a.column}:o(v,a,!c)?{row:a.row+u,column:a.column+(a.row==v.row?f:0)}:{row:g.row,column:g.column}}n.Anchor=d}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(t,n,h){var i=t("./lib/oop"),s=t("./apply_delta").applyDelta,d=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,l=t("./anchor").Anchor,r=(function(){function a(c){this.$lines=[""],c.length===0?this.$lines=[""]:Array.isArray(c)?this.insertMergedLines({row:0,column:0},c):this.insert({row:0,column:0},c)}return a.prototype.setValue=function(c){var p=this.getLength()-1;this.remove(new o(0,0,p,this.getLine(p).length)),this.insert({row:0,column:0},c||"")},a.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},a.prototype.createAnchor=function(c,p){return new l(this,c,p)},a.prototype.$detectNewLine=function(c){var p=c.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=p?p[1]:`
194
- `,this._signal("changeNewLineMode")},a.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
195
- `;case"unix":return`
196
- `;default:return this.$autoNewLine||`
197
- `}},a.prototype.setNewLineMode=function(c){this.$newLineMode!==c&&(this.$newLineMode=c,this._signal("changeNewLineMode"))},a.prototype.getNewLineMode=function(){return this.$newLineMode},a.prototype.isNewLine=function(c){return c==`\r
198
- `||c=="\r"||c==`
199
- `},a.prototype.getLine=function(c){return this.$lines[c]||""},a.prototype.getLines=function(c,p){return this.$lines.slice(c,p+1)},a.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},a.prototype.getLength=function(){return this.$lines.length},a.prototype.getTextRange=function(c){return this.getLinesForRange(c).join(this.getNewLineCharacter())},a.prototype.getLinesForRange=function(c){var p;if(c.start.row===c.end.row)p=[this.getLine(c.start.row).substring(c.start.column,c.end.column)];else{p=this.getLines(c.start.row,c.end.row),p[0]=(p[0]||"").substring(c.start.column);var u=p.length-1;c.end.row-c.start.row==u&&(p[u]=p[u].substring(0,c.end.column))}return p},a.prototype.insertLines=function(c,p){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(c,p)},a.prototype.removeLines=function(c,p){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(c,p)},a.prototype.insertNewLine=function(c){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(c,["",""])},a.prototype.insert=function(c,p){return this.getLength()<=1&&this.$detectNewLine(p),this.insertMergedLines(c,this.$split(p))},a.prototype.insertInLine=function(c,p){var u=this.clippedPos(c.row,c.column),f=this.pos(c.row,c.column+p.length);return this.applyDelta({start:u,end:f,action:"insert",lines:[p]},!0),this.clonePos(f)},a.prototype.clippedPos=function(c,p){var u=this.getLength();c===void 0?c=u:c<0?c=0:c>=u&&(c=u-1,p=void 0);var f=this.getLine(c);return p==null&&(p=f.length),p=Math.min(Math.max(p,0),f.length),{row:c,column:p}},a.prototype.clonePos=function(c){return{row:c.row,column:c.column}},a.prototype.pos=function(c,p){return{row:c,column:p}},a.prototype.$clipPosition=function(c){var p=this.getLength();return c.row>=p?(c.row=Math.max(0,p-1),c.column=this.getLine(p-1).length):(c.row=Math.max(0,c.row),c.column=Math.min(Math.max(c.column,0),this.getLine(c.row).length)),c},a.prototype.insertFullLines=function(c,p){c=Math.min(Math.max(c,0),this.getLength());var u=0;c<this.getLength()?(p=p.concat([""]),u=0):(p=[""].concat(p),c--,u=this.$lines[c].length),this.insertMergedLines({row:c,column:u},p)},a.prototype.insertMergedLines=function(c,p){var u=this.clippedPos(c.row,c.column),f={row:u.row+p.length-1,column:(p.length==1?u.column:0)+p[p.length-1].length};return this.applyDelta({start:u,end:f,action:"insert",lines:p}),this.clonePos(f)},a.prototype.remove=function(c){var p=this.clippedPos(c.start.row,c.start.column),u=this.clippedPos(c.end.row,c.end.column);return this.applyDelta({start:p,end:u,action:"remove",lines:this.getLinesForRange({start:p,end:u})}),this.clonePos(p)},a.prototype.removeInLine=function(c,p,u){var f=this.clippedPos(c,p),g=this.clippedPos(c,u);return this.applyDelta({start:f,end:g,action:"remove",lines:this.getLinesForRange({start:f,end:g})},!0),this.clonePos(f)},a.prototype.removeFullLines=function(c,p){c=Math.min(Math.max(0,c),this.getLength()-1),p=Math.min(Math.max(0,p),this.getLength()-1);var u=p==this.getLength()-1&&c>0,f=p<this.getLength()-1,g=u?c-1:c,v=u?this.getLine(g).length:0,b=f?p+1:p,D=f?0:this.getLine(b).length,E=new o(g,v,b,D),w=this.$lines.slice(c,p+1);return this.applyDelta({start:E.start,end:E.end,action:"remove",lines:this.getLinesForRange(E)}),w},a.prototype.removeNewLine=function(c){c<this.getLength()-1&&c>=0&&this.applyDelta({start:this.pos(c,this.getLine(c).length),end:this.pos(c+1,0),action:"remove",lines:["",""]})},a.prototype.replace=function(c,p){if(c instanceof o||(c=o.fromPoints(c.start,c.end)),p.length===0&&c.isEmpty())return c.start;if(p==this.getTextRange(c))return c.end;this.remove(c);var u;return p?u=this.insert(c.start,p):u=c.start,u},a.prototype.applyDeltas=function(c){for(var p=0;p<c.length;p++)this.applyDelta(c[p])},a.prototype.revertDeltas=function(c){for(var p=c.length-1;p>=0;p--)this.revertDelta(c[p])},a.prototype.applyDelta=function(c,p){var u=c.action=="insert";(u?c.lines.length<=1&&!c.lines[0]:!o.comparePoints(c.start,c.end))||(u&&c.lines.length>2e4?this.$splitAndapplyLargeDelta(c,2e4):(s(this.$lines,c,p),this._signal("change",c)))},a.prototype.$safeApplyDelta=function(c){var p=this.$lines.length;(c.action=="remove"&&c.start.row<p&&c.end.row<p||c.action=="insert"&&c.start.row<=p)&&this.applyDelta(c)},a.prototype.$splitAndapplyLargeDelta=function(c,p){for(var u=c.lines,f=u.length-p+1,g=c.start.row,v=c.start.column,b=0,D=0;b<f;b=D){D+=p-1;var E=u.slice(b,D);E.push(""),this.applyDelta({start:this.pos(g+b,v),end:this.pos(g+D,v=0),action:c.action,lines:E},!0)}c.lines=u.slice(b),c.start.row=g+b,c.start.column=v,this.applyDelta(c,!0)},a.prototype.revertDelta=function(c){this.$safeApplyDelta({start:this.clonePos(c.start),end:this.clonePos(c.end),action:c.action=="insert"?"remove":"insert",lines:c.lines.slice()})},a.prototype.indexToPosition=function(c,p){for(var u=this.$lines||this.getAllLines(),f=this.getNewLineCharacter().length,g=p||0,v=u.length;g<v;g++)if(c-=u[g].length+f,c<0)return{row:g,column:c+u[g].length+f};return{row:v-1,column:c+u[v-1].length+f}},a.prototype.positionToIndex=function(c,p){for(var u=this.$lines||this.getAllLines(),f=this.getNewLineCharacter().length,g=0,v=Math.min(c.row,u.length),b=p||0;b<v;++b)g+=u[b].length+f;return g+c.column},a.prototype.$split=function(c){return c.split(/\r\n|\r|\n/)},a})();r.prototype.$autoNewLine="",r.prototype.$newLineMode="auto",i.implement(r.prototype,d),n.Document=r}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,h){var i=t("./lib/oop"),s=t("./lib/event_emitter").EventEmitter,d=(function(){function o(l,r){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=l;var a=this;this.$worker=function(){if(a.running){for(var c=new Date,p=a.currentLine,u=-1,f=a.doc,g=p;a.lines[p];)p++;var v=f.getLength(),b=0;for(a.running=!1;p<v;){a.$tokenizeRow(p),u=p;do p++;while(a.lines[p]);if(b++,b%5===0&&new Date-c>20){a.running=setTimeout(a.$worker,20);break}}a.currentLine=p,u==-1&&(u=p),g<=u&&a.fireUpdateEvent(g,u)}}}return o.prototype.setTokenizer=function(l){this.tokenizer=l,this.lines=[],this.states=[],this.start(0)},o.prototype.setDocument=function(l){this.doc=l,this.lines=[],this.states=[],this.stop()},o.prototype.fireUpdateEvent=function(l,r){var a={first:l,last:r};this._signal("update",{data:a})},o.prototype.start=function(l){this.currentLine=Math.min(l||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},o.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},o.prototype.$updateOnChange=function(l){var r=l.start.row,a=l.end.row-r;if(a===0)this.lines[r]=null;else if(l.action=="remove")this.lines.splice(r,a+1,null),this.states.splice(r,a+1,null);else{var c=Array(a+1);c.unshift(r,1),this.lines.splice.apply(this.lines,c),this.states.splice.apply(this.states,c)}this.currentLine=Math.min(r,this.currentLine,this.doc.getLength()),this.stop()},o.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},o.prototype.getTokens=function(l){return this.lines[l]||this.$tokenizeRow(l)},o.prototype.getState=function(l){return this.currentLine==l&&this.$tokenizeRow(l),this.states[l]||"start"},o.prototype.$tokenizeRow=function(l){var r=this.doc.getLine(l),a=this.states[l-1],c=this.tokenizer.getLineTokens(r,a,l);return this.states[l]+""!=c.state+""?(this.states[l]=c.state,this.lines[l+1]=null,this.currentLine>l+1&&(this.currentLine=l+1)):this.currentLine==l&&(this.currentLine=l+1),this.lines[l]=c.tokens},o.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},o})();i.implement(d.prototype,s),n.BackgroundTokenizer=d}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(t,n,h){var i=t("./lib/lang"),s=t("./range").Range,d=(function(){function o(l,r,a){a===void 0&&(a="text"),this.setRegexp(l),this.clazz=r,this.type=a,this.docLen=0}return o.prototype.setRegexp=function(l){this.regExp+""!=l+""&&(this.regExp=l,this.cache=[])},o.prototype.update=function(l,r,a,c){if(this.regExp){for(var p=c.firstRow,u=c.lastRow,f={},g=a.$editor&&a.$editor.$search,v=g&&g.$isMultilineSearch(a.$editor.getLastSearchOptions()),b=p;b<=u;b++){var D=this.cache[b];if(D==null||a.getValue().length!=this.docLen){if(v){D=[];var E=g.$multiLineForward(a,this.regExp,b,u);if(E){var w=E.endRow<=u?E.endRow-1:u;w>b&&(b=w),D.push(new s(E.startRow,E.startCol,E.endRow,E.endCol))}D.length>this.MAX_RANGES&&(D=D.slice(0,this.MAX_RANGES))}else D=i.getMatchOffsets(a.getLine(b),this.regExp),D.length>this.MAX_RANGES&&(D=D.slice(0,this.MAX_RANGES)),D=D.map(function(x){return new s(b,x.offset,b,x.offset+x.length)});this.cache[b]=D.length?D:""}if(D.length!==0)for(var y=D.length;y--;){var A=D[y].toScreenRange(a),T=A.toString();f[T]||(f[T]=!0,r.drawSingleLineMarker(l,A,this.clazz,c))}}this.docLen=a.getValue().length}},o})();d.prototype.MAX_RANGES=500,n.SearchHighlight=d}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,n,h){var i=(function(){function w(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return w.prototype.addSession=function(y){this.$session=y},w.prototype.add=function(y,A,T){if(!this.$fromUndo&&y!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),A===!1||!this.lastDeltas){this.lastDeltas=[];var x=this.$undoStack.length;x>this.$undoDepth-1&&this.$undoStack.splice(0,x-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),y.id=this.$rev=++this.$maxRev}(y.action=="remove"||y.action=="insert")&&(this.$lastDelta=y),this.lastDeltas.push(y)}},w.prototype.addSelection=function(y,A){this.selections.push({value:y,rev:A||this.$rev})},w.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},w.prototype.markIgnored=function(y,A){A==null&&(A=this.$rev+1);for(var T=this.$undoStack,x=T.length;x--;){var M=T[x][0];if(M.id<=y)break;M.id<A&&(M.ignore=!0)}this.lastDeltas=null},w.prototype.getSelection=function(y,A){for(var T=this.selections,x=T.length;x--;){var M=T[x];if(M.rev<y)return A&&(M=T[x+1]),M}},w.prototype.getRevision=function(){return this.$rev},w.prototype.getDeltas=function(y,A){A==null&&(A=this.$rev+1);for(var T=this.$undoStack,x=null,M=0,O=T.length;O--;){var _=T[O][0];if(_.id<A&&!x&&(x=O+1),_.id<=y){M=O+1;break}}return T.slice(M,x)},w.prototype.getChangedRanges=function(y,A){A==null&&(A=this.$rev+1)},w.prototype.getChangedLines=function(y,A){A==null&&(A=this.$rev+1)},w.prototype.undo=function(y,A){this.lastDeltas=null;var T=this.$undoStack;if(s(T,T.length)){y||(y=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var x=T.pop(),M=null;return x&&(M=y.undoChanges(x,A),this.$redoStack.push(x),this.$syncRev()),this.$fromUndo=!1,M}},w.prototype.redo=function(y,A){if(this.lastDeltas=null,y||(y=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var T=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);E(this.$redoStack,T),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(O){O[0].id=++this.$maxRev},this)}var x=this.$redoStack.pop(),M=null;return x&&(M=y.redoChanges(x,A),this.$undoStack.push(x),this.$syncRev()),this.$fromUndo=!1,M},w.prototype.$syncRev=function(){var y=this.$undoStack,A=y[y.length-1],T=A&&A[0].id||0;this.$redoStackBaseRev=T,this.$rev=T},w.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},w.prototype.canUndo=function(){return this.$undoStack.length>0},w.prototype.canRedo=function(){return this.$redoStack.length>0},w.prototype.bookmark=function(y){y==null&&(y=this.$rev),this.mark=y},w.prototype.isAtBookmark=function(){return this.$rev===this.mark},w.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},w.prototype.fromJSON=function(y){this.reset(),this.$undoStack=y.$undoStack,this.$redoStack=y.$redoStack},w.prototype.$prettyPrint=function(y){return y?a(y):a(this.$undoStack)+`
200
- ---
201
- `+a(this.$redoStack)},w})();i.prototype.hasUndo=i.prototype.canUndo,i.prototype.hasRedo=i.prototype.canRedo,i.prototype.isClean=i.prototype.isAtBookmark,i.prototype.markClean=i.prototype.bookmark;function s(w,y){for(var A=y;A--;){var T=w[A];if(T&&!T[0].ignore){for(;A<y-1;){var x=u(w[A],w[A+1]);w[A]=x[0],w[A+1]=x[1],A++}return!0}}}var d=t("./range").Range,o=d.comparePoints;d.comparePoints;function l(w){return{row:w.row,column:w.column}}function r(w){return{start:l(w.start),end:l(w.end),action:w.action,lines:w.lines.slice()}}function a(w){if(w=w||this,Array.isArray(w))return w.map(a).join(`
202
- `);var y="";return w.action?(y=w.action=="insert"?"+":"-",y+="["+w.lines+"]"):w.value&&(Array.isArray(w.value)?y=w.value.map(c).join(`
203
- `):y=c(w.value)),w.start&&(y+=c(w)),(w.id||w.rev)&&(y+=" ("+(w.id||w.rev)+")"),y}function c(w){return w.start.row+":"+w.start.column+"=>"+w.end.row+":"+w.end.column}function p(w,y){var A=w.action=="insert",T=y.action=="insert";if(A&&T)if(o(y.start,w.end)>=0)g(y,w,-1);else if(o(y.start,w.start)<=0)g(w,y,1);else return null;else if(A&&!T)if(o(y.start,w.end)>=0)g(y,w,-1);else if(o(y.end,w.start)<=0)g(w,y,-1);else return null;else if(!A&&T)if(o(y.start,w.start)>=0)g(y,w,1);else if(o(y.start,w.start)<=0)g(w,y,1);else return null;else if(!A&&!T)if(o(y.start,w.start)>=0)g(y,w,1);else if(o(y.end,w.start)<=0)g(w,y,-1);else return null;return[y,w]}function u(w,y){for(var A=w.length;A--;)for(var T=0;T<y.length;T++)if(!p(w[A],y[T])){for(;A<w.length;){for(;T--;)p(y[T],w[A]);T=y.length,A++}return[w,y]}return w.selectionBefore=y.selectionBefore=w.selectionAfter=y.selectionAfter=null,[y,w]}function f(w,y){var A=w.action=="insert",T=y.action=="insert";if(A&&T)o(w.start,y.start)<0?g(y,w,1):g(w,y,1);else if(A&&!T)o(w.start,y.end)>=0?g(w,y,-1):(o(w.start,y.start)<=0||g(w,d.fromPoints(y.start,w.start),-1),g(y,w,1));else if(!A&&T)o(y.start,w.end)>=0?g(y,w,-1):(o(y.start,w.start)<=0||g(y,d.fromPoints(w.start,y.start),-1),g(w,y,1));else if(!A&&!T)if(o(y.start,w.end)>=0)g(y,w,-1);else if(o(y.end,w.start)<=0)g(w,y,-1);else{var x,M;return o(w.start,y.start)<0&&(x=w,w=b(w,y.start)),o(w.end,y.end)>0&&(M=b(w,y.end)),v(y.end,w.start,w.end,-1),M&&!x&&(w.lines=M.lines,w.start=M.start,w.end=M.end,M=w),[y,x,M].filter(Boolean)}return[y,w]}function g(w,y,A){v(w.start,y.start,y.end,A),v(w.end,y.start,y.end,A)}function v(w,y,A,T){w.row==(T==1?y:A).row&&(w.column+=T*(A.column-y.column)),w.row+=T*(A.row-y.row)}function b(w,y){var A=w.lines,T=w.end;w.end=l(y);var x=w.end.row-w.start.row,M=A.splice(x,A.length),O=x?y.column:y.column-w.start.column;A.push(M[0].substring(0,O)),M[0]=M[0].substr(O);var _={start:l(y),end:T,lines:M,action:w.action};return _}function D(w,y){y=r(y);for(var A=w.length;A--;){for(var T=w[A],x=0;x<T.length;x++){var M=T[x],O=f(M,y);y=O[0],O.length!=2&&(O[2]?(T.splice(x+1,1,O[1],O[2]),x++):O[1]||(T.splice(x,1),x--))}T.length||w.splice(A,1)}return w}function E(w,y){for(var A=0;A<y.length;A++)for(var T=y[A],x=0;x<T.length;x++)D(w,T[x])}n.UndoManager=i}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(t,n,h){var i=t("../range").Range,s=(function(){function d(o,l){this.foldData=o,Array.isArray(l)?this.folds=l:l=this.folds=[l];var r=l[l.length-1];this.range=new i(l[0].start.row,l[0].start.column,r.end.row,r.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(a){a.setFoldLine(this)},this)}return d.prototype.shiftRow=function(o){this.start.row+=o,this.end.row+=o,this.folds.forEach(function(l){l.start.row+=o,l.end.row+=o})},d.prototype.addFold=function(o){if(o.sameRow){if(o.start.row<this.startRow||o.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(o),this.folds.sort(function(l,r){return-l.range.compareEnd(r.start.row,r.start.column)}),this.range.compareEnd(o.start.row,o.start.column)>0?(this.end.row=o.end.row,this.end.column=o.end.column):this.range.compareStart(o.end.row,o.end.column)<0&&(this.start.row=o.start.row,this.start.column=o.start.column)}else if(o.start.row==this.end.row)this.folds.push(o),this.end.row=o.end.row,this.end.column=o.end.column;else if(o.end.row==this.start.row)this.folds.unshift(o),this.start.row=o.start.row,this.start.column=o.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");o.foldLine=this},d.prototype.containsRow=function(o){return o>=this.start.row&&o<=this.end.row},d.prototype.walk=function(o,l,r){var a=0,c=this.folds,p,u,f,g=!0;l==null&&(l=this.end.row,r=this.end.column);for(var v=0;v<c.length;v++){if(p=c[v],u=p.range.compareStart(l,r),u==-1){o(null,l,r,a,g);return}if(f=o(null,p.start.row,p.start.column,a,g),f=!f&&o(p.placeholder,p.start.row,p.start.column,a),f||u===0)return;g=!p.sameRow,a=p.end.column}o(null,l,r,a,g)},d.prototype.getNextFoldTo=function(o,l){for(var r,a,c=0;c<this.folds.length;c++){if(r=this.folds[c],a=r.range.compareEnd(o,l),a==-1)return{fold:r,kind:"after"};if(a===0)return{fold:r,kind:"inside"}}return null},d.prototype.addRemoveChars=function(o,l,r){var a=this.getNextFoldTo(o,l),c,p;if(a){if(c=a.fold,a.kind=="inside"&&c.start.column!=l&&c.start.row!=o)window.console&&window.console.log(o,l,c);else if(c.start.row==o){p=this.folds;var u=p.indexOf(c);for(u===0&&(this.start.column+=r),u;u<p.length;u++){if(c=p[u],c.start.column+=r,!c.sameRow)return;c.end.column+=r}this.end.column+=r}}},d.prototype.split=function(o,l){var r=this.getNextFoldTo(o,l);if(!r||r.kind=="inside")return null;var a=r.fold,c=this.folds,p=this.foldData,u=c.indexOf(a),f=c[u-1];this.end.row=f.end.row,this.end.column=f.end.column,c=c.splice(u,c.length-u);var g=new d(p,c);return p.splice(p.indexOf(this)+1,0,g),g},d.prototype.merge=function(o){for(var l=o.folds,r=0;r<l.length;r++)this.addFold(l[r]);var a=this.foldData;a.splice(a.indexOf(o),1)},d.prototype.toString=function(){var o=[this.range.toString()+": ["];return this.folds.forEach(function(l){o.push(" "+l.toString())}),o.push("]"),o.join(`
204
- `)},d.prototype.idxToPosition=function(o){for(var l=0,r=0;r<this.folds.length;r++){var a=this.folds[r];if(o-=a.start.column-l,o<0)return{row:a.start.row,column:a.start.column+o};if(o-=a.placeholder.length,o<0)return a.start;l=a.end.column}return{row:this.end.row,column:this.end.column+o}},d})();n.FoldLine=s}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(t,n,h){var i=t("./range").Range,s=i.comparePoints,d=(function(){function o(){this.ranges=[],this.$bias=1}return o.prototype.pointIndex=function(l,r,a){for(var c=this.ranges,p=a||0;p<c.length;p++){var u=c[p],f=s(l,u.end);if(!(f>0)){var g=s(l,u.start);return f===0?r&&g!==0?-p-2:p:g>0||g===0&&!r?p:-p-1}}return-p-1},o.prototype.add=function(l){var r=!l.isEmpty(),a=this.pointIndex(l.start,r);a<0&&(a=-a-1);var c=this.pointIndex(l.end,r,a);return c<0?c=-c-1:c++,this.ranges.splice(a,c-a,l)},o.prototype.addList=function(l){for(var r=[],a=l.length;a--;)r.push.apply(r,this.add(l[a]));return r},o.prototype.substractPoint=function(l){var r=this.pointIndex(l);if(r>=0)return this.ranges.splice(r,1)},o.prototype.merge=function(){var l=[],r=this.ranges;r=r.sort(function(f,g){return s(f.start,g.start)});for(var a=r[0],c,p=1;p<r.length;p++){c=a,a=r[p];var u=s(c.end,a.start);u<0||u==0&&!c.isEmpty()&&!a.isEmpty()||(s(c.end,a.end)<0&&(c.end.row=a.end.row,c.end.column=a.end.column),r.splice(p,1),l.push(a),a=c,p--)}return this.ranges=r,l},o.prototype.contains=function(l,r){return this.pointIndex({row:l,column:r})>=0},o.prototype.containsPoint=function(l){return this.pointIndex(l)>=0},o.prototype.rangeAtPoint=function(l){var r=this.pointIndex(l);if(r>=0)return this.ranges[r]},o.prototype.clipRows=function(l,r){var a=this.ranges;if(a[0].start.row>r||a[a.length-1].start.row<l)return[];var c=this.pointIndex({row:l,column:0});c<0&&(c=-c-1);var p=this.pointIndex({row:r,column:0},c);p<0&&(p=-p-1);for(var u=[],f=c;f<p;f++)u.push(a[f]);return u},o.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},o.prototype.attach=function(l){this.session&&this.detach(),this.session=l,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},o.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},o.prototype.$onChange=function(l){for(var r=l.start,a=l.end,c=r.row,p=a.row,u=this.ranges,f=0,g=u.length;f<g;f++){var v=u[f];if(v.end.row>=c)break}if(l.action=="insert")for(var b=p-c,D=-r.column+a.column;f<g;f++){var v=u[f];if(v.start.row>c)break;if(v.start.row==c&&v.start.column>=r.column&&(v.start.column==r.column&&this.$bias<=0||(v.start.column+=D,v.start.row+=b)),v.end.row==c&&v.end.column>=r.column){if(v.end.column==r.column&&this.$bias<0)continue;v.end.column==r.column&&D>0&&f<g-1&&v.end.column>v.start.column&&v.end.column==u[f+1].start.column&&(v.end.column-=D),v.end.column+=D,v.end.row+=b}}else for(var b=c-p,D=r.column-a.column;f<g;f++){var v=u[f];if(v.start.row>p)break;v.end.row<p&&(c<v.end.row||c==v.end.row&&r.column<v.end.column)?(v.end.row=c,v.end.column=r.column):v.end.row==p?v.end.column<=a.column?(b||v.end.column>r.column)&&(v.end.column=r.column,v.end.row=r.row):(v.end.column+=D,v.end.row+=b):v.end.row>p&&(v.end.row+=b),v.start.row<p&&(c<v.start.row||c==v.start.row&&r.column<v.start.column)?(v.start.row=c,v.start.column=r.column):v.start.row==p?v.start.column<=a.column?(b||v.start.column>r.column)&&(v.start.column=r.column,v.start.row=r.row):(v.start.column+=D,v.start.row+=b):v.start.row>p&&(v.start.row+=b)}if(b!=0&&f<g)for(;f<g;f++){var v=u[f];v.start.row+=b,v.end.row+=b}},o})();d.prototype.comparePoints=s,n.RangeList=d}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(t,n,h){var i=this&&this.__extends||(function(){var c=function(p,u){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)Object.prototype.hasOwnProperty.call(g,v)&&(f[v]=g[v])},c(p,u)};return function(p,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");c(p,u);function f(){this.constructor=p}p.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)}})(),s=t("../range_list").RangeList,d=(function(c){i(p,c);function p(u,f){var g=c.call(this)||this;return g.foldLine=null,g.placeholder=f,g.range=u,g.start=u.start,g.end=u.end,g.sameRow=u.start.row==u.end.row,g.subFolds=g.ranges=[],g}return p.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},p.prototype.setFoldLine=function(u){this.foldLine=u,this.subFolds.forEach(function(f){f.setFoldLine(u)})},p.prototype.clone=function(){var u=this.range.clone(),f=new p(u,this.placeholder);return this.subFolds.forEach(function(g){f.subFolds.push(g.clone())}),f.collapseChildren=this.collapseChildren,f},p.prototype.addSubFold=function(u){if(!this.range.isEqual(u)){l(u,this.start);for(var D=u.start.row,E=u.start.column,f=0,g=-1;f<this.subFolds.length&&(g=this.subFolds[f].range.compare(D,E),g==1);f++);var v=this.subFolds[f],b=0;if(g==0){if(v.range.containsRange(u))return v.addSubFold(u);b=1}for(var D=u.range.end.row,E=u.range.end.column,w=f,g=-1;w<this.subFolds.length&&(g=this.subFolds[w].range.compare(D,E),g==1);w++);g==0&&w++;for(var y=this.subFolds.splice(f,w-f,u),A=g==0?y.length-1:y.length,T=b;T<A;T++)u.addSubFold(y[T]);return u.setFoldLine(this.foldLine),u}},p.prototype.restoreRange=function(u){return a(u,this.start)},p})(s);function o(c,p){c.row-=p.row,c.row==0&&(c.column-=p.column)}function l(c,p){o(c.start,p),o(c.end,p)}function r(c,p){c.row==0&&(c.column+=p.column),c.row+=p.row}function a(c,p){r(c.start,p),r(c.end,p)}n.Fold=d}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],function(t,n,h){var i=t("../range").Range,s=t("./fold_line").FoldLine,d=t("./fold").Fold,o=t("../token_iterator").TokenIterator,l=t("../mouse/mouse_event").MouseEvent;function r(){this.getFoldAt=function(a,c,p){var u=this.getFoldLine(a);if(!u)return null;for(var f=u.folds,g=0;g<f.length;g++){var v=f[g].range;if(v.contains(a,c)){if(p==1&&v.isEnd(a,c)&&!v.isEmpty())continue;if(p==-1&&v.isStart(a,c)&&!v.isEmpty())continue;return f[g]}}},this.getFoldsInRange=function(a){var c=a.start,p=a.end,u=this.$foldData,f=[];c.column+=1,p.column-=1;for(var g=0;g<u.length;g++){var v=u[g].range.compareRange(a);if(v!=2){if(v==-2)break;for(var b=u[g].folds,D=0;D<b.length;D++){var E=b[D];if(v=E.range.compareRange(a),v==-2)break;if(v==2)continue;if(v==42)break;f.push(E)}}}return c.column-=1,p.column+=1,f},this.getFoldsInRangeList=function(a){if(Array.isArray(a)){var c=[];a.forEach(function(p){c=c.concat(this.getFoldsInRange(p))},this)}else var c=this.getFoldsInRange(a);return c},this.getAllFolds=function(){for(var a=[],c=this.$foldData,p=0;p<c.length;p++)for(var u=0;u<c[p].folds.length;u++)a.push(c[p].folds[u]);return a},this.getFoldStringAt=function(a,c,p,u){if(u=u||this.getFoldLine(a),!u)return null;for(var f={end:{column:0}},g,v,b=0;b<u.folds.length;b++){v=u.folds[b];var D=v.range.compareEnd(a,c);if(D==-1){g=this.getLine(v.start.row).substring(f.end.column,v.start.column);break}else if(D===0)return null;f=v}return g||(g=this.getLine(v.start.row).substring(f.end.column)),p==-1?g.substring(0,c-f.end.column):p==1?g.substring(c-f.end.column):g},this.getFoldLine=function(a,c){var p=this.$foldData,u=0;for(c&&(u=p.indexOf(c)),u==-1&&(u=0),u;u<p.length;u++){var f=p[u];if(f.start.row<=a&&f.end.row>=a)return f;if(f.end.row>a)return null}return null},this.getNextFoldLine=function(a,c){var p=this.$foldData,u=0;for(c&&(u=p.indexOf(c)),u==-1&&(u=0),u;u<p.length;u++){var f=p[u];if(f.end.row>=a)return f}return null},this.getFoldedRowCount=function(a,c){for(var p=this.$foldData,u=c-a+1,f=0;f<p.length;f++){var g=p[f],v=g.end.row,b=g.start.row;if(v>=c){b<c&&(b>=a?u-=c-b:u=0);break}else v>=a&&(b>=a?u-=v-b:u-=v-a+1)}return u},this.$addFoldLine=function(a){return this.$foldData.push(a),this.$foldData.sort(function(c,p){return c.start.row-p.start.row}),a},this.addFold=function(a,c){var p=this.$foldData,u=!1,f;a instanceof d?f=a:(f=new d(c,a),f.collapseChildren=c.collapseChildren),this.$clipRangeToDocument(f.range);var g=f.start.row,v=f.start.column,b=f.end.row,D=f.end.column,E=this.getFoldAt(g,v,1),w=this.getFoldAt(b,D,-1);if(E&&w==E)return E.addSubFold(f);E&&!E.range.isStart(g,v)&&this.removeFold(E),w&&!w.range.isEnd(b,D)&&this.removeFold(w);var y=this.getFoldsInRange(f.range);y.length>0&&(this.removeFolds(y),f.collapseChildren||y.forEach(function(M){f.addSubFold(M)}));for(var A=0;A<p.length;A++){var T=p[A];if(b==T.start.row){T.addFold(f),u=!0;break}else if(g==T.end.row){if(T.addFold(f),u=!0,!f.sameRow){var x=p[A+1];if(x&&x.start.row==b){T.merge(x);break}}break}else if(b<=T.start.row)break}return u||(T=this.$addFoldLine(new s(this.$foldData,f))),this.$useWrapMode?this.$updateWrapData(T.start.row,T.start.row):this.$updateRowLengthCache(T.start.row,T.start.row),this.$modified=!0,this._signal("changeFold",{data:f,action:"add"}),f},this.addFolds=function(a){a.forEach(function(c){this.addFold(c)},this)},this.removeFold=function(a){var c=a.foldLine,p=c.start.row,u=c.end.row,f=this.$foldData,g=c.folds;if(g.length==1)f.splice(f.indexOf(c),1);else if(c.range.isEnd(a.end.row,a.end.column))g.pop(),c.end.row=g[g.length-1].end.row,c.end.column=g[g.length-1].end.column;else if(c.range.isStart(a.start.row,a.start.column))g.shift(),c.start.row=g[0].start.row,c.start.column=g[0].start.column;else if(a.sameRow)g.splice(g.indexOf(a),1);else{var v=c.split(a.start.row,a.start.column);g=v.folds,g.shift(),v.start.row=g[0].start.row,v.start.column=g[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(p,u):this.$updateRowLengthCache(p,u)),this.$modified=!0,this._signal("changeFold",{data:a,action:"remove"})},this.removeFolds=function(a){for(var c=[],p=0;p<a.length;p++)c.push(a[p]);c.forEach(function(u){this.removeFold(u)},this),this.$modified=!0},this.expandFold=function(a){this.removeFold(a),a.subFolds.forEach(function(c){a.restoreRange(c),this.addFold(c)},this),a.collapseChildren>0&&this.foldAll(a.start.row+1,a.end.row,a.collapseChildren-1),a.subFolds=[]},this.expandFolds=function(a){a.forEach(function(c){this.expandFold(c)},this)},this.unfold=function(a,c){var p,u;if(a==null)p=new i(0,0,this.getLength(),0),c==null&&(c=!0);else if(typeof a=="number")p=new i(a,0,a,this.getLine(a).length);else if("row"in a)p=i.fromPoints(a,a);else{if(Array.isArray(a))return u=[],a.forEach(function(g){u=u.concat(this.unfold(g))},this),u;p=a}u=this.getFoldsInRangeList(p);for(var f=u;u.length==1&&i.comparePoints(u[0].start,p.start)<0&&i.comparePoints(u[0].end,p.end)>0;)this.expandFolds(u),u=this.getFoldsInRangeList(p);if(c!=!1?this.removeFolds(u):this.expandFolds(u),f.length)return f},this.isRowFolded=function(a,c){return!!this.getFoldLine(a,c)},this.getRowFoldEnd=function(a,c){var p=this.getFoldLine(a,c);return p?p.end.row:a},this.getRowFoldStart=function(a,c){var p=this.getFoldLine(a,c);return p?p.start.row:a},this.getFoldDisplayLine=function(a,c,p,u,f){u==null&&(u=a.start.row),f==null&&(f=0),c==null&&(c=a.end.row),p==null&&(p=this.getLine(c).length);var g=this.doc,v="";return a.walk(function(b,D,E,w){if(!(D<u)){if(D==u){if(E<f)return;w=Math.max(f,w)}b!=null?v+=b:v+=g.getLine(D).substring(w,E)}},c,p),v},this.getDisplayLine=function(a,c,p,u){var f=this.getFoldLine(a);if(f)return this.getFoldDisplayLine(f,a,c,p,u);var g;return g=this.doc.getLine(a),g.substring(u||0,c||g.length)},this.$cloneFoldData=function(){var a=[];return a=this.$foldData.map(function(c){var p=c.folds.map(function(u){return u.clone()});return new s(a,p)}),a},this.toggleFold=function(a){var c=this.selection,p=c.getRange(),u,f;if(p.isEmpty()){var g=p.start;if(u=this.getFoldAt(g.row,g.column),u){this.expandFold(u);return}else if(a){var v=this.getFoldLine(g.row);v&&this.expandFolds(v.folds);return}else(f=this.findMatchingBracket(g))?p.comparePoint(f)==1?p.end=f:(p.start=f,p.start.column++,p.end.column--):(f=this.findMatchingBracket({row:g.row,column:g.column+1}))?(p.comparePoint(f)==1?p.end=f:p.start=f,p.start.column++):p=this.getCommentFoldRange(g.row,g.column)||p}else{var b=this.getFoldsInRange(p);if(a&&b.length){this.expandFolds(b);return}else b.length==1&&(u=b[0])}if(u||(u=this.getFoldAt(p.start.row,p.start.column)),u&&u.range.toString()==p.toString()){this.expandFold(u);return}var D="...";if(!p.isMultiLine()){if(D=this.getTextRange(p),D.length<4)return;D=D.trim().substring(0,2)+".."}this.addFold(D,p)},this.getCommentFoldRange=function(a,c,p){var u=new o(this,a,c),f=u.getCurrentToken(),g=f&&f.type;if(f&&/^comment|string/.test(g)){g=g.match(/comment|string/)[0],g=="comment"&&(g+="|doc-start|\\.doc");var v=new RegExp(g),b=new i;if(p!=1){do f=u.stepBackward();while(f&&v.test(f.type));f=u.stepForward()}b.start.row=u.getCurrentTokenRow(),b.start.column=u.getCurrentTokenColumn()+f.value.length,u=new o(this,a,c);var D=this.getState(u.$row);if(p!=-1){var E=-1;do if(f=u.stepForward(),E==-1){var w=this.getState(u.$row);D.toString()!==w.toString()&&(E=u.$row)}else if(u.$row>E)break;while(f&&v.test(f.type));f=u.stepBackward()}else f=u.getCurrentToken();return b.end.row=u.getCurrentTokenRow(),b.end.column=u.getCurrentTokenColumn(),b.start.row==b.end.row&&b.start.column>b.end.column?void 0:b}},this.foldAll=function(a,c,p,u){p==null&&(p=1e5);var f=this.foldWidgets;if(f){c=c||this.getLength(),a=a||0;for(var g=a;g<c;g++)if(f[g]==null&&(f[g]=this.getFoldWidget(g)),f[g]=="start"&&!(u&&!u(g))){var v=this.getFoldWidgetRange(g);v&&v.isMultiLine()&&v.end.row<=c&&v.start.row>=a&&(g=v.end.row,v.collapseChildren=p,this.addFold("...",v))}}},this.foldToLevel=function(a){for(this.foldAll();a-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var a=this;this.foldAll(null,null,null,function(c){for(var p=a.getTokens(c),u=0;u<p.length;u++){var f=p[u];if(!(f.type=="text"&&/^\s+$/.test(f.value)))return!!/comment/.test(f.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(a){if(!this.$foldStyles[a])throw new Error("invalid fold style: "+a+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=a){this.$foldStyle=a,a=="manual"&&this.unfold();var c=this.$foldMode;this.$setFolding(null),this.$setFolding(c)}},this.$setFolding=function(a){if(this.$foldMode!=a){if(this.$foldMode=a,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!a||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=a.getFoldWidget.bind(a,this,this.$foldStyle),this.getFoldWidgetRange=a.getFoldWidgetRange.bind(a,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)}},this.getParentFoldRangeData=function(a,c){var p=this.foldWidgets;if(!p||c&&p[a])return{};for(var u=a-1,f;u>=0;){var g=p[u];if(g==null&&(g=p[u]=this.getFoldWidget(u)),g=="start"){var v=this.getFoldWidgetRange(u);if(f||(f=v),v&&v.end.row>=a)break}u--}return{range:u!==-1&&v,firstRange:f}},this.onFoldWidgetClick=function(a,c){c instanceof l&&(c=c.domEvent);var p={children:c.shiftKey,all:c.ctrlKey||c.metaKey,siblings:c.altKey},u=this.$toggleFoldWidget(a,p);if(!u){var f=c.target||c.srcElement;f&&/ace_fold-widget/.test(f.className)&&(f.className+=" ace_invalid")}},this.$toggleFoldWidget=function(a,c){if(this.getFoldWidget){var p=this.getFoldWidget(a),u=this.getLine(a),f=p==="end"?-1:1,g=this.getFoldAt(a,f===-1?0:u.length,f);if(g)return c.children||c.all?this.removeFold(g):this.expandFold(g),g;var v=this.getFoldWidgetRange(a,!0);if(v&&!v.isMultiLine()&&(g=this.getFoldAt(v.start.row,v.start.column,1),g&&v.isEqual(g.range)))return this.removeFold(g),g;if(c.siblings){var b=this.getParentFoldRangeData(a);if(b.range)var D=b.range.start.row+1,E=b.range.end.row;this.foldAll(D,E,c.all?1e4:0)}else c.children?(E=v?v.end.row:this.getLength(),this.foldAll(a+1,E,c.all?1e4:0)):v&&(c.all&&(v.collapseChildren=1e4),this.addFold("...",v));return v}},this.toggleFoldWidget=function(a){var c=this.selection.getCursor().row;c=this.getRowFoldStart(c);var p=this.$toggleFoldWidget(c,{});if(!p){var u=this.getParentFoldRangeData(c,!0);if(p=u.range||u.firstRange,p){c=p.start.row;var f=this.getFoldAt(c,this.getLine(c).length,1);f?this.removeFold(f):this.addFold("...",p)}}},this.updateFoldWidgets=function(a){var c=a.start.row,p=a.end.row-c;if(p===0)this.foldWidgets[c]=null;else if(a.action=="remove")this.foldWidgets.splice(c,p+1,null);else{var u=Array(p+1);u.unshift(c,1),this.foldWidgets.splice.apply(this.foldWidgets,u)}},this.tokenizerUpdateFoldWidgets=function(a){var c=a.data;c.first!=c.last&&this.foldWidgets.length>c.first&&this.foldWidgets.splice(c.first,this.foldWidgets.length)}}n.Folding=r}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,n,h){var i=t("../token_iterator").TokenIterator,s=t("../range").Range;function d(){this.findMatchingBracket=function(o,l){if(o.column==0)return null;var r=l||this.getLine(o.row).charAt(o.column-1);if(r=="")return null;var a=r.match(/([\(\[\{])|([\)\]\}])/);return a?a[1]?this.$findClosingBracket(a[1],o):this.$findOpeningBracket(a[2],o):null},this.getBracketRange=function(o){var l=this.getLine(o.row),r=!0,a,c=l.charAt(o.column-1),p=c&&c.match(/([\(\[\{])|([\)\]\}])/);if(p||(c=l.charAt(o.column),o={row:o.row,column:o.column+1},p=c&&c.match(/([\(\[\{])|([\)\]\}])/),r=!1),!p)return null;if(p[1]){var u=this.$findClosingBracket(p[1],o);if(!u)return null;a=s.fromPoints(o,u),r||(a.end.column++,a.start.column--),a.cursor=a.end}else{var u=this.$findOpeningBracket(p[2],o);if(!u)return null;a=s.fromPoints(u,o),r||(a.start.column++,a.end.column--),a.cursor=a.start}return a},this.getMatchingBracketRanges=function(o,l){var r=this.getLine(o.row),a=/([\(\[\{])|([\)\]\}])/,c=!l&&r.charAt(o.column-1),p=c&&c.match(a);if(p||(c=(l===void 0||l)&&r.charAt(o.column),o={row:o.row,column:o.column+1},p=c&&c.match(a)),!p)return null;var u=new s(o.row,o.column-1,o.row,o.column),f=p[1]?this.$findClosingBracket(p[1],o):this.$findOpeningBracket(p[2],o);if(!f)return[u];var g=new s(f.row,f.column,f.row,f.column+1);return[u,g]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(o,l,r){var a=this.$brackets[o],c=1,p=new i(this,l.row,l.column),u=p.getCurrentToken();if(u||(u=p.stepForward()),!!u){r||(r=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var f=l.column-p.getCurrentTokenColumn()-2,g=u.value;;){for(;f>=0;){var v=g.charAt(f);if(v==a){if(c-=1,c==0)return{row:p.getCurrentTokenRow(),column:f+p.getCurrentTokenColumn()}}else v==o&&(c+=1);f-=1}do u=p.stepBackward();while(u&&!r.test(u.type));if(u==null)break;g=u.value,f=g.length-1}return null}},this.$findClosingBracket=function(o,l,r){var a=this.$brackets[o],c=1,p=new i(this,l.row,l.column),u=p.getCurrentToken();if(u||(u=p.stepForward()),!!u){r||(r=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var f=l.column-p.getCurrentTokenColumn();;){for(var g=u.value,v=g.length;f<v;){var b=g.charAt(f);if(b==a){if(c-=1,c==0)return{row:p.getCurrentTokenRow(),column:f+p.getCurrentTokenColumn()}}else b==o&&(c+=1);f+=1}do u=p.stepForward();while(u&&!r.test(u.type));if(u==null)break;f=0}return null}},this.getMatchingTags=function(o){var l=new i(this,o.row,o.column),r=this.$findTagName(l);if(r){var a=l.stepBackward();return a.value==="<"?this.$findClosingTag(l,r):this.$findOpeningTag(l,r)}},this.$findTagName=function(o){var l=o.getCurrentToken(),r=!1,a=!1;if(l&&l.type.indexOf("tag-name")===-1)do a?l=o.stepBackward():l=o.stepForward(),l&&(l.value==="/>"?a=!0:l.type.indexOf("tag-name")!==-1&&(r=!0));while(l&&!r);return l},this.$findClosingTag=function(o,l){var r,a=l.value,c=l.value,p=0,u=new s(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);l=o.stepForward();var f=new s(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+l.value.length),g=!1;do{if(r=l,r.type.indexOf("tag-close")!==-1&&!g){var v=new s(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);g=!0}if(l=o.stepForward(),l){if(l.value===">"&&!g){var v=new s(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);g=!0}if(l.type.indexOf("tag-name")!==-1){if(a=l.value,c===a){if(r.value==="<")p++;else if(r.value==="</"&&(p--,p<0)){o.stepBackward();var b=new s(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+2);l=o.stepForward();var D=new s(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+l.value.length);if(l.type.indexOf("tag-close")===-1&&(l=o.stepForward()),l&&l.value===">")var E=new s(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);else return}}}else if(c===a&&l.value==="/>"&&(p--,p<0))var b=new s(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+2),D=b,E=D,v=new s(f.end.row,f.end.column,f.end.row,f.end.column+1)}}while(l&&p>=0);if(u&&v&&b&&E&&f&&D)return{openTag:new s(u.start.row,u.start.column,v.end.row,v.end.column),closeTag:new s(b.start.row,b.start.column,E.end.row,E.end.column),openTagName:f,closeTagName:D}},this.$findOpeningTag=function(o,l){var r=o.getCurrentToken(),a=l.value,c=0,p=o.getCurrentTokenRow(),u=o.getCurrentTokenColumn(),f=u+2,g=new s(p,u,p,f);o.stepForward();var v=new s(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+l.value.length);if(l.type.indexOf("tag-close")===-1&&(l=o.stepForward()),!(!l||l.value!==">")){var b=new s(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);o.stepBackward(),o.stepBackward();do if(l=r,p=o.getCurrentTokenRow(),u=o.getCurrentTokenColumn(),f=u+l.value.length,r=o.stepBackward(),l){if(l.type.indexOf("tag-name")!==-1){if(a===l.value)if(r.value==="<"){if(c++,c>0){var D=new s(p,u,p,f),E=new s(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);do l=o.stepForward();while(l&&l.value!==">");var w=new s(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1)}}else r.value==="</"&&c--}else if(l.value==="/>"){for(var y=0,A=r;A;){if(A.type.indexOf("tag-name")!==-1&&A.value===a){c--;break}else if(A.value==="<")break;A=o.stepBackward(),y++}for(var T=0;T<y;T++)o.stepForward()}}while(r&&c<=0);if(E&&w&&g&&b&&D&&v)return{openTag:new s(E.start.row,E.start.column,w.end.row,w.end.column),closeTag:new s(g.start.row,g.start.column,b.end.row,b.end.column),openTagName:D,closeTagName:v}}}}n.BracketMatch=d}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/line_widgets","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(t,n,h){var i=t("./lib/oop"),s=t("./lib/lang"),d=t("./bidihandler").BidiHandler,o=t("./config"),l=t("./lib/event_emitter").EventEmitter,r=t("./selection").Selection,a=t("./mode/text").Mode,c=t("./range").Range,p=t("./line_widgets").LineWidgets,u=t("./document").Document,f=t("./background_tokenizer").BackgroundTokenizer,g=t("./search_highlight").SearchHighlight,v=t("./undomanager").UndoManager,b=(function(){function _(k,S){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$editor=null,this.prevOp={},this.$foldData=[],this.id="session"+ ++_.$uid,this.$foldData.toString=function(){return this.join(`
205
- `)},this.$gutterCustomWidgets={},this.bgTokenizer=new f(new a().getTokenizer(),this);var C=this;this.bgTokenizer.on("update",function(L){C._signal("tokenizerUpdate",L)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof k!="object"||!k.getLine)&&(k=new u(k)),this.setDocument(k),this.selection=new r(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new d(this),o.resetOptions(this),this.setMode(S),o._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return _.prototype.$initOperationListeners=function(){var k=this;this.curOp=null,this.on("change",function(){k.curOp||(k.startOperation(),k.curOp.selectionBefore=k.$lastSel),k.curOp.docChanged=!0},!0),this.on("changeSelection",function(){k.curOp||(k.startOperation(),k.curOp.selectionBefore=k.$lastSel),k.curOp.selectionChanged=!0},!0),this.$operationResetTimer=s.delayedCall(this.endOperation.bind(this,!0))},_.prototype.startOperation=function(k){if(this.curOp){if(!k||this.curOp.command)return;this.prevOp=this.curOp}k||(k={}),this.$operationResetTimer.schedule(),this.curOp={command:k.command||{},args:k.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",k)},_.prototype.endOperation=function(k){if(this.curOp){if(k&&k.returnValue===!1){this.curOp=null,this._signal("endOperation",k);return}if(k==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var S=this.selection.toJSON();this.curOp.selectionAfter=S,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(S),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",k)}},_.prototype.setDocument=function(k){this.doc&&this.doc.off("change",this.$onChange),this.doc=k,k.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},_.prototype.getDocument=function(){return this.doc},Object.defineProperty(_.prototype,"widgetManager",{get:function(){var k=new p(this);return this.widgetManager=k,this.$editor&&k.attach(this.$editor),k},set:function(k){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:k})},enumerable:!1,configurable:!0}),_.prototype.$resetRowCache=function(k){if(!k){this.$docRowCache=[],this.$screenRowCache=[];return}var S=this.$docRowCache.length,C=this.$getRowCacheIndex(this.$docRowCache,k)+1;S>C&&(this.$docRowCache.splice(C,S),this.$screenRowCache.splice(C,S))},_.prototype.$getRowCacheIndex=function(k,S){for(var C=0,L=k.length-1;C<=L;){var I=C+L>>1,F=k[I];if(S>F)C=I+1;else if(S<F)L=I-1;else return I}return C-1},_.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},_.prototype.onChangeFold=function(k){var S=k.data;this.$resetRowCache(S.start.row)},_.prototype.onChange=function(k){this.$modified=!0,this.$bidiHandler.onChange(k),this.$resetRowCache(k.start.row);var S=this.$updateInternalDataOnChange(k);!this.$fromUndo&&this.$undoManager&&(S&&S.length&&(this.$undoManager.add({action:"removeFolds",folds:S},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(k,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(k),this._signal("change",k)},_.prototype.onSelectionChange=function(){this._signal("changeSelection")},_.prototype.setValue=function(k){this.doc.setValue(k),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},_.fromJSON=function(k){typeof k=="string"&&(k=JSON.parse(k));var S=new v;S.$undoStack=k.history.undo,S.$redoStack=k.history.redo,S.mark=k.history.mark,S.$rev=k.history.rev;var C=new _(k.value);return k.folds.forEach(function(L){C.addFold("...",c.fromPoints(L.start,L.end))}),C.setAnnotations(k.annotations),C.setBreakpoints(k.breakpoints),C.setMode(k.mode),C.setScrollLeft(k.scrollLeft),C.setScrollTop(k.scrollTop),C.setUndoManager(S),C.selection.fromJSON(k.selection),C},_.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(k){return k.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},_.prototype.toString=function(){return this.doc.getValue()},_.prototype.getSelection=function(){return this.selection},_.prototype.getState=function(k){return this.bgTokenizer.getState(k)},_.prototype.getTokens=function(k){return this.bgTokenizer.getTokens(k)},_.prototype.getTokenAt=function(k,S){var C=this.bgTokenizer.getTokens(k),L,I=0;if(S==null){var F=C.length-1;I=this.getLine(k).length}else for(var F=0;F<C.length&&(I+=C[F].value.length,!(I>=S));F++);return L=C[F],L?(L.index=F,L.start=I-L.value.length,L):null},_.prototype.setUndoManager=function(k){if(this.$undoManager=k,this.$informUndoManager&&this.$informUndoManager.cancel(),k){var S=this;k.addSession(this),this.$syncInformUndoManager=function(){S.$informUndoManager.cancel(),S.mergeUndoDeltas=!1},this.$informUndoManager=s.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},_.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},_.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},_.prototype.getTabString=function(){return this.getUseSoftTabs()?s.stringRepeat(" ",this.getTabSize()):" "},_.prototype.setUseSoftTabs=function(k){this.setOption("useSoftTabs",k)},_.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},_.prototype.setTabSize=function(k){this.setOption("tabSize",k)},_.prototype.getTabSize=function(){return this.$tabSize},_.prototype.isTabStop=function(k){return this.$useSoftTabs&&k.column%this.$tabSize===0},_.prototype.setNavigateWithinSoftTabs=function(k){this.setOption("navigateWithinSoftTabs",k)},_.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},_.prototype.setOverwrite=function(k){this.setOption("overwrite",k)},_.prototype.getOverwrite=function(){return this.$overwrite},_.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},_.prototype.addGutterDecoration=function(k,S){this.$decorations[k]||(this.$decorations[k]=""),this.$decorations[k]+=" "+S,this._signal("changeBreakpoint",{})},_.prototype.removeGutterCustomWidget=function(k){this.$editor&&this.$editor.renderer.$gutterLayer.$removeCustomWidget(k)},_.prototype.addGutterCustomWidget=function(k,S){this.$editor&&this.$editor.renderer.$gutterLayer.$addCustomWidget(k,S)},_.prototype.removeGutterDecoration=function(k,S){this.$decorations[k]=(this.$decorations[k]||"").replace(" "+S,""),this._signal("changeBreakpoint",{})},_.prototype.getBreakpoints=function(){return this.$breakpoints},_.prototype.setBreakpoints=function(k){this.$breakpoints=[];for(var S=0;S<k.length;S++)this.$breakpoints[k[S]]="ace_breakpoint";this._signal("changeBreakpoint",{})},_.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},_.prototype.setBreakpoint=function(k,S){S===void 0&&(S="ace_breakpoint"),S?this.$breakpoints[k]=S:delete this.$breakpoints[k],this._signal("changeBreakpoint",{})},_.prototype.clearBreakpoint=function(k){delete this.$breakpoints[k],this._signal("changeBreakpoint",{})},_.prototype.addMarker=function(k,S,C,L){var I=this.$markerId++,F={range:k,type:C||"line",renderer:typeof C=="function"?C:null,clazz:S,inFront:!!L,id:I};return L?(this.$frontMarkers[I]=F,this._signal("changeFrontMarker")):(this.$backMarkers[I]=F,this._signal("changeBackMarker")),I},_.prototype.addDynamicMarker=function(k,S){if(k.update){var C=this.$markerId++;return k.id=C,k.inFront=!!S,S?(this.$frontMarkers[C]=k,this._signal("changeFrontMarker")):(this.$backMarkers[C]=k,this._signal("changeBackMarker")),k}},_.prototype.removeMarker=function(k){var S=this.$frontMarkers[k]||this.$backMarkers[k];if(S){var C=S.inFront?this.$frontMarkers:this.$backMarkers;delete C[k],this._signal(S.inFront?"changeFrontMarker":"changeBackMarker")}},_.prototype.getMarkers=function(k){return k?this.$frontMarkers:this.$backMarkers},_.prototype.highlight=function(k){if(!this.$searchHighlight){var S=new g(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(S)}this.$searchHighlight.setRegexp(k)},_.prototype.highlightLines=function(k,S,C,L){typeof S!="number"&&(C=S,S=k),C||(C="ace_step");var I=new c(k,0,S,1/0);return I.id=this.addMarker(I,C,"fullLine",L),I},_.prototype.setAnnotations=function(k){this.$annotations=k,this._signal("changeAnnotation",{})},_.prototype.getAnnotations=function(){return this.$annotations||[]},_.prototype.clearAnnotations=function(){this.setAnnotations([])},_.prototype.$detectNewLine=function(k){var S=k.match(/^.*?(\r?\n)/m);S?this.$autoNewLine=S[1]:this.$autoNewLine=`
206
- `},_.prototype.getWordRange=function(k,S){var C=this.getLine(k),L=!1;if(S>0&&(L=!!C.charAt(S-1).match(this.tokenRe)),L||(L=!!C.charAt(S).match(this.tokenRe)),L)var I=this.tokenRe;else if(/^\s+$/.test(C.slice(S-1,S+1)))var I=/\s/;else var I=this.nonTokenRe;var F=S;if(F>0){do F--;while(F>=0&&C.charAt(F).match(I));F++}for(var R=S;R<C.length&&C.charAt(R).match(I);)R++;return new c(k,F,k,R)},_.prototype.getAWordRange=function(k,S){for(var C=this.getWordRange(k,S),L=this.getLine(C.end.row);L.charAt(C.end.column).match(/[ \t]/);)C.end.column+=1;return C},_.prototype.setNewLineMode=function(k){this.doc.setNewLineMode(k)},_.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},_.prototype.setUseWorker=function(k){this.setOption("useWorker",k)},_.prototype.getUseWorker=function(){return this.$useWorker},_.prototype.onReloadTokenizer=function(k){var S=k.data;this.bgTokenizer.start(S.first),this._signal("tokenizerUpdate",k)},_.prototype.setMode=function(k,S){if(k&&typeof k=="object"){if(k.getTokenizer)return this.$onChangeMode(k);var C=k,L=C.path}else L=k||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new a),this.$modes[L]&&!C){this.$onChangeMode(this.$modes[L]),S&&S();return}this.$modeId=L,o.loadModule(["mode",L],function(I){if(!this.destroyed){if(this.$modeId!==L)return S&&S();this.$modes[L]&&!C?this.$onChangeMode(this.$modes[L]):I&&I.Mode&&(I=new I.Mode(C),C||(this.$modes[L]=I,I.$id=L),this.$onChangeMode(I)),S&&S()}}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},_.prototype.$onChangeMode=function(k,S){if(S||(this.$modeId=k.$id),this.$mode!==k){var C=this.$mode;this.$mode=k,this.$stopWorker(),this.$useWorker&&this.$startWorker();var L=k.getTokenizer();if(L.on!==void 0){var I=this.onReloadTokenizer.bind(this);L.on("update",I)}this.bgTokenizer.setTokenizer(L),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=k.tokenRe,this.nonTokenRe=k.nonTokenRe,S||(k.attachToSession&&k.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(k.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:C,mode:k}))}},_.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},_.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(k){o.warn("Could not load worker",k),this.$worker=null}},_.prototype.getMode=function(){return this.$mode},_.prototype.setScrollTop=function(k){this.$scrollTop===k||isNaN(k)||(this.$scrollTop=k,this._signal("changeScrollTop",k))},_.prototype.getScrollTop=function(){return this.$scrollTop},_.prototype.setScrollLeft=function(k){this.$scrollLeft===k||isNaN(k)||(this.$scrollLeft=k,this._signal("changeScrollLeft",k))},_.prototype.getScrollLeft=function(){return this.$scrollLeft},_.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},_.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var k=0;return this.lineWidgets.forEach(function(S){S&&S.screenWidth>k&&(k=S.screenWidth)}),this.lineWidgetWidth=k},_.prototype.$computeWidth=function(k){if(this.$modified||k){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var S=this.doc.getAllLines(),C=this.$rowLengthCache,L=0,I=0,F=this.$foldData[I],R=F?F.start.row:1/0,B=S.length,N=0;N<B;N++){if(N>R){if(N=F.end.row+1,N>=B)break;F=this.$foldData[I++],R=F?F.start.row:1/0}C[N]==null&&(C[N]=this.$getStringScreenWidth(S[N])[0]),C[N]>L&&(L=C[N])}this.screenWidth=L}},_.prototype.getLine=function(k){return this.doc.getLine(k)},_.prototype.getLines=function(k,S){return this.doc.getLines(k,S)},_.prototype.getLength=function(){return this.doc.getLength()},_.prototype.getTextRange=function(k){return this.doc.getTextRange(k||this.selection.getRange())},_.prototype.insert=function(k,S){return this.doc.insert(k,S)},_.prototype.remove=function(k){return this.doc.remove(k)},_.prototype.removeFullLines=function(k,S){return this.doc.removeFullLines(k,S)},_.prototype.undoChanges=function(k,S){if(k.length){this.$fromUndo=!0;for(var C=k.length-1;C!=-1;C--){var L=k[C];L.action=="insert"||L.action=="remove"?this.doc.revertDelta(L):L.folds&&this.addFolds(L.folds)}!S&&this.$undoSelect&&(k.selectionBefore?this.selection.fromJSON(k.selectionBefore):this.selection.setRange(this.$getUndoSelection(k,!0))),this.$fromUndo=!1}},_.prototype.redoChanges=function(k,S){if(k.length){this.$fromUndo=!0;for(var C=0;C<k.length;C++){var L=k[C];(L.action=="insert"||L.action=="remove")&&this.doc.$safeApplyDelta(L)}!S&&this.$undoSelect&&(k.selectionAfter?this.selection.fromJSON(k.selectionAfter):this.selection.setRange(this.$getUndoSelection(k,!1))),this.$fromUndo=!1}},_.prototype.setUndoSelect=function(k){this.$undoSelect=k},_.prototype.$getUndoSelection=function(k,S){function C(B){return S?B.action!=="insert":B.action==="insert"}for(var L,I,F=0;F<k.length;F++){var R=k[F];if(R.start){if(!L){C(R)?L=c.fromPoints(R.start,R.end):L=c.fromPoints(R.start,R.start);continue}C(R)?(I=R.start,L.compare(I.row,I.column)==-1&&L.setStart(I),I=R.end,L.compare(I.row,I.column)==1&&L.setEnd(I)):(I=R.start,L.compare(I.row,I.column)==-1&&(L=c.fromPoints(R.start,R.start)))}}return L},_.prototype.replace=function(k,S){return this.doc.replace(k,S)},_.prototype.moveText=function(k,S,C){var L=this.getTextRange(k),I=this.getFoldsInRange(k),F=c.fromPoints(S,S);if(!C){this.remove(k);var R=k.start.row-k.end.row,B=R?-k.end.column:k.start.column-k.end.column;B&&(F.start.row==k.end.row&&F.start.column>k.end.column&&(F.start.column+=B),F.end.row==k.end.row&&F.end.column>k.end.column&&(F.end.column+=B)),R&&F.start.row>=k.end.row&&(F.start.row+=R,F.end.row+=R)}if(F.end=this.insert(F.start,L),I.length){var N=k.start,z=F.start,R=z.row-N.row,B=z.column-N.column;this.addFolds(I.map(function(U){return U=U.clone(),U.start.row==N.row&&(U.start.column+=B),U.end.row==N.row&&(U.end.column+=B),U.start.row+=R,U.end.row+=R,U}))}return F},_.prototype.indentRows=function(k,S,C){C=C.replace(/\t/g,this.getTabString());for(var L=k;L<=S;L++)this.doc.insertInLine({row:L,column:0},C)},_.prototype.outdentRows=function(k){for(var S=k.collapseRows(),C=new c(0,0,0,0),L=this.getTabSize(),I=S.start.row;I<=S.end.row;++I){var F=this.getLine(I);C.start.row=I,C.end.row=I;for(var R=0;R<L&&F.charAt(R)==" ";++R);R<L&&F.charAt(R)==" "?(C.start.column=R,C.end.column=R+1):(C.start.column=0,C.end.column=R),this.remove(C)}},_.prototype.$moveLines=function(k,S,C){if(k=this.getRowFoldStart(k),S=this.getRowFoldEnd(S),C<0){var L=this.getRowFoldStart(k+C);if(L<0)return 0;var I=L-k}else if(C>0){var L=this.getRowFoldEnd(S+C);if(L>this.doc.getLength()-1)return 0;var I=L-S}else{k=this.$clipRowToDocument(k),S=this.$clipRowToDocument(S);var I=S-k+1}var F=new c(k,0,S,Number.MAX_VALUE),R=this.getFoldsInRange(F).map(function(N){return N=N.clone(),N.start.row+=I,N.end.row+=I,N}),B=C==0?this.doc.getLines(k,S):this.doc.removeFullLines(k,S);return this.doc.insertFullLines(k+I,B),R.length&&this.addFolds(R),I},_.prototype.moveLinesUp=function(k,S){return this.$moveLines(k,S,-1)},_.prototype.moveLinesDown=function(k,S){return this.$moveLines(k,S,1)},_.prototype.duplicateLines=function(k,S){return this.$moveLines(k,S,0)},_.prototype.$clipRowToDocument=function(k){return Math.max(0,Math.min(k,this.doc.getLength()-1))},_.prototype.$clipColumnToRow=function(k,S){return S<0?0:Math.min(this.doc.getLine(k).length,S)},_.prototype.$clipPositionToDocument=function(k,S){if(S=Math.max(0,S),k<0)k=0,S=0;else{var C=this.doc.getLength();k>=C?(k=C-1,S=this.doc.getLine(C-1).length):S=Math.min(this.doc.getLine(k).length,S)}return{row:k,column:S}},_.prototype.$clipRangeToDocument=function(k){k.start.row<0?(k.start.row=0,k.start.column=0):k.start.column=this.$clipColumnToRow(k.start.row,k.start.column);var S=this.doc.getLength()-1;return k.end.row>S?(k.end.row=S,k.end.column=this.doc.getLine(S).length):k.end.column=this.$clipColumnToRow(k.end.row,k.end.column),k},_.prototype.setUseWrapMode=function(k){if(k!=this.$useWrapMode){if(this.$useWrapMode=k,this.$modified=!0,this.$resetRowCache(0),k){var S=this.getLength();this.$wrapData=Array(S),this.$updateWrapData(0,S-1)}this._signal("changeWrapMode")}},_.prototype.getUseWrapMode=function(){return this.$useWrapMode},_.prototype.setWrapLimitRange=function(k,S){(this.$wrapLimitRange.min!==k||this.$wrapLimitRange.max!==S)&&(this.$wrapLimitRange={min:k,max:S},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},_.prototype.adjustWrapLimit=function(k,S){var C=this.$wrapLimitRange;C.max<0&&(C={min:S,max:S});var L=this.$constrainWrapLimit(k,C.min,C.max);return L!=this.$wrapLimit&&L>1?(this.$wrapLimit=L,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},_.prototype.$constrainWrapLimit=function(k,S,C){return S&&(k=Math.max(S,k)),C&&(k=Math.min(C,k)),k},_.prototype.getWrapLimit=function(){return this.$wrapLimit},_.prototype.setWrapLimit=function(k){this.setWrapLimitRange(k,k)},_.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},_.prototype.$updateInternalDataOnChange=function(k){var S=this.$useWrapMode,C=k.action,L=k.start,I=k.end,F=L.row,R=I.row,B=R-F,N=null;if(this.$updating=!0,B!=0)if(C==="remove"){this[S?"$wrapData":"$rowLengthCache"].splice(F,B);var z=this.$foldData;N=this.getFoldsInRange(k),this.removeFolds(N);var W=this.getFoldLine(I.row),j=0;if(W){W.addRemoveChars(I.row,I.column,L.column-I.column),W.shiftRow(-B);var U=this.getFoldLine(F);U&&U!==W&&(U.merge(W),W=U),j=z.indexOf(W)+1}for(j;j<z.length;j++){var W=z[j];W.start.row>=I.row&&W.shiftRow(-B)}R=F}else{var K=Array(B);K.unshift(F,0);var J=S?this.$wrapData:this.$rowLengthCache;J.splice.apply(J,K);var z=this.$foldData,W=this.getFoldLine(F),j=0;if(W){var Y=W.range.compareInside(L.row,L.column);Y==0?(W=W.split(L.row,L.column),W&&(W.shiftRow(B),W.addRemoveChars(R,0,I.column-L.column))):Y==-1&&(W.addRemoveChars(F,0,I.column-L.column),W.shiftRow(B)),j=z.indexOf(W)+1}for(j;j<z.length;j++){var W=z[j];W.start.row>=F&&W.shiftRow(B)}}else{B=Math.abs(k.start.column-k.end.column),C==="remove"&&(N=this.getFoldsInRange(k),this.removeFolds(N),B=-B);var W=this.getFoldLine(F);W&&W.addRemoveChars(F,L.column,B)}return S&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,S?this.$updateWrapData(F,R):this.$updateRowLengthCache(F,R),N},_.prototype.$updateRowLengthCache=function(k,S){this.$rowLengthCache[k]=null,this.$rowLengthCache[S]=null},_.prototype.$updateWrapData=function(k,S){var C=this.doc.getAllLines(),L=this.getTabSize(),I=this.$wrapData,F=this.$wrapLimit,R,B,N=k;for(S=Math.min(S,C.length-1);N<=S;)B=this.getFoldLine(N,B),B?(R=[],B.walk(function(z,W,j,U){var K;if(z!=null){K=this.$getDisplayTokens(z,R.length),K[0]=w;for(var J=1;J<K.length;J++)K[J]=y}else K=this.$getDisplayTokens(C[W].substring(U,j),R.length);R=R.concat(K)}.bind(this),B.end.row,C[B.end.row].length+1),I[B.start.row]=this.$computeWrapSplits(R,F,L),N=B.end.row+1):(R=this.$getDisplayTokens(C[N]),I[N]=this.$computeWrapSplits(R,F,L),N++)},_.prototype.$computeWrapSplits=function(k,S,C){if(k.length==0)return[];var L=[],I=k.length,F=0,R=0,B=this.$wrapAsCode,N=this.$indentedSoftWrap,z=S<=Math.max(2*C,8)||N===!1?0:Math.floor(S/2);function W(){var Y=0;if(z===0)return Y;if(N)for(var X=0;X<k.length;X++){var q=k[X];if(q==T)Y+=1;else if(q==x)Y+=C;else{if(q==M)continue;break}}return B&&N!==!1&&(Y+=C),Math.min(Y,z)}function j(Y){for(var X=Y-F,q=F;q<Y;q++){var ne=k[q];(ne===12||ne===2)&&(X-=1)}L.length||(U=W(),L.indent=U),R+=X,L.push(R),F=Y}for(var U=0;I-F>S-U;){var K=F+S-U;if(k[K-1]>=T&&k[K]>=T){j(K);continue}if(k[K]==w||k[K]==y){for(K;K!=F-1&&k[K]!=w;K--);if(K>F){j(K);continue}for(K=F+S,K;K<k.length&&k[K]==y;K++);if(K==k.length)break;j(K);continue}for(var J=Math.max(K-(S-(S>>2)),F-1);K>J&&k[K]<w;)K--;if(B){for(;K>J&&k[K]<w;)K--;for(;K>J&&k[K]==A;)K--}else for(;K>J&&k[K]<T;)K--;if(K>J){j(++K);continue}K=F+S,k[K]==E&&K--,j(K-U)}return L},_.prototype.$getDisplayTokens=function(k,S){var C=[],L;S=S||0;for(var I=0;I<k.length;I++){var F=k.charCodeAt(I);if(F==9){L=this.getScreenTabSize(C.length+S),C.push(x);for(var R=1;R<L;R++)C.push(M)}else F==32?C.push(T):F>39&&F<48||F>57&&F<64?C.push(A):F>=4352&&O(F)?C.push(D,E):C.push(D)}return C},_.prototype.$getStringScreenWidth=function(k,S,C){if(S==0)return[0,0];S==null&&(S=1/0),C=C||0;var L,I;for(I=0;I<k.length&&(L=k.charCodeAt(I),L==9?C+=this.getScreenTabSize(C):L>=4352&&O(L)?C+=2:C+=1,!(C>S));I++);return[C,I]},_.prototype.getRowLength=function(k){var S=1;return this.lineWidgets&&(S+=this.lineWidgets[k]&&this.lineWidgets[k].rowCount||0),!this.$useWrapMode||!this.$wrapData[k]?S:this.$wrapData[k].length+S},_.prototype.getRowLineCount=function(k){return!this.$useWrapMode||!this.$wrapData[k]?1:this.$wrapData[k].length+1},_.prototype.getRowWrapIndent=function(k){if(this.$useWrapMode){var S=this.screenToDocumentPosition(k,Number.MAX_VALUE),C=this.$wrapData[S.row];return C.length&&C[0]<S.column?C.indent:0}else return 0},_.prototype.getScreenLastRowColumn=function(k){var S=this.screenToDocumentPosition(k,Number.MAX_VALUE);return this.documentToScreenColumn(S.row,S.column)},_.prototype.getDocumentLastRowColumn=function(k,S){var C=this.documentToScreenRow(k,S);return this.getScreenLastRowColumn(C)},_.prototype.getDocumentLastRowColumnPosition=function(k,S){var C=this.documentToScreenRow(k,S);return this.screenToDocumentPosition(C,Number.MAX_VALUE/10)},_.prototype.getRowSplitData=function(k){if(this.$useWrapMode)return this.$wrapData[k]},_.prototype.getScreenTabSize=function(k){return this.$tabSize-(k%this.$tabSize|0)},_.prototype.screenToDocumentRow=function(k,S){return this.screenToDocumentPosition(k,S).row},_.prototype.screenToDocumentColumn=function(k,S){return this.screenToDocumentPosition(k,S).column},_.prototype.screenToDocumentPosition=function(k,S,C){if(k<0)return{row:0,column:0};var L,I=0,F=0,R,B=0,N=0,z=this.$screenRowCache,W=this.$getRowCacheIndex(z,k),j=z.length;if(j&&W>=0)var B=z[W],I=this.$docRowCache[W],U=k>z[j-1];else var U=!j;for(var K=this.getLength()-1,J=this.getNextFoldLine(I),Y=J?J.start.row:1/0;B<=k&&(N=this.getRowLength(I),!(B+N>k||I>=K));)B+=N,I++,I>Y&&(I=J.end.row+1,J=this.getNextFoldLine(I,J),Y=J?J.start.row:1/0),U&&(this.$docRowCache.push(I),this.$screenRowCache.push(B));if(J&&J.start.row<=I)L=this.getFoldDisplayLine(J),I=J.start.row;else{if(B+N<=k||I>K)return{row:K,column:this.getLine(K).length};L=this.getLine(I),J=null}var X=0,q=Math.floor(k-B);if(this.$useWrapMode){var ne=this.$wrapData[I];ne&&(R=ne[q],q>0&&ne.length&&(X=ne.indent,F=ne[q-1]||ne[ne.length-1],L=L.substring(F)))}return C!==void 0&&this.$bidiHandler.isBidiRow(B+q,I,q)&&(S=this.$bidiHandler.offsetToCol(C)),F+=this.$getStringScreenWidth(L,S-X)[1],this.$useWrapMode&&F>=R&&(F=R-1),J?J.idxToPosition(F):{row:I,column:F}},_.prototype.documentToScreenPosition=function(k,S){if(typeof S>"u")var C=this.$clipPositionToDocument(k.row,k.column);else C=this.$clipPositionToDocument(k,S);k=C.row,S=C.column;var L=0,I=null,F=null;F=this.getFoldAt(k,S,1),F&&(k=F.start.row,S=F.start.column);var R,B=0,N=this.$docRowCache,z=this.$getRowCacheIndex(N,k),W=N.length;if(W&&z>=0)var B=N[z],L=this.$screenRowCache[z],j=k>N[W-1];else var j=!W;for(var U=this.getNextFoldLine(B),K=U?U.start.row:1/0;B<k;){if(B>=K){if(R=U.end.row+1,R>k)break;U=this.getNextFoldLine(R,U),K=U?U.start.row:1/0}else R=B+1;L+=this.getRowLength(B),B=R,j&&(this.$docRowCache.push(B),this.$screenRowCache.push(L))}var J="";U&&B>=K?(J=this.getFoldDisplayLine(U,k,S),I=U.start.row):(J=this.getLine(k).substring(0,S),I=k);var Y=0;if(this.$useWrapMode){var X=this.$wrapData[I];if(X){for(var q=0;J.length>=X[q];)L++,q++;J=J.substring(X[q-1]||0,J.length),Y=q>0?X.indent:0}}return this.lineWidgets&&this.lineWidgets[B]&&this.lineWidgets[B].rowsAbove&&(L+=this.lineWidgets[B].rowsAbove),{row:L,column:Y+this.$getStringScreenWidth(J)[0]}},_.prototype.documentToScreenColumn=function(k,S){return this.documentToScreenPosition(k,S).column},_.prototype.documentToScreenRow=function(k,S){return this.documentToScreenPosition(k,S).row},_.prototype.getScreenLength=function(){var k=0,S=null;if(this.$useWrapMode)for(var I=this.$wrapData.length,F=0,L=0,S=this.$foldData[L++],R=S?S.start.row:1/0;F<I;){var B=this.$wrapData[F];k+=B?B.length+1:1,F++,F>R&&(F=S.end.row+1,S=this.$foldData[L++],R=S?S.start.row:1/0)}else{k=this.getLength();for(var C=this.$foldData,L=0;L<C.length;L++)S=C[L],k-=S.end.row-S.start.row}return this.lineWidgets&&(k+=this.$getWidgetScreenLength()),k},_.prototype.$setFontMetrics=function(k){this.$enableVarChar&&(this.$getStringScreenWidth=function(S,C,L){if(C===0)return[0,0];C||(C=1/0),L=L||0;var I,F;for(F=0;F<S.length&&(I=S.charAt(F),I===" "?L+=this.getScreenTabSize(L):L+=k.getCharacterWidth(I),!(L>C));F++);return[L,F]})},_.prototype.getPrecedingCharacter=function(){var k=this.selection.getCursor();if(k.column===0)return k.row===0?"":this.doc.getNewLineCharacter();var S=this.getLine(k.row);return S[k.column-1]},_.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.endOperation(),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection&&(this.selection.off("changeCursor",this.$onSelectionChange),this.selection.off("changeSelection",this.$onSelectionChange)),this.selection.detach()},_})();b.$uid=0,b.prototype.$modes=o.$modes,b.prototype.getValue=b.prototype.toString,b.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},b.prototype.$overwrite=!1,b.prototype.$mode=null,b.prototype.$modeId=null,b.prototype.$scrollTop=0,b.prototype.$scrollLeft=0,b.prototype.$wrapLimit=80,b.prototype.$useWrapMode=!1,b.prototype.$wrapLimitRange={min:null,max:null},b.prototype.lineWidgets=null,b.prototype.isFullWidth=O,i.implement(b.prototype,l);var D=1,E=2,w=3,y=4,A=9,T=10,x=11,M=12;function O(_){return _<4352?!1:_>=4352&&_<=4447||_>=4515&&_<=4519||_>=4602&&_<=4607||_>=9001&&_<=9002||_>=11904&&_<=11929||_>=11931&&_<=12019||_>=12032&&_<=12245||_>=12272&&_<=12283||_>=12288&&_<=12350||_>=12353&&_<=12438||_>=12441&&_<=12543||_>=12549&&_<=12589||_>=12593&&_<=12686||_>=12688&&_<=12730||_>=12736&&_<=12771||_>=12784&&_<=12830||_>=12832&&_<=12871||_>=12880&&_<=13054||_>=13056&&_<=19903||_>=19968&&_<=42124||_>=42128&&_<=42182||_>=43360&&_<=43388||_>=44032&&_<=55203||_>=55216&&_<=55238||_>=55243&&_<=55291||_>=63744&&_<=64255||_>=65040&&_<=65049||_>=65072&&_<=65106||_>=65108&&_<=65126||_>=65128&&_<=65131||_>=65281&&_<=65376||_>=65504&&_<=65510}t("./edit_session/folding").Folding.call(b.prototype),t("./edit_session/bracket_match").BracketMatch.call(b.prototype),o.defineOptions(b.prototype,"session",{wrap:{set:function(_){if(!_||_=="off"?_=!1:_=="free"?_=!0:_=="printMargin"?_=-1:typeof _=="string"&&(_=parseInt(_,10)||!1),this.$wrap!=_)if(this.$wrap=_,!_)this.setUseWrapMode(!1);else{var k=typeof _=="number"?_:null;this.setWrapLimitRange(k,k),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(_){_=_=="auto"?this.$mode.type!="text":_!="text",_!=this.$wrapAsCode&&(this.$wrapAsCode=_,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(_){this.$useWorker=_,this.$stopWorker(),_&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(_){_=parseInt(_),_>0&&this.$tabSize!==_&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=_,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(_){this.setFoldStyle(_)},handlesSet:!0},overwrite:{set:function(_){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(_){this.doc.setNewLineMode(_)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(_){this.setMode(_)},get:function(){return this.$modeId},handlesSet:!0}}),n.EditSession=b}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,n,h){var i=t("./lib/lang"),s=t("./lib/oop"),d=t("./range").Range,o=(function(){function c(){this.$options={}}return c.prototype.set=function(p){return s.mixin(this.$options,p),this},c.prototype.getOptions=function(){return i.copyObject(this.$options)},c.prototype.setOptions=function(p){this.$options=p},c.prototype.find=function(p){var u=this.$options,f=this.$matchIterator(p,u);if(!f)return!1;var g=null;return f.forEach(function(v,b,D,E){return g=new d(v,b,D,E),b==E&&u.start&&u.start.start&&u.skipCurrent!=!1&&g.isEqual(u.start)?(g=null,!1):!0}),g},c.prototype.findAll=function(p){var u=this.$options;if(!u.needle)return[];this.$assembleRegExp(u);var f=u.range,g=f?p.getLines(f.start.row,f.end.row):p.doc.getAllLines(),v=[],b=u.re;if(u.$isMultiLine){var D=b.length,E=g.length-D,w;e:for(var y=b.offset||0;y<=E;y++){for(var A=0;A<D;A++)if(g[y+A].search(b[A])==-1)continue e;var T=g[y],x=g[y+D-1],M=T.length-T.match(b[0])[0].length,O=x.match(b[D-1])[0].length;w&&w.end.row===y&&w.end.column>M||(v.push(w=new d(y,M,y+D-1,O)),D>2&&(y=y+D-2))}}else for(var _,k=0;k<g.length;k++)if(this.$isMultilineSearch(u)){var S=g.length-1;if(_=this.$multiLineForward(p,b,k,S),_){var C=_.endRow<=S?_.endRow-1:S;C>k&&(k=C),v.push(new d(_.startRow,_.startCol,_.endRow,_.endCol))}}else{_=i.getMatchOffsets(g[k],b);for(var A=0;A<_.length;A++){var L=_[A];v.push(new d(k,L.offset,k,L.offset+L.length))}}if(f){for(var I=f.start.column,F=f.end.column,k=0,A=v.length-1;k<A&&v[k].start.column<I&&v[k].start.row==0;)k++;for(var R=f.end.row-f.start.row;k<A&&v[A].end.column>F&&v[A].end.row==R;)A--;for(v=v.slice(k,A+1),k=0,A=v.length;k<A;k++)v[k].start.row+=f.start.row,v[k].end.row+=f.start.row}return v},c.prototype.parseReplaceString=function(p){for(var u={DollarSign:36,Ampersand:38,Digit0:48,Digit1:49,Digit9:57,Backslash:92,n:110,t:116},f="",g=0,v=p.length;g<v;g++){var b=p.charCodeAt(g);if(b===u.Backslash){if(g++,g>=v){f+="\\";break}var D=p.charCodeAt(g);switch(D){case u.Backslash:f+="\\";break;case u.n:f+=`
207
- `;break;case u.t:f+=" ";break}continue}if(b===u.DollarSign){if(g++,g>=v){f+="$";break}var E=p.charCodeAt(g);if(E===u.DollarSign){f+="$$";continue}if(E===u.Digit0||E===u.Ampersand){f+="$&";continue}if(u.Digit1<=E&&E<=u.Digit9){f+="$"+p[g];continue}}f+=p[g]}return f||p},c.prototype.replace=function(p,u){var f=this.$options,g=this.$assembleRegExp(f);if(f.$isMultiLine)return u;if(g){var v=this.$isMultilineSearch(f);v&&(p=p.replace(/\r\n|\r|\n/g,`
208
- `));var b=g.exec(p);if(!b||!v&&b[0].length!=p.length)return null;if(u=f.regExp?this.parseReplaceString(u):u.replace(/\$/g,"$$$$"),u=p.replace(g,u),f.preserveCase){u=u.split("");for(var D=Math.min(p.length,p.length);D--;){var E=p[D];E&&E.toLowerCase()!=E?u[D]=u[D].toUpperCase():u[D]=u[D].toLowerCase()}u=u.join("")}return u}},c.prototype.$assembleRegExp=function(p,u){if(p.needle instanceof RegExp)return p.re=p.needle;var f=p.needle;if(!p.needle)return p.re=!1;p.regExp||(f=i.escapeRegExp(f));var g=p.caseSensitive?"gm":"gmi";try{new RegExp(f,"u"),p.$supportsUnicodeFlag=!0,g+="u"}catch{p.$supportsUnicodeFlag=!1}if(p.wholeWord&&(f=l(f,p)),p.$isMultiLine=!u&&/[\n\r]/.test(f),p.$isMultiLine)return p.re=this.$assembleMultilineRegExp(f,g);try{var v=new RegExp(f,g)}catch{v=!1}return p.re=v},c.prototype.$assembleMultilineRegExp=function(p,u){for(var f=p.replace(/\r\n|\r|\n/g,`$
209
- ^`).split(`
210
- `),g=[],v=0;v<f.length;v++)try{g.push(new RegExp(f[v],u))}catch{return!1}return g},c.prototype.$isMultilineSearch=function(p){return p.re&&/\\r\\n|\\r|\\n/.test(p.re.source)&&p.regExp&&!p.$isMultiLine},c.prototype.$multiLineForward=function(p,u,f,g){for(var v,b=a(p,f),D=f;D<=g;){for(var E=0;E<b&&!(D>g);E++){var w=p.getLine(D++);v=v==null?w:v+`
211
- `+w}var y=u.exec(v);if(u.lastIndex=0,y){var A=v.slice(0,y.index).split(`
212
- `),T=y[0].split(`
213
- `),x=f+A.length-1,M=A[A.length-1].length,O=x+T.length-1,_=T.length==1?M+T[0].length:T[T.length-1].length;return{startRow:x,startCol:M,endRow:O,endCol:_}}}return null},c.prototype.$multiLineBackward=function(p,u,f,g,v){for(var b,D=a(p,g),E=p.getLine(g).length-f,w=g;w>=v;){for(var y=0;y<D&&w>=v;y++){var A=p.getLine(w--);b=b==null?A:A+`
214
- `+b}var T=r(b,u,E);if(T){var x=b.slice(0,T.index).split(`
215
- `),M=T[0].split(`
216
- `),O=w+x.length,_=x[x.length-1].length,k=O+M.length-1,S=M.length==1?_+M[0].length:M[M.length-1].length;return{startRow:O,startCol:_,endRow:k,endCol:S}}}return null},c.prototype.$matchIterator=function(p,u){var f=this.$assembleRegExp(u);if(!f)return!1;var g=this.$isMultilineSearch(u),v=this.$multiLineForward,b=this.$multiLineBackward,D=u.backwards==!0,E=u.skipCurrent!=!1,w=f.unicode,y=u.range,A=u.start;A||(A=y?y[D?"end":"start"]:p.selection.getRange()),A.start&&(A=A[E!=D?"end":"start"]);var T=y?y.start.row:0,x=y?y.end.row:p.getLength()-1;if(D)var M=function(k){var S=A.row;if(!_(S,A.column,k)){for(S--;S>=T;S--)if(_(S,Number.MAX_VALUE,k))return;if(u.wrap!=!1){for(S=x,T=A.row;S>=T;S--)if(_(S,Number.MAX_VALUE,k))return}}};else var M=function(S){var C=A.row;if(!_(C,A.column,S)){for(C=C+1;C<=x;C++)if(_(C,0,S))return;if(u.wrap!=!1){for(C=T,x=A.row;C<=x;C++)if(_(C,0,S))return}}};if(u.$isMultiLine)var O=f.length,_=function(k,S,C){var L=D?k-O+1:k;if(!(L<0||L+O>p.getLength())){var I=p.getLine(L),F=I.search(f[0]);if(!(!D&&F<S||F===-1)){for(var R=1;R<O;R++)if(I=p.getLine(L+R),I.search(f[R])==-1)return;var B=I.match(f[O-1])[0].length;if(!(D&&B>S)&&C(L,F,L+O-1,B))return!0}}};else if(D)var _=function(S,C,L){if(g){var I=b(p,f,C,S,T);if(!I)return!1;if(L(I.startRow,I.startCol,I.endRow,I.endCol))return!0}else{var F=p.getLine(S),R=[],B,N=0;for(f.lastIndex=0;B=f.exec(F);){var z=B[0].length;if(N=B.index,!z){if(N>=F.length)break;f.lastIndex=N+=i.skipEmptyMatch(F,N,w)}if(B.index+z>C)break;R.push(B.index,z)}for(var W=R.length-1;W>=0;W-=2){var j=R[W-1],z=R[W];if(L(S,j,S,j+z))return!0}}};else var _=function(S,C,L){if(f.lastIndex=C,g){var I=v(p,f,S,x);if(I){var F=I.endRow<=x?I.endRow-1:x;F>S&&(S=F)}if(!I)return!1;if(L(I.startRow,I.startCol,I.endRow,I.endCol))return!0}else for(var R=p.getLine(S),B,N;N=f.exec(R);){var z=N[0].length;if(B=N.index,L(S,B,S,B+z))return!0;if(!z&&(f.lastIndex=B+=i.skipEmptyMatch(R,B,w),B>=R.length))return!1}};return{forEach:M}},c})();function l(c,p){var u=i.supportsLookbehind();function f(D,E){E===void 0&&(E=!0);var w=u&&p.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return w.test(D)||p.regExp?u&&p.$supportsUnicodeFlag?E?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var g=Array.from(c),v=g[0],b=g[g.length-1];return f(v)+c+f(b,!1)}function r(c,p,u){for(var f=null,g=0;g<=c.length;){p.lastIndex=g;var v=p.exec(c);if(!v)break;var b=v.index+v[0].length;if(b>c.length-u)break;(!f||b>f.index+f[0].length)&&(f=v),g=v.index+1}return f}function a(c,p){var u=5e3,f={row:p,column:0},g=c.doc.positionToIndex(f),v=g+u,b=c.doc.indexToPosition(v),D=b.row;return D+1}n.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,h){var i=this&&this.__extends||(function(){var c=function(p,u){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)Object.prototype.hasOwnProperty.call(g,v)&&(f[v]=g[v])},c(p,u)};return function(p,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");c(p,u);function f(){this.constructor=p}p.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)}})(),s=t("../lib/keys"),d=t("../lib/useragent"),o=s.KEY_MODS,l=(function(){function c(p,u){this.$init(p,u,!1)}return c.prototype.$init=function(p,u,f){this.platform=u||(d.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(p),this.$singleCommand=f},c.prototype.addCommand=function(p){this.commands[p.name]&&this.removeCommand(p),this.commands[p.name]=p,p.bindKey&&this._buildKeyHash(p)},c.prototype.removeCommand=function(p,u){var f=p&&(typeof p=="string"?p:p.name);p=this.commands[f],u||delete this.commands[f];var g=this.commandKeyBinding;for(var v in g){var b=g[v];if(b==p)delete g[v];else if(Array.isArray(b)){var D=b.indexOf(p);D!=-1&&(b.splice(D,1),b.length==1&&(g[v]=b[0]))}}},c.prototype.bindKey=function(p,u,f){if(typeof p=="object"&&p&&(f==null&&(f=p.position),p=p[this.platform]),!!p){if(typeof u=="function")return this.addCommand({exec:u,bindKey:p,name:u.name||p});p.split("|").forEach(function(g){var v="";if(g.indexOf(" ")!=-1){var b=g.split(/\s+/);g=b.pop(),b.forEach(function(w){var y=this.parseKeys(w),A=o[y.hashId]+y.key;v+=(v?" ":"")+A,this._addCommandToBinding(v,"chainKeys")},this),v+=" "}var D=this.parseKeys(g),E=o[D.hashId]+D.key;this._addCommandToBinding(v+E,u,f)},this)}},c.prototype._addCommandToBinding=function(p,u,f){var g=this.commandKeyBinding,v;if(!u)delete g[p];else if(!g[p]||this.$singleCommand)g[p]=u;else{Array.isArray(g[p])?(v=g[p].indexOf(u))!=-1&&g[p].splice(v,1):g[p]=[g[p]],typeof f!="number"&&(f=r(u));var b=g[p];for(v=0;v<b.length;v++){var D=b[v],E=r(D);if(E>f)break}b.splice(v,0,u)}},c.prototype.addCommands=function(p){p&&Object.keys(p).forEach(function(u){var f=p[u];if(f){if(typeof f=="string")return this.bindKey(f,u);typeof f=="function"&&(f={exec:f}),typeof f=="object"&&(f.name||(f.name=u),this.addCommand(f))}},this)},c.prototype.removeCommands=function(p){Object.keys(p).forEach(function(u){this.removeCommand(p[u])},this)},c.prototype.bindKeys=function(p){Object.keys(p).forEach(function(u){this.bindKey(u,p[u])},this)},c.prototype._buildKeyHash=function(p){this.bindKey(p.bindKey,p)},c.prototype.parseKeys=function(p){var u=p.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(E){return E}),f=u.pop(),g=s[f];if(s.FUNCTION_KEYS[g])f=s.FUNCTION_KEYS[g].toLowerCase();else if(u.length){if(u.length==1&&u[0]=="shift")return{key:f.toUpperCase(),hashId:-1}}else return{key:f,hashId:-1};for(var v=0,b=u.length;b--;){var D=s.KEY_MODS[u[b]];if(D==null)return typeof console<"u"&&console.error("invalid modifier "+u[b]+" in "+p),!1;v|=D}return{key:f,hashId:v}},c.prototype.findKeyCommand=function(p,u){var f=o[p]+u;return this.commandKeyBinding[f]},c.prototype.handleKeyboard=function(p,u,f,g){if(!(g<0)){var v=o[u]+f,b=this.commandKeyBinding[v];return p.$keyChain&&(p.$keyChain+=" "+v,b=this.commandKeyBinding[p.$keyChain]||b),b&&(b=="chainKeys"||b[b.length-1]=="chainKeys")?(p.$keyChain=p.$keyChain||v,{command:"null"}):(p.$keyChain&&((!u||u==4)&&f.length==1?p.$keyChain=p.$keyChain.slice(0,-v.length-1):(u==-1||g>0)&&(p.$keyChain="")),{command:b})}},c.prototype.getStatusText=function(p,u){return u.$keyChain||""},c})();function r(c){return typeof c=="object"&&c.bindKey&&c.bindKey.position||(c.isDefault?-100:0)}var a=(function(c){i(p,c);function p(u,f){var g=c.call(this,u,f)||this;return g.$singleCommand=!0,g}return p})(l);a.call=function(c,p,u){l.prototype.$init.call(c,p,u,!0)},l.call=function(c,p,u){l.prototype.$init.call(c,p,u,!1)},n.HashHandler=a,n.MultiHashHandler=l}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,n,h){var i=this&&this.__extends||(function(){var r=function(a,c){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,u){p.__proto__=u}||function(p,u){for(var f in u)Object.prototype.hasOwnProperty.call(u,f)&&(p[f]=u[f])},r(a,c)};return function(a,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");r(a,c);function p(){this.constructor=a}a.prototype=c===null?Object.create(c):(p.prototype=c.prototype,new p)}})(),s=t("../lib/oop"),d=t("../keyboard/hash_handler").MultiHashHandler,o=t("../lib/event_emitter").EventEmitter,l=(function(r){i(a,r);function a(c,p){var u=r.call(this,p,c)||this;return u.byName=u.commands,u.setDefaultHandler("exec",function(f){return f.args?f.command.exec(f.editor,f.args,f.event,!1):f.command.exec(f.editor,{},f.event,!0)}),u}return a.prototype.exec=function(c,p,u){if(Array.isArray(c)){for(var f=c.length;f--;)if(this.exec(c[f],p,u))return!0;return!1}typeof c=="string"&&(c=this.commands[c]);var g={editor:p,command:c,args:u};return this.canExecute(c,p)?(g.returnValue=this._emit("exec",g),this._signal("afterExec",g),g.returnValue!==!1):(this._signal("commandUnavailable",g),!1)},a.prototype.canExecute=function(c,p){return typeof c=="string"&&(c=this.commands[c]),!(!c||p&&p.$readOnly&&!c.readOnly||this.$checkCommandState!=!1&&c.isAvailable&&!c.isAvailable(p))},a.prototype.toggleRecording=function(c){if(!this.$inReplay)return c&&c._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(p){this.macro.push([p.command,p.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},a.prototype.replay=function(c){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(c);try{this.$inReplay=!0,this.macro.forEach(function(p){typeof p=="string"?this.exec(p,c):this.exec(p[0],c,p[1])},this)}finally{this.$inReplay=!1}}},a.prototype.trimMacro=function(c){return c.map(function(p){return typeof p[0]!="string"&&(p[0]=p[0].name),p[1]||(p=p[0]),p})},a})(d);s.implement(l.prototype,o),n.CommandManager=l}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,n,h){var i=t("../lib/lang"),s=t("../config"),d=t("../range").Range;function o(r,a){return{win:r,mac:a}}n.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:o("Ctrl-,","Command-,"),exec:function(r){s.loadModule("ace/ext/settings_menu",function(a){a.init(r),r.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:o("Alt-E","F4"),exec:function(r){s.loadModule("ace/ext/error_marker",function(a){a.showErrorMarker(r,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(r){s.loadModule("ace/ext/error_marker",function(a){a.showErrorMarker(r,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(r){r.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(r){r.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(r,a){typeof a=="number"&&!isNaN(a)&&r.gotoLine(a),r.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(r){r.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(r){r.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:o("F2","F2"),exec:function(r){r.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:o("Alt-F2","Alt-F2"),exec:function(r){r.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(r){r.session.foldAll(),r.session.unfold(r.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(r){r.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(r){r.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(r){r.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(r){s.loadModule("ace/ext/searchbox",function(a){a.Search(r)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(r){r.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(r){r.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(r){r.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(r){r.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(r,a){r.navigateUp(a.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(r){r.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(r){r.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(r){r.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(r,a){r.navigateDown(a.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(r){r.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(r){r.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(r){r.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(r){r.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(r,a){r.navigateLeft(a.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(r){r.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(r){r.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(r){r.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(r){r.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(r,a){r.navigateRight(a.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(r){r.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(r){r.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(r){r.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(r){r.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(r){r.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(r){r.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(r){r.renderer.scrollBy(0,-2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(r){r.renderer.scrollBy(0,2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(r){r.commands.toggleRecording(r)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(r){r.commands.replay(r)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(r){r.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(r){r.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(r){r.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(r){},readOnly:!0},{name:"cut",description:"Cut",exec:function(r){var a=r.$copyWithEmptySelection&&r.selection.isEmpty(),c=a?r.selection.getLineRange():r.selection.getRange();r._emit("cut",c),c.isEmpty()||r.session.remove(c),r.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(r,a){r.$handlePaste(a)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(r){r.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(r){r.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(r){r.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(r){r.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(r){r.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(r){r.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(r){r.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(r){s.loadModule("ace/ext/searchbox",function(a){a.Search(r,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(r){r.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(r){r.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(r){r.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(r){r.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(r){r.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(r){r.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(r){r.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(r){r.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(r){if(r.selection.isEmpty())r.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(r){r.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(r){r.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(r){var a=r.selection.getRange();a.start.column=0,r.session.remove(a)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(r){var a=r.selection.getRange();a.end.column=Number.MAX_VALUE,r.session.remove(a)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(r){r.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(r){r.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(r){r.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(r){r.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(r){r.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(r){r.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(r,a){r.insert(a)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(r,a){r.insert(i.stringRepeat(a.text||"",a.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(r){r.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(r){r.transposeLetters()},multiSelectAction:function(r){r.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(r){r.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(r){r.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:o(null,null),exec:function(r){r.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(r){var a=r.selection.getRange();a.start.column=a.end.column=0,a.end.row++,r.selection.setRange(a,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:o("Ctrl+F3","F3"),exec:function(r){r.openLink()}},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(r){for(var a=r.selection.isBackwards(),c=a?r.selection.getSelectionLead():r.selection.getSelectionAnchor(),p=a?r.selection.getSelectionAnchor():r.selection.getSelectionLead(),u=r.session.doc.getLine(c.row).length,f=r.session.doc.getTextRange(r.selection.getRange()),g=f.replace(/\n\s*/," ").length,v=r.session.doc.getLine(c.row),b=c.row+1;b<=p.row+1;b++){var D=i.stringTrimLeft(i.stringTrimRight(r.session.doc.getLine(b)));D.length!==0&&(D=" "+D),v+=D}p.row+1<r.session.doc.getLength()-1&&(v+=r.session.doc.getNewLineCharacter()),r.clearSelection(),r.session.doc.replace(new d(c.row,0,p.row+2,0),v),g>0?(r.selection.moveCursorTo(c.row,c.column),r.selection.selectTo(c.row,c.column+g)):(u=r.session.doc.getLine(c.row).length>u?u+1:u,r.selection.moveCursorTo(c.row,u))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(r){var a=r.session.doc.getLength()-1,c=r.session.doc.getLine(a).length,p=r.selection.rangeList.ranges,u=[];p.length<1&&(p=[r.selection.getRange()]);for(var f=0;f<p.length;f++)f==p.length-1&&(p[f].end.row===a&&p[f].end.column===c||u.push(new d(p[f].end.row,p[f].end.column,a,c))),f===0?p[f].start.row===0&&p[f].start.column===0||u.push(new d(0,0,p[f].start.row,p[f].start.column)):u.push(new d(p[f-1].end.row,p[f-1].end.column,p[f].start.row,p[f].start.column));r.exitMultiSelectMode(),r.clearSelection();for(var f=0;f<u.length;f++)r.selection.addRange(u[f],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(r){r.selection.clearSelection(),r.navigateLineEnd(),r.insert(`
217
- `)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(r){r.selection.clearSelection();var a=r.getCursorPosition();r.selection.moveTo(a.row-1,Number.MAX_VALUE),r.insert(`
218
- `),a.row===0&&r.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(r){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),r.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:o("F1","F1"),exec:function(r){r.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:o(null,null),exec:function(r){r.prompt({$type:"modes"})},readOnly:!0}];for(var l=1;l<9;l++)n.commands.push({name:"foldToLevel"+l,description:"Fold To Level "+l,level:l,exec:function(r){r.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys"],function(t,n,h){var i=t("../lib/keys"),s=(function(){function o(l){this.editor=l,this.gutterLayer=l.renderer.$gutterLayer,this.element=l.renderer.$gutter,this.lines=l.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=this.editor.$mouseHandler.$tooltip}return o.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},o.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},o.prototype.$onGutterKeyDown=function(l){if(this.annotationTooltip.isOpen){l.preventDefault(),l.keyCode===i.escape&&this.annotationTooltip.hide();return}if(l.target===this.element){if(l.keyCode!=i.enter)return;l.preventDefault();var r=this.editor.getCursorPosition().row;this.editor.isRowVisible(r)||this.editor.scrollToLine(r,!0,!0),setTimeout(function(){var a=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),c=this.$findNearestFoldLaneWidget(a),p=this.$findNearestAnnotation(a);if(!(c===null&&p===null)){var u=this.$findClosestNumber(c,p,a);if(u===c)if(this.activeLane="fold",this.activeRowIndex=c,this.$isCustomWidgetVisible(c)){this.$focusCustomWidget(this.activeRowIndex);return}else{this.$focusFoldWidget(this.activeRowIndex);return}else{this.activeRowIndex=p,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}}}.bind(this),10);return}this.$handleGutterKeyboardInteraction(l),setTimeout(function(){this.editor._signal("gutterkeydown",new d(l,this))}.bind(this),10)},o.prototype.$handleGutterKeyboardInteraction=function(l){if(l.keyCode===i.tab){l.preventDefault();return}if(l.keyCode===i.escape){l.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(l.keyCode===i.up){switch(l.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(l.keyCode===i.down){switch(l.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(l.keyCode===i.left){l.preventDefault(),this.$switchLane("annotation");return}if(l.keyCode===i.right){l.preventDefault(),this.$switchLane("fold");return}if(l.keyCode===i.enter||l.keyCode===i.space){switch(l.preventDefault(),this.activeLane){case"fold":var r=this.$rowIndexToRow(this.activeRowIndex),a=this.editor.session.$gutterCustomWidgets[r];if(a)a.callbacks&&a.callbacks.onClick&&a.callbacks.onClick(l,r);else if(this.gutterLayer.session.foldWidgets[r]==="start"){this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),l),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==r&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(r),this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex)),this.annotationTooltip.$fromKeyboard=!0;break}return}},o.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hide()},o.prototype.$isFoldWidgetVisible=function(l){var r=this.editor.isRowFullyVisible(this.$rowIndexToRow(l)),a=this.$getFoldWidget(l).style.display!=="none";return r&&a},o.prototype.$isCustomWidgetVisible=function(l){var r=this.editor.isRowFullyVisible(this.$rowIndexToRow(l)),a=!!this.$getCustomWidget(l);return r&&a},o.prototype.$isAnnotationVisible=function(l){var r=this.editor.isRowFullyVisible(this.$rowIndexToRow(l)),a=this.$getAnnotation(l).style.display!=="none";return r&&a},o.prototype.$getFoldWidget=function(l){var r=this.lines.get(l),a=r.element;return a.childNodes[1]},o.prototype.$getCustomWidget=function(l){var r=this.lines.get(l),a=r.element;return a.childNodes[3]},o.prototype.$getAnnotation=function(l){var r=this.lines.get(l),a=r.element;return a.childNodes[2]},o.prototype.$findNearestFoldLaneWidget=function(l){if(this.$isCustomWidgetVisible(l)||this.$isFoldWidgetVisible(l))return l;for(var r=0;l-r>0||l+r<this.lines.getLength()-1;){if(r++,l-r>=0&&this.$isCustomWidgetVisible(l-r))return l-r;if(l+r<=this.lines.getLength()-1&&this.$isCustomWidgetVisible(l+r))return l+r;if(l-r>=0&&this.$isFoldWidgetVisible(l-r))return l-r;if(l+r<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(l+r))return l+r}return null},o.prototype.$findNearestAnnotation=function(l){if(this.$isAnnotationVisible(l))return l;for(var r=0;l-r>0||l+r<this.lines.getLength()-1;){if(r++,l-r>=0&&this.$isAnnotationVisible(l-r))return l-r;if(l+r<=this.lines.getLength()-1&&this.$isAnnotationVisible(l+r))return l+r}return null},o.prototype.$focusFoldWidget=function(l){if(l!=null){var r=this.$getFoldWidget(l);r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus()}},o.prototype.$focusCustomWidget=function(l){if(l!=null){var r=this.$getCustomWidget(l);r&&(r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus())}},o.prototype.$focusAnnotation=function(l){if(l!=null){var r=this.$getAnnotation(l);r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus()}},o.prototype.$blurFoldWidget=function(l){var r=this.$getFoldWidget(l);r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur()},o.prototype.$blurCustomWidget=function(l){var r=this.$getCustomWidget(l);r&&(r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur())},o.prototype.$blurAnnotation=function(l){var r=this.$getAnnotation(l);r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur()},o.prototype.$moveFoldWidgetUp=function(){for(var l=this.activeRowIndex;l>0;)if(l--,this.$isFoldWidgetVisible(l)||this.$isCustomWidgetVisible(l)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=l,this.$isFoldWidgetVisible(l)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},o.prototype.$moveFoldWidgetDown=function(){for(var l=this.activeRowIndex;l<this.lines.getLength()-1;)if(l++,this.$isFoldWidgetVisible(l)||this.$isCustomWidgetVisible(l)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=l,this.$isFoldWidgetVisible(l)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},o.prototype.$moveAnnotationUp=function(){for(var l=this.activeRowIndex;l>0;)if(l--,this.$isAnnotationVisible(l)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=l,this.$focusAnnotation(this.activeRowIndex);return}},o.prototype.$moveAnnotationDown=function(){for(var l=this.activeRowIndex;l<this.lines.getLength()-1;)if(l++,this.$isAnnotationVisible(l)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=l,this.$focusAnnotation(this.activeRowIndex);return}},o.prototype.$findClosestNumber=function(l,r,a){return l===null?r:r===null||Math.abs(a-l)<=Math.abs(a-r)?l:r},o.prototype.$switchLane=function(l){switch(l){case"annotation":if(this.activeLane==="annotation")break;var r=this.$findNearestAnnotation(this.activeRowIndex);if(r==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var a=this.$findNearestFoldLaneWidget(this.activeRowIndex);if(a===null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=a,this.$isCustomWidgetVisible(a)?this.$focusCustomWidget(this.activeRowIndex):this.$focusFoldWidget(this.activeRowIndex);break}},o.prototype.$rowIndexToRow=function(l){var r=this.lines.get(l);return r?r.row:null},o.prototype.$rowToRowIndex=function(l){for(var r=0;r<this.lines.getLength();r++){var a=this.lines.get(r);if(a.row==l)return r}return null},o})();n.GutterKeyboardHandler=s;var d=(function(){function o(l,r){this.gutterKeyboardHandler=r,this.domEvent=l}return o.prototype.getKey=function(){return i.keyCodeToString(this.domEvent.keyCode)},o.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},o.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},o.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},o})();n.GutterKeyboardEvent=d}),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys","ace/lib/event","ace/tooltip"],function(t,n,h){var i=this&&this.__values||function(S){var C=typeof Symbol=="function"&&Symbol.iterator,L=C&&S[C],I=0;if(L)return L.call(S);if(S&&typeof S.length=="number")return{next:function(){return S&&I>=S.length&&(S=void 0),{value:S&&S[I++],done:!S}}};throw new TypeError(C?"Object is not iterable.":"Symbol.iterator is not defined.")},s=t("./lib/oop"),d=t("./lib/dom"),o=t("./lib/lang"),l=t("./lib/useragent"),r=t("./keyboard/textinput").TextInput,a=t("./mouse/mouse_handler").MouseHandler,c=t("./mouse/fold_handler").FoldHandler,p=t("./keyboard/keybinding").KeyBinding,u=t("./edit_session").EditSession,f=t("./search").Search,g=t("./range").Range,v=t("./lib/event_emitter").EventEmitter,b=t("./commands/command_manager").CommandManager,D=t("./commands/default_commands").commands,E=t("./config"),w=t("./token_iterator").TokenIterator,y=t("./keyboard/gutter_handler").GutterKeyboardHandler,A=t("./config").nls,T=t("./clipboard"),x=t("./lib/keys"),M=t("./lib/event"),O=t("./tooltip").HoverTooltip,_=(function(){function S(C,L,I){this.id="editor"+ ++S.$uid,this.session,this.$toDestroy=[];var F=C.getContainerElement();this.container=F,this.renderer=C,this.commands=new b(l.isMac?"mac":"win",D),typeof document=="object"&&(this.textInput=new r(C.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new a(this),new c(this)),this.keyBinding=new p(this),this.$search=new f().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=o.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(R,B){B._$emitInputEvent.schedule(31)}),this.setSession(L||I&&I.session||new u("")),E.resetOptions(this),I&&this.setOptions(I),E._signal("editor",this)}return S.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},S.prototype.startOperation=function(C){this.session.startOperation(C)},S.prototype.endOperation=function(C){this.session.endOperation(C)},S.prototype.onStartOperation=function(C){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,C||(this.previousCommand=null)},S.prototype.onEndOperation=function(C){if(this.curOp&&this.session){if(C&&C.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var L=this.curOp.command,I=L&&L.scrollIntoView;if(I){switch(I){case"center-animate":I="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var F=this.selection.getRange(),R=this.renderer.layerConfig;(F.start.row>=R.lastRow||F.end.row<=R.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}I=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},S.prototype.$historyTracker=function(C){if(this.$mergeUndoDeltas){var L=this.prevOp,I=this.$mergeableCommands,F=L.command&&C.command.name==L.command.name;if(C.command.name=="insertstring"){var R=C.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),F=F&&this.mergeNextCommand&&(!/\s/.test(R)||/\s/.test(L.args)),this.mergeNextCommand=!0}else F=F&&I.indexOf(C.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(F=!1),F?this.session.mergeUndoDeltas=!0:I.indexOf(C.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},S.prototype.setKeyboardHandler=function(C,L){if(C&&typeof C=="string"&&C!="ace"){this.$keybindingId=C;var I=this;E.loadModule(["keybinding",C],function(F){I.$keybindingId==C&&I.keyBinding.setKeyboardHandler(F&&F.handler),L&&L()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(C),L&&L()},S.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},S.prototype.setSession=function(C){if(this.session!=C){this.curOp&&this.endOperation(),this.curOp={};var L=this.session;if(L){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange),this.session.off("startOperation",this.$onStartOperation),this.session.off("endOperation",this.$onEndOperation);var I=this.session.getSelection();I.off("changeCursor",this.$onCursorChange),I.off("changeSelection",this.$onSelectionChange)}this.session=C,C?(this.$onDocumentChange=this.onDocumentChange.bind(this),C.on("change",this.$onDocumentChange),this.renderer.setSession(C),this.$onChangeMode=this.onChangeMode.bind(this),C.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),C.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),C.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),C.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),C.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),C.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=C.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.$onStartOperation=this.onStartOperation.bind(this),this.session.on("startOperation",this.$onStartOperation),this.$onEndOperation=this.onEndOperation.bind(this),this.session.on("endOperation",this.$onEndOperation),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(C)),this._signal("changeSession",{session:C,oldSession:L}),this.curOp=null,L&&L._signal("changeEditor",{oldEditor:this}),L&&(L.$editor=null),C&&C._signal("changeEditor",{editor:this}),C&&(C.$editor=this),C&&!C.destroyed&&C.bgTokenizer.scheduleStart()}},S.prototype.getSession=function(){return this.session},S.prototype.setValue=function(C,L){return this.session.doc.setValue(C),L?L==1?this.navigateFileEnd():L==-1&&this.navigateFileStart():this.selectAll(),C},S.prototype.getValue=function(){return this.session.getValue()},S.prototype.getSelection=function(){return this.selection},S.prototype.resize=function(C){this.renderer.onResize(C)},S.prototype.setTheme=function(C,L){this.renderer.setTheme(C,L)},S.prototype.getTheme=function(){return this.renderer.getTheme()},S.prototype.setStyle=function(C,L){this.renderer.setStyle(C,L)},S.prototype.unsetStyle=function(C){this.renderer.unsetStyle(C)},S.prototype.getFontSize=function(){return this.getOption("fontSize")||d.computedStyle(this.container).fontSize},S.prototype.setFontSize=function(C){this.setOption("fontSize",C)},S.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var C=this;this.$highlightPending=!0,setTimeout(function(){C.$highlightPending=!1;var L=C.session;if(!(!L||L.destroyed)){L.$bracketHighlight&&(L.$bracketHighlight.markerIds.forEach(function(U){L.removeMarker(U)}),L.$bracketHighlight=null);var I=C.getCursorPosition(),F=C.getKeyboardHandler(),R=F&&F.$getDirectionForHighlight&&F.$getDirectionForHighlight(C),B=L.getMatchingBracketRanges(I,R);if(!B){var N=new w(L,I.row,I.column),z=N.getCurrentToken();if(z&&/\b(?:tag-open|tag-name)/.test(z.type)){var W=L.getMatchingTags(I);W&&(B=[W.openTagName.isEmpty()?W.openTag:W.openTagName,W.closeTagName.isEmpty()?W.closeTag:W.closeTagName])}}if(!B&&L.$mode.getMatching&&(B=L.$mode.getMatching(C.session)),!B){C.getHighlightIndentGuides()&&C.renderer.$textLayer.$highlightIndentGuide();return}var j="ace_bracket";Array.isArray(B)?B.length==1&&(j="ace_error_bracket"):B=[B],B.length==2&&(g.comparePoints(B[0].end,B[1].start)==0?B=[g.fromPoints(B[0].start,B[1].end)]:g.comparePoints(B[0].start,B[1].end)==0&&(B=[g.fromPoints(B[1].start,B[0].end)])),L.$bracketHighlight={ranges:B,markerIds:B.map(function(U){return L.addMarker(U,j,"text")})},C.getHighlightIndentGuides()&&C.renderer.$textLayer.$highlightIndentGuide()}},50)}},S.prototype.focus=function(){this.textInput.focus()},S.prototype.isFocused=function(){return this.textInput.isFocused()},S.prototype.blur=function(){this.textInput.blur()},S.prototype.onFocus=function(C){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",C))},S.prototype.onBlur=function(C){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",C))},S.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},S.prototype.onDocumentChange=function(C){var L=this.session.$useWrapMode,I=C.start.row==C.end.row?C.end.row:1/0;this.renderer.updateLines(C.start.row,I,L),this._signal("change",C),this.$cursorChange()},S.prototype.onTokenizerUpdate=function(C){var L=C.data;this.renderer.updateLines(L.first,L.last)},S.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},S.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},S.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},S.prototype.$updateHighlightActiveLine=function(){var C=this.getSession(),L;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(L=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(L=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(L=!1)),C.$highlightLineMarker&&!L)C.removeMarker(C.$highlightLineMarker.id),C.$highlightLineMarker=null;else if(!C.$highlightLineMarker&&L){var I=new g(L.row,L.column,L.row,1/0);I.id=C.addMarker(I,"ace_active-line","screenLine"),C.$highlightLineMarker=I}else L&&(C.$highlightLineMarker.start.row=L.row,C.$highlightLineMarker.end.row=L.row,C.$highlightLineMarker.start.column=L.column,C._signal("changeBackMarker"))},S.prototype.onSelectionChange=function(C){var L=this.session;if(L.$selectionMarker&&L.removeMarker(L.$selectionMarker),L.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var I=this.selection.getRange(),F=this.getSelectionStyle();L.$selectionMarker=L.addMarker(I,"ace_selection",F)}var R=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(R),this._signal("changeSelection")},S.prototype.$getSelectionHighLightRegexp=function(){var C=this.session,L=this.getSelectionRange();if(!(L.isEmpty()||L.isMultiLine())){var I=L.start.column,F=L.end.column,R=C.getLine(L.start.row),B=R.substring(I,F);if(!(B.length>5e3||!/[\w\d]/.test(B))){var N=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:B}),z=R.substring(I-1,F+1);if(N.test(z))return N}}},S.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},S.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},S.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},S.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},S.prototype.onChangeMode=function(C){this.renderer.updateText(),this._emit("changeMode",C)},S.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},S.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},S.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},S.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},S.prototype.getCopyText=function(){var C=this.getSelectedText(),L=this.session.doc.getNewLineCharacter(),I=!1;if(!C&&this.$copyWithEmptySelection){I=!0;for(var F=this.selection.getAllRanges(),R=0;R<F.length;R++){var B=F[R];R&&F[R-1].start.row==B.start.row||(C+=this.session.getLine(B.start.row)+L)}}var N={text:C};return this._signal("copy",N),T.lineMode=I?N.text:!1,N.text},S.prototype.onCopy=function(){this.commands.exec("copy",this)},S.prototype.onCut=function(){this.commands.exec("cut",this)},S.prototype.onPaste=function(C,L){var I={text:C,event:L};this.commands.exec("paste",this,I)},S.prototype.$handlePaste=function(C){typeof C=="string"&&(C={text:C}),this._signal("paste",C);var L=C.text,I=L===T.lineMode,F=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)I?F.insert({row:this.selection.lead.row,column:0},L):this.insert(L);else if(I)this.selection.rangeList.ranges.forEach(function(j){F.insert({row:j.start.row,column:0},L)});else{var R=L.split(/\r\n|\r|\n/),B=this.selection.rangeList.ranges,N=R.length==2&&(!R[0]||!R[1]);if(R.length!=B.length||N)return this.commands.exec("insertstring",this,L);for(var z=B.length;z--;){var W=B[z];W.isEmpty()||F.remove(W),F.insert(W.start,R[z])}}},S.prototype.execCommand=function(C,L){return this.commands.exec(C,this,L)},S.prototype.insert=function(C,L){var I=this.session,F=I.getMode(),R=this.getCursorPosition();if(this.getBehavioursEnabled()&&!L){var B=F.transformAction(I.getState(R.row),"insertion",this,I,C);B&&(C!==B.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),C=B.text)}if(C==" "&&(C=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&C.indexOf(`
219
- `)==-1){var N=g.fromPoints(R,R);N.end.column+=C.length,this.session.remove(N)}}else{var N=this.getSelectionRange();R=this.session.remove(N),this.clearSelection()}if(C==`
220
- `||C==`\r
221
- `){var U=I.getLine(R.row);if(R.column>U.search(/\S|$/)){var z=U.substr(R.column).search(/\S|$/);I.doc.removeInLine(R.row,R.column,R.column+z)}}this.clearSelection();var W=R.column,j=I.getState(R.row),U=I.getLine(R.row),K=F.checkOutdent(j,U,C);if(I.insert(R,C),B&&B.selection&&(B.selection.length==2?this.selection.setSelectionRange(new g(R.row,W+B.selection[0],R.row,W+B.selection[1])):this.selection.setSelectionRange(new g(R.row+B.selection[0],B.selection[1],R.row+B.selection[2],B.selection[3]))),this.$enableAutoIndent){if(I.getDocument().isNewLine(C)){var J=F.getNextLineIndent(j,U.slice(0,R.column),I.getTabString());I.insert({row:R.row+1,column:0},J)}K&&F.autoOutdent(j,I,R.row)}},S.prototype.autoIndent=function(){for(var C=this.session,L=C.getMode(),I=this.selection.isEmpty()?[new g(0,0,C.doc.getLength()-1,0)]:this.selection.getAllRanges(),F="",R="",B="",N=C.getTabString(),z=0;z<I.length;z++)for(var W=I[z].start.row,j=I[z].end.row,U=W;U<=j;U++){U>0&&(F=C.getState(U-1),R=C.getLine(U-1),B=L.getNextLineIndent(F,R,N));var K=C.getLine(U),J=L.$getIndent(K);if(B!==J){if(J.length>0){var Y=new g(U,0,U,J.length);C.remove(Y)}B.length>0&&C.insert({row:U,column:0},B)}L.autoOutdent(F,C,U)}},S.prototype.onTextInput=function(C,L){if(!L)return this.keyBinding.onTextInput(C);this.startOperation({command:{name:"insertstring"}});var I=this.applyComposition.bind(this,C,L);this.selection.rangeCount?this.forEachSelection(I):I(),this.endOperation()},S.prototype.applyComposition=function(C,L){if(L.extendLeft||L.extendRight){var I=this.selection.getRange();I.start.column-=L.extendLeft,I.end.column+=L.extendRight,I.start.column<0&&(I.start.row--,I.start.column+=this.session.getLine(I.start.row).length+1),this.selection.setRange(I),!C&&!I.isEmpty()&&this.remove()}if((C||!this.selection.isEmpty())&&this.insert(C,!0),L.restoreStart||L.restoreEnd){var I=this.selection.getRange();I.start.column-=L.restoreStart,I.end.column-=L.restoreEnd,this.selection.setRange(I)}},S.prototype.onCommandKey=function(C,L,I){return this.keyBinding.onCommandKey(C,L,I)},S.prototype.setOverwrite=function(C){this.session.setOverwrite(C)},S.prototype.getOverwrite=function(){return this.session.getOverwrite()},S.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},S.prototype.setScrollSpeed=function(C){this.setOption("scrollSpeed",C)},S.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},S.prototype.setDragDelay=function(C){this.setOption("dragDelay",C)},S.prototype.getDragDelay=function(){return this.getOption("dragDelay")},S.prototype.setSelectionStyle=function(C){this.setOption("selectionStyle",C)},S.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},S.prototype.setHighlightActiveLine=function(C){this.setOption("highlightActiveLine",C)},S.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},S.prototype.setHighlightGutterLine=function(C){this.setOption("highlightGutterLine",C)},S.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},S.prototype.setHighlightSelectedWord=function(C){this.setOption("highlightSelectedWord",C)},S.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},S.prototype.setAnimatedScroll=function(C){this.renderer.setAnimatedScroll(C)},S.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},S.prototype.setShowInvisibles=function(C){this.renderer.setShowInvisibles(C)},S.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},S.prototype.setDisplayIndentGuides=function(C){this.renderer.setDisplayIndentGuides(C)},S.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},S.prototype.setHighlightIndentGuides=function(C){this.renderer.setHighlightIndentGuides(C)},S.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},S.prototype.setShowPrintMargin=function(C){this.renderer.setShowPrintMargin(C)},S.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},S.prototype.setPrintMarginColumn=function(C){this.renderer.setPrintMarginColumn(C)},S.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},S.prototype.setReadOnly=function(C){this.setOption("readOnly",C)},S.prototype.getReadOnly=function(){return this.getOption("readOnly")},S.prototype.setBehavioursEnabled=function(C){this.setOption("behavioursEnabled",C)},S.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},S.prototype.setWrapBehavioursEnabled=function(C){this.setOption("wrapBehavioursEnabled",C)},S.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},S.prototype.setShowFoldWidgets=function(C){this.setOption("showFoldWidgets",C)},S.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},S.prototype.setFadeFoldWidgets=function(C){this.setOption("fadeFoldWidgets",C)},S.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},S.prototype.remove=function(C){this.selection.isEmpty()&&(C=="left"?this.selection.selectLeft():this.selection.selectRight());var L=this.getSelectionRange();if(this.getBehavioursEnabled()){var I=this.session,F=I.getState(L.start.row),R=I.getMode().transformAction(F,"deletion",this,I,L);if(L.end.column===0){var B=I.getTextRange(L);if(B[B.length-1]==`
222
- `){var N=I.getLine(L.end.row);/^\s+$/.test(N)&&(L.end.column=N.length)}}R&&(L=R)}this.session.remove(L),this.clearSelection()},S.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},S.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},S.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},S.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var C=this.getSelectionRange();C.start.column==C.end.column&&C.start.row==C.end.row&&(C.end.column=0,C.end.row++),this.session.remove(C),this.clearSelection()},S.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var C=this.getCursorPosition();this.insert(`
223
- `),this.moveCursorToPosition(C)},S.prototype.setGhostText=function(C,L){this.renderer.setGhostText(C,L)},S.prototype.removeGhostText=function(){this.renderer.removeGhostText()},S.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var C=this.getCursorPosition(),L=C.column;if(L!==0){var I=this.session.getLine(C.row),F,R;L<I.length?(F=I.charAt(L)+I.charAt(L-1),R=new g(C.row,L-1,C.row,L+1)):(F=I.charAt(L-1)+I.charAt(L-2),R=new g(C.row,L-2,C.row,L)),this.session.replace(R,F),this.session.selection.moveToPosition(R.end)}}},S.prototype.toLowerCase=function(){var C=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var L=this.getSelectionRange(),I=this.session.getTextRange(L);this.session.replace(L,I.toLowerCase()),this.selection.setSelectionRange(C)},S.prototype.toUpperCase=function(){var C=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var L=this.getSelectionRange(),I=this.session.getTextRange(L);this.session.replace(L,I.toUpperCase()),this.selection.setSelectionRange(C)},S.prototype.indent=function(){var C=this.session,L=this.getSelectionRange();if(L.start.row<L.end.row){var I=this.$getSelectedRows();C.indentRows(I.first,I.last," ");return}else if(L.start.column<L.end.column){var F=C.getTextRange(L);if(!/^\s+$/.test(F)){var I=this.$getSelectedRows();C.indentRows(I.first,I.last," ");return}}var R=C.getLine(L.start.row),B=L.start,N=C.getTabSize(),z=C.documentToScreenColumn(B.row,B.column);if(this.session.getUseSoftTabs())var W=N-z%N,j=o.stringRepeat(" ",W);else{for(var W=z%N;R[L.start.column-1]==" "&&W;)L.start.column--,W--;this.selection.setSelectionRange(L),j=" "}return this.insert(j)},S.prototype.blockIndent=function(){var C=this.$getSelectedRows();this.session.indentRows(C.first,C.last," ")},S.prototype.blockOutdent=function(){var C=this.session.getSelection();this.session.outdentRows(C.getRange())},S.prototype.sortLines=function(){for(var C=this.$getSelectedRows(),L=this.session,I=[],F=C.first;F<=C.last;F++)I.push(L.getLine(F));I.sort(function(N,z){return N.toLowerCase()<z.toLowerCase()?-1:N.toLowerCase()>z.toLowerCase()?1:0});for(var R=new g(0,0,0,0),F=C.first;F<=C.last;F++){var B=L.getLine(F);R.start.row=F,R.end.row=F,R.end.column=B.length,L.replace(R,I[F-C.first])}},S.prototype.toggleCommentLines=function(){var C=this.session.getState(this.getCursorPosition().row),L=this.$getSelectedRows();this.session.getMode().toggleCommentLines(C,this.session,L.first,L.last)},S.prototype.toggleBlockComment=function(){var C=this.getCursorPosition(),L=this.session.getState(C.row),I=this.getSelectionRange();this.session.getMode().toggleBlockComment(L,this.session,I,C)},S.prototype.getNumberAt=function(C,L){var I=/[\-]?[0-9]+(?:\.[0-9]+)?/g;I.lastIndex=0;for(var F=this.session.getLine(C);I.lastIndex<L;){var R=I.exec(F);if(R.index<=L&&R.index+R[0].length>=L){var B={value:R[0],start:R.index,end:R.index+R[0].length};return B}}return null},S.prototype.modifyNumber=function(C){var L=this.selection.getCursor().row,I=this.selection.getCursor().column,F=new g(L,I-1,L,I),R=this.session.getTextRange(F);if(!isNaN(parseFloat(R))&&isFinite(R)){var B=this.getNumberAt(L,I);if(B){var N=B.value.indexOf(".")>=0?B.start+B.value.indexOf(".")+1:B.end,z=B.start+B.value.length-N,W=parseFloat(B.value);W*=Math.pow(10,z),N!==B.end&&I<N?C*=Math.pow(10,B.end-I-1):C*=Math.pow(10,B.end-I),W+=C,W/=Math.pow(10,z);var j=W.toFixed(z),U=new g(L,B.start,L,B.end);this.session.replace(U,j),this.moveCursorTo(L,Math.max(B.start+1,I+j.length-B.value.length))}}else this.toggleWord()},S.prototype.toggleWord=function(){var C=this.selection.getCursor().row,L=this.selection.getCursor().column;this.selection.selectWord();var I=this.getSelectedText(),F=this.selection.getWordRange().start.column,R=I.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),B=L-F-1;B<0&&(B=0);var N=0,z=0,W=this;I.match(/[A-Za-z0-9_]+/)&&R.forEach(function(ue,Se){z=N+ue.length,B>=N&&B<=z&&(I=ue,W.selection.clearSelection(),W.moveCursorTo(C,N+F),W.selection.selectTo(C,z+F)),N=z});for(var j=this.$toggleWordPairs,U,K=0;K<j.length;K++)for(var J=j[K],Y=0;Y<=1;Y++){var X=+!Y,q=I.match(new RegExp("^\\s?_?("+o.escapeRegExp(J[Y])+")\\s?$","i"));if(q){var ne=I.match(new RegExp("([_]|^|\\s)("+o.escapeRegExp(q[1])+")($|\\s)","g"));ne&&(U=I.replace(new RegExp(o.escapeRegExp(J[Y]),"i"),function(ue){var Se=J[X];return ue.toUpperCase()==ue?Se=Se.toUpperCase():ue.charAt(0).toUpperCase()==ue.charAt(0)&&(Se=Se.substr(0,0)+J[X].charAt(0).toUpperCase()+Se.substr(1)),Se}),this.insert(U),U="")}}},S.prototype.findLinkAt=function(C,L){var I,F,R=this.session.getLine(C),B=R.split(/((?:https?|ftp):\/\/[\S]+)/),N=L;N<0&&(N=0);var z=0,W=0,j;try{for(var U=i(B),K=U.next();!K.done;K=U.next()){var J=K.value;if(W=z+J.length,N>=z&&N<=W&&J.match(/((?:https?|ftp):\/\/[\S]+)/)){j=J.replace(/[\s:.,'";}\]]+$/,"");break}z=W}}catch(Y){I={error:Y}}finally{try{K&&!K.done&&(F=U.return)&&F.call(U)}finally{if(I)throw I.error}}return j},S.prototype.openLink=function(){var C=this.selection.getCursor(),L=this.findLinkAt(C.row,C.column);return L&&window.open(L,"_blank"),L!=null},S.prototype.removeLines=function(){var C=this.$getSelectedRows();this.session.removeFullLines(C.first,C.last),this.clearSelection()},S.prototype.duplicateSelection=function(){var C=this.selection,L=this.session,I=C.getRange(),F=C.isBackwards();if(I.isEmpty()){var R=I.start.row;L.duplicateLines(R,R)}else{var B=F?I.start:I.end,N=L.insert(B,L.getTextRange(I));I.start=B,I.end=N,C.setSelectionRange(I,F)}},S.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},S.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},S.prototype.moveText=function(C,L,I){return this.session.moveText(C,L,I)},S.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},S.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},S.prototype.$moveLines=function(C,L){var I,F,R=this.selection;if(!R.inMultiSelectMode||this.inVirtualSelectionMode){var B=R.toOrientedRange();I=this.$getSelectedRows(B),F=this.session.$moveLines(I.first,I.last,L?0:C),L&&C==-1&&(F=0),B.moveBy(F,0),R.fromOrientedRange(B)}else{var N=R.rangeList.ranges;R.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var z=0,W=0,j=N.length,U=0;U<j;U++){var K=U;N[U].moveBy(z,0),I=this.$getSelectedRows(N[U]);for(var J=I.first,Y=I.last;++U<j;){W&&N[U].moveBy(W,0);var X=this.$getSelectedRows(N[U]);if(L&&X.first!=Y)break;if(!L&&X.first>Y+1)break;Y=X.last}for(U--,z=this.session.$moveLines(J,Y,L?0:C),L&&C==-1&&(K=U+1);K<=U;)N[K].moveBy(z,0),K++;L||(z=0),W+=z}R.fromOrientedRange(R.ranges[0]),R.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},S.prototype.$getSelectedRows=function(C){return C=(C||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(C.start.row),last:this.session.getRowFoldEnd(C.end.row)}},S.prototype.onCompositionStart=function(C){this.renderer.showComposition(C)},S.prototype.onCompositionUpdate=function(C){this.renderer.setCompositionText(C)},S.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},S.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},S.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},S.prototype.isRowVisible=function(C){return C>=this.getFirstVisibleRow()&&C<=this.getLastVisibleRow()},S.prototype.isRowFullyVisible=function(C){return C>=this.renderer.getFirstFullyVisibleRow()&&C<=this.renderer.getLastFullyVisibleRow()},S.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},S.prototype.$moveByPage=function(C,L){var I=this.renderer,F=this.renderer.layerConfig,R=C*Math.floor(F.height/F.lineHeight);L===!0?this.selection.$moveSelection(function(){this.moveCursorBy(R,0)}):L===!1&&(this.selection.moveCursorBy(R,0),this.selection.clearSelection());var B=I.scrollTop;I.scrollBy(0,R*F.lineHeight),L!=null&&I.scrollCursorIntoView(null,.5),I.animateScrolling(B)},S.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},S.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},S.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},S.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},S.prototype.scrollPageDown=function(){this.$moveByPage(1)},S.prototype.scrollPageUp=function(){this.$moveByPage(-1)},S.prototype.scrollToRow=function(C){this.renderer.scrollToRow(C)},S.prototype.scrollToLine=function(C,L,I,F){this.renderer.scrollToLine(C,L,I,F)},S.prototype.centerSelection=function(){var C=this.getSelectionRange(),L={row:Math.floor(C.start.row+(C.end.row-C.start.row)/2),column:Math.floor(C.start.column+(C.end.column-C.start.column)/2)};this.renderer.alignCursor(L,.5)},S.prototype.getCursorPosition=function(){return this.selection.getCursor()},S.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},S.prototype.getSelectionRange=function(){return this.selection.getRange()},S.prototype.selectAll=function(){this.selection.selectAll()},S.prototype.clearSelection=function(){this.selection.clearSelection()},S.prototype.moveCursorTo=function(C,L){this.selection.moveCursorTo(C,L)},S.prototype.moveCursorToPosition=function(C){this.selection.moveCursorToPosition(C)},S.prototype.jumpToMatching=function(C,L){var I=this.getCursorPosition(),F=new w(this.session,I.row,I.column),R=F.getCurrentToken(),B=0;R&&R.type.indexOf("tag-name")!==-1&&(R=F.stepBackward());var N=R||F.stepForward();if(N){var z,W=!1,j={},U=I.column-N.start,K,J={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(N.value.match(/[{}()\[\]]/g)){for(;U<N.value.length&&!W;U++)if(J[N.value[U]])switch(K=J[N.value[U]]+"."+N.type.replace("rparen","lparen"),isNaN(j[K])&&(j[K]=0),N.value[U]){case"(":case"[":case"{":j[K]++;break;case")":case"]":case"}":j[K]--,j[K]===-1&&(z="bracket",W=!0);break}}else N.type.indexOf("tag-name")!==-1&&(isNaN(j[N.value])&&(j[N.value]=0),R.value==="<"&&B>1?j[N.value]++:R.value==="</"&&j[N.value]--,j[N.value]===-1&&(z="tag",W=!0));W||(R=N,B++,N=F.stepForward(),U=0)}while(N&&!W);if(z){var Y,X;if(z==="bracket")Y=this.session.getBracketRange(I),Y||(Y=new g(F.getCurrentTokenRow(),F.getCurrentTokenColumn()+U-1,F.getCurrentTokenRow(),F.getCurrentTokenColumn()+U-1),X=Y.start,(L||X.row===I.row&&Math.abs(X.column-I.column)<2)&&(Y=this.session.getBracketRange(X)));else if(z==="tag"){if(!N||N.type.indexOf("tag-name")===-1)return;if(Y=new g(F.getCurrentTokenRow(),F.getCurrentTokenColumn()-2,F.getCurrentTokenRow(),F.getCurrentTokenColumn()-2),Y.compare(I.row,I.column)===0){var q=this.session.getMatchingTags(I);q&&(q.openTag.contains(I.row,I.column)?(Y=q.closeTag,X=Y.start):(Y=q.openTag,q.closeTag.start.row===I.row&&q.closeTag.start.column===I.column?X=Y.end:X=Y.start))}X=X||Y.start}X=Y&&Y.cursor||X,X&&(C?Y&&L?this.selection.setRange(Y):Y&&Y.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(X.row,X.column):this.selection.moveTo(X.row,X.column))}}},S.prototype.gotoLine=function(C,L,I){this.selection.clearSelection(),this.session.unfold({row:C-1,column:L||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(C-1,L||0),this.isRowFullyVisible(C-1)||this.scrollToLine(C-1,!0,I)},S.prototype.navigateTo=function(C,L){this.selection.moveTo(C,L)},S.prototype.navigateUp=function(C){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var L=this.selection.anchor.getPosition();return this.moveCursorToPosition(L)}this.selection.clearSelection(),this.selection.moveCursorBy(-C||-1,0)},S.prototype.navigateDown=function(C){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var L=this.selection.anchor.getPosition();return this.moveCursorToPosition(L)}this.selection.clearSelection(),this.selection.moveCursorBy(C||1,0)},S.prototype.navigateLeft=function(C){if(this.selection.isEmpty())for(C=C||1;C--;)this.selection.moveCursorLeft();else{var L=this.getSelectionRange().start;this.moveCursorToPosition(L)}this.clearSelection()},S.prototype.navigateRight=function(C){if(this.selection.isEmpty())for(C=C||1;C--;)this.selection.moveCursorRight();else{var L=this.getSelectionRange().end;this.moveCursorToPosition(L)}this.clearSelection()},S.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},S.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},S.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},S.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},S.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},S.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},S.prototype.replace=function(C,L){L&&this.$search.set(L);var I=this.$search.find(this.session),F=0;return I&&(this.$tryReplace(I,C)&&(F=1),this.selection.setSelectionRange(I),this.renderer.scrollSelectionIntoView(I.start,I.end)),F},S.prototype.replaceAll=function(C,L){L&&this.$search.set(L);var I=this.$search.findAll(this.session),F=0;if(!I.length)return F;var R=this.getSelectionRange();this.selection.moveTo(0,0);for(var B=I.length-1;B>=0;--B)this.$tryReplace(I[B],C)&&F++;return this.selection.setSelectionRange(R),F},S.prototype.$tryReplace=function(C,L){var I=this.session.getTextRange(C);return L=this.$search.replace(I,L),L!==null?(C.end=this.session.replace(C,L),C):null},S.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},S.prototype.find=function(C,L,I){L||(L={}),typeof C=="string"||C instanceof RegExp?L.needle=C:typeof C=="object"&&s.mixin(L,C);var F=this.selection.getRange();L.needle==null&&(C=this.session.getTextRange(F)||this.$search.$options.needle,C||(F=this.session.getWordRange(F.start.row,F.start.column),C=this.session.getTextRange(F)),this.$search.set({needle:C})),this.$search.set(L),L.start||this.$search.set({start:F});var R=this.$search.find(this.session);if(L.preventScroll)return R;if(R)return this.revealRange(R,I),R;L.backwards?F.start=F.end:F.end=F.start,this.selection.setRange(F)},S.prototype.findNext=function(C,L){this.find({skipCurrent:!0,backwards:!1},C,L)},S.prototype.findPrevious=function(C,L){this.find(C,{skipCurrent:!0,backwards:!0},L)},S.prototype.revealRange=function(C,L){this.session.unfold(C),this.selection.setSelectionRange(C);var I=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(C.start,C.end,.5),L!==!1&&this.renderer.animateScrolling(I)},S.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},S.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},S.prototype.destroy=function(){this.destroyed=!0,this.$toDestroy&&(this.$toDestroy.forEach(function(C){C.destroy()}),this.$toDestroy=[]),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},S.prototype.setAutoScrollEditorIntoView=function(C){if(C){var L,I=this,F=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var R=this.$scrollAnchor;R.style.cssText="position:absolute",this.container.insertBefore(R,this.container.firstChild);var B=this.on("changeSelection",function(){F=!0}),N=this.renderer.on("beforeRender",function(){F&&(L=I.renderer.container.getBoundingClientRect())}),z=this.renderer.on("afterRender",function(){if(F&&L&&(I.isFocused()||I.searchBox&&I.searchBox.isFocused())){var W=I.renderer,j=W.$cursorLayer.$pixelPos,U=W.layerConfig,K=j.top-U.offset;j.top>=0&&K+L.top<0?F=!0:j.top<U.height&&j.top+L.top+U.lineHeight>window.innerHeight?F=!1:F=null,F!=null&&(R.style.top=K+"px",R.style.left=j.left+"px",R.style.height=U.lineHeight+"px",R.scrollIntoView(F)),F=L=null}});this.setAutoScrollEditorIntoView=function(W){W||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",B),this.renderer.off("afterRender",z),this.renderer.off("beforeRender",N))}}},S.prototype.$resetCursorStyle=function(){var C=this.$cursorStyle||"ace",L=this.renderer.$cursorLayer;L&&(L.setSmoothBlinking(/smooth/.test(C)),L.isBlinking=!this.$readOnly&&C!="wide",d.setCssClass(L.element,"ace_slim-cursors",/slim/.test(C)))},S.prototype.prompt=function(C,L,I){var F=this;E.loadModule("ace/ext/prompt",function(R){R.prompt(F,C,L,I)})},S})();_.$uid=0,_.prototype.curOp=null,_.prototype.prevOp={},_.prototype.$mergeableCommands=["backspace","del","insertstring"],_.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],s.implement(_.prototype,v),E.defineOptions(_.prototype,"editor",{selectionStyle:{set:function(S){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:S})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(S){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(S){var C=this;if(this.textInput.setReadOnly(S),!this.destroyed){this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(I){var F=!1;if(I&&I.type=="keydown"){if(I&&I.key&&!I.ctrlKey&&!I.metaKey&&(I.key==" "&&I.preventDefault(),F=I.key.length==1),!F)return}else I&&I.type!=="exec"&&(F=!0);if(F){C.hoverTooltip||(C.hoverTooltip=new O);var R=d.createElement("div");R.textContent=A("editor.tooltip.disable-editing","Editing is disabled"),C.hoverTooltip.isOpen||C.hoverTooltip.showForRange(C,C.getSelectionRange(),R)}else C.hoverTooltip&&C.hoverTooltip.isOpen&&C.hoverTooltip.hide()});var L=this.textInput.getElement();S?(M.addListener(L,"keydown",this.$readOnlyCallback,this),this.commands.on("exec",this.$readOnlyCallback),this.commands.on("commandUnavailable",this.$readOnlyCallback)):(M.removeListener(L,"keydown",this.$readOnlyCallback),this.commands.off("exec",this.$readOnlyCallback),this.commands.off("commandUnavailable",this.$readOnlyCallback),this.hoverTooltip&&(this.hoverTooltip.destroy(),this.hoverTooltip=null))}},initialValue:!1},copyWithEmptySelection:{set:function(S){this.textInput.setCopyWithEmptySelection(S)},initialValue:!1},cursorStyle:{set:function(S){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(S){this.setAutoScrollEditorIntoView(S)}},keyboardHandler:{set:function(S){this.setKeyboardHandler(S)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(S){this.session.setValue(S)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(S){this.setSession(S)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(S){this.renderer.$gutterLayer.setShowLineNumbers(S),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),S&&this.$relativeLineNumbers?k.attach(this):k.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(S){this.$showLineNumbers&&S?k.attach(this):k.detach(this)}},placeholder:{set:function(S){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var C=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(C&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),d.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!C&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),d.addCssClass(this.container,"ace_hasPlaceholder");var L=d.createElement("div");L.className="ace_placeholder",L.textContent=this.$placeholder||"",this.renderer.placeholderNode=L,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!C&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(S){var C={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(F){F.blur(),F.renderer.scroller.focus()},readOnly:!0},L=function(F){if(F.target==this.renderer.scroller&&F.keyCode===x.enter){F.preventDefault();var R=this.getCursorPosition().row;this.isRowVisible(R)||this.scrollToLine(R,!0,!0),this.focus()}},I;S?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(l.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",A("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",A("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",L.bind(this)),this.commands.addCommand(C),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",A("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",A("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),I||(I=new y(this)),I.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",L.bind(this)),this.commands.removeCommand(C),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),I&&I.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(S){this.$textInputAriaLabel=S},initialValue:""},enableMobileMenu:{set:function(S){this.$enableMobileMenu=S},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var k={getText:function(S,C){return(Math.abs(S.selection.lead.row-C)||C+1+(C<9?"·":""))+""},getWidth:function(S,C,L){return Math.max(C.toString().length,(L.lastRow+1).toString().length,2)*L.characterWidth},update:function(S,C){C.renderer.$loop.schedule(C.renderer.CHANGE_GUTTER)},attach:function(S){S.renderer.$gutterLayer.$renderer=this,S.on("changeSelection",this.update),this.update(null,S)},detach:function(S){S.renderer.$gutterLayer.$renderer==this&&(S.renderer.$gutterLayer.$renderer=null),S.off("changeSelection",this.update),this.update(null,S)}};n.Editor=_}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(t,n,h){var i=t("../lib/dom"),s=(function(){function d(o,l){this.element=o,this.canvasHeight=l||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return d.prototype.moveContainer=function(o){i.translate(this.element,0,-(o.firstRowScreen*o.lineHeight%this.canvasHeight)-o.offset*this.$offsetCoefficient)},d.prototype.pageChanged=function(o,l){return Math.floor(o.firstRowScreen*o.lineHeight/this.canvasHeight)!==Math.floor(l.firstRowScreen*l.lineHeight/this.canvasHeight)},d.prototype.computeLineTop=function(o,l,r){var a=l.firstRowScreen*l.lineHeight,c=Math.floor(a/this.canvasHeight),p=r.documentToScreenRow(o,0)*l.lineHeight;return p-c*this.canvasHeight},d.prototype.computeLineHeight=function(o,l,r){return l.lineHeight*r.getRowLineCount(o)},d.prototype.getLength=function(){return this.cells.length},d.prototype.get=function(o){return this.cells[o]},d.prototype.shift=function(){this.$cacheCell(this.cells.shift())},d.prototype.pop=function(){this.$cacheCell(this.cells.pop())},d.prototype.push=function(o){if(Array.isArray(o)){this.cells.push.apply(this.cells,o);for(var l=i.createFragment(this.element),r=0;r<o.length;r++)l.appendChild(o[r].element);this.element.appendChild(l)}else this.cells.push(o),this.element.appendChild(o.element)},d.prototype.unshift=function(o){if(Array.isArray(o)){this.cells.unshift.apply(this.cells,o);for(var l=i.createFragment(this.element),r=0;r<o.length;r++)l.appendChild(o[r].element);this.element.firstChild?this.element.insertBefore(l,this.element.firstChild):this.element.appendChild(l)}else this.cells.unshift(o),this.element.insertAdjacentElement("afterbegin",o.element)},d.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},d.prototype.$cacheCell=function(o){o&&(o.element.remove(),this.cellCache.push(o))},d.prototype.createCell=function(o,l,r,a){var c=this.cellCache.pop();if(!c){var p=i.createElement("div");a&&a(p),this.element.appendChild(p),c={element:p,text:"",row:o}}return c.row=o,c},d})();n.Lines=s}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],function(t,n,h){var i=t("../lib/dom"),s=t("../lib/oop"),d=t("../lib/lang"),o=t("../lib/event_emitter").EventEmitter,l=t("./lines").Lines,r=t("../config").nls,a=(function(){function p(u){this.$showCursorMarker=null,this.element=i.createElement("div"),this.element.className="ace_layer ace_gutter-layer",u.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new l(this.element),this.$lines.$offsetCoefficient=1}return p.prototype.setSession=function(u){this.session&&this.session.off("change",this.$updateAnnotations),this.session=u,u&&u.on("change",this.$updateAnnotations)},p.prototype.addGutterDecoration=function(u,f){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(u,f)},p.prototype.removeGutterDecoration=function(u,f){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(u,f)},p.prototype.setAnnotations=function(u){this.$annotations=[];for(var f=0;f<u.length;f++){var g=u[f],v=g.row,b=this.$annotations[v];b||(b=this.$annotations[v]={text:[],type:[],displayText:[]});var D=g.text,E=g.text,w=g.type;D=D?d.escapeHTML(D):g.html||"",E=E||g.html||"",b.text.indexOf(D)===-1&&(b.text.push(D),b.type.push(w),b.displayText.push(E));var y=g.className;y?b.className=y:w==="error"?b.className=" ace_error":w==="security"&&!/\bace_error\b/.test(b.className)?b.className=" ace_security":w==="warning"&&!/\bace_(error|security)\b/.test(b.className)?b.className=" ace_warning":w==="info"&&!b.className?b.className=" ace_info":w==="hint"&&!b.className&&(b.className=" ace_hint")}},p.prototype.$updateAnnotations=function(u){if(this.$annotations.length){var f=u.start.row,g=u.end.row-f;if(g!==0)if(u.action=="remove")this.$annotations.splice(f,g+1,null);else{var v=new Array(g+1);v.unshift(f,1),this.$annotations.splice.apply(this.$annotations,v)}}},p.prototype.update=function(u){this.config=u;var f=this.session,g=u.firstRow,v=Math.min(u.lastRow+u.gutterOffset,f.getLength()-1);this.oldLastRow=v,this.config=u,this.$lines.moveContainer(u),this.$updateCursorRow();for(var b=f.getNextFoldLine(g),D=b?b.start.row:1/0,E=null,w=-1,y=g;;){if(y>D&&(y=b.end.row+1,b=f.getNextFoldLine(y,b),D=b?b.start.row:1/0),y>v){for(;this.$lines.getLength()>w+1;)this.$lines.pop();break}E=this.$lines.get(++w),E?E.row=y:(E=this.$lines.createCell(y,u,this.session,c),this.$lines.push(E)),this.$renderCell(E,u,b,y),y++}this._signal("afterRender"),this.$updateGutterWidth(u),this.$showCursorMarker&&this.$highlightGutterLine&&this.$updateCursorMarker()},p.prototype.$updateGutterWidth=function(u){var f=this.session,g=f.gutterRenderer||this.$renderer,v=f.$firstLineNumber,b=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||f.$useWrapMode)&&(b=f.getLength()+v-1);var D=g?g.getWidth(f,b,u):b.toString().length*u.characterWidth,E=this.$padding||this.$computePadding();D+=E.left+E.right,D!==this.gutterWidth&&!isNaN(D)&&(this.gutterWidth=D,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",D))},p.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var u=this.session.selection.getCursor();this.$cursorRow!==u.row&&(this.$cursorRow=u.row)}},p.prototype.updateLineHighlight=function(){if(this.$showCursorMarker&&this.$updateCursorMarker(),!!this.$highlightGutterLine){var u=this.session.selection.cursor.row;if(this.$cursorRow=u,!(this.$cursorCell&&this.$cursorCell.row==u)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var f=this.$lines.cells;this.$cursorCell=null;for(var g=0;g<f.length;g++){var v=f[g];if(v.row>=this.$cursorRow){if(v.row>this.$cursorRow){var b=this.session.getFoldLine(this.$cursorRow);if(g>0&&b&&b.start.row==f[g-1].row)v=f[g-1];else break}v.element.className="ace_gutter-active-line "+v.element.className,this.$cursorCell=v;break}}}}},p.prototype.$updateCursorMarker=function(){if(this.session){var u=this.session;this.$highlightElement||(this.$highlightElement=i.createElement("div"),this.$highlightElement.className="ace_gutter-cursor",this.$highlightElement.style.pointerEvents="none",this.element.appendChild(this.$highlightElement));var f=u.selection.cursor,g=this.config,v=this.$lines,b=g.firstRowScreen*g.lineHeight,D=Math.floor(b/v.canvasHeight),E=u.documentToScreenRow(f)*g.lineHeight,w=E-D*v.canvasHeight;i.setStyle(this.$highlightElement.style,"height",g.lineHeight+"px"),i.setStyle(this.$highlightElement.style,"top",w+"px")}},p.prototype.scrollLines=function(u){var f=this.config;if(this.config=u,this.$updateCursorRow(),this.$lines.pageChanged(f,u))return this.update(u);this.$lines.moveContainer(u);var g=Math.min(u.lastRow+u.gutterOffset,this.session.getLength()-1),v=this.oldLastRow;if(this.oldLastRow=g,!f||v<u.firstRow)return this.update(u);if(g<f.firstRow)return this.update(u);if(f.firstRow<u.firstRow)for(var b=this.session.getFoldedRowCount(f.firstRow,u.firstRow-1);b>0;b--)this.$lines.shift();if(v>g)for(var b=this.session.getFoldedRowCount(g+1,v);b>0;b--)this.$lines.pop();u.firstRow<f.firstRow&&this.$lines.unshift(this.$renderLines(u,u.firstRow,f.firstRow-1)),g>v&&this.$lines.push(this.$renderLines(u,v+1,g)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(u)},p.prototype.$renderLines=function(u,f,g){for(var v=[],b=f,D=this.session.getNextFoldLine(b),E=D?D.start.row:1/0;b>E&&(b=D.end.row+1,D=this.session.getNextFoldLine(b,D),E=D?D.start.row:1/0),!(b>g);){var w=this.$lines.createCell(b,u,this.session,c);this.$renderCell(w,u,D,b),v.push(w),b++}return v},p.prototype.$renderCell=function(u,f,g,v){var b=u.element,D=this.session,E=b.childNodes[0],w=b.childNodes[1],y=b.childNodes[2],A=b.childNodes[3],T=y.firstChild,x=D.$firstLineNumber,M=D.$breakpoints,O=D.$decorations,_=D.gutterRenderer||this.$renderer,k=this.$showFoldWidgets&&D.foldWidgets,S=g?g.start.row:Number.MAX_VALUE,C=f.lineHeight+"px",L=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",I=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",F=(_?_.getText(D,v):v+x).toString();if(this.$highlightGutterLine&&(v==this.$cursorRow||g&&v<this.$cursorRow&&v>=S&&this.$cursorRow<=g.end.row)&&(L+="ace_gutter-active-line ",this.$cursorCell!=u&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=u)),M[v]&&(L+=M[v]),O[v]&&(L+=O[v]),this.$annotations[v]&&v!==S&&(L+=this.$annotations[v].className),k){var R=k[v];R==null&&(R=k[v]=D.getFoldWidget(v))}if(R){var B="ace_fold-widget ace_"+R,N=R=="start"&&v==S&&v<g.end.row;if(N){B+=" ace_closed";for(var z="",W=!1,j=v+1;j<=g.end.row;j++)if(this.$annotations[j]){if(this.$annotations[j].className===" ace_error"){W=!0,z=" ace_error_fold";break}this.$annotations[j].className===" ace_security"?(W=!0,z=" ace_security_fold"):this.$annotations[j].className===" ace_warning"&&z!==" ace_security_fold"&&(W=!0,z=" ace_warning_fold")}L+=z}else B+=" ace_open";w.className!=B&&(w.className=B),i.setStyle(w.style,"height",C),i.setStyle(w.style,"display","inline-block"),w.setAttribute("role","button"),w.setAttribute("tabindex","-1");var U=D.getFoldWidgetRange(v);U?w.setAttribute("aria-label",r("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[U.start.row+1,U.end.row+1])):g?w.setAttribute("aria-label",r("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[g.start.row+1,g.end.row+1])):w.setAttribute("aria-label",r("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[v+1])),N?(w.setAttribute("aria-expanded","false"),w.setAttribute("title",r("gutter.code-folding.closed.title","Unfold code"))):(w.setAttribute("aria-expanded","true"),w.setAttribute("title",r("gutter.code-folding.open.title","Fold code")))}else w&&(i.setStyle(w.style,"display","none"),w.setAttribute("tabindex","0"),w.removeAttribute("role"),w.removeAttribute("aria-label"));var K=this.session.$gutterCustomWidgets[v];if(K?this.$addCustomWidget(v,K,u):A&&this.$removeCustomWidget(v,u),W&&this.$showFoldedAnnotations){y.className="ace_gutter_annotation",T.className=I,T.className+=z,i.setStyle(T.style,"height",C),i.setStyle(y.style,"display","block"),i.setStyle(y.style,"height",C);var J;switch(z){case" ace_error_fold":J=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[F]);break;case" ace_security_fold":J=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[F]);break;case" ace_warning_fold":J=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[F]);break}y.setAttribute("aria-label",J),y.setAttribute("tabindex","-1"),y.setAttribute("role","button")}else if(this.$annotations[v]){y.className="ace_gutter_annotation",T.className=I,this.$useSvgGutterIcons?T.className+=this.$annotations[v].className:b.classList.add(this.$annotations[v].className.replace(" ","")),i.setStyle(T.style,"height",C),i.setStyle(y.style,"display","block"),i.setStyle(y.style,"height",C);var J;switch(this.$annotations[v].className){case" ace_error":J=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[F]);break;case" ace_security":J=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[F]);break;case" ace_warning":J=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[F]);break;case" ace_info":J=r("gutter.annotation.aria-label.info","Info, read annotations row $0",[F]);break;case" ace_hint":J=r("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[F]);break}y.setAttribute("aria-label",J),y.setAttribute("tabindex","-1"),y.setAttribute("role","button")}else i.setStyle(y.style,"display","none"),y.removeAttribute("aria-label"),y.removeAttribute("role"),y.setAttribute("tabindex","0");return F!==E.data&&(E.data=F),b.className!=L&&(b.className=L),i.setStyle(u.element.style,"height",this.$lines.computeLineHeight(v,f,D)+"px"),i.setStyle(u.element.style,"top",this.$lines.computeLineTop(v,f,D)+"px"),u.text=F,y.style.display==="none"&&w.style.display==="none"&&!K?u.element.setAttribute("aria-hidden",!0):u.element.setAttribute("aria-hidden",!1),u},p.prototype.setHighlightGutterLine=function(u){this.$highlightGutterLine=u,!u&&this.$highlightElement&&(this.$highlightElement.remove(),this.$highlightElement=null)},p.prototype.setShowLineNumbers=function(u){this.$renderer=!u&&{getWidth:function(){return 0},getText:function(){return""}}},p.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},p.prototype.setShowFoldWidgets=function(u){u?i.addCssClass(this.element,"ace_folding-enabled"):i.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=u,this.$padding=null},p.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},p.prototype.$hideFoldWidget=function(u,f){var g=f||this.$getGutterCell(u);if(g&&g.element){var v=g.element.childNodes[1];v&&i.setStyle(v.style,"display","none")}},p.prototype.$showFoldWidget=function(u,f){var g=f||this.$getGutterCell(u);if(g&&g.element){var v=g.element.childNodes[1];v&&this.session.foldWidgets&&this.session.foldWidgets[g.row]&&i.setStyle(v.style,"display","inline-block")}},p.prototype.$getGutterCell=function(u){var f=this.$lines.cells,g=0,v=f.length-1;if(!(u<f[0].row||u>f[v].row)){for(;g<=v;){var b=Math.floor((g+v)/2),D=f[b];if(D.row>u)v=b-1;else if(D.row<u)g=b+1;else return D}return D}},p.prototype.$addCustomWidget=function(u,f,g){var v=f.className,b=f.label,D=f.title,E=f.callbacks;this.session.$gutterCustomWidgets[u]={className:v,label:b,title:D,callbacks:E},this.$hideFoldWidget(u,g);var w=g||this.$getGutterCell(u);if(w&&w.element){var y=w.element.querySelector(".ace_custom-widget");y&&y.remove(),y=i.createElement("span"),y.className="ace_custom-widget ".concat(v),y.setAttribute("tabindex","-1"),y.setAttribute("role","button"),y.setAttribute("aria-label",b),y.setAttribute("title",D),i.setStyle(y.style,"display","inline-block"),i.setStyle(y.style,"height","inherit"),E&&E.onClick&&y.addEventListener("click",function(A){E.onClick(A,u),A.stopPropagation()}),w.element.appendChild(y)}},p.prototype.$removeCustomWidget=function(u,f){delete this.session.$gutterCustomWidgets[u],this.$showFoldWidget(u,f);var g=f||this.$getGutterCell(u);if(g&&g.element){var v=g.element.querySelector(".ace_custom-widget");v&&g.element.removeChild(v)}},p.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var u=i.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(u.borderLeftWidth)||0)+(parseInt(u.paddingLeft)||0)+1,this.$padding.right=(parseInt(u.borderRightWidth)||0)+(parseInt(u.paddingRight)||0),this.$padding},p.prototype.getRegion=function(u){var f=this.$padding||this.$computePadding(),g=this.element.getBoundingClientRect();if(u.x<f.left+g.left)return"markers";if(this.$showFoldWidgets&&u.x>g.right-f.right)return"foldWidgets"},p})();a.prototype.$fixedWidth=!1,a.prototype.$highlightGutterLine=!0,a.prototype.$renderer=void 0,a.prototype.$showLineNumbers=!0,a.prototype.$showFoldWidgets=!0,s.implement(a.prototype,o);function c(p){var u=document.createTextNode("");p.appendChild(u);var f=i.createElement("span");p.appendChild(f);var g=i.createElement("span");p.appendChild(g);var v=i.createElement("span");return g.appendChild(v),p}n.Gutter=a}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,n,h){var i=t("../range").Range,s=t("../lib/dom"),d=(function(){function l(r){this.element=s.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element)}return l.prototype.setPadding=function(r){this.$padding=r},l.prototype.setSession=function(r){this.session=r},l.prototype.setMarkers=function(r){this.markers=r},l.prototype.elt=function(r,a){var c=this.i!=-1&&this.element.childNodes[this.i];c?this.i++:(c=document.createElement("div"),this.element.appendChild(c),this.i=-1),c.style.cssText=a,c.className=r},l.prototype.update=function(r){if(r){this.config=r,this.i=0;var a;for(var c in this.markers){var p=this.markers[c];if(!p.range){p.update(a,this,this.session,r);continue}var u=p.range.clipRows(r.firstRow,r.lastRow);if(!u.isEmpty())if(u=u.toScreenRange(this.session),p.renderer){var f=this.$getTop(u.start.row,r),g=this.$padding+u.start.column*r.characterWidth;p.renderer(a,u,g,f,r)}else p.type=="fullLine"?this.drawFullLineMarker(a,u,p.clazz,r):p.type=="screenLine"?this.drawScreenLineMarker(a,u,p.clazz,r):u.isMultiLine()?p.type=="text"?this.drawTextMarker(a,u,p.clazz,r):this.drawMultiLineMarker(a,u,p.clazz,r):this.drawSingleLineMarker(a,u,p.clazz+" ace_start ace_br15",r)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},l.prototype.$getTop=function(r,a){return(r-a.firstRowScreen)*a.lineHeight},l.prototype.drawTextMarker=function(r,a,c,p,u){for(var f=this.session,g=a.start.row,v=a.end.row,b=g,D=0,E=0,w=f.getScreenLastRowColumn(b),y=new i(b,a.start.column,b,E);b<=v;b++)y.start.row=y.end.row=b,y.start.column=b==g?a.start.column:f.getRowWrapIndent(b),y.end.column=w,D=E,E=w,w=b+1<v?f.getScreenLastRowColumn(b+1):b==v?0:a.end.column,this.drawSingleLineMarker(r,y,c+(b==g?" ace_start":"")+" ace_br"+o(b==g||b==g+1&&a.start.column,D<E,E>w,b==v),p,b==v?0:1,u)},l.prototype.drawMultiLineMarker=function(r,a,c,p,u){var f=this.$padding,g=p.lineHeight,v=this.$getTop(a.start.row,p),b=f+a.start.column*p.characterWidth;if(u=u||"",this.session.$bidiHandler.isBidiRow(a.start.row)){var D=a.clone();D.end.row=D.start.row,D.end.column=this.session.getLine(D.start.row).length,this.drawBidiSingleLineMarker(r,D,c+" ace_br1 ace_start",p,null,u)}else this.elt(c+" ace_br1 ace_start","height:"+g+"px;right:"+f+"px;top:"+v+"px;left:"+b+"px;"+(u||""));if(this.session.$bidiHandler.isBidiRow(a.end.row)){var D=a.clone();D.start.row=D.end.row,D.start.column=0,this.drawBidiSingleLineMarker(r,D,c+" ace_br12",p,null,u)}else{v=this.$getTop(a.end.row,p);var E=a.end.column*p.characterWidth;this.elt(c+" ace_br12","height:"+g+"px;width:"+E+"px;top:"+v+"px;left:"+f+"px;"+(u||""))}if(g=(a.end.row-a.start.row-1)*p.lineHeight,!(g<=0)){v=this.$getTop(a.start.row+1,p);var w=(a.start.column?1:0)|(a.end.column?0:8);this.elt(c+(w?" ace_br"+w:""),"height:"+g+"px;right:"+f+"px;top:"+v+"px;left:"+f+"px;"+(u||""))}},l.prototype.drawSingleLineMarker=function(r,a,c,p,u,f){if(this.session.$bidiHandler.isBidiRow(a.start.row))return this.drawBidiSingleLineMarker(r,a,c,p,u,f);var g=p.lineHeight,v=(a.end.column+(u||0)-a.start.column)*p.characterWidth,b=this.$getTop(a.start.row,p),D=this.$padding+a.start.column*p.characterWidth;this.elt(c,"height:"+g+"px;width:"+v+"px;top:"+b+"px;left:"+D+"px;"+(f||""))},l.prototype.drawBidiSingleLineMarker=function(r,a,c,p,u,f){var g=p.lineHeight,v=this.$getTop(a.start.row,p),b=this.$padding,D=this.session.$bidiHandler.getSelections(a.start.column,a.end.column);D.forEach(function(E){this.elt(c,"height:"+g+"px;width:"+(E.width+(u||0))+"px;top:"+v+"px;left:"+(b+E.left)+"px;"+(f||""))},this)},l.prototype.drawFullLineMarker=function(r,a,c,p,u){var f=this.$getTop(a.start.row,p),g=p.lineHeight;a.start.row!=a.end.row&&(g+=this.$getTop(a.end.row,p)-f),this.elt(c,"height:"+g+"px;top:"+f+"px;left:0;right:0;"+(u||""))},l.prototype.drawScreenLineMarker=function(r,a,c,p,u){var f=this.$getTop(a.start.row,p),g=p.lineHeight;this.elt(c,"height:"+g+"px;top:"+f+"px;left:0;right:0;"+(u||""))},l})();d.prototype.$padding=0;function o(l,r,a,c){return(l?1:0)|(r?2:0)|(a?4:0)|(c?8:0)}n.Marker=d}),ace.define("ace/layer/text_util",["require","exports","module"],function(t,n,h){var i=new Set(["text","rparen","lparen"]);n.isTextToken=function(s){return i.has(s)}}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(t,n,h){var i=t("../lib/oop"),s=t("../lib/dom"),d=t("../lib/lang"),o=t("./lines").Lines,l=t("../lib/event_emitter").EventEmitter,r=t("../config").nls,a=t("./text_util").isTextToken,c=(function(){function p(u){this.dom=s,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",u.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)}return p.prototype.$updateEolChar=function(){var u=this.session.doc,f=u.getNewLineCharacter()==`
224
- `&&u.getNewLineMode()!="windows",g=f?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=g)return this.EOL_CHAR=g,!0},p.prototype.setPadding=function(u){this.$padding=u,this.element.style.margin="0 "+u+"px"},p.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},p.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},p.prototype.$setFontMetrics=function(u){this.$fontMetrics=u,this.$fontMetrics.on("changeCharacterSize",function(f){this._signal("changeCharacterSize",f)}.bind(this)),this.$pollSizeChanges()},p.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},p.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},p.prototype.setSession=function(u){this.session=u,u&&this.$computeTabString()},p.prototype.setShowInvisibles=function(u){return this.showInvisibles==u?!1:(this.showInvisibles=u,typeof u=="string"?(this.showSpaces=/tab/i.test(u),this.showTabs=/space/i.test(u),this.showEOL=/eol/i.test(u)):this.showSpaces=this.showTabs=this.showEOL=u,this.$computeTabString(),!0)},p.prototype.setDisplayIndentGuides=function(u){return this.displayIndentGuides==u?!1:(this.displayIndentGuides=u,this.$computeTabString(),!0)},p.prototype.setHighlightIndentGuides=function(u){return this.$highlightIndentGuides===u?!1:(this.$highlightIndentGuides=u,u)},p.prototype.$computeTabString=function(){var u=this.session.getTabSize();this.tabSize=u;for(var f=this.$tabStrings=[0],g=1;g<u+1;g++)if(this.showTabs){var v=this.dom.createElement("span");v.className="ace_invisible ace_invisible_tab",v.textContent=d.stringRepeat(this.TAB_CHAR,g),f.push(v)}else f.push(this.dom.createTextNode(d.stringRepeat(" ",g),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var b="ace_indent-guide",D=this.showSpaces?" ace_invisible ace_invisible_space":"",E=this.showSpaces?d.stringRepeat(this.SPACE_CHAR,this.tabSize):d.stringRepeat(" ",this.tabSize),w=this.showTabs?" ace_invisible ace_invisible_tab":"",y=this.showTabs?d.stringRepeat(this.TAB_CHAR,this.tabSize):E,v=this.dom.createElement("span");v.className=b+D,v.textContent=E,this.$tabStrings[" "]=v;var v=this.dom.createElement("span");v.className=b+w,v.textContent=y,this.$tabStrings[" "]=v}},p.prototype.updateLines=function(u,f,g){if(this.config.lastRow!=u.lastRow||this.config.firstRow!=u.firstRow)return this.update(u);this.config=u;for(var v=Math.max(f,u.firstRow),b=Math.min(g,u.lastRow),D=this.element.childNodes,E=0,y=u.firstRow;y<v;y++){var A=this.session.getFoldLine(y);if(A)if(A.containsRow(v)){v=A.start.row;break}else y=A.end.row;E++}for(var w=!1,y=v,A=this.session.getNextFoldLine(y),T=A?A.start.row:1/0;y>T&&(y=A.end.row+1,A=this.session.getNextFoldLine(y,A),T=A?A.start.row:1/0),!(y>b);){var x=D[E++];if(x){this.dom.removeChildren(x),this.$renderLine(x,y,y==T?A:!1),w&&(x.style.top=this.$lines.computeLineTop(y,u,this.session)+"px");var M=u.lineHeight*this.session.getRowLength(y)+"px";x.style.height!=M&&(w=!0,x.style.height=M)}y++}if(w)for(;E<this.$lines.cells.length;){var O=this.$lines.cells[E++];O.element.style.top=this.$lines.computeLineTop(O.row,u,this.session)+"px"}},p.prototype.scrollLines=function(u){var f=this.config;if(this.config=u,this.$lines.pageChanged(f,u))return this.update(u);this.$lines.moveContainer(u);var g=u.lastRow,v=f?f.lastRow:-1;if(!f||v<u.firstRow)return this.update(u);if(g<f.firstRow)return this.update(u);if(!f||f.lastRow<u.firstRow)return this.update(u);if(u.lastRow<f.firstRow)return this.update(u);if(f.firstRow<u.firstRow)for(var b=this.session.getFoldedRowCount(f.firstRow,u.firstRow-1);b>0;b--)this.$lines.shift();if(f.lastRow>u.lastRow)for(var b=this.session.getFoldedRowCount(u.lastRow+1,f.lastRow);b>0;b--)this.$lines.pop();u.firstRow<f.firstRow&&this.$lines.unshift(this.$renderLinesFragment(u,u.firstRow,f.firstRow-1)),u.lastRow>f.lastRow&&this.$lines.push(this.$renderLinesFragment(u,f.lastRow+1,u.lastRow)),this.$highlightIndentGuide()},p.prototype.$renderLinesFragment=function(u,f,g){for(var v=[],b=f,D=this.session.getNextFoldLine(b),E=D?D.start.row:1/0;b>E&&(b=D.end.row+1,D=this.session.getNextFoldLine(b,D),E=D?D.start.row:1/0),!(b>g);){var w=this.$lines.createCell(b,u,this.session),y=w.element;this.dom.removeChildren(y),s.setStyle(y.style,"height",this.$lines.computeLineHeight(b,u,this.session)+"px"),s.setStyle(y.style,"top",this.$lines.computeLineTop(b,u,this.session)+"px"),this.$renderLine(y,b,b==E?D:!1),this.$useLineGroups()?y.className="ace_line_group":y.className="ace_line",v.push(w),b++}return v},p.prototype.update=function(u){this.$lines.moveContainer(u),this.config=u;for(var f=u.firstRow,g=u.lastRow,v=this.$lines;v.getLength();)v.pop();v.push(this.$renderLinesFragment(u,f,g))},p.prototype.$renderToken=function(u,f,g,v){for(var b=this,D=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,E=this.dom.createFragment(this.element),w,y=0;w=D.exec(v);){var A=w[1],T=w[2],x=w[3],M=w[4],O=w[5];if(!(!b.showSpaces&&T)){var _=y!=w.index?v.slice(y,w.index):"";if(y=w.index+w[0].length,_&&E.appendChild(this.dom.createTextNode(_,this.element)),A){var k=b.session.getScreenTabSize(f+w.index),S=b.$tabStrings[k].cloneNode(!0);S.charCount=1,E.appendChild(S),f+=k-1}else if(T)if(b.showSpaces){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space",C.textContent=d.stringRepeat(b.SPACE_CHAR,T.length),E.appendChild(C)}else E.appendChild(this.dom.createTextNode(T,this.element));else if(x){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space ace_invalid",C.textContent=d.stringRepeat(b.SPACE_CHAR,x.length),E.appendChild(C)}else if(M){f+=1;var C=this.dom.createElement("span");C.style.width=b.config.characterWidth*2+"px",C.className=b.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",C.textContent=b.showSpaces?b.SPACE_CHAR:M,E.appendChild(C)}else if(O){f+=1;var C=this.dom.createElement("span");C.style.width=b.config.characterWidth*2+"px",C.className="ace_cjk",C.textContent=O,E.appendChild(C)}}}if(E.appendChild(this.dom.createTextNode(y?v.slice(y):v,this.element)),a(g.type))u.appendChild(E);else{var L="ace_"+g.type.replace(/\./g," ace_"),C=this.dom.createElement("span");g.type=="fold"&&(C.style.width=g.value.length*this.config.characterWidth+"px",C.setAttribute("title",r("inline-fold.closed.title","Unfold code"))),C.className=L,C.appendChild(E),u.appendChild(C)}return f+v.length},p.prototype.renderIndentGuide=function(u,f,g){var v=f.search(this.$indentGuideRe);if(v<=0||v>=g)return f;if(f[0]==" "){v-=v%this.tabSize;for(var b=v/this.tabSize,D=0;D<b;D++)u.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),f.substr(v)}else if(f[0]==" "){for(var D=0;D<v;D++)u.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),f.substr(v)}return this.$highlightIndentGuide(),f},p.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var u=this.session.doc.$lines;if(u){var f=this.session.selection.getCursor(),g=/^\s*/.exec(this.session.doc.getLine(f.row))[0].length,v=Math.floor(g/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:v,start:f.row};var b=this.session.$bracketHighlight;if(b){for(var D=this.session.$bracketHighlight.ranges,E=0;E<D.length;E++)if(f.row!==D[E].start.row){this.$highlightIndentGuideMarker.end=D[E].start.row+1,f.row>D[E].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&u[f.row]!==""&&f.column===u[f.row].length){this.$highlightIndentGuideMarker.dir=1;for(var E=f.row+1;E<u.length;E++){var w=u[E],y=/^\s*/.exec(w)[0].length;if(w!==""&&(this.$highlightIndentGuideMarker.end=E,y<=g))break}}this.$renderHighlightIndentGuide()}}},p.prototype.$clearActiveIndentGuide=function(){for(var u=this.element.querySelectorAll(".ace_indent-guide-active"),f=0;f<u.length;f++)u[f].classList.remove("ace_indent-guide-active")},p.prototype.$setIndentGuideActive=function(u,f){var g=this.session.doc.getLine(u.row);if(g!==""){var v=u.element;if(u.element.classList&&u.element.classList.contains("ace_line_group"))if(u.element.childNodes.length>0)v=u.element.childNodes[0];else return;var b=v.childNodes;if(b){var D=b[f-1];D&&D.classList&&D.classList.contains("ace_indent-guide")&&D.classList.add("ace_indent-guide-active")}}},p.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var u=this.$lines.cells;this.$clearActiveIndentGuide();var f=this.$highlightIndentGuideMarker.indentLevel;if(f!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var g=0;g<u.length;g++){var v=u[g];if(this.$highlightIndentGuideMarker.end&&v.row>=this.$highlightIndentGuideMarker.start+1){if(v.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(v,f)}}else for(var g=u.length-1;g>=0;g--){var v=u[g];if(this.$highlightIndentGuideMarker.end&&v.row<this.$highlightIndentGuideMarker.start){if(v.row<this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(v,f)}}}},p.prototype.$createLineElement=function(u){var f=this.dom.createElement("div");return f.className="ace_line",f.style.height=this.config.lineHeight+"px",f},p.prototype.$renderWrappedLine=function(u,f,g){var v=0,b=0,D=g[0],E=0,w=this.$createLineElement();u.appendChild(w);for(var y=0;y<f.length;y++){var A=f[y],T=A.value;if(y==0&&this.displayIndentGuides){if(v=T.length,T=this.renderIndentGuide(w,T,D),!T)continue;v-=T.length}if(v+T.length<D)E=this.$renderToken(w,E,A,T),v+=T.length;else{for(;v+T.length>=D;){E=this.$renderToken(w,E,A,T.substring(0,D-v)),T=T.substring(D-v),v=D,w=this.$createLineElement(),u.appendChild(w);var x=this.dom.createTextNode(d.stringRepeat(" ",g.indent),this.element);x.charCount=0,w.appendChild(x),b++,E=0,D=g[b]||Number.MAX_VALUE}T.length!=0&&(v+=T.length,E=this.$renderToken(w,E,A,T))}}g[g.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(w,E,null,"",!0)},p.prototype.$renderSimpleLine=function(u,f){for(var g=0,v=0;v<f.length;v++){var b=f[v],D=b.value;if(!(v==0&&this.displayIndentGuides&&(D=this.renderIndentGuide(u,D),!D))){if(g+D.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(u,g,b,D);g=this.$renderToken(u,g,b,D)}}},p.prototype.$renderOverflowMessage=function(u,f,g,v,b){g&&this.$renderToken(u,f,g,v.slice(0,this.MAX_LINE_LENGTH-f));var D=this.dom.createElement("span");D.className="ace_inline_button ace_keyword ace_toggle_wrap",D.textContent=b?"<hide>":"<click to see more...>",u.appendChild(D)},p.prototype.$renderLine=function(u,f,g){if(!g&&g!=!1&&(g=this.session.getFoldLine(f)),g)var v=this.$getFoldLineTokens(f,g);else var v=this.session.getTokens(f);var b=u;if(v.length){var D=this.session.getRowSplitData(f);if(D&&D.length){this.$renderWrappedLine(u,v,D);var b=u.lastChild}else{var b=u;this.$useLineGroups()&&(b=this.$createLineElement(),u.appendChild(b)),this.$renderSimpleLine(b,v)}}else this.$useLineGroups()&&(b=this.$createLineElement(),u.appendChild(b));if(this.showEOL&&b){g&&(f=g.end.row);var E=this.dom.createElement("span");E.className="ace_invisible ace_invisible_eol",E.textContent=f==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,b.appendChild(E)}},p.prototype.$getFoldLineTokens=function(u,f){var g=this.session,v=[];function b(E,w,y){for(var A=0,T=0;T+E[A].value.length<w;)if(T+=E[A].value.length,A++,A==E.length)return;if(T!=w){var x=E[A].value.substring(w-T);x.length>y-w&&(x=x.substring(0,y-w)),v.push({type:E[A].type,value:x}),T=w+x.length,A+=1}for(;T<y&&A<E.length;){var x=E[A].value;x.length+T>y?v.push({type:E[A].type,value:x.substring(0,y-T)}):v.push(E[A]),T+=x.length,A+=1}}var D=g.getTokens(u);return f.walk(function(E,w,y,A,T){E!=null?v.push({type:"fold",value:E}):(T&&(D=g.getTokens(w)),D.length&&b(D,A,y))},f.end.row,this.session.getLine(f.end.row).length),v},p.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},p})();c.prototype.EOF_CHAR="¶",c.prototype.EOL_CHAR_LF="¬",c.prototype.EOL_CHAR_CRLF="¤",c.prototype.EOL_CHAR=c.prototype.EOL_CHAR_LF,c.prototype.TAB_CHAR="—",c.prototype.SPACE_CHAR="·",c.prototype.$padding=0,c.prototype.MAX_LINE_LENGTH=1e4,c.prototype.showInvisibles=!1,c.prototype.showSpaces=!1,c.prototype.showTabs=!1,c.prototype.showEOL=!1,c.prototype.displayIndentGuides=!0,c.prototype.$highlightIndentGuides=!0,c.prototype.$tabStrings=[],c.prototype.destroy={},c.prototype.onChangeTabSize=c.prototype.$computeTabString,i.implement(c.prototype,l),n.Text=c}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,n,h){var i=t("../lib/dom"),s=(function(){function d(o){this.element=i.createElement("div"),this.element.className="ace_layer ace_cursor-layer",o.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),i.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return d.prototype.$updateOpacity=function(o){for(var l=this.cursors,r=l.length;r--;)i.setStyle(l[r].style,"opacity",o?"":"0")},d.prototype.$startCssAnimation=function(){for(var o=this.cursors,l=o.length;l--;)o[l].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&i.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},d.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,i.removeCssClass(this.element,"ace_animate-blinking")},d.prototype.setPadding=function(o){this.$padding=o},d.prototype.setSession=function(o){this.session=o},d.prototype.setBlinking=function(o){o!=this.isBlinking&&(this.isBlinking=o,this.restartTimer())},d.prototype.setBlinkInterval=function(o){o!=this.blinkInterval&&(this.blinkInterval=o,this.restartTimer())},d.prototype.setSmoothBlinking=function(o){o!=this.smoothBlinking&&(this.smoothBlinking=o,i.setCssClass(this.element,"ace_smooth-blinking",o),this.$updateCursors(!0),this.restartTimer())},d.prototype.addCursor=function(){var o=i.createElement("div");return o.className="ace_cursor",this.element.appendChild(o),this.cursors.push(o),o},d.prototype.removeCursor=function(){if(this.cursors.length>1){var o=this.cursors.pop();return o.parentNode.removeChild(o),o}},d.prototype.hideCursor=function(){this.isVisible=!1,i.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},d.prototype.showCursor=function(){this.isVisible=!0,i.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},d.prototype.restartTimer=function(){var o=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,i.removeCssClass(this.element,"ace_smooth-blinking")),o(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&i.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),i.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var l=function(){this.timeoutId=setTimeout(function(){o(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){o(!0),l()},this.blinkInterval),l()}},d.prototype.getPixelPosition=function(o,l){if(!this.config||!this.session)return{left:0,top:0};o||(o=this.session.selection.getCursor());var r=this.session.documentToScreenPosition(o),a=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,o.row)?this.session.$bidiHandler.getPosLeft(r.column):r.column*this.config.characterWidth),c=(r.row-(l?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:a,top:c}},d.prototype.isCursorInView=function(o,l){return o.top>=0&&o.top<l.maxHeight},d.prototype.update=function(o){this.config=o;var l=this.session.$selectionMarkers,r=0,a=0;(l===void 0||l.length===0)&&(l=[{cursor:null}]);for(var r=0,c=l.length;r<c;r++){var p=this.getPixelPosition(l[r].cursor,!0);if(!((p.top>o.height+o.offset||p.top<0)&&r>1)){var u=this.cursors[a++]||this.addCursor(),f=u.style;this.drawCursor?this.drawCursor(u,p,o,l[r],this.session):this.isCursorInView(p,o)?(i.setStyle(f,"display","block"),i.translate(u,p.left,p.top),i.setStyle(f,"width",Math.round(o.characterWidth)+"px"),i.setStyle(f,"height",o.lineHeight+"px")):i.setStyle(f,"display","none")}}for(;this.cursors.length>a;)this.removeCursor();var g=this.session.getOverwrite();this.$setOverwrite(g),this.$pixelPos=p,this.restartTimer()},d.prototype.$setOverwrite=function(o){o!=this.overwrite&&(this.overwrite=o,o?i.addCssClass(this.element,"ace_overwrite-cursors"):i.removeCssClass(this.element,"ace_overwrite-cursors"))},d.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},d})();s.prototype.$padding=0,s.prototype.drawCursor=null,n.Cursor=s}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,h){var i=this&&this.__extends||(function(){var u=function(f,g){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,b){v.__proto__=b}||function(v,b){for(var D in b)Object.prototype.hasOwnProperty.call(b,D)&&(v[D]=b[D])},u(f,g)};return function(f,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");u(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})(),s=t("./lib/oop"),d=t("./lib/dom"),o=t("./lib/event"),l=t("./lib/event_emitter").EventEmitter,r=32768,a=(function(){function u(f,g){this.element=d.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+g,this.inner=d.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),f.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addListener(this.element,"scroll",this.onScroll.bind(this)),o.addListener(this.element,"mousedown",o.preventDefault)}return u.prototype.setVisible=function(f){this.element.style.display=f?"":"none",this.isVisible=f,this.coeff=1},u})();s.implement(a.prototype,l);var c=(function(u){i(f,u);function f(g,v){var b=u.call(this,g,"-v")||this;return b.scrollTop=0,b.scrollHeight=0,v.$scrollbarWidth=b.width=d.scrollbarWidth(g.ownerDocument),b.inner.style.width=b.element.style.width=(b.width||15)+5+"px",b.$minWidth=0,b}return f.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var g=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-g)/(this.coeff-g)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},f.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},f.prototype.setHeight=function(g){this.element.style.height=g+"px"},f.prototype.setScrollHeight=function(g){this.scrollHeight=g,g>r?(this.coeff=r/g,g=r):this.coeff!=1&&(this.coeff=1),this.inner.style.height=g+"px"},f.prototype.setScrollTop=function(g){this.scrollTop!=g&&(this.skipEvent=!0,this.scrollTop=g,this.element.scrollTop=g*this.coeff)},f})(a);c.prototype.setInnerHeight=c.prototype.setScrollHeight;var p=(function(u){i(f,u);function f(g,v){var b=u.call(this,g,"-h")||this;return b.scrollLeft=0,b.height=v.$scrollbarWidth,b.inner.style.height=b.element.style.height=(b.height||15)+5+"px",b}return f.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},f.prototype.getHeight=function(){return this.isVisible?this.height:0},f.prototype.setWidth=function(g){this.element.style.width=g+"px"},f.prototype.setInnerWidth=function(g){this.inner.style.width=g+"px"},f.prototype.setScrollWidth=function(g){this.inner.style.width=g+"px"},f.prototype.setScrollLeft=function(g){this.scrollLeft!=g&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=g)},f})(a);n.ScrollBar=c,n.ScrollBarV=c,n.ScrollBarH=p,n.VScrollBar=c,n.HScrollBar=p}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,h){var i=this&&this.__extends||(function(){var p=function(u,f){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,v){g.__proto__=v}||function(g,v){for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(g[b]=v[b])},p(u,f)};return function(u,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");p(u,f);function g(){this.constructor=u}u.prototype=f===null?Object.create(f):(g.prototype=f.prototype,new g)}})(),s=t("./lib/oop"),d=t("./lib/dom"),o=t("./lib/event"),l=t("./lib/event_emitter").EventEmitter;d.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
225
- position: absolute;
226
- background: rgba(128, 128, 128, 0.6);
227
- -moz-box-sizing: border-box;
228
- box-sizing: border-box;
229
- border: 1px solid #bbb;
230
- border-radius: 2px;
231
- z-index: 8;
232
- }
233
- .ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {
234
- position: absolute;
235
- z-index: 6;
236
- background: none;
237
- overflow: hidden!important;
238
- }
239
- .ace_editor>.ace_sb-v {
240
- z-index: 6;
241
- right: 0;
242
- top: 0;
243
- width: 12px;
244
- }
245
- .ace_editor>.ace_sb-v div {
246
- z-index: 8;
247
- right: 0;
248
- width: 100%;
249
- }
250
- .ace_editor>.ace_sb-h {
251
- bottom: 0;
252
- left: 0;
253
- height: 12px;
254
- }
255
- .ace_editor>.ace_sb-h div {
256
- bottom: 0;
257
- height: 100%;
258
- }
259
- .ace_editor>.ace_sb_grabbed {
260
- z-index: 8;
261
- background: #000;
262
- }`,"ace_scrollbar.css",!1);var r=(function(){function p(u,f){this.element=d.createElement("div"),this.element.className="ace_sb"+f,this.inner=d.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,u.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return p.prototype.setVisible=function(u){this.element.style.display=u?"":"none",this.isVisible=u,this.coeff=1},p})();s.implement(r.prototype,l);var a=(function(p){i(u,p);function u(f,g){var v=p.call(this,f,"-v")||this;return v.scrollTop=0,v.scrollHeight=0,v.parent=f,v.width=v.VScrollWidth,v.renderer=g,v.inner.style.width=v.element.style.width=(v.width||15)+"px",v.$minWidth=0,v}return u.prototype.onMouseDown=function(f,g){if(f==="mousedown"&&!(o.getButton(g)!==0||g.detail===2)){if(g.target===this.inner){var v=this,b=g.clientY,D=function(M){b=M.clientY},E=function(){clearInterval(T)},w=g.clientY,y=this.thumbTop,A=function(){if(b!==void 0){var M=v.scrollTopFromThumbTop(y+b-w);M!==v.scrollTop&&v._emit("scroll",{data:M})}};o.capture(this.inner,D,E);var T=setInterval(A,20);return o.preventDefault(g)}var x=g.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(x)}),o.preventDefault(g)}},u.prototype.getHeight=function(){return this.height},u.prototype.scrollTopFromThumbTop=function(f){var g=f*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return g=g>>0,g<0?g=0:g>this.pageHeight-this.viewHeight&&(g=this.pageHeight-this.viewHeight),g},u.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},u.prototype.setHeight=function(f){this.height=Math.max(0,f),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},u.prototype.setScrollHeight=function(f,g){this.pageHeight===f&&!g||(this.pageHeight=f,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},u.prototype.setScrollTop=function(f){this.scrollTop=f,f<0&&(f=0),this.thumbTop=f*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},u})(r);a.prototype.setInnerHeight=a.prototype.setScrollHeight;var c=(function(p){i(u,p);function u(f,g){var v=p.call(this,f,"-h")||this;return v.scrollLeft=0,v.scrollWidth=0,v.height=v.HScrollHeight,v.inner.style.height=v.element.style.height=(v.height||12)+"px",v.renderer=g,v}return u.prototype.onMouseDown=function(f,g){if(f==="mousedown"&&!(o.getButton(g)!==0||g.detail===2)){if(g.target===this.inner){var v=this,b=g.clientX,D=function(M){b=M.clientX},E=function(){clearInterval(T)},w=g.clientX,y=this.thumbLeft,A=function(){if(b!==void 0){var M=v.scrollLeftFromThumbLeft(y+b-w);M!==v.scrollLeft&&v._emit("scroll",{data:M})}};o.capture(this.inner,D,E);var T=setInterval(A,20);return o.preventDefault(g)}var x=g.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(x)}),o.preventDefault(g)}},u.prototype.getHeight=function(){return this.isVisible?this.height:0},u.prototype.scrollLeftFromThumbLeft=function(f){var g=f*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return g=g>>0,g<0?g=0:g>this.pageWidth-this.viewWidth&&(g=this.pageWidth-this.viewWidth),g},u.prototype.setWidth=function(f){this.width=Math.max(0,f),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},u.prototype.setScrollWidth=function(f,g){this.pageWidth===f&&!g||(this.pageWidth=f,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},u.prototype.setScrollLeft=function(f){this.scrollLeft=f,f<0&&(f=0),this.thumbLeft=f*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},u})(r);c.prototype.setInnerWidth=c.prototype.setScrollWidth,n.ScrollBar=a,n.ScrollBarV=a,n.ScrollBarH=c,n.VScrollBar=a,n.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,n,h){var i=t("./lib/event"),s=(function(){function d(o,l){this.onRender=o,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=l||window;var r=this;this._flush=function(a){r.pending=!1;var c=r.changes;if(c&&(i.blockIdle(100),r.changes=0,r.onRender(c)),r.changes){if(r.$recursionLimit--<0)return;r.schedule()}else r.$recursionLimit=2}}return d.prototype.schedule=function(o){this.changes=this.changes|o,this.changes&&!this.pending&&(i.nextFrame(this._flush),this.pending=!0)},d.prototype.clear=function(o){var l=this.changes;return this.changes=0,l},d})();n.RenderLoop=s}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(t,n,h){var i=t("../lib/oop"),s=t("../lib/dom"),d=t("../lib/lang"),o=t("../lib/event"),l=t("../lib/useragent"),r=t("../lib/event_emitter").EventEmitter,a=512,c=typeof ResizeObserver=="function",p=200,u=(function(){function f(g){this.el=s.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=s.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=s.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),g.appendChild(this.el),this.$measureNode.textContent=d.stringRepeat("X",a),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()}return f.prototype.$setMeasureNodeStyles=function(g,v){g.width=g.height="auto",g.left=g.top="0px",g.visibility="hidden",g.position="absolute",g.whiteSpace="pre",l.isIE<8?g["font-family"]="inherit":g.font="inherit",g.overflow=v?"hidden":"visible"},f.prototype.checkForSizeChanges=function(g){if(g===void 0&&(g=this.$measureSizes()),g&&(this.$characterSize.width!==g.width||this.$characterSize.height!==g.height)){this.$measureNode.style.fontWeight="bold";var v=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=g,this.charSizes=Object.create(null),this.allowBoldFonts=v&&v.width===g.width&&v.height===g.height,this._emit("changeCharacterSize",{data:g})}},f.prototype.$addObserver=function(){var g=this;this.$observer=new window.ResizeObserver(function(v){g.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},f.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var g=this;return this.$pollSizeChangesTimer=o.onIdle(function v(){g.checkForSizeChanges(),o.onIdle(v,500)},500)},f.prototype.setPolling=function(g){g?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},f.prototype.$measureSizes=function(g){var v={height:(g||this.$measureNode).clientHeight,width:(g||this.$measureNode).clientWidth/a};return v.width===0||v.height===0?null:v},f.prototype.$measureCharWidth=function(g){this.$main.textContent=d.stringRepeat(g,a);var v=this.$main.getBoundingClientRect();return v.width/a},f.prototype.getCharacterWidth=function(g){var v=this.charSizes[g];return v===void 0&&(v=this.charSizes[g]=this.$measureCharWidth(g)/this.$characterSize.width),v},f.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},f.prototype.$getZoom=function(g){return!g||!g.parentElement?1:(Number(window.getComputedStyle(g).zoom)||1)*this.$getZoom(g.parentElement)},f.prototype.$initTransformMeasureNodes=function(){var g=function(v,b){return["div",{style:"position: absolute;top:"+v+"px;left:"+b+"px;"}]};this.els=s.buildDom([g(0,0),g(p,0),g(0,p),g(p,p)],this.el)},f.prototype.transformCoordinates=function(g,v){if(g){var b=this.$getZoom(this.el);g=y(1/b,g)}function D(B,N,z){var W=B[1]*N[0]-B[0]*N[1];return[(-N[1]*z[0]+N[0]*z[1])/W,(+B[1]*z[0]-B[0]*z[1])/W]}function E(B,N){return[B[0]-N[0],B[1]-N[1]]}function w(B,N){return[B[0]+N[0],B[1]+N[1]]}function y(B,N){return[B*N[0],B*N[1]]}this.els||this.$initTransformMeasureNodes();function A(B){var N=B.getBoundingClientRect();return[N.left,N.top]}var T=A(this.els[0]),x=A(this.els[1]),M=A(this.els[2]),O=A(this.els[3]),_=D(E(O,x),E(O,M),E(w(x,M),w(O,T))),k=y(1+_[0],E(x,T)),S=y(1+_[1],E(M,T));if(v){var C=v,L=_[0]*C[0]/p+_[1]*C[1]/p+1,I=w(y(C[0],k),y(C[1],S));return w(y(1/L/p,I),T)}var F=E(g,T),R=D(E(k,y(_[0],F)),E(S,y(_[1],F)),F);return y(p,R)},f})();u.prototype.$characterSize={width:0,height:0},i.implement(u.prototype,r),n.FontMetrics=u}),ace.define("ace/css/editor-css",["require","exports","module"],function(t,n,h){h.exports=`
263
- .ace_br1 {border-top-left-radius : 3px;}
264
- .ace_br2 {border-top-right-radius : 3px;}
265
- .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
266
- .ace_br4 {border-bottom-right-radius: 3px;}
267
- .ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}
268
- .ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}
269
- .ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}
270
- .ace_br8 {border-bottom-left-radius : 3px;}
271
- .ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}
272
- .ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}
273
- .ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}
274
- .ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
275
- .ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
276
- .ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
277
- .ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
278
-
279
-
280
- .ace_editor {
281
- position: relative;
282
- overflow: hidden;
283
- padding: 0;
284
- font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;
285
- direction: ltr;
286
- text-align: left;
287
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
288
- forced-color-adjust: none;
289
- }
290
-
291
- .ace_scroller {
292
- position: absolute;
293
- overflow: hidden;
294
- top: 0;
295
- bottom: 0;
296
- background-color: inherit;
297
- -ms-user-select: none;
298
- -moz-user-select: none;
299
- -webkit-user-select: none;
300
- user-select: none;
301
- cursor: text;
302
- }
303
-
304
- .ace_content {
305
- position: absolute;
306
- box-sizing: border-box;
307
- min-width: 100%;
308
- contain: style size layout;
309
- font-variant-ligatures: no-common-ligatures;
310
- }
311
- .ace_invisible {
312
- font-variant-ligatures: none;
313
- }
314
-
315
- .ace_keyboard-focus:focus {
316
- box-shadow: inset 0 0 0 2px #5E9ED6;
317
- outline: none;
318
- }
319
-
320
- .ace_dragging .ace_scroller:before{
321
- position: absolute;
322
- top: 0;
323
- left: 0;
324
- right: 0;
325
- bottom: 0;
326
- content: '';
327
- background: rgba(250, 250, 250, 0.01);
328
- z-index: 1000;
329
- }
330
- .ace_dragging.ace_dark .ace_scroller:before{
331
- background: rgba(0, 0, 0, 0.01);
332
- }
333
-
334
- .ace_gutter {
335
- position: absolute;
336
- overflow : hidden;
337
- width: auto;
338
- top: 0;
339
- bottom: 0;
340
- left: 0;
341
- cursor: default;
342
- z-index: 4;
343
- -ms-user-select: none;
344
- -moz-user-select: none;
345
- -webkit-user-select: none;
346
- user-select: none;
347
- contain: style size layout;
348
- }
349
-
350
- .ace_gutter-active-line {
351
- position: absolute;
352
- left: 0;
353
- right: 0;
354
- }
355
-
356
- .ace_scroller.ace_scroll-left:after {
357
- content: "";
358
- position: absolute;
359
- top: 0;
360
- right: 0;
361
- bottom: 0;
362
- left: 0;
363
- box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
364
- pointer-events: none;
365
- }
366
-
367
- .ace_gutter-cell, .ace_gutter-cell_svg-icons {
368
- position: absolute;
369
- top: 0;
370
- left: 0;
371
- right: 0;
372
- padding-left: 19px;
373
- padding-right: 6px;
374
- background-repeat: no-repeat;
375
- }
376
-
377
- .ace_gutter-cell_svg-icons .ace_gutter_annotation {
378
- margin-left: -14px;
379
- float: left;
380
- }
381
-
382
- .ace_gutter-cell .ace_gutter_annotation {
383
- margin-left: -19px;
384
- float: left;
385
- }
386
-
387
- .ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold, .ace_gutter-cell.ace_security, .ace_icon.ace_security, .ace_icon.ace_security_fold {
388
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");
389
- background-repeat: no-repeat;
390
- background-position: 2px center;
391
- }
392
-
393
- .ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {
394
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");
395
- background-repeat: no-repeat;
396
- background-position: 2px center;
397
- }
398
-
399
- .ace_gutter-cell.ace_info, .ace_icon.ace_info, .ace_gutter-cell.ace_hint, .ace_icon.ace_hint {
400
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");
401
- background-repeat: no-repeat;
402
- background-position: 2px center;
403
- }
404
-
405
- .ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info, .ace_dark .ace_gutter-cell.ace_hint, .ace_dark .ace_icon.ace_hint {
406
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");
407
- }
408
-
409
- .ace_icon_svg.ace_error {
410
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");
411
- background-color: crimson;
412
- }
413
- .ace_icon_svg.ace_security {
414
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iZGFya29yYW5nZSIgZmlsbD0ibm9uZSIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogICAgICAgIDxwYXRoIGNsYXNzPSJzdHJva2UtbGluZWpvaW4tcm91bmQiIGQ9Ik04IDE0LjgzMDdDOCAxNC44MzA3IDIgMTIuOTA0NyAyIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOEM3Ljk4OTk5IDEuMzQ5MTggMTAuNjkgMy4yNjU0OCAxNCAzLjI2NTQ4VjguMDg5OTJDMTQgMTIuOTA0NyA4IDE0LjgzMDcgOCAxNC44MzA3WiIvPgogICAgICAgIDxwYXRoIGQ9Ik0yIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOCIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMy45OSA4LjA4OTkyVjMuMjY1NDhDMTAuNjggMy4yNjU0OCA4IDEuMzQ5MTggOCAxLjM0OTE4Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggNFY5Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggMTBWMTIiLz4KICAgIDwvZz4KPC9zdmc+");
415
- background-color: crimson;
416
- }
417
- .ace_icon_svg.ace_warning {
418
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");
419
- background-color: darkorange;
420
- }
421
- .ace_icon_svg.ace_info {
422
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");
423
- background-color: royalblue;
424
- }
425
- .ace_icon_svg.ace_hint {
426
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0ic2lsdmVyIiBmaWxsPSJub25lIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTYgMTRIMTAiLz4KICAgICAgICA8cGF0aCBkPSJNOCAxMUg5QzkgOS40NzAwMiAxMiA4LjU0MDAyIDEyIDUuNzYwMDJDMTIuMDIgNC40MDAwMiAxMS4zOSAzLjM2MDAyIDEwLjQzIDIuNjcwMDJDOSAxLjY0MDAyIDcuMDAwMDEgMS42NDAwMiA1LjU3MDAxIDIuNjcwMDJDNC42MTAwMSAzLjM2MDAyIDMuOTggNC40MDAwMiA0IDUuNzYwMDJDNCA4LjU0MDAyIDcuMDAwMDEgOS40NzAwMiA3LjAwMDAxIDExSDhaIi8+CiAgICA8L2c+Cjwvc3ZnPg==");
427
- background-color: silver;
428
- }
429
-
430
- .ace_icon_svg.ace_error_fold {
431
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
432
- background-color: crimson;
433
- }
434
- .ace_icon_svg.ace_security_fold {
435
- -webkit-mask-image: url("data:image/svg+xml;base64,CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTcgMTQiIGZpbGw9Im5vbmUiPgogICAgPHBhdGggZD0iTTEwLjAwMDEgMTMuNjk5MkMxMC4wMDAxIDEzLjY5OTIgMTEuOTI0MSAxMy40NzYzIDEzIDEyLjY5OTJDMTQuNDEzOSAxMS42NzgxIDE2IDEwLjUgMTYuMTI1MSA2LjgxMTI2VjIuNTg5ODdDMTYuMTI1MSAyLjU0NzY4IDE2LjEyMjEgMi41MDYxOSAxNi4xMTY0IDIuNDY1NTlWMS43MTQ4NUgxNS4yNDE0TDE1LjIzMDcgMS43MTQ4NEwxNC42MjUxIDEuNjk5MjJWNi44MTEyM0MxNC42MjUxIDguNTEwNjEgMTQuNjI1MSA5LjQ2NDYxIDEyLjc4MjQgMTEuNzIxQzEyLjE1ODYgMTIuNDg0OCAxMC4wMDAxIDEzLjY5OTIgMTAuMDAwMSAxMy42OTkyWiIgZmlsbD0iY3JpbXNvbiIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuMzM2MDkgMC4zNjc0NzVDNy4wMzIxNCAwLjE1MjY1MiA2LjYyNTQ4IDAuMTUzNjE0IDYuMzIyNTMgMC4zNjk5OTdMNi4zMDg2OSAwLjM3OTU1NEM2LjI5NTUzIDAuMzg4NTg4IDYuMjczODggMC40MDMyNjYgNi4yNDQxNyAwLjQyMjc4OUM2LjE4NDcxIDAuNDYxODYgNi4wOTMyMSAwLjUyMDE3MSA1Ljk3MzEzIDAuNTkxMzczQzUuNzMyNTEgMC43MzQwNTkgNS4zNzk5IDAuOTI2ODY0IDQuOTQyNzkgMS4xMjAwOUM0LjA2MTQ0IDEuNTA5NyAyLjg3NTQxIDEuODgzNzcgMS41ODk4NCAxLjg4Mzc3SDAuNzE0ODQ0VjIuNzU4NzdWNi45ODAxNUMwLjcxNDg0NCA5LjQ5Mzc0IDIuMjg4NjYgMTEuMTk3MyAzLjcwMjU0IDEyLjIxODVDNC40MTg0NSAxMi43MzU1IDUuMTI4NzQgMTMuMTA1MyA1LjY1NzMzIDEzLjM0NTdDNS45MjI4NCAxMy40NjY0IDYuMTQ1NjYgMTMuNTU1OSA2LjMwNDY1IDEzLjYxNjFDNi4zODQyMyAxMy42NDYyIDYuNDQ4MDUgMTMuNjY5IDYuNDkzNDkgMTMuNjg0OEM2LjUxNjIyIDEzLjY5MjcgNi41MzQzOCAxMy42OTg5IDYuNTQ3NjQgMTMuNzAzM0w2LjU2MzgyIDEzLjcwODdMNi41NjkwOCAxMy43MTA0TDYuNTcwOTkgMTMuNzExTDYuODM5ODQgMTMuNzUzM0w2LjU3MjQyIDEzLjcxMTVDNi43NDYzMyAxMy43NjczIDYuOTMzMzUgMTMuNzY3MyA3LjEwNzI3IDEzLjcxMTVMNy4xMDg3IDEzLjcxMUw3LjExMDYxIDEzLjcxMDRMNy4xMTU4NyAxMy43MDg3TDcuMTMyMDUgMTMuNzAzM0M3LjE0NTMxIDEzLjY5ODkgNy4xNjM0NiAxMy42OTI3IDcuMTg2MTkgMTMuNjg0OEM3LjIzMTY0IDEzLjY2OSA3LjI5NTQ2IDEzLjY0NjIgNy4zNzUwMyAxMy42MTYxQzcuNTM0MDMgMTMuNTU1OSA3Ljc1Njg1IDEzLjQ2NjQgOC4wMjIzNiAxMy4zNDU3QzguNTUwOTUgMTMuMTA1MyA5LjI2MTIzIDEyLjczNTUgOS45NzcxNSAxMi4yMTg1QzExLjM5MSAxMS4xOTczIDEyLjk2NDggOS40OTM3NyAxMi45NjQ4IDYuOTgwMThWMi43NTg4QzEyLjk2NDggMi43MTY2IDEyLjk2MTkgMi42NzUxMSAxMi45NTYxIDIuNjM0NTFWMS44ODM3N0gxMi4wODExQzEyLjA3NzUgMS44ODM3NyAxMi4wNzQgMS44ODM3NyAxMi4wNzA0IDEuODgzNzdDMTAuNzk3OSAxLjg4MDA0IDkuNjE5NjIgMS41MTEwMiA4LjczODk0IDEuMTI0ODZDOC43MzUzNCAxLjEyMzI3IDguNzMxNzQgMS4xMjE2OCA4LjcyODE0IDEuMTIwMDlDOC4yOTEwMyAwLjkyNjg2NCA3LjkzODQyIDAuNzM0MDU5IDcuNjk3NzkgMC41OTEzNzNDNy41Nzc3MiAwLjUyMDE3MSA3LjQ4NjIyIDAuNDYxODYgNy40MjY3NiAwLjQyMjc4OUM3LjM5NzA1IDAuNDAzMjY2IDcuMzc1MzkgMC4zODg1ODggNy4zNjIyNCAwLjM3OTU1NEw3LjM0ODk2IDAuMzcwMzVDNy4zNDg5NiAwLjM3MDM1IDcuMzQ4NDcgMC4zNzAwMiA3LjM0NTYzIDAuMzc0MDU0TDcuMzM3NzkgMC4zNjg2NTlMNy4zMzYwOSAwLjM2NzQ3NVpNOC4wMzQ3MSAyLjcyNjkxQzguODYwNCAzLjA5MDYzIDkuOTYwNjYgMy40NjMwOSAxMS4yMDYxIDMuNTg5MDdWNi45ODAxNUgxMS4yMTQ4QzExLjIxNDggOC42Nzk1MyAxMC4xNjM3IDkuOTI1MDcgOC45NTI1NCAxMC43OTk4QzguMzU1OTUgMTEuMjMwNiA3Ljc1Mzc0IDExLjU0NTQgNy4yOTc5NiAxMS43NTI3QzcuMTE2NzEgMTEuODM1MSA2Ljk2MDYyIDExLjg5OTYgNi44Mzk4NCAxMS45NDY5QzYuNzE5MDYgMTEuODk5NiA2LjU2Mjk3IDExLjgzNTEgNi4zODE3MyAxMS43NTI3QzUuOTI1OTUgMTEuNTQ1NCA1LjMyMzczIDExLjIzMDYgNC43MjcxNSAxMC43OTk4QzMuNTE2MDMgOS45MjUwNyAyLjQ2NDg0IDguNjc5NTUgMi40NjQ4NCA2Ljk4MDE4VjMuNTg5MDlDMy43MTczOCAzLjQ2MjM5IDQuODIzMDggMy4wODYzOSA1LjY1MDMzIDIuNzIwNzFDNi4xNDIyOCAyLjUwMzI0IDYuNTQ0ODUgMi4yODUzNyA2LjgzMjU0IDIuMTE2MjRDNy4xMjE4MSAyLjI4NTM1IDcuNTI3IDIuNTAzNTIgOC4wMjE5NiAyLjcyMTMxQzguMDI2MiAyLjcyMzE3IDguMDMwNDUgMi43MjUwNCA4LjAzNDcxIDIuNzI2OTFaTTUuOTY0ODQgMy40MDE0N1Y3Ljc3NjQ3SDcuNzE0ODRWMy40MDE0N0g1Ljk2NDg0Wk01Ljk2NDg0IDEwLjQwMTVWOC42NTE0N0g3LjcxNDg0VjEwLjQwMTVINS45NjQ4NFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
436
- background-color: crimson;
437
- }
438
- .ace_icon_svg.ace_warning_fold {
439
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");
440
- background-color: darkorange;
441
- }
442
-
443
- .ace_scrollbar {
444
- contain: strict;
445
- position: absolute;
446
- right: 0;
447
- bottom: 0;
448
- z-index: 6;
449
- }
450
-
451
- .ace_scrollbar-inner {
452
- position: absolute;
453
- cursor: text;
454
- left: 0;
455
- top: 0;
456
- }
457
-
458
- .ace_scrollbar-v{
459
- overflow-x: hidden;
460
- overflow-y: scroll;
461
- top: 0;
462
- }
463
-
464
- .ace_scrollbar-h {
465
- overflow-x: scroll;
466
- overflow-y: hidden;
467
- left: 0;
468
- }
469
-
470
- .ace_print-margin {
471
- position: absolute;
472
- height: 100%;
473
- }
474
-
475
- .ace_text-input {
476
- position: absolute;
477
- z-index: 0;
478
- width: 0.5em;
479
- height: 1em;
480
- opacity: 0;
481
- background: transparent;
482
- -moz-appearance: none;
483
- appearance: none;
484
- border: none;
485
- resize: none;
486
- outline: none;
487
- overflow: hidden;
488
- font: inherit;
489
- padding: 0 1px;
490
- margin: 0 -1px;
491
- contain: strict;
492
- -ms-user-select: text;
493
- -moz-user-select: text;
494
- -webkit-user-select: text;
495
- user-select: text;
496
- /*with \`pre-line\` chrome inserts &nbsp; instead of space*/
497
- white-space: pre!important;
498
- }
499
- .ace_text-input.ace_composition {
500
- background: transparent;
501
- color: inherit;
502
- z-index: 1000;
503
- opacity: 1;
504
- }
505
- .ace_composition_placeholder { color: transparent }
506
- .ace_composition_marker {
507
- border-bottom: 1px solid;
508
- position: absolute;
509
- border-radius: 0;
510
- margin-top: 1px;
511
- }
512
-
513
- [ace_nocontext=true] {
514
- transform: none!important;
515
- filter: none!important;
516
- clip-path: none!important;
517
- mask : none!important;
518
- contain: none!important;
519
- perspective: none!important;
520
- mix-blend-mode: initial!important;
521
- z-index: auto;
522
- }
523
-
524
- .ace_layer {
525
- z-index: 1;
526
- position: absolute;
527
- overflow: hidden;
528
- /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
529
- word-wrap: normal;
530
- white-space: pre;
531
- height: 100%;
532
- width: 100%;
533
- box-sizing: border-box;
534
- /* setting pointer-events: auto; on node under the mouse, which changes
535
- during scroll, will break mouse wheel scrolling in Safari */
536
- pointer-events: none;
537
- }
538
-
539
- .ace_gutter-layer {
540
- position: relative;
541
- width: auto;
542
- text-align: right;
543
- pointer-events: auto;
544
- height: 1000000px;
545
- contain: style size layout;
546
- }
547
-
548
- .ace_text-layer {
549
- font: inherit !important;
550
- position: absolute;
551
- height: 1000000px;
552
- width: 1000000px;
553
- contain: style size layout;
554
- }
555
-
556
- .ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {
557
- contain: style size layout;
558
- position: absolute;
559
- top: 0;
560
- left: 0;
561
- right: 0;
562
- }
563
-
564
- .ace_hidpi .ace_text-layer,
565
- .ace_hidpi .ace_gutter-layer,
566
- .ace_hidpi .ace_content,
567
- .ace_hidpi .ace_gutter {
568
- contain: strict;
569
- }
570
- .ace_hidpi .ace_text-layer > .ace_line,
571
- .ace_hidpi .ace_text-layer > .ace_line_group {
572
- contain: strict;
573
- }
574
-
575
- .ace_cjk {
576
- display: inline-block;
577
- text-align: center;
578
- }
579
-
580
- .ace_cursor-layer {
581
- z-index: 4;
582
- }
583
-
584
- .ace_cursor {
585
- z-index: 4;
586
- position: absolute;
587
- box-sizing: border-box;
588
- border-left: 2px solid;
589
- /* workaround for smooth cursor repaintng whole screen in chrome */
590
- transform: translatez(0);
591
- }
592
-
593
- .ace_multiselect .ace_cursor {
594
- border-left-width: 1px;
595
- }
596
-
597
- .ace_slim-cursors .ace_cursor {
598
- border-left-width: 1px;
599
- }
600
-
601
- .ace_overwrite-cursors .ace_cursor {
602
- border-left-width: 0;
603
- border-bottom: 1px solid;
604
- }
605
-
606
- .ace_hidden-cursors .ace_cursor {
607
- opacity: 0.2;
608
- }
609
-
610
- .ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {
611
- opacity: 0;
612
- }
613
-
614
- .ace_smooth-blinking .ace_cursor {
615
- transition: opacity 0.18s;
616
- }
617
-
618
- .ace_animate-blinking .ace_cursor {
619
- animation-duration: 1000ms;
620
- animation-timing-function: step-end;
621
- animation-name: blink-ace-animate;
622
- animation-iteration-count: infinite;
623
- }
624
-
625
- .ace_animate-blinking.ace_smooth-blinking .ace_cursor {
626
- animation-duration: 1000ms;
627
- animation-timing-function: ease-in-out;
628
- animation-name: blink-ace-animate-smooth;
629
- }
630
-
631
- @keyframes blink-ace-animate {
632
- from, to { opacity: 1; }
633
- 60% { opacity: 0; }
634
- }
635
-
636
- @keyframes blink-ace-animate-smooth {
637
- from, to { opacity: 1; }
638
- 45% { opacity: 1; }
639
- 60% { opacity: 0; }
640
- 85% { opacity: 0; }
641
- }
642
-
643
- .ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {
644
- position: absolute;
645
- z-index: 3;
646
- }
647
-
648
- .ace_marker-layer .ace_selection {
649
- position: absolute;
650
- z-index: 5;
651
- }
652
-
653
- .ace_marker-layer .ace_bracket {
654
- position: absolute;
655
- z-index: 6;
656
- }
657
-
658
- .ace_marker-layer .ace_error_bracket {
659
- position: absolute;
660
- border-bottom: 1px solid #DE5555;
661
- border-radius: 0;
662
- }
663
-
664
- .ace_marker-layer .ace_active-line {
665
- position: absolute;
666
- z-index: 2;
667
- }
668
-
669
- .ace_marker-layer .ace_selected-word {
670
- position: absolute;
671
- z-index: 4;
672
- box-sizing: border-box;
673
- }
674
-
675
- .ace_line .ace_fold {
676
- box-sizing: border-box;
677
-
678
- display: inline-block;
679
- height: 11px;
680
- margin-top: -2px;
681
- vertical-align: middle;
682
-
683
- background-image:
684
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
685
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
686
- background-repeat: no-repeat, repeat-x;
687
- background-position: center center, top left;
688
- color: transparent;
689
-
690
- border: 1px solid black;
691
- border-radius: 2px;
692
-
693
- cursor: pointer;
694
- pointer-events: auto;
695
- }
696
-
697
- .ace_dark .ace_fold {
698
- }
699
-
700
- .ace_fold:hover{
701
- background-image:
702
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
703
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
704
- }
705
-
706
- .ace_tooltip {
707
- background-color: #f5f5f5;
708
- border: 1px solid gray;
709
- border-radius: 1px;
710
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
711
- color: black;
712
- padding: 3px 4px;
713
- position: fixed;
714
- z-index: 999999;
715
- box-sizing: border-box;
716
- cursor: default;
717
- white-space: pre-wrap;
718
- word-wrap: break-word;
719
- line-height: normal;
720
- font-style: normal;
721
- font-weight: normal;
722
- letter-spacing: normal;
723
- pointer-events: none;
724
- overflow: auto;
725
- max-width: min(33em, 66vw);
726
- overscroll-behavior: contain;
727
- }
728
- .ace_tooltip pre {
729
- white-space: pre-wrap;
730
- }
731
-
732
- .ace_tooltip.ace_dark {
733
- background-color: #636363;
734
- color: #fff;
735
- }
736
-
737
- .ace_tooltip:focus {
738
- outline: 1px solid #5E9ED6;
739
- }
740
-
741
- .ace_icon {
742
- display: inline-block;
743
- width: 18px;
744
- vertical-align: top;
745
- }
746
-
747
- .ace_icon_svg {
748
- display: inline-block;
749
- width: 12px;
750
- vertical-align: top;
751
- -webkit-mask-repeat: no-repeat;
752
- -webkit-mask-size: 12px;
753
- -webkit-mask-position: center;
754
- }
755
-
756
- .ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {
757
- padding-right: 13px;
758
- }
759
-
760
- .ace_fold-widget, .ace_custom-widget {
761
- box-sizing: border-box;
762
-
763
- margin: 0 -12px 0 1px;
764
- display: none;
765
- width: 11px;
766
- vertical-align: top;
767
-
768
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");
769
- background-repeat: no-repeat;
770
- background-position: center;
771
-
772
- border-radius: 3px;
773
-
774
- border: 1px solid transparent;
775
- cursor: pointer;
776
- pointer-events: auto;
777
- }
778
-
779
- .ace_custom-widget {
780
- background: none;
781
- }
782
-
783
- .ace_folding-enabled .ace_fold-widget {
784
- display: inline-block;
785
- }
786
-
787
- .ace_fold-widget.ace_end {
788
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");
789
- }
790
-
791
- .ace_fold-widget.ace_closed {
792
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");
793
- }
794
-
795
- .ace_fold-widget:hover {
796
- border: 1px solid rgba(0, 0, 0, 0.3);
797
- background-color: rgba(255, 255, 255, 0.2);
798
- box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
799
- }
800
-
801
- .ace_fold-widget:active {
802
- border: 1px solid rgba(0, 0, 0, 0.4);
803
- background-color: rgba(0, 0, 0, 0.05);
804
- box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
805
- }
806
- /**
807
- * Dark version for fold widgets
808
- */
809
- .ace_dark .ace_fold-widget {
810
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");
811
- }
812
- .ace_dark .ace_fold-widget.ace_end {
813
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");
814
- }
815
- .ace_dark .ace_fold-widget.ace_closed {
816
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");
817
- }
818
- .ace_dark .ace_fold-widget:hover {
819
- box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
820
- background-color: rgba(255, 255, 255, 0.1);
821
- }
822
- .ace_dark .ace_fold-widget:active {
823
- box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
824
- }
825
-
826
- .ace_inline_button {
827
- border: 1px solid lightgray;
828
- display: inline-block;
829
- margin: -1px 8px;
830
- padding: 0 5px;
831
- pointer-events: auto;
832
- cursor: pointer;
833
- }
834
- .ace_inline_button:hover {
835
- border-color: gray;
836
- background: rgba(200,200,200,0.2);
837
- display: inline-block;
838
- pointer-events: auto;
839
- }
840
-
841
- .ace_fold-widget.ace_invalid {
842
- background-color: #FFB4B4;
843
- border-color: #DE5555;
844
- }
845
-
846
- .ace_fade-fold-widgets .ace_fold-widget {
847
- transition: opacity 0.4s ease 0.05s;
848
- opacity: 0;
849
- }
850
-
851
- .ace_fade-fold-widgets:hover .ace_fold-widget {
852
- transition: opacity 0.05s ease 0.05s;
853
- opacity:1;
854
- }
855
-
856
- .ace_underline {
857
- text-decoration: underline;
858
- }
859
-
860
- .ace_bold {
861
- font-weight: bold;
862
- }
863
-
864
- .ace_nobold .ace_bold {
865
- font-weight: normal;
866
- }
867
-
868
- .ace_italic {
869
- font-style: italic;
870
- }
871
-
872
-
873
- .ace_error-marker {
874
- background-color: rgba(255, 0, 0,0.2);
875
- position: absolute;
876
- z-index: 9;
877
- }
878
-
879
- .ace_highlight-marker {
880
- background-color: rgba(255, 255, 0,0.2);
881
- position: absolute;
882
- z-index: 8;
883
- }
884
-
885
- .ace_mobile-menu {
886
- position: absolute;
887
- line-height: 1.5;
888
- border-radius: 4px;
889
- -ms-user-select: none;
890
- -moz-user-select: none;
891
- -webkit-user-select: none;
892
- user-select: none;
893
- background: white;
894
- box-shadow: 1px 3px 2px grey;
895
- border: 1px solid #dcdcdc;
896
- color: black;
897
- }
898
- .ace_dark > .ace_mobile-menu {
899
- background: #333;
900
- color: #ccc;
901
- box-shadow: 1px 3px 2px grey;
902
- border: 1px solid #444;
903
-
904
- }
905
- .ace_mobile-button {
906
- padding: 2px;
907
- cursor: pointer;
908
- overflow: hidden;
909
- }
910
- .ace_mobile-button:hover {
911
- background-color: #eee;
912
- opacity:1;
913
- }
914
- .ace_mobile-button:active {
915
- background-color: #ddd;
916
- }
917
-
918
- .ace_placeholder {
919
- position: relative;
920
- font-family: arial;
921
- transform: scale(0.9);
922
- transform-origin: left;
923
- white-space: pre;
924
- opacity: 0.7;
925
- margin: 0 10px;
926
- z-index: 1;
927
- }
928
-
929
- .ace_ghost_text {
930
- opacity: 0.5;
931
- font-style: italic;
932
- }
933
-
934
- .ace_ghost_text_container > div {
935
- white-space: pre;
936
- }
937
-
938
- .ghost_text_line_wrapped::after {
939
- content: "↩";
940
- position: absolute;
941
- }
942
-
943
- .ace_lineWidgetContainer.ace_ghost_text {
944
- margin: 0px 4px
945
- }
946
-
947
- .ace_screenreader-only {
948
- position:absolute;
949
- left:-10000px;
950
- top:auto;
951
- width:1px;
952
- height:1px;
953
- overflow:hidden;
954
- }
955
-
956
- .ace_hidden_token {
957
- display: none;
958
- }`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(t,n,h){var i=t("../lib/dom"),s=t("../lib/oop"),d=t("../lib/event_emitter").EventEmitter,o=(function(){function l(r,a){this.renderer=a,this.pixelRatio=1,this.maxHeight=a.layerConfig.maxHeight,this.lineHeight=a.layerConfig.lineHeight,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},this.setScrollBarV(r)}return l.prototype.$createCanvas=function(){this.canvas=i.createElement("canvas"),this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7",this.canvas.style.position="absolute"},l.prototype.setScrollBarV=function(r){this.$createCanvas(),this.scrollbarV=r,r.element.appendChild(this.canvas),this.setDimensions()},l.prototype.$updateDecorators=function(r){if(typeof this.canvas.getContext!="function")return;var a=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;this.setDimensions(r);var c=this.canvas.getContext("2d");function p(k,S){return k.priority<S.priority?-1:k.priority>S.priority?1:0}var u=this.renderer.session.$annotations;if(c.clearRect(0,0,this.canvas.width,this.canvas.height),u){var f={info:1,warning:2,error:3};u.forEach(function(k){k.priority=f[k.type]||null}),u=u.sort(p);for(var g=0;g<u.length;g++){var v=u[g].row,b=this.getVerticalOffsetForRow(v),D=b+this.lineHeight,E=Math.round(this.heightRatio*b),w=Math.round(this.heightRatio*D),y=Math.round((E+w)/2),A=w-y;A<this.halfMinDecorationHeight&&(A=this.halfMinDecorationHeight),y-A<0&&(y=A),y+A>this.canvasHeight&&(y=this.canvasHeight-A);var T=y-A,x=y+A,M=x-T;c.fillStyle=a[u[g].type]||null,c.fillRect(0,T,Math.round(this.oneZoneWidth-1),M)}}var O=this.renderer.session.selection.getCursor();if(O){var _=Math.round(this.getVerticalOffsetForRow(O.row)*this.heightRatio);c.fillStyle="rgba(0, 0, 0, 0.5)",c.fillRect(0,_,this.canvasWidth,2)}},l.prototype.getVerticalOffsetForRow=function(r){r=r|0;var a=this.renderer.session.documentToScreenRow(r,0)*this.lineHeight;return a},l.prototype.setDimensions=function(r){r=r||this.renderer.layerConfig,this.maxHeight=r.maxHeight,this.lineHeight=r.lineHeight,this.canvasHeight=r.height,this.canvasWidth=this.scrollbarV.width||this.canvasWidth,this.setZoneWidth(),this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.maxHeight<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight},l.prototype.setZoneWidth=function(){this.oneZoneWidth=this.canvasWidth},l.prototype.destroy=function(){this.canvas.parentNode.removeChild(this.canvas)},l})();s.implement(o.prototype,d),n.Decorator=o}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(t,n,h){var i=t("./lib/oop"),s=t("./lib/dom"),d=t("./lib/lang"),o=t("./config"),l=t("./layer/gutter").Gutter,r=t("./layer/marker").Marker,a=t("./layer/text").Text,c=t("./layer/cursor").Cursor,p=t("./scrollbar").HScrollBar,u=t("./scrollbar").VScrollBar,f=t("./scrollbar_custom").HScrollBar,g=t("./scrollbar_custom").VScrollBar,v=t("./renderloop").RenderLoop,b=t("./layer/font_metrics").FontMetrics,D=t("./lib/event_emitter").EventEmitter,E=t("./css/editor-css"),w=t("./layer/decorators").Decorator,y=t("./lib/useragent"),A=t("./layer/text_util").isTextToken;s.importCssString(E,"ace_editor.css",!1);var T=(function(){function x(M,O){var _=this;this.container=M||s.createElement("div"),s.addCssClass(this.container,"ace_editor"),s.HI_DPI&&s.addCssClass(this.container,"ace_hidpi"),this.setTheme(O),o.get("useStrictCSP")==null&&o.set("useStrictCSP",!1),this.$gutter=s.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=s.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=s.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new l(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new r(this.content);var k=this.$textLayer=new a(this.content);this.canvas=k.element,this.$markerFront=new r(this.content),this.$cursorLayer=new c(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new p(this.container,this),this.scrollBarV.on("scroll",function(S){_.$scrollAnimation||_.session.setScrollTop(S.data-_.scrollMargin.top)}),this.scrollBarH.on("scroll",function(S){_.$scrollAnimation||_.session.setScrollLeft(S.data-_.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new b(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(S){_.updateCharacterSize(),_.onResize(!0,_.gutterWidth,_.$size.width,_.$size.height),_._signal("changeCharacterSize",S)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!y.isIOS,this.$loop=new v(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),o.resetOptions(this),o._signal("renderer",this)}return x.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),s.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},x.prototype.setSession=function(M){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=M,M&&this.scrollMargin.top&&M.getScrollTop()<=0&&M.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(M),this.$markerBack.setSession(M),this.$markerFront.setSession(M),this.$gutterLayer.setSession(M),this.$textLayer.setSession(M),M&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},x.prototype.updateLines=function(M,O,_){if(O===void 0&&(O=1/0),this.$changedLines?(this.$changedLines.firstRow>M&&(this.$changedLines.firstRow=M),this.$changedLines.lastRow<O&&(this.$changedLines.lastRow=O)):this.$changedLines={firstRow:M,lastRow:O},this.$changedLines.lastRow<this.layerConfig.firstRow)if(_)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},x.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},x.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},x.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},x.prototype.updateFull=function(M){M?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},x.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},x.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},x.prototype.onResize=function(M,O,_,k){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=M?1:0;var S=this.container;k||(k=S.clientHeight||S.scrollHeight),!k&&this.$maxLines&&this.lineHeight>1&&(!S.style.height||S.style.height=="0px")&&(S.style.height="1px",k=S.clientHeight||S.scrollHeight),_||(_=S.clientWidth||S.scrollWidth);var C=this.$updateCachedSize(M,O,_,k);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!_&&!k)return this.resizing=0;M&&(this.$gutterLayer.$padding=null),M?this.$renderChanges(C|this.$changes,!0):this.$loop.schedule(C|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},x.prototype.$updateCachedSize=function(M,O,_,k){k-=this.$extraHeight||0;var S=0,C=this.$size,L={width:C.width,height:C.height,scrollerHeight:C.scrollerHeight,scrollerWidth:C.scrollerWidth};if(k&&(M||C.height!=k)&&(C.height=k,S|=this.CHANGE_SIZE,C.scrollerHeight=C.height,this.$horizScroll&&(C.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(C.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",S=S|this.CHANGE_SCROLL),_&&(M||C.width!=_)){S|=this.CHANGE_SIZE,C.width=_,O==null&&(O=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=O,s.setStyle(this.scrollBarH.element.style,"left",O+"px"),s.setStyle(this.scroller.style,"left",O+this.margin.left+"px"),C.scrollerWidth=Math.max(0,_-O-this.scrollBarV.getWidth()-this.margin.h),s.setStyle(this.$gutter.style,"left",this.margin.left+"px");var I=this.scrollBarV.getWidth()+"px";s.setStyle(this.scrollBarH.element.style,"right",I),s.setStyle(this.scroller.style,"right",I),s.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(C.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||M)&&(S|=this.CHANGE_FULL)}return C.$dirty=!_||!k,S&&this._signal("resize",L),S},x.prototype.onGutterResize=function(M){var O=this.$showGutter?M:0;O!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,O,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},x.prototype.adjustWrapLimit=function(){var M=this.$size.scrollerWidth-this.$padding*2,O=Math.floor(M/this.characterWidth);return this.session.adjustWrapLimit(O,this.$showPrintMargin&&this.$printMarginColumn)},x.prototype.setAnimatedScroll=function(M){this.setOption("animatedScroll",M)},x.prototype.getAnimatedScroll=function(){return this.$animatedScroll},x.prototype.setShowInvisibles=function(M){this.setOption("showInvisibles",M),this.session.$bidiHandler.setShowInvisibles(M)},x.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},x.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},x.prototype.setDisplayIndentGuides=function(M){this.setOption("displayIndentGuides",M)},x.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},x.prototype.setHighlightIndentGuides=function(M){this.setOption("highlightIndentGuides",M)},x.prototype.setShowPrintMargin=function(M){this.setOption("showPrintMargin",M)},x.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},x.prototype.setPrintMarginColumn=function(M){this.setOption("printMarginColumn",M)},x.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},x.prototype.getShowGutter=function(){return this.getOption("showGutter")},x.prototype.setShowGutter=function(M){return this.setOption("showGutter",M)},x.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},x.prototype.setFadeFoldWidgets=function(M){this.setOption("fadeFoldWidgets",M)},x.prototype.setHighlightGutterLine=function(M){this.setOption("highlightGutterLine",M)},x.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},x.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var M=s.createElement("div");M.className="ace_layer ace_print-margin-layer",this.$printMarginEl=s.createElement("div"),this.$printMarginEl.className="ace_print-margin",M.appendChild(this.$printMarginEl),this.content.insertBefore(M,this.content.firstChild)}var O=this.$printMarginEl.style;O.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",O.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},x.prototype.getContainerElement=function(){return this.container},x.prototype.getMouseEventTarget=function(){return this.scroller},x.prototype.getTextAreaContainer=function(){return this.container},x.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var M=this.textarea.style,O=this.$composition;if(!this.$keepTextAreaAtCursor&&!O){s.translate(this.textarea,-100,0);return}var _=this.$cursorLayer.$pixelPos;if(_){O&&O.markerRange&&(_=this.$cursorLayer.getPixelPosition(O.markerRange.start,!0));var k=this.layerConfig,S=_.top,C=_.left;S-=k.offset;var L=O&&O.useTextareaForIME||y.isMobile?this.lineHeight:1;if(S<0||S>k.height-L){s.translate(this.textarea,0,0);return}var I=1,F=this.$size.height-L;if(!O)S+=this.lineHeight;else if(O.useTextareaForIME){var R=this.textarea.value;I=this.characterWidth*this.session.$getStringScreenWidth(R)[0]}else S+=this.lineHeight+2;C-=this.scrollLeft,C>this.$size.scrollerWidth-I&&(C=this.$size.scrollerWidth-I),C+=this.gutterWidth+this.margin.left,s.setStyle(M,"height",L+"px"),s.setStyle(M,"width",I+"px"),s.translate(this.textarea,Math.min(C,this.$size.scrollerWidth-I),Math.min(S,F))}}},x.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},x.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},x.prototype.getLastFullyVisibleRow=function(){var M=this.layerConfig,O=M.lastRow,_=this.session.documentToScreenRow(O,0)*M.lineHeight;return _-this.session.getScrollTop()>M.height-M.lineHeight?O-1:O},x.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},x.prototype.setPadding=function(M){this.$padding=M,this.$textLayer.setPadding(M),this.$cursorLayer.setPadding(M),this.$markerFront.setPadding(M),this.$markerBack.setPadding(M),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},x.prototype.setScrollMargin=function(M,O,_,k){var S=this.scrollMargin;S.top=M|0,S.bottom=O|0,S.right=k|0,S.left=_|0,S.v=S.top+S.bottom,S.h=S.left+S.right,S.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-S.top),this.updateFull()},x.prototype.setMargin=function(M,O,_,k){var S=this.margin;S.top=M|0,S.bottom=O|0,S.right=k|0,S.left=_|0,S.v=S.top+S.bottom,S.h=S.left+S.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},x.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},x.prototype.setHScrollBarAlwaysVisible=function(M){this.setOption("hScrollBarAlwaysVisible",M)},x.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},x.prototype.setVScrollBarAlwaysVisible=function(M){this.setOption("vScrollBarAlwaysVisible",M)},x.prototype.$updateScrollBarV=function(){var M=this.layerConfig.maxHeight,O=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(M-=(O-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>M-O&&(M=this.scrollTop+O,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(M+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},x.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},x.prototype.freeze=function(){this.$frozen=!0},x.prototype.unfreeze=function(){this.$frozen=!1},x.prototype.$renderChanges=function(M,O){if(this.$changes&&(M|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!M&&!O){this.$changes|=M;return}if(this.$size.$dirty)return this.$changes|=M,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",M),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var _=this.layerConfig;if(M&this.CHANGE_FULL||M&this.CHANGE_SIZE||M&this.CHANGE_TEXT||M&this.CHANGE_LINES||M&this.CHANGE_SCROLL||M&this.CHANGE_H_SCROLL){if(M|=this.$computeLayerConfig()|this.$loop.clear(),_.firstRow!=this.layerConfig.firstRow&&_.firstRowScreen==this.layerConfig.firstRowScreen){var k=this.scrollTop+(_.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;k>0&&(this.scrollTop=k,M=M|this.CHANGE_SCROLL,M|=this.$computeLayerConfig()|this.$loop.clear())}_=this.layerConfig,this.$updateScrollBarV(),M&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),s.translate(this.content,-this.scrollLeft,-_.offset);var S=_.width+2*this.$padding+"px",C=_.minHeight+"px";s.setStyle(this.content.style,"width",S),s.setStyle(this.content.style,"height",C)}if(M&this.CHANGE_H_SCROLL&&(s.translate(this.content,-this.scrollLeft,-_.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),M&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(_),this.$showGutter&&this.$gutterLayer.update(_),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(_),this.$markerBack.update(_),this.$markerFront.update(_),this.$cursorLayer.update(_),this.$moveTextAreaToCursor(),this._signal("afterRender",M);return}if(M&this.CHANGE_SCROLL){this.$changedLines=null,M&this.CHANGE_TEXT||M&this.CHANGE_LINES?this.$textLayer.update(_):this.$textLayer.scrollLines(_),this.$showGutter&&(M&this.CHANGE_GUTTER||M&this.CHANGE_LINES?this.$gutterLayer.update(_):this.$gutterLayer.scrollLines(_)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(_),this.$markerBack.update(_),this.$markerFront.update(_),this.$cursorLayer.update(_),this.$moveTextAreaToCursor(),this._signal("afterRender",M);return}M&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(_),this.$showGutter&&this.$gutterLayer.update(_),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(_)):M&this.CHANGE_LINES?((this.$updateLines()||M&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(_),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(_)):M&this.CHANGE_TEXT||M&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(_),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(_)):M&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(_),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(_)),M&this.CHANGE_CURSOR&&(this.$cursorLayer.update(_),this.$moveTextAreaToCursor()),M&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(_),M&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(_),this._signal("afterRender",M)},x.prototype.$autosize=function(){var M=this.session.getScreenLength()*this.lineHeight,O=this.$maxLines*this.lineHeight,_=Math.min(O,Math.max((this.$minLines||1)*this.lineHeight,M))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(_+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&_>this.$maxPixelHeight&&(_=this.$maxPixelHeight);var k=_<=2*this.lineHeight,S=!k&&M>O;if(_!=this.desiredHeight||this.$size.height!=this.desiredHeight||S!=this.$vScroll){S!=this.$vScroll&&(this.$vScroll=S,this.scrollBarV.setVisible(S));var C=this.container.clientWidth;this.container.style.height=_+"px",this.$updateCachedSize(!0,this.$gutterWidth,C,_),this.desiredHeight=_,this._signal("autosize")}},x.prototype.$computeLayerConfig=function(){var M=this.session,O=this.$size,_=O.height<=2*this.lineHeight,k=this.session.getScreenLength(),S=k*this.lineHeight,C=this.$getLongestLine(),L=!_&&(this.$hScrollBarAlwaysVisible||O.scrollerWidth-C-2*this.$padding<0),I=this.$horizScroll!==L;I&&(this.$horizScroll=L,this.scrollBarH.setVisible(L));var F=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),_=O.height<=2*this.lineHeight);var R=O.scrollerHeight+this.lineHeight,B=!this.$maxLines&&this.$scrollPastEnd?(O.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;S+=B;var N=this.scrollMargin;this.session.setScrollTop(Math.max(-N.top,Math.min(this.scrollTop,S-O.scrollerHeight+N.bottom))),this.session.setScrollLeft(Math.max(-N.left,Math.min(this.scrollLeft,C+2*this.$padding-O.scrollerWidth+N.right)));var z=!_&&(this.$vScrollBarAlwaysVisible||O.scrollerHeight-S+B<0||this.scrollTop>N.top),W=F!==z;W&&(this.$vScroll=z,this.scrollBarV.setVisible(z));var j=this.scrollTop%this.lineHeight,U=Math.ceil(R/this.lineHeight)-1,K=Math.max(0,Math.round((this.scrollTop-j)/this.lineHeight)),J=K+U,Y,X,q=this.lineHeight;K=M.screenToDocumentRow(K,0);var ne=M.getFoldLine(K);ne&&(K=ne.start.row),Y=M.documentToScreenRow(K,0),X=M.getRowLength(K)*q,J=Math.min(M.screenToDocumentRow(J,0),M.getLength()-1),R=O.scrollerHeight+M.getRowLength(J)*q+X,j=this.scrollTop-Y*q,j<0&&Y>0&&(Y=Math.max(0,Y+Math.floor(j/q)),j=this.scrollTop-Y*q);var ue=0;return(this.layerConfig.width!=C||I)&&(ue=this.CHANGE_H_SCROLL),(I||W)&&(ue|=this.$updateCachedSize(!0,this.gutterWidth,O.width,O.height),this._signal("scrollbarVisibilityChanged"),W&&(C=this.$getLongestLine())),this.layerConfig={width:C,padding:this.$padding,firstRow:K,firstRowScreen:Y,lastRow:J,lineHeight:q,characterWidth:this.characterWidth,minHeight:R,maxHeight:S,offset:j,gutterOffset:q?Math.max(0,Math.ceil((j+O.height-O.scrollerHeight)/q)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(C-this.$padding),ue},x.prototype.$updateLines=function(){if(this.$changedLines){var M=this.$changedLines.firstRow,O=this.$changedLines.lastRow;this.$changedLines=null;var _=this.layerConfig;if(!(M>_.lastRow+1)&&!(O<_.firstRow)){if(O===1/0){this.$showGutter&&this.$gutterLayer.update(_),this.$textLayer.update(_);return}return this.$textLayer.updateLines(_,M,O),!0}}},x.prototype.$getLongestLine=function(){var M=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(M+=1),this.$textLayer&&M>this.$textLayer.MAX_LINE_LENGTH&&(M=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(M*this.characterWidth))},x.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},x.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},x.prototype.addGutterDecoration=function(M,O){this.$gutterLayer.addGutterDecoration(M,O)},x.prototype.removeGutterDecoration=function(M,O){this.$gutterLayer.removeGutterDecoration(M,O)},x.prototype.updateBreakpoints=function(M){this._rows=M,this.$loop.schedule(this.CHANGE_GUTTER)},x.prototype.setAnnotations=function(M){this.$gutterLayer.setAnnotations(M),this.$loop.schedule(this.CHANGE_GUTTER)},x.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},x.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},x.prototype.showCursor=function(){this.$cursorLayer.showCursor()},x.prototype.scrollSelectionIntoView=function(M,O,_){this.scrollCursorIntoView(M,_),this.scrollCursorIntoView(O,_)},x.prototype.scrollCursorIntoView=function(M,O,_){if(this.$size.scrollerHeight!==0){var k=this.$cursorLayer.getPixelPosition(M),S=k.left,C=k.top,L=_&&_.top||0,I=_&&_.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var F=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;F+L>C?(O&&F+L>C+this.lineHeight&&(C-=O*this.$size.scrollerHeight),C===0&&(C=-this.scrollMargin.top),this.session.setScrollTop(C)):F+this.$size.scrollerHeight-I<C+this.lineHeight&&(O&&F+this.$size.scrollerHeight-I<C-this.lineHeight&&(C+=O*this.$size.scrollerHeight),this.session.setScrollTop(C+this.lineHeight+I-this.$size.scrollerHeight));var R=this.scrollLeft,B=2*this.layerConfig.characterWidth;S-B<R?(S-=B,S<this.$padding+B&&(S=-this.scrollMargin.left),this.session.setScrollLeft(S)):(S+=B,R+this.$size.scrollerWidth<S+this.characterWidth?this.session.setScrollLeft(Math.round(S+this.characterWidth-this.$size.scrollerWidth)):R<=this.$padding&&S-R<this.characterWidth&&this.session.setScrollLeft(0))}},x.prototype.getScrollTop=function(){return this.session.getScrollTop()},x.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},x.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},x.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},x.prototype.scrollToRow=function(M){this.session.setScrollTop(M*this.lineHeight)},x.prototype.alignCursor=function(M,O){typeof M=="number"&&(M={row:M,column:0});var _=this.$cursorLayer.getPixelPosition(M),k=this.$size.scrollerHeight-this.lineHeight,S=_.top-k*(O||0);return this.session.setScrollTop(S),S},x.prototype.$calcSteps=function(M,O){var _=0,k=this.STEPS,S=[],C=function(L,I,F){return F*(Math.pow(L-1,3)+1)+I};for(_=0;_<k;++_)S.push(C(_/this.STEPS,M,O-M));return S},x.prototype.scrollToLine=function(M,O,_,k){var S=this.$cursorLayer.getPixelPosition({row:M,column:0}),C=S.top;O&&(C-=this.$size.scrollerHeight/2);var L=this.scrollTop;this.session.setScrollTop(C),_!==!1&&this.animateScrolling(L,k)},x.prototype.animateScrolling=function(M,O){var _=this.scrollTop;if(!this.$animatedScroll)return;var k=this;if(M==_)return;if(this.$scrollAnimation){var S=this.$scrollAnimation.steps;if(S.length&&(M=S[0],M==_))return}var C=k.$calcSteps(M,_);this.$scrollAnimation={from:M,to:_,steps:C},clearInterval(this.$timer),k.session.setScrollTop(C.shift()),k.session.$scrollTop=_;function L(){k.$timer=clearInterval(k.$timer),k.$scrollAnimation=null,k.$stopAnimation=!1,O&&O()}this.$timer=setInterval(function(){if(k.$stopAnimation){L();return}if(!k.session)return clearInterval(k.$timer);C.length?(k.session.setScrollTop(C.shift()),k.session.$scrollTop=_):_!=null?(k.session.$scrollTop=-1,k.session.setScrollTop(_),_=null):L()},10)},x.prototype.scrollToY=function(M){this.scrollTop!==M&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=M)},x.prototype.scrollToX=function(M){this.scrollLeft!==M&&(this.scrollLeft=M),this.$loop.schedule(this.CHANGE_H_SCROLL)},x.prototype.scrollTo=function(M,O){this.session.setScrollTop(O),this.session.setScrollLeft(M)},x.prototype.scrollBy=function(M,O){O&&this.session.setScrollTop(this.session.getScrollTop()+O),M&&this.session.setScrollLeft(this.session.getScrollLeft()+M)},x.prototype.isScrollableBy=function(M,O){if(O<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||O>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||M<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||M>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},x.prototype.pixelToScreenCoordinates=function(M,O){var _;if(this.$hasCssTransforms){_={top:0,left:0};var k=this.$fontMetrics.transformCoordinates([M,O]);M=k[1]-this.gutterWidth-this.margin.left,O=k[0]}else _=this.scroller.getBoundingClientRect();var S=M+this.scrollLeft-_.left-this.$padding,C=S/this.characterWidth,L=Math.floor((O+this.scrollTop-_.top)/this.lineHeight),I=this.$blockCursor?Math.floor(C):Math.round(C);return{row:L,column:I,side:C-I>0?1:-1,offsetX:S}},x.prototype.screenToTextCoordinates=function(M,O){var _;if(this.$hasCssTransforms){_={top:0,left:0};var k=this.$fontMetrics.transformCoordinates([M,O]);M=k[1]-this.gutterWidth-this.margin.left,O=k[0]}else _=this.scroller.getBoundingClientRect();var S=M+this.scrollLeft-_.left-this.$padding,C=S/this.characterWidth,L=this.$blockCursor?Math.floor(C):Math.round(C),I=Math.floor((O+this.scrollTop-_.top)/this.lineHeight);return this.session.screenToDocumentPosition(I,Math.max(L,0),S)},x.prototype.textToScreenCoordinates=function(M,O){var _=this.scroller.getBoundingClientRect(),k=this.session.documentToScreenPosition(M,O),S=this.$padding+(this.session.$bidiHandler.isBidiRow(k.row,M)?this.session.$bidiHandler.getPosLeft(k.column):Math.round(k.column*this.characterWidth)),C=k.row*this.lineHeight;return{pageX:_.left+S-this.scrollLeft,pageY:_.top+C-this.scrollTop}},x.prototype.visualizeFocus=function(){s.addCssClass(this.container,"ace_focus")},x.prototype.visualizeBlur=function(){s.removeCssClass(this.container,"ace_focus")},x.prototype.showComposition=function(M){this.$composition=M,M.cssText||(M.cssText=this.textarea.style.cssText),M.useTextareaForIME==null&&(M.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(s.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):M.markerId=this.session.addMarker(M.markerRange,"ace_composition_marker","text")},x.prototype.setCompositionText=function(M){var O=this.session.selection.cursor;this.addToken(M,"composition_placeholder",O.row,O.column),this.$moveTextAreaToCursor()},x.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),s.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var M=this.session.selection.cursor;this.removeExtraToken(M.row,M.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},x.prototype.setGhostText=function(M,O){var _=this.session.selection.cursor,k=O||{row:_.row,column:_.column};this.removeGhostText();var S=this.$calculateWrappedTextChunks(M,k);this.addToken(S[0].text,"ghost_text",k.row,k.column),this.$ghostText={text:M,position:{row:k.row,column:k.column}};var C=s.createElement("div");if(S.length>1){var L=this.hideTokensAfterPosition(k.row,k.column),I;S.slice(1).forEach(function(W){var j=s.createElement("div"),U=s.createElement("span");U.className="ace_ghost_text",W.wrapped&&(j.className="ghost_text_line_wrapped"),W.text.length===0&&(W.text=" "),U.appendChild(s.createTextNode(W.text)),j.appendChild(U),C.appendChild(j),I=j}),L.forEach(function(W){var j=s.createElement("span");A(W.type)||(j.className="ace_"+W.type.replace(/\./g," ace_")),j.appendChild(s.createTextNode(W.value)),I.appendChild(j)}),this.$ghostTextWidget={el:C,row:k.row,column:k.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var F=this.$cursorLayer.getPixelPosition(k,!0),R=this.container,B=R.getBoundingClientRect().height,N=S.length*this.lineHeight,z=N<B-F.top;if(z)return;N<B?this.scrollBy(0,(S.length-1)*this.lineHeight):this.scrollToRow(k.row)}},x.prototype.$calculateWrappedTextChunks=function(M,O){var _=this.$size.scrollerWidth-this.$padding*2,k=Math.floor(_/this.characterWidth)-2;k=k<=0?60:k;for(var S=M.split(/\r?\n/),C=[],L=0;L<S.length;L++){var I=this.session.$getDisplayTokens(S[L],O.column),F=this.session.$computeWrapSplits(I,k,this.session.$tabSize);if(F.length>0){var R=0;F.push(S[L].length);for(var B=0;B<F.length;B++){var N=S[L].slice(R,F[B]);C.push({text:N,wrapped:!0}),R=F[B]}}else C.push({text:S[L],wrapped:!1})}return C},x.prototype.removeGhostText=function(){if(this.$ghostText){var M=this.$ghostText.position;this.removeExtraToken(M.row,M.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},x.prototype.addToken=function(M,O,_,k){var S=this.session;S.bgTokenizer.lines[_]=null;var C={type:O,value:M},L=S.getTokens(_);if(k==null||!L.length)L.push(C);else for(var I=0,F=0;F<L.length;F++){var R=L[F];if(I+=R.value.length,k<=I){var B=R.value.length-(I-k),N=R.value.slice(0,B),z=R.value.slice(B);L.splice(F,1,{type:R.type,value:N},C,{type:R.type,value:z});break}}this.updateLines(_,_)},x.prototype.hideTokensAfterPosition=function(M,O){for(var _=this.session.getTokens(M),k=0,S=!1,C=[],L=0;L<_.length;L++){var I=_[L];if(k+=I.value.length,I.type!=="ghost_text"){if(S){C.push({type:I.type,value:I.value}),I.type="hidden_token";continue}k===O&&(S=!0)}}return this.updateLines(M,M),C},x.prototype.removeExtraToken=function(M,O){this.session.bgTokenizer.lines[M]=null,this.updateLines(M,M)},x.prototype.setTheme=function(M,O){var _=this;if(this.$themeId=M,_._dispatchEvent("themeChange",{theme:M}),!M||typeof M=="string"){var k=M||this.$options.theme.initialValue;o.loadModule(["theme",k],S)}else S(M);function S(C){if(_.$themeId!=M)return O&&O();if(!C||!C.cssClass)throw new Error("couldn't load module "+M+" or it didn't call define");C.$id&&(_.$themeId=C.$id),s.importCssString(C.cssText,C.cssClass,_.container),_.theme&&s.removeCssClass(_.container,_.theme.cssClass);var L="padding"in C?C.padding:"padding"in(_.theme||{})?4:_.$padding;if(_.$padding&&L!=_.$padding&&_.setPadding(L),_.$gutterLayer){var I=C.$showGutterCursorMarker;I&&!_.$gutterLayer.$showCursorMarker?_.$gutterLayer.$showCursorMarker="theme":!I&&_.$gutterLayer.$showCursorMarker=="theme"&&(_.$gutterLayer.$showCursorMarker=null)}_.$theme=C.cssClass,_.theme=C,s.addCssClass(_.container,C.cssClass),s.setCssClass(_.container,"ace_dark",C.isDark),_.$size&&(_.$size.width=0,_.$updateSizeAsync()),_._dispatchEvent("themeLoaded",{theme:C}),O&&O(),y.isSafari&&_.scroller&&(_.scroller.style.background="red",_.scroller.style.background="")}},x.prototype.getTheme=function(){return this.$themeId},x.prototype.setStyle=function(M,O){s.setCssClass(this.container,M,O!==!1)},x.prototype.unsetStyle=function(M){s.removeCssClass(this.container,M)},x.prototype.setCursorStyle=function(M){s.setStyle(this.scroller.style,"cursor",M)},x.prototype.setMouseCursor=function(M){s.setStyle(this.scroller.style,"cursor",M)},x.prototype.attachToShadowRoot=function(){s.importCssString(E,"ace_editor.css",this.container)},x.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},x.prototype.$updateCustomScrollbar=function(M){var O=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),M===!0?(this.scrollBarV=new g(this.container,this),this.scrollBarH=new f(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(_){O.$scrollAnimation||O.session.setScrollTop(_.data-O.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(_){O.$scrollAnimation||O.session.setScrollLeft(_.data-O.scrollMargin.left)}),this.$scrollDecorator?(this.$scrollDecorator.setScrollBarV(this.scrollBarV),this.$scrollDecorator.$updateDecorators()):(this.$scrollDecorator=new w(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators())):(this.scrollBarV=new u(this.container,this),this.scrollBarH=new p(this.container,this),this.scrollBarV.addEventListener("scroll",function(_){O.$scrollAnimation||O.session.setScrollTop(_.data-O.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(_){O.$scrollAnimation||O.session.setScrollLeft(_.data-O.scrollMargin.left)}))},x.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var M=this;this.$resizeTimer=d.delayedCall(function(){M.destroyed||M.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(O){var _=O[0].contentRect.width,k=O[0].contentRect.height;Math.abs(M.$size.width-_)>1||Math.abs(M.$size.height-k)>1?M.$resizeTimer.delay():M.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},x})();T.prototype.CHANGE_CURSOR=1,T.prototype.CHANGE_MARKER=2,T.prototype.CHANGE_GUTTER=4,T.prototype.CHANGE_SCROLL=8,T.prototype.CHANGE_LINES=16,T.prototype.CHANGE_TEXT=32,T.prototype.CHANGE_SIZE=64,T.prototype.CHANGE_MARKER_BACK=128,T.prototype.CHANGE_MARKER_FRONT=256,T.prototype.CHANGE_FULL=512,T.prototype.CHANGE_H_SCROLL=1024,T.prototype.$changes=0,T.prototype.$padding=null,T.prototype.$frozen=!1,T.prototype.STEPS=8,i.implement(T.prototype,D),o.defineOptions(T.prototype,"renderer",{useResizeObserver:{set:function(x){!x&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):x&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(x){this.$textLayer.setShowInvisibles(x)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(x){typeof x=="number"&&(this.$printMarginColumn=x),this.$showPrintMargin=!!x,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(x){this.$gutter.style.display=x?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(x){this.$gutterLayer.$useSvgGutterIcons=x},initialValue:!1},showFoldedAnnotations:{set:function(x){this.$gutterLayer.$showFoldedAnnotations=x},initialValue:!1},fadeFoldWidgets:{set:function(x){s.setCssClass(this.$gutter,"ace_fade-fold-widgets",x)},initialValue:!1},showFoldWidgets:{set:function(x){this.$gutterLayer.setShowFoldWidgets(x),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(x){this.$textLayer.setDisplayIndentGuides(x)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(x){this.$textLayer.setHighlightIndentGuides(x)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(x){this.$gutterLayer.setHighlightGutterLine(x),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(x){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(x){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(x){typeof x=="number"&&(x=x+"px"),this.container.style.fontSize=x,this.updateFontSize()},initialValue:12},fontFamily:{set:function(x){this.container.style.fontFamily=x,this.updateFontSize()}},maxLines:{set:function(x){this.updateFull()}},minLines:{set:function(x){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(x){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(x){x=+x||0,this.$scrollPastEnd!=x&&(this.$scrollPastEnd=x,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(x){this.$gutterLayer.$fixedWidth=!!x,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(x){this.$updateCustomScrollbar(x)},initialValue:!1},theme:{set:function(x){this.setTheme(x)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!y.isMobile&&!y.isIE}}),n.VirtualRenderer=T}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(t,n,h){var i=t("../lib/oop"),s=t("../lib/net"),d=t("../lib/event_emitter").EventEmitter,o=t("../config");function l(p){var u="importScripts('"+s.qualifyURL(p)+"');";try{return new Blob([u],{type:"application/javascript"})}catch{var f=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,g=new f;return g.append(u),g.getBlob("application/javascript")}}function r(p){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(o.get("loadWorkerFromBlob")){var u=l(p),f=window.URL||window.webkitURL,g=f.createObjectURL(u);return new Worker(g)}return new Worker(p)}var a=function(p){p.postMessage||(p=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=p,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){i.implement(this,d),this.$createWorkerFromOldConfig=function(p,u,f,g,v){if(t.nameToUrl&&!t.toUrl&&(t.toUrl=t.nameToUrl),o.get("packaged")||!t.toUrl)g=g||o.moduleUrl(u,"worker");else{var b=this.$normalizePath;g=g||b(t.toUrl("ace/worker/worker.js",null,"_"));var D={};p.forEach(function(E){D[E]=b(t.toUrl(E,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=r(g),v&&this.send("importScripts",v),this.$worker.postMessage({init:!0,tlns:D,module:u,classname:f}),this.$worker},this.onMessage=function(p){var u=p.data;switch(u.type){case"event":this._signal(u.name,{data:u.data});break;case"call":var f=this.callbacks[u.id];f&&(f(u.data),delete this.callbacks[u.id]);break;case"error":this.reportError(u.data);break;case"log":window.console&&console.log&&console.log.apply(console,u.data);break}},this.reportError=function(p){window.console&&console.error&&console.error(p)},this.$normalizePath=function(p){return s.qualifyURL(p)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(p){p.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(p,u){this.$worker.postMessage({command:p,args:u})},this.call=function(p,u,f){if(f){var g=this.callbackId++;this.callbacks[g]=f,u.push(g)}this.send(p,u)},this.emit=function(p,u){try{u.data&&u.data.err&&(u.data.err={message:u.data.err.message,stack:u.data.err.stack,code:u.data.err.code}),this.$worker&&this.$worker.postMessage({event:p,data:{data:u.data}})}catch(f){console.error(f.stack)}},this.attachToDocument=function(p){this.$doc&&this.terminate(),this.$doc=p,this.call("setValue",[p.getValue()]),p.on("change",this.changeListener,!0)},this.changeListener=function(p){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),p.action=="insert"?this.deltaQueue.push(p.start,p.lines):this.deltaQueue.push(p.start,p.end)},this.$sendDeltaQueue=function(){var p=this.deltaQueue;p&&(this.deltaQueue=null,p.length>50&&p.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:p}))}}).call(a.prototype);var c=function(p,u,f){var g=null,v=!1,b=Object.create(d),D=[],E=new a({messageBuffer:D,terminate:function(){},postMessage:function(y){D.push(y),g&&(v?setTimeout(w):w())}});E.setEmitSync=function(y){v=y};var w=function(){var y=D.shift();y.command?g[y.command].apply(g,y.args):y.event&&b._signal(y.event,y.data)};return b.postMessage=function(y){E.onMessage({data:y})},b.callback=function(y,A){this.postMessage({type:"call",id:A,data:y})},b.emit=function(y,A){this.postMessage({type:"event",name:y,data:A})},o.loadModule(["worker",u],function(y){for(g=new y[f](b);D.length;)w()}),E};n.UIWorkerClient=c,n.WorkerClient=a,n.createWorker=r}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,n,h){var i=t("./range").Range,s=t("./lib/event_emitter").EventEmitter,d=t("./lib/oop"),o=(function(){function l(r,a,c,p,u,f){var g=this;this.length=a,this.session=r,this.doc=r.getDocument(),this.mainClass=u,this.othersClass=f,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=p,this.$onCursorChange=function(){setTimeout(function(){g.onCursorChange()})},this.$pos=c;var v=r.getUndoManager().$undoStack||r.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=v.length,this.setup(),r.selection.on("changeCursor",this.$onCursorChange)}return l.prototype.setup=function(){var r=this,a=this.doc,c=this.session;this.selectionBefore=c.selection.toJSON(),c.selection.inMultiSelectMode&&c.selection.toSingleRange(),this.pos=a.createAnchor(this.$pos.row,this.$pos.column);var p=this.pos;p.$insertRight=!0,p.detach(),p.markerId=c.addMarker(new i(p.row,p.column,p.row,p.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(u){var f=a.createAnchor(u.row,u.column);f.$insertRight=!0,f.detach(),r.others.push(f)}),c.setUndoSelect(!1)},l.prototype.showOtherMarkers=function(){if(!this.othersActive){var r=this.session,a=this;this.othersActive=!0,this.others.forEach(function(c){c.markerId=r.addMarker(new i(c.row,c.column,c.row,c.column+a.length),a.othersClass,null,!1)})}},l.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var r=0;r<this.others.length;r++)this.session.removeMarker(this.others[r].markerId)}},l.prototype.onUpdate=function(r){if(this.$updating)return this.updateAnchors(r);var a=r;if(a.start.row===a.end.row&&a.start.row===this.pos.row){this.$updating=!0;var c=r.action==="insert"?a.end.column-a.start.column:a.start.column-a.end.column,p=a.start.column>=this.pos.column&&a.start.column<=this.pos.column+this.length+1,u=a.start.column-this.pos.column;if(this.updateAnchors(r),p&&(this.length+=c),p&&!this.session.$fromUndo){if(r.action==="insert")for(var f=this.others.length-1;f>=0;f--){var g=this.others[f],v={row:g.row,column:g.column+u};this.doc.insertMergedLines(v,r.lines)}else if(r.action==="remove")for(var f=this.others.length-1;f>=0;f--){var g=this.others[f],v={row:g.row,column:g.column+u};this.doc.remove(new i(v.row,v.column,v.row,v.column-c))}}this.$updating=!1,this.updateMarkers()}},l.prototype.updateAnchors=function(r){this.pos.onChange(r);for(var a=this.others.length;a--;)this.others[a].onChange(r);this.updateMarkers()},l.prototype.updateMarkers=function(){if(!this.$updating){var r=this,a=this.session,c=function(u,f){a.removeMarker(u.markerId),u.markerId=a.addMarker(new i(u.row,u.column,u.row,u.column+r.length),f,null,!1)};c(this.pos,this.mainClass);for(var p=this.others.length;p--;)c(this.others[p],this.othersClass)}},l.prototype.onCursorChange=function(r){if(!(this.$updating||!this.session)){var a=this.session.selection.getCursor();a.row===this.pos.row&&a.column>=this.pos.column&&a.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",r)):(this.hideOtherMarkers(),this._emit("cursorLeave",r))}},l.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},l.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var r=this.session.getUndoManager(),a=(r.$undoStack||r.$undostack).length-this.$undoStackDepth,c=0;c<a;c++)r.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},l})();d.implement(o.prototype,s),n.PlaceHolder=o}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,h){var i=t("../lib/event"),s=t("../lib/useragent");function d(l,r){return l.row==r.row&&l.column==r.column}function o(l){var r=l.domEvent,a=r.altKey,c=r.shiftKey,p=r.ctrlKey,u=l.getAccelKey(),f=l.getButton();if(p&&s.isMac&&(f=r.button),l.editor.inMultiSelectMode&&f==2){l.editor.textInput.onContextMenu(l.domEvent);return}if(!p&&!a&&!u){f===0&&l.editor.inMultiSelectMode&&l.editor.exitMultiSelectMode();return}if(f===0){var g=l.editor,v=g.selection,b=g.inMultiSelectMode,D=l.getDocumentPosition(),E=v.getCursor(),w=l.inSelection()||v.isEmpty()&&d(D,E),y=l.x,A=l.y,T=function(N){y=N.clientX,A=N.clientY},x=g.session,M=g.renderer.pixelToScreenCoordinates(y,A),O=M,_;if(g.$mouseHandler.$enableJumpToDef)p&&a||u&&a?_=c?"block":"add":a&&g.$blockSelectEnabled&&(_="block");else if(u&&!a){if(_="add",!b&&c)return}else a&&g.$blockSelectEnabled&&(_="block");if(_&&s.isMac&&r.ctrlKey&&g.$mouseHandler.cancelContextMenu(),_=="add"){if(!b&&w)return;if(!b){var k=v.toOrientedRange();g.addSelectionMarker(k)}var S=v.rangeList.rangeAtPoint(D);g.inVirtualSelectionMode=!0,c&&(S=null,k=v.ranges[0]||k,g.removeSelectionMarker(k)),g.once("mouseup",function(){var N=v.toOrientedRange();S&&N.isEmpty()&&d(S.cursor,N.cursor)?v.substractPoint(N.cursor):(c?v.substractPoint(k.cursor):k&&(g.removeSelectionMarker(k),v.addRange(k)),v.addRange(N)),g.inVirtualSelectionMode=!1})}else if(_=="block"){l.stop(),g.inVirtualSelectionMode=!0;var C,L=[],I=function(){var N=g.renderer.pixelToScreenCoordinates(y,A),z=x.screenToDocumentPosition(N.row,N.column,N.offsetX);d(O,N)&&d(z,v.lead)||(O=N,g.selection.moveToPosition(z),g.renderer.scrollCursorIntoView(),g.removeSelectionMarkers(L),L=v.rectangularRangeBlock(O,M),g.$mouseHandler.$clickSelection&&L.length==1&&L[0].isEmpty()&&(L[0]=g.$mouseHandler.$clickSelection.clone()),L.forEach(g.addSelectionMarker,g),g.updateSelectionMarkers())};b&&!u?v.toSingleRange():!b&&u&&(C=v.toOrientedRange(),g.addSelectionMarker(C)),c?M=x.documentToScreenPosition(v.lead):v.moveToPosition(D),O={row:-1,column:-1};var F=function(N){I(),clearInterval(B),g.removeSelectionMarkers(L),L.length||(L=[v.toOrientedRange()]),C&&(g.removeSelectionMarker(C),v.toSingleRange(C));for(var z=0;z<L.length;z++)v.addRange(L[z]);g.inVirtualSelectionMode=!1,g.$mouseHandler.$clickSelection=null},R=I;i.capture(g.container,T,F);var B=setInterval(function(){R()},20);return l.preventDefault()}}}n.onMouseDown=o}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(t,n,h){n.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(s){s.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(s){s.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(s){s.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(s){s.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(s){s.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(s){s.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(s){s.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(s){s.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(s){s.multiSelect.rangeCount>1?s.multiSelect.joinSelections():s.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(s){s.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(s){s.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(s){s.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],n.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(s){s.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(s){return s&&s.inMultiSelectMode}}];var i=t("../keyboard/hash_handler").HashHandler;n.keyboardHandler=new i(n.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(t,n,h){var i=t("./range_list").RangeList,s=t("./range").Range,d=t("./selection").Selection,o=t("./mouse/multi_select_handler").onMouseDown,l=t("./lib/event"),r=t("./lib/lang"),a=t("./commands/multi_select_commands");n.commands=a.defaultCommands.concat(a.multiSelectCommands);var c=t("./search").Search,p=new c;function u(E,w,y){return p.$options.wrap=!0,p.$options.needle=w,p.$options.backwards=y==-1,p.find(E)}var f=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(f.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(E,w){if(E){if(!this.inMultiSelectMode&&this.rangeCount===0){var y=this.toOrientedRange();if(this.rangeList.add(y),this.rangeList.add(E),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),w||this.fromOrientedRange(E);this.rangeList.removeAll(),this.rangeList.add(y),this.$onAddRange(y)}E.cursor||(E.cursor=E.end);var A=this.rangeList.add(E);return this.$onAddRange(E),A.length&&this.$onRemoveRange(A),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),w||this.fromOrientedRange(E)}},this.toSingleRange=function(E){E=E||this.ranges[0];var w=this.rangeList.removeAll();w.length&&this.$onRemoveRange(w),E&&this.fromOrientedRange(E)},this.substractPoint=function(E){var w=this.rangeList.substractPoint(E);if(w)return this.$onRemoveRange(w),w[0]},this.mergeOverlappingRanges=function(){var E=this.rangeList.merge();E.length&&this.$onRemoveRange(E)},this.$onAddRange=function(E){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(E),this._signal("addRange",{range:E})},this.$onRemoveRange=function(E){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var w=this.rangeList.ranges.pop();E.push(w),this.rangeCount=0}for(var y=E.length;y--;){var A=this.ranges.indexOf(E[y]);this.ranges.splice(A,1)}this._signal("removeRange",{ranges:E}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),w=w||this.ranges[0],w&&!w.isEqual(this.getRange())&&this.fromOrientedRange(w)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new i,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var E=this.ranges.length?this.ranges:[this.getRange()],w=[],y=0;y<E.length;y++){var A=E[y],T=A.start.row,x=A.end.row;if(T===x)w.push(A.clone());else{for(w.push(new s(T,A.start.column,T,this.session.getLine(T).length));++T<x;)w.push(this.getLineRange(T,!0));w.push(new s(x,0,x,A.end.column))}y==0&&!this.isBackwards()&&(w=w.reverse())}this.toSingleRange();for(var y=w.length;y--;)this.addRange(w[y])},this.joinSelections=function(){var E=this.rangeList.ranges,w=E[E.length-1],y=s.fromPoints(E[0].start,w.end);this.toSingleRange(),this.setSelectionRange(y,w.cursor==w.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var E=this.rangeList.ranges,w=E[E.length-1],y=s.fromPoints(E[0].start,w.end);this.toSingleRange(),this.setSelectionRange(y,w.cursor==w.start)}else{var A=this.session.documentToScreenPosition(this.cursor),T=this.session.documentToScreenPosition(this.anchor),x=this.rectangularRangeBlock(A,T);x.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(E,w,y){var A=[],T=E.column<w.column;if(T)var x=E.column,M=w.column,O=E.offsetX,_=w.offsetX;else var x=w.column,M=E.column,O=w.offsetX,_=E.offsetX;var k=E.row<w.row;if(k)var S=E.row,C=w.row;else var S=w.row,C=E.row;x<0&&(x=0),S<0&&(S=0),S==C&&(y=!0);for(var L,I=S;I<=C;I++){var F=s.fromPoints(this.session.screenToDocumentPosition(I,x,O),this.session.screenToDocumentPosition(I,M,_));if(F.isEmpty()){if(L&&v(F.end,L))break;L=F.end}F.cursor=T?F.start:F.end,A.push(F)}if(k&&A.reverse(),!y){for(var R=A.length-1;A[R].isEmpty()&&R>0;)R--;if(R>0)for(var B=0;A[B].isEmpty();)B++;for(var N=R;N>=B;N--)A[N].isEmpty()&&A.splice(N,1)}return A}}).call(d.prototype);var g=t("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(E){E.cursor||(E.cursor=E.end);var w=this.getSelectionStyle();return E.marker=this.session.addMarker(E,"ace_selection",w),this.session.$selectionMarkers.push(E),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,E},this.removeSelectionMarker=function(E){if(E.marker){this.session.removeMarker(E.marker);var w=this.session.$selectionMarkers.indexOf(E);w!=-1&&this.session.$selectionMarkers.splice(w,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(E){for(var w=this.session.$selectionMarkers,y=E.length;y--;){var A=E[y];if(A.marker){this.session.removeMarker(A.marker);var T=w.indexOf(A);T!=-1&&w.splice(T,1)}}this.session.selectionMarkerCount=w.length},this.$onAddRange=function(E){this.addSelectionMarker(E.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(E){this.removeSelectionMarkers(E.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(E){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(a.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(E){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(a.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(E){var w=E.command,y=E.editor;if(y.multiSelect){if(w.multiSelectAction)w.multiSelectAction=="forEach"?A=y.forEachSelection(w,E.args):w.multiSelectAction=="forEachLine"?A=y.forEachSelection(w,E.args,!0):w.multiSelectAction=="single"?(y.exitMultiSelectMode(),A=w.exec(y,E.args||{})):A=w.multiSelectAction(y,E.args||{});else{var A=w.exec(y,E.args||{});y.multiSelect.addRange(y.multiSelect.toOrientedRange()),y.multiSelect.mergeOverlappingRanges()}return A}},this.forEachSelection=function(E,w,y){if(!this.inVirtualSelectionMode){var A=y&&y.keepOrder,T=y==!0||y&&y.$byLines,x=this.session,M=this.selection,O=M.rangeList,_=(A?M:O).ranges,k;if(!_.length)return E.exec?E.exec(this,w||{}):E(this,w||{});var S=M._eventRegistry;M._eventRegistry={};var C=new d(x);this.inVirtualSelectionMode=!0;for(var L=_.length;L--;){if(T)for(;L>0&&_[L].start.row==_[L-1].end.row;)L--;C.fromOrientedRange(_[L]),C.index=L,this.selection=x.selection=C;var I=E.exec?E.exec(this,w||{}):E(this,w||{});!k&&I!==void 0&&(k=I),C.toOrientedRange(_[L])}C.detach(),this.selection=x.selection=M,this.inVirtualSelectionMode=!1,M._eventRegistry=S,M.mergeOverlappingRanges(),M.ranges[0]&&M.fromOrientedRange(M.ranges[0]);var F=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),F&&F.from==F.to&&this.renderer.animateScrolling(F.from),k}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var E="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var w=this.multiSelect.rangeList.ranges,y=[],A=0;A<w.length;A++)y.push(this.session.getTextRange(w[A]));var T=this.session.getDocument().getNewLineCharacter();E=y.join(T),E.length==(y.length-1)*T.length&&(E="")}else this.selection.isEmpty()||(E=this.session.getTextRange(this.getSelectionRange()));return E},this.$checkMultiselectChange=function(E,w){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var y=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&w==this.multiSelect.anchor)return;var A=w==this.multiSelect.anchor?y.cursor==y.start?y.end:y.start:y.cursor;A.row!=w.row||this.session.$clipPositionToDocument(A.row,A.column).column!=w.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(E,w,y){if(w=w||{},w.needle=E||w.needle,w.needle==null){var A=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();w.needle=this.session.getTextRange(A)}this.$search.set(w);var T=this.$search.findAll(this.session);if(!T.length)return 0;var x=this.multiSelect;y||x.toSingleRange(T[0]);for(var M=T.length;M--;)x.addRange(T[M],!0);return A&&x.rangeList.rangeAtPoint(A.start)&&x.addRange(A,!0),T.length},this.selectMoreLines=function(E,w){var y=this.selection.toOrientedRange(),A=y.cursor==y.end,T=this.session.documentToScreenPosition(y.cursor);this.selection.$desiredColumn&&(T.column=this.selection.$desiredColumn);var x=this.session.screenToDocumentPosition(T.row+E,T.column);if(y.isEmpty())var O=x;else var M=this.session.documentToScreenPosition(A?y.end:y.start),O=this.session.screenToDocumentPosition(M.row+E,M.column);if(A){var _=s.fromPoints(x,O);_.cursor=_.start}else{var _=s.fromPoints(O,x);_.cursor=_.end}if(_.desiredColumn=T.column,!this.selection.inMultiSelectMode)this.selection.addRange(y);else if(w)var k=y.cursor;this.selection.addRange(_),k&&this.selection.substractPoint(k)},this.transposeSelections=function(E){for(var w=this.session,y=w.multiSelect,A=y.ranges,T=A.length;T--;){var x=A[T];if(x.isEmpty()){var M=w.getWordRange(x.start.row,x.start.column);x.start.row=M.start.row,x.start.column=M.start.column,x.end.row=M.end.row,x.end.column=M.end.column}}y.mergeOverlappingRanges();for(var O=[],T=A.length;T--;){var x=A[T];O.unshift(w.getTextRange(x))}E<0?O.unshift(O.pop()):O.push(O.shift());for(var T=A.length;T--;){var x=A[T],_=x.clone();w.replace(x,O[T]),x.start.row=_.start.row,x.start.column=_.start.column}y.fromOrientedRange(y.ranges[0])},this.selectMore=function(E,w,y){var A=this.session,T=A.multiSelect,x=T.toOrientedRange();if(!(x.isEmpty()&&(x=A.getWordRange(x.start.row,x.start.column),x.cursor=E==-1?x.start:x.end,this.multiSelect.addRange(x),y))){var M=A.getTextRange(x),O=u(A,M,E);O&&(O.cursor=E==-1?O.start:O.end,this.session.unfold(O),this.multiSelect.addRange(O),this.renderer.scrollCursorIntoView(null,.5)),w&&this.multiSelect.substractPoint(x.cursor)}},this.alignCursors=function(){var E=this.session,w=E.multiSelect,y=w.ranges,A=-1,T=y.filter(function(R){if(R.cursor.row==A)return!0;A=R.cursor.row});if(!y.length||T.length==y.length-1){var x=this.selection.getRange(),M=x.start.row,O=x.end.row,_=M==O;if(_){var k=this.session.getLength(),S;do S=this.session.getLine(O);while(/[=:]/.test(S)&&++O<k);do S=this.session.getLine(M);while(/[=:]/.test(S)&&--M>0);M<0&&(M=0),O>=k&&(O=k-1)}var C=this.session.removeFullLines(M,O);C=this.$reAlignText(C,_),this.session.insert({row:M,column:0},C.join(`
959
- `)+`
960
- `),_||(x.start.column=0,x.end.column=C[C.length-1].length),this.selection.setRange(x)}else{T.forEach(function(R){w.substractPoint(R.cursor)});var L=0,I=1/0,F=y.map(function(R){var B=R.cursor,N=E.getLine(B.row),z=N.substr(B.column).search(/\S/g);return z==-1&&(z=0),B.column>L&&(L=B.column),z<I&&(I=z),z});y.forEach(function(R,B){var N=R.cursor,z=L-N.column,W=F[B]-I;z>W?E.insert(N,r.stringRepeat(" ",z-W)):E.remove(new s(N.row,N.column,N.row,N.column-z+W)),R.start.column=R.end.column=L,R.start.row=R.end.row=N.row,R.cursor=R.end}),w.fromOrientedRange(y[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(E,w){var y=!0,A=!0,T,x,M;return E.map(function(C){var L=C.match(/(\s*)(.*?)(\s*)([=:].*)/);return L?T==null?(T=L[1].length,x=L[2].length,M=L[3].length,L):(T+x+M!=L[1].length+L[2].length+L[3].length&&(A=!1),T!=L[1].length&&(y=!1),T>L[1].length&&(T=L[1].length),x<L[2].length&&(x=L[2].length),M>L[3].length&&(M=L[3].length),L):[C]}).map(w?_:y?A?k:_:S);function O(C){return r.stringRepeat(" ",C)}function _(C){return C[2]?O(T)+C[2]+O(x-C[2].length+M)+C[4].replace(/^([=:])\s+/,"$1 "):C[0]}function k(C){return C[2]?O(T+x-C[2].length)+C[2]+O(M)+C[4].replace(/^([=:])\s+/,"$1 "):C[0]}function S(C){return C[2]?O(T)+C[2]+O(M)+C[4].replace(/^([=:])\s+/,"$1 "):C[0]}}}).call(g.prototype);function v(E,w){return E.row==w.row&&E.column==w.column}n.onSessionChange=function(E){var w=E.session;w&&!w.multiSelect&&(w.$selectionMarkers=[],w.selection.$initRangeList(),w.multiSelect=w.selection),this.multiSelect=w&&w.multiSelect;var y=E.oldSession;y&&(y.multiSelect.off("addRange",this.$onAddRange),y.multiSelect.off("removeRange",this.$onRemoveRange),y.multiSelect.off("multiSelect",this.$onMultiSelect),y.multiSelect.off("singleSelect",this.$onSingleSelect),y.multiSelect.lead.off("change",this.$checkMultiselectChange),y.multiSelect.anchor.off("change",this.$checkMultiselectChange)),w&&(w.multiSelect.on("addRange",this.$onAddRange),w.multiSelect.on("removeRange",this.$onRemoveRange),w.multiSelect.on("multiSelect",this.$onMultiSelect),w.multiSelect.on("singleSelect",this.$onSingleSelect),w.multiSelect.lead.on("change",this.$checkMultiselectChange),w.multiSelect.anchor.on("change",this.$checkMultiselectChange)),w&&this.inMultiSelectMode!=w.selection.inMultiSelectMode&&(w.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function b(E){E.$multiselectOnSessionChange||(E.$onAddRange=E.$onAddRange.bind(E),E.$onRemoveRange=E.$onRemoveRange.bind(E),E.$onMultiSelect=E.$onMultiSelect.bind(E),E.$onSingleSelect=E.$onSingleSelect.bind(E),E.$multiselectOnSessionChange=n.onSessionChange.bind(E),E.$checkMultiselectChange=E.$checkMultiselectChange.bind(E),E.$multiselectOnSessionChange(E),E.on("changeSession",E.$multiselectOnSessionChange),E.on("mousedown",o),E.commands.addCommands(a.defaultCommands),D(E))}function D(E){if(!E.textInput)return;var w=E.textInput.getElement(),y=!1;l.addListener(w,"keydown",function(T){var x=T.keyCode==18&&!(T.ctrlKey||T.shiftKey||T.metaKey);E.$blockSelectEnabled&&x?y||(E.renderer.setMouseCursor("crosshair"),y=!0):y&&A()},E),l.addListener(w,"keyup",A,E),l.addListener(w,"blur",A,E);function A(T){y&&(E.renderer.setMouseCursor(""),y=!1)}}n.MultiSelect=b,t("./config").defineOptions(g.prototype,"editor",{enableMultiselect:{set:function(E){b(this),E?this.on("mousedown",o):this.off("mousedown",o)},value:!0},enableBlockSelect:{set:function(E){this.$blockSelectEnabled=E},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,n,h){var i=t("../../range").Range,s=n.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(d,o,l){var r=d.getLine(l);return this.foldingStartMarker.test(r)?"start":o=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(d,o,l){return null},this.indentationBlock=function(d,o,l){var r=/\S/,a=d.getLine(o),c=a.search(r);if(c!=-1){for(var p=l||a.length,u=d.getLength(),f=o,g=o;++o<u;){var v=d.getLine(o).search(r);if(v!=-1){if(v<=c){var b=d.getTokenAt(o,0);if(!b||b.type!=="string")break}g=o}}if(g>f){var D=d.getLine(g).length;return new i(f,p,g,D)}}},this.openingBracketBlock=function(d,o,l,r,a){var c={row:l,column:r+1},p=d.$findClosingBracket(o,c,a);if(p){var u=d.foldWidgets[p.row];return u==null&&(u=d.getFoldWidget(p.row)),u=="start"&&p.row>c.row&&(p.row--,p.column=d.getLine(p.row).length),i.fromPoints(c,p)}},this.closingBracketBlock=function(d,o,l,r,a){var c={row:l,column:r},p=d.$findOpeningBracket(o,c);if(p)return p.column++,c.column--,i.fromPoints(p,c)}}).call(s.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(t,n,h){var i=t("../lib/dom"),s=t("../range").Range,d=t("../config").nls;function o(r,a,c){for(var p=0,u=r.length-1;p<=u;){var f=p+u>>1,g=c(a,r[f]);if(g>0)p=f+1;else if(g<0)u=f-1;else return f}return-(p+1)}function l(r,a,c){var p=r.getAnnotations().sort(s.comparePoints);if(p.length){var u=o(p,{row:a,column:-1},s.comparePoints);u<0&&(u=-u-1),u>=p.length?u=c>0?0:p.length-1:u===0&&c<0&&(u=p.length-1);var f=p[u];if(!(!f||!c)){if(f.row===a){do f=p[u+=c];while(f&&f.row===a);if(!f)return p.slice()}var g=[];a=f.row;do g[c<0?"unshift":"push"](f),f=p[u+=c];while(f&&f.row==a);return g.length&&g}}}n.showErrorMarker=function(r,a){var c=r.session,p=r.getCursorPosition(),u=p.row,f=c.widgetManager.getWidgetsAtRow(u).filter(function(T){return T.type=="errorMarker"})[0];f?f.destroy():u-=a;var g=l(c,u,a),v;if(g){var b=g[0];p.column=(b.pos&&typeof b.column!="number"?b.pos.sc:b.column)||0,p.row=b.row,v=r.renderer.$gutterLayer.$annotations[p.row]}else{if(f)return;v={displayText:[d("error-marker.good-state","Looks good!")],className:"ace_ok"}}r.session.unfold(p.row),r.selection.moveToPosition(p);var D={row:p.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},E=D.el.appendChild(i.createElement("div")),w=D.el.appendChild(i.createElement("div"));w.className="error_widget_arrow "+v.className;var y=r.renderer.$cursorLayer.getPixelPosition(p).left;w.style.left=y+r.renderer.gutterWidth-5+"px",D.el.className="error_widget_wrapper",E.className="error_widget "+v.className,v.displayText.forEach(function(T,x){E.appendChild(i.createTextNode(T)),x<v.displayText.length-1&&E.appendChild(i.createElement("br"))}),E.appendChild(i.createElement("div"));var A=function(T,x,M){if(x===0&&(M==="esc"||M==="return"))return D.destroy(),{command:"null"}};D.destroy=function(){r.$mouseHandler.isMousePressed||(r.keyBinding.removeKeyboardHandler(A),c.widgetManager.removeLineWidget(D),r.off("changeSelection",D.destroy),r.off("changeSession",D.destroy),r.off("mouseup",D.destroy),r.off("change",D.destroy))},r.keyBinding.addKeyboardHandler(A),r.on("changeSelection",D.destroy),r.on("changeSession",D.destroy),r.on("mouseup",D.destroy),r.on("change",D.destroy),r.session.widgetManager.addLineWidget(D),D.el.onmousedown=r.focus.bind(r),r.renderer.scrollCursorIntoView(null,.5,{bottom:D.el.offsetHeight})},i.importCssString(`
961
- .error_widget_wrapper {
962
- background: inherit;
963
- color: inherit;
964
- border:none
965
- }
966
- .error_widget {
967
- border-top: solid 2px;
968
- border-bottom: solid 2px;
969
- margin: 5px 0;
970
- padding: 10px 40px;
971
- white-space: pre-wrap;
972
- }
973
- .error_widget.ace_error, .error_widget_arrow.ace_error{
974
- border-color: #ff5a5a
975
- }
976
- .error_widget.ace_warning, .error_widget_arrow.ace_warning{
977
- border-color: #F1D817
978
- }
979
- .error_widget.ace_info, .error_widget_arrow.ace_info{
980
- border-color: #5a5a5a
981
- }
982
- .error_widget.ace_ok, .error_widget_arrow.ace_ok{
983
- border-color: #5aaa5a
984
- }
985
- .error_widget_arrow {
986
- position: absolute;
987
- border: solid 5px;
988
- border-top-color: transparent!important;
989
- border-right-color: transparent!important;
990
- border-left-color: transparent!important;
991
- top: -5px;
992
- }
993
- `,"error_marker.css",!1)}),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(t,n,h){t("./loader_build")(n);var i=t("./lib/dom"),s=t("./range").Range,d=t("./editor").Editor,o=t("./edit_session").EditSession,l=t("./undomanager").UndoManager,r=t("./virtual_renderer").VirtualRenderer;t("./worker/worker_client"),t("./keyboard/hash_handler"),t("./placeholder"),t("./multi_select"),t("./mode/folding/fold_mode"),t("./theme/textmate"),t("./ext/error_marker"),n.config=t("./config"),n.edit=function(c,p){if(typeof c=="string"){var u=c;if(c=document.getElementById(u),!c)throw new Error("ace.edit can't find div #"+u)}if(c&&c.env&&c.env.editor instanceof d)return c.env.editor;var f="";if(c&&/input|textarea/i.test(c.tagName)){var g=c;f=g.value,c=i.createElement("pre"),g.parentNode.replaceChild(c,g)}else c&&(f=c.textContent,c.innerHTML="");var v=n.createEditSession(f),b=new d(new r(c),v,p),D={document:v,editor:b,onResize:b.resize.bind(b,null)};return g&&(D.textarea=g),b.on("destroy",function(){D.editor.container.env=null}),b.container.env=b.env=D,b},n.createEditSession=function(c,p){var u=new o(c,p);return u.setUndoManager(new l),u},n.Range=s,n.Editor=d,n.EditSession=o,n.UndoManager=l,n.VirtualRenderer=r;var a=n.config.version;n.version=a}),(function(){ace.require(["ace/ace"],function(t){t&&(t.config.init(!0),t.define=ace.define);var n=(function(){return this})();!n&&typeof window<"u"&&(n=window),!n&&typeof self<"u"&&(n=self),n.ace||(n.ace=t);for(var h in t)t.hasOwnProperty(h)&&(n.ace[h]=t[h]);n.ace.default=n.ace,m&&(m.exports=n.ace)})})()})(Yo);var Ri=Yo.exports,Ni={exports:{}};Ni.exports;(function(m,e){var t=200,n="__lodash_hash_undefined__",h=1,i=2,s=9007199254740991,d="[object Arguments]",o="[object Array]",l="[object AsyncFunction]",r="[object Boolean]",a="[object Date]",c="[object Error]",p="[object Function]",u="[object GeneratorFunction]",f="[object Map]",g="[object Number]",v="[object Null]",b="[object Object]",D="[object Promise]",E="[object Proxy]",w="[object RegExp]",y="[object Set]",A="[object String]",T="[object Symbol]",x="[object Undefined]",M="[object WeakMap]",O="[object ArrayBuffer]",_="[object DataView]",k="[object Float32Array]",S="[object Float64Array]",C="[object Int8Array]",L="[object Int16Array]",I="[object Int32Array]",F="[object Uint8Array]",R="[object Uint8ClampedArray]",B="[object Uint16Array]",N="[object Uint32Array]",z=/[\\^$.*+?()[\]{}|]/g,W=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,U={};U[k]=U[S]=U[C]=U[L]=U[I]=U[F]=U[R]=U[B]=U[N]=!0,U[d]=U[o]=U[O]=U[r]=U[_]=U[a]=U[c]=U[p]=U[f]=U[g]=U[b]=U[w]=U[y]=U[A]=U[M]=!1;var K=typeof Ge=="object"&&Ge&&Ge.Object===Object&&Ge,J=typeof self=="object"&&self&&self.Object===Object&&self,Y=K||J||Function("return this")(),X=e&&!e.nodeType&&e,q=X&&!0&&m&&!m.nodeType&&m,ne=q&&q.exports===X,ue=ne&&K.process,Se=(function(){try{return ue&&ue.binding&&ue.binding("util")}catch{}})(),Oe=Se&&Se.isTypedArray;function Ae(H,G){for(var Z=-1,ee=H==null?0:H.length,be=0,le=[];++Z<ee;){var xe=H[Z];G(xe,Z,H)&&(le[be++]=xe)}return le}function Ve(H,G){for(var Z=-1,ee=G.length,be=H.length;++Z<ee;)H[be+Z]=G[Z];return H}function ni(H,G){for(var Z=-1,ee=H==null?0:H.length;++Z<ee;)if(G(H[Z],Z,H))return!0;return!1}function nn(H,G){for(var Z=-1,ee=Array(H);++Z<H;)ee[Z]=G(Z);return ee}function za(H){return function(G){return H(G)}}function Va(H,G){return H.has(G)}function Ua(H,G){return H==null?void 0:H[G]}function Ka(H){var G=-1,Z=Array(H.size);return H.forEach(function(ee,be){Z[++G]=[be,ee]}),Z}function Ga(H,G){return function(Z){return H(G(Z))}}function Ja(H){var G=-1,Z=Array(H.size);return H.forEach(function(ee){Z[++G]=ee}),Z}var Ya=Array.prototype,Qa=Function.prototype,ii=Object.prototype,ts=Y["__core-js_shared__"],wr=Qa.toString,at=ii.hasOwnProperty,Cr=(function(){var H=/[^.]+$/.exec(ts&&ts.keys&&ts.keys.IE_PROTO||"");return H?"Symbol(src)_1."+H:""})(),Sr=ii.toString,Xa=RegExp("^"+wr.call(at).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Er=ne?Y.Buffer:void 0,si=Y.Symbol,Ar=Y.Uint8Array,Dr=ii.propertyIsEnumerable,Za=Ya.splice,Ot=si?si.toStringTag:void 0,$r=Object.getOwnPropertySymbols,qa=Er?Er.isBuffer:void 0,el=Ga(Object.keys,Object),ns=sn(Y,"DataView"),xn=sn(Y,"Map"),is=sn(Y,"Promise"),ss=sn(Y,"Set"),rs=sn(Y,"WeakMap"),_n=sn(Object,"create"),tl=Nt(ns),nl=Nt(xn),il=Nt(is),sl=Nt(ss),rl=Nt(rs),xr=si?si.prototype:void 0,os=xr?xr.valueOf:void 0;function Ft(H){var G=-1,Z=H==null?0:H.length;for(this.clear();++G<Z;){var ee=H[G];this.set(ee[0],ee[1])}}function ol(){this.__data__=_n?_n(null):{},this.size=0}function al(H){var G=this.has(H)&&delete this.__data__[H];return this.size-=G?1:0,G}function ll(H){var G=this.__data__;if(_n){var Z=G[H];return Z===n?void 0:Z}return at.call(G,H)?G[H]:void 0}function cl(H){var G=this.__data__;return _n?G[H]!==void 0:at.call(G,H)}function hl(H,G){var Z=this.__data__;return this.size+=this.has(H)?0:1,Z[H]=_n&&G===void 0?n:G,this}Ft.prototype.clear=ol,Ft.prototype.delete=al,Ft.prototype.get=ll,Ft.prototype.has=cl,Ft.prototype.set=hl;function pt(H){var G=-1,Z=H==null?0:H.length;for(this.clear();++G<Z;){var ee=H[G];this.set(ee[0],ee[1])}}function ul(){this.__data__=[],this.size=0}function pl(H){var G=this.__data__,Z=oi(G,H);if(Z<0)return!1;var ee=G.length-1;return Z==ee?G.pop():Za.call(G,Z,1),--this.size,!0}function dl(H){var G=this.__data__,Z=oi(G,H);return Z<0?void 0:G[Z][1]}function fl(H){return oi(this.__data__,H)>-1}function gl(H,G){var Z=this.__data__,ee=oi(Z,H);return ee<0?(++this.size,Z.push([H,G])):Z[ee][1]=G,this}pt.prototype.clear=ul,pt.prototype.delete=pl,pt.prototype.get=dl,pt.prototype.has=fl,pt.prototype.set=gl;function Rt(H){var G=-1,Z=H==null?0:H.length;for(this.clear();++G<Z;){var ee=H[G];this.set(ee[0],ee[1])}}function ml(){this.size=0,this.__data__={hash:new Ft,map:new(xn||pt),string:new Ft}}function vl(H){var G=ai(this,H).delete(H);return this.size-=G?1:0,G}function yl(H){return ai(this,H).get(H)}function bl(H){return ai(this,H).has(H)}function wl(H,G){var Z=ai(this,H),ee=Z.size;return Z.set(H,G),this.size+=Z.size==ee?0:1,this}Rt.prototype.clear=ml,Rt.prototype.delete=vl,Rt.prototype.get=yl,Rt.prototype.has=bl,Rt.prototype.set=wl;function ri(H){var G=-1,Z=H==null?0:H.length;for(this.__data__=new Rt;++G<Z;)this.add(H[G])}function Cl(H){return this.__data__.set(H,n),this}function Sl(H){return this.__data__.has(H)}ri.prototype.add=ri.prototype.push=Cl,ri.prototype.has=Sl;function Ct(H){var G=this.__data__=new pt(H);this.size=G.size}function El(){this.__data__=new pt,this.size=0}function Al(H){var G=this.__data__,Z=G.delete(H);return this.size=G.size,Z}function Dl(H){return this.__data__.get(H)}function $l(H){return this.__data__.has(H)}function xl(H,G){var Z=this.__data__;if(Z instanceof pt){var ee=Z.__data__;if(!xn||ee.length<t-1)return ee.push([H,G]),this.size=++Z.size,this;Z=this.__data__=new Rt(ee)}return Z.set(H,G),this.size=Z.size,this}Ct.prototype.clear=El,Ct.prototype.delete=Al,Ct.prototype.get=Dl,Ct.prototype.has=$l,Ct.prototype.set=xl;function _l(H,G){var Z=li(H),ee=!Z&&zl(H),be=!Z&&!ee&&as(H),le=!Z&&!ee&&!be&&Rr(H),xe=Z||ee||be||le,Fe=xe?nn(H.length,String):[],Be=Fe.length;for(var De in H)at.call(H,De)&&!(xe&&(De=="length"||be&&(De=="offset"||De=="parent")||le&&(De=="buffer"||De=="byteLength"||De=="byteOffset")||Bl(De,Be)))&&Fe.push(De);return Fe}function oi(H,G){for(var Z=H.length;Z--;)if(Mr(H[Z][0],G))return Z;return-1}function kl(H,G,Z){var ee=G(H);return li(H)?ee:Ve(ee,Z(H))}function kn(H){return H==null?H===void 0?x:v:Ot&&Ot in Object(H)?Rl(H):Hl(H)}function _r(H){return Tn(H)&&kn(H)==d}function kr(H,G,Z,ee,be){return H===G?!0:H==null||G==null||!Tn(H)&&!Tn(G)?H!==H&&G!==G:Tl(H,G,Z,ee,kr,be)}function Tl(H,G,Z,ee,be,le){var xe=li(H),Fe=li(G),Be=xe?o:St(H),De=Fe?o:St(G);Be=Be==d?b:Be,De=De==d?b:De;var Ue=Be==b,et=De==b,Pe=Be==De;if(Pe&&as(H)){if(!as(G))return!1;xe=!0,Ue=!1}if(Pe&&!Ue)return le||(le=new Ct),xe||Rr(H)?Tr(H,G,Z,ee,be,le):Ol(H,G,Be,Z,ee,be,le);if(!(Z&h)){var Je=Ue&&at.call(H,"__wrapped__"),Ye=et&&at.call(G,"__wrapped__");if(Je||Ye){var Et=Je?H.value():H,dt=Ye?G.value():G;return le||(le=new Ct),be(Et,dt,Z,ee,le)}}return Pe?(le||(le=new Ct),Fl(H,G,Z,ee,be,le)):!1}function Ll(H){if(!Fr(H)||Wl(H))return!1;var G=Ir(H)?Xa:W;return G.test(Nt(H))}function Ml(H){return Tn(H)&&Or(H.length)&&!!U[kn(H)]}function Il(H){if(!jl(H))return el(H);var G=[];for(var Z in Object(H))at.call(H,Z)&&Z!="constructor"&&G.push(Z);return G}function Tr(H,G,Z,ee,be,le){var xe=Z&h,Fe=H.length,Be=G.length;if(Fe!=Be&&!(xe&&Be>Fe))return!1;var De=le.get(H);if(De&&le.get(G))return De==G;var Ue=-1,et=!0,Pe=Z&i?new ri:void 0;for(le.set(H,G),le.set(G,H);++Ue<Fe;){var Je=H[Ue],Ye=G[Ue];if(ee)var Et=xe?ee(Ye,Je,Ue,G,H,le):ee(Je,Ye,Ue,H,G,le);if(Et!==void 0){if(Et)continue;et=!1;break}if(Pe){if(!ni(G,function(dt,Bt){if(!Va(Pe,Bt)&&(Je===dt||be(Je,dt,Z,ee,le)))return Pe.push(Bt)})){et=!1;break}}else if(!(Je===Ye||be(Je,Ye,Z,ee,le))){et=!1;break}}return le.delete(H),le.delete(G),et}function Ol(H,G,Z,ee,be,le,xe){switch(Z){case _:if(H.byteLength!=G.byteLength||H.byteOffset!=G.byteOffset)return!1;H=H.buffer,G=G.buffer;case O:return!(H.byteLength!=G.byteLength||!le(new Ar(H),new Ar(G)));case r:case a:case g:return Mr(+H,+G);case c:return H.name==G.name&&H.message==G.message;case w:case A:return H==G+"";case f:var Fe=Ka;case y:var Be=ee&h;if(Fe||(Fe=Ja),H.size!=G.size&&!Be)return!1;var De=xe.get(H);if(De)return De==G;ee|=i,xe.set(H,G);var Ue=Tr(Fe(H),Fe(G),ee,be,le,xe);return xe.delete(H),Ue;case T:if(os)return os.call(H)==os.call(G)}return!1}function Fl(H,G,Z,ee,be,le){var xe=Z&h,Fe=Lr(H),Be=Fe.length,De=Lr(G),Ue=De.length;if(Be!=Ue&&!xe)return!1;for(var et=Be;et--;){var Pe=Fe[et];if(!(xe?Pe in G:at.call(G,Pe)))return!1}var Je=le.get(H);if(Je&&le.get(G))return Je==G;var Ye=!0;le.set(H,G),le.set(G,H);for(var Et=xe;++et<Be;){Pe=Fe[et];var dt=H[Pe],Bt=G[Pe];if(ee)var Nr=xe?ee(Bt,dt,Pe,G,H,le):ee(dt,Bt,Pe,H,G,le);if(!(Nr===void 0?dt===Bt||be(dt,Bt,Z,ee,le):Nr)){Ye=!1;break}Et||(Et=Pe=="constructor")}if(Ye&&!Et){var ci=H.constructor,hi=G.constructor;ci!=hi&&"constructor"in H&&"constructor"in G&&!(typeof ci=="function"&&ci instanceof ci&&typeof hi=="function"&&hi instanceof hi)&&(Ye=!1)}return le.delete(H),le.delete(G),Ye}function Lr(H){return kl(H,Kl,Nl)}function ai(H,G){var Z=H.__data__;return Pl(G)?Z[typeof G=="string"?"string":"hash"]:Z.map}function sn(H,G){var Z=Ua(H,G);return Ll(Z)?Z:void 0}function Rl(H){var G=at.call(H,Ot),Z=H[Ot];try{H[Ot]=void 0;var ee=!0}catch{}var be=Sr.call(H);return ee&&(G?H[Ot]=Z:delete H[Ot]),be}var Nl=$r?function(H){return H==null?[]:(H=Object(H),Ae($r(H),function(G){return Dr.call(H,G)}))}:Gl,St=kn;(ns&&St(new ns(new ArrayBuffer(1)))!=_||xn&&St(new xn)!=f||is&&St(is.resolve())!=D||ss&&St(new ss)!=y||rs&&St(new rs)!=M)&&(St=function(H){var G=kn(H),Z=G==b?H.constructor:void 0,ee=Z?Nt(Z):"";if(ee)switch(ee){case tl:return _;case nl:return f;case il:return D;case sl:return y;case rl:return M}return G});function Bl(H,G){return G=G??s,!!G&&(typeof H=="number"||j.test(H))&&H>-1&&H%1==0&&H<G}function Pl(H){var G=typeof H;return G=="string"||G=="number"||G=="symbol"||G=="boolean"?H!=="__proto__":H===null}function Wl(H){return!!Cr&&Cr in H}function jl(H){var G=H&&H.constructor,Z=typeof G=="function"&&G.prototype||ii;return H===Z}function Hl(H){return Sr.call(H)}function Nt(H){if(H!=null){try{return wr.call(H)}catch{}try{return H+""}catch{}}return""}function Mr(H,G){return H===G||H!==H&&G!==G}var zl=_r((function(){return arguments})())?_r:function(H){return Tn(H)&&at.call(H,"callee")&&!Dr.call(H,"callee")},li=Array.isArray;function Vl(H){return H!=null&&Or(H.length)&&!Ir(H)}var as=qa||Jl;function Ul(H,G){return kr(H,G)}function Ir(H){if(!Fr(H))return!1;var G=kn(H);return G==p||G==u||G==l||G==E}function Or(H){return typeof H=="number"&&H>-1&&H%1==0&&H<=s}function Fr(H){var G=typeof H;return H!=null&&(G=="object"||G=="function")}function Tn(H){return H!=null&&typeof H=="object"}var Rr=Oe?za(Oe):Ml;function Kl(H){return Vl(H)?_l(H):Il(H)}function Gl(){return[]}function Jl(){return!1}m.exports=Ul})(Ni,Ni.exports);var Qo=Ni.exports,st={};Object.defineProperty(st,"__esModule",{value:!0});st.getAceInstance=st.debounce=st.editorEvents=st.editorOptions=void 0;var ou=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"];st.editorOptions=ou;var au=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"];st.editorEvents=au;var lu=function(){var m;return typeof window>"u"?(Ge.window={},m=Ri,delete Ge.window):window.ace?(m=window.ace,m.acequire=window.ace.require||window.ace.acequire):m=Ri,m};st.getAceInstance=lu;var cu=function(m,e){var t=null;return function(){var n=this,h=arguments;clearTimeout(t),t=setTimeout(function(){m.apply(n,h)},e)}};st.debounce=cu;var hu=Yt&&Yt.__extends||(function(){var m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,h){n.__proto__=h}||function(n,h){for(var i in h)Object.prototype.hasOwnProperty.call(h,i)&&(n[i]=h[i])},m(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");m(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Ms=Yt&&Yt.__assign||function(){return Ms=Object.assign||function(m){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var h in e)Object.prototype.hasOwnProperty.call(e,h)&&(m[h]=e[h])}return m},Ms.apply(this,arguments)};Object.defineProperty(Yt,"__esModule",{value:!0});var uu=Ri,te=Ys,Gr=Ws,gi=Qo,hn=st,Jr=(0,hn.getAceInstance)(),pu=(function(m){hu(e,m);function e(t){var n=m.call(this,t)||this;return hn.editorEvents.forEach(function(h){n[h]=n[h].bind(n)}),n.debounce=hn.debounce,n}return e.prototype.isInShadow=function(t){for(var n=t&&t.parentNode;n;){if(n.toString()==="[object ShadowRoot]")return!0;n=n.parentNode}return!1},e.prototype.componentDidMount=function(){var t=this,n=this.props,h=n.className,i=n.onBeforeLoad,s=n.onValidate,d=n.mode,o=n.focus,l=n.theme,r=n.fontSize,a=n.lineHeight,c=n.value,p=n.defaultValue,u=n.showGutter,f=n.wrapEnabled,g=n.showPrintMargin,v=n.scrollMargin,b=v===void 0?[0,0,0,0]:v,D=n.keyboardHandler,E=n.onLoad,w=n.commands,y=n.annotations,A=n.markers,T=n.placeholder;this.editor=Jr.edit(this.refEditor),i&&i(Jr);for(var x=Object.keys(this.props.editorProps),M=0;M<x.length;M++)this.editor[x[M]]=this.props.editorProps[x[M]];this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),this.editor.renderer.setScrollMargin(b[0],b[1],b[2],b[3]),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.getSession().setMode(typeof d=="string"?"ace/mode/".concat(d):d),l&&l!==""&&this.editor.setTheme("ace/theme/".concat(l)),this.editor.setFontSize(typeof r=="number"?"".concat(r,"px"):r),a&&(this.editor.container.style.lineHeight=typeof a=="number"?"".concat(a,"px"):"".concat(a),this.editor.renderer.updateFontSize()),this.editor.getSession().setValue(p||c||""),this.props.navigateToFileEnd&&this.editor.navigateFileEnd(),this.editor.renderer.setShowGutter(u),this.editor.getSession().setUseWrapMode(f),this.editor.setShowPrintMargin(g),this.editor.on("focus",this.onFocus),this.editor.on("blur",this.onBlur),this.editor.on("copy",this.onCopy),this.editor.on("paste",this.onPaste),this.editor.on("change",this.onChange),this.editor.on("input",this.onInput),T&&this.updatePlaceholder(),this.editor.getSession().selection.on("changeSelection",this.onSelectionChange),this.editor.getSession().selection.on("changeCursor",this.onCursorChange),s&&this.editor.getSession().on("changeAnnotation",function(){var _=t.editor.getSession().getAnnotations();t.props.onValidate(_)}),this.editor.session.on("changeScrollTop",this.onScroll),this.editor.getSession().setAnnotations(y||[]),A&&A.length>0&&this.handleMarkers(A);var O=this.editor.$options;hn.editorOptions.forEach(function(_){O.hasOwnProperty(_)?t.editor.setOption(_,t.props[_]):t.props[_]&&console.warn("ReactAce: editor option ".concat(_," was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"))}),this.handleOptions(this.props),Array.isArray(w)&&w.forEach(function(_){typeof _.exec=="string"?t.editor.commands.bindKey(_.bindKey,_.exec):t.editor.commands.addCommand(_)}),D&&this.editor.setKeyboardHandler("ace/keyboard/"+D),h&&(this.refEditor.className+=" "+h),E&&E(this.editor),this.editor.resize(),o&&this.editor.focus()},e.prototype.componentDidUpdate=function(t){for(var n=t,h=this.props,i=0;i<hn.editorOptions.length;i++){var s=hn.editorOptions[i];h[s]!==n[s]&&this.editor.setOption(s,h[s])}if(h.className!==n.className){var d=this.refEditor.className,o=d.trim().split(" "),l=n.className.trim().split(" ");l.forEach(function(c){var p=o.indexOf(c);o.splice(p,1)}),this.refEditor.className=" "+h.className+" "+o.join(" ")}var r=this.editor&&h.value!=null&&this.editor.getValue()!==h.value;if(r){this.silent=!0;var a=this.editor.session.selection.toJSON();this.editor.setValue(h.value,h.cursorStart),this.editor.session.selection.fromJSON(a),this.silent=!1}h.placeholder!==n.placeholder&&this.updatePlaceholder(),h.mode!==n.mode&&this.editor.getSession().setMode(typeof h.mode=="string"?"ace/mode/".concat(h.mode):h.mode),h.theme!==n.theme&&this.editor.setTheme("ace/theme/"+h.theme),h.keyboardHandler!==n.keyboardHandler&&(h.keyboardHandler?this.editor.setKeyboardHandler("ace/keyboard/"+h.keyboardHandler):this.editor.setKeyboardHandler(null)),h.fontSize!==n.fontSize&&this.editor.setFontSize(typeof h.fontSize=="number"?"".concat(h.fontSize,"px"):h.fontSize),h.lineHeight!==n.lineHeight&&(this.editor.container.style.lineHeight=typeof h.lineHeight=="number"?"".concat(h.lineHeight,"px"):h.lineHeight,this.editor.renderer.updateFontSize()),h.wrapEnabled!==n.wrapEnabled&&this.editor.getSession().setUseWrapMode(h.wrapEnabled),h.showPrintMargin!==n.showPrintMargin&&this.editor.setShowPrintMargin(h.showPrintMargin),h.showGutter!==n.showGutter&&this.editor.renderer.setShowGutter(h.showGutter),gi(h.setOptions,n.setOptions)||this.handleOptions(h),(r||!gi(h.annotations,n.annotations))&&this.editor.getSession().setAnnotations(h.annotations||[]),!gi(h.markers,n.markers)&&Array.isArray(h.markers)&&this.handleMarkers(h.markers),gi(h.scrollMargin,n.scrollMargin)||this.handleScrollMargins(h.scrollMargin),(t.height!==this.props.height||t.width!==this.props.width)&&this.editor.resize(),this.props.focus&&!t.focus&&this.editor.focus()},e.prototype.handleScrollMargins=function(t){t===void 0&&(t=[0,0,0,0]),this.editor.renderer.setScrollMargin(t[0],t[1],t[2],t[3])},e.prototype.componentWillUnmount=function(){this.editor&&(this.editor.destroy(),this.editor=null)},e.prototype.onChange=function(t){if(this.editor&&this.props.onChange&&!this.silent){var n=this.editor.getValue();this.props.onChange(n,t)}},e.prototype.onSelectionChange=function(t){if(this.props.onSelectionChange){var n=this.editor.getSelection();this.props.onSelectionChange(n,t)}},e.prototype.onCursorChange=function(t){if(this.props.onCursorChange){var n=this.editor.getSelection();this.props.onCursorChange(n,t)}},e.prototype.onInput=function(t){this.props.onInput&&this.props.onInput(t),this.props.placeholder&&this.updatePlaceholder()},e.prototype.onFocus=function(t){this.props.onFocus&&this.props.onFocus(t,this.editor)},e.prototype.onBlur=function(t){this.props.onBlur&&this.props.onBlur(t,this.editor)},e.prototype.onCopy=function(t){var n=t.text;this.props.onCopy&&this.props.onCopy(n)},e.prototype.onPaste=function(t){var n=t.text;this.props.onPaste&&this.props.onPaste(n)},e.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},e.prototype.handleOptions=function(t){for(var n=Object.keys(t.setOptions),h=0;h<n.length;h++)this.editor.setOption(n[h],t.setOptions[n[h]])},e.prototype.handleMarkers=function(t){var n=this,h=this.editor.getSession().getMarkers(!0);for(var i in h)h.hasOwnProperty(i)&&this.editor.getSession().removeMarker(h[i].id);h=this.editor.getSession().getMarkers(!1);for(var i in h)h.hasOwnProperty(i)&&h[i].clazz!=="ace_active-line"&&h[i].clazz!=="ace_selected-word"&&this.editor.getSession().removeMarker(h[i].id);t.forEach(function(s){var d=s.startRow,o=s.startCol,l=s.endRow,r=s.endCol,a=s.className,c=s.type,p=s.inFront,u=p===void 0?!1:p,f=new uu.Range(d,o,l,r);n.editor.getSession().addMarker(f,a,c,u)})},e.prototype.updatePlaceholder=function(){var t=this.editor,n=this.props.placeholder,h=!t.session.getValue().length,i=t.renderer.placeholderNode;!h&&i?(t.renderer.scroller.removeChild(t.renderer.placeholderNode),t.renderer.placeholderNode=null):h&&!i?(i=t.renderer.placeholderNode=document.createElement("div"),i.textContent=n||"",i.className="ace_comment ace_placeholder",i.style.padding="0 9px",i.style.position="absolute",i.style.zIndex="3",t.renderer.scroller.appendChild(i)):h&&i&&(i.textContent=n)},e.prototype.updateRef=function(t){this.refEditor=t},e.prototype.render=function(){var t=this.props,n=t.name,h=t.width,i=t.height,s=t.style,d=Ms({width:h,height:i},s);return Gr.createElement("div",{ref:this.updateRef,id:n,style:d})},e.propTypes={mode:te.oneOfType([te.string,te.object]),focus:te.bool,theme:te.string,name:te.string,className:te.string,height:te.string,width:te.string,fontSize:te.oneOfType([te.number,te.string]),lineHeight:te.oneOfType([te.number,te.string]),showGutter:te.bool,onChange:te.func,onCopy:te.func,onPaste:te.func,onFocus:te.func,onInput:te.func,onBlur:te.func,onScroll:te.func,value:te.string,defaultValue:te.string,onLoad:te.func,onSelectionChange:te.func,onCursorChange:te.func,onBeforeLoad:te.func,onValidate:te.func,minLines:te.number,maxLines:te.number,readOnly:te.bool,highlightActiveLine:te.bool,tabSize:te.number,showPrintMargin:te.bool,cursorStart:te.number,debounceChangePeriod:te.number,editorProps:te.object,setOptions:te.object,style:te.object,scrollMargin:te.array,annotations:te.array,markers:te.array,keyboardHandler:te.string,wrapEnabled:te.bool,enableSnippets:te.bool,enableBasicAutocompletion:te.oneOfType([te.bool,te.array]),enableLiveAutocompletion:te.oneOfType([te.bool,te.array]),navigateToFileEnd:te.bool,commands:te.array,placeholder:te.string},e.defaultProps={name:"ace-editor",focus:!1,mode:"",theme:"",height:"500px",width:"500px",fontSize:12,enableSnippets:!1,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,placeholder:null,navigateToFileEnd:!0},e})(Gr.Component);Yt.default=pu;var Gn={},It={},Xo={exports:{}};(function(m,e){ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(t,n,h){var i=t("./lib/oop");t("./lib/lang");var s=t("./lib/event_emitter").EventEmitter,d=t("./editor").Editor,o=t("./virtual_renderer").VirtualRenderer,l=t("./edit_session").EditSession,r;r=function(a,c,p){this.BELOW=1,this.BESIDE=0,this.$container=a,this.$theme=c,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(p||1),this.$cEditor=this.$editors[0],this.on("focus",function(u){this.$cEditor=u}.bind(this))},(function(){i.implement(this,s),this.$createEditor=function(){var a=document.createElement("div");a.className=this.$editorCSS,a.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(a);var c=new d(new o(a,this.$theme));return c.on("focus",function(){this._emit("focus",c)}.bind(this)),this.$editors.push(c),c.setFontSize(this.$fontSize),c},this.setSplits=function(a){var c;if(a<1)throw"The number of splits have to be > 0!";if(a!=this.$splits){if(a>this.$splits){for(;this.$splits<this.$editors.length&&this.$splits<a;)c=this.$editors[this.$splits],this.$container.appendChild(c.container),c.setFontSize(this.$fontSize),this.$splits++;for(;this.$splits<a;)this.$createEditor(),this.$splits++}else for(;this.$splits>a;)c=this.$editors[this.$splits-1],this.$container.removeChild(c.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(a){return this.$editors[a]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(a){this.$editors.forEach(function(c){c.setTheme(a)})},this.setKeyboardHandler=function(a){this.$editors.forEach(function(c){c.setKeyboardHandler(a)})},this.forEach=function(a,c){this.$editors.forEach(a,c)},this.$fontSize="",this.setFontSize=function(a){this.$fontSize=a,this.forEach(function(c){c.setFontSize(a)})},this.$cloneSession=function(a){var c=new l(a.getDocument(),a.getMode()),p=a.getUndoManager();return c.setUndoManager(p),c.setTabSize(a.getTabSize()),c.setUseSoftTabs(a.getUseSoftTabs()),c.setOverwrite(a.getOverwrite()),c.setBreakpoints(a.getBreakpoints()),c.setUseWrapMode(a.getUseWrapMode()),c.setUseWorker(a.getUseWorker()),c.setWrapLimitRange(a.$wrapLimitRange.min,a.$wrapLimitRange.max),c.$foldData=a.$cloneFoldData(),c},this.setSession=function(a,c){var p;c==null?p=this.$cEditor:p=this.$editors[c];var u=this.$editors.some(function(f){return f.session===a});return u&&(a=this.$cloneSession(a)),p.setSession(a),a},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(a){this.$orientation!=a&&(this.$orientation=a,this.resize())},this.resize=function(){var a=this.$container.clientWidth,c=this.$container.clientHeight,p;if(this.$orientation==this.BESIDE)for(var u=a/this.$splits,f=0;f<this.$splits;f++)p=this.$editors[f],p.container.style.width=u+"px",p.container.style.top="0px",p.container.style.left=f*u+"px",p.container.style.height=c+"px",p.resize();else for(var g=c/this.$splits,f=0;f<this.$splits;f++)p=this.$editors[f],p.container.style.width=a+"px",p.container.style.top=f*g+"px",p.container.style.left="0px",p.container.style.height=g+"px",p.resize()}}).call(r.prototype),n.Split=r}),ace.define("ace/ext/split",["require","exports","module","ace/ext/split","ace/split"],function(t,n,h){h.exports=t("../split")}),(function(){ace.require(["ace/ext/split"],function(t){m&&(m.exports=t)})})()})(Xo);var du=Xo.exports,fu="Expected a function",Zo="__lodash_hash_undefined__",gu="[object Function]",mu="[object GeneratorFunction]",vu="[object Symbol]",yu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bu=/^\w*$/,wu=/^\./,Cu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Su=/[\\^$.*+?()[\]{}|]/g,Eu=/\\(\\)?/g,Au=/^\[object .+?Constructor\]$/,Du=typeof Ge=="object"&&Ge&&Ge.Object===Object&&Ge,$u=typeof self=="object"&&self&&self.Object===Object&&self,er=Du||$u||Function("return this")();function xu(m,e){return m==null?void 0:m[e]}function _u(m){var e=!1;if(m!=null&&typeof m.toString!="function")try{e=!!(m+"")}catch{}return e}var ku=Array.prototype,Tu=Function.prototype,qo=Object.prototype,fs=er["__core-js_shared__"],Yr=(function(){var m=/[^.]+$/.exec(fs&&fs.keys&&fs.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""})(),ea=Tu.toString,tr=qo.hasOwnProperty,ta=qo.toString,Lu=RegExp("^"+ea.call(tr).replace(Su,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qr=er.Symbol,Mu=ku.splice,Iu=na(er,"Map"),Jn=na(Object,"create"),Xr=Qr?Qr.prototype:void 0,Zr=Xr?Xr.toString:void 0;function Qt(m){var e=-1,t=m?m.length:0;for(this.clear();++e<t;){var n=m[e];this.set(n[0],n[1])}}function Ou(){this.__data__=Jn?Jn(null):{}}function Fu(m){return this.has(m)&&delete this.__data__[m]}function Ru(m){var e=this.__data__;if(Jn){var t=e[m];return t===Zo?void 0:t}return tr.call(e,m)?e[m]:void 0}function Nu(m){var e=this.__data__;return Jn?e[m]!==void 0:tr.call(e,m)}function Bu(m,e){var t=this.__data__;return t[m]=Jn&&e===void 0?Zo:e,this}Qt.prototype.clear=Ou;Qt.prototype.delete=Fu;Qt.prototype.get=Ru;Qt.prototype.has=Nu;Qt.prototype.set=Bu;function Sn(m){var e=-1,t=m?m.length:0;for(this.clear();++e<t;){var n=m[e];this.set(n[0],n[1])}}function Pu(){this.__data__=[]}function Wu(m){var e=this.__data__,t=zi(e,m);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Mu.call(e,t,1),!0}function ju(m){var e=this.__data__,t=zi(e,m);return t<0?void 0:e[t][1]}function Hu(m){return zi(this.__data__,m)>-1}function zu(m,e){var t=this.__data__,n=zi(t,m);return n<0?t.push([m,e]):t[n][1]=e,this}Sn.prototype.clear=Pu;Sn.prototype.delete=Wu;Sn.prototype.get=ju;Sn.prototype.has=Hu;Sn.prototype.set=zu;function qt(m){var e=-1,t=m?m.length:0;for(this.clear();++e<t;){var n=m[e];this.set(n[0],n[1])}}function Vu(){this.__data__={hash:new Qt,map:new(Iu||Sn),string:new Qt}}function Uu(m){return Vi(this,m).delete(m)}function Ku(m){return Vi(this,m).get(m)}function Gu(m){return Vi(this,m).has(m)}function Ju(m,e){return Vi(this,m).set(m,e),this}qt.prototype.clear=Vu;qt.prototype.delete=Uu;qt.prototype.get=Ku;qt.prototype.has=Gu;qt.prototype.set=Ju;function zi(m,e){for(var t=m.length;t--;)if(rp(m[t][0],e))return t;return-1}function Yu(m,e){e=qu(e,m)?[e]:Zu(e);for(var t=0,n=e.length;m!=null&&t<n;)m=m[ip(e[t++])];return t&&t==n?m:void 0}function Qu(m){if(!sa(m)||tp(m))return!1;var e=op(m)||_u(m)?Lu:Au;return e.test(sp(m))}function Xu(m){if(typeof m=="string")return m;if(ir(m))return Zr?Zr.call(m):"";var e=m+"";return e=="0"&&1/m==-1/0?"-0":e}function Zu(m){return ia(m)?m:np(m)}function Vi(m,e){var t=m.__data__;return ep(e)?t[typeof e=="string"?"string":"hash"]:t.map}function na(m,e){var t=xu(m,e);return Qu(t)?t:void 0}function qu(m,e){if(ia(m))return!1;var t=typeof m;return t=="number"||t=="symbol"||t=="boolean"||m==null||ir(m)?!0:bu.test(m)||!yu.test(m)||e!=null&&m in Object(e)}function ep(m){var e=typeof m;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?m!=="__proto__":m===null}function tp(m){return!!Yr&&Yr in m}var np=nr(function(m){m=lp(m);var e=[];return wu.test(m)&&e.push(""),m.replace(Cu,function(t,n,h,i){e.push(h?i.replace(Eu,"$1"):n||t)}),e});function ip(m){if(typeof m=="string"||ir(m))return m;var e=m+"";return e=="0"&&1/m==-1/0?"-0":e}function sp(m){if(m!=null){try{return ea.call(m)}catch{}try{return m+""}catch{}}return""}function nr(m,e){if(typeof m!="function"||e&&typeof e!="function")throw new TypeError(fu);var t=function(){var n=arguments,h=e?e.apply(this,n):n[0],i=t.cache;if(i.has(h))return i.get(h);var s=m.apply(this,n);return t.cache=i.set(h,s),s};return t.cache=new(nr.Cache||qt),t}nr.Cache=qt;function rp(m,e){return m===e||m!==m&&e!==e}var ia=Array.isArray;function op(m){var e=sa(m)?ta.call(m):"";return e==gu||e==mu}function sa(m){var e=typeof m;return!!m&&(e=="object"||e=="function")}function ap(m){return!!m&&typeof m=="object"}function ir(m){return typeof m=="symbol"||ap(m)&&ta.call(m)==vu}function lp(m){return m==null?"":Xu(m)}function cp(m,e,t){var n=m==null?void 0:Yu(m,e);return n===void 0?t:n}var hp=cp,up=It&&It.__extends||(function(){var m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,h){n.__proto__=h}||function(n,h){for(var i in h)Object.prototype.hasOwnProperty.call(h,i)&&(n[i]=h[i])},m(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");m(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Is=It&&It.__assign||function(){return Is=Object.assign||function(m){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var h in e)Object.prototype.hasOwnProperty.call(e,h)&&(m[h]=e[h])}return m},Is.apply(this,arguments)};Object.defineProperty(It,"__esModule",{value:!0});var Ht=st,gs=(0,Ht.getAceInstance)(),pp=Ri,dp=du,ie=Ys,qr=Ws,ms=Qo,ft=hp,fp=(function(m){up(e,m);function e(t){var n=m.call(this,t)||this;return Ht.editorEvents.forEach(function(h){n[h]=n[h].bind(n)}),n.debounce=Ht.debounce,n}return e.prototype.isInShadow=function(t){for(var n=t&&t.parentNode;n;){if(n.toString()==="[object ShadowRoot]")return!0;n=n.parentNode}return!1},e.prototype.componentDidMount=function(){var t=this,n=this.props,h=n.className,i=n.onBeforeLoad,s=n.mode,d=n.focus,o=n.theme,l=n.fontSize,r=n.value,a=n.defaultValue,c=n.cursorStart,p=n.showGutter,u=n.wrapEnabled,f=n.showPrintMargin,g=n.scrollMargin,v=g===void 0?[0,0,0,0]:g,b=n.keyboardHandler,D=n.onLoad,E=n.commands,w=n.annotations,y=n.markers,A=n.splits;this.editor=gs.edit(this.refEditor),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.setTheme("ace/theme/".concat(o)),i&&i(gs);var T=Object.keys(this.props.editorProps),x=new dp.Split(this.editor.container,"ace/theme/".concat(o),A);this.editor.env.split=x,this.splitEditor=x.getEditor(0),this.split=x,this.editor.setShowPrintMargin(!1),this.editor.renderer.setShowGutter(!1);var M=this.splitEditor.$options;this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),x.forEach(function(_,k){for(var S=0;S<T.length;S++)_[T[S]]=t.props.editorProps[T[S]];var C=ft(a,k),L=ft(r,k,"");_.session.setUndoManager(new gs.UndoManager),_.setTheme("ace/theme/".concat(o)),_.renderer.setScrollMargin(v[0],v[1],v[2],v[3]),_.getSession().setMode("ace/mode/".concat(s)),_.setFontSize(l),_.renderer.setShowGutter(p),_.getSession().setUseWrapMode(u),_.setShowPrintMargin(f),_.on("focus",t.onFocus),_.on("blur",t.onBlur),_.on("input",t.onInput),_.on("copy",t.onCopy),_.on("paste",t.onPaste),_.on("change",t.onChange),_.getSession().selection.on("changeSelection",t.onSelectionChange),_.getSession().selection.on("changeCursor",t.onCursorChange),_.session.on("changeScrollTop",t.onScroll),_.setValue(C===void 0?L:C,c);var I=ft(w,k,[]),F=ft(y,k,[]);_.getSession().setAnnotations(I),F&&F.length>0&&t.handleMarkers(F,_);for(var S=0;S<Ht.editorOptions.length;S++){var R=Ht.editorOptions[S];M.hasOwnProperty(R)?_.setOption(R,t.props[R]):t.props[R]&&console.warn("ReaceAce: editor option ".concat(R," was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"))}t.handleOptions(t.props,_),Array.isArray(E)&&E.forEach(function(B){typeof B.exec=="string"?_.commands.bindKey(B.bindKey,B.exec):_.commands.addCommand(B)}),b&&_.setKeyboardHandler("ace/keyboard/"+b)}),h&&(this.refEditor.className+=" "+h),d&&this.splitEditor.focus();var O=this.editor.env.split;O.setOrientation(this.props.orientation==="below"?O.BELOW:O.BESIDE),O.resize(!0),D&&D(O)},e.prototype.componentDidUpdate=function(t){var n=this,h=t,i=this.props,s=this.editor.env.split;if(i.splits!==h.splits&&s.setSplits(i.splits),i.orientation!==h.orientation&&s.setOrientation(i.orientation==="below"?s.BELOW:s.BESIDE),s.forEach(function(r,a){i.mode!==h.mode&&r.getSession().setMode("ace/mode/"+i.mode),i.keyboardHandler!==h.keyboardHandler&&(i.keyboardHandler?r.setKeyboardHandler("ace/keyboard/"+i.keyboardHandler):r.setKeyboardHandler(null)),i.fontSize!==h.fontSize&&r.setFontSize(i.fontSize),i.wrapEnabled!==h.wrapEnabled&&r.getSession().setUseWrapMode(i.wrapEnabled),i.showPrintMargin!==h.showPrintMargin&&r.setShowPrintMargin(i.showPrintMargin),i.showGutter!==h.showGutter&&r.renderer.setShowGutter(i.showGutter);for(var c=0;c<Ht.editorOptions.length;c++){var p=Ht.editorOptions[c];i[p]!==h[p]&&r.setOption(p,i[p])}ms(i.setOptions,h.setOptions)||n.handleOptions(i,r);var u=ft(i.value,a,"");if(r.getValue()!==u){n.silent=!0;var f=r.session.selection.toJSON();r.setValue(u,i.cursorStart),r.session.selection.fromJSON(f),n.silent=!1}var g=ft(i.annotations,a,[]),v=ft(h.annotations,a,[]);ms(g,v)||r.getSession().setAnnotations(g);var b=ft(i.markers,a,[]),D=ft(h.markers,a,[]);!ms(b,D)&&Array.isArray(b)&&n.handleMarkers(b,r)}),i.className!==h.className){var d=this.refEditor.className,o=d.trim().split(" "),l=h.className.trim().split(" ");l.forEach(function(r){var a=o.indexOf(r);o.splice(a,1)}),this.refEditor.className=" "+i.className+" "+o.join(" ")}i.theme!==h.theme&&s.setTheme("ace/theme/"+i.theme),i.focus&&!h.focus&&this.splitEditor.focus(),(i.height!==this.props.height||i.width!==this.props.width)&&this.editor.resize()},e.prototype.componentWillUnmount=function(){this.editor.destroy(),this.editor=null},e.prototype.onChange=function(t){if(this.props.onChange&&!this.silent){var n=[];this.editor.env.split.forEach(function(h){n.push(h.getValue())}),this.props.onChange(n,t)}},e.prototype.onSelectionChange=function(t){if(this.props.onSelectionChange){var n=[];this.editor.env.split.forEach(function(h){n.push(h.getSelection())}),this.props.onSelectionChange(n,t)}},e.prototype.onCursorChange=function(t){if(this.props.onCursorChange){var n=[];this.editor.env.split.forEach(function(h){n.push(h.getSelection())}),this.props.onCursorChange(n,t)}},e.prototype.onFocus=function(t){this.props.onFocus&&this.props.onFocus(t)},e.prototype.onInput=function(t){this.props.onInput&&this.props.onInput(t)},e.prototype.onBlur=function(t){this.props.onBlur&&this.props.onBlur(t)},e.prototype.onCopy=function(t){this.props.onCopy&&this.props.onCopy(t)},e.prototype.onPaste=function(t){this.props.onPaste&&this.props.onPaste(t)},e.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},e.prototype.handleOptions=function(t,n){for(var h=Object.keys(t.setOptions),i=0;i<h.length;i++)n.setOption(h[i],t.setOptions[h[i]])},e.prototype.handleMarkers=function(t,n){var h=n.getSession().getMarkers(!0);for(var i in h)h.hasOwnProperty(i)&&n.getSession().removeMarker(h[i].id);h=n.getSession().getMarkers(!1);for(var i in h)h.hasOwnProperty(i)&&n.getSession().removeMarker(h[i].id);t.forEach(function(s){var d=s.startRow,o=s.startCol,l=s.endRow,r=s.endCol,a=s.className,c=s.type,p=s.inFront,u=p===void 0?!1:p,f=new pp.Range(d,o,l,r);n.getSession().addMarker(f,a,c,u)})},e.prototype.updateRef=function(t){this.refEditor=t},e.prototype.render=function(){var t=this.props,n=t.name,h=t.width,i=t.height,s=t.style,d=Is({width:h,height:i},s);return qr.createElement("div",{ref:this.updateRef,id:n,style:d})},e.propTypes={className:ie.string,debounceChangePeriod:ie.number,defaultValue:ie.arrayOf(ie.string),focus:ie.bool,fontSize:ie.oneOfType([ie.number,ie.string]),height:ie.string,mode:ie.string,name:ie.string,onBlur:ie.func,onChange:ie.func,onCopy:ie.func,onFocus:ie.func,onInput:ie.func,onLoad:ie.func,onPaste:ie.func,onScroll:ie.func,orientation:ie.string,showGutter:ie.bool,splits:ie.number,theme:ie.string,value:ie.arrayOf(ie.string),width:ie.string,onSelectionChange:ie.func,onCursorChange:ie.func,onBeforeLoad:ie.func,minLines:ie.number,maxLines:ie.number,readOnly:ie.bool,highlightActiveLine:ie.bool,tabSize:ie.number,showPrintMargin:ie.bool,cursorStart:ie.number,editorProps:ie.object,setOptions:ie.object,style:ie.object,scrollMargin:ie.array,annotations:ie.array,markers:ie.array,keyboardHandler:ie.string,wrapEnabled:ie.bool,enableBasicAutocompletion:ie.oneOfType([ie.bool,ie.array]),enableLiveAutocompletion:ie.oneOfType([ie.bool,ie.array]),commands:ie.array},e.defaultProps={name:"ace-editor",focus:!1,orientation:"beside",splits:2,mode:"",theme:"",height:"500px",width:"500px",value:[],fontSize:12,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1},e})(qr.Component);It.default=fp;var ra={exports:{}};(function(m){var e=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},t=-1,n=1,h=0;e.Diff=function(i,s){return[i,s]},e.prototype.diff_main=function(i,s,d,o){typeof o>"u"&&(this.Diff_Timeout<=0?o=Number.MAX_VALUE:o=new Date().getTime()+this.Diff_Timeout*1e3);var l=o;if(i==null||s==null)throw new Error("Null input. (diff_main)");if(i==s)return i?[new e.Diff(h,i)]:[];typeof d>"u"&&(d=!0);var r=d,a=this.diff_commonPrefix(i,s),c=i.substring(0,a);i=i.substring(a),s=s.substring(a),a=this.diff_commonSuffix(i,s);var p=i.substring(i.length-a);i=i.substring(0,i.length-a),s=s.substring(0,s.length-a);var u=this.diff_compute_(i,s,r,l);return c&&u.unshift(new e.Diff(h,c)),p&&u.push(new e.Diff(h,p)),this.diff_cleanupMerge(u),u},e.prototype.diff_compute_=function(i,s,d,o){var l;if(!i)return[new e.Diff(n,s)];if(!s)return[new e.Diff(t,i)];var r=i.length>s.length?i:s,a=i.length>s.length?s:i,c=r.indexOf(a);if(c!=-1)return l=[new e.Diff(n,r.substring(0,c)),new e.Diff(h,a),new e.Diff(n,r.substring(c+a.length))],i.length>s.length&&(l[0][0]=l[2][0]=t),l;if(a.length==1)return[new e.Diff(t,i),new e.Diff(n,s)];var p=this.diff_halfMatch_(i,s);if(p){var u=p[0],f=p[1],g=p[2],v=p[3],b=p[4],D=this.diff_main(u,g,d,o),E=this.diff_main(f,v,d,o);return D.concat([new e.Diff(h,b)],E)}return d&&i.length>100&&s.length>100?this.diff_lineMode_(i,s,o):this.diff_bisect_(i,s,o)},e.prototype.diff_lineMode_=function(i,s,d){var o=this.diff_linesToChars_(i,s);i=o.chars1,s=o.chars2;var l=o.lineArray,r=this.diff_main(i,s,!1,d);this.diff_charsToLines_(r,l),this.diff_cleanupSemantic(r),r.push(new e.Diff(h,""));for(var a=0,c=0,p=0,u="",f="";a<r.length;){switch(r[a][0]){case n:p++,f+=r[a][1];break;case t:c++,u+=r[a][1];break;case h:if(c>=1&&p>=1){r.splice(a-c-p,c+p),a=a-c-p;for(var g=this.diff_main(u,f,!1,d),v=g.length-1;v>=0;v--)r.splice(a,0,g[v]);a=a+g.length}p=0,c=0,u="",f="";break}a++}return r.pop(),r},e.prototype.diff_bisect_=function(i,s,d){for(var o=i.length,l=s.length,r=Math.ceil((o+l)/2),a=r,c=2*r,p=new Array(c),u=new Array(c),f=0;f<c;f++)p[f]=-1,u[f]=-1;p[a+1]=0,u[a+1]=0;for(var g=o-l,v=g%2!=0,b=0,D=0,E=0,w=0,y=0;y<r&&!(new Date().getTime()>d);y++){for(var A=-y+b;A<=y-D;A+=2){var T=a+A,x;A==-y||A!=y&&p[T-1]<p[T+1]?x=p[T+1]:x=p[T-1]+1;for(var M=x-A;x<o&&M<l&&i.charAt(x)==s.charAt(M);)x++,M++;if(p[T]=x,x>o)D+=2;else if(M>l)b+=2;else if(v){var O=a+g-A;if(O>=0&&O<c&&u[O]!=-1){var _=o-u[O];if(x>=_)return this.diff_bisectSplit_(i,s,x,M,d)}}}for(var k=-y+E;k<=y-w;k+=2){var O=a+k,_;k==-y||k!=y&&u[O-1]<u[O+1]?_=u[O+1]:_=u[O-1]+1;for(var S=_-k;_<o&&S<l&&i.charAt(o-_-1)==s.charAt(l-S-1);)_++,S++;if(u[O]=_,_>o)w+=2;else if(S>l)E+=2;else if(!v){var T=a+g-k;if(T>=0&&T<c&&p[T]!=-1){var x=p[T],M=a+x-T;if(_=o-_,x>=_)return this.diff_bisectSplit_(i,s,x,M,d)}}}}return[new e.Diff(t,i),new e.Diff(n,s)]},e.prototype.diff_bisectSplit_=function(i,s,d,o,l){var r=i.substring(0,d),a=s.substring(0,o),c=i.substring(d),p=s.substring(o),u=this.diff_main(r,a,!1,l),f=this.diff_main(c,p,!1,l);return u.concat(f)},e.prototype.diff_linesToChars_=function(i,s){var d=[],o={};d[0]="";function l(p){for(var u="",f=0,g=-1,v=d.length;g<p.length-1;){g=p.indexOf(`
994
- `,f),g==-1&&(g=p.length-1);var b=p.substring(f,g+1);(o.hasOwnProperty?o.hasOwnProperty(b):o[b]!==void 0)?u+=String.fromCharCode(o[b]):(v==r&&(b=p.substring(f),g=p.length),u+=String.fromCharCode(v),o[b]=v,d[v++]=b),f=g+1}return u}var r=4e4,a=l(i);r=65535;var c=l(s);return{chars1:a,chars2:c,lineArray:d}},e.prototype.diff_charsToLines_=function(i,s){for(var d=0;d<i.length;d++){for(var o=i[d][1],l=[],r=0;r<o.length;r++)l[r]=s[o.charCodeAt(r)];i[d][1]=l.join("")}},e.prototype.diff_commonPrefix=function(i,s){if(!i||!s||i.charAt(0)!=s.charAt(0))return 0;for(var d=0,o=Math.min(i.length,s.length),l=o,r=0;d<l;)i.substring(r,l)==s.substring(r,l)?(d=l,r=d):o=l,l=Math.floor((o-d)/2+d);return l},e.prototype.diff_commonSuffix=function(i,s){if(!i||!s||i.charAt(i.length-1)!=s.charAt(s.length-1))return 0;for(var d=0,o=Math.min(i.length,s.length),l=o,r=0;d<l;)i.substring(i.length-l,i.length-r)==s.substring(s.length-l,s.length-r)?(d=l,r=d):o=l,l=Math.floor((o-d)/2+d);return l},e.prototype.diff_commonOverlap_=function(i,s){var d=i.length,o=s.length;if(d==0||o==0)return 0;d>o?i=i.substring(d-o):d<o&&(s=s.substring(0,d));var l=Math.min(d,o);if(i==s)return l;for(var r=0,a=1;;){var c=i.substring(l-a),p=s.indexOf(c);if(p==-1)return r;a+=p,(p==0||i.substring(l-a)==s.substring(0,a))&&(r=a,a++)}},e.prototype.diff_halfMatch_=function(i,s){if(this.Diff_Timeout<=0)return null;var d=i.length>s.length?i:s,o=i.length>s.length?s:i;if(d.length<4||o.length*2<d.length)return null;var l=this;function r(D,E,w){for(var y=D.substring(w,w+Math.floor(D.length/4)),A=-1,T="",x,M,O,_;(A=E.indexOf(y,A+1))!=-1;){var k=l.diff_commonPrefix(D.substring(w),E.substring(A)),S=l.diff_commonSuffix(D.substring(0,w),E.substring(0,A));T.length<S+k&&(T=E.substring(A-S,A)+E.substring(A,A+k),x=D.substring(0,w-S),M=D.substring(w+k),O=E.substring(0,A-S),_=E.substring(A+k))}return T.length*2>=D.length?[x,M,O,_,T]:null}var a=r(d,o,Math.ceil(d.length/4)),c=r(d,o,Math.ceil(d.length/2)),p;if(!a&&!c)return null;c?a?p=a[4].length>c[4].length?a:c:p=c:p=a;var u,f,g,v;i.length>s.length?(u=p[0],f=p[1],g=p[2],v=p[3]):(g=p[0],v=p[1],u=p[2],f=p[3]);var b=p[4];return[u,f,g,v,b]},e.prototype.diff_cleanupSemantic=function(i){for(var s=!1,d=[],o=0,l=null,r=0,a=0,c=0,p=0,u=0;r<i.length;)i[r][0]==h?(d[o++]=r,a=p,c=u,p=0,u=0,l=i[r][1]):(i[r][0]==n?p+=i[r][1].length:u+=i[r][1].length,l&&l.length<=Math.max(a,c)&&l.length<=Math.max(p,u)&&(i.splice(d[o-1],0,new e.Diff(t,l)),i[d[o-1]+1][0]=n,o--,o--,r=o>0?d[o-1]:-1,a=0,c=0,p=0,u=0,l=null,s=!0)),r++;for(s&&this.diff_cleanupMerge(i),this.diff_cleanupSemanticLossless(i),r=1;r<i.length;){if(i[r-1][0]==t&&i[r][0]==n){var f=i[r-1][1],g=i[r][1],v=this.diff_commonOverlap_(f,g),b=this.diff_commonOverlap_(g,f);v>=b?(v>=f.length/2||v>=g.length/2)&&(i.splice(r,0,new e.Diff(h,g.substring(0,v))),i[r-1][1]=f.substring(0,f.length-v),i[r+1][1]=g.substring(v),r++):(b>=f.length/2||b>=g.length/2)&&(i.splice(r,0,new e.Diff(h,f.substring(0,b))),i[r-1][0]=n,i[r-1][1]=g.substring(0,g.length-b),i[r+1][0]=t,i[r+1][1]=f.substring(b),r++),r++}r++}},e.prototype.diff_cleanupSemanticLossless=function(i){function s(b,D){if(!b||!D)return 6;var E=b.charAt(b.length-1),w=D.charAt(0),y=E.match(e.nonAlphaNumericRegex_),A=w.match(e.nonAlphaNumericRegex_),T=y&&E.match(e.whitespaceRegex_),x=A&&w.match(e.whitespaceRegex_),M=T&&E.match(e.linebreakRegex_),O=x&&w.match(e.linebreakRegex_),_=M&&b.match(e.blanklineEndRegex_),k=O&&D.match(e.blanklineStartRegex_);return _||k?5:M||O?4:y&&!T&&x?3:T||x?2:y||A?1:0}for(var d=1;d<i.length-1;){if(i[d-1][0]==h&&i[d+1][0]==h){var o=i[d-1][1],l=i[d][1],r=i[d+1][1],a=this.diff_commonSuffix(o,l);if(a){var c=l.substring(l.length-a);o=o.substring(0,o.length-a),l=c+l.substring(0,l.length-a),r=c+r}for(var p=o,u=l,f=r,g=s(o,l)+s(l,r);l.charAt(0)===r.charAt(0);){o+=l.charAt(0),l=l.substring(1)+r.charAt(0),r=r.substring(1);var v=s(o,l)+s(l,r);v>=g&&(g=v,p=o,u=l,f=r)}i[d-1][1]!=p&&(p?i[d-1][1]=p:(i.splice(d-1,1),d--),i[d][1]=u,f?i[d+1][1]=f:(i.splice(d+1,1),d--))}d++}},e.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,e.whitespaceRegex_=/\s/,e.linebreakRegex_=/[\r\n]/,e.blanklineEndRegex_=/\n\r?\n$/,e.blanklineStartRegex_=/^\r?\n\r?\n/,e.prototype.diff_cleanupEfficiency=function(i){for(var s=!1,d=[],o=0,l=null,r=0,a=!1,c=!1,p=!1,u=!1;r<i.length;)i[r][0]==h?(i[r][1].length<this.Diff_EditCost&&(p||u)?(d[o++]=r,a=p,c=u,l=i[r][1]):(o=0,l=null),p=u=!1):(i[r][0]==t?u=!0:p=!0,l&&(a&&c&&p&&u||l.length<this.Diff_EditCost/2&&a+c+p+u==3)&&(i.splice(d[o-1],0,new e.Diff(t,l)),i[d[o-1]+1][0]=n,o--,l=null,a&&c?(p=u=!0,o=0):(o--,r=o>0?d[o-1]:-1,p=u=!1),s=!0)),r++;s&&this.diff_cleanupMerge(i)},e.prototype.diff_cleanupMerge=function(i){i.push(new e.Diff(h,""));for(var s=0,d=0,o=0,l="",r="",a;s<i.length;)switch(i[s][0]){case n:o++,r+=i[s][1],s++;break;case t:d++,l+=i[s][1],s++;break;case h:d+o>1?(d!==0&&o!==0&&(a=this.diff_commonPrefix(r,l),a!==0&&(s-d-o>0&&i[s-d-o-1][0]==h?i[s-d-o-1][1]+=r.substring(0,a):(i.splice(0,0,new e.Diff(h,r.substring(0,a))),s++),r=r.substring(a),l=l.substring(a)),a=this.diff_commonSuffix(r,l),a!==0&&(i[s][1]=r.substring(r.length-a)+i[s][1],r=r.substring(0,r.length-a),l=l.substring(0,l.length-a))),s-=d+o,i.splice(s,d+o),l.length&&(i.splice(s,0,new e.Diff(t,l)),s++),r.length&&(i.splice(s,0,new e.Diff(n,r)),s++),s++):s!==0&&i[s-1][0]==h?(i[s-1][1]+=i[s][1],i.splice(s,1)):s++,o=0,d=0,l="",r="";break}i[i.length-1][1]===""&&i.pop();var c=!1;for(s=1;s<i.length-1;)i[s-1][0]==h&&i[s+1][0]==h&&(i[s][1].substring(i[s][1].length-i[s-1][1].length)==i[s-1][1]?(i[s][1]=i[s-1][1]+i[s][1].substring(0,i[s][1].length-i[s-1][1].length),i[s+1][1]=i[s-1][1]+i[s+1][1],i.splice(s-1,1),c=!0):i[s][1].substring(0,i[s+1][1].length)==i[s+1][1]&&(i[s-1][1]+=i[s+1][1],i[s][1]=i[s][1].substring(i[s+1][1].length)+i[s+1][1],i.splice(s+1,1),c=!0)),s++;c&&this.diff_cleanupMerge(i)},e.prototype.diff_xIndex=function(i,s){var d=0,o=0,l=0,r=0,a;for(a=0;a<i.length&&(i[a][0]!==n&&(d+=i[a][1].length),i[a][0]!==t&&(o+=i[a][1].length),!(d>s));a++)l=d,r=o;return i.length!=a&&i[a][0]===t?r:r+(s-l)},e.prototype.diff_prettyHtml=function(i){for(var s=[],d=/&/g,o=/</g,l=/>/g,r=/\n/g,a=0;a<i.length;a++){var c=i[a][0],p=i[a][1],u=p.replace(d,"&amp;").replace(o,"&lt;").replace(l,"&gt;").replace(r,"&para;<br>");switch(c){case n:s[a]='<ins style="background:#e6ffe6;">'+u+"</ins>";break;case t:s[a]='<del style="background:#ffe6e6;">'+u+"</del>";break;case h:s[a]="<span>"+u+"</span>";break}}return s.join("")},e.prototype.diff_text1=function(i){for(var s=[],d=0;d<i.length;d++)i[d][0]!==n&&(s[d]=i[d][1]);return s.join("")},e.prototype.diff_text2=function(i){for(var s=[],d=0;d<i.length;d++)i[d][0]!==t&&(s[d]=i[d][1]);return s.join("")},e.prototype.diff_levenshtein=function(i){for(var s=0,d=0,o=0,l=0;l<i.length;l++){var r=i[l][0],a=i[l][1];switch(r){case n:d+=a.length;break;case t:o+=a.length;break;case h:s+=Math.max(d,o),d=0,o=0;break}}return s+=Math.max(d,o),s},e.prototype.diff_toDelta=function(i){for(var s=[],d=0;d<i.length;d++)switch(i[d][0]){case n:s[d]="+"+encodeURI(i[d][1]);break;case t:s[d]="-"+i[d][1].length;break;case h:s[d]="="+i[d][1].length;break}return s.join(" ").replace(/%20/g," ")},e.prototype.diff_fromDelta=function(i,s){for(var d=[],o=0,l=0,r=s.split(/\t/g),a=0;a<r.length;a++){var c=r[a].substring(1);switch(r[a].charAt(0)){case"+":try{d[o++]=new e.Diff(n,decodeURI(c))}catch{throw new Error("Illegal escape in diff_fromDelta: "+c)}break;case"-":case"=":var p=parseInt(c,10);if(isNaN(p)||p<0)throw new Error("Invalid number in diff_fromDelta: "+c);var u=i.substring(l,l+=p);r[a].charAt(0)=="="?d[o++]=new e.Diff(h,u):d[o++]=new e.Diff(t,u);break;default:if(r[a])throw new Error("Invalid diff operation in diff_fromDelta: "+r[a])}}if(l!=i.length)throw new Error("Delta length ("+l+") does not equal source text length ("+i.length+").");return d},e.prototype.match_main=function(i,s,d){if(i==null||s==null||d==null)throw new Error("Null input. (match_main)");return d=Math.max(0,Math.min(d,i.length)),i==s?0:i.length?i.substring(d,d+s.length)==s?d:this.match_bitap_(i,s,d):-1},e.prototype.match_bitap_=function(i,s,d){if(s.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var o=this.match_alphabet_(s),l=this;function r(x,M){var O=x/s.length,_=Math.abs(d-M);return l.Match_Distance?O+_/l.Match_Distance:_?1:O}var a=this.Match_Threshold,c=i.indexOf(s,d);c!=-1&&(a=Math.min(r(0,c),a),c=i.lastIndexOf(s,d+s.length),c!=-1&&(a=Math.min(r(0,c),a)));var p=1<<s.length-1;c=-1;for(var u,f,g=s.length+i.length,v,b=0;b<s.length;b++){for(u=0,f=g;u<f;)r(b,d+f)<=a?u=f:g=f,f=Math.floor((g-u)/2+u);g=f;var D=Math.max(1,d-f+1),E=Math.min(d+f,i.length)+s.length,w=Array(E+2);w[E+1]=(1<<b)-1;for(var y=E;y>=D;y--){var A=o[i.charAt(y-1)];if(b===0?w[y]=(w[y+1]<<1|1)&A:w[y]=(w[y+1]<<1|1)&A|((v[y+1]|v[y])<<1|1)|v[y+1],w[y]&p){var T=r(b,y-1);if(T<=a)if(a=T,c=y-1,c>d)D=Math.max(1,2*d-c);else break}}if(r(b+1,d)>a)break;v=w}return c},e.prototype.match_alphabet_=function(i){for(var s={},d=0;d<i.length;d++)s[i.charAt(d)]=0;for(var d=0;d<i.length;d++)s[i.charAt(d)]|=1<<i.length-d-1;return s},e.prototype.patch_addContext_=function(i,s){if(s.length!=0){if(i.start2===null)throw Error("patch not initialized");for(var d=s.substring(i.start2,i.start2+i.length1),o=0;s.indexOf(d)!=s.lastIndexOf(d)&&d.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,d=s.substring(i.start2-o,i.start2+i.length1+o);o+=this.Patch_Margin;var l=s.substring(i.start2-o,i.start2);l&&i.diffs.unshift(new e.Diff(h,l));var r=s.substring(i.start2+i.length1,i.start2+i.length1+o);r&&i.diffs.push(new e.Diff(h,r)),i.start1-=l.length,i.start2-=l.length,i.length1+=l.length+r.length,i.length2+=l.length+r.length}},e.prototype.patch_make=function(i,s,d){var o,l;if(typeof i=="string"&&typeof s=="string"&&typeof d>"u")o=i,l=this.diff_main(o,s,!0),l.length>2&&(this.diff_cleanupSemantic(l),this.diff_cleanupEfficiency(l));else if(i&&typeof i=="object"&&typeof s>"u"&&typeof d>"u")l=i,o=this.diff_text1(l);else if(typeof i=="string"&&s&&typeof s=="object"&&typeof d>"u")o=i,l=s;else if(typeof i=="string"&&typeof s=="string"&&d&&typeof d=="object")o=i,l=d;else throw new Error("Unknown call format to patch_make.");if(l.length===0)return[];for(var r=[],a=new e.patch_obj,c=0,p=0,u=0,f=o,g=o,v=0;v<l.length;v++){var b=l[v][0],D=l[v][1];switch(!c&&b!==h&&(a.start1=p,a.start2=u),b){case n:a.diffs[c++]=l[v],a.length2+=D.length,g=g.substring(0,u)+D+g.substring(u);break;case t:a.length1+=D.length,a.diffs[c++]=l[v],g=g.substring(0,u)+g.substring(u+D.length);break;case h:D.length<=2*this.Patch_Margin&&c&&l.length!=v+1?(a.diffs[c++]=l[v],a.length1+=D.length,a.length2+=D.length):D.length>=2*this.Patch_Margin&&c&&(this.patch_addContext_(a,f),r.push(a),a=new e.patch_obj,c=0,f=g,p=u);break}b!==n&&(p+=D.length),b!==t&&(u+=D.length)}return c&&(this.patch_addContext_(a,f),r.push(a)),r},e.prototype.patch_deepCopy=function(i){for(var s=[],d=0;d<i.length;d++){var o=i[d],l=new e.patch_obj;l.diffs=[];for(var r=0;r<o.diffs.length;r++)l.diffs[r]=new e.Diff(o.diffs[r][0],o.diffs[r][1]);l.start1=o.start1,l.start2=o.start2,l.length1=o.length1,l.length2=o.length2,s[d]=l}return s},e.prototype.patch_apply=function(i,s){if(i.length==0)return[s,[]];i=this.patch_deepCopy(i);var d=this.patch_addPadding(i);s=d+s+d,this.patch_splitMax(i);for(var o=0,l=[],r=0;r<i.length;r++){var a=i[r].start2+o,c=this.diff_text1(i[r].diffs),p,u=-1;if(c.length>this.Match_MaxBits?(p=this.match_main(s,c.substring(0,this.Match_MaxBits),a),p!=-1&&(u=this.match_main(s,c.substring(c.length-this.Match_MaxBits),a+c.length-this.Match_MaxBits),(u==-1||p>=u)&&(p=-1))):p=this.match_main(s,c,a),p==-1)l[r]=!1,o-=i[r].length2-i[r].length1;else{l[r]=!0,o=p-a;var f;if(u==-1?f=s.substring(p,p+c.length):f=s.substring(p,u+this.Match_MaxBits),c==f)s=s.substring(0,p)+this.diff_text2(i[r].diffs)+s.substring(p+c.length);else{var g=this.diff_main(c,f,!1);if(c.length>this.Match_MaxBits&&this.diff_levenshtein(g)/c.length>this.Patch_DeleteThreshold)l[r]=!1;else{this.diff_cleanupSemanticLossless(g);for(var v=0,b,D=0;D<i[r].diffs.length;D++){var E=i[r].diffs[D];E[0]!==h&&(b=this.diff_xIndex(g,v)),E[0]===n?s=s.substring(0,p+b)+E[1]+s.substring(p+b):E[0]===t&&(s=s.substring(0,p+b)+s.substring(p+this.diff_xIndex(g,v+E[1].length))),E[0]!==t&&(v+=E[1].length)}}}}}return s=s.substring(d.length,s.length-d.length),[s,l]},e.prototype.patch_addPadding=function(i){for(var s=this.Patch_Margin,d="",o=1;o<=s;o++)d+=String.fromCharCode(o);for(var o=0;o<i.length;o++)i[o].start1+=s,i[o].start2+=s;var l=i[0],r=l.diffs;if(r.length==0||r[0][0]!=h)r.unshift(new e.Diff(h,d)),l.start1-=s,l.start2-=s,l.length1+=s,l.length2+=s;else if(s>r[0][1].length){var a=s-r[0][1].length;r[0][1]=d.substring(r[0][1].length)+r[0][1],l.start1-=a,l.start2-=a,l.length1+=a,l.length2+=a}if(l=i[i.length-1],r=l.diffs,r.length==0||r[r.length-1][0]!=h)r.push(new e.Diff(h,d)),l.length1+=s,l.length2+=s;else if(s>r[r.length-1][1].length){var a=s-r[r.length-1][1].length;r[r.length-1][1]+=d.substring(0,a),l.length1+=a,l.length2+=a}return d},e.prototype.patch_splitMax=function(i){for(var s=this.Match_MaxBits,d=0;d<i.length;d++)if(!(i[d].length1<=s)){var o=i[d];i.splice(d--,1);for(var l=o.start1,r=o.start2,a="";o.diffs.length!==0;){var c=new e.patch_obj,p=!0;for(c.start1=l-a.length,c.start2=r-a.length,a!==""&&(c.length1=c.length2=a.length,c.diffs.push(new e.Diff(h,a)));o.diffs.length!==0&&c.length1<s-this.Patch_Margin;){var u=o.diffs[0][0],f=o.diffs[0][1];u===n?(c.length2+=f.length,r+=f.length,c.diffs.push(o.diffs.shift()),p=!1):u===t&&c.diffs.length==1&&c.diffs[0][0]==h&&f.length>2*s?(c.length1+=f.length,l+=f.length,p=!1,c.diffs.push(new e.Diff(u,f)),o.diffs.shift()):(f=f.substring(0,s-c.length1-this.Patch_Margin),c.length1+=f.length,l+=f.length,u===h?(c.length2+=f.length,r+=f.length):p=!1,c.diffs.push(new e.Diff(u,f)),f==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(f.length))}a=this.diff_text2(c.diffs),a=a.substring(a.length-this.Patch_Margin);var g=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);g!==""&&(c.length1+=g.length,c.length2+=g.length,c.diffs.length!==0&&c.diffs[c.diffs.length-1][0]===h?c.diffs[c.diffs.length-1][1]+=g:c.diffs.push(new e.Diff(h,g))),p||i.splice(++d,0,c)}}},e.prototype.patch_toText=function(i){for(var s=[],d=0;d<i.length;d++)s[d]=i[d];return s.join("")},e.prototype.patch_fromText=function(i){var s=[];if(!i)return s;for(var d=i.split(`
995
- `),o=0,l=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<d.length;){var r=d[o].match(l);if(!r)throw new Error("Invalid patch string: "+d[o]);var a=new e.patch_obj;for(s.push(a),a.start1=parseInt(r[1],10),r[2]===""?(a.start1--,a.length1=1):r[2]=="0"?a.length1=0:(a.start1--,a.length1=parseInt(r[2],10)),a.start2=parseInt(r[3],10),r[4]===""?(a.start2--,a.length2=1):r[4]=="0"?a.length2=0:(a.start2--,a.length2=parseInt(r[4],10)),o++;o<d.length;){var c=d[o].charAt(0);try{var p=decodeURI(d[o].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+p)}if(c=="-")a.diffs.push(new e.Diff(t,p));else if(c=="+")a.diffs.push(new e.Diff(n,p));else if(c==" ")a.diffs.push(new e.Diff(h,p));else{if(c=="@")break;if(c!=="")throw new Error('Invalid patch mode "'+c+'" in: '+p)}o++}}return s},e.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},e.patch_obj.prototype.toString=function(){var i,s;this.length1===0?i=this.start1+",0":this.length1==1?i=this.start1+1:i=this.start1+1+","+this.length1,this.length2===0?s=this.start2+",0":this.length2==1?s=this.start2+1:s=this.start2+1+","+this.length2;for(var d=["@@ -"+i+" +"+s+` @@
996
- `],o,l=0;l<this.diffs.length;l++){switch(this.diffs[l][0]){case n:o="+";break;case t:o="-";break;case h:o=" ";break}d[l+1]=o+encodeURI(this.diffs[l][1])+`
997
- `}return d.join("").replace(/%20/g," ")},m.exports=e,m.exports.diff_match_patch=e,m.exports.DIFF_DELETE=t,m.exports.DIFF_INSERT=n,m.exports.DIFF_EQUAL=h})(ra);var gp=ra.exports,mp=Gn&&Gn.__extends||(function(){var m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,h){n.__proto__=h}||function(n,h){for(var i in h)Object.prototype.hasOwnProperty.call(h,i)&&(n[i]=h[i])},m(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");m(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})();Object.defineProperty(Gn,"__esModule",{value:!0});var de=Ys,eo=Ws,vp=It,yp=gp,bp=(function(m){mp(e,m);function e(t){var n=m.call(this,t)||this;return n.state={value:n.props.value},n.onChange=n.onChange.bind(n),n.diff=n.diff.bind(n),n}return e.prototype.componentDidUpdate=function(){var t=this.props.value;t!==this.state.value&&this.setState({value:t})},e.prototype.onChange=function(t){this.setState({value:t}),this.props.onChange&&this.props.onChange(t)},e.prototype.diff=function(){var t=new yp,n=this.state.value[0],h=this.state.value[1];if(n.length===0&&h.length===0)return[];var i=t.diff_main(n,h);t.diff_cleanupSemantic(i);var s=this.generateDiffedLines(i),d=this.setCodeMarkers(s);return d},e.prototype.generateDiffedLines=function(t){var n={DIFF_EQUAL:0,DIFF_DELETE:-1,DIFF_INSERT:1},h={left:[],right:[]},i={left:1,right:1};return t.forEach(function(s){var d=s[0],o=s[1],l=o.split(`
998
- `).length-1;if(o.length!==0){var r=o[0],a=o[o.length-1],c=0;switch(d){case n.DIFF_EQUAL:i.left+=l,i.right+=l;break;case n.DIFF_DELETE:r===`
999
- `&&(i.left++,l--),c=l,c===0&&h.right.push({startLine:i.right,endLine:i.right}),a===`
1000
- `&&(c-=1),h.left.push({startLine:i.left,endLine:i.left+c}),i.left+=l;break;case n.DIFF_INSERT:r===`
1001
- `&&(i.right++,l--),c=l,c===0&&h.left.push({startLine:i.left,endLine:i.left}),a===`
1002
- `&&(c-=1),h.right.push({startLine:i.right,endLine:i.right+c}),i.right+=l;break;default:throw new Error("Diff type was not defined.")}}}),h},e.prototype.setCodeMarkers=function(t){t===void 0&&(t={left:[],right:[]});for(var n=[],h={left:[],right:[]},i=0;i<t.left.length;i++){var s={startRow:t.left[i].startLine-1,endRow:t.left[i].endLine,type:"text",className:"codeMarker"};h.left.push(s)}for(var i=0;i<t.right.length;i++){var s={startRow:t.right[i].startLine-1,endRow:t.right[i].endLine,type:"text",className:"codeMarker"};h.right.push(s)}return n[0]=h.left,n[1]=h.right,n},e.prototype.render=function(){var t=this.diff();return eo.createElement(vp.default,{name:this.props.name,className:this.props.className,focus:this.props.focus,orientation:this.props.orientation,splits:this.props.splits,mode:this.props.mode,theme:this.props.theme,height:this.props.height,width:this.props.width,fontSize:this.props.fontSize,showGutter:this.props.showGutter,onChange:this.onChange,onPaste:this.props.onPaste,onLoad:this.props.onLoad,onScroll:this.props.onScroll,minLines:this.props.minLines,maxLines:this.props.maxLines,readOnly:this.props.readOnly,highlightActiveLine:this.props.highlightActiveLine,showPrintMargin:this.props.showPrintMargin,tabSize:this.props.tabSize,cursorStart:this.props.cursorStart,editorProps:this.props.editorProps,style:this.props.style,scrollMargin:this.props.scrollMargin,setOptions:this.props.setOptions,wrapEnabled:this.props.wrapEnabled,enableBasicAutocompletion:this.props.enableBasicAutocompletion,enableLiveAutocompletion:this.props.enableLiveAutocompletion,value:this.state.value,markers:t})},e.propTypes={cursorStart:de.number,editorProps:de.object,enableBasicAutocompletion:de.bool,enableLiveAutocompletion:de.bool,focus:de.bool,fontSize:de.number,height:de.string,highlightActiveLine:de.bool,maxLines:de.number,minLines:de.number,mode:de.string,name:de.string,className:de.string,onLoad:de.func,onPaste:de.func,onScroll:de.func,onChange:de.func,orientation:de.string,readOnly:de.bool,scrollMargin:de.array,setOptions:de.object,showGutter:de.bool,showPrintMargin:de.bool,splits:de.number,style:de.object,tabSize:de.number,theme:de.string,value:de.array,width:de.string,wrapEnabled:de.bool},e.defaultProps={cursorStart:1,editorProps:{},enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,focus:!1,fontSize:12,height:"500px",highlightActiveLine:!0,maxLines:null,minLines:null,mode:"",name:"ace-editor",onLoad:null,onScroll:null,onPaste:null,onChange:null,orientation:"beside",readOnly:!1,scrollMargin:[0,0,0,0],setOptions:{},showGutter:!0,showPrintMargin:!0,splits:2,style:{},tabSize:4,theme:"github",value:["",""],width:"500px",wrapEnabled:!0},e})(eo.Component);Gn.default=bp;Object.defineProperty(bn,"__esModule",{value:!0});bn.diff=bn.split=void 0;var wp=Yt,Cp=Gn;bn.diff=Cp.default;var Sp=It;bn.split=Sp.default;var Ep=bn.default=wp.default,Ap={exports:{}};(function(m,e){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(t,n,h){var i=t("../lib/oop"),s=t("./text_highlight_rules").TextHighlightRules,d=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};i.inherits(d,s),n.JsonHighlightRules=d}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(t,n,h){var i=t("../range").Range,s=function(){};(function(){this.checkOutdent=function(d,o){return/^\s+$/.test(d)?/^\s*\}/.test(o):!1},this.autoOutdent=function(d,o){var l=d.getLine(o),r=l.match(/^(\s*\})/);if(!r)return 0;var a=r[1].length,c=d.findMatchingBracket({row:o,column:a});if(!c||c.row==o)return 0;var p=this.$getIndent(d.getLine(c.row));d.replace(new i(o,0,o,a-1),p)},this.$getIndent=function(d){return d.match(/^\s*/)[0]}}).call(s.prototype),n.MatchingBraceOutdent=s}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(t,n,h){var i=t("../../lib/oop"),s=t("../../range").Range,d=t("./fold_mode").FoldMode,o=n.FoldMode=function(l){l&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+l.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+l.end)))};i.inherits(o,d),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(l,r,a){var c=l.getLine(a);if(this.singleLineBlockCommentRe.test(c)&&!this.startRegionRe.test(c)&&!this.tripleStarBlockCommentRe.test(c))return"";var p=this._getFoldWidgetBase(l,r,a);return!p&&this.startRegionRe.test(c)?"start":p},this.getFoldWidgetRange=function(l,r,a,c){var p=l.getLine(a);if(this.startRegionRe.test(p))return this.getCommentRegionBlock(l,p,a);var g=p.match(this.foldingStartMarker);if(g){var u=g.index;if(g[1])return this.openingBracketBlock(l,g[1],a,u);var f=l.getCommentFoldRange(a,u+g[0].length,1);return f&&!f.isMultiLine()&&(c?f=this.getSectionRange(l,a):r!="all"&&(f=null)),f}if(r!=="markbegin"){var g=p.match(this.foldingStopMarker);if(g){var u=g.index+g[0].length;return g[1]?this.closingBracketBlock(l,g[1],a,u):l.getCommentFoldRange(a,u,-1)}}},this.getSectionRange=function(l,r){var a=l.getLine(r),c=a.search(/\S/),p=r,u=a.length;r+=1;for(var f=r,g=l.getLength();++r<g;){a=l.getLine(r);var v=a.search(/\S/);if(v!==-1){if(c>v)break;var b=this.getFoldWidgetRange(l,"all",r);if(b){if(b.start.row<=p)break;if(b.isMultiLine())r=b.end.row;else if(c==v)break}f=r}}return new s(p,u,f,l.getLine(f).length)},this.getCommentRegionBlock=function(l,r,a){for(var c=r.search(/\s*$/),p=l.getLength(),u=a,f=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,g=1;++a<p;){r=l.getLine(a);var v=f.exec(r);if(v&&(v[1]?g--:g++,!g))break}var b=a;if(b>u)return new s(u,c,b,r.length)}}.call(o.prototype)}),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle","ace/worker/worker_client"],function(t,n,h){var i=t("../lib/oop"),s=t("./text").Mode,d=t("./json_highlight_rules").JsonHighlightRules,o=t("./matching_brace_outdent").MatchingBraceOutdent,l=t("./folding/cstyle").FoldMode,r=t("../worker/worker_client").WorkerClient,a=function(){this.HighlightRules=d,this.$outdent=new o,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new l};i.inherits(a,s),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(c,p,u){var f=this.$getIndent(p);if(c=="start"){var g=p.match(/^.*[\{\(\[]\s*$/);g&&(f+=u)}return f},this.checkOutdent=function(c,p,u){return this.$outdent.checkOutdent(p,u)},this.autoOutdent=function(c,p,u){this.$outdent.autoOutdent(p,u)},this.createWorker=function(c){var p=new r(["ace"],"ace/mode/json_worker","JsonWorker");return p.attachToDocument(c.getDocument()),p.on("annotate",function(u){c.setAnnotations(u.data)}),p.on("terminate",function(){c.clearAnnotations()}),p},this.$id="ace/mode/json"}.call(a.prototype),n.Mode=a}),(function(){ace.require(["ace/mode/json"],function(t){m&&(m.exports=t)})})()})(Ap);var Dp={exports:{}};(function(m,e){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(t,n,h){var i=t("../lib/oop"),s=t("./text_highlight_rules").TextHighlightRules,d=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};i.inherits(d,s),n.JsonHighlightRules=d}),ace.define("ace/mode/json5_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/json_highlight_rules"],function(t,n,h){var i=t("../lib/oop"),s=t("./json_highlight_rules").JsonHighlightRules,d=function(){s.call(this);var o=[{token:"variable",regex:/[a-zA-Z$_\u00a1-\uffff][\w$\u00a1-\uffff]*\s*(?=:)/},{token:"variable",regex:/['](?:(?:\\.)|(?:[^'\\]))*?[']\s*(?=:)/},{token:"constant.language.boolean",regex:/(?:null)\b/},{token:"string",regex:/'/,next:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,consumeLineEnd:!0},{token:"string",regex:/'|$/,next:"start"},{defaultToken:"string"}]},{token:"string",regex:/"(?![^"]*":)/,next:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,consumeLineEnd:!0},{token:"string",regex:/"|$/,next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:/[+-]?(?:Infinity|NaN)\b/}];for(var l in this.$rules)this.$rules[l].unshift.apply(this.$rules[l],o);this.normalizeRules()};i.inherits(d,s),n.Json5HighlightRules=d}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(t,n,h){var i=t("../range").Range,s=function(){};(function(){this.checkOutdent=function(d,o){return/^\s+$/.test(d)?/^\s*\}/.test(o):!1},this.autoOutdent=function(d,o){var l=d.getLine(o),r=l.match(/^(\s*\})/);if(!r)return 0;var a=r[1].length,c=d.findMatchingBracket({row:o,column:a});if(!c||c.row==o)return 0;var p=this.$getIndent(d.getLine(c.row));d.replace(new i(o,0,o,a-1),p)},this.$getIndent=function(d){return d.match(/^\s*/)[0]}}).call(s.prototype),n.MatchingBraceOutdent=s}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(t,n,h){var i=t("../../lib/oop"),s=t("../../range").Range,d=t("./fold_mode").FoldMode,o=n.FoldMode=function(l){l&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+l.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+l.end)))};i.inherits(o,d),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(l,r,a){var c=l.getLine(a);if(this.singleLineBlockCommentRe.test(c)&&!this.startRegionRe.test(c)&&!this.tripleStarBlockCommentRe.test(c))return"";var p=this._getFoldWidgetBase(l,r,a);return!p&&this.startRegionRe.test(c)?"start":p},this.getFoldWidgetRange=function(l,r,a,c){var p=l.getLine(a);if(this.startRegionRe.test(p))return this.getCommentRegionBlock(l,p,a);var g=p.match(this.foldingStartMarker);if(g){var u=g.index;if(g[1])return this.openingBracketBlock(l,g[1],a,u);var f=l.getCommentFoldRange(a,u+g[0].length,1);return f&&!f.isMultiLine()&&(c?f=this.getSectionRange(l,a):r!="all"&&(f=null)),f}if(r!=="markbegin"){var g=p.match(this.foldingStopMarker);if(g){var u=g.index+g[0].length;return g[1]?this.closingBracketBlock(l,g[1],a,u):l.getCommentFoldRange(a,u,-1)}}},this.getSectionRange=function(l,r){var a=l.getLine(r),c=a.search(/\S/),p=r,u=a.length;r+=1;for(var f=r,g=l.getLength();++r<g;){a=l.getLine(r);var v=a.search(/\S/);if(v!==-1){if(c>v)break;var b=this.getFoldWidgetRange(l,"all",r);if(b){if(b.start.row<=p)break;if(b.isMultiLine())r=b.end.row;else if(c==v)break}f=r}}return new s(p,u,f,l.getLine(f).length)},this.getCommentRegionBlock=function(l,r,a){for(var c=r.search(/\s*$/),p=l.getLength(),u=a,f=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,g=1;++a<p;){r=l.getLine(a);var v=f.exec(r);if(v&&(v[1]?g--:g++,!g))break}var b=a;if(b>u)return new s(u,c,b,r.length)}}.call(o.prototype)}),ace.define("ace/mode/json5",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json5_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"],function(t,n,h){var i=t("../lib/oop"),s=t("./text").Mode,d=t("./json5_highlight_rules").Json5HighlightRules,o=t("./matching_brace_outdent").MatchingBraceOutdent,l=t("./folding/cstyle").FoldMode,r=function(){this.HighlightRules=d,this.$outdent=new o,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new l};i.inherits(r,s),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.checkOutdent=function(a,c,p){return this.$outdent.checkOutdent(c,p)},this.autoOutdent=function(a,c,p){this.$outdent.autoOutdent(c,p)},this.$id="ace/mode/json5"}.call(r.prototype),n.Mode=r}),(function(){ace.require(["ace/mode/json5"],function(t){m&&(m.exports=t)})})()})(Dp);var $p={exports:{}};(function(m,e){ace.define("ace/mode/yaml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(t,n,h){var i=t("../lib/oop"),s=t("./text_highlight_rules").TextHighlightRules,d=function(){this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"list.markup",regex:/^(?:-{3}|\.{3})\s*(?=#|$)/},{token:"list.markup",regex:/^\s*[\-?](?:$|\s)/},{token:"constant",regex:"!![\\w//]+"},{token:"constant.language",regex:"[&\\*][a-zA-Z0-9-_]+"},{token:["meta.tag","keyword"],regex:/^(\s*\w[^\s:]*?)(:(?=\s|$))/},{token:["meta.tag","keyword"],regex:/(\w[^\s:]*?)(\s*:(?=\s|$))/},{token:"keyword.operator",regex:"<<\\w*:\\w*"},{token:"keyword.operator",regex:"-\\s*(?=[{])"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:/[|>][-+\d]*(?:$|\s+(?:$|#))/,onMatch:function(o,l,r,a){a=a.replace(/ #.*/,"");var c=/^ *((:\s*)?-(\s*[^|>])?)?/.exec(a)[0].replace(/\S\s*$/,"").length,p=parseInt(/\d+[\s+-]*$/.exec(a));return p?(c+=p-1,this.next="mlString"):this.next="mlStringPre",r.length?(r[0]=this.next,r[1]=c):(r.push(this.next),r.push(c)),this.token},next:"mlString"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:/(\b|[+\-\.])[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)(?=[^\d-\w]|$)$/},{token:"constant.numeric",regex:/[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/},{token:"constant.language.boolean",regex:"\\b(?:true|false|TRUE|FALSE|True|False|yes|no)\\b"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:/[^\s,:\[\]\{\}]+/}],mlStringPre:[{token:"indent",regex:/^ *$/},{token:"indent",regex:/^ */,onMatch:function(o,l,r){var a=r[1];return a>=o.length?(this.next="start",r.shift(),r.shift()):(r[1]=o.length-1,this.next=r[0]="mlString"),this.token},next:"mlString"},{defaultToken:"string"}],mlString:[{token:"indent",regex:/^ *$/},{token:"indent",regex:/^ */,onMatch:function(o,l,r){var a=r[1];return a>=o.length?(this.next="start",r.splice(0)):this.next="mlString",this.token},next:"mlString"},{token:"string",regex:".+"}]},this.normalizeRules()};i.inherits(d,s),n.YamlHighlightRules=d}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(t,n,h){var i=t("../range").Range,s=function(){};(function(){this.checkOutdent=function(d,o){return/^\s+$/.test(d)?/^\s*\}/.test(o):!1},this.autoOutdent=function(d,o){var l=d.getLine(o),r=l.match(/^(\s*\})/);if(!r)return 0;var a=r[1].length,c=d.findMatchingBracket({row:o,column:a});if(!c||c.row==o)return 0;var p=this.$getIndent(d.getLine(c.row));d.replace(new i(o,0,o,a-1),p)},this.$getIndent=function(d){return d.match(/^\s*/)[0]}}).call(s.prototype),n.MatchingBraceOutdent=s}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(t,n,h){var i=t("../../lib/oop"),s=t("./fold_mode").FoldMode,d=t("../../range").Range,o=n.FoldMode=function(){};i.inherits(o,s),function(){this.commentBlock=function(l,r){var a=/\S/,c=l.getLine(r),p=c.search(a);if(!(p==-1||c[p]!="#")){for(var u=c.length,f=l.getLength(),g=r,v=r;++r<f;){c=l.getLine(r);var b=c.search(a);if(b!=-1){if(c[b]!="#")break;v=r}}if(v>g){var D=l.getLine(v).length;return new d(g,u,v,D)}}},this.getFoldWidgetRange=function(l,r,a){var c=this.indentationBlock(l,a);if(c||(c=this.commentBlock(l,a),c))return c},this.getFoldWidget=function(l,r,a){var c=l.getLine(a),p=c.search(/\S/),u=l.getLine(a+1),f=l.getLine(a-1),g=f.search(/\S/),v=u.search(/\S/);if(p==-1)return l.foldWidgets[a-1]=g!=-1&&g<v?"start":"","";if(g==-1){if(p==v&&c[p]=="#"&&u[p]=="#")return l.foldWidgets[a-1]="",l.foldWidgets[a+1]="","start"}else if(g==p&&c[p]=="#"&&f[p]=="#"&&l.getLine(a-2).search(/\S/)==-1)return l.foldWidgets[a-1]="start",l.foldWidgets[a+1]="","";return g!=-1&&g<p?l.foldWidgets[a-1]="start":l.foldWidgets[a-1]="",p<v?"start":""}}.call(o.prototype)}),ace.define("ace/mode/folding/yaml",["require","exports","module","ace/lib/oop","ace/mode/folding/coffee","ace/range"],function(t,n,h){var i=t("../../lib/oop"),s=t("./coffee").FoldMode,d=t("../../range").Range,o=n.FoldMode=function(){};i.inherits(o,s),function(){this.getFoldWidgetRange=function(l,r,a){var c=/\S/,p=l.getLine(a),u=p.search(c),f=p[u]==="#",g=p[u]==="-";if(u!=-1){var v=p.length,b=l.getLength(),D=a,E=a;if(f){var w=this.commentBlock(l,a);if(w)return w}else if(g){var w=this.indentationBlock(l,a);if(w)return w}else for(;++a<b;){var p=l.getLine(a),y=p.search(c);if(y!=-1){if(y<=u&&p[u]!=="-"){var A=l.getTokenAt(a,0);if(!A||A.type!=="string")break}E=a}}if(E>D){var T=l.getLine(E).length;return new d(D,v,E,T)}}},this.getFoldWidget=function(l,r,a){var c=l.getLine(a),p=c.search(/\S/),u=l.getLine(a+1),f=l.getLine(a-1),g=f.search(/\S/),v=u.search(/\S/),b=c[p]==="-";if(p==-1)return l.foldWidgets[a-1]=g!=-1&&g<v?"start":"","";if(g==-1){if(p==v&&c[p]=="#"&&u[p]=="#")return l.foldWidgets[a-1]="",l.foldWidgets[a+1]="","start"}else if(g==p&&c[p]=="#"&&f[p]=="#"&&l.getLine(a-2).search(/\S/)==-1)return l.foldWidgets[a-1]="start",l.foldWidgets[a+1]="","";return g!=-1&&g<p||g!=-1&&g==p&&b?l.foldWidgets[a-1]="start":l.foldWidgets[a-1]="",p<v?"start":""}}.call(o.prototype)}),ace.define("ace/mode/yaml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/yaml_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/yaml","ace/worker/worker_client"],function(t,n,h){var i=t("../lib/oop"),s=t("./text").Mode,d=t("./yaml_highlight_rules").YamlHighlightRules,o=t("./matching_brace_outdent").MatchingBraceOutdent,l=t("./folding/yaml").FoldMode,r=t("../worker/worker_client").WorkerClient,a=function(){this.HighlightRules=d,this.$outdent=new o,this.foldingRules=new l,this.$behaviour=this.$defaultBehaviour};i.inherits(a,s),function(){this.lineCommentStart=["#"],this.getNextLineIndent=function(c,p,u){var f=this.$getIndent(p);if(c=="start"){var g=p.match(/^.*[\{\(\[]\s*$/);g&&(f+=u)}return f},this.checkOutdent=function(c,p,u){return this.$outdent.checkOutdent(p,u)},this.autoOutdent=function(c,p,u){this.$outdent.autoOutdent(p,u)},this.createWorker=function(c){var p=new r(["ace"],"ace/mode/yaml_worker","YamlWorker");return p.attachToDocument(c.getDocument()),p.on("annotate",function(u){c.setAnnotations(u.data)}),p.on("terminate",function(){c.clearAnnotations()}),p},this.$id="ace/mode/yaml"}.call(a.prototype),n.Mode=a}),(function(){ace.require(["ace/mode/yaml"],function(t){m&&(m.exports=t)})})()})($p);var xp={};(function(m){function e(h,i){for(var s=h,d="";s;){var o=i[s];if(typeof o=="string")return o+d;if(o)return o.location.replace(/\/*$/,"/")+(d||o.main||o.name);if(o===!1)return"";var l=s.lastIndexOf("/");if(l===-1)break;d=s.substr(l)+d,s=s.slice(0,l)}return h}if(!(typeof m.window<"u"&&m.document)&&!(m.require&&m.define)){m.console||(m.console=function(){var h=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:h})},m.console.error=m.console.warn=m.console.log=m.console.trace=m.console),m.window=m,m.ace=m,m.onerror=function(h,i,s,d,o){postMessage({type:"error",data:{message:h,data:o&&o.data,file:i,line:s,col:d,stack:o&&o.stack}})},m.normalizeModule=function(h,i){if(i.indexOf("!")!==-1){var s=i.split("!");return m.normalizeModule(h,s[0])+"!"+m.normalizeModule(h,s[1])}if(i.charAt(0)=="."){var d=h.split("/").slice(0,-1).join("/");for(i=(d?d+"/":"")+i;i.indexOf(".")!==-1&&o!=i;){var o=i;i=i.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return i},m.require=function(h,i){if(i||(i=h,h=null),!i.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");i=m.normalizeModule(h,i);var s=m.require.modules[i];if(s)return s.initialized||(s.initialized=!0,s.exports=s.factory().exports),s.exports;if(!m.require.tlns)return console.log("unable to load "+i);var d=e(i,m.require.tlns);return d.slice(-3)!=".js"&&(d+=".js"),m.require.id=i,m.require.modules[i]={},importScripts(d),m.require(h,i)},m.require.modules={},m.require.tlns={},m.define=function(h,i,s){if(arguments.length==2?(s=i,typeof h!="string"&&(i=h,h=m.require.id)):arguments.length==1&&(s=h,i=[],h=m.require.id),typeof s!="function"){m.require.modules[h]={exports:s,initialized:!0};return}i.length||(i=["require","exports","module"]);var d=function(o){return m.require(h,o)};m.require.modules[h]={exports:{},factory:function(){var o=this,l=s.apply(this,i.slice(0,s.length).map(function(r){switch(r){case"require":return d;case"exports":return o.exports;case"module":return o;default:return d(r)}}));return l&&(o.exports=l),o}}},m.define.amd={},m.require.tlns={},m.initBaseUrls=function(h){for(var i in h)this.require.tlns[i]=h[i]},m.initSender=function(){var h=m.require("ace/lib/event_emitter").EventEmitter,i=m.require("ace/lib/oop"),s=function(){};return function(){i.implement(this,h),this.callback=function(d,o){postMessage({type:"call",id:o,data:d})},this.emit=function(d,o){postMessage({type:"event",name:d,data:o})}}.call(s.prototype),new s};var t=m.main=null,n=m.sender=null;m.onmessage=function(h){var i=h.data;if(i.event&&n)n._signal(i.event,i.data);else if(i.command)if(t[i.command])t[i.command].apply(t,i.args);else{if(!m[i.command])throw new Error("Unknown command:"+i.command);m[i.command].apply(m,i.args)}else if(i.init){m.initBaseUrls(i.tlns),n=m.sender=m.initSender();var s=this.require(i.module)[i.classname];t=m.main=new s(n)}}}})(xp),ace.define("ace/lib/oop",[],function(m,e,t){e.inherits=function(n,h){n.super_=h,n.prototype=Object.create(h.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})},e.mixin=function(n,h){for(var i in h)n[i]=h[i];return n},e.implement=function(n,h){e.mixin(n,h)}}),ace.define("ace/apply_delta",[],function(m,e,t){e.applyDelta=function(n,h,i){var s=h.start.row,d=h.start.column,o=n[s]||"";switch(h.action){case"insert":var l=h.lines;if(l.length===1)n[s]=o.substring(0,d)+h.lines[0]+o.substring(d);else{var r=[s,1].concat(h.lines);n.splice.apply(n,r),n[s]=o.substring(0,d)+n[s],n[s+h.lines.length-1]+=o.substring(d)}break;case"remove":var a=h.end.column,c=h.end.row;s===c?n[s]=o.substring(0,d)+o.substring(a):n.splice(s,c-s+1,o.substring(0,d)+n[c].substring(a))}}}),ace.define("ace/lib/event_emitter",[],function(m,e,t){var n={},h=function(){this.propagationStopped=!0},i=function(){this.defaultPrevented=!0};n._emit=n._dispatchEvent=function(s,d){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var o=this._eventRegistry[s]||[],l=this._defaultHandlers[s];if(!(!o.length&&!l)){(typeof d!="object"||!d)&&(d={}),d.type||(d.type=s),d.stopPropagation||(d.stopPropagation=h),d.preventDefault||(d.preventDefault=i),o=o.slice();for(var r=0;r<o.length&&(o[r](d,this),!d.propagationStopped);r++);if(l&&!d.defaultPrevented)return l(d,this)}},n._signal=function(s,d){var o=(this._eventRegistry||{})[s];if(o){o=o.slice();for(var l=0;l<o.length;l++)o[l](d,this)}},n.once=function(s,d){var o=this;if(this.on(s,function l(){o.off(s,l),d.apply(null,arguments)}),!d)return new Promise(function(l){d=l})},n.setDefaultHandler=function(s,d){var o=this._defaultHandlers;if(o||(o=this._defaultHandlers={_disabled_:{}}),o[s]){var l=o[s],r=o._disabled_[s];r||(o._disabled_[s]=r=[]),r.push(l);var a=r.indexOf(d);a!=-1&&r.splice(a,1)}o[s]=d},n.removeDefaultHandler=function(s,d){var o=this._defaultHandlers;if(o){var l=o._disabled_[s];if(o[s]==d)l&&this.setDefaultHandler(s,l.pop());else if(l){var r=l.indexOf(d);r!=-1&&l.splice(r,1)}}},n.on=n.addEventListener=function(s,d,o){this._eventRegistry=this._eventRegistry||{};var l=this._eventRegistry[s];return l||(l=this._eventRegistry[s]=[]),l.indexOf(d)==-1&&l[o?"unshift":"push"](d),d},n.off=n.removeListener=n.removeEventListener=function(s,d){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[s];if(o){var l=o.indexOf(d);l!==-1&&o.splice(l,1)}},n.removeAllListeners=function(s){s||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[s]=void 0),this._defaultHandlers&&(this._defaultHandlers[s]=void 0)},e.EventEmitter=n}),ace.define("ace/range",[],function(m,e,t){var n=(function(){function h(i,s,d,o){this.start={row:i,column:s},this.end={row:d,column:o}}return h.prototype.isEqual=function(i){return this.start.row===i.start.row&&this.end.row===i.end.row&&this.start.column===i.start.column&&this.end.column===i.end.column},h.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},h.prototype.contains=function(i,s){return this.compare(i,s)==0},h.prototype.compareRange=function(i){var s,d=i.end,o=i.start;return s=this.compare(d.row,d.column),s==1?(s=this.compare(o.row,o.column),s==1?2:s==0?1:0):s==-1?-2:(s=this.compare(o.row,o.column),s==-1?-1:s==1?42:0)},h.prototype.comparePoint=function(i){return this.compare(i.row,i.column)},h.prototype.containsRange=function(i){return this.comparePoint(i.start)==0&&this.comparePoint(i.end)==0},h.prototype.intersects=function(i){var s=this.compareRange(i);return s==-1||s==0||s==1},h.prototype.isEnd=function(i,s){return this.end.row==i&&this.end.column==s},h.prototype.isStart=function(i,s){return this.start.row==i&&this.start.column==s},h.prototype.setStart=function(i,s){typeof i=="object"?(this.start.column=i.column,this.start.row=i.row):(this.start.row=i,this.start.column=s)},h.prototype.setEnd=function(i,s){typeof i=="object"?(this.end.column=i.column,this.end.row=i.row):(this.end.row=i,this.end.column=s)},h.prototype.inside=function(i,s){return this.compare(i,s)==0?!(this.isEnd(i,s)||this.isStart(i,s)):!1},h.prototype.insideStart=function(i,s){return this.compare(i,s)==0?!this.isEnd(i,s):!1},h.prototype.insideEnd=function(i,s){return this.compare(i,s)==0?!this.isStart(i,s):!1},h.prototype.compare=function(i,s){return!this.isMultiLine()&&i===this.start.row?s<this.start.column?-1:s>this.end.column?1:0:i<this.start.row?-1:i>this.end.row?1:this.start.row===i?s>=this.start.column?0:-1:this.end.row===i?s<=this.end.column?0:1:0},h.prototype.compareStart=function(i,s){return this.start.row==i&&this.start.column==s?-1:this.compare(i,s)},h.prototype.compareEnd=function(i,s){return this.end.row==i&&this.end.column==s?1:this.compare(i,s)},h.prototype.compareInside=function(i,s){return this.end.row==i&&this.end.column==s?1:this.start.row==i&&this.start.column==s?-1:this.compare(i,s)},h.prototype.clipRows=function(i,s){if(this.end.row>s)var d={row:s+1,column:0};else if(this.end.row<i)var d={row:i,column:0};if(this.start.row>s)var o={row:s+1,column:0};else if(this.start.row<i)var o={row:i,column:0};return h.fromPoints(o||this.start,d||this.end)},h.prototype.extend=function(i,s){var d=this.compare(i,s);if(d==0)return this;if(d==-1)var o={row:i,column:s};else var l={row:i,column:s};return h.fromPoints(o||this.start,l||this.end)},h.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},h.prototype.isMultiLine=function(){return this.start.row!==this.end.row},h.prototype.clone=function(){return h.fromPoints(this.start,this.end)},h.prototype.collapseRows=function(){return this.end.column==0?new h(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new h(this.start.row,0,this.end.row,0)},h.prototype.toScreenRange=function(i){var s=i.documentToScreenPosition(this.start),d=i.documentToScreenPosition(this.end);return new h(s.row,s.column,d.row,d.column)},h.prototype.moveBy=function(i,s){this.start.row+=i,this.start.column+=s,this.end.row+=i,this.end.column+=s},h})();n.fromPoints=function(h,i){return new n(h.row,h.column,i.row,i.column)},n.comparePoints=function(h,i){return h.row-i.row||h.column-i.column},e.Range=n}),ace.define("ace/anchor",[],function(m,e,t){function n(o,l,r){var a=r?o.column<=l.column:o.column<l.column;return o.row<l.row||o.row==l.row&&a}function h(o,l,r){var a=o.action=="insert",c=(a?1:-1)*(o.end.row-o.start.row),p=(a?1:-1)*(o.end.column-o.start.column),u=o.start,f=a?u:o.end;return n(l,u,r)?{row:l.row,column:l.column}:n(f,l,!r)?{row:l.row+c,column:l.column+(l.row==f.row?p:0)}:{row:u.row,column:u.column}}var i=m("./lib/oop"),s=m("./lib/event_emitter").EventEmitter,d=(function(){function o(l,r,a){this.$onChange=this.onChange.bind(this),this.attach(l),typeof r!="number"?this.setPosition(r.row,r.column):this.setPosition(r,a)}return o.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},o.prototype.getDocument=function(){return this.document},o.prototype.onChange=function(l){if(!(l.start.row==l.end.row&&l.start.row!=this.row)&&!(l.start.row>this.row)){var r=h(l,{row:this.row,column:this.column},this.$insertRight);this.setPosition(r.row,r.column,!0)}},o.prototype.setPosition=function(l,r,a){var c;if(a?c={row:l,column:r}:c=this.$clipPositionToDocument(l,r),!(this.row==c.row&&this.column==c.column)){var p={row:this.row,column:this.column};this.row=c.row,this.column=c.column,this._signal("change",{old:p,value:c})}},o.prototype.detach=function(){this.document.off("change",this.$onChange)},o.prototype.attach=function(l){this.document=l||this.document,this.document.on("change",this.$onChange)},o.prototype.$clipPositionToDocument=function(l,r){var a={};return l>=this.document.getLength()?(a.row=Math.max(0,this.document.getLength()-1),a.column=this.document.getLine(a.row).length):l<0?(a.row=0,a.column=0):(a.row=l,a.column=Math.min(this.document.getLine(a.row).length,Math.max(0,r))),r<0&&(a.column=0),a},o})();d.prototype.$insertRight=!1,i.implement(d.prototype,s),e.Anchor=d}),ace.define("ace/document",[],function(m,e,t){var n=m("./lib/oop"),h=m("./apply_delta").applyDelta,i=m("./lib/event_emitter").EventEmitter,s=m("./range").Range,d=m("./anchor").Anchor,o=(function(){function l(r){this.$lines=[""],r.length===0?this.$lines=[""]:Array.isArray(r)?this.insertMergedLines({row:0,column:0},r):this.insert({row:0,column:0},r)}return l.prototype.setValue=function(r){var a=this.getLength()-1;this.remove(new s(0,0,a,this.getLine(a).length)),this.insert({row:0,column:0},r||"")},l.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},l.prototype.createAnchor=function(r,a){return new d(this,r,a)},l.prototype.$detectNewLine=function(r){var a=r.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=a?a[1]:`
1003
- `,this._signal("changeNewLineMode")},l.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
1004
- `;case"unix":return`
1005
- `;default:return this.$autoNewLine||`
1006
- `}},l.prototype.setNewLineMode=function(r){this.$newLineMode!==r&&(this.$newLineMode=r,this._signal("changeNewLineMode"))},l.prototype.getNewLineMode=function(){return this.$newLineMode},l.prototype.isNewLine=function(r){return r==`\r
1007
- `||r=="\r"||r==`
1008
- `},l.prototype.getLine=function(r){return this.$lines[r]||""},l.prototype.getLines=function(r,a){return this.$lines.slice(r,a+1)},l.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},l.prototype.getLength=function(){return this.$lines.length},l.prototype.getTextRange=function(r){return this.getLinesForRange(r).join(this.getNewLineCharacter())},l.prototype.getLinesForRange=function(r){var a;if(r.start.row===r.end.row)a=[this.getLine(r.start.row).substring(r.start.column,r.end.column)];else{a=this.getLines(r.start.row,r.end.row),a[0]=(a[0]||"").substring(r.start.column);var c=a.length-1;r.end.row-r.start.row==c&&(a[c]=a[c].substring(0,r.end.column))}return a},l.prototype.insertLines=function(r,a){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(r,a)},l.prototype.removeLines=function(r,a){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(r,a)},l.prototype.insertNewLine=function(r){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(r,["",""])},l.prototype.insert=function(r,a){return this.getLength()<=1&&this.$detectNewLine(a),this.insertMergedLines(r,this.$split(a))},l.prototype.insertInLine=function(r,a){var c=this.clippedPos(r.row,r.column),p=this.pos(r.row,r.column+a.length);return this.applyDelta({start:c,end:p,action:"insert",lines:[a]},!0),this.clonePos(p)},l.prototype.clippedPos=function(r,a){var c=this.getLength();r===void 0?r=c:r<0?r=0:r>=c&&(r=c-1,a=void 0);var p=this.getLine(r);return a==null&&(a=p.length),a=Math.min(Math.max(a,0),p.length),{row:r,column:a}},l.prototype.clonePos=function(r){return{row:r.row,column:r.column}},l.prototype.pos=function(r,a){return{row:r,column:a}},l.prototype.$clipPosition=function(r){var a=this.getLength();return r.row>=a?(r.row=Math.max(0,a-1),r.column=this.getLine(a-1).length):(r.row=Math.max(0,r.row),r.column=Math.min(Math.max(r.column,0),this.getLine(r.row).length)),r},l.prototype.insertFullLines=function(r,a){r=Math.min(Math.max(r,0),this.getLength());var c=0;r<this.getLength()?(a=a.concat([""]),c=0):(a=[""].concat(a),r--,c=this.$lines[r].length),this.insertMergedLines({row:r,column:c},a)},l.prototype.insertMergedLines=function(r,a){var c=this.clippedPos(r.row,r.column),p={row:c.row+a.length-1,column:(a.length==1?c.column:0)+a[a.length-1].length};return this.applyDelta({start:c,end:p,action:"insert",lines:a}),this.clonePos(p)},l.prototype.remove=function(r){var a=this.clippedPos(r.start.row,r.start.column),c=this.clippedPos(r.end.row,r.end.column);return this.applyDelta({start:a,end:c,action:"remove",lines:this.getLinesForRange({start:a,end:c})}),this.clonePos(a)},l.prototype.removeInLine=function(r,a,c){var p=this.clippedPos(r,a),u=this.clippedPos(r,c);return this.applyDelta({start:p,end:u,action:"remove",lines:this.getLinesForRange({start:p,end:u})},!0),this.clonePos(p)},l.prototype.removeFullLines=function(r,a){r=Math.min(Math.max(0,r),this.getLength()-1),a=Math.min(Math.max(0,a),this.getLength()-1);var c=a==this.getLength()-1&&r>0,p=a<this.getLength()-1,u=c?r-1:r,f=c?this.getLine(u).length:0,g=p?a+1:a,v=p?0:this.getLine(g).length,b=new s(u,f,g,v),D=this.$lines.slice(r,a+1);return this.applyDelta({start:b.start,end:b.end,action:"remove",lines:this.getLinesForRange(b)}),D},l.prototype.removeNewLine=function(r){r<this.getLength()-1&&r>=0&&this.applyDelta({start:this.pos(r,this.getLine(r).length),end:this.pos(r+1,0),action:"remove",lines:["",""]})},l.prototype.replace=function(r,a){if(r instanceof s||(r=s.fromPoints(r.start,r.end)),a.length===0&&r.isEmpty())return r.start;if(a==this.getTextRange(r))return r.end;this.remove(r);var c;return a?c=this.insert(r.start,a):c=r.start,c},l.prototype.applyDeltas=function(r){for(var a=0;a<r.length;a++)this.applyDelta(r[a])},l.prototype.revertDeltas=function(r){for(var a=r.length-1;a>=0;a--)this.revertDelta(r[a])},l.prototype.applyDelta=function(r,a){var c=r.action=="insert";(c?r.lines.length<=1&&!r.lines[0]:!s.comparePoints(r.start,r.end))||(c&&r.lines.length>2e4?this.$splitAndapplyLargeDelta(r,2e4):(h(this.$lines,r,a),this._signal("change",r)))},l.prototype.$safeApplyDelta=function(r){var a=this.$lines.length;(r.action=="remove"&&r.start.row<a&&r.end.row<a||r.action=="insert"&&r.start.row<=a)&&this.applyDelta(r)},l.prototype.$splitAndapplyLargeDelta=function(r,a){for(var c=r.lines,p=c.length-a+1,u=r.start.row,f=r.start.column,g=0,v=0;g<p;g=v){v+=a-1;var b=c.slice(g,v);b.push(""),this.applyDelta({start:this.pos(u+g,f),end:this.pos(u+v,f=0),action:r.action,lines:b},!0)}r.lines=c.slice(g),r.start.row=u+g,r.start.column=f,this.applyDelta(r,!0)},l.prototype.revertDelta=function(r){this.$safeApplyDelta({start:this.clonePos(r.start),end:this.clonePos(r.end),action:r.action=="insert"?"remove":"insert",lines:r.lines.slice()})},l.prototype.indexToPosition=function(r,a){for(var c=this.$lines||this.getAllLines(),p=this.getNewLineCharacter().length,u=a||0,f=c.length;u<f;u++)if(r-=c[u].length+p,r<0)return{row:u,column:r+c[u].length+p};return{row:f-1,column:r+c[f-1].length+p}},l.prototype.positionToIndex=function(r,a){for(var c=this.$lines||this.getAllLines(),p=this.getNewLineCharacter().length,u=0,f=Math.min(r.row,c.length),g=a||0;g<f;++g)u+=c[g].length+p;return u+r.column},l.prototype.$split=function(r){return r.split(/\r\n|\r|\n/)},l})();o.prototype.$autoNewLine="",o.prototype.$newLineMode="auto",n.implement(o.prototype,i),e.Document=o}),ace.define("ace/lib/deep_copy",[],function(m,e,t){e.deepCopy=function n(h){if(typeof h!="object"||!h)return h;var i;if(Array.isArray(h)){i=[];for(var s=0;s<h.length;s++)i[s]=n(h[s]);return i}if(Object.prototype.toString.call(h)!=="[object Object]")return h;i={};for(var s in h)i[s]=n(h[s]);return i}}),ace.define("ace/lib/lang",[],function(m,e,t){e.last=function(i){return i[i.length-1]},e.stringReverse=function(i){return i.split("").reverse().join("")},e.stringRepeat=function(i,s){for(var d="";s>0;)s&1&&(d+=i),(s>>=1)&&(i+=i);return d};var n=/^\s\s*/,h=/\s\s*$/;e.stringTrimLeft=function(i){return i.replace(n,"")},e.stringTrimRight=function(i){return i.replace(h,"")},e.copyObject=function(i){var s={};for(var d in i)s[d]=i[d];return s},e.copyArray=function(i){for(var s=[],d=0,o=i.length;d<o;d++)i[d]&&typeof i[d]=="object"?s[d]=this.copyObject(i[d]):s[d]=i[d];return s},e.deepCopy=m("./deep_copy").deepCopy,e.arrayToMap=function(i){for(var s={},d=0;d<i.length;d++)s[i[d]]=1;return s},e.createMap=function(i){var s=Object.create(null);for(var d in i)s[d]=i[d];return s},e.arrayRemove=function(i,s){for(var d=0;d<=i.length;d++)s===i[d]&&i.splice(d,1)},e.escapeRegExp=function(i){return i.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},e.escapeHTML=function(i){return(""+i).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},e.getMatchOffsets=function(i,s){var d=[];return i.replace(s,function(o){d.push({offset:arguments[arguments.length-2],length:o.length})}),d},e.deferredCall=function(i){var s=null,d=function(){s=null,i()},o=function(l){return o.cancel(),s=setTimeout(d,l||0),o};return o.schedule=o,o.call=function(){return this.cancel(),i(),o},o.cancel=function(){return clearTimeout(s),s=null,o},o.isPending=function(){return s},o},e.delayedCall=function(i,s){var d=null,o=function(){d=null,i()},l=function(r){d==null&&(d=setTimeout(o,r||s))};return l.delay=function(r){d&&clearTimeout(d),d=setTimeout(o,r||s)},l.schedule=l,l.call=function(){this.cancel(),i()},l.cancel=function(){d&&clearTimeout(d),d=null},l.isPending=function(){return d},l},e.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},e.skipEmptyMatch=function(i,s,d){return d&&i.codePointAt(s)>65535?2:1}}),ace.define("ace/worker/mirror",[],function(m,e,t){var n=m("../document").Document,h=m("../lib/lang"),i=e.Mirror=function(s){this.sender=s;var d=this.doc=new n(""),o=this.deferredUpdate=h.delayedCall(this.onUpdate.bind(this)),l=this;s.on("change",function(r){var a=r.data;if(a[0].start)d.applyDeltas(a);else for(var c=0;c<a.length;c+=2){var p,u;if(Array.isArray(a[c+1])?p={action:"insert",start:a[c],lines:a[c+1]}:p={action:"remove",start:a[c],end:a[c+1]},(p.action=="insert"?p.start:p.end).row>=d.$lines.length)throw u=new Error("Invalid delta"),u.data={path:l.$path,linesLength:d.$lines.length,start:p.start,end:p.end},u;d.applyDelta(p,!0)}if(l.$timeout)return o.schedule(l.$timeout);l.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(s){this.$timeout=s},this.setValue=function(s){this.doc.setValue(s),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(s){this.sender.callback(this.doc.getValue(),s)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(i.prototype)}),ace.define("ace/mode/json/json_parse",[],function(m,e,t){var n,h,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
1009
- `,r:"\r",t:" "},s,d=function(g){throw{name:"SyntaxError",message:g,at:n,text:s}},o=function(g){return g&&g!==h&&d("Expected '"+g+"' instead of '"+h+"'"),h=s.charAt(n),n+=1,h},l=function(){var g,v="";for(h==="-"&&(v="-",o("-"));h>="0"&&h<="9";)v+=h,o();if(h===".")for(v+=".";o()&&h>="0"&&h<="9";)v+=h;if(h==="e"||h==="E")for(v+=h,o(),(h==="-"||h==="+")&&(v+=h,o());h>="0"&&h<="9";)v+=h,o();if(g=+v,!isNaN(g))return g;d("Bad number")},r=function(){var g,v,b="",D;if(h==='"')for(;o();){if(h==='"')return o(),b;if(h==="\\")if(o(),h==="u"){for(D=0,v=0;v<4&&(g=parseInt(o(),16),!!isFinite(g));v+=1)D=D*16+g;b+=String.fromCharCode(D)}else{if(typeof i[h]!="string")break;b+=i[h]}else{if(h==`
1010
- `||h=="\r")break;b+=h}}d("Bad string")},a=function(){for(;h&&h<=" ";)o()},c=function(){switch(h){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}d("Unexpected '"+h+"'")},p,u=function(){var g=[];if(h==="["){if(o("["),a(),h==="]")return o("]"),g;for(;h;){if(g.push(p()),a(),h==="]")return o("]"),g;o(","),a()}}d("Bad array")},f=function(){var g,v={};if(h==="{"){if(o("{"),a(),h==="}")return o("}"),v;for(;h;){if(g=r(),a(),o(":"),Object.hasOwnProperty.call(v,g)&&d('Duplicate key "'+g+'"'),v[g]=p(),a(),h==="}")return o("}"),v;o(","),a()}}d("Bad object")};return p=function(){switch(a(),h){case"{":return f();case"[":return u();case'"':return r();case"-":return l();default:return h>="0"&&h<="9"?l():c()}},function(g,v){var b;return s=g,n=0,h=" ",b=p(),a(),h&&d("Syntax error"),typeof v=="function"?(function D(E,w){var y,A,T=E[w];if(T&&typeof T=="object")for(y in T)Object.hasOwnProperty.call(T,y)&&(A=D(T,y),A!==void 0?T[y]=A:delete T[y]);return v.call(E,w,T)})({"":b},""):b}}),ace.define("ace/mode/json_worker",[],function(m,e,t){var n=m("../lib/oop"),h=m("../worker/mirror").Mirror,i=m("./json/json_parse"),s=e.JsonWorker=function(d){h.call(this,d),this.setTimeout(200)};n.inherits(s,h),function(){this.onUpdate=function(){var d=this.doc.getValue(),o=[];try{d&&i(d)}catch(r){var l=this.doc.indexToPosition(r.at-1);o.push({row:l.row,column:l.column,text:r.message,type:"error"})}this.sender.emit("annotate",o)}}.call(s.prototype)});var _p={exports:{}};(function(m,e){ace.define("ace/theme/clouds_midnight-css",["require","exports","module"],function(t,n,h){h.exports=`.ace-clouds-midnight .ace_gutter {
1011
- background: #232323;
1012
- color: #929292
1013
- }
1014
-
1015
- .ace-clouds-midnight .ace_print-margin {
1016
- width: 1px;
1017
- background: #232323
1018
- }
1019
-
1020
- .ace-clouds-midnight {
1021
- background-color: #191919;
1022
- color: #929292
1023
- }
1024
-
1025
- .ace-clouds-midnight .ace_cursor {
1026
- color: #7DA5DC
1027
- }
1028
-
1029
- .ace-clouds-midnight .ace_marker-layer .ace_selection {
1030
- background: #000000
1031
- }
1032
-
1033
- .ace-clouds-midnight.ace_multiselect .ace_selection.ace_start {
1034
- box-shadow: 0 0 3px 0px #191919;
1035
- }
1036
-
1037
- .ace-clouds-midnight .ace_marker-layer .ace_step {
1038
- background: rgb(102, 82, 0)
1039
- }
1040
-
1041
- .ace-clouds-midnight .ace_marker-layer .ace_bracket {
1042
- margin: -1px 0 0 -1px;
1043
- border: 1px solid #BFBFBF
1044
- }
1045
-
1046
- .ace-clouds-midnight .ace_marker-layer .ace_active-line {
1047
- background: rgba(215, 215, 215, 0.031)
1048
- }
1049
-
1050
- .ace-clouds-midnight .ace_gutter-active-line {
1051
- background-color: rgba(215, 215, 215, 0.031)
1052
- }
1053
-
1054
- .ace-clouds-midnight .ace_marker-layer .ace_selected-word {
1055
- border: 1px solid #000000
1056
- }
1057
-
1058
- .ace-clouds-midnight .ace_invisible {
1059
- color: #666
1060
- }
1061
-
1062
- .ace-clouds-midnight .ace_keyword,
1063
- .ace-clouds-midnight .ace_meta,
1064
- .ace-clouds-midnight .ace_support.ace_constant.ace_property-value {
1065
- color: #927C5D
1066
- }
1067
-
1068
- .ace-clouds-midnight .ace_keyword.ace_operator {
1069
- color: #4B4B4B
1070
- }
1071
-
1072
- .ace-clouds-midnight .ace_keyword.ace_other.ace_unit {
1073
- color: #366F1A
1074
- }
1075
-
1076
- .ace-clouds-midnight .ace_constant.ace_language {
1077
- color: #39946A
1078
- }
1079
-
1080
- .ace-clouds-midnight .ace_constant.ace_numeric {
1081
- color: #46A609
1082
- }
1083
-
1084
- .ace-clouds-midnight .ace_constant.ace_character.ace_entity {
1085
- color: #A165AC
1086
- }
1087
-
1088
- .ace-clouds-midnight .ace_invalid {
1089
- color: #FFFFFF;
1090
- background-color: #E92E2E
1091
- }
1092
-
1093
- .ace-clouds-midnight .ace_fold {
1094
- background-color: #927C5D;
1095
- border-color: #929292
1096
- }
1097
-
1098
- .ace-clouds-midnight .ace_storage,
1099
- .ace-clouds-midnight .ace_support.ace_class,
1100
- .ace-clouds-midnight .ace_support.ace_function,
1101
- .ace-clouds-midnight .ace_support.ace_other,
1102
- .ace-clouds-midnight .ace_support.ace_type {
1103
- color: #E92E2E
1104
- }
1105
-
1106
- .ace-clouds-midnight .ace_string {
1107
- color: #5D90CD
1108
- }
1109
-
1110
- .ace-clouds-midnight .ace_comment {
1111
- color: #3C403B
1112
- }
1113
-
1114
- .ace-clouds-midnight .ace_entity.ace_name.ace_tag,
1115
- .ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {
1116
- color: #606060
1117
- }
1118
-
1119
- .ace-clouds-midnight .ace_indent-guide {
1120
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y
1121
- }
1122
-
1123
- .ace-clouds-midnight .ace_indent-guide-active {
1124
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;
1125
- }
1126
- `}),ace.define("ace/theme/clouds_midnight",["require","exports","module","ace/theme/clouds_midnight-css","ace/lib/dom"],function(t,n,h){n.isDark=!0,n.cssClass="ace-clouds-midnight",n.cssText=t("./clouds_midnight-css");var i=t("../lib/dom");i.importCssString(n.cssText,n.cssClass,!1)}),(function(){ace.require(["ace/theme/clouds_midnight"],function(t){m&&(m.exports=t)})})()})(_p);var kp={exports:{}};(function(m,e){ace.define("ace/theme/chrome-css",["require","exports","module"],function(t,n,h){h.exports=`.ace-chrome .ace_gutter {
1127
- background: #ebebeb;
1128
- color: #333;
1129
- overflow : hidden;
1130
- }
1131
-
1132
- .ace-chrome .ace_print-margin {
1133
- width: 1px;
1134
- background: #e8e8e8;
1135
- }
1136
-
1137
- .ace-chrome {
1138
- background-color: #FFFFFF;
1139
- color: black;
1140
- }
1141
-
1142
- .ace-chrome .ace_cursor {
1143
- color: black;
1144
- }
1145
-
1146
- .ace-chrome .ace_invisible {
1147
- color: rgb(191, 191, 191);
1148
- }
1149
-
1150
- .ace-chrome .ace_constant.ace_buildin {
1151
- color: rgb(88, 72, 246);
1152
- }
1153
-
1154
- .ace-chrome .ace_constant.ace_language {
1155
- color: rgb(88, 92, 246);
1156
- }
1157
-
1158
- .ace-chrome .ace_constant.ace_library {
1159
- color: rgb(6, 150, 14);
1160
- }
1161
-
1162
- .ace-chrome .ace_invalid {
1163
- background-color: rgb(153, 0, 0);
1164
- color: white;
1165
- }
1166
-
1167
- .ace-chrome .ace_fold {
1168
- }
1169
-
1170
- .ace-chrome .ace_support.ace_function {
1171
- color: rgb(60, 76, 114);
1172
- }
1173
-
1174
- .ace-chrome .ace_support.ace_constant {
1175
- color: rgb(6, 150, 14);
1176
- }
1177
-
1178
- .ace-chrome .ace_support.ace_type,
1179
- .ace-chrome .ace_support.ace_class
1180
- .ace-chrome .ace_support.ace_other {
1181
- color: rgb(109, 121, 222);
1182
- }
1183
-
1184
- .ace-chrome .ace_variable.ace_parameter {
1185
- font-style:italic;
1186
- color:#FD971F;
1187
- }
1188
- .ace-chrome .ace_keyword.ace_operator {
1189
- color: rgb(104, 118, 135);
1190
- }
1191
-
1192
- .ace-chrome .ace_comment {
1193
- color: #236e24;
1194
- }
1195
-
1196
- .ace-chrome .ace_comment.ace_doc {
1197
- color: #236e24;
1198
- }
1199
-
1200
- .ace-chrome .ace_comment.ace_doc.ace_tag {
1201
- color: #236e24;
1202
- }
1203
-
1204
- .ace-chrome .ace_constant.ace_numeric {
1205
- color: rgb(0, 0, 205);
1206
- }
1207
-
1208
- .ace-chrome .ace_variable {
1209
- color: rgb(49, 132, 149);
1210
- }
1211
-
1212
- .ace-chrome .ace_xml-pe {
1213
- color: rgb(104, 104, 91);
1214
- }
1215
-
1216
- .ace-chrome .ace_entity.ace_name.ace_function {
1217
- color: #0000A2;
1218
- }
1219
-
1220
-
1221
- .ace-chrome .ace_heading {
1222
- color: rgb(12, 7, 255);
1223
- }
1224
-
1225
- .ace-chrome .ace_list {
1226
- color:rgb(185, 6, 144);
1227
- }
1228
-
1229
- .ace-chrome .ace_marker-layer .ace_selection {
1230
- background: rgb(181, 213, 255);
1231
- }
1232
-
1233
- .ace-chrome .ace_marker-layer .ace_step {
1234
- background: rgb(252, 255, 0);
1235
- }
1236
-
1237
- .ace-chrome .ace_marker-layer .ace_stack {
1238
- background: rgb(164, 229, 101);
1239
- }
1240
-
1241
- .ace-chrome .ace_marker-layer .ace_bracket {
1242
- margin: -1px 0 0 -1px;
1243
- border: 1px solid rgb(192, 192, 192);
1244
- }
1245
-
1246
- .ace-chrome .ace_marker-layer .ace_active-line {
1247
- background: rgba(0, 0, 0, 0.07);
1248
- }
1249
-
1250
- .ace-chrome .ace_gutter-active-line {
1251
- background-color : #dcdcdc;
1252
- }
1253
-
1254
- .ace-chrome .ace_marker-layer .ace_selected-word {
1255
- background: rgb(250, 250, 255);
1256
- border: 1px solid rgb(200, 200, 250);
1257
- }
1258
-
1259
- .ace-chrome .ace_storage,
1260
- .ace-chrome .ace_keyword,
1261
- .ace-chrome .ace_meta.ace_tag {
1262
- color: rgb(147, 15, 128);
1263
- }
1264
-
1265
- .ace-chrome .ace_string.ace_regex {
1266
- color: rgb(255, 0, 0)
1267
- }
1268
-
1269
- .ace-chrome .ace_string {
1270
- color: #1A1AA6;
1271
- }
1272
-
1273
- .ace-chrome .ace_entity.ace_other.ace_attribute-name {
1274
- color: #994409;
1275
- }
1276
-
1277
- .ace-chrome .ace_indent-guide {
1278
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
1279
- }
1280
-
1281
- .ace-chrome .ace_indent-guide-active {
1282
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
1283
- }
1284
- `}),ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(t,n,h){n.isDark=!1,n.cssClass="ace-chrome",n.cssText=t("./chrome-css");var i=t("../lib/dom");i.importCssString(n.cssText,n.cssClass,!1)}),(function(){ace.require(["ace/theme/chrome"],function(t){m&&(m.exports=t)})})()})(kp);var Tp={exports:{}};(function(m,e){ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],function(t,n,h){function i(y){var A=new Date().toLocaleString("en-us",y);return A.length==1?"0"+A:A}var s=t("./lib/dom"),d=t("./lib/oop"),o=t("./lib/event_emitter").EventEmitter,l=t("./lib/lang"),r=t("./range").Range,a=t("./range_list").RangeList,c=t("./keyboard/hash_handler").HashHandler,p=t("./tokenizer").Tokenizer,u=t("./clipboard"),f={CURRENT_WORD:function(y){return y.session.getTextRange(y.session.getWordRange())},SELECTION:function(y,A,T){var x=y.session.getTextRange();return T?x.replace(/\n\r?([ \t]*\S)/g,`
1285
- `+T+"$1"):x},CURRENT_LINE:function(y){return y.session.getLine(y.getCursorPosition().row)},PREV_LINE:function(y){return y.session.getLine(y.getCursorPosition().row-1)},LINE_INDEX:function(y){return y.getCursorPosition().row},LINE_NUMBER:function(y){return y.getCursorPosition().row+1},SOFT_TABS:function(y){return y.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(y){return y.session.getTabSize()},CLIPBOARD:function(y){return u.getText&&u.getText()},FILENAME:function(y){return/[^/\\]*$/.exec(this.FILEPATH(y))[0]},FILENAME_BASE:function(y){return/[^/\\]*$/.exec(this.FILEPATH(y))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(y){return this.FILEPATH(y).replace(/[^/\\]*$/,"")},FILEPATH:function(y){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(y){var A=y.session.$mode||{};return A.blockComment&&A.blockComment.start||""},BLOCK_COMMENT_END:function(y){var A=y.session.$mode||{};return A.blockComment&&A.blockComment.end||""},LINE_COMMENT:function(y){var A=y.session.$mode||{};return A.lineCommentStart||""},CURRENT_YEAR:i.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:i.bind(null,{year:"2-digit"}),CURRENT_MONTH:i.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:i.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:i.bind(null,{month:"short"}),CURRENT_DATE:i.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:i.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:i.bind(null,{weekday:"short"}),CURRENT_HOUR:i.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:i.bind(null,{minute:"2-digit"}),CURRENT_SECOND:i.bind(null,{second:"2-digit"})};f.SELECTED_TEXT=f.SELECTION;var g=(function(){function y(){this.snippetMap={},this.snippetNameMap={},this.variables=f}return y.prototype.getTokenizer=function(){return y.$tokenizer||this.createTokenizer()},y.prototype.createTokenizer=function(){function A(M){return M=M.substr(1),/^\d+$/.test(M)?[{tabstopId:parseInt(M,10)}]:[{text:M}]}function T(M){return"(?:[^\\\\"+M+"]|\\\\.)"}var x={regex:"/("+T("/")+"+)/",onMatch:function(M,O,_){var k=_[0];return k.fmtString=!0,k.guard=M.slice(1,-1),k.flag="",""},next:"formatString"};return y.$tokenizer=new p({start:[{regex:/\\./,onMatch:function(M,O,_){var k=M[1];return(k=="}"&&_.length||"`$\\".indexOf(k)!=-1)&&(M=k),[M]}},{regex:/}/,onMatch:function(M,O,_){return[_.length?_.shift():M]}},{regex:/\$(?:\d+|\w+)/,onMatch:A},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(M,O,_){var k=A(M.substr(1));return _.unshift(k[0]),k},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+T("\\|")+"*\\|",onMatch:function(M,O,_){var k=M.slice(1,-1).replace(/\\[,|\\]|,/g,function(S){return S.length==2?S[1]:"\0"}).split("\0").map(function(S){return{value:S}});return _[0].choices=k,[k[0]]},next:"start"},x,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(M,O,_){return _.length&&_[0].expectElse?(_[0].expectElse=!1,_[0].ifEnd={elseEnd:_[0]},[_[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(M,O,_){var k=M[1];return k=="}"&&_.length||"`$\\".indexOf(k)!=-1?M=k:k=="n"?M=`
1286
- `:k=="t"?M=" ":"ulULE".indexOf(k)!=-1&&(M={changeCase:k,local:k>"a"}),[M]}},{regex:"/\\w*}",onMatch:function(M,O,_){var k=_.shift();return k&&(k.flag=M.slice(1,-1)),this.next=k&&k.tabstopId?"start":"",[k||M]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(M,O,_){return[{text:M.slice(1)}]}},{regex:/\${\w+/,onMatch:function(M,O,_){var k={text:M.slice(2)};return _.unshift(k),[k]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(M,O,_){var k=_.shift();return this.next=k&&k.tabstopId?"start":"",[k||M]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(M,O,_){var k=_[0];return k.formatFunction=M.slice(2,-1),[_.shift()]},next:"formatString"},x,{regex:/:[\?\-+]?/,onMatch:function(M,O,_){M[1]=="+"&&(_[0].ifEnd=_[0]),M[1]=="?"&&(_[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),y.$tokenizer},y.prototype.tokenizeTmSnippet=function(A,T){return this.getTokenizer().getLineTokens(A,T).tokens.map(function(x){return x.value||x})},y.prototype.getVariableValue=function(A,T,x){if(/^\d+$/.test(T))return(this.variables.__||{})[T]||"";if(/^[A-Z]\d+$/.test(T))return(this.variables[T[0]+"__"]||{})[T.substr(1)]||"";if(T=T.replace(/^TM_/,""),!this.variables.hasOwnProperty(T))return"";var M=this.variables[T];return typeof M=="function"&&(M=this.variables[T](A,T,x)),M??""},y.prototype.tmStrFormat=function(A,T,x){if(!T.fmt)return A;var M=T.flag||"",O=T.guard;O=new RegExp(O,M.replace(/[^gim]/g,""));var _=typeof T.fmt=="string"?this.tokenizeTmSnippet(T.fmt,"formatString"):T.fmt,k=this,S=A.replace(O,function(){var C=k.variables.__;k.variables.__=[].slice.call(arguments);for(var L=k.resolveVariables(_,x),I="E",F=0;F<L.length;F++){var R=L[F];if(typeof R=="object")if(L[F]="",R.changeCase&&R.local){var B=L[F+1];B&&typeof B=="string"&&(R.changeCase=="u"?L[F]=B[0].toUpperCase():L[F]=B[0].toLowerCase(),L[F+1]=B.substr(1))}else R.changeCase&&(I=R.changeCase);else I=="U"?L[F]=R.toUpperCase():I=="L"&&(L[F]=R.toLowerCase())}return k.variables.__=C,L.join("")});return S},y.prototype.tmFormatFunction=function(A,T,x){return T.formatFunction=="upcase"?A.toUpperCase():T.formatFunction=="downcase"?A.toLowerCase():A},y.prototype.resolveVariables=function(A,T){function x(I){var F=A.indexOf(I,k+1);F!=-1&&(k=F)}for(var M=[],O="",_=!0,k=0;k<A.length;k++){var S=A[k];if(typeof S=="string"){M.push(S),S==`
1287
- `?(_=!0,O=""):_&&(O=/^\t*/.exec(S)[0],_=/\S/.test(S));continue}if(S){if(_=!1,S.fmtString){var C=A.indexOf(S,k+1);C==-1&&(C=A.length),S.fmt=A.slice(k+1,C),k=C}if(S.text){var L=this.getVariableValue(T,S.text,O)+"";S.fmtString&&(L=this.tmStrFormat(L,S,T)),S.formatFunction&&(L=this.tmFormatFunction(L,S,T)),L&&!S.ifEnd?(M.push(L),x(S)):!L&&S.ifEnd&&x(S.ifEnd)}else S.elseEnd?x(S.elseEnd):(S.tabstopId!=null||S.changeCase!=null)&&M.push(S)}}return M},y.prototype.getDisplayTextForSnippet=function(A,T){var x=v.call(this,A,T);return x.text},y.prototype.insertSnippetForSelection=function(A,T,x){x===void 0&&(x={});var M=v.call(this,A,T,x),O=A.getSelectionRange(),_=A.session.replace(O,M.text),k=new b(A),S=A.inVirtualSelectionMode&&A.selection.index;k.addTabstops(M.tabstops,O.start,_,S)},y.prototype.insertSnippet=function(A,T,x){x===void 0&&(x={});var M=this;if(A.inVirtualSelectionMode)return M.insertSnippetForSelection(A,T,x);A.forEachSelection(function(){M.insertSnippetForSelection(A,T,x)},null,{keepOrder:!0}),A.tabstopManager&&A.tabstopManager.tabNext()},y.prototype.$getScope=function(A){var T=A.session.$mode.$id||"";if(T=T.split("/").pop(),T==="html"||T==="php"){T==="php"&&!A.session.$mode.inlinePhp&&(T="html");var x=A.getCursorPosition(),M=A.session.getState(x.row);typeof M=="object"&&(M=M[0]),M.substring&&(M.substring(0,3)=="js-"?T="javascript":M.substring(0,4)=="css-"?T="css":M.substring(0,4)=="php-"&&(T="php"))}return T},y.prototype.getActiveScopes=function(A){var T=this.$getScope(A),x=[T],M=this.snippetMap;return M[T]&&M[T].includeScopes&&x.push.apply(x,M[T].includeScopes),x.push("_"),x},y.prototype.expandWithTab=function(A,T){var x=this,M=A.forEachSelection(function(){return x.expandSnippetForSelection(A,T)},null,{keepOrder:!0});return M&&A.tabstopManager&&A.tabstopManager.tabNext(),M},y.prototype.expandSnippetForSelection=function(A,T){var x=A.getCursorPosition(),M=A.session.getLine(x.row),O=M.substring(0,x.column),_=M.substr(x.column),k=this.snippetMap,S;return this.getActiveScopes(A).some(function(C){var L=k[C];return L&&(S=this.findMatchingSnippet(L,O,_)),!!S},this),S?(T&&T.dryRun||(A.session.doc.removeInLine(x.row,x.column-S.replaceBefore.length,x.column+S.replaceAfter.length),this.variables.M__=S.matchBefore,this.variables.T__=S.matchAfter,this.insertSnippetForSelection(A,S.content),this.variables.M__=this.variables.T__=null),!0):!1},y.prototype.findMatchingSnippet=function(A,T,x){for(var M=A.length;M--;){var O=A[M];if(!(O.startRe&&!O.startRe.test(T))&&!(O.endRe&&!O.endRe.test(x))&&!(!O.startRe&&!O.endRe))return O.matchBefore=O.startRe?O.startRe.exec(T):[""],O.matchAfter=O.endRe?O.endRe.exec(x):[""],O.replaceBefore=O.triggerRe?O.triggerRe.exec(T)[0]:"",O.replaceAfter=O.endTriggerRe?O.endTriggerRe.exec(x)[0]:"",O}},y.prototype.register=function(A,T){function x(C){return C&&!/^\^?\(.*\)\$?$|^\\b$/.test(C)&&(C="(?:"+C+")"),C||""}function M(C,L,I){return C=x(C),L=x(L),C=L+C,C&&C[C.length-1]!="$"&&(C+="$"),new RegExp(C)}function O(C){C.scope||(C.scope=T||"_"),T=C.scope,_[T]||(_[T]=[],k[T]={});var L=k[T];if(C.name){var I=L[C.name];I&&S.unregister(I),L[C.name]=C}_[T].push(C),C.prefix&&(C.tabTrigger=C.prefix),!C.content&&C.body&&(C.content=Array.isArray(C.body)?C.body.join(`
1288
- `):C.body),C.tabTrigger&&!C.trigger&&(!C.guard&&/^\w/.test(C.tabTrigger)&&(C.guard="\\b"),C.trigger=l.escapeRegExp(C.tabTrigger)),!(!C.trigger&&!C.guard&&!C.endTrigger&&!C.endGuard)&&(C.startRe=M(C.trigger,C.guard),C.triggerRe=new RegExp(C.trigger),C.endRe=M(C.endTrigger,C.endGuard),C.endTriggerRe=new RegExp(C.endTrigger))}var _=this.snippetMap,k=this.snippetNameMap,S=this;A||(A=[]),Array.isArray(A)?A.forEach(O):Object.keys(A).forEach(function(C){O(A[C])}),this._signal("registerSnippets",{scope:T})},y.prototype.unregister=function(A,T){function x(_){var k=O[_.scope||T];if(k&&k[_.name]){delete k[_.name];var S=M[_.scope||T],C=S&&S.indexOf(_);C>=0&&S.splice(C,1)}}var M=this.snippetMap,O=this.snippetNameMap;A.content?x(A):Array.isArray(A)&&A.forEach(x)},y.prototype.parseSnippetFile=function(A){A=A.replace(/\r/g,"");for(var T=[],x={},M=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,O;O=M.exec(A);){if(O[1])try{x=JSON.parse(O[1]),T.push(x)}catch{}if(O[4])x.content=O[4].replace(/^\t/gm,""),T.push(x),x={};else{var _=O[2],k=O[3];if(_=="regex"){var S=/\/((?:[^\/\\]|\\.)*)|$/g;x.guard=S.exec(k)[1],x.trigger=S.exec(k)[1],x.endTrigger=S.exec(k)[1],x.endGuard=S.exec(k)[1]}else _=="snippet"?(x.tabTrigger=k.match(/^\S*/)[0],x.name||(x.name=k)):_&&(x[_]=k)}}return T},y.prototype.getSnippetByName=function(A,T){var x=this.snippetNameMap,M;return this.getActiveScopes(T).some(function(O){var _=x[O];return _&&(M=_[A]),!!M},this),M},y})();d.implement(g.prototype,o);var v=function(y,A,T){function x(K){for(var J=[],Y=0;Y<K.length;Y++){var X=K[Y];if(typeof X=="object"){if(L[X.tabstopId])continue;var q=K.lastIndexOf(X,Y-1);X=J[q]||{tabstopId:X.tabstopId}}J[Y]=X}return J}T===void 0&&(T={});var M=y.getCursorPosition(),O=y.session.getLine(M.row),_=y.session.getTabString(),k=O.match(/^\s*/)[0];M.column<k.length&&(k=k.slice(0,M.column)),A=A.replace(/\r/g,"");var S=this.tokenizeTmSnippet(A);S=this.resolveVariables(S,y),S=S.map(function(K){return K==`
1289
- `&&!T.excludeExtraIndent?K+k:typeof K=="string"?K.replace(/\t/g,_):K});var C=[];S.forEach(function(K,J){if(typeof K=="object"){var Y=K.tabstopId,X=C[Y];if(X||(X=C[Y]=[],X.index=Y,X.value="",X.parents={}),X.indexOf(K)===-1){K.choices&&!X.choices&&(X.choices=K.choices),X.push(K);var q=S.indexOf(K,J+1);if(q!==-1){var ne=S.slice(J+1,q),ue=ne.some(function(Se){return typeof Se=="object"});ue&&!X.value?X.value=ne:ne.length&&(!X.value||typeof X.value!="string")&&(X.value=ne.join(""))}}}}),C.forEach(function(K){K.length=0});for(var L={},I=0;I<S.length;I++){var F=S[I];if(typeof F=="object"){var R=F.tabstopId,B=C[R],N=S.indexOf(F,I+1);if(L[R]){L[R]===F&&(delete L[R],Object.keys(L).forEach(function(K){B.parents[K]=!0}));continue}L[R]=F;var z=B.value;typeof z!="string"?z=x(z):F.fmt&&(z=this.tmStrFormat(z,F,y)),S.splice.apply(S,[I+1,Math.max(0,N-I)].concat(z,F)),B.indexOf(F)===-1&&B.push(F)}}var W=0,j=0,U="";return S.forEach(function(K){if(typeof K=="string"){var J=K.split(`
1290
- `);J.length>1?(j=J[J.length-1].length,W+=J.length-1):j+=K.length,U+=K}else K&&(K.start?K.end={row:W,column:j}:K.start={row:W,column:j})}),{text:U,tabstops:C,tokens:S}},b=(function(){function y(A){if(this.index=0,this.ranges=[],this.tabstops=[],A.tabstopManager)return A.tabstopManager;A.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=l.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(A)}return y.prototype.attach=function(A){this.$openTabstops=null,this.selectedTabstop=null,this.editor=A,this.session=A.session,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},y.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},y.prototype.onChange=function(A){for(var T=A.action[0]=="r",x=this.selectedTabstop||{},M=x.parents||{},O=this.tabstops.slice(),_=0;_<O.length;_++){var k=O[_],S=k==x||M[k.index];if(k.rangeList.$bias=S?0:1,A.action=="remove"&&k!==x){var C=k.parents&&k.parents[x.index],L=k.rangeList.pointIndex(A.start,C);L=L<0?-L-1:L+1;var I=k.rangeList.pointIndex(A.end,C);I=I<0?-I-1:I-1;for(var F=k.rangeList.ranges.slice(L,I),R=0;R<F.length;R++)this.removeRange(F[R])}k.rangeList.$onChange(A)}var B=this.session;!this.$inChange&&T&&B.getLength()==1&&!B.getValue()&&this.detach()},y.prototype.updateLinkedFields=function(){var A=this.selectedTabstop;if(!(!A||!A.hasLinkedRanges||!A.firstNonLinked)){this.$inChange=!0;for(var T=this.session,x=T.getTextRange(A.firstNonLinked),M=0;M<A.length;M++){var O=A[M];if(O.linked){var _=O.original,k=n.snippetManager.tmStrFormat(x,_,this.editor);T.replace(O,k)}}this.$inChange=!1}},y.prototype.onAfterExec=function(A){A.command&&!A.command.readOnly&&this.updateLinkedFields()},y.prototype.onChangeSelection=function(){if(this.editor){for(var A=this.editor.selection.lead,T=this.editor.selection.anchor,x=this.editor.selection.isEmpty(),M=0;M<this.ranges.length;M++)if(!this.ranges[M].linked){var O=this.ranges[M].contains(A.row,A.column),_=x||this.ranges[M].contains(T.row,T.column);if(O&&_)return}this.detach()}},y.prototype.onChangeSession=function(){this.detach()},y.prototype.tabNext=function(A){var T=this.tabstops.length,x=this.index+(A||1);x=Math.min(Math.max(x,1),T),x==T&&(x=0),this.selectTabstop(x),this.updateTabstopMarkers(),x===0&&this.detach()},y.prototype.selectTabstop=function(A){this.$openTabstops=null;var T=this.tabstops[this.index];if(T&&this.addTabstopMarkers(T),this.index=A,T=this.tabstops[this.index],!(!T||!T.length)){this.selectedTabstop=T;var x=T.firstNonLinked||T;if(T.choices&&(x.cursor=x.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(x);else{var M=this.editor.multiSelect;M.toSingleRange(x);for(var O=0;O<T.length;O++)T.hasLinkedRanges&&T[O].linked||M.addRange(T[O].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},y.prototype.addTabstops=function(A,T,x){var M=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!A[0]){var O=r.fromPoints(x,x);E(O.start,T),E(O.end,T),A[0]=[O],A[0].index=0}var _=this.index,k=[_+1,0],S=this.ranges,C=this.snippetId=(this.snippetId||0)+1;A.forEach(function(L,I){var F=this.$openTabstops[I]||L;F.snippetId=C;for(var R=0;R<L.length;R++){var B=L[R],N=r.fromPoints(B.start,B.end||B.start);D(N.start,T),D(N.end,T),N.original=B,N.tabstop=F,S.push(N),F!=L?F.unshift(N):F[R]=N,B.fmtString||F.firstNonLinked&&M?(N.linked=!0,F.hasLinkedRanges=!0):F.firstNonLinked||(F.firstNonLinked=N)}F.firstNonLinked||(F.hasLinkedRanges=!1),F===L&&(k.push(F),this.$openTabstops[I]=F),this.addTabstopMarkers(F),F.rangeList=F.rangeList||new a,F.rangeList.$bias=0,F.rangeList.addList(F)},this),k.length>2&&(this.tabstops.length&&k.push(k.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,k))},y.prototype.addTabstopMarkers=function(A){var T=this.session;A.forEach(function(x){x.markerId||(x.markerId=T.addMarker(x,"ace_snippet-marker","text"))})},y.prototype.removeTabstopMarkers=function(A){var T=this.session;A.forEach(function(x){T.removeMarker(x.markerId),x.markerId=null})},y.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var A=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&A--,this.tabstops.forEach(function(T){T.snippetId===A?this.addTabstopMarkers(T):this.removeTabstopMarkers(T)},this)}},y.prototype.removeRange=function(A){var T=A.tabstop.indexOf(A);T!=-1&&A.tabstop.splice(T,1),T=this.ranges.indexOf(A),T!=-1&&this.ranges.splice(T,1),T=A.tabstop.rangeList.ranges.indexOf(A),T!=-1&&A.tabstop.splice(T,1),this.session.removeMarker(A.markerId),A.tabstop.length||(T=this.tabstops.indexOf(A.tabstop),T!=-1&&this.tabstops.splice(T,1),this.tabstops.length||this.detach())},y})();b.prototype.keyboardHandler=new c,b.prototype.keyboardHandler.bindKeys({Tab:function(y){n.snippetManager&&n.snippetManager.expandWithTab(y)||(y.tabstopManager.tabNext(1),y.renderer.scrollCursorIntoView())},"Shift-Tab":function(y){y.tabstopManager.tabNext(-1),y.renderer.scrollCursorIntoView()},Esc:function(y){y.tabstopManager.detach()}});var D=function(y,A){y.row==0&&(y.column+=A.column),y.row+=A.row},E=function(y,A){y.row==A.row&&(y.column-=A.column),y.row-=A.row};s.importCssString(`
1291
- .ace_snippet-marker {
1292
- -moz-box-sizing: border-box;
1293
- box-sizing: border-box;
1294
- background: rgba(194, 193, 208, 0.09);
1295
- border: 1px dotted rgba(211, 208, 235, 0.62);
1296
- position: absolute;
1297
- }`,"snippets.css",!1),n.snippetManager=new g;var w=t("./editor").Editor;(function(){this.insertSnippet=function(y,A){return n.snippetManager.insertSnippet(this,y,A)},this.expandSnippet=function(y){return n.snippetManager.expandWithTab(this,y)}}).call(w.prototype)}),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/config","ace/lib/useragent"],function(t,n,h){var i=t("../virtual_renderer").VirtualRenderer,s=t("../editor").Editor,d=t("../range").Range,o=t("../lib/event"),l=t("../lib/lang"),r=t("../lib/dom"),a=t("../config").nls,c=t("./../lib/useragent"),p=function(D){return"suggest-aria-id:".concat(D)},u=c.isSafari?"menu":"listbox",f=c.isSafari?"menuitem":"option",g=c.isSafari?"aria-current":"aria-selected",v=function(D){var E=new i(D);E.$maxLines=4;var w=new s(E);return w.setHighlightActiveLine(!1),w.setShowPrintMargin(!1),w.renderer.setShowGutter(!1),w.renderer.setHighlightGutterLine(!1),w.$mouseHandler.$focusTimeout=0,w.$highlightTagPending=!0,w},b=(function(){function D(E){var w=r.createElement("div"),y=v(w);E&&E.appendChild(w),w.style.display="none",y.renderer.content.style.cursor="default",y.renderer.setStyle("ace_autocomplete"),y.renderer.$textLayer.element.setAttribute("role",u),y.renderer.$textLayer.element.setAttribute("aria-roledescription",a("autocomplete.popup.aria-roledescription","Autocomplete suggestions")),y.renderer.$textLayer.element.setAttribute("aria-label",a("autocomplete.popup.aria-label","Autocomplete suggestions")),y.renderer.textarea.setAttribute("aria-hidden","true"),y.setOption("displayIndentGuides",!1),y.setOption("dragDelay",150);var A=function(){};y.focus=A,y.$isFocused=!0,y.renderer.$cursorLayer.restartTimer=A,y.renderer.$cursorLayer.element.style.opacity="0",y.renderer.$maxLines=8,y.renderer.$keepTextAreaAtCursor=!1,y.setHighlightActiveLine(!1),y.session.highlight(""),y.session.$searchHighlight.clazz="ace_highlight-marker",y.on("mousedown",function(S){var C=S.getDocumentPosition();y.selection.moveToPosition(C),M.start.row=M.end.row=C.row,S.stop()});var T,x=new d(-1,0,-1,1/0),M=new d(-1,0,-1,1/0);M.id=y.session.addMarker(M,"ace_active-line","fullLine"),y.setSelectOnHover=function(S){S?x.id&&(y.session.removeMarker(x.id),x.id=null):x.id=y.session.addMarker(x,"ace_line-hover","fullLine")},y.setSelectOnHover(!1),y.on("mousemove",function(S){if(!T){T=S;return}if(!(T.x==S.x&&T.y==S.y)){T=S,T.scrollTop=y.renderer.scrollTop,y.isMouseOver=!0;var C=T.getDocumentPosition().row;x.start.row!=C&&(x.id||y.setRow(C),_(C))}}),y.renderer.on("beforeRender",function(){if(T&&x.start.row!=-1){T.$pos=null;var S=T.getDocumentPosition().row;x.id||y.setRow(S),_(S,!0)}}),y.renderer.on("afterRender",function(){for(var S=y.renderer.$textLayer,C=S.config.firstRow,L=S.config.lastRow;C<=L;C++){var I=S.element.childNodes[C-S.config.firstRow];I.setAttribute("role",f),I.setAttribute("aria-roledescription",a("autocomplete.popup.item.aria-roledescription","item")),I.setAttribute("aria-setsize",y.data.length),I.setAttribute("aria-describedby","doc-tooltip"),I.setAttribute("aria-posinset",C+1);var F=y.getData(C);if(F){var R="".concat(F.caption||F.value).concat(F.meta?", ".concat(F.meta):"");I.setAttribute("aria-label",R)}var B=I.querySelectorAll(".ace_completion-highlight");B.forEach(function(N){N.setAttribute("role","mark")})}}),y.renderer.on("afterRender",function(){var S=y.getRow(),C=y.renderer.$textLayer,L=C.element.childNodes[S-C.config.firstRow],I=document.activeElement;if(L!==y.selectedNode&&y.selectedNode&&(r.removeCssClass(y.selectedNode,"ace_selected"),y.selectedNode.removeAttribute(g),y.selectedNode.removeAttribute("id")),I.removeAttribute("aria-activedescendant"),y.selectedNode=L,L){var F=p(S);r.addCssClass(L,"ace_selected"),L.id=F,C.element.setAttribute("aria-activedescendant",F),I.setAttribute("aria-activedescendant",F),L.setAttribute(g,"true")}});var O=function(){_(-1)},_=function(S,C){S!==x.start.row&&(x.start.row=x.end.row=S,C||y.session._emit("changeBackMarker"),y._emit("changeHoverMarker"))};y.getHoveredRow=function(){return x.start.row},o.addListener(y.container,"mouseout",function(){y.isMouseOver=!1,O()}),y.on("hide",O),y.on("changeSelection",O),y.session.doc.getLength=function(){return y.data.length},y.session.doc.getLine=function(S){var C=y.data[S];return typeof C=="string"?C:C&&C.value||""};var k=y.session.bgTokenizer;return k.$tokenizeRow=function(S){function C(K,J){K&&I.push({type:(L.className||"")+(J||""),value:K})}var L=y.data[S],I=[];if(!L)return I;typeof L=="string"&&(L={value:L});for(var F=L.caption||L.value||L.name,R=F.toLowerCase(),B=(y.filterText||"").toLowerCase(),N=0,z=0,W=0;W<=B.length;W++)if(W!=z&&(L.matchMask&1<<W||W==B.length)){var j=B.slice(z,W);z=W;var U=R.indexOf(j,N);if(U==-1)continue;C(F.slice(N,U),""),N=U+j.length,C(F.slice(U,N),"completion-highlight")}return C(F.slice(N,F.length),""),I.push({type:"completion-spacer",value:" "}),L.meta&&I.push({type:"completion-meta",value:L.meta}),L.message&&I.push({type:"completion-message",value:L.message}),I},k.$updateOnChange=A,k.start=A,y.session.$computeWidth=function(){return this.screenWidth=0},y.isOpen=!1,y.isTopdown=!1,y.autoSelect=!0,y.filterText="",y.isMouseOver=!1,y.data=[],y.setData=function(S,C){y.filterText=C||"",y.setValue(l.stringRepeat(`
1298
- `,S.length),-1),y.data=S||[],y.setRow(0)},y.getData=function(S){return y.data[S]},y.getRow=function(){return M.start.row},y.setRow=function(S){S=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,S)),M.start.row!=S&&(y.selection.clearSelection(),M.start.row=M.end.row=S||0,y.session._emit("changeBackMarker"),y.moveCursorTo(S||0,0),y.isOpen&&y._signal("select"))},y.on("changeSelection",function(){y.isOpen&&y.setRow(y.selection.lead.row),y.renderer.scrollCursorIntoView()}),y.hide=function(){this.container.style.display="none",y.anchorPos=null,y.anchor=null,y.isOpen&&(y.isOpen=!1,this._signal("hide"))},y.tryShow=function(S,C,L,I){if(!I&&y.isOpen&&y.anchorPos&&y.anchor&&y.anchorPos.top===S.top&&y.anchorPos.left===S.left&&y.anchor===L)return!0;var F=this.container,R=this.renderer.scrollBar.width||10,B=window.innerHeight-R,N=window.innerWidth-R,z=this.renderer,W=z.$maxLines*C*1.4,j={top:0,bottom:0},U=B-S.top-3*this.$borderSize-C,K=S.top-3*this.$borderSize;L||(K<=U||U>=W?L="bottom":L="top"),L==="top"?(j.bottom=S.top-this.$borderSize,j.top=j.bottom-W):L==="bottom"&&(j.top=S.top+C+this.$borderSize,j.bottom=j.top+W);var J=j.top>=0&&j.bottom<=B;if(!I&&!J)return!1;J?z.$maxPixelHeight=null:L==="top"?z.$maxPixelHeight=K:z.$maxPixelHeight=U,L==="top"?(F.style.top="",F.style.bottom=B+R-j.bottom+"px",y.isTopdown=!1):(F.style.top=j.top+"px",F.style.bottom="",y.isTopdown=!0),F.style.display="";var Y=S.left;return Y+F.offsetWidth>N&&(Y=N-F.offsetWidth),F.style.left=Y+"px",F.style.right="",y.isOpen||(y.isOpen=!0,this._signal("show"),T=null),y.anchorPos=S,y.anchor=L,r.$fixPositionBug(F),!0},y.show=function(S,C,L){this.tryShow(S,C,L?"bottom":void 0,!0)},y.goTo=function(S){var C=this.getRow(),L=this.session.getLength()-1;switch(S){case"up":C=C<=0?L:C-1;break;case"down":C=C>=L?-1:C+1;break;case"start":C=0;break;case"end":C=L}this.setRow(C)},y.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},y.$imageSize=0,y.$borderSize=1,y}return D})();r.importCssString(`
1299
- .ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
1300
- background-color: #CAD6FA;
1301
- z-index: 1;
1302
- }
1303
- .ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
1304
- background-color: #3a674e;
1305
- }
1306
- .ace_editor.ace_autocomplete .ace_line-hover {
1307
- border: 1px solid #abbffe;
1308
- margin-top: -1px;
1309
- background: rgba(233,233,253,0.4);
1310
- position: absolute;
1311
- z-index: 2;
1312
- }
1313
- .ace_dark.ace_editor.ace_autocomplete .ace_line-hover {
1314
- border: 1px solid rgba(109, 150, 13, 0.8);
1315
- background: rgba(58, 103, 78, 0.62);
1316
- }
1317
- .ace_completion-meta {
1318
- opacity: 0.5;
1319
- margin-left: 0.9em;
1320
- }
1321
- .ace_completion-message {
1322
- margin-left: 0.9em;
1323
- color: blue;
1324
- }
1325
- .ace_editor.ace_autocomplete .ace_completion-highlight{
1326
- color: #2d69c7;
1327
- }
1328
- .ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{
1329
- color: #93ca12;
1330
- }
1331
- .ace_editor.ace_autocomplete {
1332
- width: 300px;
1333
- z-index: 200000;
1334
- border: 1px lightgray solid;
1335
- position: fixed;
1336
- box-shadow: 2px 3px 5px rgba(0,0,0,.2);
1337
- line-height: 1.4;
1338
- background: #fefefe;
1339
- color: #111;
1340
- }
1341
- .ace_dark.ace_editor.ace_autocomplete {
1342
- border: 1px #484747 solid;
1343
- box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);
1344
- line-height: 1.4;
1345
- background: #25282c;
1346
- color: #c1c1c1;
1347
- }
1348
- .ace_autocomplete .ace_text-layer {
1349
- width: calc(100% - 8px);
1350
- }
1351
- .ace_autocomplete .ace_line {
1352
- display: flex;
1353
- align-items: center;
1354
- }
1355
- .ace_autocomplete .ace_line > * {
1356
- min-width: 0;
1357
- flex: 0 0 auto;
1358
- }
1359
- .ace_autocomplete .ace_line .ace_ {
1360
- flex: 0 1 auto;
1361
- overflow: hidden;
1362
- text-overflow: ellipsis;
1363
- }
1364
- .ace_autocomplete .ace_completion-spacer {
1365
- flex: 1;
1366
- }
1367
- .ace_autocomplete.ace_loading:after {
1368
- content: "";
1369
- position: absolute;
1370
- top: 0px;
1371
- height: 2px;
1372
- width: 8%;
1373
- background: blue;
1374
- z-index: 100;
1375
- animation: ace_progress 3s infinite linear;
1376
- animation-delay: 300ms;
1377
- transform: translateX(-100%) scaleX(1);
1378
- }
1379
- @keyframes ace_progress {
1380
- 0% { transform: translateX(-100%) scaleX(1) }
1381
- 50% { transform: translateX(625%) scaleX(2) }
1382
- 100% { transform: translateX(1500%) scaleX(3) }
1383
- }
1384
- @media (prefers-reduced-motion) {
1385
- .ace_autocomplete.ace_loading:after {
1386
- transform: translateX(625%) scaleX(2);
1387
- animation: none;
1388
- }
1389
- }
1390
- `,"autocompletion.css",!1),n.AcePopup=b,n.$singleLineEditor=v,n.getAriaId=p}),ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(t,n,h){var i=(function(){function s(d){this.editor=d,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}return s.prototype.setScreenReaderContent=function(d){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var l=this.popup.getRow(),r=this.popup.renderer.$textLayer,a=r.element.childNodes[l-r.config.firstRow];if(a){for(var c="doc-tooltip ",p=0;p<this._lines.length;p++)c+="ace-inline-screenreader-line-".concat(p," ");a.setAttribute("aria-describedby",c)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=d.split(/\r\n|\r|\n/);var o=this.createCodeBlock();this.screenReaderDiv.appendChild(o)},s.prototype.destroy=function(){this.screenReaderDiv.remove()},s.prototype.createCodeBlock=function(){var d=document.createElement("pre");d.setAttribute("id","ace-inline-screenreader");for(var o=0;o<this._lines.length;o++){var l=document.createElement("code");l.setAttribute("id","ace-inline-screenreader-line-".concat(o));var r=document.createTextNode(this._lines[o]);l.appendChild(r),d.appendChild(l)}return d},s})();n.AceInlineScreenReader=i}),ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],function(t,n,h){var i=t("../snippets").snippetManager,s=t("./inline_screenreader").AceInlineScreenReader,d=(function(){function o(){this.editor=null}return o.prototype.show=function(l,r,a){if(a=a||"",l&&this.editor&&this.editor!==l&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!l||!r)return!1;this.inlineScreenReader||(this.inlineScreenReader=new s(l));var c=r.snippet?i.getDisplayTextForSnippet(l,r.snippet):r.value;return r.hideInlinePreview||!c||!c.startsWith(a)?!1:(this.editor=l,this.inlineScreenReader.setScreenReaderContent(c),c=c.slice(a.length),c===""?l.removeGhostText():l.setGhostText(c),!0)},o.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},o.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},o.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&(this.inlineScreenReader.destroy(),this.inlineScreenReader=null)},o})();n.AceInline=d}),ace.define("ace/autocomplete/util",["require","exports","module"],function(t,n,h){n.parForEach=function(s,d,o){var l=0,r=s.length;r===0&&o();for(var a=0;a<r;a++)d(s[a],function(c,p){l++,l===r&&o(c,p)})};var i=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;n.retrievePrecedingIdentifier=function(s,d,o){o=o||i;for(var l=[],r=d-1;r>=0&&o.test(s[r]);r--)l.push(s[r]);return l.reverse().join("")},n.retrieveFollowingIdentifier=function(s,d,o){o=o||i;for(var l=[],r=d;r<s.length&&o.test(s[r]);r++)l.push(s[r]);return l},n.getCompletionPrefix=function(s){var d=s.getCursorPosition(),o=s.session.getLine(d.row),l;return s.completers.forEach(function(r){r.identifierRegexps&&r.identifierRegexps.forEach(function(a){!l&&a&&(l=this.retrievePrecedingIdentifier(o,d.column,a))}.bind(this))}.bind(this)),l||this.retrievePrecedingIdentifier(o,d.column)},n.triggerAutocomplete=function(s,o){var o=o??s.session.getPrecedingCharacter();return s.completers.some(function(l){if(l.triggerCharacters&&Array.isArray(l.triggerCharacters))return l.triggerCharacters.includes(o)})}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event","ace/lib/scroll"],function(t,n,h){var i=t("./keyboard/hash_handler").HashHandler,s=t("./autocomplete/popup").AcePopup,d=t("./autocomplete/inline").AceInline,o=t("./autocomplete/popup").getAriaId,l=t("./autocomplete/util"),r=t("./lib/lang"),a=t("./lib/dom"),c=t("./snippets").snippetManager,p=t("./config"),u=t("./lib/event"),f=t("./lib/scroll").preventParentScroll,g=function(E,w){w.completer&&w.completer.destroy()},v=(function(){function E(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new i,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=r.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=r.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=r.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=r.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=r.delayedCall(function(){var w=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!w||this.editor.completers.length===0||(this.completions=new D(E.completionsForLoading),this.openPopup(this.editor,w.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0))}.bind(this),this.stickySelectionDelay)}return Object.defineProperty(E,"completionsForLoading",{get:function(){return[{caption:p.nls("autocomplete.loading","Loading..."),value:""}]},enumerable:!1,configurable:!0}),E.prototype.$init=function(){return this.popup=new s(this.parentNode||document.body||document.documentElement),this.popup.on("click",function(w){this.insertMatch(),w.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.$onPopupShow.bind(this)),this.popup.on("hide",this.$onHidePopup.bind(this)),this.popup.on("select",this.$onPopupChange.bind(this)),u.addListener(this.popup.container,"mouseout",this.mouseOutListener.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup.renderer.on("afterRender",this.$onPopupRender.bind(this)),this.popup},E.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new d,this.inlineRenderer},E.prototype.getPopup=function(){return this.popup||this.$init()},E.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1},E.prototype.$seen=function(w){!this.hasSeen.has(w)&&w&&w.completer&&w.completer.onSeen&&typeof w.completer.onSeen=="function"&&(w.completer.onSeen(this.editor,w),this.hasSeen.add(w))},E.prototype.$onPopupChange=function(w){if(this.inlineRenderer&&this.inlineEnabled){var y=w?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(y),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule()}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null)},E.prototype.$updateGhostText=function(w){var y=this.base.row,A=this.base.column,T=this.editor.getCursorPosition().column,x=this.editor.session.getLine(y).slice(A,T);this.inlineRenderer.show(this.editor,w,x)?this.$seen(w):this.inlineRenderer.hide()},E.prototype.$onPopupRender=function(){var w=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var y=this.popup.getFirstVisibleRow();y<=this.popup.getLastVisibleRow();y++){var A=this.popup.getData(y);A&&(!w||A.hideInlinePreview)&&this.$seen(A)}},E.prototype.$onPopupShow=function(w){this.$onPopupChange(w),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},E.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var w=this.editor.container.parentNode,y=[];w;)y.push(w),w.addEventListener("scroll",this.onLayoutChange,{passive:!0}),w=w.parentNode;this.$elements=y}},E.prototype.unObserveLayoutChanges=function(){var w=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(y){y.removeEventListener("scroll",w.onLayoutChange,{passive:!0})}),this.$elements=null},E.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},E.prototype.$updatePopupPosition=function(){var w=this.editor,y=w.renderer,A=y.layerConfig.lineHeight,T=y.$cursorLayer.getPixelPosition(this.base,!0);T.left-=this.popup.getTextLeftOffset();var x=w.container.getBoundingClientRect();T.top+=x.top-y.layerConfig.offset,T.left+=x.left-w.renderer.scrollLeft,T.left+=y.gutterWidth;var M={top:T.top,left:T.left};y.$ghostText&&y.$ghostTextWidget&&this.base.row===y.$ghostText.position.row&&(M.top+=y.$ghostTextWidget.el.offsetHeight);var O=w.container.getBoundingClientRect().bottom-A,_=O<M.top?{top:O,left:M.left}:M;this.popup.tryShow(_,A,"bottom")||this.popup.tryShow(T,A,"top")||this.popup.show(T,A)},E.prototype.openPopup=function(w,y,A){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var T=this.popup.getRow(),x=this.popup.data[T];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:o(this.popup.getRow()),inline:this.inlineEnabled}),w.keyBinding.addKeyboardHandler(this.keyboardHandler);var M;this.stickySelection&&(M=this.popup.data.indexOf(x)),(!M||M===-1)&&(M=0),this.popup.setRow(this.autoSelect?M:-1),M===T&&x!==this.completions.filtered[M]&&this.$onPopupChange();var O=this.inlineRenderer&&this.inlineEnabled;if(M===T&&O){var _=this.popup.getData(this.popup.getRow());this.$updateGhostText(_)}A||(this.popup.setTheme(w.getTheme()),this.popup.setFontSize(w.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},E.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off("afterRender",this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},E.prototype.changeListener=function(w){var y=this.editor.selection.lead;(y.row!=this.base.row||y.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},E.prototype.blurListener=function(w){var y=document.activeElement,A=this.editor.textInput.getElement(),T=w.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(w.relatedTarget),x=this.popup&&this.popup.container;y!=A&&y.parentNode!=x&&!T&&y!=this.tooltipNode&&w.relatedTarget!=A&&this.detach()},E.prototype.mousedownListener=function(w){this.detach()},E.prototype.mousewheelListener=function(w){this.popup&&!this.popup.isMouseOver&&this.detach()},E.prototype.mouseOutListener=function(w){this.popup.isOpen&&this.$updatePopupPosition()},E.prototype.goTo=function(w){this.popup.goTo(w)},E.prototype.insertMatch=function(w,y){if(w||(w=this.popup.getData(this.popup.getRow())),!w)return!1;if(w.value==="")return this.detach();var A=this.completions,T=this.getCompletionProvider().insertMatch(this.editor,w,A.filterText,y);return this.completions==A&&this.detach(),T},E.prototype.showPopup=function(w,y){this.editor&&this.detach(),this.activated=!0,this.editor=w,w.completer!=this&&(w.completer&&w.completer.detach(),w.completer=this),w.on("changeSelection",this.changeListener),w.on("blur",this.blurListener),w.on("mousedown",this.mousedownListener),w.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,y)},E.prototype.getCompletionProvider=function(w){return this.completionProvider||(this.completionProvider=new b(w)),this.completionProvider},E.prototype.gatherCompletions=function(w,y){return this.getCompletionProvider().gatherCompletions(w,y)},E.prototype.updateCompletions=function(w,y){if(w&&this.base&&this.completions){var T=this.editor.getCursorPosition(),x=this.editor.session.getTextRange({start:this.base,end:T});if(x==this.completions.filterText)return;if(this.completions.setFilter(x),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==x&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,x,w);return}if(y&&y.matches){var T=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(T.row,T.column),this.base.$insertRight=!0,this.completions=new D(y.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,"",w)}var A=this.editor.getSession(),T=this.editor.getCursorPosition(),x=l.getCompletionPrefix(this.editor);this.base=A.doc.createAnchor(T.row,T.column-x.length),this.base.$insertRight=!0;var M={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:x,pos:T}).provideCompletions(this.editor,M,function(O,_,k){var S=_.filtered,C=l.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),k){if(!S.length){var L=!this.autoShown&&this.emptyMessage;if(typeof L=="function"&&(L=this.emptyMessage(C)),L){var I=[{caption:L,value:""}];this.completions=new D(I),this.openPopup(this.editor,C,w),this.popup.renderer.setStyle("ace_loading",!1),this.popup.renderer.setStyle("ace_empty-message",!0);return}return this.detach()}if(S.length==1&&S[0].value==C&&!S[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&S.length==1)return this.insertMatch(S[0])}this.completions=!k&&this.showLoadingState?new D(E.completionsForLoading.concat(S),_.filterText):_,this.openPopup(this.editor,C,w),this.popup.renderer.setStyle("ace_empty-message",!1),this.popup.renderer.setStyle("ace_loading",!k)}.bind(this)),this.showLoadingState&&!this.autoShown&&(!this.popup||!this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2)},E.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},E.prototype.updateDocTooltip=function(){var w=this.popup,y=this.completions&&this.completions.filtered,A=y&&(y[w.getHoveredRow()]||y[w.getRow()]),T=null;if(!A||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var x=this.editor.completers.length,M=0;M<x;M++){var O=this.editor.completers[M];if(O.getDocTooltip&&A.completerId===O.id){T=O.getDocTooltip(A);break}}if(!T&&typeof A!="string"&&(T=A),typeof T=="string"&&(T={docText:T}),!T||!T.docHTML&&!T.docText)return this.hideDocTooltip();this.showDocTooltip(T)},E.prototype.showDocTooltip=function(w){this.tooltipNode||(this.tooltipNode=a.createElement("div"),this.tooltipNode.style.margin="0",this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.style.overscrollBehavior="contain",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"),this.tooltipNode.addEventListener("wheel",f));var y=this.editor.renderer.theme;this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(y.isDark?"ace_dark ":"")+(y.cssClass||"");var A=this.tooltipNode;w.docHTML?A.innerHTML=w.docHTML:w.docText&&(A.textContent=w.docText),A.parentNode||this.popup.container.appendChild(this.tooltipNode);var T=this.popup,x=T.container.getBoundingClientRect(),M=400,O=300,_=T.renderer.scrollBar.width||10,k=x.left,S=window.innerWidth-x.right-_,C=T.isTopdown?x.top:window.innerHeight-_-x.bottom,L=[Math.min(S/M,1),Math.min(k/M,1),Math.min(C/O*.9)],I=Math.max.apply(Math,L),F=A.style;F.display="block",I==L[0]?(F.left=x.right+1+"px",F.right="",F.maxWidth=M*I+"px",F.top=x.top+"px",F.bottom="",F.maxHeight=Math.min(window.innerHeight-_-x.top,O)+"px"):I==L[1]?(F.right=window.innerWidth-x.left+"px",F.left="",F.maxWidth=M*I+"px",F.top=x.top+"px",F.bottom="",F.maxHeight=Math.min(window.innerHeight-_-x.top,O)+"px"):I==L[2]&&(F.left=window.innerWidth-x.left+"px",F.maxWidth=Math.min(M,window.innerWidth)+"px",T.isTopdown?(F.top=x.bottom+"px",F.left=x.left+"px",F.right="",F.bottom="",F.maxHeight=Math.min(window.innerHeight-_-x.bottom,O)+"px"):(F.top=T.container.offsetTop-A.offsetHeight+"px",F.left=x.left+"px",F.right="",F.bottom="",F.maxHeight=Math.min(T.container.offsetTop,O)+"px"))},E.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var w=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==w&&this.editor.focus(),this.tooltipNode=null,w.parentNode&&w.parentNode.removeChild(w)}},E.prototype.onTooltipClick=function(w){for(var y=w.target;y&&y!=this.tooltipNode;){if(y.nodeName=="A"&&y.href){y.rel="noreferrer",y.target="_blank";break}y=y.parentNode}},E.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var w=this.popup.container;w&&w.parentNode&&w.parentNode.removeChild(w)}this.editor&&this.editor.completer==this&&(this.editor.off("destroy",g),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},E.for=function(w){return w.completer instanceof E||(w.completer&&(w.completer.destroy(),w.completer=null),p.get("sharedPopups")?(E.$sharedInstance||(E.$sharedInstance=new E),w.completer=E.$sharedInstance):(w.completer=new E,w.once("destroy",g))),w.completer},E})();v.prototype.commands={Up:function(E){E.completer.goTo("up")},Down:function(E){E.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(E){E.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(E){E.completer.goTo("end")},Esc:function(E){E.completer.detach()},Return:function(E){return E.completer.insertMatch()},"Shift-Return":function(E){E.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(E){var w=E.completer.insertMatch();if(w||E.tabstopManager)return w;E.completer.goTo("down")},Backspace:function(E){E.execCommand("backspace");var w=l.getCompletionPrefix(E);!w&&E.completer&&E.completer.detach()},PageUp:function(E){E.completer.popup.gotoPageUp()},PageDown:function(E){E.completer.popup.gotoPageDown()}},v.startCommand={name:"startAutocomplete",exec:function(E,w){var y=v.for(E);y.autoInsert=!1,y.autoSelect=!0,y.autoShown=!1,y.showPopup(E,w),y.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var b=(function(){function E(w){this.initialPosition=w,this.active=!0}return E.prototype.insertByIndex=function(w,y,A){return!this.completions||!this.completions.filtered?!1:this.insertMatch(w,this.completions.filtered[y],A)},E.prototype.insertMatch=function(w,y,A){if(!y)return!1;if(w.startOperation({command:{name:"insertMatch"}}),y.completer&&y.completer.insertMatch)y.completer.insertMatch(w,y);else{if(!this.completions)return!1;var T=this.completions.filterText.length,x=0;if(y.range&&y.range.start.row===y.range.end.row&&(T-=this.initialPosition.prefix.length,T+=this.initialPosition.pos.column-y.range.start.column,x+=y.range.end.column-this.initialPosition.pos.column),T||x){var M;w.selection.getAllRanges?M=w.selection.getAllRanges():M=[w.getSelectionRange()];for(var O=0,_;_=M[O];O++)_.start.column-=T,_.end.column+=x,w.session.remove(_)}y.snippet?c.insertSnippet(w,y.snippet):this.$insertString(w,y),y.completer&&y.completer.onInsert&&typeof y.completer.onInsert=="function"&&y.completer.onInsert(w,y),y.command&&y.command==="startAutocomplete"&&w.execCommand(y.command)}return w.endOperation(),!0},E.prototype.$insertString=function(w,y){var A=y.value||y;w.execCommand("insertstring",A)},E.prototype.gatherCompletions=function(w,y){var A=w.getSession(),T=w.getCursorPosition(),x=l.getCompletionPrefix(w),M=[];this.completers=w.completers;var O=w.completers.length;return w.completers.forEach(function(_,k){_.getCompletions(w,A,T,x,function(S,C){_.hideInlinePreview&&(C=C.map(function(L){return Object.assign(L,{hideInlinePreview:_.hideInlinePreview})})),!S&&C&&(M=M.concat(C)),y(null,{prefix:l.getCompletionPrefix(w),matches:M,finished:--O===0})})}),!0},E.prototype.provideCompletions=function(w,y,A){var T=function(_){var k=_.prefix,S=_.matches;this.completions=new D(S),y.exactMatch&&(this.completions.exactMatch=!0),y.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(k),(_.finished||this.completions.filtered.length)&&A(null,this.completions,_.finished)}.bind(this),x=!0,M=null;if(this.gatherCompletions(w,function(_,k){if(this.active){_&&(A(_,[],!0),this.detach());var S=k.prefix;if(S.indexOf(k.prefix)===0){if(x){M=k;return}T(k)}}}.bind(this)),x=!1,M){var O=M;M=null,T(O)}},E.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(w){typeof w.cancel=="function"&&w.cancel()})},E})(),D=(function(){function E(w,y){this.all=w,this.filtered=w,this.filterText=y||"",this.exactMatch=!1,this.ignoreCaption=!1}return E.prototype.setFilter=function(w){if(w.length>this.filterText&&w.lastIndexOf(this.filterText,0)===0)var y=this.filtered;else var y=this.all;this.filterText=w,y=this.filterCompletions(y,this.filterText),y=y.sort(function(T,x){return x.exactMatch-T.exactMatch||x.$score-T.$score||(T.caption||T.value).localeCompare(x.caption||x.value)});var A=null;y=y.filter(function(T){var x=T.snippet||T.caption||T.value;return x===A?!1:(A=x,!0)}),this.filtered=y},E.prototype.filterCompletions=function(w,y){var A=[],T=y.toUpperCase(),x=y.toLowerCase();e:for(var M=0,O;O=w[M];M++){if(O.skipFilter){O.$score=O.score,A.push(O);continue}var _=!this.ignoreCaption&&O.caption||O.value||O.snippet;if(_){var k=-1,S=0,C=0,L,I;if(this.exactMatch){if(y!==_.substr(0,y.length))continue e}else{var F=_.toLowerCase().indexOf(x);if(F>-1)C=F;else for(var R=0;R<y.length;R++){var B=_.indexOf(x[R],k+1),N=_.indexOf(T[R],k+1);if(L=B>=0&&(N<0||B<N)?B:N,L<0)continue e;I=L-k-1,I>0&&(k===-1&&(C+=10),C+=I,S|=1<<R),k=L}}O.matchMask=S,O.exactMatch=C?0:1,O.$score=(O.score||0)-C,A.push(O)}}return A},E})();n.Autocomplete=v,n.CompletionProvider=b,n.FilteredList=D}),ace.define("ace/marker_group",["require","exports","module"],function(t,n,h){var i=(function(){function s(d,o){o&&(this.markerType=o.markerType),this.markers=[],this.session=d,d.addDynamicMarker(this)}return s.prototype.getMarkerAtPosition=function(d){return this.markers.find(function(o){return o.range.contains(d.row,d.column)})},s.prototype.markersComparator=function(d,o){return d.range.start.row-o.range.start.row},s.prototype.setMarkers=function(d){this.markers=d.sort(this.markersComparator).slice(0,this.MAX_MARKERS),this.session._signal("changeBackMarker")},s.prototype.update=function(d,o,l,r){if(!(!this.markers||!this.markers.length))for(var a=r.firstRow,c=r.lastRow,p,u=0,f=0,g=0;g<this.markers.length;g++){var v=this.markers[g];if(!(v.range.end.row<a)&&!(v.range.start.row>c)&&(v.range.start.row===f?u++:(f=v.range.start.row,u=0),!(u>200))){var b=v.range.clipRows(a,c);if(!(b.start.row===b.end.row&&b.start.column===b.end.column)){var D=b.toScreenRange(l);if(D.isEmpty()){p=l.getNextFoldLine(b.end.row,p),p&&p.end.row>b.end.row&&(a=p.end.row);continue}this.markerType==="fullLine"?o.drawFullLineMarker(d,D,v.className,r):D.isMultiLine()?this.markerType==="line"?o.drawMultiLineMarker(d,D,v.className,r):o.drawTextMarker(d,D,v.className,r):o.drawSingleLineMarker(d,D,v.className+" ace_br15",r)}}}},s})();i.prototype.MAX_MARKERS=1e4,n.MarkerGroup=i}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(t,n,h){function i(l,r){var a=l.getTextRange(d.fromPoints({row:0,column:0},r));return a.split(o).length-1}function s(l,r){var a=i(l,r),c=l.getValue().split(o),p=Object.create(null),u=c[a];return c.forEach(function(f,g){if(!(!f||f===u)){var v=Math.abs(a-g),b=c.length-v;p[f]?p[f]=Math.max(b,p[f]):p[f]=b}}),p}var d=t("../range").Range,o=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;n.getCompletions=function(l,r,a,c,p){var u=s(r,a),f=Object.keys(u);p(null,f.map(function(g){return{caption:g,value:g,score:u[g],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/marker_group","ace/autocomplete/text_completer","ace/editor","ace/config"],function(t,n,h){var i=t("../snippets").snippetManager,s=t("../autocomplete").Autocomplete,d=t("../config"),o=t("../lib/lang"),l=t("../autocomplete/util"),r=t("../marker_group").MarkerGroup,a=t("../autocomplete/text_completer"),c={getCompletions:function(x,M,O,_,k){if(M.$mode.completer)return M.$mode.completer.getCompletions(x,M,O,_,k);var S=x.session.getState(O.row),C=M.$mode.getCompletions(S,M,O,_);C=C.map(function(L){return L.completerId=c.id,L}),k(null,C)},id:"keywordCompleter"},p=function(x){var M={};return x.replace(/\${(\d+)(:(.*?))?}/g,function(O,_,k,S){return M[_]=S||""}).replace(/\$(\d+?)/g,function(O,_){return M[_]})},u={getCompletions:function(x,M,O,_,k){var S=[],C=M.getTokenAt(O.row,O.column);C&&C.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?S.push("html-tag"):S=i.getActiveScopes(x);var L=i.snippetMap,I=[];S.forEach(function(F){for(var R=L[F]||[],B=R.length;B--;){var N=R[B],z=N.name||N.tabTrigger;z&&I.push({caption:z,snippet:N.content,meta:N.tabTrigger&&!N.name?N.tabTrigger+"⇥ ":"snippet",completerId:u.id})}},this),k(null,I)},getDocTooltip:function(x){x.snippet&&!x.docHTML&&(x.docHTML=["<b>",o.escapeHTML(x.caption),"</b>","<hr></hr>",o.escapeHTML(p(x.snippet))].join(""))},id:"snippetCompleter"},f=[u,a,c];n.setCompleters=function(x){f.length=0,x&&f.push.apply(f,x)},n.addCompleter=function(x){f.push(x)},n.textCompleter=a,n.keyWordCompleter=c,n.snippetCompleter=u;var g={name:"expandSnippet",exec:function(x){return i.expandWithTab(x)},bindKey:"Tab"},v=function(x,M){b(M.session.$mode)},b=function(x){typeof x=="string"&&(x=d.$modes[x]),x&&(i.files||(i.files={}),D(x.$id,x.snippetFileId),x.modes&&x.modes.forEach(b))},D=function(x,M){!M||!x||i.files[x]||(i.files[x]={},d.loadModule(M,function(O){O&&(i.files[x]=O,!O.snippets&&O.snippetText&&(O.snippets=i.parseSnippetFile(O.snippetText)),i.register(O.snippets||[],O.scope),O.includeScopes&&(i.snippetMap[O.scope].includeScopes=O.includeScopes,O.includeScopes.forEach(function(_){b("ace/mode/"+_)})))}))},E=function(x){var M=x.editor,O=M.completer&&M.completer.activated;if(x.command.name==="backspace")O&&!l.getCompletionPrefix(M)&&M.completer.detach();else if(x.command.name==="insertstring"&&!O){w=x;var _=x.editor.$liveAutocompletionDelay;_?y.delay(_):A(x)}},w,y=o.delayedCall(function(){A(w)},0),A=function(x){var M=x.editor,O=l.getCompletionPrefix(M),_=x.args,k=l.triggerAutocomplete(M,_);if(O&&O.length>=M.$liveAutocompletionThreshold||k){var S=s.for(M);S.autoShown=!0,S.showPopup(M)}},T=t("../editor").Editor;t("../config").defineOptions(T.prototype,"editor",{enableBasicAutocompletion:{set:function(x){x?(s.for(this),this.completers||(this.completers=Array.isArray(x)?x:f),this.commands.addCommand(s.startCommand)):this.commands.removeCommand(s.startCommand)},value:!1},enableLiveAutocompletion:{set:function(x){x?(this.completers||(this.completers=Array.isArray(x)?x:f),this.commands.on("afterExec",E)):this.commands.off("afterExec",E)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(x){x?(this.commands.addCommand(g),this.on("changeMode",v),v(null,this)):(this.commands.removeCommand(g),this.off("changeMode",v))},value:!1}}),n.MarkerGroup=r}),(function(){ace.require(["ace/ext/language_tools"],function(t){m&&(m.exports=t)})})()})(Tp);const to={jsonError:{border:"1px solid red",minHeight:200},jsonNoError:{border:"1px solid #00000000",minHeight:200}};function sr(m){return $.createElement(Ep,{style:m.error===!0?to.jsonError:m.error===!1?to.jsonNoError:void 0,mode:m.mode||"json",width:"100%",height:"100%",showPrintMargin:m.editValueMode,showGutter:m.editValueMode,highlightActiveLine:m.editValueMode,defaultValue:m.defaultValue,theme:m.themeType==="dark"?"clouds_midnight":"chrome",value:m.value,readOnly:!m.onChange,onChange:e=>{var t;return(t=m.onChange)==null?void 0:t.call(m,e)},name:m.name||"UNIQUE_ID_OF_DIV1",fontSize:m.fontSize||14,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:m.editValueMode,tabSize:m.editValueMode?2:void 0},editorProps:{$blockScrolling:!0}})}const vs={flex:{display:"flex"},button:{height:48,minWidth:48},wrapper:{width:"calc(100vw - 40px)",height:"calc(100vh - 188px)"}};class Lp extends V{async componentDidMount(){await super.componentDidMount();const{data:e,attr:t}=this.props,n=V.getValue(e,t)||"{}";this.setState({value:n,initialized:!0,jsonError:this.validateJson(n)})}validateJson(e){let t=!1;if(this.props.schema.validateJson!==!1&&(e||!this.props.schema.allowEmpty))try{this.props.schema.json5?Jo.parse(e):JSON.parse(e)}catch(n){console.log("Error in JSON",n),t=!0}return t}renderItem(e,t){if(!this.state.initialized)return null;const{schema:n,data:h,attr:i}=this.props,{value:s,showSelectId:d}=this.state,o=n.readOnly===!0||t;return $.createElement(fe,{fullWidth:!0,variant:"standard"},$.createElement("div",{style:vs.flex},$.createElement(ve,{color:"grey",style:vs.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},P.I18n.t("ra_JSON editor"))),d?$.createElement(qs,{title:this.getText(n.label),overflowHidden:!0,applyDisabled:this.state.jsonError&&this.props.schema.doNotApplyWithError||o,onClose:()=>{o?this.setState({showSelectId:!1}):this.setState({showSelectId:!1,value:V.getValue(h,i)||{}})},onApply:o?void 0:()=>this.setState({showSelectId:!1},()=>this.onChange(i,s))},$.createElement("div",{style:{...vs.wrapper,border:this.state.jsonError?"2px solid red":"2px solid transparent"}},$.createElement(sr,{mode:this.props.schema.json5?"json5":"json",value:typeof s=="object"?JSON.stringify(s):s,onChange:o?void 0:l=>this.setState({value:l,jsonError:this.validateJson(l)}),name:"ConfigJsonEditor",themeType:this.props.oContext.themeType}))):null,n.help||this.state.jsonError?$.createElement(ge,null,this.state.jsonError?P.I18n.t("ra_Invalid JSON"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Mp=[{value:"en",label:"English"},{value:"de",label:"Deutsch"},{value:"ru",label:"русский"},{value:"pt",label:"Portugues"},{value:"nl",label:"Nederlands"},{value:"fr",label:"français"},{value:"it",label:"Italiano"},{value:"es",label:"Espanol"},{value:"pl",label:"Polski"},{value:"uk",label:"Український"},{value:"zh-cn",label:"简体中文"}];class Ip extends V{async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr),t=[...Mp];this.props.schema.system?t.unshift({value:"",label:P.I18n.t("ra_System language")}):t.unshift({value:"",label:P.I18n.t("ra_none")}),this.setState({value:this.props.schema.system?e||"":e||P.I18n.getLanguage(),selectOptions:t})}renderItem(e,t){var h,i;if(!this.state.selectOptions)return null;const n=(h=this.state.selectOptions)==null?void 0:h.find(s=>s.value===this.state.value||!s.value&&!this.state.value);return $.createElement(fe,{fullWidth:!0,variant:"standard"},this.props.schema.label?$.createElement(_e,null,this.getText(this.props.schema.label)):null,$.createElement(Ne,{variant:"standard",error:!!e,disabled:t,value:this.state.value||"_",renderValue:()=>this.getText(n==null?void 0:n.label,this.props.schema.noTranslation),onChange:s=>{let{value:d}=s.target;d==="_"&&(d=""),this.setState({value:d},()=>{const o=this.onChange(this.props.attr,d);if(o instanceof Promise&&o.catch(l=>console.error(l)),this.props.schema.changeGuiLanguage)if(d){if(d===P.I18n.getLanguage())return;P.I18n.setLanguage(d),this.props.oContext.changeLanguage&&this.props.oContext.changeLanguage()}else this.props.oContext.socket.getSystemConfig().then(l=>{l.common.language!==P.I18n.getLanguage()&&l.common.language&&(P.I18n.setLanguage(l.common.language),this.props.oContext.changeLanguage&&this.props.oContext.changeLanguage())}).catch(l=>console.error(`Cannot read system config: ${l}`))})}},(i=this.state.selectOptions)==null?void 0:i.map(s=>$.createElement($e,{key:s.value,value:s.value},s.label))),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Op extends V{scrollRef;constructor(e){super(e),this.scrollRef=$.createRef()}scrolledDown(){return this.scrollRef.current?this.scrollRef.current.offsetHeight+this.scrollRef.current.scrollTop>=this.scrollRef.current.scrollHeight:!1}async componentDidMount(){await super.componentDidMount(),V.getValue(this.props.data,this.props.attr)||(this.props.schema.licenseUrl?(this.setState({showLicenseDialog:!0,loading:!0,scrolledDown:!1}),fetch(this.props.schema.licenseUrl).then(e=>e.text()).then(e=>this.setState({license:e,loading:!1})).catch(e=>this.setState({license:e.toString(),loading:!1,error:!0,scrolledDown:!1}))):this.setState({showLicenseDialog:!0,scrolledDown:!1}),setTimeout(()=>{this.scrollRef.current&&(this.scrolledDown()?this.setState({scrolledDown:!0}):this.scrollRef.current.addEventListener("scroll",()=>{!this.state.scrolledDown&&this.scrolledDown()&&this.setState({scrolledDown:!0})}))},1e3))}renderItem(e,t){return this.state.showLicenseDialog?$.createElement(Lt,{maxWidth:"lg",open:!0,onClose:(n,h)=>{h!=="escapeKeyDown"&&h!=="backdropClick"&&this.setState({showLicenseDialog:!1})}},$.createElement(yn,null,this.props.schema.title?P.I18n.t(this.props.schema.title):P.I18n.t("ra_License agreement")),$.createElement(Kt,null,this.props.schema.licenseUrl?$.createElement($.Fragment,null,this.state.loading?$.createElement(ji,null):null,$.createElement("pre",{ref:this.scrollRef,style:{width:"100%",height:"100%",overflowY:"auto",fontSize:14}},this.state.license)):null,!this.props.schema.licenseUrl&&this.props.schema.texts?$.createElement("div",{ref:this.scrollRef,style:{width:"100%",height:"100%",overflowY:"auto",fontSize:14}},this.props.schema.texts.map((n,h)=>this.props.schema.noTranslation?$.createElement("p",{key:h},n):$.createElement("p",{key:h},P.I18n.t(n)))):null),$.createElement(Gt,null,this.props.schema.checkBox?$.createElement(Xn,{control:$.createElement(Zt,{disabled:t,checked:!!this.state.licenseChecked,onClick:()=>this.setState({licenseChecked:!this.state.licenseChecked})}),label:P.I18n.t(this.props.schema.checkBox)}):null,$.createElement(ve,{disabled:t||this.state.loading||this.state.error||this.props.schema.checkBox&&!this.state.licenseChecked||!this.state.scrolledDown,onClick:()=>{this.setState({showLicenseDialog:!1});const n=this.onChange(this.props.attr,!0);n instanceof Promise&&n.catch(h=>console.error(`Cannot set value: ${h}`))},color:"primary",variant:"contained",startIcon:$.createElement(Gs,null)},this.props.schema.agreeText?P.I18n.t(this.props.schema.agreeText):P.I18n.t("ra_Accept license")),$.createElement(ve,{onClick:()=>{this.setState({showLicenseDialog:!1}),setTimeout(()=>this.setState({showLicenseDialog:!0}),2e3)},color:"grey",variant:"contained",startIcon:$.createElement(ht,null)},P.I18n.t("ra_Close")))):null}}const no={indeterminate:{opacity:.5},control:{flexDirection:"row",width:"100%"}};class Fp extends V{updateTimeout;async componentDidMount(){await super.componentDidMount();let e=V.getValue(this.props.data,this.props.attr);if(e==null&&(e=""),Array.isArray(e)&&this.props.oContext.multiEdit){e=V.DIFFERENT_VALUE,this.setState({_value:e,oldValue:e});return}this.setState({_value:e.toString(),oldValue:e.toString()})}static getDerivedStateFromProps(e,t){if(e.schema.min!==void 0&&e.schema.min<0||e.schema.max!==void 0&&e.schema.max<0)return null;const n=V.getValue(e.data,e.attr);return e.oContext.multiEdit&&t._value===V.DIFFERENT_VALUE?{_value:V.DIFFERENT_VALUE}:n==null||t.oldValue===null||t.oldValue===void 0||n.toString()!==parseFloat(t._value).toString()&&n.toString()!==t.oldValue.toString()?{_value:n}:null}checkValue(e){if(e==null||(e=e.toString().trim().replace(",","."),e==="-"))return null;const t=e===""?0:parseFloat(e);return e!==""&&Number.isNaN(t)?"ra_Not a number":e!==""&&window.isFinite(t)?this.props.schema.min!==void 0&&t<this.props.schema.min?"ra_Too small":this.props.schema.max!==void 0&&t>this.props.schema.max?"ra_Too big":e===""||e==="-"||Number.isNaN(t)?"ra_Not a number":null:"ra_Not a number"}renderItem(e,t){var i;const n=Array.isArray(this.state._value)||this.state._value===V.DIFFERENT_VALUE;if(this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=void 0,this.setState({oldValue:null})},30)):this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=void 0),n){const s=V.getValue(this.props.data,this.props.attr),d=(s==null?void 0:s.filter(o=>o||o===0).map(o=>({label:o.toString(),value:o})))||[];return d.unshift({label:P.I18n.t(V.DIFFERENT_LABEL),value:V.DIFFERENT_VALUE}),$.createElement(Wi,{style:no.indeterminate,fullWidth:!0,freeSolo:!0,value:d[0],getOptionSelected:(o,l)=>o.label===l.label,onChange:(o,l)=>{const r=this.onChange(this.props.attr,l==null?void 0:l.value,()=>{this.setState({_value:l==null?void 0:l.value,oldValue:this.state._value})});r instanceof Promise&&r.catch(a=>console.error(a))},options:d,getOptionLabel:o=>o.label,renderInput:o=>$.createElement(pe,{...o,label:this.getText(this.props.schema.label),variant:"standard",slotProps:{htmlInput:{...o.inputProps,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):void 0}},error:!!e,placeholder:this.getText(this.props.schema.placeholder),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:!!t})})}!e&&this.state._value!==null&&this.state._value!==void 0&&this.state._value&&(e=this.checkValue(this.state._value),e&&(e=P.I18n.t(e)));const h=parseFloat(((i=this.state._value)==null?void 0:i.toString().replace(",","."))||"");return $.createElement(fe,{variant:"standard",style:no.control},$.createElement(pe,{sx:{"& .up-down":{display:"none"},"&:hover .up-down":{display:"block"}},variant:"standard",type:Number.isNaN(h)?"text":this.props.schema.min!==void 0&&this.props.schema.min>=0?"number":"text",fullWidth:!0,slotProps:{htmlInput:{min:this.props.schema.min,max:this.props.schema.max,step:this.props.schema.step,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):null}},value:this.state._value??"",error:!!e,disabled:!!t,onChange:s=>{const d=s.target.value,o=this.checkValue(d);o?this.onError(this.props.attr,P.I18n.t(o)):this.onError(this.props.attr),this.setState({_value:d,oldValue:this.state._value},()=>{const l=parseFloat(d.toString().replace(",","."));Number.isNaN(l)?this.onChange(this.props.attr,d.toString().replace(",",".")):this.onChange(this.props.attr,l)})},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:e&&typeof e=="string"?e:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}))}}class Rp extends V{authWindow;oid;url;constructor(e){super(e),this.state={...this.state,accessTokens:"",success:!1,blocked:!1,running:!1,pressed:!1,clientId:"",clientSecret:"",accessTokenError:""},this.url=`https://oauth2.iobroker.in/${e.schema.identifier}?redirect=true`,e.schema.scope&&(this.url+=`&scope=${encodeURIComponent(e.schema.scope)}`),this.oid=`${this.props.oContext.adapterName}.${this.props.oContext.instance}.${this.props.schema.saveTokenIn||"oauth2Tokens"}`}async componentDidMount(){await super.componentDidMount(),window.addEventListener?window.addEventListener("message",this.onMessage,!1):window.attachEvent("onmessage",this.onMessage,!1),await this.props.oContext.socket.subscribeState(this.oid,this.onTokensUpdated);let e;this.props.schema.ownClientId&&(e={clientId:V.getValue(this.props.data,this.props.schema.ownClientId)}),this.props.schema.ownClientId&&(e||={},e.clientSecret=V.getValue(this.props.data,this.props.schema.ownClientSecret));const t=await this.props.oContext.socket.getState(this.oid);if(t){const n=JSON.parse(t.val);new Date(n.access_token_expires_on).getTime()>Date.now()&&(e||={},e.accessTokens=t.val)}e&&this.setState(e)}onTokensUpdated=(e,t)=>{if(t!=null&&t.val){const n=JSON.parse(t.val);if(new Date(n.access_token_expires_on).getTime()>Date.now()){this.state.accessTokens!==t.val&&this.setState({accessTokens:t.val});return}}this.setState({accessTokens:""})};componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener?window.removeEventListener("message",this.onMessage,!1):window.detachEvent("onmessage",this.onMessage,!1),this.props.oContext.socket.unsubscribeState(this.oid,this.onTokensUpdated)}saveToken(e){try{e&&!e.startsWith("{")&&(e=atob(e));const t=JSON.parse(e);t.access_token&&t.refresh_token&&t.expires_in&&(t.access_token_expires_on||=new Date(Date.now()+t.expires_in*1e3).toISOString(),this.props.schema.ownClientId&&(t.client_id=V.getValue(this.props.data,this.props.schema.ownClientId)),this.props.oContext.socket.setState(this.oid,JSON.stringify(t),!0).catch(n=>console.log(`Error occurred: ${n.toString()}`)))}catch(t){console.warn(t)}}onMessage=e=>{var t,n,h;if(e.origin==="https://oauth2.iobroker.in"&&(typeof e.data=="string"&&e.data.startsWith(`${this.props.schema.identifier}-authentication:`)||typeof e.message=="string"&&e.message.startsWith(`${this.props.schema.identifier}-authentication:`))){const i=(e.data||e.message).split(":");i[1]==="success"?(this.setState({accessTokens:i[2],success:!0,pressed:!1},()=>this.saveToken(this.state.accessTokens)),(t=this.authWindow)==null||t.postMessage("close",e.origin),this.authWindow=null):(h=(n=this.props).onError)==null||h.call(n,i[2])}};onOpenUrl(){this.authWindow=window.open(this.url+(this.props.schema.ownClientId?`&client_id=${encodeURIComponent(this.state.clientId)}&client_secret=${encodeURIComponent(this.state.clientSecret)}`:""),this.props.schema.identifier),!this.authWindow||this.authWindow.closed||typeof this.authWindow.closed>"u"?this.setState({blocked:!0}):this.setState({pressed:!0})}renderItem(e,t){let n="";if(this.state.accessTokens)try{const s=JSON.parse(this.state.accessTokens);n=new Date(s.access_token_expires_on).toLocaleString()}catch{}let h;this.state.accessTokens?h=this.props.schema.refreshLabel?this.getText(this.props.schema.refreshLabel):P.I18n.t("ra_Renew %s access",this.props.schema.identifier[0].toUpperCase()+this.props.schema.identifier.slice(1)):h=this.props.schema.label?this.getText(this.props.schema.label):P.I18n.t("ra_Get %s access",this.props.schema.identifier[0].toUpperCase()+this.props.schema.identifier.slice(1));const i=this.getIcon();return $.createElement("div",{style:{width:"100%",margin:"0 0 1rem 0"}},this.props.schema.ownClientId?$.createElement(pe,{value:this.state.clientId,onChange:s=>{const d=s.target.value;this.setState({clientId:d},()=>this.onChange(this.props.schema.ownClientId,d))},style:{marginBottom:8},variant:"standard",fullWidth:!0,error:!this.state.clientId,disabled:!!t,label:P.I18n.t("ra_OAuth Client ID"),slotProps:{input:{endAdornment:this.state.clientId?$.createElement(se,{size:"small",tabIndex:-1,onClick:()=>this.setState({clientId:""},()=>this.onChange(this.props.schema.ownClientId,""))},$.createElement(ht,null)):null}}}):null,this.props.schema.ownClientSecret?$.createElement(pe,{value:this.state.clientSecret,onChange:s=>{const d=s.target.value;this.setState({clientSecret:d},()=>this.onChange(this.props.schema.ownClientSecret,d))},style:{marginBottom:8},variant:"standard",fullWidth:!0,error:!this.state.clientSecret,disabled:!!t,label:P.I18n.t("ra_OAuth Client secret"),slotProps:{input:{endAdornment:this.state.clientSecret?$.createElement(se,{size:"small",tabIndex:-1,onClick:()=>this.setState({clientSecret:""},()=>this.onChange(this.props.schema.ownClientSecret,""))},$.createElement(ht,null)):null}}}):null,$.createElement(ve,{disabled:this.state.running||this.props.schema.ownClientSecret&&!this.state.clientSecret||this.props.schema.ownClientId&&!this.state.clientId,endIcon:i||$.createElement(Tc,null),variant:"contained",onClick:()=>this.onOpenUrl()},h),this.state.blocked?$.createElement("div",{style:{color:"red",fontSize:16,marginTop:20}},P.I18n.t("ra_Please allow popups in your browser for this page!")):null,this.state.accessTokens?$.createElement("div",{style:{color:"green",fontSize:16,marginTop:20}},this.props.alive?P.I18n.t("ra_Successfully authorized. Token valid till %s and will be automatically renewed.",n):P.I18n.t("ra_Successfully authorized. Token valid till %s but it can expire as the instance is not running.",n)):null,this.state.pressed?$.createElement($.Fragment,null,$.createElement("div",{style:{width:"100%",margin:"1rem 0 1rem 0"}},$.createElement("span",{style:{marginRight:4}},`${P.I18n.t("ra_If the button above does not work, you can authorize manually this app by visiting this url")}`,":"),$.createElement("br",null),$.createElement("a",{target:this.props.schema.identifier,href:this.url,rel:"noreferrer"},this.url)),$.createElement(pe,{value:this.state.accessTokens,label:P.I18n.t("ra_Enter the code from that page here"),variant:"standard",error:!!this.state.accessTokenError,helperText:this.state.accessTokenError||"",onChange:s=>{let d=s.target.value;try{d!=null&&d.trim()&&!d.trim().startsWith("{")&&(d=atob(d.trim()))}catch{this.setState({accessTokenError:"Invalid access token. Cannot decode from base64"})}if(d!=null&&d.startsWith("{"))try{const o=JSON.parse(d);o.access_token&&(o.access_token_expires_on=new Date(Date.now()+(o.expires_in-10)*1e3).toISOString(),this.setState({accessTokens:JSON.stringify(o),accessTokenError:""},()=>this.saveToken(this.state.accessTokens)))}catch{this.setState({accessTokens:d,accessTokenError:"Invalid access token. Cannot parse JSON"})}else d&&this.setState({accessTokens:d,accessTokenError:"Invalid access token. Not JSON"})},fullWidth:!0})):null)}}const io={flex:{display:"flex"},button:{maxHeight:48,marginLeft:4,minWidth:48}};class Np extends V{fillOnSelect=[];async componentDidMount(){await super.componentDidMount();const{data:e,attr:t}=this.props,n=V.getValue(e,t)||"";if(this.props.schema.fillOnSelect){const h=this.props.schema.fillOnSelect.split(",").map(i=>i.trim());for(const i of h){const s=i.split("=>");if(s.length===2){const d={pathInObject:s[0],attr:s[1]};(d.attr.includes("(X)")||d.attr.includes("(x)"))&&(d.overwrite=!0,d.attr=d.attr.replace(/\(X\)|\(x\)/g,"")),this.fillOnSelect.push(d)}else console.error(`Invalid format for fillOnSelect: ${this.props.schema.fillOnSelect}`)}}this.setState({value:n,initialized:!0})}onObjectChanged=async(e,t)=>{if(await this.onChange(e,t),this.fillOnSelect.length)try{const n=await this.getCachedObject(t);for(const h of this.fillOnSelect)if(h.overwrite||!V.getValue(this.props.data,h.attr)){let i=V.getValue(n,h.pathInObject);typeof i=="object"&&(i=this.getText(i,!0)),await this.onChange(h.attr,i)}}catch(n){console.error(n.toString())}};renderItem(e,t){if(!this.state.initialized)return null;const n=this.props.oContext.socket,{schema:h,attr:i}=this.props,{value:s,showSelectId:d}=this.state;return $.createElement(fe,{fullWidth:!0,variant:"standard"},h.label?$.createElement(_e,{shrink:!0},this.getText(h.label)):null,$.createElement("div",{style:io.flex},$.createElement(pe,{variant:"standard",fullWidth:!0,value:s,error:!!e,disabled:t,placeholder:this.getText(h.placeholder),label:this.getText(h.label),helperText:this.renderHelp(h.help,h.helpLink,h.noTranslation),onChange:o=>{const l=Array.isArray(o.target.value)?o.target.value[0]:o.target.value;this.setState({value:l},()=>{this.onObjectChanged(i,l)})}}),$.createElement(ve,{color:"grey",disabled:t,style:io.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},"...")),d?$.createElement(P.DialogSelectID,{imagePrefix:this.props.oContext.imagePrefix??"../..",dialogName:`admin.${this.props.oContext.adapterName}`,filterFunc:h.filterFunc,themeType:this.props.oContext.themeType,theme:this.props.oContext.theme,types:h.types?Array.isArray(h.types)?h.types:[h.types]:void 0,customFilter:h.customFilter,filters:h.filters,socket:n,selected:s,root:h.root,onClose:()=>this.setState({showSelectId:!1}),onOk:o=>{const l=Array.isArray(o)?o[0]:o;this.setState({showSelectId:!1,value:l},()=>{this.onObjectChanged(i,l)})}}):null)}}const ys={fullWidth:{width:"100%",display:"inline-block"},halfWidth1:{width:"calc(50% - 5px)",display:"inline-block",marginRight:8},halfWidth2:{width:"calc(50% - 5px)",display:"inline-block"}},mi="____ppp____";class Bp extends V{async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr);this.setState({_repeat:e?mi:"",_visible:!1,value:e?mi:"",_notEqual:!1})}onChangePassword(e,t){e===void 0&&(e=this.state.value),t===void 0&&(t=this.state._repeat);const n=!!this.props.schema.repeat&&t!==e;this.setState({value:e,_repeat:t,_notEqual:n},()=>{if(n)this.onError(this.props.attr,P.I18n.t("ra_Passwords are not equal!"));else{this.onError(this.props.attr);const h=this.onChange(this.props.attr,e);h instanceof Promise&&h.catch(i=>this.onError(this.props.attr,i))}})}renderItem(e,t){if(this.state._notEqual===void 0)return null;const n=$.createElement(pe,{variant:"standard",fullWidth:!0,type:this.state._visible&&this.state.value!==mi?"text":"password",value:this.state.value,error:!!e||this.state._notEqual,disabled:!!t,onChange:h=>this.onChangePassword(h.target.value),label:this.getText(this.props.schema.label),slotProps:{input:{autoComplete:"new-password",endAdornment:this.state.value&&this.state.value!==mi&&this.props.schema.visible&&!t&&!this.props.schema.readOnly?$.createElement(vn,{position:"end"},$.createElement(se,{size:"large",tabIndex:-1,onClick:h=>{h.preventDefault(),h.stopPropagation(),this.setState({_visible:!this.state._visible})},edge:"end"},this.state._visible?$.createElement(Lc,null):$.createElement(zo,null))):void 0},htmlInput:{autoComplete:"new-password",form:{autoComplete:"off"},maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1}},helperText:this.state._notEqual?P.I18n.t("ra_Passwords are not equal!"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)});if(this.props.schema.repeat&&!this.props.schema.readOnly){const h=this.state._visible?null:$.createElement(pe,{variant:"standard",fullWidth:!0,type:"password",value:this.state._repeat,error:!!e||this.state._notEqual,disabled:!!t,onChange:i=>this.onChangePassword(void 0,i.target.value),label:`${this.getText(this.props.schema.label)} (${P.I18n.t("ra_repeat")})`,slotProps:{input:{autoComplete:"new-password"},htmlInput:{autoComplete:"new-password",form:{autoComplete:"off"},maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},helperText:this.state._notEqual?P.I18n.t("ra_Passwords are not equal!"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)});return $.createElement("div",{style:ys.fullWidth},$.createElement("div",{style:ys.halfWidth1},n),$.createElement("div",{style:ys.halfWidth2},h))}return n}}class Pp extends V{checkTimeout=null;async componentDidMount(){await super.componentDidMount();const e=await this.getPatternAsync(this.props.schema.pattern,null,!0)??"";this.setState({pattern:e})}componentWillUnmount(){this.checkTimeout&&(clearTimeout(this.checkTimeout),this.checkTimeout=null),super.componentWillUnmount()}checkIfInstanceChanged(){this.checkTimeout&&clearTimeout(this.checkTimeout),this.checkTimeout=setTimeout(async()=>{this.checkTimeout=null;const e=await this.getPatternAsync(this.props.schema.pattern,null,!0)??"";e!==this.state.pattern&&this.setState({pattern:e})},200)}renderItem(e,t){return this.checkIfInstanceChanged(),$.createElement(pe,{variant:"standard",fullWidth:!0,disabled:!!t,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?$.createElement(se,{tabIndex:-1,size:"small",onClick:async()=>{P.Utils.copyToClipboard(await this.getPatternAsync(this.props.schema.pattern,null,this.props.schema.noTranslation)),window.alert(P.I18n.t("ra_Copied"))}},$.createElement(P.IconCopy,null)):void 0}},value:this.state.pattern||"",label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const Wp={warning:{"& .Mui-error":{color:"orange"}}};class jp extends V{updateTimeout;async componentDidMount(){await super.componentDidMount();let e=V.getValue(this.props.data,this.props.attr);e==null&&(e=""),this.setState({_value:e.toString(),oldValue:e.toString()});const t=await this.props.oContext.socket.getAdapterInstances(),n=`system.adapter.${this.props.oContext.adapterName}.${this.props.oContext.instance}`,h=await this.getCachedObject(n),i=h==null?void 0:h.common.host,s=[];t.forEach(d=>{var l,r,a,c;if(!d||d._id===n||d.common.host!==i||!((l=d.native)!=null&&l.bind))return;if(d!=null&&d.native&&d.native.secure&&d.native.leEnabled&&d.native.leUpdate){const p=parseInt(d.native.leCheckPort||d.native.lePort,10);p&&s.push({name:`${d._id.replace("system.adapter.","")} (LE)`,port:p,v6bind:d.native.bind.includes(":")?d.native.bind:d.native.v6bind,bind:d.native.bind,enabled:!!((r=d.common)!=null&&r.enabled)})}const o=parseInt((a=d==null?void 0:d.native)==null?void 0:a.port,10);o&&s.push({name:d._id.replace("system.adapter.",""),bind:d.native.bind,v6bind:d.native.bind.includes(":")?d.native.bind:d.native.v6bind,port:o,enabled:!!((c=d.common)!=null&&c.enabled)})}),this.setState({ports:s})}static getDerivedStateFromProps(e,t){const n=V.getValue(e.data,e.attr);return n==null||t.oldValue===null||t.oldValue===void 0||n.toString()!==parseInt(t._value,10).toString()&&n.toString()!==t.oldValue.toString()?{_value:n}:null}checkValue(e){if(e==null)return null;const t=this.props.schema.min??20,n=this.props.schema.max||65535;e=e.toString().trim();const h=e===""?0:parseInt(e,10);return e!==""&&Number.isNaN(h)?"ra_Not a number":e!==""&&window.isFinite(Number(e))?h<t?"ra_Too small":h>n?"ra_Too big":e===""||e==="-"||Number.isNaN(h)?"ra_Not a number":null:"ra_Not a number"}renderItem(e,t){this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=void 0,this.setState({oldValue:null})},30)):this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=void 0);const n=this.props.schema.min??20,h=this.props.schema.max||65535;let i;if(this.state.ports){const s=parseInt(this.state._value,10);if(s){const d=this.props.data.bind,o=this.state.ports.filter(r=>{if(r.port!==s)return!1;const a=r.bind,c=r.v6bind;return!d||!a||d==="0.0.0.0"||a==="0.0.0.0"||d==="::"||c==="::"||d===a||d===c});let l=o.findIndex(r=>r.port===s&&r.enabled);if(l!==-1){const r=this.state.ports.find(a=>a.port===s&&a.enabled&&o.some(c=>c.name===a.name&&c.bind===a.bind));e=P.I18n.t("ra_Port is already used by %s",(r==null?void 0:r.name)||o[l].name)}else if(l=o.findIndex(r=>r.port===s&&!r.enabled),l!==-1){i=!0;const r=this.state.ports.find(a=>a.port===s&&!a.enabled&&o.some(c=>c.name===a.name&&c.bind===a.bind));e=P.I18n.t("ra_Port could be used by %s",(r==null?void 0:r.name)||o[l].name)}}}return!e&&this.state._value!==null&&this.state._value!==void 0&&(e=this.checkValue(this.state._value),typeof e=="string"&&(e=P.I18n.t(e))),$.createElement(pe,{variant:"standard",type:"number",fullWidth:!0,slotProps:{htmlInput:{min:n,max:h,readOnly:this.props.schema.readOnly||!1}},value:this.state._value??"",error:!!e,disabled:!!t,sx:i?Wp.warning:void 0,onChange:s=>{const d=Number(s.target.value.toString().replace(/[^0-9]/g,"")).toString(),o=this.checkValue(d);o?this.onError(this.props.attr,P.I18n.t(o)):this.onError(this.props.attr),this.setState({_value:d,oldValue:this.state._value},()=>{if(d.trim()===parseInt(d,10).toString()){const l=this.onChange(this.props.attr,parseInt(d,10)||0);l instanceof Promise&&l.catch(r=>{console.error(`Cannot set value for ${this.props.attr}: ${r}`)})}})},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:e&&typeof e=="string"?e:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}class Hp extends V{async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums("rooms").then(t=>{const n=Object.keys(t).map(h=>({value:this.props.schema.short?h.replace("enum.rooms.",""):h,label:this.getText(t[h].common.name),obj:t[h]}));this.props.schema.allowDeactivate!==!1&&n.unshift({label:P.I18n.t(V.NONE_LABEL),value:V.NONE_VALUE}),this.setState({value:e,selectOptions:n})}).catch(t=>console.error(`Cannot get enums: ${t}`))}renderItem(e,t){if(!this.state.selectOptions)return null;const n=this.state.selectOptions.find(h=>h.value===this.state.value);return $.createElement(fe,{variant:"standard",fullWidth:!0},this.props.schema.label?$.createElement(_e,null,this.getText(this.props.schema.label)):null,$.createElement(Ne,{variant:"standard",error:!!e,disabled:!!t,value:this.state.value||"_",renderValue:()=>n?n.obj?$.createElement(P.TextWithIcon,{value:n.obj,themeType:this.props.oContext.themeType,lang:P.I18n.getLanguage()}):n.label:"",onChange:h=>{this.setState({value:h.target.value==="_"?"":h.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(h=>$.createElement($e,{key:h.value,value:h.value,style:h.value===V.DIFFERENT_VALUE?{opacity:.5}:{}},h.obj?$.createElement(P.TextWithIcon,{value:h.obj,themeType:this.props.oContext.themeType,lang:P.I18n.getLanguage()}):h.label))),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const on={noMargin:{"&>div":{marginTop:0}},icon:{width:20,height:20,marginRight:4}};class zp extends V{initialValue="";async componentDidMount(){await super.componentDidMount();let e=V.getValue(this.props.data,this.props.attr);this.props.schema.multiple&&(typeof e=="string"?e=[e]:e==null&&(e=[]));const t=[];for(const n of this.props.schema.options||[]){const h=n;if(Array.isArray(h.items)){const i={label:this.getText(n.label,this.props.schema.noTranslation),value:n.value,group:!0,color:n.color,description:this.getText(n.description)};i.hiddenValue=await this.isHidden(i),t.push(i);for(const s of h.items){const d={label:this.getText(s.label,this.props.schema.noTranslation),value:s.value,hidden:s.hidden,color:s.color,description:this.getText(s.description),icon:s.icon};d.hiddenValue=await this.isHidden(d),t.push(d)}}else{const i={label:this.getText(n.label,this.props.schema.noTranslation),value:n.value,hidden:n.hidden,color:n.color,description:this.getText(n.description),icon:n.icon};i.hiddenValue=await this.isHidden(i),t.push(i)}}if(this.props.onFilterLabelUpdate&&this.props.table){const n={};for(const h of t)!h.group&&h.value!==V.DIFFERENT_VALUE&&(n[h.value.toString()]=h.label);this.props.onFilterLabelUpdate(this.props.attr,n)}Array.isArray(e)&&!this.props.schema.multiple?(this.initialValue=[...e],t.unshift({label:P.I18n.t(V.DIFFERENT_LABEL),value:V.DIFFERENT_VALUE}),this.setState({value:V.DIFFERENT_VALUE,selectOptions:t})):this.setState({value:e,selectOptions:t})}_getValue(){let e=this.state.value===null||this.state.value===void 0?V.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof e=="string"?e=[e]:e==null&&(e=[])),e}async isHidden(e){return e.hidden?this.props.custom?!!await this.executeCustom(e.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!!await this.execute(e.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!1}renderRadio(e,t){const n=this.state.selectOptions.filter(i=>!i.hiddenValue&&!i.group),h=this._getValue();return $.createElement(fe,{fullWidth:!0,error:!!e,disabled:!!t,id:`jsonSelect_${this.props.attr}_${this.props.index||this.props.index===0?this.props.index:""}`},this.props.schema.label?$.createElement(oc,null,this.getText(this.props.schema.label)):null,$.createElement(ac,{row:!!this.props.schema.horizontal,value:h==null?"":h.toString(),onChange:i=>{const s=n.find(o=>o.value.toString()===i.target.value),d=s?s.value:i.target.value;this.setState({value:d},()=>{const o=this.onChange(this.props.attr,d);o instanceof Promise&&o.catch(l=>console.error(l))})}},n.map((i,s)=>$.createElement(Xn,{key:s,value:i.value.toString(),control:$.createElement(lc,null),title:i.description||"",label:$.createElement("span",{style:{display:"flex",alignItems:"center"}},i.icon?$.createElement(P.Icon,{src:i.icon,style:on.icon}):null,$.createElement(yt,{component:"span",style:{color:i.color}},i.label)),style:i.value===V.DIFFERENT_VALUE?{opacity:.5}:{}}))),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}renderItem(e,t){if(!this.state.selectOptions)return null;if(this.props.schema.format==="radio")return this.renderRadio(e,t);const n=this.state.selectOptions.filter(s=>!s.hiddenValue),h=this._getValue(),i=this.props.schema.multiple?null:n.find(s=>s.value==h);return $.createElement(fe,{variant:"standard",fullWidth:!0,sx:this.props.table!==void 0?on.noMargin:void 0,id:`jsonSelect_${this.props.attr}_${this.props.index||this.props.index===0?this.props.index:""}`},this.props.schema.label?$.createElement(_e,null,this.getText(this.props.schema.label)):null,$.createElement(Ne,{variant:"standard",error:!!e,multiple:this.props.schema.multiple,disabled:!!t,value:h||"_",renderValue:s=>this.props.schema.multiple?$.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:.5}},s.map(d=>{const o=n.find(l=>l.value===d);if(o||this.props.schema.showAllValues!==!1){const l=(o==null?void 0:o.label)||d;return $.createElement(Vs,{key:d,label:l})}return null})):i!=null&&i.color?$.createElement("span",{style:{display:"flex",alignItems:"center"}},i.icon?$.createElement(P.Icon,{src:i.icon,style:on.icon}):null,$.createElement("span",null,$.createElement("div",{style:{color:i.color}},i.label??s),i.description?$.createElement("div",{style:{opacity:.7,fontStyle:"italic",fontSize:"smaller"}},i.description):null)):(i==null?void 0:i.label)===void 0?i!=null&&i.icon?$.createElement("span",{style:{display:"flex",alignItems:"center"}},$.createElement(P.Icon,{src:i.icon,style:on.icon}),s):s:$.createElement("span",{style:{display:"flex",alignItems:"center"}},i.icon?$.createElement(P.Icon,{src:i.icon,style:on.icon}):null,$.createElement("span",null,$.createElement("div",null,i.label),i.description?$.createElement("div",{style:{opacity:.7,fontStyle:"italic",fontSize:"smaller"}},i.description):null)),onChange:s=>{this.setState({value:s.target.value==="_"?"":s.target.value},()=>{let d;this.state.value===V.DIFFERENT_VALUE?d=this.onChange(this.props.attr,this.initialValue):d=this.onChange(this.props.attr,this.state.value),d instanceof Promise&&d.catch(o=>console.error(o))})}},n.map((s,d)=>s.group?$.createElement(Lo,{key:d,style:{color:s.color}},$.createElement("div",null,s.label),s.description?$.createElement("div",{style:{opacity:.7,fontStyle:"italic",fontSize:"smaller"}},s.description):null):$.createElement($e,{key:d,value:s.value,style:s.value===V.DIFFERENT_VALUE?{opacity:.5}:{}},this.props.schema.multiple?$.createElement(Zt,{checked:h.includes(s.value),onClick:()=>{const o=JSON.parse(JSON.stringify(this._getValue())),l=h.indexOf(s.value);l!==-1?o.splice(l,1):(o.push(s.value),o.sort()),this.setState({value:o},()=>this.onChange(this.props.attr,o))}}):null,s.icon?$.createElement(P.Icon,{src:s.icon,style:on.icon}):null,$.createElement(Us,{primary:s.label,secondary:s.description,slotProps:{secondary:{style:{fontSize:"smaller",fontStyle:"italic",opacity:.7}}},style:{color:s.color}})))),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Vp={menuPaper:{maxHeight:800}};class Up extends V{initialized=!1;localContext;async askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const t=await this.getPatternAsync(this.props.schema.jsonData,null,!0);try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${t}`)}}e===void 0&&(e=null),this.setState({running:!0},async()=>{const t=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(t!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){const n=await this.props.oContext.socket.getState(`system.adapter.${t}.alive`);if(!(n!=null&&n.val)){window.alert(P.I18n.t("ra_Instance %s is not alive",t));return}}try{const n=await this.props.oContext.socket.sendTo(t,this.props.schema.command||"send",e);this.reportFilterLabels(n);for(const h of n)h.hiddenValue=await this.isHidden(h);this.setState({list:n,running:!1})}catch(n){console.error(`Cannot send command: ${n}`)}})}else{const e=V.getValue(this.props.data,this.props.attr);this.setState({value:e,running:!1})}}reportFilterLabels(e){if(this.props.onFilterLabelUpdate&&this.props.table&&Array.isArray(e)){const t={};for(const n of e)n.value!==V.DIFFERENT_VALUE&&(t[n.value]=n.label);this.props.onFilterLabelUpdate(this.props.attr,t)}}getContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=V.getValue(this.props.data,t)),JSON.stringify(e)}_getValue(){let e=this.state.value===null||this.state.value===void 0?V.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof e=="string"?e=[e]:e==null&&(e=[])),e}async isHidden(e){return e.hidden?this.props.custom?!!await this.executeCustom(e.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!!await this.execute(e.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!1}renderItem(e,t){if(this.props.alive){const s=this.getContext();(s!==this.localContext||!this.initialized)&&(this.localContext=s,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}const n=this._getValue();if(!this.props.alive||!this.state.running&&!Array.isArray(this.state.list))return this.props.schema.multiple||this.props.schema.manual===!1?P.I18n.t("ra_Cannot retrieve options, as instance is offline"):$.createElement(pe,{variant:"standard",fullWidth:!0,value:n,error:!!e,disabled:!!t,onChange:s=>{const d=s.target.value;this.setState({value:d},()=>this.onChange(this.props.attr,(d||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),slotProps:{input:{endAdornment:this.state.value&&!this.props.schema.noClearButton?$.createElement(vn,{position:"end"},$.createElement(se,{tabIndex:-1,size:"small",onClick:()=>this.setState({value:""},()=>this.onChange(this.props.attr,""))},$.createElement(ht,null))):null}}});if(this.state.running)return $.createElement(Tt,{size:"24"});const h=this.state.list.filter(s=>!s.hiddenValue),i=h.find(s=>s.value===n);return $.createElement(fe,{variant:"standard",fullWidth:!0},this.props.schema.label?$.createElement(_e,null,this.getText(this.props.schema.label)):null,$.createElement(Ne,{variant:"standard",error:!!e,multiple:this.props.schema.multiple,disabled:!!t,sx:{"&.MuiSelect-paper":this.props.schema.multiple?Vp.menuPaper:void 0},value:n,renderValue:s=>this.props.schema.multiple?$.createElement(Ie,{sx:{display:"flex",flexWrap:"wrap",gap:.5}},s.map(d=>{const o=h.find(l=>l.value===d);if(o||this.props.schema.showAllValues!==!1){const l=(o==null?void 0:o.label)||d;return $.createElement(Vs,{key:d,label:l})}return null})):this.getText((i==null?void 0:i.label)||s,this.props.schema.noTranslation),onChange:s=>{const d=this.onChange(this.props.attr,s.target.value);d instanceof Promise&&d.catch(o=>console.error(`Cannot set value: ${o}`))}},h.map((s,d)=>s.group?$.createElement(Lo,{key:d},$.createElement("div",null,this.getText(s.label,this.props.schema.noTranslation)),s.description?$.createElement("div",{style:{opacity:.7,fontStyle:"italic",fontSize:"smaller"}},this.getText(s.description)):null):$.createElement($e,{key:d,value:s.value},this.props.schema.multiple?$.createElement(Zt,{checked:n.includes(s.value.toString()),onClick:()=>{const o=JSON.parse(JSON.stringify(this._getValue())),l=n.indexOf(s.value.toString());l!==-1?o.splice(l,1):(o.push(s.value),o.sort()),this.setState({value:o},()=>this.onChange(this.props.attr,o))}}):null,$.createElement(Us,{primary:this.getText(s.label),secondary:this.getText(s.description),slotProps:{secondary:{style:{fontSize:"smaller",fontStyle:"italic",opacity:.7}}}})))),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const so={fullWidth:{width:"100%"}};function At(m){return m.split(".").reduce((e,t)=>(e<<8)+parseInt(t,10),0)>>>0}function Kp(m,e){var h,i;const t=(i=(h=m==null?void 0:m.native)==null?void 0:h.hardware)==null?void 0:i.networkInterfaces;if(!t)return null;let n;return Object.keys(t).forEach(s=>t[s].forEach(d=>{d.internal||e.includes(":")&&d.family!=="IPv6"||e.includes(".")&&!e.match(/[^.\d]/)&&d.family!=="IPv4"||(d.family==="IPv4"&&!d.address.startsWith("172")&&(e==="127.0.0.0"||e==="localhost"||e.match(/[^.\d]/))?n=d.address:n||(d.family==="IPv4"&&e.includes(".")&&(At(e)&At(d.netmask),At(d.address)&At(d.netmask)),n=d.address))})),n||Object.keys(t).forEach(s=>t[s].forEach(d=>{d.internal||e.includes(":")&&d.family!=="IPv6"||e.includes(".")&&!e.match(/[^.\d]/)&&d.family!=="IPv4"||(d.family==="IPv6"&&(e==="127.0.0.0"||e==="localhost"||e.match(/[^.\d]/))?n=d.address:n||(d.family==="IPv4"&&e.includes(".")&&(At(e)&At(d.netmask),At(d.address)&At(d.netmask)),n=d.address))})),n||Object.keys(t).forEach(s=>{t[s].forEach(d=>{d.internal||e.includes(":")&&d.family!=="IPv6"||e.includes(".")&&!e.match(/[^.\d]/)&&d.family!=="IPv4"||(e==="127.0.0.0"||e==="localhost"||e.match(/[^.\d]/),n=d.address)})}),n||Object.keys(t).forEach(s=>{t[s].forEach(d=>{d.internal||(n=d.address)})}),n}class ro extends V{async componentDidMount(){var t;await super.componentDidMount();let e=window.location.hostname;if(this.props.schema.openUrl){const n=await this.props.oContext.socket.getCurrentInstance(),h=await this.getCachedObject(`system.adapter.${n}`);if(h){const i=await this.getCachedObject(`system.host.${(t=h==null?void 0:h.common)==null?void 0:t.host}`);if(i){const s=Kp(i,window.location.hostname);if(s)e=`${s}:${window.location.port}`;else{console.warn(`Cannot find suitable IP in host ${h.common.host} for ${h._id}`);return}}}}await new Promise(n=>{this.setState({_error:"",_message:"",hostname:e},n)}),this.props.schema.onLoaded&&this._onClick().catch(n=>console.error(n))}renderErrorDialog(){return this.state._error?$.createElement(P.DialogError,{text:this.state._error,onClose:()=>this.setState({_error:""})}):null}renderMessageDialog(){return this.state._message?$.createElement(P.DialogMessage,{text:this.state._message,onClose:()=>this.setState({_message:""})}):null}renderCopyDialog(){return this.state._copyDialog?$.createElement(qs,{title:this.getText(this.state._copyDialog.title||P.I18n.t("ra_Result")),overflowHidden:!0,onClose:()=>{this.setState({_copyDialog:null})},onApply:()=>{P.copy(this.state._copyDialog.text),window.alert(P.I18n.t("ra_Copied")),this.setState({_copyDialog:null})},titleButtonApply:P.I18n.t("ra_Copy content")},$.createElement("div",{style:{width:"calc(100vw - 40px)",height:"calc(100vh - 188px)"}},$.createElement(sr,{mode:this.state._copyDialog.type,value:this.state._copyDialog.text,name:"CopyDialog",themeType:this.props.oContext.themeType}))):null}async _onClick(){this.props.oContext.onCommandRunning(!0),this.setState({running:!0});const e=`${window.location.protocol}//${window.location.host}${window.location.pathname.replace(/\/index\.html$/,"")}`,t=`${window.location.protocol}//${this.state.hostname.split(":").length>3?`[${this.state.hostname}]`:this.state.hostname}${window.location.pathname.replace(/\/index\.html$/,"")}`;let n=this.props.schema.data;if(n===void 0&&this.props.schema.jsonData){const s=await this.getPatternAsync(this.props.schema.jsonData,{_origin:e,_originIp:t,...this.props.data},!0);try{n=JSON.parse(s)}catch{console.error(`Cannot parse json data: ${s}`)}}n===void 0&&(n=null),this.props.schema.openUrl&&!n&&(n={_origin:e,_originIp:t});let h;this.props.schema.timeout&&(h=setTimeout(()=>{this.props.oContext.onCommandRunning(!1),this.setState({_error:P.I18n.t("ra_Request timed out"),running:!1})},parseInt(this.props.schema.timeout,10)||1e4));const i=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(i!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){const s=await this.props.oContext.socket.getState(`system.adapter.${i}.alive`);if(!(s!=null&&s.val)){window.alert(P.I18n.t("ra_Instance %s is not alive",i));return}}this.props.oContext.socket.sendTo(i,this.props.schema.command||"send",n).then(async s=>{var d,o,l,r,a,c;if(h&&(clearTimeout(h),h=void 0),s!=null&&s.error)if((d=this.props.schema.error)!=null&&d[s.error]){let p=this.getText(this.props.schema.error[s.error]);(o=s.args)==null||o.forEach(u=>p=p.replace("%s",u)),this.setState({_error:p})}else this.setState({_error:s.error?typeof s.error=="string"?P.I18n.t(s.error):JSON.stringify(s.error):P.I18n.t("ra_Error")});else{if(s!=null&&s.command){(r=(l=this.props.oContext).onBackEndCommand)==null||r.call(l,s.command);return}if(s!=null&&s.reloadBrowser&&this.props.schema.reloadBrowser)window.location.reload();else if(s!=null&&s.openUrl&&this.props.schema.openUrl)window.open(s.openUrl,s.window||this.props.schema.window||"_blank");else if(s!=null&&s.result&&((a=this.props.schema.result)!=null&&a[s.result])){let p=this.getText(this.props.schema.result[s.result]);(c=s.args)==null||c.forEach(u=>p=p.replace("%s",u)),window.alert(p)}if(s!=null&&s.native&&this.props.schema.useNative){for(const[p,u]of Object.entries(s.native))await this.onChangeAsync(p,u);setTimeout(()=>this.props.oContext.forceUpdate(Object.keys(s.native),this.props.data),300)}else s!=null&&s.result?window.alert(typeof s.result=="object"?JSON.stringify(s.result):s.result):s!=null&&s.copyDialog?this.setState({_copyDialog:s.copyDialog}):window.alert(P.I18n.t("ra_Ok"));s!=null&&s.saveConfig&&this.props.onChange(null,null,null,!0)}}).catch(s=>{this.props.schema.error&&this.props.schema.error[s.toString()]?this.setState({_error:this.getText(this.props.schema.error[s.toString()])}):this.setState({_error:P.I18n.t(s.toString())||P.I18n.t("ra_Error")})}).then(()=>{this.props.oContext.onCommandRunning(!1),this.setState({running:!1})})}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const e=this.state.confirmData||this.props.schema.confirm;let t=null;return e.type==="warning"?t=$.createElement(zn,null):e.type==="error"?t=$.createElement(Jt,null):e.type==="info"&&(t=$.createElement(Mi,null)),$.createElement(P.DialogConfirm,{title:this.getText(e.title)||P.I18n.t("ra_Please confirm"),text:this.getText(e.text),ok:this.getText(e.ok)||P.I18n.t("ra_Ok"),cancel:this.getText(e.cancel)||P.I18n.t("ra_Cancel"),icon:t||void 0,onClose:n=>this.setState({confirmDialog:!1},()=>n&&this._onClick())})}renderItem(e,t){const n=this.getIcon();return $.createElement("div",{style:so.fullWidth},$.createElement(ve,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:{...so.fullWidth,...this.props.schema.controlStyle||void 0},disabled:t||!this.props.alive,startIcon:n,title:this.props.alive?this.getText(this.props.schema.title)||"":P.I18n.t("ra_Instance %s is not alive",this.props.oContext.instance.toString()),onClick:()=>{this.props.schema.confirm?this.setState({confirmDialog:!0}):this._onClick().catch(h=>console.error(h))}},this.props.schema.showProcess&&this.state.running?$.createElement(Tt,{size:20,style:{marginRight:8}}):null,this.getText(this.props.schema.label,this.props.schema.noTranslation)),this.renderErrorDialog(),this.renderMessageDialog(),this.renderCopyDialog())}}const Gp={fullWidth:{width:"100%"}};class Jp extends V{async _onClick(){var n,h;let e=this.props.schema.val;if(typeof e=="string"&&e.includes("${")){e=await this.getPatternAsync(e,null,!0);const i=await this.getCachedObject(this.props.schema.id);((n=i==null?void 0:i.common)==null?void 0:n.type)==="number"?e=parseFloat(e):((h=i==null?void 0:i.common)==null?void 0:h.type)==="boolean"&&(e=e==="true"||e===!0||e==="1"||e===1)}const t=(this.props.schema.id||"").replace(/%INSTANCE%/g,(this.props.oContext.instance||0).toString());try{await this.props.oContext.socket.setState(t,{val:e,ack:!!this.props.schema.ack}),this.props.schema.okText&&window.alert(this.getText(this.props.schema.okText))}catch(i){this.props.schema.error&&this.props.schema.error[i.toString()]?window.alert(this.getText(this.props.schema.error[i.toString()])):window.alert(P.I18n.t(i.toString())||P.I18n.t("ra_Error"))}}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const e=this.state.confirmData||this.props.schema.confirm;let t=null;return e.type==="warning"?t=$.createElement(zn,null):e.type==="error"?t=$.createElement(Jt,null):e.type==="info"&&(t=$.createElement(Mi,null)),$.createElement(P.DialogConfirm,{title:this.getText(e.title)||P.I18n.t("ra_Please confirm"),text:this.getText(e.text),ok:this.getText(e.ok)||P.I18n.t("ra_Ok"),cancel:this.getText(e.cancel)||P.I18n.t("ra_Cancel"),icon:t,onClose:n=>this.setState({confirmDialog:!1},()=>n&&this._onClick())})}renderItem(e,t){const n=this.getIcon();return $.createElement(ve,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:Gp.fullWidth,disabled:t,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0}):await this._onClick()},startIcon:n||void 0},this.getText(this.props.schema.label,this.props.schema.noTranslation))}}const oo={fullWidth:{width:"100%"},slider:{marginLeft:10,marginRight:10,width:"calc(100% - 20px)"}};class Yp extends V{async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr);this.setState({_value:e})}static getDerivedStateFromProps(e,t){if(e.schema.min!==void 0&&e.schema.min<0||e.schema.max!==void 0&&e.schema.max<0)return null;const n=V.getValue(e.data,e.attr);return n==null||n.toString()!==parseFloat(t._value).toString()?{_value:n}:null}renderItem(e,t){const n=this.props.schema.min||0,h=this.props.schema.max||100,i=this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):"",s=[{value:n,label:n+i},{value:h,label:h+i}];return $.createElement(Ie,{style:oo.fullWidth},this.props.schema.label?$.createElement(yt,{gutterBottom:!0},this.getText(this.props.schema.label)):null,$.createElement(Mo,{style:oo.slider,value:this.state._value,getAriaValueText:d=>d+i,step:this.props.schema.step||(h-n)/100,valueLabelDisplay:"auto",marks:s,min:n,max:h,disabled:!!t,onChange:d=>{const o=d.target.value;this.setState({_value:o},()=>this.onChange(this.props.attr,o))}}),this.props.schema.help?$.createElement(yt,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}function Dt(m,e){return m==="edit"||m==="rename"?$.createElement(Fo,{style:e}):m==="delete"?$.createElement(_t,{style:e}):m==="refresh"?$.createElement(Ks,{style:e}):m==="newDevice"||m==="new"||m==="add"?$.createElement(Un,{style:e}):m==="discover"||m==="search"?$.createElement(Oo,{style:e}):m==="unpairDevice"||m==="unpair"?$.createElement(Bo,{style:e}):m==="pairDevice"||m==="pair"?$.createElement(Po,{style:e}):m==="identify"?$.createElement(Mc,{style:e}):m==="play"?$.createElement(Js,{style:e}):m==="stop"?$.createElement(Ic,{style:e}):m==="pause"?$.createElement(Oc,{style:e}):m==="forward"||m==="next"?$.createElement(Fc,{style:e}):m==="rewind"||m==="previous"?$.createElement(Rc,{style:e}):m==="lamp"||m==="light"?$.createElement(Nc,{style:e}):m==="backlight"?$.createElement(Bc,{style:e}):m==="dimmer"?$.createElement(Pc,{style:e}):m==="socket"?$.createElement(Wc,{style:e}):m==="settings"?$.createElement(jc,{style:e}):m==="users"||m==="group"?$.createElement(No,{style:e}):m==="user"?$.createElement(Ro,{style:e}):m==="qrcode"?$.createElement(Hc,{style:e}):m==="connection"?$.createElement(zc,{style:e}):m==="no-connection"?$.createElement(Vc,{style:e}):m==="visible"?$.createElement(zo,{style:e}):null}function Qp(m,e){return typeof e=="string"?{"@keyframes newStateAnimationOnceColor":{"0%":{color:e},"100%":{color:m.palette.mode==="dark"?"#fff":"#000"}},animation:"newStateAnimationOnceColor 2s ease-in-out"}:{"@keyframes newStateAnimationOnce":{"0%":{color:"#00f900"},"80%":{color:m.palette.mode==="dark"?"#518851":"#008000"},"100%":{color:m.palette.mode==="dark"?"#fff":"#000"}},animation:"newStateAnimationOnce 2s ease-in-out"}}class Xp extends V{controlTimeout=null;delayedUpdate={timer:null,value:null};async getObjectID(){let e=(this.props.schema.oid||"").toString();return e.includes("${")&&(e=await this.getPatternAsync(e,null,!0)),this.props.schema.foreign?e:`${this.props.schema.system?"system.adapter.":""}${this.props.oContext.adapterName}.${this.props.oContext.instance||0}.${e}`}async componentDidMount(){var h,i;await super.componentDidMount();const e=await this.getObjectID(),t=await this.getCachedObject(e);if((h=t==null?void 0:t.common)!=null&&h.states&&!this.props.schema.options){if(Array.isArray((i=t==null?void 0:t.common)==null?void 0:i.states)){const s={};t.common.states.forEach((d,o)=>{s[o.toString()]=d}),t.common.states=s}Object.keys(t.common.states).length||(t.common.states=void 0)}const n=this.props.schema.control||this.detectType(t);try{const s=await this.props.oContext.socket.getState(e);this.setState({stateValue:s?s.val:null,controlType:n,obj:t,objId:e},async()=>{const d=await this.getObjectID();await this.props.oContext.socket.subscribeState(d,this.onStateChanged)})}catch(s){console.error(`Cannot get state ${e}: ${s}`),this.setState({controlType:n,obj:t,objId:e})}}componentWillUnmount(){super.componentWillUnmount(),this.state.objId&&this.props.oContext.socket.unsubscribeState(this.state.objId,this.onStateChanged),this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null),this.controlTimeout&&(clearTimeout(this.controlTimeout),this.controlTimeout=null,this.state.objId&&this.props.oContext.socket.setState(this.state.objId,this.state.stateValue,!1).catch(e=>console.error(`Cannot control value: ${e.toString()}`)))}onStateChanged=(e,t)=>{let n=t?t.val:null;this.state.controlType==="button"||this.state.controlType==="switch"?(n=!!n,this.state.stateValue!==n&&this.setState({stateValue:n})):n!==null&&(this.state.controlType==="slider"||this.state.controlType==="number")?(n=parseFloat(n),console.log(`${Date.now()} Received new value: ${n}`),n!==this.state.stateValue?(this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null),this.delayedUpdate.value=n,this.delayedUpdate.timer=setTimeout(()=>{this.setState({stateValue:this.delayedUpdate.value})},500)):this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null)):this.state.stateValue.toString()!==n.toString()&&this.setState({stateValue:n})};detectType(e){if(e||={},e.common||={},e.common.type==="boolean"){if(this.props.schema.controlled!==!1){if(e.common.read===!1||this.props.schema.controlled===!0)return"button";if(e.common.write||this.props.schema.controlled===!0)return"switch"}return"text"}return e.common.type==="number"&&this.props.schema.controlled!==!1?e.common.write||this.props.schema.controlled===!0?e.common.states||this.props.schema.options?"select":e.common.max!==void 0?"slider":"input":"text":e.common.write&&this.props.schema.controlled!==!1?e.common.states||this.props.schema.options?"select":"input":"text"}getNormalizedStates(){let e;return this.props.schema.options?e=this.props.schema.options.map(t=>typeof t=="string"?{value:t,label:this.getText(t,this.props.schema.noTranslation)}:{value:t.value,label:this.getText(t.label,this.props.schema.noTranslation),color:t.color}):this.state.obj.common.states?(e=[],Object.keys(this.state.obj.common.states).forEach(t=>{e.push({value:t,label:this.getText(this.state.obj.common.states[t],this.props.schema.noTranslation)})})):e=[],e}renderItem(e,t){var h,i,s,d,o;if(!this.state.obj)return null;let n;if(this.state.controlType==="select"||!this.state.controlType&&(this.state.obj.common.type==="number"||this.state.obj.common.type==="string")&&this.state.obj.common.write!==!1&&(this.props.schema.options||this.state.obj.common.states)){const l=this.getNormalizedStates(),r=l.find(a=>a.value===this.state.stateValue);n=$.createElement(fe,{fullWidth:!0},$.createElement(_e,null,this.getText(this.props.schema.label)),$.createElement(Ne,{value:this.state.stateValue,disabled:!!this.props.schema.readOnly||t,onChange:a=>{this.setState({stateValue:a.target.value},()=>{let c=this.state.stateValue;this.state.obj.common.type==="number"&&(c=parseFloat(c.toString().replace(",","."))),this.props.oContext.socket.setState(this.state.objId,c,!1)})},renderValue:a=>r!=null&&r.color?$.createElement("div",{style:{color:r.color}},r.label):a},l.map(a=>$.createElement($e,{key:(a.value??"").toString(),value:a.value,style:{color:a.color}},"$",a.label))))}else if(this.state.controlType==="button"||!this.state.controlType&&this.state.obj.common.type==="boolean"&&(this.state.obj.common.write&&this.state.obj.common.read===!1||(h=this.state.obj.common.role)!=null&&h.includes("button"))){let l=null;this.props.schema.falseImage&&(l=Dt(this.props.schema.falseImage));const r=this.getText(this.props.schema.falseText||this.props.schema.label,this.props.schema.noTranslation);!r&&l?n=$.createElement(se,{style:this.props.schema.falseTextStyle,disabled:!!this.props.schema.readOnly,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async a=>{a&&await this.props.oContext.socket.setState(this.state.objId,this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}}):await this.props.oContext.socket.setState(this.state.objId,this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}},l):n=$.createElement(ve,{variant:this.props.schema.variant||"contained",startIcon:l,style:this.props.schema.falseTextStyle,disabled:t||!!this.props.schema.readOnly,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async a=>{a&&await this.props.oContext.socket.setState(this.state.objId,this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}}):await this.props.oContext.socket.setState(this.state.objId,this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}},r||(this.state.objId||"").split(".").pop())}else if(this.state.controlType==="input"||!this.state.controlType&&this.state.obj.common.write&&this.state.obj.common.type==="string")n=$.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",gap:8,alignItems:"baseline"}},$.createElement(pe,{style:{flex:1},value:this.state.stateValue,variant:"standard",disabled:!!this.props.schema.readOnly||t,slotProps:{input:{endAdornment:this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||void 0},htmlInput:{readOnly:!!this.props.schema.readOnly}},onKeyUp:l=>{this.props.schema.setOnEnterKey&&l.key==="Enter"&&this.props.oContext.socket.setState(this.state.objId,this.state.stateValue,!1)},onChange:l=>{this.setState({stateValue:l.target.value},()=>{this.props.schema.setOnEnterKey||this.props.schema.showEnterButton||(this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{this.controlTimeout=null;let r=this.state.stateValue;this.state.obj.common.type==="number"&&(r=parseFloat(r.toString().replace(",","."))),await this.props.oContext.socket.setState(this.state.objId,r,!1)},this.props.schema.controlDelay||0))})},label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}),this.props.schema.showEnterButton&&!this.props.schema.readOnly&&$.createElement(ve,{variant:"outlined",disabled:t,onClick:()=>{this.props.oContext.socket.setState(this.state.objId,this.state.stateValue,!1)}},this.getText(typeof this.props.schema.showEnterButton=="string"?this.props.schema.showEnterButton:"Set")));else{let l;this.props.schema.size==="normal"?l=16:this.props.schema.size==="large"?l=20:typeof this.props.schema.size=="number"&&(l=this.props.schema.size);let r=this.getText(this.props.schema.label,this.props.schema.noTranslation);const a={display:"flex",alignItems:"center",fontSize:l||"1rem",gap:8};this.props.schema.narrow||(a.width="100%",a.justifyContent="space-between"),r.trim()&&!r.trim().endsWith(":")&&this.props.schema.addColon&&(r=`${r.trim()}:`);let c;this.props.schema.blinkOnUpdate&&(c=Qp(this.props.oContext.theme,this.props.schema.blinkOnUpdate));let p;this.props.schema.labelIcon&&(p=$.createElement(P.Icon,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let u;if(r&&p?u=$.createElement("div",{style:{whiteSpace:"nowrap"}},p,r):r?u=$.createElement("div",{style:{whiteSpace:"nowrap"}},r):p&&(u=p),this.state.controlType==="switch"||!this.state.controlType&&this.state.obj.common.type==="boolean"&&(this.state.obj.common.write&&this.state.obj.common.read!==!1||(i=this.state.obj.common.role)!=null&&i.includes("switch"))){let f=null;const g=this.getText(this.props.schema.falseText,this.props.schema.noTranslation);this.props.schema.falseImage&&(f=Dt(this.props.schema.falseImage,g?{marginLeft:8}:void 0));let v=null;const b=this.getText(this.props.schema.trueText,this.props.schema.noTranslation);this.props.schema.trueImage&&(v=Dt(this.props.schema.trueImage,b?{marginRight:8}:void 0)),n=$.createElement(cc,{checked:!!this.state.stateValue,disabled:!!this.props.schema.readOnly||t,onChange:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async D=>{D&&await this.props.oContext.socket.setState(this.state.objId,!this.state.stateValue,!1)}}):await this.props.oContext.socket.setState(this.state.objId,!this.state.stateValue,!1)}}),(g||f||b||v)&&(n=$.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:14}},$.createElement("span",{style:this.props.schema.falseTextStyle},g,f),n,$.createElement("span",{style:this.props.schema.trueTextStyle},v,b))),u&&(n=$.createElement("div",{style:a},u,n))}else if(this.state.controlType==="slider"||!this.state.controlType&&this.state.obj.common.type==="number"&&(this.state.obj.common.write&&(this.state.obj.common.max!==void 0||this.state.obj.common.unit==="%")||(s=this.state.obj.common.role)!=null&&s.includes("slider")||(d=this.state.obj.common.role)!=null&&d.includes("dimmer")||(o=this.state.obj.common.role)!=null&&o.includes("blind"))){let f=null;const g=this.getText(this.props.schema.falseText,this.props.schema.noTranslation);this.props.schema.falseImage&&(f=Dt(this.props.schema.falseImage,g?{marginLeft:8}:void 0));let v=null;const b=this.getText(this.props.schema.trueText,this.props.schema.noTranslation);this.props.schema.trueImage&&(v=Dt(this.props.schema.trueImage,b?{marginRight:8}:void 0));const D=this.props.schema.min??(this.state.obj.common.min||0),E=this.props.schema.max??this.state.obj.common.max??100,w=this.props.schema.step??(this.state.obj.common.step||1);n=$.createElement(Mo,{style:{width:"100%",flexGrow:1},min:D,max:E,disabled:!!this.props.schema.readOnly||t,step:w,value:this.state.stateValue,valueLabelDisplay:"auto",valueLabelFormat:y=>{let A=this.props.schema.digits!==void 0?y.toFixed(this.props.schema.digits):y.toString();return this.props.oContext.isFloatComma&&(A=A.replace(".",",")),`${A}${this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||""}`},onChange:(y,A)=>{this.setState({stateValue:A},()=>{this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{console.log(`${Date.now()} Send new value: ${this.state.stateValue}`),this.controlTimeout=null,await this.props.oContext.socket.setState(this.state.objId,this.state.stateValue,!1)},this.props.schema.controlDelay||0)})}}),(g||f||b||v)&&(n=$.createElement("div",{style:{display:"flex",width:"100%",flexGrow:1,alignItems:"center"}},$.createElement("span",{style:{marginRight:16,...this.props.schema.falseTextStyle}},g,f),n,$.createElement("span",{style:{marginLeft:16,...this.props.schema.trueTextStyle}},v,b))),u&&(n=$.createElement("div",{style:a},u,n))}else if(this.state.obj.common.type==="number"&&this.state.obj.common.write&&!this.state.controlType){const f=this.props.schema.min??this.state.obj.common.min??void 0,g=this.props.schema.max??this.state.obj.common.max??void 0,v=this.props.schema.step??this.state.obj.common.step??void 0;n=$.createElement(pe,{variant:"standard",style:{width:"100%"},value:this.state.stateValue,type:"number",disabled:!!this.props.schema.readOnly||t,slotProps:{htmlInput:{min:f,max:g,step:v,readOnly:!!this.props.schema.readOnly},input:{endAdornment:this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||void 0}},onChange:b=>{this.setState({stateValue:b.target.value},()=>{this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{this.controlTimeout=null;const D=parseFloat(this.state.stateValue);await this.props.oContext.socket.setState(this.state.objId,D,!1)},this.props.schema.controlDelay||0)})},label:this.getText(this.props.schema.label,this.props.schema.noTranslation),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}else if(this.state.obj.common.type==="boolean"){let f=null,g,v;this.state.stateValue?(g=this.getText(this.props.schema.trueText,this.props.schema.noTranslation),this.props.schema.trueImage&&(f=Dt(this.props.schema.falseImage,g?{marginRight:8}:void 0)),v=this.props.schema.trueTextStyle):(g=this.getText(this.props.schema.falseText,this.props.schema.noTranslation),this.props.schema.falseImage&&(f=Dt(this.props.schema.falseImage,g?{marginLeft:8}:void 0)),v=this.props.schema.falseTextStyle),v=Object.assign(a,v),n=$.createElement("div",{style:v},u,$.createElement(Ie,{style:{display:"flex",alignItems:"center",gap:8},sx:c,key:this.props.schema.blinkOnUpdate?g:void 0},f,g||(this.state.stateValue?P.I18n.t("ra_true"):P.I18n.t("ra_false"))))}else{const f=this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit;let g=this.state.stateValue;if(g!=null&&(this.props.schema.options||this.state.obj.common.states)){const E=this.getNormalizedStates().find(w=>w.value.toString()===g.toString());E&&(g=E.label)}let v,b;this.state.controlType==="html"?(b=(g||"").toString(),v=$.createElement("span",{dangerouslySetInnerHTML:{__html:g}})):this.state.stateValue===null?(v="null",b=v):this.state.stateValue===void 0?(v="undefined",b=v):(this.props.schema.digits!==void 0&&typeof g=="number"?(v=g.toFixed(this.props.schema.digits),this.props.oContext.isFloatComma&&(v=v.replace(".",","))):v=g.toString(),b=v),n=$.createElement("div",{style:a},u,$.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:4}},$.createElement(Ie,{sx:c,key:this.props.schema.blinkOnUpdate?b:void 0},v),f?$.createElement("span",{style:{opacity:.7,fontSize:"smaller"}},f):null))}}return n}}const bs={fullWidth:m=>({width:"100%",backgroundColor:m.palette.mode==="dark"?"#FFF":"#000",borderStyle:"hidden"}),primary:m=>({backgroundColor:m.palette.primary.main}),secondary:m=>({backgroundColor:m.palette.secondary.main})};class Zp extends V{renderItem(){return $.createElement(Ie,{component:"hr",sx:P.Utils.getStyle(this.props.oContext.theme,bs.fullWidth,this.props.schema.color==="primary"?bs.primary:this.props.schema.color==="secondary"?bs.secondary:{backgroundColor:this.props.schema.color||(this.props.oContext.themeType==="dark"?"#333":"#ddd")},{height:this.props.schema.color?this.props.schema.height||2:this.props.schema.height||1})})}}const qp={header:m=>({width:"100%",background:m.palette.primary.main,color:m.palette.primary.contrastText,padding:"4px !important",borderRadius:"3px",marginBlockEnd:0,marginBlockStart:0})};class ed extends V{renderItem(){let e="h5";switch((this.props.schema.size||5).toString()){case"1":e="h1";break;case"2":e="h2";break;case"3":e="h3";break;case"4":e="h4";break;default:e="h5";break}return $.createElement(Ie,{component:e,sx:qp.header},this.getText(this.props.schema.label||this.props.schema.text,this.props.schema.noTranslation))}}class td extends V{getSrc(){let e=this.props.schema.src;return e&&!e.startsWith(".")&&!e.startsWith("http")&&!e.startsWith(`adapter/${this.props.oContext.adapterName}/`)&&!e.startsWith(`./adapter/${this.props.oContext.adapterName}/`)&&(e=`${this.props.oContext.imagePrefix}/adapter/${this.props.oContext.adapterName}/${e}`),e}renderItem(){const{schema:e}=this.props,t=this.getSrc();if(e.showInDialog){const n=e.showInDialogSmallSize||100,h=e.showInDialogButtonLabel?this.getText(e.showInDialogButtonLabel):"";return $.createElement($.Fragment,null,$.createElement(me,{title:P.I18n.t("ra_Click to see in full size")},$.createElement("img",{src:t,style:{cursor:"pointer",width:"auto",height:n,objectFit:"contain"},alt:"",onClick:()=>this.setState({showDialog:!0})}))," ",h?$.createElement(ve,{variant:"outlined",color:"grey",onClick:()=>this.setState({showDialog:!0})},h):null,this.state.showDialog?$.createElement(Lt,{open:!0,onClose:()=>this.setState({showDialog:!1}),maxWidth:"lg"},$.createElement(Kt,null,$.createElement(P.Icon,{src:t,style:{width:"100%",height:"100%",objectFit:"contain"}})),$.createElement(Gt,null,$.createElement(ve,{variant:"contained",onClick:()=>this.setState({showDialog:!1}),color:"primary"},P.I18n.t("ra_Close")))):null)}return $.createElement("img",{src:t,style:{cursor:e.href?"pointer":void 0,width:"100%",height:"100%"},onClick:e.href?()=>e.href&&window.open(e.href,"_blank"):null,alt:""})}}function ao(m,e,t){return typeof t=="string"?{"@keyframes newValueAnimationOnceColor":{"0%":{color:e?`${t} !important`:t},"100%":{color:m.palette.mode==="dark"?e?"#fff !important":"#fff":e?"#000 !important":"#000"}},animation:"newValueAnimationOnceColor 2s ease-in-out"}:{"@keyframes newValueAnimationOnce":{"0%":{color:e?"#00f900 !important":"#00f900"},"80%":{color:m.palette.mode==="dark"?e?"#518851 !important":"#518851":e?"#008000 !important":"#008000"},"100%":{color:m.palette.mode==="dark"?e?"#fff !important":"#fff":e?"#000 !important":"#000"}},animation:"newValueAnimationOnce 2s ease-in-out"}}function lo(m,e){return typeof e=="string"?{"@keyframes blinkAnimationColor":{"0%":{color:e},"100%":{color:m.palette.mode==="dark"?"#fff":"#000"}},animation:"blinkAnimationColor 2s ease-in-out infinite"}:{"@keyframes blinkAnimation":{"0%":{color:"#00f900"},"80%":{color:m.palette.mode==="dark"?"#518851":"#008000"},"100%":{color:m.palette.mode==="dark"?"#fff":"#000"}},animation:"blinkAnimation 2s ease-in-out infinite"}}const an={label:{fontWeight:"bold",whiteSpace:"nowrap"},valueImage:{maxHeight:"100%"},valueAndUnit:{display:"flex",gap:4,alignItems:"baseline"},value:{},unit:{fontSize:"smaller",opacity:.7}};class nd extends V{renderItem(e){let t=this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation);this.props.schema.addColon&&typeof t=="string"&&!t.trim().endsWith(":")&&(t=`${t.trim()}:`),t&&(t.includes("<a ")||t.includes("<br")||t.includes("<b>")||t.includes("<i>"))&&(t=P.Utils.renderTextWithA(t));let n;this.props.schema.size==="normal"?n=16:this.props.schema.size==="large"?n=20:typeof this.props.schema.size=="number"&&(n=this.props.schema.size);const h={width:"100%",height:"100%",display:"flex",alignItems:"center",position:"relative",fontSize:n};this.props.schema.narrow?h.gap=8:h.justifyContent="space-between";let i,s;this.props.schema.data&&typeof this.props.schema.data=="object"&&this.props.schema.data.en?s=this.getText(this.props.schema.data):typeof this.props.schema.data=="object"||this.props.schema.data===void 0||this.props.schema.data===null?s=JSON.stringify(this.props.schema.data):typeof this.props.schema.data=="number"?(s=this.props.schema.data.toString(),this.props.oContext.isFloatComma&&(s=s.replace(".",","))):(!this.props.schema.booleanAsCheckbox||typeof this.props.schema.data!="boolean")&&(s=this.props.schema.data.toString());let d=!1;if(this.props.schema.booleanAsCheckbox&&typeof this.props.schema.data=="boolean")i=$.createElement(Zt,{checked:!!i,disabled:!0,size:this.props.schema.size==="small"?"small":this.props.schema.size==="large"?"large":void 0});else if(s.startsWith("data:image/"))i=$.createElement("div",{style:{...an.value,...an.valueImage,...this.props.schema.styleValue||void 0}},$.createElement(P.Icon,{src:s}));else{const a={...an.value,...this.props.schema.styleValue||void 0};this.props.schema.html?i=$.createElement("div",{style:a,dangerouslySetInnerHTML:{__html:s}}):Array.isArray(this.props.schema.data)?(d=!0,i=$.createElement("div",{style:a},this.props.schema.data.map((c,p)=>$.createElement("div",{key:p},typeof c=="object"||c===null||c===void 0?JSON.stringify(c):c)))):s.includes(`
1391
- `)?(d=!0,i=$.createElement("div",{style:a},P.Utils.renderTextWithA(s))):i=$.createElement("div",{style:a},s)}if(this.props.schema.blinkOnUpdate&&this.props.schema.blink){const a=ao(this.props.oContext.theme,!0,this.props.schema.blinkOnUpdate),c=lo(this.props.oContext.theme,this.props.schema.blink);i=$.createElement(Ie,{key:s,sx:{...a,...c}},i)}else if(this.props.schema.blinkOnUpdate){const a=ao(this.props.oContext.theme,!1,this.props.schema.blinkOnUpdate);i=$.createElement(Ie,{key:s,sx:a},i)}else if(this.props.schema.blink){const a=lo(this.props.oContext.theme,this.props.schema.blink);i=$.createElement(Ie,{sx:a},i)}this.props.schema.unit&&(i=$.createElement("div",{style:an.valueAndUnit},i,$.createElement("div",{style:{...an.unit,...this.props.schema.styleUnit||void 0}},this.getText(this.props.schema.unit,this.props.schema.noTranslation))));let o;this.props.schema.labelIcon&&(o=$.createElement(P.Icon,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let l;this.props.schema.copyToClipboard&&(l=$.createElement(fn,{className:"staticCopyButton",style:{position:"absolute",top:"calc(50% - 12px)",right:0,cursor:"pointer"},onClick:()=>{P.Utils.copyToClipboard(s),window.alert(P.I18n.t("ra_Copied"))}}));const r={"& .staticCopyButton":{display:"none"},"& .staticCopyButton:action":{transform:"scale(0.9)"},"&:hover .staticCopyButton":{display:"block"}};return this.props.schema.highlight&&(r["&:hover"]={backgroundColor:this.props.oContext.themeType==="dark"?"#51515180":"#b8b8b880"}),d&&(h.alignItems="top"),$.createElement(Ie,{component:"div",style:h,sx:r},$.createElement("div",{style:{...an.label,...this.props.schema.styleLabel||void 0}},o,t),i,l)}}const co={fullWidth:{height:"100%",width:"100%"},link:m=>({textDecoration:"underline",color:m.palette.mode==="dark"?"#4dabf5":"#254e72",cursor:"pointer"})};function ho(m,e,t){let n,h="";m?m.toString().startsWith("#")||m.toString().startsWith("/")?(n=e||"_self",h=m):m.startsWith("http://")||m.startsWith("https://")?(n=e||"_blank",h=m):(h=`#tab-instances/config/${t}/${m}`,n=e||"_self"):(h=`#tab-instances/config/${t}`,n=e||"_self"),n==="_self"?setTimeout(i=>{i.startsWith("#")?window.location.hash=i:i.startsWith("/")?h=`${window.location.protocol}:${window.location.host}${h}`:(i.startsWith("http://")||i.startsWith("https://"))&&(window.location.href=i)},100,h):(h.startsWith("#")?h=`${window.location.protocol}:${window.location.host}${window.location.pathname}${h}`:h.startsWith("/")&&(h=`${window.location.protocol}:${window.location.host}${h}`),window.open(h,n))}class uo extends V{renderItem(e,t){if(this.props.schema.button){const h=this.getIcon();return $.createElement(ve,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:{...co.fullWidth,...this.props.schema.controlStyle||void 0},disabled:t,startIcon:h,onClick:this.props.schema.href?()=>{const i=this.props.schema.href?this.getText(this.props.schema.href,!0):null;i&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:"link",url:i,target:this.props.schema.target,close:this.props.schema.close}):ho(i,this.props.schema.target,`${this.props.oContext.adapterName}.${this.props.oContext.instance}`))}:null},this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation))}let n=this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation);if(this.props.schema.format==="html")n=$.createElement("div",{dangerouslySetInnerHTML:{__html:n}});else if(this.props.schema.format==="json")try{const h=typeof n=="string"?JSON.parse(n):n;n=$.createElement("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0}},JSON.stringify(h,null,2))}catch{}else n&&(n.includes("<a ")||n.includes("<br")||n.includes("<b>")||n.includes("<i>"))&&(n=P.Utils.renderTextWithA(n));return $.createElement(Ie,{component:"span",style:{...this.props.schema.controlStyle||void 0},sx:this.props.schema.href?co.link:void 0,onClick:this.props.schema.href?()=>{const h=this.props.schema.href?this.getText(this.props.schema.href,!0):null;h&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:"link",url:h,target:this.props.schema.target||"_blank",close:this.props.schema.close}):ho(h,this.props.schema.target||"_blank",`${this.props.oContext.adapterName}.${this.props.oContext.instance}`))}:null},n)}}const ws=1024*1024,re={paper:{width:"100%",marginBottom:16,backgroundColor:"rgba(255, 255, 255, 0.1)"},headerText:{width:"100%"},table:{minWidth:750},label:{display:"flex",justifyContent:"space-between"},title:{flex:"1 1 100%"},rootTool:{paddingLeft:16,paddingRight:8},silver:{opacity:.2},flex:{display:"flex",alignItems:"baseline"},filteredOut:{padding:10,display:"flex",textAlign:"center"},buttonEmpty:{width:34,display:"inline-block"},buttonCell:{whiteSpace:"nowrap"},dropZone:{width:"100%",height:100,position:"relative"},dropZoneEmpty:{},uploadDiv:{position:"relative",width:"100%",minHeight:300,opacity:.9,marginTop:30,cursor:"pointer",outline:"none"},uploadDivDragging:{opacity:1,background:"rgba(128,255,128,0.1)"},uploadCenterDiv:{margin:5,border:"3px dashed grey",borderRadius:5,width:"calc(100% - 10px)",height:"calc(100% - 10px)",minHeight:300,position:"relative",display:"flex"},uploadCenterIcon:{paddingTop:10,width:48,height:48},uploadCenterText:{fontSize:16},uploadCenterTextAndIcon:{textAlign:"center",position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},tooltip:{pointerEvents:"none"},cardHeader:m=>({color:m.palette.mode==="light"?m.palette.secondary.main:m.palette.text.primary,height:"100%",fontWeight:"bold",fontSize:20,fontStyle:"italic",padding:"4px 16px",backgroundColor:m.palette.primary.main,display:"flex",justifyContent:"space-between"})};function id(m,e,t){e=e||"key";const n=[];return Object.keys(m).forEach(h=>{const i={};i[e]=h,t?(i[t]=m[h],n.push(i)):n.push(Object.assign(i,m[h]))}),n}function po(m,e,t){e=e||"key";const n={};return m.forEach(h=>{const i=h[e]??"";delete h[e],t?n[i]=h[t]:n[i]=h}),n}function sd(m,e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(m[n%m.length].charCodeAt(0)^e.charCodeAt(n));return t}function rd(m,e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(m[n%m.length].charCodeAt(0)^e.charCodeAt(n));return t}class Qe extends V{filterRefs;typingTimer=null;resizeTimeout=null;secret="Zgfr56gFe87jJOM";refDiv;listOfHiddenElements=[];refreshBecauseOfHiddenElements=null;constructor(e){super(e),this.filterRefs={},this.props.schema.items||=[],this.props.schema.items.forEach(t=>{t.filter&&(this.filterRefs[t.attr]=Xl())}),this.refDiv=$.createRef()}async componentDidMount(){var i;await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr)||[];let t;if(this.props.schema.objKeyName?t=id(e,this.props.schema.objKeyName,this.props.schema.objValueName):t=e,Array.isArray(t)||(t=[]),this.props.schema.encryptedAttributes){let s;try{this.props.oContext.socket.getCompactSystemConfig?s=await this.props.oContext.socket.getCompactSystemConfig():s=await this.getCachedObject("system.config")}catch(d){console.error(`Cannot get system configuration: ${d}`)}this.secret=((i=s==null?void 0:s.native)==null?void 0:i.secret)||this.secret,e.forEach(d=>{this.props.schema.encryptedAttributes.forEach(o=>{d[o]&&(d[o]=rd(this.secret,d[o]))})})}const n=window.localStorage.getItem(`table.collapsed.${this.props.oContext.instance}.${this.props.attr}`);let h=[];if(n)try{h=JSON.parse(n)}catch{}this.setState({value:t,visibleValue:null,orderBy:"",order:"asc",iteration:0,filterOn:[],width:0,tableErrors:{},collapsed:h,filterLabelMap:{}},()=>this.validateUniqueProps())}componentWillUnmount(){this.typingTimer&&(clearTimeout(this.typingTimer),this.typingTimer=null),this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.refreshBecauseOfHiddenElements&&(clearTimeout(this.refreshBecauseOfHiddenElements),this.refreshBecauseOfHiddenElements=null),super.componentWillUnmount()}itemTable(e,t,n,h){var o;const{schema:i}=this.props,s=(o=i.items)==null?void 0:o.find(l=>l.attr===e);if(!s)return null;const d={items:{[e]:s}};return $.createElement(tn,{oContext:this.props.oContext,alive:this.props.alive,arrayIndex:n,changed:this.props.changed,common:this.props.common,expertMode:this.props.expertMode,custom:!0,data:t,globalData:this.props.data,index:n+this.state.iteration,onChange:(l,r)=>{const a=JSON.parse(JSON.stringify(this.state.value));a[n][l]=r,this.setState({value:a},()=>{this.validateUniqueProps(),this.onChangeWrapper(a,!0)})},onError:this.onTableRowError(n),originalData:this.props.originalData,schema:d,table:!0,themeName:this.props.themeName,onFilterLabelUpdate:(l,r)=>{const a=this.state.filterLabelMap[l],c={...a,...r};JSON.stringify(a)!==JSON.stringify(c)&&this.setState(p=>({filterLabelMap:{...p.filterLabelMap,[l]:c}}))},customComponents:this.props.customComponents,onHiddenChanged:h?(l,r)=>{if(r)this.listOfHiddenElements[n]||=[],this.listOfHiddenElements[n].includes(l)||(this.listOfHiddenElements[n].push(l),this.refreshBecauseOfHiddenElements&&clearTimeout(this.refreshBecauseOfHiddenElements),this.refreshBecauseOfHiddenElements=setTimeout(()=>{this.forceUpdate()},100));else if(this.listOfHiddenElements[n]){const a=this.listOfHiddenElements[n].indexOf(l);a!==-1&&(this.listOfHiddenElements[n].splice(a,1),this.refreshBecauseOfHiddenElements&&clearTimeout(this.refreshBecauseOfHiddenElements),this.refreshBecauseOfHiddenElements=setTimeout(()=>{this.forceUpdate()},100))}}:void 0})}validateUniqueProps(){if(!this.props.schema.uniqueColumns)return;let e=null,t=null;for(const n of this.props.schema.uniqueColumns){const h=[];this.state.value.find(s=>{const d=s[n];return h.includes(d)?(e||(e=n,t=d),this.onError(n,"is not unique"),!0):(h.push(d),!1)})||this.onError(n,null)}e?this.setState({errorMessage:P.I18n.t('Non-allowed duplicate entry "%s" in column "%s"',t,e)}):this.setState({errorMessage:""})}onTableRowError=e=>(t,n)=>{const h={...this.state.tableErrors};h[e]||(h[e]={}),n?h[e][t]=n:(delete h[e][t],Object.keys(h[e]).length===0&&delete h[e]),this.setState({tableErrors:h}),this.props.onError(t,n)};static descendingComparator(e,t,n){return t[n]<e[n]?-1:t[n]>e[n]?1:0}static getComparator(e,t){return e==="desc"?(n,h)=>Qe.descendingComparator(n,h,t):(n,h)=>-Qe.descendingComparator(n,h,t)}static getFilterValue(e){var t,n,h;return(h=(n=(t=e==null?void 0:e.current)==null?void 0:t.children[0])==null?void 0:n.children[0])==null?void 0:h.value}static setFilterValue(e,t){return e.current.children[0].children[0].value=t}handleRequestSort=(e,t=!1)=>{const{order:n,orderBy:h}=this.state,s=t?n:h===e&&n==="asc"?"desc":"asc",d=this.stableSort(s,e);JSON.stringify(d)!==JSON.stringify(this.state.value)&&this.setState({value:d,order:s,orderBy:e,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,d))};stableSort=(e,t)=>{const{value:n}=this.state,h=Qe.getComparator(e,t),i=n.map((s,d)=>({el:s,index:d}));return i.sort((s,d)=>{const o=h(s.el,d.el);return o!==0?o:s.index-d.index}),i.map(s=>s.el)};renderShowHideFilter(e){return e.filter?$.createElement(se,{title:P.I18n.t("ra_Show/hide filter input"),size:"small",onClick:()=>{const t=[...this.state.filterOn],n=this.state.filterOn.indexOf(e.attr);n===-1?t.push(e.attr):t.splice(n,1),this.setState({filterOn:t},()=>{n&&Qe.getFilterValue(this.filterRefs[e.attr])&&(Qe.setFilterValue(this.filterRefs[e.attr],""),this.applyFilter())})}},this.state.filterOn.includes(e.attr)?$.createElement(Uc,null):$.createElement(Kc,null)):null}renderImportExportButtons(e){return $.createElement($.Fragment,null,!e.noDelete&&e.import?$.createElement(me,{title:P.I18n.t("ra_Import data from %s file","CSV"),slotProps:{popper:{sx:re.tooltip}}},$.createElement(se,{size:"small",onClick:()=>this.setState({showImportDialog:!0})},$.createElement(Vn,null))):null,e.export?$.createElement(me,{title:P.I18n.t("ra_Export data to %s file","CSV"),slotProps:{popper:{sx:re.tooltip}}},$.createElement(se,{size:"small",onClick:()=>this.onExport()},$.createElement(Gc,null))):null,e.noDelete?null:$.createElement(se,{disabled:!0,size:"small"},$.createElement(_t,null)))}renderAddButton(e){return $.createElement(me,{title:e?P.I18n.t("ra_Cannot add items with set filter"):P.I18n.t("ra_Add row"),slotProps:{popper:{sx:re.tooltip}}},$.createElement("span",null,$.createElement(se,{size:"small",color:"primary",disabled:!!e&&!this.props.schema.allowAddByFilter,onClick:this.onAdd},$.createElement(Un,null))))}enhancedTableHead(e,t){var s;const{schema:n}=this.props,{order:h,orderBy:i}=this.state;return $.createElement(ko,null,$.createElement(ct,null,(s=n.items)==null?void 0:s.map((d,o)=>this.renderOneFilter({schema:n,style:{width:d.width},showAddButton:!o&&!n.noDelete,headCell:d,order:h,orderBy:i,index:o,doAnyFilterSet:t})),!n.noDelete&&$.createElement(Ee,{style:{paddingLeft:20,paddingRight:20,width:e,textAlign:"right"},padding:"checkbox"},this.renderImportExportButtons(n))))}onDelete=e=>()=>{const t=JSON.parse(JSON.stringify(this.state.value));t.splice(e,1);const n={...this.state.tableErrors};n[e]&&(Object.keys(n[e]).forEach(i=>{this.props.onError(i,void 0)}),delete n[e]);const h={};Object.keys(n).forEach(i=>{const s=parseInt(i,10);s>e?h[s-1]=n[s]:h[s]=n[s]}),this.setState({value:t,iteration:this.state.iteration+1e4,tableErrors:h},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))};onExport(){const{schema:e}=this.props,{value:t}=this.state,h=[e.items.map(d=>d.attr).join(";")];t.forEach(d=>{const o=[];e.items.forEach(l=>{d[l.attr]&&typeof d[l.attr]=="string"&&d[l.attr].includes(";")?o.push(`"${d[l.attr]}"`):o.push(d[l.attr]??"")}),h.push(o.join(";"))});const i=document.createElement("a");i.setAttribute("href",`data:text/csv;charset=utf-8,${encodeURIComponent(h.join(`
1392
- `))}`);const s=new Date;i.setAttribute("download",`${s.getFullYear()}_${(s.getMonth()+1).toString().padStart(2,"0")}_${s.getDate().toString().padStart(2,"0")}_${this.props.oContext.adapterName}.${this.props.oContext.instance}_${this.props.attr}.csv`),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}onImport(e){var s;const t=e.split(`
1393
- `).map(d=>d.replace("\r","").trim()),{schema:n}=this.props,h=t.shift().split(";").filter(d=>d&&n.items.find(o=>o.attr===d)),i=[];t.forEach(d=>{const o=d.split(";"),l={};for(let r=0;r<o.length;r++){let a=o[r];if(a.startsWith('"')){for(a=a.substring(1);r<o.length&&!a.endsWith('"');)a+=`;${o[++r]}`;a=a.substring(0,a.length-1)}let c=a;if(a==="true")c=!0;else if(a==="false")c=!1;else if(window.isFinite(a)){const p=this.props.schema.items.find(u=>u.attr===h[r]);p&&p.type==="number"?c=parseFloat(a):c=a}else c=a;l[h[r]]=c}i.push(l)}),i.length?(s=this.state.value)!=null&&s.length?this.setState({showTypeOfImportDialog:i,showImportDialog:!1}):this.setState({value:i,showImportDialog:!1}):window.alert("ra_No data found in file")}onClone=e=>()=>{const t=JSON.parse(JSON.stringify(this.state.value)),n=JSON.parse(JSON.stringify(t[e]));if(typeof this.props.schema.clone=="string"&&typeof n[this.props.schema.clone]=="string"){let h=1,i=n[this.props.schema.clone];const s=i.match(/(\d+)$/);for(s?(i=i.replace(s[0],""),h=parseInt(s[0],10)+1):i+="_";t.find(d=>d[this.props.schema.clone]===i+h.toString());)h++;n[this.props.schema.clone]=`${n[this.props.schema.clone]}_${h}`}t.splice(e,0,n),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))};onChangeWrapper=(e,t)=>{this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout((n,h)=>{this.typingTimer=null;let i;if(this.props.schema.encryptedAttributes){const s=JSON.parse(JSON.stringify(n));if(s.forEach(d=>{this.props.schema.encryptedAttributes.forEach(o=>{d[o]&&(d[o]=sd(this.secret,d[o]))})}),this.props.schema.objKeyName){const d=po(s,this.props.schema.objKeyName,this.props.schema.objValueName);i=this.onChange(this.props.attr,d)}else i=this.onChange(this.props.attr,s)}else if(this.props.schema.objKeyName){const s=po(JSON.parse(JSON.stringify(n)),this.props.schema.objKeyName,this.props.schema.objValueName);i=this.onChange(this.props.attr,s)}else i=this.onChange(this.props.attr,n);i instanceof Promise&&i.catch(s=>console.error(`Cannot save: ${s}`)),h&&(this.applyFilter(!1,n),this.handleRequestSort(this.state.orderBy,!0))},300,e,t)};onAdd=async()=>{const{schema:e}=this.props,t=JSON.parse(JSON.stringify(this.state.value)),n={};if(e.items)for(const h of e.items){let i;h.defaultFunc?this.props.custom?i=h.defaultFunc?await this.executeCustom(h.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,t.length,this.props.data):this.props.schema.default:i=h.defaultFunc?await this.execute(h.defaultFunc,this.props.schema.default,this.props.data,t.length,this.props.data):this.props.schema.default:i=h.default??null,n[h.attr]=i}t.push(n),this.setState({value:t},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))};isAnyFilterSet(){return!!Object.keys(this.filterRefs).find(e=>Qe.getFilterValue(this.filterRefs[e]))}applyFilter=(e,t,n)=>{t=t||this.state.value;let h=t.map((i,s)=>s);if(Object.keys(this.filterRefs).forEach(i=>{var d;let s=Qe.getFilterValue(this.filterRefs[i]);if(!e&&s){s=s.toLowerCase();const o=(d=this.state.filterLabelMap)==null?void 0:d[i];h=h.filter(l=>{if(!t[l]||t[l][i]==null)return!1;if(t[l][i].toString().toLowerCase().includes(s))return!0;if(o){const a=o[t[l][i]];if(a&&a.toLowerCase().includes(s))return!0}return!1})}else this.filterRefs[i].current&&Qe.setFilterValue(this.filterRefs[i],"")}),h.length===t.length&&(h=null),h===null&&this.state.visibleValue===null){n&&n();return}JSON.stringify(h)!==JSON.stringify(this.state.visibleValue)?this.setState({visibleValue:h},()=>n&&n()):n&&n()};onMoveUp(e){const t=JSON.parse(JSON.stringify(this.state.value)),n=t[e];t.splice(e,1),t.splice(e-1,0,n),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))}onMoveDown(e){const t=JSON.parse(JSON.stringify(this.state.value)),n=t[e];t.splice(e,1),t.splice(e+1,0,n),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))}onDrop(e){const t=e[0],n=new FileReader;n.onabort=()=>console.log("file reading was aborted"),n.onerror=()=>console.log("file reading has failed"),n.onload=()=>{if(t.size>ws){window.alert(P.I18n.t("ra_File is too big. Max %sk allowed. Try use SVG.",Math.round(ws/1024)));return}const h=new Uint8Array(n.result).reduce((i,s)=>i+String.fromCharCode(s),"");this.onImport(h)},n.readAsArrayBuffer(t)}showTypeOfImportDialog(){return this.state.showTypeOfImportDialog?$.createElement(Lt,{open:!0,onClose:()=>this.setState({showTypeOfImportDialog:!1}),maxWidth:"md"},$.createElement(yn,null,P.I18n.t("ra_Append or replace?")),$.createElement(Kt,null,P.I18n.t("ra_Append %s entries or replace existing?",this.state.showTypeOfImportDialog.length)),$.createElement(Gt,null,$.createElement(ve,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>{const e=JSON.parse(JSON.stringify(this.state.value));this.state.showTypeOfImportDialog.forEach(t=>e.push(t)),this.setState({value:e,iteration:this.state.iteration+1e4,showTypeOfImportDialog:!1},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(e)))}},P.I18n.t("ra_Append")),$.createElement(ve,{variant:"contained",color:"secondary",autoFocus:!0,onClick:()=>{const e=this.state.showTypeOfImportDialog;this.setState({value:e,iteration:this.state.iteration+1e4,showTypeOfImportDialog:!1},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(e)))}},P.I18n.t("ra_Replace")))):null}showImportDialog(){return this.state.showImportDialog?$.createElement(Lt,{open:!0,onClose:()=>this.setState({showImportDialog:!1}),sx:{"& .MuiDialog-paper":{minHeight:500}},maxWidth:"md",fullWidth:!0},$.createElement(yn,null,P.I18n.t("ra_Import from %s","CSV")),$.createElement(Kt,null,$.createElement(Vo,{multiple:!1,accept:{"text/csv":[".csv"]},maxSize:ws,onDragEnter:()=>this.setState({uploadFile:"dragging"}),onDragLeave:()=>this.setState({uploadFile:!0}),onDrop:(e,t)=>{this.setState({uploadFile:!1}),e.length?this.onDrop(e):window.alert(t&&t[0]&&t[0].errors&&t[0].errors[0]&&t[0].errors[0].message||P.I18n.t("ra_Cannot upload"))}},({getRootProps:e,getInputProps:t})=>$.createElement("div",{style:{...re.uploadDiv,...this.state.uploadFile==="dragging"?re.uploadDivDragging:void 0,...re.dropZone,...this.state.icon?void 0:re.dropZoneEmpty},...e()},$.createElement("input",{...t()}),$.createElement("div",{style:re.uploadCenterDiv},$.createElement("div",{style:re.uploadCenterTextAndIcon},$.createElement(Vn,{style:re.uploadCenterIcon}),$.createElement("div",{style:re.uploadCenterText},this.state.uploadFile==="dragging"?P.I18n.t("ra_Drop file here"):P.I18n.t("ra_Place your files here or click here to open the browse dialog"))))))),$.createElement(Gt,null,$.createElement(ve,{variant:"contained",onClick:()=>this.setState({showImportDialog:!1}),color:"primary",startIcon:$.createElement(ht,null)},P.I18n.t("Cancel")))):null}renderOneFilter(e){return $.createElement(Ee,{key:`${e.headCell.attr}_${e.index}`,style:e.style,align:"left",sortDirection:e.orderBy===e.headCell.attr?e.order:!1},$.createElement("div",{style:{...re.flex,...e.schema.showFirstAddOnTop?{flexDirection:"column"}:void 0}},e.showAddButton?this.renderAddButton(e.doAnyFilterSet):null,e.headCell.sort&&$.createElement(hc,{active:!0,style:e.orderBy!==e.headCell.attr?re.silver:void 0,direction:e.orderBy===e.headCell.attr?e.order:"asc",onClick:()=>this.handleRequestSort(e.headCell.attr)}),e.headCell.filter&&this.state.filterOn.includes(e.headCell.attr)?$.createElement(pe,{variant:"standard",ref:this.filterRefs[e.headCell.attr],onChange:()=>this.applyFilter(),title:P.I18n.t("ra_You can filter entries by entering here some text"),slotProps:{input:{endAdornment:Qe.getFilterValue(this.filterRefs[e.headCell.attr])&&$.createElement(vn,{position:"end"},$.createElement(se,{size:"small",tabIndex:-1,onClick:()=>{Qe.setFilterValue(this.filterRefs[e.headCell.attr],""),this.applyFilter()}},$.createElement(ht,null)))}},fullWidth:!0,placeholder:this.getText(e.headCell.title)}):$.createElement("span",{style:re.headerText},this.getText(e.headCell.title)),this.renderShowHideFilter(e.headCell)))}enhancedFilterCard(){var s;const{schema:e}=this.props,{order:t,orderBy:n}=this.state;let h;this.props.schema.compact&&(h={paddingTop:1,paddingBottom:1});const i=!e.noDelete&&e.import||e.export;return i||e.items.find(d=>d.sort||d.filter)?$.createElement(ze,{size:{xs:e.xs||12,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0}},$.createElement(ls,null,$.createElement(In,{style:re.paper},$.createElement(js,{style:re.paper},$.createElement(Hs,{expandIcon:$.createElement(Ii,null)},$.createElement(yt,null,P.I18n.t("ra_Filter and Data Actions"))),$.createElement(zs,null,$.createElement(On,null,$.createElement(Fn,null,((s=e.items)==null?void 0:s.find(d=>d.sort||d.filter))&&e.items.map((d,o)=>$.createElement(ct,{key:`${d.attr}_${o}`},this.renderOneFilter({schema:e,style:h,showAddButton:!1,headCell:d,order:t,orderBy:n,index:o,doAnyFilterSet:!1}))),i?$.createElement(ct,null,$.createElement(Ee,{align:"left",style:h},$.createElement("span",{style:re.headerText},P.I18n.t("ra_Actions"))),$.createElement(Ee,{style:h},this.renderImportExportButtons(e))):null))))))):null}enhancedBottomCard(){const{schema:e}=this.props;let t;this.props.schema.compact&&(t={paddingTop:1,paddingBottom:1});const n=this.isAnyFilterSet();return $.createElement(ze,{size:{xs:e.xs||12,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0}},$.createElement(ls,null,$.createElement(In,{style:re.paper},$.createElement(On,null,$.createElement(Fn,null,$.createElement(ct,null,$.createElement(Ee,{colSpan:e.items.length+1,style:t},this.renderAddButton(n))))))))}renderCards(){const{schema:e}=this.props;let{visibleValue:t}=this.state,n;this.props.schema.compact&&(n={paddingTop:1,paddingBottom:1});const h={padding:0,borderBottom:"none"};t||=this.state.value.map((s,d)=>d);const i=this.isAnyFilterSet();return $.createElement(ze,{container:!0},this.showImportDialog(),this.showTypeOfImportDialog(),this.enhancedFilterCard(),t.map((s,d)=>{var o,l,r;return $.createElement(ze,{key:`${s}_${d}`,size:{xs:e.xs||12,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0}},$.createElement(ls,{sx:this.state.tableErrors[s]?{outline:"1px solid red"}:void 0},$.createElement(In,{style:re.paper},this.props.schema.titleAttribute?$.createElement(Ie,{sx:re.cardHeader},$.createElement("div",null,this.state.value[s][this.props.schema.titleAttribute]),$.createElement("div",null,!i&&!this.state.orderBy?$.createElement(me,{title:P.I18n.t("ra_Move up"),slotProps:{popper:{sx:re.tooltip}}},$.createElement("span",null,$.createElement(se,{size:"small",onClick:()=>this.onMoveUp(s),disabled:d===0},$.createElement(Ai,null)))):null,!i&&!this.state.orderBy?$.createElement(me,{title:P.I18n.t("ra_Move down"),slotProps:{popper:{sx:re.tooltip}}},$.createElement("span",null,$.createElement(se,{size:"small",onClick:()=>this.onMoveDown(s),disabled:d===t.length-1},$.createElement(Di,null)))):null,$.createElement(me,{title:P.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:re.tooltip}}},$.createElement(se,{size:"small",onClick:this.onDelete(s)},$.createElement(_t,null))),this.props.schema.clone?$.createElement(me,{title:P.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:re.tooltip}}},$.createElement(se,{size:"small",onClick:this.onClone(s)},$.createElement(fn,null))):null,$.createElement(me,{title:P.I18n.t("ra_Expand/Collapse card"),slotProps:{popper:{sx:re.tooltip}}},$.createElement(se,{size:"small",onClick:()=>{const a=[...this.state.collapsed],c=a.indexOf(s);c===-1?a.push(s):a.splice(c,1),window.localStorage.setItem(`table.collapsed.${this.props.oContext.instance}.${this.props.attr}`,JSON.stringify(a)),this.setState({collapsed:a})}},$.createElement(Ii,{style:{rotate:(o=this.state.collapsed)!=null&&o.includes(s)?"0deg":"180deg",transition:"0.3s",transitionProperty:"rotate"}}))))):null,$.createElement(uc,{in:!((l=this.state.collapsed)!=null&&l.includes(s)),timeout:"auto",unmountOnExit:!0},$.createElement(On,null,$.createElement(Fn,null,(r=e.items)==null?void 0:r.map(a=>{var p,u;const c=(u=(p=this.listOfHiddenElements)==null?void 0:p[s])==null?void 0:u.includes(a.attr);return $.createElement(ct,{key:`${a.attr}_${s}`},$.createElement(Ee,{align:"left",style:c?h:n},c?null:$.createElement("span",{style:re.headerText},this.getText(a.title))),$.createElement(Ee,{align:"left",style:c?h:n},this.itemTable(a.attr,this.state.value[s],s,!0)))}),!this.props.schema.titleAttribute&&!e.noDelete&&$.createElement(ct,null,$.createElement(Ee,{align:"left",style:n},$.createElement("span",{style:re.headerText},this.getText("Actions"))),$.createElement(Ee,{align:"left",style:n},!i&&!this.state.orderBy?$.createElement(me,{title:P.I18n.t("ra_Move up"),slotProps:{popper:{sx:re.tooltip}}},$.createElement("span",null,$.createElement(se,{size:"small",onClick:()=>this.onMoveUp(s),disabled:d===0},$.createElement(Ai,null)))):null,!i&&!this.state.orderBy?$.createElement(me,{title:P.I18n.t("ra_Move down"),slotProps:{popper:{sx:re.tooltip}}},$.createElement("span",null,$.createElement(se,{size:"small",onClick:()=>this.onMoveDown(s),disabled:d===t.length-1},$.createElement(Di,null)))):null,$.createElement(me,{title:P.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:re.tooltip}}},$.createElement(se,{size:"small",onClick:this.onDelete(s)},$.createElement(_t,null))),this.props.schema.clone?$.createElement(me,{title:P.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:re.tooltip}}},$.createElement(se,{size:"small",onClick:this.onClone(s)},$.createElement(fn,null))):null))))))))}),this.enhancedBottomCard())}renderTable(){const{schema:e}=this.props;let{visibleValue:t}=this.state;t=t||this.state.value.map((i,s)=>s);const n=this.isAnyFilterSet();let h;return this.props.schema.compact&&(h={paddingTop:1,paddingBottom:1}),$.createElement(In,{style:re.paper},this.showImportDialog(),this.showTypeOfImportDialog(),e.label?$.createElement("div",{style:re.label},$.createElement(Pn,{variant:"dense",style:re.rootTool},$.createElement(yt,{style:re.title,variant:"h6",id:"tableTitle",component:"div"},this.getText(e.label)))):null,$.createElement(_o,null,$.createElement(On,{style:re.table,size:"small"},this.enhancedTableHead(!n&&!this.state.orderBy?120:64,n),$.createElement(Fn,null,t.map((i,s)=>{var d;return $.createElement(ct,{hover:!0,key:`${i}_${s}`,sx:this.state.tableErrors[i]?{outline:"1px solid red"}:void 0},(d=e.items)==null?void 0:d.map(o=>$.createElement(Ee,{key:`${o.attr}_${i}`,align:"left",style:h},this.itemTable(o.attr,this.state.value[i],i,!1))),!e.noDelete&&$.createElement(Ee,{align:"left",style:{...h,...re.buttonCell}},!n&&!this.state.orderBy?s?$.createElement(me,{title:P.I18n.t("ra_Move up"),slotProps:{popper:{sx:re.tooltip}}},$.createElement(se,{size:"small",onClick:()=>this.onMoveUp(i)},$.createElement(Ai,null))):$.createElement("div",{style:re.buttonEmpty}):null,!n&&!this.state.orderBy?s<t.length-1?$.createElement(me,{title:P.I18n.t("ra_Move down"),slotProps:{popper:{sx:re.tooltip}}},$.createElement(se,{size:"small",onClick:()=>this.onMoveDown(i)},$.createElement(Di,null))):$.createElement("div",{style:re.buttonEmpty}):null,$.createElement(me,{title:P.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:re.tooltip}}},$.createElement(se,{size:"small",onClick:this.onDelete(i)},$.createElement(_t,null))),this.props.schema.clone?$.createElement(me,{title:P.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:re.tooltip}}},$.createElement(se,{size:"small",onClick:this.onClone(i)},$.createElement(fn,null))):null))}),!e.noDelete&&t.length>=(e.showSecondAddAt||5)?$.createElement(ct,null,$.createElement(Ee,{colSpan:e.items.length+1,style:{...h}},this.renderAddButton(n))):null)),!t.length&&this.state.value.length?$.createElement("div",{style:re.filteredOut},$.createElement(yt,{style:re.title,variant:"h6",id:"tableTitle",component:"div"},P.I18n.t("ra_All items are filtered out"),$.createElement(se,{size:"small",onClick:()=>this.applyFilter(!0)},$.createElement(ht,null)))):null),e.help?$.createElement(ge,{style:{paddingLeft:16}},this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null,this.state.errorMessage?$.createElement("div",{style:{display:"flex",padding:"5px"}},$.createElement(zn,{color:"error"}),$.createElement("span",{style:{color:"red",alignSelf:"center"}},this.state.errorMessage)):null)}componentDidUpdate(){var e;(e=this.refDiv.current)!=null&&e.clientWidth&&this.refDiv.current.clientWidth!==this.state.width&&(this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{var t;this.resizeTimeout=null,this.setState({width:(t=this.refDiv.current)==null?void 0:t.clientWidth})},50))}getCurrentBreakpoint(){return this.state.width?this.state.width<600?"xs":this.state.width<900?"sm":this.state.width<1200?"md":this.state.width<1536?"lg":"xl":"md"}renderItem(){const{schema:e}=this.props;if(!this.state.value||!Array.isArray(this.state.value))return null;const t=this.getCurrentBreakpoint();let n;return t&&(e.useCardFor||["xs"]).includes(t)?n=this.renderCards():n=this.renderTable(),$.createElement("div",{ref:this.refDiv,style:{width:"100%"}},n)}}const vi={indeterminate:{opacity:.5},label:{width:"100%",fontSize:14,marginBottom:2},helper:{width:"100%",fontSize:12},error:{width:"100%",fontSize:12,color:"#FF0000"}};class od extends V{updateTimeout=null;async componentDidMount(){await super.componentDidMount();let e=V.getValue(this.props.data,this.props.attr);if(Array.isArray(e)&&this.props.oContext.multiEdit){e=V.DIFFERENT_VALUE,this.setState({value:e,oldValue:e,jsonError:!1});return}this.setState({value:e,oldValue:e,jsonError:this.validateJson(e)})}validateJson(e){let t=!1;if(this.props.schema.validateJson&&(e||!this.props.schema.allowEmpty))try{JSON.parse(e)}catch(n){console.log("Error in JSON",n),t=!0}return t}static getDerivedStateFromProps(e,t){if(e.oContext.multiEdit&&t.value===V.DIFFERENT_VALUE)return{value:V.DIFFERENT_VALUE};let n=V.getValue(e.data,e.attr);return n!=null&&(n=n.toString()),n==null||n!==t.value&&n!==t.oldValue?{value:n}:null}renderItem(e,t){const n=Array.isArray(this.state.value)||this.state.value===V.DIFFERENT_VALUE;if(this.props.schema.time){let s="";return typeof this.state.value=="number"?this.state.value&&this.state.value<9466596e5?s=new Date(this.state.value*1e3).toLocaleString():s=new Date(this.state.value).toLocaleString():typeof this.state.value=="string"&&(s=new Date(this.state.value).toLocaleString()),$.createElement(pe,{variant:"standard",fullWidth:!0,value:s,error:!!e||!!this.state.jsonError,disabled:!!t,slotProps:{htmlInput:{readOnly:!0}},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}if(this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=null,this.setState({oldValue:null})},30)):this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=null),n){const s=V.getValue(this.props.data,this.props.attr),d=(s==null?void 0:s.filter(o=>o||o===0).map(o=>({label:o.toString()||"",value:o})))||[];return d.unshift({label:P.I18n.t(V.DIFFERENT_LABEL),value:V.DIFFERENT_VALUE}),$.createElement(Wi,{style:vi.indeterminate,fullWidth:!0,value:d[0],onChange:(o,l)=>{const r=l?l.value:"",a=this.onChange(this.props.attr,r,()=>{this.setState({value:r,oldValue:r,jsonError:this.validateJson(l)})});a instanceof Promise&&a.catch(c=>console.error(`Cannot set value: ${c}`))},options:d,getOptionLabel:o=>o.label,renderInput:o=>$.createElement(pe,{variant:"standard",...o,error:!!e,placeholder:this.getText(this.props.schema.placeholder),slotProps:{htmlInput:{...o.inputProps,maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1}},label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:!!t})})}let h,i;if((this.props.schema.readOnly||t)&&this.props.schema.copyToClipboard?(this.props.schema.minRows>1&&(i={position:"absolute",right:3,top:20,zIndex:1e3}),h=$.createElement(se,{tabIndex:-1,style:i,size:"small",onClick:()=>{P.Utils.copyToClipboard(this.state.value),window.alert(P.I18n.t("ra_Copied"))}},$.createElement(P.IconCopy,null))):!this.props.schema.readOnly&&!t&&this.state.value&&!this.props.schema.noClearButton&&(this.props.schema.minRows>1&&(i={position:"absolute",right:3,top:20,zIndex:1e3}),h=$.createElement(se,{style:i,size:"small",tabIndex:-1,onClick:()=>this.setState({value:"",oldValue:this.state.value},()=>this.onChange(this.props.attr,""))},$.createElement(ht,null)),this.props.schema.minRows<=1&&(h=$.createElement(vn,{position:"end"},h))),this.props.schema.minRows>1){const s=this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation);return $.createElement("div",{style:{width:"100%",position:"relative"}},this.props.schema.label?$.createElement("div",{style:vi.label},this.getText(this.props.schema.label)):null,$.createElement(pc,{style:{width:"100%",resize:"vertical",backgroundColor:this.props.oContext.themeType==="dark"?"#363636":"#cccccc",color:this.props.oContext.themeType==="dark"?"#fff":"#111"},minRows:this.props.schema.minRows,maxRows:this.props.schema.maxRows,value:this.state.value??"",disabled:!!t,readOnly:this.props.schema.readOnly||!1,onChange:d=>{const o=d.target.value;this.setState({value:o,oldValue:this.state.value,jsonError:this.validateJson(o)},()=>this.onChange(this.props.attr,o||""))},placeholder:this.getText(this.props.schema.placeholder)}),s||e||this.state.jsonError?$.createElement("div",{style:e?vi.error:vi.helper},e||(this.state.jsonError?P.I18n.t("ra_Invalid JSON"):s)):null)}return $.createElement(pe,{variant:"standard",fullWidth:!0,value:this.state.value??"",error:!!e||!!this.state.jsonError,disabled:!!t,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:h}},onChange:s=>{const d=s.target.value;this.setState({value:d,oldValue:this.state.value,jsonError:this.validateJson(d)},()=>this.onChange(this.props.attr,d))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.state.jsonError?P.I18n.t("ra_Invalid JSON"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const ad={fullWidth:{width:"100%"}};class ld extends V{initialized=!1;localContext;async askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const n=await this.getPatternAsync(this.props.schema.jsonData,null,!0);try{e=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${n}`)}}e??=null;const t=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(t!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){const n=await this.props.oContext.socket.getState(`system.adapter.${t}.alive`);if(!(n!=null&&n.val)){window.alert(P.I18n.t("ra_Instance %s is not alive",t));return}}this.props.oContext.socket.sendTo(t,this.props.schema.command||"send",e).then(n=>{if(typeof n=="object"){const h=n;this.setState({text:h.text||"",style:h.style,icon:h.icon,iconStyle:h.iconStyle})}else typeof n=="string"&&this.setState({text:n||""})}).catch(n=>console.error(`Cannot send command: ${n}`))}}getLocalContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=V.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(){if(this.props.alive){const t=this.getLocalContext();(t!==this.localContext||!this.initialized)&&(this.localContext=t,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}if(this.state.text===void 0)return null;let e=null;return this.state.icon&&(e=Dt(this.state.icon,{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}),e||(e=$.createElement(P.Icon,{src:this.state.icon,style:{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}}))),this.props.schema.container==="text"?$.createElement(pe,{variant:"standard",fullWidth:!0,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?$.createElement(se,{tabIndex:-1,size:"small",onClick:()=>{P.Utils.copyToClipboard(this.state.text),window.alert(P.I18n.t("ra_Copied"))}},$.createElement(P.IconCopy,null)):void 0}},value:this.state.text,label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}):$.createElement("div",{style:{...ad.fullWidth,...this.state.style||void 0}},e,this.props.schema.container==="html"?$.createElement("span",{dangerouslySetInnerHTML:{__html:this.state.text||""}}):this.state.text)}}class cd extends V{async componentDidMount(){await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr);this.setState({value:e})}renderItem(e,t){const n=this.props.schema.returnFormat!=="HH:mm:ss",h=new Date(Date.parse(`Thu, 01 Jan 1970 ${this.state.value||"00:00:00"}`));return $.createElement(eh,{sx:i=>({width:"100%",borderBottom:`1px solid ${i.palette.text.primary}`,"& fieldset":{display:"none"},"& input":{padding:`${i.spacing(1.5)} 0 4px 0`},"& .MuiInputAdornment-root":{marginLeft:0,marginTop:1},"& label":{transform:"translate(0px, -9px) scale(0.75)"}}),ampm:this.props.oContext.systemConfig.dateFormat.includes("/"),timeSteps:this.props.schema.timeSteps||this.props.schema.timesteps||{hours:1,minutes:5,seconds:5},format:this.props.schema.format||"HH:mm:ss",disabled:!!t,value:h,onChange:i=>{let s;s=i instanceof Date?i.toTimeString().split(" ")[0]:i.toTimeString(),n&&(s=s.split(":").slice(0,2).join(":")),this.setState({value:s},()=>this.onChange(this.props.attr,this.state.value))},views:this.props.schema.views||["hours","minutes","seconds"],label:this.getText(this.props.schema.label)})}}function hd(m,e){let t;return e&&m.substring(0,e.length)===e?t=m.substring(e.length+1):t=m,t=t.replace(/\./g,"/").replace(/_/g," "),t}class ud extends V{async componentDidMount(){var t;await super.componentDidMount();const e=V.getValue(this.props.data,this.props.attr);if(!e&&((t=this.props.customObj)!=null&&t._id)){const n=hd(this.props.customObj._id,`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);this.setState({value:n})}else this.setState({value:e||""})}renderItem(e,t){return $.createElement(pe,{variant:"standard",fullWidth:!0,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},value:this.state.value,error:!!e,disabled:t,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),onChange:n=>{const h=n.target.value;this.setState({value:h},()=>this.onChange(this.props.attr,h))}})}}class pd extends V{async componentDidMount(){var t;await super.componentDidMount();const e=await this.getCachedObject("system.meta.uuid");this.setState({uuid:((t=e==null?void 0:e.native)==null?void 0:t.uuid)||"unknown"})}renderItem(e,t){return $.createElement(pe,{variant:"standard",fullWidth:!0,error:!!e,disabled:!!t,slotProps:{htmlInput:{readOnly:!0},input:{endAdornment:$.createElement(se,{tabIndex:-1,onClick:()=>{P.Utils.copyToClipboard(this.state.uuid),window.alert(P.I18n.t("ra_Copied %s",this.state.uuid))}},$.createElement(fn,null))}},value:this.state.uuid||"",label:this.getText(this.props.schema.label)||P.I18n.t("ra_Serial number (UUID)"),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const fo={icon:{width:16,height:16,marginRight:8}};class dd extends V{async componentDidMount(){await super.componentDidMount(),this.props.oContext.socket.getUsers().then(e=>{const t={},n=P.I18n.getLanguage();this.props.schema.short?e.forEach(h=>{var i,s;return t[h._id]={color:(i=h.common)==null?void 0:i.color,icon:(s=h.common)==null?void 0:s.icon,name:P.Utils.getObjectNameFromObj(h,n)}}):e.forEach(h=>{var i,s;return t[h._id.replace(/^system\.user\./,"")]={color:(i=h.common)==null?void 0:i.color,icon:(s=h.common)==null?void 0:s.icon,name:P.Utils.getObjectNameFromObj(h,n)}}),this.setState({users:t})}).catch(e=>console.error(`Cannot get users: ${e}`))}renderItem(e,t){var h,i;const n=V.getValue(this.props.data,this.props.attr);return $.createElement(fe,{variant:"standard",fullWidth:!0},this.state.users&&this.props.schema.label?$.createElement(_e,null,this.getText(this.props.schema.label)):null,this.state.users?$.createElement(Ne,{variant:"standard",error:!!e,disabled:!!t,value:n,renderValue:s=>{var d,o,l;return $.createElement("span",null,this.state.users&&((d=this.state.users[s])!=null&&d.icon)?$.createElement(P.Icon,{src:this.state.users&&((o=this.state.users[s])==null?void 0:o.icon),style:fo.icon}):null,this.state.users&&((l=this.state.users[s])==null?void 0:l.name)||s||"")},style:{color:this.state.users&&((h=this.state.users[n])==null?void 0:h.color)||void 0,backgroundColor:P.Utils.getInvertedColor(this.state.users&&((i=this.state.users[n])==null?void 0:i.color),this.props.oContext.themeType)},onChange:s=>this.onChange(this.props.attr,s.target.value)},this.state.users&&Object.keys(this.state.users).map(s=>$.createElement($e,{style:{color:this.state.users[s].color||void 0,backgroundColor:P.Utils.getInvertedColor(this.state.users[s].color,this.props.oContext.themeType)},key:s,value:s},this.state.users[s].icon?$.createElement(P.Icon,{src:this.state.users[s].icon,style:fo.icon}):null,this.state.users[s].name))):$.createElement(pe,{variant:"standard",error:!!e,disabled:!!t,value:n,onChange:s=>this.onChange(this.props.attr,s.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?$.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const rr=Symbol.for("yaml.alias"),Os=Symbol.for("yaml.document"),kt=Symbol.for("yaml.map"),oa=Symbol.for("yaml.pair"),ut=Symbol.for("yaml.scalar"),En=Symbol.for("yaml.seq"),qe=Symbol.for("yaml.node.type"),en=m=>!!m&&typeof m=="object"&&m[qe]===rr,Ui=m=>!!m&&typeof m=="object"&&m[qe]===Os,Zn=m=>!!m&&typeof m=="object"&&m[qe]===kt,Me=m=>!!m&&typeof m=="object"&&m[qe]===oa,ye=m=>!!m&&typeof m=="object"&&m[qe]===ut,qn=m=>!!m&&typeof m=="object"&&m[qe]===En;function Te(m){if(m&&typeof m=="object")switch(m[qe]){case kt:case En:return!0}return!1}function Le(m){if(m&&typeof m=="object")switch(m[qe]){case rr:case kt:case ut:case En:return!0}return!1}const aa=m=>(ye(m)||Te(m))&&!!m.anchor,zt=Symbol("break visit"),fd=Symbol("skip children"),jn=Symbol("remove node");function An(m,e){const t=gd(e);Ui(m)?un(null,m.contents,t,Object.freeze([m]))===jn&&(m.contents=null):un(null,m,t,Object.freeze([]))}An.BREAK=zt;An.SKIP=fd;An.REMOVE=jn;function un(m,e,t,n){const h=md(m,e,t,n);if(Le(h)||Me(h))return vd(m,n,h),un(m,h,t,n);if(typeof h!="symbol"){if(Te(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){const s=un(i,e.items[i],t,n);if(typeof s=="number")i=s-1;else{if(s===zt)return zt;s===jn&&(e.items.splice(i,1),i-=1)}}}else if(Me(e)){n=Object.freeze(n.concat(e));const i=un("key",e.key,t,n);if(i===zt)return zt;i===jn&&(e.key=null);const s=un("value",e.value,t,n);if(s===zt)return zt;s===jn&&(e.value=null)}}return h}function gd(m){return typeof m=="object"&&(m.Collection||m.Node||m.Value)?Object.assign({Alias:m.Node,Map:m.Node,Scalar:m.Node,Seq:m.Node},m.Value&&{Map:m.Value,Scalar:m.Value,Seq:m.Value},m.Collection&&{Map:m.Collection,Seq:m.Collection},m):m}function md(m,e,t,n){var h,i,s,d,o;if(typeof t=="function")return t(m,e,n);if(Zn(e))return(h=t.Map)==null?void 0:h.call(t,m,e,n);if(qn(e))return(i=t.Seq)==null?void 0:i.call(t,m,e,n);if(Me(e))return(s=t.Pair)==null?void 0:s.call(t,m,e,n);if(ye(e))return(d=t.Scalar)==null?void 0:d.call(t,m,e,n);if(en(e))return(o=t.Alias)==null?void 0:o.call(t,m,e,n)}function vd(m,e,t){const n=e[e.length-1];if(Te(n))n.items[m]=t;else if(Me(n))m==="key"?n.key=t:n.value=t;else if(Ui(n))n.contents=t;else{const h=en(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${h} parent`)}}const yd={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},bd=m=>m.replace(/[!,[\]{}]/g,e=>yd[e]);class We{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},We.defaultYaml,e),this.tags=Object.assign({},We.defaultTags,t)}clone(){const e=new We(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new We(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:We.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},We.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:We.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},We.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),h=n.shift();switch(h){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[i,s]=n;return this.tags[i]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[i]=n;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const s=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,s),!1}}default:return t(0,`Unknown directive ${h}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const s=e.slice(2,-1);return s==="!"||s==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),s)}const[,n,h]=e.match(/^(.*!)([^!]*)$/s);h||t(`The ${e} tag has no suffix`);const i=this.tags[n];if(i)try{return i+decodeURIComponent(h)}catch(s){return t(String(s)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+bd(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let h;if(e&&n.length>0&&Le(e.contents)){const i={};An(e.contents,(s,d)=>{Le(d)&&d.tag&&(i[d.tag]=!0)}),h=Object.keys(i)}else h=[];for(const[i,s]of n)i==="!!"&&s==="tag:yaml.org,2002:"||(!e||h.some(d=>d.startsWith(s)))&&t.push(`%TAG ${i} ${s}`);return t.join(`
1394
- `)}}We.defaultYaml={explicit:!1,version:"1.2"};We.defaultTags={"!!":"tag:yaml.org,2002:"};function la(m){if(/[\x00-\x19\s,[\]{}]/.test(m)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(m)}`;throw new Error(t)}return!0}function ca(m){const e=new Set;return An(m,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function ha(m,e){for(let t=1;;++t){const n=`${m}${t}`;if(!e.has(n))return n}}function wd(m,e){const t=[],n=new Map;let h=null;return{onAnchor:i=>{t.push(i),h??(h=ca(m));const s=ha(e,h);return h.add(s),s},setAnchors:()=>{for(const i of t){const s=n.get(i);if(typeof s=="object"&&s.anchor&&(ye(s.node)||Te(s.node)))s.node.anchor=s.anchor;else{const d=new Error("Failed to resolve repeated object (this should not happen)");throw d.source=i,d}}},sourceObjects:n}}function pn(m,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let h=0,i=n.length;h<i;++h){const s=n[h],d=pn(m,n,String(h),s);d===void 0?delete n[h]:d!==s&&(n[h]=d)}else if(n instanceof Map)for(const h of Array.from(n.keys())){const i=n.get(h),s=pn(m,n,h,i);s===void 0?n.delete(h):s!==i&&n.set(h,s)}else if(n instanceof Set)for(const h of Array.from(n)){const i=pn(m,n,h,h);i===void 0?n.delete(h):i!==h&&(n.delete(h),n.add(i))}else for(const[h,i]of Object.entries(n)){const s=pn(m,n,h,i);s===void 0?delete n[h]:s!==i&&(n[h]=s)}return m.call(e,t,n)}function Ze(m,e,t){if(Array.isArray(m))return m.map((n,h)=>Ze(n,String(h),t));if(m&&typeof m.toJSON=="function"){if(!t||!aa(m))return m.toJSON(e,t);const n={aliasCount:0,count:1,res:void 0};t.anchors.set(m,n),t.onCreate=i=>{n.res=i,delete t.onCreate};const h=m.toJSON(e,t);return t.onCreate&&t.onCreate(h),h}return typeof m=="bigint"&&!(t!=null&&t.keep)?Number(m):m}class or{constructor(e){Object.defineProperty(this,qe,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:h,reviver:i}={}){if(!Ui(e))throw new TypeError("A document argument is required");const s={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},d=Ze(this,"",s);if(typeof h=="function")for(const{count:o,res:l}of s.anchors.values())h(l,o);return typeof i=="function"?pn(i,{"":d},"",d):d}}class ar extends or{constructor(e){super(rr),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let n;t!=null&&t.aliasResolveCache?n=t.aliasResolveCache:(n=[],An(e,{Node:(i,s)=>{(en(s)||aa(s))&&n.push(s)}}),t&&(t.aliasResolveCache=n));let h;for(const i of n){if(i===this)break;i.anchor===this.source&&(h=i)}return h}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:h,maxAliasCount:i}=t,s=this.resolve(h,t);if(!s){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(o)}let d=n.get(s);if(d||(Ze(s,null,t),d=n.get(s)),(d==null?void 0:d.res)===void 0){const o="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(o)}if(i>=0&&(d.count+=1,d.aliasCount===0&&(d.aliasCount=xi(h,s,n)),d.count*d.aliasCount>i)){const o="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(o)}return d.res}toString(e,t,n){const h=`*${this.source}`;if(e){if(la(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${h} `}return h}}function xi(m,e,t){if(en(e)){const n=e.resolve(m),h=t&&n&&t.get(n);return h?h.count*h.aliasCount:0}else if(Te(e)){let n=0;for(const h of e.items){const i=xi(m,h,t);i>n&&(n=i)}return n}else if(Me(e)){const n=xi(m,e.key,t),h=xi(m,e.value,t);return Math.max(n,h)}return 1}const ua=m=>!m||typeof m!="function"&&typeof m!="object";class ae extends or{constructor(e){super(ut),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:Ze(this.value,e,t)}toString(){return String(this.value)}}ae.BLOCK_FOLDED="BLOCK_FOLDED";ae.BLOCK_LITERAL="BLOCK_LITERAL";ae.PLAIN="PLAIN";ae.QUOTE_DOUBLE="QUOTE_DOUBLE";ae.QUOTE_SINGLE="QUOTE_SINGLE";const Cd="tag:yaml.org,2002:";function Sd(m,e,t){if(e){const n=t.filter(i=>i.tag===e),h=n.find(i=>!i.format)??n[0];if(!h)throw new Error(`Tag ${e} not found`);return h}return t.find(n=>{var h;return((h=n.identify)==null?void 0:h.call(n,m))&&!n.format})}function Yn(m,e,t){var a,c,p;if(Ui(m)&&(m=m.contents),Le(m))return m;if(Me(m)){const u=(c=(a=t.schema[kt]).createNode)==null?void 0:c.call(a,t.schema,null,t);return u.items.push(m),u}(m instanceof String||m instanceof Number||m instanceof Boolean||typeof BigInt<"u"&&m instanceof BigInt)&&(m=m.valueOf());const{aliasDuplicateObjects:n,onAnchor:h,onTagObj:i,schema:s,sourceObjects:d}=t;let o;if(n&&m&&typeof m=="object"){if(o=d.get(m),o)return o.anchor??(o.anchor=h(m)),new ar(o.anchor);o={anchor:null,node:null},d.set(m,o)}e!=null&&e.startsWith("!!")&&(e=Cd+e.slice(2));let l=Sd(m,e,s.tags);if(!l){if(m&&typeof m.toJSON=="function"&&(m=m.toJSON()),!m||typeof m!="object"){const u=new ae(m);return o&&(o.node=u),u}l=m instanceof Map?s[kt]:Symbol.iterator in Object(m)?s[En]:s[kt]}i&&(i(l),delete t.onTagObj);const r=l!=null&&l.createNode?l.createNode(t.schema,m,t):typeof((p=l==null?void 0:l.nodeClass)==null?void 0:p.from)=="function"?l.nodeClass.from(t.schema,m,t):new ae(m);return e?r.tag=e:l.default||(r.tag=l.tag),o&&(o.node=r),r}function Bi(m,e,t){let n=t;for(let h=e.length-1;h>=0;--h){const i=e[h];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const s=[];s[i]=n,n=s}else n=new Map([[i,n]])}return Yn(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:m,sourceObjects:new Map})}const Nn=m=>m==null||typeof m=="object"&&!!m[Symbol.iterator]().next().done;class pa extends or{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>Le(n)||Me(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Nn(e))this.add(t);else{const[n,...h]=e,i=this.get(n,!0);if(Te(i))i.addIn(h,t);else if(i===void 0&&this.schema)this.set(n,Bi(this.schema,h,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${h}`)}}deleteIn(e){const[t,...n]=e;if(n.length===0)return this.delete(t);const h=this.get(t,!0);if(Te(h))return h.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...h]=e,i=this.get(n,!0);return h.length===0?!t&&ye(i)?i.value:i:Te(i)?i.getIn(h,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Me(t))return!1;const n=t.value;return n==null||e&&ye(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(n.length===0)return this.has(t);const h=this.get(t,!0);return Te(h)?h.hasIn(n):!1}setIn(e,t){const[n,...h]=e;if(h.length===0)this.set(n,t);else{const i=this.get(n,!0);if(Te(i))i.setIn(h,t);else if(i===void 0&&this.schema)this.set(n,Bi(this.schema,h,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${h}`)}}}const Ed=m=>m.replace(/^(?!$)(?: $)?/gm,"#");function vt(m,e){return/^\n+$/.test(m)?m.substring(1):e?m.replace(/^(?! *$)/gm,e):m}const Vt=(m,e,t)=>m.endsWith(`
1395
- `)?vt(t,e):t.includes(`
1396
- `)?`
1397
- `+vt(t,e):(m.endsWith(" ")?"":" ")+t,da="flow",Fs="block",_i="quoted";function Ki(m,e,t="flow",{indentAtStart:n,lineWidth:h=80,minContentWidth:i=20,onFold:s,onOverflow:d}={}){if(!h||h<0)return m;h<i&&(i=0);const o=Math.max(1+i,1+h-e.length);if(m.length<=o)return m;const l=[],r={};let a=h-e.length;typeof n=="number"&&(n>h-Math.max(2,i)?l.push(0):a=h-n);let c,p,u=!1,f=-1,g=-1,v=-1;t===Fs&&(f=go(m,f,e.length),f!==-1&&(a=f+o));for(let D;D=m[f+=1];){if(t===_i&&D==="\\"){switch(g=f,m[f+1]){case"x":f+=3;break;case"u":f+=5;break;case"U":f+=9;break;default:f+=1}v=f}if(D===`
1398
- `)t===Fs&&(f=go(m,f,e.length)),a=f+e.length+o,c=void 0;else{if(D===" "&&p&&p!==" "&&p!==`
1399
- `&&p!==" "){const E=m[f+1];E&&E!==" "&&E!==`
1400
- `&&E!==" "&&(c=f)}if(f>=a)if(c)l.push(c),a=c+o,c=void 0;else if(t===_i){for(;p===" "||p===" ";)p=D,D=m[f+=1],u=!0;const E=f>v+1?f-2:g-1;if(r[E])return m;l.push(E),r[E]=!0,a=E+o,c=void 0}else u=!0}p=D}if(u&&d&&d(),l.length===0)return m;s&&s();let b=m.slice(0,l[0]);for(let D=0;D<l.length;++D){const E=l[D],w=l[D+1]||m.length;E===0?b=`
1401
- ${e}${m.slice(0,w)}`:(t===_i&&r[E]&&(b+=`${m[E]}\\`),b+=`
1402
- ${e}${m.slice(E+1,w)}`)}return b}function go(m,e,t){let n=e,h=e+1,i=m[h];for(;i===" "||i===" ";)if(e<h+t)i=m[++e];else{do i=m[++e];while(i&&i!==`
1403
- `);n=e,h=e+1,i=m[h]}return n}const Gi=(m,e)=>({indentAtStart:e?m.indent.length:m.indentAtStart,lineWidth:m.options.lineWidth,minContentWidth:m.options.minContentWidth}),Ji=m=>/^(%|---|\.\.\.)/m.test(m);function Ad(m,e,t){if(!e||e<0)return!1;const n=e-t,h=m.length;if(h<=n)return!1;for(let i=0,s=0;i<h;++i)if(m[i]===`
1404
- `){if(i-s>n)return!0;if(s=i+1,h-s<=n)return!1}return!0}function Hn(m,e){const t=JSON.stringify(m);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:n}=e,h=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Ji(m)?" ":"");let s="",d=0;for(let o=0,l=t[o];l;l=t[++o])if(l===" "&&t[o+1]==="\\"&&t[o+2]==="n"&&(s+=t.slice(d,o)+"\\ ",o+=1,d=o,l="\\"),l==="\\")switch(t[o+1]){case"u":{s+=t.slice(d,o);const r=t.substr(o+2,4);switch(r){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:r.substr(0,2)==="00"?s+="\\x"+r.substr(2):s+=t.substr(o,6)}o+=5,d=o+1}break;case"n":if(n||t[o+2]==='"'||t.length<h)o+=1;else{for(s+=t.slice(d,o)+`
1405
-
1406
- `;t[o+2]==="\\"&&t[o+3]==="n"&&t[o+4]!=='"';)s+=`
1407
- `,o+=2;s+=i,t[o+2]===" "&&(s+="\\"),o+=1,d=o+1}break;default:o+=1}return s=d?s+t.slice(d):t,n?s:Ki(s,i,_i,Gi(e,!1))}function Rs(m,e){if(e.options.singleQuote===!1||e.implicitKey&&m.includes(`
1408
- `)||/[ \t]\n|\n[ \t]/.test(m))return Hn(m,e);const t=e.indent||(Ji(m)?" ":""),n="'"+m.replace(/'/g,"''").replace(/\n+/g,`$&
1409
- ${t}`)+"'";return e.implicitKey?n:Ki(n,t,da,Gi(e,!1))}function dn(m,e){const{singleQuote:t}=e.options;let n;if(t===!1)n=Hn;else{const h=m.includes('"'),i=m.includes("'");h&&!i?n=Rs:i&&!h?n=Hn:n=t?Rs:Hn}return n(m,e)}let Ns;try{Ns=new RegExp(`(^|(?<!
1410
- ))
1411
- +(?!
1412
- |$)`,"g")}catch{Ns=/\n+(?!\n|$)/g}function ki({comment:m,type:e,value:t},n,h,i){const{blockQuote:s,commentString:d,lineWidth:o}=n.options;if(!s||/\n[\t ]+$/.test(t))return dn(t,n);const l=n.indent||(n.forceBlockIndent||Ji(t)?" ":""),r=s==="literal"?!0:s==="folded"||e===ae.BLOCK_FOLDED?!1:e===ae.BLOCK_LITERAL?!0:!Ad(t,o,l.length);if(!t)return r?`|
1413
- `:`>
1414
- `;let a,c;for(c=t.length;c>0;--c){const w=t[c-1];if(w!==`
1415
- `&&w!==" "&&w!==" ")break}let p=t.substring(c);const u=p.indexOf(`
1416
- `);u===-1?a="-":t===p||u!==p.length-1?(a="+",i&&i()):a="",p&&(t=t.slice(0,-p.length),p[p.length-1]===`
1417
- `&&(p=p.slice(0,-1)),p=p.replace(Ns,`$&${l}`));let f=!1,g,v=-1;for(g=0;g<t.length;++g){const w=t[g];if(w===" ")f=!0;else if(w===`
1418
- `)v=g;else break}let b=t.substring(0,v<g?v+1:g);b&&(t=t.substring(b.length),b=b.replace(/\n+/g,`$&${l}`));let E=(f?l?"2":"1":"")+a;if(m&&(E+=" "+d(m.replace(/ ?[\r\n]+/g," ")),h&&h()),!r){const w=t.replace(/\n+/g,`
1419
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`);let y=!1;const A=Gi(n,!0);s!=="folded"&&e!==ae.BLOCK_FOLDED&&(A.onOverflow=()=>{y=!0});const T=Ki(`${b}${w}${p}`,l,Fs,A);if(!y)return`>${E}
1420
- ${l}${T}`}return t=t.replace(/\n+/g,`$&${l}`),`|${E}
1421
- ${l}${b}${t}${p}`}function Dd(m,e,t,n){const{type:h,value:i}=m,{actualString:s,implicitKey:d,indent:o,indentStep:l,inFlow:r}=e;if(d&&i.includes(`
1422
- `)||r&&/[[\]{},]/.test(i))return dn(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return d||r||!i.includes(`
1423
- `)?dn(i,e):ki(m,e,t,n);if(!d&&!r&&h!==ae.PLAIN&&i.includes(`
1424
- `))return ki(m,e,t,n);if(Ji(i)){if(o==="")return e.forceBlockIndent=!0,ki(m,e,t,n);if(d&&o===l)return dn(i,e)}const a=i.replace(/\n+/g,`$&
1425
- ${o}`);if(s){const c=f=>{var g;return f.default&&f.tag!=="tag:yaml.org,2002:str"&&((g=f.test)==null?void 0:g.test(a))},{compat:p,tags:u}=e.doc.schema;if(u.some(c)||p!=null&&p.some(c))return dn(i,e)}return d?a:Ki(a,o,da,Gi(e,!1))}function lr(m,e,t,n){const{implicitKey:h,inFlow:i}=e,s=typeof m.value=="string"?m:Object.assign({},m,{value:String(m.value)});let{type:d}=m;d!==ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(d=ae.QUOTE_DOUBLE);const o=r=>{switch(r){case ae.BLOCK_FOLDED:case ae.BLOCK_LITERAL:return h||i?dn(s.value,e):ki(s,e,t,n);case ae.QUOTE_DOUBLE:return Hn(s.value,e);case ae.QUOTE_SINGLE:return Rs(s.value,e);case ae.PLAIN:return Dd(s,e,t,n);default:return null}};let l=o(d);if(l===null){const{defaultKeyType:r,defaultStringType:a}=e.options,c=h&&r||a;if(l=o(c),l===null)throw new Error(`Unsupported default string type ${c}`)}return l}function fa(m,e){const t=Object.assign({blockQuote:!0,commentString:Ed,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},m.schema.toStringOptions,e);let n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:m,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function $d(m,e){var h;if(e.tag){const i=m.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let t,n;if(ye(e)){n=e.value;let i=m.filter(s=>{var d;return(d=s.identify)==null?void 0:d.call(s,n)});if(i.length>1){const s=i.filter(d=>d.test);s.length>0&&(i=s)}t=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else n=e,t=m.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!t){const i=((h=n==null?void 0:n.constructor)==null?void 0:h.name)??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return t}function xd(m,e,{anchors:t,doc:n}){if(!n.directives)return"";const h=[],i=(ye(m)||Te(m))&&m.anchor;i&&la(i)&&(t.add(i),h.push(`&${i}`));const s=m.tag??(e.default?null:e.tag);return s&&h.push(n.directives.tagString(s)),h.join(" ")}function wn(m,e,t,n){var o;if(Me(m))return m.toString(e,t,n);if(en(m)){if(e.doc.directives)return m.toString(e);if((o=e.resolvedAliases)!=null&&o.has(m))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(m):e.resolvedAliases=new Set([m]),m=m.resolve(e.doc)}let h;const i=Le(m)?m:e.doc.createNode(m,{onTagObj:l=>h=l});h??(h=$d(e.doc.schema.tags,i));const s=xd(i,h,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);const d=typeof h.stringify=="function"?h.stringify(i,e,t,n):ye(i)?lr(i,e,t,n):i.toString(e,t,n);return s?ye(i)||d[0]==="{"||d[0]==="["?`${s} ${d}`:`${s}
1426
- ${e.indent}${d}`:d}function _d({key:m,value:e},t,n,h){const{allNullValues:i,doc:s,indent:d,indentStep:o,options:{commentString:l,indentSeq:r,simpleKeys:a}}=t;let c=Le(m)&&m.comment||null;if(a){if(c)throw new Error("With simple keys, key nodes cannot have comments");if(Te(m)||!Le(m)&&typeof m=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let p=!a&&(!m||c&&e==null&&!t.inFlow||Te(m)||(ye(m)?m.type===ae.BLOCK_FOLDED||m.type===ae.BLOCK_LITERAL:typeof m=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!p&&(a||!i),indent:d+o});let u=!1,f=!1,g=wn(m,t,()=>u=!0,()=>f=!0);if(!p&&!t.inFlow&&g.length>1024){if(a)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(t.inFlow){if(i||e==null)return u&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(i&&!a||e==null&&p)return g=`? ${g}`,c&&!u?g+=Vt(g,t.indent,l(c)):f&&h&&h(),g;u&&(c=null),p?(c&&(g+=Vt(g,t.indent,l(c))),g=`? ${g}
1427
- ${d}:`):(g=`${g}:`,c&&(g+=Vt(g,t.indent,l(c))));let v,b,D;Le(e)?(v=!!e.spaceBefore,b=e.commentBefore,D=e.comment):(v=!1,b=null,D=null,e&&typeof e=="object"&&(e=s.createNode(e))),t.implicitKey=!1,!p&&!c&&ye(e)&&(t.indentAtStart=g.length+1),f=!1,!r&&o.length>=2&&!t.inFlow&&!p&&qn(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let E=!1;const w=wn(e,t,()=>E=!0,()=>f=!0);let y=" ";if(c||v||b){if(y=v?`
1428
- `:"",b){const A=l(b);y+=`
1429
- ${vt(A,t.indent)}`}w===""&&!t.inFlow?y===`
1430
- `&&D&&(y=`
1431
-
1432
- `):y+=`
1433
- ${t.indent}`}else if(!p&&Te(e)){const A=w[0],T=w.indexOf(`
1434
- `),x=T!==-1,M=t.inFlow??e.flow??e.items.length===0;if(x||!M){let O=!1;if(x&&(A==="&"||A==="!")){let _=w.indexOf(" ");A==="&"&&_!==-1&&_<T&&w[_+1]==="!"&&(_=w.indexOf(" ",_+1)),(_===-1||T<_)&&(O=!0)}O||(y=`
1435
- ${t.indent}`)}}else(w===""||w[0]===`
1436
- `)&&(y="");return g+=y+w,t.inFlow?E&&n&&n():D&&!E?g+=Vt(g,t.indent,l(D)):f&&h&&h(),g}function ga(m,e){(m==="debug"||m==="warn")&&console.warn(e)}const yi="<<",wt={identify:m=>m===yi||typeof m=="symbol"&&m.description===yi,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ae(Symbol(yi)),{addToJSMap:ma}),stringify:()=>yi},kd=(m,e)=>(wt.identify(e)||ye(e)&&(!e.type||e.type===ae.PLAIN)&&wt.identify(e.value))&&(m==null?void 0:m.doc.schema.tags.some(t=>t.tag===wt.tag&&t.default));function ma(m,e,t){if(t=m&&en(t)?t.resolve(m.doc):t,qn(t))for(const n of t.items)Cs(m,e,n);else if(Array.isArray(t))for(const n of t)Cs(m,e,n);else Cs(m,e,t)}function Cs(m,e,t){const n=m&&en(t)?t.resolve(m.doc):t;if(!Zn(n))throw new Error("Merge sources must be maps or map aliases");const h=n.toJSON(null,m,Map);for(const[i,s]of h)e instanceof Map?e.has(i)||e.set(i,s):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function va(m,e,{key:t,value:n}){if(Le(t)&&t.addToJSMap)t.addToJSMap(m,e,n);else if(kd(m,t))ma(m,e,n);else{const h=Ze(t,"",m);if(e instanceof Map)e.set(h,Ze(n,h,m));else if(e instanceof Set)e.add(h);else{const i=Td(t,h,m),s=Ze(n,i,m);i in e?Object.defineProperty(e,i,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[i]=s}}return e}function Td(m,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Le(m)&&(t!=null&&t.doc)){const n=fa(t.doc,{});n.anchors=new Set;for(const i of t.anchors.keys())n.anchors.add(i.anchor);n.inFlow=!0,n.inStringifyKey=!0;const h=m.toString(n);if(!t.mapKeyWarned){let i=JSON.stringify(h);i.length>40&&(i=i.substring(0,36)+'..."'),ga(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return h}return JSON.stringify(e)}function cr(m,e,t){const n=Yn(m,void 0,t),h=Yn(e,void 0,t);return new He(n,h)}class He{constructor(e,t=null){Object.defineProperty(this,qe,{value:oa}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return Le(t)&&(t=t.clone(e)),Le(n)&&(n=n.clone(e)),new He(t,n)}toJSON(e,t){const n=t!=null&&t.mapAsMap?new Map:{};return va(t,n,this)}toString(e,t,n){return e!=null&&e.doc?_d(this,e,t,n):JSON.stringify(this)}}function ya(m,e,t){return(e.inFlow??m.flow?Md:Ld)(m,e,t)}function Ld({comment:m,items:e},t,{blockItemPrefix:n,flowChars:h,itemIndent:i,onChompKeep:s,onComment:d}){const{indent:o,options:{commentString:l}}=t,r=Object.assign({},t,{indent:i,type:null});let a=!1;const c=[];for(let u=0;u<e.length;++u){const f=e[u];let g=null;if(Le(f))!a&&f.spaceBefore&&c.push(""),Pi(t,c,f.commentBefore,a),f.comment&&(g=f.comment);else if(Me(f)){const b=Le(f.key)?f.key:null;b&&(!a&&b.spaceBefore&&c.push(""),Pi(t,c,b.commentBefore,a))}a=!1;let v=wn(f,r,()=>g=null,()=>a=!0);g&&(v+=Vt(v,i,l(g))),a&&g&&(a=!1),c.push(n+v)}let p;if(c.length===0)p=h.start+h.end;else{p=c[0];for(let u=1;u<c.length;++u){const f=c[u];p+=f?`
1437
- ${o}${f}`:`
1438
- `}}return m?(p+=`
1439
- `+vt(l(m),o),d&&d()):a&&s&&s(),p}function Md({items:m},e,{flowChars:t,itemIndent:n}){const{indent:h,indentStep:i,flowCollectionPadding:s,options:{commentString:d}}=e;n+=i;const o=Object.assign({},e,{indent:n,inFlow:!0,type:null});let l=!1,r=0;const a=[];for(let u=0;u<m.length;++u){const f=m[u];let g=null;if(Le(f))f.spaceBefore&&a.push(""),Pi(e,a,f.commentBefore,!1),f.comment&&(g=f.comment);else if(Me(f)){const b=Le(f.key)?f.key:null;b&&(b.spaceBefore&&a.push(""),Pi(e,a,b.commentBefore,!1),b.comment&&(l=!0));const D=Le(f.value)?f.value:null;D?(D.comment&&(g=D.comment),D.commentBefore&&(l=!0)):f.value==null&&(b!=null&&b.comment)&&(g=b.comment)}g&&(l=!0);let v=wn(f,o,()=>g=null);l||(l=a.length>r||v.includes(`
1440
- `)),u<m.length-1?v+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=a.reduce((b,D)=>b+D.length+2,2)+(v.length+2)>e.options.lineWidth)),l&&(v+=",")),g&&(v+=Vt(v,n,d(g))),a.push(v),r=a.length}const{start:c,end:p}=t;if(a.length===0)return c+p;if(!l){const u=a.reduce((f,g)=>f+g.length+2,2);l=e.options.lineWidth>0&&u>e.options.lineWidth}if(l){let u=c;for(const f of a)u+=f?`
1441
- ${i}${h}${f}`:`
1442
- `;return`${u}
1443
- ${h}${p}`}else return`${c}${s}${a.join(" ")}${s}${p}`}function Pi({indent:m,options:{commentString:e}},t,n,h){if(n&&h&&(n=n.replace(/^\n+/,"")),n){const i=vt(e(n),m);t.push(i.trimStart())}}function Ut(m,e){const t=ye(e)?e.value:e;for(const n of m)if(Me(n)&&(n.key===e||n.key===t||ye(n.key)&&n.key.value===t))return n}class Xe extends pa{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(kt,e),this.items=[]}static from(e,t,n){const{keepUndefined:h,replacer:i}=n,s=new this(e),d=(o,l)=>{if(typeof i=="function")l=i.call(t,o,l);else if(Array.isArray(i)&&!i.includes(o))return;(l!==void 0||h)&&s.items.push(cr(o,l,n))};if(t instanceof Map)for(const[o,l]of t)d(o,l);else if(t&&typeof t=="object")for(const o of Object.keys(t))d(o,t[o]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,t){var s;let n;Me(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new He(e,e==null?void 0:e.value):n=new He(e.key,e.value);const h=Ut(this.items,n.key),i=(s=this.schema)==null?void 0:s.sortMapEntries;if(h){if(!t)throw new Error(`Key ${n.key} already set`);ye(h.value)&&ua(n.value)?h.value.value=n.value:h.value=n.value}else if(i){const d=this.items.findIndex(o=>i(n,o)<0);d===-1?this.items.push(n):this.items.splice(d,0,n)}else this.items.push(n)}delete(e){const t=Ut(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const n=Ut(this.items,e),h=n==null?void 0:n.value;return(!t&&ye(h)?h.value:h)??void 0}has(e){return!!Ut(this.items,e)}set(e,t){this.add(new He(e,t),!0)}toJSON(e,t,n){const h=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(h);for(const i of this.items)va(t,h,i);return h}toString(e,t,n){if(!e)return JSON.stringify(this);for(const h of this.items)if(!Me(h))throw new Error(`Map items must all be pairs; found ${JSON.stringify(h)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ya(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const Dn={collection:"map",default:!0,nodeClass:Xe,tag:"tag:yaml.org,2002:map",resolve(m,e){return Zn(m)||e("Expected a mapping for this tag"),m},createNode:(m,e,t)=>Xe.from(m,e,t)};class Xt extends pa{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(En,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=bi(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const n=bi(e);if(typeof n!="number")return;const h=this.items[n];return!t&&ye(h)?h.value:h}has(e){const t=bi(e);return typeof t=="number"&&t<this.items.length}set(e,t){const n=bi(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);const h=this.items[n];ye(h)&&ua(t)?h.value=t:this.items[n]=t}toJSON(e,t){const n=[];t!=null&&t.onCreate&&t.onCreate(n);let h=0;for(const i of this.items)n.push(Ze(i,String(h++),t));return n}toString(e,t,n){return e?ya(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:h}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let s=0;for(let d of t){if(typeof h=="function"){const o=t instanceof Set?d:String(s++);d=h.call(t,o,d)}i.items.push(Yn(d,void 0,n))}}return i}}function bi(m){let e=ye(m)?m.value:m;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const $n={collection:"seq",default:!0,nodeClass:Xt,tag:"tag:yaml.org,2002:seq",resolve(m,e){return qn(m)||e("Expected a sequence for this tag"),m},createNode:(m,e,t)=>Xt.from(m,e,t)},Yi={identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:m=>m,stringify(m,e,t,n){return e=Object.assign({actualString:!0},e),lr(m,e,t,n)}},Qi={identify:m=>m==null,createNode:()=>new ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ae(null),stringify:({source:m},e)=>typeof m=="string"&&Qi.test.test(m)?m:e.options.nullStr},hr={identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:m=>new ae(m[0]==="t"||m[0]==="T"),stringify({source:m,value:e},t){if(m&&hr.test.test(m)){const n=m[0]==="t"||m[0]==="T";if(e===n)return m}return e?t.options.trueStr:t.options.falseStr}};function ot({format:m,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);const h=typeof n=="number"?n:Number(n);if(!isFinite(h))return isNaN(h)?".nan":h<0?"-.inf":".inf";let i=Object.is(n,-0)?"-0":JSON.stringify(n);if(!m&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let s=i.indexOf(".");s<0&&(s=i.length,i+=".");let d=e-(i.length-s-1);for(;d-- >0;)i+="0"}return i}const ba={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:m=>m.slice(-3).toLowerCase()==="nan"?NaN:m[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ot},wa={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:m=>parseFloat(m),stringify(m){const e=Number(m.value);return isFinite(e)?e.toExponential():ot(m)}},Ca={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(m){const e=new ae(parseFloat(m)),t=m.indexOf(".");return t!==-1&&m[m.length-1]==="0"&&(e.minFractionDigits=m.length-t-1),e},stringify:ot},Xi=m=>typeof m=="bigint"||Number.isInteger(m),ur=(m,e,t,{intAsBigInt:n})=>n?BigInt(m):parseInt(m.substring(e),t);function Sa(m,e,t){const{value:n}=m;return Xi(n)&&n>=0?t+n.toString(e):ot(m)}const Ea={identify:m=>Xi(m)&&m>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(m,e,t)=>ur(m,2,8,t),stringify:m=>Sa(m,8,"0o")},Aa={identify:Xi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(m,e,t)=>ur(m,0,10,t),stringify:ot},Da={identify:m=>Xi(m)&&m>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(m,e,t)=>ur(m,2,16,t),stringify:m=>Sa(m,16,"0x")},Id=[Dn,$n,Yi,Qi,hr,Ea,Aa,Da,ba,wa,Ca];function mo(m){return typeof m=="bigint"||Number.isInteger(m)}const wi=({value:m})=>JSON.stringify(m),Od=[{identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:m=>m,stringify:wi},{identify:m=>m==null,createNode:()=>new ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:wi},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:m=>m==="true",stringify:wi},{identify:mo,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(m,e,{intAsBigInt:t})=>t?BigInt(m):parseInt(m,10),stringify:({value:m})=>mo(m)?m.toString():JSON.stringify(m)},{identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:m=>parseFloat(m),stringify:wi}],Fd={default:!0,tag:"",test:/^/,resolve(m,e){return e(`Unresolved plain scalar ${JSON.stringify(m)}`),m}},Rd=[Dn,$n].concat(Od,Fd),pr={identify:m=>m instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(m,e){if(typeof atob=="function"){const t=atob(m.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let h=0;h<t.length;++h)n[h]=t.charCodeAt(h);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),m},stringify({comment:m,type:e,value:t},n,h,i){if(!t)return"";const s=t;let d;if(typeof btoa=="function"){let o="";for(let l=0;l<s.length;++l)o+=String.fromCharCode(s[l]);d=btoa(o)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=ae.BLOCK_LITERAL),e!==ae.QUOTE_DOUBLE){const o=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(d.length/o),r=new Array(l);for(let a=0,c=0;a<l;++a,c+=o)r[a]=d.substr(c,o);d=r.join(e===ae.BLOCK_LITERAL?`
1444
- `:" ")}return lr({comment:m,type:e,value:d},n,h,i)}};function $a(m,e){if(qn(m))for(let t=0;t<m.items.length;++t){let n=m.items[t];if(!Me(n)){if(Zn(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");const h=n.items[0]||new He(new ae(null));if(n.commentBefore&&(h.key.commentBefore=h.key.commentBefore?`${n.commentBefore}
1445
- ${h.key.commentBefore}`:n.commentBefore),n.comment){const i=h.value??h.key;i.comment=i.comment?`${n.comment}
1446
- ${i.comment}`:n.comment}n=h}m.items[t]=Me(n)?n:new He(n)}}else e("Expected a sequence for this tag");return m}function xa(m,e,t){const{replacer:n}=t,h=new Xt(m);h.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(i++),s));let d,o;if(Array.isArray(s))if(s.length===2)d=s[0],o=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){const l=Object.keys(s);if(l.length===1)d=l[0],o=s[d];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else d=s;h.items.push(cr(d,o,t))}return h}const dr={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:$a,createNode:xa};class gn extends Xt{constructor(){super(),this.add=Xe.prototype.add.bind(this),this.delete=Xe.prototype.delete.bind(this),this.get=Xe.prototype.get.bind(this),this.has=Xe.prototype.has.bind(this),this.set=Xe.prototype.set.bind(this),this.tag=gn.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(const h of this.items){let i,s;if(Me(h)?(i=Ze(h.key,"",t),s=Ze(h.value,i,t)):i=Ze(h,"",t),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,s)}return n}static from(e,t,n){const h=xa(e,t,n),i=new this;return i.items=h.items,i}}gn.tag="tag:yaml.org,2002:omap";const fr={collection:"seq",identify:m=>m instanceof Map,nodeClass:gn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(m,e){const t=$a(m,e),n=[];for(const{key:h}of t.items)ye(h)&&(n.includes(h.value)?e(`Ordered maps must not include duplicate keys: ${h.value}`):n.push(h.value));return Object.assign(new gn,t)},createNode:(m,e,t)=>gn.from(m,e,t)};function _a({value:m,source:e},t){return e&&(m?ka:Ta).test.test(e)?e:m?t.options.trueStr:t.options.falseStr}const ka={identify:m=>m===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ae(!0),stringify:_a},Ta={identify:m=>m===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ae(!1),stringify:_a},Nd={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:m=>m.slice(-3).toLowerCase()==="nan"?NaN:m[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ot},Bd={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:m=>parseFloat(m.replace(/_/g,"")),stringify(m){const e=Number(m.value);return isFinite(e)?e.toExponential():ot(m)}},Pd={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(m){const e=new ae(parseFloat(m.replace(/_/g,""))),t=m.indexOf(".");if(t!==-1){const n=m.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:ot},ei=m=>typeof m=="bigint"||Number.isInteger(m);function Zi(m,e,t,{intAsBigInt:n}){const h=m[0];if((h==="-"||h==="+")&&(e+=1),m=m.substring(e).replace(/_/g,""),n){switch(t){case 2:m=`0b${m}`;break;case 8:m=`0o${m}`;break;case 16:m=`0x${m}`;break}const s=BigInt(m);return h==="-"?BigInt(-1)*s:s}const i=parseInt(m,t);return h==="-"?-1*i:i}function gr(m,e,t){const{value:n}=m;if(ei(n)){const h=n.toString(e);return n<0?"-"+t+h.substr(1):t+h}return ot(m)}const Wd={identify:ei,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(m,e,t)=>Zi(m,2,2,t),stringify:m=>gr(m,2,"0b")},jd={identify:ei,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(m,e,t)=>Zi(m,1,8,t),stringify:m=>gr(m,8,"0")},Hd={identify:ei,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(m,e,t)=>Zi(m,0,10,t),stringify:ot},zd={identify:ei,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(m,e,t)=>Zi(m,2,16,t),stringify:m=>gr(m,16,"0x")};class mn extends Xe{constructor(e){super(e),this.tag=mn.tag}add(e){let t;Me(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new He(e.key,null):t=new He(e,null),Ut(this.items,t.key)||this.items.push(t)}get(e,t){const n=Ut(this.items,e);return!t&&Me(n)?ye(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const n=Ut(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new He(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){const{replacer:h}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let s of t)typeof h=="function"&&(s=h.call(t,s,s)),i.items.push(cr(s,null,n));return i}}mn.tag="tag:yaml.org,2002:set";const mr={collection:"map",identify:m=>m instanceof Set,nodeClass:mn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(m,e,t)=>mn.from(m,e,t),resolve(m,e){if(Zn(m)){if(m.hasAllNullValues(!0))return Object.assign(new mn,m);e("Set items must all have null values")}else e("Expected a mapping for this tag");return m}};function vr(m,e){const t=m[0],n=t==="-"||t==="+"?m.substring(1):m,h=s=>e?BigInt(s):Number(s),i=n.replace(/_/g,"").split(":").reduce((s,d)=>s*h(60)+h(d),h(0));return t==="-"?h(-1)*i:i}function La(m){let{value:e}=m,t=s=>s;if(typeof e=="bigint")t=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return ot(m);let n="";e<0&&(n="-",e*=t(-1));const h=t(60),i=[e%h];return e<60?i.unshift(0):(e=(e-i[0])/h,i.unshift(e%h),e>=60&&(e=(e-i[0])/h,i.unshift(e))),n+i.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Ma={identify:m=>typeof m=="bigint"||Number.isInteger(m),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(m,e,{intAsBigInt:t})=>vr(m,t),stringify:La},Ia={identify:m=>typeof m=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:m=>vr(m,!1),stringify:La},qi={identify:m=>m instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(m){const e=m.match(qi.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,n,h,i,s,d]=e.map(Number),o=e[7]?Number((e[7]+"00").substr(1,3)):0;let l=Date.UTC(t,n-1,h,i||0,s||0,d||0,o);const r=e[8];if(r&&r!=="Z"){let a=vr(r,!1);Math.abs(a)<30&&(a*=60),l-=6e4*a}return new Date(l)},stringify:({value:m})=>(m==null?void 0:m.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},vo=[Dn,$n,Yi,Qi,ka,Ta,Wd,jd,Hd,zd,Nd,Bd,Pd,pr,wt,fr,dr,mr,Ma,Ia,qi],yo=new Map([["core",Id],["failsafe",[Dn,$n,Yi]],["json",Rd],["yaml11",vo],["yaml-1.1",vo]]),bo={binary:pr,bool:hr,float:Ca,floatExp:wa,floatNaN:ba,floatTime:Ia,int:Aa,intHex:Da,intOct:Ea,intTime:Ma,map:Dn,merge:wt,null:Qi,omap:fr,pairs:dr,seq:$n,set:mr,timestamp:qi},Vd={"tag:yaml.org,2002:binary":pr,"tag:yaml.org,2002:merge":wt,"tag:yaml.org,2002:omap":fr,"tag:yaml.org,2002:pairs":dr,"tag:yaml.org,2002:set":mr,"tag:yaml.org,2002:timestamp":qi};function Ss(m,e,t){const n=yo.get(e);if(n&&!m)return t&&!n.includes(wt)?n.concat(wt):n.slice();let h=n;if(!h)if(Array.isArray(m))h=[];else{const i=Array.from(yo.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(m))for(const i of m)h=h.concat(i);else typeof m=="function"&&(h=m(h.slice()));return t&&(h=h.concat(wt)),h.reduce((i,s)=>{const d=typeof s=="string"?bo[s]:s;if(!d){const o=JSON.stringify(s),l=Object.keys(bo).map(r=>JSON.stringify(r)).join(", ");throw new Error(`Unknown custom tag ${o}; use one of ${l}`)}return i.includes(d)||i.push(d),i},[])}const Ud=(m,e)=>m.key<e.key?-1:m.key>e.key?1:0;class yr{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:h,schema:i,sortMapEntries:s,toStringDefaults:d}){this.compat=Array.isArray(e)?Ss(e,"compat"):e?Ss(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=h?Vd:{},this.tags=Ss(t,this.name,n),this.toStringOptions=d??null,Object.defineProperty(this,kt,{value:Dn}),Object.defineProperty(this,ut,{value:Yi}),Object.defineProperty(this,En,{value:$n}),this.sortMapEntries=typeof s=="function"?s:s===!0?Ud:null}clone(){const e=Object.create(yr.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Kd(m,e){var o;const t=[];let n=e.directives===!0;if(e.directives!==!1&&m.directives){const l=m.directives.toString(m);l?(t.push(l),n=!0):m.directives.docStart&&(n=!0)}n&&t.push("---");const h=fa(m,e),{commentString:i}=h.options;if(m.commentBefore){t.length!==1&&t.unshift("");const l=i(m.commentBefore);t.unshift(vt(l,""))}let s=!1,d=null;if(m.contents){if(Le(m.contents)){if(m.contents.spaceBefore&&n&&t.push(""),m.contents.commentBefore){const a=i(m.contents.commentBefore);t.push(vt(a,""))}h.forceBlockIndent=!!m.comment,d=m.contents.comment}const l=d?void 0:()=>s=!0;let r=wn(m.contents,h,()=>d=null,l);d&&(r+=Vt(r,"",i(d))),(r[0]==="|"||r[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${r}`:t.push(r)}else t.push(wn(m.contents,h));if((o=m.directives)!=null&&o.docEnd)if(m.comment){const l=i(m.comment);l.includes(`
1447
- `)?(t.push("..."),t.push(vt(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=m.comment;l&&s&&(l=l.replace(/^\n+/,"")),l&&((!s||d)&&t[t.length-1]!==""&&t.push(""),t.push(vt(i(l),"")))}return t.join(`
1448
- `)+`
1449
- `}class es{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,qe,{value:Os});let h=null;typeof t=="function"||Array.isArray(t)?h=t:n===void 0&&t&&(n=t,t=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:s}=i;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new We({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,h,n)}clone(){const e=Object.create(es.prototype,{[qe]:{value:Os}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Le(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ln(this.contents)&&this.contents.add(e)}addIn(e,t){ln(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=ca(this);e.anchor=!t||n.has(t)?ha(t||"a",n):t}return new ar(e.anchor)}createNode(e,t,n){let h;if(typeof t=="function")e=t.call({"":e},"",e),h=t;else if(Array.isArray(t)){const g=b=>typeof b=="number"||b instanceof String||b instanceof Number,v=t.filter(g).map(String);v.length>0&&(t=t.concat(v)),h=t}else n===void 0&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:s,flow:d,keepUndefined:o,onTagObj:l,tag:r}=n??{},{onAnchor:a,setAnchors:c,sourceObjects:p}=wd(this,s||"a"),u={aliasDuplicateObjects:i??!0,keepUndefined:o??!1,onAnchor:a,onTagObj:l,replacer:h,schema:this.schema,sourceObjects:p},f=Yn(e,r,u);return d&&Te(f)&&(f.flow=!0),c(),f}createPair(e,t,n={}){const h=this.createNode(e,null,n),i=this.createNode(t,null,n);return new He(h,i)}delete(e){return ln(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Nn(e)?this.contents==null?!1:(this.contents=null,!0):ln(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Te(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Nn(e)?!t&&ye(this.contents)?this.contents.value:this.contents:Te(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Te(this.contents)?this.contents.has(e):!1}hasIn(e){return Nn(e)?this.contents!==void 0:Te(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Bi(this.schema,[e],t):ln(this.contents)&&this.contents.set(e,t)}setIn(e,t){Nn(e)?this.contents=t:this.contents==null?this.contents=Bi(this.schema,Array.from(e),t):ln(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new We({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new We({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const h=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${h}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new yr(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:h,onAnchor:i,reviver:s}={}){const d={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof h=="number"?h:100},o=Ze(this.contents,t??"",d);if(typeof i=="function")for(const{count:l,res:r}of d.anchors.values())i(r,l);return typeof s=="function"?pn(s,{"":o},"",o):o}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Kd(this,e)}}function ln(m){if(Te(m))return!0;throw new Error("Expected a YAML collection as document contents")}class Oa extends Error{constructor(e,t,n,h){super(),this.name=e,this.code=n,this.message=h,this.pos=t}}class Bn extends Oa{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class Gd extends Oa{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const wo=(m,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(d=>e.linePos(d));const{line:n,col:h}=t.linePos[0];t.message+=` at line ${n}, column ${h}`;let i=h-1,s=m.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(i>=60&&s.length>80){const d=Math.min(i-39,s.length-79);s="…"+s.substring(d),i-=d-1}if(s.length>80&&(s=s.substring(0,79)+"…"),n>1&&/^ *$/.test(s.substring(0,i))){let d=m.substring(e.lineStarts[n-2],e.lineStarts[n-1]);d.length>80&&(d=d.substring(0,79)+`…
1450
- `),s=d+s}if(/[^ ]/.test(s)){let d=1;const o=t.linePos[1];(o==null?void 0:o.line)===n&&o.col>h&&(d=Math.max(1,Math.min(o.col-h,80-i)));const l=" ".repeat(i)+"^".repeat(d);t.message+=`:
1451
-
1452
- ${s}
1453
- ${l}
1454
- `}};function Cn(m,{flow:e,indicator:t,next:n,offset:h,onError:i,parentIndent:s,startOnNewline:d}){let o=!1,l=d,r=d,a="",c="",p=!1,u=!1,f=null,g=null,v=null,b=null,D=null,E=null,w=null;for(const T of m)switch(u&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&i(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),u=!1),f&&(l&&T.type!=="comment"&&T.type!=="newline"&&i(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),f=null),T.type){case"space":!e&&(t!=="doc-start"||(n==null?void 0:n.type)!=="flow-collection")&&T.source.includes(" ")&&(f=T),r=!0;break;case"comment":{r||i(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const x=T.source.substring(1)||" ";a?a+=c+x:a=x,c="",l=!1;break}case"newline":l?a?a+=T.source:(!E||t!=="seq-item-ind")&&(o=!0):c+=T.source,l=!0,p=!0,(g||v)&&(b=T),r=!0;break;case"anchor":g&&i(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&i(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=T,w??(w=T.offset),l=!1,r=!1,u=!0;break;case"tag":{v&&i(T,"MULTIPLE_TAGS","A node can have at most one tag"),v=T,w??(w=T.offset),l=!1,r=!1,u=!0;break}case t:(g||v)&&i(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),E&&i(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${e??"collection"}`),E=T,l=t==="seq-item-ind"||t==="explicit-key-ind",r=!1;break;case"comma":if(e){D&&i(T,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),D=T,l=!1,r=!1;break}default:i(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),l=!1,r=!1}const y=m[m.length-1],A=y?y.offset+y.source.length:h;return u&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&i(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f&&(l&&f.indent<=s||(n==null?void 0:n.type)==="block-map"||(n==null?void 0:n.type)==="block-seq")&&i(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:D,found:E,spaceBefore:o,comment:a,hasNewline:p,anchor:g,tag:v,newlineAfterProp:b,end:A,start:w??A}}function Qn(m){if(!m)return null;switch(m.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(m.source.includes(`
1455
- `))return!0;if(m.end){for(const e of m.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of m.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(Qn(e.key)||Qn(e.value))return!0}return!1;default:return!0}}function Bs(m,e,t){if((e==null?void 0:e.type)==="flow-collection"){const n=e.end[0];n.indent===m&&(n.source==="]"||n.source==="}")&&Qn(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Fa(m,e,t){const{uniqueKeys:n}=m.options;if(n===!1)return!1;const h=typeof n=="function"?n:(i,s)=>i===s||ye(i)&&ye(s)&&i.value===s.value;return e.some(i=>h(i.key,t))}const Co="All mapping items must start at the same column";function Jd({composeNode:m,composeEmptyNode:e},t,n,h,i){var r;const s=(i==null?void 0:i.nodeClass)??Xe,d=new s(t.schema);t.atRoot&&(t.atRoot=!1);let o=n.offset,l=null;for(const a of n.items){const{start:c,key:p,sep:u,value:f}=a,g=Cn(c,{indicator:"explicit-key-ind",next:p??(u==null?void 0:u[0]),offset:o,onError:h,parentIndent:n.indent,startOnNewline:!0}),v=!g.found;if(v){if(p&&(p.type==="block-seq"?h(o,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==n.indent&&h(o,"BAD_INDENT",Co)),!g.anchor&&!g.tag&&!u){l=g.end,g.comment&&(d.comment?d.comment+=`
1456
- `+g.comment:d.comment=g.comment);continue}(g.newlineAfterProp||Qn(p))&&h(p??c[c.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((r=g.found)==null?void 0:r.indent)!==n.indent&&h(o,"BAD_INDENT",Co);t.atKey=!0;const b=g.end,D=p?m(t,p,g,h):e(t,b,c,null,g,h);t.schema.compat&&Bs(n.indent,p,h),t.atKey=!1,Fa(t,d.items,D)&&h(b,"DUPLICATE_KEY","Map keys must be unique");const E=Cn(u??[],{indicator:"map-value-ind",next:f,offset:D.range[2],onError:h,parentIndent:n.indent,startOnNewline:!p||p.type==="block-scalar"});if(o=E.end,E.found){v&&((f==null?void 0:f.type)==="block-map"&&!E.hasNewline&&h(o,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&g.start<E.found.offset-1024&&h(D.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const w=f?m(t,f,E,h):e(t,o,u,null,E,h);t.schema.compat&&Bs(n.indent,f,h),o=w.range[2];const y=new He(D,w);t.options.keepSourceTokens&&(y.srcToken=a),d.items.push(y)}else{v&&h(D.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),E.comment&&(D.comment?D.comment+=`
1457
- `+E.comment:D.comment=E.comment);const w=new He(D);t.options.keepSourceTokens&&(w.srcToken=a),d.items.push(w)}}return l&&l<o&&h(l,"IMPOSSIBLE","Map comment with trailing content"),d.range=[n.offset,o,l??o],d}function Yd({composeNode:m,composeEmptyNode:e},t,n,h,i){const s=(i==null?void 0:i.nodeClass)??Xt,d=new s(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let o=n.offset,l=null;for(const{start:r,value:a}of n.items){const c=Cn(r,{indicator:"seq-item-ind",next:a,offset:o,onError:h,parentIndent:n.indent,startOnNewline:!0});if(!c.found)if(c.anchor||c.tag||a)(a==null?void 0:a.type)==="block-seq"?h(c.end,"BAD_INDENT","All sequence items must start at the same column"):h(o,"MISSING_CHAR","Sequence item without - indicator");else{l=c.end,c.comment&&(d.comment=c.comment);continue}const p=a?m(t,a,c,h):e(t,c.end,r,null,c,h);t.schema.compat&&Bs(n.indent,a,h),o=p.range[2],d.items.push(p)}return d.range=[n.offset,o,l??o],d}function ti(m,e,t,n){let h="";if(m){let i=!1,s="";for(const d of m){const{source:o,type:l}=d;switch(l){case"space":i=!0;break;case"comment":{t&&!i&&n(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const r=o.substring(1)||" ";h?h+=s+r:h=r,s="";break}case"newline":h&&(s+=o),i=!0;break;default:n(d,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=o.length}}return{comment:h,offset:e}}const Es="Block collections are not allowed within flow collections",As=m=>m&&(m.type==="block-map"||m.type==="block-seq");function Qd({composeNode:m,composeEmptyNode:e},t,n,h,i){var g;const s=n.start.source==="{",d=s?"flow map":"flow sequence",o=(i==null?void 0:i.nodeClass)??(s?Xe:Xt),l=new o(t.schema);l.flow=!0;const r=t.atRoot;r&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let a=n.offset+n.start.source.length;for(let v=0;v<n.items.length;++v){const b=n.items[v],{start:D,key:E,sep:w,value:y}=b,A=Cn(D,{flow:d,indicator:"explicit-key-ind",next:E??(w==null?void 0:w[0]),offset:a,onError:h,parentIndent:n.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!w&&!y){v===0&&A.comma?h(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`):v<n.items.length-1&&h(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${d}`),A.comment&&(l.comment?l.comment+=`
1458
- `+A.comment:l.comment=A.comment),a=A.end;continue}!s&&t.options.strict&&Qn(E)&&h(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(v===0)A.comma&&h(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`);else if(A.comma||h(A.start,"MISSING_CHAR",`Missing , between ${d} items`),A.comment){let T="";e:for(const x of D)switch(x.type){case"comma":case"space":break;case"comment":T=x.source.substring(1);break e;default:break e}if(T){let x=l.items[l.items.length-1];Me(x)&&(x=x.value??x.key),x.comment?x.comment+=`
1459
- `+T:x.comment=T,A.comment=A.comment.substring(T.length+1)}}if(!s&&!w&&!A.found){const T=y?m(t,y,A,h):e(t,A.end,w,null,A,h);l.items.push(T),a=T.range[2],As(y)&&h(T.range,"BLOCK_IN_FLOW",Es)}else{t.atKey=!0;const T=A.end,x=E?m(t,E,A,h):e(t,T,D,null,A,h);As(E)&&h(x.range,"BLOCK_IN_FLOW",Es),t.atKey=!1;const M=Cn(w??[],{flow:d,indicator:"map-value-ind",next:y,offset:x.range[2],onError:h,parentIndent:n.indent,startOnNewline:!1});if(M.found){if(!s&&!A.found&&t.options.strict){if(w)for(const k of w){if(k===M.found)break;if(k.type==="newline"){h(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<M.found.offset-1024&&h(M.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else y&&("source"in y&&((g=y.source)==null?void 0:g[0])===":"?h(y,"MISSING_CHAR",`Missing space after : in ${d}`):h(M.start,"MISSING_CHAR",`Missing , or : between ${d} items`));const O=y?m(t,y,M,h):M.found?e(t,M.end,w,null,M,h):null;O?As(y)&&h(O.range,"BLOCK_IN_FLOW",Es):M.comment&&(x.comment?x.comment+=`
1460
- `+M.comment:x.comment=M.comment);const _=new He(x,O);if(t.options.keepSourceTokens&&(_.srcToken=b),s){const k=l;Fa(t,k.items,x)&&h(T,"DUPLICATE_KEY","Map keys must be unique"),k.items.push(_)}else{const k=new Xe(t.schema);k.flow=!0,k.items.push(_);const S=(O??x).range;k.range=[x.range[0],S[1],S[2]],l.items.push(k)}a=O?O.range[2]:M.end}}const c=s?"}":"]",[p,...u]=n.end;let f=a;if((p==null?void 0:p.source)===c)f=p.offset+p.source.length;else{const v=d[0].toUpperCase()+d.substring(1),b=r?`${v} must end with a ${c}`:`${v} in block collection must be sufficiently indented and end with a ${c}`;h(a,r?"MISSING_CHAR":"BAD_INDENT",b),p&&p.source.length!==1&&u.unshift(p)}if(u.length>0){const v=ti(u,f,t.options.strict,h);v.comment&&(l.comment?l.comment+=`
1461
- `+v.comment:l.comment=v.comment),l.range=[n.offset,f,v.offset]}else l.range=[n.offset,f,f];return l}function Ds(m,e,t,n,h,i){const s=t.type==="block-map"?Jd(m,e,t,n,i):t.type==="block-seq"?Yd(m,e,t,n,i):Qd(m,e,t,n,i),d=s.constructor;return h==="!"||h===d.tagName?(s.tag=d.tagName,s):(h&&(s.tag=h),s)}function Xd(m,e,t,n,h){var c;const i=n.tag,s=i?e.directives.tagName(i.source,p=>h(i,"TAG_RESOLVE_FAILED",p)):null;if(t.type==="block-seq"){const{anchor:p,newlineAfterProp:u}=n,f=p&&i?p.offset>i.offset?p:i:p??i;f&&(!u||u.offset<f.offset)&&h(f,"MISSING_CHAR","Missing newline after block sequence props")}const d=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!i||!s||s==="!"||s===Xe.tagName&&d==="map"||s===Xt.tagName&&d==="seq")return Ds(m,e,t,h,s);let o=e.schema.tags.find(p=>p.tag===s&&p.collection===d);if(!o){const p=e.schema.knownTags[s];if((p==null?void 0:p.collection)===d)e.schema.tags.push(Object.assign({},p,{default:!1})),o=p;else return p?h(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${d} collection, but expects ${p.collection??"scalar"}`,!0):h(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),Ds(m,e,t,h,s)}const l=Ds(m,e,t,h,s,o),r=((c=o.resolve)==null?void 0:c.call(o,l,p=>h(i,"TAG_RESOLVE_FAILED",p),e.options))??l,a=Le(r)?r:new ae(r);return a.range=l.range,a.tag=s,o!=null&&o.format&&(a.format=o.format),a}function Zd(m,e,t){const n=e.offset,h=qd(e,m.options.strict,t);if(!h)return{value:"",type:null,comment:"",range:[n,n,n]};const i=h.mode===">"?ae.BLOCK_FOLDED:ae.BLOCK_LITERAL,s=e.source?ef(e.source):[];let d=s.length;for(let f=s.length-1;f>=0;--f){const g=s[f][1];if(g===""||g==="\r")d=f;else break}if(d===0){const f=h.chomp==="+"&&s.length>0?`
1462
- `.repeat(Math.max(1,s.length-1)):"";let g=n+h.length;return e.source&&(g+=e.source.length),{value:f,type:i,comment:h.comment,range:[n,g,g]}}let o=e.indent+h.indent,l=e.offset+h.length,r=0;for(let f=0;f<d;++f){const[g,v]=s[f];if(v===""||v==="\r")h.indent===0&&g.length>o&&(o=g.length);else{g.length<o&&t(l+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),h.indent===0&&(o=g.length),r=f,o===0&&!m.atRoot&&t(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=g.length+v.length+1}for(let f=s.length-1;f>=d;--f)s[f][0].length>o&&(d=f+1);let a="",c="",p=!1;for(let f=0;f<r;++f)a+=s[f][0].slice(o)+`
1463
- `;for(let f=r;f<d;++f){let[g,v]=s[f];l+=g.length+v.length+1;const b=v[v.length-1]==="\r";if(b&&(v=v.slice(0,-1)),v&&g.length<o){const E=`Block scalar lines must not be less indented than their ${h.indent?"explicit indentation indicator":"first line"}`;t(l-v.length-(b?2:1),"BAD_INDENT",E),g=""}i===ae.BLOCK_LITERAL?(a+=c+g.slice(o)+v,c=`
1464
- `):g.length>o||v[0]===" "?(c===" "?c=`
1465
- `:!p&&c===`
1466
- `&&(c=`
1467
-
1468
- `),a+=c+g.slice(o)+v,c=`
1469
- `,p=!0):v===""?c===`
1470
- `?a+=`
1471
- `:c=`
1472
- `:(a+=c+v,c=" ",p=!1)}switch(h.chomp){case"-":break;case"+":for(let f=d;f<s.length;++f)a+=`
1473
- `+s[f][0].slice(o);a[a.length-1]!==`
1474
- `&&(a+=`
1475
- `);break;default:a+=`
1476
- `}const u=n+h.length+e.source.length;return{value:a,type:i,comment:h.comment,range:[n,u,u]}}function qd({offset:m,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:h}=e[0],i=h[0];let s=0,d="",o=-1;for(let c=1;c<h.length;++c){const p=h[c];if(!d&&(p==="-"||p==="+"))d=p;else{const u=Number(p);!s&&u?s=u:o===-1&&(o=m+c)}}o!==-1&&n(o,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${h}`);let l=!1,r="",a=h.length;for(let c=1;c<e.length;++c){const p=e[c];switch(p.type){case"space":l=!0;case"newline":a+=p.source.length;break;case"comment":t&&!l&&n(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),a+=p.source.length,r=p.source.substring(1);break;case"error":n(p,"UNEXPECTED_TOKEN",p.message),a+=p.source.length;break;default:{const u=`Unexpected token in block scalar header: ${p.type}`;n(p,"UNEXPECTED_TOKEN",u);const f=p.source;f&&typeof f=="string"&&(a+=f.length)}}}return{mode:i,indent:s,chomp:d,comment:r,length:a}}function ef(m){const e=m.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),i=[n!=null&&n[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let s=1;s<e.length;s+=2)i.push([e[s],e[s+1]]);return i}function tf(m,e,t){const{offset:n,type:h,source:i,end:s}=m;let d,o;const l=(c,p,u)=>t(n+c,p,u);switch(h){case"scalar":d=ae.PLAIN,o=nf(i,l);break;case"single-quoted-scalar":d=ae.QUOTE_SINGLE,o=sf(i,l);break;case"double-quoted-scalar":d=ae.QUOTE_DOUBLE,o=rf(i,l);break;default:return t(m,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${h}`),{value:"",type:null,comment:"",range:[n,n+i.length,n+i.length]}}const r=n+i.length,a=ti(s,r,e,t);return{value:o,type:d,comment:a.comment,range:[n,r,a.offset]}}function nf(m,e){let t="";switch(m[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${m[0]}`;break}case"@":case"`":{t=`reserved character ${m[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Ra(m)}function sf(m,e){return(m[m.length-1]!=="'"||m.length===1)&&e(m.length,"MISSING_CHAR","Missing closing 'quote"),Ra(m.slice(1,-1)).replace(/''/g,"'")}function Ra(m){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
1477
- `,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
1478
- `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(m);if(!n)return m;let h=n[1],i=" ",s=e.lastIndex;for(t.lastIndex=s;n=t.exec(m);)n[1]===""?i===`
1479
- `?h+=i:i=`
1480
- `:(h+=i+n[1],i=" "),s=t.lastIndex;const d=/[ \t]*(.*)/sy;return d.lastIndex=s,n=d.exec(m),h+i+((n==null?void 0:n[1])??"")}function rf(m,e){let t="";for(let n=1;n<m.length-1;++n){const h=m[n];if(!(h==="\r"&&m[n+1]===`
1481
- `))if(h===`
1482
- `){const{fold:i,offset:s}=of(m,n);t+=i,n=s}else if(h==="\\"){let i=m[++n];const s=af[i];if(s)t+=s;else if(i===`
1483
- `)for(i=m[n+1];i===" "||i===" ";)i=m[++n+1];else if(i==="\r"&&m[n+1]===`
1484
- `)for(i=m[++n+1];i===" "||i===" ";)i=m[++n+1];else if(i==="x"||i==="u"||i==="U"){const d={x:2,u:4,U:8}[i];t+=lf(m,n+1,d,e),n+=d}else{const d=m.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),t+=d}}else if(h===" "||h===" "){const i=n;let s=m[n+1];for(;s===" "||s===" ";)s=m[++n+1];s!==`
1485
- `&&!(s==="\r"&&m[n+2]===`
1486
- `)&&(t+=n>i?m.slice(i,n+1):h)}else t+=h}return(m[m.length-1]!=='"'||m.length===1)&&e(m.length,"MISSING_CHAR",'Missing closing "quote'),t}function of(m,e){let t="",n=m[e+1];for(;(n===" "||n===" "||n===`
1487
- `||n==="\r")&&!(n==="\r"&&m[e+2]!==`
1488
- `);)n===`
1489
- `&&(t+=`
1490
- `),e+=1,n=m[e+1];return t||(t=" "),{fold:t,offset:e}}const af={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
1491
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function lf(m,e,t,n){const h=m.substr(e,t),s=h.length===t&&/^[0-9a-fA-F]+$/.test(h)?parseInt(h,16):NaN;if(isNaN(s)){const d=m.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),d}return String.fromCodePoint(s)}function Na(m,e,t,n){const{value:h,type:i,comment:s,range:d}=e.type==="block-scalar"?Zd(m,e,n):tf(e,m.options.strict,n),o=t?m.directives.tagName(t.source,a=>n(t,"TAG_RESOLVE_FAILED",a)):null;let l;m.options.stringKeys&&m.atKey?l=m.schema[ut]:o?l=cf(m.schema,h,o,t,n):e.type==="scalar"?l=hf(m,h,e,n):l=m.schema[ut];let r;try{const a=l.resolve(h,c=>n(t??e,"TAG_RESOLVE_FAILED",c),m.options);r=ye(a)?a:new ae(a)}catch(a){const c=a instanceof Error?a.message:String(a);n(t??e,"TAG_RESOLVE_FAILED",c),r=new ae(h)}return r.range=d,r.source=h,i&&(r.type=i),o&&(r.tag=o),l.format&&(r.format=l.format),s&&(r.comment=s),r}function cf(m,e,t,n,h){var d;if(t==="!")return m[ut];const i=[];for(const o of m.tags)if(!o.collection&&o.tag===t)if(o.default&&o.test)i.push(o);else return o;for(const o of i)if((d=o.test)!=null&&d.test(e))return o;const s=m.knownTags[t];return s&&!s.collection?(m.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(h(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),m[ut])}function hf({atKey:m,directives:e,schema:t},n,h,i){const s=t.tags.find(d=>{var o;return(d.default===!0||m&&d.default==="key")&&((o=d.test)==null?void 0:o.test(n))})||t[ut];if(t.compat){const d=t.compat.find(o=>{var l;return o.default&&((l=o.test)==null?void 0:l.test(n))})??t[ut];if(s.tag!==d.tag){const o=e.tagString(s.tag),l=e.tagString(d.tag),r=`Value may be parsed as either ${o} or ${l}`;i(h,"TAG_RESOLVE_FAILED",r,!0)}}return s}function uf(m,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let h=e[n];switch(h.type){case"space":case"comment":case"newline":m-=h.source.length;continue}for(h=e[++n];(h==null?void 0:h.type)==="space";)m+=h.source.length,h=e[++n];break}}return m}const pf={composeNode:Ba,composeEmptyNode:br};function Ba(m,e,t,n){const h=m.atKey,{spaceBefore:i,comment:s,anchor:d,tag:o}=t;let l,r=!0;switch(e.type){case"alias":l=df(m,e,n),(d||o)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Na(m,e,o,n),d&&(l.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Xd(pf,m,e,t,n),d&&(l.anchor=d.source.substring(1))}catch(a){const c=a instanceof Error?a.message:String(a);n(e,"RESOURCE_EXHAUSTION",c)}break;default:{const a=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",a),r=!1}}return l??(l=br(m,e.offset,void 0,null,t,n)),d&&l.anchor===""&&n(d,"BAD_ALIAS","Anchor cannot be an empty string"),h&&m.options.stringKeys&&(!ye(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(o??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),m.options.keepSourceTokens&&r&&(l.srcToken=e),l}function br(m,e,t,n,{spaceBefore:h,comment:i,anchor:s,tag:d,end:o},l){const r={type:"scalar",offset:uf(e,t,n),indent:-1,source:""},a=Na(m,r,d,l);return s&&(a.anchor=s.source.substring(1),a.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),h&&(a.spaceBefore=!0),i&&(a.comment=i,a.range[2]=o),a}function df({options:m},{offset:e,source:t,end:n},h){const i=new ar(t.substring(1));i.source===""&&h(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&h(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const s=e+t.length,d=ti(n,s,m.strict,h);return i.range=[e,s,d.offset],d.comment&&(i.comment=d.comment),i}function ff(m,e,{offset:t,start:n,value:h,end:i},s){const d=Object.assign({_directives:e},m),o=new es(void 0,d),l={atKey:!1,atRoot:!0,directives:o.directives,options:o.options,schema:o.schema},r=Cn(n,{indicator:"doc-start",next:h??(i==null?void 0:i[0]),offset:t,onError:s,parentIndent:0,startOnNewline:!0});r.found&&(o.directives.docStart=!0,h&&(h.type==="block-map"||h.type==="block-seq")&&!r.hasNewline&&s(r.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),o.contents=h?Ba(l,h,r,s):br(l,r.end,n,null,r,s);const a=o.contents.range[2],c=ti(i,a,!1,s);return c.comment&&(o.comment=c.comment),o.range=[t,a,c.offset],o}function Mn(m){if(typeof m=="number")return[m,m+1];if(Array.isArray(m))return m.length===2?m:[m[0],m[1]];const{offset:e,source:t}=m;return[e,e+(typeof t=="string"?t.length:1)]}function So(m){var h;let e="",t=!1,n=!1;for(let i=0;i<m.length;++i){const s=m[i];switch(s[0]){case"#":e+=(e===""?"":n?`
1492
-
1493
- `:`
1494
- `)+(s.substring(1)||" "),t=!0,n=!1;break;case"%":((h=m[i+1])==null?void 0:h[0])!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}class gf{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,h,i)=>{const s=Mn(t);i?this.warnings.push(new Gd(s,n,h)):this.errors.push(new Bn(s,n,h))},this.directives=new We({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:h}=So(this.prelude);if(n){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}
1495
- ${n}`:n;else if(h||e.directives.docStart||!i)e.commentBefore=n;else if(Te(i)&&!i.flow&&i.items.length>0){let s=i.items[0];Me(s)&&(s=s.key);const d=s.commentBefore;s.commentBefore=d?`${n}
1496
- ${d}`:n}else{const s=i.commentBefore;i.commentBefore=s?`${n}
1497
- ${s}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:So(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const h of e)yield*this.next(h);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,h)=>{const i=Mn(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,h)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=ff(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Bn(Mn(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new Bn(Mn(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const t=ti(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
1498
- ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Bn(Mn(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const n=Object.assign({_directives:this.directives},this.options),h=new es(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),h.range=[0,t,t],this.decorate(h,!1),yield h}}}const Pa="\uFEFF",Wa="",ja="",Ps="";function mf(m){switch(m){case Pa:return"byte-order-mark";case Wa:return"doc-mode";case ja:return"flow-error-end";case Ps:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
1499
- `:case`\r
1500
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(m[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function it(m){switch(m){case void 0:case" ":case`
1501
- `:case"\r":case" ":return!0;default:return!1}}const Eo=new Set("0123456789ABCDEFabcdef"),vf=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ci=new Set(",[]{}"),yf=new Set(` ,[]{}
1502
- \r `),$s=m=>!m||yf.has(m);class bf{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
1503
- `?!0:t==="\r"?this.buffer[e+1]===`
1504
- `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){const h=this.buffer[n+e+1];if(h===`
1505
- `||!h&&!this.atEnd)return e+n+1}return t===`
1506
- `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){const n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&it(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
1507
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Pa&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){const i=e[n-1];if(i===" "||i===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){const i=e[t-1];if(i===" "||i===" ")t-=1;else break}const h=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-h),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Wa,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&it(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!it(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&it(t)){const n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil($s),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const h=this.getLine();if(h===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&h[0]!=="#"||n===0&&(h.startsWith("---")||h.startsWith("..."))&&it(h[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(h[0]==="]"||h[0]==="}")))return this.flowLevel=0,yield ja,yield*this.parseLineStart();let i=0;for(;h[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),h[i]){case void 0:return"flow";case"#":return yield*this.pushCount(h.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil($s),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const s=this.charAt(1);if(this.flowKey||it(s)||s===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let i=0;for(;this.buffer[t-1-i]==="\\";)i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let h=n.indexOf(`
1508
- `,this.pos);if(h!==-1){for(;h!==-1;){const i=this.continueScalar(h+1);if(i===-1)break;h=n.indexOf(`
1509
- `,i)}h!==-1&&(t=h-(n[h-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>it(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let i=this.pos;n=this.buffer[i];++i)switch(n){case" ":t+=1;break;case`
1510
- `:e=i,t=0;break;case"\r":{const s=this.buffer[i+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
1511
- `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
1512
- `,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let h=e+1;for(n=this.buffer[h];n===" ";)n=this.buffer[++h];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
1513
- `;)n=this.buffer[++h];e=h-1}else if(!this.blockScalarKeep)do{let i=e-1,s=this.buffer[i];s==="\r"&&(s=this.buffer[--i]);const d=i;for(;s===" ";)s=this.buffer[--i];if(s===`
1514
- `&&i>=this.pos&&i+1+t>d)e=i;else break}while(!0);return yield Ps,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,n=this.pos-1,h;for(;h=this.buffer[++n];)if(h===":"){const i=this.buffer[n+1];if(it(i)||e&&Ci.has(i))break;t=n}else if(it(h)){let i=this.buffer[n+1];if(h==="\r"&&(i===`
1515
- `?(n+=1,h=`
1516
- `,i=this.buffer[n+1]):t=n),i==="#"||e&&Ci.has(i))break;if(h===`
1517
- `){const s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&Ci.has(h))break;t=n}return!h&&!this.atEnd?this.setNext("plain-scalar"):(yield Ps,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil($s))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(it(t)||e&&Ci.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!it(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(vf.has(t))t=this.buffer[++e];else if(t==="%"&&Eo.has(this.buffer[e+1])&&Eo.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
1518
- `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
1519
- `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");const h=t-this.pos;return h>0&&(yield this.buffer.substr(this.pos,h),this.pos=t),h}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class wf{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const i=t+n>>1;this.lineStarts[i]<e?t=i+1:n=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const h=this.lineStarts[t-1];return{line:t,col:e-h+1}}}}function xt(m,e){for(let t=0;t<m.length;++t)if(m[t].type===e)return!0;return!1}function Ao(m){for(let e=0;e<m.length;++e)switch(m[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Ha(m){switch(m==null?void 0:m.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Si(m){switch(m.type){case"document":return m.start;case"block-map":{const e=m.items[m.items.length-1];return e.sep??e.start}case"block-seq":return m.items[m.items.length-1].start;default:return[]}}function cn(m){var t;if(m.length===0)return[];let e=m.length;e:for(;--e>=0;)switch(m[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=m[++e])==null?void 0:t.type)==="space";);return m.splice(e,m.length)}function Do(m){if(m.start.type==="flow-seq-start")for(const e of m.items)e.sep&&!e.value&&!xt(e.start,"explicit-key-ind")&&!xt(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Ha(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Cf{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new bf,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=mf(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(e==null?void 0:e.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Do(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{const h=n.items[n.items.length-1];if(h.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(h.sep)h.value=t;else{Object.assign(h,{key:t,sep:[]}),this.onKeyLine=!h.explicitKey;return}break}case"block-seq":{const h=n.items[n.items.length-1];h.value?n.items.push({start:[],value:t}):h.value=t;break}case"flow-collection":{const h=n.items[n.items.length-1];!h||h.value?n.items.push({start:[],key:t,sep:[]}):h.sep?h.value=t:Object.assign(h,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const h=t.items[t.items.length-1];h&&!h.sep&&!h.value&&h.start.length>0&&Ao(h.start)===-1&&(t.indent===0||h.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(n.type==="document"?n.end=h.start:n.items.push({start:h.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Ao(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=Si(this.peek(2)),n=cn(t);let h;e.end?(h=e.end,h.push(this.sourceToken),delete e.end):h=[this.sourceToken];const i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:h}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
1520
- `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
1521
- `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var n;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const h="end"in t.value?t.value.end:void 0,i=Array.isArray(h)?h[h.length-1]:void 0;(i==null?void 0:i.type)==="comment"?h==null||h.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const h=e.items[e.items.length-2],i=(n=h==null?void 0:h.value)==null?void 0:n.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const h=!this.onKeyLine&&this.indent===e.indent,i=h&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let s=[];if(i&&t.sep&&!t.value){const d=[];for(let o=0;o<t.sep.length;++o){const l=t.sep[o];switch(l.type){case"newline":d.push(o);break;case"space":break;case"comment":l.indent>e.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(s=t.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(xt(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Ha(t.key)&&!xt(t.sep,"newline")){const d=cn(t.start),o=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:o,sep:l}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(xt(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const d=cn(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):xt(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);i||t.value?(e.items.push({start:s,key:d,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(d):(Object.assign(t,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(e);if(d){if(d.type==="block-seq"){if(!t.explicitKey&&t.sep&&!xt(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else h&&e.items.push({start:s});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var n;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const h="end"in t.value?t.value.end:void 0,i=Array.isArray(h)?h[h.length-1]:void 0;(i==null?void 0:i.type)==="comment"?h==null||h.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const h=e.items[e.items.length-2],i=(n=h==null?void 0:h.value)==null?void 0:n.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||xt(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const h=this.startBlockValue(e);if(h){this.stack.push(h);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while((n==null?void 0:n.type)==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const h=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:h,sep:[]}):t.sep?this.stack.push(h):Object.assign(t,{key:h,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){const h=Si(n),i=cn(h);Do(e);const s=e.end.splice(1,e.end.length);s.push(this.sourceToken);const d={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=d}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
1522
- `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
1523
- `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=Si(e),n=cn(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=Si(e),n=cn(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Sf(m){const e=m.prettyErrors!==!1;return{lineCounter:m.lineCounter||e&&new wf||null,prettyErrors:e}}function Ef(m,e={}){const{lineCounter:t,prettyErrors:n}=Sf(e),h=new Cf(t==null?void 0:t.addNewLine),i=new gf(e);let s=null;for(const d of i.compose(h.parse(m),!0,m.length))if(!s)s=d;else if(s.options.logLevel!=="silent"){s.errors.push(new Bn(d.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(s.errors.forEach(wo(m,t)),s.warnings.forEach(wo(m,t))),s}function Af(m,e,t){let n;const h=Ef(m,t);if(!h)return null;if(h.warnings.forEach(i=>ga(h.options.logLevel,i)),h.errors.length>0){if(h.options.logLevel!=="silent")throw h.errors[0];h.errors=[]}return h.toJS(Object.assign({reviver:n},t))}const xs={flex:{display:"flex"},button:{height:48,minWidth:48},wrapper:{width:"calc(100vw - 40px)",height:"calc(100vh - 188px)"}};class Df extends V{async componentDidMount(){await super.componentDidMount();const{data:e,attr:t}=this.props,n=V.getValue(e,t)||"";this.setState({value:n,initialized:!0,yamlError:this.validateYaml(n)})}validateYaml(e){let t=!1;if(this.props.schema.validateYaml!==!1&&(e||!this.props.schema.allowEmpty))try{Af(e)}catch(n){console.log("Error in YAML",n),t=!0}return t}renderItem(e,t){if(!this.state.initialized)return null;const{schema:n,data:h,attr:i}=this.props,{value:s,showSelectId:d}=this.state,o=n.readOnly===!0||t;return $.createElement(fe,{fullWidth:!0,variant:"standard"},$.createElement("div",{style:xs.flex},$.createElement(ve,{color:"grey",style:xs.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},P.I18n.t("ra_YAML editor"))),d?$.createElement(qs,{title:this.getText(n.label),overflowHidden:!0,applyDisabled:this.state.yamlError&&this.props.schema.doNotApplyWithError||o,onClose:()=>{o?this.setState({showSelectId:!1}):this.setState({showSelectId:!1,value:V.getValue(h,i)||""})},onApply:o?void 0:()=>this.setState({showSelectId:!1},()=>this.onChange(i,s))},$.createElement("div",{style:{...xs.wrapper,border:this.state.yamlError?"2px solid red":"2px solid transparent"}},$.createElement(sr,{mode:"yaml",value:typeof s=="object"?JSON.stringify(s):s,onChange:o?void 0:l=>this.setState({value:l,yamlError:this.validateYaml(l)}),name:"ConfigYamlEditor",themeType:this.props.oContext.themeType}))):null,n.help||this.state.yamlError?$.createElement(ge,null,this.state.yamlError?P.I18n.t("ra_Invalid YAML"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class $f extends V{async componentDidMount(){await super.componentDidMount();const e=await Uo(()=>import("./index-B5DqCD_a.js").then(t=>t.i),__vite__mapDeps([0,1,2,3]),import.meta.url);this.setState({QRCode:e.default})}renderItem(){const e=this.state.QRCode;if(!e)return null;const t=Math.max(32,Math.round((this.props.schema.size||256)*.15));return $.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:this.props.schema.bgColor||"white",padding:t,width:"100%",height:"100%"}},$.createElement(e,{title:this.getText(this.props.schema.tooltip),value:this.props.schema.data,size:this.props.schema.size,fgColor:this.props.schema.fgColor,bgColor:this.props.schema.bgColor,level:this.props.schema.level}))}}class xf extends V{initialized=!1;localContext;async componentDidMount(){await super.componentDidMount();const e=await Uo(()=>import("./index-B5DqCD_a.js").then(t=>t.i),__vite__mapDeps([0,1,2,3]),import.meta.url);this.setState({QRCode:e.default}),this.props.schema.sendFirstByClick||await this.askInstance()}async askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const n=await this.getPatternAsync(this.props.schema.jsonData,null,!0);if(n)try{e=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${JSON.stringify(e)}`)}}e===void 0&&(e=null);const t=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(t!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){const n=await this.props.oContext.socket.getState(`system.adapter.${t}.alive`);if(!(n!=null&&n.val)){window.alert(P.I18n.t("ra_Instance %s is not alive",t));return}}this.setState({loading:!0},()=>this.props.oContext.socket.sendTo(t,this.props.schema.command||"send",e).then(n=>this.setState({qrData:n||"",loading:!1})))}}getContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=V.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(){if(this.props.alive){const n=this.getContext();(n!==this.localContext||!this.initialized)&&(this.localContext=n,(!this.props.schema.sendFirstByClick||this.state.qrData!==void 0)&&setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}if(!this.state.qrData&&this.props.schema.sendFirstByClick)return this.props.alive?$.createElement("div",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",cursor:this.state.loading?"default":"pointer"},onClick:()=>!this.state.loading&&this.askInstance()},this.state.loading?$.createElement(Tt,null):typeof this.props.schema.sendFirstByClick=="boolean"?P.I18n.t("ra_Click to show"):this.getText(this.props.schema.sendFirstByClick,this.props.schema.noTranslation)):$.createElement("div",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",cursor:this.state.loading?"default":"pointer"},onClick:()=>!this.state.loading&&this.askInstance()},P.I18n.t("ra_Instance %s is not alive",this.props.oContext.instance.toString()));const e=this.state.QRCode;if(!e||this.state.qrData===void 0)return null;const t=Math.max(32,Math.round((this.props.schema.size||256)*.15));return $.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:this.props.schema.bgColor||"white",padding:t,width:"100%",height:"100%"}},$.createElement(e,{title:this.getText(this.props.schema.tooltip),value:this.state.qrData,size:this.props.schema.size,fgColor:this.props.schema.fgColor,bgColor:this.props.schema.bgColor,level:this.props.schema.level}))}}const _f={accordion:Sh,alive:Eh,autocomplete:Ah,autocompleteSendTo:Dh,certCollection:kh,certificate:xh,certificates:_h,checkbox:Lh,checkDocker:Th,checkLicense:$t,chip:Vr,chips:Vr,color:Rh,coordinates:Nh,credential:Zs,cron:$h,custom:Kn,datePicker:Bh,deviceManager:Ph,divider:Zp,file:Qh,fileSelector:Hi,func:Xh,header:ed,iframe:Zh,iframeSendTo:qh,image:nu,imageSendTo:tu,infoBox:iu,instance:su,interface:ru,ip:eu,jsonEditor:Lp,language:Ip,license:Op,number:Fp,oauth2:Rp,objectId:Np,password:Bp,pattern:Pp,port:jp,qrCode:$f,qrCodeSendTo:xf,room:Hp,select:zp,selectSendTo:Up,sendto:ro,sendTo:ro,setState:Jp,slider:Yp,state:Xp,staticImage:td,staticInfo:nd,staticLink:uo,staticText:uo,table:Qe,text:od,textSendTo:ld,timePicker:cd,topic:ud,uuid:pd,user:dd,yamlEditor:Df},lt={fullWidth:{width:"100%"},paper:{margin:1,width:"auto !important",overflowY:"auto",paddingBottom:1},paperWithIcons:{height:"calc(100vh - 259px) !important"},paperWithoutIcons:{height:"calc(100vh - 235px) !important"},padding:{padding:"10px"},heading:{},primary:m=>({backgroundColor:m.palette.primary.main,color:m.palette.mode==="dark"?"inherit":"#FFF"}),secondary:m=>({backgroundColor:m.palette.secondary.main})};class tn extends V{async componentDidMount(){var e;await super.componentDidMount(),(e=this.props.schema)!=null&&e.collapsable&&this.setState({expanded:(window._localStorage||window.localStorage).getItem(`${this.props.oContext.adapterName}.${this.props.attr}`)==="true"})}renderItems(e,t){return e?Object.keys(e).map(n=>{if(this.props.oContext.multiEdit&&e[n].noMultiEdit)return null;const h=e[n].type||"panel";let i,s="Use this.props.oContext.socket!";if(h==="custom")e[n].url?i=Kn:this.props.oContext.customs&&this.props.oContext.customs[e[n].component]?i=this.props.oContext.customs[e[n].component]:(console.error(`Cannot find custom component: ${e[n].component}`),i=V),s=this.props.oContext.socket;else if(h==="component")if(this.props.customComponents[e[n].subType])i=this.props.customComponents[e[n].subType];else return $.createElement("div",{key:`${n}_${this.props.index??""}`},`Component ${e[n].subType} not provided`);else h==="panel"?i=tn:i=_f[h]||V;return $.createElement(i,{socket:s,globalData:this.props.globalData,oContext:this.props.oContext,key:`${n}_${this.props.index??""}`,index:this.props.index,changed:this.props.changed,arrayIndex:this.props.arrayIndex,expertMode:this.props.expertMode,commandRunning:this.props.commandRunning,style:lt.panel,common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:this.props.data,originalData:this.props.originalData,onError:this.props.onError,onHiddenChanged:this.props.onHiddenChanged,onFilterLabelUpdate:this.props.onFilterLabelUpdate,onChange:this.props.onChange,disabled:t,customObj:this.props.customObj,custom:this.props.custom,schema:e[n],attr:n,table:this.props.table,customComponents:this.props.customComponents})}):null}render(){const e=this.props.schema;if(!e||(this.updateCalculatedValues(),!this.state.calculatedValues))return null;const t=this.props.schema.items,n=this.props.schema.style||{};if(this.state.calculatedValues.hidden){if(e.hideOnlyControl){const i=$.createElement(ze,{size:{xs:e.xs||void 0,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0},sx:P.Utils.getStyle(this.props.oContext.theme,{marginBottom:0,textAlign:"left"},n,this.props.oContext.themeType==="dark"&&e.darkStyle)});return e.newLine?$.createElement($.Fragment,null,$.createElement("div",{style:{flexBasis:"100%",height:0}}),i):i}return null}if(this.props.table)return this.renderItems(t,this.state.calculatedValues.disabled);if(this.props.custom)return $.createElement(ze,{key:`${this.props.attr}_${this.props.index}`,container:!0,style:lt.fullWidth,columnSpacing:2,rowSpacing:1,sx:n},this.renderItems(t,this.state.calculatedValues.disabled));let h;if(e.collapsable)h=$.createElement(js,{key:`${this.props.attr}_${this.props.index}`,style:lt.fullWidth,expanded:!!this.state.expanded,onChange:()=>{(window._localStorage||window.localStorage).setItem(`${this.props.oContext.adapterName}.${this.props.attr}`,this.state.expanded?"false":"true"),this.setState({expanded:!this.state.expanded})}},$.createElement(Hs,{expandIcon:$.createElement(Ii,null),sx:P.Utils.getStyle(this.props.oContext.theme,n,this.props.oContext.themeType&&e.darkStyle,e.color==="primary"?lt.primary:e.color==="secondary"&&lt.secondary,{width:"100%"})},$.createElement(yt,{style:lt.heading},this.getText(e.label))),$.createElement(zs,null,$.createElement(ze,{container:!0,columnSpacing:2,rowSpacing:1,sx:{...n,width:"100%",padding:"10px"}},this.renderItems(t,this.state.calculatedValues.disabled))));else{const i=P.Utils.getStyle(this.props.oContext.theme,this.props.style,n,{width:"100%"},this.props.isParentTab&&lt.paper,this.props.isParentTab&&(this.props.withoutSaveButtons?this.props.withIcons?{height:"calc(100% - 88px) !important"}:{height:"calc(100% - 64px) !important"}:this.props.withIcons?lt.paperWithIcons:lt.paperWithoutIcons));h=$.createElement(Ie,{component:"div",key:`${this.props.attr}_${this.props.index}`,className:this.props.className,sx:i},$.createElement(ze,{container:!0,columnSpacing:2,rowSpacing:1,sx:P.Utils.getStyle(this.props.oContext.theme,{width:"100%"},this.props.isParentTab&&lt.padding,this.props.schema.innerStyle)},this.renderItems(t,this.state.calculatedValues.disabled)))}if(!this.props.isParentTab){const i=$.createElement(ze,{title:this.getText(e.tooltip),size:{xs:e.xs||void 0,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0},sx:{marginBottom:0,textAlign:"left",...n}},h);return e.newLine?$.createElement($.Fragment,null,$.createElement("div",{style:{flexBasis:"100%",height:0}}),i):i}return h}}const Ei={tabs:{height:"100%",width:"100%"},panel:{width:"100%",display:"block"},panelWithIcons:{height:"calc(100% - 72px)"},panelWithoutIcons:{height:"calc(100% - 48px)"}};class kf extends V{resizeTimeout=null;calculateTimeoutTable=null;refDiv;constructor(e){super(e);let t;if(this.props.root){const n=(window.location.hash||"").replace(/^#/,"").split("/");if(n.length>=3&&n[1]==="config"){const h=n[3],i=parseInt(h,10);h&&i.toString()===h?i>=0&&i<Object.keys(this.props.schema.items).length&&(t=Object.keys(this.props.schema.items)[i]):h&&Object.keys(this.props.schema.items).includes(h)&&(t=h),window.addEventListener("hashchange",this.onHashTabsChanged,!1)}}t===void 0&&(t=(window._localStorage||window.localStorage).getItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`)||Object.keys(this.props.schema.items)[0],Object.keys(this.props.schema.items).includes(t)||(t=Object.keys(this.props.schema.items)[0])),this.refDiv=$.createRef(),Object.assign(this.state,{tab:t,width:0,openMenu:null,tabErrors:{}})}onTabError=(e,t)=>{const n=this.state.tab;if(!n){this.props.onError(e,t);return}const h={...this.state.tabErrors};h[n]||(h[n]={}),t?h[n][e]=t:(delete h[n][e],Object.keys(h[n]).length===0&&delete h[n]),this.setState({tabErrors:h}),this.props.onError(e,t)};hasTabErrors=e=>!!(this.state.tabErrors[e]&&Object.keys(this.state.tabErrors[e]).length>0);componentWillUnmount(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.calculateTimeoutTable&&(clearTimeout(this.calculateTimeoutTable),this.calculateTimeoutTable=null),window.removeEventListener("hashchange",this.onHashTabsChanged,!1),super.componentWillUnmount()}onHashTabsChanged=()=>{const e=(window.location.hash||"").replace(/^#/,"").split("/");if(e.length>3&&e[1]==="config"){const t=e[3],n=parseInt(t,10);let h;n.toString()===t?n>=0&&n<Object.keys(this.props.schema.items).length&&(h=Object.keys(this.props.schema.items)[n]):Object.keys(this.props.schema.items).includes(t)&&(h=t),h!==void 0&&h!==this.state.tab&&((window._localStorage||window.localStorage).setItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`,h),this.setState({tab:h}))}};getCurrentBreakpoint(){if(!this.state.width)return"md";if(!this.state.initialBreakpoint){let e;return this.state.width<600?e="xs":this.state.width<900?e="sm":this.state.width<1200?e="md":this.state.width<1536?e="lg":e="xl",setTimeout(()=>{this.setState({initialBreakpoint:e})},50),e}return this.state.initialBreakpoint}componentDidUpdate(){var e;!this.state.initialBreakpoint&&((e=this.refDiv.current)!=null&&e.clientWidth)&&this.refDiv.current.clientWidth!==this.state.width&&(this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{var t;this.resizeTimeout=null,this.setState({width:(t=this.refDiv.current)==null?void 0:t.clientWidth})},50))}onMenuChange(e){(window._localStorage||window.localStorage).setItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`,e),this.setState({tab:e},()=>{if(this.props.root){const t=(window.location.hash||"").split("/");t.length>=3&&t[1]==="config"&&(t[3]=this.state.tab,window.location.hash=t.join("/"))}})}updateCalculatedValuesForTable(){this.calculateTimeoutTable&&clearTimeout(this.calculateTimeoutTable),this.calculateTimeoutTable=setTimeout(async()=>{this.calculateTimeoutTable=null;const e=this.props.schema.items,t={};for(const n in e){let h;if(e[n].expertMode&&!this.props.expertMode){t[n]={hidden:!0,disabled:!1};continue}if(this.props.custom){const i=!!await this.executeCustom(e[n].hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData);if(i){t[n]={hidden:!0,disabled:!1};continue}h=!!await this.executeCustom(e[n].disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData),t[n]={hidden:i,disabled:h}}else{if(!!await this.execute(e[n].hidden,!1,this.props.data,this.props.index,this.props.globalData)){t[n]={hidden:!0,disabled:!1};continue}h=!!await this.execute(e[n].disabled,!1,this.props.data,this.props.index,this.props.globalData),t[n]={hidden:!1,disabled:h}}}JSON.stringify(t)!==JSON.stringify(this.state.calculatedValuesTable)&&this.setState({calculatedValuesTable:t})},50)}render(){const e=this.props.schema.items;let t=!1;if(this.updateCalculatedValuesForTable(),!this.state.calculatedValuesTable)return null;const n=[];Object.keys(e).filter(s=>{var d;return!((d=this.state.calculatedValuesTable[s])!=null&&d.hidden)}).map(s=>{var o;const d=this.getIcon(e[s].icon);t||=!!d,n.push({icon:d,disabled:(o=this.state.calculatedValuesTable[s])==null?void 0:o.disabled,label:this.getText(e[s].label),name:s})}),n.find(s=>s.name===this.state.tab)||setTimeout(()=>this.setState({tab:n[0].name}),50);const h=this.getCurrentBreakpoint();let i;return h==="xs"&&n.length>2?i=$.createElement(Pn,{style:{top:2,backgroundColor:this.props.oContext.themeType==="dark"?"#222":"#DDD"},variant:"dense"},$.createElement(se,{onClick:s=>this.setState({openMenu:s.currentTarget})},$.createElement(Jc,null)),this.state.openMenu?$.createElement(dc,{open:!0,anchorEl:this.state.openMenu,onClose:()=>this.setState({openMenu:null})},n.map(s=>{const d=this.hasTabErrors(s.name);return $.createElement($e,{disabled:s.disabled,key:s.name,onClick:()=>{this.setState({openMenu:null},()=>this.onMenuChange(s.name))},selected:s.name===this.state.tab,sx:d?{color:"error.main"}:void 0},t?$.createElement(To,null,s.icon):null,$.createElement(Ie,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"}},s.label,d&&$.createElement(Jt,{sx:{fontSize:16,color:"error.main"}})))})):null):i=$.createElement(fc,{variant:"scrollable",scrollButtons:"auto",style:this.props.schema.tabsStyle,value:this.state.tab,onChange:(s,d)=>this.onMenuChange(d)},n.map(s=>{const d=this.hasTabErrors(s.name),o=d?$.createElement(Ie,{sx:{display:"flex",alignItems:"center",gap:.5}},s.label,$.createElement(Jt,{sx:{fontSize:16,color:"error.main"}})):s.label;return $.createElement(gc,{id:s.name,wrapped:!0,disabled:s.disabled,key:s.name,value:s.name,iconPosition:this.props.schema.iconPosition||"start",icon:s.icon,label:o,sx:d?{"& .MuiTab-wrapper":{color:"error.main"}}:void 0})})),$.createElement("div",{style:Ei.tabs,ref:this.refDiv},i,$.createElement(tn,{oContext:this.props.oContext,withoutSaveButtons:this.props.withoutSaveButtons,isParentTab:!0,changed:this.props.changed,key:this.state.tab,expertMode:this.props.expertMode,index:1001,arrayIndex:this.props.arrayIndex,globalData:this.props.globalData,commandRunning:this.props.commandRunning,style:{...Ei.panel,...t?Ei.panelWithIcons:Ei.panelWithoutIcons},common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:this.props.data,originalData:this.props.originalData,onChange:this.props.onChange,onError:this.onTabError,customObj:this.props.customObj,custom:this.props.custom,schema:e[this.state.tab],table:this.props.table,withIcons:t,customComponents:this.props.customComponents}))}}const Tf={root:{width:"100%",height:"100%"}};class Ti extends xo{forceUpdateHandlers;errorTimeout=null;errorCached=null;oContext;cachedObjects={};constructor(e){super(e),this.state={originalData:JSON.stringify(this.props.data),changed:!1,errors:{},updateData:this.props.updateData||0,systemConfig:null,alive:!1,commandRunning:!1,schema:JSON.parse(JSON.stringify(this.props.schema))},this.forceUpdateHandlers={},this.buildDependencies(this.state.schema),this.readData().catch(t=>console.error(`Cannot read data: ${t}`))}static getDerivedStateFromProps(e,t){return e.updateData!==t.updateData?{updateData:e.updateData,originalData:JSON.stringify(e.data),schema:JSON.parse(JSON.stringify(e.schema))}:null}static async loadI18n(e,t,n){if(t===!0||t&&typeof t=="string"){const h=P.I18n.getLanguage(),i=typeof t=="string"?t:"i18n";let s=await e.fileExists(`${n}.admin`,`${i}/${h}.json`),d;if(s?d=`${i}/${h}.json`:(s=await e.fileExists(`${n}.admin`,`${i}/${h}/translations.json`),s?d=`${i}/${h}/translations.json`:h!=="en"&&(s=await e.fileExists(`${n}.admin`,`${i}/en.json`),s?d=`${i}/en.json`:(s=await e.fileExists(`${n}.admin`,`${i}/en/translations.json`),s&&(d=`${i}/en/translations.json`)))),d){const o=await e.readFile(`${n}.admin`,d);let l;o.file!==void 0?l=o.file:l=o;try{const r=JSON.parse(l);P.I18n.extendTranslations(r,h)}catch(r){return console.error(`Cannot parse language file "${n}.admin/${d}: ${r}`),""}return d}return console.warn(`Cannot find i18n for ${n} / ${d}`),""}return t&&typeof t=="object"&&P.I18n.extendTranslations(t),""}onCommandRunning=e=>this.setState({commandRunning:e});async readData(){let e;try{this.props.socket.getCompactSystemConfig?e=await this.props.socket.getCompactSystemConfig():e=await this.getCachedObject("system.config")||void 0;const t=await this.props.socket.getState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`);this.setState({systemConfig:e.common,alive:!!(t&&t.val)},()=>{this.updateContext(!0),this.props.custom||this.props.socket.subscribeState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,this.onAlive)})}catch(t){console.error(`Cannot read system config: ${t}`)}}onAlive=(e,t)=>{!!(t!=null&&t.val)!==this.state.alive&&this.setState({alive:!!(t!=null&&t.val)})};onChange=(e,t,n,h)=>{if(this.props.onValueChange)this.props.onValueChange(e,t,h),n&&n();else if(e&&this.props.onChange){const i={changed:JSON.stringify(e)!==this.state.originalData};this.setState(i,()=>{this.props.onChange(e,i.changed,h),n&&n()})}else h&&this.props.onChange(null,null,h)};onError=(e,t)=>{this.errorCached=this.errorCached||JSON.parse(JSON.stringify(this.state.errors));const n=this.errorCached;t?n[e]=t:delete n[e],this.errorTimeout&&clearTimeout(this.errorTimeout),JSON.stringify(n)!==JSON.stringify(this.state.errors)?this.errorTimeout=setTimeout(()=>this.setState({errors:this.errorCached},()=>{this.errorTimeout=null,this.errorCached=null,this.props.onError(!!Object.keys(this.state.errors).length)}),50):this.errorCached=null};flatten(e,t){return t=t||{},e.items&&Object.keys(e.items).forEach(n=>{t[n]=e.items[n],this.flatten(e.items[n],t)}),t}buildDependencies(e){const t=this.flatten(e);Object.keys(t).forEach(n=>{var h,i,s,d,o,l,r,a,c,p;(h=t[n].confirm)!=null&&h.alsoDependsOn&&((i=t[n].confirm)==null||i.alsoDependsOn.forEach(u=>{if(!t[u])console.error(`[JsonConfigComponent] Attribute ${u} does not exist!`),u.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${u.replace(/^data\./,"")}" instead of "${u}"`);else{t[u].confirmDependsOn=t[u].confirmDependsOn||[];const f={...t[n],attr:n};f.confirm&&(f.confirm.cancel="Undo"),t[u].confirmDependsOn.push(f)}})),(s=t[n].onChange)!=null&&s.alsoDependsOn&&((d=t[n].onChange)==null||d.alsoDependsOn.forEach(u=>{if(!t[u])console.error(`[JsonConfigComponent] Attribute ${u} does not exist!`),u.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${u.replace(/^data\./,"")}" instead of "${u}"`);else{t[u].onChangeDependsOn=t[u].onChangeDependsOn||[];const f={...t[n],attr:n};t[u].onChangeDependsOn.push(f)}})),(o=t[n].hidden)!=null&&o.alsoDependsOn&&((l=t[n].hidden)==null||l.alsoDependsOn.forEach(u=>{if(!t[u])console.error(`[JsonConfigComponent] Attribute ${u} does not exist!`),u.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${u.replace(/^data\./,"")}" instead of "${u}"`);else{t[u].hiddenDependsOn=t[u].hiddenDependsOn||[];const f={...t[n],attr:n};t[u].hiddenDependsOn.push(f)}})),(r=t[n].label)!=null&&r.alsoDependsOn&&((a=t[n].label)==null||a.alsoDependsOn.forEach(u=>{if(!t[u])console.error(`[JsonConfigComponent] Attribute ${u} does not exist!`),u.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${u.replace(/^data\./,"")}" instead of "${u}"`);else{t[u].labelDependsOn=t[u].labelDependsOn||[];const f={...t[n],attr:n};t[u].labelDependsOn.push(f)}})),(c=t[n].help)!=null&&c.alsoDependsOn&&((p=t[n].help)==null||p.alsoDependsOn.forEach(u=>{if(!t[u])console.error(`[JsonConfigComponent] Attribute ${u} does not exist!`),u.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${u.replace(/^data\./,"")}" instead of "${u}"`);else{t[u].helpDependsOn=t[u].helpDependsOn||[];const f={...t[n],attr:n};t[u].helpDependsOn.push(f)}}))})}getCachedObject=async e=>{if(this.cachedObjects[e]!==void 0)return this.cachedObjects[e];try{this.cachedObjects[e]=await this.props.socket.getObject(e)??null}catch(t){console.error(t),this.cachedObjects[e]=null}return this.cachedObjects[e]};updateContext(e){this.oContext={DeviceManager:this.props.DeviceManager,adapterName:this.props.adapterName,changeLanguage:this.changeLanguage,common:this.props.common,customs:this.props.customs,dateFormat:this.props.dateFormat,embedded:this.props.embedded,forceUpdate:this.forceAttrUpdate,imagePrefix:this.props.imagePrefix,instance:this.props.instance,instanceObj:this.props.instanceObj,isFloatComma:this.props.isFloatComma,multiEdit:this.props.multiEdit,onBackEndCommand:this.props.onBackEndCommand,onCommandRunning:this.onCommandRunning,onValueChange:this.props.onValueChange,registerOnForceUpdate:this.registerOnForceUpdate,socket:this.props.socket,systemConfig:this.state.systemConfig,theme:this.props.theme,themeType:this.props.themeType,_themeName:this.props.themeName,updateData:this.state.updateData,getCachedObject:this.getCachedObject},e&&this.forceUpdate()}renderItem(e){return e.type==="tabs"?$.createElement(kf,{withoutSaveButtons:this.props.withoutSaveButtons,oContext:this.oContext,alive:this.state.alive,changed:this.state.changed,commandRunning:this.state.commandRunning,common:this.props.common,custom:this.props.custom,customObj:this.props.customObj,data:this.props.data,onChange:this.onChange,onError:(t,n)=>this.onError(t,n),originalData:JSON.parse(this.state.originalData),root:!0,schema:e,expertMode:this.props.expertMode,themeName:this.props.themeName,customComponents:this.props.customComponents}):e.type==="panel"||!e.type?$.createElement(tn,{withoutSaveButtons:this.props.withoutSaveButtons,oContext:this.oContext,alive:this.state.alive,changed:this.state.changed,commandRunning:this.state.commandRunning,common:this.props.common,custom:this.props.custom,customObj:this.props.customObj,data:this.props.data,expertMode:this.props.expertMode,index:1e3,isParentTab:!this.props.embedded&&!this.props.withoutSaveButtons,onChange:this.onChange,onError:(t,n)=>this.onError(t,n),originalData:JSON.parse(this.state.originalData),root:!0,schema:e,themeName:this.props.themeName,customComponents:this.props.customComponents}):(console.error(`Unknown item type in root: ${JSON.stringify(e)}`),null)}changeLanguage=()=>{this.forceUpdate()};forceAttrUpdate=(e,t)=>{Array.isArray(e)?e.forEach(n=>this.forceUpdateHandlers[n]&&this.forceUpdateHandlers[n](t)):this.forceUpdateHandlers[e]&&this.forceUpdateHandlers[e](t)};registerOnForceUpdate=(e,t)=>{t?this.forceUpdateHandlers[e]=t:this.forceUpdateHandlers[e]&&delete this.forceUpdateHandlers[e]};render(){return!this.state.systemConfig||!this.oContext?$.createElement(ji,null):(this.oContext._themeName!==this.props.themeName&&(this.oContext._themeName=this.props.themeName,setTimeout(()=>this.updateContext(!0),0)),$.createElement("div",{style:{...!this.props.embedded||this.props.withoutSaveButtons?Tf.root:void 0,...this.props.style,...this.state.schema.style}},this.renderItem(this.state.schema)))}}const jt={root:{width:"100%",height:"100%",overflow:"hidden",position:"relative"},scroll:{height:"calc(100% - 48px)",overflowY:"auto"},exportImportButtons:{position:"absolute",top:5,right:0,zIndex:3},button:{marginRight:"5px"},tooltip:{pointerEvents:"none"}};function Lf(m,e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(m[n%m.length].charCodeAt(0)^e.charCodeAt(n));return t}function Mf(m,e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(m[n%m.length].charCodeAt(0)^e.charCodeAt(n));return t}function If(m,e){if(typeof e!="string")return e;if(!e.startsWith("$/aes-192-cbc:")||!/^[0-9a-f]{48}$/.test(m))return Lf(m,e);const t=e.split(":",3),n=window.CryptoJS.enc.Hex.parse(m),h=window.CryptoJS.enc.Hex.parse(t[1]),i=window.CryptoJS.lib.CipherParams.create({ciphertext:window.CryptoJS.enc.Hex.parse(t[2])}),s=window.CryptoJS.AES.decrypt(i,n,{iv:h});return window.CryptoJS.enc.Utf8.stringify(s)}function Of(m,e,t){if(typeof e!="string")return e;if(!/^[0-9a-f]{48}$/.test(m))return Mf(m,e);let n;n=window.CryptoJS.lib.WordArray.random(128/8);const h=window.CryptoJS.enc.Hex.parse(m),i=window.CryptoJS.AES.encrypt(e,h,{iv:n}).ciphertext;return`$/aes-192-cbc:${window.CryptoJS.enc.Hex.stringify(n)}:${i}`}function $o(m,e){var t;return document.getElementById(e)?(t=document.getElementById(e))==null?void 0:t.onload:new Promise(n=>{const h=document.createElement("script");h.setAttribute("id",e),h.onload=n,h.src=m,document.getElementsByTagName("head")[0].appendChild(h)})}let Ff=class extends P.Router{fileSubscribed=[];fileLangSubscribed="";secret;constructor(e){super(e),this.state={updateData:0,changed:!1,confirmDialog:!1,theme:P.Theme(e.themeName),saveConfigDialog:!1,hash:"_"},this.secret=e.secret||"",this.getInstanceObject().then(t=>this.getConfigFile().then(n=>Ti.loadI18n(this.props.socket,n==null?void 0:n.i18n,this.props.adapterName).then(h=>{h&&(this.fileLangSubscribed||(this.fileLangSubscribed=h,this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,this.fileLangSubscribed,this.onFileChange))),t?this.setState({schema:n,data:t.native,common:t.common,hash:jr(JSON.stringify(n)).toString()}):window.alert(`Instance system.adapter.${this.props.adapterName}.${this.props.instance} not found!`)})))}componentWillUnmount(){super.componentWillUnmount(),this.fileSubscribed.length&&(this.props.socket.unsubscribeFiles(`${this.props.adapterName}.admin`,this.fileSubscribed,this.onFileChange),this.fileSubscribed=[]),this.fileLangSubscribed&&(this.props.socket.unsubscribeFiles(`${this.props.adapterName}.admin`,this.fileLangSubscribed,this.onFileChange),this.fileLangSubscribed="")}handleFileSelect=e=>{const t=e.target.files[0];if(t){const n=new FileReader;n.onload=h=>{if(!h.target)return;const i=h.target.result;try{const s=JSON.parse(i);this.setState({data:s,changed:JSON.stringify(s)!==JSON.stringify(this.state.originalData)})}catch{window.alert(P.I18n.t("[JsonConfig] Failed to parse JSON file"))}},n.readAsText(t)}else window.alert(P.I18n.t("[JsonConfig] Failed to open JSON File"))};getExportImportButtons(){return $.createElement("div",{style:jt.exportImportButtons},$.createElement(me,{title:this.props.t("Import settings from JSON file"),slotProps:{popper:{sx:jt.tooltip}}},$.createElement(Li,{size:"small",sx:{"&.MuiFab-root":jt.button},onClick:()=>{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("id","files"),e.setAttribute("opacity",0),e.addEventListener("change",t=>this.handleFileSelect(t),!1),e.click()}},$.createElement(Br,null))),$.createElement(me,{title:this.props.t("Export setting to JSON file"),slotProps:{popper:{sx:jt.tooltip}}},$.createElement(Li,{size:"small",sx:{"&.MuiFab-root":jt.button},onClick:()=>{this.state.data&&P.Utils.generateFile(`${this.props.adapterName}.${this.props.instance}.json`,this.state.data)}},$.createElement(Br,{style:{transform:"rotate(180deg)"}}))))}onFileChange=async(e,t,n)=>{var h;if(e===`${this.props.adapterName}.admin`&&n){if(t===this.fileLangSubscribed)try{await Ti.loadI18n(this.props.socket,(h=this.state.schema)==null?void 0:h.i18n,this.props.adapterName),this.setState({hash:`${this.state.hash}1`})}catch{}else if(this.fileSubscribed.includes(t))try{const i=await this.getConfigFile(this.fileSubscribed[0]);this.setState({schema:i,hash:jr(JSON.stringify(i)).toString()})}catch{}}};async getInstanceObject(){var e;try{const t=await this.props.socket.getObject(`system.adapter.${this.props.adapterName}.${this.props.instance}`);if(Array.isArray(t.encryptedNative)){if(!this.secret){const n=await this.props.socket.getSystemConfig();await $o("../../lib/js/crypto-js/crypto-js.js","crypto-js"),this.secret=n.native.secret}return(e=t.encryptedNative)==null||e.forEach(n=>{t.native[n]&&(t.native[n]=If(this.secret,t.native[n]))}),t}return t}catch(t){window.alert(`[JsonConfig] Cannot read instance object: ${t}`)}return null}renderDialogConfirm(){return this.state.confirmDialog?$.createElement(P.DialogConfirm,{title:P.I18n.t("ra_Please confirm"),text:P.I18n.t("ra_Some data are not stored. Discard?"),ok:P.I18n.t("ra_Discard"),cancel:P.I18n.t("ra_Cancel"),onClose:e=>this.setState({confirmDialog:!1},()=>e&&P.Router.doNavigate(null))}):null}async scanForInclude(e,t){if(typeof e["#include"]=="string"){const h=await this._getConfigFile(e["#include"],[...t]);return delete e["#include"],h&&(e={...e,...h}),e}const n=Object.keys(e);for(let h=0;h<n.length;h++)e[n[h]]&&typeof e[n[h]]=="object"&&(e[n[h]]=await this.scanForInclude(e[n[h]],t));return e}async getConfigFile(e){return this._getConfigFile(e)}async _getConfigFile(e,t){if(e=e||"jsonConfig.json5",t=t||[],t.includes(e))return window.alert(`[JsonConfig] Circular reference in file: ${e} => ${t.join(" => ")}`),null;t.push(e);try{await this.props.socket.fileExists(`${this.props.adapterName}.admin`,e)||(e="jsonConfig.json");const h=await this.props.socket.readFile(`${this.props.adapterName}.admin`,e);let i="",s="";if(h.file!==void 0&&(s=h.file),typeof s=="string")i=s;else if(s.type==="Buffer"){let d="";const o=new Uint8Array(s.data),l=o.byteLength;for(let r=0;r<l;r++)d+=String.fromCharCode(o[r]);i=d}this.fileSubscribed.includes(e)||(this.fileSubscribed.push(e),await this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,e,this.onFileChange));try{return await this.scanForInclude(Jo.parse(i),t)}catch(d){window.alert("[JsonConfig] Cannot parse json5 config!"),console.log(d)}}catch(n){this.state.schema||window.alert(`[JsonConfig] Cannot read file "${e}: ${n}`)}return null}renderSaveConfigDialog(){return this.state.saveConfigDialog?$.createElement(P.DialogConfirm,{title:P.I18n.t("ra_Please confirm"),text:P.I18n.t("Save configuration?"),ok:P.I18n.t("ra_Save"),cancel:P.I18n.t("ra_Cancel"),onClose:e=>this.setState({saveConfigDialog:!1},()=>e&&this.onSave(!0))}):null}findAttr(e,t){if(t=t||this.state.schema,t!=null&&t.items){if(e in t.items)return t.items[e];for(const n of Object.values(t.items)){const h=this.findAttr(e,n);if(h)return h}}return null}postProcessing(e,t,n){if(n=n||this.state.schema,!e){console.error(`Data is empty in postProcessing: ${t}, ${JSON.stringify(n)}`);return}const h=e[t];if(n.items)if(n.type==="table"){const i=h;if(!Array.isArray(i))return;for(const s of i)for(const d of n.items)this.postProcessing(s,d.attr,d)}else for(const[i,s]of Object.entries(n.items)){if(s.type==="panel"||s.type==="tabs"||s.type==="accordion")return;this.postProcessing(e,i,s)}else if(t&&typeof h=="string")if(n.type==="text")n.trim!==!1&&(e[t]=h.trim());else if(n.type==="ip")e[t]=h.trim();else if(n.type==="number"){const i=parseFloat(h.toString().replace(",","."));n.min!==void 0&&i<n.min?e[t]=n.min:n.max!==void 0&&i>n.max?e[t]=n.max:e[t]=i}else if(n.type==="port"){const i=parseInt(h.toString(),10);n.min!==void 0&&i<n.min?e[t]=n.min:n.max!==void 0&&i>n.max&&(e[t]=n.max),e[t]!==0&&i<20?e[t]=20:i>65535?e[t]=65535:e[t]=i}else n.type==="checkbox"&&(e[t]=e[t]===!0||e[t]==="true"||e[t]==="on"||e[t]===1||e[t]==="1")}async onSave(e,t){if(e){const n=await this.getInstanceObject();if(!n){console.error("Something went wrong: may be no connection?"),window.alert("Something went wrong: may be no connection?");return}if(!this.state.data||!this.state.schema)return;const h={};for(const s of Object.keys(this.state.data)){const d=this.findAttr(s);(!d||!d.doNotSave||d.type==="state")&&!s.startsWith("_")?V.setValue(n.native,s,this.state.data[s]):(V.setValue(n.native,s,null),h[s]=this.state.data[s])}try{const s=JSON.parse(JSON.stringify(n));if(Array.isArray(s.encryptedNative)){await $o("../../lib/js/crypto-js/crypto-js.js","crypto-js");for(const d of s.encryptedNative)s.native[d]&&(s.native[d]=Of(this.secret,s.native[d]))}await this.props.socket.setObject(s._id,s)}catch(s){window.alert(`[JsonConfig] Cannot set object: ${s}`)}const i={...n.native,...h};console.log(i),this.setState({changed:!1,data:i,updateData:this.state.updateData+1,originalData:i},()=>t&&P.Router.doNavigate(null))}else this.state.changed?this.setState({confirmDialog:!0}):P.Router.doNavigate(null)}componentDidUpdate(e,t){t.changed!==this.state.changed&&this.props.configStored(!this.state.changed)}async componentDidMount(){const e=`${window.location.protocol}//${window.location.host}${window.location.pathname}validate_config/${this.props.adapterName}`;console.log(`fetch ${e}`),await fetch(e)}render(){return!this.state.data||!this.state.schema?$.createElement(ji,null):$.createElement("div",{style:jt.root},this.renderDialogConfirm(),this.getExportImportButtons(),this.renderSaveConfigDialog(),$.createElement(Ti,{key:this.state.hash,style:jt.scroll,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,adapterName:this.props.adapterName,instance:this.props.instance,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat,schema:this.state.schema,common:this.state.common,expertMode:this.props.expertMode,data:this.state.data,updateData:this.state.updateData,onError:e=>this.setState({error:e}),onChange:(e,t,n)=>{n&&this.state.error&&(window.alert(P.I18n.t("Cannot save configuration because of error in configuration")),n=!1),n&&!this.state.changed&&!t&&(n=!1),e?this.setState({data:e,changed:t,saveConfigDialog:n}):n!==void 0&&this.setState({saveConfigDialog:n})},DeviceManager:this.props.DeviceManager,theme:this.state.theme,customComponents:this.props.customComponents,imagePrefix:"."}),$.createElement(P.SaveCloseButtons,{isIFrame:!1,dense:!0,paddingLeft:0,newReact:!0,theme:this.state.theme,noTextOnButtons:this.props.width==="xs"||this.props.width==="sm"||this.props.width==="md",changed:!!(this.state.error||this.state.changed),error:!!this.state.error,onSave:e=>this.onSave(!0,e),onClose:()=>this.onSave(!1)}))}};export{V as ConfigGeneric,tn as ConfigPanel,Ff as JsonConfig,Ti as JsonConfigComponent};