@castlabs/ui 6.0.3 → 7.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 (145) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/castlabs-logo-eggshell.svg +31 -162
  3. package/dist/assets/castlabs-logo.svg +31 -162
  4. package/dist/castlabs-ui-editor.css +1 -1
  5. package/dist/castlabs-ui-editor.umd.js +30 -30
  6. package/dist/castlabs-ui.common.js +5 -5
  7. package/dist/castlabs-ui.common.js.map +1 -1
  8. package/dist/castlabs-ui.core.js +28 -35
  9. package/dist/castlabs-ui.css +7 -7
  10. package/dist/castlabs-ui.module.js +28 -35
  11. package/dist/castlabs-ui.umd.js +13 -13
  12. package/dist/castlabs-ui.umd.js.map +1 -1
  13. package/package.json +18 -18
  14. package/src/assets/castlabs-logo-eggshell.svg +31 -162
  15. package/src/assets/castlabs-logo.svg +31 -162
  16. package/src/components/ClAlert/style.scss +46 -43
  17. package/src/components/ClBadge/style.scss +13 -15
  18. package/src/components/ClBadge/style.variables.scss +39 -33
  19. package/src/components/ClButton/style.scss +47 -249
  20. package/src/components/ClCard/style.scss +20 -20
  21. package/src/components/ClCard/style.variables.scss +121 -106
  22. package/src/components/ClDropdown/style.scss +47 -150
  23. package/src/components/ClDropzone/style.scss +4 -4
  24. package/src/components/ClFooter/style.scss +6 -105
  25. package/src/components/ClIconotron/style.scss +3 -8
  26. package/src/components/ClList/style.scss +10 -13
  27. package/src/components/ClList/style.variables.scss +27 -22
  28. package/src/components/ClPagination/style.scss +48 -85
  29. package/src/components/ClProgress/style.scss +8 -23
  30. package/src/components/ClSpinner/style.scss +1 -1
  31. package/src/components/ClTabs/style.scss +9 -9
  32. package/src/components/ClToggle/style.scss +18 -59
  33. package/src/components/ClTooltip/style.scss +9 -24
  34. package/src/components/ClWizard/style.scss +14 -12
  35. package/src/components/form/ClField/style.scss +4 -4
  36. package/src/components/form/ClFieldCheck/style.scss +25 -20
  37. package/src/components/form/ClFieldFile/style.scss +11 -13
  38. package/src/components/form/ClFieldGroup/style.scss +38 -4
  39. package/src/components/form/ClFieldInput/style.scss +15 -11
  40. package/src/components/form/ClFieldSelect/style.scss +6 -5
  41. package/src/components/form/ClFieldSet/style.scss +2 -2
  42. package/src/components/form/ClForm/style.scss +6 -8
  43. package/src/components/modal/ClModal/style.scss +50 -35
  44. package/src/components/navigation/ClNavSide/ClNavDrawer/style.scss +112 -180
  45. package/src/components/navigation/ClNavSide/ClNavSideMenu/style.scss +0 -23
  46. package/src/components/navigation/ClNavSide/style.scss +11 -17
  47. package/src/components/navigation/ClNavTop/style.scss +39 -35
  48. package/src/components/section/ClSectionForm/style.scss +6 -3
  49. package/src/components/section/ClSectionHeadline/style.scss +23 -25
  50. package/src/components/table/ClTable/style.variables.scss +18 -69
  51. package/src/components/table/ClTableCel/Actions/style.scss +1 -1
  52. package/src/components/table/ClTableCel/Audit/style.scss +2 -4
  53. package/src/components/table/ClTableCel/Boolean/style.scss +1 -1
  54. package/src/components/table/ClTableCel/Checkbox/style.scss +2 -2
  55. package/src/components/table/ClTableCel/Code/style.scss +1 -1
  56. package/src/components/table/ClTableCel/Currency/style.scss +1 -1
  57. package/src/components/table/ClTableCel/Date/style.scss +1 -1
  58. package/src/components/table/ClTableCel/ID/style.scss +2 -2
  59. package/src/components/table/ClTableCel/Links/style.scss +10 -11
  60. package/src/components/table/ClTableCel/style.variables.scss +3 -3
  61. package/src/components/text/ClCopy/style.scss +4 -21
  62. package/src/components/text/ClHashtag/style.scss +7 -25
  63. package/src/components/text/ClLinkExternal/style.scss +21 -19
  64. package/src/components/text/ClOrg/style.scss +1 -19
  65. package/src/components/text/ClPlan/style.scss +7 -25
  66. package/src/components/text/ClRole/style.scss +7 -25
  67. package/src/components/widget/ClCookieBanner/style.scss +5 -1
  68. package/src/fonts/DMMono/DMMono.scss +36 -0
  69. package/src/fonts/DMMono/DM_Mono_300.woff2 +0 -0
  70. package/src/fonts/DMMono/DM_Mono_300italic.woff2 +0 -0
  71. package/src/fonts/DMMono/DM_Mono_400.woff2 +0 -0
  72. package/src/fonts/DMMono/DM_Mono_400italic.woff2 +0 -0
  73. package/src/fonts/DMMono/DM_Mono_500.woff2 +0 -0
  74. package/src/fonts/DMMono/DM_Mono_500italic.woff2 +0 -0
  75. package/src/fonts/FontAwesome5/FontAwesome5.scss +2 -2
  76. package/src/fonts/NonNaturalGroteskInktrap/NonNaturalGroteskInktrap-Bold.woff2 +0 -0
  77. package/src/fonts/NonNaturalGroteskInktrap/NonNaturalGroteskInktrap-Medium.woff2 +0 -0
  78. package/src/fonts/NonNaturalGroteskInktrap/NonNaturalGroteskInktrap-Regular.woff2 +0 -0
  79. package/src/fonts/NonNaturalGroteskInktrap/NonNaturalGroteskInktrap.scss +21 -0
  80. package/src/styles/_global.scss +2 -0
  81. package/src/styles/abstracts/brand.scss +9 -0
  82. package/src/styles/abstracts/color.scss +243 -98
  83. package/src/styles/abstracts/spacing.scss +2 -2
  84. package/src/styles/abstracts/tools.scss +0 -82
  85. package/src/styles/assets/fontawesome.scss +2 -0
  86. package/src/styles/assets/fontawesome.variables.scss +88 -0
  87. package/src/styles/assets/logo.scss +12 -6
  88. package/src/styles/components/button.variables.scss +79 -6
  89. package/src/styles/components/form.variables.scss +15 -16
  90. package/src/styles/layout/app.scss +29 -0
  91. package/src/styles/layout/color.scss +115 -0
  92. package/src/styles/layout/grid.scss +2 -1
  93. package/src/styles/layout/helper.scss +14 -2
  94. package/src/styles/layout/section.scss +46 -47
  95. package/src/styles/layout/spacing.scss +4 -4
  96. package/src/styles/layout/typography.scss +91 -112
  97. package/src/styles/layout/typography.variables.scss +281 -168
  98. package/src/styles/ui.scss +4 -5
  99. package/src/styles/vendors/bootstrap.scss +1 -1
  100. package/dist/fonts/BngRUXNETWXI6LwhGYvaxZikqbCCwR26eg.9f9ebd6f.woff2 +0 -0
  101. package/dist/fonts/BngRUXNETWXI6LwhGYvaxZikqbCFwR26eg.d7aed4ec.woff2 +0 -0
  102. package/dist/fonts/BngRUXNETWXI6LwhGYvaxZikqbCGwR0.860d704d.woff2 +0 -0
  103. package/dist/fonts/BngRUXNETWXI6LwhGYvaxZikqbCIwR26eg.196096f5.woff2 +0 -0
  104. package/dist/fonts/BngRUXNETWXI6LwhGYvaxZikqbCJwR26eg.60896ebf.woff2 +0 -0
  105. package/dist/fonts/BngRUXNETWXI6LwhGYvaxZikqbCKwR26eg.c5d717bd.woff2 +0 -0
  106. package/dist/fonts/BngRUXNETWXI6LwhGYvaxZikqbCLwR26eg.e6581016.woff2 +0 -0
  107. package/dist/fonts/mem6YaGs126MiZpBA-UFUK0Udc1UAw.ed9c080e.woff2 +0 -0
  108. package/dist/fonts/mem6YaGs126MiZpBA-UFUK0Wdc1UAw.65f5554a.woff2 +0 -0
  109. package/dist/fonts/mem6YaGs126MiZpBA-UFUK0Xdc1UAw.ffa02f1c.woff2 +0 -0
  110. package/dist/fonts/mem6YaGs126MiZpBA-UFUK0Zdc0.157a9634.woff2 +0 -0
  111. package/dist/fonts/mem6YaGs126MiZpBA-UFUK0adc1UAw.ae9457b8.woff2 +0 -0
  112. package/dist/fonts/mem6YaGs126MiZpBA-UFUK0bdc1UAw.3c6000b1.woff2 +0 -0
  113. package/dist/fonts/mem6YaGs126MiZpBA-UFUK0ddc1UAw.1244aaff.woff2 +0 -0
  114. package/dist/fonts/mem8YaGs126MiZpBA-UFUZ0bbck.32149fc9.woff2 +0 -0
  115. package/dist/fonts/mem8YaGs126MiZpBA-UFV50bbck.16910b81.woff2 +0 -0
  116. package/dist/fonts/mem8YaGs126MiZpBA-UFVZ0b.16652597.woff2 +0 -0
  117. package/dist/fonts/mem8YaGs126MiZpBA-UFVp0bbck.e1ba37a1.woff2 +0 -0
  118. package/dist/fonts/mem8YaGs126MiZpBA-UFW50bbck.b50868a3.woff2 +0 -0
  119. package/dist/fonts/mem8YaGs126MiZpBA-UFWJ0bbck.1250c5ba.woff2 +0 -0
  120. package/dist/fonts/mem8YaGs126MiZpBA-UFWp0bbck.3ec09e79.woff2 +0 -0
  121. package/src/fonts/NotoSansMono/BngRUXNETWXI6LwhGYvaxZikqbCCwR26eg.woff2 +0 -0
  122. package/src/fonts/NotoSansMono/BngRUXNETWXI6LwhGYvaxZikqbCFwR26eg.woff2 +0 -0
  123. package/src/fonts/NotoSansMono/BngRUXNETWXI6LwhGYvaxZikqbCGwR0.woff2 +0 -0
  124. package/src/fonts/NotoSansMono/BngRUXNETWXI6LwhGYvaxZikqbCIwR26eg.woff2 +0 -0
  125. package/src/fonts/NotoSansMono/BngRUXNETWXI6LwhGYvaxZikqbCJwR26eg.woff2 +0 -0
  126. package/src/fonts/NotoSansMono/BngRUXNETWXI6LwhGYvaxZikqbCKwR26eg.woff2 +0 -0
  127. package/src/fonts/NotoSansMono/BngRUXNETWXI6LwhGYvaxZikqbCLwR26eg.woff2 +0 -0
  128. package/src/fonts/NotoSansMono/NotoSansMono.scss +0 -84
  129. package/src/fonts/OpenSansVariable/OpenSansVariable.scss +0 -187
  130. package/src/fonts/OpenSansVariable/mem6YaGs126MiZpBA-UFUK0Udc1UAw.woff2 +0 -0
  131. package/src/fonts/OpenSansVariable/mem6YaGs126MiZpBA-UFUK0Vdc1UAw.woff2 +0 -0
  132. package/src/fonts/OpenSansVariable/mem6YaGs126MiZpBA-UFUK0Wdc1UAw.woff2 +0 -0
  133. package/src/fonts/OpenSansVariable/mem6YaGs126MiZpBA-UFUK0Xdc1UAw.woff2 +0 -0
  134. package/src/fonts/OpenSansVariable/mem6YaGs126MiZpBA-UFUK0Zdc0.woff2 +0 -0
  135. package/src/fonts/OpenSansVariable/mem6YaGs126MiZpBA-UFUK0adc1UAw.woff2 +0 -0
  136. package/src/fonts/OpenSansVariable/mem6YaGs126MiZpBA-UFUK0bdc1UAw.woff2 +0 -0
  137. package/src/fonts/OpenSansVariable/mem6YaGs126MiZpBA-UFUK0ddc1UAw.woff2 +0 -0
  138. package/src/fonts/OpenSansVariable/mem8YaGs126MiZpBA-UFUZ0bbck.woff2 +0 -0
  139. package/src/fonts/OpenSansVariable/mem8YaGs126MiZpBA-UFV50bbck.woff2 +0 -0
  140. package/src/fonts/OpenSansVariable/mem8YaGs126MiZpBA-UFVZ0b.woff2 +0 -0
  141. package/src/fonts/OpenSansVariable/mem8YaGs126MiZpBA-UFVp0bbck.woff2 +0 -0
  142. package/src/fonts/OpenSansVariable/mem8YaGs126MiZpBA-UFW50bbck.woff2 +0 -0
  143. package/src/fonts/OpenSansVariable/mem8YaGs126MiZpBA-UFWJ0bbck.woff2 +0 -0
  144. package/src/fonts/OpenSansVariable/mem8YaGs126MiZpBA-UFWZ0bbck.woff2 +0 -0
  145. package/src/fonts/OpenSansVariable/mem8YaGs126MiZpBA-UFWp0bbck.woff2 +0 -0
@@ -1,12 +1,12 @@
1
- (function(ee,Y){typeof exports=="object"&&typeof module<"u"?Y(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],Y):(ee=typeof globalThis<"u"?globalThis:ee||self,Y(ee["castlabs-ui-editor"]={},ee.Vue))})(this,function(ee,Y){"use strict";var de=document.createElement("style");de.textContent=`.cl-form .ace_editor{font-family:Noto Sans Mono,sfmono-regular,menlo,monaco,consolas,Liberation Mono,Courier New,monospace;font-size:1rem;letter-spacing:.025em;font-stretch:80%;font-weight:400;line-height:1.5em;border:.125rem solid #dad6d6;border-radius:0;color:#b0b3b6;font-variant-ligatures:none}.cl-form .ace_editor.ace_focus{border-color:#b0b3b6}.cl-form .ace_editor .ace_gutter{background:#f6f5f5;color:#b0b3b6}.cl-form .ace_editor .ace_gutter-active-line{background:#f6f5f5;color:#595959}.cl-form .ace_editor .ace_fold-widget{opacity:.5}.cl-form .ace_editor .ace_marker-layer .ace_active-line{background:#f6f5f5}.cl-form .ace_editor .ace_storage,.cl-form .ace_editor .ace_keyword,.cl-form .ace_editor .ace_variable,.cl-form .ace_editor .ace_meta.ace_tag{color:#595959}.cl-form .ace_editor .ace_constant,.cl-form .ace_editor .ace_constant.ace_buildin,.cl-form .ace_editor .ace_constant.ace_language,.cl-form .ace_editor .ace_constant.ace_library,.cl-form .ace_editor .ace_constant.ace_numeric{color:#fa423c}.cl-form .ace_editor.disabled .ace_storage,.cl-form .ace_editor.disabled .ace_keyword,.cl-form .ace_editor.disabled .ace_variable,.cl-form .ace_editor.disabled .ace_meta.ace_tag,.cl-form .ace_editor[disabled=true] .ace_storage,.cl-form .ace_editor[disabled=true] .ace_keyword,.cl-form .ace_editor[disabled=true] .ace_variable,.cl-form .ace_editor[disabled=true] .ace_meta.ace_tag,.cl-form .ace_editor.disabled .ace_constant,.cl-form .ace_editor.disabled .ace_constant.ace_buildin,.cl-form .ace_editor.disabled .ace_constant.ace_language,.cl-form .ace_editor.disabled .ace_constant.ace_library,.cl-form .ace_editor.disabled .ace_constant.ace_numeric,.cl-form .ace_editor[disabled=true] .ace_constant,.cl-form .ace_editor[disabled=true] .ace_constant.ace_buildin,.cl-form .ace_editor[disabled=true] .ace_constant.ace_language,.cl-form .ace_editor[disabled=true] .ace_constant.ace_library,.cl-form .ace_editor[disabled=true] .ace_constant.ace_numeric{opacity:.5}.cl-form .ace_editor :invalid{box-shadow:none}.cl-form .ace_editor[invalid],.cl-form .ace_editor.invalid{border-color:#71c0ff;color:#71c0ff}.cl-form .ace_editor[invalid]+*+.invalid-feedback,.cl-form .ace_editor[invalid]+.invalid-feedback,.cl-form .ace_editor.invalid+*+.invalid-feedback,.cl-form .ace_editor.invalid+.invalid-feedback{display:block}.cl-form .ace_editor[invalid]+*+.valid-feedback,.cl-form .ace_editor[invalid]+.valid-feedback,.cl-form .ace_editor.invalid+*+.valid-feedback,.cl-form .ace_editor.invalid+.valid-feedback{display:none}
2
- /*$vite$:1*/`,document.head.appendChild(de);function Me(W){return W&&W.__esModule&&Object.prototype.hasOwnProperty.call(W,"default")?W.default:W}var ae={exports:{}},fe;function Le(){return fe||(fe=1,function(W,U){(function(){var k="ace",x=function(){return this}();!x&&typeof window<"u"&&(x=window);var H=function(i,o,n){if(typeof i!="string"){H.original?H.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(n=o),H.modules[i]||(H.payloads[i]=n,H.modules[i]=null)};H.modules={},H.payloads={};var E=function(i,o,n){if(typeof o=="string"){var t=a(i,o);if(t!=null)return n&&n(),t}else if(Object.prototype.toString.call(o)==="[object Array]"){for(var e=[],r=0,s=o.length;r<s;++r){var l=a(i,o[r]);if(l==null&&A.original)return;e.push(l)}return n&&n.apply(null,e)||!0}},A=function(i,o){var n=E("",i,o);return n==null&&A.original?A.original.apply(this,arguments):n},$=function(i,o){if(o.indexOf("!")!==-1){var n=o.split("!");return $(i,n[0])+"!"+$(i,n[1])}if(o.charAt(0)=="."){var t=i.split("/").slice(0,-1).join("/");for(o=t+"/"+o;o.indexOf(".")!==-1&&e!=o;){var e=o;o=o.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return o},a=function(i,o){o=$(i,o);var n=H.modules[o];if(!n){if(n=H.payloads[o],typeof n=="function"){var t={},e={id:o,uri:"",exports:t,packaged:!0},r=function(l,h){return E(o,l,h)},s=n(r,t,e);t=s||e.exports,H.modules[o]=t,delete H.payloads[o]}n=H.modules[o]=t||n}return n};function c(i){var o=x;x[i]||(x[i]={}),o=x[i],(!o.define||!o.define.packaged)&&(H.original=o.define,o.define=H,o.define.packaged=!0),(!o.require||!o.require.packaged)&&(A.original=o.require,o.require=A,o.require.packaged=!0)}c(k)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(k,x,H){function E(A,$,a){Object.defineProperty(A,$,{value:a,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||E(String.prototype,"startsWith",function(A,$){return $=$||0,this.lastIndexOf(A,$)===$}),String.prototype.endsWith||E(String.prototype,"endsWith",function(A,$){var a=this;($===void 0||$>a.length)&&($=a.length),$-=A.length;var c=a.indexOf(A,$);return c!==-1&&c===$}),String.prototype.repeat||E(String.prototype,"repeat",function(A){for(var $="",a=this;A>0;)A&1&&($+=a),(A>>=1)&&(a+=a);return $}),String.prototype.includes||E(String.prototype,"includes",function(A,$){return this.indexOf(A,$)!=-1}),Object.assign||(Object.assign=function(A){if(A==null)throw new TypeError("Cannot convert undefined or null to object");for(var $=Object(A),a=1;a<arguments.length;a++){var c=arguments[a];c!=null&&Object.keys(c).forEach(function(i){$[i]=c[i]})}return $}),Object.values||(Object.values=function(A){return Object.keys(A).map(function($){return A[$]})}),Array.prototype.find||E(Array.prototype,"find",function(A){for(var $=this.length,a=arguments[1],c=0;c<$;c++){var i=this[c];if(A.call(a,i,c,this))return i}}),Array.prototype.findIndex||E(Array.prototype,"findIndex",function(A){for(var $=this.length,a=arguments[1],c=0;c<$;c++){var i=this[c];if(A.call(a,i,c,this))return c}}),Array.prototype.includes||E(Array.prototype,"includes",function(A,$){return this.indexOf(A,$)!=-1}),Array.prototype.fill||E(Array.prototype,"fill",function(A){for(var $=this,a=$.length>>>0,c=arguments[1],i=c>>0,o=i<0?Math.max(a+i,0):Math.min(i,a),n=arguments[2],t=n===void 0?a:n>>0,e=t<0?Math.max(a+t,0):Math.min(t,a);o<e;)$[o]=A,o++;return $}),Array.of||E(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(k,x,H){k("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(k,x,H){x.deepCopy=function E(A){if(typeof A!="object"||!A)return A;var $;if(Array.isArray(A)){$=[];for(var a=0;a<A.length;a++)$[a]=E(A[a]);return $}if(Object.prototype.toString.call(A)!=="[object Object]")return A;$={};for(var a in A)$[a]=E(A[a]);return $}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(k,x,H){x.last=function($){return $[$.length-1]},x.stringReverse=function($){return $.split("").reverse().join("")},x.stringRepeat=function($,a){for(var c="";a>0;)a&1&&(c+=$),(a>>=1)&&($+=$);return c};var E=/^\s\s*/,A=/\s\s*$/;x.stringTrimLeft=function($){return $.replace(E,"")},x.stringTrimRight=function($){return $.replace(A,"")},x.copyObject=function($){var a={};for(var c in $)a[c]=$[c];return a},x.copyArray=function($){for(var a=[],c=0,i=$.length;c<i;c++)$[c]&&typeof $[c]=="object"?a[c]=this.copyObject($[c]):a[c]=$[c];return a},x.deepCopy=k("./deep_copy").deepCopy,x.arrayToMap=function($){for(var a={},c=0;c<$.length;c++)a[$[c]]=1;return a},x.createMap=function($){var a=Object.create(null);for(var c in $)a[c]=$[c];return a},x.arrayRemove=function($,a){for(var c=0;c<=$.length;c++)a===$[c]&&$.splice(c,1)},x.escapeRegExp=function($){return $.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},x.escapeHTML=function($){return(""+$).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},x.getMatchOffsets=function($,a){var c=[];return $.replace(a,function(i){c.push({offset:arguments[arguments.length-2],length:i.length})}),c},x.deferredCall=function($){var a=null,c=function(){a=null,$()},i=function(o){return i.cancel(),a=setTimeout(c,o||0),i};return i.schedule=i,i.call=function(){return this.cancel(),$(),i},i.cancel=function(){return clearTimeout(a),a=null,i},i.isPending=function(){return a},i},x.delayedCall=function($,a){var c=null,i=function(){c=null,$()},o=function(n){c==null&&(c=setTimeout(i,n||a))};return o.delay=function(n){c&&clearTimeout(c),c=setTimeout(i,n||a)},o.schedule=o,o.call=function(){this.cancel(),$()},o.cancel=function(){c&&clearTimeout(c),c=null},o.isPending=function(){return c},o},x.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},x.skipEmptyMatch=function($,a,c){return c&&$.codePointAt(a)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(k,x,H){x.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},x.getOS=function(){return x.isMac?x.OS.MAC:x.isLinux?x.OS.LINUX:x.OS.WINDOWS};var E=typeof navigator=="object"?navigator:{},A=(/mac|win|linux/i.exec(E.platform)||["other"])[0].toLowerCase(),$=E.userAgent||"",a=E.appName||"";x.isWin=A=="win",x.isMac=A=="mac",x.isLinux=A=="linux",x.isIE=a=="Microsoft Internet Explorer"||a.indexOf("MSAppHost")>=0?parseFloat(($.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat(($.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),x.isOldIE=x.isIE&&x.isIE<9,x.isGecko=x.isMozilla=$.match(/ Gecko\/\d+/),x.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",x.isWebKit=parseFloat($.split("WebKit/")[1])||void 0,x.isChrome=parseFloat($.split(" Chrome/")[1])||void 0,x.isSafari=parseFloat($.split(" Safari/")[1])&&!x.isChrome||void 0,x.isEdge=parseFloat($.split(" Edge/")[1])||void 0,x.isAIR=$.indexOf("AdobeAIR")>=0,x.isAndroid=$.indexOf("Android")>=0,x.isChromeOS=$.indexOf(" CrOS ")>=0,x.isIOS=/iPad|iPhone|iPod/.test($)&&!window.MSStream,x.isIOS&&(x.isMac=!0),x.isMobile=x.isIOS||x.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(k,x,H){var E=k("./useragent"),A="http://www.w3.org/1999/xhtml";x.buildDom=function n(t,e,r){if(typeof t=="string"&&t){var s=document.createTextNode(t);return e&&e.appendChild(s),s}if(!Array.isArray(t))return t&&t.appendChild&&e&&e.appendChild(t),t;if(typeof t[0]!="string"||!t[0]){for(var l=[],h=0;h<t.length;h++){var v=n(t[h],e,r);v&&l.push(v)}return l}var m=document.createElement(t[0]),g=t[1],d=1;g&&typeof g=="object"&&!Array.isArray(g)&&(d=2);for(var h=d;h<t.length;h++)n(t[h],m,r);return d==2&&Object.keys(g).forEach(function(b){var M=g[b];b==="class"?m.className=Array.isArray(M)?M.join(" "):M:typeof M=="function"||b=="value"||b[0]=="$"?m[b]=M:b==="ref"?r&&(r[M]=m):b==="style"?typeof M=="string"&&(m.style.cssText=M):M!=null&&m.setAttribute(b,M)}),e&&e.appendChild(m),m},x.getDocumentHead=function(n){return n||(n=document),n.head||n.getElementsByTagName("head")[0]||n.documentElement},x.createElement=function(n,t){return document.createElementNS?document.createElementNS(t||A,n):document.createElement(n)},x.removeChildren=function(n){n.innerHTML=""},x.createTextNode=function(n,t){var e=t?t.ownerDocument:document;return e.createTextNode(n)},x.createFragment=function(n){var t=n?n.ownerDocument:document;return t.createDocumentFragment()},x.hasCssClass=function(n,t){var e=(n.className+"").split(/\s+/g);return e.indexOf(t)!==-1},x.addCssClass=function(n,t){x.hasCssClass(n,t)||(n.className+=" "+t)},x.removeCssClass=function(n,t){for(var e=n.className.split(/\s+/g);;){var r=e.indexOf(t);if(r==-1)break;e.splice(r,1)}n.className=e.join(" ")},x.toggleCssClass=function(n,t){for(var e=n.className.split(/\s+/g),r=!0;;){var s=e.indexOf(t);if(s==-1)break;r=!1,e.splice(s,1)}return r&&e.push(t),n.className=e.join(" "),r},x.setCssClass=function(n,t,e){e?x.addCssClass(n,t):x.removeCssClass(n,t)},x.hasCssString=function(n,t){var e=0,r;if(t=t||document,r=t.querySelectorAll("style")){for(;e<r.length;)if(r[e++].id===n)return!0}},x.removeElementById=function(n,t){t=t||document,t.getElementById(n)&&t.getElementById(n).remove()};var $,a=[];x.useStrictCSP=function(n){$=n,n==!1?c():a||(a=[])};function c(){var n=a;a=null,n&&n.forEach(function(t){i(t[0],t[1])})}function i(n,t,e){if(!(typeof document>"u")){if(a){if(e)c();else if(e===!1)return a.push([n,t])}if(!$){var r=e;!e||!e.getRootNode?r=document:(r=e.getRootNode(),(!r||r==e)&&(r=document));var s=r.ownerDocument||r;if(t&&x.hasCssString(t,r))return null;t&&(n+=`
3
- /*# sourceURL=ace/css/`+t+" */");var l=x.createElement("style");l.appendChild(s.createTextNode(n)),t&&(l.id=t),r==s&&(r=x.getDocumentHead(s)),r.insertBefore(l,r.firstChild)}}}if(x.importCssString=i,x.importCssStylsheet=function(n,t){x.buildDom(["link",{rel:"stylesheet",href:n}],x.getDocumentHead(t))},x.scrollbarWidth=function(n){var t=x.createElement("ace_inner");t.style.width="100%",t.style.minWidth="0px",t.style.height="200px",t.style.display="block";var e=x.createElement("ace_outer"),r=e.style;r.position="absolute",r.left="-10000px",r.overflow="hidden",r.width="200px",r.minWidth="0px",r.height="150px",r.display="block",e.appendChild(t);var s=n&&n.documentElement||document&&document.documentElement;if(!s)return 0;s.appendChild(e);var l=t.offsetWidth;r.overflow="scroll";var h=t.offsetWidth;return l===h&&(h=e.clientWidth),s.removeChild(e),l-h},x.computedStyle=function(n,t){return window.getComputedStyle(n,"")||{}},x.setStyle=function(n,t,e){n[t]!==e&&(n[t]=e)},x.HAS_CSS_ANIMATION=!1,x.HAS_CSS_TRANSFORMS=!1,x.HI_DPI=E.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,E.isChromeOS&&(x.HI_DPI=!1),typeof document<"u"){var o=document.createElement("div");x.HI_DPI&&o.style.transform!==void 0&&(x.HAS_CSS_TRANSFORMS=!0),!E.isEdge&&typeof o.style.animationName<"u"&&(x.HAS_CSS_ANIMATION=!0),o=null}x.HAS_CSS_TRANSFORMS?x.translate=function(n,t,e){n.style.transform="translate("+Math.round(t)+"px, "+Math.round(e)+"px)"}:x.translate=function(n,t,e){n.style.top=Math.round(e)+"px",n.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(k,x,H){/*
1
+ (function(ee,Y){typeof exports=="object"&&typeof module<"u"?Y(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],Y):(ee=typeof globalThis<"u"?globalThis:ee||self,Y(ee["castlabs-ui-editor"]={},ee.Vue))})(this,function(ee,Y){"use strict";var de=document.createElement("style");de.textContent=`.cl-form .ace_editor{font-size:16px;letter-spacing:.025em;font-stretch:80%;font-family:DM Mono,sfmono-regular,menlo,monaco,consolas,Liberation Mono,Courier New,monospace;font-weight:400;line-height:24px;background-color:var(--cl-color-background);border:1px solid #6d5e5e;border-radius:20px;color:#262a35;font-variant-ligatures:none}.cl-form .ace_editor.ace_focus{border-color:#cfc8c8}.cl-form .ace_editor .ace_gutter{background:var(--cl-color-background);color:#262a35}.cl-form .ace_editor .ace_gutter-active-line{background:var(--cl-color-background);font-weight:600}.cl-form .ace_editor .ace_fold-widget{opacity:.5}.cl-form .ace_editor .ace_marker-layer .ace_active-line{background-color:var(--cl-color-highlight)}.cl-form .ace_editor .ace_storage,.cl-form .ace_editor .ace_keyword,.cl-form .ace_editor .ace_variable,.cl-form .ace_editor .ace_meta.ace_tag{color:#262a35}.cl-form .ace_editor .ace_constant,.cl-form .ace_editor .ace_constant.ace_buildin,.cl-form .ace_editor .ace_constant.ace_language,.cl-form .ace_editor .ace_constant.ace_library,.cl-form .ace_editor .ace_constant.ace_numeric{color:#fa423c}.cl-form .ace_editor.disabled .ace_storage,.cl-form .ace_editor.disabled .ace_keyword,.cl-form .ace_editor.disabled .ace_variable,.cl-form .ace_editor.disabled .ace_meta.ace_tag,.cl-form .ace_editor[disabled=true] .ace_storage,.cl-form .ace_editor[disabled=true] .ace_keyword,.cl-form .ace_editor[disabled=true] .ace_variable,.cl-form .ace_editor[disabled=true] .ace_meta.ace_tag,.cl-form .ace_editor.disabled .ace_constant,.cl-form .ace_editor.disabled .ace_constant.ace_buildin,.cl-form .ace_editor.disabled .ace_constant.ace_language,.cl-form .ace_editor.disabled .ace_constant.ace_library,.cl-form .ace_editor.disabled .ace_constant.ace_numeric,.cl-form .ace_editor[disabled=true] .ace_constant,.cl-form .ace_editor[disabled=true] .ace_constant.ace_buildin,.cl-form .ace_editor[disabled=true] .ace_constant.ace_language,.cl-form .ace_editor[disabled=true] .ace_constant.ace_library,.cl-form .ace_editor[disabled=true] .ace_constant.ace_numeric{opacity:.5}.cl-form .ace_editor :invalid{box-shadow:none}.cl-form .ace_editor[invalid],.cl-form .ace_editor.invalid{border-color:#71c0ff}.cl-form .ace_editor[invalid]+*+.invalid-feedback,.cl-form .ace_editor[invalid]+.invalid-feedback,.cl-form .ace_editor.invalid+*+.invalid-feedback,.cl-form .ace_editor.invalid+.invalid-feedback{display:block}.cl-form .ace_editor[invalid]+*+.valid-feedback,.cl-form .ace_editor[invalid]+.valid-feedback,.cl-form .ace_editor.invalid+*+.valid-feedback,.cl-form .ace_editor.invalid+.valid-feedback{display:none}
2
+ /*$vite$:1*/`,document.head.appendChild(de);function Me(W){return W&&W.__esModule&&Object.prototype.hasOwnProperty.call(W,"default")?W.default:W}var ae={exports:{}},fe;function xe(){return fe||(fe=1,function(W,U){(function(){var k="ace",L=function(){return this}();!L&&typeof window<"u"&&(L=window);var H=function(i,o,n){if(typeof i!="string"){H.original?H.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(n=o),H.modules[i]||(H.payloads[i]=n,H.modules[i]=null)};H.modules={},H.payloads={};var E=function(i,o,n){if(typeof o=="string"){var t=a(i,o);if(t!=null)return n&&n(),t}else if(Object.prototype.toString.call(o)==="[object Array]"){for(var e=[],r=0,s=o.length;r<s;++r){var l=a(i,o[r]);if(l==null&&A.original)return;e.push(l)}return n&&n.apply(null,e)||!0}},A=function(i,o){var n=E("",i,o);return n==null&&A.original?A.original.apply(this,arguments):n},$=function(i,o){if(o.indexOf("!")!==-1){var n=o.split("!");return $(i,n[0])+"!"+$(i,n[1])}if(o.charAt(0)=="."){var t=i.split("/").slice(0,-1).join("/");for(o=t+"/"+o;o.indexOf(".")!==-1&&e!=o;){var e=o;o=o.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return o},a=function(i,o){o=$(i,o);var n=H.modules[o];if(!n){if(n=H.payloads[o],typeof n=="function"){var t={},e={id:o,uri:"",exports:t,packaged:!0},r=function(l,h){return E(o,l,h)},s=n(r,t,e);t=s||e.exports,H.modules[o]=t,delete H.payloads[o]}n=H.modules[o]=t||n}return n};function c(i){var o=L;L[i]||(L[i]={}),o=L[i],(!o.define||!o.define.packaged)&&(H.original=o.define,o.define=H,o.define.packaged=!0),(!o.require||!o.require.packaged)&&(A.original=o.require,o.require=A,o.require.packaged=!0)}c(k)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(k,L,H){function E(A,$,a){Object.defineProperty(A,$,{value:a,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||E(String.prototype,"startsWith",function(A,$){return $=$||0,this.lastIndexOf(A,$)===$}),String.prototype.endsWith||E(String.prototype,"endsWith",function(A,$){var a=this;($===void 0||$>a.length)&&($=a.length),$-=A.length;var c=a.indexOf(A,$);return c!==-1&&c===$}),String.prototype.repeat||E(String.prototype,"repeat",function(A){for(var $="",a=this;A>0;)A&1&&($+=a),(A>>=1)&&(a+=a);return $}),String.prototype.includes||E(String.prototype,"includes",function(A,$){return this.indexOf(A,$)!=-1}),Object.assign||(Object.assign=function(A){if(A==null)throw new TypeError("Cannot convert undefined or null to object");for(var $=Object(A),a=1;a<arguments.length;a++){var c=arguments[a];c!=null&&Object.keys(c).forEach(function(i){$[i]=c[i]})}return $}),Object.values||(Object.values=function(A){return Object.keys(A).map(function($){return A[$]})}),Array.prototype.find||E(Array.prototype,"find",function(A){for(var $=this.length,a=arguments[1],c=0;c<$;c++){var i=this[c];if(A.call(a,i,c,this))return i}}),Array.prototype.findIndex||E(Array.prototype,"findIndex",function(A){for(var $=this.length,a=arguments[1],c=0;c<$;c++){var i=this[c];if(A.call(a,i,c,this))return c}}),Array.prototype.includes||E(Array.prototype,"includes",function(A,$){return this.indexOf(A,$)!=-1}),Array.prototype.fill||E(Array.prototype,"fill",function(A){for(var $=this,a=$.length>>>0,c=arguments[1],i=c>>0,o=i<0?Math.max(a+i,0):Math.min(i,a),n=arguments[2],t=n===void 0?a:n>>0,e=t<0?Math.max(a+t,0):Math.min(t,a);o<e;)$[o]=A,o++;return $}),Array.of||E(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(k,L,H){k("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(k,L,H){L.deepCopy=function E(A){if(typeof A!="object"||!A)return A;var $;if(Array.isArray(A)){$=[];for(var a=0;a<A.length;a++)$[a]=E(A[a]);return $}if(Object.prototype.toString.call(A)!=="[object Object]")return A;$={};for(var a in A)$[a]=E(A[a]);return $}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(k,L,H){L.last=function($){return $[$.length-1]},L.stringReverse=function($){return $.split("").reverse().join("")},L.stringRepeat=function($,a){for(var c="";a>0;)a&1&&(c+=$),(a>>=1)&&($+=$);return c};var E=/^\s\s*/,A=/\s\s*$/;L.stringTrimLeft=function($){return $.replace(E,"")},L.stringTrimRight=function($){return $.replace(A,"")},L.copyObject=function($){var a={};for(var c in $)a[c]=$[c];return a},L.copyArray=function($){for(var a=[],c=0,i=$.length;c<i;c++)$[c]&&typeof $[c]=="object"?a[c]=this.copyObject($[c]):a[c]=$[c];return a},L.deepCopy=k("./deep_copy").deepCopy,L.arrayToMap=function($){for(var a={},c=0;c<$.length;c++)a[$[c]]=1;return a},L.createMap=function($){var a=Object.create(null);for(var c in $)a[c]=$[c];return a},L.arrayRemove=function($,a){for(var c=0;c<=$.length;c++)a===$[c]&&$.splice(c,1)},L.escapeRegExp=function($){return $.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},L.escapeHTML=function($){return(""+$).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},L.getMatchOffsets=function($,a){var c=[];return $.replace(a,function(i){c.push({offset:arguments[arguments.length-2],length:i.length})}),c},L.deferredCall=function($){var a=null,c=function(){a=null,$()},i=function(o){return i.cancel(),a=setTimeout(c,o||0),i};return i.schedule=i,i.call=function(){return this.cancel(),$(),i},i.cancel=function(){return clearTimeout(a),a=null,i},i.isPending=function(){return a},i},L.delayedCall=function($,a){var c=null,i=function(){c=null,$()},o=function(n){c==null&&(c=setTimeout(i,n||a))};return o.delay=function(n){c&&clearTimeout(c),c=setTimeout(i,n||a)},o.schedule=o,o.call=function(){this.cancel(),$()},o.cancel=function(){c&&clearTimeout(c),c=null},o.isPending=function(){return c},o},L.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},L.skipEmptyMatch=function($,a,c){return c&&$.codePointAt(a)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(k,L,H){L.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},L.getOS=function(){return L.isMac?L.OS.MAC:L.isLinux?L.OS.LINUX:L.OS.WINDOWS};var E=typeof navigator=="object"?navigator:{},A=(/mac|win|linux/i.exec(E.platform)||["other"])[0].toLowerCase(),$=E.userAgent||"",a=E.appName||"";L.isWin=A=="win",L.isMac=A=="mac",L.isLinux=A=="linux",L.isIE=a=="Microsoft Internet Explorer"||a.indexOf("MSAppHost")>=0?parseFloat(($.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat(($.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),L.isOldIE=L.isIE&&L.isIE<9,L.isGecko=L.isMozilla=$.match(/ Gecko\/\d+/),L.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",L.isWebKit=parseFloat($.split("WebKit/")[1])||void 0,L.isChrome=parseFloat($.split(" Chrome/")[1])||void 0,L.isSafari=parseFloat($.split(" Safari/")[1])&&!L.isChrome||void 0,L.isEdge=parseFloat($.split(" Edge/")[1])||void 0,L.isAIR=$.indexOf("AdobeAIR")>=0,L.isAndroid=$.indexOf("Android")>=0,L.isChromeOS=$.indexOf(" CrOS ")>=0,L.isIOS=/iPad|iPhone|iPod/.test($)&&!window.MSStream,L.isIOS&&(L.isMac=!0),L.isMobile=L.isIOS||L.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(k,L,H){var E=k("./useragent"),A="http://www.w3.org/1999/xhtml";L.buildDom=function n(t,e,r){if(typeof t=="string"&&t){var s=document.createTextNode(t);return e&&e.appendChild(s),s}if(!Array.isArray(t))return t&&t.appendChild&&e&&e.appendChild(t),t;if(typeof t[0]!="string"||!t[0]){for(var l=[],h=0;h<t.length;h++){var v=n(t[h],e,r);v&&l.push(v)}return l}var m=document.createElement(t[0]),g=t[1],d=1;g&&typeof g=="object"&&!Array.isArray(g)&&(d=2);for(var h=d;h<t.length;h++)n(t[h],m,r);return d==2&&Object.keys(g).forEach(function(b){var M=g[b];b==="class"?m.className=Array.isArray(M)?M.join(" "):M:typeof M=="function"||b=="value"||b[0]=="$"?m[b]=M:b==="ref"?r&&(r[M]=m):b==="style"?typeof M=="string"&&(m.style.cssText=M):M!=null&&m.setAttribute(b,M)}),e&&e.appendChild(m),m},L.getDocumentHead=function(n){return n||(n=document),n.head||n.getElementsByTagName("head")[0]||n.documentElement},L.createElement=function(n,t){return document.createElementNS?document.createElementNS(t||A,n):document.createElement(n)},L.removeChildren=function(n){n.innerHTML=""},L.createTextNode=function(n,t){var e=t?t.ownerDocument:document;return e.createTextNode(n)},L.createFragment=function(n){var t=n?n.ownerDocument:document;return t.createDocumentFragment()},L.hasCssClass=function(n,t){var e=(n.className+"").split(/\s+/g);return e.indexOf(t)!==-1},L.addCssClass=function(n,t){L.hasCssClass(n,t)||(n.className+=" "+t)},L.removeCssClass=function(n,t){for(var e=n.className.split(/\s+/g);;){var r=e.indexOf(t);if(r==-1)break;e.splice(r,1)}n.className=e.join(" ")},L.toggleCssClass=function(n,t){for(var e=n.className.split(/\s+/g),r=!0;;){var s=e.indexOf(t);if(s==-1)break;r=!1,e.splice(s,1)}return r&&e.push(t),n.className=e.join(" "),r},L.setCssClass=function(n,t,e){e?L.addCssClass(n,t):L.removeCssClass(n,t)},L.hasCssString=function(n,t){var e=0,r;if(t=t||document,r=t.querySelectorAll("style")){for(;e<r.length;)if(r[e++].id===n)return!0}},L.removeElementById=function(n,t){t=t||document,t.getElementById(n)&&t.getElementById(n).remove()};var $,a=[];L.useStrictCSP=function(n){$=n,n==!1?c():a||(a=[])};function c(){var n=a;a=null,n&&n.forEach(function(t){i(t[0],t[1])})}function i(n,t,e){if(!(typeof document>"u")){if(a){if(e)c();else if(e===!1)return a.push([n,t])}if(!$){var r=e;!e||!e.getRootNode?r=document:(r=e.getRootNode(),(!r||r==e)&&(r=document));var s=r.ownerDocument||r;if(t&&L.hasCssString(t,r))return null;t&&(n+=`
3
+ /*# sourceURL=ace/css/`+t+" */");var l=L.createElement("style");l.appendChild(s.createTextNode(n)),t&&(l.id=t),r==s&&(r=L.getDocumentHead(s)),r.insertBefore(l,r.firstChild)}}}if(L.importCssString=i,L.importCssStylsheet=function(n,t){L.buildDom(["link",{rel:"stylesheet",href:n}],L.getDocumentHead(t))},L.scrollbarWidth=function(n){var t=L.createElement("ace_inner");t.style.width="100%",t.style.minWidth="0px",t.style.height="200px",t.style.display="block";var e=L.createElement("ace_outer"),r=e.style;r.position="absolute",r.left="-10000px",r.overflow="hidden",r.width="200px",r.minWidth="0px",r.height="150px",r.display="block",e.appendChild(t);var s=n&&n.documentElement||document&&document.documentElement;if(!s)return 0;s.appendChild(e);var l=t.offsetWidth;r.overflow="scroll";var h=t.offsetWidth;return l===h&&(h=e.clientWidth),s.removeChild(e),l-h},L.computedStyle=function(n,t){return window.getComputedStyle(n,"")||{}},L.setStyle=function(n,t,e){n[t]!==e&&(n[t]=e)},L.HAS_CSS_ANIMATION=!1,L.HAS_CSS_TRANSFORMS=!1,L.HI_DPI=E.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,E.isChromeOS&&(L.HI_DPI=!1),typeof document<"u"){var o=document.createElement("div");L.HI_DPI&&o.style.transform!==void 0&&(L.HAS_CSS_TRANSFORMS=!0),!E.isEdge&&typeof o.style.animationName<"u"&&(L.HAS_CSS_ANIMATION=!0),o=null}L.HAS_CSS_TRANSFORMS?L.translate=function(n,t,e){n.style.transform="translate("+Math.round(t)+"px, "+Math.round(e)+"px)"}:L.translate=function(n,t,e){n.style.top=Math.round(e)+"px",n.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(k,L,H){/*
4
4
  * based on code from:
5
5
  *
6
6
  * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
7
7
  * Available via the MIT or new BSD license.
8
8
  * see: http://github.com/jrburke/requirejs for details
9
- */var E=k("./dom");x.get=function(A,$){var a=new XMLHttpRequest;a.open("GET",A,!0),a.onreadystatechange=function(){a.readyState===4&&$(a.responseText)},a.send(null)},x.loadScript=function(A,$){var a=E.getDocumentHead(),c=document.createElement("script");c.src=A,a.appendChild(c),c.onload=c.onreadystatechange=function(i,o){(o||!c.readyState||c.readyState=="loaded"||c.readyState=="complete")&&(c=c.onload=c.onreadystatechange=null,o||$())}},x.qualifyURL=function(A){var $=document.createElement("a");return $.href=A,$.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(k,x,H){x.inherits=function(E,A){E.super_=A,E.prototype=Object.create(A.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}})},x.mixin=function(E,A){for(var $ in A)E[$]=A[$];return E},x.implement=function(E,A){x.mixin(E,A)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(k,x,H){var E={},A=function(){this.propagationStopped=!0},$=function(){this.defaultPrevented=!0};E._emit=E._dispatchEvent=function(a,c){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[a]||[],o=this._defaultHandlers[a];if(!(!i.length&&!o)){(typeof c!="object"||!c)&&(c={}),c.type||(c.type=a),c.stopPropagation||(c.stopPropagation=A),c.preventDefault||(c.preventDefault=$),i=i.slice();for(var n=0;n<i.length&&(i[n](c,this),!c.propagationStopped);n++);if(o&&!c.defaultPrevented)return o(c,this)}},E._signal=function(a,c){var i=(this._eventRegistry||{})[a];if(i){i=i.slice();for(var o=0;o<i.length;o++)i[o](c,this)}},E.once=function(a,c){var i=this;if(this.on(a,function o(){i.off(a,o),c.apply(null,arguments)}),!c)return new Promise(function(o){c=o})},E.setDefaultHandler=function(a,c){var i=this._defaultHandlers;if(i||(i=this._defaultHandlers={_disabled_:{}}),i[a]){var o=i[a],n=i._disabled_[a];n||(i._disabled_[a]=n=[]),n.push(o);var t=n.indexOf(c);t!=-1&&n.splice(t,1)}i[a]=c},E.removeDefaultHandler=function(a,c){var i=this._defaultHandlers;if(i){var o=i._disabled_[a];if(i[a]==c)o&&this.setDefaultHandler(a,o.pop());else if(o){var n=o.indexOf(c);n!=-1&&o.splice(n,1)}}},E.on=E.addEventListener=function(a,c,i){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[a];return o||(o=this._eventRegistry[a]=[]),o.indexOf(c)==-1&&o[i?"unshift":"push"](c),c},E.off=E.removeListener=E.removeEventListener=function(a,c){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[a];if(i){var o=i.indexOf(c);o!==-1&&i.splice(o,1)}},E.removeAllListeners=function(a){a||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[a]=void 0),this._defaultHandlers&&(this._defaultHandlers[a]=void 0)},x.EventEmitter=E}),ace.define("ace/lib/report_error",["require","exports","module"],function(k,x,H){x.reportError=function(A,$){var a=new Error(A);a.data=$,typeof console=="object"&&console.error&&console.error(a),setTimeout(function(){throw a})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(k,x,H){var E={"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"};x.defaultEnglishMessages=E}),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(k,x,H){"no use strict";var E=k("./oop"),A=k("./event_emitter").EventEmitter,$=k("./report_error").reportError,a=k("./default_english_messages").defaultEnglishMessages,c={setOptions:function(e){Object.keys(e).forEach(function(r){this.setOption(r,e[r])},this)},getOptions:function(e){var r={};if(e)Array.isArray(e)||(e=Object.keys(e));else{var s=this.$options;e=Object.keys(s).filter(function(l){return!s[l].hidden})}return e.forEach(function(l){r[l]=this.getOption(l)},this),r},setOption:function(e,r){if(this["$"+e]!==r){var s=this.$options[e];if(!s)return i('misspelled option "'+e+'"');if(s.forwardTo)return this[s.forwardTo]&&this[s.forwardTo].setOption(e,r);s.handlesSet||(this["$"+e]=r),s&&s.set&&s.set.call(this,r)}},getOption:function(e){var r=this.$options[e];return r?r.forwardTo?this[r.forwardTo]&&this[r.forwardTo].getOption(e):r&&r.get?r.get.call(this):this["$"+e]:i('misspelled option "'+e+'"')}};function i(e){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var o,n,t=function(){function e(){this.$defaultOptions={},o=a,n="dollarSigns"}return e.prototype.defineOptions=function(r,s,l){return r.$options||(this.$defaultOptions[s]=r.$options={}),Object.keys(l).forEach(function(h){var v=l[h];typeof v=="string"&&(v={forwardTo:v}),v.name||(v.name=h),r.$options[v.name]=v,"initialValue"in v&&(r["$"+v.name]=v.initialValue)}),E.implement(r,c),this},e.prototype.resetOptions=function(r){Object.keys(r.$options).forEach(function(s){var l=r.$options[s];"value"in l&&r.setOption(s,l.value)})},e.prototype.setDefaultValue=function(r,s,l){if(!r){for(r in this.$defaultOptions)if(this.$defaultOptions[r][s])break;if(!this.$defaultOptions[r][s])return!1}var h=this.$defaultOptions[r]||(this.$defaultOptions[r]={});h[s]&&(h.forwardTo?this.setDefaultValue(h.forwardTo,s,l):h[s].value=l)},e.prototype.setDefaultValues=function(r,s){Object.keys(s).forEach(function(l){this.setDefaultValue(r,l,s[l])},this)},e.prototype.setMessages=function(r,s){o=r,s&&s.placeholders&&(n=s.placeholders)},e.prototype.nls=function(r,s,l){o[r]||(i("No message found for the key '"+r+"' in messages with id "+o.$id+", trying to find a translation for the default string '"+s+"'."),o[s]||i("No message found for the default string '"+s+"' in the provided messages. Falling back to the default English message."));var h=o[r]||o[s]||s;return l&&(n==="dollarSigns"&&(h=h.replace(/\$(\$|[\d]+)/g,function(v,m){return m=="$"?"$":l[m]})),n==="curlyBrackets"&&(h=h.replace(/\{([^\}]+)\}/g,function(v,m){return l[m]}))),h},e}();t.prototype.warn=i,t.prototype.reportError=$,E.implement(t.prototype,A),x.AppConfig=t}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(k,x,H){H.exports=`.ace-tm .ace_gutter {
9
+ */var E=k("./dom");L.get=function(A,$){var a=new XMLHttpRequest;a.open("GET",A,!0),a.onreadystatechange=function(){a.readyState===4&&$(a.responseText)},a.send(null)},L.loadScript=function(A,$){var a=E.getDocumentHead(),c=document.createElement("script");c.src=A,a.appendChild(c),c.onload=c.onreadystatechange=function(i,o){(o||!c.readyState||c.readyState=="loaded"||c.readyState=="complete")&&(c=c.onload=c.onreadystatechange=null,o||$())}},L.qualifyURL=function(A){var $=document.createElement("a");return $.href=A,$.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(k,L,H){L.inherits=function(E,A){E.super_=A,E.prototype=Object.create(A.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}})},L.mixin=function(E,A){for(var $ in A)E[$]=A[$];return E},L.implement=function(E,A){L.mixin(E,A)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(k,L,H){var E={},A=function(){this.propagationStopped=!0},$=function(){this.defaultPrevented=!0};E._emit=E._dispatchEvent=function(a,c){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[a]||[],o=this._defaultHandlers[a];if(!(!i.length&&!o)){(typeof c!="object"||!c)&&(c={}),c.type||(c.type=a),c.stopPropagation||(c.stopPropagation=A),c.preventDefault||(c.preventDefault=$),i=i.slice();for(var n=0;n<i.length&&(i[n](c,this),!c.propagationStopped);n++);if(o&&!c.defaultPrevented)return o(c,this)}},E._signal=function(a,c){var i=(this._eventRegistry||{})[a];if(i){i=i.slice();for(var o=0;o<i.length;o++)i[o](c,this)}},E.once=function(a,c){var i=this;if(this.on(a,function o(){i.off(a,o),c.apply(null,arguments)}),!c)return new Promise(function(o){c=o})},E.setDefaultHandler=function(a,c){var i=this._defaultHandlers;if(i||(i=this._defaultHandlers={_disabled_:{}}),i[a]){var o=i[a],n=i._disabled_[a];n||(i._disabled_[a]=n=[]),n.push(o);var t=n.indexOf(c);t!=-1&&n.splice(t,1)}i[a]=c},E.removeDefaultHandler=function(a,c){var i=this._defaultHandlers;if(i){var o=i._disabled_[a];if(i[a]==c)o&&this.setDefaultHandler(a,o.pop());else if(o){var n=o.indexOf(c);n!=-1&&o.splice(n,1)}}},E.on=E.addEventListener=function(a,c,i){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[a];return o||(o=this._eventRegistry[a]=[]),o.indexOf(c)==-1&&o[i?"unshift":"push"](c),c},E.off=E.removeListener=E.removeEventListener=function(a,c){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[a];if(i){var o=i.indexOf(c);o!==-1&&i.splice(o,1)}},E.removeAllListeners=function(a){a||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[a]=void 0),this._defaultHandlers&&(this._defaultHandlers[a]=void 0)},L.EventEmitter=E}),ace.define("ace/lib/report_error",["require","exports","module"],function(k,L,H){L.reportError=function(A,$){var a=new Error(A);a.data=$,typeof console=="object"&&console.error&&console.error(a),setTimeout(function(){throw a})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(k,L,H){var E={"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"};L.defaultEnglishMessages=E}),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(k,L,H){"no use strict";var E=k("./oop"),A=k("./event_emitter").EventEmitter,$=k("./report_error").reportError,a=k("./default_english_messages").defaultEnglishMessages,c={setOptions:function(e){Object.keys(e).forEach(function(r){this.setOption(r,e[r])},this)},getOptions:function(e){var r={};if(e)Array.isArray(e)||(e=Object.keys(e));else{var s=this.$options;e=Object.keys(s).filter(function(l){return!s[l].hidden})}return e.forEach(function(l){r[l]=this.getOption(l)},this),r},setOption:function(e,r){if(this["$"+e]!==r){var s=this.$options[e];if(!s)return i('misspelled option "'+e+'"');if(s.forwardTo)return this[s.forwardTo]&&this[s.forwardTo].setOption(e,r);s.handlesSet||(this["$"+e]=r),s&&s.set&&s.set.call(this,r)}},getOption:function(e){var r=this.$options[e];return r?r.forwardTo?this[r.forwardTo]&&this[r.forwardTo].getOption(e):r&&r.get?r.get.call(this):this["$"+e]:i('misspelled option "'+e+'"')}};function i(e){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var o,n,t=function(){function e(){this.$defaultOptions={},o=a,n="dollarSigns"}return e.prototype.defineOptions=function(r,s,l){return r.$options||(this.$defaultOptions[s]=r.$options={}),Object.keys(l).forEach(function(h){var v=l[h];typeof v=="string"&&(v={forwardTo:v}),v.name||(v.name=h),r.$options[v.name]=v,"initialValue"in v&&(r["$"+v.name]=v.initialValue)}),E.implement(r,c),this},e.prototype.resetOptions=function(r){Object.keys(r.$options).forEach(function(s){var l=r.$options[s];"value"in l&&r.setOption(s,l.value)})},e.prototype.setDefaultValue=function(r,s,l){if(!r){for(r in this.$defaultOptions)if(this.$defaultOptions[r][s])break;if(!this.$defaultOptions[r][s])return!1}var h=this.$defaultOptions[r]||(this.$defaultOptions[r]={});h[s]&&(h.forwardTo?this.setDefaultValue(h.forwardTo,s,l):h[s].value=l)},e.prototype.setDefaultValues=function(r,s){Object.keys(s).forEach(function(l){this.setDefaultValue(r,l,s[l])},this)},e.prototype.setMessages=function(r,s){o=r,s&&s.placeholders&&(n=s.placeholders)},e.prototype.nls=function(r,s,l){o[r]||(i("No message found for the key '"+r+"' in messages with id "+o.$id+", trying to find a translation for the default string '"+s+"'."),o[s]||i("No message found for the default string '"+s+"' in the provided messages. Falling back to the default English message."));var h=o[r]||o[s]||s;return l&&(n==="dollarSigns"&&(h=h.replace(/\$(\$|[\d]+)/g,function(v,m){return m=="$"?"$":l[m]})),n==="curlyBrackets"&&(h=h.replace(/\{([^\}]+)\}/g,function(v,m){return l[m]}))),h},e}();t.prototype.warn=i,t.prototype.reportError=$,E.implement(t.prototype,A),L.AppConfig=t}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(k,L,H){H.exports=`.ace-tm .ace_gutter {
10
10
  background: #f0f0f0;
11
11
  color: #333;
12
12
  }
@@ -164,39 +164,39 @@
164
164
  .ace-tm .ace_indent-guide-active {
165
165
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
166
166
  }
167
- `}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(k,x,H){x.isDark=!1,x.cssClass="ace-tm",x.cssText=k("./textmate-css"),x.$id="ace/theme/textmate";var E=k("../lib/dom");E.importCssString(x.cssText,x.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(k,x,H){"no use strict";var E=k("./lib/lang"),A=k("./lib/net"),$=k("./lib/dom"),a=k("./lib/app_config").AppConfig;H.exports=x=new a;var c={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};x.get=function(t){if(!c.hasOwnProperty(t))throw new Error("Unknown config key: "+t);return c[t]},x.set=function(t,e){if(c.hasOwnProperty(t))c[t]=e;else if(this.setDefaultValue("",t,e)==!1)throw new Error("Unknown config key: "+t);t=="useStrictCSP"&&$.useStrictCSP(e)},x.all=function(){return E.copyObject(c)},x.$modes={},x.moduleUrl=function(t,e){if(c.$moduleUrls[t])return c.$moduleUrls[t];var r=t.split("/");e=e||r[r.length-2]||"";var s=e=="snippets"?"/":"-",l=r[r.length-1];if(e=="worker"&&s=="-"){var h=new RegExp("^"+e+"[\\-_]|[\\-_]"+e+"$","g");l=l.replace(h,"")}(!l||l==e)&&r.length>1&&(l=r[r.length-2]);var v=c[e+"Path"];return v==null?v=c.basePath:s=="/"&&(e=s=""),v&&v.slice(-1)!="/"&&(v+="/"),v+e+s+l+this.get("suffix")},x.setModuleUrl=function(t,e){return c.$moduleUrls[t]=e};var i=function(t,e){if(t==="ace/theme/textmate"||t==="./theme/textmate")return e(null,k("./theme/textmate"));if(o)return o(t,e);console.error("loader is not configured")},o;x.setLoader=function(t){o=t},x.dynamicModules=Object.create(null),x.$loading={},x.$loaded={},x.loadModule=function(t,e){var r;if(Array.isArray(t))var s=t[0],l=t[1];else if(typeof t=="string")var l=t;var h=function(v){if(v&&!x.$loading[l])return e&&e(v);if(x.$loading[l]||(x.$loading[l]=[]),x.$loading[l].push(e),!(x.$loading[l].length>1)){var m=function(){i(l,function(g,d){d&&(x.$loaded[l]=d),x._emit("load.module",{name:l,module:d});var b=x.$loading[l];x.$loading[l]=null,b.forEach(function(M){M&&M(d)})})};if(!x.get("packaged"))return m();A.loadScript(x.moduleUrl(l,s),m),n()}};if(x.dynamicModules[l])x.dynamicModules[l]().then(function(v){v.default?h(v.default):h(v)});else{try{r=this.$require(l)}catch{}h(r||x.$loaded[l])}},x.$require=function(t){if(typeof H.require=="function"){var e="require";return H[e](t)}},x.setModuleLoader=function(t,e){x.dynamicModules[t]=e};var n=function(){!c.basePath&&!c.workerPath&&!c.modePath&&!c.themePath&&!Object.keys(c.$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"),n=function(){})};x.version="1.43.2"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(k,x,H){k("./lib/fixoldbrowsers");var E=k("./config");E.setLoader(function(c,i){k([c],function(o){i(null,o)})});var A=function(){return this||typeof window<"u"&&window}();H.exports=function(c){E.init=$,E.$require=k,c.require=k},$(!0);function $(c){if(!(!A||!A.document)){E.set("packaged",c||k.packaged||H.packaged||A.define&&(void 0).packaged);var i={},o="",n=document.currentScript||document._currentScript,t=n&&n.ownerDocument||document;n&&n.src&&(o=n.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var e=t.getElementsByTagName("script"),r=0;r<e.length;r++){var s=e[r],l=s.src||s.getAttribute("src");if(l){for(var h=s.attributes,v=0,m=h.length;v<m;v++){var g=h[v];g.name.indexOf("data-ace-")===0&&(i[a(g.name.replace(/^data-ace-/,""))]=g.value)}var d=l.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);d&&(o=d[1])}}o&&(i.base=i.base||o,i.packaged=!0),i.basePath=i.base,i.workerPath=i.workerPath||i.base,i.modePath=i.modePath||i.base,i.themePath=i.themePath||i.base,delete i.base;for(var b in i)typeof i[b]<"u"&&E.set(b,i[b])}}function a(c){return c.replace(/-(.)/g,function(i,o){return o.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(k,x,H){var E=function(){function A($,a,c,i){this.start={row:$,column:a},this.end={row:c,column:i}}return A.prototype.isEqual=function($){return this.start.row===$.start.row&&this.end.row===$.end.row&&this.start.column===$.start.column&&this.end.column===$.end.column},A.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},A.prototype.contains=function($,a){return this.compare($,a)==0},A.prototype.compareRange=function($){var a,c=$.end,i=$.start;return a=this.compare(c.row,c.column),a==1?(a=this.compare(i.row,i.column),a==1?2:a==0?1:0):a==-1?-2:(a=this.compare(i.row,i.column),a==-1?-1:a==1?42:0)},A.prototype.comparePoint=function($){return this.compare($.row,$.column)},A.prototype.containsRange=function($){return this.comparePoint($.start)==0&&this.comparePoint($.end)==0},A.prototype.intersects=function($){var a=this.compareRange($);return a==-1||a==0||a==1},A.prototype.isEnd=function($,a){return this.end.row==$&&this.end.column==a},A.prototype.isStart=function($,a){return this.start.row==$&&this.start.column==a},A.prototype.setStart=function($,a){typeof $=="object"?(this.start.column=$.column,this.start.row=$.row):(this.start.row=$,this.start.column=a)},A.prototype.setEnd=function($,a){typeof $=="object"?(this.end.column=$.column,this.end.row=$.row):(this.end.row=$,this.end.column=a)},A.prototype.inside=function($,a){return this.compare($,a)==0?!(this.isEnd($,a)||this.isStart($,a)):!1},A.prototype.insideStart=function($,a){return this.compare($,a)==0?!this.isEnd($,a):!1},A.prototype.insideEnd=function($,a){return this.compare($,a)==0?!this.isStart($,a):!1},A.prototype.compare=function($,a){return!this.isMultiLine()&&$===this.start.row?a<this.start.column?-1:a>this.end.column?1:0:$<this.start.row?-1:$>this.end.row?1:this.start.row===$?a>=this.start.column?0:-1:this.end.row===$?a<=this.end.column?0:1:0},A.prototype.compareStart=function($,a){return this.start.row==$&&this.start.column==a?-1:this.compare($,a)},A.prototype.compareEnd=function($,a){return this.end.row==$&&this.end.column==a?1:this.compare($,a)},A.prototype.compareInside=function($,a){return this.end.row==$&&this.end.column==a?1:this.start.row==$&&this.start.column==a?-1:this.compare($,a)},A.prototype.clipRows=function($,a){if(this.end.row>a)var c={row:a+1,column:0};else if(this.end.row<$)var c={row:$,column:0};if(this.start.row>a)var i={row:a+1,column:0};else if(this.start.row<$)var i={row:$,column:0};return A.fromPoints(i||this.start,c||this.end)},A.prototype.extend=function($,a){var c=this.compare($,a);if(c==0)return this;if(c==-1)var i={row:$,column:a};else var o={row:$,column:a};return A.fromPoints(i||this.start,o||this.end)},A.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},A.prototype.isMultiLine=function(){return this.start.row!==this.end.row},A.prototype.clone=function(){return A.fromPoints(this.start,this.end)},A.prototype.collapseRows=function(){return this.end.column==0?new A(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new A(this.start.row,0,this.end.row,0)},A.prototype.toScreenRange=function($){var a=$.documentToScreenPosition(this.start),c=$.documentToScreenPosition(this.end);return new A(a.row,a.column,c.row,c.column)},A.prototype.moveBy=function($,a){this.start.row+=$,this.start.column+=a,this.end.row+=$,this.end.column+=a},A}();E.fromPoints=function(A,$){return new E(A.row,A.column,$.row,$.column)},E.comparePoints=function(A,$){return A.row-$.row||A.column-$.column},x.Range=E}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(k,x,H){for(var E=k("./oop"),A={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:"*"}},$={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},a=0;a<10;a++)$["Digit"+a]=48+a,$["Numpad"+a]=96+a,A.PRINTABLE_KEYS[48+a]=""+a,A.FUNCTION_KEYS[96+a]="Numpad"+a;for(var a=65;a<91;a++){var c=String.fromCharCode(a+32);$["Key"+c.toUpperCase()]=a,A.PRINTABLE_KEYS[a]=c}for(var a=1;a<13;a++)$["F"+a]=111+a,A.FUNCTION_KEYS[111+a]="F"+a;var i={Shift:16,Control:17,Alt:18,Meta:224};for(var o in i)$[o]=$[o+"Left"]=$[o+"Right"]=i[o];x.$codeToKeyCode=$,A.PRINTABLE_KEYS[173]="-";for(var n in A.FUNCTION_KEYS){var t=A.FUNCTION_KEYS[n].toLowerCase();A[t]=parseInt(n,10)}for(var n in A.PRINTABLE_KEYS){var t=A.PRINTABLE_KEYS[n].toLowerCase();A[t]=parseInt(n,10)}E.mixin(A,A.MODIFIER_KEYS),E.mixin(A,A.PRINTABLE_KEYS),E.mixin(A,A.FUNCTION_KEYS),A.enter=A.return,A.escape=A.esc,A.del=A.delete,function(){for(var e=["cmd","ctrl","alt","shift"],r=Math.pow(2,e.length);r--;)A.KEY_MODS[r]=e.filter(function(s){return r&A.KEY_MODS[s]}).join("-")+"-"}(),A.KEY_MODS[0]="",A.KEY_MODS[-1]="input-",E.mixin(x,A),x.default=x,x.keyCodeToString=function(e){var r=A[e];return typeof r!="string"&&(r=String.fromCharCode(e)),r.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(k,x,H){var E=k("./keys"),A=k("./useragent"),$=null,a=0,c;function i(){c=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return c={passive:!1},!0}})}catch{}}function o(){return c==null&&i(),c}function n(v,m,g){this.elem=v,this.type=m,this.callback=g}n.prototype.destroy=function(){e(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var t=x.addListener=function(v,m,g,d){v.addEventListener(m,g,o()),d&&d.$toDestroy.push(new n(v,m,g))},e=x.removeListener=function(v,m,g){v.removeEventListener(m,g,o())};x.stopEvent=function(v){return x.stopPropagation(v),x.preventDefault(v),!1},x.stopPropagation=function(v){v.stopPropagation&&v.stopPropagation()},x.preventDefault=function(v){v.preventDefault&&v.preventDefault()},x.getButton=function(v){return v.type=="dblclick"?0:v.type=="contextmenu"||A.isMac&&v.ctrlKey&&!v.altKey&&!v.shiftKey?2:v.button},x.capture=function(v,m,g){var d=v&&v.ownerDocument||document;function b(M){m&&m(M),g&&g(M),e(d,"mousemove",m),e(d,"mouseup",b),e(d,"dragstart",b)}return t(d,"mousemove",m),t(d,"mouseup",b),t(d,"dragstart",b),b},x.addMouseWheelListener=function(v,m,g){t(v,"wheel",function(d){var b=.15,M=d.deltaX||0,C=d.deltaY||0;switch(d.deltaMode){case d.DOM_DELTA_PIXEL:d.wheelX=M*b,d.wheelY=C*b;break;case d.DOM_DELTA_LINE:var S=15;d.wheelX=M*S,d.wheelY=C*S;break;case d.DOM_DELTA_PAGE:var R=150;d.wheelX=M*R,d.wheelY=C*R;break}m(d)},g)},x.addMultiMouseDownListener=function(v,m,g,d,b){var M=0,C,S,R,w={2:"dblclick",3:"tripleclick",4:"quadclick"};function y(f){if(x.getButton(f)!==0?M=0:f.detail>1?(M++,M>4&&(M=1)):M=1,A.isIE){var u=Math.abs(f.clientX-C)>5||Math.abs(f.clientY-S)>5;(!R||u)&&(M=1),R&&clearTimeout(R),R=setTimeout(function(){R=null},m[M-1]||600),M==1&&(C=f.clientX,S=f.clientY)}if(f._clicks=M,g[d]("mousedown",f),M>4)M=0;else if(M>1)return g[d](w[M],f)}Array.isArray(v)||(v=[v]),v.forEach(function(f){t(f,"mousedown",y,b)})};function r(v){return 0|(v.ctrlKey?1:0)|(v.altKey?2:0)|(v.shiftKey?4:0)|(v.metaKey?8:0)}x.getModifierString=function(v){return E.KEY_MODS[r(v)]};function s(v,m,g){var d=r(m);if(!g&&m.code&&(g=E.$codeToKeyCode[m.code]||g),!A.isMac&&$){if(m.getModifierState&&(m.getModifierState("OS")||m.getModifierState("Win"))&&(d|=8),$.altGr)if((3&d)!=3)$.altGr=0;else return;if(g===18||g===17){var b=m.location;if(g===17&&b===1)$[g]==1&&(a=m.timeStamp);else if(g===18&&d===3&&b===2){var M=m.timeStamp-a;M<50&&($.altGr=!0)}}}if(g in E.MODIFIER_KEYS&&(g=-1),!(!d&&g===13&&m.location===3&&(v(m,d,-g),m.defaultPrevented))){if(A.isChromeOS&&d&8){if(v(m,d,g),m.defaultPrevented)return;d&=-9}return!d&&!(g in E.FUNCTION_KEYS)&&!(g in E.PRINTABLE_KEYS)?!1:v(m,d,g)}}x.addCommandKeyListener=function(v,m,g){var d=null;t(v,"keydown",function(b){$[b.keyCode]=($[b.keyCode]||0)+1;var M=s(m,b,b.keyCode);return d=b.defaultPrevented,M},g),t(v,"keypress",function(b){d&&(b.ctrlKey||b.altKey||b.shiftKey||b.metaKey)&&(x.stopEvent(b),d=null)},g),t(v,"keyup",function(b){$[b.keyCode]=null},g),$||(l(),t(window,"focus",l))};function l(){$=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!A.isOldIE){var h=1;x.nextTick=function(v,m){m=m||window;var g="zero-timeout-message-"+h++,d=function(b){b.data==g&&(x.stopPropagation(b),e(m,"message",d),v())};t(m,"message",d),m.postMessage(g,"*")}}x.$idleBlocked=!1,x.onIdle=function(v,m){return setTimeout(function g(){x.$idleBlocked?setTimeout(g,100):v()},m)},x.$idleBlockId=null,x.blockIdle=function(v){x.$idleBlockId&&clearTimeout(x.$idleBlockId),x.$idleBlocked=!0,x.$idleBlockId=setTimeout(function(){x.$idleBlocked=!1},v||100)},x.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),x.nextFrame?x.nextFrame=x.nextFrame.bind(window):x.nextFrame=function(v){setTimeout(v,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(k,x,H){var E;H.exports={lineMode:!1,pasteCancelled:function(){return E&&E>Date.now()-50?!0:E=!1},cancel:function(){E=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(k,x,H){var E=k("../lib/event"),A=k("../config").nls,$=k("../lib/useragent"),a=k("../lib/dom"),c=k("../lib/lang"),i=k("../clipboard"),o=$.isChrome<18,n=$.isIE,t=$.isChrome>63,e=400,r=k("../lib/keys"),s=r.KEY_MODS,l=$.isIOS,h=l?/\s/:/\n/,v=$.isMobile,m=function(){function g(d,b){var M=this;this.host=b,this.text=a.createElement("textarea"),this.text.className="ace_text-input",this.text.setAttribute("wrap","off"),this.text.setAttribute("autocorrect","off"),this.text.setAttribute("autocapitalize","off"),this.text.setAttribute("spellcheck","false"),this.text.style.opacity="0",d.insertBefore(this.text,d.firstChild),this.copied=!1,this.pasted=!1,this.inComposition=!1,this.sendingText=!1,this.tempStyle="",v||(this.text.style.fontSize="1px"),this.commandMode=!1,this.ignoreFocusEvents=!1,this.lastValue="",this.lastSelectionStart=0,this.lastSelectionEnd=0,this.lastRestoreEnd=0,this.rowStart=Number.MAX_SAFE_INTEGER,this.rowEnd=Number.MIN_SAFE_INTEGER,this.numberOfExtraLines=0;try{this.$isFocused=document.activeElement===this.text}catch{}this.cancelComposition=this.cancelComposition.bind(this),this.setAriaOptions({role:"textbox"}),E.addListener(this.text,"blur",function(C){M.ignoreFocusEvents||(b.onBlur(C),M.$isFocused=!1)},b),E.addListener(this.text,"focus",function(C){if(!M.ignoreFocusEvents){if(M.$isFocused=!0,$.isEdge)try{if(!document.hasFocus())return}catch{}b.onFocus(C),$.isEdge?setTimeout(M.resetSelection.bind(M)):M.resetSelection()}},b),this.$focusScroll=!1,b.on("beforeEndOperation",function(){var C=b.curOp,S=C&&C.command&&C.command.name;if(S!="insertstring"){var R=S&&(C.docChanged||C.selectionChanged);M.inComposition&&R&&(M.lastValue=M.text.value="",M.onCompositionEnd()),M.resetSelection()}}),b.on("changeSelection",this.setAriaLabel.bind(this)),this.resetSelection=l?this.$resetSelectionIOS:this.$resetSelection,this.$isFocused&&b.onFocus(),this.inputHandler=null,this.afterContextMenu=!1,E.addCommandKeyListener(this.text,function(C,S,R){if(!M.inComposition)return b.onCommandKey(C,S,R)},b),E.addListener(this.text,"select",this.onSelect.bind(this),b),E.addListener(this.text,"input",this.onInput.bind(this),b),E.addListener(this.text,"cut",this.onCut.bind(this),b),E.addListener(this.text,"copy",this.onCopy.bind(this),b),E.addListener(this.text,"paste",this.onPaste.bind(this),b),(!("oncut"in this.text)||!("oncopy"in this.text)||!("onpaste"in this.text))&&E.addListener(d,"keydown",function(C){if(!($.isMac&&!C.metaKey||!C.ctrlKey))switch(C.keyCode){case 67:M.onCopy(C);break;case 86:M.onPaste(C);break;case 88:M.onCut(C);break}},b),this.syncComposition=c.delayedCall(this.onCompositionUpdate.bind(this),50).schedule.bind(null,null),E.addListener(this.text,"compositionstart",this.onCompositionStart.bind(this),b),E.addListener(this.text,"compositionupdate",this.onCompositionUpdate.bind(this),b),E.addListener(this.text,"keyup",this.onKeyup.bind(this),b),E.addListener(this.text,"keydown",this.syncComposition.bind(this),b),E.addListener(this.text,"compositionend",this.onCompositionEnd.bind(this),b),this.closeTimeout,E.addListener(this.text,"mouseup",this.$onContextMenu.bind(this),b),E.addListener(this.text,"mousedown",function(C){C.preventDefault(),M.onContextMenuClose()},b),E.addListener(b.renderer.scroller,"contextmenu",this.$onContextMenu.bind(this),b),E.addListener(this.text,"contextmenu",this.$onContextMenu.bind(this),b),l&&this.addIosSelectionHandler(d,b,this.text)}return g.prototype.addIosSelectionHandler=function(d,b,M){var C=this,S=null,R=!1;M.addEventListener("keydown",function(y){S&&clearTimeout(S),R=!0},!0),M.addEventListener("keyup",function(y){S=setTimeout(function(){R=!1},100)},!0);var w=function(y){if(document.activeElement===M&&!(R||C.inComposition||b.$mouseHandler.isMousePressed)&&!C.copied){var f=M.selectionStart,u=M.selectionEnd,p=null,L=0;if(f==0?p=r.up:f==1?p=r.home:u>C.lastSelectionEnd&&C.lastValue[u]==`
168
- `?p=r.end:f<C.lastSelectionStart&&C.lastValue[f-1]==" "?(p=r.left,L=s.option):f<C.lastSelectionStart||f==C.lastSelectionStart&&C.lastSelectionEnd!=C.lastSelectionStart&&f==u?p=r.left:u>C.lastSelectionEnd&&C.lastValue.slice(0,u).split(`
169
- `).length>2?p=r.down:u>C.lastSelectionEnd&&C.lastValue[u-1]==" "?(p=r.right,L=s.option):(u>C.lastSelectionEnd||u==C.lastSelectionEnd&&C.lastSelectionEnd!=C.lastSelectionStart&&f==u)&&(p=r.right),f!==u&&(L|=s.shift),p){var T=b.onCommandKey({},L,p);if(!T&&b.commands){p=r.keyCodeToString(p);var _=b.commands.findKeyCommand(L,p);_&&b.execCommand(_)}C.lastSelectionStart=f,C.lastSelectionEnd=u,C.resetSelection("")}}};document.addEventListener("selectionchange",w),b.on("destroy",function(){document.removeEventListener("selectionchange",w)})},g.prototype.onContextMenuClose=function(){var d=this;clearTimeout(this.closeTimeout),this.closeTimeout=setTimeout(function(){d.tempStyle&&(d.text.style.cssText=d.tempStyle,d.tempStyle=""),d.host.renderer.$isMousePressed=!1,d.host.renderer.$keepTextAreaAtCursor&&d.host.renderer.$moveTextAreaToCursor()},0)},g.prototype.$onContextMenu=function(d){this.host.textInput.onContextMenu(d),this.onContextMenuClose()},g.prototype.onKeyup=function(d){d.keyCode==27&&this.text.value.length<this.text.selectionStart&&(this.inComposition||(this.lastValue=this.text.value),this.lastSelectionStart=this.lastSelectionEnd=-1,this.resetSelection()),this.syncComposition()},g.prototype.cancelComposition=function(){this.ignoreFocusEvents=!0,this.text.blur(),this.text.focus(),this.ignoreFocusEvents=!1},g.prototype.onCompositionStart=function(d){if(!(this.inComposition||!this.host.onCompositionStart||this.host.$readOnly)&&(this.inComposition={},!this.commandMode)){d.data&&(this.inComposition.useTextareaForIME=!1),setTimeout(this.onCompositionUpdate.bind(this),0),this.host._signal("compositionStart"),this.host.on("mousedown",this.cancelComposition);var b=this.host.getSelectionRange();b.end.row=b.start.row,b.end.column=b.start.column,this.inComposition.markerRange=b,this.inComposition.selectionStart=this.lastSelectionStart,this.host.onCompositionStart(this.inComposition),this.inComposition.useTextareaForIME?(this.lastValue=this.text.value="",this.lastSelectionStart=0,this.lastSelectionEnd=0):(this.text.msGetInputContext&&(this.inComposition.context=this.text.msGetInputContext()),this.text.getInputContext&&(this.inComposition.context=this.text.getInputContext()))}},g.prototype.onCompositionUpdate=function(){if(!(!this.inComposition||!this.host.onCompositionUpdate||this.host.$readOnly)){if(this.commandMode)return this.cancelComposition();if(this.inComposition.useTextareaForIME)this.host.onCompositionUpdate(this.text.value);else{var d=this.text.value;this.sendText(d),this.inComposition.markerRange&&(this.inComposition.context&&(this.inComposition.markerRange.start.column=this.inComposition.selectionStart=this.inComposition.context.compositionStartOffset),this.inComposition.markerRange.end.column=this.inComposition.markerRange.start.column+this.lastSelectionEnd-this.inComposition.selectionStart+this.lastRestoreEnd)}}},g.prototype.onCompositionEnd=function(d){!this.host.onCompositionEnd||this.host.$readOnly||(this.inComposition=!1,this.host.onCompositionEnd(),this.host.off("mousedown",this.cancelComposition),d&&this.onInput())},g.prototype.onCut=function(d){this.doCopy(d,!0)},g.prototype.onCopy=function(d){this.doCopy(d,!1)},g.prototype.onPaste=function(d){var b=this.handleClipboardData(d);i.pasteCancelled()||(typeof b=="string"?(b&&this.host.onPaste(b,d),$.isIE&&setTimeout(this.resetSelection),E.preventDefault(d)):(this.text.value="",this.pasted=!0))},g.prototype.doCopy=function(d,b){var M=this,C=this.host.getCopyText();if(!C)return E.preventDefault(d);this.handleClipboardData(d,C)?(l&&(this.resetSelection(C),this.copied=C,setTimeout(function(){M.copied=!1},10)),b?this.host.onCut():this.host.onCopy(),E.preventDefault(d)):(this.copied=!0,this.text.value=C,this.text.select(),setTimeout(function(){M.copied=!1,M.resetSelection(),b?M.host.onCut():M.host.onCopy()}))},g.prototype.handleClipboardData=function(d,b,M){var C=d.clipboardData||window.clipboardData;if(!(!C||o)){var S=n||M?"Text":"text/plain";try{return b?C.setData(S,b)!==!1:C.getData(S)}catch(R){if(!M)return this.handleClipboardData(R,b,!0)}}},g.prototype.onInput=function(d){if(this.inComposition)return this.onCompositionUpdate();if(d&&d.inputType){if(d.inputType=="historyUndo")return this.host.execCommand("undo");if(d.inputType=="historyRedo")return this.host.execCommand("redo")}var b=this.text.value,M=this.sendText(b,!0);(b.length>e+100||h.test(M)||v&&this.lastSelectionStart<1&&this.lastSelectionStart==this.lastSelectionEnd)&&this.resetSelection()},g.prototype.sendText=function(d,b){if(this.afterContextMenu&&(this.afterContextMenu=!1),this.pasted)return this.resetSelection(),d&&this.host.onPaste(d),this.pasted=!1,"";for(var M=this.text.selectionStart,C=this.text.selectionEnd,S=this.lastSelectionStart,R=this.lastValue.length-this.lastSelectionEnd,w=d,y=d.length-M,f=d.length-C,u=0;S>0&&this.lastValue[u]==d[u];)u++,S--;for(w=w.slice(u),u=1;R>0&&this.lastValue.length-u>this.lastSelectionStart-1&&this.lastValue[this.lastValue.length-u]==d[d.length-u];)u++,R--;y-=u-1,f-=u-1;var p=w.length-u+1;if(p<0&&(S=-p,p=0),w=w.slice(0,p),!b&&!w&&!y&&!S&&!R&&!f)return"";this.sendingText=!0;var L=!1;return $.isAndroid&&w==". "&&(w=" ",L=!0),w&&!S&&!R&&!y&&!f||this.commandMode?this.host.onTextInput(w):this.host.onTextInput(w,{extendLeft:S,extendRight:R,restoreStart:y,restoreEnd:f}),this.sendingText=!1,this.lastValue=d,this.lastSelectionStart=M,this.lastSelectionEnd=C,this.lastRestoreEnd=f,L?`
167
+ `}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(k,L,H){L.isDark=!1,L.cssClass="ace-tm",L.cssText=k("./textmate-css"),L.$id="ace/theme/textmate";var E=k("../lib/dom");E.importCssString(L.cssText,L.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(k,L,H){"no use strict";var E=k("./lib/lang"),A=k("./lib/net"),$=k("./lib/dom"),a=k("./lib/app_config").AppConfig;H.exports=L=new a;var c={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};L.get=function(t){if(!c.hasOwnProperty(t))throw new Error("Unknown config key: "+t);return c[t]},L.set=function(t,e){if(c.hasOwnProperty(t))c[t]=e;else if(this.setDefaultValue("",t,e)==!1)throw new Error("Unknown config key: "+t);t=="useStrictCSP"&&$.useStrictCSP(e)},L.all=function(){return E.copyObject(c)},L.$modes={},L.moduleUrl=function(t,e){if(c.$moduleUrls[t])return c.$moduleUrls[t];var r=t.split("/");e=e||r[r.length-2]||"";var s=e=="snippets"?"/":"-",l=r[r.length-1];if(e=="worker"&&s=="-"){var h=new RegExp("^"+e+"[\\-_]|[\\-_]"+e+"$","g");l=l.replace(h,"")}(!l||l==e)&&r.length>1&&(l=r[r.length-2]);var v=c[e+"Path"];return v==null?v=c.basePath:s=="/"&&(e=s=""),v&&v.slice(-1)!="/"&&(v+="/"),v+e+s+l+this.get("suffix")},L.setModuleUrl=function(t,e){return c.$moduleUrls[t]=e};var i=function(t,e){if(t==="ace/theme/textmate"||t==="./theme/textmate")return e(null,k("./theme/textmate"));if(o)return o(t,e);console.error("loader is not configured")},o;L.setLoader=function(t){o=t},L.dynamicModules=Object.create(null),L.$loading={},L.$loaded={},L.loadModule=function(t,e){var r;if(Array.isArray(t))var s=t[0],l=t[1];else if(typeof t=="string")var l=t;var h=function(v){if(v&&!L.$loading[l])return e&&e(v);if(L.$loading[l]||(L.$loading[l]=[]),L.$loading[l].push(e),!(L.$loading[l].length>1)){var m=function(){i(l,function(g,d){d&&(L.$loaded[l]=d),L._emit("load.module",{name:l,module:d});var b=L.$loading[l];L.$loading[l]=null,b.forEach(function(M){M&&M(d)})})};if(!L.get("packaged"))return m();A.loadScript(L.moduleUrl(l,s),m),n()}};if(L.dynamicModules[l])L.dynamicModules[l]().then(function(v){v.default?h(v.default):h(v)});else{try{r=this.$require(l)}catch{}h(r||L.$loaded[l])}},L.$require=function(t){if(typeof H.require=="function"){var e="require";return H[e](t)}},L.setModuleLoader=function(t,e){L.dynamicModules[t]=e};var n=function(){!c.basePath&&!c.workerPath&&!c.modePath&&!c.themePath&&!Object.keys(c.$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"),n=function(){})};L.version="1.43.2"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(k,L,H){k("./lib/fixoldbrowsers");var E=k("./config");E.setLoader(function(c,i){k([c],function(o){i(null,o)})});var A=function(){return this||typeof window<"u"&&window}();H.exports=function(c){E.init=$,E.$require=k,c.require=k},$(!0);function $(c){if(!(!A||!A.document)){E.set("packaged",c||k.packaged||H.packaged||A.define&&(void 0).packaged);var i={},o="",n=document.currentScript||document._currentScript,t=n&&n.ownerDocument||document;n&&n.src&&(o=n.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var e=t.getElementsByTagName("script"),r=0;r<e.length;r++){var s=e[r],l=s.src||s.getAttribute("src");if(l){for(var h=s.attributes,v=0,m=h.length;v<m;v++){var g=h[v];g.name.indexOf("data-ace-")===0&&(i[a(g.name.replace(/^data-ace-/,""))]=g.value)}var d=l.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);d&&(o=d[1])}}o&&(i.base=i.base||o,i.packaged=!0),i.basePath=i.base,i.workerPath=i.workerPath||i.base,i.modePath=i.modePath||i.base,i.themePath=i.themePath||i.base,delete i.base;for(var b in i)typeof i[b]<"u"&&E.set(b,i[b])}}function a(c){return c.replace(/-(.)/g,function(i,o){return o.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(k,L,H){var E=function(){function A($,a,c,i){this.start={row:$,column:a},this.end={row:c,column:i}}return A.prototype.isEqual=function($){return this.start.row===$.start.row&&this.end.row===$.end.row&&this.start.column===$.start.column&&this.end.column===$.end.column},A.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},A.prototype.contains=function($,a){return this.compare($,a)==0},A.prototype.compareRange=function($){var a,c=$.end,i=$.start;return a=this.compare(c.row,c.column),a==1?(a=this.compare(i.row,i.column),a==1?2:a==0?1:0):a==-1?-2:(a=this.compare(i.row,i.column),a==-1?-1:a==1?42:0)},A.prototype.comparePoint=function($){return this.compare($.row,$.column)},A.prototype.containsRange=function($){return this.comparePoint($.start)==0&&this.comparePoint($.end)==0},A.prototype.intersects=function($){var a=this.compareRange($);return a==-1||a==0||a==1},A.prototype.isEnd=function($,a){return this.end.row==$&&this.end.column==a},A.prototype.isStart=function($,a){return this.start.row==$&&this.start.column==a},A.prototype.setStart=function($,a){typeof $=="object"?(this.start.column=$.column,this.start.row=$.row):(this.start.row=$,this.start.column=a)},A.prototype.setEnd=function($,a){typeof $=="object"?(this.end.column=$.column,this.end.row=$.row):(this.end.row=$,this.end.column=a)},A.prototype.inside=function($,a){return this.compare($,a)==0?!(this.isEnd($,a)||this.isStart($,a)):!1},A.prototype.insideStart=function($,a){return this.compare($,a)==0?!this.isEnd($,a):!1},A.prototype.insideEnd=function($,a){return this.compare($,a)==0?!this.isStart($,a):!1},A.prototype.compare=function($,a){return!this.isMultiLine()&&$===this.start.row?a<this.start.column?-1:a>this.end.column?1:0:$<this.start.row?-1:$>this.end.row?1:this.start.row===$?a>=this.start.column?0:-1:this.end.row===$?a<=this.end.column?0:1:0},A.prototype.compareStart=function($,a){return this.start.row==$&&this.start.column==a?-1:this.compare($,a)},A.prototype.compareEnd=function($,a){return this.end.row==$&&this.end.column==a?1:this.compare($,a)},A.prototype.compareInside=function($,a){return this.end.row==$&&this.end.column==a?1:this.start.row==$&&this.start.column==a?-1:this.compare($,a)},A.prototype.clipRows=function($,a){if(this.end.row>a)var c={row:a+1,column:0};else if(this.end.row<$)var c={row:$,column:0};if(this.start.row>a)var i={row:a+1,column:0};else if(this.start.row<$)var i={row:$,column:0};return A.fromPoints(i||this.start,c||this.end)},A.prototype.extend=function($,a){var c=this.compare($,a);if(c==0)return this;if(c==-1)var i={row:$,column:a};else var o={row:$,column:a};return A.fromPoints(i||this.start,o||this.end)},A.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},A.prototype.isMultiLine=function(){return this.start.row!==this.end.row},A.prototype.clone=function(){return A.fromPoints(this.start,this.end)},A.prototype.collapseRows=function(){return this.end.column==0?new A(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new A(this.start.row,0,this.end.row,0)},A.prototype.toScreenRange=function($){var a=$.documentToScreenPosition(this.start),c=$.documentToScreenPosition(this.end);return new A(a.row,a.column,c.row,c.column)},A.prototype.moveBy=function($,a){this.start.row+=$,this.start.column+=a,this.end.row+=$,this.end.column+=a},A}();E.fromPoints=function(A,$){return new E(A.row,A.column,$.row,$.column)},E.comparePoints=function(A,$){return A.row-$.row||A.column-$.column},L.Range=E}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(k,L,H){for(var E=k("./oop"),A={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:"*"}},$={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},a=0;a<10;a++)$["Digit"+a]=48+a,$["Numpad"+a]=96+a,A.PRINTABLE_KEYS[48+a]=""+a,A.FUNCTION_KEYS[96+a]="Numpad"+a;for(var a=65;a<91;a++){var c=String.fromCharCode(a+32);$["Key"+c.toUpperCase()]=a,A.PRINTABLE_KEYS[a]=c}for(var a=1;a<13;a++)$["F"+a]=111+a,A.FUNCTION_KEYS[111+a]="F"+a;var i={Shift:16,Control:17,Alt:18,Meta:224};for(var o in i)$[o]=$[o+"Left"]=$[o+"Right"]=i[o];L.$codeToKeyCode=$,A.PRINTABLE_KEYS[173]="-";for(var n in A.FUNCTION_KEYS){var t=A.FUNCTION_KEYS[n].toLowerCase();A[t]=parseInt(n,10)}for(var n in A.PRINTABLE_KEYS){var t=A.PRINTABLE_KEYS[n].toLowerCase();A[t]=parseInt(n,10)}E.mixin(A,A.MODIFIER_KEYS),E.mixin(A,A.PRINTABLE_KEYS),E.mixin(A,A.FUNCTION_KEYS),A.enter=A.return,A.escape=A.esc,A.del=A.delete,function(){for(var e=["cmd","ctrl","alt","shift"],r=Math.pow(2,e.length);r--;)A.KEY_MODS[r]=e.filter(function(s){return r&A.KEY_MODS[s]}).join("-")+"-"}(),A.KEY_MODS[0]="",A.KEY_MODS[-1]="input-",E.mixin(L,A),L.default=L,L.keyCodeToString=function(e){var r=A[e];return typeof r!="string"&&(r=String.fromCharCode(e)),r.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(k,L,H){var E=k("./keys"),A=k("./useragent"),$=null,a=0,c;function i(){c=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return c={passive:!1},!0}})}catch{}}function o(){return c==null&&i(),c}function n(v,m,g){this.elem=v,this.type=m,this.callback=g}n.prototype.destroy=function(){e(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var t=L.addListener=function(v,m,g,d){v.addEventListener(m,g,o()),d&&d.$toDestroy.push(new n(v,m,g))},e=L.removeListener=function(v,m,g){v.removeEventListener(m,g,o())};L.stopEvent=function(v){return L.stopPropagation(v),L.preventDefault(v),!1},L.stopPropagation=function(v){v.stopPropagation&&v.stopPropagation()},L.preventDefault=function(v){v.preventDefault&&v.preventDefault()},L.getButton=function(v){return v.type=="dblclick"?0:v.type=="contextmenu"||A.isMac&&v.ctrlKey&&!v.altKey&&!v.shiftKey?2:v.button},L.capture=function(v,m,g){var d=v&&v.ownerDocument||document;function b(M){m&&m(M),g&&g(M),e(d,"mousemove",m),e(d,"mouseup",b),e(d,"dragstart",b)}return t(d,"mousemove",m),t(d,"mouseup",b),t(d,"dragstart",b),b},L.addMouseWheelListener=function(v,m,g){t(v,"wheel",function(d){var b=.15,M=d.deltaX||0,C=d.deltaY||0;switch(d.deltaMode){case d.DOM_DELTA_PIXEL:d.wheelX=M*b,d.wheelY=C*b;break;case d.DOM_DELTA_LINE:var S=15;d.wheelX=M*S,d.wheelY=C*S;break;case d.DOM_DELTA_PAGE:var R=150;d.wheelX=M*R,d.wheelY=C*R;break}m(d)},g)},L.addMultiMouseDownListener=function(v,m,g,d,b){var M=0,C,S,R,w={2:"dblclick",3:"tripleclick",4:"quadclick"};function y(f){if(L.getButton(f)!==0?M=0:f.detail>1?(M++,M>4&&(M=1)):M=1,A.isIE){var u=Math.abs(f.clientX-C)>5||Math.abs(f.clientY-S)>5;(!R||u)&&(M=1),R&&clearTimeout(R),R=setTimeout(function(){R=null},m[M-1]||600),M==1&&(C=f.clientX,S=f.clientY)}if(f._clicks=M,g[d]("mousedown",f),M>4)M=0;else if(M>1)return g[d](w[M],f)}Array.isArray(v)||(v=[v]),v.forEach(function(f){t(f,"mousedown",y,b)})};function r(v){return 0|(v.ctrlKey?1:0)|(v.altKey?2:0)|(v.shiftKey?4:0)|(v.metaKey?8:0)}L.getModifierString=function(v){return E.KEY_MODS[r(v)]};function s(v,m,g){var d=r(m);if(!g&&m.code&&(g=E.$codeToKeyCode[m.code]||g),!A.isMac&&$){if(m.getModifierState&&(m.getModifierState("OS")||m.getModifierState("Win"))&&(d|=8),$.altGr)if((3&d)!=3)$.altGr=0;else return;if(g===18||g===17){var b=m.location;if(g===17&&b===1)$[g]==1&&(a=m.timeStamp);else if(g===18&&d===3&&b===2){var M=m.timeStamp-a;M<50&&($.altGr=!0)}}}if(g in E.MODIFIER_KEYS&&(g=-1),!(!d&&g===13&&m.location===3&&(v(m,d,-g),m.defaultPrevented))){if(A.isChromeOS&&d&8){if(v(m,d,g),m.defaultPrevented)return;d&=-9}return!d&&!(g in E.FUNCTION_KEYS)&&!(g in E.PRINTABLE_KEYS)?!1:v(m,d,g)}}L.addCommandKeyListener=function(v,m,g){var d=null;t(v,"keydown",function(b){$[b.keyCode]=($[b.keyCode]||0)+1;var M=s(m,b,b.keyCode);return d=b.defaultPrevented,M},g),t(v,"keypress",function(b){d&&(b.ctrlKey||b.altKey||b.shiftKey||b.metaKey)&&(L.stopEvent(b),d=null)},g),t(v,"keyup",function(b){$[b.keyCode]=null},g),$||(l(),t(window,"focus",l))};function l(){$=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!A.isOldIE){var h=1;L.nextTick=function(v,m){m=m||window;var g="zero-timeout-message-"+h++,d=function(b){b.data==g&&(L.stopPropagation(b),e(m,"message",d),v())};t(m,"message",d),m.postMessage(g,"*")}}L.$idleBlocked=!1,L.onIdle=function(v,m){return setTimeout(function g(){L.$idleBlocked?setTimeout(g,100):v()},m)},L.$idleBlockId=null,L.blockIdle=function(v){L.$idleBlockId&&clearTimeout(L.$idleBlockId),L.$idleBlocked=!0,L.$idleBlockId=setTimeout(function(){L.$idleBlocked=!1},v||100)},L.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),L.nextFrame?L.nextFrame=L.nextFrame.bind(window):L.nextFrame=function(v){setTimeout(v,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(k,L,H){var E;H.exports={lineMode:!1,pasteCancelled:function(){return E&&E>Date.now()-50?!0:E=!1},cancel:function(){E=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(k,L,H){var E=k("../lib/event"),A=k("../config").nls,$=k("../lib/useragent"),a=k("../lib/dom"),c=k("../lib/lang"),i=k("../clipboard"),o=$.isChrome<18,n=$.isIE,t=$.isChrome>63,e=400,r=k("../lib/keys"),s=r.KEY_MODS,l=$.isIOS,h=l?/\s/:/\n/,v=$.isMobile,m=function(){function g(d,b){var M=this;this.host=b,this.text=a.createElement("textarea"),this.text.className="ace_text-input",this.text.setAttribute("wrap","off"),this.text.setAttribute("autocorrect","off"),this.text.setAttribute("autocapitalize","off"),this.text.setAttribute("spellcheck","false"),this.text.style.opacity="0",d.insertBefore(this.text,d.firstChild),this.copied=!1,this.pasted=!1,this.inComposition=!1,this.sendingText=!1,this.tempStyle="",v||(this.text.style.fontSize="1px"),this.commandMode=!1,this.ignoreFocusEvents=!1,this.lastValue="",this.lastSelectionStart=0,this.lastSelectionEnd=0,this.lastRestoreEnd=0,this.rowStart=Number.MAX_SAFE_INTEGER,this.rowEnd=Number.MIN_SAFE_INTEGER,this.numberOfExtraLines=0;try{this.$isFocused=document.activeElement===this.text}catch{}this.cancelComposition=this.cancelComposition.bind(this),this.setAriaOptions({role:"textbox"}),E.addListener(this.text,"blur",function(C){M.ignoreFocusEvents||(b.onBlur(C),M.$isFocused=!1)},b),E.addListener(this.text,"focus",function(C){if(!M.ignoreFocusEvents){if(M.$isFocused=!0,$.isEdge)try{if(!document.hasFocus())return}catch{}b.onFocus(C),$.isEdge?setTimeout(M.resetSelection.bind(M)):M.resetSelection()}},b),this.$focusScroll=!1,b.on("beforeEndOperation",function(){var C=b.curOp,S=C&&C.command&&C.command.name;if(S!="insertstring"){var R=S&&(C.docChanged||C.selectionChanged);M.inComposition&&R&&(M.lastValue=M.text.value="",M.onCompositionEnd()),M.resetSelection()}}),b.on("changeSelection",this.setAriaLabel.bind(this)),this.resetSelection=l?this.$resetSelectionIOS:this.$resetSelection,this.$isFocused&&b.onFocus(),this.inputHandler=null,this.afterContextMenu=!1,E.addCommandKeyListener(this.text,function(C,S,R){if(!M.inComposition)return b.onCommandKey(C,S,R)},b),E.addListener(this.text,"select",this.onSelect.bind(this),b),E.addListener(this.text,"input",this.onInput.bind(this),b),E.addListener(this.text,"cut",this.onCut.bind(this),b),E.addListener(this.text,"copy",this.onCopy.bind(this),b),E.addListener(this.text,"paste",this.onPaste.bind(this),b),(!("oncut"in this.text)||!("oncopy"in this.text)||!("onpaste"in this.text))&&E.addListener(d,"keydown",function(C){if(!($.isMac&&!C.metaKey||!C.ctrlKey))switch(C.keyCode){case 67:M.onCopy(C);break;case 86:M.onPaste(C);break;case 88:M.onCut(C);break}},b),this.syncComposition=c.delayedCall(this.onCompositionUpdate.bind(this),50).schedule.bind(null,null),E.addListener(this.text,"compositionstart",this.onCompositionStart.bind(this),b),E.addListener(this.text,"compositionupdate",this.onCompositionUpdate.bind(this),b),E.addListener(this.text,"keyup",this.onKeyup.bind(this),b),E.addListener(this.text,"keydown",this.syncComposition.bind(this),b),E.addListener(this.text,"compositionend",this.onCompositionEnd.bind(this),b),this.closeTimeout,E.addListener(this.text,"mouseup",this.$onContextMenu.bind(this),b),E.addListener(this.text,"mousedown",function(C){C.preventDefault(),M.onContextMenuClose()},b),E.addListener(b.renderer.scroller,"contextmenu",this.$onContextMenu.bind(this),b),E.addListener(this.text,"contextmenu",this.$onContextMenu.bind(this),b),l&&this.addIosSelectionHandler(d,b,this.text)}return g.prototype.addIosSelectionHandler=function(d,b,M){var C=this,S=null,R=!1;M.addEventListener("keydown",function(y){S&&clearTimeout(S),R=!0},!0),M.addEventListener("keyup",function(y){S=setTimeout(function(){R=!1},100)},!0);var w=function(y){if(document.activeElement===M&&!(R||C.inComposition||b.$mouseHandler.isMousePressed)&&!C.copied){var f=M.selectionStart,u=M.selectionEnd,p=null,x=0;if(f==0?p=r.up:f==1?p=r.home:u>C.lastSelectionEnd&&C.lastValue[u]==`
168
+ `?p=r.end:f<C.lastSelectionStart&&C.lastValue[f-1]==" "?(p=r.left,x=s.option):f<C.lastSelectionStart||f==C.lastSelectionStart&&C.lastSelectionEnd!=C.lastSelectionStart&&f==u?p=r.left:u>C.lastSelectionEnd&&C.lastValue.slice(0,u).split(`
169
+ `).length>2?p=r.down:u>C.lastSelectionEnd&&C.lastValue[u-1]==" "?(p=r.right,x=s.option):(u>C.lastSelectionEnd||u==C.lastSelectionEnd&&C.lastSelectionEnd!=C.lastSelectionStart&&f==u)&&(p=r.right),f!==u&&(x|=s.shift),p){var T=b.onCommandKey({},x,p);if(!T&&b.commands){p=r.keyCodeToString(p);var _=b.commands.findKeyCommand(x,p);_&&b.execCommand(_)}C.lastSelectionStart=f,C.lastSelectionEnd=u,C.resetSelection("")}}};document.addEventListener("selectionchange",w),b.on("destroy",function(){document.removeEventListener("selectionchange",w)})},g.prototype.onContextMenuClose=function(){var d=this;clearTimeout(this.closeTimeout),this.closeTimeout=setTimeout(function(){d.tempStyle&&(d.text.style.cssText=d.tempStyle,d.tempStyle=""),d.host.renderer.$isMousePressed=!1,d.host.renderer.$keepTextAreaAtCursor&&d.host.renderer.$moveTextAreaToCursor()},0)},g.prototype.$onContextMenu=function(d){this.host.textInput.onContextMenu(d),this.onContextMenuClose()},g.prototype.onKeyup=function(d){d.keyCode==27&&this.text.value.length<this.text.selectionStart&&(this.inComposition||(this.lastValue=this.text.value),this.lastSelectionStart=this.lastSelectionEnd=-1,this.resetSelection()),this.syncComposition()},g.prototype.cancelComposition=function(){this.ignoreFocusEvents=!0,this.text.blur(),this.text.focus(),this.ignoreFocusEvents=!1},g.prototype.onCompositionStart=function(d){if(!(this.inComposition||!this.host.onCompositionStart||this.host.$readOnly)&&(this.inComposition={},!this.commandMode)){d.data&&(this.inComposition.useTextareaForIME=!1),setTimeout(this.onCompositionUpdate.bind(this),0),this.host._signal("compositionStart"),this.host.on("mousedown",this.cancelComposition);var b=this.host.getSelectionRange();b.end.row=b.start.row,b.end.column=b.start.column,this.inComposition.markerRange=b,this.inComposition.selectionStart=this.lastSelectionStart,this.host.onCompositionStart(this.inComposition),this.inComposition.useTextareaForIME?(this.lastValue=this.text.value="",this.lastSelectionStart=0,this.lastSelectionEnd=0):(this.text.msGetInputContext&&(this.inComposition.context=this.text.msGetInputContext()),this.text.getInputContext&&(this.inComposition.context=this.text.getInputContext()))}},g.prototype.onCompositionUpdate=function(){if(!(!this.inComposition||!this.host.onCompositionUpdate||this.host.$readOnly)){if(this.commandMode)return this.cancelComposition();if(this.inComposition.useTextareaForIME)this.host.onCompositionUpdate(this.text.value);else{var d=this.text.value;this.sendText(d),this.inComposition.markerRange&&(this.inComposition.context&&(this.inComposition.markerRange.start.column=this.inComposition.selectionStart=this.inComposition.context.compositionStartOffset),this.inComposition.markerRange.end.column=this.inComposition.markerRange.start.column+this.lastSelectionEnd-this.inComposition.selectionStart+this.lastRestoreEnd)}}},g.prototype.onCompositionEnd=function(d){!this.host.onCompositionEnd||this.host.$readOnly||(this.inComposition=!1,this.host.onCompositionEnd(),this.host.off("mousedown",this.cancelComposition),d&&this.onInput())},g.prototype.onCut=function(d){this.doCopy(d,!0)},g.prototype.onCopy=function(d){this.doCopy(d,!1)},g.prototype.onPaste=function(d){var b=this.handleClipboardData(d);i.pasteCancelled()||(typeof b=="string"?(b&&this.host.onPaste(b,d),$.isIE&&setTimeout(this.resetSelection),E.preventDefault(d)):(this.text.value="",this.pasted=!0))},g.prototype.doCopy=function(d,b){var M=this,C=this.host.getCopyText();if(!C)return E.preventDefault(d);this.handleClipboardData(d,C)?(l&&(this.resetSelection(C),this.copied=C,setTimeout(function(){M.copied=!1},10)),b?this.host.onCut():this.host.onCopy(),E.preventDefault(d)):(this.copied=!0,this.text.value=C,this.text.select(),setTimeout(function(){M.copied=!1,M.resetSelection(),b?M.host.onCut():M.host.onCopy()}))},g.prototype.handleClipboardData=function(d,b,M){var C=d.clipboardData||window.clipboardData;if(!(!C||o)){var S=n||M?"Text":"text/plain";try{return b?C.setData(S,b)!==!1:C.getData(S)}catch(R){if(!M)return this.handleClipboardData(R,b,!0)}}},g.prototype.onInput=function(d){if(this.inComposition)return this.onCompositionUpdate();if(d&&d.inputType){if(d.inputType=="historyUndo")return this.host.execCommand("undo");if(d.inputType=="historyRedo")return this.host.execCommand("redo")}var b=this.text.value,M=this.sendText(b,!0);(b.length>e+100||h.test(M)||v&&this.lastSelectionStart<1&&this.lastSelectionStart==this.lastSelectionEnd)&&this.resetSelection()},g.prototype.sendText=function(d,b){if(this.afterContextMenu&&(this.afterContextMenu=!1),this.pasted)return this.resetSelection(),d&&this.host.onPaste(d),this.pasted=!1,"";for(var M=this.text.selectionStart,C=this.text.selectionEnd,S=this.lastSelectionStart,R=this.lastValue.length-this.lastSelectionEnd,w=d,y=d.length-M,f=d.length-C,u=0;S>0&&this.lastValue[u]==d[u];)u++,S--;for(w=w.slice(u),u=1;R>0&&this.lastValue.length-u>this.lastSelectionStart-1&&this.lastValue[this.lastValue.length-u]==d[d.length-u];)u++,R--;y-=u-1,f-=u-1;var p=w.length-u+1;if(p<0&&(S=-p,p=0),w=w.slice(0,p),!b&&!w&&!y&&!S&&!R&&!f)return"";this.sendingText=!0;var x=!1;return $.isAndroid&&w==". "&&(w=" ",x=!0),w&&!S&&!R&&!y&&!f||this.commandMode?this.host.onTextInput(w):this.host.onTextInput(w,{extendLeft:S,extendRight:R,restoreStart:y,restoreEnd:f}),this.sendingText=!1,this.lastValue=d,this.lastSelectionStart=M,this.lastSelectionEnd=C,this.lastRestoreEnd=f,x?`
170
170
  `:w},g.prototype.onSelect=function(d){var b=this;if(!this.inComposition){var M=function(C){return C.selectionStart===0&&C.selectionEnd>=b.lastValue.length&&C.value===b.lastValue&&b.lastValue&&C.selectionEnd!==b.lastSelectionEnd};this.copied?this.copied=!1:M(this.text)?(this.host.selectAll(),this.resetSelection()):v&&this.text.selectionStart!=this.lastSelectionStart&&this.resetSelection()}},g.prototype.$resetSelectionIOS=function(d){if(!(!this.$isFocused||this.copied&&!d||this.sendingText)){d||(d="");var b=`
171
171
  ab`+d+`cde fg
172
172
  `;b!=this.text.value&&(this.text.value=this.lastValue=b);var M=4,C=4+(d.length||(this.host.selection.isEmpty()?0:1));(this.lastSelectionStart!=M||this.lastSelectionEnd!=C)&&this.text.setSelectionRange(M,C),this.lastSelectionStart=M,this.lastSelectionEnd=C}},g.prototype.$resetSelection=function(){var d=this;if(!(this.inComposition||this.sendingText)&&!(!this.$isFocused&&!this.afterContextMenu)){this.inComposition=!0;var b=0,M=0,C="",S=function(_,I){for(var O=I,z=1;z<=_-d.rowStart&&z<2*d.numberOfExtraLines+1;z++)O+=d.host.session.getLine(_-z).length+1;return O};if(this.host.session){var R=this.host.selection,w=R.getRange(),y=R.cursor.row;y===this.rowEnd+1?(this.rowStart=this.rowEnd+1,this.rowEnd=this.rowStart+2*this.numberOfExtraLines):y===this.rowStart-1?(this.rowEnd=this.rowStart-1,this.rowStart=this.rowEnd-2*this.numberOfExtraLines):(y<this.rowStart-1||y>this.rowEnd+1)&&(this.rowStart=y>this.numberOfExtraLines?y-this.numberOfExtraLines:0,this.rowEnd=y>this.numberOfExtraLines?y+this.numberOfExtraLines:2*this.numberOfExtraLines);for(var f=[],u=this.rowStart;u<=this.rowEnd;u++)f.push(this.host.session.getLine(u));if(C=f.join(`
173
173
  `),b=S(w.start.row,w.start.column),M=S(w.end.row,w.end.column),w.start.row<this.rowStart){var p=this.host.session.getLine(this.rowStart-1);b=w.start.row<this.rowStart-1?0:b,M+=p.length+1,C=p+`
174
- `+C}else if(w.end.row>this.rowEnd){var L=this.host.session.getLine(this.rowEnd+1);M=w.end.row>this.rowEnd+1?L.length:w.end.column,M+=C.length+1,C=C+`
175
- `+L}else v&&y>0&&(C=`
174
+ `+C}else if(w.end.row>this.rowEnd){var x=this.host.session.getLine(this.rowEnd+1);M=w.end.row>this.rowEnd+1?x.length:w.end.column,M+=C.length+1,C=C+`
175
+ `+x}else v&&y>0&&(C=`
176
176
  `+C,M+=1,b+=1);C.length>e&&(b<e&&M<e?C=C.slice(0,e):(C=`
177
177
  `,b==M?b=M=0:(b=0,M=1)));var T=C+`
178
178
 
179
- `;T!=this.lastValue&&(this.text.value=this.lastValue=T,this.lastSelectionStart=this.lastSelectionEnd=T.length)}if(this.afterContextMenu&&(this.lastSelectionStart=this.text.selectionStart,this.lastSelectionEnd=this.text.selectionEnd),this.lastSelectionEnd!=M||this.lastSelectionStart!=b||this.text.selectionEnd!=this.lastSelectionEnd)try{this.text.setSelectionRange(b,M),this.lastSelectionStart=b,this.lastSelectionEnd=M}catch{}this.inComposition=!1}},g.prototype.setHost=function(d){this.host=d},g.prototype.setNumberOfExtraLines=function(d){if(this.rowStart=Number.MAX_SAFE_INTEGER,this.rowEnd=Number.MIN_SAFE_INTEGER,d<0){this.numberOfExtraLines=0;return}this.numberOfExtraLines=d},g.prototype.setAriaLabel=function(){var d="";if(this.host.$textInputAriaLabel&&(d+="".concat(this.host.$textInputAriaLabel,", ")),this.host.session){var b=this.host.session.selection.cursor.row;d+=A("text-input.aria-label","Cursor at row $0",[b+1])}this.text.setAttribute("aria-label",d)},g.prototype.setAriaOptions=function(d){d.activeDescendant?(this.text.setAttribute("aria-haspopup","true"),this.text.setAttribute("aria-autocomplete",d.inline?"both":"list"),this.text.setAttribute("aria-activedescendant",d.activeDescendant)):(this.text.setAttribute("aria-haspopup","false"),this.text.setAttribute("aria-autocomplete","both"),this.text.removeAttribute("aria-activedescendant")),d.role&&this.text.setAttribute("role",d.role),d.setLabel&&(this.text.setAttribute("aria-roledescription",A("text-input.aria-roledescription","editor")),this.setAriaLabel())},g.prototype.focus=function(){var d=this;if(this.setAriaOptions({setLabel:this.host.renderer.enableKeyboardAccessibility}),this.tempStyle||t||this.$focusScroll=="browser")return this.text.focus({preventScroll:!0});var b=this.text.style.top;this.text.style.position="fixed",this.text.style.top="0px";try{var M=this.text.getBoundingClientRect().top!=0}catch{return}var C=[];if(M)for(var S=this.text.parentElement;S&&S.nodeType==1;)C.push(S),S.setAttribute("ace_nocontext","true"),!S.parentElement&&S.getRootNode?S=S.getRootNode().host:S=S.parentElement;this.text.focus({preventScroll:!0}),M&&C.forEach(function(R){R.removeAttribute("ace_nocontext")}),setTimeout(function(){d.text.style.position="",d.text.style.top=="0px"&&(d.text.style.top=b)},0)},g.prototype.blur=function(){this.text.blur()},g.prototype.isFocused=function(){return this.$isFocused},g.prototype.setInputHandler=function(d){this.inputHandler=d},g.prototype.getInputHandler=function(){return this.inputHandler},g.prototype.getElement=function(){return this.text},g.prototype.setCommandMode=function(d){this.commandMode=d,this.text.readOnly=!1},g.prototype.setReadOnly=function(d){this.commandMode||(this.text.readOnly=d)},g.prototype.setCopyWithEmptySelection=function(d){},g.prototype.onContextMenu=function(d){this.afterContextMenu=!0,this.resetSelection(),this.host._emit("nativecontextmenu",{target:this.host,domEvent:d}),this.moveToMouse(d,!0)},g.prototype.moveToMouse=function(d,b){var M=this;this.tempStyle||(this.tempStyle=this.text.style.cssText),this.text.style.cssText=(b?"z-index:100000;":"")+($.isIE?"opacity:0.1;":"")+"text-indent: -"+(this.lastSelectionStart+this.lastSelectionEnd)*this.host.renderer.characterWidth*.5+"px;";var C=this.host.container.getBoundingClientRect(),S=a.computedStyle(this.host.container),R=C.top+(parseInt(S.borderTopWidth)||0),w=C.left+(parseInt(S.borderLeftWidth)||0),y=C.bottom-R-this.text.clientHeight-2,f=function(u){a.translate(M.text,u.clientX-w-2,Math.min(u.clientY-R-2,y))};f(d),d.type=="mousedown"&&(this.host.renderer.$isMousePressed=!0,clearTimeout(this.closeTimeout),$.isWin&&E.capture(this.host.container,f,this.onContextMenuClose.bind(this)))},g.prototype.destroy=function(){this.text.parentElement&&this.text.parentElement.removeChild(this.text)},g}();x.TextInput=m,x.$setUserAgentForTests=function(g,d){v=g,l=d}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(k,x,H){var E=k("../lib/useragent"),A=0,$=550,a=function(){function o(n){n.$clickSelection=null;var t=n.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(n)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(n)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(n)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(n)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(n));var e=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];e.forEach(function(r){n[r]=this[r]},this),n.selectByLines=this.extendSelectionBy.bind(n,"getLineRange"),n.selectByWords=this.extendSelectionBy.bind(n,"getWordRange")}return o.prototype.onMouseDown=function(n){var t=n.inSelection(),e=n.getDocumentPosition();this.mousedownEvent=n;var r=this.editor,s=n.getButton();if(s!==0){var l=r.getSelectionRange(),h=l.isEmpty();(h||s==1)&&r.selection.moveToPosition(e),s==2&&(r.textInput.onContextMenu(n.domEvent),E.isMozilla||n.preventDefault());return}if(this.mousedownEvent.time=Date.now(),t&&!r.isFocused()&&(r.focus(),this.$focusTimeout&&!this.$clickSelection&&!r.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(n);return}return this.captureMouse(n),this.startSelect(e,n.domEvent._clicks>1),n.preventDefault()},o.prototype.startSelect=function(n,t){n=n||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var e=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?e.selection.selectToPosition(n):t||e.selection.moveToPosition(n),t||this.select(),e.setStyle("ace_selecting"),this.setState("select"))},o.prototype.select=function(){var n,t=this.editor,e=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(e);if(r==-1)n=this.$clickSelection.end;else if(r==1)n=this.$clickSelection.start;else{var s=i(this.$clickSelection,e);e=s.cursor,n=s.anchor}t.selection.setSelectionAnchor(n.row,n.column)}t.selection.selectToPosition(e),t.renderer.scrollCursorIntoView()},o.prototype.extendSelectionBy=function(n){var t,e=this.editor,r=e.renderer.screenToTextCoordinates(this.x,this.y),s=e.selection[n](r.row,r.column);if(this.$clickSelection){var l=this.$clickSelection.comparePoint(s.start),h=this.$clickSelection.comparePoint(s.end);if(l==-1&&h<=0)t=this.$clickSelection.end,(s.end.row!=r.row||s.end.column!=r.column)&&(r=s.start);else if(h==1&&l>=0)t=this.$clickSelection.start,(s.start.row!=r.row||s.start.column!=r.column)&&(r=s.end);else if(l==-1&&h==1)r=s.end,t=s.start;else{var v=i(this.$clickSelection,r);r=v.cursor,t=v.anchor}e.selection.setSelectionAnchor(t.row,t.column)}e.selection.selectToPosition(r),e.renderer.scrollCursorIntoView()},o.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},o.prototype.focusWait=function(){var n=c(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(n>A||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},o.prototype.onDoubleClick=function(n){var t=n.getDocumentPosition(),e=this.editor,r=e.session,s=r.getBracketRange(t);s?(s.isEmpty()&&(s.start.column--,s.end.column++),this.setState("select")):(s=e.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=s,this.select()},o.prototype.onTripleClick=function(n){var t=n.getDocumentPosition(),e=this.editor;this.setState("selectByLines");var r=e.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=e.selection.getLineRange(r.start.row),this.$clickSelection.end=e.selection.getLineRange(r.end.row).end):this.$clickSelection=e.selection.getLineRange(t.row),this.select()},o.prototype.onQuadClick=function(n){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},o.prototype.onMouseWheel=function(n){if(!n.getAccelKey()){n.getShiftKey()&&n.wheelY&&!n.wheelX&&(n.wheelX=n.wheelY,n.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var e=this.$lastScroll,r=n.domEvent.timeStamp,s=r-e.t,l=s?n.wheelX/s:e.vx,h=s?n.wheelY/s:e.vy;s<$&&(l=(l+e.vx)/2,h=(h+e.vy)/2);var v=Math.abs(l/h),m=!1;if(v>=1&&t.renderer.isScrollableBy(n.wheelX*n.speed,0)&&(m=!0),v<=1&&t.renderer.isScrollableBy(0,n.wheelY*n.speed)&&(m=!0),m)e.allowed=r;else if(r-e.allowed<$){var g=Math.abs(l)<=1.5*Math.abs(e.vx)&&Math.abs(h)<=1.5*Math.abs(e.vy);g?(m=!0,e.allowed=r):e.allowed=0}if(e.t=r,e.vx=l,e.vy=h,m)return t.renderer.scrollBy(n.wheelX*n.speed,n.wheelY*n.speed),n.stop()}},o}();a.prototype.selectEnd=a.prototype.selectByLinesEnd,a.prototype.selectAllEnd=a.prototype.selectByLinesEnd,a.prototype.selectByWordsEnd=a.prototype.selectByLinesEnd,x.DefaultHandlers=a;function c(o,n,t,e){return Math.sqrt(Math.pow(t-o,2)+Math.pow(e-n,2))}function i(o,n){if(o.start.row==o.end.row)var t=2*n.column-o.start.column-o.end.column;else if(o.start.row==o.end.row-1&&!o.start.column&&!o.end.column)var t=n.column-4;else var t=2*n.row-o.start.row-o.end.row;return t<0?{cursor:o.start,anchor:o.end}:{cursor:o.end,anchor:o.start}}}),ace.define("ace/lib/scroll",["require","exports","module"],function(k,x,H){x.preventParentScroll=function(A){A.stopPropagation();var $=A.currentTarget,a=$.scrollHeight>$.clientHeight;a||A.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(k,x,H){var E=this&&this.__extends||function(){var r=function(s,l){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var m in v)Object.prototype.hasOwnProperty.call(v,m)&&(h[m]=v[m])},r(s,l)};return function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");r(s,l);function h(){this.constructor=s}s.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}}(),A=this&&this.__values||function(r){var s=typeof Symbol=="function"&&Symbol.iterator,l=s&&r[s],h=0;if(l)return l.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&h>=r.length&&(r=void 0),{value:r&&r[h++],done:!r}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},$=k("./lib/dom");k("./lib/event");var a=k("./range").Range,c=k("./lib/scroll").preventParentScroll,i="ace_tooltip",o=function(){function r(s){this.isOpen=!1,this.$element=null,this.$parentNode=s}return r.prototype.$init=function(){return this.$element=$.createElement("div"),this.$element.className=i,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},r.prototype.getElement=function(){return this.$element||this.$init()},r.prototype.setText=function(s){this.getElement().textContent=s},r.prototype.setHtml=function(s){this.getElement().innerHTML=s},r.prototype.setPosition=function(s,l){this.getElement().style.left=s+"px",this.getElement().style.top=l+"px"},r.prototype.setClassName=function(s){$.addCssClass(this.getElement(),s)},r.prototype.setTheme=function(s){this.$element.className=i+" "+(s.isDark?"ace_dark ":"")+(s.cssClass||"")},r.prototype.show=function(s,l,h){s!=null&&this.setText(s),l!=null&&h!=null&&this.setPosition(l,h),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},r.prototype.hide=function(s){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=i,this.isOpen=!1)},r.prototype.getHeight=function(){return this.getElement().offsetHeight},r.prototype.getWidth=function(){return this.getElement().offsetWidth},r.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},r}(),n=function(){function r(){this.popups=[]}return r.prototype.addPopup=function(s){this.popups.push(s),this.updatePopups()},r.prototype.removePopup=function(s){var l=this.popups.indexOf(s);l!==-1&&(this.popups.splice(l,1),this.updatePopups())},r.prototype.updatePopups=function(){var s,l,h,v;this.popups.sort(function(w,y){return y.priority-w.priority});var m=[];try{for(var g=A(this.popups),d=g.next();!d.done;d=g.next()){var b=d.value,M=!0;try{for(var C=(h=void 0,A(m)),S=C.next();!S.done;S=C.next()){var R=S.value;if(this.doPopupsOverlap(R,b)){M=!1;break}}}catch(w){h={error:w}}finally{try{S&&!S.done&&(v=C.return)&&v.call(C)}finally{if(h)throw h.error}}M?m.push(b):b.hide()}}catch(w){s={error:w}}finally{try{d&&!d.done&&(l=g.return)&&l.call(g)}finally{if(s)throw s.error}}},r.prototype.doPopupsOverlap=function(s,l){var h=s.getElement().getBoundingClientRect(),v=l.getElement().getBoundingClientRect();return h.left<v.right&&h.right>v.left&&h.top<v.bottom&&h.bottom>v.top},r}(),t=new n;x.popupManager=t,x.Tooltip=o;var e=function(r){E(s,r);function s(l){l===void 0&&(l=document.body);var h=r.call(this,l)||this;h.timeout=void 0,h.lastT=0,h.idleTime=350,h.lastEvent=void 0,h.onMouseOut=h.onMouseOut.bind(h),h.onMouseMove=h.onMouseMove.bind(h),h.waitForHover=h.waitForHover.bind(h),h.hide=h.hide.bind(h);var v=h.getElement();return v.style.whiteSpace="pre-wrap",v.style.pointerEvents="auto",v.addEventListener("mouseout",h.onMouseOut),v.tabIndex=-1,v.addEventListener("blur",(function(){v.contains(document.activeElement)||this.hide()}).bind(h)),v.addEventListener("wheel",c),h}return s.prototype.addToEditor=function(l){l.on("mousemove",this.onMouseMove),l.on("mousedown",this.hide),l.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},s.prototype.removeFromEditor=function(l){l.off("mousemove",this.onMouseMove),l.off("mousedown",this.hide),l.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},s.prototype.onMouseMove=function(l,h){this.lastEvent=l,this.lastT=Date.now();var v=h.$mouseHandler.isMousePressed;if(this.isOpen){var m=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(m.row,m.column)||v||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||v||(this.lastEvent=l,this.timeout=setTimeout(this.waitForHover,this.idleTime))},s.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var l=Date.now()-this.lastT;if(this.idleTime-l>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-l);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},s.prototype.isOutsideOfText=function(l){var h=l.editor,v=l.getDocumentPosition(),m=h.session.getLine(v.row);if(v.column==m.length){var g=h.renderer.pixelToScreenCoordinates(l.clientX,l.clientY),d=h.session.documentToScreenPosition(v.row,v.column);if(d.column!=g.column||d.row!=g.row)return!0}return!1},s.prototype.setDataProvider=function(l){this.$gatherData=l},s.prototype.showForRange=function(l,h,v,m){var g=10;if(!(m&&m!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var d=l.renderer;this.isOpen||(t.addPopup(this),this.$registerCloseEvents(),this.setTheme(d.theme)),this.isOpen=!0,this.addMarker(h,l.session),this.range=a.fromPoints(h.start,h.end);var b=d.textToScreenCoordinates(h.start.row,h.start.column),M=d.scroller.getBoundingClientRect();b.pageX<M.left&&(b.pageX=M.left);var C=this.getElement();C.innerHTML="",C.appendChild(v),C.style.maxHeight="",C.style.display="block";var S=C.clientHeight,R=C.clientWidth,w=window.innerHeight-b.pageY-d.lineHeight,y=!0;b.pageY-S<0&&b.pageY<w&&(y=!1),C.style.maxHeight=(y?b.pageY:w)-g+"px",C.style.top=y?"":b.pageY+d.lineHeight+"px",C.style.bottom=y?window.innerHeight-b.pageY+"px":"",C.style.left=Math.min(b.pageX,window.innerWidth-R-g)+"px"}},s.prototype.addMarker=function(l,h){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=h,this.marker=h&&h.addMarker(l,"ace_highlight-marker","text")},s.prototype.hide=function(l){!l&&document.activeElement==this.getElement()||l&&l.target&&(l.type!="keydown"||l.ctrlKey||l.metaKey)&&this.$element.contains(l.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,t.removePopup(this)))},s.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},s.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},s.prototype.onMouseOut=function(l){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!l.relatedTarget||this.getElement().contains(l.relatedTarget)||l&&l.currentTarget.contains(l.relatedTarget)||l.relatedTarget.classList.contains("ace_content")||this.hide())},s}(o);x.HoverTooltip=e}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config"],function(k,x,H){var E=this&&this.__extends||function(){var r=function(s,l){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var m in v)Object.prototype.hasOwnProperty.call(v,m)&&(h[m]=v[m])},r(s,l)};return function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");r(s,l);function h(){this.constructor=s}s.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}}(),A=this&&this.__values||function(r){var s=typeof Symbol=="function"&&Symbol.iterator,l=s&&r[s],h=0;if(l)return l.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&h>=r.length&&(r=void 0),{value:r&&r[h++],done:!r}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},$=k("../lib/dom"),a=k("../lib/event"),c=k("../tooltip").Tooltip,i=k("../config").nls,o=5,n=3;x.GUTTER_TOOLTIP_LEFT_OFFSET=o,x.GUTTER_TOOLTIP_TOP_OFFSET=n;function t(r){var s=r.editor,l=s.renderer.$gutterLayer,h=new e(s,!0);r.editor.setDefaultHandler("guttermousedown",function(M){if(!(!s.isFocused()||M.getButton()!=0)){var C=l.getRegion(M);if(C!="foldWidgets"){var S=M.getDocumentPosition().row,R=s.session.selection;if(M.getShiftKey())R.selectTo(S,0);else{if(M.domEvent.detail==2)return s.selectAll(),M.preventDefault();r.$clickSelection=s.selection.getLineRange(S)}return r.setState("selectByLines"),r.captureMouse(M),M.preventDefault()}}});var v,m;function g(){var M=m.getDocumentPosition().row,C=s.session.getLength();if(M==C){var S=s.renderer.pixelToScreenCoordinates(0,m.y).row,R=m.$pos;if(S>s.session.documentToScreenRow(R.row,R.column))return d()}if(h.showTooltip(M),!!h.isOpen)if(s.on("mousewheel",d),s.on("changeSession",d),window.addEventListener("keydown",d,!0),r.$tooltipFollowsMouse)b(m);else{var w=m.getGutterRow(),y=l.$lines.get(w);if(y){var f=y.element.querySelector(".ace_gutter_annotation"),u=f.getBoundingClientRect(),p=h.getElement().style;p.left=u.right-o+"px",p.top=u.bottom-n+"px"}else b(m)}}function d(M){M&&M.type==="keydown"&&(M.ctrlKey||M.metaKey)||M&&M.type==="mouseout"&&(!M.relatedTarget||h.getElement().contains(M.relatedTarget))||(v&&(v=clearTimeout(v)),h.isOpen&&(h.hideTooltip(),s.off("mousewheel",d),s.off("changeSession",d),window.removeEventListener("keydown",d,!0)))}function b(M){h.setPosition(M.x,M.y)}r.editor.setDefaultHandler("guttermousemove",function(M){var C=M.domEvent.target||M.domEvent.srcElement;if($.hasCssClass(C,"ace_fold-widget")||$.hasCssClass(C,"ace_custom-widget"))return d();h.isOpen&&r.$tooltipFollowsMouse&&b(M),m=M,!v&&(v=setTimeout(function(){v=null,m&&!r.isMousePressed&&g()},50))}),a.addListener(s.renderer.$gutter,"mouseout",function(M){m=null,h.isOpen&&(v=setTimeout(function(){v=null,d(M)},50))},s)}x.GutterHandler=t;var e=function(r){E(s,r);function s(l,h){h===void 0&&(h=!1);var v=r.call(this,l.container)||this;v.id="gt"+ ++s.$uid,v.editor=l,v.visibleTooltipRow;var m=v.getElement();return m.setAttribute("role","tooltip"),m.setAttribute("id",v.id),m.style.pointerEvents="auto",h&&(v.onMouseOut=v.onMouseOut.bind(v),m.addEventListener("mouseout",v.onMouseOut)),v}return s.prototype.onMouseOut=function(l){this.isOpen&&(!l.relatedTarget||this.getElement().contains(l.relatedTarget)||l&&l.currentTarget.contains(l.relatedTarget)||this.hideTooltip())},s.prototype.setPosition=function(l,h){var v=window.innerWidth||document.documentElement.clientWidth,m=window.innerHeight||document.documentElement.clientHeight,g=this.getWidth(),d=this.getHeight();l+=15,h+=15,l+g>v&&(l-=l+g-v),h+d>m&&(h-=20+d),c.prototype.setPosition.call(this,l,h)},Object.defineProperty(s,"annotationLabels",{get:function(){return{error:{singular:i("gutter-tooltip.aria-label.error.singular","error"),plural:i("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:i("gutter-tooltip.aria-label.security.singular","security finding"),plural:i("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:i("gutter-tooltip.aria-label.warning.singular","warning"),plural:i("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:i("gutter-tooltip.aria-label.info.singular","information message"),plural:i("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:i("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:i("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),s.prototype.showTooltip=function(l){var h,v=this.editor.renderer.$gutterLayer,m=v.$annotations[l],g;m?g={displayText:Array.from(m.displayText),type:Array.from(m.type)}:g={displayText:[],type:[]};var d=v.session.getFoldLine(l);if(d&&v.$showFoldedAnnotations){for(var b={error:[],security:[],warning:[],info:[],hint:[]},M={error:1,security:2,warning:3,info:4,hint:5},C,S=l+1;S<=d.end.row;S++)if(v.$annotations[S])for(var R=0;R<v.$annotations[S].text.length;R++){var w=v.$annotations[S].type[R];b[w].push(v.$annotations[S].text[R]),(!C||M[w]<M[C])&&(C=w)}if(["error","security","warning"].includes(C)){var y="".concat(s.annotationsToSummaryString(b)," in folded code.");g.displayText.push(y),g.type.push(C+"_fold")}}if(g.displayText.length===0)return this.hideTooltip();for(var f={error:[],security:[],warning:[],info:[],hint:[]},u=v.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",S=0;S<g.displayText.length;S++){var p=$.createElement("span"),L=$.createElement("span");(h=L.classList).add.apply(h,["ace_".concat(g.type[S]),u]),L.setAttribute("aria-label","".concat(s.annotationLabels[g.type[S].replace("_fold","")].singular)),L.setAttribute("role","img"),L.appendChild($.createTextNode(" ")),p.appendChild(L),p.appendChild($.createTextNode(g.displayText[S])),p.appendChild($.createElement("br")),f[g.type[S].replace("_fold","")].push(p)}var T=this.getElement();$.removeChildren(T),f.error.forEach(function(I){return T.appendChild(I)}),f.security.forEach(function(I){return T.appendChild(I)}),f.warning.forEach(function(I){return T.appendChild(I)}),f.info.forEach(function(I){return T.appendChild(I)}),f.hint.forEach(function(I){return T.appendChild(I)}),T.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip"));var _=this.$findLinkedAnnotationNode(l);_&&_.setAttribute("aria-describedby",this.id),this.show(),this.visibleTooltipRow=l,this.editor._signal("showGutterTooltip",this)},s.prototype.$findLinkedAnnotationNode=function(l){var h=this.$findCellByRow(l);if(h){var v=h.element;if(v.childNodes.length>2)return v.childNodes[2]}},s.prototype.$findCellByRow=function(l){return this.editor.renderer.$gutterLayer.$lines.cells.find(function(h){return h.row===l})},s.prototype.hideTooltip=function(){if(this.isOpen){if(this.$element.removeAttribute("aria-live"),this.hide(),this.visibleTooltipRow!=null){var l=this.$findLinkedAnnotationNode(this.visibleTooltipRow);l&&l.removeAttribute("aria-describedby")}this.visibleTooltipRow=void 0,this.editor._signal("hideGutterTooltip",this)}},s.annotationsToSummaryString=function(l){var h,v,m=[],g=["error","security","warning","info","hint"];try{for(var d=A(g),b=d.next();!b.done;b=d.next()){var M=b.value;if(l[M].length){var C=l[M].length===1?s.annotationLabels[M].singular:s.annotationLabels[M].plural;m.push("".concat(l[M].length," ").concat(C))}}}catch(S){h={error:S}}finally{try{b&&!b.done&&(v=d.return)&&v.call(d)}finally{if(h)throw h.error}}return m.join(", ")},s}(c);e.$uid=0,x.GutterTooltip=e}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(k,x,H){var E=k("../lib/event"),A=k("../lib/useragent"),$=function(){function a(c,i){this.speed,this.wheelX,this.wheelY,this.domEvent=c,this.editor=i,this.x=this.clientX=c.clientX,this.y=this.clientY=c.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return a.prototype.stopPropagation=function(){E.stopPropagation(this.domEvent),this.propagationStopped=!0},a.prototype.preventDefault=function(){E.preventDefault(this.domEvent),this.defaultPrevented=!0},a.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},a.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},a.prototype.getGutterRow=function(){var c=this.getDocumentPosition().row,i=this.editor.session.documentToScreenRow(c,0),o=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return i-o},a.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var c=this.editor,i=c.getSelectionRange();if(i.isEmpty())this.$inSelection=!1;else{var o=this.getDocumentPosition();this.$inSelection=i.contains(o.row,o.column)}return this.$inSelection},a.prototype.getButton=function(){return E.getButton(this.domEvent)},a.prototype.getShiftKey=function(){return this.domEvent.shiftKey},a.prototype.getAccelKey=function(){return A.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},a}();x.MouseEvent=$}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(k,x,H){var E=k("../lib/dom"),A=k("../lib/event"),$=k("../lib/useragent"),a=200,c=200,i=5;function o(t){var e=t.editor,r=E.createElement("div");r.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",r.textContent=" ";var s=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];s.forEach(function(D){t[D]=this[D]},this),e.on("mousedown",this.onMouseDown.bind(t));var l=e.container,h,v,m,g,d,b,M=0,C,S,R,w,y;this.onDragStart=function(D){if(this.cancelDrag||!l.draggable){var N=this;return setTimeout(function(){N.startSelect(),N.captureMouse(D)},0),D.preventDefault()}d=e.getSelectionRange();var F=D.dataTransfer;F.effectAllowed=e.getReadOnly()?"copy":"copyMove",e.container.appendChild(r),F.setDragImage&&F.setDragImage(r,0,0),setTimeout(function(){e.container.removeChild(r)}),F.clearData(),F.setData("Text",e.session.getTextRange()),S=!0,this.setState("drag")},this.onDragEnd=function(D){if(l.draggable=!1,S=!1,this.setState(null),!e.getReadOnly()){var N=D.dataTransfer.dropEffect;!C&&N=="move"&&e.session.remove(e.getSelectionRange()),e.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(D){if(!(e.getReadOnly()||!O(D.dataTransfer)))return v=D.clientX,m=D.clientY,h||L(),M++,D.dataTransfer.dropEffect=C=z(D),A.preventDefault(D)},this.onDragOver=function(D){if(!(e.getReadOnly()||!O(D.dataTransfer)))return v=D.clientX,m=D.clientY,h||(L(),M++),_!==null&&(_=null),D.dataTransfer.dropEffect=C=z(D),A.preventDefault(D)},this.onDragLeave=function(D){if(M--,M<=0&&h)return T(),C=null,A.preventDefault(D)},this.onDrop=function(D){if(b){var N=D.dataTransfer;if(S)switch(C){case"move":d.contains(b.row,b.column)?d={start:b,end:b}:d=e.moveText(d,b);break;case"copy":d=e.moveText(d,b,!0);break}else{var F=N.getData("Text");d={start:b,end:e.session.insert(b,F)},e.focus(),C=null}return T(),A.preventDefault(D)}},A.addListener(l,"dragstart",this.onDragStart.bind(t),e),A.addListener(l,"dragend",this.onDragEnd.bind(t),e),A.addListener(l,"dragenter",this.onDragEnter.bind(t),e),A.addListener(l,"dragover",this.onDragOver.bind(t),e),A.addListener(l,"dragleave",this.onDragLeave.bind(t),e),A.addListener(l,"drop",this.onDrop.bind(t),e);function f(D,N){var F=Date.now(),B=!N||D.row!=N.row,P=!N||D.column!=N.column;if(!w||B||P)e.moveCursorToPosition(D),w=F,y={x:v,y:m};else{var V=n(y.x,y.y,v,m);V>i?w=null:F-w>=c&&(e.renderer.scrollCursorIntoView(),w=null)}}function u(D,N){var F=Date.now(),B=e.renderer.layerConfig.lineHeight,P=e.renderer.layerConfig.characterWidth,V=e.renderer.scroller.getBoundingClientRect(),G={x:{left:v-V.left,right:V.right-v},y:{top:m-V.top,bottom:V.bottom-m}},j=Math.min(G.x.left,G.x.right),K=Math.min(G.y.top,G.y.bottom),Q={row:D.row,column:D.column};j/P<=2&&(Q.column+=G.x.left<G.x.right?-3:2),K/B<=1&&(Q.row+=G.y.top<G.y.bottom?-1:1);var X=D.row!=Q.row,J=D.column!=Q.column,Z=!N||D.row!=N.row;X||J&&!Z?R?F-R>=a&&e.renderer.scrollCursorIntoView(Q):R=F:R=null}function p(){var D=b;b=e.renderer.screenToTextCoordinates(v,m),f(b,D),u(b,D)}function L(){d=e.selection.toOrientedRange(),h=e.session.addMarker(d,"ace_selection",e.getSelectionStyle()),e.clearSelection(),e.isFocused()&&e.renderer.$cursorLayer.setBlinking(!1),clearInterval(g),p(),g=setInterval(p,20),M=0,A.addListener(document,"mousemove",I)}function T(){clearInterval(g),e.session.removeMarker(h),h=null,e.selection.fromOrientedRange(d),e.isFocused()&&!S&&e.$resetCursorStyle(),d=null,b=null,M=0,R=null,w=null,A.removeListener(document,"mousemove",I)}var _=null;function I(){_==null&&(_=setTimeout(function(){_!=null&&h&&T()},20))}function O(D){var N=D.types;return!N||Array.prototype.some.call(N,function(F){return F=="text/plain"||F=="Text"})}function z(D){var N=["copy","copymove","all","uninitialized"],F=["move","copymove","linkmove","all","uninitialized"],B=$.isMac?D.altKey:D.ctrlKey,P="uninitialized";try{P=D.dataTransfer.effectAllowed.toLowerCase()}catch{}var V="none";return B&&N.indexOf(P)>=0?V="copy":F.indexOf(P)>=0?V="move":N.indexOf(P)>=0&&(V="copy"),V}}(function(){this.dragWait=function(){var t=Date.now()-this.mousedownEvent.time;t>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var t=this.editor.container;t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(t){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var t=this.editor,e=t.container;e.draggable=!0,t.renderer.$cursorLayer.setBlinking(!1),t.setStyle("ace_dragging");var r=$.isWin?"default":"move";t.renderer.setCursorStyle(r),this.setState("dragReady")},this.onMouseDrag=function(t){var e=this.editor.container;if($.isIE&&this.state=="dragReady"){var r=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);r>3&&e.dragDrop()}if(this.state==="dragWait"){var r=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);r>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(t){if(this.$dragEnabled){this.mousedownEvent=t;var e=this.editor,r=t.inSelection(),s=t.getButton(),l=t.domEvent.detail||1;if(l===1&&s===0&&r){if(t.editor.inMultiSelectMode&&(t.getAccelKey()||t.getShiftKey()))return;this.mousedownEvent.time=Date.now();var h=t.domEvent.target||t.domEvent.srcElement;if("unselectable"in h&&(h.unselectable="on"),e.getDragDelay()){if($.isWebKit){this.cancelDrag=!0;var v=e.container;v.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(t,this.onMouseDrag.bind(this)),t.defaultPrevented=!0}}}}).call(o.prototype);function n(t,e,r,s){return Math.sqrt(Math.pow(r-t,2)+Math.pow(s-e,2))}x.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(k,x,H){var E=k("./mouse_event").MouseEvent,A=k("../lib/event"),$=k("../lib/dom");x.addTouchListeners=function(a,c){var i="scroll",o,n,t,e,r,s,l=0,h,v=0,m=0,g=0,d,b;function M(){var f=window.navigator&&window.navigator.clipboard,u=!1,p=function(){var _=c.getCopyText(),I=c.session.getUndoManager().hasUndo();b.replaceChild($.buildDom(u?["span",!_&&L("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],_&&L("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],_&&L("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],f&&L("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],I&&L("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],L("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],L("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),b.firstChild)},L=function(_){return c.commands.canExecute(_,c)},T=function(_){var I=_.target.getAttribute("action");if(I=="more"||!u)return u=!u,p();I=="paste"?f.readText().then(function(O){c.execCommand(I,O)}):I&&((I=="cut"||I=="copy")&&(f?f.writeText(c.getCopyText()):document.execCommand("copy")),c.execCommand(I)),b.firstChild.style.display="none",u=!1,I!="openCommandPalette"&&c.focus()};b=$.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(_){i="menu",_.stopPropagation(),_.preventDefault(),c.textInput.focus()},ontouchend:function(_){_.stopPropagation(),_.preventDefault(),T(_)},onclick:T},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],c.container)}function C(){if(!c.getOption("enableMobileMenu")){b&&S();return}b||M();var f=c.selection.cursor,u=c.renderer.textToScreenCoordinates(f.row,f.column),p=c.renderer.textToScreenCoordinates(0,0).pageX,L=c.renderer.scrollLeft,T=c.container.getBoundingClientRect();b.style.top=u.pageY-T.top-3+"px",u.pageX-T.left<T.width-70?(b.style.left="",b.style.right="10px"):(b.style.right="",b.style.left=p+L-T.left+"px"),b.style.display="",b.firstChild.style.display="none",c.on("input",S)}function S(f){b&&(b.style.display="none"),c.off("input",S)}function R(){r=null,clearTimeout(r);var f=c.selection.getRange(),u=f.contains(h.row,h.column);(f.isEmpty()||!u)&&(c.selection.moveToPosition(h),c.selection.selectWord()),i="wait",C()}function w(){r=null,clearTimeout(r),c.selection.moveToPosition(h);var f=v>=2?c.selection.getLineRange(h.row):c.session.getBracketRange(h);f&&!f.isEmpty()?c.selection.setRange(f):c.selection.selectWord(),i="wait"}A.addListener(a,"contextmenu",function(f){if(d){var u=c.textInput.getElement();u.focus()}},c),A.addListener(a,"touchstart",function(f){var u=f.touches;if(r||u.length>1){clearTimeout(r),r=null,t=-1,i="zoom";return}d=c.$mouseHandler.isMousePressed=!0;var p=c.renderer.layerConfig.lineHeight,L=c.renderer.layerConfig.lineHeight,T=f.timeStamp;e=T;var _=u[0],I=_.clientX,O=_.clientY;Math.abs(o-I)+Math.abs(n-O)>p&&(t=-1),o=f.clientX=I,n=f.clientY=O,m=g=0;var z=new E(f,c);if(h=z.getDocumentPosition(),T-t<500&&u.length==1&&!l)v++,f.preventDefault(),f.button=0,w();else{v=0;var D=c.selection.cursor,N=c.selection.isEmpty()?D:c.selection.anchor,F=c.renderer.$cursorLayer.getPixelPosition(D,!0),B=c.renderer.$cursorLayer.getPixelPosition(N,!0),P=c.renderer.scroller.getBoundingClientRect(),V=c.renderer.layerConfig.offset,G=c.renderer.scrollLeft,j=function(X,J){return X=X/L,J=J/p-.75,X*X+J*J};if(f.clientX<P.left){i="zoom";return}var K=j(f.clientX-P.left-F.left+G,f.clientY-P.top-F.top+V),Q=j(f.clientX-P.left-B.left+G,f.clientY-P.top-B.top+V);K<3.5&&Q<3.5&&(i=K>Q?"cursor":"anchor"),Q<3.5?i="anchor":K<3.5?i="cursor":i="scroll",r=setTimeout(R,450)}t=T},c),A.addListener(a,"touchend",function(f){d=c.$mouseHandler.isMousePressed=!1,s&&clearInterval(s),i=="zoom"?(i="",l=0):r?(c.selection.moveToPosition(h),l=0,C()):i=="scroll"?(y(),S()):C(),clearTimeout(r),r=null},c),A.addListener(a,"touchmove",function(f){r&&(clearTimeout(r),r=null);var u=f.touches;if(!(u.length>1||i=="zoom")){var p=u[0],L=o-p.clientX,T=n-p.clientY;if(i=="wait")if(L*L+T*T>4)i="cursor";else return f.preventDefault();o=p.clientX,n=p.clientY,f.clientX=p.clientX,f.clientY=p.clientY;var _=f.timeStamp,I=_-e;if(e=_,i=="scroll"){var O=new E(f,c);O.speed=1,O.wheelX=L,O.wheelY=T,10*Math.abs(L)<Math.abs(T)&&(L=0),10*Math.abs(T)<Math.abs(L)&&(T=0),I!=0&&(m=L/I,g=T/I),c._emit("mousewheel",O),O.propagationStopped||(m=g=0)}else{var z=new E(f,c),D=z.getDocumentPosition();i=="cursor"?c.selection.moveCursorToPosition(D):i=="anchor"&&c.selection.setSelectionAnchor(D.row,D.column),c.renderer.scrollCursorIntoView(D),f.preventDefault()}}},c);function y(){l+=60,s=setInterval(function(){l--<=0&&(clearInterval(s),s=null),Math.abs(m)<.01&&(m=0),Math.abs(g)<.01&&(g=0),l<20&&(m=.9*m),l<20&&(g=.9*g);var f=c.session.getScrollTop();c.renderer.scrollBy(10*m,10*g),f==c.session.getScrollTop()&&(l=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(k,x,H){var E=k("../lib/event"),A=k("../lib/useragent"),$=k("./default_handlers").DefaultHandlers,a=k("./default_gutter_handler").GutterHandler,c=k("./mouse_event").MouseEvent,i=k("./dragdrop_handler").DragdropHandler,o=k("./touch_handler").addTouchListeners,n=k("../config"),t=function(){function e(r){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var s=this;this.editor=r,new $(this),new a(this),new i(this);var l=function(m){var g=!document.hasFocus||!document.hasFocus()||!r.isFocused()&&document.activeElement==(r.textInput&&r.textInput.getElement());g&&window.focus(),r.focus(),setTimeout(function(){r.isFocused()||r.focus()})},h=r.renderer.getMouseEventTarget();E.addListener(h,"click",this.onMouseEvent.bind(this,"click"),r),E.addListener(h,"mousemove",this.onMouseMove.bind(this,"mousemove"),r),E.addMultiMouseDownListener([h,r.renderer.scrollBarV&&r.renderer.scrollBarV.inner,r.renderer.scrollBarH&&r.renderer.scrollBarH.inner,r.textInput&&r.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",r),E.addMouseWheelListener(r.container,this.onMouseWheel.bind(this,"mousewheel"),r),o(r.container,r);var v=r.renderer.$gutter;E.addListener(v,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),r),E.addListener(v,"click",this.onMouseEvent.bind(this,"gutterclick"),r),E.addListener(v,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),r),E.addListener(v,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),r),E.addListener(h,"mousedown",l,r),E.addListener(v,"mousedown",l,r),A.isIE&&r.renderer.scrollBarV&&(E.addListener(r.renderer.scrollBarV.element,"mousedown",l,r),E.addListener(r.renderer.scrollBarH.element,"mousedown",l,r)),r.on("mousemove",function(m){if(!(s.state||s.$dragDelay||!s.$dragEnabled)){var g=r.renderer.screenToTextCoordinates(m.x,m.y),d=r.session.selection.getRange(),b=r.renderer;!d.isEmpty()&&d.insideStart(g.row,g.column)?b.setCursorStyle("default"):b.setCursorStyle("")}},r)}return e.prototype.onMouseEvent=function(r,s){this.editor.session&&this.editor._emit(r,new c(s,this.editor))},e.prototype.onMouseMove=function(r,s){var l=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!l||!l.length||this.editor._emit(r,new c(s,this.editor))},e.prototype.onMouseWheel=function(r,s){var l=new c(s,this.editor);l.speed=this.$scrollSpeed*2,l.wheelX=s.wheelX,l.wheelY=s.wheelY,this.editor._emit(r,l)},e.prototype.setState=function(r){this.state=r},e.prototype.captureMouse=function(r,s){this.x=r.x,this.y=r.y,this.isMousePressed=!0;var l=this.editor,h=this.editor.renderer;h.$isMousePressed=!0;var v=this,m=!0,g=function(S){if(S){if(A.isWebKit&&!S.which&&v.releaseMouse)return v.releaseMouse();v.x=S.clientX,v.y=S.clientY,s&&s(S),v.mouseEvent=new c(S,v.editor),v.$mouseMoved=!0}},d=function(S){l.off("beforeEndOperation",C),m=!1,l.session&&b(),v[v.state+"End"]&&v[v.state+"End"](S),v.state="",v.isMousePressed=h.$isMousePressed=!1,h.$keepTextAreaAtCursor&&h.$moveTextAreaToCursor(),v.$onCaptureMouseMove=v.releaseMouse=null,S&&v.onMouseEvent("mouseup",S),l.endOperation()},b=function(){v[v.state]&&v[v.state](),v.$mouseMoved=!1},M=function(){m&&(b(),E.nextFrame(M))};if(A.isOldIE&&r.domEvent.type=="dblclick")return setTimeout(function(){d(r)});var C=function(S){v.releaseMouse&&l.curOp.command.name&&l.curOp.selectionChanged&&(v[v.state+"End"]&&v[v.state+"End"](),v.state="",v.releaseMouse())};l.on("beforeEndOperation",C),l.startOperation({command:{name:"mouse"}}),v.$onCaptureMouseMove=g,v.releaseMouse=E.capture(this.editor.container,g,d),M()},e.prototype.cancelContextMenu=function(){var r=(function(s){s&&s.domEvent&&s.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",r),s&&s.domEvent&&E.stopEvent(s.domEvent))}).bind(this);setTimeout(r,10),this.editor.on("nativecontextmenu",r)},e.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},e}();t.prototype.releaseMouse=null,n.defineOptions(t.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:A.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),x.MouseHandler=t}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(k,x,H){var E=k("../lib/dom"),A=function(){function $(a){a.on("click",function(c){var i=c.getDocumentPosition(),o=a.session,n=o.getFoldAt(i.row,i.column,1);n&&(c.getAccelKey()?o.removeFold(n):o.expandFold(n),c.stop());var t=c.domEvent&&c.domEvent.target;t&&E.hasCssClass(t,"ace_inline_button")&&E.hasCssClass(t,"ace_toggle_wrap")&&(o.setOption("wrap",!o.getUseWrapMode()),a.renderer.scrollCursorIntoView())}),a.on("gutterclick",function(c){var i=a.renderer.$gutterLayer.getRegion(c);if(i=="foldWidgets"){var o=c.getDocumentPosition().row,n=a.session;n.foldWidgets&&n.foldWidgets[o]&&a.session.onFoldWidgetClick(o,c),a.isFocused()||a.focus(),c.stop()}}),a.on("gutterdblclick",function(c){var i=a.renderer.$gutterLayer.getRegion(c);if(i=="foldWidgets"){var o=c.getDocumentPosition().row,n=a.session,t=n.getParentFoldRangeData(o,!0),e=t.range||t.firstRange;if(e){o=e.start.row;var r=n.getFoldAt(o,n.getLine(o).length,1);r?n.removeFold(r):(n.addFold("...",e),a.renderer.scrollCursorIntoView({row:e.start.row,column:0}))}c.stop()}})}return $}();x.FoldHandler=A}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(k,x,H){var E=k("../lib/keys"),A=k("../lib/event"),$=function(){function a(c){this.$editor=c,this.$data={editor:c},this.$handlers=[],this.setDefaultHandler(c.commands)}return a.prototype.setDefaultHandler=function(c){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=c,this.addKeyboardHandler(c,0)},a.prototype.setKeyboardHandler=function(c){var i=this.$handlers;if(i[i.length-1]!=c){for(;i[i.length-1]&&i[i.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(i[i.length-1]);this.addKeyboardHandler(c,1)}},a.prototype.addKeyboardHandler=function(c,i){if(c){typeof c=="function"&&!c.handleKeyboard&&(c.handleKeyboard=c);var o=this.$handlers.indexOf(c);o!=-1&&this.$handlers.splice(o,1),i==null?this.$handlers.push(c):this.$handlers.splice(i,0,c),o==-1&&c.attach&&c.attach(this.$editor)}},a.prototype.removeKeyboardHandler=function(c){var i=this.$handlers.indexOf(c);return i==-1?!1:(this.$handlers.splice(i,1),c.detach&&c.detach(this.$editor),!0)},a.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},a.prototype.getStatusText=function(){var c=this.$data,i=c.editor;return this.$handlers.map(function(o){return o.getStatusText&&o.getStatusText(i,c)||""}).filter(Boolean).join(" ")},a.prototype.$callKeyboardHandlers=function(c,i,o,n){for(var t,e=!1,r=this.$editor.commands,s=this.$handlers.length;s--&&(t=this.$handlers[s].handleKeyboard(this.$data,c,i,o,n),!(!(!t||!t.command)&&(t.command=="null"?e=!0:e=r.exec(t.command,this.$editor,t.args,n),e&&n&&c!=-1&&t.passEvent!=!0&&t.command.passEvent!=!0&&A.stopEvent(n),e))););return!e&&c==-1&&(t={command:"insertstring"},e=r.exec("insertstring",this.$editor,i)),e&&this.$editor._signal&&this.$editor._signal("keyboardActivity",t),e},a.prototype.onCommandKey=function(c,i,o){var n=E.keyCodeToString(o);return this.$callKeyboardHandlers(i,n,o,c)},a.prototype.onTextInput=function(c){return this.$callKeyboardHandlers(-1,c)},a}();x.KeyBinding=$}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(k,x,H){var E=0,A=0,$=!1,a=!1,c=!1,i=[[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]],o=[[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]],n=0,t=1,e=0,r=1,s=2,l=3,h=4,v=5,m=6,g=7,d=8,b=9,M=10,C=11,S=12,R=13,w=14,y=15,f=16,u=17,p=18,L=[p,p,p,p,p,p,p,p,p,m,v,m,d,v,p,p,p,p,p,p,p,p,p,p,p,p,p,p,v,v,v,m,d,h,h,C,C,C,h,h,h,h,h,M,b,M,b,b,s,s,s,s,s,s,s,s,s,s,b,h,h,h,h,h,h,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,h,h,h,h,h,h,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,h,h,h,h,p,p,p,p,p,p,v,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,b,h,C,C,C,C,h,h,h,h,e,h,h,p,h,h,C,C,s,s,h,e,h,h,h,s,e,h,h,h,h,h],T=[d,d,d,d,d,d,d,d,d,d,d,p,p,p,e,r,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,d,v,R,w,y,f,u,b,C,C,C,C,C,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,b,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,d];function _(D,N,F,B){var P=E?o:i,V=null,G=null,j=null,K=0,Q=null,X=null,J=-1,Z=null,q=null,Ae=[];if(!B)for(Z=0,B=[];Z<F;Z++)B[Z]=z(D[Z]);for(A=E,$=!1,a=!1,c=!1,q=0;q<F;q++){if(V=K,Ae[q]=G=O(D,B,Ae,q),K=P[V][G],Q=K&240,K&=15,N[q]=j=P[K][5],Q>0)if(Q==16){for(Z=J;Z<q;Z++)N[Z]=1;J=-1}else J=-1;if(X=P[K][6],X)J==-1&&(J=q);else if(J>-1){for(Z=J;Z<q;Z++)N[Z]=j;J=-1}B[q]==v&&(N[q]=0),A|=j}if(c){for(Z=0;Z<F;Z++)if(B[Z]==m){N[Z]=E;for(var se=Z-1;se>=0&&B[se]==d;se--)N[se]=E}}}function I(D,N,F){if(!(A<D)){if(D==1&&E==t&&!a){F.reverse();return}for(var B=F.length,P=0,V,G,j,K;P<B;){if(N[P]>=D){for(V=P+1;V<B&&N[V]>=D;)V++;for(G=P,j=V-1;G<j;G++,j--)K=F[G],F[G]=F[j],F[j]=K;P=V}P++}}}function O(D,N,F,B){var P=N[B],V,G,j,K;switch(P){case e:case r:$=!1;case h:case l:return P;case s:return $?l:s;case g:return $=!0,r;case d:return h;case b:return B<1||B+1>=N.length||(V=F[B-1])!=s&&V!=l||(G=N[B+1])!=s&&G!=l?h:($&&(G=l),G==V?G:h);case M:return V=B>0?F[B-1]:v,V==s&&B+1<N.length&&N[B+1]==s?s:h;case C:if(B>0&&F[B-1]==s)return s;if($)return h;for(K=B+1,j=N.length;K<j&&N[K]==C;)K++;return K<j&&N[K]==s?s:h;case S:for(j=N.length,K=B+1;K<j&&N[K]==S;)K++;if(K<j){var Q=D[B],X=Q>=1425&&Q<=2303||Q==64286;if(V=N[K],X&&(V==r||V==g))return r}return B<1||(V=N[B-1])==v?h:F[B-1];case v:return $=!1,a=!0,E;case m:return c=!0,h;case R:case w:case f:case u:case y:$=!1;case p:return h}}function z(D){var N=D.charCodeAt(0),F=N>>8;return F==0?N>191?e:L[N]:F==5?/[\u0591-\u05f4]/.test(D)?r:e:F==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(D)?S:/[\u0660-\u0669\u066b-\u066c]/.test(D)?l:N==1642?C:/[\u06f0-\u06f9]/.test(D)?s:g:F==32&&N<=8287?T[N&255]:F==254&&N>=65136?g:h}x.L=e,x.R=r,x.EN=s,x.ON_R=3,x.AN=4,x.R_H=5,x.B=6,x.RLE=7,x.DOT="·",x.doBidiReorder=function(D,N,F){if(D.length<2)return{};var B=D.split(""),P=new Array(B.length),V=new Array(B.length),G=[];E=F?t:n,_(B,G,B.length,N);for(var j=0;j<P.length;P[j]=j,j++);I(2,G,P),I(1,G,P);for(var j=0;j<P.length-1;j++)N[j]===l?G[j]=x.AN:G[j]===r&&(N[j]>g&&N[j]<R||N[j]===h||N[j]===p)?G[j]=x.ON_R:j>0&&B[j-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(B[j])&&(G[j-1]=G[j]=x.R_H,j++);B[B.length-1]===x.DOT&&(G[B.length-1]=x.B),B[0]==="‫"&&(G[0]=x.RLE);for(var j=0;j<P.length;j++)V[j]=G[P[j]];return{logicalFromVisual:P,bidiLevels:V}},x.hasBidiCharacters=function(D,N){for(var F=!1,B=0;B<D.length;B++)N[B]=z(D.charAt(B)),!F&&(N[B]==r||N[B]==g||N[B]==l)&&(F=!0);return F},x.getVisualFromLogicalIdx=function(D,N){for(var F=0;F<N.logicalFromVisual.length;F++)if(N.logicalFromVisual[F]==D)return F;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(k,x,H){var E=k("./lib/bidiutil"),A=k("./lib/lang"),$=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,a=function(){function c(i){this.session=i,this.bidiMap={},this.currentRow=null,this.bidiUtil=E,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=$.test(i.getValue())}return c.prototype.isBidiRow=function(i,o,n){return this.seenBidi?(i!==this.currentRow&&(this.currentRow=i,this.updateRowLine(o,n),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},c.prototype.onChange=function(i){this.seenBidi?this.currentRow=null:i.action=="insert"&&$.test(i.lines.join(`
180
- `))&&(this.seenBidi=!0,this.currentRow=null)},c.prototype.getDocumentRow=function(){var i=0,o=this.session.$screenRowCache;if(o.length){var n=this.session.$getRowCacheIndex(o,this.currentRow);n>=0&&(i=this.session.$docRowCache[n])}return i},c.prototype.getSplitIndex=function(){var i=0,o=this.session.$screenRowCache;if(o.length)for(var n,t=this.session.$getRowCacheIndex(o,this.currentRow);this.currentRow-i>0&&(n=this.session.$getRowCacheIndex(o,this.currentRow-i-1),n===t);)t=n,i++;else i=this.currentRow;return i},c.prototype.updateRowLine=function(i,o){i===void 0&&(i=this.getDocumentRow());var n=i===this.session.getLength()-1,t=n?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(i),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var e=this.session.$wrapData[i];e&&(o===void 0&&(o=this.getSplitIndex()),o>0&&e.length?(this.wrapIndent=e.indent,this.wrapOffset=this.wrapIndent*this.charWidths[E.L],this.line=o<e.length?this.line.substring(e[o-1],e[o]):this.line.substring(e[e.length-1])):this.line=this.line.substring(0,e[o]),o==e.length&&(this.line+=this.showInvisibles?t:E.DOT))}else this.line+=this.showInvisibles?t:E.DOT;var r=this.session,s=0,l;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(h,v){return h===" "||r.isFullWidth(h.charCodeAt(0))?(l=h===" "?r.getScreenTabSize(v+s):2,s+=l-1,A.stringRepeat(E.DOT,l)):h}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==E.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},c.prototype.updateBidiMap=function(){var i=[];E.hasBidiCharacters(this.line,i)||this.isRtlDir?this.bidiMap=E.doBidiReorder(this.line,i,this.isRtlDir):this.bidiMap={}},c.prototype.markAsDirty=function(){this.currentRow=null},c.prototype.updateCharacterWidths=function(i){if(this.characterWidth!==i.$characterSize.width){this.fontMetrics=i;var o=this.characterWidth=i.$characterSize.width,n=i.$measureCharWidth("ה");this.charWidths[E.L]=this.charWidths[E.EN]=this.charWidths[E.ON_R]=o,this.charWidths[E.R]=this.charWidths[E.AN]=n,this.charWidths[E.R_H]=n*.45,this.charWidths[E.B]=this.charWidths[E.RLE]=0,this.currentRow=null}},c.prototype.setShowInvisibles=function(i){this.showInvisibles=i,this.currentRow=null},c.prototype.setEolChar=function(i){this.EOL=i},c.prototype.setContentWidth=function(i){this.contentWidth=i},c.prototype.isRtlLine=function(i){return this.$isRtl?!0:i!=null?this.session.getLine(i).charAt(0)==this.RLE:this.isRtlDir},c.prototype.setRtlDirection=function(i,o){for(var n=i.getCursorPosition(),t=i.selection.getSelectionAnchor().row;t<=n.row;t++)!o&&i.session.getLine(t).charAt(0)===i.session.$bidiHandler.RLE?i.session.doc.removeInLine(t,0,1):o&&i.session.getLine(t).charAt(0)!==i.session.$bidiHandler.RLE&&i.session.doc.insert({column:0,row:t},i.session.$bidiHandler.RLE)},c.prototype.getPosLeft=function(i){i-=this.wrapIndent;var o=this.line.charAt(0)===this.RLE?1:0,n=i>o?this.session.getOverwrite()?i:i-1:o,t=E.getVisualFromLogicalIdx(n,this.bidiMap),e=this.bidiMap.bidiLevels,r=0;!this.session.getOverwrite()&&i<=o&&e[t]%2!==0&&t++;for(var s=0;s<t;s++)r+=this.charWidths[e[s]];return!this.session.getOverwrite()&&i>o&&e[t]%2===0&&(r+=this.charWidths[e[t]]),this.wrapIndent&&(r+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(r+=this.rtlLineOffset),r},c.prototype.getSelections=function(i,o){var n=this.bidiMap,t=n.bidiLevels,e,r=[],s=0,l=Math.min(i,o)-this.wrapIndent,h=Math.max(i,o)-this.wrapIndent,v=!1,m=!1,g=0;this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,b=0;b<t.length;b++)d=n.logicalFromVisual[b],e=t[b],v=d>=l&&d<h,v&&!m?g=s:!v&&m&&r.push({left:g,width:s-g}),s+=this.charWidths[e],m=v;if(v&&b===t.length&&r.push({left:g,width:s-g}),this.isRtlDir)for(var M=0;M<r.length;M++)r[M].left+=this.rtlLineOffset;return r},c.prototype.offsetToCol=function(n){this.isRtlDir&&(n-=this.rtlLineOffset);var o=0,n=Math.max(n,0),t=0,e=0,r=this.bidiMap.bidiLevels,s=this.charWidths[r[e]];for(this.wrapIndent&&(n-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);n>t+s/2;){if(t+=s,e===r.length-1){s=0;break}s=this.charWidths[r[++e]]}return e>0&&r[e-1]%2!==0&&r[e]%2===0?(n<t&&e--,o=this.bidiMap.logicalFromVisual[e]):e>0&&r[e-1]%2===0&&r[e]%2!==0?o=1+(n>t?this.bidiMap.logicalFromVisual[e]:this.bidiMap.logicalFromVisual[e-1]):this.isRtlDir&&e===r.length-1&&s===0&&r[e-1]%2===0||!this.isRtlDir&&e===0&&r[e]%2!==0?o=1+this.bidiMap.logicalFromVisual[e]:(e>0&&r[e-1]%2!==0&&s!==0&&e--,o=this.bidiMap.logicalFromVisual[e]),o===0&&this.isRtlDir&&o++,o+this.wrapIndent},c}();x.BidiHandler=a}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(k,x,H){var E=k("./lib/oop"),A=k("./lib/lang"),$=k("./lib/event_emitter").EventEmitter,a=k("./range").Range,c=function(){function i(o){this.session=o,this.doc=o.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var n=this;this.cursor.on("change",function(t){n.$cursorChanged=!0,n.$silent||n._emit("changeCursor"),!n.$isEmpty&&!n.$silent&&n._emit("changeSelection"),!n.$keepDesiredColumnOnChange&&t.old.column!=t.value.column&&(n.$desiredColumn=null)}),this.anchor.on("change",function(){n.$anchorChanged=!0,!n.$isEmpty&&!n.$silent&&n._emit("changeSelection")})}return i.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},i.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},i.prototype.getCursor=function(){return this.lead.getPosition()},i.prototype.setAnchor=function(o,n){this.$isEmpty=!1,this.anchor.setPosition(o,n)},i.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},i.prototype.getSelectionLead=function(){return this.lead.getPosition()},i.prototype.isBackwards=function(){var o=this.anchor,n=this.lead;return o.row>n.row||o.row==n.row&&o.column>n.column},i.prototype.getRange=function(){var o=this.anchor,n=this.lead;return this.$isEmpty?a.fromPoints(n,n):this.isBackwards()?a.fromPoints(n,o):a.fromPoints(o,n)},i.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},i.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},i.prototype.setRange=function(o,n){var t=n?o.end:o.start,e=n?o.start:o.end;this.$setSelection(t.row,t.column,e.row,e.column)},i.prototype.$setSelection=function(o,n,t,e){if(!this.$silent){var r=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(o,n),this.cursor.setPosition(t,e),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||s)&&this._emit("changeSelection")}},i.prototype.$moveSelection=function(o){var n=this.lead;this.$isEmpty&&this.setSelectionAnchor(n.row,n.column),o.call(this)},i.prototype.selectTo=function(o,n){this.$moveSelection(function(){this.moveCursorTo(o,n)})},i.prototype.selectToPosition=function(o){this.$moveSelection(function(){this.moveCursorToPosition(o)})},i.prototype.moveTo=function(o,n){this.clearSelection(),this.moveCursorTo(o,n)},i.prototype.moveToPosition=function(o){this.clearSelection(),this.moveCursorToPosition(o)},i.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},i.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},i.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},i.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},i.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},i.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},i.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},i.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},i.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},i.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},i.prototype.getWordRange=function(o,n){if(typeof n>"u"){var t=o||this.lead;o=t.row,n=t.column}return this.session.getWordRange(o,n)},i.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},i.prototype.selectAWord=function(){var o=this.getCursor(),n=this.session.getAWordRange(o.row,o.column);this.setSelectionRange(n)},i.prototype.getLineRange=function(o,n){var t=typeof o=="number"?o:this.lead.row,e,r=this.session.getFoldLine(t);return r?(t=r.start.row,e=r.end.row):e=t,n===!0?new a(t,0,e,this.session.getLine(e).length):new a(t,0,e+1,0)},i.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},i.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},i.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},i.prototype.wouldMoveIntoSoftTab=function(o,n,t){var e=o.column,r=o.column+n;return t<0&&(e=o.column-n,r=o.column),this.session.isTabStop(o)&&this.doc.getLine(o.row).slice(e,r).split(" ").length-1==n},i.prototype.moveCursorLeft=function(){var o=this.lead.getPosition(),n;if(n=this.session.getFoldAt(o.row,o.column,-1))this.moveCursorTo(n.start.row,n.start.column);else if(o.column===0)o.row>0&&this.moveCursorTo(o.row-1,this.doc.getLine(o.row-1).length);else{var t=this.session.getTabSize();this.wouldMoveIntoSoftTab(o,t,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-t):this.moveCursorBy(0,-1)}},i.prototype.moveCursorRight=function(){var o=this.lead.getPosition(),n;if(n=this.session.getFoldAt(o.row,o.column,1))this.moveCursorTo(n.end.row,n.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 t=this.session.getTabSize(),o=this.lead;this.wouldMoveIntoSoftTab(o,t,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,t):this.moveCursorBy(0,1)}},i.prototype.moveCursorLineStart=function(){var o=this.lead.row,n=this.lead.column,t=this.session.documentToScreenRow(o,n),e=this.session.screenToDocumentPosition(t,0),r=this.session.getDisplayLine(o,null,e.row,e.column),s=r.match(/^\s*/);s[0].length!=n&&!this.session.$useEmacsStyleLineStart&&(e.column+=s[0].length),this.moveCursorToPosition(e)},i.prototype.moveCursorLineEnd=function(){var o=this.lead,n=this.session.getDocumentLastRowColumnPosition(o.row,o.column);if(this.lead.column==n.column){var t=this.session.getLine(n.row);if(n.column==t.length){var e=t.search(/\s+$/);e>0&&(n.column=e)}}this.moveCursorTo(n.row,n.column)},i.prototype.moveCursorFileEnd=function(){var o=this.doc.getLength()-1,n=this.doc.getLine(o).length;this.moveCursorTo(o,n)},i.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},i.prototype.moveCursorLongWordRight=function(){var o=this.lead.row,n=this.lead.column,t=this.doc.getLine(o),e=t.substring(n);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(o,n,1);if(r){this.moveCursorTo(r.end.row,r.end.column);return}if(this.session.nonTokenRe.exec(e)&&(n+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,e=t.substring(n)),n>=t.length){this.moveCursorTo(o,t.length),this.moveCursorRight(),o<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(e)&&(n+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,n)},i.prototype.moveCursorLongWordLeft=function(){var o=this.lead.row,n=this.lead.column,t;if(t=this.session.getFoldAt(o,n,-1)){this.moveCursorTo(t.start.row,t.start.column);return}var e=this.session.getFoldStringAt(o,n,-1);e==null&&(e=this.doc.getLine(o).substring(0,n));var r=A.stringReverse(e);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(r)&&(n-=this.session.nonTokenRe.lastIndex,r=r.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),n<=0){this.moveCursorTo(o,0),this.moveCursorLeft(),o>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(r)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,n)},i.prototype.$shortWordEndIndex=function(o){var n=0,t,e=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(o))n=this.session.tokenRe.lastIndex;else{for(;(t=o[n])&&e.test(t);)n++;if(n<1){for(r.lastIndex=0;(t=o[n])&&!r.test(t);)if(r.lastIndex=0,n++,e.test(t))if(n>2){n--;break}else{for(;(t=o[n])&&e.test(t);)n++;if(n>2)break}}}return r.lastIndex=0,n},i.prototype.moveCursorShortWordRight=function(){var o=this.lead.row,n=this.lead.column,t=this.doc.getLine(o),e=t.substring(n),r=this.session.getFoldAt(o,n,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(n==t.length){var s=this.doc.getLength();do o++,e=this.doc.getLine(o);while(o<s&&/^\s*$/.test(e));/^\s+/.test(e)||(e=""),n=0}var l=this.$shortWordEndIndex(e);this.moveCursorTo(o,n+l)},i.prototype.moveCursorShortWordLeft=function(){var o=this.lead.row,n=this.lead.column,t;if(t=this.session.getFoldAt(o,n,-1))return this.moveCursorTo(t.start.row,t.start.column);var e=this.session.getLine(o).substring(0,n);if(n===0){do o--,e=this.doc.getLine(o);while(o>0&&/^\s*$/.test(e));n=e.length,/\s+$/.test(e)||(e="")}var r=A.stringReverse(e),s=this.$shortWordEndIndex(r);return this.moveCursorTo(o,n-s)},i.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},i.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},i.prototype.moveCursorBy=function(o,n){var t=this.session.documentToScreenPosition(this.lead.row,this.lead.column),e;if(n===0&&(o!==0&&(this.session.$bidiHandler.isBidiRow(t.row,this.lead.row)?(e=this.session.$bidiHandler.getPosLeft(t.column),t.column=Math.round(e/this.session.$bidiHandler.charWidths[0])):e=t.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?t.column=this.$desiredColumn:this.$desiredColumn=t.column),o!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var r=this.session.lineWidgets[this.lead.row];o<0?o-=r.rowsAbove||0:o>0&&(o+=r.rowCount-(r.rowsAbove||0))}var s=this.session.screenToDocumentPosition(t.row+o,t.column,e);o!==0&&n===0&&s.row===this.lead.row&&(s.column,this.lead.column),this.moveCursorTo(s.row,s.column+n,n===0)},i.prototype.moveCursorToPosition=function(o){this.moveCursorTo(o.row,o.column)},i.prototype.moveCursorTo=function(o,n,t){var e=this.session.getFoldAt(o,n,1);e&&(o=e.start.row,n=e.start.column),this.$keepDesiredColumnOnChange=!0;var r=this.session.getLine(o);/[\uDC00-\uDFFF]/.test(r.charAt(n))&&r.charAt(n-1)&&(this.lead.row==o&&this.lead.column==n+1?n=n-1:n=n+1),this.lead.setPosition(o,n),this.$keepDesiredColumnOnChange=!1,t||(this.$desiredColumn=null)},i.prototype.moveCursorToScreen=function(o,n,t){var e=this.session.screenToDocumentPosition(o,n);this.moveCursorTo(e.row,e.column,t)},i.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},i.prototype.fromOrientedRange=function(o){this.setSelectionRange(o,o.cursor==o.start),this.$desiredColumn=o.desiredColumn||this.$desiredColumn},i.prototype.toOrientedRange=function(o){var n=this.getRange();return o?(o.start.column=n.start.column,o.start.row=n.start.row,o.end.column=n.end.column,o.end.row=n.end.row):o=n,o.cursor=this.isBackwards()?o.start:o.end,o.desiredColumn=this.$desiredColumn,o},i.prototype.getRangeOfMovements=function(o){var n=this.getCursor();try{o(this);var t=this.getCursor();return a.fromPoints(n,t)}catch{return a.fromPoints(n,n)}finally{this.moveCursorToPosition(n)}},i.prototype.toJSON=function(){if(this.rangeCount)var o=this.ranges.map(function(n){var t=n.clone();return t.isBackwards=n.cursor==n.start,t});else{var o=this.getRange();o.isBackwards=this.isBackwards()}return o},i.prototype.fromJSON=function(o){if(o.start==null)if(this.rangeList&&o.length>1){this.toSingleRange(o[0]);for(var n=o.length;n--;){var t=a.fromPoints(o[n].start,o[n].end);o[n].isBackwards&&(t.cursor=t.start),this.addRange(t,!0)}return}else o=o[0];this.rangeList&&this.toSingleRange(o),this.setSelectionRange(o,o.isBackwards)},i.prototype.isEqual=function(o){if((o.length||this.rangeCount)&&o.length!=this.rangeCount)return!1;if(!o.length||!this.ranges)return this.getRange().isEqual(o);for(var n=this.ranges.length;n--;)if(!this.ranges[n].isEqual(o[n]))return!1;return!0},i}();c.prototype.setSelectionAnchor=c.prototype.setAnchor,c.prototype.getSelectionAnchor=c.prototype.getAnchor,c.prototype.setSelectionRange=c.prototype.setRange,E.implement(c.prototype,$),x.Selection=c}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(k,x,H){var E=k("./lib/report_error").reportError,A=2e3,$=function(){function a(c){this.splitRegex,this.states=c,this.regExps={},this.matchMappings={};for(var i in this.states){for(var o=this.states[i],n=[],t=0,e=this.matchMappings[i]={defaultToken:"text"},r="g",s=[],l=0;l<o.length;l++){var h=o[l];if(h.defaultToken&&(e.defaultToken=h.defaultToken),h.caseInsensitive&&r.indexOf("i")===-1&&(r+="i"),h.unicode&&r.indexOf("u")===-1&&(r+="u"),h.regex!=null){h.regex instanceof RegExp&&(h.regex=h.regex.toString().slice(1,-1));var v=h.regex,m=new RegExp("(?:("+v+")|(.))").exec("a").length-2;Array.isArray(h.token)?h.token.length==1||m==1?h.token=h.token[0]:m-1!=h.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:h,groupCount:m-1}),h.token=h.token[0]):(h.tokenArray=h.token,h.token=null,h.onMatch=this.$arrayTokens):typeof h.token=="function"&&!h.onMatch&&(m>1?h.onMatch=this.$applyToken:h.onMatch=h.token),m>1&&(/\\\d/.test(h.regex)?v=h.regex.replace(/\\([0-9]+)/g,function(g,d){return"\\"+(parseInt(d,10)+t+1)}):(m=1,v=this.removeCapturingGroups(h.regex)),!h.splitRegex&&typeof h.token!="string"&&s.push(h)),e[t]=l,t+=m,n.push(v),h.onMatch||(h.onMatch=null)}}n.length||(e[0]=0,n.push("$")),s.forEach(function(g){g.splitRegex=this.createSplitterRegexp(g.regex,r)},this),this.regExps[i]=new RegExp("("+n.join(")|(")+")|($)",r)}}return a.prototype.$setMaxTokenCount=function(c){A=c|0},a.prototype.$applyToken=function(c){var i=this.splitRegex.exec(c).slice(1),o=this.token.apply(this,i);if(typeof o=="string")return[{type:o,value:c}];for(var n=[],t=0,e=o.length;t<e;t++)i[t]&&(n[n.length]={type:o[t],value:i[t]});return n},a.prototype.$arrayTokens=function(c){if(!c)return[];var i=this.splitRegex.exec(c);if(!i)return"text";for(var o=[],n=this.tokenArray,t=0,e=n.length;t<e;t++)i[t+1]&&(o[o.length]={type:n[t],value:i[t+1]});return o},a.prototype.removeCapturingGroups=function(c){var i=c.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(o,n){return n?"(?:":o});return i},a.prototype.createSplitterRegexp=function(c,i){if(c.indexOf("(?=")!=-1){var o=0,n=!1,t={};c.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,r,s,l,h,v){return n?n=h!="]":h?n=!0:l?(o==t.stack&&(t.end=v+1,t.stack=-1),o--):s&&(o++,s.length!=1&&(t.stack=o,t.start=v)),e}),t.end!=null&&/^\)*$/.test(c.substr(t.end))&&(c=c.substring(0,t.start)+c.substr(t.end))}return c.charAt(0)!="^"&&(c="^"+c),c.charAt(c.length-1)!="$"&&(c+="$"),new RegExp(c,(i||"").replace("g",""))},a.prototype.getLineTokens=function(c,i){if(i&&typeof i!="string"){var o=i.slice(0);i=o[0],i==="#tmp"&&(o.shift(),i=o.shift())}else var o=[];var n=i||"start",t=this.states[n];t||(n="start",t=this.states[n]);var e=this.matchMappings[n],r=this.regExps[n];r.lastIndex=0;for(var s,l=[],h=0,v=0,m={type:null,value:""};s=r.exec(c);){var g=e.defaultToken,d=null,b=s[0],M=r.lastIndex;if(M-b.length>h){var C=c.substring(h,M-b.length);m.type==g?m.value+=C:(m.type&&l.push(m),m={type:g,value:C})}for(var S=0;S<s.length-2;S++)if(s[S+1]!==void 0){d=t[e[S]],d.onMatch?g=d.onMatch(b,n,o,c):g=d.token,d.next&&(typeof d.next=="string"?n=d.next:n=d.next(n,o),t=this.states[n],t||(this.reportError("state doesn't exist",n),n="start",t=this.states[n]),e=this.matchMappings[n],h=M,r=this.regExps[n],r.lastIndex=M),d.consumeLineEnd&&(h=M);break}if(b){if(typeof g=="string")(!d||d.merge!==!1)&&m.type===g?m.value+=b:(m.type&&l.push(m),m={type:g,value:b});else if(g){m.type&&l.push(m),m={type:null,value:""};for(var S=0;S<g.length;S++)l.push(g[S])}}if(h==c.length)break;if(h=M,v++>A){for(v>2*c.length&&this.reportError("infinite loop with in ace tokenizer",{startState:i,line:c});h<c.length;)m.type&&l.push(m),m={value:c.substring(h,h+=500),type:"overflow"};n="start",o=[];break}}return m.type&&l.push(m),o.length>1&&o[0]!==n&&o.unshift("#tmp",n),{tokens:l,state:o.length?o:n}},a}();$.prototype.reportError=E,x.Tokenizer=$}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(k,x,H){var E=k("../lib/deep_copy").deepCopy,A;A=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(c,i){if(!i){for(var o in c)this.$rules[o]=c[o];return}for(var o in c){for(var n=c[o],t=0;t<n.length;t++){var e=n[t];(e.next||e.onMatch)&&(typeof e.next=="string"&&e.next.indexOf(i)!==0&&(e.next=i+e.next),e.nextState&&e.nextState.indexOf(i)!==0&&(e.nextState=i+e.nextState))}this.$rules[i+o]=n}},this.getRules=function(){return this.$rules},this.embedRules=function(c,i,o,n,t){var e=typeof c=="function"?new c().getRules():c;if(n)for(var r=0;r<n.length;r++)n[r]=i+n[r];else{n=[];for(var s in e)n.push(i+s)}if(this.addRules(e,i),o)for(var l=Array.prototype[t?"push":"unshift"],r=0;r<n.length;r++)l.apply(this.$rules[n[r]],E(o));this.$embeds||(this.$embeds=[]),this.$embeds.push(i)},this.getEmbeds=function(){return this.$embeds};var $=function(c,i){return(c!="start"||i.length)&&i.unshift(this.nextState,c),this.nextState},a=function(c,i){return i.shift(),i.shift()||"start"};this.normalizeRules=function(){var c=0,i=this.$rules;function o(n){var t=i[n];t.processed=!0;for(var e=0;e<t.length;e++){var r=t[e],s=null;Array.isArray(r)&&(s=r,r={}),!r.regex&&r.start&&(r.regex=r.start,r.next||(r.next=[]),r.next.push({defaultToken:r.token},{token:r.token+".end",regex:r.end||r.start,next:"pop"}),r.token=r.token+".start",r.push=!0);var l=r.next||r.push;if(l&&Array.isArray(l)){var h=r.stateName;h||(h=r.token,typeof h!="string"&&(h=h[0]||""),i[h]&&(h+=c++)),i[h]=l,r.next=h,o(h)}else l=="pop"&&(r.next=a);if(r.push&&(r.nextState=r.next||r.push,r.next=$,delete r.push),r.rules)for(var v in r.rules)i[v]?i[v].push&&i[v].push.apply(i[v],r.rules[v]):i[v]=r.rules[v];var m=typeof r=="string"?r:r.include;if(m&&(m==="$self"&&(m="start"),Array.isArray(m)?s=m.map(function(d){return i[d]}):s=i[m]),s){var g=[e,1].concat(s);r.noEscape&&(g=g.filter(function(d){return!d.next})),t.splice.apply(t,g),e--}r.keywordMap&&(r.token=this.createKeywordMapper(r.keywordMap,r.defaultToken||"text",r.caseInsensitive),delete r.defaultToken)}}Object.keys(i).forEach(o,this)},this.createKeywordMapper=function(c,i,o,n){var t=Object.create(null);return this.$keywordList=[],Object.keys(c).forEach(function(e){for(var r=c[e],s=r.split(n||"|"),l=s.length;l--;){var h=s[l];this.$keywordList.push(h),o&&(h=h.toLowerCase()),t[h]=e}},this),c=null,o?function(e){return t[e.toLowerCase()]||i}:function(e){return t[e]||i}},this.getKeywords=function(){return this.$keywords}}).call(A.prototype),x.TextHighlightRules=A}),ace.define("ace/mode/behaviour",["require","exports","module"],function(k,x,H){var E;E=function(){this.$behaviours={}},(function(){this.add=function(A,$,a){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[A]:this.$behaviours[A]={}}this.$behaviours[A][$]=a},this.addBehaviours=function(A){for(var $ in A)for(var a in A[$])this.add($,a,A[$][a])},this.remove=function(A){this.$behaviours&&this.$behaviours[A]&&delete this.$behaviours[A]},this.inherit=function(A,$){if(typeof A=="function")var a=new A().getBehaviours($);else var a=A.getBehaviours($);this.addBehaviours(a)},this.getBehaviours=function(A){if(A){for(var $={},a=0;a<A.length;a++)this.$behaviours[A[a]]&&($[A[a]]=this.$behaviours[A[a]]);return $}else return this.$behaviours}}).call(E.prototype),x.Behaviour=E}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(k,x,H){var E=k("./range").Range,A=function(){function $(a,c,i){this.$session=a,this.$row=c,this.$rowTokens=a.getTokens(c);var o=a.getTokenAt(c,i);this.$tokenIndex=o?o.index:-1}return $.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]},$.prototype.stepForward=function(){this.$tokenIndex+=1;for(var a;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,a||(a=this.$session.getLength()),this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},$.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},$.prototype.getCurrentTokenRow=function(){return this.$row},$.prototype.getCurrentTokenColumn=function(){var a=this.$rowTokens,c=this.$tokenIndex,i=a[c].start;if(i!==void 0)return i;for(i=0;c>0;)c-=1,i+=a[c].value.length;return i},$.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},$.prototype.getCurrentTokenRange=function(){var a=this.$rowTokens[this.$tokenIndex],c=this.getCurrentTokenColumn();return new E(this.$row,c,this.$row,c+a.value.length)},$}();x.TokenIterator=A}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(k,x,H){var E=k("../../lib/oop"),A=k("../behaviour").Behaviour,$=k("../../token_iterator").TokenIterator,a=k("../../lib/lang"),c=["text","paren.rparen","rparen","paren","punctuation.operator"],i=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],o,n={},t={'"':'"',"'":"'"},e=function(l){var h=-1;if(l.multiSelect&&(h=l.selection.index,n.rangeCount!=l.multiSelect.rangeCount&&(n={rangeCount:l.multiSelect.rangeCount})),n[h])return o=n[h];o=n[h]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},r=function(l,h,v,m){var g=l.end.row-l.start.row;return{text:v+h+m,selection:[0,l.start.column+1,g,l.end.column+(g?0:1)]}},s;s=function(l){l=l||{},this.add("braces","insertion",function(h,v,m,g,d){var b=m.getCursorPosition(),M=g.doc.getLine(b.row);if(d=="{"){e(m);var C=m.getSelectionRange(),S=g.doc.getTextRange(C),R=g.getTokenAt(b.row,b.column);if(S!==""&&S!=="{"&&m.getWrapBehavioursEnabled())return r(C,S,"{","}");if(R&&/(?:string)\.quasi|\.xml/.test(R.type)){var w=[/tag\-(?:open|name)/,/attribute\-name/];return w.some(function(_){return _.test(R.type)})||/(string)\.quasi/.test(R.type)&&R.value[b.column-R.start-1]!=="$"?void 0:(s.recordAutoInsert(m,g,"}"),{text:"{}",selection:[1,1]})}else if(s.isSaneInsertion(m,g))return/[\]\}\)]/.test(M[b.column])||m.inMultiSelectMode||l.braces?(s.recordAutoInsert(m,g,"}"),{text:"{}",selection:[1,1]}):(s.recordMaybeInsert(m,g,"{"),{text:"{",selection:[1,1]})}else if(d=="}"){e(m);var y=M.substring(b.column,b.column+1);if(y=="}"){var f=g.$findOpeningBracket("}",{column:b.column+1,row:b.row});if(f!==null&&s.isAutoInsertedClosing(b,M,d))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(d==`
179
+ `;T!=this.lastValue&&(this.text.value=this.lastValue=T,this.lastSelectionStart=this.lastSelectionEnd=T.length)}if(this.afterContextMenu&&(this.lastSelectionStart=this.text.selectionStart,this.lastSelectionEnd=this.text.selectionEnd),this.lastSelectionEnd!=M||this.lastSelectionStart!=b||this.text.selectionEnd!=this.lastSelectionEnd)try{this.text.setSelectionRange(b,M),this.lastSelectionStart=b,this.lastSelectionEnd=M}catch{}this.inComposition=!1}},g.prototype.setHost=function(d){this.host=d},g.prototype.setNumberOfExtraLines=function(d){if(this.rowStart=Number.MAX_SAFE_INTEGER,this.rowEnd=Number.MIN_SAFE_INTEGER,d<0){this.numberOfExtraLines=0;return}this.numberOfExtraLines=d},g.prototype.setAriaLabel=function(){var d="";if(this.host.$textInputAriaLabel&&(d+="".concat(this.host.$textInputAriaLabel,", ")),this.host.session){var b=this.host.session.selection.cursor.row;d+=A("text-input.aria-label","Cursor at row $0",[b+1])}this.text.setAttribute("aria-label",d)},g.prototype.setAriaOptions=function(d){d.activeDescendant?(this.text.setAttribute("aria-haspopup","true"),this.text.setAttribute("aria-autocomplete",d.inline?"both":"list"),this.text.setAttribute("aria-activedescendant",d.activeDescendant)):(this.text.setAttribute("aria-haspopup","false"),this.text.setAttribute("aria-autocomplete","both"),this.text.removeAttribute("aria-activedescendant")),d.role&&this.text.setAttribute("role",d.role),d.setLabel&&(this.text.setAttribute("aria-roledescription",A("text-input.aria-roledescription","editor")),this.setAriaLabel())},g.prototype.focus=function(){var d=this;if(this.setAriaOptions({setLabel:this.host.renderer.enableKeyboardAccessibility}),this.tempStyle||t||this.$focusScroll=="browser")return this.text.focus({preventScroll:!0});var b=this.text.style.top;this.text.style.position="fixed",this.text.style.top="0px";try{var M=this.text.getBoundingClientRect().top!=0}catch{return}var C=[];if(M)for(var S=this.text.parentElement;S&&S.nodeType==1;)C.push(S),S.setAttribute("ace_nocontext","true"),!S.parentElement&&S.getRootNode?S=S.getRootNode().host:S=S.parentElement;this.text.focus({preventScroll:!0}),M&&C.forEach(function(R){R.removeAttribute("ace_nocontext")}),setTimeout(function(){d.text.style.position="",d.text.style.top=="0px"&&(d.text.style.top=b)},0)},g.prototype.blur=function(){this.text.blur()},g.prototype.isFocused=function(){return this.$isFocused},g.prototype.setInputHandler=function(d){this.inputHandler=d},g.prototype.getInputHandler=function(){return this.inputHandler},g.prototype.getElement=function(){return this.text},g.prototype.setCommandMode=function(d){this.commandMode=d,this.text.readOnly=!1},g.prototype.setReadOnly=function(d){this.commandMode||(this.text.readOnly=d)},g.prototype.setCopyWithEmptySelection=function(d){},g.prototype.onContextMenu=function(d){this.afterContextMenu=!0,this.resetSelection(),this.host._emit("nativecontextmenu",{target:this.host,domEvent:d}),this.moveToMouse(d,!0)},g.prototype.moveToMouse=function(d,b){var M=this;this.tempStyle||(this.tempStyle=this.text.style.cssText),this.text.style.cssText=(b?"z-index:100000;":"")+($.isIE?"opacity:0.1;":"")+"text-indent: -"+(this.lastSelectionStart+this.lastSelectionEnd)*this.host.renderer.characterWidth*.5+"px;";var C=this.host.container.getBoundingClientRect(),S=a.computedStyle(this.host.container),R=C.top+(parseInt(S.borderTopWidth)||0),w=C.left+(parseInt(S.borderLeftWidth)||0),y=C.bottom-R-this.text.clientHeight-2,f=function(u){a.translate(M.text,u.clientX-w-2,Math.min(u.clientY-R-2,y))};f(d),d.type=="mousedown"&&(this.host.renderer.$isMousePressed=!0,clearTimeout(this.closeTimeout),$.isWin&&E.capture(this.host.container,f,this.onContextMenuClose.bind(this)))},g.prototype.destroy=function(){this.text.parentElement&&this.text.parentElement.removeChild(this.text)},g}();L.TextInput=m,L.$setUserAgentForTests=function(g,d){v=g,l=d}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(k,L,H){var E=k("../lib/useragent"),A=0,$=550,a=function(){function o(n){n.$clickSelection=null;var t=n.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(n)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(n)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(n)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(n)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(n));var e=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];e.forEach(function(r){n[r]=this[r]},this),n.selectByLines=this.extendSelectionBy.bind(n,"getLineRange"),n.selectByWords=this.extendSelectionBy.bind(n,"getWordRange")}return o.prototype.onMouseDown=function(n){var t=n.inSelection(),e=n.getDocumentPosition();this.mousedownEvent=n;var r=this.editor,s=n.getButton();if(s!==0){var l=r.getSelectionRange(),h=l.isEmpty();(h||s==1)&&r.selection.moveToPosition(e),s==2&&(r.textInput.onContextMenu(n.domEvent),E.isMozilla||n.preventDefault());return}if(this.mousedownEvent.time=Date.now(),t&&!r.isFocused()&&(r.focus(),this.$focusTimeout&&!this.$clickSelection&&!r.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(n);return}return this.captureMouse(n),this.startSelect(e,n.domEvent._clicks>1),n.preventDefault()},o.prototype.startSelect=function(n,t){n=n||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var e=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?e.selection.selectToPosition(n):t||e.selection.moveToPosition(n),t||this.select(),e.setStyle("ace_selecting"),this.setState("select"))},o.prototype.select=function(){var n,t=this.editor,e=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(e);if(r==-1)n=this.$clickSelection.end;else if(r==1)n=this.$clickSelection.start;else{var s=i(this.$clickSelection,e);e=s.cursor,n=s.anchor}t.selection.setSelectionAnchor(n.row,n.column)}t.selection.selectToPosition(e),t.renderer.scrollCursorIntoView()},o.prototype.extendSelectionBy=function(n){var t,e=this.editor,r=e.renderer.screenToTextCoordinates(this.x,this.y),s=e.selection[n](r.row,r.column);if(this.$clickSelection){var l=this.$clickSelection.comparePoint(s.start),h=this.$clickSelection.comparePoint(s.end);if(l==-1&&h<=0)t=this.$clickSelection.end,(s.end.row!=r.row||s.end.column!=r.column)&&(r=s.start);else if(h==1&&l>=0)t=this.$clickSelection.start,(s.start.row!=r.row||s.start.column!=r.column)&&(r=s.end);else if(l==-1&&h==1)r=s.end,t=s.start;else{var v=i(this.$clickSelection,r);r=v.cursor,t=v.anchor}e.selection.setSelectionAnchor(t.row,t.column)}e.selection.selectToPosition(r),e.renderer.scrollCursorIntoView()},o.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},o.prototype.focusWait=function(){var n=c(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(n>A||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},o.prototype.onDoubleClick=function(n){var t=n.getDocumentPosition(),e=this.editor,r=e.session,s=r.getBracketRange(t);s?(s.isEmpty()&&(s.start.column--,s.end.column++),this.setState("select")):(s=e.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=s,this.select()},o.prototype.onTripleClick=function(n){var t=n.getDocumentPosition(),e=this.editor;this.setState("selectByLines");var r=e.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=e.selection.getLineRange(r.start.row),this.$clickSelection.end=e.selection.getLineRange(r.end.row).end):this.$clickSelection=e.selection.getLineRange(t.row),this.select()},o.prototype.onQuadClick=function(n){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},o.prototype.onMouseWheel=function(n){if(!n.getAccelKey()){n.getShiftKey()&&n.wheelY&&!n.wheelX&&(n.wheelX=n.wheelY,n.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var e=this.$lastScroll,r=n.domEvent.timeStamp,s=r-e.t,l=s?n.wheelX/s:e.vx,h=s?n.wheelY/s:e.vy;s<$&&(l=(l+e.vx)/2,h=(h+e.vy)/2);var v=Math.abs(l/h),m=!1;if(v>=1&&t.renderer.isScrollableBy(n.wheelX*n.speed,0)&&(m=!0),v<=1&&t.renderer.isScrollableBy(0,n.wheelY*n.speed)&&(m=!0),m)e.allowed=r;else if(r-e.allowed<$){var g=Math.abs(l)<=1.5*Math.abs(e.vx)&&Math.abs(h)<=1.5*Math.abs(e.vy);g?(m=!0,e.allowed=r):e.allowed=0}if(e.t=r,e.vx=l,e.vy=h,m)return t.renderer.scrollBy(n.wheelX*n.speed,n.wheelY*n.speed),n.stop()}},o}();a.prototype.selectEnd=a.prototype.selectByLinesEnd,a.prototype.selectAllEnd=a.prototype.selectByLinesEnd,a.prototype.selectByWordsEnd=a.prototype.selectByLinesEnd,L.DefaultHandlers=a;function c(o,n,t,e){return Math.sqrt(Math.pow(t-o,2)+Math.pow(e-n,2))}function i(o,n){if(o.start.row==o.end.row)var t=2*n.column-o.start.column-o.end.column;else if(o.start.row==o.end.row-1&&!o.start.column&&!o.end.column)var t=n.column-4;else var t=2*n.row-o.start.row-o.end.row;return t<0?{cursor:o.start,anchor:o.end}:{cursor:o.end,anchor:o.start}}}),ace.define("ace/lib/scroll",["require","exports","module"],function(k,L,H){L.preventParentScroll=function(A){A.stopPropagation();var $=A.currentTarget,a=$.scrollHeight>$.clientHeight;a||A.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(k,L,H){var E=this&&this.__extends||function(){var r=function(s,l){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var m in v)Object.prototype.hasOwnProperty.call(v,m)&&(h[m]=v[m])},r(s,l)};return function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");r(s,l);function h(){this.constructor=s}s.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}}(),A=this&&this.__values||function(r){var s=typeof Symbol=="function"&&Symbol.iterator,l=s&&r[s],h=0;if(l)return l.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&h>=r.length&&(r=void 0),{value:r&&r[h++],done:!r}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},$=k("./lib/dom");k("./lib/event");var a=k("./range").Range,c=k("./lib/scroll").preventParentScroll,i="ace_tooltip",o=function(){function r(s){this.isOpen=!1,this.$element=null,this.$parentNode=s}return r.prototype.$init=function(){return this.$element=$.createElement("div"),this.$element.className=i,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},r.prototype.getElement=function(){return this.$element||this.$init()},r.prototype.setText=function(s){this.getElement().textContent=s},r.prototype.setHtml=function(s){this.getElement().innerHTML=s},r.prototype.setPosition=function(s,l){this.getElement().style.left=s+"px",this.getElement().style.top=l+"px"},r.prototype.setClassName=function(s){$.addCssClass(this.getElement(),s)},r.prototype.setTheme=function(s){this.$element.className=i+" "+(s.isDark?"ace_dark ":"")+(s.cssClass||"")},r.prototype.show=function(s,l,h){s!=null&&this.setText(s),l!=null&&h!=null&&this.setPosition(l,h),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},r.prototype.hide=function(s){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=i,this.isOpen=!1)},r.prototype.getHeight=function(){return this.getElement().offsetHeight},r.prototype.getWidth=function(){return this.getElement().offsetWidth},r.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},r}(),n=function(){function r(){this.popups=[]}return r.prototype.addPopup=function(s){this.popups.push(s),this.updatePopups()},r.prototype.removePopup=function(s){var l=this.popups.indexOf(s);l!==-1&&(this.popups.splice(l,1),this.updatePopups())},r.prototype.updatePopups=function(){var s,l,h,v;this.popups.sort(function(w,y){return y.priority-w.priority});var m=[];try{for(var g=A(this.popups),d=g.next();!d.done;d=g.next()){var b=d.value,M=!0;try{for(var C=(h=void 0,A(m)),S=C.next();!S.done;S=C.next()){var R=S.value;if(this.doPopupsOverlap(R,b)){M=!1;break}}}catch(w){h={error:w}}finally{try{S&&!S.done&&(v=C.return)&&v.call(C)}finally{if(h)throw h.error}}M?m.push(b):b.hide()}}catch(w){s={error:w}}finally{try{d&&!d.done&&(l=g.return)&&l.call(g)}finally{if(s)throw s.error}}},r.prototype.doPopupsOverlap=function(s,l){var h=s.getElement().getBoundingClientRect(),v=l.getElement().getBoundingClientRect();return h.left<v.right&&h.right>v.left&&h.top<v.bottom&&h.bottom>v.top},r}(),t=new n;L.popupManager=t,L.Tooltip=o;var e=function(r){E(s,r);function s(l){l===void 0&&(l=document.body);var h=r.call(this,l)||this;h.timeout=void 0,h.lastT=0,h.idleTime=350,h.lastEvent=void 0,h.onMouseOut=h.onMouseOut.bind(h),h.onMouseMove=h.onMouseMove.bind(h),h.waitForHover=h.waitForHover.bind(h),h.hide=h.hide.bind(h);var v=h.getElement();return v.style.whiteSpace="pre-wrap",v.style.pointerEvents="auto",v.addEventListener("mouseout",h.onMouseOut),v.tabIndex=-1,v.addEventListener("blur",(function(){v.contains(document.activeElement)||this.hide()}).bind(h)),v.addEventListener("wheel",c),h}return s.prototype.addToEditor=function(l){l.on("mousemove",this.onMouseMove),l.on("mousedown",this.hide),l.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},s.prototype.removeFromEditor=function(l){l.off("mousemove",this.onMouseMove),l.off("mousedown",this.hide),l.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},s.prototype.onMouseMove=function(l,h){this.lastEvent=l,this.lastT=Date.now();var v=h.$mouseHandler.isMousePressed;if(this.isOpen){var m=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(m.row,m.column)||v||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||v||(this.lastEvent=l,this.timeout=setTimeout(this.waitForHover,this.idleTime))},s.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var l=Date.now()-this.lastT;if(this.idleTime-l>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-l);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},s.prototype.isOutsideOfText=function(l){var h=l.editor,v=l.getDocumentPosition(),m=h.session.getLine(v.row);if(v.column==m.length){var g=h.renderer.pixelToScreenCoordinates(l.clientX,l.clientY),d=h.session.documentToScreenPosition(v.row,v.column);if(d.column!=g.column||d.row!=g.row)return!0}return!1},s.prototype.setDataProvider=function(l){this.$gatherData=l},s.prototype.showForRange=function(l,h,v,m){var g=10;if(!(m&&m!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var d=l.renderer;this.isOpen||(t.addPopup(this),this.$registerCloseEvents(),this.setTheme(d.theme)),this.isOpen=!0,this.addMarker(h,l.session),this.range=a.fromPoints(h.start,h.end);var b=d.textToScreenCoordinates(h.start.row,h.start.column),M=d.scroller.getBoundingClientRect();b.pageX<M.left&&(b.pageX=M.left);var C=this.getElement();C.innerHTML="",C.appendChild(v),C.style.maxHeight="",C.style.display="block";var S=C.clientHeight,R=C.clientWidth,w=window.innerHeight-b.pageY-d.lineHeight,y=!0;b.pageY-S<0&&b.pageY<w&&(y=!1),C.style.maxHeight=(y?b.pageY:w)-g+"px",C.style.top=y?"":b.pageY+d.lineHeight+"px",C.style.bottom=y?window.innerHeight-b.pageY+"px":"",C.style.left=Math.min(b.pageX,window.innerWidth-R-g)+"px"}},s.prototype.addMarker=function(l,h){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=h,this.marker=h&&h.addMarker(l,"ace_highlight-marker","text")},s.prototype.hide=function(l){!l&&document.activeElement==this.getElement()||l&&l.target&&(l.type!="keydown"||l.ctrlKey||l.metaKey)&&this.$element.contains(l.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,t.removePopup(this)))},s.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},s.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},s.prototype.onMouseOut=function(l){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!l.relatedTarget||this.getElement().contains(l.relatedTarget)||l&&l.currentTarget.contains(l.relatedTarget)||l.relatedTarget.classList.contains("ace_content")||this.hide())},s}(o);L.HoverTooltip=e}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config"],function(k,L,H){var E=this&&this.__extends||function(){var r=function(s,l){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var m in v)Object.prototype.hasOwnProperty.call(v,m)&&(h[m]=v[m])},r(s,l)};return function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");r(s,l);function h(){this.constructor=s}s.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}}(),A=this&&this.__values||function(r){var s=typeof Symbol=="function"&&Symbol.iterator,l=s&&r[s],h=0;if(l)return l.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&h>=r.length&&(r=void 0),{value:r&&r[h++],done:!r}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},$=k("../lib/dom"),a=k("../lib/event"),c=k("../tooltip").Tooltip,i=k("../config").nls,o=5,n=3;L.GUTTER_TOOLTIP_LEFT_OFFSET=o,L.GUTTER_TOOLTIP_TOP_OFFSET=n;function t(r){var s=r.editor,l=s.renderer.$gutterLayer,h=new e(s,!0);r.editor.setDefaultHandler("guttermousedown",function(M){if(!(!s.isFocused()||M.getButton()!=0)){var C=l.getRegion(M);if(C!="foldWidgets"){var S=M.getDocumentPosition().row,R=s.session.selection;if(M.getShiftKey())R.selectTo(S,0);else{if(M.domEvent.detail==2)return s.selectAll(),M.preventDefault();r.$clickSelection=s.selection.getLineRange(S)}return r.setState("selectByLines"),r.captureMouse(M),M.preventDefault()}}});var v,m;function g(){var M=m.getDocumentPosition().row,C=s.session.getLength();if(M==C){var S=s.renderer.pixelToScreenCoordinates(0,m.y).row,R=m.$pos;if(S>s.session.documentToScreenRow(R.row,R.column))return d()}if(h.showTooltip(M),!!h.isOpen)if(s.on("mousewheel",d),s.on("changeSession",d),window.addEventListener("keydown",d,!0),r.$tooltipFollowsMouse)b(m);else{var w=m.getGutterRow(),y=l.$lines.get(w);if(y){var f=y.element.querySelector(".ace_gutter_annotation"),u=f.getBoundingClientRect(),p=h.getElement().style;p.left=u.right-o+"px",p.top=u.bottom-n+"px"}else b(m)}}function d(M){M&&M.type==="keydown"&&(M.ctrlKey||M.metaKey)||M&&M.type==="mouseout"&&(!M.relatedTarget||h.getElement().contains(M.relatedTarget))||(v&&(v=clearTimeout(v)),h.isOpen&&(h.hideTooltip(),s.off("mousewheel",d),s.off("changeSession",d),window.removeEventListener("keydown",d,!0)))}function b(M){h.setPosition(M.x,M.y)}r.editor.setDefaultHandler("guttermousemove",function(M){var C=M.domEvent.target||M.domEvent.srcElement;if($.hasCssClass(C,"ace_fold-widget")||$.hasCssClass(C,"ace_custom-widget"))return d();h.isOpen&&r.$tooltipFollowsMouse&&b(M),m=M,!v&&(v=setTimeout(function(){v=null,m&&!r.isMousePressed&&g()},50))}),a.addListener(s.renderer.$gutter,"mouseout",function(M){m=null,h.isOpen&&(v=setTimeout(function(){v=null,d(M)},50))},s)}L.GutterHandler=t;var e=function(r){E(s,r);function s(l,h){h===void 0&&(h=!1);var v=r.call(this,l.container)||this;v.id="gt"+ ++s.$uid,v.editor=l,v.visibleTooltipRow;var m=v.getElement();return m.setAttribute("role","tooltip"),m.setAttribute("id",v.id),m.style.pointerEvents="auto",h&&(v.onMouseOut=v.onMouseOut.bind(v),m.addEventListener("mouseout",v.onMouseOut)),v}return s.prototype.onMouseOut=function(l){this.isOpen&&(!l.relatedTarget||this.getElement().contains(l.relatedTarget)||l&&l.currentTarget.contains(l.relatedTarget)||this.hideTooltip())},s.prototype.setPosition=function(l,h){var v=window.innerWidth||document.documentElement.clientWidth,m=window.innerHeight||document.documentElement.clientHeight,g=this.getWidth(),d=this.getHeight();l+=15,h+=15,l+g>v&&(l-=l+g-v),h+d>m&&(h-=20+d),c.prototype.setPosition.call(this,l,h)},Object.defineProperty(s,"annotationLabels",{get:function(){return{error:{singular:i("gutter-tooltip.aria-label.error.singular","error"),plural:i("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:i("gutter-tooltip.aria-label.security.singular","security finding"),plural:i("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:i("gutter-tooltip.aria-label.warning.singular","warning"),plural:i("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:i("gutter-tooltip.aria-label.info.singular","information message"),plural:i("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:i("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:i("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),s.prototype.showTooltip=function(l){var h,v=this.editor.renderer.$gutterLayer,m=v.$annotations[l],g;m?g={displayText:Array.from(m.displayText),type:Array.from(m.type)}:g={displayText:[],type:[]};var d=v.session.getFoldLine(l);if(d&&v.$showFoldedAnnotations){for(var b={error:[],security:[],warning:[],info:[],hint:[]},M={error:1,security:2,warning:3,info:4,hint:5},C,S=l+1;S<=d.end.row;S++)if(v.$annotations[S])for(var R=0;R<v.$annotations[S].text.length;R++){var w=v.$annotations[S].type[R];b[w].push(v.$annotations[S].text[R]),(!C||M[w]<M[C])&&(C=w)}if(["error","security","warning"].includes(C)){var y="".concat(s.annotationsToSummaryString(b)," in folded code.");g.displayText.push(y),g.type.push(C+"_fold")}}if(g.displayText.length===0)return this.hideTooltip();for(var f={error:[],security:[],warning:[],info:[],hint:[]},u=v.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",S=0;S<g.displayText.length;S++){var p=$.createElement("span"),x=$.createElement("span");(h=x.classList).add.apply(h,["ace_".concat(g.type[S]),u]),x.setAttribute("aria-label","".concat(s.annotationLabels[g.type[S].replace("_fold","")].singular)),x.setAttribute("role","img"),x.appendChild($.createTextNode(" ")),p.appendChild(x),p.appendChild($.createTextNode(g.displayText[S])),p.appendChild($.createElement("br")),f[g.type[S].replace("_fold","")].push(p)}var T=this.getElement();$.removeChildren(T),f.error.forEach(function(I){return T.appendChild(I)}),f.security.forEach(function(I){return T.appendChild(I)}),f.warning.forEach(function(I){return T.appendChild(I)}),f.info.forEach(function(I){return T.appendChild(I)}),f.hint.forEach(function(I){return T.appendChild(I)}),T.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip"));var _=this.$findLinkedAnnotationNode(l);_&&_.setAttribute("aria-describedby",this.id),this.show(),this.visibleTooltipRow=l,this.editor._signal("showGutterTooltip",this)},s.prototype.$findLinkedAnnotationNode=function(l){var h=this.$findCellByRow(l);if(h){var v=h.element;if(v.childNodes.length>2)return v.childNodes[2]}},s.prototype.$findCellByRow=function(l){return this.editor.renderer.$gutterLayer.$lines.cells.find(function(h){return h.row===l})},s.prototype.hideTooltip=function(){if(this.isOpen){if(this.$element.removeAttribute("aria-live"),this.hide(),this.visibleTooltipRow!=null){var l=this.$findLinkedAnnotationNode(this.visibleTooltipRow);l&&l.removeAttribute("aria-describedby")}this.visibleTooltipRow=void 0,this.editor._signal("hideGutterTooltip",this)}},s.annotationsToSummaryString=function(l){var h,v,m=[],g=["error","security","warning","info","hint"];try{for(var d=A(g),b=d.next();!b.done;b=d.next()){var M=b.value;if(l[M].length){var C=l[M].length===1?s.annotationLabels[M].singular:s.annotationLabels[M].plural;m.push("".concat(l[M].length," ").concat(C))}}}catch(S){h={error:S}}finally{try{b&&!b.done&&(v=d.return)&&v.call(d)}finally{if(h)throw h.error}}return m.join(", ")},s}(c);e.$uid=0,L.GutterTooltip=e}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(k,L,H){var E=k("../lib/event"),A=k("../lib/useragent"),$=function(){function a(c,i){this.speed,this.wheelX,this.wheelY,this.domEvent=c,this.editor=i,this.x=this.clientX=c.clientX,this.y=this.clientY=c.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return a.prototype.stopPropagation=function(){E.stopPropagation(this.domEvent),this.propagationStopped=!0},a.prototype.preventDefault=function(){E.preventDefault(this.domEvent),this.defaultPrevented=!0},a.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},a.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},a.prototype.getGutterRow=function(){var c=this.getDocumentPosition().row,i=this.editor.session.documentToScreenRow(c,0),o=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return i-o},a.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var c=this.editor,i=c.getSelectionRange();if(i.isEmpty())this.$inSelection=!1;else{var o=this.getDocumentPosition();this.$inSelection=i.contains(o.row,o.column)}return this.$inSelection},a.prototype.getButton=function(){return E.getButton(this.domEvent)},a.prototype.getShiftKey=function(){return this.domEvent.shiftKey},a.prototype.getAccelKey=function(){return A.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},a}();L.MouseEvent=$}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(k,L,H){var E=k("../lib/dom"),A=k("../lib/event"),$=k("../lib/useragent"),a=200,c=200,i=5;function o(t){var e=t.editor,r=E.createElement("div");r.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",r.textContent=" ";var s=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];s.forEach(function(D){t[D]=this[D]},this),e.on("mousedown",this.onMouseDown.bind(t));var l=e.container,h,v,m,g,d,b,M=0,C,S,R,w,y;this.onDragStart=function(D){if(this.cancelDrag||!l.draggable){var N=this;return setTimeout(function(){N.startSelect(),N.captureMouse(D)},0),D.preventDefault()}d=e.getSelectionRange();var F=D.dataTransfer;F.effectAllowed=e.getReadOnly()?"copy":"copyMove",e.container.appendChild(r),F.setDragImage&&F.setDragImage(r,0,0),setTimeout(function(){e.container.removeChild(r)}),F.clearData(),F.setData("Text",e.session.getTextRange()),S=!0,this.setState("drag")},this.onDragEnd=function(D){if(l.draggable=!1,S=!1,this.setState(null),!e.getReadOnly()){var N=D.dataTransfer.dropEffect;!C&&N=="move"&&e.session.remove(e.getSelectionRange()),e.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(D){if(!(e.getReadOnly()||!O(D.dataTransfer)))return v=D.clientX,m=D.clientY,h||x(),M++,D.dataTransfer.dropEffect=C=z(D),A.preventDefault(D)},this.onDragOver=function(D){if(!(e.getReadOnly()||!O(D.dataTransfer)))return v=D.clientX,m=D.clientY,h||(x(),M++),_!==null&&(_=null),D.dataTransfer.dropEffect=C=z(D),A.preventDefault(D)},this.onDragLeave=function(D){if(M--,M<=0&&h)return T(),C=null,A.preventDefault(D)},this.onDrop=function(D){if(b){var N=D.dataTransfer;if(S)switch(C){case"move":d.contains(b.row,b.column)?d={start:b,end:b}:d=e.moveText(d,b);break;case"copy":d=e.moveText(d,b,!0);break}else{var F=N.getData("Text");d={start:b,end:e.session.insert(b,F)},e.focus(),C=null}return T(),A.preventDefault(D)}},A.addListener(l,"dragstart",this.onDragStart.bind(t),e),A.addListener(l,"dragend",this.onDragEnd.bind(t),e),A.addListener(l,"dragenter",this.onDragEnter.bind(t),e),A.addListener(l,"dragover",this.onDragOver.bind(t),e),A.addListener(l,"dragleave",this.onDragLeave.bind(t),e),A.addListener(l,"drop",this.onDrop.bind(t),e);function f(D,N){var F=Date.now(),B=!N||D.row!=N.row,P=!N||D.column!=N.column;if(!w||B||P)e.moveCursorToPosition(D),w=F,y={x:v,y:m};else{var V=n(y.x,y.y,v,m);V>i?w=null:F-w>=c&&(e.renderer.scrollCursorIntoView(),w=null)}}function u(D,N){var F=Date.now(),B=e.renderer.layerConfig.lineHeight,P=e.renderer.layerConfig.characterWidth,V=e.renderer.scroller.getBoundingClientRect(),G={x:{left:v-V.left,right:V.right-v},y:{top:m-V.top,bottom:V.bottom-m}},j=Math.min(G.x.left,G.x.right),K=Math.min(G.y.top,G.y.bottom),Q={row:D.row,column:D.column};j/P<=2&&(Q.column+=G.x.left<G.x.right?-3:2),K/B<=1&&(Q.row+=G.y.top<G.y.bottom?-1:1);var X=D.row!=Q.row,J=D.column!=Q.column,Z=!N||D.row!=N.row;X||J&&!Z?R?F-R>=a&&e.renderer.scrollCursorIntoView(Q):R=F:R=null}function p(){var D=b;b=e.renderer.screenToTextCoordinates(v,m),f(b,D),u(b,D)}function x(){d=e.selection.toOrientedRange(),h=e.session.addMarker(d,"ace_selection",e.getSelectionStyle()),e.clearSelection(),e.isFocused()&&e.renderer.$cursorLayer.setBlinking(!1),clearInterval(g),p(),g=setInterval(p,20),M=0,A.addListener(document,"mousemove",I)}function T(){clearInterval(g),e.session.removeMarker(h),h=null,e.selection.fromOrientedRange(d),e.isFocused()&&!S&&e.$resetCursorStyle(),d=null,b=null,M=0,R=null,w=null,A.removeListener(document,"mousemove",I)}var _=null;function I(){_==null&&(_=setTimeout(function(){_!=null&&h&&T()},20))}function O(D){var N=D.types;return!N||Array.prototype.some.call(N,function(F){return F=="text/plain"||F=="Text"})}function z(D){var N=["copy","copymove","all","uninitialized"],F=["move","copymove","linkmove","all","uninitialized"],B=$.isMac?D.altKey:D.ctrlKey,P="uninitialized";try{P=D.dataTransfer.effectAllowed.toLowerCase()}catch{}var V="none";return B&&N.indexOf(P)>=0?V="copy":F.indexOf(P)>=0?V="move":N.indexOf(P)>=0&&(V="copy"),V}}(function(){this.dragWait=function(){var t=Date.now()-this.mousedownEvent.time;t>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var t=this.editor.container;t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(t){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var t=this.editor,e=t.container;e.draggable=!0,t.renderer.$cursorLayer.setBlinking(!1),t.setStyle("ace_dragging");var r=$.isWin?"default":"move";t.renderer.setCursorStyle(r),this.setState("dragReady")},this.onMouseDrag=function(t){var e=this.editor.container;if($.isIE&&this.state=="dragReady"){var r=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);r>3&&e.dragDrop()}if(this.state==="dragWait"){var r=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);r>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(t){if(this.$dragEnabled){this.mousedownEvent=t;var e=this.editor,r=t.inSelection(),s=t.getButton(),l=t.domEvent.detail||1;if(l===1&&s===0&&r){if(t.editor.inMultiSelectMode&&(t.getAccelKey()||t.getShiftKey()))return;this.mousedownEvent.time=Date.now();var h=t.domEvent.target||t.domEvent.srcElement;if("unselectable"in h&&(h.unselectable="on"),e.getDragDelay()){if($.isWebKit){this.cancelDrag=!0;var v=e.container;v.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(t,this.onMouseDrag.bind(this)),t.defaultPrevented=!0}}}}).call(o.prototype);function n(t,e,r,s){return Math.sqrt(Math.pow(r-t,2)+Math.pow(s-e,2))}L.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(k,L,H){var E=k("./mouse_event").MouseEvent,A=k("../lib/event"),$=k("../lib/dom");L.addTouchListeners=function(a,c){var i="scroll",o,n,t,e,r,s,l=0,h,v=0,m=0,g=0,d,b;function M(){var f=window.navigator&&window.navigator.clipboard,u=!1,p=function(){var _=c.getCopyText(),I=c.session.getUndoManager().hasUndo();b.replaceChild($.buildDom(u?["span",!_&&x("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],_&&x("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],_&&x("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],f&&x("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],I&&x("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],x("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],x("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),b.firstChild)},x=function(_){return c.commands.canExecute(_,c)},T=function(_){var I=_.target.getAttribute("action");if(I=="more"||!u)return u=!u,p();I=="paste"?f.readText().then(function(O){c.execCommand(I,O)}):I&&((I=="cut"||I=="copy")&&(f?f.writeText(c.getCopyText()):document.execCommand("copy")),c.execCommand(I)),b.firstChild.style.display="none",u=!1,I!="openCommandPalette"&&c.focus()};b=$.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(_){i="menu",_.stopPropagation(),_.preventDefault(),c.textInput.focus()},ontouchend:function(_){_.stopPropagation(),_.preventDefault(),T(_)},onclick:T},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],c.container)}function C(){if(!c.getOption("enableMobileMenu")){b&&S();return}b||M();var f=c.selection.cursor,u=c.renderer.textToScreenCoordinates(f.row,f.column),p=c.renderer.textToScreenCoordinates(0,0).pageX,x=c.renderer.scrollLeft,T=c.container.getBoundingClientRect();b.style.top=u.pageY-T.top-3+"px",u.pageX-T.left<T.width-70?(b.style.left="",b.style.right="10px"):(b.style.right="",b.style.left=p+x-T.left+"px"),b.style.display="",b.firstChild.style.display="none",c.on("input",S)}function S(f){b&&(b.style.display="none"),c.off("input",S)}function R(){r=null,clearTimeout(r);var f=c.selection.getRange(),u=f.contains(h.row,h.column);(f.isEmpty()||!u)&&(c.selection.moveToPosition(h),c.selection.selectWord()),i="wait",C()}function w(){r=null,clearTimeout(r),c.selection.moveToPosition(h);var f=v>=2?c.selection.getLineRange(h.row):c.session.getBracketRange(h);f&&!f.isEmpty()?c.selection.setRange(f):c.selection.selectWord(),i="wait"}A.addListener(a,"contextmenu",function(f){if(d){var u=c.textInput.getElement();u.focus()}},c),A.addListener(a,"touchstart",function(f){var u=f.touches;if(r||u.length>1){clearTimeout(r),r=null,t=-1,i="zoom";return}d=c.$mouseHandler.isMousePressed=!0;var p=c.renderer.layerConfig.lineHeight,x=c.renderer.layerConfig.lineHeight,T=f.timeStamp;e=T;var _=u[0],I=_.clientX,O=_.clientY;Math.abs(o-I)+Math.abs(n-O)>p&&(t=-1),o=f.clientX=I,n=f.clientY=O,m=g=0;var z=new E(f,c);if(h=z.getDocumentPosition(),T-t<500&&u.length==1&&!l)v++,f.preventDefault(),f.button=0,w();else{v=0;var D=c.selection.cursor,N=c.selection.isEmpty()?D:c.selection.anchor,F=c.renderer.$cursorLayer.getPixelPosition(D,!0),B=c.renderer.$cursorLayer.getPixelPosition(N,!0),P=c.renderer.scroller.getBoundingClientRect(),V=c.renderer.layerConfig.offset,G=c.renderer.scrollLeft,j=function(X,J){return X=X/x,J=J/p-.75,X*X+J*J};if(f.clientX<P.left){i="zoom";return}var K=j(f.clientX-P.left-F.left+G,f.clientY-P.top-F.top+V),Q=j(f.clientX-P.left-B.left+G,f.clientY-P.top-B.top+V);K<3.5&&Q<3.5&&(i=K>Q?"cursor":"anchor"),Q<3.5?i="anchor":K<3.5?i="cursor":i="scroll",r=setTimeout(R,450)}t=T},c),A.addListener(a,"touchend",function(f){d=c.$mouseHandler.isMousePressed=!1,s&&clearInterval(s),i=="zoom"?(i="",l=0):r?(c.selection.moveToPosition(h),l=0,C()):i=="scroll"?(y(),S()):C(),clearTimeout(r),r=null},c),A.addListener(a,"touchmove",function(f){r&&(clearTimeout(r),r=null);var u=f.touches;if(!(u.length>1||i=="zoom")){var p=u[0],x=o-p.clientX,T=n-p.clientY;if(i=="wait")if(x*x+T*T>4)i="cursor";else return f.preventDefault();o=p.clientX,n=p.clientY,f.clientX=p.clientX,f.clientY=p.clientY;var _=f.timeStamp,I=_-e;if(e=_,i=="scroll"){var O=new E(f,c);O.speed=1,O.wheelX=x,O.wheelY=T,10*Math.abs(x)<Math.abs(T)&&(x=0),10*Math.abs(T)<Math.abs(x)&&(T=0),I!=0&&(m=x/I,g=T/I),c._emit("mousewheel",O),O.propagationStopped||(m=g=0)}else{var z=new E(f,c),D=z.getDocumentPosition();i=="cursor"?c.selection.moveCursorToPosition(D):i=="anchor"&&c.selection.setSelectionAnchor(D.row,D.column),c.renderer.scrollCursorIntoView(D),f.preventDefault()}}},c);function y(){l+=60,s=setInterval(function(){l--<=0&&(clearInterval(s),s=null),Math.abs(m)<.01&&(m=0),Math.abs(g)<.01&&(g=0),l<20&&(m=.9*m),l<20&&(g=.9*g);var f=c.session.getScrollTop();c.renderer.scrollBy(10*m,10*g),f==c.session.getScrollTop()&&(l=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(k,L,H){var E=k("../lib/event"),A=k("../lib/useragent"),$=k("./default_handlers").DefaultHandlers,a=k("./default_gutter_handler").GutterHandler,c=k("./mouse_event").MouseEvent,i=k("./dragdrop_handler").DragdropHandler,o=k("./touch_handler").addTouchListeners,n=k("../config"),t=function(){function e(r){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var s=this;this.editor=r,new $(this),new a(this),new i(this);var l=function(m){var g=!document.hasFocus||!document.hasFocus()||!r.isFocused()&&document.activeElement==(r.textInput&&r.textInput.getElement());g&&window.focus(),r.focus(),setTimeout(function(){r.isFocused()||r.focus()})},h=r.renderer.getMouseEventTarget();E.addListener(h,"click",this.onMouseEvent.bind(this,"click"),r),E.addListener(h,"mousemove",this.onMouseMove.bind(this,"mousemove"),r),E.addMultiMouseDownListener([h,r.renderer.scrollBarV&&r.renderer.scrollBarV.inner,r.renderer.scrollBarH&&r.renderer.scrollBarH.inner,r.textInput&&r.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",r),E.addMouseWheelListener(r.container,this.onMouseWheel.bind(this,"mousewheel"),r),o(r.container,r);var v=r.renderer.$gutter;E.addListener(v,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),r),E.addListener(v,"click",this.onMouseEvent.bind(this,"gutterclick"),r),E.addListener(v,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),r),E.addListener(v,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),r),E.addListener(h,"mousedown",l,r),E.addListener(v,"mousedown",l,r),A.isIE&&r.renderer.scrollBarV&&(E.addListener(r.renderer.scrollBarV.element,"mousedown",l,r),E.addListener(r.renderer.scrollBarH.element,"mousedown",l,r)),r.on("mousemove",function(m){if(!(s.state||s.$dragDelay||!s.$dragEnabled)){var g=r.renderer.screenToTextCoordinates(m.x,m.y),d=r.session.selection.getRange(),b=r.renderer;!d.isEmpty()&&d.insideStart(g.row,g.column)?b.setCursorStyle("default"):b.setCursorStyle("")}},r)}return e.prototype.onMouseEvent=function(r,s){this.editor.session&&this.editor._emit(r,new c(s,this.editor))},e.prototype.onMouseMove=function(r,s){var l=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!l||!l.length||this.editor._emit(r,new c(s,this.editor))},e.prototype.onMouseWheel=function(r,s){var l=new c(s,this.editor);l.speed=this.$scrollSpeed*2,l.wheelX=s.wheelX,l.wheelY=s.wheelY,this.editor._emit(r,l)},e.prototype.setState=function(r){this.state=r},e.prototype.captureMouse=function(r,s){this.x=r.x,this.y=r.y,this.isMousePressed=!0;var l=this.editor,h=this.editor.renderer;h.$isMousePressed=!0;var v=this,m=!0,g=function(S){if(S){if(A.isWebKit&&!S.which&&v.releaseMouse)return v.releaseMouse();v.x=S.clientX,v.y=S.clientY,s&&s(S),v.mouseEvent=new c(S,v.editor),v.$mouseMoved=!0}},d=function(S){l.off("beforeEndOperation",C),m=!1,l.session&&b(),v[v.state+"End"]&&v[v.state+"End"](S),v.state="",v.isMousePressed=h.$isMousePressed=!1,h.$keepTextAreaAtCursor&&h.$moveTextAreaToCursor(),v.$onCaptureMouseMove=v.releaseMouse=null,S&&v.onMouseEvent("mouseup",S),l.endOperation()},b=function(){v[v.state]&&v[v.state](),v.$mouseMoved=!1},M=function(){m&&(b(),E.nextFrame(M))};if(A.isOldIE&&r.domEvent.type=="dblclick")return setTimeout(function(){d(r)});var C=function(S){v.releaseMouse&&l.curOp.command.name&&l.curOp.selectionChanged&&(v[v.state+"End"]&&v[v.state+"End"](),v.state="",v.releaseMouse())};l.on("beforeEndOperation",C),l.startOperation({command:{name:"mouse"}}),v.$onCaptureMouseMove=g,v.releaseMouse=E.capture(this.editor.container,g,d),M()},e.prototype.cancelContextMenu=function(){var r=(function(s){s&&s.domEvent&&s.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",r),s&&s.domEvent&&E.stopEvent(s.domEvent))}).bind(this);setTimeout(r,10),this.editor.on("nativecontextmenu",r)},e.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},e}();t.prototype.releaseMouse=null,n.defineOptions(t.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:A.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),L.MouseHandler=t}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(k,L,H){var E=k("../lib/dom"),A=function(){function $(a){a.on("click",function(c){var i=c.getDocumentPosition(),o=a.session,n=o.getFoldAt(i.row,i.column,1);n&&(c.getAccelKey()?o.removeFold(n):o.expandFold(n),c.stop());var t=c.domEvent&&c.domEvent.target;t&&E.hasCssClass(t,"ace_inline_button")&&E.hasCssClass(t,"ace_toggle_wrap")&&(o.setOption("wrap",!o.getUseWrapMode()),a.renderer.scrollCursorIntoView())}),a.on("gutterclick",function(c){var i=a.renderer.$gutterLayer.getRegion(c);if(i=="foldWidgets"){var o=c.getDocumentPosition().row,n=a.session;n.foldWidgets&&n.foldWidgets[o]&&a.session.onFoldWidgetClick(o,c),a.isFocused()||a.focus(),c.stop()}}),a.on("gutterdblclick",function(c){var i=a.renderer.$gutterLayer.getRegion(c);if(i=="foldWidgets"){var o=c.getDocumentPosition().row,n=a.session,t=n.getParentFoldRangeData(o,!0),e=t.range||t.firstRange;if(e){o=e.start.row;var r=n.getFoldAt(o,n.getLine(o).length,1);r?n.removeFold(r):(n.addFold("...",e),a.renderer.scrollCursorIntoView({row:e.start.row,column:0}))}c.stop()}})}return $}();L.FoldHandler=A}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(k,L,H){var E=k("../lib/keys"),A=k("../lib/event"),$=function(){function a(c){this.$editor=c,this.$data={editor:c},this.$handlers=[],this.setDefaultHandler(c.commands)}return a.prototype.setDefaultHandler=function(c){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=c,this.addKeyboardHandler(c,0)},a.prototype.setKeyboardHandler=function(c){var i=this.$handlers;if(i[i.length-1]!=c){for(;i[i.length-1]&&i[i.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(i[i.length-1]);this.addKeyboardHandler(c,1)}},a.prototype.addKeyboardHandler=function(c,i){if(c){typeof c=="function"&&!c.handleKeyboard&&(c.handleKeyboard=c);var o=this.$handlers.indexOf(c);o!=-1&&this.$handlers.splice(o,1),i==null?this.$handlers.push(c):this.$handlers.splice(i,0,c),o==-1&&c.attach&&c.attach(this.$editor)}},a.prototype.removeKeyboardHandler=function(c){var i=this.$handlers.indexOf(c);return i==-1?!1:(this.$handlers.splice(i,1),c.detach&&c.detach(this.$editor),!0)},a.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},a.prototype.getStatusText=function(){var c=this.$data,i=c.editor;return this.$handlers.map(function(o){return o.getStatusText&&o.getStatusText(i,c)||""}).filter(Boolean).join(" ")},a.prototype.$callKeyboardHandlers=function(c,i,o,n){for(var t,e=!1,r=this.$editor.commands,s=this.$handlers.length;s--&&(t=this.$handlers[s].handleKeyboard(this.$data,c,i,o,n),!(!(!t||!t.command)&&(t.command=="null"?e=!0:e=r.exec(t.command,this.$editor,t.args,n),e&&n&&c!=-1&&t.passEvent!=!0&&t.command.passEvent!=!0&&A.stopEvent(n),e))););return!e&&c==-1&&(t={command:"insertstring"},e=r.exec("insertstring",this.$editor,i)),e&&this.$editor._signal&&this.$editor._signal("keyboardActivity",t),e},a.prototype.onCommandKey=function(c,i,o){var n=E.keyCodeToString(o);return this.$callKeyboardHandlers(i,n,o,c)},a.prototype.onTextInput=function(c){return this.$callKeyboardHandlers(-1,c)},a}();L.KeyBinding=$}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(k,L,H){var E=0,A=0,$=!1,a=!1,c=!1,i=[[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]],o=[[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]],n=0,t=1,e=0,r=1,s=2,l=3,h=4,v=5,m=6,g=7,d=8,b=9,M=10,C=11,S=12,R=13,w=14,y=15,f=16,u=17,p=18,x=[p,p,p,p,p,p,p,p,p,m,v,m,d,v,p,p,p,p,p,p,p,p,p,p,p,p,p,p,v,v,v,m,d,h,h,C,C,C,h,h,h,h,h,M,b,M,b,b,s,s,s,s,s,s,s,s,s,s,b,h,h,h,h,h,h,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,h,h,h,h,h,h,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,h,h,h,h,p,p,p,p,p,p,v,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,b,h,C,C,C,C,h,h,h,h,e,h,h,p,h,h,C,C,s,s,h,e,h,h,h,s,e,h,h,h,h,h],T=[d,d,d,d,d,d,d,d,d,d,d,p,p,p,e,r,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,d,v,R,w,y,f,u,b,C,C,C,C,C,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,b,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,d];function _(D,N,F,B){var P=E?o:i,V=null,G=null,j=null,K=0,Q=null,X=null,J=-1,Z=null,q=null,Ae=[];if(!B)for(Z=0,B=[];Z<F;Z++)B[Z]=z(D[Z]);for(A=E,$=!1,a=!1,c=!1,q=0;q<F;q++){if(V=K,Ae[q]=G=O(D,B,Ae,q),K=P[V][G],Q=K&240,K&=15,N[q]=j=P[K][5],Q>0)if(Q==16){for(Z=J;Z<q;Z++)N[Z]=1;J=-1}else J=-1;if(X=P[K][6],X)J==-1&&(J=q);else if(J>-1){for(Z=J;Z<q;Z++)N[Z]=j;J=-1}B[q]==v&&(N[q]=0),A|=j}if(c){for(Z=0;Z<F;Z++)if(B[Z]==m){N[Z]=E;for(var se=Z-1;se>=0&&B[se]==d;se--)N[se]=E}}}function I(D,N,F){if(!(A<D)){if(D==1&&E==t&&!a){F.reverse();return}for(var B=F.length,P=0,V,G,j,K;P<B;){if(N[P]>=D){for(V=P+1;V<B&&N[V]>=D;)V++;for(G=P,j=V-1;G<j;G++,j--)K=F[G],F[G]=F[j],F[j]=K;P=V}P++}}}function O(D,N,F,B){var P=N[B],V,G,j,K;switch(P){case e:case r:$=!1;case h:case l:return P;case s:return $?l:s;case g:return $=!0,r;case d:return h;case b:return B<1||B+1>=N.length||(V=F[B-1])!=s&&V!=l||(G=N[B+1])!=s&&G!=l?h:($&&(G=l),G==V?G:h);case M:return V=B>0?F[B-1]:v,V==s&&B+1<N.length&&N[B+1]==s?s:h;case C:if(B>0&&F[B-1]==s)return s;if($)return h;for(K=B+1,j=N.length;K<j&&N[K]==C;)K++;return K<j&&N[K]==s?s:h;case S:for(j=N.length,K=B+1;K<j&&N[K]==S;)K++;if(K<j){var Q=D[B],X=Q>=1425&&Q<=2303||Q==64286;if(V=N[K],X&&(V==r||V==g))return r}return B<1||(V=N[B-1])==v?h:F[B-1];case v:return $=!1,a=!0,E;case m:return c=!0,h;case R:case w:case f:case u:case y:$=!1;case p:return h}}function z(D){var N=D.charCodeAt(0),F=N>>8;return F==0?N>191?e:x[N]:F==5?/[\u0591-\u05f4]/.test(D)?r:e:F==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(D)?S:/[\u0660-\u0669\u066b-\u066c]/.test(D)?l:N==1642?C:/[\u06f0-\u06f9]/.test(D)?s:g:F==32&&N<=8287?T[N&255]:F==254&&N>=65136?g:h}L.L=e,L.R=r,L.EN=s,L.ON_R=3,L.AN=4,L.R_H=5,L.B=6,L.RLE=7,L.DOT="·",L.doBidiReorder=function(D,N,F){if(D.length<2)return{};var B=D.split(""),P=new Array(B.length),V=new Array(B.length),G=[];E=F?t:n,_(B,G,B.length,N);for(var j=0;j<P.length;P[j]=j,j++);I(2,G,P),I(1,G,P);for(var j=0;j<P.length-1;j++)N[j]===l?G[j]=L.AN:G[j]===r&&(N[j]>g&&N[j]<R||N[j]===h||N[j]===p)?G[j]=L.ON_R:j>0&&B[j-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(B[j])&&(G[j-1]=G[j]=L.R_H,j++);B[B.length-1]===L.DOT&&(G[B.length-1]=L.B),B[0]==="‫"&&(G[0]=L.RLE);for(var j=0;j<P.length;j++)V[j]=G[P[j]];return{logicalFromVisual:P,bidiLevels:V}},L.hasBidiCharacters=function(D,N){for(var F=!1,B=0;B<D.length;B++)N[B]=z(D.charAt(B)),!F&&(N[B]==r||N[B]==g||N[B]==l)&&(F=!0);return F},L.getVisualFromLogicalIdx=function(D,N){for(var F=0;F<N.logicalFromVisual.length;F++)if(N.logicalFromVisual[F]==D)return F;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(k,L,H){var E=k("./lib/bidiutil"),A=k("./lib/lang"),$=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,a=function(){function c(i){this.session=i,this.bidiMap={},this.currentRow=null,this.bidiUtil=E,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=$.test(i.getValue())}return c.prototype.isBidiRow=function(i,o,n){return this.seenBidi?(i!==this.currentRow&&(this.currentRow=i,this.updateRowLine(o,n),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},c.prototype.onChange=function(i){this.seenBidi?this.currentRow=null:i.action=="insert"&&$.test(i.lines.join(`
180
+ `))&&(this.seenBidi=!0,this.currentRow=null)},c.prototype.getDocumentRow=function(){var i=0,o=this.session.$screenRowCache;if(o.length){var n=this.session.$getRowCacheIndex(o,this.currentRow);n>=0&&(i=this.session.$docRowCache[n])}return i},c.prototype.getSplitIndex=function(){var i=0,o=this.session.$screenRowCache;if(o.length)for(var n,t=this.session.$getRowCacheIndex(o,this.currentRow);this.currentRow-i>0&&(n=this.session.$getRowCacheIndex(o,this.currentRow-i-1),n===t);)t=n,i++;else i=this.currentRow;return i},c.prototype.updateRowLine=function(i,o){i===void 0&&(i=this.getDocumentRow());var n=i===this.session.getLength()-1,t=n?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(i),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var e=this.session.$wrapData[i];e&&(o===void 0&&(o=this.getSplitIndex()),o>0&&e.length?(this.wrapIndent=e.indent,this.wrapOffset=this.wrapIndent*this.charWidths[E.L],this.line=o<e.length?this.line.substring(e[o-1],e[o]):this.line.substring(e[e.length-1])):this.line=this.line.substring(0,e[o]),o==e.length&&(this.line+=this.showInvisibles?t:E.DOT))}else this.line+=this.showInvisibles?t:E.DOT;var r=this.session,s=0,l;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(h,v){return h===" "||r.isFullWidth(h.charCodeAt(0))?(l=h===" "?r.getScreenTabSize(v+s):2,s+=l-1,A.stringRepeat(E.DOT,l)):h}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==E.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},c.prototype.updateBidiMap=function(){var i=[];E.hasBidiCharacters(this.line,i)||this.isRtlDir?this.bidiMap=E.doBidiReorder(this.line,i,this.isRtlDir):this.bidiMap={}},c.prototype.markAsDirty=function(){this.currentRow=null},c.prototype.updateCharacterWidths=function(i){if(this.characterWidth!==i.$characterSize.width){this.fontMetrics=i;var o=this.characterWidth=i.$characterSize.width,n=i.$measureCharWidth("ה");this.charWidths[E.L]=this.charWidths[E.EN]=this.charWidths[E.ON_R]=o,this.charWidths[E.R]=this.charWidths[E.AN]=n,this.charWidths[E.R_H]=n*.45,this.charWidths[E.B]=this.charWidths[E.RLE]=0,this.currentRow=null}},c.prototype.setShowInvisibles=function(i){this.showInvisibles=i,this.currentRow=null},c.prototype.setEolChar=function(i){this.EOL=i},c.prototype.setContentWidth=function(i){this.contentWidth=i},c.prototype.isRtlLine=function(i){return this.$isRtl?!0:i!=null?this.session.getLine(i).charAt(0)==this.RLE:this.isRtlDir},c.prototype.setRtlDirection=function(i,o){for(var n=i.getCursorPosition(),t=i.selection.getSelectionAnchor().row;t<=n.row;t++)!o&&i.session.getLine(t).charAt(0)===i.session.$bidiHandler.RLE?i.session.doc.removeInLine(t,0,1):o&&i.session.getLine(t).charAt(0)!==i.session.$bidiHandler.RLE&&i.session.doc.insert({column:0,row:t},i.session.$bidiHandler.RLE)},c.prototype.getPosLeft=function(i){i-=this.wrapIndent;var o=this.line.charAt(0)===this.RLE?1:0,n=i>o?this.session.getOverwrite()?i:i-1:o,t=E.getVisualFromLogicalIdx(n,this.bidiMap),e=this.bidiMap.bidiLevels,r=0;!this.session.getOverwrite()&&i<=o&&e[t]%2!==0&&t++;for(var s=0;s<t;s++)r+=this.charWidths[e[s]];return!this.session.getOverwrite()&&i>o&&e[t]%2===0&&(r+=this.charWidths[e[t]]),this.wrapIndent&&(r+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(r+=this.rtlLineOffset),r},c.prototype.getSelections=function(i,o){var n=this.bidiMap,t=n.bidiLevels,e,r=[],s=0,l=Math.min(i,o)-this.wrapIndent,h=Math.max(i,o)-this.wrapIndent,v=!1,m=!1,g=0;this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,b=0;b<t.length;b++)d=n.logicalFromVisual[b],e=t[b],v=d>=l&&d<h,v&&!m?g=s:!v&&m&&r.push({left:g,width:s-g}),s+=this.charWidths[e],m=v;if(v&&b===t.length&&r.push({left:g,width:s-g}),this.isRtlDir)for(var M=0;M<r.length;M++)r[M].left+=this.rtlLineOffset;return r},c.prototype.offsetToCol=function(n){this.isRtlDir&&(n-=this.rtlLineOffset);var o=0,n=Math.max(n,0),t=0,e=0,r=this.bidiMap.bidiLevels,s=this.charWidths[r[e]];for(this.wrapIndent&&(n-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);n>t+s/2;){if(t+=s,e===r.length-1){s=0;break}s=this.charWidths[r[++e]]}return e>0&&r[e-1]%2!==0&&r[e]%2===0?(n<t&&e--,o=this.bidiMap.logicalFromVisual[e]):e>0&&r[e-1]%2===0&&r[e]%2!==0?o=1+(n>t?this.bidiMap.logicalFromVisual[e]:this.bidiMap.logicalFromVisual[e-1]):this.isRtlDir&&e===r.length-1&&s===0&&r[e-1]%2===0||!this.isRtlDir&&e===0&&r[e]%2!==0?o=1+this.bidiMap.logicalFromVisual[e]:(e>0&&r[e-1]%2!==0&&s!==0&&e--,o=this.bidiMap.logicalFromVisual[e]),o===0&&this.isRtlDir&&o++,o+this.wrapIndent},c}();L.BidiHandler=a}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(k,L,H){var E=k("./lib/oop"),A=k("./lib/lang"),$=k("./lib/event_emitter").EventEmitter,a=k("./range").Range,c=function(){function i(o){this.session=o,this.doc=o.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var n=this;this.cursor.on("change",function(t){n.$cursorChanged=!0,n.$silent||n._emit("changeCursor"),!n.$isEmpty&&!n.$silent&&n._emit("changeSelection"),!n.$keepDesiredColumnOnChange&&t.old.column!=t.value.column&&(n.$desiredColumn=null)}),this.anchor.on("change",function(){n.$anchorChanged=!0,!n.$isEmpty&&!n.$silent&&n._emit("changeSelection")})}return i.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},i.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},i.prototype.getCursor=function(){return this.lead.getPosition()},i.prototype.setAnchor=function(o,n){this.$isEmpty=!1,this.anchor.setPosition(o,n)},i.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},i.prototype.getSelectionLead=function(){return this.lead.getPosition()},i.prototype.isBackwards=function(){var o=this.anchor,n=this.lead;return o.row>n.row||o.row==n.row&&o.column>n.column},i.prototype.getRange=function(){var o=this.anchor,n=this.lead;return this.$isEmpty?a.fromPoints(n,n):this.isBackwards()?a.fromPoints(n,o):a.fromPoints(o,n)},i.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},i.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},i.prototype.setRange=function(o,n){var t=n?o.end:o.start,e=n?o.start:o.end;this.$setSelection(t.row,t.column,e.row,e.column)},i.prototype.$setSelection=function(o,n,t,e){if(!this.$silent){var r=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(o,n),this.cursor.setPosition(t,e),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||s)&&this._emit("changeSelection")}},i.prototype.$moveSelection=function(o){var n=this.lead;this.$isEmpty&&this.setSelectionAnchor(n.row,n.column),o.call(this)},i.prototype.selectTo=function(o,n){this.$moveSelection(function(){this.moveCursorTo(o,n)})},i.prototype.selectToPosition=function(o){this.$moveSelection(function(){this.moveCursorToPosition(o)})},i.prototype.moveTo=function(o,n){this.clearSelection(),this.moveCursorTo(o,n)},i.prototype.moveToPosition=function(o){this.clearSelection(),this.moveCursorToPosition(o)},i.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},i.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},i.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},i.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},i.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},i.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},i.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},i.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},i.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},i.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},i.prototype.getWordRange=function(o,n){if(typeof n>"u"){var t=o||this.lead;o=t.row,n=t.column}return this.session.getWordRange(o,n)},i.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},i.prototype.selectAWord=function(){var o=this.getCursor(),n=this.session.getAWordRange(o.row,o.column);this.setSelectionRange(n)},i.prototype.getLineRange=function(o,n){var t=typeof o=="number"?o:this.lead.row,e,r=this.session.getFoldLine(t);return r?(t=r.start.row,e=r.end.row):e=t,n===!0?new a(t,0,e,this.session.getLine(e).length):new a(t,0,e+1,0)},i.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},i.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},i.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},i.prototype.wouldMoveIntoSoftTab=function(o,n,t){var e=o.column,r=o.column+n;return t<0&&(e=o.column-n,r=o.column),this.session.isTabStop(o)&&this.doc.getLine(o.row).slice(e,r).split(" ").length-1==n},i.prototype.moveCursorLeft=function(){var o=this.lead.getPosition(),n;if(n=this.session.getFoldAt(o.row,o.column,-1))this.moveCursorTo(n.start.row,n.start.column);else if(o.column===0)o.row>0&&this.moveCursorTo(o.row-1,this.doc.getLine(o.row-1).length);else{var t=this.session.getTabSize();this.wouldMoveIntoSoftTab(o,t,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-t):this.moveCursorBy(0,-1)}},i.prototype.moveCursorRight=function(){var o=this.lead.getPosition(),n;if(n=this.session.getFoldAt(o.row,o.column,1))this.moveCursorTo(n.end.row,n.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 t=this.session.getTabSize(),o=this.lead;this.wouldMoveIntoSoftTab(o,t,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,t):this.moveCursorBy(0,1)}},i.prototype.moveCursorLineStart=function(){var o=this.lead.row,n=this.lead.column,t=this.session.documentToScreenRow(o,n),e=this.session.screenToDocumentPosition(t,0),r=this.session.getDisplayLine(o,null,e.row,e.column),s=r.match(/^\s*/);s[0].length!=n&&!this.session.$useEmacsStyleLineStart&&(e.column+=s[0].length),this.moveCursorToPosition(e)},i.prototype.moveCursorLineEnd=function(){var o=this.lead,n=this.session.getDocumentLastRowColumnPosition(o.row,o.column);if(this.lead.column==n.column){var t=this.session.getLine(n.row);if(n.column==t.length){var e=t.search(/\s+$/);e>0&&(n.column=e)}}this.moveCursorTo(n.row,n.column)},i.prototype.moveCursorFileEnd=function(){var o=this.doc.getLength()-1,n=this.doc.getLine(o).length;this.moveCursorTo(o,n)},i.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},i.prototype.moveCursorLongWordRight=function(){var o=this.lead.row,n=this.lead.column,t=this.doc.getLine(o),e=t.substring(n);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(o,n,1);if(r){this.moveCursorTo(r.end.row,r.end.column);return}if(this.session.nonTokenRe.exec(e)&&(n+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,e=t.substring(n)),n>=t.length){this.moveCursorTo(o,t.length),this.moveCursorRight(),o<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(e)&&(n+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,n)},i.prototype.moveCursorLongWordLeft=function(){var o=this.lead.row,n=this.lead.column,t;if(t=this.session.getFoldAt(o,n,-1)){this.moveCursorTo(t.start.row,t.start.column);return}var e=this.session.getFoldStringAt(o,n,-1);e==null&&(e=this.doc.getLine(o).substring(0,n));var r=A.stringReverse(e);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(r)&&(n-=this.session.nonTokenRe.lastIndex,r=r.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),n<=0){this.moveCursorTo(o,0),this.moveCursorLeft(),o>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(r)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,n)},i.prototype.$shortWordEndIndex=function(o){var n=0,t,e=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(o))n=this.session.tokenRe.lastIndex;else{for(;(t=o[n])&&e.test(t);)n++;if(n<1){for(r.lastIndex=0;(t=o[n])&&!r.test(t);)if(r.lastIndex=0,n++,e.test(t))if(n>2){n--;break}else{for(;(t=o[n])&&e.test(t);)n++;if(n>2)break}}}return r.lastIndex=0,n},i.prototype.moveCursorShortWordRight=function(){var o=this.lead.row,n=this.lead.column,t=this.doc.getLine(o),e=t.substring(n),r=this.session.getFoldAt(o,n,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(n==t.length){var s=this.doc.getLength();do o++,e=this.doc.getLine(o);while(o<s&&/^\s*$/.test(e));/^\s+/.test(e)||(e=""),n=0}var l=this.$shortWordEndIndex(e);this.moveCursorTo(o,n+l)},i.prototype.moveCursorShortWordLeft=function(){var o=this.lead.row,n=this.lead.column,t;if(t=this.session.getFoldAt(o,n,-1))return this.moveCursorTo(t.start.row,t.start.column);var e=this.session.getLine(o).substring(0,n);if(n===0){do o--,e=this.doc.getLine(o);while(o>0&&/^\s*$/.test(e));n=e.length,/\s+$/.test(e)||(e="")}var r=A.stringReverse(e),s=this.$shortWordEndIndex(r);return this.moveCursorTo(o,n-s)},i.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},i.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},i.prototype.moveCursorBy=function(o,n){var t=this.session.documentToScreenPosition(this.lead.row,this.lead.column),e;if(n===0&&(o!==0&&(this.session.$bidiHandler.isBidiRow(t.row,this.lead.row)?(e=this.session.$bidiHandler.getPosLeft(t.column),t.column=Math.round(e/this.session.$bidiHandler.charWidths[0])):e=t.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?t.column=this.$desiredColumn:this.$desiredColumn=t.column),o!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var r=this.session.lineWidgets[this.lead.row];o<0?o-=r.rowsAbove||0:o>0&&(o+=r.rowCount-(r.rowsAbove||0))}var s=this.session.screenToDocumentPosition(t.row+o,t.column,e);o!==0&&n===0&&s.row===this.lead.row&&(s.column,this.lead.column),this.moveCursorTo(s.row,s.column+n,n===0)},i.prototype.moveCursorToPosition=function(o){this.moveCursorTo(o.row,o.column)},i.prototype.moveCursorTo=function(o,n,t){var e=this.session.getFoldAt(o,n,1);e&&(o=e.start.row,n=e.start.column),this.$keepDesiredColumnOnChange=!0;var r=this.session.getLine(o);/[\uDC00-\uDFFF]/.test(r.charAt(n))&&r.charAt(n-1)&&(this.lead.row==o&&this.lead.column==n+1?n=n-1:n=n+1),this.lead.setPosition(o,n),this.$keepDesiredColumnOnChange=!1,t||(this.$desiredColumn=null)},i.prototype.moveCursorToScreen=function(o,n,t){var e=this.session.screenToDocumentPosition(o,n);this.moveCursorTo(e.row,e.column,t)},i.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},i.prototype.fromOrientedRange=function(o){this.setSelectionRange(o,o.cursor==o.start),this.$desiredColumn=o.desiredColumn||this.$desiredColumn},i.prototype.toOrientedRange=function(o){var n=this.getRange();return o?(o.start.column=n.start.column,o.start.row=n.start.row,o.end.column=n.end.column,o.end.row=n.end.row):o=n,o.cursor=this.isBackwards()?o.start:o.end,o.desiredColumn=this.$desiredColumn,o},i.prototype.getRangeOfMovements=function(o){var n=this.getCursor();try{o(this);var t=this.getCursor();return a.fromPoints(n,t)}catch{return a.fromPoints(n,n)}finally{this.moveCursorToPosition(n)}},i.prototype.toJSON=function(){if(this.rangeCount)var o=this.ranges.map(function(n){var t=n.clone();return t.isBackwards=n.cursor==n.start,t});else{var o=this.getRange();o.isBackwards=this.isBackwards()}return o},i.prototype.fromJSON=function(o){if(o.start==null)if(this.rangeList&&o.length>1){this.toSingleRange(o[0]);for(var n=o.length;n--;){var t=a.fromPoints(o[n].start,o[n].end);o[n].isBackwards&&(t.cursor=t.start),this.addRange(t,!0)}return}else o=o[0];this.rangeList&&this.toSingleRange(o),this.setSelectionRange(o,o.isBackwards)},i.prototype.isEqual=function(o){if((o.length||this.rangeCount)&&o.length!=this.rangeCount)return!1;if(!o.length||!this.ranges)return this.getRange().isEqual(o);for(var n=this.ranges.length;n--;)if(!this.ranges[n].isEqual(o[n]))return!1;return!0},i}();c.prototype.setSelectionAnchor=c.prototype.setAnchor,c.prototype.getSelectionAnchor=c.prototype.getAnchor,c.prototype.setSelectionRange=c.prototype.setRange,E.implement(c.prototype,$),L.Selection=c}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(k,L,H){var E=k("./lib/report_error").reportError,A=2e3,$=function(){function a(c){this.splitRegex,this.states=c,this.regExps={},this.matchMappings={};for(var i in this.states){for(var o=this.states[i],n=[],t=0,e=this.matchMappings[i]={defaultToken:"text"},r="g",s=[],l=0;l<o.length;l++){var h=o[l];if(h.defaultToken&&(e.defaultToken=h.defaultToken),h.caseInsensitive&&r.indexOf("i")===-1&&(r+="i"),h.unicode&&r.indexOf("u")===-1&&(r+="u"),h.regex!=null){h.regex instanceof RegExp&&(h.regex=h.regex.toString().slice(1,-1));var v=h.regex,m=new RegExp("(?:("+v+")|(.))").exec("a").length-2;Array.isArray(h.token)?h.token.length==1||m==1?h.token=h.token[0]:m-1!=h.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:h,groupCount:m-1}),h.token=h.token[0]):(h.tokenArray=h.token,h.token=null,h.onMatch=this.$arrayTokens):typeof h.token=="function"&&!h.onMatch&&(m>1?h.onMatch=this.$applyToken:h.onMatch=h.token),m>1&&(/\\\d/.test(h.regex)?v=h.regex.replace(/\\([0-9]+)/g,function(g,d){return"\\"+(parseInt(d,10)+t+1)}):(m=1,v=this.removeCapturingGroups(h.regex)),!h.splitRegex&&typeof h.token!="string"&&s.push(h)),e[t]=l,t+=m,n.push(v),h.onMatch||(h.onMatch=null)}}n.length||(e[0]=0,n.push("$")),s.forEach(function(g){g.splitRegex=this.createSplitterRegexp(g.regex,r)},this),this.regExps[i]=new RegExp("("+n.join(")|(")+")|($)",r)}}return a.prototype.$setMaxTokenCount=function(c){A=c|0},a.prototype.$applyToken=function(c){var i=this.splitRegex.exec(c).slice(1),o=this.token.apply(this,i);if(typeof o=="string")return[{type:o,value:c}];for(var n=[],t=0,e=o.length;t<e;t++)i[t]&&(n[n.length]={type:o[t],value:i[t]});return n},a.prototype.$arrayTokens=function(c){if(!c)return[];var i=this.splitRegex.exec(c);if(!i)return"text";for(var o=[],n=this.tokenArray,t=0,e=n.length;t<e;t++)i[t+1]&&(o[o.length]={type:n[t],value:i[t+1]});return o},a.prototype.removeCapturingGroups=function(c){var i=c.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(o,n){return n?"(?:":o});return i},a.prototype.createSplitterRegexp=function(c,i){if(c.indexOf("(?=")!=-1){var o=0,n=!1,t={};c.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,r,s,l,h,v){return n?n=h!="]":h?n=!0:l?(o==t.stack&&(t.end=v+1,t.stack=-1),o--):s&&(o++,s.length!=1&&(t.stack=o,t.start=v)),e}),t.end!=null&&/^\)*$/.test(c.substr(t.end))&&(c=c.substring(0,t.start)+c.substr(t.end))}return c.charAt(0)!="^"&&(c="^"+c),c.charAt(c.length-1)!="$"&&(c+="$"),new RegExp(c,(i||"").replace("g",""))},a.prototype.getLineTokens=function(c,i){if(i&&typeof i!="string"){var o=i.slice(0);i=o[0],i==="#tmp"&&(o.shift(),i=o.shift())}else var o=[];var n=i||"start",t=this.states[n];t||(n="start",t=this.states[n]);var e=this.matchMappings[n],r=this.regExps[n];r.lastIndex=0;for(var s,l=[],h=0,v=0,m={type:null,value:""};s=r.exec(c);){var g=e.defaultToken,d=null,b=s[0],M=r.lastIndex;if(M-b.length>h){var C=c.substring(h,M-b.length);m.type==g?m.value+=C:(m.type&&l.push(m),m={type:g,value:C})}for(var S=0;S<s.length-2;S++)if(s[S+1]!==void 0){d=t[e[S]],d.onMatch?g=d.onMatch(b,n,o,c):g=d.token,d.next&&(typeof d.next=="string"?n=d.next:n=d.next(n,o),t=this.states[n],t||(this.reportError("state doesn't exist",n),n="start",t=this.states[n]),e=this.matchMappings[n],h=M,r=this.regExps[n],r.lastIndex=M),d.consumeLineEnd&&(h=M);break}if(b){if(typeof g=="string")(!d||d.merge!==!1)&&m.type===g?m.value+=b:(m.type&&l.push(m),m={type:g,value:b});else if(g){m.type&&l.push(m),m={type:null,value:""};for(var S=0;S<g.length;S++)l.push(g[S])}}if(h==c.length)break;if(h=M,v++>A){for(v>2*c.length&&this.reportError("infinite loop with in ace tokenizer",{startState:i,line:c});h<c.length;)m.type&&l.push(m),m={value:c.substring(h,h+=500),type:"overflow"};n="start",o=[];break}}return m.type&&l.push(m),o.length>1&&o[0]!==n&&o.unshift("#tmp",n),{tokens:l,state:o.length?o:n}},a}();$.prototype.reportError=E,L.Tokenizer=$}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(k,L,H){var E=k("../lib/deep_copy").deepCopy,A;A=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(c,i){if(!i){for(var o in c)this.$rules[o]=c[o];return}for(var o in c){for(var n=c[o],t=0;t<n.length;t++){var e=n[t];(e.next||e.onMatch)&&(typeof e.next=="string"&&e.next.indexOf(i)!==0&&(e.next=i+e.next),e.nextState&&e.nextState.indexOf(i)!==0&&(e.nextState=i+e.nextState))}this.$rules[i+o]=n}},this.getRules=function(){return this.$rules},this.embedRules=function(c,i,o,n,t){var e=typeof c=="function"?new c().getRules():c;if(n)for(var r=0;r<n.length;r++)n[r]=i+n[r];else{n=[];for(var s in e)n.push(i+s)}if(this.addRules(e,i),o)for(var l=Array.prototype[t?"push":"unshift"],r=0;r<n.length;r++)l.apply(this.$rules[n[r]],E(o));this.$embeds||(this.$embeds=[]),this.$embeds.push(i)},this.getEmbeds=function(){return this.$embeds};var $=function(c,i){return(c!="start"||i.length)&&i.unshift(this.nextState,c),this.nextState},a=function(c,i){return i.shift(),i.shift()||"start"};this.normalizeRules=function(){var c=0,i=this.$rules;function o(n){var t=i[n];t.processed=!0;for(var e=0;e<t.length;e++){var r=t[e],s=null;Array.isArray(r)&&(s=r,r={}),!r.regex&&r.start&&(r.regex=r.start,r.next||(r.next=[]),r.next.push({defaultToken:r.token},{token:r.token+".end",regex:r.end||r.start,next:"pop"}),r.token=r.token+".start",r.push=!0);var l=r.next||r.push;if(l&&Array.isArray(l)){var h=r.stateName;h||(h=r.token,typeof h!="string"&&(h=h[0]||""),i[h]&&(h+=c++)),i[h]=l,r.next=h,o(h)}else l=="pop"&&(r.next=a);if(r.push&&(r.nextState=r.next||r.push,r.next=$,delete r.push),r.rules)for(var v in r.rules)i[v]?i[v].push&&i[v].push.apply(i[v],r.rules[v]):i[v]=r.rules[v];var m=typeof r=="string"?r:r.include;if(m&&(m==="$self"&&(m="start"),Array.isArray(m)?s=m.map(function(d){return i[d]}):s=i[m]),s){var g=[e,1].concat(s);r.noEscape&&(g=g.filter(function(d){return!d.next})),t.splice.apply(t,g),e--}r.keywordMap&&(r.token=this.createKeywordMapper(r.keywordMap,r.defaultToken||"text",r.caseInsensitive),delete r.defaultToken)}}Object.keys(i).forEach(o,this)},this.createKeywordMapper=function(c,i,o,n){var t=Object.create(null);return this.$keywordList=[],Object.keys(c).forEach(function(e){for(var r=c[e],s=r.split(n||"|"),l=s.length;l--;){var h=s[l];this.$keywordList.push(h),o&&(h=h.toLowerCase()),t[h]=e}},this),c=null,o?function(e){return t[e.toLowerCase()]||i}:function(e){return t[e]||i}},this.getKeywords=function(){return this.$keywords}}).call(A.prototype),L.TextHighlightRules=A}),ace.define("ace/mode/behaviour",["require","exports","module"],function(k,L,H){var E;E=function(){this.$behaviours={}},(function(){this.add=function(A,$,a){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[A]:this.$behaviours[A]={}}this.$behaviours[A][$]=a},this.addBehaviours=function(A){for(var $ in A)for(var a in A[$])this.add($,a,A[$][a])},this.remove=function(A){this.$behaviours&&this.$behaviours[A]&&delete this.$behaviours[A]},this.inherit=function(A,$){if(typeof A=="function")var a=new A().getBehaviours($);else var a=A.getBehaviours($);this.addBehaviours(a)},this.getBehaviours=function(A){if(A){for(var $={},a=0;a<A.length;a++)this.$behaviours[A[a]]&&($[A[a]]=this.$behaviours[A[a]]);return $}else return this.$behaviours}}).call(E.prototype),L.Behaviour=E}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(k,L,H){var E=k("./range").Range,A=function(){function $(a,c,i){this.$session=a,this.$row=c,this.$rowTokens=a.getTokens(c);var o=a.getTokenAt(c,i);this.$tokenIndex=o?o.index:-1}return $.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]},$.prototype.stepForward=function(){this.$tokenIndex+=1;for(var a;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,a||(a=this.$session.getLength()),this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},$.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},$.prototype.getCurrentTokenRow=function(){return this.$row},$.prototype.getCurrentTokenColumn=function(){var a=this.$rowTokens,c=this.$tokenIndex,i=a[c].start;if(i!==void 0)return i;for(i=0;c>0;)c-=1,i+=a[c].value.length;return i},$.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},$.prototype.getCurrentTokenRange=function(){var a=this.$rowTokens[this.$tokenIndex],c=this.getCurrentTokenColumn();return new E(this.$row,c,this.$row,c+a.value.length)},$}();L.TokenIterator=A}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(k,L,H){var E=k("../../lib/oop"),A=k("../behaviour").Behaviour,$=k("../../token_iterator").TokenIterator,a=k("../../lib/lang"),c=["text","paren.rparen","rparen","paren","punctuation.operator"],i=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],o,n={},t={'"':'"',"'":"'"},e=function(l){var h=-1;if(l.multiSelect&&(h=l.selection.index,n.rangeCount!=l.multiSelect.rangeCount&&(n={rangeCount:l.multiSelect.rangeCount})),n[h])return o=n[h];o=n[h]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},r=function(l,h,v,m){var g=l.end.row-l.start.row;return{text:v+h+m,selection:[0,l.start.column+1,g,l.end.column+(g?0:1)]}},s;s=function(l){l=l||{},this.add("braces","insertion",function(h,v,m,g,d){var b=m.getCursorPosition(),M=g.doc.getLine(b.row);if(d=="{"){e(m);var C=m.getSelectionRange(),S=g.doc.getTextRange(C),R=g.getTokenAt(b.row,b.column);if(S!==""&&S!=="{"&&m.getWrapBehavioursEnabled())return r(C,S,"{","}");if(R&&/(?:string)\.quasi|\.xml/.test(R.type)){var w=[/tag\-(?:open|name)/,/attribute\-name/];return w.some(function(_){return _.test(R.type)})||/(string)\.quasi/.test(R.type)&&R.value[b.column-R.start-1]!=="$"?void 0:(s.recordAutoInsert(m,g,"}"),{text:"{}",selection:[1,1]})}else if(s.isSaneInsertion(m,g))return/[\]\}\)]/.test(M[b.column])||m.inMultiSelectMode||l.braces?(s.recordAutoInsert(m,g,"}"),{text:"{}",selection:[1,1]}):(s.recordMaybeInsert(m,g,"{"),{text:"{",selection:[1,1]})}else if(d=="}"){e(m);var y=M.substring(b.column,b.column+1);if(y=="}"){var f=g.$findOpeningBracket("}",{column:b.column+1,row:b.row});if(f!==null&&s.isAutoInsertedClosing(b,M,d))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(d==`
181
181
  `||d==`\r
182
- `){e(m);var u="";s.isMaybeInsertedClosing(b,M)&&(u=a.stringRepeat("}",o.maybeInsertedBrackets),s.clearMaybeInsertedClosing());var y=M.substring(b.column,b.column+1);if(y==="}"){var p=g.findMatchingBracket({row:b.row,column:b.column+1},"}");if(!p)return null;var L=this.$getIndent(g.getLine(p.row))}else if(u)var L=this.$getIndent(M);else{s.clearMaybeInsertedClosing();return}var T=L+g.getTabString();return{text:`
182
+ `){e(m);var u="";s.isMaybeInsertedClosing(b,M)&&(u=a.stringRepeat("}",o.maybeInsertedBrackets),s.clearMaybeInsertedClosing());var y=M.substring(b.column,b.column+1);if(y==="}"){var p=g.findMatchingBracket({row:b.row,column:b.column+1},"}");if(!p)return null;var x=this.$getIndent(g.getLine(p.row))}else if(u)var x=this.$getIndent(M);else{s.clearMaybeInsertedClosing();return}var T=x+g.getTabString();return{text:`
183
183
  `+T+`
184
- `+L+u,selection:[1,T.length,1,T.length]}}else s.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(h,v,m,g,d){var b=g.doc.getTextRange(d);if(!d.isMultiLine()&&b=="{"){e(m);var M=g.doc.getLine(d.start.row),C=M.substring(d.end.column,d.end.column+1);if(C=="}")return d.end.column++,d;o.maybeInsertedBrackets--}}),this.add("parens","insertion",function(h,v,m,g,d){if(d=="("){e(m);var b=m.getSelectionRange(),M=g.doc.getTextRange(b);if(M!==""&&m.getWrapBehavioursEnabled())return r(b,M,"(",")");if(s.isSaneInsertion(m,g))return s.recordAutoInsert(m,g,")"),{text:"()",selection:[1,1]}}else if(d==")"){e(m);var C=m.getCursorPosition(),S=g.doc.getLine(C.row),R=S.substring(C.column,C.column+1);if(R==")"){var w=g.$findOpeningBracket(")",{column:C.column+1,row:C.row});if(w!==null&&s.isAutoInsertedClosing(C,S,d))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(h,v,m,g,d){var b=g.doc.getTextRange(d);if(!d.isMultiLine()&&b=="("){e(m);var M=g.doc.getLine(d.start.row),C=M.substring(d.start.column+1,d.start.column+2);if(C==")")return d.end.column++,d}}),this.add("brackets","insertion",function(h,v,m,g,d){if(d=="["){e(m);var b=m.getSelectionRange(),M=g.doc.getTextRange(b);if(M!==""&&m.getWrapBehavioursEnabled())return r(b,M,"[","]");if(s.isSaneInsertion(m,g))return s.recordAutoInsert(m,g,"]"),{text:"[]",selection:[1,1]}}else if(d=="]"){e(m);var C=m.getCursorPosition(),S=g.doc.getLine(C.row),R=S.substring(C.column,C.column+1);if(R=="]"){var w=g.$findOpeningBracket("]",{column:C.column+1,row:C.row});if(w!==null&&s.isAutoInsertedClosing(C,S,d))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(h,v,m,g,d){var b=g.doc.getTextRange(d);if(!d.isMultiLine()&&b=="["){e(m);var M=g.doc.getLine(d.start.row),C=M.substring(d.start.column+1,d.start.column+2);if(C=="]")return d.end.column++,d}}),this.add("string_dquotes","insertion",function(h,v,m,g,d){var b=g.$mode.$quotes||t;if(d.length==1&&b[d]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(d)!=-1)return;e(m);var M=d,C=m.getSelectionRange(),S=g.doc.getTextRange(C);if(S!==""&&(S.length!=1||!b[S])&&m.getWrapBehavioursEnabled())return r(C,S,M,M);if(!S){var R=m.getCursorPosition(),w=g.doc.getLine(R.row),y=w.substring(R.column-1,R.column),f=w.substring(R.column,R.column+1),u=g.getTokenAt(R.row,R.column),p=g.getTokenAt(R.row,R.column+1);if(y=="\\"&&u&&/escape/.test(u.type))return null;var L=u&&/string|escape/.test(u.type),T=!p||/string|escape/.test(p.type),_;if(f==M)_=L!==T,_&&/string\.end/.test(p.type)&&(_=!1);else{if(L&&!T||L&&T)return null;var I=g.$mode.tokenRe;I.lastIndex=0;var O=I.test(y);I.lastIndex=0;var z=I.test(f),D=g.$mode.$pairQuotesAfter,N=D&&D[M]&&D[M].test(y);if(!N&&O||z||f&&!/[\s;,.})\]\\]/.test(f))return null;var F=w[R.column-2];if(y==M&&(F==M||I.test(F)))return null;_=!0}return{text:_?M+M:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(h,v,m,g,d){var b=g.$mode.$quotes||t,M=g.doc.getTextRange(d);if(!d.isMultiLine()&&b.hasOwnProperty(M)){e(m);var C=g.doc.getLine(d.start.row),S=C.substring(d.start.column+1,d.start.column+2);if(S==M)return d.end.column++,d}}),l.closeDocComment!==!1&&this.add("doc comment end","insertion",function(h,v,m,g,d){if(h==="doc-start"&&(d===`
184
+ `+x+u,selection:[1,T.length,1,T.length]}}else s.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(h,v,m,g,d){var b=g.doc.getTextRange(d);if(!d.isMultiLine()&&b=="{"){e(m);var M=g.doc.getLine(d.start.row),C=M.substring(d.end.column,d.end.column+1);if(C=="}")return d.end.column++,d;o.maybeInsertedBrackets--}}),this.add("parens","insertion",function(h,v,m,g,d){if(d=="("){e(m);var b=m.getSelectionRange(),M=g.doc.getTextRange(b);if(M!==""&&m.getWrapBehavioursEnabled())return r(b,M,"(",")");if(s.isSaneInsertion(m,g))return s.recordAutoInsert(m,g,")"),{text:"()",selection:[1,1]}}else if(d==")"){e(m);var C=m.getCursorPosition(),S=g.doc.getLine(C.row),R=S.substring(C.column,C.column+1);if(R==")"){var w=g.$findOpeningBracket(")",{column:C.column+1,row:C.row});if(w!==null&&s.isAutoInsertedClosing(C,S,d))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(h,v,m,g,d){var b=g.doc.getTextRange(d);if(!d.isMultiLine()&&b=="("){e(m);var M=g.doc.getLine(d.start.row),C=M.substring(d.start.column+1,d.start.column+2);if(C==")")return d.end.column++,d}}),this.add("brackets","insertion",function(h,v,m,g,d){if(d=="["){e(m);var b=m.getSelectionRange(),M=g.doc.getTextRange(b);if(M!==""&&m.getWrapBehavioursEnabled())return r(b,M,"[","]");if(s.isSaneInsertion(m,g))return s.recordAutoInsert(m,g,"]"),{text:"[]",selection:[1,1]}}else if(d=="]"){e(m);var C=m.getCursorPosition(),S=g.doc.getLine(C.row),R=S.substring(C.column,C.column+1);if(R=="]"){var w=g.$findOpeningBracket("]",{column:C.column+1,row:C.row});if(w!==null&&s.isAutoInsertedClosing(C,S,d))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(h,v,m,g,d){var b=g.doc.getTextRange(d);if(!d.isMultiLine()&&b=="["){e(m);var M=g.doc.getLine(d.start.row),C=M.substring(d.start.column+1,d.start.column+2);if(C=="]")return d.end.column++,d}}),this.add("string_dquotes","insertion",function(h,v,m,g,d){var b=g.$mode.$quotes||t;if(d.length==1&&b[d]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(d)!=-1)return;e(m);var M=d,C=m.getSelectionRange(),S=g.doc.getTextRange(C);if(S!==""&&(S.length!=1||!b[S])&&m.getWrapBehavioursEnabled())return r(C,S,M,M);if(!S){var R=m.getCursorPosition(),w=g.doc.getLine(R.row),y=w.substring(R.column-1,R.column),f=w.substring(R.column,R.column+1),u=g.getTokenAt(R.row,R.column),p=g.getTokenAt(R.row,R.column+1);if(y=="\\"&&u&&/escape/.test(u.type))return null;var x=u&&/string|escape/.test(u.type),T=!p||/string|escape/.test(p.type),_;if(f==M)_=x!==T,_&&/string\.end/.test(p.type)&&(_=!1);else{if(x&&!T||x&&T)return null;var I=g.$mode.tokenRe;I.lastIndex=0;var O=I.test(y);I.lastIndex=0;var z=I.test(f),D=g.$mode.$pairQuotesAfter,N=D&&D[M]&&D[M].test(y);if(!N&&O||z||f&&!/[\s;,.})\]\\]/.test(f))return null;var F=w[R.column-2];if(y==M&&(F==M||I.test(F)))return null;_=!0}return{text:_?M+M:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(h,v,m,g,d){var b=g.$mode.$quotes||t,M=g.doc.getTextRange(d);if(!d.isMultiLine()&&b.hasOwnProperty(M)){e(m);var C=g.doc.getLine(d.start.row),S=C.substring(d.start.column+1,d.start.column+2);if(S==M)return d.end.column++,d}}),l.closeDocComment!==!1&&this.add("doc comment end","insertion",function(h,v,m,g,d){if(h==="doc-start"&&(d===`
185
185
  `||d===`\r
186
- `)&&m.selection.isEmpty()){var b=m.getCursorPosition();if(b.column===0)return;for(var M=g.doc.getLine(b.row),C=g.doc.getLine(b.row+1),S=g.getTokens(b.row),R=0,w=0;w<S.length;w++){R+=S[w].value.length;var y=S[w];if(R>=b.column){if(R===b.column){if(!/\.doc/.test(y.type))return;if(/\*\//.test(y.value)){var f=S[w+1];if(!f||!/\.doc/.test(f.type))return}}var u=b.column-(R-y.value.length),p=y.value.indexOf("*/"),L=y.value.indexOf("/**",p>-1?p+2:0);if(L!==-1&&u>L&&u<L+3||p!==-1&&L!==-1&&u>=p&&u<=L||!/\.doc/.test(y.type))return;break}}var T=this.$getIndent(M);if(/\s*\*/.test(C))return/^\s*\*/.test(M)?{text:d+T+"* ",selection:[1,2+T.length,1,2+T.length]}:{text:d+T+" * ",selection:[1,3+T.length,1,3+T.length]};if(/\/\*\*/.test(M.substring(0,b.column)))return{text:d+T+" * "+d+" "+T+"*/",selection:[1,4+T.length,1,4+T.length]}}})},s.isSaneInsertion=function(l,h){var v=l.getCursorPosition(),m=new $(h,v.row,v.column);if(!this.$matchTokenType(m.getCurrentToken()||"text",c)){if(/[)}\]]/.test(l.session.getLine(v.row)[v.column]))return!0;var g=new $(h,v.row,v.column+1);if(!this.$matchTokenType(g.getCurrentToken()||"text",c))return!1}return m.stepForward(),m.getCurrentTokenRow()!==v.row||this.$matchTokenType(m.getCurrentToken()||"text",i)},s.$matchTokenType=function(l,h){return h.indexOf(l.type||l)>-1},s.recordAutoInsert=function(l,h,v){var m=l.getCursorPosition(),g=h.doc.getLine(m.row);this.isAutoInsertedClosing(m,g,o.autoInsertedLineEnd[0])||(o.autoInsertedBrackets=0),o.autoInsertedRow=m.row,o.autoInsertedLineEnd=v+g.substr(m.column),o.autoInsertedBrackets++},s.recordMaybeInsert=function(l,h,v){var m=l.getCursorPosition(),g=h.doc.getLine(m.row);this.isMaybeInsertedClosing(m,g)||(o.maybeInsertedBrackets=0),o.maybeInsertedRow=m.row,o.maybeInsertedLineStart=g.substr(0,m.column)+v,o.maybeInsertedLineEnd=g.substr(m.column),o.maybeInsertedBrackets++},s.isAutoInsertedClosing=function(l,h,v){return o.autoInsertedBrackets>0&&l.row===o.autoInsertedRow&&v===o.autoInsertedLineEnd[0]&&h.substr(l.column)===o.autoInsertedLineEnd},s.isMaybeInsertedClosing=function(l,h){return o.maybeInsertedBrackets>0&&l.row===o.maybeInsertedRow&&h.substr(l.column)===o.maybeInsertedLineEnd&&h.substr(0,l.column)==o.maybeInsertedLineStart},s.popAutoInsertedClosing=function(){o.autoInsertedLineEnd=o.autoInsertedLineEnd.substr(1),o.autoInsertedBrackets--},s.clearMaybeInsertedClosing=function(){o&&(o.maybeInsertedBrackets=0,o.maybeInsertedRow=-1)},E.inherits(s,A),x.CstyleBehaviour=s}),ace.define("ace/unicode",["require","exports","module"],function(k,x,H){for(var E=[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],A=0,$=[],a=0;a<E.length;a+=2)$.push(A+=E[a]),E[a+1]&&$.push(45,A+=E[a+1]);x.wordChars=String.fromCharCode.apply(null,$)}),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(k,x,H){var E=k("../config"),A=k("../tokenizer").Tokenizer,$=k("./text_highlight_rules").TextHighlightRules,a=k("./behaviour/cstyle").CstyleBehaviour,c=k("../unicode"),i=k("../lib/lang"),o=k("../token_iterator").TokenIterator,n=k("../range").Range,t;t=function(){this.HighlightRules=$},(function(){this.$defaultBehaviour=new a,this.tokenRe=new RegExp("^["+c.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+c.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new A(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,r,s,l){var h=r.doc,v=!0,m=!0,g=1/0,d=r.getTabSize(),b=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var S=this.lineCommentStart.map(i.escapeRegExp).join("|"),M=this.lineCommentStart[0];else var S=i.escapeRegExp(this.lineCommentStart),M=this.lineCommentStart;S=new RegExp("^(\\s*)(?:"+S+") ?"),b=r.getUseSoftTabs();var y=function(z,D){var N=z.match(S);if(N){var F=N[1].length,B=N[0].length;!p(z,F,B)&&N[0][B-1]==" "&&B--,h.removeInLine(D,F,B)}},u=M+" ",w=function(z,D){(!v||/\S/.test(z))&&(p(z,g,g)?h.insertInLine({row:D,column:g},u):h.insertInLine({row:D,column:g},M))},f=function(z,D){return S.test(z)},p=function(z,D,N){for(var F=0;D--&&z.charAt(D)==" ";)F++;if(F%d!=0)return!1;for(var F=0;z.charAt(N++)==" ";)F++;return d>2?F%d!=d-1:F%d==0}}else{if(!this.blockComment)return!1;var M=this.blockComment.start,C=this.blockComment.end,S=new RegExp("^(\\s*)(?:"+i.escapeRegExp(M)+")"),R=new RegExp("(?:"+i.escapeRegExp(C)+")\\s*$"),w=function(_,I){f(_,I)||(!v||/\S/.test(_))&&(h.insertInLine({row:I,column:_.length},C),h.insertInLine({row:I,column:g},M))},y=function(_,I){var O;(O=_.match(R))&&h.removeInLine(I,_.length-O[0].length,_.length),(O=_.match(S))&&h.removeInLine(I,O[1].length,O[0].length)},f=function(_,I){if(S.test(_))return!0;for(var O=r.getTokens(I),z=0;z<O.length;z++)if(O[z].type==="comment")return!0}}function L(_){for(var I=s;I<=l;I++)_(h.getLine(I),I)}var T=1/0;L(function(_,I){var O=_.search(/\S/);O!==-1?(O<g&&(g=O),m&&!f(_,I)&&(m=!1)):T>_.length&&(T=_.length)}),g==1/0&&(g=T,v=!1,m=!1),b&&g%d!=0&&(g=Math.floor(g/d)*d),L(m?y:w)},this.toggleBlockComment=function(e,r,s,l){var h=this.blockComment;if(h){!h.start&&h[0]&&(h=h[0]);var v=new o(r,l.row,l.column),m=v.getCurrentToken();r.selection;var g=r.selection.toOrientedRange(),d,b;if(m&&/comment/.test(m.type)){for(var M,C;m&&/comment/.test(m.type);){var S=m.value.indexOf(h.start);if(S!=-1){var R=v.getCurrentTokenRow(),w=v.getCurrentTokenColumn()+S;M=new n(R,w,R,w+h.start.length);break}m=v.stepBackward()}for(var v=new o(r,l.row,l.column),m=v.getCurrentToken();m&&/comment/.test(m.type);){var S=m.value.indexOf(h.end);if(S!=-1){var R=v.getCurrentTokenRow(),w=v.getCurrentTokenColumn()+S;C=new n(R,w,R,w+h.end.length);break}m=v.stepForward()}C&&r.remove(C),M&&(r.remove(M),d=M.start.row,b=-h.start.length)}else b=h.start.length,d=s.start.row,r.insert(s.end,h.end),r.insert(s.start,h.start);g.start.row==d&&(g.start.column+=b),g.end.row==d&&(g.end.column+=b),r.selection.fromOrientedRange(g)}},this.getNextLineIndent=function(e,r,s){return this.$getIndent(r)},this.checkOutdent=function(e,r,s){return!1},this.autoOutdent=function(e,r,s){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var r in e)if(e[r]){var s=e[r],l=s.prototype.$id,h=E.$modes[l];h||(E.$modes[l]=h=new s),E.$modes[r]||(E.$modes[r]=h),this.$embeds.push(r),this.$modes[r]=h}for(var v=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],m=function(d){(function(b){var M=v[d],C=b[M];b[v[d]]=function(){return this.$delegator(M,arguments,C)}})(g)},g=this,r=0;r<v.length;r++)m(r)},this.$delegator=function(e,r,s){var l=r[0]||"start";if(typeof l!="string"){if(Array.isArray(l[2])){var h=l[2][l[2].length-1],v=this.$modes[h];if(v)return v[e].apply(v,[l[1]].concat([].slice.call(r,1)))}l=l[0]||"start"}for(var m=0;m<this.$embeds.length;m++)if(this.$modes[this.$embeds[m]]){var g=l.split(this.$embeds[m]);if(!g[0]&&g[1]){r[0]=g[1];var v=this.$modes[this.$embeds[m]];return v[e].apply(v,r)}}var d=s.apply(this,r);return s?d:void 0},this.transformAction=function(e,r,s,l,h){if(this.$behaviour){var v=this.$behaviour.getBehaviours();for(var m in v)if(v[m][r]){var g=v[m][r].apply(this,arguments);if(g)return g}}},this.getKeywords=function(e){if(!this.completionKeywords){var r=this.$tokenizer.rules,s=[];for(var l in r)for(var h=r[l],v=0,m=h.length;v<m;v++)if(typeof h[v].token=="string")/keyword|support|storage/.test(h[v].token)&&s.push(h[v].regex);else if(typeof h[v].token=="object"){for(var g=0,d=h[v].token.length;g<d;g++)if(/keyword|support|storage/.test(h[v].token[g])){var l=h[v].regex.match(/\(.+?\)/g)[g];s.push(l.substr(1,l.length-2))}}this.completionKeywords=s}return e?s.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,r,s,l){var h=this.$keywordList||this.$createKeywordList();return h.map(function(v){return{name:v,value:v,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(t.prototype),x.Mode=t}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(k,x,H){var E=k("./lib/dom"),A=function(){function $(a){this.session=a,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 $.prototype.getRowLength=function(a){var c;return this.lineWidgets?c=this.lineWidgets[a]&&this.lineWidgets[a].rowCount||0:c=0,!this.$useWrapMode||!this.$wrapData[a]?1+c:this.$wrapData[a].length+1+c},$.prototype.$getWidgetScreenLength=function(){var a=0;return this.lineWidgets.forEach(function(c){c&&c.rowCount&&!c.hidden&&(a+=c.rowCount)}),a},$.prototype.$onChangeEditor=function(a){this.attach(a.editor)},$.prototype.attach=function(a){a&&a.widgetManager&&a.widgetManager!=this&&a.widgetManager.detach(),this.editor!=a&&(this.detach(),this.editor=a,a&&(a.widgetManager=this,a.renderer.on("beforeRender",this.measureWidgets),a.renderer.on("afterRender",this.renderWidgets)))},$.prototype.detach=function(a){var c=this.editor;if(c){this.editor=null,c.widgetManager=null,c.renderer.off("beforeRender",this.measureWidgets),c.renderer.off("afterRender",this.renderWidgets);var i=this.session.lineWidgets;i&&i.forEach(function(o){o&&o.el&&o.el.parentNode&&(o._inDocument=!1,o.el.parentNode.removeChild(o.el))})}},$.prototype.updateOnFold=function(a,c){var i=c.lineWidgets;if(!(!i||!a.action)){for(var o=a.data,n=o.start.row,t=o.end.row,e=a.action=="add",r=n+1;r<t;r++)i[r]&&(i[r].hidden=e);i[t]&&(e?i[n]?i[t].hidden=e:i[n]=i[t]:(i[n]==i[t]&&(i[n]=void 0),i[t].hidden=e))}},$.prototype.updateOnChange=function(a){var c=this.session.lineWidgets;if(c){var i=a.start.row,o=a.end.row-i;if(o!==0)if(a.action=="remove"){var n=c.splice(i+1,o);!c[i]&&n[n.length-1]&&(c[i]=n.pop()),n.forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var t=new Array(o);c[i]&&c[i].column!=null&&a.start.column>c[i].column&&i++,t.unshift(i,0),c.splice.apply(c,t),this.$updateRows()}}},$.prototype.$updateRows=function(){var a=this.session.lineWidgets;if(a){var c=!0;a.forEach(function(i,o){if(i)for(c=!1,i.row=o;i.$oldWidget;)i.$oldWidget.row=o,i=i.$oldWidget}),c&&(this.session.lineWidgets=null)}},$.prototype.$registerLineWidget=function(a){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var c=this.session.lineWidgets[a.row];return c&&(a.$oldWidget=c,c.el&&c.el.parentNode&&(c.el.parentNode.removeChild(c.el),c._inDocument=!1)),this.session.lineWidgets[a.row]=a,a},$.prototype.addLineWidget=function(a){if(this.$registerLineWidget(a),a.session=this.session,!this.editor)return a;var c=this.editor.renderer;a.html&&!a.el&&(a.el=E.createElement("div"),a.el.innerHTML=a.html),a.text&&!a.el&&(a.el=E.createElement("div"),a.el.textContent=a.text),a.el&&(E.addCssClass(a.el,"ace_lineWidgetContainer"),a.className&&E.addCssClass(a.el,a.className),a.el.style.position="absolute",a.el.style.zIndex="5",c.container.appendChild(a.el),a._inDocument=!0,a.coverGutter||(a.el.style.zIndex="3"),a.pixelHeight==null&&(a.pixelHeight=a.el.offsetHeight)),a.rowCount==null&&(a.rowCount=a.pixelHeight/c.layerConfig.lineHeight);var i=this.session.getFoldAt(a.row,0);if(a.$fold=i,i){var o=this.session.lineWidgets;a.row==i.end.row&&!o[i.start.row]?o[i.start.row]=a:a.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows(),this.renderWidgets(null,c),this.onWidgetChanged(a),a},$.prototype.removeLineWidget=function(a){if(a._inDocument=!1,a.session=null,a.el&&a.el.parentNode&&a.el.parentNode.removeChild(a.el),a.editor&&a.editor.destroy)try{a.editor.destroy()}catch{}if(this.session.lineWidgets){var c=this.session.lineWidgets[a.row];if(c==a)this.session.lineWidgets[a.row]=a.$oldWidget,a.$oldWidget&&this.onWidgetChanged(a.$oldWidget);else for(;c;){if(c.$oldWidget==a){c.$oldWidget=a.$oldWidget;break}c=c.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows()},$.prototype.getWidgetsAtRow=function(a){for(var c=this.session.lineWidgets,i=c&&c[a],o=[];i;)o.push(i),i=i.$oldWidget;return o},$.prototype.onWidgetChanged=function(a){this.session._changedWidgets.push(a),this.editor&&this.editor.renderer.updateFull()},$.prototype.measureWidgets=function(a,c){var i=this.session._changedWidgets,o=c.layerConfig;if(!(!i||!i.length)){for(var n=1/0,t=0;t<i.length;t++){var e=i[t];if(!(!e||!e.el)&&e.session==this.session){if(!e._inDocument){if(this.session.lineWidgets[e.row]!=e)continue;e._inDocument=!0,c.container.appendChild(e.el)}e.h=e.el.offsetHeight,e.fixedWidth||(e.w=e.el.offsetWidth,e.screenWidth=Math.ceil(e.w/o.characterWidth));var r=e.h/o.lineHeight;e.coverLine&&(r-=this.session.getRowLineCount(e.row),r<0&&(r=0)),e.rowCount!=r&&(e.rowCount=r,e.row<n&&(n=e.row))}}n!=1/0&&(this.session._emit("changeFold",{data:{start:{row:n}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},$.prototype.renderWidgets=function(a,c){var i=c.layerConfig,o=this.session.lineWidgets;if(o){for(var n=Math.min(this.firstRow,i.firstRow),t=Math.max(this.lastRow,i.lastRow,o.length);n>0&&!o[n];)n--;this.firstRow=i.firstRow,this.lastRow=i.lastRow,c.$cursorLayer.config=i;for(var e=n;e<=t;e++){var r=o[e];if(!(!r||!r.el)){if(r.hidden){r.el.style.top=-100-(r.pixelHeight||0)+"px";continue}r._inDocument||(r._inDocument=!0,c.container.appendChild(r.el));var s=c.$cursorLayer.getPixelPosition({row:e,column:0},!0).top;r.coverLine||(s+=i.lineHeight*this.session.getRowLineCount(r.row)),r.el.style.top=s-i.offset+"px";var l=r.coverGutter?0:c.gutterWidth;r.fixedWidth||(l-=c.scrollLeft),r.el.style.left=l+"px",r.fullWidth&&r.screenWidth&&(r.el.style.minWidth=i.width+2*i.padding+"px"),r.fixedWidth?r.el.style.right=c.scrollBar.getWidth()+"px":r.el.style.right=""}}}},$}();x.LineWidgets=A}),ace.define("ace/apply_delta",["require","exports","module"],function(k,x,H){x.applyDelta=function(E,A,$){var a=A.start.row,c=A.start.column,i=E[a]||"";switch(A.action){case"insert":var o=A.lines;if(o.length===1)E[a]=i.substring(0,c)+A.lines[0]+i.substring(c);else{var n=[a,1].concat(A.lines);E.splice.apply(E,n),E[a]=i.substring(0,c)+E[a],E[a+A.lines.length-1]+=i.substring(c)}break;case"remove":var t=A.end.column,e=A.end.row;a===e?E[a]=i.substring(0,c)+i.substring(t):E.splice(a,e-a+1,i.substring(0,c)+E[e].substring(t));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(k,x,H){var E=k("./lib/oop"),A=k("./lib/event_emitter").EventEmitter,$=function(){function i(o,n,t){this.$onChange=this.onChange.bind(this),this.attach(o),typeof n!="number"?this.setPosition(n.row,n.column):this.setPosition(n,t)}return i.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},i.prototype.getDocument=function(){return this.document},i.prototype.onChange=function(o){if(!(o.start.row==o.end.row&&o.start.row!=this.row)&&!(o.start.row>this.row)){var n=c(o,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},i.prototype.setPosition=function(o,n,t){var e;if(t?e={row:o,column:n}:e=this.$clipPositionToDocument(o,n),!(this.row==e.row&&this.column==e.column)){var r={row:this.row,column:this.column};this.row=e.row,this.column=e.column,this._signal("change",{old:r,value:e})}},i.prototype.detach=function(){this.document.off("change",this.$onChange)},i.prototype.attach=function(o){this.document=o||this.document,this.document.on("change",this.$onChange)},i.prototype.$clipPositionToDocument=function(o,n){var t={};return o>=this.document.getLength()?(t.row=Math.max(0,this.document.getLength()-1),t.column=this.document.getLine(t.row).length):o<0?(t.row=0,t.column=0):(t.row=o,t.column=Math.min(this.document.getLine(t.row).length,Math.max(0,n))),n<0&&(t.column=0),t},i}();$.prototype.$insertRight=!1,E.implement($.prototype,A);function a(i,o,n){var t=n?i.column<=o.column:i.column<o.column;return i.row<o.row||i.row==o.row&&t}function c(i,o,n){var t=i.action=="insert",e=(t?1:-1)*(i.end.row-i.start.row),r=(t?1:-1)*(i.end.column-i.start.column),s=i.start,l=t?s:i.end;return a(o,s,n)?{row:o.row,column:o.column}:a(l,o,!n)?{row:o.row+e,column:o.column+(o.row==l.row?r:0)}:{row:s.row,column:s.column}}x.Anchor=$}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(k,x,H){var E=k("./lib/oop"),A=k("./apply_delta").applyDelta,$=k("./lib/event_emitter").EventEmitter,a=k("./range").Range,c=k("./anchor").Anchor,i=function(){function o(n){this.$lines=[""],n.length===0?this.$lines=[""]:Array.isArray(n)?this.insertMergedLines({row:0,column:0},n):this.insert({row:0,column:0},n)}return o.prototype.setValue=function(n){var t=this.getLength()-1;this.remove(new a(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},n||"")},o.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},o.prototype.createAnchor=function(n,t){return new c(this,n,t)},o.prototype.$detectNewLine=function(n){var t=n.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:`
186
+ `)&&m.selection.isEmpty()){var b=m.getCursorPosition();if(b.column===0)return;for(var M=g.doc.getLine(b.row),C=g.doc.getLine(b.row+1),S=g.getTokens(b.row),R=0,w=0;w<S.length;w++){R+=S[w].value.length;var y=S[w];if(R>=b.column){if(R===b.column){if(!/\.doc/.test(y.type))return;if(/\*\//.test(y.value)){var f=S[w+1];if(!f||!/\.doc/.test(f.type))return}}var u=b.column-(R-y.value.length),p=y.value.indexOf("*/"),x=y.value.indexOf("/**",p>-1?p+2:0);if(x!==-1&&u>x&&u<x+3||p!==-1&&x!==-1&&u>=p&&u<=x||!/\.doc/.test(y.type))return;break}}var T=this.$getIndent(M);if(/\s*\*/.test(C))return/^\s*\*/.test(M)?{text:d+T+"* ",selection:[1,2+T.length,1,2+T.length]}:{text:d+T+" * ",selection:[1,3+T.length,1,3+T.length]};if(/\/\*\*/.test(M.substring(0,b.column)))return{text:d+T+" * "+d+" "+T+"*/",selection:[1,4+T.length,1,4+T.length]}}})},s.isSaneInsertion=function(l,h){var v=l.getCursorPosition(),m=new $(h,v.row,v.column);if(!this.$matchTokenType(m.getCurrentToken()||"text",c)){if(/[)}\]]/.test(l.session.getLine(v.row)[v.column]))return!0;var g=new $(h,v.row,v.column+1);if(!this.$matchTokenType(g.getCurrentToken()||"text",c))return!1}return m.stepForward(),m.getCurrentTokenRow()!==v.row||this.$matchTokenType(m.getCurrentToken()||"text",i)},s.$matchTokenType=function(l,h){return h.indexOf(l.type||l)>-1},s.recordAutoInsert=function(l,h,v){var m=l.getCursorPosition(),g=h.doc.getLine(m.row);this.isAutoInsertedClosing(m,g,o.autoInsertedLineEnd[0])||(o.autoInsertedBrackets=0),o.autoInsertedRow=m.row,o.autoInsertedLineEnd=v+g.substr(m.column),o.autoInsertedBrackets++},s.recordMaybeInsert=function(l,h,v){var m=l.getCursorPosition(),g=h.doc.getLine(m.row);this.isMaybeInsertedClosing(m,g)||(o.maybeInsertedBrackets=0),o.maybeInsertedRow=m.row,o.maybeInsertedLineStart=g.substr(0,m.column)+v,o.maybeInsertedLineEnd=g.substr(m.column),o.maybeInsertedBrackets++},s.isAutoInsertedClosing=function(l,h,v){return o.autoInsertedBrackets>0&&l.row===o.autoInsertedRow&&v===o.autoInsertedLineEnd[0]&&h.substr(l.column)===o.autoInsertedLineEnd},s.isMaybeInsertedClosing=function(l,h){return o.maybeInsertedBrackets>0&&l.row===o.maybeInsertedRow&&h.substr(l.column)===o.maybeInsertedLineEnd&&h.substr(0,l.column)==o.maybeInsertedLineStart},s.popAutoInsertedClosing=function(){o.autoInsertedLineEnd=o.autoInsertedLineEnd.substr(1),o.autoInsertedBrackets--},s.clearMaybeInsertedClosing=function(){o&&(o.maybeInsertedBrackets=0,o.maybeInsertedRow=-1)},E.inherits(s,A),L.CstyleBehaviour=s}),ace.define("ace/unicode",["require","exports","module"],function(k,L,H){for(var E=[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],A=0,$=[],a=0;a<E.length;a+=2)$.push(A+=E[a]),E[a+1]&&$.push(45,A+=E[a+1]);L.wordChars=String.fromCharCode.apply(null,$)}),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(k,L,H){var E=k("../config"),A=k("../tokenizer").Tokenizer,$=k("./text_highlight_rules").TextHighlightRules,a=k("./behaviour/cstyle").CstyleBehaviour,c=k("../unicode"),i=k("../lib/lang"),o=k("../token_iterator").TokenIterator,n=k("../range").Range,t;t=function(){this.HighlightRules=$},(function(){this.$defaultBehaviour=new a,this.tokenRe=new RegExp("^["+c.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+c.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new A(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,r,s,l){var h=r.doc,v=!0,m=!0,g=1/0,d=r.getTabSize(),b=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var S=this.lineCommentStart.map(i.escapeRegExp).join("|"),M=this.lineCommentStart[0];else var S=i.escapeRegExp(this.lineCommentStart),M=this.lineCommentStart;S=new RegExp("^(\\s*)(?:"+S+") ?"),b=r.getUseSoftTabs();var y=function(z,D){var N=z.match(S);if(N){var F=N[1].length,B=N[0].length;!p(z,F,B)&&N[0][B-1]==" "&&B--,h.removeInLine(D,F,B)}},u=M+" ",w=function(z,D){(!v||/\S/.test(z))&&(p(z,g,g)?h.insertInLine({row:D,column:g},u):h.insertInLine({row:D,column:g},M))},f=function(z,D){return S.test(z)},p=function(z,D,N){for(var F=0;D--&&z.charAt(D)==" ";)F++;if(F%d!=0)return!1;for(var F=0;z.charAt(N++)==" ";)F++;return d>2?F%d!=d-1:F%d==0}}else{if(!this.blockComment)return!1;var M=this.blockComment.start,C=this.blockComment.end,S=new RegExp("^(\\s*)(?:"+i.escapeRegExp(M)+")"),R=new RegExp("(?:"+i.escapeRegExp(C)+")\\s*$"),w=function(_,I){f(_,I)||(!v||/\S/.test(_))&&(h.insertInLine({row:I,column:_.length},C),h.insertInLine({row:I,column:g},M))},y=function(_,I){var O;(O=_.match(R))&&h.removeInLine(I,_.length-O[0].length,_.length),(O=_.match(S))&&h.removeInLine(I,O[1].length,O[0].length)},f=function(_,I){if(S.test(_))return!0;for(var O=r.getTokens(I),z=0;z<O.length;z++)if(O[z].type==="comment")return!0}}function x(_){for(var I=s;I<=l;I++)_(h.getLine(I),I)}var T=1/0;x(function(_,I){var O=_.search(/\S/);O!==-1?(O<g&&(g=O),m&&!f(_,I)&&(m=!1)):T>_.length&&(T=_.length)}),g==1/0&&(g=T,v=!1,m=!1),b&&g%d!=0&&(g=Math.floor(g/d)*d),x(m?y:w)},this.toggleBlockComment=function(e,r,s,l){var h=this.blockComment;if(h){!h.start&&h[0]&&(h=h[0]);var v=new o(r,l.row,l.column),m=v.getCurrentToken();r.selection;var g=r.selection.toOrientedRange(),d,b;if(m&&/comment/.test(m.type)){for(var M,C;m&&/comment/.test(m.type);){var S=m.value.indexOf(h.start);if(S!=-1){var R=v.getCurrentTokenRow(),w=v.getCurrentTokenColumn()+S;M=new n(R,w,R,w+h.start.length);break}m=v.stepBackward()}for(var v=new o(r,l.row,l.column),m=v.getCurrentToken();m&&/comment/.test(m.type);){var S=m.value.indexOf(h.end);if(S!=-1){var R=v.getCurrentTokenRow(),w=v.getCurrentTokenColumn()+S;C=new n(R,w,R,w+h.end.length);break}m=v.stepForward()}C&&r.remove(C),M&&(r.remove(M),d=M.start.row,b=-h.start.length)}else b=h.start.length,d=s.start.row,r.insert(s.end,h.end),r.insert(s.start,h.start);g.start.row==d&&(g.start.column+=b),g.end.row==d&&(g.end.column+=b),r.selection.fromOrientedRange(g)}},this.getNextLineIndent=function(e,r,s){return this.$getIndent(r)},this.checkOutdent=function(e,r,s){return!1},this.autoOutdent=function(e,r,s){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var r in e)if(e[r]){var s=e[r],l=s.prototype.$id,h=E.$modes[l];h||(E.$modes[l]=h=new s),E.$modes[r]||(E.$modes[r]=h),this.$embeds.push(r),this.$modes[r]=h}for(var v=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],m=function(d){(function(b){var M=v[d],C=b[M];b[v[d]]=function(){return this.$delegator(M,arguments,C)}})(g)},g=this,r=0;r<v.length;r++)m(r)},this.$delegator=function(e,r,s){var l=r[0]||"start";if(typeof l!="string"){if(Array.isArray(l[2])){var h=l[2][l[2].length-1],v=this.$modes[h];if(v)return v[e].apply(v,[l[1]].concat([].slice.call(r,1)))}l=l[0]||"start"}for(var m=0;m<this.$embeds.length;m++)if(this.$modes[this.$embeds[m]]){var g=l.split(this.$embeds[m]);if(!g[0]&&g[1]){r[0]=g[1];var v=this.$modes[this.$embeds[m]];return v[e].apply(v,r)}}var d=s.apply(this,r);return s?d:void 0},this.transformAction=function(e,r,s,l,h){if(this.$behaviour){var v=this.$behaviour.getBehaviours();for(var m in v)if(v[m][r]){var g=v[m][r].apply(this,arguments);if(g)return g}}},this.getKeywords=function(e){if(!this.completionKeywords){var r=this.$tokenizer.rules,s=[];for(var l in r)for(var h=r[l],v=0,m=h.length;v<m;v++)if(typeof h[v].token=="string")/keyword|support|storage/.test(h[v].token)&&s.push(h[v].regex);else if(typeof h[v].token=="object"){for(var g=0,d=h[v].token.length;g<d;g++)if(/keyword|support|storage/.test(h[v].token[g])){var l=h[v].regex.match(/\(.+?\)/g)[g];s.push(l.substr(1,l.length-2))}}this.completionKeywords=s}return e?s.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,r,s,l){var h=this.$keywordList||this.$createKeywordList();return h.map(function(v){return{name:v,value:v,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(t.prototype),L.Mode=t}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(k,L,H){var E=k("./lib/dom"),A=function(){function $(a){this.session=a,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 $.prototype.getRowLength=function(a){var c;return this.lineWidgets?c=this.lineWidgets[a]&&this.lineWidgets[a].rowCount||0:c=0,!this.$useWrapMode||!this.$wrapData[a]?1+c:this.$wrapData[a].length+1+c},$.prototype.$getWidgetScreenLength=function(){var a=0;return this.lineWidgets.forEach(function(c){c&&c.rowCount&&!c.hidden&&(a+=c.rowCount)}),a},$.prototype.$onChangeEditor=function(a){this.attach(a.editor)},$.prototype.attach=function(a){a&&a.widgetManager&&a.widgetManager!=this&&a.widgetManager.detach(),this.editor!=a&&(this.detach(),this.editor=a,a&&(a.widgetManager=this,a.renderer.on("beforeRender",this.measureWidgets),a.renderer.on("afterRender",this.renderWidgets)))},$.prototype.detach=function(a){var c=this.editor;if(c){this.editor=null,c.widgetManager=null,c.renderer.off("beforeRender",this.measureWidgets),c.renderer.off("afterRender",this.renderWidgets);var i=this.session.lineWidgets;i&&i.forEach(function(o){o&&o.el&&o.el.parentNode&&(o._inDocument=!1,o.el.parentNode.removeChild(o.el))})}},$.prototype.updateOnFold=function(a,c){var i=c.lineWidgets;if(!(!i||!a.action)){for(var o=a.data,n=o.start.row,t=o.end.row,e=a.action=="add",r=n+1;r<t;r++)i[r]&&(i[r].hidden=e);i[t]&&(e?i[n]?i[t].hidden=e:i[n]=i[t]:(i[n]==i[t]&&(i[n]=void 0),i[t].hidden=e))}},$.prototype.updateOnChange=function(a){var c=this.session.lineWidgets;if(c){var i=a.start.row,o=a.end.row-i;if(o!==0)if(a.action=="remove"){var n=c.splice(i+1,o);!c[i]&&n[n.length-1]&&(c[i]=n.pop()),n.forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var t=new Array(o);c[i]&&c[i].column!=null&&a.start.column>c[i].column&&i++,t.unshift(i,0),c.splice.apply(c,t),this.$updateRows()}}},$.prototype.$updateRows=function(){var a=this.session.lineWidgets;if(a){var c=!0;a.forEach(function(i,o){if(i)for(c=!1,i.row=o;i.$oldWidget;)i.$oldWidget.row=o,i=i.$oldWidget}),c&&(this.session.lineWidgets=null)}},$.prototype.$registerLineWidget=function(a){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var c=this.session.lineWidgets[a.row];return c&&(a.$oldWidget=c,c.el&&c.el.parentNode&&(c.el.parentNode.removeChild(c.el),c._inDocument=!1)),this.session.lineWidgets[a.row]=a,a},$.prototype.addLineWidget=function(a){if(this.$registerLineWidget(a),a.session=this.session,!this.editor)return a;var c=this.editor.renderer;a.html&&!a.el&&(a.el=E.createElement("div"),a.el.innerHTML=a.html),a.text&&!a.el&&(a.el=E.createElement("div"),a.el.textContent=a.text),a.el&&(E.addCssClass(a.el,"ace_lineWidgetContainer"),a.className&&E.addCssClass(a.el,a.className),a.el.style.position="absolute",a.el.style.zIndex="5",c.container.appendChild(a.el),a._inDocument=!0,a.coverGutter||(a.el.style.zIndex="3"),a.pixelHeight==null&&(a.pixelHeight=a.el.offsetHeight)),a.rowCount==null&&(a.rowCount=a.pixelHeight/c.layerConfig.lineHeight);var i=this.session.getFoldAt(a.row,0);if(a.$fold=i,i){var o=this.session.lineWidgets;a.row==i.end.row&&!o[i.start.row]?o[i.start.row]=a:a.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows(),this.renderWidgets(null,c),this.onWidgetChanged(a),a},$.prototype.removeLineWidget=function(a){if(a._inDocument=!1,a.session=null,a.el&&a.el.parentNode&&a.el.parentNode.removeChild(a.el),a.editor&&a.editor.destroy)try{a.editor.destroy()}catch{}if(this.session.lineWidgets){var c=this.session.lineWidgets[a.row];if(c==a)this.session.lineWidgets[a.row]=a.$oldWidget,a.$oldWidget&&this.onWidgetChanged(a.$oldWidget);else for(;c;){if(c.$oldWidget==a){c.$oldWidget=a.$oldWidget;break}c=c.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows()},$.prototype.getWidgetsAtRow=function(a){for(var c=this.session.lineWidgets,i=c&&c[a],o=[];i;)o.push(i),i=i.$oldWidget;return o},$.prototype.onWidgetChanged=function(a){this.session._changedWidgets.push(a),this.editor&&this.editor.renderer.updateFull()},$.prototype.measureWidgets=function(a,c){var i=this.session._changedWidgets,o=c.layerConfig;if(!(!i||!i.length)){for(var n=1/0,t=0;t<i.length;t++){var e=i[t];if(!(!e||!e.el)&&e.session==this.session){if(!e._inDocument){if(this.session.lineWidgets[e.row]!=e)continue;e._inDocument=!0,c.container.appendChild(e.el)}e.h=e.el.offsetHeight,e.fixedWidth||(e.w=e.el.offsetWidth,e.screenWidth=Math.ceil(e.w/o.characterWidth));var r=e.h/o.lineHeight;e.coverLine&&(r-=this.session.getRowLineCount(e.row),r<0&&(r=0)),e.rowCount!=r&&(e.rowCount=r,e.row<n&&(n=e.row))}}n!=1/0&&(this.session._emit("changeFold",{data:{start:{row:n}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},$.prototype.renderWidgets=function(a,c){var i=c.layerConfig,o=this.session.lineWidgets;if(o){for(var n=Math.min(this.firstRow,i.firstRow),t=Math.max(this.lastRow,i.lastRow,o.length);n>0&&!o[n];)n--;this.firstRow=i.firstRow,this.lastRow=i.lastRow,c.$cursorLayer.config=i;for(var e=n;e<=t;e++){var r=o[e];if(!(!r||!r.el)){if(r.hidden){r.el.style.top=-100-(r.pixelHeight||0)+"px";continue}r._inDocument||(r._inDocument=!0,c.container.appendChild(r.el));var s=c.$cursorLayer.getPixelPosition({row:e,column:0},!0).top;r.coverLine||(s+=i.lineHeight*this.session.getRowLineCount(r.row)),r.el.style.top=s-i.offset+"px";var l=r.coverGutter?0:c.gutterWidth;r.fixedWidth||(l-=c.scrollLeft),r.el.style.left=l+"px",r.fullWidth&&r.screenWidth&&(r.el.style.minWidth=i.width+2*i.padding+"px"),r.fixedWidth?r.el.style.right=c.scrollBar.getWidth()+"px":r.el.style.right=""}}}},$}();L.LineWidgets=A}),ace.define("ace/apply_delta",["require","exports","module"],function(k,L,H){L.applyDelta=function(E,A,$){var a=A.start.row,c=A.start.column,i=E[a]||"";switch(A.action){case"insert":var o=A.lines;if(o.length===1)E[a]=i.substring(0,c)+A.lines[0]+i.substring(c);else{var n=[a,1].concat(A.lines);E.splice.apply(E,n),E[a]=i.substring(0,c)+E[a],E[a+A.lines.length-1]+=i.substring(c)}break;case"remove":var t=A.end.column,e=A.end.row;a===e?E[a]=i.substring(0,c)+i.substring(t):E.splice(a,e-a+1,i.substring(0,c)+E[e].substring(t));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(k,L,H){var E=k("./lib/oop"),A=k("./lib/event_emitter").EventEmitter,$=function(){function i(o,n,t){this.$onChange=this.onChange.bind(this),this.attach(o),typeof n!="number"?this.setPosition(n.row,n.column):this.setPosition(n,t)}return i.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},i.prototype.getDocument=function(){return this.document},i.prototype.onChange=function(o){if(!(o.start.row==o.end.row&&o.start.row!=this.row)&&!(o.start.row>this.row)){var n=c(o,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},i.prototype.setPosition=function(o,n,t){var e;if(t?e={row:o,column:n}:e=this.$clipPositionToDocument(o,n),!(this.row==e.row&&this.column==e.column)){var r={row:this.row,column:this.column};this.row=e.row,this.column=e.column,this._signal("change",{old:r,value:e})}},i.prototype.detach=function(){this.document.off("change",this.$onChange)},i.prototype.attach=function(o){this.document=o||this.document,this.document.on("change",this.$onChange)},i.prototype.$clipPositionToDocument=function(o,n){var t={};return o>=this.document.getLength()?(t.row=Math.max(0,this.document.getLength()-1),t.column=this.document.getLine(t.row).length):o<0?(t.row=0,t.column=0):(t.row=o,t.column=Math.min(this.document.getLine(t.row).length,Math.max(0,n))),n<0&&(t.column=0),t},i}();$.prototype.$insertRight=!1,E.implement($.prototype,A);function a(i,o,n){var t=n?i.column<=o.column:i.column<o.column;return i.row<o.row||i.row==o.row&&t}function c(i,o,n){var t=i.action=="insert",e=(t?1:-1)*(i.end.row-i.start.row),r=(t?1:-1)*(i.end.column-i.start.column),s=i.start,l=t?s:i.end;return a(o,s,n)?{row:o.row,column:o.column}:a(l,o,!n)?{row:o.row+e,column:o.column+(o.row==l.row?r:0)}:{row:s.row,column:s.column}}L.Anchor=$}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(k,L,H){var E=k("./lib/oop"),A=k("./apply_delta").applyDelta,$=k("./lib/event_emitter").EventEmitter,a=k("./range").Range,c=k("./anchor").Anchor,i=function(){function o(n){this.$lines=[""],n.length===0?this.$lines=[""]:Array.isArray(n)?this.insertMergedLines({row:0,column:0},n):this.insert({row:0,column:0},n)}return o.prototype.setValue=function(n){var t=this.getLength()-1;this.remove(new a(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},n||"")},o.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},o.prototype.createAnchor=function(n,t){return new c(this,n,t)},o.prototype.$detectNewLine=function(n){var t=n.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:`
187
187
  `,this._signal("changeNewLineMode")},o.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
188
188
  `;case"unix":return`
189
189
  `;default:return this.$autoNewLine||`
190
190
  `}},o.prototype.setNewLineMode=function(n){this.$newLineMode!==n&&(this.$newLineMode=n,this._signal("changeNewLineMode"))},o.prototype.getNewLineMode=function(){return this.$newLineMode},o.prototype.isNewLine=function(n){return n==`\r
191
191
  `||n=="\r"||n==`
192
- `},o.prototype.getLine=function(n){return this.$lines[n]||""},o.prototype.getLines=function(n,t){return this.$lines.slice(n,t+1)},o.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},o.prototype.getLength=function(){return this.$lines.length},o.prototype.getTextRange=function(n){return this.getLinesForRange(n).join(this.getNewLineCharacter())},o.prototype.getLinesForRange=function(n){var t;if(n.start.row===n.end.row)t=[this.getLine(n.start.row).substring(n.start.column,n.end.column)];else{t=this.getLines(n.start.row,n.end.row),t[0]=(t[0]||"").substring(n.start.column);var e=t.length-1;n.end.row-n.start.row==e&&(t[e]=t[e].substring(0,n.end.column))}return t},o.prototype.insertLines=function(n,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(n,t)},o.prototype.removeLines=function(n,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(n,t)},o.prototype.insertNewLine=function(n){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(n,["",""])},o.prototype.insert=function(n,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(n,this.$split(t))},o.prototype.insertInLine=function(n,t){var e=this.clippedPos(n.row,n.column),r=this.pos(n.row,n.column+t.length);return this.applyDelta({start:e,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},o.prototype.clippedPos=function(n,t){var e=this.getLength();n===void 0?n=e:n<0?n=0:n>=e&&(n=e-1,t=void 0);var r=this.getLine(n);return t==null&&(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:n,column:t}},o.prototype.clonePos=function(n){return{row:n.row,column:n.column}},o.prototype.pos=function(n,t){return{row:n,column:t}},o.prototype.$clipPosition=function(n){var t=this.getLength();return n.row>=t?(n.row=Math.max(0,t-1),n.column=this.getLine(t-1).length):(n.row=Math.max(0,n.row),n.column=Math.min(Math.max(n.column,0),this.getLine(n.row).length)),n},o.prototype.insertFullLines=function(n,t){n=Math.min(Math.max(n,0),this.getLength());var e=0;n<this.getLength()?(t=t.concat([""]),e=0):(t=[""].concat(t),n--,e=this.$lines[n].length),this.insertMergedLines({row:n,column:e},t)},o.prototype.insertMergedLines=function(n,t){var e=this.clippedPos(n.row,n.column),r={row:e.row+t.length-1,column:(t.length==1?e.column:0)+t[t.length-1].length};return this.applyDelta({start:e,end:r,action:"insert",lines:t}),this.clonePos(r)},o.prototype.remove=function(n){var t=this.clippedPos(n.start.row,n.start.column),e=this.clippedPos(n.end.row,n.end.column);return this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})}),this.clonePos(t)},o.prototype.removeInLine=function(n,t,e){var r=this.clippedPos(n,t),s=this.clippedPos(n,e);return this.applyDelta({start:r,end:s,action:"remove",lines:this.getLinesForRange({start:r,end:s})},!0),this.clonePos(r)},o.prototype.removeFullLines=function(n,t){n=Math.min(Math.max(0,n),this.getLength()-1),t=Math.min(Math.max(0,t),this.getLength()-1);var e=t==this.getLength()-1&&n>0,r=t<this.getLength()-1,s=e?n-1:n,l=e?this.getLine(s).length:0,h=r?t+1:t,v=r?0:this.getLine(h).length,m=new a(s,l,h,v),g=this.$lines.slice(n,t+1);return this.applyDelta({start:m.start,end:m.end,action:"remove",lines:this.getLinesForRange(m)}),g},o.prototype.removeNewLine=function(n){n<this.getLength()-1&&n>=0&&this.applyDelta({start:this.pos(n,this.getLine(n).length),end:this.pos(n+1,0),action:"remove",lines:["",""]})},o.prototype.replace=function(n,t){if(n instanceof a||(n=a.fromPoints(n.start,n.end)),t.length===0&&n.isEmpty())return n.start;if(t==this.getTextRange(n))return n.end;this.remove(n);var e;return t?e=this.insert(n.start,t):e=n.start,e},o.prototype.applyDeltas=function(n){for(var t=0;t<n.length;t++)this.applyDelta(n[t])},o.prototype.revertDeltas=function(n){for(var t=n.length-1;t>=0;t--)this.revertDelta(n[t])},o.prototype.applyDelta=function(n,t){var e=n.action=="insert";(e?n.lines.length<=1&&!n.lines[0]:!a.comparePoints(n.start,n.end))||(e&&n.lines.length>2e4?this.$splitAndapplyLargeDelta(n,2e4):(A(this.$lines,n,t),this._signal("change",n)))},o.prototype.$safeApplyDelta=function(n){var t=this.$lines.length;(n.action=="remove"&&n.start.row<t&&n.end.row<t||n.action=="insert"&&n.start.row<=t)&&this.applyDelta(n)},o.prototype.$splitAndapplyLargeDelta=function(n,t){for(var e=n.lines,r=e.length-t+1,s=n.start.row,l=n.start.column,h=0,v=0;h<r;h=v){v+=t-1;var m=e.slice(h,v);m.push(""),this.applyDelta({start:this.pos(s+h,l),end:this.pos(s+v,l=0),action:n.action,lines:m},!0)}n.lines=e.slice(h),n.start.row=s+h,n.start.column=l,this.applyDelta(n,!0)},o.prototype.revertDelta=function(n){this.$safeApplyDelta({start:this.clonePos(n.start),end:this.clonePos(n.end),action:n.action=="insert"?"remove":"insert",lines:n.lines.slice()})},o.prototype.indexToPosition=function(n,t){for(var e=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,s=t||0,l=e.length;s<l;s++)if(n-=e[s].length+r,n<0)return{row:s,column:n+e[s].length+r};return{row:l-1,column:n+e[l-1].length+r}},o.prototype.positionToIndex=function(n,t){for(var e=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,s=0,l=Math.min(n.row,e.length),h=t||0;h<l;++h)s+=e[h].length+r;return s+n.column},o.prototype.$split=function(n){return n.split(/\r\n|\r|\n/)},o}();i.prototype.$autoNewLine="",i.prototype.$newLineMode="auto",E.implement(i.prototype,$),x.Document=i}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(k,x,H){var E=k("./lib/oop"),A=k("./lib/event_emitter").EventEmitter,$=function(){function a(c,i){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=c;var o=this;this.$worker=function(){if(o.running){for(var n=new Date,t=o.currentLine,e=-1,r=o.doc,s=t;o.lines[t];)t++;var l=r.getLength(),h=0;for(o.running=!1;t<l;){o.$tokenizeRow(t),e=t;do t++;while(o.lines[t]);if(h++,h%5===0&&new Date-n>20){o.running=setTimeout(o.$worker,20);break}}o.currentLine=t,e==-1&&(e=t),s<=e&&o.fireUpdateEvent(s,e)}}}return a.prototype.setTokenizer=function(c){this.tokenizer=c,this.lines=[],this.states=[],this.start(0)},a.prototype.setDocument=function(c){this.doc=c,this.lines=[],this.states=[],this.stop()},a.prototype.fireUpdateEvent=function(c,i){var o={first:c,last:i};this._signal("update",{data:o})},a.prototype.start=function(c){this.currentLine=Math.min(c||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)},a.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},a.prototype.$updateOnChange=function(c){var i=c.start.row,o=c.end.row-i;if(o===0)this.lines[i]=null;else if(c.action=="remove")this.lines.splice(i,o+1,null),this.states.splice(i,o+1,null);else{var n=Array(o+1);n.unshift(i,1),this.lines.splice.apply(this.lines,n),this.states.splice.apply(this.states,n)}this.currentLine=Math.min(i,this.currentLine,this.doc.getLength()),this.stop()},a.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},a.prototype.getTokens=function(c){return this.lines[c]||this.$tokenizeRow(c)},a.prototype.getState=function(c){return this.currentLine==c&&this.$tokenizeRow(c),this.states[c]||"start"},a.prototype.$tokenizeRow=function(c){var i=this.doc.getLine(c),o=this.states[c-1],n=this.tokenizer.getLineTokens(i,o,c);return this.states[c]+""!=n.state+""?(this.states[c]=n.state,this.lines[c+1]=null,this.currentLine>c+1&&(this.currentLine=c+1)):this.currentLine==c&&(this.currentLine=c+1),this.lines[c]=n.tokens},a.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},a}();E.implement($.prototype,A),x.BackgroundTokenizer=$}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(k,x,H){var E=k("./lib/lang"),A=k("./range").Range,$=function(){function a(c,i,o){o===void 0&&(o="text"),this.setRegexp(c),this.clazz=i,this.type=o,this.docLen=0}return a.prototype.setRegexp=function(c){this.regExp+""!=c+""&&(this.regExp=c,this.cache=[])},a.prototype.update=function(c,i,o,n){if(this.regExp){for(var t=n.firstRow,e=n.lastRow,r={},s=o.$editor&&o.$editor.$search,l=s&&s.$isMultilineSearch(o.$editor.getLastSearchOptions()),h=t;h<=e;h++){var v=this.cache[h];if(v==null||o.getValue().length!=this.docLen){if(l){v=[];var m=s.$multiLineForward(o,this.regExp,h,e);if(m){var g=m.endRow<=e?m.endRow-1:e;g>h&&(h=g),v.push(new A(m.startRow,m.startCol,m.endRow,m.endCol))}v.length>this.MAX_RANGES&&(v=v.slice(0,this.MAX_RANGES))}else v=E.getMatchOffsets(o.getLine(h),this.regExp),v.length>this.MAX_RANGES&&(v=v.slice(0,this.MAX_RANGES)),v=v.map(function(C){return new A(h,C.offset,h,C.offset+C.length)});this.cache[h]=v.length?v:""}if(v.length!==0)for(var d=v.length;d--;){var b=v[d].toScreenRange(o),M=b.toString();r[M]||(r[M]=!0,i.drawSingleLineMarker(c,b,this.clazz,n))}}this.docLen=o.getValue().length}},a}();$.prototype.MAX_RANGES=500,x.SearchHighlight=$}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(k,x,H){var E=function(){function g(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return g.prototype.addSession=function(d){this.$session=d},g.prototype.add=function(d,b,M){if(!this.$fromUndo&&d!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),b===!1||!this.lastDeltas){this.lastDeltas=[];var C=this.$undoStack.length;C>this.$undoDepth-1&&this.$undoStack.splice(0,C-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),d.id=this.$rev=++this.$maxRev}(d.action=="remove"||d.action=="insert")&&(this.$lastDelta=d),this.lastDeltas.push(d)}},g.prototype.addSelection=function(d,b){this.selections.push({value:d,rev:b||this.$rev})},g.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},g.prototype.markIgnored=function(d,b){b==null&&(b=this.$rev+1);for(var M=this.$undoStack,C=M.length;C--;){var S=M[C][0];if(S.id<=d)break;S.id<b&&(S.ignore=!0)}this.lastDeltas=null},g.prototype.getSelection=function(d,b){for(var M=this.selections,C=M.length;C--;){var S=M[C];if(S.rev<d)return b&&(S=M[C+1]),S}},g.prototype.getRevision=function(){return this.$rev},g.prototype.getDeltas=function(d,b){b==null&&(b=this.$rev+1);for(var M=this.$undoStack,C=null,S=0,R=M.length;R--;){var w=M[R][0];if(w.id<b&&!C&&(C=R+1),w.id<=d){S=R+1;break}}return M.slice(S,C)},g.prototype.getChangedRanges=function(d,b){b==null&&(b=this.$rev+1)},g.prototype.getChangedLines=function(d,b){b==null&&(b=this.$rev+1)},g.prototype.undo=function(d,b){this.lastDeltas=null;var M=this.$undoStack;if(A(M,M.length)){d||(d=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var C=M.pop(),S=null;return C&&(S=d.undoChanges(C,b),this.$redoStack.push(C),this.$syncRev()),this.$fromUndo=!1,S}},g.prototype.redo=function(d,b){if(this.lastDeltas=null,d||(d=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var M=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);m(this.$redoStack,M),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(R){R[0].id=++this.$maxRev},this)}var C=this.$redoStack.pop(),S=null;return C&&(S=d.redoChanges(C,b),this.$undoStack.push(C),this.$syncRev()),this.$fromUndo=!1,S},g.prototype.$syncRev=function(){var d=this.$undoStack,b=d[d.length-1],M=b&&b[0].id||0;this.$redoStackBaseRev=M,this.$rev=M},g.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=[]},g.prototype.canUndo=function(){return this.$undoStack.length>0},g.prototype.canRedo=function(){return this.$redoStack.length>0},g.prototype.bookmark=function(d){d==null&&(d=this.$rev),this.mark=d},g.prototype.isAtBookmark=function(){return this.$rev===this.mark},g.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},g.prototype.fromJSON=function(d){this.reset(),this.$undoStack=d.$undoStack,this.$redoStack=d.$redoStack},g.prototype.$prettyPrint=function(d){return d?o(d):o(this.$undoStack)+`
192
+ `},o.prototype.getLine=function(n){return this.$lines[n]||""},o.prototype.getLines=function(n,t){return this.$lines.slice(n,t+1)},o.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},o.prototype.getLength=function(){return this.$lines.length},o.prototype.getTextRange=function(n){return this.getLinesForRange(n).join(this.getNewLineCharacter())},o.prototype.getLinesForRange=function(n){var t;if(n.start.row===n.end.row)t=[this.getLine(n.start.row).substring(n.start.column,n.end.column)];else{t=this.getLines(n.start.row,n.end.row),t[0]=(t[0]||"").substring(n.start.column);var e=t.length-1;n.end.row-n.start.row==e&&(t[e]=t[e].substring(0,n.end.column))}return t},o.prototype.insertLines=function(n,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(n,t)},o.prototype.removeLines=function(n,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(n,t)},o.prototype.insertNewLine=function(n){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(n,["",""])},o.prototype.insert=function(n,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(n,this.$split(t))},o.prototype.insertInLine=function(n,t){var e=this.clippedPos(n.row,n.column),r=this.pos(n.row,n.column+t.length);return this.applyDelta({start:e,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},o.prototype.clippedPos=function(n,t){var e=this.getLength();n===void 0?n=e:n<0?n=0:n>=e&&(n=e-1,t=void 0);var r=this.getLine(n);return t==null&&(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:n,column:t}},o.prototype.clonePos=function(n){return{row:n.row,column:n.column}},o.prototype.pos=function(n,t){return{row:n,column:t}},o.prototype.$clipPosition=function(n){var t=this.getLength();return n.row>=t?(n.row=Math.max(0,t-1),n.column=this.getLine(t-1).length):(n.row=Math.max(0,n.row),n.column=Math.min(Math.max(n.column,0),this.getLine(n.row).length)),n},o.prototype.insertFullLines=function(n,t){n=Math.min(Math.max(n,0),this.getLength());var e=0;n<this.getLength()?(t=t.concat([""]),e=0):(t=[""].concat(t),n--,e=this.$lines[n].length),this.insertMergedLines({row:n,column:e},t)},o.prototype.insertMergedLines=function(n,t){var e=this.clippedPos(n.row,n.column),r={row:e.row+t.length-1,column:(t.length==1?e.column:0)+t[t.length-1].length};return this.applyDelta({start:e,end:r,action:"insert",lines:t}),this.clonePos(r)},o.prototype.remove=function(n){var t=this.clippedPos(n.start.row,n.start.column),e=this.clippedPos(n.end.row,n.end.column);return this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})}),this.clonePos(t)},o.prototype.removeInLine=function(n,t,e){var r=this.clippedPos(n,t),s=this.clippedPos(n,e);return this.applyDelta({start:r,end:s,action:"remove",lines:this.getLinesForRange({start:r,end:s})},!0),this.clonePos(r)},o.prototype.removeFullLines=function(n,t){n=Math.min(Math.max(0,n),this.getLength()-1),t=Math.min(Math.max(0,t),this.getLength()-1);var e=t==this.getLength()-1&&n>0,r=t<this.getLength()-1,s=e?n-1:n,l=e?this.getLine(s).length:0,h=r?t+1:t,v=r?0:this.getLine(h).length,m=new a(s,l,h,v),g=this.$lines.slice(n,t+1);return this.applyDelta({start:m.start,end:m.end,action:"remove",lines:this.getLinesForRange(m)}),g},o.prototype.removeNewLine=function(n){n<this.getLength()-1&&n>=0&&this.applyDelta({start:this.pos(n,this.getLine(n).length),end:this.pos(n+1,0),action:"remove",lines:["",""]})},o.prototype.replace=function(n,t){if(n instanceof a||(n=a.fromPoints(n.start,n.end)),t.length===0&&n.isEmpty())return n.start;if(t==this.getTextRange(n))return n.end;this.remove(n);var e;return t?e=this.insert(n.start,t):e=n.start,e},o.prototype.applyDeltas=function(n){for(var t=0;t<n.length;t++)this.applyDelta(n[t])},o.prototype.revertDeltas=function(n){for(var t=n.length-1;t>=0;t--)this.revertDelta(n[t])},o.prototype.applyDelta=function(n,t){var e=n.action=="insert";(e?n.lines.length<=1&&!n.lines[0]:!a.comparePoints(n.start,n.end))||(e&&n.lines.length>2e4?this.$splitAndapplyLargeDelta(n,2e4):(A(this.$lines,n,t),this._signal("change",n)))},o.prototype.$safeApplyDelta=function(n){var t=this.$lines.length;(n.action=="remove"&&n.start.row<t&&n.end.row<t||n.action=="insert"&&n.start.row<=t)&&this.applyDelta(n)},o.prototype.$splitAndapplyLargeDelta=function(n,t){for(var e=n.lines,r=e.length-t+1,s=n.start.row,l=n.start.column,h=0,v=0;h<r;h=v){v+=t-1;var m=e.slice(h,v);m.push(""),this.applyDelta({start:this.pos(s+h,l),end:this.pos(s+v,l=0),action:n.action,lines:m},!0)}n.lines=e.slice(h),n.start.row=s+h,n.start.column=l,this.applyDelta(n,!0)},o.prototype.revertDelta=function(n){this.$safeApplyDelta({start:this.clonePos(n.start),end:this.clonePos(n.end),action:n.action=="insert"?"remove":"insert",lines:n.lines.slice()})},o.prototype.indexToPosition=function(n,t){for(var e=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,s=t||0,l=e.length;s<l;s++)if(n-=e[s].length+r,n<0)return{row:s,column:n+e[s].length+r};return{row:l-1,column:n+e[l-1].length+r}},o.prototype.positionToIndex=function(n,t){for(var e=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,s=0,l=Math.min(n.row,e.length),h=t||0;h<l;++h)s+=e[h].length+r;return s+n.column},o.prototype.$split=function(n){return n.split(/\r\n|\r|\n/)},o}();i.prototype.$autoNewLine="",i.prototype.$newLineMode="auto",E.implement(i.prototype,$),L.Document=i}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(k,L,H){var E=k("./lib/oop"),A=k("./lib/event_emitter").EventEmitter,$=function(){function a(c,i){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=c;var o=this;this.$worker=function(){if(o.running){for(var n=new Date,t=o.currentLine,e=-1,r=o.doc,s=t;o.lines[t];)t++;var l=r.getLength(),h=0;for(o.running=!1;t<l;){o.$tokenizeRow(t),e=t;do t++;while(o.lines[t]);if(h++,h%5===0&&new Date-n>20){o.running=setTimeout(o.$worker,20);break}}o.currentLine=t,e==-1&&(e=t),s<=e&&o.fireUpdateEvent(s,e)}}}return a.prototype.setTokenizer=function(c){this.tokenizer=c,this.lines=[],this.states=[],this.start(0)},a.prototype.setDocument=function(c){this.doc=c,this.lines=[],this.states=[],this.stop()},a.prototype.fireUpdateEvent=function(c,i){var o={first:c,last:i};this._signal("update",{data:o})},a.prototype.start=function(c){this.currentLine=Math.min(c||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)},a.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},a.prototype.$updateOnChange=function(c){var i=c.start.row,o=c.end.row-i;if(o===0)this.lines[i]=null;else if(c.action=="remove")this.lines.splice(i,o+1,null),this.states.splice(i,o+1,null);else{var n=Array(o+1);n.unshift(i,1),this.lines.splice.apply(this.lines,n),this.states.splice.apply(this.states,n)}this.currentLine=Math.min(i,this.currentLine,this.doc.getLength()),this.stop()},a.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},a.prototype.getTokens=function(c){return this.lines[c]||this.$tokenizeRow(c)},a.prototype.getState=function(c){return this.currentLine==c&&this.$tokenizeRow(c),this.states[c]||"start"},a.prototype.$tokenizeRow=function(c){var i=this.doc.getLine(c),o=this.states[c-1],n=this.tokenizer.getLineTokens(i,o,c);return this.states[c]+""!=n.state+""?(this.states[c]=n.state,this.lines[c+1]=null,this.currentLine>c+1&&(this.currentLine=c+1)):this.currentLine==c&&(this.currentLine=c+1),this.lines[c]=n.tokens},a.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},a}();E.implement($.prototype,A),L.BackgroundTokenizer=$}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(k,L,H){var E=k("./lib/lang"),A=k("./range").Range,$=function(){function a(c,i,o){o===void 0&&(o="text"),this.setRegexp(c),this.clazz=i,this.type=o,this.docLen=0}return a.prototype.setRegexp=function(c){this.regExp+""!=c+""&&(this.regExp=c,this.cache=[])},a.prototype.update=function(c,i,o,n){if(this.regExp){for(var t=n.firstRow,e=n.lastRow,r={},s=o.$editor&&o.$editor.$search,l=s&&s.$isMultilineSearch(o.$editor.getLastSearchOptions()),h=t;h<=e;h++){var v=this.cache[h];if(v==null||o.getValue().length!=this.docLen){if(l){v=[];var m=s.$multiLineForward(o,this.regExp,h,e);if(m){var g=m.endRow<=e?m.endRow-1:e;g>h&&(h=g),v.push(new A(m.startRow,m.startCol,m.endRow,m.endCol))}v.length>this.MAX_RANGES&&(v=v.slice(0,this.MAX_RANGES))}else v=E.getMatchOffsets(o.getLine(h),this.regExp),v.length>this.MAX_RANGES&&(v=v.slice(0,this.MAX_RANGES)),v=v.map(function(C){return new A(h,C.offset,h,C.offset+C.length)});this.cache[h]=v.length?v:""}if(v.length!==0)for(var d=v.length;d--;){var b=v[d].toScreenRange(o),M=b.toString();r[M]||(r[M]=!0,i.drawSingleLineMarker(c,b,this.clazz,n))}}this.docLen=o.getValue().length}},a}();$.prototype.MAX_RANGES=500,L.SearchHighlight=$}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(k,L,H){var E=function(){function g(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return g.prototype.addSession=function(d){this.$session=d},g.prototype.add=function(d,b,M){if(!this.$fromUndo&&d!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),b===!1||!this.lastDeltas){this.lastDeltas=[];var C=this.$undoStack.length;C>this.$undoDepth-1&&this.$undoStack.splice(0,C-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),d.id=this.$rev=++this.$maxRev}(d.action=="remove"||d.action=="insert")&&(this.$lastDelta=d),this.lastDeltas.push(d)}},g.prototype.addSelection=function(d,b){this.selections.push({value:d,rev:b||this.$rev})},g.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},g.prototype.markIgnored=function(d,b){b==null&&(b=this.$rev+1);for(var M=this.$undoStack,C=M.length;C--;){var S=M[C][0];if(S.id<=d)break;S.id<b&&(S.ignore=!0)}this.lastDeltas=null},g.prototype.getSelection=function(d,b){for(var M=this.selections,C=M.length;C--;){var S=M[C];if(S.rev<d)return b&&(S=M[C+1]),S}},g.prototype.getRevision=function(){return this.$rev},g.prototype.getDeltas=function(d,b){b==null&&(b=this.$rev+1);for(var M=this.$undoStack,C=null,S=0,R=M.length;R--;){var w=M[R][0];if(w.id<b&&!C&&(C=R+1),w.id<=d){S=R+1;break}}return M.slice(S,C)},g.prototype.getChangedRanges=function(d,b){b==null&&(b=this.$rev+1)},g.prototype.getChangedLines=function(d,b){b==null&&(b=this.$rev+1)},g.prototype.undo=function(d,b){this.lastDeltas=null;var M=this.$undoStack;if(A(M,M.length)){d||(d=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var C=M.pop(),S=null;return C&&(S=d.undoChanges(C,b),this.$redoStack.push(C),this.$syncRev()),this.$fromUndo=!1,S}},g.prototype.redo=function(d,b){if(this.lastDeltas=null,d||(d=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var M=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);m(this.$redoStack,M),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(R){R[0].id=++this.$maxRev},this)}var C=this.$redoStack.pop(),S=null;return C&&(S=d.redoChanges(C,b),this.$undoStack.push(C),this.$syncRev()),this.$fromUndo=!1,S},g.prototype.$syncRev=function(){var d=this.$undoStack,b=d[d.length-1],M=b&&b[0].id||0;this.$redoStackBaseRev=M,this.$rev=M},g.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=[]},g.prototype.canUndo=function(){return this.$undoStack.length>0},g.prototype.canRedo=function(){return this.$redoStack.length>0},g.prototype.bookmark=function(d){d==null&&(d=this.$rev),this.mark=d},g.prototype.isAtBookmark=function(){return this.$rev===this.mark},g.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},g.prototype.fromJSON=function(d){this.reset(),this.$undoStack=d.$undoStack,this.$redoStack=d.$redoStack},g.prototype.$prettyPrint=function(d){return d?o(d):o(this.$undoStack)+`
193
193
  ---
194
194
  `+o(this.$redoStack)},g}();E.prototype.hasUndo=E.prototype.canUndo,E.prototype.hasRedo=E.prototype.canRedo,E.prototype.isClean=E.prototype.isAtBookmark,E.prototype.markClean=E.prototype.bookmark;function A(g,d){for(var b=d;b--;){var M=g[b];if(M&&!M[0].ignore){for(;b<d-1;){var C=e(g[b],g[b+1]);g[b]=C[0],g[b+1]=C[1],b++}return!0}}}var $=k("./range").Range,a=$.comparePoints;$.comparePoints;function c(g){return{row:g.row,column:g.column}}function i(g){return{start:c(g.start),end:c(g.end),action:g.action,lines:g.lines.slice()}}function o(g){if(g=g||this,Array.isArray(g))return g.map(o).join(`
195
195
  `);var d="";return g.action?(d=g.action=="insert"?"+":"-",d+="["+g.lines+"]"):g.value&&(Array.isArray(g.value)?d=g.value.map(n).join(`
196
- `):d=n(g.value)),g.start&&(d+=n(g)),(g.id||g.rev)&&(d+=" ("+(g.id||g.rev)+")"),d}function n(g){return g.start.row+":"+g.start.column+"=>"+g.end.row+":"+g.end.column}function t(g,d){var b=g.action=="insert",M=d.action=="insert";if(b&&M)if(a(d.start,g.end)>=0)s(d,g,-1);else if(a(d.start,g.start)<=0)s(g,d,1);else return null;else if(b&&!M)if(a(d.start,g.end)>=0)s(d,g,-1);else if(a(d.end,g.start)<=0)s(g,d,-1);else return null;else if(!b&&M)if(a(d.start,g.start)>=0)s(d,g,1);else if(a(d.start,g.start)<=0)s(g,d,1);else return null;else if(!b&&!M)if(a(d.start,g.start)>=0)s(d,g,1);else if(a(d.end,g.start)<=0)s(g,d,-1);else return null;return[d,g]}function e(g,d){for(var b=g.length;b--;)for(var M=0;M<d.length;M++)if(!t(g[b],d[M])){for(;b<g.length;){for(;M--;)t(d[M],g[b]);M=d.length,b++}return[g,d]}return g.selectionBefore=d.selectionBefore=g.selectionAfter=d.selectionAfter=null,[d,g]}function r(g,d){var b=g.action=="insert",M=d.action=="insert";if(b&&M)a(g.start,d.start)<0?s(d,g,1):s(g,d,1);else if(b&&!M)a(g.start,d.end)>=0?s(g,d,-1):(a(g.start,d.start)<=0||s(g,$.fromPoints(d.start,g.start),-1),s(d,g,1));else if(!b&&M)a(d.start,g.end)>=0?s(d,g,-1):(a(d.start,g.start)<=0||s(d,$.fromPoints(g.start,d.start),-1),s(g,d,1));else if(!b&&!M)if(a(d.start,g.end)>=0)s(d,g,-1);else if(a(d.end,g.start)<=0)s(g,d,-1);else{var C,S;return a(g.start,d.start)<0&&(C=g,g=h(g,d.start)),a(g.end,d.end)>0&&(S=h(g,d.end)),l(d.end,g.start,g.end,-1),S&&!C&&(g.lines=S.lines,g.start=S.start,g.end=S.end,S=g),[d,C,S].filter(Boolean)}return[d,g]}function s(g,d,b){l(g.start,d.start,d.end,b),l(g.end,d.start,d.end,b)}function l(g,d,b,M){g.row==(M==1?d:b).row&&(g.column+=M*(b.column-d.column)),g.row+=M*(b.row-d.row)}function h(g,d){var b=g.lines,M=g.end;g.end=c(d);var C=g.end.row-g.start.row,S=b.splice(C,b.length),R=C?d.column:d.column-g.start.column;b.push(S[0].substring(0,R)),S[0]=S[0].substr(R);var w={start:c(d),end:M,lines:S,action:g.action};return w}function v(g,d){d=i(d);for(var b=g.length;b--;){for(var M=g[b],C=0;C<M.length;C++){var S=M[C],R=r(S,d);d=R[0],R.length!=2&&(R[2]?(M.splice(C+1,1,R[1],R[2]),C++):R[1]||(M.splice(C,1),C--))}M.length||g.splice(b,1)}return g}function m(g,d){for(var b=0;b<d.length;b++)for(var M=d[b],C=0;C<M.length;C++)v(g,M[C])}x.UndoManager=E}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(k,x,H){var E=k("../range").Range,A=function(){function $(a,c){this.foldData=a,Array.isArray(c)?this.folds=c:c=this.folds=[c];var i=c[c.length-1];this.range=new E(c[0].start.row,c[0].start.column,i.end.row,i.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(o){o.setFoldLine(this)},this)}return $.prototype.shiftRow=function(a){this.start.row+=a,this.end.row+=a,this.folds.forEach(function(c){c.start.row+=a,c.end.row+=a})},$.prototype.addFold=function(a){if(a.sameRow){if(a.start.row<this.startRow||a.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(a),this.folds.sort(function(c,i){return-c.range.compareEnd(i.start.row,i.start.column)}),this.range.compareEnd(a.start.row,a.start.column)>0?(this.end.row=a.end.row,this.end.column=a.end.column):this.range.compareStart(a.end.row,a.end.column)<0&&(this.start.row=a.start.row,this.start.column=a.start.column)}else if(a.start.row==this.end.row)this.folds.push(a),this.end.row=a.end.row,this.end.column=a.end.column;else if(a.end.row==this.start.row)this.folds.unshift(a),this.start.row=a.start.row,this.start.column=a.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");a.foldLine=this},$.prototype.containsRow=function(a){return a>=this.start.row&&a<=this.end.row},$.prototype.walk=function(a,c,i){var o=0,n=this.folds,t,e,r,s=!0;c==null&&(c=this.end.row,i=this.end.column);for(var l=0;l<n.length;l++){if(t=n[l],e=t.range.compareStart(c,i),e==-1){a(null,c,i,o,s);return}if(r=a(null,t.start.row,t.start.column,o,s),r=!r&&a(t.placeholder,t.start.row,t.start.column,o),r||e===0)return;s=!t.sameRow,o=t.end.column}a(null,c,i,o,s)},$.prototype.getNextFoldTo=function(a,c){for(var i,o,n=0;n<this.folds.length;n++){if(i=this.folds[n],o=i.range.compareEnd(a,c),o==-1)return{fold:i,kind:"after"};if(o===0)return{fold:i,kind:"inside"}}return null},$.prototype.addRemoveChars=function(a,c,i){var o=this.getNextFoldTo(a,c),n,t;if(o){if(n=o.fold,o.kind=="inside"&&n.start.column!=c&&n.start.row!=a)window.console&&window.console.log(a,c,n);else if(n.start.row==a){t=this.folds;var e=t.indexOf(n);for(e===0&&(this.start.column+=i),e;e<t.length;e++){if(n=t[e],n.start.column+=i,!n.sameRow)return;n.end.column+=i}this.end.column+=i}}},$.prototype.split=function(a,c){var i=this.getNextFoldTo(a,c);if(!i||i.kind=="inside")return null;var o=i.fold,n=this.folds,t=this.foldData,e=n.indexOf(o),r=n[e-1];this.end.row=r.end.row,this.end.column=r.end.column,n=n.splice(e,n.length-e);var s=new $(t,n);return t.splice(t.indexOf(this)+1,0,s),s},$.prototype.merge=function(a){for(var c=a.folds,i=0;i<c.length;i++)this.addFold(c[i]);var o=this.foldData;o.splice(o.indexOf(a),1)},$.prototype.toString=function(){var a=[this.range.toString()+": ["];return this.folds.forEach(function(c){a.push(" "+c.toString())}),a.push("]"),a.join(`
197
- `)},$.prototype.idxToPosition=function(a){for(var c=0,i=0;i<this.folds.length;i++){var o=this.folds[i];if(a-=o.start.column-c,a<0)return{row:o.start.row,column:o.start.column+a};if(a-=o.placeholder.length,a<0)return o.start;c=o.end.column}return{row:this.end.row,column:this.end.column+a}},$}();x.FoldLine=A}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(k,x,H){var E=k("./range").Range,A=E.comparePoints,$=function(){function a(){this.ranges=[],this.$bias=1}return a.prototype.pointIndex=function(c,i,o){for(var n=this.ranges,t=o||0;t<n.length;t++){var e=n[t],r=A(c,e.end);if(!(r>0)){var s=A(c,e.start);return r===0?i&&s!==0?-t-2:t:s>0||s===0&&!i?t:-t-1}}return-t-1},a.prototype.add=function(c){var i=!c.isEmpty(),o=this.pointIndex(c.start,i);o<0&&(o=-o-1);var n=this.pointIndex(c.end,i,o);return n<0?n=-n-1:n++,this.ranges.splice(o,n-o,c)},a.prototype.addList=function(c){for(var i=[],o=c.length;o--;)i.push.apply(i,this.add(c[o]));return i},a.prototype.substractPoint=function(c){var i=this.pointIndex(c);if(i>=0)return this.ranges.splice(i,1)},a.prototype.merge=function(){var c=[],i=this.ranges;i=i.sort(function(r,s){return A(r.start,s.start)});for(var o=i[0],n,t=1;t<i.length;t++){n=o,o=i[t];var e=A(n.end,o.start);e<0||e==0&&!n.isEmpty()&&!o.isEmpty()||(A(n.end,o.end)<0&&(n.end.row=o.end.row,n.end.column=o.end.column),i.splice(t,1),c.push(o),o=n,t--)}return this.ranges=i,c},a.prototype.contains=function(c,i){return this.pointIndex({row:c,column:i})>=0},a.prototype.containsPoint=function(c){return this.pointIndex(c)>=0},a.prototype.rangeAtPoint=function(c){var i=this.pointIndex(c);if(i>=0)return this.ranges[i]},a.prototype.clipRows=function(c,i){var o=this.ranges;if(o[0].start.row>i||o[o.length-1].start.row<c)return[];var n=this.pointIndex({row:c,column:0});n<0&&(n=-n-1);var t=this.pointIndex({row:i,column:0},n);t<0&&(t=-t-1);for(var e=[],r=n;r<t;r++)e.push(o[r]);return e},a.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},a.prototype.attach=function(c){this.session&&this.detach(),this.session=c,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},a.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},a.prototype.$onChange=function(c){for(var i=c.start,o=c.end,n=i.row,t=o.row,e=this.ranges,r=0,s=e.length;r<s;r++){var l=e[r];if(l.end.row>=n)break}if(c.action=="insert")for(var h=t-n,v=-i.column+o.column;r<s;r++){var l=e[r];if(l.start.row>n)break;if(l.start.row==n&&l.start.column>=i.column&&(l.start.column==i.column&&this.$bias<=0||(l.start.column+=v,l.start.row+=h)),l.end.row==n&&l.end.column>=i.column){if(l.end.column==i.column&&this.$bias<0)continue;l.end.column==i.column&&v>0&&r<s-1&&l.end.column>l.start.column&&l.end.column==e[r+1].start.column&&(l.end.column-=v),l.end.column+=v,l.end.row+=h}}else for(var h=n-t,v=i.column-o.column;r<s;r++){var l=e[r];if(l.start.row>t)break;l.end.row<t&&(n<l.end.row||n==l.end.row&&i.column<l.end.column)?(l.end.row=n,l.end.column=i.column):l.end.row==t?l.end.column<=o.column?(h||l.end.column>i.column)&&(l.end.column=i.column,l.end.row=i.row):(l.end.column+=v,l.end.row+=h):l.end.row>t&&(l.end.row+=h),l.start.row<t&&(n<l.start.row||n==l.start.row&&i.column<l.start.column)?(l.start.row=n,l.start.column=i.column):l.start.row==t?l.start.column<=o.column?(h||l.start.column>i.column)&&(l.start.column=i.column,l.start.row=i.row):(l.start.column+=v,l.start.row+=h):l.start.row>t&&(l.start.row+=h)}if(h!=0&&r<s)for(;r<s;r++){var l=e[r];l.start.row+=h,l.end.row+=h}},a}();$.prototype.comparePoints=A,x.RangeList=$}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(k,x,H){var E=this&&this.__extends||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(r[l]=s[l])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),A=k("../range_list").RangeList,$=function(n){E(t,n);function t(e,r){var s=n.call(this)||this;return s.foldLine=null,s.placeholder=r,s.range=e,s.start=e.start,s.end=e.end,s.sameRow=e.start.row==e.end.row,s.subFolds=s.ranges=[],s}return t.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},t.prototype.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(r){r.setFoldLine(e)})},t.prototype.clone=function(){var e=this.range.clone(),r=new t(e,this.placeholder);return this.subFolds.forEach(function(s){r.subFolds.push(s.clone())}),r.collapseChildren=this.collapseChildren,r},t.prototype.addSubFold=function(e){if(!this.range.isEqual(e)){c(e,this.start);for(var v=e.start.row,m=e.start.column,r=0,s=-1;r<this.subFolds.length&&(s=this.subFolds[r].range.compare(v,m),s==1);r++);var l=this.subFolds[r],h=0;if(s==0){if(l.range.containsRange(e))return l.addSubFold(e);h=1}for(var v=e.range.end.row,m=e.range.end.column,g=r,s=-1;g<this.subFolds.length&&(s=this.subFolds[g].range.compare(v,m),s==1);g++);s==0&&g++;for(var d=this.subFolds.splice(r,g-r,e),b=s==0?d.length-1:d.length,M=h;M<b;M++)e.addSubFold(d[M]);return e.setFoldLine(this.foldLine),e}},t.prototype.restoreRange=function(e){return o(e,this.start)},t}(A);function a(n,t){n.row-=t.row,n.row==0&&(n.column-=t.column)}function c(n,t){a(n.start,t),a(n.end,t)}function i(n,t){n.row==0&&(n.column+=t.column),n.row+=t.row}function o(n,t){i(n.start,t),i(n.end,t)}x.Fold=$}),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(k,x,H){var E=k("../range").Range,A=k("./fold_line").FoldLine,$=k("./fold").Fold,a=k("../token_iterator").TokenIterator,c=k("../mouse/mouse_event").MouseEvent;function i(){this.getFoldAt=function(o,n,t){var e=this.getFoldLine(o);if(!e)return null;for(var r=e.folds,s=0;s<r.length;s++){var l=r[s].range;if(l.contains(o,n)){if(t==1&&l.isEnd(o,n)&&!l.isEmpty())continue;if(t==-1&&l.isStart(o,n)&&!l.isEmpty())continue;return r[s]}}},this.getFoldsInRange=function(o){var n=o.start,t=o.end,e=this.$foldData,r=[];n.column+=1,t.column-=1;for(var s=0;s<e.length;s++){var l=e[s].range.compareRange(o);if(l!=2){if(l==-2)break;for(var h=e[s].folds,v=0;v<h.length;v++){var m=h[v];if(l=m.range.compareRange(o),l==-2)break;if(l==2)continue;if(l==42)break;r.push(m)}}}return n.column-=1,t.column+=1,r},this.getFoldsInRangeList=function(o){if(Array.isArray(o)){var n=[];o.forEach(function(t){n=n.concat(this.getFoldsInRange(t))},this)}else var n=this.getFoldsInRange(o);return n},this.getAllFolds=function(){for(var o=[],n=this.$foldData,t=0;t<n.length;t++)for(var e=0;e<n[t].folds.length;e++)o.push(n[t].folds[e]);return o},this.getFoldStringAt=function(o,n,t,e){if(e=e||this.getFoldLine(o),!e)return null;for(var r={end:{column:0}},s,l,h=0;h<e.folds.length;h++){l=e.folds[h];var v=l.range.compareEnd(o,n);if(v==-1){s=this.getLine(l.start.row).substring(r.end.column,l.start.column);break}else if(v===0)return null;r=l}return s||(s=this.getLine(l.start.row).substring(r.end.column)),t==-1?s.substring(0,n-r.end.column):t==1?s.substring(n-r.end.column):s},this.getFoldLine=function(o,n){var t=this.$foldData,e=0;for(n&&(e=t.indexOf(n)),e==-1&&(e=0),e;e<t.length;e++){var r=t[e];if(r.start.row<=o&&r.end.row>=o)return r;if(r.end.row>o)return null}return null},this.getNextFoldLine=function(o,n){var t=this.$foldData,e=0;for(n&&(e=t.indexOf(n)),e==-1&&(e=0),e;e<t.length;e++){var r=t[e];if(r.end.row>=o)return r}return null},this.getFoldedRowCount=function(o,n){for(var t=this.$foldData,e=n-o+1,r=0;r<t.length;r++){var s=t[r],l=s.end.row,h=s.start.row;if(l>=n){h<n&&(h>=o?e-=n-h:e=0);break}else l>=o&&(h>=o?e-=l-h:e-=l-o+1)}return e},this.$addFoldLine=function(o){return this.$foldData.push(o),this.$foldData.sort(function(n,t){return n.start.row-t.start.row}),o},this.addFold=function(o,n){var t=this.$foldData,e=!1,r;o instanceof $?r=o:(r=new $(n,o),r.collapseChildren=n.collapseChildren),this.$clipRangeToDocument(r.range);var s=r.start.row,l=r.start.column,h=r.end.row,v=r.end.column,m=this.getFoldAt(s,l,1),g=this.getFoldAt(h,v,-1);if(m&&g==m)return m.addSubFold(r);m&&!m.range.isStart(s,l)&&this.removeFold(m),g&&!g.range.isEnd(h,v)&&this.removeFold(g);var d=this.getFoldsInRange(r.range);d.length>0&&(this.removeFolds(d),r.collapseChildren||d.forEach(function(S){r.addSubFold(S)}));for(var b=0;b<t.length;b++){var M=t[b];if(h==M.start.row){M.addFold(r),e=!0;break}else if(s==M.end.row){if(M.addFold(r),e=!0,!r.sameRow){var C=t[b+1];if(C&&C.start.row==h){M.merge(C);break}}break}else if(h<=M.start.row)break}return e||(M=this.$addFoldLine(new A(this.$foldData,r))),this.$useWrapMode?this.$updateWrapData(M.start.row,M.start.row):this.$updateRowLengthCache(M.start.row,M.start.row),this.$modified=!0,this._signal("changeFold",{data:r,action:"add"}),r},this.addFolds=function(o){o.forEach(function(n){this.addFold(n)},this)},this.removeFold=function(o){var n=o.foldLine,t=n.start.row,e=n.end.row,r=this.$foldData,s=n.folds;if(s.length==1)r.splice(r.indexOf(n),1);else if(n.range.isEnd(o.end.row,o.end.column))s.pop(),n.end.row=s[s.length-1].end.row,n.end.column=s[s.length-1].end.column;else if(n.range.isStart(o.start.row,o.start.column))s.shift(),n.start.row=s[0].start.row,n.start.column=s[0].start.column;else if(o.sameRow)s.splice(s.indexOf(o),1);else{var l=n.split(o.start.row,o.start.column);s=l.folds,s.shift(),l.start.row=s[0].start.row,l.start.column=s[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(t,e):this.$updateRowLengthCache(t,e)),this.$modified=!0,this._signal("changeFold",{data:o,action:"remove"})},this.removeFolds=function(o){for(var n=[],t=0;t<o.length;t++)n.push(o[t]);n.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(o){this.removeFold(o),o.subFolds.forEach(function(n){o.restoreRange(n),this.addFold(n)},this),o.collapseChildren>0&&this.foldAll(o.start.row+1,o.end.row,o.collapseChildren-1),o.subFolds=[]},this.expandFolds=function(o){o.forEach(function(n){this.expandFold(n)},this)},this.unfold=function(o,n){var t,e;if(o==null)t=new E(0,0,this.getLength(),0),n==null&&(n=!0);else if(typeof o=="number")t=new E(o,0,o,this.getLine(o).length);else if("row"in o)t=E.fromPoints(o,o);else{if(Array.isArray(o))return e=[],o.forEach(function(s){e=e.concat(this.unfold(s))},this),e;t=o}e=this.getFoldsInRangeList(t);for(var r=e;e.length==1&&E.comparePoints(e[0].start,t.start)<0&&E.comparePoints(e[0].end,t.end)>0;)this.expandFolds(e),e=this.getFoldsInRangeList(t);if(n!=!1?this.removeFolds(e):this.expandFolds(e),r.length)return r},this.isRowFolded=function(o,n){return!!this.getFoldLine(o,n)},this.getRowFoldEnd=function(o,n){var t=this.getFoldLine(o,n);return t?t.end.row:o},this.getRowFoldStart=function(o,n){var t=this.getFoldLine(o,n);return t?t.start.row:o},this.getFoldDisplayLine=function(o,n,t,e,r){e==null&&(e=o.start.row),r==null&&(r=0),n==null&&(n=o.end.row),t==null&&(t=this.getLine(n).length);var s=this.doc,l="";return o.walk(function(h,v,m,g){if(!(v<e)){if(v==e){if(m<r)return;g=Math.max(r,g)}h!=null?l+=h:l+=s.getLine(v).substring(g,m)}},n,t),l},this.getDisplayLine=function(o,n,t,e){var r=this.getFoldLine(o);if(r)return this.getFoldDisplayLine(r,o,n,t,e);var s;return s=this.doc.getLine(o),s.substring(e||0,n||s.length)},this.$cloneFoldData=function(){var o=[];return o=this.$foldData.map(function(n){var t=n.folds.map(function(e){return e.clone()});return new A(o,t)}),o},this.toggleFold=function(o){var n=this.selection,t=n.getRange(),e,r;if(t.isEmpty()){var s=t.start;if(e=this.getFoldAt(s.row,s.column),e){this.expandFold(e);return}else if(o){var l=this.getFoldLine(s.row);l&&this.expandFolds(l.folds);return}else(r=this.findMatchingBracket(s))?t.comparePoint(r)==1?t.end=r:(t.start=r,t.start.column++,t.end.column--):(r=this.findMatchingBracket({row:s.row,column:s.column+1}))?(t.comparePoint(r)==1?t.end=r:t.start=r,t.start.column++):t=this.getCommentFoldRange(s.row,s.column)||t}else{var h=this.getFoldsInRange(t);if(o&&h.length){this.expandFolds(h);return}else h.length==1&&(e=h[0])}if(e||(e=this.getFoldAt(t.start.row,t.start.column)),e&&e.range.toString()==t.toString()){this.expandFold(e);return}var v="...";if(!t.isMultiLine()){if(v=this.getTextRange(t),v.length<4)return;v=v.trim().substring(0,2)+".."}this.addFold(v,t)},this.getCommentFoldRange=function(o,n,t){var e=new a(this,o,n),r=e.getCurrentToken(),s=r&&r.type;if(r&&/^comment|string/.test(s)){s=s.match(/comment|string/)[0],s=="comment"&&(s+="|doc-start|\\.doc");var l=new RegExp(s),h=new E;if(t!=1){do r=e.stepBackward();while(r&&l.test(r.type));r=e.stepForward()}h.start.row=e.getCurrentTokenRow(),h.start.column=e.getCurrentTokenColumn()+r.value.length,e=new a(this,o,n);var v=this.getState(e.$row);if(t!=-1){var m=-1;do if(r=e.stepForward(),m==-1){var g=this.getState(e.$row);v.toString()!==g.toString()&&(m=e.$row)}else if(e.$row>m)break;while(r&&l.test(r.type));r=e.stepBackward()}else r=e.getCurrentToken();return h.end.row=e.getCurrentTokenRow(),h.end.column=e.getCurrentTokenColumn(),h.start.row==h.end.row&&h.start.column>h.end.column?void 0:h}},this.foldAll=function(o,n,t,e){t==null&&(t=1e5);var r=this.foldWidgets;if(r){n=n||this.getLength(),o=o||0;for(var s=o;s<n;s++)if(r[s]==null&&(r[s]=this.getFoldWidget(s)),r[s]=="start"&&!(e&&!e(s))){var l=this.getFoldWidgetRange(s);l&&l.isMultiLine()&&l.end.row<=n&&l.start.row>=o&&(s=l.end.row,l.collapseChildren=t,this.addFold("...",l))}}},this.foldToLevel=function(o){for(this.foldAll();o-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var o=this;this.foldAll(null,null,null,function(n){for(var t=o.getTokens(n),e=0;e<t.length;e++){var r=t[e];if(!(r.type=="text"&&/^\s+$/.test(r.value)))return!!/comment/.test(r.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(o){if(!this.$foldStyles[o])throw new Error("invalid fold style: "+o+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=o){this.$foldStyle=o,o=="manual"&&this.unfold();var n=this.$foldMode;this.$setFolding(null),this.$setFolding(n)}},this.$setFolding=function(o){if(this.$foldMode!=o){if(this.$foldMode=o,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!o||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=o.getFoldWidget.bind(o,this,this.$foldStyle),this.getFoldWidgetRange=o.getFoldWidgetRange.bind(o,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(o,n){var t=this.foldWidgets;if(!t||n&&t[o])return{};for(var e=o-1,r;e>=0;){var s=t[e];if(s==null&&(s=t[e]=this.getFoldWidget(e)),s=="start"){var l=this.getFoldWidgetRange(e);if(r||(r=l),l&&l.end.row>=o)break}e--}return{range:e!==-1&&l,firstRange:r}},this.onFoldWidgetClick=function(o,n){n instanceof c&&(n=n.domEvent);var t={children:n.shiftKey,all:n.ctrlKey||n.metaKey,siblings:n.altKey},e=this.$toggleFoldWidget(o,t);if(!e){var r=n.target||n.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(o,n){if(this.getFoldWidget){var t=this.getFoldWidget(o),e=this.getLine(o),r=t==="end"?-1:1,s=this.getFoldAt(o,r===-1?0:e.length,r);if(s)return n.children||n.all?this.removeFold(s):this.expandFold(s),s;var l=this.getFoldWidgetRange(o,!0);if(l&&!l.isMultiLine()&&(s=this.getFoldAt(l.start.row,l.start.column,1),s&&l.isEqual(s.range)))return this.removeFold(s),s;if(n.siblings){var h=this.getParentFoldRangeData(o);if(h.range)var v=h.range.start.row+1,m=h.range.end.row;this.foldAll(v,m,n.all?1e4:0)}else n.children?(m=l?l.end.row:this.getLength(),this.foldAll(o+1,m,n.all?1e4:0)):l&&(n.all&&(l.collapseChildren=1e4),this.addFold("...",l));return l}},this.toggleFoldWidget=function(o){var n=this.selection.getCursor().row;n=this.getRowFoldStart(n);var t=this.$toggleFoldWidget(n,{});if(!t){var e=this.getParentFoldRangeData(n,!0);if(t=e.range||e.firstRange,t){n=t.start.row;var r=this.getFoldAt(n,this.getLine(n).length,1);r?this.removeFold(r):this.addFold("...",t)}}},this.updateFoldWidgets=function(o){var n=o.start.row,t=o.end.row-n;if(t===0)this.foldWidgets[n]=null;else if(o.action=="remove")this.foldWidgets.splice(n,t+1,null);else{var e=Array(t+1);e.unshift(n,1),this.foldWidgets.splice.apply(this.foldWidgets,e)}},this.tokenizerUpdateFoldWidgets=function(o){var n=o.data;n.first!=n.last&&this.foldWidgets.length>n.first&&this.foldWidgets.splice(n.first,this.foldWidgets.length)}}x.Folding=i}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(k,x,H){var E=k("../token_iterator").TokenIterator,A=k("../range").Range;function $(){this.findMatchingBracket=function(a,c){if(a.column==0)return null;var i=c||this.getLine(a.row).charAt(a.column-1);if(i=="")return null;var o=i.match(/([\(\[\{])|([\)\]\}])/);return o?o[1]?this.$findClosingBracket(o[1],a):this.$findOpeningBracket(o[2],a):null},this.getBracketRange=function(a){var c=this.getLine(a.row),i=!0,o,n=c.charAt(a.column-1),t=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(t||(n=c.charAt(a.column),a={row:a.row,column:a.column+1},t=n&&n.match(/([\(\[\{])|([\)\]\}])/),i=!1),!t)return null;if(t[1]){var e=this.$findClosingBracket(t[1],a);if(!e)return null;o=A.fromPoints(a,e),i||(o.end.column++,o.start.column--),o.cursor=o.end}else{var e=this.$findOpeningBracket(t[2],a);if(!e)return null;o=A.fromPoints(e,a),i||(o.start.column++,o.end.column--),o.cursor=o.start}return o},this.getMatchingBracketRanges=function(a,c){var i=this.getLine(a.row),o=/([\(\[\{])|([\)\]\}])/,n=!c&&i.charAt(a.column-1),t=n&&n.match(o);if(t||(n=(c===void 0||c)&&i.charAt(a.column),a={row:a.row,column:a.column+1},t=n&&n.match(o)),!t)return null;var e=new A(a.row,a.column-1,a.row,a.column),r=t[1]?this.$findClosingBracket(t[1],a):this.$findOpeningBracket(t[2],a);if(!r)return[e];var s=new A(r.row,r.column,r.row,r.column+1);return[e,s]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(a,c,i){var o=this.$brackets[a],n=1,t=new E(this,c.row,c.column),e=t.getCurrentToken();if(e||(e=t.stepForward()),!!e){i||(i=new RegExp("(\\.?"+e.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var r=c.column-t.getCurrentTokenColumn()-2,s=e.value;;){for(;r>=0;){var l=s.charAt(r);if(l==o){if(n-=1,n==0)return{row:t.getCurrentTokenRow(),column:r+t.getCurrentTokenColumn()}}else l==a&&(n+=1);r-=1}do e=t.stepBackward();while(e&&!i.test(e.type));if(e==null)break;s=e.value,r=s.length-1}return null}},this.$findClosingBracket=function(a,c,i){var o=this.$brackets[a],n=1,t=new E(this,c.row,c.column),e=t.getCurrentToken();if(e||(e=t.stepForward()),!!e){i||(i=new RegExp("(\\.?"+e.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var r=c.column-t.getCurrentTokenColumn();;){for(var s=e.value,l=s.length;r<l;){var h=s.charAt(r);if(h==o){if(n-=1,n==0)return{row:t.getCurrentTokenRow(),column:r+t.getCurrentTokenColumn()}}else h==a&&(n+=1);r+=1}do e=t.stepForward();while(e&&!i.test(e.type));if(e==null)break;r=0}return null}},this.getMatchingTags=function(a){var c=new E(this,a.row,a.column),i=this.$findTagName(c);if(i){var o=c.stepBackward();return o.value==="<"?this.$findClosingTag(c,i):this.$findOpeningTag(c,i)}},this.$findTagName=function(a){var c=a.getCurrentToken(),i=!1,o=!1;if(c&&c.type.indexOf("tag-name")===-1)do o?c=a.stepBackward():c=a.stepForward(),c&&(c.value==="/>"?o=!0:c.type.indexOf("tag-name")!==-1&&(i=!0));while(c&&!i);return c},this.$findClosingTag=function(a,c){var i,o=c.value,n=c.value,t=0,e=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);c=a.stepForward();var r=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+c.value.length),s=!1;do{if(i=c,i.type.indexOf("tag-close")!==-1&&!s){var l=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);s=!0}if(c=a.stepForward(),c){if(c.value===">"&&!s){var l=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);s=!0}if(c.type.indexOf("tag-name")!==-1){if(o=c.value,n===o){if(i.value==="<")t++;else if(i.value==="</"&&(t--,t<0)){a.stepBackward();var h=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+2);c=a.stepForward();var v=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+c.value.length);if(c.type.indexOf("tag-close")===-1&&(c=a.stepForward()),c&&c.value===">")var m=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);else return}}}else if(n===o&&c.value==="/>"&&(t--,t<0))var h=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+2),v=h,m=v,l=new A(r.end.row,r.end.column,r.end.row,r.end.column+1)}}while(c&&t>=0);if(e&&l&&h&&m&&r&&v)return{openTag:new A(e.start.row,e.start.column,l.end.row,l.end.column),closeTag:new A(h.start.row,h.start.column,m.end.row,m.end.column),openTagName:r,closeTagName:v}},this.$findOpeningTag=function(a,c){var i=a.getCurrentToken(),o=c.value,n=0,t=a.getCurrentTokenRow(),e=a.getCurrentTokenColumn(),r=e+2,s=new A(t,e,t,r);a.stepForward();var l=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+c.value.length);if(c.type.indexOf("tag-close")===-1&&(c=a.stepForward()),!(!c||c.value!==">")){var h=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);a.stepBackward(),a.stepBackward();do if(c=i,t=a.getCurrentTokenRow(),e=a.getCurrentTokenColumn(),r=e+c.value.length,i=a.stepBackward(),c){if(c.type.indexOf("tag-name")!==-1){if(o===c.value)if(i.value==="<"){if(n++,n>0){var v=new A(t,e,t,r),m=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);do c=a.stepForward();while(c&&c.value!==">");var g=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1)}}else i.value==="</"&&n--}else if(c.value==="/>"){for(var d=0,b=i;b;){if(b.type.indexOf("tag-name")!==-1&&b.value===o){n--;break}else if(b.value==="<")break;b=a.stepBackward(),d++}for(var M=0;M<d;M++)a.stepForward()}}while(i&&n<=0);if(m&&g&&s&&h&&v&&l)return{openTag:new A(m.start.row,m.start.column,g.end.row,g.end.column),closeTag:new A(s.start.row,s.start.column,h.end.row,h.end.column),openTagName:v,closeTagName:l}}}}x.BracketMatch=$}),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(k,x,H){var E=k("./lib/oop"),A=k("./lib/lang"),$=k("./bidihandler").BidiHandler,a=k("./config"),c=k("./lib/event_emitter").EventEmitter,i=k("./selection").Selection,o=k("./mode/text").Mode,n=k("./range").Range,t=k("./line_widgets").LineWidgets,e=k("./document").Document,r=k("./background_tokenizer").BackgroundTokenizer,s=k("./search_highlight").SearchHighlight,l=k("./undomanager").UndoManager,h=function(){function w(y,f){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"+ ++w.$uid,this.$foldData.toString=function(){return this.join(`
198
- `)},this.$gutterCustomWidgets={},this.bgTokenizer=new r(new o().getTokenizer(),this);var u=this;this.bgTokenizer.on("update",function(p){u._signal("tokenizerUpdate",p)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof y!="object"||!y.getLine)&&(y=new e(y)),this.setDocument(y),this.selection=new i(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new $(this),a.resetOptions(this),this.setMode(f),a._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return w.prototype.$initOperationListeners=function(){var y=this;this.curOp=null,this.on("change",function(){y.curOp||(y.startOperation(),y.curOp.selectionBefore=y.$lastSel),y.curOp.docChanged=!0},!0),this.on("changeSelection",function(){y.curOp||(y.startOperation(),y.curOp.selectionBefore=y.$lastSel),y.curOp.selectionChanged=!0},!0),this.$operationResetTimer=A.delayedCall(this.endOperation.bind(this,!0))},w.prototype.startOperation=function(y){if(this.curOp){if(!y||this.curOp.command)return;this.prevOp=this.curOp}y||(y={}),this.$operationResetTimer.schedule(),this.curOp={command:y.command||{},args:y.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",y)},w.prototype.endOperation=function(y){if(this.curOp){if(y&&y.returnValue===!1){this.curOp=null,this._signal("endOperation",y);return}if(y==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var f=this.selection.toJSON();this.curOp.selectionAfter=f,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(f),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",y)}},w.prototype.setDocument=function(y){this.doc&&this.doc.off("change",this.$onChange),this.doc=y,y.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},w.prototype.getDocument=function(){return this.doc},Object.defineProperty(w.prototype,"widgetManager",{get:function(){var y=new t(this);return this.widgetManager=y,this.$editor&&y.attach(this.$editor),y},set:function(y){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:y})},enumerable:!1,configurable:!0}),w.prototype.$resetRowCache=function(y){if(!y){this.$docRowCache=[],this.$screenRowCache=[];return}var f=this.$docRowCache.length,u=this.$getRowCacheIndex(this.$docRowCache,y)+1;f>u&&(this.$docRowCache.splice(u,f),this.$screenRowCache.splice(u,f))},w.prototype.$getRowCacheIndex=function(y,f){for(var u=0,p=y.length-1;u<=p;){var L=u+p>>1,T=y[L];if(f>T)u=L+1;else if(f<T)p=L-1;else return L}return u-1},w.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},w.prototype.onChangeFold=function(y){var f=y.data;this.$resetRowCache(f.start.row)},w.prototype.onChange=function(y){this.$modified=!0,this.$bidiHandler.onChange(y),this.$resetRowCache(y.start.row);var f=this.$updateInternalDataOnChange(y);!this.$fromUndo&&this.$undoManager&&(f&&f.length&&(this.$undoManager.add({action:"removeFolds",folds:f},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(y,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(y),this._signal("change",y)},w.prototype.onSelectionChange=function(){this._signal("changeSelection")},w.prototype.setValue=function(y){this.doc.setValue(y),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},w.fromJSON=function(y){typeof y=="string"&&(y=JSON.parse(y));var f=new l;f.$undoStack=y.history.undo,f.$redoStack=y.history.redo,f.mark=y.history.mark,f.$rev=y.history.rev;var u=new w(y.value);return y.folds.forEach(function(p){u.addFold("...",n.fromPoints(p.start,p.end))}),u.setAnnotations(y.annotations),u.setBreakpoints(y.breakpoints),u.setMode(y.mode),u.setScrollLeft(y.scrollLeft),u.setScrollTop(y.scrollTop),u.setUndoManager(f),u.selection.fromJSON(y.selection),u},w.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(y){return y.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},w.prototype.toString=function(){return this.doc.getValue()},w.prototype.getSelection=function(){return this.selection},w.prototype.getState=function(y){return this.bgTokenizer.getState(y)},w.prototype.getTokens=function(y){return this.bgTokenizer.getTokens(y)},w.prototype.getTokenAt=function(y,f){var u=this.bgTokenizer.getTokens(y),p,L=0;if(f==null){var T=u.length-1;L=this.getLine(y).length}else for(var T=0;T<u.length&&(L+=u[T].value.length,!(L>=f));T++);return p=u[T],p?(p.index=T,p.start=L-p.value.length,p):null},w.prototype.setUndoManager=function(y){if(this.$undoManager=y,this.$informUndoManager&&this.$informUndoManager.cancel(),y){var f=this;y.addSession(this),this.$syncInformUndoManager=function(){f.$informUndoManager.cancel(),f.mergeUndoDeltas=!1},this.$informUndoManager=A.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},w.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},w.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},w.prototype.getTabString=function(){return this.getUseSoftTabs()?A.stringRepeat(" ",this.getTabSize()):" "},w.prototype.setUseSoftTabs=function(y){this.setOption("useSoftTabs",y)},w.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},w.prototype.setTabSize=function(y){this.setOption("tabSize",y)},w.prototype.getTabSize=function(){return this.$tabSize},w.prototype.isTabStop=function(y){return this.$useSoftTabs&&y.column%this.$tabSize===0},w.prototype.setNavigateWithinSoftTabs=function(y){this.setOption("navigateWithinSoftTabs",y)},w.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},w.prototype.setOverwrite=function(y){this.setOption("overwrite",y)},w.prototype.getOverwrite=function(){return this.$overwrite},w.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},w.prototype.addGutterDecoration=function(y,f){this.$decorations[y]||(this.$decorations[y]=""),this.$decorations[y]+=" "+f,this._signal("changeBreakpoint",{})},w.prototype.removeGutterCustomWidget=function(y){this.$editor&&this.$editor.renderer.$gutterLayer.$removeCustomWidget(y)},w.prototype.addGutterCustomWidget=function(y,f){this.$editor&&this.$editor.renderer.$gutterLayer.$addCustomWidget(y,f)},w.prototype.removeGutterDecoration=function(y,f){this.$decorations[y]=(this.$decorations[y]||"").replace(" "+f,""),this._signal("changeBreakpoint",{})},w.prototype.getBreakpoints=function(){return this.$breakpoints},w.prototype.setBreakpoints=function(y){this.$breakpoints=[];for(var f=0;f<y.length;f++)this.$breakpoints[y[f]]="ace_breakpoint";this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},w.prototype.setBreakpoint=function(y,f){f===void 0&&(f="ace_breakpoint"),f?this.$breakpoints[y]=f:delete this.$breakpoints[y],this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoint=function(y){delete this.$breakpoints[y],this._signal("changeBreakpoint",{})},w.prototype.addMarker=function(y,f,u,p){var L=this.$markerId++,T={range:y,type:u||"line",renderer:typeof u=="function"?u:null,clazz:f,inFront:!!p,id:L};return p?(this.$frontMarkers[L]=T,this._signal("changeFrontMarker")):(this.$backMarkers[L]=T,this._signal("changeBackMarker")),L},w.prototype.addDynamicMarker=function(y,f){if(y.update){var u=this.$markerId++;return y.id=u,y.inFront=!!f,f?(this.$frontMarkers[u]=y,this._signal("changeFrontMarker")):(this.$backMarkers[u]=y,this._signal("changeBackMarker")),y}},w.prototype.removeMarker=function(y){var f=this.$frontMarkers[y]||this.$backMarkers[y];if(f){var u=f.inFront?this.$frontMarkers:this.$backMarkers;delete u[y],this._signal(f.inFront?"changeFrontMarker":"changeBackMarker")}},w.prototype.getMarkers=function(y){return y?this.$frontMarkers:this.$backMarkers},w.prototype.highlight=function(y){if(!this.$searchHighlight){var f=new s(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(f)}this.$searchHighlight.setRegexp(y)},w.prototype.highlightLines=function(y,f,u,p){typeof f!="number"&&(u=f,f=y),u||(u="ace_step");var L=new n(y,0,f,1/0);return L.id=this.addMarker(L,u,"fullLine",p),L},w.prototype.setAnnotations=function(y){this.$annotations=y,this._signal("changeAnnotation",{})},w.prototype.getAnnotations=function(){return this.$annotations||[]},w.prototype.clearAnnotations=function(){this.setAnnotations([])},w.prototype.$detectNewLine=function(y){var f=y.match(/^.*?(\r?\n)/m);f?this.$autoNewLine=f[1]:this.$autoNewLine=`
199
- `},w.prototype.getWordRange=function(y,f){var u=this.getLine(y),p=!1;if(f>0&&(p=!!u.charAt(f-1).match(this.tokenRe)),p||(p=!!u.charAt(f).match(this.tokenRe)),p)var L=this.tokenRe;else if(/^\s+$/.test(u.slice(f-1,f+1)))var L=/\s/;else var L=this.nonTokenRe;var T=f;if(T>0){do T--;while(T>=0&&u.charAt(T).match(L));T++}for(var _=f;_<u.length&&u.charAt(_).match(L);)_++;return new n(y,T,y,_)},w.prototype.getAWordRange=function(y,f){for(var u=this.getWordRange(y,f),p=this.getLine(u.end.row);p.charAt(u.end.column).match(/[ \t]/);)u.end.column+=1;return u},w.prototype.setNewLineMode=function(y){this.doc.setNewLineMode(y)},w.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},w.prototype.setUseWorker=function(y){this.setOption("useWorker",y)},w.prototype.getUseWorker=function(){return this.$useWorker},w.prototype.onReloadTokenizer=function(y){var f=y.data;this.bgTokenizer.start(f.first),this._signal("tokenizerUpdate",y)},w.prototype.setMode=function(y,f){if(y&&typeof y=="object"){if(y.getTokenizer)return this.$onChangeMode(y);var u=y,p=u.path}else p=y||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new o),this.$modes[p]&&!u){this.$onChangeMode(this.$modes[p]),f&&f();return}this.$modeId=p,a.loadModule(["mode",p],(function(L){if(!this.destroyed){if(this.$modeId!==p)return f&&f();this.$modes[p]&&!u?this.$onChangeMode(this.$modes[p]):L&&L.Mode&&(L=new L.Mode(u),u||(this.$modes[p]=L,L.$id=p),this.$onChangeMode(L)),f&&f()}}).bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},w.prototype.$onChangeMode=function(y,f){if(f||(this.$modeId=y.$id),this.$mode!==y){var u=this.$mode;this.$mode=y,this.$stopWorker(),this.$useWorker&&this.$startWorker();var p=y.getTokenizer();if(p.on!==void 0){var L=this.onReloadTokenizer.bind(this);p.on("update",L)}this.bgTokenizer.setTokenizer(p),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=y.tokenRe,this.nonTokenRe=y.nonTokenRe,f||(y.attachToSession&&y.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(y.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:u,mode:y}))}},w.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},w.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(y){a.warn("Could not load worker",y),this.$worker=null}},w.prototype.getMode=function(){return this.$mode},w.prototype.setScrollTop=function(y){this.$scrollTop===y||isNaN(y)||(this.$scrollTop=y,this._signal("changeScrollTop",y))},w.prototype.getScrollTop=function(){return this.$scrollTop},w.prototype.setScrollLeft=function(y){this.$scrollLeft===y||isNaN(y)||(this.$scrollLeft=y,this._signal("changeScrollLeft",y))},w.prototype.getScrollLeft=function(){return this.$scrollLeft},w.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},w.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var y=0;return this.lineWidgets.forEach(function(f){f&&f.screenWidth>y&&(y=f.screenWidth)}),this.lineWidgetWidth=y},w.prototype.$computeWidth=function(y){if(this.$modified||y){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var f=this.doc.getAllLines(),u=this.$rowLengthCache,p=0,L=0,T=this.$foldData[L],_=T?T.start.row:1/0,I=f.length,O=0;O<I;O++){if(O>_){if(O=T.end.row+1,O>=I)break;T=this.$foldData[L++],_=T?T.start.row:1/0}u[O]==null&&(u[O]=this.$getStringScreenWidth(f[O])[0]),u[O]>p&&(p=u[O])}this.screenWidth=p}},w.prototype.getLine=function(y){return this.doc.getLine(y)},w.prototype.getLines=function(y,f){return this.doc.getLines(y,f)},w.prototype.getLength=function(){return this.doc.getLength()},w.prototype.getTextRange=function(y){return this.doc.getTextRange(y||this.selection.getRange())},w.prototype.insert=function(y,f){return this.doc.insert(y,f)},w.prototype.remove=function(y){return this.doc.remove(y)},w.prototype.removeFullLines=function(y,f){return this.doc.removeFullLines(y,f)},w.prototype.undoChanges=function(y,f){if(y.length){this.$fromUndo=!0;for(var u=y.length-1;u!=-1;u--){var p=y[u];p.action=="insert"||p.action=="remove"?this.doc.revertDelta(p):p.folds&&this.addFolds(p.folds)}!f&&this.$undoSelect&&(y.selectionBefore?this.selection.fromJSON(y.selectionBefore):this.selection.setRange(this.$getUndoSelection(y,!0))),this.$fromUndo=!1}},w.prototype.redoChanges=function(y,f){if(y.length){this.$fromUndo=!0;for(var u=0;u<y.length;u++){var p=y[u];(p.action=="insert"||p.action=="remove")&&this.doc.$safeApplyDelta(p)}!f&&this.$undoSelect&&(y.selectionAfter?this.selection.fromJSON(y.selectionAfter):this.selection.setRange(this.$getUndoSelection(y,!1))),this.$fromUndo=!1}},w.prototype.setUndoSelect=function(y){this.$undoSelect=y},w.prototype.$getUndoSelection=function(y,f){function u(I){return f?I.action!=="insert":I.action==="insert"}for(var p,L,T=0;T<y.length;T++){var _=y[T];if(_.start){if(!p){u(_)?p=n.fromPoints(_.start,_.end):p=n.fromPoints(_.start,_.start);continue}u(_)?(L=_.start,p.compare(L.row,L.column)==-1&&p.setStart(L),L=_.end,p.compare(L.row,L.column)==1&&p.setEnd(L)):(L=_.start,p.compare(L.row,L.column)==-1&&(p=n.fromPoints(_.start,_.start)))}}return p},w.prototype.replace=function(y,f){return this.doc.replace(y,f)},w.prototype.moveText=function(y,f,u){var p=this.getTextRange(y),L=this.getFoldsInRange(y),T=n.fromPoints(f,f);if(!u){this.remove(y);var _=y.start.row-y.end.row,I=_?-y.end.column:y.start.column-y.end.column;I&&(T.start.row==y.end.row&&T.start.column>y.end.column&&(T.start.column+=I),T.end.row==y.end.row&&T.end.column>y.end.column&&(T.end.column+=I)),_&&T.start.row>=y.end.row&&(T.start.row+=_,T.end.row+=_)}if(T.end=this.insert(T.start,p),L.length){var O=y.start,z=T.start,_=z.row-O.row,I=z.column-O.column;this.addFolds(L.map(function(F){return F=F.clone(),F.start.row==O.row&&(F.start.column+=I),F.end.row==O.row&&(F.end.column+=I),F.start.row+=_,F.end.row+=_,F}))}return T},w.prototype.indentRows=function(y,f,u){u=u.replace(/\t/g,this.getTabString());for(var p=y;p<=f;p++)this.doc.insertInLine({row:p,column:0},u)},w.prototype.outdentRows=function(y){for(var f=y.collapseRows(),u=new n(0,0,0,0),p=this.getTabSize(),L=f.start.row;L<=f.end.row;++L){var T=this.getLine(L);u.start.row=L,u.end.row=L;for(var _=0;_<p&&T.charAt(_)==" ";++_);_<p&&T.charAt(_)==" "?(u.start.column=_,u.end.column=_+1):(u.start.column=0,u.end.column=_),this.remove(u)}},w.prototype.$moveLines=function(y,f,u){if(y=this.getRowFoldStart(y),f=this.getRowFoldEnd(f),u<0){var p=this.getRowFoldStart(y+u);if(p<0)return 0;var L=p-y}else if(u>0){var p=this.getRowFoldEnd(f+u);if(p>this.doc.getLength()-1)return 0;var L=p-f}else{y=this.$clipRowToDocument(y),f=this.$clipRowToDocument(f);var L=f-y+1}var T=new n(y,0,f,Number.MAX_VALUE),_=this.getFoldsInRange(T).map(function(O){return O=O.clone(),O.start.row+=L,O.end.row+=L,O}),I=u==0?this.doc.getLines(y,f):this.doc.removeFullLines(y,f);return this.doc.insertFullLines(y+L,I),_.length&&this.addFolds(_),L},w.prototype.moveLinesUp=function(y,f){return this.$moveLines(y,f,-1)},w.prototype.moveLinesDown=function(y,f){return this.$moveLines(y,f,1)},w.prototype.duplicateLines=function(y,f){return this.$moveLines(y,f,0)},w.prototype.$clipRowToDocument=function(y){return Math.max(0,Math.min(y,this.doc.getLength()-1))},w.prototype.$clipColumnToRow=function(y,f){return f<0?0:Math.min(this.doc.getLine(y).length,f)},w.prototype.$clipPositionToDocument=function(y,f){if(f=Math.max(0,f),y<0)y=0,f=0;else{var u=this.doc.getLength();y>=u?(y=u-1,f=this.doc.getLine(u-1).length):f=Math.min(this.doc.getLine(y).length,f)}return{row:y,column:f}},w.prototype.$clipRangeToDocument=function(y){y.start.row<0?(y.start.row=0,y.start.column=0):y.start.column=this.$clipColumnToRow(y.start.row,y.start.column);var f=this.doc.getLength()-1;return y.end.row>f?(y.end.row=f,y.end.column=this.doc.getLine(f).length):y.end.column=this.$clipColumnToRow(y.end.row,y.end.column),y},w.prototype.setUseWrapMode=function(y){if(y!=this.$useWrapMode){if(this.$useWrapMode=y,this.$modified=!0,this.$resetRowCache(0),y){var f=this.getLength();this.$wrapData=Array(f),this.$updateWrapData(0,f-1)}this._signal("changeWrapMode")}},w.prototype.getUseWrapMode=function(){return this.$useWrapMode},w.prototype.setWrapLimitRange=function(y,f){(this.$wrapLimitRange.min!==y||this.$wrapLimitRange.max!==f)&&(this.$wrapLimitRange={min:y,max:f},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},w.prototype.adjustWrapLimit=function(y,f){var u=this.$wrapLimitRange;u.max<0&&(u={min:f,max:f});var p=this.$constrainWrapLimit(y,u.min,u.max);return p!=this.$wrapLimit&&p>1?(this.$wrapLimit=p,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},w.prototype.$constrainWrapLimit=function(y,f,u){return f&&(y=Math.max(f,y)),u&&(y=Math.min(u,y)),y},w.prototype.getWrapLimit=function(){return this.$wrapLimit},w.prototype.setWrapLimit=function(y){this.setWrapLimitRange(y,y)},w.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},w.prototype.$updateInternalDataOnChange=function(y){var f=this.$useWrapMode,u=y.action,p=y.start,L=y.end,T=p.row,_=L.row,I=_-T,O=null;if(this.$updating=!0,I!=0)if(u==="remove"){this[f?"$wrapData":"$rowLengthCache"].splice(T,I);var z=this.$foldData;O=this.getFoldsInRange(y),this.removeFolds(O);var D=this.getFoldLine(L.row),N=0;if(D){D.addRemoveChars(L.row,L.column,p.column-L.column),D.shiftRow(-I);var F=this.getFoldLine(T);F&&F!==D&&(F.merge(D),D=F),N=z.indexOf(D)+1}for(N;N<z.length;N++){var D=z[N];D.start.row>=L.row&&D.shiftRow(-I)}_=T}else{var B=Array(I);B.unshift(T,0);var P=f?this.$wrapData:this.$rowLengthCache;P.splice.apply(P,B);var z=this.$foldData,D=this.getFoldLine(T),N=0;if(D){var V=D.range.compareInside(p.row,p.column);V==0?(D=D.split(p.row,p.column),D&&(D.shiftRow(I),D.addRemoveChars(_,0,L.column-p.column))):V==-1&&(D.addRemoveChars(T,0,L.column-p.column),D.shiftRow(I)),N=z.indexOf(D)+1}for(N;N<z.length;N++){var D=z[N];D.start.row>=T&&D.shiftRow(I)}}else{I=Math.abs(y.start.column-y.end.column),u==="remove"&&(O=this.getFoldsInRange(y),this.removeFolds(O),I=-I);var D=this.getFoldLine(T);D&&D.addRemoveChars(T,p.column,I)}return f&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,f?this.$updateWrapData(T,_):this.$updateRowLengthCache(T,_),O},w.prototype.$updateRowLengthCache=function(y,f){this.$rowLengthCache[y]=null,this.$rowLengthCache[f]=null},w.prototype.$updateWrapData=function(y,f){var u=this.doc.getAllLines(),p=this.getTabSize(),L=this.$wrapData,T=this.$wrapLimit,_,I,O=y;for(f=Math.min(f,u.length-1);O<=f;)I=this.getFoldLine(O,I),I?(_=[],I.walk((function(z,D,N,F){var B;if(z!=null){B=this.$getDisplayTokens(z,_.length),B[0]=g;for(var P=1;P<B.length;P++)B[P]=d}else B=this.$getDisplayTokens(u[D].substring(F,N),_.length);_=_.concat(B)}).bind(this),I.end.row,u[I.end.row].length+1),L[I.start.row]=this.$computeWrapSplits(_,T,p),O=I.end.row+1):(_=this.$getDisplayTokens(u[O]),L[O]=this.$computeWrapSplits(_,T,p),O++)},w.prototype.$computeWrapSplits=function(y,f,u){if(y.length==0)return[];var p=[],L=y.length,T=0,_=0,I=this.$wrapAsCode,O=this.$indentedSoftWrap,z=f<=Math.max(2*u,8)||O===!1?0:Math.floor(f/2);function D(){var V=0;if(z===0)return V;if(O)for(var G=0;G<y.length;G++){var j=y[G];if(j==M)V+=1;else if(j==C)V+=u;else{if(j==S)continue;break}}return I&&O!==!1&&(V+=u),Math.min(V,z)}function N(V){for(var G=V-T,j=T;j<V;j++){var K=y[j];(K===12||K===2)&&(G-=1)}p.length||(F=D(),p.indent=F),_+=G,p.push(_),T=V}for(var F=0;L-T>f-F;){var B=T+f-F;if(y[B-1]>=M&&y[B]>=M){N(B);continue}if(y[B]==g||y[B]==d){for(B;B!=T-1&&y[B]!=g;B--);if(B>T){N(B);continue}for(B=T+f,B;B<y.length&&y[B]==d;B++);if(B==y.length)break;N(B);continue}for(var P=Math.max(B-(f-(f>>2)),T-1);B>P&&y[B]<g;)B--;if(I){for(;B>P&&y[B]<g;)B--;for(;B>P&&y[B]==b;)B--}else for(;B>P&&y[B]<M;)B--;if(B>P){N(++B);continue}B=T+f,y[B]==m&&B--,N(B-F)}return p},w.prototype.$getDisplayTokens=function(y,f){var u=[],p;f=f||0;for(var L=0;L<y.length;L++){var T=y.charCodeAt(L);if(T==9){p=this.getScreenTabSize(u.length+f),u.push(C);for(var _=1;_<p;_++)u.push(S)}else T==32?u.push(M):T>39&&T<48||T>57&&T<64?u.push(b):T>=4352&&R(T)?u.push(v,m):u.push(v)}return u},w.prototype.$getStringScreenWidth=function(y,f,u){if(f==0)return[0,0];f==null&&(f=1/0),u=u||0;var p,L;for(L=0;L<y.length&&(p=y.charCodeAt(L),p==9?u+=this.getScreenTabSize(u):p>=4352&&R(p)?u+=2:u+=1,!(u>f));L++);return[u,L]},w.prototype.getRowLength=function(y){var f=1;return this.lineWidgets&&(f+=this.lineWidgets[y]&&this.lineWidgets[y].rowCount||0),!this.$useWrapMode||!this.$wrapData[y]?f:this.$wrapData[y].length+f},w.prototype.getRowLineCount=function(y){return!this.$useWrapMode||!this.$wrapData[y]?1:this.$wrapData[y].length+1},w.prototype.getRowWrapIndent=function(y){if(this.$useWrapMode){var f=this.screenToDocumentPosition(y,Number.MAX_VALUE),u=this.$wrapData[f.row];return u.length&&u[0]<f.column?u.indent:0}else return 0},w.prototype.getScreenLastRowColumn=function(y){var f=this.screenToDocumentPosition(y,Number.MAX_VALUE);return this.documentToScreenColumn(f.row,f.column)},w.prototype.getDocumentLastRowColumn=function(y,f){var u=this.documentToScreenRow(y,f);return this.getScreenLastRowColumn(u)},w.prototype.getDocumentLastRowColumnPosition=function(y,f){var u=this.documentToScreenRow(y,f);return this.screenToDocumentPosition(u,Number.MAX_VALUE/10)},w.prototype.getRowSplitData=function(y){if(this.$useWrapMode)return this.$wrapData[y]},w.prototype.getScreenTabSize=function(y){return this.$tabSize-(y%this.$tabSize|0)},w.prototype.screenToDocumentRow=function(y,f){return this.screenToDocumentPosition(y,f).row},w.prototype.screenToDocumentColumn=function(y,f){return this.screenToDocumentPosition(y,f).column},w.prototype.screenToDocumentPosition=function(y,f,u){if(y<0)return{row:0,column:0};var p,L=0,T=0,_,I=0,O=0,z=this.$screenRowCache,D=this.$getRowCacheIndex(z,y),N=z.length;if(N&&D>=0)var I=z[D],L=this.$docRowCache[D],F=y>z[N-1];else var F=!N;for(var B=this.getLength()-1,P=this.getNextFoldLine(L),V=P?P.start.row:1/0;I<=y&&(O=this.getRowLength(L),!(I+O>y||L>=B));)I+=O,L++,L>V&&(L=P.end.row+1,P=this.getNextFoldLine(L,P),V=P?P.start.row:1/0),F&&(this.$docRowCache.push(L),this.$screenRowCache.push(I));if(P&&P.start.row<=L)p=this.getFoldDisplayLine(P),L=P.start.row;else{if(I+O<=y||L>B)return{row:B,column:this.getLine(B).length};p=this.getLine(L),P=null}var G=0,j=Math.floor(y-I);if(this.$useWrapMode){var K=this.$wrapData[L];K&&(_=K[j],j>0&&K.length&&(G=K.indent,T=K[j-1]||K[K.length-1],p=p.substring(T)))}return u!==void 0&&this.$bidiHandler.isBidiRow(I+j,L,j)&&(f=this.$bidiHandler.offsetToCol(u)),T+=this.$getStringScreenWidth(p,f-G)[1],this.$useWrapMode&&T>=_&&(T=_-1),P?P.idxToPosition(T):{row:L,column:T}},w.prototype.documentToScreenPosition=function(y,f){if(typeof f>"u")var u=this.$clipPositionToDocument(y.row,y.column);else u=this.$clipPositionToDocument(y,f);y=u.row,f=u.column;var p=0,L=null,T=null;T=this.getFoldAt(y,f,1),T&&(y=T.start.row,f=T.start.column);var _,I=0,O=this.$docRowCache,z=this.$getRowCacheIndex(O,y),D=O.length;if(D&&z>=0)var I=O[z],p=this.$screenRowCache[z],N=y>O[D-1];else var N=!D;for(var F=this.getNextFoldLine(I),B=F?F.start.row:1/0;I<y;){if(I>=B){if(_=F.end.row+1,_>y)break;F=this.getNextFoldLine(_,F),B=F?F.start.row:1/0}else _=I+1;p+=this.getRowLength(I),I=_,N&&(this.$docRowCache.push(I),this.$screenRowCache.push(p))}var P="";F&&I>=B?(P=this.getFoldDisplayLine(F,y,f),L=F.start.row):(P=this.getLine(y).substring(0,f),L=y);var V=0;if(this.$useWrapMode){var G=this.$wrapData[L];if(G){for(var j=0;P.length>=G[j];)p++,j++;P=P.substring(G[j-1]||0,P.length),V=j>0?G.indent:0}}return this.lineWidgets&&this.lineWidgets[I]&&this.lineWidgets[I].rowsAbove&&(p+=this.lineWidgets[I].rowsAbove),{row:p,column:V+this.$getStringScreenWidth(P)[0]}},w.prototype.documentToScreenColumn=function(y,f){return this.documentToScreenPosition(y,f).column},w.prototype.documentToScreenRow=function(y,f){return this.documentToScreenPosition(y,f).row},w.prototype.getScreenLength=function(){var y=0,f=null;if(this.$useWrapMode)for(var L=this.$wrapData.length,T=0,p=0,f=this.$foldData[p++],_=f?f.start.row:1/0;T<L;){var I=this.$wrapData[T];y+=I?I.length+1:1,T++,T>_&&(T=f.end.row+1,f=this.$foldData[p++],_=f?f.start.row:1/0)}else{y=this.getLength();for(var u=this.$foldData,p=0;p<u.length;p++)f=u[p],y-=f.end.row-f.start.row}return this.lineWidgets&&(y+=this.$getWidgetScreenLength()),y},w.prototype.$setFontMetrics=function(y){this.$enableVarChar&&(this.$getStringScreenWidth=function(f,u,p){if(u===0)return[0,0];u||(u=1/0),p=p||0;var L,T;for(T=0;T<f.length&&(L=f.charAt(T),L===" "?p+=this.getScreenTabSize(p):p+=y.getCharacterWidth(L),!(p>u));T++);return[p,T]})},w.prototype.getPrecedingCharacter=function(){var y=this.selection.getCursor();if(y.column===0)return y.row===0?"":this.doc.getNewLineCharacter();var f=this.getLine(y.row);return f[y.column-1]},w.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()},w}();h.$uid=0,h.prototype.$modes=a.$modes,h.prototype.getValue=h.prototype.toString,h.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},h.prototype.$overwrite=!1,h.prototype.$mode=null,h.prototype.$modeId=null,h.prototype.$scrollTop=0,h.prototype.$scrollLeft=0,h.prototype.$wrapLimit=80,h.prototype.$useWrapMode=!1,h.prototype.$wrapLimitRange={min:null,max:null},h.prototype.lineWidgets=null,h.prototype.isFullWidth=R,E.implement(h.prototype,c);var v=1,m=2,g=3,d=4,b=9,M=10,C=11,S=12;function R(w){return w<4352?!1:w>=4352&&w<=4447||w>=4515&&w<=4519||w>=4602&&w<=4607||w>=9001&&w<=9002||w>=11904&&w<=11929||w>=11931&&w<=12019||w>=12032&&w<=12245||w>=12272&&w<=12283||w>=12288&&w<=12350||w>=12353&&w<=12438||w>=12441&&w<=12543||w>=12549&&w<=12589||w>=12593&&w<=12686||w>=12688&&w<=12730||w>=12736&&w<=12771||w>=12784&&w<=12830||w>=12832&&w<=12871||w>=12880&&w<=13054||w>=13056&&w<=19903||w>=19968&&w<=42124||w>=42128&&w<=42182||w>=43360&&w<=43388||w>=44032&&w<=55203||w>=55216&&w<=55238||w>=55243&&w<=55291||w>=63744&&w<=64255||w>=65040&&w<=65049||w>=65072&&w<=65106||w>=65108&&w<=65126||w>=65128&&w<=65131||w>=65281&&w<=65376||w>=65504&&w<=65510}k("./edit_session/folding").Folding.call(h.prototype),k("./edit_session/bracket_match").BracketMatch.call(h.prototype),a.defineOptions(h.prototype,"session",{wrap:{set:function(w){if(!w||w=="off"?w=!1:w=="free"?w=!0:w=="printMargin"?w=-1:typeof w=="string"&&(w=parseInt(w,10)||!1),this.$wrap!=w)if(this.$wrap=w,!w)this.setUseWrapMode(!1);else{var y=typeof w=="number"?w:null;this.setWrapLimitRange(y,y),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(w){w=w=="auto"?this.$mode.type!="text":w!="text",w!=this.$wrapAsCode&&(this.$wrapAsCode=w,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(w){this.$useWorker=w,this.$stopWorker(),w&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(w){w=parseInt(w),w>0&&this.$tabSize!==w&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=w,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(w){this.setFoldStyle(w)},handlesSet:!0},overwrite:{set:function(w){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(w){this.doc.setNewLineMode(w)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(w){this.setMode(w)},get:function(){return this.$modeId},handlesSet:!0}}),x.EditSession=h}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(k,x,H){var E=k("./lib/lang"),A=k("./lib/oop"),$=k("./range").Range,a=function(){function n(){this.$options={}}return n.prototype.set=function(t){return A.mixin(this.$options,t),this},n.prototype.getOptions=function(){return E.copyObject(this.$options)},n.prototype.setOptions=function(t){this.$options=t},n.prototype.find=function(t){var e=this.$options,r=this.$matchIterator(t,e);if(!r)return!1;var s=null;return r.forEach(function(l,h,v,m){return s=new $(l,h,v,m),h==m&&e.start&&e.start.start&&e.skipCurrent!=!1&&s.isEqual(e.start)?(s=null,!1):!0}),s},n.prototype.findAll=function(t){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var r=e.range,s=r?t.getLines(r.start.row,r.end.row):t.doc.getAllLines(),l=[],h=e.re;if(e.$isMultiLine){var v=h.length,m=s.length-v,g;e:for(var d=h.offset||0;d<=m;d++){for(var b=0;b<v;b++)if(s[d+b].search(h[b])==-1)continue e;var M=s[d],C=s[d+v-1],S=M.length-M.match(h[0])[0].length,R=C.match(h[v-1])[0].length;g&&g.end.row===d&&g.end.column>S||(l.push(g=new $(d,S,d+v-1,R)),v>2&&(d=d+v-2))}}else for(var w,y=0;y<s.length;y++)if(this.$isMultilineSearch(e)){var f=s.length-1;if(w=this.$multiLineForward(t,h,y,f),w){var u=w.endRow<=f?w.endRow-1:f;u>y&&(y=u),l.push(new $(w.startRow,w.startCol,w.endRow,w.endCol))}}else{w=E.getMatchOffsets(s[y],h);for(var b=0;b<w.length;b++){var p=w[b];l.push(new $(y,p.offset,y,p.offset+p.length))}}if(r){for(var L=r.start.column,T=r.end.column,y=0,b=l.length-1;y<b&&l[y].start.column<L&&l[y].start.row==0;)y++;for(var _=r.end.row-r.start.row;y<b&&l[b].end.column>T&&l[b].end.row==_;)b--;for(l=l.slice(y,b+1),y=0,b=l.length;y<b;y++)l[y].start.row+=r.start.row,l[y].end.row+=r.start.row}return l},n.prototype.parseReplaceString=function(t){for(var e={DollarSign:36,Ampersand:38,Digit0:48,Digit1:49,Digit9:57,Backslash:92,n:110,t:116},r="",s=0,l=t.length;s<l;s++){var h=t.charCodeAt(s);if(h===e.Backslash){if(s++,s>=l){r+="\\";break}var v=t.charCodeAt(s);switch(v){case e.Backslash:r+="\\";break;case e.n:r+=`
196
+ `):d=n(g.value)),g.start&&(d+=n(g)),(g.id||g.rev)&&(d+=" ("+(g.id||g.rev)+")"),d}function n(g){return g.start.row+":"+g.start.column+"=>"+g.end.row+":"+g.end.column}function t(g,d){var b=g.action=="insert",M=d.action=="insert";if(b&&M)if(a(d.start,g.end)>=0)s(d,g,-1);else if(a(d.start,g.start)<=0)s(g,d,1);else return null;else if(b&&!M)if(a(d.start,g.end)>=0)s(d,g,-1);else if(a(d.end,g.start)<=0)s(g,d,-1);else return null;else if(!b&&M)if(a(d.start,g.start)>=0)s(d,g,1);else if(a(d.start,g.start)<=0)s(g,d,1);else return null;else if(!b&&!M)if(a(d.start,g.start)>=0)s(d,g,1);else if(a(d.end,g.start)<=0)s(g,d,-1);else return null;return[d,g]}function e(g,d){for(var b=g.length;b--;)for(var M=0;M<d.length;M++)if(!t(g[b],d[M])){for(;b<g.length;){for(;M--;)t(d[M],g[b]);M=d.length,b++}return[g,d]}return g.selectionBefore=d.selectionBefore=g.selectionAfter=d.selectionAfter=null,[d,g]}function r(g,d){var b=g.action=="insert",M=d.action=="insert";if(b&&M)a(g.start,d.start)<0?s(d,g,1):s(g,d,1);else if(b&&!M)a(g.start,d.end)>=0?s(g,d,-1):(a(g.start,d.start)<=0||s(g,$.fromPoints(d.start,g.start),-1),s(d,g,1));else if(!b&&M)a(d.start,g.end)>=0?s(d,g,-1):(a(d.start,g.start)<=0||s(d,$.fromPoints(g.start,d.start),-1),s(g,d,1));else if(!b&&!M)if(a(d.start,g.end)>=0)s(d,g,-1);else if(a(d.end,g.start)<=0)s(g,d,-1);else{var C,S;return a(g.start,d.start)<0&&(C=g,g=h(g,d.start)),a(g.end,d.end)>0&&(S=h(g,d.end)),l(d.end,g.start,g.end,-1),S&&!C&&(g.lines=S.lines,g.start=S.start,g.end=S.end,S=g),[d,C,S].filter(Boolean)}return[d,g]}function s(g,d,b){l(g.start,d.start,d.end,b),l(g.end,d.start,d.end,b)}function l(g,d,b,M){g.row==(M==1?d:b).row&&(g.column+=M*(b.column-d.column)),g.row+=M*(b.row-d.row)}function h(g,d){var b=g.lines,M=g.end;g.end=c(d);var C=g.end.row-g.start.row,S=b.splice(C,b.length),R=C?d.column:d.column-g.start.column;b.push(S[0].substring(0,R)),S[0]=S[0].substr(R);var w={start:c(d),end:M,lines:S,action:g.action};return w}function v(g,d){d=i(d);for(var b=g.length;b--;){for(var M=g[b],C=0;C<M.length;C++){var S=M[C],R=r(S,d);d=R[0],R.length!=2&&(R[2]?(M.splice(C+1,1,R[1],R[2]),C++):R[1]||(M.splice(C,1),C--))}M.length||g.splice(b,1)}return g}function m(g,d){for(var b=0;b<d.length;b++)for(var M=d[b],C=0;C<M.length;C++)v(g,M[C])}L.UndoManager=E}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(k,L,H){var E=k("../range").Range,A=function(){function $(a,c){this.foldData=a,Array.isArray(c)?this.folds=c:c=this.folds=[c];var i=c[c.length-1];this.range=new E(c[0].start.row,c[0].start.column,i.end.row,i.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(o){o.setFoldLine(this)},this)}return $.prototype.shiftRow=function(a){this.start.row+=a,this.end.row+=a,this.folds.forEach(function(c){c.start.row+=a,c.end.row+=a})},$.prototype.addFold=function(a){if(a.sameRow){if(a.start.row<this.startRow||a.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(a),this.folds.sort(function(c,i){return-c.range.compareEnd(i.start.row,i.start.column)}),this.range.compareEnd(a.start.row,a.start.column)>0?(this.end.row=a.end.row,this.end.column=a.end.column):this.range.compareStart(a.end.row,a.end.column)<0&&(this.start.row=a.start.row,this.start.column=a.start.column)}else if(a.start.row==this.end.row)this.folds.push(a),this.end.row=a.end.row,this.end.column=a.end.column;else if(a.end.row==this.start.row)this.folds.unshift(a),this.start.row=a.start.row,this.start.column=a.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");a.foldLine=this},$.prototype.containsRow=function(a){return a>=this.start.row&&a<=this.end.row},$.prototype.walk=function(a,c,i){var o=0,n=this.folds,t,e,r,s=!0;c==null&&(c=this.end.row,i=this.end.column);for(var l=0;l<n.length;l++){if(t=n[l],e=t.range.compareStart(c,i),e==-1){a(null,c,i,o,s);return}if(r=a(null,t.start.row,t.start.column,o,s),r=!r&&a(t.placeholder,t.start.row,t.start.column,o),r||e===0)return;s=!t.sameRow,o=t.end.column}a(null,c,i,o,s)},$.prototype.getNextFoldTo=function(a,c){for(var i,o,n=0;n<this.folds.length;n++){if(i=this.folds[n],o=i.range.compareEnd(a,c),o==-1)return{fold:i,kind:"after"};if(o===0)return{fold:i,kind:"inside"}}return null},$.prototype.addRemoveChars=function(a,c,i){var o=this.getNextFoldTo(a,c),n,t;if(o){if(n=o.fold,o.kind=="inside"&&n.start.column!=c&&n.start.row!=a)window.console&&window.console.log(a,c,n);else if(n.start.row==a){t=this.folds;var e=t.indexOf(n);for(e===0&&(this.start.column+=i),e;e<t.length;e++){if(n=t[e],n.start.column+=i,!n.sameRow)return;n.end.column+=i}this.end.column+=i}}},$.prototype.split=function(a,c){var i=this.getNextFoldTo(a,c);if(!i||i.kind=="inside")return null;var o=i.fold,n=this.folds,t=this.foldData,e=n.indexOf(o),r=n[e-1];this.end.row=r.end.row,this.end.column=r.end.column,n=n.splice(e,n.length-e);var s=new $(t,n);return t.splice(t.indexOf(this)+1,0,s),s},$.prototype.merge=function(a){for(var c=a.folds,i=0;i<c.length;i++)this.addFold(c[i]);var o=this.foldData;o.splice(o.indexOf(a),1)},$.prototype.toString=function(){var a=[this.range.toString()+": ["];return this.folds.forEach(function(c){a.push(" "+c.toString())}),a.push("]"),a.join(`
197
+ `)},$.prototype.idxToPosition=function(a){for(var c=0,i=0;i<this.folds.length;i++){var o=this.folds[i];if(a-=o.start.column-c,a<0)return{row:o.start.row,column:o.start.column+a};if(a-=o.placeholder.length,a<0)return o.start;c=o.end.column}return{row:this.end.row,column:this.end.column+a}},$}();L.FoldLine=A}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(k,L,H){var E=k("./range").Range,A=E.comparePoints,$=function(){function a(){this.ranges=[],this.$bias=1}return a.prototype.pointIndex=function(c,i,o){for(var n=this.ranges,t=o||0;t<n.length;t++){var e=n[t],r=A(c,e.end);if(!(r>0)){var s=A(c,e.start);return r===0?i&&s!==0?-t-2:t:s>0||s===0&&!i?t:-t-1}}return-t-1},a.prototype.add=function(c){var i=!c.isEmpty(),o=this.pointIndex(c.start,i);o<0&&(o=-o-1);var n=this.pointIndex(c.end,i,o);return n<0?n=-n-1:n++,this.ranges.splice(o,n-o,c)},a.prototype.addList=function(c){for(var i=[],o=c.length;o--;)i.push.apply(i,this.add(c[o]));return i},a.prototype.substractPoint=function(c){var i=this.pointIndex(c);if(i>=0)return this.ranges.splice(i,1)},a.prototype.merge=function(){var c=[],i=this.ranges;i=i.sort(function(r,s){return A(r.start,s.start)});for(var o=i[0],n,t=1;t<i.length;t++){n=o,o=i[t];var e=A(n.end,o.start);e<0||e==0&&!n.isEmpty()&&!o.isEmpty()||(A(n.end,o.end)<0&&(n.end.row=o.end.row,n.end.column=o.end.column),i.splice(t,1),c.push(o),o=n,t--)}return this.ranges=i,c},a.prototype.contains=function(c,i){return this.pointIndex({row:c,column:i})>=0},a.prototype.containsPoint=function(c){return this.pointIndex(c)>=0},a.prototype.rangeAtPoint=function(c){var i=this.pointIndex(c);if(i>=0)return this.ranges[i]},a.prototype.clipRows=function(c,i){var o=this.ranges;if(o[0].start.row>i||o[o.length-1].start.row<c)return[];var n=this.pointIndex({row:c,column:0});n<0&&(n=-n-1);var t=this.pointIndex({row:i,column:0},n);t<0&&(t=-t-1);for(var e=[],r=n;r<t;r++)e.push(o[r]);return e},a.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},a.prototype.attach=function(c){this.session&&this.detach(),this.session=c,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},a.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},a.prototype.$onChange=function(c){for(var i=c.start,o=c.end,n=i.row,t=o.row,e=this.ranges,r=0,s=e.length;r<s;r++){var l=e[r];if(l.end.row>=n)break}if(c.action=="insert")for(var h=t-n,v=-i.column+o.column;r<s;r++){var l=e[r];if(l.start.row>n)break;if(l.start.row==n&&l.start.column>=i.column&&(l.start.column==i.column&&this.$bias<=0||(l.start.column+=v,l.start.row+=h)),l.end.row==n&&l.end.column>=i.column){if(l.end.column==i.column&&this.$bias<0)continue;l.end.column==i.column&&v>0&&r<s-1&&l.end.column>l.start.column&&l.end.column==e[r+1].start.column&&(l.end.column-=v),l.end.column+=v,l.end.row+=h}}else for(var h=n-t,v=i.column-o.column;r<s;r++){var l=e[r];if(l.start.row>t)break;l.end.row<t&&(n<l.end.row||n==l.end.row&&i.column<l.end.column)?(l.end.row=n,l.end.column=i.column):l.end.row==t?l.end.column<=o.column?(h||l.end.column>i.column)&&(l.end.column=i.column,l.end.row=i.row):(l.end.column+=v,l.end.row+=h):l.end.row>t&&(l.end.row+=h),l.start.row<t&&(n<l.start.row||n==l.start.row&&i.column<l.start.column)?(l.start.row=n,l.start.column=i.column):l.start.row==t?l.start.column<=o.column?(h||l.start.column>i.column)&&(l.start.column=i.column,l.start.row=i.row):(l.start.column+=v,l.start.row+=h):l.start.row>t&&(l.start.row+=h)}if(h!=0&&r<s)for(;r<s;r++){var l=e[r];l.start.row+=h,l.end.row+=h}},a}();$.prototype.comparePoints=A,L.RangeList=$}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(k,L,H){var E=this&&this.__extends||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(r[l]=s[l])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),A=k("../range_list").RangeList,$=function(n){E(t,n);function t(e,r){var s=n.call(this)||this;return s.foldLine=null,s.placeholder=r,s.range=e,s.start=e.start,s.end=e.end,s.sameRow=e.start.row==e.end.row,s.subFolds=s.ranges=[],s}return t.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},t.prototype.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(r){r.setFoldLine(e)})},t.prototype.clone=function(){var e=this.range.clone(),r=new t(e,this.placeholder);return this.subFolds.forEach(function(s){r.subFolds.push(s.clone())}),r.collapseChildren=this.collapseChildren,r},t.prototype.addSubFold=function(e){if(!this.range.isEqual(e)){c(e,this.start);for(var v=e.start.row,m=e.start.column,r=0,s=-1;r<this.subFolds.length&&(s=this.subFolds[r].range.compare(v,m),s==1);r++);var l=this.subFolds[r],h=0;if(s==0){if(l.range.containsRange(e))return l.addSubFold(e);h=1}for(var v=e.range.end.row,m=e.range.end.column,g=r,s=-1;g<this.subFolds.length&&(s=this.subFolds[g].range.compare(v,m),s==1);g++);s==0&&g++;for(var d=this.subFolds.splice(r,g-r,e),b=s==0?d.length-1:d.length,M=h;M<b;M++)e.addSubFold(d[M]);return e.setFoldLine(this.foldLine),e}},t.prototype.restoreRange=function(e){return o(e,this.start)},t}(A);function a(n,t){n.row-=t.row,n.row==0&&(n.column-=t.column)}function c(n,t){a(n.start,t),a(n.end,t)}function i(n,t){n.row==0&&(n.column+=t.column),n.row+=t.row}function o(n,t){i(n.start,t),i(n.end,t)}L.Fold=$}),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(k,L,H){var E=k("../range").Range,A=k("./fold_line").FoldLine,$=k("./fold").Fold,a=k("../token_iterator").TokenIterator,c=k("../mouse/mouse_event").MouseEvent;function i(){this.getFoldAt=function(o,n,t){var e=this.getFoldLine(o);if(!e)return null;for(var r=e.folds,s=0;s<r.length;s++){var l=r[s].range;if(l.contains(o,n)){if(t==1&&l.isEnd(o,n)&&!l.isEmpty())continue;if(t==-1&&l.isStart(o,n)&&!l.isEmpty())continue;return r[s]}}},this.getFoldsInRange=function(o){var n=o.start,t=o.end,e=this.$foldData,r=[];n.column+=1,t.column-=1;for(var s=0;s<e.length;s++){var l=e[s].range.compareRange(o);if(l!=2){if(l==-2)break;for(var h=e[s].folds,v=0;v<h.length;v++){var m=h[v];if(l=m.range.compareRange(o),l==-2)break;if(l==2)continue;if(l==42)break;r.push(m)}}}return n.column-=1,t.column+=1,r},this.getFoldsInRangeList=function(o){if(Array.isArray(o)){var n=[];o.forEach(function(t){n=n.concat(this.getFoldsInRange(t))},this)}else var n=this.getFoldsInRange(o);return n},this.getAllFolds=function(){for(var o=[],n=this.$foldData,t=0;t<n.length;t++)for(var e=0;e<n[t].folds.length;e++)o.push(n[t].folds[e]);return o},this.getFoldStringAt=function(o,n,t,e){if(e=e||this.getFoldLine(o),!e)return null;for(var r={end:{column:0}},s,l,h=0;h<e.folds.length;h++){l=e.folds[h];var v=l.range.compareEnd(o,n);if(v==-1){s=this.getLine(l.start.row).substring(r.end.column,l.start.column);break}else if(v===0)return null;r=l}return s||(s=this.getLine(l.start.row).substring(r.end.column)),t==-1?s.substring(0,n-r.end.column):t==1?s.substring(n-r.end.column):s},this.getFoldLine=function(o,n){var t=this.$foldData,e=0;for(n&&(e=t.indexOf(n)),e==-1&&(e=0),e;e<t.length;e++){var r=t[e];if(r.start.row<=o&&r.end.row>=o)return r;if(r.end.row>o)return null}return null},this.getNextFoldLine=function(o,n){var t=this.$foldData,e=0;for(n&&(e=t.indexOf(n)),e==-1&&(e=0),e;e<t.length;e++){var r=t[e];if(r.end.row>=o)return r}return null},this.getFoldedRowCount=function(o,n){for(var t=this.$foldData,e=n-o+1,r=0;r<t.length;r++){var s=t[r],l=s.end.row,h=s.start.row;if(l>=n){h<n&&(h>=o?e-=n-h:e=0);break}else l>=o&&(h>=o?e-=l-h:e-=l-o+1)}return e},this.$addFoldLine=function(o){return this.$foldData.push(o),this.$foldData.sort(function(n,t){return n.start.row-t.start.row}),o},this.addFold=function(o,n){var t=this.$foldData,e=!1,r;o instanceof $?r=o:(r=new $(n,o),r.collapseChildren=n.collapseChildren),this.$clipRangeToDocument(r.range);var s=r.start.row,l=r.start.column,h=r.end.row,v=r.end.column,m=this.getFoldAt(s,l,1),g=this.getFoldAt(h,v,-1);if(m&&g==m)return m.addSubFold(r);m&&!m.range.isStart(s,l)&&this.removeFold(m),g&&!g.range.isEnd(h,v)&&this.removeFold(g);var d=this.getFoldsInRange(r.range);d.length>0&&(this.removeFolds(d),r.collapseChildren||d.forEach(function(S){r.addSubFold(S)}));for(var b=0;b<t.length;b++){var M=t[b];if(h==M.start.row){M.addFold(r),e=!0;break}else if(s==M.end.row){if(M.addFold(r),e=!0,!r.sameRow){var C=t[b+1];if(C&&C.start.row==h){M.merge(C);break}}break}else if(h<=M.start.row)break}return e||(M=this.$addFoldLine(new A(this.$foldData,r))),this.$useWrapMode?this.$updateWrapData(M.start.row,M.start.row):this.$updateRowLengthCache(M.start.row,M.start.row),this.$modified=!0,this._signal("changeFold",{data:r,action:"add"}),r},this.addFolds=function(o){o.forEach(function(n){this.addFold(n)},this)},this.removeFold=function(o){var n=o.foldLine,t=n.start.row,e=n.end.row,r=this.$foldData,s=n.folds;if(s.length==1)r.splice(r.indexOf(n),1);else if(n.range.isEnd(o.end.row,o.end.column))s.pop(),n.end.row=s[s.length-1].end.row,n.end.column=s[s.length-1].end.column;else if(n.range.isStart(o.start.row,o.start.column))s.shift(),n.start.row=s[0].start.row,n.start.column=s[0].start.column;else if(o.sameRow)s.splice(s.indexOf(o),1);else{var l=n.split(o.start.row,o.start.column);s=l.folds,s.shift(),l.start.row=s[0].start.row,l.start.column=s[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(t,e):this.$updateRowLengthCache(t,e)),this.$modified=!0,this._signal("changeFold",{data:o,action:"remove"})},this.removeFolds=function(o){for(var n=[],t=0;t<o.length;t++)n.push(o[t]);n.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(o){this.removeFold(o),o.subFolds.forEach(function(n){o.restoreRange(n),this.addFold(n)},this),o.collapseChildren>0&&this.foldAll(o.start.row+1,o.end.row,o.collapseChildren-1),o.subFolds=[]},this.expandFolds=function(o){o.forEach(function(n){this.expandFold(n)},this)},this.unfold=function(o,n){var t,e;if(o==null)t=new E(0,0,this.getLength(),0),n==null&&(n=!0);else if(typeof o=="number")t=new E(o,0,o,this.getLine(o).length);else if("row"in o)t=E.fromPoints(o,o);else{if(Array.isArray(o))return e=[],o.forEach(function(s){e=e.concat(this.unfold(s))},this),e;t=o}e=this.getFoldsInRangeList(t);for(var r=e;e.length==1&&E.comparePoints(e[0].start,t.start)<0&&E.comparePoints(e[0].end,t.end)>0;)this.expandFolds(e),e=this.getFoldsInRangeList(t);if(n!=!1?this.removeFolds(e):this.expandFolds(e),r.length)return r},this.isRowFolded=function(o,n){return!!this.getFoldLine(o,n)},this.getRowFoldEnd=function(o,n){var t=this.getFoldLine(o,n);return t?t.end.row:o},this.getRowFoldStart=function(o,n){var t=this.getFoldLine(o,n);return t?t.start.row:o},this.getFoldDisplayLine=function(o,n,t,e,r){e==null&&(e=o.start.row),r==null&&(r=0),n==null&&(n=o.end.row),t==null&&(t=this.getLine(n).length);var s=this.doc,l="";return o.walk(function(h,v,m,g){if(!(v<e)){if(v==e){if(m<r)return;g=Math.max(r,g)}h!=null?l+=h:l+=s.getLine(v).substring(g,m)}},n,t),l},this.getDisplayLine=function(o,n,t,e){var r=this.getFoldLine(o);if(r)return this.getFoldDisplayLine(r,o,n,t,e);var s;return s=this.doc.getLine(o),s.substring(e||0,n||s.length)},this.$cloneFoldData=function(){var o=[];return o=this.$foldData.map(function(n){var t=n.folds.map(function(e){return e.clone()});return new A(o,t)}),o},this.toggleFold=function(o){var n=this.selection,t=n.getRange(),e,r;if(t.isEmpty()){var s=t.start;if(e=this.getFoldAt(s.row,s.column),e){this.expandFold(e);return}else if(o){var l=this.getFoldLine(s.row);l&&this.expandFolds(l.folds);return}else(r=this.findMatchingBracket(s))?t.comparePoint(r)==1?t.end=r:(t.start=r,t.start.column++,t.end.column--):(r=this.findMatchingBracket({row:s.row,column:s.column+1}))?(t.comparePoint(r)==1?t.end=r:t.start=r,t.start.column++):t=this.getCommentFoldRange(s.row,s.column)||t}else{var h=this.getFoldsInRange(t);if(o&&h.length){this.expandFolds(h);return}else h.length==1&&(e=h[0])}if(e||(e=this.getFoldAt(t.start.row,t.start.column)),e&&e.range.toString()==t.toString()){this.expandFold(e);return}var v="...";if(!t.isMultiLine()){if(v=this.getTextRange(t),v.length<4)return;v=v.trim().substring(0,2)+".."}this.addFold(v,t)},this.getCommentFoldRange=function(o,n,t){var e=new a(this,o,n),r=e.getCurrentToken(),s=r&&r.type;if(r&&/^comment|string/.test(s)){s=s.match(/comment|string/)[0],s=="comment"&&(s+="|doc-start|\\.doc");var l=new RegExp(s),h=new E;if(t!=1){do r=e.stepBackward();while(r&&l.test(r.type));r=e.stepForward()}h.start.row=e.getCurrentTokenRow(),h.start.column=e.getCurrentTokenColumn()+r.value.length,e=new a(this,o,n);var v=this.getState(e.$row);if(t!=-1){var m=-1;do if(r=e.stepForward(),m==-1){var g=this.getState(e.$row);v.toString()!==g.toString()&&(m=e.$row)}else if(e.$row>m)break;while(r&&l.test(r.type));r=e.stepBackward()}else r=e.getCurrentToken();return h.end.row=e.getCurrentTokenRow(),h.end.column=e.getCurrentTokenColumn(),h.start.row==h.end.row&&h.start.column>h.end.column?void 0:h}},this.foldAll=function(o,n,t,e){t==null&&(t=1e5);var r=this.foldWidgets;if(r){n=n||this.getLength(),o=o||0;for(var s=o;s<n;s++)if(r[s]==null&&(r[s]=this.getFoldWidget(s)),r[s]=="start"&&!(e&&!e(s))){var l=this.getFoldWidgetRange(s);l&&l.isMultiLine()&&l.end.row<=n&&l.start.row>=o&&(s=l.end.row,l.collapseChildren=t,this.addFold("...",l))}}},this.foldToLevel=function(o){for(this.foldAll();o-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var o=this;this.foldAll(null,null,null,function(n){for(var t=o.getTokens(n),e=0;e<t.length;e++){var r=t[e];if(!(r.type=="text"&&/^\s+$/.test(r.value)))return!!/comment/.test(r.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(o){if(!this.$foldStyles[o])throw new Error("invalid fold style: "+o+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=o){this.$foldStyle=o,o=="manual"&&this.unfold();var n=this.$foldMode;this.$setFolding(null),this.$setFolding(n)}},this.$setFolding=function(o){if(this.$foldMode!=o){if(this.$foldMode=o,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!o||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=o.getFoldWidget.bind(o,this,this.$foldStyle),this.getFoldWidgetRange=o.getFoldWidgetRange.bind(o,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(o,n){var t=this.foldWidgets;if(!t||n&&t[o])return{};for(var e=o-1,r;e>=0;){var s=t[e];if(s==null&&(s=t[e]=this.getFoldWidget(e)),s=="start"){var l=this.getFoldWidgetRange(e);if(r||(r=l),l&&l.end.row>=o)break}e--}return{range:e!==-1&&l,firstRange:r}},this.onFoldWidgetClick=function(o,n){n instanceof c&&(n=n.domEvent);var t={children:n.shiftKey,all:n.ctrlKey||n.metaKey,siblings:n.altKey},e=this.$toggleFoldWidget(o,t);if(!e){var r=n.target||n.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(o,n){if(this.getFoldWidget){var t=this.getFoldWidget(o),e=this.getLine(o),r=t==="end"?-1:1,s=this.getFoldAt(o,r===-1?0:e.length,r);if(s)return n.children||n.all?this.removeFold(s):this.expandFold(s),s;var l=this.getFoldWidgetRange(o,!0);if(l&&!l.isMultiLine()&&(s=this.getFoldAt(l.start.row,l.start.column,1),s&&l.isEqual(s.range)))return this.removeFold(s),s;if(n.siblings){var h=this.getParentFoldRangeData(o);if(h.range)var v=h.range.start.row+1,m=h.range.end.row;this.foldAll(v,m,n.all?1e4:0)}else n.children?(m=l?l.end.row:this.getLength(),this.foldAll(o+1,m,n.all?1e4:0)):l&&(n.all&&(l.collapseChildren=1e4),this.addFold("...",l));return l}},this.toggleFoldWidget=function(o){var n=this.selection.getCursor().row;n=this.getRowFoldStart(n);var t=this.$toggleFoldWidget(n,{});if(!t){var e=this.getParentFoldRangeData(n,!0);if(t=e.range||e.firstRange,t){n=t.start.row;var r=this.getFoldAt(n,this.getLine(n).length,1);r?this.removeFold(r):this.addFold("...",t)}}},this.updateFoldWidgets=function(o){var n=o.start.row,t=o.end.row-n;if(t===0)this.foldWidgets[n]=null;else if(o.action=="remove")this.foldWidgets.splice(n,t+1,null);else{var e=Array(t+1);e.unshift(n,1),this.foldWidgets.splice.apply(this.foldWidgets,e)}},this.tokenizerUpdateFoldWidgets=function(o){var n=o.data;n.first!=n.last&&this.foldWidgets.length>n.first&&this.foldWidgets.splice(n.first,this.foldWidgets.length)}}L.Folding=i}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(k,L,H){var E=k("../token_iterator").TokenIterator,A=k("../range").Range;function $(){this.findMatchingBracket=function(a,c){if(a.column==0)return null;var i=c||this.getLine(a.row).charAt(a.column-1);if(i=="")return null;var o=i.match(/([\(\[\{])|([\)\]\}])/);return o?o[1]?this.$findClosingBracket(o[1],a):this.$findOpeningBracket(o[2],a):null},this.getBracketRange=function(a){var c=this.getLine(a.row),i=!0,o,n=c.charAt(a.column-1),t=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(t||(n=c.charAt(a.column),a={row:a.row,column:a.column+1},t=n&&n.match(/([\(\[\{])|([\)\]\}])/),i=!1),!t)return null;if(t[1]){var e=this.$findClosingBracket(t[1],a);if(!e)return null;o=A.fromPoints(a,e),i||(o.end.column++,o.start.column--),o.cursor=o.end}else{var e=this.$findOpeningBracket(t[2],a);if(!e)return null;o=A.fromPoints(e,a),i||(o.start.column++,o.end.column--),o.cursor=o.start}return o},this.getMatchingBracketRanges=function(a,c){var i=this.getLine(a.row),o=/([\(\[\{])|([\)\]\}])/,n=!c&&i.charAt(a.column-1),t=n&&n.match(o);if(t||(n=(c===void 0||c)&&i.charAt(a.column),a={row:a.row,column:a.column+1},t=n&&n.match(o)),!t)return null;var e=new A(a.row,a.column-1,a.row,a.column),r=t[1]?this.$findClosingBracket(t[1],a):this.$findOpeningBracket(t[2],a);if(!r)return[e];var s=new A(r.row,r.column,r.row,r.column+1);return[e,s]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(a,c,i){var o=this.$brackets[a],n=1,t=new E(this,c.row,c.column),e=t.getCurrentToken();if(e||(e=t.stepForward()),!!e){i||(i=new RegExp("(\\.?"+e.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var r=c.column-t.getCurrentTokenColumn()-2,s=e.value;;){for(;r>=0;){var l=s.charAt(r);if(l==o){if(n-=1,n==0)return{row:t.getCurrentTokenRow(),column:r+t.getCurrentTokenColumn()}}else l==a&&(n+=1);r-=1}do e=t.stepBackward();while(e&&!i.test(e.type));if(e==null)break;s=e.value,r=s.length-1}return null}},this.$findClosingBracket=function(a,c,i){var o=this.$brackets[a],n=1,t=new E(this,c.row,c.column),e=t.getCurrentToken();if(e||(e=t.stepForward()),!!e){i||(i=new RegExp("(\\.?"+e.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var r=c.column-t.getCurrentTokenColumn();;){for(var s=e.value,l=s.length;r<l;){var h=s.charAt(r);if(h==o){if(n-=1,n==0)return{row:t.getCurrentTokenRow(),column:r+t.getCurrentTokenColumn()}}else h==a&&(n+=1);r+=1}do e=t.stepForward();while(e&&!i.test(e.type));if(e==null)break;r=0}return null}},this.getMatchingTags=function(a){var c=new E(this,a.row,a.column),i=this.$findTagName(c);if(i){var o=c.stepBackward();return o.value==="<"?this.$findClosingTag(c,i):this.$findOpeningTag(c,i)}},this.$findTagName=function(a){var c=a.getCurrentToken(),i=!1,o=!1;if(c&&c.type.indexOf("tag-name")===-1)do o?c=a.stepBackward():c=a.stepForward(),c&&(c.value==="/>"?o=!0:c.type.indexOf("tag-name")!==-1&&(i=!0));while(c&&!i);return c},this.$findClosingTag=function(a,c){var i,o=c.value,n=c.value,t=0,e=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);c=a.stepForward();var r=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+c.value.length),s=!1;do{if(i=c,i.type.indexOf("tag-close")!==-1&&!s){var l=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);s=!0}if(c=a.stepForward(),c){if(c.value===">"&&!s){var l=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);s=!0}if(c.type.indexOf("tag-name")!==-1){if(o=c.value,n===o){if(i.value==="<")t++;else if(i.value==="</"&&(t--,t<0)){a.stepBackward();var h=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+2);c=a.stepForward();var v=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+c.value.length);if(c.type.indexOf("tag-close")===-1&&(c=a.stepForward()),c&&c.value===">")var m=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);else return}}}else if(n===o&&c.value==="/>"&&(t--,t<0))var h=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+2),v=h,m=v,l=new A(r.end.row,r.end.column,r.end.row,r.end.column+1)}}while(c&&t>=0);if(e&&l&&h&&m&&r&&v)return{openTag:new A(e.start.row,e.start.column,l.end.row,l.end.column),closeTag:new A(h.start.row,h.start.column,m.end.row,m.end.column),openTagName:r,closeTagName:v}},this.$findOpeningTag=function(a,c){var i=a.getCurrentToken(),o=c.value,n=0,t=a.getCurrentTokenRow(),e=a.getCurrentTokenColumn(),r=e+2,s=new A(t,e,t,r);a.stepForward();var l=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+c.value.length);if(c.type.indexOf("tag-close")===-1&&(c=a.stepForward()),!(!c||c.value!==">")){var h=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);a.stepBackward(),a.stepBackward();do if(c=i,t=a.getCurrentTokenRow(),e=a.getCurrentTokenColumn(),r=e+c.value.length,i=a.stepBackward(),c){if(c.type.indexOf("tag-name")!==-1){if(o===c.value)if(i.value==="<"){if(n++,n>0){var v=new A(t,e,t,r),m=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);do c=a.stepForward();while(c&&c.value!==">");var g=new A(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1)}}else i.value==="</"&&n--}else if(c.value==="/>"){for(var d=0,b=i;b;){if(b.type.indexOf("tag-name")!==-1&&b.value===o){n--;break}else if(b.value==="<")break;b=a.stepBackward(),d++}for(var M=0;M<d;M++)a.stepForward()}}while(i&&n<=0);if(m&&g&&s&&h&&v&&l)return{openTag:new A(m.start.row,m.start.column,g.end.row,g.end.column),closeTag:new A(s.start.row,s.start.column,h.end.row,h.end.column),openTagName:v,closeTagName:l}}}}L.BracketMatch=$}),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(k,L,H){var E=k("./lib/oop"),A=k("./lib/lang"),$=k("./bidihandler").BidiHandler,a=k("./config"),c=k("./lib/event_emitter").EventEmitter,i=k("./selection").Selection,o=k("./mode/text").Mode,n=k("./range").Range,t=k("./line_widgets").LineWidgets,e=k("./document").Document,r=k("./background_tokenizer").BackgroundTokenizer,s=k("./search_highlight").SearchHighlight,l=k("./undomanager").UndoManager,h=function(){function w(y,f){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"+ ++w.$uid,this.$foldData.toString=function(){return this.join(`
198
+ `)},this.$gutterCustomWidgets={},this.bgTokenizer=new r(new o().getTokenizer(),this);var u=this;this.bgTokenizer.on("update",function(p){u._signal("tokenizerUpdate",p)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof y!="object"||!y.getLine)&&(y=new e(y)),this.setDocument(y),this.selection=new i(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new $(this),a.resetOptions(this),this.setMode(f),a._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return w.prototype.$initOperationListeners=function(){var y=this;this.curOp=null,this.on("change",function(){y.curOp||(y.startOperation(),y.curOp.selectionBefore=y.$lastSel),y.curOp.docChanged=!0},!0),this.on("changeSelection",function(){y.curOp||(y.startOperation(),y.curOp.selectionBefore=y.$lastSel),y.curOp.selectionChanged=!0},!0),this.$operationResetTimer=A.delayedCall(this.endOperation.bind(this,!0))},w.prototype.startOperation=function(y){if(this.curOp){if(!y||this.curOp.command)return;this.prevOp=this.curOp}y||(y={}),this.$operationResetTimer.schedule(),this.curOp={command:y.command||{},args:y.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",y)},w.prototype.endOperation=function(y){if(this.curOp){if(y&&y.returnValue===!1){this.curOp=null,this._signal("endOperation",y);return}if(y==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var f=this.selection.toJSON();this.curOp.selectionAfter=f,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(f),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",y)}},w.prototype.setDocument=function(y){this.doc&&this.doc.off("change",this.$onChange),this.doc=y,y.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},w.prototype.getDocument=function(){return this.doc},Object.defineProperty(w.prototype,"widgetManager",{get:function(){var y=new t(this);return this.widgetManager=y,this.$editor&&y.attach(this.$editor),y},set:function(y){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:y})},enumerable:!1,configurable:!0}),w.prototype.$resetRowCache=function(y){if(!y){this.$docRowCache=[],this.$screenRowCache=[];return}var f=this.$docRowCache.length,u=this.$getRowCacheIndex(this.$docRowCache,y)+1;f>u&&(this.$docRowCache.splice(u,f),this.$screenRowCache.splice(u,f))},w.prototype.$getRowCacheIndex=function(y,f){for(var u=0,p=y.length-1;u<=p;){var x=u+p>>1,T=y[x];if(f>T)u=x+1;else if(f<T)p=x-1;else return x}return u-1},w.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},w.prototype.onChangeFold=function(y){var f=y.data;this.$resetRowCache(f.start.row)},w.prototype.onChange=function(y){this.$modified=!0,this.$bidiHandler.onChange(y),this.$resetRowCache(y.start.row);var f=this.$updateInternalDataOnChange(y);!this.$fromUndo&&this.$undoManager&&(f&&f.length&&(this.$undoManager.add({action:"removeFolds",folds:f},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(y,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(y),this._signal("change",y)},w.prototype.onSelectionChange=function(){this._signal("changeSelection")},w.prototype.setValue=function(y){this.doc.setValue(y),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},w.fromJSON=function(y){typeof y=="string"&&(y=JSON.parse(y));var f=new l;f.$undoStack=y.history.undo,f.$redoStack=y.history.redo,f.mark=y.history.mark,f.$rev=y.history.rev;var u=new w(y.value);return y.folds.forEach(function(p){u.addFold("...",n.fromPoints(p.start,p.end))}),u.setAnnotations(y.annotations),u.setBreakpoints(y.breakpoints),u.setMode(y.mode),u.setScrollLeft(y.scrollLeft),u.setScrollTop(y.scrollTop),u.setUndoManager(f),u.selection.fromJSON(y.selection),u},w.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(y){return y.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},w.prototype.toString=function(){return this.doc.getValue()},w.prototype.getSelection=function(){return this.selection},w.prototype.getState=function(y){return this.bgTokenizer.getState(y)},w.prototype.getTokens=function(y){return this.bgTokenizer.getTokens(y)},w.prototype.getTokenAt=function(y,f){var u=this.bgTokenizer.getTokens(y),p,x=0;if(f==null){var T=u.length-1;x=this.getLine(y).length}else for(var T=0;T<u.length&&(x+=u[T].value.length,!(x>=f));T++);return p=u[T],p?(p.index=T,p.start=x-p.value.length,p):null},w.prototype.setUndoManager=function(y){if(this.$undoManager=y,this.$informUndoManager&&this.$informUndoManager.cancel(),y){var f=this;y.addSession(this),this.$syncInformUndoManager=function(){f.$informUndoManager.cancel(),f.mergeUndoDeltas=!1},this.$informUndoManager=A.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},w.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},w.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},w.prototype.getTabString=function(){return this.getUseSoftTabs()?A.stringRepeat(" ",this.getTabSize()):" "},w.prototype.setUseSoftTabs=function(y){this.setOption("useSoftTabs",y)},w.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},w.prototype.setTabSize=function(y){this.setOption("tabSize",y)},w.prototype.getTabSize=function(){return this.$tabSize},w.prototype.isTabStop=function(y){return this.$useSoftTabs&&y.column%this.$tabSize===0},w.prototype.setNavigateWithinSoftTabs=function(y){this.setOption("navigateWithinSoftTabs",y)},w.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},w.prototype.setOverwrite=function(y){this.setOption("overwrite",y)},w.prototype.getOverwrite=function(){return this.$overwrite},w.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},w.prototype.addGutterDecoration=function(y,f){this.$decorations[y]||(this.$decorations[y]=""),this.$decorations[y]+=" "+f,this._signal("changeBreakpoint",{})},w.prototype.removeGutterCustomWidget=function(y){this.$editor&&this.$editor.renderer.$gutterLayer.$removeCustomWidget(y)},w.prototype.addGutterCustomWidget=function(y,f){this.$editor&&this.$editor.renderer.$gutterLayer.$addCustomWidget(y,f)},w.prototype.removeGutterDecoration=function(y,f){this.$decorations[y]=(this.$decorations[y]||"").replace(" "+f,""),this._signal("changeBreakpoint",{})},w.prototype.getBreakpoints=function(){return this.$breakpoints},w.prototype.setBreakpoints=function(y){this.$breakpoints=[];for(var f=0;f<y.length;f++)this.$breakpoints[y[f]]="ace_breakpoint";this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},w.prototype.setBreakpoint=function(y,f){f===void 0&&(f="ace_breakpoint"),f?this.$breakpoints[y]=f:delete this.$breakpoints[y],this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoint=function(y){delete this.$breakpoints[y],this._signal("changeBreakpoint",{})},w.prototype.addMarker=function(y,f,u,p){var x=this.$markerId++,T={range:y,type:u||"line",renderer:typeof u=="function"?u:null,clazz:f,inFront:!!p,id:x};return p?(this.$frontMarkers[x]=T,this._signal("changeFrontMarker")):(this.$backMarkers[x]=T,this._signal("changeBackMarker")),x},w.prototype.addDynamicMarker=function(y,f){if(y.update){var u=this.$markerId++;return y.id=u,y.inFront=!!f,f?(this.$frontMarkers[u]=y,this._signal("changeFrontMarker")):(this.$backMarkers[u]=y,this._signal("changeBackMarker")),y}},w.prototype.removeMarker=function(y){var f=this.$frontMarkers[y]||this.$backMarkers[y];if(f){var u=f.inFront?this.$frontMarkers:this.$backMarkers;delete u[y],this._signal(f.inFront?"changeFrontMarker":"changeBackMarker")}},w.prototype.getMarkers=function(y){return y?this.$frontMarkers:this.$backMarkers},w.prototype.highlight=function(y){if(!this.$searchHighlight){var f=new s(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(f)}this.$searchHighlight.setRegexp(y)},w.prototype.highlightLines=function(y,f,u,p){typeof f!="number"&&(u=f,f=y),u||(u="ace_step");var x=new n(y,0,f,1/0);return x.id=this.addMarker(x,u,"fullLine",p),x},w.prototype.setAnnotations=function(y){this.$annotations=y,this._signal("changeAnnotation",{})},w.prototype.getAnnotations=function(){return this.$annotations||[]},w.prototype.clearAnnotations=function(){this.setAnnotations([])},w.prototype.$detectNewLine=function(y){var f=y.match(/^.*?(\r?\n)/m);f?this.$autoNewLine=f[1]:this.$autoNewLine=`
199
+ `},w.prototype.getWordRange=function(y,f){var u=this.getLine(y),p=!1;if(f>0&&(p=!!u.charAt(f-1).match(this.tokenRe)),p||(p=!!u.charAt(f).match(this.tokenRe)),p)var x=this.tokenRe;else if(/^\s+$/.test(u.slice(f-1,f+1)))var x=/\s/;else var x=this.nonTokenRe;var T=f;if(T>0){do T--;while(T>=0&&u.charAt(T).match(x));T++}for(var _=f;_<u.length&&u.charAt(_).match(x);)_++;return new n(y,T,y,_)},w.prototype.getAWordRange=function(y,f){for(var u=this.getWordRange(y,f),p=this.getLine(u.end.row);p.charAt(u.end.column).match(/[ \t]/);)u.end.column+=1;return u},w.prototype.setNewLineMode=function(y){this.doc.setNewLineMode(y)},w.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},w.prototype.setUseWorker=function(y){this.setOption("useWorker",y)},w.prototype.getUseWorker=function(){return this.$useWorker},w.prototype.onReloadTokenizer=function(y){var f=y.data;this.bgTokenizer.start(f.first),this._signal("tokenizerUpdate",y)},w.prototype.setMode=function(y,f){if(y&&typeof y=="object"){if(y.getTokenizer)return this.$onChangeMode(y);var u=y,p=u.path}else p=y||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new o),this.$modes[p]&&!u){this.$onChangeMode(this.$modes[p]),f&&f();return}this.$modeId=p,a.loadModule(["mode",p],(function(x){if(!this.destroyed){if(this.$modeId!==p)return f&&f();this.$modes[p]&&!u?this.$onChangeMode(this.$modes[p]):x&&x.Mode&&(x=new x.Mode(u),u||(this.$modes[p]=x,x.$id=p),this.$onChangeMode(x)),f&&f()}}).bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},w.prototype.$onChangeMode=function(y,f){if(f||(this.$modeId=y.$id),this.$mode!==y){var u=this.$mode;this.$mode=y,this.$stopWorker(),this.$useWorker&&this.$startWorker();var p=y.getTokenizer();if(p.on!==void 0){var x=this.onReloadTokenizer.bind(this);p.on("update",x)}this.bgTokenizer.setTokenizer(p),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=y.tokenRe,this.nonTokenRe=y.nonTokenRe,f||(y.attachToSession&&y.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(y.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:u,mode:y}))}},w.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},w.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(y){a.warn("Could not load worker",y),this.$worker=null}},w.prototype.getMode=function(){return this.$mode},w.prototype.setScrollTop=function(y){this.$scrollTop===y||isNaN(y)||(this.$scrollTop=y,this._signal("changeScrollTop",y))},w.prototype.getScrollTop=function(){return this.$scrollTop},w.prototype.setScrollLeft=function(y){this.$scrollLeft===y||isNaN(y)||(this.$scrollLeft=y,this._signal("changeScrollLeft",y))},w.prototype.getScrollLeft=function(){return this.$scrollLeft},w.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},w.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var y=0;return this.lineWidgets.forEach(function(f){f&&f.screenWidth>y&&(y=f.screenWidth)}),this.lineWidgetWidth=y},w.prototype.$computeWidth=function(y){if(this.$modified||y){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var f=this.doc.getAllLines(),u=this.$rowLengthCache,p=0,x=0,T=this.$foldData[x],_=T?T.start.row:1/0,I=f.length,O=0;O<I;O++){if(O>_){if(O=T.end.row+1,O>=I)break;T=this.$foldData[x++],_=T?T.start.row:1/0}u[O]==null&&(u[O]=this.$getStringScreenWidth(f[O])[0]),u[O]>p&&(p=u[O])}this.screenWidth=p}},w.prototype.getLine=function(y){return this.doc.getLine(y)},w.prototype.getLines=function(y,f){return this.doc.getLines(y,f)},w.prototype.getLength=function(){return this.doc.getLength()},w.prototype.getTextRange=function(y){return this.doc.getTextRange(y||this.selection.getRange())},w.prototype.insert=function(y,f){return this.doc.insert(y,f)},w.prototype.remove=function(y){return this.doc.remove(y)},w.prototype.removeFullLines=function(y,f){return this.doc.removeFullLines(y,f)},w.prototype.undoChanges=function(y,f){if(y.length){this.$fromUndo=!0;for(var u=y.length-1;u!=-1;u--){var p=y[u];p.action=="insert"||p.action=="remove"?this.doc.revertDelta(p):p.folds&&this.addFolds(p.folds)}!f&&this.$undoSelect&&(y.selectionBefore?this.selection.fromJSON(y.selectionBefore):this.selection.setRange(this.$getUndoSelection(y,!0))),this.$fromUndo=!1}},w.prototype.redoChanges=function(y,f){if(y.length){this.$fromUndo=!0;for(var u=0;u<y.length;u++){var p=y[u];(p.action=="insert"||p.action=="remove")&&this.doc.$safeApplyDelta(p)}!f&&this.$undoSelect&&(y.selectionAfter?this.selection.fromJSON(y.selectionAfter):this.selection.setRange(this.$getUndoSelection(y,!1))),this.$fromUndo=!1}},w.prototype.setUndoSelect=function(y){this.$undoSelect=y},w.prototype.$getUndoSelection=function(y,f){function u(I){return f?I.action!=="insert":I.action==="insert"}for(var p,x,T=0;T<y.length;T++){var _=y[T];if(_.start){if(!p){u(_)?p=n.fromPoints(_.start,_.end):p=n.fromPoints(_.start,_.start);continue}u(_)?(x=_.start,p.compare(x.row,x.column)==-1&&p.setStart(x),x=_.end,p.compare(x.row,x.column)==1&&p.setEnd(x)):(x=_.start,p.compare(x.row,x.column)==-1&&(p=n.fromPoints(_.start,_.start)))}}return p},w.prototype.replace=function(y,f){return this.doc.replace(y,f)},w.prototype.moveText=function(y,f,u){var p=this.getTextRange(y),x=this.getFoldsInRange(y),T=n.fromPoints(f,f);if(!u){this.remove(y);var _=y.start.row-y.end.row,I=_?-y.end.column:y.start.column-y.end.column;I&&(T.start.row==y.end.row&&T.start.column>y.end.column&&(T.start.column+=I),T.end.row==y.end.row&&T.end.column>y.end.column&&(T.end.column+=I)),_&&T.start.row>=y.end.row&&(T.start.row+=_,T.end.row+=_)}if(T.end=this.insert(T.start,p),x.length){var O=y.start,z=T.start,_=z.row-O.row,I=z.column-O.column;this.addFolds(x.map(function(F){return F=F.clone(),F.start.row==O.row&&(F.start.column+=I),F.end.row==O.row&&(F.end.column+=I),F.start.row+=_,F.end.row+=_,F}))}return T},w.prototype.indentRows=function(y,f,u){u=u.replace(/\t/g,this.getTabString());for(var p=y;p<=f;p++)this.doc.insertInLine({row:p,column:0},u)},w.prototype.outdentRows=function(y){for(var f=y.collapseRows(),u=new n(0,0,0,0),p=this.getTabSize(),x=f.start.row;x<=f.end.row;++x){var T=this.getLine(x);u.start.row=x,u.end.row=x;for(var _=0;_<p&&T.charAt(_)==" ";++_);_<p&&T.charAt(_)==" "?(u.start.column=_,u.end.column=_+1):(u.start.column=0,u.end.column=_),this.remove(u)}},w.prototype.$moveLines=function(y,f,u){if(y=this.getRowFoldStart(y),f=this.getRowFoldEnd(f),u<0){var p=this.getRowFoldStart(y+u);if(p<0)return 0;var x=p-y}else if(u>0){var p=this.getRowFoldEnd(f+u);if(p>this.doc.getLength()-1)return 0;var x=p-f}else{y=this.$clipRowToDocument(y),f=this.$clipRowToDocument(f);var x=f-y+1}var T=new n(y,0,f,Number.MAX_VALUE),_=this.getFoldsInRange(T).map(function(O){return O=O.clone(),O.start.row+=x,O.end.row+=x,O}),I=u==0?this.doc.getLines(y,f):this.doc.removeFullLines(y,f);return this.doc.insertFullLines(y+x,I),_.length&&this.addFolds(_),x},w.prototype.moveLinesUp=function(y,f){return this.$moveLines(y,f,-1)},w.prototype.moveLinesDown=function(y,f){return this.$moveLines(y,f,1)},w.prototype.duplicateLines=function(y,f){return this.$moveLines(y,f,0)},w.prototype.$clipRowToDocument=function(y){return Math.max(0,Math.min(y,this.doc.getLength()-1))},w.prototype.$clipColumnToRow=function(y,f){return f<0?0:Math.min(this.doc.getLine(y).length,f)},w.prototype.$clipPositionToDocument=function(y,f){if(f=Math.max(0,f),y<0)y=0,f=0;else{var u=this.doc.getLength();y>=u?(y=u-1,f=this.doc.getLine(u-1).length):f=Math.min(this.doc.getLine(y).length,f)}return{row:y,column:f}},w.prototype.$clipRangeToDocument=function(y){y.start.row<0?(y.start.row=0,y.start.column=0):y.start.column=this.$clipColumnToRow(y.start.row,y.start.column);var f=this.doc.getLength()-1;return y.end.row>f?(y.end.row=f,y.end.column=this.doc.getLine(f).length):y.end.column=this.$clipColumnToRow(y.end.row,y.end.column),y},w.prototype.setUseWrapMode=function(y){if(y!=this.$useWrapMode){if(this.$useWrapMode=y,this.$modified=!0,this.$resetRowCache(0),y){var f=this.getLength();this.$wrapData=Array(f),this.$updateWrapData(0,f-1)}this._signal("changeWrapMode")}},w.prototype.getUseWrapMode=function(){return this.$useWrapMode},w.prototype.setWrapLimitRange=function(y,f){(this.$wrapLimitRange.min!==y||this.$wrapLimitRange.max!==f)&&(this.$wrapLimitRange={min:y,max:f},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},w.prototype.adjustWrapLimit=function(y,f){var u=this.$wrapLimitRange;u.max<0&&(u={min:f,max:f});var p=this.$constrainWrapLimit(y,u.min,u.max);return p!=this.$wrapLimit&&p>1?(this.$wrapLimit=p,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},w.prototype.$constrainWrapLimit=function(y,f,u){return f&&(y=Math.max(f,y)),u&&(y=Math.min(u,y)),y},w.prototype.getWrapLimit=function(){return this.$wrapLimit},w.prototype.setWrapLimit=function(y){this.setWrapLimitRange(y,y)},w.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},w.prototype.$updateInternalDataOnChange=function(y){var f=this.$useWrapMode,u=y.action,p=y.start,x=y.end,T=p.row,_=x.row,I=_-T,O=null;if(this.$updating=!0,I!=0)if(u==="remove"){this[f?"$wrapData":"$rowLengthCache"].splice(T,I);var z=this.$foldData;O=this.getFoldsInRange(y),this.removeFolds(O);var D=this.getFoldLine(x.row),N=0;if(D){D.addRemoveChars(x.row,x.column,p.column-x.column),D.shiftRow(-I);var F=this.getFoldLine(T);F&&F!==D&&(F.merge(D),D=F),N=z.indexOf(D)+1}for(N;N<z.length;N++){var D=z[N];D.start.row>=x.row&&D.shiftRow(-I)}_=T}else{var B=Array(I);B.unshift(T,0);var P=f?this.$wrapData:this.$rowLengthCache;P.splice.apply(P,B);var z=this.$foldData,D=this.getFoldLine(T),N=0;if(D){var V=D.range.compareInside(p.row,p.column);V==0?(D=D.split(p.row,p.column),D&&(D.shiftRow(I),D.addRemoveChars(_,0,x.column-p.column))):V==-1&&(D.addRemoveChars(T,0,x.column-p.column),D.shiftRow(I)),N=z.indexOf(D)+1}for(N;N<z.length;N++){var D=z[N];D.start.row>=T&&D.shiftRow(I)}}else{I=Math.abs(y.start.column-y.end.column),u==="remove"&&(O=this.getFoldsInRange(y),this.removeFolds(O),I=-I);var D=this.getFoldLine(T);D&&D.addRemoveChars(T,p.column,I)}return f&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,f?this.$updateWrapData(T,_):this.$updateRowLengthCache(T,_),O},w.prototype.$updateRowLengthCache=function(y,f){this.$rowLengthCache[y]=null,this.$rowLengthCache[f]=null},w.prototype.$updateWrapData=function(y,f){var u=this.doc.getAllLines(),p=this.getTabSize(),x=this.$wrapData,T=this.$wrapLimit,_,I,O=y;for(f=Math.min(f,u.length-1);O<=f;)I=this.getFoldLine(O,I),I?(_=[],I.walk((function(z,D,N,F){var B;if(z!=null){B=this.$getDisplayTokens(z,_.length),B[0]=g;for(var P=1;P<B.length;P++)B[P]=d}else B=this.$getDisplayTokens(u[D].substring(F,N),_.length);_=_.concat(B)}).bind(this),I.end.row,u[I.end.row].length+1),x[I.start.row]=this.$computeWrapSplits(_,T,p),O=I.end.row+1):(_=this.$getDisplayTokens(u[O]),x[O]=this.$computeWrapSplits(_,T,p),O++)},w.prototype.$computeWrapSplits=function(y,f,u){if(y.length==0)return[];var p=[],x=y.length,T=0,_=0,I=this.$wrapAsCode,O=this.$indentedSoftWrap,z=f<=Math.max(2*u,8)||O===!1?0:Math.floor(f/2);function D(){var V=0;if(z===0)return V;if(O)for(var G=0;G<y.length;G++){var j=y[G];if(j==M)V+=1;else if(j==C)V+=u;else{if(j==S)continue;break}}return I&&O!==!1&&(V+=u),Math.min(V,z)}function N(V){for(var G=V-T,j=T;j<V;j++){var K=y[j];(K===12||K===2)&&(G-=1)}p.length||(F=D(),p.indent=F),_+=G,p.push(_),T=V}for(var F=0;x-T>f-F;){var B=T+f-F;if(y[B-1]>=M&&y[B]>=M){N(B);continue}if(y[B]==g||y[B]==d){for(B;B!=T-1&&y[B]!=g;B--);if(B>T){N(B);continue}for(B=T+f,B;B<y.length&&y[B]==d;B++);if(B==y.length)break;N(B);continue}for(var P=Math.max(B-(f-(f>>2)),T-1);B>P&&y[B]<g;)B--;if(I){for(;B>P&&y[B]<g;)B--;for(;B>P&&y[B]==b;)B--}else for(;B>P&&y[B]<M;)B--;if(B>P){N(++B);continue}B=T+f,y[B]==m&&B--,N(B-F)}return p},w.prototype.$getDisplayTokens=function(y,f){var u=[],p;f=f||0;for(var x=0;x<y.length;x++){var T=y.charCodeAt(x);if(T==9){p=this.getScreenTabSize(u.length+f),u.push(C);for(var _=1;_<p;_++)u.push(S)}else T==32?u.push(M):T>39&&T<48||T>57&&T<64?u.push(b):T>=4352&&R(T)?u.push(v,m):u.push(v)}return u},w.prototype.$getStringScreenWidth=function(y,f,u){if(f==0)return[0,0];f==null&&(f=1/0),u=u||0;var p,x;for(x=0;x<y.length&&(p=y.charCodeAt(x),p==9?u+=this.getScreenTabSize(u):p>=4352&&R(p)?u+=2:u+=1,!(u>f));x++);return[u,x]},w.prototype.getRowLength=function(y){var f=1;return this.lineWidgets&&(f+=this.lineWidgets[y]&&this.lineWidgets[y].rowCount||0),!this.$useWrapMode||!this.$wrapData[y]?f:this.$wrapData[y].length+f},w.prototype.getRowLineCount=function(y){return!this.$useWrapMode||!this.$wrapData[y]?1:this.$wrapData[y].length+1},w.prototype.getRowWrapIndent=function(y){if(this.$useWrapMode){var f=this.screenToDocumentPosition(y,Number.MAX_VALUE),u=this.$wrapData[f.row];return u.length&&u[0]<f.column?u.indent:0}else return 0},w.prototype.getScreenLastRowColumn=function(y){var f=this.screenToDocumentPosition(y,Number.MAX_VALUE);return this.documentToScreenColumn(f.row,f.column)},w.prototype.getDocumentLastRowColumn=function(y,f){var u=this.documentToScreenRow(y,f);return this.getScreenLastRowColumn(u)},w.prototype.getDocumentLastRowColumnPosition=function(y,f){var u=this.documentToScreenRow(y,f);return this.screenToDocumentPosition(u,Number.MAX_VALUE/10)},w.prototype.getRowSplitData=function(y){if(this.$useWrapMode)return this.$wrapData[y]},w.prototype.getScreenTabSize=function(y){return this.$tabSize-(y%this.$tabSize|0)},w.prototype.screenToDocumentRow=function(y,f){return this.screenToDocumentPosition(y,f).row},w.prototype.screenToDocumentColumn=function(y,f){return this.screenToDocumentPosition(y,f).column},w.prototype.screenToDocumentPosition=function(y,f,u){if(y<0)return{row:0,column:0};var p,x=0,T=0,_,I=0,O=0,z=this.$screenRowCache,D=this.$getRowCacheIndex(z,y),N=z.length;if(N&&D>=0)var I=z[D],x=this.$docRowCache[D],F=y>z[N-1];else var F=!N;for(var B=this.getLength()-1,P=this.getNextFoldLine(x),V=P?P.start.row:1/0;I<=y&&(O=this.getRowLength(x),!(I+O>y||x>=B));)I+=O,x++,x>V&&(x=P.end.row+1,P=this.getNextFoldLine(x,P),V=P?P.start.row:1/0),F&&(this.$docRowCache.push(x),this.$screenRowCache.push(I));if(P&&P.start.row<=x)p=this.getFoldDisplayLine(P),x=P.start.row;else{if(I+O<=y||x>B)return{row:B,column:this.getLine(B).length};p=this.getLine(x),P=null}var G=0,j=Math.floor(y-I);if(this.$useWrapMode){var K=this.$wrapData[x];K&&(_=K[j],j>0&&K.length&&(G=K.indent,T=K[j-1]||K[K.length-1],p=p.substring(T)))}return u!==void 0&&this.$bidiHandler.isBidiRow(I+j,x,j)&&(f=this.$bidiHandler.offsetToCol(u)),T+=this.$getStringScreenWidth(p,f-G)[1],this.$useWrapMode&&T>=_&&(T=_-1),P?P.idxToPosition(T):{row:x,column:T}},w.prototype.documentToScreenPosition=function(y,f){if(typeof f>"u")var u=this.$clipPositionToDocument(y.row,y.column);else u=this.$clipPositionToDocument(y,f);y=u.row,f=u.column;var p=0,x=null,T=null;T=this.getFoldAt(y,f,1),T&&(y=T.start.row,f=T.start.column);var _,I=0,O=this.$docRowCache,z=this.$getRowCacheIndex(O,y),D=O.length;if(D&&z>=0)var I=O[z],p=this.$screenRowCache[z],N=y>O[D-1];else var N=!D;for(var F=this.getNextFoldLine(I),B=F?F.start.row:1/0;I<y;){if(I>=B){if(_=F.end.row+1,_>y)break;F=this.getNextFoldLine(_,F),B=F?F.start.row:1/0}else _=I+1;p+=this.getRowLength(I),I=_,N&&(this.$docRowCache.push(I),this.$screenRowCache.push(p))}var P="";F&&I>=B?(P=this.getFoldDisplayLine(F,y,f),x=F.start.row):(P=this.getLine(y).substring(0,f),x=y);var V=0;if(this.$useWrapMode){var G=this.$wrapData[x];if(G){for(var j=0;P.length>=G[j];)p++,j++;P=P.substring(G[j-1]||0,P.length),V=j>0?G.indent:0}}return this.lineWidgets&&this.lineWidgets[I]&&this.lineWidgets[I].rowsAbove&&(p+=this.lineWidgets[I].rowsAbove),{row:p,column:V+this.$getStringScreenWidth(P)[0]}},w.prototype.documentToScreenColumn=function(y,f){return this.documentToScreenPosition(y,f).column},w.prototype.documentToScreenRow=function(y,f){return this.documentToScreenPosition(y,f).row},w.prototype.getScreenLength=function(){var y=0,f=null;if(this.$useWrapMode)for(var x=this.$wrapData.length,T=0,p=0,f=this.$foldData[p++],_=f?f.start.row:1/0;T<x;){var I=this.$wrapData[T];y+=I?I.length+1:1,T++,T>_&&(T=f.end.row+1,f=this.$foldData[p++],_=f?f.start.row:1/0)}else{y=this.getLength();for(var u=this.$foldData,p=0;p<u.length;p++)f=u[p],y-=f.end.row-f.start.row}return this.lineWidgets&&(y+=this.$getWidgetScreenLength()),y},w.prototype.$setFontMetrics=function(y){this.$enableVarChar&&(this.$getStringScreenWidth=function(f,u,p){if(u===0)return[0,0];u||(u=1/0),p=p||0;var x,T;for(T=0;T<f.length&&(x=f.charAt(T),x===" "?p+=this.getScreenTabSize(p):p+=y.getCharacterWidth(x),!(p>u));T++);return[p,T]})},w.prototype.getPrecedingCharacter=function(){var y=this.selection.getCursor();if(y.column===0)return y.row===0?"":this.doc.getNewLineCharacter();var f=this.getLine(y.row);return f[y.column-1]},w.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()},w}();h.$uid=0,h.prototype.$modes=a.$modes,h.prototype.getValue=h.prototype.toString,h.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},h.prototype.$overwrite=!1,h.prototype.$mode=null,h.prototype.$modeId=null,h.prototype.$scrollTop=0,h.prototype.$scrollLeft=0,h.prototype.$wrapLimit=80,h.prototype.$useWrapMode=!1,h.prototype.$wrapLimitRange={min:null,max:null},h.prototype.lineWidgets=null,h.prototype.isFullWidth=R,E.implement(h.prototype,c);var v=1,m=2,g=3,d=4,b=9,M=10,C=11,S=12;function R(w){return w<4352?!1:w>=4352&&w<=4447||w>=4515&&w<=4519||w>=4602&&w<=4607||w>=9001&&w<=9002||w>=11904&&w<=11929||w>=11931&&w<=12019||w>=12032&&w<=12245||w>=12272&&w<=12283||w>=12288&&w<=12350||w>=12353&&w<=12438||w>=12441&&w<=12543||w>=12549&&w<=12589||w>=12593&&w<=12686||w>=12688&&w<=12730||w>=12736&&w<=12771||w>=12784&&w<=12830||w>=12832&&w<=12871||w>=12880&&w<=13054||w>=13056&&w<=19903||w>=19968&&w<=42124||w>=42128&&w<=42182||w>=43360&&w<=43388||w>=44032&&w<=55203||w>=55216&&w<=55238||w>=55243&&w<=55291||w>=63744&&w<=64255||w>=65040&&w<=65049||w>=65072&&w<=65106||w>=65108&&w<=65126||w>=65128&&w<=65131||w>=65281&&w<=65376||w>=65504&&w<=65510}k("./edit_session/folding").Folding.call(h.prototype),k("./edit_session/bracket_match").BracketMatch.call(h.prototype),a.defineOptions(h.prototype,"session",{wrap:{set:function(w){if(!w||w=="off"?w=!1:w=="free"?w=!0:w=="printMargin"?w=-1:typeof w=="string"&&(w=parseInt(w,10)||!1),this.$wrap!=w)if(this.$wrap=w,!w)this.setUseWrapMode(!1);else{var y=typeof w=="number"?w:null;this.setWrapLimitRange(y,y),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(w){w=w=="auto"?this.$mode.type!="text":w!="text",w!=this.$wrapAsCode&&(this.$wrapAsCode=w,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(w){this.$useWorker=w,this.$stopWorker(),w&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(w){w=parseInt(w),w>0&&this.$tabSize!==w&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=w,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(w){this.setFoldStyle(w)},handlesSet:!0},overwrite:{set:function(w){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(w){this.doc.setNewLineMode(w)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(w){this.setMode(w)},get:function(){return this.$modeId},handlesSet:!0}}),L.EditSession=h}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(k,L,H){var E=k("./lib/lang"),A=k("./lib/oop"),$=k("./range").Range,a=function(){function n(){this.$options={}}return n.prototype.set=function(t){return A.mixin(this.$options,t),this},n.prototype.getOptions=function(){return E.copyObject(this.$options)},n.prototype.setOptions=function(t){this.$options=t},n.prototype.find=function(t){var e=this.$options,r=this.$matchIterator(t,e);if(!r)return!1;var s=null;return r.forEach(function(l,h,v,m){return s=new $(l,h,v,m),h==m&&e.start&&e.start.start&&e.skipCurrent!=!1&&s.isEqual(e.start)?(s=null,!1):!0}),s},n.prototype.findAll=function(t){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var r=e.range,s=r?t.getLines(r.start.row,r.end.row):t.doc.getAllLines(),l=[],h=e.re;if(e.$isMultiLine){var v=h.length,m=s.length-v,g;e:for(var d=h.offset||0;d<=m;d++){for(var b=0;b<v;b++)if(s[d+b].search(h[b])==-1)continue e;var M=s[d],C=s[d+v-1],S=M.length-M.match(h[0])[0].length,R=C.match(h[v-1])[0].length;g&&g.end.row===d&&g.end.column>S||(l.push(g=new $(d,S,d+v-1,R)),v>2&&(d=d+v-2))}}else for(var w,y=0;y<s.length;y++)if(this.$isMultilineSearch(e)){var f=s.length-1;if(w=this.$multiLineForward(t,h,y,f),w){var u=w.endRow<=f?w.endRow-1:f;u>y&&(y=u),l.push(new $(w.startRow,w.startCol,w.endRow,w.endCol))}}else{w=E.getMatchOffsets(s[y],h);for(var b=0;b<w.length;b++){var p=w[b];l.push(new $(y,p.offset,y,p.offset+p.length))}}if(r){for(var x=r.start.column,T=r.end.column,y=0,b=l.length-1;y<b&&l[y].start.column<x&&l[y].start.row==0;)y++;for(var _=r.end.row-r.start.row;y<b&&l[b].end.column>T&&l[b].end.row==_;)b--;for(l=l.slice(y,b+1),y=0,b=l.length;y<b;y++)l[y].start.row+=r.start.row,l[y].end.row+=r.start.row}return l},n.prototype.parseReplaceString=function(t){for(var e={DollarSign:36,Ampersand:38,Digit0:48,Digit1:49,Digit9:57,Backslash:92,n:110,t:116},r="",s=0,l=t.length;s<l;s++){var h=t.charCodeAt(s);if(h===e.Backslash){if(s++,s>=l){r+="\\";break}var v=t.charCodeAt(s);switch(v){case e.Backslash:r+="\\";break;case e.n:r+=`
200
200
  `;break;case e.t:r+=" ";break}continue}if(h===e.DollarSign){if(s++,s>=l){r+="$";break}var m=t.charCodeAt(s);if(m===e.DollarSign){r+="$$";continue}if(m===e.Digit0||m===e.Ampersand){r+="$&";continue}if(e.Digit1<=m&&m<=e.Digit9){r+="$"+t[s];continue}}r+=t[s]}return r||t},n.prototype.replace=function(t,e){var r=this.$options,s=this.$assembleRegExp(r);if(r.$isMultiLine)return e;if(s){var l=this.$isMultilineSearch(r);l&&(t=t.replace(/\r\n|\r|\n/g,`
201
201
  `));var h=s.exec(t);if(!h||!l&&h[0].length!=t.length)return null;if(e=r.regExp?this.parseReplaceString(e):e.replace(/\$/g,"$$$$"),e=t.replace(s,e),r.preserveCase){e=e.split("");for(var v=Math.min(t.length,t.length);v--;){var m=t[v];m&&m.toLowerCase()!=m?e[v]=e[v].toUpperCase():e[v]=e[v].toLowerCase()}e=e.join("")}return e}},n.prototype.$assembleRegExp=function(t,e){if(t.needle instanceof RegExp)return t.re=t.needle;var r=t.needle;if(!t.needle)return t.re=!1;t.regExp||(r=E.escapeRegExp(r));var s=t.caseSensitive?"gm":"gmi";try{new RegExp(r,"u"),t.$supportsUnicodeFlag=!0,s+="u"}catch{t.$supportsUnicodeFlag=!1}if(t.wholeWord&&(r=c(r,t)),t.$isMultiLine=!e&&/[\n\r]/.test(r),t.$isMultiLine)return t.re=this.$assembleMultilineRegExp(r,s);try{var l=new RegExp(r,s)}catch{l=!1}return t.re=l},n.prototype.$assembleMultilineRegExp=function(t,e){for(var r=t.replace(/\r\n|\r|\n/g,`$
202
202
  ^`).split(`
@@ -206,15 +206,15 @@
206
206
  `),C=r+b.length-1,S=b[b.length-1].length,R=C+M.length-1,w=M.length==1?S+M[0].length:M[M.length-1].length;return{startRow:C,startCol:S,endRow:R,endCol:w}}}return null},n.prototype.$multiLineBackward=function(t,e,r,s,l){for(var h,v=o(t,s),m=t.getLine(s).length-r,g=s;g>=l;){for(var d=0;d<v&&g>=l;d++){var b=t.getLine(g--);h=h==null?b:b+`
207
207
  `+h}var M=i(h,e,m);if(M){var C=h.slice(0,M.index).split(`
208
208
  `),S=M[0].split(`
209
- `),R=g+C.length,w=C[C.length-1].length,y=R+S.length-1,f=S.length==1?w+S[0].length:S[S.length-1].length;return{startRow:R,startCol:w,endRow:y,endCol:f}}}return null},n.prototype.$matchIterator=function(t,e){var r=this.$assembleRegExp(e);if(!r)return!1;var s=this.$isMultilineSearch(e),l=this.$multiLineForward,h=this.$multiLineBackward,v=e.backwards==!0,m=e.skipCurrent!=!1,g=r.unicode,d=e.range,b=e.start;b||(b=d?d[v?"end":"start"]:t.selection.getRange()),b.start&&(b=b[m!=v?"end":"start"]);var M=d?d.start.row:0,C=d?d.end.row:t.getLength()-1;if(v)var S=function(y){var f=b.row;if(!w(f,b.column,y)){for(f--;f>=M;f--)if(w(f,Number.MAX_VALUE,y))return;if(e.wrap!=!1){for(f=C,M=b.row;f>=M;f--)if(w(f,Number.MAX_VALUE,y))return}}};else var S=function(f){var u=b.row;if(!w(u,b.column,f)){for(u=u+1;u<=C;u++)if(w(u,0,f))return;if(e.wrap!=!1){for(u=M,C=b.row;u<=C;u++)if(w(u,0,f))return}}};if(e.$isMultiLine)var R=r.length,w=function(y,f,u){var p=v?y-R+1:y;if(!(p<0||p+R>t.getLength())){var L=t.getLine(p),T=L.search(r[0]);if(!(!v&&T<f||T===-1)){for(var _=1;_<R;_++)if(L=t.getLine(p+_),L.search(r[_])==-1)return;var I=L.match(r[R-1])[0].length;if(!(v&&I>f)&&u(p,T,p+R-1,I))return!0}}};else if(v)var w=function(f,u,p){if(s){var L=h(t,r,u,f,M);if(!L)return!1;if(p(L.startRow,L.startCol,L.endRow,L.endCol))return!0}else{var T=t.getLine(f),_=[],I,O=0;for(r.lastIndex=0;I=r.exec(T);){var z=I[0].length;if(O=I.index,!z){if(O>=T.length)break;r.lastIndex=O+=E.skipEmptyMatch(T,O,g)}if(I.index+z>u)break;_.push(I.index,z)}for(var D=_.length-1;D>=0;D-=2){var N=_[D-1],z=_[D];if(p(f,N,f,N+z))return!0}}};else var w=function(f,u,p){if(r.lastIndex=u,s){var L=l(t,r,f,C);if(L){var T=L.endRow<=C?L.endRow-1:C;T>f&&(f=T)}if(!L)return!1;if(p(L.startRow,L.startCol,L.endRow,L.endCol))return!0}else for(var _=t.getLine(f),I,O;O=r.exec(_);){var z=O[0].length;if(I=O.index,p(f,I,f,I+z))return!0;if(!z&&(r.lastIndex=I+=E.skipEmptyMatch(_,I,g),I>=_.length))return!1}};return{forEach:S}},n}();function c(n,t){var e=E.supportsLookbehind();function r(v,m){m===void 0&&(m=!0);var g=e&&t.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return g.test(v)||t.regExp?e&&t.$supportsUnicodeFlag?m?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var s=Array.from(n),l=s[0],h=s[s.length-1];return r(l)+n+r(h,!1)}function i(n,t,e){for(var r=null,s=0;s<=n.length;){t.lastIndex=s;var l=t.exec(n);if(!l)break;var h=l.index+l[0].length;if(h>n.length-e)break;(!r||h>r.index+r[0].length)&&(r=l),s=l.index+1}return r}function o(n,t){var e=5e3,r={row:t,column:0},s=n.doc.positionToIndex(r),l=s+e,h=n.doc.indexToPosition(l),v=h.row;return v+1}x.Search=a}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(k,x,H){var E=this&&this.__extends||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(r[l]=s[l])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),A=k("../lib/keys"),$=k("../lib/useragent"),a=A.KEY_MODS,c=function(){function n(t,e){this.$init(t,e,!1)}return n.prototype.$init=function(t,e,r){this.platform=e||($.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=r},n.prototype.addCommand=function(t){this.commands[t.name]&&this.removeCommand(t),this.commands[t.name]=t,t.bindKey&&this._buildKeyHash(t)},n.prototype.removeCommand=function(t,e){var r=t&&(typeof t=="string"?t:t.name);t=this.commands[r],e||delete this.commands[r];var s=this.commandKeyBinding;for(var l in s){var h=s[l];if(h==t)delete s[l];else if(Array.isArray(h)){var v=h.indexOf(t);v!=-1&&(h.splice(v,1),h.length==1&&(s[l]=h[0]))}}},n.prototype.bindKey=function(t,e,r){if(typeof t=="object"&&t&&(r==null&&(r=t.position),t=t[this.platform]),!!t){if(typeof e=="function")return this.addCommand({exec:e,bindKey:t,name:e.name||t});t.split("|").forEach(function(s){var l="";if(s.indexOf(" ")!=-1){var h=s.split(/\s+/);s=h.pop(),h.forEach(function(g){var d=this.parseKeys(g),b=a[d.hashId]+d.key;l+=(l?" ":"")+b,this._addCommandToBinding(l,"chainKeys")},this),l+=" "}var v=this.parseKeys(s),m=a[v.hashId]+v.key;this._addCommandToBinding(l+m,e,r)},this)}},n.prototype._addCommandToBinding=function(t,e,r){var s=this.commandKeyBinding,l;if(!e)delete s[t];else if(!s[t]||this.$singleCommand)s[t]=e;else{Array.isArray(s[t])?(l=s[t].indexOf(e))!=-1&&s[t].splice(l,1):s[t]=[s[t]],typeof r!="number"&&(r=i(e));var h=s[t];for(l=0;l<h.length;l++){var v=h[l],m=i(v);if(m>r)break}h.splice(l,0,e)}},n.prototype.addCommands=function(t){t&&Object.keys(t).forEach(function(e){var r=t[e];if(r){if(typeof r=="string")return this.bindKey(r,e);typeof r=="function"&&(r={exec:r}),typeof r=="object"&&(r.name||(r.name=e),this.addCommand(r))}},this)},n.prototype.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)},n.prototype.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)},n.prototype._buildKeyHash=function(t){this.bindKey(t.bindKey,t)},n.prototype.parseKeys=function(t){var e=t.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(m){return m}),r=e.pop(),s=A[r];if(A.FUNCTION_KEYS[s])r=A.FUNCTION_KEYS[s].toLowerCase();else if(e.length){if(e.length==1&&e[0]=="shift")return{key:r.toUpperCase(),hashId:-1}}else return{key:r,hashId:-1};for(var l=0,h=e.length;h--;){var v=A.KEY_MODS[e[h]];if(v==null)return typeof console<"u"&&console.error("invalid modifier "+e[h]+" in "+t),!1;l|=v}return{key:r,hashId:l}},n.prototype.findKeyCommand=function(t,e){var r=a[t]+e;return this.commandKeyBinding[r]},n.prototype.handleKeyboard=function(t,e,r,s){if(!(s<0)){var l=a[e]+r,h=this.commandKeyBinding[l];return t.$keyChain&&(t.$keyChain+=" "+l,h=this.commandKeyBinding[t.$keyChain]||h),h&&(h=="chainKeys"||h[h.length-1]=="chainKeys")?(t.$keyChain=t.$keyChain||l,{command:"null"}):(t.$keyChain&&((!e||e==4)&&r.length==1?t.$keyChain=t.$keyChain.slice(0,-l.length-1):(e==-1||s>0)&&(t.$keyChain="")),{command:h})}},n.prototype.getStatusText=function(t,e){return e.$keyChain||""},n}();function i(n){return typeof n=="object"&&n.bindKey&&n.bindKey.position||(n.isDefault?-100:0)}var o=function(n){E(t,n);function t(e,r){var s=n.call(this,e,r)||this;return s.$singleCommand=!0,s}return t}(c);o.call=function(n,t,e){c.prototype.$init.call(n,t,e,!0)},c.call=function(n,t,e){c.prototype.$init.call(n,t,e,!1)},x.HashHandler=o,x.MultiHashHandler=c}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(k,x,H){var E=this&&this.__extends||function(){var i=function(o,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(o,n)};return function(o,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(o,n);function t(){this.constructor=o}o.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}(),A=k("../lib/oop"),$=k("../keyboard/hash_handler").MultiHashHandler,a=k("../lib/event_emitter").EventEmitter,c=function(i){E(o,i);function o(n,t){var e=i.call(this,t,n)||this;return e.byName=e.commands,e.setDefaultHandler("exec",function(r){return r.args?r.command.exec(r.editor,r.args,r.event,!1):r.command.exec(r.editor,{},r.event,!0)}),e}return o.prototype.exec=function(n,t,e){if(Array.isArray(n)){for(var r=n.length;r--;)if(this.exec(n[r],t,e))return!0;return!1}typeof n=="string"&&(n=this.commands[n]);var s={editor:t,command:n,args:e};return this.canExecute(n,t)?(s.returnValue=this._emit("exec",s),this._signal("afterExec",s),s.returnValue!==!1):(this._signal("commandUnavailable",s),!1)},o.prototype.canExecute=function(n,t){return typeof n=="string"&&(n=this.commands[n]),!(!n||t&&t.$readOnly&&!n.readOnly||this.$checkCommandState!=!1&&n.isAvailable&&!n.isAvailable(t))},o.prototype.toggleRecording=function(n){if(!this.$inReplay)return n&&n._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(t){this.macro.push([t.command,t.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},o.prototype.replay=function(n){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(n);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,n):this.exec(t[0],n,t[1])},this)}finally{this.$inReplay=!1}}},o.prototype.trimMacro=function(n){return n.map(function(t){return typeof t[0]!="string"&&(t[0]=t[0].name),t[1]||(t=t[0]),t})},o}($);A.implement(c.prototype,a),x.CommandManager=c}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(k,x,H){var E=k("../lib/lang"),A=k("../config"),$=k("../range").Range;function a(i,o){return{win:i,mac:o}}x.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:a("Ctrl-,","Command-,"),exec:function(i){A.loadModule("ace/ext/settings_menu",function(o){o.init(i),i.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:a("Alt-E","F4"),exec:function(i){A.loadModule("ace/ext/error_marker",function(o){o.showErrorMarker(i,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:a("Alt-Shift-E","Shift-F4"),exec:function(i){A.loadModule("ace/ext/error_marker",function(o){o.showErrorMarker(i,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:a("Ctrl-A","Command-A"),exec:function(i){i.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:a(null,"Ctrl-L"),exec:function(i){i.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:a("Ctrl-L","Command-L"),exec:function(i,o){typeof o=="number"&&!isNaN(o)&&i.gotoLine(o),i.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:a("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(i){i.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:a("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(i){i.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:a("F2","F2"),exec:function(i){i.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:a("Alt-F2","Alt-F2"),exec:function(i){i.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(i){i.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(i){i.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:a("Alt-0","Command-Option-0"),exec:function(i){i.session.foldAll(),i.session.unfold(i.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:a("Alt-Shift-0","Command-Option-Shift-0"),exec:function(i){i.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:a("Ctrl-K","Command-G"),exec:function(i){i.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:a("Ctrl-Shift-K","Command-Shift-G"),exec:function(i){i.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:a("Alt-K","Ctrl-G"),exec:function(i){i.selection.isEmpty()?i.selection.selectWord():i.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:a("Alt-Shift-K","Ctrl-Shift-G"),exec:function(i){i.selection.isEmpty()?i.selection.selectWord():i.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:a("Ctrl-F","Command-F"),exec:function(i){A.loadModule("ace/ext/searchbox",function(o){o.Search(i)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(i){i.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:a("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(i){i.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:a("Ctrl-Home","Command-Home|Command-Up"),exec:function(i){i.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:a("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(i){i.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:a("Up","Up|Ctrl-P"),exec:function(i,o){i.navigateUp(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:a("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(i){i.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:a("Ctrl-End","Command-End|Command-Down"),exec:function(i){i.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:a("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(i){i.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:a("Down","Down|Ctrl-N"),exec:function(i,o){i.navigateDown(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:a("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(i){i.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:a("Ctrl-Left","Option-Left"),exec:function(i){i.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:a("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(i){i.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:a("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(i){i.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:a("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(i){i.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:a("Left","Left|Ctrl-B"),exec:function(i,o){i.navigateLeft(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:a("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(i){i.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:a("Ctrl-Right","Option-Right"),exec:function(i){i.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:a("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(i){i.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:a("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(i){i.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:a("Shift-Right","Shift-Right"),exec:function(i){i.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:a("Right","Right|Ctrl-F"),exec:function(i,o){i.navigateRight(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(i){i.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:a(null,"Option-PageDown"),exec:function(i){i.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:a("PageDown","PageDown|Ctrl-V"),exec:function(i){i.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(i){i.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:a(null,"Option-PageUp"),exec:function(i){i.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(i){i.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:a("Ctrl-Up",null),exec:function(i){i.renderer.scrollBy(0,-2*i.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:a("Ctrl-Down",null),exec:function(i){i.renderer.scrollBy(0,2*i.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(i){i.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(i){i.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:a("Ctrl-Alt-E","Command-Option-E"),exec:function(i){i.commands.toggleRecording(i)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:a("Ctrl-Shift-E","Command-Shift-E"),exec:function(i){i.commands.replay(i)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:a("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(i){i.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:a("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(i){i.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:a("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(i){i.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:a(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(i){},readOnly:!0},{name:"cut",description:"Cut",exec:function(i){var o=i.$copyWithEmptySelection&&i.selection.isEmpty(),n=o?i.selection.getLineRange():i.selection.getRange();i._emit("cut",n),n.isEmpty()||i.session.remove(n),i.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(i,o){i.$handlePaste(o)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:a("Ctrl-D","Command-D"),exec:function(i){i.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:a("Ctrl-Shift-D","Command-Shift-D"),exec:function(i){i.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:a("Ctrl-Alt-S","Command-Alt-S"),exec:function(i){i.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:a("Ctrl-/","Command-/"),exec:function(i){i.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:a("Ctrl-Shift-/","Command-Shift-/"),exec:function(i){i.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:a("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(i){i.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:a("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(i){i.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:a("Ctrl-H","Command-Option-F"),exec:function(i){A.loadModule("ace/ext/searchbox",function(o){o.Search(i,!0)})}},{name:"undo",description:"Undo",bindKey:a("Ctrl-Z","Command-Z"),exec:function(i){i.undo()}},{name:"redo",description:"Redo",bindKey:a("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(i){i.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:a("Alt-Shift-Up","Command-Option-Up"),exec:function(i){i.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:a("Alt-Up","Option-Up"),exec:function(i){i.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:a("Alt-Shift-Down","Command-Option-Down"),exec:function(i){i.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:a("Alt-Down","Option-Down"),exec:function(i){i.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:a("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(i){i.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:a("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(i){i.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:a("Shift-Delete",null),exec:function(i){if(i.selection.isEmpty())i.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:a("Alt-Backspace","Command-Backspace"),exec:function(i){i.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:a("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(i){i.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:a("Ctrl-Shift-Backspace",null),exec:function(i){var o=i.selection.getRange();o.start.column=0,i.session.remove(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:a("Ctrl-Shift-Delete",null),exec:function(i){var o=i.selection.getRange();o.end.column=Number.MAX_VALUE,i.session.remove(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:a("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(i){i.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:a("Ctrl-Delete","Alt-Delete"),exec:function(i){i.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:a("Shift-Tab","Shift-Tab"),exec:function(i){i.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:a("Tab","Tab"),exec:function(i){i.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:a("Ctrl-[","Ctrl-["),exec:function(i){i.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:a("Ctrl-]","Ctrl-]"),exec:function(i){i.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(i,o){i.insert(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(i,o){i.insert(E.stringRepeat(o.text||"",o.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:a(null,"Ctrl-O"),exec:function(i){i.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:a("Alt-Shift-X","Ctrl-T"),exec:function(i){i.transposeLetters()},multiSelectAction:function(i){i.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:a("Ctrl-U","Ctrl-U"),exec:function(i){i.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:a("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(i){i.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:a(null,null),exec:function(i){i.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:a("Ctrl-Shift-L","Command-Shift-L"),exec:function(i){var o=i.selection.getRange();o.start.column=o.end.column=0,o.end.row++,i.selection.setRange(o,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:a("Ctrl+F3","F3"),exec:function(i){i.openLink()}},{name:"joinlines",description:"Join lines",bindKey:a(null,null),exec:function(i){for(var o=i.selection.isBackwards(),n=o?i.selection.getSelectionLead():i.selection.getSelectionAnchor(),t=o?i.selection.getSelectionAnchor():i.selection.getSelectionLead(),e=i.session.doc.getLine(n.row).length,r=i.session.doc.getTextRange(i.selection.getRange()),s=r.replace(/\n\s*/," ").length,l=i.session.doc.getLine(n.row),h=n.row+1;h<=t.row+1;h++){var v=E.stringTrimLeft(E.stringTrimRight(i.session.doc.getLine(h)));v.length!==0&&(v=" "+v),l+=v}t.row+1<i.session.doc.getLength()-1&&(l+=i.session.doc.getNewLineCharacter()),i.clearSelection(),i.session.doc.replace(new $(n.row,0,t.row+2,0),l),s>0?(i.selection.moveCursorTo(n.row,n.column),i.selection.selectTo(n.row,n.column+s)):(e=i.session.doc.getLine(n.row).length>e?e+1:e,i.selection.moveCursorTo(n.row,e))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:a(null,null),exec:function(i){var o=i.session.doc.getLength()-1,n=i.session.doc.getLine(o).length,t=i.selection.rangeList.ranges,e=[];t.length<1&&(t=[i.selection.getRange()]);for(var r=0;r<t.length;r++)r==t.length-1&&(t[r].end.row===o&&t[r].end.column===n||e.push(new $(t[r].end.row,t[r].end.column,o,n))),r===0?t[r].start.row===0&&t[r].start.column===0||e.push(new $(0,0,t[r].start.row,t[r].start.column)):e.push(new $(t[r-1].end.row,t[r-1].end.column,t[r].start.row,t[r].start.column));i.exitMultiSelectMode(),i.clearSelection();for(var r=0;r<e.length;r++)i.selection.addRange(e[r],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(i){i.selection.clearSelection(),i.navigateLineEnd(),i.insert(`
209
+ `),R=g+C.length,w=C[C.length-1].length,y=R+S.length-1,f=S.length==1?w+S[0].length:S[S.length-1].length;return{startRow:R,startCol:w,endRow:y,endCol:f}}}return null},n.prototype.$matchIterator=function(t,e){var r=this.$assembleRegExp(e);if(!r)return!1;var s=this.$isMultilineSearch(e),l=this.$multiLineForward,h=this.$multiLineBackward,v=e.backwards==!0,m=e.skipCurrent!=!1,g=r.unicode,d=e.range,b=e.start;b||(b=d?d[v?"end":"start"]:t.selection.getRange()),b.start&&(b=b[m!=v?"end":"start"]);var M=d?d.start.row:0,C=d?d.end.row:t.getLength()-1;if(v)var S=function(y){var f=b.row;if(!w(f,b.column,y)){for(f--;f>=M;f--)if(w(f,Number.MAX_VALUE,y))return;if(e.wrap!=!1){for(f=C,M=b.row;f>=M;f--)if(w(f,Number.MAX_VALUE,y))return}}};else var S=function(f){var u=b.row;if(!w(u,b.column,f)){for(u=u+1;u<=C;u++)if(w(u,0,f))return;if(e.wrap!=!1){for(u=M,C=b.row;u<=C;u++)if(w(u,0,f))return}}};if(e.$isMultiLine)var R=r.length,w=function(y,f,u){var p=v?y-R+1:y;if(!(p<0||p+R>t.getLength())){var x=t.getLine(p),T=x.search(r[0]);if(!(!v&&T<f||T===-1)){for(var _=1;_<R;_++)if(x=t.getLine(p+_),x.search(r[_])==-1)return;var I=x.match(r[R-1])[0].length;if(!(v&&I>f)&&u(p,T,p+R-1,I))return!0}}};else if(v)var w=function(f,u,p){if(s){var x=h(t,r,u,f,M);if(!x)return!1;if(p(x.startRow,x.startCol,x.endRow,x.endCol))return!0}else{var T=t.getLine(f),_=[],I,O=0;for(r.lastIndex=0;I=r.exec(T);){var z=I[0].length;if(O=I.index,!z){if(O>=T.length)break;r.lastIndex=O+=E.skipEmptyMatch(T,O,g)}if(I.index+z>u)break;_.push(I.index,z)}for(var D=_.length-1;D>=0;D-=2){var N=_[D-1],z=_[D];if(p(f,N,f,N+z))return!0}}};else var w=function(f,u,p){if(r.lastIndex=u,s){var x=l(t,r,f,C);if(x){var T=x.endRow<=C?x.endRow-1:C;T>f&&(f=T)}if(!x)return!1;if(p(x.startRow,x.startCol,x.endRow,x.endCol))return!0}else for(var _=t.getLine(f),I,O;O=r.exec(_);){var z=O[0].length;if(I=O.index,p(f,I,f,I+z))return!0;if(!z&&(r.lastIndex=I+=E.skipEmptyMatch(_,I,g),I>=_.length))return!1}};return{forEach:S}},n}();function c(n,t){var e=E.supportsLookbehind();function r(v,m){m===void 0&&(m=!0);var g=e&&t.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return g.test(v)||t.regExp?e&&t.$supportsUnicodeFlag?m?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var s=Array.from(n),l=s[0],h=s[s.length-1];return r(l)+n+r(h,!1)}function i(n,t,e){for(var r=null,s=0;s<=n.length;){t.lastIndex=s;var l=t.exec(n);if(!l)break;var h=l.index+l[0].length;if(h>n.length-e)break;(!r||h>r.index+r[0].length)&&(r=l),s=l.index+1}return r}function o(n,t){var e=5e3,r={row:t,column:0},s=n.doc.positionToIndex(r),l=s+e,h=n.doc.indexToPosition(l),v=h.row;return v+1}L.Search=a}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(k,L,H){var E=this&&this.__extends||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(r[l]=s[l])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),A=k("../lib/keys"),$=k("../lib/useragent"),a=A.KEY_MODS,c=function(){function n(t,e){this.$init(t,e,!1)}return n.prototype.$init=function(t,e,r){this.platform=e||($.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=r},n.prototype.addCommand=function(t){this.commands[t.name]&&this.removeCommand(t),this.commands[t.name]=t,t.bindKey&&this._buildKeyHash(t)},n.prototype.removeCommand=function(t,e){var r=t&&(typeof t=="string"?t:t.name);t=this.commands[r],e||delete this.commands[r];var s=this.commandKeyBinding;for(var l in s){var h=s[l];if(h==t)delete s[l];else if(Array.isArray(h)){var v=h.indexOf(t);v!=-1&&(h.splice(v,1),h.length==1&&(s[l]=h[0]))}}},n.prototype.bindKey=function(t,e,r){if(typeof t=="object"&&t&&(r==null&&(r=t.position),t=t[this.platform]),!!t){if(typeof e=="function")return this.addCommand({exec:e,bindKey:t,name:e.name||t});t.split("|").forEach(function(s){var l="";if(s.indexOf(" ")!=-1){var h=s.split(/\s+/);s=h.pop(),h.forEach(function(g){var d=this.parseKeys(g),b=a[d.hashId]+d.key;l+=(l?" ":"")+b,this._addCommandToBinding(l,"chainKeys")},this),l+=" "}var v=this.parseKeys(s),m=a[v.hashId]+v.key;this._addCommandToBinding(l+m,e,r)},this)}},n.prototype._addCommandToBinding=function(t,e,r){var s=this.commandKeyBinding,l;if(!e)delete s[t];else if(!s[t]||this.$singleCommand)s[t]=e;else{Array.isArray(s[t])?(l=s[t].indexOf(e))!=-1&&s[t].splice(l,1):s[t]=[s[t]],typeof r!="number"&&(r=i(e));var h=s[t];for(l=0;l<h.length;l++){var v=h[l],m=i(v);if(m>r)break}h.splice(l,0,e)}},n.prototype.addCommands=function(t){t&&Object.keys(t).forEach(function(e){var r=t[e];if(r){if(typeof r=="string")return this.bindKey(r,e);typeof r=="function"&&(r={exec:r}),typeof r=="object"&&(r.name||(r.name=e),this.addCommand(r))}},this)},n.prototype.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)},n.prototype.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)},n.prototype._buildKeyHash=function(t){this.bindKey(t.bindKey,t)},n.prototype.parseKeys=function(t){var e=t.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(m){return m}),r=e.pop(),s=A[r];if(A.FUNCTION_KEYS[s])r=A.FUNCTION_KEYS[s].toLowerCase();else if(e.length){if(e.length==1&&e[0]=="shift")return{key:r.toUpperCase(),hashId:-1}}else return{key:r,hashId:-1};for(var l=0,h=e.length;h--;){var v=A.KEY_MODS[e[h]];if(v==null)return typeof console<"u"&&console.error("invalid modifier "+e[h]+" in "+t),!1;l|=v}return{key:r,hashId:l}},n.prototype.findKeyCommand=function(t,e){var r=a[t]+e;return this.commandKeyBinding[r]},n.prototype.handleKeyboard=function(t,e,r,s){if(!(s<0)){var l=a[e]+r,h=this.commandKeyBinding[l];return t.$keyChain&&(t.$keyChain+=" "+l,h=this.commandKeyBinding[t.$keyChain]||h),h&&(h=="chainKeys"||h[h.length-1]=="chainKeys")?(t.$keyChain=t.$keyChain||l,{command:"null"}):(t.$keyChain&&((!e||e==4)&&r.length==1?t.$keyChain=t.$keyChain.slice(0,-l.length-1):(e==-1||s>0)&&(t.$keyChain="")),{command:h})}},n.prototype.getStatusText=function(t,e){return e.$keyChain||""},n}();function i(n){return typeof n=="object"&&n.bindKey&&n.bindKey.position||(n.isDefault?-100:0)}var o=function(n){E(t,n);function t(e,r){var s=n.call(this,e,r)||this;return s.$singleCommand=!0,s}return t}(c);o.call=function(n,t,e){c.prototype.$init.call(n,t,e,!0)},c.call=function(n,t,e){c.prototype.$init.call(n,t,e,!1)},L.HashHandler=o,L.MultiHashHandler=c}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(k,L,H){var E=this&&this.__extends||function(){var i=function(o,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(o,n)};return function(o,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(o,n);function t(){this.constructor=o}o.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}(),A=k("../lib/oop"),$=k("../keyboard/hash_handler").MultiHashHandler,a=k("../lib/event_emitter").EventEmitter,c=function(i){E(o,i);function o(n,t){var e=i.call(this,t,n)||this;return e.byName=e.commands,e.setDefaultHandler("exec",function(r){return r.args?r.command.exec(r.editor,r.args,r.event,!1):r.command.exec(r.editor,{},r.event,!0)}),e}return o.prototype.exec=function(n,t,e){if(Array.isArray(n)){for(var r=n.length;r--;)if(this.exec(n[r],t,e))return!0;return!1}typeof n=="string"&&(n=this.commands[n]);var s={editor:t,command:n,args:e};return this.canExecute(n,t)?(s.returnValue=this._emit("exec",s),this._signal("afterExec",s),s.returnValue!==!1):(this._signal("commandUnavailable",s),!1)},o.prototype.canExecute=function(n,t){return typeof n=="string"&&(n=this.commands[n]),!(!n||t&&t.$readOnly&&!n.readOnly||this.$checkCommandState!=!1&&n.isAvailable&&!n.isAvailable(t))},o.prototype.toggleRecording=function(n){if(!this.$inReplay)return n&&n._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(t){this.macro.push([t.command,t.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},o.prototype.replay=function(n){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(n);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,n):this.exec(t[0],n,t[1])},this)}finally{this.$inReplay=!1}}},o.prototype.trimMacro=function(n){return n.map(function(t){return typeof t[0]!="string"&&(t[0]=t[0].name),t[1]||(t=t[0]),t})},o}($);A.implement(c.prototype,a),L.CommandManager=c}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(k,L,H){var E=k("../lib/lang"),A=k("../config"),$=k("../range").Range;function a(i,o){return{win:i,mac:o}}L.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:a("Ctrl-,","Command-,"),exec:function(i){A.loadModule("ace/ext/settings_menu",function(o){o.init(i),i.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:a("Alt-E","F4"),exec:function(i){A.loadModule("ace/ext/error_marker",function(o){o.showErrorMarker(i,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:a("Alt-Shift-E","Shift-F4"),exec:function(i){A.loadModule("ace/ext/error_marker",function(o){o.showErrorMarker(i,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:a("Ctrl-A","Command-A"),exec:function(i){i.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:a(null,"Ctrl-L"),exec:function(i){i.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:a("Ctrl-L","Command-L"),exec:function(i,o){typeof o=="number"&&!isNaN(o)&&i.gotoLine(o),i.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:a("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(i){i.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:a("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(i){i.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:a("F2","F2"),exec:function(i){i.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:a("Alt-F2","Alt-F2"),exec:function(i){i.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(i){i.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(i){i.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:a("Alt-0","Command-Option-0"),exec:function(i){i.session.foldAll(),i.session.unfold(i.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:a("Alt-Shift-0","Command-Option-Shift-0"),exec:function(i){i.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:a("Ctrl-K","Command-G"),exec:function(i){i.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:a("Ctrl-Shift-K","Command-Shift-G"),exec:function(i){i.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:a("Alt-K","Ctrl-G"),exec:function(i){i.selection.isEmpty()?i.selection.selectWord():i.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:a("Alt-Shift-K","Ctrl-Shift-G"),exec:function(i){i.selection.isEmpty()?i.selection.selectWord():i.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:a("Ctrl-F","Command-F"),exec:function(i){A.loadModule("ace/ext/searchbox",function(o){o.Search(i)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(i){i.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:a("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(i){i.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:a("Ctrl-Home","Command-Home|Command-Up"),exec:function(i){i.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:a("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(i){i.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:a("Up","Up|Ctrl-P"),exec:function(i,o){i.navigateUp(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:a("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(i){i.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:a("Ctrl-End","Command-End|Command-Down"),exec:function(i){i.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:a("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(i){i.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:a("Down","Down|Ctrl-N"),exec:function(i,o){i.navigateDown(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:a("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(i){i.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:a("Ctrl-Left","Option-Left"),exec:function(i){i.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:a("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(i){i.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:a("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(i){i.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:a("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(i){i.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:a("Left","Left|Ctrl-B"),exec:function(i,o){i.navigateLeft(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:a("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(i){i.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:a("Ctrl-Right","Option-Right"),exec:function(i){i.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:a("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(i){i.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:a("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(i){i.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:a("Shift-Right","Shift-Right"),exec:function(i){i.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:a("Right","Right|Ctrl-F"),exec:function(i,o){i.navigateRight(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(i){i.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:a(null,"Option-PageDown"),exec:function(i){i.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:a("PageDown","PageDown|Ctrl-V"),exec:function(i){i.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(i){i.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:a(null,"Option-PageUp"),exec:function(i){i.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(i){i.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:a("Ctrl-Up",null),exec:function(i){i.renderer.scrollBy(0,-2*i.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:a("Ctrl-Down",null),exec:function(i){i.renderer.scrollBy(0,2*i.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(i){i.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(i){i.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:a("Ctrl-Alt-E","Command-Option-E"),exec:function(i){i.commands.toggleRecording(i)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:a("Ctrl-Shift-E","Command-Shift-E"),exec:function(i){i.commands.replay(i)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:a("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(i){i.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:a("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(i){i.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:a("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(i){i.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:a(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(i){},readOnly:!0},{name:"cut",description:"Cut",exec:function(i){var o=i.$copyWithEmptySelection&&i.selection.isEmpty(),n=o?i.selection.getLineRange():i.selection.getRange();i._emit("cut",n),n.isEmpty()||i.session.remove(n),i.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(i,o){i.$handlePaste(o)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:a("Ctrl-D","Command-D"),exec:function(i){i.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:a("Ctrl-Shift-D","Command-Shift-D"),exec:function(i){i.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:a("Ctrl-Alt-S","Command-Alt-S"),exec:function(i){i.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:a("Ctrl-/","Command-/"),exec:function(i){i.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:a("Ctrl-Shift-/","Command-Shift-/"),exec:function(i){i.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:a("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(i){i.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:a("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(i){i.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:a("Ctrl-H","Command-Option-F"),exec:function(i){A.loadModule("ace/ext/searchbox",function(o){o.Search(i,!0)})}},{name:"undo",description:"Undo",bindKey:a("Ctrl-Z","Command-Z"),exec:function(i){i.undo()}},{name:"redo",description:"Redo",bindKey:a("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(i){i.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:a("Alt-Shift-Up","Command-Option-Up"),exec:function(i){i.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:a("Alt-Up","Option-Up"),exec:function(i){i.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:a("Alt-Shift-Down","Command-Option-Down"),exec:function(i){i.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:a("Alt-Down","Option-Down"),exec:function(i){i.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:a("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(i){i.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:a("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(i){i.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:a("Shift-Delete",null),exec:function(i){if(i.selection.isEmpty())i.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:a("Alt-Backspace","Command-Backspace"),exec:function(i){i.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:a("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(i){i.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:a("Ctrl-Shift-Backspace",null),exec:function(i){var o=i.selection.getRange();o.start.column=0,i.session.remove(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:a("Ctrl-Shift-Delete",null),exec:function(i){var o=i.selection.getRange();o.end.column=Number.MAX_VALUE,i.session.remove(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:a("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(i){i.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:a("Ctrl-Delete","Alt-Delete"),exec:function(i){i.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:a("Shift-Tab","Shift-Tab"),exec:function(i){i.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:a("Tab","Tab"),exec:function(i){i.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:a("Ctrl-[","Ctrl-["),exec:function(i){i.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:a("Ctrl-]","Ctrl-]"),exec:function(i){i.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(i,o){i.insert(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(i,o){i.insert(E.stringRepeat(o.text||"",o.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:a(null,"Ctrl-O"),exec:function(i){i.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:a("Alt-Shift-X","Ctrl-T"),exec:function(i){i.transposeLetters()},multiSelectAction:function(i){i.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:a("Ctrl-U","Ctrl-U"),exec:function(i){i.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:a("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(i){i.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:a(null,null),exec:function(i){i.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:a("Ctrl-Shift-L","Command-Shift-L"),exec:function(i){var o=i.selection.getRange();o.start.column=o.end.column=0,o.end.row++,i.selection.setRange(o,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:a("Ctrl+F3","F3"),exec:function(i){i.openLink()}},{name:"joinlines",description:"Join lines",bindKey:a(null,null),exec:function(i){for(var o=i.selection.isBackwards(),n=o?i.selection.getSelectionLead():i.selection.getSelectionAnchor(),t=o?i.selection.getSelectionAnchor():i.selection.getSelectionLead(),e=i.session.doc.getLine(n.row).length,r=i.session.doc.getTextRange(i.selection.getRange()),s=r.replace(/\n\s*/," ").length,l=i.session.doc.getLine(n.row),h=n.row+1;h<=t.row+1;h++){var v=E.stringTrimLeft(E.stringTrimRight(i.session.doc.getLine(h)));v.length!==0&&(v=" "+v),l+=v}t.row+1<i.session.doc.getLength()-1&&(l+=i.session.doc.getNewLineCharacter()),i.clearSelection(),i.session.doc.replace(new $(n.row,0,t.row+2,0),l),s>0?(i.selection.moveCursorTo(n.row,n.column),i.selection.selectTo(n.row,n.column+s)):(e=i.session.doc.getLine(n.row).length>e?e+1:e,i.selection.moveCursorTo(n.row,e))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:a(null,null),exec:function(i){var o=i.session.doc.getLength()-1,n=i.session.doc.getLine(o).length,t=i.selection.rangeList.ranges,e=[];t.length<1&&(t=[i.selection.getRange()]);for(var r=0;r<t.length;r++)r==t.length-1&&(t[r].end.row===o&&t[r].end.column===n||e.push(new $(t[r].end.row,t[r].end.column,o,n))),r===0?t[r].start.row===0&&t[r].start.column===0||e.push(new $(0,0,t[r].start.row,t[r].start.column)):e.push(new $(t[r-1].end.row,t[r-1].end.column,t[r].start.row,t[r].start.column));i.exitMultiSelectMode(),i.clearSelection();for(var r=0;r<e.length;r++)i.selection.addRange(e[r],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(i){i.selection.clearSelection(),i.navigateLineEnd(),i.insert(`
210
210
  `)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(i){i.selection.clearSelection();var o=i.getCursorPosition();i.selection.moveTo(o.row-1,Number.MAX_VALUE),i.insert(`
211
- `),o.row===0&&i.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(i){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),i.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:a("F1","F1"),exec:function(i){i.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:a(null,null),exec:function(i){i.prompt({$type:"modes"})},readOnly:!0}];for(var c=1;c<9;c++)x.commands.push({name:"foldToLevel"+c,description:"Fold To Level "+c,level:c,exec:function(i){i.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(k,x,H){var E=k("../lib/keys"),A=k("../mouse/default_gutter_handler").GutterTooltip,$=function(){function c(i){this.editor=i,this.gutterLayer=i.renderer.$gutterLayer,this.element=i.renderer.$gutter,this.lines=i.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new A(this.editor)}return c.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))},c.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))},c.prototype.$onGutterKeyDown=function(i){if(this.annotationTooltip.isOpen){i.preventDefault(),i.keyCode===E.escape&&this.annotationTooltip.hideTooltip();return}if(i.target===this.element){if(i.keyCode!=E.enter)return;i.preventDefault();var o=this.editor.getCursorPosition().row;this.editor.isRowVisible(o)||this.editor.scrollToLine(o,!0,!0),setTimeout((function(){var n=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),t=this.$findNearestFoldLaneWidget(n),e=this.$findNearestAnnotation(n);if(!(t===null&&e===null)){var r=this.$findClosestNumber(t,e,n);if(r===t)if(this.activeLane="fold",this.activeRowIndex=t,this.$isCustomWidgetVisible(t)){this.$focusCustomWidget(this.activeRowIndex);return}else{this.$focusFoldWidget(this.activeRowIndex);return}else{this.activeRowIndex=e,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}}}).bind(this),10);return}this.$handleGutterKeyboardInteraction(i),setTimeout((function(){this.editor._signal("gutterkeydown",new a(i,this))}).bind(this),10)},c.prototype.$handleGutterKeyboardInteraction=function(i){if(i.keyCode===E.tab){i.preventDefault();return}if(i.keyCode===E.escape){i.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(i.keyCode===E.up){switch(i.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(i.keyCode===E.down){switch(i.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(i.keyCode===E.left){i.preventDefault(),this.$switchLane("annotation");return}if(i.keyCode===E.right){i.preventDefault(),this.$switchLane("fold");return}if(i.keyCode===E.enter||i.keyCode===E.space){switch(i.preventDefault(),this.activeLane){case"fold":var o=this.$rowIndexToRow(this.activeRowIndex),n=this.editor.session.$gutterCustomWidgets[o];if(n)n.callbacks&&n.callbacks.onClick&&n.callbacks.onClick(i,o);else if(this.gutterLayer.session.foldWidgets[o]==="start"){this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),i),setTimeout((function(){this.$rowIndexToRow(this.activeRowIndex)!==o&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(o),this.$focusFoldWidget(this.activeRowIndex))}).bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var t=this.lines.cells[this.activeRowIndex].element.childNodes[2],e=t.getBoundingClientRect(),r=this.annotationTooltip.getElement().style;r.left=e.right+"px",r.top=e.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},c.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()},c.prototype.$isFoldWidgetVisible=function(i){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(i)),n=this.$getFoldWidget(i).style.display!=="none";return o&&n},c.prototype.$isCustomWidgetVisible=function(i){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(i)),n=!!this.$getCustomWidget(i);return o&&n},c.prototype.$isAnnotationVisible=function(i){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(i)),n=this.$getAnnotation(i).style.display!=="none";return o&&n},c.prototype.$getFoldWidget=function(i){var o=this.lines.get(i),n=o.element;return n.childNodes[1]},c.prototype.$getCustomWidget=function(i){var o=this.lines.get(i),n=o.element;return n.childNodes[3]},c.prototype.$getAnnotation=function(i){var o=this.lines.get(i),n=o.element;return n.childNodes[2]},c.prototype.$findNearestFoldLaneWidget=function(i){if(this.$isCustomWidgetVisible(i)||this.$isFoldWidgetVisible(i))return i;for(var o=0;i-o>0||i+o<this.lines.getLength()-1;){if(o++,i-o>=0&&this.$isCustomWidgetVisible(i-o))return i-o;if(i+o<=this.lines.getLength()-1&&this.$isCustomWidgetVisible(i+o))return i+o;if(i-o>=0&&this.$isFoldWidgetVisible(i-o))return i-o;if(i+o<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(i+o))return i+o}return null},c.prototype.$findNearestAnnotation=function(i){if(this.$isAnnotationVisible(i))return i;for(var o=0;i-o>0||i+o<this.lines.getLength()-1;){if(o++,i-o>=0&&this.$isAnnotationVisible(i-o))return i-o;if(i+o<=this.lines.getLength()-1&&this.$isAnnotationVisible(i+o))return i+o}return null},c.prototype.$focusFoldWidget=function(i){if(i!=null){var o=this.$getFoldWidget(i);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},c.prototype.$focusCustomWidget=function(i){if(i!=null){var o=this.$getCustomWidget(i);o&&(o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus())}},c.prototype.$focusAnnotation=function(i){if(i!=null){var o=this.$getAnnotation(i);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},c.prototype.$blurFoldWidget=function(i){var o=this.$getFoldWidget(i);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},c.prototype.$blurCustomWidget=function(i){var o=this.$getCustomWidget(i);o&&(o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur())},c.prototype.$blurAnnotation=function(i){var o=this.$getAnnotation(i);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},c.prototype.$moveFoldWidgetUp=function(){for(var i=this.activeRowIndex;i>0;)if(i--,this.$isFoldWidgetVisible(i)||this.$isCustomWidgetVisible(i)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=i,this.$isFoldWidgetVisible(i)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},c.prototype.$moveFoldWidgetDown=function(){for(var i=this.activeRowIndex;i<this.lines.getLength()-1;)if(i++,this.$isFoldWidgetVisible(i)||this.$isCustomWidgetVisible(i)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=i,this.$isFoldWidgetVisible(i)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},c.prototype.$moveAnnotationUp=function(){for(var i=this.activeRowIndex;i>0;)if(i--,this.$isAnnotationVisible(i)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$focusAnnotation(this.activeRowIndex);return}},c.prototype.$moveAnnotationDown=function(){for(var i=this.activeRowIndex;i<this.lines.getLength()-1;)if(i++,this.$isAnnotationVisible(i)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$focusAnnotation(this.activeRowIndex);return}},c.prototype.$findClosestNumber=function(i,o,n){return i===null?o:o===null||Math.abs(n-i)<=Math.abs(n-o)?i:o},c.prototype.$switchLane=function(i){switch(i){case"annotation":if(this.activeLane==="annotation")break;var o=this.$findNearestAnnotation(this.activeRowIndex);if(o==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=o,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var n=this.$findNearestFoldLaneWidget(this.activeRowIndex);if(n===null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=n,this.$isCustomWidgetVisible(n)?this.$focusCustomWidget(this.activeRowIndex):this.$focusFoldWidget(this.activeRowIndex);break}},c.prototype.$rowIndexToRow=function(i){var o=this.lines.get(i);return o?o.row:null},c.prototype.$rowToRowIndex=function(i){for(var o=0;o<this.lines.getLength();o++){var n=this.lines.get(o);if(n.row==i)return o}return null},c}();x.GutterKeyboardHandler=$;var a=function(){function c(i,o){this.gutterKeyboardHandler=o,this.domEvent=i}return c.prototype.getKey=function(){return E.keyCodeToString(this.domEvent.keyCode)},c.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},c.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},c.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},c}();x.GutterKeyboardEvent=a}),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(k,x,H){var E=this&&this.__values||function(f){var u=typeof Symbol=="function"&&Symbol.iterator,p=u&&f[u],L=0;if(p)return p.call(f);if(f&&typeof f.length=="number")return{next:function(){return f&&L>=f.length&&(f=void 0),{value:f&&f[L++],done:!f}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")},A=k("./lib/oop"),$=k("./lib/dom"),a=k("./lib/lang"),c=k("./lib/useragent"),i=k("./keyboard/textinput").TextInput,o=k("./mouse/mouse_handler").MouseHandler,n=k("./mouse/fold_handler").FoldHandler,t=k("./keyboard/keybinding").KeyBinding,e=k("./edit_session").EditSession,r=k("./search").Search,s=k("./range").Range,l=k("./lib/event_emitter").EventEmitter,h=k("./commands/command_manager").CommandManager,v=k("./commands/default_commands").commands,m=k("./config"),g=k("./token_iterator").TokenIterator,d=k("./keyboard/gutter_handler").GutterKeyboardHandler,b=k("./config").nls,M=k("./clipboard"),C=k("./lib/keys"),S=k("./lib/event"),R=k("./tooltip").HoverTooltip,w=function(){function f(u,p,L){this.id="editor"+ ++f.$uid,this.session,this.$toDestroy=[];var T=u.getContainerElement();this.container=T,this.renderer=u,this.commands=new h(c.isMac?"mac":"win",v),typeof document=="object"&&(this.textInput=new i(u.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new o(this),new n(this)),this.keyBinding=new t(this),this.$search=new r().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=a.delayedCall((function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}).bind(this)),this.on("change",function(_,I){I._$emitInputEvent.schedule(31)}),this.setSession(p||L&&L.session||new e("")),m.resetOptions(this),L&&this.setOptions(L),m._signal("editor",this)}return f.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},f.prototype.startOperation=function(u){this.session.startOperation(u)},f.prototype.endOperation=function(u){this.session.endOperation(u)},f.prototype.onStartOperation=function(u){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,u||(this.previousCommand=null)},f.prototype.onEndOperation=function(u){if(this.curOp&&this.session){if(u&&u.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var p=this.curOp.command,L=p&&p.scrollIntoView;if(L){switch(L){case"center-animate":L="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var T=this.selection.getRange(),_=this.renderer.layerConfig;(T.start.row>=_.lastRow||T.end.row<=_.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}L=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},f.prototype.$historyTracker=function(u){if(this.$mergeUndoDeltas){var p=this.prevOp,L=this.$mergeableCommands,T=p.command&&u.command.name==p.command.name;if(u.command.name=="insertstring"){var _=u.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),T=T&&this.mergeNextCommand&&(!/\s/.test(_)||/\s/.test(p.args)),this.mergeNextCommand=!0}else T=T&&L.indexOf(u.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(T=!1),T?this.session.mergeUndoDeltas=!0:L.indexOf(u.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},f.prototype.setKeyboardHandler=function(u,p){if(u&&typeof u=="string"&&u!="ace"){this.$keybindingId=u;var L=this;m.loadModule(["keybinding",u],function(T){L.$keybindingId==u&&L.keyBinding.setKeyboardHandler(T&&T.handler),p&&p()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(u),p&&p()},f.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},f.prototype.setSession=function(u){if(this.session!=u){this.curOp&&this.endOperation(),this.curOp={};var p=this.session;if(p){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 L=this.session.getSelection();L.off("changeCursor",this.$onCursorChange),L.off("changeSelection",this.$onSelectionChange)}this.session=u,u?(this.$onDocumentChange=this.onDocumentChange.bind(this),u.on("change",this.$onDocumentChange),this.renderer.setSession(u),this.$onChangeMode=this.onChangeMode.bind(this),u.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),u.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),u.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),u.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),u.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),u.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=u.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(u)),this._signal("changeSession",{session:u,oldSession:p}),this.curOp=null,p&&p._signal("changeEditor",{oldEditor:this}),p&&(p.$editor=null),u&&u._signal("changeEditor",{editor:this}),u&&(u.$editor=this),u&&!u.destroyed&&u.bgTokenizer.scheduleStart()}},f.prototype.getSession=function(){return this.session},f.prototype.setValue=function(u,p){return this.session.doc.setValue(u),p?p==1?this.navigateFileEnd():p==-1&&this.navigateFileStart():this.selectAll(),u},f.prototype.getValue=function(){return this.session.getValue()},f.prototype.getSelection=function(){return this.selection},f.prototype.resize=function(u){this.renderer.onResize(u)},f.prototype.setTheme=function(u,p){this.renderer.setTheme(u,p)},f.prototype.getTheme=function(){return this.renderer.getTheme()},f.prototype.setStyle=function(u,p){this.renderer.setStyle(u,p)},f.prototype.unsetStyle=function(u){this.renderer.unsetStyle(u)},f.prototype.getFontSize=function(){return this.getOption("fontSize")||$.computedStyle(this.container).fontSize},f.prototype.setFontSize=function(u){this.setOption("fontSize",u)},f.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var u=this;this.$highlightPending=!0,setTimeout(function(){u.$highlightPending=!1;var p=u.session;if(!(!p||p.destroyed)){p.$bracketHighlight&&(p.$bracketHighlight.markerIds.forEach(function(F){p.removeMarker(F)}),p.$bracketHighlight=null);var L=u.getCursorPosition(),T=u.getKeyboardHandler(),_=T&&T.$getDirectionForHighlight&&T.$getDirectionForHighlight(u),I=p.getMatchingBracketRanges(L,_);if(!I){var O=new g(p,L.row,L.column),z=O.getCurrentToken();if(z&&/\b(?:tag-open|tag-name)/.test(z.type)){var D=p.getMatchingTags(L);D&&(I=[D.openTagName.isEmpty()?D.openTag:D.openTagName,D.closeTagName.isEmpty()?D.closeTag:D.closeTagName])}}if(!I&&p.$mode.getMatching&&(I=p.$mode.getMatching(u.session)),!I){u.getHighlightIndentGuides()&&u.renderer.$textLayer.$highlightIndentGuide();return}var N="ace_bracket";Array.isArray(I)?I.length==1&&(N="ace_error_bracket"):I=[I],I.length==2&&(s.comparePoints(I[0].end,I[1].start)==0?I=[s.fromPoints(I[0].start,I[1].end)]:s.comparePoints(I[0].start,I[1].end)==0&&(I=[s.fromPoints(I[1].start,I[0].end)])),p.$bracketHighlight={ranges:I,markerIds:I.map(function(F){return p.addMarker(F,N,"text")})},u.getHighlightIndentGuides()&&u.renderer.$textLayer.$highlightIndentGuide()}},50)}},f.prototype.focus=function(){this.textInput.focus()},f.prototype.isFocused=function(){return this.textInput.isFocused()},f.prototype.blur=function(){this.textInput.blur()},f.prototype.onFocus=function(u){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",u))},f.prototype.onBlur=function(u){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",u))},f.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},f.prototype.onDocumentChange=function(u){var p=this.session.$useWrapMode,L=u.start.row==u.end.row?u.end.row:1/0;this.renderer.updateLines(u.start.row,L,p),this._signal("change",u),this.$cursorChange()},f.prototype.onTokenizerUpdate=function(u){var p=u.data;this.renderer.updateLines(p.first,p.last)},f.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},f.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},f.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},f.prototype.$updateHighlightActiveLine=function(){var u=this.getSession(),p;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(p=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(p=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(p=!1)),u.$highlightLineMarker&&!p)u.removeMarker(u.$highlightLineMarker.id),u.$highlightLineMarker=null;else if(!u.$highlightLineMarker&&p){var L=new s(p.row,p.column,p.row,1/0);L.id=u.addMarker(L,"ace_active-line","screenLine"),u.$highlightLineMarker=L}else p&&(u.$highlightLineMarker.start.row=p.row,u.$highlightLineMarker.end.row=p.row,u.$highlightLineMarker.start.column=p.column,u._signal("changeBackMarker"))},f.prototype.onSelectionChange=function(u){var p=this.session;if(p.$selectionMarker&&p.removeMarker(p.$selectionMarker),p.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var L=this.selection.getRange(),T=this.getSelectionStyle();p.$selectionMarker=p.addMarker(L,"ace_selection",T)}var _=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(_),this._signal("changeSelection")},f.prototype.$getSelectionHighLightRegexp=function(){var u=this.session,p=this.getSelectionRange();if(!(p.isEmpty()||p.isMultiLine())){var L=p.start.column,T=p.end.column,_=u.getLine(p.start.row),I=_.substring(L,T);if(!(I.length>5e3||!/[\w\d]/.test(I))){var O=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:I}),z=_.substring(L-1,T+1);if(O.test(z))return O}}},f.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},f.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},f.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},f.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},f.prototype.onChangeMode=function(u){this.renderer.updateText(),this._emit("changeMode",u)},f.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},f.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},f.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},f.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},f.prototype.getCopyText=function(){var u=this.getSelectedText(),p=this.session.doc.getNewLineCharacter(),L=!1;if(!u&&this.$copyWithEmptySelection){L=!0;for(var T=this.selection.getAllRanges(),_=0;_<T.length;_++){var I=T[_];_&&T[_-1].start.row==I.start.row||(u+=this.session.getLine(I.start.row)+p)}}var O={text:u};return this._signal("copy",O),M.lineMode=L?O.text:!1,O.text},f.prototype.onCopy=function(){this.commands.exec("copy",this)},f.prototype.onCut=function(){this.commands.exec("cut",this)},f.prototype.onPaste=function(u,p){var L={text:u,event:p};this.commands.exec("paste",this,L)},f.prototype.$handlePaste=function(u){typeof u=="string"&&(u={text:u}),this._signal("paste",u);var p=u.text,L=p===M.lineMode,T=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)L?T.insert({row:this.selection.lead.row,column:0},p):this.insert(p);else if(L)this.selection.rangeList.ranges.forEach(function(N){T.insert({row:N.start.row,column:0},p)});else{var _=p.split(/\r\n|\r|\n/),I=this.selection.rangeList.ranges,O=_.length==2&&(!_[0]||!_[1]);if(_.length!=I.length||O)return this.commands.exec("insertstring",this,p);for(var z=I.length;z--;){var D=I[z];D.isEmpty()||T.remove(D),T.insert(D.start,_[z])}}},f.prototype.execCommand=function(u,p){return this.commands.exec(u,this,p)},f.prototype.insert=function(u,p){var L=this.session,T=L.getMode(),_=this.getCursorPosition();if(this.getBehavioursEnabled()&&!p){var I=T.transformAction(L.getState(_.row),"insertion",this,L,u);I&&(u!==I.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),u=I.text)}if(u==" "&&(u=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&u.indexOf(`
211
+ `),o.row===0&&i.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(i){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),i.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:a("F1","F1"),exec:function(i){i.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:a(null,null),exec:function(i){i.prompt({$type:"modes"})},readOnly:!0}];for(var c=1;c<9;c++)L.commands.push({name:"foldToLevel"+c,description:"Fold To Level "+c,level:c,exec:function(i){i.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(k,L,H){var E=k("../lib/keys"),A=k("../mouse/default_gutter_handler").GutterTooltip,$=function(){function c(i){this.editor=i,this.gutterLayer=i.renderer.$gutterLayer,this.element=i.renderer.$gutter,this.lines=i.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new A(this.editor)}return c.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))},c.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))},c.prototype.$onGutterKeyDown=function(i){if(this.annotationTooltip.isOpen){i.preventDefault(),i.keyCode===E.escape&&this.annotationTooltip.hideTooltip();return}if(i.target===this.element){if(i.keyCode!=E.enter)return;i.preventDefault();var o=this.editor.getCursorPosition().row;this.editor.isRowVisible(o)||this.editor.scrollToLine(o,!0,!0),setTimeout((function(){var n=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),t=this.$findNearestFoldLaneWidget(n),e=this.$findNearestAnnotation(n);if(!(t===null&&e===null)){var r=this.$findClosestNumber(t,e,n);if(r===t)if(this.activeLane="fold",this.activeRowIndex=t,this.$isCustomWidgetVisible(t)){this.$focusCustomWidget(this.activeRowIndex);return}else{this.$focusFoldWidget(this.activeRowIndex);return}else{this.activeRowIndex=e,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}}}).bind(this),10);return}this.$handleGutterKeyboardInteraction(i),setTimeout((function(){this.editor._signal("gutterkeydown",new a(i,this))}).bind(this),10)},c.prototype.$handleGutterKeyboardInteraction=function(i){if(i.keyCode===E.tab){i.preventDefault();return}if(i.keyCode===E.escape){i.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(i.keyCode===E.up){switch(i.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(i.keyCode===E.down){switch(i.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(i.keyCode===E.left){i.preventDefault(),this.$switchLane("annotation");return}if(i.keyCode===E.right){i.preventDefault(),this.$switchLane("fold");return}if(i.keyCode===E.enter||i.keyCode===E.space){switch(i.preventDefault(),this.activeLane){case"fold":var o=this.$rowIndexToRow(this.activeRowIndex),n=this.editor.session.$gutterCustomWidgets[o];if(n)n.callbacks&&n.callbacks.onClick&&n.callbacks.onClick(i,o);else if(this.gutterLayer.session.foldWidgets[o]==="start"){this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),i),setTimeout((function(){this.$rowIndexToRow(this.activeRowIndex)!==o&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(o),this.$focusFoldWidget(this.activeRowIndex))}).bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var t=this.lines.cells[this.activeRowIndex].element.childNodes[2],e=t.getBoundingClientRect(),r=this.annotationTooltip.getElement().style;r.left=e.right+"px",r.top=e.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},c.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()},c.prototype.$isFoldWidgetVisible=function(i){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(i)),n=this.$getFoldWidget(i).style.display!=="none";return o&&n},c.prototype.$isCustomWidgetVisible=function(i){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(i)),n=!!this.$getCustomWidget(i);return o&&n},c.prototype.$isAnnotationVisible=function(i){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(i)),n=this.$getAnnotation(i).style.display!=="none";return o&&n},c.prototype.$getFoldWidget=function(i){var o=this.lines.get(i),n=o.element;return n.childNodes[1]},c.prototype.$getCustomWidget=function(i){var o=this.lines.get(i),n=o.element;return n.childNodes[3]},c.prototype.$getAnnotation=function(i){var o=this.lines.get(i),n=o.element;return n.childNodes[2]},c.prototype.$findNearestFoldLaneWidget=function(i){if(this.$isCustomWidgetVisible(i)||this.$isFoldWidgetVisible(i))return i;for(var o=0;i-o>0||i+o<this.lines.getLength()-1;){if(o++,i-o>=0&&this.$isCustomWidgetVisible(i-o))return i-o;if(i+o<=this.lines.getLength()-1&&this.$isCustomWidgetVisible(i+o))return i+o;if(i-o>=0&&this.$isFoldWidgetVisible(i-o))return i-o;if(i+o<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(i+o))return i+o}return null},c.prototype.$findNearestAnnotation=function(i){if(this.$isAnnotationVisible(i))return i;for(var o=0;i-o>0||i+o<this.lines.getLength()-1;){if(o++,i-o>=0&&this.$isAnnotationVisible(i-o))return i-o;if(i+o<=this.lines.getLength()-1&&this.$isAnnotationVisible(i+o))return i+o}return null},c.prototype.$focusFoldWidget=function(i){if(i!=null){var o=this.$getFoldWidget(i);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},c.prototype.$focusCustomWidget=function(i){if(i!=null){var o=this.$getCustomWidget(i);o&&(o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus())}},c.prototype.$focusAnnotation=function(i){if(i!=null){var o=this.$getAnnotation(i);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},c.prototype.$blurFoldWidget=function(i){var o=this.$getFoldWidget(i);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},c.prototype.$blurCustomWidget=function(i){var o=this.$getCustomWidget(i);o&&(o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur())},c.prototype.$blurAnnotation=function(i){var o=this.$getAnnotation(i);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},c.prototype.$moveFoldWidgetUp=function(){for(var i=this.activeRowIndex;i>0;)if(i--,this.$isFoldWidgetVisible(i)||this.$isCustomWidgetVisible(i)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=i,this.$isFoldWidgetVisible(i)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},c.prototype.$moveFoldWidgetDown=function(){for(var i=this.activeRowIndex;i<this.lines.getLength()-1;)if(i++,this.$isFoldWidgetVisible(i)||this.$isCustomWidgetVisible(i)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=i,this.$isFoldWidgetVisible(i)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},c.prototype.$moveAnnotationUp=function(){for(var i=this.activeRowIndex;i>0;)if(i--,this.$isAnnotationVisible(i)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$focusAnnotation(this.activeRowIndex);return}},c.prototype.$moveAnnotationDown=function(){for(var i=this.activeRowIndex;i<this.lines.getLength()-1;)if(i++,this.$isAnnotationVisible(i)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$focusAnnotation(this.activeRowIndex);return}},c.prototype.$findClosestNumber=function(i,o,n){return i===null?o:o===null||Math.abs(n-i)<=Math.abs(n-o)?i:o},c.prototype.$switchLane=function(i){switch(i){case"annotation":if(this.activeLane==="annotation")break;var o=this.$findNearestAnnotation(this.activeRowIndex);if(o==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=o,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var n=this.$findNearestFoldLaneWidget(this.activeRowIndex);if(n===null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=n,this.$isCustomWidgetVisible(n)?this.$focusCustomWidget(this.activeRowIndex):this.$focusFoldWidget(this.activeRowIndex);break}},c.prototype.$rowIndexToRow=function(i){var o=this.lines.get(i);return o?o.row:null},c.prototype.$rowToRowIndex=function(i){for(var o=0;o<this.lines.getLength();o++){var n=this.lines.get(o);if(n.row==i)return o}return null},c}();L.GutterKeyboardHandler=$;var a=function(){function c(i,o){this.gutterKeyboardHandler=o,this.domEvent=i}return c.prototype.getKey=function(){return E.keyCodeToString(this.domEvent.keyCode)},c.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},c.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},c.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},c}();L.GutterKeyboardEvent=a}),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(k,L,H){var E=this&&this.__values||function(f){var u=typeof Symbol=="function"&&Symbol.iterator,p=u&&f[u],x=0;if(p)return p.call(f);if(f&&typeof f.length=="number")return{next:function(){return f&&x>=f.length&&(f=void 0),{value:f&&f[x++],done:!f}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")},A=k("./lib/oop"),$=k("./lib/dom"),a=k("./lib/lang"),c=k("./lib/useragent"),i=k("./keyboard/textinput").TextInput,o=k("./mouse/mouse_handler").MouseHandler,n=k("./mouse/fold_handler").FoldHandler,t=k("./keyboard/keybinding").KeyBinding,e=k("./edit_session").EditSession,r=k("./search").Search,s=k("./range").Range,l=k("./lib/event_emitter").EventEmitter,h=k("./commands/command_manager").CommandManager,v=k("./commands/default_commands").commands,m=k("./config"),g=k("./token_iterator").TokenIterator,d=k("./keyboard/gutter_handler").GutterKeyboardHandler,b=k("./config").nls,M=k("./clipboard"),C=k("./lib/keys"),S=k("./lib/event"),R=k("./tooltip").HoverTooltip,w=function(){function f(u,p,x){this.id="editor"+ ++f.$uid,this.session,this.$toDestroy=[];var T=u.getContainerElement();this.container=T,this.renderer=u,this.commands=new h(c.isMac?"mac":"win",v),typeof document=="object"&&(this.textInput=new i(u.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new o(this),new n(this)),this.keyBinding=new t(this),this.$search=new r().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=a.delayedCall((function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}).bind(this)),this.on("change",function(_,I){I._$emitInputEvent.schedule(31)}),this.setSession(p||x&&x.session||new e("")),m.resetOptions(this),x&&this.setOptions(x),m._signal("editor",this)}return f.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},f.prototype.startOperation=function(u){this.session.startOperation(u)},f.prototype.endOperation=function(u){this.session.endOperation(u)},f.prototype.onStartOperation=function(u){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,u||(this.previousCommand=null)},f.prototype.onEndOperation=function(u){if(this.curOp&&this.session){if(u&&u.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var p=this.curOp.command,x=p&&p.scrollIntoView;if(x){switch(x){case"center-animate":x="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var T=this.selection.getRange(),_=this.renderer.layerConfig;(T.start.row>=_.lastRow||T.end.row<=_.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}x=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},f.prototype.$historyTracker=function(u){if(this.$mergeUndoDeltas){var p=this.prevOp,x=this.$mergeableCommands,T=p.command&&u.command.name==p.command.name;if(u.command.name=="insertstring"){var _=u.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),T=T&&this.mergeNextCommand&&(!/\s/.test(_)||/\s/.test(p.args)),this.mergeNextCommand=!0}else T=T&&x.indexOf(u.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(T=!1),T?this.session.mergeUndoDeltas=!0:x.indexOf(u.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},f.prototype.setKeyboardHandler=function(u,p){if(u&&typeof u=="string"&&u!="ace"){this.$keybindingId=u;var x=this;m.loadModule(["keybinding",u],function(T){x.$keybindingId==u&&x.keyBinding.setKeyboardHandler(T&&T.handler),p&&p()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(u),p&&p()},f.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},f.prototype.setSession=function(u){if(this.session!=u){this.curOp&&this.endOperation(),this.curOp={};var p=this.session;if(p){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 x=this.session.getSelection();x.off("changeCursor",this.$onCursorChange),x.off("changeSelection",this.$onSelectionChange)}this.session=u,u?(this.$onDocumentChange=this.onDocumentChange.bind(this),u.on("change",this.$onDocumentChange),this.renderer.setSession(u),this.$onChangeMode=this.onChangeMode.bind(this),u.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),u.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),u.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),u.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),u.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),u.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=u.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(u)),this._signal("changeSession",{session:u,oldSession:p}),this.curOp=null,p&&p._signal("changeEditor",{oldEditor:this}),p&&(p.$editor=null),u&&u._signal("changeEditor",{editor:this}),u&&(u.$editor=this),u&&!u.destroyed&&u.bgTokenizer.scheduleStart()}},f.prototype.getSession=function(){return this.session},f.prototype.setValue=function(u,p){return this.session.doc.setValue(u),p?p==1?this.navigateFileEnd():p==-1&&this.navigateFileStart():this.selectAll(),u},f.prototype.getValue=function(){return this.session.getValue()},f.prototype.getSelection=function(){return this.selection},f.prototype.resize=function(u){this.renderer.onResize(u)},f.prototype.setTheme=function(u,p){this.renderer.setTheme(u,p)},f.prototype.getTheme=function(){return this.renderer.getTheme()},f.prototype.setStyle=function(u,p){this.renderer.setStyle(u,p)},f.prototype.unsetStyle=function(u){this.renderer.unsetStyle(u)},f.prototype.getFontSize=function(){return this.getOption("fontSize")||$.computedStyle(this.container).fontSize},f.prototype.setFontSize=function(u){this.setOption("fontSize",u)},f.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var u=this;this.$highlightPending=!0,setTimeout(function(){u.$highlightPending=!1;var p=u.session;if(!(!p||p.destroyed)){p.$bracketHighlight&&(p.$bracketHighlight.markerIds.forEach(function(F){p.removeMarker(F)}),p.$bracketHighlight=null);var x=u.getCursorPosition(),T=u.getKeyboardHandler(),_=T&&T.$getDirectionForHighlight&&T.$getDirectionForHighlight(u),I=p.getMatchingBracketRanges(x,_);if(!I){var O=new g(p,x.row,x.column),z=O.getCurrentToken();if(z&&/\b(?:tag-open|tag-name)/.test(z.type)){var D=p.getMatchingTags(x);D&&(I=[D.openTagName.isEmpty()?D.openTag:D.openTagName,D.closeTagName.isEmpty()?D.closeTag:D.closeTagName])}}if(!I&&p.$mode.getMatching&&(I=p.$mode.getMatching(u.session)),!I){u.getHighlightIndentGuides()&&u.renderer.$textLayer.$highlightIndentGuide();return}var N="ace_bracket";Array.isArray(I)?I.length==1&&(N="ace_error_bracket"):I=[I],I.length==2&&(s.comparePoints(I[0].end,I[1].start)==0?I=[s.fromPoints(I[0].start,I[1].end)]:s.comparePoints(I[0].start,I[1].end)==0&&(I=[s.fromPoints(I[1].start,I[0].end)])),p.$bracketHighlight={ranges:I,markerIds:I.map(function(F){return p.addMarker(F,N,"text")})},u.getHighlightIndentGuides()&&u.renderer.$textLayer.$highlightIndentGuide()}},50)}},f.prototype.focus=function(){this.textInput.focus()},f.prototype.isFocused=function(){return this.textInput.isFocused()},f.prototype.blur=function(){this.textInput.blur()},f.prototype.onFocus=function(u){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",u))},f.prototype.onBlur=function(u){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",u))},f.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},f.prototype.onDocumentChange=function(u){var p=this.session.$useWrapMode,x=u.start.row==u.end.row?u.end.row:1/0;this.renderer.updateLines(u.start.row,x,p),this._signal("change",u),this.$cursorChange()},f.prototype.onTokenizerUpdate=function(u){var p=u.data;this.renderer.updateLines(p.first,p.last)},f.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},f.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},f.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},f.prototype.$updateHighlightActiveLine=function(){var u=this.getSession(),p;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(p=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(p=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(p=!1)),u.$highlightLineMarker&&!p)u.removeMarker(u.$highlightLineMarker.id),u.$highlightLineMarker=null;else if(!u.$highlightLineMarker&&p){var x=new s(p.row,p.column,p.row,1/0);x.id=u.addMarker(x,"ace_active-line","screenLine"),u.$highlightLineMarker=x}else p&&(u.$highlightLineMarker.start.row=p.row,u.$highlightLineMarker.end.row=p.row,u.$highlightLineMarker.start.column=p.column,u._signal("changeBackMarker"))},f.prototype.onSelectionChange=function(u){var p=this.session;if(p.$selectionMarker&&p.removeMarker(p.$selectionMarker),p.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var x=this.selection.getRange(),T=this.getSelectionStyle();p.$selectionMarker=p.addMarker(x,"ace_selection",T)}var _=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(_),this._signal("changeSelection")},f.prototype.$getSelectionHighLightRegexp=function(){var u=this.session,p=this.getSelectionRange();if(!(p.isEmpty()||p.isMultiLine())){var x=p.start.column,T=p.end.column,_=u.getLine(p.start.row),I=_.substring(x,T);if(!(I.length>5e3||!/[\w\d]/.test(I))){var O=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:I}),z=_.substring(x-1,T+1);if(O.test(z))return O}}},f.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},f.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},f.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},f.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},f.prototype.onChangeMode=function(u){this.renderer.updateText(),this._emit("changeMode",u)},f.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},f.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},f.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},f.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},f.prototype.getCopyText=function(){var u=this.getSelectedText(),p=this.session.doc.getNewLineCharacter(),x=!1;if(!u&&this.$copyWithEmptySelection){x=!0;for(var T=this.selection.getAllRanges(),_=0;_<T.length;_++){var I=T[_];_&&T[_-1].start.row==I.start.row||(u+=this.session.getLine(I.start.row)+p)}}var O={text:u};return this._signal("copy",O),M.lineMode=x?O.text:!1,O.text},f.prototype.onCopy=function(){this.commands.exec("copy",this)},f.prototype.onCut=function(){this.commands.exec("cut",this)},f.prototype.onPaste=function(u,p){var x={text:u,event:p};this.commands.exec("paste",this,x)},f.prototype.$handlePaste=function(u){typeof u=="string"&&(u={text:u}),this._signal("paste",u);var p=u.text,x=p===M.lineMode,T=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)x?T.insert({row:this.selection.lead.row,column:0},p):this.insert(p);else if(x)this.selection.rangeList.ranges.forEach(function(N){T.insert({row:N.start.row,column:0},p)});else{var _=p.split(/\r\n|\r|\n/),I=this.selection.rangeList.ranges,O=_.length==2&&(!_[0]||!_[1]);if(_.length!=I.length||O)return this.commands.exec("insertstring",this,p);for(var z=I.length;z--;){var D=I[z];D.isEmpty()||T.remove(D),T.insert(D.start,_[z])}}},f.prototype.execCommand=function(u,p){return this.commands.exec(u,this,p)},f.prototype.insert=function(u,p){var x=this.session,T=x.getMode(),_=this.getCursorPosition();if(this.getBehavioursEnabled()&&!p){var I=T.transformAction(x.getState(_.row),"insertion",this,x,u);I&&(u!==I.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),u=I.text)}if(u==" "&&(u=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&u.indexOf(`
212
212
  `)==-1){var O=s.fromPoints(_,_);O.end.column+=u.length,this.session.remove(O)}}else{var O=this.getSelectionRange();_=this.session.remove(O),this.clearSelection()}if(u==`
213
213
  `||u==`\r
214
- `){var F=L.getLine(_.row);if(_.column>F.search(/\S|$/)){var z=F.substr(_.column).search(/\S|$/);L.doc.removeInLine(_.row,_.column,_.column+z)}}this.clearSelection();var D=_.column,N=L.getState(_.row),F=L.getLine(_.row),B=T.checkOutdent(N,F,u);if(L.insert(_,u),I&&I.selection&&(I.selection.length==2?this.selection.setSelectionRange(new s(_.row,D+I.selection[0],_.row,D+I.selection[1])):this.selection.setSelectionRange(new s(_.row+I.selection[0],I.selection[1],_.row+I.selection[2],I.selection[3]))),this.$enableAutoIndent){if(L.getDocument().isNewLine(u)){var P=T.getNextLineIndent(N,F.slice(0,_.column),L.getTabString());L.insert({row:_.row+1,column:0},P)}B&&T.autoOutdent(N,L,_.row)}},f.prototype.autoIndent=function(){for(var u=this.session,p=u.getMode(),L=this.selection.isEmpty()?[new s(0,0,u.doc.getLength()-1,0)]:this.selection.getAllRanges(),T="",_="",I="",O=u.getTabString(),z=0;z<L.length;z++)for(var D=L[z].start.row,N=L[z].end.row,F=D;F<=N;F++){F>0&&(T=u.getState(F-1),_=u.getLine(F-1),I=p.getNextLineIndent(T,_,O));var B=u.getLine(F),P=p.$getIndent(B);if(I!==P){if(P.length>0){var V=new s(F,0,F,P.length);u.remove(V)}I.length>0&&u.insert({row:F,column:0},I)}p.autoOutdent(T,u,F)}},f.prototype.onTextInput=function(u,p){if(!p)return this.keyBinding.onTextInput(u);this.startOperation({command:{name:"insertstring"}});var L=this.applyComposition.bind(this,u,p);this.selection.rangeCount?this.forEachSelection(L):L(),this.endOperation()},f.prototype.applyComposition=function(u,p){if(p.extendLeft||p.extendRight){var L=this.selection.getRange();L.start.column-=p.extendLeft,L.end.column+=p.extendRight,L.start.column<0&&(L.start.row--,L.start.column+=this.session.getLine(L.start.row).length+1),this.selection.setRange(L),!u&&!L.isEmpty()&&this.remove()}if((u||!this.selection.isEmpty())&&this.insert(u,!0),p.restoreStart||p.restoreEnd){var L=this.selection.getRange();L.start.column-=p.restoreStart,L.end.column-=p.restoreEnd,this.selection.setRange(L)}},f.prototype.onCommandKey=function(u,p,L){return this.keyBinding.onCommandKey(u,p,L)},f.prototype.setOverwrite=function(u){this.session.setOverwrite(u)},f.prototype.getOverwrite=function(){return this.session.getOverwrite()},f.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},f.prototype.setScrollSpeed=function(u){this.setOption("scrollSpeed",u)},f.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},f.prototype.setDragDelay=function(u){this.setOption("dragDelay",u)},f.prototype.getDragDelay=function(){return this.getOption("dragDelay")},f.prototype.setSelectionStyle=function(u){this.setOption("selectionStyle",u)},f.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},f.prototype.setHighlightActiveLine=function(u){this.setOption("highlightActiveLine",u)},f.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},f.prototype.setHighlightGutterLine=function(u){this.setOption("highlightGutterLine",u)},f.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},f.prototype.setHighlightSelectedWord=function(u){this.setOption("highlightSelectedWord",u)},f.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},f.prototype.setAnimatedScroll=function(u){this.renderer.setAnimatedScroll(u)},f.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},f.prototype.setShowInvisibles=function(u){this.renderer.setShowInvisibles(u)},f.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},f.prototype.setDisplayIndentGuides=function(u){this.renderer.setDisplayIndentGuides(u)},f.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},f.prototype.setHighlightIndentGuides=function(u){this.renderer.setHighlightIndentGuides(u)},f.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},f.prototype.setShowPrintMargin=function(u){this.renderer.setShowPrintMargin(u)},f.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},f.prototype.setPrintMarginColumn=function(u){this.renderer.setPrintMarginColumn(u)},f.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},f.prototype.setReadOnly=function(u){this.setOption("readOnly",u)},f.prototype.getReadOnly=function(){return this.getOption("readOnly")},f.prototype.setBehavioursEnabled=function(u){this.setOption("behavioursEnabled",u)},f.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},f.prototype.setWrapBehavioursEnabled=function(u){this.setOption("wrapBehavioursEnabled",u)},f.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},f.prototype.setShowFoldWidgets=function(u){this.setOption("showFoldWidgets",u)},f.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},f.prototype.setFadeFoldWidgets=function(u){this.setOption("fadeFoldWidgets",u)},f.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},f.prototype.remove=function(u){this.selection.isEmpty()&&(u=="left"?this.selection.selectLeft():this.selection.selectRight());var p=this.getSelectionRange();if(this.getBehavioursEnabled()){var L=this.session,T=L.getState(p.start.row),_=L.getMode().transformAction(T,"deletion",this,L,p);if(p.end.column===0){var I=L.getTextRange(p);if(I[I.length-1]==`
215
- `){var O=L.getLine(p.end.row);/^\s+$/.test(O)&&(p.end.column=O.length)}}_&&(p=_)}this.session.remove(p),this.clearSelection()},f.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},f.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},f.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},f.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var u=this.getSelectionRange();u.start.column==u.end.column&&u.start.row==u.end.row&&(u.end.column=0,u.end.row++),this.session.remove(u),this.clearSelection()},f.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var u=this.getCursorPosition();this.insert(`
216
- `),this.moveCursorToPosition(u)},f.prototype.setGhostText=function(u,p){this.renderer.setGhostText(u,p)},f.prototype.removeGhostText=function(){this.renderer.removeGhostText()},f.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var u=this.getCursorPosition(),p=u.column;if(p!==0){var L=this.session.getLine(u.row),T,_;p<L.length?(T=L.charAt(p)+L.charAt(p-1),_=new s(u.row,p-1,u.row,p+1)):(T=L.charAt(p-1)+L.charAt(p-2),_=new s(u.row,p-2,u.row,p)),this.session.replace(_,T),this.session.selection.moveToPosition(_.end)}}},f.prototype.toLowerCase=function(){var u=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var p=this.getSelectionRange(),L=this.session.getTextRange(p);this.session.replace(p,L.toLowerCase()),this.selection.setSelectionRange(u)},f.prototype.toUpperCase=function(){var u=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var p=this.getSelectionRange(),L=this.session.getTextRange(p);this.session.replace(p,L.toUpperCase()),this.selection.setSelectionRange(u)},f.prototype.indent=function(){var u=this.session,p=this.getSelectionRange();if(p.start.row<p.end.row){var L=this.$getSelectedRows();u.indentRows(L.first,L.last," ");return}else if(p.start.column<p.end.column){var T=u.getTextRange(p);if(!/^\s+$/.test(T)){var L=this.$getSelectedRows();u.indentRows(L.first,L.last," ");return}}var _=u.getLine(p.start.row),I=p.start,O=u.getTabSize(),z=u.documentToScreenColumn(I.row,I.column);if(this.session.getUseSoftTabs())var D=O-z%O,N=a.stringRepeat(" ",D);else{for(var D=z%O;_[p.start.column-1]==" "&&D;)p.start.column--,D--;this.selection.setSelectionRange(p),N=" "}return this.insert(N)},f.prototype.blockIndent=function(){var u=this.$getSelectedRows();this.session.indentRows(u.first,u.last," ")},f.prototype.blockOutdent=function(){var u=this.session.getSelection();this.session.outdentRows(u.getRange())},f.prototype.sortLines=function(){for(var u=this.$getSelectedRows(),p=this.session,L=[],T=u.first;T<=u.last;T++)L.push(p.getLine(T));L.sort(function(O,z){return O.toLowerCase()<z.toLowerCase()?-1:O.toLowerCase()>z.toLowerCase()?1:0});for(var _=new s(0,0,0,0),T=u.first;T<=u.last;T++){var I=p.getLine(T);_.start.row=T,_.end.row=T,_.end.column=I.length,p.replace(_,L[T-u.first])}},f.prototype.toggleCommentLines=function(){var u=this.session.getState(this.getCursorPosition().row),p=this.$getSelectedRows();this.session.getMode().toggleCommentLines(u,this.session,p.first,p.last)},f.prototype.toggleBlockComment=function(){var u=this.getCursorPosition(),p=this.session.getState(u.row),L=this.getSelectionRange();this.session.getMode().toggleBlockComment(p,this.session,L,u)},f.prototype.getNumberAt=function(u,p){var L=/[\-]?[0-9]+(?:\.[0-9]+)?/g;L.lastIndex=0;for(var T=this.session.getLine(u);L.lastIndex<p;){var _=L.exec(T);if(_.index<=p&&_.index+_[0].length>=p){var I={value:_[0],start:_.index,end:_.index+_[0].length};return I}}return null},f.prototype.modifyNumber=function(u){var p=this.selection.getCursor().row,L=this.selection.getCursor().column,T=new s(p,L-1,p,L),_=this.session.getTextRange(T);if(!isNaN(parseFloat(_))&&isFinite(_)){var I=this.getNumberAt(p,L);if(I){var O=I.value.indexOf(".")>=0?I.start+I.value.indexOf(".")+1:I.end,z=I.start+I.value.length-O,D=parseFloat(I.value);D*=Math.pow(10,z),O!==I.end&&L<O?u*=Math.pow(10,I.end-L-1):u*=Math.pow(10,I.end-L),D+=u,D/=Math.pow(10,z);var N=D.toFixed(z),F=new s(p,I.start,p,I.end);this.session.replace(F,N),this.moveCursorTo(p,Math.max(I.start+1,L+N.length-I.value.length))}}else this.toggleWord()},f.prototype.toggleWord=function(){var u=this.selection.getCursor().row,p=this.selection.getCursor().column;this.selection.selectWord();var L=this.getSelectedText(),T=this.selection.getWordRange().start.column,_=L.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),I=p-T-1;I<0&&(I=0);var O=0,z=0,D=this;L.match(/[A-Za-z0-9_]+/)&&_.forEach(function(Q,X){z=O+Q.length,I>=O&&I<=z&&(L=Q,D.selection.clearSelection(),D.moveCursorTo(u,O+T),D.selection.selectTo(u,z+T)),O=z});for(var N=this.$toggleWordPairs,F,B=0;B<N.length;B++)for(var P=N[B],V=0;V<=1;V++){var G=+!V,j=L.match(new RegExp("^\\s?_?("+a.escapeRegExp(P[V])+")\\s?$","i"));if(j){var K=L.match(new RegExp("([_]|^|\\s)("+a.escapeRegExp(j[1])+")($|\\s)","g"));K&&(F=L.replace(new RegExp(a.escapeRegExp(P[V]),"i"),function(Q){var X=P[G];return Q.toUpperCase()==Q?X=X.toUpperCase():Q.charAt(0).toUpperCase()==Q.charAt(0)&&(X=X.substr(0,0)+P[G].charAt(0).toUpperCase()+X.substr(1)),X}),this.insert(F),F="")}}},f.prototype.findLinkAt=function(u,p){var L,T,_=this.session.getLine(u),I=_.split(/((?:https?|ftp):\/\/[\S]+)/),O=p;O<0&&(O=0);var z=0,D=0,N;try{for(var F=E(I),B=F.next();!B.done;B=F.next()){var P=B.value;if(D=z+P.length,O>=z&&O<=D&&P.match(/((?:https?|ftp):\/\/[\S]+)/)){N=P.replace(/[\s:.,'";}\]]+$/,"");break}z=D}}catch(V){L={error:V}}finally{try{B&&!B.done&&(T=F.return)&&T.call(F)}finally{if(L)throw L.error}}return N},f.prototype.openLink=function(){var u=this.selection.getCursor(),p=this.findLinkAt(u.row,u.column);return p&&window.open(p,"_blank"),p!=null},f.prototype.removeLines=function(){var u=this.$getSelectedRows();this.session.removeFullLines(u.first,u.last),this.clearSelection()},f.prototype.duplicateSelection=function(){var u=this.selection,p=this.session,L=u.getRange(),T=u.isBackwards();if(L.isEmpty()){var _=L.start.row;p.duplicateLines(_,_)}else{var I=T?L.start:L.end,O=p.insert(I,p.getTextRange(L));L.start=I,L.end=O,u.setSelectionRange(L,T)}},f.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},f.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},f.prototype.moveText=function(u,p,L){return this.session.moveText(u,p,L)},f.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},f.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},f.prototype.$moveLines=function(u,p){var L,T,_=this.selection;if(!_.inMultiSelectMode||this.inVirtualSelectionMode){var I=_.toOrientedRange();L=this.$getSelectedRows(I),T=this.session.$moveLines(L.first,L.last,p?0:u),p&&u==-1&&(T=0),I.moveBy(T,0),_.fromOrientedRange(I)}else{var O=_.rangeList.ranges;_.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var z=0,D=0,N=O.length,F=0;F<N;F++){var B=F;O[F].moveBy(z,0),L=this.$getSelectedRows(O[F]);for(var P=L.first,V=L.last;++F<N;){D&&O[F].moveBy(D,0);var G=this.$getSelectedRows(O[F]);if(p&&G.first!=V)break;if(!p&&G.first>V+1)break;V=G.last}for(F--,z=this.session.$moveLines(P,V,p?0:u),p&&u==-1&&(B=F+1);B<=F;)O[B].moveBy(z,0),B++;p||(z=0),D+=z}_.fromOrientedRange(_.ranges[0]),_.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},f.prototype.$getSelectedRows=function(u){return u=(u||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(u.start.row),last:this.session.getRowFoldEnd(u.end.row)}},f.prototype.onCompositionStart=function(u){this.renderer.showComposition(u)},f.prototype.onCompositionUpdate=function(u){this.renderer.setCompositionText(u)},f.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},f.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},f.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},f.prototype.isRowVisible=function(u){return u>=this.getFirstVisibleRow()&&u<=this.getLastVisibleRow()},f.prototype.isRowFullyVisible=function(u){return u>=this.renderer.getFirstFullyVisibleRow()&&u<=this.renderer.getLastFullyVisibleRow()},f.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},f.prototype.$moveByPage=function(u,p){var L=this.renderer,T=this.renderer.layerConfig,_=u*Math.floor(T.height/T.lineHeight);p===!0?this.selection.$moveSelection(function(){this.moveCursorBy(_,0)}):p===!1&&(this.selection.moveCursorBy(_,0),this.selection.clearSelection());var I=L.scrollTop;L.scrollBy(0,_*T.lineHeight),p!=null&&L.scrollCursorIntoView(null,.5),L.animateScrolling(I)},f.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},f.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},f.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},f.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},f.prototype.scrollPageDown=function(){this.$moveByPage(1)},f.prototype.scrollPageUp=function(){this.$moveByPage(-1)},f.prototype.scrollToRow=function(u){this.renderer.scrollToRow(u)},f.prototype.scrollToLine=function(u,p,L,T){this.renderer.scrollToLine(u,p,L,T)},f.prototype.centerSelection=function(){var u=this.getSelectionRange(),p={row:Math.floor(u.start.row+(u.end.row-u.start.row)/2),column:Math.floor(u.start.column+(u.end.column-u.start.column)/2)};this.renderer.alignCursor(p,.5)},f.prototype.getCursorPosition=function(){return this.selection.getCursor()},f.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},f.prototype.getSelectionRange=function(){return this.selection.getRange()},f.prototype.selectAll=function(){this.selection.selectAll()},f.prototype.clearSelection=function(){this.selection.clearSelection()},f.prototype.moveCursorTo=function(u,p){this.selection.moveCursorTo(u,p)},f.prototype.moveCursorToPosition=function(u){this.selection.moveCursorToPosition(u)},f.prototype.jumpToMatching=function(u,p){var L=this.getCursorPosition(),T=new g(this.session,L.row,L.column),_=T.getCurrentToken(),I=0;_&&_.type.indexOf("tag-name")!==-1&&(_=T.stepBackward());var O=_||T.stepForward();if(O){var z,D=!1,N={},F=L.column-O.start,B,P={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(O.value.match(/[{}()\[\]]/g)){for(;F<O.value.length&&!D;F++)if(P[O.value[F]])switch(B=P[O.value[F]]+"."+O.type.replace("rparen","lparen"),isNaN(N[B])&&(N[B]=0),O.value[F]){case"(":case"[":case"{":N[B]++;break;case")":case"]":case"}":N[B]--,N[B]===-1&&(z="bracket",D=!0);break}}else O.type.indexOf("tag-name")!==-1&&(isNaN(N[O.value])&&(N[O.value]=0),_.value==="<"&&I>1?N[O.value]++:_.value==="</"&&N[O.value]--,N[O.value]===-1&&(z="tag",D=!0));D||(_=O,I++,O=T.stepForward(),F=0)}while(O&&!D);if(z){var V,G;if(z==="bracket")V=this.session.getBracketRange(L),V||(V=new s(T.getCurrentTokenRow(),T.getCurrentTokenColumn()+F-1,T.getCurrentTokenRow(),T.getCurrentTokenColumn()+F-1),G=V.start,(p||G.row===L.row&&Math.abs(G.column-L.column)<2)&&(V=this.session.getBracketRange(G)));else if(z==="tag"){if(!O||O.type.indexOf("tag-name")===-1)return;if(V=new s(T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2,T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2),V.compare(L.row,L.column)===0){var j=this.session.getMatchingTags(L);j&&(j.openTag.contains(L.row,L.column)?(V=j.closeTag,G=V.start):(V=j.openTag,j.closeTag.start.row===L.row&&j.closeTag.start.column===L.column?G=V.end:G=V.start))}G=G||V.start}G=V&&V.cursor||G,G&&(u?V&&p?this.selection.setRange(V):V&&V.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(G.row,G.column):this.selection.moveTo(G.row,G.column))}}},f.prototype.gotoLine=function(u,p,L){this.selection.clearSelection(),this.session.unfold({row:u-1,column:p||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(u-1,p||0),this.isRowFullyVisible(u-1)||this.scrollToLine(u-1,!0,L)},f.prototype.navigateTo=function(u,p){this.selection.moveTo(u,p)},f.prototype.navigateUp=function(u){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var p=this.selection.anchor.getPosition();return this.moveCursorToPosition(p)}this.selection.clearSelection(),this.selection.moveCursorBy(-u||-1,0)},f.prototype.navigateDown=function(u){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var p=this.selection.anchor.getPosition();return this.moveCursorToPosition(p)}this.selection.clearSelection(),this.selection.moveCursorBy(u||1,0)},f.prototype.navigateLeft=function(u){if(this.selection.isEmpty())for(u=u||1;u--;)this.selection.moveCursorLeft();else{var p=this.getSelectionRange().start;this.moveCursorToPosition(p)}this.clearSelection()},f.prototype.navigateRight=function(u){if(this.selection.isEmpty())for(u=u||1;u--;)this.selection.moveCursorRight();else{var p=this.getSelectionRange().end;this.moveCursorToPosition(p)}this.clearSelection()},f.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},f.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},f.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},f.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},f.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},f.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},f.prototype.replace=function(u,p){p&&this.$search.set(p);var L=this.$search.find(this.session),T=0;return L&&(this.$tryReplace(L,u)&&(T=1),this.selection.setSelectionRange(L),this.renderer.scrollSelectionIntoView(L.start,L.end)),T},f.prototype.replaceAll=function(u,p){p&&this.$search.set(p);var L=this.$search.findAll(this.session),T=0;if(!L.length)return T;var _=this.getSelectionRange();this.selection.moveTo(0,0);for(var I=L.length-1;I>=0;--I)this.$tryReplace(L[I],u)&&T++;return this.selection.setSelectionRange(_),T},f.prototype.$tryReplace=function(u,p){var L=this.session.getTextRange(u);return p=this.$search.replace(L,p),p!==null?(u.end=this.session.replace(u,p),u):null},f.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},f.prototype.find=function(u,p,L){p||(p={}),typeof u=="string"||u instanceof RegExp?p.needle=u:typeof u=="object"&&A.mixin(p,u);var T=this.selection.getRange();p.needle==null&&(u=this.session.getTextRange(T)||this.$search.$options.needle,u||(T=this.session.getWordRange(T.start.row,T.start.column),u=this.session.getTextRange(T)),this.$search.set({needle:u})),this.$search.set(p),p.start||this.$search.set({start:T});var _=this.$search.find(this.session);if(p.preventScroll)return _;if(_)return this.revealRange(_,L),_;p.backwards?T.start=T.end:T.end=T.start,this.selection.setRange(T)},f.prototype.findNext=function(u,p){this.find({skipCurrent:!0,backwards:!1},u,p)},f.prototype.findPrevious=function(u,p){this.find(u,{skipCurrent:!0,backwards:!0},p)},f.prototype.revealRange=function(u,p){this.session.unfold(u),this.selection.setSelectionRange(u);var L=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(u.start,u.end,.5),p!==!1&&this.renderer.animateScrolling(L)},f.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},f.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},f.prototype.destroy=function(){this.destroyed=!0,this.$toDestroy&&(this.$toDestroy.forEach(function(u){u.destroy()}),this.$toDestroy=[]),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},f.prototype.setAutoScrollEditorIntoView=function(u){if(u){var p,L=this,T=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var _=this.$scrollAnchor;_.style.cssText="position:absolute",this.container.insertBefore(_,this.container.firstChild);var I=this.on("changeSelection",function(){T=!0}),O=this.renderer.on("beforeRender",function(){T&&(p=L.renderer.container.getBoundingClientRect())}),z=this.renderer.on("afterRender",function(){if(T&&p&&(L.isFocused()||L.searchBox&&L.searchBox.isFocused())){var D=L.renderer,N=D.$cursorLayer.$pixelPos,F=D.layerConfig,B=N.top-F.offset;N.top>=0&&B+p.top<0?T=!0:N.top<F.height&&N.top+p.top+F.lineHeight>window.innerHeight?T=!1:T=null,T!=null&&(_.style.top=B+"px",_.style.left=N.left+"px",_.style.height=F.lineHeight+"px",_.scrollIntoView(T)),T=p=null}});this.setAutoScrollEditorIntoView=function(D){D||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",I),this.renderer.off("afterRender",z),this.renderer.off("beforeRender",O))}}},f.prototype.$resetCursorStyle=function(){var u=this.$cursorStyle||"ace",p=this.renderer.$cursorLayer;p&&(p.setSmoothBlinking(/smooth/.test(u)),p.isBlinking=!this.$readOnly&&u!="wide",$.setCssClass(p.element,"ace_slim-cursors",/slim/.test(u)))},f.prototype.prompt=function(u,p,L){var T=this;m.loadModule("ace/ext/prompt",function(_){_.prompt(T,u,p,L)})},f}();w.$uid=0,w.prototype.curOp=null,w.prototype.prevOp={},w.prototype.$mergeableCommands=["backspace","del","insertstring"],w.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"],["&&","||"],["==","!="]],A.implement(w.prototype,l),m.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(f){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:f})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(f){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(f){var u=this;if(this.textInput.setReadOnly(f),!this.destroyed){this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(L){var T=!1;if(L&&L.type=="keydown"){if(L&&L.key&&!L.ctrlKey&&!L.metaKey&&(L.key==" "&&L.preventDefault(),T=L.key.length==1),!T)return}else L&&L.type!=="exec"&&(T=!0);if(T){u.hoverTooltip||(u.hoverTooltip=new R);var _=$.createElement("div");_.textContent=b("editor.tooltip.disable-editing","Editing is disabled"),u.hoverTooltip.isOpen||u.hoverTooltip.showForRange(u,u.getSelectionRange(),_)}else u.hoverTooltip&&u.hoverTooltip.isOpen&&u.hoverTooltip.hide()});var p=this.textInput.getElement();f?(S.addListener(p,"keydown",this.$readOnlyCallback,this),this.commands.on("exec",this.$readOnlyCallback),this.commands.on("commandUnavailable",this.$readOnlyCallback)):(S.removeListener(p,"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(f){this.textInput.setCopyWithEmptySelection(f)},initialValue:!1},cursorStyle:{set:function(f){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(f){this.setAutoScrollEditorIntoView(f)}},keyboardHandler:{set:function(f){this.setKeyboardHandler(f)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(f){this.session.setValue(f)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(f){this.setSession(f)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(f){this.renderer.$gutterLayer.setShowLineNumbers(f),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),f&&this.$relativeLineNumbers?y.attach(this):y.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(f){this.$showLineNumbers&&f?y.attach(this):y.detach(this)}},placeholder:{set:function(f){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var u=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(u&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),$.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!u&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),$.addCssClass(this.container,"ace_hasPlaceholder");var p=$.createElement("div");p.className="ace_placeholder",p.textContent=this.$placeholder||"",this.renderer.placeholderNode=p,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!u&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(f){var u={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(T){T.blur(),T.renderer.scroller.focus()},readOnly:!0},p=function(T){if(T.target==this.renderer.scroller&&T.keyCode===C.enter){T.preventDefault();var _=this.getCursorPosition().row;this.isRowVisible(_)||this.scrollToLine(_,!0,!0),this.focus()}},L;f?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(c.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",b("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",b("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",p.bind(this)),this.commands.addCommand(u),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",b("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",b("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),L||(L=new d(this)),L.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",p.bind(this)),this.commands.removeCommand(u),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),L&&L.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(f){this.$textInputAriaLabel=f},initialValue:""},enableMobileMenu:{set:function(f){this.$enableMobileMenu=f},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 y={getText:function(f,u){return(Math.abs(f.selection.lead.row-u)||u+1+(u<9?"·":""))+""},getWidth:function(f,u,p){return Math.max(u.toString().length,(p.lastRow+1).toString().length,2)*p.characterWidth},update:function(f,u){u.renderer.$loop.schedule(u.renderer.CHANGE_GUTTER)},attach:function(f){f.renderer.$gutterLayer.$renderer=this,f.on("changeSelection",this.update),this.update(null,f)},detach:function(f){f.renderer.$gutterLayer.$renderer==this&&(f.renderer.$gutterLayer.$renderer=null),f.off("changeSelection",this.update),this.update(null,f)}};x.Editor=w}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(k,x,H){var E=k("../lib/dom"),A=function(){function $(a,c){this.element=a,this.canvasHeight=c||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return $.prototype.moveContainer=function(a){E.translate(this.element,0,-(a.firstRowScreen*a.lineHeight%this.canvasHeight)-a.offset*this.$offsetCoefficient)},$.prototype.pageChanged=function(a,c){return Math.floor(a.firstRowScreen*a.lineHeight/this.canvasHeight)!==Math.floor(c.firstRowScreen*c.lineHeight/this.canvasHeight)},$.prototype.computeLineTop=function(a,c,i){var o=c.firstRowScreen*c.lineHeight,n=Math.floor(o/this.canvasHeight),t=i.documentToScreenRow(a,0)*c.lineHeight;return t-n*this.canvasHeight},$.prototype.computeLineHeight=function(a,c,i){return c.lineHeight*i.getRowLineCount(a)},$.prototype.getLength=function(){return this.cells.length},$.prototype.get=function(a){return this.cells[a]},$.prototype.shift=function(){this.$cacheCell(this.cells.shift())},$.prototype.pop=function(){this.$cacheCell(this.cells.pop())},$.prototype.push=function(a){if(Array.isArray(a)){this.cells.push.apply(this.cells,a);for(var c=E.createFragment(this.element),i=0;i<a.length;i++)c.appendChild(a[i].element);this.element.appendChild(c)}else this.cells.push(a),this.element.appendChild(a.element)},$.prototype.unshift=function(a){if(Array.isArray(a)){this.cells.unshift.apply(this.cells,a);for(var c=E.createFragment(this.element),i=0;i<a.length;i++)c.appendChild(a[i].element);this.element.firstChild?this.element.insertBefore(c,this.element.firstChild):this.element.appendChild(c)}else this.cells.unshift(a),this.element.insertAdjacentElement("afterbegin",a.element)},$.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},$.prototype.$cacheCell=function(a){a&&(a.element.remove(),this.cellCache.push(a))},$.prototype.createCell=function(a,c,i,o){var n=this.cellCache.pop();if(!n){var t=E.createElement("div");o&&o(t),this.element.appendChild(t),n={element:t,text:"",row:a}}return n.row=a,n},$}();x.Lines=A}),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(k,x,H){var E=k("../lib/dom"),A=k("../lib/oop"),$=k("../lib/lang"),a=k("../lib/event_emitter").EventEmitter,c=k("./lines").Lines,i=k("../config").nls,o=function(){function t(e){this.element=E.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new c(this.element),this.$lines.$offsetCoefficient=1}return t.prototype.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},t.prototype.addGutterDecoration=function(e,r){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,r)},t.prototype.removeGutterDecoration=function(e,r){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,r)},t.prototype.setAnnotations=function(e){this.$annotations=[];for(var r=0;r<e.length;r++){var s=e[r],l=s.row,h=this.$annotations[l];h||(h=this.$annotations[l]={text:[],type:[],displayText:[]});var v=s.text,m=s.text,g=s.type;v=v?$.escapeHTML(v):s.html||"",m=m||s.html||"",h.text.indexOf(v)===-1&&(h.text.push(v),h.type.push(g),h.displayText.push(m));var d=s.className;d?h.className=d:g==="error"?h.className=" ace_error":g==="security"&&!/\bace_error\b/.test(h.className)?h.className=" ace_security":g==="warning"&&!/\bace_(error|security)\b/.test(h.className)?h.className=" ace_warning":g==="info"&&!h.className?h.className=" ace_info":g==="hint"&&!h.className&&(h.className=" ace_hint")}},t.prototype.$updateAnnotations=function(e){if(this.$annotations.length){var r=e.start.row,s=e.end.row-r;if(s!==0)if(e.action=="remove")this.$annotations.splice(r,s+1,null);else{var l=new Array(s+1);l.unshift(r,1),this.$annotations.splice.apply(this.$annotations,l)}}},t.prototype.update=function(e){this.config=e;var r=this.session,s=e.firstRow,l=Math.min(e.lastRow+e.gutterOffset,r.getLength()-1);this.oldLastRow=l,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var h=r.getNextFoldLine(s),v=h?h.start.row:1/0,m=null,g=-1,d=s;;){if(d>v&&(d=h.end.row+1,h=r.getNextFoldLine(d,h),v=h?h.start.row:1/0),d>l){for(;this.$lines.getLength()>g+1;)this.$lines.pop();break}m=this.$lines.get(++g),m?m.row=d:(m=this.$lines.createCell(d,e,this.session,n),this.$lines.push(m)),this.$renderCell(m,e,h,d),d++}this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$updateGutterWidth=function(e){var r=this.session,s=r.gutterRenderer||this.$renderer,l=r.$firstLineNumber,h=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||r.$useWrapMode)&&(h=r.getLength()+l-1);var v=s?s.getWidth(r,h,e):h.toString().length*e.characterWidth,m=this.$padding||this.$computePadding();v+=m.left+m.right,v!==this.gutterWidth&&!isNaN(v)&&(this.gutterWidth=v,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",v))},t.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},t.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!(this.$cursorCell&&this.$cursorCell.row==e)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var r=this.$lines.cells;this.$cursorCell=null;for(var s=0;s<r.length;s++){var l=r[s];if(l.row>=this.$cursorRow){if(l.row>this.$cursorRow){var h=this.session.getFoldLine(this.$cursorRow);if(s>0&&h&&h.start.row==r[s-1].row)l=r[s-1];else break}l.element.className="ace_gutter-active-line "+l.element.className,this.$cursorCell=l;break}}}}},t.prototype.scrollLines=function(e){var r=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(r,e))return this.update(e);this.$lines.moveContainer(e);var s=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),l=this.oldLastRow;if(this.oldLastRow=s,!r||l<e.firstRow)return this.update(e);if(s<r.firstRow)return this.update(e);if(r.firstRow<e.firstRow)for(var h=this.session.getFoldedRowCount(r.firstRow,e.firstRow-1);h>0;h--)this.$lines.shift();if(l>s)for(var h=this.session.getFoldedRowCount(s+1,l);h>0;h--)this.$lines.pop();e.firstRow<r.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,r.firstRow-1)),s>l&&this.$lines.push(this.$renderLines(e,l+1,s)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$renderLines=function(e,r,s){for(var l=[],h=r,v=this.session.getNextFoldLine(h),m=v?v.start.row:1/0;h>m&&(h=v.end.row+1,v=this.session.getNextFoldLine(h,v),m=v?v.start.row:1/0),!(h>s);){var g=this.$lines.createCell(h,e,this.session,n);this.$renderCell(g,e,v,h),l.push(g),h++}return l},t.prototype.$renderCell=function(e,r,s,l){var h=e.element,v=this.session,m=h.childNodes[0],g=h.childNodes[1],d=h.childNodes[2],b=h.childNodes[3],M=d.firstChild,C=v.$firstLineNumber,S=v.$breakpoints,R=v.$decorations,w=v.gutterRenderer||this.$renderer,y=this.$showFoldWidgets&&v.foldWidgets,f=s?s.start.row:Number.MAX_VALUE,u=r.lineHeight+"px",p=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",L=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",T=(w?w.getText(v,l):l+C).toString();if(this.$highlightGutterLine&&(l==this.$cursorRow||s&&l<this.$cursorRow&&l>=f&&this.$cursorRow<=s.end.row)&&(p+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),S[l]&&(p+=S[l]),R[l]&&(p+=R[l]),this.$annotations[l]&&l!==f&&(p+=this.$annotations[l].className),y){var _=y[l];_==null&&(_=y[l]=v.getFoldWidget(l))}if(_){var I="ace_fold-widget ace_"+_,O=_=="start"&&l==f&&l<s.end.row;if(O){I+=" ace_closed";for(var z="",D=!1,N=l+1;N<=s.end.row;N++)if(this.$annotations[N]){if(this.$annotations[N].className===" ace_error"){D=!0,z=" ace_error_fold";break}this.$annotations[N].className===" ace_security"?(D=!0,z=" ace_security_fold"):this.$annotations[N].className===" ace_warning"&&z!==" ace_security_fold"&&(D=!0,z=" ace_warning_fold")}p+=z}else I+=" ace_open";g.className!=I&&(g.className=I),E.setStyle(g.style,"height",u),E.setStyle(g.style,"display","inline-block"),g.setAttribute("role","button"),g.setAttribute("tabindex","-1");var F=v.getFoldWidgetRange(l);F?g.setAttribute("aria-label",i("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[F.start.row+1,F.end.row+1])):s?g.setAttribute("aria-label",i("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[s.start.row+1,s.end.row+1])):g.setAttribute("aria-label",i("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[l+1])),O?(g.setAttribute("aria-expanded","false"),g.setAttribute("title",i("gutter.code-folding.closed.title","Unfold code"))):(g.setAttribute("aria-expanded","true"),g.setAttribute("title",i("gutter.code-folding.open.title","Fold code")))}else g&&(E.setStyle(g.style,"display","none"),g.setAttribute("tabindex","0"),g.removeAttribute("role"),g.removeAttribute("aria-label"));var B=this.session.$gutterCustomWidgets[l];if(B?this.$addCustomWidget(l,B,e):b&&this.$removeCustomWidget(l,e),D&&this.$showFoldedAnnotations){d.className="ace_gutter_annotation",M.className=L,M.className+=z,E.setStyle(M.style,"height",u),E.setStyle(d.style,"display","block"),E.setStyle(d.style,"height",u);var P;switch(z){case" ace_error_fold":P=i("gutter.annotation.aria-label.error","Error, read annotations row $0",[T]);break;case" ace_security_fold":P=i("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[T]);break;case" ace_warning_fold":P=i("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[T]);break}d.setAttribute("aria-label",P),d.setAttribute("tabindex","-1"),d.setAttribute("role","button")}else if(this.$annotations[l]){d.className="ace_gutter_annotation",M.className=L,this.$useSvgGutterIcons?M.className+=this.$annotations[l].className:h.classList.add(this.$annotations[l].className.replace(" ","")),E.setStyle(M.style,"height",u),E.setStyle(d.style,"display","block"),E.setStyle(d.style,"height",u);var P;switch(this.$annotations[l].className){case" ace_error":P=i("gutter.annotation.aria-label.error","Error, read annotations row $0",[T]);break;case" ace_security":P=i("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[T]);break;case" ace_warning":P=i("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[T]);break;case" ace_info":P=i("gutter.annotation.aria-label.info","Info, read annotations row $0",[T]);break;case" ace_hint":P=i("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[T]);break}d.setAttribute("aria-label",P),d.setAttribute("tabindex","-1"),d.setAttribute("role","button")}else E.setStyle(d.style,"display","none"),d.removeAttribute("aria-label"),d.removeAttribute("role"),d.setAttribute("tabindex","0");return T!==m.data&&(m.data=T),h.className!=p&&(h.className=p),E.setStyle(e.element.style,"height",this.$lines.computeLineHeight(l,r,v)+"px"),E.setStyle(e.element.style,"top",this.$lines.computeLineTop(l,r,v)+"px"),e.text=T,d.style.display==="none"&&g.style.display==="none"&&!B?e.element.setAttribute("aria-hidden",!0):e.element.setAttribute("aria-hidden",!1),e},t.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},t.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},t.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},t.prototype.setShowFoldWidgets=function(e){e?E.addCssClass(this.element,"ace_folding-enabled"):E.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},t.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},t.prototype.$hideFoldWidget=function(e,r){var s=r||this.$getGutterCell(e);if(s&&s.element){var l=s.element.childNodes[1];l&&E.setStyle(l.style,"display","none")}},t.prototype.$showFoldWidget=function(e,r){var s=r||this.$getGutterCell(e);if(s&&s.element){var l=s.element.childNodes[1];l&&this.session.foldWidgets&&this.session.foldWidgets[s.row]&&E.setStyle(l.style,"display","inline-block")}},t.prototype.$getGutterCell=function(e){var r=this.$lines.cells,s=this.session.documentToScreenRow(e,0);return r[e-this.config.firstRowScreen-(e-s)]},t.prototype.$addCustomWidget=function(e,r,s){var l=r.className,h=r.label,v=r.title,m=r.callbacks;this.session.$gutterCustomWidgets[e]={className:l,label:h,title:v,callbacks:m},this.$hideFoldWidget(e,s);var g=s||this.$getGutterCell(e);if(g&&g.element){var d=g.element.querySelector(".ace_custom-widget");d&&d.remove(),d=E.createElement("span"),d.className="ace_custom-widget ".concat(l),d.setAttribute("tabindex","-1"),d.setAttribute("role","button"),d.setAttribute("aria-label",h),d.setAttribute("title",v),E.setStyle(d.style,"display","inline-block"),E.setStyle(d.style,"height","inherit"),m&&m.onClick&&d.addEventListener("click",function(b){m.onClick(b,e),b.stopPropagation()}),g.element.appendChild(d)}},t.prototype.$removeCustomWidget=function(e,r){delete this.session.$gutterCustomWidgets[e],this.$showFoldWidget(e,r);var s=r||this.$getGutterCell(e);if(s&&s.element){var l=s.element.querySelector(".ace_custom-widget");l&&s.element.removeChild(l)}},t.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=E.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},t.prototype.getRegion=function(e){var r=this.$padding||this.$computePadding(),s=this.element.getBoundingClientRect();if(e.x<r.left+s.left)return"markers";if(this.$showFoldWidgets&&e.x>s.right-r.right)return"foldWidgets"},t}();o.prototype.$fixedWidth=!1,o.prototype.$highlightGutterLine=!0,o.prototype.$renderer="",o.prototype.$showLineNumbers=!0,o.prototype.$showFoldWidgets=!0,A.implement(o.prototype,a);function n(t){var e=document.createTextNode("");t.appendChild(e);var r=E.createElement("span");t.appendChild(r);var s=E.createElement("span");t.appendChild(s);var l=E.createElement("span");return s.appendChild(l),t}x.Gutter=o}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(k,x,H){var E=k("../range").Range,A=k("../lib/dom"),$=function(){function c(i){this.element=A.createElement("div"),this.element.className="ace_layer ace_marker-layer",i.appendChild(this.element)}return c.prototype.setPadding=function(i){this.$padding=i},c.prototype.setSession=function(i){this.session=i},c.prototype.setMarkers=function(i){this.markers=i},c.prototype.elt=function(i,o){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=o,n.className=i},c.prototype.update=function(i){if(i){this.config=i,this.i=0;var o;for(var n in this.markers){var t=this.markers[n];if(!t.range){t.update(o,this,this.session,i);continue}var e=t.range.clipRows(i.firstRow,i.lastRow);if(!e.isEmpty())if(e=e.toScreenRange(this.session),t.renderer){var r=this.$getTop(e.start.row,i),s=this.$padding+e.start.column*i.characterWidth;t.renderer(o,e,s,r,i)}else t.type=="fullLine"?this.drawFullLineMarker(o,e,t.clazz,i):t.type=="screenLine"?this.drawScreenLineMarker(o,e,t.clazz,i):e.isMultiLine()?t.type=="text"?this.drawTextMarker(o,e,t.clazz,i):this.drawMultiLineMarker(o,e,t.clazz,i):this.drawSingleLineMarker(o,e,t.clazz+" ace_start ace_br15",i)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},c.prototype.$getTop=function(i,o){return(i-o.firstRowScreen)*o.lineHeight},c.prototype.drawTextMarker=function(i,o,n,t,e){for(var r=this.session,s=o.start.row,l=o.end.row,h=s,v=0,m=0,g=r.getScreenLastRowColumn(h),d=new E(h,o.start.column,h,m);h<=l;h++)d.start.row=d.end.row=h,d.start.column=h==s?o.start.column:r.getRowWrapIndent(h),d.end.column=g,v=m,m=g,g=h+1<l?r.getScreenLastRowColumn(h+1):h==l?0:o.end.column,this.drawSingleLineMarker(i,d,n+(h==s?" ace_start":"")+" ace_br"+a(h==s||h==s+1&&o.start.column,v<m,m>g,h==l),t,h==l?0:1,e)},c.prototype.drawMultiLineMarker=function(i,o,n,t,e){var r=this.$padding,s=t.lineHeight,l=this.$getTop(o.start.row,t),h=r+o.start.column*t.characterWidth;if(e=e||"",this.session.$bidiHandler.isBidiRow(o.start.row)){var v=o.clone();v.end.row=v.start.row,v.end.column=this.session.getLine(v.start.row).length,this.drawBidiSingleLineMarker(i,v,n+" ace_br1 ace_start",t,null,e)}else this.elt(n+" ace_br1 ace_start","height:"+s+"px;right:"+r+"px;top:"+l+"px;left:"+h+"px;"+(e||""));if(this.session.$bidiHandler.isBidiRow(o.end.row)){var v=o.clone();v.start.row=v.end.row,v.start.column=0,this.drawBidiSingleLineMarker(i,v,n+" ace_br12",t,null,e)}else{l=this.$getTop(o.end.row,t);var m=o.end.column*t.characterWidth;this.elt(n+" ace_br12","height:"+s+"px;width:"+m+"px;top:"+l+"px;left:"+r+"px;"+(e||""))}if(s=(o.end.row-o.start.row-1)*t.lineHeight,!(s<=0)){l=this.$getTop(o.start.row+1,t);var g=(o.start.column?1:0)|(o.end.column?0:8);this.elt(n+(g?" ace_br"+g:""),"height:"+s+"px;right:"+r+"px;top:"+l+"px;left:"+r+"px;"+(e||""))}},c.prototype.drawSingleLineMarker=function(i,o,n,t,e,r){if(this.session.$bidiHandler.isBidiRow(o.start.row))return this.drawBidiSingleLineMarker(i,o,n,t,e,r);var s=t.lineHeight,l=(o.end.column+(e||0)-o.start.column)*t.characterWidth,h=this.$getTop(o.start.row,t),v=this.$padding+o.start.column*t.characterWidth;this.elt(n,"height:"+s+"px;width:"+l+"px;top:"+h+"px;left:"+v+"px;"+(r||""))},c.prototype.drawBidiSingleLineMarker=function(i,o,n,t,e,r){var s=t.lineHeight,l=this.$getTop(o.start.row,t),h=this.$padding,v=this.session.$bidiHandler.getSelections(o.start.column,o.end.column);v.forEach(function(m){this.elt(n,"height:"+s+"px;width:"+(m.width+(e||0))+"px;top:"+l+"px;left:"+(h+m.left)+"px;"+(r||""))},this)},c.prototype.drawFullLineMarker=function(i,o,n,t,e){var r=this.$getTop(o.start.row,t),s=t.lineHeight;o.start.row!=o.end.row&&(s+=this.$getTop(o.end.row,t)-r),this.elt(n,"height:"+s+"px;top:"+r+"px;left:0;right:0;"+(e||""))},c.prototype.drawScreenLineMarker=function(i,o,n,t,e){var r=this.$getTop(o.start.row,t),s=t.lineHeight;this.elt(n,"height:"+s+"px;top:"+r+"px;left:0;right:0;"+(e||""))},c}();$.prototype.$padding=0;function a(c,i,o,n){return(c?1:0)|(i?2:0)|(o?4:0)|(n?8:0)}x.Marker=$}),ace.define("ace/layer/text_util",["require","exports","module"],function(k,x,H){var E=new Set(["text","rparen","lparen"]);x.isTextToken=function(A){return E.has(A)}}),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(k,x,H){var E=k("../lib/oop"),A=k("../lib/dom"),$=k("../lib/lang"),a=k("./lines").Lines,c=k("../lib/event_emitter").EventEmitter,i=k("../config").nls,o=k("./text_util").isTextToken,n=function(){function t(e){this.dom=A,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new a(this.element)}return t.prototype.$updateEolChar=function(){var e=this.session.doc,r=e.getNewLineCharacter()==`
217
- `&&e.getNewLineMode()!="windows",s=r?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=s)return this.EOL_CHAR=s,!0},t.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},t.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},t.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},t.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",(function(r){this._signal("changeCharacterSize",r)}).bind(this)),this.$pollSizeChanges()},t.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},t.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},t.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString()},t.prototype.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,typeof e=="string"?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},t.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},t.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides===e?!1:(this.$highlightIndentGuides=e,e)},t.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var r=this.$tabStrings=[0],s=1;s<e+1;s++)if(this.showTabs){var l=this.dom.createElement("span");l.className="ace_invisible ace_invisible_tab",l.textContent=$.stringRepeat(this.TAB_CHAR,s),r.push(l)}else r.push(this.dom.createTextNode($.stringRepeat(" ",s),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var h="ace_indent-guide",v=this.showSpaces?" ace_invisible ace_invisible_space":"",m=this.showSpaces?$.stringRepeat(this.SPACE_CHAR,this.tabSize):$.stringRepeat(" ",this.tabSize),g=this.showTabs?" ace_invisible ace_invisible_tab":"",d=this.showTabs?$.stringRepeat(this.TAB_CHAR,this.tabSize):m,l=this.dom.createElement("span");l.className=h+v,l.textContent=m,this.$tabStrings[" "]=l;var l=this.dom.createElement("span");l.className=h+g,l.textContent=d,this.$tabStrings[" "]=l}},t.prototype.updateLines=function(e,r,s){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var l=Math.max(r,e.firstRow),h=Math.min(s,e.lastRow),v=this.element.childNodes,m=0,d=e.firstRow;d<l;d++){var b=this.session.getFoldLine(d);if(b)if(b.containsRow(l)){l=b.start.row;break}else d=b.end.row;m++}for(var g=!1,d=l,b=this.session.getNextFoldLine(d),M=b?b.start.row:1/0;d>M&&(d=b.end.row+1,b=this.session.getNextFoldLine(d,b),M=b?b.start.row:1/0),!(d>h);){var C=v[m++];if(C){this.dom.removeChildren(C),this.$renderLine(C,d,d==M?b:!1),g&&(C.style.top=this.$lines.computeLineTop(d,e,this.session)+"px");var S=e.lineHeight*this.session.getRowLength(d)+"px";C.style.height!=S&&(g=!0,C.style.height=S)}d++}if(g)for(;m<this.$lines.cells.length;){var R=this.$lines.cells[m++];R.element.style.top=this.$lines.computeLineTop(R.row,e,this.session)+"px"}},t.prototype.scrollLines=function(e){var r=this.config;if(this.config=e,this.$lines.pageChanged(r,e))return this.update(e);this.$lines.moveContainer(e);var s=e.lastRow,l=r?r.lastRow:-1;if(!r||l<e.firstRow)return this.update(e);if(s<r.firstRow)return this.update(e);if(!r||r.lastRow<e.firstRow)return this.update(e);if(e.lastRow<r.firstRow)return this.update(e);if(r.firstRow<e.firstRow)for(var h=this.session.getFoldedRowCount(r.firstRow,e.firstRow-1);h>0;h--)this.$lines.shift();if(r.lastRow>e.lastRow)for(var h=this.session.getFoldedRowCount(e.lastRow+1,r.lastRow);h>0;h--)this.$lines.pop();e.firstRow<r.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,r.firstRow-1)),e.lastRow>r.lastRow&&this.$lines.push(this.$renderLinesFragment(e,r.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},t.prototype.$renderLinesFragment=function(e,r,s){for(var l=[],h=r,v=this.session.getNextFoldLine(h),m=v?v.start.row:1/0;h>m&&(h=v.end.row+1,v=this.session.getNextFoldLine(h,v),m=v?v.start.row:1/0),!(h>s);){var g=this.$lines.createCell(h,e,this.session),d=g.element;this.dom.removeChildren(d),A.setStyle(d.style,"height",this.$lines.computeLineHeight(h,e,this.session)+"px"),A.setStyle(d.style,"top",this.$lines.computeLineTop(h,e,this.session)+"px"),this.$renderLine(d,h,h==m?v:!1),this.$useLineGroups()?d.className="ace_line_group":d.className="ace_line",l.push(g),h++}return l},t.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var r=e.firstRow,s=e.lastRow,l=this.$lines;l.getLength();)l.pop();l.push(this.$renderLinesFragment(e,r,s))},t.prototype.$renderToken=function(e,r,s,l){for(var h=this,v=/(\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,m=this.dom.createFragment(this.element),g,d=0;g=v.exec(l);){var b=g[1],M=g[2],C=g[3],S=g[4],R=g[5];if(!(!h.showSpaces&&M)){var w=d!=g.index?l.slice(d,g.index):"";if(d=g.index+g[0].length,w&&m.appendChild(this.dom.createTextNode(w,this.element)),b){var y=h.session.getScreenTabSize(r+g.index),f=h.$tabStrings[y].cloneNode(!0);f.charCount=1,m.appendChild(f),r+=y-1}else if(M)if(h.showSpaces){var u=this.dom.createElement("span");u.className="ace_invisible ace_invisible_space",u.textContent=$.stringRepeat(h.SPACE_CHAR,M.length),m.appendChild(u)}else m.appendChild(this.dom.createTextNode(M,this.element));else if(C){var u=this.dom.createElement("span");u.className="ace_invisible ace_invisible_space ace_invalid",u.textContent=$.stringRepeat(h.SPACE_CHAR,C.length),m.appendChild(u)}else if(S){r+=1;var u=this.dom.createElement("span");u.style.width=h.config.characterWidth*2+"px",u.className=h.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",u.textContent=h.showSpaces?h.SPACE_CHAR:S,m.appendChild(u)}else if(R){r+=1;var u=this.dom.createElement("span");u.style.width=h.config.characterWidth*2+"px",u.className="ace_cjk",u.textContent=R,m.appendChild(u)}}}if(m.appendChild(this.dom.createTextNode(d?l.slice(d):l,this.element)),o(s.type))e.appendChild(m);else{var p="ace_"+s.type.replace(/\./g," ace_"),u=this.dom.createElement("span");s.type=="fold"&&(u.style.width=s.value.length*this.config.characterWidth+"px",u.setAttribute("title",i("inline-fold.closed.title","Unfold code"))),u.className=p,u.appendChild(m),e.appendChild(u)}return r+l.length},t.prototype.renderIndentGuide=function(e,r,s){var l=r.search(this.$indentGuideRe);if(l<=0||l>=s)return r;if(r[0]==" "){l-=l%this.tabSize;for(var h=l/this.tabSize,v=0;v<h;v++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),r.substr(l)}else if(r[0]==" "){for(var v=0;v<l;v++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),r.substr(l)}return this.$highlightIndentGuide(),r},t.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var e=this.session.doc.$lines;if(e){var r=this.session.selection.getCursor(),s=/^\s*/.exec(this.session.doc.getLine(r.row))[0].length,l=Math.floor(s/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:l,start:r.row};var h=this.session.$bracketHighlight;if(h){for(var v=this.session.$bracketHighlight.ranges,m=0;m<v.length;m++)if(r.row!==v[m].start.row){this.$highlightIndentGuideMarker.end=v[m].start.row+1,r.row>v[m].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&e[r.row]!==""&&r.column===e[r.row].length){this.$highlightIndentGuideMarker.dir=1;for(var m=r.row+1;m<e.length;m++){var g=e[m],d=/^\s*/.exec(g)[0].length;if(g!==""&&(this.$highlightIndentGuideMarker.end=m,d<=s))break}}this.$renderHighlightIndentGuide()}}},t.prototype.$clearActiveIndentGuide=function(){for(var e=this.element.querySelectorAll(".ace_indent-guide-active"),r=0;r<e.length;r++)e[r].classList.remove("ace_indent-guide-active")},t.prototype.$setIndentGuideActive=function(e,r){var s=this.session.doc.getLine(e.row);if(s!==""){var l=e.element;if(e.element.classList&&e.element.classList.contains("ace_line_group"))if(e.element.childNodes.length>0)l=e.element.childNodes[0];else return;var h=l.childNodes;if(h){var v=h[r-1];v&&v.classList&&v.classList.contains("ace_indent-guide")&&v.classList.add("ace_indent-guide-active")}}},t.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var r=this.$highlightIndentGuideMarker.indentLevel;if(r!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var s=0;s<e.length;s++){var l=e[s];if(this.$highlightIndentGuideMarker.end&&l.row>=this.$highlightIndentGuideMarker.start+1){if(l.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(l,r)}}else for(var s=e.length-1;s>=0;s--){var l=e[s];if(this.$highlightIndentGuideMarker.end&&l.row<this.$highlightIndentGuideMarker.start){if(l.row<this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(l,r)}}}},t.prototype.$createLineElement=function(e){var r=this.dom.createElement("div");return r.className="ace_line",r.style.height=this.config.lineHeight+"px",r},t.prototype.$renderWrappedLine=function(e,r,s){var l=0,h=0,v=s[0],m=0,g=this.$createLineElement();e.appendChild(g);for(var d=0;d<r.length;d++){var b=r[d],M=b.value;if(d==0&&this.displayIndentGuides){if(l=M.length,M=this.renderIndentGuide(g,M,v),!M)continue;l-=M.length}if(l+M.length<v)m=this.$renderToken(g,m,b,M),l+=M.length;else{for(;l+M.length>=v;){m=this.$renderToken(g,m,b,M.substring(0,v-l)),M=M.substring(v-l),l=v,g=this.$createLineElement(),e.appendChild(g);var C=this.dom.createTextNode($.stringRepeat(" ",s.indent),this.element);C.charCount=0,g.appendChild(C),h++,m=0,v=s[h]||Number.MAX_VALUE}M.length!=0&&(l+=M.length,m=this.$renderToken(g,m,b,M))}}s[s.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(g,m,null,"",!0)},t.prototype.$renderSimpleLine=function(e,r){for(var s=0,l=0;l<r.length;l++){var h=r[l],v=h.value;if(!(l==0&&this.displayIndentGuides&&(v=this.renderIndentGuide(e,v),!v))){if(s+v.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,s,h,v);s=this.$renderToken(e,s,h,v)}}},t.prototype.$renderOverflowMessage=function(e,r,s,l,h){s&&this.$renderToken(e,r,s,l.slice(0,this.MAX_LINE_LENGTH-r));var v=this.dom.createElement("span");v.className="ace_inline_button ace_keyword ace_toggle_wrap",v.textContent=h?"<hide>":"<click to see more...>",e.appendChild(v)},t.prototype.$renderLine=function(e,r,s){if(!s&&s!=!1&&(s=this.session.getFoldLine(r)),s)var l=this.$getFoldLineTokens(r,s);else var l=this.session.getTokens(r);var h=e;if(l.length){var v=this.session.getRowSplitData(r);if(v&&v.length){this.$renderWrappedLine(e,l,v);var h=e.lastChild}else{var h=e;this.$useLineGroups()&&(h=this.$createLineElement(),e.appendChild(h)),this.$renderSimpleLine(h,l)}}else this.$useLineGroups()&&(h=this.$createLineElement(),e.appendChild(h));if(this.showEOL&&h){s&&(r=s.end.row);var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_eol",m.textContent=r==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,h.appendChild(m)}},t.prototype.$getFoldLineTokens=function(e,r){var s=this.session,l=[];function h(m,g,d){for(var b=0,M=0;M+m[b].value.length<g;)if(M+=m[b].value.length,b++,b==m.length)return;if(M!=g){var C=m[b].value.substring(g-M);C.length>d-g&&(C=C.substring(0,d-g)),l.push({type:m[b].type,value:C}),M=g+C.length,b+=1}for(;M<d&&b<m.length;){var C=m[b].value;C.length+M>d?l.push({type:m[b].type,value:C.substring(0,d-M)}):l.push(m[b]),M+=C.length,b+=1}}var v=s.getTokens(e);return r.walk(function(m,g,d,b,M){m!=null?l.push({type:"fold",value:m}):(M&&(v=s.getTokens(g)),v.length&&h(v,b,d))},r.end.row,this.session.getLine(r.end.row).length),l},t.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},t}();n.prototype.EOF_CHAR="¶",n.prototype.EOL_CHAR_LF="¬",n.prototype.EOL_CHAR_CRLF="¤",n.prototype.EOL_CHAR=n.prototype.EOL_CHAR_LF,n.prototype.TAB_CHAR="—",n.prototype.SPACE_CHAR="·",n.prototype.$padding=0,n.prototype.MAX_LINE_LENGTH=1e4,n.prototype.showInvisibles=!1,n.prototype.showSpaces=!1,n.prototype.showTabs=!1,n.prototype.showEOL=!1,n.prototype.displayIndentGuides=!0,n.prototype.$highlightIndentGuides=!0,n.prototype.$tabStrings=[],n.prototype.destroy={},n.prototype.onChangeTabSize=n.prototype.$computeTabString,E.implement(n.prototype,c),x.Text=n}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(k,x,H){var E=k("../lib/dom"),A=function(){function $(a){this.element=E.createElement("div"),this.element.className="ace_layer ace_cursor-layer",a.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),E.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return $.prototype.$updateOpacity=function(a){for(var c=this.cursors,i=c.length;i--;)E.setStyle(c[i].style,"opacity",a?"":"0")},$.prototype.$startCssAnimation=function(){for(var a=this.cursors,c=a.length;c--;)a[c].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout((function(){this.$isAnimating&&E.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},$.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,E.removeCssClass(this.element,"ace_animate-blinking")},$.prototype.setPadding=function(a){this.$padding=a},$.prototype.setSession=function(a){this.session=a},$.prototype.setBlinking=function(a){a!=this.isBlinking&&(this.isBlinking=a,this.restartTimer())},$.prototype.setBlinkInterval=function(a){a!=this.blinkInterval&&(this.blinkInterval=a,this.restartTimer())},$.prototype.setSmoothBlinking=function(a){a!=this.smoothBlinking&&(this.smoothBlinking=a,E.setCssClass(this.element,"ace_smooth-blinking",a),this.$updateCursors(!0),this.restartTimer())},$.prototype.addCursor=function(){var a=E.createElement("div");return a.className="ace_cursor",this.element.appendChild(a),this.cursors.push(a),a},$.prototype.removeCursor=function(){if(this.cursors.length>1){var a=this.cursors.pop();return a.parentNode.removeChild(a),a}},$.prototype.hideCursor=function(){this.isVisible=!1,E.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},$.prototype.showCursor=function(){this.isVisible=!0,E.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},$.prototype.restartTimer=function(){var a=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,E.removeCssClass(this.element,"ace_smooth-blinking")),a(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout((function(){this.$isSmoothBlinking&&E.addCssClass(this.element,"ace_smooth-blinking")}).bind(this))),E.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var c=(function(){this.timeoutId=setTimeout(function(){a(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){a(!0),c()},this.blinkInterval),c()}},$.prototype.getPixelPosition=function(a,c){if(!this.config||!this.session)return{left:0,top:0};a||(a=this.session.selection.getCursor());var i=this.session.documentToScreenPosition(a),o=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,a.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth),n=(i.row-(c?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:o,top:n}},$.prototype.isCursorInView=function(a,c){return a.top>=0&&a.top<c.maxHeight},$.prototype.update=function(a){this.config=a;var c=this.session.$selectionMarkers,i=0,o=0;(c===void 0||c.length===0)&&(c=[{cursor:null}]);for(var i=0,n=c.length;i<n;i++){var t=this.getPixelPosition(c[i].cursor,!0);if(!((t.top>a.height+a.offset||t.top<0)&&i>1)){var e=this.cursors[o++]||this.addCursor(),r=e.style;this.drawCursor?this.drawCursor(e,t,a,c[i],this.session):this.isCursorInView(t,a)?(E.setStyle(r,"display","block"),E.translate(e,t.left,t.top),E.setStyle(r,"width",Math.round(a.characterWidth)+"px"),E.setStyle(r,"height",a.lineHeight+"px")):E.setStyle(r,"display","none")}}for(;this.cursors.length>o;)this.removeCursor();var s=this.session.getOverwrite();this.$setOverwrite(s),this.$pixelPos=t,this.restartTimer()},$.prototype.$setOverwrite=function(a){a!=this.overwrite&&(this.overwrite=a,a?E.addCssClass(this.element,"ace_overwrite-cursors"):E.removeCssClass(this.element,"ace_overwrite-cursors"))},$.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},$}();A.prototype.$padding=0,A.prototype.drawCursor=null,x.Cursor=A}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(k,x,H){var E=this&&this.__extends||function(){var e=function(r,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,h){l.__proto__=h}||function(l,h){for(var v in h)Object.prototype.hasOwnProperty.call(h,v)&&(l[v]=h[v])},e(r,s)};return function(r,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(r,s);function l(){this.constructor=r}r.prototype=s===null?Object.create(s):(l.prototype=s.prototype,new l)}}(),A=k("./lib/oop"),$=k("./lib/dom"),a=k("./lib/event"),c=k("./lib/event_emitter").EventEmitter,i=32768,o=function(){function e(r,s){this.element=$.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+s,this.inner=$.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),r.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addListener(this.element,"scroll",this.onScroll.bind(this)),a.addListener(this.element,"mousedown",a.preventDefault)}return e.prototype.setVisible=function(r){this.element.style.display=r?"":"none",this.isVisible=r,this.coeff=1},e}();A.implement(o.prototype,c);var n=function(e){E(r,e);function r(s,l){var h=e.call(this,s,"-v")||this;return h.scrollTop=0,h.scrollHeight=0,l.$scrollbarWidth=h.width=$.scrollbarWidth(s.ownerDocument),h.inner.style.width=h.element.style.width=(h.width||15)+5+"px",h.$minWidth=0,h}return r.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var s=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-s)/(this.coeff-s)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},r.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},r.prototype.setHeight=function(s){this.element.style.height=s+"px"},r.prototype.setScrollHeight=function(s){this.scrollHeight=s,s>i?(this.coeff=i/s,s=i):this.coeff!=1&&(this.coeff=1),this.inner.style.height=s+"px"},r.prototype.setScrollTop=function(s){this.scrollTop!=s&&(this.skipEvent=!0,this.scrollTop=s,this.element.scrollTop=s*this.coeff)},r}(o);n.prototype.setInnerHeight=n.prototype.setScrollHeight;var t=function(e){E(r,e);function r(s,l){var h=e.call(this,s,"-h")||this;return h.scrollLeft=0,h.height=l.$scrollbarWidth,h.inner.style.height=h.element.style.height=(h.height||15)+5+"px",h}return r.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},r.prototype.getHeight=function(){return this.isVisible?this.height:0},r.prototype.setWidth=function(s){this.element.style.width=s+"px"},r.prototype.setInnerWidth=function(s){this.inner.style.width=s+"px"},r.prototype.setScrollWidth=function(s){this.inner.style.width=s+"px"},r.prototype.setScrollLeft=function(s){this.scrollLeft!=s&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=s)},r}(o);x.ScrollBar=n,x.ScrollBarV=n,x.ScrollBarH=t,x.VScrollBar=n,x.HScrollBar=t}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(k,x,H){var E=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,l){s.__proto__=l}||function(s,l){for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(s[h]=l[h])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function s(){this.constructor=e}e.prototype=r===null?Object.create(r):(s.prototype=r.prototype,new s)}}(),A=k("./lib/oop"),$=k("./lib/dom"),a=k("./lib/event"),c=k("./lib/event_emitter").EventEmitter;$.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
214
+ `){var F=x.getLine(_.row);if(_.column>F.search(/\S|$/)){var z=F.substr(_.column).search(/\S|$/);x.doc.removeInLine(_.row,_.column,_.column+z)}}this.clearSelection();var D=_.column,N=x.getState(_.row),F=x.getLine(_.row),B=T.checkOutdent(N,F,u);if(x.insert(_,u),I&&I.selection&&(I.selection.length==2?this.selection.setSelectionRange(new s(_.row,D+I.selection[0],_.row,D+I.selection[1])):this.selection.setSelectionRange(new s(_.row+I.selection[0],I.selection[1],_.row+I.selection[2],I.selection[3]))),this.$enableAutoIndent){if(x.getDocument().isNewLine(u)){var P=T.getNextLineIndent(N,F.slice(0,_.column),x.getTabString());x.insert({row:_.row+1,column:0},P)}B&&T.autoOutdent(N,x,_.row)}},f.prototype.autoIndent=function(){for(var u=this.session,p=u.getMode(),x=this.selection.isEmpty()?[new s(0,0,u.doc.getLength()-1,0)]:this.selection.getAllRanges(),T="",_="",I="",O=u.getTabString(),z=0;z<x.length;z++)for(var D=x[z].start.row,N=x[z].end.row,F=D;F<=N;F++){F>0&&(T=u.getState(F-1),_=u.getLine(F-1),I=p.getNextLineIndent(T,_,O));var B=u.getLine(F),P=p.$getIndent(B);if(I!==P){if(P.length>0){var V=new s(F,0,F,P.length);u.remove(V)}I.length>0&&u.insert({row:F,column:0},I)}p.autoOutdent(T,u,F)}},f.prototype.onTextInput=function(u,p){if(!p)return this.keyBinding.onTextInput(u);this.startOperation({command:{name:"insertstring"}});var x=this.applyComposition.bind(this,u,p);this.selection.rangeCount?this.forEachSelection(x):x(),this.endOperation()},f.prototype.applyComposition=function(u,p){if(p.extendLeft||p.extendRight){var x=this.selection.getRange();x.start.column-=p.extendLeft,x.end.column+=p.extendRight,x.start.column<0&&(x.start.row--,x.start.column+=this.session.getLine(x.start.row).length+1),this.selection.setRange(x),!u&&!x.isEmpty()&&this.remove()}if((u||!this.selection.isEmpty())&&this.insert(u,!0),p.restoreStart||p.restoreEnd){var x=this.selection.getRange();x.start.column-=p.restoreStart,x.end.column-=p.restoreEnd,this.selection.setRange(x)}},f.prototype.onCommandKey=function(u,p,x){return this.keyBinding.onCommandKey(u,p,x)},f.prototype.setOverwrite=function(u){this.session.setOverwrite(u)},f.prototype.getOverwrite=function(){return this.session.getOverwrite()},f.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},f.prototype.setScrollSpeed=function(u){this.setOption("scrollSpeed",u)},f.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},f.prototype.setDragDelay=function(u){this.setOption("dragDelay",u)},f.prototype.getDragDelay=function(){return this.getOption("dragDelay")},f.prototype.setSelectionStyle=function(u){this.setOption("selectionStyle",u)},f.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},f.prototype.setHighlightActiveLine=function(u){this.setOption("highlightActiveLine",u)},f.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},f.prototype.setHighlightGutterLine=function(u){this.setOption("highlightGutterLine",u)},f.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},f.prototype.setHighlightSelectedWord=function(u){this.setOption("highlightSelectedWord",u)},f.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},f.prototype.setAnimatedScroll=function(u){this.renderer.setAnimatedScroll(u)},f.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},f.prototype.setShowInvisibles=function(u){this.renderer.setShowInvisibles(u)},f.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},f.prototype.setDisplayIndentGuides=function(u){this.renderer.setDisplayIndentGuides(u)},f.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},f.prototype.setHighlightIndentGuides=function(u){this.renderer.setHighlightIndentGuides(u)},f.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},f.prototype.setShowPrintMargin=function(u){this.renderer.setShowPrintMargin(u)},f.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},f.prototype.setPrintMarginColumn=function(u){this.renderer.setPrintMarginColumn(u)},f.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},f.prototype.setReadOnly=function(u){this.setOption("readOnly",u)},f.prototype.getReadOnly=function(){return this.getOption("readOnly")},f.prototype.setBehavioursEnabled=function(u){this.setOption("behavioursEnabled",u)},f.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},f.prototype.setWrapBehavioursEnabled=function(u){this.setOption("wrapBehavioursEnabled",u)},f.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},f.prototype.setShowFoldWidgets=function(u){this.setOption("showFoldWidgets",u)},f.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},f.prototype.setFadeFoldWidgets=function(u){this.setOption("fadeFoldWidgets",u)},f.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},f.prototype.remove=function(u){this.selection.isEmpty()&&(u=="left"?this.selection.selectLeft():this.selection.selectRight());var p=this.getSelectionRange();if(this.getBehavioursEnabled()){var x=this.session,T=x.getState(p.start.row),_=x.getMode().transformAction(T,"deletion",this,x,p);if(p.end.column===0){var I=x.getTextRange(p);if(I[I.length-1]==`
215
+ `){var O=x.getLine(p.end.row);/^\s+$/.test(O)&&(p.end.column=O.length)}}_&&(p=_)}this.session.remove(p),this.clearSelection()},f.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},f.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},f.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},f.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var u=this.getSelectionRange();u.start.column==u.end.column&&u.start.row==u.end.row&&(u.end.column=0,u.end.row++),this.session.remove(u),this.clearSelection()},f.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var u=this.getCursorPosition();this.insert(`
216
+ `),this.moveCursorToPosition(u)},f.prototype.setGhostText=function(u,p){this.renderer.setGhostText(u,p)},f.prototype.removeGhostText=function(){this.renderer.removeGhostText()},f.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var u=this.getCursorPosition(),p=u.column;if(p!==0){var x=this.session.getLine(u.row),T,_;p<x.length?(T=x.charAt(p)+x.charAt(p-1),_=new s(u.row,p-1,u.row,p+1)):(T=x.charAt(p-1)+x.charAt(p-2),_=new s(u.row,p-2,u.row,p)),this.session.replace(_,T),this.session.selection.moveToPosition(_.end)}}},f.prototype.toLowerCase=function(){var u=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var p=this.getSelectionRange(),x=this.session.getTextRange(p);this.session.replace(p,x.toLowerCase()),this.selection.setSelectionRange(u)},f.prototype.toUpperCase=function(){var u=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var p=this.getSelectionRange(),x=this.session.getTextRange(p);this.session.replace(p,x.toUpperCase()),this.selection.setSelectionRange(u)},f.prototype.indent=function(){var u=this.session,p=this.getSelectionRange();if(p.start.row<p.end.row){var x=this.$getSelectedRows();u.indentRows(x.first,x.last," ");return}else if(p.start.column<p.end.column){var T=u.getTextRange(p);if(!/^\s+$/.test(T)){var x=this.$getSelectedRows();u.indentRows(x.first,x.last," ");return}}var _=u.getLine(p.start.row),I=p.start,O=u.getTabSize(),z=u.documentToScreenColumn(I.row,I.column);if(this.session.getUseSoftTabs())var D=O-z%O,N=a.stringRepeat(" ",D);else{for(var D=z%O;_[p.start.column-1]==" "&&D;)p.start.column--,D--;this.selection.setSelectionRange(p),N=" "}return this.insert(N)},f.prototype.blockIndent=function(){var u=this.$getSelectedRows();this.session.indentRows(u.first,u.last," ")},f.prototype.blockOutdent=function(){var u=this.session.getSelection();this.session.outdentRows(u.getRange())},f.prototype.sortLines=function(){for(var u=this.$getSelectedRows(),p=this.session,x=[],T=u.first;T<=u.last;T++)x.push(p.getLine(T));x.sort(function(O,z){return O.toLowerCase()<z.toLowerCase()?-1:O.toLowerCase()>z.toLowerCase()?1:0});for(var _=new s(0,0,0,0),T=u.first;T<=u.last;T++){var I=p.getLine(T);_.start.row=T,_.end.row=T,_.end.column=I.length,p.replace(_,x[T-u.first])}},f.prototype.toggleCommentLines=function(){var u=this.session.getState(this.getCursorPosition().row),p=this.$getSelectedRows();this.session.getMode().toggleCommentLines(u,this.session,p.first,p.last)},f.prototype.toggleBlockComment=function(){var u=this.getCursorPosition(),p=this.session.getState(u.row),x=this.getSelectionRange();this.session.getMode().toggleBlockComment(p,this.session,x,u)},f.prototype.getNumberAt=function(u,p){var x=/[\-]?[0-9]+(?:\.[0-9]+)?/g;x.lastIndex=0;for(var T=this.session.getLine(u);x.lastIndex<p;){var _=x.exec(T);if(_.index<=p&&_.index+_[0].length>=p){var I={value:_[0],start:_.index,end:_.index+_[0].length};return I}}return null},f.prototype.modifyNumber=function(u){var p=this.selection.getCursor().row,x=this.selection.getCursor().column,T=new s(p,x-1,p,x),_=this.session.getTextRange(T);if(!isNaN(parseFloat(_))&&isFinite(_)){var I=this.getNumberAt(p,x);if(I){var O=I.value.indexOf(".")>=0?I.start+I.value.indexOf(".")+1:I.end,z=I.start+I.value.length-O,D=parseFloat(I.value);D*=Math.pow(10,z),O!==I.end&&x<O?u*=Math.pow(10,I.end-x-1):u*=Math.pow(10,I.end-x),D+=u,D/=Math.pow(10,z);var N=D.toFixed(z),F=new s(p,I.start,p,I.end);this.session.replace(F,N),this.moveCursorTo(p,Math.max(I.start+1,x+N.length-I.value.length))}}else this.toggleWord()},f.prototype.toggleWord=function(){var u=this.selection.getCursor().row,p=this.selection.getCursor().column;this.selection.selectWord();var x=this.getSelectedText(),T=this.selection.getWordRange().start.column,_=x.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),I=p-T-1;I<0&&(I=0);var O=0,z=0,D=this;x.match(/[A-Za-z0-9_]+/)&&_.forEach(function(Q,X){z=O+Q.length,I>=O&&I<=z&&(x=Q,D.selection.clearSelection(),D.moveCursorTo(u,O+T),D.selection.selectTo(u,z+T)),O=z});for(var N=this.$toggleWordPairs,F,B=0;B<N.length;B++)for(var P=N[B],V=0;V<=1;V++){var G=+!V,j=x.match(new RegExp("^\\s?_?("+a.escapeRegExp(P[V])+")\\s?$","i"));if(j){var K=x.match(new RegExp("([_]|^|\\s)("+a.escapeRegExp(j[1])+")($|\\s)","g"));K&&(F=x.replace(new RegExp(a.escapeRegExp(P[V]),"i"),function(Q){var X=P[G];return Q.toUpperCase()==Q?X=X.toUpperCase():Q.charAt(0).toUpperCase()==Q.charAt(0)&&(X=X.substr(0,0)+P[G].charAt(0).toUpperCase()+X.substr(1)),X}),this.insert(F),F="")}}},f.prototype.findLinkAt=function(u,p){var x,T,_=this.session.getLine(u),I=_.split(/((?:https?|ftp):\/\/[\S]+)/),O=p;O<0&&(O=0);var z=0,D=0,N;try{for(var F=E(I),B=F.next();!B.done;B=F.next()){var P=B.value;if(D=z+P.length,O>=z&&O<=D&&P.match(/((?:https?|ftp):\/\/[\S]+)/)){N=P.replace(/[\s:.,'";}\]]+$/,"");break}z=D}}catch(V){x={error:V}}finally{try{B&&!B.done&&(T=F.return)&&T.call(F)}finally{if(x)throw x.error}}return N},f.prototype.openLink=function(){var u=this.selection.getCursor(),p=this.findLinkAt(u.row,u.column);return p&&window.open(p,"_blank"),p!=null},f.prototype.removeLines=function(){var u=this.$getSelectedRows();this.session.removeFullLines(u.first,u.last),this.clearSelection()},f.prototype.duplicateSelection=function(){var u=this.selection,p=this.session,x=u.getRange(),T=u.isBackwards();if(x.isEmpty()){var _=x.start.row;p.duplicateLines(_,_)}else{var I=T?x.start:x.end,O=p.insert(I,p.getTextRange(x));x.start=I,x.end=O,u.setSelectionRange(x,T)}},f.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},f.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},f.prototype.moveText=function(u,p,x){return this.session.moveText(u,p,x)},f.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},f.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},f.prototype.$moveLines=function(u,p){var x,T,_=this.selection;if(!_.inMultiSelectMode||this.inVirtualSelectionMode){var I=_.toOrientedRange();x=this.$getSelectedRows(I),T=this.session.$moveLines(x.first,x.last,p?0:u),p&&u==-1&&(T=0),I.moveBy(T,0),_.fromOrientedRange(I)}else{var O=_.rangeList.ranges;_.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var z=0,D=0,N=O.length,F=0;F<N;F++){var B=F;O[F].moveBy(z,0),x=this.$getSelectedRows(O[F]);for(var P=x.first,V=x.last;++F<N;){D&&O[F].moveBy(D,0);var G=this.$getSelectedRows(O[F]);if(p&&G.first!=V)break;if(!p&&G.first>V+1)break;V=G.last}for(F--,z=this.session.$moveLines(P,V,p?0:u),p&&u==-1&&(B=F+1);B<=F;)O[B].moveBy(z,0),B++;p||(z=0),D+=z}_.fromOrientedRange(_.ranges[0]),_.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},f.prototype.$getSelectedRows=function(u){return u=(u||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(u.start.row),last:this.session.getRowFoldEnd(u.end.row)}},f.prototype.onCompositionStart=function(u){this.renderer.showComposition(u)},f.prototype.onCompositionUpdate=function(u){this.renderer.setCompositionText(u)},f.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},f.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},f.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},f.prototype.isRowVisible=function(u){return u>=this.getFirstVisibleRow()&&u<=this.getLastVisibleRow()},f.prototype.isRowFullyVisible=function(u){return u>=this.renderer.getFirstFullyVisibleRow()&&u<=this.renderer.getLastFullyVisibleRow()},f.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},f.prototype.$moveByPage=function(u,p){var x=this.renderer,T=this.renderer.layerConfig,_=u*Math.floor(T.height/T.lineHeight);p===!0?this.selection.$moveSelection(function(){this.moveCursorBy(_,0)}):p===!1&&(this.selection.moveCursorBy(_,0),this.selection.clearSelection());var I=x.scrollTop;x.scrollBy(0,_*T.lineHeight),p!=null&&x.scrollCursorIntoView(null,.5),x.animateScrolling(I)},f.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},f.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},f.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},f.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},f.prototype.scrollPageDown=function(){this.$moveByPage(1)},f.prototype.scrollPageUp=function(){this.$moveByPage(-1)},f.prototype.scrollToRow=function(u){this.renderer.scrollToRow(u)},f.prototype.scrollToLine=function(u,p,x,T){this.renderer.scrollToLine(u,p,x,T)},f.prototype.centerSelection=function(){var u=this.getSelectionRange(),p={row:Math.floor(u.start.row+(u.end.row-u.start.row)/2),column:Math.floor(u.start.column+(u.end.column-u.start.column)/2)};this.renderer.alignCursor(p,.5)},f.prototype.getCursorPosition=function(){return this.selection.getCursor()},f.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},f.prototype.getSelectionRange=function(){return this.selection.getRange()},f.prototype.selectAll=function(){this.selection.selectAll()},f.prototype.clearSelection=function(){this.selection.clearSelection()},f.prototype.moveCursorTo=function(u,p){this.selection.moveCursorTo(u,p)},f.prototype.moveCursorToPosition=function(u){this.selection.moveCursorToPosition(u)},f.prototype.jumpToMatching=function(u,p){var x=this.getCursorPosition(),T=new g(this.session,x.row,x.column),_=T.getCurrentToken(),I=0;_&&_.type.indexOf("tag-name")!==-1&&(_=T.stepBackward());var O=_||T.stepForward();if(O){var z,D=!1,N={},F=x.column-O.start,B,P={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(O.value.match(/[{}()\[\]]/g)){for(;F<O.value.length&&!D;F++)if(P[O.value[F]])switch(B=P[O.value[F]]+"."+O.type.replace("rparen","lparen"),isNaN(N[B])&&(N[B]=0),O.value[F]){case"(":case"[":case"{":N[B]++;break;case")":case"]":case"}":N[B]--,N[B]===-1&&(z="bracket",D=!0);break}}else O.type.indexOf("tag-name")!==-1&&(isNaN(N[O.value])&&(N[O.value]=0),_.value==="<"&&I>1?N[O.value]++:_.value==="</"&&N[O.value]--,N[O.value]===-1&&(z="tag",D=!0));D||(_=O,I++,O=T.stepForward(),F=0)}while(O&&!D);if(z){var V,G;if(z==="bracket")V=this.session.getBracketRange(x),V||(V=new s(T.getCurrentTokenRow(),T.getCurrentTokenColumn()+F-1,T.getCurrentTokenRow(),T.getCurrentTokenColumn()+F-1),G=V.start,(p||G.row===x.row&&Math.abs(G.column-x.column)<2)&&(V=this.session.getBracketRange(G)));else if(z==="tag"){if(!O||O.type.indexOf("tag-name")===-1)return;if(V=new s(T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2,T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2),V.compare(x.row,x.column)===0){var j=this.session.getMatchingTags(x);j&&(j.openTag.contains(x.row,x.column)?(V=j.closeTag,G=V.start):(V=j.openTag,j.closeTag.start.row===x.row&&j.closeTag.start.column===x.column?G=V.end:G=V.start))}G=G||V.start}G=V&&V.cursor||G,G&&(u?V&&p?this.selection.setRange(V):V&&V.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(G.row,G.column):this.selection.moveTo(G.row,G.column))}}},f.prototype.gotoLine=function(u,p,x){this.selection.clearSelection(),this.session.unfold({row:u-1,column:p||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(u-1,p||0),this.isRowFullyVisible(u-1)||this.scrollToLine(u-1,!0,x)},f.prototype.navigateTo=function(u,p){this.selection.moveTo(u,p)},f.prototype.navigateUp=function(u){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var p=this.selection.anchor.getPosition();return this.moveCursorToPosition(p)}this.selection.clearSelection(),this.selection.moveCursorBy(-u||-1,0)},f.prototype.navigateDown=function(u){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var p=this.selection.anchor.getPosition();return this.moveCursorToPosition(p)}this.selection.clearSelection(),this.selection.moveCursorBy(u||1,0)},f.prototype.navigateLeft=function(u){if(this.selection.isEmpty())for(u=u||1;u--;)this.selection.moveCursorLeft();else{var p=this.getSelectionRange().start;this.moveCursorToPosition(p)}this.clearSelection()},f.prototype.navigateRight=function(u){if(this.selection.isEmpty())for(u=u||1;u--;)this.selection.moveCursorRight();else{var p=this.getSelectionRange().end;this.moveCursorToPosition(p)}this.clearSelection()},f.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},f.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},f.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},f.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},f.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},f.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},f.prototype.replace=function(u,p){p&&this.$search.set(p);var x=this.$search.find(this.session),T=0;return x&&(this.$tryReplace(x,u)&&(T=1),this.selection.setSelectionRange(x),this.renderer.scrollSelectionIntoView(x.start,x.end)),T},f.prototype.replaceAll=function(u,p){p&&this.$search.set(p);var x=this.$search.findAll(this.session),T=0;if(!x.length)return T;var _=this.getSelectionRange();this.selection.moveTo(0,0);for(var I=x.length-1;I>=0;--I)this.$tryReplace(x[I],u)&&T++;return this.selection.setSelectionRange(_),T},f.prototype.$tryReplace=function(u,p){var x=this.session.getTextRange(u);return p=this.$search.replace(x,p),p!==null?(u.end=this.session.replace(u,p),u):null},f.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},f.prototype.find=function(u,p,x){p||(p={}),typeof u=="string"||u instanceof RegExp?p.needle=u:typeof u=="object"&&A.mixin(p,u);var T=this.selection.getRange();p.needle==null&&(u=this.session.getTextRange(T)||this.$search.$options.needle,u||(T=this.session.getWordRange(T.start.row,T.start.column),u=this.session.getTextRange(T)),this.$search.set({needle:u})),this.$search.set(p),p.start||this.$search.set({start:T});var _=this.$search.find(this.session);if(p.preventScroll)return _;if(_)return this.revealRange(_,x),_;p.backwards?T.start=T.end:T.end=T.start,this.selection.setRange(T)},f.prototype.findNext=function(u,p){this.find({skipCurrent:!0,backwards:!1},u,p)},f.prototype.findPrevious=function(u,p){this.find(u,{skipCurrent:!0,backwards:!0},p)},f.prototype.revealRange=function(u,p){this.session.unfold(u),this.selection.setSelectionRange(u);var x=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(u.start,u.end,.5),p!==!1&&this.renderer.animateScrolling(x)},f.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},f.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},f.prototype.destroy=function(){this.destroyed=!0,this.$toDestroy&&(this.$toDestroy.forEach(function(u){u.destroy()}),this.$toDestroy=[]),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},f.prototype.setAutoScrollEditorIntoView=function(u){if(u){var p,x=this,T=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var _=this.$scrollAnchor;_.style.cssText="position:absolute",this.container.insertBefore(_,this.container.firstChild);var I=this.on("changeSelection",function(){T=!0}),O=this.renderer.on("beforeRender",function(){T&&(p=x.renderer.container.getBoundingClientRect())}),z=this.renderer.on("afterRender",function(){if(T&&p&&(x.isFocused()||x.searchBox&&x.searchBox.isFocused())){var D=x.renderer,N=D.$cursorLayer.$pixelPos,F=D.layerConfig,B=N.top-F.offset;N.top>=0&&B+p.top<0?T=!0:N.top<F.height&&N.top+p.top+F.lineHeight>window.innerHeight?T=!1:T=null,T!=null&&(_.style.top=B+"px",_.style.left=N.left+"px",_.style.height=F.lineHeight+"px",_.scrollIntoView(T)),T=p=null}});this.setAutoScrollEditorIntoView=function(D){D||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",I),this.renderer.off("afterRender",z),this.renderer.off("beforeRender",O))}}},f.prototype.$resetCursorStyle=function(){var u=this.$cursorStyle||"ace",p=this.renderer.$cursorLayer;p&&(p.setSmoothBlinking(/smooth/.test(u)),p.isBlinking=!this.$readOnly&&u!="wide",$.setCssClass(p.element,"ace_slim-cursors",/slim/.test(u)))},f.prototype.prompt=function(u,p,x){var T=this;m.loadModule("ace/ext/prompt",function(_){_.prompt(T,u,p,x)})},f}();w.$uid=0,w.prototype.curOp=null,w.prototype.prevOp={},w.prototype.$mergeableCommands=["backspace","del","insertstring"],w.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"],["&&","||"],["==","!="]],A.implement(w.prototype,l),m.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(f){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:f})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(f){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(f){var u=this;if(this.textInput.setReadOnly(f),!this.destroyed){this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(x){var T=!1;if(x&&x.type=="keydown"){if(x&&x.key&&!x.ctrlKey&&!x.metaKey&&(x.key==" "&&x.preventDefault(),T=x.key.length==1),!T)return}else x&&x.type!=="exec"&&(T=!0);if(T){u.hoverTooltip||(u.hoverTooltip=new R);var _=$.createElement("div");_.textContent=b("editor.tooltip.disable-editing","Editing is disabled"),u.hoverTooltip.isOpen||u.hoverTooltip.showForRange(u,u.getSelectionRange(),_)}else u.hoverTooltip&&u.hoverTooltip.isOpen&&u.hoverTooltip.hide()});var p=this.textInput.getElement();f?(S.addListener(p,"keydown",this.$readOnlyCallback,this),this.commands.on("exec",this.$readOnlyCallback),this.commands.on("commandUnavailable",this.$readOnlyCallback)):(S.removeListener(p,"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(f){this.textInput.setCopyWithEmptySelection(f)},initialValue:!1},cursorStyle:{set:function(f){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(f){this.setAutoScrollEditorIntoView(f)}},keyboardHandler:{set:function(f){this.setKeyboardHandler(f)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(f){this.session.setValue(f)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(f){this.setSession(f)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(f){this.renderer.$gutterLayer.setShowLineNumbers(f),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),f&&this.$relativeLineNumbers?y.attach(this):y.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(f){this.$showLineNumbers&&f?y.attach(this):y.detach(this)}},placeholder:{set:function(f){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var u=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(u&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),$.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!u&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),$.addCssClass(this.container,"ace_hasPlaceholder");var p=$.createElement("div");p.className="ace_placeholder",p.textContent=this.$placeholder||"",this.renderer.placeholderNode=p,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!u&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(f){var u={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(T){T.blur(),T.renderer.scroller.focus()},readOnly:!0},p=function(T){if(T.target==this.renderer.scroller&&T.keyCode===C.enter){T.preventDefault();var _=this.getCursorPosition().row;this.isRowVisible(_)||this.scrollToLine(_,!0,!0),this.focus()}},x;f?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(c.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",b("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",b("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",p.bind(this)),this.commands.addCommand(u),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",b("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",b("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),x||(x=new d(this)),x.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",p.bind(this)),this.commands.removeCommand(u),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),x&&x.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(f){this.$textInputAriaLabel=f},initialValue:""},enableMobileMenu:{set:function(f){this.$enableMobileMenu=f},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 y={getText:function(f,u){return(Math.abs(f.selection.lead.row-u)||u+1+(u<9?"·":""))+""},getWidth:function(f,u,p){return Math.max(u.toString().length,(p.lastRow+1).toString().length,2)*p.characterWidth},update:function(f,u){u.renderer.$loop.schedule(u.renderer.CHANGE_GUTTER)},attach:function(f){f.renderer.$gutterLayer.$renderer=this,f.on("changeSelection",this.update),this.update(null,f)},detach:function(f){f.renderer.$gutterLayer.$renderer==this&&(f.renderer.$gutterLayer.$renderer=null),f.off("changeSelection",this.update),this.update(null,f)}};L.Editor=w}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(k,L,H){var E=k("../lib/dom"),A=function(){function $(a,c){this.element=a,this.canvasHeight=c||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return $.prototype.moveContainer=function(a){E.translate(this.element,0,-(a.firstRowScreen*a.lineHeight%this.canvasHeight)-a.offset*this.$offsetCoefficient)},$.prototype.pageChanged=function(a,c){return Math.floor(a.firstRowScreen*a.lineHeight/this.canvasHeight)!==Math.floor(c.firstRowScreen*c.lineHeight/this.canvasHeight)},$.prototype.computeLineTop=function(a,c,i){var o=c.firstRowScreen*c.lineHeight,n=Math.floor(o/this.canvasHeight),t=i.documentToScreenRow(a,0)*c.lineHeight;return t-n*this.canvasHeight},$.prototype.computeLineHeight=function(a,c,i){return c.lineHeight*i.getRowLineCount(a)},$.prototype.getLength=function(){return this.cells.length},$.prototype.get=function(a){return this.cells[a]},$.prototype.shift=function(){this.$cacheCell(this.cells.shift())},$.prototype.pop=function(){this.$cacheCell(this.cells.pop())},$.prototype.push=function(a){if(Array.isArray(a)){this.cells.push.apply(this.cells,a);for(var c=E.createFragment(this.element),i=0;i<a.length;i++)c.appendChild(a[i].element);this.element.appendChild(c)}else this.cells.push(a),this.element.appendChild(a.element)},$.prototype.unshift=function(a){if(Array.isArray(a)){this.cells.unshift.apply(this.cells,a);for(var c=E.createFragment(this.element),i=0;i<a.length;i++)c.appendChild(a[i].element);this.element.firstChild?this.element.insertBefore(c,this.element.firstChild):this.element.appendChild(c)}else this.cells.unshift(a),this.element.insertAdjacentElement("afterbegin",a.element)},$.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},$.prototype.$cacheCell=function(a){a&&(a.element.remove(),this.cellCache.push(a))},$.prototype.createCell=function(a,c,i,o){var n=this.cellCache.pop();if(!n){var t=E.createElement("div");o&&o(t),this.element.appendChild(t),n={element:t,text:"",row:a}}return n.row=a,n},$}();L.Lines=A}),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(k,L,H){var E=k("../lib/dom"),A=k("../lib/oop"),$=k("../lib/lang"),a=k("../lib/event_emitter").EventEmitter,c=k("./lines").Lines,i=k("../config").nls,o=function(){function t(e){this.element=E.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new c(this.element),this.$lines.$offsetCoefficient=1}return t.prototype.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},t.prototype.addGutterDecoration=function(e,r){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,r)},t.prototype.removeGutterDecoration=function(e,r){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,r)},t.prototype.setAnnotations=function(e){this.$annotations=[];for(var r=0;r<e.length;r++){var s=e[r],l=s.row,h=this.$annotations[l];h||(h=this.$annotations[l]={text:[],type:[],displayText:[]});var v=s.text,m=s.text,g=s.type;v=v?$.escapeHTML(v):s.html||"",m=m||s.html||"",h.text.indexOf(v)===-1&&(h.text.push(v),h.type.push(g),h.displayText.push(m));var d=s.className;d?h.className=d:g==="error"?h.className=" ace_error":g==="security"&&!/\bace_error\b/.test(h.className)?h.className=" ace_security":g==="warning"&&!/\bace_(error|security)\b/.test(h.className)?h.className=" ace_warning":g==="info"&&!h.className?h.className=" ace_info":g==="hint"&&!h.className&&(h.className=" ace_hint")}},t.prototype.$updateAnnotations=function(e){if(this.$annotations.length){var r=e.start.row,s=e.end.row-r;if(s!==0)if(e.action=="remove")this.$annotations.splice(r,s+1,null);else{var l=new Array(s+1);l.unshift(r,1),this.$annotations.splice.apply(this.$annotations,l)}}},t.prototype.update=function(e){this.config=e;var r=this.session,s=e.firstRow,l=Math.min(e.lastRow+e.gutterOffset,r.getLength()-1);this.oldLastRow=l,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var h=r.getNextFoldLine(s),v=h?h.start.row:1/0,m=null,g=-1,d=s;;){if(d>v&&(d=h.end.row+1,h=r.getNextFoldLine(d,h),v=h?h.start.row:1/0),d>l){for(;this.$lines.getLength()>g+1;)this.$lines.pop();break}m=this.$lines.get(++g),m?m.row=d:(m=this.$lines.createCell(d,e,this.session,n),this.$lines.push(m)),this.$renderCell(m,e,h,d),d++}this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$updateGutterWidth=function(e){var r=this.session,s=r.gutterRenderer||this.$renderer,l=r.$firstLineNumber,h=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||r.$useWrapMode)&&(h=r.getLength()+l-1);var v=s?s.getWidth(r,h,e):h.toString().length*e.characterWidth,m=this.$padding||this.$computePadding();v+=m.left+m.right,v!==this.gutterWidth&&!isNaN(v)&&(this.gutterWidth=v,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",v))},t.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},t.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!(this.$cursorCell&&this.$cursorCell.row==e)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var r=this.$lines.cells;this.$cursorCell=null;for(var s=0;s<r.length;s++){var l=r[s];if(l.row>=this.$cursorRow){if(l.row>this.$cursorRow){var h=this.session.getFoldLine(this.$cursorRow);if(s>0&&h&&h.start.row==r[s-1].row)l=r[s-1];else break}l.element.className="ace_gutter-active-line "+l.element.className,this.$cursorCell=l;break}}}}},t.prototype.scrollLines=function(e){var r=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(r,e))return this.update(e);this.$lines.moveContainer(e);var s=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),l=this.oldLastRow;if(this.oldLastRow=s,!r||l<e.firstRow)return this.update(e);if(s<r.firstRow)return this.update(e);if(r.firstRow<e.firstRow)for(var h=this.session.getFoldedRowCount(r.firstRow,e.firstRow-1);h>0;h--)this.$lines.shift();if(l>s)for(var h=this.session.getFoldedRowCount(s+1,l);h>0;h--)this.$lines.pop();e.firstRow<r.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,r.firstRow-1)),s>l&&this.$lines.push(this.$renderLines(e,l+1,s)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$renderLines=function(e,r,s){for(var l=[],h=r,v=this.session.getNextFoldLine(h),m=v?v.start.row:1/0;h>m&&(h=v.end.row+1,v=this.session.getNextFoldLine(h,v),m=v?v.start.row:1/0),!(h>s);){var g=this.$lines.createCell(h,e,this.session,n);this.$renderCell(g,e,v,h),l.push(g),h++}return l},t.prototype.$renderCell=function(e,r,s,l){var h=e.element,v=this.session,m=h.childNodes[0],g=h.childNodes[1],d=h.childNodes[2],b=h.childNodes[3],M=d.firstChild,C=v.$firstLineNumber,S=v.$breakpoints,R=v.$decorations,w=v.gutterRenderer||this.$renderer,y=this.$showFoldWidgets&&v.foldWidgets,f=s?s.start.row:Number.MAX_VALUE,u=r.lineHeight+"px",p=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",x=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",T=(w?w.getText(v,l):l+C).toString();if(this.$highlightGutterLine&&(l==this.$cursorRow||s&&l<this.$cursorRow&&l>=f&&this.$cursorRow<=s.end.row)&&(p+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),S[l]&&(p+=S[l]),R[l]&&(p+=R[l]),this.$annotations[l]&&l!==f&&(p+=this.$annotations[l].className),y){var _=y[l];_==null&&(_=y[l]=v.getFoldWidget(l))}if(_){var I="ace_fold-widget ace_"+_,O=_=="start"&&l==f&&l<s.end.row;if(O){I+=" ace_closed";for(var z="",D=!1,N=l+1;N<=s.end.row;N++)if(this.$annotations[N]){if(this.$annotations[N].className===" ace_error"){D=!0,z=" ace_error_fold";break}this.$annotations[N].className===" ace_security"?(D=!0,z=" ace_security_fold"):this.$annotations[N].className===" ace_warning"&&z!==" ace_security_fold"&&(D=!0,z=" ace_warning_fold")}p+=z}else I+=" ace_open";g.className!=I&&(g.className=I),E.setStyle(g.style,"height",u),E.setStyle(g.style,"display","inline-block"),g.setAttribute("role","button"),g.setAttribute("tabindex","-1");var F=v.getFoldWidgetRange(l);F?g.setAttribute("aria-label",i("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[F.start.row+1,F.end.row+1])):s?g.setAttribute("aria-label",i("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[s.start.row+1,s.end.row+1])):g.setAttribute("aria-label",i("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[l+1])),O?(g.setAttribute("aria-expanded","false"),g.setAttribute("title",i("gutter.code-folding.closed.title","Unfold code"))):(g.setAttribute("aria-expanded","true"),g.setAttribute("title",i("gutter.code-folding.open.title","Fold code")))}else g&&(E.setStyle(g.style,"display","none"),g.setAttribute("tabindex","0"),g.removeAttribute("role"),g.removeAttribute("aria-label"));var B=this.session.$gutterCustomWidgets[l];if(B?this.$addCustomWidget(l,B,e):b&&this.$removeCustomWidget(l,e),D&&this.$showFoldedAnnotations){d.className="ace_gutter_annotation",M.className=x,M.className+=z,E.setStyle(M.style,"height",u),E.setStyle(d.style,"display","block"),E.setStyle(d.style,"height",u);var P;switch(z){case" ace_error_fold":P=i("gutter.annotation.aria-label.error","Error, read annotations row $0",[T]);break;case" ace_security_fold":P=i("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[T]);break;case" ace_warning_fold":P=i("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[T]);break}d.setAttribute("aria-label",P),d.setAttribute("tabindex","-1"),d.setAttribute("role","button")}else if(this.$annotations[l]){d.className="ace_gutter_annotation",M.className=x,this.$useSvgGutterIcons?M.className+=this.$annotations[l].className:h.classList.add(this.$annotations[l].className.replace(" ","")),E.setStyle(M.style,"height",u),E.setStyle(d.style,"display","block"),E.setStyle(d.style,"height",u);var P;switch(this.$annotations[l].className){case" ace_error":P=i("gutter.annotation.aria-label.error","Error, read annotations row $0",[T]);break;case" ace_security":P=i("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[T]);break;case" ace_warning":P=i("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[T]);break;case" ace_info":P=i("gutter.annotation.aria-label.info","Info, read annotations row $0",[T]);break;case" ace_hint":P=i("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[T]);break}d.setAttribute("aria-label",P),d.setAttribute("tabindex","-1"),d.setAttribute("role","button")}else E.setStyle(d.style,"display","none"),d.removeAttribute("aria-label"),d.removeAttribute("role"),d.setAttribute("tabindex","0");return T!==m.data&&(m.data=T),h.className!=p&&(h.className=p),E.setStyle(e.element.style,"height",this.$lines.computeLineHeight(l,r,v)+"px"),E.setStyle(e.element.style,"top",this.$lines.computeLineTop(l,r,v)+"px"),e.text=T,d.style.display==="none"&&g.style.display==="none"&&!B?e.element.setAttribute("aria-hidden",!0):e.element.setAttribute("aria-hidden",!1),e},t.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},t.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},t.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},t.prototype.setShowFoldWidgets=function(e){e?E.addCssClass(this.element,"ace_folding-enabled"):E.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},t.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},t.prototype.$hideFoldWidget=function(e,r){var s=r||this.$getGutterCell(e);if(s&&s.element){var l=s.element.childNodes[1];l&&E.setStyle(l.style,"display","none")}},t.prototype.$showFoldWidget=function(e,r){var s=r||this.$getGutterCell(e);if(s&&s.element){var l=s.element.childNodes[1];l&&this.session.foldWidgets&&this.session.foldWidgets[s.row]&&E.setStyle(l.style,"display","inline-block")}},t.prototype.$getGutterCell=function(e){var r=this.$lines.cells,s=this.session.documentToScreenRow(e,0);return r[e-this.config.firstRowScreen-(e-s)]},t.prototype.$addCustomWidget=function(e,r,s){var l=r.className,h=r.label,v=r.title,m=r.callbacks;this.session.$gutterCustomWidgets[e]={className:l,label:h,title:v,callbacks:m},this.$hideFoldWidget(e,s);var g=s||this.$getGutterCell(e);if(g&&g.element){var d=g.element.querySelector(".ace_custom-widget");d&&d.remove(),d=E.createElement("span"),d.className="ace_custom-widget ".concat(l),d.setAttribute("tabindex","-1"),d.setAttribute("role","button"),d.setAttribute("aria-label",h),d.setAttribute("title",v),E.setStyle(d.style,"display","inline-block"),E.setStyle(d.style,"height","inherit"),m&&m.onClick&&d.addEventListener("click",function(b){m.onClick(b,e),b.stopPropagation()}),g.element.appendChild(d)}},t.prototype.$removeCustomWidget=function(e,r){delete this.session.$gutterCustomWidgets[e],this.$showFoldWidget(e,r);var s=r||this.$getGutterCell(e);if(s&&s.element){var l=s.element.querySelector(".ace_custom-widget");l&&s.element.removeChild(l)}},t.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=E.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},t.prototype.getRegion=function(e){var r=this.$padding||this.$computePadding(),s=this.element.getBoundingClientRect();if(e.x<r.left+s.left)return"markers";if(this.$showFoldWidgets&&e.x>s.right-r.right)return"foldWidgets"},t}();o.prototype.$fixedWidth=!1,o.prototype.$highlightGutterLine=!0,o.prototype.$renderer="",o.prototype.$showLineNumbers=!0,o.prototype.$showFoldWidgets=!0,A.implement(o.prototype,a);function n(t){var e=document.createTextNode("");t.appendChild(e);var r=E.createElement("span");t.appendChild(r);var s=E.createElement("span");t.appendChild(s);var l=E.createElement("span");return s.appendChild(l),t}L.Gutter=o}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(k,L,H){var E=k("../range").Range,A=k("../lib/dom"),$=function(){function c(i){this.element=A.createElement("div"),this.element.className="ace_layer ace_marker-layer",i.appendChild(this.element)}return c.prototype.setPadding=function(i){this.$padding=i},c.prototype.setSession=function(i){this.session=i},c.prototype.setMarkers=function(i){this.markers=i},c.prototype.elt=function(i,o){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=o,n.className=i},c.prototype.update=function(i){if(i){this.config=i,this.i=0;var o;for(var n in this.markers){var t=this.markers[n];if(!t.range){t.update(o,this,this.session,i);continue}var e=t.range.clipRows(i.firstRow,i.lastRow);if(!e.isEmpty())if(e=e.toScreenRange(this.session),t.renderer){var r=this.$getTop(e.start.row,i),s=this.$padding+e.start.column*i.characterWidth;t.renderer(o,e,s,r,i)}else t.type=="fullLine"?this.drawFullLineMarker(o,e,t.clazz,i):t.type=="screenLine"?this.drawScreenLineMarker(o,e,t.clazz,i):e.isMultiLine()?t.type=="text"?this.drawTextMarker(o,e,t.clazz,i):this.drawMultiLineMarker(o,e,t.clazz,i):this.drawSingleLineMarker(o,e,t.clazz+" ace_start ace_br15",i)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},c.prototype.$getTop=function(i,o){return(i-o.firstRowScreen)*o.lineHeight},c.prototype.drawTextMarker=function(i,o,n,t,e){for(var r=this.session,s=o.start.row,l=o.end.row,h=s,v=0,m=0,g=r.getScreenLastRowColumn(h),d=new E(h,o.start.column,h,m);h<=l;h++)d.start.row=d.end.row=h,d.start.column=h==s?o.start.column:r.getRowWrapIndent(h),d.end.column=g,v=m,m=g,g=h+1<l?r.getScreenLastRowColumn(h+1):h==l?0:o.end.column,this.drawSingleLineMarker(i,d,n+(h==s?" ace_start":"")+" ace_br"+a(h==s||h==s+1&&o.start.column,v<m,m>g,h==l),t,h==l?0:1,e)},c.prototype.drawMultiLineMarker=function(i,o,n,t,e){var r=this.$padding,s=t.lineHeight,l=this.$getTop(o.start.row,t),h=r+o.start.column*t.characterWidth;if(e=e||"",this.session.$bidiHandler.isBidiRow(o.start.row)){var v=o.clone();v.end.row=v.start.row,v.end.column=this.session.getLine(v.start.row).length,this.drawBidiSingleLineMarker(i,v,n+" ace_br1 ace_start",t,null,e)}else this.elt(n+" ace_br1 ace_start","height:"+s+"px;right:"+r+"px;top:"+l+"px;left:"+h+"px;"+(e||""));if(this.session.$bidiHandler.isBidiRow(o.end.row)){var v=o.clone();v.start.row=v.end.row,v.start.column=0,this.drawBidiSingleLineMarker(i,v,n+" ace_br12",t,null,e)}else{l=this.$getTop(o.end.row,t);var m=o.end.column*t.characterWidth;this.elt(n+" ace_br12","height:"+s+"px;width:"+m+"px;top:"+l+"px;left:"+r+"px;"+(e||""))}if(s=(o.end.row-o.start.row-1)*t.lineHeight,!(s<=0)){l=this.$getTop(o.start.row+1,t);var g=(o.start.column?1:0)|(o.end.column?0:8);this.elt(n+(g?" ace_br"+g:""),"height:"+s+"px;right:"+r+"px;top:"+l+"px;left:"+r+"px;"+(e||""))}},c.prototype.drawSingleLineMarker=function(i,o,n,t,e,r){if(this.session.$bidiHandler.isBidiRow(o.start.row))return this.drawBidiSingleLineMarker(i,o,n,t,e,r);var s=t.lineHeight,l=(o.end.column+(e||0)-o.start.column)*t.characterWidth,h=this.$getTop(o.start.row,t),v=this.$padding+o.start.column*t.characterWidth;this.elt(n,"height:"+s+"px;width:"+l+"px;top:"+h+"px;left:"+v+"px;"+(r||""))},c.prototype.drawBidiSingleLineMarker=function(i,o,n,t,e,r){var s=t.lineHeight,l=this.$getTop(o.start.row,t),h=this.$padding,v=this.session.$bidiHandler.getSelections(o.start.column,o.end.column);v.forEach(function(m){this.elt(n,"height:"+s+"px;width:"+(m.width+(e||0))+"px;top:"+l+"px;left:"+(h+m.left)+"px;"+(r||""))},this)},c.prototype.drawFullLineMarker=function(i,o,n,t,e){var r=this.$getTop(o.start.row,t),s=t.lineHeight;o.start.row!=o.end.row&&(s+=this.$getTop(o.end.row,t)-r),this.elt(n,"height:"+s+"px;top:"+r+"px;left:0;right:0;"+(e||""))},c.prototype.drawScreenLineMarker=function(i,o,n,t,e){var r=this.$getTop(o.start.row,t),s=t.lineHeight;this.elt(n,"height:"+s+"px;top:"+r+"px;left:0;right:0;"+(e||""))},c}();$.prototype.$padding=0;function a(c,i,o,n){return(c?1:0)|(i?2:0)|(o?4:0)|(n?8:0)}L.Marker=$}),ace.define("ace/layer/text_util",["require","exports","module"],function(k,L,H){var E=new Set(["text","rparen","lparen"]);L.isTextToken=function(A){return E.has(A)}}),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(k,L,H){var E=k("../lib/oop"),A=k("../lib/dom"),$=k("../lib/lang"),a=k("./lines").Lines,c=k("../lib/event_emitter").EventEmitter,i=k("../config").nls,o=k("./text_util").isTextToken,n=function(){function t(e){this.dom=A,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new a(this.element)}return t.prototype.$updateEolChar=function(){var e=this.session.doc,r=e.getNewLineCharacter()==`
217
+ `&&e.getNewLineMode()!="windows",s=r?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=s)return this.EOL_CHAR=s,!0},t.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},t.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},t.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},t.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",(function(r){this._signal("changeCharacterSize",r)}).bind(this)),this.$pollSizeChanges()},t.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},t.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},t.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString()},t.prototype.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,typeof e=="string"?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},t.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},t.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides===e?!1:(this.$highlightIndentGuides=e,e)},t.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var r=this.$tabStrings=[0],s=1;s<e+1;s++)if(this.showTabs){var l=this.dom.createElement("span");l.className="ace_invisible ace_invisible_tab",l.textContent=$.stringRepeat(this.TAB_CHAR,s),r.push(l)}else r.push(this.dom.createTextNode($.stringRepeat(" ",s),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var h="ace_indent-guide",v=this.showSpaces?" ace_invisible ace_invisible_space":"",m=this.showSpaces?$.stringRepeat(this.SPACE_CHAR,this.tabSize):$.stringRepeat(" ",this.tabSize),g=this.showTabs?" ace_invisible ace_invisible_tab":"",d=this.showTabs?$.stringRepeat(this.TAB_CHAR,this.tabSize):m,l=this.dom.createElement("span");l.className=h+v,l.textContent=m,this.$tabStrings[" "]=l;var l=this.dom.createElement("span");l.className=h+g,l.textContent=d,this.$tabStrings[" "]=l}},t.prototype.updateLines=function(e,r,s){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var l=Math.max(r,e.firstRow),h=Math.min(s,e.lastRow),v=this.element.childNodes,m=0,d=e.firstRow;d<l;d++){var b=this.session.getFoldLine(d);if(b)if(b.containsRow(l)){l=b.start.row;break}else d=b.end.row;m++}for(var g=!1,d=l,b=this.session.getNextFoldLine(d),M=b?b.start.row:1/0;d>M&&(d=b.end.row+1,b=this.session.getNextFoldLine(d,b),M=b?b.start.row:1/0),!(d>h);){var C=v[m++];if(C){this.dom.removeChildren(C),this.$renderLine(C,d,d==M?b:!1),g&&(C.style.top=this.$lines.computeLineTop(d,e,this.session)+"px");var S=e.lineHeight*this.session.getRowLength(d)+"px";C.style.height!=S&&(g=!0,C.style.height=S)}d++}if(g)for(;m<this.$lines.cells.length;){var R=this.$lines.cells[m++];R.element.style.top=this.$lines.computeLineTop(R.row,e,this.session)+"px"}},t.prototype.scrollLines=function(e){var r=this.config;if(this.config=e,this.$lines.pageChanged(r,e))return this.update(e);this.$lines.moveContainer(e);var s=e.lastRow,l=r?r.lastRow:-1;if(!r||l<e.firstRow)return this.update(e);if(s<r.firstRow)return this.update(e);if(!r||r.lastRow<e.firstRow)return this.update(e);if(e.lastRow<r.firstRow)return this.update(e);if(r.firstRow<e.firstRow)for(var h=this.session.getFoldedRowCount(r.firstRow,e.firstRow-1);h>0;h--)this.$lines.shift();if(r.lastRow>e.lastRow)for(var h=this.session.getFoldedRowCount(e.lastRow+1,r.lastRow);h>0;h--)this.$lines.pop();e.firstRow<r.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,r.firstRow-1)),e.lastRow>r.lastRow&&this.$lines.push(this.$renderLinesFragment(e,r.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},t.prototype.$renderLinesFragment=function(e,r,s){for(var l=[],h=r,v=this.session.getNextFoldLine(h),m=v?v.start.row:1/0;h>m&&(h=v.end.row+1,v=this.session.getNextFoldLine(h,v),m=v?v.start.row:1/0),!(h>s);){var g=this.$lines.createCell(h,e,this.session),d=g.element;this.dom.removeChildren(d),A.setStyle(d.style,"height",this.$lines.computeLineHeight(h,e,this.session)+"px"),A.setStyle(d.style,"top",this.$lines.computeLineTop(h,e,this.session)+"px"),this.$renderLine(d,h,h==m?v:!1),this.$useLineGroups()?d.className="ace_line_group":d.className="ace_line",l.push(g),h++}return l},t.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var r=e.firstRow,s=e.lastRow,l=this.$lines;l.getLength();)l.pop();l.push(this.$renderLinesFragment(e,r,s))},t.prototype.$renderToken=function(e,r,s,l){for(var h=this,v=/(\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,m=this.dom.createFragment(this.element),g,d=0;g=v.exec(l);){var b=g[1],M=g[2],C=g[3],S=g[4],R=g[5];if(!(!h.showSpaces&&M)){var w=d!=g.index?l.slice(d,g.index):"";if(d=g.index+g[0].length,w&&m.appendChild(this.dom.createTextNode(w,this.element)),b){var y=h.session.getScreenTabSize(r+g.index),f=h.$tabStrings[y].cloneNode(!0);f.charCount=1,m.appendChild(f),r+=y-1}else if(M)if(h.showSpaces){var u=this.dom.createElement("span");u.className="ace_invisible ace_invisible_space",u.textContent=$.stringRepeat(h.SPACE_CHAR,M.length),m.appendChild(u)}else m.appendChild(this.dom.createTextNode(M,this.element));else if(C){var u=this.dom.createElement("span");u.className="ace_invisible ace_invisible_space ace_invalid",u.textContent=$.stringRepeat(h.SPACE_CHAR,C.length),m.appendChild(u)}else if(S){r+=1;var u=this.dom.createElement("span");u.style.width=h.config.characterWidth*2+"px",u.className=h.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",u.textContent=h.showSpaces?h.SPACE_CHAR:S,m.appendChild(u)}else if(R){r+=1;var u=this.dom.createElement("span");u.style.width=h.config.characterWidth*2+"px",u.className="ace_cjk",u.textContent=R,m.appendChild(u)}}}if(m.appendChild(this.dom.createTextNode(d?l.slice(d):l,this.element)),o(s.type))e.appendChild(m);else{var p="ace_"+s.type.replace(/\./g," ace_"),u=this.dom.createElement("span");s.type=="fold"&&(u.style.width=s.value.length*this.config.characterWidth+"px",u.setAttribute("title",i("inline-fold.closed.title","Unfold code"))),u.className=p,u.appendChild(m),e.appendChild(u)}return r+l.length},t.prototype.renderIndentGuide=function(e,r,s){var l=r.search(this.$indentGuideRe);if(l<=0||l>=s)return r;if(r[0]==" "){l-=l%this.tabSize;for(var h=l/this.tabSize,v=0;v<h;v++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),r.substr(l)}else if(r[0]==" "){for(var v=0;v<l;v++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),r.substr(l)}return this.$highlightIndentGuide(),r},t.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var e=this.session.doc.$lines;if(e){var r=this.session.selection.getCursor(),s=/^\s*/.exec(this.session.doc.getLine(r.row))[0].length,l=Math.floor(s/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:l,start:r.row};var h=this.session.$bracketHighlight;if(h){for(var v=this.session.$bracketHighlight.ranges,m=0;m<v.length;m++)if(r.row!==v[m].start.row){this.$highlightIndentGuideMarker.end=v[m].start.row+1,r.row>v[m].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&e[r.row]!==""&&r.column===e[r.row].length){this.$highlightIndentGuideMarker.dir=1;for(var m=r.row+1;m<e.length;m++){var g=e[m],d=/^\s*/.exec(g)[0].length;if(g!==""&&(this.$highlightIndentGuideMarker.end=m,d<=s))break}}this.$renderHighlightIndentGuide()}}},t.prototype.$clearActiveIndentGuide=function(){for(var e=this.element.querySelectorAll(".ace_indent-guide-active"),r=0;r<e.length;r++)e[r].classList.remove("ace_indent-guide-active")},t.prototype.$setIndentGuideActive=function(e,r){var s=this.session.doc.getLine(e.row);if(s!==""){var l=e.element;if(e.element.classList&&e.element.classList.contains("ace_line_group"))if(e.element.childNodes.length>0)l=e.element.childNodes[0];else return;var h=l.childNodes;if(h){var v=h[r-1];v&&v.classList&&v.classList.contains("ace_indent-guide")&&v.classList.add("ace_indent-guide-active")}}},t.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var r=this.$highlightIndentGuideMarker.indentLevel;if(r!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var s=0;s<e.length;s++){var l=e[s];if(this.$highlightIndentGuideMarker.end&&l.row>=this.$highlightIndentGuideMarker.start+1){if(l.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(l,r)}}else for(var s=e.length-1;s>=0;s--){var l=e[s];if(this.$highlightIndentGuideMarker.end&&l.row<this.$highlightIndentGuideMarker.start){if(l.row<this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(l,r)}}}},t.prototype.$createLineElement=function(e){var r=this.dom.createElement("div");return r.className="ace_line",r.style.height=this.config.lineHeight+"px",r},t.prototype.$renderWrappedLine=function(e,r,s){var l=0,h=0,v=s[0],m=0,g=this.$createLineElement();e.appendChild(g);for(var d=0;d<r.length;d++){var b=r[d],M=b.value;if(d==0&&this.displayIndentGuides){if(l=M.length,M=this.renderIndentGuide(g,M,v),!M)continue;l-=M.length}if(l+M.length<v)m=this.$renderToken(g,m,b,M),l+=M.length;else{for(;l+M.length>=v;){m=this.$renderToken(g,m,b,M.substring(0,v-l)),M=M.substring(v-l),l=v,g=this.$createLineElement(),e.appendChild(g);var C=this.dom.createTextNode($.stringRepeat(" ",s.indent),this.element);C.charCount=0,g.appendChild(C),h++,m=0,v=s[h]||Number.MAX_VALUE}M.length!=0&&(l+=M.length,m=this.$renderToken(g,m,b,M))}}s[s.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(g,m,null,"",!0)},t.prototype.$renderSimpleLine=function(e,r){for(var s=0,l=0;l<r.length;l++){var h=r[l],v=h.value;if(!(l==0&&this.displayIndentGuides&&(v=this.renderIndentGuide(e,v),!v))){if(s+v.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,s,h,v);s=this.$renderToken(e,s,h,v)}}},t.prototype.$renderOverflowMessage=function(e,r,s,l,h){s&&this.$renderToken(e,r,s,l.slice(0,this.MAX_LINE_LENGTH-r));var v=this.dom.createElement("span");v.className="ace_inline_button ace_keyword ace_toggle_wrap",v.textContent=h?"<hide>":"<click to see more...>",e.appendChild(v)},t.prototype.$renderLine=function(e,r,s){if(!s&&s!=!1&&(s=this.session.getFoldLine(r)),s)var l=this.$getFoldLineTokens(r,s);else var l=this.session.getTokens(r);var h=e;if(l.length){var v=this.session.getRowSplitData(r);if(v&&v.length){this.$renderWrappedLine(e,l,v);var h=e.lastChild}else{var h=e;this.$useLineGroups()&&(h=this.$createLineElement(),e.appendChild(h)),this.$renderSimpleLine(h,l)}}else this.$useLineGroups()&&(h=this.$createLineElement(),e.appendChild(h));if(this.showEOL&&h){s&&(r=s.end.row);var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_eol",m.textContent=r==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,h.appendChild(m)}},t.prototype.$getFoldLineTokens=function(e,r){var s=this.session,l=[];function h(m,g,d){for(var b=0,M=0;M+m[b].value.length<g;)if(M+=m[b].value.length,b++,b==m.length)return;if(M!=g){var C=m[b].value.substring(g-M);C.length>d-g&&(C=C.substring(0,d-g)),l.push({type:m[b].type,value:C}),M=g+C.length,b+=1}for(;M<d&&b<m.length;){var C=m[b].value;C.length+M>d?l.push({type:m[b].type,value:C.substring(0,d-M)}):l.push(m[b]),M+=C.length,b+=1}}var v=s.getTokens(e);return r.walk(function(m,g,d,b,M){m!=null?l.push({type:"fold",value:m}):(M&&(v=s.getTokens(g)),v.length&&h(v,b,d))},r.end.row,this.session.getLine(r.end.row).length),l},t.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},t}();n.prototype.EOF_CHAR="¶",n.prototype.EOL_CHAR_LF="¬",n.prototype.EOL_CHAR_CRLF="¤",n.prototype.EOL_CHAR=n.prototype.EOL_CHAR_LF,n.prototype.TAB_CHAR="—",n.prototype.SPACE_CHAR="·",n.prototype.$padding=0,n.prototype.MAX_LINE_LENGTH=1e4,n.prototype.showInvisibles=!1,n.prototype.showSpaces=!1,n.prototype.showTabs=!1,n.prototype.showEOL=!1,n.prototype.displayIndentGuides=!0,n.prototype.$highlightIndentGuides=!0,n.prototype.$tabStrings=[],n.prototype.destroy={},n.prototype.onChangeTabSize=n.prototype.$computeTabString,E.implement(n.prototype,c),L.Text=n}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(k,L,H){var E=k("../lib/dom"),A=function(){function $(a){this.element=E.createElement("div"),this.element.className="ace_layer ace_cursor-layer",a.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),E.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return $.prototype.$updateOpacity=function(a){for(var c=this.cursors,i=c.length;i--;)E.setStyle(c[i].style,"opacity",a?"":"0")},$.prototype.$startCssAnimation=function(){for(var a=this.cursors,c=a.length;c--;)a[c].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout((function(){this.$isAnimating&&E.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},$.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,E.removeCssClass(this.element,"ace_animate-blinking")},$.prototype.setPadding=function(a){this.$padding=a},$.prototype.setSession=function(a){this.session=a},$.prototype.setBlinking=function(a){a!=this.isBlinking&&(this.isBlinking=a,this.restartTimer())},$.prototype.setBlinkInterval=function(a){a!=this.blinkInterval&&(this.blinkInterval=a,this.restartTimer())},$.prototype.setSmoothBlinking=function(a){a!=this.smoothBlinking&&(this.smoothBlinking=a,E.setCssClass(this.element,"ace_smooth-blinking",a),this.$updateCursors(!0),this.restartTimer())},$.prototype.addCursor=function(){var a=E.createElement("div");return a.className="ace_cursor",this.element.appendChild(a),this.cursors.push(a),a},$.prototype.removeCursor=function(){if(this.cursors.length>1){var a=this.cursors.pop();return a.parentNode.removeChild(a),a}},$.prototype.hideCursor=function(){this.isVisible=!1,E.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},$.prototype.showCursor=function(){this.isVisible=!0,E.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},$.prototype.restartTimer=function(){var a=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,E.removeCssClass(this.element,"ace_smooth-blinking")),a(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout((function(){this.$isSmoothBlinking&&E.addCssClass(this.element,"ace_smooth-blinking")}).bind(this))),E.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var c=(function(){this.timeoutId=setTimeout(function(){a(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){a(!0),c()},this.blinkInterval),c()}},$.prototype.getPixelPosition=function(a,c){if(!this.config||!this.session)return{left:0,top:0};a||(a=this.session.selection.getCursor());var i=this.session.documentToScreenPosition(a),o=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,a.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth),n=(i.row-(c?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:o,top:n}},$.prototype.isCursorInView=function(a,c){return a.top>=0&&a.top<c.maxHeight},$.prototype.update=function(a){this.config=a;var c=this.session.$selectionMarkers,i=0,o=0;(c===void 0||c.length===0)&&(c=[{cursor:null}]);for(var i=0,n=c.length;i<n;i++){var t=this.getPixelPosition(c[i].cursor,!0);if(!((t.top>a.height+a.offset||t.top<0)&&i>1)){var e=this.cursors[o++]||this.addCursor(),r=e.style;this.drawCursor?this.drawCursor(e,t,a,c[i],this.session):this.isCursorInView(t,a)?(E.setStyle(r,"display","block"),E.translate(e,t.left,t.top),E.setStyle(r,"width",Math.round(a.characterWidth)+"px"),E.setStyle(r,"height",a.lineHeight+"px")):E.setStyle(r,"display","none")}}for(;this.cursors.length>o;)this.removeCursor();var s=this.session.getOverwrite();this.$setOverwrite(s),this.$pixelPos=t,this.restartTimer()},$.prototype.$setOverwrite=function(a){a!=this.overwrite&&(this.overwrite=a,a?E.addCssClass(this.element,"ace_overwrite-cursors"):E.removeCssClass(this.element,"ace_overwrite-cursors"))},$.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},$}();A.prototype.$padding=0,A.prototype.drawCursor=null,L.Cursor=A}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(k,L,H){var E=this&&this.__extends||function(){var e=function(r,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,h){l.__proto__=h}||function(l,h){for(var v in h)Object.prototype.hasOwnProperty.call(h,v)&&(l[v]=h[v])},e(r,s)};return function(r,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(r,s);function l(){this.constructor=r}r.prototype=s===null?Object.create(s):(l.prototype=s.prototype,new l)}}(),A=k("./lib/oop"),$=k("./lib/dom"),a=k("./lib/event"),c=k("./lib/event_emitter").EventEmitter,i=32768,o=function(){function e(r,s){this.element=$.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+s,this.inner=$.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),r.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addListener(this.element,"scroll",this.onScroll.bind(this)),a.addListener(this.element,"mousedown",a.preventDefault)}return e.prototype.setVisible=function(r){this.element.style.display=r?"":"none",this.isVisible=r,this.coeff=1},e}();A.implement(o.prototype,c);var n=function(e){E(r,e);function r(s,l){var h=e.call(this,s,"-v")||this;return h.scrollTop=0,h.scrollHeight=0,l.$scrollbarWidth=h.width=$.scrollbarWidth(s.ownerDocument),h.inner.style.width=h.element.style.width=(h.width||15)+5+"px",h.$minWidth=0,h}return r.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var s=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-s)/(this.coeff-s)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},r.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},r.prototype.setHeight=function(s){this.element.style.height=s+"px"},r.prototype.setScrollHeight=function(s){this.scrollHeight=s,s>i?(this.coeff=i/s,s=i):this.coeff!=1&&(this.coeff=1),this.inner.style.height=s+"px"},r.prototype.setScrollTop=function(s){this.scrollTop!=s&&(this.skipEvent=!0,this.scrollTop=s,this.element.scrollTop=s*this.coeff)},r}(o);n.prototype.setInnerHeight=n.prototype.setScrollHeight;var t=function(e){E(r,e);function r(s,l){var h=e.call(this,s,"-h")||this;return h.scrollLeft=0,h.height=l.$scrollbarWidth,h.inner.style.height=h.element.style.height=(h.height||15)+5+"px",h}return r.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},r.prototype.getHeight=function(){return this.isVisible?this.height:0},r.prototype.setWidth=function(s){this.element.style.width=s+"px"},r.prototype.setInnerWidth=function(s){this.inner.style.width=s+"px"},r.prototype.setScrollWidth=function(s){this.inner.style.width=s+"px"},r.prototype.setScrollLeft=function(s){this.scrollLeft!=s&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=s)},r}(o);L.ScrollBar=n,L.ScrollBarV=n,L.ScrollBarH=t,L.VScrollBar=n,L.HScrollBar=t}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(k,L,H){var E=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,l){s.__proto__=l}||function(s,l){for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(s[h]=l[h])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function s(){this.constructor=e}e.prototype=r===null?Object.create(r):(s.prototype=r.prototype,new s)}}(),A=k("./lib/oop"),$=k("./lib/dom"),a=k("./lib/event"),c=k("./lib/event_emitter").EventEmitter;$.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
218
218
  position: absolute;
219
219
  background: rgba(128, 128, 128, 0.6);
220
220
  -moz-box-sizing: border-box;
@@ -252,7 +252,7 @@
252
252
  .ace_editor>.ace_sb_grabbed {
253
253
  z-index: 8;
254
254
  background: #000;
255
- }`,"ace_scrollbar.css",!1);var i=function(){function t(e,r){this.element=$.createElement("div"),this.element.className="ace_sb"+r,this.inner=$.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return t.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},t}();A.implement(i.prototype,c);var o=function(t){E(e,t);function e(r,s){var l=t.call(this,r,"-v")||this;return l.scrollTop=0,l.scrollHeight=0,l.parent=r,l.width=l.VScrollWidth,l.renderer=s,l.inner.style.width=l.element.style.width=(l.width||15)+"px",l.$minWidth=0,l}return e.prototype.onMouseDown=function(r,s){if(r==="mousedown"&&!(a.getButton(s)!==0||s.detail===2)){if(s.target===this.inner){var l=this,h=s.clientY,v=function(S){h=S.clientY},m=function(){clearInterval(M)},g=s.clientY,d=this.thumbTop,b=function(){if(h!==void 0){var S=l.scrollTopFromThumbTop(d+h-g);S!==l.scrollTop&&l._emit("scroll",{data:S})}};a.capture(this.inner,v,m);var M=setInterval(b,20);return a.preventDefault(s)}var C=s.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(C)}),a.preventDefault(s)}},e.prototype.getHeight=function(){return this.height},e.prototype.scrollTopFromThumbTop=function(r){var s=r*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return s=s>>0,s<0?s=0:s>this.pageHeight-this.viewHeight&&(s=this.pageHeight-this.viewHeight),s},e.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},e.prototype.setHeight=function(r){this.height=Math.max(0,r),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},e.prototype.setScrollHeight=function(r,s){this.pageHeight===r&&!s||(this.pageHeight=r,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})))},e.prototype.setScrollTop=function(r){this.scrollTop=r,r<0&&(r=0),this.thumbTop=r*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},e}(i);o.prototype.setInnerHeight=o.prototype.setScrollHeight;var n=function(t){E(e,t);function e(r,s){var l=t.call(this,r,"-h")||this;return l.scrollLeft=0,l.scrollWidth=0,l.height=l.HScrollHeight,l.inner.style.height=l.element.style.height=(l.height||12)+"px",l.renderer=s,l}return e.prototype.onMouseDown=function(r,s){if(r==="mousedown"&&!(a.getButton(s)!==0||s.detail===2)){if(s.target===this.inner){var l=this,h=s.clientX,v=function(S){h=S.clientX},m=function(){clearInterval(M)},g=s.clientX,d=this.thumbLeft,b=function(){if(h!==void 0){var S=l.scrollLeftFromThumbLeft(d+h-g);S!==l.scrollLeft&&l._emit("scroll",{data:S})}};a.capture(this.inner,v,m);var M=setInterval(b,20);return a.preventDefault(s)}var C=s.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(C)}),a.preventDefault(s)}},e.prototype.getHeight=function(){return this.isVisible?this.height:0},e.prototype.scrollLeftFromThumbLeft=function(r){var s=r*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return s=s>>0,s<0?s=0:s>this.pageWidth-this.viewWidth&&(s=this.pageWidth-this.viewWidth),s},e.prototype.setWidth=function(r){this.width=Math.max(0,r),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},e.prototype.setScrollWidth=function(r,s){this.pageWidth===r&&!s||(this.pageWidth=r,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})))},e.prototype.setScrollLeft=function(r){this.scrollLeft=r,r<0&&(r=0),this.thumbLeft=r*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},e}(i);n.prototype.setInnerWidth=n.prototype.setScrollWidth,x.ScrollBar=o,x.ScrollBarV=o,x.ScrollBarH=n,x.VScrollBar=o,x.HScrollBar=n}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(k,x,H){var E=k("./lib/event"),A=function(){function $(a,c){this.onRender=a,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=c||window;var i=this;this._flush=function(o){i.pending=!1;var n=i.changes;if(n&&(E.blockIdle(100),i.changes=0,i.onRender(n)),i.changes){if(i.$recursionLimit--<0)return;i.schedule()}else i.$recursionLimit=2}}return $.prototype.schedule=function(a){this.changes=this.changes|a,this.changes&&!this.pending&&(E.nextFrame(this._flush),this.pending=!0)},$.prototype.clear=function(a){var c=this.changes;return this.changes=0,c},$}();x.RenderLoop=A}),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(k,x,H){var E=k("../lib/oop"),A=k("../lib/dom"),$=k("../lib/lang"),a=k("../lib/event"),c=k("../lib/useragent"),i=k("../lib/event_emitter").EventEmitter,o=512,n=typeof ResizeObserver=="function",t=200,e=function(){function r(s){this.el=A.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=A.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=A.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),s.appendChild(this.el),this.$measureNode.textContent=$.stringRepeat("X",o),this.$characterSize={width:0,height:0},n?this.$addObserver():this.checkForSizeChanges()}return r.prototype.$setMeasureNodeStyles=function(s,l){s.width=s.height="auto",s.left=s.top="0px",s.visibility="hidden",s.position="absolute",s.whiteSpace="pre",c.isIE<8?s["font-family"]="inherit":s.font="inherit",s.overflow=l?"hidden":"visible"},r.prototype.checkForSizeChanges=function(s){if(s===void 0&&(s=this.$measureSizes()),s&&(this.$characterSize.width!==s.width||this.$characterSize.height!==s.height)){this.$measureNode.style.fontWeight="bold";var l=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=s,this.charSizes=Object.create(null),this.allowBoldFonts=l&&l.width===s.width&&l.height===s.height,this._emit("changeCharacterSize",{data:s})}},r.prototype.$addObserver=function(){var s=this;this.$observer=new window.ResizeObserver(function(l){s.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},r.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var s=this;return this.$pollSizeChangesTimer=a.onIdle(function l(){s.checkForSizeChanges(),a.onIdle(l,500)},500)},r.prototype.setPolling=function(s){s?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},r.prototype.$measureSizes=function(s){var l={height:(s||this.$measureNode).clientHeight,width:(s||this.$measureNode).clientWidth/o};return l.width===0||l.height===0?null:l},r.prototype.$measureCharWidth=function(s){this.$main.textContent=$.stringRepeat(s,o);var l=this.$main.getBoundingClientRect();return l.width/o},r.prototype.getCharacterWidth=function(s){var l=this.charSizes[s];return l===void 0&&(l=this.charSizes[s]=this.$measureCharWidth(s)/this.$characterSize.width),l},r.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},r.prototype.$getZoom=function(s){return!s||!s.parentElement?1:(Number(window.getComputedStyle(s).zoom)||1)*this.$getZoom(s.parentElement)},r.prototype.$initTransformMeasureNodes=function(){var s=function(l,h){return["div",{style:"position: absolute;top:"+l+"px;left:"+h+"px;"}]};this.els=A.buildDom([s(0,0),s(t,0),s(0,t),s(t,t)],this.el)},r.prototype.transformCoordinates=function(s,l){if(s){var h=this.$getZoom(this.el);s=d(1/h,s)}function v(I,O,z){var D=I[1]*O[0]-I[0]*O[1];return[(-O[1]*z[0]+O[0]*z[1])/D,(+I[1]*z[0]-I[0]*z[1])/D]}function m(I,O){return[I[0]-O[0],I[1]-O[1]]}function g(I,O){return[I[0]+O[0],I[1]+O[1]]}function d(I,O){return[I*O[0],I*O[1]]}this.els||this.$initTransformMeasureNodes();function b(I){var O=I.getBoundingClientRect();return[O.left,O.top]}var M=b(this.els[0]),C=b(this.els[1]),S=b(this.els[2]),R=b(this.els[3]),w=v(m(R,C),m(R,S),m(g(C,S),g(R,M))),y=d(1+w[0],m(C,M)),f=d(1+w[1],m(S,M));if(l){var u=l,p=w[0]*u[0]/t+w[1]*u[1]/t+1,L=g(d(u[0],y),d(u[1],f));return g(d(1/p/t,L),M)}var T=m(s,M),_=v(m(y,d(w[0],T)),m(f,d(w[1],T)),T);return d(t,_)},r}();e.prototype.$characterSize={width:0,height:0},E.implement(e.prototype,i),x.FontMetrics=e}),ace.define("ace/css/editor-css",["require","exports","module"],function(k,x,H){H.exports=`
255
+ }`,"ace_scrollbar.css",!1);var i=function(){function t(e,r){this.element=$.createElement("div"),this.element.className="ace_sb"+r,this.inner=$.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return t.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},t}();A.implement(i.prototype,c);var o=function(t){E(e,t);function e(r,s){var l=t.call(this,r,"-v")||this;return l.scrollTop=0,l.scrollHeight=0,l.parent=r,l.width=l.VScrollWidth,l.renderer=s,l.inner.style.width=l.element.style.width=(l.width||15)+"px",l.$minWidth=0,l}return e.prototype.onMouseDown=function(r,s){if(r==="mousedown"&&!(a.getButton(s)!==0||s.detail===2)){if(s.target===this.inner){var l=this,h=s.clientY,v=function(S){h=S.clientY},m=function(){clearInterval(M)},g=s.clientY,d=this.thumbTop,b=function(){if(h!==void 0){var S=l.scrollTopFromThumbTop(d+h-g);S!==l.scrollTop&&l._emit("scroll",{data:S})}};a.capture(this.inner,v,m);var M=setInterval(b,20);return a.preventDefault(s)}var C=s.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(C)}),a.preventDefault(s)}},e.prototype.getHeight=function(){return this.height},e.prototype.scrollTopFromThumbTop=function(r){var s=r*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return s=s>>0,s<0?s=0:s>this.pageHeight-this.viewHeight&&(s=this.pageHeight-this.viewHeight),s},e.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},e.prototype.setHeight=function(r){this.height=Math.max(0,r),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},e.prototype.setScrollHeight=function(r,s){this.pageHeight===r&&!s||(this.pageHeight=r,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})))},e.prototype.setScrollTop=function(r){this.scrollTop=r,r<0&&(r=0),this.thumbTop=r*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},e}(i);o.prototype.setInnerHeight=o.prototype.setScrollHeight;var n=function(t){E(e,t);function e(r,s){var l=t.call(this,r,"-h")||this;return l.scrollLeft=0,l.scrollWidth=0,l.height=l.HScrollHeight,l.inner.style.height=l.element.style.height=(l.height||12)+"px",l.renderer=s,l}return e.prototype.onMouseDown=function(r,s){if(r==="mousedown"&&!(a.getButton(s)!==0||s.detail===2)){if(s.target===this.inner){var l=this,h=s.clientX,v=function(S){h=S.clientX},m=function(){clearInterval(M)},g=s.clientX,d=this.thumbLeft,b=function(){if(h!==void 0){var S=l.scrollLeftFromThumbLeft(d+h-g);S!==l.scrollLeft&&l._emit("scroll",{data:S})}};a.capture(this.inner,v,m);var M=setInterval(b,20);return a.preventDefault(s)}var C=s.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(C)}),a.preventDefault(s)}},e.prototype.getHeight=function(){return this.isVisible?this.height:0},e.prototype.scrollLeftFromThumbLeft=function(r){var s=r*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return s=s>>0,s<0?s=0:s>this.pageWidth-this.viewWidth&&(s=this.pageWidth-this.viewWidth),s},e.prototype.setWidth=function(r){this.width=Math.max(0,r),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},e.prototype.setScrollWidth=function(r,s){this.pageWidth===r&&!s||(this.pageWidth=r,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})))},e.prototype.setScrollLeft=function(r){this.scrollLeft=r,r<0&&(r=0),this.thumbLeft=r*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},e}(i);n.prototype.setInnerWidth=n.prototype.setScrollWidth,L.ScrollBar=o,L.ScrollBarV=o,L.ScrollBarH=n,L.VScrollBar=o,L.HScrollBar=n}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(k,L,H){var E=k("./lib/event"),A=function(){function $(a,c){this.onRender=a,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=c||window;var i=this;this._flush=function(o){i.pending=!1;var n=i.changes;if(n&&(E.blockIdle(100),i.changes=0,i.onRender(n)),i.changes){if(i.$recursionLimit--<0)return;i.schedule()}else i.$recursionLimit=2}}return $.prototype.schedule=function(a){this.changes=this.changes|a,this.changes&&!this.pending&&(E.nextFrame(this._flush),this.pending=!0)},$.prototype.clear=function(a){var c=this.changes;return this.changes=0,c},$}();L.RenderLoop=A}),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(k,L,H){var E=k("../lib/oop"),A=k("../lib/dom"),$=k("../lib/lang"),a=k("../lib/event"),c=k("../lib/useragent"),i=k("../lib/event_emitter").EventEmitter,o=512,n=typeof ResizeObserver=="function",t=200,e=function(){function r(s){this.el=A.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=A.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=A.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),s.appendChild(this.el),this.$measureNode.textContent=$.stringRepeat("X",o),this.$characterSize={width:0,height:0},n?this.$addObserver():this.checkForSizeChanges()}return r.prototype.$setMeasureNodeStyles=function(s,l){s.width=s.height="auto",s.left=s.top="0px",s.visibility="hidden",s.position="absolute",s.whiteSpace="pre",c.isIE<8?s["font-family"]="inherit":s.font="inherit",s.overflow=l?"hidden":"visible"},r.prototype.checkForSizeChanges=function(s){if(s===void 0&&(s=this.$measureSizes()),s&&(this.$characterSize.width!==s.width||this.$characterSize.height!==s.height)){this.$measureNode.style.fontWeight="bold";var l=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=s,this.charSizes=Object.create(null),this.allowBoldFonts=l&&l.width===s.width&&l.height===s.height,this._emit("changeCharacterSize",{data:s})}},r.prototype.$addObserver=function(){var s=this;this.$observer=new window.ResizeObserver(function(l){s.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},r.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var s=this;return this.$pollSizeChangesTimer=a.onIdle(function l(){s.checkForSizeChanges(),a.onIdle(l,500)},500)},r.prototype.setPolling=function(s){s?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},r.prototype.$measureSizes=function(s){var l={height:(s||this.$measureNode).clientHeight,width:(s||this.$measureNode).clientWidth/o};return l.width===0||l.height===0?null:l},r.prototype.$measureCharWidth=function(s){this.$main.textContent=$.stringRepeat(s,o);var l=this.$main.getBoundingClientRect();return l.width/o},r.prototype.getCharacterWidth=function(s){var l=this.charSizes[s];return l===void 0&&(l=this.charSizes[s]=this.$measureCharWidth(s)/this.$characterSize.width),l},r.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},r.prototype.$getZoom=function(s){return!s||!s.parentElement?1:(Number(window.getComputedStyle(s).zoom)||1)*this.$getZoom(s.parentElement)},r.prototype.$initTransformMeasureNodes=function(){var s=function(l,h){return["div",{style:"position: absolute;top:"+l+"px;left:"+h+"px;"}]};this.els=A.buildDom([s(0,0),s(t,0),s(0,t),s(t,t)],this.el)},r.prototype.transformCoordinates=function(s,l){if(s){var h=this.$getZoom(this.el);s=d(1/h,s)}function v(I,O,z){var D=I[1]*O[0]-I[0]*O[1];return[(-O[1]*z[0]+O[0]*z[1])/D,(+I[1]*z[0]-I[0]*z[1])/D]}function m(I,O){return[I[0]-O[0],I[1]-O[1]]}function g(I,O){return[I[0]+O[0],I[1]+O[1]]}function d(I,O){return[I*O[0],I*O[1]]}this.els||this.$initTransformMeasureNodes();function b(I){var O=I.getBoundingClientRect();return[O.left,O.top]}var M=b(this.els[0]),C=b(this.els[1]),S=b(this.els[2]),R=b(this.els[3]),w=v(m(R,C),m(R,S),m(g(C,S),g(R,M))),y=d(1+w[0],m(C,M)),f=d(1+w[1],m(S,M));if(l){var u=l,p=w[0]*u[0]/t+w[1]*u[1]/t+1,x=g(d(u[0],y),d(u[1],f));return g(d(1/p/t,x),M)}var T=m(s,M),_=v(m(y,d(w[0],T)),m(f,d(w[1],T)),T);return d(t,_)},r}();e.prototype.$characterSize={width:0,height:0},E.implement(e.prototype,i),L.FontMetrics=e}),ace.define("ace/css/editor-css",["require","exports","module"],function(k,L,H){H.exports=`
256
256
  .ace_br1 {border-top-left-radius : 3px;}
257
257
  .ace_br2 {border-top-right-radius : 3px;}
258
258
  .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
@@ -948,9 +948,9 @@
948
948
 
949
949
  .ace_hidden_token {
950
950
  display: none;
951
- }`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(k,x,H){var E=k("../lib/dom"),A=k("../lib/oop"),$=k("../lib/event_emitter").EventEmitter,a=function(){function c(i,o){this.renderer=o,this.pixelRatio=1,this.maxHeight=o.layerConfig.maxHeight,this.lineHeight=o.layerConfig.lineHeight,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},this.setScrollBarV(i)}return c.prototype.$createCanvas=function(){this.canvas=E.createElement("canvas"),this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7",this.canvas.style.position="absolute"},c.prototype.setScrollBarV=function(i){this.$createCanvas(),this.scrollbarV=i,i.element.appendChild(this.canvas),this.setDimensions()},c.prototype.$updateDecorators=function(i){if(typeof this.canvas.getContext!="function")return;var o=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;this.setDimensions(i);var n=this.canvas.getContext("2d");function t(y,f){return y.priority<f.priority?-1:y.priority>f.priority?1:0}var e=this.renderer.session.$annotations;if(n.clearRect(0,0,this.canvas.width,this.canvas.height),e){var r={info:1,warning:2,error:3};e.forEach(function(y){y.priority=r[y.type]||null}),e=e.sort(t);for(var s=0;s<e.length;s++){var l=e[s].row,h=this.getVerticalOffsetForRow(l),v=h+this.lineHeight,m=Math.round(this.heightRatio*h),g=Math.round(this.heightRatio*v),d=Math.round((m+g)/2),b=g-d;b<this.halfMinDecorationHeight&&(b=this.halfMinDecorationHeight),d-b<0&&(d=b),d+b>this.canvasHeight&&(d=this.canvasHeight-b);var M=d-b,C=d+b,S=C-M;n.fillStyle=o[e[s].type]||null,n.fillRect(0,M,Math.round(this.oneZoneWidth-1),S)}}var R=this.renderer.session.selection.getCursor();if(R){var w=Math.round(this.getVerticalOffsetForRow(R.row)*this.heightRatio);n.fillStyle="rgba(0, 0, 0, 0.5)",n.fillRect(0,w,this.canvasWidth,2)}},c.prototype.getVerticalOffsetForRow=function(i){i=i|0;var o=this.renderer.session.documentToScreenRow(i,0)*this.lineHeight;return o},c.prototype.setDimensions=function(i){i=i||this.renderer.layerConfig,this.maxHeight=i.maxHeight,this.lineHeight=i.lineHeight,this.canvasHeight=i.height,this.canvasWidth=this.scrollbarV.width||this.canvasWidth,this.setZoneWidth(),this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.maxHeight<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight},c.prototype.setZoneWidth=function(){this.oneZoneWidth=this.canvasWidth},c.prototype.destroy=function(){this.canvas.parentNode.removeChild(this.canvas)},c}();A.implement(a.prototype,$),x.Decorator=a}),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(k,x,H){var E=k("./lib/oop"),A=k("./lib/dom"),$=k("./lib/lang"),a=k("./config"),c=k("./layer/gutter").Gutter,i=k("./layer/marker").Marker,o=k("./layer/text").Text,n=k("./layer/cursor").Cursor,t=k("./scrollbar").HScrollBar,e=k("./scrollbar").VScrollBar,r=k("./scrollbar_custom").HScrollBar,s=k("./scrollbar_custom").VScrollBar,l=k("./renderloop").RenderLoop,h=k("./layer/font_metrics").FontMetrics,v=k("./lib/event_emitter").EventEmitter,m=k("./css/editor-css"),g=k("./layer/decorators").Decorator,d=k("./lib/useragent"),b=k("./layer/text_util").isTextToken;A.importCssString(m,"ace_editor.css",!1);var M=function(){function C(S,R){var w=this;this.container=S||A.createElement("div"),A.addCssClass(this.container,"ace_editor"),A.HI_DPI&&A.addCssClass(this.container,"ace_hidpi"),this.setTheme(R),a.get("useStrictCSP")==null&&a.set("useStrictCSP",!1),this.$gutter=A.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=A.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=A.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new c(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new i(this.content);var y=this.$textLayer=new o(this.content);this.canvas=y.element,this.$markerFront=new i(this.content),this.$cursorLayer=new n(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new e(this.container,this),this.scrollBarH=new t(this.container,this),this.scrollBarV.on("scroll",function(f){w.$scrollAnimation||w.session.setScrollTop(f.data-w.scrollMargin.top)}),this.scrollBarH.on("scroll",function(f){w.$scrollAnimation||w.session.setScrollLeft(f.data-w.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new h(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(f){w.updateCharacterSize(),w.onResize(!0,w.gutterWidth,w.$size.width,w.$size.height),w._signal("changeCharacterSize",f)}),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=!d.isIOS,this.$loop=new l(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),a.resetOptions(this),a._signal("renderer",this)}return C.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(),A.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},C.prototype.setSession=function(S){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=S,S&&this.scrollMargin.top&&S.getScrollTop()<=0&&S.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(S),this.$markerBack.setSession(S),this.$markerFront.setSession(S),this.$gutterLayer.setSession(S),this.$textLayer.setSession(S),S&&(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))},C.prototype.updateLines=function(S,R,w){if(R===void 0&&(R=1/0),this.$changedLines?(this.$changedLines.firstRow>S&&(this.$changedLines.firstRow=S),this.$changedLines.lastRow<R&&(this.$changedLines.lastRow=R)):this.$changedLines={firstRow:S,lastRow:R},this.$changedLines.lastRow<this.layerConfig.firstRow)if(w)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},C.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},C.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},C.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},C.prototype.updateFull=function(S){S?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},C.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},C.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},C.prototype.onResize=function(S,R,w,y){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=S?1:0;var f=this.container;y||(y=f.clientHeight||f.scrollHeight),!y&&this.$maxLines&&this.lineHeight>1&&(!f.style.height||f.style.height=="0px")&&(f.style.height="1px",y=f.clientHeight||f.scrollHeight),w||(w=f.clientWidth||f.scrollWidth);var u=this.$updateCachedSize(S,R,w,y);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!w&&!y)return this.resizing=0;S&&(this.$gutterLayer.$padding=null),S?this.$renderChanges(u|this.$changes,!0):this.$loop.schedule(u|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},C.prototype.$updateCachedSize=function(S,R,w,y){y-=this.$extraHeight||0;var f=0,u=this.$size,p={width:u.width,height:u.height,scrollerHeight:u.scrollerHeight,scrollerWidth:u.scrollerWidth};if(y&&(S||u.height!=y)&&(u.height=y,f|=this.CHANGE_SIZE,u.scrollerHeight=u.height,this.$horizScroll&&(u.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(u.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",f=f|this.CHANGE_SCROLL),w&&(S||u.width!=w)){f|=this.CHANGE_SIZE,u.width=w,R==null&&(R=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=R,A.setStyle(this.scrollBarH.element.style,"left",R+"px"),A.setStyle(this.scroller.style,"left",R+this.margin.left+"px"),u.scrollerWidth=Math.max(0,w-R-this.scrollBarV.getWidth()-this.margin.h),A.setStyle(this.$gutter.style,"left",this.margin.left+"px");var L=this.scrollBarV.getWidth()+"px";A.setStyle(this.scrollBarH.element.style,"right",L),A.setStyle(this.scroller.style,"right",L),A.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(u.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||S)&&(f|=this.CHANGE_FULL)}return u.$dirty=!w||!y,f&&this._signal("resize",p),f},C.prototype.onGutterResize=function(S){var R=this.$showGutter?S: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()},C.prototype.adjustWrapLimit=function(){var S=this.$size.scrollerWidth-this.$padding*2,R=Math.floor(S/this.characterWidth);return this.session.adjustWrapLimit(R,this.$showPrintMargin&&this.$printMarginColumn)},C.prototype.setAnimatedScroll=function(S){this.setOption("animatedScroll",S)},C.prototype.getAnimatedScroll=function(){return this.$animatedScroll},C.prototype.setShowInvisibles=function(S){this.setOption("showInvisibles",S),this.session.$bidiHandler.setShowInvisibles(S)},C.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},C.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},C.prototype.setDisplayIndentGuides=function(S){this.setOption("displayIndentGuides",S)},C.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},C.prototype.setHighlightIndentGuides=function(S){this.setOption("highlightIndentGuides",S)},C.prototype.setShowPrintMargin=function(S){this.setOption("showPrintMargin",S)},C.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},C.prototype.setPrintMarginColumn=function(S){this.setOption("printMarginColumn",S)},C.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},C.prototype.getShowGutter=function(){return this.getOption("showGutter")},C.prototype.setShowGutter=function(S){return this.setOption("showGutter",S)},C.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},C.prototype.setFadeFoldWidgets=function(S){this.setOption("fadeFoldWidgets",S)},C.prototype.setHighlightGutterLine=function(S){this.setOption("highlightGutterLine",S)},C.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},C.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var S=A.createElement("div");S.className="ace_layer ace_print-margin-layer",this.$printMarginEl=A.createElement("div"),this.$printMarginEl.className="ace_print-margin",S.appendChild(this.$printMarginEl),this.content.insertBefore(S,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()}},C.prototype.getContainerElement=function(){return this.container},C.prototype.getMouseEventTarget=function(){return this.scroller},C.prototype.getTextAreaContainer=function(){return this.container},C.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var S=this.textarea.style,R=this.$composition;if(!this.$keepTextAreaAtCursor&&!R){A.translate(this.textarea,-100,0);return}var w=this.$cursorLayer.$pixelPos;if(w){R&&R.markerRange&&(w=this.$cursorLayer.getPixelPosition(R.markerRange.start,!0));var y=this.layerConfig,f=w.top,u=w.left;f-=y.offset;var p=R&&R.useTextareaForIME||d.isMobile?this.lineHeight:1;if(f<0||f>y.height-p){A.translate(this.textarea,0,0);return}var L=1,T=this.$size.height-p;if(!R)f+=this.lineHeight;else if(R.useTextareaForIME){var _=this.textarea.value;L=this.characterWidth*this.session.$getStringScreenWidth(_)[0]}else f+=this.lineHeight+2;u-=this.scrollLeft,u>this.$size.scrollerWidth-L&&(u=this.$size.scrollerWidth-L),u+=this.gutterWidth+this.margin.left,A.setStyle(S,"height",p+"px"),A.setStyle(S,"width",L+"px"),A.translate(this.textarea,Math.min(u,this.$size.scrollerWidth-L),Math.min(f,T))}}},C.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},C.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},C.prototype.getLastFullyVisibleRow=function(){var S=this.layerConfig,R=S.lastRow,w=this.session.documentToScreenRow(R,0)*S.lineHeight;return w-this.session.getScrollTop()>S.height-S.lineHeight?R-1:R},C.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},C.prototype.setPadding=function(S){this.$padding=S,this.$textLayer.setPadding(S),this.$cursorLayer.setPadding(S),this.$markerFront.setPadding(S),this.$markerBack.setPadding(S),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},C.prototype.setScrollMargin=function(S,R,w,y){var f=this.scrollMargin;f.top=S|0,f.bottom=R|0,f.right=y|0,f.left=w|0,f.v=f.top+f.bottom,f.h=f.left+f.right,f.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-f.top),this.updateFull()},C.prototype.setMargin=function(S,R,w,y){var f=this.margin;f.top=S|0,f.bottom=R|0,f.right=y|0,f.left=w|0,f.v=f.top+f.bottom,f.h=f.left+f.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},C.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},C.prototype.setHScrollBarAlwaysVisible=function(S){this.setOption("hScrollBarAlwaysVisible",S)},C.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},C.prototype.setVScrollBarAlwaysVisible=function(S){this.setOption("vScrollBarAlwaysVisible",S)},C.prototype.$updateScrollBarV=function(){var S=this.layerConfig.maxHeight,R=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(S-=(R-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>S-R&&(S=this.scrollTop+R,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(S+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},C.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},C.prototype.freeze=function(){this.$frozen=!0},C.prototype.unfreeze=function(){this.$frozen=!1},C.prototype.$renderChanges=function(S,R){if(this.$changes&&(S|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!S&&!R){this.$changes|=S;return}if(this.$size.$dirty)return this.$changes|=S,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",S),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var w=this.layerConfig;if(S&this.CHANGE_FULL||S&this.CHANGE_SIZE||S&this.CHANGE_TEXT||S&this.CHANGE_LINES||S&this.CHANGE_SCROLL||S&this.CHANGE_H_SCROLL){if(S|=this.$computeLayerConfig()|this.$loop.clear(),w.firstRow!=this.layerConfig.firstRow&&w.firstRowScreen==this.layerConfig.firstRowScreen){var y=this.scrollTop+(w.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;y>0&&(this.scrollTop=y,S=S|this.CHANGE_SCROLL,S|=this.$computeLayerConfig()|this.$loop.clear())}w=this.layerConfig,this.$updateScrollBarV(),S&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),A.translate(this.content,-this.scrollLeft,-w.offset);var f=w.width+2*this.$padding+"px",u=w.minHeight+"px";A.setStyle(this.content.style,"width",f),A.setStyle(this.content.style,"height",u)}if(S&this.CHANGE_H_SCROLL&&(A.translate(this.content,-this.scrollLeft,-w.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),S&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",S);return}if(S&this.CHANGE_SCROLL){this.$changedLines=null,S&this.CHANGE_TEXT||S&this.CHANGE_LINES?this.$textLayer.update(w):this.$textLayer.scrollLines(w),this.$showGutter&&(S&this.CHANGE_GUTTER||S&this.CHANGE_LINES?this.$gutterLayer.update(w):this.$gutterLayer.scrollLines(w)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",S);return}S&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):S&this.CHANGE_LINES?((this.$updateLines()||S&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):S&this.CHANGE_TEXT||S&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):S&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)),S&this.CHANGE_CURSOR&&(this.$cursorLayer.update(w),this.$moveTextAreaToCursor()),S&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(w),S&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(w),this._signal("afterRender",S)},C.prototype.$autosize=function(){var S=this.session.getScreenLength()*this.lineHeight,R=this.$maxLines*this.lineHeight,w=Math.min(R,Math.max((this.$minLines||1)*this.lineHeight,S))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(w+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&w>this.$maxPixelHeight&&(w=this.$maxPixelHeight);var y=w<=2*this.lineHeight,f=!y&&S>R;if(w!=this.desiredHeight||this.$size.height!=this.desiredHeight||f!=this.$vScroll){f!=this.$vScroll&&(this.$vScroll=f,this.scrollBarV.setVisible(f));var u=this.container.clientWidth;this.container.style.height=w+"px",this.$updateCachedSize(!0,this.$gutterWidth,u,w),this.desiredHeight=w,this._signal("autosize")}},C.prototype.$computeLayerConfig=function(){var S=this.session,R=this.$size,w=R.height<=2*this.lineHeight,y=this.session.getScreenLength(),f=y*this.lineHeight,u=this.$getLongestLine(),p=!w&&(this.$hScrollBarAlwaysVisible||R.scrollerWidth-u-2*this.$padding<0),L=this.$horizScroll!==p;L&&(this.$horizScroll=p,this.scrollBarH.setVisible(p));var T=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),w=R.height<=2*this.lineHeight);var _=R.scrollerHeight+this.lineHeight,I=!this.$maxLines&&this.$scrollPastEnd?(R.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;f+=I;var O=this.scrollMargin;this.session.setScrollTop(Math.max(-O.top,Math.min(this.scrollTop,f-R.scrollerHeight+O.bottom))),this.session.setScrollLeft(Math.max(-O.left,Math.min(this.scrollLeft,u+2*this.$padding-R.scrollerWidth+O.right)));var z=!w&&(this.$vScrollBarAlwaysVisible||R.scrollerHeight-f+I<0||this.scrollTop>O.top),D=T!==z;D&&(this.$vScroll=z,this.scrollBarV.setVisible(z));var N=this.scrollTop%this.lineHeight,F=Math.ceil(_/this.lineHeight)-1,B=Math.max(0,Math.round((this.scrollTop-N)/this.lineHeight)),P=B+F,V,G,j=this.lineHeight;B=S.screenToDocumentRow(B,0);var K=S.getFoldLine(B);K&&(B=K.start.row),V=S.documentToScreenRow(B,0),G=S.getRowLength(B)*j,P=Math.min(S.screenToDocumentRow(P,0),S.getLength()-1),_=R.scrollerHeight+S.getRowLength(P)*j+G,N=this.scrollTop-V*j,N<0&&V>0&&(V=Math.max(0,V+Math.floor(N/j)),N=this.scrollTop-V*j);var Q=0;return(this.layerConfig.width!=u||L)&&(Q=this.CHANGE_H_SCROLL),(L||D)&&(Q|=this.$updateCachedSize(!0,this.gutterWidth,R.width,R.height),this._signal("scrollbarVisibilityChanged"),D&&(u=this.$getLongestLine())),this.layerConfig={width:u,padding:this.$padding,firstRow:B,firstRowScreen:V,lastRow:P,lineHeight:j,characterWidth:this.characterWidth,minHeight:_,maxHeight:f,offset:N,gutterOffset:j?Math.max(0,Math.ceil((N+R.height-R.scrollerHeight)/j)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(u-this.$padding),Q},C.prototype.$updateLines=function(){if(this.$changedLines){var S=this.$changedLines.firstRow,R=this.$changedLines.lastRow;this.$changedLines=null;var w=this.layerConfig;if(!(S>w.lastRow+1)&&!(R<w.firstRow)){if(R===1/0){this.$showGutter&&this.$gutterLayer.update(w),this.$textLayer.update(w);return}return this.$textLayer.updateLines(w,S,R),!0}}},C.prototype.$getLongestLine=function(){var S=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(S+=1),this.$textLayer&&S>this.$textLayer.MAX_LINE_LENGTH&&(S=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(S*this.characterWidth))},C.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},C.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},C.prototype.addGutterDecoration=function(S,R){this.$gutterLayer.addGutterDecoration(S,R)},C.prototype.removeGutterDecoration=function(S,R){this.$gutterLayer.removeGutterDecoration(S,R)},C.prototype.updateBreakpoints=function(S){this._rows=S,this.$loop.schedule(this.CHANGE_GUTTER)},C.prototype.setAnnotations=function(S){this.$gutterLayer.setAnnotations(S),this.$loop.schedule(this.CHANGE_GUTTER)},C.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},C.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},C.prototype.showCursor=function(){this.$cursorLayer.showCursor()},C.prototype.scrollSelectionIntoView=function(S,R,w){this.scrollCursorIntoView(S,w),this.scrollCursorIntoView(R,w)},C.prototype.scrollCursorIntoView=function(S,R,w){if(this.$size.scrollerHeight!==0){var y=this.$cursorLayer.getPixelPosition(S),f=y.left,u=y.top,p=w&&w.top||0,L=w&&w.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var T=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;T+p>u?(R&&T+p>u+this.lineHeight&&(u-=R*this.$size.scrollerHeight),u===0&&(u=-this.scrollMargin.top),this.session.setScrollTop(u)):T+this.$size.scrollerHeight-L<u+this.lineHeight&&(R&&T+this.$size.scrollerHeight-L<u-this.lineHeight&&(u+=R*this.$size.scrollerHeight),this.session.setScrollTop(u+this.lineHeight+L-this.$size.scrollerHeight));var _=this.scrollLeft,I=2*this.layerConfig.characterWidth;f-I<_?(f-=I,f<this.$padding+I&&(f=-this.scrollMargin.left),this.session.setScrollLeft(f)):(f+=I,_+this.$size.scrollerWidth<f+this.characterWidth?this.session.setScrollLeft(Math.round(f+this.characterWidth-this.$size.scrollerWidth)):_<=this.$padding&&f-_<this.characterWidth&&this.session.setScrollLeft(0))}},C.prototype.getScrollTop=function(){return this.session.getScrollTop()},C.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},C.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},C.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},C.prototype.scrollToRow=function(S){this.session.setScrollTop(S*this.lineHeight)},C.prototype.alignCursor=function(S,R){typeof S=="number"&&(S={row:S,column:0});var w=this.$cursorLayer.getPixelPosition(S),y=this.$size.scrollerHeight-this.lineHeight,f=w.top-y*(R||0);return this.session.setScrollTop(f),f},C.prototype.$calcSteps=function(S,R){var w=0,y=this.STEPS,f=[],u=function(p,L,T){return T*(Math.pow(p-1,3)+1)+L};for(w=0;w<y;++w)f.push(u(w/this.STEPS,S,R-S));return f},C.prototype.scrollToLine=function(S,R,w,y){var f=this.$cursorLayer.getPixelPosition({row:S,column:0}),u=f.top;R&&(u-=this.$size.scrollerHeight/2);var p=this.scrollTop;this.session.setScrollTop(u),w!==!1&&this.animateScrolling(p,y)},C.prototype.animateScrolling=function(S,R){var w=this.scrollTop;if(!this.$animatedScroll)return;var y=this;if(S==w)return;if(this.$scrollAnimation){var f=this.$scrollAnimation.steps;if(f.length&&(S=f[0],S==w))return}var u=y.$calcSteps(S,w);this.$scrollAnimation={from:S,to:w,steps:u},clearInterval(this.$timer),y.session.setScrollTop(u.shift()),y.session.$scrollTop=w;function p(){y.$timer=clearInterval(y.$timer),y.$scrollAnimation=null,y.$stopAnimation=!1,R&&R()}this.$timer=setInterval(function(){if(y.$stopAnimation){p();return}if(!y.session)return clearInterval(y.$timer);u.length?(y.session.setScrollTop(u.shift()),y.session.$scrollTop=w):w!=null?(y.session.$scrollTop=-1,y.session.setScrollTop(w),w=null):p()},10)},C.prototype.scrollToY=function(S){this.scrollTop!==S&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=S)},C.prototype.scrollToX=function(S){this.scrollLeft!==S&&(this.scrollLeft=S),this.$loop.schedule(this.CHANGE_H_SCROLL)},C.prototype.scrollTo=function(S,R){this.session.setScrollTop(R),this.session.setScrollLeft(S)},C.prototype.scrollBy=function(S,R){R&&this.session.setScrollTop(this.session.getScrollTop()+R),S&&this.session.setScrollLeft(this.session.getScrollLeft()+S)},C.prototype.isScrollableBy=function(S,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||S<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||S>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},C.prototype.pixelToScreenCoordinates=function(S,R){var w;if(this.$hasCssTransforms){w={top:0,left:0};var y=this.$fontMetrics.transformCoordinates([S,R]);S=y[1]-this.gutterWidth-this.margin.left,R=y[0]}else w=this.scroller.getBoundingClientRect();var f=S+this.scrollLeft-w.left-this.$padding,u=f/this.characterWidth,p=Math.floor((R+this.scrollTop-w.top)/this.lineHeight),L=this.$blockCursor?Math.floor(u):Math.round(u);return{row:p,column:L,side:u-L>0?1:-1,offsetX:f}},C.prototype.screenToTextCoordinates=function(S,R){var w;if(this.$hasCssTransforms){w={top:0,left:0};var y=this.$fontMetrics.transformCoordinates([S,R]);S=y[1]-this.gutterWidth-this.margin.left,R=y[0]}else w=this.scroller.getBoundingClientRect();var f=S+this.scrollLeft-w.left-this.$padding,u=f/this.characterWidth,p=this.$blockCursor?Math.floor(u):Math.round(u),L=Math.floor((R+this.scrollTop-w.top)/this.lineHeight);return this.session.screenToDocumentPosition(L,Math.max(p,0),f)},C.prototype.textToScreenCoordinates=function(S,R){var w=this.scroller.getBoundingClientRect(),y=this.session.documentToScreenPosition(S,R),f=this.$padding+(this.session.$bidiHandler.isBidiRow(y.row,S)?this.session.$bidiHandler.getPosLeft(y.column):Math.round(y.column*this.characterWidth)),u=y.row*this.lineHeight;return{pageX:w.left+f-this.scrollLeft,pageY:w.top+u-this.scrollTop}},C.prototype.visualizeFocus=function(){A.addCssClass(this.container,"ace_focus")},C.prototype.visualizeBlur=function(){A.removeCssClass(this.container,"ace_focus")},C.prototype.showComposition=function(S){this.$composition=S,S.cssText||(S.cssText=this.textarea.style.cssText),S.useTextareaForIME==null&&(S.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(A.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):S.markerId=this.session.addMarker(S.markerRange,"ace_composition_marker","text")},C.prototype.setCompositionText=function(S){var R=this.session.selection.cursor;this.addToken(S,"composition_placeholder",R.row,R.column),this.$moveTextAreaToCursor()},C.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),A.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var S=this.session.selection.cursor;this.removeExtraToken(S.row,S.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},C.prototype.setGhostText=function(S,R){var w=this.session.selection.cursor,y=R||{row:w.row,column:w.column};this.removeGhostText();var f=this.$calculateWrappedTextChunks(S,y);this.addToken(f[0].text,"ghost_text",y.row,y.column),this.$ghostText={text:S,position:{row:y.row,column:y.column}};var u=A.createElement("div");if(f.length>1){var p=this.hideTokensAfterPosition(y.row,y.column),L;f.slice(1).forEach(function(D){var N=A.createElement("div"),F=A.createElement("span");F.className="ace_ghost_text",D.wrapped&&(N.className="ghost_text_line_wrapped"),D.text.length===0&&(D.text=" "),F.appendChild(A.createTextNode(D.text)),N.appendChild(F),u.appendChild(N),L=N}),p.forEach(function(D){var N=A.createElement("span");b(D.type)||(N.className="ace_"+D.type.replace(/\./g," ace_")),N.appendChild(A.createTextNode(D.value)),L.appendChild(N)}),this.$ghostTextWidget={el:u,row:y.row,column:y.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var T=this.$cursorLayer.getPixelPosition(y,!0),_=this.container,I=_.getBoundingClientRect().height,O=f.length*this.lineHeight,z=O<I-T.top;if(z)return;O<I?this.scrollBy(0,(f.length-1)*this.lineHeight):this.scrollToRow(y.row)}},C.prototype.$calculateWrappedTextChunks=function(S,R){var w=this.$size.scrollerWidth-this.$padding*2,y=Math.floor(w/this.characterWidth)-2;y=y<=0?60:y;for(var f=S.split(/\r?\n/),u=[],p=0;p<f.length;p++){var L=this.session.$getDisplayTokens(f[p],R.column),T=this.session.$computeWrapSplits(L,y,this.session.$tabSize);if(T.length>0){var _=0;T.push(f[p].length);for(var I=0;I<T.length;I++){var O=f[p].slice(_,T[I]);u.push({text:O,wrapped:!0}),_=T[I]}}else u.push({text:f[p],wrapped:!1})}return u},C.prototype.removeGhostText=function(){if(this.$ghostText){var S=this.$ghostText.position;this.removeExtraToken(S.row,S.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},C.prototype.addToken=function(S,R,w,y){var f=this.session;f.bgTokenizer.lines[w]=null;var u={type:R,value:S},p=f.getTokens(w);if(y==null||!p.length)p.push(u);else for(var L=0,T=0;T<p.length;T++){var _=p[T];if(L+=_.value.length,y<=L){var I=_.value.length-(L-y),O=_.value.slice(0,I),z=_.value.slice(I);p.splice(T,1,{type:_.type,value:O},u,{type:_.type,value:z});break}}this.updateLines(w,w)},C.prototype.hideTokensAfterPosition=function(S,R){for(var w=this.session.getTokens(S),y=0,f=!1,u=[],p=0;p<w.length;p++){var L=w[p];if(y+=L.value.length,L.type!=="ghost_text"){if(f){u.push({type:L.type,value:L.value}),L.type="hidden_token";continue}y===R&&(f=!0)}}return this.updateLines(S,S),u},C.prototype.removeExtraToken=function(S,R){this.session.bgTokenizer.lines[S]=null,this.updateLines(S,S)},C.prototype.setTheme=function(S,R){var w=this;if(this.$themeId=S,w._dispatchEvent("themeChange",{theme:S}),!S||typeof S=="string"){var y=S||this.$options.theme.initialValue;a.loadModule(["theme",y],f)}else f(S);function f(u){if(w.$themeId!=S)return R&&R();if(!u||!u.cssClass)throw new Error("couldn't load module "+S+" or it didn't call define");u.$id&&(w.$themeId=u.$id),A.importCssString(u.cssText,u.cssClass,w.container),w.theme&&A.removeCssClass(w.container,w.theme.cssClass);var p="padding"in u?u.padding:"padding"in(w.theme||{})?4:w.$padding;w.$padding&&p!=w.$padding&&w.setPadding(p),w.$theme=u.cssClass,w.theme=u,A.addCssClass(w.container,u.cssClass),A.setCssClass(w.container,"ace_dark",u.isDark),w.$size&&(w.$size.width=0,w.$updateSizeAsync()),w._dispatchEvent("themeLoaded",{theme:u}),R&&R(),d.isSafari&&w.scroller&&(w.scroller.style.background="red",w.scroller.style.background="")}},C.prototype.getTheme=function(){return this.$themeId},C.prototype.setStyle=function(S,R){A.setCssClass(this.container,S,R!==!1)},C.prototype.unsetStyle=function(S){A.removeCssClass(this.container,S)},C.prototype.setCursorStyle=function(S){A.setStyle(this.scroller.style,"cursor",S)},C.prototype.setMouseCursor=function(S){A.setStyle(this.scroller.style,"cursor",S)},C.prototype.attachToShadowRoot=function(){A.importCssString(m,"ace_editor.css",this.container)},C.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},C.prototype.$updateCustomScrollbar=function(S){var R=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),S===!0?(this.scrollBarV=new s(this.container,this),this.scrollBarH=new r(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(w){R.$scrollAnimation||R.session.setScrollTop(w.data-R.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){R.$scrollAnimation||R.session.setScrollLeft(w.data-R.scrollMargin.left)}),this.$scrollDecorator?(this.$scrollDecorator.setScrollBarV(this.scrollBarV),this.$scrollDecorator.$updateDecorators()):(this.$scrollDecorator=new g(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators())):(this.scrollBarV=new e(this.container,this),this.scrollBarH=new t(this.container,this),this.scrollBarV.addEventListener("scroll",function(w){R.$scrollAnimation||R.session.setScrollTop(w.data-R.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){R.$scrollAnimation||R.session.setScrollLeft(w.data-R.scrollMargin.left)}))},C.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var S=this;this.$resizeTimer=$.delayedCall(function(){S.destroyed||S.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(R){var w=R[0].contentRect.width,y=R[0].contentRect.height;Math.abs(S.$size.width-w)>1||Math.abs(S.$size.height-y)>1?S.$resizeTimer.delay():S.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},C}();M.prototype.CHANGE_CURSOR=1,M.prototype.CHANGE_MARKER=2,M.prototype.CHANGE_GUTTER=4,M.prototype.CHANGE_SCROLL=8,M.prototype.CHANGE_LINES=16,M.prototype.CHANGE_TEXT=32,M.prototype.CHANGE_SIZE=64,M.prototype.CHANGE_MARKER_BACK=128,M.prototype.CHANGE_MARKER_FRONT=256,M.prototype.CHANGE_FULL=512,M.prototype.CHANGE_H_SCROLL=1024,M.prototype.$changes=0,M.prototype.$padding=null,M.prototype.$frozen=!1,M.prototype.STEPS=8,E.implement(M.prototype,v),a.defineOptions(M.prototype,"renderer",{useResizeObserver:{set:function(C){!C&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):C&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(C){this.$textLayer.setShowInvisibles(C)&&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(C){typeof C=="number"&&(this.$printMarginColumn=C),this.$showPrintMargin=!!C,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(C){this.$gutter.style.display=C?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(C){this.$gutterLayer.$useSvgGutterIcons=C},initialValue:!1},showFoldedAnnotations:{set:function(C){this.$gutterLayer.$showFoldedAnnotations=C},initialValue:!1},fadeFoldWidgets:{set:function(C){A.setCssClass(this.$gutter,"ace_fade-fold-widgets",C)},initialValue:!1},showFoldWidgets:{set:function(C){this.$gutterLayer.setShowFoldWidgets(C),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(C){this.$textLayer.setDisplayIndentGuides(C)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(C){this.$textLayer.setHighlightIndentGuides(C)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(C){this.$gutterLayer.setHighlightGutterLine(C),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(C){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(C){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(C){typeof C=="number"&&(C=C+"px"),this.container.style.fontSize=C,this.updateFontSize()},initialValue:12},fontFamily:{set:function(C){this.container.style.fontFamily=C,this.updateFontSize()}},maxLines:{set:function(C){this.updateFull()}},minLines:{set:function(C){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(C){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(C){C=+C||0,this.$scrollPastEnd!=C&&(this.$scrollPastEnd=C,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(C){this.$gutterLayer.$fixedWidth=!!C,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(C){this.$updateCustomScrollbar(C)},initialValue:!1},theme:{set:function(C){this.setTheme(C)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!d.isMobile&&!d.isIE}}),x.VirtualRenderer=M}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(k,x,H){var E=k("../lib/oop"),A=k("../lib/net"),$=k("../lib/event_emitter").EventEmitter,a=k("../config");function c(t){var e="importScripts('"+A.qualifyURL(t)+"');";try{return new Blob([e],{type:"application/javascript"})}catch{var r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,s=new r;return s.append(e),s.getBlob("application/javascript")}}function i(t){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(a.get("loadWorkerFromBlob")){var e=c(t),r=window.URL||window.webkitURL,s=r.createObjectURL(e);return new Worker(s)}return new Worker(t)}var o=function(t){t.postMessage||(t=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=t,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(){E.implement(this,$),this.$createWorkerFromOldConfig=function(t,e,r,s,l){if(k.nameToUrl&&!k.toUrl&&(k.toUrl=k.nameToUrl),a.get("packaged")||!k.toUrl)s=s||a.moduleUrl(e,"worker");else{var h=this.$normalizePath;s=s||h(k.toUrl("ace/worker/worker.js",null,"_"));var v={};t.forEach(function(m){v[m]=h(k.toUrl(m,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=i(s),l&&this.send("importScripts",l),this.$worker.postMessage({init:!0,tlns:v,module:e,classname:r}),this.$worker},this.onMessage=function(t){var e=t.data;switch(e.type){case"event":this._signal(e.name,{data:e.data});break;case"call":var r=this.callbacks[e.id];r&&(r(e.data),delete this.callbacks[e.id]);break;case"error":this.reportError(e.data);break;case"log":window.console&&console.log&&console.log.apply(console,e.data);break}},this.reportError=function(t){window.console&&console.error&&console.error(t)},this.$normalizePath=function(t){return A.qualifyURL(t)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(t){t.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(t,e){this.$worker.postMessage({command:t,args:e})},this.call=function(t,e,r){if(r){var s=this.callbackId++;this.callbacks[s]=r,e.push(s)}this.send(t,e)},this.emit=function(t,e){try{e.data&&e.data.err&&(e.data.err={message:e.data.err.message,stack:e.data.err.stack,code:e.data.err.code}),this.$worker&&this.$worker.postMessage({event:t,data:{data:e.data}})}catch(r){console.error(r.stack)}},this.attachToDocument=function(t){this.$doc&&this.terminate(),this.$doc=t,this.call("setValue",[t.getValue()]),t.on("change",this.changeListener,!0)},this.changeListener=function(t){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),t.action=="insert"?this.deltaQueue.push(t.start,t.lines):this.deltaQueue.push(t.start,t.end)},this.$sendDeltaQueue=function(){var t=this.deltaQueue;t&&(this.deltaQueue=null,t.length>50&&t.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:t}))}}).call(o.prototype);var n=function(t,e,r){var s=null,l=!1,h=Object.create($),v=[],m=new o({messageBuffer:v,terminate:function(){},postMessage:function(d){v.push(d),s&&(l?setTimeout(g):g())}});m.setEmitSync=function(d){l=d};var g=function(){var d=v.shift();d.command?s[d.command].apply(s,d.args):d.event&&h._signal(d.event,d.data)};return h.postMessage=function(d){m.onMessage({data:d})},h.callback=function(d,b){this.postMessage({type:"call",id:b,data:d})},h.emit=function(d,b){this.postMessage({type:"event",name:d,data:b})},a.loadModule(["worker",e],function(d){for(s=new d[r](h);v.length;)g()}),m};x.UIWorkerClient=n,x.WorkerClient=o,x.createWorker=i}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(k,x,H){var E=k("./range").Range,A=k("./lib/event_emitter").EventEmitter,$=k("./lib/oop"),a=function(){function c(i,o,n,t,e,r){var s=this;this.length=o,this.session=i,this.doc=i.getDocument(),this.mainClass=e,this.othersClass=r,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=t,this.$onCursorChange=function(){setTimeout(function(){s.onCursorChange()})},this.$pos=n;var l=i.getUndoManager().$undoStack||i.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=l.length,this.setup(),i.selection.on("changeCursor",this.$onCursorChange)}return c.prototype.setup=function(){var i=this,o=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=o.createAnchor(this.$pos.row,this.$pos.column);var t=this.pos;t.$insertRight=!0,t.detach(),t.markerId=n.addMarker(new E(t.row,t.column,t.row,t.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(e){var r=o.createAnchor(e.row,e.column);r.$insertRight=!0,r.detach(),i.others.push(r)}),n.setUndoSelect(!1)},c.prototype.showOtherMarkers=function(){if(!this.othersActive){var i=this.session,o=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=i.addMarker(new E(n.row,n.column,n.row,n.column+o.length),o.othersClass,null,!1)})}},c.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var i=0;i<this.others.length;i++)this.session.removeMarker(this.others[i].markerId)}},c.prototype.onUpdate=function(i){if(this.$updating)return this.updateAnchors(i);var o=i;if(o.start.row===o.end.row&&o.start.row===this.pos.row){this.$updating=!0;var n=i.action==="insert"?o.end.column-o.start.column:o.start.column-o.end.column,t=o.start.column>=this.pos.column&&o.start.column<=this.pos.column+this.length+1,e=o.start.column-this.pos.column;if(this.updateAnchors(i),t&&(this.length+=n),t&&!this.session.$fromUndo){if(i.action==="insert")for(var r=this.others.length-1;r>=0;r--){var s=this.others[r],l={row:s.row,column:s.column+e};this.doc.insertMergedLines(l,i.lines)}else if(i.action==="remove")for(var r=this.others.length-1;r>=0;r--){var s=this.others[r],l={row:s.row,column:s.column+e};this.doc.remove(new E(l.row,l.column,l.row,l.column-n))}}this.$updating=!1,this.updateMarkers()}},c.prototype.updateAnchors=function(i){this.pos.onChange(i);for(var o=this.others.length;o--;)this.others[o].onChange(i);this.updateMarkers()},c.prototype.updateMarkers=function(){if(!this.$updating){var i=this,o=this.session,n=function(e,r){o.removeMarker(e.markerId),e.markerId=o.addMarker(new E(e.row,e.column,e.row,e.column+i.length),r,null,!1)};n(this.pos,this.mainClass);for(var t=this.others.length;t--;)n(this.others[t],this.othersClass)}},c.prototype.onCursorChange=function(i){if(!(this.$updating||!this.session)){var o=this.session.selection.getCursor();o.row===this.pos.row&&o.column>=this.pos.column&&o.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",i)):(this.hideOtherMarkers(),this._emit("cursorLeave",i))}},c.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},c.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var i=this.session.getUndoManager(),o=(i.$undoStack||i.$undostack).length-this.$undoStackDepth,n=0;n<o;n++)i.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},c}();$.implement(a.prototype,A),x.PlaceHolder=a}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(k,x,H){var E=k("../lib/event"),A=k("../lib/useragent");function $(c,i){return c.row==i.row&&c.column==i.column}function a(c){var i=c.domEvent,o=i.altKey,n=i.shiftKey,t=i.ctrlKey,e=c.getAccelKey(),r=c.getButton();if(t&&A.isMac&&(r=i.button),c.editor.inMultiSelectMode&&r==2){c.editor.textInput.onContextMenu(c.domEvent);return}if(!t&&!o&&!e){r===0&&c.editor.inMultiSelectMode&&c.editor.exitMultiSelectMode();return}if(r===0){var s=c.editor,l=s.selection,h=s.inMultiSelectMode,v=c.getDocumentPosition(),m=l.getCursor(),g=c.inSelection()||l.isEmpty()&&$(v,m),d=c.x,b=c.y,M=function(O){d=O.clientX,b=O.clientY},C=s.session,S=s.renderer.pixelToScreenCoordinates(d,b),R=S,w;if(s.$mouseHandler.$enableJumpToDef)t&&o||e&&o?w=n?"block":"add":o&&s.$blockSelectEnabled&&(w="block");else if(e&&!o){if(w="add",!h&&n)return}else o&&s.$blockSelectEnabled&&(w="block");if(w&&A.isMac&&i.ctrlKey&&s.$mouseHandler.cancelContextMenu(),w=="add"){if(!h&&g)return;if(!h){var y=l.toOrientedRange();s.addSelectionMarker(y)}var f=l.rangeList.rangeAtPoint(v);s.inVirtualSelectionMode=!0,n&&(f=null,y=l.ranges[0]||y,s.removeSelectionMarker(y)),s.once("mouseup",function(){var O=l.toOrientedRange();f&&O.isEmpty()&&$(f.cursor,O.cursor)?l.substractPoint(O.cursor):(n?l.substractPoint(y.cursor):y&&(s.removeSelectionMarker(y),l.addRange(y)),l.addRange(O)),s.inVirtualSelectionMode=!1})}else if(w=="block"){c.stop(),s.inVirtualSelectionMode=!0;var u,p=[],L=function(){var O=s.renderer.pixelToScreenCoordinates(d,b),z=C.screenToDocumentPosition(O.row,O.column,O.offsetX);$(R,O)&&$(z,l.lead)||(R=O,s.selection.moveToPosition(z),s.renderer.scrollCursorIntoView(),s.removeSelectionMarkers(p),p=l.rectangularRangeBlock(R,S),s.$mouseHandler.$clickSelection&&p.length==1&&p[0].isEmpty()&&(p[0]=s.$mouseHandler.$clickSelection.clone()),p.forEach(s.addSelectionMarker,s),s.updateSelectionMarkers())};h&&!e?l.toSingleRange():!h&&e&&(u=l.toOrientedRange(),s.addSelectionMarker(u)),n?S=C.documentToScreenPosition(l.lead):l.moveToPosition(v),R={row:-1,column:-1};var T=function(O){L(),clearInterval(I),s.removeSelectionMarkers(p),p.length||(p=[l.toOrientedRange()]),u&&(s.removeSelectionMarker(u),l.toSingleRange(u));for(var z=0;z<p.length;z++)l.addRange(p[z]);s.inVirtualSelectionMode=!1,s.$mouseHandler.$clickSelection=null},_=L;E.capture(s.container,M,T);var I=setInterval(function(){_()},20);return c.preventDefault()}}}x.onMouseDown=a}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(k,x,H){x.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(A){A.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(A){A.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(A){A.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(A){A.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(A){A.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(A){A.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(A){A.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(A){A.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(A){A.multiSelect.rangeCount>1?A.multiSelect.joinSelections():A.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(A){A.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(A){A.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(A){A.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],x.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(A){A.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(A){return A&&A.inMultiSelectMode}}];var E=k("../keyboard/hash_handler").HashHandler;x.keyboardHandler=new E(x.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(k,x,H){var E=k("./range_list").RangeList,A=k("./range").Range,$=k("./selection").Selection,a=k("./mouse/multi_select_handler").onMouseDown,c=k("./lib/event"),i=k("./lib/lang"),o=k("./commands/multi_select_commands");x.commands=o.defaultCommands.concat(o.multiSelectCommands);var n=k("./search").Search,t=new n;function e(m,g,d){return t.$options.wrap=!0,t.$options.needle=g,t.$options.backwards=d==-1,t.find(m)}var r=k("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(r.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(m,g){if(m){if(!this.inMultiSelectMode&&this.rangeCount===0){var d=this.toOrientedRange();if(this.rangeList.add(d),this.rangeList.add(m),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),g||this.fromOrientedRange(m);this.rangeList.removeAll(),this.rangeList.add(d),this.$onAddRange(d)}m.cursor||(m.cursor=m.end);var b=this.rangeList.add(m);return this.$onAddRange(m),b.length&&this.$onRemoveRange(b),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),g||this.fromOrientedRange(m)}},this.toSingleRange=function(m){m=m||this.ranges[0];var g=this.rangeList.removeAll();g.length&&this.$onRemoveRange(g),m&&this.fromOrientedRange(m)},this.substractPoint=function(m){var g=this.rangeList.substractPoint(m);if(g)return this.$onRemoveRange(g),g[0]},this.mergeOverlappingRanges=function(){var m=this.rangeList.merge();m.length&&this.$onRemoveRange(m)},this.$onAddRange=function(m){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(m),this._signal("addRange",{range:m})},this.$onRemoveRange=function(m){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var g=this.rangeList.ranges.pop();m.push(g),this.rangeCount=0}for(var d=m.length;d--;){var b=this.ranges.indexOf(m[d]);this.ranges.splice(b,1)}this._signal("removeRange",{ranges:m}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),g=g||this.ranges[0],g&&!g.isEqual(this.getRange())&&this.fromOrientedRange(g)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new E,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var m=this.ranges.length?this.ranges:[this.getRange()],g=[],d=0;d<m.length;d++){var b=m[d],M=b.start.row,C=b.end.row;if(M===C)g.push(b.clone());else{for(g.push(new A(M,b.start.column,M,this.session.getLine(M).length));++M<C;)g.push(this.getLineRange(M,!0));g.push(new A(C,0,C,b.end.column))}d==0&&!this.isBackwards()&&(g=g.reverse())}this.toSingleRange();for(var d=g.length;d--;)this.addRange(g[d])},this.joinSelections=function(){var m=this.rangeList.ranges,g=m[m.length-1],d=A.fromPoints(m[0].start,g.end);this.toSingleRange(),this.setSelectionRange(d,g.cursor==g.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var m=this.rangeList.ranges,g=m[m.length-1],d=A.fromPoints(m[0].start,g.end);this.toSingleRange(),this.setSelectionRange(d,g.cursor==g.start)}else{var b=this.session.documentToScreenPosition(this.cursor),M=this.session.documentToScreenPosition(this.anchor),C=this.rectangularRangeBlock(b,M);C.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(m,g,d){var b=[],M=m.column<g.column;if(M)var C=m.column,S=g.column,R=m.offsetX,w=g.offsetX;else var C=g.column,S=m.column,R=g.offsetX,w=m.offsetX;var y=m.row<g.row;if(y)var f=m.row,u=g.row;else var f=g.row,u=m.row;C<0&&(C=0),f<0&&(f=0),f==u&&(d=!0);for(var p,L=f;L<=u;L++){var T=A.fromPoints(this.session.screenToDocumentPosition(L,C,R),this.session.screenToDocumentPosition(L,S,w));if(T.isEmpty()){if(p&&l(T.end,p))break;p=T.end}T.cursor=M?T.start:T.end,b.push(T)}if(y&&b.reverse(),!d){for(var _=b.length-1;b[_].isEmpty()&&_>0;)_--;if(_>0)for(var I=0;b[I].isEmpty();)I++;for(var O=_;O>=I;O--)b[O].isEmpty()&&b.splice(O,1)}return b}}).call($.prototype);var s=k("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(m){m.cursor||(m.cursor=m.end);var g=this.getSelectionStyle();return m.marker=this.session.addMarker(m,"ace_selection",g),this.session.$selectionMarkers.push(m),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,m},this.removeSelectionMarker=function(m){if(m.marker){this.session.removeMarker(m.marker);var g=this.session.$selectionMarkers.indexOf(m);g!=-1&&this.session.$selectionMarkers.splice(g,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(m){for(var g=this.session.$selectionMarkers,d=m.length;d--;){var b=m[d];if(b.marker){this.session.removeMarker(b.marker);var M=g.indexOf(b);M!=-1&&g.splice(M,1)}}this.session.selectionMarkerCount=g.length},this.$onAddRange=function(m){this.addSelectionMarker(m.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(m){this.removeSelectionMarkers(m.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(m){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(o.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(m){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(o.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(m){var g=m.command,d=m.editor;if(d.multiSelect){if(g.multiSelectAction)g.multiSelectAction=="forEach"?b=d.forEachSelection(g,m.args):g.multiSelectAction=="forEachLine"?b=d.forEachSelection(g,m.args,!0):g.multiSelectAction=="single"?(d.exitMultiSelectMode(),b=g.exec(d,m.args||{})):b=g.multiSelectAction(d,m.args||{});else{var b=g.exec(d,m.args||{});d.multiSelect.addRange(d.multiSelect.toOrientedRange()),d.multiSelect.mergeOverlappingRanges()}return b}},this.forEachSelection=function(m,g,d){if(!this.inVirtualSelectionMode){var b=d&&d.keepOrder,M=d==!0||d&&d.$byLines,C=this.session,S=this.selection,R=S.rangeList,w=(b?S:R).ranges,y;if(!w.length)return m.exec?m.exec(this,g||{}):m(this,g||{});var f=S._eventRegistry;S._eventRegistry={};var u=new $(C);this.inVirtualSelectionMode=!0;for(var p=w.length;p--;){if(M)for(;p>0&&w[p].start.row==w[p-1].end.row;)p--;u.fromOrientedRange(w[p]),u.index=p,this.selection=C.selection=u;var L=m.exec?m.exec(this,g||{}):m(this,g||{});!y&&L!==void 0&&(y=L),u.toOrientedRange(w[p])}u.detach(),this.selection=C.selection=S,this.inVirtualSelectionMode=!1,S._eventRegistry=f,S.mergeOverlappingRanges(),S.ranges[0]&&S.fromOrientedRange(S.ranges[0]);var T=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),T&&T.from==T.to&&this.renderer.animateScrolling(T.from),y}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var m="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var g=this.multiSelect.rangeList.ranges,d=[],b=0;b<g.length;b++)d.push(this.session.getTextRange(g[b]));var M=this.session.getDocument().getNewLineCharacter();m=d.join(M),m.length==(d.length-1)*M.length&&(m="")}else this.selection.isEmpty()||(m=this.session.getTextRange(this.getSelectionRange()));return m},this.$checkMultiselectChange=function(m,g){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var d=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&g==this.multiSelect.anchor)return;var b=g==this.multiSelect.anchor?d.cursor==d.start?d.end:d.start:d.cursor;b.row!=g.row||this.session.$clipPositionToDocument(b.row,b.column).column!=g.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(m,g,d){if(g=g||{},g.needle=m||g.needle,g.needle==null){var b=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();g.needle=this.session.getTextRange(b)}this.$search.set(g);var M=this.$search.findAll(this.session);if(!M.length)return 0;var C=this.multiSelect;d||C.toSingleRange(M[0]);for(var S=M.length;S--;)C.addRange(M[S],!0);return b&&C.rangeList.rangeAtPoint(b.start)&&C.addRange(b,!0),M.length},this.selectMoreLines=function(m,g){var d=this.selection.toOrientedRange(),b=d.cursor==d.end,M=this.session.documentToScreenPosition(d.cursor);this.selection.$desiredColumn&&(M.column=this.selection.$desiredColumn);var C=this.session.screenToDocumentPosition(M.row+m,M.column);if(d.isEmpty())var R=C;else var S=this.session.documentToScreenPosition(b?d.end:d.start),R=this.session.screenToDocumentPosition(S.row+m,S.column);if(b){var w=A.fromPoints(C,R);w.cursor=w.start}else{var w=A.fromPoints(R,C);w.cursor=w.end}if(w.desiredColumn=M.column,!this.selection.inMultiSelectMode)this.selection.addRange(d);else if(g)var y=d.cursor;this.selection.addRange(w),y&&this.selection.substractPoint(y)},this.transposeSelections=function(m){for(var g=this.session,d=g.multiSelect,b=d.ranges,M=b.length;M--;){var C=b[M];if(C.isEmpty()){var S=g.getWordRange(C.start.row,C.start.column);C.start.row=S.start.row,C.start.column=S.start.column,C.end.row=S.end.row,C.end.column=S.end.column}}d.mergeOverlappingRanges();for(var R=[],M=b.length;M--;){var C=b[M];R.unshift(g.getTextRange(C))}m<0?R.unshift(R.pop()):R.push(R.shift());for(var M=b.length;M--;){var C=b[M],w=C.clone();g.replace(C,R[M]),C.start.row=w.start.row,C.start.column=w.start.column}d.fromOrientedRange(d.ranges[0])},this.selectMore=function(m,g,d){var b=this.session,M=b.multiSelect,C=M.toOrientedRange();if(!(C.isEmpty()&&(C=b.getWordRange(C.start.row,C.start.column),C.cursor=m==-1?C.start:C.end,this.multiSelect.addRange(C),d))){var S=b.getTextRange(C),R=e(b,S,m);R&&(R.cursor=m==-1?R.start:R.end,this.session.unfold(R),this.multiSelect.addRange(R),this.renderer.scrollCursorIntoView(null,.5)),g&&this.multiSelect.substractPoint(C.cursor)}},this.alignCursors=function(){var m=this.session,g=m.multiSelect,d=g.ranges,b=-1,M=d.filter(function(_){if(_.cursor.row==b)return!0;b=_.cursor.row});if(!d.length||M.length==d.length-1){var C=this.selection.getRange(),S=C.start.row,R=C.end.row,w=S==R;if(w){var y=this.session.getLength(),f;do f=this.session.getLine(R);while(/[=:]/.test(f)&&++R<y);do f=this.session.getLine(S);while(/[=:]/.test(f)&&--S>0);S<0&&(S=0),R>=y&&(R=y-1)}var u=this.session.removeFullLines(S,R);u=this.$reAlignText(u,w),this.session.insert({row:S,column:0},u.join(`
951
+ }`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(k,L,H){var E=k("../lib/dom"),A=k("../lib/oop"),$=k("../lib/event_emitter").EventEmitter,a=function(){function c(i,o){this.renderer=o,this.pixelRatio=1,this.maxHeight=o.layerConfig.maxHeight,this.lineHeight=o.layerConfig.lineHeight,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},this.setScrollBarV(i)}return c.prototype.$createCanvas=function(){this.canvas=E.createElement("canvas"),this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7",this.canvas.style.position="absolute"},c.prototype.setScrollBarV=function(i){this.$createCanvas(),this.scrollbarV=i,i.element.appendChild(this.canvas),this.setDimensions()},c.prototype.$updateDecorators=function(i){if(typeof this.canvas.getContext!="function")return;var o=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;this.setDimensions(i);var n=this.canvas.getContext("2d");function t(y,f){return y.priority<f.priority?-1:y.priority>f.priority?1:0}var e=this.renderer.session.$annotations;if(n.clearRect(0,0,this.canvas.width,this.canvas.height),e){var r={info:1,warning:2,error:3};e.forEach(function(y){y.priority=r[y.type]||null}),e=e.sort(t);for(var s=0;s<e.length;s++){var l=e[s].row,h=this.getVerticalOffsetForRow(l),v=h+this.lineHeight,m=Math.round(this.heightRatio*h),g=Math.round(this.heightRatio*v),d=Math.round((m+g)/2),b=g-d;b<this.halfMinDecorationHeight&&(b=this.halfMinDecorationHeight),d-b<0&&(d=b),d+b>this.canvasHeight&&(d=this.canvasHeight-b);var M=d-b,C=d+b,S=C-M;n.fillStyle=o[e[s].type]||null,n.fillRect(0,M,Math.round(this.oneZoneWidth-1),S)}}var R=this.renderer.session.selection.getCursor();if(R){var w=Math.round(this.getVerticalOffsetForRow(R.row)*this.heightRatio);n.fillStyle="rgba(0, 0, 0, 0.5)",n.fillRect(0,w,this.canvasWidth,2)}},c.prototype.getVerticalOffsetForRow=function(i){i=i|0;var o=this.renderer.session.documentToScreenRow(i,0)*this.lineHeight;return o},c.prototype.setDimensions=function(i){i=i||this.renderer.layerConfig,this.maxHeight=i.maxHeight,this.lineHeight=i.lineHeight,this.canvasHeight=i.height,this.canvasWidth=this.scrollbarV.width||this.canvasWidth,this.setZoneWidth(),this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.maxHeight<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight},c.prototype.setZoneWidth=function(){this.oneZoneWidth=this.canvasWidth},c.prototype.destroy=function(){this.canvas.parentNode.removeChild(this.canvas)},c}();A.implement(a.prototype,$),L.Decorator=a}),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(k,L,H){var E=k("./lib/oop"),A=k("./lib/dom"),$=k("./lib/lang"),a=k("./config"),c=k("./layer/gutter").Gutter,i=k("./layer/marker").Marker,o=k("./layer/text").Text,n=k("./layer/cursor").Cursor,t=k("./scrollbar").HScrollBar,e=k("./scrollbar").VScrollBar,r=k("./scrollbar_custom").HScrollBar,s=k("./scrollbar_custom").VScrollBar,l=k("./renderloop").RenderLoop,h=k("./layer/font_metrics").FontMetrics,v=k("./lib/event_emitter").EventEmitter,m=k("./css/editor-css"),g=k("./layer/decorators").Decorator,d=k("./lib/useragent"),b=k("./layer/text_util").isTextToken;A.importCssString(m,"ace_editor.css",!1);var M=function(){function C(S,R){var w=this;this.container=S||A.createElement("div"),A.addCssClass(this.container,"ace_editor"),A.HI_DPI&&A.addCssClass(this.container,"ace_hidpi"),this.setTheme(R),a.get("useStrictCSP")==null&&a.set("useStrictCSP",!1),this.$gutter=A.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=A.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=A.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new c(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new i(this.content);var y=this.$textLayer=new o(this.content);this.canvas=y.element,this.$markerFront=new i(this.content),this.$cursorLayer=new n(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new e(this.container,this),this.scrollBarH=new t(this.container,this),this.scrollBarV.on("scroll",function(f){w.$scrollAnimation||w.session.setScrollTop(f.data-w.scrollMargin.top)}),this.scrollBarH.on("scroll",function(f){w.$scrollAnimation||w.session.setScrollLeft(f.data-w.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new h(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(f){w.updateCharacterSize(),w.onResize(!0,w.gutterWidth,w.$size.width,w.$size.height),w._signal("changeCharacterSize",f)}),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=!d.isIOS,this.$loop=new l(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),a.resetOptions(this),a._signal("renderer",this)}return C.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(),A.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},C.prototype.setSession=function(S){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=S,S&&this.scrollMargin.top&&S.getScrollTop()<=0&&S.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(S),this.$markerBack.setSession(S),this.$markerFront.setSession(S),this.$gutterLayer.setSession(S),this.$textLayer.setSession(S),S&&(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))},C.prototype.updateLines=function(S,R,w){if(R===void 0&&(R=1/0),this.$changedLines?(this.$changedLines.firstRow>S&&(this.$changedLines.firstRow=S),this.$changedLines.lastRow<R&&(this.$changedLines.lastRow=R)):this.$changedLines={firstRow:S,lastRow:R},this.$changedLines.lastRow<this.layerConfig.firstRow)if(w)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},C.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},C.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},C.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},C.prototype.updateFull=function(S){S?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},C.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},C.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},C.prototype.onResize=function(S,R,w,y){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=S?1:0;var f=this.container;y||(y=f.clientHeight||f.scrollHeight),!y&&this.$maxLines&&this.lineHeight>1&&(!f.style.height||f.style.height=="0px")&&(f.style.height="1px",y=f.clientHeight||f.scrollHeight),w||(w=f.clientWidth||f.scrollWidth);var u=this.$updateCachedSize(S,R,w,y);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!w&&!y)return this.resizing=0;S&&(this.$gutterLayer.$padding=null),S?this.$renderChanges(u|this.$changes,!0):this.$loop.schedule(u|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},C.prototype.$updateCachedSize=function(S,R,w,y){y-=this.$extraHeight||0;var f=0,u=this.$size,p={width:u.width,height:u.height,scrollerHeight:u.scrollerHeight,scrollerWidth:u.scrollerWidth};if(y&&(S||u.height!=y)&&(u.height=y,f|=this.CHANGE_SIZE,u.scrollerHeight=u.height,this.$horizScroll&&(u.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(u.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",f=f|this.CHANGE_SCROLL),w&&(S||u.width!=w)){f|=this.CHANGE_SIZE,u.width=w,R==null&&(R=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=R,A.setStyle(this.scrollBarH.element.style,"left",R+"px"),A.setStyle(this.scroller.style,"left",R+this.margin.left+"px"),u.scrollerWidth=Math.max(0,w-R-this.scrollBarV.getWidth()-this.margin.h),A.setStyle(this.$gutter.style,"left",this.margin.left+"px");var x=this.scrollBarV.getWidth()+"px";A.setStyle(this.scrollBarH.element.style,"right",x),A.setStyle(this.scroller.style,"right",x),A.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(u.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||S)&&(f|=this.CHANGE_FULL)}return u.$dirty=!w||!y,f&&this._signal("resize",p),f},C.prototype.onGutterResize=function(S){var R=this.$showGutter?S: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()},C.prototype.adjustWrapLimit=function(){var S=this.$size.scrollerWidth-this.$padding*2,R=Math.floor(S/this.characterWidth);return this.session.adjustWrapLimit(R,this.$showPrintMargin&&this.$printMarginColumn)},C.prototype.setAnimatedScroll=function(S){this.setOption("animatedScroll",S)},C.prototype.getAnimatedScroll=function(){return this.$animatedScroll},C.prototype.setShowInvisibles=function(S){this.setOption("showInvisibles",S),this.session.$bidiHandler.setShowInvisibles(S)},C.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},C.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},C.prototype.setDisplayIndentGuides=function(S){this.setOption("displayIndentGuides",S)},C.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},C.prototype.setHighlightIndentGuides=function(S){this.setOption("highlightIndentGuides",S)},C.prototype.setShowPrintMargin=function(S){this.setOption("showPrintMargin",S)},C.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},C.prototype.setPrintMarginColumn=function(S){this.setOption("printMarginColumn",S)},C.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},C.prototype.getShowGutter=function(){return this.getOption("showGutter")},C.prototype.setShowGutter=function(S){return this.setOption("showGutter",S)},C.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},C.prototype.setFadeFoldWidgets=function(S){this.setOption("fadeFoldWidgets",S)},C.prototype.setHighlightGutterLine=function(S){this.setOption("highlightGutterLine",S)},C.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},C.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var S=A.createElement("div");S.className="ace_layer ace_print-margin-layer",this.$printMarginEl=A.createElement("div"),this.$printMarginEl.className="ace_print-margin",S.appendChild(this.$printMarginEl),this.content.insertBefore(S,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()}},C.prototype.getContainerElement=function(){return this.container},C.prototype.getMouseEventTarget=function(){return this.scroller},C.prototype.getTextAreaContainer=function(){return this.container},C.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var S=this.textarea.style,R=this.$composition;if(!this.$keepTextAreaAtCursor&&!R){A.translate(this.textarea,-100,0);return}var w=this.$cursorLayer.$pixelPos;if(w){R&&R.markerRange&&(w=this.$cursorLayer.getPixelPosition(R.markerRange.start,!0));var y=this.layerConfig,f=w.top,u=w.left;f-=y.offset;var p=R&&R.useTextareaForIME||d.isMobile?this.lineHeight:1;if(f<0||f>y.height-p){A.translate(this.textarea,0,0);return}var x=1,T=this.$size.height-p;if(!R)f+=this.lineHeight;else if(R.useTextareaForIME){var _=this.textarea.value;x=this.characterWidth*this.session.$getStringScreenWidth(_)[0]}else f+=this.lineHeight+2;u-=this.scrollLeft,u>this.$size.scrollerWidth-x&&(u=this.$size.scrollerWidth-x),u+=this.gutterWidth+this.margin.left,A.setStyle(S,"height",p+"px"),A.setStyle(S,"width",x+"px"),A.translate(this.textarea,Math.min(u,this.$size.scrollerWidth-x),Math.min(f,T))}}},C.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},C.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},C.prototype.getLastFullyVisibleRow=function(){var S=this.layerConfig,R=S.lastRow,w=this.session.documentToScreenRow(R,0)*S.lineHeight;return w-this.session.getScrollTop()>S.height-S.lineHeight?R-1:R},C.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},C.prototype.setPadding=function(S){this.$padding=S,this.$textLayer.setPadding(S),this.$cursorLayer.setPadding(S),this.$markerFront.setPadding(S),this.$markerBack.setPadding(S),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},C.prototype.setScrollMargin=function(S,R,w,y){var f=this.scrollMargin;f.top=S|0,f.bottom=R|0,f.right=y|0,f.left=w|0,f.v=f.top+f.bottom,f.h=f.left+f.right,f.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-f.top),this.updateFull()},C.prototype.setMargin=function(S,R,w,y){var f=this.margin;f.top=S|0,f.bottom=R|0,f.right=y|0,f.left=w|0,f.v=f.top+f.bottom,f.h=f.left+f.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},C.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},C.prototype.setHScrollBarAlwaysVisible=function(S){this.setOption("hScrollBarAlwaysVisible",S)},C.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},C.prototype.setVScrollBarAlwaysVisible=function(S){this.setOption("vScrollBarAlwaysVisible",S)},C.prototype.$updateScrollBarV=function(){var S=this.layerConfig.maxHeight,R=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(S-=(R-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>S-R&&(S=this.scrollTop+R,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(S+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},C.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},C.prototype.freeze=function(){this.$frozen=!0},C.prototype.unfreeze=function(){this.$frozen=!1},C.prototype.$renderChanges=function(S,R){if(this.$changes&&(S|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!S&&!R){this.$changes|=S;return}if(this.$size.$dirty)return this.$changes|=S,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",S),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var w=this.layerConfig;if(S&this.CHANGE_FULL||S&this.CHANGE_SIZE||S&this.CHANGE_TEXT||S&this.CHANGE_LINES||S&this.CHANGE_SCROLL||S&this.CHANGE_H_SCROLL){if(S|=this.$computeLayerConfig()|this.$loop.clear(),w.firstRow!=this.layerConfig.firstRow&&w.firstRowScreen==this.layerConfig.firstRowScreen){var y=this.scrollTop+(w.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;y>0&&(this.scrollTop=y,S=S|this.CHANGE_SCROLL,S|=this.$computeLayerConfig()|this.$loop.clear())}w=this.layerConfig,this.$updateScrollBarV(),S&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),A.translate(this.content,-this.scrollLeft,-w.offset);var f=w.width+2*this.$padding+"px",u=w.minHeight+"px";A.setStyle(this.content.style,"width",f),A.setStyle(this.content.style,"height",u)}if(S&this.CHANGE_H_SCROLL&&(A.translate(this.content,-this.scrollLeft,-w.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),S&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",S);return}if(S&this.CHANGE_SCROLL){this.$changedLines=null,S&this.CHANGE_TEXT||S&this.CHANGE_LINES?this.$textLayer.update(w):this.$textLayer.scrollLines(w),this.$showGutter&&(S&this.CHANGE_GUTTER||S&this.CHANGE_LINES?this.$gutterLayer.update(w):this.$gutterLayer.scrollLines(w)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",S);return}S&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):S&this.CHANGE_LINES?((this.$updateLines()||S&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):S&this.CHANGE_TEXT||S&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):S&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)),S&this.CHANGE_CURSOR&&(this.$cursorLayer.update(w),this.$moveTextAreaToCursor()),S&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(w),S&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(w),this._signal("afterRender",S)},C.prototype.$autosize=function(){var S=this.session.getScreenLength()*this.lineHeight,R=this.$maxLines*this.lineHeight,w=Math.min(R,Math.max((this.$minLines||1)*this.lineHeight,S))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(w+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&w>this.$maxPixelHeight&&(w=this.$maxPixelHeight);var y=w<=2*this.lineHeight,f=!y&&S>R;if(w!=this.desiredHeight||this.$size.height!=this.desiredHeight||f!=this.$vScroll){f!=this.$vScroll&&(this.$vScroll=f,this.scrollBarV.setVisible(f));var u=this.container.clientWidth;this.container.style.height=w+"px",this.$updateCachedSize(!0,this.$gutterWidth,u,w),this.desiredHeight=w,this._signal("autosize")}},C.prototype.$computeLayerConfig=function(){var S=this.session,R=this.$size,w=R.height<=2*this.lineHeight,y=this.session.getScreenLength(),f=y*this.lineHeight,u=this.$getLongestLine(),p=!w&&(this.$hScrollBarAlwaysVisible||R.scrollerWidth-u-2*this.$padding<0),x=this.$horizScroll!==p;x&&(this.$horizScroll=p,this.scrollBarH.setVisible(p));var T=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),w=R.height<=2*this.lineHeight);var _=R.scrollerHeight+this.lineHeight,I=!this.$maxLines&&this.$scrollPastEnd?(R.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;f+=I;var O=this.scrollMargin;this.session.setScrollTop(Math.max(-O.top,Math.min(this.scrollTop,f-R.scrollerHeight+O.bottom))),this.session.setScrollLeft(Math.max(-O.left,Math.min(this.scrollLeft,u+2*this.$padding-R.scrollerWidth+O.right)));var z=!w&&(this.$vScrollBarAlwaysVisible||R.scrollerHeight-f+I<0||this.scrollTop>O.top),D=T!==z;D&&(this.$vScroll=z,this.scrollBarV.setVisible(z));var N=this.scrollTop%this.lineHeight,F=Math.ceil(_/this.lineHeight)-1,B=Math.max(0,Math.round((this.scrollTop-N)/this.lineHeight)),P=B+F,V,G,j=this.lineHeight;B=S.screenToDocumentRow(B,0);var K=S.getFoldLine(B);K&&(B=K.start.row),V=S.documentToScreenRow(B,0),G=S.getRowLength(B)*j,P=Math.min(S.screenToDocumentRow(P,0),S.getLength()-1),_=R.scrollerHeight+S.getRowLength(P)*j+G,N=this.scrollTop-V*j,N<0&&V>0&&(V=Math.max(0,V+Math.floor(N/j)),N=this.scrollTop-V*j);var Q=0;return(this.layerConfig.width!=u||x)&&(Q=this.CHANGE_H_SCROLL),(x||D)&&(Q|=this.$updateCachedSize(!0,this.gutterWidth,R.width,R.height),this._signal("scrollbarVisibilityChanged"),D&&(u=this.$getLongestLine())),this.layerConfig={width:u,padding:this.$padding,firstRow:B,firstRowScreen:V,lastRow:P,lineHeight:j,characterWidth:this.characterWidth,minHeight:_,maxHeight:f,offset:N,gutterOffset:j?Math.max(0,Math.ceil((N+R.height-R.scrollerHeight)/j)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(u-this.$padding),Q},C.prototype.$updateLines=function(){if(this.$changedLines){var S=this.$changedLines.firstRow,R=this.$changedLines.lastRow;this.$changedLines=null;var w=this.layerConfig;if(!(S>w.lastRow+1)&&!(R<w.firstRow)){if(R===1/0){this.$showGutter&&this.$gutterLayer.update(w),this.$textLayer.update(w);return}return this.$textLayer.updateLines(w,S,R),!0}}},C.prototype.$getLongestLine=function(){var S=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(S+=1),this.$textLayer&&S>this.$textLayer.MAX_LINE_LENGTH&&(S=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(S*this.characterWidth))},C.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},C.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},C.prototype.addGutterDecoration=function(S,R){this.$gutterLayer.addGutterDecoration(S,R)},C.prototype.removeGutterDecoration=function(S,R){this.$gutterLayer.removeGutterDecoration(S,R)},C.prototype.updateBreakpoints=function(S){this._rows=S,this.$loop.schedule(this.CHANGE_GUTTER)},C.prototype.setAnnotations=function(S){this.$gutterLayer.setAnnotations(S),this.$loop.schedule(this.CHANGE_GUTTER)},C.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},C.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},C.prototype.showCursor=function(){this.$cursorLayer.showCursor()},C.prototype.scrollSelectionIntoView=function(S,R,w){this.scrollCursorIntoView(S,w),this.scrollCursorIntoView(R,w)},C.prototype.scrollCursorIntoView=function(S,R,w){if(this.$size.scrollerHeight!==0){var y=this.$cursorLayer.getPixelPosition(S),f=y.left,u=y.top,p=w&&w.top||0,x=w&&w.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var T=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;T+p>u?(R&&T+p>u+this.lineHeight&&(u-=R*this.$size.scrollerHeight),u===0&&(u=-this.scrollMargin.top),this.session.setScrollTop(u)):T+this.$size.scrollerHeight-x<u+this.lineHeight&&(R&&T+this.$size.scrollerHeight-x<u-this.lineHeight&&(u+=R*this.$size.scrollerHeight),this.session.setScrollTop(u+this.lineHeight+x-this.$size.scrollerHeight));var _=this.scrollLeft,I=2*this.layerConfig.characterWidth;f-I<_?(f-=I,f<this.$padding+I&&(f=-this.scrollMargin.left),this.session.setScrollLeft(f)):(f+=I,_+this.$size.scrollerWidth<f+this.characterWidth?this.session.setScrollLeft(Math.round(f+this.characterWidth-this.$size.scrollerWidth)):_<=this.$padding&&f-_<this.characterWidth&&this.session.setScrollLeft(0))}},C.prototype.getScrollTop=function(){return this.session.getScrollTop()},C.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},C.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},C.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},C.prototype.scrollToRow=function(S){this.session.setScrollTop(S*this.lineHeight)},C.prototype.alignCursor=function(S,R){typeof S=="number"&&(S={row:S,column:0});var w=this.$cursorLayer.getPixelPosition(S),y=this.$size.scrollerHeight-this.lineHeight,f=w.top-y*(R||0);return this.session.setScrollTop(f),f},C.prototype.$calcSteps=function(S,R){var w=0,y=this.STEPS,f=[],u=function(p,x,T){return T*(Math.pow(p-1,3)+1)+x};for(w=0;w<y;++w)f.push(u(w/this.STEPS,S,R-S));return f},C.prototype.scrollToLine=function(S,R,w,y){var f=this.$cursorLayer.getPixelPosition({row:S,column:0}),u=f.top;R&&(u-=this.$size.scrollerHeight/2);var p=this.scrollTop;this.session.setScrollTop(u),w!==!1&&this.animateScrolling(p,y)},C.prototype.animateScrolling=function(S,R){var w=this.scrollTop;if(!this.$animatedScroll)return;var y=this;if(S==w)return;if(this.$scrollAnimation){var f=this.$scrollAnimation.steps;if(f.length&&(S=f[0],S==w))return}var u=y.$calcSteps(S,w);this.$scrollAnimation={from:S,to:w,steps:u},clearInterval(this.$timer),y.session.setScrollTop(u.shift()),y.session.$scrollTop=w;function p(){y.$timer=clearInterval(y.$timer),y.$scrollAnimation=null,y.$stopAnimation=!1,R&&R()}this.$timer=setInterval(function(){if(y.$stopAnimation){p();return}if(!y.session)return clearInterval(y.$timer);u.length?(y.session.setScrollTop(u.shift()),y.session.$scrollTop=w):w!=null?(y.session.$scrollTop=-1,y.session.setScrollTop(w),w=null):p()},10)},C.prototype.scrollToY=function(S){this.scrollTop!==S&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=S)},C.prototype.scrollToX=function(S){this.scrollLeft!==S&&(this.scrollLeft=S),this.$loop.schedule(this.CHANGE_H_SCROLL)},C.prototype.scrollTo=function(S,R){this.session.setScrollTop(R),this.session.setScrollLeft(S)},C.prototype.scrollBy=function(S,R){R&&this.session.setScrollTop(this.session.getScrollTop()+R),S&&this.session.setScrollLeft(this.session.getScrollLeft()+S)},C.prototype.isScrollableBy=function(S,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||S<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||S>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},C.prototype.pixelToScreenCoordinates=function(S,R){var w;if(this.$hasCssTransforms){w={top:0,left:0};var y=this.$fontMetrics.transformCoordinates([S,R]);S=y[1]-this.gutterWidth-this.margin.left,R=y[0]}else w=this.scroller.getBoundingClientRect();var f=S+this.scrollLeft-w.left-this.$padding,u=f/this.characterWidth,p=Math.floor((R+this.scrollTop-w.top)/this.lineHeight),x=this.$blockCursor?Math.floor(u):Math.round(u);return{row:p,column:x,side:u-x>0?1:-1,offsetX:f}},C.prototype.screenToTextCoordinates=function(S,R){var w;if(this.$hasCssTransforms){w={top:0,left:0};var y=this.$fontMetrics.transformCoordinates([S,R]);S=y[1]-this.gutterWidth-this.margin.left,R=y[0]}else w=this.scroller.getBoundingClientRect();var f=S+this.scrollLeft-w.left-this.$padding,u=f/this.characterWidth,p=this.$blockCursor?Math.floor(u):Math.round(u),x=Math.floor((R+this.scrollTop-w.top)/this.lineHeight);return this.session.screenToDocumentPosition(x,Math.max(p,0),f)},C.prototype.textToScreenCoordinates=function(S,R){var w=this.scroller.getBoundingClientRect(),y=this.session.documentToScreenPosition(S,R),f=this.$padding+(this.session.$bidiHandler.isBidiRow(y.row,S)?this.session.$bidiHandler.getPosLeft(y.column):Math.round(y.column*this.characterWidth)),u=y.row*this.lineHeight;return{pageX:w.left+f-this.scrollLeft,pageY:w.top+u-this.scrollTop}},C.prototype.visualizeFocus=function(){A.addCssClass(this.container,"ace_focus")},C.prototype.visualizeBlur=function(){A.removeCssClass(this.container,"ace_focus")},C.prototype.showComposition=function(S){this.$composition=S,S.cssText||(S.cssText=this.textarea.style.cssText),S.useTextareaForIME==null&&(S.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(A.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):S.markerId=this.session.addMarker(S.markerRange,"ace_composition_marker","text")},C.prototype.setCompositionText=function(S){var R=this.session.selection.cursor;this.addToken(S,"composition_placeholder",R.row,R.column),this.$moveTextAreaToCursor()},C.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),A.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var S=this.session.selection.cursor;this.removeExtraToken(S.row,S.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},C.prototype.setGhostText=function(S,R){var w=this.session.selection.cursor,y=R||{row:w.row,column:w.column};this.removeGhostText();var f=this.$calculateWrappedTextChunks(S,y);this.addToken(f[0].text,"ghost_text",y.row,y.column),this.$ghostText={text:S,position:{row:y.row,column:y.column}};var u=A.createElement("div");if(f.length>1){var p=this.hideTokensAfterPosition(y.row,y.column),x;f.slice(1).forEach(function(D){var N=A.createElement("div"),F=A.createElement("span");F.className="ace_ghost_text",D.wrapped&&(N.className="ghost_text_line_wrapped"),D.text.length===0&&(D.text=" "),F.appendChild(A.createTextNode(D.text)),N.appendChild(F),u.appendChild(N),x=N}),p.forEach(function(D){var N=A.createElement("span");b(D.type)||(N.className="ace_"+D.type.replace(/\./g," ace_")),N.appendChild(A.createTextNode(D.value)),x.appendChild(N)}),this.$ghostTextWidget={el:u,row:y.row,column:y.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var T=this.$cursorLayer.getPixelPosition(y,!0),_=this.container,I=_.getBoundingClientRect().height,O=f.length*this.lineHeight,z=O<I-T.top;if(z)return;O<I?this.scrollBy(0,(f.length-1)*this.lineHeight):this.scrollToRow(y.row)}},C.prototype.$calculateWrappedTextChunks=function(S,R){var w=this.$size.scrollerWidth-this.$padding*2,y=Math.floor(w/this.characterWidth)-2;y=y<=0?60:y;for(var f=S.split(/\r?\n/),u=[],p=0;p<f.length;p++){var x=this.session.$getDisplayTokens(f[p],R.column),T=this.session.$computeWrapSplits(x,y,this.session.$tabSize);if(T.length>0){var _=0;T.push(f[p].length);for(var I=0;I<T.length;I++){var O=f[p].slice(_,T[I]);u.push({text:O,wrapped:!0}),_=T[I]}}else u.push({text:f[p],wrapped:!1})}return u},C.prototype.removeGhostText=function(){if(this.$ghostText){var S=this.$ghostText.position;this.removeExtraToken(S.row,S.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},C.prototype.addToken=function(S,R,w,y){var f=this.session;f.bgTokenizer.lines[w]=null;var u={type:R,value:S},p=f.getTokens(w);if(y==null||!p.length)p.push(u);else for(var x=0,T=0;T<p.length;T++){var _=p[T];if(x+=_.value.length,y<=x){var I=_.value.length-(x-y),O=_.value.slice(0,I),z=_.value.slice(I);p.splice(T,1,{type:_.type,value:O},u,{type:_.type,value:z});break}}this.updateLines(w,w)},C.prototype.hideTokensAfterPosition=function(S,R){for(var w=this.session.getTokens(S),y=0,f=!1,u=[],p=0;p<w.length;p++){var x=w[p];if(y+=x.value.length,x.type!=="ghost_text"){if(f){u.push({type:x.type,value:x.value}),x.type="hidden_token";continue}y===R&&(f=!0)}}return this.updateLines(S,S),u},C.prototype.removeExtraToken=function(S,R){this.session.bgTokenizer.lines[S]=null,this.updateLines(S,S)},C.prototype.setTheme=function(S,R){var w=this;if(this.$themeId=S,w._dispatchEvent("themeChange",{theme:S}),!S||typeof S=="string"){var y=S||this.$options.theme.initialValue;a.loadModule(["theme",y],f)}else f(S);function f(u){if(w.$themeId!=S)return R&&R();if(!u||!u.cssClass)throw new Error("couldn't load module "+S+" or it didn't call define");u.$id&&(w.$themeId=u.$id),A.importCssString(u.cssText,u.cssClass,w.container),w.theme&&A.removeCssClass(w.container,w.theme.cssClass);var p="padding"in u?u.padding:"padding"in(w.theme||{})?4:w.$padding;w.$padding&&p!=w.$padding&&w.setPadding(p),w.$theme=u.cssClass,w.theme=u,A.addCssClass(w.container,u.cssClass),A.setCssClass(w.container,"ace_dark",u.isDark),w.$size&&(w.$size.width=0,w.$updateSizeAsync()),w._dispatchEvent("themeLoaded",{theme:u}),R&&R(),d.isSafari&&w.scroller&&(w.scroller.style.background="red",w.scroller.style.background="")}},C.prototype.getTheme=function(){return this.$themeId},C.prototype.setStyle=function(S,R){A.setCssClass(this.container,S,R!==!1)},C.prototype.unsetStyle=function(S){A.removeCssClass(this.container,S)},C.prototype.setCursorStyle=function(S){A.setStyle(this.scroller.style,"cursor",S)},C.prototype.setMouseCursor=function(S){A.setStyle(this.scroller.style,"cursor",S)},C.prototype.attachToShadowRoot=function(){A.importCssString(m,"ace_editor.css",this.container)},C.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},C.prototype.$updateCustomScrollbar=function(S){var R=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),S===!0?(this.scrollBarV=new s(this.container,this),this.scrollBarH=new r(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(w){R.$scrollAnimation||R.session.setScrollTop(w.data-R.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){R.$scrollAnimation||R.session.setScrollLeft(w.data-R.scrollMargin.left)}),this.$scrollDecorator?(this.$scrollDecorator.setScrollBarV(this.scrollBarV),this.$scrollDecorator.$updateDecorators()):(this.$scrollDecorator=new g(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators())):(this.scrollBarV=new e(this.container,this),this.scrollBarH=new t(this.container,this),this.scrollBarV.addEventListener("scroll",function(w){R.$scrollAnimation||R.session.setScrollTop(w.data-R.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){R.$scrollAnimation||R.session.setScrollLeft(w.data-R.scrollMargin.left)}))},C.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var S=this;this.$resizeTimer=$.delayedCall(function(){S.destroyed||S.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(R){var w=R[0].contentRect.width,y=R[0].contentRect.height;Math.abs(S.$size.width-w)>1||Math.abs(S.$size.height-y)>1?S.$resizeTimer.delay():S.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},C}();M.prototype.CHANGE_CURSOR=1,M.prototype.CHANGE_MARKER=2,M.prototype.CHANGE_GUTTER=4,M.prototype.CHANGE_SCROLL=8,M.prototype.CHANGE_LINES=16,M.prototype.CHANGE_TEXT=32,M.prototype.CHANGE_SIZE=64,M.prototype.CHANGE_MARKER_BACK=128,M.prototype.CHANGE_MARKER_FRONT=256,M.prototype.CHANGE_FULL=512,M.prototype.CHANGE_H_SCROLL=1024,M.prototype.$changes=0,M.prototype.$padding=null,M.prototype.$frozen=!1,M.prototype.STEPS=8,E.implement(M.prototype,v),a.defineOptions(M.prototype,"renderer",{useResizeObserver:{set:function(C){!C&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):C&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(C){this.$textLayer.setShowInvisibles(C)&&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(C){typeof C=="number"&&(this.$printMarginColumn=C),this.$showPrintMargin=!!C,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(C){this.$gutter.style.display=C?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(C){this.$gutterLayer.$useSvgGutterIcons=C},initialValue:!1},showFoldedAnnotations:{set:function(C){this.$gutterLayer.$showFoldedAnnotations=C},initialValue:!1},fadeFoldWidgets:{set:function(C){A.setCssClass(this.$gutter,"ace_fade-fold-widgets",C)},initialValue:!1},showFoldWidgets:{set:function(C){this.$gutterLayer.setShowFoldWidgets(C),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(C){this.$textLayer.setDisplayIndentGuides(C)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(C){this.$textLayer.setHighlightIndentGuides(C)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(C){this.$gutterLayer.setHighlightGutterLine(C),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(C){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(C){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(C){typeof C=="number"&&(C=C+"px"),this.container.style.fontSize=C,this.updateFontSize()},initialValue:12},fontFamily:{set:function(C){this.container.style.fontFamily=C,this.updateFontSize()}},maxLines:{set:function(C){this.updateFull()}},minLines:{set:function(C){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(C){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(C){C=+C||0,this.$scrollPastEnd!=C&&(this.$scrollPastEnd=C,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(C){this.$gutterLayer.$fixedWidth=!!C,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(C){this.$updateCustomScrollbar(C)},initialValue:!1},theme:{set:function(C){this.setTheme(C)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!d.isMobile&&!d.isIE}}),L.VirtualRenderer=M}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(k,L,H){var E=k("../lib/oop"),A=k("../lib/net"),$=k("../lib/event_emitter").EventEmitter,a=k("../config");function c(t){var e="importScripts('"+A.qualifyURL(t)+"');";try{return new Blob([e],{type:"application/javascript"})}catch{var r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,s=new r;return s.append(e),s.getBlob("application/javascript")}}function i(t){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(a.get("loadWorkerFromBlob")){var e=c(t),r=window.URL||window.webkitURL,s=r.createObjectURL(e);return new Worker(s)}return new Worker(t)}var o=function(t){t.postMessage||(t=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=t,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(){E.implement(this,$),this.$createWorkerFromOldConfig=function(t,e,r,s,l){if(k.nameToUrl&&!k.toUrl&&(k.toUrl=k.nameToUrl),a.get("packaged")||!k.toUrl)s=s||a.moduleUrl(e,"worker");else{var h=this.$normalizePath;s=s||h(k.toUrl("ace/worker/worker.js",null,"_"));var v={};t.forEach(function(m){v[m]=h(k.toUrl(m,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=i(s),l&&this.send("importScripts",l),this.$worker.postMessage({init:!0,tlns:v,module:e,classname:r}),this.$worker},this.onMessage=function(t){var e=t.data;switch(e.type){case"event":this._signal(e.name,{data:e.data});break;case"call":var r=this.callbacks[e.id];r&&(r(e.data),delete this.callbacks[e.id]);break;case"error":this.reportError(e.data);break;case"log":window.console&&console.log&&console.log.apply(console,e.data);break}},this.reportError=function(t){window.console&&console.error&&console.error(t)},this.$normalizePath=function(t){return A.qualifyURL(t)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(t){t.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(t,e){this.$worker.postMessage({command:t,args:e})},this.call=function(t,e,r){if(r){var s=this.callbackId++;this.callbacks[s]=r,e.push(s)}this.send(t,e)},this.emit=function(t,e){try{e.data&&e.data.err&&(e.data.err={message:e.data.err.message,stack:e.data.err.stack,code:e.data.err.code}),this.$worker&&this.$worker.postMessage({event:t,data:{data:e.data}})}catch(r){console.error(r.stack)}},this.attachToDocument=function(t){this.$doc&&this.terminate(),this.$doc=t,this.call("setValue",[t.getValue()]),t.on("change",this.changeListener,!0)},this.changeListener=function(t){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),t.action=="insert"?this.deltaQueue.push(t.start,t.lines):this.deltaQueue.push(t.start,t.end)},this.$sendDeltaQueue=function(){var t=this.deltaQueue;t&&(this.deltaQueue=null,t.length>50&&t.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:t}))}}).call(o.prototype);var n=function(t,e,r){var s=null,l=!1,h=Object.create($),v=[],m=new o({messageBuffer:v,terminate:function(){},postMessage:function(d){v.push(d),s&&(l?setTimeout(g):g())}});m.setEmitSync=function(d){l=d};var g=function(){var d=v.shift();d.command?s[d.command].apply(s,d.args):d.event&&h._signal(d.event,d.data)};return h.postMessage=function(d){m.onMessage({data:d})},h.callback=function(d,b){this.postMessage({type:"call",id:b,data:d})},h.emit=function(d,b){this.postMessage({type:"event",name:d,data:b})},a.loadModule(["worker",e],function(d){for(s=new d[r](h);v.length;)g()}),m};L.UIWorkerClient=n,L.WorkerClient=o,L.createWorker=i}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(k,L,H){var E=k("./range").Range,A=k("./lib/event_emitter").EventEmitter,$=k("./lib/oop"),a=function(){function c(i,o,n,t,e,r){var s=this;this.length=o,this.session=i,this.doc=i.getDocument(),this.mainClass=e,this.othersClass=r,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=t,this.$onCursorChange=function(){setTimeout(function(){s.onCursorChange()})},this.$pos=n;var l=i.getUndoManager().$undoStack||i.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=l.length,this.setup(),i.selection.on("changeCursor",this.$onCursorChange)}return c.prototype.setup=function(){var i=this,o=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=o.createAnchor(this.$pos.row,this.$pos.column);var t=this.pos;t.$insertRight=!0,t.detach(),t.markerId=n.addMarker(new E(t.row,t.column,t.row,t.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(e){var r=o.createAnchor(e.row,e.column);r.$insertRight=!0,r.detach(),i.others.push(r)}),n.setUndoSelect(!1)},c.prototype.showOtherMarkers=function(){if(!this.othersActive){var i=this.session,o=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=i.addMarker(new E(n.row,n.column,n.row,n.column+o.length),o.othersClass,null,!1)})}},c.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var i=0;i<this.others.length;i++)this.session.removeMarker(this.others[i].markerId)}},c.prototype.onUpdate=function(i){if(this.$updating)return this.updateAnchors(i);var o=i;if(o.start.row===o.end.row&&o.start.row===this.pos.row){this.$updating=!0;var n=i.action==="insert"?o.end.column-o.start.column:o.start.column-o.end.column,t=o.start.column>=this.pos.column&&o.start.column<=this.pos.column+this.length+1,e=o.start.column-this.pos.column;if(this.updateAnchors(i),t&&(this.length+=n),t&&!this.session.$fromUndo){if(i.action==="insert")for(var r=this.others.length-1;r>=0;r--){var s=this.others[r],l={row:s.row,column:s.column+e};this.doc.insertMergedLines(l,i.lines)}else if(i.action==="remove")for(var r=this.others.length-1;r>=0;r--){var s=this.others[r],l={row:s.row,column:s.column+e};this.doc.remove(new E(l.row,l.column,l.row,l.column-n))}}this.$updating=!1,this.updateMarkers()}},c.prototype.updateAnchors=function(i){this.pos.onChange(i);for(var o=this.others.length;o--;)this.others[o].onChange(i);this.updateMarkers()},c.prototype.updateMarkers=function(){if(!this.$updating){var i=this,o=this.session,n=function(e,r){o.removeMarker(e.markerId),e.markerId=o.addMarker(new E(e.row,e.column,e.row,e.column+i.length),r,null,!1)};n(this.pos,this.mainClass);for(var t=this.others.length;t--;)n(this.others[t],this.othersClass)}},c.prototype.onCursorChange=function(i){if(!(this.$updating||!this.session)){var o=this.session.selection.getCursor();o.row===this.pos.row&&o.column>=this.pos.column&&o.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",i)):(this.hideOtherMarkers(),this._emit("cursorLeave",i))}},c.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},c.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var i=this.session.getUndoManager(),o=(i.$undoStack||i.$undostack).length-this.$undoStackDepth,n=0;n<o;n++)i.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},c}();$.implement(a.prototype,A),L.PlaceHolder=a}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(k,L,H){var E=k("../lib/event"),A=k("../lib/useragent");function $(c,i){return c.row==i.row&&c.column==i.column}function a(c){var i=c.domEvent,o=i.altKey,n=i.shiftKey,t=i.ctrlKey,e=c.getAccelKey(),r=c.getButton();if(t&&A.isMac&&(r=i.button),c.editor.inMultiSelectMode&&r==2){c.editor.textInput.onContextMenu(c.domEvent);return}if(!t&&!o&&!e){r===0&&c.editor.inMultiSelectMode&&c.editor.exitMultiSelectMode();return}if(r===0){var s=c.editor,l=s.selection,h=s.inMultiSelectMode,v=c.getDocumentPosition(),m=l.getCursor(),g=c.inSelection()||l.isEmpty()&&$(v,m),d=c.x,b=c.y,M=function(O){d=O.clientX,b=O.clientY},C=s.session,S=s.renderer.pixelToScreenCoordinates(d,b),R=S,w;if(s.$mouseHandler.$enableJumpToDef)t&&o||e&&o?w=n?"block":"add":o&&s.$blockSelectEnabled&&(w="block");else if(e&&!o){if(w="add",!h&&n)return}else o&&s.$blockSelectEnabled&&(w="block");if(w&&A.isMac&&i.ctrlKey&&s.$mouseHandler.cancelContextMenu(),w=="add"){if(!h&&g)return;if(!h){var y=l.toOrientedRange();s.addSelectionMarker(y)}var f=l.rangeList.rangeAtPoint(v);s.inVirtualSelectionMode=!0,n&&(f=null,y=l.ranges[0]||y,s.removeSelectionMarker(y)),s.once("mouseup",function(){var O=l.toOrientedRange();f&&O.isEmpty()&&$(f.cursor,O.cursor)?l.substractPoint(O.cursor):(n?l.substractPoint(y.cursor):y&&(s.removeSelectionMarker(y),l.addRange(y)),l.addRange(O)),s.inVirtualSelectionMode=!1})}else if(w=="block"){c.stop(),s.inVirtualSelectionMode=!0;var u,p=[],x=function(){var O=s.renderer.pixelToScreenCoordinates(d,b),z=C.screenToDocumentPosition(O.row,O.column,O.offsetX);$(R,O)&&$(z,l.lead)||(R=O,s.selection.moveToPosition(z),s.renderer.scrollCursorIntoView(),s.removeSelectionMarkers(p),p=l.rectangularRangeBlock(R,S),s.$mouseHandler.$clickSelection&&p.length==1&&p[0].isEmpty()&&(p[0]=s.$mouseHandler.$clickSelection.clone()),p.forEach(s.addSelectionMarker,s),s.updateSelectionMarkers())};h&&!e?l.toSingleRange():!h&&e&&(u=l.toOrientedRange(),s.addSelectionMarker(u)),n?S=C.documentToScreenPosition(l.lead):l.moveToPosition(v),R={row:-1,column:-1};var T=function(O){x(),clearInterval(I),s.removeSelectionMarkers(p),p.length||(p=[l.toOrientedRange()]),u&&(s.removeSelectionMarker(u),l.toSingleRange(u));for(var z=0;z<p.length;z++)l.addRange(p[z]);s.inVirtualSelectionMode=!1,s.$mouseHandler.$clickSelection=null},_=x;E.capture(s.container,M,T);var I=setInterval(function(){_()},20);return c.preventDefault()}}}L.onMouseDown=a}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(k,L,H){L.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(A){A.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(A){A.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(A){A.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(A){A.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(A){A.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(A){A.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(A){A.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(A){A.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(A){A.multiSelect.rangeCount>1?A.multiSelect.joinSelections():A.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(A){A.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(A){A.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(A){A.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],L.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(A){A.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(A){return A&&A.inMultiSelectMode}}];var E=k("../keyboard/hash_handler").HashHandler;L.keyboardHandler=new E(L.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(k,L,H){var E=k("./range_list").RangeList,A=k("./range").Range,$=k("./selection").Selection,a=k("./mouse/multi_select_handler").onMouseDown,c=k("./lib/event"),i=k("./lib/lang"),o=k("./commands/multi_select_commands");L.commands=o.defaultCommands.concat(o.multiSelectCommands);var n=k("./search").Search,t=new n;function e(m,g,d){return t.$options.wrap=!0,t.$options.needle=g,t.$options.backwards=d==-1,t.find(m)}var r=k("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(r.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(m,g){if(m){if(!this.inMultiSelectMode&&this.rangeCount===0){var d=this.toOrientedRange();if(this.rangeList.add(d),this.rangeList.add(m),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),g||this.fromOrientedRange(m);this.rangeList.removeAll(),this.rangeList.add(d),this.$onAddRange(d)}m.cursor||(m.cursor=m.end);var b=this.rangeList.add(m);return this.$onAddRange(m),b.length&&this.$onRemoveRange(b),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),g||this.fromOrientedRange(m)}},this.toSingleRange=function(m){m=m||this.ranges[0];var g=this.rangeList.removeAll();g.length&&this.$onRemoveRange(g),m&&this.fromOrientedRange(m)},this.substractPoint=function(m){var g=this.rangeList.substractPoint(m);if(g)return this.$onRemoveRange(g),g[0]},this.mergeOverlappingRanges=function(){var m=this.rangeList.merge();m.length&&this.$onRemoveRange(m)},this.$onAddRange=function(m){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(m),this._signal("addRange",{range:m})},this.$onRemoveRange=function(m){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var g=this.rangeList.ranges.pop();m.push(g),this.rangeCount=0}for(var d=m.length;d--;){var b=this.ranges.indexOf(m[d]);this.ranges.splice(b,1)}this._signal("removeRange",{ranges:m}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),g=g||this.ranges[0],g&&!g.isEqual(this.getRange())&&this.fromOrientedRange(g)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new E,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var m=this.ranges.length?this.ranges:[this.getRange()],g=[],d=0;d<m.length;d++){var b=m[d],M=b.start.row,C=b.end.row;if(M===C)g.push(b.clone());else{for(g.push(new A(M,b.start.column,M,this.session.getLine(M).length));++M<C;)g.push(this.getLineRange(M,!0));g.push(new A(C,0,C,b.end.column))}d==0&&!this.isBackwards()&&(g=g.reverse())}this.toSingleRange();for(var d=g.length;d--;)this.addRange(g[d])},this.joinSelections=function(){var m=this.rangeList.ranges,g=m[m.length-1],d=A.fromPoints(m[0].start,g.end);this.toSingleRange(),this.setSelectionRange(d,g.cursor==g.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var m=this.rangeList.ranges,g=m[m.length-1],d=A.fromPoints(m[0].start,g.end);this.toSingleRange(),this.setSelectionRange(d,g.cursor==g.start)}else{var b=this.session.documentToScreenPosition(this.cursor),M=this.session.documentToScreenPosition(this.anchor),C=this.rectangularRangeBlock(b,M);C.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(m,g,d){var b=[],M=m.column<g.column;if(M)var C=m.column,S=g.column,R=m.offsetX,w=g.offsetX;else var C=g.column,S=m.column,R=g.offsetX,w=m.offsetX;var y=m.row<g.row;if(y)var f=m.row,u=g.row;else var f=g.row,u=m.row;C<0&&(C=0),f<0&&(f=0),f==u&&(d=!0);for(var p,x=f;x<=u;x++){var T=A.fromPoints(this.session.screenToDocumentPosition(x,C,R),this.session.screenToDocumentPosition(x,S,w));if(T.isEmpty()){if(p&&l(T.end,p))break;p=T.end}T.cursor=M?T.start:T.end,b.push(T)}if(y&&b.reverse(),!d){for(var _=b.length-1;b[_].isEmpty()&&_>0;)_--;if(_>0)for(var I=0;b[I].isEmpty();)I++;for(var O=_;O>=I;O--)b[O].isEmpty()&&b.splice(O,1)}return b}}).call($.prototype);var s=k("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(m){m.cursor||(m.cursor=m.end);var g=this.getSelectionStyle();return m.marker=this.session.addMarker(m,"ace_selection",g),this.session.$selectionMarkers.push(m),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,m},this.removeSelectionMarker=function(m){if(m.marker){this.session.removeMarker(m.marker);var g=this.session.$selectionMarkers.indexOf(m);g!=-1&&this.session.$selectionMarkers.splice(g,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(m){for(var g=this.session.$selectionMarkers,d=m.length;d--;){var b=m[d];if(b.marker){this.session.removeMarker(b.marker);var M=g.indexOf(b);M!=-1&&g.splice(M,1)}}this.session.selectionMarkerCount=g.length},this.$onAddRange=function(m){this.addSelectionMarker(m.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(m){this.removeSelectionMarkers(m.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(m){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(o.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(m){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(o.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(m){var g=m.command,d=m.editor;if(d.multiSelect){if(g.multiSelectAction)g.multiSelectAction=="forEach"?b=d.forEachSelection(g,m.args):g.multiSelectAction=="forEachLine"?b=d.forEachSelection(g,m.args,!0):g.multiSelectAction=="single"?(d.exitMultiSelectMode(),b=g.exec(d,m.args||{})):b=g.multiSelectAction(d,m.args||{});else{var b=g.exec(d,m.args||{});d.multiSelect.addRange(d.multiSelect.toOrientedRange()),d.multiSelect.mergeOverlappingRanges()}return b}},this.forEachSelection=function(m,g,d){if(!this.inVirtualSelectionMode){var b=d&&d.keepOrder,M=d==!0||d&&d.$byLines,C=this.session,S=this.selection,R=S.rangeList,w=(b?S:R).ranges,y;if(!w.length)return m.exec?m.exec(this,g||{}):m(this,g||{});var f=S._eventRegistry;S._eventRegistry={};var u=new $(C);this.inVirtualSelectionMode=!0;for(var p=w.length;p--;){if(M)for(;p>0&&w[p].start.row==w[p-1].end.row;)p--;u.fromOrientedRange(w[p]),u.index=p,this.selection=C.selection=u;var x=m.exec?m.exec(this,g||{}):m(this,g||{});!y&&x!==void 0&&(y=x),u.toOrientedRange(w[p])}u.detach(),this.selection=C.selection=S,this.inVirtualSelectionMode=!1,S._eventRegistry=f,S.mergeOverlappingRanges(),S.ranges[0]&&S.fromOrientedRange(S.ranges[0]);var T=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),T&&T.from==T.to&&this.renderer.animateScrolling(T.from),y}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var m="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var g=this.multiSelect.rangeList.ranges,d=[],b=0;b<g.length;b++)d.push(this.session.getTextRange(g[b]));var M=this.session.getDocument().getNewLineCharacter();m=d.join(M),m.length==(d.length-1)*M.length&&(m="")}else this.selection.isEmpty()||(m=this.session.getTextRange(this.getSelectionRange()));return m},this.$checkMultiselectChange=function(m,g){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var d=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&g==this.multiSelect.anchor)return;var b=g==this.multiSelect.anchor?d.cursor==d.start?d.end:d.start:d.cursor;b.row!=g.row||this.session.$clipPositionToDocument(b.row,b.column).column!=g.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(m,g,d){if(g=g||{},g.needle=m||g.needle,g.needle==null){var b=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();g.needle=this.session.getTextRange(b)}this.$search.set(g);var M=this.$search.findAll(this.session);if(!M.length)return 0;var C=this.multiSelect;d||C.toSingleRange(M[0]);for(var S=M.length;S--;)C.addRange(M[S],!0);return b&&C.rangeList.rangeAtPoint(b.start)&&C.addRange(b,!0),M.length},this.selectMoreLines=function(m,g){var d=this.selection.toOrientedRange(),b=d.cursor==d.end,M=this.session.documentToScreenPosition(d.cursor);this.selection.$desiredColumn&&(M.column=this.selection.$desiredColumn);var C=this.session.screenToDocumentPosition(M.row+m,M.column);if(d.isEmpty())var R=C;else var S=this.session.documentToScreenPosition(b?d.end:d.start),R=this.session.screenToDocumentPosition(S.row+m,S.column);if(b){var w=A.fromPoints(C,R);w.cursor=w.start}else{var w=A.fromPoints(R,C);w.cursor=w.end}if(w.desiredColumn=M.column,!this.selection.inMultiSelectMode)this.selection.addRange(d);else if(g)var y=d.cursor;this.selection.addRange(w),y&&this.selection.substractPoint(y)},this.transposeSelections=function(m){for(var g=this.session,d=g.multiSelect,b=d.ranges,M=b.length;M--;){var C=b[M];if(C.isEmpty()){var S=g.getWordRange(C.start.row,C.start.column);C.start.row=S.start.row,C.start.column=S.start.column,C.end.row=S.end.row,C.end.column=S.end.column}}d.mergeOverlappingRanges();for(var R=[],M=b.length;M--;){var C=b[M];R.unshift(g.getTextRange(C))}m<0?R.unshift(R.pop()):R.push(R.shift());for(var M=b.length;M--;){var C=b[M],w=C.clone();g.replace(C,R[M]),C.start.row=w.start.row,C.start.column=w.start.column}d.fromOrientedRange(d.ranges[0])},this.selectMore=function(m,g,d){var b=this.session,M=b.multiSelect,C=M.toOrientedRange();if(!(C.isEmpty()&&(C=b.getWordRange(C.start.row,C.start.column),C.cursor=m==-1?C.start:C.end,this.multiSelect.addRange(C),d))){var S=b.getTextRange(C),R=e(b,S,m);R&&(R.cursor=m==-1?R.start:R.end,this.session.unfold(R),this.multiSelect.addRange(R),this.renderer.scrollCursorIntoView(null,.5)),g&&this.multiSelect.substractPoint(C.cursor)}},this.alignCursors=function(){var m=this.session,g=m.multiSelect,d=g.ranges,b=-1,M=d.filter(function(_){if(_.cursor.row==b)return!0;b=_.cursor.row});if(!d.length||M.length==d.length-1){var C=this.selection.getRange(),S=C.start.row,R=C.end.row,w=S==R;if(w){var y=this.session.getLength(),f;do f=this.session.getLine(R);while(/[=:]/.test(f)&&++R<y);do f=this.session.getLine(S);while(/[=:]/.test(f)&&--S>0);S<0&&(S=0),R>=y&&(R=y-1)}var u=this.session.removeFullLines(S,R);u=this.$reAlignText(u,w),this.session.insert({row:S,column:0},u.join(`
952
952
  `)+`
953
- `),w||(C.start.column=0,C.end.column=u[u.length-1].length),this.selection.setRange(C)}else{M.forEach(function(_){g.substractPoint(_.cursor)});var p=0,L=1/0,T=d.map(function(_){var I=_.cursor,O=m.getLine(I.row),z=O.substr(I.column).search(/\S/g);return z==-1&&(z=0),I.column>p&&(p=I.column),z<L&&(L=z),z});d.forEach(function(_,I){var O=_.cursor,z=p-O.column,D=T[I]-L;z>D?m.insert(O,i.stringRepeat(" ",z-D)):m.remove(new A(O.row,O.column,O.row,O.column-z+D)),_.start.column=_.end.column=p,_.start.row=_.end.row=O.row,_.cursor=_.end}),g.fromOrientedRange(d[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(m,g){var d=!0,b=!0,M,C,S;return m.map(function(u){var p=u.match(/(\s*)(.*?)(\s*)([=:].*)/);return p?M==null?(M=p[1].length,C=p[2].length,S=p[3].length,p):(M+C+S!=p[1].length+p[2].length+p[3].length&&(b=!1),M!=p[1].length&&(d=!1),M>p[1].length&&(M=p[1].length),C<p[2].length&&(C=p[2].length),S>p[3].length&&(S=p[3].length),p):[u]}).map(g?w:d?b?y:w:f);function R(u){return i.stringRepeat(" ",u)}function w(u){return u[2]?R(M)+u[2]+R(C-u[2].length+S)+u[4].replace(/^([=:])\s+/,"$1 "):u[0]}function y(u){return u[2]?R(M+C-u[2].length)+u[2]+R(S)+u[4].replace(/^([=:])\s+/,"$1 "):u[0]}function f(u){return u[2]?R(M)+u[2]+R(S)+u[4].replace(/^([=:])\s+/,"$1 "):u[0]}}}).call(s.prototype);function l(m,g){return m.row==g.row&&m.column==g.column}x.onSessionChange=function(m){var g=m.session;g&&!g.multiSelect&&(g.$selectionMarkers=[],g.selection.$initRangeList(),g.multiSelect=g.selection),this.multiSelect=g&&g.multiSelect;var d=m.oldSession;d&&(d.multiSelect.off("addRange",this.$onAddRange),d.multiSelect.off("removeRange",this.$onRemoveRange),d.multiSelect.off("multiSelect",this.$onMultiSelect),d.multiSelect.off("singleSelect",this.$onSingleSelect),d.multiSelect.lead.off("change",this.$checkMultiselectChange),d.multiSelect.anchor.off("change",this.$checkMultiselectChange)),g&&(g.multiSelect.on("addRange",this.$onAddRange),g.multiSelect.on("removeRange",this.$onRemoveRange),g.multiSelect.on("multiSelect",this.$onMultiSelect),g.multiSelect.on("singleSelect",this.$onSingleSelect),g.multiSelect.lead.on("change",this.$checkMultiselectChange),g.multiSelect.anchor.on("change",this.$checkMultiselectChange)),g&&this.inMultiSelectMode!=g.selection.inMultiSelectMode&&(g.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function h(m){m.$multiselectOnSessionChange||(m.$onAddRange=m.$onAddRange.bind(m),m.$onRemoveRange=m.$onRemoveRange.bind(m),m.$onMultiSelect=m.$onMultiSelect.bind(m),m.$onSingleSelect=m.$onSingleSelect.bind(m),m.$multiselectOnSessionChange=x.onSessionChange.bind(m),m.$checkMultiselectChange=m.$checkMultiselectChange.bind(m),m.$multiselectOnSessionChange(m),m.on("changeSession",m.$multiselectOnSessionChange),m.on("mousedown",a),m.commands.addCommands(o.defaultCommands),v(m))}function v(m){if(!m.textInput)return;var g=m.textInput.getElement(),d=!1;c.addListener(g,"keydown",function(M){var C=M.keyCode==18&&!(M.ctrlKey||M.shiftKey||M.metaKey);m.$blockSelectEnabled&&C?d||(m.renderer.setMouseCursor("crosshair"),d=!0):d&&b()},m),c.addListener(g,"keyup",b,m),c.addListener(g,"blur",b,m);function b(M){d&&(m.renderer.setMouseCursor(""),d=!1)}}x.MultiSelect=h,k("./config").defineOptions(s.prototype,"editor",{enableMultiselect:{set:function(m){h(this),m?this.on("mousedown",a):this.off("mousedown",a)},value:!0},enableBlockSelect:{set:function(m){this.$blockSelectEnabled=m},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(k,x,H){var E=k("../../range").Range,A=x.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function($,a,c){var i=$.getLine(c);return this.foldingStartMarker.test(i)?"start":a=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(i)?"end":""},this.getFoldWidgetRange=function($,a,c){return null},this.indentationBlock=function($,a,c){var i=/\S/,o=$.getLine(a),n=o.search(i);if(n!=-1){for(var t=c||o.length,e=$.getLength(),r=a,s=a;++a<e;){var l=$.getLine(a).search(i);if(l!=-1){if(l<=n){var h=$.getTokenAt(a,0);if(!h||h.type!=="string")break}s=a}}if(s>r){var v=$.getLine(s).length;return new E(r,t,s,v)}}},this.openingBracketBlock=function($,a,c,i,o){var n={row:c,column:i+1},t=$.$findClosingBracket(a,n,o);if(t){var e=$.foldWidgets[t.row];return e==null&&(e=$.getFoldWidget(t.row)),e=="start"&&t.row>n.row&&(t.row--,t.column=$.getLine(t.row).length),E.fromPoints(n,t)}},this.closingBracketBlock=function($,a,c,i,o){var n={row:c,column:i},t=$.$findOpeningBracket(a,n);if(t)return t.column++,n.column--,E.fromPoints(t,n)}}).call(A.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(k,x,H){var E=k("../lib/dom"),A=k("../range").Range,$=k("../config").nls;function a(i,o,n){for(var t=0,e=i.length-1;t<=e;){var r=t+e>>1,s=n(o,i[r]);if(s>0)t=r+1;else if(s<0)e=r-1;else return r}return-(t+1)}function c(i,o,n){var t=i.getAnnotations().sort(A.comparePoints);if(t.length){var e=a(t,{row:o,column:-1},A.comparePoints);e<0&&(e=-e-1),e>=t.length?e=n>0?0:t.length-1:e===0&&n<0&&(e=t.length-1);var r=t[e];if(!(!r||!n)){if(r.row===o){do r=t[e+=n];while(r&&r.row===o);if(!r)return t.slice()}var s=[];o=r.row;do s[n<0?"unshift":"push"](r),r=t[e+=n];while(r&&r.row==o);return s.length&&s}}}x.showErrorMarker=function(i,o){var n=i.session,t=i.getCursorPosition(),e=t.row,r=n.widgetManager.getWidgetsAtRow(e).filter(function(M){return M.type=="errorMarker"})[0];r?r.destroy():e-=o;var s=c(n,e,o),l;if(s){var h=s[0];t.column=(h.pos&&typeof h.column!="number"?h.pos.sc:h.column)||0,t.row=h.row,l=i.renderer.$gutterLayer.$annotations[t.row]}else{if(r)return;l={displayText:[$("error-marker.good-state","Looks good!")],className:"ace_ok"}}i.session.unfold(t.row),i.selection.moveToPosition(t);var v={row:t.row,fixedWidth:!0,coverGutter:!0,el:E.createElement("div"),type:"errorMarker"},m=v.el.appendChild(E.createElement("div")),g=v.el.appendChild(E.createElement("div"));g.className="error_widget_arrow "+l.className;var d=i.renderer.$cursorLayer.getPixelPosition(t).left;g.style.left=d+i.renderer.gutterWidth-5+"px",v.el.className="error_widget_wrapper",m.className="error_widget "+l.className,l.displayText.forEach(function(M,C){m.appendChild(E.createTextNode(M)),C<l.displayText.length-1&&m.appendChild(E.createElement("br"))}),m.appendChild(E.createElement("div"));var b=function(M,C,S){if(C===0&&(S==="esc"||S==="return"))return v.destroy(),{command:"null"}};v.destroy=function(){i.$mouseHandler.isMousePressed||(i.keyBinding.removeKeyboardHandler(b),n.widgetManager.removeLineWidget(v),i.off("changeSelection",v.destroy),i.off("changeSession",v.destroy),i.off("mouseup",v.destroy),i.off("change",v.destroy))},i.keyBinding.addKeyboardHandler(b),i.on("changeSelection",v.destroy),i.on("changeSession",v.destroy),i.on("mouseup",v.destroy),i.on("change",v.destroy),i.session.widgetManager.addLineWidget(v),v.el.onmousedown=i.focus.bind(i),i.renderer.scrollCursorIntoView(null,.5,{bottom:v.el.offsetHeight})},E.importCssString(`
953
+ `),w||(C.start.column=0,C.end.column=u[u.length-1].length),this.selection.setRange(C)}else{M.forEach(function(_){g.substractPoint(_.cursor)});var p=0,x=1/0,T=d.map(function(_){var I=_.cursor,O=m.getLine(I.row),z=O.substr(I.column).search(/\S/g);return z==-1&&(z=0),I.column>p&&(p=I.column),z<x&&(x=z),z});d.forEach(function(_,I){var O=_.cursor,z=p-O.column,D=T[I]-x;z>D?m.insert(O,i.stringRepeat(" ",z-D)):m.remove(new A(O.row,O.column,O.row,O.column-z+D)),_.start.column=_.end.column=p,_.start.row=_.end.row=O.row,_.cursor=_.end}),g.fromOrientedRange(d[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(m,g){var d=!0,b=!0,M,C,S;return m.map(function(u){var p=u.match(/(\s*)(.*?)(\s*)([=:].*)/);return p?M==null?(M=p[1].length,C=p[2].length,S=p[3].length,p):(M+C+S!=p[1].length+p[2].length+p[3].length&&(b=!1),M!=p[1].length&&(d=!1),M>p[1].length&&(M=p[1].length),C<p[2].length&&(C=p[2].length),S>p[3].length&&(S=p[3].length),p):[u]}).map(g?w:d?b?y:w:f);function R(u){return i.stringRepeat(" ",u)}function w(u){return u[2]?R(M)+u[2]+R(C-u[2].length+S)+u[4].replace(/^([=:])\s+/,"$1 "):u[0]}function y(u){return u[2]?R(M+C-u[2].length)+u[2]+R(S)+u[4].replace(/^([=:])\s+/,"$1 "):u[0]}function f(u){return u[2]?R(M)+u[2]+R(S)+u[4].replace(/^([=:])\s+/,"$1 "):u[0]}}}).call(s.prototype);function l(m,g){return m.row==g.row&&m.column==g.column}L.onSessionChange=function(m){var g=m.session;g&&!g.multiSelect&&(g.$selectionMarkers=[],g.selection.$initRangeList(),g.multiSelect=g.selection),this.multiSelect=g&&g.multiSelect;var d=m.oldSession;d&&(d.multiSelect.off("addRange",this.$onAddRange),d.multiSelect.off("removeRange",this.$onRemoveRange),d.multiSelect.off("multiSelect",this.$onMultiSelect),d.multiSelect.off("singleSelect",this.$onSingleSelect),d.multiSelect.lead.off("change",this.$checkMultiselectChange),d.multiSelect.anchor.off("change",this.$checkMultiselectChange)),g&&(g.multiSelect.on("addRange",this.$onAddRange),g.multiSelect.on("removeRange",this.$onRemoveRange),g.multiSelect.on("multiSelect",this.$onMultiSelect),g.multiSelect.on("singleSelect",this.$onSingleSelect),g.multiSelect.lead.on("change",this.$checkMultiselectChange),g.multiSelect.anchor.on("change",this.$checkMultiselectChange)),g&&this.inMultiSelectMode!=g.selection.inMultiSelectMode&&(g.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function h(m){m.$multiselectOnSessionChange||(m.$onAddRange=m.$onAddRange.bind(m),m.$onRemoveRange=m.$onRemoveRange.bind(m),m.$onMultiSelect=m.$onMultiSelect.bind(m),m.$onSingleSelect=m.$onSingleSelect.bind(m),m.$multiselectOnSessionChange=L.onSessionChange.bind(m),m.$checkMultiselectChange=m.$checkMultiselectChange.bind(m),m.$multiselectOnSessionChange(m),m.on("changeSession",m.$multiselectOnSessionChange),m.on("mousedown",a),m.commands.addCommands(o.defaultCommands),v(m))}function v(m){if(!m.textInput)return;var g=m.textInput.getElement(),d=!1;c.addListener(g,"keydown",function(M){var C=M.keyCode==18&&!(M.ctrlKey||M.shiftKey||M.metaKey);m.$blockSelectEnabled&&C?d||(m.renderer.setMouseCursor("crosshair"),d=!0):d&&b()},m),c.addListener(g,"keyup",b,m),c.addListener(g,"blur",b,m);function b(M){d&&(m.renderer.setMouseCursor(""),d=!1)}}L.MultiSelect=h,k("./config").defineOptions(s.prototype,"editor",{enableMultiselect:{set:function(m){h(this),m?this.on("mousedown",a):this.off("mousedown",a)},value:!0},enableBlockSelect:{set:function(m){this.$blockSelectEnabled=m},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(k,L,H){var E=k("../../range").Range,A=L.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function($,a,c){var i=$.getLine(c);return this.foldingStartMarker.test(i)?"start":a=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(i)?"end":""},this.getFoldWidgetRange=function($,a,c){return null},this.indentationBlock=function($,a,c){var i=/\S/,o=$.getLine(a),n=o.search(i);if(n!=-1){for(var t=c||o.length,e=$.getLength(),r=a,s=a;++a<e;){var l=$.getLine(a).search(i);if(l!=-1){if(l<=n){var h=$.getTokenAt(a,0);if(!h||h.type!=="string")break}s=a}}if(s>r){var v=$.getLine(s).length;return new E(r,t,s,v)}}},this.openingBracketBlock=function($,a,c,i,o){var n={row:c,column:i+1},t=$.$findClosingBracket(a,n,o);if(t){var e=$.foldWidgets[t.row];return e==null&&(e=$.getFoldWidget(t.row)),e=="start"&&t.row>n.row&&(t.row--,t.column=$.getLine(t.row).length),E.fromPoints(n,t)}},this.closingBracketBlock=function($,a,c,i,o){var n={row:c,column:i},t=$.$findOpeningBracket(a,n);if(t)return t.column++,n.column--,E.fromPoints(t,n)}}).call(A.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(k,L,H){var E=k("../lib/dom"),A=k("../range").Range,$=k("../config").nls;function a(i,o,n){for(var t=0,e=i.length-1;t<=e;){var r=t+e>>1,s=n(o,i[r]);if(s>0)t=r+1;else if(s<0)e=r-1;else return r}return-(t+1)}function c(i,o,n){var t=i.getAnnotations().sort(A.comparePoints);if(t.length){var e=a(t,{row:o,column:-1},A.comparePoints);e<0&&(e=-e-1),e>=t.length?e=n>0?0:t.length-1:e===0&&n<0&&(e=t.length-1);var r=t[e];if(!(!r||!n)){if(r.row===o){do r=t[e+=n];while(r&&r.row===o);if(!r)return t.slice()}var s=[];o=r.row;do s[n<0?"unshift":"push"](r),r=t[e+=n];while(r&&r.row==o);return s.length&&s}}}L.showErrorMarker=function(i,o){var n=i.session,t=i.getCursorPosition(),e=t.row,r=n.widgetManager.getWidgetsAtRow(e).filter(function(M){return M.type=="errorMarker"})[0];r?r.destroy():e-=o;var s=c(n,e,o),l;if(s){var h=s[0];t.column=(h.pos&&typeof h.column!="number"?h.pos.sc:h.column)||0,t.row=h.row,l=i.renderer.$gutterLayer.$annotations[t.row]}else{if(r)return;l={displayText:[$("error-marker.good-state","Looks good!")],className:"ace_ok"}}i.session.unfold(t.row),i.selection.moveToPosition(t);var v={row:t.row,fixedWidth:!0,coverGutter:!0,el:E.createElement("div"),type:"errorMarker"},m=v.el.appendChild(E.createElement("div")),g=v.el.appendChild(E.createElement("div"));g.className="error_widget_arrow "+l.className;var d=i.renderer.$cursorLayer.getPixelPosition(t).left;g.style.left=d+i.renderer.gutterWidth-5+"px",v.el.className="error_widget_wrapper",m.className="error_widget "+l.className,l.displayText.forEach(function(M,C){m.appendChild(E.createTextNode(M)),C<l.displayText.length-1&&m.appendChild(E.createElement("br"))}),m.appendChild(E.createElement("div"));var b=function(M,C,S){if(C===0&&(S==="esc"||S==="return"))return v.destroy(),{command:"null"}};v.destroy=function(){i.$mouseHandler.isMousePressed||(i.keyBinding.removeKeyboardHandler(b),n.widgetManager.removeLineWidget(v),i.off("changeSelection",v.destroy),i.off("changeSession",v.destroy),i.off("mouseup",v.destroy),i.off("change",v.destroy))},i.keyBinding.addKeyboardHandler(b),i.on("changeSelection",v.destroy),i.on("changeSession",v.destroy),i.on("mouseup",v.destroy),i.on("change",v.destroy),i.session.widgetManager.addLineWidget(v),v.el.onmousedown=i.focus.bind(i),i.renderer.scrollCursorIntoView(null,.5,{bottom:v.el.offsetHeight})},E.importCssString(`
954
954
  .error_widget_wrapper {
955
955
  background: inherit;
956
956
  color: inherit;
@@ -983,7 +983,7 @@
983
983
  border-left-color: transparent!important;
984
984
  top: -5px;
985
985
  }
986
- `,"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(k,x,H){k("./loader_build")(x);var E=k("./lib/dom"),A=k("./range").Range,$=k("./editor").Editor,a=k("./edit_session").EditSession,c=k("./undomanager").UndoManager,i=k("./virtual_renderer").VirtualRenderer;k("./worker/worker_client"),k("./keyboard/hash_handler"),k("./placeholder"),k("./multi_select"),k("./mode/folding/fold_mode"),k("./theme/textmate"),k("./ext/error_marker"),x.config=k("./config"),x.edit=function(n,t){if(typeof n=="string"){var e=n;if(n=document.getElementById(e),!n)throw new Error("ace.edit can't find div #"+e)}if(n&&n.env&&n.env.editor instanceof $)return n.env.editor;var r="";if(n&&/input|textarea/i.test(n.tagName)){var s=n;r=s.value,n=E.createElement("pre"),s.parentNode.replaceChild(n,s)}else n&&(r=n.textContent,n.innerHTML="");var l=x.createEditSession(r),h=new $(new i(n),l,t),v={document:l,editor:h,onResize:h.resize.bind(h,null)};return s&&(v.textarea=s),h.on("destroy",function(){v.editor.container.env=null}),h.container.env=h.env=v,h},x.createEditSession=function(n,t){var e=new a(n,t);return e.setUndoManager(new c),e},x.Range=A,x.Editor=$,x.EditSession=a,x.UndoManager=c,x.VirtualRenderer=i;var o=x.config.version;x.version=o}),function(){ace.require(["ace/ace"],function(k){k&&(k.config.init(!0),k.define=ace.define);var x=function(){return this}();!x&&typeof window<"u"&&(x=window),!x&&typeof self<"u"&&(x=self),x.ace||(x.ace=k);for(var H in k)k.hasOwnProperty(H)&&(x.ace[H]=k[H]);x.ace.default=x.ace,W&&(W.exports=x.ace)})}()}(ae)),ae.exports}var xe=Le();const ke=Me(xe);var ge=function(){if(typeof Map<"u")return Map;function W(U,k){var x=-1;return U.some(function(H,E){return H[0]===k?(x=E,!0):!1}),x}return function(){function U(){this.__entries__=[]}return Object.defineProperty(U.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),U.prototype.get=function(k){var x=W(this.__entries__,k),H=this.__entries__[x];return H&&H[1]},U.prototype.set=function(k,x){var H=W(this.__entries__,k);~H?this.__entries__[H][1]=x:this.__entries__.push([k,x])},U.prototype.delete=function(k){var x=this.__entries__,H=W(x,k);~H&&x.splice(H,1)},U.prototype.has=function(k){return!!~W(this.__entries__,k)},U.prototype.clear=function(){this.__entries__.splice(0)},U.prototype.forEach=function(k,x){x===void 0&&(x=null);for(var H=0,E=this.__entries__;H<E.length;H++){var A=E[H];k.call(x,A[1],A[0])}},U}()}(),le=typeof window<"u"&&typeof document<"u"&&window.document===document,ne=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Ee=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ne):function(W){return setTimeout(function(){return W(Date.now())},1e3/60)}}(),Te=2;function _e(W,U){var k=!1,x=!1,H=0;function E(){k&&(k=!1,W()),x&&$()}function A(){Ee(E)}function $(){var a=Date.now();if(k){if(a-H<Te)return;x=!0}else k=!0,x=!1,setTimeout(A,U);H=a}return $}var Re=20,Ie=["top","right","bottom","left","width","height","size","weight"],Oe=typeof MutationObserver<"u",De=function(){function W(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=_e(this.refresh.bind(this),Re)}return W.prototype.addObserver=function(U){~this.observers_.indexOf(U)||this.observers_.push(U),this.connected_||this.connect_()},W.prototype.removeObserver=function(U){var k=this.observers_,x=k.indexOf(U);~x&&k.splice(x,1),!k.length&&this.connected_&&this.disconnect_()},W.prototype.refresh=function(){var U=this.updateObservers_();U&&this.refresh()},W.prototype.updateObservers_=function(){var U=this.observers_.filter(function(k){return k.gatherActive(),k.hasActive()});return U.forEach(function(k){return k.broadcastActive()}),U.length>0},W.prototype.connect_=function(){!le||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Oe?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},W.prototype.disconnect_=function(){!le||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},W.prototype.onTransitionEnd_=function(U){var k=U.propertyName,x=k===void 0?"":k,H=Ie.some(function(E){return!!~x.indexOf(E)});H&&this.refresh()},W.getInstance=function(){return this.instance_||(this.instance_=new W),this.instance_},W.instance_=null,W}(),pe=function(W,U){for(var k=0,x=Object.keys(U);k<x.length;k++){var H=x[k];Object.defineProperty(W,H,{value:U[H],enumerable:!1,writable:!1,configurable:!0})}return W},te=function(W){var U=W&&W.ownerDocument&&W.ownerDocument.defaultView;return U||ne},me=oe(0,0,0,0);function re(W){return parseFloat(W)||0}function ve(W){for(var U=[],k=1;k<arguments.length;k++)U[k-1]=arguments[k];return U.reduce(function(x,H){var E=W["border-"+H+"-width"];return x+re(E)},0)}function Ne(W){for(var U=["top","right","bottom","left"],k={},x=0,H=U;x<H.length;x++){var E=H[x],A=W["padding-"+E];k[E]=re(A)}return k}function Fe(W){var U=W.getBBox();return oe(0,0,U.width,U.height)}function We(W){var U=W.clientWidth,k=W.clientHeight;if(!U&&!k)return me;var x=te(W).getComputedStyle(W),H=Ne(x),E=H.left+H.right,A=H.top+H.bottom,$=re(x.width),a=re(x.height);if(x.boxSizing==="border-box"&&(Math.round($+E)!==U&&($-=ve(x,"left","right")+E),Math.round(a+A)!==k&&(a-=ve(x,"top","bottom")+A)),!He(W)){var c=Math.round($+E)-U,i=Math.round(a+A)-k;Math.abs(c)!==1&&($-=c),Math.abs(i)!==1&&(a-=i)}return oe(H.left,H.top,$,a)}var Be=function(){return typeof SVGGraphicsElement<"u"?function(W){return W instanceof te(W).SVGGraphicsElement}:function(W){return W instanceof te(W).SVGElement&&typeof W.getBBox=="function"}}();function He(W){return W===te(W).document.documentElement}function ze(W){return le?Be(W)?Fe(W):We(W):me}function Pe(W){var U=W.x,k=W.y,x=W.width,H=W.height,E=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,A=Object.create(E.prototype);return pe(A,{x:U,y:k,width:x,height:H,top:k,right:U+x,bottom:H+k,left:U}),A}function oe(W,U,k,x){return{x:W,y:U,width:k,height:x}}var Ue=function(){function W(U){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=oe(0,0,0,0),this.target=U}return W.prototype.isActive=function(){var U=ze(this.target);return this.contentRect_=U,U.width!==this.broadcastWidth||U.height!==this.broadcastHeight},W.prototype.broadcastRect=function(){var U=this.contentRect_;return this.broadcastWidth=U.width,this.broadcastHeight=U.height,U},W}(),Ve=function(){function W(U,k){var x=Pe(k);pe(this,{target:U,contentRect:x})}return W}(),je=function(){function W(U,k,x){if(this.activeObservations_=[],this.observations_=new ge,typeof U!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=U,this.controller_=k,this.callbackCtx_=x}return W.prototype.observe=function(U){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(U instanceof te(U).Element))throw new TypeError('parameter 1 is not of type "Element".');var k=this.observations_;k.has(U)||(k.set(U,new Ue(U)),this.controller_.addObserver(this),this.controller_.refresh())}},W.prototype.unobserve=function(U){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(U instanceof te(U).Element))throw new TypeError('parameter 1 is not of type "Element".');var k=this.observations_;k.has(U)&&(k.delete(U),k.size||this.controller_.removeObserver(this))}},W.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},W.prototype.gatherActive=function(){var U=this;this.clearActive(),this.observations_.forEach(function(k){k.isActive()&&U.activeObservations_.push(k)})},W.prototype.broadcastActive=function(){if(this.hasActive()){var U=this.callbackCtx_,k=this.activeObservations_.map(function(x){return new Ve(x.target,x.broadcastRect())});this.callback_.call(U,k,U),this.clearActive()}},W.prototype.clearActive=function(){this.activeObservations_.splice(0)},W.prototype.hasActive=function(){return this.activeObservations_.length>0},W}(),ye=typeof WeakMap<"u"?new WeakMap:new ge,we=function(){function W(U){if(!(this instanceof W))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var k=De.getInstance(),x=new je(U,k,this);ye.set(this,x)}return W}();["observe","unobserve","disconnect"].forEach(function(W){we.prototype[W]=function(){var U;return(U=ye.get(this))[W].apply(U,arguments)}});var Ge=function(){return typeof ne.ResizeObserver<"u"?ne.ResizeObserver:we}();const be=["blur","input","change","changeSelectionStyle","changeSession","copy","focus","paste"],Ke=Y.defineComponent({name:"VAceEditor",props:{value:{type:String,required:!0},lang:{type:String,default:"text"},theme:{type:String,default:"chrome"},options:Object,placeholder:String,readonly:Boolean,wrap:Boolean,printMargin:{type:[Boolean,Number],default:!0},minLines:Number,maxLines:Number},emits:["update:value","init",...be],render(){return Y.h("div")},mounted(){const W=this._editor=Y.markRaw(ke.edit(this.$el,{placeholder:this.placeholder,readOnly:this.readonly,value:this.value,mode:"ace/mode/"+this.lang,theme:"ace/theme/"+this.theme,wrap:this.wrap,printMargin:this.printMargin,useWorker:!1,minLines:this.minLines,maxLines:this.maxLines,...this.options}));this._contentBackup=this.value,this._isSettingContent=!1,W.on("change",()=>{if(this._isSettingContent)return;const U=W.getValue();this._contentBackup=U,this.$emit("update:value",U)}),be.forEach(U=>{const k="on"+Y.capitalize(U);typeof this.$.vnode.props[k]=="function"&&W.on(U,this.$emit.bind(this,U))}),this._ro=new Ge(()=>W.resize()),this._ro.observe(this.$el),this.$emit("init",W)},beforeUnmount(){var W,U;(W=this._ro)===null||W===void 0||W.disconnect(),(U=this._editor)===null||U===void 0||U.destroy()},methods:{focus(){this._editor.focus()},blur(){this._editor.blur()},selectAll(){this._editor.selectAll()},getAceInstance(){return this._editor}},watch:{value(W){if(this._contentBackup!==W){try{this._isSettingContent=!0,this._editor.setValue(W,1)}finally{this._isSettingContent=!1}this._contentBackup=W}},theme(W){this._editor.setTheme("ace/theme/"+W)},options(W){this._editor.setOptions(W)},readonly(W){this._editor.setReadOnly(W)},placeholder(W){this._editor.setOption("placeholder",W)},wrap(W){this._editor.setWrapBehavioursEnabled(W)},printMargin(W){this._editor.setOption("printMargin",W)},lang(W){this._editor.setOption("mode","ace/mode/"+W)},minLines(W){this._editor.setOption("minLines",W)},maxLines(W){this._editor.setOption("maxLines",W)}}});var ce={exports:{}},$e;function Ye(){return $e||($e=1,function(W,U){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(k,x,H){var E=k("../lib/oop"),A=k("./text_highlight_rules").TextHighlightRules,$=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"}]}};E.inherits($,A),x.JsonHighlightRules=$}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(k,x,H){var E=k("../range").Range,A=function(){};(function(){this.checkOutdent=function($,a){return/^\s+$/.test($)?/^\s*\}/.test(a):!1},this.autoOutdent=function($,a){var c=$.getLine(a),i=c.match(/^(\s*\})/);if(!i)return 0;var o=i[1].length,n=$.findMatchingBracket({row:a,column:o});if(!n||n.row==a)return 0;var t=this.$getIndent($.getLine(n.row));$.replace(new E(a,0,a,o-1),t)},this.$getIndent=function($){return $.match(/^\s*/)[0]}}).call(A.prototype),x.MatchingBraceOutdent=A}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(k,x,H){var E=k("../../lib/oop"),A=k("../../range").Range,$=k("./fold_mode").FoldMode,a=x.FoldMode=function(c){c&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+c.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+c.end)))};E.inherits(a,$),(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(c,i,o){var n=c.getLine(o);if(this.singleLineBlockCommentRe.test(n)&&!this.startRegionRe.test(n)&&!this.tripleStarBlockCommentRe.test(n))return"";var t=this._getFoldWidgetBase(c,i,o);return!t&&this.startRegionRe.test(n)?"start":t},this.getFoldWidgetRange=function(c,i,o,n){var t=c.getLine(o);if(this.startRegionRe.test(t))return this.getCommentRegionBlock(c,t,o);var s=t.match(this.foldingStartMarker);if(s){var e=s.index;if(s[1])return this.openingBracketBlock(c,s[1],o,e);var r=c.getCommentFoldRange(o,e+s[0].length,1);return r&&!r.isMultiLine()&&(n?r=this.getSectionRange(c,o):i!="all"&&(r=null)),r}if(i!=="markbegin"){var s=t.match(this.foldingStopMarker);if(s){var e=s.index+s[0].length;return s[1]?this.closingBracketBlock(c,s[1],o,e):c.getCommentFoldRange(o,e,-1)}}},this.getSectionRange=function(c,i){var o=c.getLine(i),n=o.search(/\S/),t=i,e=o.length;i=i+1;for(var r=i,s=c.getLength();++i<s;){o=c.getLine(i);var l=o.search(/\S/);if(l!==-1){if(n>l)break;var h=this.getFoldWidgetRange(c,"all",i);if(h){if(h.start.row<=t)break;if(h.isMultiLine())i=h.end.row;else if(n==l)break}r=i}}return new A(t,e,r,c.getLine(r).length)},this.getCommentRegionBlock=function(c,i,o){for(var n=i.search(/\s*$/),t=c.getLength(),e=o,r=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,s=1;++o<t;){i=c.getLine(o);var l=r.exec(i);if(l&&(l[1]?s--:s++,!s))break}var h=o;if(h>e)return new A(e,n,h,i.length)}}).call(a.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(k,x,H){var E=k("../lib/oop"),A=k("./text").Mode,$=k("./json_highlight_rules").JsonHighlightRules,a=k("./matching_brace_outdent").MatchingBraceOutdent,c=k("./folding/cstyle").FoldMode,i=k("../worker/worker_client").WorkerClient,o=function(){this.HighlightRules=$,this.$outdent=new a,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new c};E.inherits(o,A),(function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(n,t,e){var r=this.$getIndent(t);if(n=="start"){var s=t.match(/^.*[\{\(\[]\s*$/);s&&(r+=e)}return r},this.checkOutdent=function(n,t,e){return this.$outdent.checkOutdent(t,e)},this.autoOutdent=function(n,t,e){this.$outdent.autoOutdent(t,e)},this.createWorker=function(n){var t=new i(["ace"],"ace/mode/json_worker","JsonWorker");return t.attachToDocument(n.getDocument()),t.on("annotate",function(e){n.setAnnotations(e.data)}),t.on("terminate",function(){n.clearAnnotations()}),t},this.$id="ace/mode/json"}).call(o.prototype),x.Mode=o}),function(){ace.require(["ace/mode/json"],function(k){W&&(W.exports=k)})}()}(ce)),ce.exports}Ye();var he={exports:{}},Ce;function Qe(){return Ce||(Ce=1,function(W,U){ace.define("ace/theme/chrome-css",["require","exports","module"],function(k,x,H){H.exports=`.ace-chrome .ace_gutter {
986
+ `,"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(k,L,H){k("./loader_build")(L);var E=k("./lib/dom"),A=k("./range").Range,$=k("./editor").Editor,a=k("./edit_session").EditSession,c=k("./undomanager").UndoManager,i=k("./virtual_renderer").VirtualRenderer;k("./worker/worker_client"),k("./keyboard/hash_handler"),k("./placeholder"),k("./multi_select"),k("./mode/folding/fold_mode"),k("./theme/textmate"),k("./ext/error_marker"),L.config=k("./config"),L.edit=function(n,t){if(typeof n=="string"){var e=n;if(n=document.getElementById(e),!n)throw new Error("ace.edit can't find div #"+e)}if(n&&n.env&&n.env.editor instanceof $)return n.env.editor;var r="";if(n&&/input|textarea/i.test(n.tagName)){var s=n;r=s.value,n=E.createElement("pre"),s.parentNode.replaceChild(n,s)}else n&&(r=n.textContent,n.innerHTML="");var l=L.createEditSession(r),h=new $(new i(n),l,t),v={document:l,editor:h,onResize:h.resize.bind(h,null)};return s&&(v.textarea=s),h.on("destroy",function(){v.editor.container.env=null}),h.container.env=h.env=v,h},L.createEditSession=function(n,t){var e=new a(n,t);return e.setUndoManager(new c),e},L.Range=A,L.Editor=$,L.EditSession=a,L.UndoManager=c,L.VirtualRenderer=i;var o=L.config.version;L.version=o}),function(){ace.require(["ace/ace"],function(k){k&&(k.config.init(!0),k.define=ace.define);var L=function(){return this}();!L&&typeof window<"u"&&(L=window),!L&&typeof self<"u"&&(L=self),L.ace||(L.ace=k);for(var H in k)k.hasOwnProperty(H)&&(L.ace[H]=k[H]);L.ace.default=L.ace,W&&(W.exports=L.ace)})}()}(ae)),ae.exports}var Le=xe();const ke=Me(Le);var ge=function(){if(typeof Map<"u")return Map;function W(U,k){var L=-1;return U.some(function(H,E){return H[0]===k?(L=E,!0):!1}),L}return function(){function U(){this.__entries__=[]}return Object.defineProperty(U.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),U.prototype.get=function(k){var L=W(this.__entries__,k),H=this.__entries__[L];return H&&H[1]},U.prototype.set=function(k,L){var H=W(this.__entries__,k);~H?this.__entries__[H][1]=L:this.__entries__.push([k,L])},U.prototype.delete=function(k){var L=this.__entries__,H=W(L,k);~H&&L.splice(H,1)},U.prototype.has=function(k){return!!~W(this.__entries__,k)},U.prototype.clear=function(){this.__entries__.splice(0)},U.prototype.forEach=function(k,L){L===void 0&&(L=null);for(var H=0,E=this.__entries__;H<E.length;H++){var A=E[H];k.call(L,A[1],A[0])}},U}()}(),le=typeof window<"u"&&typeof document<"u"&&window.document===document,ne=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Ee=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ne):function(W){return setTimeout(function(){return W(Date.now())},1e3/60)}}(),Te=2;function _e(W,U){var k=!1,L=!1,H=0;function E(){k&&(k=!1,W()),L&&$()}function A(){Ee(E)}function $(){var a=Date.now();if(k){if(a-H<Te)return;L=!0}else k=!0,L=!1,setTimeout(A,U);H=a}return $}var Re=20,Ie=["top","right","bottom","left","width","height","size","weight"],Oe=typeof MutationObserver<"u",De=function(){function W(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=_e(this.refresh.bind(this),Re)}return W.prototype.addObserver=function(U){~this.observers_.indexOf(U)||this.observers_.push(U),this.connected_||this.connect_()},W.prototype.removeObserver=function(U){var k=this.observers_,L=k.indexOf(U);~L&&k.splice(L,1),!k.length&&this.connected_&&this.disconnect_()},W.prototype.refresh=function(){var U=this.updateObservers_();U&&this.refresh()},W.prototype.updateObservers_=function(){var U=this.observers_.filter(function(k){return k.gatherActive(),k.hasActive()});return U.forEach(function(k){return k.broadcastActive()}),U.length>0},W.prototype.connect_=function(){!le||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Oe?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},W.prototype.disconnect_=function(){!le||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},W.prototype.onTransitionEnd_=function(U){var k=U.propertyName,L=k===void 0?"":k,H=Ie.some(function(E){return!!~L.indexOf(E)});H&&this.refresh()},W.getInstance=function(){return this.instance_||(this.instance_=new W),this.instance_},W.instance_=null,W}(),pe=function(W,U){for(var k=0,L=Object.keys(U);k<L.length;k++){var H=L[k];Object.defineProperty(W,H,{value:U[H],enumerable:!1,writable:!1,configurable:!0})}return W},te=function(W){var U=W&&W.ownerDocument&&W.ownerDocument.defaultView;return U||ne},me=oe(0,0,0,0);function re(W){return parseFloat(W)||0}function ve(W){for(var U=[],k=1;k<arguments.length;k++)U[k-1]=arguments[k];return U.reduce(function(L,H){var E=W["border-"+H+"-width"];return L+re(E)},0)}function Ne(W){for(var U=["top","right","bottom","left"],k={},L=0,H=U;L<H.length;L++){var E=H[L],A=W["padding-"+E];k[E]=re(A)}return k}function Fe(W){var U=W.getBBox();return oe(0,0,U.width,U.height)}function We(W){var U=W.clientWidth,k=W.clientHeight;if(!U&&!k)return me;var L=te(W).getComputedStyle(W),H=Ne(L),E=H.left+H.right,A=H.top+H.bottom,$=re(L.width),a=re(L.height);if(L.boxSizing==="border-box"&&(Math.round($+E)!==U&&($-=ve(L,"left","right")+E),Math.round(a+A)!==k&&(a-=ve(L,"top","bottom")+A)),!He(W)){var c=Math.round($+E)-U,i=Math.round(a+A)-k;Math.abs(c)!==1&&($-=c),Math.abs(i)!==1&&(a-=i)}return oe(H.left,H.top,$,a)}var Be=function(){return typeof SVGGraphicsElement<"u"?function(W){return W instanceof te(W).SVGGraphicsElement}:function(W){return W instanceof te(W).SVGElement&&typeof W.getBBox=="function"}}();function He(W){return W===te(W).document.documentElement}function ze(W){return le?Be(W)?Fe(W):We(W):me}function Pe(W){var U=W.x,k=W.y,L=W.width,H=W.height,E=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,A=Object.create(E.prototype);return pe(A,{x:U,y:k,width:L,height:H,top:k,right:U+L,bottom:H+k,left:U}),A}function oe(W,U,k,L){return{x:W,y:U,width:k,height:L}}var Ue=function(){function W(U){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=oe(0,0,0,0),this.target=U}return W.prototype.isActive=function(){var U=ze(this.target);return this.contentRect_=U,U.width!==this.broadcastWidth||U.height!==this.broadcastHeight},W.prototype.broadcastRect=function(){var U=this.contentRect_;return this.broadcastWidth=U.width,this.broadcastHeight=U.height,U},W}(),Ve=function(){function W(U,k){var L=Pe(k);pe(this,{target:U,contentRect:L})}return W}(),je=function(){function W(U,k,L){if(this.activeObservations_=[],this.observations_=new ge,typeof U!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=U,this.controller_=k,this.callbackCtx_=L}return W.prototype.observe=function(U){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(U instanceof te(U).Element))throw new TypeError('parameter 1 is not of type "Element".');var k=this.observations_;k.has(U)||(k.set(U,new Ue(U)),this.controller_.addObserver(this),this.controller_.refresh())}},W.prototype.unobserve=function(U){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(U instanceof te(U).Element))throw new TypeError('parameter 1 is not of type "Element".');var k=this.observations_;k.has(U)&&(k.delete(U),k.size||this.controller_.removeObserver(this))}},W.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},W.prototype.gatherActive=function(){var U=this;this.clearActive(),this.observations_.forEach(function(k){k.isActive()&&U.activeObservations_.push(k)})},W.prototype.broadcastActive=function(){if(this.hasActive()){var U=this.callbackCtx_,k=this.activeObservations_.map(function(L){return new Ve(L.target,L.broadcastRect())});this.callback_.call(U,k,U),this.clearActive()}},W.prototype.clearActive=function(){this.activeObservations_.splice(0)},W.prototype.hasActive=function(){return this.activeObservations_.length>0},W}(),ye=typeof WeakMap<"u"?new WeakMap:new ge,we=function(){function W(U){if(!(this instanceof W))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var k=De.getInstance(),L=new je(U,k,this);ye.set(this,L)}return W}();["observe","unobserve","disconnect"].forEach(function(W){we.prototype[W]=function(){var U;return(U=ye.get(this))[W].apply(U,arguments)}});var Ge=function(){return typeof ne.ResizeObserver<"u"?ne.ResizeObserver:we}();const be=["blur","input","change","changeSelectionStyle","changeSession","copy","focus","paste"],Ke=Y.defineComponent({name:"VAceEditor",props:{value:{type:String,required:!0},lang:{type:String,default:"text"},theme:{type:String,default:"chrome"},options:Object,placeholder:String,readonly:Boolean,wrap:Boolean,printMargin:{type:[Boolean,Number],default:!0},minLines:Number,maxLines:Number},emits:["update:value","init",...be],render(){return Y.h("div")},mounted(){const W=this._editor=Y.markRaw(ke.edit(this.$el,{placeholder:this.placeholder,readOnly:this.readonly,value:this.value,mode:"ace/mode/"+this.lang,theme:"ace/theme/"+this.theme,wrap:this.wrap,printMargin:this.printMargin,useWorker:!1,minLines:this.minLines,maxLines:this.maxLines,...this.options}));this._contentBackup=this.value,this._isSettingContent=!1,W.on("change",()=>{if(this._isSettingContent)return;const U=W.getValue();this._contentBackup=U,this.$emit("update:value",U)}),be.forEach(U=>{const k="on"+Y.capitalize(U);typeof this.$.vnode.props[k]=="function"&&W.on(U,this.$emit.bind(this,U))}),this._ro=new Ge(()=>W.resize()),this._ro.observe(this.$el),this.$emit("init",W)},beforeUnmount(){var W,U;(W=this._ro)===null||W===void 0||W.disconnect(),(U=this._editor)===null||U===void 0||U.destroy()},methods:{focus(){this._editor.focus()},blur(){this._editor.blur()},selectAll(){this._editor.selectAll()},getAceInstance(){return this._editor}},watch:{value(W){if(this._contentBackup!==W){try{this._isSettingContent=!0,this._editor.setValue(W,1)}finally{this._isSettingContent=!1}this._contentBackup=W}},theme(W){this._editor.setTheme("ace/theme/"+W)},options(W){this._editor.setOptions(W)},readonly(W){this._editor.setReadOnly(W)},placeholder(W){this._editor.setOption("placeholder",W)},wrap(W){this._editor.setWrapBehavioursEnabled(W)},printMargin(W){this._editor.setOption("printMargin",W)},lang(W){this._editor.setOption("mode","ace/mode/"+W)},minLines(W){this._editor.setOption("minLines",W)},maxLines(W){this._editor.setOption("maxLines",W)}}});var ce={exports:{}},$e;function Ye(){return $e||($e=1,function(W,U){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(k,L,H){var E=k("../lib/oop"),A=k("./text_highlight_rules").TextHighlightRules,$=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"}]}};E.inherits($,A),L.JsonHighlightRules=$}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(k,L,H){var E=k("../range").Range,A=function(){};(function(){this.checkOutdent=function($,a){return/^\s+$/.test($)?/^\s*\}/.test(a):!1},this.autoOutdent=function($,a){var c=$.getLine(a),i=c.match(/^(\s*\})/);if(!i)return 0;var o=i[1].length,n=$.findMatchingBracket({row:a,column:o});if(!n||n.row==a)return 0;var t=this.$getIndent($.getLine(n.row));$.replace(new E(a,0,a,o-1),t)},this.$getIndent=function($){return $.match(/^\s*/)[0]}}).call(A.prototype),L.MatchingBraceOutdent=A}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(k,L,H){var E=k("../../lib/oop"),A=k("../../range").Range,$=k("./fold_mode").FoldMode,a=L.FoldMode=function(c){c&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+c.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+c.end)))};E.inherits(a,$),(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(c,i,o){var n=c.getLine(o);if(this.singleLineBlockCommentRe.test(n)&&!this.startRegionRe.test(n)&&!this.tripleStarBlockCommentRe.test(n))return"";var t=this._getFoldWidgetBase(c,i,o);return!t&&this.startRegionRe.test(n)?"start":t},this.getFoldWidgetRange=function(c,i,o,n){var t=c.getLine(o);if(this.startRegionRe.test(t))return this.getCommentRegionBlock(c,t,o);var s=t.match(this.foldingStartMarker);if(s){var e=s.index;if(s[1])return this.openingBracketBlock(c,s[1],o,e);var r=c.getCommentFoldRange(o,e+s[0].length,1);return r&&!r.isMultiLine()&&(n?r=this.getSectionRange(c,o):i!="all"&&(r=null)),r}if(i!=="markbegin"){var s=t.match(this.foldingStopMarker);if(s){var e=s.index+s[0].length;return s[1]?this.closingBracketBlock(c,s[1],o,e):c.getCommentFoldRange(o,e,-1)}}},this.getSectionRange=function(c,i){var o=c.getLine(i),n=o.search(/\S/),t=i,e=o.length;i=i+1;for(var r=i,s=c.getLength();++i<s;){o=c.getLine(i);var l=o.search(/\S/);if(l!==-1){if(n>l)break;var h=this.getFoldWidgetRange(c,"all",i);if(h){if(h.start.row<=t)break;if(h.isMultiLine())i=h.end.row;else if(n==l)break}r=i}}return new A(t,e,r,c.getLine(r).length)},this.getCommentRegionBlock=function(c,i,o){for(var n=i.search(/\s*$/),t=c.getLength(),e=o,r=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,s=1;++o<t;){i=c.getLine(o);var l=r.exec(i);if(l&&(l[1]?s--:s++,!s))break}var h=o;if(h>e)return new A(e,n,h,i.length)}}).call(a.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(k,L,H){var E=k("../lib/oop"),A=k("./text").Mode,$=k("./json_highlight_rules").JsonHighlightRules,a=k("./matching_brace_outdent").MatchingBraceOutdent,c=k("./folding/cstyle").FoldMode,i=k("../worker/worker_client").WorkerClient,o=function(){this.HighlightRules=$,this.$outdent=new a,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new c};E.inherits(o,A),(function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(n,t,e){var r=this.$getIndent(t);if(n=="start"){var s=t.match(/^.*[\{\(\[]\s*$/);s&&(r+=e)}return r},this.checkOutdent=function(n,t,e){return this.$outdent.checkOutdent(t,e)},this.autoOutdent=function(n,t,e){this.$outdent.autoOutdent(t,e)},this.createWorker=function(n){var t=new i(["ace"],"ace/mode/json_worker","JsonWorker");return t.attachToDocument(n.getDocument()),t.on("annotate",function(e){n.setAnnotations(e.data)}),t.on("terminate",function(){n.clearAnnotations()}),t},this.$id="ace/mode/json"}).call(o.prototype),L.Mode=o}),function(){ace.require(["ace/mode/json"],function(k){W&&(W.exports=k)})}()}(ce)),ce.exports}Ye();var he={exports:{}},Ce;function Qe(){return Ce||(Ce=1,function(W,U){ace.define("ace/theme/chrome-css",["require","exports","module"],function(k,L,H){H.exports=`.ace-chrome .ace_gutter {
987
987
  background: #ebebeb;
988
988
  color: #333;
989
989
  overflow : hidden;
@@ -1141,5 +1141,5 @@
1141
1141
  .ace-chrome .ace_indent-guide-active {
1142
1142
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
1143
1143
  }
1144
- `}),ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(k,x,H){x.isDark=!1,x.cssClass="ace-chrome",x.cssText=k("./chrome-css");var E=k("../lib/dom");E.importCssString(x.cssText,x.cssClass,!1)}),function(){ace.require(["ace/theme/chrome"],function(k){W&&(W.exports=k)})}()}(he)),he.exports}Qe();const Se="chrome",Ze=Y.defineComponent({name:"ClFieldEditor",components:{VAceEditor:Ke},inheritAttrs:!1,props:{class:{type:String,default:`ace_editor ace-${Se}`},label:{type:String,default:void 0},initial:{type:String,default:""},lang:{type:String,default:""},rows:{type:Number,default:void 0},required:{type:Boolean,default:!1},help:{type:String,default:void 0},error:{type:String,default:void 0},invalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1}},emits:["change","update:valid","update:modelValue"],data(){return{valid:!0,value:this.initial,invalidMessage:this.error||"Input invalid."}},computed:{uid:function(){return this.$uid},theme:function(){return Se},classes:function(){return this.class+" form-control"+(this.valid?"":" invalid")},options:function(){return{tabSize:2}}},methods:{setValue:function(W){this.$refs.aceEditor._editor?.setValue(W)},click:function(){this.changed()},changed:function(){if(this.valid=!0,this.required&&(this.value??"").trim()==="")this.setInvalid("This field may not be blank.");else if(this.lang==="json")try{JSON.parse(this.value??"{}")}catch(W){W.ignore=!0,this.setInvalid("Please enter valid JSON.")}this.$emit("update:modelValue",this.value),this.$emit("change")},setInvalid:function(W){this.valid=!1,this.invalidMessage=W,this.$emit("update:valid",this.valid)}}}),Xe=(W,U)=>{const k=W.__vccOpts||W;for(const[x,H]of U)k[x]=H;return k},Je=["for"],qe={key:0,class:"required"},et={class:"invalid-feedback"},tt={key:1,class:"valid-feedback"},it={key:2,class:"valid-feedback valid-feedback-none"};function nt(W,U,k,x,H,E){const A=Y.resolveComponent("v-ace-editor");return Y.openBlock(),Y.createElementBlock(Y.Fragment,null,[W.label?(Y.openBlock(),Y.createElementBlock("label",{key:0,for:W.uid,class:"form-label"},[Y.createTextVNode(Y.toDisplayString(W.label),1),W.required?(Y.openBlock(),Y.createElementBlock("span",qe,"*")):Y.createCommentVNode("",!0)],8,Je)):Y.createCommentVNode("",!0),Y.createVNode(A,{id:W.uid,ref:"aceEditor",value:W.value,"onUpdate:value":U[0]||(U[0]=$=>W.value=$),class:Y.normalizeClass(W.classes),disabled:W.disabled,readonly:W.disabled,lang:W.lang,theme:W.theme,options:W.options,"min-lines":W.rows??10,"max-lines":W.rows??25,onClick:W.click,onBlur:W.changed,onChange:W.changed},null,8,["id","value","class","disabled","readonly","lang","theme","options","min-lines","max-lines","onClick","onBlur","onChange"]),Y.createElementVNode("p",et,Y.toDisplayString(W.invalidMessage),1),W.help?(Y.openBlock(),Y.createElementBlock("p",tt,Y.toDisplayString(W.help),1)):(Y.openBlock(),Y.createElementBlock("p",it))],64)}const ie=Xe(Ze,[["render",nt]]);ie.install=W=>{W.component(ie.name??"ClNoName",ie)};const ue={ClFieldEditor:ie};function rt(W){for(const U in ue)W.component(ue[U].name,ue[U])}ee.ClFieldEditor=ie,ee.castlabsUiEditor=rt,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})});
1144
+ `}),ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(k,L,H){L.isDark=!1,L.cssClass="ace-chrome",L.cssText=k("./chrome-css");var E=k("../lib/dom");E.importCssString(L.cssText,L.cssClass,!1)}),function(){ace.require(["ace/theme/chrome"],function(k){W&&(W.exports=k)})}()}(he)),he.exports}Qe();const Se="chrome",Ze=Y.defineComponent({name:"ClFieldEditor",components:{VAceEditor:Ke},inheritAttrs:!1,props:{class:{type:String,default:`ace_editor ace-${Se}`},label:{type:String,default:void 0},initial:{type:String,default:""},lang:{type:String,default:""},rows:{type:Number,default:void 0},required:{type:Boolean,default:!1},help:{type:String,default:void 0},error:{type:String,default:void 0},invalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1}},emits:["change","update:valid","update:modelValue"],data(){return{valid:!0,value:this.initial,invalidMessage:this.error||"Input invalid."}},computed:{uid:function(){return this.$uid},theme:function(){return Se},classes:function(){return this.class+" form-control"+(this.valid?"":" invalid")},options:function(){return{tabSize:2}}},methods:{setValue:function(W){this.$refs.aceEditor._editor?.setValue(W)},click:function(){this.changed()},changed:function(){if(this.valid=!0,this.required&&(this.value??"").trim()==="")this.setInvalid("This field may not be blank.");else if(this.lang==="json")try{JSON.parse(this.value??"{}")}catch(W){W.ignore=!0,this.setInvalid("Please enter valid JSON.")}this.$emit("update:modelValue",this.value),this.$emit("change")},setInvalid:function(W){this.valid=!1,this.invalidMessage=W,this.$emit("update:valid",this.valid)}}}),Xe=(W,U)=>{const k=W.__vccOpts||W;for(const[L,H]of U)k[L]=H;return k},Je=["for"],qe={key:0,class:"required"},et={class:"invalid-feedback"},tt={key:1,class:"valid-feedback"},it={key:2,class:"valid-feedback valid-feedback-none"};function nt(W,U,k,L,H,E){const A=Y.resolveComponent("v-ace-editor");return Y.openBlock(),Y.createElementBlock(Y.Fragment,null,[W.label?(Y.openBlock(),Y.createElementBlock("label",{key:0,for:W.uid,class:"form-label"},[Y.createTextVNode(Y.toDisplayString(W.label),1),W.required?(Y.openBlock(),Y.createElementBlock("span",qe,"*")):Y.createCommentVNode("",!0)],8,Je)):Y.createCommentVNode("",!0),Y.createVNode(A,{id:W.uid,ref:"aceEditor",value:W.value,"onUpdate:value":U[0]||(U[0]=$=>W.value=$),class:Y.normalizeClass(W.classes),disabled:W.disabled,readonly:W.disabled,lang:W.lang,theme:W.theme,options:W.options,"min-lines":W.rows??10,"max-lines":W.rows??25,onClick:W.click,onBlur:W.changed,onChange:W.changed},null,8,["id","value","class","disabled","readonly","lang","theme","options","min-lines","max-lines","onClick","onBlur","onChange"]),Y.createElementVNode("p",et,Y.toDisplayString(W.invalidMessage),1),W.help?(Y.openBlock(),Y.createElementBlock("p",tt,Y.toDisplayString(W.help),1)):(Y.openBlock(),Y.createElementBlock("p",it))],64)}const ie=Xe(Ze,[["render",nt]]);ie.install=W=>{W.component(ie.name??"ClNoName",ie)};const ue={ClFieldEditor:ie};function rt(W){for(const U in ue)W.component(ue[U].name,ue[U])}ee.ClFieldEditor=ie,ee.castlabsUiEditor=rt,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})});
1145
1145
  //# sourceMappingURL=castlabs-ui-editor.umd.js.map