iobroker.javascript 9.0.18 → 9.1.1

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 (156) hide show
  1. package/README.md +14 -6
  2. package/admin/assets/OpenAiDialog-rhLuRLIM.js +13 -0
  3. package/admin/assets/{Save-C-o2LLTD.js → Save-Cld9qv9i.js} +1 -1
  4. package/admin/assets/ScriptEditor-C-fO5h68.js +2 -0
  5. package/admin/assets/ScriptEditorVanillaMonaco-DSYvOslZ.js +1 -0
  6. package/admin/assets/createSvgIcon-DPvF8xqu.js +8 -0
  7. package/admin/assets/hostInit-LzITLWDa.js +1 -0
  8. package/admin/assets/index-BVPl8hv0.js +16 -0
  9. package/admin/assets/index-BkyLyaYT.js +8 -0
  10. package/admin/assets/index-C49cpVll.js +5 -0
  11. package/admin/assets/index-CVZSzCXy.js +1 -0
  12. package/admin/assets/index-DFZipply.js +1 -0
  13. package/admin/assets/index-DlDUIfpA.js +193 -0
  14. package/admin/assets/index-Dsh1HfIY.js +1 -0
  15. package/admin/assets/index-XSrHkgLE.js +1230 -0
  16. package/admin/assets/index-gIA8x-8f.js +1 -0
  17. package/admin/assets/index-q6iFaoFb.js +986 -0
  18. package/admin/assets/inheritsLoose-B0Ba5G9z.js +29 -0
  19. package/admin/assets/iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js +1 -0
  20. package/admin/assets/iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js +1 -0
  21. package/admin/assets/iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js +1 -0
  22. package/admin/assets/iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js +1 -0
  23. package/admin/assets/iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js +1 -0
  24. package/admin/assets/iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js +1 -0
  25. package/admin/assets/iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js +1 -0
  26. package/admin/assets/localSharedImportMap-xmSu9Qkg.js +1 -0
  27. package/admin/assets/useTheme-hy6f3gra.js +1 -0
  28. package/admin/assets/virtualExposes-BPsCufin.js +1 -0
  29. package/admin/assets/virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-D-eF6r8M.js +8 -0
  30. package/admin/custom/assets/Components-B8x6wOMD.js +1 -0
  31. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-B7D2xOvV.js +1 -0
  32. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.mjs-ClsgYnEX.js +1 -0
  33. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__.mjs-B551AMx-.js +1 -0
  34. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-KsT5vKjV.js +1 -0
  35. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_x_mf_2_date_mf_2_pickers__loadShare__.mjs-DgHZUNxn.js +1 -0
  36. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__leaflet__loadShare__.mjs-BYONkEgA.js +1 -0
  37. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-0SjJESw9.js +1 -0
  38. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-CInLgMWW.js +1 -0
  39. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs-CL--xmjC.js +1 -0
  40. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-CorOEig8.js +1 -0
  41. package/admin/custom/assets/DefaultPropsProvider-CGb21NGY.js +1 -0
  42. package/admin/custom/assets/TextField-DNzklBSl.js +139 -0
  43. package/admin/custom/assets/ThemeProvider-B4G3jidj.js +29 -0
  44. package/admin/custom/assets/blue-CagzI6CQ.js +1 -0
  45. package/admin/custom/assets/createSvgIcon-ZdrQ8zSU.js +1 -0
  46. package/admin/custom/assets/createTheme-Wd4QxQE0.js +8 -0
  47. package/admin/custom/assets/defaultTheme-F2iJF2G2.js +1 -0
  48. package/admin/custom/assets/hostInit-iUL-wyj1.js +1 -0
  49. package/admin/custom/assets/index-AZB1OHDH.js +1 -0
  50. package/admin/custom/assets/index-BptSiKBK.js +55 -0
  51. package/admin/custom/assets/index-Bvwv5H7k.js +1 -0
  52. package/admin/custom/assets/index-C0RmLaAj.js +1 -0
  53. package/admin/custom/assets/index-CYc31Gwg.js +960 -0
  54. package/admin/custom/assets/index-CmJ8HzSc.js +1 -0
  55. package/admin/custom/assets/index-D0iTiVVG.js +8 -0
  56. package/admin/custom/assets/index-DbXK0odl.js +1 -0
  57. package/admin/custom/assets/index-Dp7A3XHd.js +7 -0
  58. package/admin/custom/assets/index-N2n19KrF.js +1523 -0
  59. package/admin/custom/assets/index-YBvFYuP6.js +31 -0
  60. package/admin/custom/assets/index-huvZQhZw.js +1 -0
  61. package/admin/custom/assets/index-iRHaQfi-.js +1 -0
  62. package/admin/custom/assets/isSameWeek-DDsSIa_t.js +1 -0
  63. package/admin/custom/assets/jsx-runtime-DfVU3AZG.js +1 -0
  64. package/admin/custom/assets/leaflet-src-k2rCV-Ix.js +1 -0
  65. package/admin/custom/assets/localSharedImportMap-2Enh8EZe.js +1 -0
  66. package/admin/custom/assets/useTheme-BfhDdtAr.js +1 -0
  67. package/admin/custom/assets/useTheme-DWZ6jNyq.js +1 -0
  68. package/admin/custom/assets/virtualExposes-CqrW7o8v.js +2 -0
  69. package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BZZsMeVW.js +8 -0
  70. package/admin/custom/customComponents.js +1 -2
  71. package/admin/i18n/de.json +10 -1
  72. package/admin/i18n/en.json +10 -1
  73. package/admin/i18n/es.json +10 -1
  74. package/admin/i18n/fr.json +10 -1
  75. package/admin/i18n/it.json +10 -1
  76. package/admin/i18n/nl.json +10 -1
  77. package/admin/i18n/pl.json +10 -1
  78. package/admin/i18n/pt.json +10 -1
  79. package/admin/i18n/ru.json +10 -1
  80. package/admin/i18n/uk.json +10 -1
  81. package/admin/i18n/zh-cn.json +10 -1
  82. package/admin/jsonConfig.json +195 -130
  83. package/admin/mf-manifest.json +1 -1
  84. package/admin/remoteEntry.js +1 -2
  85. package/admin/tab.html +13 -8
  86. package/build/lib/javascript.d.ts +4 -2
  87. package/build/lib/nodeModulesManagement.js +3 -2
  88. package/build/lib/nodeModulesManagement.js.map +1 -1
  89. package/build/lib/protectFs.js +27 -12
  90. package/build/lib/protectFs.js.map +1 -1
  91. package/build/lib/sandbox.js +3 -3
  92. package/build/lib/sandbox.js.map +1 -1
  93. package/build/lib/tools.js +7 -2
  94. package/build/lib/tools.js.map +1 -1
  95. package/build/main.js +236 -19
  96. package/build/main.js.map +1 -1
  97. package/build/types.d.ts +5 -0
  98. package/docs/de/README.md +75 -0
  99. package/docs/en/README.md +75 -0
  100. package/io-package.json +32 -28
  101. package/package.json +14 -14
  102. package/admin/assets/OpenAiDialog-BVH3CrDi.js +0 -36
  103. package/admin/assets/ScriptEditor-CAoVSrVf.js +0 -2
  104. package/admin/assets/ScriptEditorVanillaMonaco-Cf9lA3Q5.js +0 -1
  105. package/admin/assets/_commonjsHelpers-Cpj98o6Y.js +0 -1
  106. package/admin/assets/createSvgIcon-XLoRKyxt.js +0 -30
  107. package/admin/assets/hostInit-OBG53iVO.js +0 -2
  108. package/admin/assets/index-BDco9K7T.js +0 -942
  109. package/admin/assets/index-C96hfBFW.js +0 -16
  110. package/admin/assets/index-CFhFEZTW.js +0 -5
  111. package/admin/assets/index-Cm-iTDHo.js +0 -193
  112. package/admin/assets/index-DCTpQXgR.js +0 -1294
  113. package/admin/assets/index-DKvqhUY5.js +0 -24
  114. package/admin/assets/index-DQiceR5U.js +0 -1
  115. package/admin/assets/index-DZ3lKVw8.js +0 -1
  116. package/admin/assets/index-DcrzW8Zn.js +0 -1
  117. package/admin/assets/index-Do-nCdWy.js +0 -9
  118. package/admin/assets/inheritsLoose-tR_kcxUR.js +0 -36
  119. package/admin/assets/iobroker_javascript__loadShare__react__loadShare__-6sH5wUl6.js +0 -1
  120. package/admin/assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CMP-NJnH.js +0 -8
  121. package/admin/assets/useTheme-C2oUi01-.js +0 -1
  122. package/admin/assets/virtualExposes-BIHI7g3E.js +0 -1
  123. package/admin/custom/assets/Components-DjQ_LxKw.js +0 -1
  124. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-DaN0pfsw.js +0 -1
  125. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__-BqzgglHd.js +0 -1
  126. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react__loadShare__-BNbscXK6.js +0 -1
  127. package/admin/custom/assets/ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__-N2_tx_mJ.js +0 -1
  128. package/admin/custom/assets/ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-jdUmHa_i.js +0 -5
  129. package/admin/custom/assets/DefaultPropsProvider-B8ZCC-c2.js +0 -1
  130. package/admin/custom/assets/DefaultPropsProvider-DfdXSIBu.js +0 -1
  131. package/admin/custom/assets/FilledInput-CSjr0QT8.js +0 -2
  132. package/admin/custom/assets/Tabs-CiTQkBjL.js +0 -138
  133. package/admin/custom/assets/ThemeProvider-C50pIiW4.js +0 -29
  134. package/admin/custom/assets/_commonjsHelpers-CE1G-McA.js +0 -1
  135. package/admin/custom/assets/createSvgIcon-C7qUEvjp.js +0 -1
  136. package/admin/custom/assets/createTheme-Bm92JF8u.js +0 -8
  137. package/admin/custom/assets/defaultTheme-BlO0eCf6.js +0 -1
  138. package/admin/custom/assets/hostInit-BJ6gSofk.js +0 -2
  139. package/admin/custom/assets/index-4wMOc304.js +0 -1
  140. package/admin/custom/assets/index-5CTGLw4h.js +0 -55
  141. package/admin/custom/assets/index-BkjEWGjf.js +0 -1
  142. package/admin/custom/assets/index-Bym4WjyH.js +0 -908
  143. package/admin/custom/assets/index-COcxCdeX.js +0 -8
  144. package/admin/custom/assets/index-CnpybLRW.js +0 -1
  145. package/admin/custom/assets/index-Db8nkuMR.js +0 -7
  146. package/admin/custom/assets/index-DcK0RDrH.js +0 -1
  147. package/admin/custom/assets/index-Df6OaCxx.js +0 -1
  148. package/admin/custom/assets/index-Dx7rDE4p.js +0 -1
  149. package/admin/custom/assets/index-t-NMdeH5.js +0 -31
  150. package/admin/custom/assets/index-u8R8UVCf.js +0 -1393
  151. package/admin/custom/assets/jsx-runtime-C1csJtRx.js +0 -1
  152. package/admin/custom/assets/leaflet-src-DpWQqQWv.js +0 -1
  153. package/admin/custom/assets/useEnhancedEffect-aUb-5tTL.js +0 -1
  154. package/admin/custom/assets/useTheme-Cgjfsi-1.js +0 -1
  155. package/admin/custom/assets/useTheme-DFGylj2o.js +0 -1
  156. package/admin/custom/assets/virtualExposes-C_DtjFte.js +0 -2
@@ -0,0 +1,1523 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-iRHaQfi-.js","./index-huvZQhZw.js","./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-CInLgMWW.js","./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-0SjJESw9.js"])))=>i.map(i=>d[i]);
2
+ import{i as So,h as _,f as Ul,a as Kl,n as Gl}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs-0SjJESw9.js";import{c as Ge,r as Bs}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__.mjs_commonjs-proxy-CInLgMWW.js";function Jl(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 Yl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{G as He,p as Se,F as Mn,i as Bn,M as vt,z as we,r as re,W as Ps,X as Ws,s as Ie,Y as js,g as ge,Z as Bi,b as de,$ as fn,h as Tt,c as fe,d as Te,e as Be,f as xe,_ as Qn,a as Qt,a0 as Do,Q as In,T as Ao,S as ct,R as Ee,V as On,k as Ut,l as gn,m as mn,n as Ql,o as vn,a1 as Xl,a2 as Zl,D as ql,a3 as zs,j as ki,E as Pi,A as $o,B as Hs,x as ec,y as tc,a4 as nc,a5 as ic,N as sc,a6 as xo,a7 as _o,I as rc,U as oc,a8 as os,a9 as ac,aa as lc,t as cc,v as hc,w as uc}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-KsT5vKjV.js";import{a7 as zn,W as Kt,k as Ti,aj as dc,ak as ko,al as pc,am as To,an as fc,J as gc,S as Hn,u as Lo,ao as Mo,ap as Io,c as xt,E as Vs,R as Vn,aq as Oo,M as Fo,_ as mc,ar as vc,as as yc,at as bc,au as wc,af as Li,av as Ei,aw as Si,n as un,b as Us,a as _t,ax as Cc,ay as Ec,az as Sc,q as Dc,aA as Ro,w as No,r as Bo,aB as Ks,d as Ac,aC as $c,aD as xc,a8 as Po,aE as _c,aF as kc,aG as Tc,aH as Lc,aI as Mc,aJ as Ic,aK as Oc,aL as Fc,aM as Rc,V as Nc,aN as Bc,j as Pc,X as Wc,aO as jc,aP as zc,aQ as Hc,aR as Vc,G as Fr}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__.mjs-B551AMx-.js";import{_ as W,A as Uc}from"./ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-B7D2xOvV.js";import{R as Kc}from"./ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__.mjs-CL--xmjC.js";import{b as Gc}from"./blue-CagzI6CQ.js";import{C as Jc,D as Wo}from"./index-YBvFYuP6.js";import{d as $s}from"./virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BZZsMeVW.js";import{b as Yc,a as Qc}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_x_mf_2_date_mf_2_pickers__loadShare__.mjs-DgHZUNxn.js";import{p as Gs}from"./index-huvZQhZw.js";import{_ as jo}from"./preload-helper-BDBacUwf.js";const Xc=Object.freeze(Object.defineProperty({__proto__:null,get ConfigGeneric(){return U},get ConfigPanel(){return qt},get JsonConfig(){return Mf},get JsonConfigComponent(){return _i}},Symbol.toStringTag,{value:"Module"}));var Zc=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,qc=/[\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]/,eh=/[\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]/,as={Space_Separator:Zc,ID_Start:qc,ID_Continue:eh},_e={isSpaceSeparator(m){return typeof m=="string"&&as.Space_Separator.test(m)},isIdStartChar(m){return typeof m=="string"&&(m>="a"&&m<="z"||m>="A"&&m<="Z"||m==="$"||m==="_"||as.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==="‍"||as.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 xs,je,gt,Mi,Lt,rt,Re,Js,Pn;var th=function(e,t){xs=String(e),je="start",gt=[],Mi=0,Lt=1,rt=0,Re=void 0,Js=void 0,Pn=void 0;do Re=nh(),rh[je]();while(Re.type!=="eof");return typeof t=="function"?_s({"":Pn},"",t):Pn};function _s(m,e,t){const n=m[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let d=0;d<n.length;d++){const i=String(d),r=_s(n,i,t);r===void 0?delete n[i]:Object.defineProperty(n,i,{value:r,writable:!0,enumerable:!0,configurable:!0})}else for(const d in n){const i=_s(n,d,t);i===void 0?delete n[d]:Object.defineProperty(n,d,{value:i,writable:!0,enumerable:!0,configurable:!0})}return t.call(m,e,n)}let ce,oe,Fn,ft,he;function nh(){for(ce="default",oe="",Fn=!1,ft=1;;){he=yt();const m=zo[ce]();if(m)return m}}function yt(){if(xs[Mi])return String.fromCodePoint(xs.codePointAt(Mi))}function Q(){const m=yt();return m===`
3
+ `?(Lt++,rt=0):m?rt+=m.length:rt++,m&&(Mi+=m.length),m}const zo={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(),ye("eof")}if(_e.isSpaceSeparator(he)){Q();return}return zo[je]()},comment(){switch(he){case"*":Q(),ce="multiLineComment";return;case"/":Q(),ce="singleLineComment";return}throw be(Q())},multiLineComment(){switch(he){case"*":Q(),ce="multiLineCommentAsterisk";return;case void 0:throw be(Q())}Q()},multiLineCommentAsterisk(){switch(he){case"*":Q();return;case"/":Q(),ce="default";return;case void 0:throw be(Q())}Q(),ce="multiLineComment"},singleLineComment(){switch(he){case`
5
+ `:case"\r":case"\u2028":case"\u2029":Q(),ce="default";return;case void 0:return Q(),ye("eof")}Q()},value(){switch(he){case"{":case"[":return ye("punctuator",Q());case"n":return Q(),Bt("ull"),ye("null",null);case"t":return Q(),Bt("rue"),ye("boolean",!0);case"f":return Q(),Bt("alse"),ye("boolean",!1);case"-":case"+":Q()==="-"&&(ft=-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(),Bt("nfinity"),ye("numeric",1/0);case"N":return Q(),Bt("aN"),ye("numeric",NaN);case'"':case"'":Fn=Q()==='"',oe="",ce="string";return}throw be(Q())},identifierNameStartEscape(){if(he!=="u")throw be(Q());Q();const m=ks();switch(m){case"$":case"_":break;default:if(!_e.isIdStartChar(m))throw Rr();break}oe+=m,ce="identifierName"},identifierName(){switch(he){case"$":case"_":case"‌":case"‍":oe+=Q();return;case"\\":Q(),ce="identifierNameEscape";return}if(_e.isIdContinueChar(he)){oe+=Q();return}return ye("identifier",oe)},identifierNameEscape(){if(he!=="u")throw be(Q());Q();const m=ks();switch(m){case"$":case"_":case"‌":case"‍":break;default:if(!_e.isIdContinueChar(m))throw Rr();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(),Bt("nfinity"),ye("numeric",ft*(1/0));case"N":return Q(),Bt("aN"),ye("numeric",NaN)}throw be(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 ye("numeric",ft*0)},decimalInteger(){switch(he){case".":oe+=Q(),ce="decimalPoint";return;case"e":case"E":oe+=Q(),ce="decimalExponent";return}if(_e.isDigit(he)){oe+=Q();return}return ye("numeric",ft*Number(oe))},decimalPointLeading(){if(_e.isDigit(he)){oe+=Q(),ce="decimalFraction";return}throw be(Q())},decimalPoint(){switch(he){case"e":case"E":oe+=Q(),ce="decimalExponent";return}if(_e.isDigit(he)){oe+=Q(),ce="decimalFraction";return}return ye("numeric",ft*Number(oe))},decimalFraction(){switch(he){case"e":case"E":oe+=Q(),ce="decimalExponent";return}if(_e.isDigit(he)){oe+=Q();return}return ye("numeric",ft*Number(oe))},decimalExponent(){switch(he){case"+":case"-":oe+=Q(),ce="decimalExponentSign";return}if(_e.isDigit(he)){oe+=Q(),ce="decimalExponentInteger";return}throw be(Q())},decimalExponentSign(){if(_e.isDigit(he)){oe+=Q(),ce="decimalExponentInteger";return}throw be(Q())},decimalExponentInteger(){if(_e.isDigit(he)){oe+=Q();return}return ye("numeric",ft*Number(oe))},hexadecimal(){if(_e.isHexDigit(he)){oe+=Q(),ce="hexadecimalInteger";return}throw be(Q())},hexadecimalInteger(){if(_e.isHexDigit(he)){oe+=Q();return}return ye("numeric",ft*Number(oe))},string(){switch(he){case"\\":Q(),oe+=ih();return;case'"':if(Fn)return Q(),ye("string",oe);oe+=Q();return;case"'":if(!Fn)return Q(),ye("string",oe);oe+=Q();return;case`
6
+ `:case"\r":throw be(Q());case"\u2028":case"\u2029":oh(he);break;case void 0:throw be(Q())}oe+=Q()},start(){switch(he){case"{":case"[":return ye("punctuator",Q())}ce="value"},beforePropertyName(){switch(he){case"$":case"_":oe=Q(),ce="identifierName";return;case"\\":Q(),ce="identifierNameStartEscape";return;case"}":return ye("punctuator",Q());case'"':case"'":Fn=Q()==='"',ce="string";return}if(_e.isIdStartChar(he)){oe+=Q(),ce="identifierName";return}throw be(Q())},afterPropertyName(){if(he===":")return ye("punctuator",Q());throw be(Q())},beforePropertyValue(){ce="value"},afterPropertyValue(){switch(he){case",":case"}":return ye("punctuator",Q())}throw be(Q())},beforeArrayValue(){if(he==="]")return ye("punctuator",Q());ce="value"},afterArrayValue(){switch(he){case",":case"]":return ye("punctuator",Q())}throw be(Q())},end(){throw be(Q())}};function ye(m,e){return{type:m,value:e,line:Lt,column:rt}}function Bt(m){for(const e of m){if(yt()!==e)throw be(Q());Q()}}function ih(){switch(yt()){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(),_e.isDigit(yt()))throw be(Q());return"\0";case"x":return Q(),sh();case"u":return Q(),ks();case`
8
+ `:case"\u2028":case"\u2029":return Q(),"";case"\r":return Q(),yt()===`
9
+ `&&Q(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw be(Q());case void 0:throw be(Q())}return Q()}function sh(){let m="",e=yt();if(!_e.isHexDigit(e)||(m+=Q(),e=yt(),!_e.isHexDigit(e)))throw be(Q());return m+=Q(),String.fromCodePoint(parseInt(m,16))}function ks(){let m="",e=4;for(;e-- >0;){const t=yt();if(!_e.isHexDigit(t))throw be(Q());m+=Q()}return String.fromCodePoint(parseInt(m,16))}const rh={start(){if(Re.type==="eof")throw Pt();ls()},beforePropertyName(){switch(Re.type){case"identifier":case"string":Js=Re.value,je="afterPropertyName";return;case"punctuator":hi();return;case"eof":throw Pt()}},afterPropertyName(){if(Re.type==="eof")throw Pt();je="beforePropertyValue"},beforePropertyValue(){if(Re.type==="eof")throw Pt();ls()},beforeArrayValue(){if(Re.type==="eof")throw Pt();if(Re.type==="punctuator"&&Re.value==="]"){hi();return}ls()},afterPropertyValue(){if(Re.type==="eof")throw Pt();switch(Re.value){case",":je="beforePropertyName";return;case"}":hi()}},afterArrayValue(){if(Re.type==="eof")throw Pt();switch(Re.value){case",":je="beforeArrayValue";return;case"]":hi()}},end(){}};function ls(){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(Pn===void 0)Pn=m;else{const e=gt[gt.length-1];Array.isArray(e)?e.push(m):Object.defineProperty(e,Js,{value:m,writable:!0,enumerable:!0,configurable:!0})}if(m!==null&&typeof m=="object")gt.push(m),Array.isArray(m)?je="beforeArrayValue":je="beforePropertyName";else{const e=gt[gt.length-1];e==null?je="end":Array.isArray(e)?je="afterArrayValue":je="afterPropertyValue"}}function hi(){gt.pop();const m=gt[gt.length-1];m==null?je="end":Array.isArray(m)?je="afterArrayValue":je="afterPropertyValue"}function be(m){return Ii(m===void 0?`JSON5: invalid end of input at ${Lt}:${rt}`:`JSON5: invalid character '${Ho(m)}' at ${Lt}:${rt}`)}function Pt(){return Ii(`JSON5: invalid end of input at ${Lt}:${rt}`)}function Rr(){return rt-=5,Ii(`JSON5: invalid identifier character at ${Lt}:${rt}`)}function oh(m){console.warn(`JSON5: '${Ho(m)}' in strings is not valid ECMAScript; consider escaping`)}function Ho(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 Ii(m){const e=new SyntaxError(m);return e.lineNumber=Lt,e.columnNumber=rt,e}var ah=function(e,t,n){const d=[];let i="",r,p,o="",l;if(t!=null&&typeof t=="object"&&!Array.isArray(t)&&(n=t.space,l=t.quote,t=t.replacer),typeof t=="function")p=t;else if(Array.isArray(t)){r=[];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&&r.indexOf(g)<0&&r.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)),s("",{"":e});function s(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))),p&&(v=p.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)?h(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 S=0;S<f.length;S++){const w=f[S];switch(w){case"'":case'"':g[w]++,b+=w;continue;case"\0":if(_e.isDigit(f[S+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 A=l||Object.keys(g).reduce((S,w)=>g[S]<g[w]?S:w);return b=b.replace(new RegExp(A,"g"),v[A]),A+b+A}function c(f){if(d.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");d.push(f);let g=i;i=i+o;let v=r||Object.keys(f),b=[];for(const S of v){const w=s(S,f);if(w!==void 0){let y=u(S)+":";o!==""&&(y+=" "),y+=w,b.push(y)}}let A;if(b.length===0)A="{}";else{let S;if(o==="")S=b.join(","),A="{"+S+"}";else{let w=`,
10
+ `+i;S=b.join(w),A=`{
11
+ `+i+S+`,
12
+ `+g+"}"}}return d.pop(),i=g,A}function u(f){if(f.length===0)return a(f);const g=String.fromCodePoint(f.codePointAt(0));if(!_e.isIdStartChar(g))return a(f);for(let v=g.length;v<f.length;v++)if(!_e.isIdContinueChar(String.fromCodePoint(f.codePointAt(v))))return a(f);return f}function h(f){if(d.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");d.push(f);let g=i;i=i+o;let v=[];for(let A=0;A<f.length;A++){const S=s(String(A),f);v.push(S!==void 0?S:"null")}let b;if(v.length===0)b="[]";else if(o==="")b="["+v.join(",")+"]";else{let A=`,
13
+ `+i,S=v.join(A);b=`[
14
+ `+i+S+`,
15
+ `+g+"]"}return d.pop(),i=g,b}};const lh={parse:th,stringify:ah};var Vo=lh,Ys={exports:{}};function ch(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 Di={exports:{}};const hh={},uh=Object.freeze(Object.defineProperty({__proto__:null,default:hh},Symbol.toStringTag,{value:"Module"})),dh=Jl(uh);var ph=Di.exports,Nr;function fh(){return Nr||(Nr=1,(function(m,e){(function(t,n){m.exports=n()})(ph,function(){var t=t||(function(n,d){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 ch=="function")try{i=dh}catch{}var r=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.")},p=Object.create||(function(){function b(){}return function(A){var S;return b.prototype=A,S=new b,b.prototype=null,S}})(),o={},l=o.lib={},s=l.Base=(function(){return{extend:function(b){var A=p(this);return b&&A.mixIn(b),(!A.hasOwnProperty("init")||this.init===A.init)&&(A.init=function(){A.$super.init.apply(this,arguments)}),A.init.prototype=A,A.$super=this,A},create:function(){var b=this.extend();return b.init.apply(b,arguments),b},init:function(){},mixIn:function(b){for(var A in b)b.hasOwnProperty(A)&&(this[A]=b[A]);b.hasOwnProperty("toString")&&(this.toString=b.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),a=l.WordArray=s.extend({init:function(b,A){b=this.words=b||[],A!=d?this.sigBytes=A:this.sigBytes=b.length*4},toString:function(b){return(b||u).stringify(this)},concat:function(b){var A=this.words,S=b.words,w=this.sigBytes,y=b.sigBytes;if(this.clamp(),w%4)for(var D=0;D<y;D++){var T=S[D>>>2]>>>24-D%4*8&255;A[w+D>>>2]|=T<<24-(w+D)%4*8}else for(var $=0;$<y;$+=4)A[w+$>>>2]=S[$>>>2];return this.sigBytes+=y,this},clamp:function(){var b=this.words,A=this.sigBytes;b[A>>>2]&=4294967295<<32-A%4*8,b.length=n.ceil(A/4)},clone:function(){var b=s.clone.call(this);return b.words=this.words.slice(0),b},random:function(b){for(var A=[],S=0;S<b;S+=4)A.push(r());return new a.init(A,b)}}),c=o.enc={},u=c.Hex={stringify:function(b){for(var A=b.words,S=b.sigBytes,w=[],y=0;y<S;y++){var D=A[y>>>2]>>>24-y%4*8&255;w.push((D>>>4).toString(16)),w.push((D&15).toString(16))}return w.join("")},parse:function(b){for(var A=b.length,S=[],w=0;w<A;w+=2)S[w>>>3]|=parseInt(b.substr(w,2),16)<<24-w%8*4;return new a.init(S,A/2)}},h=c.Latin1={stringify:function(b){for(var A=b.words,S=b.sigBytes,w=[],y=0;y<S;y++){var D=A[y>>>2]>>>24-y%4*8&255;w.push(String.fromCharCode(D))}return w.join("")},parse:function(b){for(var A=b.length,S=[],w=0;w<A;w++)S[w>>>2]|=(b.charCodeAt(w)&255)<<24-w%4*8;return new a.init(S,A)}},f=c.Utf8={stringify:function(b){try{return decodeURIComponent(escape(h.stringify(b)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(b){return h.parse(unescape(encodeURIComponent(b)))}},g=l.BufferedBlockAlgorithm=s.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 A,S=this._data,w=S.words,y=S.sigBytes,D=this.blockSize,T=D*4,$=y/T;b?$=n.ceil($):$=n.max(($|0)-this._minBufferSize,0);var M=$*D,O=n.min(M*4,y);if(M){for(var x=0;x<M;x+=D)this._doProcessBlock(w,x);A=w.splice(0,M),S.sigBytes-=O}return new a.init(A,O)},clone:function(){var b=s.clone.call(this);return b._data=this._data.clone(),b},_minBufferSize:0});l.Hasher=g.extend({cfg:s.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 A=this._doFinalize();return A},blockSize:16,_createHelper:function(b){return function(A,S){return new b.init(S).finalize(A)}},_createHmacHelper:function(b){return function(A,S){return new v.HMAC.init(b,S).finalize(A)}}});var v=o.algo={};return o})(Math);return t})})(Di)),Di.exports}var gh=Ys.exports;(function(m,e){(function(t,n){m.exports=n(fh())})(gh,function(t){return(function(n){var d=t,i=d.lib,r=i.WordArray,p=i.Hasher,o=d.algo,l=[];(function(){for(var f=0;f<64;f++)l[f]=n.abs(n.sin(f+1))*4294967296|0})();var s=o.MD5=p.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(f,g){for(var v=0;v<16;v++){var b=g+v,A=f[b];f[b]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}var S=this._hash.words,w=f[g+0],y=f[g+1],D=f[g+2],T=f[g+3],$=f[g+4],M=f[g+5],O=f[g+6],x=f[g+7],k=f[g+8],E=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=S[0],H=S[1],P=S[2],j=S[3];N=a(N,H,P,j,w,7,l[0]),j=a(j,N,H,P,y,12,l[1]),P=a(P,j,N,H,D,17,l[2]),H=a(H,P,j,N,T,22,l[3]),N=a(N,H,P,j,$,7,l[4]),j=a(j,N,H,P,M,12,l[5]),P=a(P,j,N,H,O,17,l[6]),H=a(H,P,j,N,x,22,l[7]),N=a(N,H,P,j,k,7,l[8]),j=a(j,N,H,P,E,12,l[9]),P=a(P,j,N,H,C,17,l[10]),H=a(H,P,j,N,L,22,l[11]),N=a(N,H,P,j,I,7,l[12]),j=a(j,N,H,P,F,12,l[13]),P=a(P,j,N,H,R,17,l[14]),H=a(H,P,j,N,B,22,l[15]),N=c(N,H,P,j,y,5,l[16]),j=c(j,N,H,P,O,9,l[17]),P=c(P,j,N,H,L,14,l[18]),H=c(H,P,j,N,w,20,l[19]),N=c(N,H,P,j,M,5,l[20]),j=c(j,N,H,P,C,9,l[21]),P=c(P,j,N,H,B,14,l[22]),H=c(H,P,j,N,$,20,l[23]),N=c(N,H,P,j,E,5,l[24]),j=c(j,N,H,P,R,9,l[25]),P=c(P,j,N,H,T,14,l[26]),H=c(H,P,j,N,k,20,l[27]),N=c(N,H,P,j,F,5,l[28]),j=c(j,N,H,P,D,9,l[29]),P=c(P,j,N,H,x,14,l[30]),H=c(H,P,j,N,I,20,l[31]),N=u(N,H,P,j,M,4,l[32]),j=u(j,N,H,P,k,11,l[33]),P=u(P,j,N,H,L,16,l[34]),H=u(H,P,j,N,R,23,l[35]),N=u(N,H,P,j,y,4,l[36]),j=u(j,N,H,P,$,11,l[37]),P=u(P,j,N,H,x,16,l[38]),H=u(H,P,j,N,C,23,l[39]),N=u(N,H,P,j,F,4,l[40]),j=u(j,N,H,P,w,11,l[41]),P=u(P,j,N,H,T,16,l[42]),H=u(H,P,j,N,O,23,l[43]),N=u(N,H,P,j,E,4,l[44]),j=u(j,N,H,P,I,11,l[45]),P=u(P,j,N,H,B,16,l[46]),H=u(H,P,j,N,D,23,l[47]),N=h(N,H,P,j,w,6,l[48]),j=h(j,N,H,P,x,10,l[49]),P=h(P,j,N,H,R,15,l[50]),H=h(H,P,j,N,M,21,l[51]),N=h(N,H,P,j,I,6,l[52]),j=h(j,N,H,P,T,10,l[53]),P=h(P,j,N,H,C,15,l[54]),H=h(H,P,j,N,y,21,l[55]),N=h(N,H,P,j,k,6,l[56]),j=h(j,N,H,P,B,10,l[57]),P=h(P,j,N,H,O,15,l[58]),H=h(H,P,j,N,F,21,l[59]),N=h(N,H,P,j,$,6,l[60]),j=h(j,N,H,P,L,10,l[61]),P=h(P,j,N,H,D,15,l[62]),H=h(H,P,j,N,E,21,l[63]),S[0]=S[0]+N|0,S[1]=S[1]+H|0,S[2]=S[2]+P|0,S[3]=S[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 A=n.floor(v/4294967296),S=v;g[(b+64>>>9<<4)+15]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,g[(b+64>>>9<<4)+14]=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360,f.sigBytes=(g.length+1)*4,this._process();for(var w=this._hash,y=w.words,D=0;D<4;D++){var T=y[D];y[D]=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360}return w},clone:function(){var f=p.clone.call(this);return f._hash=this._hash.clone(),f}});function a(f,g,v,b,A,S,w){var y=f+(g&v|~g&b)+A+w;return(y<<S|y>>>32-S)+g}function c(f,g,v,b,A,S,w){var y=f+(g&b|v&~b)+A+w;return(y<<S|y>>>32-S)+g}function u(f,g,v,b,A,S,w){var y=f+(g^v^b)+A+w;return(y<<S|y>>>32-S)+g}function h(f,g,v,b,A,S,w){var y=f+(v^(g|~b))+A+w;return(y<<S|y>>>32-S)+g}d.MD5=p._createHelper(s),d.HmacMD5=p._createHmacHelper(s)})(Math),t.MD5})})(Ys);var mh=Ys.exports;const Br=Yl(mh),vh=window.innerWidth<=600?12:void 0;function cs(m){return Object.prototype.toString.call(m)==="[object Object]"}class U extends So{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;constructor(e){super(e),this.state={confirmDialog:!1,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},this.isError={},e.schema&&(e.custom?this.defaultValue=e.schema.defaultFunc?this.executeCustom(e.schema.defaultFunc,e.data,e.customObj,e.oContext.instanceObj,e.arrayIndex,e.globalData):e.schema.default:e.schema.type!=="state"&&(this.defaultValue=e.schema.defaultFunc?this.execute(e.schema.defaultFunc,e.schema.default,e.data,e.arrayIndex,e.globalData):e.schema.default)),this.lang=W.I18n.getLanguage()}componentDidMount(){this.props.oContext.registerOnForceUpdate&&this.props.oContext.registerOnForceUpdate(this.props.attr,this.onUpdate);const e=["select","autocomplete","autocompleteSendTo"];if(this.defaultValue!==void 0){const t=U.getValue(this.props.data,this.props.attr);(t===void 0||e.includes(this.props.schema.type)&&(t===""||t===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)):(U.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()}sendTo(){if(this.props.alive){this.defaultSendToDone=!0;let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const t=this.getPattern(this.props.schema.jsonData,null,!0);try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${t}`)}}else e={attr:this.props.attr,value:U.getValue(this.props.data,this.props.attr)};e===void 0&&(e=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.defaultSendTo,e).then(t=>{t!=null&&(this.props.custom?this.props.onChange(this.props.attr,t,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data)):(U.setValue(this.props.data,this.props.attr,t),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,W.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)}onUpdate=e=>{const t=U.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 U.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 U.getValue(e[n],t)}static setValue(e,t,n){if(typeof t=="string"){U.setValue(e,t.split("."),n);return}if(t.length===1)n===null?delete e[t[0]]:e[t[0]]=n;else{const d=t.shift();if(typeof d!="string")return;(!e[d]||typeof e[d]=="object")&&(e[d]=e[d]||{}),U.setValue(e[d],t,n)}}getText(e,t){if(!e)return"";if(typeof e=="string"){const n=t?e:W.I18n.t(e);return n.includes("${")?this.getPattern(n,null,t):n}return cs(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()}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(Kt,null):e.type==="info"&&(t=_.createElement(Ti,null)),_.createElement(W.DialogConfirm,{title:this.getText(e.title)||W.I18n.t("ra_Please confirm"),text:this.getText(e.text),ok:this.getText(e.ok)||W.I18n.t("ra_Ok"),cancel:this.getText(e.cancel)||W.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 d=JSON.parse(JSON.stringify(this.props.data));this.state.confirmDepAttr&&U.setValue(d,this.state.confirmDepAttr,this.state.confirmDepNewValue),U.setValue(d,this.state.confirmAttr,this.state.confirmNewValue),this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null},()=>this.props.onChange(d))}else{const d=this.state.confirmCallback;this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},()=>{d&&d(!1)})}})})}getIcon(e){e=e||this.props.schema.icon;let t=null;return e==="auth"?t=_.createElement(dc,null):e==="send"?t=_.createElement(ko,null):e==="web"?t=_.createElement(pc,null):e==="warning"?t=_.createElement(zn,null):e==="error"?t=_.createElement(Kt,null):e==="info"?t=_.createElement(Ti,null):e==="search"?t=_.createElement(To,null):e==="book"?t=_.createElement(fc,null):e==="help"?t=_.createElement(gc,null):e==="upload"?t=_.createElement(Hn,null):e==="edit"?t=_.createElement(Lo,null):e==="user"?t=_.createElement(Mo,null):e==="group"?t=_.createElement(Io,null):e==="delete"?t=_.createElement(xt,null):e==="refresh"?t=_.createElement(Vs,null):e==="add"?t=_.createElement(Vn,null):e==="unpair"?t=_.createElement(Oo,null):e==="pair"?t=_.createElement(Fo,null):e==="save"?t=_.createElement(mc,null):e==="open"?t=_.createElement(vc,null):e&&((e.endsWith(".png")||e.endsWith(".svg")||e.endsWith(".jpg"))&&!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`./adapter/${this.props.oContext.adapterName}/${e}`),t=_.createElement(W.Icon,{src:e,style:{width:22,height:22}})),t}onChangeAsync(e,t){return new Promise(n=>{const d=this.onChange(e,t,n);d instanceof Promise&&d.catch(i=>console.error(`Cannot set value: ${i}`))})}onChange(e,t,n){const d=JSON.parse(JSON.stringify(this.props.data));if(U.setValue(d,e,t),this.props.schema.confirm&&this.execute(this.props.schema.confirm.condition,!1,d,this.props.arrayIndex,this.props.globalData))return new Promise(r=>{this.setState({confirmDialog:!0,confirmNewValue:t,confirmAttr:e,confirmData:null},()=>{typeof n=="function"?n():r()})});if(this.props.schema.confirmDependsOn)for(let r=0;r<this.props.schema.confirmDependsOn.length;r++){const p=this.props.schema.confirmDependsOn[r];if(p.confirm){const o=U.getValue(d,p.attr);if(this.execute(p.confirm.condition,!1,d,this.props.arrayIndex,this.props.globalData))return new Promise(l=>{this.setState({confirmDialog:!0,confirmNewValue:t,confirmAttr:e,confirmDepNewValue:o,confirmDepAttr:p.attr,confirmData:p.confirm},()=>{typeof n=="function"?n():l()})})}}const i=[];if(this.props.schema.onChangeDependsOn)for(let r=0;r<this.props.schema.onChangeDependsOn.length;r++){const p=this.props.schema.onChangeDependsOn[r];if(p.onChange){const o=U.getValue(d,p.attr);let l;this.props.custom?l=this.executeCustom(p.onChange.calculateFunc,d,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):l=this.execute(p.onChange.calculateFunc,o,d,this.props.arrayIndex,this.props.globalData),l!==o&&(U.setValue(d,p.attr,l),i.push(p.attr))}}if(this.props.schema.hiddenDependsOn)for(let r=0;r<this.props.schema.hiddenDependsOn.length;r++){const p=this.props.schema.hiddenDependsOn[r];p.hidden&&i.push(p.attr)}if(this.props.schema.labelDependsOn)for(let r=0;r<this.props.schema.labelDependsOn.length;r++){const p=this.props.schema.labelDependsOn[r];p.hidden&&i.push(p.attr)}if(this.props.schema.helpDependsOn)for(let r=0;r<this.props.schema.helpDependsOn.length;r++){const p=this.props.schema.helpDependsOn[r];p.hidden&&i.push(p.attr)}if(this.props.schema.onChange&&!this.props.schema.onChange.ignoreOwnChanges){const r=U.getValue(d,this.props.attr),p=this.props.custom?this.executeCustom(this.props.schema.onChange.calculateFunc,d,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):this.execute(this.props.schema.onChange.calculateFunc,r,d,this.props.arrayIndex,this.props.globalData);p!==r&&U.setValue(d,this.props.attr,p)}return this.props.custom?(this.props.onChange(e,t,()=>n&&n()),i!=null&&i.length&&i.forEach((r,p)=>setTimeout(()=>this.props.onChange(r,U.getValue(d,r)),p*50))):this.props.onChange(d,void 0,()=>{i.length&&this.props.oContext.forceUpdate(i,d),n&&n()}),Promise.resolve()}execute(e,t,n,d,i){let r;if(cs(e))r=e.func;else if(typeof e=="string")r=e;else return e;if(!r)return t;try{return new Function("data","originalData","_system","_alive","_common","_socket","_instance","arrayIndex","globalData","_changed",r.includes("return")?r:`return ${r}`)(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,d,i,this.props.changed)}catch(p){return console.error(`Cannot execute ${JSON.stringify(e)}: ${p}`),t}}executeCustom(e,t,n,d,i,r){let p;if(cs(e))p=e.func;else if(typeof e=="string")p=e;else return e;if(!p)return null;try{return new Function("data","originalData","_system","instanceObj","customObj","_socket","arrayIndex","globalData","_changed",p.includes("return")?p:`return ${p}`)(t||this.props.data,this.props.originalData,this.props.oContext.systemConfig,d,n,this.props.oContext.socket,i,r,this.props.changed)}catch(o){return console.error(`Cannot execute ${p}: ${o}`),null}}calculate(e){let t,n,d,i;return this.props.custom?(t=e.validator?!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?this.executeCustom(e.disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,e.hidden===!0?d=!0:d=e.hidden?this.executeCustom(e.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,i=e.defaultFunc?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?!this.execute(e.validator,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,e.disabled===!0?n=!0:n=e.disabled?this.execute(e.disabled,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,e.hidden===!0?d=!0:d=e.hidden?this.execute(e.hidden,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,i=e.defaultFunc?this.execute(e.defaultFunc,e.default,this.props.data,this.props.arrayIndex,this.props.globalData):e.default),{error:t,disabled:n,hidden:d,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>"))?W.Utils.renderTextWithA(e):e)}static escapeString(e,t){return typeof e!="string"?"":(e=e.replace(/`/g,"\\`"),e=e.replace(/\${([^}]+)}/g,(n,d)=>{if(d&&typeof d=="string"&&d.startsWith("data.")){const i=U.getValue(t,d.replace(/^data\./,""));if(typeof i=="string"&&(i.includes("\\")||i.includes('"')))return`\${${d}.replace(/\\\\/g, '\\\\\\\\').replace(/"/g, '\\\\"')}`}return n}),e)}getPattern(e,t,n){if(t=t||this.props.data,!e)return"";let d;typeof e=="object"?e.func?d=e.func:(console.log(`Object must be stringified: ${JSON.stringify(e)}`),d=JSON.stringify(e)):d=e;try{if(this.props.custom)return new Function("data","originalData","arrayIndex","globalData","_system","instanceObj","customObj","_socket","_changed",`return \`${U.escapeString(d,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);const r=new Function("data","originalData","arrayIndex","globalData","_system","_alive","_common","_socket","_changed",`return \`${U.escapeString(d,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);return n?r:W.I18n.t(r)}catch(i){return console.error(`Cannot execute ${d}: ${i}`),d}}render(){const e=this.props.schema;if(!e||this.props.expertMode===!1&&e.expertMode)return null;this.props.alive&&this.defaultSendToDone===!1&&(this.sendToTimeout=setTimeout(()=>{this.sendToTimeout=null,this.sendTo()},200));const{error:t,disabled:n,hidden:d,defaultValue:i}=this.calculate(e);if(d){if(Object.keys(this.isError).length&&(setTimeout(o=>Object.keys(o).forEach(l=>this.props.onError(l)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}),e.hideOnlyControl){const o=_.createElement(He,{size:{xs:e.xs||vh,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}}),o):o}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&&(t&&!Object.keys(this.isError).length?(this.isError={[this.props.attr]:e.validatorErrorText?W.I18n.t(e.validatorErrorText):!0},setTimeout(o=>Object.keys(o).forEach(l=>this.props.onError(l,o[l])),100,JSON.parse(JSON.stringify(this.isError)))):!t&&Object.keys(this.isError).length&&(setTimeout(o=>Object.keys(o).forEach(l=>this.props.onError(l)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}));const r=this.renderItem(t,n||this.props.commandRunning||this.props.disabled,i);if(this.noPlaceRequired)return r;const p=_.createElement(He,{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(He,{container:!0,style:{width:"100%"}},_.createElement(He,{flex:1},r),_.createElement(He,null,_.createElement(Se,{disabled:n,variant:"outlined",onClick:()=>this.sendTo(),title:this.props.schema.buttonTooltip?this.getText(this.props.schema.buttonTooltip,this.props.schema.buttonTooltipNoTranslation):W.I18n.t("ra_Request data by instance")},this.getText(this.props.schema.button)))):r);return e.newLine?_.createElement(_.Fragment,null,_.createElement("div",{style:{flexBasis:"100%",height:0}}),this.renderDialogConfirm(),p):this.state.confirmDialog?_.createElement(_.Fragment,null,this.renderDialogConfirm(),p):p}}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 yh extends U{typingTimer=null;constructor(e){super(e),this.props.schema.items=this.props.schema.items||[]}componentDidMount(){super.componentDidMount();let e=U.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 d={...this.state.accordionErrors};d[e]||(d[e]={}),n?d[e][t]=n:(delete d[e][t],Object.keys(d[e]).length===0&&delete d[e]),this.setState({accordionErrors:d}),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:d}=this.props,i={type:"panel",items:d.items.reduce((r,p)=>(r[p.attr]=p,r),{}),style:{marginLeft:"-8px",marginTop:"10px",marginBottom:"10px"}};return _.createElement(qt,{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:(r,p)=>{const o=JSON.parse(JSON.stringify(n));o[t][r]=p,this.setState({value:o},()=>this.onChangeWrapper(o))},onError:this.onAccordionError(t),onHiddenChanged:this.props.onHiddenChanged,table:this.props.table})}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 d=1,i=n[this.props.schema.clone];const r=i.match(/(\d+)$/);for(r?(i=i.replace(r[0],""),d=parseInt(r[0],10)+1):i+="_";t.find(p=>p[this.props.schema.clone]===i+d.toString());)d++;n[this.props.schema.clone]=`${n[this.props.schema.clone]}_${d}`}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(d=>this.onError(d))},300,e)};onAdd=()=>{const{schema:e}=this.props,t=JSON.parse(JSON.stringify(this.state.value)),n=e.items&&e.items.reduce((d,i)=>{let r;return i.defaultFunc?this.props.custom?r=i.defaultFunc?this.executeCustom(i.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,t.length,this.props.data):this.props.schema.default:r=i.defaultFunc?this.execute(i.defaultFunc,this.props.schema.default,this.props.data,t.length,this.props.data):this.props.schema.default:r=i.default===void 0?null:i.default,d[i.attr]=r,d},{});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 d=this.state.activeIndex-1;this.setState({value:t,activeIndex:d,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 d=this.state.activeIndex+1;this.setState({value:t,activeIndex:d,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)}`,d=`config_section_${new Date().toISOString().slice(0,19).replace(/:/g,"-")}.json`,i=document.createElement("a");i.setAttribute("href",n),i.setAttribute("download",d),i.click()};onImport=e=>{const t=document.createElement("input");t.type="file",t.accept=".json",t.onchange=n=>{var r;const d=(r=n.target.files)==null?void 0:r[0];if(!d)return;const i=new FileReader;i.onload=p=>{var o;try{const l=JSON.parse((o=p.target)==null?void 0:o.result);if(!Array.isArray(l)){alert(W.I18n.t("ra_Invalid JSON format. Expected an array."));return}let s;e?s=l:s=[...this.state.value,...l],this.setState({value:s,activeIndex:-1},()=>this.onChangeWrapper(s))}catch{alert(W.I18n.t("ra_Invalid JSON file."))}},i.readAsText(d)},t.click()};renderItem(){const{schema:e}=this.props,{value:t}=this.state;return t?_.createElement(Mn,null,e.label||!e.noDelete?_.createElement(Bn,{variant:"dense"},e.label?_.createElement(vt,{variant:"h6",id:"tableTitle",component:"div"},this.getText(e.label)):null,e.noDelete?null:_.createElement(_.Fragment,null,_.createElement(we,{title:W.I18n.t("ra_Export configuration section")},_.createElement(re,{size:"small",color:"primary",onClick:this.onExport},_.createElement(yc,null))),_.createElement(we,{title:W.I18n.t("ra_Import and replace configuration section")},_.createElement(re,{size:"small",color:"primary",onClick:()=>this.onImport(!0)},_.createElement(bc,null))),_.createElement(we,{title:W.I18n.t("ra_Import and add configuration section")},_.createElement(re,{size:"small",color:"primary",onClick:()=>this.onImport(!1)},_.createElement(wc,null))),_.createElement(re,{size:"small",color:"primary",onClick:this.onAdd},_.createElement(Vn,null)))):null,t.map((n,d)=>_.createElement(Ps,{key:`${n}_${d}`,expanded:this.state.activeIndex===d,onChange:(i,r)=>this.setState({activeIndex:r?d:-1})},_.createElement(Ws,{expandIcon:_.createElement(Li,null),sx:W.Utils.getStyle(this.props.oContext.theme,tt.fullWidth,tt.accordionSummary)},_.createElement(Ie,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"}},_.createElement(vt,{style:tt.accordionTitle},n[e.titleAttr]),this.hasAccordionErrors(d)&&_.createElement(Kt,{sx:{fontSize:20,color:"error.main"}}))),_.createElement(js,{style:{...e.style,...this.props.oContext.themeType?e.darkStyle:void 0}},this.itemAccordion(t[d],d),_.createElement(Bn,{sx:tt.toolbar},d?_.createElement(we,{title:W.I18n.t("ra_Move up"),slotProps:{popper:{sx:tt.tooltip}}},_.createElement(re,{size:"small",onClick:()=>this.onMoveUp(d)},_.createElement(Ei,null))):_.createElement("div",{style:tt.buttonEmpty}),d<t.length-1?_.createElement(we,{title:W.I18n.t("ra_Move down"),slotProps:{popper:{sx:tt.tooltip}}},_.createElement(re,{size:"small",onClick:()=>this.onMoveDown(d)},_.createElement(Si,null))):_.createElement("div",{style:tt.buttonEmpty}),e.noDelete?null:_.createElement(we,{title:W.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:tt.tooltip}}},_.createElement(re,{size:"small",onClick:this.onDelete(d)},_.createElement(xt,null))),e.clone?_.createElement(we,{title:W.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:tt.tooltip}}},_.createElement(re,{size:"small",onClick:this.onClone(d)},_.createElement(un,null))):null)))),!e.noDelete&&t.length>0?_.createElement(Bn,{variant:"dense",sx:tt.rootTool},_.createElement(re,{size:"small",color:"primary",onClick:this.onAdd},_.createElement(Vn,null))):null,e.help?_.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null):null}}const Pr={root:{width:"100%"},notAlive:{color:"#a30000"}};class bh extends U{aliveId=null;async componentDidMount(){super.componentDidMount();const e=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.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)})};getInstance(){let e=this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`;return e.includes("${")&&(e=this.getPattern(e,null,!0)),e&&!e.startsWith("system.adapter.")&&(e=`system.adapter.${e}`),e}renderItem(){if(this.getInstance()!==this.state.instance&&setTimeout(()=>{const t=this.getInstance();t?this.props.oContext.socket.getState(`${t}.alive`).then(n=>this.setState({alive:!!(n&&n.val),instance:t})):this.setState({alive:null,instance:t})},200),this.state.alive!==!1&&this.state.alive!==!0)return null;const e=this.state.instance.replace(/^system.adapter./,"");return _.createElement("div",{style:{...Pr.root,...this.state.alive?void 0:Pr.notAlive}},this.state.alive?this.props.schema.textAlive!==void 0?this.props.schema.textAlive?W.I18n.t(this.props.schema.textAlive,e):"":W.I18n.t("ra_Instance %s is alive",e):this.props.schema.textNotAlive!==void 0?this.props.schema.textNotAlive?W.I18n.t(this.props.schema.textNotAlive,e):"":W.I18n.t("ra_Instance %s is not alive",e))}}class wh extends U{componentDidMount(){super.componentDidMount();const e=U.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 d of t)d.value!==U.DIFFERENT_VALUE&&(n[d.value]=d.label);this.props.onFilterLabelUpdate(this.props.attr,n)}Array.isArray(e)?(t.unshift({label:W.I18n.t(U.DIFFERENT_LABEL),value:U.DIFFERENT_VALUE}),this.setState({value:U.DIFFERENT_VALUE,selectOptions:t})):this.setState({value:e,selectOptions:t})}renderItem(e,t){if(!this.state.selectOptions)return null;let n;const d=JSON.parse(JSON.stringify(this.state.selectOptions));return Array.isArray(this.state.value)||this.state.value===U.DIFFERENT_VALUE?([...this.state.value].filter(r=>!d.find(p=>typeof p=="object"?p.value===r:p===r)).forEach(r=>d.push({label:r.toString(),value:r})),n={label:W.I18n.t(U.DIFFERENT_LABEL),value:U.DIFFERENT_VALUE},d.unshift(n)):(n=this.state.value!==null&&this.state.value!==void 0&&d.find(r=>typeof r=="object"?r.value==this.state.value:r==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},d.push(n))),_.createElement(Bi,{fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,value:n,options:d,isOptionEqualToValue:(r,p)=>r.value===p.value,filterOptions:(r,p)=>{const o=r.filter(l=>p.inputValue===""?!0:l.label.toLowerCase().includes(p.inputValue.toLowerCase())||l.value.toLowerCase().includes(p.inputValue.toLowerCase()));return this.props.schema.freeSolo&&p.inputValue!==""&&o.push({label:p.inputValue,value:p.inputValue}),o},onInputChange:r=>{if(!r||!this.props.schema.freeSolo)return;const p=r.target.value;p!==this.state.value&&this.setState({value:p},()=>this.onChange(this.props.attr,p))},onChange:(r,p)=>{const o=typeof p=="object"?p?p.value:"":p;o!==this.state.value&&this.setState({value:o},()=>this.onChange(this.props.attr,o))},getOptionLabel:r=>typeof r=="object"?(r==null?void 0:r.label)??"":"",renderInput:r=>_.createElement(de,{variant:"standard",...r,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 Ch extends U{initialized=!1;localContext;askInstance(){const e=U.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 d=this.getPattern(this.props.schema.jsonData,null,!0);try{typeof d=="string"&&(n=JSON.parse(d))}catch{console.error(`Cannot parse json data: ${JSON.stringify(n)}`)}}n===void 0&&(n=null),this.setState({loading:!0}),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",n).then(d=>{d&&Array.isArray(d)&&d.forEach(i=>t.push(typeof i=="string"?{label:i,value:i}:JSON.parse(JSON.stringify(i)))),this.reportFilterLabels(t),Array.isArray(e)?(t.unshift({label:W.I18n.t(U.DIFFERENT_LABEL),value:U.DIFFERENT_VALUE}),this.setState({value:U.DIFFERENT_VALUE,selectOptions:t,loading:!1})):this.setState({value:e,selectOptions:t,loading:!1})}).catch(d=>{console.error("Error in autocompleteSendTo:",d),this.setState({loading:!1})})}else Array.isArray(e)?(t.unshift({label:W.I18n.t(U.DIFFERENT_LABEL),value:U.DIFFERENT_VALUE}),this.reportFilterLabels(t),this.setState({value:U.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!==U.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]=U.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(e,t){if(this.props.alive){const r=this.getContext();(r!==this.localContext||!this.initialized)&&(this.localContext=r,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}let n;const d=this.state.selectOptions?JSON.parse(JSON.stringify(this.state.selectOptions)):[];return Array.isArray(this.state.value)||this.state.value===U.DIFFERENT_LABEL?([...this.state.value].filter(r=>!d.find(p=>p.value===r)).forEach(r=>d.push({label:r.toString(),value:r})),n={label:W.I18n.t(U.DIFFERENT_LABEL),value:U.DIFFERENT_VALUE},d.unshift(n)):(n=this.state.value!==null&&this.state.value!==void 0&&d.find(r=>r.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},d.push(n)),n=n||null),d.length?_.createElement(Bi,{value:n,fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,options:d,disabled:t,isOptionEqualToValue:(r,p)=>r.value===p.value,filterOptions:(r,p)=>{const o=r.filter(l=>p.inputValue===""?!0:l.label.toLowerCase().includes(p.inputValue.toLowerCase())||l.value.toLowerCase().includes(p.inputValue.toLowerCase()));return this.props.schema.freeSolo&&p.inputValue!==""&&o.push({label:p.inputValue,value:p.inputValue}),o},getOptionLabel:r=>(r==null?void 0:r.label)??"",onInputChange:r=>{if(!r||!this.props.schema.freeSolo)return;const p=r.target.value;p!==this.state.value&&this.setState({value:p},()=>this.onChange(this.props.attr,p))},onChange:(r,p)=>{const o=typeof p=="object"?p?p.value:"":p;o!==this.state.value&&this.setState({value:o},()=>this.onChange(this.props.attr,o))},renderInput:r=>_.createElement(de,{variant:"standard",...r,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:{...r.InputProps,endAdornment:_.createElement(_.Fragment,null,this.state.loading?_.createElement(fn,{position:"end"},_.createElement(Tt,{size:20})):null,t?null:r.InputProps.endAdornment)}}})}):_.createElement(de,{variant:"standard",fullWidth:!0,value:this.state.value===null||this.state.value===void 0?"":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(fn,{position:"end"},_.createElement(Tt,{size:20})):null}},onChange:r=>{const p=r.target.value;this.setState({value:p},()=>this.onChange(this.props.attr,(p||"").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 hs={fullWidth:{width:"100%"},flex:{display:"flex"},button:{height:48,marginLeft:4,minWidth:48}};class Eh extends U{componentDidMount(){super.componentDidMount();const{data:e,attr:t}=this.props,n=U.getValue(e,t)||"";this.setState({value:n,showDialog:!1})}renderItem(e,t){const{schema:n,attr:d}=this.props,{value:i,showDialog:r}=this.state;return _.createElement(fe,{style:hs.fullWidth,variant:"standard"},n.label?_.createElement(Te,{shrink:!0},this.getText(n.label)):null,_.createElement("div",{style:hs.flex},_.createElement(de,{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:p=>{const o=p.target.value;this.setState({value:o},()=>this.onChange(d,o))}}),_.createElement(Se,{color:"grey",disabled:t,style:hs.button,size:"small",variant:"outlined",onClick:()=>this.setState({showDialog:!0})},"...")),r?_.createElement(W.DialogCron,{title:W.I18n.t("ra_Define schedule"),simple:n.simple,complex:n.complex,cron:i,onClose:()=>this.setState({showDialog:!1}),cancel:W.I18n.t("ra_Cancel"),ok:W.I18n.t("ra_Ok"),theme:this.props.oContext.theme,onOk:p=>this.setState({showDialog:!1,value:p},()=>this.onChange(d,p))}):null)}}class Sh extends U{async componentDidMount(){super.componentDidMount();const e=U.getValue(this.props.data,this.props.attr),n=(await this.props.oContext.socket.getCertificates()).filter(d=>{const i=this.props.attr.toLowerCase();return i.includes(d.type)||d.type==="public"&&i.includes("cert")||d.type==="private"&&(i.includes("priv")||i.includes("key"))?!0:!!(d.type==="chained"&&(i.includes("chain")||i.includes("ca")))}).map(d=>({label:d.name,value:d.name}));n.unshift({label:W.I18n.t(U.NONE_LABEL),value:U.NONE_VALUE}),this.setState({value:e,selectOptions:n})}renderItem(e,t){var d,i;if(!this.state.selectOptions)return null;const n=(d=this.state.selectOptions)==null?void 0:d.find(r=>r.value===this.state.value);return _.createElement(fe,{style:{width:"100%"},variant:"standard"},this.props.schema.label?_.createElement(Te,{shrink:!0},this.getText(this.props.schema.label)):null,_.createElement(Be,{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:r=>this.setState({value:r.target.value},()=>this.onChange(this.props.attr,this.state.value))},(i=this.state.selectOptions)==null?void 0:i.map(r=>_.createElement(xe,{key:r.value,value:r.value,style:r.value===U.NONE_VALUE?{opacity:.5}:{}},this.getText(r.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 Tn={fullWidth:{width:"100%"},leWidth:{width:620,marginBottom:10},certWidth:{width:200,marginRight:10}};class Dh extends U{async componentDidMount(){var p;super.componentDidMount();const e=await this.props.oContext.socket.getCertificates(),t=[],n=[],d=[];let i=[];const r=await this.props.oContext.socket.getObject("system.certificates");(p=r==null?void 0:r.native)!=null&&p.collections?i=Object.keys(r.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"?d.push({label:o.name,value:o.name}):(t.push({label:o.name,value:o.name}),n.push({label:o.name,value:o.name}),d.push({label:o.name,value:o.name}))}),t.unshift({label:W.I18n.t(U.NONE_LABEL),value:U.NONE_VALUE}),n.unshift({label:W.I18n.t(U.NONE_LABEL),value:U.NONE_VALUE}),d.unshift({label:W.I18n.t(U.NONE_LABEL),value:U.NONE_VALUE}),this.setState({certsPublicOptions:t,certsChainOptions:d,certsPrivateOptions:n,collectionsOptions:i})}renderItem(e,t){var s,a,c,u,h,f,g;if(!this.state.certsPublicOptions||!this.state.certsPrivateOptions||!this.state.certsChainOptions)return null;const n=(U.getValue(this.props.data,this.props.schema.leCollectionName||"leCollection")||"false").toString(),d=U.getValue(this.props.data,this.props.schema.certPublicName||"certPublic"),i=U.getValue(this.props.data,this.props.schema.certPrivateName||"certPrivate"),r=U.getValue(this.props.data,this.props.schema.certChainedName||"certChained"),p=(s=this.state.certsPublicOptions)==null?void 0:s.find(v=>v.value===d),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===r);return _.createElement("div",{style:Tn.fullWidth},this.state.collectionsOptions?_.createElement(fe,{style:Tn.leWidth,variant:"standard"},_.createElement(Te,{shrink:!0},"Let's encrypt"),_.createElement(Be,{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(xe,{key:"_false",value:"false",style:{fontWeight:"bold"}},W.I18n.t("ra_Do not use let's encrypt")),_.createElement(xe,{key:"_true",value:"true",style:{fontWeight:"bold"}},W.I18n.t("ra_Use all available let's encrypt certificates")),(u=this.state.collectionsOptions)==null?void 0:u.map(v=>_.createElement(xe,{key:v,value:v},v)))):null,this.state.collectionsOptions?_.createElement("br",null):null,this.state.collectionsOptions&&n!=="false"?_.createElement("div",null,W.I18n.t("ra_Fallback custom certificates")):null,_.createElement(fe,{style:Tn.certWidth,variant:"standard"},_.createElement(Te,{shrink:!0},W.I18n.t("ra_Public certificate")),_.createElement(Be,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:d||"",renderValue:()=>this.getText(p==null?void 0:p.label,!0),onChange:v=>this.onChange(this.props.schema.certPublicName||"certPublic",v.target.value)},(h=this.state.certsPublicOptions)==null?void 0:h.map((v,b)=>_.createElement(xe,{key:`${v.value}_${b}`,value:v.value,style:v.value===U.NONE_VALUE?{opacity:.5}:{}},this.getText(v.label,!0))))),_.createElement(fe,{style:Tn.certWidth,variant:"standard"},_.createElement(Te,{shrink:!0},W.I18n.t("ra_Private certificate")),_.createElement(Be,{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(xe,{key:`${v.value}_${b}`,value:v.value,style:v.value===U.NONE_VALUE?{opacity:.5}:{}},this.getText(v.label,!0))))),_.createElement(fe,{style:Tn.certWidth,variant:"standard"},_.createElement(Te,{shrink:!0},W.I18n.t("ra_Chained certificate")),_.createElement(Be,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:r||"",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(xe,{key:`${v.value}_${b}`,value:v.value,style:v.value===U.NONE_VALUE?{opacity:.5}:{}},this.getText(v.label,!0))))))}}class Ah extends U{async componentDidMount(){var n;super.componentDidMount();let e;const t=await this.props.oContext.socket.getObject("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 d;if(!this.state.collectionsOptions)return null;const n=(U.getValue(this.props.data,this.props.schema.leCollectionName||"leCollection")||"false").toString();return _.createElement(fe,{style:{width:"100%"},variant:"standard"},this.props.schema.label?_.createElement(Te,{shrink:!0},this.getText(this.props.schema.label)):null,_.createElement(Be,{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(xe,{key:"_false",value:"false",style:{fontWeight:"bold"}},W.I18n.t("ra_Do not use let's encrypt")),_.createElement(xe,{key:"_true",value:"true",style:{fontWeight:"bold"}},W.I18n.t("ra_Use all available let's encrypt certificates")),(d=this.state.collectionsOptions)==null?void 0:d.map(i=>_.createElement(xe,{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 $h extends U{async componentDidMount(){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?"":W.I18n.t("ra_Docker is not installed or not running"):W.I18n.t("ra_No response from admin")})})}renderItem(e,t){const n=U.getValue(this.props.data,this.props.attr);return this.state.requesting?_.createElement(Tt,null):this.state.errorDocker&&!n?_.createElement(ge,{style:{color:"orange"}},W.I18n.t("ra_Docker is not available"),": ",W.I18n.t(`ra_${this.state.errorDocker}`).replace(/^ra_/,"")):_.createElement(fe,{style:{width:"100%"},variant:"standard"},_.createElement(Qn,{onClick:d=>{if(d.preventDefault(),d.stopPropagation(),!t){const i=this.onChange(this.props.attr,!n);i instanceof Promise&&i.catch(r=>console.error(`Cannot set value: ${r}`))}},control:_.createElement(Qt,{checked:!!n,onChange:d=>{this.onChange(this.props.attr,d.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 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 At extends U{componentDidMount(){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(Se,{key:"button",variant:"contained",onClick:()=>window.open("https://iobroker.net/www/account/licenses","_blank")},W.I18n.t("iobroker.net"))),this.state.allLicenses.length?e.push(_.createElement(Do,{key:"table"},_.createElement(In,{size:"small"},_.createElement(Ao,null,_.createElement(ct,null,_.createElement(Ee,null,W.I18n.t("ra_Product")),_.createElement(Ee,null,W.I18n.t("ra_Version")),_.createElement(Ee,null,"UUID"),_.createElement(Ee,null,W.I18n.t("ra_ValidTill")),_.createElement(Ee,null,W.I18n.t("ra_Commercial")),_.createElement(Ee,null,"ID"))),_.createElement(On,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"},W.I18n.t("ra_No one license found in license manager"))),e.push(_.createElement("div",{key:"text2"},W.I18n.t("ra_Please create license"))))),_.createElement(Ut,{open:!0,maxWidth:"xl",fullWidth:this.props.fullWidth!==void 0?this.props.fullWidth:!0,onClick:()=>this.setState({_error:"",allLicenses:null})},_.createElement(gn,null,W.I18n.t("ra_Error")),_.createElement(mn,null,_.createElement(Ql,null,e)),_.createElement(vn,null,_.createElement(Se,{variant:"contained",onClick:()=>this.setState({_error:"",allLicenses:null}),color:"primary",autoFocus:!0,startIcon:_.createElement(Us,null)},W.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 d=t[n];Object.keys(d).forEach(i=>{d[i]!==null&&d[i]!==void 0&&(typeof d[i]=="object"?e.push(_.createElement("div",{key:i},_.createElement("div",{style:Ke.licLabel},i,":"),JSON.stringify(d[i],null,2))):e.push(_.createElement("div",{key:i},_.createElement("div",{style:Ke.licLabel},n," -",i,":"),d[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},W.I18n.t("ra_Checked"),":"),this.state.licenseOfflineCheck?W.I18n.t("ra_locally"):W.I18n.t("ra_via internet"))),_.createElement(Ut,{open:!0,onClose:()=>this.setState({showLicenseData:null})},_.createElement(gn,null,_.createElement(Ie,{component:"span",sx:this.state.result?Ke.okTitle:Ke.errorTitle},W.I18n.t("ra_License %s",this.state.result?"OK":"INVALID"))),_.createElement(mn,null,this.state.showLinkToProfile?_.createElement(Se,{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(vn,null,_.createElement(Se,{onClick:()=>this.setState({showLicenseData:null,_error:""}),color:"primary",variant:"contained"},W.I18n.t("ra_Close"))))}return null}static parseJwt(e){const n=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),d=decodeURIComponent(atob(n).split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));try{return JSON.parse(d)}catch{return null}}static isVersionValid(e,t,n,d){if(!t||!e)return!0;let i=!0;const[r]=e.split(".");return t.startsWith(">=")?i=parseInt(r,10)>=parseInt(t.substring(2,10)):t.startsWith("<=")?i=parseInt(r,10)<=parseInt(t.substring(2,10)):t.startsWith(">")?i=parseInt(r,10)>parseInt(t.substring(1,10)):t.startsWith("<")?i=parseInt(r,10)<parseInt(t.substring(1,10)):t.startsWith("=")?i=parseInt(r,10)===parseInt(t.substring(1,10)):t.startsWith("==")?i=parseInt(r,10)===parseInt(t.substring(2,10)):t.startsWith("===")&&(i=parseInt(r,10)===parseInt(t.substring(3,10))),!0}async findInLicenseManager(e){var d,i,r,p;const t=await this.props.oContext.socket.getObject("system.licenses"),n=[];if((i=(d=t==null?void 0:t.native)==null?void 0:d.licenses)!=null&&i.length){let o=null;const l=Date.now();let s;if(this.props.schema.uuid){const c=await this.props.oContext.socket.getObject("system.meta.uuid");s=(r=c==null?void 0:c.native)==null?void 0:r.uuid}let a;if(this.props.schema.version){const c=await this.props.oContext.socket.getObject(`system.adapter.${e}`);a=(p=c==null?void 0:c.common)==null?void 0:p.version}t.native.licenses.forEach(c=>{const u=!c.validTill||c.validTill==="0000-00-00 00:00:00"||new Date(c.validTill).getTime()>l,h=(c.product||"").split("."),f=h[1]===e||e==="vis-2"&&h[1]==="vis",g=!s||!c.uuid||c.uuid===s,v=At.isVersionValid(a,c.version,c.invoice,e);(!o||c.invoice!=="free")&&u&&f&&g&&v&&(o=c),n.push({id:c.id,validName:f,validUuid:g,validVersion:v,validTill:u,license:c})}),o&&(n.find(c=>c.id===o.id).used=!0)}return n}async checkLicense(e,t){var p,o,l;let n;if(this.props.schema.uuid){const s=await this.props.oContext.socket.getObject("system.meta.uuid");n=(p=s==null?void 0:s.native)==null?void 0:p.uuid}let d;if(this.props.schema.version){const s=await this.props.oContext.socket.getObject(`system.adapter.${t}`);d=(o=s==null?void 0:s.common)==null?void 0:o.version}const i=new AbortController;let r=setTimeout(()=>{r=null,i.abort()},5e3);try{const s=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});r&&clearTimeout(r);const a=await s.text();let c;try{c=JSON.parse(a)}catch{}if(c!=null&&c.error)try{const u=At.parseJwt(e),h=W.I18n.t(`ra_${u.error||c.error||"Unknown error"}`).replace(/^ra_/,"");return this.setState({_error:h,licenseOfflineCheck:!1,showLicenseData:u,result:!1,running:!1})}catch{return console.log("Cannot parse license"),this.setState({_error:c.error,result:!1,running:!1})}else{let u=null;try{u=At.parseJwt(e)}catch{}if(c){const h=c.validTill||c.valid_till;if(h&&h!=="0000-00-00 00:00:00"&&new Date(h).getTime()<Date.now())return this.setState({_error:W.I18n.t("ra_License expired on %s",new Date(h).toLocaleString()),licenseOfflineCheck:!1,showLicenseData:u,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:W.I18n.t("ra_License must be converted",c.uuid),showLinkToProfile:!0,licenseOfflineCheck:!1,showLicenseData:u,result:!1,running:!1}):n&&c.uuid&&c.uuid!==n?this.setState({_error:W.I18n.t('ra_Serial number (UUID) "%s" in license is for other device.',c.uuid),licenseOfflineCheck:!1,showLicenseData:u,result:!1,running:!1}):At.isVersionValid(d,c.version,c.invoice,t)?this.setState({licenseOfflineCheck:!1,showLicenseData:u,result:!0,running:!1}):this.setState({_error:W.I18n.t("ra_License is for version %s, but required version is %s",c.version,this.props.schema.version),licenseOfflineCheck:!1,showLicenseData:u,result:!1,running:!1}):this.setState({_error:W.I18n.t('ra_License for other product "%s"',c.name),licenseOfflineCheck:!1,showLicenseData:u,result:!1,running:!1})}throw new Error("ra_Invalid answer from server")}}catch(s){if(((l=s==null?void 0:s.response)==null?void 0:l.status)===404)return this.setState({_error:W.I18n.t("ra_License does not exist"),result:!1,running:!1});try{const a=At.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:W.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:W.I18n.t('ra_Serial number (UUID) "%s" in license is for other device.',a.uuid),showLicenseData:a,licenseOfflineCheck:!0,result:!1,running:!1}):At.isVersionValid(d,a.version,a.invoice,t)?this.setState({running:!1,result:!0,licenseOfflineCheck:!0,showLicenseData:a}):this.setState({_error:W.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:W.I18n.t('ra_License for other product "%s"',a.name),licenseOfflineCheck:!0,showLicenseData:a,result:!1,running:!1})}catch{return this.setState({_error:W.I18n.t("ra_Cannot decode license"),result:!1,licenseOfflineCheck:!0,running:!1})}}}renderAskForUpdate(){return this.state.askForUpdate?_.createElement(W.DialogConfirm,{text:W.I18n.t("ra_License not found in license manager. Do you want to read licenses from iobroker.net?"),ok:W.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(W.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,d;if(this.props.data.useLicenseManager){if(d=await this.findInLicenseManager(t),n=d.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:W.I18n.t("ra_Suitable license not found in license manager"),result:!1,running:!1,allLicenses:d}):this.setState({_error:W.I18n.t("ra_Please enter the license"),result:!1,running:!1})}renderItem(){return _.createElement("div",{style:Ke.fullWidth},_.createElement(Se,{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(ko,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 xh extends U{renderItem(e,t){const n=U.getValue(this.props.data,this.props.attr),d=Array.isArray(n);return _.createElement(fe,{style:{width:"100%"},variant:"standard"},_.createElement(Qn,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),!t){const r=this.onChange(this.props.attr,!n);r instanceof Promise&&r.catch(p=>console.error(`Cannot set value: ${p}`))}},control:_.createElement(Qt,{indeterminate:d,checked:!!n,onChange:i=>{let r;d?r=this.onChange(this.props.attr,!0):r=this.onChange(this.props.attr,i.target.checked),r instanceof Promise&&r.catch(p=>console.error(`Cannot set value: ${p}`))},disabled:t||this.props.schema.readOnly}),label:this.getText(this.props.schema.label)}),_.createElement(ge,{style:{color:"red"}},e?this.props.schema.validatorErrorText?W.I18n.t(this.props.schema.validatorErrorText):W.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 _h={standard:ql,filled:Zl,outlined:Xl},kh=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:{}}},ui={BACKSPACE:8,DELETE:46,LEFT_ARROW:37,RIGHT_ARROW:39},Th=({value:m,isFocused:e,isDisabled:t,isReadOnly:n,handleClick:d,handleDelete:i,style:r},p)=>_.createElement(zs,{key:p,style:{...r,pointerEvents:t||n?"none":void 0,backgroundColor:e?Gc[300]:void 0},onClick:d,onDelete:i,label:m});class Lh 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=Kc.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 d=(this.props.value||this.state.chips).length;this.inputBlurTimeout=setTimeout(()=>{const i=(this.props.value||this.state.chips).length;d===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 ui.BACKSPACE:e.target.value===""&&(t?(this.handleDeleteChip(n[t],t),t&&this.setState({focusedChip:t-1})):this.setState({focusedChip:n.length-1}));break;case ui.DELETE:e.target.value===""&&t&&(this.handleDeleteChip(n[t],t),t<=n.length-1&&this.setState({focusedChip:t}));break;case ui.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 ui.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=Th,className:n,disabled:d,disableUnderline:i,error:r,FormHelperTextProps:p,fullWidth:o,fullWidthInput:l,helperText:s,id:a,InputProps:c={},InputLabelProps:u={},inputValue:h,label:f,placeholder:g,readOnly:v,required:b,rootRef:A,value:S,margin:w}=this.props,y=this.state.variant;this.styleTheme!==this.props.theme.palette.mode&&(this.styleTheme=this.props.theme.palette.mode,this.styles=W.Utils.getStyle(this.props.theme,kh));let D=S||this.state.chips||[];Array.isArray(D)||(D=(D||"").toString().split(/[,\s]+/).map(E=>E.trim()));const T=h??this.state.inputValue,$=(this.props.value||T).length||T.length,M=typeof u.shrink=="boolean"?u.shrink:f!==null&&($||this.state.isFocused||D.length),O=D.map((E,C)=>t({value:E,isDisabled:!!d,isReadOnly:!!v,isFocused:this.state.focusedChip===C,handleClick:()=>this.setState({focusedChip:C}),handleDelete:()=>this.handleDeleteChip(E,C),style:this.styles.chip},C.toString())),x={};y==="outlined"&&(x.notched=!!M,x.labelWidth=M&&this.labelNode&&this.labelNode.offsetWidth||0),y!=="standard"?x.startAdornment=O:c.disableUnderline=!0;const k=_h[y];return _.createElement(fe,{ref:A,fullWidth:o,className:n,sx:{...this.styles.root,...w==="dense"?this.styles.marginDense:{}},error:r,required:D.length>0?void 0:b,onClick:this.focus,disabled:d,variant:y,component:"div",margin:w},f&&_.createElement(Te,{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",...u},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,...d?this.styles.disabled:void 0,...f?this.styles.labeled:void 0,...r?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:d,fullWidth:l,placeholder:!$&&(M||f===null||f===void 0)||e?g:void 0,readOnly:v,...c,...x})),s&&_.createElement(ge,{...p,className:p==null?void 0:p.className,style:this.styles.helperText},s))}}class Wr extends U{componentDidMount(){super.componentDidMount();const{data:e,attr:t}=this.props,n=U.getValue(e,t);if(this.props.schema.delimiter&&typeof n=="string"){const d=n.split(this.props.schema.delimiter).map(i=>i.trim()).filter(i=>i);this.setState({value:d})}else this.setState({value:n||[]})}renderItem(e,t){const{attr:n,schema:d}=this.props,{value:i}=this.state;return _.createElement(fe,{fullWidth:!0,variant:"standard"},_.createElement(Lh,{value:i,disabled:!!t,label:this.getText(d.label),error:!!e,onAdd:r=>{const p=JSON.parse(JSON.stringify(i));p.push(r),this.setState({value:p},()=>{let o;this.props.schema.delimiter?o=this.onChange(n,p.join(`${this.props.schema.delimiter} `)):o=this.onChange(n,p),o instanceof Promise&&o.catch(l=>console.error(l))})},theme:this.props.oContext.theme,onDelete:(r,p)=>{const o=JSON.parse(JSON.stringify(i));o.splice(p,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(s=>console.error(s))})}}),_.createElement(ge,null,W.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 Mh extends U{renderColorDialog(){return!!this.state.showColorDialog&&_.createElement(Ut,{onClose:()=>this.setState({showColorDialog:!1}),open:this.state.showColorDialog},_.createElement(Jc,{color:this.state.colorDialogValue,onChange:e=>this.setState({colorDialogValue:e.hex},()=>this.onChange(this.props.attr,this.state.colorDialogValue))}))}renderItem(e,t){const n=U.getValue(this.props.data,this.props.attr);let d=W.Utils.isUseBright(n,null);return d===null&&(d=void 0),_.createElement(_.Fragment,null,this.renderColorDialog(),_.createElement(de,{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 r=i.target.value,p=this.onChange(this.props.attr,r);p instanceof Promise&&p.catch(o=>console.error(`Cannot set value: ${o}`))},slotProps:{htmlInput:{style:{backgroundColor:n,color:d?"#FFF":"#000"},readOnly:this.props.schema.readOnly||!1},input:{endAdornment:!this.props.schema.readOnly&&n&&!this.props.schema.noClearButton?_.createElement(re,{tabIndex:-1,size:"small",onClick:i=>{i.stopPropagation();const r=this.onChange(this.props.attr,"");r instanceof Promise&&r.catch(p=>console.error(`Cannot set value: ${p}`))}},_.createElement(_t,null)):void 0},inputLabel:{shrink:!0}}}))}}const us={width:{width:"calc(100% - 85px)"},width50:{width:120,marginRight:5}};class Ih extends U{componentDidMount(){super.componentDidMount();const e=U.getValue(this.props.data,this.props.attr);this.setState({value:e});const t={};this.props.schema.useSystemName&&(t.useSystem=!!U.getValue(this.props.data,this.props.schema.useSystemName)),this.props.schema.longitudeName&&this.props.schema.latitudeName?(t.longitude=U.getValue(this.props.data,this.props.schema.longitudeName),t.latitude=U.getValue(this.props.data,this.props.schema.latitudeName),!t.longitude&&!t.latitude&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300)):!U.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(){const e=await this.props.oContext.socket.getCompactSystemConfig();if(e!=null&&e.common&&(e.common.longitude||e.common.latitude))if(window.alert(W.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(d=>console.error(`Cannot set value: ${d}`))})}else window.alert(W.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(d=>console.error(`Cannot set value: ${d}`))})}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(Qn,{control:_.createElement(Qt,{checked:!!this.state.useSystem,onChange:n=>{const d=n.target.checked;d&&this.getSystemCoordinates().catch(i=>console.error(`Cannot determine coordinates: ${i}`)),this.setState({useSystem:d},()=>this.onChange(this.props.schema.useSystemName,d))}}),label:W.I18n.t("ra_Use system settings for position")}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?_.createElement(de,{variant:"standard",style:us.width50,value:this.state.longitude??"",error:!!e,disabled:this.state.useSystem||!!t,onChange:n=>{const d=n.target.value;this.setState({longitude:d},()=>{const i=this.onChange(this.props.schema.longitudeName,(d||"").trim());i instanceof Promise&&i.catch(r=>console.error(`Cannot set value: ${r}`))})},label:W.I18n.t("ra_Longitude")}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?_.createElement(de,{variant:"standard",style:us.width50,value:this.state.latitude??"",error:!!e,disabled:this.state.useSystem||!!t,onChange:n=>{const d=n.target.value;this.setState({latitude:d},()=>this.onChange(this.props.schema.latitudeName,(d||"").trim()))},label:W.I18n.t("ra_Latitude")}):null,!this.props.schema.longitudeName||!this.props.schema.latitudeName?_.createElement(de,{variant:"standard",style:us.width,value:this.state.value===null||this.state.value===void 0?"":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 d=n.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)}):null,this.state.useSystem?null:_.createElement(ki,{size:"small",onClick:()=>this.getCoordinates(),title:W.I18n.t("ra_Take browser position"),style:{marginRight:4}},_.createElement(Cc,null)),this.state.useSystem?null:_.createElement(ki,{size:"small",onClick:()=>this.getSystemCoordinates(),title:W.I18n.t("ra_Take position from system settings")},_.createElement(Ec,null)))}}$s.init({name:"iobroker_admin",shared:{"@iobroker/adapter-react-v5":{lib:()=>Uc,version:"*"},"@mui/icons-material":{lib:()=>Sc,version:"*"},"@iobroker/json-config":{lib:()=>Xc,version:"*"}},remotes:[]});class Un extends U{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,...d]=this.props.schema.name.split("/"),i=d.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 r=Un.runningLoads[`${e}!${n}`];if(!(r instanceof Promise)){let p;if(this.props.schema.i18n===!0){const o=e.lastIndexOf("/");let l;o!==-1?l=e.substring(0,o):l=e;const s=W.I18n.getLanguage(),a=`${l}/i18n/${s}.json`;p=fetch(a).then(c=>c.json()).then(c=>W.I18n.extendTranslations(c,s)).catch(c=>{if(s!=="en"){fetch(`${l}/i18n/en.json`).then(u=>u.json()).then(u=>W.I18n.extendTranslations(u,s)).catch(u=>console.log(`Cannot load i18n "${a}": ${u}`));return}console.log(`Cannot load i18n "${a}": ${c}`)})}else if(this.props.schema.i18n&&typeof this.props.schema.i18n=="object")try{W.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}]),r=$s.loadRemote(`${t}/${n}`),p instanceof Promise&&(r=Promise.all([r,p]).then(o=>o[0])),Un.runningLoads[`${e}!${n}`]=r}catch(o){console.error(o),this.setState({error:`Cannot import from ${this.props.schema.url}: ${o}`})}}try{const p=(await r).default;if(p!=null&&p[i])this.setState({Component:p[i]});else{const o=Object.keys(p||{});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(p){console.error(p),this.setState({error:`Cannot import from ${this.props.schema.url}: ${p}`})}}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(Pi,null);return t.newLine?_.createElement(_.Fragment,null,_.createElement("div",{style:{flexBasis:"100%",height:0}}),n):n}}class Oh extends U{componentDidMount(){super.componentDidMount();const e=U.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(Yc,{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 d=this.state.value.toISOString();this.onChange(this.props.attr,d).catch(i=>console.warn(`Error saving value for ${this.props.attr}:`,i))}catch{}}),label:this.getText(this.props.schema.label)})}}class Fh extends U{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})}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}},Rh=["jpg","jpeg","svg","png","webp","gif","apng","avif","webp"],Nh=["mp3","ogg","wav","aac"],Bh=["avi","mp4","mov"],Ph=["txt","log","html","htm"],Wh=["json","js","ts"];class Wi extends U{dropzoneRef;imagePrefix;objectID;path;constructor(e){super(e),this.dropzoneRef=_.createRef(),this.imagePrefix=this.props.oContext.imagePrefix===void 0?"./files":this.props.oContext.imagePrefix}componentDidMount(){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=U.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 d=await this.props.oContext.socket.readDir(this.objectID,e.replace(/^\//,"")||null);for(let i=0;i<d.length;i++){const r=d[i];if(r.isDir)await this.readFolder(`${e+r.file}/`,t,n);else{let p=!1;n==="*.*"&&r.file.includes(".")||!n||n==="*"||n===".*"&&r.file.startsWith(".")?p=!0:p=new RegExp(`^${n.replace(/\./g,"\\.").replace(/\*/g,".*")}$`).test(r.file),p&&t.push({name:e+r.file,size:r.stats?W.Utils.formatBytes(r.stats.size):"--"})}}}catch(d){console.error(`Cannot read "${e}": ${d}`)}return t}async readFiles(e){const t=[];e=e||this.props.schema.pattern,e||(e="**/*.*");let n;const d=e.lastIndexOf("/");if(d===-1?n=e:n=e.substring(d+1),e.startsWith("**"))await this.readFolder("/",t,n);else{const i=e.lastIndexOf("/");if(i===-1)await this.readFolder("/",t,n);else{const r=e.substring(0,i+1);await this.readFolder(r,t,n)}}return t}onDrop(e){const t=e[0],n=new FileReader,d=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>d){window.alert(W.I18n.t("File is too big. Max %sk allowed. Try use SVG.",Math.round(d/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(W.DialogConfirm,{title:W.I18n.t("ra_Are you sure?"),text:W.I18n.t("ra_File will be deleted"),ok:W.I18n.t("ra_Delete"),cancel:W.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,d=new Uint8Array(n);for(let i=0;i<n;i++)d[i]=t.charCodeAt(i);return d.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=Wi.base64ToArrayBuffer(e.file);t.decodeAudioData(n,d=>{const i=t.createBufferSource();i.buffer=d,i.connect(t.destination),i.start(0)},d=>window.alert(`Cannot play: ${d.message}`))}})}getFileIcon(e){return e!=null&&e.extension?Rh.includes(e.extension)?_.createElement("div",{style:{...nt.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.objectID}/${e.value})`,backgroundSize:"contain",backgroundRepeat:"no-repeat"}}):Nh.includes(e.extension)?_.createElement(Dc,null):Ph.includes(e.extension)?_.createElement(Ro,null):Bh.includes(e.extension)?_.createElement(No,null):Wh.includes(e.extension)?_.createElement(Bo,null):null:null}renderItem(e,t){if(!this.state.files)return null;const n=[];this.props.schema.withFolder||this.state.files.forEach(s=>{const a=s.name.lastIndexOf("/");if(a===-1)n.includes("/")||n.push("/");else{const c=s.name.substring(0,a+1);n.includes(c)||n.push(c)}});const d=this.state.files.map(s=>({value:s.name,label:!this.props.schema.withFolder&&n.length===1?`${s.name.substring(n[0].length)}`:`${s.name}${this.props.schema.noSize?"":`(${s.size})`}`,extension:s.name.toLowerCase().split(".").pop()}));this.props.schema.noNone||d.unshift({label:W.I18n.t("ra_none"),value:""});const i=d.find(s=>s.value===this.state.value);let r=0;this.props.schema.upload&&r++,this.props.schema.refresh&&r++;const p=this.state.value&&(this.state.value.endsWith(".mp3")||this.state.value.endsWith(".ogg")||this.state.value.endsWith(".wav"));p&&r++;const o=_.createElement("div",{style:nt.fullWidth},_.createElement(fe,{variant:"standard",style:{width:`calc(100% - ${r*42}px)`}},this.props.schema.label?_.createElement(Te,null,this.getText(this.props.schema.label)):null,_.createElement(Be,{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:s=>{this.setState({value:s.target.value==="_"?"":s.target.value},()=>this.onChange(this.props.attr,this.state.value))}},d.map(s=>_.createElement(xe,{key:s.value,value:s.value},_.createElement($o,null,this.getFileIcon(s)),_.createElement(Hs,null,s.label),this.props.schema.delete&&i.value?_.createElement(re,{style:nt.deleteButton,size:"small",onClick:()=>this.setState({deleteFile:i.value})},_.createElement(xt,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(re,{onClick:()=>this.updateFiles()},_.createElement(Vs,null)),this.props.schema.upload&&_.createElement(re,{onClick:()=>{var s;return(s=this.dropzoneRef.current)==null?void 0:s.open()}},_.createElement(Hn,null)),p&&_.createElement(re,{style:{color:"#00FF00"},onClick:()=>this.play()},_.createElement(Ks,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 s=this.props.schema.pattern.split("/").pop().toLowerCase().replace(/.*\./,"");s==="png"||s==="jpg"||s==="svg"||s==="gif"||s==="apng"||s==="avif"||s==="webp"?l={"image/*":[".png",".jpg",".svg",".gif",".apng",".avif",".webp"]}:s==="mp3"||s==="ogg"||s==="wav"?l={"audio/*":[".mp3",".ogg",".wav",".mp4"]}:s==="ics"?l={"text/calendar":[".ics"]}:s==="txt"?l={"text/plain":[".txt"]}:s==="pem"?l={"text/plain":[".pem"]}:l={"*/*":[`.${s}`]}}return _.createElement(Wo,{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:(s,a)=>{var c,u,h;this.setState({uploadFile:!1}),s.length?this.onDrop(s):window.alert(((h=(u=(c=a==null?void 0:a[0])==null?void 0:c.errors)==null?void 0:u[0])==null?void 0:h.message)||W.I18n.t("Cannot upload"))}},({getRootProps:s,getInputProps:a})=>_.createElement("div",{style:{...nt.uploadDiv,...this.state.uploadFile==="dragging"?nt.uploadDivDragging:void 0,...t?nt.disabledOpacity:void 0},...s()},_.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(Hn,{style:nt.uploadCenterIcon}),_.createElement("div",{style:nt.uploadCenterText},this.state.uploadFile==="dragging"?W.I18n.t("ra_Drop file here"):W.I18n.t("ra_Place your files here or click here to open the browse dialog")))):null,o,this.renderDeleteDialog()))}}const di={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}},jh=["jpg","jpeg","svg","png","webp","gif","apng","avif","webp"],zh=["mp3","ogg","wav","aac"],Hh=["avi","mp4","mov"],Vh=["txt","log","html","htm"],Uh=["json","js","ts"];class Kh extends U{imagePrefix="../..";componentDidMount(){super.componentDidMount();const e=U.getValue(this.props.data,this.props.attr);this.imagePrefix=this.props.oContext.imagePrefix===void 0?"./files":this.props.oContext.imagePrefix,this.setState({value:e??""})}static getDerivedStateFromProps(e,t){const n=U.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=Wi.base64ToArrayBuffer(e.file);t.decodeAudioData(n,d=>{const i=t.createBufferSource();i.buffer=d,i.connect(t.destination),i.start(0)},d=>window.alert(`Cannot play: ${d.message}`))}})}getIcon(){const e=this.state.value.split(".").pop().toLowerCase();return jh.includes(e)?_.createElement("div",{style:{...di.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.state.value})`,backgroundSize:"contain",backgroundRepeat:"no-repeat"}}):zh.includes(e)?_.createElement(re,{style:{color:"#00FF00"},onClick:()=>this.play()},_.createElement(Ks,null)):Vh.includes(e)?_.createElement(Ro,null):Hh.includes(e)?_.createElement(No,null):Uh.includes(e)?_.createElement(Bo,null):null}renderFileBrowser(){return this.state.showFileBrowser?_.createElement(W.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:di.fullWidth},n,_.createElement(de,{variant:"standard",style:n?di.fullWidthIcon:di.fullWidthOneButton,value:this.state.value===null||this.state.value===void 0?"":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:d=>{const i=d.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(Se,{disabled:t,variant:"outlined",onClick:()=>this.setState({showFileBrowser:!0})},"..."),this.renderFileBrowser())}}class Gh extends U{componentDidMount(){super.componentDidMount();const e=U.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums("functions").then(t=>{const n=Object.keys(t).map(d=>({value:this.props.schema.short?d.replace("enum.functions.",""):d,label:this.getText(t[d].common.name),obj:t[d]}));this.props.schema.allowDeactivate!==!1&&n.unshift({label:W.I18n.t(U.NONE_LABEL),value:U.NONE_VALUE}),this.setState({value:e,selectOptions:n})})}renderItem(e,t){if(!this.state.selectOptions)return null;const n=this.state.selectOptions.find(d=>d.value===this.state.value);return _.createElement(fe,{variant:"standard",fullWidth:!0},this.props.schema.label?_.createElement(Te,null,this.getText(this.props.schema.label)):null,_.createElement(Be,{variant:"standard",error:!!e,disabled:!!t,value:this.state.value||"_",renderValue:()=>n?n.obj?_.createElement(W.TextWithIcon,{value:n.obj,themeType:this.props.oContext.themeType,lang:W.I18n.getLanguage()}):n.label:"",onChange:d=>{this.setState({value:d.target.value==="_"?"":d.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(d=>_.createElement(xe,{key:d.value,value:d.value,style:d.value===U.DIFFERENT_VALUE?{opacity:.5}:{}},d.obj?_.createElement(W.TextWithIcon,{value:d.obj,themeType:this.props.oContext.themeType,lang:W.I18n.getLanguage()}):d.label))),this.props.schema.help?_.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Jh extends U{iframeRef=_.createRef();observer=null;componentDidMount(){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||U.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 Yh extends U{initialized=!1;localContext;iframeRef=_.createRef();observer=null;componentDidMount(){super.componentDidMount(),this.askInstance(),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))}askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const t=this.getPattern(this.props.schema.jsonData,null,!0);if(t)try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${JSON.stringify(e)}`)}}e===void 0&&(e=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",e).then(t=>this.setState({url:t||""}))}}getContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=U.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 Qh extends U{componentDidMount(){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 - ${W.I18n.t("ra_Listen on all IPs")}`:t.address==="::"&&(t.name=`[IPv6] :: - ${W.I18n.t("ra_Listen on all IPs")}`)}),this.setState({ips:e})}).catch(e=>console.error(e))}renderItem(e,t){var i,r;const n=U.getValue(this.props.data,this.props.attr),d=(i=this.state.ips)==null?void 0:i.find(p=>p.address===n);return _.createElement(fe,{fullWidth:!0,variant:"standard"},this.state.ips&&this.props.schema.label?_.createElement(Te,null,this.getText(this.props.schema.label)):null,this.state.ips?_.createElement(Be,{variant:"standard",error:!!e,disabled:!!t,value:n,renderValue:p=>(d==null?void 0:d.name)||p,onChange:p=>this.onChange(this.props.attr,p.target.value)},(r=this.state.ips)==null?void 0:r.map((p,o)=>_.createElement(xe,{key:o,value:p.address},p.name))):_.createElement(de,{fullWidth:!0,variant:"standard",error:!!e,disabled:!!t,value:n,onChange:p=>this.onChange(this.props.attr,p.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 Xh extends U{initialized=!1;localContext;componentDidMount(){super.componentDidMount(),this.props.schema.sendFirstByClick||this.askInstance()}askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const t=this.getPattern(this.props.schema.jsonData,null,!0);if(t)try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${JSON.stringify(e)}`)}}e===void 0&&(e=null),this.setState({loading:!0},()=>this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",e).then(t=>this.setState({image:t||""})))}}getContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=U.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"?W.I18n.t("ra_Click to show"):this.getText(this.props.schema.sendFirstByClick,this.props.schema.noTranslation)):this.state.image===void 0?null:_.createElement("img",{title:this.getText(this.props.schema.tooltip),alt:"dynamic content",src:this.state.image,style:{width:this.props.schema.width||"100%",height:this.props.schema.height}})}}class Zh extends U{index;constructor(e){super(e),this.index=Date.now()}componentDidMount(){if(super.componentDidMount(),this.props.schema.base64){const e=U.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(Te,{shrink:!0},this.getText(this.props.schema.label)):null,_.createElement(W.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(d=>console.error(`Cannot set value: ${d}`))}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 d=this.onChange(this.props.attr,this.state.value);d instanceof Promise&&d.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(d=>console.error(d))})}),this.props.schema.help?_.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class qh extends U{renderItem(){return _.createElement(W.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 jr={icon:{width:20,height:20,marginRight:4}};class eu extends U{componentDidMount(){super.componentDidMount();const e=U.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 r;return(r=i==null?void 0:i.common)==null?void 0:r.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 r;return this.props.schema.adapters.includes((r=i==null?void 0:i.common)==null?void 0:r.name)})),this.props.schema.onlyEnabled&&(n=n.filter(i=>{var r;return(r=i==null?void 0:i.common)==null?void 0:r.enabled}));const d=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:`adapter/${i.common.name}/${i.common.icon}`}));d.sort((i,r)=>i.value>r.value?1:i.value<r.value?-1:0),this.props.schema.allowDeactivate!==!1&&d.unshift({label:W.I18n.t(U.NONE_LABEL),value:U.NONE_VALUE}),this.props.schema.all&&d.unshift({label:W.I18n.t("sch_all"),value:"*"}),this.setState({value:e||"",selectOptions:d}),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\./,""),d=this.state.selectOptions.findIndex(i=>i.value===n);if(t){if(this.props.schema.adapter==="_dataSources"&&(!t.common||!t.common.getHistory))return;if(d===-1){const i=JSON.parse(JSON.stringify(this.state.selectOptions)),r=typeof t.common.name=="object"?t.common.name[W.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:`${r} [${t._id.replace(/^system\.adapter\./,"")}]`,icon:`adapter/${r}/${t.common.icon}`}),i.sort((p,o)=>p.label>o.label?1:p.label<o.label?-1:0),this.setState({selectOptions:i})}}else if(d!==-1){const i=JSON.parse(JSON.stringify(this.state.selectOptions)),r={};this.state.value===i[d].value&&(r.value=U.NONE_VALUE),i.splice(d,1),r.selectOptions=i,this.setState(r)}};renderItem(e,t){var d;if(!this.state.selectOptions)return null;const n=(d=this.state.selectOptions)==null?void 0:d.find(i=>i.value===this.state.value);return _.createElement(fe,{fullWidth:!0,key:this.props.attr,variant:"standard"},this.props.schema.label?_.createElement(Te,{shrink:!0},this.getText(this.props.schema.label)):null,_.createElement(Be,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:this.state.value,renderValue:()=>_.createElement("span",{style:{display:"flex"}},n!=null&&n.icon?_.createElement("img",{src:`./${n.icon}`,alt:n.value,style:jr.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(xe,{key:i.value,value:i.value,style:i.value===U.NONE_VALUE?{opacity:.5}:{}},i.icon?_.createElement("img",{src:`./${i.icon}`,alt:i.value,style:jr.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 zr={address:{fontSize:"smaller",opacity:.5,marginLeft:8}};class tu extends U{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getObject(`system.host.${this.props.common.host}`).then(e=>{var n,d;const t=[];if((d=(n=e==null?void 0:e.native)==null?void 0:n.hardware)!=null&&d.networkInterfaces){const i=e.native.hardware.networkInterfaces;Object.keys(i).forEach(r=>{if(this.props.schema.ignoreInternal&&!i[r].find(o=>!o.internal)||this.props.schema.ignoreLoopback&&i[r].find(o=>o.address==="127.0.0.1"||o.address==="::1"))return;let p=i[r].find(o=>o.family==="IPv4");p||=i[r].find(o=>o.family==="IPv6"),t.push({value:r,address:p.address})})}this.setState({interfaces:t})}).catch(e=>window.alert(`Cannot read interfaces: ${e}`))}renderItem(e,t){var i,r,p;const n=U.getValue(this.props.data,this.props.attr),d=(i=this.state.interfaces)==null?void 0:i.find(o=>o.value===n);return _.createElement(fe,{fullWidth:!0,variant:"standard"},(r=this.state.interfaces)!=null&&r.length&&this.props.schema.label?_.createElement(Te,null,this.getText(this.props.schema.label)):null,(p=this.state.interfaces)!=null&&p.length?_.createElement(Be,{variant:"standard",error:!!e,disabled:!!t,value:n,renderValue:o=>d?_.createElement("span",null,d.value,_.createElement("span",{style:zr.address},d.address)):o,onChange:o=>this.onChange(this.props.attr,o.target.value)},this.state.interfaces.map((o,l)=>_.createElement(xe,{key:l,value:o.value},_.createElement("span",null,o.value,_.createElement("span",{style:zr.address},o.address))))):_.createElement(de,{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 nn={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:d,maxWidth:i,progress:r,icon:p,applyDisabled:o,applyButton:l,onClose:s,children:a,titleButtonApply:c,titleButtonClose:u,onApply:h,textInput:f,defaultValue:g,overflowHidden:v})=>{const[b,A]=Ul(g);Kl(()=>{A(g)},[g]);const S=ec(),w=tc(S.breakpoints.down("md"));let y=null;return p&&(y=p),_.createElement(Ut,{open:!0,maxWidth:w?!1:i||"md",fullWidth:!!n,fullScreen:w,disableEscapeKeyDown:!1,onClose:s,sx:{"& .MuiPaper-root":w?{}:nn.modalDialog}},t&&_.createElement(gn,null,p?_.createElement(y,{style:nn.titleIcon}):null,t,W.I18n.getLanguage()!=="en"&&m?_.createElement(re,{size:"large",style:{...nn.languageButton,...e?nn.languageButtonActive:{}},onClick:()=>m(),title:W.I18n.t("ra_Disable/Enable translation")},_.createElement(Ac,null)):null),_.createElement(mn,{sx:{...v?nn.overflowHidden:{},...nn.content},style:{paddingTop:8}},f&&_.createElement(de,{autoComplete:"off",fullWidth:!0,autoFocus:!0,variant:"outlined",size:"medium",multiline:!0,value:b,onChange:D=>A(D.target.value)}),a,d?_.createElement("div",null,d):null),_.createElement(vn,null,l!==!1&&_.createElement(Se,{startIcon:_.createElement(Us,null),disabled:r||o&&g===b,onClick:()=>h&&h(f?b:""),variant:"contained",color:"primary"},W.I18n.t(c||"ra_Ok")),_.createElement(Se,{color:"grey",onClick:()=>s&&s(),disabled:r,variant:"contained",startIcon:_.createElement(_t,null)},W.I18n.t(u||"ra_Cancel"))))};var yn={},Gt={},Uo={exports:{}};(function(m,e){(function(){var t="ace",n=(function(){return this})();!n&&typeof window<"u"&&(n=window);var d=function(s,a,c){if(typeof s!="string"){d.original?d.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(c=a),d.modules[s]||(d.payloads[s]=c,d.modules[s]=null)};d.modules={},d.payloads={};var i=function(s,a,c){if(typeof a=="string"){var u=o(s,a);if(u!=null)return c&&c(),u}else if(Object.prototype.toString.call(a)==="[object Array]"){for(var h=[],f=0,g=a.length;f<g;++f){var v=o(s,a[f]);if(v==null&&r.original)return;h.push(v)}return c&&c.apply(null,h)||!0}},r=function(s,a){var c=i("",s,a);return c==null&&r.original?r.original.apply(this,arguments):c},p=function(s,a){if(a.indexOf("!")!==-1){var c=a.split("!");return p(s,c[0])+"!"+p(s,c[1])}if(a.charAt(0)=="."){var u=s.split("/").slice(0,-1).join("/");for(a=u+"/"+a;a.indexOf(".")!==-1&&h!=a;){var h=a;a=a.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return a},o=function(s,a){a=p(s,a);var c=d.modules[a];if(!c){if(c=d.payloads[a],typeof c=="function"){var u={},h={id:a,uri:"",exports:u,packaged:!0},f=function(v,b){return i(a,v,b)},g=c(f,u,h);u=g||h.exports,d.modules[a]=u,delete d.payloads[a]}c=d.modules[a]=u||c}return c};function l(s){var a=n;n[s]||(n[s]={}),a=n[s],(!a.define||!a.define.packaged)&&(d.original=a.define,a.define=d,a.define.packaged=!0),(!a.require||!a.require.packaged)&&(r.original=a.require,a.require=r,a.require.packaged=!0)}l(t)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(t,n,d){function i(r,p,o){Object.defineProperty(r,p,{value:o,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||i(String.prototype,"startsWith",function(r,p){return p=p||0,this.lastIndexOf(r,p)===p}),String.prototype.endsWith||i(String.prototype,"endsWith",function(r,p){var o=this;(p===void 0||p>o.length)&&(p=o.length),p-=r.length;var l=o.indexOf(r,p);return l!==-1&&l===p}),String.prototype.repeat||i(String.prototype,"repeat",function(r){for(var p="",o=this;r>0;)r&1&&(p+=o),(r>>=1)&&(o+=o);return p}),String.prototype.includes||i(String.prototype,"includes",function(r,p){return this.indexOf(r,p)!=-1}),Object.assign||(Object.assign=function(r){if(r==null)throw new TypeError("Cannot convert undefined or null to object");for(var p=Object(r),o=1;o<arguments.length;o++){var l=arguments[o];l!=null&&Object.keys(l).forEach(function(s){p[s]=l[s]})}return p}),Object.values||(Object.values=function(r){return Object.keys(r).map(function(p){return r[p]})}),Array.prototype.find||i(Array.prototype,"find",function(r){for(var p=this.length,o=arguments[1],l=0;l<p;l++){var s=this[l];if(r.call(o,s,l,this))return s}}),Array.prototype.findIndex||i(Array.prototype,"findIndex",function(r){for(var p=this.length,o=arguments[1],l=0;l<p;l++){var s=this[l];if(r.call(o,s,l,this))return l}}),Array.prototype.includes||i(Array.prototype,"includes",function(r,p){return this.indexOf(r,p)!=-1}),Array.prototype.fill||i(Array.prototype,"fill",function(r){for(var p=this,o=p.length>>>0,l=arguments[1],s=l>>0,a=s<0?Math.max(o+s,0):Math.min(s,o),c=arguments[2],u=c===void 0?o:c>>0,h=u<0?Math.max(o+u,0):Math.min(u,o);a<h;)p[a]=r,a++;return p}),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,d){t("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(t,n,d){n.deepCopy=function i(r){if(typeof r!="object"||!r)return r;var p;if(Array.isArray(r)){p=[];for(var o=0;o<r.length;o++)p[o]=i(r[o]);return p}if(Object.prototype.toString.call(r)!=="[object Object]")return r;p={};for(var o in r)p[o]=i(r[o]);return p}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(t,n,d){n.last=function(p){return p[p.length-1]},n.stringReverse=function(p){return p.split("").reverse().join("")},n.stringRepeat=function(p,o){for(var l="";o>0;)o&1&&(l+=p),(o>>=1)&&(p+=p);return l};var i=/^\s\s*/,r=/\s\s*$/;n.stringTrimLeft=function(p){return p.replace(i,"")},n.stringTrimRight=function(p){return p.replace(r,"")},n.copyObject=function(p){var o={};for(var l in p)o[l]=p[l];return o},n.copyArray=function(p){for(var o=[],l=0,s=p.length;l<s;l++)p[l]&&typeof p[l]=="object"?o[l]=this.copyObject(p[l]):o[l]=p[l];return o},n.deepCopy=t("./deep_copy").deepCopy,n.arrayToMap=function(p){for(var o={},l=0;l<p.length;l++)o[p[l]]=1;return o},n.createMap=function(p){var o=Object.create(null);for(var l in p)o[l]=p[l];return o},n.arrayRemove=function(p,o){for(var l=0;l<=p.length;l++)o===p[l]&&p.splice(l,1)},n.escapeRegExp=function(p){return p.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},n.escapeHTML=function(p){return(""+p).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},n.getMatchOffsets=function(p,o){var l=[];return p.replace(o,function(s){l.push({offset:arguments[arguments.length-2],length:s.length})}),l},n.deferredCall=function(p){var o=null,l=function(){o=null,p()},s=function(a){return s.cancel(),o=setTimeout(l,a||0),s};return s.schedule=s,s.call=function(){return this.cancel(),p(),s},s.cancel=function(){return clearTimeout(o),o=null,s},s.isPending=function(){return o},s},n.delayedCall=function(p,o){var l=null,s=function(){l=null,p()},a=function(c){l==null&&(l=setTimeout(s,c||o))};return a.delay=function(c){l&&clearTimeout(l),l=setTimeout(s,c||o)},a.schedule=a,a.call=function(){this.cancel(),p()},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(p,o,l){return l&&p.codePointAt(o)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(t,n,d){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:{},r=(/mac|win|linux/i.exec(i.platform)||["other"])[0].toLowerCase(),p=i.userAgent||"",o=i.appName||"";n.isWin=r=="win",n.isMac=r=="mac",n.isLinux=r=="linux",n.isIE=o=="Microsoft Internet Explorer"||o.indexOf("MSAppHost")>=0?parseFloat((p.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((p.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),n.isOldIE=n.isIE&&n.isIE<9,n.isGecko=n.isMozilla=p.match(/ Gecko\/\d+/),n.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",n.isWebKit=parseFloat(p.split("WebKit/")[1])||void 0,n.isChrome=parseFloat(p.split(" Chrome/")[1])||void 0,n.isSafari=parseFloat(p.split(" Safari/")[1])&&!n.isChrome||void 0,n.isEdge=parseFloat(p.split(" Edge/")[1])||void 0,n.isAIR=p.indexOf("AdobeAIR")>=0,n.isAndroid=p.indexOf("Android")>=0,n.isChromeOS=p.indexOf(" CrOS ")>=0,n.isIOS=/iPad|iPhone|iPod/.test(p)&&!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,d){var i=t("./useragent"),r="http://www.w3.org/1999/xhtml";n.buildDom=function c(u,h,f){if(typeof u=="string"&&u){var g=document.createTextNode(u);return h&&h.appendChild(g),g}if(!Array.isArray(u))return u&&u.appendChild&&h&&h.appendChild(u),u;if(typeof u[0]!="string"||!u[0]){for(var v=[],b=0;b<u.length;b++){var A=c(u[b],h,f);A&&v.push(A)}return v}var S=document.createElement(u[0]),w=u[1],y=1;w&&typeof w=="object"&&!Array.isArray(w)&&(y=2);for(var b=y;b<u.length;b++)c(u[b],S,f);return y==2&&Object.keys(w).forEach(function(D){var T=w[D];D==="class"?S.className=Array.isArray(T)?T.join(" "):T:typeof T=="function"||D=="value"||D[0]=="$"?S[D]=T:D==="ref"?f&&(f[T]=S):D==="style"?typeof T=="string"&&(S.style.cssText=T):T!=null&&S.setAttribute(D,T)}),h&&h.appendChild(S),S},n.getDocumentHead=function(c){return c||(c=document),c.head||c.getElementsByTagName("head")[0]||c.documentElement},n.createElement=function(c,u){return document.createElementNS?document.createElementNS(u||r,c):document.createElement(c)},n.removeChildren=function(c){c.innerHTML=""},n.createTextNode=function(c,u){var h=u?u.ownerDocument:document;return h.createTextNode(c)},n.createFragment=function(c){var u=c?c.ownerDocument:document;return u.createDocumentFragment()},n.hasCssClass=function(c,u){var h=(c.className+"").split(/\s+/g);return h.indexOf(u)!==-1},n.addCssClass=function(c,u){n.hasCssClass(c,u)||(c.className+=" "+u)},n.removeCssClass=function(c,u){for(var h=c.className.split(/\s+/g);;){var f=h.indexOf(u);if(f==-1)break;h.splice(f,1)}c.className=h.join(" ")},n.toggleCssClass=function(c,u){for(var h=c.className.split(/\s+/g),f=!0;;){var g=h.indexOf(u);if(g==-1)break;f=!1,h.splice(g,1)}return f&&h.push(u),c.className=h.join(" "),f},n.setCssClass=function(c,u,h){h?n.addCssClass(c,u):n.removeCssClass(c,u)},n.hasCssString=function(c,u){var h=0,f;if(u=u||document,f=u.querySelectorAll("style")){for(;h<f.length;)if(f[h++].id===c)return!0}},n.removeElementById=function(c,u){u=u||document,u.getElementById(c)&&u.getElementById(c).remove()};var p,o=[];n.useStrictCSP=function(c){p=c,c==!1?l():o||(o=[])};function l(){var c=o;o=null,c&&c.forEach(function(u){s(u[0],u[1])})}function s(c,u,h){if(!(typeof document>"u")){if(o){if(h)l();else if(h===!1)return o.push([c,u])}if(!p){var f=h;!h||!h.getRootNode?f=document:(f=h.getRootNode(),(!f||f==h)&&(f=document));var g=f.ownerDocument||f;if(u&&n.hasCssString(u,f))return null;u&&(c+=`
16
+ /*# sourceURL=ace/css/`+u+" */");var v=n.createElement("style");v.appendChild(g.createTextNode(c)),u&&(v.id=u),f==g&&(f=n.getDocumentHead(g)),f.insertBefore(v,f.firstChild)}}}if(n.importCssString=s,n.importCssStylsheet=function(c,u){n.buildDom(["link",{rel:"stylesheet",href:c}],n.getDocumentHead(u))},n.$fixPositionBug=function(c){var u=c.getBoundingClientRect();if(c.style.left){var h=parseFloat(c.style.left),f=+u.left;Math.abs(h-f)>1&&(c.style.left=2*h-f+"px")}if(c.style.right){var h=parseFloat(c.style.right),f=window.innerWidth-u.right;Math.abs(h-f)>1&&(c.style.right=2*h-f+"px")}if(c.style.top){var h=parseFloat(c.style.top),f=+u.top;Math.abs(h-f)>1&&(c.style.top=2*h-f+"px")}if(c.style.bottom){var h=parseFloat(c.style.bottom),f=window.innerHeight-u.bottom;Math.abs(h-f)>1&&(c.style.bottom=2*h-f+"px")}},n.scrollbarWidth=function(c){var u=n.createElement("ace_inner");u.style.width="100%",u.style.minWidth="0px",u.style.height="200px",u.style.display="block";var h=n.createElement("ace_outer"),f=h.style;f.position="absolute",f.left="-10000px",f.overflow="hidden",f.width="200px",f.minWidth="0px",f.height="150px",f.display="block",h.appendChild(u);var g=c&&c.documentElement||document&&document.documentElement;if(!g)return 0;g.appendChild(h);var v=u.offsetWidth;f.overflow="scroll";var b=u.offsetWidth;return v===b&&(b=h.clientWidth),g.removeChild(h),v-b},n.computedStyle=function(c,u){return window.getComputedStyle(c,"")||{}},n.setStyle=function(c,u,h){c[u]!==h&&(c[u]=h)},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,u,h){c.style.transform="translate("+Math.round(u)+"px, "+Math.round(h)+"px)"}:n.translate=function(c,u,h){c.style.top=Math.round(h)+"px",c.style.left=Math.round(u)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(t,n,d){var i=t("./dom");n.get=function(r,p){var o=new XMLHttpRequest;o.open("GET",r,!0),o.onreadystatechange=function(){o.readyState===4&&p(o.responseText)},o.send(null)},n.loadScript=function(r,p){var o=i.getDocumentHead(),l=document.createElement("script");l.src=r,o.appendChild(l),l.onload=l.onreadystatechange=function(s,a){(a||!l.readyState||l.readyState=="loaded"||l.readyState=="complete")&&(l=l.onload=l.onreadystatechange=null,a||p())}},n.qualifyURL=function(r){var p=document.createElement("a");return p.href=r,p.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(t,n,d){n.inherits=function(i,r){i.super_=r,i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}})},n.mixin=function(i,r){for(var p in r)i[p]=r[p];return i},n.implement=function(i,r){n.mixin(i,r)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(t,n,d){var i={},r=function(){this.propagationStopped=!0},p=function(){this.defaultPrevented=!0};i._emit=i._dispatchEvent=function(o,l){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var s=this._eventRegistry[o]||[],a=this._defaultHandlers[o];if(!(!s.length&&!a)){(typeof l!="object"||!l)&&(l={}),l.type||(l.type=o),l.stopPropagation||(l.stopPropagation=r),l.preventDefault||(l.preventDefault=p),s=s.slice();for(var c=0;c<s.length&&(s[c](l,this),!l.propagationStopped);c++);if(a&&!l.defaultPrevented)return a(l,this)}},i._signal=function(o,l){var s=(this._eventRegistry||{})[o];if(s){s=s.slice();for(var a=0;a<s.length;a++)s[a](l,this)}},i.once=function(o,l){var s=this;if(this.on(o,function a(){s.off(o,a),l.apply(null,arguments)}),!l)return new Promise(function(a){l=a})},i.setDefaultHandler=function(o,l){var s=this._defaultHandlers;if(s||(s=this._defaultHandlers={_disabled_:{}}),s[o]){var a=s[o],c=s._disabled_[o];c||(s._disabled_[o]=c=[]),c.push(a);var u=c.indexOf(l);u!=-1&&c.splice(u,1)}s[o]=l},i.removeDefaultHandler=function(o,l){var s=this._defaultHandlers;if(s){var a=s._disabled_[o];if(s[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,s){this._eventRegistry=this._eventRegistry||{};var a=this._eventRegistry[o];return a||(a=this._eventRegistry[o]=[]),a.indexOf(l)==-1&&a[s?"unshift":"push"](l),l},i.off=i.removeListener=i.removeEventListener=function(o,l){this._eventRegistry=this._eventRegistry||{};var s=this._eventRegistry[o];if(s){var a=s.indexOf(l);a!==-1&&s.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,d){n.reportError=function(r,p){var o=new Error(r);o.data=p,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,d){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,d){"no use strict";var i=t("./oop"),r=t("./event_emitter").EventEmitter,p=t("./report_error").reportError,o=t("./default_english_messages").defaultEnglishMessages,l={setOptions:function(h){Object.keys(h).forEach(function(f){this.setOption(f,h[f])},this)},getOptions:function(h){var f={};if(h)Array.isArray(h)||(h=Object.keys(h));else{var g=this.$options;h=Object.keys(g).filter(function(v){return!g[v].hidden})}return h.forEach(function(v){f[v]=this.getOption(v)},this),f},setOption:function(h,f){if(this["$"+h]!==f){var g=this.$options[h];if(!g)return s('misspelled option "'+h+'"');if(g.forwardTo)return this[g.forwardTo]&&this[g.forwardTo].setOption(h,f);g.handlesSet||(this["$"+h]=f),g&&g.set&&g.set.call(this,f)}},getOption:function(h){var f=this.$options[h];return f?f.forwardTo?this[f.forwardTo]&&this[f.forwardTo].getOption(h):f&&f.get?f.get.call(this):this["$"+h]:s('misspelled option "'+h+'"')}};function s(h){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var a,c,u=(function(){function h(){this.$defaultOptions={},a=o,c="dollarSigns"}return h.prototype.defineOptions=function(f,g,v){return f.$options||(this.$defaultOptions[g]=f.$options={}),Object.keys(v).forEach(function(b){var A=v[b];typeof A=="string"&&(A={forwardTo:A}),A.name||(A.name=b),f.$options[A.name]=A,"initialValue"in A&&(f["$"+A.name]=A.initialValue)}),i.implement(f,l),this},h.prototype.resetOptions=function(f){Object.keys(f.$options).forEach(function(g){var v=f.$options[g];"value"in v&&f.setOption(g,v.value)})},h.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)},h.prototype.setDefaultValues=function(f,g){Object.keys(g).forEach(function(v){this.setDefaultValue(f,v,g[v])},this)},h.prototype.setMessages=function(f,g){a=f,g&&g.placeholders&&(c=g.placeholders)},h.prototype.nls=function(f,g,v){a[f]||(s("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]||s("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(A,S){return S=="$"?"$":v[S]})),c==="curlyBrackets"&&(b=b.replace(/\{([^\}]+)\}/g,function(A,S){return v[S]}))),b},h})();u.prototype.warn=s,u.prototype.reportError=p,i.implement(u.prototype,r),n.AppConfig=u}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(t,n,d){d.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,d){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,d){"no use strict";var i=t("./lib/lang"),r=t("./lib/net"),p=t("./lib/dom"),o=t("./lib/app_config").AppConfig;d.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(u){if(!l.hasOwnProperty(u))throw new Error("Unknown config key: "+u);return l[u]},n.set=function(u,h){if(l.hasOwnProperty(u))l[u]=h;else if(this.setDefaultValue("",u,h)==!1)throw new Error("Unknown config key: "+u);u=="useStrictCSP"&&p.useStrictCSP(h)},n.all=function(){return i.copyObject(l)},n.$modes={},n.moduleUrl=function(u,h){if(l.$moduleUrls[u])return l.$moduleUrls[u];var f=u.split("/");h=h||f[f.length-2]||"";var g=h=="snippets"?"/":"-",v=f[f.length-1];if(h=="worker"&&g=="-"){var b=new RegExp("^"+h+"[\\-_]|[\\-_]"+h+"$","g");v=v.replace(b,"")}(!v||v==h)&&f.length>1&&(v=f[f.length-2]);var A=l[h+"Path"];return A==null?A=l.basePath:g=="/"&&(h=g=""),A&&A.slice(-1)!="/"&&(A+="/"),A+h+g+v+this.get("suffix")},n.setModuleUrl=function(u,h){return l.$moduleUrls[u]=h};var s=function(u,h){if(u==="ace/theme/textmate"||u==="./theme/textmate")return h(null,t("./theme/textmate"));if(a)return a(u,h);console.error("loader is not configured")},a;n.setLoader=function(u){a=u},n.dynamicModules=Object.create(null),n.$loading={},n.$loaded={},n.loadModule=function(u,h){var f;if(Array.isArray(u))var g=u[0],v=u[1];else if(typeof u=="string")var v=u;var b=function(A){if(A&&!n.$loading[v])return h&&h(A);if(n.$loading[v]||(n.$loading[v]=[]),n.$loading[v].push(h),!(n.$loading[v].length>1)){var S=function(){s(v,function(w,y){y&&(n.$loaded[v]=y),n._emit("load.module",{name:v,module:y});var D=n.$loading[v];n.$loading[v]=null,D.forEach(function(T){T&&T(y)})})};if(!n.get("packaged"))return S();r.loadScript(n.moduleUrl(v,g),S),c()}};if(n.dynamicModules[v])n.dynamicModules[v]().then(function(A){A.default?b(A.default):b(A)});else{try{f=this.$require(v)}catch{}b(f||n.$loaded[v])}},n.$require=function(u){if(typeof d.require=="function"){var h="require";return d[h](u)}},n.setModuleLoader=function(u,h){n.dynamicModules[u]=h};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,d){t("./lib/fixoldbrowsers");var i=t("./config");i.setLoader(function(l,s){t([l],function(a){s(null,a)})});var r=(function(){return this||typeof window<"u"&&window})();d.exports=function(l){i.init=p,i.$require=t,l.require=t},p(!0);function p(l){if(!(!r||!r.document)){i.set("packaged",l||t.packaged||d.packaged||r.define&&(void 0).packaged);var s={},a="",c=document.currentScript||document._currentScript,u=c&&c.ownerDocument||document;c&&c.src&&(a=c.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var h=u.getElementsByTagName("script"),f=0;f<h.length;f++){var g=h[f],v=g.src||g.getAttribute("src");if(v){for(var b=g.attributes,A=0,S=b.length;A<S;A++){var w=b[A];w.name.indexOf("data-ace-")===0&&(s[o(w.name.replace(/^data-ace-/,""))]=w.value)}var y=v.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);y&&(a=y[1])}}a&&(s.base=s.base||a,s.packaged=!0),s.basePath=s.base,s.workerPath=s.workerPath||s.base,s.modePath=s.modePath||s.base,s.themePath=s.themePath||s.base,delete s.base;for(var D in s)typeof s[D]<"u"&&i.set(D,s[D])}}function o(l){return l.replace(/-(.)/g,function(s,a){return a.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(t,n,d){var i=(function(){function r(p,o,l,s){this.start={row:p,column:o},this.end={row:l,column:s}}return r.prototype.isEqual=function(p){return this.start.row===p.start.row&&this.end.row===p.end.row&&this.start.column===p.start.column&&this.end.column===p.end.column},r.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},r.prototype.contains=function(p,o){return this.compare(p,o)==0},r.prototype.compareRange=function(p){var o,l=p.end,s=p.start;return o=this.compare(l.row,l.column),o==1?(o=this.compare(s.row,s.column),o==1?2:o==0?1:0):o==-1?-2:(o=this.compare(s.row,s.column),o==-1?-1:o==1?42:0)},r.prototype.comparePoint=function(p){return this.compare(p.row,p.column)},r.prototype.containsRange=function(p){return this.comparePoint(p.start)==0&&this.comparePoint(p.end)==0},r.prototype.intersects=function(p){var o=this.compareRange(p);return o==-1||o==0||o==1},r.prototype.isEnd=function(p,o){return this.end.row==p&&this.end.column==o},r.prototype.isStart=function(p,o){return this.start.row==p&&this.start.column==o},r.prototype.setStart=function(p,o){typeof p=="object"?(this.start.column=p.column,this.start.row=p.row):(this.start.row=p,this.start.column=o)},r.prototype.setEnd=function(p,o){typeof p=="object"?(this.end.column=p.column,this.end.row=p.row):(this.end.row=p,this.end.column=o)},r.prototype.inside=function(p,o){return this.compare(p,o)==0?!(this.isEnd(p,o)||this.isStart(p,o)):!1},r.prototype.insideStart=function(p,o){return this.compare(p,o)==0?!this.isEnd(p,o):!1},r.prototype.insideEnd=function(p,o){return this.compare(p,o)==0?!this.isStart(p,o):!1},r.prototype.compare=function(p,o){return!this.isMultiLine()&&p===this.start.row?o<this.start.column?-1:o>this.end.column?1:0:p<this.start.row?-1:p>this.end.row?1:this.start.row===p?o>=this.start.column?0:-1:this.end.row===p?o<=this.end.column?0:1:0},r.prototype.compareStart=function(p,o){return this.start.row==p&&this.start.column==o?-1:this.compare(p,o)},r.prototype.compareEnd=function(p,o){return this.end.row==p&&this.end.column==o?1:this.compare(p,o)},r.prototype.compareInside=function(p,o){return this.end.row==p&&this.end.column==o?1:this.start.row==p&&this.start.column==o?-1:this.compare(p,o)},r.prototype.clipRows=function(p,o){if(this.end.row>o)var l={row:o+1,column:0};else if(this.end.row<p)var l={row:p,column:0};if(this.start.row>o)var s={row:o+1,column:0};else if(this.start.row<p)var s={row:p,column:0};return r.fromPoints(s||this.start,l||this.end)},r.prototype.extend=function(p,o){var l=this.compare(p,o);if(l==0)return this;if(l==-1)var s={row:p,column:o};else var a={row:p,column:o};return r.fromPoints(s||this.start,a||this.end)},r.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},r.prototype.isMultiLine=function(){return this.start.row!==this.end.row},r.prototype.clone=function(){return r.fromPoints(this.start,this.end)},r.prototype.collapseRows=function(){return this.end.column==0?new r(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new r(this.start.row,0,this.end.row,0)},r.prototype.toScreenRange=function(p){var o=p.documentToScreenPosition(this.start),l=p.documentToScreenPosition(this.end);return new r(o.row,o.column,l.row,l.column)},r.prototype.moveBy=function(p,o){this.start.row+=p,this.start.column+=o,this.end.row+=p,this.end.column+=o},r})();i.fromPoints=function(r,p){return new i(r.row,r.column,p.row,p.column)},i.comparePoints=function(r,p){return r.row-p.row||r.column-p.column},n.Range=i}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(t,n,d){for(var i=t("./oop"),r={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:"*"}},p={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++)p["Digit"+o]=48+o,p["Numpad"+o]=96+o,r.PRINTABLE_KEYS[48+o]=""+o,r.FUNCTION_KEYS[96+o]="Numpad"+o;for(var o=65;o<91;o++){var l=String.fromCharCode(o+32);p["Key"+l.toUpperCase()]=o,r.PRINTABLE_KEYS[o]=l}for(var o=1;o<13;o++)p["F"+o]=111+o,r.FUNCTION_KEYS[111+o]="F"+o;var s={Shift:16,Control:17,Alt:18,Meta:224};for(var a in s)p[a]=p[a+"Left"]=p[a+"Right"]=s[a];n.$codeToKeyCode=p,r.PRINTABLE_KEYS[173]="-";for(var c in r.FUNCTION_KEYS){var u=r.FUNCTION_KEYS[c].toLowerCase();r[u]=parseInt(c,10)}for(var c in r.PRINTABLE_KEYS){var u=r.PRINTABLE_KEYS[c].toLowerCase();r[u]=parseInt(c,10)}i.mixin(r,r.MODIFIER_KEYS),i.mixin(r,r.PRINTABLE_KEYS),i.mixin(r,r.FUNCTION_KEYS),r.enter=r.return,r.escape=r.esc,r.del=r.delete,(function(){for(var h=["cmd","ctrl","alt","shift"],f=Math.pow(2,h.length);f--;)r.KEY_MODS[f]=h.filter(function(g){return f&r.KEY_MODS[g]}).join("-")+"-"})(),r.KEY_MODS[0]="",r.KEY_MODS[-1]="input-",i.mixin(n,r),n.default=n,n.keyCodeToString=function(h){var f=r[h];return typeof f!="string"&&(f=String.fromCharCode(h)),f.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,d){var i=t("./keys"),r=t("./useragent"),p=null,o=0,l;function s(){l=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return l={passive:!1},!0}})}catch{}}function a(){return l==null&&s(),l}function c(A,S,w){this.elem=A,this.type=S,this.callback=w}c.prototype.destroy=function(){h(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var u=n.addListener=function(A,S,w,y){A.addEventListener(S,w,a()),y&&y.$toDestroy.push(new c(A,S,w))},h=n.removeListener=function(A,S,w){A.removeEventListener(S,w,a())};n.stopEvent=function(A){return n.stopPropagation(A),n.preventDefault(A),!1},n.stopPropagation=function(A){A.stopPropagation&&A.stopPropagation()},n.preventDefault=function(A){A.preventDefault&&A.preventDefault()},n.getButton=function(A){return A.type=="dblclick"?0:A.type=="contextmenu"||r.isMac&&A.ctrlKey&&!A.altKey&&!A.shiftKey?2:A.button},n.capture=function(A,S,w){var y=A&&A.ownerDocument||document;function D(T){S&&S(T),w&&w(T),h(y,"mousemove",S),h(y,"mouseup",D),h(y,"dragstart",D)}return u(y,"mousemove",S),u(y,"mouseup",D),u(y,"dragstart",D),D},n.addMouseWheelListener=function(A,S,w){u(A,"wheel",function(y){var D=.15,T=y.deltaX||0,$=y.deltaY||0;switch(y.deltaMode){case y.DOM_DELTA_PIXEL:y.wheelX=T*D,y.wheelY=$*D;break;case y.DOM_DELTA_LINE:var M=15;y.wheelX=T*M,y.wheelY=$*M;break;case y.DOM_DELTA_PAGE:var O=150;y.wheelX=T*O,y.wheelY=$*O;break}S(y)},w)},n.addMultiMouseDownListener=function(A,S,w,y,D){var T=0,$,M,O,x={2:"dblclick",3:"tripleclick",4:"quadclick"};function k(E){if(n.getButton(E)!==0?T=0:E.detail>1?(T++,T>4&&(T=1)):T=1,r.isIE){var C=Math.abs(E.clientX-$)>5||Math.abs(E.clientY-M)>5;(!O||C)&&(T=1),O&&clearTimeout(O),O=setTimeout(function(){O=null},S[T-1]||600),T==1&&($=E.clientX,M=E.clientY)}if(E._clicks=T,w[y]("mousedown",E),T>4)T=0;else if(T>1)return w[y](x[T],E)}Array.isArray(A)||(A=[A]),A.forEach(function(E){u(E,"mousedown",k,D)})};function f(A){return 0|(A.ctrlKey?1:0)|(A.altKey?2:0)|(A.shiftKey?4:0)|(A.metaKey?8:0)}n.getModifierString=function(A){return i.KEY_MODS[f(A)]};function g(A,S,w){var y=f(S);if(!w&&S.code&&(w=i.$codeToKeyCode[S.code]||w),!r.isMac&&p){if(S.getModifierState&&(S.getModifierState("OS")||S.getModifierState("Win"))&&(y|=8),p.altGr)if((3&y)!=3)p.altGr=0;else return;if(w===18||w===17){var D=S.location;if(w===17&&D===1)p[w]==1&&(o=S.timeStamp);else if(w===18&&y===3&&D===2){var T=S.timeStamp-o;T<50&&(p.altGr=!0)}}}if(w in i.MODIFIER_KEYS&&(w=-1),!(!y&&w===13&&S.location===3&&(A(S,y,-w),S.defaultPrevented))){if(r.isChromeOS&&y&8){if(A(S,y,w),S.defaultPrevented)return;y&=-9}return!y&&!(w in i.FUNCTION_KEYS)&&!(w in i.PRINTABLE_KEYS)?!1:A(S,y,w)}}n.addCommandKeyListener=function(A,S,w){var y=null;u(A,"keydown",function(D){p[D.keyCode]=(p[D.keyCode]||0)+1;var T=g(S,D,D.keyCode);return y=D.defaultPrevented,T},w),u(A,"keypress",function(D){y&&(D.ctrlKey||D.altKey||D.shiftKey||D.metaKey)&&(n.stopEvent(D),y=null)},w),u(A,"keyup",function(D){p[D.keyCode]=null},w),p||(v(),u(window,"focus",v))};function v(){p=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!r.isOldIE){var b=1;n.nextTick=function(A,S){S=S||window;var w="zero-timeout-message-"+b++,y=function(D){D.data==w&&(n.stopPropagation(D),h(S,"message",y),A())};u(S,"message",y),S.postMessage(w,"*")}}n.$idleBlocked=!1,n.onIdle=function(A,S){return setTimeout(function w(){n.$idleBlocked?setTimeout(w,100):A()},S)},n.$idleBlockId=null,n.blockIdle=function(A){n.$idleBlockId&&clearTimeout(n.$idleBlockId),n.$idleBlocked=!0,n.$idleBlockId=setTimeout(function(){n.$idleBlocked=!1},A||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(A){setTimeout(A,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(t,n,d){var i;d.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,d){var i=t("../lib/event"),r=t("../config").nls,p=t("../lib/useragent"),o=t("../lib/dom"),l=t("../lib/lang"),s=t("../clipboard"),a=p.isChrome<18,c=p.isIE,u=p.isChrome>63,h=400,f=t("../lib/keys"),g=f.KEY_MODS,v=p.isIOS,b=v?/\s/:/\n/,A=p.isMobile,S=(function(){function w(y,D){var T=this;this.host=D,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="",A||(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($){T.ignoreFocusEvents||(D.onBlur($),T.$isFocused=!1)},D),i.addListener(this.text,"focus",function($){if(!T.ignoreFocusEvents){if(T.$isFocused=!0,p.isEdge)try{if(!document.hasFocus())return}catch{}D.onFocus($),p.isEdge?setTimeout(T.resetSelection.bind(T)):T.resetSelection()}},D),this.$focusScroll=!1,D.on("beforeEndOperation",function(){var $=D.curOp,M=$&&$.command&&$.command.name;if(M!="insertstring"){var O=M&&($.docChanged||$.selectionChanged);T.inComposition&&O&&(T.lastValue=T.text.value="",T.onCompositionEnd()),T.resetSelection()}}),D.on("changeSelection",this.setAriaLabel.bind(this)),this.resetSelection=v?this.$resetSelectionIOS:this.$resetSelection,this.$isFocused&&D.onFocus(),this.inputHandler=null,this.afterContextMenu=!1,i.addCommandKeyListener(this.text,function($,M,O){if(!T.inComposition)return D.onCommandKey($,M,O)},D),i.addListener(this.text,"select",this.onSelect.bind(this),D),i.addListener(this.text,"input",this.onInput.bind(this),D),i.addListener(this.text,"cut",this.onCut.bind(this),D),i.addListener(this.text,"copy",this.onCopy.bind(this),D),i.addListener(this.text,"paste",this.onPaste.bind(this),D),(!("oncut"in this.text)||!("oncopy"in this.text)||!("onpaste"in this.text))&&i.addListener(y,"keydown",function($){if(!(p.isMac&&!$.metaKey||!$.ctrlKey))switch($.keyCode){case 67:T.onCopy($);break;case 86:T.onPaste($);break;case 88:T.onCut($);break}},D),this.syncComposition=l.delayedCall(this.onCompositionUpdate.bind(this),50).schedule.bind(null,null),i.addListener(this.text,"compositionstart",this.onCompositionStart.bind(this),D),i.addListener(this.text,"compositionupdate",this.onCompositionUpdate.bind(this),D),i.addListener(this.text,"keyup",this.onKeyup.bind(this),D),i.addListener(this.text,"keydown",this.syncComposition.bind(this),D),i.addListener(this.text,"compositionend",this.onCompositionEnd.bind(this),D),this.closeTimeout,i.addListener(this.text,"mouseup",this.$onContextMenu.bind(this),D),i.addListener(this.text,"mousedown",function($){$.preventDefault(),T.onContextMenuClose()},D),i.addListener(D.renderer.scroller,"contextmenu",this.$onContextMenu.bind(this),D),i.addListener(this.text,"contextmenu",this.$onContextMenu.bind(this),D),v&&this.addIosSelectionHandler(y,D,this.text)}return w.prototype.addIosSelectionHandler=function(y,D,T){var $=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 x=function(k){if(document.activeElement===T&&!(O||$.inComposition||D.$mouseHandler.isMousePressed)&&!$.copied){var E=T.selectionStart,C=T.selectionEnd,L=null,I=0;if(E==0?L=f.up:E==1?L=f.home:C>$.lastSelectionEnd&&$.lastValue[C]==`
175
+ `?L=f.end:E<$.lastSelectionStart&&$.lastValue[E-1]==" "?(L=f.left,I=g.option):E<$.lastSelectionStart||E==$.lastSelectionStart&&$.lastSelectionEnd!=$.lastSelectionStart&&E==C?L=f.left:C>$.lastSelectionEnd&&$.lastValue.slice(0,C).split(`
176
+ `).length>2?L=f.down:C>$.lastSelectionEnd&&$.lastValue[C-1]==" "?(L=f.right,I=g.option):(C>$.lastSelectionEnd||C==$.lastSelectionEnd&&$.lastSelectionEnd!=$.lastSelectionStart&&E==C)&&(L=f.right),E!==C&&(I|=g.shift),L){var F=D.onCommandKey({},I,L);if(!F&&D.commands){L=f.keyCodeToString(L);var R=D.commands.findKeyCommand(I,L);R&&D.execCommand(R)}$.lastSelectionStart=E,$.lastSelectionEnd=C,$.resetSelection("")}}};document.addEventListener("selectionchange",x),D.on("destroy",function(){document.removeEventListener("selectionchange",x)})},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 D=this.host.getSelectionRange();D.end.row=D.start.row,D.end.column=D.start.column,this.inComposition.markerRange=D,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 D=this.handleClipboardData(y);s.pasteCancelled()||(typeof D=="string"?(D&&this.host.onPaste(D,y),p.isIE&&setTimeout(this.resetSelection),i.preventDefault(y)):(this.text.value="",this.pasted=!0))},w.prototype.doCopy=function(y,D){var T=this,$=this.host.getCopyText();if(!$)return i.preventDefault(y);this.handleClipboardData(y,$)?(v&&(this.resetSelection($),this.copied=$,setTimeout(function(){T.copied=!1},10)),D?this.host.onCut():this.host.onCopy(),i.preventDefault(y)):(this.copied=!0,this.text.value=$,this.text.select(),setTimeout(function(){T.copied=!1,T.resetSelection(),D?T.host.onCut():T.host.onCopy()}))},w.prototype.handleClipboardData=function(y,D,T){var $=y.clipboardData||window.clipboardData;if(!(!$||a)){var M=c||T?"Text":"text/plain";try{return D?$.setData(M,D)!==!1:$.getData(M)}catch(O){if(!T)return this.handleClipboardData(O,D,!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 D=this.text.value,T=this.sendText(D,!0);(D.length>h+100||b.test(T)||A&&this.lastSelectionStart<1&&this.lastSelectionStart==this.lastSelectionEnd)&&this.resetSelection()},w.prototype.sendText=function(y,D){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,$=this.text.selectionEnd,M=this.lastSelectionStart,O=this.lastValue.length-this.lastSelectionEnd,x=y,k=y.length-T,E=y.length-$,C=0;M>0&&this.lastValue[C]==y[C];)C++,M--;for(x=x.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,E-=C-1;var L=x.length-C+1;if(L<0&&(M=-L,L=0),x=x.slice(0,L),!D&&!x&&!k&&!M&&!O&&!E)return"";this.sendingText=!0;var I=!1;return p.isAndroid&&x==". "&&(x=" ",I=!0),x&&!M&&!O&&!k&&!E||this.commandMode?this.host.onTextInput(x):this.host.onTextInput(x,{extendLeft:M,extendRight:O,restoreStart:k,restoreEnd:E}),this.sendingText=!1,this.lastValue=y,this.lastSelectionStart=T,this.lastSelectionEnd=$,this.lastRestoreEnd=E,I?`
177
+ `:x},w.prototype.onSelect=function(y){var D=this;if(!this.inComposition){var T=function($){return $.selectionStart===0&&$.selectionEnd>=D.lastValue.length&&$.value===D.lastValue&&D.lastValue&&$.selectionEnd!==D.lastSelectionEnd};this.copied?this.copied=!1:T(this.text)?(this.host.selectAll(),this.resetSelection()):A&&this.text.selectionStart!=this.lastSelectionStart&&this.resetSelection()}},w.prototype.$resetSelectionIOS=function(y){if(!(!this.$isFocused||this.copied&&!y||this.sendingText)){y||(y="");var D=`
178
+ ab`+y+`cde fg
179
+ `;D!=this.text.value&&(this.text.value=this.lastValue=D);var T=4,$=4+(y.length||(this.host.selection.isEmpty()?0:1));(this.lastSelectionStart!=T||this.lastSelectionEnd!=$)&&this.text.setSelectionRange(T,$),this.lastSelectionStart=T,this.lastSelectionEnd=$}},w.prototype.$resetSelection=function(){var y=this;if(!(this.inComposition||this.sendingText)&&!(!this.$isFocused&&!this.afterContextMenu)){this.inComposition=!0;var D=0,T=0,$="",M=function(R,B){for(var N=B,H=1;H<=R-y.rowStart&&H<2*y.numberOfExtraLines+1;H++)N+=y.host.session.getLine(R-H).length+1;return N};if(this.host.session){var O=this.host.selection,x=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 E=[],C=this.rowStart;C<=this.rowEnd;C++)E.push(this.host.session.getLine(C));if($=E.join(`
180
+ `),D=M(x.start.row,x.start.column),T=M(x.end.row,x.end.column),x.start.row<this.rowStart){var L=this.host.session.getLine(this.rowStart-1);D=x.start.row<this.rowStart-1?0:D,T+=L.length+1,$=L+`
181
+ `+$}else if(x.end.row>this.rowEnd){var I=this.host.session.getLine(this.rowEnd+1);T=x.end.row>this.rowEnd+1?I.length:x.end.column,T+=$.length+1,$=$+`
182
+ `+I}else A&&k>0&&($=`
183
+ `+$,T+=1,D+=1);$.length>h&&(D<h&&T<h?$=$.slice(0,h):($=`
184
+ `,D==T?D=T=0:(D=0,T=1)));var F=$+`
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!=D||this.text.selectionEnd!=this.lastSelectionEnd)try{this.text.setSelectionRange(D,T),this.lastSelectionStart=D,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 D=this.host.session.selection.cursor.row;y+=r("text-input.aria-label","Cursor at row $0",[D+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",r("text-input.aria-roledescription","editor")),this.setAriaLabel())},w.prototype.focus=function(){var y=this;if(this.setAriaOptions({setLabel:this.host.renderer.enableKeyboardAccessibility}),this.tempStyle||u||this.$focusScroll=="browser")return this.text.focus({preventScroll:!0});var D=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 $=[];if(T)for(var M=this.text.parentElement;M&&M.nodeType==1;)$.push(M),M.setAttribute("ace_nocontext","true"),!M.parentElement&&M.getRootNode?M=M.getRootNode().host:M=M.parentElement;this.text.focus({preventScroll:!0}),T&&$.forEach(function(O){O.removeAttribute("ace_nocontext")}),setTimeout(function(){y.text.style.position="",y.text.style.top=="0px"&&(y.text.style.top=D)},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,D){var T=this;this.tempStyle||(this.tempStyle=this.text.style.cssText),this.text.style.cssText=(D?"z-index:100000;":"")+(p.isIE?"opacity:0.1;":"")+"text-indent: -"+(this.lastSelectionStart+this.lastSelectionEnd)*this.host.renderer.characterWidth*.5+"px;";var $=this.host.container.getBoundingClientRect(),M=o.computedStyle(this.host.container),O=$.top+(parseInt(M.borderTopWidth)||0),x=$.left+(parseInt(M.borderLeftWidth)||0),k=$.bottom-O-this.text.clientHeight-2,E=function(C){o.translate(T.text,C.clientX-x-2,Math.min(C.clientY-O-2,k))};E(y),y.type=="mousedown"&&(this.host.renderer.$isMousePressed=!0,clearTimeout(this.closeTimeout),p.isWin&&i.capture(this.host.container,E,this.onContextMenuClose.bind(this)))},w.prototype.destroy=function(){this.text.parentElement&&this.text.parentElement.removeChild(this.text)},w})();n.TextInput=S,n.$setUserAgentForTests=function(w,y){A=w,v=y}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,n,d){var i=t("../lib/useragent"),r=0,p=550,o=(function(){function a(c){c.$clickSelection=null;var u=c.editor;u.setDefaultHandler("mousedown",this.onMouseDown.bind(c)),u.setDefaultHandler("dblclick",this.onDoubleClick.bind(c)),u.setDefaultHandler("tripleclick",this.onTripleClick.bind(c)),u.setDefaultHandler("quadclick",this.onQuadClick.bind(c)),u.setDefaultHandler("mousewheel",this.onMouseWheel.bind(c));var h=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];h.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 u=c.inSelection(),h=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(h),g==2&&(f.textInput.onContextMenu(c.domEvent),i.isMozilla||c.preventDefault());return}if(this.mousedownEvent.time=Date.now(),u&&!f.isFocused()&&(f.focus(),this.$focusTimeout&&!this.$clickSelection&&!f.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(c);return}return this.captureMouse(c),this.startSelect(h,c.domEvent._clicks>1),c.preventDefault()},a.prototype.startSelect=function(c,u){c=c||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var h=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?h.selection.selectToPosition(c):u||h.selection.moveToPosition(c),u||this.select(),h.setStyle("ace_selecting"),this.setState("select"))},a.prototype.select=function(){var c,u=this.editor,h=u.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var f=this.$clickSelection.comparePoint(h);if(f==-1)c=this.$clickSelection.end;else if(f==1)c=this.$clickSelection.start;else{var g=s(this.$clickSelection,h,u.session);h=g.cursor,c=g.anchor}u.selection.setSelectionAnchor(c.row,c.column)}u.selection.selectToPosition(h),u.renderer.scrollCursorIntoView()},a.prototype.extendSelectionBy=function(c){var u,h=this.editor,f=h.renderer.screenToTextCoordinates(this.x,this.y),g=h.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)u=this.$clickSelection.end,(g.end.row!=f.row||g.end.column!=f.column)&&(f=g.start);else if(b==1&&v>=0)u=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,u=g.start;else{var A=s(this.$clickSelection,f,h.session);f=A.cursor,u=A.anchor}h.selection.setSelectionAnchor(u.row,u.column)}h.selection.selectToPosition(f),h.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),u=Date.now();(c>r||u-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},a.prototype.onDoubleClick=function(c){var u=c.getDocumentPosition(),h=this.editor,f=h.session,g=f.getBracketRange(u);g?(g.isEmpty()&&(g.start.column--,g.end.column++),this.setState("select")):(g=h.selection.getWordRange(u.row,u.column),this.setState("selectByWords")),this.$clickSelection=g,this.select()},a.prototype.onTripleClick=function(c){var u=c.getDocumentPosition(),h=this.editor;this.setState("selectByLines");var f=h.getSelectionRange();f.isMultiLine()&&f.contains(u.row,u.column)?(this.$clickSelection=h.selection.getLineRange(f.start.row),this.$clickSelection.end=h.selection.getLineRange(f.end.row).end):this.$clickSelection=h.selection.getLineRange(u.row),this.select()},a.prototype.onQuadClick=function(c){var u=this.editor;u.selectAll(),this.$clickSelection=u.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 u=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var h=this.$lastScroll,f=c.domEvent.timeStamp,g=f-h.t,v=g?c.wheelX/g:h.vx,b=g?c.wheelY/g:h.vy;g<p&&(v=(v+h.vx)/2,b=(b+h.vy)/2);var A=Math.abs(v/b),S=!1;if(A>=1&&u.renderer.isScrollableBy(c.wheelX*c.speed,0)&&(S=!0),A<=1&&u.renderer.isScrollableBy(0,c.wheelY*c.speed)&&(S=!0),S)h.allowed=f;else if(f-h.allowed<p){var w=Math.abs(v)<=1.5*Math.abs(h.vx)&&Math.abs(b)<=1.5*Math.abs(h.vy);w?(S=!0,h.allowed=f):h.allowed=0}if(h.t=f,h.vx=v,h.vy=b,S)return u.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,u,h){return Math.sqrt(Math.pow(u-a,2)+Math.pow(h-c,2))}function s(a,c,u){if(a.start.row==a.end.row)var h=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 h=3*c.column-2*u.getLine(a.start.row).length;else var h=2*c.row-a.start.row-a.end.row;return h<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,d){var i=t("../lib/event"),r=t("../lib/useragent"),p=(function(){function o(l,s){this.speed,this.wheelX,this.wheelY,this.domEvent=l,this.editor=s,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,s=this.editor.session.documentToScreenRow(l,0),a=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return s-a},o.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var l=this.editor,s=l.getSelectionRange();if(s.isEmpty())this.$inSelection=!1;else{var a=this.getDocumentPosition();this.$inSelection=s.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 r.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},o})();n.MouseEvent=p}),ace.define("ace/lib/scroll",["require","exports","module"],function(t,n,d){n.preventParentScroll=function(r){r.stopPropagation();var p=r.currentTarget,o=p.scrollHeight>p.clientHeight;o||r.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(t,n,d){var i=this&&this.__extends||(function(){var f=function(g,v){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,A){b.__proto__=A}||function(b,A){for(var S in A)Object.prototype.hasOwnProperty.call(A,S)&&(b[S]=A[S])},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)}})(),r=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.")},p=t("./lib/dom");t("./lib/event");var o=t("./range").Range,l=t("./lib/scroll").preventParentScroll,s="ace_tooltip",a=(function(){function f(g){this.isOpen=!1,this.$element=null,this.$parentNode=g}return f.prototype.$init=function(){return this.$element=p.createElement("div"),this.$element.className=s,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){p.addCssClass(this.getElement(),g)},f.prototype.setTheme=function(g){this.theme&&(this.theme.isDark&&p.removeCssClass(this.getElement(),"ace_dark"),this.theme.cssClass&&p.removeCssClass(this.getElement(),this.theme.cssClass)),g.isDark&&p.addCssClass(this.getElement(),"ace_dark"),g.cssClass&&p.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=s,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,A;this.popups.sort(function(x,k){return k.priority-x.priority});var S=[];try{for(var w=r(this.popups),y=w.next();!y.done;y=w.next()){var D=y.value,T=!0;try{for(var $=(b=void 0,r(S)),M=$.next();!M.done;M=$.next()){var O=M.value;if(this.doPopupsOverlap(O,D)){T=!1;break}}}catch(x){b={error:x}}finally{try{M&&!M.done&&(A=$.return)&&A.call($)}finally{if(b)throw b.error}}T?S.push(D):D.hide()}}catch(x){g={error:x}}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(),A=v.getElement().getBoundingClientRect();return b.left<A.right&&b.right>A.left&&b.top<A.bottom&&b.bottom>A.top},f})(),u=new c;n.popupManager=u,n.Tooltip=a;var h=(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 A=b.getElement();return A.style.whiteSpace="pre-wrap",A.style.pointerEvents="auto",A.addEventListener("mouseout",b.onMouseOut),A.tabIndex=-1,A.addEventListener("blur",function(){A.contains(document.activeElement)||this.hide()}.bind(b)),A.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 A=b.$mouseHandler.isMousePressed;if(this.isOpen){var S=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(S.row,S.column)||A||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||A||(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,A=v.getDocumentPosition(),S=b.session.getLine(A.row);if(A.column==S.length){var w=b.renderer.pixelToScreenCoordinates(v.clientX,v.clientY),y=b.session.documentToScreenPosition(A.row,A.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,A,S){if(!(S&&S!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var w=v.renderer;this.isOpen||(u.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),D=w.scroller.getBoundingClientRect();y.pageX<D.left&&(y.pageX=D.left);var T=this.getElement();T.innerHTML="",T.appendChild(A),T.style.maxHeight="",T.style.display="block",this.$setPosition(v,y,!0,b),p.$fixPositionBug(T)}},g.prototype.$setPosition=function(v,b,A,S){var w=10;A&&this.addMarker(S,v.session);var y=v.renderer,D=this.getElement(),T=D.offsetHeight,$=D.offsetWidth,M=b.pageY,O=b.pageX,x=window.innerHeight-M-y.lineHeight,k=this.$shouldPlaceAbove(T,M,x-w);D.style.maxHeight=(k?M:x)-w+"px",D.style.top=k?"":M+y.lineHeight+"px",D.style.bottom=k?window.innerHeight-M+"px":"",D.style.left=Math.min(O,window.innerWidth-$-w)+"px"},g.prototype.$shouldPlaceAbove=function(v,b,A){return!(b-v<0&&b<A)},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,u.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=h}),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,d){var i=this&&this.__extends||(function(){var h=function(f,g){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,b){v.__proto__=b}||function(v,b){for(var A in b)Object.prototype.hasOwnProperty.call(b,A)&&(v[A]=b[A])},h(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");h(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})(),r=this&&this.__values||function(h){var f=typeof Symbol=="function"&&Symbol.iterator,g=f&&h[f],v=0;if(g)return g.call(h);if(h&&typeof h.length=="number")return{next:function(){return h&&v>=h.length&&(h=void 0),{value:h&&h[v++],done:!h}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},p=t("../lib/dom"),o=t("./mouse_event").MouseEvent,l=t("../tooltip").HoverTooltip,s=t("../config").nls,a=t("../range").Range;function c(h){var f=h.editor,g=f.renderer.$gutterLayer;h.$tooltip=new u(f),h.$tooltip.addToEditor(f),h.$tooltip.setDataProvider(function(v,b){var A=v.getDocumentPosition().row;h.$tooltip.showTooltip(A)}),h.editor.setDefaultHandler("guttermousedown",function(v){if(!(!f.isFocused()||v.getButton()!=0)){var b=g.getRegion(v);if(b!="foldWidgets"){var A=v.getDocumentPosition().row,S=f.session.selection;if(v.getShiftKey())S.selectTo(A,0);else{if(v.domEvent.detail==2)return f.selectAll(),v.preventDefault();h.$clickSelection=f.selection.getLineRange(A)}return h.setState("selectByLines"),h.captureMouse(v),v.preventDefault()}}})}n.GutterHandler=c;var u=(function(h){i(f,h);function f(g){var v=h.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),h.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),h.prototype.removeFromEditor.call(this,g)},f.prototype.destroy=function(){this.editor&&this.removeFromEditor(this.editor),h.prototype.destroy.call(this)},Object.defineProperty(f,"annotationLabels",{get:function(){return{error:{singular:s("gutter-tooltip.aria-label.error.singular","error"),plural:s("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:s("gutter-tooltip.aria-label.security.singular","security finding"),plural:s("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:s("gutter-tooltip.aria-label.warning.singular","warning"),plural:s("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:s("gutter-tooltip.aria-label.info.singular","information message"),plural:s("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:s("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:s("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),f.prototype.showTooltip=function(g){var v,b=this.editor.renderer.$gutterLayer,A=b.$annotations[g],S;A?S={displayText:Array.from(A.displayText),type:Array.from(A.type)}:S={displayText:[],type:[]};var w=b.session.getFoldLine(g);if(w&&b.$showFoldedAnnotations){for(var y={error:[],security:[],warning:[],info:[],hint:[]},D={error:1,security:2,warning:3,info:4,hint:5},T,$=g+1;$<=w.end.row;$++)if(b.$annotations[$])for(var M=0;M<b.$annotations[$].text.length;M++){var O=b.$annotations[$].type[M];y[O].push(b.$annotations[$].text[M]),(!T||D[O]<D[T])&&(T=O)}if(["error","security","warning"].includes(T)){var x="".concat(f.annotationsToSummaryString(y)," in folded code.");S.displayText.push(x),S.type.push(T+"_fold")}}if(S.displayText.length===0)return this.hide();for(var k={error:[],security:[],warning:[],info:[],hint:[]},E=b.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",$=0;$<S.displayText.length;$++){var C=p.createElement("span"),L=p.createElement("span");(v=L.classList).add.apply(v,["ace_".concat(S.type[$]),E]),L.setAttribute("aria-label","".concat(f.annotationLabels[S.type[$].replace("_fold","")].singular)),L.setAttribute("role","img"),L.appendChild(p.createTextNode(" ")),C.appendChild(L),C.appendChild(p.createTextNode(S.displayText[$])),C.appendChild(p.createElement("br")),k[S.type[$].replace("_fold","")].push(C)}var I=p.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,A){var S=this.$findCellByRow(A.start.row);if(S){var w=S&&S.element,y=w&&w.querySelector(".ace_gutter_annotation");if(y){var D=y.getBoundingClientRect();if(D){var T={pageX:D.right,pageY:D.top};return h.prototype.$setPosition.call(this,g,T,!1,A)}}}},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),h.prototype.hide.call(this,g)}},f.annotationsToSummaryString=function(g){var v,b,A=[],S=["error","security","warning","info","hint"];try{for(var w=r(S),y=w.next();!y.done;y=w.next()){var D=y.value;if(g[D].length){var T=g[D].length===1?f.annotationLabels[D].singular:f.annotationLabels[D].plural;A.push("".concat(g[D].length," ").concat(T))}}}catch($){v={error:$}}finally{try{y&&!y.done&&(b=w.return)&&b.call(w)}finally{if(v)throw v.error}}return A.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);u.$uid=0,n.GutterTooltip=u}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,n,d){var i=t("../lib/dom"),r=t("../lib/event"),p=t("../lib/useragent"),o=200,l=200,s=5;function a(u){var h=u.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(P){u[P]=this[P]},this),h.on("mousedown",this.onMouseDown.bind(u));var v=h.container,b,A,S,w,y,D,T=0,$,M,O,x,k;this.onDragStart=function(P){if(this.cancelDrag||!v.draggable){var j=this;return setTimeout(function(){j.startSelect(),j.captureMouse(P)},0),P.preventDefault()}y=h.getSelectionRange();var V=P.dataTransfer;V.effectAllowed=h.getReadOnly()?"copy":"copyMove",h.container.appendChild(f),V.setDragImage&&V.setDragImage(f,0,0),setTimeout(function(){h.container.removeChild(f)}),V.clearData(),V.setData("Text",h.session.getTextRange()),M=!0,this.setState("drag")},this.onDragEnd=function(P){if(v.draggable=!1,M=!1,this.setState(null),!h.getReadOnly()){var j=P.dataTransfer.dropEffect;!$&&j=="move"&&h.session.remove(h.getSelectionRange()),h.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(P){if(!(h.getReadOnly()||!N(P.dataTransfer)))return A=P.clientX,S=P.clientY,b||I(),T++,P.dataTransfer.dropEffect=$=H(P),r.preventDefault(P)},this.onDragOver=function(P){if(!(h.getReadOnly()||!N(P.dataTransfer)))return A=P.clientX,S=P.clientY,b||(I(),T++),R!==null&&(R=null),P.dataTransfer.dropEffect=$=H(P),r.preventDefault(P)},this.onDragLeave=function(P){if(T--,T<=0&&b)return F(),$=null,r.preventDefault(P)},this.onDrop=function(P){if(D){var j=P.dataTransfer;if(M)switch($){case"move":y.contains(D.row,D.column)?y={start:D,end:D}:y=h.moveText(y,D);break;case"copy":y=h.moveText(y,D,!0);break}else{var V=j.getData("Text");y={start:D,end:h.session.insert(D,V)},h.focus(),$=null}return F(),r.preventDefault(P)}},r.addListener(v,"dragstart",this.onDragStart.bind(u),h),r.addListener(v,"dragend",this.onDragEnd.bind(u),h),r.addListener(v,"dragenter",this.onDragEnter.bind(u),h),r.addListener(v,"dragover",this.onDragOver.bind(u),h),r.addListener(v,"dragleave",this.onDragLeave.bind(u),h),r.addListener(v,"drop",this.onDrop.bind(u),h);function E(P,j){var V=Date.now(),K=!j||P.row!=j.row,J=!j||P.column!=j.column;if(!x||K||J)h.moveCursorToPosition(P),x=V,k={x:A,y:S};else{var Y=c(k.x,k.y,A,S);Y>s?x=null:V-x>=l&&(h.renderer.scrollCursorIntoView(),x=null)}}function C(P,j){var V=Date.now(),K=h.renderer.layerConfig.lineHeight,J=h.renderer.layerConfig.characterWidth,Y=h.renderer.scroller.getBoundingClientRect(),X={x:{left:A-Y.left,right:Y.right-A},y:{top:S-Y.top,bottom:Y.bottom-S}},q=Math.min(X.x.left,X.x.right),ne=Math.min(X.y.top,X.y.bottom),ue={row:P.row,column:P.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 Ce=P.row!=ue.row,Oe=P.column!=ue.column,De=!j||P.row!=j.row;Ce||Oe&&!De?O?V-O>=o&&h.renderer.scrollCursorIntoView(ue):O=V:O=null}function L(){var P=D;D=h.renderer.screenToTextCoordinates(A,S),E(D,P),C(D,P)}function I(){y=h.selection.toOrientedRange(),b=h.session.addMarker(y,"ace_selection",h.getSelectionStyle()),h.clearSelection(),h.isFocused()&&h.renderer.$cursorLayer.setBlinking(!1),clearInterval(w),L(),w=setInterval(L,20),T=0,r.addListener(document,"mousemove",B)}function F(){clearInterval(w),h.session.removeMarker(b),b=null,h.selection.fromOrientedRange(y),h.isFocused()&&!M&&h.$resetCursorStyle(),y=null,D=null,T=0,O=null,x=null,r.removeListener(document,"mousemove",B)}var R=null;function B(){R==null&&(R=setTimeout(function(){R!=null&&b&&F()},20))}function N(P){var j=P.types;return!j||Array.prototype.some.call(j,function(V){return V=="text/plain"||V=="Text"})}function H(P){var j=["copy","copymove","all","uninitialized"],V=["move","copymove","linkmove","all","uninitialized"],K=p.isMac?P.altKey:P.ctrlKey,J="uninitialized";try{J=P.dataTransfer.effectAllowed.toLowerCase()}catch{}var Y="none";return K&&j.indexOf(J)>=0?Y="copy":V.indexOf(J)>=0?Y="move":j.indexOf(J)>=0&&(Y="copy"),Y}}(function(){this.dragWait=function(){var u=Date.now()-this.mousedownEvent.time;u>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var u=this.editor.container;u.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(u){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var u=this.editor,h=u.container;h.draggable=!0,u.renderer.$cursorLayer.setBlinking(!1),u.setStyle("ace_dragging");var f=p.isWin?"default":"move";u.renderer.setCursorStyle(f),this.setState("dragReady")},this.onMouseDrag=function(u){var h=this.editor.container;if(p.isIE&&this.state=="dragReady"){var f=c(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);f>3&&h.dragDrop()}if(this.state==="dragWait"){var f=c(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);f>0&&(h.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(u){if(this.$dragEnabled){this.mousedownEvent=u;var h=this.editor,f=u.inSelection(),g=u.getButton(),v=u.domEvent.detail||1;if(v===1&&g===0&&f){if(u.editor.inMultiSelectMode&&(u.getAccelKey()||u.getShiftKey()))return;this.mousedownEvent.time=Date.now();var b=u.domEvent.target||u.domEvent.srcElement;if("unselectable"in b&&(b.unselectable="on"),h.getDragDelay()){if(p.isWebKit){this.cancelDrag=!0;var A=h.container;A.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(u,this.onMouseDrag.bind(this)),u.defaultPrevented=!0}}}}).call(a.prototype);function c(u,h,f,g){return Math.sqrt(Math.pow(f-u,2)+Math.pow(g-h,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,d){var i=t("./mouse_event").MouseEvent,r=t("../lib/event"),p=t("../lib/dom");n.addTouchListeners=function(o,l){var s="scroll",a,c,u,h,f,g,v=0,b,A=0,S=0,w=0,y,D;function T(){var E=window.navigator&&window.navigator.clipboard,C=!1,L=function(){var R=l.getCopyText(),B=l.session.getUndoManager().hasUndo();D.replaceChild(p.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"],E&&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"]),D.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"?E.readText().then(function(N){l.execCommand(B,N)}):B&&((B=="cut"||B=="copy")&&(E?E.writeText(l.getCopyText()):document.execCommand("copy")),l.execCommand(B)),D.firstChild.style.display="none",C=!1,B!="openCommandPalette"&&l.focus()};D=p.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(R){s="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 $(){if(!l.getOption("enableMobileMenu")){D&&M();return}D||T();var E=l.selection.cursor,C=l.renderer.textToScreenCoordinates(E.row,E.column),L=l.renderer.textToScreenCoordinates(0,0).pageX,I=l.renderer.scrollLeft,F=l.container.getBoundingClientRect();D.style.top=C.pageY-F.top-3+"px",C.pageX-F.left<F.width-70?(D.style.left="",D.style.right="10px"):(D.style.right="",D.style.left=L+I-F.left+"px"),D.style.display="",D.firstChild.style.display="none",l.on("input",M)}function M(E){D&&(D.style.display="none"),l.off("input",M)}function O(){f=null,clearTimeout(f);var E=l.selection.getRange(),C=E.contains(b.row,b.column);(E.isEmpty()||!C)&&(l.selection.moveToPosition(b),l.selection.selectWord()),s="wait",$()}function x(){f=null,clearTimeout(f),l.selection.moveToPosition(b);var E=A>=2?l.selection.getLineRange(b.row):l.session.getBracketRange(b);E&&!E.isEmpty()?l.selection.setRange(E):l.selection.selectWord(),s="wait"}r.addListener(o,"contextmenu",function(E){if(y){var C=l.textInput.getElement();C.focus()}},l),r.addListener(o,"touchstart",function(E){var C=E.touches;if(f||C.length>1){clearTimeout(f),f=null,u=-1,s="zoom";return}y=l.$mouseHandler.isMousePressed=!0;var L=l.renderer.layerConfig.lineHeight,I=l.renderer.layerConfig.lineHeight,F=E.timeStamp;h=F;var R=C[0],B=R.clientX,N=R.clientY;Math.abs(a-B)+Math.abs(c-N)>L&&(u=-1),a=E.clientX=B,c=E.clientY=N,S=w=0;var H=new i(E,l);if(b=H.getDocumentPosition(),F-u<500&&C.length==1&&!v)A++,E.preventDefault(),E.button=0,x();else{A=0;var P=l.selection.cursor,j=l.selection.isEmpty()?P:l.selection.anchor,V=l.renderer.$cursorLayer.getPixelPosition(P,!0),K=l.renderer.$cursorLayer.getPixelPosition(j,!0),J=l.renderer.scroller.getBoundingClientRect(),Y=l.renderer.layerConfig.offset,X=l.renderer.scrollLeft,q=function(Ce,Oe){return Ce=Ce/I,Oe=Oe/L-.75,Ce*Ce+Oe*Oe};if(E.clientX<J.left){s="zoom";return}var ne=q(E.clientX-J.left-V.left+X,E.clientY-J.top-V.top+Y),ue=q(E.clientX-J.left-K.left+X,E.clientY-J.top-K.top+Y);ne<3.5&&ue<3.5&&(s=ne>ue?"cursor":"anchor"),ue<3.5?s="anchor":ne<3.5?s="cursor":s="scroll",f=setTimeout(O,450)}u=F},l),r.addListener(o,"touchend",function(E){y=l.$mouseHandler.isMousePressed=!1,g&&clearInterval(g),s=="zoom"?(s="",v=0):f?(l.selection.moveToPosition(b),v=0,$()):s=="scroll"?(k(),M()):$(),clearTimeout(f),f=null},l),r.addListener(o,"touchmove",function(E){f&&(clearTimeout(f),f=null);var C=E.touches;if(!(C.length>1||s=="zoom")){var L=C[0],I=a-L.clientX,F=c-L.clientY;if(s=="wait")if(I*I+F*F>4)s="cursor";else return E.preventDefault();a=L.clientX,c=L.clientY,E.clientX=L.clientX,E.clientY=L.clientY;var R=E.timeStamp,B=R-h;if(h=R,s=="scroll"){var N=new i(E,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&&(S=I/B,w=F/B),l._emit("mousewheel",N),N.propagationStopped||(S=w=0)}else{var H=new i(E,l),P=H.getDocumentPosition();s=="cursor"?l.selection.moveCursorToPosition(P):s=="anchor"&&l.selection.setSelectionAnchor(P.row,P.column),l.renderer.scrollCursorIntoView(P),E.preventDefault()}}},l);function k(){v+=60,g=setInterval(function(){v--<=0&&(clearInterval(g),g=null),Math.abs(S)<.01&&(S=0),Math.abs(w)<.01&&(w=0),v<20&&(S=.9*S),v<20&&(w=.9*w);var E=l.session.getScrollTop();l.renderer.scrollBy(10*S,10*w),E==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,d){var i=t("../lib/event"),r=t("../lib/useragent"),p=t("./default_handlers").DefaultHandlers,o=t("./default_gutter_handler").GutterHandler,l=t("./mouse_event").MouseEvent,s=t("./dragdrop_handler").DragdropHandler,a=t("./touch_handler").addTouchListeners,c=t("../config"),u=(function(){function h(f){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var g=this;this.editor=f,new p(this),new o(this),new s(this);var v=function(S){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 A=f.renderer.$gutter;i.addListener(A,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),f),i.addListener(A,"click",this.onMouseEvent.bind(this,"gutterclick"),f),i.addListener(A,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),f),i.addListener(A,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),f),i.addListener(b,"mousedown",v,f),i.addListener(A,"mousedown",v,f),r.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(S){if(!(g.state||g.$dragDelay||!g.$dragEnabled)){var w=f.renderer.screenToTextCoordinates(S.x,S.y),y=f.session.selection.getRange(),D=f.renderer;!y.isEmpty()&&y.insideStart(w.row,w.column)?D.setCursorStyle("default"):D.setCursorStyle("")}},f)}return h.prototype.onMouseEvent=function(f,g){this.editor.session&&this.editor._emit(f,new l(g,this.editor))},h.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))},h.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)},h.prototype.setState=function(f){this.state=f},h.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 A=this,S=!0,w=function(M){if(M){if(r.isWebKit&&!M.which&&A.releaseMouse)return A.releaseMouse();A.x=M.clientX,A.y=M.clientY,g&&g(M),A.mouseEvent=new l(M,A.editor),A.$mouseMoved=!0}},y=function(M){v.off("beforeEndOperation",$),S=!1,v.session&&D(),A[A.state+"End"]&&A[A.state+"End"](M),A.state="",A.isMousePressed=b.$isMousePressed=!1,b.$keepTextAreaAtCursor&&b.$moveTextAreaToCursor(),A.$onCaptureMouseMove=A.releaseMouse=null,M&&A.onMouseEvent("mouseup",M),v.endOperation()},D=function(){A[A.state]&&A[A.state](),A.$mouseMoved=!1},T=function(){S&&(D(),i.nextFrame(T))};if(r.isOldIE&&f.domEvent.type=="dblclick")return setTimeout(function(){y(f)});var $=function(M){A.releaseMouse&&v.curOp.command.name&&v.curOp.selectionChanged&&(A[A.state+"End"]&&A[A.state+"End"](),A.state="",A.releaseMouse())};v.on("beforeEndOperation",$),v.startOperation({command:{name:"mouse"}}),A.$onCaptureMouseMove=w,A.releaseMouse=i.capture(this.editor.container,w,y),T()},h.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)},h.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse(),this.$tooltip&&this.$tooltip.destroy()},h})();u.prototype.releaseMouse=null,c.defineOptions(u.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:r.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0}}),n.MouseHandler=u}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(t,n,d){var i=t("../lib/dom"),r=(function(){function p(o){o.on("click",function(l){var s=l.getDocumentPosition(),a=o.session,c=a.getFoldAt(s.row,s.column,1);c&&(l.getAccelKey()?a.removeFold(c):a.expandFold(c),l.stop());var u=l.domEvent&&l.domEvent.target;u&&i.hasCssClass(u,"ace_inline_button")&&i.hasCssClass(u,"ace_toggle_wrap")&&(a.setOption("wrap",!a.getUseWrapMode()),o.renderer.scrollCursorIntoView())}),o.on("gutterclick",function(l){var s=o.renderer.$gutterLayer.getRegion(l);if(s=="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 s=o.renderer.$gutterLayer.getRegion(l);if(s=="foldWidgets"){var a=l.getDocumentPosition().row,c=o.session,u=c.getParentFoldRangeData(a,!0),h=u.range||u.firstRange;if(h){a=h.start.row;var f=c.getFoldAt(a,c.getLine(a).length,1);f?c.removeFold(f):(c.addFold("...",h),o.renderer.scrollCursorIntoView({row:h.start.row,column:0}))}l.stop()}})}return p})();n.FoldHandler=r}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(t,n,d){var i=t("../lib/keys"),r=t("../lib/event"),p=(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 s=this.$handlers;if(s[s.length-1]!=l){for(;s[s.length-1]&&s[s.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(s[s.length-1]);this.addKeyboardHandler(l,1)}},o.prototype.addKeyboardHandler=function(l,s){if(l){typeof l=="function"&&!l.handleKeyboard&&(l.handleKeyboard=l);var a=this.$handlers.indexOf(l);a!=-1&&this.$handlers.splice(a,1),s==null?this.$handlers.push(l):this.$handlers.splice(s,0,l),a==-1&&l.attach&&l.attach(this.$editor)}},o.prototype.removeKeyboardHandler=function(l){var s=this.$handlers.indexOf(l);return s==-1?!1:(this.$handlers.splice(s,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,s=l.editor;return this.$handlers.map(function(a){return a.getStatusText&&a.getStatusText(s,l)||""}).filter(Boolean).join(" ")},o.prototype.$callKeyboardHandlers=function(l,s,a,c){for(var u,h=!1,f=this.$editor.commands,g=this.$handlers.length;g--&&(u=this.$handlers[g].handleKeyboard(this.$data,l,s,a,c),!(!(!u||!u.command)&&(u.command=="null"?h=!0:h=f.exec(u.command,this.$editor,u.args,c),h&&c&&l!=-1&&u.passEvent!=!0&&u.command.passEvent!=!0&&r.stopEvent(c),h))););return!h&&l==-1&&(u={command:"insertstring"},h=f.exec("insertstring",this.$editor,s)),h&&this.$editor._signal&&this.$editor._signal("keyboardActivity",u),h},o.prototype.onCommandKey=function(l,s,a){var c=i.keyCodeToString(a);return this.$callKeyboardHandlers(s,c,a,l)},o.prototype.onTextInput=function(l){return this.$callKeyboardHandlers(-1,l)},o})();n.KeyBinding=p}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(t,n,d){var i=0,r=0,p=!1,o=!1,l=!1,s=[[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,u=1,h=0,f=1,g=2,v=3,b=4,A=5,S=6,w=7,y=8,D=9,T=10,$=11,M=12,O=13,x=14,k=15,E=16,C=17,L=18,I=[L,L,L,L,L,L,L,L,L,S,A,S,y,A,L,L,L,L,L,L,L,L,L,L,L,L,L,L,A,A,A,S,y,b,b,$,$,$,b,b,b,b,b,T,D,T,D,D,g,g,g,g,g,g,g,g,g,g,D,b,b,b,b,b,b,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,b,b,b,b,b,b,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,b,b,b,b,L,L,L,L,L,L,A,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,D,b,$,$,$,$,b,b,b,b,h,b,b,L,b,b,$,$,g,g,b,h,b,b,b,g,h,b,b,b,b,b],F=[y,y,y,y,y,y,y,y,y,y,y,L,L,L,h,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,A,O,x,k,E,C,D,$,$,$,$,$,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,D,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(P,j,V,K){var J=i?a:s,Y=null,X=null,q=null,ne=0,ue=null,Ce=null,Oe=-1,De=null,Ve=null,ti=[];if(!K)for(De=0,K=[];De<V;De++)K[De]=H(P[De]);for(r=i,p=!1,o=!1,l=!1,Ve=0;Ve<V;Ve++){if(Y=ne,ti[Ve]=X=N(P,K,ti,Ve),ne=J[Y][X],ue=ne&240,ne&=15,j[Ve]=q=J[ne][5],ue>0)if(ue==16){for(De=Oe;De<Ve;De++)j[De]=1;Oe=-1}else Oe=-1;if(Ce=J[ne][6],Ce)Oe==-1&&(Oe=Ve);else if(Oe>-1){for(De=Oe;De<Ve;De++)j[De]=q;Oe=-1}K[Ve]==A&&(j[Ve]=0),r|=q}if(l){for(De=0;De<V;De++)if(K[De]==S){j[De]=i;for(var en=De-1;en>=0&&K[en]==y;en--)j[en]=i}}}function B(P,j,V){if(!(r<P)){if(P==1&&i==u&&!o){V.reverse();return}for(var K=V.length,J=0,Y,X,q,ne;J<K;){if(j[J]>=P){for(Y=J+1;Y<K&&j[Y]>=P;)Y++;for(X=J,q=Y-1;X<q;X++,q--)ne=V[X],V[X]=V[q],V[q]=ne;J=Y}J++}}}function N(P,j,V,K){var J=j[K],Y,X,q,ne;switch(J){case h:case f:p=!1;case b:case v:return J;case g:return p?v:g;case w:return p=!0,f;case y:return b;case D:return K<1||K+1>=j.length||(Y=V[K-1])!=g&&Y!=v||(X=j[K+1])!=g&&X!=v?b:(p&&(X=v),X==Y?X:b);case T:return Y=K>0?V[K-1]:A,Y==g&&K+1<j.length&&j[K+1]==g?g:b;case $:if(K>0&&V[K-1]==g)return g;if(p)return b;for(ne=K+1,q=j.length;ne<q&&j[ne]==$;)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=P[K],Ce=ue>=1425&&ue<=2303||ue==64286;if(Y=j[ne],Ce&&(Y==f||Y==w))return f}return K<1||(Y=j[K-1])==A?b:V[K-1];case A:return p=!1,o=!0,i;case S:return l=!0,b;case O:case x:case E:case C:case k:p=!1;case L:return b}}function H(P){var j=P.charCodeAt(0),V=j>>8;return V==0?j>191?h:I[j]:V==5?/[\u0591-\u05f4]/.test(P)?f:h:V==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(P)?M:/[\u0660-\u0669\u066b-\u066c]/.test(P)?v:j==1642?$:/[\u06f0-\u06f9]/.test(P)?g:w:V==32&&j<=8287?F[j&255]:V==254&&j>=65136?w:b}n.L=h,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(P,j,V){if(P.length<2)return{};var K=P.split(""),J=new Array(K.length),Y=new Array(K.length),X=[];i=V?u: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(P,j){for(var V=!1,K=0;K<P.length;K++)j[K]=H(P.charAt(K)),!V&&(j[K]==f||j[K]==w||j[K]==v)&&(V=!0);return V},n.getVisualFromLogicalIdx=function(P,j){for(var V=0;V<j.logicalFromVisual.length;V++)if(j.logicalFromVisual[V]==P)return V;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(t,n,d){var i=t("./lib/bidiutil"),r=t("./lib/lang"),p=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,o=(function(){function l(s){this.session=s,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=p.test(s.getValue())}return l.prototype.isBidiRow=function(s,a,c){return this.seenBidi?(s!==this.currentRow&&(this.currentRow=s,this.updateRowLine(a,c),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},l.prototype.onChange=function(s){this.seenBidi?this.currentRow=null:s.action=="insert"&&p.test(s.lines.join(`
187
+ `))&&(this.seenBidi=!0,this.currentRow=null)},l.prototype.getDocumentRow=function(){var s=0,a=this.session.$screenRowCache;if(a.length){var c=this.session.$getRowCacheIndex(a,this.currentRow);c>=0&&(s=this.session.$docRowCache[c])}return s},l.prototype.getSplitIndex=function(){var s=0,a=this.session.$screenRowCache;if(a.length)for(var c,u=this.session.$getRowCacheIndex(a,this.currentRow);this.currentRow-s>0&&(c=this.session.$getRowCacheIndex(a,this.currentRow-s-1),c===u);)u=c,s++;else s=this.currentRow;return s},l.prototype.updateRowLine=function(s,a){s===void 0&&(s=this.getDocumentRow());var c=s===this.session.getLength()-1,u=c?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(s),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var h=this.session.$wrapData[s];h&&(a===void 0&&(a=this.getSplitIndex()),a>0&&h.length?(this.wrapIndent=h.indent,this.wrapOffset=this.wrapIndent*this.charWidths[i.L],this.line=a<h.length?this.line.substring(h[a-1],h[a]):this.line.substring(h[h.length-1])):this.line=this.line.substring(0,h[a]),a==h.length&&(this.line+=this.showInvisibles?u:i.DOT))}else this.line+=this.showInvisibles?u:i.DOT;var f=this.session,g=0,v;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(b,A){return b===" "||f.isFullWidth(b.charCodeAt(0))?(v=b===" "?f.getScreenTabSize(A+g):2,g+=v-1,r.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 s=[];i.hasBidiCharacters(this.line,s)||this.isRtlDir?this.bidiMap=i.doBidiReorder(this.line,s,this.isRtlDir):this.bidiMap={}},l.prototype.markAsDirty=function(){this.currentRow=null},l.prototype.updateCharacterWidths=function(s){if(this.characterWidth!==s.$characterSize.width){this.fontMetrics=s;var a=this.characterWidth=s.$characterSize.width,c=s.$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(s){this.showInvisibles=s,this.currentRow=null},l.prototype.setEolChar=function(s){this.EOL=s},l.prototype.setContentWidth=function(s){this.contentWidth=s},l.prototype.isRtlLine=function(s){return this.$isRtl?!0:s!=null?this.session.getLine(s).charAt(0)==this.RLE:this.isRtlDir},l.prototype.setRtlDirection=function(s,a){for(var c=s.getCursorPosition(),u=s.selection.getSelectionAnchor().row;u<=c.row;u++)!a&&s.session.getLine(u).charAt(0)===s.session.$bidiHandler.RLE?s.session.doc.removeInLine(u,0,1):a&&s.session.getLine(u).charAt(0)!==s.session.$bidiHandler.RLE&&s.session.doc.insert({column:0,row:u},s.session.$bidiHandler.RLE)},l.prototype.getPosLeft=function(s){s-=this.wrapIndent;var a=this.line.charAt(0)===this.RLE?1:0,c=s>a?this.session.getOverwrite()?s:s-1:a,u=i.getVisualFromLogicalIdx(c,this.bidiMap),h=this.bidiMap.bidiLevels,f=0;!this.session.getOverwrite()&&s<=a&&h[u]%2!==0&&u++;for(var g=0;g<u;g++)f+=this.charWidths[h[g]];return!this.session.getOverwrite()&&s>a&&h[u]%2===0&&(f+=this.charWidths[h[u]]),this.wrapIndent&&(f+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(f+=this.rtlLineOffset),f},l.prototype.getSelections=function(s,a){var c=this.bidiMap,u=c.bidiLevels,h,f=[],g=0,v=Math.min(s,a)-this.wrapIndent,b=Math.max(s,a)-this.wrapIndent,A=!1,S=!1,w=0;this.wrapIndent&&(g+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var y,D=0;D<u.length;D++)y=c.logicalFromVisual[D],h=u[D],A=y>=v&&y<b,A&&!S?w=g:!A&&S&&f.push({left:w,width:g-w}),g+=this.charWidths[h],S=A;if(A&&D===u.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),u=0,h=0,f=this.bidiMap.bidiLevels,g=this.charWidths[f[h]];for(this.wrapIndent&&(c-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);c>u+g/2;){if(u+=g,h===f.length-1){g=0;break}g=this.charWidths[f[++h]]}return h>0&&f[h-1]%2!==0&&f[h]%2===0?(c<u&&h--,a=this.bidiMap.logicalFromVisual[h]):h>0&&f[h-1]%2===0&&f[h]%2!==0?a=1+(c>u?this.bidiMap.logicalFromVisual[h]:this.bidiMap.logicalFromVisual[h-1]):this.isRtlDir&&h===f.length-1&&g===0&&f[h-1]%2===0||!this.isRtlDir&&h===0&&f[h]%2!==0?a=1+this.bidiMap.logicalFromVisual[h]:(h>0&&f[h-1]%2!==0&&g!==0&&h--,a=this.bidiMap.logicalFromVisual[h]),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,d){var i=t("./lib/oop"),r=t("./lib/lang"),p=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,l=(function(){function s(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(u){c.$cursorChanged=!0,c.$silent||c._emit("changeCursor"),!c.$isEmpty&&!c.$silent&&c._emit("changeSelection"),!c.$keepDesiredColumnOnChange&&u.old.column!=u.value.column&&(c.$desiredColumn=null)}),this.anchor.on("change",function(){c.$anchorChanged=!0,!c.$isEmpty&&!c.$silent&&c._emit("changeSelection")})}return s.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},s.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},s.prototype.getCursor=function(){return this.lead.getPosition()},s.prototype.setAnchor=function(a,c){this.$isEmpty=!1,this.anchor.setPosition(a,c)},s.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},s.prototype.getSelectionLead=function(){return this.lead.getPosition()},s.prototype.isBackwards=function(){var a=this.anchor,c=this.lead;return a.row>c.row||a.row==c.row&&a.column>c.column},s.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)},s.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},s.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},s.prototype.setRange=function(a,c){var u=c?a.end:a.start,h=c?a.start:a.end;this.$setSelection(u.row,u.column,h.row,h.column)},s.prototype.$setSelection=function(a,c,u,h){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(u,h),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")}},s.prototype.$moveSelection=function(a){var c=this.lead;this.$isEmpty&&this.setSelectionAnchor(c.row,c.column),a.call(this)},s.prototype.selectTo=function(a,c){this.$moveSelection(function(){this.moveCursorTo(a,c)})},s.prototype.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},s.prototype.moveTo=function(a,c){this.clearSelection(),this.moveCursorTo(a,c)},s.prototype.moveToPosition=function(a){this.clearSelection(),this.moveCursorToPosition(a)},s.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},s.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},s.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},s.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},s.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},s.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},s.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},s.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},s.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},s.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},s.prototype.getWordRange=function(a,c){if(typeof c>"u"){var u=a||this.lead;a=u.row,c=u.column}return this.session.getWordRange(a,c)},s.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},s.prototype.selectAWord=function(){var a=this.getCursor(),c=this.session.getAWordRange(a.row,a.column);this.setSelectionRange(c)},s.prototype.getLineRange=function(a,c){var u=typeof a=="number"?a:this.lead.row,h,f=this.session.getFoldLine(u);return f?(u=f.start.row,h=f.end.row):h=u,c===!0?new o(u,0,h,this.session.getLine(h).length):new o(u,0,h+1,0)},s.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},s.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},s.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},s.prototype.wouldMoveIntoSoftTab=function(a,c,u){var h=a.column,f=a.column+c;return u<0&&(h=a.column-c,f=a.column),this.session.isTabStop(a)&&this.doc.getLine(a.row).slice(h,f).split(" ").length-1==c},s.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 u=this.session.getTabSize();this.wouldMoveIntoSoftTab(a,u,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-u):this.moveCursorBy(0,-1)}},s.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 u=this.session.getTabSize(),a=this.lead;this.wouldMoveIntoSoftTab(a,u,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,u):this.moveCursorBy(0,1)}},s.prototype.moveCursorLineStart=function(){var a=this.lead.row,c=this.lead.column,u=this.session.documentToScreenRow(a,c),h=this.session.screenToDocumentPosition(u,0),f=this.session.getDisplayLine(a,null,h.row,h.column),g=f.match(/^\s*/);g[0].length!=c&&!this.session.$useEmacsStyleLineStart&&(h.column+=g[0].length),this.moveCursorToPosition(h)},s.prototype.moveCursorLineEnd=function(){var a=this.lead,c=this.session.getDocumentLastRowColumnPosition(a.row,a.column);if(this.lead.column==c.column){var u=this.session.getLine(c.row);if(c.column==u.length){var h=u.search(/\s+$/);h>0&&(c.column=h)}}this.moveCursorTo(c.row,c.column)},s.prototype.moveCursorFileEnd=function(){var a=this.doc.getLength()-1,c=this.doc.getLine(a).length;this.moveCursorTo(a,c)},s.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},s.prototype.moveCursorLongWordRight=function(){var a=this.lead.row,c=this.lead.column,u=this.doc.getLine(a),h=u.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(h)&&(c+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,h=u.substring(c)),c>=u.length){this.moveCursorTo(a,u.length),this.moveCursorRight(),a<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(h)&&(c+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(a,c)},s.prototype.moveCursorLongWordLeft=function(){var a=this.lead.row,c=this.lead.column,u;if(u=this.session.getFoldAt(a,c,-1)){this.moveCursorTo(u.start.row,u.start.column);return}var h=this.session.getFoldStringAt(a,c,-1);h==null&&(h=this.doc.getLine(a).substring(0,c));var f=r.stringReverse(h);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)},s.prototype.$shortWordEndIndex=function(a){var c=0,u,h=/\s/,f=this.session.tokenRe;if(f.lastIndex=0,this.session.tokenRe.exec(a))c=this.session.tokenRe.lastIndex;else{for(;(u=a[c])&&h.test(u);)c++;if(c<1){for(f.lastIndex=0;(u=a[c])&&!f.test(u);)if(f.lastIndex=0,c++,h.test(u))if(c>2){c--;break}else{for(;(u=a[c])&&h.test(u);)c++;if(c>2)break}}}return f.lastIndex=0,c},s.prototype.moveCursorShortWordRight=function(){var a=this.lead.row,c=this.lead.column,u=this.doc.getLine(a),h=u.substring(c),f=this.session.getFoldAt(a,c,1);if(f)return this.moveCursorTo(f.end.row,f.end.column);if(c==u.length){var g=this.doc.getLength();do a++,h=this.doc.getLine(a);while(a<g&&/^\s*$/.test(h));/^\s+/.test(h)||(h=""),c=0}var v=this.$shortWordEndIndex(h);this.moveCursorTo(a,c+v)},s.prototype.moveCursorShortWordLeft=function(){var a=this.lead.row,c=this.lead.column,u;if(u=this.session.getFoldAt(a,c,-1))return this.moveCursorTo(u.start.row,u.start.column);var h=this.session.getLine(a).substring(0,c);if(c===0){do a--,h=this.doc.getLine(a);while(a>0&&/^\s*$/.test(h));c=h.length,/\s+$/.test(h)||(h="")}var f=r.stringReverse(h),g=this.$shortWordEndIndex(f);return this.moveCursorTo(a,c-g)},s.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},s.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},s.prototype.moveCursorBy=function(a,c){var u=this.session.documentToScreenPosition(this.lead.row,this.lead.column),h;if(c===0&&(a!==0&&(this.session.$bidiHandler.isBidiRow(u.row,this.lead.row)?(h=this.session.$bidiHandler.getPosLeft(u.column),u.column=Math.round(h/this.session.$bidiHandler.charWidths[0])):h=u.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?u.column=this.$desiredColumn:this.$desiredColumn=u.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(u.row+a,u.column,h);a!==0&&c===0&&g.row===this.lead.row&&(g.column,this.lead.column),this.moveCursorTo(g.row,g.column+c,c===0)},s.prototype.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},s.prototype.moveCursorTo=function(a,c,u){var h=this.session.getFoldAt(a,c,1);h&&(a=h.start.row,c=h.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,u||(this.$desiredColumn=null)},s.prototype.moveCursorToScreen=function(a,c,u){var h=this.session.screenToDocumentPosition(a,c);this.moveCursorTo(h.row,h.column,u)},s.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},s.prototype.fromOrientedRange=function(a){this.setSelectionRange(a,a.cursor==a.start),this.$desiredColumn=a.desiredColumn||this.$desiredColumn},s.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},s.prototype.getRangeOfMovements=function(a){var c=this.getCursor();try{a(this);var u=this.getCursor();return o.fromPoints(c,u)}catch{return o.fromPoints(c,c)}finally{this.moveCursorToPosition(c)}},s.prototype.toJSON=function(){if(this.rangeCount)var a=this.ranges.map(function(c){var u=c.clone();return u.isBackwards=c.cursor==c.start,u});else{var a=this.getRange();a.isBackwards=this.isBackwards()}return a},s.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 u=o.fromPoints(a[c].start,a[c].end);a[c].isBackwards&&(u.cursor=u.start),this.addRange(u,!0)}return}else a=a[0];this.rangeList&&this.toSingleRange(a),this.setSelectionRange(a,a.isBackwards)},s.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},s})();l.prototype.setSelectionAnchor=l.prototype.setAnchor,l.prototype.getSelectionAnchor=l.prototype.getAnchor,l.prototype.setSelectionRange=l.prototype.setRange,i.implement(l.prototype,p),n.Selection=l}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(t,n,d){var i=t("./lib/report_error").reportError,r=2e3,p=(function(){function o(l){this.splitRegex,this.states=l,this.regExps={},this.matchMappings={};for(var s in this.states){for(var a=this.states[s],c=[],u=0,h=this.matchMappings[s]={defaultToken:"text"},f="g",g=[],v=0;v<a.length;v++){var b=a[v];if(b.defaultToken&&(h.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 A=b.regex,S=new RegExp("(?:("+A+")|(.))").exec("a").length-2;Array.isArray(b.token)?b.token.length==1||S==1?b.token=b.token[0]:S-1!=b.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:b,groupCount:S-1}),b.token=b.token[0]):(b.tokenArray=b.token,b.token=null,b.onMatch=this.$arrayTokens):typeof b.token=="function"&&!b.onMatch&&(S>1?b.onMatch=this.$applyToken:b.onMatch=b.token),S>1&&(/\\\d/.test(b.regex)?A=b.regex.replace(/\\([0-9]+)/g,function(w,y){return"\\"+(parseInt(y,10)+u+1)}):(S=1,A=this.removeCapturingGroups(b.regex)),!b.splitRegex&&typeof b.token!="string"&&g.push(b)),h[u]=v,u+=S,c.push(A),b.onMatch||(b.onMatch=null)}}c.length||(h[0]=0,c.push("$")),g.forEach(function(w){w.splitRegex=this.createSplitterRegexp(w.regex,f)},this),this.regExps[s]=new RegExp("("+c.join(")|(")+")|($)",f)}}return o.prototype.$setMaxTokenCount=function(l){r=l|0},o.prototype.$applyToken=function(l){var s=this.splitRegex.exec(l).slice(1),a=this.token.apply(this,s);if(typeof a=="string")return[{type:a,value:l}];for(var c=[],u=0,h=a.length;u<h;u++)s[u]&&(c[c.length]={type:a[u],value:s[u]});return c},o.prototype.$arrayTokens=function(l){if(!l)return[];var s=this.splitRegex.exec(l);if(!s)return"text";for(var a=[],c=this.tokenArray,u=0,h=c.length;u<h;u++)s[u+1]&&(a[a.length]={type:c[u],value:s[u+1]});return a},o.prototype.removeCapturingGroups=function(l){var s=l.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(a,c){return c?"(?:":a});return s},o.prototype.createSplitterRegexp=function(l,s){if(l.indexOf("(?=")!=-1){var a=0,c=!1,u={};l.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(h,f,g,v,b,A){return c?c=b!="]":b?c=!0:v?(a==u.stack&&(u.end=A+1,u.stack=-1),a--):g&&(a++,g.length!=1&&(u.stack=a,u.start=A)),h}),u.end!=null&&/^\)*$/.test(l.substr(u.end))&&(l=l.substring(0,u.start)+l.substr(u.end))}return l.charAt(0)!="^"&&(l="^"+l),l.charAt(l.length-1)!="$"&&(l+="$"),new RegExp(l,(s||"").replace("g",""))},o.prototype.getLineTokens=function(l,s){if(s&&typeof s!="string"){var a=s.slice(0);s=a[0],s==="#tmp"&&(a.shift(),s=a.shift())}else var a=[];var c=s||"start",u=this.states[c];u||(c="start",u=this.states[c]);var h=this.matchMappings[c],f=this.regExps[c];f.lastIndex=0;for(var g,v=[],b=0,A=0,S={type:null,value:""};g=f.exec(l);){var w=h.defaultToken,y=null,D=g[0],T=f.lastIndex;if(T-D.length>b){var $=l.substring(b,T-D.length);S.type==w?S.value+=$:(S.type&&v.push(S),S={type:w,value:$})}for(var M=0;M<g.length-2;M++)if(g[M+1]!==void 0){y=u[h[M]],y.onMatch?w=y.onMatch(D,c,a,l):w=y.token,y.next&&(typeof y.next=="string"?c=y.next:c=y.next(c,a),u=this.states[c],u||(this.reportError("state doesn't exist",c),c="start",u=this.states[c]),h=this.matchMappings[c],b=T,f=this.regExps[c],f.lastIndex=T),y.consumeLineEnd&&(b=T);break}if(D){if(typeof w=="string")(!y||y.merge!==!1)&&S.type===w?S.value+=D:(S.type&&v.push(S),S={type:w,value:D});else if(w){S.type&&v.push(S),S={type:null,value:""};for(var M=0;M<w.length;M++)v.push(w[M])}}if(b==l.length)break;if(b=T,A++>r){for(A>2*l.length&&this.reportError("infinite loop with in ace tokenizer",{startState:s,line:l});b<l.length;)S.type&&v.push(S),S={value:l.substring(b,b+=500),type:"overflow"};c="start",a=[];break}}return S.type&&v.push(S),a.length>1&&a[0]!==c&&a.unshift("#tmp",c),{tokens:v,state:a.length?a:c}},o})();p.prototype.reportError=i,n.Tokenizer=p}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(t,n,d){var i=t("../lib/deep_copy").deepCopy,r;r=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(l,s){if(!s){for(var a in l)this.$rules[a]=l[a];return}for(var a in l){for(var c=l[a],u=0;u<c.length;u++){var h=c[u];(h.next||h.onMatch)&&(typeof h.next=="string"&&h.next.indexOf(s)!==0&&(h.next=s+h.next),h.nextState&&h.nextState.indexOf(s)!==0&&(h.nextState=s+h.nextState))}this.$rules[s+a]=c}},this.getRules=function(){return this.$rules},this.embedRules=function(l,s,a,c,u){var h=typeof l=="function"?new l().getRules():l;if(c)for(var f=0;f<c.length;f++)c[f]=s+c[f];else{c=[];for(var g in h)c.push(s+g)}if(this.addRules(h,s),a)for(var v=Array.prototype[u?"push":"unshift"],f=0;f<c.length;f++)v.apply(this.$rules[c[f]],i(a));this.$embeds||(this.$embeds=[]),this.$embeds.push(s)},this.getEmbeds=function(){return this.$embeds};var p=function(l,s){return(l!="start"||s.length)&&s.unshift(this.nextState,l),this.nextState},o=function(l,s){return s.shift(),s.shift()||"start"};this.normalizeRules=function(){var l=0,s=this.$rules;function a(c){var u=s[c];u.processed=!0;for(var h=0;h<u.length;h++){var f=u[h],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]||""),s[b]&&(b+=l++)),s[b]=v,f.next=b,a(b)}else v=="pop"&&(f.next=o);if(f.push&&(f.nextState=f.next||f.push,f.next=p,delete f.push),f.rules)for(var A in f.rules)s[A]?s[A].push&&s[A].push.apply(s[A],f.rules[A]):s[A]=f.rules[A];var S=typeof f=="string"?f:f.include;if(S&&(S==="$self"&&(S="start"),Array.isArray(S)?g=S.map(function(y){return s[y]}):g=s[S]),g){var w=[h,1].concat(g);f.noEscape&&(w=w.filter(function(y){return!y.next})),u.splice.apply(u,w),h--}f.keywordMap&&(f.token=this.createKeywordMapper(f.keywordMap,f.defaultToken||"text",f.caseInsensitive),delete f.defaultToken)}}Object.keys(s).forEach(a,this)},this.createKeywordMapper=function(l,s,a,c){var u=Object.create(null);return this.$keywordList=[],Object.keys(l).forEach(function(h){for(var f=l[h],g=f.split(c||"|"),v=g.length;v--;){var b=g[v];this.$keywordList.push(b),a&&(b=b.toLowerCase()),u[b]=h}},this),l=null,a?function(h){return u[h.toLowerCase()]||s}:function(h){return u[h]||s}},this.getKeywords=function(){return this.$keywords}}).call(r.prototype),n.TextHighlightRules=r}),ace.define("ace/mode/behaviour",["require","exports","module"],function(t,n,d){var i;i=function(){this.$behaviours={}},(function(){this.add=function(r,p,o){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[r]:this.$behaviours[r]={}}this.$behaviours[r][p]=o},this.addBehaviours=function(r){for(var p in r)for(var o in r[p])this.add(p,o,r[p][o])},this.remove=function(r){this.$behaviours&&this.$behaviours[r]&&delete this.$behaviours[r]},this.inherit=function(r,p){if(typeof r=="function")var o=new r().getBehaviours(p);else var o=r.getBehaviours(p);this.addBehaviours(o)},this.getBehaviours=function(r){if(r){for(var p={},o=0;o<r.length;o++)this.$behaviours[r[o]]&&(p[r[o]]=this.$behaviours[r[o]]);return p}else return this.$behaviours}}).call(i.prototype),n.Behaviour=i}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(t,n,d){var i=t("./range").Range,r=(function(){function p(o,l,s){this.$session=o,this.$row=l,this.$rowTokens=o.getTokens(l);var a=o.getTokenAt(l,s);this.$tokenIndex=a?a.index:-1}return p.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]},p.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]},p.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},p.prototype.getCurrentTokenRow=function(){return this.$row},p.prototype.getCurrentTokenColumn=function(){var o=this.$rowTokens,l=this.$tokenIndex,s=o[l].start;if(s!==void 0)return s;for(s=0;l>0;)l-=1,s+=o[l].value.length;return s},p.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},p.prototype.getCurrentTokenRange=function(){var o=this.$rowTokens[this.$tokenIndex],l=this.getCurrentTokenColumn();return new i(this.$row,l,this.$row,l+o.value.length)},p})();n.TokenIterator=r}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,n,d){var i=t("../../lib/oop"),r=t("../behaviour").Behaviour,p=t("../../token_iterator").TokenIterator,o=t("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],s=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],a,c={},u={'"':'"',"'":"'"},h=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,A,S){var w=v.end.row-v.start.row;return{text:A+b+S,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,A,S,w,y){var D=S.getCursorPosition(),T=w.doc.getLine(D.row);if(y=="{"){h(S);var $=S.getSelectionRange(),M=w.doc.getTextRange($),O=w.getTokenAt(D.row,D.column);if(M!==""&&M!=="{"&&S.getWrapBehavioursEnabled())return f($,M,"{","}");if(O&&/(?:string)\.quasi|\.xml/.test(O.type)){var x=[/tag\-(?:open|name)/,/attribute\-name/];return x.some(function(R){return R.test(O.type)})||/(string)\.quasi/.test(O.type)&&O.value[D.column-O.start-1]!=="$"?void 0:(g.recordAutoInsert(S,w,"}"),{text:"{}",selection:[1,1]})}else if(g.isSaneInsertion(S,w))return/[\]\}\)]/.test(T[D.column])||S.inMultiSelectMode||v.braces?(g.recordAutoInsert(S,w,"}"),{text:"{}",selection:[1,1]}):(g.recordMaybeInsert(S,w,"{"),{text:"{",selection:[1,1]})}else if(y=="}"){h(S);var k=T.substring(D.column,D.column+1);if(k=="}"){var E=w.$findOpeningBracket("}",{column:D.column+1,row:D.row});if(E!==null&&g.isAutoInsertedClosing(D,T,y))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(y==`
188
+ `||y==`\r
189
+ `){h(S);var C="";g.isMaybeInsertedClosing(D,T)&&(C=o.stringRepeat("}",a.maybeInsertedBrackets),g.clearMaybeInsertedClosing());var k=T.substring(D.column,D.column+1);if(k==="}"){var L=w.findMatchingBracket({row:D.row,column:D.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,A,S,w,y){var D=w.doc.getTextRange(y);if(!y.isMultiLine()&&D=="{"){h(S);var T=w.doc.getLine(y.start.row),$=T.substring(y.end.column,y.end.column+1);if($=="}")return y.end.column++,y;a.maybeInsertedBrackets--}}),this.add("parens","insertion",function(b,A,S,w,y){if(y=="("){h(S);var D=S.getSelectionRange(),T=w.doc.getTextRange(D);if(T!==""&&S.getWrapBehavioursEnabled())return f(D,T,"(",")");if(g.isSaneInsertion(S,w))return g.recordAutoInsert(S,w,")"),{text:"()",selection:[1,1]}}else if(y==")"){h(S);var $=S.getCursorPosition(),M=w.doc.getLine($.row),O=M.substring($.column,$.column+1);if(O==")"){var x=w.$findOpeningBracket(")",{column:$.column+1,row:$.row});if(x!==null&&g.isAutoInsertedClosing($,M,y))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(b,A,S,w,y){var D=w.doc.getTextRange(y);if(!y.isMultiLine()&&D=="("){h(S);var T=w.doc.getLine(y.start.row),$=T.substring(y.start.column+1,y.start.column+2);if($==")")return y.end.column++,y}}),this.add("brackets","insertion",function(b,A,S,w,y){if(y=="["){h(S);var D=S.getSelectionRange(),T=w.doc.getTextRange(D);if(T!==""&&S.getWrapBehavioursEnabled())return f(D,T,"[","]");if(g.isSaneInsertion(S,w))return g.recordAutoInsert(S,w,"]"),{text:"[]",selection:[1,1]}}else if(y=="]"){h(S);var $=S.getCursorPosition(),M=w.doc.getLine($.row),O=M.substring($.column,$.column+1);if(O=="]"){var x=w.$findOpeningBracket("]",{column:$.column+1,row:$.row});if(x!==null&&g.isAutoInsertedClosing($,M,y))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(b,A,S,w,y){var D=w.doc.getTextRange(y);if(!y.isMultiLine()&&D=="["){h(S);var T=w.doc.getLine(y.start.row),$=T.substring(y.start.column+1,y.start.column+2);if($=="]")return y.end.column++,y}}),this.add("string_dquotes","insertion",function(b,A,S,w,y){var D=w.$mode.$quotes||u;if(y.length==1&&D[y]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(y)!=-1)return;h(S);var T=y,$=S.getSelectionRange(),M=w.doc.getTextRange($);if(M!==""&&(M.length!=1||!D[M])&&S.getWrapBehavioursEnabled())return f($,M,T,T);if(!M){var O=S.getCursorPosition(),x=w.doc.getLine(O.row),k=x.substring(O.column-1,O.column),E=x.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(E==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 H=B.test(E),P=w.$mode.$pairQuotesAfter,j=P&&P[T]&&P[T].test(k);if(!j&&N||H||E&&!/[\s;,.})\]\\]/.test(E))return null;var V=x[O.column-2];if(k==T&&(V==T||B.test(V)))return null;R=!0}return{text:R?T+T:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(b,A,S,w,y){var D=w.$mode.$quotes||u,T=w.doc.getTextRange(y);if(!y.isMultiLine()&&D.hasOwnProperty(T)){h(S);var $=w.doc.getLine(y.start.row),M=$.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,A,S,w,y){if(b==="doc-start"&&(y===`
192
+ `||y===`\r
193
+ `)&&S.selection.isEmpty()){var D=S.getCursorPosition();if(D.column===0)return;for(var T=w.doc.getLine(D.row),$=w.doc.getLine(D.row+1),M=w.getTokens(D.row),O=0,x=0;x<M.length;x++){O+=M[x].value.length;var k=M[x];if(O>=D.column){if(O===D.column){if(!/\.doc/.test(k.type))return;if(/\*\//.test(k.value)){var E=M[x+1];if(!E||!/\.doc/.test(E.type))return}}var C=D.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($))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,D.column)))return{text:y+F+" * "+y+" "+F+"*/",selection:[1,4+F.length,1,4+F.length]}}})},g.isSaneInsertion=function(v,b){var A=v.getCursorPosition(),S=new p(b,A.row,A.column);if(!this.$matchTokenType(S.getCurrentToken()||"text",l)){if(/[)}\]]/.test(v.session.getLine(A.row)[A.column]))return!0;var w=new p(b,A.row,A.column+1);if(!this.$matchTokenType(w.getCurrentToken()||"text",l))return!1}return S.stepForward(),S.getCurrentTokenRow()!==A.row||this.$matchTokenType(S.getCurrentToken()||"text",s)},g.$matchTokenType=function(v,b){return b.indexOf(v.type||v)>-1},g.recordAutoInsert=function(v,b,A){var S=v.getCursorPosition(),w=b.doc.getLine(S.row);this.isAutoInsertedClosing(S,w,a.autoInsertedLineEnd[0])||(a.autoInsertedBrackets=0),a.autoInsertedRow=S.row,a.autoInsertedLineEnd=A+w.substr(S.column),a.autoInsertedBrackets++},g.recordMaybeInsert=function(v,b,A){var S=v.getCursorPosition(),w=b.doc.getLine(S.row);this.isMaybeInsertedClosing(S,w)||(a.maybeInsertedBrackets=0),a.maybeInsertedRow=S.row,a.maybeInsertedLineStart=w.substr(0,S.column)+A,a.maybeInsertedLineEnd=w.substr(S.column),a.maybeInsertedBrackets++},g.isAutoInsertedClosing=function(v,b,A){return a.autoInsertedBrackets>0&&v.row===a.autoInsertedRow&&A===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,r),n.CstyleBehaviour=g}),ace.define("ace/unicode",["require","exports","module"],function(t,n,d){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],r=0,p=[],o=0;o<i.length;o+=2)p.push(r+=i[o]),i[o+1]&&p.push(45,r+=i[o+1]);n.wordChars=String.fromCharCode.apply(null,p)}),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,d){var i=t("../config"),r=t("../tokenizer").Tokenizer,p=t("./text_highlight_rules").TextHighlightRules,o=t("./behaviour/cstyle").CstyleBehaviour,l=t("../unicode"),s=t("../lib/lang"),a=t("../token_iterator").TokenIterator,c=t("../range").Range,u;u=function(){this.HighlightRules=p},(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 r(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(h,f,g,v){var b=f.doc,A=!0,S=!0,w=1/0,y=f.getTabSize(),D=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var M=this.lineCommentStart.map(s.escapeRegExp).join("|"),T=this.lineCommentStart[0];else var M=s.escapeRegExp(this.lineCommentStart),T=this.lineCommentStart;M=new RegExp("^(\\s*)(?:"+M+") ?"),D=f.getUseSoftTabs();var k=function(H,P){var j=H.match(M);if(j){var V=j[1].length,K=j[0].length;!L(H,V,K)&&j[0][K-1]==" "&&K--,b.removeInLine(P,V,K)}},C=T+" ",x=function(H,P){(!A||/\S/.test(H))&&(L(H,w,w)?b.insertInLine({row:P,column:w},C):b.insertInLine({row:P,column:w},T))},E=function(H,P){return M.test(H)},L=function(H,P,j){for(var V=0;P--&&H.charAt(P)==" ";)V++;if(V%y!=0)return!1;for(var V=0;H.charAt(j++)==" ";)V++;return y>2?V%y!=y-1:V%y==0}}else{if(!this.blockComment)return!1;var T=this.blockComment.start,$=this.blockComment.end,M=new RegExp("^(\\s*)(?:"+s.escapeRegExp(T)+")"),O=new RegExp("(?:"+s.escapeRegExp($)+")\\s*$"),x=function(R,B){E(R,B)||(!A||/\S/.test(R))&&(b.insertInLine({row:B,column:R.length},$),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)},E=function(R,B){if(M.test(R))return!0;for(var N=f.getTokens(B),H=0;H<N.length;H++)if(N[H].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),S&&!E(R,B)&&(S=!1)):F>R.length&&(F=R.length)}),w==1/0&&(w=F,A=!1,S=!1),D&&w%y!=0&&(w=Math.floor(w/y)*y),I(S?k:x)},this.toggleBlockComment=function(h,f,g,v){var b=this.blockComment;if(b){!b.start&&b[0]&&(b=b[0]);var A=new a(f,v.row,v.column),S=A.getCurrentToken();f.selection;var w=f.selection.toOrientedRange(),y,D;if(S&&/comment/.test(S.type)){for(var T,$;S&&/comment/.test(S.type);){var M=S.value.indexOf(b.start);if(M!=-1){var O=A.getCurrentTokenRow(),x=A.getCurrentTokenColumn()+M;T=new c(O,x,O,x+b.start.length);break}S=A.stepBackward()}for(var A=new a(f,v.row,v.column),S=A.getCurrentToken();S&&/comment/.test(S.type);){var M=S.value.indexOf(b.end);if(M!=-1){var O=A.getCurrentTokenRow(),x=A.getCurrentTokenColumn()+M;$=new c(O,x,O,x+b.end.length);break}S=A.stepForward()}$&&f.remove($),T&&(f.remove(T),y=T.start.row,D=-b.start.length)}else D=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+=D),w.end.row==y&&(w.end.column+=D),f.selection.fromOrientedRange(w)}},this.getNextLineIndent=function(h,f,g){return this.$getIndent(f)},this.checkOutdent=function(h,f,g){return!1},this.autoOutdent=function(h,f,g){},this.$getIndent=function(h){return h.match(/^\s*/)[0]},this.createWorker=function(h){return null},this.createModeDelegates=function(h){this.$embeds=[],this.$modes={};for(var f in h)if(h[f]){var g=h[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 A=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],S=function(y){(function(D){var T=A[y],$=D[T];D[A[y]]=function(){return this.$delegator(T,arguments,$)}})(w)},w=this,f=0;f<A.length;f++)S(f)},this.$delegator=function(h,f,g){var v=f[0]||"start";if(typeof v!="string"){if(Array.isArray(v[2])){var b=v[2][v[2].length-1],A=this.$modes[b];if(A)return A[h].apply(A,[v[1]].concat([].slice.call(f,1)))}v=v[0]||"start"}for(var S=0;S<this.$embeds.length;S++)if(this.$modes[this.$embeds[S]]){var w=v.split(this.$embeds[S]);if(!w[0]&&w[1]){f[0]=w[1];var A=this.$modes[this.$embeds[S]];return A[h].apply(A,f)}}var y=g.apply(this,f);return g?y:void 0},this.transformAction=function(h,f,g,v,b){if(this.$behaviour){var A=this.$behaviour.getBehaviours();for(var S in A)if(A[S][f]){var w=A[S][f].apply(this,arguments);if(w)return w}}},this.getKeywords=function(h){if(!this.completionKeywords){var f=this.$tokenizer.rules,g=[];for(var v in f)for(var b=f[v],A=0,S=b.length;A<S;A++)if(typeof b[A].token=="string")/keyword|support|storage/.test(b[A].token)&&g.push(b[A].regex);else if(typeof b[A].token=="object"){for(var w=0,y=b[A].token.length;w<y;w++)if(/keyword|support|storage/.test(b[A].token[w])){var v=b[A].regex.match(/\(.+?\)/g)[w];g.push(v.substr(1,v.length-2))}}this.completionKeywords=g}return h?g.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(h,f,g,v){var b=this.$keywordList||this.$createKeywordList();return b.map(function(A){return{name:A,value:A,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(u.prototype),n.Mode=u}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(t,n,d){var i=t("./lib/dom"),r=(function(){function p(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 p.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},p.prototype.$getWidgetScreenLength=function(){var o=0;return this.lineWidgets.forEach(function(l){l&&l.rowCount&&!l.hidden&&(o+=l.rowCount)}),o},p.prototype.$onChangeEditor=function(o){this.attach(o.editor)},p.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)))},p.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 s=this.session.lineWidgets;s&&s.forEach(function(a){a&&a.el&&a.el.parentNode&&(a._inDocument=!1,a.el.parentNode.removeChild(a.el))})}},p.prototype.updateOnFold=function(o,l){var s=l.lineWidgets;if(!(!s||!o.action)){for(var a=o.data,c=a.start.row,u=a.end.row,h=o.action=="add",f=c+1;f<u;f++)s[f]&&(s[f].hidden=h);s[u]&&(h?s[c]?s[u].hidden=h:s[c]=s[u]:(s[c]==s[u]&&(s[c]=void 0),s[u].hidden=h))}},p.prototype.updateOnChange=function(o){var l=this.session.lineWidgets;if(l){var s=o.start.row,a=o.end.row-s;if(a!==0)if(o.action=="remove"){var c=l.splice(s+1,a);!l[s]&&c[c.length-1]&&(l[s]=c.pop()),c.forEach(function(h){h&&this.removeLineWidget(h)},this),this.$updateRows()}else{var u=new Array(a);l[s]&&l[s].column!=null&&o.start.column>l[s].column&&s++,u.unshift(s,0),l.splice.apply(l,u),this.$updateRows()}}},p.prototype.$updateRows=function(){var o=this.session.lineWidgets;if(o){var l=!0;o.forEach(function(s,a){if(s)for(l=!1,s.row=a;s.$oldWidget;)s.$oldWidget.row=a,s=s.$oldWidget}),l&&(this.session.lineWidgets=null)}},p.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},p.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 s=this.session.getFoldAt(o.row,0);if(o.$fold=s,s){var a=this.session.lineWidgets;o.row==s.end.row&&!a[s.start.row]?a[s.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},p.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()},p.prototype.getWidgetsAtRow=function(o){for(var l=this.session.lineWidgets,s=l&&l[o],a=[];s;)a.push(s),s=s.$oldWidget;return a},p.prototype.onWidgetChanged=function(o){this.session._changedWidgets.push(o),this.editor&&this.editor.renderer.updateFull()},p.prototype.measureWidgets=function(o,l){var s=this.session._changedWidgets,a=l.layerConfig;if(!(!s||!s.length)){for(var c=1/0,u=0;u<s.length;u++){var h=s[u];if(!(!h||!h.el)&&h.session==this.session){if(!h._inDocument){if(this.session.lineWidgets[h.row]!=h)continue;h._inDocument=!0,l.container.appendChild(h.el)}h.h=h.el.offsetHeight,h.fixedWidth||(h.w=h.el.offsetWidth,h.screenWidth=Math.ceil(h.w/a.characterWidth));var f=h.h/a.lineHeight;h.coverLine&&(f-=this.session.getRowLineCount(h.row),f<0&&(f=0)),h.rowCount!=f&&(h.rowCount=f,h.row<c&&(c=h.row))}}c!=1/0&&(this.session._emit("changeFold",{data:{start:{row:c}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},p.prototype.renderWidgets=function(o,l){var s=l.layerConfig,a=this.session.lineWidgets;if(a){for(var c=Math.min(this.firstRow,s.firstRow),u=Math.max(this.lastRow,s.lastRow,a.length);c>0&&!a[c];)c--;this.firstRow=s.firstRow,this.lastRow=s.lastRow,l.$cursorLayer.config=s;for(var h=c;h<=u;h++){var f=a[h];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:h,column:0},!0).top;f.coverLine||(g+=s.lineHeight*this.session.getRowLineCount(f.row)),f.el.style.top=g-s.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=s.width+2*s.padding+"px"),f.fixedWidth?f.el.style.right=l.scrollBar.getWidth()+"px":f.el.style.right=""}}}},p})();n.LineWidgets=r}),ace.define("ace/apply_delta",["require","exports","module"],function(t,n,d){n.applyDelta=function(i,r,p){var o=r.start.row,l=r.start.column,s=i[o]||"";switch(r.action){case"insert":var a=r.lines;if(a.length===1)i[o]=s.substring(0,l)+r.lines[0]+s.substring(l);else{var c=[o,1].concat(r.lines);i.splice.apply(i,c),i[o]=s.substring(0,l)+i[o],i[o+r.lines.length-1]+=s.substring(l)}break;case"remove":var u=r.end.column,h=r.end.row;o===h?i[o]=s.substring(0,l)+s.substring(u):i.splice(o,h-o+1,s.substring(0,l)+i[h].substring(u));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,d){var i=t("./lib/oop"),r=t("./lib/event_emitter").EventEmitter,p=(function(){function s(a,c,u){this.$onChange=this.onChange.bind(this),this.attach(a),typeof c!="number"?this.setPosition(c.row,c.column):this.setPosition(c,u)}return s.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},s.prototype.getDocument=function(){return this.document},s.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)}},s.prototype.setPosition=function(a,c,u){var h;if(u?h={row:a,column:c}:h=this.$clipPositionToDocument(a,c),!(this.row==h.row&&this.column==h.column)){var f={row:this.row,column:this.column};this.row=h.row,this.column=h.column,this._signal("change",{old:f,value:h})}},s.prototype.detach=function(){this.document.off("change",this.$onChange)},s.prototype.attach=function(a){this.document=a||this.document,this.document.on("change",this.$onChange)},s.prototype.$clipPositionToDocument=function(a,c){var u={};return a>=this.document.getLength()?(u.row=Math.max(0,this.document.getLength()-1),u.column=this.document.getLine(u.row).length):a<0?(u.row=0,u.column=0):(u.row=a,u.column=Math.min(this.document.getLine(u.row).length,Math.max(0,c))),c<0&&(u.column=0),u},s})();p.prototype.$insertRight=!1,i.implement(p.prototype,r);function o(s,a,c){var u=c?s.column<=a.column:s.column<a.column;return s.row<a.row||s.row==a.row&&u}function l(s,a,c){var u=s.action=="insert",h=(u?1:-1)*(s.end.row-s.start.row),f=(u?1:-1)*(s.end.column-s.start.column),g=s.start,v=u?g:s.end;return o(a,g,c)?{row:a.row,column:a.column}:o(v,a,!c)?{row:a.row+h,column:a.column+(a.row==v.row?f:0)}:{row:g.row,column:g.column}}n.Anchor=p}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(t,n,d){var i=t("./lib/oop"),r=t("./apply_delta").applyDelta,p=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,l=t("./anchor").Anchor,s=(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 u=this.getLength()-1;this.remove(new o(0,0,u,this.getLine(u).length)),this.insert({row:0,column:0},c||"")},a.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},a.prototype.createAnchor=function(c,u){return new l(this,c,u)},a.prototype.$detectNewLine=function(c){var u=c.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=u?u[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,u){return this.$lines.slice(c,u+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 u;if(c.start.row===c.end.row)u=[this.getLine(c.start.row).substring(c.start.column,c.end.column)];else{u=this.getLines(c.start.row,c.end.row),u[0]=(u[0]||"").substring(c.start.column);var h=u.length-1;c.end.row-c.start.row==h&&(u[h]=u[h].substring(0,c.end.column))}return u},a.prototype.insertLines=function(c,u){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(c,u)},a.prototype.removeLines=function(c,u){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(c,u)},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,u){return this.getLength()<=1&&this.$detectNewLine(u),this.insertMergedLines(c,this.$split(u))},a.prototype.insertInLine=function(c,u){var h=this.clippedPos(c.row,c.column),f=this.pos(c.row,c.column+u.length);return this.applyDelta({start:h,end:f,action:"insert",lines:[u]},!0),this.clonePos(f)},a.prototype.clippedPos=function(c,u){var h=this.getLength();c===void 0?c=h:c<0?c=0:c>=h&&(c=h-1,u=void 0);var f=this.getLine(c);return u==null&&(u=f.length),u=Math.min(Math.max(u,0),f.length),{row:c,column:u}},a.prototype.clonePos=function(c){return{row:c.row,column:c.column}},a.prototype.pos=function(c,u){return{row:c,column:u}},a.prototype.$clipPosition=function(c){var u=this.getLength();return c.row>=u?(c.row=Math.max(0,u-1),c.column=this.getLine(u-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,u){c=Math.min(Math.max(c,0),this.getLength());var h=0;c<this.getLength()?(u=u.concat([""]),h=0):(u=[""].concat(u),c--,h=this.$lines[c].length),this.insertMergedLines({row:c,column:h},u)},a.prototype.insertMergedLines=function(c,u){var h=this.clippedPos(c.row,c.column),f={row:h.row+u.length-1,column:(u.length==1?h.column:0)+u[u.length-1].length};return this.applyDelta({start:h,end:f,action:"insert",lines:u}),this.clonePos(f)},a.prototype.remove=function(c){var u=this.clippedPos(c.start.row,c.start.column),h=this.clippedPos(c.end.row,c.end.column);return this.applyDelta({start:u,end:h,action:"remove",lines:this.getLinesForRange({start:u,end:h})}),this.clonePos(u)},a.prototype.removeInLine=function(c,u,h){var f=this.clippedPos(c,u),g=this.clippedPos(c,h);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,u){c=Math.min(Math.max(0,c),this.getLength()-1),u=Math.min(Math.max(0,u),this.getLength()-1);var h=u==this.getLength()-1&&c>0,f=u<this.getLength()-1,g=h?c-1:c,v=h?this.getLine(g).length:0,b=f?u+1:u,A=f?0:this.getLine(b).length,S=new o(g,v,b,A),w=this.$lines.slice(c,u+1);return this.applyDelta({start:S.start,end:S.end,action:"remove",lines:this.getLinesForRange(S)}),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,u){if(c instanceof o||(c=o.fromPoints(c.start,c.end)),u.length===0&&c.isEmpty())return c.start;if(u==this.getTextRange(c))return c.end;this.remove(c);var h;return u?h=this.insert(c.start,u):h=c.start,h},a.prototype.applyDeltas=function(c){for(var u=0;u<c.length;u++)this.applyDelta(c[u])},a.prototype.revertDeltas=function(c){for(var u=c.length-1;u>=0;u--)this.revertDelta(c[u])},a.prototype.applyDelta=function(c,u){var h=c.action=="insert";(h?c.lines.length<=1&&!c.lines[0]:!o.comparePoints(c.start,c.end))||(h&&c.lines.length>2e4?this.$splitAndapplyLargeDelta(c,2e4):(r(this.$lines,c,u),this._signal("change",c)))},a.prototype.$safeApplyDelta=function(c){var u=this.$lines.length;(c.action=="remove"&&c.start.row<u&&c.end.row<u||c.action=="insert"&&c.start.row<=u)&&this.applyDelta(c)},a.prototype.$splitAndapplyLargeDelta=function(c,u){for(var h=c.lines,f=h.length-u+1,g=c.start.row,v=c.start.column,b=0,A=0;b<f;b=A){A+=u-1;var S=h.slice(b,A);S.push(""),this.applyDelta({start:this.pos(g+b,v),end:this.pos(g+A,v=0),action:c.action,lines:S},!0)}c.lines=h.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,u){for(var h=this.$lines||this.getAllLines(),f=this.getNewLineCharacter().length,g=u||0,v=h.length;g<v;g++)if(c-=h[g].length+f,c<0)return{row:g,column:c+h[g].length+f};return{row:v-1,column:c+h[v-1].length+f}},a.prototype.positionToIndex=function(c,u){for(var h=this.$lines||this.getAllLines(),f=this.getNewLineCharacter().length,g=0,v=Math.min(c.row,h.length),b=u||0;b<v;++b)g+=h[b].length+f;return g+c.column},a.prototype.$split=function(c){return c.split(/\r\n|\r|\n/)},a})();s.prototype.$autoNewLine="",s.prototype.$newLineMode="auto",i.implement(s.prototype,p),n.Document=s}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,d){var i=t("./lib/oop"),r=t("./lib/event_emitter").EventEmitter,p=(function(){function o(l,s){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,u=a.currentLine,h=-1,f=a.doc,g=u;a.lines[u];)u++;var v=f.getLength(),b=0;for(a.running=!1;u<v;){a.$tokenizeRow(u),h=u;do u++;while(a.lines[u]);if(b++,b%5===0&&new Date-c>20){a.running=setTimeout(a.$worker,20);break}}a.currentLine=u,h==-1&&(h=u),g<=h&&a.fireUpdateEvent(g,h)}}}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,s){var a={first:l,last:s};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 s=l.start.row,a=l.end.row-s;if(a===0)this.lines[s]=null;else if(l.action=="remove")this.lines.splice(s,a+1,null),this.states.splice(s,a+1,null);else{var c=Array(a+1);c.unshift(s,1),this.lines.splice.apply(this.lines,c),this.states.splice.apply(this.states,c)}this.currentLine=Math.min(s,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 s=this.doc.getLine(l),a=this.states[l-1],c=this.tokenizer.getLineTokens(s,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(p.prototype,r),n.BackgroundTokenizer=p}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(t,n,d){var i=t("./lib/lang"),r=t("./range").Range,p=(function(){function o(l,s,a){a===void 0&&(a="text"),this.setRegexp(l),this.clazz=s,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,s,a,c){if(this.regExp){for(var u=c.firstRow,h=c.lastRow,f={},g=a.$editor&&a.$editor.$search,v=g&&g.$isMultilineSearch(a.$editor.getLastSearchOptions()),b=u;b<=h;b++){var A=this.cache[b];if(A==null||a.getValue().length!=this.docLen){if(v){A=[];var S=g.$multiLineForward(a,this.regExp,b,h);if(S){var w=S.endRow<=h?S.endRow-1:h;w>b&&(b=w),A.push(new r(S.startRow,S.startCol,S.endRow,S.endCol))}A.length>this.MAX_RANGES&&(A=A.slice(0,this.MAX_RANGES))}else A=i.getMatchOffsets(a.getLine(b),this.regExp),A.length>this.MAX_RANGES&&(A=A.slice(0,this.MAX_RANGES)),A=A.map(function($){return new r(b,$.offset,b,$.offset+$.length)});this.cache[b]=A.length?A:""}if(A.length!==0)for(var y=A.length;y--;){var D=A[y].toScreenRange(a),T=D.toString();f[T]||(f[T]=!0,s.drawSingleLineMarker(l,D,this.clazz,c))}}this.docLen=a.getValue().length}},o})();p.prototype.MAX_RANGES=500,n.SearchHighlight=p}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,n,d){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,D,T){if(!this.$fromUndo&&y!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),D===!1||!this.lastDeltas){this.lastDeltas=[];var $=this.$undoStack.length;$>this.$undoDepth-1&&this.$undoStack.splice(0,$-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,D){this.selections.push({value:y,rev:D||this.$rev})},w.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},w.prototype.markIgnored=function(y,D){D==null&&(D=this.$rev+1);for(var T=this.$undoStack,$=T.length;$--;){var M=T[$][0];if(M.id<=y)break;M.id<D&&(M.ignore=!0)}this.lastDeltas=null},w.prototype.getSelection=function(y,D){for(var T=this.selections,$=T.length;$--;){var M=T[$];if(M.rev<y)return D&&(M=T[$+1]),M}},w.prototype.getRevision=function(){return this.$rev},w.prototype.getDeltas=function(y,D){D==null&&(D=this.$rev+1);for(var T=this.$undoStack,$=null,M=0,O=T.length;O--;){var x=T[O][0];if(x.id<D&&!$&&($=O+1),x.id<=y){M=O+1;break}}return T.slice(M,$)},w.prototype.getChangedRanges=function(y,D){D==null&&(D=this.$rev+1)},w.prototype.getChangedLines=function(y,D){D==null&&(D=this.$rev+1)},w.prototype.undo=function(y,D){this.lastDeltas=null;var T=this.$undoStack;if(r(T,T.length)){y||(y=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var $=T.pop(),M=null;return $&&(M=y.undoChanges($,D),this.$redoStack.push($),this.$syncRev()),this.$fromUndo=!1,M}},w.prototype.redo=function(y,D){if(this.lastDeltas=null,y||(y=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var T=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);S(this.$redoStack,T),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(O){O[0].id=++this.$maxRev},this)}var $=this.$redoStack.pop(),M=null;return $&&(M=y.redoChanges($,D),this.$undoStack.push($),this.$syncRev()),this.$fromUndo=!1,M},w.prototype.$syncRev=function(){var y=this.$undoStack,D=y[y.length-1],T=D&&D[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 r(w,y){for(var D=y;D--;){var T=w[D];if(T&&!T[0].ignore){for(;D<y-1;){var $=h(w[D],w[D+1]);w[D]=$[0],w[D+1]=$[1],D++}return!0}}}var p=t("./range").Range,o=p.comparePoints;p.comparePoints;function l(w){return{row:w.row,column:w.column}}function s(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 u(w,y){var D=w.action=="insert",T=y.action=="insert";if(D&&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(D&&!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(!D&&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(!D&&!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 h(w,y){for(var D=w.length;D--;)for(var T=0;T<y.length;T++)if(!u(w[D],y[T])){for(;D<w.length;){for(;T--;)u(y[T],w[D]);T=y.length,D++}return[w,y]}return w.selectionBefore=y.selectionBefore=w.selectionAfter=y.selectionAfter=null,[y,w]}function f(w,y){var D=w.action=="insert",T=y.action=="insert";if(D&&T)o(w.start,y.start)<0?g(y,w,1):g(w,y,1);else if(D&&!T)o(w.start,y.end)>=0?g(w,y,-1):(o(w.start,y.start)<=0||g(w,p.fromPoints(y.start,w.start),-1),g(y,w,1));else if(!D&&T)o(y.start,w.end)>=0?g(y,w,-1):(o(y.start,w.start)<=0||g(y,p.fromPoints(w.start,y.start),-1),g(w,y,1));else if(!D&&!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 $,M;return o(w.start,y.start)<0&&($=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&&!$&&(w.lines=M.lines,w.start=M.start,w.end=M.end,M=w),[y,$,M].filter(Boolean)}return[y,w]}function g(w,y,D){v(w.start,y.start,y.end,D),v(w.end,y.start,y.end,D)}function v(w,y,D,T){w.row==(T==1?y:D).row&&(w.column+=T*(D.column-y.column)),w.row+=T*(D.row-y.row)}function b(w,y){var D=w.lines,T=w.end;w.end=l(y);var $=w.end.row-w.start.row,M=D.splice($,D.length),O=$?y.column:y.column-w.start.column;D.push(M[0].substring(0,O)),M[0]=M[0].substr(O);var x={start:l(y),end:T,lines:M,action:w.action};return x}function A(w,y){y=s(y);for(var D=w.length;D--;){for(var T=w[D],$=0;$<T.length;$++){var M=T[$],O=f(M,y);y=O[0],O.length!=2&&(O[2]?(T.splice($+1,1,O[1],O[2]),$++):O[1]||(T.splice($,1),$--))}T.length||w.splice(D,1)}return w}function S(w,y){for(var D=0;D<y.length;D++)for(var T=y[D],$=0;$<T.length;$++)A(w,T[$])}n.UndoManager=i}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(t,n,d){var i=t("../range").Range,r=(function(){function p(o,l){this.foldData=o,Array.isArray(l)?this.folds=l:l=this.folds=[l];var s=l[l.length-1];this.range=new i(l[0].start.row,l[0].start.column,s.end.row,s.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(a){a.setFoldLine(this)},this)}return p.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})},p.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,s){return-l.range.compareEnd(s.start.row,s.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},p.prototype.containsRow=function(o){return o>=this.start.row&&o<=this.end.row},p.prototype.walk=function(o,l,s){var a=0,c=this.folds,u,h,f,g=!0;l==null&&(l=this.end.row,s=this.end.column);for(var v=0;v<c.length;v++){if(u=c[v],h=u.range.compareStart(l,s),h==-1){o(null,l,s,a,g);return}if(f=o(null,u.start.row,u.start.column,a,g),f=!f&&o(u.placeholder,u.start.row,u.start.column,a),f||h===0)return;g=!u.sameRow,a=u.end.column}o(null,l,s,a,g)},p.prototype.getNextFoldTo=function(o,l){for(var s,a,c=0;c<this.folds.length;c++){if(s=this.folds[c],a=s.range.compareEnd(o,l),a==-1)return{fold:s,kind:"after"};if(a===0)return{fold:s,kind:"inside"}}return null},p.prototype.addRemoveChars=function(o,l,s){var a=this.getNextFoldTo(o,l),c,u;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){u=this.folds;var h=u.indexOf(c);for(h===0&&(this.start.column+=s),h;h<u.length;h++){if(c=u[h],c.start.column+=s,!c.sameRow)return;c.end.column+=s}this.end.column+=s}}},p.prototype.split=function(o,l){var s=this.getNextFoldTo(o,l);if(!s||s.kind=="inside")return null;var a=s.fold,c=this.folds,u=this.foldData,h=c.indexOf(a),f=c[h-1];this.end.row=f.end.row,this.end.column=f.end.column,c=c.splice(h,c.length-h);var g=new p(u,c);return u.splice(u.indexOf(this)+1,0,g),g},p.prototype.merge=function(o){for(var l=o.folds,s=0;s<l.length;s++)this.addFold(l[s]);var a=this.foldData;a.splice(a.indexOf(o),1)},p.prototype.toString=function(){var o=[this.range.toString()+": ["];return this.folds.forEach(function(l){o.push(" "+l.toString())}),o.push("]"),o.join(`
204
+ `)},p.prototype.idxToPosition=function(o){for(var l=0,s=0;s<this.folds.length;s++){var a=this.folds[s];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}},p})();n.FoldLine=r}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(t,n,d){var i=t("./range").Range,r=i.comparePoints,p=(function(){function o(){this.ranges=[],this.$bias=1}return o.prototype.pointIndex=function(l,s,a){for(var c=this.ranges,u=a||0;u<c.length;u++){var h=c[u],f=r(l,h.end);if(!(f>0)){var g=r(l,h.start);return f===0?s&&g!==0?-u-2:u:g>0||g===0&&!s?u:-u-1}}return-u-1},o.prototype.add=function(l){var s=!l.isEmpty(),a=this.pointIndex(l.start,s);a<0&&(a=-a-1);var c=this.pointIndex(l.end,s,a);return c<0?c=-c-1:c++,this.ranges.splice(a,c-a,l)},o.prototype.addList=function(l){for(var s=[],a=l.length;a--;)s.push.apply(s,this.add(l[a]));return s},o.prototype.substractPoint=function(l){var s=this.pointIndex(l);if(s>=0)return this.ranges.splice(s,1)},o.prototype.merge=function(){var l=[],s=this.ranges;s=s.sort(function(f,g){return r(f.start,g.start)});for(var a=s[0],c,u=1;u<s.length;u++){c=a,a=s[u];var h=r(c.end,a.start);h<0||h==0&&!c.isEmpty()&&!a.isEmpty()||(r(c.end,a.end)<0&&(c.end.row=a.end.row,c.end.column=a.end.column),s.splice(u,1),l.push(a),a=c,u--)}return this.ranges=s,l},o.prototype.contains=function(l,s){return this.pointIndex({row:l,column:s})>=0},o.prototype.containsPoint=function(l){return this.pointIndex(l)>=0},o.prototype.rangeAtPoint=function(l){var s=this.pointIndex(l);if(s>=0)return this.ranges[s]},o.prototype.clipRows=function(l,s){var a=this.ranges;if(a[0].start.row>s||a[a.length-1].start.row<l)return[];var c=this.pointIndex({row:l,column:0});c<0&&(c=-c-1);var u=this.pointIndex({row:s,column:0},c);u<0&&(u=-u-1);for(var h=[],f=c;f<u;f++)h.push(a[f]);return h},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 s=l.start,a=l.end,c=s.row,u=a.row,h=this.ranges,f=0,g=h.length;f<g;f++){var v=h[f];if(v.end.row>=c)break}if(l.action=="insert")for(var b=u-c,A=-s.column+a.column;f<g;f++){var v=h[f];if(v.start.row>c)break;if(v.start.row==c&&v.start.column>=s.column&&(v.start.column==s.column&&this.$bias<=0||(v.start.column+=A,v.start.row+=b)),v.end.row==c&&v.end.column>=s.column){if(v.end.column==s.column&&this.$bias<0)continue;v.end.column==s.column&&A>0&&f<g-1&&v.end.column>v.start.column&&v.end.column==h[f+1].start.column&&(v.end.column-=A),v.end.column+=A,v.end.row+=b}}else for(var b=c-u,A=s.column-a.column;f<g;f++){var v=h[f];if(v.start.row>u)break;v.end.row<u&&(c<v.end.row||c==v.end.row&&s.column<v.end.column)?(v.end.row=c,v.end.column=s.column):v.end.row==u?v.end.column<=a.column?(b||v.end.column>s.column)&&(v.end.column=s.column,v.end.row=s.row):(v.end.column+=A,v.end.row+=b):v.end.row>u&&(v.end.row+=b),v.start.row<u&&(c<v.start.row||c==v.start.row&&s.column<v.start.column)?(v.start.row=c,v.start.column=s.column):v.start.row==u?v.start.column<=a.column?(b||v.start.column>s.column)&&(v.start.column=s.column,v.start.row=s.row):(v.start.column+=A,v.start.row+=b):v.start.row>u&&(v.start.row+=b)}if(b!=0&&f<g)for(;f<g;f++){var v=h[f];v.start.row+=b,v.end.row+=b}},o})();p.prototype.comparePoints=r,n.RangeList=p}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(t,n,d){var i=this&&this.__extends||(function(){var c=function(u,h){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(u,h)};return function(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");c(u,h);function f(){this.constructor=u}u.prototype=h===null?Object.create(h):(f.prototype=h.prototype,new f)}})(),r=t("../range_list").RangeList,p=(function(c){i(u,c);function u(h,f){var g=c.call(this)||this;return g.foldLine=null,g.placeholder=f,g.range=h,g.start=h.start,g.end=h.end,g.sameRow=h.start.row==h.end.row,g.subFolds=g.ranges=[],g}return u.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},u.prototype.setFoldLine=function(h){this.foldLine=h,this.subFolds.forEach(function(f){f.setFoldLine(h)})},u.prototype.clone=function(){var h=this.range.clone(),f=new u(h,this.placeholder);return this.subFolds.forEach(function(g){f.subFolds.push(g.clone())}),f.collapseChildren=this.collapseChildren,f},u.prototype.addSubFold=function(h){if(!this.range.isEqual(h)){l(h,this.start);for(var A=h.start.row,S=h.start.column,f=0,g=-1;f<this.subFolds.length&&(g=this.subFolds[f].range.compare(A,S),g==1);f++);var v=this.subFolds[f],b=0;if(g==0){if(v.range.containsRange(h))return v.addSubFold(h);b=1}for(var A=h.range.end.row,S=h.range.end.column,w=f,g=-1;w<this.subFolds.length&&(g=this.subFolds[w].range.compare(A,S),g==1);w++);g==0&&w++;for(var y=this.subFolds.splice(f,w-f,h),D=g==0?y.length-1:y.length,T=b;T<D;T++)h.addSubFold(y[T]);return h.setFoldLine(this.foldLine),h}},u.prototype.restoreRange=function(h){return a(h,this.start)},u})(r);function o(c,u){c.row-=u.row,c.row==0&&(c.column-=u.column)}function l(c,u){o(c.start,u),o(c.end,u)}function s(c,u){c.row==0&&(c.column+=u.column),c.row+=u.row}function a(c,u){s(c.start,u),s(c.end,u)}n.Fold=p}),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,d){var i=t("../range").Range,r=t("./fold_line").FoldLine,p=t("./fold").Fold,o=t("../token_iterator").TokenIterator,l=t("../mouse/mouse_event").MouseEvent;function s(){this.getFoldAt=function(a,c,u){var h=this.getFoldLine(a);if(!h)return null;for(var f=h.folds,g=0;g<f.length;g++){var v=f[g].range;if(v.contains(a,c)){if(u==1&&v.isEnd(a,c)&&!v.isEmpty())continue;if(u==-1&&v.isStart(a,c)&&!v.isEmpty())continue;return f[g]}}},this.getFoldsInRange=function(a){var c=a.start,u=a.end,h=this.$foldData,f=[];c.column+=1,u.column-=1;for(var g=0;g<h.length;g++){var v=h[g].range.compareRange(a);if(v!=2){if(v==-2)break;for(var b=h[g].folds,A=0;A<b.length;A++){var S=b[A];if(v=S.range.compareRange(a),v==-2)break;if(v==2)continue;if(v==42)break;f.push(S)}}}return c.column-=1,u.column+=1,f},this.getFoldsInRangeList=function(a){if(Array.isArray(a)){var c=[];a.forEach(function(u){c=c.concat(this.getFoldsInRange(u))},this)}else var c=this.getFoldsInRange(a);return c},this.getAllFolds=function(){for(var a=[],c=this.$foldData,u=0;u<c.length;u++)for(var h=0;h<c[u].folds.length;h++)a.push(c[u].folds[h]);return a},this.getFoldStringAt=function(a,c,u,h){if(h=h||this.getFoldLine(a),!h)return null;for(var f={end:{column:0}},g,v,b=0;b<h.folds.length;b++){v=h.folds[b];var A=v.range.compareEnd(a,c);if(A==-1){g=this.getLine(v.start.row).substring(f.end.column,v.start.column);break}else if(A===0)return null;f=v}return g||(g=this.getLine(v.start.row).substring(f.end.column)),u==-1?g.substring(0,c-f.end.column):u==1?g.substring(c-f.end.column):g},this.getFoldLine=function(a,c){var u=this.$foldData,h=0;for(c&&(h=u.indexOf(c)),h==-1&&(h=0),h;h<u.length;h++){var f=u[h];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 u=this.$foldData,h=0;for(c&&(h=u.indexOf(c)),h==-1&&(h=0),h;h<u.length;h++){var f=u[h];if(f.end.row>=a)return f}return null},this.getFoldedRowCount=function(a,c){for(var u=this.$foldData,h=c-a+1,f=0;f<u.length;f++){var g=u[f],v=g.end.row,b=g.start.row;if(v>=c){b<c&&(b>=a?h-=c-b:h=0);break}else v>=a&&(b>=a?h-=v-b:h-=v-a+1)}return h},this.$addFoldLine=function(a){return this.$foldData.push(a),this.$foldData.sort(function(c,u){return c.start.row-u.start.row}),a},this.addFold=function(a,c){var u=this.$foldData,h=!1,f;a instanceof p?f=a:(f=new p(c,a),f.collapseChildren=c.collapseChildren),this.$clipRangeToDocument(f.range);var g=f.start.row,v=f.start.column,b=f.end.row,A=f.end.column,S=this.getFoldAt(g,v,1),w=this.getFoldAt(b,A,-1);if(S&&w==S)return S.addSubFold(f);S&&!S.range.isStart(g,v)&&this.removeFold(S),w&&!w.range.isEnd(b,A)&&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 D=0;D<u.length;D++){var T=u[D];if(b==T.start.row){T.addFold(f),h=!0;break}else if(g==T.end.row){if(T.addFold(f),h=!0,!f.sameRow){var $=u[D+1];if($&&$.start.row==b){T.merge($);break}}break}else if(b<=T.start.row)break}return h||(T=this.$addFoldLine(new r(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,u=c.start.row,h=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(u,h):this.$updateRowLengthCache(u,h)),this.$modified=!0,this._signal("changeFold",{data:a,action:"remove"})},this.removeFolds=function(a){for(var c=[],u=0;u<a.length;u++)c.push(a[u]);c.forEach(function(h){this.removeFold(h)},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 u,h;if(a==null)u=new i(0,0,this.getLength(),0),c==null&&(c=!0);else if(typeof a=="number")u=new i(a,0,a,this.getLine(a).length);else if("row"in a)u=i.fromPoints(a,a);else{if(Array.isArray(a))return h=[],a.forEach(function(g){h=h.concat(this.unfold(g))},this),h;u=a}h=this.getFoldsInRangeList(u);for(var f=h;h.length==1&&i.comparePoints(h[0].start,u.start)<0&&i.comparePoints(h[0].end,u.end)>0;)this.expandFolds(h),h=this.getFoldsInRangeList(u);if(c!=!1?this.removeFolds(h):this.expandFolds(h),f.length)return f},this.isRowFolded=function(a,c){return!!this.getFoldLine(a,c)},this.getRowFoldEnd=function(a,c){var u=this.getFoldLine(a,c);return u?u.end.row:a},this.getRowFoldStart=function(a,c){var u=this.getFoldLine(a,c);return u?u.start.row:a},this.getFoldDisplayLine=function(a,c,u,h,f){h==null&&(h=a.start.row),f==null&&(f=0),c==null&&(c=a.end.row),u==null&&(u=this.getLine(c).length);var g=this.doc,v="";return a.walk(function(b,A,S,w){if(!(A<h)){if(A==h){if(S<f)return;w=Math.max(f,w)}b!=null?v+=b:v+=g.getLine(A).substring(w,S)}},c,u),v},this.getDisplayLine=function(a,c,u,h){var f=this.getFoldLine(a);if(f)return this.getFoldDisplayLine(f,a,c,u,h);var g;return g=this.doc.getLine(a),g.substring(h||0,c||g.length)},this.$cloneFoldData=function(){var a=[];return a=this.$foldData.map(function(c){var u=c.folds.map(function(h){return h.clone()});return new r(a,u)}),a},this.toggleFold=function(a){var c=this.selection,u=c.getRange(),h,f;if(u.isEmpty()){var g=u.start;if(h=this.getFoldAt(g.row,g.column),h){this.expandFold(h);return}else if(a){var v=this.getFoldLine(g.row);v&&this.expandFolds(v.folds);return}else(f=this.findMatchingBracket(g))?u.comparePoint(f)==1?u.end=f:(u.start=f,u.start.column++,u.end.column--):(f=this.findMatchingBracket({row:g.row,column:g.column+1}))?(u.comparePoint(f)==1?u.end=f:u.start=f,u.start.column++):u=this.getCommentFoldRange(g.row,g.column)||u}else{var b=this.getFoldsInRange(u);if(a&&b.length){this.expandFolds(b);return}else b.length==1&&(h=b[0])}if(h||(h=this.getFoldAt(u.start.row,u.start.column)),h&&h.range.toString()==u.toString()){this.expandFold(h);return}var A="...";if(!u.isMultiLine()){if(A=this.getTextRange(u),A.length<4)return;A=A.trim().substring(0,2)+".."}this.addFold(A,u)},this.getCommentFoldRange=function(a,c,u){var h=new o(this,a,c),f=h.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(u!=1){do f=h.stepBackward();while(f&&v.test(f.type));f=h.stepForward()}b.start.row=h.getCurrentTokenRow(),b.start.column=h.getCurrentTokenColumn()+f.value.length,h=new o(this,a,c);var A=this.getState(h.$row);if(u!=-1){var S=-1;do if(f=h.stepForward(),S==-1){var w=this.getState(h.$row);A.toString()!==w.toString()&&(S=h.$row)}else if(h.$row>S)break;while(f&&v.test(f.type));f=h.stepBackward()}else f=h.getCurrentToken();return b.end.row=h.getCurrentTokenRow(),b.end.column=h.getCurrentTokenColumn(),b.start.row==b.end.row&&b.start.column>b.end.column?void 0:b}},this.foldAll=function(a,c,u,h){u==null&&(u=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"&&!(h&&!h(g))){var v=this.getFoldWidgetRange(g);v&&v.isMultiLine()&&v.end.row<=c&&v.start.row>=a&&(g=v.end.row,v.collapseChildren=u,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 u=a.getTokens(c),h=0;h<u.length;h++){var f=u[h];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 u=this.foldWidgets;if(!u||c&&u[a])return{};for(var h=a-1,f;h>=0;){var g=u[h];if(g==null&&(g=u[h]=this.getFoldWidget(h)),g=="start"){var v=this.getFoldWidgetRange(h);if(f||(f=v),v&&v.end.row>=a)break}h--}return{range:h!==-1&&v,firstRange:f}},this.onFoldWidgetClick=function(a,c){c instanceof l&&(c=c.domEvent);var u={children:c.shiftKey,all:c.ctrlKey||c.metaKey,siblings:c.altKey},h=this.$toggleFoldWidget(a,u);if(!h){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 u=this.getFoldWidget(a),h=this.getLine(a),f=u==="end"?-1:1,g=this.getFoldAt(a,f===-1?0:h.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 A=b.range.start.row+1,S=b.range.end.row;this.foldAll(A,S,c.all?1e4:0)}else c.children?(S=v?v.end.row:this.getLength(),this.foldAll(a+1,S,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 u=this.$toggleFoldWidget(c,{});if(!u){var h=this.getParentFoldRangeData(c,!0);if(u=h.range||h.firstRange,u){c=u.start.row;var f=this.getFoldAt(c,this.getLine(c).length,1);f?this.removeFold(f):this.addFold("...",u)}}},this.updateFoldWidgets=function(a){var c=a.start.row,u=a.end.row-c;if(u===0)this.foldWidgets[c]=null;else if(a.action=="remove")this.foldWidgets.splice(c,u+1,null);else{var h=Array(u+1);h.unshift(c,1),this.foldWidgets.splice.apply(this.foldWidgets,h)}},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=s}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,n,d){var i=t("../token_iterator").TokenIterator,r=t("../range").Range;function p(){this.findMatchingBracket=function(o,l){if(o.column==0)return null;var s=l||this.getLine(o.row).charAt(o.column-1);if(s=="")return null;var a=s.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),s=!0,a,c=l.charAt(o.column-1),u=c&&c.match(/([\(\[\{])|([\)\]\}])/);if(u||(c=l.charAt(o.column),o={row:o.row,column:o.column+1},u=c&&c.match(/([\(\[\{])|([\)\]\}])/),s=!1),!u)return null;if(u[1]){var h=this.$findClosingBracket(u[1],o);if(!h)return null;a=r.fromPoints(o,h),s||(a.end.column++,a.start.column--),a.cursor=a.end}else{var h=this.$findOpeningBracket(u[2],o);if(!h)return null;a=r.fromPoints(h,o),s||(a.start.column++,a.end.column--),a.cursor=a.start}return a},this.getMatchingBracketRanges=function(o,l){var s=this.getLine(o.row),a=/([\(\[\{])|([\)\]\}])/,c=!l&&s.charAt(o.column-1),u=c&&c.match(a);if(u||(c=(l===void 0||l)&&s.charAt(o.column),o={row:o.row,column:o.column+1},u=c&&c.match(a)),!u)return null;var h=new r(o.row,o.column-1,o.row,o.column),f=u[1]?this.$findClosingBracket(u[1],o):this.$findOpeningBracket(u[2],o);if(!f)return[h];var g=new r(f.row,f.column,f.row,f.column+1);return[h,g]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(o,l,s){var a=this.$brackets[o],c=1,u=new i(this,l.row,l.column),h=u.getCurrentToken();if(h||(h=u.stepForward()),!!h){s||(s=new RegExp("(\\.?"+h.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var f=l.column-u.getCurrentTokenColumn()-2,g=h.value;;){for(;f>=0;){var v=g.charAt(f);if(v==a){if(c-=1,c==0)return{row:u.getCurrentTokenRow(),column:f+u.getCurrentTokenColumn()}}else v==o&&(c+=1);f-=1}do h=u.stepBackward();while(h&&!s.test(h.type));if(h==null)break;g=h.value,f=g.length-1}return null}},this.$findClosingBracket=function(o,l,s){var a=this.$brackets[o],c=1,u=new i(this,l.row,l.column),h=u.getCurrentToken();if(h||(h=u.stepForward()),!!h){s||(s=new RegExp("(\\.?"+h.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var f=l.column-u.getCurrentTokenColumn();;){for(var g=h.value,v=g.length;f<v;){var b=g.charAt(f);if(b==a){if(c-=1,c==0)return{row:u.getCurrentTokenRow(),column:f+u.getCurrentTokenColumn()}}else b==o&&(c+=1);f+=1}do h=u.stepForward();while(h&&!s.test(h.type));if(h==null)break;f=0}return null}},this.getMatchingTags=function(o){var l=new i(this,o.row,o.column),s=this.$findTagName(l);if(s){var a=l.stepBackward();return a.value==="<"?this.$findClosingTag(l,s):this.$findOpeningTag(l,s)}},this.$findTagName=function(o){var l=o.getCurrentToken(),s=!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&&(s=!0));while(l&&!s);return l},this.$findClosingTag=function(o,l){var s,a=l.value,c=l.value,u=0,h=new r(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);l=o.stepForward();var f=new r(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+l.value.length),g=!1;do{if(s=l,s.type.indexOf("tag-close")!==-1&&!g){var v=new r(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);g=!0}if(l=o.stepForward(),l){if(l.value===">"&&!g){var v=new r(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(s.value==="<")u++;else if(s.value==="</"&&(u--,u<0)){o.stepBackward();var b=new r(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+2);l=o.stepForward();var A=new r(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 S=new r(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);else return}}}else if(c===a&&l.value==="/>"&&(u--,u<0))var b=new r(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+2),A=b,S=A,v=new r(f.end.row,f.end.column,f.end.row,f.end.column+1)}}while(l&&u>=0);if(h&&v&&b&&S&&f&&A)return{openTag:new r(h.start.row,h.start.column,v.end.row,v.end.column),closeTag:new r(b.start.row,b.start.column,S.end.row,S.end.column),openTagName:f,closeTagName:A}},this.$findOpeningTag=function(o,l){var s=o.getCurrentToken(),a=l.value,c=0,u=o.getCurrentTokenRow(),h=o.getCurrentTokenColumn(),f=h+2,g=new r(u,h,u,f);o.stepForward();var v=new r(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 r(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);o.stepBackward(),o.stepBackward();do if(l=s,u=o.getCurrentTokenRow(),h=o.getCurrentTokenColumn(),f=h+l.value.length,s=o.stepBackward(),l){if(l.type.indexOf("tag-name")!==-1){if(a===l.value)if(s.value==="<"){if(c++,c>0){var A=new r(u,h,u,f),S=new r(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);do l=o.stepForward();while(l&&l.value!==">");var w=new r(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1)}}else s.value==="</"&&c--}else if(l.value==="/>"){for(var y=0,D=s;D;){if(D.type.indexOf("tag-name")!==-1&&D.value===a){c--;break}else if(D.value==="<")break;D=o.stepBackward(),y++}for(var T=0;T<y;T++)o.stepForward()}}while(s&&c<=0);if(S&&w&&g&&b&&A&&v)return{openTag:new r(S.start.row,S.start.column,w.end.row,w.end.column),closeTag:new r(g.start.row,g.start.column,b.end.row,b.end.column),openTagName:A,closeTagName:v}}}}n.BracketMatch=p}),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,d){var i=t("./lib/oop"),r=t("./lib/lang"),p=t("./bidihandler").BidiHandler,o=t("./config"),l=t("./lib/event_emitter").EventEmitter,s=t("./selection").Selection,a=t("./mode/text").Mode,c=t("./range").Range,u=t("./line_widgets").LineWidgets,h=t("./document").Document,f=t("./background_tokenizer").BackgroundTokenizer,g=t("./search_highlight").SearchHighlight,v=t("./undomanager").UndoManager,b=(function(){function x(k,E){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"+ ++x.$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 h(k)),this.setDocument(k),this.selection=new s(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new p(this),o.resetOptions(this),this.setMode(E),o._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return x.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=r.delayedCall(this.endOperation.bind(this,!0))},x.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)},x.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 E=this.selection.toJSON();this.curOp.selectionAfter=E,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(E),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",k)}},x.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()},x.prototype.getDocument=function(){return this.doc},Object.defineProperty(x.prototype,"widgetManager",{get:function(){var k=new u(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}),x.prototype.$resetRowCache=function(k){if(!k){this.$docRowCache=[],this.$screenRowCache=[];return}var E=this.$docRowCache.length,C=this.$getRowCacheIndex(this.$docRowCache,k)+1;E>C&&(this.$docRowCache.splice(C,E),this.$screenRowCache.splice(C,E))},x.prototype.$getRowCacheIndex=function(k,E){for(var C=0,L=k.length-1;C<=L;){var I=C+L>>1,F=k[I];if(E>F)C=I+1;else if(E<F)L=I-1;else return I}return C-1},x.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},x.prototype.onChangeFold=function(k){var E=k.data;this.$resetRowCache(E.start.row)},x.prototype.onChange=function(k){this.$modified=!0,this.$bidiHandler.onChange(k),this.$resetRowCache(k.start.row);var E=this.$updateInternalDataOnChange(k);!this.$fromUndo&&this.$undoManager&&(E&&E.length&&(this.$undoManager.add({action:"removeFolds",folds:E},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)},x.prototype.onSelectionChange=function(){this._signal("changeSelection")},x.prototype.setValue=function(k){this.doc.setValue(k),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},x.fromJSON=function(k){typeof k=="string"&&(k=JSON.parse(k));var E=new v;E.$undoStack=k.history.undo,E.$redoStack=k.history.redo,E.mark=k.history.mark,E.$rev=k.history.rev;var C=new x(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(E),C.selection.fromJSON(k.selection),C},x.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()}},x.prototype.toString=function(){return this.doc.getValue()},x.prototype.getSelection=function(){return this.selection},x.prototype.getState=function(k){return this.bgTokenizer.getState(k)},x.prototype.getTokens=function(k){return this.bgTokenizer.getTokens(k)},x.prototype.getTokenAt=function(k,E){var C=this.bgTokenizer.getTokens(k),L,I=0;if(E==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>=E));F++);return L=C[F],L?(L.index=F,L.start=I-L.value.length,L):null},x.prototype.setUndoManager=function(k){if(this.$undoManager=k,this.$informUndoManager&&this.$informUndoManager.cancel(),k){var E=this;k.addSession(this),this.$syncInformUndoManager=function(){E.$informUndoManager.cancel(),E.mergeUndoDeltas=!1},this.$informUndoManager=r.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},x.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},x.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},x.prototype.getTabString=function(){return this.getUseSoftTabs()?r.stringRepeat(" ",this.getTabSize()):" "},x.prototype.setUseSoftTabs=function(k){this.setOption("useSoftTabs",k)},x.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},x.prototype.setTabSize=function(k){this.setOption("tabSize",k)},x.prototype.getTabSize=function(){return this.$tabSize},x.prototype.isTabStop=function(k){return this.$useSoftTabs&&k.column%this.$tabSize===0},x.prototype.setNavigateWithinSoftTabs=function(k){this.setOption("navigateWithinSoftTabs",k)},x.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},x.prototype.setOverwrite=function(k){this.setOption("overwrite",k)},x.prototype.getOverwrite=function(){return this.$overwrite},x.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},x.prototype.addGutterDecoration=function(k,E){this.$decorations[k]||(this.$decorations[k]=""),this.$decorations[k]+=" "+E,this._signal("changeBreakpoint",{})},x.prototype.removeGutterCustomWidget=function(k){this.$editor&&this.$editor.renderer.$gutterLayer.$removeCustomWidget(k)},x.prototype.addGutterCustomWidget=function(k,E){this.$editor&&this.$editor.renderer.$gutterLayer.$addCustomWidget(k,E)},x.prototype.removeGutterDecoration=function(k,E){this.$decorations[k]=(this.$decorations[k]||"").replace(" "+E,""),this._signal("changeBreakpoint",{})},x.prototype.getBreakpoints=function(){return this.$breakpoints},x.prototype.setBreakpoints=function(k){this.$breakpoints=[];for(var E=0;E<k.length;E++)this.$breakpoints[k[E]]="ace_breakpoint";this._signal("changeBreakpoint",{})},x.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},x.prototype.setBreakpoint=function(k,E){E===void 0&&(E="ace_breakpoint"),E?this.$breakpoints[k]=E:delete this.$breakpoints[k],this._signal("changeBreakpoint",{})},x.prototype.clearBreakpoint=function(k){delete this.$breakpoints[k],this._signal("changeBreakpoint",{})},x.prototype.addMarker=function(k,E,C,L){var I=this.$markerId++,F={range:k,type:C||"line",renderer:typeof C=="function"?C:null,clazz:E,inFront:!!L,id:I};return L?(this.$frontMarkers[I]=F,this._signal("changeFrontMarker")):(this.$backMarkers[I]=F,this._signal("changeBackMarker")),I},x.prototype.addDynamicMarker=function(k,E){if(k.update){var C=this.$markerId++;return k.id=C,k.inFront=!!E,E?(this.$frontMarkers[C]=k,this._signal("changeFrontMarker")):(this.$backMarkers[C]=k,this._signal("changeBackMarker")),k}},x.prototype.removeMarker=function(k){var E=this.$frontMarkers[k]||this.$backMarkers[k];if(E){var C=E.inFront?this.$frontMarkers:this.$backMarkers;delete C[k],this._signal(E.inFront?"changeFrontMarker":"changeBackMarker")}},x.prototype.getMarkers=function(k){return k?this.$frontMarkers:this.$backMarkers},x.prototype.highlight=function(k){if(!this.$searchHighlight){var E=new g(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(E)}this.$searchHighlight.setRegexp(k)},x.prototype.highlightLines=function(k,E,C,L){typeof E!="number"&&(C=E,E=k),C||(C="ace_step");var I=new c(k,0,E,1/0);return I.id=this.addMarker(I,C,"fullLine",L),I},x.prototype.setAnnotations=function(k){this.$annotations=k,this._signal("changeAnnotation",{})},x.prototype.getAnnotations=function(){return this.$annotations||[]},x.prototype.clearAnnotations=function(){this.setAnnotations([])},x.prototype.$detectNewLine=function(k){var E=k.match(/^.*?(\r?\n)/m);E?this.$autoNewLine=E[1]:this.$autoNewLine=`
206
+ `},x.prototype.getWordRange=function(k,E){var C=this.getLine(k),L=!1;if(E>0&&(L=!!C.charAt(E-1).match(this.tokenRe)),L||(L=!!C.charAt(E).match(this.tokenRe)),L)var I=this.tokenRe;else if(/^\s+$/.test(C.slice(E-1,E+1)))var I=/\s/;else var I=this.nonTokenRe;var F=E;if(F>0){do F--;while(F>=0&&C.charAt(F).match(I));F++}for(var R=E;R<C.length&&C.charAt(R).match(I);)R++;return new c(k,F,k,R)},x.prototype.getAWordRange=function(k,E){for(var C=this.getWordRange(k,E),L=this.getLine(C.end.row);L.charAt(C.end.column).match(/[ \t]/);)C.end.column+=1;return C},x.prototype.setNewLineMode=function(k){this.doc.setNewLineMode(k)},x.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},x.prototype.setUseWorker=function(k){this.setOption("useWorker",k)},x.prototype.getUseWorker=function(){return this.$useWorker},x.prototype.onReloadTokenizer=function(k){var E=k.data;this.bgTokenizer.start(E.first),this._signal("tokenizerUpdate",k)},x.prototype.setMode=function(k,E){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]),E&&E();return}this.$modeId=L,o.loadModule(["mode",L],function(I){if(!this.destroyed){if(this.$modeId!==L)return E&&E();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)),E&&E()}}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},x.prototype.$onChangeMode=function(k,E){if(E||(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,E||(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}))}},x.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},x.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(k){o.warn("Could not load worker",k),this.$worker=null}},x.prototype.getMode=function(){return this.$mode},x.prototype.setScrollTop=function(k){this.$scrollTop===k||isNaN(k)||(this.$scrollTop=k,this._signal("changeScrollTop",k))},x.prototype.getScrollTop=function(){return this.$scrollTop},x.prototype.setScrollLeft=function(k){this.$scrollLeft===k||isNaN(k)||(this.$scrollLeft=k,this._signal("changeScrollLeft",k))},x.prototype.getScrollLeft=function(){return this.$scrollLeft},x.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},x.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var k=0;return this.lineWidgets.forEach(function(E){E&&E.screenWidth>k&&(k=E.screenWidth)}),this.lineWidgetWidth=k},x.prototype.$computeWidth=function(k){if(this.$modified||k){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var E=this.doc.getAllLines(),C=this.$rowLengthCache,L=0,I=0,F=this.$foldData[I],R=F?F.start.row:1/0,B=E.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(E[N])[0]),C[N]>L&&(L=C[N])}this.screenWidth=L}},x.prototype.getLine=function(k){return this.doc.getLine(k)},x.prototype.getLines=function(k,E){return this.doc.getLines(k,E)},x.prototype.getLength=function(){return this.doc.getLength()},x.prototype.getTextRange=function(k){return this.doc.getTextRange(k||this.selection.getRange())},x.prototype.insert=function(k,E){return this.doc.insert(k,E)},x.prototype.remove=function(k){return this.doc.remove(k)},x.prototype.removeFullLines=function(k,E){return this.doc.removeFullLines(k,E)},x.prototype.undoChanges=function(k,E){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)}!E&&this.$undoSelect&&(k.selectionBefore?this.selection.fromJSON(k.selectionBefore):this.selection.setRange(this.$getUndoSelection(k,!0))),this.$fromUndo=!1}},x.prototype.redoChanges=function(k,E){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)}!E&&this.$undoSelect&&(k.selectionAfter?this.selection.fromJSON(k.selectionAfter):this.selection.setRange(this.$getUndoSelection(k,!1))),this.$fromUndo=!1}},x.prototype.setUndoSelect=function(k){this.$undoSelect=k},x.prototype.$getUndoSelection=function(k,E){function C(B){return E?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},x.prototype.replace=function(k,E){return this.doc.replace(k,E)},x.prototype.moveText=function(k,E,C){var L=this.getTextRange(k),I=this.getFoldsInRange(k),F=c.fromPoints(E,E);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,H=F.start,R=H.row-N.row,B=H.column-N.column;this.addFolds(I.map(function(V){return V=V.clone(),V.start.row==N.row&&(V.start.column+=B),V.end.row==N.row&&(V.end.column+=B),V.start.row+=R,V.end.row+=R,V}))}return F},x.prototype.indentRows=function(k,E,C){C=C.replace(/\t/g,this.getTabString());for(var L=k;L<=E;L++)this.doc.insertInLine({row:L,column:0},C)},x.prototype.outdentRows=function(k){for(var E=k.collapseRows(),C=new c(0,0,0,0),L=this.getTabSize(),I=E.start.row;I<=E.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)}},x.prototype.$moveLines=function(k,E,C){if(k=this.getRowFoldStart(k),E=this.getRowFoldEnd(E),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(E+C);if(L>this.doc.getLength()-1)return 0;var I=L-E}else{k=this.$clipRowToDocument(k),E=this.$clipRowToDocument(E);var I=E-k+1}var F=new c(k,0,E,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,E):this.doc.removeFullLines(k,E);return this.doc.insertFullLines(k+I,B),R.length&&this.addFolds(R),I},x.prototype.moveLinesUp=function(k,E){return this.$moveLines(k,E,-1)},x.prototype.moveLinesDown=function(k,E){return this.$moveLines(k,E,1)},x.prototype.duplicateLines=function(k,E){return this.$moveLines(k,E,0)},x.prototype.$clipRowToDocument=function(k){return Math.max(0,Math.min(k,this.doc.getLength()-1))},x.prototype.$clipColumnToRow=function(k,E){return E<0?0:Math.min(this.doc.getLine(k).length,E)},x.prototype.$clipPositionToDocument=function(k,E){if(E=Math.max(0,E),k<0)k=0,E=0;else{var C=this.doc.getLength();k>=C?(k=C-1,E=this.doc.getLine(C-1).length):E=Math.min(this.doc.getLine(k).length,E)}return{row:k,column:E}},x.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 E=this.doc.getLength()-1;return k.end.row>E?(k.end.row=E,k.end.column=this.doc.getLine(E).length):k.end.column=this.$clipColumnToRow(k.end.row,k.end.column),k},x.prototype.setUseWrapMode=function(k){if(k!=this.$useWrapMode){if(this.$useWrapMode=k,this.$modified=!0,this.$resetRowCache(0),k){var E=this.getLength();this.$wrapData=Array(E),this.$updateWrapData(0,E-1)}this._signal("changeWrapMode")}},x.prototype.getUseWrapMode=function(){return this.$useWrapMode},x.prototype.setWrapLimitRange=function(k,E){(this.$wrapLimitRange.min!==k||this.$wrapLimitRange.max!==E)&&(this.$wrapLimitRange={min:k,max:E},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},x.prototype.adjustWrapLimit=function(k,E){var C=this.$wrapLimitRange;C.max<0&&(C={min:E,max:E});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},x.prototype.$constrainWrapLimit=function(k,E,C){return E&&(k=Math.max(E,k)),C&&(k=Math.min(C,k)),k},x.prototype.getWrapLimit=function(){return this.$wrapLimit},x.prototype.setWrapLimit=function(k){this.setWrapLimitRange(k,k)},x.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},x.prototype.$updateInternalDataOnChange=function(k){var E=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[E?"$wrapData":"$rowLengthCache"].splice(F,B);var H=this.$foldData;N=this.getFoldsInRange(k),this.removeFolds(N);var P=this.getFoldLine(I.row),j=0;if(P){P.addRemoveChars(I.row,I.column,L.column-I.column),P.shiftRow(-B);var V=this.getFoldLine(F);V&&V!==P&&(V.merge(P),P=V),j=H.indexOf(P)+1}for(j;j<H.length;j++){var P=H[j];P.start.row>=I.row&&P.shiftRow(-B)}R=F}else{var K=Array(B);K.unshift(F,0);var J=E?this.$wrapData:this.$rowLengthCache;J.splice.apply(J,K);var H=this.$foldData,P=this.getFoldLine(F),j=0;if(P){var Y=P.range.compareInside(L.row,L.column);Y==0?(P=P.split(L.row,L.column),P&&(P.shiftRow(B),P.addRemoveChars(R,0,I.column-L.column))):Y==-1&&(P.addRemoveChars(F,0,I.column-L.column),P.shiftRow(B)),j=H.indexOf(P)+1}for(j;j<H.length;j++){var P=H[j];P.start.row>=F&&P.shiftRow(B)}}else{B=Math.abs(k.start.column-k.end.column),C==="remove"&&(N=this.getFoldsInRange(k),this.removeFolds(N),B=-B);var P=this.getFoldLine(F);P&&P.addRemoveChars(F,L.column,B)}return E&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,E?this.$updateWrapData(F,R):this.$updateRowLengthCache(F,R),N},x.prototype.$updateRowLengthCache=function(k,E){this.$rowLengthCache[k]=null,this.$rowLengthCache[E]=null},x.prototype.$updateWrapData=function(k,E){var C=this.doc.getAllLines(),L=this.getTabSize(),I=this.$wrapData,F=this.$wrapLimit,R,B,N=k;for(E=Math.min(E,C.length-1);N<=E;)B=this.getFoldLine(N,B),B?(R=[],B.walk(function(H,P,j,V){var K;if(H!=null){K=this.$getDisplayTokens(H,R.length),K[0]=w;for(var J=1;J<K.length;J++)K[J]=y}else K=this.$getDisplayTokens(C[P].substring(V,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++)},x.prototype.$computeWrapSplits=function(k,E,C){if(k.length==0)return[];var L=[],I=k.length,F=0,R=0,B=this.$wrapAsCode,N=this.$indentedSoftWrap,H=E<=Math.max(2*C,8)||N===!1?0:Math.floor(E/2);function P(){var Y=0;if(H===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==$)Y+=C;else{if(q==M)continue;break}}return B&&N!==!1&&(Y+=C),Math.min(Y,H)}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||(V=P(),L.indent=V),R+=X,L.push(R),F=Y}for(var V=0;I-F>E-V;){var K=F+E-V;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+E,K;K<k.length&&k[K]==y;K++);if(K==k.length)break;j(K);continue}for(var J=Math.max(K-(E-(E>>2)),F-1);K>J&&k[K]<w;)K--;if(B){for(;K>J&&k[K]<w;)K--;for(;K>J&&k[K]==D;)K--}else for(;K>J&&k[K]<T;)K--;if(K>J){j(++K);continue}K=F+E,k[K]==S&&K--,j(K-V)}return L},x.prototype.$getDisplayTokens=function(k,E){var C=[],L;E=E||0;for(var I=0;I<k.length;I++){var F=k.charCodeAt(I);if(F==9){L=this.getScreenTabSize(C.length+E),C.push($);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(D):F>=4352&&O(F)?C.push(A,S):C.push(A)}return C},x.prototype.$getStringScreenWidth=function(k,E,C){if(E==0)return[0,0];E==null&&(E=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>E));I++);return[C,I]},x.prototype.getRowLength=function(k){var E=1;return this.lineWidgets&&(E+=this.lineWidgets[k]&&this.lineWidgets[k].rowCount||0),!this.$useWrapMode||!this.$wrapData[k]?E:this.$wrapData[k].length+E},x.prototype.getRowLineCount=function(k){return!this.$useWrapMode||!this.$wrapData[k]?1:this.$wrapData[k].length+1},x.prototype.getRowWrapIndent=function(k){if(this.$useWrapMode){var E=this.screenToDocumentPosition(k,Number.MAX_VALUE),C=this.$wrapData[E.row];return C.length&&C[0]<E.column?C.indent:0}else return 0},x.prototype.getScreenLastRowColumn=function(k){var E=this.screenToDocumentPosition(k,Number.MAX_VALUE);return this.documentToScreenColumn(E.row,E.column)},x.prototype.getDocumentLastRowColumn=function(k,E){var C=this.documentToScreenRow(k,E);return this.getScreenLastRowColumn(C)},x.prototype.getDocumentLastRowColumnPosition=function(k,E){var C=this.documentToScreenRow(k,E);return this.screenToDocumentPosition(C,Number.MAX_VALUE/10)},x.prototype.getRowSplitData=function(k){if(this.$useWrapMode)return this.$wrapData[k]},x.prototype.getScreenTabSize=function(k){return this.$tabSize-(k%this.$tabSize|0)},x.prototype.screenToDocumentRow=function(k,E){return this.screenToDocumentPosition(k,E).row},x.prototype.screenToDocumentColumn=function(k,E){return this.screenToDocumentPosition(k,E).column},x.prototype.screenToDocumentPosition=function(k,E,C){if(k<0)return{row:0,column:0};var L,I=0,F=0,R,B=0,N=0,H=this.$screenRowCache,P=this.$getRowCacheIndex(H,k),j=H.length;if(j&&P>=0)var B=H[P],I=this.$docRowCache[P],V=k>H[j-1];else var V=!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),V&&(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)&&(E=this.$bidiHandler.offsetToCol(C)),F+=this.$getStringScreenWidth(L,E-X)[1],this.$useWrapMode&&F>=R&&(F=R-1),J?J.idxToPosition(F):{row:I,column:F}},x.prototype.documentToScreenPosition=function(k,E){if(typeof E>"u")var C=this.$clipPositionToDocument(k.row,k.column);else C=this.$clipPositionToDocument(k,E);k=C.row,E=C.column;var L=0,I=null,F=null;F=this.getFoldAt(k,E,1),F&&(k=F.start.row,E=F.start.column);var R,B=0,N=this.$docRowCache,H=this.$getRowCacheIndex(N,k),P=N.length;if(P&&H>=0)var B=N[H],L=this.$screenRowCache[H],j=k>N[P-1];else var j=!P;for(var V=this.getNextFoldLine(B),K=V?V.start.row:1/0;B<k;){if(B>=K){if(R=V.end.row+1,R>k)break;V=this.getNextFoldLine(R,V),K=V?V.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="";V&&B>=K?(J=this.getFoldDisplayLine(V,k,E),I=V.start.row):(J=this.getLine(k).substring(0,E),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]}},x.prototype.documentToScreenColumn=function(k,E){return this.documentToScreenPosition(k,E).column},x.prototype.documentToScreenRow=function(k,E){return this.documentToScreenPosition(k,E).row},x.prototype.getScreenLength=function(){var k=0,E=null;if(this.$useWrapMode)for(var I=this.$wrapData.length,F=0,L=0,E=this.$foldData[L++],R=E?E.start.row:1/0;F<I;){var B=this.$wrapData[F];k+=B?B.length+1:1,F++,F>R&&(F=E.end.row+1,E=this.$foldData[L++],R=E?E.start.row:1/0)}else{k=this.getLength();for(var C=this.$foldData,L=0;L<C.length;L++)E=C[L],k-=E.end.row-E.start.row}return this.lineWidgets&&(k+=this.$getWidgetScreenLength()),k},x.prototype.$setFontMetrics=function(k){this.$enableVarChar&&(this.$getStringScreenWidth=function(E,C,L){if(C===0)return[0,0];C||(C=1/0),L=L||0;var I,F;for(F=0;F<E.length&&(I=E.charAt(F),I===" "?L+=this.getScreenTabSize(L):L+=k.getCharacterWidth(I),!(L>C));F++);return[L,F]})},x.prototype.getPrecedingCharacter=function(){var k=this.selection.getCursor();if(k.column===0)return k.row===0?"":this.doc.getNewLineCharacter();var E=this.getLine(k.row);return E[k.column-1]},x.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()},x})();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 A=1,S=2,w=3,y=4,D=9,T=10,$=11,M=12;function O(x){return x<4352?!1:x>=4352&&x<=4447||x>=4515&&x<=4519||x>=4602&&x<=4607||x>=9001&&x<=9002||x>=11904&&x<=11929||x>=11931&&x<=12019||x>=12032&&x<=12245||x>=12272&&x<=12283||x>=12288&&x<=12350||x>=12353&&x<=12438||x>=12441&&x<=12543||x>=12549&&x<=12589||x>=12593&&x<=12686||x>=12688&&x<=12730||x>=12736&&x<=12771||x>=12784&&x<=12830||x>=12832&&x<=12871||x>=12880&&x<=13054||x>=13056&&x<=19903||x>=19968&&x<=42124||x>=42128&&x<=42182||x>=43360&&x<=43388||x>=44032&&x<=55203||x>=55216&&x<=55238||x>=55243&&x<=55291||x>=63744&&x<=64255||x>=65040&&x<=65049||x>=65072&&x<=65106||x>=65108&&x<=65126||x>=65128&&x<=65131||x>=65281&&x<=65376||x>=65504&&x<=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(x){if(!x||x=="off"?x=!1:x=="free"?x=!0:x=="printMargin"?x=-1:typeof x=="string"&&(x=parseInt(x,10)||!1),this.$wrap!=x)if(this.$wrap=x,!x)this.setUseWrapMode(!1);else{var k=typeof x=="number"?x: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(x){x=x=="auto"?this.$mode.type!="text":x!="text",x!=this.$wrapAsCode&&(this.$wrapAsCode=x,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(x){this.$useWorker=x,this.$stopWorker(),x&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(x){x=parseInt(x),x>0&&this.$tabSize!==x&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=x,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(x){this.setFoldStyle(x)},handlesSet:!0},overwrite:{set:function(x){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(x){this.doc.setNewLineMode(x)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(x){this.setMode(x)},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,d){var i=t("./lib/lang"),r=t("./lib/oop"),p=t("./range").Range,o=(function(){function c(){this.$options={}}return c.prototype.set=function(u){return r.mixin(this.$options,u),this},c.prototype.getOptions=function(){return i.copyObject(this.$options)},c.prototype.setOptions=function(u){this.$options=u},c.prototype.find=function(u){var h=this.$options,f=this.$matchIterator(u,h);if(!f)return!1;var g=null;return f.forEach(function(v,b,A,S){return g=new p(v,b,A,S),b==S&&h.start&&h.start.start&&h.skipCurrent!=!1&&g.isEqual(h.start)?(g=null,!1):!0}),g},c.prototype.findAll=function(u){var h=this.$options;if(!h.needle)return[];this.$assembleRegExp(h);var f=h.range,g=f?u.getLines(f.start.row,f.end.row):u.doc.getAllLines(),v=[],b=h.re;if(h.$isMultiLine){var A=b.length,S=g.length-A,w;e:for(var y=b.offset||0;y<=S;y++){for(var D=0;D<A;D++)if(g[y+D].search(b[D])==-1)continue e;var T=g[y],$=g[y+A-1],M=T.length-T.match(b[0])[0].length,O=$.match(b[A-1])[0].length;w&&w.end.row===y&&w.end.column>M||(v.push(w=new p(y,M,y+A-1,O)),A>2&&(y=y+A-2))}}else for(var x,k=0;k<g.length;k++)if(this.$isMultilineSearch(h)){var E=g.length-1;if(x=this.$multiLineForward(u,b,k,E),x){var C=x.endRow<=E?x.endRow-1:E;C>k&&(k=C),v.push(new p(x.startRow,x.startCol,x.endRow,x.endCol))}}else{x=i.getMatchOffsets(g[k],b);for(var D=0;D<x.length;D++){var L=x[D];v.push(new p(k,L.offset,k,L.offset+L.length))}}if(f){for(var I=f.start.column,F=f.end.column,k=0,D=v.length-1;k<D&&v[k].start.column<I&&v[k].start.row==0;)k++;for(var R=f.end.row-f.start.row;k<D&&v[D].end.column>F&&v[D].end.row==R;)D--;for(v=v.slice(k,D+1),k=0,D=v.length;k<D;k++)v[k].start.row+=f.start.row,v[k].end.row+=f.start.row}return v},c.prototype.parseReplaceString=function(u){for(var h={DollarSign:36,Ampersand:38,Digit0:48,Digit1:49,Digit9:57,Backslash:92,n:110,t:116},f="",g=0,v=u.length;g<v;g++){var b=u.charCodeAt(g);if(b===h.Backslash){if(g++,g>=v){f+="\\";break}var A=u.charCodeAt(g);switch(A){case h.Backslash:f+="\\";break;case h.n:f+=`
207
+ `;break;case h.t:f+=" ";break}continue}if(b===h.DollarSign){if(g++,g>=v){f+="$";break}var S=u.charCodeAt(g);if(S===h.DollarSign){f+="$$";continue}if(S===h.Digit0||S===h.Ampersand){f+="$&";continue}if(h.Digit1<=S&&S<=h.Digit9){f+="$"+u[g];continue}}f+=u[g]}return f||u},c.prototype.replace=function(u,h){var f=this.$options,g=this.$assembleRegExp(f);if(f.$isMultiLine)return h;if(g){var v=this.$isMultilineSearch(f);v&&(u=u.replace(/\r\n|\r|\n/g,`
208
+ `));var b=g.exec(u);if(!b||!v&&b[0].length!=u.length)return null;if(h=f.regExp?this.parseReplaceString(h):h.replace(/\$/g,"$$$$"),h=u.replace(g,h),f.preserveCase){h=h.split("");for(var A=Math.min(u.length,u.length);A--;){var S=u[A];S&&S.toLowerCase()!=S?h[A]=h[A].toUpperCase():h[A]=h[A].toLowerCase()}h=h.join("")}return h}},c.prototype.$assembleRegExp=function(u,h){if(u.needle instanceof RegExp)return u.re=u.needle;var f=u.needle;if(!u.needle)return u.re=!1;u.regExp||(f=i.escapeRegExp(f));var g=u.caseSensitive?"gm":"gmi";try{new RegExp(f,"u"),u.$supportsUnicodeFlag=!0,g+="u"}catch{u.$supportsUnicodeFlag=!1}if(u.wholeWord&&(f=l(f,u)),u.$isMultiLine=!h&&/[\n\r]/.test(f),u.$isMultiLine)return u.re=this.$assembleMultilineRegExp(f,g);try{var v=new RegExp(f,g)}catch{v=!1}return u.re=v},c.prototype.$assembleMultilineRegExp=function(u,h){for(var f=u.replace(/\r\n|\r|\n/g,`$
209
+ ^`).split(`
210
+ `),g=[],v=0;v<f.length;v++)try{g.push(new RegExp(f[v],h))}catch{return!1}return g},c.prototype.$isMultilineSearch=function(u){return u.re&&/\\r\\n|\\r|\\n/.test(u.re.source)&&u.regExp&&!u.$isMultiLine},c.prototype.$multiLineForward=function(u,h,f,g){for(var v,b=a(u,f),A=f;A<=g;){for(var S=0;S<b&&!(A>g);S++){var w=u.getLine(A++);v=v==null?w:v+`
211
+ `+w}var y=h.exec(v);if(h.lastIndex=0,y){var D=v.slice(0,y.index).split(`
212
+ `),T=y[0].split(`
213
+ `),$=f+D.length-1,M=D[D.length-1].length,O=$+T.length-1,x=T.length==1?M+T[0].length:T[T.length-1].length;return{startRow:$,startCol:M,endRow:O,endCol:x}}}return null},c.prototype.$multiLineBackward=function(u,h,f,g,v){for(var b,A=a(u,g),S=u.getLine(g).length-f,w=g;w>=v;){for(var y=0;y<A&&w>=v;y++){var D=u.getLine(w--);b=b==null?D:D+`
214
+ `+b}var T=s(b,h,S);if(T){var $=b.slice(0,T.index).split(`
215
+ `),M=T[0].split(`
216
+ `),O=w+$.length,x=$[$.length-1].length,k=O+M.length-1,E=M.length==1?x+M[0].length:M[M.length-1].length;return{startRow:O,startCol:x,endRow:k,endCol:E}}}return null},c.prototype.$matchIterator=function(u,h){var f=this.$assembleRegExp(h);if(!f)return!1;var g=this.$isMultilineSearch(h),v=this.$multiLineForward,b=this.$multiLineBackward,A=h.backwards==!0,S=h.skipCurrent!=!1,w=f.unicode,y=h.range,D=h.start;D||(D=y?y[A?"end":"start"]:u.selection.getRange()),D.start&&(D=D[S!=A?"end":"start"]);var T=y?y.start.row:0,$=y?y.end.row:u.getLength()-1;if(A)var M=function(k){var E=D.row;if(!x(E,D.column,k)){for(E--;E>=T;E--)if(x(E,Number.MAX_VALUE,k))return;if(h.wrap!=!1){for(E=$,T=D.row;E>=T;E--)if(x(E,Number.MAX_VALUE,k))return}}};else var M=function(E){var C=D.row;if(!x(C,D.column,E)){for(C=C+1;C<=$;C++)if(x(C,0,E))return;if(h.wrap!=!1){for(C=T,$=D.row;C<=$;C++)if(x(C,0,E))return}}};if(h.$isMultiLine)var O=f.length,x=function(k,E,C){var L=A?k-O+1:k;if(!(L<0||L+O>u.getLength())){var I=u.getLine(L),F=I.search(f[0]);if(!(!A&&F<E||F===-1)){for(var R=1;R<O;R++)if(I=u.getLine(L+R),I.search(f[R])==-1)return;var B=I.match(f[O-1])[0].length;if(!(A&&B>E)&&C(L,F,L+O-1,B))return!0}}};else if(A)var x=function(E,C,L){if(g){var I=b(u,f,C,E,T);if(!I)return!1;if(L(I.startRow,I.startCol,I.endRow,I.endCol))return!0}else{var F=u.getLine(E),R=[],B,N=0;for(f.lastIndex=0;B=f.exec(F);){var H=B[0].length;if(N=B.index,!H){if(N>=F.length)break;f.lastIndex=N+=i.skipEmptyMatch(F,N,w)}if(B.index+H>C)break;R.push(B.index,H)}for(var P=R.length-1;P>=0;P-=2){var j=R[P-1],H=R[P];if(L(E,j,E,j+H))return!0}}};else var x=function(E,C,L){if(f.lastIndex=C,g){var I=v(u,f,E,$);if(I){var F=I.endRow<=$?I.endRow-1:$;F>E&&(E=F)}if(!I)return!1;if(L(I.startRow,I.startCol,I.endRow,I.endCol))return!0}else for(var R=u.getLine(E),B,N;N=f.exec(R);){var H=N[0].length;if(B=N.index,L(E,B,E,B+H))return!0;if(!H&&(f.lastIndex=B+=i.skipEmptyMatch(R,B,w),B>=R.length))return!1}};return{forEach:M}},c})();function l(c,u){var h=i.supportsLookbehind();function f(A,S){S===void 0&&(S=!0);var w=h&&u.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return w.test(A)||u.regExp?h&&u.$supportsUnicodeFlag?S?"(?<=^|[^\\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 s(c,u,h){for(var f=null,g=0;g<=c.length;){u.lastIndex=g;var v=u.exec(c);if(!v)break;var b=v.index+v[0].length;if(b>c.length-h)break;(!f||b>f.index+f[0].length)&&(f=v),g=v.index+1}return f}function a(c,u){var h=5e3,f={row:u,column:0},g=c.doc.positionToIndex(f),v=g+h,b=c.doc.indexToPosition(v),A=b.row;return A+1}n.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,d){var i=this&&this.__extends||(function(){var c=function(u,h){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(u,h)};return function(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");c(u,h);function f(){this.constructor=u}u.prototype=h===null?Object.create(h):(f.prototype=h.prototype,new f)}})(),r=t("../lib/keys"),p=t("../lib/useragent"),o=r.KEY_MODS,l=(function(){function c(u,h){this.$init(u,h,!1)}return c.prototype.$init=function(u,h,f){this.platform=h||(p.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(u),this.$singleCommand=f},c.prototype.addCommand=function(u){this.commands[u.name]&&this.removeCommand(u),this.commands[u.name]=u,u.bindKey&&this._buildKeyHash(u)},c.prototype.removeCommand=function(u,h){var f=u&&(typeof u=="string"?u:u.name);u=this.commands[f],h||delete this.commands[f];var g=this.commandKeyBinding;for(var v in g){var b=g[v];if(b==u)delete g[v];else if(Array.isArray(b)){var A=b.indexOf(u);A!=-1&&(b.splice(A,1),b.length==1&&(g[v]=b[0]))}}},c.prototype.bindKey=function(u,h,f){if(typeof u=="object"&&u&&(f==null&&(f=u.position),u=u[this.platform]),!!u){if(typeof h=="function")return this.addCommand({exec:h,bindKey:u,name:h.name||u});u.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),D=o[y.hashId]+y.key;v+=(v?" ":"")+D,this._addCommandToBinding(v,"chainKeys")},this),v+=" "}var A=this.parseKeys(g),S=o[A.hashId]+A.key;this._addCommandToBinding(v+S,h,f)},this)}},c.prototype._addCommandToBinding=function(u,h,f){var g=this.commandKeyBinding,v;if(!h)delete g[u];else if(!g[u]||this.$singleCommand)g[u]=h;else{Array.isArray(g[u])?(v=g[u].indexOf(h))!=-1&&g[u].splice(v,1):g[u]=[g[u]],typeof f!="number"&&(f=s(h));var b=g[u];for(v=0;v<b.length;v++){var A=b[v],S=s(A);if(S>f)break}b.splice(v,0,h)}},c.prototype.addCommands=function(u){u&&Object.keys(u).forEach(function(h){var f=u[h];if(f){if(typeof f=="string")return this.bindKey(f,h);typeof f=="function"&&(f={exec:f}),typeof f=="object"&&(f.name||(f.name=h),this.addCommand(f))}},this)},c.prototype.removeCommands=function(u){Object.keys(u).forEach(function(h){this.removeCommand(u[h])},this)},c.prototype.bindKeys=function(u){Object.keys(u).forEach(function(h){this.bindKey(h,u[h])},this)},c.prototype._buildKeyHash=function(u){this.bindKey(u.bindKey,u)},c.prototype.parseKeys=function(u){var h=u.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(S){return S}),f=h.pop(),g=r[f];if(r.FUNCTION_KEYS[g])f=r.FUNCTION_KEYS[g].toLowerCase();else if(h.length){if(h.length==1&&h[0]=="shift")return{key:f.toUpperCase(),hashId:-1}}else return{key:f,hashId:-1};for(var v=0,b=h.length;b--;){var A=r.KEY_MODS[h[b]];if(A==null)return typeof console<"u"&&console.error("invalid modifier "+h[b]+" in "+u),!1;v|=A}return{key:f,hashId:v}},c.prototype.findKeyCommand=function(u,h){var f=o[u]+h;return this.commandKeyBinding[f]},c.prototype.handleKeyboard=function(u,h,f,g){if(!(g<0)){var v=o[h]+f,b=this.commandKeyBinding[v];return u.$keyChain&&(u.$keyChain+=" "+v,b=this.commandKeyBinding[u.$keyChain]||b),b&&(b=="chainKeys"||b[b.length-1]=="chainKeys")?(u.$keyChain=u.$keyChain||v,{command:"null"}):(u.$keyChain&&((!h||h==4)&&f.length==1?u.$keyChain=u.$keyChain.slice(0,-v.length-1):(h==-1||g>0)&&(u.$keyChain="")),{command:b})}},c.prototype.getStatusText=function(u,h){return h.$keyChain||""},c})();function s(c){return typeof c=="object"&&c.bindKey&&c.bindKey.position||(c.isDefault?-100:0)}var a=(function(c){i(u,c);function u(h,f){var g=c.call(this,h,f)||this;return g.$singleCommand=!0,g}return u})(l);a.call=function(c,u,h){l.prototype.$init.call(c,u,h,!0)},l.call=function(c,u,h){l.prototype.$init.call(c,u,h,!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,d){var i=this&&this.__extends||(function(){var s=function(a,c){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,h){u.__proto__=h}||function(u,h){for(var f in h)Object.prototype.hasOwnProperty.call(h,f)&&(u[f]=h[f])},s(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");s(a,c);function u(){this.constructor=a}a.prototype=c===null?Object.create(c):(u.prototype=c.prototype,new u)}})(),r=t("../lib/oop"),p=t("../keyboard/hash_handler").MultiHashHandler,o=t("../lib/event_emitter").EventEmitter,l=(function(s){i(a,s);function a(c,u){var h=s.call(this,u,c)||this;return h.byName=h.commands,h.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)}),h}return a.prototype.exec=function(c,u,h){if(Array.isArray(c)){for(var f=c.length;f--;)if(this.exec(c[f],u,h))return!0;return!1}typeof c=="string"&&(c=this.commands[c]);var g={editor:u,command:c,args:h};return this.canExecute(c,u)?(g.returnValue=this._emit("exec",g),this._signal("afterExec",g),g.returnValue!==!1):(this._signal("commandUnavailable",g),!1)},a.prototype.canExecute=function(c,u){return typeof c=="string"&&(c=this.commands[c]),!(!c||u&&u.$readOnly&&!c.readOnly||this.$checkCommandState!=!1&&c.isAvailable&&!c.isAvailable(u))},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(u){this.macro.push([u.command,u.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(u){typeof u=="string"?this.exec(u,c):this.exec(u[0],c,u[1])},this)}finally{this.$inReplay=!1}}},a.prototype.trimMacro=function(c){return c.map(function(u){return typeof u[0]!="string"&&(u[0]=u[0].name),u[1]||(u=u[0]),u})},a})(p);r.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,d){var i=t("../lib/lang"),r=t("../config"),p=t("../range").Range;function o(s,a){return{win:s,mac:a}}n.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:o("Ctrl-,","Command-,"),exec:function(s){r.loadModule("ace/ext/settings_menu",function(a){a.init(s),s.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:o("Alt-E","F4"),exec:function(s){r.loadModule("ace/ext/error_marker",function(a){a.showErrorMarker(s,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(s){r.loadModule("ace/ext/error_marker",function(a){a.showErrorMarker(s,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(s){s.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(s){s.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(s,a){typeof a=="number"&&!isNaN(a)&&s.gotoLine(a),s.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(s){s.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(s){s.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:o("F2","F2"),exec:function(s){s.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:o("Alt-F2","Alt-F2"),exec:function(s){s.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(s){s.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(s){s.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(s){s.session.foldAll(),s.session.unfold(s.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(s){s.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(s){s.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(s){s.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(s){s.selection.isEmpty()?s.selection.selectWord():s.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(s){s.selection.isEmpty()?s.selection.selectWord():s.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(s){r.loadModule("ace/ext/searchbox",function(a){a.Search(s)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(s){s.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(s){s.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(s){s.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(s){s.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(s,a){s.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(s){s.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(s){s.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(s){s.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(s,a){s.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(s){s.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(s){s.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(s){s.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(s){s.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(s){s.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(s,a){s.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(s){s.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(s){s.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(s){s.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(s){s.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(s){s.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(s,a){s.navigateRight(a.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(s){s.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(s){s.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(s){s.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(s){s.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(s){s.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(s){s.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(s){s.renderer.scrollBy(0,-2*s.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(s){s.renderer.scrollBy(0,2*s.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(s){s.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(s){s.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(s){s.commands.toggleRecording(s)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(s){s.commands.replay(s)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(s){s.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(s){s.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(s){s.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(s){},readOnly:!0},{name:"cut",description:"Cut",exec:function(s){var a=s.$copyWithEmptySelection&&s.selection.isEmpty(),c=a?s.selection.getLineRange():s.selection.getRange();s._emit("cut",c),c.isEmpty()||s.session.remove(c),s.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(s,a){s.$handlePaste(a)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(s){s.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(s){s.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(s){s.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(s){s.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(s){s.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(s){s.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(s){s.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(s){r.loadModule("ace/ext/searchbox",function(a){a.Search(s,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(s){s.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(s){s.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(s){s.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(s){s.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(s){s.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(s){s.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(s){s.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(s){s.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(s){if(s.selection.isEmpty())s.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(s){s.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(s){s.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(s){var a=s.selection.getRange();a.start.column=0,s.session.remove(a)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(s){var a=s.selection.getRange();a.end.column=Number.MAX_VALUE,s.session.remove(a)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(s){s.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(s){s.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(s){s.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(s){s.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(s){s.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(s){s.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(s,a){s.insert(a)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(s,a){s.insert(i.stringRepeat(a.text||"",a.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(s){s.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(s){s.transposeLetters()},multiSelectAction:function(s){s.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(s){s.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(s){s.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:o(null,null),exec:function(s){s.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(s){var a=s.selection.getRange();a.start.column=a.end.column=0,a.end.row++,s.selection.setRange(a,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:o("Ctrl+F3","F3"),exec:function(s){s.openLink()}},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(s){for(var a=s.selection.isBackwards(),c=a?s.selection.getSelectionLead():s.selection.getSelectionAnchor(),u=a?s.selection.getSelectionAnchor():s.selection.getSelectionLead(),h=s.session.doc.getLine(c.row).length,f=s.session.doc.getTextRange(s.selection.getRange()),g=f.replace(/\n\s*/," ").length,v=s.session.doc.getLine(c.row),b=c.row+1;b<=u.row+1;b++){var A=i.stringTrimLeft(i.stringTrimRight(s.session.doc.getLine(b)));A.length!==0&&(A=" "+A),v+=A}u.row+1<s.session.doc.getLength()-1&&(v+=s.session.doc.getNewLineCharacter()),s.clearSelection(),s.session.doc.replace(new p(c.row,0,u.row+2,0),v),g>0?(s.selection.moveCursorTo(c.row,c.column),s.selection.selectTo(c.row,c.column+g)):(h=s.session.doc.getLine(c.row).length>h?h+1:h,s.selection.moveCursorTo(c.row,h))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(s){var a=s.session.doc.getLength()-1,c=s.session.doc.getLine(a).length,u=s.selection.rangeList.ranges,h=[];u.length<1&&(u=[s.selection.getRange()]);for(var f=0;f<u.length;f++)f==u.length-1&&(u[f].end.row===a&&u[f].end.column===c||h.push(new p(u[f].end.row,u[f].end.column,a,c))),f===0?u[f].start.row===0&&u[f].start.column===0||h.push(new p(0,0,u[f].start.row,u[f].start.column)):h.push(new p(u[f-1].end.row,u[f-1].end.column,u[f].start.row,u[f].start.column));s.exitMultiSelectMode(),s.clearSelection();for(var f=0;f<h.length;f++)s.selection.addRange(h[f],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(s){s.selection.clearSelection(),s.navigateLineEnd(),s.insert(`
217
+ `)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(s){s.selection.clearSelection();var a=s.getCursorPosition();s.selection.moveTo(a.row-1,Number.MAX_VALUE),s.insert(`
218
+ `),a.row===0&&s.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(s){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),s.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:o("F1","F1"),exec:function(s){s.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:o(null,null),exec:function(s){s.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(s){s.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys"],function(t,n,d){var i=t("../lib/keys"),r=(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 s=this.editor.getCursorPosition().row;this.editor.isRowVisible(s)||this.editor.scrollToLine(s,!0,!0),setTimeout(function(){var a=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),c=this.$findNearestFoldLaneWidget(a),u=this.$findNearestAnnotation(a);if(!(c===null&&u===null)){var h=this.$findClosestNumber(c,u,a);if(h===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=u,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}}}.bind(this),10);return}this.$handleGutterKeyboardInteraction(l),setTimeout(function(){this.editor._signal("gutterkeydown",new p(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 s=this.$rowIndexToRow(this.activeRowIndex),a=this.editor.session.$gutterCustomWidgets[s];if(a)a.callbacks&&a.callbacks.onClick&&a.callbacks.onClick(l,s);else if(this.gutterLayer.session.foldWidgets[s]==="start"){this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),l),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==s&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(s),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 s=this.editor.isRowFullyVisible(this.$rowIndexToRow(l)),a=this.$getFoldWidget(l).style.display!=="none";return s&&a},o.prototype.$isCustomWidgetVisible=function(l){var s=this.editor.isRowFullyVisible(this.$rowIndexToRow(l)),a=!!this.$getCustomWidget(l);return s&&a},o.prototype.$isAnnotationVisible=function(l){var s=this.editor.isRowFullyVisible(this.$rowIndexToRow(l)),a=this.$getAnnotation(l).style.display!=="none";return s&&a},o.prototype.$getFoldWidget=function(l){var s=this.lines.get(l),a=s.element;return a.childNodes[1]},o.prototype.$getCustomWidget=function(l){var s=this.lines.get(l),a=s.element;return a.childNodes[3]},o.prototype.$getAnnotation=function(l){var s=this.lines.get(l),a=s.element;return a.childNodes[2]},o.prototype.$findNearestFoldLaneWidget=function(l){if(this.$isCustomWidgetVisible(l)||this.$isFoldWidgetVisible(l))return l;for(var s=0;l-s>0||l+s<this.lines.getLength()-1;){if(s++,l-s>=0&&this.$isCustomWidgetVisible(l-s))return l-s;if(l+s<=this.lines.getLength()-1&&this.$isCustomWidgetVisible(l+s))return l+s;if(l-s>=0&&this.$isFoldWidgetVisible(l-s))return l-s;if(l+s<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(l+s))return l+s}return null},o.prototype.$findNearestAnnotation=function(l){if(this.$isAnnotationVisible(l))return l;for(var s=0;l-s>0||l+s<this.lines.getLength()-1;){if(s++,l-s>=0&&this.$isAnnotationVisible(l-s))return l-s;if(l+s<=this.lines.getLength()-1&&this.$isAnnotationVisible(l+s))return l+s}return null},o.prototype.$focusFoldWidget=function(l){if(l!=null){var s=this.$getFoldWidget(l);s.classList.add(this.editor.renderer.keyboardFocusClassName),s.focus()}},o.prototype.$focusCustomWidget=function(l){if(l!=null){var s=this.$getCustomWidget(l);s&&(s.classList.add(this.editor.renderer.keyboardFocusClassName),s.focus())}},o.prototype.$focusAnnotation=function(l){if(l!=null){var s=this.$getAnnotation(l);s.classList.add(this.editor.renderer.keyboardFocusClassName),s.focus()}},o.prototype.$blurFoldWidget=function(l){var s=this.$getFoldWidget(l);s.classList.remove(this.editor.renderer.keyboardFocusClassName),s.blur()},o.prototype.$blurCustomWidget=function(l){var s=this.$getCustomWidget(l);s&&(s.classList.remove(this.editor.renderer.keyboardFocusClassName),s.blur())},o.prototype.$blurAnnotation=function(l){var s=this.$getAnnotation(l);s.classList.remove(this.editor.renderer.keyboardFocusClassName),s.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,s,a){return l===null?s:s===null||Math.abs(a-l)<=Math.abs(a-s)?l:s},o.prototype.$switchLane=function(l){switch(l){case"annotation":if(this.activeLane==="annotation")break;var s=this.$findNearestAnnotation(this.activeRowIndex);if(s==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=s,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 s=this.lines.get(l);return s?s.row:null},o.prototype.$rowToRowIndex=function(l){for(var s=0;s<this.lines.getLength();s++){var a=this.lines.get(s);if(a.row==l)return s}return null},o})();n.GutterKeyboardHandler=r;var p=(function(){function o(l,s){this.gutterKeyboardHandler=s,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=p}),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,d){var i=this&&this.__values||function(E){var C=typeof Symbol=="function"&&Symbol.iterator,L=C&&E[C],I=0;if(L)return L.call(E);if(E&&typeof E.length=="number")return{next:function(){return E&&I>=E.length&&(E=void 0),{value:E&&E[I++],done:!E}}};throw new TypeError(C?"Object is not iterable.":"Symbol.iterator is not defined.")},r=t("./lib/oop"),p=t("./lib/dom"),o=t("./lib/lang"),l=t("./lib/useragent"),s=t("./keyboard/textinput").TextInput,a=t("./mouse/mouse_handler").MouseHandler,c=t("./mouse/fold_handler").FoldHandler,u=t("./keyboard/keybinding").KeyBinding,h=t("./edit_session").EditSession,f=t("./search").Search,g=t("./range").Range,v=t("./lib/event_emitter").EventEmitter,b=t("./commands/command_manager").CommandManager,A=t("./commands/default_commands").commands,S=t("./config"),w=t("./token_iterator").TokenIterator,y=t("./keyboard/gutter_handler").GutterKeyboardHandler,D=t("./config").nls,T=t("./clipboard"),$=t("./lib/keys"),M=t("./lib/event"),O=t("./tooltip").HoverTooltip,x=(function(){function E(C,L,I){this.id="editor"+ ++E.$uid,this.session,this.$toDestroy=[];var F=C.getContainerElement();this.container=F,this.renderer=C,this.commands=new b(l.isMac?"mac":"win",A),typeof document=="object"&&(this.textInput=new s(C.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new a(this),new c(this)),this.keyBinding=new u(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 h("")),S.resetOptions(this),I&&this.setOptions(I),S._signal("editor",this)}return E.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},E.prototype.startOperation=function(C){this.session.startOperation(C)},E.prototype.endOperation=function(C){this.session.endOperation(C)},E.prototype.onStartOperation=function(C){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,C||(this.previousCommand=null)},E.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}},E.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())}},E.prototype.setKeyboardHandler=function(C,L){if(C&&typeof C=="string"&&C!="ace"){this.$keybindingId=C;var I=this;S.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()},E.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},E.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()}},E.prototype.getSession=function(){return this.session},E.prototype.setValue=function(C,L){return this.session.doc.setValue(C),L?L==1?this.navigateFileEnd():L==-1&&this.navigateFileStart():this.selectAll(),C},E.prototype.getValue=function(){return this.session.getValue()},E.prototype.getSelection=function(){return this.selection},E.prototype.resize=function(C){this.renderer.onResize(C)},E.prototype.setTheme=function(C,L){this.renderer.setTheme(C,L)},E.prototype.getTheme=function(){return this.renderer.getTheme()},E.prototype.setStyle=function(C,L){this.renderer.setStyle(C,L)},E.prototype.unsetStyle=function(C){this.renderer.unsetStyle(C)},E.prototype.getFontSize=function(){return this.getOption("fontSize")||p.computedStyle(this.container).fontSize},E.prototype.setFontSize=function(C){this.setOption("fontSize",C)},E.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(V){L.removeMarker(V)}),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),H=N.getCurrentToken();if(H&&/\b(?:tag-open|tag-name)/.test(H.type)){var P=L.getMatchingTags(I);P&&(B=[P.openTagName.isEmpty()?P.openTag:P.openTagName,P.closeTagName.isEmpty()?P.closeTag:P.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(V){return L.addMarker(V,j,"text")})},C.getHighlightIndentGuides()&&C.renderer.$textLayer.$highlightIndentGuide()}},50)}},E.prototype.focus=function(){this.textInput.focus()},E.prototype.isFocused=function(){return this.textInput.isFocused()},E.prototype.blur=function(){this.textInput.blur()},E.prototype.onFocus=function(C){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",C))},E.prototype.onBlur=function(C){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",C))},E.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},E.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()},E.prototype.onTokenizerUpdate=function(C){var L=C.data;this.renderer.updateLines(L.first,L.last)},E.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},E.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},E.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},E.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"))},E.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")},E.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}),H=R.substring(I-1,F+1);if(N.test(H))return N}}},E.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},E.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},E.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},E.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},E.prototype.onChangeMode=function(C){this.renderer.updateText(),this._emit("changeMode",C)},E.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},E.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},E.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},E.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},E.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},E.prototype.onCopy=function(){this.commands.exec("copy",this)},E.prototype.onCut=function(){this.commands.exec("cut",this)},E.prototype.onPaste=function(C,L){var I={text:C,event:L};this.commands.exec("paste",this,I)},E.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 H=B.length;H--;){var P=B[H];P.isEmpty()||F.remove(P),F.insert(P.start,R[H])}}},E.prototype.execCommand=function(C,L){return this.commands.exec(C,this,L)},E.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 V=I.getLine(R.row);if(R.column>V.search(/\S|$/)){var H=V.substr(R.column).search(/\S|$/);I.doc.removeInLine(R.row,R.column,R.column+H)}}this.clearSelection();var P=R.column,j=I.getState(R.row),V=I.getLine(R.row),K=F.checkOutdent(j,V,C);if(I.insert(R,C),B&&B.selection&&(B.selection.length==2?this.selection.setSelectionRange(new g(R.row,P+B.selection[0],R.row,P+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,V.slice(0,R.column),I.getTabString());I.insert({row:R.row+1,column:0},J)}K&&F.autoOutdent(j,I,R.row)}},E.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(),H=0;H<I.length;H++)for(var P=I[H].start.row,j=I[H].end.row,V=P;V<=j;V++){V>0&&(F=C.getState(V-1),R=C.getLine(V-1),B=L.getNextLineIndent(F,R,N));var K=C.getLine(V),J=L.$getIndent(K);if(B!==J){if(J.length>0){var Y=new g(V,0,V,J.length);C.remove(Y)}B.length>0&&C.insert({row:V,column:0},B)}L.autoOutdent(F,C,V)}},E.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()},E.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)}},E.prototype.onCommandKey=function(C,L,I){return this.keyBinding.onCommandKey(C,L,I)},E.prototype.setOverwrite=function(C){this.session.setOverwrite(C)},E.prototype.getOverwrite=function(){return this.session.getOverwrite()},E.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},E.prototype.setScrollSpeed=function(C){this.setOption("scrollSpeed",C)},E.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},E.prototype.setDragDelay=function(C){this.setOption("dragDelay",C)},E.prototype.getDragDelay=function(){return this.getOption("dragDelay")},E.prototype.setSelectionStyle=function(C){this.setOption("selectionStyle",C)},E.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},E.prototype.setHighlightActiveLine=function(C){this.setOption("highlightActiveLine",C)},E.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},E.prototype.setHighlightGutterLine=function(C){this.setOption("highlightGutterLine",C)},E.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},E.prototype.setHighlightSelectedWord=function(C){this.setOption("highlightSelectedWord",C)},E.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},E.prototype.setAnimatedScroll=function(C){this.renderer.setAnimatedScroll(C)},E.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},E.prototype.setShowInvisibles=function(C){this.renderer.setShowInvisibles(C)},E.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},E.prototype.setDisplayIndentGuides=function(C){this.renderer.setDisplayIndentGuides(C)},E.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},E.prototype.setHighlightIndentGuides=function(C){this.renderer.setHighlightIndentGuides(C)},E.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},E.prototype.setShowPrintMargin=function(C){this.renderer.setShowPrintMargin(C)},E.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},E.prototype.setPrintMarginColumn=function(C){this.renderer.setPrintMarginColumn(C)},E.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},E.prototype.setReadOnly=function(C){this.setOption("readOnly",C)},E.prototype.getReadOnly=function(){return this.getOption("readOnly")},E.prototype.setBehavioursEnabled=function(C){this.setOption("behavioursEnabled",C)},E.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},E.prototype.setWrapBehavioursEnabled=function(C){this.setOption("wrapBehavioursEnabled",C)},E.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},E.prototype.setShowFoldWidgets=function(C){this.setOption("showFoldWidgets",C)},E.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},E.prototype.setFadeFoldWidgets=function(C){this.setOption("fadeFoldWidgets",C)},E.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},E.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()},E.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},E.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},E.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},E.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()},E.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var C=this.getCursorPosition();this.insert(`
223
+ `),this.moveCursorToPosition(C)},E.prototype.setGhostText=function(C,L){this.renderer.setGhostText(C,L)},E.prototype.removeGhostText=function(){this.renderer.removeGhostText()},E.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)}}},E.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)},E.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)},E.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(),H=C.documentToScreenColumn(B.row,B.column);if(this.session.getUseSoftTabs())var P=N-H%N,j=o.stringRepeat(" ",P);else{for(var P=H%N;R[L.start.column-1]==" "&&P;)L.start.column--,P--;this.selection.setSelectionRange(L),j=" "}return this.insert(j)},E.prototype.blockIndent=function(){var C=this.$getSelectedRows();this.session.indentRows(C.first,C.last," ")},E.prototype.blockOutdent=function(){var C=this.session.getSelection();this.session.outdentRows(C.getRange())},E.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,H){return N.toLowerCase()<H.toLowerCase()?-1:N.toLowerCase()>H.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])}},E.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)},E.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)},E.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},E.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,H=B.start+B.value.length-N,P=parseFloat(B.value);P*=Math.pow(10,H),N!==B.end&&I<N?C*=Math.pow(10,B.end-I-1):C*=Math.pow(10,B.end-I),P+=C,P/=Math.pow(10,H);var j=P.toFixed(H),V=new g(L,B.start,L,B.end);this.session.replace(V,j),this.moveCursorTo(L,Math.max(B.start+1,I+j.length-B.value.length))}}else this.toggleWord()},E.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,H=0,P=this;I.match(/[A-Za-z0-9_]+/)&&R.forEach(function(ue,Ce){H=N+ue.length,B>=N&&B<=H&&(I=ue,P.selection.clearSelection(),P.moveCursorTo(C,N+F),P.selection.selectTo(C,H+F)),N=H});for(var j=this.$toggleWordPairs,V,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&&(V=I.replace(new RegExp(o.escapeRegExp(J[Y]),"i"),function(ue){var Ce=J[X];return ue.toUpperCase()==ue?Ce=Ce.toUpperCase():ue.charAt(0).toUpperCase()==ue.charAt(0)&&(Ce=Ce.substr(0,0)+J[X].charAt(0).toUpperCase()+Ce.substr(1)),Ce}),this.insert(V),V="")}}},E.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 H=0,P=0,j;try{for(var V=i(B),K=V.next();!K.done;K=V.next()){var J=K.value;if(P=H+J.length,N>=H&&N<=P&&J.match(/((?:https?|ftp):\/\/[\S]+)/)){j=J.replace(/[\s:.,'";}\]]+$/,"");break}H=P}}catch(Y){I={error:Y}}finally{try{K&&!K.done&&(F=V.return)&&F.call(V)}finally{if(I)throw I.error}}return j},E.prototype.openLink=function(){var C=this.selection.getCursor(),L=this.findLinkAt(C.row,C.column);return L&&window.open(L,"_blank"),L!=null},E.prototype.removeLines=function(){var C=this.$getSelectedRows();this.session.removeFullLines(C.first,C.last),this.clearSelection()},E.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)}},E.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},E.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},E.prototype.moveText=function(C,L,I){return this.session.moveText(C,L,I)},E.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},E.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},E.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 H=0,P=0,j=N.length,V=0;V<j;V++){var K=V;N[V].moveBy(H,0),I=this.$getSelectedRows(N[V]);for(var J=I.first,Y=I.last;++V<j;){P&&N[V].moveBy(P,0);var X=this.$getSelectedRows(N[V]);if(L&&X.first!=Y)break;if(!L&&X.first>Y+1)break;Y=X.last}for(V--,H=this.session.$moveLines(J,Y,L?0:C),L&&C==-1&&(K=V+1);K<=V;)N[K].moveBy(H,0),K++;L||(H=0),P+=H}R.fromOrientedRange(R.ranges[0]),R.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},E.prototype.$getSelectedRows=function(C){return C=(C||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(C.start.row),last:this.session.getRowFoldEnd(C.end.row)}},E.prototype.onCompositionStart=function(C){this.renderer.showComposition(C)},E.prototype.onCompositionUpdate=function(C){this.renderer.setCompositionText(C)},E.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},E.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},E.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},E.prototype.isRowVisible=function(C){return C>=this.getFirstVisibleRow()&&C<=this.getLastVisibleRow()},E.prototype.isRowFullyVisible=function(C){return C>=this.renderer.getFirstFullyVisibleRow()&&C<=this.renderer.getLastFullyVisibleRow()},E.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},E.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)},E.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},E.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},E.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},E.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},E.prototype.scrollPageDown=function(){this.$moveByPage(1)},E.prototype.scrollPageUp=function(){this.$moveByPage(-1)},E.prototype.scrollToRow=function(C){this.renderer.scrollToRow(C)},E.prototype.scrollToLine=function(C,L,I,F){this.renderer.scrollToLine(C,L,I,F)},E.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)},E.prototype.getCursorPosition=function(){return this.selection.getCursor()},E.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},E.prototype.getSelectionRange=function(){return this.selection.getRange()},E.prototype.selectAll=function(){this.selection.selectAll()},E.prototype.clearSelection=function(){this.selection.clearSelection()},E.prototype.moveCursorTo=function(C,L){this.selection.moveCursorTo(C,L)},E.prototype.moveCursorToPosition=function(C){this.selection.moveCursorToPosition(C)},E.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 H,P=!1,j={},V=I.column-N.start,K,J={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(N.value.match(/[{}()\[\]]/g)){for(;V<N.value.length&&!P;V++)if(J[N.value[V]])switch(K=J[N.value[V]]+"."+N.type.replace("rparen","lparen"),isNaN(j[K])&&(j[K]=0),N.value[V]){case"(":case"[":case"{":j[K]++;break;case")":case"]":case"}":j[K]--,j[K]===-1&&(H="bracket",P=!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&&(H="tag",P=!0));P||(R=N,B++,N=F.stepForward(),V=0)}while(N&&!P);if(H){var Y,X;if(H==="bracket")Y=this.session.getBracketRange(I),Y||(Y=new g(F.getCurrentTokenRow(),F.getCurrentTokenColumn()+V-1,F.getCurrentTokenRow(),F.getCurrentTokenColumn()+V-1),X=Y.start,(L||X.row===I.row&&Math.abs(X.column-I.column)<2)&&(Y=this.session.getBracketRange(X)));else if(H==="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))}}},E.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)},E.prototype.navigateTo=function(C,L){this.selection.moveTo(C,L)},E.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)},E.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)},E.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()},E.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()},E.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},E.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},E.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},E.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},E.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},E.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},E.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},E.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},E.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},E.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},E.prototype.find=function(C,L,I){L||(L={}),typeof C=="string"||C instanceof RegExp?L.needle=C:typeof C=="object"&&r.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)},E.prototype.findNext=function(C,L){this.find({skipCurrent:!0,backwards:!1},C,L)},E.prototype.findPrevious=function(C,L){this.find(C,{skipCurrent:!0,backwards:!0},L)},E.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)},E.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},E.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},E.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()},E.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())}),H=this.renderer.on("afterRender",function(){if(F&&L&&(I.isFocused()||I.searchBox&&I.searchBox.isFocused())){var P=I.renderer,j=P.$cursorLayer.$pixelPos,V=P.layerConfig,K=j.top-V.offset;j.top>=0&&K+L.top<0?F=!0:j.top<V.height&&j.top+L.top+V.lineHeight>window.innerHeight?F=!1:F=null,F!=null&&(R.style.top=K+"px",R.style.left=j.left+"px",R.style.height=V.lineHeight+"px",R.scrollIntoView(F)),F=L=null}});this.setAutoScrollEditorIntoView=function(P){P||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",B),this.renderer.off("afterRender",H),this.renderer.off("beforeRender",N))}}},E.prototype.$resetCursorStyle=function(){var C=this.$cursorStyle||"ace",L=this.renderer.$cursorLayer;L&&(L.setSmoothBlinking(/smooth/.test(C)),L.isBlinking=!this.$readOnly&&C!="wide",p.setCssClass(L.element,"ace_slim-cursors",/slim/.test(C)))},E.prototype.prompt=function(C,L,I){var F=this;S.loadModule("ace/ext/prompt",function(R){R.prompt(F,C,L,I)})},E})();x.$uid=0,x.prototype.curOp=null,x.prototype.prevOp={},x.prototype.$mergeableCommands=["backspace","del","insertstring"],x.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"],["&&","||"],["==","!="]],r.implement(x.prototype,v),S.defineOptions(x.prototype,"editor",{selectionStyle:{set:function(E){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:E})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(E){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(E){var C=this;if(this.textInput.setReadOnly(E),!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=p.createElement("div");R.textContent=D("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();E?(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(E){this.textInput.setCopyWithEmptySelection(E)},initialValue:!1},cursorStyle:{set:function(E){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(E){this.setAutoScrollEditorIntoView(E)}},keyboardHandler:{set:function(E){this.setKeyboardHandler(E)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(E){this.session.setValue(E)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(E){this.setSession(E)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(E){this.renderer.$gutterLayer.setShowLineNumbers(E),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),E&&this.$relativeLineNumbers?k.attach(this):k.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(E){this.$showLineNumbers&&E?k.attach(this):k.detach(this)}},placeholder:{set:function(E){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),p.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),p.addCssClass(this.container,"ace_hasPlaceholder");var L=p.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(E){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===$.enter){F.preventDefault();var R=this.getCursorPosition().row;this.isRowVisible(R)||this.scrollToLine(R,!0,!0),this.focus()}},I;E?(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",D("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",D("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",D("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",D("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(E){this.$textInputAriaLabel=E},initialValue:""},enableMobileMenu:{set:function(E){this.$enableMobileMenu=E},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(E,C){return(Math.abs(E.selection.lead.row-C)||C+1+(C<9?"·":""))+""},getWidth:function(E,C,L){return Math.max(C.toString().length,(L.lastRow+1).toString().length,2)*L.characterWidth},update:function(E,C){C.renderer.$loop.schedule(C.renderer.CHANGE_GUTTER)},attach:function(E){E.renderer.$gutterLayer.$renderer=this,E.on("changeSelection",this.update),this.update(null,E)},detach:function(E){E.renderer.$gutterLayer.$renderer==this&&(E.renderer.$gutterLayer.$renderer=null),E.off("changeSelection",this.update),this.update(null,E)}};n.Editor=x}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(t,n,d){var i=t("../lib/dom"),r=(function(){function p(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 p.prototype.moveContainer=function(o){i.translate(this.element,0,-(o.firstRowScreen*o.lineHeight%this.canvasHeight)-o.offset*this.$offsetCoefficient)},p.prototype.pageChanged=function(o,l){return Math.floor(o.firstRowScreen*o.lineHeight/this.canvasHeight)!==Math.floor(l.firstRowScreen*l.lineHeight/this.canvasHeight)},p.prototype.computeLineTop=function(o,l,s){var a=l.firstRowScreen*l.lineHeight,c=Math.floor(a/this.canvasHeight),u=s.documentToScreenRow(o,0)*l.lineHeight;return u-c*this.canvasHeight},p.prototype.computeLineHeight=function(o,l,s){return l.lineHeight*s.getRowLineCount(o)},p.prototype.getLength=function(){return this.cells.length},p.prototype.get=function(o){return this.cells[o]},p.prototype.shift=function(){this.$cacheCell(this.cells.shift())},p.prototype.pop=function(){this.$cacheCell(this.cells.pop())},p.prototype.push=function(o){if(Array.isArray(o)){this.cells.push.apply(this.cells,o);for(var l=i.createFragment(this.element),s=0;s<o.length;s++)l.appendChild(o[s].element);this.element.appendChild(l)}else this.cells.push(o),this.element.appendChild(o.element)},p.prototype.unshift=function(o){if(Array.isArray(o)){this.cells.unshift.apply(this.cells,o);for(var l=i.createFragment(this.element),s=0;s<o.length;s++)l.appendChild(o[s].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)},p.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},p.prototype.$cacheCell=function(o){o&&(o.element.remove(),this.cellCache.push(o))},p.prototype.createCell=function(o,l,s,a){var c=this.cellCache.pop();if(!c){var u=i.createElement("div");a&&a(u),this.element.appendChild(u),c={element:u,text:"",row:o}}return c.row=o,c},p})();n.Lines=r}),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,d){var i=t("../lib/dom"),r=t("../lib/oop"),p=t("../lib/lang"),o=t("../lib/event_emitter").EventEmitter,l=t("./lines").Lines,s=t("../config").nls,a=(function(){function u(h){this.$showCursorMarker=null,this.element=i.createElement("div"),this.element.className="ace_layer ace_gutter-layer",h.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 u.prototype.setSession=function(h){this.session&&this.session.off("change",this.$updateAnnotations),this.session=h,h&&h.on("change",this.$updateAnnotations)},u.prototype.addGutterDecoration=function(h,f){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(h,f)},u.prototype.removeGutterDecoration=function(h,f){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(h,f)},u.prototype.setAnnotations=function(h){this.$annotations=[];for(var f=0;f<h.length;f++){var g=h[f],v=g.row,b=this.$annotations[v];b||(b=this.$annotations[v]={text:[],type:[],displayText:[]});var A=g.text,S=g.text,w=g.type;A=A?p.escapeHTML(A):g.html||"",S=S||g.html||"",b.text.indexOf(A)===-1&&(b.text.push(A),b.type.push(w),b.displayText.push(S));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")}},u.prototype.$updateAnnotations=function(h){if(this.$annotations.length){var f=h.start.row,g=h.end.row-f;if(g!==0)if(h.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)}}},u.prototype.update=function(h){this.config=h;var f=this.session,g=h.firstRow,v=Math.min(h.lastRow+h.gutterOffset,f.getLength()-1);this.oldLastRow=v,this.config=h,this.$lines.moveContainer(h),this.$updateCursorRow();for(var b=f.getNextFoldLine(g),A=b?b.start.row:1/0,S=null,w=-1,y=g;;){if(y>A&&(y=b.end.row+1,b=f.getNextFoldLine(y,b),A=b?b.start.row:1/0),y>v){for(;this.$lines.getLength()>w+1;)this.$lines.pop();break}S=this.$lines.get(++w),S?S.row=y:(S=this.$lines.createCell(y,h,this.session,c),this.$lines.push(S)),this.$renderCell(S,h,b,y),y++}this._signal("afterRender"),this.$updateGutterWidth(h),this.$showCursorMarker&&this.$highlightGutterLine&&this.$updateCursorMarker()},u.prototype.$updateGutterWidth=function(h){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 A=g?g.getWidth(f,b,h):b.toString().length*h.characterWidth,S=this.$padding||this.$computePadding();A+=S.left+S.right,A!==this.gutterWidth&&!isNaN(A)&&(this.gutterWidth=A,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",A))},u.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var h=this.session.selection.getCursor();this.$cursorRow!==h.row&&(this.$cursorRow=h.row)}},u.prototype.updateLineHighlight=function(){if(this.$showCursorMarker&&this.$updateCursorMarker(),!!this.$highlightGutterLine){var h=this.session.selection.cursor.row;if(this.$cursorRow=h,!(this.$cursorCell&&this.$cursorCell.row==h)){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}}}}},u.prototype.$updateCursorMarker=function(){if(this.session){var h=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=h.selection.cursor,g=this.config,v=this.$lines,b=g.firstRowScreen*g.lineHeight,A=Math.floor(b/v.canvasHeight),S=h.documentToScreenRow(f)*g.lineHeight,w=S-A*v.canvasHeight;i.setStyle(this.$highlightElement.style,"height",g.lineHeight+"px"),i.setStyle(this.$highlightElement.style,"top",w+"px")}},u.prototype.scrollLines=function(h){var f=this.config;if(this.config=h,this.$updateCursorRow(),this.$lines.pageChanged(f,h))return this.update(h);this.$lines.moveContainer(h);var g=Math.min(h.lastRow+h.gutterOffset,this.session.getLength()-1),v=this.oldLastRow;if(this.oldLastRow=g,!f||v<h.firstRow)return this.update(h);if(g<f.firstRow)return this.update(h);if(f.firstRow<h.firstRow)for(var b=this.session.getFoldedRowCount(f.firstRow,h.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();h.firstRow<f.firstRow&&this.$lines.unshift(this.$renderLines(h,h.firstRow,f.firstRow-1)),g>v&&this.$lines.push(this.$renderLines(h,v+1,g)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(h)},u.prototype.$renderLines=function(h,f,g){for(var v=[],b=f,A=this.session.getNextFoldLine(b),S=A?A.start.row:1/0;b>S&&(b=A.end.row+1,A=this.session.getNextFoldLine(b,A),S=A?A.start.row:1/0),!(b>g);){var w=this.$lines.createCell(b,h,this.session,c);this.$renderCell(w,h,A,b),v.push(w),b++}return v},u.prototype.$renderCell=function(h,f,g,v){var b=h.element,A=this.session,S=b.childNodes[0],w=b.childNodes[1],y=b.childNodes[2],D=b.childNodes[3],T=y.firstChild,$=A.$firstLineNumber,M=A.$breakpoints,O=A.$decorations,x=A.gutterRenderer||this.$renderer,k=this.$showFoldWidgets&&A.foldWidgets,E=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=(x?x.getText(A,v):v+$).toString();if(this.$highlightGutterLine&&(v==this.$cursorRow||g&&v<this.$cursorRow&&v>=E&&this.$cursorRow<=g.end.row)&&(L+="ace_gutter-active-line ",this.$cursorCell!=h&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=h)),M[v]&&(L+=M[v]),O[v]&&(L+=O[v]),this.$annotations[v]&&v!==E&&(L+=this.$annotations[v].className),k){var R=k[v];R==null&&(R=k[v]=A.getFoldWidget(v))}if(R){var B="ace_fold-widget ace_"+R,N=R=="start"&&v==E&&v<g.end.row;if(N){B+=" ace_closed";for(var H="",P=!1,j=v+1;j<=g.end.row;j++)if(this.$annotations[j]){if(this.$annotations[j].className===" ace_error"){P=!0,H=" ace_error_fold";break}this.$annotations[j].className===" ace_security"?(P=!0,H=" ace_security_fold"):this.$annotations[j].className===" ace_warning"&&H!==" ace_security_fold"&&(P=!0,H=" ace_warning_fold")}L+=H}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 V=A.getFoldWidgetRange(v);V?w.setAttribute("aria-label",s("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[V.start.row+1,V.end.row+1])):g?w.setAttribute("aria-label",s("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",s("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[v+1])),N?(w.setAttribute("aria-expanded","false"),w.setAttribute("title",s("gutter.code-folding.closed.title","Unfold code"))):(w.setAttribute("aria-expanded","true"),w.setAttribute("title",s("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,h):D&&this.$removeCustomWidget(v,h),P&&this.$showFoldedAnnotations){y.className="ace_gutter_annotation",T.className=I,T.className+=H,i.setStyle(T.style,"height",C),i.setStyle(y.style,"display","block"),i.setStyle(y.style,"height",C);var J;switch(H){case" ace_error_fold":J=s("gutter.annotation.aria-label.error","Error, read annotations row $0",[F]);break;case" ace_security_fold":J=s("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[F]);break;case" ace_warning_fold":J=s("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=s("gutter.annotation.aria-label.error","Error, read annotations row $0",[F]);break;case" ace_security":J=s("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[F]);break;case" ace_warning":J=s("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[F]);break;case" ace_info":J=s("gutter.annotation.aria-label.info","Info, read annotations row $0",[F]);break;case" ace_hint":J=s("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!==S.data&&(S.data=F),b.className!=L&&(b.className=L),i.setStyle(h.element.style,"height",this.$lines.computeLineHeight(v,f,A)+"px"),i.setStyle(h.element.style,"top",this.$lines.computeLineTop(v,f,A)+"px"),h.text=F,y.style.display==="none"&&w.style.display==="none"&&!K?h.element.setAttribute("aria-hidden",!0):h.element.setAttribute("aria-hidden",!1),h},u.prototype.setHighlightGutterLine=function(h){this.$highlightGutterLine=h,!h&&this.$highlightElement&&(this.$highlightElement.remove(),this.$highlightElement=null)},u.prototype.setShowLineNumbers=function(h){this.$renderer=!h&&{getWidth:function(){return 0},getText:function(){return""}}},u.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},u.prototype.setShowFoldWidgets=function(h){h?i.addCssClass(this.element,"ace_folding-enabled"):i.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=h,this.$padding=null},u.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},u.prototype.$hideFoldWidget=function(h,f){var g=f||this.$getGutterCell(h);if(g&&g.element){var v=g.element.childNodes[1];v&&i.setStyle(v.style,"display","none")}},u.prototype.$showFoldWidget=function(h,f){var g=f||this.$getGutterCell(h);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")}},u.prototype.$getGutterCell=function(h){var f=this.$lines.cells,g=0,v=f.length-1;if(!(h<f[0].row||h>f[v].row)){for(;g<=v;){var b=Math.floor((g+v)/2),A=f[b];if(A.row>h)v=b-1;else if(A.row<h)g=b+1;else return A}return A}},u.prototype.$addCustomWidget=function(h,f,g){var v=f.className,b=f.label,A=f.title,S=f.callbacks;this.session.$gutterCustomWidgets[h]={className:v,label:b,title:A,callbacks:S},this.$hideFoldWidget(h,g);var w=g||this.$getGutterCell(h);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",A),i.setStyle(y.style,"display","inline-block"),i.setStyle(y.style,"height","inherit"),S&&S.onClick&&y.addEventListener("click",function(D){S.onClick(D,h),D.stopPropagation()}),w.element.appendChild(y)}},u.prototype.$removeCustomWidget=function(h,f){delete this.session.$gutterCustomWidgets[h],this.$showFoldWidget(h,f);var g=f||this.$getGutterCell(h);if(g&&g.element){var v=g.element.querySelector(".ace_custom-widget");v&&g.element.removeChild(v)}},u.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var h=i.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(h.borderLeftWidth)||0)+(parseInt(h.paddingLeft)||0)+1,this.$padding.right=(parseInt(h.borderRightWidth)||0)+(parseInt(h.paddingRight)||0),this.$padding},u.prototype.getRegion=function(h){var f=this.$padding||this.$computePadding(),g=this.element.getBoundingClientRect();if(h.x<f.left+g.left)return"markers";if(this.$showFoldWidgets&&h.x>g.right-f.right)return"foldWidgets"},u})();a.prototype.$fixedWidth=!1,a.prototype.$highlightGutterLine=!0,a.prototype.$renderer=void 0,a.prototype.$showLineNumbers=!0,a.prototype.$showFoldWidgets=!0,r.implement(a.prototype,o);function c(u){var h=document.createTextNode("");u.appendChild(h);var f=i.createElement("span");u.appendChild(f);var g=i.createElement("span");u.appendChild(g);var v=i.createElement("span");return g.appendChild(v),u}n.Gutter=a}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,n,d){var i=t("../range").Range,r=t("../lib/dom"),p=(function(){function l(s){this.element=r.createElement("div"),this.element.className="ace_layer ace_marker-layer",s.appendChild(this.element)}return l.prototype.setPadding=function(s){this.$padding=s},l.prototype.setSession=function(s){this.session=s},l.prototype.setMarkers=function(s){this.markers=s},l.prototype.elt=function(s,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=s},l.prototype.update=function(s){if(s){this.config=s,this.i=0;var a;for(var c in this.markers){var u=this.markers[c];if(!u.range){u.update(a,this,this.session,s);continue}var h=u.range.clipRows(s.firstRow,s.lastRow);if(!h.isEmpty())if(h=h.toScreenRange(this.session),u.renderer){var f=this.$getTop(h.start.row,s),g=this.$padding+h.start.column*s.characterWidth;u.renderer(a,h,g,f,s)}else u.type=="fullLine"?this.drawFullLineMarker(a,h,u.clazz,s):u.type=="screenLine"?this.drawScreenLineMarker(a,h,u.clazz,s):h.isMultiLine()?u.type=="text"?this.drawTextMarker(a,h,u.clazz,s):this.drawMultiLineMarker(a,h,u.clazz,s):this.drawSingleLineMarker(a,h,u.clazz+" ace_start ace_br15",s)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},l.prototype.$getTop=function(s,a){return(s-a.firstRowScreen)*a.lineHeight},l.prototype.drawTextMarker=function(s,a,c,u,h){for(var f=this.session,g=a.start.row,v=a.end.row,b=g,A=0,S=0,w=f.getScreenLastRowColumn(b),y=new i(b,a.start.column,b,S);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,A=S,S=w,w=b+1<v?f.getScreenLastRowColumn(b+1):b==v?0:a.end.column,this.drawSingleLineMarker(s,y,c+(b==g?" ace_start":"")+" ace_br"+o(b==g||b==g+1&&a.start.column,A<S,S>w,b==v),u,b==v?0:1,h)},l.prototype.drawMultiLineMarker=function(s,a,c,u,h){var f=this.$padding,g=u.lineHeight,v=this.$getTop(a.start.row,u),b=f+a.start.column*u.characterWidth;if(h=h||"",this.session.$bidiHandler.isBidiRow(a.start.row)){var A=a.clone();A.end.row=A.start.row,A.end.column=this.session.getLine(A.start.row).length,this.drawBidiSingleLineMarker(s,A,c+" ace_br1 ace_start",u,null,h)}else this.elt(c+" ace_br1 ace_start","height:"+g+"px;right:"+f+"px;top:"+v+"px;left:"+b+"px;"+(h||""));if(this.session.$bidiHandler.isBidiRow(a.end.row)){var A=a.clone();A.start.row=A.end.row,A.start.column=0,this.drawBidiSingleLineMarker(s,A,c+" ace_br12",u,null,h)}else{v=this.$getTop(a.end.row,u);var S=a.end.column*u.characterWidth;this.elt(c+" ace_br12","height:"+g+"px;width:"+S+"px;top:"+v+"px;left:"+f+"px;"+(h||""))}if(g=(a.end.row-a.start.row-1)*u.lineHeight,!(g<=0)){v=this.$getTop(a.start.row+1,u);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;"+(h||""))}},l.prototype.drawSingleLineMarker=function(s,a,c,u,h,f){if(this.session.$bidiHandler.isBidiRow(a.start.row))return this.drawBidiSingleLineMarker(s,a,c,u,h,f);var g=u.lineHeight,v=(a.end.column+(h||0)-a.start.column)*u.characterWidth,b=this.$getTop(a.start.row,u),A=this.$padding+a.start.column*u.characterWidth;this.elt(c,"height:"+g+"px;width:"+v+"px;top:"+b+"px;left:"+A+"px;"+(f||""))},l.prototype.drawBidiSingleLineMarker=function(s,a,c,u,h,f){var g=u.lineHeight,v=this.$getTop(a.start.row,u),b=this.$padding,A=this.session.$bidiHandler.getSelections(a.start.column,a.end.column);A.forEach(function(S){this.elt(c,"height:"+g+"px;width:"+(S.width+(h||0))+"px;top:"+v+"px;left:"+(b+S.left)+"px;"+(f||""))},this)},l.prototype.drawFullLineMarker=function(s,a,c,u,h){var f=this.$getTop(a.start.row,u),g=u.lineHeight;a.start.row!=a.end.row&&(g+=this.$getTop(a.end.row,u)-f),this.elt(c,"height:"+g+"px;top:"+f+"px;left:0;right:0;"+(h||""))},l.prototype.drawScreenLineMarker=function(s,a,c,u,h){var f=this.$getTop(a.start.row,u),g=u.lineHeight;this.elt(c,"height:"+g+"px;top:"+f+"px;left:0;right:0;"+(h||""))},l})();p.prototype.$padding=0;function o(l,s,a,c){return(l?1:0)|(s?2:0)|(a?4:0)|(c?8:0)}n.Marker=p}),ace.define("ace/layer/text_util",["require","exports","module"],function(t,n,d){var i=new Set(["text","rparen","lparen"]);n.isTextToken=function(r){return i.has(r)}}),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,d){var i=t("../lib/oop"),r=t("../lib/dom"),p=t("../lib/lang"),o=t("./lines").Lines,l=t("../lib/event_emitter").EventEmitter,s=t("../config").nls,a=t("./text_util").isTextToken,c=(function(){function u(h){this.dom=r,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",h.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)}return u.prototype.$updateEolChar=function(){var h=this.session.doc,f=h.getNewLineCharacter()==`
224
+ `&&h.getNewLineMode()!="windows",g=f?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=g)return this.EOL_CHAR=g,!0},u.prototype.setPadding=function(h){this.$padding=h,this.element.style.margin="0 "+h+"px"},u.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},u.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},u.prototype.$setFontMetrics=function(h){this.$fontMetrics=h,this.$fontMetrics.on("changeCharacterSize",function(f){this._signal("changeCharacterSize",f)}.bind(this)),this.$pollSizeChanges()},u.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},u.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},u.prototype.setSession=function(h){this.session=h,h&&this.$computeTabString()},u.prototype.setShowInvisibles=function(h){return this.showInvisibles==h?!1:(this.showInvisibles=h,typeof h=="string"?(this.showSpaces=/tab/i.test(h),this.showTabs=/space/i.test(h),this.showEOL=/eol/i.test(h)):this.showSpaces=this.showTabs=this.showEOL=h,this.$computeTabString(),!0)},u.prototype.setDisplayIndentGuides=function(h){return this.displayIndentGuides==h?!1:(this.displayIndentGuides=h,this.$computeTabString(),!0)},u.prototype.setHighlightIndentGuides=function(h){return this.$highlightIndentGuides===h?!1:(this.$highlightIndentGuides=h,h)},u.prototype.$computeTabString=function(){var h=this.session.getTabSize();this.tabSize=h;for(var f=this.$tabStrings=[0],g=1;g<h+1;g++)if(this.showTabs){var v=this.dom.createElement("span");v.className="ace_invisible ace_invisible_tab",v.textContent=p.stringRepeat(this.TAB_CHAR,g),f.push(v)}else f.push(this.dom.createTextNode(p.stringRepeat(" ",g),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var b="ace_indent-guide",A=this.showSpaces?" ace_invisible ace_invisible_space":"",S=this.showSpaces?p.stringRepeat(this.SPACE_CHAR,this.tabSize):p.stringRepeat(" ",this.tabSize),w=this.showTabs?" ace_invisible ace_invisible_tab":"",y=this.showTabs?p.stringRepeat(this.TAB_CHAR,this.tabSize):S,v=this.dom.createElement("span");v.className=b+A,v.textContent=S,this.$tabStrings[" "]=v;var v=this.dom.createElement("span");v.className=b+w,v.textContent=y,this.$tabStrings[" "]=v}},u.prototype.updateLines=function(h,f,g){if(this.config.lastRow!=h.lastRow||this.config.firstRow!=h.firstRow)return this.update(h);this.config=h;for(var v=Math.max(f,h.firstRow),b=Math.min(g,h.lastRow),A=this.element.childNodes,S=0,y=h.firstRow;y<v;y++){var D=this.session.getFoldLine(y);if(D)if(D.containsRow(v)){v=D.start.row;break}else y=D.end.row;S++}for(var w=!1,y=v,D=this.session.getNextFoldLine(y),T=D?D.start.row:1/0;y>T&&(y=D.end.row+1,D=this.session.getNextFoldLine(y,D),T=D?D.start.row:1/0),!(y>b);){var $=A[S++];if($){this.dom.removeChildren($),this.$renderLine($,y,y==T?D:!1),w&&($.style.top=this.$lines.computeLineTop(y,h,this.session)+"px");var M=h.lineHeight*this.session.getRowLength(y)+"px";$.style.height!=M&&(w=!0,$.style.height=M)}y++}if(w)for(;S<this.$lines.cells.length;){var O=this.$lines.cells[S++];O.element.style.top=this.$lines.computeLineTop(O.row,h,this.session)+"px"}},u.prototype.scrollLines=function(h){var f=this.config;if(this.config=h,this.$lines.pageChanged(f,h))return this.update(h);this.$lines.moveContainer(h);var g=h.lastRow,v=f?f.lastRow:-1;if(!f||v<h.firstRow)return this.update(h);if(g<f.firstRow)return this.update(h);if(!f||f.lastRow<h.firstRow)return this.update(h);if(h.lastRow<f.firstRow)return this.update(h);if(f.firstRow<h.firstRow)for(var b=this.session.getFoldedRowCount(f.firstRow,h.firstRow-1);b>0;b--)this.$lines.shift();if(f.lastRow>h.lastRow)for(var b=this.session.getFoldedRowCount(h.lastRow+1,f.lastRow);b>0;b--)this.$lines.pop();h.firstRow<f.firstRow&&this.$lines.unshift(this.$renderLinesFragment(h,h.firstRow,f.firstRow-1)),h.lastRow>f.lastRow&&this.$lines.push(this.$renderLinesFragment(h,f.lastRow+1,h.lastRow)),this.$highlightIndentGuide()},u.prototype.$renderLinesFragment=function(h,f,g){for(var v=[],b=f,A=this.session.getNextFoldLine(b),S=A?A.start.row:1/0;b>S&&(b=A.end.row+1,A=this.session.getNextFoldLine(b,A),S=A?A.start.row:1/0),!(b>g);){var w=this.$lines.createCell(b,h,this.session),y=w.element;this.dom.removeChildren(y),r.setStyle(y.style,"height",this.$lines.computeLineHeight(b,h,this.session)+"px"),r.setStyle(y.style,"top",this.$lines.computeLineTop(b,h,this.session)+"px"),this.$renderLine(y,b,b==S?A:!1),this.$useLineGroups()?y.className="ace_line_group":y.className="ace_line",v.push(w),b++}return v},u.prototype.update=function(h){this.$lines.moveContainer(h),this.config=h;for(var f=h.firstRow,g=h.lastRow,v=this.$lines;v.getLength();)v.pop();v.push(this.$renderLinesFragment(h,f,g))},u.prototype.$renderToken=function(h,f,g,v){for(var b=this,A=/(\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,S=this.dom.createFragment(this.element),w,y=0;w=A.exec(v);){var D=w[1],T=w[2],$=w[3],M=w[4],O=w[5];if(!(!b.showSpaces&&T)){var x=y!=w.index?v.slice(y,w.index):"";if(y=w.index+w[0].length,x&&S.appendChild(this.dom.createTextNode(x,this.element)),D){var k=b.session.getScreenTabSize(f+w.index),E=b.$tabStrings[k].cloneNode(!0);E.charCount=1,S.appendChild(E),f+=k-1}else if(T)if(b.showSpaces){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space",C.textContent=p.stringRepeat(b.SPACE_CHAR,T.length),S.appendChild(C)}else S.appendChild(this.dom.createTextNode(T,this.element));else if($){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space ace_invalid",C.textContent=p.stringRepeat(b.SPACE_CHAR,$.length),S.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,S.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,S.appendChild(C)}}}if(S.appendChild(this.dom.createTextNode(y?v.slice(y):v,this.element)),a(g.type))h.appendChild(S);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",s("inline-fold.closed.title","Unfold code"))),C.className=L,C.appendChild(S),h.appendChild(C)}return f+v.length},u.prototype.renderIndentGuide=function(h,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,A=0;A<b;A++)h.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),f.substr(v)}else if(f[0]==" "){for(var A=0;A<v;A++)h.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),f.substr(v)}return this.$highlightIndentGuide(),f},u.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var h=this.session.doc.$lines;if(h){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 A=this.session.$bracketHighlight.ranges,S=0;S<A.length;S++)if(f.row!==A[S].start.row){this.$highlightIndentGuideMarker.end=A[S].start.row+1,f.row>A[S].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&h[f.row]!==""&&f.column===h[f.row].length){this.$highlightIndentGuideMarker.dir=1;for(var S=f.row+1;S<h.length;S++){var w=h[S],y=/^\s*/.exec(w)[0].length;if(w!==""&&(this.$highlightIndentGuideMarker.end=S,y<=g))break}}this.$renderHighlightIndentGuide()}}},u.prototype.$clearActiveIndentGuide=function(){for(var h=this.element.querySelectorAll(".ace_indent-guide-active"),f=0;f<h.length;f++)h[f].classList.remove("ace_indent-guide-active")},u.prototype.$setIndentGuideActive=function(h,f){var g=this.session.doc.getLine(h.row);if(g!==""){var v=h.element;if(h.element.classList&&h.element.classList.contains("ace_line_group"))if(h.element.childNodes.length>0)v=h.element.childNodes[0];else return;var b=v.childNodes;if(b){var A=b[f-1];A&&A.classList&&A.classList.contains("ace_indent-guide")&&A.classList.add("ace_indent-guide-active")}}},u.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var h=this.$lines.cells;this.$clearActiveIndentGuide();var f=this.$highlightIndentGuideMarker.indentLevel;if(f!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var g=0;g<h.length;g++){var v=h[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=h.length-1;g>=0;g--){var v=h[g];if(this.$highlightIndentGuideMarker.end&&v.row<this.$highlightIndentGuideMarker.start){if(v.row<this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(v,f)}}}},u.prototype.$createLineElement=function(h){var f=this.dom.createElement("div");return f.className="ace_line",f.style.height=this.config.lineHeight+"px",f},u.prototype.$renderWrappedLine=function(h,f,g){var v=0,b=0,A=g[0],S=0,w=this.$createLineElement();h.appendChild(w);for(var y=0;y<f.length;y++){var D=f[y],T=D.value;if(y==0&&this.displayIndentGuides){if(v=T.length,T=this.renderIndentGuide(w,T,A),!T)continue;v-=T.length}if(v+T.length<A)S=this.$renderToken(w,S,D,T),v+=T.length;else{for(;v+T.length>=A;){S=this.$renderToken(w,S,D,T.substring(0,A-v)),T=T.substring(A-v),v=A,w=this.$createLineElement(),h.appendChild(w);var $=this.dom.createTextNode(p.stringRepeat(" ",g.indent),this.element);$.charCount=0,w.appendChild($),b++,S=0,A=g[b]||Number.MAX_VALUE}T.length!=0&&(v+=T.length,S=this.$renderToken(w,S,D,T))}}g[g.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(w,S,null,"",!0)},u.prototype.$renderSimpleLine=function(h,f){for(var g=0,v=0;v<f.length;v++){var b=f[v],A=b.value;if(!(v==0&&this.displayIndentGuides&&(A=this.renderIndentGuide(h,A),!A))){if(g+A.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(h,g,b,A);g=this.$renderToken(h,g,b,A)}}},u.prototype.$renderOverflowMessage=function(h,f,g,v,b){g&&this.$renderToken(h,f,g,v.slice(0,this.MAX_LINE_LENGTH-f));var A=this.dom.createElement("span");A.className="ace_inline_button ace_keyword ace_toggle_wrap",A.textContent=b?"<hide>":"<click to see more...>",h.appendChild(A)},u.prototype.$renderLine=function(h,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=h;if(v.length){var A=this.session.getRowSplitData(f);if(A&&A.length){this.$renderWrappedLine(h,v,A);var b=h.lastChild}else{var b=h;this.$useLineGroups()&&(b=this.$createLineElement(),h.appendChild(b)),this.$renderSimpleLine(b,v)}}else this.$useLineGroups()&&(b=this.$createLineElement(),h.appendChild(b));if(this.showEOL&&b){g&&(f=g.end.row);var S=this.dom.createElement("span");S.className="ace_invisible ace_invisible_eol",S.textContent=f==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,b.appendChild(S)}},u.prototype.$getFoldLineTokens=function(h,f){var g=this.session,v=[];function b(S,w,y){for(var D=0,T=0;T+S[D].value.length<w;)if(T+=S[D].value.length,D++,D==S.length)return;if(T!=w){var $=S[D].value.substring(w-T);$.length>y-w&&($=$.substring(0,y-w)),v.push({type:S[D].type,value:$}),T=w+$.length,D+=1}for(;T<y&&D<S.length;){var $=S[D].value;$.length+T>y?v.push({type:S[D].type,value:$.substring(0,y-T)}):v.push(S[D]),T+=$.length,D+=1}}var A=g.getTokens(h);return f.walk(function(S,w,y,D,T){S!=null?v.push({type:"fold",value:S}):(T&&(A=g.getTokens(w)),A.length&&b(A,D,y))},f.end.row,this.session.getLine(f.end.row).length),v},u.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},u})();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,d){var i=t("../lib/dom"),r=(function(){function p(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 p.prototype.$updateOpacity=function(o){for(var l=this.cursors,s=l.length;s--;)i.setStyle(l[s].style,"opacity",o?"":"0")},p.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))},p.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,i.removeCssClass(this.element,"ace_animate-blinking")},p.prototype.setPadding=function(o){this.$padding=o},p.prototype.setSession=function(o){this.session=o},p.prototype.setBlinking=function(o){o!=this.isBlinking&&(this.isBlinking=o,this.restartTimer())},p.prototype.setBlinkInterval=function(o){o!=this.blinkInterval&&(this.blinkInterval=o,this.restartTimer())},p.prototype.setSmoothBlinking=function(o){o!=this.smoothBlinking&&(this.smoothBlinking=o,i.setCssClass(this.element,"ace_smooth-blinking",o),this.$updateCursors(!0),this.restartTimer())},p.prototype.addCursor=function(){var o=i.createElement("div");return o.className="ace_cursor",this.element.appendChild(o),this.cursors.push(o),o},p.prototype.removeCursor=function(){if(this.cursors.length>1){var o=this.cursors.pop();return o.parentNode.removeChild(o),o}},p.prototype.hideCursor=function(){this.isVisible=!1,i.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},p.prototype.showCursor=function(){this.isVisible=!0,i.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},p.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()}},p.prototype.getPixelPosition=function(o,l){if(!this.config||!this.session)return{left:0,top:0};o||(o=this.session.selection.getCursor());var s=this.session.documentToScreenPosition(o),a=this.$padding+(this.session.$bidiHandler.isBidiRow(s.row,o.row)?this.session.$bidiHandler.getPosLeft(s.column):s.column*this.config.characterWidth),c=(s.row-(l?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:a,top:c}},p.prototype.isCursorInView=function(o,l){return o.top>=0&&o.top<l.maxHeight},p.prototype.update=function(o){this.config=o;var l=this.session.$selectionMarkers,s=0,a=0;(l===void 0||l.length===0)&&(l=[{cursor:null}]);for(var s=0,c=l.length;s<c;s++){var u=this.getPixelPosition(l[s].cursor,!0);if(!((u.top>o.height+o.offset||u.top<0)&&s>1)){var h=this.cursors[a++]||this.addCursor(),f=h.style;this.drawCursor?this.drawCursor(h,u,o,l[s],this.session):this.isCursorInView(u,o)?(i.setStyle(f,"display","block"),i.translate(h,u.left,u.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=u,this.restartTimer()},p.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"))},p.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},p})();r.prototype.$padding=0,r.prototype.drawCursor=null,n.Cursor=r}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,d){var i=this&&this.__extends||(function(){var h=function(f,g){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,b){v.__proto__=b}||function(v,b){for(var A in b)Object.prototype.hasOwnProperty.call(b,A)&&(v[A]=b[A])},h(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");h(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})(),r=t("./lib/oop"),p=t("./lib/dom"),o=t("./lib/event"),l=t("./lib/event_emitter").EventEmitter,s=32768,a=(function(){function h(f,g){this.element=p.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+g,this.inner=p.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 h.prototype.setVisible=function(f){this.element.style.display=f?"":"none",this.isVisible=f,this.coeff=1},h})();r.implement(a.prototype,l);var c=(function(h){i(f,h);function f(g,v){var b=h.call(this,g,"-v")||this;return b.scrollTop=0,b.scrollHeight=0,v.$scrollbarWidth=b.width=p.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>s?(this.coeff=s/g,g=s):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 u=(function(h){i(f,h);function f(g,v){var b=h.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=u,n.VScrollBar=c,n.HScrollBar=u}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,d){var i=this&&this.__extends||(function(){var u=function(h,f){return u=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])},u(h,f)};return function(h,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");u(h,f);function g(){this.constructor=h}h.prototype=f===null?Object.create(f):(g.prototype=f.prototype,new g)}})(),r=t("./lib/oop"),p=t("./lib/dom"),o=t("./lib/event"),l=t("./lib/event_emitter").EventEmitter;p.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 s=(function(){function u(h,f){this.element=p.createElement("div"),this.element.className="ace_sb"+f,this.inner=p.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,h.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return u.prototype.setVisible=function(h){this.element.style.display=h?"":"none",this.isVisible=h,this.coeff=1},u})();r.implement(s.prototype,l);var a=(function(u){i(h,u);function h(f,g){var v=u.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 h.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,A=function(M){b=M.clientY},S=function(){clearInterval(T)},w=g.clientY,y=this.thumbTop,D=function(){if(b!==void 0){var M=v.scrollTopFromThumbTop(y+b-w);M!==v.scrollTop&&v._emit("scroll",{data:M})}};o.capture(this.inner,A,S);var T=setInterval(D,20);return o.preventDefault(g)}var $=g.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop($)}),o.preventDefault(g)}},h.prototype.getHeight=function(){return this.height},h.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},h.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},h.prototype.setHeight=function(f){this.height=Math.max(0,f),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},h.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})))},h.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"},h})(s);a.prototype.setInnerHeight=a.prototype.setScrollHeight;var c=(function(u){i(h,u);function h(f,g){var v=u.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 h.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,A=function(M){b=M.clientX},S=function(){clearInterval(T)},w=g.clientX,y=this.thumbLeft,D=function(){if(b!==void 0){var M=v.scrollLeftFromThumbLeft(y+b-w);M!==v.scrollLeft&&v._emit("scroll",{data:M})}};o.capture(this.inner,A,S);var T=setInterval(D,20);return o.preventDefault(g)}var $=g.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft($)}),o.preventDefault(g)}},h.prototype.getHeight=function(){return this.isVisible?this.height:0},h.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},h.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)},h.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})))},h.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"},h})(s);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,d){var i=t("./lib/event"),r=(function(){function p(o,l){this.onRender=o,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=l||window;var s=this;this._flush=function(a){s.pending=!1;var c=s.changes;if(c&&(i.blockIdle(100),s.changes=0,s.onRender(c)),s.changes){if(s.$recursionLimit--<0)return;s.schedule()}else s.$recursionLimit=2}}return p.prototype.schedule=function(o){this.changes=this.changes|o,this.changes&&!this.pending&&(i.nextFrame(this._flush),this.pending=!0)},p.prototype.clear=function(o){var l=this.changes;return this.changes=0,l},p})();n.RenderLoop=r}),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,d){var i=t("../lib/oop"),r=t("../lib/dom"),p=t("../lib/lang"),o=t("../lib/event"),l=t("../lib/useragent"),s=t("../lib/event_emitter").EventEmitter,a=512,c=typeof ResizeObserver=="function",u=200,h=(function(){function f(g){this.el=r.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=r.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=r.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),g.appendChild(this.el),this.$measureNode.textContent=p.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=p.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=r.buildDom([g(0,0),g(u,0),g(0,u),g(u,u)],this.el)},f.prototype.transformCoordinates=function(g,v){if(g){var b=this.$getZoom(this.el);g=y(1/b,g)}function A(B,N,H){var P=B[1]*N[0]-B[0]*N[1];return[(-N[1]*H[0]+N[0]*H[1])/P,(+B[1]*H[0]-B[0]*H[1])/P]}function S(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 D(B){var N=B.getBoundingClientRect();return[N.left,N.top]}var T=D(this.els[0]),$=D(this.els[1]),M=D(this.els[2]),O=D(this.els[3]),x=A(S(O,$),S(O,M),S(w($,M),w(O,T))),k=y(1+x[0],S($,T)),E=y(1+x[1],S(M,T));if(v){var C=v,L=x[0]*C[0]/u+x[1]*C[1]/u+1,I=w(y(C[0],k),y(C[1],E));return w(y(1/L/u,I),T)}var F=S(g,T),R=A(S(k,y(x[0],F)),S(E,y(x[1],F)),F);return y(u,R)},f})();h.prototype.$characterSize={width:0,height:0},i.implement(h.prototype,s),n.FontMetrics=h}),ace.define("ace/css/editor-css",["require","exports","module"],function(t,n,d){d.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,d){var i=t("../lib/dom"),r=t("../lib/oop"),p=t("../lib/event_emitter").EventEmitter,o=(function(){function l(s,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(s)}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(s){this.$createCanvas(),this.scrollbarV=s,s.element.appendChild(this.canvas),this.setDimensions()},l.prototype.$updateDecorators=function(s){if(typeof this.canvas.getContext!="function")return;var a=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;this.setDimensions(s);var c=this.canvas.getContext("2d");function u(k,E){return k.priority<E.priority?-1:k.priority>E.priority?1:0}var h=this.renderer.session.$annotations;if(c.clearRect(0,0,this.canvas.width,this.canvas.height),h){var f={info:1,warning:2,error:3};h.forEach(function(k){k.priority=f[k.type]||null}),h=h.sort(u);for(var g=0;g<h.length;g++){var v=h[g].row,b=this.getVerticalOffsetForRow(v),A=b+this.lineHeight,S=Math.round(this.heightRatio*b),w=Math.round(this.heightRatio*A),y=Math.round((S+w)/2),D=w-y;D<this.halfMinDecorationHeight&&(D=this.halfMinDecorationHeight),y-D<0&&(y=D),y+D>this.canvasHeight&&(y=this.canvasHeight-D);var T=y-D,$=y+D,M=$-T;c.fillStyle=a[h[g].type]||null,c.fillRect(0,T,Math.round(this.oneZoneWidth-1),M)}}var O=this.renderer.session.selection.getCursor();if(O){var x=Math.round(this.getVerticalOffsetForRow(O.row)*this.heightRatio);c.fillStyle="rgba(0, 0, 0, 0.5)",c.fillRect(0,x,this.canvasWidth,2)}},l.prototype.getVerticalOffsetForRow=function(s){s=s|0;var a=this.renderer.session.documentToScreenRow(s,0)*this.lineHeight;return a},l.prototype.setDimensions=function(s){s=s||this.renderer.layerConfig,this.maxHeight=s.maxHeight,this.lineHeight=s.lineHeight,this.canvasHeight=s.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})();r.implement(o.prototype,p),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,d){var i=t("./lib/oop"),r=t("./lib/dom"),p=t("./lib/lang"),o=t("./config"),l=t("./layer/gutter").Gutter,s=t("./layer/marker").Marker,a=t("./layer/text").Text,c=t("./layer/cursor").Cursor,u=t("./scrollbar").HScrollBar,h=t("./scrollbar").VScrollBar,f=t("./scrollbar_custom").HScrollBar,g=t("./scrollbar_custom").VScrollBar,v=t("./renderloop").RenderLoop,b=t("./layer/font_metrics").FontMetrics,A=t("./lib/event_emitter").EventEmitter,S=t("./css/editor-css"),w=t("./layer/decorators").Decorator,y=t("./lib/useragent"),D=t("./layer/text_util").isTextToken;r.importCssString(S,"ace_editor.css",!1);var T=(function(){function $(M,O){var x=this;this.container=M||r.createElement("div"),r.addCssClass(this.container,"ace_editor"),r.HI_DPI&&r.addCssClass(this.container,"ace_hidpi"),this.setTheme(O),o.get("useStrictCSP")==null&&o.set("useStrictCSP",!1),this.$gutter=r.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=r.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=r.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 s(this.content);var k=this.$textLayer=new a(this.content);this.canvas=k.element,this.$markerFront=new s(this.content),this.$cursorLayer=new c(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.on("scroll",function(E){x.$scrollAnimation||x.session.setScrollTop(E.data-x.scrollMargin.top)}),this.scrollBarH.on("scroll",function(E){x.$scrollAnimation||x.session.setScrollLeft(E.data-x.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(E){x.updateCharacterSize(),x.onResize(!0,x.gutterWidth,x.$size.width,x.$size.height),x._signal("changeCharacterSize",E)}),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 $.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(),r.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},$.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))},$.prototype.updateLines=function(M,O,x){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(x)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},$.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},$.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},$.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},$.prototype.updateFull=function(M){M?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},$.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},$.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},$.prototype.onResize=function(M,O,x,k){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=M?1:0;var E=this.container;k||(k=E.clientHeight||E.scrollHeight),!k&&this.$maxLines&&this.lineHeight>1&&(!E.style.height||E.style.height=="0px")&&(E.style.height="1px",k=E.clientHeight||E.scrollHeight),x||(x=E.clientWidth||E.scrollWidth);var C=this.$updateCachedSize(M,O,x,k);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!x&&!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)}},$.prototype.$updateCachedSize=function(M,O,x,k){k-=this.$extraHeight||0;var E=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,E|=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",E=E|this.CHANGE_SCROLL),x&&(M||C.width!=x)){E|=this.CHANGE_SIZE,C.width=x,O==null&&(O=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=O,r.setStyle(this.scrollBarH.element.style,"left",O+"px"),r.setStyle(this.scroller.style,"left",O+this.margin.left+"px"),C.scrollerWidth=Math.max(0,x-O-this.scrollBarV.getWidth()-this.margin.h),r.setStyle(this.$gutter.style,"left",this.margin.left+"px");var I=this.scrollBarV.getWidth()+"px";r.setStyle(this.scrollBarH.element.style,"right",I),r.setStyle(this.scroller.style,"right",I),r.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(C.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||M)&&(E|=this.CHANGE_FULL)}return C.$dirty=!x||!k,E&&this._signal("resize",L),E},$.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()},$.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)},$.prototype.setAnimatedScroll=function(M){this.setOption("animatedScroll",M)},$.prototype.getAnimatedScroll=function(){return this.$animatedScroll},$.prototype.setShowInvisibles=function(M){this.setOption("showInvisibles",M),this.session.$bidiHandler.setShowInvisibles(M)},$.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},$.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},$.prototype.setDisplayIndentGuides=function(M){this.setOption("displayIndentGuides",M)},$.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},$.prototype.setHighlightIndentGuides=function(M){this.setOption("highlightIndentGuides",M)},$.prototype.setShowPrintMargin=function(M){this.setOption("showPrintMargin",M)},$.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},$.prototype.setPrintMarginColumn=function(M){this.setOption("printMarginColumn",M)},$.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},$.prototype.getShowGutter=function(){return this.getOption("showGutter")},$.prototype.setShowGutter=function(M){return this.setOption("showGutter",M)},$.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},$.prototype.setFadeFoldWidgets=function(M){this.setOption("fadeFoldWidgets",M)},$.prototype.setHighlightGutterLine=function(M){this.setOption("highlightGutterLine",M)},$.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},$.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var M=r.createElement("div");M.className="ace_layer ace_print-margin-layer",this.$printMarginEl=r.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()}},$.prototype.getContainerElement=function(){return this.container},$.prototype.getMouseEventTarget=function(){return this.scroller},$.prototype.getTextAreaContainer=function(){return this.container},$.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var M=this.textarea.style,O=this.$composition;if(!this.$keepTextAreaAtCursor&&!O){r.translate(this.textarea,-100,0);return}var x=this.$cursorLayer.$pixelPos;if(x){O&&O.markerRange&&(x=this.$cursorLayer.getPixelPosition(O.markerRange.start,!0));var k=this.layerConfig,E=x.top,C=x.left;E-=k.offset;var L=O&&O.useTextareaForIME||y.isMobile?this.lineHeight:1;if(E<0||E>k.height-L){r.translate(this.textarea,0,0);return}var I=1,F=this.$size.height-L;if(!O)E+=this.lineHeight;else if(O.useTextareaForIME){var R=this.textarea.value;I=this.characterWidth*this.session.$getStringScreenWidth(R)[0]}else E+=this.lineHeight+2;C-=this.scrollLeft,C>this.$size.scrollerWidth-I&&(C=this.$size.scrollerWidth-I),C+=this.gutterWidth+this.margin.left,r.setStyle(M,"height",L+"px"),r.setStyle(M,"width",I+"px"),r.translate(this.textarea,Math.min(C,this.$size.scrollerWidth-I),Math.min(E,F))}}},$.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},$.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},$.prototype.getLastFullyVisibleRow=function(){var M=this.layerConfig,O=M.lastRow,x=this.session.documentToScreenRow(O,0)*M.lineHeight;return x-this.session.getScrollTop()>M.height-M.lineHeight?O-1:O},$.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},$.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()},$.prototype.setScrollMargin=function(M,O,x,k){var E=this.scrollMargin;E.top=M|0,E.bottom=O|0,E.right=k|0,E.left=x|0,E.v=E.top+E.bottom,E.h=E.left+E.right,E.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-E.top),this.updateFull()},$.prototype.setMargin=function(M,O,x,k){var E=this.margin;E.top=M|0,E.bottom=O|0,E.right=k|0,E.left=x|0,E.v=E.top+E.bottom,E.h=E.left+E.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},$.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},$.prototype.setHScrollBarAlwaysVisible=function(M){this.setOption("hScrollBarAlwaysVisible",M)},$.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},$.prototype.setVScrollBarAlwaysVisible=function(M){this.setOption("vScrollBarAlwaysVisible",M)},$.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)},$.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},$.prototype.freeze=function(){this.$frozen=!0},$.prototype.unfreeze=function(){this.$frozen=!1},$.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 x=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(),x.firstRow!=this.layerConfig.firstRow&&x.firstRowScreen==this.layerConfig.firstRowScreen){var k=this.scrollTop+(x.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())}x=this.layerConfig,this.$updateScrollBarV(),M&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),r.translate(this.content,-this.scrollLeft,-x.offset);var E=x.width+2*this.$padding+"px",C=x.minHeight+"px";r.setStyle(this.content.style,"width",E),r.setStyle(this.content.style,"height",C)}if(M&this.CHANGE_H_SCROLL&&(r.translate(this.content,-this.scrollLeft,-x.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(x),this.$showGutter&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x),this.$markerBack.update(x),this.$markerFront.update(x),this.$cursorLayer.update(x),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(x):this.$textLayer.scrollLines(x),this.$showGutter&&(M&this.CHANGE_GUTTER||M&this.CHANGE_LINES?this.$gutterLayer.update(x):this.$gutterLayer.scrollLines(x)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x),this.$markerBack.update(x),this.$markerFront.update(x),this.$cursorLayer.update(x),this.$moveTextAreaToCursor(),this._signal("afterRender",M);return}M&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(x),this.$showGutter&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)):M&this.CHANGE_LINES?((this.$updateLines()||M&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)):M&this.CHANGE_TEXT||M&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)):M&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)),M&this.CHANGE_CURSOR&&(this.$cursorLayer.update(x),this.$moveTextAreaToCursor()),M&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(x),M&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(x),this._signal("afterRender",M)},$.prototype.$autosize=function(){var M=this.session.getScreenLength()*this.lineHeight,O=this.$maxLines*this.lineHeight,x=Math.min(O,Math.max((this.$minLines||1)*this.lineHeight,M))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(x+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&x>this.$maxPixelHeight&&(x=this.$maxPixelHeight);var k=x<=2*this.lineHeight,E=!k&&M>O;if(x!=this.desiredHeight||this.$size.height!=this.desiredHeight||E!=this.$vScroll){E!=this.$vScroll&&(this.$vScroll=E,this.scrollBarV.setVisible(E));var C=this.container.clientWidth;this.container.style.height=x+"px",this.$updateCachedSize(!0,this.$gutterWidth,C,x),this.desiredHeight=x,this._signal("autosize")}},$.prototype.$computeLayerConfig=function(){var M=this.session,O=this.$size,x=O.height<=2*this.lineHeight,k=this.session.getScreenLength(),E=k*this.lineHeight,C=this.$getLongestLine(),L=!x&&(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(),x=O.height<=2*this.lineHeight);var R=O.scrollerHeight+this.lineHeight,B=!this.$maxLines&&this.$scrollPastEnd?(O.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;E+=B;var N=this.scrollMargin;this.session.setScrollTop(Math.max(-N.top,Math.min(this.scrollTop,E-O.scrollerHeight+N.bottom))),this.session.setScrollLeft(Math.max(-N.left,Math.min(this.scrollLeft,C+2*this.$padding-O.scrollerWidth+N.right)));var H=!x&&(this.$vScrollBarAlwaysVisible||O.scrollerHeight-E+B<0||this.scrollTop>N.top),P=F!==H;P&&(this.$vScroll=H,this.scrollBarV.setVisible(H));var j=this.scrollTop%this.lineHeight,V=Math.ceil(R/this.lineHeight)-1,K=Math.max(0,Math.round((this.scrollTop-j)/this.lineHeight)),J=K+V,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||P)&&(ue|=this.$updateCachedSize(!0,this.gutterWidth,O.width,O.height),this._signal("scrollbarVisibilityChanged"),P&&(C=this.$getLongestLine())),this.layerConfig={width:C,padding:this.$padding,firstRow:K,firstRowScreen:Y,lastRow:J,lineHeight:q,characterWidth:this.characterWidth,minHeight:R,maxHeight:E,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},$.prototype.$updateLines=function(){if(this.$changedLines){var M=this.$changedLines.firstRow,O=this.$changedLines.lastRow;this.$changedLines=null;var x=this.layerConfig;if(!(M>x.lastRow+1)&&!(O<x.firstRow)){if(O===1/0){this.$showGutter&&this.$gutterLayer.update(x),this.$textLayer.update(x);return}return this.$textLayer.updateLines(x,M,O),!0}}},$.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))},$.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},$.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},$.prototype.addGutterDecoration=function(M,O){this.$gutterLayer.addGutterDecoration(M,O)},$.prototype.removeGutterDecoration=function(M,O){this.$gutterLayer.removeGutterDecoration(M,O)},$.prototype.updateBreakpoints=function(M){this._rows=M,this.$loop.schedule(this.CHANGE_GUTTER)},$.prototype.setAnnotations=function(M){this.$gutterLayer.setAnnotations(M),this.$loop.schedule(this.CHANGE_GUTTER)},$.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},$.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},$.prototype.showCursor=function(){this.$cursorLayer.showCursor()},$.prototype.scrollSelectionIntoView=function(M,O,x){this.scrollCursorIntoView(M,x),this.scrollCursorIntoView(O,x)},$.prototype.scrollCursorIntoView=function(M,O,x){if(this.$size.scrollerHeight!==0){var k=this.$cursorLayer.getPixelPosition(M),E=k.left,C=k.top,L=x&&x.top||0,I=x&&x.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;E-B<R?(E-=B,E<this.$padding+B&&(E=-this.scrollMargin.left),this.session.setScrollLeft(E)):(E+=B,R+this.$size.scrollerWidth<E+this.characterWidth?this.session.setScrollLeft(Math.round(E+this.characterWidth-this.$size.scrollerWidth)):R<=this.$padding&&E-R<this.characterWidth&&this.session.setScrollLeft(0))}},$.prototype.getScrollTop=function(){return this.session.getScrollTop()},$.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},$.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},$.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},$.prototype.scrollToRow=function(M){this.session.setScrollTop(M*this.lineHeight)},$.prototype.alignCursor=function(M,O){typeof M=="number"&&(M={row:M,column:0});var x=this.$cursorLayer.getPixelPosition(M),k=this.$size.scrollerHeight-this.lineHeight,E=x.top-k*(O||0);return this.session.setScrollTop(E),E},$.prototype.$calcSteps=function(M,O){var x=0,k=this.STEPS,E=[],C=function(L,I,F){return F*(Math.pow(L-1,3)+1)+I};for(x=0;x<k;++x)E.push(C(x/this.STEPS,M,O-M));return E},$.prototype.scrollToLine=function(M,O,x,k){var E=this.$cursorLayer.getPixelPosition({row:M,column:0}),C=E.top;O&&(C-=this.$size.scrollerHeight/2);var L=this.scrollTop;this.session.setScrollTop(C),x!==!1&&this.animateScrolling(L,k)},$.prototype.animateScrolling=function(M,O){var x=this.scrollTop;if(!this.$animatedScroll)return;var k=this;if(M==x)return;if(this.$scrollAnimation){var E=this.$scrollAnimation.steps;if(E.length&&(M=E[0],M==x))return}var C=k.$calcSteps(M,x);this.$scrollAnimation={from:M,to:x,steps:C},clearInterval(this.$timer),k.session.setScrollTop(C.shift()),k.session.$scrollTop=x;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=x):x!=null?(k.session.$scrollTop=-1,k.session.setScrollTop(x),x=null):L()},10)},$.prototype.scrollToY=function(M){this.scrollTop!==M&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=M)},$.prototype.scrollToX=function(M){this.scrollLeft!==M&&(this.scrollLeft=M),this.$loop.schedule(this.CHANGE_H_SCROLL)},$.prototype.scrollTo=function(M,O){this.session.setScrollTop(O),this.session.setScrollLeft(M)},$.prototype.scrollBy=function(M,O){O&&this.session.setScrollTop(this.session.getScrollTop()+O),M&&this.session.setScrollLeft(this.session.getScrollLeft()+M)},$.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},$.prototype.pixelToScreenCoordinates=function(M,O){var x;if(this.$hasCssTransforms){x={top:0,left:0};var k=this.$fontMetrics.transformCoordinates([M,O]);M=k[1]-this.gutterWidth-this.margin.left,O=k[0]}else x=this.scroller.getBoundingClientRect();var E=M+this.scrollLeft-x.left-this.$padding,C=E/this.characterWidth,L=Math.floor((O+this.scrollTop-x.top)/this.lineHeight),I=this.$blockCursor?Math.floor(C):Math.round(C);return{row:L,column:I,side:C-I>0?1:-1,offsetX:E}},$.prototype.screenToTextCoordinates=function(M,O){var x;if(this.$hasCssTransforms){x={top:0,left:0};var k=this.$fontMetrics.transformCoordinates([M,O]);M=k[1]-this.gutterWidth-this.margin.left,O=k[0]}else x=this.scroller.getBoundingClientRect();var E=M+this.scrollLeft-x.left-this.$padding,C=E/this.characterWidth,L=this.$blockCursor?Math.floor(C):Math.round(C),I=Math.floor((O+this.scrollTop-x.top)/this.lineHeight);return this.session.screenToDocumentPosition(I,Math.max(L,0),E)},$.prototype.textToScreenCoordinates=function(M,O){var x=this.scroller.getBoundingClientRect(),k=this.session.documentToScreenPosition(M,O),E=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:x.left+E-this.scrollLeft,pageY:x.top+C-this.scrollTop}},$.prototype.visualizeFocus=function(){r.addCssClass(this.container,"ace_focus")},$.prototype.visualizeBlur=function(){r.removeCssClass(this.container,"ace_focus")},$.prototype.showComposition=function(M){this.$composition=M,M.cssText||(M.cssText=this.textarea.style.cssText),M.useTextareaForIME==null&&(M.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(r.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")},$.prototype.setCompositionText=function(M){var O=this.session.selection.cursor;this.addToken(M,"composition_placeholder",O.row,O.column),this.$moveTextAreaToCursor()},$.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),r.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=""}},$.prototype.setGhostText=function(M,O){var x=this.session.selection.cursor,k=O||{row:x.row,column:x.column};this.removeGhostText();var E=this.$calculateWrappedTextChunks(M,k);this.addToken(E[0].text,"ghost_text",k.row,k.column),this.$ghostText={text:M,position:{row:k.row,column:k.column}};var C=r.createElement("div");if(E.length>1){var L=this.hideTokensAfterPosition(k.row,k.column),I;E.slice(1).forEach(function(P){var j=r.createElement("div"),V=r.createElement("span");V.className="ace_ghost_text",P.wrapped&&(j.className="ghost_text_line_wrapped"),P.text.length===0&&(P.text=" "),V.appendChild(r.createTextNode(P.text)),j.appendChild(V),C.appendChild(j),I=j}),L.forEach(function(P){var j=r.createElement("span");D(P.type)||(j.className="ace_"+P.type.replace(/\./g," ace_")),j.appendChild(r.createTextNode(P.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=E.length*this.lineHeight,H=N<B-F.top;if(H)return;N<B?this.scrollBy(0,(E.length-1)*this.lineHeight):this.scrollToRow(k.row)}},$.prototype.$calculateWrappedTextChunks=function(M,O){var x=this.$size.scrollerWidth-this.$padding*2,k=Math.floor(x/this.characterWidth)-2;k=k<=0?60:k;for(var E=M.split(/\r?\n/),C=[],L=0;L<E.length;L++){var I=this.session.$getDisplayTokens(E[L],O.column),F=this.session.$computeWrapSplits(I,k,this.session.$tabSize);if(F.length>0){var R=0;F.push(E[L].length);for(var B=0;B<F.length;B++){var N=E[L].slice(R,F[B]);C.push({text:N,wrapped:!0}),R=F[B]}}else C.push({text:E[L],wrapped:!1})}return C},$.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}},$.prototype.addToken=function(M,O,x,k){var E=this.session;E.bgTokenizer.lines[x]=null;var C={type:O,value:M},L=E.getTokens(x);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),H=R.value.slice(B);L.splice(F,1,{type:R.type,value:N},C,{type:R.type,value:H});break}}this.updateLines(x,x)},$.prototype.hideTokensAfterPosition=function(M,O){for(var x=this.session.getTokens(M),k=0,E=!1,C=[],L=0;L<x.length;L++){var I=x[L];if(k+=I.value.length,I.type!=="ghost_text"){if(E){C.push({type:I.type,value:I.value}),I.type="hidden_token";continue}k===O&&(E=!0)}}return this.updateLines(M,M),C},$.prototype.removeExtraToken=function(M,O){this.session.bgTokenizer.lines[M]=null,this.updateLines(M,M)},$.prototype.setTheme=function(M,O){var x=this;if(this.$themeId=M,x._dispatchEvent("themeChange",{theme:M}),!M||typeof M=="string"){var k=M||this.$options.theme.initialValue;o.loadModule(["theme",k],E)}else E(M);function E(C){if(x.$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&&(x.$themeId=C.$id),r.importCssString(C.cssText,C.cssClass,x.container),x.theme&&r.removeCssClass(x.container,x.theme.cssClass);var L="padding"in C?C.padding:"padding"in(x.theme||{})?4:x.$padding;if(x.$padding&&L!=x.$padding&&x.setPadding(L),x.$gutterLayer){var I=C.$showGutterCursorMarker;I&&!x.$gutterLayer.$showCursorMarker?x.$gutterLayer.$showCursorMarker="theme":!I&&x.$gutterLayer.$showCursorMarker=="theme"&&(x.$gutterLayer.$showCursorMarker=null)}x.$theme=C.cssClass,x.theme=C,r.addCssClass(x.container,C.cssClass),r.setCssClass(x.container,"ace_dark",C.isDark),x.$size&&(x.$size.width=0,x.$updateSizeAsync()),x._dispatchEvent("themeLoaded",{theme:C}),O&&O(),y.isSafari&&x.scroller&&(x.scroller.style.background="red",x.scroller.style.background="")}},$.prototype.getTheme=function(){return this.$themeId},$.prototype.setStyle=function(M,O){r.setCssClass(this.container,M,O!==!1)},$.prototype.unsetStyle=function(M){r.removeCssClass(this.container,M)},$.prototype.setCursorStyle=function(M){r.setStyle(this.scroller.style,"cursor",M)},$.prototype.setMouseCursor=function(M){r.setStyle(this.scroller.style,"cursor",M)},$.prototype.attachToShadowRoot=function(){r.importCssString(S,"ace_editor.css",this.container)},$.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},$.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(x){O.$scrollAnimation||O.session.setScrollTop(x.data-O.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(x){O.$scrollAnimation||O.session.setScrollLeft(x.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 h(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.addEventListener("scroll",function(x){O.$scrollAnimation||O.session.setScrollTop(x.data-O.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(x){O.$scrollAnimation||O.session.setScrollLeft(x.data-O.scrollMargin.left)}))},$.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var M=this;this.$resizeTimer=p.delayedCall(function(){M.destroyed||M.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(O){var x=O[0].contentRect.width,k=O[0].contentRect.height;Math.abs(M.$size.width-x)>1||Math.abs(M.$size.height-k)>1?M.$resizeTimer.delay():M.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},$})();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,A),o.defineOptions(T.prototype,"renderer",{useResizeObserver:{set:function($){!$&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):$&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function($){this.$textLayer.setShowInvisibles($)&&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($){typeof $=="number"&&(this.$printMarginColumn=$),this.$showPrintMargin=!!$,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function($){this.$gutter.style.display=$?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function($){this.$gutterLayer.$useSvgGutterIcons=$},initialValue:!1},showFoldedAnnotations:{set:function($){this.$gutterLayer.$showFoldedAnnotations=$},initialValue:!1},fadeFoldWidgets:{set:function($){r.setCssClass(this.$gutter,"ace_fade-fold-widgets",$)},initialValue:!1},showFoldWidgets:{set:function($){this.$gutterLayer.setShowFoldWidgets($),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function($){this.$textLayer.setDisplayIndentGuides($)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function($){this.$textLayer.setHighlightIndentGuides($)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function($){this.$gutterLayer.setHighlightGutterLine($),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function($){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function($){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function($){typeof $=="number"&&($=$+"px"),this.container.style.fontSize=$,this.updateFontSize()},initialValue:12},fontFamily:{set:function($){this.container.style.fontFamily=$,this.updateFontSize()}},maxLines:{set:function($){this.updateFull()}},minLines:{set:function($){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function($){this.updateFull()},initialValue:0},scrollPastEnd:{set:function($){$=+$||0,this.$scrollPastEnd!=$&&(this.$scrollPastEnd=$,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function($){this.$gutterLayer.$fixedWidth=!!$,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function($){this.$updateCustomScrollbar($)},initialValue:!1},theme:{set:function($){this.setTheme($)},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,d){var i=t("../lib/oop"),r=t("../lib/net"),p=t("../lib/event_emitter").EventEmitter,o=t("../config");function l(u){var h="importScripts('"+r.qualifyURL(u)+"');";try{return new Blob([h],{type:"application/javascript"})}catch{var f=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,g=new f;return g.append(h),g.getBlob("application/javascript")}}function s(u){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(o.get("loadWorkerFromBlob")){var h=l(u),f=window.URL||window.webkitURL,g=f.createObjectURL(h);return new Worker(g)}return new Worker(u)}var a=function(u){u.postMessage||(u=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=u,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,p),this.$createWorkerFromOldConfig=function(u,h,f,g,v){if(t.nameToUrl&&!t.toUrl&&(t.toUrl=t.nameToUrl),o.get("packaged")||!t.toUrl)g=g||o.moduleUrl(h,"worker");else{var b=this.$normalizePath;g=g||b(t.toUrl("ace/worker/worker.js",null,"_"));var A={};u.forEach(function(S){A[S]=b(t.toUrl(S,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=s(g),v&&this.send("importScripts",v),this.$worker.postMessage({init:!0,tlns:A,module:h,classname:f}),this.$worker},this.onMessage=function(u){var h=u.data;switch(h.type){case"event":this._signal(h.name,{data:h.data});break;case"call":var f=this.callbacks[h.id];f&&(f(h.data),delete this.callbacks[h.id]);break;case"error":this.reportError(h.data);break;case"log":window.console&&console.log&&console.log.apply(console,h.data);break}},this.reportError=function(u){window.console&&console.error&&console.error(u)},this.$normalizePath=function(u){return r.qualifyURL(u)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(u){u.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(u,h){this.$worker.postMessage({command:u,args:h})},this.call=function(u,h,f){if(f){var g=this.callbackId++;this.callbacks[g]=f,h.push(g)}this.send(u,h)},this.emit=function(u,h){try{h.data&&h.data.err&&(h.data.err={message:h.data.err.message,stack:h.data.err.stack,code:h.data.err.code}),this.$worker&&this.$worker.postMessage({event:u,data:{data:h.data}})}catch(f){console.error(f.stack)}},this.attachToDocument=function(u){this.$doc&&this.terminate(),this.$doc=u,this.call("setValue",[u.getValue()]),u.on("change",this.changeListener,!0)},this.changeListener=function(u){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),u.action=="insert"?this.deltaQueue.push(u.start,u.lines):this.deltaQueue.push(u.start,u.end)},this.$sendDeltaQueue=function(){var u=this.deltaQueue;u&&(this.deltaQueue=null,u.length>50&&u.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:u}))}}).call(a.prototype);var c=function(u,h,f){var g=null,v=!1,b=Object.create(p),A=[],S=new a({messageBuffer:A,terminate:function(){},postMessage:function(y){A.push(y),g&&(v?setTimeout(w):w())}});S.setEmitSync=function(y){v=y};var w=function(){var y=A.shift();y.command?g[y.command].apply(g,y.args):y.event&&b._signal(y.event,y.data)};return b.postMessage=function(y){S.onMessage({data:y})},b.callback=function(y,D){this.postMessage({type:"call",id:D,data:y})},b.emit=function(y,D){this.postMessage({type:"event",name:y,data:D})},o.loadModule(["worker",h],function(y){for(g=new y[f](b);A.length;)w()}),S};n.UIWorkerClient=c,n.WorkerClient=a,n.createWorker=s}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,n,d){var i=t("./range").Range,r=t("./lib/event_emitter").EventEmitter,p=t("./lib/oop"),o=(function(){function l(s,a,c,u,h,f){var g=this;this.length=a,this.session=s,this.doc=s.getDocument(),this.mainClass=h,this.othersClass=f,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=u,this.$onCursorChange=function(){setTimeout(function(){g.onCursorChange()})},this.$pos=c;var v=s.getUndoManager().$undoStack||s.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=v.length,this.setup(),s.selection.on("changeCursor",this.$onCursorChange)}return l.prototype.setup=function(){var s=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 u=this.pos;u.$insertRight=!0,u.detach(),u.markerId=c.addMarker(new i(u.row,u.column,u.row,u.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(h){var f=a.createAnchor(h.row,h.column);f.$insertRight=!0,f.detach(),s.others.push(f)}),c.setUndoSelect(!1)},l.prototype.showOtherMarkers=function(){if(!this.othersActive){var s=this.session,a=this;this.othersActive=!0,this.others.forEach(function(c){c.markerId=s.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 s=0;s<this.others.length;s++)this.session.removeMarker(this.others[s].markerId)}},l.prototype.onUpdate=function(s){if(this.$updating)return this.updateAnchors(s);var a=s;if(a.start.row===a.end.row&&a.start.row===this.pos.row){this.$updating=!0;var c=s.action==="insert"?a.end.column-a.start.column:a.start.column-a.end.column,u=a.start.column>=this.pos.column&&a.start.column<=this.pos.column+this.length+1,h=a.start.column-this.pos.column;if(this.updateAnchors(s),u&&(this.length+=c),u&&!this.session.$fromUndo){if(s.action==="insert")for(var f=this.others.length-1;f>=0;f--){var g=this.others[f],v={row:g.row,column:g.column+h};this.doc.insertMergedLines(v,s.lines)}else if(s.action==="remove")for(var f=this.others.length-1;f>=0;f--){var g=this.others[f],v={row:g.row,column:g.column+h};this.doc.remove(new i(v.row,v.column,v.row,v.column-c))}}this.$updating=!1,this.updateMarkers()}},l.prototype.updateAnchors=function(s){this.pos.onChange(s);for(var a=this.others.length;a--;)this.others[a].onChange(s);this.updateMarkers()},l.prototype.updateMarkers=function(){if(!this.$updating){var s=this,a=this.session,c=function(h,f){a.removeMarker(h.markerId),h.markerId=a.addMarker(new i(h.row,h.column,h.row,h.column+s.length),f,null,!1)};c(this.pos,this.mainClass);for(var u=this.others.length;u--;)c(this.others[u],this.othersClass)}},l.prototype.onCursorChange=function(s){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",s)):(this.hideOtherMarkers(),this._emit("cursorLeave",s))}},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 s=this.session.getUndoManager(),a=(s.$undoStack||s.$undostack).length-this.$undoStackDepth,c=0;c<a;c++)s.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},l})();p.implement(o.prototype,r),n.PlaceHolder=o}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,d){var i=t("../lib/event"),r=t("../lib/useragent");function p(l,s){return l.row==s.row&&l.column==s.column}function o(l){var s=l.domEvent,a=s.altKey,c=s.shiftKey,u=s.ctrlKey,h=l.getAccelKey(),f=l.getButton();if(u&&r.isMac&&(f=s.button),l.editor.inMultiSelectMode&&f==2){l.editor.textInput.onContextMenu(l.domEvent);return}if(!u&&!a&&!h){f===0&&l.editor.inMultiSelectMode&&l.editor.exitMultiSelectMode();return}if(f===0){var g=l.editor,v=g.selection,b=g.inMultiSelectMode,A=l.getDocumentPosition(),S=v.getCursor(),w=l.inSelection()||v.isEmpty()&&p(A,S),y=l.x,D=l.y,T=function(N){y=N.clientX,D=N.clientY},$=g.session,M=g.renderer.pixelToScreenCoordinates(y,D),O=M,x;if(g.$mouseHandler.$enableJumpToDef)u&&a||h&&a?x=c?"block":"add":a&&g.$blockSelectEnabled&&(x="block");else if(h&&!a){if(x="add",!b&&c)return}else a&&g.$blockSelectEnabled&&(x="block");if(x&&r.isMac&&s.ctrlKey&&g.$mouseHandler.cancelContextMenu(),x=="add"){if(!b&&w)return;if(!b){var k=v.toOrientedRange();g.addSelectionMarker(k)}var E=v.rangeList.rangeAtPoint(A);g.inVirtualSelectionMode=!0,c&&(E=null,k=v.ranges[0]||k,g.removeSelectionMarker(k)),g.once("mouseup",function(){var N=v.toOrientedRange();E&&N.isEmpty()&&p(E.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(x=="block"){l.stop(),g.inVirtualSelectionMode=!0;var C,L=[],I=function(){var N=g.renderer.pixelToScreenCoordinates(y,D),H=$.screenToDocumentPosition(N.row,N.column,N.offsetX);p(O,N)&&p(H,v.lead)||(O=N,g.selection.moveToPosition(H),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&&!h?v.toSingleRange():!b&&h&&(C=v.toOrientedRange(),g.addSelectionMarker(C)),c?M=$.documentToScreenPosition(v.lead):v.moveToPosition(A),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 H=0;H<L.length;H++)v.addRange(L[H]);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,d){n.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(r){r.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(r){r.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(r){r.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(r){r.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(r){r.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(r){r.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(r){r.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(r){r.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(r){r.multiSelect.rangeCount>1?r.multiSelect.joinSelections():r.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(r){r.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(r){r.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(r){r.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(r){r.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(r){return r&&r.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,d){var i=t("./range_list").RangeList,r=t("./range").Range,p=t("./selection").Selection,o=t("./mouse/multi_select_handler").onMouseDown,l=t("./lib/event"),s=t("./lib/lang"),a=t("./commands/multi_select_commands");n.commands=a.defaultCommands.concat(a.multiSelectCommands);var c=t("./search").Search,u=new c;function h(S,w,y){return u.$options.wrap=!0,u.$options.needle=w,u.$options.backwards=y==-1,u.find(S)}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(S,w){if(S){if(!this.inMultiSelectMode&&this.rangeCount===0){var y=this.toOrientedRange();if(this.rangeList.add(y),this.rangeList.add(S),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),w||this.fromOrientedRange(S);this.rangeList.removeAll(),this.rangeList.add(y),this.$onAddRange(y)}S.cursor||(S.cursor=S.end);var D=this.rangeList.add(S);return this.$onAddRange(S),D.length&&this.$onRemoveRange(D),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),w||this.fromOrientedRange(S)}},this.toSingleRange=function(S){S=S||this.ranges[0];var w=this.rangeList.removeAll();w.length&&this.$onRemoveRange(w),S&&this.fromOrientedRange(S)},this.substractPoint=function(S){var w=this.rangeList.substractPoint(S);if(w)return this.$onRemoveRange(w),w[0]},this.mergeOverlappingRanges=function(){var S=this.rangeList.merge();S.length&&this.$onRemoveRange(S)},this.$onAddRange=function(S){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(S),this._signal("addRange",{range:S})},this.$onRemoveRange=function(S){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var w=this.rangeList.ranges.pop();S.push(w),this.rangeCount=0}for(var y=S.length;y--;){var D=this.ranges.indexOf(S[y]);this.ranges.splice(D,1)}this._signal("removeRange",{ranges:S}),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 S=this.ranges.length?this.ranges:[this.getRange()],w=[],y=0;y<S.length;y++){var D=S[y],T=D.start.row,$=D.end.row;if(T===$)w.push(D.clone());else{for(w.push(new r(T,D.start.column,T,this.session.getLine(T).length));++T<$;)w.push(this.getLineRange(T,!0));w.push(new r($,0,$,D.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 S=this.rangeList.ranges,w=S[S.length-1],y=r.fromPoints(S[0].start,w.end);this.toSingleRange(),this.setSelectionRange(y,w.cursor==w.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var S=this.rangeList.ranges,w=S[S.length-1],y=r.fromPoints(S[0].start,w.end);this.toSingleRange(),this.setSelectionRange(y,w.cursor==w.start)}else{var D=this.session.documentToScreenPosition(this.cursor),T=this.session.documentToScreenPosition(this.anchor),$=this.rectangularRangeBlock(D,T);$.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(S,w,y){var D=[],T=S.column<w.column;if(T)var $=S.column,M=w.column,O=S.offsetX,x=w.offsetX;else var $=w.column,M=S.column,O=w.offsetX,x=S.offsetX;var k=S.row<w.row;if(k)var E=S.row,C=w.row;else var E=w.row,C=S.row;$<0&&($=0),E<0&&(E=0),E==C&&(y=!0);for(var L,I=E;I<=C;I++){var F=r.fromPoints(this.session.screenToDocumentPosition(I,$,O),this.session.screenToDocumentPosition(I,M,x));if(F.isEmpty()){if(L&&v(F.end,L))break;L=F.end}F.cursor=T?F.start:F.end,D.push(F)}if(k&&D.reverse(),!y){for(var R=D.length-1;D[R].isEmpty()&&R>0;)R--;if(R>0)for(var B=0;D[B].isEmpty();)B++;for(var N=R;N>=B;N--)D[N].isEmpty()&&D.splice(N,1)}return D}}).call(p.prototype);var g=t("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(S){S.cursor||(S.cursor=S.end);var w=this.getSelectionStyle();return S.marker=this.session.addMarker(S,"ace_selection",w),this.session.$selectionMarkers.push(S),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,S},this.removeSelectionMarker=function(S){if(S.marker){this.session.removeMarker(S.marker);var w=this.session.$selectionMarkers.indexOf(S);w!=-1&&this.session.$selectionMarkers.splice(w,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(S){for(var w=this.session.$selectionMarkers,y=S.length;y--;){var D=S[y];if(D.marker){this.session.removeMarker(D.marker);var T=w.indexOf(D);T!=-1&&w.splice(T,1)}}this.session.selectionMarkerCount=w.length},this.$onAddRange=function(S){this.addSelectionMarker(S.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(S){this.removeSelectionMarkers(S.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(S){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(S){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(S){var w=S.command,y=S.editor;if(y.multiSelect){if(w.multiSelectAction)w.multiSelectAction=="forEach"?D=y.forEachSelection(w,S.args):w.multiSelectAction=="forEachLine"?D=y.forEachSelection(w,S.args,!0):w.multiSelectAction=="single"?(y.exitMultiSelectMode(),D=w.exec(y,S.args||{})):D=w.multiSelectAction(y,S.args||{});else{var D=w.exec(y,S.args||{});y.multiSelect.addRange(y.multiSelect.toOrientedRange()),y.multiSelect.mergeOverlappingRanges()}return D}},this.forEachSelection=function(S,w,y){if(!this.inVirtualSelectionMode){var D=y&&y.keepOrder,T=y==!0||y&&y.$byLines,$=this.session,M=this.selection,O=M.rangeList,x=(D?M:O).ranges,k;if(!x.length)return S.exec?S.exec(this,w||{}):S(this,w||{});var E=M._eventRegistry;M._eventRegistry={};var C=new p($);this.inVirtualSelectionMode=!0;for(var L=x.length;L--;){if(T)for(;L>0&&x[L].start.row==x[L-1].end.row;)L--;C.fromOrientedRange(x[L]),C.index=L,this.selection=$.selection=C;var I=S.exec?S.exec(this,w||{}):S(this,w||{});!k&&I!==void 0&&(k=I),C.toOrientedRange(x[L])}C.detach(),this.selection=$.selection=M,this.inVirtualSelectionMode=!1,M._eventRegistry=E,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 S="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var w=this.multiSelect.rangeList.ranges,y=[],D=0;D<w.length;D++)y.push(this.session.getTextRange(w[D]));var T=this.session.getDocument().getNewLineCharacter();S=y.join(T),S.length==(y.length-1)*T.length&&(S="")}else this.selection.isEmpty()||(S=this.session.getTextRange(this.getSelectionRange()));return S},this.$checkMultiselectChange=function(S,w){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var y=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&w==this.multiSelect.anchor)return;var D=w==this.multiSelect.anchor?y.cursor==y.start?y.end:y.start:y.cursor;D.row!=w.row||this.session.$clipPositionToDocument(D.row,D.column).column!=w.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(S,w,y){if(w=w||{},w.needle=S||w.needle,w.needle==null){var D=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();w.needle=this.session.getTextRange(D)}this.$search.set(w);var T=this.$search.findAll(this.session);if(!T.length)return 0;var $=this.multiSelect;y||$.toSingleRange(T[0]);for(var M=T.length;M--;)$.addRange(T[M],!0);return D&&$.rangeList.rangeAtPoint(D.start)&&$.addRange(D,!0),T.length},this.selectMoreLines=function(S,w){var y=this.selection.toOrientedRange(),D=y.cursor==y.end,T=this.session.documentToScreenPosition(y.cursor);this.selection.$desiredColumn&&(T.column=this.selection.$desiredColumn);var $=this.session.screenToDocumentPosition(T.row+S,T.column);if(y.isEmpty())var O=$;else var M=this.session.documentToScreenPosition(D?y.end:y.start),O=this.session.screenToDocumentPosition(M.row+S,M.column);if(D){var x=r.fromPoints($,O);x.cursor=x.start}else{var x=r.fromPoints(O,$);x.cursor=x.end}if(x.desiredColumn=T.column,!this.selection.inMultiSelectMode)this.selection.addRange(y);else if(w)var k=y.cursor;this.selection.addRange(x),k&&this.selection.substractPoint(k)},this.transposeSelections=function(S){for(var w=this.session,y=w.multiSelect,D=y.ranges,T=D.length;T--;){var $=D[T];if($.isEmpty()){var M=w.getWordRange($.start.row,$.start.column);$.start.row=M.start.row,$.start.column=M.start.column,$.end.row=M.end.row,$.end.column=M.end.column}}y.mergeOverlappingRanges();for(var O=[],T=D.length;T--;){var $=D[T];O.unshift(w.getTextRange($))}S<0?O.unshift(O.pop()):O.push(O.shift());for(var T=D.length;T--;){var $=D[T],x=$.clone();w.replace($,O[T]),$.start.row=x.start.row,$.start.column=x.start.column}y.fromOrientedRange(y.ranges[0])},this.selectMore=function(S,w,y){var D=this.session,T=D.multiSelect,$=T.toOrientedRange();if(!($.isEmpty()&&($=D.getWordRange($.start.row,$.start.column),$.cursor=S==-1?$.start:$.end,this.multiSelect.addRange($),y))){var M=D.getTextRange($),O=h(D,M,S);O&&(O.cursor=S==-1?O.start:O.end,this.session.unfold(O),this.multiSelect.addRange(O),this.renderer.scrollCursorIntoView(null,.5)),w&&this.multiSelect.substractPoint($.cursor)}},this.alignCursors=function(){var S=this.session,w=S.multiSelect,y=w.ranges,D=-1,T=y.filter(function(R){if(R.cursor.row==D)return!0;D=R.cursor.row});if(!y.length||T.length==y.length-1){var $=this.selection.getRange(),M=$.start.row,O=$.end.row,x=M==O;if(x){var k=this.session.getLength(),E;do E=this.session.getLine(O);while(/[=:]/.test(E)&&++O<k);do E=this.session.getLine(M);while(/[=:]/.test(E)&&--M>0);M<0&&(M=0),O>=k&&(O=k-1)}var C=this.session.removeFullLines(M,O);C=this.$reAlignText(C,x),this.session.insert({row:M,column:0},C.join(`
959
+ `)+`
960
+ `),x||($.start.column=0,$.end.column=C[C.length-1].length),this.selection.setRange($)}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=S.getLine(B.row),H=N.substr(B.column).search(/\S/g);return H==-1&&(H=0),B.column>L&&(L=B.column),H<I&&(I=H),H});y.forEach(function(R,B){var N=R.cursor,H=L-N.column,P=F[B]-I;H>P?S.insert(N,s.stringRepeat(" ",H-P)):S.remove(new r(N.row,N.column,N.row,N.column-H+P)),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(S,w){var y=!0,D=!0,T,$,M;return S.map(function(C){var L=C.match(/(\s*)(.*?)(\s*)([=:].*)/);return L?T==null?(T=L[1].length,$=L[2].length,M=L[3].length,L):(T+$+M!=L[1].length+L[2].length+L[3].length&&(D=!1),T!=L[1].length&&(y=!1),T>L[1].length&&(T=L[1].length),$<L[2].length&&($=L[2].length),M>L[3].length&&(M=L[3].length),L):[C]}).map(w?x:y?D?k:x:E);function O(C){return s.stringRepeat(" ",C)}function x(C){return C[2]?O(T)+C[2]+O($-C[2].length+M)+C[4].replace(/^([=:])\s+/,"$1 "):C[0]}function k(C){return C[2]?O(T+$-C[2].length)+C[2]+O(M)+C[4].replace(/^([=:])\s+/,"$1 "):C[0]}function E(C){return C[2]?O(T)+C[2]+O(M)+C[4].replace(/^([=:])\s+/,"$1 "):C[0]}}}).call(g.prototype);function v(S,w){return S.row==w.row&&S.column==w.column}n.onSessionChange=function(S){var w=S.session;w&&!w.multiSelect&&(w.$selectionMarkers=[],w.selection.$initRangeList(),w.multiSelect=w.selection),this.multiSelect=w&&w.multiSelect;var y=S.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(S){S.$multiselectOnSessionChange||(S.$onAddRange=S.$onAddRange.bind(S),S.$onRemoveRange=S.$onRemoveRange.bind(S),S.$onMultiSelect=S.$onMultiSelect.bind(S),S.$onSingleSelect=S.$onSingleSelect.bind(S),S.$multiselectOnSessionChange=n.onSessionChange.bind(S),S.$checkMultiselectChange=S.$checkMultiselectChange.bind(S),S.$multiselectOnSessionChange(S),S.on("changeSession",S.$multiselectOnSessionChange),S.on("mousedown",o),S.commands.addCommands(a.defaultCommands),A(S))}function A(S){if(!S.textInput)return;var w=S.textInput.getElement(),y=!1;l.addListener(w,"keydown",function(T){var $=T.keyCode==18&&!(T.ctrlKey||T.shiftKey||T.metaKey);S.$blockSelectEnabled&&$?y||(S.renderer.setMouseCursor("crosshair"),y=!0):y&&D()},S),l.addListener(w,"keyup",D,S),l.addListener(w,"blur",D,S);function D(T){y&&(S.renderer.setMouseCursor(""),y=!1)}}n.MultiSelect=b,t("./config").defineOptions(g.prototype,"editor",{enableMultiselect:{set:function(S){b(this),S?this.on("mousedown",o):this.off("mousedown",o)},value:!0},enableBlockSelect:{set:function(S){this.$blockSelectEnabled=S},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,n,d){var i=t("../../range").Range,r=n.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(p,o,l){var s=p.getLine(l);return this.foldingStartMarker.test(s)?"start":o=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(s)?"end":""},this.getFoldWidgetRange=function(p,o,l){return null},this.indentationBlock=function(p,o,l){var s=/\S/,a=p.getLine(o),c=a.search(s);if(c!=-1){for(var u=l||a.length,h=p.getLength(),f=o,g=o;++o<h;){var v=p.getLine(o).search(s);if(v!=-1){if(v<=c){var b=p.getTokenAt(o,0);if(!b||b.type!=="string")break}g=o}}if(g>f){var A=p.getLine(g).length;return new i(f,u,g,A)}}},this.openingBracketBlock=function(p,o,l,s,a){var c={row:l,column:s+1},u=p.$findClosingBracket(o,c,a);if(u){var h=p.foldWidgets[u.row];return h==null&&(h=p.getFoldWidget(u.row)),h=="start"&&u.row>c.row&&(u.row--,u.column=p.getLine(u.row).length),i.fromPoints(c,u)}},this.closingBracketBlock=function(p,o,l,s,a){var c={row:l,column:s},u=p.$findOpeningBracket(o,c);if(u)return u.column++,c.column--,i.fromPoints(u,c)}}).call(r.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(t,n,d){var i=t("../lib/dom"),r=t("../range").Range,p=t("../config").nls;function o(s,a,c){for(var u=0,h=s.length-1;u<=h;){var f=u+h>>1,g=c(a,s[f]);if(g>0)u=f+1;else if(g<0)h=f-1;else return f}return-(u+1)}function l(s,a,c){var u=s.getAnnotations().sort(r.comparePoints);if(u.length){var h=o(u,{row:a,column:-1},r.comparePoints);h<0&&(h=-h-1),h>=u.length?h=c>0?0:u.length-1:h===0&&c<0&&(h=u.length-1);var f=u[h];if(!(!f||!c)){if(f.row===a){do f=u[h+=c];while(f&&f.row===a);if(!f)return u.slice()}var g=[];a=f.row;do g[c<0?"unshift":"push"](f),f=u[h+=c];while(f&&f.row==a);return g.length&&g}}}n.showErrorMarker=function(s,a){var c=s.session,u=s.getCursorPosition(),h=u.row,f=c.widgetManager.getWidgetsAtRow(h).filter(function(T){return T.type=="errorMarker"})[0];f?f.destroy():h-=a;var g=l(c,h,a),v;if(g){var b=g[0];u.column=(b.pos&&typeof b.column!="number"?b.pos.sc:b.column)||0,u.row=b.row,v=s.renderer.$gutterLayer.$annotations[u.row]}else{if(f)return;v={displayText:[p("error-marker.good-state","Looks good!")],className:"ace_ok"}}s.session.unfold(u.row),s.selection.moveToPosition(u);var A={row:u.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},S=A.el.appendChild(i.createElement("div")),w=A.el.appendChild(i.createElement("div"));w.className="error_widget_arrow "+v.className;var y=s.renderer.$cursorLayer.getPixelPosition(u).left;w.style.left=y+s.renderer.gutterWidth-5+"px",A.el.className="error_widget_wrapper",S.className="error_widget "+v.className,v.displayText.forEach(function(T,$){S.appendChild(i.createTextNode(T)),$<v.displayText.length-1&&S.appendChild(i.createElement("br"))}),S.appendChild(i.createElement("div"));var D=function(T,$,M){if($===0&&(M==="esc"||M==="return"))return A.destroy(),{command:"null"}};A.destroy=function(){s.$mouseHandler.isMousePressed||(s.keyBinding.removeKeyboardHandler(D),c.widgetManager.removeLineWidget(A),s.off("changeSelection",A.destroy),s.off("changeSession",A.destroy),s.off("mouseup",A.destroy),s.off("change",A.destroy))},s.keyBinding.addKeyboardHandler(D),s.on("changeSelection",A.destroy),s.on("changeSession",A.destroy),s.on("mouseup",A.destroy),s.on("change",A.destroy),s.session.widgetManager.addLineWidget(A),A.el.onmousedown=s.focus.bind(s),s.renderer.scrollCursorIntoView(null,.5,{bottom:A.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,d){t("./loader_build")(n);var i=t("./lib/dom"),r=t("./range").Range,p=t("./editor").Editor,o=t("./edit_session").EditSession,l=t("./undomanager").UndoManager,s=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,u){if(typeof c=="string"){var h=c;if(c=document.getElementById(h),!c)throw new Error("ace.edit can't find div #"+h)}if(c&&c.env&&c.env.editor instanceof p)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 p(new s(c),v,u),A={document:v,editor:b,onResize:b.resize.bind(b,null)};return g&&(A.textarea=g),b.on("destroy",function(){A.editor.container.env=null}),b.container.env=b.env=A,b},n.createEditSession=function(c,u){var h=new o(c,u);return h.setUndoManager(new l),h},n.Range=r,n.Editor=p,n.EditSession=o,n.UndoManager=l,n.VirtualRenderer=s;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 d in t)t.hasOwnProperty(d)&&(n.ace[d]=t[d]);n.ace.default=n.ace,m&&(m.exports=n.ace)})})()})(Uo);var Oi=Uo.exports,Fi={exports:{}};Fi.exports;(function(m,e){var t=200,n="__lodash_hash_undefined__",d=1,i=2,r=9007199254740991,p="[object Arguments]",o="[object Array]",l="[object AsyncFunction]",s="[object Boolean]",a="[object Date]",c="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",g="[object Number]",v="[object Null]",b="[object Object]",A="[object Promise]",S="[object Proxy]",w="[object RegExp]",y="[object Set]",D="[object String]",T="[object Symbol]",$="[object Undefined]",M="[object WeakMap]",O="[object ArrayBuffer]",x="[object DataView]",k="[object Float32Array]",E="[object Float64Array]",C="[object Int8Array]",L="[object Int16Array]",I="[object Int32Array]",F="[object Uint8Array]",R="[object Uint8ClampedArray]",B="[object Uint16Array]",N="[object Uint32Array]",H=/[\\^$.*+?()[\]{}|]/g,P=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,V={};V[k]=V[E]=V[C]=V[L]=V[I]=V[F]=V[R]=V[B]=V[N]=!0,V[p]=V[o]=V[O]=V[s]=V[x]=V[a]=V[c]=V[u]=V[f]=V[g]=V[b]=V[w]=V[y]=V[D]=V[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,Ce=(function(){try{return ue&&ue.binding&&ue.binding("util")}catch{}})(),Oe=Ce&&Ce.isTypedArray;function De(z,G){for(var Z=-1,ee=z==null?0:z.length,ve=0,le=[];++Z<ee;){var $e=z[Z];G($e,Z,z)&&(le[ve++]=$e)}return le}function Ve(z,G){for(var Z=-1,ee=G.length,ve=z.length;++Z<ee;)z[ve+Z]=G[Z];return z}function ti(z,G){for(var Z=-1,ee=z==null?0:z.length;++Z<ee;)if(G(z[Z],Z,z))return!0;return!1}function en(z,G){for(var Z=-1,ee=Array(z);++Z<z;)ee[Z]=G(Z);return ee}function Pa(z){return function(G){return z(G)}}function Wa(z,G){return z.has(G)}function ja(z,G){return z==null?void 0:z[G]}function za(z){var G=-1,Z=Array(z.size);return z.forEach(function(ee,ve){Z[++G]=[ve,ee]}),Z}function Ha(z,G){return function(Z){return z(G(Z))}}function Va(z){var G=-1,Z=Array(z.size);return z.forEach(function(ee){Z[++G]=ee}),Z}var Ua=Array.prototype,Ka=Function.prototype,ni=Object.prototype,qi=Y["__core-js_shared__"],vr=Ka.toString,at=ni.hasOwnProperty,yr=(function(){var z=/[^.]+$/.exec(qi&&qi.keys&&qi.keys.IE_PROTO||"");return z?"Symbol(src)_1."+z:""})(),br=ni.toString,Ga=RegExp("^"+vr.call(at).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wr=ne?Y.Buffer:void 0,ii=Y.Symbol,Cr=Y.Uint8Array,Er=ni.propertyIsEnumerable,Ja=Ua.splice,It=ii?ii.toStringTag:void 0,Sr=Object.getOwnPropertySymbols,Ya=wr?wr.isBuffer:void 0,Qa=Ha(Object.keys,Object),es=tn(Y,"DataView"),$n=tn(Y,"Map"),ts=tn(Y,"Promise"),ns=tn(Y,"Set"),is=tn(Y,"WeakMap"),xn=tn(Object,"create"),Xa=Rt(es),Za=Rt($n),qa=Rt(ts),el=Rt(ns),tl=Rt(is),Dr=ii?ii.prototype:void 0,ss=Dr?Dr.valueOf:void 0;function Ot(z){var G=-1,Z=z==null?0:z.length;for(this.clear();++G<Z;){var ee=z[G];this.set(ee[0],ee[1])}}function nl(){this.__data__=xn?xn(null):{},this.size=0}function il(z){var G=this.has(z)&&delete this.__data__[z];return this.size-=G?1:0,G}function sl(z){var G=this.__data__;if(xn){var Z=G[z];return Z===n?void 0:Z}return at.call(G,z)?G[z]:void 0}function rl(z){var G=this.__data__;return xn?G[z]!==void 0:at.call(G,z)}function ol(z,G){var Z=this.__data__;return this.size+=this.has(z)?0:1,Z[z]=xn&&G===void 0?n:G,this}Ot.prototype.clear=nl,Ot.prototype.delete=il,Ot.prototype.get=sl,Ot.prototype.has=rl,Ot.prototype.set=ol;function ut(z){var G=-1,Z=z==null?0:z.length;for(this.clear();++G<Z;){var ee=z[G];this.set(ee[0],ee[1])}}function al(){this.__data__=[],this.size=0}function ll(z){var G=this.__data__,Z=ri(G,z);if(Z<0)return!1;var ee=G.length-1;return Z==ee?G.pop():Ja.call(G,Z,1),--this.size,!0}function cl(z){var G=this.__data__,Z=ri(G,z);return Z<0?void 0:G[Z][1]}function hl(z){return ri(this.__data__,z)>-1}function ul(z,G){var Z=this.__data__,ee=ri(Z,z);return ee<0?(++this.size,Z.push([z,G])):Z[ee][1]=G,this}ut.prototype.clear=al,ut.prototype.delete=ll,ut.prototype.get=cl,ut.prototype.has=hl,ut.prototype.set=ul;function Ft(z){var G=-1,Z=z==null?0:z.length;for(this.clear();++G<Z;){var ee=z[G];this.set(ee[0],ee[1])}}function dl(){this.size=0,this.__data__={hash:new Ot,map:new($n||ut),string:new Ot}}function pl(z){var G=oi(this,z).delete(z);return this.size-=G?1:0,G}function fl(z){return oi(this,z).get(z)}function gl(z){return oi(this,z).has(z)}function ml(z,G){var Z=oi(this,z),ee=Z.size;return Z.set(z,G),this.size+=Z.size==ee?0:1,this}Ft.prototype.clear=dl,Ft.prototype.delete=pl,Ft.prototype.get=fl,Ft.prototype.has=gl,Ft.prototype.set=ml;function si(z){var G=-1,Z=z==null?0:z.length;for(this.__data__=new Ft;++G<Z;)this.add(z[G])}function vl(z){return this.__data__.set(z,n),this}function yl(z){return this.__data__.has(z)}si.prototype.add=si.prototype.push=vl,si.prototype.has=yl;function wt(z){var G=this.__data__=new ut(z);this.size=G.size}function bl(){this.__data__=new ut,this.size=0}function wl(z){var G=this.__data__,Z=G.delete(z);return this.size=G.size,Z}function Cl(z){return this.__data__.get(z)}function El(z){return this.__data__.has(z)}function Sl(z,G){var Z=this.__data__;if(Z instanceof ut){var ee=Z.__data__;if(!$n||ee.length<t-1)return ee.push([z,G]),this.size=++Z.size,this;Z=this.__data__=new Ft(ee)}return Z.set(z,G),this.size=Z.size,this}wt.prototype.clear=bl,wt.prototype.delete=wl,wt.prototype.get=Cl,wt.prototype.has=El,wt.prototype.set=Sl;function Dl(z,G){var Z=ai(z),ee=!Z&&Pl(z),ve=!Z&&!ee&&rs(z),le=!Z&&!ee&&!ve&&Ir(z),$e=Z||ee||ve||le,Fe=$e?en(z.length,String):[],Ne=Fe.length;for(var Ae in z)at.call(z,Ae)&&!($e&&(Ae=="length"||ve&&(Ae=="offset"||Ae=="parent")||le&&(Ae=="buffer"||Ae=="byteLength"||Ae=="byteOffset")||Ol(Ae,Ne)))&&Fe.push(Ae);return Fe}function ri(z,G){for(var Z=z.length;Z--;)if(kr(z[Z][0],G))return Z;return-1}function Al(z,G,Z){var ee=G(z);return ai(z)?ee:Ve(ee,Z(z))}function _n(z){return z==null?z===void 0?$:v:It&&It in Object(z)?Ml(z):Bl(z)}function Ar(z){return kn(z)&&_n(z)==p}function $r(z,G,Z,ee,ve){return z===G?!0:z==null||G==null||!kn(z)&&!kn(G)?z!==z&&G!==G:$l(z,G,Z,ee,$r,ve)}function $l(z,G,Z,ee,ve,le){var $e=ai(z),Fe=ai(G),Ne=$e?o:Ct(z),Ae=Fe?o:Ct(G);Ne=Ne==p?b:Ne,Ae=Ae==p?b:Ae;var Ue=Ne==b,et=Ae==b,Pe=Ne==Ae;if(Pe&&rs(z)){if(!rs(G))return!1;$e=!0,Ue=!1}if(Pe&&!Ue)return le||(le=new wt),$e||Ir(z)?xr(z,G,Z,ee,ve,le):Tl(z,G,Ne,Z,ee,ve,le);if(!(Z&d)){var Je=Ue&&at.call(z,"__wrapped__"),Ye=et&&at.call(G,"__wrapped__");if(Je||Ye){var Et=Je?z.value():z,dt=Ye?G.value():G;return le||(le=new wt),ve(Et,dt,Z,ee,le)}}return Pe?(le||(le=new wt),Ll(z,G,Z,ee,ve,le)):!1}function xl(z){if(!Mr(z)||Rl(z))return!1;var G=Tr(z)?Ga:P;return G.test(Rt(z))}function _l(z){return kn(z)&&Lr(z.length)&&!!V[_n(z)]}function kl(z){if(!Nl(z))return Qa(z);var G=[];for(var Z in Object(z))at.call(z,Z)&&Z!="constructor"&&G.push(Z);return G}function xr(z,G,Z,ee,ve,le){var $e=Z&d,Fe=z.length,Ne=G.length;if(Fe!=Ne&&!($e&&Ne>Fe))return!1;var Ae=le.get(z);if(Ae&&le.get(G))return Ae==G;var Ue=-1,et=!0,Pe=Z&i?new si:void 0;for(le.set(z,G),le.set(G,z);++Ue<Fe;){var Je=z[Ue],Ye=G[Ue];if(ee)var Et=$e?ee(Ye,Je,Ue,G,z,le):ee(Je,Ye,Ue,z,G,le);if(Et!==void 0){if(Et)continue;et=!1;break}if(Pe){if(!ti(G,function(dt,Nt){if(!Wa(Pe,Nt)&&(Je===dt||ve(Je,dt,Z,ee,le)))return Pe.push(Nt)})){et=!1;break}}else if(!(Je===Ye||ve(Je,Ye,Z,ee,le))){et=!1;break}}return le.delete(z),le.delete(G),et}function Tl(z,G,Z,ee,ve,le,$e){switch(Z){case x:if(z.byteLength!=G.byteLength||z.byteOffset!=G.byteOffset)return!1;z=z.buffer,G=G.buffer;case O:return!(z.byteLength!=G.byteLength||!le(new Cr(z),new Cr(G)));case s:case a:case g:return kr(+z,+G);case c:return z.name==G.name&&z.message==G.message;case w:case D:return z==G+"";case f:var Fe=za;case y:var Ne=ee&d;if(Fe||(Fe=Va),z.size!=G.size&&!Ne)return!1;var Ae=$e.get(z);if(Ae)return Ae==G;ee|=i,$e.set(z,G);var Ue=xr(Fe(z),Fe(G),ee,ve,le,$e);return $e.delete(z),Ue;case T:if(ss)return ss.call(z)==ss.call(G)}return!1}function Ll(z,G,Z,ee,ve,le){var $e=Z&d,Fe=_r(z),Ne=Fe.length,Ae=_r(G),Ue=Ae.length;if(Ne!=Ue&&!$e)return!1;for(var et=Ne;et--;){var Pe=Fe[et];if(!($e?Pe in G:at.call(G,Pe)))return!1}var Je=le.get(z);if(Je&&le.get(G))return Je==G;var Ye=!0;le.set(z,G),le.set(G,z);for(var Et=$e;++et<Ne;){Pe=Fe[et];var dt=z[Pe],Nt=G[Pe];if(ee)var Or=$e?ee(Nt,dt,Pe,G,z,le):ee(dt,Nt,Pe,z,G,le);if(!(Or===void 0?dt===Nt||ve(dt,Nt,Z,ee,le):Or)){Ye=!1;break}Et||(Et=Pe=="constructor")}if(Ye&&!Et){var li=z.constructor,ci=G.constructor;li!=ci&&"constructor"in z&&"constructor"in G&&!(typeof li=="function"&&li instanceof li&&typeof ci=="function"&&ci instanceof ci)&&(Ye=!1)}return le.delete(z),le.delete(G),Ye}function _r(z){return Al(z,zl,Il)}function oi(z,G){var Z=z.__data__;return Fl(G)?Z[typeof G=="string"?"string":"hash"]:Z.map}function tn(z,G){var Z=ja(z,G);return xl(Z)?Z:void 0}function Ml(z){var G=at.call(z,It),Z=z[It];try{z[It]=void 0;var ee=!0}catch{}var ve=br.call(z);return ee&&(G?z[It]=Z:delete z[It]),ve}var Il=Sr?function(z){return z==null?[]:(z=Object(z),De(Sr(z),function(G){return Er.call(z,G)}))}:Hl,Ct=_n;(es&&Ct(new es(new ArrayBuffer(1)))!=x||$n&&Ct(new $n)!=f||ts&&Ct(ts.resolve())!=A||ns&&Ct(new ns)!=y||is&&Ct(new is)!=M)&&(Ct=function(z){var G=_n(z),Z=G==b?z.constructor:void 0,ee=Z?Rt(Z):"";if(ee)switch(ee){case Xa:return x;case Za:return f;case qa:return A;case el:return y;case tl:return M}return G});function Ol(z,G){return G=G??r,!!G&&(typeof z=="number"||j.test(z))&&z>-1&&z%1==0&&z<G}function Fl(z){var G=typeof z;return G=="string"||G=="number"||G=="symbol"||G=="boolean"?z!=="__proto__":z===null}function Rl(z){return!!yr&&yr in z}function Nl(z){var G=z&&z.constructor,Z=typeof G=="function"&&G.prototype||ni;return z===Z}function Bl(z){return br.call(z)}function Rt(z){if(z!=null){try{return vr.call(z)}catch{}try{return z+""}catch{}}return""}function kr(z,G){return z===G||z!==z&&G!==G}var Pl=Ar((function(){return arguments})())?Ar:function(z){return kn(z)&&at.call(z,"callee")&&!Er.call(z,"callee")},ai=Array.isArray;function Wl(z){return z!=null&&Lr(z.length)&&!Tr(z)}var rs=Ya||Vl;function jl(z,G){return $r(z,G)}function Tr(z){if(!Mr(z))return!1;var G=_n(z);return G==u||G==h||G==l||G==S}function Lr(z){return typeof z=="number"&&z>-1&&z%1==0&&z<=r}function Mr(z){var G=typeof z;return z!=null&&(G=="object"||G=="function")}function kn(z){return z!=null&&typeof z=="object"}var Ir=Oe?Pa(Oe):_l;function zl(z){return Wl(z)?Dl(z):kl(z)}function Hl(){return[]}function Vl(){return!1}m.exports=jl})(Fi,Fi.exports);var Ko=Fi.exports,st={};Object.defineProperty(st,"__esModule",{value:!0});st.getAceInstance=st.debounce=st.editorEvents=st.editorOptions=void 0;var nu=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"];st.editorOptions=nu;var iu=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"];st.editorEvents=iu;var su=function(){var m;return typeof window>"u"?(Ge.window={},m=Oi,delete Ge.window):window.ace?(m=window.ace,m.acequire=window.ace.require||window.ace.acequire):m=Oi,m};st.getAceInstance=su;var ru=function(m,e){var t=null;return function(){var n=this,d=arguments;clearTimeout(t),t=setTimeout(function(){m.apply(n,d)},e)}};st.debounce=ru;var ou=Gt&&Gt.__extends||(function(){var m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,d){n.__proto__=d}||function(n,d){for(var i in d)Object.prototype.hasOwnProperty.call(d,i)&&(n[i]=d[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)}})(),Ts=Gt&&Gt.__assign||function(){return Ts=Object.assign||function(m){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var d in e)Object.prototype.hasOwnProperty.call(e,d)&&(m[d]=e[d])}return m},Ts.apply(this,arguments)};Object.defineProperty(Gt,"__esModule",{value:!0});var au=Oi,te=Gs,Hr=Bs,pi=Ko,an=st,Vr=(0,an.getAceInstance)(),lu=(function(m){ou(e,m);function e(t){var n=m.call(this,t)||this;return an.editorEvents.forEach(function(d){n[d]=n[d].bind(n)}),n.debounce=an.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,d=n.className,i=n.onBeforeLoad,r=n.onValidate,p=n.mode,o=n.focus,l=n.theme,s=n.fontSize,a=n.lineHeight,c=n.value,u=n.defaultValue,h=n.showGutter,f=n.wrapEnabled,g=n.showPrintMargin,v=n.scrollMargin,b=v===void 0?[0,0,0,0]:v,A=n.keyboardHandler,S=n.onLoad,w=n.commands,y=n.annotations,D=n.markers,T=n.placeholder;this.editor=Vr.edit(this.refEditor),i&&i(Vr);for(var $=Object.keys(this.props.editorProps),M=0;M<$.length;M++)this.editor[$[M]]=this.props.editorProps[$[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 p=="string"?"ace/mode/".concat(p):p),l&&l!==""&&this.editor.setTheme("ace/theme/".concat(l)),this.editor.setFontSize(typeof s=="number"?"".concat(s,"px"):s),a&&(this.editor.container.style.lineHeight=typeof a=="number"?"".concat(a,"px"):"".concat(a),this.editor.renderer.updateFontSize()),this.editor.getSession().setValue(u||c||""),this.props.navigateToFileEnd&&this.editor.navigateFileEnd(),this.editor.renderer.setShowGutter(h),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),r&&this.editor.getSession().on("changeAnnotation",function(){var x=t.editor.getSession().getAnnotations();t.props.onValidate(x)}),this.editor.session.on("changeScrollTop",this.onScroll),this.editor.getSession().setAnnotations(y||[]),D&&D.length>0&&this.handleMarkers(D);var O=this.editor.$options;an.editorOptions.forEach(function(x){O.hasOwnProperty(x)?t.editor.setOption(x,t.props[x]):t.props[x]&&console.warn("ReactAce: editor option ".concat(x," 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(x){typeof x.exec=="string"?t.editor.commands.bindKey(x.bindKey,x.exec):t.editor.commands.addCommand(x)}),A&&this.editor.setKeyboardHandler("ace/keyboard/"+A),d&&(this.refEditor.className+=" "+d),S&&S(this.editor),this.editor.resize(),o&&this.editor.focus()},e.prototype.componentDidUpdate=function(t){for(var n=t,d=this.props,i=0;i<an.editorOptions.length;i++){var r=an.editorOptions[i];d[r]!==n[r]&&this.editor.setOption(r,d[r])}if(d.className!==n.className){var p=this.refEditor.className,o=p.trim().split(" "),l=n.className.trim().split(" ");l.forEach(function(c){var u=o.indexOf(c);o.splice(u,1)}),this.refEditor.className=" "+d.className+" "+o.join(" ")}var s=this.editor&&d.value!=null&&this.editor.getValue()!==d.value;if(s){this.silent=!0;var a=this.editor.session.selection.toJSON();this.editor.setValue(d.value,d.cursorStart),this.editor.session.selection.fromJSON(a),this.silent=!1}d.placeholder!==n.placeholder&&this.updatePlaceholder(),d.mode!==n.mode&&this.editor.getSession().setMode(typeof d.mode=="string"?"ace/mode/".concat(d.mode):d.mode),d.theme!==n.theme&&this.editor.setTheme("ace/theme/"+d.theme),d.keyboardHandler!==n.keyboardHandler&&(d.keyboardHandler?this.editor.setKeyboardHandler("ace/keyboard/"+d.keyboardHandler):this.editor.setKeyboardHandler(null)),d.fontSize!==n.fontSize&&this.editor.setFontSize(typeof d.fontSize=="number"?"".concat(d.fontSize,"px"):d.fontSize),d.lineHeight!==n.lineHeight&&(this.editor.container.style.lineHeight=typeof d.lineHeight=="number"?"".concat(d.lineHeight,"px"):d.lineHeight,this.editor.renderer.updateFontSize()),d.wrapEnabled!==n.wrapEnabled&&this.editor.getSession().setUseWrapMode(d.wrapEnabled),d.showPrintMargin!==n.showPrintMargin&&this.editor.setShowPrintMargin(d.showPrintMargin),d.showGutter!==n.showGutter&&this.editor.renderer.setShowGutter(d.showGutter),pi(d.setOptions,n.setOptions)||this.handleOptions(d),(s||!pi(d.annotations,n.annotations))&&this.editor.getSession().setAnnotations(d.annotations||[]),!pi(d.markers,n.markers)&&Array.isArray(d.markers)&&this.handleMarkers(d.markers),pi(d.scrollMargin,n.scrollMargin)||this.handleScrollMargins(d.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),d=0;d<n.length;d++)this.editor.setOption(n[d],t.setOptions[n[d]])},e.prototype.handleMarkers=function(t){var n=this,d=this.editor.getSession().getMarkers(!0);for(var i in d)d.hasOwnProperty(i)&&this.editor.getSession().removeMarker(d[i].id);d=this.editor.getSession().getMarkers(!1);for(var i in d)d.hasOwnProperty(i)&&d[i].clazz!=="ace_active-line"&&d[i].clazz!=="ace_selected-word"&&this.editor.getSession().removeMarker(d[i].id);t.forEach(function(r){var p=r.startRow,o=r.startCol,l=r.endRow,s=r.endCol,a=r.className,c=r.type,u=r.inFront,h=u===void 0?!1:u,f=new au.Range(p,o,l,s);n.editor.getSession().addMarker(f,a,c,h)})},e.prototype.updatePlaceholder=function(){var t=this.editor,n=this.props.placeholder,d=!t.session.getValue().length,i=t.renderer.placeholderNode;!d&&i?(t.renderer.scroller.removeChild(t.renderer.placeholderNode),t.renderer.placeholderNode=null):d&&!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)):d&&i&&(i.textContent=n)},e.prototype.updateRef=function(t){this.refEditor=t},e.prototype.render=function(){var t=this.props,n=t.name,d=t.width,i=t.height,r=t.style,p=Ts({width:d,height:i},r);return Hr.createElement("div",{ref:this.updateRef,id:n,style:p})},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})(Hr.Component);Gt.default=lu;var Kn={},Mt={},Go={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,d){var i=t("./lib/oop");t("./lib/lang");var r=t("./lib/event_emitter").EventEmitter,p=t("./editor").Editor,o=t("./virtual_renderer").VirtualRenderer,l=t("./edit_session").EditSession,s;s=function(a,c,u){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(u||1),this.$cEditor=this.$editors[0],this.on("focus",function(h){this.$cEditor=h}.bind(this))},(function(){i.implement(this,r),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 p(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()),u=a.getUndoManager();return c.setUndoManager(u),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 u;c==null?u=this.$cEditor:u=this.$editors[c];var h=this.$editors.some(function(f){return f.session===a});return h&&(a=this.$cloneSession(a)),u.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,u;if(this.$orientation==this.BESIDE)for(var h=a/this.$splits,f=0;f<this.$splits;f++)u=this.$editors[f],u.container.style.width=h+"px",u.container.style.top="0px",u.container.style.left=f*h+"px",u.container.style.height=c+"px",u.resize();else for(var g=c/this.$splits,f=0;f<this.$splits;f++)u=this.$editors[f],u.container.style.width=a+"px",u.container.style.top=f*g+"px",u.container.style.left="0px",u.container.style.height=g+"px",u.resize()}}).call(s.prototype),n.Split=s}),ace.define("ace/ext/split",["require","exports","module","ace/ext/split","ace/split"],function(t,n,d){d.exports=t("../split")}),(function(){ace.require(["ace/ext/split"],function(t){m&&(m.exports=t)})})()})(Go);var cu=Go.exports,hu="Expected a function",Jo="__lodash_hash_undefined__",uu="[object Function]",du="[object GeneratorFunction]",pu="[object Symbol]",fu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gu=/^\w*$/,mu=/^\./,vu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yu=/[\\^$.*+?()[\]{}|]/g,bu=/\\(\\)?/g,wu=/^\[object .+?Constructor\]$/,Cu=typeof Ge=="object"&&Ge&&Ge.Object===Object&&Ge,Eu=typeof self=="object"&&self&&self.Object===Object&&self,Xs=Cu||Eu||Function("return this")();function Su(m,e){return m==null?void 0:m[e]}function Du(m){var e=!1;if(m!=null&&typeof m.toString!="function")try{e=!!(m+"")}catch{}return e}var Au=Array.prototype,$u=Function.prototype,Yo=Object.prototype,ds=Xs["__core-js_shared__"],Ur=(function(){var m=/[^.]+$/.exec(ds&&ds.keys&&ds.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""})(),Qo=$u.toString,Zs=Yo.hasOwnProperty,Xo=Yo.toString,xu=RegExp("^"+Qo.call(Zs).replace(yu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kr=Xs.Symbol,_u=Au.splice,ku=Zo(Xs,"Map"),Gn=Zo(Object,"create"),Gr=Kr?Kr.prototype:void 0,Jr=Gr?Gr.toString:void 0;function Jt(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 Tu(){this.__data__=Gn?Gn(null):{}}function Lu(m){return this.has(m)&&delete this.__data__[m]}function Mu(m){var e=this.__data__;if(Gn){var t=e[m];return t===Jo?void 0:t}return Zs.call(e,m)?e[m]:void 0}function Iu(m){var e=this.__data__;return Gn?e[m]!==void 0:Zs.call(e,m)}function Ou(m,e){var t=this.__data__;return t[m]=Gn&&e===void 0?Jo:e,this}Jt.prototype.clear=Tu;Jt.prototype.delete=Lu;Jt.prototype.get=Mu;Jt.prototype.has=Iu;Jt.prototype.set=Ou;function Cn(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 Fu(){this.__data__=[]}function Ru(m){var e=this.__data__,t=ji(e,m);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():_u.call(e,t,1),!0}function Nu(m){var e=this.__data__,t=ji(e,m);return t<0?void 0:e[t][1]}function Bu(m){return ji(this.__data__,m)>-1}function Pu(m,e){var t=this.__data__,n=ji(t,m);return n<0?t.push([m,e]):t[n][1]=e,this}Cn.prototype.clear=Fu;Cn.prototype.delete=Ru;Cn.prototype.get=Nu;Cn.prototype.has=Bu;Cn.prototype.set=Pu;function Xt(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 Wu(){this.__data__={hash:new Jt,map:new(ku||Cn),string:new Jt}}function ju(m){return zi(this,m).delete(m)}function zu(m){return zi(this,m).get(m)}function Hu(m){return zi(this,m).has(m)}function Vu(m,e){return zi(this,m).set(m,e),this}Xt.prototype.clear=Wu;Xt.prototype.delete=ju;Xt.prototype.get=zu;Xt.prototype.has=Hu;Xt.prototype.set=Vu;function ji(m,e){for(var t=m.length;t--;)if(td(m[t][0],e))return t;return-1}function Uu(m,e){e=Yu(e,m)?[e]:Ju(e);for(var t=0,n=e.length;m!=null&&t<n;)m=m[qu(e[t++])];return t&&t==n?m:void 0}function Ku(m){if(!ea(m)||Xu(m))return!1;var e=nd(m)||Du(m)?xu:wu;return e.test(ed(m))}function Gu(m){if(typeof m=="string")return m;if(er(m))return Jr?Jr.call(m):"";var e=m+"";return e=="0"&&1/m==-1/0?"-0":e}function Ju(m){return qo(m)?m:Zu(m)}function zi(m,e){var t=m.__data__;return Qu(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Zo(m,e){var t=Su(m,e);return Ku(t)?t:void 0}function Yu(m,e){if(qo(m))return!1;var t=typeof m;return t=="number"||t=="symbol"||t=="boolean"||m==null||er(m)?!0:gu.test(m)||!fu.test(m)||e!=null&&m in Object(e)}function Qu(m){var e=typeof m;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?m!=="__proto__":m===null}function Xu(m){return!!Ur&&Ur in m}var Zu=qs(function(m){m=sd(m);var e=[];return mu.test(m)&&e.push(""),m.replace(vu,function(t,n,d,i){e.push(d?i.replace(bu,"$1"):n||t)}),e});function qu(m){if(typeof m=="string"||er(m))return m;var e=m+"";return e=="0"&&1/m==-1/0?"-0":e}function ed(m){if(m!=null){try{return Qo.call(m)}catch{}try{return m+""}catch{}}return""}function qs(m,e){if(typeof m!="function"||e&&typeof e!="function")throw new TypeError(hu);var t=function(){var n=arguments,d=e?e.apply(this,n):n[0],i=t.cache;if(i.has(d))return i.get(d);var r=m.apply(this,n);return t.cache=i.set(d,r),r};return t.cache=new(qs.Cache||Xt),t}qs.Cache=Xt;function td(m,e){return m===e||m!==m&&e!==e}var qo=Array.isArray;function nd(m){var e=ea(m)?Xo.call(m):"";return e==uu||e==du}function ea(m){var e=typeof m;return!!m&&(e=="object"||e=="function")}function id(m){return!!m&&typeof m=="object"}function er(m){return typeof m=="symbol"||id(m)&&Xo.call(m)==pu}function sd(m){return m==null?"":Gu(m)}function rd(m,e,t){var n=m==null?void 0:Uu(m,e);return n===void 0?t:n}var od=rd,ad=Mt&&Mt.__extends||(function(){var m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,d){n.__proto__=d}||function(n,d){for(var i in d)Object.prototype.hasOwnProperty.call(d,i)&&(n[i]=d[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)}})(),Ls=Mt&&Mt.__assign||function(){return Ls=Object.assign||function(m){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var d in e)Object.prototype.hasOwnProperty.call(e,d)&&(m[d]=e[d])}return m},Ls.apply(this,arguments)};Object.defineProperty(Mt,"__esModule",{value:!0});var jt=st,ps=(0,jt.getAceInstance)(),ld=Oi,cd=cu,ie=Gs,Yr=Bs,fs=Ko,pt=od,hd=(function(m){ad(e,m);function e(t){var n=m.call(this,t)||this;return jt.editorEvents.forEach(function(d){n[d]=n[d].bind(n)}),n.debounce=jt.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,d=n.className,i=n.onBeforeLoad,r=n.mode,p=n.focus,o=n.theme,l=n.fontSize,s=n.value,a=n.defaultValue,c=n.cursorStart,u=n.showGutter,h=n.wrapEnabled,f=n.showPrintMargin,g=n.scrollMargin,v=g===void 0?[0,0,0,0]:g,b=n.keyboardHandler,A=n.onLoad,S=n.commands,w=n.annotations,y=n.markers,D=n.splits;this.editor=ps.edit(this.refEditor),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.setTheme("ace/theme/".concat(o)),i&&i(ps);var T=Object.keys(this.props.editorProps),$=new cd.Split(this.editor.container,"ace/theme/".concat(o),D);this.editor.env.split=$,this.splitEditor=$.getEditor(0),this.split=$,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)),$.forEach(function(x,k){for(var E=0;E<T.length;E++)x[T[E]]=t.props.editorProps[T[E]];var C=pt(a,k),L=pt(s,k,"");x.session.setUndoManager(new ps.UndoManager),x.setTheme("ace/theme/".concat(o)),x.renderer.setScrollMargin(v[0],v[1],v[2],v[3]),x.getSession().setMode("ace/mode/".concat(r)),x.setFontSize(l),x.renderer.setShowGutter(u),x.getSession().setUseWrapMode(h),x.setShowPrintMargin(f),x.on("focus",t.onFocus),x.on("blur",t.onBlur),x.on("input",t.onInput),x.on("copy",t.onCopy),x.on("paste",t.onPaste),x.on("change",t.onChange),x.getSession().selection.on("changeSelection",t.onSelectionChange),x.getSession().selection.on("changeCursor",t.onCursorChange),x.session.on("changeScrollTop",t.onScroll),x.setValue(C===void 0?L:C,c);var I=pt(w,k,[]),F=pt(y,k,[]);x.getSession().setAnnotations(I),F&&F.length>0&&t.handleMarkers(F,x);for(var E=0;E<jt.editorOptions.length;E++){var R=jt.editorOptions[E];M.hasOwnProperty(R)?x.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,x),Array.isArray(S)&&S.forEach(function(B){typeof B.exec=="string"?x.commands.bindKey(B.bindKey,B.exec):x.commands.addCommand(B)}),b&&x.setKeyboardHandler("ace/keyboard/"+b)}),d&&(this.refEditor.className+=" "+d),p&&this.splitEditor.focus();var O=this.editor.env.split;O.setOrientation(this.props.orientation==="below"?O.BELOW:O.BESIDE),O.resize(!0),A&&A(O)},e.prototype.componentDidUpdate=function(t){var n=this,d=t,i=this.props,r=this.editor.env.split;if(i.splits!==d.splits&&r.setSplits(i.splits),i.orientation!==d.orientation&&r.setOrientation(i.orientation==="below"?r.BELOW:r.BESIDE),r.forEach(function(s,a){i.mode!==d.mode&&s.getSession().setMode("ace/mode/"+i.mode),i.keyboardHandler!==d.keyboardHandler&&(i.keyboardHandler?s.setKeyboardHandler("ace/keyboard/"+i.keyboardHandler):s.setKeyboardHandler(null)),i.fontSize!==d.fontSize&&s.setFontSize(i.fontSize),i.wrapEnabled!==d.wrapEnabled&&s.getSession().setUseWrapMode(i.wrapEnabled),i.showPrintMargin!==d.showPrintMargin&&s.setShowPrintMargin(i.showPrintMargin),i.showGutter!==d.showGutter&&s.renderer.setShowGutter(i.showGutter);for(var c=0;c<jt.editorOptions.length;c++){var u=jt.editorOptions[c];i[u]!==d[u]&&s.setOption(u,i[u])}fs(i.setOptions,d.setOptions)||n.handleOptions(i,s);var h=pt(i.value,a,"");if(s.getValue()!==h){n.silent=!0;var f=s.session.selection.toJSON();s.setValue(h,i.cursorStart),s.session.selection.fromJSON(f),n.silent=!1}var g=pt(i.annotations,a,[]),v=pt(d.annotations,a,[]);fs(g,v)||s.getSession().setAnnotations(g);var b=pt(i.markers,a,[]),A=pt(d.markers,a,[]);!fs(b,A)&&Array.isArray(b)&&n.handleMarkers(b,s)}),i.className!==d.className){var p=this.refEditor.className,o=p.trim().split(" "),l=d.className.trim().split(" ");l.forEach(function(s){var a=o.indexOf(s);o.splice(a,1)}),this.refEditor.className=" "+i.className+" "+o.join(" ")}i.theme!==d.theme&&r.setTheme("ace/theme/"+i.theme),i.focus&&!d.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(d){n.push(d.getValue())}),this.props.onChange(n,t)}},e.prototype.onSelectionChange=function(t){if(this.props.onSelectionChange){var n=[];this.editor.env.split.forEach(function(d){n.push(d.getSelection())}),this.props.onSelectionChange(n,t)}},e.prototype.onCursorChange=function(t){if(this.props.onCursorChange){var n=[];this.editor.env.split.forEach(function(d){n.push(d.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 d=Object.keys(t.setOptions),i=0;i<d.length;i++)n.setOption(d[i],t.setOptions[d[i]])},e.prototype.handleMarkers=function(t,n){var d=n.getSession().getMarkers(!0);for(var i in d)d.hasOwnProperty(i)&&n.getSession().removeMarker(d[i].id);d=n.getSession().getMarkers(!1);for(var i in d)d.hasOwnProperty(i)&&n.getSession().removeMarker(d[i].id);t.forEach(function(r){var p=r.startRow,o=r.startCol,l=r.endRow,s=r.endCol,a=r.className,c=r.type,u=r.inFront,h=u===void 0?!1:u,f=new ld.Range(p,o,l,s);n.getSession().addMarker(f,a,c,h)})},e.prototype.updateRef=function(t){this.refEditor=t},e.prototype.render=function(){var t=this.props,n=t.name,d=t.width,i=t.height,r=t.style,p=Ls({width:d,height:i},r);return Yr.createElement("div",{ref:this.updateRef,id:n,style:p})},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})(Yr.Component);Mt.default=hd;var ta={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,d=0;e.Diff=function(i,r){return[i,r]},e.prototype.diff_main=function(i,r,p,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||r==null)throw new Error("Null input. (diff_main)");if(i==r)return i?[new e.Diff(d,i)]:[];typeof p>"u"&&(p=!0);var s=p,a=this.diff_commonPrefix(i,r),c=i.substring(0,a);i=i.substring(a),r=r.substring(a),a=this.diff_commonSuffix(i,r);var u=i.substring(i.length-a);i=i.substring(0,i.length-a),r=r.substring(0,r.length-a);var h=this.diff_compute_(i,r,s,l);return c&&h.unshift(new e.Diff(d,c)),u&&h.push(new e.Diff(d,u)),this.diff_cleanupMerge(h),h},e.prototype.diff_compute_=function(i,r,p,o){var l;if(!i)return[new e.Diff(n,r)];if(!r)return[new e.Diff(t,i)];var s=i.length>r.length?i:r,a=i.length>r.length?r:i,c=s.indexOf(a);if(c!=-1)return l=[new e.Diff(n,s.substring(0,c)),new e.Diff(d,a),new e.Diff(n,s.substring(c+a.length))],i.length>r.length&&(l[0][0]=l[2][0]=t),l;if(a.length==1)return[new e.Diff(t,i),new e.Diff(n,r)];var u=this.diff_halfMatch_(i,r);if(u){var h=u[0],f=u[1],g=u[2],v=u[3],b=u[4],A=this.diff_main(h,g,p,o),S=this.diff_main(f,v,p,o);return A.concat([new e.Diff(d,b)],S)}return p&&i.length>100&&r.length>100?this.diff_lineMode_(i,r,o):this.diff_bisect_(i,r,o)},e.prototype.diff_lineMode_=function(i,r,p){var o=this.diff_linesToChars_(i,r);i=o.chars1,r=o.chars2;var l=o.lineArray,s=this.diff_main(i,r,!1,p);this.diff_charsToLines_(s,l),this.diff_cleanupSemantic(s),s.push(new e.Diff(d,""));for(var a=0,c=0,u=0,h="",f="";a<s.length;){switch(s[a][0]){case n:u++,f+=s[a][1];break;case t:c++,h+=s[a][1];break;case d:if(c>=1&&u>=1){s.splice(a-c-u,c+u),a=a-c-u;for(var g=this.diff_main(h,f,!1,p),v=g.length-1;v>=0;v--)s.splice(a,0,g[v]);a=a+g.length}u=0,c=0,h="",f="";break}a++}return s.pop(),s},e.prototype.diff_bisect_=function(i,r,p){for(var o=i.length,l=r.length,s=Math.ceil((o+l)/2),a=s,c=2*s,u=new Array(c),h=new Array(c),f=0;f<c;f++)u[f]=-1,h[f]=-1;u[a+1]=0,h[a+1]=0;for(var g=o-l,v=g%2!=0,b=0,A=0,S=0,w=0,y=0;y<s&&!(new Date().getTime()>p);y++){for(var D=-y+b;D<=y-A;D+=2){var T=a+D,$;D==-y||D!=y&&u[T-1]<u[T+1]?$=u[T+1]:$=u[T-1]+1;for(var M=$-D;$<o&&M<l&&i.charAt($)==r.charAt(M);)$++,M++;if(u[T]=$,$>o)A+=2;else if(M>l)b+=2;else if(v){var O=a+g-D;if(O>=0&&O<c&&h[O]!=-1){var x=o-h[O];if($>=x)return this.diff_bisectSplit_(i,r,$,M,p)}}}for(var k=-y+S;k<=y-w;k+=2){var O=a+k,x;k==-y||k!=y&&h[O-1]<h[O+1]?x=h[O+1]:x=h[O-1]+1;for(var E=x-k;x<o&&E<l&&i.charAt(o-x-1)==r.charAt(l-E-1);)x++,E++;if(h[O]=x,x>o)w+=2;else if(E>l)S+=2;else if(!v){var T=a+g-k;if(T>=0&&T<c&&u[T]!=-1){var $=u[T],M=a+$-T;if(x=o-x,$>=x)return this.diff_bisectSplit_(i,r,$,M,p)}}}}return[new e.Diff(t,i),new e.Diff(n,r)]},e.prototype.diff_bisectSplit_=function(i,r,p,o,l){var s=i.substring(0,p),a=r.substring(0,o),c=i.substring(p),u=r.substring(o),h=this.diff_main(s,a,!1,l),f=this.diff_main(c,u,!1,l);return h.concat(f)},e.prototype.diff_linesToChars_=function(i,r){var p=[],o={};p[0]="";function l(u){for(var h="",f=0,g=-1,v=p.length;g<u.length-1;){g=u.indexOf(`
994
+ `,f),g==-1&&(g=u.length-1);var b=u.substring(f,g+1);(o.hasOwnProperty?o.hasOwnProperty(b):o[b]!==void 0)?h+=String.fromCharCode(o[b]):(v==s&&(b=u.substring(f),g=u.length),h+=String.fromCharCode(v),o[b]=v,p[v++]=b),f=g+1}return h}var s=4e4,a=l(i);s=65535;var c=l(r);return{chars1:a,chars2:c,lineArray:p}},e.prototype.diff_charsToLines_=function(i,r){for(var p=0;p<i.length;p++){for(var o=i[p][1],l=[],s=0;s<o.length;s++)l[s]=r[o.charCodeAt(s)];i[p][1]=l.join("")}},e.prototype.diff_commonPrefix=function(i,r){if(!i||!r||i.charAt(0)!=r.charAt(0))return 0;for(var p=0,o=Math.min(i.length,r.length),l=o,s=0;p<l;)i.substring(s,l)==r.substring(s,l)?(p=l,s=p):o=l,l=Math.floor((o-p)/2+p);return l},e.prototype.diff_commonSuffix=function(i,r){if(!i||!r||i.charAt(i.length-1)!=r.charAt(r.length-1))return 0;for(var p=0,o=Math.min(i.length,r.length),l=o,s=0;p<l;)i.substring(i.length-l,i.length-s)==r.substring(r.length-l,r.length-s)?(p=l,s=p):o=l,l=Math.floor((o-p)/2+p);return l},e.prototype.diff_commonOverlap_=function(i,r){var p=i.length,o=r.length;if(p==0||o==0)return 0;p>o?i=i.substring(p-o):p<o&&(r=r.substring(0,p));var l=Math.min(p,o);if(i==r)return l;for(var s=0,a=1;;){var c=i.substring(l-a),u=r.indexOf(c);if(u==-1)return s;a+=u,(u==0||i.substring(l-a)==r.substring(0,a))&&(s=a,a++)}},e.prototype.diff_halfMatch_=function(i,r){if(this.Diff_Timeout<=0)return null;var p=i.length>r.length?i:r,o=i.length>r.length?r:i;if(p.length<4||o.length*2<p.length)return null;var l=this;function s(A,S,w){for(var y=A.substring(w,w+Math.floor(A.length/4)),D=-1,T="",$,M,O,x;(D=S.indexOf(y,D+1))!=-1;){var k=l.diff_commonPrefix(A.substring(w),S.substring(D)),E=l.diff_commonSuffix(A.substring(0,w),S.substring(0,D));T.length<E+k&&(T=S.substring(D-E,D)+S.substring(D,D+k),$=A.substring(0,w-E),M=A.substring(w+k),O=S.substring(0,D-E),x=S.substring(D+k))}return T.length*2>=A.length?[$,M,O,x,T]:null}var a=s(p,o,Math.ceil(p.length/4)),c=s(p,o,Math.ceil(p.length/2)),u;if(!a&&!c)return null;c?a?u=a[4].length>c[4].length?a:c:u=c:u=a;var h,f,g,v;i.length>r.length?(h=u[0],f=u[1],g=u[2],v=u[3]):(g=u[0],v=u[1],h=u[2],f=u[3]);var b=u[4];return[h,f,g,v,b]},e.prototype.diff_cleanupSemantic=function(i){for(var r=!1,p=[],o=0,l=null,s=0,a=0,c=0,u=0,h=0;s<i.length;)i[s][0]==d?(p[o++]=s,a=u,c=h,u=0,h=0,l=i[s][1]):(i[s][0]==n?u+=i[s][1].length:h+=i[s][1].length,l&&l.length<=Math.max(a,c)&&l.length<=Math.max(u,h)&&(i.splice(p[o-1],0,new e.Diff(t,l)),i[p[o-1]+1][0]=n,o--,o--,s=o>0?p[o-1]:-1,a=0,c=0,u=0,h=0,l=null,r=!0)),s++;for(r&&this.diff_cleanupMerge(i),this.diff_cleanupSemanticLossless(i),s=1;s<i.length;){if(i[s-1][0]==t&&i[s][0]==n){var f=i[s-1][1],g=i[s][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(s,0,new e.Diff(d,g.substring(0,v))),i[s-1][1]=f.substring(0,f.length-v),i[s+1][1]=g.substring(v),s++):(b>=f.length/2||b>=g.length/2)&&(i.splice(s,0,new e.Diff(d,f.substring(0,b))),i[s-1][0]=n,i[s-1][1]=g.substring(0,g.length-b),i[s+1][0]=t,i[s+1][1]=f.substring(b),s++),s++}s++}},e.prototype.diff_cleanupSemanticLossless=function(i){function r(b,A){if(!b||!A)return 6;var S=b.charAt(b.length-1),w=A.charAt(0),y=S.match(e.nonAlphaNumericRegex_),D=w.match(e.nonAlphaNumericRegex_),T=y&&S.match(e.whitespaceRegex_),$=D&&w.match(e.whitespaceRegex_),M=T&&S.match(e.linebreakRegex_),O=$&&w.match(e.linebreakRegex_),x=M&&b.match(e.blanklineEndRegex_),k=O&&A.match(e.blanklineStartRegex_);return x||k?5:M||O?4:y&&!T&&$?3:T||$?2:y||D?1:0}for(var p=1;p<i.length-1;){if(i[p-1][0]==d&&i[p+1][0]==d){var o=i[p-1][1],l=i[p][1],s=i[p+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),s=c+s}for(var u=o,h=l,f=s,g=r(o,l)+r(l,s);l.charAt(0)===s.charAt(0);){o+=l.charAt(0),l=l.substring(1)+s.charAt(0),s=s.substring(1);var v=r(o,l)+r(l,s);v>=g&&(g=v,u=o,h=l,f=s)}i[p-1][1]!=u&&(u?i[p-1][1]=u:(i.splice(p-1,1),p--),i[p][1]=h,f?i[p+1][1]=f:(i.splice(p+1,1),p--))}p++}},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 r=!1,p=[],o=0,l=null,s=0,a=!1,c=!1,u=!1,h=!1;s<i.length;)i[s][0]==d?(i[s][1].length<this.Diff_EditCost&&(u||h)?(p[o++]=s,a=u,c=h,l=i[s][1]):(o=0,l=null),u=h=!1):(i[s][0]==t?h=!0:u=!0,l&&(a&&c&&u&&h||l.length<this.Diff_EditCost/2&&a+c+u+h==3)&&(i.splice(p[o-1],0,new e.Diff(t,l)),i[p[o-1]+1][0]=n,o--,l=null,a&&c?(u=h=!0,o=0):(o--,s=o>0?p[o-1]:-1,u=h=!1),r=!0)),s++;r&&this.diff_cleanupMerge(i)},e.prototype.diff_cleanupMerge=function(i){i.push(new e.Diff(d,""));for(var r=0,p=0,o=0,l="",s="",a;r<i.length;)switch(i[r][0]){case n:o++,s+=i[r][1],r++;break;case t:p++,l+=i[r][1],r++;break;case d:p+o>1?(p!==0&&o!==0&&(a=this.diff_commonPrefix(s,l),a!==0&&(r-p-o>0&&i[r-p-o-1][0]==d?i[r-p-o-1][1]+=s.substring(0,a):(i.splice(0,0,new e.Diff(d,s.substring(0,a))),r++),s=s.substring(a),l=l.substring(a)),a=this.diff_commonSuffix(s,l),a!==0&&(i[r][1]=s.substring(s.length-a)+i[r][1],s=s.substring(0,s.length-a),l=l.substring(0,l.length-a))),r-=p+o,i.splice(r,p+o),l.length&&(i.splice(r,0,new e.Diff(t,l)),r++),s.length&&(i.splice(r,0,new e.Diff(n,s)),r++),r++):r!==0&&i[r-1][0]==d?(i[r-1][1]+=i[r][1],i.splice(r,1)):r++,o=0,p=0,l="",s="";break}i[i.length-1][1]===""&&i.pop();var c=!1;for(r=1;r<i.length-1;)i[r-1][0]==d&&i[r+1][0]==d&&(i[r][1].substring(i[r][1].length-i[r-1][1].length)==i[r-1][1]?(i[r][1]=i[r-1][1]+i[r][1].substring(0,i[r][1].length-i[r-1][1].length),i[r+1][1]=i[r-1][1]+i[r+1][1],i.splice(r-1,1),c=!0):i[r][1].substring(0,i[r+1][1].length)==i[r+1][1]&&(i[r-1][1]+=i[r+1][1],i[r][1]=i[r][1].substring(i[r+1][1].length)+i[r+1][1],i.splice(r+1,1),c=!0)),r++;c&&this.diff_cleanupMerge(i)},e.prototype.diff_xIndex=function(i,r){var p=0,o=0,l=0,s=0,a;for(a=0;a<i.length&&(i[a][0]!==n&&(p+=i[a][1].length),i[a][0]!==t&&(o+=i[a][1].length),!(p>r));a++)l=p,s=o;return i.length!=a&&i[a][0]===t?s:s+(r-l)},e.prototype.diff_prettyHtml=function(i){for(var r=[],p=/&/g,o=/</g,l=/>/g,s=/\n/g,a=0;a<i.length;a++){var c=i[a][0],u=i[a][1],h=u.replace(p,"&amp;").replace(o,"&lt;").replace(l,"&gt;").replace(s,"&para;<br>");switch(c){case n:r[a]='<ins style="background:#e6ffe6;">'+h+"</ins>";break;case t:r[a]='<del style="background:#ffe6e6;">'+h+"</del>";break;case d:r[a]="<span>"+h+"</span>";break}}return r.join("")},e.prototype.diff_text1=function(i){for(var r=[],p=0;p<i.length;p++)i[p][0]!==n&&(r[p]=i[p][1]);return r.join("")},e.prototype.diff_text2=function(i){for(var r=[],p=0;p<i.length;p++)i[p][0]!==t&&(r[p]=i[p][1]);return r.join("")},e.prototype.diff_levenshtein=function(i){for(var r=0,p=0,o=0,l=0;l<i.length;l++){var s=i[l][0],a=i[l][1];switch(s){case n:p+=a.length;break;case t:o+=a.length;break;case d:r+=Math.max(p,o),p=0,o=0;break}}return r+=Math.max(p,o),r},e.prototype.diff_toDelta=function(i){for(var r=[],p=0;p<i.length;p++)switch(i[p][0]){case n:r[p]="+"+encodeURI(i[p][1]);break;case t:r[p]="-"+i[p][1].length;break;case d:r[p]="="+i[p][1].length;break}return r.join(" ").replace(/%20/g," ")},e.prototype.diff_fromDelta=function(i,r){for(var p=[],o=0,l=0,s=r.split(/\t/g),a=0;a<s.length;a++){var c=s[a].substring(1);switch(s[a].charAt(0)){case"+":try{p[o++]=new e.Diff(n,decodeURI(c))}catch{throw new Error("Illegal escape in diff_fromDelta: "+c)}break;case"-":case"=":var u=parseInt(c,10);if(isNaN(u)||u<0)throw new Error("Invalid number in diff_fromDelta: "+c);var h=i.substring(l,l+=u);s[a].charAt(0)=="="?p[o++]=new e.Diff(d,h):p[o++]=new e.Diff(t,h);break;default:if(s[a])throw new Error("Invalid diff operation in diff_fromDelta: "+s[a])}}if(l!=i.length)throw new Error("Delta length ("+l+") does not equal source text length ("+i.length+").");return p},e.prototype.match_main=function(i,r,p){if(i==null||r==null||p==null)throw new Error("Null input. (match_main)");return p=Math.max(0,Math.min(p,i.length)),i==r?0:i.length?i.substring(p,p+r.length)==r?p:this.match_bitap_(i,r,p):-1},e.prototype.match_bitap_=function(i,r,p){if(r.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var o=this.match_alphabet_(r),l=this;function s($,M){var O=$/r.length,x=Math.abs(p-M);return l.Match_Distance?O+x/l.Match_Distance:x?1:O}var a=this.Match_Threshold,c=i.indexOf(r,p);c!=-1&&(a=Math.min(s(0,c),a),c=i.lastIndexOf(r,p+r.length),c!=-1&&(a=Math.min(s(0,c),a)));var u=1<<r.length-1;c=-1;for(var h,f,g=r.length+i.length,v,b=0;b<r.length;b++){for(h=0,f=g;h<f;)s(b,p+f)<=a?h=f:g=f,f=Math.floor((g-h)/2+h);g=f;var A=Math.max(1,p-f+1),S=Math.min(p+f,i.length)+r.length,w=Array(S+2);w[S+1]=(1<<b)-1;for(var y=S;y>=A;y--){var D=o[i.charAt(y-1)];if(b===0?w[y]=(w[y+1]<<1|1)&D:w[y]=(w[y+1]<<1|1)&D|((v[y+1]|v[y])<<1|1)|v[y+1],w[y]&u){var T=s(b,y-1);if(T<=a)if(a=T,c=y-1,c>p)A=Math.max(1,2*p-c);else break}}if(s(b+1,p)>a)break;v=w}return c},e.prototype.match_alphabet_=function(i){for(var r={},p=0;p<i.length;p++)r[i.charAt(p)]=0;for(var p=0;p<i.length;p++)r[i.charAt(p)]|=1<<i.length-p-1;return r},e.prototype.patch_addContext_=function(i,r){if(r.length!=0){if(i.start2===null)throw Error("patch not initialized");for(var p=r.substring(i.start2,i.start2+i.length1),o=0;r.indexOf(p)!=r.lastIndexOf(p)&&p.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,p=r.substring(i.start2-o,i.start2+i.length1+o);o+=this.Patch_Margin;var l=r.substring(i.start2-o,i.start2);l&&i.diffs.unshift(new e.Diff(d,l));var s=r.substring(i.start2+i.length1,i.start2+i.length1+o);s&&i.diffs.push(new e.Diff(d,s)),i.start1-=l.length,i.start2-=l.length,i.length1+=l.length+s.length,i.length2+=l.length+s.length}},e.prototype.patch_make=function(i,r,p){var o,l;if(typeof i=="string"&&typeof r=="string"&&typeof p>"u")o=i,l=this.diff_main(o,r,!0),l.length>2&&(this.diff_cleanupSemantic(l),this.diff_cleanupEfficiency(l));else if(i&&typeof i=="object"&&typeof r>"u"&&typeof p>"u")l=i,o=this.diff_text1(l);else if(typeof i=="string"&&r&&typeof r=="object"&&typeof p>"u")o=i,l=r;else if(typeof i=="string"&&typeof r=="string"&&p&&typeof p=="object")o=i,l=p;else throw new Error("Unknown call format to patch_make.");if(l.length===0)return[];for(var s=[],a=new e.patch_obj,c=0,u=0,h=0,f=o,g=o,v=0;v<l.length;v++){var b=l[v][0],A=l[v][1];switch(!c&&b!==d&&(a.start1=u,a.start2=h),b){case n:a.diffs[c++]=l[v],a.length2+=A.length,g=g.substring(0,h)+A+g.substring(h);break;case t:a.length1+=A.length,a.diffs[c++]=l[v],g=g.substring(0,h)+g.substring(h+A.length);break;case d:A.length<=2*this.Patch_Margin&&c&&l.length!=v+1?(a.diffs[c++]=l[v],a.length1+=A.length,a.length2+=A.length):A.length>=2*this.Patch_Margin&&c&&(this.patch_addContext_(a,f),s.push(a),a=new e.patch_obj,c=0,f=g,u=h);break}b!==n&&(u+=A.length),b!==t&&(h+=A.length)}return c&&(this.patch_addContext_(a,f),s.push(a)),s},e.prototype.patch_deepCopy=function(i){for(var r=[],p=0;p<i.length;p++){var o=i[p],l=new e.patch_obj;l.diffs=[];for(var s=0;s<o.diffs.length;s++)l.diffs[s]=new e.Diff(o.diffs[s][0],o.diffs[s][1]);l.start1=o.start1,l.start2=o.start2,l.length1=o.length1,l.length2=o.length2,r[p]=l}return r},e.prototype.patch_apply=function(i,r){if(i.length==0)return[r,[]];i=this.patch_deepCopy(i);var p=this.patch_addPadding(i);r=p+r+p,this.patch_splitMax(i);for(var o=0,l=[],s=0;s<i.length;s++){var a=i[s].start2+o,c=this.diff_text1(i[s].diffs),u,h=-1;if(c.length>this.Match_MaxBits?(u=this.match_main(r,c.substring(0,this.Match_MaxBits),a),u!=-1&&(h=this.match_main(r,c.substring(c.length-this.Match_MaxBits),a+c.length-this.Match_MaxBits),(h==-1||u>=h)&&(u=-1))):u=this.match_main(r,c,a),u==-1)l[s]=!1,o-=i[s].length2-i[s].length1;else{l[s]=!0,o=u-a;var f;if(h==-1?f=r.substring(u,u+c.length):f=r.substring(u,h+this.Match_MaxBits),c==f)r=r.substring(0,u)+this.diff_text2(i[s].diffs)+r.substring(u+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[s]=!1;else{this.diff_cleanupSemanticLossless(g);for(var v=0,b,A=0;A<i[s].diffs.length;A++){var S=i[s].diffs[A];S[0]!==d&&(b=this.diff_xIndex(g,v)),S[0]===n?r=r.substring(0,u+b)+S[1]+r.substring(u+b):S[0]===t&&(r=r.substring(0,u+b)+r.substring(u+this.diff_xIndex(g,v+S[1].length))),S[0]!==t&&(v+=S[1].length)}}}}}return r=r.substring(p.length,r.length-p.length),[r,l]},e.prototype.patch_addPadding=function(i){for(var r=this.Patch_Margin,p="",o=1;o<=r;o++)p+=String.fromCharCode(o);for(var o=0;o<i.length;o++)i[o].start1+=r,i[o].start2+=r;var l=i[0],s=l.diffs;if(s.length==0||s[0][0]!=d)s.unshift(new e.Diff(d,p)),l.start1-=r,l.start2-=r,l.length1+=r,l.length2+=r;else if(r>s[0][1].length){var a=r-s[0][1].length;s[0][1]=p.substring(s[0][1].length)+s[0][1],l.start1-=a,l.start2-=a,l.length1+=a,l.length2+=a}if(l=i[i.length-1],s=l.diffs,s.length==0||s[s.length-1][0]!=d)s.push(new e.Diff(d,p)),l.length1+=r,l.length2+=r;else if(r>s[s.length-1][1].length){var a=r-s[s.length-1][1].length;s[s.length-1][1]+=p.substring(0,a),l.length1+=a,l.length2+=a}return p},e.prototype.patch_splitMax=function(i){for(var r=this.Match_MaxBits,p=0;p<i.length;p++)if(!(i[p].length1<=r)){var o=i[p];i.splice(p--,1);for(var l=o.start1,s=o.start2,a="";o.diffs.length!==0;){var c=new e.patch_obj,u=!0;for(c.start1=l-a.length,c.start2=s-a.length,a!==""&&(c.length1=c.length2=a.length,c.diffs.push(new e.Diff(d,a)));o.diffs.length!==0&&c.length1<r-this.Patch_Margin;){var h=o.diffs[0][0],f=o.diffs[0][1];h===n?(c.length2+=f.length,s+=f.length,c.diffs.push(o.diffs.shift()),u=!1):h===t&&c.diffs.length==1&&c.diffs[0][0]==d&&f.length>2*r?(c.length1+=f.length,l+=f.length,u=!1,c.diffs.push(new e.Diff(h,f)),o.diffs.shift()):(f=f.substring(0,r-c.length1-this.Patch_Margin),c.length1+=f.length,l+=f.length,h===d?(c.length2+=f.length,s+=f.length):u=!1,c.diffs.push(new e.Diff(h,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]===d?c.diffs[c.diffs.length-1][1]+=g:c.diffs.push(new e.Diff(d,g))),u||i.splice(++p,0,c)}}},e.prototype.patch_toText=function(i){for(var r=[],p=0;p<i.length;p++)r[p]=i[p];return r.join("")},e.prototype.patch_fromText=function(i){var r=[];if(!i)return r;for(var p=i.split(`
995
+ `),o=0,l=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<p.length;){var s=p[o].match(l);if(!s)throw new Error("Invalid patch string: "+p[o]);var a=new e.patch_obj;for(r.push(a),a.start1=parseInt(s[1],10),s[2]===""?(a.start1--,a.length1=1):s[2]=="0"?a.length1=0:(a.start1--,a.length1=parseInt(s[2],10)),a.start2=parseInt(s[3],10),s[4]===""?(a.start2--,a.length2=1):s[4]=="0"?a.length2=0:(a.start2--,a.length2=parseInt(s[4],10)),o++;o<p.length;){var c=p[o].charAt(0);try{var u=decodeURI(p[o].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+u)}if(c=="-")a.diffs.push(new e.Diff(t,u));else if(c=="+")a.diffs.push(new e.Diff(n,u));else if(c==" ")a.diffs.push(new e.Diff(d,u));else{if(c=="@")break;if(c!=="")throw new Error('Invalid patch mode "'+c+'" in: '+u)}o++}}return r},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,r;this.length1===0?i=this.start1+",0":this.length1==1?i=this.start1+1:i=this.start1+1+","+this.length1,this.length2===0?r=this.start2+",0":this.length2==1?r=this.start2+1:r=this.start2+1+","+this.length2;for(var p=["@@ -"+i+" +"+r+` @@
996
+ `],o,l=0;l<this.diffs.length;l++){switch(this.diffs[l][0]){case n:o="+";break;case t:o="-";break;case d:o=" ";break}p[l+1]=o+encodeURI(this.diffs[l][1])+`
997
+ `}return p.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=d})(ta);var ud=ta.exports,dd=Kn&&Kn.__extends||(function(){var m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,d){n.__proto__=d}||function(n,d){for(var i in d)Object.prototype.hasOwnProperty.call(d,i)&&(n[i]=d[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(Kn,"__esModule",{value:!0});var pe=Gs,Qr=Bs,pd=Mt,fd=ud,gd=(function(m){dd(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 fd,n=this.state.value[0],d=this.state.value[1];if(n.length===0&&d.length===0)return[];var i=t.diff_main(n,d);t.diff_cleanupSemantic(i);var r=this.generateDiffedLines(i),p=this.setCodeMarkers(r);return p},e.prototype.generateDiffedLines=function(t){var n={DIFF_EQUAL:0,DIFF_DELETE:-1,DIFF_INSERT:1},d={left:[],right:[]},i={left:1,right:1};return t.forEach(function(r){var p=r[0],o=r[1],l=o.split(`
998
+ `).length-1;if(o.length!==0){var s=o[0],a=o[o.length-1],c=0;switch(p){case n.DIFF_EQUAL:i.left+=l,i.right+=l;break;case n.DIFF_DELETE:s===`
999
+ `&&(i.left++,l--),c=l,c===0&&d.right.push({startLine:i.right,endLine:i.right}),a===`
1000
+ `&&(c-=1),d.left.push({startLine:i.left,endLine:i.left+c}),i.left+=l;break;case n.DIFF_INSERT:s===`
1001
+ `&&(i.right++,l--),c=l,c===0&&d.left.push({startLine:i.left,endLine:i.left}),a===`
1002
+ `&&(c-=1),d.right.push({startLine:i.right,endLine:i.right+c}),i.right+=l;break;default:throw new Error("Diff type was not defined.")}}}),d},e.prototype.setCodeMarkers=function(t){t===void 0&&(t={left:[],right:[]});for(var n=[],d={left:[],right:[]},i=0;i<t.left.length;i++){var r={startRow:t.left[i].startLine-1,endRow:t.left[i].endLine,type:"text",className:"codeMarker"};d.left.push(r)}for(var i=0;i<t.right.length;i++){var r={startRow:t.right[i].startLine-1,endRow:t.right[i].endLine,type:"text",className:"codeMarker"};d.right.push(r)}return n[0]=d.left,n[1]=d.right,n},e.prototype.render=function(){var t=this.diff();return Qr.createElement(pd.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:pe.number,editorProps:pe.object,enableBasicAutocompletion:pe.bool,enableLiveAutocompletion:pe.bool,focus:pe.bool,fontSize:pe.number,height:pe.string,highlightActiveLine:pe.bool,maxLines:pe.number,minLines:pe.number,mode:pe.string,name:pe.string,className:pe.string,onLoad:pe.func,onPaste:pe.func,onScroll:pe.func,onChange:pe.func,orientation:pe.string,readOnly:pe.bool,scrollMargin:pe.array,setOptions:pe.object,showGutter:pe.bool,showPrintMargin:pe.bool,splits:pe.number,style:pe.object,tabSize:pe.number,theme:pe.string,value:pe.array,width:pe.string,wrapEnabled:pe.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})(Qr.Component);Kn.default=gd;Object.defineProperty(yn,"__esModule",{value:!0});yn.diff=yn.split=void 0;var md=Gt,vd=Kn;yn.diff=vd.default;var yd=Mt;yn.split=yd.default;var bd=yn.default=md.default,wd={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,d){var i=t("../lib/oop"),r=t("./text_highlight_rules").TextHighlightRules,p=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(p,r),n.JsonHighlightRules=p}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(t,n,d){var i=t("../range").Range,r=function(){};(function(){this.checkOutdent=function(p,o){return/^\s+$/.test(p)?/^\s*\}/.test(o):!1},this.autoOutdent=function(p,o){var l=p.getLine(o),s=l.match(/^(\s*\})/);if(!s)return 0;var a=s[1].length,c=p.findMatchingBracket({row:o,column:a});if(!c||c.row==o)return 0;var u=this.$getIndent(p.getLine(c.row));p.replace(new i(o,0,o,a-1),u)},this.$getIndent=function(p){return p.match(/^\s*/)[0]}}).call(r.prototype),n.MatchingBraceOutdent=r}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(t,n,d){var i=t("../../lib/oop"),r=t("../../range").Range,p=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,p),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,s,a){var c=l.getLine(a);if(this.singleLineBlockCommentRe.test(c)&&!this.startRegionRe.test(c)&&!this.tripleStarBlockCommentRe.test(c))return"";var u=this._getFoldWidgetBase(l,s,a);return!u&&this.startRegionRe.test(c)?"start":u},this.getFoldWidgetRange=function(l,s,a,c){var u=l.getLine(a);if(this.startRegionRe.test(u))return this.getCommentRegionBlock(l,u,a);var g=u.match(this.foldingStartMarker);if(g){var h=g.index;if(g[1])return this.openingBracketBlock(l,g[1],a,h);var f=l.getCommentFoldRange(a,h+g[0].length,1);return f&&!f.isMultiLine()&&(c?f=this.getSectionRange(l,a):s!="all"&&(f=null)),f}if(s!=="markbegin"){var g=u.match(this.foldingStopMarker);if(g){var h=g.index+g[0].length;return g[1]?this.closingBracketBlock(l,g[1],a,h):l.getCommentFoldRange(a,h,-1)}}},this.getSectionRange=function(l,s){var a=l.getLine(s),c=a.search(/\S/),u=s,h=a.length;s+=1;for(var f=s,g=l.getLength();++s<g;){a=l.getLine(s);var v=a.search(/\S/);if(v!==-1){if(c>v)break;var b=this.getFoldWidgetRange(l,"all",s);if(b){if(b.start.row<=u)break;if(b.isMultiLine())s=b.end.row;else if(c==v)break}f=s}}return new r(u,h,f,l.getLine(f).length)},this.getCommentRegionBlock=function(l,s,a){for(var c=s.search(/\s*$/),u=l.getLength(),h=a,f=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,g=1;++a<u;){s=l.getLine(a);var v=f.exec(s);if(v&&(v[1]?g--:g++,!g))break}var b=a;if(b>h)return new r(h,c,b,s.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,d){var i=t("../lib/oop"),r=t("./text").Mode,p=t("./json_highlight_rules").JsonHighlightRules,o=t("./matching_brace_outdent").MatchingBraceOutdent,l=t("./folding/cstyle").FoldMode,s=t("../worker/worker_client").WorkerClient,a=function(){this.HighlightRules=p,this.$outdent=new o,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new l};i.inherits(a,r),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(c,u,h){var f=this.$getIndent(u);if(c=="start"){var g=u.match(/^.*[\{\(\[]\s*$/);g&&(f+=h)}return f},this.checkOutdent=function(c,u,h){return this.$outdent.checkOutdent(u,h)},this.autoOutdent=function(c,u,h){this.$outdent.autoOutdent(u,h)},this.createWorker=function(c){var u=new s(["ace"],"ace/mode/json_worker","JsonWorker");return u.attachToDocument(c.getDocument()),u.on("annotate",function(h){c.setAnnotations(h.data)}),u.on("terminate",function(){c.clearAnnotations()}),u},this.$id="ace/mode/json"}.call(a.prototype),n.Mode=a}),(function(){ace.require(["ace/mode/json"],function(t){m&&(m.exports=t)})})()})(wd);var Cd={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,d){var i=t("../lib/oop"),r=t("./text_highlight_rules").TextHighlightRules,p=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(p,r),n.JsonHighlightRules=p}),ace.define("ace/mode/json5_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/json_highlight_rules"],function(t,n,d){var i=t("../lib/oop"),r=t("./json_highlight_rules").JsonHighlightRules,p=function(){r.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(p,r),n.Json5HighlightRules=p}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(t,n,d){var i=t("../range").Range,r=function(){};(function(){this.checkOutdent=function(p,o){return/^\s+$/.test(p)?/^\s*\}/.test(o):!1},this.autoOutdent=function(p,o){var l=p.getLine(o),s=l.match(/^(\s*\})/);if(!s)return 0;var a=s[1].length,c=p.findMatchingBracket({row:o,column:a});if(!c||c.row==o)return 0;var u=this.$getIndent(p.getLine(c.row));p.replace(new i(o,0,o,a-1),u)},this.$getIndent=function(p){return p.match(/^\s*/)[0]}}).call(r.prototype),n.MatchingBraceOutdent=r}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(t,n,d){var i=t("../../lib/oop"),r=t("../../range").Range,p=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,p),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,s,a){var c=l.getLine(a);if(this.singleLineBlockCommentRe.test(c)&&!this.startRegionRe.test(c)&&!this.tripleStarBlockCommentRe.test(c))return"";var u=this._getFoldWidgetBase(l,s,a);return!u&&this.startRegionRe.test(c)?"start":u},this.getFoldWidgetRange=function(l,s,a,c){var u=l.getLine(a);if(this.startRegionRe.test(u))return this.getCommentRegionBlock(l,u,a);var g=u.match(this.foldingStartMarker);if(g){var h=g.index;if(g[1])return this.openingBracketBlock(l,g[1],a,h);var f=l.getCommentFoldRange(a,h+g[0].length,1);return f&&!f.isMultiLine()&&(c?f=this.getSectionRange(l,a):s!="all"&&(f=null)),f}if(s!=="markbegin"){var g=u.match(this.foldingStopMarker);if(g){var h=g.index+g[0].length;return g[1]?this.closingBracketBlock(l,g[1],a,h):l.getCommentFoldRange(a,h,-1)}}},this.getSectionRange=function(l,s){var a=l.getLine(s),c=a.search(/\S/),u=s,h=a.length;s+=1;for(var f=s,g=l.getLength();++s<g;){a=l.getLine(s);var v=a.search(/\S/);if(v!==-1){if(c>v)break;var b=this.getFoldWidgetRange(l,"all",s);if(b){if(b.start.row<=u)break;if(b.isMultiLine())s=b.end.row;else if(c==v)break}f=s}}return new r(u,h,f,l.getLine(f).length)},this.getCommentRegionBlock=function(l,s,a){for(var c=s.search(/\s*$/),u=l.getLength(),h=a,f=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,g=1;++a<u;){s=l.getLine(a);var v=f.exec(s);if(v&&(v[1]?g--:g++,!g))break}var b=a;if(b>h)return new r(h,c,b,s.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,d){var i=t("../lib/oop"),r=t("./text").Mode,p=t("./json5_highlight_rules").Json5HighlightRules,o=t("./matching_brace_outdent").MatchingBraceOutdent,l=t("./folding/cstyle").FoldMode,s=function(){this.HighlightRules=p,this.$outdent=new o,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new l};i.inherits(s,r),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.checkOutdent=function(a,c,u){return this.$outdent.checkOutdent(c,u)},this.autoOutdent=function(a,c,u){this.$outdent.autoOutdent(c,u)},this.$id="ace/mode/json5"}.call(s.prototype),n.Mode=s}),(function(){ace.require(["ace/mode/json5"],function(t){m&&(m.exports=t)})})()})(Cd);var Ed={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,d){var i=t("../lib/oop"),r=t("./text_highlight_rules").TextHighlightRules,p=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,s,a){a=a.replace(/ #.*/,"");var c=/^ *((:\s*)?-(\s*[^|>])?)?/.exec(a)[0].replace(/\S\s*$/,"").length,u=parseInt(/\d+[\s+-]*$/.exec(a));return u?(c+=u-1,this.next="mlString"):this.next="mlStringPre",s.length?(s[0]=this.next,s[1]=c):(s.push(this.next),s.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,s){var a=s[1];return a>=o.length?(this.next="start",s.shift(),s.shift()):(s[1]=o.length-1,this.next=s[0]="mlString"),this.token},next:"mlString"},{defaultToken:"string"}],mlString:[{token:"indent",regex:/^ *$/},{token:"indent",regex:/^ */,onMatch:function(o,l,s){var a=s[1];return a>=o.length?(this.next="start",s.splice(0)):this.next="mlString",this.token},next:"mlString"},{token:"string",regex:".+"}]},this.normalizeRules()};i.inherits(p,r),n.YamlHighlightRules=p}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(t,n,d){var i=t("../range").Range,r=function(){};(function(){this.checkOutdent=function(p,o){return/^\s+$/.test(p)?/^\s*\}/.test(o):!1},this.autoOutdent=function(p,o){var l=p.getLine(o),s=l.match(/^(\s*\})/);if(!s)return 0;var a=s[1].length,c=p.findMatchingBracket({row:o,column:a});if(!c||c.row==o)return 0;var u=this.$getIndent(p.getLine(c.row));p.replace(new i(o,0,o,a-1),u)},this.$getIndent=function(p){return p.match(/^\s*/)[0]}}).call(r.prototype),n.MatchingBraceOutdent=r}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(t,n,d){var i=t("../../lib/oop"),r=t("./fold_mode").FoldMode,p=t("../../range").Range,o=n.FoldMode=function(){};i.inherits(o,r),function(){this.commentBlock=function(l,s){var a=/\S/,c=l.getLine(s),u=c.search(a);if(!(u==-1||c[u]!="#")){for(var h=c.length,f=l.getLength(),g=s,v=s;++s<f;){c=l.getLine(s);var b=c.search(a);if(b!=-1){if(c[b]!="#")break;v=s}}if(v>g){var A=l.getLine(v).length;return new p(g,h,v,A)}}},this.getFoldWidgetRange=function(l,s,a){var c=this.indentationBlock(l,a);if(c||(c=this.commentBlock(l,a),c))return c},this.getFoldWidget=function(l,s,a){var c=l.getLine(a),u=c.search(/\S/),h=l.getLine(a+1),f=l.getLine(a-1),g=f.search(/\S/),v=h.search(/\S/);if(u==-1)return l.foldWidgets[a-1]=g!=-1&&g<v?"start":"","";if(g==-1){if(u==v&&c[u]=="#"&&h[u]=="#")return l.foldWidgets[a-1]="",l.foldWidgets[a+1]="","start"}else if(g==u&&c[u]=="#"&&f[u]=="#"&&l.getLine(a-2).search(/\S/)==-1)return l.foldWidgets[a-1]="start",l.foldWidgets[a+1]="","";return g!=-1&&g<u?l.foldWidgets[a-1]="start":l.foldWidgets[a-1]="",u<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,d){var i=t("../../lib/oop"),r=t("./coffee").FoldMode,p=t("../../range").Range,o=n.FoldMode=function(){};i.inherits(o,r),function(){this.getFoldWidgetRange=function(l,s,a){var c=/\S/,u=l.getLine(a),h=u.search(c),f=u[h]==="#",g=u[h]==="-";if(h!=-1){var v=u.length,b=l.getLength(),A=a,S=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 u=l.getLine(a),y=u.search(c);if(y!=-1){if(y<=h&&u[h]!=="-"){var D=l.getTokenAt(a,0);if(!D||D.type!=="string")break}S=a}}if(S>A){var T=l.getLine(S).length;return new p(A,v,S,T)}}},this.getFoldWidget=function(l,s,a){var c=l.getLine(a),u=c.search(/\S/),h=l.getLine(a+1),f=l.getLine(a-1),g=f.search(/\S/),v=h.search(/\S/),b=c[u]==="-";if(u==-1)return l.foldWidgets[a-1]=g!=-1&&g<v?"start":"","";if(g==-1){if(u==v&&c[u]=="#"&&h[u]=="#")return l.foldWidgets[a-1]="",l.foldWidgets[a+1]="","start"}else if(g==u&&c[u]=="#"&&f[u]=="#"&&l.getLine(a-2).search(/\S/)==-1)return l.foldWidgets[a-1]="start",l.foldWidgets[a+1]="","";return g!=-1&&g<u||g!=-1&&g==u&&b?l.foldWidgets[a-1]="start":l.foldWidgets[a-1]="",u<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,d){var i=t("../lib/oop"),r=t("./text").Mode,p=t("./yaml_highlight_rules").YamlHighlightRules,o=t("./matching_brace_outdent").MatchingBraceOutdent,l=t("./folding/yaml").FoldMode,s=t("../worker/worker_client").WorkerClient,a=function(){this.HighlightRules=p,this.$outdent=new o,this.foldingRules=new l,this.$behaviour=this.$defaultBehaviour};i.inherits(a,r),function(){this.lineCommentStart=["#"],this.getNextLineIndent=function(c,u,h){var f=this.$getIndent(u);if(c=="start"){var g=u.match(/^.*[\{\(\[]\s*$/);g&&(f+=h)}return f},this.checkOutdent=function(c,u,h){return this.$outdent.checkOutdent(u,h)},this.autoOutdent=function(c,u,h){this.$outdent.autoOutdent(u,h)},this.createWorker=function(c){var u=new s(["ace"],"ace/mode/yaml_worker","YamlWorker");return u.attachToDocument(c.getDocument()),u.on("annotate",function(h){c.setAnnotations(h.data)}),u.on("terminate",function(){c.clearAnnotations()}),u},this.$id="ace/mode/yaml"}.call(a.prototype),n.Mode=a}),(function(){ace.require(["ace/mode/yaml"],function(t){m&&(m.exports=t)})})()})(Ed);var Sd={};(function(m){function e(d,i){for(var r=d,p="";r;){var o=i[r];if(typeof o=="string")return o+p;if(o)return o.location.replace(/\/*$/,"/")+(p||o.main||o.name);if(o===!1)return"";var l=r.lastIndexOf("/");if(l===-1)break;p=r.substr(l)+p,r=r.slice(0,l)}return d}if(!(typeof m.window<"u"&&m.document)&&!(m.require&&m.define)){m.console||(m.console=function(){var d=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:d})},m.console.error=m.console.warn=m.console.log=m.console.trace=m.console),m.window=m,m.ace=m,m.onerror=function(d,i,r,p,o){postMessage({type:"error",data:{message:d,data:o&&o.data,file:i,line:r,col:p,stack:o&&o.stack}})},m.normalizeModule=function(d,i){if(i.indexOf("!")!==-1){var r=i.split("!");return m.normalizeModule(d,r[0])+"!"+m.normalizeModule(d,r[1])}if(i.charAt(0)=="."){var p=d.split("/").slice(0,-1).join("/");for(i=(p?p+"/":"")+i;i.indexOf(".")!==-1&&o!=i;){var o=i;i=i.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return i},m.require=function(d,i){if(i||(i=d,d=null),!i.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");i=m.normalizeModule(d,i);var r=m.require.modules[i];if(r)return r.initialized||(r.initialized=!0,r.exports=r.factory().exports),r.exports;if(!m.require.tlns)return console.log("unable to load "+i);var p=e(i,m.require.tlns);return p.slice(-3)!=".js"&&(p+=".js"),m.require.id=i,m.require.modules[i]={},importScripts(p),m.require(d,i)},m.require.modules={},m.require.tlns={},m.define=function(d,i,r){if(arguments.length==2?(r=i,typeof d!="string"&&(i=d,d=m.require.id)):arguments.length==1&&(r=d,i=[],d=m.require.id),typeof r!="function"){m.require.modules[d]={exports:r,initialized:!0};return}i.length||(i=["require","exports","module"]);var p=function(o){return m.require(d,o)};m.require.modules[d]={exports:{},factory:function(){var o=this,l=r.apply(this,i.slice(0,r.length).map(function(s){switch(s){case"require":return p;case"exports":return o.exports;case"module":return o;default:return p(s)}}));return l&&(o.exports=l),o}}},m.define.amd={},m.require.tlns={},m.initBaseUrls=function(d){for(var i in d)this.require.tlns[i]=d[i]},m.initSender=function(){var d=m.require("ace/lib/event_emitter").EventEmitter,i=m.require("ace/lib/oop"),r=function(){};return function(){i.implement(this,d),this.callback=function(p,o){postMessage({type:"call",id:o,data:p})},this.emit=function(p,o){postMessage({type:"event",name:p,data:o})}}.call(r.prototype),new r};var t=m.main=null,n=m.sender=null;m.onmessage=function(d){var i=d.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 r=this.require(i.module)[i.classname];t=m.main=new r(n)}}}})(Sd),ace.define("ace/lib/oop",[],function(m,e,t){e.inherits=function(n,d){n.super_=d,n.prototype=Object.create(d.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})},e.mixin=function(n,d){for(var i in d)n[i]=d[i];return n},e.implement=function(n,d){e.mixin(n,d)}}),ace.define("ace/apply_delta",[],function(m,e,t){e.applyDelta=function(n,d,i){var r=d.start.row,p=d.start.column,o=n[r]||"";switch(d.action){case"insert":var l=d.lines;if(l.length===1)n[r]=o.substring(0,p)+d.lines[0]+o.substring(p);else{var s=[r,1].concat(d.lines);n.splice.apply(n,s),n[r]=o.substring(0,p)+n[r],n[r+d.lines.length-1]+=o.substring(p)}break;case"remove":var a=d.end.column,c=d.end.row;r===c?n[r]=o.substring(0,p)+o.substring(a):n.splice(r,c-r+1,o.substring(0,p)+n[c].substring(a))}}}),ace.define("ace/lib/event_emitter",[],function(m,e,t){var n={},d=function(){this.propagationStopped=!0},i=function(){this.defaultPrevented=!0};n._emit=n._dispatchEvent=function(r,p){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var o=this._eventRegistry[r]||[],l=this._defaultHandlers[r];if(!(!o.length&&!l)){(typeof p!="object"||!p)&&(p={}),p.type||(p.type=r),p.stopPropagation||(p.stopPropagation=d),p.preventDefault||(p.preventDefault=i),o=o.slice();for(var s=0;s<o.length&&(o[s](p,this),!p.propagationStopped);s++);if(l&&!p.defaultPrevented)return l(p,this)}},n._signal=function(r,p){var o=(this._eventRegistry||{})[r];if(o){o=o.slice();for(var l=0;l<o.length;l++)o[l](p,this)}},n.once=function(r,p){var o=this;if(this.on(r,function l(){o.off(r,l),p.apply(null,arguments)}),!p)return new Promise(function(l){p=l})},n.setDefaultHandler=function(r,p){var o=this._defaultHandlers;if(o||(o=this._defaultHandlers={_disabled_:{}}),o[r]){var l=o[r],s=o._disabled_[r];s||(o._disabled_[r]=s=[]),s.push(l);var a=s.indexOf(p);a!=-1&&s.splice(a,1)}o[r]=p},n.removeDefaultHandler=function(r,p){var o=this._defaultHandlers;if(o){var l=o._disabled_[r];if(o[r]==p)l&&this.setDefaultHandler(r,l.pop());else if(l){var s=l.indexOf(p);s!=-1&&l.splice(s,1)}}},n.on=n.addEventListener=function(r,p,o){this._eventRegistry=this._eventRegistry||{};var l=this._eventRegistry[r];return l||(l=this._eventRegistry[r]=[]),l.indexOf(p)==-1&&l[o?"unshift":"push"](p),p},n.off=n.removeListener=n.removeEventListener=function(r,p){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[r];if(o){var l=o.indexOf(p);l!==-1&&o.splice(l,1)}},n.removeAllListeners=function(r){r||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[r]=void 0),this._defaultHandlers&&(this._defaultHandlers[r]=void 0)},e.EventEmitter=n}),ace.define("ace/range",[],function(m,e,t){var n=(function(){function d(i,r,p,o){this.start={row:i,column:r},this.end={row:p,column:o}}return d.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},d.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},d.prototype.contains=function(i,r){return this.compare(i,r)==0},d.prototype.compareRange=function(i){var r,p=i.end,o=i.start;return r=this.compare(p.row,p.column),r==1?(r=this.compare(o.row,o.column),r==1?2:r==0?1:0):r==-1?-2:(r=this.compare(o.row,o.column),r==-1?-1:r==1?42:0)},d.prototype.comparePoint=function(i){return this.compare(i.row,i.column)},d.prototype.containsRange=function(i){return this.comparePoint(i.start)==0&&this.comparePoint(i.end)==0},d.prototype.intersects=function(i){var r=this.compareRange(i);return r==-1||r==0||r==1},d.prototype.isEnd=function(i,r){return this.end.row==i&&this.end.column==r},d.prototype.isStart=function(i,r){return this.start.row==i&&this.start.column==r},d.prototype.setStart=function(i,r){typeof i=="object"?(this.start.column=i.column,this.start.row=i.row):(this.start.row=i,this.start.column=r)},d.prototype.setEnd=function(i,r){typeof i=="object"?(this.end.column=i.column,this.end.row=i.row):(this.end.row=i,this.end.column=r)},d.prototype.inside=function(i,r){return this.compare(i,r)==0?!(this.isEnd(i,r)||this.isStart(i,r)):!1},d.prototype.insideStart=function(i,r){return this.compare(i,r)==0?!this.isEnd(i,r):!1},d.prototype.insideEnd=function(i,r){return this.compare(i,r)==0?!this.isStart(i,r):!1},d.prototype.compare=function(i,r){return!this.isMultiLine()&&i===this.start.row?r<this.start.column?-1:r>this.end.column?1:0:i<this.start.row?-1:i>this.end.row?1:this.start.row===i?r>=this.start.column?0:-1:this.end.row===i?r<=this.end.column?0:1:0},d.prototype.compareStart=function(i,r){return this.start.row==i&&this.start.column==r?-1:this.compare(i,r)},d.prototype.compareEnd=function(i,r){return this.end.row==i&&this.end.column==r?1:this.compare(i,r)},d.prototype.compareInside=function(i,r){return this.end.row==i&&this.end.column==r?1:this.start.row==i&&this.start.column==r?-1:this.compare(i,r)},d.prototype.clipRows=function(i,r){if(this.end.row>r)var p={row:r+1,column:0};else if(this.end.row<i)var p={row:i,column:0};if(this.start.row>r)var o={row:r+1,column:0};else if(this.start.row<i)var o={row:i,column:0};return d.fromPoints(o||this.start,p||this.end)},d.prototype.extend=function(i,r){var p=this.compare(i,r);if(p==0)return this;if(p==-1)var o={row:i,column:r};else var l={row:i,column:r};return d.fromPoints(o||this.start,l||this.end)},d.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},d.prototype.isMultiLine=function(){return this.start.row!==this.end.row},d.prototype.clone=function(){return d.fromPoints(this.start,this.end)},d.prototype.collapseRows=function(){return this.end.column==0?new d(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new d(this.start.row,0,this.end.row,0)},d.prototype.toScreenRange=function(i){var r=i.documentToScreenPosition(this.start),p=i.documentToScreenPosition(this.end);return new d(r.row,r.column,p.row,p.column)},d.prototype.moveBy=function(i,r){this.start.row+=i,this.start.column+=r,this.end.row+=i,this.end.column+=r},d})();n.fromPoints=function(d,i){return new n(d.row,d.column,i.row,i.column)},n.comparePoints=function(d,i){return d.row-i.row||d.column-i.column},e.Range=n}),ace.define("ace/anchor",[],function(m,e,t){function n(o,l,s){var a=s?o.column<=l.column:o.column<l.column;return o.row<l.row||o.row==l.row&&a}function d(o,l,s){var a=o.action=="insert",c=(a?1:-1)*(o.end.row-o.start.row),u=(a?1:-1)*(o.end.column-o.start.column),h=o.start,f=a?h:o.end;return n(l,h,s)?{row:l.row,column:l.column}:n(f,l,!s)?{row:l.row+c,column:l.column+(l.row==f.row?u:0)}:{row:h.row,column:h.column}}var i=m("./lib/oop"),r=m("./lib/event_emitter").EventEmitter,p=(function(){function o(l,s,a){this.$onChange=this.onChange.bind(this),this.attach(l),typeof s!="number"?this.setPosition(s.row,s.column):this.setPosition(s,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 s=d(l,{row:this.row,column:this.column},this.$insertRight);this.setPosition(s.row,s.column,!0)}},o.prototype.setPosition=function(l,s,a){var c;if(a?c={row:l,column:s}:c=this.$clipPositionToDocument(l,s),!(this.row==c.row&&this.column==c.column)){var u={row:this.row,column:this.column};this.row=c.row,this.column=c.column,this._signal("change",{old:u,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,s){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,s))),s<0&&(a.column=0),a},o})();p.prototype.$insertRight=!1,i.implement(p.prototype,r),e.Anchor=p}),ace.define("ace/document",[],function(m,e,t){var n=m("./lib/oop"),d=m("./apply_delta").applyDelta,i=m("./lib/event_emitter").EventEmitter,r=m("./range").Range,p=m("./anchor").Anchor,o=(function(){function l(s){this.$lines=[""],s.length===0?this.$lines=[""]:Array.isArray(s)?this.insertMergedLines({row:0,column:0},s):this.insert({row:0,column:0},s)}return l.prototype.setValue=function(s){var a=this.getLength()-1;this.remove(new r(0,0,a,this.getLine(a).length)),this.insert({row:0,column:0},s||"")},l.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},l.prototype.createAnchor=function(s,a){return new p(this,s,a)},l.prototype.$detectNewLine=function(s){var a=s.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(s){this.$newLineMode!==s&&(this.$newLineMode=s,this._signal("changeNewLineMode"))},l.prototype.getNewLineMode=function(){return this.$newLineMode},l.prototype.isNewLine=function(s){return s==`\r
1007
+ `||s=="\r"||s==`
1008
+ `},l.prototype.getLine=function(s){return this.$lines[s]||""},l.prototype.getLines=function(s,a){return this.$lines.slice(s,a+1)},l.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},l.prototype.getLength=function(){return this.$lines.length},l.prototype.getTextRange=function(s){return this.getLinesForRange(s).join(this.getNewLineCharacter())},l.prototype.getLinesForRange=function(s){var a;if(s.start.row===s.end.row)a=[this.getLine(s.start.row).substring(s.start.column,s.end.column)];else{a=this.getLines(s.start.row,s.end.row),a[0]=(a[0]||"").substring(s.start.column);var c=a.length-1;s.end.row-s.start.row==c&&(a[c]=a[c].substring(0,s.end.column))}return a},l.prototype.insertLines=function(s,a){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(s,a)},l.prototype.removeLines=function(s,a){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(s,a)},l.prototype.insertNewLine=function(s){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(s,["",""])},l.prototype.insert=function(s,a){return this.getLength()<=1&&this.$detectNewLine(a),this.insertMergedLines(s,this.$split(a))},l.prototype.insertInLine=function(s,a){var c=this.clippedPos(s.row,s.column),u=this.pos(s.row,s.column+a.length);return this.applyDelta({start:c,end:u,action:"insert",lines:[a]},!0),this.clonePos(u)},l.prototype.clippedPos=function(s,a){var c=this.getLength();s===void 0?s=c:s<0?s=0:s>=c&&(s=c-1,a=void 0);var u=this.getLine(s);return a==null&&(a=u.length),a=Math.min(Math.max(a,0),u.length),{row:s,column:a}},l.prototype.clonePos=function(s){return{row:s.row,column:s.column}},l.prototype.pos=function(s,a){return{row:s,column:a}},l.prototype.$clipPosition=function(s){var a=this.getLength();return s.row>=a?(s.row=Math.max(0,a-1),s.column=this.getLine(a-1).length):(s.row=Math.max(0,s.row),s.column=Math.min(Math.max(s.column,0),this.getLine(s.row).length)),s},l.prototype.insertFullLines=function(s,a){s=Math.min(Math.max(s,0),this.getLength());var c=0;s<this.getLength()?(a=a.concat([""]),c=0):(a=[""].concat(a),s--,c=this.$lines[s].length),this.insertMergedLines({row:s,column:c},a)},l.prototype.insertMergedLines=function(s,a){var c=this.clippedPos(s.row,s.column),u={row:c.row+a.length-1,column:(a.length==1?c.column:0)+a[a.length-1].length};return this.applyDelta({start:c,end:u,action:"insert",lines:a}),this.clonePos(u)},l.prototype.remove=function(s){var a=this.clippedPos(s.start.row,s.start.column),c=this.clippedPos(s.end.row,s.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(s,a,c){var u=this.clippedPos(s,a),h=this.clippedPos(s,c);return this.applyDelta({start:u,end:h,action:"remove",lines:this.getLinesForRange({start:u,end:h})},!0),this.clonePos(u)},l.prototype.removeFullLines=function(s,a){s=Math.min(Math.max(0,s),this.getLength()-1),a=Math.min(Math.max(0,a),this.getLength()-1);var c=a==this.getLength()-1&&s>0,u=a<this.getLength()-1,h=c?s-1:s,f=c?this.getLine(h).length:0,g=u?a+1:a,v=u?0:this.getLine(g).length,b=new r(h,f,g,v),A=this.$lines.slice(s,a+1);return this.applyDelta({start:b.start,end:b.end,action:"remove",lines:this.getLinesForRange(b)}),A},l.prototype.removeNewLine=function(s){s<this.getLength()-1&&s>=0&&this.applyDelta({start:this.pos(s,this.getLine(s).length),end:this.pos(s+1,0),action:"remove",lines:["",""]})},l.prototype.replace=function(s,a){if(s instanceof r||(s=r.fromPoints(s.start,s.end)),a.length===0&&s.isEmpty())return s.start;if(a==this.getTextRange(s))return s.end;this.remove(s);var c;return a?c=this.insert(s.start,a):c=s.start,c},l.prototype.applyDeltas=function(s){for(var a=0;a<s.length;a++)this.applyDelta(s[a])},l.prototype.revertDeltas=function(s){for(var a=s.length-1;a>=0;a--)this.revertDelta(s[a])},l.prototype.applyDelta=function(s,a){var c=s.action=="insert";(c?s.lines.length<=1&&!s.lines[0]:!r.comparePoints(s.start,s.end))||(c&&s.lines.length>2e4?this.$splitAndapplyLargeDelta(s,2e4):(d(this.$lines,s,a),this._signal("change",s)))},l.prototype.$safeApplyDelta=function(s){var a=this.$lines.length;(s.action=="remove"&&s.start.row<a&&s.end.row<a||s.action=="insert"&&s.start.row<=a)&&this.applyDelta(s)},l.prototype.$splitAndapplyLargeDelta=function(s,a){for(var c=s.lines,u=c.length-a+1,h=s.start.row,f=s.start.column,g=0,v=0;g<u;g=v){v+=a-1;var b=c.slice(g,v);b.push(""),this.applyDelta({start:this.pos(h+g,f),end:this.pos(h+v,f=0),action:s.action,lines:b},!0)}s.lines=c.slice(g),s.start.row=h+g,s.start.column=f,this.applyDelta(s,!0)},l.prototype.revertDelta=function(s){this.$safeApplyDelta({start:this.clonePos(s.start),end:this.clonePos(s.end),action:s.action=="insert"?"remove":"insert",lines:s.lines.slice()})},l.prototype.indexToPosition=function(s,a){for(var c=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,h=a||0,f=c.length;h<f;h++)if(s-=c[h].length+u,s<0)return{row:h,column:s+c[h].length+u};return{row:f-1,column:s+c[f-1].length+u}},l.prototype.positionToIndex=function(s,a){for(var c=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,h=0,f=Math.min(s.row,c.length),g=a||0;g<f;++g)h+=c[g].length+u;return h+s.column},l.prototype.$split=function(s){return s.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(d){if(typeof d!="object"||!d)return d;var i;if(Array.isArray(d)){i=[];for(var r=0;r<d.length;r++)i[r]=n(d[r]);return i}if(Object.prototype.toString.call(d)!=="[object Object]")return d;i={};for(var r in d)i[r]=n(d[r]);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,r){for(var p="";r>0;)r&1&&(p+=i),(r>>=1)&&(i+=i);return p};var n=/^\s\s*/,d=/\s\s*$/;e.stringTrimLeft=function(i){return i.replace(n,"")},e.stringTrimRight=function(i){return i.replace(d,"")},e.copyObject=function(i){var r={};for(var p in i)r[p]=i[p];return r},e.copyArray=function(i){for(var r=[],p=0,o=i.length;p<o;p++)i[p]&&typeof i[p]=="object"?r[p]=this.copyObject(i[p]):r[p]=i[p];return r},e.deepCopy=m("./deep_copy").deepCopy,e.arrayToMap=function(i){for(var r={},p=0;p<i.length;p++)r[i[p]]=1;return r},e.createMap=function(i){var r=Object.create(null);for(var p in i)r[p]=i[p];return r},e.arrayRemove=function(i,r){for(var p=0;p<=i.length;p++)r===i[p]&&i.splice(p,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,r){var p=[];return i.replace(r,function(o){p.push({offset:arguments[arguments.length-2],length:o.length})}),p},e.deferredCall=function(i){var r=null,p=function(){r=null,i()},o=function(l){return o.cancel(),r=setTimeout(p,l||0),o};return o.schedule=o,o.call=function(){return this.cancel(),i(),o},o.cancel=function(){return clearTimeout(r),r=null,o},o.isPending=function(){return r},o},e.delayedCall=function(i,r){var p=null,o=function(){p=null,i()},l=function(s){p==null&&(p=setTimeout(o,s||r))};return l.delay=function(s){p&&clearTimeout(p),p=setTimeout(o,s||r)},l.schedule=l,l.call=function(){this.cancel(),i()},l.cancel=function(){p&&clearTimeout(p),p=null},l.isPending=function(){return p},l},e.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},e.skipEmptyMatch=function(i,r,p){return p&&i.codePointAt(r)>65535?2:1}}),ace.define("ace/worker/mirror",[],function(m,e,t){var n=m("../document").Document,d=m("../lib/lang"),i=e.Mirror=function(r){this.sender=r;var p=this.doc=new n(""),o=this.deferredUpdate=d.delayedCall(this.onUpdate.bind(this)),l=this;r.on("change",function(s){var a=s.data;if(a[0].start)p.applyDeltas(a);else for(var c=0;c<a.length;c+=2){var u,h;if(Array.isArray(a[c+1])?u={action:"insert",start:a[c],lines:a[c+1]}:u={action:"remove",start:a[c],end:a[c+1]},(u.action=="insert"?u.start:u.end).row>=p.$lines.length)throw h=new Error("Invalid delta"),h.data={path:l.$path,linesLength:p.$lines.length,start:u.start,end:u.end},h;p.applyDelta(u,!0)}if(l.$timeout)return o.schedule(l.$timeout);l.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(r){this.$timeout=r},this.setValue=function(r){this.doc.setValue(r),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(r){this.sender.callback(this.doc.getValue(),r)},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,d,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
1009
+ `,r:"\r",t:" "},r,p=function(g){throw{name:"SyntaxError",message:g,at:n,text:r}},o=function(g){return g&&g!==d&&p("Expected '"+g+"' instead of '"+d+"'"),d=r.charAt(n),n+=1,d},l=function(){var g,v="";for(d==="-"&&(v="-",o("-"));d>="0"&&d<="9";)v+=d,o();if(d===".")for(v+=".";o()&&d>="0"&&d<="9";)v+=d;if(d==="e"||d==="E")for(v+=d,o(),(d==="-"||d==="+")&&(v+=d,o());d>="0"&&d<="9";)v+=d,o();if(g=+v,!isNaN(g))return g;p("Bad number")},s=function(){var g,v,b="",A;if(d==='"')for(;o();){if(d==='"')return o(),b;if(d==="\\")if(o(),d==="u"){for(A=0,v=0;v<4&&(g=parseInt(o(),16),!!isFinite(g));v+=1)A=A*16+g;b+=String.fromCharCode(A)}else{if(typeof i[d]!="string")break;b+=i[d]}else{if(d==`
1010
+ `||d=="\r")break;b+=d}}p("Bad string")},a=function(){for(;d&&d<=" ";)o()},c=function(){switch(d){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}p("Unexpected '"+d+"'")},u,h=function(){var g=[];if(d==="["){if(o("["),a(),d==="]")return o("]"),g;for(;d;){if(g.push(u()),a(),d==="]")return o("]"),g;o(","),a()}}p("Bad array")},f=function(){var g,v={};if(d==="{"){if(o("{"),a(),d==="}")return o("}"),v;for(;d;){if(g=s(),a(),o(":"),Object.hasOwnProperty.call(v,g)&&p('Duplicate key "'+g+'"'),v[g]=u(),a(),d==="}")return o("}"),v;o(","),a()}}p("Bad object")};return u=function(){switch(a(),d){case"{":return f();case"[":return h();case'"':return s();case"-":return l();default:return d>="0"&&d<="9"?l():c()}},function(g,v){var b;return r=g,n=0,d=" ",b=u(),a(),d&&p("Syntax error"),typeof v=="function"?(function A(S,w){var y,D,T=S[w];if(T&&typeof T=="object")for(y in T)Object.hasOwnProperty.call(T,y)&&(D=A(T,y),D!==void 0?T[y]=D:delete T[y]);return v.call(S,w,T)})({"":b},""):b}}),ace.define("ace/mode/json_worker",[],function(m,e,t){var n=m("../lib/oop"),d=m("../worker/mirror").Mirror,i=m("./json/json_parse"),r=e.JsonWorker=function(p){d.call(this,p),this.setTimeout(200)};n.inherits(r,d),function(){this.onUpdate=function(){var p=this.doc.getValue(),o=[];try{p&&i(p)}catch(s){var l=this.doc.indexToPosition(s.at-1);o.push({row:l.row,column:l.column,text:s.message,type:"error"})}this.sender.emit("annotate",o)}}.call(r.prototype)});var Dd={exports:{}};(function(m,e){ace.define("ace/theme/clouds_midnight-css",["require","exports","module"],function(t,n,d){d.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,d){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)})})()})(Dd);var Ad={exports:{}};(function(m,e){ace.define("ace/theme/chrome-css",["require","exports","module"],function(t,n,d){d.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,d){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)})})()})(Ad);var $d={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,d){function i(y){var D=new Date().toLocaleString("en-us",y);return D.length==1?"0"+D:D}var r=t("./lib/dom"),p=t("./lib/oop"),o=t("./lib/event_emitter").EventEmitter,l=t("./lib/lang"),s=t("./range").Range,a=t("./range_list").RangeList,c=t("./keyboard/hash_handler").HashHandler,u=t("./tokenizer").Tokenizer,h=t("./clipboard"),f={CURRENT_WORD:function(y){return y.session.getTextRange(y.session.getWordRange())},SELECTION:function(y,D,T){var $=y.session.getTextRange();return T?$.replace(/\n\r?([ \t]*\S)/g,`
1285
+ `+T+"$1"):$},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 h.getText&&h.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 D=y.session.$mode||{};return D.blockComment&&D.blockComment.start||""},BLOCK_COMMENT_END:function(y){var D=y.session.$mode||{};return D.blockComment&&D.blockComment.end||""},LINE_COMMENT:function(y){var D=y.session.$mode||{};return D.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 D(M){return M=M.substr(1),/^\d+$/.test(M)?[{tabstopId:parseInt(M,10)}]:[{text:M}]}function T(M){return"(?:[^\\\\"+M+"]|\\\\.)"}var $={regex:"/("+T("/")+"+)/",onMatch:function(M,O,x){var k=x[0];return k.fmtString=!0,k.guard=M.slice(1,-1),k.flag="",""},next:"formatString"};return y.$tokenizer=new u({start:[{regex:/\\./,onMatch:function(M,O,x){var k=M[1];return(k=="}"&&x.length||"`$\\".indexOf(k)!=-1)&&(M=k),[M]}},{regex:/}/,onMatch:function(M,O,x){return[x.length?x.shift():M]}},{regex:/\$(?:\d+|\w+)/,onMatch:D},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(M,O,x){var k=D(M.substr(1));return x.unshift(k[0]),k},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+T("\\|")+"*\\|",onMatch:function(M,O,x){var k=M.slice(1,-1).replace(/\\[,|\\]|,/g,function(E){return E.length==2?E[1]:"\0"}).split("\0").map(function(E){return{value:E}});return x[0].choices=k,[k[0]]},next:"start"},$,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(M,O,x){return x.length&&x[0].expectElse?(x[0].expectElse=!1,x[0].ifEnd={elseEnd:x[0]},[x[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(M,O,x){var k=M[1];return k=="}"&&x.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,x){var k=x.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,x){return[{text:M.slice(1)}]}},{regex:/\${\w+/,onMatch:function(M,O,x){var k={text:M.slice(2)};return x.unshift(k),[k]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(M,O,x){var k=x.shift();return this.next=k&&k.tabstopId?"start":"",[k||M]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(M,O,x){var k=x[0];return k.formatFunction=M.slice(2,-1),[x.shift()]},next:"formatString"},$,{regex:/:[\?\-+]?/,onMatch:function(M,O,x){M[1]=="+"&&(x[0].ifEnd=x[0]),M[1]=="?"&&(x[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),y.$tokenizer},y.prototype.tokenizeTmSnippet=function(D,T){return this.getTokenizer().getLineTokens(D,T).tokens.map(function($){return $.value||$})},y.prototype.getVariableValue=function(D,T,$){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](D,T,$)),M??""},y.prototype.tmStrFormat=function(D,T,$){if(!T.fmt)return D;var M=T.flag||"",O=T.guard;O=new RegExp(O,M.replace(/[^gim]/g,""));var x=typeof T.fmt=="string"?this.tokenizeTmSnippet(T.fmt,"formatString"):T.fmt,k=this,E=D.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 E},y.prototype.tmFormatFunction=function(D,T,$){return T.formatFunction=="upcase"?D.toUpperCase():T.formatFunction=="downcase"?D.toLowerCase():D},y.prototype.resolveVariables=function(D,T){function $(I){var F=D.indexOf(I,k+1);F!=-1&&(k=F)}for(var M=[],O="",x=!0,k=0;k<D.length;k++){var E=D[k];if(typeof E=="string"){M.push(E),E==`
1287
+ `?(x=!0,O=""):x&&(O=/^\t*/.exec(E)[0],x=/\S/.test(E));continue}if(E){if(x=!1,E.fmtString){var C=D.indexOf(E,k+1);C==-1&&(C=D.length),E.fmt=D.slice(k+1,C),k=C}if(E.text){var L=this.getVariableValue(T,E.text,O)+"";E.fmtString&&(L=this.tmStrFormat(L,E,T)),E.formatFunction&&(L=this.tmFormatFunction(L,E,T)),L&&!E.ifEnd?(M.push(L),$(E)):!L&&E.ifEnd&&$(E.ifEnd)}else E.elseEnd?$(E.elseEnd):(E.tabstopId!=null||E.changeCase!=null)&&M.push(E)}}return M},y.prototype.getDisplayTextForSnippet=function(D,T){var $=v.call(this,D,T);return $.text},y.prototype.insertSnippetForSelection=function(D,T,$){$===void 0&&($={});var M=v.call(this,D,T,$),O=D.getSelectionRange(),x=D.session.replace(O,M.text),k=new b(D),E=D.inVirtualSelectionMode&&D.selection.index;k.addTabstops(M.tabstops,O.start,x,E)},y.prototype.insertSnippet=function(D,T,$){$===void 0&&($={});var M=this;if(D.inVirtualSelectionMode)return M.insertSnippetForSelection(D,T,$);D.forEachSelection(function(){M.insertSnippetForSelection(D,T,$)},null,{keepOrder:!0}),D.tabstopManager&&D.tabstopManager.tabNext()},y.prototype.$getScope=function(D){var T=D.session.$mode.$id||"";if(T=T.split("/").pop(),T==="html"||T==="php"){T==="php"&&!D.session.$mode.inlinePhp&&(T="html");var $=D.getCursorPosition(),M=D.session.getState($.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(D){var T=this.$getScope(D),$=[T],M=this.snippetMap;return M[T]&&M[T].includeScopes&&$.push.apply($,M[T].includeScopes),$.push("_"),$},y.prototype.expandWithTab=function(D,T){var $=this,M=D.forEachSelection(function(){return $.expandSnippetForSelection(D,T)},null,{keepOrder:!0});return M&&D.tabstopManager&&D.tabstopManager.tabNext(),M},y.prototype.expandSnippetForSelection=function(D,T){var $=D.getCursorPosition(),M=D.session.getLine($.row),O=M.substring(0,$.column),x=M.substr($.column),k=this.snippetMap,E;return this.getActiveScopes(D).some(function(C){var L=k[C];return L&&(E=this.findMatchingSnippet(L,O,x)),!!E},this),E?(T&&T.dryRun||(D.session.doc.removeInLine($.row,$.column-E.replaceBefore.length,$.column+E.replaceAfter.length),this.variables.M__=E.matchBefore,this.variables.T__=E.matchAfter,this.insertSnippetForSelection(D,E.content),this.variables.M__=this.variables.T__=null),!0):!1},y.prototype.findMatchingSnippet=function(D,T,$){for(var M=D.length;M--;){var O=D[M];if(!(O.startRe&&!O.startRe.test(T))&&!(O.endRe&&!O.endRe.test($))&&!(!O.startRe&&!O.endRe))return O.matchBefore=O.startRe?O.startRe.exec(T):[""],O.matchAfter=O.endRe?O.endRe.exec($):[""],O.replaceBefore=O.triggerRe?O.triggerRe.exec(T)[0]:"",O.replaceAfter=O.endTriggerRe?O.endTriggerRe.exec($)[0]:"",O}},y.prototype.register=function(D,T){function $(C){return C&&!/^\^?\(.*\)\$?$|^\\b$/.test(C)&&(C="(?:"+C+")"),C||""}function M(C,L,I){return C=$(C),L=$(L),C=L+C,C&&C[C.length-1]!="$"&&(C+="$"),new RegExp(C)}function O(C){C.scope||(C.scope=T||"_"),T=C.scope,x[T]||(x[T]=[],k[T]={});var L=k[T];if(C.name){var I=L[C.name];I&&E.unregister(I),L[C.name]=C}x[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 x=this.snippetMap,k=this.snippetNameMap,E=this;D||(D=[]),Array.isArray(D)?D.forEach(O):Object.keys(D).forEach(function(C){O(D[C])}),this._signal("registerSnippets",{scope:T})},y.prototype.unregister=function(D,T){function $(x){var k=O[x.scope||T];if(k&&k[x.name]){delete k[x.name];var E=M[x.scope||T],C=E&&E.indexOf(x);C>=0&&E.splice(C,1)}}var M=this.snippetMap,O=this.snippetNameMap;D.content?$(D):Array.isArray(D)&&D.forEach($)},y.prototype.parseSnippetFile=function(D){D=D.replace(/\r/g,"");for(var T=[],$={},M=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,O;O=M.exec(D);){if(O[1])try{$=JSON.parse(O[1]),T.push($)}catch{}if(O[4])$.content=O[4].replace(/^\t/gm,""),T.push($),$={};else{var x=O[2],k=O[3];if(x=="regex"){var E=/\/((?:[^\/\\]|\\.)*)|$/g;$.guard=E.exec(k)[1],$.trigger=E.exec(k)[1],$.endTrigger=E.exec(k)[1],$.endGuard=E.exec(k)[1]}else x=="snippet"?($.tabTrigger=k.match(/^\S*/)[0],$.name||($.name=k)):x&&($[x]=k)}}return T},y.prototype.getSnippetByName=function(D,T){var $=this.snippetNameMap,M;return this.getActiveScopes(T).some(function(O){var x=$[O];return x&&(M=x[D]),!!M},this),M},y})();p.implement(g.prototype,o);var v=function(y,D,T){function $(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),x=y.session.getTabString(),k=O.match(/^\s*/)[0];M.column<k.length&&(k=k.slice(0,M.column)),D=D.replace(/\r/g,"");var E=this.tokenizeTmSnippet(D);E=this.resolveVariables(E,y),E=E.map(function(K){return K==`
1289
+ `&&!T.excludeExtraIndent?K+k:typeof K=="string"?K.replace(/\t/g,x):K});var C=[];E.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=E.indexOf(K,J+1);if(q!==-1){var ne=E.slice(J+1,q),ue=ne.some(function(Ce){return typeof Ce=="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<E.length;I++){var F=E[I];if(typeof F=="object"){var R=F.tabstopId,B=C[R],N=E.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 H=B.value;typeof H!="string"?H=$(H):F.fmt&&(H=this.tmStrFormat(H,F,y)),E.splice.apply(E,[I+1,Math.max(0,N-I)].concat(H,F)),B.indexOf(F)===-1&&B.push(F)}}var P=0,j=0,V="";return E.forEach(function(K){if(typeof K=="string"){var J=K.split(`
1290
+ `);J.length>1?(j=J[J.length-1].length,P+=J.length-1):j+=K.length,V+=K}else K&&(K.start?K.end={row:P,column:j}:K.start={row:P,column:j})}),{text:V,tabstops:C,tokens:E}},b=(function(){function y(D){if(this.index=0,this.ranges=[],this.tabstops=[],D.tabstopManager)return D.tabstopManager;D.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(D)}return y.prototype.attach=function(D){this.$openTabstops=null,this.selectedTabstop=null,this.editor=D,this.session=D.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(D){for(var T=D.action[0]=="r",$=this.selectedTabstop||{},M=$.parents||{},O=this.tabstops.slice(),x=0;x<O.length;x++){var k=O[x],E=k==$||M[k.index];if(k.rangeList.$bias=E?0:1,D.action=="remove"&&k!==$){var C=k.parents&&k.parents[$.index],L=k.rangeList.pointIndex(D.start,C);L=L<0?-L-1:L+1;var I=k.rangeList.pointIndex(D.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(D)}var B=this.session;!this.$inChange&&T&&B.getLength()==1&&!B.getValue()&&this.detach()},y.prototype.updateLinkedFields=function(){var D=this.selectedTabstop;if(!(!D||!D.hasLinkedRanges||!D.firstNonLinked)){this.$inChange=!0;for(var T=this.session,$=T.getTextRange(D.firstNonLinked),M=0;M<D.length;M++){var O=D[M];if(O.linked){var x=O.original,k=n.snippetManager.tmStrFormat($,x,this.editor);T.replace(O,k)}}this.$inChange=!1}},y.prototype.onAfterExec=function(D){D.command&&!D.command.readOnly&&this.updateLinkedFields()},y.prototype.onChangeSelection=function(){if(this.editor){for(var D=this.editor.selection.lead,T=this.editor.selection.anchor,$=this.editor.selection.isEmpty(),M=0;M<this.ranges.length;M++)if(!this.ranges[M].linked){var O=this.ranges[M].contains(D.row,D.column),x=$||this.ranges[M].contains(T.row,T.column);if(O&&x)return}this.detach()}},y.prototype.onChangeSession=function(){this.detach()},y.prototype.tabNext=function(D){var T=this.tabstops.length,$=this.index+(D||1);$=Math.min(Math.max($,1),T),$==T&&($=0),this.selectTabstop($),this.updateTabstopMarkers(),$===0&&this.detach()},y.prototype.selectTabstop=function(D){this.$openTabstops=null;var T=this.tabstops[this.index];if(T&&this.addTabstopMarkers(T),this.index=D,T=this.tabstops[this.index],!(!T||!T.length)){this.selectedTabstop=T;var $=T.firstNonLinked||T;if(T.choices&&($.cursor=$.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange($);else{var M=this.editor.multiSelect;M.toSingleRange($);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(D,T,$){var M=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!D[0]){var O=s.fromPoints($,$);S(O.start,T),S(O.end,T),D[0]=[O],D[0].index=0}var x=this.index,k=[x+1,0],E=this.ranges,C=this.snippetId=(this.snippetId||0)+1;D.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=s.fromPoints(B.start,B.end||B.start);A(N.start,T),A(N.end,T),N.original=B,N.tabstop=F,E.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(D){var T=this.session;D.forEach(function($){$.markerId||($.markerId=T.addMarker($,"ace_snippet-marker","text"))})},y.prototype.removeTabstopMarkers=function(D){var T=this.session;D.forEach(function($){T.removeMarker($.markerId),$.markerId=null})},y.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var D=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&D--,this.tabstops.forEach(function(T){T.snippetId===D?this.addTabstopMarkers(T):this.removeTabstopMarkers(T)},this)}},y.prototype.removeRange=function(D){var T=D.tabstop.indexOf(D);T!=-1&&D.tabstop.splice(T,1),T=this.ranges.indexOf(D),T!=-1&&this.ranges.splice(T,1),T=D.tabstop.rangeList.ranges.indexOf(D),T!=-1&&D.tabstop.splice(T,1),this.session.removeMarker(D.markerId),D.tabstop.length||(T=this.tabstops.indexOf(D.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 A=function(y,D){y.row==0&&(y.column+=D.column),y.row+=D.row},S=function(y,D){y.row==D.row&&(y.column-=D.column),y.row-=D.row};r.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,D){return n.snippetManager.insertSnippet(this,y,D)},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,d){var i=t("../virtual_renderer").VirtualRenderer,r=t("../editor").Editor,p=t("../range").Range,o=t("../lib/event"),l=t("../lib/lang"),s=t("../lib/dom"),a=t("../config").nls,c=t("./../lib/useragent"),u=function(A){return"suggest-aria-id:".concat(A)},h=c.isSafari?"menu":"listbox",f=c.isSafari?"menuitem":"option",g=c.isSafari?"aria-current":"aria-selected",v=function(A){var S=new i(A);S.$maxLines=4;var w=new r(S);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 A(S){var w=s.createElement("div"),y=v(w);S&&S.appendChild(w),w.style.display="none",y.renderer.content.style.cursor="default",y.renderer.setStyle("ace_autocomplete"),y.renderer.$textLayer.element.setAttribute("role",h),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 D=function(){};y.focus=D,y.$isFocused=!0,y.renderer.$cursorLayer.restartTimer=D,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(E){var C=E.getDocumentPosition();y.selection.moveToPosition(C),M.start.row=M.end.row=C.row,E.stop()});var T,$=new p(-1,0,-1,1/0),M=new p(-1,0,-1,1/0);M.id=y.session.addMarker(M,"ace_active-line","fullLine"),y.setSelectOnHover=function(E){E?$.id&&(y.session.removeMarker($.id),$.id=null):$.id=y.session.addMarker($,"ace_line-hover","fullLine")},y.setSelectOnHover(!1),y.on("mousemove",function(E){if(!T){T=E;return}if(!(T.x==E.x&&T.y==E.y)){T=E,T.scrollTop=y.renderer.scrollTop,y.isMouseOver=!0;var C=T.getDocumentPosition().row;$.start.row!=C&&($.id||y.setRow(C),x(C))}}),y.renderer.on("beforeRender",function(){if(T&&$.start.row!=-1){T.$pos=null;var E=T.getDocumentPosition().row;$.id||y.setRow(E),x(E,!0)}}),y.renderer.on("afterRender",function(){for(var E=y.renderer.$textLayer,C=E.config.firstRow,L=E.config.lastRow;C<=L;C++){var I=E.element.childNodes[C-E.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 E=y.getRow(),C=y.renderer.$textLayer,L=C.element.childNodes[E-C.config.firstRow],I=document.activeElement;if(L!==y.selectedNode&&y.selectedNode&&(s.removeCssClass(y.selectedNode,"ace_selected"),y.selectedNode.removeAttribute(g),y.selectedNode.removeAttribute("id")),I.removeAttribute("aria-activedescendant"),y.selectedNode=L,L){var F=u(E);s.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(){x(-1)},x=function(E,C){E!==$.start.row&&($.start.row=$.end.row=E,C||y.session._emit("changeBackMarker"),y._emit("changeHoverMarker"))};y.getHoveredRow=function(){return $.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(E){var C=y.data[E];return typeof C=="string"?C:C&&C.value||""};var k=y.session.bgTokenizer;return k.$tokenizeRow=function(E){function C(K,J){K&&I.push({type:(L.className||"")+(J||""),value:K})}var L=y.data[E],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,H=0,P=0;P<=B.length;P++)if(P!=H&&(L.matchMask&1<<P||P==B.length)){var j=B.slice(H,P);H=P;var V=R.indexOf(j,N);if(V==-1)continue;C(F.slice(N,V),""),N=V+j.length,C(F.slice(V,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=D,k.start=D,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(E,C){y.filterText=C||"",y.setValue(l.stringRepeat(`
1298
+ `,E.length),-1),y.data=E||[],y.setRow(0)},y.getData=function(E){return y.data[E]},y.getRow=function(){return M.start.row},y.setRow=function(E){E=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,E)),M.start.row!=E&&(y.selection.clearSelection(),M.start.row=M.end.row=E||0,y.session._emit("changeBackMarker"),y.moveCursorTo(E||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(E,C,L,I){if(!I&&y.isOpen&&y.anchorPos&&y.anchor&&y.anchorPos.top===E.top&&y.anchorPos.left===E.left&&y.anchor===L)return!0;var F=this.container,R=this.renderer.scrollBar.width||10,B=window.innerHeight-R,N=window.innerWidth-R,H=this.renderer,P=H.$maxLines*C*1.4,j={top:0,bottom:0},V=B-E.top-3*this.$borderSize-C,K=E.top-3*this.$borderSize;L||(K<=V||V>=P?L="bottom":L="top"),L==="top"?(j.bottom=E.top-this.$borderSize,j.top=j.bottom-P):L==="bottom"&&(j.top=E.top+C+this.$borderSize,j.bottom=j.top+P);var J=j.top>=0&&j.bottom<=B;if(!I&&!J)return!1;J?H.$maxPixelHeight=null:L==="top"?H.$maxPixelHeight=K:H.$maxPixelHeight=V,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=E.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=E,y.anchor=L,s.$fixPositionBug(F),!0},y.show=function(E,C,L){this.tryShow(E,C,L?"bottom":void 0,!0)},y.goTo=function(E){var C=this.getRow(),L=this.session.getLength()-1;switch(E){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 A})();s.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=u}),ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(t,n,d){var i=(function(){function r(p){this.editor=p,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}return r.prototype.setScreenReaderContent=function(p){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(),s=this.popup.renderer.$textLayer,a=s.element.childNodes[l-s.config.firstRow];if(a){for(var c="doc-tooltip ",u=0;u<this._lines.length;u++)c+="ace-inline-screenreader-line-".concat(u," ");a.setAttribute("aria-describedby",c)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=p.split(/\r\n|\r|\n/);var o=this.createCodeBlock();this.screenReaderDiv.appendChild(o)},r.prototype.destroy=function(){this.screenReaderDiv.remove()},r.prototype.createCodeBlock=function(){var p=document.createElement("pre");p.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 s=document.createTextNode(this._lines[o]);l.appendChild(s),p.appendChild(l)}return p},r})();n.AceInlineScreenReader=i}),ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],function(t,n,d){var i=t("../snippets").snippetManager,r=t("./inline_screenreader").AceInlineScreenReader,p=(function(){function o(){this.editor=null}return o.prototype.show=function(l,s,a){if(a=a||"",l&&this.editor&&this.editor!==l&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!l||!s)return!1;this.inlineScreenReader||(this.inlineScreenReader=new r(l));var c=s.snippet?i.getDisplayTextForSnippet(l,s.snippet):s.value;return s.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=p}),ace.define("ace/autocomplete/util",["require","exports","module"],function(t,n,d){n.parForEach=function(r,p,o){var l=0,s=r.length;s===0&&o();for(var a=0;a<s;a++)p(r[a],function(c,u){l++,l===s&&o(c,u)})};var i=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;n.retrievePrecedingIdentifier=function(r,p,o){o=o||i;for(var l=[],s=p-1;s>=0&&o.test(r[s]);s--)l.push(r[s]);return l.reverse().join("")},n.retrieveFollowingIdentifier=function(r,p,o){o=o||i;for(var l=[],s=p;s<r.length&&o.test(r[s]);s++)l.push(r[s]);return l},n.getCompletionPrefix=function(r){var p=r.getCursorPosition(),o=r.session.getLine(p.row),l;return r.completers.forEach(function(s){s.identifierRegexps&&s.identifierRegexps.forEach(function(a){!l&&a&&(l=this.retrievePrecedingIdentifier(o,p.column,a))}.bind(this))}.bind(this)),l||this.retrievePrecedingIdentifier(o,p.column)},n.triggerAutocomplete=function(r,o){var o=o??r.session.getPrecedingCharacter();return r.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,d){var i=t("./keyboard/hash_handler").HashHandler,r=t("./autocomplete/popup").AcePopup,p=t("./autocomplete/inline").AceInline,o=t("./autocomplete/popup").getAriaId,l=t("./autocomplete/util"),s=t("./lib/lang"),a=t("./lib/dom"),c=t("./snippets").snippetManager,u=t("./config"),h=t("./lib/event"),f=t("./lib/scroll").preventParentScroll,g=function(S,w){w.completer&&w.completer.destroy()},v=(function(){function S(){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=s.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=s.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=s.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=s.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=s.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 A(S.completionsForLoading),this.openPopup(this.editor,w.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0))}.bind(this),this.stickySelectionDelay)}return Object.defineProperty(S,"completionsForLoading",{get:function(){return[{caption:u.nls("autocomplete.loading","Loading..."),value:""}]},enumerable:!1,configurable:!0}),S.prototype.$init=function(){return this.popup=new r(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)),h.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},S.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new p,this.inlineRenderer},S.prototype.getPopup=function(){return this.popup||this.$init()},S.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1},S.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))},S.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)},S.prototype.$updateGhostText=function(w){var y=this.base.row,D=this.base.column,T=this.editor.getCursorPosition().column,$=this.editor.session.getLine(y).slice(D,T);this.inlineRenderer.show(this.editor,w,$)?this.$seen(w):this.inlineRenderer.hide()},S.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 D=this.popup.getData(y);D&&(!w||D.hideInlinePreview)&&this.$seen(D)}},S.prototype.$onPopupShow=function(w){this.$onPopupChange(w),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},S.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}},S.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},S.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},S.prototype.$updatePopupPosition=function(){var w=this.editor,y=w.renderer,D=y.layerConfig.lineHeight,T=y.$cursorLayer.getPixelPosition(this.base,!0);T.left-=this.popup.getTextLeftOffset();var $=w.container.getBoundingClientRect();T.top+=$.top-y.layerConfig.offset,T.left+=$.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-D,x=O<M.top?{top:O,left:M.left}:M;this.popup.tryShow(x,D,"bottom")||this.popup.tryShow(T,D,"top")||this.popup.show(T,D)},S.prototype.openPopup=function(w,y,D){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(),$=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($)),(!M||M===-1)&&(M=0),this.popup.setRow(this.autoSelect?M:-1),M===T&&$!==this.completions.filtered[M]&&this.$onPopupChange();var O=this.inlineRenderer&&this.inlineEnabled;if(M===T&&O){var x=this.popup.getData(this.popup.getRow());this.$updateGhostText(x)}D||(this.popup.setTheme(w.getTheme()),this.popup.setFontSize(w.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},S.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()},S.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()},S.prototype.blurListener=function(w){var y=document.activeElement,D=this.editor.textInput.getElement(),T=w.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(w.relatedTarget),$=this.popup&&this.popup.container;y!=D&&y.parentNode!=$&&!T&&y!=this.tooltipNode&&w.relatedTarget!=D&&this.detach()},S.prototype.mousedownListener=function(w){this.detach()},S.prototype.mousewheelListener=function(w){this.popup&&!this.popup.isMouseOver&&this.detach()},S.prototype.mouseOutListener=function(w){this.popup.isOpen&&this.$updatePopupPosition()},S.prototype.goTo=function(w){this.popup.goTo(w)},S.prototype.insertMatch=function(w,y){if(w||(w=this.popup.getData(this.popup.getRow())),!w)return!1;if(w.value==="")return this.detach();var D=this.completions,T=this.getCompletionProvider().insertMatch(this.editor,w,D.filterText,y);return this.completions==D&&this.detach(),T},S.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)},S.prototype.getCompletionProvider=function(w){return this.completionProvider||(this.completionProvider=new b(w)),this.completionProvider},S.prototype.gatherCompletions=function(w,y){return this.getCompletionProvider().gatherCompletions(w,y)},S.prototype.updateCompletions=function(w,y){if(w&&this.base&&this.completions){var T=this.editor.getCursorPosition(),$=this.editor.session.getTextRange({start:this.base,end:T});if($==this.completions.filterText)return;if(this.completions.setFilter($),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==$&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,$,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 A(y.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,"",w)}var D=this.editor.getSession(),T=this.editor.getCursorPosition(),$=l.getCompletionPrefix(this.editor);this.base=D.doc.createAnchor(T.row,T.column-$.length),this.base.$insertRight=!0;var M={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:$,pos:T}).provideCompletions(this.editor,M,function(O,x,k){var E=x.filtered,C=l.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),k){if(!E.length){var L=!this.autoShown&&this.emptyMessage;if(typeof L=="function"&&(L=this.emptyMessage(C)),L){var I=[{caption:L,value:""}];this.completions=new A(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(E.length==1&&E[0].value==C&&!E[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&E.length==1)return this.insertMatch(E[0])}this.completions=!k&&this.showLoadingState?new A(S.completionsForLoading.concat(E),x.filterText):x,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)},S.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},S.prototype.updateDocTooltip=function(){var w=this.popup,y=this.completions&&this.completions.filtered,D=y&&(y[w.getHoveredRow()]||y[w.getRow()]),T=null;if(!D||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var $=this.editor.completers.length,M=0;M<$;M++){var O=this.editor.completers[M];if(O.getDocTooltip&&D.completerId===O.id){T=O.getDocTooltip(D);break}}if(!T&&typeof D!="string"&&(T=D),typeof T=="string"&&(T={docText:T}),!T||!T.docHTML&&!T.docText)return this.hideDocTooltip();this.showDocTooltip(T)},S.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 D=this.tooltipNode;w.docHTML?D.innerHTML=w.docHTML:w.docText&&(D.textContent=w.docText),D.parentNode||this.popup.container.appendChild(this.tooltipNode);var T=this.popup,$=T.container.getBoundingClientRect(),M=400,O=300,x=T.renderer.scrollBar.width||10,k=$.left,E=window.innerWidth-$.right-x,C=T.isTopdown?$.top:window.innerHeight-x-$.bottom,L=[Math.min(E/M,1),Math.min(k/M,1),Math.min(C/O*.9)],I=Math.max.apply(Math,L),F=D.style;F.display="block",I==L[0]?(F.left=$.right+1+"px",F.right="",F.maxWidth=M*I+"px",F.top=$.top+"px",F.bottom="",F.maxHeight=Math.min(window.innerHeight-x-$.top,O)+"px"):I==L[1]?(F.right=window.innerWidth-$.left+"px",F.left="",F.maxWidth=M*I+"px",F.top=$.top+"px",F.bottom="",F.maxHeight=Math.min(window.innerHeight-x-$.top,O)+"px"):I==L[2]&&(F.left=window.innerWidth-$.left+"px",F.maxWidth=Math.min(M,window.innerWidth)+"px",T.isTopdown?(F.top=$.bottom+"px",F.left=$.left+"px",F.right="",F.bottom="",F.maxHeight=Math.min(window.innerHeight-x-$.bottom,O)+"px"):(F.top=T.container.offsetTop-D.offsetHeight+"px",F.left=$.left+"px",F.right="",F.bottom="",F.maxHeight=Math.min(T.container.offsetTop,O)+"px"))},S.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)}},S.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}},S.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},S.for=function(w){return w.completer instanceof S||(w.completer&&(w.completer.destroy(),w.completer=null),u.get("sharedPopups")?(S.$sharedInstance||(S.$sharedInstance=new S),w.completer=S.$sharedInstance):(w.completer=new S,w.once("destroy",g))),w.completer},S})();v.prototype.commands={Up:function(S){S.completer.goTo("up")},Down:function(S){S.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(S){S.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(S){S.completer.goTo("end")},Esc:function(S){S.completer.detach()},Return:function(S){return S.completer.insertMatch()},"Shift-Return":function(S){S.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(S){var w=S.completer.insertMatch();if(w||S.tabstopManager)return w;S.completer.goTo("down")},Backspace:function(S){S.execCommand("backspace");var w=l.getCompletionPrefix(S);!w&&S.completer&&S.completer.detach()},PageUp:function(S){S.completer.popup.gotoPageUp()},PageDown:function(S){S.completer.popup.gotoPageDown()}},v.startCommand={name:"startAutocomplete",exec:function(S,w){var y=v.for(S);y.autoInsert=!1,y.autoSelect=!0,y.autoShown=!1,y.showPopup(S,w),y.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var b=(function(){function S(w){this.initialPosition=w,this.active=!0}return S.prototype.insertByIndex=function(w,y,D){return!this.completions||!this.completions.filtered?!1:this.insertMatch(w,this.completions.filtered[y],D)},S.prototype.insertMatch=function(w,y,D){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,$=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,$+=y.range.end.column-this.initialPosition.pos.column),T||$){var M;w.selection.getAllRanges?M=w.selection.getAllRanges():M=[w.getSelectionRange()];for(var O=0,x;x=M[O];O++)x.start.column-=T,x.end.column+=$,w.session.remove(x)}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},S.prototype.$insertString=function(w,y){var D=y.value||y;w.execCommand("insertstring",D)},S.prototype.gatherCompletions=function(w,y){var D=w.getSession(),T=w.getCursorPosition(),$=l.getCompletionPrefix(w),M=[];this.completers=w.completers;var O=w.completers.length;return w.completers.forEach(function(x,k){x.getCompletions(w,D,T,$,function(E,C){x.hideInlinePreview&&(C=C.map(function(L){return Object.assign(L,{hideInlinePreview:x.hideInlinePreview})})),!E&&C&&(M=M.concat(C)),y(null,{prefix:l.getCompletionPrefix(w),matches:M,finished:--O===0})})}),!0},S.prototype.provideCompletions=function(w,y,D){var T=function(x){var k=x.prefix,E=x.matches;this.completions=new A(E),y.exactMatch&&(this.completions.exactMatch=!0),y.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(k),(x.finished||this.completions.filtered.length)&&D(null,this.completions,x.finished)}.bind(this),$=!0,M=null;if(this.gatherCompletions(w,function(x,k){if(this.active){x&&(D(x,[],!0),this.detach());var E=k.prefix;if(E.indexOf(k.prefix)===0){if($){M=k;return}T(k)}}}.bind(this)),$=!1,M){var O=M;M=null,T(O)}},S.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(w){typeof w.cancel=="function"&&w.cancel()})},S})(),A=(function(){function S(w,y){this.all=w,this.filtered=w,this.filterText=y||"",this.exactMatch=!1,this.ignoreCaption=!1}return S.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,$){return $.exactMatch-T.exactMatch||$.$score-T.$score||(T.caption||T.value).localeCompare($.caption||$.value)});var D=null;y=y.filter(function(T){var $=T.snippet||T.caption||T.value;return $===D?!1:(D=$,!0)}),this.filtered=y},S.prototype.filterCompletions=function(w,y){var D=[],T=y.toUpperCase(),$=y.toLowerCase();e:for(var M=0,O;O=w[M];M++){if(O.skipFilter){O.$score=O.score,D.push(O);continue}var x=!this.ignoreCaption&&O.caption||O.value||O.snippet;if(x){var k=-1,E=0,C=0,L,I;if(this.exactMatch){if(y!==x.substr(0,y.length))continue e}else{var F=x.toLowerCase().indexOf($);if(F>-1)C=F;else for(var R=0;R<y.length;R++){var B=x.indexOf($[R],k+1),N=x.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,E|=1<<R),k=L}}O.matchMask=E,O.exactMatch=C?0:1,O.$score=(O.score||0)-C,D.push(O)}}return D},S})();n.Autocomplete=v,n.CompletionProvider=b,n.FilteredList=A}),ace.define("ace/marker_group",["require","exports","module"],function(t,n,d){var i=(function(){function r(p,o){o&&(this.markerType=o.markerType),this.markers=[],this.session=p,p.addDynamicMarker(this)}return r.prototype.getMarkerAtPosition=function(p){return this.markers.find(function(o){return o.range.contains(p.row,p.column)})},r.prototype.markersComparator=function(p,o){return p.range.start.row-o.range.start.row},r.prototype.setMarkers=function(p){this.markers=p.sort(this.markersComparator).slice(0,this.MAX_MARKERS),this.session._signal("changeBackMarker")},r.prototype.update=function(p,o,l,s){if(!(!this.markers||!this.markers.length))for(var a=s.firstRow,c=s.lastRow,u,h=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?h++:(f=v.range.start.row,h=0),!(h>200))){var b=v.range.clipRows(a,c);if(!(b.start.row===b.end.row&&b.start.column===b.end.column)){var A=b.toScreenRange(l);if(A.isEmpty()){u=l.getNextFoldLine(b.end.row,u),u&&u.end.row>b.end.row&&(a=u.end.row);continue}this.markerType==="fullLine"?o.drawFullLineMarker(p,A,v.className,s):A.isMultiLine()?this.markerType==="line"?o.drawMultiLineMarker(p,A,v.className,s):o.drawTextMarker(p,A,v.className,s):o.drawSingleLineMarker(p,A,v.className+" ace_br15",s)}}}},r})();i.prototype.MAX_MARKERS=1e4,n.MarkerGroup=i}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(t,n,d){function i(l,s){var a=l.getTextRange(p.fromPoints({row:0,column:0},s));return a.split(o).length-1}function r(l,s){var a=i(l,s),c=l.getValue().split(o),u=Object.create(null),h=c[a];return c.forEach(function(f,g){if(!(!f||f===h)){var v=Math.abs(a-g),b=c.length-v;u[f]?u[f]=Math.max(b,u[f]):u[f]=b}}),u}var p=t("../range").Range,o=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;n.getCompletions=function(l,s,a,c,u){var h=r(s,a),f=Object.keys(h);u(null,f.map(function(g){return{caption:g,value:g,score:h[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,d){var i=t("../snippets").snippetManager,r=t("../autocomplete").Autocomplete,p=t("../config"),o=t("../lib/lang"),l=t("../autocomplete/util"),s=t("../marker_group").MarkerGroup,a=t("../autocomplete/text_completer"),c={getCompletions:function($,M,O,x,k){if(M.$mode.completer)return M.$mode.completer.getCompletions($,M,O,x,k);var E=$.session.getState(O.row),C=M.$mode.getCompletions(E,M,O,x);C=C.map(function(L){return L.completerId=c.id,L}),k(null,C)},id:"keywordCompleter"},u=function($){var M={};return $.replace(/\${(\d+)(:(.*?))?}/g,function(O,x,k,E){return M[x]=E||""}).replace(/\$(\d+?)/g,function(O,x){return M[x]})},h={getCompletions:function($,M,O,x,k){var E=[],C=M.getTokenAt(O.row,O.column);C&&C.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?E.push("html-tag"):E=i.getActiveScopes($);var L=i.snippetMap,I=[];E.forEach(function(F){for(var R=L[F]||[],B=R.length;B--;){var N=R[B],H=N.name||N.tabTrigger;H&&I.push({caption:H,snippet:N.content,meta:N.tabTrigger&&!N.name?N.tabTrigger+"⇥ ":"snippet",completerId:h.id})}},this),k(null,I)},getDocTooltip:function($){$.snippet&&!$.docHTML&&($.docHTML=["<b>",o.escapeHTML($.caption),"</b>","<hr></hr>",o.escapeHTML(u($.snippet))].join(""))},id:"snippetCompleter"},f=[h,a,c];n.setCompleters=function($){f.length=0,$&&f.push.apply(f,$)},n.addCompleter=function($){f.push($)},n.textCompleter=a,n.keyWordCompleter=c,n.snippetCompleter=h;var g={name:"expandSnippet",exec:function($){return i.expandWithTab($)},bindKey:"Tab"},v=function($,M){b(M.session.$mode)},b=function($){typeof $=="string"&&($=p.$modes[$]),$&&(i.files||(i.files={}),A($.$id,$.snippetFileId),$.modes&&$.modes.forEach(b))},A=function($,M){!M||!$||i.files[$]||(i.files[$]={},p.loadModule(M,function(O){O&&(i.files[$]=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(x){b("ace/mode/"+x)})))}))},S=function($){var M=$.editor,O=M.completer&&M.completer.activated;if($.command.name==="backspace")O&&!l.getCompletionPrefix(M)&&M.completer.detach();else if($.command.name==="insertstring"&&!O){w=$;var x=$.editor.$liveAutocompletionDelay;x?y.delay(x):D($)}},w,y=o.delayedCall(function(){D(w)},0),D=function($){var M=$.editor,O=l.getCompletionPrefix(M),x=$.args,k=l.triggerAutocomplete(M,x);if(O&&O.length>=M.$liveAutocompletionThreshold||k){var E=r.for(M);E.autoShown=!0,E.showPopup(M)}},T=t("../editor").Editor;t("../config").defineOptions(T.prototype,"editor",{enableBasicAutocompletion:{set:function($){$?(r.for(this),this.completers||(this.completers=Array.isArray($)?$:f),this.commands.addCommand(r.startCommand)):this.commands.removeCommand(r.startCommand)},value:!1},enableLiveAutocompletion:{set:function($){$?(this.completers||(this.completers=Array.isArray($)?$:f),this.commands.on("afterExec",S)):this.commands.off("afterExec",S)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function($){$?(this.commands.addCommand(g),this.on("changeMode",v),v(null,this)):(this.commands.removeCommand(g),this.off("changeMode",v))},value:!1}}),n.MarkerGroup=s}),(function(){ace.require(["ace/ext/language_tools"],function(t){m&&(m.exports=t)})})()})($d);const Xr={jsonError:{border:"1px solid red",minHeight:200},jsonNoError:{border:"1px solid #00000000",minHeight:200}};function tr(m){return _.createElement(bd,{style:m.error===!0?Xr.jsonError:m.error===!1?Xr.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 gs={flex:{display:"flex"},button:{height:48,minWidth:48},wrapper:{width:"calc(100vw - 40px)",height:"calc(100vh - 188px)"}};class xd extends U{componentDidMount(){super.componentDidMount();const{data:e,attr:t}=this.props,n=U.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?Vo.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:d,attr:i}=this.props,{value:r,showSelectId:p}=this.state,o=n.readOnly===!0||t;return _.createElement(fe,{fullWidth:!0,variant:"standard"},_.createElement("div",{style:gs.flex},_.createElement(Se,{color:"grey",style:gs.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},W.I18n.t("ra_JSON editor"))),p?_.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:U.getValue(d,i)||{}})},onApply:o?void 0:()=>this.setState({showSelectId:!1},()=>this.onChange(i,r))},_.createElement("div",{style:{...gs.wrapper,border:this.state.jsonError?"2px solid red":"2px solid transparent"}},_.createElement(tr,{mode:this.props.schema.json5?"json5":"json",value:typeof r=="object"?JSON.stringify(r):r,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?W.I18n.t("ra_Invalid JSON"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const _d=[{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 kd extends U{componentDidMount(){super.componentDidMount();const e=U.getValue(this.props.data,this.props.attr),t=[..._d];this.props.schema.system?t.unshift({value:"",label:W.I18n.t("ra_System language")}):t.unshift({value:"",label:W.I18n.t("ra_none")}),this.setState({value:this.props.schema.system?e||"":e||W.I18n.getLanguage(),selectOptions:t})}renderItem(e,t){var d,i;if(!this.state.selectOptions)return null;const n=(d=this.state.selectOptions)==null?void 0:d.find(r=>r.value===this.state.value||!r.value&&!this.state.value);return _.createElement(fe,{fullWidth:!0,variant:"standard"},this.props.schema.label?_.createElement(Te,null,this.getText(this.props.schema.label)):null,_.createElement(Be,{variant:"standard",error:!!e,disabled:t,value:this.state.value||"_",renderValue:()=>this.getText(n==null?void 0:n.label,this.props.schema.noTranslation),onChange:r=>{let{value:p}=r.target;p==="_"&&(p=""),this.setState({value:p},()=>{const o=this.onChange(this.props.attr,p);if(o instanceof Promise&&o.catch(l=>console.error(l)),this.props.schema.changeGuiLanguage)if(p){if(p===W.I18n.getLanguage())return;W.I18n.setLanguage(p),this.props.oContext.changeLanguage&&this.props.oContext.changeLanguage()}else this.props.oContext.socket.getSystemConfig().then(l=>{l.common.language!==W.I18n.getLanguage()&&l.common.language&&(W.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(r=>_.createElement(xe,{key:r.value,value:r.value},r.label))),this.props.schema.help?_.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Td extends U{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}componentDidMount(){super.componentDidMount(),U.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(Ut,{maxWidth:"lg",open:!0,onClose:(n,d)=>{d!=="escapeKeyDown"&&d!=="backdropClick"&&this.setState({showLicenseDialog:!1})}},_.createElement(gn,null,this.props.schema.title?W.I18n.t(this.props.schema.title):W.I18n.t("ra_License agreement")),_.createElement(mn,null,this.props.schema.licenseUrl?_.createElement(_.Fragment,null,this.state.loading?_.createElement(Pi,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,d)=>this.props.schema.noTranslation?_.createElement("p",{key:d},n):_.createElement("p",{key:d},W.I18n.t(n)))):null),_.createElement(vn,null,this.props.schema.checkBox?_.createElement(Qn,{control:_.createElement(Qt,{disabled:t,checked:!!this.state.licenseChecked,onClick:()=>this.setState({licenseChecked:!this.state.licenseChecked})}),label:W.I18n.t(this.props.schema.checkBox)}):null,_.createElement(Se,{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(d=>console.error(`Cannot set value: ${d}`))},color:"primary",variant:"contained",startIcon:_.createElement(Us,null)},this.props.schema.agreeText?W.I18n.t(this.props.schema.agreeText):W.I18n.t("ra_Accept license")),_.createElement(Se,{onClick:()=>{this.setState({showLicenseDialog:!1}),setTimeout(()=>this.setState({showLicenseDialog:!0}),2e3)},color:"grey",variant:"contained",startIcon:_.createElement(_t,null)},W.I18n.t("ra_Close")))):null}}const Zr={indeterminate:{opacity:.5},control:{flexDirection:"row",width:"100%"}};class Ld extends U{updateTimeout;componentDidMount(){super.componentDidMount();let e=U.getValue(this.props.data,this.props.attr);if(e==null&&(e=""),Array.isArray(e)&&this.props.oContext.multiEdit){e=U.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=U.getValue(e.data,e.attr);return e.oContext.multiEdit&&t._value===U.DIFFERENT_VALUE?{_value:U.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===U.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 r=U.getValue(this.props.data,this.props.attr),p=(r==null?void 0:r.filter(o=>o||o===0).map(o=>({label:o.toString(),value:o})))||[];return p.unshift({label:W.I18n.t(U.DIFFERENT_LABEL),value:U.DIFFERENT_VALUE}),_.createElement(Bi,{style:Zr.indeterminate,fullWidth:!0,freeSolo:!0,value:p[0],getOptionSelected:(o,l)=>o.label===l.label,onChange:(o,l)=>{const s=this.onChange(this.props.attr,l==null?void 0:l.value,()=>{this.setState({_value:l==null?void 0:l.value,oldValue:this.state._value})});s instanceof Promise&&s.catch(a=>console.error(a))},options:p,getOptionLabel:o=>o.label,renderInput:o=>_.createElement(de,{...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=W.I18n.t(e)));const d=parseFloat(((i=this.state._value)==null?void 0:i.toString().replace(",","."))||"");return _.createElement(fe,{variant:"standard",style:Zr.control},_.createElement(de,{sx:{"& .up-down":{display:"none"},"&:hover .up-down":{display:"block"}},variant:"standard",type:Number.isNaN(d)?"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===null||this.state._value===void 0?"":this.state._value,error:!!e,disabled:!!t,onChange:r=>{const p=r.target.value,o=this.checkValue(p);o?this.onError(this.props.attr,W.I18n.t(o)):this.onError(this.props.attr),this.setState({_value:p,oldValue:this.state._value},()=>{const l=parseFloat(p.toString().replace(",","."));Number.isNaN(l)?this.onChange(this.props.attr,p.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 Md extends U{authWindow;oid;url;constructor(e){super(e),this.state={...this.state,accessTokens:"",success:!1,blocked:!1,running:!1,pressed:!1},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(){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);const e=await this.props.oContext.socket.getState(this.oid);if(e){const t=JSON.parse(e.val);new Date(t.access_token_expires_on).getTime()>Date.now()&&this.setState({accessTokens:e.val})}}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.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,d;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):(d=(n=this.props).onError)==null||d.call(n,i[2])}};onOpenUrl(){this.authWindow=window.open(this.url,this.props.schema.identifier),!this.authWindow||this.authWindow.closed||typeof this.authWindow.closed>"u"?this.setState({blocked:!0}):this.setState({pressed:!0})}renderItem(){let e="";if(this.state.accessTokens)try{const d=JSON.parse(this.state.accessTokens);e=new Date(d.access_token_expires_on).toLocaleString()}catch{}let t;this.state.accessTokens?t=this.props.schema.refreshLabel?this.getText(this.props.schema.refreshLabel):W.I18n.t("ra_Renew %s access",this.props.schema.identifier[0].toUpperCase()+this.props.schema.identifier.slice(1)):t=this.props.schema.label?this.getText(this.props.schema.label):W.I18n.t("ra_Get %s access",this.props.schema.identifier[0].toUpperCase()+this.props.schema.identifier.slice(1));const n=this.getIcon();return _.createElement("div",{style:{width:"100%",margin:"0 0 1rem 0"}},_.createElement(Se,{disabled:this.state.running,endIcon:n||_.createElement($c,null),variant:"contained",onClick:()=>this.onOpenUrl()},t),this.state.blocked?_.createElement("div",{style:{color:"red",fontSize:16,marginTop:20}},W.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?W.I18n.t("ra_Successfully authorized. Token valid till %s and will be automatically renewed.",e):W.I18n.t("ra_Successfully authorized. Token valid till %s but it can expire as the instance is not running.",e)):null,this.state.pressed?_.createElement(_.Fragment,null,_.createElement("div",{style:{width:"100%",margin:"1rem 0 1rem 0"}},_.createElement("span",{style:{marginRight:4}},`${W.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(de,{value:this.state.accessTokens,label:W.I18n.t("ra_Enter the code from that page here"),variant:"standard",onChange:d=>{let i=d.target.value;i&&!i.startsWith("{")&&(i=atob(i));try{const r=JSON.parse(i);r.access_token&&(r.access_token_expires_on=new Date(Date.now()+(r.expires_in-10)*1e3).toISOString(),this.setState({accessTokens:JSON.stringify(r)},()=>this.saveToken(this.state.accessTokens)))}catch{}},fullWidth:!0})):null)}}const qr={flex:{display:"flex"},button:{maxHeight:48,marginLeft:4,minWidth:48}};class Id extends U{componentDidMount(){super.componentDidMount();const{data:e,attr:t}=this.props,n=U.getValue(e,t)||"";this.setState({value:n,initialized:!0})}renderItem(e,t){if(!this.state.initialized)return null;const n=this.props.oContext.socket,{schema:d,attr:i}=this.props,{value:r,showSelectId:p}=this.state;return _.createElement(fe,{fullWidth:!0,variant:"standard"},d.label?_.createElement(Te,{shrink:!0},this.getText(d.label)):null,_.createElement("div",{style:qr.flex},_.createElement(de,{variant:"standard",fullWidth:!0,value:r,error:!!e,disabled:t,placeholder:this.getText(d.placeholder),label:this.getText(d.label),helperText:this.renderHelp(d.help,d.helpLink,d.noTranslation),onChange:o=>{const l=o.target.value;this.setState({value:l},()=>this.onChange(i,l))}}),_.createElement(Se,{color:"grey",disabled:t,style:qr.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},"...")),p?_.createElement(W.DialogSelectID,{imagePrefix:this.props.oContext.imagePrefix===void 0?"../..":this.props.oContext.imagePrefix,dialogName:`admin.${this.props.oContext.adapterName}`,filterFunc:d.filterFunc,themeType:this.props.oContext.themeType,theme:this.props.oContext.theme,types:d.types?Array.isArray(d.types)?d.types:[d.types]:void 0,customFilter:d.customFilter,filters:d.filters,socket:n,selected:r,root:d.root,onClose:()=>this.setState({showSelectId:!1}),onOk:o=>this.setState({showSelectId:!1,value:o},()=>this.onChange(i,o))}):null)}}const ms={fullWidth:{width:"100%",display:"inline-block"},halfWidth1:{width:"calc(50% - 5px)",display:"inline-block",marginRight:8},halfWidth2:{width:"calc(50% - 5px)",display:"inline-block"}},fi="____ppp____";class Od extends U{componentDidMount(){super.componentDidMount();const e=U.getValue(this.props.data,this.props.attr);this.setState({_repeat:e?fi:"",_visible:!1,value:e?fi:"",_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,W.I18n.t("ra_Passwords are not equal!"));else{this.onError(this.props.attr);const d=this.onChange(this.props.attr,e);d instanceof Promise&&d.catch(i=>this.onError(this.props.attr,i))}})}renderItem(e,t){if(this.state._notEqual===void 0)return null;const n=_.createElement(de,{variant:"standard",fullWidth:!0,type:this.state._visible&&this.state.value!==fi?"text":"password",value:this.state.value,error:!!e||this.state._notEqual,disabled:!!t,onChange:d=>this.onChangePassword(d.target.value),label:this.getText(this.props.schema.label),slotProps:{input:{autoComplete:"new-password",endAdornment:this.state.value&&this.state.value!==fi&&this.props.schema.visible&&!t&&!this.props.schema.readOnly?_.createElement(fn,{position:"end"},_.createElement(re,{size:"large",tabIndex:-1,onClick:d=>{d.preventDefault(),d.stopPropagation(),this.setState({_visible:!this.state._visible})},edge:"end"},this.state._visible?_.createElement(xc,null):_.createElement(Po,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?W.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 d=this.state._visible?null:_.createElement(de,{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)} (${W.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?W.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:ms.fullWidth},_.createElement("div",{style:ms.halfWidth1},n),_.createElement("div",{style:ms.halfWidth2},d))}return n}}class Fd extends U{renderItem(e,t){return _.createElement(de,{variant:"standard",fullWidth:!0,disabled:!!t,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?_.createElement(re,{tabIndex:-1,size:"small",onClick:()=>{W.Utils.copyToClipboard(this.getPattern(this.props.schema.pattern,null,this.props.schema.noTranslation)),window.alert(W.I18n.t("ra_Copied"))}},_.createElement(W.IconCopy,null)):void 0}},value:this.getPattern(this.props.schema.pattern,null,!0),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const Rd={warning:{"& .Mui-error":{color:"orange"}}};class Nd extends U{updateTimeout;async componentDidMount(){super.componentDidMount();let e=U.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}`,d=await this.props.oContext.socket.getObject(n),i=d==null?void 0:d.common.host,r=[];t.forEach(p=>{var l,s,a,c;if(!p||p._id===n||p.common.host!==i||!((l=p.native)!=null&&l.bind))return;if(p!=null&&p.native&&p.native.secure&&p.native.leEnabled&&p.native.leUpdate){const u=parseInt(p.native.leCheckPort||p.native.lePort,10);u&&r.push({name:`${p._id.replace("system.adapter.","")} (LE)`,port:u,v6bind:p.native.bind.includes(":")?p.native.bind:p.native.v6bind,bind:p.native.bind,enabled:!!((s=p.common)!=null&&s.enabled)})}const o=parseInt((a=p==null?void 0:p.native)==null?void 0:a.port,10);o&&r.push({name:p._id.replace("system.adapter.",""),bind:p.native.bind,v6bind:p.native.bind.includes(":")?p.native.bind:p.native.v6bind,port:o,enabled:!!((c=p.common)!=null&&c.enabled)})}),this.setState({ports:r})}static getDerivedStateFromProps(e,t){const n=U.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===void 0?20:this.props.schema.min,n=this.props.schema.max||65535;e=e.toString().trim();const d=e===""?0:parseInt(e,10);return e!==""&&Number.isNaN(d)?"ra_Not a number":e!==""&&window.isFinite(Number(e))?d<t?"ra_Too small":d>n?"ra_Too big":e===""||e==="-"||Number.isNaN(d)?"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===void 0?20:this.props.schema.min,d=this.props.schema.max||65535;let i;if(this.state.ports){const r=parseInt(this.state._value,10);if(r){const p=this.props.data.bind,o=this.state.ports.filter(s=>{if(s.port!==r)return!1;const a=s.bind,c=s.v6bind;return!p||!a||p==="0.0.0.0"||a==="0.0.0.0"||p==="::"||c==="::"||p===a||p===c});let l=o.findIndex(s=>s.port===r&&s.enabled);if(l!==-1){const s=this.state.ports.find(a=>a.port===r&&a.enabled&&o.some(c=>c.name===a.name&&c.bind===a.bind));e=W.I18n.t("ra_Port is already used by %s",(s==null?void 0:s.name)||o[l].name)}else if(l=o.findIndex(s=>s.port===r&&!s.enabled),l!==-1){i=!0;const s=this.state.ports.find(a=>a.port===r&&!a.enabled&&o.some(c=>c.name===a.name&&c.bind===a.bind));e=W.I18n.t("ra_Port could be used by %s",(s==null?void 0:s.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=W.I18n.t(e))),_.createElement(de,{variant:"standard",type:"number",fullWidth:!0,slotProps:{htmlInput:{min:n,max:d,readOnly:this.props.schema.readOnly||!1}},value:this.state._value===null||this.state._value===void 0?"":this.state._value,error:!!e,disabled:!!t,sx:i?Rd.warning:void 0,onChange:r=>{const p=Number(r.target.value.toString().replace(/[^0-9]/g,"")).toString(),o=this.checkValue(p);o?this.onError(this.props.attr,W.I18n.t(o)):this.onError(this.props.attr),this.setState({_value:p,oldValue:this.state._value},()=>{if(p.trim()===parseInt(p,10).toString()){const l=this.onChange(this.props.attr,parseInt(p,10)||0);l instanceof Promise&&l.catch(s=>{console.error(`Cannot set value for ${this.props.attr}: ${s}`)})}})},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 Bd extends U{componentDidMount(){super.componentDidMount();const e=U.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums("rooms").then(t=>{const n=Object.keys(t).map(d=>({value:this.props.schema.short?d.replace("enum.rooms.",""):d,label:this.getText(t[d].common.name),obj:t[d]}));this.props.schema.allowDeactivate!==!1&&n.unshift({label:W.I18n.t(U.NONE_LABEL),value:U.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(d=>d.value===this.state.value);return _.createElement(fe,{variant:"standard",fullWidth:!0},this.props.schema.label?_.createElement(Te,null,this.getText(this.props.schema.label)):null,_.createElement(Be,{variant:"standard",error:!!e,disabled:!!t,value:this.state.value||"_",renderValue:()=>n?n.obj?_.createElement(W.TextWithIcon,{value:n.obj,themeType:this.props.oContext.themeType,lang:W.I18n.getLanguage()}):n.label:"",onChange:d=>{this.setState({value:d.target.value==="_"?"":d.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(d=>_.createElement(xe,{key:d.value,value:d.value,style:d.value===U.DIFFERENT_VALUE?{opacity:.5}:{}},d.obj?_.createElement(W.TextWithIcon,{value:d.obj,themeType:this.props.oContext.themeType,lang:W.I18n.getLanguage()}):d.label))),this.props.schema.help?_.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Pd={noMargin:{"&>div":{marginTop:0}}};class Wd extends U{initialValue="";componentDidMount(){super.componentDidMount();let e=U.getValue(this.props.data,this.props.attr);this.props.schema.multiple&&(typeof e=="string"?e=[e]:e==null&&(e=[]));const t=[];if((this.props.schema.options||[]).forEach(n=>{const d=n;Array.isArray(d.items)?(t.push({label:this.getText(n.label,this.props.schema.noTranslation),value:n.value,group:!0,color:n.color,description:this.getText(n.description)}),d.items.forEach(i=>t.push({label:this.getText(i.label,this.props.schema.noTranslation),value:i.value,hidden:i.hidden,color:n.color,description:this.getText(n.description)}))):t.push({label:this.getText(n.label,this.props.schema.noTranslation),value:n.value,hidden:n.hidden,color:n.color,description:this.getText(n.description)})}),this.props.onFilterLabelUpdate&&this.props.table){const n={};for(const d of t)!d.group&&d.value!==U.DIFFERENT_VALUE&&(n[d.value.toString()]=d.label);this.props.onFilterLabelUpdate(this.props.attr,n)}Array.isArray(e)&&!this.props.schema.multiple?(this.initialValue=[...e],t.unshift({label:W.I18n.t(U.DIFFERENT_LABEL),value:U.DIFFERENT_VALUE}),this.setState({value:U.DIFFERENT_VALUE,selectOptions:t})):this.setState({value:e,selectOptions:t})}_getValue(){let e=this.state.value===null||this.state.value===void 0?U.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof e=="string"?e=[e]:e==null&&(e=[])),e}_filterOptions(e){return(e||[]).filter(t=>t.hidden?this.props.custom?!this.executeCustom(t.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!this.execute(t.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!0)}renderRadio(e,t){const n=this._filterOptions(this.state.selectOptions).filter(i=>!i.group),d=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(nc,null,this.getText(this.props.schema.label)):null,_.createElement(ic,{value:d==null?"":d.toString(),onChange:i=>{const r=n.find(o=>o.value.toString()===i.target.value),p=r?r.value:i.target.value;this.setState({value:p},()=>{const o=this.onChange(this.props.attr,p);o instanceof Promise&&o.catch(l=>console.error(l))})}},n.map((i,r)=>_.createElement(Qn,{key:r,value:i.value.toString(),control:_.createElement(sc,null),title:i.description||"",label:_.createElement(vt,{component:"span",style:{color:i.color}},i.label),style:i.value===U.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._filterOptions(this.state.selectOptions),d=this._getValue(),i=this.props.schema.multiple?null:n.find(r=>r.value==d);return _.createElement(fe,{variant:"standard",fullWidth:!0,sx:this.props.table!==void 0&&Pd.noMargin,id:`jsonSelect_${this.props.attr}_${this.props.index||this.props.index===0?this.props.index:""}`},this.props.schema.label?_.createElement(Te,null,this.getText(this.props.schema.label)):null,_.createElement(Be,{variant:"standard",error:!!e,multiple:this.props.schema.multiple,disabled:!!t,value:d||"_",renderValue:r=>this.props.schema.multiple?_.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:.5}},r.map(p=>{const o=n.find(l=>l.value===p);if(o||this.props.schema.showAllValues!==!1){const l=(o==null?void 0:o.label)||p;return _.createElement(zs,{key:p,label:l})}return null})):i!=null&&i.color?_.createElement(_.Fragment,null,_.createElement("div",{style:{color:i.color}},i.label===void 0?r:i.label),i.description?_.createElement("div",{style:{opacity:.7,fontStyle:"italic",fontSize:"smaller"}},i.description):null):(i==null?void 0:i.label)===void 0?r:_.createElement(_.Fragment,null,_.createElement("div",null,i.label),i.description?_.createElement("div",{style:{opacity:.7,fontStyle:"italic",fontSize:"smaller"}},i.description):null),onChange:r=>{this.setState({value:r.target.value==="_"?"":r.target.value},()=>{let p;this.state.value===U.DIFFERENT_VALUE?p=this.onChange(this.props.attr,this.initialValue):p=this.onChange(this.props.attr,this.state.value),p instanceof Promise&&p.catch(o=>console.error(o))})}},n.map((r,p)=>r.group?_.createElement(xo,{key:p,style:{color:r.color}},_.createElement("div",null,r.label),i.description?_.createElement("div",{style:{opacity:.7,fontStyle:"italic",fontSize:"smaller"}},i.description):null):_.createElement(xe,{key:p,value:r.value,style:r.value===U.DIFFERENT_VALUE?{opacity:.5}:{}},this.props.schema.multiple?_.createElement(Qt,{checked:d.includes(r.value),onClick:()=>{const o=JSON.parse(JSON.stringify(this._getValue())),l=d.indexOf(r.value);l!==-1?o.splice(l,1):(o.push(r.value),o.sort()),this.setState({value:o},()=>this.onChange(this.props.attr,o))}}):null,_.createElement(Hs,{primary:r.label,secondary:r.description,slotProps:{secondary:{style:{fontSize:"smaller",fontStyle:"italic",opacity:.7}}},style:{color:r.color}})))),this.props.schema.help?_.createElement(ge,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const jd={menuPaper:{maxHeight:800}};class zd extends U{initialized=!1;localContext;askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const t=this.getPattern(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},()=>{this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",e).then(t=>{this.reportFilterLabels(t),this.setState({list:t,running:!1})}).catch(t=>{console.error(`Cannot send command: ${t}`)})})}else{const e=U.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!==U.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]=U.getValue(this.props.data,t)),JSON.stringify(e)}_getValue(){let e=this.state.value===null||this.state.value===void 0?U.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof e=="string"?e=[e]:e==null&&(e=[])),e}renderItem(e,t){if(this.props.alive){const r=this.getContext();(r!==this.localContext||!this.initialized)&&(this.localContext=r,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?W.I18n.t("ra_Cannot retrieve options, as instance is offline"):_.createElement(de,{variant:"standard",fullWidth:!0,value:n,error:!!e,disabled:!!t,onChange:r=>{const p=r.target.value;this.setState({value:p},()=>this.onChange(this.props.attr,(p||"").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(fn,{position:"end"},_.createElement(re,{tabIndex:-1,size:"small",onClick:()=>this.setState({value:""},()=>this.onChange(this.props.attr,""))},_.createElement(_t,null))):null}}});if(this.state.running)return _.createElement(Tt,{size:"24"});const d=this.state.list.filter(r=>r.hidden?this.props.custom?!this.executeCustom(r.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!this.execute(r.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!0),i=d.find(r=>r.value===n);return _.createElement(fe,{variant:"standard",fullWidth:!0},this.props.schema.label?_.createElement(Te,null,this.getText(this.props.schema.label)):null,_.createElement(Be,{variant:"standard",error:!!e,multiple:this.props.schema.multiple,disabled:!!t,sx:{"&.MuiSelect-paper":this.props.schema.multiple?jd.menuPaper:void 0},value:n,renderValue:r=>this.props.schema.multiple?_.createElement(Ie,{sx:{display:"flex",flexWrap:"wrap",gap:.5}},r.map(p=>{const o=d.find(l=>l.value===p);if(o||this.props.schema.showAllValues!==!1){const l=(o==null?void 0:o.label)||p;return _.createElement(zs,{key:p,label:l})}return null})):this.getText((i==null?void 0:i.label)||r,this.props.schema.noTranslation),onChange:r=>{const p=this.onChange(this.props.attr,r.target.value);p instanceof Promise&&p.catch(o=>console.error(`Cannot set value: ${o}`))}},d.map((r,p)=>r.group?_.createElement(xo,{key:p},_.createElement("div",null,this.getText(r.label,this.props.schema.noTranslation)),r.description?_.createElement("div",{style:{opacity:.7,fontStyle:"italic",fontSize:"smaller"}},this.getText(r.description)):null):_.createElement(xe,{key:p,value:r.value},this.props.schema.multiple?_.createElement(Qt,{checked:n.includes(r.value),onClick:()=>{const o=JSON.parse(JSON.stringify(this._getValue())),l=n.indexOf(r.value);l!==-1?o.splice(l,1):(o.push(r.value),o.sort()),this.setState({value:o},()=>this.onChange(this.props.attr,o))}}):null,_.createElement(Hs,{primary:this.getText(r.label),secondary:this.getText(r.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 eo={fullWidth:{width:"100%"}};function St(m){return m.split(".").reduce((e,t)=>(e<<8)+parseInt(t,10),0)>>>0}function Hd(m,e){var d,i;const t=(i=(d=m==null?void 0:m.native)==null?void 0:d.hardware)==null?void 0:i.networkInterfaces;if(!t)return null;let n;return Object.keys(t).forEach(r=>t[r].forEach(p=>{p.internal||e.includes(":")&&p.family!=="IPv6"||e.includes(".")&&!e.match(/[^.\d]/)&&p.family!=="IPv4"||(p.family==="IPv4"&&!p.address.startsWith("172")&&(e==="127.0.0.0"||e==="localhost"||e.match(/[^.\d]/))?n=p.address:n||(p.family==="IPv4"&&e.includes(".")&&(St(e)&St(p.netmask),St(p.address)&St(p.netmask)),n=p.address))})),n||Object.keys(t).forEach(r=>t[r].forEach(p=>{p.internal||e.includes(":")&&p.family!=="IPv6"||e.includes(".")&&!e.match(/[^.\d]/)&&p.family!=="IPv4"||(p.family==="IPv6"&&(e==="127.0.0.0"||e==="localhost"||e.match(/[^.\d]/))?n=p.address:n||(p.family==="IPv4"&&e.includes(".")&&(St(e)&St(p.netmask),St(p.address)&St(p.netmask)),n=p.address))})),n||Object.keys(t).forEach(r=>{t[r].forEach(p=>{p.internal||e.includes(":")&&p.family!=="IPv6"||e.includes(".")&&!e.match(/[^.\d]/)&&p.family!=="IPv4"||(e==="127.0.0.0"||e==="localhost"||e.match(/[^.\d]/),n=p.address)})}),n||Object.keys(t).forEach(r=>{t[r].forEach(p=>{p.internal||(n=p.address)})}),n}class to extends U{async componentDidMount(){var t;super.componentDidMount();let e=window.location.hostname;if(this.props.schema.openUrl){const n=await this.props.oContext.socket.getCurrentInstance(),d=await this.props.oContext.socket.getObject(`system.adapter.${n}`);if(d){const i=await this.props.oContext.socket.getObject(`system.host.${(t=d==null?void 0:d.common)==null?void 0:t.host}`);if(i){const r=Hd(i,window.location.hostname);if(r)e=`${r}:${window.location.port}`;else{console.warn(`Cannot find suitable IP in host ${d.common.host} for ${d._id}`);return}}}}await new Promise(n=>{this.setState({_error:"",_message:"",hostname:e},n)}),this.props.schema.onLoaded&&this._onClick()}renderErrorDialog(){return this.state._error?_.createElement(W.DialogError,{text:this.state._error,onClose:()=>this.setState({_error:""})}):null}renderMessageDialog(){return this.state._message?_.createElement(W.DialogMessage,{text:this.state._message,onClose:()=>this.setState({_message:""})}):null}renderCopyDialog(){return this.state._copyDialog?_.createElement(Qs,{title:this.getText(this.state._copyDialog.title||W.I18n.t("ra_Result")),overflowHidden:!0,onClose:()=>{this.setState({_copyDialog:null})},onApply:()=>{W.copy(this.state._copyDialog.text),window.alert(W.I18n.t("ra_Copied")),this.setState({_copyDialog:null})},titleButtonApply:W.I18n.t("ra_Copy content")},_.createElement("div",{style:{width:"calc(100vw - 40px)",height:"calc(100vh - 188px)"}},_.createElement(tr,{mode:this.state._copyDialog.type,value:this.state._copyDialog.text,name:"CopyDialog",themeType:this.props.oContext.themeType}))):null}_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 i=this.getPattern(this.props.schema.jsonData,{_origin:e,_originIp:t,...this.props.data},!0);try{n=JSON.parse(i)}catch{console.error(`Cannot parse json data: ${i}`)}}n===void 0&&(n=null),this.props.schema.openUrl&&!n&&(n={_origin:e,_originIp:t});let d;this.props.schema.timeout&&(d=setTimeout(()=>{this.props.oContext.onCommandRunning(!1),this.setState({_error:W.I18n.t("ra_Request timed out"),running:!1})},parseInt(this.props.schema.timeout,10)||1e4)),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",n).then(async i=>{var r,p,o,l,s,a;if(d&&(clearTimeout(d),d=void 0),i!=null&&i.error)if((r=this.props.schema.error)!=null&&r[i.error]){let c=this.getText(this.props.schema.error[i.error]);(p=i.args)==null||p.forEach(u=>c=c.replace("%s",u)),this.setState({_error:c})}else this.setState({_error:i.error?typeof i.error=="string"?W.I18n.t(i.error):JSON.stringify(i.error):W.I18n.t("ra_Error")});else{if(i!=null&&i.command){(l=(o=this.props.oContext).onBackEndCommand)==null||l.call(o,i.command);return}if(i!=null&&i.reloadBrowser&&this.props.schema.reloadBrowser)window.location.reload();else if(i!=null&&i.openUrl&&this.props.schema.openUrl)window.open(i.openUrl,i.window||this.props.schema.window||"_blank");else if(i!=null&&i.result&&((s=this.props.schema.result)!=null&&s[i.result])){let c=this.getText(this.props.schema.result[i.result]);(a=i.args)==null||a.forEach(u=>c=c.replace("%s",u)),window.alert(c)}if(i!=null&&i.native&&this.props.schema.useNative){for(const[c,u]of Object.entries(i.native))await this.onChangeAsync(c,u);setTimeout(()=>this.props.oContext.forceUpdate(Object.keys(i.native),this.props.data),300)}else i!=null&&i.result?window.alert(typeof i.result=="object"?JSON.stringify(i.result):i.result):i!=null&&i.copyDialog?this.setState({_copyDialog:i.copyDialog}):window.alert(W.I18n.t("ra_Ok"));i!=null&&i.saveConfig&&this.props.onChange(null,null,null,!0)}}).catch(i=>{this.props.schema.error&&this.props.schema.error[i.toString()]?this.setState({_error:this.getText(this.props.schema.error[i.toString()])}):this.setState({_error:W.I18n.t(i.toString())||W.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(Kt,null):e.type==="info"&&(t=_.createElement(Ti,null)),_.createElement(W.DialogConfirm,{title:this.getText(e.title)||W.I18n.t("ra_Please confirm"),text:this.getText(e.text),ok:this.getText(e.ok)||W.I18n.t("ra_Ok"),cancel:this.getText(e.cancel)||W.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:eo.fullWidth},_.createElement(Se,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:{...eo.fullWidth,...this.props.schema.controlStyle||void 0},disabled:t||!this.props.alive,startIcon:n,title:this.props.alive?this.getText(this.props.schema.title)||"":W.I18n.t("ra_Instance is not alive"),onClick:()=>{this.props.schema.confirm?this.setState({confirmDialog:!0}):this._onClick()}},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 Vd={fullWidth:{width:"100%"}};class Ud extends U{async _onClick(){var n,d;let e=this.props.schema.val;if(typeof e=="string"&&e.includes("${")){e=this.getPattern(e,null,!0);const i=await this.props.oContext.socket.getObject(this.props.schema.id);((n=i==null?void 0:i.common)==null?void 0:n.type)==="number"?e=parseFloat(e):((d=i==null?void 0:i.common)==null?void 0:d.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(W.I18n.t(i.toString())||W.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(Kt,null):e.type==="info"&&(t=_.createElement(Ti,null)),_.createElement(W.DialogConfirm,{title:this.getText(e.title)||W.I18n.t("ra_Please confirm"),text:this.getText(e.text),ok:this.getText(e.ok)||W.I18n.t("ra_Ok"),cancel:this.getText(e.cancel)||W.I18n.t("ra_Cancel"),icon:t,onClose:n=>this.setState({confirmDialog:!1},()=>n&&this._onClick())})}renderItem(e,t){const n=this.getIcon();return _.createElement(Se,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:Vd.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 no={fullWidth:{width:"100%"},slider:{marginLeft:10,marginRight:10,width:"calc(100% - 20px)"}};class Kd extends U{componentDidMount(){super.componentDidMount();const e=U.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=U.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,d=this.props.schema.max||100,i=this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):"",r=[{value:n,label:n+i},{value:d,label:d+i}];return _.createElement(Ie,{style:no.fullWidth},this.props.schema.label?_.createElement(vt,{gutterBottom:!0},this.getText(this.props.schema.label)):null,_.createElement(_o,{style:no.slider,value:this.state._value,getAriaValueText:p=>p+i,step:this.props.schema.step||(d-n)/100,valueLabelDisplay:"auto",marks:r,min:n,max:d,disabled:!!t,onChange:p=>{const o=p.target.value;this.setState({_value:o},()=>this.onChange(this.props.attr,o))}}),this.props.schema.help?_.createElement(vt,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(Lo,{style:e}):m==="delete"?_.createElement(xt,{style:e}):m==="refresh"?_.createElement(Vs,{style:e}):m==="newDevice"||m==="new"||m==="add"?_.createElement(Vn,{style:e}):m==="discover"||m==="search"?_.createElement(To,{style:e}):m==="unpairDevice"||m==="unpair"?_.createElement(Oo,{style:e}):m==="pairDevice"||m==="pair"?_.createElement(Fo,{style:e}):m==="identify"?_.createElement(_c,{style:e}):m==="play"?_.createElement(Ks,{style:e}):m==="stop"?_.createElement(kc,{style:e}):m==="pause"?_.createElement(Tc,{style:e}):m==="forward"||m==="next"?_.createElement(Lc,{style:e}):m==="rewind"||m==="previous"?_.createElement(Mc,{style:e}):m==="lamp"||m==="light"?_.createElement(Ic,{style:e}):m==="backlight"?_.createElement(Oc,{style:e}):m==="dimmer"?_.createElement(Fc,{style:e}):m==="socket"?_.createElement(Rc,{style:e}):m==="settings"?_.createElement(Nc,{style:e}):m==="users"||m==="group"?_.createElement(Io,{style:e}):m==="user"?_.createElement(Mo,{style:e}):m==="qrcode"?_.createElement(Bc,{style:e}):m==="connection"?_.createElement(Pc,{style:e}):m==="no-connection"?_.createElement(Wc,{style:e}):m==="visible"?_.createElement(Po,{style:e}):null}function Gd(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 Jd extends U{controlTimeout=null;delayedUpdate={timer:null,value:null};getObjectID(){let e=(this.props.schema.oid||"").toString();return e.includes("${")&&(e=this.getPattern(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 n,d;super.componentDidMount();const e=await this.props.oContext.socket.getObject(this.getObjectID());if((n=e==null?void 0:e.common)!=null&&n.states&&!this.props.schema.options){if(Array.isArray((d=e==null?void 0:e.common)==null?void 0:d.states)){const i={};e.common.states.forEach((r,p)=>{i[p.toString()]=r}),e.common.states=i}Object.keys(e.common.states).length||(e.common.states=void 0)}const t=this.props.schema.control||this.detectType(e);try{const i=await this.props.oContext.socket.getState(this.getObjectID());this.setState({stateValue:i?i.val:null,controlType:t,obj:e},async()=>{await this.props.oContext.socket.subscribeState(this.getObjectID(),this.onStateChanged)})}catch(i){console.error(`Cannot get state ${this.getObjectID()}: ${i}`),this.setState({controlType:t,obj:e})}}componentWillUnmount(){super.componentWillUnmount(),this.props.oContext.socket.unsubscribeState(this.getObjectID(),this.onStateChanged),this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null),this.controlTimeout&&(clearTimeout(this.controlTimeout),this.controlTimeout=null,this.props.oContext.socket.setState(this.getObjectID(),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 d,i,r,p,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(),s=l.find(a=>a.value===this.state.stateValue);n=_.createElement(fe,{fullWidth:!0},_.createElement(Te,null,"$",this.getText(this.props.schema.label)),_.createElement(Be,{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.getObjectID(),c,!1)})},renderValue:a=>s!=null&&s.color?_.createElement("div",{style:{color:s.color}},s.label):a},l.map(a=>_.createElement(xe,{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||(d=this.state.obj.common.role)!=null&&d.includes("button"))){let l=null;this.props.schema.falseImage&&(l=Dt(this.props.schema.falseImage));const s=this.getText(this.props.schema.falseText||this.props.schema.label,this.props.schema.noTranslation);!s&&l?n=_.createElement(re,{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.getObjectID(),this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}}):await this.props.oContext.socket.setState(this.getObjectID(),this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}},l):n=_.createElement(Se,{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.getObjectID(),this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}}):await this.props.oContext.socket.setState(this.getObjectID(),this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}},s||this.getObjectID().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(de,{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.getObjectID(),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 s=this.state.stateValue;this.state.obj.common.type==="number"&&(s=parseFloat(s.toString().replace(",","."))),await this.props.oContext.socket.setState(this.getObjectID(),s,!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(Se,{variant:"outlined",disabled:t,onClick:()=>{this.props.oContext.socket.setState(this.getObjectID(),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 s=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"),s.trim()&&!s.trim().endsWith(":")&&this.props.schema.addColon&&(s=`${s.trim()}:`);let c;this.props.schema.blinkOnUpdate&&(c=Gd(this.props.oContext.theme,this.props.schema.blinkOnUpdate));let u;this.props.schema.labelIcon&&(u=_.createElement(W.Icon,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let h;if(s&&u?h=_.createElement("div",{style:{whiteSpace:"nowrap"}},u,s):s?h=_.createElement("div",{style:{whiteSpace:"nowrap"}},s):u&&(h=u),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(rc,{checked:!!this.state.stateValue,disabled:!!this.props.schema.readOnly||t,onChange:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async A=>{A&&await this.props.oContext.socket.setState(this.getObjectID(),!this.state.stateValue,!1)}}):await this.props.oContext.socket.setState(this.getObjectID(),!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))),h&&(n=_.createElement("div",{style:a},h,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==="%")||(r=this.state.obj.common.role)!=null&&r.includes("slider")||(p=this.state.obj.common.role)!=null&&p.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 A=this.props.schema.min===void 0?this.state.obj.common.min||0:this.props.schema.min,S=this.props.schema.max===void 0?this.state.obj.common.max===void 0?100:this.state.obj.common.max:this.props.schema.max,w=this.props.schema.step===void 0?this.state.obj.common.step||1:this.props.schema.step;n=_.createElement(_o,{style:{width:"100%",flexGrow:1},min:A,max:S,disabled:!!this.props.schema.readOnly||t,step:w,value:this.state.stateValue,valueLabelDisplay:"auto",valueLabelFormat:y=>{let D=this.props.schema.digits!==void 0?y.toFixed(this.props.schema.digits):y.toString();return this.props.oContext.isFloatComma&&(D=D.replace(".",",")),`${D}${this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||""}`},onChange:(y,D)=>{this.setState({stateValue:D},()=>{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.getObjectID(),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))),h&&(n=_.createElement("div",{style:a},h,n))}else if(this.state.obj.common.type==="number"&&this.state.obj.common.write&&!this.state.controlType){const f=this.props.schema.min===void 0?this.state.obj.common.min===void 0?void 0:this.state.obj.common.min:this.props.schema.min,g=this.props.schema.max===void 0?this.state.obj.common.max===void 0?void 0:this.state.obj.common.max:this.props.schema.max,v=this.props.schema.step===void 0?this.state.obj.common.step===void 0?void 0:this.state.obj.common.step:this.props.schema.step;n=_.createElement(de,{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 A=parseFloat(this.state.stateValue);await this.props.oContext.socket.setState(this.getObjectID(),A,!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},h,_.createElement(Ie,{style:{display:"flex",alignItems:"center",gap:8},sx:c,key:this.props.schema.blinkOnUpdate?g:void 0},f,g||(this.state.stateValue?W.I18n.t("ra_true"):W.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 S=this.getNormalizedStates().find(w=>w.value===g);S&&(g=S.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},h,_.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 vs={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 Yd extends U{renderItem(){return _.createElement(Ie,{component:"hr",sx:W.Utils.getStyle(this.props.oContext.theme,vs.fullWidth,this.props.schema.color==="primary"?vs.primary:this.props.schema.color==="secondary"?vs.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 Qd={header:m=>({width:"100%",background:m.palette.primary.main,color:m.palette.primary.contrastText,padding:"4px !important",borderRadius:"3px",marginBlockEnd:0,marginBlockStart:0})};class Xd extends U{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:Qd.header},this.getText(this.props.schema.label||this.props.schema.text,this.props.schema.noTranslation))}}class Zd extends U{renderItem(){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=`adapter/${this.props.oContext.adapterName}/${e}`),_.createElement("img",{src:e,style:{cursor:this.props.schema.href?"pointer":void 0,width:"100%",height:"100%"},onClick:this.props.schema.href?()=>this.props.schema.href&&window.open(this.props.schema.href,"_blank"):null,alt:""})}}function io(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 so(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 sn={label:{fontWeight:"bold",whiteSpace:"nowrap"},valueImage:{maxHeight:"100%"},valueAndUnit:{display:"flex",gap:4,alignItems:"baseline"},value:{},unit:{fontSize:"smaller",opacity:.7}};class qd extends U{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=W.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 d={width:"100%",height:"100%",display:"flex",alignItems:"center",position:"relative",fontSize:n};this.props.schema.narrow?d.gap=8:d.justifyContent="space-between";let i,r;this.props.schema.data&&typeof this.props.schema.data=="object"&&this.props.schema.data.en?r=this.getText(this.props.schema.data):typeof this.props.schema.data=="object"||this.props.schema.data===void 0||this.props.schema.data===null?r=JSON.stringify(this.props.schema.data):typeof this.props.schema.data=="number"?(r=this.props.schema.data.toString(),this.props.oContext.isFloatComma&&(r=r.replace(".",","))):(!this.props.schema.booleanAsCheckbox||typeof this.props.schema.data!="boolean")&&(r=this.props.schema.data.toString());let p=!1;if(this.props.schema.booleanAsCheckbox&&typeof this.props.schema.data=="boolean")i=_.createElement(Qt,{checked:!!i,disabled:!0,size:this.props.schema.size==="small"?"small":this.props.schema.size==="large"?"large":void 0});else if(r.startsWith("data:image/"))i=_.createElement("div",{style:{...sn.value,...sn.valueImage,...this.props.schema.styleValue||void 0}},_.createElement(W.Icon,{src:r}));else{const a={...sn.value,...this.props.schema.styleValue||void 0};this.props.schema.html?i=_.createElement("div",{style:a,dangerouslySetInnerHTML:{__html:r}}):Array.isArray(this.props.schema.data)?(p=!0,i=_.createElement("div",{style:a},this.props.schema.data.map((c,u)=>_.createElement("div",{key:u},typeof c=="object"||c===null||c===void 0?JSON.stringify(c):c)))):r.includes(`
1391
+ `)?(p=!0,i=_.createElement("div",{style:a},W.Utils.renderTextWithA(r))):i=_.createElement("div",{style:a},r)}if(this.props.schema.blinkOnUpdate&&this.props.schema.blink){const a=io(this.props.oContext.theme,!0,this.props.schema.blinkOnUpdate),c=so(this.props.oContext.theme,this.props.schema.blink);i=_.createElement(Ie,{key:r,sx:{...a,...c}},i)}else if(this.props.schema.blinkOnUpdate){const a=io(this.props.oContext.theme,!1,this.props.schema.blinkOnUpdate);i=_.createElement(Ie,{key:r,sx:a},i)}else if(this.props.schema.blink){const a=so(this.props.oContext.theme,this.props.schema.blink);i=_.createElement(Ie,{sx:a},i)}this.props.schema.unit&&(i=_.createElement("div",{style:sn.valueAndUnit},i,_.createElement("div",{style:{...sn.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(W.Icon,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let l;this.props.schema.copyToClipboard&&(l=_.createElement(un,{className:"staticCopyButton",style:{position:"absolute",top:"calc(50% - 12px)",right:0,cursor:"pointer"},onClick:()=>{W.Utils.copyToClipboard(r),window.alert(W.I18n.t("ra_Copied"))}}));const s={"& .staticCopyButton":{display:"none"},"& .staticCopyButton:action":{transform:"scale(0.9)"},"&:hover .staticCopyButton":{display:"block"}};return this.props.schema.highlight&&(s["&:hover"]={backgroundColor:this.props.oContext.themeType==="dark"?"#51515180":"#b8b8b880"}),p&&(d.alignItems="top"),_.createElement(Ie,{component:"div",style:d,sx:s},_.createElement("div",{style:{...sn.label,...this.props.schema.styleLabel||void 0}},o,t),i,l)}}const ro={fullWidth:{height:"100%",width:"100%"},link:m=>({textDecoration:"underline",color:m.palette.mode==="dark"?"#4dabf5":"#254e72",cursor:"pointer"})};function oo(m,e,t){let n,d="";m?m.toString().startsWith("#")||m.toString().startsWith("/")?(n=e||"_self",d=m):m.startsWith("http://")||m.startsWith("https://")?(n=e||"_blank",d=m):(d=`#tab-instances/config/${t}/${m}`,n=e||"_self"):(d=`#tab-instances/config/${t}`,n=e||"_self"),n==="_self"?setTimeout(i=>{i.startsWith("#")?window.location.hash=i:i.startsWith("/")?d=`${window.location.protocol}:${window.location.host}${d}`:(i.startsWith("http://")||i.startsWith("https://"))&&(window.location.href=i)},100,d):(d.startsWith("#")?d=`${window.location.protocol}:${window.location.host}${window.location.pathname}${d}`:d.startsWith("/")&&(d=`${window.location.protocol}:${window.location.host}${d}`),window.open(d,n))}class ao extends U{renderItem(e,t){if(this.props.schema.button){const d=this.getIcon();return _.createElement(Se,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:{...ro.fullWidth,...this.props.schema.controlStyle||void 0},disabled:t,startIcon:d,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}):oo(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 d=typeof n=="string"?JSON.parse(n):n;n=_.createElement("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0}},JSON.stringify(d,null,2))}catch{}else n&&(n.includes("<a ")||n.includes("<br")||n.includes("<b>")||n.includes("<i>"))&&(n=W.Utils.renderTextWithA(n));return _.createElement(Ie,{component:"span",style:{...this.props.schema.controlStyle||void 0},sx:this.props.schema.href?ro.link:void 0,onClick:this.props.schema.href?()=>{const d=this.props.schema.href?this.getText(this.props.schema.href,!0):null;d&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:"link",url:d,target:this.props.schema.target||"_blank",close:this.props.schema.close}):oo(d,this.props.schema.target||"_blank",`${this.props.oContext.adapterName}.${this.props.oContext.instance}`))}:null},n)}}const ys=1024*1024,se={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 ep(m,e,t){e=e||"key";const n=[];return Object.keys(m).forEach(d=>{const i={};i[e]=d,t?(i[t]=m[d],n.push(i)):n.push(Object.assign(i,m[d]))}),n}function lo(m,e,t){e=e||"key";const n={};return m.forEach(d=>{let i=d[e];i==null&&(i=""),delete d[e],t?n[i]=d[t]:n[i]=d}),n}function tp(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 np(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 U{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]=Gl())}),this.refDiv=_.createRef()}async componentDidMount(){super.componentDidMount();const e=U.getValue(this.props.data,this.props.attr)||[];let t;if(this.props.schema.objKeyName?t=ep(e,this.props.schema.objKeyName,this.props.schema.objValueName):t=e,Array.isArray(t)||(t=[]),this.props.schema.encryptedAttributes){const i=await this.props.oContext.socket.getCompactSystemConfig();this.secret=(i==null?void 0:i.native.secret)||this.secret,e.forEach(r=>{this.props.schema.encryptedAttributes.forEach(p=>{r[p]&&(r[p]=np(this.secret,r[p]))})})}const n=window.localStorage.getItem(`table.collapsed.${this.props.oContext.instance}.${this.props.attr}`);let d=[];if(n)try{d=JSON.parse(n)}catch{}this.setState({value:t,visibleValue:null,orderBy:"",order:"asc",iteration:0,filterOn:[],width:0,tableErrors:{},collapsed:d,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,d){var o;const{schema:i}=this.props,r=(o=i.items)==null?void 0:o.find(l=>l.attr===e);if(!r)return null;const p={items:{[e]:r}};return _.createElement(qt,{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,s)=>{const a=JSON.parse(JSON.stringify(this.state.value));a[n][l]=s,this.setState({value:a},()=>{this.validateUniqueProps(),this.onChangeWrapper(a,!0)})},onError:this.onTableRowError(n),originalData:this.props.originalData,schema:p,table:!0,themeName:this.props.themeName,onFilterLabelUpdate:(l,s)=>{const a=this.state.filterLabelMap[l],c={...a,...s};JSON.stringify(a)!==JSON.stringify(c)&&this.setState(u=>({filterLabelMap:{...u.filterLabelMap,[l]:c}}))},onHiddenChanged:d?(l,s)=>{if(s)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 d=[];this.state.value.find(r=>{const p=r[n];return d.includes(p)?(e||(e=n,t=p),this.onError(n,"is not unique"),!0):(d.push(p),!1)})||this.onError(n,null)}e?this.setState({errorMessage:W.I18n.t('Non-allowed duplicate entry "%s" in column "%s"',t,e)}):this.setState({errorMessage:""})}onTableRowError=e=>(t,n)=>{const d={...this.state.tableErrors};d[e]||(d[e]={}),n?d[e][t]=n:(delete d[e][t],Object.keys(d[e]).length===0&&delete d[e]),this.setState({tableErrors:d}),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,d)=>Qe.descendingComparator(n,d,t):(n,d)=>-Qe.descendingComparator(n,d,t)}static getFilterValue(e){var t,n,d;return(d=(n=(t=e==null?void 0:e.current)==null?void 0:t.children[0])==null?void 0:n.children[0])==null?void 0:d.value}static setFilterValue(e,t){return e.current.children[0].children[0].value=t}handleRequestSort=(e,t=!1)=>{const{order:n,orderBy:d}=this.state,r=t?n:d===e&&n==="asc"?"desc":"asc",p=this.stableSort(r,e);JSON.stringify(p)!==JSON.stringify(this.state.value)&&this.setState({value:p,order:r,orderBy:e,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,p))};stableSort=(e,t)=>{const{value:n}=this.state,d=Qe.getComparator(e,t),i=n.map((r,p)=>({el:r,index:p}));return i.sort((r,p)=>{const o=d(r.el,p.el);return o!==0?o:r.index-p.index}),i.map(r=>r.el)};renderShowHideFilter(e){return e.filter?_.createElement(re,{title:W.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(jc,null):_.createElement(zc,null)):null}renderImportExportButtons(e){return _.createElement(_.Fragment,null,!e.noDelete&&e.import?_.createElement(we,{title:W.I18n.t("ra_Import data from %s file","CSV"),slotProps:{popper:{sx:se.tooltip}}},_.createElement(re,{size:"small",onClick:()=>this.setState({showImportDialog:!0})},_.createElement(Hn,null))):null,e.export?_.createElement(we,{title:W.I18n.t("ra_Export data to %s file","CSV"),slotProps:{popper:{sx:se.tooltip}}},_.createElement(re,{size:"small",onClick:()=>this.onExport()},_.createElement(Hc,null))):null,e.noDelete?null:_.createElement(re,{disabled:!0,size:"small"},_.createElement(xt,null)))}renderAddButton(e){return _.createElement(we,{title:e?W.I18n.t("ra_Cannot add items with set filter"):W.I18n.t("ra_Add row"),slotProps:{popper:{sx:se.tooltip}}},_.createElement("span",null,_.createElement(re,{size:"small",color:"primary",disabled:!!e&&!this.props.schema.allowAddByFilter,onClick:this.onAdd},_.createElement(Vn,null))))}enhancedTableHead(e,t){var r;const{schema:n}=this.props,{order:d,orderBy:i}=this.state;return _.createElement(Ao,null,_.createElement(ct,null,(r=n.items)==null?void 0:r.map((p,o)=>this.renderOneFilter({schema:n,style:{width:p.width},showAddButton:!o&&!n.noDelete,headCell:p,order:d,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 d={};Object.keys(n).forEach(i=>{const r=parseInt(i,10);r>e?d[r-1]=n[r]:d[r]=n[r]}),this.setState({value:t,iteration:this.state.iteration+1e4,tableErrors:d},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))};onExport(){const{schema:e}=this.props,{value:t}=this.state,d=[e.items.map(p=>p.attr).join(";")];t.forEach(p=>{const o=[];e.items.forEach(l=>{p[l.attr]&&typeof p[l.attr]=="string"&&p[l.attr].includes(";")?o.push(`"${p[l.attr]}"`):o.push(p[l.attr]===void 0||p[l.attr]===null?"":p[l.attr])}),d.push(o.join(";"))});const i=document.createElement("a");i.setAttribute("href",`data:text/csv;charset=utf-8,${encodeURIComponent(d.join(`
1392
+ `))}`);const r=new Date;i.setAttribute("download",`${r.getFullYear()}_${(r.getMonth()+1).toString().padStart(2,"0")}_${r.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 r;const t=e.split(`
1393
+ `).map(p=>p.replace("\r","").trim()),{schema:n}=this.props,d=t.shift().split(";").filter(p=>p&&n.items.find(o=>o.attr===p)),i=[];t.forEach(p=>{const o=p.split(";"),l={};for(let s=0;s<o.length;s++){let a=o[s];if(a.startsWith('"')){for(a=a.substring(1);s<o.length&&!a.endsWith('"');)a+=`;${o[++s]}`;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 u=this.props.schema.items.find(h=>h.attr===d[s]);u&&u.type==="number"?c=parseFloat(a):c=a}else c=a;l[d[s]]=c}i.push(l)}),i.length?(r=this.state.value)!=null&&r.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 d=1,i=n[this.props.schema.clone];const r=i.match(/(\d+)$/);for(r?(i=i.replace(r[0],""),d=parseInt(r[0],10)+1):i+="_";t.find(p=>p[this.props.schema.clone]===i+d.toString());)d++;n[this.props.schema.clone]=`${n[this.props.schema.clone]}_${d}`}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,d)=>{this.typingTimer=null;let i;if(this.props.schema.encryptedAttributes){const r=JSON.parse(JSON.stringify(n));if(r.forEach(p=>{this.props.schema.encryptedAttributes.forEach(o=>{p[o]&&(p[o]=tp(this.secret,p[o]))})}),this.props.schema.objKeyName){const p=lo(r,this.props.schema.objKeyName,this.props.schema.objValueName);i=this.onChange(this.props.attr,p)}else i=this.onChange(this.props.attr,r)}else if(this.props.schema.objKeyName){const r=lo(JSON.parse(JSON.stringify(n)),this.props.schema.objKeyName,this.props.schema.objValueName);i=this.onChange(this.props.attr,r)}else i=this.onChange(this.props.attr,n);i instanceof Promise&&i.catch(r=>console.error(`Cannot save: ${r}`)),d&&(this.applyFilter(!1,n),this.handleRequestSort(this.state.orderBy,!0))},300,e,t)};onAdd=()=>{var d;const{schema:e}=this.props,t=JSON.parse(JSON.stringify(this.state.value)),n=(d=e.items)==null?void 0:d.reduce((i,r)=>{let p;return r.defaultFunc?this.props.custom?p=r.defaultFunc?this.executeCustom(r.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,t.length,this.props.data):this.props.schema.default:p=r.defaultFunc?this.execute(r.defaultFunc,this.props.schema.default,this.props.data,t.length,this.props.data):this.props.schema.default:p=r.default===void 0?null:r.default,i[r.attr]=p,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 d=t.map((i,r)=>r);if(Object.keys(this.filterRefs).forEach(i=>{var p;let r=Qe.getFilterValue(this.filterRefs[i]);if(!e&&r){r=r.toLowerCase();const o=(p=this.state.filterLabelMap)==null?void 0:p[i];d=d.filter(l=>{if(!t[l]||t[l][i]==null)return!1;if(t[l][i].toString().toLowerCase().includes(r))return!0;if(o){const a=o[t[l][i]];if(a&&a.toLowerCase().includes(r))return!0}return!1})}else this.filterRefs[i].current&&Qe.setFilterValue(this.filterRefs[i],"")}),d.length===t.length&&(d=null),d===null&&this.state.visibleValue===null){n&&n();return}JSON.stringify(d)!==JSON.stringify(this.state.visibleValue)?this.setState({visibleValue:d},()=>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>ys){window.alert(W.I18n.t("ra_File is too big. Max %sk allowed. Try use SVG.",Math.round(ys/1024)));return}const d=new Uint8Array(n.result).reduce((i,r)=>i+String.fromCharCode(r),"");this.onImport(d)},n.readAsArrayBuffer(t)}showTypeOfImportDialog(){return this.state.showTypeOfImportDialog?_.createElement(Ut,{open:!0,onClose:()=>this.setState({showTypeOfImportDialog:!1}),maxWidth:"md"},_.createElement(gn,null,W.I18n.t("ra_Append or replace?")),_.createElement(mn,null,W.I18n.t("ra_Append %s entries or replace existing?",this.state.showTypeOfImportDialog.length)),_.createElement(vn,null,_.createElement(Se,{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)))}},W.I18n.t("ra_Append")),_.createElement(Se,{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)))}},W.I18n.t("ra_Replace")))):null}showImportDialog(){return this.state.showImportDialog?_.createElement(Ut,{open:!0,onClose:()=>this.setState({showImportDialog:!1}),sx:{"& .MuiDialog-paper":{minHeight:500}},maxWidth:"md",fullWidth:!0},_.createElement(gn,null,W.I18n.t("ra_Import from %s","CSV")),_.createElement(mn,null,_.createElement(Wo,{multiple:!1,accept:{"text/csv":[".csv"]},maxSize:ys,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||W.I18n.t("ra_Cannot upload"))}},({getRootProps:e,getInputProps:t})=>_.createElement("div",{style:{...se.uploadDiv,...this.state.uploadFile==="dragging"?se.uploadDivDragging:void 0,...se.dropZone,...this.state.icon?void 0:se.dropZoneEmpty},...e()},_.createElement("input",{...t()}),_.createElement("div",{style:se.uploadCenterDiv},_.createElement("div",{style:se.uploadCenterTextAndIcon},_.createElement(Hn,{style:se.uploadCenterIcon}),_.createElement("div",{style:se.uploadCenterText},this.state.uploadFile==="dragging"?W.I18n.t("ra_Drop file here"):W.I18n.t("ra_Place your files here or click here to open the browse dialog"))))))),_.createElement(vn,null,_.createElement(Se,{variant:"contained",onClick:()=>this.setState({showImportDialog:!1}),color:"primary",startIcon:_.createElement(_t,null)},W.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:{...se.flex,...e.schema.showFirstAddOnTop?{flexDirection:"column"}:void 0}},e.showAddButton?this.renderAddButton(e.doAnyFilterSet):null,e.headCell.sort&&_.createElement(oc,{active:!0,style:e.orderBy!==e.headCell.attr?se.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(de,{variant:"standard",ref:this.filterRefs[e.headCell.attr],onChange:()=>this.applyFilter(),title:W.I18n.t("ra_You can filter entries by entering here some text"),slotProps:{input:{endAdornment:Qe.getFilterValue(this.filterRefs[e.headCell.attr])&&_.createElement(fn,{position:"end"},_.createElement(re,{size:"small",tabIndex:-1,onClick:()=>{Qe.setFilterValue(this.filterRefs[e.headCell.attr],""),this.applyFilter()}},_.createElement(_t,null)))}},fullWidth:!0,placeholder:this.getText(e.headCell.title)}):_.createElement("span",{style:se.headerText},this.getText(e.headCell.title)),this.renderShowHideFilter(e.headCell)))}enhancedFilterCard(){var r;const{schema:e}=this.props,{order:t,orderBy:n}=this.state;let d;this.props.schema.compact&&(d={paddingTop:1,paddingBottom:1});const i=!e.noDelete&&e.import||e.export;return i||e.items.find(p=>p.sort||p.filter)?_.createElement(He,{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(os,null,_.createElement(Mn,{style:se.paper},_.createElement(Ps,{style:se.paper},_.createElement(Ws,{expandIcon:_.createElement(Li,null)},_.createElement(vt,null,W.I18n.t("ra_Filter and Data Actions"))),_.createElement(js,null,_.createElement(In,null,_.createElement(On,null,((r=e.items)==null?void 0:r.find(p=>p.sort||p.filter))&&e.items.map((p,o)=>_.createElement(ct,{key:`${p.attr}_${o}`},this.renderOneFilter({schema:e,style:d,showAddButton:!1,headCell:p,order:t,orderBy:n,index:o,doAnyFilterSet:!1}))),i?_.createElement(ct,null,_.createElement(Ee,{align:"left",style:d},_.createElement("span",{style:se.headerText},W.I18n.t("ra_Actions"))),_.createElement(Ee,{style:d},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(He,{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(os,null,_.createElement(Mn,{style:se.paper},_.createElement(In,null,_.createElement(On,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 d={padding:0,borderBottom:"none"};t||=this.state.value.map((r,p)=>p);const i=this.isAnyFilterSet();return _.createElement(He,{container:!0},this.showImportDialog(),this.showTypeOfImportDialog(),this.enhancedFilterCard(),t.map((r,p)=>{var o,l,s;return _.createElement(He,{key:`${r}_${p}`,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(os,{sx:this.state.tableErrors[r]?{outline:"1px solid red"}:void 0},_.createElement(Mn,{style:se.paper},this.props.schema.titleAttribute?_.createElement(Ie,{sx:se.cardHeader},_.createElement("div",null,this.state.value[r][this.props.schema.titleAttribute]),_.createElement("div",null,!i&&!this.state.orderBy?_.createElement(we,{title:W.I18n.t("ra_Move up"),slotProps:{popper:{sx:se.tooltip}}},_.createElement("span",null,_.createElement(re,{size:"small",onClick:()=>this.onMoveUp(r),disabled:p===0},_.createElement(Ei,null)))):null,!i&&!this.state.orderBy?_.createElement(we,{title:W.I18n.t("ra_Move down"),slotProps:{popper:{sx:se.tooltip}}},_.createElement("span",null,_.createElement(re,{size:"small",onClick:()=>this.onMoveDown(r),disabled:p===t.length-1},_.createElement(Si,null)))):null,_.createElement(we,{title:W.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:se.tooltip}}},_.createElement(re,{size:"small",onClick:this.onDelete(r)},_.createElement(xt,null))),this.props.schema.clone?_.createElement(we,{title:W.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:se.tooltip}}},_.createElement(re,{size:"small",onClick:this.onClone(r)},_.createElement(un,null))):null,_.createElement(we,{title:W.I18n.t("ra_Expand/Collapse card"),slotProps:{popper:{sx:se.tooltip}}},_.createElement(re,{size:"small",onClick:()=>{const a=[...this.state.collapsed],c=a.indexOf(r);c===-1?a.push(r):a.splice(c,1),window.localStorage.setItem(`table.collapsed.${this.props.oContext.instance}.${this.props.attr}`,JSON.stringify(a)),this.setState({collapsed:a})}},_.createElement(Li,{style:{rotate:(o=this.state.collapsed)!=null&&o.includes(r)?"0deg":"180deg",transition:"0.3s",transitionProperty:"rotate"}}))))):null,_.createElement(ac,{in:!((l=this.state.collapsed)!=null&&l.includes(r)),timeout:"auto",unmountOnExit:!0},_.createElement(In,null,_.createElement(On,null,(s=e.items)==null?void 0:s.map(a=>{var u,h;const c=(h=(u=this.listOfHiddenElements)==null?void 0:u[r])==null?void 0:h.includes(a.attr);return _.createElement(ct,{key:`${a.attr}_${r}`},_.createElement(Ee,{align:"left",style:c?d:n},c?null:_.createElement("span",{style:se.headerText},this.getText(a.title))),_.createElement(Ee,{align:"left",style:c?d:n},this.itemTable(a.attr,this.state.value[r],r,!0)))}),!this.props.schema.titleAttribute&&!e.noDelete&&_.createElement(ct,null,_.createElement(Ee,{align:"left",style:n},_.createElement("span",{style:se.headerText},this.getText("Actions"))),_.createElement(Ee,{align:"left",style:n},!i&&!this.state.orderBy?_.createElement(we,{title:W.I18n.t("ra_Move up"),slotProps:{popper:{sx:se.tooltip}}},_.createElement("span",null,_.createElement(re,{size:"small",onClick:()=>this.onMoveUp(r),disabled:p===0},_.createElement(Ei,null)))):null,!i&&!this.state.orderBy?_.createElement(we,{title:W.I18n.t("ra_Move down"),slotProps:{popper:{sx:se.tooltip}}},_.createElement("span",null,_.createElement(re,{size:"small",onClick:()=>this.onMoveDown(r),disabled:p===t.length-1},_.createElement(Si,null)))):null,_.createElement(we,{title:W.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:se.tooltip}}},_.createElement(re,{size:"small",onClick:this.onDelete(r)},_.createElement(xt,null))),this.props.schema.clone?_.createElement(we,{title:W.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:se.tooltip}}},_.createElement(re,{size:"small",onClick:this.onClone(r)},_.createElement(un,null))):null))))))))}),this.enhancedBottomCard())}renderTable(){const{schema:e}=this.props;let{visibleValue:t}=this.state;t=t||this.state.value.map((i,r)=>r);const n=this.isAnyFilterSet();let d;return this.props.schema.compact&&(d={paddingTop:1,paddingBottom:1}),_.createElement(Mn,{style:se.paper},this.showImportDialog(),this.showTypeOfImportDialog(),e.label?_.createElement("div",{style:se.label},_.createElement(Bn,{variant:"dense",style:se.rootTool},_.createElement(vt,{style:se.title,variant:"h6",id:"tableTitle",component:"div"},this.getText(e.label)))):null,_.createElement(Do,null,_.createElement(In,{style:se.table,size:"small"},this.enhancedTableHead(!n&&!this.state.orderBy?120:64,n),_.createElement(On,null,t.map((i,r)=>{var p;return _.createElement(ct,{hover:!0,key:`${i}_${r}`,sx:this.state.tableErrors[i]?{outline:"1px solid red"}:void 0},(p=e.items)==null?void 0:p.map(o=>_.createElement(Ee,{key:`${o.attr}_${i}`,align:"left",style:d},this.itemTable(o.attr,this.state.value[i],i,!1))),!e.noDelete&&_.createElement(Ee,{align:"left",style:{...d,...se.buttonCell}},!n&&!this.state.orderBy?r?_.createElement(we,{title:W.I18n.t("ra_Move up"),slotProps:{popper:{sx:se.tooltip}}},_.createElement(re,{size:"small",onClick:()=>this.onMoveUp(i)},_.createElement(Ei,null))):_.createElement("div",{style:se.buttonEmpty}):null,!n&&!this.state.orderBy?r<t.length-1?_.createElement(we,{title:W.I18n.t("ra_Move down"),slotProps:{popper:{sx:se.tooltip}}},_.createElement(re,{size:"small",onClick:()=>this.onMoveDown(i)},_.createElement(Si,null))):_.createElement("div",{style:se.buttonEmpty}):null,_.createElement(we,{title:W.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:se.tooltip}}},_.createElement(re,{size:"small",onClick:this.onDelete(i)},_.createElement(xt,null))),this.props.schema.clone?_.createElement(we,{title:W.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:se.tooltip}}},_.createElement(re,{size:"small",onClick:this.onClone(i)},_.createElement(un,null))):null))}),!e.noDelete&&t.length>=(e.showSecondAddAt||5)?_.createElement(ct,null,_.createElement(Ee,{colSpan:e.items.length+1,style:{...d}},this.renderAddButton(n))):null)),!t.length&&this.state.value.length?_.createElement("div",{style:se.filteredOut},_.createElement(vt,{style:se.title,variant:"h6",id:"tableTitle",component:"div"},W.I18n.t("ra_All items are filtered out"),_.createElement(re,{size:"small",onClick:()=>this.applyFilter(!0)},_.createElement(_t,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 gi={indeterminate:{opacity:.5},label:{width:"100%",fontSize:14,marginBottom:2},helper:{width:"100%",fontSize:12},error:{width:"100%",fontSize:12,color:"#FF0000"}};class ip extends U{updateTimeout=null;componentDidMount(){super.componentDidMount();let e=U.getValue(this.props.data,this.props.attr);if(Array.isArray(e)&&this.props.oContext.multiEdit){e=U.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===U.DIFFERENT_VALUE)return{value:U.DIFFERENT_VALUE};let n=U.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===U.DIFFERENT_VALUE;if(this.props.schema.time){let r="";return typeof this.state.value=="number"?this.state.value&&this.state.value<9466596e5?r=new Date(this.state.value*1e3).toLocaleString():r=new Date(this.state.value).toLocaleString():typeof this.state.value=="string"&&(r=new Date(this.state.value).toLocaleString()),_.createElement(de,{variant:"standard",fullWidth:!0,value:r,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 r=U.getValue(this.props.data,this.props.attr),p=(r==null?void 0:r.filter(o=>o||o===0).map(o=>({label:o.toString()||"",value:o})))||[];return p.unshift({label:W.I18n.t(U.DIFFERENT_LABEL),value:U.DIFFERENT_VALUE}),_.createElement(Bi,{style:gi.indeterminate,fullWidth:!0,value:p[0],onChange:(o,l)=>{const s=l?l.value:"",a=this.onChange(this.props.attr,s,()=>{this.setState({value:s,oldValue:s,jsonError:this.validateJson(l)})});a instanceof Promise&&a.catch(c=>console.error(`Cannot set value: ${c}`))},options:p,getOptionLabel:o=>o.label,renderInput:o=>_.createElement(de,{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 d,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}),d=_.createElement(re,{tabIndex:-1,style:i,size:"small",onClick:()=>{W.Utils.copyToClipboard(this.state.value),window.alert(W.I18n.t("ra_Copied"))}},_.createElement(W.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}),d=_.createElement(re,{style:i,size:"small",tabIndex:-1,onClick:()=>this.setState({value:"",oldValue:this.state.value},()=>this.onChange(this.props.attr,""))},_.createElement(_t,null)),this.props.schema.minRows<=1&&(d=_.createElement(fn,{position:"end"},d))),this.props.schema.minRows>1){const r=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:gi.label},this.getText(this.props.schema.label)):null,_.createElement(lc,{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===null||this.state.value===void 0?"":this.state.value,disabled:!!t,readOnly:this.props.schema.readOnly||!1,onChange:p=>{const o=p.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)}),r||e||this.state.jsonError?_.createElement("div",{style:e?gi.error:gi.helper},e||(this.state.jsonError?W.I18n.t("ra_Invalid JSON"):r)):null)}return _.createElement(de,{variant:"standard",fullWidth:!0,value:this.state.value===null||this.state.value===void 0?"":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:d}},onChange:r=>{const p=r.target.value;this.setState({value:p,oldValue:this.state.value,jsonError:this.validateJson(p)},()=>this.onChange(this.props.attr,p))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.state.jsonError?W.I18n.t("ra_Invalid JSON"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const sp={fullWidth:{width:"100%"}};class rp extends U{initialized=!1;localContext;askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const t=this.getPattern(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.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",e).then(t=>{if(typeof t=="object"){const n=t;this.setState({text:n.text||"",style:n.style,icon:n.icon,iconStyle:n.iconStyle})}else typeof t=="string"&&this.setState({text:t||""})}).catch(t=>console.error(`Cannot send command: ${t}`))}}getLocalContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=U.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(W.Icon,{src:this.state.icon,style:{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}}))),this.props.schema.container==="text"?_.createElement(de,{variant:"standard",fullWidth:!0,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?_.createElement(re,{tabIndex:-1,size:"small",onClick:()=>{W.Utils.copyToClipboard(this.state.text),window.alert(W.I18n.t("ra_Copied"))}},_.createElement(W.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:{...sp.fullWidth,...this.state.style||void 0}},e,this.props.schema.container==="html"?_.createElement("span",{dangerouslySetInnerHTML:{__html:this.state.text||""}}):this.state.text)}}class op extends U{componentDidMount(){super.componentDidMount();const e=U.getValue(this.props.data,this.props.attr);this.setState({value:e})}renderItem(e,t){const n=this.props.schema.returnFormat!=="HH:mm:ss",d=new Date(Date.parse(`Thu, 01 Jan 1970 ${this.state.value||"00:00:00"}`));return _.createElement(Qc,{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:d,onChange:i=>{let r;r=i instanceof Date?i.toTimeString().split(" ")[0]:i.toTimeString(),n&&(r=r.split(":").slice(0,2).join(":")),this.setState({value:r},()=>this.onChange(this.props.attr,this.state.value))},views:this.props.schema.views||["hours","minutes","seconds"],label:this.getText(this.props.schema.label)})}}function ap(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 lp extends U{componentDidMount(){var t;super.componentDidMount();const e=U.getValue(this.props.data,this.props.attr);if(!e&&((t=this.props.customObj)!=null&&t._id)){const n=ap(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(de,{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 d=n.target.value;this.setState({value:d},()=>this.onChange(this.props.attr,d))}})}}class cp extends U{async componentDidMount(){var t;super.componentDidMount();const e=await this.props.oContext.socket.getObject("system.meta.uuid");this.setState({uuid:((t=e==null?void 0:e.native)==null?void 0:t.uuid)||"unknown"})}renderItem(e,t){return _.createElement(de,{variant:"standard",fullWidth:!0,error:!!e,disabled:!!t,slotProps:{htmlInput:{readOnly:!0},input:{endAdornment:_.createElement(re,{tabIndex:-1,onClick:()=>{W.Utils.copyToClipboard(this.state.uuid),window.alert(W.I18n.t("ra_Copied %s",this.state.uuid))}},_.createElement(un,null))}},value:this.state.uuid||"",label:this.getText(this.props.schema.label)||W.I18n.t("ra_Serial number (UUID)"),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const co={icon:{width:16,height:16,marginRight:8}};class hp extends U{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getUsers().then(e=>{const t={},n=W.I18n.getLanguage();this.props.schema.short?e.forEach(d=>{var i,r;return t[d._id]={color:(i=d.common)==null?void 0:i.color,icon:(r=d.common)==null?void 0:r.icon,name:W.Utils.getObjectNameFromObj(d,n)}}):e.forEach(d=>{var i,r;return t[d._id.replace(/^system\.user\./,"")]={color:(i=d.common)==null?void 0:i.color,icon:(r=d.common)==null?void 0:r.icon,name:W.Utils.getObjectNameFromObj(d,n)}}),this.setState({users:t})}).catch(e=>console.error(`Cannot get users: ${e}`))}renderItem(e,t){var d,i;const n=U.getValue(this.props.data,this.props.attr);return _.createElement(fe,{variant:"standard",fullWidth:!0},this.state.users&&this.props.schema.label?_.createElement(Te,null,this.getText(this.props.schema.label)):null,this.state.users?_.createElement(Be,{variant:"standard",error:!!e,disabled:!!t,value:n,renderValue:r=>{var p,o,l;return _.createElement("span",null,this.state.users&&((p=this.state.users[r])!=null&&p.icon)?_.createElement(W.Icon,{src:this.state.users&&((o=this.state.users[r])==null?void 0:o.icon),style:co.icon}):null,this.state.users&&((l=this.state.users[r])==null?void 0:l.name)||r||"")},style:{color:this.state.users&&((d=this.state.users[n])==null?void 0:d.color)||void 0,backgroundColor:W.Utils.getInvertedColor(this.state.users&&((i=this.state.users[n])==null?void 0:i.color),this.props.oContext.themeType)},onChange:r=>this.onChange(this.props.attr,r.target.value)},this.state.users&&Object.keys(this.state.users).map(r=>_.createElement(xe,{style:{color:this.state.users[r].color||void 0,backgroundColor:W.Utils.getInvertedColor(this.state.users[r].color,this.props.oContext.themeType)},key:r,value:r},this.state.users[r].icon?_.createElement(W.Icon,{src:this.state.users[r].icon,style:co.icon}):null,this.state.users[r].name))):_.createElement(de,{variant:"standard",error:!!e,disabled:!!t,value:n,onChange:r=>this.onChange(this.props.attr,r.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 nr=Symbol.for("yaml.alias"),Ms=Symbol.for("yaml.document"),kt=Symbol.for("yaml.map"),na=Symbol.for("yaml.pair"),ht=Symbol.for("yaml.scalar"),En=Symbol.for("yaml.seq"),qe=Symbol.for("yaml.node.type"),Zt=m=>!!m&&typeof m=="object"&&m[qe]===nr,Hi=m=>!!m&&typeof m=="object"&&m[qe]===Ms,Xn=m=>!!m&&typeof m=="object"&&m[qe]===kt,Me=m=>!!m&&typeof m=="object"&&m[qe]===na,me=m=>!!m&&typeof m=="object"&&m[qe]===ht,Zn=m=>!!m&&typeof m=="object"&&m[qe]===En;function ke(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 nr:case kt:case ht:case En:return!0}return!1}const ia=m=>(me(m)||ke(m))&&!!m.anchor,zt=Symbol("break visit"),up=Symbol("skip children"),Wn=Symbol("remove node");function Sn(m,e){const t=dp(e);Hi(m)?ln(null,m.contents,t,Object.freeze([m]))===Wn&&(m.contents=null):ln(null,m,t,Object.freeze([]))}Sn.BREAK=zt;Sn.SKIP=up;Sn.REMOVE=Wn;function ln(m,e,t,n){const d=pp(m,e,t,n);if(Le(d)||Me(d))return fp(m,n,d),ln(m,d,t,n);if(typeof d!="symbol"){if(ke(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){const r=ln(i,e.items[i],t,n);if(typeof r=="number")i=r-1;else{if(r===zt)return zt;r===Wn&&(e.items.splice(i,1),i-=1)}}}else if(Me(e)){n=Object.freeze(n.concat(e));const i=ln("key",e.key,t,n);if(i===zt)return zt;i===Wn&&(e.key=null);const r=ln("value",e.value,t,n);if(r===zt)return zt;r===Wn&&(e.value=null)}}return d}function dp(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 pp(m,e,t,n){var d,i,r,p,o;if(typeof t=="function")return t(m,e,n);if(Xn(e))return(d=t.Map)==null?void 0:d.call(t,m,e,n);if(Zn(e))return(i=t.Seq)==null?void 0:i.call(t,m,e,n);if(Me(e))return(r=t.Pair)==null?void 0:r.call(t,m,e,n);if(me(e))return(p=t.Scalar)==null?void 0:p.call(t,m,e,n);if(Zt(e))return(o=t.Alias)==null?void 0:o.call(t,m,e,n)}function fp(m,e,t){const n=e[e.length-1];if(ke(n))n.items[m]=t;else if(Me(n))m==="key"?n.key=t:n.value=t;else if(Hi(n))n.contents=t;else{const d=Zt(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${d} parent`)}}const gp={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},mp=m=>m.replace(/[!,[\]{}]/g,e=>gp[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]+/),d=n.shift();switch(d){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[i,r]=n;return this.tags[i]=r,!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 r=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,r),!1}}default:return t(0,`Unknown directive ${d}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const r=e.slice(2,-1);return r==="!"||r==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),r)}const[,n,d]=e.match(/^(.*!)([^!]*)$/s);d||t(`The ${e} tag has no suffix`);const i=this.tags[n];if(i)try{return i+decodeURIComponent(d)}catch(r){return t(String(r)),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+mp(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 d;if(e&&n.length>0&&Le(e.contents)){const i={};Sn(e.contents,(r,p)=>{Le(p)&&p.tag&&(i[p.tag]=!0)}),d=Object.keys(i)}else d=[];for(const[i,r]of n)i==="!!"&&r==="tag:yaml.org,2002:"||(!e||d.some(p=>p.startsWith(r)))&&t.push(`%TAG ${i} ${r}`);return t.join(`
1394
+ `)}}We.defaultYaml={explicit:!1,version:"1.2"};We.defaultTags={"!!":"tag:yaml.org,2002:"};function sa(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 ra(m){const e=new Set;return Sn(m,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function oa(m,e){for(let t=1;;++t){const n=`${m}${t}`;if(!e.has(n))return n}}function vp(m,e){const t=[],n=new Map;let d=null;return{onAnchor:i=>{t.push(i),d??(d=ra(m));const r=oa(e,d);return d.add(r),r},setAnchors:()=>{for(const i of t){const r=n.get(i);if(typeof r=="object"&&r.anchor&&(me(r.node)||ke(r.node)))r.node.anchor=r.anchor;else{const p=new Error("Failed to resolve repeated object (this should not happen)");throw p.source=i,p}}},sourceObjects:n}}function cn(m,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let d=0,i=n.length;d<i;++d){const r=n[d],p=cn(m,n,String(d),r);p===void 0?delete n[d]:p!==r&&(n[d]=p)}else if(n instanceof Map)for(const d of Array.from(n.keys())){const i=n.get(d),r=cn(m,n,d,i);r===void 0?n.delete(d):r!==i&&n.set(d,r)}else if(n instanceof Set)for(const d of Array.from(n)){const i=cn(m,n,d,d);i===void 0?n.delete(d):i!==d&&(n.delete(d),n.add(i))}else for(const[d,i]of Object.entries(n)){const r=cn(m,n,d,i);r===void 0?delete n[d]:r!==i&&(n[d]=r)}return m.call(e,t,n)}function Ze(m,e,t){if(Array.isArray(m))return m.map((n,d)=>Ze(n,String(d),t));if(m&&typeof m.toJSON=="function"){if(!t||!ia(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 d=m.toJSON(e,t);return t.onCreate&&t.onCreate(d),d}return typeof m=="bigint"&&!(t!=null&&t.keep)?Number(m):m}class ir{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:d,reviver:i}={}){if(!Hi(e))throw new TypeError("A document argument is required");const r={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},p=Ze(this,"",r);if(typeof d=="function")for(const{count:o,res:l}of r.anchors.values())d(l,o);return typeof i=="function"?cn(i,{"":p},"",p):p}}class sr extends ir{constructor(e){super(nr),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=[],Sn(e,{Node:(i,r)=>{(Zt(r)||ia(r))&&n.push(r)}}),t&&(t.aliasResolveCache=n));let d;for(const i of n){if(i===this)break;i.anchor===this.source&&(d=i)}return d}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:d,maxAliasCount:i}=t,r=this.resolve(d,t);if(!r){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(o)}let p=n.get(r);if(p||(Ze(r,null,t),p=n.get(r)),(p==null?void 0:p.res)===void 0){const o="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(o)}if(i>=0&&(p.count+=1,p.aliasCount===0&&(p.aliasCount=Ai(d,r,n)),p.count*p.aliasCount>i)){const o="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(o)}return p.res}toString(e,t,n){const d=`*${this.source}`;if(e){if(sa(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`${d} `}return d}}function Ai(m,e,t){if(Zt(e)){const n=e.resolve(m),d=t&&n&&t.get(n);return d?d.count*d.aliasCount:0}else if(ke(e)){let n=0;for(const d of e.items){const i=Ai(m,d,t);i>n&&(n=i)}return n}else if(Me(e)){const n=Ai(m,e.key,t),d=Ai(m,e.value,t);return Math.max(n,d)}return 1}const aa=m=>!m||typeof m!="function"&&typeof m!="object";class ae extends ir{constructor(e){super(ht),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 yp="tag:yaml.org,2002:";function bp(m,e,t){if(e){const n=t.filter(i=>i.tag===e),d=n.find(i=>!i.format)??n[0];if(!d)throw new Error(`Tag ${e} not found`);return d}return t.find(n=>{var d;return((d=n.identify)==null?void 0:d.call(n,m))&&!n.format})}function Jn(m,e,t){var a,c,u;if(Hi(m)&&(m=m.contents),Le(m))return m;if(Me(m)){const h=(c=(a=t.schema[kt]).createNode)==null?void 0:c.call(a,t.schema,null,t);return h.items.push(m),h}(m instanceof String||m instanceof Number||m instanceof Boolean||typeof BigInt<"u"&&m instanceof BigInt)&&(m=m.valueOf());const{aliasDuplicateObjects:n,onAnchor:d,onTagObj:i,schema:r,sourceObjects:p}=t;let o;if(n&&m&&typeof m=="object"){if(o=p.get(m),o)return o.anchor??(o.anchor=d(m)),new sr(o.anchor);o={anchor:null,node:null},p.set(m,o)}e!=null&&e.startsWith("!!")&&(e=yp+e.slice(2));let l=bp(m,e,r.tags);if(!l){if(m&&typeof m.toJSON=="function"&&(m=m.toJSON()),!m||typeof m!="object"){const h=new ae(m);return o&&(o.node=h),h}l=m instanceof Map?r[kt]:Symbol.iterator in Object(m)?r[En]:r[kt]}i&&(i(l),delete t.onTagObj);const s=l!=null&&l.createNode?l.createNode(t.schema,m,t):typeof((u=l==null?void 0:l.nodeClass)==null?void 0:u.from)=="function"?l.nodeClass.from(t.schema,m,t):new ae(m);return e?s.tag=e:l.default||(s.tag=l.tag),o&&(o.node=s),s}function Ri(m,e,t){let n=t;for(let d=e.length-1;d>=0;--d){const i=e[d];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const r=[];r[i]=n,n=r}else n=new Map([[i,n]])}return Jn(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 Rn=m=>m==null||typeof m=="object"&&!!m[Symbol.iterator]().next().done;class la extends ir{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(Rn(e))this.add(t);else{const[n,...d]=e,i=this.get(n,!0);if(ke(i))i.addIn(d,t);else if(i===void 0&&this.schema)this.set(n,Ri(this.schema,d,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${d}`)}}deleteIn(e){const[t,...n]=e;if(n.length===0)return this.delete(t);const d=this.get(t,!0);if(ke(d))return d.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...d]=e,i=this.get(n,!0);return d.length===0?!t&&me(i)?i.value:i:ke(i)?i.getIn(d,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Me(t))return!1;const n=t.value;return n==null||e&&me(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 d=this.get(t,!0);return ke(d)?d.hasIn(n):!1}setIn(e,t){const[n,...d]=e;if(d.length===0)this.set(n,t);else{const i=this.get(n,!0);if(ke(i))i.setIn(d,t);else if(i===void 0&&this.schema)this.set(n,Ri(this.schema,d,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${d}`)}}}const wp=m=>m.replace(/^(?!$)(?: $)?/gm,"#");function mt(m,e){return/^\n+$/.test(m)?m.substring(1):e?m.replace(/^(?! *$)/gm,e):m}const Ht=(m,e,t)=>m.endsWith(`
1395
+ `)?mt(t,e):t.includes(`
1396
+ `)?`
1397
+ `+mt(t,e):(m.endsWith(" ")?"":" ")+t,ca="flow",Is="block",$i="quoted";function Vi(m,e,t="flow",{indentAtStart:n,lineWidth:d=80,minContentWidth:i=20,onFold:r,onOverflow:p}={}){if(!d||d<0)return m;d<i&&(i=0);const o=Math.max(1+i,1+d-e.length);if(m.length<=o)return m;const l=[],s={};let a=d-e.length;typeof n=="number"&&(n>d-Math.max(2,i)?l.push(0):a=d-n);let c,u,h=!1,f=-1,g=-1,v=-1;t===Is&&(f=ho(m,f,e.length),f!==-1&&(a=f+o));for(let A;A=m[f+=1];){if(t===$i&&A==="\\"){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(A===`
1398
+ `)t===Is&&(f=ho(m,f,e.length)),a=f+e.length+o,c=void 0;else{if(A===" "&&u&&u!==" "&&u!==`
1399
+ `&&u!==" "){const S=m[f+1];S&&S!==" "&&S!==`
1400
+ `&&S!==" "&&(c=f)}if(f>=a)if(c)l.push(c),a=c+o,c=void 0;else if(t===$i){for(;u===" "||u===" ";)u=A,A=m[f+=1],h=!0;const S=f>v+1?f-2:g-1;if(s[S])return m;l.push(S),s[S]=!0,a=S+o,c=void 0}else h=!0}u=A}if(h&&p&&p(),l.length===0)return m;r&&r();let b=m.slice(0,l[0]);for(let A=0;A<l.length;++A){const S=l[A],w=l[A+1]||m.length;S===0?b=`
1401
+ ${e}${m.slice(0,w)}`:(t===$i&&s[S]&&(b+=`${m[S]}\\`),b+=`
1402
+ ${e}${m.slice(S+1,w)}`)}return b}function ho(m,e,t){let n=e,d=e+1,i=m[d];for(;i===" "||i===" ";)if(e<d+t)i=m[++e];else{do i=m[++e];while(i&&i!==`
1403
+ `);n=e,d=e+1,i=m[d]}return n}const Ui=(m,e)=>({indentAtStart:e?m.indent.length:m.indentAtStart,lineWidth:m.options.lineWidth,minContentWidth:m.options.minContentWidth}),Ki=m=>/^(%|---|\.\.\.)/m.test(m);function Cp(m,e,t){if(!e||e<0)return!1;const n=e-t,d=m.length;if(d<=n)return!1;for(let i=0,r=0;i<d;++i)if(m[i]===`
1404
+ `){if(i-r>n)return!0;if(r=i+1,d-r<=n)return!1}return!0}function jn(m,e){const t=JSON.stringify(m);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:n}=e,d=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Ki(m)?" ":"");let r="",p=0;for(let o=0,l=t[o];l;l=t[++o])if(l===" "&&t[o+1]==="\\"&&t[o+2]==="n"&&(r+=t.slice(p,o)+"\\ ",o+=1,p=o,l="\\"),l==="\\")switch(t[o+1]){case"u":{r+=t.slice(p,o);const s=t.substr(o+2,4);switch(s){case"0000":r+="\\0";break;case"0007":r+="\\a";break;case"000b":r+="\\v";break;case"001b":r+="\\e";break;case"0085":r+="\\N";break;case"00a0":r+="\\_";break;case"2028":r+="\\L";break;case"2029":r+="\\P";break;default:s.substr(0,2)==="00"?r+="\\x"+s.substr(2):r+=t.substr(o,6)}o+=5,p=o+1}break;case"n":if(n||t[o+2]==='"'||t.length<d)o+=1;else{for(r+=t.slice(p,o)+`
1405
+
1406
+ `;t[o+2]==="\\"&&t[o+3]==="n"&&t[o+4]!=='"';)r+=`
1407
+ `,o+=2;r+=i,t[o+2]===" "&&(r+="\\"),o+=1,p=o+1}break;default:o+=1}return r=p?r+t.slice(p):t,n?r:Vi(r,i,$i,Ui(e,!1))}function Os(m,e){if(e.options.singleQuote===!1||e.implicitKey&&m.includes(`
1408
+ `)||/[ \t]\n|\n[ \t]/.test(m))return jn(m,e);const t=e.indent||(Ki(m)?" ":""),n="'"+m.replace(/'/g,"''").replace(/\n+/g,`$&
1409
+ ${t}`)+"'";return e.implicitKey?n:Vi(n,t,ca,Ui(e,!1))}function hn(m,e){const{singleQuote:t}=e.options;let n;if(t===!1)n=jn;else{const d=m.includes('"'),i=m.includes("'");d&&!i?n=Os:i&&!d?n=jn:n=t?Os:jn}return n(m,e)}let Fs;try{Fs=new RegExp(`(^|(?<!
1410
+ ))
1411
+ +(?!
1412
+ |$)`,"g")}catch{Fs=/\n+(?!\n|$)/g}function xi({comment:m,type:e,value:t},n,d,i){const{blockQuote:r,commentString:p,lineWidth:o}=n.options;if(!r||/\n[\t ]+$/.test(t))return hn(t,n);const l=n.indent||(n.forceBlockIndent||Ki(t)?" ":""),s=r==="literal"?!0:r==="folded"||e===ae.BLOCK_FOLDED?!1:e===ae.BLOCK_LITERAL?!0:!Cp(t,o,l.length);if(!t)return s?`|
1413
+ `:`>
1414
+ `;let a,c;for(c=t.length;c>0;--c){const w=t[c-1];if(w!==`
1415
+ `&&w!==" "&&w!==" ")break}let u=t.substring(c);const h=u.indexOf(`
1416
+ `);h===-1?a="-":t===u||h!==u.length-1?(a="+",i&&i()):a="",u&&(t=t.slice(0,-u.length),u[u.length-1]===`
1417
+ `&&(u=u.slice(0,-1)),u=u.replace(Fs,`$&${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 S=(f?l?"2":"1":"")+a;if(m&&(S+=" "+p(m.replace(/ ?[\r\n]+/g," ")),d&&d()),!s){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 D=Ui(n,!0);r!=="folded"&&e!==ae.BLOCK_FOLDED&&(D.onOverflow=()=>{y=!0});const T=Vi(`${b}${w}${u}`,l,Is,D);if(!y)return`>${S}
1420
+ ${l}${T}`}return t=t.replace(/\n+/g,`$&${l}`),`|${S}
1421
+ ${l}${b}${t}${u}`}function Ep(m,e,t,n){const{type:d,value:i}=m,{actualString:r,implicitKey:p,indent:o,indentStep:l,inFlow:s}=e;if(p&&i.includes(`
1422
+ `)||s&&/[[\]{},]/.test(i))return hn(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return p||s||!i.includes(`
1423
+ `)?hn(i,e):xi(m,e,t,n);if(!p&&!s&&d!==ae.PLAIN&&i.includes(`
1424
+ `))return xi(m,e,t,n);if(Ki(i)){if(o==="")return e.forceBlockIndent=!0,xi(m,e,t,n);if(p&&o===l)return hn(i,e)}const a=i.replace(/\n+/g,`$&
1425
+ ${o}`);if(r){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:u,tags:h}=e.doc.schema;if(h.some(c)||u!=null&&u.some(c))return hn(i,e)}return p?a:Vi(a,o,ca,Ui(e,!1))}function rr(m,e,t,n){const{implicitKey:d,inFlow:i}=e,r=typeof m.value=="string"?m:Object.assign({},m,{value:String(m.value)});let{type:p}=m;p!==ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(r.value)&&(p=ae.QUOTE_DOUBLE);const o=s=>{switch(s){case ae.BLOCK_FOLDED:case ae.BLOCK_LITERAL:return d||i?hn(r.value,e):xi(r,e,t,n);case ae.QUOTE_DOUBLE:return jn(r.value,e);case ae.QUOTE_SINGLE:return Os(r.value,e);case ae.PLAIN:return Ep(r,e,t,n);default:return null}};let l=o(p);if(l===null){const{defaultKeyType:s,defaultStringType:a}=e.options,c=d&&s||a;if(l=o(c),l===null)throw new Error(`Unsupported default string type ${c}`)}return l}function ha(m,e){const t=Object.assign({blockQuote:!0,commentString:wp,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,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 Sp(m,e){var d;if(e.tag){const i=m.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,n;if(me(e)){n=e.value;let i=m.filter(r=>{var p;return(p=r.identify)==null?void 0:p.call(r,n)});if(i.length>1){const r=i.filter(p=>p.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else n=e,t=m.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!t){const i=((d=n==null?void 0:n.constructor)==null?void 0:d.name)??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return t}function Dp(m,e,{anchors:t,doc:n}){if(!n.directives)return"";const d=[],i=(me(m)||ke(m))&&m.anchor;i&&sa(i)&&(t.add(i),d.push(`&${i}`));const r=m.tag??(e.default?null:e.tag);return r&&d.push(n.directives.tagString(r)),d.join(" ")}function bn(m,e,t,n){var o;if(Me(m))return m.toString(e,t,n);if(Zt(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 d;const i=Le(m)?m:e.doc.createNode(m,{onTagObj:l=>d=l});d??(d=Sp(e.doc.schema.tags,i));const r=Dp(i,d,e);r.length>0&&(e.indentAtStart=(e.indentAtStart??0)+r.length+1);const p=typeof d.stringify=="function"?d.stringify(i,e,t,n):me(i)?rr(i,e,t,n):i.toString(e,t,n);return r?me(i)||p[0]==="{"||p[0]==="["?`${r} ${p}`:`${r}
1426
+ ${e.indent}${p}`:p}function Ap({key:m,value:e},t,n,d){const{allNullValues:i,doc:r,indent:p,indentStep:o,options:{commentString:l,indentSeq:s,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(ke(m)||!Le(m)&&typeof m=="object"){const D="With simple keys, collection cannot be used as a key value";throw new Error(D)}}let u=!a&&(!m||c&&e==null&&!t.inFlow||ke(m)||(me(m)?m.type===ae.BLOCK_FOLDED||m.type===ae.BLOCK_LITERAL:typeof m=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!u&&(a||!i),indent:p+o});let h=!1,f=!1,g=bn(m,t,()=>h=!0,()=>f=!0);if(!u&&!t.inFlow&&g.length>1024){if(a)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");u=!0}if(t.inFlow){if(i||e==null)return h&&n&&n(),g===""?"?":u?`? ${g}`:g}else if(i&&!a||e==null&&u)return g=`? ${g}`,c&&!h?g+=Ht(g,t.indent,l(c)):f&&d&&d(),g;h&&(c=null),u?(c&&(g+=Ht(g,t.indent,l(c))),g=`? ${g}
1427
+ ${p}:`):(g=`${g}:`,c&&(g+=Ht(g,t.indent,l(c))));let v,b,A;Le(e)?(v=!!e.spaceBefore,b=e.commentBefore,A=e.comment):(v=!1,b=null,A=null,e&&typeof e=="object"&&(e=r.createNode(e))),t.implicitKey=!1,!u&&!c&&me(e)&&(t.indentAtStart=g.length+1),f=!1,!s&&o.length>=2&&!t.inFlow&&!u&&Zn(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let S=!1;const w=bn(e,t,()=>S=!0,()=>f=!0);let y=" ";if(c||v||b){if(y=v?`
1428
+ `:"",b){const D=l(b);y+=`
1429
+ ${mt(D,t.indent)}`}w===""&&!t.inFlow?y===`
1430
+ `&&A&&(y=`
1431
+
1432
+ `):y+=`
1433
+ ${t.indent}`}else if(!u&&ke(e)){const D=w[0],T=w.indexOf(`
1434
+ `),$=T!==-1,M=t.inFlow??e.flow??e.items.length===0;if($||!M){let O=!1;if($&&(D==="&"||D==="!")){let x=w.indexOf(" ");D==="&"&&x!==-1&&x<T&&w[x+1]==="!"&&(x=w.indexOf(" ",x+1)),(x===-1||T<x)&&(O=!0)}O||(y=`
1435
+ ${t.indent}`)}}else(w===""||w[0]===`
1436
+ `)&&(y="");return g+=y+w,t.inFlow?S&&n&&n():A&&!S?g+=Ht(g,t.indent,l(A)):f&&d&&d(),g}function ua(m,e){(m==="debug"||m==="warn")&&console.warn(e)}const mi="<<",bt={identify:m=>m===mi||typeof m=="symbol"&&m.description===mi,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ae(Symbol(mi)),{addToJSMap:da}),stringify:()=>mi},$p=(m,e)=>(bt.identify(e)||me(e)&&(!e.type||e.type===ae.PLAIN)&&bt.identify(e.value))&&(m==null?void 0:m.doc.schema.tags.some(t=>t.tag===bt.tag&&t.default));function da(m,e,t){if(t=m&&Zt(t)?t.resolve(m.doc):t,Zn(t))for(const n of t.items)bs(m,e,n);else if(Array.isArray(t))for(const n of t)bs(m,e,n);else bs(m,e,t)}function bs(m,e,t){const n=m&&Zt(t)?t.resolve(m.doc):t;if(!Xn(n))throw new Error("Merge sources must be maps or map aliases");const d=n.toJSON(null,m,Map);for(const[i,r]of d)e instanceof Map?e.has(i)||e.set(i,r):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:r,writable:!0,enumerable:!0,configurable:!0});return e}function pa(m,e,{key:t,value:n}){if(Le(t)&&t.addToJSMap)t.addToJSMap(m,e,n);else if($p(m,t))da(m,e,n);else{const d=Ze(t,"",m);if(e instanceof Map)e.set(d,Ze(n,d,m));else if(e instanceof Set)e.add(d);else{const i=xp(t,d,m),r=Ze(n,i,m);i in e?Object.defineProperty(e,i,{value:r,writable:!0,enumerable:!0,configurable:!0}):e[i]=r}}return e}function xp(m,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Le(m)&&(t!=null&&t.doc)){const n=ha(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 d=m.toString(n);if(!t.mapKeyWarned){let i=JSON.stringify(d);i.length>40&&(i=i.substring(0,36)+'..."'),ua(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 d}return JSON.stringify(e)}function or(m,e,t){const n=Jn(m,void 0,t),d=Jn(e,void 0,t);return new ze(n,d)}class ze{constructor(e,t=null){Object.defineProperty(this,qe,{value:na}),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 ze(t,n)}toJSON(e,t){const n=t!=null&&t.mapAsMap?new Map:{};return pa(t,n,this)}toString(e,t,n){return e!=null&&e.doc?Ap(this,e,t,n):JSON.stringify(this)}}function fa(m,e,t){return(e.inFlow??m.flow?kp:_p)(m,e,t)}function _p({comment:m,items:e},t,{blockItemPrefix:n,flowChars:d,itemIndent:i,onChompKeep:r,onComment:p}){const{indent:o,options:{commentString:l}}=t,s=Object.assign({},t,{indent:i,type:null});let a=!1;const c=[];for(let h=0;h<e.length;++h){const f=e[h];let g=null;if(Le(f))!a&&f.spaceBefore&&c.push(""),Ni(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(""),Ni(t,c,b.commentBefore,a))}a=!1;let v=bn(f,s,()=>g=null,()=>a=!0);g&&(v+=Ht(v,i,l(g))),a&&g&&(a=!1),c.push(n+v)}let u;if(c.length===0)u=d.start+d.end;else{u=c[0];for(let h=1;h<c.length;++h){const f=c[h];u+=f?`
1437
+ ${o}${f}`:`
1438
+ `}}return m?(u+=`
1439
+ `+mt(l(m),o),p&&p()):a&&r&&r(),u}function kp({items:m},e,{flowChars:t,itemIndent:n}){const{indent:d,indentStep:i,flowCollectionPadding:r,options:{commentString:p}}=e;n+=i;const o=Object.assign({},e,{indent:n,inFlow:!0,type:null});let l=!1,s=0;const a=[];for(let h=0;h<m.length;++h){const f=m[h];let g=null;if(Le(f))f.spaceBefore&&a.push(""),Ni(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(""),Ni(e,a,b.commentBefore,!1),b.comment&&(l=!0));const A=Le(f.value)?f.value:null;A?(A.comment&&(g=A.comment),A.commentBefore&&(l=!0)):f.value==null&&(b!=null&&b.comment)&&(g=b.comment)}g&&(l=!0);let v=bn(f,o,()=>g=null);h<m.length-1&&(v+=","),g&&(v+=Ht(v,n,p(g))),!l&&(a.length>s||v.includes(`
1440
+ `))&&(l=!0),a.push(v),s=a.length}const{start:c,end:u}=t;if(a.length===0)return c+u;if(!l){const h=a.reduce((f,g)=>f+g.length+2,2);l=e.options.lineWidth>0&&h>e.options.lineWidth}if(l){let h=c;for(const f of a)h+=f?`
1441
+ ${i}${d}${f}`:`
1442
+ `;return`${h}
1443
+ ${d}${u}`}else return`${c}${r}${a.join(" ")}${r}${u}`}function Ni({indent:m,options:{commentString:e}},t,n,d){if(n&&d&&(n=n.replace(/^\n+/,"")),n){const i=mt(e(n),m);t.push(i.trimStart())}}function Vt(m,e){const t=me(e)?e.value:e;for(const n of m)if(Me(n)&&(n.key===e||n.key===t||me(n.key)&&n.key.value===t))return n}class Xe extends la{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(kt,e),this.items=[]}static from(e,t,n){const{keepUndefined:d,replacer:i}=n,r=new this(e),p=(o,l)=>{if(typeof i=="function")l=i.call(t,o,l);else if(Array.isArray(i)&&!i.includes(o))return;(l!==void 0||d)&&r.items.push(or(o,l,n))};if(t instanceof Map)for(const[o,l]of t)p(o,l);else if(t&&typeof t=="object")for(const o of Object.keys(t))p(o,t[o]);return typeof e.sortMapEntries=="function"&&r.items.sort(e.sortMapEntries),r}add(e,t){var r;let n;Me(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new ze(e,e==null?void 0:e.value):n=new ze(e.key,e.value);const d=Vt(this.items,n.key),i=(r=this.schema)==null?void 0:r.sortMapEntries;if(d){if(!t)throw new Error(`Key ${n.key} already set`);me(d.value)&&aa(n.value)?d.value.value=n.value:d.value=n.value}else if(i){const p=this.items.findIndex(o=>i(n,o)<0);p===-1?this.items.push(n):this.items.splice(p,0,n)}else this.items.push(n)}delete(e){const t=Vt(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const n=Vt(this.items,e),d=n==null?void 0:n.value;return(!t&&me(d)?d.value:d)??void 0}has(e){return!!Vt(this.items,e)}set(e,t){this.add(new ze(e,t),!0)}toJSON(e,t,n){const d=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(d);for(const i of this.items)pa(t,d,i);return d}toString(e,t,n){if(!e)return JSON.stringify(this);for(const d of this.items)if(!Me(d))throw new Error(`Map items must all be pairs; found ${JSON.stringify(d)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),fa(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 Xn(m)||e("Expected a mapping for this tag"),m},createNode:(m,e,t)=>Xe.from(m,e,t)};class Yt extends la{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=vi(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const n=vi(e);if(typeof n!="number")return;const d=this.items[n];return!t&&me(d)?d.value:d}has(e){const t=vi(e);return typeof t=="number"&&t<this.items.length}set(e,t){const n=vi(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);const d=this.items[n];me(d)&&aa(t)?d.value=t:this.items[n]=t}toJSON(e,t){const n=[];t!=null&&t.onCreate&&t.onCreate(n);let d=0;for(const i of this.items)n.push(Ze(i,String(d++),t));return n}toString(e,t,n){return e?fa(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:d}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let r=0;for(let p of t){if(typeof d=="function"){const o=t instanceof Set?p:String(r++);p=d.call(t,o,p)}i.items.push(Jn(p,void 0,n))}}return i}}function vi(m){let e=me(m)?m.value:m;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const An={collection:"seq",default:!0,nodeClass:Yt,tag:"tag:yaml.org,2002:seq",resolve(m,e){return Zn(m)||e("Expected a sequence for this tag"),m},createNode:(m,e,t)=>Yt.from(m,e,t)},Gi={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),rr(m,e,t,n)}},Ji={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"&&Ji.test.test(m)?m:e.options.nullStr},ar={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&&ar.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 d=typeof n=="number"?n:Number(n);if(!isFinite(d))return isNaN(d)?".nan":d<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 r=i.indexOf(".");r<0&&(r=i.length,i+=".");let p=e-(i.length-r-1);for(;p-- >0;)i+="0"}return i}const ga={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},ma={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)}},va={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},Yi=m=>typeof m=="bigint"||Number.isInteger(m),lr=(m,e,t,{intAsBigInt:n})=>n?BigInt(m):parseInt(m.substring(e),t);function ya(m,e,t){const{value:n}=m;return Yi(n)&&n>=0?t+n.toString(e):ot(m)}const ba={identify:m=>Yi(m)&&m>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(m,e,t)=>lr(m,2,8,t),stringify:m=>ya(m,8,"0o")},wa={identify:Yi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(m,e,t)=>lr(m,0,10,t),stringify:ot},Ca={identify:m=>Yi(m)&&m>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(m,e,t)=>lr(m,2,16,t),stringify:m=>ya(m,16,"0x")},Tp=[Dn,An,Gi,Ji,ar,ba,wa,Ca,ga,ma,va];function uo(m){return typeof m=="bigint"||Number.isInteger(m)}const yi=({value:m})=>JSON.stringify(m),Lp=[{identify:m=>typeof m=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:m=>m,stringify:yi},{identify:m=>m==null,createNode:()=>new ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:yi},{identify:m=>typeof m=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:m=>m==="true",stringify:yi},{identify:uo,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})=>uo(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:yi}],Mp={default:!0,tag:"",test:/^/,resolve(m,e){return e(`Unresolved plain scalar ${JSON.stringify(m)}`),m}},Ip=[Dn,An].concat(Lp,Mp),cr={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 d=0;d<t.length;++d)n[d]=t.charCodeAt(d);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,d,i){if(!t)return"";const r=t;let p;if(typeof btoa=="function"){let o="";for(let l=0;l<r.length;++l)o+=String.fromCharCode(r[l]);p=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(p.length/o),s=new Array(l);for(let a=0,c=0;a<l;++a,c+=o)s[a]=p.substr(c,o);p=s.join(e===ae.BLOCK_LITERAL?`
1444
+ `:" ")}return rr({comment:m,type:e,value:p},n,d,i)}};function Ea(m,e){if(Zn(m))for(let t=0;t<m.items.length;++t){let n=m.items[t];if(!Me(n)){if(Xn(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");const d=n.items[0]||new ze(new ae(null));if(n.commentBefore&&(d.key.commentBefore=d.key.commentBefore?`${n.commentBefore}
1445
+ ${d.key.commentBefore}`:n.commentBefore),n.comment){const i=d.value??d.key;i.comment=i.comment?`${n.comment}
1446
+ ${i.comment}`:n.comment}n=d}m.items[t]=Me(n)?n:new ze(n)}}else e("Expected a sequence for this tag");return m}function Sa(m,e,t){const{replacer:n}=t,d=new Yt(m);d.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let r of e){typeof n=="function"&&(r=n.call(e,String(i++),r));let p,o;if(Array.isArray(r))if(r.length===2)p=r[0],o=r[1];else throw new TypeError(`Expected [key, value] tuple: ${r}`);else if(r&&r instanceof Object){const l=Object.keys(r);if(l.length===1)p=l[0],o=r[p];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else p=r;d.items.push(or(p,o,t))}return d}const hr={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ea,createNode:Sa};class dn extends Yt{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=dn.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(const d of this.items){let i,r;if(Me(d)?(i=Ze(d.key,"",t),r=Ze(d.value,i,t)):i=Ze(d,"",t),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,r)}return n}static from(e,t,n){const d=Sa(e,t,n),i=new this;return i.items=d.items,i}}dn.tag="tag:yaml.org,2002:omap";const ur={collection:"seq",identify:m=>m instanceof Map,nodeClass:dn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(m,e){const t=Ea(m,e),n=[];for(const{key:d}of t.items)me(d)&&(n.includes(d.value)?e(`Ordered maps must not include duplicate keys: ${d.value}`):n.push(d.value));return Object.assign(new dn,t)},createNode:(m,e,t)=>dn.from(m,e,t)};function Da({value:m,source:e},t){return e&&(m?Aa:$a).test.test(e)?e:m?t.options.trueStr:t.options.falseStr}const Aa={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:Da},$a={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:Da},Op={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},Fp={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)}},Rp={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},qn=m=>typeof m=="bigint"||Number.isInteger(m);function Qi(m,e,t,{intAsBigInt:n}){const d=m[0];if((d==="-"||d==="+")&&(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 r=BigInt(m);return d==="-"?BigInt(-1)*r:r}const i=parseInt(m,t);return d==="-"?-1*i:i}function dr(m,e,t){const{value:n}=m;if(qn(n)){const d=n.toString(e);return n<0?"-"+t+d.substr(1):t+d}return ot(m)}const Np={identify:qn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(m,e,t)=>Qi(m,2,2,t),stringify:m=>dr(m,2,"0b")},Bp={identify:qn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(m,e,t)=>Qi(m,1,8,t),stringify:m=>dr(m,8,"0")},Pp={identify:qn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(m,e,t)=>Qi(m,0,10,t),stringify:ot},Wp={identify:qn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(m,e,t)=>Qi(m,2,16,t),stringify:m=>dr(m,16,"0x")};class pn extends Xe{constructor(e){super(e),this.tag=pn.tag}add(e){let t;Me(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new ze(e.key,null):t=new ze(e,null),Vt(this.items,t.key)||this.items.push(t)}get(e,t){const n=Vt(this.items,e);return!t&&Me(n)?me(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=Vt(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new ze(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:d}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let r of t)typeof d=="function"&&(r=d.call(t,r,r)),i.items.push(or(r,null,n));return i}}pn.tag="tag:yaml.org,2002:set";const pr={collection:"map",identify:m=>m instanceof Set,nodeClass:pn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(m,e,t)=>pn.from(m,e,t),resolve(m,e){if(Xn(m)){if(m.hasAllNullValues(!0))return Object.assign(new pn,m);e("Set items must all have null values")}else e("Expected a mapping for this tag");return m}};function fr(m,e){const t=m[0],n=t==="-"||t==="+"?m.substring(1):m,d=r=>e?BigInt(r):Number(r),i=n.replace(/_/g,"").split(":").reduce((r,p)=>r*d(60)+d(p),d(0));return t==="-"?d(-1)*i:i}function xa(m){let{value:e}=m,t=r=>r;if(typeof e=="bigint")t=r=>BigInt(r);else if(isNaN(e)||!isFinite(e))return ot(m);let n="";e<0&&(n="-",e*=t(-1));const d=t(60),i=[e%d];return e<60?i.unshift(0):(e=(e-i[0])/d,i.unshift(e%d),e>=60&&(e=(e-i[0])/d,i.unshift(e))),n+i.map(r=>String(r).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const _a={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})=>fr(m,t),stringify:xa},ka={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=>fr(m,!1),stringify:xa},Xi={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(Xi.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,n,d,i,r,p]=e.map(Number),o=e[7]?Number((e[7]+"00").substr(1,3)):0;let l=Date.UTC(t,n-1,d,i||0,r||0,p||0,o);const s=e[8];if(s&&s!=="Z"){let a=fr(s,!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$/,""))??""},po=[Dn,An,Gi,Ji,Aa,$a,Np,Bp,Pp,Wp,Op,Fp,Rp,cr,bt,ur,hr,pr,_a,ka,Xi],fo=new Map([["core",Tp],["failsafe",[Dn,An,Gi]],["json",Ip],["yaml11",po],["yaml-1.1",po]]),go={binary:cr,bool:ar,float:va,floatExp:ma,floatNaN:ga,floatTime:ka,int:wa,intHex:Ca,intOct:ba,intTime:_a,map:Dn,merge:bt,null:Ji,omap:ur,pairs:hr,seq:An,set:pr,timestamp:Xi},jp={"tag:yaml.org,2002:binary":cr,"tag:yaml.org,2002:merge":bt,"tag:yaml.org,2002:omap":ur,"tag:yaml.org,2002:pairs":hr,"tag:yaml.org,2002:set":pr,"tag:yaml.org,2002:timestamp":Xi};function ws(m,e,t){const n=fo.get(e);if(n&&!m)return t&&!n.includes(bt)?n.concat(bt):n.slice();let d=n;if(!d)if(Array.isArray(m))d=[];else{const i=Array.from(fo.keys()).filter(r=>r!=="yaml11").map(r=>JSON.stringify(r)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(m))for(const i of m)d=d.concat(i);else typeof m=="function"&&(d=m(d.slice()));return t&&(d=d.concat(bt)),d.reduce((i,r)=>{const p=typeof r=="string"?go[r]:r;if(!p){const o=JSON.stringify(r),l=Object.keys(go).map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown custom tag ${o}; use one of ${l}`)}return i.includes(p)||i.push(p),i},[])}const zp=(m,e)=>m.key<e.key?-1:m.key>e.key?1:0;class gr{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:d,schema:i,sortMapEntries:r,toStringDefaults:p}){this.compat=Array.isArray(e)?ws(e,"compat"):e?ws(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=d?jp:{},this.tags=ws(t,this.name,n),this.toStringOptions=p??null,Object.defineProperty(this,kt,{value:Dn}),Object.defineProperty(this,ht,{value:Gi}),Object.defineProperty(this,En,{value:An}),this.sortMapEntries=typeof r=="function"?r:r===!0?zp:null}clone(){const e=Object.create(gr.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Hp(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 d=ha(m,e),{commentString:i}=d.options;if(m.commentBefore){t.length!==1&&t.unshift("");const l=i(m.commentBefore);t.unshift(mt(l,""))}let r=!1,p=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(mt(a,""))}d.forceBlockIndent=!!m.comment,p=m.contents.comment}const l=p?void 0:()=>r=!0;let s=bn(m.contents,d,()=>p=null,l);p&&(s+=Ht(s,"",i(p))),(s[0]==="|"||s[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${s}`:t.push(s)}else t.push(bn(m.contents,d));if((o=m.directives)!=null&&o.docEnd)if(m.comment){const l=i(m.comment);l.includes(`
1447
+ `)?(t.push("..."),t.push(mt(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=m.comment;l&&r&&(l=l.replace(/^\n+/,"")),l&&((!r||p)&&t[t.length-1]!==""&&t.push(""),t.push(mt(i(l),"")))}return t.join(`
1448
+ `)+`
1449
+ `}class Zi{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,qe,{value:Ms});let d=null;typeof t=="function"||Array.isArray(t)?d=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:r}=i;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(r=this.directives.yaml.version)):this.directives=new We({version:r}),this.setSchema(r,n),this.contents=e===void 0?null:this.createNode(e,d,n)}clone(){const e=Object.create(Zi.prototype,{[qe]:{value:Ms}});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){rn(this.contents)&&this.contents.add(e)}addIn(e,t){rn(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=ra(this);e.anchor=!t||n.has(t)?oa(t||"a",n):t}return new sr(e.anchor)}createNode(e,t,n){let d;if(typeof t=="function")e=t.call({"":e},"",e),d=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)),d=t}else n===void 0&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:r,flow:p,keepUndefined:o,onTagObj:l,tag:s}=n??{},{onAnchor:a,setAnchors:c,sourceObjects:u}=vp(this,r||"a"),h={aliasDuplicateObjects:i??!0,keepUndefined:o??!1,onAnchor:a,onTagObj:l,replacer:d,schema:this.schema,sourceObjects:u},f=Jn(e,s,h);return p&&ke(f)&&(f.flow=!0),c(),f}createPair(e,t,n={}){const d=this.createNode(e,null,n),i=this.createNode(t,null,n);return new ze(d,i)}delete(e){return rn(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Rn(e)?this.contents==null?!1:(this.contents=null,!0):rn(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return ke(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Rn(e)?!t&&me(this.contents)?this.contents.value:this.contents:ke(this.contents)?this.contents.getIn(e,t):void 0}has(e){return ke(this.contents)?this.contents.has(e):!1}hasIn(e){return Rn(e)?this.contents!==void 0:ke(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ri(this.schema,[e],t):rn(this.contents)&&this.contents.set(e,t)}setIn(e,t){Rn(e)?this.contents=t:this.contents==null?this.contents=Ri(this.schema,Array.from(e),t):rn(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 d=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${d}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new gr(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:d,onAnchor:i,reviver:r}={}){const p={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof d=="number"?d:100},o=Ze(this.contents,t??"",p);if(typeof i=="function")for(const{count:l,res:s}of p.anchors.values())i(s,l);return typeof r=="function"?cn(r,{"":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 Hp(this,e)}}function rn(m){if(ke(m))return!0;throw new Error("Expected a YAML collection as document contents")}class Ta extends Error{constructor(e,t,n,d){super(),this.name=e,this.code=n,this.message=d,this.pos=t}}class Nn extends Ta{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class Vp extends Ta{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const mo=(m,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(p=>e.linePos(p));const{line:n,col:d}=t.linePos[0];t.message+=` at line ${n}, column ${d}`;let i=d-1,r=m.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(i>=60&&r.length>80){const p=Math.min(i-39,r.length-79);r="…"+r.substring(p),i-=p-1}if(r.length>80&&(r=r.substring(0,79)+"…"),n>1&&/^ *$/.test(r.substring(0,i))){let p=m.substring(e.lineStarts[n-2],e.lineStarts[n-1]);p.length>80&&(p=p.substring(0,79)+`…
1450
+ `),r=p+r}if(/[^ ]/.test(r)){let p=1;const o=t.linePos[1];(o==null?void 0:o.line)===n&&o.col>d&&(p=Math.max(1,Math.min(o.col-d,80-i)));const l=" ".repeat(i)+"^".repeat(p);t.message+=`:
1451
+
1452
+ ${r}
1453
+ ${l}
1454
+ `}};function wn(m,{flow:e,indicator:t,next:n,offset:d,onError:i,parentIndent:r,startOnNewline:p}){let o=!1,l=p,s=p,a="",c="",u=!1,h=!1,f=null,g=null,v=null,b=null,A=null,S=null,w=null;for(const T of m)switch(h&&(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"),h=!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),s=!0;break;case"comment":{s||i(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const $=T.source.substring(1)||" ";a?a+=c+$:a=$,c="",l=!1;break}case"newline":l?a?a+=T.source:(!S||t!=="seq-item-ind")&&(o=!0):c+=T.source,l=!0,u=!0,(g||v)&&(b=T),s=!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,s=!1,h=!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,s=!1,h=!0;break}case t:(g||v)&&i(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),S&&i(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${e??"collection"}`),S=T,l=t==="seq-item-ind"||t==="explicit-key-ind",s=!1;break;case"comma":if(e){A&&i(T,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),A=T,l=!1,s=!1;break}default:i(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),l=!1,s=!1}const y=m[m.length-1],D=y?y.offset+y.source.length:d;return h&&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<=r||(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:A,found:S,spaceBefore:o,comment:a,hasNewline:u,anchor:g,tag:v,newlineAfterProp:b,end:D,start:w??D}}function Yn(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(Yn(e.key)||Yn(e.value))return!0}return!1;default:return!0}}function Rs(m,e,t){if((e==null?void 0:e.type)==="flow-collection"){const n=e.end[0];n.indent===m&&(n.source==="]"||n.source==="}")&&Yn(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function La(m,e,t){const{uniqueKeys:n}=m.options;if(n===!1)return!1;const d=typeof n=="function"?n:(i,r)=>i===r||me(i)&&me(r)&&i.value===r.value;return e.some(i=>d(i.key,t))}const vo="All mapping items must start at the same column";function Up({composeNode:m,composeEmptyNode:e},t,n,d,i){var s;const r=(i==null?void 0:i.nodeClass)??Xe,p=new r(t.schema);t.atRoot&&(t.atRoot=!1);let o=n.offset,l=null;for(const a of n.items){const{start:c,key:u,sep:h,value:f}=a,g=wn(c,{indicator:"explicit-key-ind",next:u??(h==null?void 0:h[0]),offset:o,onError:d,parentIndent:n.indent,startOnNewline:!0}),v=!g.found;if(v){if(u&&(u.type==="block-seq"?d(o,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==n.indent&&d(o,"BAD_INDENT",vo)),!g.anchor&&!g.tag&&!h){l=g.end,g.comment&&(p.comment?p.comment+=`
1456
+ `+g.comment:p.comment=g.comment);continue}(g.newlineAfterProp||Yn(u))&&d(u??c[c.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((s=g.found)==null?void 0:s.indent)!==n.indent&&d(o,"BAD_INDENT",vo);t.atKey=!0;const b=g.end,A=u?m(t,u,g,d):e(t,b,c,null,g,d);t.schema.compat&&Rs(n.indent,u,d),t.atKey=!1,La(t,p.items,A)&&d(b,"DUPLICATE_KEY","Map keys must be unique");const S=wn(h??[],{indicator:"map-value-ind",next:f,offset:A.range[2],onError:d,parentIndent:n.indent,startOnNewline:!u||u.type==="block-scalar"});if(o=S.end,S.found){v&&((f==null?void 0:f.type)==="block-map"&&!S.hasNewline&&d(o,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&g.start<S.found.offset-1024&&d(A.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,S,d):e(t,o,h,null,S,d);t.schema.compat&&Rs(n.indent,f,d),o=w.range[2];const y=new ze(A,w);t.options.keepSourceTokens&&(y.srcToken=a),p.items.push(y)}else{v&&d(A.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(A.comment?A.comment+=`
1457
+ `+S.comment:A.comment=S.comment);const w=new ze(A);t.options.keepSourceTokens&&(w.srcToken=a),p.items.push(w)}}return l&&l<o&&d(l,"IMPOSSIBLE","Map comment with trailing content"),p.range=[n.offset,o,l??o],p}function Kp({composeNode:m,composeEmptyNode:e},t,n,d,i){const r=(i==null?void 0:i.nodeClass)??Yt,p=new r(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let o=n.offset,l=null;for(const{start:s,value:a}of n.items){const c=wn(s,{indicator:"seq-item-ind",next:a,offset:o,onError:d,parentIndent:n.indent,startOnNewline:!0});if(!c.found)if(c.anchor||c.tag||a)(a==null?void 0:a.type)==="block-seq"?d(c.end,"BAD_INDENT","All sequence items must start at the same column"):d(o,"MISSING_CHAR","Sequence item without - indicator");else{l=c.end,c.comment&&(p.comment=c.comment);continue}const u=a?m(t,a,c,d):e(t,c.end,s,null,c,d);t.schema.compat&&Rs(n.indent,a,d),o=u.range[2],p.items.push(u)}return p.range=[n.offset,o,l??o],p}function ei(m,e,t,n){let d="";if(m){let i=!1,r="";for(const p of m){const{source:o,type:l}=p;switch(l){case"space":i=!0;break;case"comment":{t&&!i&&n(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const s=o.substring(1)||" ";d?d+=r+s:d=s,r="";break}case"newline":d&&(r+=o),i=!0;break;default:n(p,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=o.length}}return{comment:d,offset:e}}const Cs="Block collections are not allowed within flow collections",Es=m=>m&&(m.type==="block-map"||m.type==="block-seq");function Gp({composeNode:m,composeEmptyNode:e},t,n,d,i){var g;const r=n.start.source==="{",p=r?"flow map":"flow sequence",o=(i==null?void 0:i.nodeClass)??(r?Xe:Yt),l=new o(t.schema);l.flow=!0;const s=t.atRoot;s&&(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:A,key:S,sep:w,value:y}=b,D=wn(A,{flow:p,indicator:"explicit-key-ind",next:S??(w==null?void 0:w[0]),offset:a,onError:d,parentIndent:n.indent,startOnNewline:!1});if(!D.found){if(!D.anchor&&!D.tag&&!w&&!y){v===0&&D.comma?d(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${p}`):v<n.items.length-1&&d(D.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${p}`),D.comment&&(l.comment?l.comment+=`
1458
+ `+D.comment:l.comment=D.comment),a=D.end;continue}!r&&t.options.strict&&Yn(S)&&d(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(v===0)D.comma&&d(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${p}`);else if(D.comma||d(D.start,"MISSING_CHAR",`Missing , between ${p} items`),D.comment){let T="";e:for(const $ of A)switch($.type){case"comma":case"space":break;case"comment":T=$.source.substring(1);break e;default:break e}if(T){let $=l.items[l.items.length-1];Me($)&&($=$.value??$.key),$.comment?$.comment+=`
1459
+ `+T:$.comment=T,D.comment=D.comment.substring(T.length+1)}}if(!r&&!w&&!D.found){const T=y?m(t,y,D,d):e(t,D.end,w,null,D,d);l.items.push(T),a=T.range[2],Es(y)&&d(T.range,"BLOCK_IN_FLOW",Cs)}else{t.atKey=!0;const T=D.end,$=S?m(t,S,D,d):e(t,T,A,null,D,d);Es(S)&&d($.range,"BLOCK_IN_FLOW",Cs),t.atKey=!1;const M=wn(w??[],{flow:p,indicator:"map-value-ind",next:y,offset:$.range[2],onError:d,parentIndent:n.indent,startOnNewline:!1});if(M.found){if(!r&&!D.found&&t.options.strict){if(w)for(const k of w){if(k===M.found)break;if(k.type==="newline"){d(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}D.start<M.found.offset-1024&&d(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])===":"?d(y,"MISSING_CHAR",`Missing space after : in ${p}`):d(M.start,"MISSING_CHAR",`Missing , or : between ${p} items`));const O=y?m(t,y,M,d):M.found?e(t,M.end,w,null,M,d):null;O?Es(y)&&d(O.range,"BLOCK_IN_FLOW",Cs):M.comment&&($.comment?$.comment+=`
1460
+ `+M.comment:$.comment=M.comment);const x=new ze($,O);if(t.options.keepSourceTokens&&(x.srcToken=b),r){const k=l;La(t,k.items,$)&&d(T,"DUPLICATE_KEY","Map keys must be unique"),k.items.push(x)}else{const k=new Xe(t.schema);k.flow=!0,k.items.push(x);const E=(O??$).range;k.range=[$.range[0],E[1],E[2]],l.items.push(k)}a=O?O.range[2]:M.end}}const c=r?"}":"]",[u,...h]=n.end;let f=a;if((u==null?void 0:u.source)===c)f=u.offset+u.source.length;else{const v=p[0].toUpperCase()+p.substring(1),b=s?`${v} must end with a ${c}`:`${v} in block collection must be sufficiently indented and end with a ${c}`;d(a,s?"MISSING_CHAR":"BAD_INDENT",b),u&&u.source.length!==1&&h.unshift(u)}if(h.length>0){const v=ei(h,f,t.options.strict,d);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 Ss(m,e,t,n,d,i){const r=t.type==="block-map"?Up(m,e,t,n,i):t.type==="block-seq"?Kp(m,e,t,n,i):Gp(m,e,t,n,i),p=r.constructor;return d==="!"||d===p.tagName?(r.tag=p.tagName,r):(d&&(r.tag=d),r)}function Jp(m,e,t,n,d){var c;const i=n.tag,r=i?e.directives.tagName(i.source,u=>d(i,"TAG_RESOLVE_FAILED",u)):null;if(t.type==="block-seq"){const{anchor:u,newlineAfterProp:h}=n,f=u&&i?u.offset>i.offset?u:i:u??i;f&&(!h||h.offset<f.offset)&&d(f,"MISSING_CHAR","Missing newline after block sequence props")}const p=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!i||!r||r==="!"||r===Xe.tagName&&p==="map"||r===Yt.tagName&&p==="seq")return Ss(m,e,t,d,r);let o=e.schema.tags.find(u=>u.tag===r&&u.collection===p);if(!o){const u=e.schema.knownTags[r];if((u==null?void 0:u.collection)===p)e.schema.tags.push(Object.assign({},u,{default:!1})),o=u;else return u?d(i,"BAD_COLLECTION_TYPE",`${u.tag} used for ${p} collection, but expects ${u.collection??"scalar"}`,!0):d(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,!0),Ss(m,e,t,d,r)}const l=Ss(m,e,t,d,r,o),s=((c=o.resolve)==null?void 0:c.call(o,l,u=>d(i,"TAG_RESOLVE_FAILED",u),e.options))??l,a=Le(s)?s:new ae(s);return a.range=l.range,a.tag=r,o!=null&&o.format&&(a.format=o.format),a}function Yp(m,e,t){const n=e.offset,d=Qp(e,m.options.strict,t);if(!d)return{value:"",type:null,comment:"",range:[n,n,n]};const i=d.mode===">"?ae.BLOCK_FOLDED:ae.BLOCK_LITERAL,r=e.source?Xp(e.source):[];let p=r.length;for(let f=r.length-1;f>=0;--f){const g=r[f][1];if(g===""||g==="\r")p=f;else break}if(p===0){const f=d.chomp==="+"&&r.length>0?`
1462
+ `.repeat(Math.max(1,r.length-1)):"";let g=n+d.length;return e.source&&(g+=e.source.length),{value:f,type:i,comment:d.comment,range:[n,g,g]}}let o=e.indent+d.indent,l=e.offset+d.length,s=0;for(let f=0;f<p;++f){const[g,v]=r[f];if(v===""||v==="\r")d.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"),d.indent===0&&(o=g.length),s=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=r.length-1;f>=p;--f)r[f][0].length>o&&(p=f+1);let a="",c="",u=!1;for(let f=0;f<s;++f)a+=r[f][0].slice(o)+`
1463
+ `;for(let f=s;f<p;++f){let[g,v]=r[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 S=`Block scalar lines must not be less indented than their ${d.indent?"explicit indentation indicator":"first line"}`;t(l-v.length-(b?2:1),"BAD_INDENT",S),g=""}i===ae.BLOCK_LITERAL?(a+=c+g.slice(o)+v,c=`
1464
+ `):g.length>o||v[0]===" "?(c===" "?c=`
1465
+ `:!u&&c===`
1466
+ `&&(c=`
1467
+
1468
+ `),a+=c+g.slice(o)+v,c=`
1469
+ `,u=!0):v===""?c===`
1470
+ `?a+=`
1471
+ `:c=`
1472
+ `:(a+=c+v,c=" ",u=!1)}switch(d.chomp){case"-":break;case"+":for(let f=p;f<r.length;++f)a+=`
1473
+ `+r[f][0].slice(o);a[a.length-1]!==`
1474
+ `&&(a+=`
1475
+ `);break;default:a+=`
1476
+ `}const h=n+d.length+e.source.length;return{value:a,type:i,comment:d.comment,range:[n,h,h]}}function Qp({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:d}=e[0],i=d[0];let r=0,p="",o=-1;for(let c=1;c<d.length;++c){const u=d[c];if(!p&&(u==="-"||u==="+"))p=u;else{const h=Number(u);!r&&h?r=h:o===-1&&(o=m+c)}}o!==-1&&n(o,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${d}`);let l=!1,s="",a=d.length;for(let c=1;c<e.length;++c){const u=e[c];switch(u.type){case"space":l=!0;case"newline":a+=u.source.length;break;case"comment":t&&!l&&n(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),a+=u.source.length,s=u.source.substring(1);break;case"error":n(u,"UNEXPECTED_TOKEN",u.message),a+=u.source.length;break;default:{const h=`Unexpected token in block scalar header: ${u.type}`;n(u,"UNEXPECTED_TOKEN",h);const f=u.source;f&&typeof f=="string"&&(a+=f.length)}}}return{mode:i,indent:r,chomp:p,comment:s,length:a}}function Xp(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 r=1;r<e.length;r+=2)i.push([e[r],e[r+1]]);return i}function Zp(m,e,t){const{offset:n,type:d,source:i,end:r}=m;let p,o;const l=(c,u,h)=>t(n+c,u,h);switch(d){case"scalar":p=ae.PLAIN,o=qp(i,l);break;case"single-quoted-scalar":p=ae.QUOTE_SINGLE,o=ef(i,l);break;case"double-quoted-scalar":p=ae.QUOTE_DOUBLE,o=tf(i,l);break;default:return t(m,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${d}`),{value:"",type:null,comment:"",range:[n,n+i.length,n+i.length]}}const s=n+i.length,a=ei(r,s,e,t);return{value:o,type:p,comment:a.comment,range:[n,s,a.offset]}}function qp(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}`),Ma(m)}function ef(m,e){return(m[m.length-1]!=="'"||m.length===1)&&e(m.length,"MISSING_CHAR","Missing closing 'quote"),Ma(m.slice(1,-1)).replace(/''/g,"'")}function Ma(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 d=n[1],i=" ",r=e.lastIndex;for(t.lastIndex=r;n=t.exec(m);)n[1]===""?i===`
1479
+ `?d+=i:i=`
1480
+ `:(d+=i+n[1],i=" "),r=t.lastIndex;const p=/[ \t]*(.*)/sy;return p.lastIndex=r,n=p.exec(m),d+i+((n==null?void 0:n[1])??"")}function tf(m,e){let t="";for(let n=1;n<m.length-1;++n){const d=m[n];if(!(d==="\r"&&m[n+1]===`
1481
+ `))if(d===`
1482
+ `){const{fold:i,offset:r}=nf(m,n);t+=i,n=r}else if(d==="\\"){let i=m[++n];const r=sf[i];if(r)t+=r;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 p={x:2,u:4,U:8}[i];t+=rf(m,n+1,p,e),n+=p}else{const p=m.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${p}`),t+=p}}else if(d===" "||d===" "){const i=n;let r=m[n+1];for(;r===" "||r===" ";)r=m[++n+1];r!==`
1485
+ `&&!(r==="\r"&&m[n+2]===`
1486
+ `)&&(t+=n>i?m.slice(i,n+1):d)}else t+=d}return(m[m.length-1]!=='"'||m.length===1)&&e(m.length,"MISSING_CHAR",'Missing closing "quote'),t}function nf(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 sf={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
1491
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function rf(m,e,t,n){const d=m.substr(e,t),r=d.length===t&&/^[0-9a-fA-F]+$/.test(d)?parseInt(d,16):NaN;if(isNaN(r)){const p=m.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${p}`),p}return String.fromCodePoint(r)}function Ia(m,e,t,n){const{value:d,type:i,comment:r,range:p}=e.type==="block-scalar"?Yp(m,e,n):Zp(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[ht]:o?l=of(m.schema,d,o,t,n):e.type==="scalar"?l=af(m,d,e,n):l=m.schema[ht];let s;try{const a=l.resolve(d,c=>n(t??e,"TAG_RESOLVE_FAILED",c),m.options);s=me(a)?a:new ae(a)}catch(a){const c=a instanceof Error?a.message:String(a);n(t??e,"TAG_RESOLVE_FAILED",c),s=new ae(d)}return s.range=p,s.source=d,i&&(s.type=i),o&&(s.tag=o),l.format&&(s.format=l.format),r&&(s.comment=r),s}function of(m,e,t,n,d){var p;if(t==="!")return m[ht];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((p=o.test)!=null&&p.test(e))return o;const r=m.knownTags[t];return r&&!r.collection?(m.tags.push(Object.assign({},r,{default:!1,test:void 0})),r):(d(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),m[ht])}function af({atKey:m,directives:e,schema:t},n,d,i){const r=t.tags.find(p=>{var o;return(p.default===!0||m&&p.default==="key")&&((o=p.test)==null?void 0:o.test(n))})||t[ht];if(t.compat){const p=t.compat.find(o=>{var l;return o.default&&((l=o.test)==null?void 0:l.test(n))})??t[ht];if(r.tag!==p.tag){const o=e.tagString(r.tag),l=e.tagString(p.tag),s=`Value may be parsed as either ${o} or ${l}`;i(d,"TAG_RESOLVE_FAILED",s,!0)}}return r}function lf(m,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let d=e[n];switch(d.type){case"space":case"comment":case"newline":m-=d.source.length;continue}for(d=e[++n];(d==null?void 0:d.type)==="space";)m+=d.source.length,d=e[++n];break}}return m}const cf={composeNode:Oa,composeEmptyNode:mr};function Oa(m,e,t,n){const d=m.atKey,{spaceBefore:i,comment:r,anchor:p,tag:o}=t;let l,s=!0;switch(e.type){case"alias":l=hf(m,e,n),(p||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=Ia(m,e,o,n),p&&(l.anchor=p.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=Jp(cf,m,e,t,n),p&&(l.anchor=p.source.substring(1));break;default:{const a=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",a),l=mr(m,e.offset,void 0,null,t,n),s=!1}}return p&&l.anchor===""&&n(p,"BAD_ALIAS","Anchor cannot be an empty string"),d&&m.options.stringKeys&&(!me(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),r&&(e.type==="scalar"&&e.source===""?l.comment=r:l.commentBefore=r),m.options.keepSourceTokens&&s&&(l.srcToken=e),l}function mr(m,e,t,n,{spaceBefore:d,comment:i,anchor:r,tag:p,end:o},l){const s={type:"scalar",offset:lf(e,t,n),indent:-1,source:""},a=Ia(m,s,p,l);return r&&(a.anchor=r.source.substring(1),a.anchor===""&&l(r,"BAD_ALIAS","Anchor cannot be an empty string")),d&&(a.spaceBefore=!0),i&&(a.comment=i,a.range[2]=o),a}function hf({options:m},{offset:e,source:t,end:n},d){const i=new sr(t.substring(1));i.source===""&&d(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&d(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const r=e+t.length,p=ei(n,r,m.strict,d);return i.range=[e,r,p.offset],p.comment&&(i.comment=p.comment),i}function uf(m,e,{offset:t,start:n,value:d,end:i},r){const p=Object.assign({_directives:e},m),o=new Zi(void 0,p),l={atKey:!1,atRoot:!0,directives:o.directives,options:o.options,schema:o.schema},s=wn(n,{indicator:"doc-start",next:d??(i==null?void 0:i[0]),offset:t,onError:r,parentIndent:0,startOnNewline:!0});s.found&&(o.directives.docStart=!0,d&&(d.type==="block-map"||d.type==="block-seq")&&!s.hasNewline&&r(s.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),o.contents=d?Oa(l,d,s,r):mr(l,s.end,n,null,s,r);const a=o.contents.range[2],c=ei(i,a,!1,r);return c.comment&&(o.comment=c.comment),o.range=[t,a,c.offset],o}function Ln(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 yo(m){var d;let e="",t=!1,n=!1;for(let i=0;i<m.length;++i){const r=m[i];switch(r[0]){case"#":e+=(e===""?"":n?`
1492
+
1493
+ `:`
1494
+ `)+(r.substring(1)||" "),t=!0,n=!1;break;case"%":((d=m[i+1])==null?void 0:d[0])!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}class df{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,d,i)=>{const r=Ln(t);i?this.warnings.push(new Vp(r,n,d)):this.errors.push(new Nn(r,n,d))},this.directives=new We({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:d}=yo(this.prelude);if(n){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}
1495
+ ${n}`:n;else if(d||e.directives.docStart||!i)e.commentBefore=n;else if(ke(i)&&!i.flow&&i.items.length>0){let r=i.items[0];Me(r)&&(r=r.key);const p=r.commentBefore;r.commentBefore=p?`${n}
1496
+ ${p}`:n}else{const r=i.commentBefore;i.commentBefore=r?`${n}
1497
+ ${r}`: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:yo(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const d of e)yield*this.next(d);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,d)=>{const i=Ln(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,d)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=uf(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 Nn(Ln(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 Nn(Ln(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const t=ei(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 Nn(Ln(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),d=new Zi(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),d.range=[0,t,t],this.decorate(d,!1),yield d}}}const Fa="\uFEFF",Ra="",Na="",Ns="";function pf(m){switch(m){case Fa:return"byte-order-mark";case Ra:return"doc-mode";case Na:return"flow-error-end";case Ns: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 bo=new Set("0123456789ABCDEFabcdef"),ff=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),bi=new Set(",[]{}"),gf=new Set(` ,[]{}
1502
+ \r `),Ds=m=>!m||gf.has(m);class mf{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 d=this.buffer[n+e+1];if(d===`
1505
+ `||!d&&!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]===Fa&&(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 d=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-d),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 Ra,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(Ds),"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 d=this.getLine();if(d===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&d[0]!=="#"||n===0&&(d.startsWith("---")||d.startsWith("..."))&&it(d[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(d[0]==="]"||d[0]==="}")))return this.flowLevel=0,yield Na,yield*this.parseLineStart();let i=0;for(;d[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),d[i]){case void 0:return"flow";case"#":return yield*this.pushCount(d.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(Ds),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const r=this.charAt(1);if(this.flowKey||it(r)||r===",")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 d=n.indexOf(`
1508
+ `,this.pos);if(d!==-1){for(;d!==-1;){const i=this.continueScalar(d+1);if(i===-1)break;d=n.indexOf(`
1509
+ `,i)}d!==-1&&(t=d-(n[d-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 r=this.buffer[i+1];if(!r&&!this.atEnd)return this.setNext("block-scalar");if(r===`
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 d=e+1;for(n=this.buffer[d];n===" ";)n=this.buffer[++d];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
1513
+ `;)n=this.buffer[++d];e=d-1}else if(!this.blockScalarKeep)do{let i=e-1,r=this.buffer[i];r==="\r"&&(r=this.buffer[--i]);const p=i;for(;r===" ";)r=this.buffer[--i];if(r===`
1514
+ `&&i>=this.pos&&i+1+t>p)e=i;else break}while(!0);return yield Ns,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,n=this.pos-1,d;for(;d=this.buffer[++n];)if(d===":"){const i=this.buffer[n+1];if(it(i)||e&&bi.has(i))break;t=n}else if(it(d)){let i=this.buffer[n+1];if(d==="\r"&&(i===`
1515
+ `?(n+=1,d=`
1516
+ `,i=this.buffer[n+1]):t=n),i==="#"||e&&bi.has(i))break;if(d===`
1517
+ `){const r=this.continueScalar(n+1);if(r===-1)break;n=Math.max(n,r-2)}}else{if(e&&bi.has(d))break;t=n}return!d&&!this.atEnd?this.setNext("plain-scalar"):(yield Ns,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(Ds))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(it(t)||e&&bi.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(ff.has(t))t=this.buffer[++e];else if(t==="%"&&bo.has(this.buffer[e+1])&&bo.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 d=t-this.pos;return d>0&&(yield this.buffer.substr(this.pos,d),this.pos=t),d}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class vf{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 d=this.lineStarts[t-1];return{line:t,col:e-d+1}}}}function $t(m,e){for(let t=0;t<m.length;++t)if(m[t].type===e)return!0;return!1}function wo(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 Ba(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 wi(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 on(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 Co(m){if(m.start.type==="flow-seq-start")for(const e of m.items)e.sep&&!e.value&&!$t(e.start,"explicit-key-ind")&&!$t(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Ba(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 yf{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 mf,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=pf(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"&&Co(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{const d=n.items[n.items.length-1];if(d.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(d.sep)d.value=t;else{Object.assign(d,{key:t,sep:[]}),this.onKeyLine=!d.explicitKey;return}break}case"block-seq":{const d=n.items[n.items.length-1];d.value?n.items.push({start:[],value:t}):d.value=t;break}case"flow-collection":{const d=n.items[n.items.length-1];!d||d.value?n.items.push({start:[],key:t,sep:[]}):d.sep?d.value=t:Object.assign(d,{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 d=t.items[t.items.length-1];d&&!d.sep&&!d.value&&d.start.length>0&&wo(d.start)===-1&&(t.indent===0||d.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(n.type==="document"?n.end=d.start:n.items.push({start:d.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":{wo(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=wi(this.peek(2)),n=on(t);let d;e.end?(d=e.end,d.push(this.sourceToken),delete e.end):d=[this.sourceToken];const i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:d}]};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 d="end"in t.value?t.value.end:void 0,i=Array.isArray(d)?d[d.length-1]:void 0;(i==null?void 0:i.type)==="comment"?d==null||d.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 d=e.items[e.items.length-2],i=(n=d==null?void 0:d.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 d=!this.onKeyLine&&this.indent===e.indent,i=d&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let r=[];if(i&&t.sep&&!t.value){const p=[];for(let o=0;o<t.sep.length;++o){const l=t.sep[o];switch(l.type){case"newline":p.push(o);break;case"space":break;case"comment":l.indent>e.indent&&(p.length=0);break;default:p.length=0}}p.length>=2&&(r=t.sep.splice(p[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),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?(r.push(this.sourceToken),e.items.push({start:r,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($t(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(Ba(t.key)&&!$t(t.sep,"newline")){const p=on(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:p,key:o,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if($t(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const p=on(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:p,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):$t(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 p=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:p,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(p):(Object.assign(t,{key:p,sep:[]}),this.onKeyLine=!0);return}default:{const p=this.startBlockValue(e);if(p){if(p.type==="block-seq"){if(!t.explicitKey&&t.sep&&!$t(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 d&&e.items.push({start:r});this.stack.push(p);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 d="end"in t.value?t.value.end:void 0,i=Array.isArray(d)?d[d.length-1]:void 0;(i==null?void 0:i.type)==="comment"?d==null||d.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 d=e.items[e.items.length-2],i=(n=d==null?void 0:d.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||$t(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const d=this.startBlockValue(e);if(d){this.stack.push(d);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 d=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:d,sep:[]}):t.sep?this.stack.push(d):Object.assign(t,{key:d,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 d=wi(n),i=on(d);Co(e);const r=e.end.splice(1,e.end.length);r.push(this.sourceToken);const p={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=p}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=wi(e),n=on(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=wi(e),n=on(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 bf(m){const e=m.prettyErrors!==!1;return{lineCounter:m.lineCounter||e&&new vf||null,prettyErrors:e}}function wf(m,e={}){const{lineCounter:t,prettyErrors:n}=bf(e),d=new yf(t==null?void 0:t.addNewLine),i=new df(e);let r=null;for(const p of i.compose(d.parse(m),!0,m.length))if(!r)r=p;else if(r.options.logLevel!=="silent"){r.errors.push(new Nn(p.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(r.errors.forEach(mo(m,t)),r.warnings.forEach(mo(m,t))),r}function Cf(m,e,t){let n;const d=wf(m,t);if(!d)return null;if(d.warnings.forEach(i=>ua(d.options.logLevel,i)),d.errors.length>0){if(d.options.logLevel!=="silent")throw d.errors[0];d.errors=[]}return d.toJS(Object.assign({reviver:n},t))}const As={flex:{display:"flex"},button:{height:48,minWidth:48},wrapper:{width:"calc(100vw - 40px)",height:"calc(100vh - 188px)"}};class Ef extends U{componentDidMount(){super.componentDidMount();const{data:e,attr:t}=this.props,n=U.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{Cf(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:d,attr:i}=this.props,{value:r,showSelectId:p}=this.state,o=n.readOnly===!0||t;return _.createElement(fe,{fullWidth:!0,variant:"standard"},_.createElement("div",{style:As.flex},_.createElement(Se,{color:"grey",style:As.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},W.I18n.t("ra_YAML editor"))),p?_.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:U.getValue(d,i)||""})},onApply:o?void 0:()=>this.setState({showSelectId:!1},()=>this.onChange(i,r))},_.createElement("div",{style:{...As.wrapper,border:this.state.yamlError?"2px solid red":"2px solid transparent"}},_.createElement(tr,{mode:"yaml",value:typeof r=="object"?JSON.stringify(r):r,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?W.I18n.t("ra_Invalid YAML"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Sf extends U{async componentDidMount(){super.componentDidMount();const e=await jo(()=>import("./index-iRHaQfi-.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 Df extends U{initialized=!1;localContext;async componentDidMount(){super.componentDidMount();const e=await jo(()=>import("./index-iRHaQfi-.js").then(t=>t.i),__vite__mapDeps([0,1,2,3]),import.meta.url);this.setState({QRCode:e.default}),this.props.schema.sendFirstByClick||this.askInstance()}askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const t=this.getPattern(this.props.schema.jsonData,null,!0);if(t)try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${JSON.stringify(e)}`)}}e===void 0&&(e=null),this.setState({loading:!0},()=>this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",e).then(t=>this.setState({qrData:t||"",loading:!1})))}}getContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=U.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 _.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"?W.I18n.t("ra_Click to show"):this.getText(this.props.schema.sendFirstByClick,this.props.schema.noTranslation));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 Af={accordion:yh,alive:bh,autocomplete:wh,autocompleteSendTo:Ch,certCollection:Ah,certificate:Sh,certificates:Dh,checkbox:xh,checkDocker:$h,checkLicense:At,chip:Wr,chips:Wr,color:Mh,coordinates:Ih,cron:Eh,custom:Un,datePicker:Oh,deviceManager:Fh,divider:Yd,file:Kh,fileSelector:Wi,func:Gh,header:Xd,iframe:Jh,iframeSendTo:Yh,image:Zh,imageSendTo:Xh,infoBox:qh,instance:eu,interface:tu,ip:Qh,jsonEditor:xd,language:kd,license:Td,number:Ld,oauth2:Md,objectId:Id,password:Od,pattern:Fd,port:Nd,qrCode:Sf,qrCodeSendTo:Df,room:Bd,select:Wd,selectSendTo:zd,sendto:to,sendTo:to,setState:Ud,slider:Kd,state:Jd,staticImage:Zd,staticInfo:qd,staticLink:ao,staticText:ao,table:Qe,text:ip,textSendTo:rp,timePicker:op,topic:lp,uuid:cp,user:hp,yamlEditor:Ef},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 qt extends U{componentDidMount(){var e;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 d=e[n].type||"panel";let i,r="Use this.props.oContext.socket!";return d==="custom"?(e[n].url?i=Un: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=U),r=this.props.oContext.socket):d==="panel"?i=qt:i=Af[d]||U,_.createElement(i,{socket:r,globalData:this.props.globalData,oContext:this.props.oContext,key:`${n}_${this.props.index===void 0?"":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})}):null}render(){const e=this.props.schema;if(!e)return null;const{disabled:t,hidden:n}=this.calculate(e),d=this.props.schema.items,i=this.props.schema.style||{};if(n){if(e.hideOnlyControl){const p=_.createElement(He,{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:W.Utils.getStyle(this.props.oContext.theme,{marginBottom:0,textAlign:"left"},i,this.props.oContext.themeType==="dark"&&e.darkStyle)});return e.newLine?_.createElement(_.Fragment,null,_.createElement("div",{style:{flexBasis:"100%",height:0}}),p):p}return null}if(this.props.table)return this.renderItems(d,t);if(this.props.custom)return _.createElement(He,{key:`${this.props.attr}_${this.props.index}`,container:!0,style:lt.fullWidth,columnSpacing:2,rowSpacing:1,sx:i},this.renderItems(d,t));let r;if(e.collapsable)r=_.createElement(Ps,{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(Ws,{expandIcon:_.createElement(Li,null),sx:W.Utils.getStyle(this.props.oContext.theme,i,this.props.oContext.themeType&&e.darkStyle,e.color==="primary"?lt.primary:e.color==="secondary"&&lt.secondary,{width:"100%"})},_.createElement(vt,{style:lt.heading},this.getText(e.label))),_.createElement(js,null,_.createElement(He,{container:!0,columnSpacing:2,rowSpacing:1,sx:{...i,width:"100%",padding:"10px"}},this.renderItems(d,t))));else{const p=W.Utils.getStyle(this.props.oContext.theme,this.props.style,i,{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));r=_.createElement(Ie,{component:"div",key:`${this.props.attr}_${this.props.index}`,className:this.props.className,sx:p},_.createElement(He,{container:!0,columnSpacing:2,rowSpacing:1,sx:W.Utils.getStyle(this.props.oContext.theme,{width:"100%"},this.props.isParentTab&&lt.padding,this.props.schema.innerStyle)},this.renderItems(d,t)))}if(!this.props.isParentTab){const p=_.createElement(He,{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",...i}},r);return e.newLine?_.createElement(_.Fragment,null,_.createElement("div",{style:{flexBasis:"100%",height:0}}),p):p}return r}}const Ci={tabs:{height:"100%",width:"100%"},panel:{width:"100%",display:"block"},panelWithIcons:{height:"calc(100% - 72px)"},panelWithoutIcons:{height:"calc(100% - 48px)"}};class $f extends U{resizeTimeout=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 d=n[3],i=parseInt(d,10);d&&i.toString()===d?i>=0&&i<Object.keys(this.props.schema.items).length&&(t=Object.keys(this.props.schema.items)[i]):d&&Object.keys(this.props.schema.items).includes(d)&&(t=d),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 d={...this.state.tabErrors};d[n]||(d[n]={}),t?d[n][e]=t:(delete d[n][e],Object.keys(d[n]).length===0&&delete d[n]),this.setState({tabErrors:d}),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),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 d;n.toString()===t?n>=0&&n<Object.keys(this.props.schema.items).length&&(d=Object.keys(this.props.schema.items)[n]):Object.keys(this.props.schema.items).includes(t)&&(d=t),d!==void 0&&d!==this.state.tab&&((window._localStorage||window.localStorage).setItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`,d),this.setState({tab:d}))}};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("/"))}})}render(){const e=this.props.schema.items;let t=!1;const n=[];Object.keys(e).map(r=>{let p;if(e[r].expertMode&&!this.props.expertMode)return;if(this.props.custom){if(this.executeCustom(e[r].hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData))return;p=this.executeCustom(e[r].disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData)}else{if(this.execute(e[r].hidden,!1,this.props.data,this.props.index,this.props.globalData))return;p=this.execute(e[r].disabled,!1,this.props.data,this.props.index,this.props.globalData)}const o=this.getIcon(e[r].icon);t=t||!!o,n.push({icon:o,disabled:p,label:this.getText(e[r].label),name:r})}),n.find(r=>r.name===this.state.tab)||setTimeout(()=>this.setState({tab:n[0].name}),50);const d=this.getCurrentBreakpoint();let i;return d==="xs"&&n.length>2?i=_.createElement(Bn,{style:{top:2,backgroundColor:this.props.oContext.themeType==="dark"?"#222":"#DDD"},variant:"dense"},_.createElement(re,{onClick:r=>this.setState({openMenu:r.currentTarget})},_.createElement(Vc,null)),this.state.openMenu?_.createElement(cc,{open:!0,anchorEl:this.state.openMenu,onClose:()=>this.setState({openMenu:null})},n.map(r=>{const p=this.hasTabErrors(r.name);return _.createElement(xe,{disabled:r.disabled,key:r.name,onClick:()=>{this.setState({openMenu:null},()=>this.onMenuChange(r.name))},selected:r.name===this.state.tab,sx:p?{color:"error.main"}:void 0},t?_.createElement($o,null,r.icon):null,_.createElement(Ie,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"}},r.label,p&&_.createElement(Kt,{sx:{fontSize:16,color:"error.main"}})))})):null):i=_.createElement(hc,{variant:"scrollable",scrollButtons:"auto",style:this.props.schema.tabsStyle,value:this.state.tab,onChange:(r,p)=>this.onMenuChange(p)},n.map(r=>{const p=this.hasTabErrors(r.name),o=p?_.createElement(Ie,{sx:{display:"flex",alignItems:"center",gap:.5}},r.label,_.createElement(Kt,{sx:{fontSize:16,color:"error.main"}})):r.label;return _.createElement(uc,{id:r.name,wrapped:!0,disabled:r.disabled,key:r.name,value:r.name,iconPosition:this.props.schema.iconPosition||"start",icon:r.icon,label:o,sx:p?{"& .MuiTab-wrapper":{color:"error.main"}}:void 0})})),_.createElement("div",{style:Ci.tabs,ref:this.refDiv},i,_.createElement(qt,{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:{...Ci.panel,...t?Ci.panelWithIcons:Ci.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}))}}const xf={root:{width:"100%",height:"100%"}};class _i extends So{forceUpdateHandlers;errorTimeout=null;errorCached=null;oContext;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()}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 d=W.I18n.getLanguage(),i=typeof t=="string"?t:"i18n";let r=await e.fileExists(`${n}.admin`,`${i}/${d}.json`),p;if(r?p=`${i}/${d}.json`:(r=await e.fileExists(`${n}.admin`,`${i}/${d}/translations.json`),r?p=`${i}/${d}/translations.json`:d!=="en"&&(r=await e.fileExists(`${n}.admin`,`${i}/en.json`),r?p=`${i}/en.json`:(r=await e.fileExists(`${n}.admin`,`${i}/en/translations.json`),r&&(p=`${i}/en/translations.json`)))),p){const o=await e.readFile(`${n}.admin`,p);let l;o.file!==void 0?l=o.file:l=o;try{const s=JSON.parse(l);W.I18n.extendTranslations(s,d)}catch(s){return console.error(`Cannot parse language file "${n}.admin/${p}: ${s}`),""}return p}return console.warn(`Cannot find i18n for ${n} / ${p}`),""}return t&&typeof t=="object"&&W.I18n.extendTranslations(t),""}onCommandRunning=e=>this.setState({commandRunning:e});readData(){this.props.socket.getCompactSystemConfig().then(e=>this.props.socket.getState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`).then(t=>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(e=>console.error(`Cannot read system config: ${e}`))}onAlive=(e,t)=>{!!(t!=null&&t.val)!==this.state.alive&&this.setState({alive:!!(t!=null&&t.val)})};onChange=(e,t,n,d)=>{if(this.props.onValueChange)this.props.onValueChange(e,t,d),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,d),n&&n()})}else d&&this.props.onChange(null,null,d)};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 d,i,r,p,o,l,s,a,c,u;(d=t[n].confirm)!=null&&d.alsoDependsOn&&((i=t[n].confirm)==null||i.alsoDependsOn.forEach(h=>{if(!t[h])console.error(`[JsonConfigComponent] Attribute ${h} does not exist!`),h.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${h.replace(/^data\./,"")}" instead of "${h}"`);else{t[h].confirmDependsOn=t[h].confirmDependsOn||[];const f={...t[n],attr:n};f.confirm&&(f.confirm.cancel="Undo"),t[h].confirmDependsOn.push(f)}})),(r=t[n].onChange)!=null&&r.alsoDependsOn&&((p=t[n].onChange)==null||p.alsoDependsOn.forEach(h=>{if(!t[h])console.error(`[JsonConfigComponent] Attribute ${h} does not exist!`),h.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${h.replace(/^data\./,"")}" instead of "${h}"`);else{t[h].onChangeDependsOn=t[h].onChangeDependsOn||[];const f={...t[n],attr:n};t[h].onChangeDependsOn.push(f)}})),(o=t[n].hidden)!=null&&o.alsoDependsOn&&((l=t[n].hidden)==null||l.alsoDependsOn.forEach(h=>{if(!t[h])console.error(`[JsonConfigComponent] Attribute ${h} does not exist!`),h.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${h.replace(/^data\./,"")}" instead of "${h}"`);else{t[h].hiddenDependsOn=t[h].hiddenDependsOn||[];const f={...t[n],attr:n};t[h].hiddenDependsOn.push(f)}})),(s=t[n].label)!=null&&s.alsoDependsOn&&((a=t[n].label)==null||a.alsoDependsOn.forEach(h=>{if(!t[h])console.error(`[JsonConfigComponent] Attribute ${h} does not exist!`),h.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${h.replace(/^data\./,"")}" instead of "${h}"`);else{t[h].labelDependsOn=t[h].labelDependsOn||[];const f={...t[n],attr:n};t[h].labelDependsOn.push(f)}})),(c=t[n].help)!=null&&c.alsoDependsOn&&((u=t[n].help)==null||u.alsoDependsOn.forEach(h=>{if(!t[h])console.error(`[JsonConfigComponent] Attribute ${h} does not exist!`),h.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${h.replace(/^data\./,"")}" instead of "${h}"`);else{t[h].helpDependsOn=t[h].helpDependsOn||[];const f={...t[n],attr:n};t[h].helpDependsOn.push(f)}}))})}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},e&&this.forceUpdate()}renderItem(e){return e.type==="tabs"?_.createElement($f,{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}):e.type==="panel"||!e.type?_.createElement(qt,{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}):(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(Pi,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?xf.root:void 0,...this.props.style,...this.state.schema.style}},this.renderItem(this.state.schema)))}}const Wt={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 _f(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 kf(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 Tf(m,e){if(typeof e!="string")return e;if(!e.startsWith("$/aes-192-cbc:")||!/^[0-9a-f]{48}$/.test(m))return _f(m,e);const t=e.split(":",3),n=window.CryptoJS.enc.Hex.parse(m),d=window.CryptoJS.enc.Hex.parse(t[1]),i=window.CryptoJS.lib.CipherParams.create({ciphertext:window.CryptoJS.enc.Hex.parse(t[2])}),r=window.CryptoJS.AES.decrypt(i,n,{iv:d});return window.CryptoJS.enc.Utf8.stringify(r)}function Lf(m,e,t){if(typeof e!="string")return e;if(!/^[0-9a-f]{48}$/.test(m))return kf(m,e);let n;n=window.CryptoJS.lib.WordArray.random(128/8);const d=window.CryptoJS.enc.Hex.parse(m),i=window.CryptoJS.AES.encrypt(e,d,{iv:n}).ciphertext;return`$/aes-192-cbc:${window.CryptoJS.enc.Hex.stringify(n)}:${i}`}function Eo(m,e){var t;return document.getElementById(e)?(t=document.getElementById(e))==null?void 0:t.onload:new Promise(n=>{const d=document.createElement("script");d.setAttribute("id",e),d.onload=n,d.src=m,document.getElementsByTagName("head")[0].appendChild(d)})}let Mf=class extends W.Router{fileSubscribed=[];fileLangSubscribed="";secret;constructor(e){super(e),this.state={updateData:0,changed:!1,confirmDialog:!1,theme:W.Theme(e.themeName),saveConfigDialog:!1,hash:"_"},this.secret=e.secret||"",this.getInstanceObject().then(t=>this.getConfigFile().then(n=>_i.loadI18n(this.props.socket,n==null?void 0:n.i18n,this.props.adapterName).then(d=>{d&&(this.fileLangSubscribed||(this.fileLangSubscribed=d,this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,this.fileLangSubscribed,this.onFileChange))),t?this.setState({schema:n,data:t.native,common:t.common,hash:Br(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=d=>{if(!d.target)return;const i=d.target.result;try{const r=JSON.parse(i);this.setState({data:r,changed:JSON.stringify(r)!==JSON.stringify(this.state.originalData)})}catch{window.alert(W.I18n.t("[JsonConfig] Failed to parse JSON file"))}},n.readAsText(t)}else window.alert(W.I18n.t("[JsonConfig] Failed to open JSON File"))};getExportImportButtons(){return _.createElement("div",{style:Wt.exportImportButtons},_.createElement(we,{title:this.props.t("Import settings from JSON file"),slotProps:{popper:{sx:Wt.tooltip}}},_.createElement(ki,{size:"small",sx:{"&.MuiFab-root":Wt.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(Fr,null))),_.createElement(we,{title:this.props.t("Export setting to JSON file"),slotProps:{popper:{sx:Wt.tooltip}}},_.createElement(ki,{size:"small",sx:{"&.MuiFab-root":Wt.button},onClick:()=>{this.state.data&&W.Utils.generateFile(`${this.props.adapterName}.${this.props.instance}.json`,this.state.data)}},_.createElement(Fr,{style:{transform:"rotate(180deg)"}}))))}onFileChange=async(e,t,n)=>{var d;if(e===`${this.props.adapterName}.admin`&&n){if(t===this.fileLangSubscribed)try{await _i.loadI18n(this.props.socket,(d=this.state.schema)==null?void 0:d.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:Br(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 Eo("../../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]=Tf(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(W.DialogConfirm,{title:W.I18n.t("ra_Please confirm"),text:W.I18n.t("ra_Some data are not stored. Discard?"),ok:W.I18n.t("ra_Discard"),cancel:W.I18n.t("ra_Cancel"),onClose:e=>this.setState({confirmDialog:!1},()=>e&&W.Router.doNavigate(null))}):null}async scanForInclude(e,t){if(typeof e["#include"]=="string"){const d=await this._getConfigFile(e["#include"],[...t]);return delete e["#include"],d&&(e={...e,...d}),e}const n=Object.keys(e);for(let d=0;d<n.length;d++)e[n[d]]&&typeof e[n[d]]=="object"&&(e[n[d]]=await this.scanForInclude(e[n[d]],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 d=await this.props.socket.readFile(`${this.props.adapterName}.admin`,e);let i="",r="";if(d.file!==void 0&&(r=d.file),typeof r=="string")i=r;else if(r.type==="Buffer"){let p="";const o=new Uint8Array(r.data),l=o.byteLength;for(let s=0;s<l;s++)p+=String.fromCharCode(o[s]);i=p}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(Vo.parse(i),t)}catch(p){window.alert("[JsonConfig] Cannot parse json5 config!"),console.log(p)}}catch(n){this.state.schema||window.alert(`[JsonConfig] Cannot read file "${e}: ${n}`)}return null}renderSaveConfigDialog(){return this.state.saveConfigDialog?_.createElement(W.DialogConfirm,{title:W.I18n.t("ra_Please confirm"),text:W.I18n.t("Save configuration?"),ok:W.I18n.t("ra_Save"),cancel:W.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 d=this.findAttr(e,n);if(d)return d}}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 d=e[t];if(n.items)if(n.type==="table"){const i=d;if(!Array.isArray(i))return;for(const r of i)for(const p of n.items)this.postProcessing(r,p.attr,p)}else for(const[i,r]of Object.entries(n.items)){if(r.type==="panel"||r.type==="tabs"||r.type==="accordion")return;this.postProcessing(e,i,r)}else if(t&&typeof d=="string")if(n.type==="text")n.trim!==!1&&(e[t]=d.trim());else if(n.type==="ip")e[t]=d.trim();else if(n.type==="number"){const i=parseFloat(d.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(d.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 d={};for(const r of Object.keys(this.state.data)){const p=this.findAttr(r);(!p||!p.doNotSave||p.type==="state")&&!r.startsWith("_")?U.setValue(n.native,r,this.state.data[r]):(U.setValue(n.native,r,null),d[r]=this.state.data[r])}try{const r=JSON.parse(JSON.stringify(n));if(Array.isArray(r.encryptedNative)){await Eo("../../lib/js/crypto-js/crypto-js.js","crypto-js");for(const p of r.encryptedNative)r.native[p]&&(r.native[p]=Lf(this.secret,r.native[p]))}await this.props.socket.setObject(r._id,r)}catch(r){window.alert(`[JsonConfig] Cannot set object: ${r}`)}const i={...n.native,...d};console.log(i),this.setState({changed:!1,data:i,updateData:this.state.updateData+1,originalData:i},()=>t&&W.Router.doNavigate(null))}else this.state.changed?this.setState({confirmDialog:!0}):W.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(Pi,null):_.createElement("div",{style:Wt.root},this.renderDialogConfirm(),this.getExportImportButtons(),this.renderSaveConfigDialog(),_.createElement(_i,{key:this.state.hash,style:Wt.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(W.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}),_.createElement(W.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{U as ConfigGeneric,qt as ConfigPanel,Mf as JsonConfig,_i as JsonConfigComponent};