iobroker.javascript 8.9.2 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/README.md +7 -3
  2. package/admin/assets/{createSvgIcon-BdRvDw53.js → createSvgIcon-BQT-7-GS.js} +1 -1
  3. package/admin/assets/{docs-6na4NFtj.js → docs-BrInh2Pn.js} +2 -2
  4. package/admin/assets/index-B0RKH_iG.js +1329 -0
  5. package/admin/assets/index-CfuHVX2B.js +193 -0
  6. package/admin/assets/index-CuCs5aLs.js +5 -0
  7. package/admin/assets/index-tExaxF69.js +930 -0
  8. package/admin/assets/inheritsLoose--KnFDOw1.js +36 -0
  9. package/admin/assets/{useTheme-Cl1QmYFL.js → useTheme-DF6qfrtI.js} +1 -1
  10. package/admin/custom/assets/{Components-ChpTW7sE.js → Components-D9kRsHNY.js} +1 -1
  11. package/admin/custom/assets/{DefaultPropsProvider-CHpMCMgA.js → DefaultPropsProvider-9qubdy-V.js} +2 -2
  12. package/admin/custom/assets/{FilledInput-CtcQVKyj.js → FilledInput-BpuM_GyB.js} +1 -1
  13. package/admin/custom/assets/Tabs-CvEv0KOT.js +138 -0
  14. package/admin/custom/assets/ThemeProvider-DZTpMR8n.js +29 -0
  15. package/admin/custom/assets/{createSvgIcon-C_vAELFU.js → createSvgIcon-BQThUM-f.js} +1 -1
  16. package/admin/custom/assets/hostInit-CrAs5YZS.js +1 -1
  17. package/admin/custom/assets/{index-DwsbskQy.js → index-DIWNdd4a.js} +1 -1
  18. package/admin/custom/assets/index-DZqbj5K4.js +55 -0
  19. package/admin/custom/assets/{index-D5apCzjJ.js → index-Dbe-II7_.js} +6 -6
  20. package/admin/custom/assets/index-az76fZMP.js +904 -0
  21. package/admin/custom/assets/index-sawv1cUe.js +1399 -0
  22. package/admin/custom/assets/{virtualExposes-BPncCdUy.js → virtualExposes-BMKIjWrE.js} +2 -2
  23. package/admin/custom/customComponents.js +2 -2
  24. package/admin/custom/i18n/de.json +29 -29
  25. package/admin/custom/i18n/es.json +29 -29
  26. package/admin/custom/i18n/fr.json +29 -29
  27. package/admin/custom/i18n/it.json +29 -29
  28. package/admin/custom/i18n/nl.json +29 -29
  29. package/admin/custom/i18n/pl.json +29 -29
  30. package/admin/custom/i18n/pt.json +29 -29
  31. package/admin/custom/i18n/ru.json +29 -29
  32. package/admin/custom/i18n/uk.json +29 -29
  33. package/admin/custom/i18n/zh-cn.json +29 -29
  34. package/admin/google-blockly/blockly_compressed.js +875 -887
  35. package/admin/google-blockly/blocks_compressed.js +38 -41
  36. package/admin/google-blockly/javascript_compressed.js +19 -54
  37. package/admin/google-blockly/media/delete-icon.svg +1 -0
  38. package/admin/google-blockly/media/foldout-icon.svg +1 -0
  39. package/admin/google-blockly/media/resize-handle.svg +3 -0
  40. package/admin/jsonConfig.json +2 -0
  41. package/admin/mf-manifest.json +1 -1
  42. package/admin/remoteEntry.js +2 -2
  43. package/admin/tab.html +4 -4
  44. package/admin/vsFont/README.md +1 -1
  45. package/admin/vsFont/createJson.js +1 -1
  46. package/build-backend/lib/consts.js +346 -0
  47. package/build-backend/lib/consts.js.map +1 -0
  48. package/build-backend/lib/convert.js +120 -0
  49. package/build-backend/lib/convert.js.map +1 -0
  50. package/build-backend/lib/debug.js +163 -0
  51. package/build-backend/lib/debug.js.map +1 -0
  52. package/{lib → build-backend/lib}/debugger.js +261 -232
  53. package/build-backend/lib/debugger.js.map +1 -0
  54. package/build-backend/lib/eventObj.js +177 -0
  55. package/build-backend/lib/eventObj.js.map +1 -0
  56. package/build-backend/lib/inspect.js +728 -0
  57. package/build-backend/lib/inspect.js.map +1 -0
  58. package/build-backend/lib/javascript.d.ts +1972 -0
  59. package/{lib → build-backend/lib}/mirror.js +185 -182
  60. package/build-backend/lib/mirror.js.map +1 -0
  61. package/build-backend/lib/nodeModulesManagement.js +25 -0
  62. package/build-backend/lib/nodeModulesManagement.js.map +1 -0
  63. package/build-backend/lib/patternCompareFunctions.js +321 -0
  64. package/build-backend/lib/patternCompareFunctions.js.map +1 -0
  65. package/build-backend/lib/protectFs.js +477 -0
  66. package/build-backend/lib/protectFs.js.map +1 -0
  67. package/build-backend/lib/request.js +89 -0
  68. package/build-backend/lib/request.js.map +1 -0
  69. package/{lib → build-backend/lib}/sandbox.js +2046 -1852
  70. package/build-backend/lib/sandbox.js.map +1 -0
  71. package/build-backend/lib/scheduler.js +553 -0
  72. package/build-backend/lib/scheduler.js.map +1 -0
  73. package/build-backend/lib/tools.js +183 -0
  74. package/build-backend/lib/tools.js.map +1 -0
  75. package/build-backend/lib/typescriptSettings.js +39 -0
  76. package/build-backend/lib/typescriptSettings.js.map +1 -0
  77. package/build-backend/lib/typescriptTools.js +435 -0
  78. package/build-backend/lib/typescriptTools.js.map +1 -0
  79. package/build-backend/lib/utils.js +66 -0
  80. package/build-backend/lib/utils.js.map +1 -0
  81. package/{lib → build-backend/lib}/words.js +23 -30
  82. package/build-backend/lib/words.js.map +1 -0
  83. package/build-backend/main.js +2671 -0
  84. package/build-backend/main.js.map +1 -0
  85. package/build-backend/types.d.ts +742 -0
  86. package/docs/de/README.md +1 -1
  87. package/docs/en/README.md +1 -1
  88. package/docs/en/javascript.md +10 -6
  89. package/docs/ru/README.md +1 -1
  90. package/install/installTypings.js +34 -47
  91. package/io-package.json +14 -14
  92. package/package.json +14 -14
  93. package/admin/assets/index-DCkkMRRa.js +0 -1335
  94. package/admin/assets/index-DJfSBoBB.js +0 -192
  95. package/admin/assets/index-DTiA4WdK.js +0 -930
  96. package/admin/assets/index-qABB1JVe.js +0 -5
  97. package/admin/assets/inheritsLoose-BW-3V39H.js +0 -36
  98. package/admin/custom/assets/Tabs-C1KOyWRi.js +0 -137
  99. package/admin/custom/assets/ThemeProvider-Buvx5nSd.js +0 -29
  100. package/admin/custom/assets/index-BGCRznKh.js +0 -904
  101. package/admin/custom/assets/index-DfBPYXqA.js +0 -55
  102. package/admin/custom/assets/index-jIr6kOLK.js +0 -1398
  103. package/lib/adapter-config.d.ts +0 -16
  104. package/lib/consts.js +0 -83
  105. package/lib/convert.js +0 -106
  106. package/lib/debug.js +0 -154
  107. package/lib/eventObj.js +0 -201
  108. package/lib/inspect.js +0 -688
  109. package/lib/javascript.d.ts +0 -1858
  110. package/lib/nodeModulesManagement.js +0 -26
  111. package/lib/patternCompareFunctions.js +0 -391
  112. package/lib/protectFs.js +0 -401
  113. package/lib/request.js +0 -72
  114. package/lib/scheduler.js +0 -447
  115. package/lib/tools.js +0 -192
  116. package/lib/typescriptSettings.js +0 -44
  117. package/lib/typescriptTools.js +0 -529
  118. package/lib/utils.js +0 -87
  119. package/main.js +0 -2653
@@ -1,1398 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CttBOMyq.js","./useTheme-MELayQMj.js","./_commonjsHelpers-D6-XlEtG.js","./createTheme-BwMO3rTt.js","./ConfigCustomJavascriptSet__loadShare__react__loadShare__-CzzIM-HW.js","./ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-BaLGCXMi.js","./useThemeWithoutDefault-C-hl_s0Z.js"])))=>i.map(i=>d[i]);
2
- import{C as pt,R as M}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__-CzzIM-HW.js";import{a as Zr,c as He,g as qr}from"./_commonjsHelpers-D6-XlEtG.js";import{C as N}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__-BlV79j8y.js";import{C as Z,a as es,I as ts,D as Wi}from"./index-B8sZ2j0S.js";import{C as j,A as ns,a as Hi}from"./ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-DAwHgdl6.js";import{R as is}from"./ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__-DibxNPKw.js";import{F as rs}from"./FilledInput-CtcQVKyj.js";import{p as ss}from"./createTheme-BwMO3rTt.js";import{i as Pn}from"./ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-BaLGCXMi.js";import{p as Un}from"./useTheme-MELayQMj.js";import{_ as os}from"./preload-helper-Dp1pzeXC.js";import"./DefaultPropsProvider-CHpMCMgA.js";import"./defaultTheme-avbtL0lf.js";import"./DefaultPropsProvider-DbEA5uR6.js";import"./jsx-runtime-o-xyxrOj.js";import"./useEnhancedEffect-CdLBzwyA.js";import"./useThemeWithoutDefault-C-hl_s0Z.js";const as=Object.freeze(Object.defineProperty({__proto__:null,get ConfigGeneric(){return K},get ConfigPanel(){return $t},get JsonConfig(){return Al},get JsonConfigComponent(){return cn}},Symbol.toStringTag,{value:"Module"}));var ls=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,us=/[\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]/,hs=/[\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]/,$n={Space_Separator:ls,ID_Start:us,ID_Continue:hs},Me={isSpaceSeparator(L){return typeof L=="string"&&$n.Space_Separator.test(L)},isIdStartChar(L){return typeof L=="string"&&(L>="a"&&L<="z"||L>="A"&&L<="Z"||L==="$"||L==="_"||$n.ID_Start.test(L))},isIdContinueChar(L){return typeof L=="string"&&(L>="a"&&L<="z"||L>="A"&&L<="Z"||L>="0"&&L<="9"||L==="$"||L==="_"||L==="‌"||L==="‍"||$n.ID_Continue.test(L))},isDigit(L){return typeof L=="string"&&/[0-9]/.test(L)},isHexDigit(L){return typeof L=="string"&&/[0-9A-Fa-f]/.test(L)}};let Wn,Be,it,pn,dt,Ye,Ie,Gn,Vt;var cs=function(i,n){Wn=String(i),Be="start",it=[],pn=0,dt=1,Ye=0,Ie=void 0,Gn=void 0,Vt=void 0;do Ie=ps(),gs[Be]();while(Ie.type!=="eof");return typeof n=="function"?Hn({"":Vt},"",n):Vt};function Hn(L,i,n){const u=L[i];if(u!=null&&typeof u=="object")if(Array.isArray(u))for(let v=0;v<u.length;v++){const a=String(v),h=Hn(u,a,n);h===void 0?delete u[a]:Object.defineProperty(u,a,{value:h,writable:!0,enumerable:!0,configurable:!0})}else for(const v in u){const a=Hn(u,v,n);a===void 0?delete u[v]:Object.defineProperty(u,v,{value:a,writable:!0,enumerable:!0,configurable:!0})}return n.call(L,i,u)}let pe,ue,jt,nt,me;function ps(){for(pe="default",ue="",jt=!1,nt=1;;){me=rt();const L=zi[pe]();if(L)return L}}function rt(){if(Wn[pn])return String.fromCodePoint(Wn.codePointAt(pn))}function q(){const L=rt();return L===`
3
- `?(dt++,Ye=0):L?Ye+=L.length:Ye++,L&&(pn+=L.length),L}const zi={default(){switch(me){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
4
- `:case"\r":case"\u2028":case"\u2029":q();return;case"/":q(),pe="comment";return;case void 0:return q(),De("eof")}if(Me.isSpaceSeparator(me)){q();return}return zi[Be]()},comment(){switch(me){case"*":q(),pe="multiLineComment";return;case"/":q(),pe="singleLineComment";return}throw Ae(q())},multiLineComment(){switch(me){case"*":q(),pe="multiLineCommentAsterisk";return;case void 0:throw Ae(q())}q()},multiLineCommentAsterisk(){switch(me){case"*":q();return;case"/":q(),pe="default";return;case void 0:throw Ae(q())}q(),pe="multiLineComment"},singleLineComment(){switch(me){case`
5
- `:case"\r":case"\u2028":case"\u2029":q(),pe="default";return;case void 0:return q(),De("eof")}q()},value(){switch(me){case"{":case"[":return De("punctuator",q());case"n":return q(),wt("ull"),De("null",null);case"t":return q(),wt("rue"),De("boolean",!0);case"f":return q(),wt("alse"),De("boolean",!1);case"-":case"+":q()==="-"&&(nt=-1),pe="sign";return;case".":ue=q(),pe="decimalPointLeading";return;case"0":ue=q(),pe="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":ue=q(),pe="decimalInteger";return;case"I":return q(),wt("nfinity"),De("numeric",1/0);case"N":return q(),wt("aN"),De("numeric",NaN);case'"':case"'":jt=q()==='"',ue="",pe="string";return}throw Ae(q())},identifierNameStartEscape(){if(me!=="u")throw Ae(q());q();const L=zn();switch(L){case"$":case"_":break;default:if(!Me.isIdStartChar(L))throw hi();break}ue+=L,pe="identifierName"},identifierName(){switch(me){case"$":case"_":case"‌":case"‍":ue+=q();return;case"\\":q(),pe="identifierNameEscape";return}if(Me.isIdContinueChar(me)){ue+=q();return}return De("identifier",ue)},identifierNameEscape(){if(me!=="u")throw Ae(q());q();const L=zn();switch(L){case"$":case"_":case"‌":case"‍":break;default:if(!Me.isIdContinueChar(L))throw hi();break}ue+=L,pe="identifierName"},sign(){switch(me){case".":ue=q(),pe="decimalPointLeading";return;case"0":ue=q(),pe="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":ue=q(),pe="decimalInteger";return;case"I":return q(),wt("nfinity"),De("numeric",nt*(1/0));case"N":return q(),wt("aN"),De("numeric",NaN)}throw Ae(q())},zero(){switch(me){case".":ue+=q(),pe="decimalPoint";return;case"e":case"E":ue+=q(),pe="decimalExponent";return;case"x":case"X":ue+=q(),pe="hexadecimal";return}return De("numeric",nt*0)},decimalInteger(){switch(me){case".":ue+=q(),pe="decimalPoint";return;case"e":case"E":ue+=q(),pe="decimalExponent";return}if(Me.isDigit(me)){ue+=q();return}return De("numeric",nt*Number(ue))},decimalPointLeading(){if(Me.isDigit(me)){ue+=q(),pe="decimalFraction";return}throw Ae(q())},decimalPoint(){switch(me){case"e":case"E":ue+=q(),pe="decimalExponent";return}if(Me.isDigit(me)){ue+=q(),pe="decimalFraction";return}return De("numeric",nt*Number(ue))},decimalFraction(){switch(me){case"e":case"E":ue+=q(),pe="decimalExponent";return}if(Me.isDigit(me)){ue+=q();return}return De("numeric",nt*Number(ue))},decimalExponent(){switch(me){case"+":case"-":ue+=q(),pe="decimalExponentSign";return}if(Me.isDigit(me)){ue+=q(),pe="decimalExponentInteger";return}throw Ae(q())},decimalExponentSign(){if(Me.isDigit(me)){ue+=q(),pe="decimalExponentInteger";return}throw Ae(q())},decimalExponentInteger(){if(Me.isDigit(me)){ue+=q();return}return De("numeric",nt*Number(ue))},hexadecimal(){if(Me.isHexDigit(me)){ue+=q(),pe="hexadecimalInteger";return}throw Ae(q())},hexadecimalInteger(){if(Me.isHexDigit(me)){ue+=q();return}return De("numeric",nt*Number(ue))},string(){switch(me){case"\\":q(),ue+=ds();return;case'"':if(jt)return q(),De("string",ue);ue+=q();return;case"'":if(!jt)return q(),De("string",ue);ue+=q();return;case`
6
- `:case"\r":throw Ae(q());case"\u2028":case"\u2029":ms(me);break;case void 0:throw Ae(q())}ue+=q()},start(){switch(me){case"{":case"[":return De("punctuator",q())}pe="value"},beforePropertyName(){switch(me){case"$":case"_":ue=q(),pe="identifierName";return;case"\\":q(),pe="identifierNameStartEscape";return;case"}":return De("punctuator",q());case'"':case"'":jt=q()==='"',pe="string";return}if(Me.isIdStartChar(me)){ue+=q(),pe="identifierName";return}throw Ae(q())},afterPropertyName(){if(me===":")return De("punctuator",q());throw Ae(q())},beforePropertyValue(){pe="value"},afterPropertyValue(){switch(me){case",":case"}":return De("punctuator",q())}throw Ae(q())},beforeArrayValue(){if(me==="]")return De("punctuator",q());pe="value"},afterArrayValue(){switch(me){case",":case"]":return De("punctuator",q())}throw Ae(q())},end(){throw Ae(q())}};function De(L,i){return{type:L,value:i,line:dt,column:Ye}}function wt(L){for(const i of L){if(rt()!==i)throw Ae(q());q()}}function ds(){switch(rt()){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(),Me.isDigit(rt()))throw Ae(q());return"\0";case"x":return q(),fs();case"u":return q(),zn();case`
8
- `:case"\u2028":case"\u2029":return q(),"";case"\r":return q(),rt()===`
9
- `&&q(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Ae(q());case void 0:throw Ae(q())}return q()}function fs(){let L="",i=rt();if(!Me.isHexDigit(i)||(L+=q(),i=rt(),!Me.isHexDigit(i)))throw Ae(q());return L+=q(),String.fromCodePoint(parseInt(L,16))}function zn(){let L="",i=4;for(;i-- >0;){const n=rt();if(!Me.isHexDigit(n))throw Ae(q());L+=q()}return String.fromCodePoint(parseInt(L,16))}const gs={start(){if(Ie.type==="eof")throw Ct();Tn()},beforePropertyName(){switch(Ie.type){case"identifier":case"string":Gn=Ie.value,Be="afterPropertyName";return;case"punctuator":nn();return;case"eof":throw Ct()}},afterPropertyName(){if(Ie.type==="eof")throw Ct();Be="beforePropertyValue"},beforePropertyValue(){if(Ie.type==="eof")throw Ct();Tn()},beforeArrayValue(){if(Ie.type==="eof")throw Ct();if(Ie.type==="punctuator"&&Ie.value==="]"){nn();return}Tn()},afterPropertyValue(){if(Ie.type==="eof")throw Ct();switch(Ie.value){case",":Be="beforePropertyName";return;case"}":nn()}},afterArrayValue(){if(Ie.type==="eof")throw Ct();switch(Ie.value){case",":Be="beforeArrayValue";return;case"]":nn()}},end(){}};function Tn(){let L;switch(Ie.type){case"punctuator":switch(Ie.value){case"{":L={};break;case"[":L=[];break}break;case"null":case"boolean":case"numeric":case"string":L=Ie.value;break}if(Vt===void 0)Vt=L;else{const i=it[it.length-1];Array.isArray(i)?i.push(L):Object.defineProperty(i,Gn,{value:L,writable:!0,enumerable:!0,configurable:!0})}if(L!==null&&typeof L=="object")it.push(L),Array.isArray(L)?Be="beforeArrayValue":Be="beforePropertyName";else{const i=it[it.length-1];i==null?Be="end":Array.isArray(i)?Be="afterArrayValue":Be="afterPropertyValue"}}function nn(){it.pop();const L=it[it.length-1];L==null?Be="end":Array.isArray(L)?Be="afterArrayValue":Be="afterPropertyValue"}function Ae(L){return dn(L===void 0?`JSON5: invalid end of input at ${dt}:${Ye}`:`JSON5: invalid character '${ji(L)}' at ${dt}:${Ye}`)}function Ct(){return dn(`JSON5: invalid end of input at ${dt}:${Ye}`)}function hi(){return Ye-=5,dn(`JSON5: invalid identifier character at ${dt}:${Ye}`)}function ms(L){console.warn(`JSON5: '${ji(L)}' in strings is not valid ECMAScript; consider escaping`)}function ji(L){const i={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(i[L])return i[L];if(L<" "){const n=L.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return L}function dn(L){const i=new SyntaxError(L);return i.lineNumber=dt,i.columnNumber=Ye,i}var vs=function(i,n,u){const v=[];let a="",h,d,o="",p;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(u=n.space,p=n.quote,n=n.replacer),typeof n=="function")d=n;else if(Array.isArray(n)){h=[];for(const c of n){let f;typeof c=="string"?f=c:(typeof c=="number"||c instanceof String||c instanceof Number)&&(f=String(c)),f!==void 0&&h.indexOf(f)<0&&h.push(f)}}return u instanceof Number?u=Number(u):u instanceof String&&(u=String(u)),typeof u=="number"?u>0&&(u=Math.min(10,Math.floor(u)),o=" ".substr(0,u)):typeof u=="string"&&(o=u.substr(0,10)),e("",{"":i});function e(c,f){let m=f[c];switch(m!=null&&(typeof m.toJSON5=="function"?m=m.toJSON5(c):typeof m.toJSON=="function"&&(m=m.toJSON(c))),d&&(m=d.call(f,c,m)),m instanceof Number?m=Number(m):m instanceof String?m=String(m):m instanceof Boolean&&(m=m.valueOf()),m){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof m=="string")return t(m);if(typeof m=="number")return String(m);if(typeof m=="object")return Array.isArray(m)?s(m):r(m)}function t(c){const f={"'":.1,'"':.2},m={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let y="";for(let E=0;E<c.length;E++){const b=c[E];switch(b){case"'":case'"':f[b]++,y+=b;continue;case"\0":if(Me.isDigit(c[E+1])){y+="\\x00";continue}}if(m[b]){y+=m[b];continue}if(b<" "){let g=b.charCodeAt(0).toString(16);y+="\\x"+("00"+g).substring(g.length);continue}y+=b}const D=p||Object.keys(f).reduce((E,b)=>f[E]<f[b]?E:b);return y=y.replace(new RegExp(D,"g"),m[D]),D+y+D}function r(c){if(v.indexOf(c)>=0)throw TypeError("Converting circular structure to JSON5");v.push(c);let f=a;a=a+o;let m=h||Object.keys(c),y=[];for(const E of m){const b=e(E,c);if(b!==void 0){let g=l(E)+":";o!==""&&(g+=" "),g+=b,y.push(g)}}let D;if(y.length===0)D="{}";else{let E;if(o==="")E=y.join(","),D="{"+E+"}";else{let b=`,
10
- `+a;E=y.join(b),D=`{
11
- `+a+E+`,
12
- `+f+"}"}}return v.pop(),a=f,D}function l(c){if(c.length===0)return t(c);const f=String.fromCodePoint(c.codePointAt(0));if(!Me.isIdStartChar(f))return t(c);for(let m=f.length;m<c.length;m++)if(!Me.isIdContinueChar(String.fromCodePoint(c.codePointAt(m))))return t(c);return c}function s(c){if(v.indexOf(c)>=0)throw TypeError("Converting circular structure to JSON5");v.push(c);let f=a;a=a+o;let m=[];for(let D=0;D<c.length;D++){const E=e(String(D),c);m.push(E!==void 0?E:"null")}let y;if(m.length===0)y="[]";else if(o==="")y="["+m.join(",")+"]";else{let D=`,
13
- `+a,E=m.join(D);y=`[
14
- `+a+E+`,
15
- `+f+"]"}return v.pop(),a=f,y}};const ys={parse:cs,stringify:vs};var Vi=ys,Kn={exports:{}};function bs(L){throw new Error('Could not dynamically require "'+L+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var hn={exports:{}};const ws={},Cs=Object.freeze(Object.defineProperty({__proto__:null,default:ws},Symbol.toStringTag,{value:"Module"})),Es=Zr(Cs);var Ss=hn.exports,ci;function Ds(){return ci||(ci=1,function(L,i){(function(n,u){L.exports=u()})(Ss,function(){var n=n||function(u,v){var a;if(typeof window<"u"&&window.crypto&&(a=window.crypto),typeof self<"u"&&self.crypto&&(a=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a=globalThis.crypto),!a&&typeof window<"u"&&window.msCrypto&&(a=window.msCrypto),!a&&typeof He<"u"&&He.crypto&&(a=He.crypto),!a&&typeof bs=="function")try{a=Es}catch{}var h=function(){if(a){if(typeof a.getRandomValues=="function")try{return a.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a.randomBytes=="function")try{return a.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},d=Object.create||function(){function y(){}return function(D){var E;return y.prototype=D,E=new y,y.prototype=null,E}}(),o={},p=o.lib={},e=p.Base=function(){return{extend:function(y){var D=d(this);return y&&D.mixIn(y),(!D.hasOwnProperty("init")||this.init===D.init)&&(D.init=function(){D.$super.init.apply(this,arguments)}),D.init.prototype=D,D.$super=this,D},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var D in y)y.hasOwnProperty(D)&&(this[D]=y[D]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),t=p.WordArray=e.extend({init:function(y,D){y=this.words=y||[],D!=v?this.sigBytes=D:this.sigBytes=y.length*4},toString:function(y){return(y||l).stringify(this)},concat:function(y){var D=this.words,E=y.words,b=this.sigBytes,g=y.sigBytes;if(this.clamp(),b%4)for(var S=0;S<g;S++){var T=E[S>>>2]>>>24-S%4*8&255;D[b+S>>>2]|=T<<24-(b+S)%4*8}else for(var k=0;k<g;k+=4)D[b+k>>>2]=E[k>>>2];return this.sigBytes+=g,this},clamp:function(){var y=this.words,D=this.sigBytes;y[D>>>2]&=4294967295<<32-D%4*8,y.length=u.ceil(D/4)},clone:function(){var y=e.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var D=[],E=0;E<y;E+=4)D.push(h());return new t.init(D,y)}}),r=o.enc={},l=r.Hex={stringify:function(y){for(var D=y.words,E=y.sigBytes,b=[],g=0;g<E;g++){var S=D[g>>>2]>>>24-g%4*8&255;b.push((S>>>4).toString(16)),b.push((S&15).toString(16))}return b.join("")},parse:function(y){for(var D=y.length,E=[],b=0;b<D;b+=2)E[b>>>3]|=parseInt(y.substr(b,2),16)<<24-b%8*4;return new t.init(E,D/2)}},s=r.Latin1={stringify:function(y){for(var D=y.words,E=y.sigBytes,b=[],g=0;g<E;g++){var S=D[g>>>2]>>>24-g%4*8&255;b.push(String.fromCharCode(S))}return b.join("")},parse:function(y){for(var D=y.length,E=[],b=0;b<D;b++)E[b>>>2]|=(y.charCodeAt(b)&255)<<24-b%4*8;return new t.init(E,D)}},c=r.Utf8={stringify:function(y){try{return decodeURIComponent(escape(s.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return s.parse(unescape(encodeURIComponent(y)))}},f=p.BufferedBlockAlgorithm=e.extend({reset:function(){this._data=new t.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=c.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var D,E=this._data,b=E.words,g=E.sigBytes,S=this.blockSize,T=S*4,k=g/T;y?k=u.ceil(k):k=u.max((k|0)-this._minBufferSize,0);var _=k*S,R=u.min(_*4,g);if(_){for(var x=0;x<_;x+=S)this._doProcessBlock(b,x);D=b.splice(0,_),E.sigBytes-=R}return new t.init(D,R)},clone:function(){var y=e.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});p.Hasher=f.extend({cfg:e.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var D=this._doFinalize();return D},blockSize:16,_createHelper:function(y){return function(D,E){return new y.init(E).finalize(D)}},_createHmacHelper:function(y){return function(D,E){return new m.HMAC.init(y,E).finalize(D)}}});var m=o.algo={};return o}(Math);return n})}(hn)),hn.exports}var As=Kn.exports;(function(L,i){(function(n,u){L.exports=u(Ds())})(As,function(n){return function(u){var v=n,a=v.lib,h=a.WordArray,d=a.Hasher,o=v.algo,p=[];(function(){for(var c=0;c<64;c++)p[c]=u.abs(u.sin(c+1))*4294967296|0})();var e=o.MD5=d.extend({_doReset:function(){this._hash=new h.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(c,f){for(var m=0;m<16;m++){var y=f+m,D=c[y];c[y]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}var E=this._hash.words,b=c[f+0],g=c[f+1],S=c[f+2],T=c[f+3],k=c[f+4],_=c[f+5],R=c[f+6],x=c[f+7],A=c[f+8],C=c[f+9],w=c[f+10],$=c[f+11],I=c[f+12],F=c[f+13],O=c[f+14],B=c[f+15],P=E[0],V=E[1],W=E[2],H=E[3];P=t(P,V,W,H,b,7,p[0]),H=t(H,P,V,W,g,12,p[1]),W=t(W,H,P,V,S,17,p[2]),V=t(V,W,H,P,T,22,p[3]),P=t(P,V,W,H,k,7,p[4]),H=t(H,P,V,W,_,12,p[5]),W=t(W,H,P,V,R,17,p[6]),V=t(V,W,H,P,x,22,p[7]),P=t(P,V,W,H,A,7,p[8]),H=t(H,P,V,W,C,12,p[9]),W=t(W,H,P,V,w,17,p[10]),V=t(V,W,H,P,$,22,p[11]),P=t(P,V,W,H,I,7,p[12]),H=t(H,P,V,W,F,12,p[13]),W=t(W,H,P,V,O,17,p[14]),V=t(V,W,H,P,B,22,p[15]),P=r(P,V,W,H,g,5,p[16]),H=r(H,P,V,W,R,9,p[17]),W=r(W,H,P,V,$,14,p[18]),V=r(V,W,H,P,b,20,p[19]),P=r(P,V,W,H,_,5,p[20]),H=r(H,P,V,W,w,9,p[21]),W=r(W,H,P,V,B,14,p[22]),V=r(V,W,H,P,k,20,p[23]),P=r(P,V,W,H,C,5,p[24]),H=r(H,P,V,W,O,9,p[25]),W=r(W,H,P,V,T,14,p[26]),V=r(V,W,H,P,A,20,p[27]),P=r(P,V,W,H,F,5,p[28]),H=r(H,P,V,W,S,9,p[29]),W=r(W,H,P,V,x,14,p[30]),V=r(V,W,H,P,I,20,p[31]),P=l(P,V,W,H,_,4,p[32]),H=l(H,P,V,W,A,11,p[33]),W=l(W,H,P,V,$,16,p[34]),V=l(V,W,H,P,O,23,p[35]),P=l(P,V,W,H,g,4,p[36]),H=l(H,P,V,W,k,11,p[37]),W=l(W,H,P,V,x,16,p[38]),V=l(V,W,H,P,w,23,p[39]),P=l(P,V,W,H,F,4,p[40]),H=l(H,P,V,W,b,11,p[41]),W=l(W,H,P,V,T,16,p[42]),V=l(V,W,H,P,R,23,p[43]),P=l(P,V,W,H,C,4,p[44]),H=l(H,P,V,W,I,11,p[45]),W=l(W,H,P,V,B,16,p[46]),V=l(V,W,H,P,S,23,p[47]),P=s(P,V,W,H,b,6,p[48]),H=s(H,P,V,W,x,10,p[49]),W=s(W,H,P,V,O,15,p[50]),V=s(V,W,H,P,_,21,p[51]),P=s(P,V,W,H,I,6,p[52]),H=s(H,P,V,W,T,10,p[53]),W=s(W,H,P,V,w,15,p[54]),V=s(V,W,H,P,g,21,p[55]),P=s(P,V,W,H,A,6,p[56]),H=s(H,P,V,W,B,10,p[57]),W=s(W,H,P,V,R,15,p[58]),V=s(V,W,H,P,F,21,p[59]),P=s(P,V,W,H,k,6,p[60]),H=s(H,P,V,W,$,10,p[61]),W=s(W,H,P,V,S,15,p[62]),V=s(V,W,H,P,C,21,p[63]),E[0]=E[0]+P|0,E[1]=E[1]+V|0,E[2]=E[2]+W|0,E[3]=E[3]+H|0},_doFinalize:function(){var c=this._data,f=c.words,m=this._nDataBytes*8,y=c.sigBytes*8;f[y>>>5]|=128<<24-y%32;var D=u.floor(m/4294967296),E=m;f[(y+64>>>9<<4)+15]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,f[(y+64>>>9<<4)+14]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,c.sigBytes=(f.length+1)*4,this._process();for(var b=this._hash,g=b.words,S=0;S<4;S++){var T=g[S];g[S]=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360}return b},clone:function(){var c=d.clone.call(this);return c._hash=this._hash.clone(),c}});function t(c,f,m,y,D,E,b){var g=c+(f&m|~f&y)+D+b;return(g<<E|g>>>32-E)+f}function r(c,f,m,y,D,E,b){var g=c+(f&y|m&~y)+D+b;return(g<<E|g>>>32-E)+f}function l(c,f,m,y,D,E,b){var g=c+(f^m^y)+D+b;return(g<<E|g>>>32-E)+f}function s(c,f,m,y,D,E,b){var g=c+(m^(f|~y))+D+b;return(g<<E|g>>>32-E)+f}v.MD5=d._createHelper(e),v.HmacMD5=d._createHmacHelper(e)}(Math),n.MD5})})(Kn);var xs=Kn.exports;const pi=qr(xs),$s=window.innerWidth<=600?12:void 0;function _n(L){return Object.prototype.toString.call(L)==="[object Object]"}class K extends pt.Component{static DIFFERENT_VALUE="__different__";static DIFFERENT_LABEL="ra___different__";static NONE_VALUE="";static NONE_LABEL="ra_none";defaultValue;isError;lang;defaultSendToDone;sendToTimeout;noPlaceRequired;constructor(i){super(i),this.state={confirmDialog:!1,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},this.isError={},i.schema&&(i.custom?this.defaultValue=i.schema.defaultFunc?this.executeCustom(i.schema.defaultFunc,i.data,i.customObj,i.oContext.instanceObj,i.arrayIndex,i.globalData):i.schema.default:i.schema.type!=="state"&&(this.defaultValue=i.schema.defaultFunc?this.execute(i.schema.defaultFunc,i.schema.default,i.data,i.arrayIndex,i.globalData):i.schema.default)),this.lang=j.I18n.getLanguage()}componentDidMount(){this.props.oContext.registerOnForceUpdate&&this.props.oContext.registerOnForceUpdate(this.props.attr,this.onUpdate);const i=["select","autocomplete","autocompleteSendTo"];if(this.defaultValue!==void 0){const n=K.getValue(this.props.data,this.props.attr);(n===void 0||i.includes(this.props.schema.type)&&(n===""||n===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)):(K.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 i=this.props.schema.data;if(i===void 0&&this.props.schema.jsonData){const n=this.getPattern(this.props.schema.jsonData,null,!0);try{i=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${n}`)}}else i={attr:this.props.attr,value:K.getValue(this.props.data,this.props.attr)};i===void 0&&(i=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.defaultSendTo,i).then(n=>{n!=null&&(this.props.custom?this.props.onChange(this.props.attr,n,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data)):(K.setValue(this.props.data,this.props.attr,n),this.props.onChange(this.props.data,void 0,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data))))})}else this.defaultSendToDone=!1,this.props.schema.allowSaveWithError||this.onError(this.props.attr,j.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=i=>{const n=K.getValue(i||this.props.data,this.props.attr)||"";this.state.value!==n?this.setState({value:n}):this.forceUpdate()};static getValue(i,n){if(typeof n=="string")return K.getValue(i,n.split("."));if(n.length===1)return i[n[0]];const u=n.shift();if(typeof u=="string"&&typeof i[u]=="object")return K.getValue(i[u],n)}static setValue(i,n,u){if(typeof n=="string"){K.setValue(i,n.split("."),u);return}if(n.length===1)u===null?delete i[n[0]]:i[n[0]]=u;else{const v=n.shift();if(typeof v!="string")return;(!i[v]||typeof i[v]=="object")&&(i[v]=i[v]||{}),K.setValue(i[v],n,u)}}getText(i,n){if(!i)return"";if(typeof i=="string"){const u=n?i:j.I18n.t(i);return u.includes("${")?this.getPattern(u,null,n):u}return _n(i)?i.func?typeof i.func=="object"?this.getPattern(i.func[this.lang]||i.func.en||"",null,!0):this.getPattern(i.func,null,n):i[this.lang]||i.en||"":i.toString()}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const i=this.state.confirmData||this.props.schema.confirm;let n=null;return i.type==="warning"?n=M.createElement(Z.Warning,null):i.type==="error"?n=M.createElement(Z.Error,null):i.type==="info"&&(n=M.createElement(Z.Info,null)),M.createElement(j.DialogConfirm,{title:this.getText(i.title)||j.I18n.t("ra_Please confirm"),text:this.getText(i.text),ok:this.getText(i.ok)||j.I18n.t("ra_Ok"),cancel:this.getText(i.cancel)||j.I18n.t("ra_Cancel"),icon:n||void 0,onClose:u=>this.setState({confirmDialog:!1},()=>{if(u){if(this.state.confirmCallback){const a=this.state.confirmCallback;this.setState({confirmCallback:null},()=>a(!0));return}const v=JSON.parse(JSON.stringify(this.props.data));this.state.confirmDepAttr&&K.setValue(v,this.state.confirmDepAttr,this.state.confirmDepNewValue),K.setValue(v,this.state.confirmAttr,this.state.confirmNewValue),this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null},()=>this.props.onChange(v))}else{const v=this.state.confirmCallback;this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},()=>{v&&v(!1)})}})})}getIcon(i){i=i||this.props.schema.icon;let n=null;return i==="auth"?n=M.createElement(Z.Key,null):i==="send"?n=M.createElement(Z.Send,null):i==="web"?n=M.createElement(Z.Public,null):i==="warning"?n=M.createElement(Z.Warning,null):i==="error"?n=M.createElement(Z.Error,null):i==="info"?n=M.createElement(Z.Info,null):i==="search"?n=M.createElement(Z.Search,null):i==="book"?n=M.createElement(Z.MenuBook,null):i==="help"?n=M.createElement(Z.Help,null):i==="upload"?n=M.createElement(Z.UploadFile,null):i==="edit"?n=M.createElement(Z.Edit,null):i==="user"?n=M.createElement(Z.Person,null):i==="group"?n=M.createElement(Z.Group,null):i==="delete"?n=M.createElement(Z.Delete,null):i==="refresh"?n=M.createElement(Z.Refresh,null):i==="add"?n=M.createElement(Z.Add,null):i==="unpair"?n=M.createElement(Z.LinkOff,null):i==="pair"?n=M.createElement(Z.Link,null):i==="save"?n=M.createElement(Z.Save,null):i==="open"?n=M.createElement(Z.OpenInNew,null):i&&((i.endsWith(".png")||i.endsWith(".svg")||i.endsWith(".jpg"))&&!i.startsWith("http://")&&!i.startsWith("https://")&&(i=`./adapter/${this.props.oContext.adapterName}/${i}`),n=M.createElement(j.Icon,{src:i,style:{width:22,height:22}})),n}onChangeAsync(i,n){return new Promise(u=>{const v=this.onChange(i,n,u);v instanceof Promise&&v.catch(a=>console.error(`Cannot set value: ${a}`))})}onChange(i,n,u){const v=JSON.parse(JSON.stringify(this.props.data));if(K.setValue(v,i,n),this.props.schema.confirm&&this.execute(this.props.schema.confirm.condition,!1,v,this.props.arrayIndex,this.props.globalData))return new Promise(h=>{this.setState({confirmDialog:!0,confirmNewValue:n,confirmAttr:i,confirmData:null},()=>{typeof u=="function"?u():h()})});if(this.props.schema.confirmDependsOn)for(let h=0;h<this.props.schema.confirmDependsOn.length;h++){const d=this.props.schema.confirmDependsOn[h];if(d.confirm){const o=K.getValue(v,d.attr);if(this.execute(d.confirm.condition,!1,v,this.props.arrayIndex,this.props.globalData))return new Promise(p=>{this.setState({confirmDialog:!0,confirmNewValue:n,confirmAttr:i,confirmDepNewValue:o,confirmDepAttr:d.attr,confirmData:d.confirm},()=>{typeof u=="function"?u():p()})})}}const a=[];if(this.props.schema.onChangeDependsOn)for(let h=0;h<this.props.schema.onChangeDependsOn.length;h++){const d=this.props.schema.onChangeDependsOn[h];if(d.onChange){const o=K.getValue(v,d.attr);let p;this.props.custom?p=this.executeCustom(d.onChange.calculateFunc,v,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):p=this.execute(d.onChange.calculateFunc,o,v,this.props.arrayIndex,this.props.globalData),p!==o&&(K.setValue(v,d.attr,p),a.push(d.attr))}}if(this.props.schema.hiddenDependsOn)for(let h=0;h<this.props.schema.hiddenDependsOn.length;h++){const d=this.props.schema.hiddenDependsOn[h];d.hidden&&a.push(d.attr)}if(this.props.schema.labelDependsOn)for(let h=0;h<this.props.schema.labelDependsOn.length;h++){const d=this.props.schema.labelDependsOn[h];d.hidden&&a.push(d.attr)}if(this.props.schema.helpDependsOn)for(let h=0;h<this.props.schema.helpDependsOn.length;h++){const d=this.props.schema.helpDependsOn[h];d.hidden&&a.push(d.attr)}if(this.props.schema.onChange&&!this.props.schema.onChange.ignoreOwnChanges){const h=K.getValue(v,this.props.attr),d=this.props.custom?this.executeCustom(this.props.schema.onChange.calculateFunc,v,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):this.execute(this.props.schema.onChange.calculateFunc,h,v,this.props.arrayIndex,this.props.globalData);d!==h&&K.setValue(v,this.props.attr,d)}return this.props.custom?(this.props.onChange(i,n,()=>u&&u()),a!=null&&a.length&&a.forEach((h,d)=>setTimeout(()=>this.props.onChange(h,K.getValue(v,h)),d*50))):this.props.onChange(v,void 0,()=>{a.length&&this.props.oContext.forceUpdate(a,v),u&&u()}),Promise.resolve()}execute(i,n,u,v,a){let h;if(_n(i))h=i.func;else if(typeof i=="string")h=i;else return i;if(!h)return n;try{return new Function("data","originalData","_system","_alive","_common","_socket","_instance","arrayIndex","globalData","_changed",h.includes("return")?h:`return ${h}`)(u||this.props.data,this.props.originalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.oContext.instance,v,a,this.props.changed)}catch(d){return console.error(`Cannot execute ${JSON.stringify(i)}: ${d}`),n}}executeCustom(i,n,u,v,a,h){let d;if(_n(i))d=i.func;else if(typeof i=="string")d=i;else return i;if(!d)return null;try{return new Function("data","originalData","_system","instanceObj","customObj","_socket","arrayIndex","globalData","_changed",d.includes("return")?d:`return ${d}`)(n||this.props.data,this.props.originalData,this.props.oContext.systemConfig,v,u,this.props.oContext.socket,a,h,this.props.changed)}catch(o){return console.error(`Cannot execute ${d}: ${o}`),null}}calculate(i){let n,u,v,a;return this.props.custom?(n=i.validator?!this.executeCustom(i.validator,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,i.disabled===!0?u=!0:u=i.disabled?this.executeCustom(i.disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,i.hidden===!0?v=!0:v=i.hidden?this.executeCustom(i.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,a=i.defaultFunc?this.executeCustom(i.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):i.default):(n=i.validator?!this.execute(i.validator,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,i.disabled===!0?u=!0:u=i.disabled?this.execute(i.disabled,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,i.hidden===!0?v=!0:v=i.hidden?this.execute(i.hidden,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,a=i.defaultFunc?this.execute(i.defaultFunc,i.default,this.props.data,this.props.arrayIndex,this.props.globalData):i.default),{error:n,disabled:u,hidden:v,defaultValue:a}}onError(i,n){n?this.isError[i]=n:delete this.isError[i],this.props.onError&&this.props.onError(i,n)}renderItem(i,n,u){return this.getText(this.props.schema.label)||this.getText(this.props.schema.text)}renderHelp(i,n,u){return n?M.createElement("a",{href:n,target:"_blank",rel:"noreferrer",style:{color:this.props.oContext.themeType==="dark"?"#a147ff":"#5b238f",textDecoration:"underline"}},this.getText(i,u)):(i=this.getText(i,u)||"",i&&(i.includes("<a ")||i.includes("<br")||i.includes("<b>")||i.includes("<i>"))?j.Utils.renderTextWithA(i):i)}static escapeString(i,n){return typeof i!="string"?"":(i=i.replace(/`/g,"\\`"),i=i.replace(/\${([^}]+)}/g,(u,v)=>{if(v&&typeof v=="string"&&v.startsWith("data.")){const a=K.getValue(n,v.replace(/^data\./,""));if(typeof a=="string"&&a.includes('"'))return`\${${v}.replace(/"/g, '\\\\"')}`}return u}),i)}getPattern(i,n,u){if(n=n||this.props.data,!i)return"";let v;typeof i=="object"?i.func?v=i.func:(console.log(`Object must be stringified: ${JSON.stringify(i)}`),v=JSON.stringify(i)):v=i;try{if(this.props.custom)return new Function("data","originalData","arrayIndex","globalData","_system","instanceObj","customObj","_socket","_changed",`return \`${K.escapeString(v,n)}\``)(n,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 h=new Function("data","originalData","arrayIndex","globalData","_system","_alive","_common","_socket","_changed",`return \`${K.escapeString(v,n)}\``)(n,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 u?h:j.I18n.t(h)}catch(a){return console.error(`Cannot execute ${v}: ${a}`),v}}render(){const i=this.props.schema;if(!i||this.props.expertMode===!1&&i.expertMode)return null;this.props.alive&&this.defaultSendToDone===!1&&(this.sendToTimeout=setTimeout(()=>{this.sendToTimeout=null,this.sendTo()},200));const{error:n,disabled:u,hidden:v,defaultValue:a}=this.calculate(i);if(v){if(Object.keys(this.isError).length&&(setTimeout(o=>Object.keys(o).forEach(p=>this.props.onError(p)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}),i.hideOnlyControl){const o=M.createElement(N.Grid2,{size:{xs:i.xs||$s,sm:i.sm||void 0,md:i.md||void 0,lg:i.lg||void 0,xl:i.xl||void 0},style:{marginBottom:0,textAlign:"left",...i.style,...this.props.oContext.themeType==="dark"?i.darkStyle:{}}});return i.newLine?M.createElement(M.Fragment,null,M.createElement("div",{style:{flexBasis:"100%",height:0}}),o):o}return null}i.validatorNoSaveOnError&&(n&&!Object.keys(this.isError).length?(this.isError={[this.props.attr]:i.validatorErrorText?j.I18n.t(i.validatorErrorText):!0},setTimeout(o=>Object.keys(o).forEach(p=>this.props.onError(p,o[p])),100,JSON.parse(JSON.stringify(this.isError)))):!n&&Object.keys(this.isError).length&&(setTimeout(o=>Object.keys(o).forEach(p=>this.props.onError(p)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}));const h=this.renderItem(n,u||this.props.commandRunning||this.props.disabled,a);if(this.noPlaceRequired)return h;const d=M.createElement(N.Grid2,{title:this.getText(i.tooltip),size:{xs:i.xs||12,sm:i.sm||void 0,md:i.md||void 0,lg:i.lg||void 0,xl:i.xl||void 0},style:{marginBottom:0,textAlign:"left",width:i.type==="divider"||i.type==="header"?i.width||"100%":void 0,...i.style,...this.props.oContext.themeType==="dark"?i.darkStyle:{}}},this.props.schema.defaultSendTo&&this.props.schema.button?M.createElement(N.Grid2,{container:!0,style:{width:"100%"}},M.createElement(N.Grid2,{flex:1},h),M.createElement(N.Grid2,null,M.createElement(N.Button,{disabled:u,variant:"outlined",onClick:()=>this.sendTo(),title:this.props.schema.buttonTooltip?this.getText(this.props.schema.buttonTooltip,this.props.schema.buttonTooltipNoTranslation):j.I18n.t("ra_Request data by instance")},this.getText(this.props.schema.button)))):h);return i.newLine?M.createElement(M.Fragment,null,M.createElement("div",{style:{flexBasis:"100%",height:0}}),this.renderDialogConfirm(),d):this.state.confirmDialog?M.createElement(M.Fragment,null,this.renderDialogConfirm(),d):d}}const Ge={fullWidth:{width:"100%"},accordionSummary:L=>({backgroundColor:L.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.08)"}),accordionTitle:{},toolbar:L=>({backgroundColor:L.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.08)",borderRadius:"3px"}),tooltip:{pointerEvents:"none"}};class Ts extends K{typingTimer=null;constructor(i){super(i),this.props.schema.items=this.props.schema.items||[]}componentDidMount(){super.componentDidMount();let i=K.getValue(this.props.data,this.props.attr)||[];Array.isArray(i)||(i=[]),this.setState({value:i,activeIndex:-1,iteration:0})}componentWillUnmount(){this.typingTimer&&(clearTimeout(this.typingTimer),this.typingTimer=null),super.componentWillUnmount()}itemAccordion(i,n){const{value:u}=this.state,{schema:v}=this.props,a={type:"panel",items:v.items.reduce((h,d)=>(h[d.attr]=d,h),{}),style:{marginLeft:"-8px",marginTop:"10px",marginBottom:"10px"}};return M.createElement($t,{oContext:this.props.oContext,index:n+this.state.iteration,arrayIndex:n,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:i,custom:!0,schema:a,originalData:this.props.originalData,onChange:(h,d)=>{const o=JSON.parse(JSON.stringify(u));o[n][h]=d,this.setState({value:o},()=>this.onChangeWrapper(o))},onError:(h,d)=>this.onError(h,d),table:this.props.table})}onDelete=i=>()=>{const n=JSON.parse(JSON.stringify(this.state.value));n.splice(i,1),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(n))};onClone=i=>()=>{const n=JSON.parse(JSON.stringify(this.state.value)),u=JSON.parse(JSON.stringify(n[i]));if(typeof this.props.schema.clone=="string"&&typeof u[this.props.schema.clone]=="string"){let v=1,a=u[this.props.schema.clone];const h=a.match(/(\d+)$/);for(h?(a=a.replace(h[0],""),v=parseInt(h[0],10)+1):a+="_";n.find(d=>d[this.props.schema.clone]===a+v.toString());)v++;u[this.props.schema.clone]=`${u[this.props.schema.clone]}_${v}`}n.splice(i,0,u),this.setState({value:n,activeIndex:-1,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(n))};onChangeWrapper=i=>{this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout(n=>{this.typingTimer=null;const u=this.onChange(this.props.attr,n);u instanceof Promise&&u.catch(v=>this.onError(v))},300,i)};onAdd=()=>{const{schema:i}=this.props,n=JSON.parse(JSON.stringify(this.state.value)),u=i.items&&i.items.reduce((v,a)=>{let h;return a.defaultFunc?this.props.custom?h=a.defaultFunc?this.executeCustom(a.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,n.length,this.props.data):this.props.schema.default:h=a.defaultFunc?this.execute(a.defaultFunc,this.props.schema.default,this.props.data,n.length,this.props.data):this.props.schema.default:h=a.default===void 0?null:a.default,v[a.attr]=h,v},{});n.push(u),this.setState({value:n,activeIndex:n.length-1},()=>this.onChangeWrapper(n))};onMoveUp(i){const n=JSON.parse(JSON.stringify(this.state.value)),u=n[i];n.splice(i,1),n.splice(i-1,0,u);const v=this.state.activeIndex-1;this.setState({value:n,activeIndex:v,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(n))}onMoveDown(i){const n=JSON.parse(JSON.stringify(this.state.value)),u=n[i];n.splice(i,1),n.splice(i+1,0,u);const v=this.state.activeIndex+1;this.setState({value:n,activeIndex:v,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(n))}renderItem(){const{schema:i}=this.props,{value:n}=this.state;return n?M.createElement(N.Paper,null,i.label||!i.noDelete?M.createElement(N.Toolbar,{variant:"dense"},i.label?M.createElement(N.Typography,{variant:"h6",id:"tableTitle",component:"div"},this.getText(i.label)):null,i.noDelete?null:M.createElement(N.IconButton,{size:"small",color:"primary",onClick:this.onAdd},M.createElement(Z.Add,null))):null,n.map((u,v)=>M.createElement(N.Accordion,{key:`${u}_${v}`,expanded:this.state.activeIndex===v,onChange:(a,h)=>this.setState({activeIndex:h?v:-1})},M.createElement(N.AccordionSummary,{expandIcon:M.createElement(Z.ExpandMore,null),sx:j.Utils.getStyle(this.props.oContext.theme,Ge.fullWidth,Ge.accordionSummary)},M.createElement(N.Typography,{style:Ge.accordionTitle},u[i.titleAttr])),M.createElement(N.AccordionDetails,{style:{...i.style,...this.props.oContext.themeType?i.darkStyle:void 0}},this.itemAccordion(n[v],v),M.createElement(N.Toolbar,{sx:Ge.toolbar},v?M.createElement(N.Tooltip,{title:j.I18n.t("ra_Move up"),slotProps:{popper:{sx:Ge.tooltip}}},M.createElement(N.IconButton,{size:"small",onClick:()=>this.onMoveUp(v)},M.createElement(Z.ArrowUpward,null))):M.createElement("div",{style:Ge.buttonEmpty}),v<n.length-1?M.createElement(N.Tooltip,{title:j.I18n.t("ra_Move down"),slotProps:{popper:{sx:Ge.tooltip}}},M.createElement(N.IconButton,{size:"small",onClick:()=>this.onMoveDown(v)},M.createElement(Z.ArrowDownward,null))):M.createElement("div",{style:Ge.buttonEmpty}),i.noDelete?null:M.createElement(N.Tooltip,{title:j.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:Ge.tooltip}}},M.createElement(N.IconButton,{size:"small",onClick:this.onDelete(v)},M.createElement(Z.Delete,null))),i.clone?M.createElement(N.Tooltip,{title:j.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:Ge.tooltip}}},M.createElement(N.IconButton,{size:"small",onClick:this.onClone(v)},M.createElement(Z.ContentCopy,null))):null)))),!i.noDelete&&n.length>0?M.createElement(N.Toolbar,{variant:"dense",sx:Ge.rootTool},M.createElement(N.IconButton,{size:"small",color:"primary",onClick:this.onAdd},M.createElement(Z.Add,null))):null,i.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null):null}}const di={root:{width:"100%"},notAlive:{color:"#a30000"}};class _s extends K{componentDidMount(){super.componentDidMount();const i=this.getInstance();this.props.oContext.socket.getState(`${i}.alive`).then(n=>this.setState({alive:!!(n&&n.val),instance:i}))}getInstance(){let i=this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`;return i.includes("${")&&(i=this.getPattern(i,null,!0)),i&&!i.startsWith("system.adapter.")&&(i=`system.adapter.${i}`),i}renderItem(){if(this.getInstance()!==this.state.instance&&setTimeout(()=>{const n=this.getInstance();n?this.props.oContext.socket.getState(`${n}.alive`).then(u=>this.setState({alive:!!(u&&u.val),instance:n})):this.setState({alive:null,instance:n})},200),this.state.alive!==!1&&this.state.alive!==!0)return null;const i=this.state.instance.replace(/^system.adapter./,"");return M.createElement("div",{style:{...di.root,...this.state.alive?void 0:di.notAlive}},this.state.alive?this.props.schema.textAlive!==void 0?this.props.schema.textAlive?j.I18n.t(this.props.schema.textAlive,i):"":j.I18n.t("ra_Instance %s is alive",i):this.props.schema.textNotAlive!==void 0?this.props.schema.textNotAlive?j.I18n.t(this.props.schema.textNotAlive,i):"":j.I18n.t("ra_Instance %s is not alive",i))}}class ks extends K{componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr),n=this.props.schema.options.map(u=>typeof u=="string"?{label:u,value:u}:JSON.parse(JSON.stringify(u)));Array.isArray(i)?(n.unshift({label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),this.setState({value:K.DIFFERENT_VALUE,selectOptions:n})):this.setState({value:i,selectOptions:n})}renderItem(i,n){if(!this.state.selectOptions)return null;let u;const v=JSON.parse(JSON.stringify(this.state.selectOptions));return Array.isArray(this.state.value)||this.state.value===K.DIFFERENT_VALUE?([...this.state.value].filter(h=>!v.find(d=>typeof d=="object"?d.value===h:d===h)).forEach(h=>v.push({label:h.toString(),value:h})),u={label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE},v.unshift(u)):(u=this.state.value!==null&&this.state.value!==void 0&&v.find(h=>typeof h=="object"?h.value==this.state.value:h==this.state.value),this.state.value!==null&&this.state.value!==void 0&&!u&&this.props.schema.freeSolo&&(u={value:this.state.value,label:this.state.value},v.push(u))),M.createElement(N.Autocomplete,{fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,value:u,options:v,isOptionEqualToValue:(h,d)=>h.value===d.value,filterOptions:(h,d)=>{const o=h.filter(p=>d.inputValue===""?!0:p.label.toLowerCase().includes(d.inputValue.toLowerCase())||p.value.toLowerCase().includes(d.inputValue.toLowerCase()));return this.props.schema.freeSolo&&d.inputValue!==""&&o.push({label:d.inputValue,value:d.inputValue}),o},onInputChange:h=>{if(!h||!this.props.schema.freeSolo)return;const d=h.target.value;d!==this.state.value&&this.setState({value:d},()=>this.onChange(this.props.attr,d))},onChange:(h,d)=>{const o=typeof d=="object"?d?d.value:"":d;o!==this.state.value&&this.setState({value:o},()=>this.onChange(this.props.attr,o))},getOptionLabel:h=>typeof h=="object"?(h==null?void 0:h.label)??"":"",renderInput:h=>M.createElement(N.TextField,{variant:"standard",...h,error:!!i,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:n})})}}class Ms extends K{initialized=!1;localContext;askInstance(){const i=K.getValue(this.props.data,this.props.attr),n=this.props.schema.options?this.props.schema.options.map(u=>typeof u=="string"?{label:u,value:u}:JSON.parse(JSON.stringify(u))):[];if(this.props.alive){let u=this.props.schema.data;if(u===void 0&&this.props.schema.jsonData){const v=this.getPattern(this.props.schema.jsonData,null,!0);try{typeof v=="string"&&(u=JSON.parse(v))}catch{console.error(`Cannot parse json data: ${JSON.stringify(u)}`)}}u===void 0&&(u=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",u).then(v=>{v&&Array.isArray(v)&&v.forEach(a=>n.push(typeof a=="string"?{label:a,value:a}:JSON.parse(JSON.stringify(a)))),Array.isArray(i)?(n.unshift({label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),this.setState({value:K.DIFFERENT_VALUE,selectOptions:n})):this.setState({value:i,selectOptions:n})})}else Array.isArray(i)?(n.unshift({label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),this.setState({value:K.DIFFERENT_VALUE,selectOptions:n})):this.setState({value:i,selectOptions:n})}getContext(){const i={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(n=>i[n]=K.getValue(this.props.data,n)),JSON.stringify(i)}renderItem(i,n){if(this.props.alive){const h=this.getContext();(h!==this.localContext||!this.initialized)&&(this.localContext=h,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}let u;const v=this.state.selectOptions?JSON.parse(JSON.stringify(this.state.selectOptions)):[];return Array.isArray(this.state.value)||this.state.value===K.DIFFERENT_LABEL?([...this.state.value].filter(h=>!v.find(d=>d.value===h)).forEach(h=>v.push({label:h.toString(),value:h})),u={label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE},v.unshift(u)):(u=this.state.value!==null&&this.state.value!==void 0&&v.find(h=>h.value==this.state.value),this.state.value!==null&&this.state.value!==void 0&&!u&&this.props.schema.freeSolo&&(u={value:this.state.value,label:this.state.value},v.push(u)),u=u||null),v.length?M.createElement(N.Autocomplete,{value:u,fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,options:v,isOptionEqualToValue:(h,d)=>h.value===d.value,filterOptions:(h,d)=>{const o=h.filter(p=>d.inputValue===""?!0:p.label.toLowerCase().includes(d.inputValue.toLowerCase())||p.value.toLowerCase().includes(d.inputValue.toLowerCase()));return this.props.schema.freeSolo&&d.inputValue!==""&&o.push({label:d.inputValue,value:d.inputValue}),o},getOptionLabel:h=>(h==null?void 0:h.label)??"",onInputChange:h=>{if(!h||!this.props.schema.freeSolo)return;const d=h.target.value;d!==this.state.value&&this.setState({value:d},()=>this.onChange(this.props.attr,d))},onChange:(h,d)=>{const o=typeof d=="object"?d?d.value:"":d;o!==this.state.value&&this.setState({value:o},()=>this.onChange(this.props.attr,o))},renderInput:h=>M.createElement(N.TextField,{variant:"standard",...h,error:!!i,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:n})}):M.createElement(N.TextField,{variant:"standard",fullWidth:!0,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!i,disabled:n,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},onChange:h=>{const d=h.target.value;this.setState({value:d},()=>this.onChange(this.props.attr,(d||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const kn={fullWidth:{width:"100%"},flex:{display:"flex"},button:{height:48,marginLeft:4,minWidth:48}};class Ls extends K{componentDidMount(){super.componentDidMount();const{data:i,attr:n}=this.props,u=K.getValue(i,n)||"";this.setState({value:u,showDialog:!1})}renderItem(i,n){const{schema:u,attr:v}=this.props,{value:a,showDialog:h}=this.state;return M.createElement(N.FormControl,{style:kn.fullWidth,variant:"standard"},u.label?M.createElement(N.InputLabel,{shrink:!0},this.getText(u.label)):null,M.createElement("div",{style:kn.flex},M.createElement(N.TextField,{variant:"standard",fullWidth:!0,value:a??"",error:!!i,disabled:n,placeholder:this.getText(u.placeholder),label:this.getText(u.label),helperText:this.renderHelp(u.help,u.helpLink,u.noTranslation),onChange:d=>{const o=d.target.value;this.setState({value:o},()=>this.onChange(v,o))}}),M.createElement(N.Button,{color:"grey",disabled:n,style:kn.button,size:"small",variant:"outlined",onClick:()=>this.setState({showDialog:!0})},"...")),h?M.createElement(j.DialogCron,{title:j.I18n.t("ra_Define schedule"),simple:u.simple,complex:u.complex,cron:a,onClose:()=>this.setState({showDialog:!1}),cancel:j.I18n.t("ra_Cancel"),ok:j.I18n.t("ra_Ok"),theme:this.props.oContext.theme,onOk:d=>this.setState({showDialog:!1,value:d},()=>this.onChange(v,d))}):null)}}class Is extends K{async componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr),u=(await this.props.oContext.socket.getCertificates()).filter(v=>{const a=this.props.attr.toLowerCase();return a.includes(v.type)||v.type==="public"&&a.includes("cert")||v.type==="private"&&(a.includes("priv")||a.includes("key"))?!0:!!(v.type==="chained"&&(a.includes("chain")||a.includes("ca")))}).map(v=>({label:v.name,value:v.name}));u.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.setState({value:i,selectOptions:u})}renderItem(i,n){var v,a;if(!this.state.selectOptions)return null;const u=(v=this.state.selectOptions)==null?void 0:v.find(h=>h.value===this.state.value);return M.createElement(N.FormControl,{style:{width:"100%"},variant:"standard"},this.props.schema.label?M.createElement(N.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,M.createElement(N.Select,{variant:"standard",error:!!i,displayEmpty:!0,disabled:!!n,value:this.state.value,renderValue:()=>this.getText(u==null?void 0:u.label,this.props.schema.noTranslation!==!1),onChange:h=>this.setState({value:h.target.value},()=>this.onChange(this.props.attr,this.state.value))},(a=this.state.selectOptions)==null?void 0:a.map(h=>M.createElement(N.MenuItem,{key:h.value,value:h.value,style:h.value===K.NONE_VALUE?{opacity:.5}:{}},this.getText(h.label,this.props.schema.noTranslation!==!1)))),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const zt={fullWidth:{width:"100%"},leWidth:{width:620,marginBottom:10},certWidth:{width:200,marginRight:10}};class Fs extends K{async componentDidMount(){var d;super.componentDidMount();const i=await this.props.oContext.socket.getCertificates(),n=[],u=[],v=[];let a=[];const h=await this.props.oContext.socket.getObject("system.certificates");(d=h==null?void 0:h.native)!=null&&d.collections?a=Object.keys(h.native.collections):a=null,i.forEach(o=>{o.type==="public"?n.push({label:o.name,value:o.name}):o.type==="private"?u.push({label:o.name,value:o.name}):o.type==="chained"?v.push({label:o.name,value:o.name}):(n.push({label:o.name,value:o.name}),u.push({label:o.name,value:o.name}),v.push({label:o.name,value:o.name}))}),n.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),u.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),v.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.setState({certsPublicOptions:n,certsChainOptions:v,certsPrivateOptions:u,collectionsOptions:a})}renderItem(i,n){var e,t,r,l,s,c,f;if(!this.state.certsPublicOptions||!this.state.certsPrivateOptions||!this.state.certsChainOptions)return null;const u=(K.getValue(this.props.data,this.props.schema.leCollectionName||"leCollection")||"false").toString(),v=K.getValue(this.props.data,this.props.schema.certPublicName||"certPublic"),a=K.getValue(this.props.data,this.props.schema.certPrivateName||"certPrivate"),h=K.getValue(this.props.data,this.props.schema.certChainedName||"certChained"),d=(e=this.state.certsPublicOptions)==null?void 0:e.find(m=>m.value===v),o=(t=this.state.certsPrivateOptions)==null?void 0:t.find(m=>m.value===a),p=(r=this.state.certsChainOptions)==null?void 0:r.find(m=>m.value===h);return M.createElement("div",{style:zt.fullWidth},this.state.collectionsOptions?M.createElement(N.FormControl,{style:zt.leWidth,variant:"standard"},M.createElement(N.InputLabel,{shrink:!0},"Let's encrypt"),M.createElement(N.Select,{variant:"standard",error:!!i,displayEmpty:!0,disabled:!!n,value:u,onChange:m=>this.onChange(this.props.schema.leCollectionName||"leCollection",m.target.value==="false"?!1:m.target.value==="true"?!0:m.target.value)},M.createElement(N.MenuItem,{key:"_false",value:"false",style:{fontWeight:"bold"}},j.I18n.t("ra_Do not use let's encrypt")),M.createElement(N.MenuItem,{key:"_true",value:"true",style:{fontWeight:"bold"}},j.I18n.t("ra_Use all available let's encrypt certificates")),(l=this.state.collectionsOptions)==null?void 0:l.map(m=>M.createElement(N.MenuItem,{key:m,value:m},m)))):null,this.state.collectionsOptions?M.createElement("br",null):null,this.state.collectionsOptions&&u!=="false"?M.createElement("div",null,j.I18n.t("ra_Fallback custom certificates")):null,M.createElement(N.FormControl,{style:zt.certWidth,variant:"standard"},M.createElement(N.InputLabel,{shrink:!0},j.I18n.t("ra_Public certificate")),M.createElement(N.Select,{variant:"standard",error:!!i,displayEmpty:!0,disabled:!!n,value:v||"",renderValue:()=>this.getText(d==null?void 0:d.label),onChange:m=>this.onChange(this.props.schema.certPublicName||"certPublic",m.target.value)},(s=this.state.certsPublicOptions)==null?void 0:s.map((m,y)=>M.createElement(N.MenuItem,{key:`${m.value}_${y}`,value:m.value,style:m.value===K.NONE_VALUE?{opacity:.5}:{}},this.getText(m.label))))),M.createElement(N.FormControl,{style:zt.certWidth,variant:"standard"},M.createElement(N.InputLabel,{shrink:!0},j.I18n.t("ra_Private certificate")),M.createElement(N.Select,{variant:"standard",error:!!i,displayEmpty:!0,disabled:!!n,value:a||"",renderValue:()=>this.getText(o==null?void 0:o.label),onChange:m=>this.onChange(this.props.schema.certPrivateName||"certPrivate",m.target.value)},(c=this.state.certsPrivateOptions)==null?void 0:c.map((m,y)=>M.createElement(N.MenuItem,{key:`${m.value}_${y}`,value:m.value,style:m.value===K.NONE_VALUE?{opacity:.5}:{}},this.getText(m.label))))),M.createElement(N.FormControl,{style:zt.certWidth,variant:"standard"},M.createElement(N.InputLabel,{shrink:!0},j.I18n.t("ra_Chained certificate")),M.createElement(N.Select,{variant:"standard",error:!!i,displayEmpty:!0,disabled:!!n,value:h||"",renderValue:()=>this.getText(p==null?void 0:p.label),onChange:m=>this.onChange(this.props.schema.certChainedName||"certChained",m.target.value)},(f=this.state.certsChainOptions)==null?void 0:f.map((m,y)=>M.createElement(N.MenuItem,{key:`${m.value}_${y}`,value:m.value,style:m.value===K.NONE_VALUE?{opacity:.5}:{}},this.getText(m.label))))))}}class Rs extends K{async componentDidMount(){var u;super.componentDidMount();let i;const n=await this.props.oContext.socket.getObject("system.certificates");(u=n==null?void 0:n.native)!=null&&u.collections?i=Object.keys(n.native.collections):i=[],this.setState({collectionsOptions:i})}renderItem(i,n){var v;if(!this.state.collectionsOptions)return null;const u=(K.getValue(this.props.data,this.props.schema.leCollectionName||"leCollection")||"false").toString();return M.createElement(N.FormControl,{style:{width:"100%"},variant:"standard"},this.props.schema.label?M.createElement(N.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,M.createElement(N.Select,{variant:"standard",error:!!i,displayEmpty:!0,disabled:!!n,value:u,onChange:a=>this.onChange(this.props.schema.leCollectionName||"leCollection",a.target.value==="false"?!1:a.target.value==="true"?!0:a.target.value)},M.createElement(N.MenuItem,{key:"_false",value:"false",style:{fontWeight:"bold"}},j.I18n.t("ra_Do not use let's encrypt")),M.createElement(N.MenuItem,{key:"_true",value:"true",style:{fontWeight:"bold"}},j.I18n.t("ra_Use all available let's encrypt certificates")),(v=this.state.collectionsOptions)==null?void 0:v.map(a=>M.createElement(N.MenuItem,{key:a,value:a},a))),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const We={fullWidth:{width:"100%"},licLabel:{fontWeight:"bold",minWidth:100,marginRight:10,textTransform:"capitalize",display:"inline-block"},errorTitle:L=>({color:L.palette.mode==="dark"?"#e39191":"#b62020"}),okTitle:L=>({color:L.palette.mode==="dark"?"#6fd56f":"#007c00"}),errorText:L=>({color:L.palette.mode==="dark"?"#e39191":"#b62020",mb:"30px"})};class ct extends K{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 i=this.state._error;return this.state.allLicenses&&(i=[M.createElement("div",{key:"error"},i)],i.push(M.createElement(N.Button,{key:"button",variant:"contained",onClick:()=>window.open("https://iobroker.net/www/account/licenses","_blank")},j.I18n.t("iobroker.net"))),this.state.allLicenses.length?i.push(M.createElement(N.TableContainer,{key:"table"},M.createElement(N.Table,{size:"small"},M.createElement(N.TableHead,null,M.createElement(N.TableRow,null,M.createElement(N.TableCell,null,j.I18n.t("ra_Product")),M.createElement(N.TableCell,null,j.I18n.t("ra_Version")),M.createElement(N.TableCell,null,"UUID"),M.createElement(N.TableCell,null,j.I18n.t("ra_ValidTill")),M.createElement(N.TableCell,null,j.I18n.t("ra_Commercial")),M.createElement(N.TableCell,null,"ID"))),M.createElement(N.TableBody,null,this.state.allLicenses.map(n=>M.createElement(N.TableRow,{key:n.id},M.createElement(N.TableCell,{sx:n.validName?null:We.errorText},n.license.product),M.createElement(N.TableCell,{sx:n.validVersion?null:We.errorText},n.license.version),M.createElement(N.TableCell,{sx:n.validUuid?null:We.errorText},n.license.uuid||"--"),M.createElement(N.TableCell,{sx:n.validTill?null:We.errorText},n.license.validTill&&n.license.validTill!=="0000-00-00 00:00:00"?new Date(n.license.validTill).toLocaleDateString():"--"),M.createElement(N.TableCell,null,n.license.invoice!=="free"?n.license.invoice==="MANUALLY_CREATED"?"✓":n.license.invoice:"-"),M.createElement(N.TableCell,null,n.id))))))):(i.push(M.createElement("div",{key:"text1"},j.I18n.t("ra_No one license found in license manager"))),i.push(M.createElement("div",{key:"text2"},j.I18n.t("ra_Please create license"))))),M.createElement(N.Dialog,{open:!0,maxWidth:"xl",fullWidth:this.props.fullWidth!==void 0?this.props.fullWidth:!0,onClick:()=>this.setState({_error:"",allLicenses:null})},M.createElement(N.DialogTitle,null,j.I18n.t("ra_Error")),M.createElement(N.DialogContent,null,M.createElement(N.DialogContentText,null,i)),M.createElement(N.DialogActions,null,M.createElement(N.Button,{variant:"contained",onClick:()=>this.setState({_error:"",allLicenses:null}),color:"primary",autoFocus:!0,startIcon:M.createElement(Z.Check,null)},j.I18n.t("ra_Ok"))))}return null}renderMessageDialog(){if(this.state.showLicenseData){const i=[],n=this.state.showLicenseData;return Object.keys(n).forEach(u=>{if(!(n[u]===null||n[u]===void 0))if(typeof n[u]=="object"){const v=n[u];Object.keys(v).forEach(a=>{v[a]!==null&&v[a]!==void 0&&(typeof v[a]=="object"?i.push(M.createElement("div",{key:a},M.createElement("div",{style:We.licLabel},a,":"),JSON.stringify(v[a],null,2))):i.push(M.createElement("div",{key:a},M.createElement("div",{style:We.licLabel},u," -",a,":"),v[a].toString())))})}else i.push(M.createElement("div",{key:u},M.createElement("div",{style:We.licLabel},u.replace(/_/g," "),":"),n[u].toString()))}),i.push(M.createElement("div",{key:"checked"},M.createElement("div",{style:We.licLabel},j.I18n.t("ra_Checked"),":"),this.state.licenseOfflineCheck?j.I18n.t("ra_locally"):j.I18n.t("ra_via internet"))),M.createElement(N.Dialog,{open:!0,onClose:()=>this.setState({showLicenseData:null})},M.createElement(N.DialogTitle,null,M.createElement(N.Box,{component:"span",sx:this.state.result?We.okTitle:We.errorTitle},j.I18n.t("ra_License %s",this.state.result?"OK":"INVALID"))),M.createElement(N.DialogContent,null,this.state.showLinkToProfile?M.createElement(N.Button,{variant:"contained",onClick:()=>window.open("https://iobroker.net/www/account/licenses","_blank")},"https://iobroker.net"):null,this.state._error?M.createElement(N.Box,{component:"div",sx:We.errorText},this.state._error):null,i),M.createElement(N.DialogActions,null,M.createElement(N.Button,{onClick:()=>this.setState({showLicenseData:null,_error:""}),color:"primary",variant:"contained"},j.I18n.t("ra_Close"))))}return null}static parseJwt(i){const u=i.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),v=decodeURIComponent(atob(u).split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));try{return JSON.parse(v)}catch{return null}}static isVersionValid(i,n,u,v){if(!n||!i)return!0;let a=!0;const[h]=i.split(".");return n.startsWith(">=")?a=parseInt(h,10)>=parseInt(n.substring(2,10)):n.startsWith("<=")?a=parseInt(h,10)<=parseInt(n.substring(2,10)):n.startsWith(">")?a=parseInt(h,10)>parseInt(n.substring(1,10)):n.startsWith("<")?a=parseInt(h,10)<parseInt(n.substring(1,10)):n.startsWith("=")?a=parseInt(h,10)===parseInt(n.substring(1,10)):n.startsWith("==")?a=parseInt(h,10)===parseInt(n.substring(2,10)):n.startsWith("===")&&(a=parseInt(h,10)===parseInt(n.substring(3,10))),!0}async findInLicenseManager(i){var v,a,h,d;const n=await this.props.oContext.socket.getObject("system.licenses"),u=[];if((a=(v=n==null?void 0:n.native)==null?void 0:v.licenses)!=null&&a.length){let o=null;const p=Date.now();let e;if(this.props.schema.uuid){const r=await this.props.oContext.socket.getObject("system.meta.uuid");e=(h=r==null?void 0:r.native)==null?void 0:h.uuid}let t;if(this.props.schema.version){const r=await this.props.oContext.socket.getObject(`system.adapter.${i}`);t=(d=r==null?void 0:r.common)==null?void 0:d.version}n.native.licenses.forEach(r=>{const l=!r.validTill||r.validTill==="0000-00-00 00:00:00"||new Date(r.validTill).getTime()>p,s=(r.product||"").split("."),c=s[1]===i||i==="vis-2"&&s[1]==="vis",f=!e||!r.uuid||r.uuid===e,m=ct.isVersionValid(t,r.version,r.invoice,i);(!o||r.invoice!=="free")&&l&&c&&f&&m&&(o=r),u.push({id:r.id,validName:c,validUuid:f,validVersion:m,validTill:l,license:r})}),o&&(u.find(r=>r.id===o.id).used=!0)}return u}async checkLicense(i,n){var d,o,p;let u;if(this.props.schema.uuid){const e=await this.props.oContext.socket.getObject("system.meta.uuid");u=(d=e==null?void 0:e.native)==null?void 0:d.uuid}let v;if(this.props.schema.version){const e=await this.props.oContext.socket.getObject(`system.adapter.${n}`);v=(o=e==null?void 0:e.common)==null?void 0:o.version}const a=new AbortController;let h=setTimeout(()=>{h=null,a.abort()},5e3);try{const e=await window.fetch("https://iobroker.net/api/v1/public/cert/",{method:"POST",body:JSON.stringify({json:i,uuid:u}),headers:{"Content-Type":"text/plain"},signal:a.signal});h&&clearTimeout(h);const t=await e.text();let r;try{r=JSON.parse(t)}catch{}if(r!=null&&r.error)try{const l=ct.parseJwt(i),s=j.I18n.t(`ra_${l.error||r.error||"Unknown error"}`).replace(/^ra_/,"");return this.setState({_error:s,licenseOfflineCheck:!1,showLicenseData:l,result:!1,running:!1})}catch{return console.log("Cannot parse license"),this.setState({_error:r.error,result:!1,running:!1})}else{let l=null;try{l=ct.parseJwt(i)}catch{}if(r){const s=r.validTill||r.valid_till;if(s&&s!=="0000-00-00 00:00:00"&&new Date(s).getTime()<Date.now())return this.setState({_error:j.I18n.t("ra_License expired on %s",new Date(s).toLocaleString()),licenseOfflineCheck:!1,showLicenseData:l,result:!1,running:!1});const c=(r.name||"").split(".");return c[1]===n||c[1]==="vis"&&n==="vis-2"?u&&!r.uuid&&n==="vis-2"?this.setState({_error:j.I18n.t("ra_License must be converted",r.uuid),showLinkToProfile:!0,licenseOfflineCheck:!1,showLicenseData:l,result:!1,running:!1}):u&&r.uuid&&r.uuid!==u?this.setState({_error:j.I18n.t('ra_Serial number (UUID) "%s" in license is for other device.',r.uuid),licenseOfflineCheck:!1,showLicenseData:l,result:!1,running:!1}):ct.isVersionValid(v,r.version,r.invoice,n)?this.setState({licenseOfflineCheck:!1,showLicenseData:l,result:!0,running:!1}):this.setState({_error:j.I18n.t("ra_License is for version %s, but required version is %s",r.version,this.props.schema.version),licenseOfflineCheck:!1,showLicenseData:l,result:!1,running:!1}):this.setState({_error:j.I18n.t('ra_License for other product "%s"',r.name),licenseOfflineCheck:!1,showLicenseData:l,result:!1,running:!1})}throw new Error("ra_Invalid answer from server")}}catch(e){if(((p=e==null?void 0:e.response)==null?void 0:p.status)===404)return this.setState({_error:j.I18n.t("ra_License does not exist"),result:!1,running:!1});try{const t=ct.parseJwt(i),r=(t.name||"").split(".");return t.valid_till&&t.valid_till!=="0000-00-00 00:00:00"&&new Date(t.valid_till).getTime()<Date.now()?this.setState({_error:j.I18n.t("ra_License expired on %s",new Date(t.valid_till).toLocaleString()),showLicenseData:t,licenseOfflineCheck:!0,running:!1,result:!1}):r[1]===n?u&&t.uuid&&t.uuid!==u?this.setState({_error:j.I18n.t('ra_Serial number (UUID) "%s" in license is for other device.',t.uuid),showLicenseData:t,licenseOfflineCheck:!0,result:!1,running:!1}):ct.isVersionValid(v,t.version,t.invoice,n)?this.setState({running:!1,result:!0,licenseOfflineCheck:!0,showLicenseData:t}):this.setState({_error:j.I18n.t("ra_License is for version %s, but required version is %s",t.version,this.props.schema.version),licenseOfflineCheck:!0,showLicenseData:t,result:!1,running:!1}):this.setState({_error:j.I18n.t('ra_License for other product "%s"',t.name),licenseOfflineCheck:!0,showLicenseData:t,result:!1,running:!1})}catch{return this.setState({_error:j.I18n.t("ra_Cannot decode license"),result:!1,licenseOfflineCheck:!0,running:!1})}}}renderAskForUpdate(){return this.state.askForUpdate?M.createElement(j.DialogConfirm,{text:j.I18n.t("ra_License not found in license manager. Do you want to read licenses from iobroker.net?"),ok:j.I18n.t("ra_Yes"),onClose:async i=>{if(i){this.setState({askForUpdate:!1});try{await this.props.oContext.socket.updateLicenses(null,null)}catch(n){window.alert(j.I18n.t("ra_Cannot read licenses: %s",n));return}await this._onClick(!0)}else this.setState({askForUpdate:!1,running:!1})}}):null}async _onClick(i){const n=this.props.oContext.adapterName==="vis-2"?"vis":this.props.oContext.adapterName;this.setState({running:!0});let u,v;if(this.props.data.useLicenseManager){if(v=await this.findInLicenseManager(n),u=v.find(a=>a.used),u&&(u=u.license.json),!u&&!i){this.setState({askForUpdate:!0});return}}else u=this.props.data.license;u?await this.checkLicense(u,n):this.props.data.useLicenseManager?this.setState({_error:j.I18n.t("ra_Suitable license not found in license manager"),result:!1,running:!1,allLicenses:v}):this.setState({_error:j.I18n.t("ra_Please enter the license"),result:!1,running:!1})}renderItem(){return M.createElement("div",{style:We.fullWidth},M.createElement(N.Button,{variant:this.props.schema.variant||"outlined",color:this.props.schema.color||"primary",style:We.fullWidth,disabled:!this.props.data.license&&!this.props.data.useLicenseManager||this.state.running,startIcon:M.createElement(Z.Send,null),onClick:()=>this._onClick()},this.state.running?M.createElement(N.CircularProgress,{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 Os extends K{renderItem(i,n){const u=K.getValue(this.props.data,this.props.attr),v=Array.isArray(u);return M.createElement(N.FormControl,{style:{width:"100%"},variant:"standard"},M.createElement(N.FormControlLabel,{onClick:a=>{if(a.preventDefault(),a.stopPropagation(),!n){const h=this.onChange(this.props.attr,!u);h instanceof Promise&&h.catch(d=>console.error(`Cannot set value: ${d}`))}},control:M.createElement(N.Checkbox,{indeterminate:v,checked:!!u,onChange:a=>{let h;v?h=this.onChange(this.props.attr,!0):h=this.onChange(this.props.attr,a.target.checked),h instanceof Promise&&h.catch(d=>console.error(`Cannot set value: ${d}`))},disabled:n||this.props.schema.readOnly}),label:this.getText(this.props.schema.label)}),M.createElement(N.FormHelperText,{style:{color:"red"}},i?this.props.schema.validatorErrorText?j.I18n.t(this.props.schema.validatorErrorText):j.I18n.t("ra_Error"):null),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Ns={standard:N.Input,filled:rs,outlined:N.OutlinedInput},Bs=L=>{const i=L.palette.mode==="light",n=i?"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 ${L.palette.primary[i?"dark":"light"]}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:L.transitions.create("transform",{duration:L.transitions.duration.shorter,easing:L.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:L.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:L.transitions.create("border-bottom-color",{duration:L.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:not($disabled):not($focused):not($error):before":{borderBottom:`2px solid ${L.palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{"&:after":{backgroundColor:L.palette.error.main,transform:"scaleX(1)"}},chip:{margin:"0 8px 8px 0",float:"left"},marginDense:{}}},rn={BACKSPACE:8,DELETE:46,LEFT_ARROW:37,RIGHT_ARROW:39},Ps=({value:L,isFocused:i,isDisabled:n,isReadOnly:u,handleClick:v,handleDelete:a,style:h},d)=>M.createElement(N.Chip,{key:d,style:{...h,pointerEvents:n||u?"none":void 0,backgroundColor:i?ss[300]:void 0},onClick:v,onDelete:a,label:L});class Ws extends M.Component{labelRef;labelNode=null;input;newChipKeyCodes;newChipKeys;actualInput=null;inputBlurTimeout=null;_keyPressed;_preventChipCreation;styles={};styleTheme=null;constructor(i){super(i),this.state={chips:i.defaultValue||[],focusedChip:null,inputValue:"",isFocused:!1,chipsUpdated:!1,prevPropsValue:[],variant:this.props.variant||"standard"},this.newChipKeyCodes=i.newChipKeyCodes||[13],this.newChipKeys=i.newChipKeys||["Enter"],this.labelRef=M.createRef(),this.input=M.createRef()}componentDidMount(){this.state.variant==="outlined"&&(this.labelNode=is.findDOMNode(this.labelRef.current),this.forceUpdate())}componentWillUnmount(){this.inputBlurTimeout&&clearTimeout(this.inputBlurTimeout)}static getDerivedStateFromProps(i,n){let u=null;return i.value&&i.value.length!==n.prevPropsValue.length&&(u={prevPropsValue:i.value},i.clearInputValueOnChange&&(u.inputValue="")),i.clearInputValueOnChange&&i.value&&i.value.length!==n.prevPropsValue.length&&(u={prevPropsValue:i.value,inputValue:""}),i.disabled&&(u={...u,focusedChip:null}),!n.chipsUpdated&&i.defaultValue&&(u={...u,chips:i.defaultValue}),u}focus=()=>{var i;(i=this.actualInput)==null||i.focus(),this.state.focusedChip&&this.setState({focusedChip:null})};handleInputBlur=i=>{this.props.onBlur&&this.props.onBlur(i),this.setState({isFocused:!1}),this.state.focusedChip&&this.setState({focusedChip:null});const n=i.target.value;let u;switch(this.props.blurBehavior||"clear"){case"add-or-clear":u={clearInputOnFail:!0};case"add":if(this.props.delayBeforeAdd){const v=(this.props.value||this.state.chips).length;this.inputBlurTimeout=setTimeout(()=>{const a=(this.props.value||this.state.chips).length;v===a?this.handleAddChip(n,u):this.clearInput()},150)}else this.handleAddChip(n,u);break;case"clear":this.clearInput();break}};handleInputFocus=i=>{this.setState({isFocused:!0}),this.props.onFocus&&this.props.onFocus(i)};handleKeyDown=i=>{const{focusedChip:n}=this.state;if(this._keyPressed=!1,this._preventChipCreation=!1,this.props.onKeyDown&&(this.props.onKeyDown(i),i.isDefaultPrevented()))return;const u=this.props.value||this.state.chips;if(this.newChipKeyCodes.includes(i.keyCode)||this.newChipKeys.includes(i.key)){this.handleAddChip(i.target.value)!==!1&&i.preventDefault();return}switch(i.keyCode){case rn.BACKSPACE:i.target.value===""&&(n?(this.handleDeleteChip(u[n],n),n&&this.setState({focusedChip:n-1})):this.setState({focusedChip:u.length-1}));break;case rn.DELETE:i.target.value===""&&n&&(this.handleDeleteChip(u[n],n),n<=u.length-1&&this.setState({focusedChip:n}));break;case rn.LEFT_ARROW:n===null&&i.target.value===""&&u.length?this.setState({focusedChip:u.length-1}):n!==null&&n>0&&this.setState({focusedChip:n-1});break;case rn.RIGHT_ARROW:n!==null&&n<u.length-1?this.setState({focusedChip:n+1}):this.setState({focusedChip:null});break;default:this.setState({focusedChip:null});break}};handleKeyUp=i=>{!this._preventChipCreation&&(this.newChipKeyCodes.includes(i.keyCode)||this.newChipKeys.includes(i.key))&&this._keyPressed?this.clearInput():this.updateInput(i.target.value),this.props.onKeyUp&&this.props.onKeyUp(i)};handleUpdateInput=i=>{(this.props.inputValue===null||this.props.inputValue===void 0)&&this.updateInput(i.target.value),this.props.onUpdateInput&&this.props.onUpdateInput(i)};handleAddChip(i,n){if(this.props.onBeforeAdd&&!this.props.onBeforeAdd(i))return this._preventChipCreation=!0,n&&n.clearInputOnFail&&this.clearInput(),!1;this.clearInput();const u=this.props.value||this.state.chips;return i.trim().length?((this.props.allowDuplicates||!u.includes(i))&&(this.props.value&&this.props.onAdd?this.props.onAdd(i):this.updateChips([...this.state.chips,i])),!0):!1}handleDeleteChip(i,n){if(this.props.value)this.props.onDelete&&this.props.onDelete(i,n);else{const u=this.state.chips.slice();if(u.splice(n,1)){let a=this.state.focusedChip;this.state.focusedChip===n?a=null:this.state.focusedChip>n&&(a=this.state.focusedChip-1),this.updateChips(u,{focusedChip:a})}}}updateChips(i,n={}){this.setState({chips:i,chipsUpdated:!0,...n}),this.props.onChange&&this.props.onChange(i)}clearInput(){this.updateInput("")}updateInput(i){this.setState({inputValue:i})}setActualInputRef=i=>{this.actualInput=i,this.props.inputRef&&this.props.inputRef(i)};render(){const{alwaysShowPlaceholder:i,chipRenderer:n=Ps,className:u,disabled:v,disableUnderline:a,error:h,FormHelperTextProps:d,fullWidth:o,fullWidthInput:p,helperText:e,id:t,InputProps:r={},InputLabelProps:l={},inputValue:s,label:c,placeholder:f,readOnly:m,required:y,rootRef:D,value:E,margin:b}=this.props,g=this.state.variant;this.styleTheme!==this.props.theme.palette.mode&&(this.styleTheme=this.props.theme.palette.mode,this.styles=j.Utils.getStyle(this.props.theme,Bs));let S=E||this.state.chips||[];Array.isArray(S)||(S=(S||"").toString().split(/[,\s]+/).map(C=>C.trim()));const T=s??this.state.inputValue,k=(this.props.value||T).length||T.length,_=typeof l.shrink=="boolean"?l.shrink:c!==null&&(k||this.state.isFocused||S.length),R=S.map((C,w)=>n({value:C,isDisabled:!!v,isReadOnly:m,isFocused:this.state.focusedChip===w,handleClick:()=>this.setState({focusedChip:w}),handleDelete:()=>this.handleDeleteChip(C,w),style:this.styles.chip},w.toString())),x={};g==="outlined"&&(x.notched=!!_,x.labelWidth=_&&this.labelNode&&this.labelNode.offsetWidth||0),g!=="standard"?x.startAdornment=R:r.disableUnderline=!0;const A=Ns[g];return M.createElement(N.FormControl,{ref:D,fullWidth:o,className:u,sx:{...this.styles.root,...b==="dense"?this.styles.marginDense:{}},error:h,required:S.length>0?void 0:y,onClick:this.focus,disabled:v,variant:g,component:"div",margin:b},c&&M.createElement(N.InputLabel,{htmlFor:t,sx:{"&.MuiInputLabel-root":this.styles.label,"&.MuiInputLabel-shrink":this.styles.labelShrink},shrink:!!_,focused:this.state.isFocused,variant:g,ref:this.labelRef,required:y,component:"label",...l},c),M.createElement(N.Box,{component:"div",id:"input-chip-container",sx:{...this.styles[g],...this.styles.chipContainer,...this.state.isFocused?this.styles.focused:void 0,...!a&&g==="standard"?this.styles.underline:void 0,...v?this.styles.disabled:void 0,...c?this.styles.labeled:void 0,...h?this.styles.error:void 0}},g==="standard"&&R,M.createElement(A,{ref:this.input,className:`mui-variant-${this.styles[g]} ${c?"mui-chip-with-label":"mui-chip-no-label"}`,sx:{"&.MuiInputBase-input":{...this.styles.input,...this.styles[g]},"&.MuiInputBase-root":{...this.styles.inputRoot}},id:t,value:T,onChange:this.handleUpdateInput,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,inputRef:this.setActualInputRef,disabled:v,fullWidth:p,placeholder:!k&&(_||c===null||c===void 0)||i?f:null,readOnly:m,...r,...x})),e&&M.createElement(N.FormHelperText,{...d,className:d==null?void 0:d.className,style:this.styles.helperText},e))}}class fi extends K{componentDidMount(){super.componentDidMount();const{data:i,attr:n}=this.props,u=K.getValue(i,n);if(this.props.schema.delimiter&&typeof u=="string"){const v=u.split(this.props.schema.delimiter).map(a=>a.trim()).filter(a=>a);this.setState({value:v})}else this.setState({value:u||[]})}renderItem(i,n){const{attr:u,schema:v}=this.props,{value:a}=this.state;return M.createElement(N.FormControl,{fullWidth:!0,variant:"standard"},M.createElement(Ws,{value:a,disabled:!!n,label:this.getText(v.label),error:!!i,onAdd:h=>{const d=JSON.parse(JSON.stringify(a));d.push(h),this.setState({value:d},()=>{let o;this.props.schema.delimiter?o=this.onChange(u,d.join(`${this.props.schema.delimiter} `)):o=this.onChange(u,d),o instanceof Promise&&o.catch(p=>console.error(p))})},theme:this.props.oContext.theme,onDelete:(h,d)=>{const o=JSON.parse(JSON.stringify(a));o.splice(d,1),this.setState({value:o},()=>{let p;this.props.schema.delimiter?p=this.onChange(u,o.join(`${this.props.schema.delimiter} `)):p=this.onChange(u,o),p instanceof Promise&&p.catch(e=>console.error(e))})}}),M.createElement(N.FormHelperText,null,j.I18n.t("ra_Press ENTER Key to add new item")),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Hs extends K{renderColorDialog(){return!!this.state.showColorDialog&&M.createElement(N.Dialog,{onClose:()=>this.setState({showColorDialog:!1}),open:this.state.showColorDialog},M.createElement(es,{color:this.state.colorDialogValue,onChange:i=>this.setState({colorDialogValue:i.hex},()=>this.onChange(this.props.attr,this.state.colorDialogValue))}))}renderItem(i,n){const u=K.getValue(this.props.data,this.props.attr);let v=j.Utils.isUseBright(u,null);return v===null&&(v=void 0),M.createElement(M.Fragment,null,this.renderColorDialog(),M.createElement(N.TextField,{variant:"standard",disabled:!!n,style:{minWidth:100,width:"calc(100% - 8px)"},label:this.getText(this.props.schema.label),value:u||"",onClick:()=>!this.props.schema.readOnly&&this.setState({showColorDialog:!0,colorDialogValue:u||""}),onChange:a=>{const h=a.target.value,d=this.onChange(this.props.attr,h);d instanceof Promise&&d.catch(o=>console.error(`Cannot set value: ${o}`))},slotProps:{htmlInput:{style:{backgroundColor:u,color:v?"#FFF":"#000"},readOnly:this.props.schema.readOnly||!1},input:{endAdornment:!this.props.schema.readOnly&&u&&!this.props.schema.noClearButton?M.createElement(N.IconButton,{tabIndex:-1,size:"small",onClick:a=>{a.stopPropagation();const h=this.onChange(this.props.attr,"");h instanceof Promise&&h.catch(d=>console.error(`Cannot set value: ${d}`))}},M.createElement(Z.Close,null)):void 0},inputLabel:{shrink:!0}}}))}}const Mn={width:{width:"calc(100% - 85px)"},width50:{width:120,marginRight:5}};class zs extends K{componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr);this.setState({value:i});const n={};this.props.schema.useSystemName&&(n.useSystem=!!K.getValue(this.props.data,this.props.schema.useSystemName)),this.props.schema.longitudeName&&this.props.schema.latitudeName?(n.longitude=K.getValue(this.props.data,this.props.schema.longitudeName),n.latitude=K.getValue(this.props.data,this.props.schema.latitudeName),!n.longitude&&!n.latitude&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300)):!K.getValue(this.props.data,this.props.attr)&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300),Object.keys(n).length&&setTimeout(()=>this.setState(n),50)}async getSystemCoordinates(){const i=await this.props.oContext.socket.getCompactSystemConfig();if(i!=null&&i.common&&(i.common.longitude||i.common.latitude))if(window.alert(j.I18n.t("ra_Used system settings")),this.props.schema.longitudeName&&this.props.schema.latitudeName)this.setState({longitude:i.common.longitude,latitude:i.common.latitude},async()=>{await this.onChange(this.props.schema.longitudeName,i.common.longitude),await this.onChange(this.props.schema.latitudeName,i.common.latitude)});else{const n=i.common.latitude+(this.props.schema.divider||",")+i.common.longitude;this.setState({value:n},()=>{const u=this.onChange(this.props.attr,n);u instanceof Promise&&u.catch(v=>console.error(`Cannot set value: ${v}`))})}else window.alert(j.I18n.t("ra_Cannot determine position: System settings are empty and GPS detection is disabled in browser"))}getCoordinates(){navigator.geolocation?navigator.geolocation.getCurrentPosition(async i=>{if(i!=null&&i.coords)if(this.props.schema.longitudeName&&this.props.schema.latitudeName)this.setState({longitude:i.coords.longitude,latitude:i.coords.latitude},async()=>{await this.onChange(this.props.schema.longitudeName,i.coords.longitude||""),await this.onChange(this.props.schema.latitudeName,i.coords.latitude||"")});else{const n=i.coords.latitude+(this.props.schema.divider||",")+i.coords.longitude;this.setState({value:n},()=>{const u=this.onChange(this.props.attr,n);u instanceof Promise&&u.catch(v=>console.error(`Cannot set value: ${v}`))})}else await this.getSystemCoordinates()},async i=>{console.error(`Cannot determine coordinates from browser: ${i.message}`),await this.getSystemCoordinates()}):this.getSystemCoordinates().catch(i=>{console.error(`Cannot determine coordinates: ${i}`)})}renderItem(i,n){return M.createElement(M.Fragment,null,this.props.schema.useSystemName?M.createElement(N.FormControlLabel,{control:M.createElement(N.Checkbox,{checked:!!this.state.useSystem,onChange:u=>{const v=u.target.checked;v&&this.getSystemCoordinates().catch(a=>console.error(`Cannot determine coordinates: ${a}`)),this.setState({useSystem:v},()=>this.onChange(this.props.schema.useSystemName,v))}}),label:j.I18n.t("ra_Use system settings for position")}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?M.createElement(N.TextField,{variant:"standard",style:Mn.width50,value:this.state.longitude??"",error:!!i,disabled:this.state.useSystem||!!n,onChange:u=>{const v=u.target.value;this.setState({longitude:v},()=>{const a=this.onChange(this.props.schema.longitudeName,(v||"").trim());a instanceof Promise&&a.catch(h=>console.error(`Cannot set value: ${h}`))})},label:j.I18n.t("ra_Longitude")}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?M.createElement(N.TextField,{variant:"standard",style:Mn.width50,value:this.state.latitude??"",error:!!i,disabled:this.state.useSystem||!!n,onChange:u=>{const v=u.target.value;this.setState({latitude:v},()=>this.onChange(this.props.schema.latitudeName,(v||"").trim()))},label:j.I18n.t("ra_Latitude")}):null,!this.props.schema.longitudeName||!this.props.schema.latitudeName?M.createElement(N.TextField,{variant:"standard",style:Mn.width,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!i,disabled:!!n,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.state.useSystem}},onChange:u=>{const v=u.target.value;this.setState({value:v},()=>this.onChange(this.props.attr,(v||"").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:M.createElement(N.Fab,{size:"small",onClick:()=>this.getCoordinates(),title:j.I18n.t("ra_Take browser position"),style:{marginRight:4}},M.createElement(Z.LocationOn,null)),this.state.useSystem?null:M.createElement(N.Fab,{size:"small",onClick:()=>this.getSystemCoordinates(),title:j.I18n.t("ra_Take position from system settings")},M.createElement(Z.GpsFixed,null)))}}Pn.init({name:"iobroker_admin",shared:{"@iobroker/adapter-react-v5":{lib:()=>ns,version:"*"},"@mui/icons-material":{lib:()=>ts,version:"*"},"@iobroker/json-config":{lib:()=>as,version:"*"}},remotes:[]});class Ut extends K{static runningLoads={};constructor(i){super(i),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 i;this.props.schema.url.startsWith("http:")||this.props.schema.url.startsWith("https:")?i=this.props.schema.url:this.props.schema.url.startsWith("./")?i=`${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\./,"")}`:i=`${window.location.protocol}//${window.location.host}/adapter/${this.props.oContext.adapterName}/${this.props.schema.url}`;const[n,u,...v]=this.props.schema.name.split("/"),a=v.join("/");if(!i){console.error('Cannot find URL for custom component! Please define "url" as "custom/customComponents.js" in the schema');return}if(!n||!u||!a){console.error('Invalid format of "name"! Please define "name" as "ConfigCustomBackItUpSet/Components/AdapterExist" in the schema');return}let h=Ut.runningLoads[`${i}!${u}`];if(!(h instanceof Promise)){let d;if(this.props.schema.i18n===!0){const o=i.lastIndexOf("/");let p;o!==-1?p=i.substring(0,o):p=i;const e=j.I18n.getLanguage(),t=`${p}/i18n/${e}.json`;d=fetch(t).then(r=>r.json()).then(r=>j.I18n.extendTranslations(r,e)).catch(r=>{if(e!=="en"){fetch(`${p}/i18n/en.json`).then(l=>l.json()).then(l=>j.I18n.extendTranslations(l,e)).catch(l=>console.log(`Cannot load i18n "${t}": ${l}`));return}console.log(`Cannot load i18n "${t}": ${r}`)})}else if(this.props.schema.i18n&&typeof this.props.schema.i18n=="object")try{j.I18n.extendTranslations(this.props.schema.i18n)}catch(o){console.error(`Cannot import i18n: ${o}`)}try{console.log(i,n,u,a),Pn.registerRemotes([{name:n,entry:i,type:this.props.schema.bundlerType||void 0}]),h=Pn.loadRemote(`${n}/${u}`),d instanceof Promise&&(h=Promise.all([h,d]).then(o=>o[0])),Ut.runningLoads[`${i}!${u}`]=h}catch(o){console.error(o),this.setState({error:`Cannot import from ${this.props.schema.url}: ${o}`})}}try{const d=(await h).default;if(d!=null&&d[a])this.setState({Component:d[a]});else{const o=Object.keys(d||{});console.error("URL is empty. Cannot load custom component!"),this.setState({error:`Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${o.join(", ")}`})}}catch(d){console.error(d),this.setState({error:`Cannot import from ${this.props.schema.url}: ${d}`})}}render(){const i=this.state.Component,n=this.props.schema||{};let u=i?M.createElement(i,{...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?M.createElement("div",null,this.state.error):M.createElement(N.LinearProgress,null);return n.newLine?M.createElement(M.Fragment,null,M.createElement("div",{style:{flexBasis:"100%",height:0}}),u):u}}class js extends K{componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr);this.setState({value:i})}renderItem(i,n){return M.createElement(Hi.DatePicker,{sx:u=>({width:"100%",borderBottom:`1px solid ${u.palette.text.primary}`,"& fieldset":{display:"none"},"& input":{padding:`${u.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:!!n,value:this.state.value,onChange:u=>{this.setState({value:u},()=>this.onChange(this.props.attr,this.state.value))},label:this.getText(this.props.schema.label)})}}class Vs extends K{renderItem(){if(!this.props.schema)return null;if(this.props.oContext.DeviceManager){const n=this.props.oContext.DeviceManager;return M.createElement(n,{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 M.createElement("div",null,"DeviceManager not found")}}const Ke={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}},Us=["jpg","jpeg","svg","png","webp","gif","apng","avif","webp"],Gs=["mp3","ogg","wav","aac"],Ks=["avi","mp4","mov"],Js=["txt","log","html","htm"],Ys=["json","js","ts"];class mn extends K{dropzoneRef;imagePrefix;objectID;path;constructor(i){super(i),this.dropzoneRef=M.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 i=K.getValue(this.props.data,this.props.attr);this.setState({value:i}),this.props.oContext.socket.subscribeFiles(this.objectID,`${this.path}/*`,this.onFolderChanged).catch(n=>console.error(`Cannot subscribe: ${n}`))})}onFolderChanged=(i,n)=>{this.path&&n.startsWith(this.path)&&this.updateFiles().catch(u=>console.error(`Cannot update files: ${u}`))};componentWillUnmount(){this.props.oContext.socket.subscribeFiles(this.objectID,`${this.path}/*`,this.onFolderChanged).catch(i=>console.error(`Cannot subscribe: ${i}`)),super.componentWillUnmount()}async updateFiles(){const i=await this.readFiles(this.props.schema.pattern);await new Promise(n=>this.setState({files:i},n))}async readFolder(i,n,u){try{const v=await this.props.oContext.socket.readDir(this.objectID,i.replace(/^\//,"")||null);for(let a=0;a<v.length;a++){const h=v[a];if(h.isDir)await this.readFolder(`${i+h.file}/`,n,u);else{let d=!1;u==="*.*"&&h.file.includes(".")||!u||u==="*"||u===".*"&&h.file.startsWith(".")?d=!0:d=new RegExp(`^${u.replace(/\./g,"\\.").replace(/\*/g,".*")}$`).test(h.file),d&&n.push({name:i+h.file,size:h.stats?j.Utils.formatBytes(h.stats.size):"--"})}}}catch(v){console.error(`Cannot read "${i}": ${v}`)}return n}async readFiles(i){const n=[];i=i||this.props.schema.pattern,i||(i="**/*.*");let u;const v=i.lastIndexOf("/");if(v===-1?u=i:u=i.substring(v+1),i.startsWith("**"))await this.readFolder("/",n,u);else{const a=i.lastIndexOf("/");if(a===-1)await this.readFolder("/",n,u);else{const h=i.substring(0,a+1);await this.readFolder(h,n,u)}}return n}onDrop(i){const n=i[0],u=new FileReader,v=this.props.schema.maxSize||2*1024*1024;u.onabort=()=>console.log("file reading was aborted"),u.onerror=()=>console.log("file reading has failed"),u.onload=()=>{if(n.size>v){window.alert(j.I18n.t("File is too big. Max %sk allowed. Try use SVG.",Math.round(v/1024)));return}this.props.oContext.socket.writeFile64(this.objectID,this.path+n.name,u.result).then(()=>this.updateFiles()).then(()=>this.setState({value:this.path+n.name},()=>this.onChange(this.props.attr,this.path+n.name))).catch(a=>window.alert(`Cannot upload file: ${a}`))},u.readAsArrayBuffer(n)}renderDeleteDialog(){return this.state.deleteFile?M.createElement(j.DialogConfirm,{title:j.I18n.t("ra_Are you sure?"),text:j.I18n.t("ra_File will be deleted"),ok:j.I18n.t("ra_Delete"),cancel:j.I18n.t("ra_Cancel"),onClose:i=>{const n=this.state.deleteFile;this.setState({deleteFile:""},()=>{i&&this.props.oContext.socket.deleteFile(this.objectID,n).then(()=>this.updateFiles()).catch(u=>window.alert(`Cannot delete file: ${u}`))})}}):null}static base64ToArrayBuffer(i){const n=window.atob(i),u=n.length,v=new Uint8Array(u);for(let a=0;a<u;a++)v[a]=n.charCodeAt(a);return v.buffer}loadFile(){return this.props.oContext.socket.readFile(this.objectID,this.state.value,!0)}play(){this.loadFile().then(i=>{if(typeof AudioContext<"u"){const n=new AudioContext,u=mn.base64ToArrayBuffer(i.file);n.decodeAudioData(u,v=>{const a=n.createBufferSource();a.buffer=v,a.connect(n.destination),a.start(0)},v=>window.alert(`Cannot play: ${v.message}`))}})}getFileIcon(i){return i!=null&&i.extension?Us.includes(i.extension)?M.createElement("div",{style:{...Ke.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.objectID}/${i.value})`,backgroundSize:"contain",backgroundRepeat:"no-repeat"}}):Gs.includes(i.extension)?M.createElement(Z.MusicNote,null):Js.includes(i.extension)?M.createElement(Z.Article,null):Ks.includes(i.extension)?M.createElement(Z.Videocam,null):Ys.includes(i.extension)?M.createElement(Z.Code,null):null:null}renderItem(i,n){if(!this.state.files)return null;const u=[];this.props.schema.withFolder||this.state.files.forEach(e=>{const t=e.name.lastIndexOf("/");if(t===-1)u.includes("/")||u.push("/");else{const r=e.name.substring(0,t+1);u.includes(r)||u.push(r)}});const v=this.state.files.map(e=>({value:e.name,label:!this.props.schema.withFolder&&u.length===1?`${e.name.substring(u[0].length)}`:`${e.name}${this.props.schema.noSize?"":`(${e.size})`}`,extension:e.name.toLowerCase().split(".").pop()}));this.props.schema.noNone||v.unshift({label:j.I18n.t("ra_none"),value:""});const a=v.find(e=>e.value===this.state.value);let h=0;this.props.schema.upload&&h++,this.props.schema.refresh&&h++;const d=this.state.value&&(this.state.value.endsWith(".mp3")||this.state.value.endsWith(".ogg")||this.state.value.endsWith(".wav"));d&&h++;const o=M.createElement("div",{style:Ke.fullWidth},M.createElement(N.FormControl,{variant:"standard",style:{width:`calc(100% - ${h*42}px)`}},this.props.schema.label?M.createElement(N.InputLabel,null,this.getText(this.props.schema.label)):null,M.createElement(N.Select,{variant:"standard",error:!!i,disabled:!!n,value:this.state.value||"_",renderValue:()=>M.createElement(M.Fragment,null,this.getFileIcon(a),M.createElement("span",null,(a==null?void 0:a.label)||"")),onChange:e=>{this.setState({value:e.target.value==="_"?"":e.target.value},()=>this.onChange(this.props.attr,this.state.value))}},v.map(e=>M.createElement(N.MenuItem,{key:e.value,value:e.value},M.createElement(N.ListItemIcon,null,this.getFileIcon(e)),M.createElement(N.ListItemText,null,e.label),this.props.schema.delete&&a.value?M.createElement(N.IconButton,{style:Ke.deleteButton,size:"small",onClick:()=>this.setState({deleteFile:a.value})},M.createElement(Z.Delete,null)):null))),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null),this.props.schema.refresh&&M.createElement(N.IconButton,{onClick:()=>this.updateFiles()},M.createElement(Z.Refresh,null)),this.props.schema.upload&&M.createElement(N.IconButton,{onClick:()=>{var e;return(e=this.dropzoneRef.current)==null?void 0:e.open()}},M.createElement(Z.UploadFile,null)),d&&M.createElement(N.IconButton,{style:{color:"#00FF00"},onClick:()=>this.play()},M.createElement(Z.PlayArrow,null)));if(!this.props.schema.upload)return M.createElement(M.Fragment,null,o,this.renderDeleteDialog());let p={"*/*":[]};if(this.props.schema.fileTypes==="image"?p={"image/*":[".png",".jpg",".svg",".gif",".apng",".avif",".webp"]}:this.props.schema.fileTypes==="audio"?p={"audio/*":[".mp3",".ogg",".wav",".mp4"]}:this.props.schema.fileTypes==="text"&&(p={"text/plain":[".txt"]}),this.props.schema.pattern){const e=this.props.schema.pattern.split("/").pop().toLowerCase().replace(/.*\./,"");e==="png"||e==="jpg"||e==="svg"||e==="gif"||e==="apng"||e==="avif"||e==="webp"?p={"image/*":[".png",".jpg",".svg",".gif",".apng",".avif",".webp"]}:e==="mp3"||e==="ogg"||e==="wav"?p={"audio/*":[".mp3",".ogg",".wav",".mp4"]}:e==="ics"?p={"text/calendar":[".ics"]}:e==="txt"?p={"text/plain":[".txt"]}:e==="pem"?p={"text/plain":[".pem"]}:p={"*/*":[`.${e}`]}}return M.createElement(Wi,{ref:this.dropzoneRef,multiple:!1,accept:p,noKeyboard:!0,noClick:!0,maxSize:this.props.schema.maxSize||2*1024*1024,onDragEnter:()=>{this.setState({uploadFile:"dragging"})},onDragLeave:()=>this.setState({uploadFile:!0}),onDrop:(e,t)=>{var r,l,s;this.setState({uploadFile:!1}),e.length?this.onDrop(e):window.alert(((s=(l=(r=t==null?void 0:t[0])==null?void 0:r.errors)==null?void 0:l[0])==null?void 0:s.message)||j.I18n.t("Cannot upload"))}},({getRootProps:e,getInputProps:t})=>M.createElement("div",{style:{...Ke.uploadDiv,...this.state.uploadFile==="dragging"?Ke.uploadDivDragging:void 0,...n?Ke.disabledOpacity:void 0},...e()},M.createElement("input",{...t()}),this.state.uploadFile==="dragging"?M.createElement("div",{style:{...Ke.uploadCenterDiv,...this.state.uploadError?Ke.error:void 0}},M.createElement("div",{style:Ke.uploadCenterTextAndIcon},M.createElement(Z.UploadFile,{style:Ke.uploadCenterIcon}),M.createElement("div",{style:Ke.uploadCenterText},this.state.uploadFile==="dragging"?j.I18n.t("ra_Drop file here"):j.I18n.t("ra_Place your files here or click here to open the browse dialog")))):null,o,this.renderDeleteDialog()))}}const sn={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}},Qs=["jpg","jpeg","svg","png","webp","gif","apng","avif","webp"],Xs=["mp3","ogg","wav","aac"],Zs=["avi","mp4","mov"],qs=["txt","log","html","htm"],eo=["json","js","ts"];class to extends K{imagePrefix="../..";componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr);this.imagePrefix=this.props.oContext.imagePrefix===void 0?"./files":this.props.oContext.imagePrefix,this.setState({value:i??""})}static getDerivedStateFromProps(i,n){const u=K.getValue(i.data,i.attr);return u==null||u.toString().trim()!==(n.value||"").toString().trim()?{value:u??""}:null}loadFile(){const i=this.state.value.indexOf("/");if(i!==-1){const n=this.state.value.substring(0,i),u=this.state.value.substring(i+1);return this.props.oContext.socket.readFile(n,u,!0)}return Promise.resolve(null)}play(){this.loadFile().then(i=>{if(typeof AudioContext<"u"&&(i!=null&&i.file)){const n=new AudioContext,u=mn.base64ToArrayBuffer(i.file);n.decodeAudioData(u,v=>{const a=n.createBufferSource();a.buffer=v,a.connect(n.destination),a.start(0)},v=>window.alert(`Cannot play: ${v.message}`))}})}getIcon(){const i=this.state.value.split(".").pop().toLowerCase();return Qs.includes(i)?M.createElement("div",{style:{...sn.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.state.value})`,backgroundSize:"contain",backgroundRepeat:"no-repeat"}}):Xs.includes(i)?M.createElement(N.IconButton,{style:{color:"#00FF00"},onClick:()=>this.play()},M.createElement(Z.PlayArrow,null)):qs.includes(i)?M.createElement(Z.Article,null):Zs.includes(i)?M.createElement(Z.Videocam,null):eo.includes(i)?M.createElement(Z.Code,null):null}renderFileBrowser(){return this.state.showFileBrowser?M.createElement(j.DialogSelectFile,{imagePrefix:this.props.oContext.imagePrefix,socket:this.props.oContext.socket,selected:this.state.value,onClose:()=>this.setState({showFileBrowser:!1}),onOk:i=>{const n=Array.isArray(i)?i[0]:i;this.setState({value:n},()=>this.onChange(this.props.attr,this.props.schema.trim===!1?n:(n||"").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(i,n){const u=this.getIcon();return M.createElement("div",{style:sn.fullWidth},u,M.createElement(N.TextField,{variant:"standard",style:u?sn.fullWidthIcon:sn.fullWidthOneButton,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!i,disabled:!!n,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:!!this.props.schema.disableEdit}},onChange:v=>{const a=v.target.value;this.setState({value:a},()=>this.onChange(this.props.attr,this.props.schema.trim===!1?a:(a||"").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)}),M.createElement(N.Button,{disabled:n,variant:"outlined",onClick:()=>this.setState({showFileBrowser:!0})},"..."),this.renderFileBrowser())}}class no extends K{componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums("functions").then(n=>{const u=Object.keys(n).map(v=>({value:this.props.schema.short?v.replace("enum.functions.",""):v,label:this.getText(n[v].common.name),obj:n[v]}));this.props.schema.allowDeactivate!==!1&&u.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.setState({value:i,selectOptions:u})})}renderItem(i,n){if(!this.state.selectOptions)return null;const u=this.state.selectOptions.find(v=>v.value===this.state.value);return M.createElement(N.FormControl,{variant:"standard",fullWidth:!0},this.props.schema.label?M.createElement(N.InputLabel,null,this.getText(this.props.schema.label)):null,M.createElement(N.Select,{variant:"standard",error:!!i,disabled:!!n,value:this.state.value||"_",renderValue:()=>u?u.obj?M.createElement(j.TextWithIcon,{value:u.obj,themeType:this.props.oContext.themeType,lang:j.I18n.getLanguage()}):u.label:"",onChange:v=>{this.setState({value:v.target.value==="_"?"":v.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(v=>M.createElement(N.MenuItem,{key:v.value,value:v.value,style:v.value===K.DIFFERENT_VALUE?{opacity:.5}:{}},v.obj?M.createElement(j.TextWithIcon,{value:v.obj,themeType:this.props.oContext.themeType,lang:j.I18n.getLanguage()}):v.label))),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class io extends K{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getHostByIp(this.props.common.host).then(i=>{this.props.schema.listenOnAllPorts||(i=i.filter(n=>n.address!=="0.0.0.0"&&n.address!=="::")),this.props.schema.onlyIp4?i=i.filter(n=>n.family==="ipv4"):this.props.schema.onlyIp6&&(i=i.filter(n=>n.family==="ipv6")),this.props.schema.noInternal&&(i=i.filter(n=>!n.internal)),i.forEach(n=>{n.address==="0.0.0.0"?n.name=`[IPv4] 0.0.0.0 - ${j.I18n.t("ra_Listen on all IPs")}`:n.address==="::"&&(n.name=`[IPv6] :: - ${j.I18n.t("ra_Listen on all IPs")}`)}),this.setState({ips:i})}).catch(i=>console.error(i))}renderItem(i,n){var a,h;const u=K.getValue(this.props.data,this.props.attr),v=(a=this.state.ips)==null?void 0:a.find(d=>d.address===u);return M.createElement(N.FormControl,{fullWidth:!0,variant:"standard"},this.state.ips&&this.props.schema.label?M.createElement(N.InputLabel,null,this.getText(this.props.schema.label)):null,this.state.ips?M.createElement(N.Select,{variant:"standard",error:!!i,disabled:!!n,value:u,renderValue:d=>(v==null?void 0:v.name)||d,onChange:d=>this.onChange(this.props.attr,d.target.value)},(h=this.state.ips)==null?void 0:h.map((d,o)=>M.createElement(N.MenuItem,{key:o,value:d.address},d.name))):M.createElement(N.TextField,{fullWidth:!0,variant:"standard",error:!!i,disabled:!!n,value:u,onChange:d=>this.onChange(this.props.attr,d.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class ro extends K{initialized=!1;localContext;componentDidMount(){super.componentDidMount(),this.askInstance()}askInstance(){if(this.props.alive){let i=this.props.schema.data;if(i===void 0&&this.props.schema.jsonData){const n=this.getPattern(this.props.schema.jsonData,null,!0);if(n)try{i=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${JSON.stringify(i)}`)}}i===void 0&&(i=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",i).then(n=>this.setState({image:n||""}))}}getContext(){const i={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(n=>i[n]=K.getValue(this.props.data,n)),JSON.stringify(i)}renderItem(){if(this.props.alive){const i=this.getContext();(i!==this.localContext||!this.initialized)&&(this.localContext=i,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}return this.state.image===void 0?null:M.createElement("img",{alt:"dynamic content",src:this.state.image,style:{width:this.props.schema.width||"100%",height:this.props.schema.height}})}}class so extends K{index;constructor(i){super(i),this.index=Date.now()}componentDidMount(){if(super.componentDidMount(),this.props.schema.base64){const i=K.getValue(this.props.data,this.props.attr);this.setState({value:i})}else this.props.oContext.socket.fileExists(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr).then(i=>i&&this.loadImage())}_getUrl(i){i&&(this.index=Date.now());let n=`files/${this.props.oContext.adapterName}.${this.props.oContext.instance}/${this.props.attr}?t=${this.index}`;return window.location.port==="3000"&&(n=`${window.location.protocol}//${window.location.hostname}:8081/${n}`),n}loadImage(){fetch(this._getUrl()).then(i=>i.blob()).then(i=>{const n=new FileReader;n.onload=()=>{this.setState({value:n.result})},n.readAsDataURL(i)}).catch(i=>console.error(i))}renderItem(i,n){return M.createElement(N.FormControl,{fullWidth:!0,variant:"standard"},this.props.schema.label?M.createElement(N.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,M.createElement(j.UploadImage,{error:!!i,disabled:n,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 u=this.onChange(this.props.attr,this.state.value);u instanceof Promise&&u.catch(v=>console.error(`Cannot set value: ${v}`))}else this.props.oContext.socket.deleteFile(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr).catch(u=>console.error(u))}),onChange:u=>this.setState({value:u},()=>{if(this.props.schema.base64){const v=this.onChange(this.props.attr,this.state.value);v instanceof Promise&&v.catch(a=>console.error(`Cannot set value: ${a}`))}else u.startsWith("data")&&(u=u.split(",")[1]);this.props.oContext.socket.writeFile64(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr,u).catch(v=>console.error(v))})}),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const gi={icon:{width:20,height:20,marginRight:4}};class oo extends K{componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr);let n=this.props.schema.adapter;n==="_dataSources"&&(n=void 0),this.props.oContext.socket.getAdapterInstances(n,!0).then(async u=>{this.props.schema.adapter==="_dataSources"?u=u.filter(a=>{var h;return(h=a==null?void 0:a.common)==null?void 0:h.getHistory}):this.props.schema.adapter?u=u.filter(a=>a==null?void 0:a._id.startsWith(`system.adapter.${this.props.schema.adapter}.`)):this.props.schema.adapters&&Array.isArray(this.props.schema.adapters)&&(u=u.filter(a=>{var h;return this.props.schema.adapters.includes((h=a==null?void 0:a.common)==null?void 0:h.name)})),this.props.schema.onlyEnabled&&(u=u.filter(a=>{var h;return(h=a==null?void 0:a.common)==null?void 0:h.enabled}));const v=u.map(a=>({value:this.props.schema.long?a._id:this.props.schema.short?a._id.split(".").pop():a._id.replace(/^system\.adapter\./,""),label:`${a.common.name} [${a._id.replace(/^system\.adapter\./,"")}]`,icon:`adapter/${a.common.name}/${a.common.icon}`}));v.sort((a,h)=>a.value>h.value?1:a.value<h.value?-1:0),this.props.schema.allowDeactivate!==!1&&v.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.props.schema.all&&v.unshift({label:j.I18n.t("sch_all"),value:"*"}),this.setState({value:i||"",selectOptions:v}),await this.props.oContext.socket.subscribeObject(`system.adapter.${n?`${n}.`:""}*`,this.onInstancesUpdate)}).catch(u=>console.error(`Cannot get instances: ${u}`))}componentWillUnmount(){this.props.oContext.socket.unsubscribeObject("system.adapter.*",this.onInstancesUpdate).then(()=>{}),super.componentWillUnmount()}onInstancesUpdate=(i,n)=>{if(!i.match(/^system\.adapter\.[-_a-z\d]+\.\d+$/))return;const u=this.props.schema.long?i:this.props.schema.short?i.split(".").pop():i.replace(/^system\.adapter\./,""),v=this.state.selectOptions.findIndex(a=>a.value===u);if(n){if(this.props.schema.adapter==="_dataSources"&&(!n.common||!n.common.getHistory))return;if(v===-1){const a=JSON.parse(JSON.stringify(this.state.selectOptions)),h=typeof n.common.name=="object"?n.common.name[j.I18n.getLanguage()]||n.common.name.en:n.common.name;a.push({value:this.props.schema.long?n._id:this.props.schema.short?n._id.split(".").pop():n._id.replace(/^system\.adapter\./,""),label:`${h} [${n._id.replace(/^system\.adapter\./,"")}]`,icon:`adapter/${h}/${n.common.icon}`}),a.sort((d,o)=>d.label>o.label?1:d.label<o.label?-1:0),this.setState({selectOptions:a})}}else if(v!==-1){const a=JSON.parse(JSON.stringify(this.state.selectOptions)),h={};this.state.value===a[v].value&&(h.value=K.NONE_VALUE),a.splice(v,1),h.selectOptions=a,this.setState(h)}};renderItem(i,n){var v;if(!this.state.selectOptions)return null;const u=(v=this.state.selectOptions)==null?void 0:v.find(a=>a.value===this.state.value);return M.createElement(N.FormControl,{fullWidth:!0,key:this.props.attr,variant:"standard"},this.props.schema.label?M.createElement(N.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,M.createElement(N.Select,{variant:"standard",error:!!i,displayEmpty:!0,disabled:!!n,value:this.state.value,renderValue:()=>M.createElement("span",{style:{display:"flex"}},u!=null&&u.icon?M.createElement("img",{src:`./${u.icon}`,alt:u.value,style:gi.icon}):null,this.getText(u==null?void 0:u.label,!0)),onChange:a=>this.setState({value:a.target.value},()=>this.onChange(this.props.attr,this.state.value))},this.state.selectOptions.map(a=>M.createElement(N.MenuItem,{key:a.value,value:a.value,style:a.value===K.NONE_VALUE?{opacity:.5}:{}},a.icon?M.createElement("img",{src:`./${a.icon}`,alt:a.value,style:gi.icon}):null,this.getText(a.label,!0)))),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const mi={address:{fontSize:"smaller",opacity:.5,marginLeft:8}};class ao extends K{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getObject(`system.host.${this.props.common.host}`).then(i=>{var u,v;const n=[];if((v=(u=i==null?void 0:i.native)==null?void 0:u.hardware)!=null&&v.networkInterfaces){const a=i.native.hardware.networkInterfaces;Object.keys(a).forEach(h=>{if(this.props.schema.ignoreInternal&&!a[h].find(o=>!o.internal)||this.props.schema.ignoreLoopback&&a[h].find(o=>o.address==="127.0.0.1"||o.address==="::1"))return;let d=a[h].find(o=>o.family==="IPv4");d=d||a[h].find(o=>o.family==="IPv6"),n.push({value:h,address:d.address})})}this.setState({interfaces:n})}).catch(i=>window.alert(`Cannot read interfaces: ${i}`))}renderItem(i,n){var a,h,d;const u=K.getValue(this.props.data,this.props.attr),v=(a=this.state.interfaces)==null?void 0:a.find(o=>o.value===u);return M.createElement(N.FormControl,{fullWidth:!0,variant:"standard"},(h=this.state.interfaces)!=null&&h.length&&this.props.schema.label?M.createElement(N.InputLabel,null,this.getText(this.props.schema.label)):null,(d=this.state.interfaces)!=null&&d.length?M.createElement(N.Select,{variant:"standard",error:!!i,disabled:!!n,value:u,renderValue:o=>v?M.createElement("span",null,v.value,M.createElement("span",{style:mi.address},v.address)):o,onChange:o=>this.onChange(this.props.attr,o.target.value)},this.state.interfaces.map((o,p)=>M.createElement(N.MenuItem,{key:p,value:o.value},M.createElement("span",null,o.value,M.createElement("span",{style:mi.address},o.address))))):M.createElement(N.TextField,{fullWidth:!0,variant:"standard",error:!!i,disabled:!!n,value:u,onChange:o=>this.onChange(this.props.attr,o.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const kt={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"}},lo=({toggleTranslation:L,noTranslation:i,title:n,fullWidth:u,help:v,maxWidth:a,progress:h,icon:d,applyDisabled:o,applyButton:p,onClose:e,children:t,titleButtonApply:r,titleButtonClose:l,onApply:s,textInput:c,defaultValue:f,overflowHidden:m})=>{const[y,D]=pt.useState(f);pt.useEffect(()=>{D(f)},[f]);let E=null;return d&&(E=d),M.createElement(N.Dialog,{open:!0,maxWidth:a||"md",fullWidth:!!u,disableEscapeKeyDown:!1,onClose:e,sx:{"& .MuiPaper-root":kt.modalDialog}},n&&M.createElement(N.DialogTitle,null,d?M.createElement(E,{style:kt.titleIcon}):null,n,j.I18n.getLanguage()!=="en"&&L?M.createElement(N.IconButton,{size:"large",style:{...kt.languageButton,...i?kt.languageButtonActive:{}},onClick:()=>L(),title:j.I18n.t("Disable/Enable translation")},M.createElement(Z.Language,null)):null),M.createElement(N.DialogContent,{sx:{...m?kt.overflowHidden:{},...kt.content},style:{paddingTop:8}},c&&M.createElement(N.TextField,{autoComplete:"off",fullWidth:!0,autoFocus:!0,variant:"outlined",size:"medium",multiline:!0,value:y,onChange:b=>D(b.target.value)}),t,v?M.createElement("div",null,v):null),M.createElement(N.DialogActions,null,p!==!1&&M.createElement(N.Button,{startIcon:M.createElement(Z.Check,null),disabled:h||o&&f===y,onClick:()=>s&&s(c?y:""),variant:"contained",color:"primary"},j.I18n.t(r||"Ok")),M.createElement(N.Button,{color:"grey",onClick:()=>e&&e(),disabled:h,variant:"contained",startIcon:M.createElement(Z.Close,null)},j.I18n.t(l||"Cancel"))))};var It={},Dt={},Ui={exports:{}};(function(L,i){(function(){var n="ace",u=function(){return this}();!u&&typeof window<"u"&&(u=window);var v=function(e,t,r){if(typeof e!="string"){v.original?v.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(r=t),v.modules[e]||(v.payloads[e]=r,v.modules[e]=null)};v.modules={},v.payloads={};var a=function(e,t,r){if(typeof t=="string"){var l=o(e,t);if(l!=null)return r&&r(),l}else if(Object.prototype.toString.call(t)==="[object Array]"){for(var s=[],c=0,f=t.length;c<f;++c){var m=o(e,t[c]);if(m==null&&h.original)return;s.push(m)}return r&&r.apply(null,s)||!0}},h=function(e,t){var r=a("",e,t);return r==null&&h.original?h.original.apply(this,arguments):r},d=function(e,t){if(t.indexOf("!")!==-1){var r=t.split("!");return d(e,r[0])+"!"+d(e,r[1])}if(t.charAt(0)=="."){var l=e.split("/").slice(0,-1).join("/");for(t=l+"/"+t;t.indexOf(".")!==-1&&s!=t;){var s=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},o=function(e,t){t=d(e,t);var r=v.modules[t];if(!r){if(r=v.payloads[t],typeof r=="function"){var l={},s={id:t,uri:"",exports:l,packaged:!0},c=function(m,y){return a(t,m,y)},f=r(c,l,s);l=f||s.exports,v.modules[t]=l,delete v.payloads[t]}r=v.modules[t]=l||r}return r};function p(e){var t=u;u[e]||(u[e]={}),t=u[e],(!t.define||!t.define.packaged)&&(v.original=t.define,t.define=v,t.define.packaged=!0),(!t.require||!t.require.packaged)&&(h.original=t.require,t.require=h,t.require.packaged=!0)}p(n)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(n,u,v){function a(h,d,o){Object.defineProperty(h,d,{value:o,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||a(String.prototype,"startsWith",function(h,d){return d=d||0,this.lastIndexOf(h,d)===d}),String.prototype.endsWith||a(String.prototype,"endsWith",function(h,d){var o=this;(d===void 0||d>o.length)&&(d=o.length),d-=h.length;var p=o.indexOf(h,d);return p!==-1&&p===d}),String.prototype.repeat||a(String.prototype,"repeat",function(h){for(var d="",o=this;h>0;)h&1&&(d+=o),(h>>=1)&&(o+=o);return d}),String.prototype.includes||a(String.prototype,"includes",function(h,d){return this.indexOf(h,d)!=-1}),Object.assign||(Object.assign=function(h){if(h==null)throw new TypeError("Cannot convert undefined or null to object");for(var d=Object(h),o=1;o<arguments.length;o++){var p=arguments[o];p!=null&&Object.keys(p).forEach(function(e){d[e]=p[e]})}return d}),Object.values||(Object.values=function(h){return Object.keys(h).map(function(d){return h[d]})}),Array.prototype.find||a(Array.prototype,"find",function(h){for(var d=this.length,o=arguments[1],p=0;p<d;p++){var e=this[p];if(h.call(o,e,p,this))return e}}),Array.prototype.findIndex||a(Array.prototype,"findIndex",function(h){for(var d=this.length,o=arguments[1],p=0;p<d;p++){var e=this[p];if(h.call(o,e,p,this))return p}}),Array.prototype.includes||a(Array.prototype,"includes",function(h,d){return this.indexOf(h,d)!=-1}),Array.prototype.fill||a(Array.prototype,"fill",function(h){for(var d=this,o=d.length>>>0,p=arguments[1],e=p>>0,t=e<0?Math.max(o+e,0):Math.min(e,o),r=arguments[2],l=r===void 0?o:r>>0,s=l<0?Math.max(o+l,0):Math.min(l,o);t<s;)d[t]=h,t++;return d}),Array.of||a(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(n,u,v){n("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(n,u,v){u.deepCopy=function a(h){if(typeof h!="object"||!h)return h;var d;if(Array.isArray(h)){d=[];for(var o=0;o<h.length;o++)d[o]=a(h[o]);return d}if(Object.prototype.toString.call(h)!=="[object Object]")return h;d={};for(var o in h)d[o]=a(h[o]);return d}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(n,u,v){u.last=function(d){return d[d.length-1]},u.stringReverse=function(d){return d.split("").reverse().join("")},u.stringRepeat=function(d,o){for(var p="";o>0;)o&1&&(p+=d),(o>>=1)&&(d+=d);return p};var a=/^\s\s*/,h=/\s\s*$/;u.stringTrimLeft=function(d){return d.replace(a,"")},u.stringTrimRight=function(d){return d.replace(h,"")},u.copyObject=function(d){var o={};for(var p in d)o[p]=d[p];return o},u.copyArray=function(d){for(var o=[],p=0,e=d.length;p<e;p++)d[p]&&typeof d[p]=="object"?o[p]=this.copyObject(d[p]):o[p]=d[p];return o},u.deepCopy=n("./deep_copy").deepCopy,u.arrayToMap=function(d){for(var o={},p=0;p<d.length;p++)o[d[p]]=1;return o},u.createMap=function(d){var o=Object.create(null);for(var p in d)o[p]=d[p];return o},u.arrayRemove=function(d,o){for(var p=0;p<=d.length;p++)o===d[p]&&d.splice(p,1)},u.escapeRegExp=function(d){return d.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},u.escapeHTML=function(d){return(""+d).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},u.getMatchOffsets=function(d,o){var p=[];return d.replace(o,function(e){p.push({offset:arguments[arguments.length-2],length:e.length})}),p},u.deferredCall=function(d){var o=null,p=function(){o=null,d()},e=function(t){return e.cancel(),o=setTimeout(p,t||0),e};return e.schedule=e,e.call=function(){return this.cancel(),d(),e},e.cancel=function(){return clearTimeout(o),o=null,e},e.isPending=function(){return o},e},u.delayedCall=function(d,o){var p=null,e=function(){p=null,d()},t=function(r){p==null&&(p=setTimeout(e,r||o))};return t.delay=function(r){p&&clearTimeout(p),p=setTimeout(e,r||o)},t.schedule=t,t.call=function(){this.cancel(),d()},t.cancel=function(){p&&clearTimeout(p),p=null},t.isPending=function(){return p},t},u.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},u.skipEmptyMatch=function(d,o,p){return p&&d.codePointAt(o)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(n,u,v){u.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},u.getOS=function(){return u.isMac?u.OS.MAC:u.isLinux?u.OS.LINUX:u.OS.WINDOWS};var a=typeof navigator=="object"?navigator:{},h=(/mac|win|linux/i.exec(a.platform)||["other"])[0].toLowerCase(),d=a.userAgent||"",o=a.appName||"";u.isWin=h=="win",u.isMac=h=="mac",u.isLinux=h=="linux",u.isIE=o=="Microsoft Internet Explorer"||o.indexOf("MSAppHost")>=0?parseFloat((d.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((d.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),u.isOldIE=u.isIE&&u.isIE<9,u.isGecko=u.isMozilla=d.match(/ Gecko\/\d+/),u.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",u.isWebKit=parseFloat(d.split("WebKit/")[1])||void 0,u.isChrome=parseFloat(d.split(" Chrome/")[1])||void 0,u.isSafari=parseFloat(d.split(" Safari/")[1])&&!u.isChrome||void 0,u.isEdge=parseFloat(d.split(" Edge/")[1])||void 0,u.isAIR=d.indexOf("AdobeAIR")>=0,u.isAndroid=d.indexOf("Android")>=0,u.isChromeOS=d.indexOf(" CrOS ")>=0,u.isIOS=/iPad|iPhone|iPod/.test(d)&&!window.MSStream,u.isIOS&&(u.isMac=!0),u.isMobile=u.isIOS||u.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(n,u,v){var a=n("./useragent"),h="http://www.w3.org/1999/xhtml";u.buildDom=function r(l,s,c){if(typeof l=="string"&&l){var f=document.createTextNode(l);return s&&s.appendChild(f),f}if(!Array.isArray(l))return l&&l.appendChild&&s&&s.appendChild(l),l;if(typeof l[0]!="string"||!l[0]){for(var m=[],y=0;y<l.length;y++){var D=r(l[y],s,c);D&&m.push(D)}return m}var E=document.createElement(l[0]),b=l[1],g=1;b&&typeof b=="object"&&!Array.isArray(b)&&(g=2);for(var y=g;y<l.length;y++)r(l[y],E,c);return g==2&&Object.keys(b).forEach(function(S){var T=b[S];S==="class"?E.className=Array.isArray(T)?T.join(" "):T:typeof T=="function"||S=="value"||S[0]=="$"?E[S]=T:S==="ref"?c&&(c[T]=E):S==="style"?typeof T=="string"&&(E.style.cssText=T):T!=null&&E.setAttribute(S,T)}),s&&s.appendChild(E),E},u.getDocumentHead=function(r){return r||(r=document),r.head||r.getElementsByTagName("head")[0]||r.documentElement},u.createElement=function(r,l){return document.createElementNS?document.createElementNS(l||h,r):document.createElement(r)},u.removeChildren=function(r){r.innerHTML=""},u.createTextNode=function(r,l){var s=l?l.ownerDocument:document;return s.createTextNode(r)},u.createFragment=function(r){var l=r?r.ownerDocument:document;return l.createDocumentFragment()},u.hasCssClass=function(r,l){var s=(r.className+"").split(/\s+/g);return s.indexOf(l)!==-1},u.addCssClass=function(r,l){u.hasCssClass(r,l)||(r.className+=" "+l)},u.removeCssClass=function(r,l){for(var s=r.className.split(/\s+/g);;){var c=s.indexOf(l);if(c==-1)break;s.splice(c,1)}r.className=s.join(" ")},u.toggleCssClass=function(r,l){for(var s=r.className.split(/\s+/g),c=!0;;){var f=s.indexOf(l);if(f==-1)break;c=!1,s.splice(f,1)}return c&&s.push(l),r.className=s.join(" "),c},u.setCssClass=function(r,l,s){s?u.addCssClass(r,l):u.removeCssClass(r,l)},u.hasCssString=function(r,l){var s=0,c;if(l=l||document,c=l.querySelectorAll("style")){for(;s<c.length;)if(c[s++].id===r)return!0}},u.removeElementById=function(r,l){l=l||document,l.getElementById(r)&&l.getElementById(r).remove()};var d,o=[];u.useStrictCSP=function(r){d=r,r==!1?p():o||(o=[])};function p(){var r=o;o=null,r&&r.forEach(function(l){e(l[0],l[1])})}function e(r,l,s){if(!(typeof document>"u")){if(o){if(s)p();else if(s===!1)return o.push([r,l])}if(!d){var c=s;!s||!s.getRootNode?c=document:(c=s.getRootNode(),(!c||c==s)&&(c=document));var f=c.ownerDocument||c;if(l&&u.hasCssString(l,c))return null;l&&(r+=`
16
- /*# sourceURL=ace/css/`+l+" */");var m=u.createElement("style");m.appendChild(f.createTextNode(r)),l&&(m.id=l),c==f&&(c=u.getDocumentHead(f)),c.insertBefore(m,c.firstChild)}}}if(u.importCssString=e,u.importCssStylsheet=function(r,l){u.buildDom(["link",{rel:"stylesheet",href:r}],u.getDocumentHead(l))},u.scrollbarWidth=function(r){var l=u.createElement("ace_inner");l.style.width="100%",l.style.minWidth="0px",l.style.height="200px",l.style.display="block";var s=u.createElement("ace_outer"),c=s.style;c.position="absolute",c.left="-10000px",c.overflow="hidden",c.width="200px",c.minWidth="0px",c.height="150px",c.display="block",s.appendChild(l);var f=r&&r.documentElement||document&&document.documentElement;if(!f)return 0;f.appendChild(s);var m=l.offsetWidth;c.overflow="scroll";var y=l.offsetWidth;return m===y&&(y=s.clientWidth),f.removeChild(s),m-y},u.computedStyle=function(r,l){return window.getComputedStyle(r,"")||{}},u.setStyle=function(r,l,s){r[l]!==s&&(r[l]=s)},u.HAS_CSS_ANIMATION=!1,u.HAS_CSS_TRANSFORMS=!1,u.HI_DPI=a.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,a.isChromeOS&&(u.HI_DPI=!1),typeof document<"u"){var t=document.createElement("div");u.HI_DPI&&t.style.transform!==void 0&&(u.HAS_CSS_TRANSFORMS=!0),!a.isEdge&&typeof t.style.animationName<"u"&&(u.HAS_CSS_ANIMATION=!0),t=null}u.HAS_CSS_TRANSFORMS?u.translate=function(r,l,s){r.style.transform="translate("+Math.round(l)+"px, "+Math.round(s)+"px)"}:u.translate=function(r,l,s){r.style.top=Math.round(s)+"px",r.style.left=Math.round(l)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(n,u,v){/*
17
- * based on code from:
18
- *
19
- * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
20
- * Available via the MIT or new BSD license.
21
- * see: http://github.com/jrburke/requirejs for details
22
- */var a=n("./dom");u.get=function(h,d){var o=new XMLHttpRequest;o.open("GET",h,!0),o.onreadystatechange=function(){o.readyState===4&&d(o.responseText)},o.send(null)},u.loadScript=function(h,d){var o=a.getDocumentHead(),p=document.createElement("script");p.src=h,o.appendChild(p),p.onload=p.onreadystatechange=function(e,t){(t||!p.readyState||p.readyState=="loaded"||p.readyState=="complete")&&(p=p.onload=p.onreadystatechange=null,t||d())}},u.qualifyURL=function(h){var d=document.createElement("a");return d.href=h,d.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(n,u,v){u.inherits=function(a,h){a.super_=h,a.prototype=Object.create(h.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})},u.mixin=function(a,h){for(var d in h)a[d]=h[d];return a},u.implement=function(a,h){u.mixin(a,h)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(n,u,v){var a={},h=function(){this.propagationStopped=!0},d=function(){this.defaultPrevented=!0};a._emit=a._dispatchEvent=function(o,p){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var e=this._eventRegistry[o]||[],t=this._defaultHandlers[o];if(!(!e.length&&!t)){(typeof p!="object"||!p)&&(p={}),p.type||(p.type=o),p.stopPropagation||(p.stopPropagation=h),p.preventDefault||(p.preventDefault=d),e=e.slice();for(var r=0;r<e.length&&(e[r](p,this),!p.propagationStopped);r++);if(t&&!p.defaultPrevented)return t(p,this)}},a._signal=function(o,p){var e=(this._eventRegistry||{})[o];if(e){e=e.slice();for(var t=0;t<e.length;t++)e[t](p,this)}},a.once=function(o,p){var e=this;if(this.on(o,function t(){e.off(o,t),p.apply(null,arguments)}),!p)return new Promise(function(t){p=t})},a.setDefaultHandler=function(o,p){var e=this._defaultHandlers;if(e||(e=this._defaultHandlers={_disabled_:{}}),e[o]){var t=e[o],r=e._disabled_[o];r||(e._disabled_[o]=r=[]),r.push(t);var l=r.indexOf(p);l!=-1&&r.splice(l,1)}e[o]=p},a.removeDefaultHandler=function(o,p){var e=this._defaultHandlers;if(e){var t=e._disabled_[o];if(e[o]==p)t&&this.setDefaultHandler(o,t.pop());else if(t){var r=t.indexOf(p);r!=-1&&t.splice(r,1)}}},a.on=a.addEventListener=function(o,p,e){this._eventRegistry=this._eventRegistry||{};var t=this._eventRegistry[o];return t||(t=this._eventRegistry[o]=[]),t.indexOf(p)==-1&&t[e?"unshift":"push"](p),p},a.off=a.removeListener=a.removeEventListener=function(o,p){this._eventRegistry=this._eventRegistry||{};var e=this._eventRegistry[o];if(e){var t=e.indexOf(p);t!==-1&&e.splice(t,1)}},a.removeAllListeners=function(o){o||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[o]=void 0),this._defaultHandlers&&(this._defaultHandlers[o]=void 0)},u.EventEmitter=a}),ace.define("ace/lib/report_error",["require","exports","module"],function(n,u,v){u.reportError=function(h,d){var o=new Error(h);o.data=d,typeof console=="object"&&console.error&&console.error(o),setTimeout(function(){throw o})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(n,u,v){var a={"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"};u.defaultEnglishMessages=a}),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(n,u,v){"no use strict";var a=n("./oop"),h=n("./event_emitter").EventEmitter,d=n("./report_error").reportError,o=n("./default_english_messages").defaultEnglishMessages,p={setOptions:function(s){Object.keys(s).forEach(function(c){this.setOption(c,s[c])},this)},getOptions:function(s){var c={};if(s)Array.isArray(s)||(c=s,s=Object.keys(c));else{var f=this.$options;s=Object.keys(f).filter(function(m){return!f[m].hidden})}return s.forEach(function(m){c[m]=this.getOption(m)},this),c},setOption:function(s,c){if(this["$"+s]!==c){var f=this.$options[s];if(!f)return e('misspelled option "'+s+'"');if(f.forwardTo)return this[f.forwardTo]&&this[f.forwardTo].setOption(s,c);f.handlesSet||(this["$"+s]=c),f&&f.set&&f.set.call(this,c)}},getOption:function(s){var c=this.$options[s];return c?c.forwardTo?this[c.forwardTo]&&this[c.forwardTo].getOption(s):c&&c.get?c.get.call(this):this["$"+s]:e('misspelled option "'+s+'"')}};function e(s){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var t,r,l=function(){function s(){this.$defaultOptions={},t=o,r="dollarSigns"}return s.prototype.defineOptions=function(c,f,m){return c.$options||(this.$defaultOptions[f]=c.$options={}),Object.keys(m).forEach(function(y){var D=m[y];typeof D=="string"&&(D={forwardTo:D}),D.name||(D.name=y),c.$options[D.name]=D,"initialValue"in D&&(c["$"+D.name]=D.initialValue)}),a.implement(c,p),this},s.prototype.resetOptions=function(c){Object.keys(c.$options).forEach(function(f){var m=c.$options[f];"value"in m&&c.setOption(f,m.value)})},s.prototype.setDefaultValue=function(c,f,m){if(!c){for(c in this.$defaultOptions)if(this.$defaultOptions[c][f])break;if(!this.$defaultOptions[c][f])return!1}var y=this.$defaultOptions[c]||(this.$defaultOptions[c]={});y[f]&&(y.forwardTo?this.setDefaultValue(y.forwardTo,f,m):y[f].value=m)},s.prototype.setDefaultValues=function(c,f){Object.keys(f).forEach(function(m){this.setDefaultValue(c,m,f[m])},this)},s.prototype.setMessages=function(c,f){t=c,f&&f.placeholders&&(r=f.placeholders)},s.prototype.nls=function(c,f,m){t[c]||(e("No message found for the key '"+c+"' in messages with id "+t.$id+", trying to find a translation for the default string '"+f+"'."),t[f]||e("No message found for the default string '"+f+"' in the provided messages. Falling back to the default English message."));var y=t[c]||t[f]||f;return m&&(r==="dollarSigns"&&(y=y.replace(/\$(\$|[\d]+)/g,function(D,E){return E=="$"?"$":m[E]})),r==="curlyBrackets"&&(y=y.replace(/\{([^\}]+)\}/g,function(D,E){return m[E]}))),y},s}();l.prototype.warn=e,l.prototype.reportError=d,a.implement(l.prototype,h),u.AppConfig=l}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(n,u,v){v.exports=`.ace-tm .ace_gutter {
23
- background: #f0f0f0;
24
- color: #333;
25
- }
26
-
27
- .ace-tm .ace_print-margin {
28
- width: 1px;
29
- background: #e8e8e8;
30
- }
31
-
32
- .ace-tm .ace_fold {
33
- background-color: #6B72E6;
34
- }
35
-
36
- .ace-tm {
37
- background-color: #FFFFFF;
38
- color: black;
39
- }
40
-
41
- .ace-tm .ace_cursor {
42
- color: black;
43
- }
44
-
45
- .ace-tm .ace_invisible {
46
- color: rgb(191, 191, 191);
47
- }
48
-
49
- .ace-tm .ace_storage,
50
- .ace-tm .ace_keyword {
51
- color: blue;
52
- }
53
-
54
- .ace-tm .ace_constant {
55
- color: rgb(197, 6, 11);
56
- }
57
-
58
- .ace-tm .ace_constant.ace_buildin {
59
- color: rgb(88, 72, 246);
60
- }
61
-
62
- .ace-tm .ace_constant.ace_language {
63
- color: rgb(88, 92, 246);
64
- }
65
-
66
- .ace-tm .ace_constant.ace_library {
67
- color: rgb(6, 150, 14);
68
- }
69
-
70
- .ace-tm .ace_invalid {
71
- background-color: rgba(255, 0, 0, 0.1);
72
- color: red;
73
- }
74
-
75
- .ace-tm .ace_support.ace_function {
76
- color: rgb(60, 76, 114);
77
- }
78
-
79
- .ace-tm .ace_support.ace_constant {
80
- color: rgb(6, 150, 14);
81
- }
82
-
83
- .ace-tm .ace_support.ace_type,
84
- .ace-tm .ace_support.ace_class {
85
- color: rgb(109, 121, 222);
86
- }
87
-
88
- .ace-tm .ace_keyword.ace_operator {
89
- color: rgb(104, 118, 135);
90
- }
91
-
92
- .ace-tm .ace_string {
93
- color: rgb(3, 106, 7);
94
- }
95
-
96
- .ace-tm .ace_comment {
97
- color: rgb(76, 136, 107);
98
- }
99
-
100
- .ace-tm .ace_comment.ace_doc {
101
- color: rgb(0, 102, 255);
102
- }
103
-
104
- .ace-tm .ace_comment.ace_doc.ace_tag {
105
- color: rgb(128, 159, 191);
106
- }
107
-
108
- .ace-tm .ace_constant.ace_numeric {
109
- color: rgb(0, 0, 205);
110
- }
111
-
112
- .ace-tm .ace_variable {
113
- color: rgb(49, 132, 149);
114
- }
115
-
116
- .ace-tm .ace_xml-pe {
117
- color: rgb(104, 104, 91);
118
- }
119
-
120
- .ace-tm .ace_entity.ace_name.ace_function {
121
- color: #0000A2;
122
- }
123
-
124
-
125
- .ace-tm .ace_heading {
126
- color: rgb(12, 7, 255);
127
- }
128
-
129
- .ace-tm .ace_list {
130
- color:rgb(185, 6, 144);
131
- }
132
-
133
- .ace-tm .ace_meta.ace_tag {
134
- color:rgb(0, 22, 142);
135
- }
136
-
137
- .ace-tm .ace_string.ace_regex {
138
- color: rgb(255, 0, 0)
139
- }
140
-
141
- .ace-tm .ace_marker-layer .ace_selection {
142
- background: rgb(181, 213, 255);
143
- }
144
- .ace-tm.ace_multiselect .ace_selection.ace_start {
145
- box-shadow: 0 0 3px 0px white;
146
- }
147
- .ace-tm .ace_marker-layer .ace_step {
148
- background: rgb(252, 255, 0);
149
- }
150
-
151
- .ace-tm .ace_marker-layer .ace_stack {
152
- background: rgb(164, 229, 101);
153
- }
154
-
155
- .ace-tm .ace_marker-layer .ace_bracket {
156
- margin: -1px 0 0 -1px;
157
- border: 1px solid rgb(192, 192, 192);
158
- }
159
-
160
- .ace-tm .ace_marker-layer .ace_active-line {
161
- background: rgba(0, 0, 0, 0.07);
162
- }
163
-
164
- .ace-tm .ace_gutter-active-line {
165
- background-color : #dcdcdc;
166
- }
167
-
168
- .ace-tm .ace_marker-layer .ace_selected-word {
169
- background: rgb(250, 250, 255);
170
- border: 1px solid rgb(200, 200, 250);
171
- }
172
-
173
- .ace-tm .ace_indent-guide {
174
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
175
- }
176
-
177
- .ace-tm .ace_indent-guide-active {
178
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
179
- }
180
- `}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(n,u,v){u.isDark=!1,u.cssClass="ace-tm",u.cssText=n("./textmate-css"),u.$id="ace/theme/textmate";var a=n("../lib/dom");a.importCssString(u.cssText,u.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(n,u,v){"no use strict";var a=n("./lib/lang"),h=n("./lib/net"),d=n("./lib/dom"),o=n("./lib/app_config").AppConfig;v.exports=u=new o;var p={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};u.get=function(l){if(!p.hasOwnProperty(l))throw new Error("Unknown config key: "+l);return p[l]},u.set=function(l,s){if(p.hasOwnProperty(l))p[l]=s;else if(this.setDefaultValue("",l,s)==!1)throw new Error("Unknown config key: "+l);l=="useStrictCSP"&&d.useStrictCSP(s)},u.all=function(){return a.copyObject(p)},u.$modes={},u.moduleUrl=function(l,s){if(p.$moduleUrls[l])return p.$moduleUrls[l];var c=l.split("/");s=s||c[c.length-2]||"";var f=s=="snippets"?"/":"-",m=c[c.length-1];if(s=="worker"&&f=="-"){var y=new RegExp("^"+s+"[\\-_]|[\\-_]"+s+"$","g");m=m.replace(y,"")}(!m||m==s)&&c.length>1&&(m=c[c.length-2]);var D=p[s+"Path"];return D==null?D=p.basePath:f=="/"&&(s=f=""),D&&D.slice(-1)!="/"&&(D+="/"),D+s+f+m+this.get("suffix")},u.setModuleUrl=function(l,s){return p.$moduleUrls[l]=s};var e=function(l,s){if(l==="ace/theme/textmate"||l==="./theme/textmate")return s(null,n("./theme/textmate"));if(t)return t(l,s);console.error("loader is not configured")},t;u.setLoader=function(l){t=l},u.dynamicModules=Object.create(null),u.$loading={},u.$loaded={},u.loadModule=function(l,s){var c;if(Array.isArray(l))var f=l[0],m=l[1];else if(typeof l=="string")var m=l;var y=function(D){if(D&&!u.$loading[m])return s&&s(D);if(u.$loading[m]||(u.$loading[m]=[]),u.$loading[m].push(s),!(u.$loading[m].length>1)){var E=function(){e(m,function(b,g){g&&(u.$loaded[m]=g),u._emit("load.module",{name:m,module:g});var S=u.$loading[m];u.$loading[m]=null,S.forEach(function(T){T&&T(g)})})};if(!u.get("packaged"))return E();h.loadScript(u.moduleUrl(m,f),E),r()}};if(u.dynamicModules[m])u.dynamicModules[m]().then(function(D){D.default?y(D.default):y(D)});else{try{c=this.$require(m)}catch{}y(c||u.$loaded[m])}},u.$require=function(l){if(typeof v.require=="function"){var s="require";return v[s](l)}},u.setModuleLoader=function(l,s){u.dynamicModules[l]=s};var r=function(){!p.basePath&&!p.workerPath&&!p.modePath&&!p.themePath&&!Object.keys(p.$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"),r=function(){})};u.version="1.40.1"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(n,u,v){n("./lib/fixoldbrowsers");var a=n("./config");a.setLoader(function(p,e){n([p],function(t){e(null,t)})});var h=function(){return this||typeof window<"u"&&window}();v.exports=function(p){a.init=d,a.$require=n,p.require=n},d(!0);function d(p){if(!(!h||!h.document)){a.set("packaged",p||n.packaged||v.packaged||h.define&&(void 0).packaged);var e={},t="",r=document.currentScript||document._currentScript,l=r&&r.ownerDocument||document;r&&r.src&&(t=r.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var s=l.getElementsByTagName("script"),c=0;c<s.length;c++){var f=s[c],m=f.src||f.getAttribute("src");if(m){for(var y=f.attributes,D=0,E=y.length;D<E;D++){var b=y[D];b.name.indexOf("data-ace-")===0&&(e[o(b.name.replace(/^data-ace-/,""))]=b.value)}var g=m.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);g&&(t=g[1])}}t&&(e.base=e.base||t,e.packaged=!0),e.basePath=e.base,e.workerPath=e.workerPath||e.base,e.modePath=e.modePath||e.base,e.themePath=e.themePath||e.base,delete e.base;for(var S in e)typeof e[S]<"u"&&a.set(S,e[S])}}function o(p){return p.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(n,u,v){var a=function(){function h(d,o,p,e){this.start={row:d,column:o},this.end={row:p,column:e}}return h.prototype.isEqual=function(d){return this.start.row===d.start.row&&this.end.row===d.end.row&&this.start.column===d.start.column&&this.end.column===d.end.column},h.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},h.prototype.contains=function(d,o){return this.compare(d,o)==0},h.prototype.compareRange=function(d){var o,p=d.end,e=d.start;return o=this.compare(p.row,p.column),o==1?(o=this.compare(e.row,e.column),o==1?2:o==0?1:0):o==-1?-2:(o=this.compare(e.row,e.column),o==-1?-1:o==1?42:0)},h.prototype.comparePoint=function(d){return this.compare(d.row,d.column)},h.prototype.containsRange=function(d){return this.comparePoint(d.start)==0&&this.comparePoint(d.end)==0},h.prototype.intersects=function(d){var o=this.compareRange(d);return o==-1||o==0||o==1},h.prototype.isEnd=function(d,o){return this.end.row==d&&this.end.column==o},h.prototype.isStart=function(d,o){return this.start.row==d&&this.start.column==o},h.prototype.setStart=function(d,o){typeof d=="object"?(this.start.column=d.column,this.start.row=d.row):(this.start.row=d,this.start.column=o)},h.prototype.setEnd=function(d,o){typeof d=="object"?(this.end.column=d.column,this.end.row=d.row):(this.end.row=d,this.end.column=o)},h.prototype.inside=function(d,o){return this.compare(d,o)==0?!(this.isEnd(d,o)||this.isStart(d,o)):!1},h.prototype.insideStart=function(d,o){return this.compare(d,o)==0?!this.isEnd(d,o):!1},h.prototype.insideEnd=function(d,o){return this.compare(d,o)==0?!this.isStart(d,o):!1},h.prototype.compare=function(d,o){return!this.isMultiLine()&&d===this.start.row?o<this.start.column?-1:o>this.end.column?1:0:d<this.start.row?-1:d>this.end.row?1:this.start.row===d?o>=this.start.column?0:-1:this.end.row===d?o<=this.end.column?0:1:0},h.prototype.compareStart=function(d,o){return this.start.row==d&&this.start.column==o?-1:this.compare(d,o)},h.prototype.compareEnd=function(d,o){return this.end.row==d&&this.end.column==o?1:this.compare(d,o)},h.prototype.compareInside=function(d,o){return this.end.row==d&&this.end.column==o?1:this.start.row==d&&this.start.column==o?-1:this.compare(d,o)},h.prototype.clipRows=function(d,o){if(this.end.row>o)var p={row:o+1,column:0};else if(this.end.row<d)var p={row:d,column:0};if(this.start.row>o)var e={row:o+1,column:0};else if(this.start.row<d)var e={row:d,column:0};return h.fromPoints(e||this.start,p||this.end)},h.prototype.extend=function(d,o){var p=this.compare(d,o);if(p==0)return this;if(p==-1)var e={row:d,column:o};else var t={row:d,column:o};return h.fromPoints(e||this.start,t||this.end)},h.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},h.prototype.isMultiLine=function(){return this.start.row!==this.end.row},h.prototype.clone=function(){return h.fromPoints(this.start,this.end)},h.prototype.collapseRows=function(){return this.end.column==0?new h(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new h(this.start.row,0,this.end.row,0)},h.prototype.toScreenRange=function(d){var o=d.documentToScreenPosition(this.start),p=d.documentToScreenPosition(this.end);return new h(o.row,o.column,p.row,p.column)},h.prototype.moveBy=function(d,o){this.start.row+=d,this.start.column+=o,this.end.row+=d,this.end.column+=o},h}();a.fromPoints=function(h,d){return new a(h.row,h.column,d.row,d.column)},a.comparePoints=function(h,d){return h.row-d.row||h.column-d.column},u.Range=a}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(n,u,v){for(var a=n("./oop"),h={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},d={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},o=0;o<10;o++)d["Digit"+o]=48+o,d["Numpad"+o]=96+o,h.PRINTABLE_KEYS[48+o]=""+o,h.FUNCTION_KEYS[96+o]="Numpad"+o;for(var o=65;o<91;o++){var p=String.fromCharCode(o+32);d["Key"+p.toUpperCase()]=o,h.PRINTABLE_KEYS[o]=p}for(var o=1;o<13;o++)d["F"+o]=111+o,h.FUNCTION_KEYS[111+o]="F"+o;var e={Shift:16,Control:17,Alt:18,Meta:224};for(var t in e)d[t]=d[t+"Left"]=d[t+"Right"]=e[t];u.$codeToKeyCode=d,h.PRINTABLE_KEYS[173]="-";for(var r in h.FUNCTION_KEYS){var l=h.FUNCTION_KEYS[r].toLowerCase();h[l]=parseInt(r,10)}for(var r in h.PRINTABLE_KEYS){var l=h.PRINTABLE_KEYS[r].toLowerCase();h[l]=parseInt(r,10)}a.mixin(h,h.MODIFIER_KEYS),a.mixin(h,h.PRINTABLE_KEYS),a.mixin(h,h.FUNCTION_KEYS),h.enter=h.return,h.escape=h.esc,h.del=h.delete,function(){for(var s=["cmd","ctrl","alt","shift"],c=Math.pow(2,s.length);c--;)h.KEY_MODS[c]=s.filter(function(f){return c&h.KEY_MODS[f]}).join("-")+"-"}(),h.KEY_MODS[0]="",h.KEY_MODS[-1]="input-",a.mixin(u,h),u.default=u,u.keyCodeToString=function(s){var c=h[s];return typeof c!="string"&&(c=String.fromCharCode(s)),c.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(n,u,v){var a=n("./keys"),h=n("./useragent"),d=null,o=0,p;function e(){p=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return p={passive:!1},!0}})}catch{}}function t(){return p==null&&e(),p}function r(D,E,b){this.elem=D,this.type=E,this.callback=b}r.prototype.destroy=function(){s(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var l=u.addListener=function(D,E,b,g){D.addEventListener(E,b,t()),g&&g.$toDestroy.push(new r(D,E,b))},s=u.removeListener=function(D,E,b){D.removeEventListener(E,b,t())};u.stopEvent=function(D){return u.stopPropagation(D),u.preventDefault(D),!1},u.stopPropagation=function(D){D.stopPropagation&&D.stopPropagation()},u.preventDefault=function(D){D.preventDefault&&D.preventDefault()},u.getButton=function(D){return D.type=="dblclick"?0:D.type=="contextmenu"||h.isMac&&D.ctrlKey&&!D.altKey&&!D.shiftKey?2:D.button},u.capture=function(D,E,b){var g=D&&D.ownerDocument||document;function S(T){E&&E(T),b&&b(T),s(g,"mousemove",E),s(g,"mouseup",S),s(g,"dragstart",S)}return l(g,"mousemove",E),l(g,"mouseup",S),l(g,"dragstart",S),S},u.addMouseWheelListener=function(D,E,b){l(D,"wheel",function(g){var S=.15,T=g.deltaX||0,k=g.deltaY||0;switch(g.deltaMode){case g.DOM_DELTA_PIXEL:g.wheelX=T*S,g.wheelY=k*S;break;case g.DOM_DELTA_LINE:var _=15;g.wheelX=T*_,g.wheelY=k*_;break;case g.DOM_DELTA_PAGE:var R=150;g.wheelX=T*R,g.wheelY=k*R;break}E(g)},b)},u.addMultiMouseDownListener=function(D,E,b,g,S){var T=0,k,_,R,x={2:"dblclick",3:"tripleclick",4:"quadclick"};function A(C){if(u.getButton(C)!==0?T=0:C.detail>1?(T++,T>4&&(T=1)):T=1,h.isIE){var w=Math.abs(C.clientX-k)>5||Math.abs(C.clientY-_)>5;(!R||w)&&(T=1),R&&clearTimeout(R),R=setTimeout(function(){R=null},E[T-1]||600),T==1&&(k=C.clientX,_=C.clientY)}if(C._clicks=T,b[g]("mousedown",C),T>4)T=0;else if(T>1)return b[g](x[T],C)}Array.isArray(D)||(D=[D]),D.forEach(function(C){l(C,"mousedown",A,S)})};function c(D){return 0|(D.ctrlKey?1:0)|(D.altKey?2:0)|(D.shiftKey?4:0)|(D.metaKey?8:0)}u.getModifierString=function(D){return a.KEY_MODS[c(D)]};function f(D,E,b){var g=c(E);if(!b&&E.code&&(b=a.$codeToKeyCode[E.code]||b),!h.isMac&&d){if(E.getModifierState&&(E.getModifierState("OS")||E.getModifierState("Win"))&&(g|=8),d.altGr)if((3&g)!=3)d.altGr=0;else return;if(b===18||b===17){var S=E.location;if(b===17&&S===1)d[b]==1&&(o=E.timeStamp);else if(b===18&&g===3&&S===2){var T=E.timeStamp-o;T<50&&(d.altGr=!0)}}}if(b in a.MODIFIER_KEYS&&(b=-1),!(!g&&b===13&&E.location===3&&(D(E,g,-b),E.defaultPrevented))){if(h.isChromeOS&&g&8){if(D(E,g,b),E.defaultPrevented)return;g&=-9}return!g&&!(b in a.FUNCTION_KEYS)&&!(b in a.PRINTABLE_KEYS)?!1:D(E,g,b)}}u.addCommandKeyListener=function(D,E,b){var g=null;l(D,"keydown",function(S){d[S.keyCode]=(d[S.keyCode]||0)+1;var T=f(E,S,S.keyCode);return g=S.defaultPrevented,T},b),l(D,"keypress",function(S){g&&(S.ctrlKey||S.altKey||S.shiftKey||S.metaKey)&&(u.stopEvent(S),g=null)},b),l(D,"keyup",function(S){d[S.keyCode]=null},b),d||(m(),l(window,"focus",m))};function m(){d=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!h.isOldIE){var y=1;u.nextTick=function(D,E){E=E||window;var b="zero-timeout-message-"+y++,g=function(S){S.data==b&&(u.stopPropagation(S),s(E,"message",g),D())};l(E,"message",g),E.postMessage(b,"*")}}u.$idleBlocked=!1,u.onIdle=function(D,E){return setTimeout(function b(){u.$idleBlocked?setTimeout(b,100):D()},E)},u.$idleBlockId=null,u.blockIdle=function(D){u.$idleBlockId&&clearTimeout(u.$idleBlockId),u.$idleBlocked=!0,u.$idleBlockId=setTimeout(function(){u.$idleBlocked=!1},D||100)},u.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),u.nextFrame?u.nextFrame=u.nextFrame.bind(window):u.nextFrame=function(D){setTimeout(D,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(n,u,v){var a;v.exports={lineMode:!1,pasteCancelled:function(){return a&&a>Date.now()-50?!0:a=!1},cancel:function(){a=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(n,u,v){var a=n("../lib/event"),h=n("../config").nls,d=n("../lib/useragent"),o=n("../lib/dom"),p=n("../lib/lang"),e=n("../clipboard"),t=d.isChrome<18,r=d.isIE,l=d.isChrome>63,s=400,c=n("../lib/keys"),f=c.KEY_MODS,m=d.isIOS,y=m?/\s/:/\n/,D=d.isMobile,E;E=function(b,g){var S=o.createElement("textarea");S.className="ace_text-input",S.setAttribute("wrap","off"),S.setAttribute("autocorrect","off"),S.setAttribute("autocapitalize","off"),S.setAttribute("spellcheck","false"),S.style.opacity="0",b.insertBefore(S,b.firstChild);var T=!1,k=!1,_=!1,R=!1,x="";D||(S.style.fontSize="1px");var A=!1,C=!1,w="",$=0,I=0,F=0,O=Number.MAX_SAFE_INTEGER,B=Number.MIN_SAFE_INTEGER,P=0;try{var V=document.activeElement===S}catch{}this.setNumberOfExtraLines=function(X){if(O=Number.MAX_SAFE_INTEGER,B=Number.MIN_SAFE_INTEGER,X<0){P=0;return}P=X},this.setAriaLabel=function(){var X="";if(g.$textInputAriaLabel&&(X+="".concat(g.$textInputAriaLabel,", ")),g.session){var re=g.session.selection.cursor.row;X+=h("text-input.aria-label","Cursor at row $0",[re+1])}S.setAttribute("aria-label",X)},this.setAriaOptions=function(X){X.activeDescendant?(S.setAttribute("aria-haspopup","true"),S.setAttribute("aria-autocomplete",X.inline?"both":"list"),S.setAttribute("aria-activedescendant",X.activeDescendant)):(S.setAttribute("aria-haspopup","false"),S.setAttribute("aria-autocomplete","both"),S.removeAttribute("aria-activedescendant")),X.role&&S.setAttribute("role",X.role),X.setLabel&&(S.setAttribute("aria-roledescription",h("text-input.aria-roledescription","editor")),this.setAriaLabel())},this.setAriaOptions({role:"textbox"}),a.addListener(S,"blur",function(X){C||(g.onBlur(X),V=!1)},g),a.addListener(S,"focus",function(X){if(!C){if(V=!0,d.isEdge)try{if(!document.hasFocus())return}catch{}g.onFocus(X),d.isEdge?setTimeout(H):H()}},g),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:g.renderer.enableKeyboardAccessibility}),x||l||this.$focusScroll=="browser")return S.focus({preventScroll:!0});var X=S.style.top;S.style.position="fixed",S.style.top="0px";try{var re=S.getBoundingClientRect().top!=0}catch{return}var ae=[];if(re)for(var de=S.parentElement;de&&de.nodeType==1;)ae.push(de),de.setAttribute("ace_nocontext","true"),!de.parentElement&&de.getRootNode?de=de.getRootNode().host:de=de.parentElement;S.focus({preventScroll:!0}),re&&ae.forEach(function(ce){ce.removeAttribute("ace_nocontext")}),setTimeout(function(){S.style.position="",S.style.top=="0px"&&(S.style.top=X)},0)},this.blur=function(){S.blur()},this.isFocused=function(){return V},g.on("beforeEndOperation",function(){var X=g.curOp,re=X&&X.command&&X.command.name;if(re!="insertstring"){var ae=re&&(X.docChanged||X.selectionChanged);_&&ae&&(w=S.value="",Ze()),H()}}),g.on("changeSelection",this.setAriaLabel);var W=function(X,re){for(var ae=re,de=1;de<=X-O&&de<2*P+1;de++)ae+=g.session.getLine(X-de).length+1;return ae},H=m?function(X){if(!(!V||T&&!X||R)){X||(X="");var re=`
181
- ab`+X+`cde fg
182
- `;re!=S.value&&(S.value=w=re);var ae=4,de=4+(X.length||(g.selection.isEmpty()?0:1));($!=ae||I!=de)&&S.setSelectionRange(ae,de),$=ae,I=de}}:function(){if(!(_||R)&&!(!V&&!Q)){_=!0;var X=0,re=0,ae="";if(g.session){var de=g.selection,ce=de.getRange(),Ee=de.cursor.row;Ee===B+1?(O=B+1,B=O+2*P):Ee===O-1?(B=O-1,O=B-2*P):(Ee<O-1||Ee>B+1)&&(O=Ee>P?Ee-P:0,B=Ee>P?Ee+P:2*P);for(var $e=[],xe=O;xe<=B;xe++)$e.push(g.session.getLine(xe));if(ae=$e.join(`
183
- `),X=W(ce.start.row,ce.start.column),re=W(ce.end.row,ce.end.column),ce.start.row<O){var we=g.session.getLine(O-1);X=ce.start.row<O-1?0:X,re+=we.length+1,ae=we+`
184
- `+ae}else if(ce.end.row>B){var ve=g.session.getLine(B+1);re=ce.end.row>B+1?ve.length:ce.end.column,re+=ae.length+1,ae=ae+`
185
- `+ve}else D&&Ee>0&&(ae=`
186
- `+ae,re+=1,X+=1);ae.length>s&&(X<s&&re<s?ae=ae.slice(0,s):(ae=`
187
- `,X==re?X=re=0:(X=0,re=1)));var Fe=ae+`
188
-
189
- `;Fe!=w&&(S.value=w=Fe,$=I=Fe.length)}if(Q&&($=S.selectionStart,I=S.selectionEnd),I!=re||$!=X||S.selectionEnd!=I)try{S.setSelectionRange(X,re),$=X,I=re}catch{}_=!1}};this.resetSelection=H,V&&g.onFocus();var U=function(X){return X.selectionStart===0&&X.selectionEnd>=w.length&&X.value===w&&w&&X.selectionEnd!==I},G=function(X){_||(T?T=!1:U(S)?(g.selectAll(),H()):D&&S.selectionStart!=$&&H())},Y=null;this.setInputHandler=function(X){Y=X},this.getInputHandler=function(){return Y};var Q=!1,ee=function(X,re){if(Q&&(Q=!1),k)return H(),X&&g.onPaste(X),k=!1,"";for(var ae=S.selectionStart,de=S.selectionEnd,ce=$,Ee=w.length-I,$e=X,xe=X.length-ae,we=X.length-de,ve=0;ce>0&&w[ve]==X[ve];)ve++,ce--;for($e=$e.slice(ve),ve=1;Ee>0&&w.length-ve>$-1&&w[w.length-ve]==X[X.length-ve];)ve++,Ee--;xe-=ve-1,we-=ve-1;var Fe=$e.length-ve+1;if(Fe<0&&(ce=-Fe,Fe=0),$e=$e.slice(0,Fe),!re&&!$e&&!xe&&!ce&&!Ee&&!we)return"";R=!0;var st=!1;return d.isAndroid&&$e==". "&&($e=" ",st=!0),$e&&!ce&&!Ee&&!xe&&!we||A?g.onTextInput($e):g.onTextInput($e,{extendLeft:ce,extendRight:Ee,restoreStart:xe,restoreEnd:we}),R=!1,w=X,$=ae,I=de,F=we,st?`
190
- `:$e},ne=function(X){if(_)return Xe();if(X&&X.inputType){if(X.inputType=="historyUndo")return g.execCommand("undo");if(X.inputType=="historyRedo")return g.execCommand("redo")}var re=S.value,ae=ee(re,!0);(re.length>s+100||y.test(ae)||D&&$<1&&$==I)&&H()},se=function(X,re,ae){var de=X.clipboardData||window.clipboardData;if(!(!de||t)){var ce=r||ae?"Text":"text/plain";try{return re?de.setData(ce,re)!==!1:de.getData(ce)}catch(Ee){if(!ae)return se(Ee,re,!0)}}},ge=function(X,re){var ae=g.getCopyText();if(!ae)return a.preventDefault(X);se(X,ae)?(m&&(H(ae),T=ae,setTimeout(function(){T=!1},10)),re?g.onCut():g.onCopy(),a.preventDefault(X)):(T=!0,S.value=ae,S.select(),setTimeout(function(){T=!1,H(),re?g.onCut():g.onCopy()}))},be=function(X){ge(X,!0)},ke=function(X){ge(X,!1)},Ce=function(X){var re=se(X);e.pasteCancelled()||(typeof re=="string"?(re&&g.onPaste(re,X),d.isIE&&setTimeout(H),a.preventDefault(X)):(S.value="",k=!0))};a.addCommandKeyListener(S,function(X,re,ae){if(!_)return g.onCommandKey(X,re,ae)},g),a.addListener(S,"select",G,g),a.addListener(S,"input",ne,g),a.addListener(S,"cut",be,g),a.addListener(S,"copy",ke,g),a.addListener(S,"paste",Ce,g),(!("oncut"in S)||!("oncopy"in S)||!("onpaste"in S))&&a.addListener(b,"keydown",function(X){if(!(d.isMac&&!X.metaKey||!X.ctrlKey))switch(X.keyCode){case 67:ke(X);break;case 86:Ce(X);break;case 88:be(X);break}},g);var Ne=function(X){if(!(_||!g.onCompositionStart||g.$readOnly)&&(_={},!A)){X.data&&(_.useTextareaForIME=!1),setTimeout(Xe,0),g._signal("compositionStart"),g.on("mousedown",Rt);var re=g.getSelectionRange();re.end.row=re.start.row,re.end.column=re.start.column,_.markerRange=re,_.selectionStart=$,g.onCompositionStart(_),_.useTextareaForIME?(w=S.value="",$=0,I=0):(S.msGetInputContext&&(_.context=S.msGetInputContext()),S.getInputContext&&(_.context=S.getInputContext()))}},Xe=function(){if(!(!_||!g.onCompositionUpdate||g.$readOnly)){if(A)return Rt();if(_.useTextareaForIME)g.onCompositionUpdate(S.value);else{var X=S.value;ee(X),_.markerRange&&(_.context&&(_.markerRange.start.column=_.selectionStart=_.context.compositionStartOffset),_.markerRange.end.column=_.markerRange.start.column+I-_.selectionStart+F)}}},Ze=function(X){!g.onCompositionEnd||g.$readOnly||(_=!1,g.onCompositionEnd(),g.off("mousedown",Rt),X&&ne())};function Rt(){C=!0,S.blur(),S.focus(),C=!1}var Jt=p.delayedCall(Xe,50).schedule.bind(null,null);function bn(X){X.keyCode==27&&S.value.length<S.selectionStart&&(_||(w=S.value),$=I=-1,H()),Jt()}a.addListener(S,"compositionstart",Ne,g),a.addListener(S,"compositionupdate",Xe,g),a.addListener(S,"keyup",bn,g),a.addListener(S,"keydown",Jt,g),a.addListener(S,"compositionend",Ze,g),this.getElement=function(){return S},this.setCommandMode=function(X){A=X,S.readOnly=!1},this.setReadOnly=function(X){A||(S.readOnly=X)},this.setCopyWithEmptySelection=function(X){},this.onContextMenu=function(X){Q=!0,H(),g._emit("nativecontextmenu",{target:g,domEvent:X}),this.moveToMouse(X,!0)},this.moveToMouse=function(X,re){x||(x=S.style.cssText),S.style.cssText=(re?"z-index:100000;":"")+(d.isIE?"opacity:0.1;":"")+"text-indent: -"+($+I)*g.renderer.characterWidth*.5+"px;";var ae=g.container.getBoundingClientRect(),de=o.computedStyle(g.container),ce=ae.top+(parseInt(de.borderTopWidth)||0),Ee=ae.left+(parseInt(de.borderLeftWidth)||0),$e=ae.bottom-ce-S.clientHeight-2,xe=function(we){o.translate(S,we.clientX-Ee-2,Math.min(we.clientY-ce-2,$e))};xe(X),X.type=="mousedown"&&(g.renderer.$isMousePressed=!0,clearTimeout(Ot),d.isWin&&a.capture(g.container,xe,Tt))},this.onContextMenuClose=Tt;var Ot;function Tt(){clearTimeout(Ot),Ot=setTimeout(function(){x&&(S.style.cssText=x,x=""),g.renderer.$isMousePressed=!1,g.renderer.$keepTextAreaAtCursor&&g.renderer.$moveTextAreaToCursor()},0)}var Nt=function(X){g.textInput.onContextMenu(X),Tt()};a.addListener(S,"mouseup",Nt,g),a.addListener(S,"mousedown",function(X){X.preventDefault(),Tt()},g),a.addListener(g.renderer.scroller,"contextmenu",Nt,g),a.addListener(S,"contextmenu",Nt,g),m&&wn(b,g,S);function wn(X,re,ae){var de=null,ce=!1;ae.addEventListener("keydown",function($e){de&&clearTimeout(de),ce=!0},!0),ae.addEventListener("keyup",function($e){de=setTimeout(function(){ce=!1},100)},!0);var Ee=function($e){if(document.activeElement===ae&&!(ce||_||re.$mouseHandler.isMousePressed)&&!T){var xe=ae.selectionStart,we=ae.selectionEnd,ve=null,Fe=0;if(xe==0?ve=c.up:xe==1?ve=c.home:we>I&&w[we]==`
191
- `?ve=c.end:xe<$&&w[xe-1]==" "?(ve=c.left,Fe=f.option):xe<$||xe==$&&I!=$&&xe==we?ve=c.left:we>I&&w.slice(0,we).split(`
192
- `).length>2?ve=c.down:we>I&&w[we-1]==" "?(ve=c.right,Fe=f.option):(we>I||we==I&&I!=$&&xe==we)&&(ve=c.right),xe!==we&&(Fe|=f.shift),ve){var st=re.onCommandKey({},Fe,ve);if(!st&&re.commands){ve=c.keyCodeToString(ve);var Yt=re.commands.findKeyCommand(Fe,ve);Yt&&re.execCommand(Yt)}$=xe,I=we,H("")}}};document.addEventListener("selectionchange",Ee),re.on("destroy",function(){document.removeEventListener("selectionchange",Ee)})}this.destroy=function(){S.parentElement&&S.parentElement.removeChild(S)}},u.TextInput=E,u.$setUserAgentForTests=function(b,g){D=b,m=g}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(n,u,v){var a=n("../lib/useragent"),h=0,d=550,o=function(){function t(r){r.$clickSelection=null;var l=r.editor;l.setDefaultHandler("mousedown",this.onMouseDown.bind(r)),l.setDefaultHandler("dblclick",this.onDoubleClick.bind(r)),l.setDefaultHandler("tripleclick",this.onTripleClick.bind(r)),l.setDefaultHandler("quadclick",this.onQuadClick.bind(r)),l.setDefaultHandler("mousewheel",this.onMouseWheel.bind(r));var s=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];s.forEach(function(c){r[c]=this[c]},this),r.selectByLines=this.extendSelectionBy.bind(r,"getLineRange"),r.selectByWords=this.extendSelectionBy.bind(r,"getWordRange")}return t.prototype.onMouseDown=function(r){var l=r.inSelection(),s=r.getDocumentPosition();this.mousedownEvent=r;var c=this.editor,f=r.getButton();if(f!==0){var m=c.getSelectionRange(),y=m.isEmpty();(y||f==1)&&c.selection.moveToPosition(s),f==2&&(c.textInput.onContextMenu(r.domEvent),a.isMozilla||r.preventDefault());return}if(this.mousedownEvent.time=Date.now(),l&&!c.isFocused()&&(c.focus(),this.$focusTimeout&&!this.$clickSelection&&!c.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(r);return}return this.captureMouse(r),this.startSelect(s,r.domEvent._clicks>1),r.preventDefault()},t.prototype.startSelect=function(r,l){r=r||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var s=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?s.selection.selectToPosition(r):l||s.selection.moveToPosition(r),l||this.select(),s.setStyle("ace_selecting"),this.setState("select"))},t.prototype.select=function(){var r,l=this.editor,s=l.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var c=this.$clickSelection.comparePoint(s);if(c==-1)r=this.$clickSelection.end;else if(c==1)r=this.$clickSelection.start;else{var f=e(this.$clickSelection,s);s=f.cursor,r=f.anchor}l.selection.setSelectionAnchor(r.row,r.column)}l.selection.selectToPosition(s),l.renderer.scrollCursorIntoView()},t.prototype.extendSelectionBy=function(r){var l,s=this.editor,c=s.renderer.screenToTextCoordinates(this.x,this.y),f=s.selection[r](c.row,c.column);if(this.$clickSelection){var m=this.$clickSelection.comparePoint(f.start),y=this.$clickSelection.comparePoint(f.end);if(m==-1&&y<=0)l=this.$clickSelection.end,(f.end.row!=c.row||f.end.column!=c.column)&&(c=f.start);else if(y==1&&m>=0)l=this.$clickSelection.start,(f.start.row!=c.row||f.start.column!=c.column)&&(c=f.end);else if(m==-1&&y==1)c=f.end,l=f.start;else{var D=e(this.$clickSelection,c);c=D.cursor,l=D.anchor}s.selection.setSelectionAnchor(l.row,l.column)}s.selection.selectToPosition(c),s.renderer.scrollCursorIntoView()},t.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},t.prototype.focusWait=function(){var r=p(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),l=Date.now();(r>h||l-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},t.prototype.onDoubleClick=function(r){var l=r.getDocumentPosition(),s=this.editor,c=s.session,f=c.getBracketRange(l);f?(f.isEmpty()&&(f.start.column--,f.end.column++),this.setState("select")):(f=s.selection.getWordRange(l.row,l.column),this.setState("selectByWords")),this.$clickSelection=f,this.select()},t.prototype.onTripleClick=function(r){var l=r.getDocumentPosition(),s=this.editor;this.setState("selectByLines");var c=s.getSelectionRange();c.isMultiLine()&&c.contains(l.row,l.column)?(this.$clickSelection=s.selection.getLineRange(c.start.row),this.$clickSelection.end=s.selection.getLineRange(c.end.row).end):this.$clickSelection=s.selection.getLineRange(l.row),this.select()},t.prototype.onQuadClick=function(r){var l=this.editor;l.selectAll(),this.$clickSelection=l.getSelectionRange(),this.setState("selectAll")},t.prototype.onMouseWheel=function(r){if(!r.getAccelKey()){r.getShiftKey()&&r.wheelY&&!r.wheelX&&(r.wheelX=r.wheelY,r.wheelY=0);var l=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var s=this.$lastScroll,c=r.domEvent.timeStamp,f=c-s.t,m=f?r.wheelX/f:s.vx,y=f?r.wheelY/f:s.vy;f<d&&(m=(m+s.vx)/2,y=(y+s.vy)/2);var D=Math.abs(m/y),E=!1;if(D>=1&&l.renderer.isScrollableBy(r.wheelX*r.speed,0)&&(E=!0),D<=1&&l.renderer.isScrollableBy(0,r.wheelY*r.speed)&&(E=!0),E)s.allowed=c;else if(c-s.allowed<d){var b=Math.abs(m)<=1.5*Math.abs(s.vx)&&Math.abs(y)<=1.5*Math.abs(s.vy);b?(E=!0,s.allowed=c):s.allowed=0}if(s.t=c,s.vx=m,s.vy=y,E)return l.renderer.scrollBy(r.wheelX*r.speed,r.wheelY*r.speed),r.stop()}},t}();o.prototype.selectEnd=o.prototype.selectByLinesEnd,o.prototype.selectAllEnd=o.prototype.selectByLinesEnd,o.prototype.selectByWordsEnd=o.prototype.selectByLinesEnd,u.DefaultHandlers=o;function p(t,r,l,s){return Math.sqrt(Math.pow(l-t,2)+Math.pow(s-r,2))}function e(t,r){if(t.start.row==t.end.row)var l=2*r.column-t.start.column-t.end.column;else if(t.start.row==t.end.row-1&&!t.start.column&&!t.end.column)var l=r.column-4;else var l=2*r.row-t.start.row-t.end.row;return l<0?{cursor:t.start,anchor:t.end}:{cursor:t.end,anchor:t.start}}}),ace.define("ace/lib/scroll",["require","exports","module"],function(n,u,v){u.preventParentScroll=function(h){h.stopPropagation();var d=h.currentTarget,o=d.scrollHeight>d.clientHeight;o||h.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(n,u,v){var a=this&&this.__extends||function(){var c=function(f,m){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,D){y.__proto__=D}||function(y,D){for(var E in D)Object.prototype.hasOwnProperty.call(D,E)&&(y[E]=D[E])},c(f,m)};return function(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");c(f,m);function y(){this.constructor=f}f.prototype=m===null?Object.create(m):(y.prototype=m.prototype,new y)}}(),h=this&&this.__values||function(c){var f=typeof Symbol=="function"&&Symbol.iterator,m=f&&c[f],y=0;if(m)return m.call(c);if(c&&typeof c.length=="number")return{next:function(){return c&&y>=c.length&&(c=void 0),{value:c&&c[y++],done:!c}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},d=n("./lib/dom");n("./lib/event");var o=n("./range").Range,p=n("./lib/scroll").preventParentScroll,e="ace_tooltip",t=function(){function c(f){this.isOpen=!1,this.$element=null,this.$parentNode=f}return c.prototype.$init=function(){return this.$element=d.createElement("div"),this.$element.className=e,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},c.prototype.getElement=function(){return this.$element||this.$init()},c.prototype.setText=function(f){this.getElement().textContent=f},c.prototype.setHtml=function(f){this.getElement().innerHTML=f},c.prototype.setPosition=function(f,m){this.getElement().style.left=f+"px",this.getElement().style.top=m+"px"},c.prototype.setClassName=function(f){d.addCssClass(this.getElement(),f)},c.prototype.setTheme=function(f){this.$element.className=e+" "+(f.isDark?"ace_dark ":"")+(f.cssClass||"")},c.prototype.show=function(f,m,y){f!=null&&this.setText(f),m!=null&&y!=null&&this.setPosition(m,y),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},c.prototype.hide=function(f){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=e,this.isOpen=!1)},c.prototype.getHeight=function(){return this.getElement().offsetHeight},c.prototype.getWidth=function(){return this.getElement().offsetWidth},c.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},c}(),r=function(){function c(){this.popups=[]}return c.prototype.addPopup=function(f){this.popups.push(f),this.updatePopups()},c.prototype.removePopup=function(f){var m=this.popups.indexOf(f);m!==-1&&(this.popups.splice(m,1),this.updatePopups())},c.prototype.updatePopups=function(){var f,m,y,D;this.popups.sort(function(x,A){return A.priority-x.priority});var E=[];try{for(var b=h(this.popups),g=b.next();!g.done;g=b.next()){var S=g.value,T=!0;try{for(var k=(y=void 0,h(E)),_=k.next();!_.done;_=k.next()){var R=_.value;if(this.doPopupsOverlap(R,S)){T=!1;break}}}catch(x){y={error:x}}finally{try{_&&!_.done&&(D=k.return)&&D.call(k)}finally{if(y)throw y.error}}T?E.push(S):S.hide()}}catch(x){f={error:x}}finally{try{g&&!g.done&&(m=b.return)&&m.call(b)}finally{if(f)throw f.error}}},c.prototype.doPopupsOverlap=function(f,m){var y=f.getElement().getBoundingClientRect(),D=m.getElement().getBoundingClientRect();return y.left<D.right&&y.right>D.left&&y.top<D.bottom&&y.bottom>D.top},c}(),l=new r;u.popupManager=l,u.Tooltip=t;var s=function(c){a(f,c);function f(m){m===void 0&&(m=document.body);var y=c.call(this,m)||this;y.timeout=void 0,y.lastT=0,y.idleTime=350,y.lastEvent=void 0,y.onMouseOut=y.onMouseOut.bind(y),y.onMouseMove=y.onMouseMove.bind(y),y.waitForHover=y.waitForHover.bind(y),y.hide=y.hide.bind(y);var D=y.getElement();return D.style.whiteSpace="pre-wrap",D.style.pointerEvents="auto",D.addEventListener("mouseout",y.onMouseOut),D.tabIndex=-1,D.addEventListener("blur",function(){D.contains(document.activeElement)||this.hide()}.bind(y)),D.addEventListener("wheel",p),y}return f.prototype.addToEditor=function(m){m.on("mousemove",this.onMouseMove),m.on("mousedown",this.hide),m.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},f.prototype.removeFromEditor=function(m){m.off("mousemove",this.onMouseMove),m.off("mousedown",this.hide),m.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},f.prototype.onMouseMove=function(m,y){this.lastEvent=m,this.lastT=Date.now();var D=y.$mouseHandler.isMousePressed;if(this.isOpen){var E=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(E.row,E.column)||D||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||D||(this.lastEvent=m,this.timeout=setTimeout(this.waitForHover,this.idleTime))},f.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var m=Date.now()-this.lastT;if(this.idleTime-m>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-m);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},f.prototype.isOutsideOfText=function(m){var y=m.editor,D=m.getDocumentPosition(),E=y.session.getLine(D.row);if(D.column==E.length){var b=y.renderer.pixelToScreenCoordinates(m.clientX,m.clientY),g=y.session.documentToScreenPosition(D.row,D.column);if(g.column!=b.column||g.row!=b.row)return!0}return!1},f.prototype.setDataProvider=function(m){this.$gatherData=m},f.prototype.showForRange=function(m,y,D,E){var b=10;if(!(E&&E!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var g=m.renderer;this.isOpen||(l.addPopup(this),this.$registerCloseEvents(),this.setTheme(g.theme)),this.isOpen=!0,this.addMarker(y,m.session),this.range=o.fromPoints(y.start,y.end);var S=g.textToScreenCoordinates(y.start.row,y.start.column),T=g.scroller.getBoundingClientRect();S.pageX<T.left&&(S.pageX=T.left);var k=this.getElement();k.innerHTML="",k.appendChild(D),k.style.maxHeight="",k.style.display="block";var _=k.clientHeight,R=k.clientWidth,x=window.innerHeight-S.pageY-g.lineHeight,A=!0;S.pageY-_<0&&S.pageY<x&&(A=!1),k.style.maxHeight=(A?S.pageY:x)-b+"px",k.style.top=A?"":S.pageY+g.lineHeight+"px",k.style.bottom=A?window.innerHeight-S.pageY+"px":"",k.style.left=Math.min(S.pageX,window.innerWidth-R-b)+"px"}},f.prototype.addMarker=function(m,y){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=y,this.marker=y&&y.addMarker(m,"ace_highlight-marker","text")},f.prototype.hide=function(m){!m&&document.activeElement==this.getElement()||m&&m.target&&(m.type!="keydown"||m.ctrlKey||m.metaKey)&&this.$element.contains(m.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,l.removePopup(this)))},f.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},f.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},f.prototype.onMouseOut=function(m){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!m.relatedTarget||this.getElement().contains(m.relatedTarget)||m&&m.currentTarget.contains(m.relatedTarget)||m.relatedTarget.classList.contains("ace_content")||this.hide())},f}(t);u.HoverTooltip=s}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config"],function(n,u,v){var a=this&&this.__extends||function(){var c=function(f,m){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,D){y.__proto__=D}||function(y,D){for(var E in D)Object.prototype.hasOwnProperty.call(D,E)&&(y[E]=D[E])},c(f,m)};return function(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");c(f,m);function y(){this.constructor=f}f.prototype=m===null?Object.create(m):(y.prototype=m.prototype,new y)}}(),h=this&&this.__values||function(c){var f=typeof Symbol=="function"&&Symbol.iterator,m=f&&c[f],y=0;if(m)return m.call(c);if(c&&typeof c.length=="number")return{next:function(){return c&&y>=c.length&&(c=void 0),{value:c&&c[y++],done:!c}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},d=n("../lib/dom"),o=n("../lib/event"),p=n("../tooltip").Tooltip,e=n("../config").nls,t=5,r=3;u.GUTTER_TOOLTIP_LEFT_OFFSET=t,u.GUTTER_TOOLTIP_TOP_OFFSET=r;function l(c){var f=c.editor,m=f.renderer.$gutterLayer,y=new s(f,!0);c.editor.setDefaultHandler("guttermousedown",function(T){if(!(!f.isFocused()||T.getButton()!=0)){var k=m.getRegion(T);if(k!="foldWidgets"){var _=T.getDocumentPosition().row,R=f.session.selection;if(T.getShiftKey())R.selectTo(_,0);else{if(T.domEvent.detail==2)return f.selectAll(),T.preventDefault();c.$clickSelection=f.selection.getLineRange(_)}return c.setState("selectByLines"),c.captureMouse(T),T.preventDefault()}}});var D,E;function b(){var T=E.getDocumentPosition().row,k=f.session.getLength();if(T==k){var _=f.renderer.pixelToScreenCoordinates(0,E.y).row,R=E.$pos;if(_>f.session.documentToScreenRow(R.row,R.column))return g()}if(y.showTooltip(T),!!y.isOpen)if(f.on("mousewheel",g),f.on("changeSession",g),window.addEventListener("keydown",g,!0),c.$tooltipFollowsMouse)S(E);else{var x=E.getGutterRow(),A=m.$lines.get(x);if(A){var C=A.element.querySelector(".ace_gutter_annotation"),w=C.getBoundingClientRect(),$=y.getElement().style;$.left=w.right-t+"px",$.top=w.bottom-r+"px"}else S(E)}}function g(T){T&&T.type==="keydown"&&(T.ctrlKey||T.metaKey)||T&&T.type==="mouseout"&&(!T.relatedTarget||y.getElement().contains(T.relatedTarget))||(D&&(D=clearTimeout(D)),y.isOpen&&(y.hideTooltip(),f.off("mousewheel",g),f.off("changeSession",g),window.removeEventListener("keydown",g,!0)))}function S(T){y.setPosition(T.x,T.y)}c.editor.setDefaultHandler("guttermousemove",function(T){var k=T.domEvent.target||T.domEvent.srcElement;if(d.hasCssClass(k,"ace_fold-widget")||d.hasCssClass(k,"ace_custom-widget"))return g();y.isOpen&&c.$tooltipFollowsMouse&&S(T),E=T,!D&&(D=setTimeout(function(){D=null,E&&!c.isMousePressed&&b()},50))}),o.addListener(f.renderer.$gutter,"mouseout",function(T){E=null,y.isOpen&&(D=setTimeout(function(){D=null,g(T)},50))},f)}u.GutterHandler=l;var s=function(c){a(f,c);function f(m,y){y===void 0&&(y=!1);var D=c.call(this,m.container)||this;D.editor=m,D.visibleTooltipRow;var E=D.getElement();return E.setAttribute("role","tooltip"),E.style.pointerEvents="auto",y&&(D.onMouseOut=D.onMouseOut.bind(D),E.addEventListener("mouseout",D.onMouseOut)),D}return f.prototype.onMouseOut=function(m){this.isOpen&&(!m.relatedTarget||this.getElement().contains(m.relatedTarget)||m&&m.currentTarget.contains(m.relatedTarget)||this.hideTooltip())},f.prototype.setPosition=function(m,y){var D=window.innerWidth||document.documentElement.clientWidth,E=window.innerHeight||document.documentElement.clientHeight,b=this.getWidth(),g=this.getHeight();m+=15,y+=15,m+b>D&&(m-=m+b-D),y+g>E&&(y-=20+g),p.prototype.setPosition.call(this,m,y)},Object.defineProperty(f,"annotationLabels",{get:function(){return{error:{singular:e("gutter-tooltip.aria-label.error.singular","error"),plural:e("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:e("gutter-tooltip.aria-label.security.singular","security finding"),plural:e("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:e("gutter-tooltip.aria-label.warning.singular","warning"),plural:e("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:e("gutter-tooltip.aria-label.info.singular","information message"),plural:e("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:e("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:e("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),f.prototype.showTooltip=function(m){var y,D=this.editor.renderer.$gutterLayer,E=D.$annotations[m],b;E?b={displayText:Array.from(E.displayText),type:Array.from(E.type)}:b={displayText:[],type:[]};var g=D.session.getFoldLine(m);if(g&&D.$showFoldedAnnotations){for(var S={error:[],security:[],warning:[],info:[],hint:[]},T={error:1,security:2,warning:3,info:4,hint:5},k,_=m+1;_<=g.end.row;_++)if(D.$annotations[_])for(var R=0;R<D.$annotations[_].text.length;R++){var x=D.$annotations[_].type[R];S[x].push(D.$annotations[_].text[R]),(!k||T[x]<T[k])&&(k=x)}if(["error","security","warning"].includes(k)){var A="".concat(f.annotationsToSummaryString(S)," in folded code.");b.displayText.push(A),b.type.push(k+"_fold")}}if(b.displayText.length===0)return this.hideTooltip();for(var C={error:[],security:[],warning:[],info:[],hint:[]},w=D.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",_=0;_<b.displayText.length;_++){var $=d.createElement("span"),I=d.createElement("span");(y=I.classList).add.apply(y,["ace_".concat(b.type[_]),w]),I.setAttribute("aria-label","".concat(f.annotationLabels[b.type[_].replace("_fold","")].singular)),I.setAttribute("role","img"),I.appendChild(d.createTextNode(" ")),$.appendChild(I),$.appendChild(d.createTextNode(b.displayText[_])),$.appendChild(d.createElement("br")),C[b.type[_].replace("_fold","")].push($)}var F=this.getElement();d.removeChildren(F),C.error.forEach(function(O){return F.appendChild(O)}),C.security.forEach(function(O){return F.appendChild(O)}),C.warning.forEach(function(O){return F.appendChild(O)}),C.info.forEach(function(O){return F.appendChild(O)}),C.hint.forEach(function(O){return F.appendChild(O)}),F.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.visibleTooltipRow=m,this.editor._signal("showGutterTooltip",this)},f.prototype.hideTooltip=function(){this.isOpen&&(this.$element.removeAttribute("aria-live"),this.hide(),this.visibleTooltipRow=void 0,this.editor._signal("hideGutterTooltip",this))},f.annotationsToSummaryString=function(m){var y,D,E=[],b=["error","security","warning","info","hint"];try{for(var g=h(b),S=g.next();!S.done;S=g.next()){var T=S.value;if(m[T].length){var k=m[T].length===1?f.annotationLabels[T].singular:f.annotationLabels[T].plural;E.push("".concat(m[T].length," ").concat(k))}}}catch(_){y={error:_}}finally{try{S&&!S.done&&(D=g.return)&&D.call(g)}finally{if(y)throw y.error}}return E.join(", ")},f}(p);u.GutterTooltip=s}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(n,u,v){var a=n("../lib/event"),h=n("../lib/useragent"),d=function(){function o(p,e){this.speed,this.wheelX,this.wheelY,this.domEvent=p,this.editor=e,this.x=this.clientX=p.clientX,this.y=this.clientY=p.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return o.prototype.stopPropagation=function(){a.stopPropagation(this.domEvent),this.propagationStopped=!0},o.prototype.preventDefault=function(){a.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 p=this.getDocumentPosition().row,e=this.editor.session.documentToScreenRow(p,0),t=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return e-t},o.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var p=this.editor,e=p.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},o.prototype.getButton=function(){return a.getButton(this.domEvent)},o.prototype.getShiftKey=function(){return this.domEvent.shiftKey},o.prototype.getAccelKey=function(){return h.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},o}();u.MouseEvent=d}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(n,u,v){var a=n("../lib/dom"),h=n("../lib/event"),d=n("../lib/useragent"),o=200,p=200,e=5;function t(l){var s=l.editor,c=a.createElement("div");c.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",c.textContent=" ";var f=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];f.forEach(function(W){l[W]=this[W]},this),s.on("mousedown",this.onMouseDown.bind(l));var m=s.container,y,D,E,b,g,S,T=0,k,_,R,x,A;this.onDragStart=function(W){if(this.cancelDrag||!m.draggable){var H=this;return setTimeout(function(){H.startSelect(),H.captureMouse(W)},0),W.preventDefault()}g=s.getSelectionRange();var U=W.dataTransfer;U.effectAllowed=s.getReadOnly()?"copy":"copyMove",s.container.appendChild(c),U.setDragImage&&U.setDragImage(c,0,0),setTimeout(function(){s.container.removeChild(c)}),U.clearData(),U.setData("Text",s.session.getTextRange()),_=!0,this.setState("drag")},this.onDragEnd=function(W){if(m.draggable=!1,_=!1,this.setState(null),!s.getReadOnly()){var H=W.dataTransfer.dropEffect;!k&&H=="move"&&s.session.remove(s.getSelectionRange()),s.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(W){if(!(s.getReadOnly()||!P(W.dataTransfer)))return D=W.clientX,E=W.clientY,y||I(),T++,W.dataTransfer.dropEffect=k=V(W),h.preventDefault(W)},this.onDragOver=function(W){if(!(s.getReadOnly()||!P(W.dataTransfer)))return D=W.clientX,E=W.clientY,y||(I(),T++),O!==null&&(O=null),W.dataTransfer.dropEffect=k=V(W),h.preventDefault(W)},this.onDragLeave=function(W){if(T--,T<=0&&y)return F(),k=null,h.preventDefault(W)},this.onDrop=function(W){if(S){var H=W.dataTransfer;if(_)switch(k){case"move":g.contains(S.row,S.column)?g={start:S,end:S}:g=s.moveText(g,S);break;case"copy":g=s.moveText(g,S,!0);break}else{var U=H.getData("Text");g={start:S,end:s.session.insert(S,U)},s.focus(),k=null}return F(),h.preventDefault(W)}},h.addListener(m,"dragstart",this.onDragStart.bind(l),s),h.addListener(m,"dragend",this.onDragEnd.bind(l),s),h.addListener(m,"dragenter",this.onDragEnter.bind(l),s),h.addListener(m,"dragover",this.onDragOver.bind(l),s),h.addListener(m,"dragleave",this.onDragLeave.bind(l),s),h.addListener(m,"drop",this.onDrop.bind(l),s);function C(W,H){var U=Date.now(),G=!H||W.row!=H.row,Y=!H||W.column!=H.column;if(!x||G||Y)s.moveCursorToPosition(W),x=U,A={x:D,y:E};else{var Q=r(A.x,A.y,D,E);Q>e?x=null:U-x>=p&&(s.renderer.scrollCursorIntoView(),x=null)}}function w(W,H){var U=Date.now(),G=s.renderer.layerConfig.lineHeight,Y=s.renderer.layerConfig.characterWidth,Q=s.renderer.scroller.getBoundingClientRect(),ee={x:{left:D-Q.left,right:Q.right-D},y:{top:E-Q.top,bottom:Q.bottom-E}},ne=Math.min(ee.x.left,ee.x.right),se=Math.min(ee.y.top,ee.y.bottom),ge={row:W.row,column:W.column};ne/Y<=2&&(ge.column+=ee.x.left<ee.x.right?-3:2),se/G<=1&&(ge.row+=ee.y.top<ee.y.bottom?-1:1);var be=W.row!=ge.row,ke=W.column!=ge.column,Ce=!H||W.row!=H.row;be||ke&&!Ce?R?U-R>=o&&s.renderer.scrollCursorIntoView(ge):R=U:R=null}function $(){var W=S;S=s.renderer.screenToTextCoordinates(D,E),C(S,W),w(S,W)}function I(){g=s.selection.toOrientedRange(),y=s.session.addMarker(g,"ace_selection",s.getSelectionStyle()),s.clearSelection(),s.isFocused()&&s.renderer.$cursorLayer.setBlinking(!1),clearInterval(b),$(),b=setInterval($,20),T=0,h.addListener(document,"mousemove",B)}function F(){clearInterval(b),s.session.removeMarker(y),y=null,s.selection.fromOrientedRange(g),s.isFocused()&&!_&&s.$resetCursorStyle(),g=null,S=null,T=0,R=null,x=null,h.removeListener(document,"mousemove",B)}var O=null;function B(){O==null&&(O=setTimeout(function(){O!=null&&y&&F()},20))}function P(W){var H=W.types;return!H||Array.prototype.some.call(H,function(U){return U=="text/plain"||U=="Text"})}function V(W){var H=["copy","copymove","all","uninitialized"],U=["move","copymove","linkmove","all","uninitialized"],G=d.isMac?W.altKey:W.ctrlKey,Y="uninitialized";try{Y=W.dataTransfer.effectAllowed.toLowerCase()}catch{}var Q="none";return G&&H.indexOf(Y)>=0?Q="copy":U.indexOf(Y)>=0?Q="move":H.indexOf(Y)>=0&&(Q="copy"),Q}}(function(){this.dragWait=function(){var l=Date.now()-this.mousedownEvent.time;l>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var l=this.editor.container;l.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(l){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var l=this.editor,s=l.container;s.draggable=!0,l.renderer.$cursorLayer.setBlinking(!1),l.setStyle("ace_dragging");var c=d.isWin?"default":"move";l.renderer.setCursorStyle(c),this.setState("dragReady")},this.onMouseDrag=function(l){var s=this.editor.container;if(d.isIE&&this.state=="dragReady"){var c=r(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);c>3&&s.dragDrop()}if(this.state==="dragWait"){var c=r(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);c>0&&(s.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(l){if(this.$dragEnabled){this.mousedownEvent=l;var s=this.editor,c=l.inSelection(),f=l.getButton(),m=l.domEvent.detail||1;if(m===1&&f===0&&c){if(l.editor.inMultiSelectMode&&(l.getAccelKey()||l.getShiftKey()))return;this.mousedownEvent.time=Date.now();var y=l.domEvent.target||l.domEvent.srcElement;if("unselectable"in y&&(y.unselectable="on"),s.getDragDelay()){if(d.isWebKit){this.cancelDrag=!0;var D=s.container;D.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(l,this.onMouseDrag.bind(this)),l.defaultPrevented=!0}}}}).call(t.prototype);function r(l,s,c,f){return Math.sqrt(Math.pow(c-l,2)+Math.pow(f-s,2))}u.DragdropHandler=t}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(n,u,v){var a=n("./mouse_event").MouseEvent,h=n("../lib/event"),d=n("../lib/dom");u.addTouchListeners=function(o,p){var e="scroll",t,r,l,s,c,f,m=0,y,D=0,E=0,b=0,g,S;function T(){var C=window.navigator&&window.navigator.clipboard,w=!1,$=function(){var O=p.getCopyText(),B=p.session.getUndoManager().hasUndo();S.replaceChild(d.buildDom(w?["span",!O&&I("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],O&&I("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],O&&I("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],C&&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"]),S.firstChild)},I=function(O){return p.commands.canExecute(O,p)},F=function(O){var B=O.target.getAttribute("action");if(B=="more"||!w)return w=!w,$();B=="paste"?C.readText().then(function(P){p.execCommand(B,P)}):B&&((B=="cut"||B=="copy")&&(C?C.writeText(p.getCopyText()):document.execCommand("copy")),p.execCommand(B)),S.firstChild.style.display="none",w=!1,B!="openCommandPalette"&&p.focus()};S=d.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(O){e="menu",O.stopPropagation(),O.preventDefault(),p.textInput.focus()},ontouchend:function(O){O.stopPropagation(),O.preventDefault(),F(O)},onclick:F},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],p.container)}function k(){if(!p.getOption("enableMobileMenu")){S&&_();return}S||T();var C=p.selection.cursor,w=p.renderer.textToScreenCoordinates(C.row,C.column),$=p.renderer.textToScreenCoordinates(0,0).pageX,I=p.renderer.scrollLeft,F=p.container.getBoundingClientRect();S.style.top=w.pageY-F.top-3+"px",w.pageX-F.left<F.width-70?(S.style.left="",S.style.right="10px"):(S.style.right="",S.style.left=$+I-F.left+"px"),S.style.display="",S.firstChild.style.display="none",p.on("input",_)}function _(C){S&&(S.style.display="none"),p.off("input",_)}function R(){c=null,clearTimeout(c);var C=p.selection.getRange(),w=C.contains(y.row,y.column);(C.isEmpty()||!w)&&(p.selection.moveToPosition(y),p.selection.selectWord()),e="wait",k()}function x(){c=null,clearTimeout(c),p.selection.moveToPosition(y);var C=D>=2?p.selection.getLineRange(y.row):p.session.getBracketRange(y);C&&!C.isEmpty()?p.selection.setRange(C):p.selection.selectWord(),e="wait"}h.addListener(o,"contextmenu",function(C){if(g){var w=p.textInput.getElement();w.focus()}},p),h.addListener(o,"touchstart",function(C){var w=C.touches;if(c||w.length>1){clearTimeout(c),c=null,l=-1,e="zoom";return}g=p.$mouseHandler.isMousePressed=!0;var $=p.renderer.layerConfig.lineHeight,I=p.renderer.layerConfig.lineHeight,F=C.timeStamp;s=F;var O=w[0],B=O.clientX,P=O.clientY;Math.abs(t-B)+Math.abs(r-P)>$&&(l=-1),t=C.clientX=B,r=C.clientY=P,E=b=0;var V=new a(C,p);if(y=V.getDocumentPosition(),F-l<500&&w.length==1&&!m)D++,C.preventDefault(),C.button=0,x();else{D=0;var W=p.selection.cursor,H=p.selection.isEmpty()?W:p.selection.anchor,U=p.renderer.$cursorLayer.getPixelPosition(W,!0),G=p.renderer.$cursorLayer.getPixelPosition(H,!0),Y=p.renderer.scroller.getBoundingClientRect(),Q=p.renderer.layerConfig.offset,ee=p.renderer.scrollLeft,ne=function(be,ke){return be=be/I,ke=ke/$-.75,be*be+ke*ke};if(C.clientX<Y.left){e="zoom";return}var se=ne(C.clientX-Y.left-U.left+ee,C.clientY-Y.top-U.top+Q),ge=ne(C.clientX-Y.left-G.left+ee,C.clientY-Y.top-G.top+Q);se<3.5&&ge<3.5&&(e=se>ge?"cursor":"anchor"),ge<3.5?e="anchor":se<3.5?e="cursor":e="scroll",c=setTimeout(R,450)}l=F},p),h.addListener(o,"touchend",function(C){g=p.$mouseHandler.isMousePressed=!1,f&&clearInterval(f),e=="zoom"?(e="",m=0):c?(p.selection.moveToPosition(y),m=0,k()):e=="scroll"?(A(),_()):k(),clearTimeout(c),c=null},p),h.addListener(o,"touchmove",function(C){c&&(clearTimeout(c),c=null);var w=C.touches;if(!(w.length>1||e=="zoom")){var $=w[0],I=t-$.clientX,F=r-$.clientY;if(e=="wait")if(I*I+F*F>4)e="cursor";else return C.preventDefault();t=$.clientX,r=$.clientY,C.clientX=$.clientX,C.clientY=$.clientY;var O=C.timeStamp,B=O-s;if(s=O,e=="scroll"){var P=new a(C,p);P.speed=1,P.wheelX=I,P.wheelY=F,10*Math.abs(I)<Math.abs(F)&&(I=0),10*Math.abs(F)<Math.abs(I)&&(F=0),B!=0&&(E=I/B,b=F/B),p._emit("mousewheel",P),P.propagationStopped||(E=b=0)}else{var V=new a(C,p),W=V.getDocumentPosition();e=="cursor"?p.selection.moveCursorToPosition(W):e=="anchor"&&p.selection.setSelectionAnchor(W.row,W.column),p.renderer.scrollCursorIntoView(W),C.preventDefault()}}},p);function A(){m+=60,f=setInterval(function(){m--<=0&&(clearInterval(f),f=null),Math.abs(E)<.01&&(E=0),Math.abs(b)<.01&&(b=0),m<20&&(E=.9*E),m<20&&(b=.9*b);var C=p.session.getScrollTop();p.renderer.scrollBy(10*E,10*b),C==p.session.getScrollTop()&&(m=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(n,u,v){var a=n("../lib/event"),h=n("../lib/useragent"),d=n("./default_handlers").DefaultHandlers,o=n("./default_gutter_handler").GutterHandler,p=n("./mouse_event").MouseEvent,e=n("./dragdrop_handler").DragdropHandler,t=n("./touch_handler").addTouchListeners,r=n("../config"),l=function(){function s(c){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var f=this;this.editor=c,new d(this),new o(this),new e(this);var m=function(E){var b=!document.hasFocus||!document.hasFocus()||!c.isFocused()&&document.activeElement==(c.textInput&&c.textInput.getElement());b&&window.focus(),c.focus(),setTimeout(function(){c.isFocused()||c.focus()})},y=c.renderer.getMouseEventTarget();a.addListener(y,"click",this.onMouseEvent.bind(this,"click"),c),a.addListener(y,"mousemove",this.onMouseMove.bind(this,"mousemove"),c),a.addMultiMouseDownListener([y,c.renderer.scrollBarV&&c.renderer.scrollBarV.inner,c.renderer.scrollBarH&&c.renderer.scrollBarH.inner,c.textInput&&c.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",c),a.addMouseWheelListener(c.container,this.onMouseWheel.bind(this,"mousewheel"),c),t(c.container,c);var D=c.renderer.$gutter;a.addListener(D,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),c),a.addListener(D,"click",this.onMouseEvent.bind(this,"gutterclick"),c),a.addListener(D,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),c),a.addListener(D,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),c),a.addListener(y,"mousedown",m,c),a.addListener(D,"mousedown",m,c),h.isIE&&c.renderer.scrollBarV&&(a.addListener(c.renderer.scrollBarV.element,"mousedown",m,c),a.addListener(c.renderer.scrollBarH.element,"mousedown",m,c)),c.on("mousemove",function(E){if(!(f.state||f.$dragDelay||!f.$dragEnabled)){var b=c.renderer.screenToTextCoordinates(E.x,E.y),g=c.session.selection.getRange(),S=c.renderer;!g.isEmpty()&&g.insideStart(b.row,b.column)?S.setCursorStyle("default"):S.setCursorStyle("")}},c)}return s.prototype.onMouseEvent=function(c,f){this.editor.session&&this.editor._emit(c,new p(f,this.editor))},s.prototype.onMouseMove=function(c,f){var m=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!m||!m.length||this.editor._emit(c,new p(f,this.editor))},s.prototype.onMouseWheel=function(c,f){var m=new p(f,this.editor);m.speed=this.$scrollSpeed*2,m.wheelX=f.wheelX,m.wheelY=f.wheelY,this.editor._emit(c,m)},s.prototype.setState=function(c){this.state=c},s.prototype.captureMouse=function(c,f){this.x=c.x,this.y=c.y,this.isMousePressed=!0;var m=this.editor,y=this.editor.renderer;y.$isMousePressed=!0;var D=this,E=function(k){if(k){if(h.isWebKit&&!k.which&&D.releaseMouse)return D.releaseMouse();D.x=k.clientX,D.y=k.clientY,f&&f(k),D.mouseEvent=new p(k,D.editor),D.$mouseMoved=!0}},b=function(k){m.off("beforeEndOperation",S),clearInterval(T),m.session&&g(),D[D.state+"End"]&&D[D.state+"End"](k),D.state="",D.isMousePressed=y.$isMousePressed=!1,y.$keepTextAreaAtCursor&&y.$moveTextAreaToCursor(),D.$onCaptureMouseMove=D.releaseMouse=null,k&&D.onMouseEvent("mouseup",k),m.endOperation()},g=function(){D[D.state]&&D[D.state](),D.$mouseMoved=!1};if(h.isOldIE&&c.domEvent.type=="dblclick")return setTimeout(function(){b(c)});var S=function(k){D.releaseMouse&&m.curOp.command.name&&m.curOp.selectionChanged&&(D[D.state+"End"]&&D[D.state+"End"](),D.state="",D.releaseMouse())};m.on("beforeEndOperation",S),m.startOperation({command:{name:"mouse"}}),D.$onCaptureMouseMove=E,D.releaseMouse=a.capture(this.editor.container,E,b);var T=setInterval(g,20)},s.prototype.cancelContextMenu=function(){var c=function(f){f&&f.domEvent&&f.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",c),f&&f.domEvent&&a.stopEvent(f.domEvent))}.bind(this);setTimeout(c,10),this.editor.on("nativecontextmenu",c)},s.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},s}();l.prototype.releaseMouse=null,r.defineOptions(l.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:h.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),u.MouseHandler=l}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(n,u,v){var a=n("../lib/dom"),h=function(){function d(o){o.on("click",function(p){var e=p.getDocumentPosition(),t=o.session,r=t.getFoldAt(e.row,e.column,1);r&&(p.getAccelKey()?t.removeFold(r):t.expandFold(r),p.stop());var l=p.domEvent&&p.domEvent.target;l&&a.hasCssClass(l,"ace_inline_button")&&a.hasCssClass(l,"ace_toggle_wrap")&&(t.setOption("wrap",!t.getUseWrapMode()),o.renderer.scrollCursorIntoView())}),o.on("gutterclick",function(p){var e=o.renderer.$gutterLayer.getRegion(p);if(e=="foldWidgets"){var t=p.getDocumentPosition().row,r=o.session;r.foldWidgets&&r.foldWidgets[t]&&o.session.onFoldWidgetClick(t,p),o.isFocused()||o.focus(),p.stop()}}),o.on("gutterdblclick",function(p){var e=o.renderer.$gutterLayer.getRegion(p);if(e=="foldWidgets"){var t=p.getDocumentPosition().row,r=o.session,l=r.getParentFoldRangeData(t,!0),s=l.range||l.firstRange;if(s){t=s.start.row;var c=r.getFoldAt(t,r.getLine(t).length,1);c?r.removeFold(c):(r.addFold("...",s),o.renderer.scrollCursorIntoView({row:s.start.row,column:0}))}p.stop()}})}return d}();u.FoldHandler=h}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(n,u,v){var a=n("../lib/keys"),h=n("../lib/event"),d=function(){function o(p){this.$editor=p,this.$data={editor:p},this.$handlers=[],this.setDefaultHandler(p.commands)}return o.prototype.setDefaultHandler=function(p){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=p,this.addKeyboardHandler(p,0)},o.prototype.setKeyboardHandler=function(p){var e=this.$handlers;if(e[e.length-1]!=p){for(;e[e.length-1]&&e[e.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(e[e.length-1]);this.addKeyboardHandler(p,1)}},o.prototype.addKeyboardHandler=function(p,e){if(p){typeof p=="function"&&!p.handleKeyboard&&(p.handleKeyboard=p);var t=this.$handlers.indexOf(p);t!=-1&&this.$handlers.splice(t,1),e==null?this.$handlers.push(p):this.$handlers.splice(e,0,p),t==-1&&p.attach&&p.attach(this.$editor)}},o.prototype.removeKeyboardHandler=function(p){var e=this.$handlers.indexOf(p);return e==-1?!1:(this.$handlers.splice(e,1),p.detach&&p.detach(this.$editor),!0)},o.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},o.prototype.getStatusText=function(){var p=this.$data,e=p.editor;return this.$handlers.map(function(t){return t.getStatusText&&t.getStatusText(e,p)||""}).filter(Boolean).join(" ")},o.prototype.$callKeyboardHandlers=function(p,e,t,r){for(var l,s=!1,c=this.$editor.commands,f=this.$handlers.length;f--&&(l=this.$handlers[f].handleKeyboard(this.$data,p,e,t,r),!(!(!l||!l.command)&&(l.command=="null"?s=!0:s=c.exec(l.command,this.$editor,l.args,r),s&&r&&p!=-1&&l.passEvent!=!0&&l.command.passEvent!=!0&&h.stopEvent(r),s))););return!s&&p==-1&&(l={command:"insertstring"},s=c.exec("insertstring",this.$editor,e)),s&&this.$editor._signal&&this.$editor._signal("keyboardActivity",l),s},o.prototype.onCommandKey=function(p,e,t){var r=a.keyCodeToString(t);return this.$callKeyboardHandlers(e,r,t,p)},o.prototype.onTextInput=function(p){return this.$callKeyboardHandlers(-1,p)},o}();u.KeyBinding=d}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(n,u,v){var a=0,h=0,d=!1,o=!1,p=!1,e=[[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]],t=[[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]],r=0,l=1,s=0,c=1,f=2,m=3,y=4,D=5,E=6,b=7,g=8,S=9,T=10,k=11,_=12,R=13,x=14,A=15,C=16,w=17,$=18,I=[$,$,$,$,$,$,$,$,$,E,D,E,g,D,$,$,$,$,$,$,$,$,$,$,$,$,$,$,D,D,D,E,g,y,y,k,k,k,y,y,y,y,y,T,S,T,S,S,f,f,f,f,f,f,f,f,f,f,S,y,y,y,y,y,y,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,y,y,y,y,y,y,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,y,y,y,y,$,$,$,$,$,$,D,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,S,y,k,k,k,k,y,y,y,y,s,y,y,$,y,y,k,k,f,f,y,s,y,y,y,f,s,y,y,y,y,y],F=[g,g,g,g,g,g,g,g,g,g,g,$,$,$,s,c,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,g,D,R,x,A,C,w,S,k,k,k,k,k,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,S,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,g];function O(W,H,U,G){var Y=a?t:e,Q=null,ee=null,ne=null,se=0,ge=null,be=null,ke=-1,Ce=null,Ne=null,Xe=[];if(!G)for(Ce=0,G=[];Ce<U;Ce++)G[Ce]=V(W[Ce]);for(h=a,d=!1,o=!1,p=!1,Ne=0;Ne<U;Ne++){if(Q=se,Xe[Ne]=ee=P(W,G,Xe,Ne),se=Y[Q][ee],ge=se&240,se&=15,H[Ne]=ne=Y[se][5],ge>0)if(ge==16){for(Ce=ke;Ce<Ne;Ce++)H[Ce]=1;ke=-1}else ke=-1;if(be=Y[se][6],be)ke==-1&&(ke=Ne);else if(ke>-1){for(Ce=ke;Ce<Ne;Ce++)H[Ce]=ne;ke=-1}G[Ne]==D&&(H[Ne]=0),h|=ne}if(p){for(Ce=0;Ce<U;Ce++)if(G[Ce]==E){H[Ce]=a;for(var Ze=Ce-1;Ze>=0&&G[Ze]==g;Ze--)H[Ze]=a}}}function B(W,H,U){if(!(h<W)){if(W==1&&a==l&&!o){U.reverse();return}for(var G=U.length,Y=0,Q,ee,ne,se;Y<G;){if(H[Y]>=W){for(Q=Y+1;Q<G&&H[Q]>=W;)Q++;for(ee=Y,ne=Q-1;ee<ne;ee++,ne--)se=U[ee],U[ee]=U[ne],U[ne]=se;Y=Q}Y++}}}function P(W,H,U,G){var Y=H[G],Q,ee,ne,se;switch(Y){case s:case c:d=!1;case y:case m:return Y;case f:return d?m:f;case b:return d=!0,c;case g:return y;case S:return G<1||G+1>=H.length||(Q=U[G-1])!=f&&Q!=m||(ee=H[G+1])!=f&&ee!=m?y:(d&&(ee=m),ee==Q?ee:y);case T:return Q=G>0?U[G-1]:D,Q==f&&G+1<H.length&&H[G+1]==f?f:y;case k:if(G>0&&U[G-1]==f)return f;if(d)return y;for(se=G+1,ne=H.length;se<ne&&H[se]==k;)se++;return se<ne&&H[se]==f?f:y;case _:for(ne=H.length,se=G+1;se<ne&&H[se]==_;)se++;if(se<ne){var ge=W[G],be=ge>=1425&&ge<=2303||ge==64286;if(Q=H[se],be&&(Q==c||Q==b))return c}return G<1||(Q=H[G-1])==D?y:U[G-1];case D:return d=!1,o=!0,a;case E:return p=!0,y;case R:case x:case C:case w:case A:d=!1;case $:return y}}function V(W){var H=W.charCodeAt(0),U=H>>8;return U==0?H>191?s:I[H]:U==5?/[\u0591-\u05f4]/.test(W)?c:s:U==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(W)?_:/[\u0660-\u0669\u066b-\u066c]/.test(W)?m:H==1642?k:/[\u06f0-\u06f9]/.test(W)?f:b:U==32&&H<=8287?F[H&255]:U==254&&H>=65136?b:y}u.L=s,u.R=c,u.EN=f,u.ON_R=3,u.AN=4,u.R_H=5,u.B=6,u.RLE=7,u.DOT="·",u.doBidiReorder=function(W,H,U){if(W.length<2)return{};var G=W.split(""),Y=new Array(G.length),Q=new Array(G.length),ee=[];a=U?l:r,O(G,ee,G.length,H);for(var ne=0;ne<Y.length;Y[ne]=ne,ne++);B(2,ee,Y),B(1,ee,Y);for(var ne=0;ne<Y.length-1;ne++)H[ne]===m?ee[ne]=u.AN:ee[ne]===c&&(H[ne]>b&&H[ne]<R||H[ne]===y||H[ne]===$)?ee[ne]=u.ON_R:ne>0&&G[ne-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(G[ne])&&(ee[ne-1]=ee[ne]=u.R_H,ne++);G[G.length-1]===u.DOT&&(ee[G.length-1]=u.B),G[0]==="‫"&&(ee[0]=u.RLE);for(var ne=0;ne<Y.length;ne++)Q[ne]=ee[Y[ne]];return{logicalFromVisual:Y,bidiLevels:Q}},u.hasBidiCharacters=function(W,H){for(var U=!1,G=0;G<W.length;G++)H[G]=V(W.charAt(G)),!U&&(H[G]==c||H[G]==b||H[G]==m)&&(U=!0);return U},u.getVisualFromLogicalIdx=function(W,H){for(var U=0;U<H.logicalFromVisual.length;U++)if(H.logicalFromVisual[U]==W)return U;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(n,u,v){var a=n("./lib/bidiutil"),h=n("./lib/lang"),d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,o=function(){function p(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=a,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=d.test(e.getValue())}return p.prototype.isBidiRow=function(e,t,r){return this.seenBidi?(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,r),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},p.prototype.onChange=function(e){this.seenBidi?this.currentRow=null:e.action=="insert"&&d.test(e.lines.join(`
193
- `))&&(this.seenBidi=!0,this.currentRow=null)},p.prototype.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var r=this.session.$getRowCacheIndex(t,this.currentRow);r>=0&&(e=this.session.$docRowCache[r])}return e},p.prototype.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var r,l=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(r=this.session.$getRowCacheIndex(t,this.currentRow-e-1),r===l);)l=r,e++;else e=this.currentRow;return e},p.prototype.updateRowLine=function(e,t){e===void 0&&(e=this.getDocumentRow());var r=e===this.session.getLength()-1,l=r?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(t===void 0&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[a.L],this.line=t<s.length?this.line.substring(s[t-1],s[t]):this.line.substring(s[s.length-1])):this.line=this.line.substring(0,s[t]),t==s.length&&(this.line+=this.showInvisibles?l:a.DOT))}else this.line+=this.showInvisibles?l:a.DOT;var c=this.session,f=0,m;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(y,D){return y===" "||c.isFullWidth(y.charCodeAt(0))?(m=y===" "?c.getScreenTabSize(D+f):2,f+=m-1,h.stringRepeat(a.DOT,m)):y}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==a.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},p.prototype.updateBidiMap=function(){var e=[];a.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=a.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},p.prototype.markAsDirty=function(){this.currentRow=null},p.prototype.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width,r=e.$measureCharWidth("ה");this.charWidths[a.L]=this.charWidths[a.EN]=this.charWidths[a.ON_R]=t,this.charWidths[a.R]=this.charWidths[a.AN]=r,this.charWidths[a.R_H]=r*.45,this.charWidths[a.B]=this.charWidths[a.RLE]=0,this.currentRow=null}},p.prototype.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},p.prototype.setEolChar=function(e){this.EOL=e},p.prototype.setContentWidth=function(e){this.contentWidth=e},p.prototype.isRtlLine=function(e){return this.$isRtl?!0:e!=null?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir},p.prototype.setRtlDirection=function(e,t){for(var r=e.getCursorPosition(),l=e.selection.getSelectionAnchor().row;l<=r.row;l++)!t&&e.session.getLine(l).charAt(0)===e.session.$bidiHandler.RLE?e.session.doc.removeInLine(l,0,1):t&&e.session.getLine(l).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:l},e.session.$bidiHandler.RLE)},p.prototype.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,r=e>t?this.session.getOverwrite()?e:e-1:t,l=a.getVisualFromLogicalIdx(r,this.bidiMap),s=this.bidiMap.bidiLevels,c=0;!this.session.getOverwrite()&&e<=t&&s[l]%2!==0&&l++;for(var f=0;f<l;f++)c+=this.charWidths[s[f]];return!this.session.getOverwrite()&&e>t&&s[l]%2===0&&(c+=this.charWidths[s[l]]),this.wrapIndent&&(c+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(c+=this.rtlLineOffset),c},p.prototype.getSelections=function(e,t){var r=this.bidiMap,l=r.bidiLevels,s,c=[],f=0,m=Math.min(e,t)-this.wrapIndent,y=Math.max(e,t)-this.wrapIndent,D=!1,E=!1,b=0;this.wrapIndent&&(f+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var g,S=0;S<l.length;S++)g=r.logicalFromVisual[S],s=l[S],D=g>=m&&g<y,D&&!E?b=f:!D&&E&&c.push({left:b,width:f-b}),f+=this.charWidths[s],E=D;if(D&&S===l.length&&c.push({left:b,width:f-b}),this.isRtlDir)for(var T=0;T<c.length;T++)c[T].left+=this.rtlLineOffset;return c},p.prototype.offsetToCol=function(r){this.isRtlDir&&(r-=this.rtlLineOffset);var t=0,r=Math.max(r,0),l=0,s=0,c=this.bidiMap.bidiLevels,f=this.charWidths[c[s]];for(this.wrapIndent&&(r-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);r>l+f/2;){if(l+=f,s===c.length-1){f=0;break}f=this.charWidths[c[++s]]}return s>0&&c[s-1]%2!==0&&c[s]%2===0?(r<l&&s--,t=this.bidiMap.logicalFromVisual[s]):s>0&&c[s-1]%2===0&&c[s]%2!==0?t=1+(r>l?this.bidiMap.logicalFromVisual[s]:this.bidiMap.logicalFromVisual[s-1]):this.isRtlDir&&s===c.length-1&&f===0&&c[s-1]%2===0||!this.isRtlDir&&s===0&&c[s]%2!==0?t=1+this.bidiMap.logicalFromVisual[s]:(s>0&&c[s-1]%2!==0&&f!==0&&s--,t=this.bidiMap.logicalFromVisual[s]),t===0&&this.isRtlDir&&t++,t+this.wrapIndent},p}();u.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(n,u,v){var a=n("./lib/oop"),h=n("./lib/lang"),d=n("./lib/event_emitter").EventEmitter,o=n("./range").Range,p=function(){function e(t){this.session=t,this.doc=t.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var r=this;this.cursor.on("change",function(l){r.$cursorChanged=!0,r.$silent||r._emit("changeCursor"),!r.$isEmpty&&!r.$silent&&r._emit("changeSelection"),!r.$keepDesiredColumnOnChange&&l.old.column!=l.value.column&&(r.$desiredColumn=null)}),this.anchor.on("change",function(){r.$anchorChanged=!0,!r.$isEmpty&&!r.$silent&&r._emit("changeSelection")})}return e.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},e.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},e.prototype.getCursor=function(){return this.lead.getPosition()},e.prototype.setAnchor=function(t,r){this.$isEmpty=!1,this.anchor.setPosition(t,r)},e.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},e.prototype.getSelectionLead=function(){return this.lead.getPosition()},e.prototype.isBackwards=function(){var t=this.anchor,r=this.lead;return t.row>r.row||t.row==r.row&&t.column>r.column},e.prototype.getRange=function(){var t=this.anchor,r=this.lead;return this.$isEmpty?o.fromPoints(r,r):this.isBackwards()?o.fromPoints(r,t):o.fromPoints(t,r)},e.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},e.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},e.prototype.setRange=function(t,r){var l=r?t.end:t.start,s=r?t.start:t.end;this.$setSelection(l.row,l.column,s.row,s.column)},e.prototype.$setSelection=function(t,r,l,s){if(!this.$silent){var c=this.$isEmpty,f=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(t,r),this.cursor.setPosition(l,s),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||c!=this.$isEmpty||f)&&this._emit("changeSelection")}},e.prototype.$moveSelection=function(t){var r=this.lead;this.$isEmpty&&this.setSelectionAnchor(r.row,r.column),t.call(this)},e.prototype.selectTo=function(t,r){this.$moveSelection(function(){this.moveCursorTo(t,r)})},e.prototype.selectToPosition=function(t){this.$moveSelection(function(){this.moveCursorToPosition(t)})},e.prototype.moveTo=function(t,r){this.clearSelection(),this.moveCursorTo(t,r)},e.prototype.moveToPosition=function(t){this.clearSelection(),this.moveCursorToPosition(t)},e.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},e.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},e.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},e.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},e.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},e.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},e.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},e.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},e.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},e.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},e.prototype.getWordRange=function(t,r){if(typeof r>"u"){var l=t||this.lead;t=l.row,r=l.column}return this.session.getWordRange(t,r)},e.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},e.prototype.selectAWord=function(){var t=this.getCursor(),r=this.session.getAWordRange(t.row,t.column);this.setSelectionRange(r)},e.prototype.getLineRange=function(t,r){var l=typeof t=="number"?t:this.lead.row,s,c=this.session.getFoldLine(l);return c?(l=c.start.row,s=c.end.row):s=l,r===!0?new o(l,0,s,this.session.getLine(s).length):new o(l,0,s+1,0)},e.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},e.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},e.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},e.prototype.wouldMoveIntoSoftTab=function(t,r,l){var s=t.column,c=t.column+r;return l<0&&(s=t.column-r,c=t.column),this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(s,c).split(" ").length-1==r},e.prototype.moveCursorLeft=function(){var t=this.lead.getPosition(),r;if(r=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(r.start.row,r.start.column);else if(t.column===0)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var l=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,l,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-l):this.moveCursorBy(0,-1)}},e.prototype.moveCursorRight=function(){var t=this.lead.getPosition(),r;if(r=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(r.end.row,r.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 l=this.session.getTabSize(),t=this.lead;this.wouldMoveIntoSoftTab(t,l,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,l):this.moveCursorBy(0,1)}},e.prototype.moveCursorLineStart=function(){var t=this.lead.row,r=this.lead.column,l=this.session.documentToScreenRow(t,r),s=this.session.screenToDocumentPosition(l,0),c=this.session.getDisplayLine(t,null,s.row,s.column),f=c.match(/^\s*/);f[0].length!=r&&!this.session.$useEmacsStyleLineStart&&(s.column+=f[0].length),this.moveCursorToPosition(s)},e.prototype.moveCursorLineEnd=function(){var t=this.lead,r=this.session.getDocumentLastRowColumnPosition(t.row,t.column);if(this.lead.column==r.column){var l=this.session.getLine(r.row);if(r.column==l.length){var s=l.search(/\s+$/);s>0&&(r.column=s)}}this.moveCursorTo(r.row,r.column)},e.prototype.moveCursorFileEnd=function(){var t=this.doc.getLength()-1,r=this.doc.getLine(t).length;this.moveCursorTo(t,r)},e.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},e.prototype.moveCursorLongWordRight=function(){var t=this.lead.row,r=this.lead.column,l=this.doc.getLine(t),s=l.substring(r);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var c=this.session.getFoldAt(t,r,1);if(c){this.moveCursorTo(c.end.row,c.end.column);return}if(this.session.nonTokenRe.exec(s)&&(r+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,s=l.substring(r)),r>=l.length){this.moveCursorTo(t,l.length),this.moveCursorRight(),t<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(s)&&(r+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,r)},e.prototype.moveCursorLongWordLeft=function(){var t=this.lead.row,r=this.lead.column,l;if(l=this.session.getFoldAt(t,r,-1)){this.moveCursorTo(l.start.row,l.start.column);return}var s=this.session.getFoldStringAt(t,r,-1);s==null&&(s=this.doc.getLine(t).substring(0,r));var c=h.stringReverse(s);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(c)&&(r-=this.session.nonTokenRe.lastIndex,c=c.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),r<=0){this.moveCursorTo(t,0),this.moveCursorLeft(),t>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(c)&&(r-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,r)},e.prototype.$shortWordEndIndex=function(t){var r=0,l,s=/\s/,c=this.session.tokenRe;if(c.lastIndex=0,this.session.tokenRe.exec(t))r=this.session.tokenRe.lastIndex;else{for(;(l=t[r])&&s.test(l);)r++;if(r<1){for(c.lastIndex=0;(l=t[r])&&!c.test(l);)if(c.lastIndex=0,r++,s.test(l))if(r>2){r--;break}else{for(;(l=t[r])&&s.test(l);)r++;if(r>2)break}}}return c.lastIndex=0,r},e.prototype.moveCursorShortWordRight=function(){var t=this.lead.row,r=this.lead.column,l=this.doc.getLine(t),s=l.substring(r),c=this.session.getFoldAt(t,r,1);if(c)return this.moveCursorTo(c.end.row,c.end.column);if(r==l.length){var f=this.doc.getLength();do t++,s=this.doc.getLine(t);while(t<f&&/^\s*$/.test(s));/^\s+/.test(s)||(s=""),r=0}var m=this.$shortWordEndIndex(s);this.moveCursorTo(t,r+m)},e.prototype.moveCursorShortWordLeft=function(){var t=this.lead.row,r=this.lead.column,l;if(l=this.session.getFoldAt(t,r,-1))return this.moveCursorTo(l.start.row,l.start.column);var s=this.session.getLine(t).substring(0,r);if(r===0){do t--,s=this.doc.getLine(t);while(t>0&&/^\s*$/.test(s));r=s.length,/\s+$/.test(s)||(s="")}var c=h.stringReverse(s),f=this.$shortWordEndIndex(c);return this.moveCursorTo(t,r-f)},e.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},e.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},e.prototype.moveCursorBy=function(t,r){var l=this.session.documentToScreenPosition(this.lead.row,this.lead.column),s;if(r===0&&(t!==0&&(this.session.$bidiHandler.isBidiRow(l.row,this.lead.row)?(s=this.session.$bidiHandler.getPosLeft(l.column),l.column=Math.round(s/this.session.$bidiHandler.charWidths[0])):s=l.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?l.column=this.$desiredColumn:this.$desiredColumn=l.column),t!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var c=this.session.lineWidgets[this.lead.row];t<0?t-=c.rowsAbove||0:t>0&&(t+=c.rowCount-(c.rowsAbove||0))}var f=this.session.screenToDocumentPosition(l.row+t,l.column,s);t!==0&&r===0&&f.row===this.lead.row&&(f.column,this.lead.column),this.moveCursorTo(f.row,f.column+r,r===0)},e.prototype.moveCursorToPosition=function(t){this.moveCursorTo(t.row,t.column)},e.prototype.moveCursorTo=function(t,r,l){var s=this.session.getFoldAt(t,r,1);s&&(t=s.start.row,r=s.start.column),this.$keepDesiredColumnOnChange=!0;var c=this.session.getLine(t);/[\uDC00-\uDFFF]/.test(c.charAt(r))&&c.charAt(r-1)&&(this.lead.row==t&&this.lead.column==r+1?r=r-1:r=r+1),this.lead.setPosition(t,r),this.$keepDesiredColumnOnChange=!1,l||(this.$desiredColumn=null)},e.prototype.moveCursorToScreen=function(t,r,l){var s=this.session.screenToDocumentPosition(t,r);this.moveCursorTo(s.row,s.column,l)},e.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},e.prototype.fromOrientedRange=function(t){this.setSelectionRange(t,t.cursor==t.start),this.$desiredColumn=t.desiredColumn||this.$desiredColumn},e.prototype.toOrientedRange=function(t){var r=this.getRange();return t?(t.start.column=r.start.column,t.start.row=r.start.row,t.end.column=r.end.column,t.end.row=r.end.row):t=r,t.cursor=this.isBackwards()?t.start:t.end,t.desiredColumn=this.$desiredColumn,t},e.prototype.getRangeOfMovements=function(t){var r=this.getCursor();try{t(this);var l=this.getCursor();return o.fromPoints(r,l)}catch{return o.fromPoints(r,r)}finally{this.moveCursorToPosition(r)}},e.prototype.toJSON=function(){if(this.rangeCount)var t=this.ranges.map(function(r){var l=r.clone();return l.isBackwards=r.cursor==r.start,l});else{var t=this.getRange();t.isBackwards=this.isBackwards()}return t},e.prototype.fromJSON=function(t){if(t.start==null)if(this.rangeList&&t.length>1){this.toSingleRange(t[0]);for(var r=t.length;r--;){var l=o.fromPoints(t[r].start,t[r].end);t[r].isBackwards&&(l.cursor=l.start),this.addRange(l,!0)}return}else t=t[0];this.rangeList&&this.toSingleRange(t),this.setSelectionRange(t,t.isBackwards)},e.prototype.isEqual=function(t){if((t.length||this.rangeCount)&&t.length!=this.rangeCount)return!1;if(!t.length||!this.ranges)return this.getRange().isEqual(t);for(var r=this.ranges.length;r--;)if(!this.ranges[r].isEqual(t[r]))return!1;return!0},e}();p.prototype.setSelectionAnchor=p.prototype.setAnchor,p.prototype.getSelectionAnchor=p.prototype.getAnchor,p.prototype.setSelectionRange=p.prototype.setRange,a.implement(p.prototype,d),u.Selection=p}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(n,u,v){var a=n("./lib/report_error").reportError,h=2e3,d=function(){function o(p){this.splitRegex,this.states=p,this.regExps={},this.matchMappings={};for(var e in this.states){for(var t=this.states[e],r=[],l=0,s=this.matchMappings[e]={defaultToken:"text"},c="g",f=[],m=0;m<t.length;m++){var y=t[m];if(y.defaultToken&&(s.defaultToken=y.defaultToken),y.caseInsensitive&&c.indexOf("i")===-1&&(c+="i"),y.unicode&&c.indexOf("u")===-1&&(c+="u"),y.regex!=null){y.regex instanceof RegExp&&(y.regex=y.regex.toString().slice(1,-1));var D=y.regex,E=new RegExp("(?:("+D+")|(.))").exec("a").length-2;Array.isArray(y.token)?y.token.length==1||E==1?y.token=y.token[0]:E-1!=y.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:y,groupCount:E-1}),y.token=y.token[0]):(y.tokenArray=y.token,y.token=null,y.onMatch=this.$arrayTokens):typeof y.token=="function"&&!y.onMatch&&(E>1?y.onMatch=this.$applyToken:y.onMatch=y.token),E>1&&(/\\\d/.test(y.regex)?D=y.regex.replace(/\\([0-9]+)/g,function(b,g){return"\\"+(parseInt(g,10)+l+1)}):(E=1,D=this.removeCapturingGroups(y.regex)),!y.splitRegex&&typeof y.token!="string"&&f.push(y)),s[l]=m,l+=E,r.push(D),y.onMatch||(y.onMatch=null)}}r.length||(s[0]=0,r.push("$")),f.forEach(function(b){b.splitRegex=this.createSplitterRegexp(b.regex,c)},this),this.regExps[e]=new RegExp("("+r.join(")|(")+")|($)",c)}}return o.prototype.$setMaxTokenCount=function(p){h=p|0},o.prototype.$applyToken=function(p){var e=this.splitRegex.exec(p).slice(1),t=this.token.apply(this,e);if(typeof t=="string")return[{type:t,value:p}];for(var r=[],l=0,s=t.length;l<s;l++)e[l]&&(r[r.length]={type:t[l],value:e[l]});return r},o.prototype.$arrayTokens=function(p){if(!p)return[];var e=this.splitRegex.exec(p);if(!e)return"text";for(var t=[],r=this.tokenArray,l=0,s=r.length;l<s;l++)e[l+1]&&(t[t.length]={type:r[l],value:e[l+1]});return t},o.prototype.removeCapturingGroups=function(p){var e=p.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(t,r){return r?"(?:":t});return e},o.prototype.createSplitterRegexp=function(p,e){if(p.indexOf("(?=")!=-1){var t=0,r=!1,l={};p.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(s,c,f,m,y,D){return r?r=y!="]":y?r=!0:m?(t==l.stack&&(l.end=D+1,l.stack=-1),t--):f&&(t++,f.length!=1&&(l.stack=t,l.start=D)),s}),l.end!=null&&/^\)*$/.test(p.substr(l.end))&&(p=p.substring(0,l.start)+p.substr(l.end))}return p.charAt(0)!="^"&&(p="^"+p),p.charAt(p.length-1)!="$"&&(p+="$"),new RegExp(p,(e||"").replace("g",""))},o.prototype.getLineTokens=function(p,e){if(e&&typeof e!="string"){var t=e.slice(0);e=t[0],e==="#tmp"&&(t.shift(),e=t.shift())}else var t=[];var r=e||"start",l=this.states[r];l||(r="start",l=this.states[r]);var s=this.matchMappings[r],c=this.regExps[r];c.lastIndex=0;for(var f,m=[],y=0,D=0,E={type:null,value:""};f=c.exec(p);){var b=s.defaultToken,g=null,S=f[0],T=c.lastIndex;if(T-S.length>y){var k=p.substring(y,T-S.length);E.type==b?E.value+=k:(E.type&&m.push(E),E={type:b,value:k})}for(var _=0;_<f.length-2;_++)if(f[_+1]!==void 0){g=l[s[_]],g.onMatch?b=g.onMatch(S,r,t,p):b=g.token,g.next&&(typeof g.next=="string"?r=g.next:r=g.next(r,t),l=this.states[r],l||(this.reportError("state doesn't exist",r),r="start",l=this.states[r]),s=this.matchMappings[r],y=T,c=this.regExps[r],c.lastIndex=T),g.consumeLineEnd&&(y=T);break}if(S){if(typeof b=="string")(!g||g.merge!==!1)&&E.type===b?E.value+=S:(E.type&&m.push(E),E={type:b,value:S});else if(b){E.type&&m.push(E),E={type:null,value:""};for(var _=0;_<b.length;_++)m.push(b[_])}}if(y==p.length)break;if(y=T,D++>h){for(D>2*p.length&&this.reportError("infinite loop with in ace tokenizer",{startState:e,line:p});y<p.length;)E.type&&m.push(E),E={value:p.substring(y,y+=500),type:"overflow"};r="start",t=[];break}}return E.type&&m.push(E),t.length>1&&t[0]!==r&&t.unshift("#tmp",r),{tokens:m,state:t.length?t:r}},o}();d.prototype.reportError=a,u.Tokenizer=d}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(n,u,v){var a=n("../lib/deep_copy").deepCopy,h;h=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},function(){this.addRules=function(p,e){if(!e){for(var t in p)this.$rules[t]=p[t];return}for(var t in p){for(var r=p[t],l=0;l<r.length;l++){var s=r[l];(s.next||s.onMatch)&&(typeof s.next=="string"&&s.next.indexOf(e)!==0&&(s.next=e+s.next),s.nextState&&s.nextState.indexOf(e)!==0&&(s.nextState=e+s.nextState))}this.$rules[e+t]=r}},this.getRules=function(){return this.$rules},this.embedRules=function(p,e,t,r,l){var s=typeof p=="function"?new p().getRules():p;if(r)for(var c=0;c<r.length;c++)r[c]=e+r[c];else{r=[];for(var f in s)r.push(e+f)}if(this.addRules(s,e),t)for(var m=Array.prototype[l?"push":"unshift"],c=0;c<r.length;c++)m.apply(this.$rules[r[c]],a(t));this.$embeds||(this.$embeds=[]),this.$embeds.push(e)},this.getEmbeds=function(){return this.$embeds};var d=function(p,e){return(p!="start"||e.length)&&e.unshift(this.nextState,p),this.nextState},o=function(p,e){return e.shift(),e.shift()||"start"};this.normalizeRules=function(){var p=0,e=this.$rules;function t(r){var l=e[r];l.processed=!0;for(var s=0;s<l.length;s++){var c=l[s],f=null;Array.isArray(c)&&(f=c,c={}),!c.regex&&c.start&&(c.regex=c.start,c.next||(c.next=[]),c.next.push({defaultToken:c.token},{token:c.token+".end",regex:c.end||c.start,next:"pop"}),c.token=c.token+".start",c.push=!0);var m=c.next||c.push;if(m&&Array.isArray(m)){var y=c.stateName;y||(y=c.token,typeof y!="string"&&(y=y[0]||""),e[y]&&(y+=p++)),e[y]=m,c.next=y,t(y)}else m=="pop"&&(c.next=o);if(c.push&&(c.nextState=c.next||c.push,c.next=d,delete c.push),c.rules)for(var D in c.rules)e[D]?e[D].push&&e[D].push.apply(e[D],c.rules[D]):e[D]=c.rules[D];var E=typeof c=="string"?c:c.include;if(E&&(E==="$self"&&(E="start"),Array.isArray(E)?f=E.map(function(g){return e[g]}):f=e[E]),f){var b=[s,1].concat(f);c.noEscape&&(b=b.filter(function(g){return!g.next})),l.splice.apply(l,b),s--}c.keywordMap&&(c.token=this.createKeywordMapper(c.keywordMap,c.defaultToken||"text",c.caseInsensitive),delete c.defaultToken)}}Object.keys(e).forEach(t,this)},this.createKeywordMapper=function(p,e,t,r){var l=Object.create(null);return this.$keywordList=[],Object.keys(p).forEach(function(s){for(var c=p[s],f=c.split(r||"|"),m=f.length;m--;){var y=f[m];this.$keywordList.push(y),t&&(y=y.toLowerCase()),l[y]=s}},this),p=null,t?function(s){return l[s.toLowerCase()]||e}:function(s){return l[s]||e}},this.getKeywords=function(){return this.$keywords}}.call(h.prototype),u.TextHighlightRules=h}),ace.define("ace/mode/behaviour",["require","exports","module"],function(n,u,v){var a;a=function(){this.$behaviours={}},function(){this.add=function(h,d,o){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[h]:this.$behaviours[h]={}}this.$behaviours[h][d]=o},this.addBehaviours=function(h){for(var d in h)for(var o in h[d])this.add(d,o,h[d][o])},this.remove=function(h){this.$behaviours&&this.$behaviours[h]&&delete this.$behaviours[h]},this.inherit=function(h,d){if(typeof h=="function")var o=new h().getBehaviours(d);else var o=h.getBehaviours(d);this.addBehaviours(o)},this.getBehaviours=function(h){if(h){for(var d={},o=0;o<h.length;o++)this.$behaviours[h[o]]&&(d[h[o]]=this.$behaviours[h[o]]);return d}else return this.$behaviours}}.call(a.prototype),u.Behaviour=a}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(n,u,v){var a=n("./range").Range,h=function(){function d(o,p,e){this.$session=o,this.$row=p,this.$rowTokens=o.getTokens(p);var t=o.getTokenAt(p,e);this.$tokenIndex=t?t.index:-1}return d.prototype.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},d.prototype.stepForward=function(){this.$tokenIndex+=1;for(var o;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,o||(o=this.$session.getLength()),this.$row>=o)return this.$row=o-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},d.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},d.prototype.getCurrentTokenRow=function(){return this.$row},d.prototype.getCurrentTokenColumn=function(){var o=this.$rowTokens,p=this.$tokenIndex,e=o[p].start;if(e!==void 0)return e;for(e=0;p>0;)p-=1,e+=o[p].value.length;return e},d.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},d.prototype.getCurrentTokenRange=function(){var o=this.$rowTokens[this.$tokenIndex],p=this.getCurrentTokenColumn();return new a(this.$row,p,this.$row,p+o.value.length)},d}();u.TokenIterator=h}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(n,u,v){var a=n("../../lib/oop"),h=n("../behaviour").Behaviour,d=n("../../token_iterator").TokenIterator,o=n("../../lib/lang"),p=["text","paren.rparen","rparen","paren","punctuation.operator"],e=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],t,r={},l={'"':'"',"'":"'"},s=function(m){var y=-1;if(m.multiSelect&&(y=m.selection.index,r.rangeCount!=m.multiSelect.rangeCount&&(r={rangeCount:m.multiSelect.rangeCount})),r[y])return t=r[y];t=r[y]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},c=function(m,y,D,E){var b=m.end.row-m.start.row;return{text:D+y+E,selection:[0,m.start.column+1,b,m.end.column+(b?0:1)]}},f;f=function(m){m=m||{},this.add("braces","insertion",function(y,D,E,b,g){var S=E.getCursorPosition(),T=b.doc.getLine(S.row);if(g=="{"){s(E);var k=E.getSelectionRange(),_=b.doc.getTextRange(k),R=b.getTokenAt(S.row,S.column);if(_!==""&&_!=="{"&&E.getWrapBehavioursEnabled())return c(k,_,"{","}");if(R&&/(?:string)\.quasi|\.xml/.test(R.type)){var x=[/tag\-(?:open|name)/,/attribute\-name/];return x.some(function(O){return O.test(R.type)})||/(string)\.quasi/.test(R.type)&&R.value[S.column-R.start-1]!=="$"?void 0:(f.recordAutoInsert(E,b,"}"),{text:"{}",selection:[1,1]})}else if(f.isSaneInsertion(E,b))return/[\]\}\)]/.test(T[S.column])||E.inMultiSelectMode||m.braces?(f.recordAutoInsert(E,b,"}"),{text:"{}",selection:[1,1]}):(f.recordMaybeInsert(E,b,"{"),{text:"{",selection:[1,1]})}else if(g=="}"){s(E);var A=T.substring(S.column,S.column+1);if(A=="}"){var C=b.$findOpeningBracket("}",{column:S.column+1,row:S.row});if(C!==null&&f.isAutoInsertedClosing(S,T,g))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(g==`
194
- `||g==`\r
195
- `){s(E);var w="";f.isMaybeInsertedClosing(S,T)&&(w=o.stringRepeat("}",t.maybeInsertedBrackets),f.clearMaybeInsertedClosing());var A=T.substring(S.column,S.column+1);if(A==="}"){var $=b.findMatchingBracket({row:S.row,column:S.column+1},"}");if(!$)return null;var I=this.$getIndent(b.getLine($.row))}else if(w)var I=this.$getIndent(T);else{f.clearMaybeInsertedClosing();return}var F=I+b.getTabString();return{text:`
196
- `+F+`
197
- `+I+w,selection:[1,F.length,1,F.length]}}else f.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(y,D,E,b,g){var S=b.doc.getTextRange(g);if(!g.isMultiLine()&&S=="{"){s(E);var T=b.doc.getLine(g.start.row),k=T.substring(g.end.column,g.end.column+1);if(k=="}")return g.end.column++,g;t.maybeInsertedBrackets--}}),this.add("parens","insertion",function(y,D,E,b,g){if(g=="("){s(E);var S=E.getSelectionRange(),T=b.doc.getTextRange(S);if(T!==""&&E.getWrapBehavioursEnabled())return c(S,T,"(",")");if(f.isSaneInsertion(E,b))return f.recordAutoInsert(E,b,")"),{text:"()",selection:[1,1]}}else if(g==")"){s(E);var k=E.getCursorPosition(),_=b.doc.getLine(k.row),R=_.substring(k.column,k.column+1);if(R==")"){var x=b.$findOpeningBracket(")",{column:k.column+1,row:k.row});if(x!==null&&f.isAutoInsertedClosing(k,_,g))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(y,D,E,b,g){var S=b.doc.getTextRange(g);if(!g.isMultiLine()&&S=="("){s(E);var T=b.doc.getLine(g.start.row),k=T.substring(g.start.column+1,g.start.column+2);if(k==")")return g.end.column++,g}}),this.add("brackets","insertion",function(y,D,E,b,g){if(g=="["){s(E);var S=E.getSelectionRange(),T=b.doc.getTextRange(S);if(T!==""&&E.getWrapBehavioursEnabled())return c(S,T,"[","]");if(f.isSaneInsertion(E,b))return f.recordAutoInsert(E,b,"]"),{text:"[]",selection:[1,1]}}else if(g=="]"){s(E);var k=E.getCursorPosition(),_=b.doc.getLine(k.row),R=_.substring(k.column,k.column+1);if(R=="]"){var x=b.$findOpeningBracket("]",{column:k.column+1,row:k.row});if(x!==null&&f.isAutoInsertedClosing(k,_,g))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(y,D,E,b,g){var S=b.doc.getTextRange(g);if(!g.isMultiLine()&&S=="["){s(E);var T=b.doc.getLine(g.start.row),k=T.substring(g.start.column+1,g.start.column+2);if(k=="]")return g.end.column++,g}}),this.add("string_dquotes","insertion",function(y,D,E,b,g){var S=b.$mode.$quotes||l;if(g.length==1&&S[g]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(g)!=-1)return;s(E);var T=g,k=E.getSelectionRange(),_=b.doc.getTextRange(k);if(_!==""&&(_.length!=1||!S[_])&&E.getWrapBehavioursEnabled())return c(k,_,T,T);if(!_){var R=E.getCursorPosition(),x=b.doc.getLine(R.row),A=x.substring(R.column-1,R.column),C=x.substring(R.column,R.column+1),w=b.getTokenAt(R.row,R.column),$=b.getTokenAt(R.row,R.column+1);if(A=="\\"&&w&&/escape/.test(w.type))return null;var I=w&&/string|escape/.test(w.type),F=!$||/string|escape/.test($.type),O;if(C==T)O=I!==F,O&&/string\.end/.test($.type)&&(O=!1);else{if(I&&!F||I&&F)return null;var B=b.$mode.tokenRe;B.lastIndex=0;var P=B.test(A);B.lastIndex=0;var V=B.test(C),W=b.$mode.$pairQuotesAfter,H=W&&W[T]&&W[T].test(A);if(!H&&P||V||C&&!/[\s;,.})\]\\]/.test(C))return null;var U=x[R.column-2];if(A==T&&(U==T||B.test(U)))return null;O=!0}return{text:O?T+T:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(y,D,E,b,g){var S=b.$mode.$quotes||l,T=b.doc.getTextRange(g);if(!g.isMultiLine()&&S.hasOwnProperty(T)){s(E);var k=b.doc.getLine(g.start.row),_=k.substring(g.start.column+1,g.start.column+2);if(_==T)return g.end.column++,g}}),m.closeDocComment!==!1&&this.add("doc comment end","insertion",function(y,D,E,b,g){if(y==="doc-start"&&(g===`
198
- `||g===`\r
199
- `)&&E.selection.isEmpty()){var S=E.getCursorPosition();if(S.column===0)return;for(var T=b.doc.getLine(S.row),k=b.doc.getLine(S.row+1),_=b.getTokens(S.row),R=0,x=0;x<_.length;x++){R+=_[x].value.length;var A=_[x];if(R>=S.column){if(R===S.column){if(!/\.doc/.test(A.type))return;if(/\*\//.test(A.value)){var C=_[x+1];if(!C||!/\.doc/.test(C.type))return}}var w=S.column-(R-A.value.length),$=A.value.indexOf("*/"),I=A.value.indexOf("/**",$>-1?$+2:0);if(I!==-1&&w>I&&w<I+3||$!==-1&&I!==-1&&w>=$&&w<=I||!/\.doc/.test(A.type))return;break}}var F=this.$getIndent(T);if(/\s*\*/.test(k))return/^\s*\*/.test(T)?{text:g+F+"* ",selection:[1,2+F.length,1,2+F.length]}:{text:g+F+" * ",selection:[1,3+F.length,1,3+F.length]};if(/\/\*\*/.test(T.substring(0,S.column)))return{text:g+F+" * "+g+" "+F+"*/",selection:[1,4+F.length,1,4+F.length]}}})},f.isSaneInsertion=function(m,y){var D=m.getCursorPosition(),E=new d(y,D.row,D.column);if(!this.$matchTokenType(E.getCurrentToken()||"text",p)){if(/[)}\]]/.test(m.session.getLine(D.row)[D.column]))return!0;var b=new d(y,D.row,D.column+1);if(!this.$matchTokenType(b.getCurrentToken()||"text",p))return!1}return E.stepForward(),E.getCurrentTokenRow()!==D.row||this.$matchTokenType(E.getCurrentToken()||"text",e)},f.$matchTokenType=function(m,y){return y.indexOf(m.type||m)>-1},f.recordAutoInsert=function(m,y,D){var E=m.getCursorPosition(),b=y.doc.getLine(E.row);this.isAutoInsertedClosing(E,b,t.autoInsertedLineEnd[0])||(t.autoInsertedBrackets=0),t.autoInsertedRow=E.row,t.autoInsertedLineEnd=D+b.substr(E.column),t.autoInsertedBrackets++},f.recordMaybeInsert=function(m,y,D){var E=m.getCursorPosition(),b=y.doc.getLine(E.row);this.isMaybeInsertedClosing(E,b)||(t.maybeInsertedBrackets=0),t.maybeInsertedRow=E.row,t.maybeInsertedLineStart=b.substr(0,E.column)+D,t.maybeInsertedLineEnd=b.substr(E.column),t.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(m,y,D){return t.autoInsertedBrackets>0&&m.row===t.autoInsertedRow&&D===t.autoInsertedLineEnd[0]&&y.substr(m.column)===t.autoInsertedLineEnd},f.isMaybeInsertedClosing=function(m,y){return t.maybeInsertedBrackets>0&&m.row===t.maybeInsertedRow&&y.substr(m.column)===t.maybeInsertedLineEnd&&y.substr(0,m.column)==t.maybeInsertedLineStart},f.popAutoInsertedClosing=function(){t.autoInsertedLineEnd=t.autoInsertedLineEnd.substr(1),t.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){t&&(t.maybeInsertedBrackets=0,t.maybeInsertedRow=-1)},a.inherits(f,h),u.CstyleBehaviour=f}),ace.define("ace/unicode",["require","exports","module"],function(n,u,v){for(var a=[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],h=0,d=[],o=0;o<a.length;o+=2)d.push(h+=a[o]),a[o+1]&&d.push(45,h+=a[o+1]);u.wordChars=String.fromCharCode.apply(null,d)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(n,u,v){var a=n("../config"),h=n("../tokenizer").Tokenizer,d=n("./text_highlight_rules").TextHighlightRules,o=n("./behaviour/cstyle").CstyleBehaviour,p=n("../unicode"),e=n("../lib/lang"),t=n("../token_iterator").TokenIterator,r=n("../range").Range,l;l=function(){this.HighlightRules=d},function(){this.$defaultBehaviour=new o,this.tokenRe=new RegExp("^["+p.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+p.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new h(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(s,c,f,m){var y=c.doc,D=!0,E=!0,b=1/0,g=c.getTabSize(),S=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var _=this.lineCommentStart.map(e.escapeRegExp).join("|"),T=this.lineCommentStart[0];else var _=e.escapeRegExp(this.lineCommentStart),T=this.lineCommentStart;_=new RegExp("^(\\s*)(?:"+_+") ?"),S=c.getUseSoftTabs();var A=function(V,W){var H=V.match(_);if(H){var U=H[1].length,G=H[0].length;!$(V,U,G)&&H[0][G-1]==" "&&G--,y.removeInLine(W,U,G)}},w=T+" ",x=function(V,W){(!D||/\S/.test(V))&&($(V,b,b)?y.insertInLine({row:W,column:b},w):y.insertInLine({row:W,column:b},T))},C=function(V,W){return _.test(V)},$=function(V,W,H){for(var U=0;W--&&V.charAt(W)==" ";)U++;if(U%g!=0)return!1;for(var U=0;V.charAt(H++)==" ";)U++;return g>2?U%g!=g-1:U%g==0}}else{if(!this.blockComment)return!1;var T=this.blockComment.start,k=this.blockComment.end,_=new RegExp("^(\\s*)(?:"+e.escapeRegExp(T)+")"),R=new RegExp("(?:"+e.escapeRegExp(k)+")\\s*$"),x=function(O,B){C(O,B)||(!D||/\S/.test(O))&&(y.insertInLine({row:B,column:O.length},k),y.insertInLine({row:B,column:b},T))},A=function(O,B){var P;(P=O.match(R))&&y.removeInLine(B,O.length-P[0].length,O.length),(P=O.match(_))&&y.removeInLine(B,P[1].length,P[0].length)},C=function(O,B){if(_.test(O))return!0;for(var P=c.getTokens(B),V=0;V<P.length;V++)if(P[V].type==="comment")return!0}}function I(O){for(var B=f;B<=m;B++)O(y.getLine(B),B)}var F=1/0;I(function(O,B){var P=O.search(/\S/);P!==-1?(P<b&&(b=P),E&&!C(O,B)&&(E=!1)):F>O.length&&(F=O.length)}),b==1/0&&(b=F,D=!1,E=!1),S&&b%g!=0&&(b=Math.floor(b/g)*g),I(E?A:x)},this.toggleBlockComment=function(s,c,f,m){var y=this.blockComment;if(y){!y.start&&y[0]&&(y=y[0]);var D=new t(c,m.row,m.column),E=D.getCurrentToken();c.selection;var b=c.selection.toOrientedRange(),g,S;if(E&&/comment/.test(E.type)){for(var T,k;E&&/comment/.test(E.type);){var _=E.value.indexOf(y.start);if(_!=-1){var R=D.getCurrentTokenRow(),x=D.getCurrentTokenColumn()+_;T=new r(R,x,R,x+y.start.length);break}E=D.stepBackward()}for(var D=new t(c,m.row,m.column),E=D.getCurrentToken();E&&/comment/.test(E.type);){var _=E.value.indexOf(y.end);if(_!=-1){var R=D.getCurrentTokenRow(),x=D.getCurrentTokenColumn()+_;k=new r(R,x,R,x+y.end.length);break}E=D.stepForward()}k&&c.remove(k),T&&(c.remove(T),g=T.start.row,S=-y.start.length)}else S=y.start.length,g=f.start.row,c.insert(f.end,y.end),c.insert(f.start,y.start);b.start.row==g&&(b.start.column+=S),b.end.row==g&&(b.end.column+=S),c.selection.fromOrientedRange(b)}},this.getNextLineIndent=function(s,c,f){return this.$getIndent(c)},this.checkOutdent=function(s,c,f){return!1},this.autoOutdent=function(s,c,f){},this.$getIndent=function(s){return s.match(/^\s*/)[0]},this.createWorker=function(s){return null},this.createModeDelegates=function(s){this.$embeds=[],this.$modes={};for(var c in s)if(s[c]){var f=s[c],m=f.prototype.$id,y=a.$modes[m];y||(a.$modes[m]=y=new f),a.$modes[c]||(a.$modes[c]=y),this.$embeds.push(c),this.$modes[c]=y}for(var D=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],E=function(g){(function(S){var T=D[g],k=S[T];S[D[g]]=function(){return this.$delegator(T,arguments,k)}})(b)},b=this,c=0;c<D.length;c++)E(c)},this.$delegator=function(s,c,f){var m=c[0]||"start";if(typeof m!="string"){if(Array.isArray(m[2])){var y=m[2][m[2].length-1],D=this.$modes[y];if(D)return D[s].apply(D,[m[1]].concat([].slice.call(c,1)))}m=m[0]||"start"}for(var E=0;E<this.$embeds.length;E++)if(this.$modes[this.$embeds[E]]){var b=m.split(this.$embeds[E]);if(!b[0]&&b[1]){c[0]=b[1];var D=this.$modes[this.$embeds[E]];return D[s].apply(D,c)}}var g=f.apply(this,c);return f?g:void 0},this.transformAction=function(s,c,f,m,y){if(this.$behaviour){var D=this.$behaviour.getBehaviours();for(var E in D)if(D[E][c]){var b=D[E][c].apply(this,arguments);if(b)return b}}},this.getKeywords=function(s){if(!this.completionKeywords){var c=this.$tokenizer.rules,f=[];for(var m in c)for(var y=c[m],D=0,E=y.length;D<E;D++)if(typeof y[D].token=="string")/keyword|support|storage/.test(y[D].token)&&f.push(y[D].regex);else if(typeof y[D].token=="object"){for(var b=0,g=y[D].token.length;b<g;b++)if(/keyword|support|storage/.test(y[D].token[b])){var m=y[D].regex.match(/\(.+?\)/g)[b];f.push(m.substr(1,m.length-2))}}this.completionKeywords=f}return s?f.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(s,c,f,m){var y=this.$keywordList||this.$createKeywordList();return y.map(function(D){return{name:D,value:D,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}.call(l.prototype),u.Mode=l}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(n,u,v){var a=n("./lib/dom"),h=function(){function d(o){this.session=o,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}return d.prototype.getRowLength=function(o){var p;return this.lineWidgets?p=this.lineWidgets[o]&&this.lineWidgets[o].rowCount||0:p=0,!this.$useWrapMode||!this.$wrapData[o]?1+p:this.$wrapData[o].length+1+p},d.prototype.$getWidgetScreenLength=function(){var o=0;return this.lineWidgets.forEach(function(p){p&&p.rowCount&&!p.hidden&&(o+=p.rowCount)}),o},d.prototype.$onChangeEditor=function(o){this.attach(o.editor)},d.prototype.attach=function(o){o&&o.widgetManager&&o.widgetManager!=this&&o.widgetManager.detach(),this.editor!=o&&(this.detach(),this.editor=o,o&&(o.widgetManager=this,o.renderer.on("beforeRender",this.measureWidgets),o.renderer.on("afterRender",this.renderWidgets)))},d.prototype.detach=function(o){var p=this.editor;if(p){this.editor=null,p.widgetManager=null,p.renderer.off("beforeRender",this.measureWidgets),p.renderer.off("afterRender",this.renderWidgets);var e=this.session.lineWidgets;e&&e.forEach(function(t){t&&t.el&&t.el.parentNode&&(t._inDocument=!1,t.el.parentNode.removeChild(t.el))})}},d.prototype.updateOnFold=function(o,p){var e=p.lineWidgets;if(!(!e||!o.action)){for(var t=o.data,r=t.start.row,l=t.end.row,s=o.action=="add",c=r+1;c<l;c++)e[c]&&(e[c].hidden=s);e[l]&&(s?e[r]?e[l].hidden=s:e[r]=e[l]:(e[r]==e[l]&&(e[r]=void 0),e[l].hidden=s))}},d.prototype.updateOnChange=function(o){var p=this.session.lineWidgets;if(p){var e=o.start.row,t=o.end.row-e;if(t!==0)if(o.action=="remove"){var r=p.splice(e+1,t);!p[e]&&r[r.length-1]&&(p[e]=r.pop()),r.forEach(function(s){s&&this.removeLineWidget(s)},this),this.$updateRows()}else{var l=new Array(t);p[e]&&p[e].column!=null&&o.start.column>p[e].column&&e++,l.unshift(e,0),p.splice.apply(p,l),this.$updateRows()}}},d.prototype.$updateRows=function(){var o=this.session.lineWidgets;if(o){var p=!0;o.forEach(function(e,t){if(e)for(p=!1,e.row=t;e.$oldWidget;)e.$oldWidget.row=t,e=e.$oldWidget}),p&&(this.session.lineWidgets=null)}},d.prototype.$registerLineWidget=function(o){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var p=this.session.lineWidgets[o.row];return p&&(o.$oldWidget=p,p.el&&p.el.parentNode&&(p.el.parentNode.removeChild(p.el),p._inDocument=!1)),this.session.lineWidgets[o.row]=o,o},d.prototype.addLineWidget=function(o){if(this.$registerLineWidget(o),o.session=this.session,!this.editor)return o;var p=this.editor.renderer;o.html&&!o.el&&(o.el=a.createElement("div"),o.el.innerHTML=o.html),o.text&&!o.el&&(o.el=a.createElement("div"),o.el.textContent=o.text),o.el&&(a.addCssClass(o.el,"ace_lineWidgetContainer"),o.className&&a.addCssClass(o.el,o.className),o.el.style.position="absolute",o.el.style.zIndex="5",p.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/p.layerConfig.lineHeight);var e=this.session.getFoldAt(o.row,0);if(o.$fold=e,e){var t=this.session.lineWidgets;o.row==e.end.row&&!t[e.start.row]?t[e.start.row]=o:o.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:o.row}}}),this.$updateRows(),this.renderWidgets(null,p),this.onWidgetChanged(o),o},d.prototype.removeLineWidget=function(o){if(o._inDocument=!1,o.session=null,o.el&&o.el.parentNode&&o.el.parentNode.removeChild(o.el),o.editor&&o.editor.destroy)try{o.editor.destroy()}catch{}if(this.session.lineWidgets){var p=this.session.lineWidgets[o.row];if(p==o)this.session.lineWidgets[o.row]=o.$oldWidget,o.$oldWidget&&this.onWidgetChanged(o.$oldWidget);else for(;p;){if(p.$oldWidget==o){p.$oldWidget=o.$oldWidget;break}p=p.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:o.row}}}),this.$updateRows()},d.prototype.getWidgetsAtRow=function(o){for(var p=this.session.lineWidgets,e=p&&p[o],t=[];e;)t.push(e),e=e.$oldWidget;return t},d.prototype.onWidgetChanged=function(o){this.session._changedWidgets.push(o),this.editor&&this.editor.renderer.updateFull()},d.prototype.measureWidgets=function(o,p){var e=this.session._changedWidgets,t=p.layerConfig;if(!(!e||!e.length)){for(var r=1/0,l=0;l<e.length;l++){var s=e[l];if(!(!s||!s.el)&&s.session==this.session){if(!s._inDocument){if(this.session.lineWidgets[s.row]!=s)continue;s._inDocument=!0,p.container.appendChild(s.el)}s.h=s.el.offsetHeight,s.fixedWidth||(s.w=s.el.offsetWidth,s.screenWidth=Math.ceil(s.w/t.characterWidth));var c=s.h/t.lineHeight;s.coverLine&&(c-=this.session.getRowLineCount(s.row),c<0&&(c=0)),s.rowCount!=c&&(s.rowCount=c,s.row<r&&(r=s.row))}}r!=1/0&&(this.session._emit("changeFold",{data:{start:{row:r}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},d.prototype.renderWidgets=function(o,p){var e=p.layerConfig,t=this.session.lineWidgets;if(t){for(var r=Math.min(this.firstRow,e.firstRow),l=Math.max(this.lastRow,e.lastRow,t.length);r>0&&!t[r];)r--;this.firstRow=e.firstRow,this.lastRow=e.lastRow,p.$cursorLayer.config=e;for(var s=r;s<=l;s++){var c=t[s];if(!(!c||!c.el)){if(c.hidden){c.el.style.top=-100-(c.pixelHeight||0)+"px";continue}c._inDocument||(c._inDocument=!0,p.container.appendChild(c.el));var f=p.$cursorLayer.getPixelPosition({row:s,column:0},!0).top;c.coverLine||(f+=e.lineHeight*this.session.getRowLineCount(c.row)),c.el.style.top=f-e.offset+"px";var m=c.coverGutter?0:p.gutterWidth;c.fixedWidth||(m-=p.scrollLeft),c.el.style.left=m+"px",c.fullWidth&&c.screenWidth&&(c.el.style.minWidth=e.width+2*e.padding+"px"),c.fixedWidth?c.el.style.right=p.scrollBar.getWidth()+"px":c.el.style.right=""}}}},d}();u.LineWidgets=h}),ace.define("ace/apply_delta",["require","exports","module"],function(n,u,v){u.applyDelta=function(a,h,d){var o=h.start.row,p=h.start.column,e=a[o]||"";switch(h.action){case"insert":var t=h.lines;if(t.length===1)a[o]=e.substring(0,p)+h.lines[0]+e.substring(p);else{var r=[o,1].concat(h.lines);a.splice.apply(a,r),a[o]=e.substring(0,p)+a[o],a[o+h.lines.length-1]+=e.substring(p)}break;case"remove":var l=h.end.column,s=h.end.row;o===s?a[o]=e.substring(0,p)+e.substring(l):a.splice(o,s-o+1,e.substring(0,p)+a[s].substring(l));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(n,u,v){var a=n("./lib/oop"),h=n("./lib/event_emitter").EventEmitter,d=function(){function e(t,r,l){this.$onChange=this.onChange.bind(this),this.attach(t),typeof r!="number"?this.setPosition(r.row,r.column):this.setPosition(r,l)}return e.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},e.prototype.getDocument=function(){return this.document},e.prototype.onChange=function(t){if(!(t.start.row==t.end.row&&t.start.row!=this.row)&&!(t.start.row>this.row)){var r=p(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(r.row,r.column,!0)}},e.prototype.setPosition=function(t,r,l){var s;if(l?s={row:t,column:r}:s=this.$clipPositionToDocument(t,r),!(this.row==s.row&&this.column==s.column)){var c={row:this.row,column:this.column};this.row=s.row,this.column=s.column,this._signal("change",{old:c,value:s})}},e.prototype.detach=function(){this.document.off("change",this.$onChange)},e.prototype.attach=function(t){this.document=t||this.document,this.document.on("change",this.$onChange)},e.prototype.$clipPositionToDocument=function(t,r){var l={};return t>=this.document.getLength()?(l.row=Math.max(0,this.document.getLength()-1),l.column=this.document.getLine(l.row).length):t<0?(l.row=0,l.column=0):(l.row=t,l.column=Math.min(this.document.getLine(l.row).length,Math.max(0,r))),r<0&&(l.column=0),l},e}();d.prototype.$insertRight=!1,a.implement(d.prototype,h);function o(e,t,r){var l=r?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&l}function p(e,t,r){var l=e.action=="insert",s=(l?1:-1)*(e.end.row-e.start.row),c=(l?1:-1)*(e.end.column-e.start.column),f=e.start,m=l?f:e.end;return o(t,f,r)?{row:t.row,column:t.column}:o(m,t,!r)?{row:t.row+s,column:t.column+(t.row==m.row?c:0)}:{row:f.row,column:f.column}}u.Anchor=d}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(n,u,v){var a=n("./lib/oop"),h=n("./apply_delta").applyDelta,d=n("./lib/event_emitter").EventEmitter,o=n("./range").Range,p=n("./anchor").Anchor,e=function(){function t(r){this.$lines=[""],r.length===0?this.$lines=[""]:Array.isArray(r)?this.insertMergedLines({row:0,column:0},r):this.insert({row:0,column:0},r)}return t.prototype.setValue=function(r){var l=this.getLength()-1;this.remove(new o(0,0,l,this.getLine(l).length)),this.insert({row:0,column:0},r||"")},t.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},t.prototype.createAnchor=function(r,l){return new p(this,r,l)},t.prototype.$detectNewLine=function(r){var l=r.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=l?l[1]:`
200
- `,this._signal("changeNewLineMode")},t.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
201
- `;case"unix":return`
202
- `;default:return this.$autoNewLine||`
203
- `}},t.prototype.setNewLineMode=function(r){this.$newLineMode!==r&&(this.$newLineMode=r,this._signal("changeNewLineMode"))},t.prototype.getNewLineMode=function(){return this.$newLineMode},t.prototype.isNewLine=function(r){return r==`\r
204
- `||r=="\r"||r==`
205
- `},t.prototype.getLine=function(r){return this.$lines[r]||""},t.prototype.getLines=function(r,l){return this.$lines.slice(r,l+1)},t.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},t.prototype.getLength=function(){return this.$lines.length},t.prototype.getTextRange=function(r){return this.getLinesForRange(r).join(this.getNewLineCharacter())},t.prototype.getLinesForRange=function(r){var l;if(r.start.row===r.end.row)l=[this.getLine(r.start.row).substring(r.start.column,r.end.column)];else{l=this.getLines(r.start.row,r.end.row),l[0]=(l[0]||"").substring(r.start.column);var s=l.length-1;r.end.row-r.start.row==s&&(l[s]=l[s].substring(0,r.end.column))}return l},t.prototype.insertLines=function(r,l){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(r,l)},t.prototype.removeLines=function(r,l){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(r,l)},t.prototype.insertNewLine=function(r){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(r,["",""])},t.prototype.insert=function(r,l){return this.getLength()<=1&&this.$detectNewLine(l),this.insertMergedLines(r,this.$split(l))},t.prototype.insertInLine=function(r,l){var s=this.clippedPos(r.row,r.column),c=this.pos(r.row,r.column+l.length);return this.applyDelta({start:s,end:c,action:"insert",lines:[l]},!0),this.clonePos(c)},t.prototype.clippedPos=function(r,l){var s=this.getLength();r===void 0?r=s:r<0?r=0:r>=s&&(r=s-1,l=void 0);var c=this.getLine(r);return l==null&&(l=c.length),l=Math.min(Math.max(l,0),c.length),{row:r,column:l}},t.prototype.clonePos=function(r){return{row:r.row,column:r.column}},t.prototype.pos=function(r,l){return{row:r,column:l}},t.prototype.$clipPosition=function(r){var l=this.getLength();return r.row>=l?(r.row=Math.max(0,l-1),r.column=this.getLine(l-1).length):(r.row=Math.max(0,r.row),r.column=Math.min(Math.max(r.column,0),this.getLine(r.row).length)),r},t.prototype.insertFullLines=function(r,l){r=Math.min(Math.max(r,0),this.getLength());var s=0;r<this.getLength()?(l=l.concat([""]),s=0):(l=[""].concat(l),r--,s=this.$lines[r].length),this.insertMergedLines({row:r,column:s},l)},t.prototype.insertMergedLines=function(r,l){var s=this.clippedPos(r.row,r.column),c={row:s.row+l.length-1,column:(l.length==1?s.column:0)+l[l.length-1].length};return this.applyDelta({start:s,end:c,action:"insert",lines:l}),this.clonePos(c)},t.prototype.remove=function(r){var l=this.clippedPos(r.start.row,r.start.column),s=this.clippedPos(r.end.row,r.end.column);return this.applyDelta({start:l,end:s,action:"remove",lines:this.getLinesForRange({start:l,end:s})}),this.clonePos(l)},t.prototype.removeInLine=function(r,l,s){var c=this.clippedPos(r,l),f=this.clippedPos(r,s);return this.applyDelta({start:c,end:f,action:"remove",lines:this.getLinesForRange({start:c,end:f})},!0),this.clonePos(c)},t.prototype.removeFullLines=function(r,l){r=Math.min(Math.max(0,r),this.getLength()-1),l=Math.min(Math.max(0,l),this.getLength()-1);var s=l==this.getLength()-1&&r>0,c=l<this.getLength()-1,f=s?r-1:r,m=s?this.getLine(f).length:0,y=c?l+1:l,D=c?0:this.getLine(y).length,E=new o(f,m,y,D),b=this.$lines.slice(r,l+1);return this.applyDelta({start:E.start,end:E.end,action:"remove",lines:this.getLinesForRange(E)}),b},t.prototype.removeNewLine=function(r){r<this.getLength()-1&&r>=0&&this.applyDelta({start:this.pos(r,this.getLine(r).length),end:this.pos(r+1,0),action:"remove",lines:["",""]})},t.prototype.replace=function(r,l){if(r instanceof o||(r=o.fromPoints(r.start,r.end)),l.length===0&&r.isEmpty())return r.start;if(l==this.getTextRange(r))return r.end;this.remove(r);var s;return l?s=this.insert(r.start,l):s=r.start,s},t.prototype.applyDeltas=function(r){for(var l=0;l<r.length;l++)this.applyDelta(r[l])},t.prototype.revertDeltas=function(r){for(var l=r.length-1;l>=0;l--)this.revertDelta(r[l])},t.prototype.applyDelta=function(r,l){var s=r.action=="insert";(s?r.lines.length<=1&&!r.lines[0]:!o.comparePoints(r.start,r.end))||(s&&r.lines.length>2e4?this.$splitAndapplyLargeDelta(r,2e4):(h(this.$lines,r,l),this._signal("change",r)))},t.prototype.$safeApplyDelta=function(r){var l=this.$lines.length;(r.action=="remove"&&r.start.row<l&&r.end.row<l||r.action=="insert"&&r.start.row<=l)&&this.applyDelta(r)},t.prototype.$splitAndapplyLargeDelta=function(r,l){for(var s=r.lines,c=s.length-l+1,f=r.start.row,m=r.start.column,y=0,D=0;y<c;y=D){D+=l-1;var E=s.slice(y,D);E.push(""),this.applyDelta({start:this.pos(f+y,m),end:this.pos(f+D,m=0),action:r.action,lines:E},!0)}r.lines=s.slice(y),r.start.row=f+y,r.start.column=m,this.applyDelta(r,!0)},t.prototype.revertDelta=function(r){this.$safeApplyDelta({start:this.clonePos(r.start),end:this.clonePos(r.end),action:r.action=="insert"?"remove":"insert",lines:r.lines.slice()})},t.prototype.indexToPosition=function(r,l){for(var s=this.$lines||this.getAllLines(),c=this.getNewLineCharacter().length,f=l||0,m=s.length;f<m;f++)if(r-=s[f].length+c,r<0)return{row:f,column:r+s[f].length+c};return{row:m-1,column:r+s[m-1].length+c}},t.prototype.positionToIndex=function(r,l){for(var s=this.$lines||this.getAllLines(),c=this.getNewLineCharacter().length,f=0,m=Math.min(r.row,s.length),y=l||0;y<m;++y)f+=s[y].length+c;return f+r.column},t.prototype.$split=function(r){return r.split(/\r\n|\r|\n/)},t}();e.prototype.$autoNewLine="",e.prototype.$newLineMode="auto",a.implement(e.prototype,d),u.Document=e}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(n,u,v){var a=n("./lib/oop"),h=n("./lib/event_emitter").EventEmitter,d=function(){function o(p,e){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=p;var t=this;this.$worker=function(){if(t.running){for(var r=new Date,l=t.currentLine,s=-1,c=t.doc,f=l;t.lines[l];)l++;var m=c.getLength(),y=0;for(t.running=!1;l<m;){t.$tokenizeRow(l),s=l;do l++;while(t.lines[l]);if(y++,y%5===0&&new Date-r>20){t.running=setTimeout(t.$worker,20);break}}t.currentLine=l,s==-1&&(s=l),f<=s&&t.fireUpdateEvent(f,s)}}}return o.prototype.setTokenizer=function(p){this.tokenizer=p,this.lines=[],this.states=[],this.start(0)},o.prototype.setDocument=function(p){this.doc=p,this.lines=[],this.states=[],this.stop()},o.prototype.fireUpdateEvent=function(p,e){var t={first:p,last:e};this._signal("update",{data:t})},o.prototype.start=function(p){this.currentLine=Math.min(p||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(p){var e=p.start.row,t=p.end.row-e;if(t===0)this.lines[e]=null;else if(p.action=="remove")this.lines.splice(e,t+1,null),this.states.splice(e,t+1,null);else{var r=Array(t+1);r.unshift(e,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(e,this.currentLine,this.doc.getLength()),this.stop()},o.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},o.prototype.getTokens=function(p){return this.lines[p]||this.$tokenizeRow(p)},o.prototype.getState=function(p){return this.currentLine==p&&this.$tokenizeRow(p),this.states[p]||"start"},o.prototype.$tokenizeRow=function(p){var e=this.doc.getLine(p),t=this.states[p-1],r=this.tokenizer.getLineTokens(e,t,p);return this.states[p]+""!=r.state+""?(this.states[p]=r.state,this.lines[p+1]=null,this.currentLine>p+1&&(this.currentLine=p+1)):this.currentLine==p&&(this.currentLine=p+1),this.lines[p]=r.tokens},o.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},o}();a.implement(d.prototype,h),u.BackgroundTokenizer=d}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(n,u,v){var a=n("./lib/lang"),h=n("./range").Range,d=function(){function o(p,e,t){t===void 0&&(t="text"),this.setRegexp(p),this.clazz=e,this.type=t,this.docLen=0}return o.prototype.setRegexp=function(p){this.regExp+""!=p+""&&(this.regExp=p,this.cache=[])},o.prototype.update=function(p,e,t,r){if(this.regExp){for(var l=r.firstRow,s=r.lastRow,c={},f=t.$editor.$search,m=f.$isMultilineSearch(t.$editor.getLastSearchOptions()),y=l;y<=s;y++){var D=this.cache[y];if(D==null||t.getValue().length!=this.docLen){if(m){D=[];var E=f.$multiLineForward(t,this.regExp,y,s);if(E){var b=E.endRow<=s?E.endRow-1:s;b>y&&(y=b),D.push(new h(E.startRow,E.startCol,E.endRow,E.endCol))}D.length>this.MAX_RANGES&&(D=D.slice(0,this.MAX_RANGES))}else D=a.getMatchOffsets(t.getLine(y),this.regExp),D.length>this.MAX_RANGES&&(D=D.slice(0,this.MAX_RANGES)),D=D.map(function(k){return new h(y,k.offset,y,k.offset+k.length)});this.cache[y]=D.length?D:""}if(D.length!==0)for(var g=D.length;g--;){var S=D[g].toScreenRange(t),T=S.toString();c[T]||(c[T]=!0,e.drawSingleLineMarker(p,S,this.clazz,r))}}this.docLen=t.getValue().length}},o}();d.prototype.MAX_RANGES=500,u.SearchHighlight=d}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(n,u,v){var a=function(){function b(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return b.prototype.addSession=function(g){this.$session=g},b.prototype.add=function(g,S,T){if(!this.$fromUndo&&g!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),S===!1||!this.lastDeltas){this.lastDeltas=[];var k=this.$undoStack.length;k>this.$undoDepth-1&&this.$undoStack.splice(0,k-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),g.id=this.$rev=++this.$maxRev}(g.action=="remove"||g.action=="insert")&&(this.$lastDelta=g),this.lastDeltas.push(g)}},b.prototype.addSelection=function(g,S){this.selections.push({value:g,rev:S||this.$rev})},b.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},b.prototype.markIgnored=function(g,S){S==null&&(S=this.$rev+1);for(var T=this.$undoStack,k=T.length;k--;){var _=T[k][0];if(_.id<=g)break;_.id<S&&(_.ignore=!0)}this.lastDeltas=null},b.prototype.getSelection=function(g,S){for(var T=this.selections,k=T.length;k--;){var _=T[k];if(_.rev<g)return S&&(_=T[k+1]),_}},b.prototype.getRevision=function(){return this.$rev},b.prototype.getDeltas=function(g,S){S==null&&(S=this.$rev+1);for(var T=this.$undoStack,k=null,_=0,R=T.length;R--;){var x=T[R][0];if(x.id<S&&!k&&(k=R+1),x.id<=g){_=R+1;break}}return T.slice(_,k)},b.prototype.getChangedRanges=function(g,S){S==null&&(S=this.$rev+1)},b.prototype.getChangedLines=function(g,S){S==null&&(S=this.$rev+1)},b.prototype.undo=function(g,S){this.lastDeltas=null;var T=this.$undoStack;if(h(T,T.length)){g||(g=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var k=T.pop(),_=null;return k&&(_=g.undoChanges(k,S),this.$redoStack.push(k),this.$syncRev()),this.$fromUndo=!1,_}},b.prototype.redo=function(g,S){if(this.lastDeltas=null,g||(g=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var T=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);E(this.$redoStack,T),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(R){R[0].id=++this.$maxRev},this)}var k=this.$redoStack.pop(),_=null;return k&&(_=g.redoChanges(k,S),this.$undoStack.push(k),this.$syncRev()),this.$fromUndo=!1,_},b.prototype.$syncRev=function(){var g=this.$undoStack,S=g[g.length-1],T=S&&S[0].id||0;this.$redoStackBaseRev=T,this.$rev=T},b.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=[]},b.prototype.canUndo=function(){return this.$undoStack.length>0},b.prototype.canRedo=function(){return this.$redoStack.length>0},b.prototype.bookmark=function(g){g==null&&(g=this.$rev),this.mark=g},b.prototype.isAtBookmark=function(){return this.$rev===this.mark},b.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},b.prototype.fromJSON=function(g){this.reset(),this.$undoStack=g.$undoStack,this.$redoStack=g.$redoStack},b.prototype.$prettyPrint=function(g){return g?t(g):t(this.$undoStack)+`
206
- ---
207
- `+t(this.$redoStack)},b}();a.prototype.hasUndo=a.prototype.canUndo,a.prototype.hasRedo=a.prototype.canRedo,a.prototype.isClean=a.prototype.isAtBookmark,a.prototype.markClean=a.prototype.bookmark;function h(b,g){for(var S=g;S--;){var T=b[S];if(T&&!T[0].ignore){for(;S<g-1;){var k=s(b[S],b[S+1]);b[S]=k[0],b[S+1]=k[1],S++}return!0}}}var d=n("./range").Range,o=d.comparePoints;d.comparePoints;function p(b){return{row:b.row,column:b.column}}function e(b){return{start:p(b.start),end:p(b.end),action:b.action,lines:b.lines.slice()}}function t(b){if(b=b||this,Array.isArray(b))return b.map(t).join(`
208
- `);var g="";return b.action?(g=b.action=="insert"?"+":"-",g+="["+b.lines+"]"):b.value&&(Array.isArray(b.value)?g=b.value.map(r).join(`
209
- `):g=r(b.value)),b.start&&(g+=r(b)),(b.id||b.rev)&&(g+=" ("+(b.id||b.rev)+")"),g}function r(b){return b.start.row+":"+b.start.column+"=>"+b.end.row+":"+b.end.column}function l(b,g){var S=b.action=="insert",T=g.action=="insert";if(S&&T)if(o(g.start,b.end)>=0)f(g,b,-1);else if(o(g.start,b.start)<=0)f(b,g,1);else return null;else if(S&&!T)if(o(g.start,b.end)>=0)f(g,b,-1);else if(o(g.end,b.start)<=0)f(b,g,-1);else return null;else if(!S&&T)if(o(g.start,b.start)>=0)f(g,b,1);else if(o(g.start,b.start)<=0)f(b,g,1);else return null;else if(!S&&!T)if(o(g.start,b.start)>=0)f(g,b,1);else if(o(g.end,b.start)<=0)f(b,g,-1);else return null;return[g,b]}function s(b,g){for(var S=b.length;S--;)for(var T=0;T<g.length;T++)if(!l(b[S],g[T])){for(;S<b.length;){for(;T--;)l(g[T],b[S]);T=g.length,S++}return[b,g]}return b.selectionBefore=g.selectionBefore=b.selectionAfter=g.selectionAfter=null,[g,b]}function c(b,g){var S=b.action=="insert",T=g.action=="insert";if(S&&T)o(b.start,g.start)<0?f(g,b,1):f(b,g,1);else if(S&&!T)o(b.start,g.end)>=0?f(b,g,-1):(o(b.start,g.start)<=0||f(b,d.fromPoints(g.start,b.start),-1),f(g,b,1));else if(!S&&T)o(g.start,b.end)>=0?f(g,b,-1):(o(g.start,b.start)<=0||f(g,d.fromPoints(b.start,g.start),-1),f(b,g,1));else if(!S&&!T)if(o(g.start,b.end)>=0)f(g,b,-1);else if(o(g.end,b.start)<=0)f(b,g,-1);else{var k,_;return o(b.start,g.start)<0&&(k=b,b=y(b,g.start)),o(b.end,g.end)>0&&(_=y(b,g.end)),m(g.end,b.start,b.end,-1),_&&!k&&(b.lines=_.lines,b.start=_.start,b.end=_.end,_=b),[g,k,_].filter(Boolean)}return[g,b]}function f(b,g,S){m(b.start,g.start,g.end,S),m(b.end,g.start,g.end,S)}function m(b,g,S,T){b.row==(T==1?g:S).row&&(b.column+=T*(S.column-g.column)),b.row+=T*(S.row-g.row)}function y(b,g){var S=b.lines,T=b.end;b.end=p(g);var k=b.end.row-b.start.row,_=S.splice(k,S.length),R=k?g.column:g.column-b.start.column;S.push(_[0].substring(0,R)),_[0]=_[0].substr(R);var x={start:p(g),end:T,lines:_,action:b.action};return x}function D(b,g){g=e(g);for(var S=b.length;S--;){for(var T=b[S],k=0;k<T.length;k++){var _=T[k],R=c(_,g);g=R[0],R.length!=2&&(R[2]?(T.splice(k+1,1,R[1],R[2]),k++):R[1]||(T.splice(k,1),k--))}T.length||b.splice(S,1)}return b}function E(b,g){for(var S=0;S<g.length;S++)for(var T=g[S],k=0;k<T.length;k++)D(b,T[k])}u.UndoManager=a}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(n,u,v){var a=n("../range").Range,h=function(){function d(o,p){this.foldData=o,Array.isArray(p)?this.folds=p:p=this.folds=[p];var e=p[p.length-1];this.range=new a(p[0].start.row,p[0].start.column,e.end.row,e.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(t){t.setFoldLine(this)},this)}return d.prototype.shiftRow=function(o){this.start.row+=o,this.end.row+=o,this.folds.forEach(function(p){p.start.row+=o,p.end.row+=o})},d.prototype.addFold=function(o){if(o.sameRow){if(o.start.row<this.startRow||o.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(o),this.folds.sort(function(p,e){return-p.range.compareEnd(e.start.row,e.start.column)}),this.range.compareEnd(o.start.row,o.start.column)>0?(this.end.row=o.end.row,this.end.column=o.end.column):this.range.compareStart(o.end.row,o.end.column)<0&&(this.start.row=o.start.row,this.start.column=o.start.column)}else if(o.start.row==this.end.row)this.folds.push(o),this.end.row=o.end.row,this.end.column=o.end.column;else if(o.end.row==this.start.row)this.folds.unshift(o),this.start.row=o.start.row,this.start.column=o.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");o.foldLine=this},d.prototype.containsRow=function(o){return o>=this.start.row&&o<=this.end.row},d.prototype.walk=function(o,p,e){var t=0,r=this.folds,l,s,c,f=!0;p==null&&(p=this.end.row,e=this.end.column);for(var m=0;m<r.length;m++){if(l=r[m],s=l.range.compareStart(p,e),s==-1){o(null,p,e,t,f);return}if(c=o(null,l.start.row,l.start.column,t,f),c=!c&&o(l.placeholder,l.start.row,l.start.column,t),c||s===0)return;f=!l.sameRow,t=l.end.column}o(null,p,e,t,f)},d.prototype.getNextFoldTo=function(o,p){for(var e,t,r=0;r<this.folds.length;r++){if(e=this.folds[r],t=e.range.compareEnd(o,p),t==-1)return{fold:e,kind:"after"};if(t===0)return{fold:e,kind:"inside"}}return null},d.prototype.addRemoveChars=function(o,p,e){var t=this.getNextFoldTo(o,p),r,l;if(t){if(r=t.fold,t.kind=="inside"&&r.start.column!=p&&r.start.row!=o)window.console&&window.console.log(o,p,r);else if(r.start.row==o){l=this.folds;var s=l.indexOf(r);for(s===0&&(this.start.column+=e),s;s<l.length;s++){if(r=l[s],r.start.column+=e,!r.sameRow)return;r.end.column+=e}this.end.column+=e}}},d.prototype.split=function(o,p){var e=this.getNextFoldTo(o,p);if(!e||e.kind=="inside")return null;var t=e.fold,r=this.folds,l=this.foldData,s=r.indexOf(t),c=r[s-1];this.end.row=c.end.row,this.end.column=c.end.column,r=r.splice(s,r.length-s);var f=new d(l,r);return l.splice(l.indexOf(this)+1,0,f),f},d.prototype.merge=function(o){for(var p=o.folds,e=0;e<p.length;e++)this.addFold(p[e]);var t=this.foldData;t.splice(t.indexOf(o),1)},d.prototype.toString=function(){var o=[this.range.toString()+": ["];return this.folds.forEach(function(p){o.push(" "+p.toString())}),o.push("]"),o.join(`
210
- `)},d.prototype.idxToPosition=function(o){for(var p=0,e=0;e<this.folds.length;e++){var t=this.folds[e];if(o-=t.start.column-p,o<0)return{row:t.start.row,column:t.start.column+o};if(o-=t.placeholder.length,o<0)return t.start;p=t.end.column}return{row:this.end.row,column:this.end.column+o}},d}();u.FoldLine=h}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(n,u,v){var a=n("./range").Range,h=a.comparePoints,d=function(){function o(){this.ranges=[],this.$bias=1}return o.prototype.pointIndex=function(p,e,t){for(var r=this.ranges,l=t||0;l<r.length;l++){var s=r[l],c=h(p,s.end);if(!(c>0)){var f=h(p,s.start);return c===0?e&&f!==0?-l-2:l:f>0||f===0&&!e?l:-l-1}}return-l-1},o.prototype.add=function(p){var e=!p.isEmpty(),t=this.pointIndex(p.start,e);t<0&&(t=-t-1);var r=this.pointIndex(p.end,e,t);return r<0?r=-r-1:r++,this.ranges.splice(t,r-t,p)},o.prototype.addList=function(p){for(var e=[],t=p.length;t--;)e.push.apply(e,this.add(p[t]));return e},o.prototype.substractPoint=function(p){var e=this.pointIndex(p);if(e>=0)return this.ranges.splice(e,1)},o.prototype.merge=function(){var p=[],e=this.ranges;e=e.sort(function(c,f){return h(c.start,f.start)});for(var t=e[0],r,l=1;l<e.length;l++){r=t,t=e[l];var s=h(r.end,t.start);s<0||s==0&&!r.isEmpty()&&!t.isEmpty()||(h(r.end,t.end)<0&&(r.end.row=t.end.row,r.end.column=t.end.column),e.splice(l,1),p.push(t),t=r,l--)}return this.ranges=e,p},o.prototype.contains=function(p,e){return this.pointIndex({row:p,column:e})>=0},o.prototype.containsPoint=function(p){return this.pointIndex(p)>=0},o.prototype.rangeAtPoint=function(p){var e=this.pointIndex(p);if(e>=0)return this.ranges[e]},o.prototype.clipRows=function(p,e){var t=this.ranges;if(t[0].start.row>e||t[t.length-1].start.row<p)return[];var r=this.pointIndex({row:p,column:0});r<0&&(r=-r-1);var l=this.pointIndex({row:e,column:0},r);l<0&&(l=-l-1);for(var s=[],c=r;c<l;c++)s.push(t[c]);return s},o.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},o.prototype.attach=function(p){this.session&&this.detach(),this.session=p,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(p){for(var e=p.start,t=p.end,r=e.row,l=t.row,s=this.ranges,c=0,f=s.length;c<f;c++){var m=s[c];if(m.end.row>=r)break}if(p.action=="insert")for(var y=l-r,D=-e.column+t.column;c<f;c++){var m=s[c];if(m.start.row>r)break;if(m.start.row==r&&m.start.column>=e.column&&(m.start.column==e.column&&this.$bias<=0||(m.start.column+=D,m.start.row+=y)),m.end.row==r&&m.end.column>=e.column){if(m.end.column==e.column&&this.$bias<0)continue;m.end.column==e.column&&D>0&&c<f-1&&m.end.column>m.start.column&&m.end.column==s[c+1].start.column&&(m.end.column-=D),m.end.column+=D,m.end.row+=y}}else for(var y=r-l,D=e.column-t.column;c<f;c++){var m=s[c];if(m.start.row>l)break;m.end.row<l&&(r<m.end.row||r==m.end.row&&e.column<m.end.column)?(m.end.row=r,m.end.column=e.column):m.end.row==l?m.end.column<=t.column?(y||m.end.column>e.column)&&(m.end.column=e.column,m.end.row=e.row):(m.end.column+=D,m.end.row+=y):m.end.row>l&&(m.end.row+=y),m.start.row<l&&(r<m.start.row||r==m.start.row&&e.column<m.start.column)?(m.start.row=r,m.start.column=e.column):m.start.row==l?m.start.column<=t.column?(y||m.start.column>e.column)&&(m.start.column=e.column,m.start.row=e.row):(m.start.column+=D,m.start.row+=y):m.start.row>l&&(m.start.row+=y)}if(y!=0&&c<f)for(;c<f;c++){var m=s[c];m.start.row+=y,m.end.row+=y}},o}();d.prototype.comparePoints=h,u.RangeList=d}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(n,u,v){var a=this&&this.__extends||function(){var r=function(l,s){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(c[m]=f[m])},r(l,s)};return function(l,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");r(l,s);function c(){this.constructor=l}l.prototype=s===null?Object.create(s):(c.prototype=s.prototype,new c)}}(),h=n("../range_list").RangeList,d=function(r){a(l,r);function l(s,c){var f=r.call(this)||this;return f.foldLine=null,f.placeholder=c,f.range=s,f.start=s.start,f.end=s.end,f.sameRow=s.start.row==s.end.row,f.subFolds=f.ranges=[],f}return l.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},l.prototype.setFoldLine=function(s){this.foldLine=s,this.subFolds.forEach(function(c){c.setFoldLine(s)})},l.prototype.clone=function(){var s=this.range.clone(),c=new l(s,this.placeholder);return this.subFolds.forEach(function(f){c.subFolds.push(f.clone())}),c.collapseChildren=this.collapseChildren,c},l.prototype.addSubFold=function(s){if(!this.range.isEqual(s)){p(s,this.start);for(var D=s.start.row,E=s.start.column,c=0,f=-1;c<this.subFolds.length&&(f=this.subFolds[c].range.compare(D,E),f==1);c++);var m=this.subFolds[c],y=0;if(f==0){if(m.range.containsRange(s))return m.addSubFold(s);y=1}for(var D=s.range.end.row,E=s.range.end.column,b=c,f=-1;b<this.subFolds.length&&(f=this.subFolds[b].range.compare(D,E),f==1);b++);f==0&&b++;for(var g=this.subFolds.splice(c,b-c,s),S=f==0?g.length-1:g.length,T=y;T<S;T++)s.addSubFold(g[T]);return s.setFoldLine(this.foldLine),s}},l.prototype.restoreRange=function(s){return t(s,this.start)},l}(h);function o(r,l){r.row-=l.row,r.row==0&&(r.column-=l.column)}function p(r,l){o(r.start,l),o(r.end,l)}function e(r,l){r.row==0&&(r.column+=l.column),r.row+=l.row}function t(r,l){e(r.start,l),e(r.end,l)}u.Fold=d}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],function(n,u,v){var a=n("../range").Range,h=n("./fold_line").FoldLine,d=n("./fold").Fold,o=n("../token_iterator").TokenIterator,p=n("../mouse/mouse_event").MouseEvent;function e(){this.getFoldAt=function(t,r,l){var s=this.getFoldLine(t);if(!s)return null;for(var c=s.folds,f=0;f<c.length;f++){var m=c[f].range;if(m.contains(t,r)){if(l==1&&m.isEnd(t,r)&&!m.isEmpty())continue;if(l==-1&&m.isStart(t,r)&&!m.isEmpty())continue;return c[f]}}},this.getFoldsInRange=function(t){var r=t.start,l=t.end,s=this.$foldData,c=[];r.column+=1,l.column-=1;for(var f=0;f<s.length;f++){var m=s[f].range.compareRange(t);if(m!=2){if(m==-2)break;for(var y=s[f].folds,D=0;D<y.length;D++){var E=y[D];if(m=E.range.compareRange(t),m==-2)break;if(m==2)continue;if(m==42)break;c.push(E)}}}return r.column-=1,l.column+=1,c},this.getFoldsInRangeList=function(t){if(Array.isArray(t)){var r=[];t.forEach(function(l){r=r.concat(this.getFoldsInRange(l))},this)}else var r=this.getFoldsInRange(t);return r},this.getAllFolds=function(){for(var t=[],r=this.$foldData,l=0;l<r.length;l++)for(var s=0;s<r[l].folds.length;s++)t.push(r[l].folds[s]);return t},this.getFoldStringAt=function(t,r,l,s){if(s=s||this.getFoldLine(t),!s)return null;for(var c={end:{column:0}},f,m,y=0;y<s.folds.length;y++){m=s.folds[y];var D=m.range.compareEnd(t,r);if(D==-1){f=this.getLine(m.start.row).substring(c.end.column,m.start.column);break}else if(D===0)return null;c=m}return f||(f=this.getLine(m.start.row).substring(c.end.column)),l==-1?f.substring(0,r-c.end.column):l==1?f.substring(r-c.end.column):f},this.getFoldLine=function(t,r){var l=this.$foldData,s=0;for(r&&(s=l.indexOf(r)),s==-1&&(s=0),s;s<l.length;s++){var c=l[s];if(c.start.row<=t&&c.end.row>=t)return c;if(c.end.row>t)return null}return null},this.getNextFoldLine=function(t,r){var l=this.$foldData,s=0;for(r&&(s=l.indexOf(r)),s==-1&&(s=0),s;s<l.length;s++){var c=l[s];if(c.end.row>=t)return c}return null},this.getFoldedRowCount=function(t,r){for(var l=this.$foldData,s=r-t+1,c=0;c<l.length;c++){var f=l[c],m=f.end.row,y=f.start.row;if(m>=r){y<r&&(y>=t?s-=r-y:s=0);break}else m>=t&&(y>=t?s-=m-y:s-=m-t+1)}return s},this.$addFoldLine=function(t){return this.$foldData.push(t),this.$foldData.sort(function(r,l){return r.start.row-l.start.row}),t},this.addFold=function(t,r){var l=this.$foldData,s=!1,c;t instanceof d?c=t:(c=new d(r,t),c.collapseChildren=r.collapseChildren),this.$clipRangeToDocument(c.range);var f=c.start.row,m=c.start.column,y=c.end.row,D=c.end.column,E=this.getFoldAt(f,m,1),b=this.getFoldAt(y,D,-1);if(E&&b==E)return E.addSubFold(c);E&&!E.range.isStart(f,m)&&this.removeFold(E),b&&!b.range.isEnd(y,D)&&this.removeFold(b);var g=this.getFoldsInRange(c.range);g.length>0&&(this.removeFolds(g),c.collapseChildren||g.forEach(function(_){c.addSubFold(_)}));for(var S=0;S<l.length;S++){var T=l[S];if(y==T.start.row){T.addFold(c),s=!0;break}else if(f==T.end.row){if(T.addFold(c),s=!0,!c.sameRow){var k=l[S+1];if(k&&k.start.row==y){T.merge(k);break}}break}else if(y<=T.start.row)break}return s||(T=this.$addFoldLine(new h(this.$foldData,c))),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:c,action:"add"}),c},this.addFolds=function(t){t.forEach(function(r){this.addFold(r)},this)},this.removeFold=function(t){var r=t.foldLine,l=r.start.row,s=r.end.row,c=this.$foldData,f=r.folds;if(f.length==1)c.splice(c.indexOf(r),1);else if(r.range.isEnd(t.end.row,t.end.column))f.pop(),r.end.row=f[f.length-1].end.row,r.end.column=f[f.length-1].end.column;else if(r.range.isStart(t.start.row,t.start.column))f.shift(),r.start.row=f[0].start.row,r.start.column=f[0].start.column;else if(t.sameRow)f.splice(f.indexOf(t),1);else{var m=r.split(t.start.row,t.start.column);f=m.folds,f.shift(),m.start.row=f[0].start.row,m.start.column=f[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(l,s):this.$updateRowLengthCache(l,s)),this.$modified=!0,this._signal("changeFold",{data:t,action:"remove"})},this.removeFolds=function(t){for(var r=[],l=0;l<t.length;l++)r.push(t[l]);r.forEach(function(s){this.removeFold(s)},this),this.$modified=!0},this.expandFold=function(t){this.removeFold(t),t.subFolds.forEach(function(r){t.restoreRange(r),this.addFold(r)},this),t.collapseChildren>0&&this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1),t.subFolds=[]},this.expandFolds=function(t){t.forEach(function(r){this.expandFold(r)},this)},this.unfold=function(t,r){var l,s;if(t==null)l=new a(0,0,this.getLength(),0),r==null&&(r=!0);else if(typeof t=="number")l=new a(t,0,t,this.getLine(t).length);else if("row"in t)l=a.fromPoints(t,t);else{if(Array.isArray(t))return s=[],t.forEach(function(f){s=s.concat(this.unfold(f))},this),s;l=t}s=this.getFoldsInRangeList(l);for(var c=s;s.length==1&&a.comparePoints(s[0].start,l.start)<0&&a.comparePoints(s[0].end,l.end)>0;)this.expandFolds(s),s=this.getFoldsInRangeList(l);if(r!=!1?this.removeFolds(s):this.expandFolds(s),c.length)return c},this.isRowFolded=function(t,r){return!!this.getFoldLine(t,r)},this.getRowFoldEnd=function(t,r){var l=this.getFoldLine(t,r);return l?l.end.row:t},this.getRowFoldStart=function(t,r){var l=this.getFoldLine(t,r);return l?l.start.row:t},this.getFoldDisplayLine=function(t,r,l,s,c){s==null&&(s=t.start.row),c==null&&(c=0),r==null&&(r=t.end.row),l==null&&(l=this.getLine(r).length);var f=this.doc,m="";return t.walk(function(y,D,E,b){if(!(D<s)){if(D==s){if(E<c)return;b=Math.max(c,b)}y!=null?m+=y:m+=f.getLine(D).substring(b,E)}},r,l),m},this.getDisplayLine=function(t,r,l,s){var c=this.getFoldLine(t);if(c)return this.getFoldDisplayLine(c,t,r,l,s);var f;return f=this.doc.getLine(t),f.substring(s||0,r||f.length)},this.$cloneFoldData=function(){var t=[];return t=this.$foldData.map(function(r){var l=r.folds.map(function(s){return s.clone()});return new h(t,l)}),t},this.toggleFold=function(t){var r=this.selection,l=r.getRange(),s,c;if(l.isEmpty()){var f=l.start;if(s=this.getFoldAt(f.row,f.column),s){this.expandFold(s);return}else if(t){var m=this.getFoldLine(f.row);m&&this.expandFolds(m.folds);return}else(c=this.findMatchingBracket(f))?l.comparePoint(c)==1?l.end=c:(l.start=c,l.start.column++,l.end.column--):(c=this.findMatchingBracket({row:f.row,column:f.column+1}))?(l.comparePoint(c)==1?l.end=c:l.start=c,l.start.column++):l=this.getCommentFoldRange(f.row,f.column)||l}else{var y=this.getFoldsInRange(l);if(t&&y.length){this.expandFolds(y);return}else y.length==1&&(s=y[0])}if(s||(s=this.getFoldAt(l.start.row,l.start.column)),s&&s.range.toString()==l.toString()){this.expandFold(s);return}var D="...";if(!l.isMultiLine()){if(D=this.getTextRange(l),D.length<4)return;D=D.trim().substring(0,2)+".."}this.addFold(D,l)},this.getCommentFoldRange=function(t,r,l){var s=new o(this,t,r),c=s.getCurrentToken(),f=c&&c.type;if(c&&/^comment|string/.test(f)){f=f.match(/comment|string/)[0],f=="comment"&&(f+="|doc-start|\\.doc");var m=new RegExp(f),y=new a;if(l!=1){do c=s.stepBackward();while(c&&m.test(c.type));c=s.stepForward()}y.start.row=s.getCurrentTokenRow(),y.start.column=s.getCurrentTokenColumn()+c.value.length,s=new o(this,t,r);var D=this.getState(s.$row);if(l!=-1){var E=-1;do if(c=s.stepForward(),E==-1){var b=this.getState(s.$row);D.toString()!==b.toString()&&(E=s.$row)}else if(s.$row>E)break;while(c&&m.test(c.type));c=s.stepBackward()}else c=s.getCurrentToken();return y.end.row=s.getCurrentTokenRow(),y.end.column=s.getCurrentTokenColumn(),y.start.row==y.end.row&&y.start.column>y.end.column?void 0:y}},this.foldAll=function(t,r,l,s){l==null&&(l=1e5);var c=this.foldWidgets;if(c){r=r||this.getLength(),t=t||0;for(var f=t;f<r;f++)if(c[f]==null&&(c[f]=this.getFoldWidget(f)),c[f]=="start"&&!(s&&!s(f))){var m=this.getFoldWidgetRange(f);m&&m.isMultiLine()&&m.end.row<=r&&m.start.row>=t&&(f=m.end.row,m.collapseChildren=l,this.addFold("...",m))}}},this.foldToLevel=function(t){for(this.foldAll();t-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var t=this;this.foldAll(null,null,null,function(r){for(var l=t.getTokens(r),s=0;s<l.length;s++){var c=l[s];if(!(c.type=="text"&&/^\s+$/.test(c.value)))return!!/comment/.test(c.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(t){if(!this.$foldStyles[t])throw new Error("invalid fold style: "+t+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=t){this.$foldStyle=t,t=="manual"&&this.unfold();var r=this.$foldMode;this.$setFolding(null),this.$setFolding(r)}},this.$setFolding=function(t){if(this.$foldMode!=t){if(this.$foldMode=t,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!t||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=t.getFoldWidget.bind(t,this,this.$foldStyle),this.getFoldWidgetRange=t.getFoldWidgetRange.bind(t,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(t,r){var l=this.foldWidgets;if(!l||r&&l[t])return{};for(var s=t-1,c;s>=0;){var f=l[s];if(f==null&&(f=l[s]=this.getFoldWidget(s)),f=="start"){var m=this.getFoldWidgetRange(s);if(c||(c=m),m&&m.end.row>=t)break}s--}return{range:s!==-1&&m,firstRange:c}},this.onFoldWidgetClick=function(t,r){r instanceof p&&(r=r.domEvent);var l={children:r.shiftKey,all:r.ctrlKey||r.metaKey,siblings:r.altKey},s=this.$toggleFoldWidget(t,l);if(!s){var c=r.target||r.srcElement;c&&/ace_fold-widget/.test(c.className)&&(c.className+=" ace_invalid")}},this.$toggleFoldWidget=function(t,r){if(this.getFoldWidget){var l=this.getFoldWidget(t),s=this.getLine(t),c=l==="end"?-1:1,f=this.getFoldAt(t,c===-1?0:s.length,c);if(f)return r.children||r.all?this.removeFold(f):this.expandFold(f),f;var m=this.getFoldWidgetRange(t,!0);if(m&&!m.isMultiLine()&&(f=this.getFoldAt(m.start.row,m.start.column,1),f&&m.isEqual(f.range)))return this.removeFold(f),f;if(r.siblings){var y=this.getParentFoldRangeData(t);if(y.range)var D=y.range.start.row+1,E=y.range.end.row;this.foldAll(D,E,r.all?1e4:0)}else r.children?(E=m?m.end.row:this.getLength(),this.foldAll(t+1,E,r.all?1e4:0)):m&&(r.all&&(m.collapseChildren=1e4),this.addFold("...",m));return m}},this.toggleFoldWidget=function(t){var r=this.selection.getCursor().row;r=this.getRowFoldStart(r);var l=this.$toggleFoldWidget(r,{});if(!l){var s=this.getParentFoldRangeData(r,!0);if(l=s.range||s.firstRange,l){r=l.start.row;var c=this.getFoldAt(r,this.getLine(r).length,1);c?this.removeFold(c):this.addFold("...",l)}}},this.updateFoldWidgets=function(t){var r=t.start.row,l=t.end.row-r;if(l===0)this.foldWidgets[r]=null;else if(t.action=="remove")this.foldWidgets.splice(r,l+1,null);else{var s=Array(l+1);s.unshift(r,1),this.foldWidgets.splice.apply(this.foldWidgets,s)}},this.tokenizerUpdateFoldWidgets=function(t){var r=t.data;r.first!=r.last&&this.foldWidgets.length>r.first&&this.foldWidgets.splice(r.first,this.foldWidgets.length)}}u.Folding=e}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(n,u,v){var a=n("../token_iterator").TokenIterator,h=n("../range").Range;function d(){this.findMatchingBracket=function(o,p){if(o.column==0)return null;var e=p||this.getLine(o.row).charAt(o.column-1);if(e=="")return null;var t=e.match(/([\(\[\{])|([\)\]\}])/);return t?t[1]?this.$findClosingBracket(t[1],o):this.$findOpeningBracket(t[2],o):null},this.getBracketRange=function(o){var p=this.getLine(o.row),e=!0,t,r=p.charAt(o.column-1),l=r&&r.match(/([\(\[\{])|([\)\]\}])/);if(l||(r=p.charAt(o.column),o={row:o.row,column:o.column+1},l=r&&r.match(/([\(\[\{])|([\)\]\}])/),e=!1),!l)return null;if(l[1]){var s=this.$findClosingBracket(l[1],o);if(!s)return null;t=h.fromPoints(o,s),e||(t.end.column++,t.start.column--),t.cursor=t.end}else{var s=this.$findOpeningBracket(l[2],o);if(!s)return null;t=h.fromPoints(s,o),e||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(o,p){var e=this.getLine(o.row),t=/([\(\[\{])|([\)\]\}])/,r=!p&&e.charAt(o.column-1),l=r&&r.match(t);if(l||(r=(p===void 0||p)&&e.charAt(o.column),o={row:o.row,column:o.column+1},l=r&&r.match(t)),!l)return null;var s=new h(o.row,o.column-1,o.row,o.column),c=l[1]?this.$findClosingBracket(l[1],o):this.$findOpeningBracket(l[2],o);if(!c)return[s];var f=new h(c.row,c.column,c.row,c.column+1);return[s,f]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(o,p,e){var t=this.$brackets[o],r=1,l=new a(this,p.row,p.column),s=l.getCurrentToken();if(s||(s=l.stepForward()),!!s){e||(e=new RegExp("(\\.?"+s.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var c=p.column-l.getCurrentTokenColumn()-2,f=s.value;;){for(;c>=0;){var m=f.charAt(c);if(m==t){if(r-=1,r==0)return{row:l.getCurrentTokenRow(),column:c+l.getCurrentTokenColumn()}}else m==o&&(r+=1);c-=1}do s=l.stepBackward();while(s&&!e.test(s.type));if(s==null)break;f=s.value,c=f.length-1}return null}},this.$findClosingBracket=function(o,p,e){var t=this.$brackets[o],r=1,l=new a(this,p.row,p.column),s=l.getCurrentToken();if(s||(s=l.stepForward()),!!s){e||(e=new RegExp("(\\.?"+s.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var c=p.column-l.getCurrentTokenColumn();;){for(var f=s.value,m=f.length;c<m;){var y=f.charAt(c);if(y==t){if(r-=1,r==0)return{row:l.getCurrentTokenRow(),column:c+l.getCurrentTokenColumn()}}else y==o&&(r+=1);c+=1}do s=l.stepForward();while(s&&!e.test(s.type));if(s==null)break;c=0}return null}},this.getMatchingTags=function(o){var p=new a(this,o.row,o.column),e=this.$findTagName(p);if(e){var t=p.stepBackward();return t.value==="<"?this.$findClosingTag(p,e):this.$findOpeningTag(p,e)}},this.$findTagName=function(o){var p=o.getCurrentToken(),e=!1,t=!1;if(p&&p.type.indexOf("tag-name")===-1)do t?p=o.stepBackward():p=o.stepForward(),p&&(p.value==="/>"?t=!0:p.type.indexOf("tag-name")!==-1&&(e=!0));while(p&&!e);return p},this.$findClosingTag=function(o,p){var e,t=p.value,r=p.value,l=0,s=new h(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);p=o.stepForward();var c=new h(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+p.value.length),f=!1;do{if(e=p,e.type.indexOf("tag-close")!==-1&&!f){var m=new h(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);f=!0}if(p=o.stepForward(),p){if(p.value===">"&&!f){var m=new h(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);f=!0}if(p.type.indexOf("tag-name")!==-1){if(t=p.value,r===t){if(e.value==="<")l++;else if(e.value==="</"&&(l--,l<0)){o.stepBackward();var y=new h(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+2);p=o.stepForward();var D=new h(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+p.value.length);if(p.type.indexOf("tag-close")===-1&&(p=o.stepForward()),p&&p.value===">")var E=new h(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);else return}}}else if(r===t&&p.value==="/>"&&(l--,l<0))var y=new h(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+2),D=y,E=D,m=new h(c.end.row,c.end.column,c.end.row,c.end.column+1)}}while(p&&l>=0);if(s&&m&&y&&E&&c&&D)return{openTag:new h(s.start.row,s.start.column,m.end.row,m.end.column),closeTag:new h(y.start.row,y.start.column,E.end.row,E.end.column),openTagName:c,closeTagName:D}},this.$findOpeningTag=function(o,p){var e=o.getCurrentToken(),t=p.value,r=0,l=o.getCurrentTokenRow(),s=o.getCurrentTokenColumn(),c=s+2,f=new h(l,s,l,c);o.stepForward();var m=new h(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+p.value.length);if(p.type.indexOf("tag-close")===-1&&(p=o.stepForward()),!(!p||p.value!==">")){var y=new h(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);o.stepBackward(),o.stepBackward();do if(p=e,l=o.getCurrentTokenRow(),s=o.getCurrentTokenColumn(),c=s+p.value.length,e=o.stepBackward(),p){if(p.type.indexOf("tag-name")!==-1){if(t===p.value)if(e.value==="<"){if(r++,r>0){var D=new h(l,s,l,c),E=new h(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);do p=o.stepForward();while(p&&p.value!==">");var b=new h(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1)}}else e.value==="</"&&r--}else if(p.value==="/>"){for(var g=0,S=e;S;){if(S.type.indexOf("tag-name")!==-1&&S.value===t){r--;break}else if(S.value==="<")break;S=o.stepBackward(),g++}for(var T=0;T<g;T++)o.stepForward()}}while(e&&r<=0);if(E&&b&&f&&y&&D&&m)return{openTag:new h(E.start.row,E.start.column,b.end.row,b.end.column),closeTag:new h(f.start.row,f.start.column,y.end.row,y.end.column),openTagName:D,closeTagName:m}}}}u.BracketMatch=d}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/line_widgets","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(n,u,v){var a=n("./lib/oop"),h=n("./lib/lang"),d=n("./bidihandler").BidiHandler,o=n("./config"),p=n("./lib/event_emitter").EventEmitter,e=n("./selection").Selection,t=n("./mode/text").Mode,r=n("./range").Range,l=n("./line_widgets").LineWidgets,s=n("./document").Document,c=n("./background_tokenizer").BackgroundTokenizer,f=n("./search_highlight").SearchHighlight,m=n("./undomanager").UndoManager,y=function(){function x(A,C){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(`
211
- `)},this.$gutterCustomWidgets={},this.bgTokenizer=new c(new t().getTokenizer(),this);var w=this;this.bgTokenizer.on("update",function($){w._signal("tokenizerUpdate",$)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof A!="object"||!A.getLine)&&(A=new s(A)),this.setDocument(A),this.selection=new e(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new d(this),o.resetOptions(this),this.setMode(C),o._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return x.prototype.$initOperationListeners=function(){var A=this;this.curOp=null,this.on("change",function(){A.curOp||(A.startOperation(),A.curOp.selectionBefore=A.$lastSel),A.curOp.docChanged=!0},!0),this.on("changeSelection",function(){A.curOp||(A.startOperation(),A.curOp.selectionBefore=A.$lastSel),A.curOp.selectionChanged=!0},!0),this.$operationResetTimer=h.delayedCall(this.endOperation.bind(this,!0))},x.prototype.startOperation=function(A){if(this.curOp){if(!A||this.curOp.command)return;this.prevOp=this.curOp}A||(A={}),this.$operationResetTimer.schedule(),this.curOp={command:A.command||{},args:A.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",A)},x.prototype.endOperation=function(A){if(this.curOp){if(A&&A.returnValue===!1){this.curOp=null,this._signal("endOperation",A);return}if(A==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var C=this.selection.toJSON();this.curOp.selectionAfter=C,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(C),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",A)}},x.prototype.setDocument=function(A){this.doc&&this.doc.off("change",this.$onChange),this.doc=A,A.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 A=new l(this);return this.widgetManager=A,this.$editor&&A.attach(this.$editor),A},set:function(A){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:A})},enumerable:!1,configurable:!0}),x.prototype.$resetRowCache=function(A){if(!A){this.$docRowCache=[],this.$screenRowCache=[];return}var C=this.$docRowCache.length,w=this.$getRowCacheIndex(this.$docRowCache,A)+1;C>w&&(this.$docRowCache.splice(w,C),this.$screenRowCache.splice(w,C))},x.prototype.$getRowCacheIndex=function(A,C){for(var w=0,$=A.length-1;w<=$;){var I=w+$>>1,F=A[I];if(C>F)w=I+1;else if(C<F)$=I-1;else return I}return w-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(A){var C=A.data;this.$resetRowCache(C.start.row)},x.prototype.onChange=function(A){this.$modified=!0,this.$bidiHandler.onChange(A),this.$resetRowCache(A.start.row);var C=this.$updateInternalDataOnChange(A);!this.$fromUndo&&this.$undoManager&&(C&&C.length&&(this.$undoManager.add({action:"removeFolds",folds:C},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(A,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(A),this._signal("change",A)},x.prototype.onSelectionChange=function(){this._signal("changeSelection")},x.prototype.setValue=function(A){this.doc.setValue(A),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},x.fromJSON=function(A){typeof A=="string"&&(A=JSON.parse(A));var C=new m;C.$undoStack=A.history.undo,C.$redoStack=A.history.redo,C.mark=A.history.mark,C.$rev=A.history.rev;var w=new x(A.value);return A.folds.forEach(function($){w.addFold("...",r.fromPoints($.start,$.end))}),w.setAnnotations(A.annotations),w.setBreakpoints(A.breakpoints),w.setMode(A.mode),w.setScrollLeft(A.scrollLeft),w.setScrollTop(A.scrollTop),w.setUndoManager(C),w.selection.fromJSON(A.selection),w},x.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(A){return A.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(A){return this.bgTokenizer.getState(A)},x.prototype.getTokens=function(A){return this.bgTokenizer.getTokens(A)},x.prototype.getTokenAt=function(A,C){var w=this.bgTokenizer.getTokens(A),$,I=0;if(C==null){var F=w.length-1;I=this.getLine(A).length}else for(var F=0;F<w.length&&(I+=w[F].value.length,!(I>=C));F++);return $=w[F],$?($.index=F,$.start=I-$.value.length,$):null},x.prototype.setUndoManager=function(A){if(this.$undoManager=A,this.$informUndoManager&&this.$informUndoManager.cancel(),A){var C=this;A.addSession(this),this.$syncInformUndoManager=function(){C.$informUndoManager.cancel(),C.mergeUndoDeltas=!1},this.$informUndoManager=h.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()?h.stringRepeat(" ",this.getTabSize()):" "},x.prototype.setUseSoftTabs=function(A){this.setOption("useSoftTabs",A)},x.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},x.prototype.setTabSize=function(A){this.setOption("tabSize",A)},x.prototype.getTabSize=function(){return this.$tabSize},x.prototype.isTabStop=function(A){return this.$useSoftTabs&&A.column%this.$tabSize===0},x.prototype.setNavigateWithinSoftTabs=function(A){this.setOption("navigateWithinSoftTabs",A)},x.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},x.prototype.setOverwrite=function(A){this.setOption("overwrite",A)},x.prototype.getOverwrite=function(){return this.$overwrite},x.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},x.prototype.addGutterDecoration=function(A,C){this.$decorations[A]||(this.$decorations[A]=""),this.$decorations[A]+=" "+C,this._signal("changeBreakpoint",{})},x.prototype.removeGutterCustomWidget=function(A){this.$editor&&this.$editor.renderer.$gutterLayer.$removeCustomWidget(A)},x.prototype.addGutterCustomWidget=function(A,C){this.$editor&&this.$editor.renderer.$gutterLayer.$addCustomWidget(A,C)},x.prototype.removeGutterDecoration=function(A,C){this.$decorations[A]=(this.$decorations[A]||"").replace(" "+C,""),this._signal("changeBreakpoint",{})},x.prototype.getBreakpoints=function(){return this.$breakpoints},x.prototype.setBreakpoints=function(A){this.$breakpoints=[];for(var C=0;C<A.length;C++)this.$breakpoints[A[C]]="ace_breakpoint";this._signal("changeBreakpoint",{})},x.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},x.prototype.setBreakpoint=function(A,C){C===void 0&&(C="ace_breakpoint"),C?this.$breakpoints[A]=C:delete this.$breakpoints[A],this._signal("changeBreakpoint",{})},x.prototype.clearBreakpoint=function(A){delete this.$breakpoints[A],this._signal("changeBreakpoint",{})},x.prototype.addMarker=function(A,C,w,$){var I=this.$markerId++,F={range:A,type:w||"line",renderer:typeof w=="function"?w:null,clazz:C,inFront:!!$,id:I};return $?(this.$frontMarkers[I]=F,this._signal("changeFrontMarker")):(this.$backMarkers[I]=F,this._signal("changeBackMarker")),I},x.prototype.addDynamicMarker=function(A,C){if(A.update){var w=this.$markerId++;return A.id=w,A.inFront=!!C,C?(this.$frontMarkers[w]=A,this._signal("changeFrontMarker")):(this.$backMarkers[w]=A,this._signal("changeBackMarker")),A}},x.prototype.removeMarker=function(A){var C=this.$frontMarkers[A]||this.$backMarkers[A];if(C){var w=C.inFront?this.$frontMarkers:this.$backMarkers;delete w[A],this._signal(C.inFront?"changeFrontMarker":"changeBackMarker")}},x.prototype.getMarkers=function(A){return A?this.$frontMarkers:this.$backMarkers},x.prototype.highlight=function(A){if(!this.$searchHighlight){var C=new f(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(C)}this.$searchHighlight.setRegexp(A)},x.prototype.highlightLines=function(A,C,w,$){typeof C!="number"&&(w=C,C=A),w||(w="ace_step");var I=new r(A,0,C,1/0);return I.id=this.addMarker(I,w,"fullLine",$),I},x.prototype.setAnnotations=function(A){this.$annotations=A,this._signal("changeAnnotation",{})},x.prototype.getAnnotations=function(){return this.$annotations||[]},x.prototype.clearAnnotations=function(){this.setAnnotations([])},x.prototype.$detectNewLine=function(A){var C=A.match(/^.*?(\r?\n)/m);C?this.$autoNewLine=C[1]:this.$autoNewLine=`
212
- `},x.prototype.getWordRange=function(A,C){var w=this.getLine(A),$=!1;if(C>0&&($=!!w.charAt(C-1).match(this.tokenRe)),$||($=!!w.charAt(C).match(this.tokenRe)),$)var I=this.tokenRe;else if(/^\s+$/.test(w.slice(C-1,C+1)))var I=/\s/;else var I=this.nonTokenRe;var F=C;if(F>0){do F--;while(F>=0&&w.charAt(F).match(I));F++}for(var O=C;O<w.length&&w.charAt(O).match(I);)O++;return new r(A,F,A,O)},x.prototype.getAWordRange=function(A,C){for(var w=this.getWordRange(A,C),$=this.getLine(w.end.row);$.charAt(w.end.column).match(/[ \t]/);)w.end.column+=1;return w},x.prototype.setNewLineMode=function(A){this.doc.setNewLineMode(A)},x.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},x.prototype.setUseWorker=function(A){this.setOption("useWorker",A)},x.prototype.getUseWorker=function(){return this.$useWorker},x.prototype.onReloadTokenizer=function(A){var C=A.data;this.bgTokenizer.start(C.first),this._signal("tokenizerUpdate",A)},x.prototype.setMode=function(A,C){if(A&&typeof A=="object"){if(A.getTokenizer)return this.$onChangeMode(A);var w=A,$=w.path}else $=A||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new t),this.$modes[$]&&!w){this.$onChangeMode(this.$modes[$]),C&&C();return}this.$modeId=$,o.loadModule(["mode",$],function(I){if(!this.destroyed){if(this.$modeId!==$)return C&&C();this.$modes[$]&&!w?this.$onChangeMode(this.$modes[$]):I&&I.Mode&&(I=new I.Mode(w),w||(this.$modes[$]=I,I.$id=$),this.$onChangeMode(I)),C&&C()}}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},x.prototype.$onChangeMode=function(A,C){if(C||(this.$modeId=A.$id),this.$mode!==A){var w=this.$mode;this.$mode=A,this.$stopWorker(),this.$useWorker&&this.$startWorker();var $=A.getTokenizer();if($.on!==void 0){var I=this.onReloadTokenizer.bind(this);$.on("update",I)}this.bgTokenizer.setTokenizer($),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=A.tokenRe,this.nonTokenRe=A.nonTokenRe,C||(A.attachToSession&&A.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(A.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:w,mode:A}))}},x.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},x.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(A){o.warn("Could not load worker",A),this.$worker=null}},x.prototype.getMode=function(){return this.$mode},x.prototype.setScrollTop=function(A){this.$scrollTop===A||isNaN(A)||(this.$scrollTop=A,this._signal("changeScrollTop",A))},x.prototype.getScrollTop=function(){return this.$scrollTop},x.prototype.setScrollLeft=function(A){this.$scrollLeft===A||isNaN(A)||(this.$scrollLeft=A,this._signal("changeScrollLeft",A))},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 A=0;return this.lineWidgets.forEach(function(C){C&&C.screenWidth>A&&(A=C.screenWidth)}),this.lineWidgetWidth=A},x.prototype.$computeWidth=function(A){if(this.$modified||A){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var C=this.doc.getAllLines(),w=this.$rowLengthCache,$=0,I=0,F=this.$foldData[I],O=F?F.start.row:1/0,B=C.length,P=0;P<B;P++){if(P>O){if(P=F.end.row+1,P>=B)break;F=this.$foldData[I++],O=F?F.start.row:1/0}w[P]==null&&(w[P]=this.$getStringScreenWidth(C[P])[0]),w[P]>$&&($=w[P])}this.screenWidth=$}},x.prototype.getLine=function(A){return this.doc.getLine(A)},x.prototype.getLines=function(A,C){return this.doc.getLines(A,C)},x.prototype.getLength=function(){return this.doc.getLength()},x.prototype.getTextRange=function(A){return this.doc.getTextRange(A||this.selection.getRange())},x.prototype.insert=function(A,C){return this.doc.insert(A,C)},x.prototype.remove=function(A){return this.doc.remove(A)},x.prototype.removeFullLines=function(A,C){return this.doc.removeFullLines(A,C)},x.prototype.undoChanges=function(A,C){if(A.length){this.$fromUndo=!0;for(var w=A.length-1;w!=-1;w--){var $=A[w];$.action=="insert"||$.action=="remove"?this.doc.revertDelta($):$.folds&&this.addFolds($.folds)}!C&&this.$undoSelect&&(A.selectionBefore?this.selection.fromJSON(A.selectionBefore):this.selection.setRange(this.$getUndoSelection(A,!0))),this.$fromUndo=!1}},x.prototype.redoChanges=function(A,C){if(A.length){this.$fromUndo=!0;for(var w=0;w<A.length;w++){var $=A[w];($.action=="insert"||$.action=="remove")&&this.doc.$safeApplyDelta($)}!C&&this.$undoSelect&&(A.selectionAfter?this.selection.fromJSON(A.selectionAfter):this.selection.setRange(this.$getUndoSelection(A,!1))),this.$fromUndo=!1}},x.prototype.setUndoSelect=function(A){this.$undoSelect=A},x.prototype.$getUndoSelection=function(A,C){function w(B){return C?B.action!=="insert":B.action==="insert"}for(var $,I,F=0;F<A.length;F++){var O=A[F];if(O.start){if(!$){w(O)?$=r.fromPoints(O.start,O.end):$=r.fromPoints(O.start,O.start);continue}w(O)?(I=O.start,$.compare(I.row,I.column)==-1&&$.setStart(I),I=O.end,$.compare(I.row,I.column)==1&&$.setEnd(I)):(I=O.start,$.compare(I.row,I.column)==-1&&($=r.fromPoints(O.start,O.start)))}}return $},x.prototype.replace=function(A,C){return this.doc.replace(A,C)},x.prototype.moveText=function(A,C,w){var $=this.getTextRange(A),I=this.getFoldsInRange(A),F=r.fromPoints(C,C);if(!w){this.remove(A);var O=A.start.row-A.end.row,B=O?-A.end.column:A.start.column-A.end.column;B&&(F.start.row==A.end.row&&F.start.column>A.end.column&&(F.start.column+=B),F.end.row==A.end.row&&F.end.column>A.end.column&&(F.end.column+=B)),O&&F.start.row>=A.end.row&&(F.start.row+=O,F.end.row+=O)}if(F.end=this.insert(F.start,$),I.length){var P=A.start,V=F.start,O=V.row-P.row,B=V.column-P.column;this.addFolds(I.map(function(U){return U=U.clone(),U.start.row==P.row&&(U.start.column+=B),U.end.row==P.row&&(U.end.column+=B),U.start.row+=O,U.end.row+=O,U}))}return F},x.prototype.indentRows=function(A,C,w){w=w.replace(/\t/g,this.getTabString());for(var $=A;$<=C;$++)this.doc.insertInLine({row:$,column:0},w)},x.prototype.outdentRows=function(A){for(var C=A.collapseRows(),w=new r(0,0,0,0),$=this.getTabSize(),I=C.start.row;I<=C.end.row;++I){var F=this.getLine(I);w.start.row=I,w.end.row=I;for(var O=0;O<$&&F.charAt(O)==" ";++O);O<$&&F.charAt(O)==" "?(w.start.column=O,w.end.column=O+1):(w.start.column=0,w.end.column=O),this.remove(w)}},x.prototype.$moveLines=function(A,C,w){if(A=this.getRowFoldStart(A),C=this.getRowFoldEnd(C),w<0){var $=this.getRowFoldStart(A+w);if($<0)return 0;var I=$-A}else if(w>0){var $=this.getRowFoldEnd(C+w);if($>this.doc.getLength()-1)return 0;var I=$-C}else{A=this.$clipRowToDocument(A),C=this.$clipRowToDocument(C);var I=C-A+1}var F=new r(A,0,C,Number.MAX_VALUE),O=this.getFoldsInRange(F).map(function(P){return P=P.clone(),P.start.row+=I,P.end.row+=I,P}),B=w==0?this.doc.getLines(A,C):this.doc.removeFullLines(A,C);return this.doc.insertFullLines(A+I,B),O.length&&this.addFolds(O),I},x.prototype.moveLinesUp=function(A,C){return this.$moveLines(A,C,-1)},x.prototype.moveLinesDown=function(A,C){return this.$moveLines(A,C,1)},x.prototype.duplicateLines=function(A,C){return this.$moveLines(A,C,0)},x.prototype.$clipRowToDocument=function(A){return Math.max(0,Math.min(A,this.doc.getLength()-1))},x.prototype.$clipColumnToRow=function(A,C){return C<0?0:Math.min(this.doc.getLine(A).length,C)},x.prototype.$clipPositionToDocument=function(A,C){if(C=Math.max(0,C),A<0)A=0,C=0;else{var w=this.doc.getLength();A>=w?(A=w-1,C=this.doc.getLine(w-1).length):C=Math.min(this.doc.getLine(A).length,C)}return{row:A,column:C}},x.prototype.$clipRangeToDocument=function(A){A.start.row<0?(A.start.row=0,A.start.column=0):A.start.column=this.$clipColumnToRow(A.start.row,A.start.column);var C=this.doc.getLength()-1;return A.end.row>C?(A.end.row=C,A.end.column=this.doc.getLine(C).length):A.end.column=this.$clipColumnToRow(A.end.row,A.end.column),A},x.prototype.setUseWrapMode=function(A){if(A!=this.$useWrapMode){if(this.$useWrapMode=A,this.$modified=!0,this.$resetRowCache(0),A){var C=this.getLength();this.$wrapData=Array(C),this.$updateWrapData(0,C-1)}this._signal("changeWrapMode")}},x.prototype.getUseWrapMode=function(){return this.$useWrapMode},x.prototype.setWrapLimitRange=function(A,C){(this.$wrapLimitRange.min!==A||this.$wrapLimitRange.max!==C)&&(this.$wrapLimitRange={min:A,max:C},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},x.prototype.adjustWrapLimit=function(A,C){var w=this.$wrapLimitRange;w.max<0&&(w={min:C,max:C});var $=this.$constrainWrapLimit(A,w.min,w.max);return $!=this.$wrapLimit&&$>1?(this.$wrapLimit=$,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},x.prototype.$constrainWrapLimit=function(A,C,w){return C&&(A=Math.max(C,A)),w&&(A=Math.min(w,A)),A},x.prototype.getWrapLimit=function(){return this.$wrapLimit},x.prototype.setWrapLimit=function(A){this.setWrapLimitRange(A,A)},x.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},x.prototype.$updateInternalDataOnChange=function(A){var C=this.$useWrapMode,w=A.action,$=A.start,I=A.end,F=$.row,O=I.row,B=O-F,P=null;if(this.$updating=!0,B!=0)if(w==="remove"){this[C?"$wrapData":"$rowLengthCache"].splice(F,B);var V=this.$foldData;P=this.getFoldsInRange(A),this.removeFolds(P);var W=this.getFoldLine(I.row),H=0;if(W){W.addRemoveChars(I.row,I.column,$.column-I.column),W.shiftRow(-B);var U=this.getFoldLine(F);U&&U!==W&&(U.merge(W),W=U),H=V.indexOf(W)+1}for(H;H<V.length;H++){var W=V[H];W.start.row>=I.row&&W.shiftRow(-B)}O=F}else{var G=Array(B);G.unshift(F,0);var Y=C?this.$wrapData:this.$rowLengthCache;Y.splice.apply(Y,G);var V=this.$foldData,W=this.getFoldLine(F),H=0;if(W){var Q=W.range.compareInside($.row,$.column);Q==0?(W=W.split($.row,$.column),W&&(W.shiftRow(B),W.addRemoveChars(O,0,I.column-$.column))):Q==-1&&(W.addRemoveChars(F,0,I.column-$.column),W.shiftRow(B)),H=V.indexOf(W)+1}for(H;H<V.length;H++){var W=V[H];W.start.row>=F&&W.shiftRow(B)}}else{B=Math.abs(A.start.column-A.end.column),w==="remove"&&(P=this.getFoldsInRange(A),this.removeFolds(P),B=-B);var W=this.getFoldLine(F);W&&W.addRemoveChars(F,$.column,B)}return C&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,C?this.$updateWrapData(F,O):this.$updateRowLengthCache(F,O),P},x.prototype.$updateRowLengthCache=function(A,C){this.$rowLengthCache[A]=null,this.$rowLengthCache[C]=null},x.prototype.$updateWrapData=function(A,C){var w=this.doc.getAllLines(),$=this.getTabSize(),I=this.$wrapData,F=this.$wrapLimit,O,B,P=A;for(C=Math.min(C,w.length-1);P<=C;)B=this.getFoldLine(P,B),B?(O=[],B.walk(function(V,W,H,U){var G;if(V!=null){G=this.$getDisplayTokens(V,O.length),G[0]=b;for(var Y=1;Y<G.length;Y++)G[Y]=g}else G=this.$getDisplayTokens(w[W].substring(U,H),O.length);O=O.concat(G)}.bind(this),B.end.row,w[B.end.row].length+1),I[B.start.row]=this.$computeWrapSplits(O,F,$),P=B.end.row+1):(O=this.$getDisplayTokens(w[P]),I[P]=this.$computeWrapSplits(O,F,$),P++)},x.prototype.$computeWrapSplits=function(A,C,w){if(A.length==0)return[];var $=[],I=A.length,F=0,O=0,B=this.$wrapAsCode,P=this.$indentedSoftWrap,V=C<=Math.max(2*w,8)||P===!1?0:Math.floor(C/2);function W(){var Q=0;if(V===0)return Q;if(P)for(var ee=0;ee<A.length;ee++){var ne=A[ee];if(ne==T)Q+=1;else if(ne==k)Q+=w;else{if(ne==_)continue;break}}return B&&P!==!1&&(Q+=w),Math.min(Q,V)}function H(Q){for(var ee=Q-F,ne=F;ne<Q;ne++){var se=A[ne];(se===12||se===2)&&(ee-=1)}$.length||(U=W(),$.indent=U),O+=ee,$.push(O),F=Q}for(var U=0;I-F>C-U;){var G=F+C-U;if(A[G-1]>=T&&A[G]>=T){H(G);continue}if(A[G]==b||A[G]==g){for(G;G!=F-1&&A[G]!=b;G--);if(G>F){H(G);continue}for(G=F+C,G;G<A.length&&A[G]==g;G++);if(G==A.length)break;H(G);continue}for(var Y=Math.max(G-(C-(C>>2)),F-1);G>Y&&A[G]<b;)G--;if(B){for(;G>Y&&A[G]<b;)G--;for(;G>Y&&A[G]==S;)G--}else for(;G>Y&&A[G]<T;)G--;if(G>Y){H(++G);continue}G=F+C,A[G]==E&&G--,H(G-U)}return $},x.prototype.$getDisplayTokens=function(A,C){var w=[],$;C=C||0;for(var I=0;I<A.length;I++){var F=A.charCodeAt(I);if(F==9){$=this.getScreenTabSize(w.length+C),w.push(k);for(var O=1;O<$;O++)w.push(_)}else F==32?w.push(T):F>39&&F<48||F>57&&F<64?w.push(S):F>=4352&&R(F)?w.push(D,E):w.push(D)}return w},x.prototype.$getStringScreenWidth=function(A,C,w){if(C==0)return[0,0];C==null&&(C=1/0),w=w||0;var $,I;for(I=0;I<A.length&&($=A.charCodeAt(I),$==9?w+=this.getScreenTabSize(w):$>=4352&&R($)?w+=2:w+=1,!(w>C));I++);return[w,I]},x.prototype.getRowLength=function(A){var C=1;return this.lineWidgets&&(C+=this.lineWidgets[A]&&this.lineWidgets[A].rowCount||0),!this.$useWrapMode||!this.$wrapData[A]?C:this.$wrapData[A].length+C},x.prototype.getRowLineCount=function(A){return!this.$useWrapMode||!this.$wrapData[A]?1:this.$wrapData[A].length+1},x.prototype.getRowWrapIndent=function(A){if(this.$useWrapMode){var C=this.screenToDocumentPosition(A,Number.MAX_VALUE),w=this.$wrapData[C.row];return w.length&&w[0]<C.column?w.indent:0}else return 0},x.prototype.getScreenLastRowColumn=function(A){var C=this.screenToDocumentPosition(A,Number.MAX_VALUE);return this.documentToScreenColumn(C.row,C.column)},x.prototype.getDocumentLastRowColumn=function(A,C){var w=this.documentToScreenRow(A,C);return this.getScreenLastRowColumn(w)},x.prototype.getDocumentLastRowColumnPosition=function(A,C){var w=this.documentToScreenRow(A,C);return this.screenToDocumentPosition(w,Number.MAX_VALUE/10)},x.prototype.getRowSplitData=function(A){if(this.$useWrapMode)return this.$wrapData[A]},x.prototype.getScreenTabSize=function(A){return this.$tabSize-(A%this.$tabSize|0)},x.prototype.screenToDocumentRow=function(A,C){return this.screenToDocumentPosition(A,C).row},x.prototype.screenToDocumentColumn=function(A,C){return this.screenToDocumentPosition(A,C).column},x.prototype.screenToDocumentPosition=function(A,C,w){if(A<0)return{row:0,column:0};var $,I=0,F=0,O,B=0,P=0,V=this.$screenRowCache,W=this.$getRowCacheIndex(V,A),H=V.length;if(H&&W>=0)var B=V[W],I=this.$docRowCache[W],U=A>V[H-1];else var U=!H;for(var G=this.getLength()-1,Y=this.getNextFoldLine(I),Q=Y?Y.start.row:1/0;B<=A&&(P=this.getRowLength(I),!(B+P>A||I>=G));)B+=P,I++,I>Q&&(I=Y.end.row+1,Y=this.getNextFoldLine(I,Y),Q=Y?Y.start.row:1/0),U&&(this.$docRowCache.push(I),this.$screenRowCache.push(B));if(Y&&Y.start.row<=I)$=this.getFoldDisplayLine(Y),I=Y.start.row;else{if(B+P<=A||I>G)return{row:G,column:this.getLine(G).length};$=this.getLine(I),Y=null}var ee=0,ne=Math.floor(A-B);if(this.$useWrapMode){var se=this.$wrapData[I];se&&(O=se[ne],ne>0&&se.length&&(ee=se.indent,F=se[ne-1]||se[se.length-1],$=$.substring(F)))}return w!==void 0&&this.$bidiHandler.isBidiRow(B+ne,I,ne)&&(C=this.$bidiHandler.offsetToCol(w)),F+=this.$getStringScreenWidth($,C-ee)[1],this.$useWrapMode&&F>=O&&(F=O-1),Y?Y.idxToPosition(F):{row:I,column:F}},x.prototype.documentToScreenPosition=function(A,C){if(typeof C>"u")var w=this.$clipPositionToDocument(A.row,A.column);else w=this.$clipPositionToDocument(A,C);A=w.row,C=w.column;var $=0,I=null,F=null;F=this.getFoldAt(A,C,1),F&&(A=F.start.row,C=F.start.column);var O,B=0,P=this.$docRowCache,V=this.$getRowCacheIndex(P,A),W=P.length;if(W&&V>=0)var B=P[V],$=this.$screenRowCache[V],H=A>P[W-1];else var H=!W;for(var U=this.getNextFoldLine(B),G=U?U.start.row:1/0;B<A;){if(B>=G){if(O=U.end.row+1,O>A)break;U=this.getNextFoldLine(O,U),G=U?U.start.row:1/0}else O=B+1;$+=this.getRowLength(B),B=O,H&&(this.$docRowCache.push(B),this.$screenRowCache.push($))}var Y="";U&&B>=G?(Y=this.getFoldDisplayLine(U,A,C),I=U.start.row):(Y=this.getLine(A).substring(0,C),I=A);var Q=0;if(this.$useWrapMode){var ee=this.$wrapData[I];if(ee){for(var ne=0;Y.length>=ee[ne];)$++,ne++;Y=Y.substring(ee[ne-1]||0,Y.length),Q=ne>0?ee.indent:0}}return this.lineWidgets&&this.lineWidgets[B]&&this.lineWidgets[B].rowsAbove&&($+=this.lineWidgets[B].rowsAbove),{row:$,column:Q+this.$getStringScreenWidth(Y)[0]}},x.prototype.documentToScreenColumn=function(A,C){return this.documentToScreenPosition(A,C).column},x.prototype.documentToScreenRow=function(A,C){return this.documentToScreenPosition(A,C).row},x.prototype.getScreenLength=function(){var A=0,C=null;if(this.$useWrapMode)for(var I=this.$wrapData.length,F=0,$=0,C=this.$foldData[$++],O=C?C.start.row:1/0;F<I;){var B=this.$wrapData[F];A+=B?B.length+1:1,F++,F>O&&(F=C.end.row+1,C=this.$foldData[$++],O=C?C.start.row:1/0)}else{A=this.getLength();for(var w=this.$foldData,$=0;$<w.length;$++)C=w[$],A-=C.end.row-C.start.row}return this.lineWidgets&&(A+=this.$getWidgetScreenLength()),A},x.prototype.$setFontMetrics=function(A){this.$enableVarChar&&(this.$getStringScreenWidth=function(C,w,$){if(w===0)return[0,0];w||(w=1/0),$=$||0;var I,F;for(F=0;F<C.length&&(I=C.charAt(F),I===" "?$+=this.getScreenTabSize($):$+=A.getCharacterWidth(I),!($>w));F++);return[$,F]})},x.prototype.getPrecedingCharacter=function(){var A=this.selection.getCursor();if(A.column===0)return A.row===0?"":this.doc.getNewLineCharacter();var C=this.getLine(A.row);return C[A.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}();y.$uid=0,y.prototype.$modes=o.$modes,y.prototype.getValue=y.prototype.toString,y.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},y.prototype.$overwrite=!1,y.prototype.$mode=null,y.prototype.$modeId=null,y.prototype.$scrollTop=0,y.prototype.$scrollLeft=0,y.prototype.$wrapLimit=80,y.prototype.$useWrapMode=!1,y.prototype.$wrapLimitRange={min:null,max:null},y.prototype.lineWidgets=null,y.prototype.isFullWidth=R,a.implement(y.prototype,p);var D=1,E=2,b=3,g=4,S=9,T=10,k=11,_=12;function R(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}n("./edit_session/folding").Folding.call(y.prototype),n("./edit_session/bracket_match").BracketMatch.call(y.prototype),o.defineOptions(y.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 A=typeof x=="number"?x:null;this.setWrapLimitRange(A,A),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}}),u.EditSession=y}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(n,u,v){var a=n("./lib/lang"),h=n("./lib/oop"),d=n("./range").Range,o=function(){function r(){this.$options={}}return r.prototype.set=function(l){return h.mixin(this.$options,l),this},r.prototype.getOptions=function(){return a.copyObject(this.$options)},r.prototype.setOptions=function(l){this.$options=l},r.prototype.find=function(l){var s=this.$options,c=this.$matchIterator(l,s);if(!c)return!1;var f=null;return c.forEach(function(m,y,D,E){return f=new d(m,y,D,E),y==E&&s.start&&s.start.start&&s.skipCurrent!=!1&&f.isEqual(s.start)?(f=null,!1):!0}),f},r.prototype.findAll=function(l){var s=this.$options;if(!s.needle)return[];this.$assembleRegExp(s);var c=s.range,f=c?l.getLines(c.start.row,c.end.row):l.doc.getAllLines(),m=[],y=s.re;if(s.$isMultiLine){var D=y.length,E=f.length-D,b;e:for(var g=y.offset||0;g<=E;g++){for(var S=0;S<D;S++)if(f[g+S].search(y[S])==-1)continue e;var T=f[g],k=f[g+D-1],_=T.length-T.match(y[0])[0].length,R=k.match(y[D-1])[0].length;b&&b.end.row===g&&b.end.column>_||(m.push(b=new d(g,_,g+D-1,R)),D>2&&(g=g+D-2))}}else for(var x,A=0;A<f.length;A++)if(this.$isMultilineSearch(s)){var C=f.length-1;if(x=this.$multiLineForward(l,y,A,C),x){var w=x.endRow<=C?x.endRow-1:C;w>A&&(A=w),m.push(new d(x.startRow,x.startCol,x.endRow,x.endCol))}}else{x=a.getMatchOffsets(f[A],y);for(var S=0;S<x.length;S++){var $=x[S];m.push(new d(A,$.offset,A,$.offset+$.length))}}if(c){for(var I=c.start.column,F=c.end.column,A=0,S=m.length-1;A<S&&m[A].start.column<I&&m[A].start.row==0;)A++;for(var O=c.end.row-c.start.row;A<S&&m[S].end.column>F&&m[S].end.row==O;)S--;for(m=m.slice(A,S+1),A=0,S=m.length;A<S;A++)m[A].start.row+=c.start.row,m[A].end.row+=c.start.row}return m},r.prototype.parseReplaceString=function(l){for(var s={DollarSign:36,Ampersand:38,Digit0:48,Digit1:49,Digit9:57,Backslash:92,n:110,t:116},c="",f=0,m=l.length;f<m;f++){var y=l.charCodeAt(f);if(y===s.Backslash){if(f++,f>=m){c+="\\";break}var D=l.charCodeAt(f);switch(D){case s.Backslash:c+="\\";break;case s.n:c+=`
213
- `;break;case s.t:c+=" ";break}continue}if(y===s.DollarSign){if(f++,f>=m){c+="$";break}var E=l.charCodeAt(f);if(E===s.DollarSign){c+="$$";continue}if(E===s.Digit0||E===s.Ampersand){c+="$&";continue}if(s.Digit1<=E&&E<=s.Digit9){c+="$"+l[f];continue}}c+=l[f]}return c||l},r.prototype.replace=function(l,s){var c=this.$options,f=this.$assembleRegExp(c);if(c.$isMultiLine)return s;if(f){var m=this.$isMultilineSearch(c);m&&(l=l.replace(/\r\n|\r|\n/g,`
214
- `));var y=f.exec(l);if(!y||!m&&y[0].length!=l.length)return null;if(s=c.regExp?this.parseReplaceString(s):s.replace(/\$/g,"$$$$"),s=l.replace(f,s),c.preserveCase){s=s.split("");for(var D=Math.min(l.length,l.length);D--;){var E=l[D];E&&E.toLowerCase()!=E?s[D]=s[D].toUpperCase():s[D]=s[D].toLowerCase()}s=s.join("")}return s}},r.prototype.$assembleRegExp=function(l,s){if(l.needle instanceof RegExp)return l.re=l.needle;var c=l.needle;if(!l.needle)return l.re=!1;l.regExp||(c=a.escapeRegExp(c));var f=l.caseSensitive?"gm":"gmi";try{new RegExp(c,"u"),l.$supportsUnicodeFlag=!0,f+="u"}catch{l.$supportsUnicodeFlag=!1}if(l.wholeWord&&(c=p(c,l)),l.$isMultiLine=!s&&/[\n\r]/.test(c),l.$isMultiLine)return l.re=this.$assembleMultilineRegExp(c,f);try{var m=new RegExp(c,f)}catch{m=!1}return l.re=m},r.prototype.$assembleMultilineRegExp=function(l,s){for(var c=l.replace(/\r\n|\r|\n/g,`$
215
- ^`).split(`
216
- `),f=[],m=0;m<c.length;m++)try{f.push(new RegExp(c[m],s))}catch{return!1}return f},r.prototype.$isMultilineSearch=function(l){return l.re&&/\\r\\n|\\r|\\n/.test(l.re.source)&&l.regExp&&!l.$isMultiLine},r.prototype.$multiLineForward=function(l,s,c,f){for(var m,y=t(l,c),D=c;D<=f;){for(var E=0;E<y&&!(D>f);E++){var b=l.getLine(D++);m=m==null?b:m+`
217
- `+b}var g=s.exec(m);if(s.lastIndex=0,g){var S=m.slice(0,g.index).split(`
218
- `),T=g[0].split(`
219
- `),k=c+S.length-1,_=S[S.length-1].length,R=k+T.length-1,x=T.length==1?_+T[0].length:T[T.length-1].length;return{startRow:k,startCol:_,endRow:R,endCol:x}}}return null},r.prototype.$multiLineBackward=function(l,s,c,f,m){for(var y,D=t(l,f),E=l.getLine(f).length-c,b=f;b>=m;){for(var g=0;g<D&&b>=m;g++){var S=l.getLine(b--);y=y==null?S:S+`
220
- `+y}var T=e(y,s,E);if(T){var k=y.slice(0,T.index).split(`
221
- `),_=T[0].split(`
222
- `),R=b+k.length,x=k[k.length-1].length,A=R+_.length-1,C=_.length==1?x+_[0].length:_[_.length-1].length;return{startRow:R,startCol:x,endRow:A,endCol:C}}}return null},r.prototype.$matchIterator=function(l,s){var c=this.$assembleRegExp(s);if(!c)return!1;var f=this.$isMultilineSearch(s),m=this.$multiLineForward,y=this.$multiLineBackward,D=s.backwards==!0,E=s.skipCurrent!=!1,b=c.unicode,g=s.range,S=s.start;S||(S=g?g[D?"end":"start"]:l.selection.getRange()),S.start&&(S=S[E!=D?"end":"start"]);var T=g?g.start.row:0,k=g?g.end.row:l.getLength()-1;if(D)var _=function(A){var C=S.row;if(!x(C,S.column,A)){for(C--;C>=T;C--)if(x(C,Number.MAX_VALUE,A))return;if(s.wrap!=!1){for(C=k,T=S.row;C>=T;C--)if(x(C,Number.MAX_VALUE,A))return}}};else var _=function(C){var w=S.row;if(!x(w,S.column,C)){for(w=w+1;w<=k;w++)if(x(w,0,C))return;if(s.wrap!=!1){for(w=T,k=S.row;w<=k;w++)if(x(w,0,C))return}}};if(s.$isMultiLine)var R=c.length,x=function(A,C,w){var $=D?A-R+1:A;if(!($<0||$+R>l.getLength())){var I=l.getLine($),F=I.search(c[0]);if(!(!D&&F<C||F===-1)){for(var O=1;O<R;O++)if(I=l.getLine($+O),I.search(c[O])==-1)return;var B=I.match(c[R-1])[0].length;if(!(D&&B>C)&&w($,F,$+R-1,B))return!0}}};else if(D)var x=function(C,w,$){if(f){var I=y(l,c,w,C,T);if(!I)return!1;if($(I.startRow,I.startCol,I.endRow,I.endCol))return!0}else{var F=l.getLine(C),O=[],B,P=0;for(c.lastIndex=0;B=c.exec(F);){var V=B[0].length;if(P=B.index,!V){if(P>=F.length)break;c.lastIndex=P+=a.skipEmptyMatch(F,P,b)}if(B.index+V>w)break;O.push(B.index,V)}for(var W=O.length-1;W>=0;W-=2){var H=O[W-1],V=O[W];if($(C,H,C,H+V))return!0}}};else var x=function(C,w,$){if(c.lastIndex=w,f){var I=m(l,c,C,k);if(I){var F=I.endRow<=k?I.endRow-1:k;F>C&&(C=F)}if(!I)return!1;if($(I.startRow,I.startCol,I.endRow,I.endCol))return!0}else for(var O=l.getLine(C),B,P;P=c.exec(O);){var V=P[0].length;if(B=P.index,$(C,B,C,B+V))return!0;if(!V&&(c.lastIndex=B+=a.skipEmptyMatch(O,B,b),B>=O.length))return!1}};return{forEach:_}},r}();function p(r,l){var s=a.supportsLookbehind();function c(D,E){E===void 0&&(E=!0);var b=s&&l.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return b.test(D)||l.regExp?s&&l.$supportsUnicodeFlag?E?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var f=Array.from(r),m=f[0],y=f[f.length-1];return c(m)+r+c(y,!1)}function e(r,l,s){for(var c=null,f=0;f<=r.length;){l.lastIndex=f;var m=l.exec(r);if(!m)break;var y=m.index+m[0].length;if(y>r.length-s)break;(!c||y>c.index+c[0].length)&&(c=m),f=m.index+1}return c}function t(r,l){var s=5e3,c={row:l,column:0},f=r.doc.positionToIndex(c),m=f+s,y=r.doc.indexToPosition(m),D=y.row;return D+1}u.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(n,u,v){var a=this&&this.__extends||function(){var r=function(l,s){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(c[m]=f[m])},r(l,s)};return function(l,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");r(l,s);function c(){this.constructor=l}l.prototype=s===null?Object.create(s):(c.prototype=s.prototype,new c)}}(),h=n("../lib/keys"),d=n("../lib/useragent"),o=h.KEY_MODS,p=function(){function r(l,s){this.$init(l,s,!1)}return r.prototype.$init=function(l,s,c){this.platform=s||(d.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(l),this.$singleCommand=c},r.prototype.addCommand=function(l){this.commands[l.name]&&this.removeCommand(l),this.commands[l.name]=l,l.bindKey&&this._buildKeyHash(l)},r.prototype.removeCommand=function(l,s){var c=l&&(typeof l=="string"?l:l.name);l=this.commands[c],s||delete this.commands[c];var f=this.commandKeyBinding;for(var m in f){var y=f[m];if(y==l)delete f[m];else if(Array.isArray(y)){var D=y.indexOf(l);D!=-1&&(y.splice(D,1),y.length==1&&(f[m]=y[0]))}}},r.prototype.bindKey=function(l,s,c){if(typeof l=="object"&&l&&(c==null&&(c=l.position),l=l[this.platform]),!!l){if(typeof s=="function")return this.addCommand({exec:s,bindKey:l,name:s.name||l});l.split("|").forEach(function(f){var m="";if(f.indexOf(" ")!=-1){var y=f.split(/\s+/);f=y.pop(),y.forEach(function(b){var g=this.parseKeys(b),S=o[g.hashId]+g.key;m+=(m?" ":"")+S,this._addCommandToBinding(m,"chainKeys")},this),m+=" "}var D=this.parseKeys(f),E=o[D.hashId]+D.key;this._addCommandToBinding(m+E,s,c)},this)}},r.prototype._addCommandToBinding=function(l,s,c){var f=this.commandKeyBinding,m;if(!s)delete f[l];else if(!f[l]||this.$singleCommand)f[l]=s;else{Array.isArray(f[l])?(m=f[l].indexOf(s))!=-1&&f[l].splice(m,1):f[l]=[f[l]],typeof c!="number"&&(c=e(s));var y=f[l];for(m=0;m<y.length;m++){var D=y[m],E=e(D);if(E>c)break}y.splice(m,0,s)}},r.prototype.addCommands=function(l){l&&Object.keys(l).forEach(function(s){var c=l[s];if(c){if(typeof c=="string")return this.bindKey(c,s);typeof c=="function"&&(c={exec:c}),typeof c=="object"&&(c.name||(c.name=s),this.addCommand(c))}},this)},r.prototype.removeCommands=function(l){Object.keys(l).forEach(function(s){this.removeCommand(l[s])},this)},r.prototype.bindKeys=function(l){Object.keys(l).forEach(function(s){this.bindKey(s,l[s])},this)},r.prototype._buildKeyHash=function(l){this.bindKey(l.bindKey,l)},r.prototype.parseKeys=function(l){var s=l.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(E){return E}),c=s.pop(),f=h[c];if(h.FUNCTION_KEYS[f])c=h.FUNCTION_KEYS[f].toLowerCase();else if(s.length){if(s.length==1&&s[0]=="shift")return{key:c.toUpperCase(),hashId:-1}}else return{key:c,hashId:-1};for(var m=0,y=s.length;y--;){var D=h.KEY_MODS[s[y]];if(D==null)return typeof console<"u"&&console.error("invalid modifier "+s[y]+" in "+l),!1;m|=D}return{key:c,hashId:m}},r.prototype.findKeyCommand=function(l,s){var c=o[l]+s;return this.commandKeyBinding[c]},r.prototype.handleKeyboard=function(l,s,c,f){if(!(f<0)){var m=o[s]+c,y=this.commandKeyBinding[m];return l.$keyChain&&(l.$keyChain+=" "+m,y=this.commandKeyBinding[l.$keyChain]||y),y&&(y=="chainKeys"||y[y.length-1]=="chainKeys")?(l.$keyChain=l.$keyChain||m,{command:"null"}):(l.$keyChain&&((!s||s==4)&&c.length==1?l.$keyChain=l.$keyChain.slice(0,-m.length-1):(s==-1||f>0)&&(l.$keyChain="")),{command:y})}},r.prototype.getStatusText=function(l,s){return s.$keyChain||""},r}();function e(r){return typeof r=="object"&&r.bindKey&&r.bindKey.position||(r.isDefault?-100:0)}var t=function(r){a(l,r);function l(s,c){var f=r.call(this,s,c)||this;return f.$singleCommand=!0,f}return l}(p);t.call=function(r,l,s){p.prototype.$init.call(r,l,s,!0)},p.call=function(r,l,s){p.prototype.$init.call(r,l,s,!1)},u.HashHandler=t,u.MultiHashHandler=p}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(n,u,v){var a=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,s){l.__proto__=s}||function(l,s){for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(l[c]=s[c])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function l(){this.constructor=t}t.prototype=r===null?Object.create(r):(l.prototype=r.prototype,new l)}}(),h=n("../lib/oop"),d=n("../keyboard/hash_handler").MultiHashHandler,o=n("../lib/event_emitter").EventEmitter,p=function(e){a(t,e);function t(r,l){var s=e.call(this,l,r)||this;return s.byName=s.commands,s.setDefaultHandler("exec",function(c){return c.args?c.command.exec(c.editor,c.args,c.event,!1):c.command.exec(c.editor,{},c.event,!0)}),s}return t.prototype.exec=function(r,l,s){if(Array.isArray(r)){for(var c=r.length;c--;)if(this.exec(r[c],l,s))return!0;return!1}typeof r=="string"&&(r=this.commands[r]);var f={editor:l,command:r,args:s};return this.canExecute(r,l)?(f.returnValue=this._emit("exec",f),this._signal("afterExec",f),f.returnValue!==!1):(this._signal("commandUnavailable",f),!1)},t.prototype.canExecute=function(r,l){return typeof r=="string"&&(r=this.commands[r]),!(!r||l&&l.$readOnly&&!r.readOnly||this.$checkCommandState!=!1&&r.isAvailable&&!r.isAvailable(l))},t.prototype.toggleRecording=function(r){if(!this.$inReplay)return r&&r._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(l){this.macro.push([l.command,l.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},t.prototype.replay=function(r){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(r);try{this.$inReplay=!0,this.macro.forEach(function(l){typeof l=="string"?this.exec(l,r):this.exec(l[0],r,l[1])},this)}finally{this.$inReplay=!1}}},t.prototype.trimMacro=function(r){return r.map(function(l){return typeof l[0]!="string"&&(l[0]=l[0].name),l[1]||(l=l[0]),l})},t}(d);h.implement(p.prototype,o),u.CommandManager=p}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(n,u,v){var a=n("../lib/lang"),h=n("../config"),d=n("../range").Range;function o(e,t){return{win:e,mac:t}}u.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){h.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:o("Alt-E","F4"),exec:function(e){h.loadModule("ace/ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){h.loadModule("ace/ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){typeof t=="number"&&!isNaN(t)&&e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.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(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){h.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.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(e){e.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(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.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(e){e.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(e){e.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(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.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(e){e.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(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.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(e){e.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(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.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(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty(),r=t?e.selection.getLineRange():e.selection.getRange();e._emit("cut",r),r.isEmpty()||e.session.remove(r),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){h.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(e.selection.isEmpty())e.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(a.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:o(null,null),exec:function(e){e.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:o("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),r=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),l=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),s=e.session.doc.getLine(r.row).length,c=e.session.doc.getTextRange(e.selection.getRange()),f=c.replace(/\n\s*/," ").length,m=e.session.doc.getLine(r.row),y=r.row+1;y<=l.row+1;y++){var D=a.stringTrimLeft(a.stringTrimRight(e.session.doc.getLine(y)));D.length!==0&&(D=" "+D),m+=D}l.row+1<e.session.doc.getLength()-1&&(m+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new d(r.row,0,l.row+2,0),m),f>0?(e.selection.moveCursorTo(r.row,r.column),e.selection.selectTo(r.row,r.column+f)):(s=e.session.doc.getLine(r.row).length>s?s+1:s,e.selection.moveCursorTo(r.row,s))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,r=e.session.doc.getLine(t).length,l=e.selection.rangeList.ranges,s=[];l.length<1&&(l=[e.selection.getRange()]);for(var c=0;c<l.length;c++)c==l.length-1&&(l[c].end.row===t&&l[c].end.column===r||s.push(new d(l[c].end.row,l[c].end.column,t,r))),c===0?l[c].start.row===0&&l[c].start.column===0||s.push(new d(0,0,l[c].start.row,l[c].start.column)):s.push(new d(l[c-1].end.row,l[c-1].end.column,l[c].start.row,l[c].start.column));e.exitMultiSelectMode(),e.clearSelection();for(var c=0;c<s.length;c++)e.selection.addRange(s[c],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(e){e.selection.clearSelection(),e.navigateLineEnd(),e.insert(`
223
- `)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(e){e.selection.clearSelection();var t=e.getCursorPosition();e.selection.moveTo(t.row-1,Number.MAX_VALUE),e.insert(`
224
- `),t.row===0&&e.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(e){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),e.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:o("F1","F1"),exec:function(e){e.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:o(null,null),exec:function(e){e.prompt({$type:"modes"})},readOnly:!0}];for(var p=1;p<9;p++)u.commands.push({name:"foldToLevel"+p,description:"Fold To Level "+p,level:p,exec:function(e){e.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(n,u,v){var a=n("../lib/keys"),h=n("../mouse/default_gutter_handler").GutterTooltip,d=function(){function p(e){this.editor=e,this.gutterLayer=e.renderer.$gutterLayer,this.element=e.renderer.$gutter,this.lines=e.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new h(this.editor)}return p.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))},p.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))},p.prototype.$onGutterKeyDown=function(e){if(this.annotationTooltip.isOpen){e.preventDefault(),e.keyCode===a.escape&&this.annotationTooltip.hideTooltip();return}if(e.target===this.element){if(e.keyCode!=a.enter)return;e.preventDefault();var t=this.editor.getCursorPosition().row;this.editor.isRowVisible(t)||this.editor.scrollToLine(t,!0,!0),setTimeout(function(){var r=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),l=this.$findNearestFoldLaneWidget(r),s=this.$findNearestAnnotation(r);if(!(l===null&&s===null)){var c=this.$findClosestNumber(l,s,r);if(c===l)if(this.activeLane="fold",this.activeRowIndex=l,this.$isCustomWidgetVisible(l)){this.$focusCustomWidget(this.activeRowIndex);return}else{this.$focusFoldWidget(this.activeRowIndex);return}else{this.activeRowIndex=s,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}}}.bind(this),10);return}this.$handleGutterKeyboardInteraction(e),setTimeout(function(){this.editor._signal("gutterkeydown",new o(e,this))}.bind(this),10)},p.prototype.$handleGutterKeyboardInteraction=function(e){if(e.keyCode===a.tab){e.preventDefault();return}if(e.keyCode===a.escape){e.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(e.keyCode===a.up){switch(e.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(e.keyCode===a.down){switch(e.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(e.keyCode===a.left){e.preventDefault(),this.$switchLane("annotation");return}if(e.keyCode===a.right){e.preventDefault(),this.$switchLane("fold");return}if(e.keyCode===a.enter||e.keyCode===a.space){switch(e.preventDefault(),this.activeLane){case"fold":var t=this.$rowIndexToRow(this.activeRowIndex),r=this.editor.session.$gutterCustomWidgets[t];if(r)r.callbacks&&r.callbacks.onClick&&r.callbacks.onClick(e,t);else if(this.gutterLayer.session.foldWidgets[t]==="start"){this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),e),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==t&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(t),this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var l=this.lines.cells[this.activeRowIndex].element.childNodes[2],s=l.getBoundingClientRect(),c=this.annotationTooltip.getElement().style;c.left=s.right+"px",c.top=s.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},p.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.hideTooltip()},p.prototype.$isFoldWidgetVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e)),r=this.$getFoldWidget(e).style.display!=="none";return t&&r},p.prototype.$isCustomWidgetVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e)),r=!!this.$getCustomWidget(e);return t&&r},p.prototype.$isAnnotationVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e)),r=this.$getAnnotation(e).style.display!=="none";return t&&r},p.prototype.$getFoldWidget=function(e){var t=this.lines.get(e),r=t.element;return r.childNodes[1]},p.prototype.$getCustomWidget=function(e){var t=this.lines.get(e),r=t.element;return r.childNodes[3]},p.prototype.$getAnnotation=function(e){var t=this.lines.get(e),r=t.element;return r.childNodes[2]},p.prototype.$findNearestFoldLaneWidget=function(e){if(this.$isCustomWidgetVisible(e)||this.$isFoldWidgetVisible(e))return e;for(var t=0;e-t>0||e+t<this.lines.getLength()-1;){if(t++,e-t>=0&&this.$isCustomWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isCustomWidgetVisible(e+t))return e+t;if(e-t>=0&&this.$isFoldWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(e+t))return e+t}return null},p.prototype.$findNearestAnnotation=function(e){if(this.$isAnnotationVisible(e))return e;for(var t=0;e-t>0||e+t<this.lines.getLength()-1;){if(t++,e-t>=0&&this.$isAnnotationVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isAnnotationVisible(e+t))return e+t}return null},p.prototype.$focusFoldWidget=function(e){if(e!=null){var t=this.$getFoldWidget(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},p.prototype.$focusCustomWidget=function(e){if(e!=null){var t=this.$getCustomWidget(e);t&&(t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus())}},p.prototype.$focusAnnotation=function(e){if(e!=null){var t=this.$getAnnotation(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},p.prototype.$blurFoldWidget=function(e){var t=this.$getFoldWidget(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},p.prototype.$blurCustomWidget=function(e){var t=this.$getCustomWidget(e);t&&(t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur())},p.prototype.$blurAnnotation=function(e){var t=this.$getAnnotation(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},p.prototype.$moveFoldWidgetUp=function(){for(var e=this.activeRowIndex;e>0;)if(e--,this.$isFoldWidgetVisible(e)||this.$isCustomWidgetVisible(e)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=e,this.$isFoldWidgetVisible(e)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},p.prototype.$moveFoldWidgetDown=function(){for(var e=this.activeRowIndex;e<this.lines.getLength()-1;)if(e++,this.$isFoldWidgetVisible(e)||this.$isCustomWidgetVisible(e)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=e,this.$isFoldWidgetVisible(e)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},p.prototype.$moveAnnotationUp=function(){for(var e=this.activeRowIndex;e>0;)if(e--,this.$isAnnotationVisible(e)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,this.$focusAnnotation(this.activeRowIndex);return}},p.prototype.$moveAnnotationDown=function(){for(var e=this.activeRowIndex;e<this.lines.getLength()-1;)if(e++,this.$isAnnotationVisible(e)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,this.$focusAnnotation(this.activeRowIndex);return}},p.prototype.$findClosestNumber=function(e,t,r){return e===null?t:t===null||Math.abs(r-e)<=Math.abs(r-t)?e:t},p.prototype.$switchLane=function(e){switch(e){case"annotation":if(this.activeLane==="annotation")break;var t=this.$findNearestAnnotation(this.activeRowIndex);if(t==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=t,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var r=this.$findNearestFoldLaneWidget(this.activeRowIndex);if(r===null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$isCustomWidgetVisible(r)?this.$focusCustomWidget(this.activeRowIndex):this.$focusFoldWidget(this.activeRowIndex);break}},p.prototype.$rowIndexToRow=function(e){var t=this.lines.get(e);return t?t.row:null},p.prototype.$rowToRowIndex=function(e){for(var t=0;t<this.lines.getLength();t++){var r=this.lines.get(t);if(r.row==e)return t}return null},p}();u.GutterKeyboardHandler=d;var o=function(){function p(e,t){this.gutterKeyboardHandler=t,this.domEvent=e}return p.prototype.getKey=function(){return a.keyCodeToString(this.domEvent.keyCode)},p.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},p.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},p.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},p}();u.GutterKeyboardEvent=o}),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(n,u,v){var a=this&&this.__values||function(C){var w=typeof Symbol=="function"&&Symbol.iterator,$=w&&C[w],I=0;if($)return $.call(C);if(C&&typeof C.length=="number")return{next:function(){return C&&I>=C.length&&(C=void 0),{value:C&&C[I++],done:!C}}};throw new TypeError(w?"Object is not iterable.":"Symbol.iterator is not defined.")},h=n("./lib/oop"),d=n("./lib/dom"),o=n("./lib/lang"),p=n("./lib/useragent"),e=n("./keyboard/textinput").TextInput,t=n("./mouse/mouse_handler").MouseHandler,r=n("./mouse/fold_handler").FoldHandler,l=n("./keyboard/keybinding").KeyBinding,s=n("./edit_session").EditSession,c=n("./search").Search,f=n("./range").Range,m=n("./lib/event_emitter").EventEmitter,y=n("./commands/command_manager").CommandManager,D=n("./commands/default_commands").commands,E=n("./config"),b=n("./token_iterator").TokenIterator,g=n("./keyboard/gutter_handler").GutterKeyboardHandler,S=n("./config").nls,T=n("./clipboard"),k=n("./lib/keys"),_=n("./lib/event"),R=n("./tooltip").HoverTooltip,x=function(){function C(w,$,I){this.session,this.$toDestroy=[];var F=w.getContainerElement();this.container=F,this.renderer=w,this.id="editor"+ ++C.$uid,this.commands=new y(p.isMac?"mac":"win",D),typeof document=="object"&&(this.textInput=new e(w.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new t(this),new r(this)),this.keyBinding=new l(this),this.$search=new c().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(O,B){B._$emitInputEvent.schedule(31)}),this.setSession($||I&&I.session||new s("")),E.resetOptions(this),I&&this.setOptions(I),E._signal("editor",this)}return C.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},C.prototype.startOperation=function(w){this.session.startOperation(w)},C.prototype.endOperation=function(w){this.session.endOperation(w)},C.prototype.onStartOperation=function(w){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,w||(this.previousCommand=null)},C.prototype.onEndOperation=function(w){if(this.curOp&&this.session){if(w&&w.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var $=this.curOp.command,I=$&&$.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(),O=this.renderer.layerConfig;(F.start.row>=O.lastRow||F.end.row<=O.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}},C.prototype.$historyTracker=function(w){if(this.$mergeUndoDeltas){var $=this.prevOp,I=this.$mergeableCommands,F=$.command&&w.command.name==$.command.name;if(w.command.name=="insertstring"){var O=w.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),F=F&&this.mergeNextCommand&&(!/\s/.test(O)||/\s/.test($.args)),this.mergeNextCommand=!0}else F=F&&I.indexOf(w.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(F=!1),F?this.session.mergeUndoDeltas=!0:I.indexOf(w.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},C.prototype.setKeyboardHandler=function(w,$){if(w&&typeof w=="string"&&w!="ace"){this.$keybindingId=w;var I=this;E.loadModule(["keybinding",w],function(F){I.$keybindingId==w&&I.keyBinding.setKeyboardHandler(F&&F.handler),$&&$()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(w),$&&$()},C.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},C.prototype.setSession=function(w){if(this.session!=w){this.curOp&&this.endOperation(),this.curOp={};var $=this.session;if($){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=w,w?(this.$onDocumentChange=this.onDocumentChange.bind(this),w.on("change",this.$onDocumentChange),this.renderer.setSession(w),this.$onChangeMode=this.onChangeMode.bind(this),w.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),w.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),w.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),w.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),w.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),w.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=w.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(w)),this._signal("changeSession",{session:w,oldSession:$}),this.curOp=null,$&&$._signal("changeEditor",{oldEditor:this}),$&&($.$editor=null),w&&w._signal("changeEditor",{editor:this}),w&&(w.$editor=this),w&&!w.destroyed&&w.bgTokenizer.scheduleStart()}},C.prototype.getSession=function(){return this.session},C.prototype.setValue=function(w,$){return this.session.doc.setValue(w),$?$==1?this.navigateFileEnd():$==-1&&this.navigateFileStart():this.selectAll(),w},C.prototype.getValue=function(){return this.session.getValue()},C.prototype.getSelection=function(){return this.selection},C.prototype.resize=function(w){this.renderer.onResize(w)},C.prototype.setTheme=function(w,$){this.renderer.setTheme(w,$)},C.prototype.getTheme=function(){return this.renderer.getTheme()},C.prototype.setStyle=function(w){this.renderer.setStyle(w)},C.prototype.unsetStyle=function(w){this.renderer.unsetStyle(w)},C.prototype.getFontSize=function(){return this.getOption("fontSize")||d.computedStyle(this.container).fontSize},C.prototype.setFontSize=function(w){this.setOption("fontSize",w)},C.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var w=this;this.$highlightPending=!0,setTimeout(function(){w.$highlightPending=!1;var $=w.session;if(!(!$||$.destroyed)){$.$bracketHighlight&&($.$bracketHighlight.markerIds.forEach(function(U){$.removeMarker(U)}),$.$bracketHighlight=null);var I=w.getCursorPosition(),F=w.getKeyboardHandler(),O=F&&F.$getDirectionForHighlight&&F.$getDirectionForHighlight(w),B=$.getMatchingBracketRanges(I,O);if(!B){var P=new b($,I.row,I.column),V=P.getCurrentToken();if(V&&/\b(?:tag-open|tag-name)/.test(V.type)){var W=$.getMatchingTags(I);W&&(B=[W.openTagName.isEmpty()?W.openTag:W.openTagName,W.closeTagName.isEmpty()?W.closeTag:W.closeTagName])}}if(!B&&$.$mode.getMatching&&(B=$.$mode.getMatching(w.session)),!B){w.getHighlightIndentGuides()&&w.renderer.$textLayer.$highlightIndentGuide();return}var H="ace_bracket";Array.isArray(B)?B.length==1&&(H="ace_error_bracket"):B=[B],B.length==2&&(f.comparePoints(B[0].end,B[1].start)==0?B=[f.fromPoints(B[0].start,B[1].end)]:f.comparePoints(B[0].start,B[1].end)==0&&(B=[f.fromPoints(B[1].start,B[0].end)])),$.$bracketHighlight={ranges:B,markerIds:B.map(function(U){return $.addMarker(U,H,"text")})},w.getHighlightIndentGuides()&&w.renderer.$textLayer.$highlightIndentGuide()}},50)}},C.prototype.focus=function(){this.textInput.focus()},C.prototype.isFocused=function(){return this.textInput.isFocused()},C.prototype.blur=function(){this.textInput.blur()},C.prototype.onFocus=function(w){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",w))},C.prototype.onBlur=function(w){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",w))},C.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},C.prototype.onDocumentChange=function(w){var $=this.session.$useWrapMode,I=w.start.row==w.end.row?w.end.row:1/0;this.renderer.updateLines(w.start.row,I,$),this._signal("change",w),this.$cursorChange()},C.prototype.onTokenizerUpdate=function(w){var $=w.data;this.renderer.updateLines($.first,$.last)},C.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},C.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},C.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},C.prototype.$updateHighlightActiveLine=function(){var w=this.getSession(),$;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&($=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&($=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&($=!1)),w.$highlightLineMarker&&!$)w.removeMarker(w.$highlightLineMarker.id),w.$highlightLineMarker=null;else if(!w.$highlightLineMarker&&$){var I=new f($.row,$.column,$.row,1/0);I.id=w.addMarker(I,"ace_active-line","screenLine"),w.$highlightLineMarker=I}else $&&(w.$highlightLineMarker.start.row=$.row,w.$highlightLineMarker.end.row=$.row,w.$highlightLineMarker.start.column=$.column,w._signal("changeBackMarker"))},C.prototype.onSelectionChange=function(w){var $=this.session;if($.$selectionMarker&&$.removeMarker($.$selectionMarker),$.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var I=this.selection.getRange(),F=this.getSelectionStyle();$.$selectionMarker=$.addMarker(I,"ace_selection",F)}var O=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(O),this._signal("changeSelection")},C.prototype.$getSelectionHighLightRegexp=function(){var w=this.session,$=this.getSelectionRange();if(!($.isEmpty()||$.isMultiLine())){var I=$.start.column,F=$.end.column,O=w.getLine($.start.row),B=O.substring(I,F);if(!(B.length>5e3||!/[\w\d]/.test(B))){var P=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:B}),V=O.substring(I-1,F+1);if(P.test(V))return P}}},C.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},C.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},C.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},C.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},C.prototype.onChangeMode=function(w){this.renderer.updateText(),this._emit("changeMode",w)},C.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},C.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},C.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},C.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},C.prototype.getCopyText=function(){var w=this.getSelectedText(),$=this.session.doc.getNewLineCharacter(),I=!1;if(!w&&this.$copyWithEmptySelection){I=!0;for(var F=this.selection.getAllRanges(),O=0;O<F.length;O++){var B=F[O];O&&F[O-1].start.row==B.start.row||(w+=this.session.getLine(B.start.row)+$)}}var P={text:w};return this._signal("copy",P),T.lineMode=I?P.text:!1,P.text},C.prototype.onCopy=function(){this.commands.exec("copy",this)},C.prototype.onCut=function(){this.commands.exec("cut",this)},C.prototype.onPaste=function(w,$){var I={text:w,event:$};this.commands.exec("paste",this,I)},C.prototype.$handlePaste=function(w){typeof w=="string"&&(w={text:w}),this._signal("paste",w);var $=w.text,I=$===T.lineMode,F=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)I?F.insert({row:this.selection.lead.row,column:0},$):this.insert($);else if(I)this.selection.rangeList.ranges.forEach(function(H){F.insert({row:H.start.row,column:0},$)});else{var O=$.split(/\r\n|\r|\n/),B=this.selection.rangeList.ranges,P=O.length==2&&(!O[0]||!O[1]);if(O.length!=B.length||P)return this.commands.exec("insertstring",this,$);for(var V=B.length;V--;){var W=B[V];W.isEmpty()||F.remove(W),F.insert(W.start,O[V])}}},C.prototype.execCommand=function(w,$){return this.commands.exec(w,this,$)},C.prototype.insert=function(w,$){var I=this.session,F=I.getMode(),O=this.getCursorPosition();if(this.getBehavioursEnabled()&&!$){var B=F.transformAction(I.getState(O.row),"insertion",this,I,w);B&&(w!==B.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),w=B.text)}if(w==" "&&(w=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&w.indexOf(`
225
- `)==-1){var P=f.fromPoints(O,O);P.end.column+=w.length,this.session.remove(P)}}else{var P=this.getSelectionRange();O=this.session.remove(P),this.clearSelection()}if(w==`
226
- `||w==`\r
227
- `){var U=I.getLine(O.row);if(O.column>U.search(/\S|$/)){var V=U.substr(O.column).search(/\S|$/);I.doc.removeInLine(O.row,O.column,O.column+V)}}this.clearSelection();var W=O.column,H=I.getState(O.row),U=I.getLine(O.row),G=F.checkOutdent(H,U,w);if(I.insert(O,w),B&&B.selection&&(B.selection.length==2?this.selection.setSelectionRange(new f(O.row,W+B.selection[0],O.row,W+B.selection[1])):this.selection.setSelectionRange(new f(O.row+B.selection[0],B.selection[1],O.row+B.selection[2],B.selection[3]))),this.$enableAutoIndent){if(I.getDocument().isNewLine(w)){var Y=F.getNextLineIndent(H,U.slice(0,O.column),I.getTabString());I.insert({row:O.row+1,column:0},Y)}G&&F.autoOutdent(H,I,O.row)}},C.prototype.autoIndent=function(){for(var w=this.session,$=w.getMode(),I=this.selection.isEmpty()?[new f(0,0,w.doc.getLength()-1,0)]:this.selection.getAllRanges(),F="",O="",B="",P=w.getTabString(),V=0;V<I.length;V++)for(var W=I[V].start.row,H=I[V].end.row,U=W;U<=H;U++){U>0&&(F=w.getState(U-1),O=w.getLine(U-1),B=$.getNextLineIndent(F,O,P));var G=w.getLine(U),Y=$.$getIndent(G);if(B!==Y){if(Y.length>0){var Q=new f(U,0,U,Y.length);w.remove(Q)}B.length>0&&w.insert({row:U,column:0},B)}$.autoOutdent(F,w,U)}},C.prototype.onTextInput=function(w,$){if(!$)return this.keyBinding.onTextInput(w);this.startOperation({command:{name:"insertstring"}});var I=this.applyComposition.bind(this,w,$);this.selection.rangeCount?this.forEachSelection(I):I(),this.endOperation()},C.prototype.applyComposition=function(w,$){if($.extendLeft||$.extendRight){var I=this.selection.getRange();I.start.column-=$.extendLeft,I.end.column+=$.extendRight,I.start.column<0&&(I.start.row--,I.start.column+=this.session.getLine(I.start.row).length+1),this.selection.setRange(I),!w&&!I.isEmpty()&&this.remove()}if((w||!this.selection.isEmpty())&&this.insert(w,!0),$.restoreStart||$.restoreEnd){var I=this.selection.getRange();I.start.column-=$.restoreStart,I.end.column-=$.restoreEnd,this.selection.setRange(I)}},C.prototype.onCommandKey=function(w,$,I){return this.keyBinding.onCommandKey(w,$,I)},C.prototype.setOverwrite=function(w){this.session.setOverwrite(w)},C.prototype.getOverwrite=function(){return this.session.getOverwrite()},C.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},C.prototype.setScrollSpeed=function(w){this.setOption("scrollSpeed",w)},C.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},C.prototype.setDragDelay=function(w){this.setOption("dragDelay",w)},C.prototype.getDragDelay=function(){return this.getOption("dragDelay")},C.prototype.setSelectionStyle=function(w){this.setOption("selectionStyle",w)},C.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},C.prototype.setHighlightActiveLine=function(w){this.setOption("highlightActiveLine",w)},C.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},C.prototype.setHighlightGutterLine=function(w){this.setOption("highlightGutterLine",w)},C.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},C.prototype.setHighlightSelectedWord=function(w){this.setOption("highlightSelectedWord",w)},C.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},C.prototype.setAnimatedScroll=function(w){this.renderer.setAnimatedScroll(w)},C.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},C.prototype.setShowInvisibles=function(w){this.renderer.setShowInvisibles(w)},C.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},C.prototype.setDisplayIndentGuides=function(w){this.renderer.setDisplayIndentGuides(w)},C.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},C.prototype.setHighlightIndentGuides=function(w){this.renderer.setHighlightIndentGuides(w)},C.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},C.prototype.setShowPrintMargin=function(w){this.renderer.setShowPrintMargin(w)},C.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},C.prototype.setPrintMarginColumn=function(w){this.renderer.setPrintMarginColumn(w)},C.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},C.prototype.setReadOnly=function(w){this.setOption("readOnly",w)},C.prototype.getReadOnly=function(){return this.getOption("readOnly")},C.prototype.setBehavioursEnabled=function(w){this.setOption("behavioursEnabled",w)},C.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},C.prototype.setWrapBehavioursEnabled=function(w){this.setOption("wrapBehavioursEnabled",w)},C.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},C.prototype.setShowFoldWidgets=function(w){this.setOption("showFoldWidgets",w)},C.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},C.prototype.setFadeFoldWidgets=function(w){this.setOption("fadeFoldWidgets",w)},C.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},C.prototype.remove=function(w){this.selection.isEmpty()&&(w=="left"?this.selection.selectLeft():this.selection.selectRight());var $=this.getSelectionRange();if(this.getBehavioursEnabled()){var I=this.session,F=I.getState($.start.row),O=I.getMode().transformAction(F,"deletion",this,I,$);if($.end.column===0){var B=I.getTextRange($);if(B[B.length-1]==`
228
- `){var P=I.getLine($.end.row);/^\s+$/.test(P)&&($.end.column=P.length)}}O&&($=O)}this.session.remove($),this.clearSelection()},C.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},C.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},C.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},C.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var w=this.getSelectionRange();w.start.column==w.end.column&&w.start.row==w.end.row&&(w.end.column=0,w.end.row++),this.session.remove(w),this.clearSelection()},C.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var w=this.getCursorPosition();this.insert(`
229
- `),this.moveCursorToPosition(w)},C.prototype.setGhostText=function(w,$){this.renderer.setGhostText(w,$)},C.prototype.removeGhostText=function(){this.renderer.removeGhostText()},C.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var w=this.getCursorPosition(),$=w.column;if($!==0){var I=this.session.getLine(w.row),F,O;$<I.length?(F=I.charAt($)+I.charAt($-1),O=new f(w.row,$-1,w.row,$+1)):(F=I.charAt($-1)+I.charAt($-2),O=new f(w.row,$-2,w.row,$)),this.session.replace(O,F),this.session.selection.moveToPosition(O.end)}}},C.prototype.toLowerCase=function(){var w=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var $=this.getSelectionRange(),I=this.session.getTextRange($);this.session.replace($,I.toLowerCase()),this.selection.setSelectionRange(w)},C.prototype.toUpperCase=function(){var w=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var $=this.getSelectionRange(),I=this.session.getTextRange($);this.session.replace($,I.toUpperCase()),this.selection.setSelectionRange(w)},C.prototype.indent=function(){var w=this.session,$=this.getSelectionRange();if($.start.row<$.end.row){var I=this.$getSelectedRows();w.indentRows(I.first,I.last," ");return}else if($.start.column<$.end.column){var F=w.getTextRange($);if(!/^\s+$/.test(F)){var I=this.$getSelectedRows();w.indentRows(I.first,I.last," ");return}}var O=w.getLine($.start.row),B=$.start,P=w.getTabSize(),V=w.documentToScreenColumn(B.row,B.column);if(this.session.getUseSoftTabs())var W=P-V%P,H=o.stringRepeat(" ",W);else{for(var W=V%P;O[$.start.column-1]==" "&&W;)$.start.column--,W--;this.selection.setSelectionRange($),H=" "}return this.insert(H)},C.prototype.blockIndent=function(){var w=this.$getSelectedRows();this.session.indentRows(w.first,w.last," ")},C.prototype.blockOutdent=function(){var w=this.session.getSelection();this.session.outdentRows(w.getRange())},C.prototype.sortLines=function(){for(var w=this.$getSelectedRows(),$=this.session,I=[],F=w.first;F<=w.last;F++)I.push($.getLine(F));I.sort(function(P,V){return P.toLowerCase()<V.toLowerCase()?-1:P.toLowerCase()>V.toLowerCase()?1:0});for(var O=new f(0,0,0,0),F=w.first;F<=w.last;F++){var B=$.getLine(F);O.start.row=F,O.end.row=F,O.end.column=B.length,$.replace(O,I[F-w.first])}},C.prototype.toggleCommentLines=function(){var w=this.session.getState(this.getCursorPosition().row),$=this.$getSelectedRows();this.session.getMode().toggleCommentLines(w,this.session,$.first,$.last)},C.prototype.toggleBlockComment=function(){var w=this.getCursorPosition(),$=this.session.getState(w.row),I=this.getSelectionRange();this.session.getMode().toggleBlockComment($,this.session,I,w)},C.prototype.getNumberAt=function(w,$){var I=/[\-]?[0-9]+(?:\.[0-9]+)?/g;I.lastIndex=0;for(var F=this.session.getLine(w);I.lastIndex<$;){var O=I.exec(F);if(O.index<=$&&O.index+O[0].length>=$){var B={value:O[0],start:O.index,end:O.index+O[0].length};return B}}return null},C.prototype.modifyNumber=function(w){var $=this.selection.getCursor().row,I=this.selection.getCursor().column,F=new f($,I-1,$,I),O=this.session.getTextRange(F);if(!isNaN(parseFloat(O))&&isFinite(O)){var B=this.getNumberAt($,I);if(B){var P=B.value.indexOf(".")>=0?B.start+B.value.indexOf(".")+1:B.end,V=B.start+B.value.length-P,W=parseFloat(B.value);W*=Math.pow(10,V),P!==B.end&&I<P?w*=Math.pow(10,B.end-I-1):w*=Math.pow(10,B.end-I),W+=w,W/=Math.pow(10,V);var H=W.toFixed(V),U=new f($,B.start,$,B.end);this.session.replace(U,H),this.moveCursorTo($,Math.max(B.start+1,I+H.length-B.value.length))}}else this.toggleWord()},C.prototype.toggleWord=function(){var w=this.selection.getCursor().row,$=this.selection.getCursor().column;this.selection.selectWord();var I=this.getSelectedText(),F=this.selection.getWordRange().start.column,O=I.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),B=$-F-1;B<0&&(B=0);var P=0,V=0,W=this;I.match(/[A-Za-z0-9_]+/)&&O.forEach(function(ge,be){V=P+ge.length,B>=P&&B<=V&&(I=ge,W.selection.clearSelection(),W.moveCursorTo(w,P+F),W.selection.selectTo(w,V+F)),P=V});for(var H=this.$toggleWordPairs,U,G=0;G<H.length;G++)for(var Y=H[G],Q=0;Q<=1;Q++){var ee=+!Q,ne=I.match(new RegExp("^\\s?_?("+o.escapeRegExp(Y[Q])+")\\s?$","i"));if(ne){var se=I.match(new RegExp("([_]|^|\\s)("+o.escapeRegExp(ne[1])+")($|\\s)","g"));se&&(U=I.replace(new RegExp(o.escapeRegExp(Y[Q]),"i"),function(ge){var be=Y[ee];return ge.toUpperCase()==ge?be=be.toUpperCase():ge.charAt(0).toUpperCase()==ge.charAt(0)&&(be=be.substr(0,0)+Y[ee].charAt(0).toUpperCase()+be.substr(1)),be}),this.insert(U),U="")}}},C.prototype.findLinkAt=function(w,$){var I,F,O=this.session.getLine(w),B=O.split(/((?:https?|ftp):\/\/[\S]+)/),P=$;P<0&&(P=0);var V=0,W=0,H;try{for(var U=a(B),G=U.next();!G.done;G=U.next()){var Y=G.value;if(W=V+Y.length,P>=V&&P<=W&&Y.match(/((?:https?|ftp):\/\/[\S]+)/)){H=Y.replace(/[\s:.,'";}\]]+$/,"");break}V=W}}catch(Q){I={error:Q}}finally{try{G&&!G.done&&(F=U.return)&&F.call(U)}finally{if(I)throw I.error}}return H},C.prototype.openLink=function(){var w=this.selection.getCursor(),$=this.findLinkAt(w.row,w.column);return $&&window.open($,"_blank"),$!=null},C.prototype.removeLines=function(){var w=this.$getSelectedRows();this.session.removeFullLines(w.first,w.last),this.clearSelection()},C.prototype.duplicateSelection=function(){var w=this.selection,$=this.session,I=w.getRange(),F=w.isBackwards();if(I.isEmpty()){var O=I.start.row;$.duplicateLines(O,O)}else{var B=F?I.start:I.end,P=$.insert(B,$.getTextRange(I));I.start=B,I.end=P,w.setSelectionRange(I,F)}},C.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},C.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},C.prototype.moveText=function(w,$,I){return this.session.moveText(w,$,I)},C.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},C.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},C.prototype.$moveLines=function(w,$){var I,F,O=this.selection;if(!O.inMultiSelectMode||this.inVirtualSelectionMode){var B=O.toOrientedRange();I=this.$getSelectedRows(B),F=this.session.$moveLines(I.first,I.last,$?0:w),$&&w==-1&&(F=0),B.moveBy(F,0),O.fromOrientedRange(B)}else{var P=O.rangeList.ranges;O.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var V=0,W=0,H=P.length,U=0;U<H;U++){var G=U;P[U].moveBy(V,0),I=this.$getSelectedRows(P[U]);for(var Y=I.first,Q=I.last;++U<H;){W&&P[U].moveBy(W,0);var ee=this.$getSelectedRows(P[U]);if($&&ee.first!=Q)break;if(!$&&ee.first>Q+1)break;Q=ee.last}for(U--,V=this.session.$moveLines(Y,Q,$?0:w),$&&w==-1&&(G=U+1);G<=U;)P[G].moveBy(V,0),G++;$||(V=0),W+=V}O.fromOrientedRange(O.ranges[0]),O.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},C.prototype.$getSelectedRows=function(w){return w=(w||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(w.start.row),last:this.session.getRowFoldEnd(w.end.row)}},C.prototype.onCompositionStart=function(w){this.renderer.showComposition(w)},C.prototype.onCompositionUpdate=function(w){this.renderer.setCompositionText(w)},C.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},C.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},C.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},C.prototype.isRowVisible=function(w){return w>=this.getFirstVisibleRow()&&w<=this.getLastVisibleRow()},C.prototype.isRowFullyVisible=function(w){return w>=this.renderer.getFirstFullyVisibleRow()&&w<=this.renderer.getLastFullyVisibleRow()},C.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},C.prototype.$moveByPage=function(w,$){var I=this.renderer,F=this.renderer.layerConfig,O=w*Math.floor(F.height/F.lineHeight);$===!0?this.selection.$moveSelection(function(){this.moveCursorBy(O,0)}):$===!1&&(this.selection.moveCursorBy(O,0),this.selection.clearSelection());var B=I.scrollTop;I.scrollBy(0,O*F.lineHeight),$!=null&&I.scrollCursorIntoView(null,.5),I.animateScrolling(B)},C.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},C.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},C.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},C.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},C.prototype.scrollPageDown=function(){this.$moveByPage(1)},C.prototype.scrollPageUp=function(){this.$moveByPage(-1)},C.prototype.scrollToRow=function(w){this.renderer.scrollToRow(w)},C.prototype.scrollToLine=function(w,$,I,F){this.renderer.scrollToLine(w,$,I,F)},C.prototype.centerSelection=function(){var w=this.getSelectionRange(),$={row:Math.floor(w.start.row+(w.end.row-w.start.row)/2),column:Math.floor(w.start.column+(w.end.column-w.start.column)/2)};this.renderer.alignCursor($,.5)},C.prototype.getCursorPosition=function(){return this.selection.getCursor()},C.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},C.prototype.getSelectionRange=function(){return this.selection.getRange()},C.prototype.selectAll=function(){this.selection.selectAll()},C.prototype.clearSelection=function(){this.selection.clearSelection()},C.prototype.moveCursorTo=function(w,$){this.selection.moveCursorTo(w,$)},C.prototype.moveCursorToPosition=function(w){this.selection.moveCursorToPosition(w)},C.prototype.jumpToMatching=function(w,$){var I=this.getCursorPosition(),F=new b(this.session,I.row,I.column),O=F.getCurrentToken(),B=0;O&&O.type.indexOf("tag-name")!==-1&&(O=F.stepBackward());var P=O||F.stepForward();if(P){var V,W=!1,H={},U=I.column-P.start,G,Y={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(P.value.match(/[{}()\[\]]/g)){for(;U<P.value.length&&!W;U++)if(Y[P.value[U]])switch(G=Y[P.value[U]]+"."+P.type.replace("rparen","lparen"),isNaN(H[G])&&(H[G]=0),P.value[U]){case"(":case"[":case"{":H[G]++;break;case")":case"]":case"}":H[G]--,H[G]===-1&&(V="bracket",W=!0);break}}else P.type.indexOf("tag-name")!==-1&&(isNaN(H[P.value])&&(H[P.value]=0),O.value==="<"&&B>1?H[P.value]++:O.value==="</"&&H[P.value]--,H[P.value]===-1&&(V="tag",W=!0));W||(O=P,B++,P=F.stepForward(),U=0)}while(P&&!W);if(V){var Q,ee;if(V==="bracket")Q=this.session.getBracketRange(I),Q||(Q=new f(F.getCurrentTokenRow(),F.getCurrentTokenColumn()+U-1,F.getCurrentTokenRow(),F.getCurrentTokenColumn()+U-1),ee=Q.start,($||ee.row===I.row&&Math.abs(ee.column-I.column)<2)&&(Q=this.session.getBracketRange(ee)));else if(V==="tag"){if(!P||P.type.indexOf("tag-name")===-1)return;if(Q=new f(F.getCurrentTokenRow(),F.getCurrentTokenColumn()-2,F.getCurrentTokenRow(),F.getCurrentTokenColumn()-2),Q.compare(I.row,I.column)===0){var ne=this.session.getMatchingTags(I);ne&&(ne.openTag.contains(I.row,I.column)?(Q=ne.closeTag,ee=Q.start):(Q=ne.openTag,ne.closeTag.start.row===I.row&&ne.closeTag.start.column===I.column?ee=Q.end:ee=Q.start))}ee=ee||Q.start}ee=Q&&Q.cursor||ee,ee&&(w?Q&&$?this.selection.setRange(Q):Q&&Q.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(ee.row,ee.column):this.selection.moveTo(ee.row,ee.column))}}},C.prototype.gotoLine=function(w,$,I){this.selection.clearSelection(),this.session.unfold({row:w-1,column:$||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(w-1,$||0),this.isRowFullyVisible(w-1)||this.scrollToLine(w-1,!0,I)},C.prototype.navigateTo=function(w,$){this.selection.moveTo(w,$)},C.prototype.navigateUp=function(w){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var $=this.selection.anchor.getPosition();return this.moveCursorToPosition($)}this.selection.clearSelection(),this.selection.moveCursorBy(-w||-1,0)},C.prototype.navigateDown=function(w){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var $=this.selection.anchor.getPosition();return this.moveCursorToPosition($)}this.selection.clearSelection(),this.selection.moveCursorBy(w||1,0)},C.prototype.navigateLeft=function(w){if(this.selection.isEmpty())for(w=w||1;w--;)this.selection.moveCursorLeft();else{var $=this.getSelectionRange().start;this.moveCursorToPosition($)}this.clearSelection()},C.prototype.navigateRight=function(w){if(this.selection.isEmpty())for(w=w||1;w--;)this.selection.moveCursorRight();else{var $=this.getSelectionRange().end;this.moveCursorToPosition($)}this.clearSelection()},C.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},C.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},C.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},C.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},C.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},C.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},C.prototype.replace=function(w,$){$&&this.$search.set($);var I=this.$search.find(this.session),F=0;return I&&(this.$tryReplace(I,w)&&(F=1),this.selection.setSelectionRange(I),this.renderer.scrollSelectionIntoView(I.start,I.end)),F},C.prototype.replaceAll=function(w,$){$&&this.$search.set($);var I=this.$search.findAll(this.session),F=0;if(!I.length)return F;var O=this.getSelectionRange();this.selection.moveTo(0,0);for(var B=I.length-1;B>=0;--B)this.$tryReplace(I[B],w)&&F++;return this.selection.setSelectionRange(O),F},C.prototype.$tryReplace=function(w,$){var I=this.session.getTextRange(w);return $=this.$search.replace(I,$),$!==null?(w.end=this.session.replace(w,$),w):null},C.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},C.prototype.find=function(w,$,I){$||($={}),typeof w=="string"||w instanceof RegExp?$.needle=w:typeof w=="object"&&h.mixin($,w);var F=this.selection.getRange();$.needle==null&&(w=this.session.getTextRange(F)||this.$search.$options.needle,w||(F=this.session.getWordRange(F.start.row,F.start.column),w=this.session.getTextRange(F)),this.$search.set({needle:w})),this.$search.set($),$.start||this.$search.set({start:F});var O=this.$search.find(this.session);if($.preventScroll)return O;if(O)return this.revealRange(O,I),O;$.backwards?F.start=F.end:F.end=F.start,this.selection.setRange(F)},C.prototype.findNext=function(w,$){this.find({skipCurrent:!0,backwards:!1},w,$)},C.prototype.findPrevious=function(w,$){this.find(w,{skipCurrent:!0,backwards:!0},$)},C.prototype.revealRange=function(w,$){this.session.unfold(w),this.selection.setSelectionRange(w);var I=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(w.start,w.end,.5),$!==!1&&this.renderer.animateScrolling(I)},C.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},C.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},C.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(w){w.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},C.prototype.setAutoScrollEditorIntoView=function(w){if(w){var $,I=this,F=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var O=this.$scrollAnchor;O.style.cssText="position:absolute",this.container.insertBefore(O,this.container.firstChild);var B=this.on("changeSelection",function(){F=!0}),P=this.renderer.on("beforeRender",function(){F&&($=I.renderer.container.getBoundingClientRect())}),V=this.renderer.on("afterRender",function(){if(F&&$&&(I.isFocused()||I.searchBox&&I.searchBox.isFocused())){var W=I.renderer,H=W.$cursorLayer.$pixelPos,U=W.layerConfig,G=H.top-U.offset;H.top>=0&&G+$.top<0?F=!0:H.top<U.height&&H.top+$.top+U.lineHeight>window.innerHeight?F=!1:F=null,F!=null&&(O.style.top=G+"px",O.style.left=H.left+"px",O.style.height=U.lineHeight+"px",O.scrollIntoView(F)),F=$=null}});this.setAutoScrollEditorIntoView=function(W){W||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",B),this.renderer.off("afterRender",V),this.renderer.off("beforeRender",P))}}},C.prototype.$resetCursorStyle=function(){var w=this.$cursorStyle||"ace",$=this.renderer.$cursorLayer;$&&($.setSmoothBlinking(/smooth/.test(w)),$.isBlinking=!this.$readOnly&&w!="wide",d.setCssClass($.element,"ace_slim-cursors",/slim/.test(w)))},C.prototype.prompt=function(w,$,I){var F=this;E.loadModule("ace/ext/prompt",function(O){O.prompt(F,w,$,I)})},C}();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"],["&&","||"],["==","!="]],h.implement(x.prototype,m),E.defineOptions(x.prototype,"editor",{selectionStyle:{set:function(C){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:C})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(C){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(C){var w=this;this.textInput.setReadOnly(C),this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(I){var F=!1;if(I&&I.type=="keydown"){if(F=I&&I.key&&I.key.length==1&&!I.ctrlKey&&!I.metaKey,!F)return}else I&&I.type!=="exec"&&(F=!0);if(F){w.hoverTooltip||(w.hoverTooltip=new R);var O=d.createElement("div");O.textContent=S("editor.tooltip.disable-editing","Editing is disabled"),w.hoverTooltip.isOpen||w.hoverTooltip.showForRange(w,w.getSelectionRange(),O)}else w.hoverTooltip&&w.hoverTooltip.isOpen&&w.hoverTooltip.hide()});var $=this.textInput.getElement();C?(_.addListener($,"keydown",this.$readOnlyCallback,this),this.commands.on("exec",this.$readOnlyCallback),this.commands.on("commandUnavailable",this.$readOnlyCallback)):(_.removeListener($,"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(C){this.textInput.setCopyWithEmptySelection(C)},initialValue:!1},cursorStyle:{set:function(C){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(C){this.setAutoScrollEditorIntoView(C)}},keyboardHandler:{set:function(C){this.setKeyboardHandler(C)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(C){this.session.setValue(C)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(C){this.setSession(C)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(C){this.renderer.$gutterLayer.setShowLineNumbers(C),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),C&&this.$relativeLineNumbers?A.attach(this):A.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(C){this.$showLineNumbers&&C?A.attach(this):A.detach(this)}},placeholder:{set:function(C){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var w=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(w&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),d.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!w&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),d.addCssClass(this.container,"ace_hasPlaceholder");var $=d.createElement("div");$.className="ace_placeholder",$.textContent=this.$placeholder||"",this.renderer.placeholderNode=$,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!w&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(C){var w={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},$=function(F){if(F.target==this.renderer.scroller&&F.keyCode===k.enter){F.preventDefault();var O=this.getCursorPosition().row;this.isRowVisible(O)||this.scrollToLine(O,!0,!0),this.focus()}},I;C?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(p.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",S("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",S("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",$.bind(this)),this.commands.addCommand(w),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",S("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",S("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 g(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",$.bind(this)),this.commands.removeCommand(w),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(C){this.$textInputAriaLabel=C},initialValue:""},enableMobileMenu:{set:function(C){this.$enableMobileMenu=C},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",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var A={getText:function(C,w){return(Math.abs(C.selection.lead.row-w)||w+1+(w<9?"·":""))+""},getWidth:function(C,w,$){return Math.max(w.toString().length,($.lastRow+1).toString().length,2)*$.characterWidth},update:function(C,w){w.renderer.$loop.schedule(w.renderer.CHANGE_GUTTER)},attach:function(C){C.renderer.$gutterLayer.$renderer=this,C.on("changeSelection",this.update),this.update(null,C)},detach:function(C){C.renderer.$gutterLayer.$renderer==this&&(C.renderer.$gutterLayer.$renderer=null),C.off("changeSelection",this.update),this.update(null,C)}};u.Editor=x}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(n,u,v){var a=n("../lib/dom"),h=function(){function d(o,p){this.element=o,this.canvasHeight=p||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return d.prototype.moveContainer=function(o){a.translate(this.element,0,-(o.firstRowScreen*o.lineHeight%this.canvasHeight)-o.offset*this.$offsetCoefficient)},d.prototype.pageChanged=function(o,p){return Math.floor(o.firstRowScreen*o.lineHeight/this.canvasHeight)!==Math.floor(p.firstRowScreen*p.lineHeight/this.canvasHeight)},d.prototype.computeLineTop=function(o,p,e){var t=p.firstRowScreen*p.lineHeight,r=Math.floor(t/this.canvasHeight),l=e.documentToScreenRow(o,0)*p.lineHeight;return l-r*this.canvasHeight},d.prototype.computeLineHeight=function(o,p,e){return p.lineHeight*e.getRowLineCount(o)},d.prototype.getLength=function(){return this.cells.length},d.prototype.get=function(o){return this.cells[o]},d.prototype.shift=function(){this.$cacheCell(this.cells.shift())},d.prototype.pop=function(){this.$cacheCell(this.cells.pop())},d.prototype.push=function(o){if(Array.isArray(o)){this.cells.push.apply(this.cells,o);for(var p=a.createFragment(this.element),e=0;e<o.length;e++)p.appendChild(o[e].element);this.element.appendChild(p)}else this.cells.push(o),this.element.appendChild(o.element)},d.prototype.unshift=function(o){if(Array.isArray(o)){this.cells.unshift.apply(this.cells,o);for(var p=a.createFragment(this.element),e=0;e<o.length;e++)p.appendChild(o[e].element);this.element.firstChild?this.element.insertBefore(p,this.element.firstChild):this.element.appendChild(p)}else this.cells.unshift(o),this.element.insertAdjacentElement("afterbegin",o.element)},d.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},d.prototype.$cacheCell=function(o){o&&(o.element.remove(),this.cellCache.push(o))},d.prototype.createCell=function(o,p,e,t){var r=this.cellCache.pop();if(!r){var l=a.createElement("div");t&&t(l),this.element.appendChild(l),r={element:l,text:"",row:o}}return r.row=o,r},d}();u.Lines=h}),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(n,u,v){var a=n("../lib/dom"),h=n("../lib/oop"),d=n("../lib/lang"),o=n("../lib/event_emitter").EventEmitter,p=n("./lines").Lines,e=n("../config").nls,t=function(){function l(s){this.element=a.createElement("div"),this.element.className="ace_layer ace_gutter-layer",s.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new p(this.element),this.$lines.$offsetCoefficient=1}return l.prototype.setSession=function(s){this.session&&this.session.off("change",this.$updateAnnotations),this.session=s,s&&s.on("change",this.$updateAnnotations)},l.prototype.addGutterDecoration=function(s,c){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(s,c)},l.prototype.removeGutterDecoration=function(s,c){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(s,c)},l.prototype.setAnnotations=function(s){this.$annotations=[];for(var c=0;c<s.length;c++){var f=s[c],m=f.row,y=this.$annotations[m];y||(y=this.$annotations[m]={text:[],type:[],displayText:[]});var D=f.text,E=f.text,b=f.type;D=D?d.escapeHTML(D):f.html||"",E=E||f.html||"",y.text.indexOf(D)===-1&&(y.text.push(D),y.type.push(b),y.displayText.push(E));var g=f.className;g?y.className=g:b==="error"?y.className=" ace_error":b==="security"&&!/\bace_error\b/.test(y.className)?y.className=" ace_security":b==="warning"&&!/\bace_(error|security)\b/.test(y.className)?y.className=" ace_warning":b==="info"&&!y.className?y.className=" ace_info":b==="hint"&&!y.className&&(y.className=" ace_hint")}},l.prototype.$updateAnnotations=function(s){if(this.$annotations.length){var c=s.start.row,f=s.end.row-c;if(f!==0)if(s.action=="remove")this.$annotations.splice(c,f+1,null);else{var m=new Array(f+1);m.unshift(c,1),this.$annotations.splice.apply(this.$annotations,m)}}},l.prototype.update=function(s){this.config=s;var c=this.session,f=s.firstRow,m=Math.min(s.lastRow+s.gutterOffset,c.getLength()-1);this.oldLastRow=m,this.config=s,this.$lines.moveContainer(s),this.$updateCursorRow();for(var y=c.getNextFoldLine(f),D=y?y.start.row:1/0,E=null,b=-1,g=f;;){if(g>D&&(g=y.end.row+1,y=c.getNextFoldLine(g,y),D=y?y.start.row:1/0),g>m){for(;this.$lines.getLength()>b+1;)this.$lines.pop();break}E=this.$lines.get(++b),E?E.row=g:(E=this.$lines.createCell(g,s,this.session,r),this.$lines.push(E)),this.$renderCell(E,s,y,g),g++}this._signal("afterRender"),this.$updateGutterWidth(s)},l.prototype.$updateGutterWidth=function(s){var c=this.session,f=c.gutterRenderer||this.$renderer,m=c.$firstLineNumber,y=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||c.$useWrapMode)&&(y=c.getLength()+m-1);var D=f?f.getWidth(c,y,s):y.toString().length*s.characterWidth,E=this.$padding||this.$computePadding();D+=E.left+E.right,D!==this.gutterWidth&&!isNaN(D)&&(this.gutterWidth=D,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",D))},l.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var s=this.session.selection.getCursor();this.$cursorRow!==s.row&&(this.$cursorRow=s.row)}},l.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var s=this.session.selection.cursor.row;if(this.$cursorRow=s,!(this.$cursorCell&&this.$cursorCell.row==s)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var c=this.$lines.cells;this.$cursorCell=null;for(var f=0;f<c.length;f++){var m=c[f];if(m.row>=this.$cursorRow){if(m.row>this.$cursorRow){var y=this.session.getFoldLine(this.$cursorRow);if(f>0&&y&&y.start.row==c[f-1].row)m=c[f-1];else break}m.element.className="ace_gutter-active-line "+m.element.className,this.$cursorCell=m;break}}}}},l.prototype.scrollLines=function(s){var c=this.config;if(this.config=s,this.$updateCursorRow(),this.$lines.pageChanged(c,s))return this.update(s);this.$lines.moveContainer(s);var f=Math.min(s.lastRow+s.gutterOffset,this.session.getLength()-1),m=this.oldLastRow;if(this.oldLastRow=f,!c||m<s.firstRow)return this.update(s);if(f<c.firstRow)return this.update(s);if(c.firstRow<s.firstRow)for(var y=this.session.getFoldedRowCount(c.firstRow,s.firstRow-1);y>0;y--)this.$lines.shift();if(m>f)for(var y=this.session.getFoldedRowCount(f+1,m);y>0;y--)this.$lines.pop();s.firstRow<c.firstRow&&this.$lines.unshift(this.$renderLines(s,s.firstRow,c.firstRow-1)),f>m&&this.$lines.push(this.$renderLines(s,m+1,f)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(s)},l.prototype.$renderLines=function(s,c,f){for(var m=[],y=c,D=this.session.getNextFoldLine(y),E=D?D.start.row:1/0;y>E&&(y=D.end.row+1,D=this.session.getNextFoldLine(y,D),E=D?D.start.row:1/0),!(y>f);){var b=this.$lines.createCell(y,s,this.session,r);this.$renderCell(b,s,D,y),m.push(b),y++}return m},l.prototype.$renderCell=function(s,c,f,m){var y=s.element,D=this.session,E=y.childNodes[0],b=y.childNodes[1],g=y.childNodes[2],S=y.childNodes[3],T=g.firstChild,k=D.$firstLineNumber,_=D.$breakpoints,R=D.$decorations,x=D.gutterRenderer||this.$renderer,A=this.$showFoldWidgets&&D.foldWidgets,C=f?f.start.row:Number.MAX_VALUE,w=c.lineHeight+"px",$=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",I=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",F=(x?x.getText(D,m):m+k).toString();if(this.$highlightGutterLine&&(m==this.$cursorRow||f&&m<this.$cursorRow&&m>=C&&this.$cursorRow<=f.end.row)&&($+="ace_gutter-active-line ",this.$cursorCell!=s&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=s)),_[m]&&($+=_[m]),R[m]&&($+=R[m]),this.$annotations[m]&&m!==C&&($+=this.$annotations[m].className),A){var O=A[m];O==null&&(O=A[m]=D.getFoldWidget(m))}if(O){var B="ace_fold-widget ace_"+O,P=O=="start"&&m==C&&m<f.end.row;if(P){B+=" ace_closed";for(var V="",W=!1,H=m+1;H<=f.end.row;H++)if(this.$annotations[H]){if(this.$annotations[H].className===" ace_error"){W=!0,V=" ace_error_fold";break}this.$annotations[H].className===" ace_security"?(W=!0,V=" ace_security_fold"):this.$annotations[H].className===" ace_warning"&&V!==" ace_security_fold"&&(W=!0,V=" ace_warning_fold")}$+=V}else B+=" ace_open";b.className!=B&&(b.className=B),a.setStyle(b.style,"height",w),a.setStyle(b.style,"display","inline-block"),b.setAttribute("role","button"),b.setAttribute("tabindex","-1");var U=D.getFoldWidgetRange(m);U?b.setAttribute("aria-label",e("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[U.start.row+1,U.end.row+1])):f?b.setAttribute("aria-label",e("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[f.start.row+1,f.end.row+1])):b.setAttribute("aria-label",e("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[m+1])),P?(b.setAttribute("aria-expanded","false"),b.setAttribute("title",e("gutter.code-folding.closed.title","Unfold code"))):(b.setAttribute("aria-expanded","true"),b.setAttribute("title",e("gutter.code-folding.open.title","Fold code")))}else b&&(a.setStyle(b.style,"display","none"),b.setAttribute("tabindex","0"),b.removeAttribute("role"),b.removeAttribute("aria-label"));var G=this.session.$gutterCustomWidgets[m];if(G?this.$addCustomWidget(m,G,s):S&&this.$removeCustomWidget(m,s),W&&this.$showFoldedAnnotations){g.className="ace_gutter_annotation",T.className=I,T.className+=V,a.setStyle(T.style,"height",w),a.setStyle(g.style,"display","block"),a.setStyle(g.style,"height",w);var Y;switch(V){case" ace_error_fold":Y=e("gutter.annotation.aria-label.error","Error, read annotations row $0",[F]);break;case" ace_security_fold":Y=e("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[F]);break;case" ace_warning_fold":Y=e("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[F]);break}g.setAttribute("aria-label",Y),g.setAttribute("tabindex","-1"),g.setAttribute("role","button")}else if(this.$annotations[m]){g.className="ace_gutter_annotation",T.className=I,this.$useSvgGutterIcons?T.className+=this.$annotations[m].className:y.classList.add(this.$annotations[m].className.replace(" ","")),a.setStyle(T.style,"height",w),a.setStyle(g.style,"display","block"),a.setStyle(g.style,"height",w);var Y;switch(this.$annotations[m].className){case" ace_error":Y=e("gutter.annotation.aria-label.error","Error, read annotations row $0",[F]);break;case" ace_security":Y=e("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[F]);break;case" ace_warning":Y=e("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[F]);break;case" ace_info":Y=e("gutter.annotation.aria-label.info","Info, read annotations row $0",[F]);break;case" ace_hint":Y=e("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[F]);break}g.setAttribute("aria-label",Y),g.setAttribute("tabindex","-1"),g.setAttribute("role","button")}else a.setStyle(g.style,"display","none"),g.removeAttribute("aria-label"),g.removeAttribute("role"),g.setAttribute("tabindex","0");return F!==E.data&&(E.data=F),y.className!=$&&(y.className=$),a.setStyle(s.element.style,"height",this.$lines.computeLineHeight(m,c,D)+"px"),a.setStyle(s.element.style,"top",this.$lines.computeLineTop(m,c,D)+"px"),s.text=F,g.style.display==="none"&&b.style.display==="none"&&!G?s.element.setAttribute("aria-hidden",!0):s.element.setAttribute("aria-hidden",!1),s},l.prototype.setHighlightGutterLine=function(s){this.$highlightGutterLine=s},l.prototype.setShowLineNumbers=function(s){this.$renderer=!s&&{getWidth:function(){return 0},getText:function(){return""}}},l.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},l.prototype.setShowFoldWidgets=function(s){s?a.addCssClass(this.element,"ace_folding-enabled"):a.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=s,this.$padding=null},l.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},l.prototype.$hideFoldWidget=function(s,c){var f=c||this.$getGutterCell(s);if(f&&f.element){var m=f.element.childNodes[1];m&&a.setStyle(m.style,"display","none")}},l.prototype.$showFoldWidget=function(s,c){var f=c||this.$getGutterCell(s);if(f&&f.element){var m=f.element.childNodes[1];m&&this.session.foldWidgets&&this.session.foldWidgets[f.row]&&a.setStyle(m.style,"display","inline-block")}},l.prototype.$getGutterCell=function(s){var c=this.$lines.cells,f=this.session.documentToScreenRow(s,0);return c[s-this.config.firstRowScreen-(s-f)]},l.prototype.$addCustomWidget=function(s,c,f){var m=c.className,y=c.label,D=c.title,E=c.callbacks;this.session.$gutterCustomWidgets[s]={className:m,label:y,title:D,callbacks:E},this.$hideFoldWidget(s,f);var b=f||this.$getGutterCell(s);if(b&&b.element){var g=b.element.querySelector(".ace_custom-widget");g&&g.remove(),g=a.createElement("span"),g.className="ace_custom-widget ".concat(m),g.setAttribute("tabindex","-1"),g.setAttribute("role","button"),g.setAttribute("aria-label",y),g.setAttribute("title",D),a.setStyle(g.style,"display","inline-block"),a.setStyle(g.style,"height","inherit"),E&&E.onClick&&g.addEventListener("click",function(S){E.onClick(S,s),S.stopPropagation()}),b.element.appendChild(g)}},l.prototype.$removeCustomWidget=function(s,c){delete this.session.$gutterCustomWidgets[s],this.$showFoldWidget(s,c);var f=c||this.$getGutterCell(s);if(f&&f.element){var m=f.element.querySelector(".ace_custom-widget");m&&f.element.removeChild(m)}},l.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var s=a.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(s.borderLeftWidth)||0)+(parseInt(s.paddingLeft)||0)+1,this.$padding.right=(parseInt(s.borderRightWidth)||0)+(parseInt(s.paddingRight)||0),this.$padding},l.prototype.getRegion=function(s){var c=this.$padding||this.$computePadding(),f=this.element.getBoundingClientRect();if(s.x<c.left+f.left)return"markers";if(this.$showFoldWidgets&&s.x>f.right-c.right)return"foldWidgets"},l}();t.prototype.$fixedWidth=!1,t.prototype.$highlightGutterLine=!0,t.prototype.$renderer="",t.prototype.$showLineNumbers=!0,t.prototype.$showFoldWidgets=!0,h.implement(t.prototype,o);function r(l){var s=document.createTextNode("");l.appendChild(s);var c=a.createElement("span");l.appendChild(c);var f=a.createElement("span");l.appendChild(f);var m=a.createElement("span");return f.appendChild(m),l}u.Gutter=t}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(n,u,v){var a=n("../range").Range,h=n("../lib/dom"),d=function(){function p(e){this.element=h.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}return p.prototype.setPadding=function(e){this.$padding=e},p.prototype.setSession=function(e){this.session=e},p.prototype.setMarkers=function(e){this.markers=e},p.prototype.elt=function(e,t){var r=this.i!=-1&&this.element.childNodes[this.i];r?this.i++:(r=document.createElement("div"),this.element.appendChild(r),this.i=-1),r.style.cssText=t,r.className=e},p.prototype.update=function(e){if(e){this.config=e,this.i=0;var t;for(var r in this.markers){var l=this.markers[r];if(!l.range){l.update(t,this,this.session,e);continue}var s=l.range.clipRows(e.firstRow,e.lastRow);if(!s.isEmpty())if(s=s.toScreenRange(this.session),l.renderer){var c=this.$getTop(s.start.row,e),f=this.$padding+s.start.column*e.characterWidth;l.renderer(t,s,f,c,e)}else l.type=="fullLine"?this.drawFullLineMarker(t,s,l.clazz,e):l.type=="screenLine"?this.drawScreenLineMarker(t,s,l.clazz,e):s.isMultiLine()?l.type=="text"?this.drawTextMarker(t,s,l.clazz,e):this.drawMultiLineMarker(t,s,l.clazz,e):this.drawSingleLineMarker(t,s,l.clazz+" ace_start ace_br15",e)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},p.prototype.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},p.prototype.drawTextMarker=function(e,t,r,l,s){for(var c=this.session,f=t.start.row,m=t.end.row,y=f,D=0,E=0,b=c.getScreenLastRowColumn(y),g=new a(y,t.start.column,y,E);y<=m;y++)g.start.row=g.end.row=y,g.start.column=y==f?t.start.column:c.getRowWrapIndent(y),g.end.column=b,D=E,E=b,b=y+1<m?c.getScreenLastRowColumn(y+1):y==m?0:t.end.column,this.drawSingleLineMarker(e,g,r+(y==f?" ace_start":"")+" ace_br"+o(y==f||y==f+1&&t.start.column,D<E,E>b,y==m),l,y==m?0:1,s)},p.prototype.drawMultiLineMarker=function(e,t,r,l,s){var c=this.$padding,f=l.lineHeight,m=this.$getTop(t.start.row,l),y=c+t.start.column*l.characterWidth;if(s=s||"",this.session.$bidiHandler.isBidiRow(t.start.row)){var D=t.clone();D.end.row=D.start.row,D.end.column=this.session.getLine(D.start.row).length,this.drawBidiSingleLineMarker(e,D,r+" ace_br1 ace_start",l,null,s)}else this.elt(r+" ace_br1 ace_start","height:"+f+"px;right:"+c+"px;top:"+m+"px;left:"+y+"px;"+(s||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var D=t.clone();D.start.row=D.end.row,D.start.column=0,this.drawBidiSingleLineMarker(e,D,r+" ace_br12",l,null,s)}else{m=this.$getTop(t.end.row,l);var E=t.end.column*l.characterWidth;this.elt(r+" ace_br12","height:"+f+"px;width:"+E+"px;top:"+m+"px;left:"+c+"px;"+(s||""))}if(f=(t.end.row-t.start.row-1)*l.lineHeight,!(f<=0)){m=this.$getTop(t.start.row+1,l);var b=(t.start.column?1:0)|(t.end.column?0:8);this.elt(r+(b?" ace_br"+b:""),"height:"+f+"px;right:"+c+"px;top:"+m+"px;left:"+c+"px;"+(s||""))}},p.prototype.drawSingleLineMarker=function(e,t,r,l,s,c){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,r,l,s,c);var f=l.lineHeight,m=(t.end.column+(s||0)-t.start.column)*l.characterWidth,y=this.$getTop(t.start.row,l),D=this.$padding+t.start.column*l.characterWidth;this.elt(r,"height:"+f+"px;width:"+m+"px;top:"+y+"px;left:"+D+"px;"+(c||""))},p.prototype.drawBidiSingleLineMarker=function(e,t,r,l,s,c){var f=l.lineHeight,m=this.$getTop(t.start.row,l),y=this.$padding,D=this.session.$bidiHandler.getSelections(t.start.column,t.end.column);D.forEach(function(E){this.elt(r,"height:"+f+"px;width:"+(E.width+(s||0))+"px;top:"+m+"px;left:"+(y+E.left)+"px;"+(c||""))},this)},p.prototype.drawFullLineMarker=function(e,t,r,l,s){var c=this.$getTop(t.start.row,l),f=l.lineHeight;t.start.row!=t.end.row&&(f+=this.$getTop(t.end.row,l)-c),this.elt(r,"height:"+f+"px;top:"+c+"px;left:0;right:0;"+(s||""))},p.prototype.drawScreenLineMarker=function(e,t,r,l,s){var c=this.$getTop(t.start.row,l),f=l.lineHeight;this.elt(r,"height:"+f+"px;top:"+c+"px;left:0;right:0;"+(s||""))},p}();d.prototype.$padding=0;function o(p,e,t,r){return(p?1:0)|(e?2:0)|(t?4:0)|(r?8:0)}u.Marker=d}),ace.define("ace/layer/text_util",["require","exports","module"],function(n,u,v){var a=new Set(["text","rparen","lparen"]);u.isTextToken=function(h){return a.has(h)}}),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(n,u,v){var a=n("../lib/oop"),h=n("../lib/dom"),d=n("../lib/lang"),o=n("./lines").Lines,p=n("../lib/event_emitter").EventEmitter,e=n("../config").nls,t=n("./text_util").isTextToken,r=function(){function l(s){this.dom=h,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",s.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)}return l.prototype.$updateEolChar=function(){var s=this.session.doc,c=s.getNewLineCharacter()==`
230
- `&&s.getNewLineMode()!="windows",f=c?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=f)return this.EOL_CHAR=f,!0},l.prototype.setPadding=function(s){this.$padding=s,this.element.style.margin="0 "+s+"px"},l.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},l.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},l.prototype.$setFontMetrics=function(s){this.$fontMetrics=s,this.$fontMetrics.on("changeCharacterSize",function(c){this._signal("changeCharacterSize",c)}.bind(this)),this.$pollSizeChanges()},l.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},l.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},l.prototype.setSession=function(s){this.session=s,s&&this.$computeTabString()},l.prototype.setShowInvisibles=function(s){return this.showInvisibles==s?!1:(this.showInvisibles=s,typeof s=="string"?(this.showSpaces=/tab/i.test(s),this.showTabs=/space/i.test(s),this.showEOL=/eol/i.test(s)):this.showSpaces=this.showTabs=this.showEOL=s,this.$computeTabString(),!0)},l.prototype.setDisplayIndentGuides=function(s){return this.displayIndentGuides==s?!1:(this.displayIndentGuides=s,this.$computeTabString(),!0)},l.prototype.setHighlightIndentGuides=function(s){return this.$highlightIndentGuides===s?!1:(this.$highlightIndentGuides=s,s)},l.prototype.$computeTabString=function(){var s=this.session.getTabSize();this.tabSize=s;for(var c=this.$tabStrings=[0],f=1;f<s+1;f++)if(this.showTabs){var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_tab",m.textContent=d.stringRepeat(this.TAB_CHAR,f),c.push(m)}else c.push(this.dom.createTextNode(d.stringRepeat(" ",f),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var y="ace_indent-guide",D=this.showSpaces?" ace_invisible ace_invisible_space":"",E=this.showSpaces?d.stringRepeat(this.SPACE_CHAR,this.tabSize):d.stringRepeat(" ",this.tabSize),b=this.showTabs?" ace_invisible ace_invisible_tab":"",g=this.showTabs?d.stringRepeat(this.TAB_CHAR,this.tabSize):E,m=this.dom.createElement("span");m.className=y+D,m.textContent=E,this.$tabStrings[" "]=m;var m=this.dom.createElement("span");m.className=y+b,m.textContent=g,this.$tabStrings[" "]=m}},l.prototype.updateLines=function(s,c,f){if(this.config.lastRow!=s.lastRow||this.config.firstRow!=s.firstRow)return this.update(s);this.config=s;for(var m=Math.max(c,s.firstRow),y=Math.min(f,s.lastRow),D=this.element.childNodes,E=0,g=s.firstRow;g<m;g++){var S=this.session.getFoldLine(g);if(S)if(S.containsRow(m)){m=S.start.row;break}else g=S.end.row;E++}for(var b=!1,g=m,S=this.session.getNextFoldLine(g),T=S?S.start.row:1/0;g>T&&(g=S.end.row+1,S=this.session.getNextFoldLine(g,S),T=S?S.start.row:1/0),!(g>y);){var k=D[E++];if(k){this.dom.removeChildren(k),this.$renderLine(k,g,g==T?S:!1),b&&(k.style.top=this.$lines.computeLineTop(g,s,this.session)+"px");var _=s.lineHeight*this.session.getRowLength(g)+"px";k.style.height!=_&&(b=!0,k.style.height=_)}g++}if(b)for(;E<this.$lines.cells.length;){var R=this.$lines.cells[E++];R.element.style.top=this.$lines.computeLineTop(R.row,s,this.session)+"px"}},l.prototype.scrollLines=function(s){var c=this.config;if(this.config=s,this.$lines.pageChanged(c,s))return this.update(s);this.$lines.moveContainer(s);var f=s.lastRow,m=c?c.lastRow:-1;if(!c||m<s.firstRow)return this.update(s);if(f<c.firstRow)return this.update(s);if(!c||c.lastRow<s.firstRow)return this.update(s);if(s.lastRow<c.firstRow)return this.update(s);if(c.firstRow<s.firstRow)for(var y=this.session.getFoldedRowCount(c.firstRow,s.firstRow-1);y>0;y--)this.$lines.shift();if(c.lastRow>s.lastRow)for(var y=this.session.getFoldedRowCount(s.lastRow+1,c.lastRow);y>0;y--)this.$lines.pop();s.firstRow<c.firstRow&&this.$lines.unshift(this.$renderLinesFragment(s,s.firstRow,c.firstRow-1)),s.lastRow>c.lastRow&&this.$lines.push(this.$renderLinesFragment(s,c.lastRow+1,s.lastRow)),this.$highlightIndentGuide()},l.prototype.$renderLinesFragment=function(s,c,f){for(var m=[],y=c,D=this.session.getNextFoldLine(y),E=D?D.start.row:1/0;y>E&&(y=D.end.row+1,D=this.session.getNextFoldLine(y,D),E=D?D.start.row:1/0),!(y>f);){var b=this.$lines.createCell(y,s,this.session),g=b.element;this.dom.removeChildren(g),h.setStyle(g.style,"height",this.$lines.computeLineHeight(y,s,this.session)+"px"),h.setStyle(g.style,"top",this.$lines.computeLineTop(y,s,this.session)+"px"),this.$renderLine(g,y,y==E?D:!1),this.$useLineGroups()?g.className="ace_line_group":g.className="ace_line",m.push(b),y++}return m},l.prototype.update=function(s){this.$lines.moveContainer(s),this.config=s;for(var c=s.firstRow,f=s.lastRow,m=this.$lines;m.getLength();)m.pop();m.push(this.$renderLinesFragment(s,c,f))},l.prototype.$renderToken=function(s,c,f,m){for(var y=this,D=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,E=this.dom.createFragment(this.element),b,g=0;b=D.exec(m);){var S=b[1],T=b[2],k=b[3],_=b[4],R=b[5];if(!(!y.showSpaces&&T)){var x=g!=b.index?m.slice(g,b.index):"";if(g=b.index+b[0].length,x&&E.appendChild(this.dom.createTextNode(x,this.element)),S){var A=y.session.getScreenTabSize(c+b.index);E.appendChild(y.$tabStrings[A].cloneNode(!0)),c+=A-1}else if(T)if(y.showSpaces){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space",C.textContent=d.stringRepeat(y.SPACE_CHAR,T.length),E.appendChild(C)}else E.appendChild(this.dom.createTextNode(T,this.element));else if(k){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space ace_invalid",C.textContent=d.stringRepeat(y.SPACE_CHAR,k.length),E.appendChild(C)}else if(_){c+=1;var C=this.dom.createElement("span");C.style.width=y.config.characterWidth*2+"px",C.className=y.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",C.textContent=y.showSpaces?y.SPACE_CHAR:_,E.appendChild(C)}else if(R){c+=1;var C=this.dom.createElement("span");C.style.width=y.config.characterWidth*2+"px",C.className="ace_cjk",C.textContent=R,E.appendChild(C)}}}if(E.appendChild(this.dom.createTextNode(g?m.slice(g):m,this.element)),t(f.type))s.appendChild(E);else{var w="ace_"+f.type.replace(/\./g," ace_"),C=this.dom.createElement("span");f.type=="fold"&&(C.style.width=f.value.length*this.config.characterWidth+"px",C.setAttribute("title",e("inline-fold.closed.title","Unfold code"))),C.className=w,C.appendChild(E),s.appendChild(C)}return c+m.length},l.prototype.renderIndentGuide=function(s,c,f){var m=c.search(this.$indentGuideRe);if(m<=0||m>=f)return c;if(c[0]==" "){m-=m%this.tabSize;for(var y=m/this.tabSize,D=0;D<y;D++)s.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),c.substr(m)}else if(c[0]==" "){for(var D=0;D<m;D++)s.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),c.substr(m)}return this.$highlightIndentGuide(),c},l.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var s=this.session.doc.$lines;if(s){var c=this.session.selection.getCursor(),f=/^\s*/.exec(this.session.doc.getLine(c.row))[0].length,m=Math.floor(f/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:m,start:c.row};var y=this.session.$bracketHighlight;if(y){for(var D=this.session.$bracketHighlight.ranges,E=0;E<D.length;E++)if(c.row!==D[E].start.row){this.$highlightIndentGuideMarker.end=D[E].start.row+1,c.row>D[E].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&s[c.row]!==""&&c.column===s[c.row].length){this.$highlightIndentGuideMarker.dir=1;for(var E=c.row+1;E<s.length;E++){var b=s[E],g=/^\s*/.exec(b)[0].length;if(b!==""&&(this.$highlightIndentGuideMarker.end=E,g<=f))break}}this.$renderHighlightIndentGuide()}}},l.prototype.$clearActiveIndentGuide=function(){for(var s=this.element.querySelectorAll(".ace_indent-guide-active"),c=0;c<s.length;c++)s[c].classList.remove("ace_indent-guide-active")},l.prototype.$setIndentGuideActive=function(s,c){var f=this.session.doc.getLine(s.row);if(f!==""){var m=s.element;if(s.element.classList&&s.element.classList.contains("ace_line_group"))if(s.element.childNodes.length>0)m=s.element.childNodes[0];else return;var y=m.childNodes;if(y){var D=y[c-1];D&&D.classList&&D.classList.contains("ace_indent-guide")&&D.classList.add("ace_indent-guide-active")}}},l.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var s=this.$lines.cells;this.$clearActiveIndentGuide();var c=this.$highlightIndentGuideMarker.indentLevel;if(c!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var f=0;f<s.length;f++){var m=s[f];if(this.$highlightIndentGuideMarker.end&&m.row>=this.$highlightIndentGuideMarker.start+1){if(m.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(m,c)}}else for(var f=s.length-1;f>=0;f--){var m=s[f];if(this.$highlightIndentGuideMarker.end&&m.row<this.$highlightIndentGuideMarker.start){if(m.row<this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(m,c)}}}},l.prototype.$createLineElement=function(s){var c=this.dom.createElement("div");return c.className="ace_line",c.style.height=this.config.lineHeight+"px",c},l.prototype.$renderWrappedLine=function(s,c,f){var m=0,y=0,D=f[0],E=0,b=this.$createLineElement();s.appendChild(b);for(var g=0;g<c.length;g++){var S=c[g],T=S.value;if(g==0&&this.displayIndentGuides){if(m=T.length,T=this.renderIndentGuide(b,T,D),!T)continue;m-=T.length}if(m+T.length<D)E=this.$renderToken(b,E,S,T),m+=T.length;else{for(;m+T.length>=D;)E=this.$renderToken(b,E,S,T.substring(0,D-m)),T=T.substring(D-m),m=D,b=this.$createLineElement(),s.appendChild(b),b.appendChild(this.dom.createTextNode(d.stringRepeat(" ",f.indent),this.element)),y++,E=0,D=f[y]||Number.MAX_VALUE;T.length!=0&&(m+=T.length,E=this.$renderToken(b,E,S,T))}}f[f.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(b,E,null,"",!0)},l.prototype.$renderSimpleLine=function(s,c){for(var f=0,m=0;m<c.length;m++){var y=c[m],D=y.value;if(!(m==0&&this.displayIndentGuides&&(D=this.renderIndentGuide(s,D),!D))){if(f+D.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(s,f,y,D);f=this.$renderToken(s,f,y,D)}}},l.prototype.$renderOverflowMessage=function(s,c,f,m,y){f&&this.$renderToken(s,c,f,m.slice(0,this.MAX_LINE_LENGTH-c));var D=this.dom.createElement("span");D.className="ace_inline_button ace_keyword ace_toggle_wrap",D.textContent=y?"<hide>":"<click to see more...>",s.appendChild(D)},l.prototype.$renderLine=function(s,c,f){if(!f&&f!=!1&&(f=this.session.getFoldLine(c)),f)var m=this.$getFoldLineTokens(c,f);else var m=this.session.getTokens(c);var y=s;if(m.length){var D=this.session.getRowSplitData(c);if(D&&D.length){this.$renderWrappedLine(s,m,D);var y=s.lastChild}else{var y=s;this.$useLineGroups()&&(y=this.$createLineElement(),s.appendChild(y)),this.$renderSimpleLine(y,m)}}else this.$useLineGroups()&&(y=this.$createLineElement(),s.appendChild(y));if(this.showEOL&&y){f&&(c=f.end.row);var E=this.dom.createElement("span");E.className="ace_invisible ace_invisible_eol",E.textContent=c==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,y.appendChild(E)}},l.prototype.$getFoldLineTokens=function(s,c){var f=this.session,m=[];function y(E,b,g){for(var S=0,T=0;T+E[S].value.length<b;)if(T+=E[S].value.length,S++,S==E.length)return;if(T!=b){var k=E[S].value.substring(b-T);k.length>g-b&&(k=k.substring(0,g-b)),m.push({type:E[S].type,value:k}),T=b+k.length,S+=1}for(;T<g&&S<E.length;){var k=E[S].value;k.length+T>g?m.push({type:E[S].type,value:k.substring(0,g-T)}):m.push(E[S]),T+=k.length,S+=1}}var D=f.getTokens(s);return c.walk(function(E,b,g,S,T){E!=null?m.push({type:"fold",value:E}):(T&&(D=f.getTokens(b)),D.length&&y(D,S,g))},c.end.row,this.session.getLine(c.end.row).length),m},l.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},l}();r.prototype.EOF_CHAR="¶",r.prototype.EOL_CHAR_LF="¬",r.prototype.EOL_CHAR_CRLF="¤",r.prototype.EOL_CHAR=r.prototype.EOL_CHAR_LF,r.prototype.TAB_CHAR="—",r.prototype.SPACE_CHAR="·",r.prototype.$padding=0,r.prototype.MAX_LINE_LENGTH=1e4,r.prototype.showInvisibles=!1,r.prototype.showSpaces=!1,r.prototype.showTabs=!1,r.prototype.showEOL=!1,r.prototype.displayIndentGuides=!0,r.prototype.$highlightIndentGuides=!0,r.prototype.$tabStrings=[],r.prototype.destroy={},r.prototype.onChangeTabSize=r.prototype.$computeTabString,a.implement(r.prototype,p),u.Text=r}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(n,u,v){var a=n("../lib/dom"),h=function(){function d(o){this.element=a.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(),a.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return d.prototype.$updateOpacity=function(o){for(var p=this.cursors,e=p.length;e--;)a.setStyle(p[e].style,"opacity",o?"":"0")},d.prototype.$startCssAnimation=function(){for(var o=this.cursors,p=o.length;p--;)o[p].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&a.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},d.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,a.removeCssClass(this.element,"ace_animate-blinking")},d.prototype.setPadding=function(o){this.$padding=o},d.prototype.setSession=function(o){this.session=o},d.prototype.setBlinking=function(o){o!=this.isBlinking&&(this.isBlinking=o,this.restartTimer())},d.prototype.setBlinkInterval=function(o){o!=this.blinkInterval&&(this.blinkInterval=o,this.restartTimer())},d.prototype.setSmoothBlinking=function(o){o!=this.smoothBlinking&&(this.smoothBlinking=o,a.setCssClass(this.element,"ace_smooth-blinking",o),this.$updateCursors(!0),this.restartTimer())},d.prototype.addCursor=function(){var o=a.createElement("div");return o.className="ace_cursor",this.element.appendChild(o),this.cursors.push(o),o},d.prototype.removeCursor=function(){if(this.cursors.length>1){var o=this.cursors.pop();return o.parentNode.removeChild(o),o}},d.prototype.hideCursor=function(){this.isVisible=!1,a.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},d.prototype.showCursor=function(){this.isVisible=!0,a.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},d.prototype.restartTimer=function(){var o=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,a.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&&a.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),a.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var p=function(){this.timeoutId=setTimeout(function(){o(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){o(!0),p()},this.blinkInterval),p()}},d.prototype.getPixelPosition=function(o,p){if(!this.config||!this.session)return{left:0,top:0};o||(o=this.session.selection.getCursor());var e=this.session.documentToScreenPosition(o),t=this.$padding+(this.session.$bidiHandler.isBidiRow(e.row,o.row)?this.session.$bidiHandler.getPosLeft(e.column):e.column*this.config.characterWidth),r=(e.row-(p?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:t,top:r}},d.prototype.isCursorInView=function(o,p){return o.top>=0&&o.top<p.maxHeight},d.prototype.update=function(o){this.config=o;var p=this.session.$selectionMarkers,e=0,t=0;(p===void 0||p.length===0)&&(p=[{cursor:null}]);for(var e=0,r=p.length;e<r;e++){var l=this.getPixelPosition(p[e].cursor,!0);if(!((l.top>o.height+o.offset||l.top<0)&&e>1)){var s=this.cursors[t++]||this.addCursor(),c=s.style;this.drawCursor?this.drawCursor(s,l,o,p[e],this.session):this.isCursorInView(l,o)?(a.setStyle(c,"display","block"),a.translate(s,l.left,l.top),a.setStyle(c,"width",Math.round(o.characterWidth)+"px"),a.setStyle(c,"height",o.lineHeight+"px")):a.setStyle(c,"display","none")}}for(;this.cursors.length>t;)this.removeCursor();var f=this.session.getOverwrite();this.$setOverwrite(f),this.$pixelPos=l,this.restartTimer()},d.prototype.$setOverwrite=function(o){o!=this.overwrite&&(this.overwrite=o,o?a.addCssClass(this.element,"ace_overwrite-cursors"):a.removeCssClass(this.element,"ace_overwrite-cursors"))},d.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},d}();h.prototype.$padding=0,h.prototype.drawCursor=null,u.Cursor=h}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(n,u,v){var a=this&&this.__extends||function(){var s=function(c,f){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,y){m.__proto__=y}||function(m,y){for(var D in y)Object.prototype.hasOwnProperty.call(y,D)&&(m[D]=y[D])},s(c,f)};return function(c,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");s(c,f);function m(){this.constructor=c}c.prototype=f===null?Object.create(f):(m.prototype=f.prototype,new m)}}(),h=n("./lib/oop"),d=n("./lib/dom"),o=n("./lib/event"),p=n("./lib/event_emitter").EventEmitter,e=32768,t=function(){function s(c,f){this.element=d.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+f,this.inner=d.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),c.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 s.prototype.setVisible=function(c){this.element.style.display=c?"":"none",this.isVisible=c,this.coeff=1},s}();h.implement(t.prototype,p);var r=function(s){a(c,s);function c(f,m){var y=s.call(this,f,"-v")||this;return y.scrollTop=0,y.scrollHeight=0,m.$scrollbarWidth=y.width=d.scrollbarWidth(f.ownerDocument),y.inner.style.width=y.element.style.width=(y.width||15)+5+"px",y.$minWidth=0,y}return c.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var f=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-f)/(this.coeff-f)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},c.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},c.prototype.setHeight=function(f){this.element.style.height=f+"px"},c.prototype.setScrollHeight=function(f){this.scrollHeight=f,f>e?(this.coeff=e/f,f=e):this.coeff!=1&&(this.coeff=1),this.inner.style.height=f+"px"},c.prototype.setScrollTop=function(f){this.scrollTop!=f&&(this.skipEvent=!0,this.scrollTop=f,this.element.scrollTop=f*this.coeff)},c}(t);r.prototype.setInnerHeight=r.prototype.setScrollHeight;var l=function(s){a(c,s);function c(f,m){var y=s.call(this,f,"-h")||this;return y.scrollLeft=0,y.height=m.$scrollbarWidth,y.inner.style.height=y.element.style.height=(y.height||15)+5+"px",y}return c.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},c.prototype.getHeight=function(){return this.isVisible?this.height:0},c.prototype.setWidth=function(f){this.element.style.width=f+"px"},c.prototype.setInnerWidth=function(f){this.inner.style.width=f+"px"},c.prototype.setScrollWidth=function(f){this.inner.style.width=f+"px"},c.prototype.setScrollLeft=function(f){this.scrollLeft!=f&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=f)},c}(t);u.ScrollBar=r,u.ScrollBarV=r,u.ScrollBarH=l,u.VScrollBar=r,u.HScrollBar=l}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(n,u,v){var a=this&&this.__extends||function(){var l=function(s,c){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(f[y]=m[y])},l(s,c)};return function(s,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");l(s,c);function f(){this.constructor=s}s.prototype=c===null?Object.create(c):(f.prototype=c.prototype,new f)}}(),h=n("./lib/oop"),d=n("./lib/dom"),o=n("./lib/event"),p=n("./lib/event_emitter").EventEmitter;d.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
231
- position: absolute;
232
- background: rgba(128, 128, 128, 0.6);
233
- -moz-box-sizing: border-box;
234
- box-sizing: border-box;
235
- border: 1px solid #bbb;
236
- border-radius: 2px;
237
- z-index: 8;
238
- }
239
- .ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {
240
- position: absolute;
241
- z-index: 6;
242
- background: none;
243
- overflow: hidden!important;
244
- }
245
- .ace_editor>.ace_sb-v {
246
- z-index: 6;
247
- right: 0;
248
- top: 0;
249
- width: 12px;
250
- }
251
- .ace_editor>.ace_sb-v div {
252
- z-index: 8;
253
- right: 0;
254
- width: 100%;
255
- }
256
- .ace_editor>.ace_sb-h {
257
- bottom: 0;
258
- left: 0;
259
- height: 12px;
260
- }
261
- .ace_editor>.ace_sb-h div {
262
- bottom: 0;
263
- height: 100%;
264
- }
265
- .ace_editor>.ace_sb_grabbed {
266
- z-index: 8;
267
- background: #000;
268
- }`,"ace_scrollbar.css",!1);var e=function(){function l(s,c){this.element=d.createElement("div"),this.element.className="ace_sb"+c,this.inner=d.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,s.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return l.prototype.setVisible=function(s){this.element.style.display=s?"":"none",this.isVisible=s,this.coeff=1},l}();h.implement(e.prototype,p);var t=function(l){a(s,l);function s(c,f){var m=l.call(this,c,"-v")||this;return m.scrollTop=0,m.scrollHeight=0,m.parent=c,m.width=m.VScrollWidth,m.renderer=f,m.inner.style.width=m.element.style.width=(m.width||15)+"px",m.$minWidth=0,m}return s.prototype.onMouseDown=function(c,f){if(c==="mousedown"&&!(o.getButton(f)!==0||f.detail===2)){if(f.target===this.inner){var m=this,y=f.clientY,D=function(_){y=_.clientY},E=function(){clearInterval(T)},b=f.clientY,g=this.thumbTop,S=function(){if(y!==void 0){var _=m.scrollTopFromThumbTop(g+y-b);_!==m.scrollTop&&m._emit("scroll",{data:_})}};o.capture(this.inner,D,E);var T=setInterval(S,20);return o.preventDefault(f)}var k=f.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(k)}),o.preventDefault(f)}},s.prototype.getHeight=function(){return this.height},s.prototype.scrollTopFromThumbTop=function(c){var f=c*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return f=f>>0,f<0?f=0:f>this.pageHeight-this.viewHeight&&(f=this.pageHeight-this.viewHeight),f},s.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},s.prototype.setHeight=function(c){this.height=Math.max(0,c),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},s.prototype.setScrollHeight=function(c,f){this.pageHeight===c&&!f||(this.pageHeight=c,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})))},s.prototype.setScrollTop=function(c){this.scrollTop=c,c<0&&(c=0),this.thumbTop=c*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},s}(e);t.prototype.setInnerHeight=t.prototype.setScrollHeight;var r=function(l){a(s,l);function s(c,f){var m=l.call(this,c,"-h")||this;return m.scrollLeft=0,m.scrollWidth=0,m.height=m.HScrollHeight,m.inner.style.height=m.element.style.height=(m.height||12)+"px",m.renderer=f,m}return s.prototype.onMouseDown=function(c,f){if(c==="mousedown"&&!(o.getButton(f)!==0||f.detail===2)){if(f.target===this.inner){var m=this,y=f.clientX,D=function(_){y=_.clientX},E=function(){clearInterval(T)},b=f.clientX,g=this.thumbLeft,S=function(){if(y!==void 0){var _=m.scrollLeftFromThumbLeft(g+y-b);_!==m.scrollLeft&&m._emit("scroll",{data:_})}};o.capture(this.inner,D,E);var T=setInterval(S,20);return o.preventDefault(f)}var k=f.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(k)}),o.preventDefault(f)}},s.prototype.getHeight=function(){return this.isVisible?this.height:0},s.prototype.scrollLeftFromThumbLeft=function(c){var f=c*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return f=f>>0,f<0?f=0:f>this.pageWidth-this.viewWidth&&(f=this.pageWidth-this.viewWidth),f},s.prototype.setWidth=function(c){this.width=Math.max(0,c),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},s.prototype.setScrollWidth=function(c,f){this.pageWidth===c&&!f||(this.pageWidth=c,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})))},s.prototype.setScrollLeft=function(c){this.scrollLeft=c,c<0&&(c=0),this.thumbLeft=c*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},s}(e);r.prototype.setInnerWidth=r.prototype.setScrollWidth,u.ScrollBar=t,u.ScrollBarV=t,u.ScrollBarH=r,u.VScrollBar=t,u.HScrollBar=r}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(n,u,v){var a=n("./lib/event"),h=function(){function d(o,p){this.onRender=o,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=p||window;var e=this;this._flush=function(t){e.pending=!1;var r=e.changes;if(r&&(a.blockIdle(100),e.changes=0,e.onRender(r)),e.changes){if(e.$recursionLimit--<0)return;e.schedule()}else e.$recursionLimit=2}}return d.prototype.schedule=function(o){this.changes=this.changes|o,this.changes&&!this.pending&&(a.nextFrame(this._flush),this.pending=!0)},d.prototype.clear=function(o){var p=this.changes;return this.changes=0,p},d}();u.RenderLoop=h}),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(n,u,v){var a=n("../lib/oop"),h=n("../lib/dom"),d=n("../lib/lang"),o=n("../lib/event"),p=n("../lib/useragent"),e=n("../lib/event_emitter").EventEmitter,t=512,r=typeof ResizeObserver=="function",l=200,s=function(){function c(f){this.el=h.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=h.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=h.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),f.appendChild(this.el),this.$measureNode.textContent=d.stringRepeat("X",t),this.$characterSize={width:0,height:0},r?this.$addObserver():this.checkForSizeChanges()}return c.prototype.$setMeasureNodeStyles=function(f,m){f.width=f.height="auto",f.left=f.top="0px",f.visibility="hidden",f.position="absolute",f.whiteSpace="pre",p.isIE<8?f["font-family"]="inherit":f.font="inherit",f.overflow=m?"hidden":"visible"},c.prototype.checkForSizeChanges=function(f){if(f===void 0&&(f=this.$measureSizes()),f&&(this.$characterSize.width!==f.width||this.$characterSize.height!==f.height)){this.$measureNode.style.fontWeight="bold";var m=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=f,this.charSizes=Object.create(null),this.allowBoldFonts=m&&m.width===f.width&&m.height===f.height,this._emit("changeCharacterSize",{data:f})}},c.prototype.$addObserver=function(){var f=this;this.$observer=new window.ResizeObserver(function(m){f.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},c.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var f=this;return this.$pollSizeChangesTimer=o.onIdle(function m(){f.checkForSizeChanges(),o.onIdle(m,500)},500)},c.prototype.setPolling=function(f){f?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},c.prototype.$measureSizes=function(f){var m={height:(f||this.$measureNode).clientHeight,width:(f||this.$measureNode).clientWidth/t};return m.width===0||m.height===0?null:m},c.prototype.$measureCharWidth=function(f){this.$main.textContent=d.stringRepeat(f,t);var m=this.$main.getBoundingClientRect();return m.width/t},c.prototype.getCharacterWidth=function(f){var m=this.charSizes[f];return m===void 0&&(m=this.charSizes[f]=this.$measureCharWidth(f)/this.$characterSize.width),m},c.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},c.prototype.$getZoom=function(f){return!f||!f.parentElement?1:(Number(window.getComputedStyle(f).zoom)||1)*this.$getZoom(f.parentElement)},c.prototype.$initTransformMeasureNodes=function(){var f=function(m,y){return["div",{style:"position: absolute;top:"+m+"px;left:"+y+"px;"}]};this.els=h.buildDom([f(0,0),f(l,0),f(0,l),f(l,l)],this.el)},c.prototype.transformCoordinates=function(f,m){if(f){var y=this.$getZoom(this.el);f=g(1/y,f)}function D(B,P,V){var W=B[1]*P[0]-B[0]*P[1];return[(-P[1]*V[0]+P[0]*V[1])/W,(+B[1]*V[0]-B[0]*V[1])/W]}function E(B,P){return[B[0]-P[0],B[1]-P[1]]}function b(B,P){return[B[0]+P[0],B[1]+P[1]]}function g(B,P){return[B*P[0],B*P[1]]}this.els||this.$initTransformMeasureNodes();function S(B){var P=B.getBoundingClientRect();return[P.left,P.top]}var T=S(this.els[0]),k=S(this.els[1]),_=S(this.els[2]),R=S(this.els[3]),x=D(E(R,k),E(R,_),E(b(k,_),b(R,T))),A=g(1+x[0],E(k,T)),C=g(1+x[1],E(_,T));if(m){var w=m,$=x[0]*w[0]/l+x[1]*w[1]/l+1,I=b(g(w[0],A),g(w[1],C));return b(g(1/$/l,I),T)}var F=E(f,T),O=D(E(A,g(x[0],F)),E(C,g(x[1],F)),F);return g(l,O)},c}();s.prototype.$characterSize={width:0,height:0},a.implement(s.prototype,e),u.FontMetrics=s}),ace.define("ace/css/editor-css",["require","exports","module"],function(n,u,v){v.exports=`
269
- .ace_br1 {border-top-left-radius : 3px;}
270
- .ace_br2 {border-top-right-radius : 3px;}
271
- .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
272
- .ace_br4 {border-bottom-right-radius: 3px;}
273
- .ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}
274
- .ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}
275
- .ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}
276
- .ace_br8 {border-bottom-left-radius : 3px;}
277
- .ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}
278
- .ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}
279
- .ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}
280
- .ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
281
- .ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
282
- .ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
283
- .ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
284
-
285
-
286
- .ace_editor {
287
- position: relative;
288
- overflow: hidden;
289
- padding: 0;
290
- font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;
291
- direction: ltr;
292
- text-align: left;
293
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
294
- forced-color-adjust: none;
295
- }
296
-
297
- .ace_scroller {
298
- position: absolute;
299
- overflow: hidden;
300
- top: 0;
301
- bottom: 0;
302
- background-color: inherit;
303
- -ms-user-select: none;
304
- -moz-user-select: none;
305
- -webkit-user-select: none;
306
- user-select: none;
307
- cursor: text;
308
- }
309
-
310
- .ace_content {
311
- position: absolute;
312
- box-sizing: border-box;
313
- min-width: 100%;
314
- contain: style size layout;
315
- font-variant-ligatures: no-common-ligatures;
316
- }
317
- .ace_invisible {
318
- font-variant-ligatures: none;
319
- }
320
-
321
- .ace_keyboard-focus:focus {
322
- box-shadow: inset 0 0 0 2px #5E9ED6;
323
- outline: none;
324
- }
325
-
326
- .ace_dragging .ace_scroller:before{
327
- position: absolute;
328
- top: 0;
329
- left: 0;
330
- right: 0;
331
- bottom: 0;
332
- content: '';
333
- background: rgba(250, 250, 250, 0.01);
334
- z-index: 1000;
335
- }
336
- .ace_dragging.ace_dark .ace_scroller:before{
337
- background: rgba(0, 0, 0, 0.01);
338
- }
339
-
340
- .ace_gutter {
341
- position: absolute;
342
- overflow : hidden;
343
- width: auto;
344
- top: 0;
345
- bottom: 0;
346
- left: 0;
347
- cursor: default;
348
- z-index: 4;
349
- -ms-user-select: none;
350
- -moz-user-select: none;
351
- -webkit-user-select: none;
352
- user-select: none;
353
- contain: style size layout;
354
- }
355
-
356
- .ace_gutter-active-line {
357
- position: absolute;
358
- left: 0;
359
- right: 0;
360
- }
361
-
362
- .ace_scroller.ace_scroll-left:after {
363
- content: "";
364
- position: absolute;
365
- top: 0;
366
- right: 0;
367
- bottom: 0;
368
- left: 0;
369
- box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
370
- pointer-events: none;
371
- }
372
-
373
- .ace_gutter-cell, .ace_gutter-cell_svg-icons {
374
- position: absolute;
375
- top: 0;
376
- left: 0;
377
- right: 0;
378
- padding-left: 19px;
379
- padding-right: 6px;
380
- background-repeat: no-repeat;
381
- }
382
-
383
- .ace_gutter-cell_svg-icons .ace_gutter_annotation {
384
- margin-left: -14px;
385
- float: left;
386
- }
387
-
388
- .ace_gutter-cell .ace_gutter_annotation {
389
- margin-left: -19px;
390
- float: left;
391
- }
392
-
393
- .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 {
394
- 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==");
395
- background-repeat: no-repeat;
396
- background-position: 2px center;
397
- }
398
-
399
- .ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {
400
- 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==");
401
- background-repeat: no-repeat;
402
- background-position: 2px center;
403
- }
404
-
405
- .ace_gutter-cell.ace_info, .ace_icon.ace_info, .ace_gutter-cell.ace_hint, .ace_icon.ace_hint {
406
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");
407
- background-repeat: no-repeat;
408
- background-position: 2px center;
409
- }
410
-
411
- .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 {
412
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");
413
- }
414
-
415
- .ace_icon_svg.ace_error {
416
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");
417
- background-color: crimson;
418
- }
419
- .ace_icon_svg.ace_security {
420
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iZGFya29yYW5nZSIgZmlsbD0ibm9uZSIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogICAgICAgIDxwYXRoIGNsYXNzPSJzdHJva2UtbGluZWpvaW4tcm91bmQiIGQ9Ik04IDE0LjgzMDdDOCAxNC44MzA3IDIgMTIuOTA0NyAyIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOEM3Ljk4OTk5IDEuMzQ5MTggMTAuNjkgMy4yNjU0OCAxNCAzLjI2NTQ4VjguMDg5OTJDMTQgMTIuOTA0NyA4IDE0LjgzMDcgOCAxNC44MzA3WiIvPgogICAgICAgIDxwYXRoIGQ9Ik0yIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOCIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMy45OSA4LjA4OTkyVjMuMjY1NDhDMTAuNjggMy4yNjU0OCA4IDEuMzQ5MTggOCAxLjM0OTE4Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggNFY5Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggMTBWMTIiLz4KICAgIDwvZz4KPC9zdmc+");
421
- background-color: crimson;
422
- }
423
- .ace_icon_svg.ace_warning {
424
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");
425
- background-color: darkorange;
426
- }
427
- .ace_icon_svg.ace_info {
428
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");
429
- background-color: royalblue;
430
- }
431
- .ace_icon_svg.ace_hint {
432
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0ic2lsdmVyIiBmaWxsPSJub25lIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTYgMTRIMTAiLz4KICAgICAgICA8cGF0aCBkPSJNOCAxMUg5QzkgOS40NzAwMiAxMiA4LjU0MDAyIDEyIDUuNzYwMDJDMTIuMDIgNC40MDAwMiAxMS4zOSAzLjM2MDAyIDEwLjQzIDIuNjcwMDJDOSAxLjY0MDAyIDcuMDAwMDEgMS42NDAwMiA1LjU3MDAxIDIuNjcwMDJDNC42MTAwMSAzLjM2MDAyIDMuOTggNC40MDAwMiA0IDUuNzYwMDJDNCA4LjU0MDAyIDcuMDAwMDEgOS40NzAwMiA3LjAwMDAxIDExSDhaIi8+CiAgICA8L2c+Cjwvc3ZnPg==");
433
- background-color: silver;
434
- }
435
-
436
- .ace_icon_svg.ace_error_fold {
437
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
438
- background-color: crimson;
439
- }
440
- .ace_icon_svg.ace_security_fold {
441
- -webkit-mask-image: url("data:image/svg+xml;base64,CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTcgMTQiIGZpbGw9Im5vbmUiPgogICAgPHBhdGggZD0iTTEwLjAwMDEgMTMuNjk5MkMxMC4wMDAxIDEzLjY5OTIgMTEuOTI0MSAxMy40NzYzIDEzIDEyLjY5OTJDMTQuNDEzOSAxMS42NzgxIDE2IDEwLjUgMTYuMTI1MSA2LjgxMTI2VjIuNTg5ODdDMTYuMTI1MSAyLjU0NzY4IDE2LjEyMjEgMi41MDYxOSAxNi4xMTY0IDIuNDY1NTlWMS43MTQ4NUgxNS4yNDE0TDE1LjIzMDcgMS43MTQ4NEwxNC42MjUxIDEuNjk5MjJWNi44MTEyM0MxNC42MjUxIDguNTEwNjEgMTQuNjI1MSA5LjQ2NDYxIDEyLjc4MjQgMTEuNzIxQzEyLjE1ODYgMTIuNDg0OCAxMC4wMDAxIDEzLjY5OTIgMTAuMDAwMSAxMy42OTkyWiIgZmlsbD0iY3JpbXNvbiIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuMzM2MDkgMC4zNjc0NzVDNy4wMzIxNCAwLjE1MjY1MiA2LjYyNTQ4IDAuMTUzNjE0IDYuMzIyNTMgMC4zNjk5OTdMNi4zMDg2OSAwLjM3OTU1NEM2LjI5NTUzIDAuMzg4NTg4IDYuMjczODggMC40MDMyNjYgNi4yNDQxNyAwLjQyMjc4OUM2LjE4NDcxIDAuNDYxODYgNi4wOTMyMSAwLjUyMDE3MSA1Ljk3MzEzIDAuNTkxMzczQzUuNzMyNTEgMC43MzQwNTkgNS4zNzk5IDAuOTI2ODY0IDQuOTQyNzkgMS4xMjAwOUM0LjA2MTQ0IDEuNTA5NyAyLjg3NTQxIDEuODgzNzcgMS41ODk4NCAxLjg4Mzc3SDAuNzE0ODQ0VjIuNzU4NzdWNi45ODAxNUMwLjcxNDg0NCA5LjQ5Mzc0IDIuMjg4NjYgMTEuMTk3MyAzLjcwMjU0IDEyLjIxODVDNC40MTg0NSAxMi43MzU1IDUuMTI4NzQgMTMuMTA1MyA1LjY1NzMzIDEzLjM0NTdDNS45MjI4NCAxMy40NjY0IDYuMTQ1NjYgMTMuNTU1OSA2LjMwNDY1IDEzLjYxNjFDNi4zODQyMyAxMy42NDYyIDYuNDQ4MDUgMTMuNjY5IDYuNDkzNDkgMTMuNjg0OEM2LjUxNjIyIDEzLjY5MjcgNi41MzQzOCAxMy42OTg5IDYuNTQ3NjQgMTMuNzAzM0w2LjU2MzgyIDEzLjcwODdMNi41NjkwOCAxMy43MTA0TDYuNTcwOTkgMTMuNzExTDYuODM5ODQgMTMuNzUzM0w2LjU3MjQyIDEzLjcxMTVDNi43NDYzMyAxMy43NjczIDYuOTMzMzUgMTMuNzY3MyA3LjEwNzI3IDEzLjcxMTVMNy4xMDg3IDEzLjcxMUw3LjExMDYxIDEzLjcxMDRMNy4xMTU4NyAxMy43MDg3TDcuMTMyMDUgMTMuNzAzM0M3LjE0NTMxIDEzLjY5ODkgNy4xNjM0NiAxMy42OTI3IDcuMTg2MTkgMTMuNjg0OEM3LjIzMTY0IDEzLjY2OSA3LjI5NTQ2IDEzLjY0NjIgNy4zNzUwMyAxMy42MTYxQzcuNTM0MDMgMTMuNTU1OSA3Ljc1Njg1IDEzLjQ2NjQgOC4wMjIzNiAxMy4zNDU3QzguNTUwOTUgMTMuMTA1MyA5LjI2MTIzIDEyLjczNTUgOS45NzcxNSAxMi4yMTg1QzExLjM5MSAxMS4xOTczIDEyLjk2NDggOS40OTM3NyAxMi45NjQ4IDYuOTgwMThWMi43NTg4QzEyLjk2NDggMi43MTY2IDEyLjk2MTkgMi42NzUxMSAxMi45NTYxIDIuNjM0NTFWMS44ODM3N0gxMi4wODExQzEyLjA3NzUgMS44ODM3NyAxMi4wNzQgMS44ODM3NyAxMi4wNzA0IDEuODgzNzdDMTAuNzk3OSAxLjg4MDA0IDkuNjE5NjIgMS41MTEwMiA4LjczODk0IDEuMTI0ODZDOC43MzUzNCAxLjEyMzI3IDguNzMxNzQgMS4xMjE2OCA4LjcyODE0IDEuMTIwMDlDOC4yOTEwMyAwLjkyNjg2NCA3LjkzODQyIDAuNzM0MDU5IDcuNjk3NzkgMC41OTEzNzNDNy41Nzc3MiAwLjUyMDE3MSA3LjQ4NjIyIDAuNDYxODYgNy40MjY3NiAwLjQyMjc4OUM3LjM5NzA1IDAuNDAzMjY2IDcuMzc1MzkgMC4zODg1ODggNy4zNjIyNCAwLjM3OTU1NEw3LjM0ODk2IDAuMzcwMzVDNy4zNDg5NiAwLjM3MDM1IDcuMzQ4NDcgMC4zNzAwMiA3LjM0NTYzIDAuMzc0MDU0TDcuMzM3NzkgMC4zNjg2NTlMNy4zMzYwOSAwLjM2NzQ3NVpNOC4wMzQ3MSAyLjcyNjkxQzguODYwNCAzLjA5MDYzIDkuOTYwNjYgMy40NjMwOSAxMS4yMDYxIDMuNTg5MDdWNi45ODAxNUgxMS4yMTQ4QzExLjIxNDggOC42Nzk1MyAxMC4xNjM3IDkuOTI1MDcgOC45NTI1NCAxMC43OTk4QzguMzU1OTUgMTEuMjMwNiA3Ljc1Mzc0IDExLjU0NTQgNy4yOTc5NiAxMS43NTI3QzcuMTE2NzEgMTEuODM1MSA2Ljk2MDYyIDExLjg5OTYgNi44Mzk4NCAxMS45NDY5QzYuNzE5MDYgMTEuODk5NiA2LjU2Mjk3IDExLjgzNTEgNi4zODE3MyAxMS43NTI3QzUuOTI1OTUgMTEuNTQ1NCA1LjMyMzczIDExLjIzMDYgNC43MjcxNSAxMC43OTk4QzMuNTE2MDMgOS45MjUwNyAyLjQ2NDg0IDguNjc5NTUgMi40NjQ4NCA2Ljk4MDE4VjMuNTg5MDlDMy43MTczOCAzLjQ2MjM5IDQuODIzMDggMy4wODYzOSA1LjY1MDMzIDIuNzIwNzFDNi4xNDIyOCAyLjUwMzI0IDYuNTQ0ODUgMi4yODUzNyA2LjgzMjU0IDIuMTE2MjRDNy4xMjE4MSAyLjI4NTM1IDcuNTI3IDIuNTAzNTIgOC4wMjE5NiAyLjcyMTMxQzguMDI2MiAyLjcyMzE3IDguMDMwNDUgMi43MjUwNCA4LjAzNDcxIDIuNzI2OTFaTTUuOTY0ODQgMy40MDE0N1Y3Ljc3NjQ3SDcuNzE0ODRWMy40MDE0N0g1Ljk2NDg0Wk01Ljk2NDg0IDEwLjQwMTVWOC42NTE0N0g3LjcxNDg0VjEwLjQwMTVINS45NjQ4NFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
442
- background-color: crimson;
443
- }
444
- .ace_icon_svg.ace_warning_fold {
445
- -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");
446
- background-color: darkorange;
447
- }
448
-
449
- .ace_scrollbar {
450
- contain: strict;
451
- position: absolute;
452
- right: 0;
453
- bottom: 0;
454
- z-index: 6;
455
- }
456
-
457
- .ace_scrollbar-inner {
458
- position: absolute;
459
- cursor: text;
460
- left: 0;
461
- top: 0;
462
- }
463
-
464
- .ace_scrollbar-v{
465
- overflow-x: hidden;
466
- overflow-y: scroll;
467
- top: 0;
468
- }
469
-
470
- .ace_scrollbar-h {
471
- overflow-x: scroll;
472
- overflow-y: hidden;
473
- left: 0;
474
- }
475
-
476
- .ace_print-margin {
477
- position: absolute;
478
- height: 100%;
479
- }
480
-
481
- .ace_text-input {
482
- position: absolute;
483
- z-index: 0;
484
- width: 0.5em;
485
- height: 1em;
486
- opacity: 0;
487
- background: transparent;
488
- -moz-appearance: none;
489
- appearance: none;
490
- border: none;
491
- resize: none;
492
- outline: none;
493
- overflow: hidden;
494
- font: inherit;
495
- padding: 0 1px;
496
- margin: 0 -1px;
497
- contain: strict;
498
- -ms-user-select: text;
499
- -moz-user-select: text;
500
- -webkit-user-select: text;
501
- user-select: text;
502
- /*with \`pre-line\` chrome inserts &nbsp; instead of space*/
503
- white-space: pre!important;
504
- }
505
- .ace_text-input.ace_composition {
506
- background: transparent;
507
- color: inherit;
508
- z-index: 1000;
509
- opacity: 1;
510
- }
511
- .ace_composition_placeholder { color: transparent }
512
- .ace_composition_marker {
513
- border-bottom: 1px solid;
514
- position: absolute;
515
- border-radius: 0;
516
- margin-top: 1px;
517
- }
518
-
519
- [ace_nocontext=true] {
520
- transform: none!important;
521
- filter: none!important;
522
- clip-path: none!important;
523
- mask : none!important;
524
- contain: none!important;
525
- perspective: none!important;
526
- mix-blend-mode: initial!important;
527
- z-index: auto;
528
- }
529
-
530
- .ace_layer {
531
- z-index: 1;
532
- position: absolute;
533
- overflow: hidden;
534
- /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
535
- word-wrap: normal;
536
- white-space: pre;
537
- height: 100%;
538
- width: 100%;
539
- box-sizing: border-box;
540
- /* setting pointer-events: auto; on node under the mouse, which changes
541
- during scroll, will break mouse wheel scrolling in Safari */
542
- pointer-events: none;
543
- }
544
-
545
- .ace_gutter-layer {
546
- position: relative;
547
- width: auto;
548
- text-align: right;
549
- pointer-events: auto;
550
- height: 1000000px;
551
- contain: style size layout;
552
- }
553
-
554
- .ace_text-layer {
555
- font: inherit !important;
556
- position: absolute;
557
- height: 1000000px;
558
- width: 1000000px;
559
- contain: style size layout;
560
- }
561
-
562
- .ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {
563
- contain: style size layout;
564
- position: absolute;
565
- top: 0;
566
- left: 0;
567
- right: 0;
568
- }
569
-
570
- .ace_hidpi .ace_text-layer,
571
- .ace_hidpi .ace_gutter-layer,
572
- .ace_hidpi .ace_content,
573
- .ace_hidpi .ace_gutter {
574
- contain: strict;
575
- }
576
- .ace_hidpi .ace_text-layer > .ace_line,
577
- .ace_hidpi .ace_text-layer > .ace_line_group {
578
- contain: strict;
579
- }
580
-
581
- .ace_cjk {
582
- display: inline-block;
583
- text-align: center;
584
- }
585
-
586
- .ace_cursor-layer {
587
- z-index: 4;
588
- }
589
-
590
- .ace_cursor {
591
- z-index: 4;
592
- position: absolute;
593
- box-sizing: border-box;
594
- border-left: 2px solid;
595
- /* workaround for smooth cursor repaintng whole screen in chrome */
596
- transform: translatez(0);
597
- }
598
-
599
- .ace_multiselect .ace_cursor {
600
- border-left-width: 1px;
601
- }
602
-
603
- .ace_slim-cursors .ace_cursor {
604
- border-left-width: 1px;
605
- }
606
-
607
- .ace_overwrite-cursors .ace_cursor {
608
- border-left-width: 0;
609
- border-bottom: 1px solid;
610
- }
611
-
612
- .ace_hidden-cursors .ace_cursor {
613
- opacity: 0.2;
614
- }
615
-
616
- .ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {
617
- opacity: 0;
618
- }
619
-
620
- .ace_smooth-blinking .ace_cursor {
621
- transition: opacity 0.18s;
622
- }
623
-
624
- .ace_animate-blinking .ace_cursor {
625
- animation-duration: 1000ms;
626
- animation-timing-function: step-end;
627
- animation-name: blink-ace-animate;
628
- animation-iteration-count: infinite;
629
- }
630
-
631
- .ace_animate-blinking.ace_smooth-blinking .ace_cursor {
632
- animation-duration: 1000ms;
633
- animation-timing-function: ease-in-out;
634
- animation-name: blink-ace-animate-smooth;
635
- }
636
-
637
- @keyframes blink-ace-animate {
638
- from, to { opacity: 1; }
639
- 60% { opacity: 0; }
640
- }
641
-
642
- @keyframes blink-ace-animate-smooth {
643
- from, to { opacity: 1; }
644
- 45% { opacity: 1; }
645
- 60% { opacity: 0; }
646
- 85% { opacity: 0; }
647
- }
648
-
649
- .ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {
650
- position: absolute;
651
- z-index: 3;
652
- }
653
-
654
- .ace_marker-layer .ace_selection {
655
- position: absolute;
656
- z-index: 5;
657
- }
658
-
659
- .ace_marker-layer .ace_bracket {
660
- position: absolute;
661
- z-index: 6;
662
- }
663
-
664
- .ace_marker-layer .ace_error_bracket {
665
- position: absolute;
666
- border-bottom: 1px solid #DE5555;
667
- border-radius: 0;
668
- }
669
-
670
- .ace_marker-layer .ace_active-line {
671
- position: absolute;
672
- z-index: 2;
673
- }
674
-
675
- .ace_marker-layer .ace_selected-word {
676
- position: absolute;
677
- z-index: 4;
678
- box-sizing: border-box;
679
- }
680
-
681
- .ace_line .ace_fold {
682
- box-sizing: border-box;
683
-
684
- display: inline-block;
685
- height: 11px;
686
- margin-top: -2px;
687
- vertical-align: middle;
688
-
689
- background-image:
690
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
691
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
692
- background-repeat: no-repeat, repeat-x;
693
- background-position: center center, top left;
694
- color: transparent;
695
-
696
- border: 1px solid black;
697
- border-radius: 2px;
698
-
699
- cursor: pointer;
700
- pointer-events: auto;
701
- }
702
-
703
- .ace_dark .ace_fold {
704
- }
705
-
706
- .ace_fold:hover{
707
- background-image:
708
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
709
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
710
- }
711
-
712
- .ace_tooltip {
713
- background-color: #f5f5f5;
714
- border: 1px solid gray;
715
- border-radius: 1px;
716
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
717
- color: black;
718
- padding: 3px 4px;
719
- position: fixed;
720
- z-index: 999999;
721
- box-sizing: border-box;
722
- cursor: default;
723
- white-space: pre-wrap;
724
- word-wrap: break-word;
725
- line-height: normal;
726
- font-style: normal;
727
- font-weight: normal;
728
- letter-spacing: normal;
729
- pointer-events: none;
730
- overflow: auto;
731
- max-width: min(33em, 66vw);
732
- overscroll-behavior: contain;
733
- }
734
- .ace_tooltip pre {
735
- white-space: pre-wrap;
736
- }
737
-
738
- .ace_tooltip.ace_dark {
739
- background-color: #636363;
740
- color: #fff;
741
- }
742
-
743
- .ace_tooltip:focus {
744
- outline: 1px solid #5E9ED6;
745
- }
746
-
747
- .ace_icon {
748
- display: inline-block;
749
- width: 18px;
750
- vertical-align: top;
751
- }
752
-
753
- .ace_icon_svg {
754
- display: inline-block;
755
- width: 12px;
756
- vertical-align: top;
757
- -webkit-mask-repeat: no-repeat;
758
- -webkit-mask-size: 12px;
759
- -webkit-mask-position: center;
760
- }
761
-
762
- .ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {
763
- padding-right: 13px;
764
- }
765
-
766
- .ace_fold-widget, .ace_custom-widget {
767
- box-sizing: border-box;
768
-
769
- margin: 0 -12px 0 1px;
770
- display: none;
771
- width: 11px;
772
- vertical-align: top;
773
-
774
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");
775
- background-repeat: no-repeat;
776
- background-position: center;
777
-
778
- border-radius: 3px;
779
-
780
- border: 1px solid transparent;
781
- cursor: pointer;
782
- }
783
-
784
- .ace_custom-widget {
785
- background: none;
786
- }
787
-
788
- .ace_folding-enabled .ace_fold-widget {
789
- display: inline-block;
790
- }
791
-
792
- .ace_fold-widget.ace_end {
793
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");
794
- }
795
-
796
- .ace_fold-widget.ace_closed {
797
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");
798
- }
799
-
800
- .ace_fold-widget:hover {
801
- border: 1px solid rgba(0, 0, 0, 0.3);
802
- background-color: rgba(255, 255, 255, 0.2);
803
- box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
804
- }
805
-
806
- .ace_fold-widget:active {
807
- border: 1px solid rgba(0, 0, 0, 0.4);
808
- background-color: rgba(0, 0, 0, 0.05);
809
- box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
810
- }
811
- /**
812
- * Dark version for fold widgets
813
- */
814
- .ace_dark .ace_fold-widget {
815
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");
816
- }
817
- .ace_dark .ace_fold-widget.ace_end {
818
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");
819
- }
820
- .ace_dark .ace_fold-widget.ace_closed {
821
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");
822
- }
823
- .ace_dark .ace_fold-widget:hover {
824
- box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
825
- background-color: rgba(255, 255, 255, 0.1);
826
- }
827
- .ace_dark .ace_fold-widget:active {
828
- box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
829
- }
830
-
831
- .ace_inline_button {
832
- border: 1px solid lightgray;
833
- display: inline-block;
834
- margin: -1px 8px;
835
- padding: 0 5px;
836
- pointer-events: auto;
837
- cursor: pointer;
838
- }
839
- .ace_inline_button:hover {
840
- border-color: gray;
841
- background: rgba(200,200,200,0.2);
842
- display: inline-block;
843
- pointer-events: auto;
844
- }
845
-
846
- .ace_fold-widget.ace_invalid {
847
- background-color: #FFB4B4;
848
- border-color: #DE5555;
849
- }
850
-
851
- .ace_fade-fold-widgets .ace_fold-widget {
852
- transition: opacity 0.4s ease 0.05s;
853
- opacity: 0;
854
- }
855
-
856
- .ace_fade-fold-widgets:hover .ace_fold-widget {
857
- transition: opacity 0.05s ease 0.05s;
858
- opacity:1;
859
- }
860
-
861
- .ace_underline {
862
- text-decoration: underline;
863
- }
864
-
865
- .ace_bold {
866
- font-weight: bold;
867
- }
868
-
869
- .ace_nobold .ace_bold {
870
- font-weight: normal;
871
- }
872
-
873
- .ace_italic {
874
- font-style: italic;
875
- }
876
-
877
-
878
- .ace_error-marker {
879
- background-color: rgba(255, 0, 0,0.2);
880
- position: absolute;
881
- z-index: 9;
882
- }
883
-
884
- .ace_highlight-marker {
885
- background-color: rgba(255, 255, 0,0.2);
886
- position: absolute;
887
- z-index: 8;
888
- }
889
-
890
- .ace_mobile-menu {
891
- position: absolute;
892
- line-height: 1.5;
893
- border-radius: 4px;
894
- -ms-user-select: none;
895
- -moz-user-select: none;
896
- -webkit-user-select: none;
897
- user-select: none;
898
- background: white;
899
- box-shadow: 1px 3px 2px grey;
900
- border: 1px solid #dcdcdc;
901
- color: black;
902
- }
903
- .ace_dark > .ace_mobile-menu {
904
- background: #333;
905
- color: #ccc;
906
- box-shadow: 1px 3px 2px grey;
907
- border: 1px solid #444;
908
-
909
- }
910
- .ace_mobile-button {
911
- padding: 2px;
912
- cursor: pointer;
913
- overflow: hidden;
914
- }
915
- .ace_mobile-button:hover {
916
- background-color: #eee;
917
- opacity:1;
918
- }
919
- .ace_mobile-button:active {
920
- background-color: #ddd;
921
- }
922
-
923
- .ace_placeholder {
924
- position: relative;
925
- font-family: arial;
926
- transform: scale(0.9);
927
- transform-origin: left;
928
- white-space: pre;
929
- opacity: 0.7;
930
- margin: 0 10px;
931
- z-index: 1;
932
- }
933
-
934
- .ace_ghost_text {
935
- opacity: 0.5;
936
- font-style: italic;
937
- }
938
-
939
- .ace_ghost_text_container > div {
940
- white-space: pre;
941
- }
942
-
943
- .ghost_text_line_wrapped::after {
944
- content: "↩";
945
- position: absolute;
946
- }
947
-
948
- .ace_lineWidgetContainer.ace_ghost_text {
949
- margin: 0px 4px
950
- }
951
-
952
- .ace_screenreader-only {
953
- position:absolute;
954
- left:-10000px;
955
- top:auto;
956
- width:1px;
957
- height:1px;
958
- overflow:hidden;
959
- }
960
-
961
- .ace_hidden_token {
962
- display: none;
963
- }`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(n,u,v){var a=n("../lib/dom"),h=n("../lib/oop"),d=n("../lib/event_emitter").EventEmitter,o=function(){function p(e,t){this.canvas=a.createElement("canvas"),this.renderer=t,this.pixelRatio=1,this.maxHeight=t.layerConfig.maxHeight,this.lineHeight=t.layerConfig.lineHeight,this.canvasHeight=e.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=e.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",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)"},e.element.appendChild(this.canvas)}return p.prototype.$updateDecorators=function(e){var t=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(e){this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height;var r=(e.lastRow+1)*this.lineHeight;r<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight}var l=this.canvas.getContext("2d");function s(R,x){return R.priority<x.priority?-1:R.priority>x.priority?1:0}var c=this.renderer.session.$annotations;if(l.clearRect(0,0,this.canvas.width,this.canvas.height),c){var f={info:1,warning:2,error:3};c.forEach(function(R){R.priority=f[R.type]||null}),c=c.sort(s);for(var m=this.renderer.session.$foldData,y=0;y<c.length;y++){var D=c[y].row,E=this.compensateFoldRows(D,m),b=Math.round((D-E)*this.lineHeight*this.heightRatio),g=Math.round((D-E)*this.lineHeight*this.heightRatio),S=Math.round(((D-E)*this.lineHeight+this.lineHeight)*this.heightRatio),T=S-g;if(T<this.minDecorationHeight){var k=(g+S)/2|0;k<this.halfMinDecorationHeight?k=this.halfMinDecorationHeight:k+this.halfMinDecorationHeight>this.canvasHeight&&(k=this.canvasHeight-this.halfMinDecorationHeight),g=Math.round(k-this.halfMinDecorationHeight),S=Math.round(k+this.halfMinDecorationHeight)}l.fillStyle=t[c[y].type]||null,l.fillRect(0,b,this.canvasWidth,S-g)}}var _=this.renderer.session.selection.getCursor();if(_){var E=this.compensateFoldRows(_.row,m),b=Math.round((_.row-E)*this.lineHeight*this.heightRatio);l.fillStyle="rgba(0, 0, 0, 0.5)",l.fillRect(0,b,this.canvasWidth,2)}},p.prototype.compensateFoldRows=function(e,t){var r=0;if(t&&t.length>0)for(var l=0;l<t.length;l++)e>t[l].start.row&&e<t[l].end.row?r+=e-t[l].start.row:e>=t[l].end.row&&(r+=t[l].end.row-t[l].start.row);return r},p}();h.implement(o.prototype,d),u.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(n,u,v){var a=n("./lib/oop"),h=n("./lib/dom"),d=n("./lib/lang"),o=n("./config"),p=n("./layer/gutter").Gutter,e=n("./layer/marker").Marker,t=n("./layer/text").Text,r=n("./layer/cursor").Cursor,l=n("./scrollbar").HScrollBar,s=n("./scrollbar").VScrollBar,c=n("./scrollbar_custom").HScrollBar,f=n("./scrollbar_custom").VScrollBar,m=n("./renderloop").RenderLoop,y=n("./layer/font_metrics").FontMetrics,D=n("./lib/event_emitter").EventEmitter,E=n("./css/editor-css"),b=n("./layer/decorators").Decorator,g=n("./lib/useragent"),S=n("./layer/text_util").isTextToken;h.importCssString(E,"ace_editor.css",!1);var T=function(){function k(_,R){var x=this;this.container=_||h.createElement("div"),h.addCssClass(this.container,"ace_editor"),h.HI_DPI&&h.addCssClass(this.container,"ace_hidpi"),this.setTheme(R),o.get("useStrictCSP")==null&&o.set("useStrictCSP",!1),this.$gutter=h.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=h.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=h.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new p(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new e(this.content);var A=this.$textLayer=new t(this.content);this.canvas=A.element,this.$markerFront=new e(this.content),this.$cursorLayer=new r(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new s(this.container,this),this.scrollBarH=new l(this.container,this),this.scrollBarV.on("scroll",function(C){x.$scrollAnimation||x.session.setScrollTop(C.data-x.scrollMargin.top)}),this.scrollBarH.on("scroll",function(C){x.$scrollAnimation||x.session.setScrollLeft(C.data-x.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new y(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(C){x.updateCharacterSize(),x.onResize(!0,x.gutterWidth,x.$size.width,x.$size.height),x._signal("changeCharacterSize",C)}),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=!g.isIOS,this.$loop=new m(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 k.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(),h.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},k.prototype.setSession=function(_){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=_,_&&this.scrollMargin.top&&_.getScrollTop()<=0&&_.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(_),this.$markerBack.setSession(_),this.$markerFront.setSession(_),this.$gutterLayer.setSession(_),this.$textLayer.setSession(_),_&&(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))},k.prototype.updateLines=function(_,R,x){if(R===void 0&&(R=1/0),this.$changedLines?(this.$changedLines.firstRow>_&&(this.$changedLines.firstRow=_),this.$changedLines.lastRow<R&&(this.$changedLines.lastRow=R)):this.$changedLines={firstRow:_,lastRow:R},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)},k.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},k.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},k.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},k.prototype.updateFull=function(_){_?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},k.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},k.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},k.prototype.onResize=function(_,R,x,A){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=_?1:0;var C=this.container;A||(A=C.clientHeight||C.scrollHeight),!A&&this.$maxLines&&this.lineHeight>1&&(!C.style.height||C.style.height=="0px")&&(C.style.height="1px",A=C.clientHeight||C.scrollHeight),x||(x=C.clientWidth||C.scrollWidth);var w=this.$updateCachedSize(_,R,x,A);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!x&&!A)return this.resizing=0;_&&(this.$gutterLayer.$padding=null),_?this.$renderChanges(w|this.$changes,!0):this.$loop.schedule(w|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},k.prototype.$updateCachedSize=function(_,R,x,A){A-=this.$extraHeight||0;var C=0,w=this.$size,$={width:w.width,height:w.height,scrollerHeight:w.scrollerHeight,scrollerWidth:w.scrollerWidth};if(A&&(_||w.height!=A)&&(w.height=A,C|=this.CHANGE_SIZE,w.scrollerHeight=w.height,this.$horizScroll&&(w.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(w.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",C=C|this.CHANGE_SCROLL),x&&(_||w.width!=x)){C|=this.CHANGE_SIZE,w.width=x,R==null&&(R=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=R,h.setStyle(this.scrollBarH.element.style,"left",R+"px"),h.setStyle(this.scroller.style,"left",R+this.margin.left+"px"),w.scrollerWidth=Math.max(0,x-R-this.scrollBarV.getWidth()-this.margin.h),h.setStyle(this.$gutter.style,"left",this.margin.left+"px");var I=this.scrollBarV.getWidth()+"px";h.setStyle(this.scrollBarH.element.style,"right",I),h.setStyle(this.scroller.style,"right",I),h.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(w.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||_)&&(C|=this.CHANGE_FULL)}return w.$dirty=!x||!A,C&&this._signal("resize",$),C},k.prototype.onGutterResize=function(_){var R=this.$showGutter?_:0;R!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,R,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()},k.prototype.adjustWrapLimit=function(){var _=this.$size.scrollerWidth-this.$padding*2,R=Math.floor(_/this.characterWidth);return this.session.adjustWrapLimit(R,this.$showPrintMargin&&this.$printMarginColumn)},k.prototype.setAnimatedScroll=function(_){this.setOption("animatedScroll",_)},k.prototype.getAnimatedScroll=function(){return this.$animatedScroll},k.prototype.setShowInvisibles=function(_){this.setOption("showInvisibles",_),this.session.$bidiHandler.setShowInvisibles(_)},k.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},k.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},k.prototype.setDisplayIndentGuides=function(_){this.setOption("displayIndentGuides",_)},k.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},k.prototype.setHighlightIndentGuides=function(_){this.setOption("highlightIndentGuides",_)},k.prototype.setShowPrintMargin=function(_){this.setOption("showPrintMargin",_)},k.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},k.prototype.setPrintMarginColumn=function(_){this.setOption("printMarginColumn",_)},k.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},k.prototype.getShowGutter=function(){return this.getOption("showGutter")},k.prototype.setShowGutter=function(_){return this.setOption("showGutter",_)},k.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},k.prototype.setFadeFoldWidgets=function(_){this.setOption("fadeFoldWidgets",_)},k.prototype.setHighlightGutterLine=function(_){this.setOption("highlightGutterLine",_)},k.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},k.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var _=h.createElement("div");_.className="ace_layer ace_print-margin-layer",this.$printMarginEl=h.createElement("div"),this.$printMarginEl.className="ace_print-margin",_.appendChild(this.$printMarginEl),this.content.insertBefore(_,this.content.firstChild)}var R=this.$printMarginEl.style;R.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",R.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},k.prototype.getContainerElement=function(){return this.container},k.prototype.getMouseEventTarget=function(){return this.scroller},k.prototype.getTextAreaContainer=function(){return this.container},k.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var _=this.textarea.style,R=this.$composition;if(!this.$keepTextAreaAtCursor&&!R){h.translate(this.textarea,-100,0);return}var x=this.$cursorLayer.$pixelPos;if(x){R&&R.markerRange&&(x=this.$cursorLayer.getPixelPosition(R.markerRange.start,!0));var A=this.layerConfig,C=x.top,w=x.left;C-=A.offset;var $=R&&R.useTextareaForIME||g.isMobile?this.lineHeight:1;if(C<0||C>A.height-$){h.translate(this.textarea,0,0);return}var I=1,F=this.$size.height-$;if(!R)C+=this.lineHeight;else if(R.useTextareaForIME){var O=this.textarea.value;I=this.characterWidth*this.session.$getStringScreenWidth(O)[0]}else C+=this.lineHeight+2;w-=this.scrollLeft,w>this.$size.scrollerWidth-I&&(w=this.$size.scrollerWidth-I),w+=this.gutterWidth+this.margin.left,h.setStyle(_,"height",$+"px"),h.setStyle(_,"width",I+"px"),h.translate(this.textarea,Math.min(w,this.$size.scrollerWidth-I),Math.min(C,F))}}},k.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},k.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},k.prototype.getLastFullyVisibleRow=function(){var _=this.layerConfig,R=_.lastRow,x=this.session.documentToScreenRow(R,0)*_.lineHeight;return x-this.session.getScrollTop()>_.height-_.lineHeight?R-1:R},k.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},k.prototype.setPadding=function(_){this.$padding=_,this.$textLayer.setPadding(_),this.$cursorLayer.setPadding(_),this.$markerFront.setPadding(_),this.$markerBack.setPadding(_),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},k.prototype.setScrollMargin=function(_,R,x,A){var C=this.scrollMargin;C.top=_|0,C.bottom=R|0,C.right=A|0,C.left=x|0,C.v=C.top+C.bottom,C.h=C.left+C.right,C.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-C.top),this.updateFull()},k.prototype.setMargin=function(_,R,x,A){var C=this.margin;C.top=_|0,C.bottom=R|0,C.right=A|0,C.left=x|0,C.v=C.top+C.bottom,C.h=C.left+C.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},k.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},k.prototype.setHScrollBarAlwaysVisible=function(_){this.setOption("hScrollBarAlwaysVisible",_)},k.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},k.prototype.setVScrollBarAlwaysVisible=function(_){this.setOption("vScrollBarAlwaysVisible",_)},k.prototype.$updateScrollBarV=function(){var _=this.layerConfig.maxHeight,R=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(_-=(R-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>_-R&&(_=this.scrollTop+R,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(_+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},k.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},k.prototype.freeze=function(){this.$frozen=!0},k.prototype.unfreeze=function(){this.$frozen=!1},k.prototype.$renderChanges=function(_,R){if(this.$changes&&(_|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!_&&!R){this.$changes|=_;return}if(this.$size.$dirty)return this.$changes|=_,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",_),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var x=this.layerConfig;if(_&this.CHANGE_FULL||_&this.CHANGE_SIZE||_&this.CHANGE_TEXT||_&this.CHANGE_LINES||_&this.CHANGE_SCROLL||_&this.CHANGE_H_SCROLL){if(_|=this.$computeLayerConfig()|this.$loop.clear(),x.firstRow!=this.layerConfig.firstRow&&x.firstRowScreen==this.layerConfig.firstRowScreen){var A=this.scrollTop+(x.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;A>0&&(this.scrollTop=A,_=_|this.CHANGE_SCROLL,_|=this.$computeLayerConfig()|this.$loop.clear())}x=this.layerConfig,this.$updateScrollBarV(),_&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),h.translate(this.content,-this.scrollLeft,-x.offset);var C=x.width+2*this.$padding+"px",w=x.minHeight+"px";h.setStyle(this.content.style,"width",C),h.setStyle(this.content.style,"height",w)}if(_&this.CHANGE_H_SCROLL&&(h.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)),_&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",_);return}if(_&this.CHANGE_SCROLL){this.$changedLines=null,_&this.CHANGE_TEXT||_&this.CHANGE_LINES?this.$textLayer.update(x):this.$textLayer.scrollLines(x),this.$showGutter&&(_&this.CHANGE_GUTTER||_&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",_);return}_&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(x),this.$showGutter&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)):_&this.CHANGE_LINES?((this.$updateLines()||_&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)):_&this.CHANGE_TEXT||_&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)):_&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)),_&this.CHANGE_CURSOR&&(this.$cursorLayer.update(x),this.$moveTextAreaToCursor()),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(x),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(x),this._signal("afterRender",_)},k.prototype.$autosize=function(){var _=this.session.getScreenLength()*this.lineHeight,R=this.$maxLines*this.lineHeight,x=Math.min(R,Math.max((this.$minLines||1)*this.lineHeight,_))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(x+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&x>this.$maxPixelHeight&&(x=this.$maxPixelHeight);var A=x<=2*this.lineHeight,C=!A&&_>R;if(x!=this.desiredHeight||this.$size.height!=this.desiredHeight||C!=this.$vScroll){C!=this.$vScroll&&(this.$vScroll=C,this.scrollBarV.setVisible(C));var w=this.container.clientWidth;this.container.style.height=x+"px",this.$updateCachedSize(!0,this.$gutterWidth,w,x),this.desiredHeight=x,this._signal("autosize")}},k.prototype.$computeLayerConfig=function(){var _=this.session,R=this.$size,x=R.height<=2*this.lineHeight,A=this.session.getScreenLength(),C=A*this.lineHeight,w=this.$getLongestLine(),$=!x&&(this.$hScrollBarAlwaysVisible||R.scrollerWidth-w-2*this.$padding<0),I=this.$horizScroll!==$;I&&(this.$horizScroll=$,this.scrollBarH.setVisible($));var F=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),x=R.height<=2*this.lineHeight);var O=R.scrollerHeight+this.lineHeight,B=!this.$maxLines&&this.$scrollPastEnd?(R.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;C+=B;var P=this.scrollMargin;this.session.setScrollTop(Math.max(-P.top,Math.min(this.scrollTop,C-R.scrollerHeight+P.bottom))),this.session.setScrollLeft(Math.max(-P.left,Math.min(this.scrollLeft,w+2*this.$padding-R.scrollerWidth+P.right)));var V=!x&&(this.$vScrollBarAlwaysVisible||R.scrollerHeight-C+B<0||this.scrollTop>P.top),W=F!==V;W&&(this.$vScroll=V,this.scrollBarV.setVisible(V));var H=this.scrollTop%this.lineHeight,U=Math.ceil(O/this.lineHeight)-1,G=Math.max(0,Math.round((this.scrollTop-H)/this.lineHeight)),Y=G+U,Q,ee,ne=this.lineHeight;G=_.screenToDocumentRow(G,0);var se=_.getFoldLine(G);se&&(G=se.start.row),Q=_.documentToScreenRow(G,0),ee=_.getRowLength(G)*ne,Y=Math.min(_.screenToDocumentRow(Y,0),_.getLength()-1),O=R.scrollerHeight+_.getRowLength(Y)*ne+ee,H=this.scrollTop-Q*ne;var ge=0;return(this.layerConfig.width!=w||I)&&(ge=this.CHANGE_H_SCROLL),(I||W)&&(ge|=this.$updateCachedSize(!0,this.gutterWidth,R.width,R.height),this._signal("scrollbarVisibilityChanged"),W&&(w=this.$getLongestLine())),this.layerConfig={width:w,padding:this.$padding,firstRow:G,firstRowScreen:Q,lastRow:Y,lineHeight:ne,characterWidth:this.characterWidth,minHeight:O,maxHeight:C,offset:H,gutterOffset:ne?Math.max(0,Math.ceil((H+R.height-R.scrollerHeight)/ne)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(w-this.$padding),ge},k.prototype.$updateLines=function(){if(this.$changedLines){var _=this.$changedLines.firstRow,R=this.$changedLines.lastRow;this.$changedLines=null;var x=this.layerConfig;if(!(_>x.lastRow+1)&&!(R<x.firstRow)){if(R===1/0){this.$showGutter&&this.$gutterLayer.update(x),this.$textLayer.update(x);return}return this.$textLayer.updateLines(x,_,R),!0}}},k.prototype.$getLongestLine=function(){var _=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(_+=1),this.$textLayer&&_>this.$textLayer.MAX_LINE_LENGTH&&(_=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(_*this.characterWidth))},k.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},k.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},k.prototype.addGutterDecoration=function(_,R){this.$gutterLayer.addGutterDecoration(_,R)},k.prototype.removeGutterDecoration=function(_,R){this.$gutterLayer.removeGutterDecoration(_,R)},k.prototype.updateBreakpoints=function(_){this._rows=_,this.$loop.schedule(this.CHANGE_GUTTER)},k.prototype.setAnnotations=function(_){this.$gutterLayer.setAnnotations(_),this.$loop.schedule(this.CHANGE_GUTTER)},k.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},k.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},k.prototype.showCursor=function(){this.$cursorLayer.showCursor()},k.prototype.scrollSelectionIntoView=function(_,R,x){this.scrollCursorIntoView(_,x),this.scrollCursorIntoView(R,x)},k.prototype.scrollCursorIntoView=function(_,R,x){if(this.$size.scrollerHeight!==0){var A=this.$cursorLayer.getPixelPosition(_),C=A.left,w=A.top,$=x&&x.top||0,I=x&&x.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var F=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;F+$>w?(R&&F+$>w+this.lineHeight&&(w-=R*this.$size.scrollerHeight),w===0&&(w=-this.scrollMargin.top),this.session.setScrollTop(w)):F+this.$size.scrollerHeight-I<w+this.lineHeight&&(R&&F+this.$size.scrollerHeight-I<w-this.lineHeight&&(w+=R*this.$size.scrollerHeight),this.session.setScrollTop(w+this.lineHeight+I-this.$size.scrollerHeight));var O=this.scrollLeft,B=2*this.layerConfig.characterWidth;C-B<O?(C-=B,C<this.$padding+B&&(C=-this.scrollMargin.left),this.session.setScrollLeft(C)):(C+=B,O+this.$size.scrollerWidth<C+this.characterWidth?this.session.setScrollLeft(Math.round(C+this.characterWidth-this.$size.scrollerWidth)):O<=this.$padding&&C-O<this.characterWidth&&this.session.setScrollLeft(0))}},k.prototype.getScrollTop=function(){return this.session.getScrollTop()},k.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},k.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},k.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},k.prototype.scrollToRow=function(_){this.session.setScrollTop(_*this.lineHeight)},k.prototype.alignCursor=function(_,R){typeof _=="number"&&(_={row:_,column:0});var x=this.$cursorLayer.getPixelPosition(_),A=this.$size.scrollerHeight-this.lineHeight,C=x.top-A*(R||0);return this.session.setScrollTop(C),C},k.prototype.$calcSteps=function(_,R){var x=0,A=this.STEPS,C=[],w=function($,I,F){return F*(Math.pow($-1,3)+1)+I};for(x=0;x<A;++x)C.push(w(x/this.STEPS,_,R-_));return C},k.prototype.scrollToLine=function(_,R,x,A){var C=this.$cursorLayer.getPixelPosition({row:_,column:0}),w=C.top;R&&(w-=this.$size.scrollerHeight/2);var $=this.scrollTop;this.session.setScrollTop(w),x!==!1&&this.animateScrolling($,A)},k.prototype.animateScrolling=function(_,R){var x=this.scrollTop;if(!this.$animatedScroll)return;var A=this;if(_==x)return;if(this.$scrollAnimation){var C=this.$scrollAnimation.steps;if(C.length&&(_=C[0],_==x))return}var w=A.$calcSteps(_,x);this.$scrollAnimation={from:_,to:x,steps:w},clearInterval(this.$timer),A.session.setScrollTop(w.shift()),A.session.$scrollTop=x;function $(){A.$timer=clearInterval(A.$timer),A.$scrollAnimation=null,A.$stopAnimation=!1,R&&R()}this.$timer=setInterval(function(){if(A.$stopAnimation){$();return}if(!A.session)return clearInterval(A.$timer);w.length?(A.session.setScrollTop(w.shift()),A.session.$scrollTop=x):x!=null?(A.session.$scrollTop=-1,A.session.setScrollTop(x),x=null):$()},10)},k.prototype.scrollToY=function(_){this.scrollTop!==_&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=_)},k.prototype.scrollToX=function(_){this.scrollLeft!==_&&(this.scrollLeft=_),this.$loop.schedule(this.CHANGE_H_SCROLL)},k.prototype.scrollTo=function(_,R){this.session.setScrollTop(R),this.session.setScrollLeft(_)},k.prototype.scrollBy=function(_,R){R&&this.session.setScrollTop(this.session.getScrollTop()+R),_&&this.session.setScrollLeft(this.session.getScrollLeft()+_)},k.prototype.isScrollableBy=function(_,R){if(R<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||R>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||_<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||_>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},k.prototype.pixelToScreenCoordinates=function(_,R){var x;if(this.$hasCssTransforms){x={top:0,left:0};var A=this.$fontMetrics.transformCoordinates([_,R]);_=A[1]-this.gutterWidth-this.margin.left,R=A[0]}else x=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-x.left-this.$padding,w=C/this.characterWidth,$=Math.floor((R+this.scrollTop-x.top)/this.lineHeight),I=this.$blockCursor?Math.floor(w):Math.round(w);return{row:$,column:I,side:w-I>0?1:-1,offsetX:C}},k.prototype.screenToTextCoordinates=function(_,R){var x;if(this.$hasCssTransforms){x={top:0,left:0};var A=this.$fontMetrics.transformCoordinates([_,R]);_=A[1]-this.gutterWidth-this.margin.left,R=A[0]}else x=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-x.left-this.$padding,w=C/this.characterWidth,$=this.$blockCursor?Math.floor(w):Math.round(w),I=Math.floor((R+this.scrollTop-x.top)/this.lineHeight);return this.session.screenToDocumentPosition(I,Math.max($,0),C)},k.prototype.textToScreenCoordinates=function(_,R){var x=this.scroller.getBoundingClientRect(),A=this.session.documentToScreenPosition(_,R),C=this.$padding+(this.session.$bidiHandler.isBidiRow(A.row,_)?this.session.$bidiHandler.getPosLeft(A.column):Math.round(A.column*this.characterWidth)),w=A.row*this.lineHeight;return{pageX:x.left+C-this.scrollLeft,pageY:x.top+w-this.scrollTop}},k.prototype.visualizeFocus=function(){h.addCssClass(this.container,"ace_focus")},k.prototype.visualizeBlur=function(){h.removeCssClass(this.container,"ace_focus")},k.prototype.showComposition=function(_){this.$composition=_,_.cssText||(_.cssText=this.textarea.style.cssText),_.useTextareaForIME==null&&(_.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(h.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):_.markerId=this.session.addMarker(_.markerRange,"ace_composition_marker","text")},k.prototype.setCompositionText=function(_){var R=this.session.selection.cursor;this.addToken(_,"composition_placeholder",R.row,R.column),this.$moveTextAreaToCursor()},k.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),h.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var _=this.session.selection.cursor;this.removeExtraToken(_.row,_.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},k.prototype.setGhostText=function(_,R){var x=this.session.selection.cursor,A=R||{row:x.row,column:x.column};this.removeGhostText();var C=this.$calculateWrappedTextChunks(_,A);this.addToken(C[0].text,"ghost_text",A.row,A.column),this.$ghostText={text:_,position:{row:A.row,column:A.column}};var w=h.createElement("div");if(C.length>1){var $=this.hideTokensAfterPosition(A.row,A.column),I;C.slice(1).forEach(function(W){var H=h.createElement("div"),U=h.createElement("span");U.className="ace_ghost_text",W.wrapped&&(H.className="ghost_text_line_wrapped"),W.text.length===0&&(W.text=" "),U.appendChild(h.createTextNode(W.text)),H.appendChild(U),w.appendChild(H),I=H}),$.forEach(function(W){var H=h.createElement("span");S(W.type)||(H.className="ace_"+W.type.replace(/\./g," ace_")),H.appendChild(h.createTextNode(W.value)),I.appendChild(H)}),this.$ghostTextWidget={el:w,row:A.row,column:A.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var F=this.$cursorLayer.getPixelPosition(A,!0),O=this.container,B=O.getBoundingClientRect().height,P=C.length*this.lineHeight,V=P<B-F.top;if(V)return;P<B?this.scrollBy(0,(C.length-1)*this.lineHeight):this.scrollToRow(A.row)}},k.prototype.$calculateWrappedTextChunks=function(_,R){var x=this.$size.scrollerWidth-this.$padding*2,A=Math.floor(x/this.characterWidth)-2;A=A<=0?60:A;for(var C=_.split(/\r?\n/),w=[],$=0;$<C.length;$++){var I=this.session.$getDisplayTokens(C[$],R.column),F=this.session.$computeWrapSplits(I,A,this.session.$tabSize);if(F.length>0){var O=0;F.push(C[$].length);for(var B=0;B<F.length;B++){var P=C[$].slice(O,F[B]);w.push({text:P,wrapped:!0}),O=F[B]}}else w.push({text:C[$],wrapped:!1})}return w},k.prototype.removeGhostText=function(){if(this.$ghostText){var _=this.$ghostText.position;this.removeExtraToken(_.row,_.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},k.prototype.addToken=function(_,R,x,A){var C=this.session;C.bgTokenizer.lines[x]=null;var w={type:R,value:_},$=C.getTokens(x);if(A==null||!$.length)$.push(w);else for(var I=0,F=0;F<$.length;F++){var O=$[F];if(I+=O.value.length,A<=I){var B=O.value.length-(I-A),P=O.value.slice(0,B),V=O.value.slice(B);$.splice(F,1,{type:O.type,value:P},w,{type:O.type,value:V});break}}this.updateLines(x,x)},k.prototype.hideTokensAfterPosition=function(_,R){for(var x=this.session.getTokens(_),A=0,C=!1,w=[],$=0;$<x.length;$++){var I=x[$];if(A+=I.value.length,I.type!=="ghost_text"){if(C){w.push({type:I.type,value:I.value}),I.type="hidden_token";continue}A===R&&(C=!0)}}return this.updateLines(_,_),w},k.prototype.removeExtraToken=function(_,R){this.session.bgTokenizer.lines[_]=null,this.updateLines(_,_)},k.prototype.setTheme=function(_,R){var x=this;if(this.$themeId=_,x._dispatchEvent("themeChange",{theme:_}),!_||typeof _=="string"){var A=_||this.$options.theme.initialValue;o.loadModule(["theme",A],C)}else C(_);function C(w){if(x.$themeId!=_)return R&&R();if(!w||!w.cssClass)throw new Error("couldn't load module "+_+" or it didn't call define");w.$id&&(x.$themeId=w.$id),h.importCssString(w.cssText,w.cssClass,x.container),x.theme&&h.removeCssClass(x.container,x.theme.cssClass);var $="padding"in w?w.padding:"padding"in(x.theme||{})?4:x.$padding;x.$padding&&$!=x.$padding&&x.setPadding($),x.$theme=w.cssClass,x.theme=w,h.addCssClass(x.container,w.cssClass),h.setCssClass(x.container,"ace_dark",w.isDark),x.$size&&(x.$size.width=0,x.$updateSizeAsync()),x._dispatchEvent("themeLoaded",{theme:w}),R&&R(),g.isSafari&&x.scroller&&(x.scroller.style.background="red",x.scroller.style.background="")}},k.prototype.getTheme=function(){return this.$themeId},k.prototype.setStyle=function(_,R){h.setCssClass(this.container,_,R!==!1)},k.prototype.unsetStyle=function(_){h.removeCssClass(this.container,_)},k.prototype.setCursorStyle=function(_){h.setStyle(this.scroller.style,"cursor",_)},k.prototype.setMouseCursor=function(_){h.setStyle(this.scroller.style,"cursor",_)},k.prototype.attachToShadowRoot=function(){h.importCssString(E,"ace_editor.css",this.container)},k.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},k.prototype.$updateCustomScrollbar=function(_){var R=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,_===!0?(this.scrollBarV=new f(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(x){R.$scrollAnimation||R.session.setScrollTop(x.data-R.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(x){R.$scrollAnimation||R.session.setScrollLeft(x.data-R.scrollMargin.left)}),this.$scrollDecorator=new b(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new s(this.container,this),this.scrollBarH=new l(this.container,this),this.scrollBarV.addEventListener("scroll",function(x){R.$scrollAnimation||R.session.setScrollTop(x.data-R.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(x){R.$scrollAnimation||R.session.setScrollLeft(x.data-R.scrollMargin.left)}))},k.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var _=this;this.$resizeTimer=d.delayedCall(function(){_.destroyed||_.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(R){var x=R[0].contentRect.width,A=R[0].contentRect.height;Math.abs(_.$size.width-x)>1||Math.abs(_.$size.height-A)>1?_.$resizeTimer.delay():_.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},k}();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,a.implement(T.prototype,D),o.defineOptions(T.prototype,"renderer",{useResizeObserver:{set:function(k){!k&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):k&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(k){this.$textLayer.setShowInvisibles(k)&&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(k){typeof k=="number"&&(this.$printMarginColumn=k),this.$showPrintMargin=!!k,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(k){this.$gutter.style.display=k?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(k){this.$gutterLayer.$useSvgGutterIcons=k},initialValue:!1},showFoldedAnnotations:{set:function(k){this.$gutterLayer.$showFoldedAnnotations=k},initialValue:!1},fadeFoldWidgets:{set:function(k){h.setCssClass(this.$gutter,"ace_fade-fold-widgets",k)},initialValue:!1},showFoldWidgets:{set:function(k){this.$gutterLayer.setShowFoldWidgets(k),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(k){this.$textLayer.setDisplayIndentGuides(k)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(k){this.$textLayer.setHighlightIndentGuides(k)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(k){this.$gutterLayer.setHighlightGutterLine(k),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(k){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(k){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(k){typeof k=="number"&&(k=k+"px"),this.container.style.fontSize=k,this.updateFontSize()},initialValue:12},fontFamily:{set:function(k){this.container.style.fontFamily=k,this.updateFontSize()}},maxLines:{set:function(k){this.updateFull()}},minLines:{set:function(k){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(k){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(k){k=+k||0,this.$scrollPastEnd!=k&&(this.$scrollPastEnd=k,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(k){this.$gutterLayer.$fixedWidth=!!k,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(k){this.$updateCustomScrollbar(k)},initialValue:!1},theme:{set:function(k){this.setTheme(k)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!g.isMobile&&!g.isIE}}),u.VirtualRenderer=T}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(n,u,v){var a=n("../lib/oop"),h=n("../lib/net"),d=n("../lib/event_emitter").EventEmitter,o=n("../config");function p(l){var s="importScripts('"+h.qualifyURL(l)+"');";try{return new Blob([s],{type:"application/javascript"})}catch{var c=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,f=new c;return f.append(s),f.getBlob("application/javascript")}}function e(l){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(o.get("loadWorkerFromBlob")){var s=p(l),c=window.URL||window.webkitURL,f=c.createObjectURL(s);return new Worker(f)}return new Worker(l)}var t=function(l){l.postMessage||(l=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=l,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(){a.implement(this,d),this.$createWorkerFromOldConfig=function(l,s,c,f,m){if(n.nameToUrl&&!n.toUrl&&(n.toUrl=n.nameToUrl),o.get("packaged")||!n.toUrl)f=f||o.moduleUrl(s,"worker");else{var y=this.$normalizePath;f=f||y(n.toUrl("ace/worker/worker.js",null,"_"));var D={};l.forEach(function(E){D[E]=y(n.toUrl(E,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=e(f),m&&this.send("importScripts",m),this.$worker.postMessage({init:!0,tlns:D,module:s,classname:c}),this.$worker},this.onMessage=function(l){var s=l.data;switch(s.type){case"event":this._signal(s.name,{data:s.data});break;case"call":var c=this.callbacks[s.id];c&&(c(s.data),delete this.callbacks[s.id]);break;case"error":this.reportError(s.data);break;case"log":window.console&&console.log&&console.log.apply(console,s.data);break}},this.reportError=function(l){window.console&&console.error&&console.error(l)},this.$normalizePath=function(l){return h.qualifyURL(l)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(l){l.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(l,s){this.$worker.postMessage({command:l,args:s})},this.call=function(l,s,c){if(c){var f=this.callbackId++;this.callbacks[f]=c,s.push(f)}this.send(l,s)},this.emit=function(l,s){try{s.data&&s.data.err&&(s.data.err={message:s.data.err.message,stack:s.data.err.stack,code:s.data.err.code}),this.$worker&&this.$worker.postMessage({event:l,data:{data:s.data}})}catch(c){console.error(c.stack)}},this.attachToDocument=function(l){this.$doc&&this.terminate(),this.$doc=l,this.call("setValue",[l.getValue()]),l.on("change",this.changeListener,!0)},this.changeListener=function(l){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),l.action=="insert"?this.deltaQueue.push(l.start,l.lines):this.deltaQueue.push(l.start,l.end)},this.$sendDeltaQueue=function(){var l=this.deltaQueue;l&&(this.deltaQueue=null,l.length>50&&l.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:l}))}}).call(t.prototype);var r=function(l,s,c){var f=null,m=!1,y=Object.create(d),D=[],E=new t({messageBuffer:D,terminate:function(){},postMessage:function(g){D.push(g),f&&(m?setTimeout(b):b())}});E.setEmitSync=function(g){m=g};var b=function(){var g=D.shift();g.command?f[g.command].apply(f,g.args):g.event&&y._signal(g.event,g.data)};return y.postMessage=function(g){E.onMessage({data:g})},y.callback=function(g,S){this.postMessage({type:"call",id:S,data:g})},y.emit=function(g,S){this.postMessage({type:"event",name:g,data:S})},o.loadModule(["worker",s],function(g){for(f=new g[c](y);D.length;)b()}),E};u.UIWorkerClient=r,u.WorkerClient=t,u.createWorker=e}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(n,u,v){var a=n("./range").Range,h=n("./lib/event_emitter").EventEmitter,d=n("./lib/oop"),o=function(){function p(e,t,r,l,s,c){var f=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=s,this.othersClass=c,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=l,this.$onCursorChange=function(){setTimeout(function(){f.onCursorChange()})},this.$pos=r;var m=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=m.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}return p.prototype.setup=function(){var e=this,t=this.doc,r=this.session;this.selectionBefore=r.selection.toJSON(),r.selection.inMultiSelectMode&&r.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var l=this.pos;l.$insertRight=!0,l.detach(),l.markerId=r.addMarker(new a(l.row,l.column,l.row,l.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(s){var c=t.createAnchor(s.row,s.column);c.$insertRight=!0,c.detach(),e.others.push(c)}),r.setUndoSelect(!1)},p.prototype.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(r){r.markerId=e.addMarker(new a(r.row,r.column,r.row,r.column+t.length),t.othersClass,null,!1)})}},p.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},p.prototype.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var r=e.action==="insert"?t.end.column-t.start.column:t.start.column-t.end.column,l=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),l&&(this.length+=r),l&&!this.session.$fromUndo){if(e.action==="insert")for(var c=this.others.length-1;c>=0;c--){var f=this.others[c],m={row:f.row,column:f.column+s};this.doc.insertMergedLines(m,e.lines)}else if(e.action==="remove")for(var c=this.others.length-1;c>=0;c--){var f=this.others[c],m={row:f.row,column:f.column+s};this.doc.remove(new a(m.row,m.column,m.row,m.column-r))}}this.$updating=!1,this.updateMarkers()}},p.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},p.prototype.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,r=function(s,c){t.removeMarker(s.markerId),s.markerId=t.addMarker(new a(s.row,s.column,s.row,s.column+e.length),c,null,!1)};r(this.pos,this.mainClass);for(var l=this.others.length;l--;)r(this.others[l],this.othersClass)}},p.prototype.onCursorChange=function(e){if(!(this.$updating||!this.session)){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},p.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},p.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,r=0;r<t;r++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},p}();d.implement(o.prototype,h),u.PlaceHolder=o}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(n,u,v){var a=n("../lib/event"),h=n("../lib/useragent");function d(p,e){return p.row==e.row&&p.column==e.column}function o(p){var e=p.domEvent,t=e.altKey,r=e.shiftKey,l=e.ctrlKey,s=p.getAccelKey(),c=p.getButton();if(l&&h.isMac&&(c=e.button),p.editor.inMultiSelectMode&&c==2){p.editor.textInput.onContextMenu(p.domEvent);return}if(!l&&!t&&!s){c===0&&p.editor.inMultiSelectMode&&p.editor.exitMultiSelectMode();return}if(c===0){var f=p.editor,m=f.selection,y=f.inMultiSelectMode,D=p.getDocumentPosition(),E=m.getCursor(),b=p.inSelection()||m.isEmpty()&&d(D,E),g=p.x,S=p.y,T=function(P){g=P.clientX,S=P.clientY},k=f.session,_=f.renderer.pixelToScreenCoordinates(g,S),R=_,x;if(f.$mouseHandler.$enableJumpToDef)l&&t||s&&t?x=r?"block":"add":t&&f.$blockSelectEnabled&&(x="block");else if(s&&!t){if(x="add",!y&&r)return}else t&&f.$blockSelectEnabled&&(x="block");if(x&&h.isMac&&e.ctrlKey&&f.$mouseHandler.cancelContextMenu(),x=="add"){if(!y&&b)return;if(!y){var A=m.toOrientedRange();f.addSelectionMarker(A)}var C=m.rangeList.rangeAtPoint(D);f.inVirtualSelectionMode=!0,r&&(C=null,A=m.ranges[0]||A,f.removeSelectionMarker(A)),f.once("mouseup",function(){var P=m.toOrientedRange();C&&P.isEmpty()&&d(C.cursor,P.cursor)?m.substractPoint(P.cursor):(r?m.substractPoint(A.cursor):A&&(f.removeSelectionMarker(A),m.addRange(A)),m.addRange(P)),f.inVirtualSelectionMode=!1})}else if(x=="block"){p.stop(),f.inVirtualSelectionMode=!0;var w,$=[],I=function(){var P=f.renderer.pixelToScreenCoordinates(g,S),V=k.screenToDocumentPosition(P.row,P.column,P.offsetX);d(R,P)&&d(V,m.lead)||(R=P,f.selection.moveToPosition(V),f.renderer.scrollCursorIntoView(),f.removeSelectionMarkers($),$=m.rectangularRangeBlock(R,_),f.$mouseHandler.$clickSelection&&$.length==1&&$[0].isEmpty()&&($[0]=f.$mouseHandler.$clickSelection.clone()),$.forEach(f.addSelectionMarker,f),f.updateSelectionMarkers())};y&&!s?m.toSingleRange():!y&&s&&(w=m.toOrientedRange(),f.addSelectionMarker(w)),r?_=k.documentToScreenPosition(m.lead):m.moveToPosition(D),R={row:-1,column:-1};var F=function(P){I(),clearInterval(B),f.removeSelectionMarkers($),$.length||($=[m.toOrientedRange()]),w&&(f.removeSelectionMarker(w),m.toSingleRange(w));for(var V=0;V<$.length;V++)m.addRange($[V]);f.inVirtualSelectionMode=!1,f.$mouseHandler.$clickSelection=null},O=I;a.capture(f.container,T,F);var B=setInterval(function(){O()},20);return p.preventDefault()}}}u.onMouseDown=o}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(n,u,v){u.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(h){h.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(h){h.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(h){h.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(h){h.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(h){h.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(h){h.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(h){h.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(h){h.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(h){h.multiSelect.rangeCount>1?h.multiSelect.joinSelections():h.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(h){h.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(h){h.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(h){h.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],u.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(h){h.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(h){return h&&h.inMultiSelectMode}}];var a=n("../keyboard/hash_handler").HashHandler;u.keyboardHandler=new a(u.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(n,u,v){var a=n("./range_list").RangeList,h=n("./range").Range,d=n("./selection").Selection,o=n("./mouse/multi_select_handler").onMouseDown,p=n("./lib/event"),e=n("./lib/lang"),t=n("./commands/multi_select_commands");u.commands=t.defaultCommands.concat(t.multiSelectCommands);var r=n("./search").Search,l=new r;function s(E,b,g){return l.$options.wrap=!0,l.$options.needle=b,l.$options.backwards=g==-1,l.find(E)}var c=n("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(c.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(E,b){if(E){if(!this.inMultiSelectMode&&this.rangeCount===0){var g=this.toOrientedRange();if(this.rangeList.add(g),this.rangeList.add(E),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),b||this.fromOrientedRange(E);this.rangeList.removeAll(),this.rangeList.add(g),this.$onAddRange(g)}E.cursor||(E.cursor=E.end);var S=this.rangeList.add(E);return this.$onAddRange(E),S.length&&this.$onRemoveRange(S),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),b||this.fromOrientedRange(E)}},this.toSingleRange=function(E){E=E||this.ranges[0];var b=this.rangeList.removeAll();b.length&&this.$onRemoveRange(b),E&&this.fromOrientedRange(E)},this.substractPoint=function(E){var b=this.rangeList.substractPoint(E);if(b)return this.$onRemoveRange(b),b[0]},this.mergeOverlappingRanges=function(){var E=this.rangeList.merge();E.length&&this.$onRemoveRange(E)},this.$onAddRange=function(E){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(E),this._signal("addRange",{range:E})},this.$onRemoveRange=function(E){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var b=this.rangeList.ranges.pop();E.push(b),this.rangeCount=0}for(var g=E.length;g--;){var S=this.ranges.indexOf(E[g]);this.ranges.splice(S,1)}this._signal("removeRange",{ranges:E}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),b=b||this.ranges[0],b&&!b.isEqual(this.getRange())&&this.fromOrientedRange(b)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new a,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var E=this.ranges.length?this.ranges:[this.getRange()],b=[],g=0;g<E.length;g++){var S=E[g],T=S.start.row,k=S.end.row;if(T===k)b.push(S.clone());else{for(b.push(new h(T,S.start.column,T,this.session.getLine(T).length));++T<k;)b.push(this.getLineRange(T,!0));b.push(new h(k,0,k,S.end.column))}g==0&&!this.isBackwards()&&(b=b.reverse())}this.toSingleRange();for(var g=b.length;g--;)this.addRange(b[g])},this.joinSelections=function(){var E=this.rangeList.ranges,b=E[E.length-1],g=h.fromPoints(E[0].start,b.end);this.toSingleRange(),this.setSelectionRange(g,b.cursor==b.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var E=this.rangeList.ranges,b=E[E.length-1],g=h.fromPoints(E[0].start,b.end);this.toSingleRange(),this.setSelectionRange(g,b.cursor==b.start)}else{var S=this.session.documentToScreenPosition(this.cursor),T=this.session.documentToScreenPosition(this.anchor),k=this.rectangularRangeBlock(S,T);k.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(E,b,g){var S=[],T=E.column<b.column;if(T)var k=E.column,_=b.column,R=E.offsetX,x=b.offsetX;else var k=b.column,_=E.column,R=b.offsetX,x=E.offsetX;var A=E.row<b.row;if(A)var C=E.row,w=b.row;else var C=b.row,w=E.row;k<0&&(k=0),C<0&&(C=0),C==w&&(g=!0);for(var $,I=C;I<=w;I++){var F=h.fromPoints(this.session.screenToDocumentPosition(I,k,R),this.session.screenToDocumentPosition(I,_,x));if(F.isEmpty()){if($&&m(F.end,$))break;$=F.end}F.cursor=T?F.start:F.end,S.push(F)}if(A&&S.reverse(),!g){for(var O=S.length-1;S[O].isEmpty()&&O>0;)O--;if(O>0)for(var B=0;S[B].isEmpty();)B++;for(var P=O;P>=B;P--)S[P].isEmpty()&&S.splice(P,1)}return S}}.call(d.prototype);var f=n("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(E){E.cursor||(E.cursor=E.end);var b=this.getSelectionStyle();return E.marker=this.session.addMarker(E,"ace_selection",b),this.session.$selectionMarkers.push(E),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,E},this.removeSelectionMarker=function(E){if(E.marker){this.session.removeMarker(E.marker);var b=this.session.$selectionMarkers.indexOf(E);b!=-1&&this.session.$selectionMarkers.splice(b,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(E){for(var b=this.session.$selectionMarkers,g=E.length;g--;){var S=E[g];if(S.marker){this.session.removeMarker(S.marker);var T=b.indexOf(S);T!=-1&&b.splice(T,1)}}this.session.selectionMarkerCount=b.length},this.$onAddRange=function(E){this.addSelectionMarker(E.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(E){this.removeSelectionMarkers(E.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(E){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(t.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(E){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(t.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(E){var b=E.command,g=E.editor;if(g.multiSelect){if(b.multiSelectAction)b.multiSelectAction=="forEach"?S=g.forEachSelection(b,E.args):b.multiSelectAction=="forEachLine"?S=g.forEachSelection(b,E.args,!0):b.multiSelectAction=="single"?(g.exitMultiSelectMode(),S=b.exec(g,E.args||{})):S=b.multiSelectAction(g,E.args||{});else{var S=b.exec(g,E.args||{});g.multiSelect.addRange(g.multiSelect.toOrientedRange()),g.multiSelect.mergeOverlappingRanges()}return S}},this.forEachSelection=function(E,b,g){if(!this.inVirtualSelectionMode){var S=g&&g.keepOrder,T=g==!0||g&&g.$byLines,k=this.session,_=this.selection,R=_.rangeList,x=(S?_:R).ranges,A;if(!x.length)return E.exec?E.exec(this,b||{}):E(this,b||{});var C=_._eventRegistry;_._eventRegistry={};var w=new d(k);this.inVirtualSelectionMode=!0;for(var $=x.length;$--;){if(T)for(;$>0&&x[$].start.row==x[$-1].end.row;)$--;w.fromOrientedRange(x[$]),w.index=$,this.selection=k.selection=w;var I=E.exec?E.exec(this,b||{}):E(this,b||{});!A&&I!==void 0&&(A=I),w.toOrientedRange(x[$])}w.detach(),this.selection=k.selection=_,this.inVirtualSelectionMode=!1,_._eventRegistry=C,_.mergeOverlappingRanges(),_.ranges[0]&&_.fromOrientedRange(_.ranges[0]);var F=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),F&&F.from==F.to&&this.renderer.animateScrolling(F.from),A}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var E="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var b=this.multiSelect.rangeList.ranges,g=[],S=0;S<b.length;S++)g.push(this.session.getTextRange(b[S]));var T=this.session.getDocument().getNewLineCharacter();E=g.join(T),E.length==(g.length-1)*T.length&&(E="")}else this.selection.isEmpty()||(E=this.session.getTextRange(this.getSelectionRange()));return E},this.$checkMultiselectChange=function(E,b){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var g=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&b==this.multiSelect.anchor)return;var S=b==this.multiSelect.anchor?g.cursor==g.start?g.end:g.start:g.cursor;S.row!=b.row||this.session.$clipPositionToDocument(S.row,S.column).column!=b.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(E,b,g){if(b=b||{},b.needle=E||b.needle,b.needle==null){var S=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();b.needle=this.session.getTextRange(S)}this.$search.set(b);var T=this.$search.findAll(this.session);if(!T.length)return 0;var k=this.multiSelect;g||k.toSingleRange(T[0]);for(var _=T.length;_--;)k.addRange(T[_],!0);return S&&k.rangeList.rangeAtPoint(S.start)&&k.addRange(S,!0),T.length},this.selectMoreLines=function(E,b){var g=this.selection.toOrientedRange(),S=g.cursor==g.end,T=this.session.documentToScreenPosition(g.cursor);this.selection.$desiredColumn&&(T.column=this.selection.$desiredColumn);var k=this.session.screenToDocumentPosition(T.row+E,T.column);if(g.isEmpty())var R=k;else var _=this.session.documentToScreenPosition(S?g.end:g.start),R=this.session.screenToDocumentPosition(_.row+E,_.column);if(S){var x=h.fromPoints(k,R);x.cursor=x.start}else{var x=h.fromPoints(R,k);x.cursor=x.end}if(x.desiredColumn=T.column,!this.selection.inMultiSelectMode)this.selection.addRange(g);else if(b)var A=g.cursor;this.selection.addRange(x),A&&this.selection.substractPoint(A)},this.transposeSelections=function(E){for(var b=this.session,g=b.multiSelect,S=g.ranges,T=S.length;T--;){var k=S[T];if(k.isEmpty()){var _=b.getWordRange(k.start.row,k.start.column);k.start.row=_.start.row,k.start.column=_.start.column,k.end.row=_.end.row,k.end.column=_.end.column}}g.mergeOverlappingRanges();for(var R=[],T=S.length;T--;){var k=S[T];R.unshift(b.getTextRange(k))}E<0?R.unshift(R.pop()):R.push(R.shift());for(var T=S.length;T--;){var k=S[T],x=k.clone();b.replace(k,R[T]),k.start.row=x.start.row,k.start.column=x.start.column}g.fromOrientedRange(g.ranges[0])},this.selectMore=function(E,b,g){var S=this.session,T=S.multiSelect,k=T.toOrientedRange();if(!(k.isEmpty()&&(k=S.getWordRange(k.start.row,k.start.column),k.cursor=E==-1?k.start:k.end,this.multiSelect.addRange(k),g))){var _=S.getTextRange(k),R=s(S,_,E);R&&(R.cursor=E==-1?R.start:R.end,this.session.unfold(R),this.multiSelect.addRange(R),this.renderer.scrollCursorIntoView(null,.5)),b&&this.multiSelect.substractPoint(k.cursor)}},this.alignCursors=function(){var E=this.session,b=E.multiSelect,g=b.ranges,S=-1,T=g.filter(function(O){if(O.cursor.row==S)return!0;S=O.cursor.row});if(!g.length||T.length==g.length-1){var k=this.selection.getRange(),_=k.start.row,R=k.end.row,x=_==R;if(x){var A=this.session.getLength(),C;do C=this.session.getLine(R);while(/[=:]/.test(C)&&++R<A);do C=this.session.getLine(_);while(/[=:]/.test(C)&&--_>0);_<0&&(_=0),R>=A&&(R=A-1)}var w=this.session.removeFullLines(_,R);w=this.$reAlignText(w,x),this.session.insert({row:_,column:0},w.join(`
964
- `)+`
965
- `),x||(k.start.column=0,k.end.column=w[w.length-1].length),this.selection.setRange(k)}else{T.forEach(function(O){b.substractPoint(O.cursor)});var $=0,I=1/0,F=g.map(function(O){var B=O.cursor,P=E.getLine(B.row),V=P.substr(B.column).search(/\S/g);return V==-1&&(V=0),B.column>$&&($=B.column),V<I&&(I=V),V});g.forEach(function(O,B){var P=O.cursor,V=$-P.column,W=F[B]-I;V>W?E.insert(P,e.stringRepeat(" ",V-W)):E.remove(new h(P.row,P.column,P.row,P.column-V+W)),O.start.column=O.end.column=$,O.start.row=O.end.row=P.row,O.cursor=O.end}),b.fromOrientedRange(g[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(E,b){var g=!0,S=!0,T,k,_;return E.map(function(w){var $=w.match(/(\s*)(.*?)(\s*)([=:].*)/);return $?T==null?(T=$[1].length,k=$[2].length,_=$[3].length,$):(T+k+_!=$[1].length+$[2].length+$[3].length&&(S=!1),T!=$[1].length&&(g=!1),T>$[1].length&&(T=$[1].length),k<$[2].length&&(k=$[2].length),_>$[3].length&&(_=$[3].length),$):[w]}).map(b?x:g?S?A:x:C);function R(w){return e.stringRepeat(" ",w)}function x(w){return w[2]?R(T)+w[2]+R(k-w[2].length+_)+w[4].replace(/^([=:])\s+/,"$1 "):w[0]}function A(w){return w[2]?R(T+k-w[2].length)+w[2]+R(_)+w[4].replace(/^([=:])\s+/,"$1 "):w[0]}function C(w){return w[2]?R(T)+w[2]+R(_)+w[4].replace(/^([=:])\s+/,"$1 "):w[0]}}}).call(f.prototype);function m(E,b){return E.row==b.row&&E.column==b.column}u.onSessionChange=function(E){var b=E.session;b&&!b.multiSelect&&(b.$selectionMarkers=[],b.selection.$initRangeList(),b.multiSelect=b.selection),this.multiSelect=b&&b.multiSelect;var g=E.oldSession;g&&(g.multiSelect.off("addRange",this.$onAddRange),g.multiSelect.off("removeRange",this.$onRemoveRange),g.multiSelect.off("multiSelect",this.$onMultiSelect),g.multiSelect.off("singleSelect",this.$onSingleSelect),g.multiSelect.lead.off("change",this.$checkMultiselectChange),g.multiSelect.anchor.off("change",this.$checkMultiselectChange)),b&&(b.multiSelect.on("addRange",this.$onAddRange),b.multiSelect.on("removeRange",this.$onRemoveRange),b.multiSelect.on("multiSelect",this.$onMultiSelect),b.multiSelect.on("singleSelect",this.$onSingleSelect),b.multiSelect.lead.on("change",this.$checkMultiselectChange),b.multiSelect.anchor.on("change",this.$checkMultiselectChange)),b&&this.inMultiSelectMode!=b.selection.inMultiSelectMode&&(b.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function y(E){E.$multiselectOnSessionChange||(E.$onAddRange=E.$onAddRange.bind(E),E.$onRemoveRange=E.$onRemoveRange.bind(E),E.$onMultiSelect=E.$onMultiSelect.bind(E),E.$onSingleSelect=E.$onSingleSelect.bind(E),E.$multiselectOnSessionChange=u.onSessionChange.bind(E),E.$checkMultiselectChange=E.$checkMultiselectChange.bind(E),E.$multiselectOnSessionChange(E),E.on("changeSession",E.$multiselectOnSessionChange),E.on("mousedown",o),E.commands.addCommands(t.defaultCommands),D(E))}function D(E){if(!E.textInput)return;var b=E.textInput.getElement(),g=!1;p.addListener(b,"keydown",function(T){var k=T.keyCode==18&&!(T.ctrlKey||T.shiftKey||T.metaKey);E.$blockSelectEnabled&&k?g||(E.renderer.setMouseCursor("crosshair"),g=!0):g&&S()},E),p.addListener(b,"keyup",S,E),p.addListener(b,"blur",S,E);function S(T){g&&(E.renderer.setMouseCursor(""),g=!1)}}u.MultiSelect=y,n("./config").defineOptions(f.prototype,"editor",{enableMultiselect:{set:function(E){y(this),E?this.on("mousedown",o):this.off("mousedown",o)},value:!0},enableBlockSelect:{set:function(E){this.$blockSelectEnabled=E},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(n,u,v){var a=n("../../range").Range,h=u.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(d,o,p){var e=d.getLine(p);return this.foldingStartMarker.test(e)?"start":o=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(e)?"end":""},this.getFoldWidgetRange=function(d,o,p){return null},this.indentationBlock=function(d,o,p){var e=/\S/,t=d.getLine(o),r=t.search(e);if(r!=-1){for(var l=p||t.length,s=d.getLength(),c=o,f=o;++o<s;){var m=d.getLine(o).search(e);if(m!=-1){if(m<=r){var y=d.getTokenAt(o,0);if(!y||y.type!=="string")break}f=o}}if(f>c){var D=d.getLine(f).length;return new a(c,l,f,D)}}},this.openingBracketBlock=function(d,o,p,e,t){var r={row:p,column:e+1},l=d.$findClosingBracket(o,r,t);if(l){var s=d.foldWidgets[l.row];return s==null&&(s=d.getFoldWidget(l.row)),s=="start"&&l.row>r.row&&(l.row--,l.column=d.getLine(l.row).length),a.fromPoints(r,l)}},this.closingBracketBlock=function(d,o,p,e,t){var r={row:p,column:e},l=d.$findOpeningBracket(o,r);if(l)return l.column++,r.column--,a.fromPoints(l,r)}}).call(h.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(n,u,v){var a=n("../lib/dom"),h=n("../range").Range,d=n("../config").nls;function o(e,t,r){for(var l=0,s=e.length-1;l<=s;){var c=l+s>>1,f=r(t,e[c]);if(f>0)l=c+1;else if(f<0)s=c-1;else return c}return-(l+1)}function p(e,t,r){var l=e.getAnnotations().sort(h.comparePoints);if(l.length){var s=o(l,{row:t,column:-1},h.comparePoints);s<0&&(s=-s-1),s>=l.length?s=r>0?0:l.length-1:s===0&&r<0&&(s=l.length-1);var c=l[s];if(!(!c||!r)){if(c.row===t){do c=l[s+=r];while(c&&c.row===t);if(!c)return l.slice()}var f=[];t=c.row;do f[r<0?"unshift":"push"](c),c=l[s+=r];while(c&&c.row==t);return f.length&&f}}}u.showErrorMarker=function(e,t){var r=e.session,l=e.getCursorPosition(),s=l.row,c=r.widgetManager.getWidgetsAtRow(s).filter(function(T){return T.type=="errorMarker"})[0];c?c.destroy():s-=t;var f=p(r,s,t),m;if(f){var y=f[0];l.column=(y.pos&&typeof y.column!="number"?y.pos.sc:y.column)||0,l.row=y.row,m=e.renderer.$gutterLayer.$annotations[l.row]}else{if(c)return;m={displayText:[d("error-marker.good-state","Looks good!")],className:"ace_ok"}}e.session.unfold(l.row),e.selection.moveToPosition(l);var D={row:l.row,fixedWidth:!0,coverGutter:!0,el:a.createElement("div"),type:"errorMarker"},E=D.el.appendChild(a.createElement("div")),b=D.el.appendChild(a.createElement("div"));b.className="error_widget_arrow "+m.className;var g=e.renderer.$cursorLayer.getPixelPosition(l).left;b.style.left=g+e.renderer.gutterWidth-5+"px",D.el.className="error_widget_wrapper",E.className="error_widget "+m.className,m.displayText.forEach(function(T,k){E.appendChild(a.createTextNode(T)),k<m.displayText.length-1&&E.appendChild(a.createElement("br"))}),E.appendChild(a.createElement("div"));var S=function(T,k,_){if(k===0&&(_==="esc"||_==="return"))return D.destroy(),{command:"null"}};D.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(S),r.widgetManager.removeLineWidget(D),e.off("changeSelection",D.destroy),e.off("changeSession",D.destroy),e.off("mouseup",D.destroy),e.off("change",D.destroy))},e.keyBinding.addKeyboardHandler(S),e.on("changeSelection",D.destroy),e.on("changeSession",D.destroy),e.on("mouseup",D.destroy),e.on("change",D.destroy),e.session.widgetManager.addLineWidget(D),D.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:D.el.offsetHeight})},a.importCssString(`
966
- .error_widget_wrapper {
967
- background: inherit;
968
- color: inherit;
969
- border:none
970
- }
971
- .error_widget {
972
- border-top: solid 2px;
973
- border-bottom: solid 2px;
974
- margin: 5px 0;
975
- padding: 10px 40px;
976
- white-space: pre-wrap;
977
- }
978
- .error_widget.ace_error, .error_widget_arrow.ace_error{
979
- border-color: #ff5a5a
980
- }
981
- .error_widget.ace_warning, .error_widget_arrow.ace_warning{
982
- border-color: #F1D817
983
- }
984
- .error_widget.ace_info, .error_widget_arrow.ace_info{
985
- border-color: #5a5a5a
986
- }
987
- .error_widget.ace_ok, .error_widget_arrow.ace_ok{
988
- border-color: #5aaa5a
989
- }
990
- .error_widget_arrow {
991
- position: absolute;
992
- border: solid 5px;
993
- border-top-color: transparent!important;
994
- border-right-color: transparent!important;
995
- border-left-color: transparent!important;
996
- top: -5px;
997
- }
998
- `,"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(n,u,v){n("./loader_build")(u);var a=n("./lib/dom"),h=n("./range").Range,d=n("./editor").Editor,o=n("./edit_session").EditSession,p=n("./undomanager").UndoManager,e=n("./virtual_renderer").VirtualRenderer;n("./worker/worker_client"),n("./keyboard/hash_handler"),n("./placeholder"),n("./multi_select"),n("./mode/folding/fold_mode"),n("./theme/textmate"),n("./ext/error_marker"),u.config=n("./config"),u.edit=function(r,l){if(typeof r=="string"){var s=r;if(r=document.getElementById(s),!r)throw new Error("ace.edit can't find div #"+s)}if(r&&r.env&&r.env.editor instanceof d)return r.env.editor;var c="";if(r&&/input|textarea/i.test(r.tagName)){var f=r;c=f.value,r=a.createElement("pre"),f.parentNode.replaceChild(r,f)}else r&&(c=r.textContent,r.innerHTML="");var m=u.createEditSession(c),y=new d(new e(r),m,l),D={document:m,editor:y,onResize:y.resize.bind(y,null)};return f&&(D.textarea=f),y.on("destroy",function(){D.editor.container.env=null}),y.container.env=y.env=D,y},u.createEditSession=function(r,l){var s=new o(r,l);return s.setUndoManager(new p),s},u.Range=h,u.Editor=d,u.EditSession=o,u.UndoManager=p,u.VirtualRenderer=e;var t=u.config.version;u.version=t}),function(){ace.require(["ace/ace"],function(n){n&&(n.config.init(!0),n.define=ace.define);var u=function(){return this}();!u&&typeof window<"u"&&(u=window),!u&&typeof self<"u"&&(u=self),u.ace||(u.ace=n);for(var v in n)n.hasOwnProperty(v)&&(u.ace[v]=n[v]);u.ace.default=u.ace,L&&(L.exports=u.ace)})}()})(Ui);var fn=Ui.exports,gn={exports:{}};gn.exports;(function(L,i){var n=200,u="__lodash_hash_undefined__",v=1,a=2,h=9007199254740991,d="[object Arguments]",o="[object Array]",p="[object AsyncFunction]",e="[object Boolean]",t="[object Date]",r="[object Error]",l="[object Function]",s="[object GeneratorFunction]",c="[object Map]",f="[object Number]",m="[object Null]",y="[object Object]",D="[object Promise]",E="[object Proxy]",b="[object RegExp]",g="[object Set]",S="[object String]",T="[object Symbol]",k="[object Undefined]",_="[object WeakMap]",R="[object ArrayBuffer]",x="[object DataView]",A="[object Float32Array]",C="[object Float64Array]",w="[object Int8Array]",$="[object Int16Array]",I="[object Int32Array]",F="[object Uint8Array]",O="[object Uint8ClampedArray]",B="[object Uint16Array]",P="[object Uint32Array]",V=/[\\^$.*+?()[\]{}|]/g,W=/^\[object .+?Constructor\]$/,H=/^(?:0|[1-9]\d*)$/,U={};U[A]=U[C]=U[w]=U[$]=U[I]=U[F]=U[O]=U[B]=U[P]=!0,U[d]=U[o]=U[R]=U[e]=U[x]=U[t]=U[r]=U[l]=U[c]=U[f]=U[y]=U[b]=U[g]=U[S]=U[_]=!1;var G=typeof He=="object"&&He&&He.Object===Object&&He,Y=typeof self=="object"&&self&&self.Object===Object&&self,Q=G||Y||Function("return this")(),ee=i&&!i.nodeType&&i,ne=ee&&!0&&L&&!L.nodeType&&L,se=ne&&ne.exports===ee,ge=se&&G.process,be=function(){try{return ge&&ge.binding&&ge.binding("util")}catch{}}(),ke=be&&be.isTypedArray;function Ce(z,J){for(var te=-1,ie=z==null?0:z.length,Se=0,he=[];++te<ie;){var _e=z[te];J(_e,te,z)&&(he[Se++]=_e)}return he}function Ne(z,J){for(var te=-1,ie=J.length,Se=z.length;++te<ie;)z[Se+te]=J[te];return z}function Xe(z,J){for(var te=-1,ie=z==null?0:z.length;++te<ie;)if(J(z[te],te,z))return!0;return!1}function Ze(z,J){for(var te=-1,ie=Array(z);++te<z;)ie[te]=J(te);return ie}function Rt(z){return function(J){return z(J)}}function Jt(z,J){return z.has(J)}function bn(z,J){return z==null?void 0:z[J]}function Ot(z){var J=-1,te=Array(z.size);return z.forEach(function(ie,Se){te[++J]=[Se,ie]}),te}function Tt(z,J){return function(te){return z(J(te))}}function Nt(z){var J=-1,te=Array(z.size);return z.forEach(function(ie){te[++J]=ie}),te}var wn=Array.prototype,X=Function.prototype,re=Object.prototype,ae=Q["__core-js_shared__"],de=X.toString,ce=re.hasOwnProperty,Ee=function(){var z=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||"");return z?"Symbol(src)_1."+z:""}(),$e=re.toString,xe=RegExp("^"+de.call(ce).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=se?Q.Buffer:void 0,ve=Q.Symbol,Fe=Q.Uint8Array,st=re.propertyIsEnumerable,Yt=wn.splice,gt=ve?ve.toStringTag:void 0,Zn=Object.getOwnPropertySymbols,nr=we?we.isBuffer:void 0,ir=Tt(Object.keys,Object),Cn=_t(Q,"DataView"),Bt=_t(Q,"Map"),En=_t(Q,"Promise"),Sn=_t(Q,"Set"),Dn=_t(Q,"WeakMap"),Pt=_t(Object,"create"),rr=yt(Cn),sr=yt(Bt),or=yt(En),ar=yt(Sn),lr=yt(Dn),qn=ve?ve.prototype:void 0,An=qn?qn.valueOf:void 0;function mt(z){var J=-1,te=z==null?0:z.length;for(this.clear();++J<te;){var ie=z[J];this.set(ie[0],ie[1])}}function ur(){this.__data__=Pt?Pt(null):{},this.size=0}function hr(z){var J=this.has(z)&&delete this.__data__[z];return this.size-=J?1:0,J}function cr(z){var J=this.__data__;if(Pt){var te=J[z];return te===u?void 0:te}return ce.call(J,z)?J[z]:void 0}function pr(z){var J=this.__data__;return Pt?J[z]!==void 0:ce.call(J,z)}function dr(z,J){var te=this.__data__;return this.size+=this.has(z)?0:1,te[z]=Pt&&J===void 0?u:J,this}mt.prototype.clear=ur,mt.prototype.delete=hr,mt.prototype.get=cr,mt.prototype.has=pr,mt.prototype.set=dr;function qe(z){var J=-1,te=z==null?0:z.length;for(this.clear();++J<te;){var ie=z[J];this.set(ie[0],ie[1])}}function fr(){this.__data__=[],this.size=0}function gr(z){var J=this.__data__,te=Xt(J,z);if(te<0)return!1;var ie=J.length-1;return te==ie?J.pop():Yt.call(J,te,1),--this.size,!0}function mr(z){var J=this.__data__,te=Xt(J,z);return te<0?void 0:J[te][1]}function vr(z){return Xt(this.__data__,z)>-1}function yr(z,J){var te=this.__data__,ie=Xt(te,z);return ie<0?(++this.size,te.push([z,J])):te[ie][1]=J,this}qe.prototype.clear=fr,qe.prototype.delete=gr,qe.prototype.get=mr,qe.prototype.has=vr,qe.prototype.set=yr;function vt(z){var J=-1,te=z==null?0:z.length;for(this.clear();++J<te;){var ie=z[J];this.set(ie[0],ie[1])}}function br(){this.size=0,this.__data__={hash:new mt,map:new(Bt||qe),string:new mt}}function wr(z){var J=Zt(this,z).delete(z);return this.size-=J?1:0,J}function Cr(z){return Zt(this,z).get(z)}function Er(z){return Zt(this,z).has(z)}function Sr(z,J){var te=Zt(this,z),ie=te.size;return te.set(z,J),this.size+=te.size==ie?0:1,this}vt.prototype.clear=br,vt.prototype.delete=wr,vt.prototype.get=Cr,vt.prototype.has=Er,vt.prototype.set=Sr;function Qt(z){var J=-1,te=z==null?0:z.length;for(this.__data__=new vt;++J<te;)this.add(z[J])}function Dr(z){return this.__data__.set(z,u),this}function Ar(z){return this.__data__.has(z)}Qt.prototype.add=Qt.prototype.push=Dr,Qt.prototype.has=Ar;function ot(z){var J=this.__data__=new qe(z);this.size=J.size}function xr(){this.__data__=new qe,this.size=0}function $r(z){var J=this.__data__,te=J.delete(z);return this.size=J.size,te}function Tr(z){return this.__data__.get(z)}function _r(z){return this.__data__.has(z)}function kr(z,J){var te=this.__data__;if(te instanceof qe){var ie=te.__data__;if(!Bt||ie.length<n-1)return ie.push([z,J]),this.size=++te.size,this;te=this.__data__=new vt(ie)}return te.set(z,J),this.size=te.size,this}ot.prototype.clear=xr,ot.prototype.delete=$r,ot.prototype.get=Tr,ot.prototype.has=_r,ot.prototype.set=kr;function Mr(z,J){var te=qt(z),ie=!te&&Gr(z),Se=!te&&!ie&&xn(z),he=!te&&!ie&&!Se&&li(z),_e=te||ie||Se||he,Le=_e?Ze(z.length,String):[],Re=Le.length;for(var Te in z)ce.call(z,Te)&&!(_e&&(Te=="length"||Se&&(Te=="offset"||Te=="parent")||he&&(Te=="buffer"||Te=="byteLength"||Te=="byteOffset")||Hr(Te,Re)))&&Le.push(Te);return Le}function Xt(z,J){for(var te=z.length;te--;)if(ri(z[te][0],J))return te;return-1}function Lr(z,J,te){var ie=J(z);return qt(z)?ie:Ne(ie,te(z))}function Wt(z){return z==null?z===void 0?k:m:gt&&gt in Object(z)?Pr(z):Ur(z)}function ei(z){return Ht(z)&&Wt(z)==d}function ti(z,J,te,ie,Se){return z===J?!0:z==null||J==null||!Ht(z)&&!Ht(J)?z!==z&&J!==J:Ir(z,J,te,ie,ti,Se)}function Ir(z,J,te,ie,Se,he){var _e=qt(z),Le=qt(J),Re=_e?o:at(z),Te=Le?o:at(J);Re=Re==d?y:Re,Te=Te==d?y:Te;var Pe=Re==y,Ue=Te==y,Oe=Re==Te;if(Oe&&xn(z)){if(!xn(J))return!1;_e=!0,Pe=!1}if(Oe&&!Pe)return he||(he=new ot),_e||li(z)?ni(z,J,te,ie,Se,he):Nr(z,J,Re,te,ie,Se,he);if(!(te&v)){var ze=Pe&&ce.call(z,"__wrapped__"),je=Ue&&ce.call(J,"__wrapped__");if(ze||je){var lt=ze?z.value():z,et=je?J.value():J;return he||(he=new ot),Se(lt,et,te,ie,he)}}return Oe?(he||(he=new ot),Br(z,J,te,ie,Se,he)):!1}function Fr(z){if(!ai(z)||jr(z))return!1;var J=si(z)?xe:W;return J.test(yt(z))}function Rr(z){return Ht(z)&&oi(z.length)&&!!U[Wt(z)]}function Or(z){if(!Vr(z))return ir(z);var J=[];for(var te in Object(z))ce.call(z,te)&&te!="constructor"&&J.push(te);return J}function ni(z,J,te,ie,Se,he){var _e=te&v,Le=z.length,Re=J.length;if(Le!=Re&&!(_e&&Re>Le))return!1;var Te=he.get(z);if(Te&&he.get(J))return Te==J;var Pe=-1,Ue=!0,Oe=te&a?new Qt:void 0;for(he.set(z,J),he.set(J,z);++Pe<Le;){var ze=z[Pe],je=J[Pe];if(ie)var lt=_e?ie(je,ze,Pe,J,z,he):ie(ze,je,Pe,z,J,he);if(lt!==void 0){if(lt)continue;Ue=!1;break}if(Oe){if(!Xe(J,function(et,bt){if(!Jt(Oe,bt)&&(ze===et||Se(ze,et,te,ie,he)))return Oe.push(bt)})){Ue=!1;break}}else if(!(ze===je||Se(ze,je,te,ie,he))){Ue=!1;break}}return he.delete(z),he.delete(J),Ue}function Nr(z,J,te,ie,Se,he,_e){switch(te){case x:if(z.byteLength!=J.byteLength||z.byteOffset!=J.byteOffset)return!1;z=z.buffer,J=J.buffer;case R:return!(z.byteLength!=J.byteLength||!he(new Fe(z),new Fe(J)));case e:case t:case f:return ri(+z,+J);case r:return z.name==J.name&&z.message==J.message;case b:case S:return z==J+"";case c:var Le=Ot;case g:var Re=ie&v;if(Le||(Le=Nt),z.size!=J.size&&!Re)return!1;var Te=_e.get(z);if(Te)return Te==J;ie|=a,_e.set(z,J);var Pe=ni(Le(z),Le(J),ie,Se,he,_e);return _e.delete(z),Pe;case T:if(An)return An.call(z)==An.call(J)}return!1}function Br(z,J,te,ie,Se,he){var _e=te&v,Le=ii(z),Re=Le.length,Te=ii(J),Pe=Te.length;if(Re!=Pe&&!_e)return!1;for(var Ue=Re;Ue--;){var Oe=Le[Ue];if(!(_e?Oe in J:ce.call(J,Oe)))return!1}var ze=he.get(z);if(ze&&he.get(J))return ze==J;var je=!0;he.set(z,J),he.set(J,z);for(var lt=_e;++Ue<Re;){Oe=Le[Ue];var et=z[Oe],bt=J[Oe];if(ie)var ui=_e?ie(bt,et,Oe,J,z,he):ie(et,bt,Oe,z,J,he);if(!(ui===void 0?et===bt||Se(et,bt,te,ie,he):ui)){je=!1;break}lt||(lt=Oe=="constructor")}if(je&&!lt){var en=z.constructor,tn=J.constructor;en!=tn&&"constructor"in z&&"constructor"in J&&!(typeof en=="function"&&en instanceof en&&typeof tn=="function"&&tn instanceof tn)&&(je=!1)}return he.delete(z),he.delete(J),je}function ii(z){return Lr(z,Yr,Wr)}function Zt(z,J){var te=z.__data__;return zr(J)?te[typeof J=="string"?"string":"hash"]:te.map}function _t(z,J){var te=bn(z,J);return Fr(te)?te:void 0}function Pr(z){var J=ce.call(z,gt),te=z[gt];try{z[gt]=void 0;var ie=!0}catch{}var Se=$e.call(z);return ie&&(J?z[gt]=te:delete z[gt]),Se}var Wr=Zn?function(z){return z==null?[]:(z=Object(z),Ce(Zn(z),function(J){return st.call(z,J)}))}:Qr,at=Wt;(Cn&&at(new Cn(new ArrayBuffer(1)))!=x||Bt&&at(new Bt)!=c||En&&at(En.resolve())!=D||Sn&&at(new Sn)!=g||Dn&&at(new Dn)!=_)&&(at=function(z){var J=Wt(z),te=J==y?z.constructor:void 0,ie=te?yt(te):"";if(ie)switch(ie){case rr:return x;case sr:return c;case or:return D;case ar:return g;case lr:return _}return J});function Hr(z,J){return J=J??h,!!J&&(typeof z=="number"||H.test(z))&&z>-1&&z%1==0&&z<J}function zr(z){var J=typeof z;return J=="string"||J=="number"||J=="symbol"||J=="boolean"?z!=="__proto__":z===null}function jr(z){return!!Ee&&Ee in z}function Vr(z){var J=z&&z.constructor,te=typeof J=="function"&&J.prototype||re;return z===te}function Ur(z){return $e.call(z)}function yt(z){if(z!=null){try{return de.call(z)}catch{}try{return z+""}catch{}}return""}function ri(z,J){return z===J||z!==z&&J!==J}var Gr=ei(function(){return arguments}())?ei:function(z){return Ht(z)&&ce.call(z,"callee")&&!st.call(z,"callee")},qt=Array.isArray;function Kr(z){return z!=null&&oi(z.length)&&!si(z)}var xn=nr||Xr;function Jr(z,J){return ti(z,J)}function si(z){if(!ai(z))return!1;var J=Wt(z);return J==l||J==s||J==p||J==E}function oi(z){return typeof z=="number"&&z>-1&&z%1==0&&z<=h}function ai(z){var J=typeof z;return z!=null&&(J=="object"||J=="function")}function Ht(z){return z!=null&&typeof z=="object"}var li=ke?Rt(ke):Rr;function Yr(z){return Kr(z)?Mr(z):Or(z)}function Qr(){return[]}function Xr(){return!1}L.exports=Jr})(gn,gn.exports);var Gi=gn.exports,Je={};Object.defineProperty(Je,"__esModule",{value:!0});Je.getAceInstance=Je.debounce=Je.editorEvents=Je.editorOptions=void 0;var uo=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"];Je.editorOptions=uo;var ho=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"];Je.editorEvents=ho;var co=function(){var L;return typeof window>"u"?(He.window={},L=fn,delete He.window):window.ace?(L=window.ace,L.acequire=window.ace.require||window.ace.acequire):L=fn,L};Je.getAceInstance=co;var po=function(L,i){var n=null;return function(){var u=this,v=arguments;clearTimeout(n),n=setTimeout(function(){L.apply(u,v)},i)}};Je.debounce=po;var fo=Dt&&Dt.__extends||function(){var L=function(i,n){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,v){u.__proto__=v}||function(u,v){for(var a in v)Object.prototype.hasOwnProperty.call(v,a)&&(u[a]=v[a])},L(i,n)};return function(i,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");L(i,n);function u(){this.constructor=i}i.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),jn=Dt&&Dt.__assign||function(){return jn=Object.assign||function(L){for(var i,n=1,u=arguments.length;n<u;n++){i=arguments[n];for(var v in i)Object.prototype.hasOwnProperty.call(i,v)&&(L[v]=i[v])}return L},jn.apply(this,arguments)};Object.defineProperty(Dt,"__esModule",{value:!0});var go=fn,oe=Un,vi=pt,on=Gi,Lt=Je,yi=(0,Lt.getAceInstance)(),mo=function(L){fo(i,L);function i(n){var u=L.call(this,n)||this;return Lt.editorEvents.forEach(function(v){u[v]=u[v].bind(u)}),u.debounce=Lt.debounce,u}return i.prototype.isInShadow=function(n){for(var u=n&&n.parentNode;u;){if(u.toString()==="[object ShadowRoot]")return!0;u=u.parentNode}return!1},i.prototype.componentDidMount=function(){var n=this,u=this.props,v=u.className,a=u.onBeforeLoad,h=u.onValidate,d=u.mode,o=u.focus,p=u.theme,e=u.fontSize,t=u.lineHeight,r=u.value,l=u.defaultValue,s=u.showGutter,c=u.wrapEnabled,f=u.showPrintMargin,m=u.scrollMargin,y=m===void 0?[0,0,0,0]:m,D=u.keyboardHandler,E=u.onLoad,b=u.commands,g=u.annotations,S=u.markers,T=u.placeholder;this.editor=yi.edit(this.refEditor),a&&a(yi);for(var k=Object.keys(this.props.editorProps),_=0;_<k.length;_++)this.editor[k[_]]=this.props.editorProps[k[_]];this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),this.editor.renderer.setScrollMargin(y[0],y[1],y[2],y[3]),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.getSession().setMode(typeof d=="string"?"ace/mode/".concat(d):d),p&&p!==""&&this.editor.setTheme("ace/theme/".concat(p)),this.editor.setFontSize(typeof e=="number"?"".concat(e,"px"):e),t&&(this.editor.container.style.lineHeight=typeof t=="number"?"".concat(t,"px"):"".concat(t),this.editor.renderer.updateFontSize()),this.editor.getSession().setValue(l||r||""),this.props.navigateToFileEnd&&this.editor.navigateFileEnd(),this.editor.renderer.setShowGutter(s),this.editor.getSession().setUseWrapMode(c),this.editor.setShowPrintMargin(f),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),h&&this.editor.getSession().on("changeAnnotation",function(){var x=n.editor.getSession().getAnnotations();n.props.onValidate(x)}),this.editor.session.on("changeScrollTop",this.onScroll),this.editor.getSession().setAnnotations(g||[]),S&&S.length>0&&this.handleMarkers(S);var R=this.editor.$options;Lt.editorOptions.forEach(function(x){R.hasOwnProperty(x)?n.editor.setOption(x,n.props[x]):n.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(b)&&b.forEach(function(x){typeof x.exec=="string"?n.editor.commands.bindKey(x.bindKey,x.exec):n.editor.commands.addCommand(x)}),D&&this.editor.setKeyboardHandler("ace/keyboard/"+D),v&&(this.refEditor.className+=" "+v),E&&E(this.editor),this.editor.resize(),o&&this.editor.focus()},i.prototype.componentDidUpdate=function(n){for(var u=n,v=this.props,a=0;a<Lt.editorOptions.length;a++){var h=Lt.editorOptions[a];v[h]!==u[h]&&this.editor.setOption(h,v[h])}if(v.className!==u.className){var d=this.refEditor.className,o=d.trim().split(" "),p=u.className.trim().split(" ");p.forEach(function(r){var l=o.indexOf(r);o.splice(l,1)}),this.refEditor.className=" "+v.className+" "+o.join(" ")}var e=this.editor&&v.value!=null&&this.editor.getValue()!==v.value;if(e){this.silent=!0;var t=this.editor.session.selection.toJSON();this.editor.setValue(v.value,v.cursorStart),this.editor.session.selection.fromJSON(t),this.silent=!1}v.placeholder!==u.placeholder&&this.updatePlaceholder(),v.mode!==u.mode&&this.editor.getSession().setMode(typeof v.mode=="string"?"ace/mode/".concat(v.mode):v.mode),v.theme!==u.theme&&this.editor.setTheme("ace/theme/"+v.theme),v.keyboardHandler!==u.keyboardHandler&&(v.keyboardHandler?this.editor.setKeyboardHandler("ace/keyboard/"+v.keyboardHandler):this.editor.setKeyboardHandler(null)),v.fontSize!==u.fontSize&&this.editor.setFontSize(typeof v.fontSize=="number"?"".concat(v.fontSize,"px"):v.fontSize),v.lineHeight!==u.lineHeight&&(this.editor.container.style.lineHeight=typeof v.lineHeight=="number"?"".concat(v.lineHeight,"px"):v.lineHeight,this.editor.renderer.updateFontSize()),v.wrapEnabled!==u.wrapEnabled&&this.editor.getSession().setUseWrapMode(v.wrapEnabled),v.showPrintMargin!==u.showPrintMargin&&this.editor.setShowPrintMargin(v.showPrintMargin),v.showGutter!==u.showGutter&&this.editor.renderer.setShowGutter(v.showGutter),on(v.setOptions,u.setOptions)||this.handleOptions(v),(e||!on(v.annotations,u.annotations))&&this.editor.getSession().setAnnotations(v.annotations||[]),!on(v.markers,u.markers)&&Array.isArray(v.markers)&&this.handleMarkers(v.markers),on(v.scrollMargin,u.scrollMargin)||this.handleScrollMargins(v.scrollMargin),(n.height!==this.props.height||n.width!==this.props.width)&&this.editor.resize(),this.props.focus&&!n.focus&&this.editor.focus()},i.prototype.handleScrollMargins=function(n){n===void 0&&(n=[0,0,0,0]),this.editor.renderer.setScrollMargin(n[0],n[1],n[2],n[3])},i.prototype.componentWillUnmount=function(){this.editor&&(this.editor.destroy(),this.editor=null)},i.prototype.onChange=function(n){if(this.editor&&this.props.onChange&&!this.silent){var u=this.editor.getValue();this.props.onChange(u,n)}},i.prototype.onSelectionChange=function(n){if(this.props.onSelectionChange){var u=this.editor.getSelection();this.props.onSelectionChange(u,n)}},i.prototype.onCursorChange=function(n){if(this.props.onCursorChange){var u=this.editor.getSelection();this.props.onCursorChange(u,n)}},i.prototype.onInput=function(n){this.props.onInput&&this.props.onInput(n),this.props.placeholder&&this.updatePlaceholder()},i.prototype.onFocus=function(n){this.props.onFocus&&this.props.onFocus(n,this.editor)},i.prototype.onBlur=function(n){this.props.onBlur&&this.props.onBlur(n,this.editor)},i.prototype.onCopy=function(n){var u=n.text;this.props.onCopy&&this.props.onCopy(u)},i.prototype.onPaste=function(n){var u=n.text;this.props.onPaste&&this.props.onPaste(u)},i.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},i.prototype.handleOptions=function(n){for(var u=Object.keys(n.setOptions),v=0;v<u.length;v++)this.editor.setOption(u[v],n.setOptions[u[v]])},i.prototype.handleMarkers=function(n){var u=this,v=this.editor.getSession().getMarkers(!0);for(var a in v)v.hasOwnProperty(a)&&this.editor.getSession().removeMarker(v[a].id);v=this.editor.getSession().getMarkers(!1);for(var a in v)v.hasOwnProperty(a)&&v[a].clazz!=="ace_active-line"&&v[a].clazz!=="ace_selected-word"&&this.editor.getSession().removeMarker(v[a].id);n.forEach(function(h){var d=h.startRow,o=h.startCol,p=h.endRow,e=h.endCol,t=h.className,r=h.type,l=h.inFront,s=l===void 0?!1:l,c=new go.Range(d,o,p,e);u.editor.getSession().addMarker(c,t,r,s)})},i.prototype.updatePlaceholder=function(){var n=this.editor,u=this.props.placeholder,v=!n.session.getValue().length,a=n.renderer.placeholderNode;!v&&a?(n.renderer.scroller.removeChild(n.renderer.placeholderNode),n.renderer.placeholderNode=null):v&&!a?(a=n.renderer.placeholderNode=document.createElement("div"),a.textContent=u||"",a.className="ace_comment ace_placeholder",a.style.padding="0 9px",a.style.position="absolute",a.style.zIndex="3",n.renderer.scroller.appendChild(a)):v&&a&&(a.textContent=u)},i.prototype.updateRef=function(n){this.refEditor=n},i.prototype.render=function(){var n=this.props,u=n.name,v=n.width,a=n.height,h=n.style,d=jn({width:v,height:a},h);return vi.createElement("div",{ref:this.updateRef,id:u,style:d})},i.propTypes={mode:oe.oneOfType([oe.string,oe.object]),focus:oe.bool,theme:oe.string,name:oe.string,className:oe.string,height:oe.string,width:oe.string,fontSize:oe.oneOfType([oe.number,oe.string]),lineHeight:oe.oneOfType([oe.number,oe.string]),showGutter:oe.bool,onChange:oe.func,onCopy:oe.func,onPaste:oe.func,onFocus:oe.func,onInput:oe.func,onBlur:oe.func,onScroll:oe.func,value:oe.string,defaultValue:oe.string,onLoad:oe.func,onSelectionChange:oe.func,onCursorChange:oe.func,onBeforeLoad:oe.func,onValidate:oe.func,minLines:oe.number,maxLines:oe.number,readOnly:oe.bool,highlightActiveLine:oe.bool,tabSize:oe.number,showPrintMargin:oe.bool,cursorStart:oe.number,debounceChangePeriod:oe.number,editorProps:oe.object,setOptions:oe.object,style:oe.object,scrollMargin:oe.array,annotations:oe.array,markers:oe.array,keyboardHandler:oe.string,wrapEnabled:oe.bool,enableSnippets:oe.bool,enableBasicAutocompletion:oe.oneOfType([oe.bool,oe.array]),enableLiveAutocompletion:oe.oneOfType([oe.bool,oe.array]),navigateToFileEnd:oe.bool,commands:oe.array,placeholder:oe.string},i.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},i}(vi.Component);Dt.default=mo;var Gt={},ft={},Ki={exports:{}};(function(L,i){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(n,u,v){var a=n("./lib/oop");n("./lib/lang");var h=n("./lib/event_emitter").EventEmitter,d=n("./editor").Editor,o=n("./virtual_renderer").VirtualRenderer,p=n("./edit_session").EditSession,e;e=function(t,r,l){this.BELOW=1,this.BESIDE=0,this.$container=t,this.$theme=r,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(l||1),this.$cEditor=this.$editors[0],this.on("focus",function(s){this.$cEditor=s}.bind(this))},function(){a.implement(this,h),this.$createEditor=function(){var t=document.createElement("div");t.className=this.$editorCSS,t.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(t);var r=new d(new o(t,this.$theme));return r.on("focus",function(){this._emit("focus",r)}.bind(this)),this.$editors.push(r),r.setFontSize(this.$fontSize),r},this.setSplits=function(t){var r;if(t<1)throw"The number of splits have to be > 0!";if(t!=this.$splits){if(t>this.$splits){for(;this.$splits<this.$editors.length&&this.$splits<t;)r=this.$editors[this.$splits],this.$container.appendChild(r.container),r.setFontSize(this.$fontSize),this.$splits++;for(;this.$splits<t;)this.$createEditor(),this.$splits++}else for(;this.$splits>t;)r=this.$editors[this.$splits-1],this.$container.removeChild(r.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(t){return this.$editors[t]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(t){this.$editors.forEach(function(r){r.setTheme(t)})},this.setKeyboardHandler=function(t){this.$editors.forEach(function(r){r.setKeyboardHandler(t)})},this.forEach=function(t,r){this.$editors.forEach(t,r)},this.$fontSize="",this.setFontSize=function(t){this.$fontSize=t,this.forEach(function(r){r.setFontSize(t)})},this.$cloneSession=function(t){var r=new p(t.getDocument(),t.getMode()),l=t.getUndoManager();return r.setUndoManager(l),r.setTabSize(t.getTabSize()),r.setUseSoftTabs(t.getUseSoftTabs()),r.setOverwrite(t.getOverwrite()),r.setBreakpoints(t.getBreakpoints()),r.setUseWrapMode(t.getUseWrapMode()),r.setUseWorker(t.getUseWorker()),r.setWrapLimitRange(t.$wrapLimitRange.min,t.$wrapLimitRange.max),r.$foldData=t.$cloneFoldData(),r},this.setSession=function(t,r){var l;r==null?l=this.$cEditor:l=this.$editors[r];var s=this.$editors.some(function(c){return c.session===t});return s&&(t=this.$cloneSession(t)),l.setSession(t),t},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(t){this.$orientation!=t&&(this.$orientation=t,this.resize())},this.resize=function(){var t=this.$container.clientWidth,r=this.$container.clientHeight,l;if(this.$orientation==this.BESIDE)for(var s=t/this.$splits,c=0;c<this.$splits;c++)l=this.$editors[c],l.container.style.width=s+"px",l.container.style.top="0px",l.container.style.left=c*s+"px",l.container.style.height=r+"px",l.resize();else for(var f=r/this.$splits,c=0;c<this.$splits;c++)l=this.$editors[c],l.container.style.width=t+"px",l.container.style.top=c*f+"px",l.container.style.left="0px",l.container.style.height=f+"px",l.resize()}}.call(e.prototype),u.Split=e}),ace.define("ace/ext/split",["require","exports","module","ace/split"],function(n,u,v){v.exports=n("../split")}),function(){ace.require(["ace/ext/split"],function(n){L&&(L.exports=n)})}()})(Ki);var vo=Ki.exports,yo="Expected a function",Ji="__lodash_hash_undefined__",bo="[object Function]",wo="[object GeneratorFunction]",Co="[object Symbol]",Eo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,So=/^\w*$/,Do=/^\./,Ao=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xo=/[\\^$.*+?()[\]{}|]/g,$o=/\\(\\)?/g,To=/^\[object .+?Constructor\]$/,_o=typeof He=="object"&&He&&He.Object===Object&&He,ko=typeof self=="object"&&self&&self.Object===Object&&self,Jn=_o||ko||Function("return this")();function Mo(L,i){return L==null?void 0:L[i]}function Lo(L){var i=!1;if(L!=null&&typeof L.toString!="function")try{i=!!(L+"")}catch{}return i}var Io=Array.prototype,Fo=Function.prototype,Yi=Object.prototype,Ln=Jn["__core-js_shared__"],bi=function(){var L=/[^.]+$/.exec(Ln&&Ln.keys&&Ln.keys.IE_PROTO||"");return L?"Symbol(src)_1."+L:""}(),Qi=Fo.toString,Yn=Yi.hasOwnProperty,Xi=Yi.toString,Ro=RegExp("^"+Qi.call(Yn).replace(xo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wi=Jn.Symbol,Oo=Io.splice,No=Zi(Jn,"Map"),Kt=Zi(Object,"create"),Ci=wi?wi.prototype:void 0,Ei=Ci?Ci.toString:void 0;function At(L){var i=-1,n=L?L.length:0;for(this.clear();++i<n;){var u=L[i];this.set(u[0],u[1])}}function Bo(){this.__data__=Kt?Kt(null):{}}function Po(L){return this.has(L)&&delete this.__data__[L]}function Wo(L){var i=this.__data__;if(Kt){var n=i[L];return n===Ji?void 0:n}return Yn.call(i,L)?i[L]:void 0}function Ho(L){var i=this.__data__;return Kt?i[L]!==void 0:Yn.call(i,L)}function zo(L,i){var n=this.__data__;return n[L]=Kt&&i===void 0?Ji:i,this}At.prototype.clear=Bo;At.prototype.delete=Po;At.prototype.get=Wo;At.prototype.has=Ho;At.prototype.set=zo;function Ft(L){var i=-1,n=L?L.length:0;for(this.clear();++i<n;){var u=L[i];this.set(u[0],u[1])}}function jo(){this.__data__=[]}function Vo(L){var i=this.__data__,n=vn(i,L);if(n<0)return!1;var u=i.length-1;return n==u?i.pop():Oo.call(i,n,1),!0}function Uo(L){var i=this.__data__,n=vn(i,L);return n<0?void 0:i[n][1]}function Go(L){return vn(this.__data__,L)>-1}function Ko(L,i){var n=this.__data__,u=vn(n,L);return u<0?n.push([L,i]):n[u][1]=i,this}Ft.prototype.clear=jo;Ft.prototype.delete=Vo;Ft.prototype.get=Uo;Ft.prototype.has=Go;Ft.prototype.set=Ko;function xt(L){var i=-1,n=L?L.length:0;for(this.clear();++i<n;){var u=L[i];this.set(u[0],u[1])}}function Jo(){this.__data__={hash:new At,map:new(No||Ft),string:new At}}function Yo(L){return yn(this,L).delete(L)}function Qo(L){return yn(this,L).get(L)}function Xo(L){return yn(this,L).has(L)}function Zo(L,i){return yn(this,L).set(L,i),this}xt.prototype.clear=Jo;xt.prototype.delete=Yo;xt.prototype.get=Qo;xt.prototype.has=Xo;xt.prototype.set=Zo;function vn(L,i){for(var n=L.length;n--;)if(ua(L[n][0],i))return n;return-1}function qo(L,i){i=ia(i,L)?[i]:na(i);for(var n=0,u=i.length;L!=null&&n<u;)L=L[aa(i[n++])];return n&&n==u?L:void 0}function ea(L){if(!er(L)||sa(L))return!1;var i=ha(L)||Lo(L)?Ro:To;return i.test(la(L))}function ta(L){if(typeof L=="string")return L;if(Xn(L))return Ei?Ei.call(L):"";var i=L+"";return i=="0"&&1/L==-1/0?"-0":i}function na(L){return qi(L)?L:oa(L)}function yn(L,i){var n=L.__data__;return ra(i)?n[typeof i=="string"?"string":"hash"]:n.map}function Zi(L,i){var n=Mo(L,i);return ea(n)?n:void 0}function ia(L,i){if(qi(L))return!1;var n=typeof L;return n=="number"||n=="symbol"||n=="boolean"||L==null||Xn(L)?!0:So.test(L)||!Eo.test(L)||i!=null&&L in Object(i)}function ra(L){var i=typeof L;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?L!=="__proto__":L===null}function sa(L){return!!bi&&bi in L}var oa=Qn(function(L){L=pa(L);var i=[];return Do.test(L)&&i.push(""),L.replace(Ao,function(n,u,v,a){i.push(v?a.replace($o,"$1"):u||n)}),i});function aa(L){if(typeof L=="string"||Xn(L))return L;var i=L+"";return i=="0"&&1/L==-1/0?"-0":i}function la(L){if(L!=null){try{return Qi.call(L)}catch{}try{return L+""}catch{}}return""}function Qn(L,i){if(typeof L!="function"||i&&typeof i!="function")throw new TypeError(yo);var n=function(){var u=arguments,v=i?i.apply(this,u):u[0],a=n.cache;if(a.has(v))return a.get(v);var h=L.apply(this,u);return n.cache=a.set(v,h),h};return n.cache=new(Qn.Cache||xt),n}Qn.Cache=xt;function ua(L,i){return L===i||L!==L&&i!==i}var qi=Array.isArray;function ha(L){var i=er(L)?Xi.call(L):"";return i==bo||i==wo}function er(L){var i=typeof L;return!!L&&(i=="object"||i=="function")}function ca(L){return!!L&&typeof L=="object"}function Xn(L){return typeof L=="symbol"||ca(L)&&Xi.call(L)==Co}function pa(L){return L==null?"":ta(L)}function da(L,i,n){var u=L==null?void 0:qo(L,i);return u===void 0?n:u}var fa=da,ga=ft&&ft.__extends||function(){var L=function(i,n){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,v){u.__proto__=v}||function(u,v){for(var a in v)Object.prototype.hasOwnProperty.call(v,a)&&(u[a]=v[a])},L(i,n)};return function(i,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");L(i,n);function u(){this.constructor=i}i.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}(),Vn=ft&&ft.__assign||function(){return Vn=Object.assign||function(L){for(var i,n=1,u=arguments.length;n<u;n++){i=arguments[n];for(var v in i)Object.prototype.hasOwnProperty.call(i,v)&&(L[v]=i[v])}return L},Vn.apply(this,arguments)};Object.defineProperty(ft,"__esModule",{value:!0});var St=Je,In=(0,St.getAceInstance)(),ma=fn,va=vo,le=Un,Si=pt,Fn=Gi,tt=fa,ya=function(L){ga(i,L);function i(n){var u=L.call(this,n)||this;return St.editorEvents.forEach(function(v){u[v]=u[v].bind(u)}),u.debounce=St.debounce,u}return i.prototype.isInShadow=function(n){for(var u=n&&n.parentNode;u;){if(u.toString()==="[object ShadowRoot]")return!0;u=u.parentNode}return!1},i.prototype.componentDidMount=function(){var n=this,u=this.props,v=u.className,a=u.onBeforeLoad,h=u.mode,d=u.focus,o=u.theme,p=u.fontSize,e=u.value,t=u.defaultValue,r=u.cursorStart,l=u.showGutter,s=u.wrapEnabled,c=u.showPrintMargin,f=u.scrollMargin,m=f===void 0?[0,0,0,0]:f,y=u.keyboardHandler,D=u.onLoad,E=u.commands,b=u.annotations,g=u.markers,S=u.splits;this.editor=In.edit(this.refEditor),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.setTheme("ace/theme/".concat(o)),a&&a(In);var T=Object.keys(this.props.editorProps),k=new va.Split(this.editor.container,"ace/theme/".concat(o),S);this.editor.env.split=k,this.splitEditor=k.getEditor(0),this.split=k,this.editor.setShowPrintMargin(!1),this.editor.renderer.setShowGutter(!1);var _=this.splitEditor.$options;this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),k.forEach(function(x,A){for(var C=0;C<T.length;C++)x[T[C]]=n.props.editorProps[T[C]];var w=tt(t,A),$=tt(e,A,"");x.session.setUndoManager(new In.UndoManager),x.setTheme("ace/theme/".concat(o)),x.renderer.setScrollMargin(m[0],m[1],m[2],m[3]),x.getSession().setMode("ace/mode/".concat(h)),x.setFontSize(p),x.renderer.setShowGutter(l),x.getSession().setUseWrapMode(s),x.setShowPrintMargin(c),x.on("focus",n.onFocus),x.on("blur",n.onBlur),x.on("input",n.onInput),x.on("copy",n.onCopy),x.on("paste",n.onPaste),x.on("change",n.onChange),x.getSession().selection.on("changeSelection",n.onSelectionChange),x.getSession().selection.on("changeCursor",n.onCursorChange),x.session.on("changeScrollTop",n.onScroll),x.setValue(w===void 0?$:w,r);var I=tt(b,A,[]),F=tt(g,A,[]);x.getSession().setAnnotations(I),F&&F.length>0&&n.handleMarkers(F,x);for(var C=0;C<St.editorOptions.length;C++){var O=St.editorOptions[C];_.hasOwnProperty(O)?x.setOption(O,n.props[O]):n.props[O]&&console.warn("ReaceAce: editor option ".concat(O," was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"))}n.handleOptions(n.props,x),Array.isArray(E)&&E.forEach(function(B){typeof B.exec=="string"?x.commands.bindKey(B.bindKey,B.exec):x.commands.addCommand(B)}),y&&x.setKeyboardHandler("ace/keyboard/"+y)}),v&&(this.refEditor.className+=" "+v),d&&this.splitEditor.focus();var R=this.editor.env.split;R.setOrientation(this.props.orientation==="below"?R.BELOW:R.BESIDE),R.resize(!0),D&&D(R)},i.prototype.componentDidUpdate=function(n){var u=this,v=n,a=this.props,h=this.editor.env.split;if(a.splits!==v.splits&&h.setSplits(a.splits),a.orientation!==v.orientation&&h.setOrientation(a.orientation==="below"?h.BELOW:h.BESIDE),h.forEach(function(e,t){a.mode!==v.mode&&e.getSession().setMode("ace/mode/"+a.mode),a.keyboardHandler!==v.keyboardHandler&&(a.keyboardHandler?e.setKeyboardHandler("ace/keyboard/"+a.keyboardHandler):e.setKeyboardHandler(null)),a.fontSize!==v.fontSize&&e.setFontSize(a.fontSize),a.wrapEnabled!==v.wrapEnabled&&e.getSession().setUseWrapMode(a.wrapEnabled),a.showPrintMargin!==v.showPrintMargin&&e.setShowPrintMargin(a.showPrintMargin),a.showGutter!==v.showGutter&&e.renderer.setShowGutter(a.showGutter);for(var r=0;r<St.editorOptions.length;r++){var l=St.editorOptions[r];a[l]!==v[l]&&e.setOption(l,a[l])}Fn(a.setOptions,v.setOptions)||u.handleOptions(a,e);var s=tt(a.value,t,"");if(e.getValue()!==s){u.silent=!0;var c=e.session.selection.toJSON();e.setValue(s,a.cursorStart),e.session.selection.fromJSON(c),u.silent=!1}var f=tt(a.annotations,t,[]),m=tt(v.annotations,t,[]);Fn(f,m)||e.getSession().setAnnotations(f);var y=tt(a.markers,t,[]),D=tt(v.markers,t,[]);!Fn(y,D)&&Array.isArray(y)&&u.handleMarkers(y,e)}),a.className!==v.className){var d=this.refEditor.className,o=d.trim().split(" "),p=v.className.trim().split(" ");p.forEach(function(e){var t=o.indexOf(e);o.splice(t,1)}),this.refEditor.className=" "+a.className+" "+o.join(" ")}a.theme!==v.theme&&h.setTheme("ace/theme/"+a.theme),a.focus&&!v.focus&&this.splitEditor.focus(),(a.height!==this.props.height||a.width!==this.props.width)&&this.editor.resize()},i.prototype.componentWillUnmount=function(){this.editor.destroy(),this.editor=null},i.prototype.onChange=function(n){if(this.props.onChange&&!this.silent){var u=[];this.editor.env.split.forEach(function(v){u.push(v.getValue())}),this.props.onChange(u,n)}},i.prototype.onSelectionChange=function(n){if(this.props.onSelectionChange){var u=[];this.editor.env.split.forEach(function(v){u.push(v.getSelection())}),this.props.onSelectionChange(u,n)}},i.prototype.onCursorChange=function(n){if(this.props.onCursorChange){var u=[];this.editor.env.split.forEach(function(v){u.push(v.getSelection())}),this.props.onCursorChange(u,n)}},i.prototype.onFocus=function(n){this.props.onFocus&&this.props.onFocus(n)},i.prototype.onInput=function(n){this.props.onInput&&this.props.onInput(n)},i.prototype.onBlur=function(n){this.props.onBlur&&this.props.onBlur(n)},i.prototype.onCopy=function(n){this.props.onCopy&&this.props.onCopy(n)},i.prototype.onPaste=function(n){this.props.onPaste&&this.props.onPaste(n)},i.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},i.prototype.handleOptions=function(n,u){for(var v=Object.keys(n.setOptions),a=0;a<v.length;a++)u.setOption(v[a],n.setOptions[v[a]])},i.prototype.handleMarkers=function(n,u){var v=u.getSession().getMarkers(!0);for(var a in v)v.hasOwnProperty(a)&&u.getSession().removeMarker(v[a].id);v=u.getSession().getMarkers(!1);for(var a in v)v.hasOwnProperty(a)&&u.getSession().removeMarker(v[a].id);n.forEach(function(h){var d=h.startRow,o=h.startCol,p=h.endRow,e=h.endCol,t=h.className,r=h.type,l=h.inFront,s=l===void 0?!1:l,c=new ma.Range(d,o,p,e);u.getSession().addMarker(c,t,r,s)})},i.prototype.updateRef=function(n){this.refEditor=n},i.prototype.render=function(){var n=this.props,u=n.name,v=n.width,a=n.height,h=n.style,d=Vn({width:v,height:a},h);return Si.createElement("div",{ref:this.updateRef,id:u,style:d})},i.propTypes={className:le.string,debounceChangePeriod:le.number,defaultValue:le.arrayOf(le.string),focus:le.bool,fontSize:le.oneOfType([le.number,le.string]),height:le.string,mode:le.string,name:le.string,onBlur:le.func,onChange:le.func,onCopy:le.func,onFocus:le.func,onInput:le.func,onLoad:le.func,onPaste:le.func,onScroll:le.func,orientation:le.string,showGutter:le.bool,splits:le.number,theme:le.string,value:le.arrayOf(le.string),width:le.string,onSelectionChange:le.func,onCursorChange:le.func,onBeforeLoad:le.func,minLines:le.number,maxLines:le.number,readOnly:le.bool,highlightActiveLine:le.bool,tabSize:le.number,showPrintMargin:le.bool,cursorStart:le.number,editorProps:le.object,setOptions:le.object,style:le.object,scrollMargin:le.array,annotations:le.array,markers:le.array,keyboardHandler:le.string,wrapEnabled:le.bool,enableBasicAutocompletion:le.oneOfType([le.bool,le.array]),enableLiveAutocompletion:le.oneOfType([le.bool,le.array]),commands:le.array},i.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},i}(Si.Component);ft.default=ya;var tr={exports:{}};(function(L){var i=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},n=-1,u=1,v=0;i.Diff=function(a,h){return[a,h]},i.prototype.diff_main=function(a,h,d,o){typeof o>"u"&&(this.Diff_Timeout<=0?o=Number.MAX_VALUE:o=new Date().getTime()+this.Diff_Timeout*1e3);var p=o;if(a==null||h==null)throw new Error("Null input. (diff_main)");if(a==h)return a?[new i.Diff(v,a)]:[];typeof d>"u"&&(d=!0);var e=d,t=this.diff_commonPrefix(a,h),r=a.substring(0,t);a=a.substring(t),h=h.substring(t),t=this.diff_commonSuffix(a,h);var l=a.substring(a.length-t);a=a.substring(0,a.length-t),h=h.substring(0,h.length-t);var s=this.diff_compute_(a,h,e,p);return r&&s.unshift(new i.Diff(v,r)),l&&s.push(new i.Diff(v,l)),this.diff_cleanupMerge(s),s},i.prototype.diff_compute_=function(a,h,d,o){var p;if(!a)return[new i.Diff(u,h)];if(!h)return[new i.Diff(n,a)];var e=a.length>h.length?a:h,t=a.length>h.length?h:a,r=e.indexOf(t);if(r!=-1)return p=[new i.Diff(u,e.substring(0,r)),new i.Diff(v,t),new i.Diff(u,e.substring(r+t.length))],a.length>h.length&&(p[0][0]=p[2][0]=n),p;if(t.length==1)return[new i.Diff(n,a),new i.Diff(u,h)];var l=this.diff_halfMatch_(a,h);if(l){var s=l[0],c=l[1],f=l[2],m=l[3],y=l[4],D=this.diff_main(s,f,d,o),E=this.diff_main(c,m,d,o);return D.concat([new i.Diff(v,y)],E)}return d&&a.length>100&&h.length>100?this.diff_lineMode_(a,h,o):this.diff_bisect_(a,h,o)},i.prototype.diff_lineMode_=function(a,h,d){var o=this.diff_linesToChars_(a,h);a=o.chars1,h=o.chars2;var p=o.lineArray,e=this.diff_main(a,h,!1,d);this.diff_charsToLines_(e,p),this.diff_cleanupSemantic(e),e.push(new i.Diff(v,""));for(var t=0,r=0,l=0,s="",c="";t<e.length;){switch(e[t][0]){case u:l++,c+=e[t][1];break;case n:r++,s+=e[t][1];break;case v:if(r>=1&&l>=1){e.splice(t-r-l,r+l),t=t-r-l;for(var f=this.diff_main(s,c,!1,d),m=f.length-1;m>=0;m--)e.splice(t,0,f[m]);t=t+f.length}l=0,r=0,s="",c="";break}t++}return e.pop(),e},i.prototype.diff_bisect_=function(a,h,d){for(var o=a.length,p=h.length,e=Math.ceil((o+p)/2),t=e,r=2*e,l=new Array(r),s=new Array(r),c=0;c<r;c++)l[c]=-1,s[c]=-1;l[t+1]=0,s[t+1]=0;for(var f=o-p,m=f%2!=0,y=0,D=0,E=0,b=0,g=0;g<e&&!(new Date().getTime()>d);g++){for(var S=-g+y;S<=g-D;S+=2){var T=t+S,k;S==-g||S!=g&&l[T-1]<l[T+1]?k=l[T+1]:k=l[T-1]+1;for(var _=k-S;k<o&&_<p&&a.charAt(k)==h.charAt(_);)k++,_++;if(l[T]=k,k>o)D+=2;else if(_>p)y+=2;else if(m){var R=t+f-S;if(R>=0&&R<r&&s[R]!=-1){var x=o-s[R];if(k>=x)return this.diff_bisectSplit_(a,h,k,_,d)}}}for(var A=-g+E;A<=g-b;A+=2){var R=t+A,x;A==-g||A!=g&&s[R-1]<s[R+1]?x=s[R+1]:x=s[R-1]+1;for(var C=x-A;x<o&&C<p&&a.charAt(o-x-1)==h.charAt(p-C-1);)x++,C++;if(s[R]=x,x>o)b+=2;else if(C>p)E+=2;else if(!m){var T=t+f-A;if(T>=0&&T<r&&l[T]!=-1){var k=l[T],_=t+k-T;if(x=o-x,k>=x)return this.diff_bisectSplit_(a,h,k,_,d)}}}}return[new i.Diff(n,a),new i.Diff(u,h)]},i.prototype.diff_bisectSplit_=function(a,h,d,o,p){var e=a.substring(0,d),t=h.substring(0,o),r=a.substring(d),l=h.substring(o),s=this.diff_main(e,t,!1,p),c=this.diff_main(r,l,!1,p);return s.concat(c)},i.prototype.diff_linesToChars_=function(a,h){var d=[],o={};d[0]="";function p(l){for(var s="",c=0,f=-1,m=d.length;f<l.length-1;){f=l.indexOf(`
999
- `,c),f==-1&&(f=l.length-1);var y=l.substring(c,f+1);(o.hasOwnProperty?o.hasOwnProperty(y):o[y]!==void 0)?s+=String.fromCharCode(o[y]):(m==e&&(y=l.substring(c),f=l.length),s+=String.fromCharCode(m),o[y]=m,d[m++]=y),c=f+1}return s}var e=4e4,t=p(a);e=65535;var r=p(h);return{chars1:t,chars2:r,lineArray:d}},i.prototype.diff_charsToLines_=function(a,h){for(var d=0;d<a.length;d++){for(var o=a[d][1],p=[],e=0;e<o.length;e++)p[e]=h[o.charCodeAt(e)];a[d][1]=p.join("")}},i.prototype.diff_commonPrefix=function(a,h){if(!a||!h||a.charAt(0)!=h.charAt(0))return 0;for(var d=0,o=Math.min(a.length,h.length),p=o,e=0;d<p;)a.substring(e,p)==h.substring(e,p)?(d=p,e=d):o=p,p=Math.floor((o-d)/2+d);return p},i.prototype.diff_commonSuffix=function(a,h){if(!a||!h||a.charAt(a.length-1)!=h.charAt(h.length-1))return 0;for(var d=0,o=Math.min(a.length,h.length),p=o,e=0;d<p;)a.substring(a.length-p,a.length-e)==h.substring(h.length-p,h.length-e)?(d=p,e=d):o=p,p=Math.floor((o-d)/2+d);return p},i.prototype.diff_commonOverlap_=function(a,h){var d=a.length,o=h.length;if(d==0||o==0)return 0;d>o?a=a.substring(d-o):d<o&&(h=h.substring(0,d));var p=Math.min(d,o);if(a==h)return p;for(var e=0,t=1;;){var r=a.substring(p-t),l=h.indexOf(r);if(l==-1)return e;t+=l,(l==0||a.substring(p-t)==h.substring(0,t))&&(e=t,t++)}},i.prototype.diff_halfMatch_=function(a,h){if(this.Diff_Timeout<=0)return null;var d=a.length>h.length?a:h,o=a.length>h.length?h:a;if(d.length<4||o.length*2<d.length)return null;var p=this;function e(D,E,b){for(var g=D.substring(b,b+Math.floor(D.length/4)),S=-1,T="",k,_,R,x;(S=E.indexOf(g,S+1))!=-1;){var A=p.diff_commonPrefix(D.substring(b),E.substring(S)),C=p.diff_commonSuffix(D.substring(0,b),E.substring(0,S));T.length<C+A&&(T=E.substring(S-C,S)+E.substring(S,S+A),k=D.substring(0,b-C),_=D.substring(b+A),R=E.substring(0,S-C),x=E.substring(S+A))}return T.length*2>=D.length?[k,_,R,x,T]:null}var t=e(d,o,Math.ceil(d.length/4)),r=e(d,o,Math.ceil(d.length/2)),l;if(!t&&!r)return null;r?t?l=t[4].length>r[4].length?t:r:l=r:l=t;var s,c,f,m;a.length>h.length?(s=l[0],c=l[1],f=l[2],m=l[3]):(f=l[0],m=l[1],s=l[2],c=l[3]);var y=l[4];return[s,c,f,m,y]},i.prototype.diff_cleanupSemantic=function(a){for(var h=!1,d=[],o=0,p=null,e=0,t=0,r=0,l=0,s=0;e<a.length;)a[e][0]==v?(d[o++]=e,t=l,r=s,l=0,s=0,p=a[e][1]):(a[e][0]==u?l+=a[e][1].length:s+=a[e][1].length,p&&p.length<=Math.max(t,r)&&p.length<=Math.max(l,s)&&(a.splice(d[o-1],0,new i.Diff(n,p)),a[d[o-1]+1][0]=u,o--,o--,e=o>0?d[o-1]:-1,t=0,r=0,l=0,s=0,p=null,h=!0)),e++;for(h&&this.diff_cleanupMerge(a),this.diff_cleanupSemanticLossless(a),e=1;e<a.length;){if(a[e-1][0]==n&&a[e][0]==u){var c=a[e-1][1],f=a[e][1],m=this.diff_commonOverlap_(c,f),y=this.diff_commonOverlap_(f,c);m>=y?(m>=c.length/2||m>=f.length/2)&&(a.splice(e,0,new i.Diff(v,f.substring(0,m))),a[e-1][1]=c.substring(0,c.length-m),a[e+1][1]=f.substring(m),e++):(y>=c.length/2||y>=f.length/2)&&(a.splice(e,0,new i.Diff(v,c.substring(0,y))),a[e-1][0]=u,a[e-1][1]=f.substring(0,f.length-y),a[e+1][0]=n,a[e+1][1]=c.substring(y),e++),e++}e++}},i.prototype.diff_cleanupSemanticLossless=function(a){function h(y,D){if(!y||!D)return 6;var E=y.charAt(y.length-1),b=D.charAt(0),g=E.match(i.nonAlphaNumericRegex_),S=b.match(i.nonAlphaNumericRegex_),T=g&&E.match(i.whitespaceRegex_),k=S&&b.match(i.whitespaceRegex_),_=T&&E.match(i.linebreakRegex_),R=k&&b.match(i.linebreakRegex_),x=_&&y.match(i.blanklineEndRegex_),A=R&&D.match(i.blanklineStartRegex_);return x||A?5:_||R?4:g&&!T&&k?3:T||k?2:g||S?1:0}for(var d=1;d<a.length-1;){if(a[d-1][0]==v&&a[d+1][0]==v){var o=a[d-1][1],p=a[d][1],e=a[d+1][1],t=this.diff_commonSuffix(o,p);if(t){var r=p.substring(p.length-t);o=o.substring(0,o.length-t),p=r+p.substring(0,p.length-t),e=r+e}for(var l=o,s=p,c=e,f=h(o,p)+h(p,e);p.charAt(0)===e.charAt(0);){o+=p.charAt(0),p=p.substring(1)+e.charAt(0),e=e.substring(1);var m=h(o,p)+h(p,e);m>=f&&(f=m,l=o,s=p,c=e)}a[d-1][1]!=l&&(l?a[d-1][1]=l:(a.splice(d-1,1),d--),a[d][1]=s,c?a[d+1][1]=c:(a.splice(d+1,1),d--))}d++}},i.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,i.whitespaceRegex_=/\s/,i.linebreakRegex_=/[\r\n]/,i.blanklineEndRegex_=/\n\r?\n$/,i.blanklineStartRegex_=/^\r?\n\r?\n/,i.prototype.diff_cleanupEfficiency=function(a){for(var h=!1,d=[],o=0,p=null,e=0,t=!1,r=!1,l=!1,s=!1;e<a.length;)a[e][0]==v?(a[e][1].length<this.Diff_EditCost&&(l||s)?(d[o++]=e,t=l,r=s,p=a[e][1]):(o=0,p=null),l=s=!1):(a[e][0]==n?s=!0:l=!0,p&&(t&&r&&l&&s||p.length<this.Diff_EditCost/2&&t+r+l+s==3)&&(a.splice(d[o-1],0,new i.Diff(n,p)),a[d[o-1]+1][0]=u,o--,p=null,t&&r?(l=s=!0,o=0):(o--,e=o>0?d[o-1]:-1,l=s=!1),h=!0)),e++;h&&this.diff_cleanupMerge(a)},i.prototype.diff_cleanupMerge=function(a){a.push(new i.Diff(v,""));for(var h=0,d=0,o=0,p="",e="",t;h<a.length;)switch(a[h][0]){case u:o++,e+=a[h][1],h++;break;case n:d++,p+=a[h][1],h++;break;case v:d+o>1?(d!==0&&o!==0&&(t=this.diff_commonPrefix(e,p),t!==0&&(h-d-o>0&&a[h-d-o-1][0]==v?a[h-d-o-1][1]+=e.substring(0,t):(a.splice(0,0,new i.Diff(v,e.substring(0,t))),h++),e=e.substring(t),p=p.substring(t)),t=this.diff_commonSuffix(e,p),t!==0&&(a[h][1]=e.substring(e.length-t)+a[h][1],e=e.substring(0,e.length-t),p=p.substring(0,p.length-t))),h-=d+o,a.splice(h,d+o),p.length&&(a.splice(h,0,new i.Diff(n,p)),h++),e.length&&(a.splice(h,0,new i.Diff(u,e)),h++),h++):h!==0&&a[h-1][0]==v?(a[h-1][1]+=a[h][1],a.splice(h,1)):h++,o=0,d=0,p="",e="";break}a[a.length-1][1]===""&&a.pop();var r=!1;for(h=1;h<a.length-1;)a[h-1][0]==v&&a[h+1][0]==v&&(a[h][1].substring(a[h][1].length-a[h-1][1].length)==a[h-1][1]?(a[h][1]=a[h-1][1]+a[h][1].substring(0,a[h][1].length-a[h-1][1].length),a[h+1][1]=a[h-1][1]+a[h+1][1],a.splice(h-1,1),r=!0):a[h][1].substring(0,a[h+1][1].length)==a[h+1][1]&&(a[h-1][1]+=a[h+1][1],a[h][1]=a[h][1].substring(a[h+1][1].length)+a[h+1][1],a.splice(h+1,1),r=!0)),h++;r&&this.diff_cleanupMerge(a)},i.prototype.diff_xIndex=function(a,h){var d=0,o=0,p=0,e=0,t;for(t=0;t<a.length&&(a[t][0]!==u&&(d+=a[t][1].length),a[t][0]!==n&&(o+=a[t][1].length),!(d>h));t++)p=d,e=o;return a.length!=t&&a[t][0]===n?e:e+(h-p)},i.prototype.diff_prettyHtml=function(a){for(var h=[],d=/&/g,o=/</g,p=/>/g,e=/\n/g,t=0;t<a.length;t++){var r=a[t][0],l=a[t][1],s=l.replace(d,"&amp;").replace(o,"&lt;").replace(p,"&gt;").replace(e,"&para;<br>");switch(r){case u:h[t]='<ins style="background:#e6ffe6;">'+s+"</ins>";break;case n:h[t]='<del style="background:#ffe6e6;">'+s+"</del>";break;case v:h[t]="<span>"+s+"</span>";break}}return h.join("")},i.prototype.diff_text1=function(a){for(var h=[],d=0;d<a.length;d++)a[d][0]!==u&&(h[d]=a[d][1]);return h.join("")},i.prototype.diff_text2=function(a){for(var h=[],d=0;d<a.length;d++)a[d][0]!==n&&(h[d]=a[d][1]);return h.join("")},i.prototype.diff_levenshtein=function(a){for(var h=0,d=0,o=0,p=0;p<a.length;p++){var e=a[p][0],t=a[p][1];switch(e){case u:d+=t.length;break;case n:o+=t.length;break;case v:h+=Math.max(d,o),d=0,o=0;break}}return h+=Math.max(d,o),h},i.prototype.diff_toDelta=function(a){for(var h=[],d=0;d<a.length;d++)switch(a[d][0]){case u:h[d]="+"+encodeURI(a[d][1]);break;case n:h[d]="-"+a[d][1].length;break;case v:h[d]="="+a[d][1].length;break}return h.join(" ").replace(/%20/g," ")},i.prototype.diff_fromDelta=function(a,h){for(var d=[],o=0,p=0,e=h.split(/\t/g),t=0;t<e.length;t++){var r=e[t].substring(1);switch(e[t].charAt(0)){case"+":try{d[o++]=new i.Diff(u,decodeURI(r))}catch{throw new Error("Illegal escape in diff_fromDelta: "+r)}break;case"-":case"=":var l=parseInt(r,10);if(isNaN(l)||l<0)throw new Error("Invalid number in diff_fromDelta: "+r);var s=a.substring(p,p+=l);e[t].charAt(0)=="="?d[o++]=new i.Diff(v,s):d[o++]=new i.Diff(n,s);break;default:if(e[t])throw new Error("Invalid diff operation in diff_fromDelta: "+e[t])}}if(p!=a.length)throw new Error("Delta length ("+p+") does not equal source text length ("+a.length+").");return d},i.prototype.match_main=function(a,h,d){if(a==null||h==null||d==null)throw new Error("Null input. (match_main)");return d=Math.max(0,Math.min(d,a.length)),a==h?0:a.length?a.substring(d,d+h.length)==h?d:this.match_bitap_(a,h,d):-1},i.prototype.match_bitap_=function(a,h,d){if(h.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var o=this.match_alphabet_(h),p=this;function e(k,_){var R=k/h.length,x=Math.abs(d-_);return p.Match_Distance?R+x/p.Match_Distance:x?1:R}var t=this.Match_Threshold,r=a.indexOf(h,d);r!=-1&&(t=Math.min(e(0,r),t),r=a.lastIndexOf(h,d+h.length),r!=-1&&(t=Math.min(e(0,r),t)));var l=1<<h.length-1;r=-1;for(var s,c,f=h.length+a.length,m,y=0;y<h.length;y++){for(s=0,c=f;s<c;)e(y,d+c)<=t?s=c:f=c,c=Math.floor((f-s)/2+s);f=c;var D=Math.max(1,d-c+1),E=Math.min(d+c,a.length)+h.length,b=Array(E+2);b[E+1]=(1<<y)-1;for(var g=E;g>=D;g--){var S=o[a.charAt(g-1)];if(y===0?b[g]=(b[g+1]<<1|1)&S:b[g]=(b[g+1]<<1|1)&S|((m[g+1]|m[g])<<1|1)|m[g+1],b[g]&l){var T=e(y,g-1);if(T<=t)if(t=T,r=g-1,r>d)D=Math.max(1,2*d-r);else break}}if(e(y+1,d)>t)break;m=b}return r},i.prototype.match_alphabet_=function(a){for(var h={},d=0;d<a.length;d++)h[a.charAt(d)]=0;for(var d=0;d<a.length;d++)h[a.charAt(d)]|=1<<a.length-d-1;return h},i.prototype.patch_addContext_=function(a,h){if(h.length!=0){if(a.start2===null)throw Error("patch not initialized");for(var d=h.substring(a.start2,a.start2+a.length1),o=0;h.indexOf(d)!=h.lastIndexOf(d)&&d.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,d=h.substring(a.start2-o,a.start2+a.length1+o);o+=this.Patch_Margin;var p=h.substring(a.start2-o,a.start2);p&&a.diffs.unshift(new i.Diff(v,p));var e=h.substring(a.start2+a.length1,a.start2+a.length1+o);e&&a.diffs.push(new i.Diff(v,e)),a.start1-=p.length,a.start2-=p.length,a.length1+=p.length+e.length,a.length2+=p.length+e.length}},i.prototype.patch_make=function(a,h,d){var o,p;if(typeof a=="string"&&typeof h=="string"&&typeof d>"u")o=a,p=this.diff_main(o,h,!0),p.length>2&&(this.diff_cleanupSemantic(p),this.diff_cleanupEfficiency(p));else if(a&&typeof a=="object"&&typeof h>"u"&&typeof d>"u")p=a,o=this.diff_text1(p);else if(typeof a=="string"&&h&&typeof h=="object"&&typeof d>"u")o=a,p=h;else if(typeof a=="string"&&typeof h=="string"&&d&&typeof d=="object")o=a,p=d;else throw new Error("Unknown call format to patch_make.");if(p.length===0)return[];for(var e=[],t=new i.patch_obj,r=0,l=0,s=0,c=o,f=o,m=0;m<p.length;m++){var y=p[m][0],D=p[m][1];switch(!r&&y!==v&&(t.start1=l,t.start2=s),y){case u:t.diffs[r++]=p[m],t.length2+=D.length,f=f.substring(0,s)+D+f.substring(s);break;case n:t.length1+=D.length,t.diffs[r++]=p[m],f=f.substring(0,s)+f.substring(s+D.length);break;case v:D.length<=2*this.Patch_Margin&&r&&p.length!=m+1?(t.diffs[r++]=p[m],t.length1+=D.length,t.length2+=D.length):D.length>=2*this.Patch_Margin&&r&&(this.patch_addContext_(t,c),e.push(t),t=new i.patch_obj,r=0,c=f,l=s);break}y!==u&&(l+=D.length),y!==n&&(s+=D.length)}return r&&(this.patch_addContext_(t,c),e.push(t)),e},i.prototype.patch_deepCopy=function(a){for(var h=[],d=0;d<a.length;d++){var o=a[d],p=new i.patch_obj;p.diffs=[];for(var e=0;e<o.diffs.length;e++)p.diffs[e]=new i.Diff(o.diffs[e][0],o.diffs[e][1]);p.start1=o.start1,p.start2=o.start2,p.length1=o.length1,p.length2=o.length2,h[d]=p}return h},i.prototype.patch_apply=function(a,h){if(a.length==0)return[h,[]];a=this.patch_deepCopy(a);var d=this.patch_addPadding(a);h=d+h+d,this.patch_splitMax(a);for(var o=0,p=[],e=0;e<a.length;e++){var t=a[e].start2+o,r=this.diff_text1(a[e].diffs),l,s=-1;if(r.length>this.Match_MaxBits?(l=this.match_main(h,r.substring(0,this.Match_MaxBits),t),l!=-1&&(s=this.match_main(h,r.substring(r.length-this.Match_MaxBits),t+r.length-this.Match_MaxBits),(s==-1||l>=s)&&(l=-1))):l=this.match_main(h,r,t),l==-1)p[e]=!1,o-=a[e].length2-a[e].length1;else{p[e]=!0,o=l-t;var c;if(s==-1?c=h.substring(l,l+r.length):c=h.substring(l,s+this.Match_MaxBits),r==c)h=h.substring(0,l)+this.diff_text2(a[e].diffs)+h.substring(l+r.length);else{var f=this.diff_main(r,c,!1);if(r.length>this.Match_MaxBits&&this.diff_levenshtein(f)/r.length>this.Patch_DeleteThreshold)p[e]=!1;else{this.diff_cleanupSemanticLossless(f);for(var m=0,y,D=0;D<a[e].diffs.length;D++){var E=a[e].diffs[D];E[0]!==v&&(y=this.diff_xIndex(f,m)),E[0]===u?h=h.substring(0,l+y)+E[1]+h.substring(l+y):E[0]===n&&(h=h.substring(0,l+y)+h.substring(l+this.diff_xIndex(f,m+E[1].length))),E[0]!==n&&(m+=E[1].length)}}}}}return h=h.substring(d.length,h.length-d.length),[h,p]},i.prototype.patch_addPadding=function(a){for(var h=this.Patch_Margin,d="",o=1;o<=h;o++)d+=String.fromCharCode(o);for(var o=0;o<a.length;o++)a[o].start1+=h,a[o].start2+=h;var p=a[0],e=p.diffs;if(e.length==0||e[0][0]!=v)e.unshift(new i.Diff(v,d)),p.start1-=h,p.start2-=h,p.length1+=h,p.length2+=h;else if(h>e[0][1].length){var t=h-e[0][1].length;e[0][1]=d.substring(e[0][1].length)+e[0][1],p.start1-=t,p.start2-=t,p.length1+=t,p.length2+=t}if(p=a[a.length-1],e=p.diffs,e.length==0||e[e.length-1][0]!=v)e.push(new i.Diff(v,d)),p.length1+=h,p.length2+=h;else if(h>e[e.length-1][1].length){var t=h-e[e.length-1][1].length;e[e.length-1][1]+=d.substring(0,t),p.length1+=t,p.length2+=t}return d},i.prototype.patch_splitMax=function(a){for(var h=this.Match_MaxBits,d=0;d<a.length;d++)if(!(a[d].length1<=h)){var o=a[d];a.splice(d--,1);for(var p=o.start1,e=o.start2,t="";o.diffs.length!==0;){var r=new i.patch_obj,l=!0;for(r.start1=p-t.length,r.start2=e-t.length,t!==""&&(r.length1=r.length2=t.length,r.diffs.push(new i.Diff(v,t)));o.diffs.length!==0&&r.length1<h-this.Patch_Margin;){var s=o.diffs[0][0],c=o.diffs[0][1];s===u?(r.length2+=c.length,e+=c.length,r.diffs.push(o.diffs.shift()),l=!1):s===n&&r.diffs.length==1&&r.diffs[0][0]==v&&c.length>2*h?(r.length1+=c.length,p+=c.length,l=!1,r.diffs.push(new i.Diff(s,c)),o.diffs.shift()):(c=c.substring(0,h-r.length1-this.Patch_Margin),r.length1+=c.length,p+=c.length,s===v?(r.length2+=c.length,e+=c.length):l=!1,r.diffs.push(new i.Diff(s,c)),c==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(c.length))}t=this.diff_text2(r.diffs),t=t.substring(t.length-this.Patch_Margin);var f=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);f!==""&&(r.length1+=f.length,r.length2+=f.length,r.diffs.length!==0&&r.diffs[r.diffs.length-1][0]===v?r.diffs[r.diffs.length-1][1]+=f:r.diffs.push(new i.Diff(v,f))),l||a.splice(++d,0,r)}}},i.prototype.patch_toText=function(a){for(var h=[],d=0;d<a.length;d++)h[d]=a[d];return h.join("")},i.prototype.patch_fromText=function(a){var h=[];if(!a)return h;for(var d=a.split(`
1000
- `),o=0,p=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<d.length;){var e=d[o].match(p);if(!e)throw new Error("Invalid patch string: "+d[o]);var t=new i.patch_obj;for(h.push(t),t.start1=parseInt(e[1],10),e[2]===""?(t.start1--,t.length1=1):e[2]=="0"?t.length1=0:(t.start1--,t.length1=parseInt(e[2],10)),t.start2=parseInt(e[3],10),e[4]===""?(t.start2--,t.length2=1):e[4]=="0"?t.length2=0:(t.start2--,t.length2=parseInt(e[4],10)),o++;o<d.length;){var r=d[o].charAt(0);try{var l=decodeURI(d[o].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+l)}if(r=="-")t.diffs.push(new i.Diff(n,l));else if(r=="+")t.diffs.push(new i.Diff(u,l));else if(r==" ")t.diffs.push(new i.Diff(v,l));else{if(r=="@")break;if(r!=="")throw new Error('Invalid patch mode "'+r+'" in: '+l)}o++}}return h},i.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},i.patch_obj.prototype.toString=function(){var a,h;this.length1===0?a=this.start1+",0":this.length1==1?a=this.start1+1:a=this.start1+1+","+this.length1,this.length2===0?h=this.start2+",0":this.length2==1?h=this.start2+1:h=this.start2+1+","+this.length2;for(var d=["@@ -"+a+" +"+h+` @@
1001
- `],o,p=0;p<this.diffs.length;p++){switch(this.diffs[p][0]){case u:o="+";break;case n:o="-";break;case v:o=" ";break}d[p+1]=o+encodeURI(this.diffs[p][1])+`
1002
- `}return d.join("").replace(/%20/g," ")},L.exports=i,L.exports.diff_match_patch=i,L.exports.DIFF_DELETE=n,L.exports.DIFF_INSERT=u,L.exports.DIFF_EQUAL=v})(tr);var ba=tr.exports,wa=Gt&&Gt.__extends||function(){var L=function(i,n){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,v){u.__proto__=v}||function(u,v){for(var a in v)Object.prototype.hasOwnProperty.call(v,a)&&(u[a]=v[a])},L(i,n)};return function(i,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");L(i,n);function u(){this.constructor=i}i.prototype=n===null?Object.create(n):(u.prototype=n.prototype,new u)}}();Object.defineProperty(Gt,"__esModule",{value:!0});var ye=Un,Di=pt,Ca=ft,Ea=ba,Sa=function(L){wa(i,L);function i(n){var u=L.call(this,n)||this;return u.state={value:u.props.value},u.onChange=u.onChange.bind(u),u.diff=u.diff.bind(u),u}return i.prototype.componentDidUpdate=function(){var n=this.props.value;n!==this.state.value&&this.setState({value:n})},i.prototype.onChange=function(n){this.setState({value:n}),this.props.onChange&&this.props.onChange(n)},i.prototype.diff=function(){var n=new Ea,u=this.state.value[0],v=this.state.value[1];if(u.length===0&&v.length===0)return[];var a=n.diff_main(u,v);n.diff_cleanupSemantic(a);var h=this.generateDiffedLines(a),d=this.setCodeMarkers(h);return d},i.prototype.generateDiffedLines=function(n){var u={DIFF_EQUAL:0,DIFF_DELETE:-1,DIFF_INSERT:1},v={left:[],right:[]},a={left:1,right:1};return n.forEach(function(h){var d=h[0],o=h[1],p=o.split(`
1003
- `).length-1;if(o.length!==0){var e=o[0],t=o[o.length-1],r=0;switch(d){case u.DIFF_EQUAL:a.left+=p,a.right+=p;break;case u.DIFF_DELETE:e===`
1004
- `&&(a.left++,p--),r=p,r===0&&v.right.push({startLine:a.right,endLine:a.right}),t===`
1005
- `&&(r-=1),v.left.push({startLine:a.left,endLine:a.left+r}),a.left+=p;break;case u.DIFF_INSERT:e===`
1006
- `&&(a.right++,p--),r=p,r===0&&v.left.push({startLine:a.left,endLine:a.left}),t===`
1007
- `&&(r-=1),v.right.push({startLine:a.right,endLine:a.right+r}),a.right+=p;break;default:throw new Error("Diff type was not defined.")}}}),v},i.prototype.setCodeMarkers=function(n){n===void 0&&(n={left:[],right:[]});for(var u=[],v={left:[],right:[]},a=0;a<n.left.length;a++){var h={startRow:n.left[a].startLine-1,endRow:n.left[a].endLine,type:"text",className:"codeMarker"};v.left.push(h)}for(var a=0;a<n.right.length;a++){var h={startRow:n.right[a].startLine-1,endRow:n.right[a].endLine,type:"text",className:"codeMarker"};v.right.push(h)}return u[0]=v.left,u[1]=v.right,u},i.prototype.render=function(){var n=this.diff();return Di.createElement(Ca.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:n})},i.propTypes={cursorStart:ye.number,editorProps:ye.object,enableBasicAutocompletion:ye.bool,enableLiveAutocompletion:ye.bool,focus:ye.bool,fontSize:ye.number,height:ye.string,highlightActiveLine:ye.bool,maxLines:ye.number,minLines:ye.number,mode:ye.string,name:ye.string,className:ye.string,onLoad:ye.func,onPaste:ye.func,onScroll:ye.func,onChange:ye.func,orientation:ye.string,readOnly:ye.bool,scrollMargin:ye.array,setOptions:ye.object,showGutter:ye.bool,showPrintMargin:ye.bool,splits:ye.number,style:ye.object,tabSize:ye.number,theme:ye.string,value:ye.array,width:ye.string,wrapEnabled:ye.bool},i.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},i}(Di.Component);Gt.default=Sa;Object.defineProperty(It,"__esModule",{value:!0});It.diff=It.split=void 0;var Da=Dt,Aa=Gt;It.diff=Aa.default;var xa=ft;It.split=xa.default;var $a=It.default=Da.default,Ta={exports:{}};(function(L,i){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(n,u,v){var a=n("../lib/oop"),h=n("./text_highlight_rules").TextHighlightRules,d=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};a.inherits(d,h),u.JsonHighlightRules=d}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(n,u,v){var a=n("../range").Range,h=function(){};(function(){this.checkOutdent=function(d,o){return/^\s+$/.test(d)?/^\s*\}/.test(o):!1},this.autoOutdent=function(d,o){var p=d.getLine(o),e=p.match(/^(\s*\})/);if(!e)return 0;var t=e[1].length,r=d.findMatchingBracket({row:o,column:t});if(!r||r.row==o)return 0;var l=this.$getIndent(d.getLine(r.row));d.replace(new a(o,0,o,t-1),l)},this.$getIndent=function(d){return d.match(/^\s*/)[0]}}).call(h.prototype),u.MatchingBraceOutdent=h}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(n,u,v){var a=n("../../lib/oop"),h=n("../../range").Range,d=n("./fold_mode").FoldMode,o=u.FoldMode=function(p){p&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+p.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+p.end)))};a.inherits(o,d),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(p,e,t){var r=p.getLine(t);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var l=this._getFoldWidgetBase(p,e,t);return!l&&this.startRegionRe.test(r)?"start":l},this.getFoldWidgetRange=function(p,e,t,r){var l=p.getLine(t);if(this.startRegionRe.test(l))return this.getCommentRegionBlock(p,l,t);var f=l.match(this.foldingStartMarker);if(f){var s=f.index;if(f[1])return this.openingBracketBlock(p,f[1],t,s);var c=p.getCommentFoldRange(t,s+f[0].length,1);return c&&!c.isMultiLine()&&(r?c=this.getSectionRange(p,t):e!="all"&&(c=null)),c}if(e!=="markbegin"){var f=l.match(this.foldingStopMarker);if(f){var s=f.index+f[0].length;return f[1]?this.closingBracketBlock(p,f[1],t,s):p.getCommentFoldRange(t,s,-1)}}},this.getSectionRange=function(p,e){var t=p.getLine(e),r=t.search(/\S/),l=e,s=t.length;e+=1;for(var c=e,f=p.getLength();++e<f;){t=p.getLine(e);var m=t.search(/\S/);if(m!==-1){if(r>m)break;var y=this.getFoldWidgetRange(p,"all",e);if(y){if(y.start.row<=l)break;if(y.isMultiLine())e=y.end.row;else if(r==m)break}c=e}}return new h(l,s,c,p.getLine(c).length)},this.getCommentRegionBlock=function(p,e,t){for(var r=e.search(/\s*$/),l=p.getLength(),s=t,c=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,f=1;++t<l;){e=p.getLine(t);var m=c.exec(e);if(m&&(m[1]?f--:f++,!f))break}var y=t;if(y>s)return new h(s,r,y,e.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(n,u,v){var a=n("../lib/oop"),h=n("./text").Mode,d=n("./json_highlight_rules").JsonHighlightRules,o=n("./matching_brace_outdent").MatchingBraceOutdent,p=n("./folding/cstyle").FoldMode,e=n("../worker/worker_client").WorkerClient,t=function(){this.HighlightRules=d,this.$outdent=new o,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new p};a.inherits(t,h),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(r,l,s){var c=this.$getIndent(l);if(r=="start"){var f=l.match(/^.*[\{\(\[]\s*$/);f&&(c+=s)}return c},this.checkOutdent=function(r,l,s){return this.$outdent.checkOutdent(l,s)},this.autoOutdent=function(r,l,s){this.$outdent.autoOutdent(l,s)},this.createWorker=function(r){var l=new e(["ace"],"ace/mode/json_worker","JsonWorker");return l.attachToDocument(r.getDocument()),l.on("annotate",function(s){r.setAnnotations(s.data)}),l.on("terminate",function(){r.clearAnnotations()}),l},this.$id="ace/mode/json"}.call(t.prototype),u.Mode=t}),function(){ace.require(["ace/mode/json"],function(n){L&&(L.exports=n)})}()})(Ta);var _a={exports:{}};(function(L,i){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(n,u,v){var a=n("../lib/oop"),h=n("./text_highlight_rules").TextHighlightRules,d=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};a.inherits(d,h),u.JsonHighlightRules=d}),ace.define("ace/mode/json5_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/json_highlight_rules"],function(n,u,v){var a=n("../lib/oop"),h=n("./json_highlight_rules").JsonHighlightRules,d=function(){h.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 p in this.$rules)this.$rules[p].unshift.apply(this.$rules[p],o);this.normalizeRules()};a.inherits(d,h),u.Json5HighlightRules=d}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(n,u,v){var a=n("../range").Range,h=function(){};(function(){this.checkOutdent=function(d,o){return/^\s+$/.test(d)?/^\s*\}/.test(o):!1},this.autoOutdent=function(d,o){var p=d.getLine(o),e=p.match(/^(\s*\})/);if(!e)return 0;var t=e[1].length,r=d.findMatchingBracket({row:o,column:t});if(!r||r.row==o)return 0;var l=this.$getIndent(d.getLine(r.row));d.replace(new a(o,0,o,t-1),l)},this.$getIndent=function(d){return d.match(/^\s*/)[0]}}).call(h.prototype),u.MatchingBraceOutdent=h}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(n,u,v){var a=n("../../lib/oop"),h=n("../../range").Range,d=n("./fold_mode").FoldMode,o=u.FoldMode=function(p){p&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+p.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+p.end)))};a.inherits(o,d),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(p,e,t){var r=p.getLine(t);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var l=this._getFoldWidgetBase(p,e,t);return!l&&this.startRegionRe.test(r)?"start":l},this.getFoldWidgetRange=function(p,e,t,r){var l=p.getLine(t);if(this.startRegionRe.test(l))return this.getCommentRegionBlock(p,l,t);var f=l.match(this.foldingStartMarker);if(f){var s=f.index;if(f[1])return this.openingBracketBlock(p,f[1],t,s);var c=p.getCommentFoldRange(t,s+f[0].length,1);return c&&!c.isMultiLine()&&(r?c=this.getSectionRange(p,t):e!="all"&&(c=null)),c}if(e!=="markbegin"){var f=l.match(this.foldingStopMarker);if(f){var s=f.index+f[0].length;return f[1]?this.closingBracketBlock(p,f[1],t,s):p.getCommentFoldRange(t,s,-1)}}},this.getSectionRange=function(p,e){var t=p.getLine(e),r=t.search(/\S/),l=e,s=t.length;e+=1;for(var c=e,f=p.getLength();++e<f;){t=p.getLine(e);var m=t.search(/\S/);if(m!==-1){if(r>m)break;var y=this.getFoldWidgetRange(p,"all",e);if(y){if(y.start.row<=l)break;if(y.isMultiLine())e=y.end.row;else if(r==m)break}c=e}}return new h(l,s,c,p.getLine(c).length)},this.getCommentRegionBlock=function(p,e,t){for(var r=e.search(/\s*$/),l=p.getLength(),s=t,c=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,f=1;++t<l;){e=p.getLine(t);var m=c.exec(e);if(m&&(m[1]?f--:f++,!f))break}var y=t;if(y>s)return new h(s,r,y,e.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(n,u,v){var a=n("../lib/oop"),h=n("./text").Mode,d=n("./json5_highlight_rules").Json5HighlightRules,o=n("./matching_brace_outdent").MatchingBraceOutdent,p=n("./folding/cstyle").FoldMode,e=function(){this.HighlightRules=d,this.$outdent=new o,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new p};a.inherits(e,h),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.checkOutdent=function(t,r,l){return this.$outdent.checkOutdent(r,l)},this.autoOutdent=function(t,r,l){this.$outdent.autoOutdent(r,l)},this.$id="ace/mode/json5"}.call(e.prototype),u.Mode=e}),function(){ace.require(["ace/mode/json5"],function(n){L&&(L.exports=n)})}()})(_a);var ka={};(function(L){function i(v,a){for(var h=v,d="";h;){var o=a[h];if(typeof o=="string")return o+d;if(o)return o.location.replace(/\/*$/,"/")+(d||o.main||o.name);if(o===!1)return"";var p=h.lastIndexOf("/");if(p===-1)break;d=h.substr(p)+d,h=h.slice(0,p)}return v}if(!(typeof L.window<"u"&&L.document)&&!(L.require&&L.define)){L.console||(L.console=function(){var v=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:v})},L.console.error=L.console.warn=L.console.log=L.console.trace=L.console),L.window=L,L.ace=L,L.onerror=function(v,a,h,d,o){postMessage({type:"error",data:{message:v,data:o&&o.data,file:a,line:h,col:d,stack:o&&o.stack}})},L.normalizeModule=function(v,a){if(a.indexOf("!")!==-1){var h=a.split("!");return L.normalizeModule(v,h[0])+"!"+L.normalizeModule(v,h[1])}if(a.charAt(0)=="."){var d=v.split("/").slice(0,-1).join("/");for(a=(d?d+"/":"")+a;a.indexOf(".")!==-1&&o!=a;){var o=a;a=a.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return a},L.require=function(v,a){if(a||(a=v,v=null),!a.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");a=L.normalizeModule(v,a);var h=L.require.modules[a];if(h)return h.initialized||(h.initialized=!0,h.exports=h.factory().exports),h.exports;if(!L.require.tlns)return console.log("unable to load "+a);var d=i(a,L.require.tlns);return d.slice(-3)!=".js"&&(d+=".js"),L.require.id=a,L.require.modules[a]={},importScripts(d),L.require(v,a)},L.require.modules={},L.require.tlns={},L.define=function(v,a,h){if(arguments.length==2?(h=a,typeof v!="string"&&(a=v,v=L.require.id)):arguments.length==1&&(h=v,a=[],v=L.require.id),typeof h!="function"){L.require.modules[v]={exports:h,initialized:!0};return}a.length||(a=["require","exports","module"]);var d=function(o){return L.require(v,o)};L.require.modules[v]={exports:{},factory:function(){var o=this,p=h.apply(this,a.slice(0,h.length).map(function(e){switch(e){case"require":return d;case"exports":return o.exports;case"module":return o;default:return d(e)}}));return p&&(o.exports=p),o}}},L.define.amd={},L.require.tlns={},L.initBaseUrls=function(v){for(var a in v)this.require.tlns[a]=v[a]},L.initSender=function(){var v=L.require("ace/lib/event_emitter").EventEmitter,a=L.require("ace/lib/oop"),h=function(){};return function(){a.implement(this,v),this.callback=function(d,o){postMessage({type:"call",id:o,data:d})},this.emit=function(d,o){postMessage({type:"event",name:d,data:o})}}.call(h.prototype),new h};var n=L.main=null,u=L.sender=null;L.onmessage=function(v){var a=v.data;if(a.event&&u)u._signal(a.event,a.data);else if(a.command)if(n[a.command])n[a.command].apply(n,a.args);else{if(!L[a.command])throw new Error("Unknown command:"+a.command);L[a.command].apply(L,a.args)}else if(a.init){L.initBaseUrls(a.tlns),u=L.sender=L.initSender();var h=this.require(a.module)[a.classname];n=L.main=new h(u)}}}})(ka),ace.define("ace/lib/oop",[],function(L,i,n){i.inherits=function(u,v){u.super_=v,u.prototype=Object.create(v.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}})},i.mixin=function(u,v){for(var a in v)u[a]=v[a];return u},i.implement=function(u,v){i.mixin(u,v)}}),ace.define("ace/apply_delta",[],function(L,i,n){i.applyDelta=function(u,v,a){var h=v.start.row,d=v.start.column,o=u[h]||"";switch(v.action){case"insert":var p=v.lines;if(p.length===1)u[h]=o.substring(0,d)+v.lines[0]+o.substring(d);else{var e=[h,1].concat(v.lines);u.splice.apply(u,e),u[h]=o.substring(0,d)+u[h],u[h+v.lines.length-1]+=o.substring(d)}break;case"remove":var t=v.end.column,r=v.end.row;h===r?u[h]=o.substring(0,d)+o.substring(t):u.splice(h,r-h+1,o.substring(0,d)+u[r].substring(t))}}}),ace.define("ace/lib/event_emitter",[],function(L,i,n){var u={},v=function(){this.propagationStopped=!0},a=function(){this.defaultPrevented=!0};u._emit=u._dispatchEvent=function(h,d){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var o=this._eventRegistry[h]||[],p=this._defaultHandlers[h];if(!(!o.length&&!p)){(typeof d!="object"||!d)&&(d={}),d.type||(d.type=h),d.stopPropagation||(d.stopPropagation=v),d.preventDefault||(d.preventDefault=a),o=o.slice();for(var e=0;e<o.length&&(o[e](d,this),!d.propagationStopped);e++);if(p&&!d.defaultPrevented)return p(d,this)}},u._signal=function(h,d){var o=(this._eventRegistry||{})[h];if(o){o=o.slice();for(var p=0;p<o.length;p++)o[p](d,this)}},u.once=function(h,d){var o=this;if(this.on(h,function p(){o.off(h,p),d.apply(null,arguments)}),!d)return new Promise(function(p){d=p})},u.setDefaultHandler=function(h,d){var o=this._defaultHandlers;if(o||(o=this._defaultHandlers={_disabled_:{}}),o[h]){var p=o[h],e=o._disabled_[h];e||(o._disabled_[h]=e=[]),e.push(p);var t=e.indexOf(d);t!=-1&&e.splice(t,1)}o[h]=d},u.removeDefaultHandler=function(h,d){var o=this._defaultHandlers;if(o){var p=o._disabled_[h];if(o[h]==d)p&&this.setDefaultHandler(h,p.pop());else if(p){var e=p.indexOf(d);e!=-1&&p.splice(e,1)}}},u.on=u.addEventListener=function(h,d,o){this._eventRegistry=this._eventRegistry||{};var p=this._eventRegistry[h];return p||(p=this._eventRegistry[h]=[]),p.indexOf(d)==-1&&p[o?"unshift":"push"](d),d},u.off=u.removeListener=u.removeEventListener=function(h,d){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[h];if(o){var p=o.indexOf(d);p!==-1&&o.splice(p,1)}},u.removeAllListeners=function(h){h||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[h]=void 0),this._defaultHandlers&&(this._defaultHandlers[h]=void 0)},i.EventEmitter=u}),ace.define("ace/range",[],function(L,i,n){var u=function(){function v(a,h,d,o){this.start={row:a,column:h},this.end={row:d,column:o}}return v.prototype.isEqual=function(a){return this.start.row===a.start.row&&this.end.row===a.end.row&&this.start.column===a.start.column&&this.end.column===a.end.column},v.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},v.prototype.contains=function(a,h){return this.compare(a,h)==0},v.prototype.compareRange=function(a){var h,d=a.end,o=a.start;return h=this.compare(d.row,d.column),h==1?(h=this.compare(o.row,o.column),h==1?2:h==0?1:0):h==-1?-2:(h=this.compare(o.row,o.column),h==-1?-1:h==1?42:0)},v.prototype.comparePoint=function(a){return this.compare(a.row,a.column)},v.prototype.containsRange=function(a){return this.comparePoint(a.start)==0&&this.comparePoint(a.end)==0},v.prototype.intersects=function(a){var h=this.compareRange(a);return h==-1||h==0||h==1},v.prototype.isEnd=function(a,h){return this.end.row==a&&this.end.column==h},v.prototype.isStart=function(a,h){return this.start.row==a&&this.start.column==h},v.prototype.setStart=function(a,h){typeof a=="object"?(this.start.column=a.column,this.start.row=a.row):(this.start.row=a,this.start.column=h)},v.prototype.setEnd=function(a,h){typeof a=="object"?(this.end.column=a.column,this.end.row=a.row):(this.end.row=a,this.end.column=h)},v.prototype.inside=function(a,h){return this.compare(a,h)==0?!(this.isEnd(a,h)||this.isStart(a,h)):!1},v.prototype.insideStart=function(a,h){return this.compare(a,h)==0?!this.isEnd(a,h):!1},v.prototype.insideEnd=function(a,h){return this.compare(a,h)==0?!this.isStart(a,h):!1},v.prototype.compare=function(a,h){return!this.isMultiLine()&&a===this.start.row?h<this.start.column?-1:h>this.end.column?1:0:a<this.start.row?-1:a>this.end.row?1:this.start.row===a?h>=this.start.column?0:-1:this.end.row===a?h<=this.end.column?0:1:0},v.prototype.compareStart=function(a,h){return this.start.row==a&&this.start.column==h?-1:this.compare(a,h)},v.prototype.compareEnd=function(a,h){return this.end.row==a&&this.end.column==h?1:this.compare(a,h)},v.prototype.compareInside=function(a,h){return this.end.row==a&&this.end.column==h?1:this.start.row==a&&this.start.column==h?-1:this.compare(a,h)},v.prototype.clipRows=function(a,h){if(this.end.row>h)var d={row:h+1,column:0};else if(this.end.row<a)var d={row:a,column:0};if(this.start.row>h)var o={row:h+1,column:0};else if(this.start.row<a)var o={row:a,column:0};return v.fromPoints(o||this.start,d||this.end)},v.prototype.extend=function(a,h){var d=this.compare(a,h);if(d==0)return this;if(d==-1)var o={row:a,column:h};else var p={row:a,column:h};return v.fromPoints(o||this.start,p||this.end)},v.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},v.prototype.isMultiLine=function(){return this.start.row!==this.end.row},v.prototype.clone=function(){return v.fromPoints(this.start,this.end)},v.prototype.collapseRows=function(){return this.end.column==0?new v(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new v(this.start.row,0,this.end.row,0)},v.prototype.toScreenRange=function(a){var h=a.documentToScreenPosition(this.start),d=a.documentToScreenPosition(this.end);return new v(h.row,h.column,d.row,d.column)},v.prototype.moveBy=function(a,h){this.start.row+=a,this.start.column+=h,this.end.row+=a,this.end.column+=h},v}();u.fromPoints=function(v,a){return new u(v.row,v.column,a.row,a.column)},u.comparePoints=function(v,a){return v.row-a.row||v.column-a.column},i.Range=u}),ace.define("ace/anchor",[],function(L,i,n){function u(o,p,e){var t=e?o.column<=p.column:o.column<p.column;return o.row<p.row||o.row==p.row&&t}function v(o,p,e){var t=o.action=="insert",r=(t?1:-1)*(o.end.row-o.start.row),l=(t?1:-1)*(o.end.column-o.start.column),s=o.start,c=t?s:o.end;return u(p,s,e)?{row:p.row,column:p.column}:u(c,p,!e)?{row:p.row+r,column:p.column+(p.row==c.row?l:0)}:{row:s.row,column:s.column}}var a=L("./lib/oop"),h=L("./lib/event_emitter").EventEmitter,d=function(){function o(p,e,t){this.$onChange=this.onChange.bind(this),this.attach(p),typeof e!="number"?this.setPosition(e.row,e.column):this.setPosition(e,t)}return o.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},o.prototype.getDocument=function(){return this.document},o.prototype.onChange=function(p){if(!(p.start.row==p.end.row&&p.start.row!=this.row)&&!(p.start.row>this.row)){var e=v(p,{row:this.row,column:this.column},this.$insertRight);this.setPosition(e.row,e.column,!0)}},o.prototype.setPosition=function(p,e,t){var r;if(t?r={row:p,column:e}:r=this.$clipPositionToDocument(p,e),!(this.row==r.row&&this.column==r.column)){var l={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:l,value:r})}},o.prototype.detach=function(){this.document.off("change",this.$onChange)},o.prototype.attach=function(p){this.document=p||this.document,this.document.on("change",this.$onChange)},o.prototype.$clipPositionToDocument=function(p,e){var t={};return p>=this.document.getLength()?(t.row=Math.max(0,this.document.getLength()-1),t.column=this.document.getLine(t.row).length):p<0?(t.row=0,t.column=0):(t.row=p,t.column=Math.min(this.document.getLine(t.row).length,Math.max(0,e))),e<0&&(t.column=0),t},o}();d.prototype.$insertRight=!1,a.implement(d.prototype,h),i.Anchor=d}),ace.define("ace/document",[],function(L,i,n){var u=L("./lib/oop"),v=L("./apply_delta").applyDelta,a=L("./lib/event_emitter").EventEmitter,h=L("./range").Range,d=L("./anchor").Anchor,o=function(){function p(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)}return p.prototype.setValue=function(e){var t=this.getLength()-1;this.remove(new h(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e||"")},p.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},p.prototype.createAnchor=function(e,t){return new d(this,e,t)},p.prototype.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:`
1008
- `,this._signal("changeNewLineMode")},p.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
1009
- `;case"unix":return`
1010
- `;default:return this.$autoNewLine||`
1011
- `}},p.prototype.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},p.prototype.getNewLineMode=function(){return this.$newLineMode},p.prototype.isNewLine=function(e){return e==`\r
1012
- `||e=="\r"||e==`
1013
- `},p.prototype.getLine=function(e){return this.$lines[e]||""},p.prototype.getLines=function(e,t){return this.$lines.slice(e,t+1)},p.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},p.prototype.getLength=function(){return this.$lines.length},p.prototype.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},p.prototype.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var r=t.length-1;e.end.row-e.start.row==r&&(t[r]=t[r].substring(0,e.end.column))}return t},p.prototype.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},p.prototype.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},p.prototype.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},p.prototype.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},p.prototype.insertInLine=function(e,t){var r=this.clippedPos(e.row,e.column),l=this.pos(e.row,e.column+t.length);return this.applyDelta({start:r,end:l,action:"insert",lines:[t]},!0),this.clonePos(l)},p.prototype.clippedPos=function(e,t){var r=this.getLength();e===void 0?e=r:e<0?e=0:e>=r&&(e=r-1,t=void 0);var l=this.getLine(e);return t==null&&(t=l.length),t=Math.min(Math.max(t,0),l.length),{row:e,column:t}},p.prototype.clonePos=function(e){return{row:e.row,column:e.column}},p.prototype.pos=function(e,t){return{row:e,column:t}},p.prototype.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},p.prototype.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var r=0;e<this.getLength()?(t=t.concat([""]),r=0):(t=[""].concat(t),e--,r=this.$lines[e].length),this.insertMergedLines({row:e,column:r},t)},p.prototype.insertMergedLines=function(e,t){var r=this.clippedPos(e.row,e.column),l={row:r.row+t.length-1,column:(t.length==1?r.column:0)+t[t.length-1].length};return this.applyDelta({start:r,end:l,action:"insert",lines:t}),this.clonePos(l)},p.prototype.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),r=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:r,action:"remove",lines:this.getLinesForRange({start:t,end:r})}),this.clonePos(t)},p.prototype.removeInLine=function(e,t,r){var l=this.clippedPos(e,t),s=this.clippedPos(e,r);return this.applyDelta({start:l,end:s,action:"remove",lines:this.getLinesForRange({start:l,end:s})},!0),this.clonePos(l)},p.prototype.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1),t=Math.min(Math.max(0,t),this.getLength()-1);var r=t==this.getLength()-1&&e>0,l=t<this.getLength()-1,s=r?e-1:e,c=r?this.getLine(s).length:0,f=l?t+1:t,m=l?0:this.getLine(f).length,y=new h(s,c,f,m),D=this.$lines.slice(e,t+1);return this.applyDelta({start:y.start,end:y.end,action:"remove",lines:this.getLinesForRange(y)}),D},p.prototype.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},p.prototype.replace=function(e,t){if(e instanceof h||(e=h.fromPoints(e.start,e.end)),t.length===0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);var r;return t?r=this.insert(e.start,t):r=e.start,r},p.prototype.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},p.prototype.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--)this.revertDelta(e[t])},p.prototype.applyDelta=function(e,t){var r=e.action=="insert";(r?e.lines.length<=1&&!e.lines[0]:!h.comparePoints(e.start,e.end))||(r&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(v(this.$lines,e,t),this._signal("change",e)))},p.prototype.$safeApplyDelta=function(e){var t=this.$lines.length;(e.action=="remove"&&e.start.row<t&&e.end.row<t||e.action=="insert"&&e.start.row<=t)&&this.applyDelta(e)},p.prototype.$splitAndapplyLargeDelta=function(e,t){for(var r=e.lines,l=r.length-t+1,s=e.start.row,c=e.start.column,f=0,m=0;f<l;f=m){m+=t-1;var y=r.slice(f,m);y.push(""),this.applyDelta({start:this.pos(s+f,c),end:this.pos(s+m,c=0),action:e.action,lines:y},!0)}e.lines=r.slice(f),e.start.row=s+f,e.start.column=c,this.applyDelta(e,!0)},p.prototype.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:e.action=="insert"?"remove":"insert",lines:e.lines.slice()})},p.prototype.indexToPosition=function(e,t){for(var r=this.$lines||this.getAllLines(),l=this.getNewLineCharacter().length,s=t||0,c=r.length;s<c;s++)if(e-=r[s].length+l,e<0)return{row:s,column:e+r[s].length+l};return{row:c-1,column:e+r[c-1].length+l}},p.prototype.positionToIndex=function(e,t){for(var r=this.$lines||this.getAllLines(),l=this.getNewLineCharacter().length,s=0,c=Math.min(e.row,r.length),f=t||0;f<c;++f)s+=r[f].length+l;return s+e.column},p.prototype.$split=function(e){return e.split(/\r\n|\r|\n/)},p}();o.prototype.$autoNewLine="",o.prototype.$newLineMode="auto",u.implement(o.prototype,a),i.Document=o}),ace.define("ace/lib/deep_copy",[],function(L,i,n){i.deepCopy=function u(v){if(typeof v!="object"||!v)return v;var a;if(Array.isArray(v)){a=[];for(var h=0;h<v.length;h++)a[h]=u(v[h]);return a}if(Object.prototype.toString.call(v)!=="[object Object]")return v;a={};for(var h in v)a[h]=u(v[h]);return a}}),ace.define("ace/lib/lang",[],function(L,i,n){i.last=function(a){return a[a.length-1]},i.stringReverse=function(a){return a.split("").reverse().join("")},i.stringRepeat=function(a,h){for(var d="";h>0;)h&1&&(d+=a),(h>>=1)&&(a+=a);return d};var u=/^\s\s*/,v=/\s\s*$/;i.stringTrimLeft=function(a){return a.replace(u,"")},i.stringTrimRight=function(a){return a.replace(v,"")},i.copyObject=function(a){var h={};for(var d in a)h[d]=a[d];return h},i.copyArray=function(a){for(var h=[],d=0,o=a.length;d<o;d++)a[d]&&typeof a[d]=="object"?h[d]=this.copyObject(a[d]):h[d]=a[d];return h},i.deepCopy=L("./deep_copy").deepCopy,i.arrayToMap=function(a){for(var h={},d=0;d<a.length;d++)h[a[d]]=1;return h},i.createMap=function(a){var h=Object.create(null);for(var d in a)h[d]=a[d];return h},i.arrayRemove=function(a,h){for(var d=0;d<=a.length;d++)h===a[d]&&a.splice(d,1)},i.escapeRegExp=function(a){return a.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},i.escapeHTML=function(a){return(""+a).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},i.getMatchOffsets=function(a,h){var d=[];return a.replace(h,function(o){d.push({offset:arguments[arguments.length-2],length:o.length})}),d},i.deferredCall=function(a){var h=null,d=function(){h=null,a()},o=function(p){return o.cancel(),h=setTimeout(d,p||0),o};return o.schedule=o,o.call=function(){return this.cancel(),a(),o},o.cancel=function(){return clearTimeout(h),h=null,o},o.isPending=function(){return h},o},i.delayedCall=function(a,h){var d=null,o=function(){d=null,a()},p=function(e){d==null&&(d=setTimeout(o,e||h))};return p.delay=function(e){d&&clearTimeout(d),d=setTimeout(o,e||h)},p.schedule=p,p.call=function(){this.cancel(),a()},p.cancel=function(){d&&clearTimeout(d),d=null},p.isPending=function(){return d},p},i.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},i.skipEmptyMatch=function(a,h,d){return d&&a.codePointAt(h)>65535?2:1}}),ace.define("ace/worker/mirror",[],function(L,i,n){var u=L("../document").Document,v=L("../lib/lang"),a=i.Mirror=function(h){this.sender=h;var d=this.doc=new u(""),o=this.deferredUpdate=v.delayedCall(this.onUpdate.bind(this)),p=this;h.on("change",function(e){var t=e.data;if(t[0].start)d.applyDeltas(t);else for(var r=0;r<t.length;r+=2){var l,s;if(Array.isArray(t[r+1])?l={action:"insert",start:t[r],lines:t[r+1]}:l={action:"remove",start:t[r],end:t[r+1]},(l.action=="insert"?l.start:l.end).row>=d.$lines.length)throw s=new Error("Invalid delta"),s.data={path:p.$path,linesLength:d.$lines.length,start:l.start,end:l.end},s;d.applyDelta(l,!0)}if(p.$timeout)return o.schedule(p.$timeout);p.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(h){this.$timeout=h},this.setValue=function(h){this.doc.setValue(h),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(h){this.sender.callback(this.doc.getValue(),h)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(a.prototype)}),ace.define("ace/mode/json/json_parse",[],function(L,i,n){var u,v,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
1014
- `,r:"\r",t:" "},h,d=function(f){throw{name:"SyntaxError",message:f,at:u,text:h}},o=function(f){return f&&f!==v&&d("Expected '"+f+"' instead of '"+v+"'"),v=h.charAt(u),u+=1,v},p=function(){var f,m="";for(v==="-"&&(m="-",o("-"));v>="0"&&v<="9";)m+=v,o();if(v===".")for(m+=".";o()&&v>="0"&&v<="9";)m+=v;if(v==="e"||v==="E")for(m+=v,o(),(v==="-"||v==="+")&&(m+=v,o());v>="0"&&v<="9";)m+=v,o();if(f=+m,!isNaN(f))return f;d("Bad number")},e=function(){var f,m,y="",D;if(v==='"')for(;o();){if(v==='"')return o(),y;if(v==="\\")if(o(),v==="u"){for(D=0,m=0;m<4&&(f=parseInt(o(),16),!!isFinite(f));m+=1)D=D*16+f;y+=String.fromCharCode(D)}else{if(typeof a[v]!="string")break;y+=a[v]}else{if(v==`
1015
- `||v=="\r")break;y+=v}}d("Bad string")},t=function(){for(;v&&v<=" ";)o()},r=function(){switch(v){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}d("Unexpected '"+v+"'")},l,s=function(){var f=[];if(v==="["){if(o("["),t(),v==="]")return o("]"),f;for(;v;){if(f.push(l()),t(),v==="]")return o("]"),f;o(","),t()}}d("Bad array")},c=function(){var f,m={};if(v==="{"){if(o("{"),t(),v==="}")return o("}"),m;for(;v;){if(f=e(),t(),o(":"),Object.hasOwnProperty.call(m,f)&&d('Duplicate key "'+f+'"'),m[f]=l(),t(),v==="}")return o("}"),m;o(","),t()}}d("Bad object")};return l=function(){switch(t(),v){case"{":return c();case"[":return s();case'"':return e();case"-":return p();default:return v>="0"&&v<="9"?p():r()}},function(f,m){var y;return h=f,u=0,v=" ",y=l(),t(),v&&d("Syntax error"),typeof m=="function"?function D(E,b){var g,S,T=E[b];if(T&&typeof T=="object")for(g in T)Object.hasOwnProperty.call(T,g)&&(S=D(T,g),S!==void 0?T[g]=S:delete T[g]);return m.call(E,b,T)}({"":y},""):y}}),ace.define("ace/mode/json_worker",[],function(L,i,n){var u=L("../lib/oop"),v=L("../worker/mirror").Mirror,a=L("./json/json_parse"),h=i.JsonWorker=function(d){v.call(this,d),this.setTimeout(200)};u.inherits(h,v),function(){this.onUpdate=function(){var d=this.doc.getValue(),o=[];try{d&&a(d)}catch(e){var p=this.doc.indexToPosition(e.at-1);o.push({row:p.row,column:p.column,text:e.message,type:"error"})}this.sender.emit("annotate",o)}}.call(h.prototype)});var Ma={exports:{}};(function(L,i){ace.define("ace/theme/clouds_midnight-css",["require","exports","module"],function(n,u,v){v.exports=`.ace-clouds-midnight .ace_gutter {
1016
- background: #232323;
1017
- color: #929292
1018
- }
1019
-
1020
- .ace-clouds-midnight .ace_print-margin {
1021
- width: 1px;
1022
- background: #232323
1023
- }
1024
-
1025
- .ace-clouds-midnight {
1026
- background-color: #191919;
1027
- color: #929292
1028
- }
1029
-
1030
- .ace-clouds-midnight .ace_cursor {
1031
- color: #7DA5DC
1032
- }
1033
-
1034
- .ace-clouds-midnight .ace_marker-layer .ace_selection {
1035
- background: #000000
1036
- }
1037
-
1038
- .ace-clouds-midnight.ace_multiselect .ace_selection.ace_start {
1039
- box-shadow: 0 0 3px 0px #191919;
1040
- }
1041
-
1042
- .ace-clouds-midnight .ace_marker-layer .ace_step {
1043
- background: rgb(102, 82, 0)
1044
- }
1045
-
1046
- .ace-clouds-midnight .ace_marker-layer .ace_bracket {
1047
- margin: -1px 0 0 -1px;
1048
- border: 1px solid #BFBFBF
1049
- }
1050
-
1051
- .ace-clouds-midnight .ace_marker-layer .ace_active-line {
1052
- background: rgba(215, 215, 215, 0.031)
1053
- }
1054
-
1055
- .ace-clouds-midnight .ace_gutter-active-line {
1056
- background-color: rgba(215, 215, 215, 0.031)
1057
- }
1058
-
1059
- .ace-clouds-midnight .ace_marker-layer .ace_selected-word {
1060
- border: 1px solid #000000
1061
- }
1062
-
1063
- .ace-clouds-midnight .ace_invisible {
1064
- color: #666
1065
- }
1066
-
1067
- .ace-clouds-midnight .ace_keyword,
1068
- .ace-clouds-midnight .ace_meta,
1069
- .ace-clouds-midnight .ace_support.ace_constant.ace_property-value {
1070
- color: #927C5D
1071
- }
1072
-
1073
- .ace-clouds-midnight .ace_keyword.ace_operator {
1074
- color: #4B4B4B
1075
- }
1076
-
1077
- .ace-clouds-midnight .ace_keyword.ace_other.ace_unit {
1078
- color: #366F1A
1079
- }
1080
-
1081
- .ace-clouds-midnight .ace_constant.ace_language {
1082
- color: #39946A
1083
- }
1084
-
1085
- .ace-clouds-midnight .ace_constant.ace_numeric {
1086
- color: #46A609
1087
- }
1088
-
1089
- .ace-clouds-midnight .ace_constant.ace_character.ace_entity {
1090
- color: #A165AC
1091
- }
1092
-
1093
- .ace-clouds-midnight .ace_invalid {
1094
- color: #FFFFFF;
1095
- background-color: #E92E2E
1096
- }
1097
-
1098
- .ace-clouds-midnight .ace_fold {
1099
- background-color: #927C5D;
1100
- border-color: #929292
1101
- }
1102
-
1103
- .ace-clouds-midnight .ace_storage,
1104
- .ace-clouds-midnight .ace_support.ace_class,
1105
- .ace-clouds-midnight .ace_support.ace_function,
1106
- .ace-clouds-midnight .ace_support.ace_other,
1107
- .ace-clouds-midnight .ace_support.ace_type {
1108
- color: #E92E2E
1109
- }
1110
-
1111
- .ace-clouds-midnight .ace_string {
1112
- color: #5D90CD
1113
- }
1114
-
1115
- .ace-clouds-midnight .ace_comment {
1116
- color: #3C403B
1117
- }
1118
-
1119
- .ace-clouds-midnight .ace_entity.ace_name.ace_tag,
1120
- .ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {
1121
- color: #606060
1122
- }
1123
-
1124
- .ace-clouds-midnight .ace_indent-guide {
1125
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y
1126
- }
1127
-
1128
- .ace-clouds-midnight .ace_indent-guide-active {
1129
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;
1130
- }
1131
- `}),ace.define("ace/theme/clouds_midnight",["require","exports","module","ace/theme/clouds_midnight-css","ace/lib/dom"],function(n,u,v){u.isDark=!0,u.cssClass="ace-clouds-midnight",u.cssText=n("./clouds_midnight-css");var a=n("../lib/dom");a.importCssString(u.cssText,u.cssClass,!1)}),function(){ace.require(["ace/theme/clouds_midnight"],function(n){L&&(L.exports=n)})}()})(Ma);var La={exports:{}};(function(L,i){ace.define("ace/theme/chrome-css",["require","exports","module"],function(n,u,v){v.exports=`.ace-chrome .ace_gutter {
1132
- background: #ebebeb;
1133
- color: #333;
1134
- overflow : hidden;
1135
- }
1136
-
1137
- .ace-chrome .ace_print-margin {
1138
- width: 1px;
1139
- background: #e8e8e8;
1140
- }
1141
-
1142
- .ace-chrome {
1143
- background-color: #FFFFFF;
1144
- color: black;
1145
- }
1146
-
1147
- .ace-chrome .ace_cursor {
1148
- color: black;
1149
- }
1150
-
1151
- .ace-chrome .ace_invisible {
1152
- color: rgb(191, 191, 191);
1153
- }
1154
-
1155
- .ace-chrome .ace_constant.ace_buildin {
1156
- color: rgb(88, 72, 246);
1157
- }
1158
-
1159
- .ace-chrome .ace_constant.ace_language {
1160
- color: rgb(88, 92, 246);
1161
- }
1162
-
1163
- .ace-chrome .ace_constant.ace_library {
1164
- color: rgb(6, 150, 14);
1165
- }
1166
-
1167
- .ace-chrome .ace_invalid {
1168
- background-color: rgb(153, 0, 0);
1169
- color: white;
1170
- }
1171
-
1172
- .ace-chrome .ace_fold {
1173
- }
1174
-
1175
- .ace-chrome .ace_support.ace_function {
1176
- color: rgb(60, 76, 114);
1177
- }
1178
-
1179
- .ace-chrome .ace_support.ace_constant {
1180
- color: rgb(6, 150, 14);
1181
- }
1182
-
1183
- .ace-chrome .ace_support.ace_type,
1184
- .ace-chrome .ace_support.ace_class
1185
- .ace-chrome .ace_support.ace_other {
1186
- color: rgb(109, 121, 222);
1187
- }
1188
-
1189
- .ace-chrome .ace_variable.ace_parameter {
1190
- font-style:italic;
1191
- color:#FD971F;
1192
- }
1193
- .ace-chrome .ace_keyword.ace_operator {
1194
- color: rgb(104, 118, 135);
1195
- }
1196
-
1197
- .ace-chrome .ace_comment {
1198
- color: #236e24;
1199
- }
1200
-
1201
- .ace-chrome .ace_comment.ace_doc {
1202
- color: #236e24;
1203
- }
1204
-
1205
- .ace-chrome .ace_comment.ace_doc.ace_tag {
1206
- color: #236e24;
1207
- }
1208
-
1209
- .ace-chrome .ace_constant.ace_numeric {
1210
- color: rgb(0, 0, 205);
1211
- }
1212
-
1213
- .ace-chrome .ace_variable {
1214
- color: rgb(49, 132, 149);
1215
- }
1216
-
1217
- .ace-chrome .ace_xml-pe {
1218
- color: rgb(104, 104, 91);
1219
- }
1220
-
1221
- .ace-chrome .ace_entity.ace_name.ace_function {
1222
- color: #0000A2;
1223
- }
1224
-
1225
-
1226
- .ace-chrome .ace_heading {
1227
- color: rgb(12, 7, 255);
1228
- }
1229
-
1230
- .ace-chrome .ace_list {
1231
- color:rgb(185, 6, 144);
1232
- }
1233
-
1234
- .ace-chrome .ace_marker-layer .ace_selection {
1235
- background: rgb(181, 213, 255);
1236
- }
1237
-
1238
- .ace-chrome .ace_marker-layer .ace_step {
1239
- background: rgb(252, 255, 0);
1240
- }
1241
-
1242
- .ace-chrome .ace_marker-layer .ace_stack {
1243
- background: rgb(164, 229, 101);
1244
- }
1245
-
1246
- .ace-chrome .ace_marker-layer .ace_bracket {
1247
- margin: -1px 0 0 -1px;
1248
- border: 1px solid rgb(192, 192, 192);
1249
- }
1250
-
1251
- .ace-chrome .ace_marker-layer .ace_active-line {
1252
- background: rgba(0, 0, 0, 0.07);
1253
- }
1254
-
1255
- .ace-chrome .ace_gutter-active-line {
1256
- background-color : #dcdcdc;
1257
- }
1258
-
1259
- .ace-chrome .ace_marker-layer .ace_selected-word {
1260
- background: rgb(250, 250, 255);
1261
- border: 1px solid rgb(200, 200, 250);
1262
- }
1263
-
1264
- .ace-chrome .ace_storage,
1265
- .ace-chrome .ace_keyword,
1266
- .ace-chrome .ace_meta.ace_tag {
1267
- color: rgb(147, 15, 128);
1268
- }
1269
-
1270
- .ace-chrome .ace_string.ace_regex {
1271
- color: rgb(255, 0, 0)
1272
- }
1273
-
1274
- .ace-chrome .ace_string {
1275
- color: #1A1AA6;
1276
- }
1277
-
1278
- .ace-chrome .ace_entity.ace_other.ace_attribute-name {
1279
- color: #994409;
1280
- }
1281
-
1282
- .ace-chrome .ace_indent-guide {
1283
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
1284
- }
1285
-
1286
- .ace-chrome .ace_indent-guide-active {
1287
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
1288
- }
1289
- `}),ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(n,u,v){u.isDark=!1,u.cssClass="ace-chrome",u.cssText=n("./chrome-css");var a=n("../lib/dom");a.importCssString(u.cssText,u.cssClass,!1)}),function(){ace.require(["ace/theme/chrome"],function(n){L&&(L.exports=n)})}()})(La);var Ia={exports:{}};(function(L,i){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(n,u,v){function a(g){var S=new Date().toLocaleString("en-us",g);return S.length==1?"0"+S:S}var h=n("./lib/dom"),d=n("./lib/oop"),o=n("./lib/event_emitter").EventEmitter,p=n("./lib/lang"),e=n("./range").Range,t=n("./range_list").RangeList,r=n("./keyboard/hash_handler").HashHandler,l=n("./tokenizer").Tokenizer,s=n("./clipboard"),c={CURRENT_WORD:function(g){return g.session.getTextRange(g.session.getWordRange())},SELECTION:function(g,S,T){var k=g.session.getTextRange();return T?k.replace(/\n\r?([ \t]*\S)/g,`
1290
- `+T+"$1"):k},CURRENT_LINE:function(g){return g.session.getLine(g.getCursorPosition().row)},PREV_LINE:function(g){return g.session.getLine(g.getCursorPosition().row-1)},LINE_INDEX:function(g){return g.getCursorPosition().row},LINE_NUMBER:function(g){return g.getCursorPosition().row+1},SOFT_TABS:function(g){return g.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(g){return g.session.getTabSize()},CLIPBOARD:function(g){return s.getText&&s.getText()},FILENAME:function(g){return/[^/\\]*$/.exec(this.FILEPATH(g))[0]},FILENAME_BASE:function(g){return/[^/\\]*$/.exec(this.FILEPATH(g))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(g){return this.FILEPATH(g).replace(/[^/\\]*$/,"")},FILEPATH:function(g){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(g){var S=g.session.$mode||{};return S.blockComment&&S.blockComment.start||""},BLOCK_COMMENT_END:function(g){var S=g.session.$mode||{};return S.blockComment&&S.blockComment.end||""},LINE_COMMENT:function(g){var S=g.session.$mode||{};return S.lineCommentStart||""},CURRENT_YEAR:a.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:a.bind(null,{year:"2-digit"}),CURRENT_MONTH:a.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:a.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:a.bind(null,{month:"short"}),CURRENT_DATE:a.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:a.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:a.bind(null,{weekday:"short"}),CURRENT_HOUR:a.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:a.bind(null,{minute:"2-digit"}),CURRENT_SECOND:a.bind(null,{second:"2-digit"})};c.SELECTED_TEXT=c.SELECTION;var f=function(){function g(){this.snippetMap={},this.snippetNameMap={},this.variables=c}return g.prototype.getTokenizer=function(){return g.$tokenizer||this.createTokenizer()},g.prototype.createTokenizer=function(){function S(_){return _=_.substr(1),/^\d+$/.test(_)?[{tabstopId:parseInt(_,10)}]:[{text:_}]}function T(_){return"(?:[^\\\\"+_+"]|\\\\.)"}var k={regex:"/("+T("/")+"+)/",onMatch:function(_,R,x){var A=x[0];return A.fmtString=!0,A.guard=_.slice(1,-1),A.flag="",""},next:"formatString"};return g.$tokenizer=new l({start:[{regex:/\\./,onMatch:function(_,R,x){var A=_[1];return(A=="}"&&x.length||"`$\\".indexOf(A)!=-1)&&(_=A),[_]}},{regex:/}/,onMatch:function(_,R,x){return[x.length?x.shift():_]}},{regex:/\$(?:\d+|\w+)/,onMatch:S},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(_,R,x){var A=S(_.substr(1));return x.unshift(A[0]),A},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+T("\\|")+"*\\|",onMatch:function(_,R,x){var A=_.slice(1,-1).replace(/\\[,|\\]|,/g,function(C){return C.length==2?C[1]:"\0"}).split("\0").map(function(C){return{value:C}});return x[0].choices=A,[A[0]]},next:"start"},k,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(_,R,x){return x.length&&x[0].expectElse?(x[0].expectElse=!1,x[0].ifEnd={elseEnd:x[0]},[x[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(_,R,x){var A=_[1];return A=="}"&&x.length||"`$\\".indexOf(A)!=-1?_=A:A=="n"?_=`
1291
- `:A=="t"?_=" ":"ulULE".indexOf(A)!=-1&&(_={changeCase:A,local:A>"a"}),[_]}},{regex:"/\\w*}",onMatch:function(_,R,x){var A=x.shift();return A&&(A.flag=_.slice(1,-1)),this.next=A&&A.tabstopId?"start":"",[A||_]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(_,R,x){return[{text:_.slice(1)}]}},{regex:/\${\w+/,onMatch:function(_,R,x){var A={text:_.slice(2)};return x.unshift(A),[A]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(_,R,x){var A=x.shift();return this.next=A&&A.tabstopId?"start":"",[A||_]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(_,R,x){var A=x[0];return A.formatFunction=_.slice(2,-1),[x.shift()]},next:"formatString"},k,{regex:/:[\?\-+]?/,onMatch:function(_,R,x){_[1]=="+"&&(x[0].ifEnd=x[0]),_[1]=="?"&&(x[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),g.$tokenizer},g.prototype.tokenizeTmSnippet=function(S,T){return this.getTokenizer().getLineTokens(S,T).tokens.map(function(k){return k.value||k})},g.prototype.getVariableValue=function(S,T,k){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 _=this.variables[T];return typeof _=="function"&&(_=this.variables[T](S,T,k)),_??""},g.prototype.tmStrFormat=function(S,T,k){if(!T.fmt)return S;var _=T.flag||"",R=T.guard;R=new RegExp(R,_.replace(/[^gim]/g,""));var x=typeof T.fmt=="string"?this.tokenizeTmSnippet(T.fmt,"formatString"):T.fmt,A=this,C=S.replace(R,function(){var w=A.variables.__;A.variables.__=[].slice.call(arguments);for(var $=A.resolveVariables(x,k),I="E",F=0;F<$.length;F++){var O=$[F];if(typeof O=="object")if($[F]="",O.changeCase&&O.local){var B=$[F+1];B&&typeof B=="string"&&(O.changeCase=="u"?$[F]=B[0].toUpperCase():$[F]=B[0].toLowerCase(),$[F+1]=B.substr(1))}else O.changeCase&&(I=O.changeCase);else I=="U"?$[F]=O.toUpperCase():I=="L"&&($[F]=O.toLowerCase())}return A.variables.__=w,$.join("")});return C},g.prototype.tmFormatFunction=function(S,T,k){return T.formatFunction=="upcase"?S.toUpperCase():T.formatFunction=="downcase"?S.toLowerCase():S},g.prototype.resolveVariables=function(S,T){function k(I){var F=S.indexOf(I,A+1);F!=-1&&(A=F)}for(var _=[],R="",x=!0,A=0;A<S.length;A++){var C=S[A];if(typeof C=="string"){_.push(C),C==`
1292
- `?(x=!0,R=""):x&&(R=/^\t*/.exec(C)[0],x=/\S/.test(C));continue}if(C){if(x=!1,C.fmtString){var w=S.indexOf(C,A+1);w==-1&&(w=S.length),C.fmt=S.slice(A+1,w),A=w}if(C.text){var $=this.getVariableValue(T,C.text,R)+"";C.fmtString&&($=this.tmStrFormat($,C,T)),C.formatFunction&&($=this.tmFormatFunction($,C,T)),$&&!C.ifEnd?(_.push($),k(C)):!$&&C.ifEnd&&k(C.ifEnd)}else C.elseEnd?k(C.elseEnd):(C.tabstopId!=null||C.changeCase!=null)&&_.push(C)}}return _},g.prototype.getDisplayTextForSnippet=function(S,T){var k=m.call(this,S,T);return k.text},g.prototype.insertSnippetForSelection=function(S,T,k){k===void 0&&(k={});var _=m.call(this,S,T,k),R=S.getSelectionRange(),x=S.session.replace(R,_.text),A=new y(S),C=S.inVirtualSelectionMode&&S.selection.index;A.addTabstops(_.tabstops,R.start,x,C)},g.prototype.insertSnippet=function(S,T,k){k===void 0&&(k={});var _=this;if(S.inVirtualSelectionMode)return _.insertSnippetForSelection(S,T,k);S.forEachSelection(function(){_.insertSnippetForSelection(S,T,k)},null,{keepOrder:!0}),S.tabstopManager&&S.tabstopManager.tabNext()},g.prototype.$getScope=function(S){var T=S.session.$mode.$id||"";if(T=T.split("/").pop(),T==="html"||T==="php"){T==="php"&&!S.session.$mode.inlinePhp&&(T="html");var k=S.getCursorPosition(),_=S.session.getState(k.row);typeof _=="object"&&(_=_[0]),_.substring&&(_.substring(0,3)=="js-"?T="javascript":_.substring(0,4)=="css-"?T="css":_.substring(0,4)=="php-"&&(T="php"))}return T},g.prototype.getActiveScopes=function(S){var T=this.$getScope(S),k=[T],_=this.snippetMap;return _[T]&&_[T].includeScopes&&k.push.apply(k,_[T].includeScopes),k.push("_"),k},g.prototype.expandWithTab=function(S,T){var k=this,_=S.forEachSelection(function(){return k.expandSnippetForSelection(S,T)},null,{keepOrder:!0});return _&&S.tabstopManager&&S.tabstopManager.tabNext(),_},g.prototype.expandSnippetForSelection=function(S,T){var k=S.getCursorPosition(),_=S.session.getLine(k.row),R=_.substring(0,k.column),x=_.substr(k.column),A=this.snippetMap,C;return this.getActiveScopes(S).some(function(w){var $=A[w];return $&&(C=this.findMatchingSnippet($,R,x)),!!C},this),C?(T&&T.dryRun||(S.session.doc.removeInLine(k.row,k.column-C.replaceBefore.length,k.column+C.replaceAfter.length),this.variables.M__=C.matchBefore,this.variables.T__=C.matchAfter,this.insertSnippetForSelection(S,C.content),this.variables.M__=this.variables.T__=null),!0):!1},g.prototype.findMatchingSnippet=function(S,T,k){for(var _=S.length;_--;){var R=S[_];if(!(R.startRe&&!R.startRe.test(T))&&!(R.endRe&&!R.endRe.test(k))&&!(!R.startRe&&!R.endRe))return R.matchBefore=R.startRe?R.startRe.exec(T):[""],R.matchAfter=R.endRe?R.endRe.exec(k):[""],R.replaceBefore=R.triggerRe?R.triggerRe.exec(T)[0]:"",R.replaceAfter=R.endTriggerRe?R.endTriggerRe.exec(k)[0]:"",R}},g.prototype.register=function(S,T){function k(w){return w&&!/^\^?\(.*\)\$?$|^\\b$/.test(w)&&(w="(?:"+w+")"),w||""}function _(w,$,I){return w=k(w),$=k($),w=$+w,w&&w[w.length-1]!="$"&&(w+="$"),new RegExp(w)}function R(w){w.scope||(w.scope=T||"_"),T=w.scope,x[T]||(x[T]=[],A[T]={});var $=A[T];if(w.name){var I=$[w.name];I&&C.unregister(I),$[w.name]=w}x[T].push(w),w.prefix&&(w.tabTrigger=w.prefix),!w.content&&w.body&&(w.content=Array.isArray(w.body)?w.body.join(`
1293
- `):w.body),w.tabTrigger&&!w.trigger&&(!w.guard&&/^\w/.test(w.tabTrigger)&&(w.guard="\\b"),w.trigger=p.escapeRegExp(w.tabTrigger)),!(!w.trigger&&!w.guard&&!w.endTrigger&&!w.endGuard)&&(w.startRe=_(w.trigger,w.guard),w.triggerRe=new RegExp(w.trigger),w.endRe=_(w.endTrigger,w.endGuard),w.endTriggerRe=new RegExp(w.endTrigger))}var x=this.snippetMap,A=this.snippetNameMap,C=this;S||(S=[]),Array.isArray(S)?S.forEach(R):Object.keys(S).forEach(function(w){R(S[w])}),this._signal("registerSnippets",{scope:T})},g.prototype.unregister=function(S,T){function k(x){var A=R[x.scope||T];if(A&&A[x.name]){delete A[x.name];var C=_[x.scope||T],w=C&&C.indexOf(x);w>=0&&C.splice(w,1)}}var _=this.snippetMap,R=this.snippetNameMap;S.content?k(S):Array.isArray(S)&&S.forEach(k)},g.prototype.parseSnippetFile=function(S){S=S.replace(/\r/g,"");for(var T=[],k={},_=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,R;R=_.exec(S);){if(R[1])try{k=JSON.parse(R[1]),T.push(k)}catch{}if(R[4])k.content=R[4].replace(/^\t/gm,""),T.push(k),k={};else{var x=R[2],A=R[3];if(x=="regex"){var C=/\/((?:[^\/\\]|\\.)*)|$/g;k.guard=C.exec(A)[1],k.trigger=C.exec(A)[1],k.endTrigger=C.exec(A)[1],k.endGuard=C.exec(A)[1]}else x=="snippet"?(k.tabTrigger=A.match(/^\S*/)[0],k.name||(k.name=A)):x&&(k[x]=A)}}return T},g.prototype.getSnippetByName=function(S,T){var k=this.snippetNameMap,_;return this.getActiveScopes(T).some(function(R){var x=k[R];return x&&(_=x[S]),!!_},this),_},g}();d.implement(f.prototype,o);var m=function(g,S,T){function k(G){for(var Y=[],Q=0;Q<G.length;Q++){var ee=G[Q];if(typeof ee=="object"){if($[ee.tabstopId])continue;var ne=G.lastIndexOf(ee,Q-1);ee=Y[ne]||{tabstopId:ee.tabstopId}}Y[Q]=ee}return Y}T===void 0&&(T={});var _=g.getCursorPosition(),R=g.session.getLine(_.row),x=g.session.getTabString(),A=R.match(/^\s*/)[0];_.column<A.length&&(A=A.slice(0,_.column)),S=S.replace(/\r/g,"");var C=this.tokenizeTmSnippet(S);C=this.resolveVariables(C,g),C=C.map(function(G){return G==`
1294
- `&&!T.excludeExtraIndent?G+A:typeof G=="string"?G.replace(/\t/g,x):G});var w=[];C.forEach(function(G,Y){if(typeof G=="object"){var Q=G.tabstopId,ee=w[Q];if(ee||(ee=w[Q]=[],ee.index=Q,ee.value="",ee.parents={}),ee.indexOf(G)===-1){G.choices&&!ee.choices&&(ee.choices=G.choices),ee.push(G);var ne=C.indexOf(G,Y+1);if(ne!==-1){var se=C.slice(Y+1,ne),ge=se.some(function(be){return typeof be=="object"});ge&&!ee.value?ee.value=se:se.length&&(!ee.value||typeof ee.value!="string")&&(ee.value=se.join(""))}}}}),w.forEach(function(G){G.length=0});for(var $={},I=0;I<C.length;I++){var F=C[I];if(typeof F=="object"){var O=F.tabstopId,B=w[O],P=C.indexOf(F,I+1);if($[O]){$[O]===F&&(delete $[O],Object.keys($).forEach(function(G){B.parents[G]=!0}));continue}$[O]=F;var V=B.value;typeof V!="string"?V=k(V):F.fmt&&(V=this.tmStrFormat(V,F,g)),C.splice.apply(C,[I+1,Math.max(0,P-I)].concat(V,F)),B.indexOf(F)===-1&&B.push(F)}}var W=0,H=0,U="";return C.forEach(function(G){if(typeof G=="string"){var Y=G.split(`
1295
- `);Y.length>1?(H=Y[Y.length-1].length,W+=Y.length-1):H+=G.length,U+=G}else G&&(G.start?G.end={row:W,column:H}:G.start={row:W,column:H})}),{text:U,tabstops:w,tokens:C}},y=function(){function g(S){if(this.index=0,this.ranges=[],this.tabstops=[],S.tabstopManager)return S.tabstopManager;S.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=p.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(S)}return g.prototype.attach=function(S){this.$openTabstops=null,this.selectedTabstop=null,this.editor=S,this.session=S.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)},g.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},g.prototype.onChange=function(S){for(var T=S.action[0]=="r",k=this.selectedTabstop||{},_=k.parents||{},R=this.tabstops.slice(),x=0;x<R.length;x++){var A=R[x],C=A==k||_[A.index];if(A.rangeList.$bias=C?0:1,S.action=="remove"&&A!==k){var w=A.parents&&A.parents[k.index],$=A.rangeList.pointIndex(S.start,w);$=$<0?-$-1:$+1;var I=A.rangeList.pointIndex(S.end,w);I=I<0?-I-1:I-1;for(var F=A.rangeList.ranges.slice($,I),O=0;O<F.length;O++)this.removeRange(F[O])}A.rangeList.$onChange(S)}var B=this.session;!this.$inChange&&T&&B.getLength()==1&&!B.getValue()&&this.detach()},g.prototype.updateLinkedFields=function(){var S=this.selectedTabstop;if(!(!S||!S.hasLinkedRanges||!S.firstNonLinked)){this.$inChange=!0;for(var T=this.session,k=T.getTextRange(S.firstNonLinked),_=0;_<S.length;_++){var R=S[_];if(R.linked){var x=R.original,A=u.snippetManager.tmStrFormat(k,x,this.editor);T.replace(R,A)}}this.$inChange=!1}},g.prototype.onAfterExec=function(S){S.command&&!S.command.readOnly&&this.updateLinkedFields()},g.prototype.onChangeSelection=function(){if(this.editor){for(var S=this.editor.selection.lead,T=this.editor.selection.anchor,k=this.editor.selection.isEmpty(),_=0;_<this.ranges.length;_++)if(!this.ranges[_].linked){var R=this.ranges[_].contains(S.row,S.column),x=k||this.ranges[_].contains(T.row,T.column);if(R&&x)return}this.detach()}},g.prototype.onChangeSession=function(){this.detach()},g.prototype.tabNext=function(S){var T=this.tabstops.length,k=this.index+(S||1);k=Math.min(Math.max(k,1),T),k==T&&(k=0),this.selectTabstop(k),this.updateTabstopMarkers(),k===0&&this.detach()},g.prototype.selectTabstop=function(S){this.$openTabstops=null;var T=this.tabstops[this.index];if(T&&this.addTabstopMarkers(T),this.index=S,T=this.tabstops[this.index],!(!T||!T.length)){this.selectedTabstop=T;var k=T.firstNonLinked||T;if(T.choices&&(k.cursor=k.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(k);else{var _=this.editor.multiSelect;_.toSingleRange(k);for(var R=0;R<T.length;R++)T.hasLinkedRanges&&T[R].linked||_.addRange(T[R].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},g.prototype.addTabstops=function(S,T,k){var _=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!S[0]){var R=e.fromPoints(k,k);E(R.start,T),E(R.end,T),S[0]=[R],S[0].index=0}var x=this.index,A=[x+1,0],C=this.ranges,w=this.snippetId=(this.snippetId||0)+1;S.forEach(function($,I){var F=this.$openTabstops[I]||$;F.snippetId=w;for(var O=0;O<$.length;O++){var B=$[O],P=e.fromPoints(B.start,B.end||B.start);D(P.start,T),D(P.end,T),P.original=B,P.tabstop=F,C.push(P),F!=$?F.unshift(P):F[O]=P,B.fmtString||F.firstNonLinked&&_?(P.linked=!0,F.hasLinkedRanges=!0):F.firstNonLinked||(F.firstNonLinked=P)}F.firstNonLinked||(F.hasLinkedRanges=!1),F===$&&(A.push(F),this.$openTabstops[I]=F),this.addTabstopMarkers(F),F.rangeList=F.rangeList||new t,F.rangeList.$bias=0,F.rangeList.addList(F)},this),A.length>2&&(this.tabstops.length&&A.push(A.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,A))},g.prototype.addTabstopMarkers=function(S){var T=this.session;S.forEach(function(k){k.markerId||(k.markerId=T.addMarker(k,"ace_snippet-marker","text"))})},g.prototype.removeTabstopMarkers=function(S){var T=this.session;S.forEach(function(k){T.removeMarker(k.markerId),k.markerId=null})},g.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var S=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&S--,this.tabstops.forEach(function(T){T.snippetId===S?this.addTabstopMarkers(T):this.removeTabstopMarkers(T)},this)}},g.prototype.removeRange=function(S){var T=S.tabstop.indexOf(S);T!=-1&&S.tabstop.splice(T,1),T=this.ranges.indexOf(S),T!=-1&&this.ranges.splice(T,1),T=S.tabstop.rangeList.ranges.indexOf(S),T!=-1&&S.tabstop.splice(T,1),this.session.removeMarker(S.markerId),S.tabstop.length||(T=this.tabstops.indexOf(S.tabstop),T!=-1&&this.tabstops.splice(T,1),this.tabstops.length||this.detach())},g}();y.prototype.keyboardHandler=new r,y.prototype.keyboardHandler.bindKeys({Tab:function(g){u.snippetManager&&u.snippetManager.expandWithTab(g)||(g.tabstopManager.tabNext(1),g.renderer.scrollCursorIntoView())},"Shift-Tab":function(g){g.tabstopManager.tabNext(-1),g.renderer.scrollCursorIntoView()},Esc:function(g){g.tabstopManager.detach()}});var D=function(g,S){g.row==0&&(g.column+=S.column),g.row+=S.row},E=function(g,S){g.row==S.row&&(g.column-=S.column),g.row-=S.row};h.importCssString(`
1296
- .ace_snippet-marker {
1297
- -moz-box-sizing: border-box;
1298
- box-sizing: border-box;
1299
- background: rgba(194, 193, 208, 0.09);
1300
- border: 1px dotted rgba(211, 208, 235, 0.62);
1301
- position: absolute;
1302
- }`,"snippets.css",!1),u.snippetManager=new f;var b=n("./editor").Editor;(function(){this.insertSnippet=function(g,S){return u.snippetManager.insertSnippet(this,g,S)},this.expandSnippet=function(g){return u.snippetManager.expandWithTab(this,g)}}).call(b.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(n,u,v){var a=n("../virtual_renderer").VirtualRenderer,h=n("../editor").Editor,d=n("../range").Range,o=n("../lib/event"),p=n("../lib/lang"),e=n("../lib/dom"),t=n("../config").nls,r=n("./../lib/useragent"),l=function(D){return"suggest-aria-id:".concat(D)},s=r.isSafari?"menu":"listbox",c=r.isSafari?"menuitem":"option",f=r.isSafari?"aria-current":"aria-selected",m=function(D){var E=new a(D);E.$maxLines=4;var b=new h(E);return b.setHighlightActiveLine(!1),b.setShowPrintMargin(!1),b.renderer.setShowGutter(!1),b.renderer.setHighlightGutterLine(!1),b.$mouseHandler.$focusTimeout=0,b.$highlightTagPending=!0,b},y=function(){function D(E){var b=e.createElement("div"),g=m(b);E&&E.appendChild(b),b.style.display="none",g.renderer.content.style.cursor="default",g.renderer.setStyle("ace_autocomplete"),g.renderer.$textLayer.element.setAttribute("role",s),g.renderer.$textLayer.element.setAttribute("aria-roledescription",t("autocomplete.popup.aria-roledescription","Autocomplete suggestions")),g.renderer.$textLayer.element.setAttribute("aria-label",t("autocomplete.popup.aria-label","Autocomplete suggestions")),g.renderer.textarea.setAttribute("aria-hidden","true"),g.setOption("displayIndentGuides",!1),g.setOption("dragDelay",150);var S=function(){};g.focus=S,g.$isFocused=!0,g.renderer.$cursorLayer.restartTimer=S,g.renderer.$cursorLayer.element.style.opacity="0",g.renderer.$maxLines=8,g.renderer.$keepTextAreaAtCursor=!1,g.setHighlightActiveLine(!1),g.session.highlight(""),g.session.$searchHighlight.clazz="ace_highlight-marker",g.on("mousedown",function(C){var w=C.getDocumentPosition();g.selection.moveToPosition(w),_.start.row=_.end.row=w.row,C.stop()});var T,k=new d(-1,0,-1,1/0),_=new d(-1,0,-1,1/0);_.id=g.session.addMarker(_,"ace_active-line","fullLine"),g.setSelectOnHover=function(C){C?k.id&&(g.session.removeMarker(k.id),k.id=null):k.id=g.session.addMarker(k,"ace_line-hover","fullLine")},g.setSelectOnHover(!1),g.on("mousemove",function(C){if(!T){T=C;return}if(!(T.x==C.x&&T.y==C.y)){T=C,T.scrollTop=g.renderer.scrollTop,g.isMouseOver=!0;var w=T.getDocumentPosition().row;k.start.row!=w&&(k.id||g.setRow(w),x(w))}}),g.renderer.on("beforeRender",function(){if(T&&k.start.row!=-1){T.$pos=null;var C=T.getDocumentPosition().row;k.id||g.setRow(C),x(C,!0)}}),g.renderer.on("afterRender",function(){for(var C=g.renderer.$textLayer,w=C.config.firstRow,$=C.config.lastRow;w<=$;w++){var I=C.element.childNodes[w-C.config.firstRow];I.setAttribute("role",c),I.setAttribute("aria-roledescription",t("autocomplete.popup.item.aria-roledescription","item")),I.setAttribute("aria-setsize",g.data.length),I.setAttribute("aria-describedby","doc-tooltip"),I.setAttribute("aria-posinset",w+1);var F=g.getData(w);if(F){var O="".concat(F.caption||F.value).concat(F.meta?", ".concat(F.meta):"");I.setAttribute("aria-label",O)}var B=I.querySelectorAll(".ace_completion-highlight");B.forEach(function(P){P.setAttribute("role","mark")})}}),g.renderer.on("afterRender",function(){var C=g.getRow(),w=g.renderer.$textLayer,$=w.element.childNodes[C-w.config.firstRow],I=document.activeElement;if($!==g.selectedNode&&g.selectedNode&&(e.removeCssClass(g.selectedNode,"ace_selected"),g.selectedNode.removeAttribute(f),g.selectedNode.removeAttribute("id")),I.removeAttribute("aria-activedescendant"),g.selectedNode=$,$){var F=l(C);e.addCssClass($,"ace_selected"),$.id=F,w.element.setAttribute("aria-activedescendant",F),I.setAttribute("aria-activedescendant",F),$.setAttribute(f,"true")}});var R=function(){x(-1)},x=function(C,w){C!==k.start.row&&(k.start.row=k.end.row=C,w||g.session._emit("changeBackMarker"),g._emit("changeHoverMarker"))};g.getHoveredRow=function(){return k.start.row},o.addListener(g.container,"mouseout",function(){g.isMouseOver=!1,R()}),g.on("hide",R),g.on("changeSelection",R),g.session.doc.getLength=function(){return g.data.length},g.session.doc.getLine=function(C){var w=g.data[C];return typeof w=="string"?w:w&&w.value||""};var A=g.session.bgTokenizer;return A.$tokenizeRow=function(C){function w(G,Y){G&&I.push({type:($.className||"")+(Y||""),value:G})}var $=g.data[C],I=[];if(!$)return I;typeof $=="string"&&($={value:$});for(var F=$.caption||$.value||$.name,O=F.toLowerCase(),B=(g.filterText||"").toLowerCase(),P=0,V=0,W=0;W<=B.length;W++)if(W!=V&&($.matchMask&1<<W||W==B.length)){var H=B.slice(V,W);V=W;var U=O.indexOf(H,P);if(U==-1)continue;w(F.slice(P,U),""),P=U+H.length,w(F.slice(U,P),"completion-highlight")}return w(F.slice(P,F.length),""),I.push({type:"completion-spacer",value:" "}),$.meta&&I.push({type:"completion-meta",value:$.meta}),$.message&&I.push({type:"completion-message",value:$.message}),I},A.$updateOnChange=S,A.start=S,g.session.$computeWidth=function(){return this.screenWidth=0},g.isOpen=!1,g.isTopdown=!1,g.autoSelect=!0,g.filterText="",g.isMouseOver=!1,g.data=[],g.setData=function(C,w){g.filterText=w||"",g.setValue(p.stringRepeat(`
1303
- `,C.length),-1),g.data=C||[],g.setRow(0)},g.getData=function(C){return g.data[C]},g.getRow=function(){return _.start.row},g.setRow=function(C){C=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,C)),_.start.row!=C&&(g.selection.clearSelection(),_.start.row=_.end.row=C||0,g.session._emit("changeBackMarker"),g.moveCursorTo(C||0,0),g.isOpen&&g._signal("select"))},g.on("changeSelection",function(){g.isOpen&&g.setRow(g.selection.lead.row),g.renderer.scrollCursorIntoView()}),g.hide=function(){this.container.style.display="none",g.anchorPos=null,g.anchor=null,g.isOpen&&(g.isOpen=!1,this._signal("hide"))},g.tryShow=function(C,w,$,I){if(!I&&g.isOpen&&g.anchorPos&&g.anchor&&g.anchorPos.top===C.top&&g.anchorPos.left===C.left&&g.anchor===$)return!0;var F=this.container,O=this.renderer.scrollBar.width||10,B=window.innerHeight-O,P=window.innerWidth-O,V=this.renderer,W=V.$maxLines*w*1.4,H={top:0,bottom:0},U=B-C.top-3*this.$borderSize-w,G=C.top-3*this.$borderSize;$||(G<=U||U>=W?$="bottom":$="top"),$==="top"?(H.bottom=C.top-this.$borderSize,H.top=H.bottom-W):$==="bottom"&&(H.top=C.top+w+this.$borderSize,H.bottom=H.top+W);var Y=H.top>=0&&H.bottom<=B;if(!I&&!Y)return!1;Y?V.$maxPixelHeight=null:$==="top"?V.$maxPixelHeight=G:V.$maxPixelHeight=U,$==="top"?(F.style.top="",F.style.bottom=B+O-H.bottom+"px",g.isTopdown=!1):(F.style.top=H.top+"px",F.style.bottom="",g.isTopdown=!0),F.style.display="";var Q=C.left;return Q+F.offsetWidth>P&&(Q=P-F.offsetWidth),F.style.left=Q+"px",F.style.right="",g.isOpen||(g.isOpen=!0,this._signal("show"),T=null),g.anchorPos=C,g.anchor=$,!0},g.show=function(C,w,$){this.tryShow(C,w,$?"bottom":void 0,!0)},g.goTo=function(C){var w=this.getRow(),$=this.session.getLength()-1;switch(C){case"up":w=w<=0?$:w-1;break;case"down":w=w>=$?-1:w+1;break;case"start":w=0;break;case"end":w=$}this.setRow(w)},g.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},g.$imageSize=0,g.$borderSize=1,g}return D}();e.importCssString(`
1304
- .ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
1305
- background-color: #CAD6FA;
1306
- z-index: 1;
1307
- }
1308
- .ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
1309
- background-color: #3a674e;
1310
- }
1311
- .ace_editor.ace_autocomplete .ace_line-hover {
1312
- border: 1px solid #abbffe;
1313
- margin-top: -1px;
1314
- background: rgba(233,233,253,0.4);
1315
- position: absolute;
1316
- z-index: 2;
1317
- }
1318
- .ace_dark.ace_editor.ace_autocomplete .ace_line-hover {
1319
- border: 1px solid rgba(109, 150, 13, 0.8);
1320
- background: rgba(58, 103, 78, 0.62);
1321
- }
1322
- .ace_completion-meta {
1323
- opacity: 0.5;
1324
- margin-left: 0.9em;
1325
- }
1326
- .ace_completion-message {
1327
- margin-left: 0.9em;
1328
- color: blue;
1329
- }
1330
- .ace_editor.ace_autocomplete .ace_completion-highlight{
1331
- color: #2d69c7;
1332
- }
1333
- .ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{
1334
- color: #93ca12;
1335
- }
1336
- .ace_editor.ace_autocomplete {
1337
- width: 300px;
1338
- z-index: 200000;
1339
- border: 1px lightgray solid;
1340
- position: fixed;
1341
- box-shadow: 2px 3px 5px rgba(0,0,0,.2);
1342
- line-height: 1.4;
1343
- background: #fefefe;
1344
- color: #111;
1345
- }
1346
- .ace_dark.ace_editor.ace_autocomplete {
1347
- border: 1px #484747 solid;
1348
- box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);
1349
- line-height: 1.4;
1350
- background: #25282c;
1351
- color: #c1c1c1;
1352
- }
1353
- .ace_autocomplete .ace_text-layer {
1354
- width: calc(100% - 8px);
1355
- }
1356
- .ace_autocomplete .ace_line {
1357
- display: flex;
1358
- align-items: center;
1359
- }
1360
- .ace_autocomplete .ace_line > * {
1361
- min-width: 0;
1362
- flex: 0 0 auto;
1363
- }
1364
- .ace_autocomplete .ace_line .ace_ {
1365
- flex: 0 1 auto;
1366
- overflow: hidden;
1367
- text-overflow: ellipsis;
1368
- }
1369
- .ace_autocomplete .ace_completion-spacer {
1370
- flex: 1;
1371
- }
1372
- .ace_autocomplete.ace_loading:after {
1373
- content: "";
1374
- position: absolute;
1375
- top: 0px;
1376
- height: 2px;
1377
- width: 8%;
1378
- background: blue;
1379
- z-index: 100;
1380
- animation: ace_progress 3s infinite linear;
1381
- animation-delay: 300ms;
1382
- transform: translateX(-100%) scaleX(1);
1383
- }
1384
- @keyframes ace_progress {
1385
- 0% { transform: translateX(-100%) scaleX(1) }
1386
- 50% { transform: translateX(625%) scaleX(2) }
1387
- 100% { transform: translateX(1500%) scaleX(3) }
1388
- }
1389
- @media (prefers-reduced-motion) {
1390
- .ace_autocomplete.ace_loading:after {
1391
- transform: translateX(625%) scaleX(2);
1392
- animation: none;
1393
- }
1394
- }
1395
- `,"autocompletion.css",!1),u.AcePopup=y,u.$singleLineEditor=m,u.getAriaId=l}),ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(n,u,v){var a=function(){function h(d){this.editor=d,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}return h.prototype.setScreenReaderContent=function(d){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var p=this.popup.getRow(),e=this.popup.renderer.$textLayer,t=e.element.childNodes[p-e.config.firstRow];if(t){for(var r="doc-tooltip ",l=0;l<this._lines.length;l++)r+="ace-inline-screenreader-line-".concat(l," ");t.setAttribute("aria-describedby",r)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=d.split(/\r\n|\r|\n/);var o=this.createCodeBlock();this.screenReaderDiv.appendChild(o)},h.prototype.destroy=function(){this.screenReaderDiv.remove()},h.prototype.createCodeBlock=function(){var d=document.createElement("pre");d.setAttribute("id","ace-inline-screenreader");for(var o=0;o<this._lines.length;o++){var p=document.createElement("code");p.setAttribute("id","ace-inline-screenreader-line-".concat(o));var e=document.createTextNode(this._lines[o]);p.appendChild(e),d.appendChild(p)}return d},h}();u.AceInlineScreenReader=a}),ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],function(n,u,v){var a=n("../snippets").snippetManager,h=n("./inline_screenreader").AceInlineScreenReader,d=function(){function o(){this.editor=null}return o.prototype.show=function(p,e,t){if(t=t||"",p&&this.editor&&this.editor!==p&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!p||!e)return!1;this.inlineScreenReader||(this.inlineScreenReader=new h(p));var r=e.snippet?a.getDisplayTextForSnippet(p,e.snippet):e.value;return e.hideInlinePreview||!r||!r.startsWith(t)?!1:(this.editor=p,this.inlineScreenReader.setScreenReaderContent(r),r=r.slice(t.length),r===""?p.removeGhostText():p.setGhostText(r),!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}();u.AceInline=d}),ace.define("ace/autocomplete/util",["require","exports","module"],function(n,u,v){u.parForEach=function(h,d,o){var p=0,e=h.length;e===0&&o();for(var t=0;t<e;t++)d(h[t],function(r,l){p++,p===e&&o(r,l)})};var a=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;u.retrievePrecedingIdentifier=function(h,d,o){o=o||a;for(var p=[],e=d-1;e>=0&&o.test(h[e]);e--)p.push(h[e]);return p.reverse().join("")},u.retrieveFollowingIdentifier=function(h,d,o){o=o||a;for(var p=[],e=d;e<h.length&&o.test(h[e]);e++)p.push(h[e]);return p},u.getCompletionPrefix=function(h){var d=h.getCursorPosition(),o=h.session.getLine(d.row),p;return h.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(t){!p&&t&&(p=this.retrievePrecedingIdentifier(o,d.column,t))}.bind(this))}.bind(this)),p||this.retrievePrecedingIdentifier(o,d.column)},u.triggerAutocomplete=function(h,o){var o=o??h.session.getPrecedingCharacter();return h.completers.some(function(p){if(p.triggerCharacters&&Array.isArray(p.triggerCharacters))return p.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(n,u,v){var a=n("./keyboard/hash_handler").HashHandler,h=n("./autocomplete/popup").AcePopup,d=n("./autocomplete/inline").AceInline,o=n("./autocomplete/popup").getAriaId,p=n("./autocomplete/util"),e=n("./lib/lang"),t=n("./lib/dom"),r=n("./snippets").snippetManager,l=n("./config"),s=n("./lib/event"),c=n("./lib/scroll").preventParentScroll,f=function(E,b){b.completer&&b.completer.destroy()},m=function(){function E(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new a,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=e.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=e.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=e.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=e.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=e.delayedCall(function(){var b=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!b||this.editor.completers.length===0||(this.completions=new D(E.completionsForLoading),this.openPopup(this.editor,b.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0))}.bind(this),this.stickySelectionDelay)}return Object.defineProperty(E,"completionsForLoading",{get:function(){return[{caption:l.nls("autocomplete.loading","Loading..."),value:""}]},enumerable:!1,configurable:!0}),E.prototype.$init=function(){return this.popup=new h(this.parentNode||document.body||document.documentElement),this.popup.on("click",function(b){this.insertMatch(),b.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)),s.addListener(this.popup.container,"mouseout",this.mouseOutListener.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup.renderer.on("afterRender",this.$onPopupRender.bind(this)),this.popup},E.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new d,this.inlineRenderer},E.prototype.getPopup=function(){return this.popup||this.$init()},E.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1},E.prototype.$seen=function(b){!this.hasSeen.has(b)&&b&&b.completer&&b.completer.onSeen&&typeof b.completer.onSeen=="function"&&(b.completer.onSeen(this.editor,b),this.hasSeen.add(b))},E.prototype.$onPopupChange=function(b){if(this.inlineRenderer&&this.inlineEnabled){var g=b?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(g),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule()}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null)},E.prototype.$updateGhostText=function(b){var g=this.base.row,S=this.base.column,T=this.editor.getCursorPosition().column,k=this.editor.session.getLine(g).slice(S,T);this.inlineRenderer.show(this.editor,b,k)?this.$seen(b):this.inlineRenderer.hide()},E.prototype.$onPopupRender=function(){var b=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var g=this.popup.getFirstVisibleRow();g<=this.popup.getLastVisibleRow();g++){var S=this.popup.getData(g);S&&(!b||S.hideInlinePreview)&&this.$seen(S)}},E.prototype.$onPopupShow=function(b){this.$onPopupChange(b),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},E.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var b=this.editor.container.parentNode,g=[];b;)g.push(b),b.addEventListener("scroll",this.onLayoutChange,{passive:!0}),b=b.parentNode;this.$elements=g}},E.prototype.unObserveLayoutChanges=function(){var b=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(g){g.removeEventListener("scroll",b.onLayoutChange,{passive:!0})}),this.$elements=null},E.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},E.prototype.$updatePopupPosition=function(){var b=this.editor,g=b.renderer,S=g.layerConfig.lineHeight,T=g.$cursorLayer.getPixelPosition(this.base,!0);T.left-=this.popup.getTextLeftOffset();var k=b.container.getBoundingClientRect();T.top+=k.top-g.layerConfig.offset,T.left+=k.left-b.renderer.scrollLeft,T.left+=g.gutterWidth;var _={top:T.top,left:T.left};g.$ghostText&&g.$ghostTextWidget&&this.base.row===g.$ghostText.position.row&&(_.top+=g.$ghostTextWidget.el.offsetHeight);var R=b.container.getBoundingClientRect().bottom-S,x=R<_.top?{top:R,left:_.left}:_;this.popup.tryShow(x,S,"bottom")||this.popup.tryShow(T,S,"top")||this.popup.show(T,S)},E.prototype.openPopup=function(b,g,S){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(),k=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}),b.keyBinding.addKeyboardHandler(this.keyboardHandler);var _;this.stickySelection&&(_=this.popup.data.indexOf(k)),(!_||_===-1)&&(_=0),this.popup.setRow(this.autoSelect?_:-1),_===T&&k!==this.completions.filtered[_]&&this.$onPopupChange();var R=this.inlineRenderer&&this.inlineEnabled;if(_===T&&R){var x=this.popup.getData(this.popup.getRow());this.$updateGhostText(x)}S||(this.popup.setTheme(b.getTheme()),this.popup.setFontSize(b.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},E.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off("afterRender",this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},E.prototype.changeListener=function(b){var g=this.editor.selection.lead;(g.row!=this.base.row||g.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},E.prototype.blurListener=function(b){var g=document.activeElement,S=this.editor.textInput.getElement(),T=b.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(b.relatedTarget),k=this.popup&&this.popup.container;g!=S&&g.parentNode!=k&&!T&&g!=this.tooltipNode&&b.relatedTarget!=S&&this.detach()},E.prototype.mousedownListener=function(b){this.detach()},E.prototype.mousewheelListener=function(b){this.popup&&!this.popup.isMouseOver&&this.detach()},E.prototype.mouseOutListener=function(b){this.popup.isOpen&&this.$updatePopupPosition()},E.prototype.goTo=function(b){this.popup.goTo(b)},E.prototype.insertMatch=function(b,g){if(b||(b=this.popup.getData(this.popup.getRow())),!b)return!1;if(b.value==="")return this.detach();var S=this.completions,T=this.getCompletionProvider().insertMatch(this.editor,b,S.filterText,g);return this.completions==S&&this.detach(),T},E.prototype.showPopup=function(b,g){this.editor&&this.detach(),this.activated=!0,this.editor=b,b.completer!=this&&(b.completer&&b.completer.detach(),b.completer=this),b.on("changeSelection",this.changeListener),b.on("blur",this.blurListener),b.on("mousedown",this.mousedownListener),b.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,g)},E.prototype.getCompletionProvider=function(b){return this.completionProvider||(this.completionProvider=new y(b)),this.completionProvider},E.prototype.gatherCompletions=function(b,g){return this.getCompletionProvider().gatherCompletions(b,g)},E.prototype.updateCompletions=function(b,g){if(b&&this.base&&this.completions){var T=this.editor.getCursorPosition(),k=this.editor.session.getTextRange({start:this.base,end:T});if(k==this.completions.filterText)return;if(this.completions.setFilter(k),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==k&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,k,b);return}if(g&&g.matches){var T=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(T.row,T.column),this.base.$insertRight=!0,this.completions=new D(g.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,"",b)}var S=this.editor.getSession(),T=this.editor.getCursorPosition(),k=p.getCompletionPrefix(this.editor);this.base=S.doc.createAnchor(T.row,T.column-k.length),this.base.$insertRight=!0;var _={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:k,pos:T}).provideCompletions(this.editor,_,function(R,x,A){var C=x.filtered,w=p.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),A){if(!C.length){var $=!this.autoShown&&this.emptyMessage;if(typeof $=="function"&&($=this.emptyMessage(w)),$){var I=[{caption:$,value:""}];this.completions=new D(I),this.openPopup(this.editor,w,b),this.popup.renderer.setStyle("ace_loading",!1),this.popup.renderer.setStyle("ace_empty-message",!0);return}return this.detach()}if(C.length==1&&C[0].value==w&&!C[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&C.length==1)return this.insertMatch(C[0])}this.completions=!A&&this.showLoadingState?new D(E.completionsForLoading.concat(C),x.filterText):x,this.openPopup(this.editor,w,b),this.popup.renderer.setStyle("ace_empty-message",!1),this.popup.renderer.setStyle("ace_loading",!A)}.bind(this)),this.showLoadingState&&!this.autoShown&&(!this.popup||!this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2)},E.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},E.prototype.updateDocTooltip=function(){var b=this.popup,g=this.completions&&this.completions.filtered,S=g&&(g[b.getHoveredRow()]||g[b.getRow()]),T=null;if(!S||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var k=this.editor.completers.length,_=0;_<k;_++){var R=this.editor.completers[_];if(R.getDocTooltip&&S.completerId===R.id){T=R.getDocTooltip(S);break}}if(!T&&typeof S!="string"&&(T=S),typeof T=="string"&&(T={docText:T}),!T||!T.docHTML&&!T.docText)return this.hideDocTooltip();this.showDocTooltip(T)},E.prototype.showDocTooltip=function(b){this.tooltipNode||(this.tooltipNode=t.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",c));var g=this.editor.renderer.theme;this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(g.isDark?"ace_dark ":"")+(g.cssClass||"");var S=this.tooltipNode;b.docHTML?S.innerHTML=b.docHTML:b.docText&&(S.textContent=b.docText),S.parentNode||this.popup.container.appendChild(this.tooltipNode);var T=this.popup,k=T.container.getBoundingClientRect(),_=400,R=300,x=T.renderer.scrollBar.width||10,A=k.left,C=window.innerWidth-k.right-x,w=T.isTopdown?k.top:window.innerHeight-x-k.bottom,$=[Math.min(C/_,1),Math.min(A/_,1),Math.min(w/R*.9)],I=Math.max.apply(Math,$),F=S.style;F.display="block",I==$[0]?(F.left=k.right+1+"px",F.right="",F.maxWidth=_*I+"px",F.top=k.top+"px",F.bottom="",F.maxHeight=Math.min(window.innerHeight-x-k.top,R)+"px"):I==$[1]?(F.right=window.innerWidth-k.left+"px",F.left="",F.maxWidth=_*I+"px",F.top=k.top+"px",F.bottom="",F.maxHeight=Math.min(window.innerHeight-x-k.top,R)+"px"):I==$[2]&&(F.left=window.innerWidth-k.left+"px",F.maxWidth=Math.min(_,window.innerWidth)+"px",T.isTopdown?(F.top=k.bottom+"px",F.left=k.left+"px",F.right="",F.bottom="",F.maxHeight=Math.min(window.innerHeight-x-k.bottom,R)+"px"):(F.top=T.container.offsetTop-S.offsetHeight+"px",F.left=k.left+"px",F.right="",F.bottom="",F.maxHeight=Math.min(T.container.offsetTop,R)+"px"))},E.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var b=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==b&&this.editor.focus(),this.tooltipNode=null,b.parentNode&&b.parentNode.removeChild(b)}},E.prototype.onTooltipClick=function(b){for(var g=b.target;g&&g!=this.tooltipNode;){if(g.nodeName=="A"&&g.href){g.rel="noreferrer",g.target="_blank";break}g=g.parentNode}},E.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var b=this.popup.container;b&&b.parentNode&&b.parentNode.removeChild(b)}this.editor&&this.editor.completer==this&&(this.editor.off("destroy",f),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},E.for=function(b){return b.completer instanceof E||(b.completer&&(b.completer.destroy(),b.completer=null),l.get("sharedPopups")?(E.$sharedInstance||(E.$sharedInstance=new E),b.completer=E.$sharedInstance):(b.completer=new E,b.once("destroy",f))),b.completer},E}();m.prototype.commands={Up:function(E){E.completer.goTo("up")},Down:function(E){E.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(E){E.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(E){E.completer.goTo("end")},Esc:function(E){E.completer.detach()},Return:function(E){return E.completer.insertMatch()},"Shift-Return":function(E){E.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(E){var b=E.completer.insertMatch();if(b||E.tabstopManager)return b;E.completer.goTo("down")},Backspace:function(E){E.execCommand("backspace");var b=p.getCompletionPrefix(E);!b&&E.completer&&E.completer.detach()},PageUp:function(E){E.completer.popup.gotoPageUp()},PageDown:function(E){E.completer.popup.gotoPageDown()}},m.startCommand={name:"startAutocomplete",exec:function(E,b){var g=m.for(E);g.autoInsert=!1,g.autoSelect=!0,g.autoShown=!1,g.showPopup(E,b),g.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var y=function(){function E(b){this.initialPosition=b,this.active=!0}return E.prototype.insertByIndex=function(b,g,S){return!this.completions||!this.completions.filtered?!1:this.insertMatch(b,this.completions.filtered[g],S)},E.prototype.insertMatch=function(b,g,S){if(!g)return!1;if(b.startOperation({command:{name:"insertMatch"}}),g.completer&&g.completer.insertMatch)g.completer.insertMatch(b,g);else{if(!this.completions)return!1;var T=this.completions.filterText.length,k=0;if(g.range&&g.range.start.row===g.range.end.row&&(T-=this.initialPosition.prefix.length,T+=this.initialPosition.pos.column-g.range.start.column,k+=g.range.end.column-this.initialPosition.pos.column),T||k){var _;b.selection.getAllRanges?_=b.selection.getAllRanges():_=[b.getSelectionRange()];for(var R=0,x;x=_[R];R++)x.start.column-=T,x.end.column+=k,b.session.remove(x)}g.snippet?r.insertSnippet(b,g.snippet):this.$insertString(b,g),g.completer&&g.completer.onInsert&&typeof g.completer.onInsert=="function"&&g.completer.onInsert(b,g),g.command&&g.command==="startAutocomplete"&&b.execCommand(g.command)}return b.endOperation(),!0},E.prototype.$insertString=function(b,g){var S=g.value||g;b.execCommand("insertstring",S)},E.prototype.gatherCompletions=function(b,g){var S=b.getSession(),T=b.getCursorPosition(),k=p.getCompletionPrefix(b),_=[];this.completers=b.completers;var R=b.completers.length;return b.completers.forEach(function(x,A){x.getCompletions(b,S,T,k,function(C,w){x.hideInlinePreview&&(w=w.map(function($){return Object.assign($,{hideInlinePreview:x.hideInlinePreview})})),!C&&w&&(_=_.concat(w)),g(null,{prefix:p.getCompletionPrefix(b),matches:_,finished:--R===0})})}),!0},E.prototype.provideCompletions=function(b,g,S){var T=function(x){var A=x.prefix,C=x.matches;this.completions=new D(C),g.exactMatch&&(this.completions.exactMatch=!0),g.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(A),(x.finished||this.completions.filtered.length)&&S(null,this.completions,x.finished)}.bind(this),k=!0,_=null;if(this.gatherCompletions(b,function(x,A){if(this.active){x&&(S(x,[],!0),this.detach());var C=A.prefix;if(C.indexOf(A.prefix)===0){if(k){_=A;return}T(A)}}}.bind(this)),k=!1,_){var R=_;_=null,T(R)}},E.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(b){typeof b.cancel=="function"&&b.cancel()})},E}(),D=function(){function E(b,g){this.all=b,this.filtered=b,this.filterText=g||"",this.exactMatch=!1,this.ignoreCaption=!1}return E.prototype.setFilter=function(b){if(b.length>this.filterText&&b.lastIndexOf(this.filterText,0)===0)var g=this.filtered;else var g=this.all;this.filterText=b,g=this.filterCompletions(g,this.filterText),g=g.sort(function(T,k){return k.exactMatch-T.exactMatch||k.$score-T.$score||(T.caption||T.value).localeCompare(k.caption||k.value)});var S=null;g=g.filter(function(T){var k=T.snippet||T.caption||T.value;return k===S?!1:(S=k,!0)}),this.filtered=g},E.prototype.filterCompletions=function(b,g){var S=[],T=g.toUpperCase(),k=g.toLowerCase();e:for(var _=0,R;R=b[_];_++){if(R.skipFilter){R.$score=R.score,S.push(R);continue}var x=!this.ignoreCaption&&R.caption||R.value||R.snippet;if(x){var A=-1,C=0,w=0,$,I;if(this.exactMatch){if(g!==x.substr(0,g.length))continue e}else{var F=x.toLowerCase().indexOf(k);if(F>-1)w=F;else for(var O=0;O<g.length;O++){var B=x.indexOf(k[O],A+1),P=x.indexOf(T[O],A+1);if($=B>=0&&(P<0||B<P)?B:P,$<0)continue e;I=$-A-1,I>0&&(A===-1&&(w+=10),w+=I,C|=1<<O),A=$}}R.matchMask=C,R.exactMatch=w?0:1,R.$score=(R.score||0)-w,S.push(R)}}return S},E}();u.Autocomplete=m,u.CompletionProvider=y,u.FilteredList=D}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(n,u,v){function a(p,e){var t=p.getTextRange(d.fromPoints({row:0,column:0},e));return t.split(o).length-1}function h(p,e){var t=a(p,e),r=p.getValue().split(o),l=Object.create(null),s=r[t];return r.forEach(function(c,f){if(!(!c||c===s)){var m=Math.abs(t-f),y=r.length-m;l[c]?l[c]=Math.max(y,l[c]):l[c]=y}}),l}var d=n("../range").Range,o=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;u.getCompletions=function(p,e,t,r,l){var s=h(e,t),c=Object.keys(s);l(null,c.map(function(f){return{caption:f,value:f,score:s[f],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(n,u,v){var a=n("../snippets").snippetManager,h=n("../autocomplete").Autocomplete,d=n("../config"),o=n("../lib/lang"),p=n("../autocomplete/util"),e=n("../autocomplete/text_completer"),t={getCompletions:function(T,k,_,R,x){if(k.$mode.completer)return k.$mode.completer.getCompletions(T,k,_,R,x);var A=T.session.getState(_.row),C=k.$mode.getCompletions(A,k,_,R);C=C.map(function(w){return w.completerId=t.id,w}),x(null,C)},id:"keywordCompleter"},r=function(T){var k={};return T.replace(/\${(\d+)(:(.*?))?}/g,function(_,R,x,A){return k[R]=A||""}).replace(/\$(\d+?)/g,function(_,R){return k[R]})},l={getCompletions:function(T,k,_,R,x){var A=[],C=k.getTokenAt(_.row,_.column);C&&C.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?A.push("html-tag"):A=a.getActiveScopes(T);var w=a.snippetMap,$=[];A.forEach(function(I){for(var F=w[I]||[],O=F.length;O--;){var B=F[O],P=B.name||B.tabTrigger;P&&$.push({caption:P,snippet:B.content,meta:B.tabTrigger&&!B.name?B.tabTrigger+"⇥ ":"snippet",completerId:l.id})}},this),x(null,$)},getDocTooltip:function(T){T.snippet&&!T.docHTML&&(T.docHTML=["<b>",o.escapeHTML(T.caption),"</b>","<hr></hr>",o.escapeHTML(r(T.snippet))].join(""))},id:"snippetCompleter"},s=[l,e,t];u.setCompleters=function(T){s.length=0,T&&s.push.apply(s,T)},u.addCompleter=function(T){s.push(T)},u.textCompleter=e,u.keyWordCompleter=t,u.snippetCompleter=l;var c={name:"expandSnippet",exec:function(T){return a.expandWithTab(T)},bindKey:"Tab"},f=function(T,k){m(k.session.$mode)},m=function(T){typeof T=="string"&&(T=d.$modes[T]),T&&(a.files||(a.files={}),y(T.$id,T.snippetFileId),T.modes&&T.modes.forEach(m))},y=function(T,k){!k||!T||a.files[T]||(a.files[T]={},d.loadModule(k,function(_){_&&(a.files[T]=_,!_.snippets&&_.snippetText&&(_.snippets=a.parseSnippetFile(_.snippetText)),a.register(_.snippets||[],_.scope),_.includeScopes&&(a.snippetMap[_.scope].includeScopes=_.includeScopes,_.includeScopes.forEach(function(R){m("ace/mode/"+R)})))}))},D=function(T){var k=T.editor,_=k.completer&&k.completer.activated;if(T.command.name==="backspace")_&&!p.getCompletionPrefix(k)&&k.completer.detach();else if(T.command.name==="insertstring"&&!_){E=T;var R=T.editor.$liveAutocompletionDelay;R?b.delay(R):g(T)}},E,b=o.delayedCall(function(){g(E)},0),g=function(T){var k=T.editor,_=p.getCompletionPrefix(k),R=T.args,x=p.triggerAutocomplete(k,R);if(_&&_.length>=k.$liveAutocompletionThreshold||x){var A=h.for(k);A.autoShown=!0,A.showPopup(k)}},S=n("../editor").Editor;n("../config").defineOptions(S.prototype,"editor",{enableBasicAutocompletion:{set:function(T){T?(this.completers||(this.completers=Array.isArray(T)?T:s),this.commands.addCommand(h.startCommand)):this.commands.removeCommand(h.startCommand)},value:!1},enableLiveAutocompletion:{set:function(T){T?(this.completers||(this.completers=Array.isArray(T)?T:s),this.commands.on("afterExec",D)):this.commands.off("afterExec",D)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(T){T?(this.commands.addCommand(c),this.on("changeMode",f),f(null,this)):(this.commands.removeCommand(c),this.off("changeMode",f))},value:!1}})}),function(){ace.require(["ace/ext/language_tools"],function(n){L&&(L.exports=n)})}()})(Ia);const Ai={jsonError:{border:"1px solid red",minHeight:200},jsonNoError:{border:"1px solid #00000000",minHeight:200}};function Fa(L){return M.createElement($a,{style:L.error===!0?Ai.jsonError:L.error===!1?Ai.jsonNoError:void 0,mode:L.mode||"json",width:"100%",height:"100%",showPrintMargin:L.editValueMode,showGutter:L.editValueMode,highlightActiveLine:L.editValueMode,defaultValue:L.defaultValue,theme:L.themeType==="dark"?"clouds_midnight":"chrome",value:L.value,readOnly:!L.onChange,onChange:i=>L.onChange(i),name:L.name||"UNIQUE_ID_OF_DIV1",fontSize:L.fontSize||14,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:L.editValueMode,tabSize:L.editValueMode?2:void 0},editorProps:{$blockScrolling:!0}})}const Rn={flex:{display:"flex"},button:{height:48,minWidth:48},wrapper:{width:"calc(100vw - 40px)",height:"calc(100vh - 188px)"}};class Ra extends K{componentDidMount(){super.componentDidMount();const{data:i,attr:n}=this.props,u=K.getValue(i,n)||"{}";this.setState({value:u,initialized:!0,jsonError:this.validateJson(u)})}validateJson(i){let n=!1;if(this.props.schema.validateJson!==!1&&(i||!this.props.schema.allowEmpty))try{this.props.schema.json5?Vi.parse(i):JSON.parse(i)}catch(u){console.log("Error in JSON",u),n=!0}return n}renderItem(i,n){if(!this.state.initialized)return null;const{schema:u,data:v,attr:a}=this.props,{value:h,showSelectId:d}=this.state;return M.createElement(N.FormControl,{fullWidth:!0,variant:"standard"},M.createElement("div",{style:Rn.flex},M.createElement(N.Button,{color:"grey",disabled:n,style:Rn.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},j.I18n.t("ra_JSON editor"))),d?M.createElement(lo,{title:this.getText(u.label),overflowHidden:!0,applyDisabled:this.state.jsonError&&this.props.schema.doNotApplyWithError,onClose:()=>this.setState({showSelectId:!1,value:K.getValue(v,a)||{}}),onApply:()=>this.setState({showSelectId:!1},()=>this.onChange(a,h))},M.createElement("div",{style:{...Rn.wrapper,border:this.state.jsonError?"2px solid red":"2px solid transparent"}},M.createElement(Fa,{mode:this.props.schema.json5?"json5":"json",value:typeof h=="object"?JSON.stringify(h):h,onChange:o=>this.setState({value:o,jsonError:this.validateJson(o)}),name:"ConfigJsonEditor",themeType:this.props.oContext.themeType}))):null,u.help||this.state.jsonError?M.createElement(N.FormHelperText,null,this.state.jsonError?j.I18n.t("ra_Invalid JSON"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Oa=[{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 Na extends K{componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr),n=[...Oa];this.props.schema.system?n.unshift({value:"",label:j.I18n.t("ra_System language")}):n.unshift({value:"",label:j.I18n.t("ra_none")}),this.setState({value:this.props.schema.system?i||"":i||j.I18n.getLanguage(),selectOptions:n})}renderItem(i,n){var v,a;if(!this.state.selectOptions)return null;const u=(v=this.state.selectOptions)==null?void 0:v.find(h=>h.value===this.state.value||!h.value&&!this.state.value);return M.createElement(N.FormControl,{fullWidth:!0,variant:"standard"},this.props.schema.label?M.createElement(N.InputLabel,null,this.getText(this.props.schema.label)):null,M.createElement(N.Select,{variant:"standard",error:!!i,disabled:n,value:this.state.value||"_",renderValue:()=>this.getText(u==null?void 0:u.label,this.props.schema.noTranslation),onChange:h=>{let{value:d}=h.target;d==="_"&&(d=""),this.setState({value:d},()=>{const o=this.onChange(this.props.attr,d);if(o instanceof Promise&&o.catch(p=>console.error(p)),this.props.schema.changeGuiLanguage)if(d){if(d===j.I18n.getLanguage())return;j.I18n.setLanguage(d),this.props.oContext.changeLanguage&&this.props.oContext.changeLanguage()}else this.props.oContext.socket.getSystemConfig().then(p=>{p.common.language!==j.I18n.getLanguage()&&p.common.language&&(j.I18n.setLanguage(p.common.language),this.props.oContext.changeLanguage&&this.props.oContext.changeLanguage())}).catch(p=>console.error(`Cannot read system config: ${p}`))})}},(a=this.state.selectOptions)==null?void 0:a.map(h=>M.createElement(N.MenuItem,{key:h.value,value:h.value},h.label))),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Ba extends K{scrollRef;constructor(i){super(i),this.scrollRef=M.createRef()}scrolledDown(){return this.scrollRef.current?this.scrollRef.current.offsetHeight+this.scrollRef.current.scrollTop>=this.scrollRef.current.scrollHeight:!1}componentDidMount(){super.componentDidMount(),K.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(i=>i.text()).then(i=>this.setState({license:i,loading:!1})).catch(i=>this.setState({license:i.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(i,n){return this.state.showLicenseDialog?M.createElement(N.Dialog,{maxWidth:"lg",open:!0,onClose:(u,v)=>{v!=="escapeKeyDown"&&v!=="backdropClick"&&this.setState({showLicenseDialog:!1})}},M.createElement(N.DialogTitle,null,this.props.schema.title?j.I18n.t(this.props.schema.title):j.I18n.t("ra_License agreement")),M.createElement(N.DialogContent,null,this.props.schema.licenseUrl?M.createElement(M.Fragment,null,this.state.loading?M.createElement(N.LinearProgress,null):null,M.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?M.createElement("div",{ref:this.scrollRef,style:{width:"100%",height:"100%",overflowY:"auto",fontSize:14}},this.props.schema.texts.map((u,v)=>this.props.schema.noTranslation?M.createElement("p",{key:v},u):M.createElement("p",{key:v},j.I18n.t(u)))):null),M.createElement(N.DialogActions,null,this.props.schema.checkBox?M.createElement(N.FormControlLabel,{control:M.createElement(N.Checkbox,{disabled:n,checked:!!this.state.licenseChecked,onClick:()=>this.setState({licenseChecked:!this.state.licenseChecked})}),label:j.I18n.t(this.props.schema.checkBox)}):null,M.createElement(N.Button,{disabled:n||this.state.loading||this.state.error||this.props.schema.checkBox&&!this.state.licenseChecked||!this.state.scrolledDown,onClick:()=>{this.setState({showLicenseDialog:!1});const u=this.onChange(this.props.attr,!0);u instanceof Promise&&u.catch(v=>console.error(`Cannot set value: ${v}`))},color:"primary",variant:"contained",startIcon:M.createElement(Z.Check,null)},this.props.schema.agreeText?j.I18n.t(this.props.schema.agreeText):j.I18n.t("ra_Accept license")),M.createElement(N.Button,{onClick:()=>{this.setState({showLicenseDialog:!1}),setTimeout(()=>this.setState({showLicenseDialog:!0}),2e3)},color:"grey",variant:"contained",startIcon:M.createElement(Z.Close,null)},j.I18n.t("ra_Close")))):null}}const xi={indeterminate:{opacity:.5},control:{flexDirection:"row",width:"100%"}};class Pa extends K{updateTimeout;componentDidMount(){super.componentDidMount();let i=K.getValue(this.props.data,this.props.attr);if(i==null&&(i=""),Array.isArray(i)&&this.props.oContext.multiEdit){i=K.DIFFERENT_VALUE,this.setState({_value:i,oldValue:i});return}this.setState({_value:i.toString(),oldValue:i.toString()})}static getDerivedStateFromProps(i,n){if(i.schema.min!==void 0&&i.schema.min<0||i.schema.max!==void 0&&i.schema.max<0)return null;const u=K.getValue(i.data,i.attr);return i.oContext.multiEdit&&n._value===K.DIFFERENT_VALUE?{_value:K.DIFFERENT_VALUE}:u==null||n.oldValue===null||n.oldValue===void 0||u.toString()!==parseFloat(n._value).toString()&&u.toString()!==n.oldValue.toString()?{_value:u}:null}checkValue(i){if(i==null)return null;i=i.toString().trim();const n=i===""?0:parseFloat(i);return i!==""&&Number.isNaN(n)?"ra_Not a number":i!==""&&window.isFinite(n)?this.props.schema.min!==void 0&&n<this.props.schema.min?"ra_Too small":this.props.schema.max!==void 0&&n>this.props.schema.max?"ra_Too big":i===""||i==="-"||Number.isNaN(n)?"ra_Not a number":null:"ra_Not a number"}renderItem(i,n){const u=Array.isArray(this.state._value)||this.state._value===K.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),u){const v=K.getValue(this.props.data,this.props.attr),a=(v==null?void 0:v.filter(h=>h||h===0).map(h=>({label:h.toString(),value:h})))||[];return a.unshift({label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),M.createElement(N.Autocomplete,{style:xi.indeterminate,fullWidth:!0,freeSolo:!0,value:a[0],getOptionSelected:(h,d)=>h.label===d.label,onChange:(h,d)=>{const o=this.onChange(this.props.attr,d==null?void 0:d.value,()=>{this.setState({_value:d==null?void 0:d.value,oldValue:this.state._value})});o instanceof Promise&&o.catch(p=>console.error(p))},options:a,getOptionLabel:h=>h.label,renderInput:h=>M.createElement(N.TextField,{...h,label:this.getText(this.props.schema.label),variant:"standard",slotProps:{htmlInput:{...h.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:!!i,placeholder:this.getText(this.props.schema.placeholder),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:!!n})})}return!i&&this.state._value!==null&&this.state._value!==void 0&&this.state._value&&(i=this.checkValue(this.state._value),i&&(i=j.I18n.t(i))),M.createElement(N.FormControl,{variant:"standard",style:xi.control},M.createElement(N.TextField,{variant:"standard",type:"number",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):void 0}},value:this.state._value===null||this.state._value===void 0?"":this.state._value,error:!!i,disabled:!!n,onChange:v=>{const a=v.target.value,h=this.checkValue(a);h?this.onError(this.props.attr,j.I18n.t(h)):this.onError(this.props.attr),this.setState({_value:a,oldValue:this.state._value},()=>this.onChange(this.props.attr,parseFloat(a)))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:i&&typeof i=="string"?i:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}))}}const $i={flex:{display:"flex"},button:{height:48,marginLeft:4,minWidth:48}};class Wa extends K{componentDidMount(){super.componentDidMount();const{data:i,attr:n}=this.props,u=K.getValue(i,n)||"";this.setState({value:u,initialized:!0})}renderItem(i,n){if(!this.state.initialized)return null;const u=this.props.oContext.socket,{schema:v,attr:a}=this.props,{value:h,showSelectId:d}=this.state;return M.createElement(N.FormControl,{fullWidth:!0,variant:"standard"},v.label?M.createElement(N.InputLabel,{shrink:!0},this.getText(v.label)):null,M.createElement("div",{style:$i.flex},M.createElement(N.TextField,{variant:"standard",fullWidth:!0,value:h,error:!!i,disabled:n,placeholder:this.getText(v.placeholder),label:this.getText(v.label),helperText:this.renderHelp(v.help,v.helpLink,v.noTranslation),onChange:o=>{const p=o.target.value;this.setState({value:p},()=>this.onChange(a,p))}}),M.createElement(N.Button,{color:"grey",disabled:n,style:$i.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},"...")),d?M.createElement(j.DialogSelectID,{imagePrefix:this.props.oContext.imagePrefix===void 0?"../..":this.props.oContext.imagePrefix,dialogName:`admin.${this.props.oContext.adapterName}`,filterFunc:v.filterFunc,themeType:this.props.oContext.themeType,theme:this.props.oContext.theme,types:v.types?Array.isArray(v.types)?v.types:[v.types]:void 0,customFilter:v.customFilter,filters:v.filters,socket:u,selected:h,root:v.root,onClose:()=>this.setState({showSelectId:!1}),onOk:o=>this.setState({showSelectId:!1,value:o},()=>this.onChange(a,o))}):null)}}const On={fullWidth:{width:"100%",display:"inline-block"},halfWidth1:{width:"calc(50% - 5px)",display:"inline-block",marginRight:8},halfWidth2:{width:"calc(50% - 5px)",display:"inline-block"}},an="____ppp____";class Ha extends K{componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr);this.setState({_repeat:i?an:"",_visible:!1,value:i?an:"",_notEqual:!1})}onChangePassword(i,n){i===void 0&&(i=this.state.value),n===void 0&&(n=this.state._repeat);const u=!!this.props.schema.repeat&&n!==i;this.setState({value:i,_repeat:n,_notEqual:u},()=>{if(u)this.onError(this.props.attr,j.I18n.t("ra_Passwords are not equal!"));else{this.onError(this.props.attr);const v=this.onChange(this.props.attr,i);v instanceof Promise&&v.catch(a=>this.onError(this.props.attr,a))}})}renderItem(i,n){if(this.state._notEqual===void 0)return null;const u=M.createElement(N.TextField,{variant:"standard",fullWidth:!0,type:this.state._visible&&this.state.value!==an?"text":"password",value:this.state.value,error:!!i||this.state._notEqual,disabled:!!n,onChange:v=>this.onChangePassword(v.target.value),label:this.getText(this.props.schema.label),slotProps:{input:{autoComplete:"new-password",endAdornment:this.state.value&&this.state.value!==an&&this.props.schema.visible&&!n&&!this.props.schema.readOnly?M.createElement(N.InputAdornment,{position:"end"},M.createElement(N.IconButton,{size:"large",tabIndex:-1,onClick:v=>{v.preventDefault(),v.stopPropagation(),this.setState({_visible:!this.state._visible})},edge:"end"},this.state._visible?M.createElement(Z.VisibilityOff,null):M.createElement(Z.Visibility,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?j.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 v=this.state._visible?null:M.createElement(N.TextField,{variant:"standard",fullWidth:!0,type:"password",value:this.state._repeat,error:!!i||this.state._notEqual,disabled:!!n,onChange:a=>this.onChangePassword(void 0,a.target.value),label:`${this.getText(this.props.schema.label)} (${j.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?j.I18n.t("ra_Passwords are not equal!"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)});return M.createElement("div",{style:On.fullWidth},M.createElement("div",{style:On.halfWidth1},u),M.createElement("div",{style:On.halfWidth2},v))}return u}}class za extends K{renderItem(i,n){return M.createElement(N.TextField,{variant:"standard",fullWidth:!0,disabled:!!n,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?M.createElement(N.IconButton,{size:"small",onClick:()=>{j.Utils.copyToClipboard(this.getPattern(this.props.schema.pattern,null,this.props.schema.noTranslation)),window.alert(j.I18n.t("ra_Copied"))}},M.createElement(j.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 ja={warning:{"& .Mui-error":{color:"orange"}}};class Va extends K{updateTimeout;async componentDidMount(){super.componentDidMount();let i=K.getValue(this.props.data,this.props.attr);i==null&&(i=""),this.setState({_value:i.toString(),oldValue:i.toString()});const n=await this.props.oContext.socket.getAdapterInstances(),u=`system.adapter.${this.props.oContext.adapterName}.${this.props.oContext.instance}`,v=await this.props.oContext.socket.getObject(u),a=v==null?void 0:v.common.host,h=[];n.forEach(d=>{var p,e,t,r;if(!d||d._id===u||d.common.host!==a||!((p=d.native)!=null&&p.bind))return;if(d!=null&&d.native&&d.native.secure&&d.native.leEnabled&&d.native.leUpdate){const l=parseInt(d.native.leCheckPort||d.native.lePort,10);l&&h.push({name:`${d._id.replace("system.adapter.","")} (LE)`,port:l,v6bind:d.native.bind.includes(":")?d.native.bind:d.native.v6bind,bind:d.native.bind,enabled:!!((e=d.common)!=null&&e.enabled)})}const o=parseInt((t=d==null?void 0:d.native)==null?void 0:t.port,10);o&&h.push({name:d._id.replace("system.adapter.",""),bind:d.native.bind,v6bind:d.native.bind.includes(":")?d.native.bind:d.native.v6bind,port:o,enabled:!!((r=d.common)!=null&&r.enabled)})}),this.setState({ports:h})}static getDerivedStateFromProps(i,n){const u=K.getValue(i.data,i.attr);return u==null||n.oldValue===null||n.oldValue===void 0||u.toString()!==parseInt(n._value,10).toString()&&u.toString()!==n.oldValue.toString()?{_value:u}:null}checkValue(i){if(i==null)return null;const n=this.props.schema.min===void 0?20:this.props.schema.min,u=this.props.schema.max||65535;i=i.toString().trim();const v=i===""?0:parseInt(i,10);return i!==""&&Number.isNaN(v)?"ra_Not a number":i!==""&&window.isFinite(Number(i))?v<n?"ra_Too small":v>u?"ra_Too big":i===""||i==="-"||Number.isNaN(v)?"ra_Not a number":null:"ra_Not a number"}renderItem(i,n){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 u=this.props.schema.min===void 0?20:this.props.schema.min,v=this.props.schema.max||65535;let a;if(this.state.ports){const h=parseInt(this.state._value,10);if(h){const d=this.state.ports.filter(p=>!this.props.data.bind||this.props.data.bind===p.bind||this.props.data.bind==="0.0.0.0"||p.bind==="0.0.0.0");let o=d.findIndex(p=>p.port===h&&p.enabled);o!==-1?i=j.I18n.t("ra_Port is already used by %s",this.state.ports[o].name):(o=d.findIndex(p=>p.port===h&&!p.enabled),o!==-1&&(a=!0,i=j.I18n.t("ra_Port could be used by %s",this.state.ports[o].name)))}}return!i&&this.state._value!==null&&this.state._value!==void 0&&(i=this.checkValue(this.state._value),typeof i=="string"&&(i=j.I18n.t(i))),M.createElement(N.TextField,{variant:"standard",type:"number",fullWidth:!0,slotProps:{htmlInput:{min:u,max:v,readOnly:this.props.schema.readOnly||!1}},value:this.state._value===null||this.state._value===void 0?"":this.state._value,error:!!i,disabled:!!n,sx:a?ja.warning:void 0,onChange:h=>{const d=Number(h.target.value.toString().replace(/[^0-9]/g,"")).toString(),o=this.checkValue(d);o?this.onError(this.props.attr,j.I18n.t(o)):this.onError(this.props.attr),this.setState({_value:d,oldValue:this.state._value},()=>{if(d.trim()===parseInt(d,10).toString()){const p=this.onChange(this.props.attr,parseInt(d,10)||0);p instanceof Promise&&p.catch(e=>{console.error(`Cannot set value for ${this.props.attr}: ${e}`)})}})},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:i&&typeof i=="string"?i:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}class Ua extends K{componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums("rooms").then(n=>{const u=Object.keys(n).map(v=>({value:this.props.schema.short?v.replace("enum.rooms.",""):v,label:this.getText(n[v].common.name),obj:n[v]}));this.props.schema.allowDeactivate!==!1&&u.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.setState({value:i,selectOptions:u})}).catch(n=>console.error(`Cannot get enums: ${n}`))}renderItem(i,n){if(!this.state.selectOptions)return null;const u=this.state.selectOptions.find(v=>v.value===this.state.value);return M.createElement(N.FormControl,{variant:"standard",fullWidth:!0},this.props.schema.label?M.createElement(N.InputLabel,null,this.getText(this.props.schema.label)):null,M.createElement(N.Select,{variant:"standard",error:!!i,disabled:!!n,value:this.state.value||"_",renderValue:()=>u?u.obj?M.createElement(j.TextWithIcon,{value:u.obj,themeType:this.props.oContext.themeType,lang:j.I18n.getLanguage()}):u.label:"",onChange:v=>{this.setState({value:v.target.value==="_"?"":v.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(v=>M.createElement(N.MenuItem,{key:v.value,value:v.value,style:v.value===K.DIFFERENT_VALUE?{opacity:.5}:{}},v.obj?M.createElement(j.TextWithIcon,{value:v.obj,themeType:this.props.oContext.themeType,lang:j.I18n.getLanguage()}):v.label))),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Ga={noMargin:{"&>div":{marginTop:0}}};class Ka extends K{initialValue="";componentDidMount(){super.componentDidMount();let i=K.getValue(this.props.data,this.props.attr);this.props.schema.multiple&&(typeof i=="string"?i=[i]:i==null&&(i=[]));const n=[];(this.props.schema.options||[]).forEach(u=>{const v=u;Array.isArray(v.items)?(n.push({label:this.getText(u.label,this.props.schema.noTranslation),value:u.value,group:!0}),v.items.forEach(a=>n.push({label:this.getText(a.label,this.props.schema.noTranslation),value:a.value,hidden:a.hidden}))):n.push({label:this.getText(u.label,this.props.schema.noTranslation),value:u.value,hidden:u.hidden})}),Array.isArray(i)&&!this.props.schema.multiple?(this.initialValue=[...i],n.unshift({label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),this.setState({value:K.DIFFERENT_VALUE,selectOptions:n})):this.setState({value:i,selectOptions:n})}_getValue(){let i=this.state.value===null||this.state.value===void 0?K.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof i=="string"?i=[i]:i==null&&(i=[])),i}renderItem(i,n){if(!this.state.selectOptions)return null;const u=(this.state.selectOptions||[]).filter(h=>h.hidden?this.props.custom?!this.executeCustom(h.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!this.execute(h.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!0),v=this._getValue(),a=this.props.schema.multiple?null:u.find(h=>h.value==v);return M.createElement(N.FormControl,{variant:"standard",fullWidth:!0,sx:this.props.table!==void 0&&Ga.noMargin,id:`jsonSelect_${this.props.attr}_${this.props.index||this.props.index===0?this.props.index:""}`},this.props.schema.label?M.createElement(N.InputLabel,null,this.getText(this.props.schema.label)):null,M.createElement(N.Select,{variant:"standard",error:!!i,multiple:this.props.schema.multiple,disabled:!!n,value:v||"_",renderValue:h=>this.props.schema.multiple?M.createElement(N.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5}},h.map(d=>{const o=u.find(p=>p.value===d);if(o||this.props.schema.showAllValues!==!1){const p=(o==null?void 0:o.label)||d;return M.createElement(N.Chip,{key:d,label:p})}return null})):this.getText(a==null?void 0:a.label,this.props.schema.noTranslation),onChange:h=>{this.setState({value:h.target.value==="_"?"":h.target.value},()=>{let d;this.state.value===K.DIFFERENT_VALUE?d=this.onChange(this.props.attr,this.initialValue):d=this.onChange(this.props.attr,this.state.value),d instanceof Promise&&d.catch(o=>console.error(o))})}},u.map((h,d)=>h.group?M.createElement(N.ListSubheader,{key:d},this.getText(h.label,this.props.schema.noTranslation)):M.createElement(N.MenuItem,{key:d,value:h.value,style:h.value===K.DIFFERENT_VALUE?{opacity:.5}:{}},this.props.schema.multiple?M.createElement(N.Checkbox,{checked:v.includes(h.value),onClick:()=>{const o=JSON.parse(JSON.stringify(this._getValue())),p=v.indexOf(h.value);p!==-1?o.splice(p,1):(o.push(h.value),o.sort()),this.setState({value:o},()=>this.onChange(this.props.attr,o))}}):null,M.createElement(N.ListItemText,{primary:this.getText(h.label,this.props.schema.noTranslation)})))),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Ja={menuPaper:{maxHeight:800}};class Ya extends K{initialized=!1;localContext;askInstance(){if(this.props.alive){let i=this.props.schema.data;if(i===void 0&&this.props.schema.jsonData){const n=this.getPattern(this.props.schema.jsonData,null,!0);try{i=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${n}`)}}i===void 0&&(i=null),this.setState({running:!0},()=>{this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",i).then(n=>this.setState({list:n,running:!1})).catch(n=>{console.error(`Cannot send command: ${n}`)})})}else{const i=K.getValue(this.props.data,this.props.attr);this.setState({value:i,running:!1})}}getContext(){const i={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(n=>i[n]=K.getValue(this.props.data,n)),JSON.stringify(i)}_getValue(){let i=this.state.value===null||this.state.value===void 0?K.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof i=="string"?i=[i]:i==null&&(i=[])),i}renderItem(i,n){var h;if(this.props.alive){const d=this.getContext();(d!==this.localContext||!this.initialized)&&(this.localContext=d,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}const u=this._getValue();if(!this.props.alive||!this.state.running&&!((h=this.state.list)!=null&&h.length))return this.props.schema.multiple||this.props.schema.manual===!1?j.I18n.t("ra_Cannot retrieve options, as instance is offline"):M.createElement(N.TextField,{variant:"standard",fullWidth:!0,value:u,error:!!i,disabled:!!n,onChange:d=>{const o=d.target.value;this.setState({value:o},()=>this.onChange(this.props.attr,(o||"").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?M.createElement(N.InputAdornment,{position:"end"},M.createElement(N.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({value:""},()=>this.onChange(this.props.attr,""))},M.createElement(Z.Close,null))):null}}});if(this.state.running)return M.createElement(N.CircularProgress,{size:"24"});const v=this.state.list.filter(d=>d.hidden?this.props.custom?!this.executeCustom(d.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!this.execute(d.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!0),a=v.find(d=>d.value===u);return M.createElement(N.FormControl,{variant:"standard",fullWidth:!0},this.props.schema.label?M.createElement(N.InputLabel,null,this.getText(this.props.schema.label)):null,M.createElement(N.Select,{variant:"standard",error:!!i,multiple:this.props.schema.multiple,disabled:!!n,sx:{"&.MuiSelect-paper":this.props.schema.multiple?Ja.menuPaper:void 0},value:u,renderValue:d=>this.props.schema.multiple?M.createElement(N.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5}},d.map(o=>{const p=v.find(e=>e.value===o);if(p||this.props.schema.showAllValues!==!1){const e=(p==null?void 0:p.label)||o;return M.createElement(N.Chip,{key:o,label:e})}return null})):this.getText((a==null?void 0:a.label)||d,this.props.schema.noTranslation),onChange:d=>{const o=this.onChange(this.props.attr,d.target.value);o instanceof Promise&&o.catch(p=>console.error(`Cannot set value: ${p}`))}},v.map((d,o)=>d.group?M.createElement(N.ListSubheader,{key:o},this.getText(d.label,this.props.schema.noTranslation)):M.createElement(N.MenuItem,{key:o,value:d.value},this.props.schema.multiple?M.createElement(N.Checkbox,{checked:u.includes(d.value),onClick:()=>{const p=JSON.parse(JSON.stringify(this._getValue())),e=u.indexOf(d.value);e!==-1?p.splice(e,1):(p.push(d.value),p.sort()),this.setState({value:p},()=>this.onChange(this.props.attr,p))}}):null,M.createElement(N.ListItemText,{primary:d.label})))),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Ti={fullWidth:{width:"100%"}};function ut(L){return L.split(".").reduce((i,n)=>(i<<8)+parseInt(n,10),0)>>>0}function Qa(L,i){var v,a;const n=(a=(v=L==null?void 0:L.native)==null?void 0:v.hardware)==null?void 0:a.networkInterfaces;if(!n)return null;let u;return Object.keys(n).forEach(h=>n[h].forEach(d=>{d.internal||i.includes(":")&&d.family!=="IPv6"||i.includes(".")&&!i.match(/[^.\d]/)&&d.family!=="IPv4"||(d.family==="IPv4"&&!d.address.startsWith("172")&&(i==="127.0.0.0"||i==="localhost"||i.match(/[^.\d]/))?u=d.address:u||(d.family==="IPv4"&&i.includes(".")&&(ut(i)&ut(d.netmask),ut(d.address)&ut(d.netmask)),u=d.address))})),u||Object.keys(n).forEach(h=>n[h].forEach(d=>{d.internal||i.includes(":")&&d.family!=="IPv6"||i.includes(".")&&!i.match(/[^.\d]/)&&d.family!=="IPv4"||(d.family==="IPv6"&&(i==="127.0.0.0"||i==="localhost"||i.match(/[^.\d]/))?u=d.address:u||(d.family==="IPv4"&&i.includes(".")&&(ut(i)&ut(d.netmask),ut(d.address)&ut(d.netmask)),u=d.address))})),u||Object.keys(n).forEach(h=>{n[h].forEach(d=>{d.internal||i.includes(":")&&d.family!=="IPv6"||i.includes(".")&&!i.match(/[^.\d]/)&&d.family!=="IPv4"||(i==="127.0.0.0"||i==="localhost"||i.match(/[^.\d]/),u=d.address)})}),u||Object.keys(n).forEach(h=>{n[h].forEach(d=>{d.internal||(u=d.address)})}),u}class _i extends K{async componentDidMount(){var n;super.componentDidMount();let i=window.location.hostname;if(this.props.schema.openUrl){const u=await this.props.oContext.socket.getCurrentInstance(),v=await this.props.oContext.socket.getObject(`system.adapter.${u}`);if(v){const a=await this.props.oContext.socket.getObject(`system.host.${(n=v==null?void 0:v.common)==null?void 0:n.host}`);if(a){const h=Qa(a,window.location.hostname);if(h)i=`${h}:${window.location.port}`;else{console.warn(`Cannot find suitable IP in host ${v.common.host} for ${v._id}`);return}}}}await new Promise(u=>{this.setState({_error:"",_message:"",hostname:i},u)}),this.props.schema.onLoaded&&this._onClick()}renderErrorDialog(){return this.state._error?M.createElement(j.DialogError,{text:this.state._error,onClose:()=>this.setState({_error:""})}):null}renderMessageDialog(){return this.state._message?M.createElement(j.DialogMessage,{text:this.state._message,onClose:()=>this.setState({_message:""})}):null}_onClick(){this.props.oContext.onCommandRunning(!0),this.setState({running:!0});const i=`${window.location.protocol}//${window.location.host}${window.location.pathname.replace(/\/index\.html$/,"")}`,n=`${window.location.protocol}//${this.state.hostname.split(":").length>3?`[${this.state.hostname}]`:this.state.hostname}${window.location.pathname.replace(/\/index\.html$/,"")}`;let u=this.props.schema.data;if(u===void 0&&this.props.schema.jsonData){const a=this.getPattern(this.props.schema.jsonData,{_origin:i,_originIp:n,...this.props.data},!0);try{u=JSON.parse(a)}catch{console.error(`Cannot parse json data: ${a}`)}}u===void 0&&(u=null),this.props.schema.openUrl&&!u&&(u={_origin:i,_originIp:n});let v;this.props.schema.timeout&&(v=setTimeout(()=>{this.props.oContext.onCommandRunning(!1),this.setState({_error:j.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",u).then(async a=>{if(v&&(clearTimeout(v),v=void 0),a!=null&&a.error)if(this.props.schema.error&&this.props.schema.error[a.error]){let h=this.getText(this.props.schema.error[a.error]);a.args&&a.args.forEach(d=>h=h.replace("%s",d)),this.setState({_error:h})}else this.setState({_error:a.error?j.I18n.t(a.error):j.I18n.t("ra_Error")});else{if(a!=null&&a.command){this.props.oContext.onBackEndCommand&&this.props.oContext.onBackEndCommand(a.command);return}if(a!=null&&a.reloadBrowser&&this.props.schema.reloadBrowser)window.location.reload();else if(a!=null&&a.openUrl&&this.props.schema.openUrl)window.open(a.openUrl,a.window||this.props.schema.window||"_blank");else if(a!=null&&a.result&&this.props.schema.result&&this.props.schema.result[a.result]){let h=this.getText(this.props.schema.result[a.result]);a.args&&a.args.forEach(d=>h=h.replace("%s",d)),window.alert(h)}if(a!=null&&a.native&&this.props.schema.useNative){for(const[h,d]of Object.entries(a.native))await this.onChangeAsync(h,d);setTimeout(()=>this.props.oContext.forceUpdate(Object.keys(a.native),this.props.data),300)}else a!=null&&a.result?window.alert(typeof a.result=="object"?JSON.stringify(a.result):a.result):window.alert(j.I18n.t("ra_Ok"));a!=null&&a.saveConfig&&this.props.onChange(null,null,null,!0)}}).catch(a=>{this.props.schema.error&&this.props.schema.error[a.toString()]?this.setState({_error:this.getText(this.props.schema.error[a.toString()])}):this.setState({_error:j.I18n.t(a.toString())||j.I18n.t("ra_Error")})}).then(()=>{this.props.oContext.onCommandRunning(!1),this.setState({running:!1})})}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const i=this.state.confirmData||this.props.schema.confirm;let n=null;return i.type==="warning"?n=M.createElement(Z.Warning,null):i.type==="error"?n=M.createElement(Z.Error,null):i.type==="info"&&(n=M.createElement(Z.Info,null)),M.createElement(j.DialogConfirm,{title:this.getText(i.title)||j.I18n.t("ra_Please confirm"),text:this.getText(i.text),ok:this.getText(i.ok)||j.I18n.t("ra_Ok"),cancel:this.getText(i.cancel)||j.I18n.t("ra_Cancel"),icon:n||void 0,onClose:u=>this.setState({confirmDialog:!1},()=>u&&this._onClick())})}renderItem(i,n){const u=this.getIcon();return M.createElement("div",{style:Ti.fullWidth},M.createElement(N.Button,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:{...Ti.fullWidth,...this.props.schema.controlStyle||void 0},disabled:n||!this.props.alive,startIcon:u,title:this.props.alive?this.getText(this.props.schema.title)||"":j.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?M.createElement(N.CircularProgress,{size:20,style:{marginRight:8}}):null,this.getText(this.props.schema.label,this.props.schema.noTranslation)),this.renderErrorDialog(),this.renderMessageDialog())}}const ki={fullWidth:{width:"100%"},icon:{width:24,height:24,marginRight:4}};class Xa extends K{async _onClick(){var u,v;let i=this.props.schema.val;if(typeof i=="string"&&i.includes("${")){i=this.getPattern(i,null,!0);const a=await this.props.oContext.socket.getObject(this.props.schema.id);((u=a==null?void 0:a.common)==null?void 0:u.type)==="number"?i=parseFloat(i):((v=a==null?void 0:a.common)==null?void 0:v.type)==="boolean"&&(i=i==="true"||i===!0||i==="1"||i===1)}const n=(this.props.schema.id||"").replace(/%INSTANCE%/g,(this.props.oContext.instance||0).toString());try{await this.props.oContext.socket.setState(n,{val:i,ack:!!this.props.schema.ack}),this.props.schema.okText&&window.alert(this.getText(this.props.schema.okText))}catch(a){this.props.schema.error&&this.props.schema.error[a.toString()]?window.alert(this.getText(this.props.schema.error[a.toString()])):window.alert(j.I18n.t(a.toString())||j.I18n.t("ra_Error"))}}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const i=this.state.confirmData||this.props.schema.confirm;let n=null;return i.type==="warning"?n=M.createElement(Z.Warning,null):i.type==="error"?n=M.createElement(Z.Error,null):i.type==="info"&&(n=M.createElement(Z.Info,null)),M.createElement(j.DialogConfirm,{title:this.getText(i.title)||j.I18n.t("ra_Please confirm"),text:this.getText(i.text),ok:this.getText(i.ok)||j.I18n.t("ra_Ok"),cancel:this.getText(i.cancel)||j.I18n.t("ra_Cancel"),icon:n,onClose:u=>this.setState({confirmDialog:!1},()=>u&&this._onClick())})}renderItem(i,n){return M.createElement(N.Button,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:ki.fullWidth,disabled:n,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0}):await this._onClick()}},this.props.schema.icon?M.createElement(j.Icon,{src:this.props.schema.icon,style:ki.icon}):null,this.getText(this.props.schema.label,this.props.schema.noTranslation))}}const Mi={fullWidth:{width:"100%"},slider:{marginLeft:10,marginRight:10,width:"calc(100% - 20px)"}};class Za extends K{componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr);this.setState({_value:i})}static getDerivedStateFromProps(i,n){if(i.schema.min!==void 0&&i.schema.min<0||i.schema.max!==void 0&&i.schema.max<0)return null;const u=K.getValue(i.data,i.attr);return u==null||u.toString()!==parseFloat(n._value).toString()?{_value:u}:null}renderItem(i,n){const u=this.props.schema.min||0,v=this.props.schema.max||100,a=this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):"",h=[{value:u,label:u+a},{value:v,label:v+a}];return M.createElement(N.Box,{style:Mi.fullWidth},this.props.schema.label?M.createElement(N.Typography,{gutterBottom:!0},this.getText(this.props.schema.label)):null,M.createElement(N.Slider,{style:Mi.slider,value:this.state._value,getAriaValueText:d=>d+a,step:this.props.schema.step||(v-u)/100,valueLabelDisplay:"auto",marks:h,min:u,max:v,disabled:!!n,onChange:d=>{const o=d.target.value;this.setState({_value:o},()=>this.onChange(this.props.attr,o))}}),this.props.schema.help?M.createElement(N.Typography,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}function ht(L,i){return L==="edit"||L==="rename"?M.createElement(Z.Edit,{style:i}):L==="delete"?M.createElement(Z.Delete,{style:i}):L==="refresh"?M.createElement(Z.Refresh,{style:i}):L==="newDevice"||L==="new"||L==="add"?M.createElement(Z.Add,{style:i}):L==="discover"||L==="search"?M.createElement(Z.Search,{style:i}):L==="unpairDevice"||L==="unpair"?M.createElement(Z.LinkOff,{style:i}):L==="pairDevice"||L==="pair"?M.createElement(Z.Link,{style:i}):L==="identify"?M.createElement(Z.NotListedLocation,{style:i}):L==="play"?M.createElement(Z.PlayArrow,{style:i}):L==="stop"?M.createElement(Z.Stop,{style:i}):L==="pause"?M.createElement(Z.Pause,{style:i}):L==="forward"||L==="next"?M.createElement(Z.FastForward,{style:i}):L==="rewind"||L==="previous"?M.createElement(Z.FastRewind,{style:i}):L==="lamp"||L==="light"?M.createElement(Z.Lightbulb,{style:i}):L==="backlight"?M.createElement(Z.Fluorescent,{style:i}):L==="dimmer"?M.createElement(Z.WbIncandescent,{style:i}):L==="socket"?M.createElement(Z.Power,{style:i}):L==="settings"?M.createElement(Z.Settings,{style:i}):L==="users"||L==="group"?M.createElement(Z.Group,{style:i}):L==="user"?M.createElement(Z.Person,{style:i}):L==="qrcode"?M.createElement(Z.QrCode,{style:i}):L==="connection"?M.createElement(Z.Wifi,{style:i}):L==="no-connection"?M.createElement(Z.WifiOff,{style:i}):L==="visible"?M.createElement(Z.Visibility,{style:i}):null}function qa(L,i){return typeof i=="string"?{"@keyframes newStateAnimationOnceColor":{"0%":{color:i},"100%":{color:L.palette.mode==="dark"?"#fff":"#000"}},animation:"newStateAnimationOnceColor 2s ease-in-out"}:{"@keyframes newStateAnimationOnce":{"0%":{color:"#00f900"},"80%":{color:L.palette.mode==="dark"?"#518851":"#008000"},"100%":{color:L.palette.mode==="dark"?"#fff":"#000"}},animation:"newStateAnimationOnce 2s ease-in-out"}}class el extends K{controlTimeout=null;delayedUpdate={timer:null,value:null};getObjectID(){let i=this.props.schema.oid;return i.includes("${")&&(i=this.getPattern(i,null,!0)),this.props.schema.foreign?i:`${this.props.schema.system?"system.adapter.":""}${this.props.oContext.adapterName}.${this.props.oContext.instance||0}.${i}`}async componentDidMount(){super.componentDidMount();const i=await this.props.oContext.socket.getObject(this.getObjectID()),n=this.props.schema.control||this.detectType(i);try{const u=await this.props.oContext.socket.getState(this.getObjectID());this.setState({stateValue:u?u.val:null,controlType:n,obj:i},async()=>{await this.props.oContext.socket.subscribeState(this.getObjectID(),this.onStateChanged)})}catch(u){console.error(`Cannot get state ${this.getObjectID()}: ${u}`),this.setState({controlType:n,obj:i})}}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(i=>console.error(`Cannot control value: ${i.toString()}`)))}onStateChanged=(i,n)=>{let u=n?n.val:null;this.state.controlType==="button"||this.state.controlType==="switch"?(u=!!u,this.state.stateValue!==u&&this.setState({stateValue:u})):u!==null&&(this.state.controlType==="slider"||this.state.controlType==="number")?(u=parseFloat(u),console.log(`${Date.now()} Received new value: ${u}`),u!==this.state.stateValue?(this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null),this.delayedUpdate.value=u,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()!==u.toString()&&this.setState({stateValue:u})};detectType(i){if(i=i||{},i.common=i.common||{},i.common.type==="boolean"){if(this.props.schema.controlled!==!1){if(i.common.read===!1||this.props.schema.controlled===!0)return"button";if(i.common.write||this.props.schema.controlled===!0)return"switch"}return"text"}return i.common.type==="number"&&this.props.schema.controlled!==!1?i.common.write||this.props.schema.controlled===!0?i.common.max!==void 0?"slider":"input":"text":i.common.write&&this.props.schema.controlled!==!1?"input":"text"}renderItem(i,n){var v,a,h,d,o;if(!this.state.obj)return null;let u;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||(v=this.state.obj.common.role)!=null&&v.includes("button"))){let p=null;this.props.schema.falseImage&&(p=ht(this.props.schema.falseImage));const e=this.getText(this.props.schema.falseText||this.props.schema.label,this.props.schema.noTranslation);!e&&p?u=M.createElement(N.IconButton,{style:this.props.schema.falseTextStyle,disabled:!!this.props.schema.readOnly,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async t=>{t&&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)}},p):u=M.createElement(N.Button,{variant:this.props.schema.variant||"contained",startIcon:p,style:this.props.schema.falseTextStyle,disabled:n||!!this.props.schema.readOnly,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async t=>{t&&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)}},e||this.getObjectID().split(".").pop())}else if(this.state.controlType==="input"||!this.state.controlType&&this.state.obj.common.write&&this.state.obj.common.type==="string")u=M.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",gap:8,alignItems:"baseline"}},M.createElement(N.TextField,{style:{flex:1},value:this.state.stateValue,variant:"standard",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:p=>{this.props.schema.setOnEnterKey&&p.key==="Enter"&&this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!1)},onChange:p=>{this.setState({stateValue:p.target.value},()=>{this.props.schema.setOnEnterKey||this.props.schema.showEnterButton||(this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{this.controlTimeout=null,await this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!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&&M.createElement(N.Button,{variant:"outlined",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 p;this.props.schema.size==="normal"?p=16:this.props.schema.size==="large"?p=20:typeof this.props.schema.size=="number"&&(p=this.props.schema.size);let e=this.getText(this.props.schema.label,this.props.schema.noTranslation);const t={display:"flex",alignItems:"center",fontSize:p||"1rem",gap:8};this.props.schema.narrow||(t.width="100%",t.justifyContent="space-between"),e.trim()&&!e.trim().endsWith(":")&&this.props.schema.addColon&&(e=`${e.trim()}:`);let r;this.props.schema.blinkOnUpdate&&(r=qa(this.props.oContext.theme,this.props.schema.blinkOnUpdate));let l;this.props.schema.labelIcon&&(l=M.createElement(j.Icon,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let s;if(e&&l?s=M.createElement("div",{style:{whiteSpace:"nowrap"}},l,e):e?s=M.createElement("div",{style:{whiteSpace:"nowrap"}},e):l&&(s=l),this.state.controlType==="switch"||!this.state.controlType&&this.state.obj.common.type==="boolean"&&(this.state.obj.common.write&&this.state.obj.common.read!==!1||(a=this.state.obj.common.role)!=null&&a.includes("switch"))){let c=null;const f=this.getText(this.props.schema.falseText,this.props.schema.noTranslation);this.props.schema.falseImage&&(c=ht(this.props.schema.falseImage,f?{marginLeft:8}:void 0));let m=null;const y=this.getText(this.props.schema.trueText,this.props.schema.noTranslation);this.props.schema.trueImage&&(m=ht(this.props.schema.trueImage,y?{marginRight:8}:void 0)),u=M.createElement(N.Switch,{checked:!!this.state.stateValue,disabled:!!this.props.schema.readOnly,onChange:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async D=>{D&&await this.props.oContext.socket.setState(this.getObjectID(),!this.state.stateValue,!1)}}):await this.props.oContext.socket.setState(this.getObjectID(),!this.state.stateValue,!1)}}),(f||c||y||m)&&(u=M.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:14}},M.createElement("span",{style:this.props.schema.falseTextStyle},f,c),u,M.createElement("span",{style:this.props.schema.trueTextStyle},m,y))),s&&(u=M.createElement("div",{style:t},s,u))}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==="%")||(h=this.state.obj.common.role)!=null&&h.includes("slider")||(d=this.state.obj.common.role)!=null&&d.includes("dimmer")||(o=this.state.obj.common.role)!=null&&o.includes("blind"))){let c=null;const f=this.getText(this.props.schema.falseText,this.props.schema.noTranslation);this.props.schema.falseImage&&(c=ht(this.props.schema.falseImage,f?{marginLeft:8}:void 0));let m=null;const y=this.getText(this.props.schema.trueText,this.props.schema.noTranslation);this.props.schema.trueImage&&(m=ht(this.props.schema.trueImage,y?{marginRight:8}:void 0));const D=this.props.schema.min===void 0?this.state.obj.common.min||0:this.props.schema.min,E=this.props.schema.max===void 0?this.state.obj.common.max===void 0?100:this.state.obj.common.max:this.props.schema.max,b=this.props.schema.step===void 0?this.state.obj.common.step||1:this.props.schema.step;u=M.createElement(N.Slider,{style:{width:"100%",flexGrow:1},min:D,max:E,disabled:!!this.props.schema.readOnly,step:b,value:this.state.stateValue,valueLabelDisplay:"auto",valueLabelFormat:g=>`${g}${this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||""}`,onChange:(g,S)=>{this.setState({stateValue:S},()=>{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)})}}),(f||c||y||m)&&(u=M.createElement("div",{style:{display:"flex",width:"100%",flexGrow:1,alignItems:"center"}},M.createElement("span",{style:{marginRight:16,...this.props.schema.falseTextStyle}},f,c),u,M.createElement("span",{style:{marginLeft:16,...this.props.schema.trueTextStyle}},m,y))),s&&(u=M.createElement("div",{style:t},s,u))}else if(this.state.obj.common.type==="number"&&this.state.obj.common.write){const c=this.props.schema.min===void 0?this.state.obj.common.min===void 0?void 0:this.state.obj.common.min:this.props.schema.min,f=this.props.schema.max===void 0?this.state.obj.common.max===void 0?void 0:this.state.obj.common.max:this.props.schema.max,m=this.props.schema.step===void 0?this.state.obj.common.step===void 0?void 0:this.state.obj.common.step:this.props.schema.step;u=M.createElement(N.TextField,{variant:"standard",style:{width:"100%"},value:this.state.stateValue,type:"number",slotProps:{htmlInput:{min:c,max:f,step:m,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:y=>{this.setState({stateValue:y.target.value},()=>{this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{this.controlTimeout=null;const D=parseFloat(this.state.stateValue);await this.props.oContext.socket.setState(this.getObjectID(),D,!1)},this.props.schema.controlDelay||0)})},label:this.getText(this.props.schema.label,this.props.schema.noTranslation),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}else if(this.state.obj.common.type==="boolean"){let c=null,f,m;this.state.stateValue?(f=this.getText(this.props.schema.trueText,this.props.schema.noTranslation),this.props.schema.trueImage&&(c=ht(this.props.schema.falseImage,f?{marginRight:8}:void 0)),m=this.props.schema.trueTextStyle):(f=this.getText(this.props.schema.falseText,this.props.schema.noTranslation),this.props.schema.falseImage&&(c=ht(this.props.schema.falseImage,f?{marginLeft:8}:void 0)),m=this.props.schema.falseTextStyle),m=Object.assign(t,m),u=M.createElement("div",{style:m},s,M.createElement(N.Box,{style:{display:"flex",alignItems:"center",gap:8},sx:r,key:this.props.schema.blinkOnUpdate?f:void 0},c,f||(this.state.stateValue?j.I18n.t("ra_true"):j.I18n.t("ra_false"))))}else{const c=this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit;let f,m;this.state.controlType==="html"?(m=(this.state.stateValue||"").toString(),f=M.createElement("span",{dangerouslySetInnerHTML:{__html:this.state.stateValue}})):this.state.stateValue===null?(f="null",m=f):this.state.stateValue===void 0?(f="undefined",m=f):(f=this.state.stateValue.toString(),m=f),u=M.createElement("div",{style:t},s,M.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:4}},M.createElement(N.Box,{sx:r,key:this.props.schema.blinkOnUpdate?m:void 0},f),c?M.createElement("span",{style:{opacity:.7,fontSize:"smaller"}},c):null))}}return u}}const Nn={fullWidth:L=>({width:"100%",backgroundColor:L.palette.mode==="dark"?"#FFF":"#000",borderStyle:"hidden"}),primary:L=>({backgroundColor:L.palette.primary.main}),secondary:L=>({backgroundColor:L.palette.secondary.main})};class tl extends K{renderItem(){return M.createElement(N.Box,{component:"hr",sx:j.Utils.getStyle(this.props.oContext.theme,Nn.fullWidth,this.props.schema.color==="primary"?Nn.primary:this.props.schema.color==="secondary"?Nn.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 nl={header:L=>({width:"100%",background:L.palette.primary.main,color:L.palette.primary.contrastText,padding:"4px !important",borderRadius:"3px",marginBlockEnd:0,marginBlockStart:0})};class il extends K{renderItem(){let i="h5";switch((this.props.schema.size||5).toString()){case"1":i="h1";break;case"2":i="h2";break;case"3":i="h3";break;case"4":i="h4";break;case"5":default:i="h5";break}return M.createElement(N.Box,{component:i,sx:nl.header},this.getText(this.props.schema.label||this.props.schema.text,this.props.schema.noTranslation))}}class rl extends K{renderItem(){let i=this.props.schema.src;return i&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith(`adapter/${this.props.oContext.adapterName}/`)&&!i.startsWith(`./adapter/${this.props.oContext.adapterName}/`)&&(i=`adapter/${this.props.oContext.adapterName}/${i}`),M.createElement("img",{src:i,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 Li(L,i,n){return typeof n=="string"?{"@keyframes newValueAnimationOnceColor":{"0%":{color:i?`${n} !important`:n},"100%":{color:L.palette.mode==="dark"?i?"#fff !important":"#fff":i?"#000 !important":"#000"}},animation:"newValueAnimationOnceColor 2s ease-in-out"}:{"@keyframes newValueAnimationOnce":{"0%":{color:i?"#00f900 !important":"#00f900"},"80%":{color:L.palette.mode==="dark"?i?"#518851 !important":"#518851":i?"#008000 !important":"#008000"},"100%":{color:L.palette.mode==="dark"?i?"#fff !important":"#fff":i?"#000 !important":"#000"}},animation:"newValueAnimationOnce 2s ease-in-out"}}function Ii(L,i){return typeof i=="string"?{"@keyframes blinkAnimationColor":{"0%":{color:i},"100%":{color:L.palette.mode==="dark"?"#fff":"#000"}},animation:"blinkAnimationColor 2s ease-in-out infinite"}:{"@keyframes blinkAnimation":{"0%":{color:"#00f900"},"80%":{color:L.palette.mode==="dark"?"#518851":"#008000"},"100%":{color:L.palette.mode==="dark"?"#fff":"#000"}},animation:"blinkAnimation 2s ease-in-out infinite"}}const Mt={label:{fontWeight:"bold",whiteSpace:"nowrap"},valueImage:{maxHeight:"100%"},valueAndUnit:{display:"flex",gap:4,alignItems:"baseline"},value:{},unit:{fontSize:"smaller",opacity:.7}};class sl extends K{renderItem(i){let n=this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation);this.props.schema.addColon&&typeof n=="string"&&!n.trim().endsWith(":")&&(n=`${n.trim()}:`),n&&(n.includes("<a ")||n.includes("<br")||n.includes("<b>")||n.includes("<i>"))&&(n=j.Utils.renderTextWithA(n));let u;this.props.schema.size==="normal"?u=16:this.props.schema.size==="large"?u=20:typeof this.props.schema.size=="number"&&(u=this.props.schema.size);const v={width:"100%",height:"100%",display:"flex",alignItems:"center",position:"relative",fontSize:u};this.props.schema.narrow?v.gap=8:v.justifyContent="space-between";let a,h;this.props.schema.data&&typeof this.props.schema.data=="object"&&this.props.schema.data.en?h=this.getText(this.props.schema.data):typeof this.props.schema.data=="object"||this.props.schema.data===void 0||this.props.schema.data===null?h=JSON.stringify(this.props.schema.data):typeof this.props.schema.data=="number"?(h=this.props.schema.data.toString(),this.props.oContext.isFloatComma&&(h=h.replace(".",","))):(!this.props.schema.booleanAsCheckbox||typeof this.props.schema.data!="boolean")&&(h=this.props.schema.data.toString());let d=!1;if(this.props.schema.booleanAsCheckbox&&typeof this.props.schema.data=="boolean")a=M.createElement(N.Checkbox,{checked:!!a,disabled:!0,size:this.props.schema.size==="small"?"small":this.props.schema.size==="large"?"large":void 0});else if(h.startsWith("data:image/"))a=M.createElement("div",{style:{...Mt.value,...Mt.valueImage,...this.props.schema.styleValue||void 0}},M.createElement(j.Icon,{src:h}));else{const t={...Mt.value,...this.props.schema.styleValue||void 0};this.props.schema.html?a=M.createElement("div",{style:t,dangerouslySetInnerHTML:{__html:h}}):Array.isArray(this.props.schema.data)?(d=!0,a=M.createElement("div",{style:t},this.props.schema.data.map((r,l)=>M.createElement("div",{key:l},typeof r=="object"||r===null||r===void 0?JSON.stringify(r):r)))):h.includes(`
1396
- `)?(d=!0,a=M.createElement("div",{style:t},j.Utils.renderTextWithA(h))):a=M.createElement("div",{style:t},h)}if(this.props.schema.blinkOnUpdate&&this.props.schema.blink){const t=Li(this.props.oContext.theme,!0,this.props.schema.blinkOnUpdate),r=Ii(this.props.oContext.theme,this.props.schema.blink);a=M.createElement(N.Box,{key:h,sx:{...t,...r}},a)}else if(this.props.schema.blinkOnUpdate){const t=Li(this.props.oContext.theme,!1,this.props.schema.blinkOnUpdate);a=M.createElement(N.Box,{key:h,sx:t},a)}else if(this.props.schema.blink){const t=Ii(this.props.oContext.theme,this.props.schema.blink);a=M.createElement(N.Box,{sx:t},a)}this.props.schema.unit&&(a=M.createElement("div",{style:Mt.valueAndUnit},a,M.createElement("div",{style:{...Mt.unit,...this.props.schema.styleUnit||void 0}},this.getText(this.props.schema.unit,this.props.schema.noTranslation))));let o;this.props.schema.labelIcon&&(o=M.createElement(j.Icon,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let p;this.props.schema.copyToClipboard&&(p=M.createElement(Z.ContentCopy,{className:"staticCopyButton",style:{position:"absolute",top:"calc(50% - 12px)",right:0,cursor:"pointer"},onClick:()=>{j.Utils.copyToClipboard(h),window.alert(j.I18n.t("ra_Copied"))}}));const e={"& .staticCopyButton":{display:"none"},"& .staticCopyButton:action":{transform:"scale(0.9)"},"&:hover .staticCopyButton":{display:"block"}};return this.props.schema.highlight&&(e["&:hover"]={backgroundColor:this.props.oContext.themeType==="dark"?"#51515180":"#b8b8b880"}),d&&(v.alignItems="top"),M.createElement(N.Box,{component:"div",style:v,sx:e},M.createElement("div",{style:{...Mt.label,...this.props.schema.styleLabel||void 0}},o,n),a,p)}}const Fi={fullWidth:{height:"100%",width:"100%"},link:L=>({textDecoration:"underline",color:L.palette.mode==="dark"?"#4dabf5":"#254e72",cursor:"pointer"})};function Ri(L,i,n){let u,v="";L?L.toString().startsWith("#")||L.toString().startsWith("/")?(u=i||"_self",v=L):L.startsWith("http://")||L.startsWith("https://")?(u=i||"_blank",v=L):(v=`#tab-instances/config/${n}/${L}`,u=i||"_self"):(v=`#tab-instances/config/${n}`,u=i||"_self"),u==="_self"?setTimeout(a=>{a.startsWith("#")?window.location.hash=a:a.startsWith("/")?v=`${window.location.protocol}:${window.location.host}${v}`:(a.startsWith("http://")||a.startsWith("https://"))&&(window.location.href=a)},100,v):(v.startsWith("#")?v=`${window.location.protocol}:${window.location.host}${window.location.pathname}${v}`:v.startsWith("/")&&(v=`${window.location.protocol}:${window.location.host}${v}`),window.open(v,u))}class Oi extends K{renderItem(i,n){if(this.props.schema.button){const v=this.getIcon();return M.createElement(N.Button,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:{...Fi.fullWidth,...this.props.schema.controlStyle||void 0},disabled:n,startIcon:v,onClick:this.props.schema.href?()=>{const a=this.props.schema.href?this.getText(this.props.schema.href,!0):null;a&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:"link",url:a,target:this.props.schema.target,close:this.props.schema.close}):Ri(a,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 u=this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation);return u&&(u.includes("<a ")||u.includes("<br")||u.includes("<b>")||u.includes("<i>"))&&(u=j.Utils.renderTextWithA(u)),M.createElement(N.Box,{component:"span",style:{...this.props.schema.controlStyle||void 0},sx:this.props.schema.href?Fi.link:void 0,onClick:this.props.schema.href?()=>{const v=this.props.schema.href?this.getText(this.props.schema.href,!0):null;v&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:"link",url:v,target:this.props.schema.target||"_blank",close:this.props.schema.close}):Ri(v,this.props.schema.target||"_blank",`${this.props.oContext.adapterName}.${this.props.oContext.instance}`))}:null},u)}}const Bn=1024*1024,fe={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"}};function ol(L,i,n){i=i||"key";const u=[];return Object.keys(L).forEach(v=>{const a={};a[i]=v,n?(a[n]=L[v],u.push(a)):u.push(Object.assign(a,L[v]))}),u}function Ni(L,i,n){i=i||"key";const u={};return L.forEach(v=>{let a=v[i];a==null&&(a=""),delete v[i],n?u[a]=v[n]:u[a]=v}),u}function al(L,i){let n="";for(let u=0;u<i.length;u++)n+=String.fromCharCode(L[u%L.length].charCodeAt(0)^i.charCodeAt(u));return n}function ll(L,i){let n="";for(let u=0;u<i.length;u++)n+=String.fromCharCode(L[u%L.length].charCodeAt(0)^i.charCodeAt(u));return n}class Ve extends K{filterRefs;typingTimer=null;resizeTimeout=null;secret="Zgfr56gFe87jJOM";refDiv;constructor(i){super(i),this.filterRefs={},this.props.schema.items=this.props.schema.items||[],this.props.schema.items.forEach(n=>{n.filter&&(this.filterRefs[n.attr]=pt.createRef())}),this.refDiv=M.createRef()}async componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr)||[];let n;if(this.props.schema.objKeyName?n=ol(i,this.props.schema.objKeyName,this.props.schema.objValueName):n=i,Array.isArray(n)||(n=[]),this.props.schema.encryptedAttributes){const u=await this.props.oContext.socket.getCompactSystemConfig();this.secret=(u==null?void 0:u.native.secret)||this.secret,i.forEach(v=>{this.props.schema.encryptedAttributes.forEach(a=>{v[a]&&(v[a]=ll(this.secret,v[a]))})})}this.setState({value:n,visibleValue:null,orderBy:"",order:"asc",iteration:0,filterOn:[],width:0},()=>this.validateUniqueProps())}componentWillUnmount(){this.typingTimer&&(clearTimeout(this.typingTimer),this.typingTimer=null),this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),super.componentWillUnmount()}itemTable(i,n,u){var d;const{schema:v}=this.props,a=(d=v.items)==null?void 0:d.find(o=>o.attr===i);if(!a)return null;const h={items:{[i]:a}};return M.createElement($t,{oContext:this.props.oContext,alive:this.props.alive,arrayIndex:u,changed:this.props.changed,common:this.props.common,expertMode:this.props.expertMode,custom:!0,data:n,globalData:this.props.data,index:u+this.state.iteration,onChange:(o,p)=>{const e=JSON.parse(JSON.stringify(this.state.value));e[u][o]=p,this.setState({value:e},()=>{this.validateUniqueProps(),this.onChangeWrapper(e,!0)})},onError:(o,p)=>this.onError(o,p),originalData:this.props.originalData,schema:h,table:!0,themeName:this.props.themeName})}validateUniqueProps(){if(this.props.schema.uniqueColumns)for(const i of this.props.schema.uniqueColumns){const n=[];this.state.value.find(v=>{const a=v[i];return n.includes(a)?(this.onError(i,"is not unique"),this.setState({errorMessage:j.I18n.t('Non-allowed duplicate entry "%s" in column "%s"',a,i)}),!0):(n.push(a),!1)})||(this.onError(i,null),this.setState({errorMessage:""}))}}static descendingComparator(i,n,u){return n[u]<i[u]?-1:n[u]>i[u]?1:0}static getComparator(i,n){return i==="desc"?(u,v)=>Ve.descendingComparator(u,v,n):(u,v)=>-Ve.descendingComparator(u,v,n)}static getFilterValue(i){var n,u,v;return(v=(u=(n=i==null?void 0:i.current)==null?void 0:n.children[0])==null?void 0:u.children[0])==null?void 0:v.value}static setFilterValue(i,n){return i.current.children[0].children[0].value=n}handleRequestSort=(i,n=!1)=>{const{order:u,orderBy:v}=this.state,h=n?u:v===i&&u==="asc"?"desc":"asc",d=this.stableSort(h,i);JSON.stringify(d)!==JSON.stringify(this.state.value)&&this.setState({value:d,order:h,orderBy:i,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,d))};stableSort=(i,n)=>{const{value:u}=this.state,v=Ve.getComparator(i,n),a=u.map((h,d)=>({el:h,index:d}));return a.sort((h,d)=>{const o=v(h.el,d.el);return o!==0?o:h.index-d.index}),a.map(h=>h.el)};renderShowHideFilter(i){return i.filter?M.createElement(N.IconButton,{title:j.I18n.t("ra_Show/hide filter input"),size:"small",onClick:()=>{const n=[...this.state.filterOn],u=this.state.filterOn.indexOf(i.attr);u===-1?n.push(i.attr):n.splice(u,1),this.setState({filterOn:n},()=>{u&&Ve.getFilterValue(this.filterRefs[i.attr])&&(Ve.setFilterValue(this.filterRefs[i.attr],""),this.applyFilter())})}},this.state.filterOn.includes(i.attr)?M.createElement(Z.FilterAltOff,null):M.createElement(Z.FilterAlt,null)):null}renderImportExportButtons(i){return M.createElement(M.Fragment,null,!i.noDelete&&i.import?M.createElement(N.Tooltip,{title:j.I18n.t("ra_Import data from %s file","CSV"),slotProps:{popper:{sx:fe.tooltip}}},M.createElement(N.IconButton,{size:"small",onClick:()=>this.setState({showImportDialog:!0})},M.createElement(Z.UploadFile,null))):null,i.export?M.createElement(N.Tooltip,{title:j.I18n.t("ra_Export data to %s file","CSV"),slotProps:{popper:{sx:fe.tooltip}}},M.createElement(N.IconButton,{size:"small",onClick:()=>this.onExport()},M.createElement(Z.Download,null))):null,M.createElement(N.IconButton,{disabled:!0,size:"small"},M.createElement(Z.Delete,null)))}renderAddButton(i){return M.createElement(N.Tooltip,{title:i?j.I18n.t("ra_Cannot add items with set filter"):j.I18n.t("ra_Add row"),slotProps:{popper:{sx:fe.tooltip}}},M.createElement("span",null,M.createElement(N.IconButton,{size:"small",color:"primary",disabled:!!i&&!this.props.schema.allowAddByFilter,onClick:this.onAdd},M.createElement(Z.Add,null))))}enhancedTableHead(i,n){var h;const{schema:u}=this.props,{order:v,orderBy:a}=this.state;return M.createElement(N.TableHead,null,M.createElement(N.TableRow,null,(h=u.items)==null?void 0:h.map((d,o)=>this.renderOneFilter({schema:u,style:{width:d.width},showAddButton:!o&&!u.noDelete,headCell:d,order:v,orderBy:a,index:o,doAnyFilterSet:n})),!u.noDelete&&M.createElement(N.TableCell,{style:{paddingLeft:20,paddingRight:20,width:i,textAlign:"right"},padding:"checkbox"},this.renderImportExportButtons(u))))}onDelete=i=>()=>{const n=JSON.parse(JSON.stringify(this.state.value));n.splice(i,1),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))};onExport(){const{schema:i}=this.props,{value:n}=this.state,v=[i.items.map(d=>d.attr).join(";")];n.forEach(d=>{const o=[];i.items.forEach(p=>{var e;(e=d[p.attr])!=null&&e.includes(";")?o.push(`"${d[p.attr]}"`):o.push(d[p.attr]===void 0||d[p.attr]===null?"":d[p.attr])}),v.push(o.join(";"))});const a=document.createElement("a");a.setAttribute("href",`data:text/csv;charset=utf-8,${encodeURIComponent(v.join(`
1397
- `))}`);const h=new Date;a.setAttribute("download",`${h.getFullYear()}_${(h.getMonth()+1).toString().padStart(2,"0")}_${h.getDate().toString().padStart(2,"0")}_${this.props.oContext.adapterName}.${this.props.oContext.instance}_${this.props.attr}.csv`),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)}onImport(i){var h;const n=i.split(`
1398
- `).map(d=>d.replace("\r","").trim()),{schema:u}=this.props,v=n.shift().split(";").filter(d=>d&&u.items.find(o=>o.attr===d)),a=[];n.forEach(d=>{const o=d.split(";"),p={};for(let e=0;e<o.length;e++){let t=o[e];if(t.startsWith('"')){for(t=t.substring(1);e<o.length&&!t.endsWith('"');)t+=`;${o[++e]}`;t=t.substring(0,t.length-1)}let r=t;if(t==="true")r=!0;else if(t==="false")r=!1;else if(window.isFinite(t)){const l=this.props.schema.items.find(s=>s.attr===v[e]);l&&l.type==="number"?r=parseFloat(t):r=t}else r=t;p[v[e]]=r}a.push(p)}),a.length?(h=this.state.value)!=null&&h.length?this.setState({showTypeOfImportDialog:a,showImportDialog:!1}):this.setState({value:a,showImportDialog:!1}):window.alert("ra_No data found in file")}onClone=i=>()=>{const n=JSON.parse(JSON.stringify(this.state.value)),u=JSON.parse(JSON.stringify(n[i]));if(typeof this.props.schema.clone=="string"&&typeof u[this.props.schema.clone]=="string"){let v=1,a=u[this.props.schema.clone];const h=a.match(/(\d+)$/);for(h?(a=a.replace(h[0],""),v=parseInt(h[0],10)+1):a+="_";n.find(d=>d[this.props.schema.clone]===a+v.toString());)v++;u[this.props.schema.clone]=`${u[this.props.schema.clone]}_${v}`}n.splice(i,0,u),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))};onChangeWrapper=(i,n)=>{this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout((u,v)=>{this.typingTimer=null;let a;if(this.props.schema.encryptedAttributes){const h=JSON.parse(JSON.stringify(u));if(h.forEach(d=>{this.props.schema.encryptedAttributes.forEach(o=>{d[o]&&(d[o]=al(this.secret,d[o]))})}),this.props.schema.objKeyName){const d=Ni(h,this.props.schema.objKeyName,this.props.schema.objValueName);a=this.onChange(this.props.attr,d)}else a=this.onChange(this.props.attr,h)}else if(this.props.schema.objKeyName){const h=Ni(JSON.parse(JSON.stringify(u)),this.props.schema.objKeyName,this.props.schema.objValueName);a=this.onChange(this.props.attr,h)}else a=this.onChange(this.props.attr,u);a instanceof Promise&&a.catch(h=>console.error(`Cannot save: ${h}`)),v&&(this.applyFilter(!1,u),this.handleRequestSort(this.state.orderBy,!0))},300,i,n)};onAdd=()=>{var v;const{schema:i}=this.props,n=JSON.parse(JSON.stringify(this.state.value)),u=(v=i.items)==null?void 0:v.reduce((a,h)=>{let d;return h.defaultFunc?this.props.custom?d=h.defaultFunc?this.executeCustom(h.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,n.length,this.props.data):this.props.schema.default:d=h.defaultFunc?this.execute(h.defaultFunc,this.props.schema.default,this.props.data,n.length,this.props.data):this.props.schema.default:d=h.default===void 0?null:h.default,a[h.attr]=d,a},{});n.push(u),this.setState({value:n},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))};isAnyFilterSet(){return!!Object.keys(this.filterRefs).find(i=>Ve.getFilterValue(this.filterRefs[i]))}applyFilter=(i,n,u)=>{n=n||this.state.value;let v=n.map((a,h)=>h);if(Object.keys(this.filterRefs).forEach(a=>{let h=Ve.getFilterValue(this.filterRefs[a]);!i&&h?(h=h.toLowerCase(),v=v.filter(d=>n[d]&&n[d][a]&&n[d][a].toLowerCase().includes(h))):this.filterRefs[a].current&&Ve.setFilterValue(this.filterRefs[a],"")}),v.length===n.length&&(v=null),v===null&&this.state.visibleValue===null){u&&u();return}JSON.stringify(v)!==JSON.stringify(this.state.visibleValue)?this.setState({visibleValue:v},()=>u&&u()):u&&u()};onMoveUp(i){const n=JSON.parse(JSON.stringify(this.state.value)),u=n[i];n.splice(i,1),n.splice(i-1,0,u),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))}onMoveDown(i){const n=JSON.parse(JSON.stringify(this.state.value)),u=n[i];n.splice(i,1),n.splice(i+1,0,u),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))}onDrop(i){const n=i[0],u=new FileReader;u.onabort=()=>console.log("file reading was aborted"),u.onerror=()=>console.log("file reading has failed"),u.onload=()=>{if(n.size>Bn){window.alert(j.I18n.t("ra_File is too big. Max %sk allowed. Try use SVG.",Math.round(Bn/1024)));return}const v=new Uint8Array(u.result).reduce((a,h)=>a+String.fromCharCode(h),"");this.onImport(v)},u.readAsArrayBuffer(n)}showTypeOfImportDialog(){return this.state.showTypeOfImportDialog?M.createElement(N.Dialog,{open:!0,onClose:()=>this.setState({showTypeOfImportDialog:!1}),maxWidth:"md"},M.createElement(N.DialogTitle,null,j.I18n.t("ra_Append or replace?")),M.createElement(N.DialogContent,null,j.I18n.t("ra_Append %s entries or replace existing?",this.state.showTypeOfImportDialog.length)),M.createElement(N.DialogActions,null,M.createElement(N.Button,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>{const i=JSON.parse(JSON.stringify(this.state.value));this.state.showTypeOfImportDialog.forEach(n=>i.push(n)),this.setState({value:i,iteration:this.state.iteration+1e4,showTypeOfImportDialog:!1},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(i)))}},j.I18n.t("ra_Append")),M.createElement(N.Button,{variant:"contained",color:"secondary",autoFocus:!0,onClick:()=>{const i=this.state.showTypeOfImportDialog;this.setState({value:i,iteration:this.state.iteration+1e4,showTypeOfImportDialog:!1},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(i)))}},j.I18n.t("ra_Replace")))):null}showImportDialog(){return this.state.showImportDialog?M.createElement(N.Dialog,{open:!0,onClose:()=>this.setState({showImportDialog:!1}),sx:{"& .MuiDialog-paper":{minHeight:500}},maxWidth:"md",fullWidth:!0},M.createElement(N.DialogTitle,null,j.I18n.t("ra_Import from %s","CSV")),M.createElement(N.DialogContent,null,M.createElement(Wi,{multiple:!1,accept:{"text/csv":[".csv"]},maxSize:Bn,onDragEnter:()=>this.setState({uploadFile:"dragging"}),onDragLeave:()=>this.setState({uploadFile:!0}),onDrop:(i,n)=>{this.setState({uploadFile:!1}),i.length?this.onDrop(i):window.alert(n&&n[0]&&n[0].errors&&n[0].errors[0]&&n[0].errors[0].message||j.I18n.t("ra_Cannot upload"))}},({getRootProps:i,getInputProps:n})=>M.createElement("div",{style:{...fe.uploadDiv,...this.state.uploadFile==="dragging"?fe.uploadDivDragging:void 0,...fe.dropZone,...this.state.icon?void 0:fe.dropZoneEmpty},...i()},M.createElement("input",{...n()}),M.createElement("div",{style:fe.uploadCenterDiv},M.createElement("div",{style:fe.uploadCenterTextAndIcon},M.createElement(Z.UploadFile,{style:fe.uploadCenterIcon}),M.createElement("div",{style:fe.uploadCenterText},this.state.uploadFile==="dragging"?j.I18n.t("ra_Drop file here"):j.I18n.t("ra_Place your files here or click here to open the browse dialog"))))))),M.createElement(N.DialogActions,null,M.createElement(N.Button,{variant:"contained",onClick:()=>this.setState({showImportDialog:!1}),color:"primary",startIcon:M.createElement(Z.Close,null)},j.I18n.t("Cancel")))):null}renderOneFilter(i){return M.createElement(N.TableCell,{key:`${i.headCell.attr}_${i.index}`,style:i.style,align:"left",sortDirection:i.orderBy===i.headCell.attr?i.order:!1},M.createElement("div",{style:{...fe.flex,...i.schema.showFirstAddOnTop?{flexDirection:"column"}:void 0}},i.showAddButton?this.renderAddButton(i.doAnyFilterSet):null,i.headCell.sort&&M.createElement(N.TableSortLabel,{active:!0,style:i.orderBy!==i.headCell.attr?fe.silver:void 0,direction:i.orderBy===i.headCell.attr?i.order:"asc",onClick:()=>this.handleRequestSort(i.headCell.attr)}),i.headCell.filter&&this.state.filterOn.includes(i.headCell.attr)?M.createElement(N.TextField,{variant:"standard",ref:this.filterRefs[i.headCell.attr],onChange:()=>this.applyFilter(),title:j.I18n.t("ra_You can filter entries by entering here some text"),slotProps:{input:{endAdornment:Ve.getFilterValue(this.filterRefs[i.headCell.attr])&&M.createElement(N.InputAdornment,{position:"end"},M.createElement(N.IconButton,{size:"small",tabIndex:-1,onClick:()=>{Ve.setFilterValue(this.filterRefs[i.headCell.attr],""),this.applyFilter()}},M.createElement(Z.Close,null)))}},fullWidth:!0,placeholder:this.getText(i.headCell.title)}):M.createElement("span",{style:fe.headerText},this.getText(i.headCell.title)),this.renderShowHideFilter(i.headCell)))}enhancedFilterCard(){var a;const{schema:i}=this.props,{order:n,orderBy:u}=this.state;let v;return this.props.schema.compact&&(v={paddingTop:1,paddingBottom:1}),M.createElement(N.Grid2,{size:{xs:i.xs||12,sm:i.sm||void 0,md:i.md||void 0,lg:i.lg||void 0,xl:i.xl||void 0}},M.createElement(N.Card,null,M.createElement(N.Paper,{style:fe.paper},M.createElement(N.Accordion,{style:fe.paper},M.createElement(N.AccordionSummary,{expandIcon:M.createElement(Z.ExpandMore,null)},M.createElement(N.Typography,null,j.I18n.t("ra_Filter and Data Actions"))),M.createElement(N.AccordionDetails,null,M.createElement(N.Table,null,M.createElement(N.TableBody,null,(a=i.items)==null?void 0:a.map((h,d)=>M.createElement(N.TableRow,{key:`${h.attr}_${d}`},this.renderOneFilter({schema:i,style:v,showAddButton:!1,headCell:h,order:n,orderBy:u,index:d,doAnyFilterSet:!1}))),M.createElement(N.TableRow,null,M.createElement(N.TableCell,{align:"left",style:v},M.createElement("span",{style:fe.headerText},j.I18n.t("ra_Actions"))),M.createElement(N.TableCell,{style:v},this.renderImportExportButtons(i))))))))))}enhancedBottomCard(){const{schema:i}=this.props;let n;this.props.schema.compact&&(n={paddingTop:1,paddingBottom:1});const u=this.isAnyFilterSet();return M.createElement(N.Grid2,{size:{xs:i.xs||12,sm:i.sm||void 0,md:i.md||void 0,lg:i.lg||void 0,xl:i.xl||void 0}},M.createElement(N.Card,null,M.createElement(N.Paper,{style:fe.paper},M.createElement(N.Table,null,M.createElement(N.TableBody,null,M.createElement(N.TableRow,null,M.createElement(N.TableCell,{colSpan:i.items.length+1,style:n},this.renderAddButton(u))))))))}renderCards(){const{schema:i}=this.props;let{visibleValue:n}=this.state,u;this.props.schema.compact&&(u={paddingTop:1,paddingBottom:1}),n=n||this.state.value.map((a,h)=>h);const v=this.isAnyFilterSet();return M.createElement(N.Grid2,{container:!0},this.showImportDialog(),this.showTypeOfImportDialog(),this.enhancedFilterCard(),n.map((a,h)=>{var d;return M.createElement(N.Grid2,{key:`${a}_${h}`,size:{xs:i.xs||12,sm:i.sm||void 0,md:i.md||void 0,lg:i.lg||void 0,xl:i.xl||void 0}},M.createElement(N.Card,null,M.createElement(N.Paper,{style:fe.paper},M.createElement(N.Table,null,M.createElement(N.TableBody,null,(d=i.items)==null?void 0:d.map(o=>M.createElement(N.TableRow,{key:`${o.attr}_${a}`},M.createElement(N.TableCell,{align:"left",style:u},M.createElement("span",{style:fe.headerText},this.getText(o.title))),M.createElement(N.TableCell,{align:"left",style:u},this.itemTable(o.attr,this.state.value[a],a)))),M.createElement(N.TableRow,null,M.createElement(N.TableCell,{align:"left",style:u},M.createElement("span",{style:fe.headerText},this.getText("Actions"))),M.createElement(N.TableCell,{align:"left",style:u},!v&&!this.state.orderBy?M.createElement(N.Tooltip,{title:j.I18n.t("ra_Move up"),slotProps:{popper:{sx:fe.tooltip}}},M.createElement("span",null,M.createElement(N.IconButton,{size:"small",onClick:()=>this.onMoveUp(a),disabled:h===0},M.createElement(Z.ArrowUpward,null)))):null,!v&&!this.state.orderBy?M.createElement(N.Tooltip,{title:j.I18n.t("ra_Move down"),slotProps:{popper:{sx:fe.tooltip}}},M.createElement("span",null,M.createElement(N.IconButton,{size:"small",onClick:()=>this.onMoveDown(a),disabled:h===n.length-1},M.createElement(Z.ArrowDownward,null)))):null,M.createElement(N.Tooltip,{title:j.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:fe.tooltip}}},M.createElement(N.IconButton,{size:"small",onClick:this.onDelete(a)},M.createElement(Z.Delete,null))),this.props.schema.clone?M.createElement(N.Tooltip,{title:j.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:fe.tooltip}}},M.createElement(N.IconButton,{size:"small",onClick:this.onClone(a)},M.createElement(Z.ContentCopy,null))):null)))))))}),this.enhancedBottomCard())}renderTable(){const{schema:i}=this.props;let{visibleValue:n}=this.state;n=n||this.state.value.map((a,h)=>h);const u=this.isAnyFilterSet();let v;return this.props.schema.compact&&(v={paddingTop:1,paddingBottom:1}),M.createElement(N.Paper,{style:fe.paper},this.showImportDialog(),this.showTypeOfImportDialog(),i.label?M.createElement("div",{style:fe.label},M.createElement(N.Toolbar,{variant:"dense",style:fe.rootTool},M.createElement(N.Typography,{style:fe.title,variant:"h6",id:"tableTitle",component:"div"},this.getText(i.label)))):null,M.createElement(N.TableContainer,null,M.createElement(N.Table,{style:fe.table,size:"small"},this.enhancedTableHead(!u&&!this.state.orderBy?120:64,u),M.createElement(N.TableBody,null,n.map((a,h)=>{var d;return M.createElement(N.TableRow,{hover:!0,key:`${a}_${h}`},(d=i.items)==null?void 0:d.map(o=>M.createElement(N.TableCell,{key:`${o.attr}_${a}`,align:"left",style:v},this.itemTable(o.attr,this.state.value[a],a))),!i.noDelete&&M.createElement(N.TableCell,{align:"left",style:{...v,...fe.buttonCell}},!u&&!this.state.orderBy?h?M.createElement(N.Tooltip,{title:j.I18n.t("ra_Move up"),slotProps:{popper:{sx:fe.tooltip}}},M.createElement(N.IconButton,{size:"small",onClick:()=>this.onMoveUp(a)},M.createElement(Z.ArrowUpward,null))):M.createElement("div",{style:fe.buttonEmpty}):null,!u&&!this.state.orderBy?h<n.length-1?M.createElement(N.Tooltip,{title:j.I18n.t("ra_Move down"),slotProps:{popper:{sx:fe.tooltip}}},M.createElement(N.IconButton,{size:"small",onClick:()=>this.onMoveDown(a)},M.createElement(Z.ArrowDownward,null))):M.createElement("div",{style:fe.buttonEmpty}):null,M.createElement(N.Tooltip,{title:j.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:fe.tooltip}}},M.createElement(N.IconButton,{size:"small",onClick:this.onDelete(a)},M.createElement(Z.Delete,null))),this.props.schema.clone?M.createElement(N.Tooltip,{title:j.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:fe.tooltip}}},M.createElement(N.IconButton,{size:"small",onClick:this.onClone(a)},M.createElement(Z.ContentCopy,null))):null))}),!i.noDelete&&n.length>=(i.showSecondAddAt||5)?M.createElement(N.TableRow,null,M.createElement(N.TableCell,{colSpan:i.items.length+1,style:{...v}},this.renderAddButton(u))):null)),!n.length&&this.state.value.length?M.createElement("div",{style:fe.filteredOut},M.createElement(N.Typography,{style:fe.title,variant:"h6",id:"tableTitle",component:"div"},j.I18n.t("ra_All items are filtered out"),M.createElement(N.IconButton,{size:"small",onClick:()=>this.applyFilter(!0)},M.createElement(Z.Close,null)))):null),i.help?M.createElement(N.FormHelperText,{style:{paddingLeft:16}},this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null,this.state.errorMessage?M.createElement("div",{style:{display:"flex",padding:"5px"}},M.createElement(Z.Warning,{color:"error"}),M.createElement("span",{style:{color:"red",alignSelf:"center"}},this.state.errorMessage)):null)}componentDidUpdate(){var i;(i=this.refDiv.current)!=null&&i.clientWidth&&this.refDiv.current.clientWidth!==this.state.width&&(this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{var n;this.resizeTimeout=null,this.setState({width:(n=this.refDiv.current)==null?void 0:n.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:i}=this.props;if(!this.state.value||!Array.isArray(this.state.value))return null;const n=this.getCurrentBreakpoint();let u;return n&&(i.useCardFor||["xs"]).includes(n)?u=this.renderCards():u=this.renderTable(),M.createElement("div",{ref:this.refDiv,style:{width:"100%"}},u)}}const ln={indeterminate:{opacity:.5},label:{width:"100%",fontSize:14,marginBottom:2},helper:{width:"100%",fontSize:12},error:{width:"100%",fontSize:12,color:"#FF0000"}};class ul extends K{updateTimeout=null;componentDidMount(){super.componentDidMount();let i=K.getValue(this.props.data,this.props.attr);if(Array.isArray(i)&&this.props.oContext.multiEdit){i=K.DIFFERENT_VALUE,this.setState({value:i,oldValue:i,jsonError:!1});return}this.setState({value:i,oldValue:i,jsonError:this.validateJson(i)})}validateJson(i){let n=!1;if(this.props.schema.validateJson&&(i||!this.props.schema.allowEmpty))try{JSON.parse(i)}catch(u){console.log("Error in JSON",u),n=!0}return n}static getDerivedStateFromProps(i,n){if(i.oContext.multiEdit&&n.value===K.DIFFERENT_VALUE)return{value:K.DIFFERENT_VALUE};let u=K.getValue(i.data,i.attr);return u!=null&&(u=u.toString()),u==null||u!==n.value&&u!==n.oldValue?{value:u}:null}renderItem(i,n){const u=Array.isArray(this.state.value)||this.state.value===K.DIFFERENT_VALUE;if(this.props.schema.time){let h="";return typeof this.state.value=="number"?this.state.value&&this.state.value<9466596e5?h=new Date(this.state.value*1e3).toLocaleString():h=new Date(this.state.value).toLocaleString():typeof this.state.value=="string"&&(h=new Date(this.state.value).toLocaleString()),M.createElement(N.TextField,{variant:"standard",fullWidth:!0,value:h,error:!!i||!!this.state.jsonError,disabled:!!n,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),u){const h=K.getValue(this.props.data,this.props.attr),d=(h==null?void 0:h.filter(o=>o||o===0).map(o=>({label:o.toString()||"",value:o})))||[];return d.unshift({label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),M.createElement(N.Autocomplete,{style:ln.indeterminate,fullWidth:!0,value:d[0],onChange:(o,p)=>{const e=p?p.value:"",t=this.onChange(this.props.attr,e,()=>{this.setState({value:e,oldValue:e,jsonError:this.validateJson(p)})});t instanceof Promise&&t.catch(r=>console.error(`Cannot set value: ${r}`))},options:d,getOptionLabel:o=>o.label,renderInput:o=>M.createElement(N.TextField,{variant:"standard",...o,error:!!i,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:!!n})})}let v,a;if((this.props.schema.readOnly||n)&&this.props.schema.copyToClipboard?(this.props.schema.minRows>1&&(a={position:"absolute",right:3,top:20,zIndex:1e3}),v=M.createElement(N.IconButton,{style:a,size:"small",onClick:()=>{j.Utils.copyToClipboard(this.state.value),window.alert(j.I18n.t("ra_Copied"))}},M.createElement(j.IconCopy,null))):!this.props.schema.readOnly&&!n&&this.state.value&&!this.props.schema.noClearButton&&(this.props.schema.minRows>1&&(a={position:"absolute",right:3,top:20,zIndex:1e3}),v=M.createElement(N.IconButton,{style:a,size:"small",tabIndex:-1,onClick:()=>this.setState({value:"",oldValue:this.state.value},()=>this.onChange(this.props.attr,""))},M.createElement(Z.Close,null)),this.props.schema.minRows<=1&&(v=M.createElement(N.InputAdornment,{position:"end"},v))),this.props.schema.minRows>1){const h=this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation);return M.createElement("div",{style:{width:"100%",position:"relative"}},this.props.schema.label?M.createElement("div",{style:ln.label},this.getText(this.props.schema.label)):null,M.createElement(N.TextareaAutosize,{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:!!n,readOnly:this.props.schema.readOnly||!1,onChange:d=>{const o=d.target.value;this.setState({value:o,oldValue:this.state.value,jsonError:this.validateJson(o)},()=>this.onChange(this.props.attr,o||""))},placeholder:this.getText(this.props.schema.placeholder)}),h||i||this.state.jsonError?M.createElement("div",{style:i?ln.error:ln.helper},i||(this.state.jsonError?j.I18n.t("ra_Invalid JSON"):h)):null)}return M.createElement(N.TextField,{variant:"standard",fullWidth:!0,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!i||!!this.state.jsonError,disabled:!!n,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:v}},onChange:h=>{const d=h.target.value;this.setState({value:d,oldValue:this.state.value,jsonError:this.validateJson(d)},()=>this.onChange(this.props.attr,d))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.state.jsonError?j.I18n.t("ra_Invalid JSON"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const hl={fullWidth:{width:"100%"}};class cl extends K{initialized=!1;localContext;askInstance(){if(this.props.alive){let i=this.props.schema.data;if(i===void 0&&this.props.schema.jsonData){const n=this.getPattern(this.props.schema.jsonData,null,!0);try{i=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${n}`)}}i===void 0&&(i=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",i).then(n=>{if(typeof n=="object"){const u=n;this.setState({text:u.text||"",style:u.style,icon:u.icon,iconStyle:u.iconStyle})}else typeof n=="string"&&this.setState({text:n||""})}).catch(n=>console.error(`Cannot send command: ${n}`))}}getLocalContext(){const i={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(n=>i[n]=K.getValue(this.props.data,n)),JSON.stringify(i)}renderItem(){if(this.props.alive){const n=this.getLocalContext();(n!==this.localContext||!this.initialized)&&(this.localContext=n,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}if(this.state.text===void 0)return null;let i=null;return this.state.icon&&(i=ht(this.state.icon,{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}),i||(i=M.createElement(j.Icon,{src:this.state.icon,style:{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}}))),this.props.schema.container==="text"?M.createElement(N.TextField,{variant:"standard",fullWidth:!0,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?M.createElement(N.IconButton,{size:"small",onClick:()=>{j.Utils.copyToClipboard(this.state.text),window.alert(j.I18n.t("ra_Copied"))}},M.createElement(j.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)}):M.createElement("div",{style:{...hl.fullWidth,...this.state.style||void 0}},i,this.props.schema.container==="html"?M.createElement("span",{dangerouslySetInnerHTML:{__html:this.state.text||""}}):this.state.text)}}class pl extends K{componentDidMount(){super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr);this.setState({value:i})}renderItem(i,n){const u=this.props.schema.returnFormat!=="HH:mm:ss",v=new Date(Date.parse(`Thu, 01 Jan 1970 ${this.state.value||"00:00:00"}`));return M.createElement(Hi.TimePicker,{sx:a=>({width:"100%",borderBottom:`1px solid ${a.palette.text.primary}`,"& fieldset":{display:"none"},"& input":{padding:`${a.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:!!n,value:v,onChange:a=>{let h;h=a instanceof Date?a.toTimeString().split(" ")[0]:a.toTimeString(),u&&(h=h.split(":").slice(0,2).join(":")),this.setState({value:h},()=>this.onChange(this.props.attr,this.state.value))},views:this.props.schema.views||["hours","minutes","seconds"],label:this.getText(this.props.schema.label)})}}function dl(L,i){let n;return i&&L.substring(0,i.length)===i?n=L.substring(i.length+1):n=L,n=n.replace(/\./g,"/").replace(/_/g," "),n}class fl extends K{componentDidMount(){var n;super.componentDidMount();const i=K.getValue(this.props.data,this.props.attr);if(!i&&((n=this.props.customObj)!=null&&n._id)){const u=dl(this.props.customObj._id,`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);this.setState({value:u})}else this.setState({value:i||""})}renderItem(i,n){return M.createElement(N.TextField,{variant:"standard",fullWidth:!0,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},value:this.state.value,error:!!i,disabled:n,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:u=>{const v=u.target.value;this.setState({value:v},()=>this.onChange(this.props.attr,v))}})}}class gl extends K{async componentDidMount(){var n;super.componentDidMount();const i=await this.props.oContext.socket.getObject("system.meta.uuid");this.setState({uuid:((n=i==null?void 0:i.native)==null?void 0:n.uuid)||"unknown"})}renderItem(i,n){return M.createElement(N.TextField,{variant:"standard",fullWidth:!0,error:!!i,disabled:!!n,slotProps:{htmlInput:{readOnly:!0},input:{endAdornment:M.createElement(N.IconButton,{onClick:()=>{j.Utils.copyToClipboard(this.state.uuid),window.alert(j.I18n.t("ra_Copied %s",this.state.uuid))}},M.createElement(Z.ContentCopy,null))}},value:this.state.uuid||"",label:this.getText(this.props.schema.label)||j.I18n.t("ra_Serial number (UUID)"),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const Bi={icon:{width:16,height:16,marginRight:8}};class ml extends K{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getUsers().then(i=>{const n={},u=j.I18n.getLanguage();this.props.schema.short?i.forEach(v=>{var a,h;return n[v._id]={color:(a=v.common)==null?void 0:a.color,icon:(h=v.common)==null?void 0:h.icon,name:j.Utils.getObjectNameFromObj(v,u)}}):i.forEach(v=>{var a,h;return n[v._id.replace(/^system\.user\./,"")]={color:(a=v.common)==null?void 0:a.color,icon:(h=v.common)==null?void 0:h.icon,name:j.Utils.getObjectNameFromObj(v,u)}}),this.setState({users:n})}).catch(i=>console.error(`Cannot get users: ${i}`))}renderItem(i,n){var v,a;const u=K.getValue(this.props.data,this.props.attr);return M.createElement(N.FormControl,{variant:"standard",fullWidth:!0},this.state.users&&this.props.schema.label?M.createElement(N.InputLabel,null,this.getText(this.props.schema.label)):null,this.state.users?M.createElement(N.Select,{variant:"standard",error:!!i,disabled:!!n,value:u,renderValue:h=>{var d,o,p;return M.createElement("span",null,this.state.users&&((d=this.state.users[h])!=null&&d.icon)?M.createElement(j.Icon,{src:this.state.users&&((o=this.state.users[h])==null?void 0:o.icon),style:Bi.icon}):null,this.state.users&&((p=this.state.users[h])==null?void 0:p.name)||h||"")},style:{color:this.state.users&&((v=this.state.users[u])==null?void 0:v.color)||void 0,backgroundColor:j.Utils.getInvertedColor(this.state.users&&((a=this.state.users[u])==null?void 0:a.color),this.props.oContext.themeType)},onChange:h=>this.onChange(this.props.attr,h.target.value)},this.state.users&&Object.keys(this.state.users).map(h=>M.createElement(N.MenuItem,{style:{color:this.state.users[h].color||void 0,backgroundColor:j.Utils.getInvertedColor(this.state.users[h].color,this.props.oContext.themeType)},key:h,value:h},this.state.users[h].icon?M.createElement(j.Icon,{src:this.state.users[h].icon,style:Bi.icon}):null,this.state.users[h].name))):M.createElement(N.TextField,{variant:"standard",error:!!i,disabled:!!n,value:u,onChange:h=>this.onChange(this.props.attr,h.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?M.createElement(N.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class vl extends K{async componentDidMount(){super.componentDidMount();const i=await os(()=>import("./index-CttBOMyq.js").then(n=>n.i),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url);this.setState({QRCode:i.default})}renderItem(){const i=this.state.QRCode;return i?M.createElement(i,{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}):null}}const yl={accordion:Ts,alive:_s,autocomplete:ks,autocompleteSendTo:Ms,certCollection:Rs,certificate:Is,certificates:Fs,checkbox:Os,checkLicense:ct,chip:fi,chips:fi,color:Hs,coordinates:zs,cron:Ls,custom:Ut,datePicker:js,deviceManager:Vs,divider:tl,file:to,fileSelector:mn,func:no,header:il,image:so,imageSendTo:ro,instance:oo,interface:ao,ip:io,jsonEditor:Ra,language:Na,license:Ba,number:Pa,objectId:Wa,password:Ha,pattern:za,port:Va,qrCode:vl,room:Ua,select:Ka,selectSendTo:Ya,sendto:_i,sendTo:_i,setState:Xa,slider:Za,state:el,staticImage:rl,staticInfo:sl,staticLink:Oi,staticText:Oi,table:Ve,text:ul,textSendTo:cl,timePicker:pl,topic:fl,uuid:gl,user:ml},Qe={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:L=>({backgroundColor:L.palette.primary.main,color:L.palette.mode==="dark"?"inherit":"#FFF"}),secondary:L=>({backgroundColor:L.palette.secondary.main})};class $t extends K{componentDidMount(){var i;super.componentDidMount(),(i=this.props.schema)!=null&&i.collapsable&&this.setState({expanded:(window._localStorage||window.localStorage).getItem(`${this.props.oContext.adapterName}.${this.props.attr}`)==="true"})}renderItems(i,n){return i?Object.keys(i).map(u=>{if(this.props.oContext.multiEdit&&i[u].noMultiEdit)return null;const v=i[u].type||"panel";let a,h="Use this.props.oContext.socket!";return v==="custom"?(i[u].url?a=Ut:this.props.oContext.customs&&this.props.oContext.customs[i[u].component]?a=this.props.oContext.customs[i[u].component]:(console.error(`Cannot find custom component: ${i[u].component}`),a=K),h=this.props.oContext.socket):v==="panel"?a=$t:a=yl[v]||K,M.createElement(a,{socket:h,globalData:this.props.globalData,oContext:this.props.oContext,key:`${u}_${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:Qe.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,onChange:this.props.onChange,disabled:n,customObj:this.props.customObj,custom:this.props.custom,schema:i[u],attr:u,table:this.props.table})}):null}render(){const i=this.props.schema;if(!i)return null;const{disabled:n,hidden:u}=this.calculate(i),v=this.props.schema.items,a=this.props.schema.style||{};if(u){if(i.hideOnlyControl){const d=M.createElement(N.Grid2,{size:{xs:i.xs||void 0,sm:i.sm||void 0,md:i.md||void 0,lg:i.lg||void 0,xl:i.xl||void 0},sx:j.Utils.getStyle(this.props.oContext.theme,{marginBottom:0,textAlign:"left"},a,this.props.oContext.themeType==="dark"&&i.darkStyle)});return i.newLine?M.createElement(M.Fragment,null,M.createElement("div",{style:{flexBasis:"100%",height:0}}),d):d}return null}if(this.props.table)return this.renderItems(v,n);if(this.props.custom)return M.createElement(N.Grid2,{key:`${this.props.attr}_${this.props.index}`,container:!0,style:Qe.fullWidth,columnSpacing:2,rowSpacing:1,sx:a},this.renderItems(v,n));let h;if(i.collapsable)h=M.createElement(N.Accordion,{key:`${this.props.attr}_${this.props.index}`,style:Qe.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})}},M.createElement(N.AccordionSummary,{expandIcon:M.createElement(Z.ExpandMore,null),sx:j.Utils.getStyle(this.props.oContext.theme,a,this.props.oContext.themeType&&i.darkStyle,i.color==="primary"?Qe.primary:i.color==="secondary"&&Qe.secondary,{width:"100%"})},M.createElement(N.Typography,{style:Qe.heading},this.getText(i.label))),M.createElement(N.AccordionDetails,null,M.createElement(N.Grid2,{container:!0,columnSpacing:2,rowSpacing:1,sx:{...a,width:"100%",padding:"10px"}},this.renderItems(v,n))));else{const d=j.Utils.getStyle(this.props.oContext.theme,this.props.style,a,{width:"100%"},this.props.isParentTab&&Qe.paper,this.props.isParentTab&&(this.props.withoutSaveButtons?this.props.withIcons?{height:"calc(100% - 88px) !important"}:{height:"calc(100% - 64px) !important"}:this.props.withIcons?Qe.paperWithIcons:Qe.paperWithoutIcons));h=M.createElement(N.Box,{component:"div",key:`${this.props.attr}_${this.props.index}`,className:this.props.className,sx:d},M.createElement(N.Grid2,{container:!0,columnSpacing:2,rowSpacing:1,sx:j.Utils.getStyle(this.props.oContext.theme,{width:"100%"},this.props.isParentTab&&Qe.padding,this.props.schema.innerStyle)},this.renderItems(v,n)))}if(!this.props.isParentTab){const d=M.createElement(N.Grid2,{title:this.getText(i.tooltip),size:{xs:i.xs||void 0,sm:i.sm||void 0,md:i.md||void 0,lg:i.lg||void 0,xl:i.xl||void 0},sx:{marginBottom:0,textAlign:"left",...a}},h);return i.newLine?M.createElement(M.Fragment,null,M.createElement("div",{style:{flexBasis:"100%",height:0}}),d):d}return h}}const un={tabs:{height:"100%",width:"100%"},panel:{width:"100%",display:"block"},panelWithIcons:{height:"calc(100% - 72px)"},panelWithoutIcons:{height:"calc(100% - 48px)"}};class bl extends K{resizeTimeout=null;refDiv;constructor(i){super(i);let n;if(this.props.root){const u=(window.location.hash||"").replace(/^#/,"").split("/");if(u.length>=3&&u[1]==="config"){const v=u[3],a=parseInt(v,10);v&&a.toString()===v?a>=0&&a<Object.keys(this.props.schema.items).length&&(n=Object.keys(this.props.schema.items)[a]):v&&Object.keys(this.props.schema.items).includes(v)&&(n=v),window.addEventListener("hashchange",this.onHashTabsChanged,!1)}}n===void 0&&(n=(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(n)||(n=Object.keys(this.props.schema.items)[0])),this.refDiv=M.createRef(),Object.assign(this.state,{tab:n,width:0,openMenu:null})}componentWillUnmount(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),window.removeEventListener("hashchange",this.onHashTabsChanged,!1),super.componentWillUnmount()}onHashTabsChanged=()=>{const i=(window.location.hash||"").replace(/^#/,"").split("/");if(i.length>3&&i[1]==="config"){const n=i[3],u=parseInt(n,10);let v;u.toString()===n?u>=0&&u<Object.keys(this.props.schema.items).length&&(v=Object.keys(this.props.schema.items)[u]):Object.keys(this.props.schema.items).includes(n)&&(v=n),v!==void 0&&v!==this.state.tab&&((window._localStorage||window.localStorage).setItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`,v),this.setState({tab:v}))}};getCurrentBreakpoint(){if(!this.state.width)return"md";if(!this.state.initialBreakpoint){let i;return this.state.width<600?i="xs":this.state.width<900?i="sm":this.state.width<1200?i="md":this.state.width<1536?i="lg":i="xl",setTimeout(()=>{this.setState({initialBreakpoint:i})},50),i}return this.state.initialBreakpoint}componentDidUpdate(){var i;!this.state.initialBreakpoint&&((i=this.refDiv.current)!=null&&i.clientWidth)&&this.refDiv.current.clientWidth!==this.state.width&&(this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{var n;this.resizeTimeout=null,this.setState({width:(n=this.refDiv.current)==null?void 0:n.clientWidth})},50))}onMenuChange(i){(window._localStorage||window.localStorage).setItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`,i),this.setState({tab:i},()=>{if(this.props.root){const n=(window.location.hash||"").split("/");n.length>=3&&n[1]==="config"&&(n[3]=this.state.tab,window.location.hash=n.join("/"))}})}render(){const i=this.props.schema.items;let n=!1;const u=[];Object.keys(i).map(h=>{let d;if(i[h].expertMode&&!this.props.expertMode)return;if(this.props.custom){if(this.executeCustom(i[h].hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData))return;d=this.executeCustom(i[h].disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData)}else{if(this.execute(i[h].hidden,!1,this.props.data,this.props.index,this.props.globalData))return;d=this.execute(i[h].disabled,!1,this.props.data,this.props.index,this.props.globalData)}const o=this.getIcon(i[h].icon);n=n||!!o,u.push({icon:o,disabled:d,label:this.getText(i[h].label),name:h})}),u.find(h=>h.name===this.state.tab)||setTimeout(()=>this.setState({tab:u[0].name}),50);const v=this.getCurrentBreakpoint();let a;return v==="xs"&&u.length>2?a=M.createElement(N.Toolbar,{style:{top:2,backgroundColor:this.props.oContext.themeType==="dark"?"#222":"#DDD"},variant:"dense"},M.createElement(N.IconButton,{onClick:h=>this.setState({openMenu:h.currentTarget})},M.createElement(Z.Menu,null)),this.state.openMenu?M.createElement(N.Menu,{open:!0,anchorEl:this.state.openMenu,onClose:()=>this.setState({openMenu:null})},u.map(h=>M.createElement(N.MenuItem,{disabled:h.disabled,key:h.name,onClick:()=>{this.setState({openMenu:null},()=>this.onMenuChange(h.name))},selected:h.name===this.state.tab},n?M.createElement(N.ListItemIcon,null,h.icon):null,h.label))):null):a=M.createElement(N.Tabs,{variant:"scrollable",scrollButtons:"auto",style:this.props.schema.tabsStyle,value:this.state.tab,onChange:(h,d)=>this.onMenuChange(d)},u.map(h=>M.createElement(N.Tab,{id:h.name,wrapped:!0,disabled:h.disabled,key:h.name,value:h.name,iconPosition:this.props.schema.iconPosition||"start",icon:h.icon,label:h.label}))),M.createElement("div",{style:un.tabs,ref:this.refDiv},a,M.createElement($t,{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:{...un.panel,...n?un.panelWithIcons:un.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.props.onError,customObj:this.props.customObj,custom:this.props.custom,schema:i[this.state.tab],table:this.props.table,withIcons:n}))}}const wl={root:{width:"100%",height:"100%"}};class cn extends pt.Component{forceUpdateHandlers;errorTimeout=null;errorCached=null;oContext;constructor(i){super(i),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(i,n){return i.updateData!==n.updateData?{updateData:i.updateData,originalData:JSON.stringify(i.data),schema:JSON.parse(JSON.stringify(i.schema))}:null}static async loadI18n(i,n,u){if(n===!0||n&&typeof n=="string"){const v=j.I18n.getLanguage(),a=typeof n=="string"?n:"i18n";let h=await i.fileExists(`${u}.admin`,`${a}/${v}.json`),d;if(h?d=`${a}/${v}.json`:(h=await i.fileExists(`${u}.admin`,`${a}/${v}/translations.json`),h?d=`${a}/${v}/translations.json`:v!=="en"&&(h=await i.fileExists(`${u}.admin`,`${a}/en.json`),h?d=`${a}/en.json`:(h=await i.fileExists(`${u}.admin`,`${a}/en/translations.json`),h&&(d=`${a}/en/translations.json`)))),d){const o=await i.readFile(`${u}.admin`,d);let p;o.file!==void 0?p=o.file:p=o;try{const e=JSON.parse(p);j.I18n.extendTranslations(e,v)}catch(e){return console.error(`Cannot parse language file "${u}.admin/${d}: ${e}`),""}return d}return console.warn(`Cannot find i18n for ${u} / ${d}`),""}return n&&typeof n=="object"&&j.I18n.extendTranslations(n),""}onCommandRunning=i=>this.setState({commandRunning:i});readData(){this.props.socket.getCompactSystemConfig().then(i=>this.props.socket.getState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`).then(n=>this.setState({systemConfig:i.common,alive:!!(n&&n.val)},()=>{this.updateContext(!0),this.props.custom||this.props.socket.subscribeState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,this.onAlive)}))).catch(i=>console.error(`Cannot read system config: ${i}`))}onAlive=(i,n)=>{!!(n!=null&&n.val)!==this.state.alive&&this.setState({alive:!!(n!=null&&n.val)})};onChange=(i,n,u,v)=>{if(this.props.onValueChange)this.props.onValueChange(i,n,v),u&&u();else if(i&&this.props.onChange){const a={changed:JSON.stringify(i)!==this.state.originalData};this.setState(a,()=>{this.props.onChange(i,a.changed,v),u&&u()})}else v&&this.props.onChange(null,null,v)};onError=(i,n)=>{this.errorCached=this.errorCached||JSON.parse(JSON.stringify(this.state.errors));const u=this.errorCached;n?u[i]=n:delete u[i],this.errorTimeout&&clearTimeout(this.errorTimeout),JSON.stringify(u)!==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(i,n){return n=n||{},i.items&&Object.keys(i.items).forEach(u=>{n[u]=i.items[u],this.flatten(i.items[u],n)}),n}buildDependencies(i){const n=this.flatten(i);Object.keys(n).forEach(u=>{var v,a,h,d,o,p,e,t,r,l;(v=n[u].confirm)!=null&&v.alsoDependsOn&&((a=n[u].confirm)==null||a.alsoDependsOn.forEach(s=>{if(!n[s])console.error(`[JsonConfigComponent] Attribute ${s} does not exist!`),s.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${s.replace(/^data\./,"")}" instead of "${s}"`);else{n[s].confirmDependsOn=n[s].confirmDependsOn||[];const c={...n[u],attr:u};c.confirm&&(c.confirm.cancel="Undo"),n[s].confirmDependsOn.push(c)}})),(h=n[u].onChange)!=null&&h.alsoDependsOn&&((d=n[u].onChange)==null||d.alsoDependsOn.forEach(s=>{if(!n[s])console.error(`[JsonConfigComponent] Attribute ${s} does not exist!`),s.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${s.replace(/^data\./,"")}" instead of "${s}"`);else{n[s].onChangeDependsOn=n[s].onChangeDependsOn||[];const c={...n[u],attr:u};n[s].onChangeDependsOn.push(c)}})),(o=n[u].hidden)!=null&&o.alsoDependsOn&&((p=n[u].hidden)==null||p.alsoDependsOn.forEach(s=>{if(!n[s])console.error(`[JsonConfigComponent] Attribute ${s} does not exist!`),s.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${s.replace(/^data\./,"")}" instead of "${s}"`);else{n[s].hiddenDependsOn=n[s].hiddenDependsOn||[];const c={...n[u],attr:u};n[s].hiddenDependsOn.push(c)}})),(e=n[u].label)!=null&&e.alsoDependsOn&&((t=n[u].label)==null||t.alsoDependsOn.forEach(s=>{if(!n[s])console.error(`[JsonConfigComponent] Attribute ${s} does not exist!`),s.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${s.replace(/^data\./,"")}" instead of "${s}"`);else{n[s].labelDependsOn=n[s].labelDependsOn||[];const c={...n[u],attr:u};n[s].labelDependsOn.push(c)}})),(r=n[u].help)!=null&&r.alsoDependsOn&&((l=n[u].help)==null||l.alsoDependsOn.forEach(s=>{if(!n[s])console.error(`[JsonConfigComponent] Attribute ${s} does not exist!`),s.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${s.replace(/^data\./,"")}" instead of "${s}"`);else{n[s].helpDependsOn=n[s].helpDependsOn||[];const c={...n[u],attr:u};n[s].helpDependsOn.push(c)}}))})}updateContext(i){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},i&&this.forceUpdate()}renderItem(i){return i.type==="tabs"?M.createElement(bl,{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:(n,u)=>this.onError(n,u),originalData:JSON.parse(this.state.originalData),root:!0,schema:i,expertMode:this.props.expertMode,themeName:this.props.themeName}):i.type==="panel"||!i.type?M.createElement($t,{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:(n,u)=>this.onError(n,u),originalData:JSON.parse(this.state.originalData),root:!0,schema:i,themeName:this.props.themeName}):(console.error(`Unknown item type in root: ${JSON.stringify(i)}`),null)}changeLanguage=()=>{this.forceUpdate()};forceAttrUpdate=(i,n)=>{Array.isArray(i)?i.forEach(u=>this.forceUpdateHandlers[u]&&this.forceUpdateHandlers[u](n)):this.forceUpdateHandlers[i]&&this.forceUpdateHandlers[i](n)};registerOnForceUpdate=(i,n)=>{n?this.forceUpdateHandlers[i]=n:this.forceUpdateHandlers[i]&&delete this.forceUpdateHandlers[i]};render(){return!this.state.systemConfig||!this.oContext?M.createElement(N.LinearProgress,null):(this.oContext._themeName!==this.props.themeName&&(this.oContext._themeName=this.props.themeName,setTimeout(()=>this.updateContext(!0),0)),M.createElement("div",{style:{...!this.props.embedded||this.props.withoutSaveButtons?wl.root:void 0,...this.props.style,...this.state.schema.style}},this.renderItem(this.state.schema)))}}const Et={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 Cl(L,i){let n="";for(let u=0;u<i.length;u++)n+=String.fromCharCode(L[u%L.length].charCodeAt(0)^i.charCodeAt(u));return n}function El(L,i){let n="";for(let u=0;u<i.length;u++)n+=String.fromCharCode(L[u%L.length].charCodeAt(0)^i.charCodeAt(u));return n}function Sl(L,i){if(typeof i!="string")return i;if(!i.startsWith("$/aes-192-cbc:")||!/^[0-9a-f]{48}$/.test(L))return Cl(L,i);const n=i.split(":",3),u=window.CryptoJS.enc.Hex.parse(L),v=window.CryptoJS.enc.Hex.parse(n[1]),a=window.CryptoJS.lib.CipherParams.create({ciphertext:window.CryptoJS.enc.Hex.parse(n[2])}),h=window.CryptoJS.AES.decrypt(a,u,{iv:v});return window.CryptoJS.enc.Utf8.stringify(h)}function Dl(L,i,n){if(typeof i!="string")return i;if(!/^[0-9a-f]{48}$/.test(L))return El(L,i);let u;u=window.CryptoJS.lib.WordArray.random(128/8);const v=window.CryptoJS.enc.Hex.parse(L),a=window.CryptoJS.AES.encrypt(i,v,{iv:u}).ciphertext;return`$/aes-192-cbc:${window.CryptoJS.enc.Hex.stringify(u)}:${a}`}function Pi(L,i){var n;return document.getElementById(i)?(n=document.getElementById(i))==null?void 0:n.onload:new Promise(u=>{const v=document.createElement("script");v.setAttribute("id",i),v.onload=u,v.src=L,document.getElementsByTagName("head")[0].appendChild(v)})}let Al=class extends j.Router{fileSubscribed=[];fileLangSubscribed="";secret;constructor(i){super(i),this.state={updateData:0,changed:!1,confirmDialog:!1,theme:j.Theme(i.themeName),saveConfigDialog:!1,hash:"_"},this.secret=i.secret||"",this.getInstanceObject().then(n=>this.getConfigFile().then(u=>cn.loadI18n(this.props.socket,u==null?void 0:u.i18n,this.props.adapterName).then(v=>{v&&(this.fileLangSubscribed||(this.fileLangSubscribed=v,this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,this.fileLangSubscribed,this.onFileChange))),n?this.setState({schema:u,data:n.native,common:n.common,hash:pi(JSON.stringify(u)).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=i=>{const n=i.target.files[0];if(n){const u=new FileReader;u.onload=v=>{if(!v.target)return;const a=v.target.result;try{const h=JSON.parse(a);this.setState({data:h,changed:JSON.stringify(h)!==JSON.stringify(this.state.originalData)})}catch{window.alert(j.I18n.t("[JsonConfig] Failed to parse JSON file"))}},u.readAsText(n)}else window.alert(j.I18n.t("[JsonConfig] Failed to open JSON File"))};getExportImportButtons(){return M.createElement("div",{style:Et.exportImportButtons},M.createElement(N.Tooltip,{title:this.props.t("Import settings from JSON file"),slotProps:{popper:{sx:Et.tooltip}}},M.createElement(N.Fab,{size:"small",sx:{"&.MuiFab-root":Et.button},onClick:()=>{const i=document.createElement("input");i.setAttribute("type","file"),i.setAttribute("id","files"),i.setAttribute("opacity",0),i.addEventListener("change",n=>this.handleFileSelect(n),!1),i.click()}},M.createElement(Z.Publish,null))),M.createElement(N.Tooltip,{title:this.props.t("Export setting to JSON file"),slotProps:{popper:{sx:Et.tooltip}}},M.createElement(N.Fab,{size:"small",sx:{"&.MuiFab-root":Et.button},onClick:()=>{this.state.data&&j.Utils.generateFile(`${this.props.adapterName}.${this.props.instance}.json`,this.state.data)}},M.createElement(Z.Publish,{style:{transform:"rotate(180deg)"}}))))}onFileChange=async(i,n,u)=>{var v;if(i===`${this.props.adapterName}.admin`&&u){if(n===this.fileLangSubscribed)try{await cn.loadI18n(this.props.socket,(v=this.state.schema)==null?void 0:v.i18n,this.props.adapterName),this.setState({hash:`${this.state.hash}1`})}catch{}else if(this.fileSubscribed.includes(n))try{const a=await this.getConfigFile(this.fileSubscribed[0]);this.setState({schema:a,hash:pi(JSON.stringify(a)).toString()})}catch{}}};async getInstanceObject(){var i;try{const n=await this.props.socket.getObject(`system.adapter.${this.props.adapterName}.${this.props.instance}`);if(Array.isArray(n.encryptedNative)){if(!this.secret){const u=await this.props.socket.getSystemConfig();await Pi("../../lib/js/crypto-js/crypto-js.js","crypto-js"),this.secret=u.native.secret}return(i=n.encryptedNative)==null||i.forEach(u=>{n.native[u]&&(n.native[u]=Sl(this.secret,n.native[u]))}),n}return n}catch(n){window.alert(`[JsonConfig] Cannot read instance object: ${n}`)}return null}renderDialogConfirm(){return this.state.confirmDialog?M.createElement(j.DialogConfirm,{title:j.I18n.t("ra_Please confirm"),text:j.I18n.t("ra_Some data are not stored. Discard?"),ok:j.I18n.t("ra_Discard"),cancel:j.I18n.t("ra_Cancel"),onClose:i=>this.setState({confirmDialog:!1},()=>i&&j.Router.doNavigate(null))}):null}async scanForInclude(i,n){if(typeof i["#include"]=="string"){const v=await this._getConfigFile(i["#include"],[...n]);return delete i["#include"],v&&(i={...i,...v}),i}const u=Object.keys(i);for(let v=0;v<u.length;v++)i[u[v]]&&typeof i[u[v]]=="object"&&(i[u[v]]=await this.scanForInclude(i[u[v]],n));return i}async getConfigFile(i){return this._getConfigFile(i)}async _getConfigFile(i,n){if(i=i||"jsonConfig.json5",n=n||[],n.includes(i))return window.alert(`[JsonConfig] Circular reference in file: ${i} => ${n.join(" => ")}`),null;n.push(i);try{await this.props.socket.fileExists(`${this.props.adapterName}.admin`,i)||(i="jsonConfig.json");const v=await this.props.socket.readFile(`${this.props.adapterName}.admin`,i);let a="",h="";if(v.file!==void 0&&(h=v.file),typeof h=="string")a=h;else if(h.type==="Buffer"){let d="";const o=new Uint8Array(h.data),p=o.byteLength;for(let e=0;e<p;e++)d+=String.fromCharCode(o[e]);a=d}this.fileSubscribed.includes(i)||(this.fileSubscribed.push(i),await this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,i,this.onFileChange));try{return await this.scanForInclude(Vi.parse(a),n)}catch(d){window.alert("[JsonConfig] Cannot parse json5 config!"),console.log(d)}}catch(u){this.state.schema||window.alert(`[JsonConfig] Cannot read file "${i}: ${u}`)}return null}renderSaveConfigDialog(){return this.state.saveConfigDialog?M.createElement(j.DialogConfirm,{title:j.I18n.t("ra_Please confirm"),text:j.I18n.t("Save configuration?"),ok:j.I18n.t("ra_Save"),cancel:j.I18n.t("ra_Cancel"),onClose:i=>this.setState({saveConfigDialog:!1},()=>i&&this.onSave(!0))}):null}findAttr(i,n){if(n=n||this.state.schema,n!=null&&n.items){if(i in n.items)return n.items[i];for(const u of Object.values(n.items)){const v=this.findAttr(i,u);if(v)return v}}return null}postProcessing(i,n,u){if(u=u||this.state.schema,!i){console.error(`Data is empty in postProcessing: ${n}, ${JSON.stringify(u)}`);return}const v=i[n];if(u.items)if(u.type==="table"){const a=v;if(!Array.isArray(a))return;for(const h of a)for(const d of u.items)this.postProcessing(h,d.attr,d)}else for(const[a,h]of Object.entries(u.items)){if(h.type==="panel"||h.type==="tabs"||h.type==="accordion")return;this.postProcessing(i,a,h)}else if(n&&typeof v=="string")if(u.type==="text")u.trim!==!1&&(i[n]=v.trim());else if(u.type==="ip")i[n]=v.trim();else if(u.type==="number"){const a=parseFloat(v.toString().replace(",","."));u.min!==void 0&&a<u.min?i[n]=u.min:u.max!==void 0&&a>u.max?i[n]=u.max:i[n]=a}else if(u.type==="port"){const a=parseInt(v.toString(),10);u.min!==void 0&&a<u.min?i[n]=u.min:u.max!==void 0&&a>u.max&&(i[n]=u.max),i[n]!==0&&a<20?i[n]=20:a>65535?i[n]=65535:i[n]=a}else u.type==="checkbox"&&(i[n]=i[n]===!0||i[n]==="true"||i[n]==="on"||i[n]===1||i[n]==="1")}async onSave(i,n){if(i){const u=await this.getInstanceObject();if(!u){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 v={};for(const h of Object.keys(this.state.data)){const d=this.findAttr(h);(!d||!d.doNotSave||d.type==="state")&&!h.startsWith("_")?K.setValue(u.native,h,this.state.data[h]):(K.setValue(u.native,h,null),v[h]=this.state.data[h])}try{const h=JSON.parse(JSON.stringify(u));if(Array.isArray(h.encryptedNative)){await Pi("../../lib/js/crypto-js/crypto-js.js","crypto-js");for(const d of h.encryptedNative)h.native[d]&&(h.native[d]=Dl(this.secret,h.native[d]))}await this.props.socket.setObject(h._id,h)}catch(h){window.alert(`[JsonConfig] Cannot set object: ${h}`)}const a={...u.native,...v};console.log(a),this.setState({changed:!1,data:a,updateData:this.state.updateData+1,originalData:a},()=>n&&j.Router.doNavigate(null))}else this.state.changed?this.setState({confirmDialog:!0}):j.Router.doNavigate(null)}componentDidUpdate(i,n){n.changed!==this.state.changed&&this.props.configStored(!this.state.changed)}async componentDidMount(){const i=`${window.location.protocol}//${window.location.host}${window.location.pathname}validate_config/${this.props.adapterName}`;console.log(`fetch ${i}`),await fetch(i)}render(){return!this.state.data||!this.state.schema?M.createElement(N.LinearProgress,null):M.createElement("div",{style:Et.root},this.renderDialogConfirm(),this.getExportImportButtons(),this.renderSaveConfigDialog(),M.createElement(cn,{key:this.state.hash,style:Et.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:i=>this.setState({error:i}),onChange:(i,n,u)=>{u&&this.state.error&&(window.alert(j.I18n.t("Cannot save configuration because of error in configuration")),u=!1),u&&!this.state.changed&&!n&&(u=!1),i?this.setState({data:i,changed:n,saveConfigDialog:u}):u!==void 0&&this.setState({saveConfigDialog:u})},DeviceManager:this.props.DeviceManager,theme:this.state.theme}),M.createElement(j.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:i=>this.onSave(!0,i),onClose:()=>this.onSave(!1)}))}};export{K as ConfigGeneric,$t as ConfigPanel,Al as JsonConfig,cn as JsonConfigComponent};