iobroker.javascript 9.0.12 → 9.0.13
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.
- package/README.md +1 -1
- package/admin/assets/{OpenAiDialog-Db5nBWtV.js → OpenAiDialog-BmcYPsVa.js} +1 -1
- package/admin/assets/{ScriptEditor-CuzI8bbK.js → ScriptEditor-BoSBgnK-.js} +1 -1
- package/admin/assets/{ScriptEditorVanillaMonaco-LjlfPO8c.js → ScriptEditorVanillaMonaco-Xge2wqgO.js} +1 -1
- package/admin/assets/{index-DzAZ7TKU.js → index-BMwfsknM.js} +1 -1
- package/admin/assets/index-Br_QjNUk.js +942 -0
- package/admin/assets/{index-ee1BGSYh.js → index-CePzv5-W.js} +5 -5
- package/admin/assets/{index-DoG44L1P.js → index-DZ3lKVw8.js} +1 -1
- package/admin/assets/{index-CpvUlHhu.js → index-DwcZPzOL.js} +4 -4
- package/admin/assets/{index-CtB5rga_.js → index-OIiv3PJA.js} +1 -1
- package/admin/custom/assets/{Components-DJLwk8Py.js → Components-DjQ_LxKw.js} +1 -1
- package/admin/custom/assets/{DefaultPropsProvider-BbFDEnmq.js → DefaultPropsProvider-B8ZCC-c2.js} +1 -1
- package/admin/custom/assets/{DefaultPropsProvider-B6-0SEtV.js → DefaultPropsProvider-DfdXSIBu.js} +1 -7
- package/admin/custom/assets/{FilledInput-CX9v1cwN.js → FilledInput-CSjr0QT8.js} +1 -1
- package/admin/custom/assets/{Tabs-bjxmjZcg.js → Tabs-CiTQkBjL.js} +1 -1
- package/admin/custom/assets/{ThemeProvider-CeD4z8mE.js → ThemeProvider-C50pIiW4.js} +1 -1
- package/admin/custom/assets/{createSvgIcon-DAmSzHRD.js → createSvgIcon-C7qUEvjp.js} +1 -1
- package/admin/custom/assets/createTheme-Bm92JF8u.js +8 -0
- package/admin/custom/assets/defaultTheme-BlO0eCf6.js +1 -0
- package/admin/custom/assets/hostInit-BJ6gSofk.js +1 -1
- package/admin/custom/assets/index-4wMOc304.js +1 -0
- package/admin/custom/assets/{index-CrVgzaLe.js → index-5CTGLw4h.js} +1 -1
- package/admin/custom/assets/index-BHN4DzE4.js +908 -0
- package/admin/custom/assets/{index-BM9YMTul.js → index-BkjEWGjf.js} +1 -1
- package/admin/custom/assets/{index-D-RbixT9.js → index-COcxCdeX.js} +4 -20
- package/admin/custom/assets/{index-DMiiPxNM.js → index-CnpybLRW.js} +1 -1
- package/admin/custom/assets/{index-CznMGPgM.js → index-Db8nkuMR.js} +1 -1
- package/admin/custom/assets/{index-1hRrucfm.js → index-Df6OaCxx.js} +1 -1
- package/admin/custom/assets/{index-EogeheIH.js → index-t-NMdeH5.js} +6 -6
- package/admin/custom/assets/index-u8R8UVCf.js +1393 -0
- package/admin/custom/assets/jsx-runtime-C1csJtRx.js +1 -0
- package/admin/custom/assets/leaflet-src-DpWQqQWv.js +1 -0
- package/admin/custom/assets/useEnhancedEffect-aUb-5tTL.js +1 -0
- package/admin/custom/assets/{useTheme-Y8PztM11.js → useTheme-Cgjfsi-1.js} +1 -1
- package/admin/custom/assets/useTheme-DFGylj2o.js +1 -0
- package/admin/custom/assets/{virtualExposes-BMbgFEvP.js → virtualExposes-C_DtjFte.js} +2 -2
- package/admin/custom/customComponents.js +2 -2
- package/admin/mf-manifest.json +1 -1
- package/admin/remoteEntry.js +2 -2
- package/admin/tab.html +1 -1
- package/io-package.json +2 -2
- package/package.json +1 -1
- package/admin/assets/index-XLsd8FZV.js +0 -942
- package/admin/custom/assets/createTheme-LEFpI6rM.js +0 -16
- package/admin/custom/assets/defaultTheme-2suHr_rQ.js +0 -1
- package/admin/custom/assets/index-BgpTxVrG.js +0 -9
- package/admin/custom/assets/index-CJimub3l.js +0 -1399
- package/admin/custom/assets/index-CPZpQ2Mb.js +0 -916
- package/admin/custom/assets/jsx-runtime-CJ3ByJW3.js +0 -9
- package/admin/custom/assets/leaflet-src-Dnh7srds.js +0 -4
- package/admin/custom/assets/useEnhancedEffect-COBJo-Ex.js +0 -8
- package/admin/custom/assets/useTheme-52mADBCy.js +0 -1
|
@@ -1,1399 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Dx7rDE4p.js","./index-DcK0RDrH.js","./_commonjsHelpers-CE1G-McA.js","./ConfigCustomJavascriptSet__loadShare__react__loadShare__-BNbscXK6.js","./ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-jdUmHa_i.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{C as qe,R as M}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__-BNbscXK6.js";import{a as Qr,c as ke,g as Xr}from"./_commonjsHelpers-CE1G-McA.js";import{C as O}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__-BqzgglHd.js";import{C as X,a as Zr,I as qr,D as Ti}from"./index-EogeheIH.js";import{C as j,A as es,a as _i}from"./ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-DaN0pfsw.js";import{R as ts}from"./ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__-N2_tx_mJ.js";import{F as ns}from"./FilledInput-CX9v1cwN.js";import{b as is}from"./createTheme-LEFpI6rM.js";import{r as rs,l as ss,i as os}from"./ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-jdUmHa_i.js";import{p as Tn}from"./index-DcK0RDrH.js";import{_ as as}from"./preload-helper-BDBacUwf.js";import"./DefaultPropsProvider-BbFDEnmq.js";import"./defaultTheme-2suHr_rQ.js";import"./DefaultPropsProvider-B6-0SEtV.js";import"./jsx-runtime-CJ3ByJW3.js";import"./useEnhancedEffect-COBJo-Ex.js";import"./useTheme-Y8PztM11.js";const ls=Object.freeze(Object.defineProperty({__proto__:null,get ConfigGeneric(){return K},get ConfigPanel(){return ft},get JsonConfig(){return _l},get JsonConfigComponent(){return Yt}},Symbol.toStringTag,{value:"Module"}));var hs=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,cs=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,us=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,un={Space_Separator:hs,ID_Start:cs,ID_Continue:us},we={isSpaceSeparator(L){return typeof L=="string"&&un.Space_Separator.test(L)},isIdStartChar(L){return typeof L=="string"&&(L>="a"&&L<="z"||L>="A"&&L<="Z"||L==="$"||L==="_"||un.ID_Start.test(L))},isIdContinueChar(L){return typeof L=="string"&&(L>="a"&&L<="z"||L>="A"&&L<="Z"||L>="0"&&L<="9"||L==="$"||L==="_"||L===""||L===""||un.ID_Continue.test(L))},isDigit(L){return typeof L=="string"&&/[0-9]/.test(L)},isHexDigit(L){return typeof L=="string"&&/[0-9A-Fa-f]/.test(L)}};let Sn,Ae,Ue,Qt,et,Be,Se,_n,Tt;var ps=function(t,n){Sn=String(t),Ae="start",Ue=[],Qt=0,et=1,Be=0,Se=void 0,_n=void 0,Tt=void 0;do Se=ds(),ms[Ae]();while(Se.type!=="eof");return typeof n=="function"?Dn({"":Tt},"",n):Tt};function Dn(L,t,n){const l=L[t];if(l!=null&&typeof l=="object")if(Array.isArray(l))for(let y=0;y<l.length;y++){const a=String(y),p=Dn(l,a,n);p===void 0?delete l[a]:Object.defineProperty(l,a,{value:p,writable:!0,enumerable:!0,configurable:!0})}else for(const y in l){const a=Dn(l,y,n);a===void 0?delete l[y]:Object.defineProperty(l,y,{value:a,writable:!0,enumerable:!0,configurable:!0})}return n.call(L,t,l)}let le,oe,$t,Ve,ce;function ds(){for(le="default",oe="",$t=!1,Ve=1;;){ce=Ge();const L=ki[le]();if(L)return L}}function Ge(){if(Sn[Qt])return String.fromCodePoint(Sn.codePointAt(Qt))}function Z(){const L=Ge();return L===`
|
|
3
|
-
`?(et++,Be=0):L?Be+=L.length:Be++,L&&(Qt+=L.length),L}const ki={default(){switch(ce){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
|
|
4
|
-
`:case"\r":case"\u2028":case"\u2029":Z();return;case"/":Z(),le="comment";return;case void 0:return Z(),fe("eof")}if(we.isSpaceSeparator(ce)){Z();return}return ki[Ae]()},comment(){switch(ce){case"*":Z(),le="multiLineComment";return;case"/":Z(),le="singleLineComment";return}throw ge(Z())},multiLineComment(){switch(ce){case"*":Z(),le="multiLineCommentAsterisk";return;case void 0:throw ge(Z())}Z()},multiLineCommentAsterisk(){switch(ce){case"*":Z();return;case"/":Z(),le="default";return;case void 0:throw ge(Z())}Z(),le="multiLineComment"},singleLineComment(){switch(ce){case`
|
|
5
|
-
`:case"\r":case"\u2028":case"\u2029":Z(),le="default";return;case void 0:return Z(),fe("eof")}Z()},value(){switch(ce){case"{":case"[":return fe("punctuator",Z());case"n":return Z(),at("ull"),fe("null",null);case"t":return Z(),at("rue"),fe("boolean",!0);case"f":return Z(),at("alse"),fe("boolean",!1);case"-":case"+":Z()==="-"&&(Ve=-1),le="sign";return;case".":oe=Z(),le="decimalPointLeading";return;case"0":oe=Z(),le="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":oe=Z(),le="decimalInteger";return;case"I":return Z(),at("nfinity"),fe("numeric",1/0);case"N":return Z(),at("aN"),fe("numeric",NaN);case'"':case"'":$t=Z()==='"',oe="",le="string";return}throw ge(Z())},identifierNameStartEscape(){if(ce!=="u")throw ge(Z());Z();const L=xn();switch(L){case"$":case"_":break;default:if(!we.isIdStartChar(L))throw qn();break}oe+=L,le="identifierName"},identifierName(){switch(ce){case"$":case"_":case"":case"":oe+=Z();return;case"\\":Z(),le="identifierNameEscape";return}if(we.isIdContinueChar(ce)){oe+=Z();return}return fe("identifier",oe)},identifierNameEscape(){if(ce!=="u")throw ge(Z());Z();const L=xn();switch(L){case"$":case"_":case"":case"":break;default:if(!we.isIdContinueChar(L))throw qn();break}oe+=L,le="identifierName"},sign(){switch(ce){case".":oe=Z(),le="decimalPointLeading";return;case"0":oe=Z(),le="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":oe=Z(),le="decimalInteger";return;case"I":return Z(),at("nfinity"),fe("numeric",Ve*(1/0));case"N":return Z(),at("aN"),fe("numeric",NaN)}throw ge(Z())},zero(){switch(ce){case".":oe+=Z(),le="decimalPoint";return;case"e":case"E":oe+=Z(),le="decimalExponent";return;case"x":case"X":oe+=Z(),le="hexadecimal";return}return fe("numeric",Ve*0)},decimalInteger(){switch(ce){case".":oe+=Z(),le="decimalPoint";return;case"e":case"E":oe+=Z(),le="decimalExponent";return}if(we.isDigit(ce)){oe+=Z();return}return fe("numeric",Ve*Number(oe))},decimalPointLeading(){if(we.isDigit(ce)){oe+=Z(),le="decimalFraction";return}throw ge(Z())},decimalPoint(){switch(ce){case"e":case"E":oe+=Z(),le="decimalExponent";return}if(we.isDigit(ce)){oe+=Z(),le="decimalFraction";return}return fe("numeric",Ve*Number(oe))},decimalFraction(){switch(ce){case"e":case"E":oe+=Z(),le="decimalExponent";return}if(we.isDigit(ce)){oe+=Z();return}return fe("numeric",Ve*Number(oe))},decimalExponent(){switch(ce){case"+":case"-":oe+=Z(),le="decimalExponentSign";return}if(we.isDigit(ce)){oe+=Z(),le="decimalExponentInteger";return}throw ge(Z())},decimalExponentSign(){if(we.isDigit(ce)){oe+=Z(),le="decimalExponentInteger";return}throw ge(Z())},decimalExponentInteger(){if(we.isDigit(ce)){oe+=Z();return}return fe("numeric",Ve*Number(oe))},hexadecimal(){if(we.isHexDigit(ce)){oe+=Z(),le="hexadecimalInteger";return}throw ge(Z())},hexadecimalInteger(){if(we.isHexDigit(ce)){oe+=Z();return}return fe("numeric",Ve*Number(oe))},string(){switch(ce){case"\\":Z(),oe+=fs();return;case'"':if($t)return Z(),fe("string",oe);oe+=Z();return;case"'":if(!$t)return Z(),fe("string",oe);oe+=Z();return;case`
|
|
6
|
-
`:case"\r":throw ge(Z());case"\u2028":case"\u2029":vs(ce);break;case void 0:throw ge(Z())}oe+=Z()},start(){switch(ce){case"{":case"[":return fe("punctuator",Z())}le="value"},beforePropertyName(){switch(ce){case"$":case"_":oe=Z(),le="identifierName";return;case"\\":Z(),le="identifierNameStartEscape";return;case"}":return fe("punctuator",Z());case'"':case"'":$t=Z()==='"',le="string";return}if(we.isIdStartChar(ce)){oe+=Z(),le="identifierName";return}throw ge(Z())},afterPropertyName(){if(ce===":")return fe("punctuator",Z());throw ge(Z())},beforePropertyValue(){le="value"},afterPropertyValue(){switch(ce){case",":case"}":return fe("punctuator",Z())}throw ge(Z())},beforeArrayValue(){if(ce==="]")return fe("punctuator",Z());le="value"},afterArrayValue(){switch(ce){case",":case"]":return fe("punctuator",Z())}throw ge(Z())},end(){throw ge(Z())}};function fe(L,t){return{type:L,value:t,line:et,column:Be}}function at(L){for(const t of L){if(Ge()!==t)throw ge(Z());Z()}}function fs(){switch(Ge()){case"b":return Z(),"\b";case"f":return Z(),"\f";case"n":return Z(),`
|
|
7
|
-
`;case"r":return Z(),"\r";case"t":return Z()," ";case"v":return Z(),"\v";case"0":if(Z(),we.isDigit(Ge()))throw ge(Z());return"\0";case"x":return Z(),gs();case"u":return Z(),xn();case`
|
|
8
|
-
`:case"\u2028":case"\u2029":return Z(),"";case"\r":return Z(),Ge()===`
|
|
9
|
-
`&&Z(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw ge(Z());case void 0:throw ge(Z())}return Z()}function gs(){let L="",t=Ge();if(!we.isHexDigit(t)||(L+=Z(),t=Ge(),!we.isHexDigit(t)))throw ge(Z());return L+=Z(),String.fromCodePoint(parseInt(L,16))}function xn(){let L="",t=4;for(;t-- >0;){const n=Ge();if(!we.isHexDigit(n))throw ge(Z());L+=Z()}return String.fromCodePoint(parseInt(L,16))}const ms={start(){if(Se.type==="eof")throw lt();pn()},beforePropertyName(){switch(Se.type){case"identifier":case"string":_n=Se.value,Ae="afterPropertyName";return;case"punctuator":zt();return;case"eof":throw lt()}},afterPropertyName(){if(Se.type==="eof")throw lt();Ae="beforePropertyValue"},beforePropertyValue(){if(Se.type==="eof")throw lt();pn()},beforeArrayValue(){if(Se.type==="eof")throw lt();if(Se.type==="punctuator"&&Se.value==="]"){zt();return}pn()},afterPropertyValue(){if(Se.type==="eof")throw lt();switch(Se.value){case",":Ae="beforePropertyName";return;case"}":zt()}},afterArrayValue(){if(Se.type==="eof")throw lt();switch(Se.value){case",":Ae="beforeArrayValue";return;case"]":zt()}},end(){}};function pn(){let L;switch(Se.type){case"punctuator":switch(Se.value){case"{":L={};break;case"[":L=[];break}break;case"null":case"boolean":case"numeric":case"string":L=Se.value;break}if(Tt===void 0)Tt=L;else{const t=Ue[Ue.length-1];Array.isArray(t)?t.push(L):Object.defineProperty(t,_n,{value:L,writable:!0,enumerable:!0,configurable:!0})}if(L!==null&&typeof L=="object")Ue.push(L),Array.isArray(L)?Ae="beforeArrayValue":Ae="beforePropertyName";else{const t=Ue[Ue.length-1];t==null?Ae="end":Array.isArray(t)?Ae="afterArrayValue":Ae="afterPropertyValue"}}function zt(){Ue.pop();const L=Ue[Ue.length-1];L==null?Ae="end":Array.isArray(L)?Ae="afterArrayValue":Ae="afterPropertyValue"}function ge(L){return Xt(L===void 0?`JSON5: invalid end of input at ${et}:${Be}`:`JSON5: invalid character '${Mi(L)}' at ${et}:${Be}`)}function lt(){return Xt(`JSON5: invalid end of input at ${et}:${Be}`)}function qn(){return Be-=5,Xt(`JSON5: invalid identifier character at ${et}:${Be}`)}function vs(L){console.warn(`JSON5: '${Mi(L)}' in strings is not valid ECMAScript; consider escaping`)}function Mi(L){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[L])return t[L];if(L<" "){const n=L.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return L}function Xt(L){const t=new SyntaxError(L);return t.lineNumber=et,t.columnNumber=Be,t}var ys=function(t,n,l){const y=[];let a="",p,d,s="",c;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(l=n.space,c=n.quote,n=n.replacer),typeof n=="function")d=n;else if(Array.isArray(n)){p=[];for(const u of n){let f;typeof u=="string"?f=u:(typeof u=="number"||u instanceof String||u instanceof Number)&&(f=String(u)),f!==void 0&&p.indexOf(f)<0&&p.push(f)}}return l instanceof Number?l=Number(l):l instanceof String&&(l=String(l)),typeof l=="number"?l>0&&(l=Math.min(10,Math.floor(l)),s=" ".substr(0,l)):typeof l=="string"&&(s=l.substr(0,10)),e("",{"":t});function e(u,f){let g=f[u];switch(g!=null&&(typeof g.toJSON5=="function"?g=g.toJSON5(u):typeof g.toJSON=="function"&&(g=g.toJSON(u))),d&&(g=d.call(f,u,g)),g instanceof Number?g=Number(g):g instanceof String?g=String(g):g instanceof Boolean&&(g=g.valueOf()),g){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof g=="string")return i(g);if(typeof g=="number")return String(g);if(typeof g=="object")return Array.isArray(g)?r(g):o(g)}function i(u){const f={"'":.1,'"':.2},g={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let v="";for(let E=0;E<u.length;E++){const w=u[E];switch(w){case"'":case'"':f[w]++,v+=w;continue;case"\0":if(we.isDigit(u[E+1])){v+="\\x00";continue}}if(g[w]){v+=g[w];continue}if(w<" "){let m=w.charCodeAt(0).toString(16);v+="\\x"+("00"+m).substring(m.length);continue}v+=w}const A=c||Object.keys(f).reduce((E,w)=>f[E]<f[w]?E:w);return v=v.replace(new RegExp(A,"g"),g[A]),A+v+A}function o(u){if(y.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");y.push(u);let f=a;a=a+s;let g=p||Object.keys(u),v=[];for(const E of g){const w=e(E,u);if(w!==void 0){let m=h(E)+":";s!==""&&(m+=" "),m+=w,v.push(m)}}let A;if(v.length===0)A="{}";else{let E;if(s==="")E=v.join(","),A="{"+E+"}";else{let w=`,
|
|
10
|
-
`+a;E=v.join(w),A=`{
|
|
11
|
-
`+a+E+`,
|
|
12
|
-
`+f+"}"}}return y.pop(),a=f,A}function h(u){if(u.length===0)return i(u);const f=String.fromCodePoint(u.codePointAt(0));if(!we.isIdStartChar(f))return i(u);for(let g=f.length;g<u.length;g++)if(!we.isIdContinueChar(String.fromCodePoint(u.codePointAt(g))))return i(u);return u}function r(u){if(y.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");y.push(u);let f=a;a=a+s;let g=[];for(let A=0;A<u.length;A++){const E=e(String(A),u);g.push(E!==void 0?E:"null")}let v;if(g.length===0)v="[]";else if(s==="")v="["+g.join(",")+"]";else{let A=`,
|
|
13
|
-
`+a,E=g.join(A);v=`[
|
|
14
|
-
`+a+E+`,
|
|
15
|
-
`+f+"]"}return y.pop(),a=f,v}};const bs={parse:ps,stringify:ys};var Li=bs,kn={exports:{}};function ws(L){throw new Error('Could not dynamically require "'+L+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Jt={exports:{}};const Cs={},Es=Object.freeze(Object.defineProperty({__proto__:null,default:Cs},Symbol.toStringTag,{value:"Module"})),Ss=Qr(Es);var Ds=Jt.exports,ei;function xs(){return ei||(ei=1,(function(L,t){(function(n,l){L.exports=l()})(Ds,function(){var n=n||(function(l,y){var a;if(typeof window<"u"&&window.crypto&&(a=window.crypto),typeof self<"u"&&self.crypto&&(a=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a=globalThis.crypto),!a&&typeof window<"u"&&window.msCrypto&&(a=window.msCrypto),!a&&typeof ke<"u"&&ke.crypto&&(a=ke.crypto),!a&&typeof ws=="function")try{a=Ss}catch{}var p=function(){if(a){if(typeof a.getRandomValues=="function")try{return a.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a.randomBytes=="function")try{return a.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},d=Object.create||(function(){function v(){}return function(A){var E;return v.prototype=A,E=new v,v.prototype=null,E}})(),s={},c=s.lib={},e=c.Base=(function(){return{extend:function(v){var A=d(this);return v&&A.mixIn(v),(!A.hasOwnProperty("init")||this.init===A.init)&&(A.init=function(){A.$super.init.apply(this,arguments)}),A.init.prototype=A,A.$super=this,A},create:function(){var v=this.extend();return v.init.apply(v,arguments),v},init:function(){},mixIn:function(v){for(var A in v)v.hasOwnProperty(A)&&(this[A]=v[A]);v.hasOwnProperty("toString")&&(this.toString=v.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),i=c.WordArray=e.extend({init:function(v,A){v=this.words=v||[],A!=y?this.sigBytes=A:this.sigBytes=v.length*4},toString:function(v){return(v||h).stringify(this)},concat:function(v){var A=this.words,E=v.words,w=this.sigBytes,m=v.sigBytes;if(this.clamp(),w%4)for(var S=0;S<m;S++){var k=E[S>>>2]>>>24-S%4*8&255;A[w+S>>>2]|=k<<24-(w+S)%4*8}else for(var D=0;D<m;D+=4)A[w+D>>>2]=E[D>>>2];return this.sigBytes+=m,this},clamp:function(){var v=this.words,A=this.sigBytes;v[A>>>2]&=4294967295<<32-A%4*8,v.length=l.ceil(A/4)},clone:function(){var v=e.clone.call(this);return v.words=this.words.slice(0),v},random:function(v){for(var A=[],E=0;E<v;E+=4)A.push(p());return new i.init(A,v)}}),o=s.enc={},h=o.Hex={stringify:function(v){for(var A=v.words,E=v.sigBytes,w=[],m=0;m<E;m++){var S=A[m>>>2]>>>24-m%4*8&255;w.push((S>>>4).toString(16)),w.push((S&15).toString(16))}return w.join("")},parse:function(v){for(var A=v.length,E=[],w=0;w<A;w+=2)E[w>>>3]|=parseInt(v.substr(w,2),16)<<24-w%8*4;return new i.init(E,A/2)}},r=o.Latin1={stringify:function(v){for(var A=v.words,E=v.sigBytes,w=[],m=0;m<E;m++){var S=A[m>>>2]>>>24-m%4*8&255;w.push(String.fromCharCode(S))}return w.join("")},parse:function(v){for(var A=v.length,E=[],w=0;w<A;w++)E[w>>>2]|=(v.charCodeAt(w)&255)<<24-w%4*8;return new i.init(E,A)}},u=o.Utf8={stringify:function(v){try{return decodeURIComponent(escape(r.stringify(v)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(v){return r.parse(unescape(encodeURIComponent(v)))}},f=c.BufferedBlockAlgorithm=e.extend({reset:function(){this._data=new i.init,this._nDataBytes=0},_append:function(v){typeof v=="string"&&(v=u.parse(v)),this._data.concat(v),this._nDataBytes+=v.sigBytes},_process:function(v){var A,E=this._data,w=E.words,m=E.sigBytes,S=this.blockSize,k=S*4,D=m/k;v?D=l.ceil(D):D=l.max((D|0)-this._minBufferSize,0);var _=D*S,F=l.min(_*4,m);if(_){for(var x=0;x<_;x+=S)this._doProcessBlock(w,x);A=w.splice(0,_),E.sigBytes-=F}return new i.init(A,F)},clone:function(){var v=e.clone.call(this);return v._data=this._data.clone(),v},_minBufferSize:0});c.Hasher=f.extend({cfg:e.extend(),init:function(v){this.cfg=this.cfg.extend(v),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(v){return this._append(v),this._process(),this},finalize:function(v){v&&this._append(v);var A=this._doFinalize();return A},blockSize:16,_createHelper:function(v){return function(A,E){return new v.init(E).finalize(A)}},_createHmacHelper:function(v){return function(A,E){return new g.HMAC.init(v,E).finalize(A)}}});var g=s.algo={};return s})(Math);return n})})(Jt)),Jt.exports}var As=kn.exports;(function(L,t){(function(n,l){L.exports=l(xs())})(As,function(n){return(function(l){var y=n,a=y.lib,p=a.WordArray,d=a.Hasher,s=y.algo,c=[];(function(){for(var u=0;u<64;u++)c[u]=l.abs(l.sin(u+1))*4294967296|0})();var e=s.MD5=d.extend({_doReset:function(){this._hash=new p.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(u,f){for(var g=0;g<16;g++){var v=f+g,A=u[v];u[v]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}var E=this._hash.words,w=u[f+0],m=u[f+1],S=u[f+2],k=u[f+3],D=u[f+4],_=u[f+5],F=u[f+6],x=u[f+7],$=u[f+8],C=u[f+9],b=u[f+10],T=u[f+11],I=u[f+12],R=u[f+13],N=u[f+14],P=u[f+15],B=E[0],V=E[1],W=E[2],z=E[3];B=i(B,V,W,z,w,7,c[0]),z=i(z,B,V,W,m,12,c[1]),W=i(W,z,B,V,S,17,c[2]),V=i(V,W,z,B,k,22,c[3]),B=i(B,V,W,z,D,7,c[4]),z=i(z,B,V,W,_,12,c[5]),W=i(W,z,B,V,F,17,c[6]),V=i(V,W,z,B,x,22,c[7]),B=i(B,V,W,z,$,7,c[8]),z=i(z,B,V,W,C,12,c[9]),W=i(W,z,B,V,b,17,c[10]),V=i(V,W,z,B,T,22,c[11]),B=i(B,V,W,z,I,7,c[12]),z=i(z,B,V,W,R,12,c[13]),W=i(W,z,B,V,N,17,c[14]),V=i(V,W,z,B,P,22,c[15]),B=o(B,V,W,z,m,5,c[16]),z=o(z,B,V,W,F,9,c[17]),W=o(W,z,B,V,T,14,c[18]),V=o(V,W,z,B,w,20,c[19]),B=o(B,V,W,z,_,5,c[20]),z=o(z,B,V,W,b,9,c[21]),W=o(W,z,B,V,P,14,c[22]),V=o(V,W,z,B,D,20,c[23]),B=o(B,V,W,z,C,5,c[24]),z=o(z,B,V,W,N,9,c[25]),W=o(W,z,B,V,k,14,c[26]),V=o(V,W,z,B,$,20,c[27]),B=o(B,V,W,z,R,5,c[28]),z=o(z,B,V,W,S,9,c[29]),W=o(W,z,B,V,x,14,c[30]),V=o(V,W,z,B,I,20,c[31]),B=h(B,V,W,z,_,4,c[32]),z=h(z,B,V,W,$,11,c[33]),W=h(W,z,B,V,T,16,c[34]),V=h(V,W,z,B,N,23,c[35]),B=h(B,V,W,z,m,4,c[36]),z=h(z,B,V,W,D,11,c[37]),W=h(W,z,B,V,x,16,c[38]),V=h(V,W,z,B,b,23,c[39]),B=h(B,V,W,z,R,4,c[40]),z=h(z,B,V,W,w,11,c[41]),W=h(W,z,B,V,k,16,c[42]),V=h(V,W,z,B,F,23,c[43]),B=h(B,V,W,z,C,4,c[44]),z=h(z,B,V,W,I,11,c[45]),W=h(W,z,B,V,P,16,c[46]),V=h(V,W,z,B,S,23,c[47]),B=r(B,V,W,z,w,6,c[48]),z=r(z,B,V,W,x,10,c[49]),W=r(W,z,B,V,N,15,c[50]),V=r(V,W,z,B,_,21,c[51]),B=r(B,V,W,z,I,6,c[52]),z=r(z,B,V,W,k,10,c[53]),W=r(W,z,B,V,b,15,c[54]),V=r(V,W,z,B,m,21,c[55]),B=r(B,V,W,z,$,6,c[56]),z=r(z,B,V,W,P,10,c[57]),W=r(W,z,B,V,F,15,c[58]),V=r(V,W,z,B,R,21,c[59]),B=r(B,V,W,z,D,6,c[60]),z=r(z,B,V,W,T,10,c[61]),W=r(W,z,B,V,S,15,c[62]),V=r(V,W,z,B,C,21,c[63]),E[0]=E[0]+B|0,E[1]=E[1]+V|0,E[2]=E[2]+W|0,E[3]=E[3]+z|0},_doFinalize:function(){var u=this._data,f=u.words,g=this._nDataBytes*8,v=u.sigBytes*8;f[v>>>5]|=128<<24-v%32;var A=l.floor(g/4294967296),E=g;f[(v+64>>>9<<4)+15]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,f[(v+64>>>9<<4)+14]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,u.sigBytes=(f.length+1)*4,this._process();for(var w=this._hash,m=w.words,S=0;S<4;S++){var k=m[S];m[S]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}return w},clone:function(){var u=d.clone.call(this);return u._hash=this._hash.clone(),u}});function i(u,f,g,v,A,E,w){var m=u+(f&g|~f&v)+A+w;return(m<<E|m>>>32-E)+f}function o(u,f,g,v,A,E,w){var m=u+(f&v|g&~v)+A+w;return(m<<E|m>>>32-E)+f}function h(u,f,g,v,A,E,w){var m=u+(f^g^v)+A+w;return(m<<E|m>>>32-E)+f}function r(u,f,g,v,A,E,w){var m=u+(g^(f|~v))+A+w;return(m<<E|m>>>32-E)+f}y.MD5=d._createHelper(e),y.HmacMD5=d._createHmacHelper(e)})(Math),n.MD5})})(kn);var $s=kn.exports;const ti=Xr($s),Ts=window.innerWidth<=600?12:void 0;function dn(L){return Object.prototype.toString.call(L)==="[object Object]"}class K extends qe.Component{static DIFFERENT_VALUE="__different__";static DIFFERENT_LABEL="ra___different__";static NONE_VALUE="";static NONE_LABEL="ra_none";defaultValue;isError;lang;defaultSendToDone;sendToTimeout;noPlaceRequired;constructor(t){super(t),this.state={confirmDialog:!1,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},this.isError={},t.schema&&(t.custom?this.defaultValue=t.schema.defaultFunc?this.executeCustom(t.schema.defaultFunc,t.data,t.customObj,t.oContext.instanceObj,t.arrayIndex,t.globalData):t.schema.default:t.schema.type!=="state"&&(this.defaultValue=t.schema.defaultFunc?this.execute(t.schema.defaultFunc,t.schema.default,t.data,t.arrayIndex,t.globalData):t.schema.default)),this.lang=j.I18n.getLanguage()}componentDidMount(){this.props.oContext.registerOnForceUpdate&&this.props.oContext.registerOnForceUpdate(this.props.attr,this.onUpdate);const t=["select","autocomplete","autocompleteSendTo"];if(this.defaultValue!==void 0){const n=K.getValue(this.props.data,this.props.attr);(n===void 0||t.includes(this.props.schema.type)&&(n===""||n===null))&&setTimeout(()=>{this.props.custom?this.props.onChange(this.props.attr,this.defaultValue,()=>setTimeout(()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data),100)):(K.setValue(this.props.data,this.props.attr,this.defaultValue),this.props.onChange(this.props.data,void 0,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data)))},100)}else this.props.schema.defaultSendTo&&this.sendTo()}sendTo(){if(this.props.alive){this.defaultSendToDone=!0;let t=this.props.schema.data;if(t===void 0&&this.props.schema.jsonData){const n=this.getPattern(this.props.schema.jsonData,null,!0);try{t=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${n}`)}}else t={attr:this.props.attr,value:K.getValue(this.props.data,this.props.attr)};t===void 0&&(t=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.defaultSendTo,t).then(n=>{n!=null&&(this.props.custom?this.props.onChange(this.props.attr,n,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data)):(K.setValue(this.props.data,this.props.attr,n),this.props.onChange(this.props.data,void 0,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data))))})}else this.defaultSendToDone=!1,this.props.schema.allowSaveWithError||this.onError(this.props.attr,j.I18n.t("ra_Instance %s is not alive",this.props.oContext.instance.toString()))}componentWillUnmount(){this.props.oContext.registerOnForceUpdate&&this.props.oContext.registerOnForceUpdate(this.props.attr),this.sendToTimeout&&(clearTimeout(this.sendToTimeout),this.sendToTimeout=null)}onUpdate=t=>{const n=K.getValue(t||this.props.data,this.props.attr)||"";this.state.value!==n?this.setState({value:n}):this.forceUpdate()};static getValue(t,n){if(typeof n=="string")return K.getValue(t,n.split("."));if(n.length===1)return t[n[0]];const l=n.shift();if(typeof l=="string"&&typeof t[l]=="object")return K.getValue(t[l],n)}static setValue(t,n,l){if(typeof n=="string"){K.setValue(t,n.split("."),l);return}if(n.length===1)l===null?delete t[n[0]]:t[n[0]]=l;else{const y=n.shift();if(typeof y!="string")return;(!t[y]||typeof t[y]=="object")&&(t[y]=t[y]||{}),K.setValue(t[y],n,l)}}getText(t,n){if(!t)return"";if(typeof t=="string"){const l=n?t:j.I18n.t(t);return l.includes("${")?this.getPattern(l,null,n):l}return dn(t)?t.func?typeof t.func=="object"?this.getPattern(t.func[this.lang]||t.func.en||"",null,!0):this.getPattern(t.func,null,n):t[this.lang]||t.en||"":t.toString()}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const t=this.state.confirmData||this.props.schema.confirm;let n=null;return t.type==="warning"?n=M.createElement(X.Warning,null):t.type==="error"?n=M.createElement(X.Error,null):t.type==="info"&&(n=M.createElement(X.Info,null)),M.createElement(j.DialogConfirm,{title:this.getText(t.title)||j.I18n.t("ra_Please confirm"),text:this.getText(t.text),ok:this.getText(t.ok)||j.I18n.t("ra_Ok"),cancel:this.getText(t.cancel)||j.I18n.t("ra_Cancel"),icon:n||void 0,onClose:l=>this.setState({confirmDialog:!1},()=>{if(l){if(this.state.confirmCallback){const a=this.state.confirmCallback;this.setState({confirmCallback:null},()=>a(!0));return}const y=JSON.parse(JSON.stringify(this.props.data));this.state.confirmDepAttr&&K.setValue(y,this.state.confirmDepAttr,this.state.confirmDepNewValue),K.setValue(y,this.state.confirmAttr,this.state.confirmNewValue),this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null},()=>this.props.onChange(y))}else{const y=this.state.confirmCallback;this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},()=>{y&&y(!1)})}})})}getIcon(t){t=t||this.props.schema.icon;let n=null;return t==="auth"?n=M.createElement(X.Key,null):t==="send"?n=M.createElement(X.Send,null):t==="web"?n=M.createElement(X.Public,null):t==="warning"?n=M.createElement(X.Warning,null):t==="error"?n=M.createElement(X.Error,null):t==="info"?n=M.createElement(X.Info,null):t==="search"?n=M.createElement(X.Search,null):t==="book"?n=M.createElement(X.MenuBook,null):t==="help"?n=M.createElement(X.Help,null):t==="upload"?n=M.createElement(X.UploadFile,null):t==="edit"?n=M.createElement(X.Edit,null):t==="user"?n=M.createElement(X.Person,null):t==="group"?n=M.createElement(X.Group,null):t==="delete"?n=M.createElement(X.Delete,null):t==="refresh"?n=M.createElement(X.Refresh,null):t==="add"?n=M.createElement(X.Add,null):t==="unpair"?n=M.createElement(X.LinkOff,null):t==="pair"?n=M.createElement(X.Link,null):t==="save"?n=M.createElement(X.Save,null):t==="open"?n=M.createElement(X.OpenInNew,null):t&&((t.endsWith(".png")||t.endsWith(".svg")||t.endsWith(".jpg"))&&!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`./adapter/${this.props.oContext.adapterName}/${t}`),n=M.createElement(j.Icon,{src:t,style:{width:22,height:22}})),n}onChangeAsync(t,n){return new Promise(l=>{const y=this.onChange(t,n,l);y instanceof Promise&&y.catch(a=>console.error(`Cannot set value: ${a}`))})}onChange(t,n,l){const y=JSON.parse(JSON.stringify(this.props.data));if(K.setValue(y,t,n),this.props.schema.confirm&&this.execute(this.props.schema.confirm.condition,!1,y,this.props.arrayIndex,this.props.globalData))return new Promise(p=>{this.setState({confirmDialog:!0,confirmNewValue:n,confirmAttr:t,confirmData:null},()=>{typeof l=="function"?l():p()})});if(this.props.schema.confirmDependsOn)for(let p=0;p<this.props.schema.confirmDependsOn.length;p++){const d=this.props.schema.confirmDependsOn[p];if(d.confirm){const s=K.getValue(y,d.attr);if(this.execute(d.confirm.condition,!1,y,this.props.arrayIndex,this.props.globalData))return new Promise(c=>{this.setState({confirmDialog:!0,confirmNewValue:n,confirmAttr:t,confirmDepNewValue:s,confirmDepAttr:d.attr,confirmData:d.confirm},()=>{typeof l=="function"?l():c()})})}}const a=[];if(this.props.schema.onChangeDependsOn)for(let p=0;p<this.props.schema.onChangeDependsOn.length;p++){const d=this.props.schema.onChangeDependsOn[p];if(d.onChange){const s=K.getValue(y,d.attr);let c;this.props.custom?c=this.executeCustom(d.onChange.calculateFunc,y,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):c=this.execute(d.onChange.calculateFunc,s,y,this.props.arrayIndex,this.props.globalData),c!==s&&(K.setValue(y,d.attr,c),a.push(d.attr))}}if(this.props.schema.hiddenDependsOn)for(let p=0;p<this.props.schema.hiddenDependsOn.length;p++){const d=this.props.schema.hiddenDependsOn[p];d.hidden&&a.push(d.attr)}if(this.props.schema.labelDependsOn)for(let p=0;p<this.props.schema.labelDependsOn.length;p++){const d=this.props.schema.labelDependsOn[p];d.hidden&&a.push(d.attr)}if(this.props.schema.helpDependsOn)for(let p=0;p<this.props.schema.helpDependsOn.length;p++){const d=this.props.schema.helpDependsOn[p];d.hidden&&a.push(d.attr)}if(this.props.schema.onChange&&!this.props.schema.onChange.ignoreOwnChanges){const p=K.getValue(y,this.props.attr),d=this.props.custom?this.executeCustom(this.props.schema.onChange.calculateFunc,y,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):this.execute(this.props.schema.onChange.calculateFunc,p,y,this.props.arrayIndex,this.props.globalData);d!==p&&K.setValue(y,this.props.attr,d)}return this.props.custom?(this.props.onChange(t,n,()=>l&&l()),a!=null&&a.length&&a.forEach((p,d)=>setTimeout(()=>this.props.onChange(p,K.getValue(y,p)),d*50))):this.props.onChange(y,void 0,()=>{a.length&&this.props.oContext.forceUpdate(a,y),l&&l()}),Promise.resolve()}execute(t,n,l,y,a){let p;if(dn(t))p=t.func;else if(typeof t=="string")p=t;else return t;if(!p)return n;try{return new Function("data","originalData","_system","_alive","_common","_socket","_instance","arrayIndex","globalData","_changed",p.includes("return")?p:`return ${p}`)(l||this.props.data,this.props.originalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.oContext.instance,y,a,this.props.changed)}catch(d){return console.error(`Cannot execute ${JSON.stringify(t)}: ${d}`),n}}executeCustom(t,n,l,y,a,p){let d;if(dn(t))d=t.func;else if(typeof t=="string")d=t;else return t;if(!d)return null;try{return new Function("data","originalData","_system","instanceObj","customObj","_socket","arrayIndex","globalData","_changed",d.includes("return")?d:`return ${d}`)(n||this.props.data,this.props.originalData,this.props.oContext.systemConfig,y,l,this.props.oContext.socket,a,p,this.props.changed)}catch(s){return console.error(`Cannot execute ${d}: ${s}`),null}}calculate(t){let n,l,y,a;return this.props.custom?(n=t.validator?!this.executeCustom(t.validator,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,t.disabled===!0?l=!0:l=t.disabled?this.executeCustom(t.disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,t.hidden===!0?y=!0:y=t.hidden?this.executeCustom(t.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,a=t.defaultFunc?this.executeCustom(t.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):t.default):(n=t.validator?!this.execute(t.validator,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,t.disabled===!0?l=!0:l=t.disabled?this.execute(t.disabled,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,t.hidden===!0?y=!0:y=t.hidden?this.execute(t.hidden,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,a=t.defaultFunc?this.execute(t.defaultFunc,t.default,this.props.data,this.props.arrayIndex,this.props.globalData):t.default),{error:n,disabled:l,hidden:y,defaultValue:a}}onError(t,n){n?this.isError[t]=n:delete this.isError[t],this.props.onError&&this.props.onError(t,n)}renderItem(t,n,l){return this.getText(this.props.schema.label)||this.getText(this.props.schema.text)}renderHelp(t,n,l){return n?M.createElement("a",{href:n,target:"_blank",rel:"noreferrer",style:{color:this.props.oContext.themeType==="dark"?"#a147ff":"#5b238f",textDecoration:"underline"}},this.getText(t,l)):(t=this.getText(t,l)||"",t&&(t.includes("<a ")||t.includes("<br")||t.includes("<b>")||t.includes("<i>"))?j.Utils.renderTextWithA(t):t)}static escapeString(t,n){return typeof t!="string"?"":(t=t.replace(/`/g,"\\`"),t=t.replace(/\${([^}]+)}/g,(l,y)=>{if(y&&typeof y=="string"&&y.startsWith("data.")){const a=K.getValue(n,y.replace(/^data\./,""));if(typeof a=="string"&&a.includes('"'))return`\${${y}.replace(/"/g, '\\\\"')}`}return l}),t)}getPattern(t,n,l){if(n=n||this.props.data,!t)return"";let y;typeof t=="object"?t.func?y=t.func:(console.log(`Object must be stringified: ${JSON.stringify(t)}`),y=JSON.stringify(t)):y=t;try{if(this.props.custom)return new Function("data","originalData","arrayIndex","globalData","_system","instanceObj","customObj","_socket","_changed",`return \`${K.escapeString(y,n)}\``)(n,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.oContext.instanceObj,this.props.customObj,this.props.oContext.socket,this.props.changed);const p=new Function("data","originalData","arrayIndex","globalData","_system","_alive","_common","_socket","_changed",`return \`${K.escapeString(y,n)}\``)(n,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.changed);return l?p:j.I18n.t(p)}catch(a){return console.error(`Cannot execute ${y}: ${a}`),y}}render(){const t=this.props.schema;if(!t||this.props.expertMode===!1&&t.expertMode)return null;this.props.alive&&this.defaultSendToDone===!1&&(this.sendToTimeout=setTimeout(()=>{this.sendToTimeout=null,this.sendTo()},200));const{error:n,disabled:l,hidden:y,defaultValue:a}=this.calculate(t);if(y){if(Object.keys(this.isError).length&&(setTimeout(s=>Object.keys(s).forEach(c=>this.props.onError(c)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}),t.hideOnlyControl){const s=M.createElement(O.Grid2,{size:{xs:t.xs||Ts,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0},style:{marginBottom:0,textAlign:"left",...t.style,...this.props.oContext.themeType==="dark"?t.darkStyle:{}}});return t.newLine?M.createElement(M.Fragment,null,M.createElement("div",{style:{flexBasis:"100%",height:0}}),s):s}return null}t.validatorNoSaveOnError&&(n&&!Object.keys(this.isError).length?(this.isError={[this.props.attr]:t.validatorErrorText?j.I18n.t(t.validatorErrorText):!0},setTimeout(s=>Object.keys(s).forEach(c=>this.props.onError(c,s[c])),100,JSON.parse(JSON.stringify(this.isError)))):!n&&Object.keys(this.isError).length&&(setTimeout(s=>Object.keys(s).forEach(c=>this.props.onError(c)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}));const p=this.renderItem(n,l||this.props.commandRunning||this.props.disabled,a);if(this.noPlaceRequired)return p;const d=M.createElement(O.Grid2,{title:this.getText(t.tooltip),size:{xs:t.xs||12,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0},style:{marginBottom:0,textAlign:"left",width:t.type==="divider"||t.type==="header"?t.width||"100%":void 0,...t.style,...this.props.oContext.themeType==="dark"?t.darkStyle:{}}},this.props.schema.defaultSendTo&&this.props.schema.button?M.createElement(O.Grid2,{container:!0,style:{width:"100%"}},M.createElement(O.Grid2,{flex:1},p),M.createElement(O.Grid2,null,M.createElement(O.Button,{disabled:l,variant:"outlined",onClick:()=>this.sendTo(),title:this.props.schema.buttonTooltip?this.getText(this.props.schema.buttonTooltip,this.props.schema.buttonTooltipNoTranslation):j.I18n.t("ra_Request data by instance")},this.getText(this.props.schema.button)))):p);return t.newLine?M.createElement(M.Fragment,null,M.createElement("div",{style:{flexBasis:"100%",height:0}}),this.renderDialogConfirm(),d):this.state.confirmDialog?M.createElement(M.Fragment,null,this.renderDialogConfirm(),d):d}}const Re={fullWidth:{width:"100%"},accordionSummary:L=>({backgroundColor:L.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.08)"}),accordionTitle:{},toolbar:L=>({backgroundColor:L.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.08)",borderRadius:"3px"}),tooltip:{pointerEvents:"none"}};class _s extends K{typingTimer=null;constructor(t){super(t),this.props.schema.items=this.props.schema.items||[]}componentDidMount(){super.componentDidMount();let t=K.getValue(this.props.data,this.props.attr)||[];Array.isArray(t)||(t=[]),this.setState({value:t,activeIndex:-1,iteration:0})}componentWillUnmount(){this.typingTimer&&(clearTimeout(this.typingTimer),this.typingTimer=null),super.componentWillUnmount()}itemAccordion(t,n){const{value:l}=this.state,{schema:y}=this.props,a={type:"panel",items:y.items.reduce((p,d)=>(p[d.attr]=d,p),{}),style:{marginLeft:"-8px",marginTop:"10px",marginBottom:"10px"}};return M.createElement(ft,{oContext:this.props.oContext,index:n+this.state.iteration,arrayIndex:n,changed:this.props.changed,expertMode:this.props.expertMode,globalData:this.props.data,common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:t,custom:!0,schema:a,originalData:this.props.originalData,onChange:(p,d)=>{const s=JSON.parse(JSON.stringify(l));s[n][p]=d,this.setState({value:s},()=>this.onChangeWrapper(s))},onError:(p,d)=>this.onError(p,d),table:this.props.table})}onDelete=t=>()=>{const n=JSON.parse(JSON.stringify(this.state.value));n.splice(t,1),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(n))};onClone=t=>()=>{const n=JSON.parse(JSON.stringify(this.state.value)),l=JSON.parse(JSON.stringify(n[t]));if(typeof this.props.schema.clone=="string"&&typeof l[this.props.schema.clone]=="string"){let y=1,a=l[this.props.schema.clone];const p=a.match(/(\d+)$/);for(p?(a=a.replace(p[0],""),y=parseInt(p[0],10)+1):a+="_";n.find(d=>d[this.props.schema.clone]===a+y.toString());)y++;l[this.props.schema.clone]=`${l[this.props.schema.clone]}_${y}`}n.splice(t,0,l),this.setState({value:n,activeIndex:-1,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(n))};onChangeWrapper=t=>{this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout(n=>{this.typingTimer=null;const l=this.onChange(this.props.attr,n);l instanceof Promise&&l.catch(y=>this.onError(y))},300,t)};onAdd=()=>{const{schema:t}=this.props,n=JSON.parse(JSON.stringify(this.state.value)),l=t.items&&t.items.reduce((y,a)=>{let p;return a.defaultFunc?this.props.custom?p=a.defaultFunc?this.executeCustom(a.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,n.length,this.props.data):this.props.schema.default:p=a.defaultFunc?this.execute(a.defaultFunc,this.props.schema.default,this.props.data,n.length,this.props.data):this.props.schema.default:p=a.default===void 0?null:a.default,y[a.attr]=p,y},{});n.push(l),this.setState({value:n,activeIndex:n.length-1},()=>this.onChangeWrapper(n))};onMoveUp(t){const n=JSON.parse(JSON.stringify(this.state.value)),l=n[t];n.splice(t,1),n.splice(t-1,0,l);const y=this.state.activeIndex-1;this.setState({value:n,activeIndex:y,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(n))}onMoveDown(t){const n=JSON.parse(JSON.stringify(this.state.value)),l=n[t];n.splice(t,1),n.splice(t+1,0,l);const y=this.state.activeIndex+1;this.setState({value:n,activeIndex:y,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(n))}renderItem(){const{schema:t}=this.props,{value:n}=this.state;return n?M.createElement(O.Paper,null,t.label||!t.noDelete?M.createElement(O.Toolbar,{variant:"dense"},t.label?M.createElement(O.Typography,{variant:"h6",id:"tableTitle",component:"div"},this.getText(t.label)):null,t.noDelete?null:M.createElement(O.IconButton,{size:"small",color:"primary",onClick:this.onAdd},M.createElement(X.Add,null))):null,n.map((l,y)=>M.createElement(O.Accordion,{key:`${l}_${y}`,expanded:this.state.activeIndex===y,onChange:(a,p)=>this.setState({activeIndex:p?y:-1})},M.createElement(O.AccordionSummary,{expandIcon:M.createElement(X.ExpandMore,null),sx:j.Utils.getStyle(this.props.oContext.theme,Re.fullWidth,Re.accordionSummary)},M.createElement(O.Typography,{style:Re.accordionTitle},l[t.titleAttr])),M.createElement(O.AccordionDetails,{style:{...t.style,...this.props.oContext.themeType?t.darkStyle:void 0}},this.itemAccordion(n[y],y),M.createElement(O.Toolbar,{sx:Re.toolbar},y?M.createElement(O.Tooltip,{title:j.I18n.t("ra_Move up"),slotProps:{popper:{sx:Re.tooltip}}},M.createElement(O.IconButton,{size:"small",onClick:()=>this.onMoveUp(y)},M.createElement(X.ArrowUpward,null))):M.createElement("div",{style:Re.buttonEmpty}),y<n.length-1?M.createElement(O.Tooltip,{title:j.I18n.t("ra_Move down"),slotProps:{popper:{sx:Re.tooltip}}},M.createElement(O.IconButton,{size:"small",onClick:()=>this.onMoveDown(y)},M.createElement(X.ArrowDownward,null))):M.createElement("div",{style:Re.buttonEmpty}),t.noDelete?null:M.createElement(O.Tooltip,{title:j.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:Re.tooltip}}},M.createElement(O.IconButton,{size:"small",onClick:this.onDelete(y)},M.createElement(X.Delete,null))),t.clone?M.createElement(O.Tooltip,{title:j.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:Re.tooltip}}},M.createElement(O.IconButton,{size:"small",onClick:this.onClone(y)},M.createElement(X.ContentCopy,null))):null)))),!t.noDelete&&n.length>0?M.createElement(O.Toolbar,{variant:"dense",sx:Re.rootTool},M.createElement(O.IconButton,{size:"small",color:"primary",onClick:this.onAdd},M.createElement(X.Add,null))):null,t.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null):null}}const ni={root:{width:"100%"},notAlive:{color:"#a30000"}};class ks extends K{componentDidMount(){super.componentDidMount();const t=this.getInstance();this.props.oContext.socket.getState(`${t}.alive`).then(n=>this.setState({alive:!!(n&&n.val),instance:t}))}getInstance(){let t=this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`;return t.includes("${")&&(t=this.getPattern(t,null,!0)),t&&!t.startsWith("system.adapter.")&&(t=`system.adapter.${t}`),t}renderItem(){if(this.getInstance()!==this.state.instance&&setTimeout(()=>{const n=this.getInstance();n?this.props.oContext.socket.getState(`${n}.alive`).then(l=>this.setState({alive:!!(l&&l.val),instance:n})):this.setState({alive:null,instance:n})},200),this.state.alive!==!1&&this.state.alive!==!0)return null;const t=this.state.instance.replace(/^system.adapter./,"");return M.createElement("div",{style:{...ni.root,...this.state.alive?void 0:ni.notAlive}},this.state.alive?this.props.schema.textAlive!==void 0?this.props.schema.textAlive?j.I18n.t(this.props.schema.textAlive,t):"":j.I18n.t("ra_Instance %s is alive",t):this.props.schema.textNotAlive!==void 0?this.props.schema.textNotAlive?j.I18n.t(this.props.schema.textNotAlive,t):"":j.I18n.t("ra_Instance %s is not alive",t))}}class Ms extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr),n=this.props.schema.options.map(l=>typeof l=="string"?{label:l,value:l}:JSON.parse(JSON.stringify(l)));Array.isArray(t)?(n.unshift({label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),this.setState({value:K.DIFFERENT_VALUE,selectOptions:n})):this.setState({value:t,selectOptions:n})}renderItem(t,n){if(!this.state.selectOptions)return null;let l;const y=JSON.parse(JSON.stringify(this.state.selectOptions));return Array.isArray(this.state.value)||this.state.value===K.DIFFERENT_VALUE?([...this.state.value].filter(p=>!y.find(d=>typeof d=="object"?d.value===p:d===p)).forEach(p=>y.push({label:p.toString(),value:p})),l={label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE},y.unshift(l)):(l=this.state.value!==null&&this.state.value!==void 0&&y.find(p=>typeof p=="object"?p.value==this.state.value:p==this.state.value),this.state.value!==null&&this.state.value!==void 0&&!l&&this.props.schema.freeSolo&&(l={value:this.state.value,label:this.state.value},y.push(l))),M.createElement(O.Autocomplete,{fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,value:l,options:y,isOptionEqualToValue:(p,d)=>p.value===d.value,filterOptions:(p,d)=>{const s=p.filter(c=>d.inputValue===""?!0:c.label.toLowerCase().includes(d.inputValue.toLowerCase())||c.value.toLowerCase().includes(d.inputValue.toLowerCase()));return this.props.schema.freeSolo&&d.inputValue!==""&&s.push({label:d.inputValue,value:d.inputValue}),s},onInputChange:p=>{if(!p||!this.props.schema.freeSolo)return;const d=p.target.value;d!==this.state.value&&this.setState({value:d},()=>this.onChange(this.props.attr,d))},onChange:(p,d)=>{const s=typeof d=="object"?d?d.value:"":d;s!==this.state.value&&this.setState({value:s},()=>this.onChange(this.props.attr,s))},getOptionLabel:p=>typeof p=="object"?(p==null?void 0:p.label)??"":"",renderInput:p=>M.createElement(O.TextField,{variant:"standard",...p,error:!!t,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:n})})}}class Ls extends K{initialized=!1;localContext;askInstance(){const t=K.getValue(this.props.data,this.props.attr),n=this.props.schema.options?this.props.schema.options.map(l=>typeof l=="string"?{label:l,value:l}:JSON.parse(JSON.stringify(l))):[];if(this.props.alive){let l=this.props.schema.data;if(l===void 0&&this.props.schema.jsonData){const y=this.getPattern(this.props.schema.jsonData,null,!0);try{typeof y=="string"&&(l=JSON.parse(y))}catch{console.error(`Cannot parse json data: ${JSON.stringify(l)}`)}}l===void 0&&(l=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",l).then(y=>{y&&Array.isArray(y)&&y.forEach(a=>n.push(typeof a=="string"?{label:a,value:a}:JSON.parse(JSON.stringify(a)))),Array.isArray(t)?(n.unshift({label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),this.setState({value:K.DIFFERENT_VALUE,selectOptions:n})):this.setState({value:t,selectOptions:n})})}else Array.isArray(t)?(n.unshift({label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),this.setState({value:K.DIFFERENT_VALUE,selectOptions:n})):this.setState({value:t,selectOptions:n})}getContext(){const t={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(n=>t[n]=K.getValue(this.props.data,n)),JSON.stringify(t)}renderItem(t,n){if(this.props.alive){const p=this.getContext();(p!==this.localContext||!this.initialized)&&(this.localContext=p,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}let l;const y=this.state.selectOptions?JSON.parse(JSON.stringify(this.state.selectOptions)):[];return Array.isArray(this.state.value)||this.state.value===K.DIFFERENT_LABEL?([...this.state.value].filter(p=>!y.find(d=>d.value===p)).forEach(p=>y.push({label:p.toString(),value:p})),l={label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE},y.unshift(l)):(l=this.state.value!==null&&this.state.value!==void 0&&y.find(p=>p.value==this.state.value),this.state.value!==null&&this.state.value!==void 0&&!l&&this.props.schema.freeSolo&&(l={value:this.state.value,label:this.state.value},y.push(l)),l=l||null),y.length?M.createElement(O.Autocomplete,{value:l,fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,options:y,isOptionEqualToValue:(p,d)=>p.value===d.value,filterOptions:(p,d)=>{const s=p.filter(c=>d.inputValue===""?!0:c.label.toLowerCase().includes(d.inputValue.toLowerCase())||c.value.toLowerCase().includes(d.inputValue.toLowerCase()));return this.props.schema.freeSolo&&d.inputValue!==""&&s.push({label:d.inputValue,value:d.inputValue}),s},getOptionLabel:p=>(p==null?void 0:p.label)??"",onInputChange:p=>{if(!p||!this.props.schema.freeSolo)return;const d=p.target.value;d!==this.state.value&&this.setState({value:d},()=>this.onChange(this.props.attr,d))},onChange:(p,d)=>{const s=typeof d=="object"?d?d.value:"":d;s!==this.state.value&&this.setState({value:s},()=>this.onChange(this.props.attr,s))},renderInput:p=>M.createElement(O.TextField,{variant:"standard",...p,error:!!t,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:n})}):M.createElement(O.TextField,{variant:"standard",fullWidth:!0,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!t,disabled:n,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},onChange:p=>{const d=p.target.value;this.setState({value:d},()=>this.onChange(this.props.attr,(d||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const fn={fullWidth:{width:"100%"},flex:{display:"flex"},button:{height:48,marginLeft:4,minWidth:48}};class Is extends K{componentDidMount(){super.componentDidMount();const{data:t,attr:n}=this.props,l=K.getValue(t,n)||"";this.setState({value:l,showDialog:!1})}renderItem(t,n){const{schema:l,attr:y}=this.props,{value:a,showDialog:p}=this.state;return M.createElement(O.FormControl,{style:fn.fullWidth,variant:"standard"},l.label?M.createElement(O.InputLabel,{shrink:!0},this.getText(l.label)):null,M.createElement("div",{style:fn.flex},M.createElement(O.TextField,{variant:"standard",fullWidth:!0,value:a??"",error:!!t,disabled:n,placeholder:this.getText(l.placeholder),label:this.getText(l.label),helperText:this.renderHelp(l.help,l.helpLink,l.noTranslation),onChange:d=>{const s=d.target.value;this.setState({value:s},()=>this.onChange(y,s))}}),M.createElement(O.Button,{color:"grey",disabled:n,style:fn.button,size:"small",variant:"outlined",onClick:()=>this.setState({showDialog:!0})},"...")),p?M.createElement(j.DialogCron,{title:j.I18n.t("ra_Define schedule"),simple:l.simple,complex:l.complex,cron:a,onClose:()=>this.setState({showDialog:!1}),cancel:j.I18n.t("ra_Cancel"),ok:j.I18n.t("ra_Ok"),theme:this.props.oContext.theme,onOk:d=>this.setState({showDialog:!1,value:d},()=>this.onChange(y,d))}):null)}}class Fs extends K{async componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr),l=(await this.props.oContext.socket.getCertificates()).filter(y=>{const a=this.props.attr.toLowerCase();return a.includes(y.type)||y.type==="public"&&a.includes("cert")||y.type==="private"&&(a.includes("priv")||a.includes("key"))?!0:!!(y.type==="chained"&&(a.includes("chain")||a.includes("ca")))}).map(y=>({label:y.name,value:y.name}));l.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.setState({value:t,selectOptions:l})}renderItem(t,n){var y,a;if(!this.state.selectOptions)return null;const l=(y=this.state.selectOptions)==null?void 0:y.find(p=>p.value===this.state.value);return M.createElement(O.FormControl,{style:{width:"100%"},variant:"standard"},this.props.schema.label?M.createElement(O.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,M.createElement(O.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:this.state.value,renderValue:()=>this.getText(l==null?void 0:l.label,this.props.schema.noTranslation!==!1),onChange:p=>this.setState({value:p.target.value},()=>this.onChange(this.props.attr,this.state.value))},(a=this.state.selectOptions)==null?void 0:a.map(p=>M.createElement(O.MenuItem,{key:p.value,value:p.value,style:p.value===K.NONE_VALUE?{opacity:.5}:{}},this.getText(p.label,this.props.schema.noTranslation!==!1)))),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const At={fullWidth:{width:"100%"},leWidth:{width:620,marginBottom:10},certWidth:{width:200,marginRight:10}};class Rs extends K{async componentDidMount(){var d;super.componentDidMount();const t=await this.props.oContext.socket.getCertificates(),n=[],l=[],y=[];let a=[];const p=await this.props.oContext.socket.getObject("system.certificates");(d=p==null?void 0:p.native)!=null&&d.collections?a=Object.keys(p.native.collections):a=null,t.forEach(s=>{s.type==="public"?n.push({label:s.name,value:s.name}):s.type==="private"?l.push({label:s.name,value:s.name}):s.type==="chained"?y.push({label:s.name,value:s.name}):(n.push({label:s.name,value:s.name}),l.push({label:s.name,value:s.name}),y.push({label:s.name,value:s.name}))}),n.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),l.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),y.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.setState({certsPublicOptions:n,certsChainOptions:y,certsPrivateOptions:l,collectionsOptions:a})}renderItem(t,n){var e,i,o,h,r,u,f;if(!this.state.certsPublicOptions||!this.state.certsPrivateOptions||!this.state.certsChainOptions)return null;const l=(K.getValue(this.props.data,this.props.schema.leCollectionName||"leCollection")||"false").toString(),y=K.getValue(this.props.data,this.props.schema.certPublicName||"certPublic"),a=K.getValue(this.props.data,this.props.schema.certPrivateName||"certPrivate"),p=K.getValue(this.props.data,this.props.schema.certChainedName||"certChained"),d=(e=this.state.certsPublicOptions)==null?void 0:e.find(g=>g.value===y),s=(i=this.state.certsPrivateOptions)==null?void 0:i.find(g=>g.value===a),c=(o=this.state.certsChainOptions)==null?void 0:o.find(g=>g.value===p);return M.createElement("div",{style:At.fullWidth},this.state.collectionsOptions?M.createElement(O.FormControl,{style:At.leWidth,variant:"standard"},M.createElement(O.InputLabel,{shrink:!0},"Let's encrypt"),M.createElement(O.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:l,onChange:g=>this.onChange(this.props.schema.leCollectionName||"leCollection",g.target.value==="false"?!1:g.target.value==="true"?!0:g.target.value)},M.createElement(O.MenuItem,{key:"_false",value:"false",style:{fontWeight:"bold"}},j.I18n.t("ra_Do not use let's encrypt")),M.createElement(O.MenuItem,{key:"_true",value:"true",style:{fontWeight:"bold"}},j.I18n.t("ra_Use all available let's encrypt certificates")),(h=this.state.collectionsOptions)==null?void 0:h.map(g=>M.createElement(O.MenuItem,{key:g,value:g},g)))):null,this.state.collectionsOptions?M.createElement("br",null):null,this.state.collectionsOptions&&l!=="false"?M.createElement("div",null,j.I18n.t("ra_Fallback custom certificates")):null,M.createElement(O.FormControl,{style:At.certWidth,variant:"standard"},M.createElement(O.InputLabel,{shrink:!0},j.I18n.t("ra_Public certificate")),M.createElement(O.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:y||"",renderValue:()=>this.getText(d==null?void 0:d.label),onChange:g=>this.onChange(this.props.schema.certPublicName||"certPublic",g.target.value)},(r=this.state.certsPublicOptions)==null?void 0:r.map((g,v)=>M.createElement(O.MenuItem,{key:`${g.value}_${v}`,value:g.value,style:g.value===K.NONE_VALUE?{opacity:.5}:{}},this.getText(g.label))))),M.createElement(O.FormControl,{style:At.certWidth,variant:"standard"},M.createElement(O.InputLabel,{shrink:!0},j.I18n.t("ra_Private certificate")),M.createElement(O.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:a||"",renderValue:()=>this.getText(s==null?void 0:s.label),onChange:g=>this.onChange(this.props.schema.certPrivateName||"certPrivate",g.target.value)},(u=this.state.certsPrivateOptions)==null?void 0:u.map((g,v)=>M.createElement(O.MenuItem,{key:`${g.value}_${v}`,value:g.value,style:g.value===K.NONE_VALUE?{opacity:.5}:{}},this.getText(g.label))))),M.createElement(O.FormControl,{style:At.certWidth,variant:"standard"},M.createElement(O.InputLabel,{shrink:!0},j.I18n.t("ra_Chained certificate")),M.createElement(O.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:p||"",renderValue:()=>this.getText(c==null?void 0:c.label),onChange:g=>this.onChange(this.props.schema.certChainedName||"certChained",g.target.value)},(f=this.state.certsChainOptions)==null?void 0:f.map((g,v)=>M.createElement(O.MenuItem,{key:`${g.value}_${v}`,value:g.value,style:g.value===K.NONE_VALUE?{opacity:.5}:{}},this.getText(g.label))))))}}class Os extends K{async componentDidMount(){var l;super.componentDidMount();let t;const n=await this.props.oContext.socket.getObject("system.certificates");(l=n==null?void 0:n.native)!=null&&l.collections?t=Object.keys(n.native.collections):t=[],this.setState({collectionsOptions:t})}renderItem(t,n){var y;if(!this.state.collectionsOptions)return null;const l=(K.getValue(this.props.data,this.props.schema.leCollectionName||"leCollection")||"false").toString();return M.createElement(O.FormControl,{style:{width:"100%"},variant:"standard"},this.props.schema.label?M.createElement(O.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,M.createElement(O.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:l,onChange:a=>this.onChange(this.props.schema.leCollectionName||"leCollection",a.target.value==="false"?!1:a.target.value==="true"?!0:a.target.value)},M.createElement(O.MenuItem,{key:"_false",value:"false",style:{fontWeight:"bold"}},j.I18n.t("ra_Do not use let's encrypt")),M.createElement(O.MenuItem,{key:"_true",value:"true",style:{fontWeight:"bold"}},j.I18n.t("ra_Use all available let's encrypt certificates")),(y=this.state.collectionsOptions)==null?void 0:y.map(a=>M.createElement(O.MenuItem,{key:a,value:a},a))),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const _e={fullWidth:{width:"100%"},licLabel:{fontWeight:"bold",minWidth:100,marginRight:10,textTransform:"capitalize",display:"inline-block"},errorTitle:L=>({color:L.palette.mode==="dark"?"#e39191":"#b62020"}),okTitle:L=>({color:L.palette.mode==="dark"?"#6fd56f":"#007c00"}),errorText:L=>({color:L.palette.mode==="dark"?"#e39191":"#b62020",mb:"30px"})};class Ze extends K{componentDidMount(){super.componentDidMount(),this.setState({_error:"",running:!1,showLicenseData:null,foundSuitableLicense:!1,licenseOfflineCheck:!1,result:null,allLicenses:null,askForUpdate:!1,showLinkToProfile:!1})}renderErrorDialog(){if(this.state._error&&!this.state.showLicenseData){let t=this.state._error;return this.state.allLicenses&&(t=[M.createElement("div",{key:"error"},t)],t.push(M.createElement(O.Button,{key:"button",variant:"contained",onClick:()=>window.open("https://iobroker.net/www/account/licenses","_blank")},j.I18n.t("iobroker.net"))),this.state.allLicenses.length?t.push(M.createElement(O.TableContainer,{key:"table"},M.createElement(O.Table,{size:"small"},M.createElement(O.TableHead,null,M.createElement(O.TableRow,null,M.createElement(O.TableCell,null,j.I18n.t("ra_Product")),M.createElement(O.TableCell,null,j.I18n.t("ra_Version")),M.createElement(O.TableCell,null,"UUID"),M.createElement(O.TableCell,null,j.I18n.t("ra_ValidTill")),M.createElement(O.TableCell,null,j.I18n.t("ra_Commercial")),M.createElement(O.TableCell,null,"ID"))),M.createElement(O.TableBody,null,this.state.allLicenses.map(n=>M.createElement(O.TableRow,{key:n.id},M.createElement(O.TableCell,{sx:n.validName?null:_e.errorText},n.license.product),M.createElement(O.TableCell,{sx:n.validVersion?null:_e.errorText},n.license.version),M.createElement(O.TableCell,{sx:n.validUuid?null:_e.errorText},n.license.uuid||"--"),M.createElement(O.TableCell,{sx:n.validTill?null:_e.errorText},n.license.validTill&&n.license.validTill!=="0000-00-00 00:00:00"?new Date(n.license.validTill).toLocaleDateString():"--"),M.createElement(O.TableCell,null,n.license.invoice!=="free"?n.license.invoice==="MANUALLY_CREATED"?"✓":n.license.invoice:"-"),M.createElement(O.TableCell,null,n.id))))))):(t.push(M.createElement("div",{key:"text1"},j.I18n.t("ra_No one license found in license manager"))),t.push(M.createElement("div",{key:"text2"},j.I18n.t("ra_Please create license"))))),M.createElement(O.Dialog,{open:!0,maxWidth:"xl",fullWidth:this.props.fullWidth!==void 0?this.props.fullWidth:!0,onClick:()=>this.setState({_error:"",allLicenses:null})},M.createElement(O.DialogTitle,null,j.I18n.t("ra_Error")),M.createElement(O.DialogContent,null,M.createElement(O.DialogContentText,null,t)),M.createElement(O.DialogActions,null,M.createElement(O.Button,{variant:"contained",onClick:()=>this.setState({_error:"",allLicenses:null}),color:"primary",autoFocus:!0,startIcon:M.createElement(X.Check,null)},j.I18n.t("ra_Ok"))))}return null}renderMessageDialog(){if(this.state.showLicenseData){const t=[],n=this.state.showLicenseData;return Object.keys(n).forEach(l=>{if(!(n[l]===null||n[l]===void 0))if(typeof n[l]=="object"){const y=n[l];Object.keys(y).forEach(a=>{y[a]!==null&&y[a]!==void 0&&(typeof y[a]=="object"?t.push(M.createElement("div",{key:a},M.createElement("div",{style:_e.licLabel},a,":"),JSON.stringify(y[a],null,2))):t.push(M.createElement("div",{key:a},M.createElement("div",{style:_e.licLabel},l," -",a,":"),y[a].toString())))})}else t.push(M.createElement("div",{key:l},M.createElement("div",{style:_e.licLabel},l.replace(/_/g," "),":"),n[l].toString()))}),t.push(M.createElement("div",{key:"checked"},M.createElement("div",{style:_e.licLabel},j.I18n.t("ra_Checked"),":"),this.state.licenseOfflineCheck?j.I18n.t("ra_locally"):j.I18n.t("ra_via internet"))),M.createElement(O.Dialog,{open:!0,onClose:()=>this.setState({showLicenseData:null})},M.createElement(O.DialogTitle,null,M.createElement(O.Box,{component:"span",sx:this.state.result?_e.okTitle:_e.errorTitle},j.I18n.t("ra_License %s",this.state.result?"OK":"INVALID"))),M.createElement(O.DialogContent,null,this.state.showLinkToProfile?M.createElement(O.Button,{variant:"contained",onClick:()=>window.open("https://iobroker.net/www/account/licenses","_blank")},"https://iobroker.net"):null,this.state._error?M.createElement(O.Box,{component:"div",sx:_e.errorText},this.state._error):null,t),M.createElement(O.DialogActions,null,M.createElement(O.Button,{onClick:()=>this.setState({showLicenseData:null,_error:""}),color:"primary",variant:"contained"},j.I18n.t("ra_Close"))))}return null}static parseJwt(t){const l=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),y=decodeURIComponent(atob(l).split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));try{return JSON.parse(y)}catch{return null}}static isVersionValid(t,n,l,y){if(!n||!t)return!0;let a=!0;const[p]=t.split(".");return n.startsWith(">=")?a=parseInt(p,10)>=parseInt(n.substring(2,10)):n.startsWith("<=")?a=parseInt(p,10)<=parseInt(n.substring(2,10)):n.startsWith(">")?a=parseInt(p,10)>parseInt(n.substring(1,10)):n.startsWith("<")?a=parseInt(p,10)<parseInt(n.substring(1,10)):n.startsWith("=")?a=parseInt(p,10)===parseInt(n.substring(1,10)):n.startsWith("==")?a=parseInt(p,10)===parseInt(n.substring(2,10)):n.startsWith("===")&&(a=parseInt(p,10)===parseInt(n.substring(3,10))),!0}async findInLicenseManager(t){var y,a,p,d;const n=await this.props.oContext.socket.getObject("system.licenses"),l=[];if((a=(y=n==null?void 0:n.native)==null?void 0:y.licenses)!=null&&a.length){let s=null;const c=Date.now();let e;if(this.props.schema.uuid){const o=await this.props.oContext.socket.getObject("system.meta.uuid");e=(p=o==null?void 0:o.native)==null?void 0:p.uuid}let i;if(this.props.schema.version){const o=await this.props.oContext.socket.getObject(`system.adapter.${t}`);i=(d=o==null?void 0:o.common)==null?void 0:d.version}n.native.licenses.forEach(o=>{const h=!o.validTill||o.validTill==="0000-00-00 00:00:00"||new Date(o.validTill).getTime()>c,r=(o.product||"").split("."),u=r[1]===t||t==="vis-2"&&r[1]==="vis",f=!e||!o.uuid||o.uuid===e,g=Ze.isVersionValid(i,o.version,o.invoice,t);(!s||o.invoice!=="free")&&h&&u&&f&&g&&(s=o),l.push({id:o.id,validName:u,validUuid:f,validVersion:g,validTill:h,license:o})}),s&&(l.find(o=>o.id===s.id).used=!0)}return l}async checkLicense(t,n){var d,s,c;let l;if(this.props.schema.uuid){const e=await this.props.oContext.socket.getObject("system.meta.uuid");l=(d=e==null?void 0:e.native)==null?void 0:d.uuid}let y;if(this.props.schema.version){const e=await this.props.oContext.socket.getObject(`system.adapter.${n}`);y=(s=e==null?void 0:e.common)==null?void 0:s.version}const a=new AbortController;let p=setTimeout(()=>{p=null,a.abort()},5e3);try{const e=await window.fetch("https://iobroker.net/api/v1/public/cert/",{method:"POST",body:JSON.stringify({json:t,uuid:l}),headers:{"Content-Type":"text/plain"},signal:a.signal});p&&clearTimeout(p);const i=await e.text();let o;try{o=JSON.parse(i)}catch{}if(o!=null&&o.error)try{const h=Ze.parseJwt(t),r=j.I18n.t(`ra_${h.error||o.error||"Unknown error"}`).replace(/^ra_/,"");return this.setState({_error:r,licenseOfflineCheck:!1,showLicenseData:h,result:!1,running:!1})}catch{return console.log("Cannot parse license"),this.setState({_error:o.error,result:!1,running:!1})}else{let h=null;try{h=Ze.parseJwt(t)}catch{}if(o){const r=o.validTill||o.valid_till;if(r&&r!=="0000-00-00 00:00:00"&&new Date(r).getTime()<Date.now())return this.setState({_error:j.I18n.t("ra_License expired on %s",new Date(r).toLocaleString()),licenseOfflineCheck:!1,showLicenseData:h,result:!1,running:!1});const u=(o.name||"").split(".");return u[1]===n||u[1]==="vis"&&n==="vis-2"?l&&!o.uuid&&n==="vis-2"?this.setState({_error:j.I18n.t("ra_License must be converted",o.uuid),showLinkToProfile:!0,licenseOfflineCheck:!1,showLicenseData:h,result:!1,running:!1}):l&&o.uuid&&o.uuid!==l?this.setState({_error:j.I18n.t('ra_Serial number (UUID) "%s" in license is for other device.',o.uuid),licenseOfflineCheck:!1,showLicenseData:h,result:!1,running:!1}):Ze.isVersionValid(y,o.version,o.invoice,n)?this.setState({licenseOfflineCheck:!1,showLicenseData:h,result:!0,running:!1}):this.setState({_error:j.I18n.t("ra_License is for version %s, but required version is %s",o.version,this.props.schema.version),licenseOfflineCheck:!1,showLicenseData:h,result:!1,running:!1}):this.setState({_error:j.I18n.t('ra_License for other product "%s"',o.name),licenseOfflineCheck:!1,showLicenseData:h,result:!1,running:!1})}throw new Error("ra_Invalid answer from server")}}catch(e){if(((c=e==null?void 0:e.response)==null?void 0:c.status)===404)return this.setState({_error:j.I18n.t("ra_License does not exist"),result:!1,running:!1});try{const i=Ze.parseJwt(t),o=(i.name||"").split(".");return i.valid_till&&i.valid_till!=="0000-00-00 00:00:00"&&new Date(i.valid_till).getTime()<Date.now()?this.setState({_error:j.I18n.t("ra_License expired on %s",new Date(i.valid_till).toLocaleString()),showLicenseData:i,licenseOfflineCheck:!0,running:!1,result:!1}):o[1]===n?l&&i.uuid&&i.uuid!==l?this.setState({_error:j.I18n.t('ra_Serial number (UUID) "%s" in license is for other device.',i.uuid),showLicenseData:i,licenseOfflineCheck:!0,result:!1,running:!1}):Ze.isVersionValid(y,i.version,i.invoice,n)?this.setState({running:!1,result:!0,licenseOfflineCheck:!0,showLicenseData:i}):this.setState({_error:j.I18n.t("ra_License is for version %s, but required version is %s",i.version,this.props.schema.version),licenseOfflineCheck:!0,showLicenseData:i,result:!1,running:!1}):this.setState({_error:j.I18n.t('ra_License for other product "%s"',i.name),licenseOfflineCheck:!0,showLicenseData:i,result:!1,running:!1})}catch{return this.setState({_error:j.I18n.t("ra_Cannot decode license"),result:!1,licenseOfflineCheck:!0,running:!1})}}}renderAskForUpdate(){return this.state.askForUpdate?M.createElement(j.DialogConfirm,{text:j.I18n.t("ra_License not found in license manager. Do you want to read licenses from iobroker.net?"),ok:j.I18n.t("ra_Yes"),onClose:async t=>{if(t){this.setState({askForUpdate:!1});try{await this.props.oContext.socket.updateLicenses(null,null)}catch(n){window.alert(j.I18n.t("ra_Cannot read licenses: %s",n));return}await this._onClick(!0)}else this.setState({askForUpdate:!1,running:!1})}}):null}async _onClick(t){const n=this.props.oContext.adapterName==="vis-2"?"vis":this.props.oContext.adapterName;this.setState({running:!0});let l,y;if(this.props.data.useLicenseManager){if(y=await this.findInLicenseManager(n),l=y.find(a=>a.used),l&&(l=l.license.json),!l&&!t){this.setState({askForUpdate:!0});return}}else l=this.props.data.license;l?await this.checkLicense(l,n):this.props.data.useLicenseManager?this.setState({_error:j.I18n.t("ra_Suitable license not found in license manager"),result:!1,running:!1,allLicenses:y}):this.setState({_error:j.I18n.t("ra_Please enter the license"),result:!1,running:!1})}renderItem(){return M.createElement("div",{style:_e.fullWidth},M.createElement(O.Button,{variant:this.props.schema.variant||"outlined",color:this.props.schema.color||"primary",style:_e.fullWidth,disabled:!this.props.data.license&&!this.props.data.useLicenseManager||this.state.running,startIcon:M.createElement(X.Send,null),onClick:()=>this._onClick()},this.state.running?M.createElement(O.CircularProgress,{size:20,style:{marginRight:8}}):null,this.getText(this.props.schema.label||"ra_Check license",this.props.schema.noTranslation)),this.renderMessageDialog(),this.renderErrorDialog(),this.renderAskForUpdate())}}class Ns extends K{renderItem(t,n){const l=K.getValue(this.props.data,this.props.attr),y=Array.isArray(l);return M.createElement(O.FormControl,{style:{width:"100%"},variant:"standard"},M.createElement(O.FormControlLabel,{onClick:a=>{if(a.preventDefault(),a.stopPropagation(),!n){const p=this.onChange(this.props.attr,!l);p instanceof Promise&&p.catch(d=>console.error(`Cannot set value: ${d}`))}},control:M.createElement(O.Checkbox,{indeterminate:y,checked:!!l,onChange:a=>{let p;y?p=this.onChange(this.props.attr,!0):p=this.onChange(this.props.attr,a.target.checked),p instanceof Promise&&p.catch(d=>console.error(`Cannot set value: ${d}`))},disabled:n||this.props.schema.readOnly}),label:this.getText(this.props.schema.label)}),M.createElement(O.FormHelperText,{style:{color:"red"}},t?this.props.schema.validatorErrorText?j.I18n.t(this.props.schema.validatorErrorText):j.I18n.t("ra_Error"):null),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Bs={standard:O.Input,filled:ns,outlined:O.OutlinedInput},Ps=L=>{const t=L.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return{root:{},inputRoot:{display:"inline-flex",flexWrap:"wrap",flex:1,marginTop:0,minWidth:70,"&.mui-variant-outlined,&.mui-variant-filled":{boxSizing:"border-box"},"&.mui-variant-outlined":{paddingTop:"14px"},"&.mui-variant-filled":{paddingTop:"28px"}},input:{display:"inline-block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",appearance:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",float:"left",flex:1},chipContainer:{display:"flex",flexFlow:"row wrap",alignItems:"center",cursor:"text",marginBottom:"-2px",minHeight:40},outlined:{"& input":{height:16,paddingTop:"4px",paddingBottom:"12px",marginTop:"4px",marginBottom:"4px"}},standard:{marginTop:"18px"},filled:{"& input":{height:22,marginBottom:"4px",marginTop:"4px",paddingTop:0},"$marginDense & input":{height:26}},labeled:{},label:{top:4,"&$outlined&:not($labelShrink)":{top:2,"$marginDense &":{top:5}},"&$filled&:not($labelShrink)":{top:15,"$marginDense &":{top:20}}},labelShrink:{top:0},helperText:{marginBottom:-20},focused:{},disabled:{},underline:{"&:after":{borderBottom:`2px solid ${L.palette.primary[t?"dark":"light"]}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:L.transitions.create("transform",{duration:L.transitions.duration.shorter,easing:L.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:L.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:L.transitions.create("border-bottom-color",{duration:L.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:not($disabled):not($focused):not($error):before":{borderBottom:`2px solid ${L.palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{"&:after":{backgroundColor:L.palette.error.main,transform:"scaleX(1)"}},chip:{margin:"0 8px 8px 0",float:"left"},marginDense:{}}},Ht={BACKSPACE:8,DELETE:46,LEFT_ARROW:37,RIGHT_ARROW:39},Ws=({value:L,isFocused:t,isDisabled:n,isReadOnly:l,handleClick:y,handleDelete:a,style:p},d)=>M.createElement(O.Chip,{key:d,style:{...p,pointerEvents:n||l?"none":void 0,backgroundColor:t?is[300]:void 0},onClick:y,onDelete:a,label:L});class zs extends M.Component{labelRef;labelNode=null;input;newChipKeyCodes;newChipKeys;actualInput=null;inputBlurTimeout=null;_keyPressed;_preventChipCreation;styles={};styleTheme=null;constructor(t){super(t),this.state={chips:t.defaultValue||[],focusedChip:null,inputValue:"",isFocused:!1,chipsUpdated:!1,prevPropsValue:[],variant:this.props.variant||"standard"},this.newChipKeyCodes=t.newChipKeyCodes||[13],this.newChipKeys=t.newChipKeys||["Enter"],this.labelRef=M.createRef(),this.input=M.createRef()}componentDidMount(){this.state.variant==="outlined"&&(this.labelNode=ts.findDOMNode(this.labelRef.current),this.forceUpdate())}componentWillUnmount(){this.inputBlurTimeout&&clearTimeout(this.inputBlurTimeout)}static getDerivedStateFromProps(t,n){let l=null;return t.value&&t.value.length!==n.prevPropsValue.length&&(l={prevPropsValue:t.value},t.clearInputValueOnChange&&(l.inputValue="")),t.clearInputValueOnChange&&t.value&&t.value.length!==n.prevPropsValue.length&&(l={prevPropsValue:t.value,inputValue:""}),t.disabled&&(l={...l,focusedChip:null}),!n.chipsUpdated&&t.defaultValue&&(l={...l,chips:t.defaultValue}),l}focus=()=>{var t;(t=this.actualInput)==null||t.focus(),this.state.focusedChip&&this.setState({focusedChip:null})};handleInputBlur=t=>{this.props.onBlur&&this.props.onBlur(t),this.setState({isFocused:!1}),this.state.focusedChip&&this.setState({focusedChip:null});const n=t.target.value;let l;switch(this.props.blurBehavior||"clear"){case"add-or-clear":l={clearInputOnFail:!0};case"add":if(this.props.delayBeforeAdd){const y=(this.props.value||this.state.chips).length;this.inputBlurTimeout=setTimeout(()=>{const a=(this.props.value||this.state.chips).length;y===a?this.handleAddChip(n,l):this.clearInput()},150)}else this.handleAddChip(n,l);break;case"clear":this.clearInput();break}};handleInputFocus=t=>{this.setState({isFocused:!0}),this.props.onFocus&&this.props.onFocus(t)};handleKeyDown=t=>{const{focusedChip:n}=this.state;if(this._keyPressed=!1,this._preventChipCreation=!1,this.props.onKeyDown&&(this.props.onKeyDown(t),t.isDefaultPrevented()))return;const l=this.props.value||this.state.chips;if(this.newChipKeyCodes.includes(t.keyCode)||this.newChipKeys.includes(t.key)){this.handleAddChip(t.target.value)!==!1&&t.preventDefault();return}switch(t.keyCode){case Ht.BACKSPACE:t.target.value===""&&(n?(this.handleDeleteChip(l[n],n),n&&this.setState({focusedChip:n-1})):this.setState({focusedChip:l.length-1}));break;case Ht.DELETE:t.target.value===""&&n&&(this.handleDeleteChip(l[n],n),n<=l.length-1&&this.setState({focusedChip:n}));break;case Ht.LEFT_ARROW:n===null&&t.target.value===""&&l.length?this.setState({focusedChip:l.length-1}):n!==null&&n>0&&this.setState({focusedChip:n-1});break;case Ht.RIGHT_ARROW:n!==null&&n<l.length-1?this.setState({focusedChip:n+1}):this.setState({focusedChip:null});break;default:this.setState({focusedChip:null});break}};handleKeyUp=t=>{!this._preventChipCreation&&(this.newChipKeyCodes.includes(t.keyCode)||this.newChipKeys.includes(t.key))&&this._keyPressed?this.clearInput():this.updateInput(t.target.value),this.props.onKeyUp&&this.props.onKeyUp(t)};handleUpdateInput=t=>{(this.props.inputValue===null||this.props.inputValue===void 0)&&this.updateInput(t.target.value),this.props.onUpdateInput&&this.props.onUpdateInput(t)};handleAddChip(t,n){if(this.props.onBeforeAdd&&!this.props.onBeforeAdd(t))return this._preventChipCreation=!0,n&&n.clearInputOnFail&&this.clearInput(),!1;this.clearInput();const l=this.props.value||this.state.chips;return t.trim().length?((this.props.allowDuplicates||!l.includes(t))&&(this.props.value&&this.props.onAdd?this.props.onAdd(t):this.updateChips([...this.state.chips,t])),!0):!1}handleDeleteChip(t,n){if(this.props.value)this.props.onDelete&&this.props.onDelete(t,n);else{const l=this.state.chips.slice();if(l.splice(n,1)){let a=this.state.focusedChip;this.state.focusedChip===n?a=null:this.state.focusedChip>n&&(a=this.state.focusedChip-1),this.updateChips(l,{focusedChip:a})}}}updateChips(t,n={}){this.setState({chips:t,chipsUpdated:!0,...n}),this.props.onChange&&this.props.onChange(t)}clearInput(){this.updateInput("")}updateInput(t){this.setState({inputValue:t})}setActualInputRef=t=>{this.actualInput=t,this.props.inputRef&&this.props.inputRef(t)};render(){const{alwaysShowPlaceholder:t,chipRenderer:n=Ws,className:l,disabled:y,disableUnderline:a,error:p,FormHelperTextProps:d,fullWidth:s,fullWidthInput:c,helperText:e,id:i,InputProps:o={},InputLabelProps:h={},inputValue:r,label:u,placeholder:f,readOnly:g,required:v,rootRef:A,value:E,margin:w}=this.props,m=this.state.variant;this.styleTheme!==this.props.theme.palette.mode&&(this.styleTheme=this.props.theme.palette.mode,this.styles=j.Utils.getStyle(this.props.theme,Ps));let S=E||this.state.chips||[];Array.isArray(S)||(S=(S||"").toString().split(/[,\s]+/).map(C=>C.trim()));const k=r??this.state.inputValue,D=(this.props.value||k).length||k.length,_=typeof h.shrink=="boolean"?h.shrink:u!==null&&(D||this.state.isFocused||S.length),F=S.map((C,b)=>n({value:C,isDisabled:!!y,isReadOnly:g,isFocused:this.state.focusedChip===b,handleClick:()=>this.setState({focusedChip:b}),handleDelete:()=>this.handleDeleteChip(C,b),style:this.styles.chip},b.toString())),x={};m==="outlined"&&(x.notched=!!_,x.labelWidth=_&&this.labelNode&&this.labelNode.offsetWidth||0),m!=="standard"?x.startAdornment=F:o.disableUnderline=!0;const $=Bs[m];return M.createElement(O.FormControl,{ref:A,fullWidth:s,className:l,sx:{...this.styles.root,...w==="dense"?this.styles.marginDense:{}},error:p,required:S.length>0?void 0:v,onClick:this.focus,disabled:y,variant:m,component:"div",margin:w},u&&M.createElement(O.InputLabel,{htmlFor:i,sx:{"&.MuiInputLabel-root":this.styles.label,"&.MuiInputLabel-shrink":this.styles.labelShrink},shrink:!!_,focused:this.state.isFocused,variant:m,ref:this.labelRef,required:v,component:"label",...h},u),M.createElement(O.Box,{component:"div",id:"input-chip-container",sx:{...this.styles[m],...this.styles.chipContainer,...this.state.isFocused?this.styles.focused:void 0,...!a&&m==="standard"?this.styles.underline:void 0,...y?this.styles.disabled:void 0,...u?this.styles.labeled:void 0,...p?this.styles.error:void 0}},m==="standard"&&F,M.createElement($,{ref:this.input,className:`mui-variant-${this.styles[m]} ${u?"mui-chip-with-label":"mui-chip-no-label"}`,sx:{"&.MuiInputBase-input":{...this.styles.input,...this.styles[m]},"&.MuiInputBase-root":{...this.styles.inputRoot}},id:i,value:k,onChange:this.handleUpdateInput,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,inputRef:this.setActualInputRef,disabled:y,fullWidth:c,placeholder:!D&&(_||u===null||u===void 0)||t?f:null,readOnly:g,...o,...x})),e&&M.createElement(O.FormHelperText,{...d,className:d==null?void 0:d.className,style:this.styles.helperText},e))}}class ii extends K{componentDidMount(){super.componentDidMount();const{data:t,attr:n}=this.props,l=K.getValue(t,n);if(this.props.schema.delimiter&&typeof l=="string"){const y=l.split(this.props.schema.delimiter).map(a=>a.trim()).filter(a=>a);this.setState({value:y})}else this.setState({value:l||[]})}renderItem(t,n){const{attr:l,schema:y}=this.props,{value:a}=this.state;return M.createElement(O.FormControl,{fullWidth:!0,variant:"standard"},M.createElement(zs,{value:a,disabled:!!n,label:this.getText(y.label),error:!!t,onAdd:p=>{const d=JSON.parse(JSON.stringify(a));d.push(p),this.setState({value:d},()=>{let s;this.props.schema.delimiter?s=this.onChange(l,d.join(`${this.props.schema.delimiter} `)):s=this.onChange(l,d),s instanceof Promise&&s.catch(c=>console.error(c))})},theme:this.props.oContext.theme,onDelete:(p,d)=>{const s=JSON.parse(JSON.stringify(a));s.splice(d,1),this.setState({value:s},()=>{let c;this.props.schema.delimiter?c=this.onChange(l,s.join(`${this.props.schema.delimiter} `)):c=this.onChange(l,s),c instanceof Promise&&c.catch(e=>console.error(e))})}}),M.createElement(O.FormHelperText,null,j.I18n.t("ra_Press ENTER Key to add new item")),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Hs extends K{renderColorDialog(){return!!this.state.showColorDialog&&M.createElement(O.Dialog,{onClose:()=>this.setState({showColorDialog:!1}),open:this.state.showColorDialog},M.createElement(Zr,{color:this.state.colorDialogValue,onChange:t=>this.setState({colorDialogValue:t.hex},()=>this.onChange(this.props.attr,this.state.colorDialogValue))}))}renderItem(t,n){const l=K.getValue(this.props.data,this.props.attr);let y=j.Utils.isUseBright(l,null);return y===null&&(y=void 0),M.createElement(M.Fragment,null,this.renderColorDialog(),M.createElement(O.TextField,{variant:"standard",disabled:!!n,style:{minWidth:100,width:"calc(100% - 8px)"},label:this.getText(this.props.schema.label),value:l||"",onClick:()=>!this.props.schema.readOnly&&this.setState({showColorDialog:!0,colorDialogValue:l||""}),onChange:a=>{const p=a.target.value,d=this.onChange(this.props.attr,p);d instanceof Promise&&d.catch(s=>console.error(`Cannot set value: ${s}`))},slotProps:{htmlInput:{style:{backgroundColor:l,color:y?"#FFF":"#000"},readOnly:this.props.schema.readOnly||!1},input:{endAdornment:!this.props.schema.readOnly&&l&&!this.props.schema.noClearButton?M.createElement(O.IconButton,{tabIndex:-1,size:"small",onClick:a=>{a.stopPropagation();const p=this.onChange(this.props.attr,"");p instanceof Promise&&p.catch(d=>console.error(`Cannot set value: ${d}`))}},M.createElement(X.Close,null)):void 0},inputLabel:{shrink:!0}}}))}}const gn={width:{width:"calc(100% - 85px)"},width50:{width:120,marginRight:5}};class js extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.setState({value:t});const n={};this.props.schema.useSystemName&&(n.useSystem=!!K.getValue(this.props.data,this.props.schema.useSystemName)),this.props.schema.longitudeName&&this.props.schema.latitudeName?(n.longitude=K.getValue(this.props.data,this.props.schema.longitudeName),n.latitude=K.getValue(this.props.data,this.props.schema.latitudeName),!n.longitude&&!n.latitude&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300)):!K.getValue(this.props.data,this.props.attr)&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300),Object.keys(n).length&&setTimeout(()=>this.setState(n),50)}async getSystemCoordinates(){const t=await this.props.oContext.socket.getCompactSystemConfig();if(t!=null&&t.common&&(t.common.longitude||t.common.latitude))if(window.alert(j.I18n.t("ra_Used system settings")),this.props.schema.longitudeName&&this.props.schema.latitudeName)this.setState({longitude:t.common.longitude,latitude:t.common.latitude},async()=>{await this.onChange(this.props.schema.longitudeName,t.common.longitude),await this.onChange(this.props.schema.latitudeName,t.common.latitude)});else{const n=t.common.latitude+(this.props.schema.divider||",")+t.common.longitude;this.setState({value:n},()=>{const l=this.onChange(this.props.attr,n);l instanceof Promise&&l.catch(y=>console.error(`Cannot set value: ${y}`))})}else window.alert(j.I18n.t("ra_Cannot determine position: System settings are empty and GPS detection is disabled in browser"))}getCoordinates(){navigator.geolocation?navigator.geolocation.getCurrentPosition(async t=>{if(t!=null&&t.coords)if(this.props.schema.longitudeName&&this.props.schema.latitudeName)this.setState({longitude:t.coords.longitude,latitude:t.coords.latitude},async()=>{await this.onChange(this.props.schema.longitudeName,t.coords.longitude||""),await this.onChange(this.props.schema.latitudeName,t.coords.latitude||"")});else{const n=t.coords.latitude+(this.props.schema.divider||",")+t.coords.longitude;this.setState({value:n},()=>{const l=this.onChange(this.props.attr,n);l instanceof Promise&&l.catch(y=>console.error(`Cannot set value: ${y}`))})}else await this.getSystemCoordinates()},async t=>{console.error(`Cannot determine coordinates from browser: ${t.message}`),await this.getSystemCoordinates()}):this.getSystemCoordinates().catch(t=>{console.error(`Cannot determine coordinates: ${t}`)})}renderItem(t,n){return M.createElement(M.Fragment,null,this.props.schema.useSystemName?M.createElement(O.FormControlLabel,{control:M.createElement(O.Checkbox,{checked:!!this.state.useSystem,onChange:l=>{const y=l.target.checked;y&&this.getSystemCoordinates().catch(a=>console.error(`Cannot determine coordinates: ${a}`)),this.setState({useSystem:y},()=>this.onChange(this.props.schema.useSystemName,y))}}),label:j.I18n.t("ra_Use system settings for position")}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?M.createElement(O.TextField,{variant:"standard",style:gn.width50,value:this.state.longitude??"",error:!!t,disabled:this.state.useSystem||!!n,onChange:l=>{const y=l.target.value;this.setState({longitude:y},()=>{const a=this.onChange(this.props.schema.longitudeName,(y||"").trim());a instanceof Promise&&a.catch(p=>console.error(`Cannot set value: ${p}`))})},label:j.I18n.t("ra_Longitude")}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?M.createElement(O.TextField,{variant:"standard",style:gn.width50,value:this.state.latitude??"",error:!!t,disabled:this.state.useSystem||!!n,onChange:l=>{const y=l.target.value;this.setState({latitude:y},()=>this.onChange(this.props.schema.latitudeName,(y||"").trim()))},label:j.I18n.t("ra_Latitude")}):null,!this.props.schema.longitudeName||!this.props.schema.latitudeName?M.createElement(O.TextField,{variant:"standard",style:gn.width,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!t,disabled:!!n,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.state.useSystem}},onChange:l=>{const y=l.target.value;this.setState({value:y},()=>this.onChange(this.props.attr,(y||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}):null,this.state.useSystem?null:M.createElement(O.Fab,{size:"small",onClick:()=>this.getCoordinates(),title:j.I18n.t("ra_Take browser position"),style:{marginRight:4}},M.createElement(X.LocationOn,null)),this.state.useSystem?null:M.createElement(O.Fab,{size:"small",onClick:()=>this.getSystemCoordinates(),title:j.I18n.t("ra_Take position from system settings")},M.createElement(X.GpsFixed,null)))}}os({name:"iobroker_admin",shared:{"@iobroker/adapter-react-v5":{lib:()=>es,version:"*"},"@mui/icons-material":{lib:()=>qr,version:"*"},"@iobroker/json-config":{lib:()=>ls,version:"*"}},remotes:[]});class _t extends K{static runningLoads={};constructor(t){super(t),Object.assign(this.state,{Component:null,error:""})}async componentDidMount(){if(!this.props.schema.url){console.error("URL is empty. Cannot load custom component!"),this.setState({error:"URL is empty. Cannot load custom component!"});return}let t;this.props.schema.url.startsWith("http:")||this.props.schema.url.startsWith("https:")?t=this.props.schema.url:this.props.schema.url.startsWith("./")?t=`${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\./,"")}`:t=`${window.location.protocol}//${window.location.host}/adapter/${this.props.oContext.adapterName}/${this.props.schema.url}`;const[n,l,...y]=this.props.schema.name.split("/"),a=y.join("/");if(!t){console.error('Cannot find URL for custom component! Please define "url" as "custom/customComponents.js" in the schema');return}if(!n||!l||!a){console.error('Invalid format of "name"! Please define "name" as "ConfigCustomBackItUpSet/Components/AdapterExist" in the schema');return}let p=_t.runningLoads[`${t}!${l}`];if(!(p instanceof Promise)){let d;if(this.props.schema.i18n===!0){const s=t.lastIndexOf("/");let c;s!==-1?c=t.substring(0,s):c=t;const e=j.I18n.getLanguage(),i=`${c}/i18n/${e}.json`;d=fetch(i).then(o=>o.json()).then(o=>j.I18n.extendTranslations(o,e)).catch(o=>{if(e!=="en"){fetch(`${c}/i18n/en.json`).then(h=>h.json()).then(h=>j.I18n.extendTranslations(h,e)).catch(h=>console.log(`Cannot load i18n "${i}": ${h}`));return}console.log(`Cannot load i18n "${i}": ${o}`)})}else if(this.props.schema.i18n&&typeof this.props.schema.i18n=="object")try{j.I18n.extendTranslations(this.props.schema.i18n)}catch(s){console.error(`Cannot import i18n: ${s}`)}try{console.log(t,n,l,a),rs([{name:n,entry:t,type:this.props.schema.bundlerType||void 0}]),p=ss(`${n}/${l}`),d instanceof Promise&&(p=Promise.all([p,d]).then(s=>s[0])),_t.runningLoads[`${t}!${l}`]=p}catch(s){console.error(s),this.setState({error:`Cannot import from ${this.props.schema.url}: ${s}`})}}try{const d=(await p).default;if(d!=null&&d[a])this.setState({Component:d[a]});else{const s=Object.keys(d||{});console.error("URL is empty. Cannot load custom component!"),this.setState({error:`Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${s.join(", ")}`})}}catch(d){console.error(d),this.setState({error:`Cannot import from ${this.props.schema.url}: ${d}`})}}render(){const t=this.state.Component,n=this.props.schema||{},l=t?M.createElement(t,{...this.props,socket:this.props.oContext.socket,theme:this.props.oContext.theme,themeType:this.props.oContext.themeType,instance:this.props.oContext.instance,adapterName:this.props.oContext.adapterName,systemConfig:this.props.oContext.systemConfig,forceUpdate:this.props.oContext.forceUpdate}):this.state.error?M.createElement("div",null,this.state.error):M.createElement(O.LinearProgress,null);return n.newLine?M.createElement(M.Fragment,null,M.createElement("div",{style:{flexBasis:"100%",height:0}}),l):l}}class Vs extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.setState({value:t})}renderItem(t,n){return M.createElement(_i.DatePicker,{sx:l=>({width:"100%",borderBottom:`1px solid ${l.palette.text.primary}`,"& fieldset":{display:"none"},"& input":{padding:`${l.spacing(1.5)} 0 4px 0`},"& .MuiInputAdornment-root":{marginLeft:0,marginTop:1},"& label":{transform:"translate(0px, -9px) scale(0.75)"}}),format:this.props.oContext.systemConfig.dateFormat.toLowerCase().replace("mm","MM"),disabled:!!n,value:this.state.value,onChange:l=>{this.setState({value:l},()=>this.onChange(this.props.attr,this.state.value))},label:this.getText(this.props.schema.label)})}}class Us extends K{renderItem(){if(!this.props.schema)return null;if(this.props.oContext.DeviceManager){const n=this.props.oContext.DeviceManager;return M.createElement(n,{uploadImagesToInstance:`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,title:this.getText(this.props.schema.label),socket:this.props.oContext.socket,selectedInstance:`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,themeName:this.props.themeName,theme:this.props.oContext.theme,themeType:this.props.oContext.themeType,isFloatComma:this.props.oContext.isFloatComma,dateFormat:this.props.oContext.dateFormat})}return M.createElement("div",null,"DeviceManager not found")}}const Oe={fullWidth:{width:"100%"},uploadDiv:{position:"relative",width:"100%"},uploadDivDragging:{opacity:1,background:"rgba(128,255,128,0.1)"},uploadCenterDiv:{margin:5,border:"3px dashed grey",borderRadius:5,width:"100%",height:"100%",position:"absolute",display:"flex"},uploadCenterIcon:{paddingTop:10,width:48,height:48},uploadCenterText:{fontSize:16},uploadCenterTextAndIcon:{textAlign:"center",position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},disabledOpacity:{opacity:.3,cursor:"default"},error:{border:"2px solid red"},deleteButton:{},selectedImage:{height:40,width:40,display:"inline-block",marginRight:8}},Gs=["jpg","jpeg","svg","png","webp","gif","apng","avif","webp"],Ks=["mp3","ogg","wav","aac"],Js=["avi","mp4","mov"],Ys=["txt","log","html","htm"],Qs=["json","js","ts"];class en extends K{dropzoneRef;imagePrefix;objectID;path;constructor(t){super(t),this.dropzoneRef=M.createRef(),this.imagePrefix=this.props.oContext.imagePrefix===void 0?"./files":this.props.oContext.imagePrefix}componentDidMount(){super.componentDidMount(),this.objectID=(this.props.schema.objectID||"0_userdata.0").replace("%INSTANCE%",(this.props.oContext.instance||0).toString()),this.path=this.props.schema.upload,this.path&&(this.path==="/"?this.path="":this.path.endsWith("/")||(this.path=`${this.path}/`)),this.updateFiles().then(()=>{const t=K.getValue(this.props.data,this.props.attr);this.setState({value:t}),this.props.oContext.socket.subscribeFiles(this.objectID,`${this.path}/*`,this.onFolderChanged).catch(n=>console.error(`Cannot subscribe: ${n}`))})}onFolderChanged=(t,n)=>{this.path&&n.startsWith(this.path)&&this.updateFiles().catch(l=>console.error(`Cannot update files: ${l}`))};componentWillUnmount(){this.props.oContext.socket.subscribeFiles(this.objectID,`${this.path}/*`,this.onFolderChanged).catch(t=>console.error(`Cannot subscribe: ${t}`)),super.componentWillUnmount()}async updateFiles(){const t=await this.readFiles(this.props.schema.pattern);await new Promise(n=>this.setState({files:t},n))}async readFolder(t,n,l){try{const y=await this.props.oContext.socket.readDir(this.objectID,t.replace(/^\//,"")||null);for(let a=0;a<y.length;a++){const p=y[a];if(p.isDir)await this.readFolder(`${t+p.file}/`,n,l);else{let d=!1;l==="*.*"&&p.file.includes(".")||!l||l==="*"||l===".*"&&p.file.startsWith(".")?d=!0:d=new RegExp(`^${l.replace(/\./g,"\\.").replace(/\*/g,".*")}$`).test(p.file),d&&n.push({name:t+p.file,size:p.stats?j.Utils.formatBytes(p.stats.size):"--"})}}}catch(y){console.error(`Cannot read "${t}": ${y}`)}return n}async readFiles(t){const n=[];t=t||this.props.schema.pattern,t||(t="**/*.*");let l;const y=t.lastIndexOf("/");if(y===-1?l=t:l=t.substring(y+1),t.startsWith("**"))await this.readFolder("/",n,l);else{const a=t.lastIndexOf("/");if(a===-1)await this.readFolder("/",n,l);else{const p=t.substring(0,a+1);await this.readFolder(p,n,l)}}return n}onDrop(t){const n=t[0],l=new FileReader,y=this.props.schema.maxSize||2*1024*1024;l.onabort=()=>console.log("file reading was aborted"),l.onerror=()=>console.log("file reading has failed"),l.onload=()=>{if(n.size>y){window.alert(j.I18n.t("File is too big. Max %sk allowed. Try use SVG.",Math.round(y/1024)));return}this.props.oContext.socket.writeFile64(this.objectID,this.path+n.name,l.result).then(()=>this.updateFiles()).then(()=>this.setState({value:this.path+n.name},()=>this.onChange(this.props.attr,this.path+n.name))).catch(a=>window.alert(`Cannot upload file: ${a}`))},l.readAsArrayBuffer(n)}renderDeleteDialog(){return this.state.deleteFile?M.createElement(j.DialogConfirm,{title:j.I18n.t("ra_Are you sure?"),text:j.I18n.t("ra_File will be deleted"),ok:j.I18n.t("ra_Delete"),cancel:j.I18n.t("ra_Cancel"),onClose:t=>{const n=this.state.deleteFile;this.setState({deleteFile:""},()=>{t&&this.props.oContext.socket.deleteFile(this.objectID,n).then(()=>this.updateFiles()).catch(l=>window.alert(`Cannot delete file: ${l}`))})}}):null}static base64ToArrayBuffer(t){const n=window.atob(t),l=n.length,y=new Uint8Array(l);for(let a=0;a<l;a++)y[a]=n.charCodeAt(a);return y.buffer}loadFile(){return this.props.oContext.socket.readFile(this.objectID,this.state.value,!0)}play(){this.loadFile().then(t=>{if(typeof AudioContext<"u"){const n=new AudioContext,l=en.base64ToArrayBuffer(t.file);n.decodeAudioData(l,y=>{const a=n.createBufferSource();a.buffer=y,a.connect(n.destination),a.start(0)},y=>window.alert(`Cannot play: ${y.message}`))}})}getFileIcon(t){return t!=null&&t.extension?Gs.includes(t.extension)?M.createElement("div",{style:{...Oe.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.objectID}/${t.value})`,backgroundSize:"contain",backgroundRepeat:"no-repeat"}}):Ks.includes(t.extension)?M.createElement(X.MusicNote,null):Ys.includes(t.extension)?M.createElement(X.Article,null):Js.includes(t.extension)?M.createElement(X.Videocam,null):Qs.includes(t.extension)?M.createElement(X.Code,null):null:null}renderItem(t,n){if(!this.state.files)return null;const l=[];this.props.schema.withFolder||this.state.files.forEach(e=>{const i=e.name.lastIndexOf("/");if(i===-1)l.includes("/")||l.push("/");else{const o=e.name.substring(0,i+1);l.includes(o)||l.push(o)}});const y=this.state.files.map(e=>({value:e.name,label:!this.props.schema.withFolder&&l.length===1?`${e.name.substring(l[0].length)}`:`${e.name}${this.props.schema.noSize?"":`(${e.size})`}`,extension:e.name.toLowerCase().split(".").pop()}));this.props.schema.noNone||y.unshift({label:j.I18n.t("ra_none"),value:""});const a=y.find(e=>e.value===this.state.value);let p=0;this.props.schema.upload&&p++,this.props.schema.refresh&&p++;const d=this.state.value&&(this.state.value.endsWith(".mp3")||this.state.value.endsWith(".ogg")||this.state.value.endsWith(".wav"));d&&p++;const s=M.createElement("div",{style:Oe.fullWidth},M.createElement(O.FormControl,{variant:"standard",style:{width:`calc(100% - ${p*42}px)`}},this.props.schema.label?M.createElement(O.InputLabel,null,this.getText(this.props.schema.label)):null,M.createElement(O.Select,{variant:"standard",error:!!t,disabled:!!n,value:this.state.value||"_",renderValue:()=>M.createElement(M.Fragment,null,this.getFileIcon(a),M.createElement("span",null,(a==null?void 0:a.label)||"")),onChange:e=>{this.setState({value:e.target.value==="_"?"":e.target.value},()=>this.onChange(this.props.attr,this.state.value))}},y.map(e=>M.createElement(O.MenuItem,{key:e.value,value:e.value},M.createElement(O.ListItemIcon,null,this.getFileIcon(e)),M.createElement(O.ListItemText,null,e.label),this.props.schema.delete&&a.value?M.createElement(O.IconButton,{style:Oe.deleteButton,size:"small",onClick:()=>this.setState({deleteFile:a.value})},M.createElement(X.Delete,null)):null))),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null),this.props.schema.refresh&&M.createElement(O.IconButton,{onClick:()=>this.updateFiles()},M.createElement(X.Refresh,null)),this.props.schema.upload&&M.createElement(O.IconButton,{onClick:()=>{var e;return(e=this.dropzoneRef.current)==null?void 0:e.open()}},M.createElement(X.UploadFile,null)),d&&M.createElement(O.IconButton,{style:{color:"#00FF00"},onClick:()=>this.play()},M.createElement(X.PlayArrow,null)));if(!this.props.schema.upload)return M.createElement(M.Fragment,null,s,this.renderDeleteDialog());let c={"*/*":[]};if(this.props.schema.fileTypes==="image"?c={"image/*":[".png",".jpg",".svg",".gif",".apng",".avif",".webp"]}:this.props.schema.fileTypes==="audio"?c={"audio/*":[".mp3",".ogg",".wav",".mp4"]}:this.props.schema.fileTypes==="text"&&(c={"text/plain":[".txt"]}),this.props.schema.pattern){const e=this.props.schema.pattern.split("/").pop().toLowerCase().replace(/.*\./,"");e==="png"||e==="jpg"||e==="svg"||e==="gif"||e==="apng"||e==="avif"||e==="webp"?c={"image/*":[".png",".jpg",".svg",".gif",".apng",".avif",".webp"]}:e==="mp3"||e==="ogg"||e==="wav"?c={"audio/*":[".mp3",".ogg",".wav",".mp4"]}:e==="ics"?c={"text/calendar":[".ics"]}:e==="txt"?c={"text/plain":[".txt"]}:e==="pem"?c={"text/plain":[".pem"]}:c={"*/*":[`.${e}`]}}return M.createElement(Ti,{ref:this.dropzoneRef,multiple:!1,accept:c,noKeyboard:!0,noClick:!0,maxSize:this.props.schema.maxSize||2*1024*1024,onDragEnter:()=>{this.setState({uploadFile:"dragging"})},onDragLeave:()=>this.setState({uploadFile:!0}),onDrop:(e,i)=>{var o,h,r;this.setState({uploadFile:!1}),e.length?this.onDrop(e):window.alert(((r=(h=(o=i==null?void 0:i[0])==null?void 0:o.errors)==null?void 0:h[0])==null?void 0:r.message)||j.I18n.t("Cannot upload"))}},({getRootProps:e,getInputProps:i})=>M.createElement("div",{style:{...Oe.uploadDiv,...this.state.uploadFile==="dragging"?Oe.uploadDivDragging:void 0,...n?Oe.disabledOpacity:void 0},...e()},M.createElement("input",{...i()}),this.state.uploadFile==="dragging"?M.createElement("div",{style:{...Oe.uploadCenterDiv,...this.state.uploadError?Oe.error:void 0}},M.createElement("div",{style:Oe.uploadCenterTextAndIcon},M.createElement(X.UploadFile,{style:Oe.uploadCenterIcon}),M.createElement("div",{style:Oe.uploadCenterText},this.state.uploadFile==="dragging"?j.I18n.t("ra_Drop file here"):j.I18n.t("ra_Place your files here or click here to open the browse dialog")))):null,s,this.renderDeleteDialog()))}}const jt={fullWidth:{width:"100%"},fullWidthOneButton:{width:"calc(100% - 69px)",marginRight:4},fullWidthIcon:{width:"calc(100% - 119px)",marginRight:4},selectedImage:{height:40,width:40,display:"inline-block",marginRight:8}},Xs=["jpg","jpeg","svg","png","webp","gif","apng","avif","webp"],Zs=["mp3","ogg","wav","aac"],qs=["avi","mp4","mov"],eo=["txt","log","html","htm"],to=["json","js","ts"];class no extends K{imagePrefix="../..";componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.imagePrefix=this.props.oContext.imagePrefix===void 0?"./files":this.props.oContext.imagePrefix,this.setState({value:t??""})}static getDerivedStateFromProps(t,n){const l=K.getValue(t.data,t.attr);return l==null||l.toString().trim()!==(n.value||"").toString().trim()?{value:l??""}:null}loadFile(){const t=this.state.value.indexOf("/");if(t!==-1){const n=this.state.value.substring(0,t),l=this.state.value.substring(t+1);return this.props.oContext.socket.readFile(n,l,!0)}return Promise.resolve(null)}play(){this.loadFile().then(t=>{if(typeof AudioContext<"u"&&(t!=null&&t.file)){const n=new AudioContext,l=en.base64ToArrayBuffer(t.file);n.decodeAudioData(l,y=>{const a=n.createBufferSource();a.buffer=y,a.connect(n.destination),a.start(0)},y=>window.alert(`Cannot play: ${y.message}`))}})}getIcon(){const t=this.state.value.split(".").pop().toLowerCase();return Xs.includes(t)?M.createElement("div",{style:{...jt.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.state.value})`,backgroundSize:"contain",backgroundRepeat:"no-repeat"}}):Zs.includes(t)?M.createElement(O.IconButton,{style:{color:"#00FF00"},onClick:()=>this.play()},M.createElement(X.PlayArrow,null)):eo.includes(t)?M.createElement(X.Article,null):qs.includes(t)?M.createElement(X.Videocam,null):to.includes(t)?M.createElement(X.Code,null):null}renderFileBrowser(){return this.state.showFileBrowser?M.createElement(j.DialogSelectFile,{imagePrefix:this.props.oContext.imagePrefix,socket:this.props.oContext.socket,selected:this.state.value,onClose:()=>this.setState({showFileBrowser:!1}),onOk:t=>{const n=Array.isArray(t)?t[0]:t;this.setState({value:n},()=>this.onChange(this.props.attr,this.props.schema.trim===!1?n:(n||"").trim()))},selectOnlyFolders:this.props.schema.selectOnlyFolders,allowUpload:this.props.schema.allowUpload,allowDownload:this.props.schema.allowDownload,allowCreateFolder:this.props.schema.allowCreateFolder,allowView:this.props.schema.allowView,showToolbar:this.props.schema.showToolbar,limitPath:this.props.schema.limitPath,theme:this.props.oContext.theme}):null}renderItem(t,n){const l=this.getIcon();return M.createElement("div",{style:jt.fullWidth},l,M.createElement(O.TextField,{variant:"standard",style:l?jt.fullWidthIcon:jt.fullWidthOneButton,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!t,disabled:!!n,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:!!this.props.schema.disableEdit}},onChange:y=>{const a=y.target.value;this.setState({value:a},()=>this.onChange(this.props.attr,this.props.schema.trim===!1?a:(a||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}),M.createElement(O.Button,{disabled:n,variant:"outlined",onClick:()=>this.setState({showFileBrowser:!0})},"..."),this.renderFileBrowser())}}class io extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums("functions").then(n=>{const l=Object.keys(n).map(y=>({value:this.props.schema.short?y.replace("enum.functions.",""):y,label:this.getText(n[y].common.name),obj:n[y]}));this.props.schema.allowDeactivate!==!1&&l.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.setState({value:t,selectOptions:l})})}renderItem(t,n){if(!this.state.selectOptions)return null;const l=this.state.selectOptions.find(y=>y.value===this.state.value);return M.createElement(O.FormControl,{variant:"standard",fullWidth:!0},this.props.schema.label?M.createElement(O.InputLabel,null,this.getText(this.props.schema.label)):null,M.createElement(O.Select,{variant:"standard",error:!!t,disabled:!!n,value:this.state.value||"_",renderValue:()=>l?l.obj?M.createElement(j.TextWithIcon,{value:l.obj,themeType:this.props.oContext.themeType,lang:j.I18n.getLanguage()}):l.label:"",onChange:y=>{this.setState({value:y.target.value==="_"?"":y.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(y=>M.createElement(O.MenuItem,{key:y.value,value:y.value,style:y.value===K.DIFFERENT_VALUE?{opacity:.5}:{}},y.obj?M.createElement(j.TextWithIcon,{value:y.obj,themeType:this.props.oContext.themeType,lang:j.I18n.getLanguage()}):y.label))),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class ro extends K{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getHostByIp(this.props.common.host).then(t=>{this.props.schema.listenOnAllPorts||(t=t.filter(n=>n.address!=="0.0.0.0"&&n.address!=="::")),this.props.schema.onlyIp4?t=t.filter(n=>n.family==="ipv4"):this.props.schema.onlyIp6&&(t=t.filter(n=>n.family==="ipv6")),this.props.schema.noInternal&&(t=t.filter(n=>!n.internal)),t.forEach(n=>{n.address==="0.0.0.0"?n.name=`[IPv4] 0.0.0.0 - ${j.I18n.t("ra_Listen on all IPs")}`:n.address==="::"&&(n.name=`[IPv6] :: - ${j.I18n.t("ra_Listen on all IPs")}`)}),this.setState({ips:t})}).catch(t=>console.error(t))}renderItem(t,n){var a,p;const l=K.getValue(this.props.data,this.props.attr),y=(a=this.state.ips)==null?void 0:a.find(d=>d.address===l);return M.createElement(O.FormControl,{fullWidth:!0,variant:"standard"},this.state.ips&&this.props.schema.label?M.createElement(O.InputLabel,null,this.getText(this.props.schema.label)):null,this.state.ips?M.createElement(O.Select,{variant:"standard",error:!!t,disabled:!!n,value:l,renderValue:d=>(y==null?void 0:y.name)||d,onChange:d=>this.onChange(this.props.attr,d.target.value)},(p=this.state.ips)==null?void 0:p.map((d,s)=>M.createElement(O.MenuItem,{key:s,value:d.address},d.name))):M.createElement(O.TextField,{fullWidth:!0,variant:"standard",error:!!t,disabled:!!n,value:l,onChange:d=>this.onChange(this.props.attr,d.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class so extends K{initialized=!1;localContext;componentDidMount(){super.componentDidMount(),this.askInstance()}askInstance(){if(this.props.alive){let t=this.props.schema.data;if(t===void 0&&this.props.schema.jsonData){const n=this.getPattern(this.props.schema.jsonData,null,!0);if(n)try{t=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${JSON.stringify(t)}`)}}t===void 0&&(t=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",t).then(n=>this.setState({image:n||""}))}}getContext(){const t={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(n=>t[n]=K.getValue(this.props.data,n)),JSON.stringify(t)}renderItem(){if(this.props.alive){const t=this.getContext();(t!==this.localContext||!this.initialized)&&(this.localContext=t,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}return this.state.image===void 0?null:M.createElement("img",{alt:"dynamic content",src:this.state.image,style:{width:this.props.schema.width||"100%",height:this.props.schema.height}})}}class oo extends K{index;constructor(t){super(t),this.index=Date.now()}componentDidMount(){if(super.componentDidMount(),this.props.schema.base64){const t=K.getValue(this.props.data,this.props.attr);this.setState({value:t})}else this.props.oContext.socket.fileExists(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr).then(t=>t&&this.loadImage())}_getUrl(t){t&&(this.index=Date.now());let n=`files/${this.props.oContext.adapterName}.${this.props.oContext.instance}/${this.props.attr}?t=${this.index}`;return window.location.port==="3000"&&(n=`${window.location.protocol}//${window.location.hostname}:8081/${n}`),n}loadImage(){fetch(this._getUrl()).then(t=>t.blob()).then(t=>{const n=new FileReader;n.onload=()=>{this.setState({value:n.result})},n.readAsDataURL(t)}).catch(t=>console.error(t))}renderItem(t,n){return M.createElement(O.FormControl,{fullWidth:!0,variant:"standard"},this.props.schema.label?M.createElement(O.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,M.createElement(j.UploadImage,{error:!!t,disabled:n,accept:this.props.schema.accept,crop:this.props.schema.crop,maxSize:this.props.schema.maxSize||256*1024,icon:this.state.value||void 0,removeIconFunc:()=>this.setState({value:null},()=>{if(this.props.schema.base64){const l=this.onChange(this.props.attr,this.state.value);l instanceof Promise&&l.catch(y=>console.error(`Cannot set value: ${y}`))}else this.props.oContext.socket.deleteFile(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr).catch(l=>console.error(l))}),onChange:l=>this.setState({value:l},()=>{if(this.props.schema.base64){const y=this.onChange(this.props.attr,this.state.value);y instanceof Promise&&y.catch(a=>console.error(`Cannot set value: ${a}`))}else l.startsWith("data")&&(l=l.split(",")[1]);this.props.oContext.socket.writeFile64(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr,l).catch(y=>console.error(y))})}),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class ao extends K{renderItem(){return M.createElement(j.InfoBox,{type:this.props.schema.boxType||"info",closeable:this.props.schema.closeable!==void 0?this.props.schema.closeable:!0,storeId:this.props.schema.closed!==void 0?void 0:`${!!this.props.oContext.adapterName} ${this.props.attr}`,closed:this.props.schema.closed,style:{width:"100%",...this.props.schema.style}},this.props.schema.title?M.createElement(O.Box,{component:"div",sx:{fontWeight:"bold",fontSize:"larger"}},this.getText(this.props.schema.title)):null,this.getText(this.props.schema.text))}}const ri={icon:{width:20,height:20,marginRight:4}};class lo extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);let n=this.props.schema.adapter;n==="_dataSources"&&(n=void 0),this.props.oContext.socket.getAdapterInstances(n,!0).then(async l=>{this.props.schema.adapter==="_dataSources"?l=l.filter(a=>{var p;return(p=a==null?void 0:a.common)==null?void 0:p.getHistory}):this.props.schema.adapter?l=l.filter(a=>a==null?void 0:a._id.startsWith(`system.adapter.${this.props.schema.adapter}.`)):this.props.schema.adapters&&Array.isArray(this.props.schema.adapters)&&(l=l.filter(a=>{var p;return this.props.schema.adapters.includes((p=a==null?void 0:a.common)==null?void 0:p.name)})),this.props.schema.onlyEnabled&&(l=l.filter(a=>{var p;return(p=a==null?void 0:a.common)==null?void 0:p.enabled}));const y=l.map(a=>({value:this.props.schema.long?a._id:this.props.schema.short?a._id.split(".").pop():a._id.replace(/^system\.adapter\./,""),label:`${a.common.name} [${a._id.replace(/^system\.adapter\./,"")}]`,icon:`adapter/${a.common.name}/${a.common.icon}`}));y.sort((a,p)=>a.value>p.value?1:a.value<p.value?-1:0),this.props.schema.allowDeactivate!==!1&&y.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.props.schema.all&&y.unshift({label:j.I18n.t("sch_all"),value:"*"}),this.setState({value:t||"",selectOptions:y}),await this.props.oContext.socket.subscribeObject(`system.adapter.${n?`${n}.`:""}*`,this.onInstancesUpdate)}).catch(l=>console.error(`Cannot get instances: ${l}`))}componentWillUnmount(){this.props.oContext.socket.unsubscribeObject("system.adapter.*",this.onInstancesUpdate).then(()=>{}),super.componentWillUnmount()}onInstancesUpdate=(t,n)=>{if(!t.match(/^system\.adapter\.[-_a-z\d]+\.\d+$/))return;const l=this.props.schema.long?t:this.props.schema.short?t.split(".").pop():t.replace(/^system\.adapter\./,""),y=this.state.selectOptions.findIndex(a=>a.value===l);if(n){if(this.props.schema.adapter==="_dataSources"&&(!n.common||!n.common.getHistory))return;if(y===-1){const a=JSON.parse(JSON.stringify(this.state.selectOptions)),p=typeof n.common.name=="object"?n.common.name[j.I18n.getLanguage()]||n.common.name.en:n.common.name;a.push({value:this.props.schema.long?n._id:this.props.schema.short?n._id.split(".").pop():n._id.replace(/^system\.adapter\./,""),label:`${p} [${n._id.replace(/^system\.adapter\./,"")}]`,icon:`adapter/${p}/${n.common.icon}`}),a.sort((d,s)=>d.label>s.label?1:d.label<s.label?-1:0),this.setState({selectOptions:a})}}else if(y!==-1){const a=JSON.parse(JSON.stringify(this.state.selectOptions)),p={};this.state.value===a[y].value&&(p.value=K.NONE_VALUE),a.splice(y,1),p.selectOptions=a,this.setState(p)}};renderItem(t,n){var y;if(!this.state.selectOptions)return null;const l=(y=this.state.selectOptions)==null?void 0:y.find(a=>a.value===this.state.value);return M.createElement(O.FormControl,{fullWidth:!0,key:this.props.attr,variant:"standard"},this.props.schema.label?M.createElement(O.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,M.createElement(O.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:this.state.value,renderValue:()=>M.createElement("span",{style:{display:"flex"}},l!=null&&l.icon?M.createElement("img",{src:`./${l.icon}`,alt:l.value,style:ri.icon}):null,this.getText(l==null?void 0:l.label,!0)),onChange:a=>this.setState({value:a.target.value},()=>this.onChange(this.props.attr,this.state.value))},this.state.selectOptions.map(a=>M.createElement(O.MenuItem,{key:a.value,value:a.value,style:a.value===K.NONE_VALUE?{opacity:.5}:{}},a.icon?M.createElement("img",{src:`./${a.icon}`,alt:a.value,style:ri.icon}):null,this.getText(a.label,!0)))),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const si={address:{fontSize:"smaller",opacity:.5,marginLeft:8}};class ho extends K{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getObject(`system.host.${this.props.common.host}`).then(t=>{var l,y;const n=[];if((y=(l=t==null?void 0:t.native)==null?void 0:l.hardware)!=null&&y.networkInterfaces){const a=t.native.hardware.networkInterfaces;Object.keys(a).forEach(p=>{if(this.props.schema.ignoreInternal&&!a[p].find(s=>!s.internal)||this.props.schema.ignoreLoopback&&a[p].find(s=>s.address==="127.0.0.1"||s.address==="::1"))return;let d=a[p].find(s=>s.family==="IPv4");d=d||a[p].find(s=>s.family==="IPv6"),n.push({value:p,address:d.address})})}this.setState({interfaces:n})}).catch(t=>window.alert(`Cannot read interfaces: ${t}`))}renderItem(t,n){var a,p,d;const l=K.getValue(this.props.data,this.props.attr),y=(a=this.state.interfaces)==null?void 0:a.find(s=>s.value===l);return M.createElement(O.FormControl,{fullWidth:!0,variant:"standard"},(p=this.state.interfaces)!=null&&p.length&&this.props.schema.label?M.createElement(O.InputLabel,null,this.getText(this.props.schema.label)):null,(d=this.state.interfaces)!=null&&d.length?M.createElement(O.Select,{variant:"standard",error:!!t,disabled:!!n,value:l,renderValue:s=>y?M.createElement("span",null,y.value,M.createElement("span",{style:si.address},y.address)):s,onChange:s=>this.onChange(this.props.attr,s.target.value)},this.state.interfaces.map((s,c)=>M.createElement(O.MenuItem,{key:c,value:s.value},M.createElement("span",null,s.value,M.createElement("span",{style:si.address},s.address))))):M.createElement(O.TextField,{fullWidth:!0,variant:"standard",error:!!t,disabled:!!n,value:l,onChange:s=>this.onChange(this.props.attr,s.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const vt={modalDialog:{minWidth:400,maxWidth:800},overflowHidden:{display:"flex",overflow:"hidden"},titleIcon:{marginRight:5},content:{fontSize:16},languageButton:{position:"absolute",right:8,top:8},languageButtonActive:{color:"primary.main"}},co=({toggleTranslation:L,noTranslation:t,title:n,fullWidth:l,help:y,maxWidth:a,progress:p,icon:d,applyDisabled:s,applyButton:c,onClose:e,children:i,titleButtonApply:o,titleButtonClose:h,onApply:r,textInput:u,defaultValue:f,overflowHidden:g})=>{const[v,A]=qe.useState(f);qe.useEffect(()=>{A(f)},[f]);let E=null;return d&&(E=d),M.createElement(O.Dialog,{open:!0,maxWidth:a||"md",fullWidth:!!l,disableEscapeKeyDown:!1,onClose:e,sx:{"& .MuiPaper-root":vt.modalDialog}},n&&M.createElement(O.DialogTitle,null,d?M.createElement(E,{style:vt.titleIcon}):null,n,j.I18n.getLanguage()!=="en"&&L?M.createElement(O.IconButton,{size:"large",style:{...vt.languageButton,...t?vt.languageButtonActive:{}},onClick:()=>L(),title:j.I18n.t("Disable/Enable translation")},M.createElement(X.Language,null)):null),M.createElement(O.DialogContent,{sx:{...g?vt.overflowHidden:{},...vt.content},style:{paddingTop:8}},u&&M.createElement(O.TextField,{autoComplete:"off",fullWidth:!0,autoFocus:!0,variant:"outlined",size:"medium",multiline:!0,value:v,onChange:w=>A(w.target.value)}),i,y?M.createElement("div",null,y):null),M.createElement(O.DialogActions,null,c!==!1&&M.createElement(O.Button,{startIcon:M.createElement(X.Check,null),disabled:p||s&&f===v,onClick:()=>r&&r(u?v:""),variant:"contained",color:"primary"},j.I18n.t(o||"Ok")),M.createElement(O.Button,{color:"grey",onClick:()=>e&&e(),disabled:p,variant:"contained",startIcon:M.createElement(X.Close,null)},j.I18n.t(h||"Cancel"))))};var wt={},ut={},Ii={exports:{}};(function(L,t){(function(){var n="ace",l=(function(){return this})();!l&&typeof window<"u"&&(l=window);var y=function(e,i,o){if(typeof e!="string"){y.original?y.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(o=i),y.modules[e]||(y.payloads[e]=o,y.modules[e]=null)};y.modules={},y.payloads={};var a=function(e,i,o){if(typeof i=="string"){var h=s(e,i);if(h!=null)return o&&o(),h}else if(Object.prototype.toString.call(i)==="[object Array]"){for(var r=[],u=0,f=i.length;u<f;++u){var g=s(e,i[u]);if(g==null&&p.original)return;r.push(g)}return o&&o.apply(null,r)||!0}},p=function(e,i){var o=a("",e,i);return o==null&&p.original?p.original.apply(this,arguments):o},d=function(e,i){if(i.indexOf("!")!==-1){var o=i.split("!");return d(e,o[0])+"!"+d(e,o[1])}if(i.charAt(0)=="."){var h=e.split("/").slice(0,-1).join("/");for(i=h+"/"+i;i.indexOf(".")!==-1&&r!=i;){var r=i;i=i.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return i},s=function(e,i){i=d(e,i);var o=y.modules[i];if(!o){if(o=y.payloads[i],typeof o=="function"){var h={},r={id:i,uri:"",exports:h,packaged:!0},u=function(g,v){return a(i,g,v)},f=o(u,h,r);h=f||r.exports,y.modules[i]=h,delete y.payloads[i]}o=y.modules[i]=h||o}return o};function c(e){var i=l;l[e]||(l[e]={}),i=l[e],(!i.define||!i.define.packaged)&&(y.original=i.define,i.define=y,i.define.packaged=!0),(!i.require||!i.require.packaged)&&(p.original=i.require,i.require=p,i.require.packaged=!0)}c(n)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(n,l,y){function a(p,d,s){Object.defineProperty(p,d,{value:s,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||a(String.prototype,"startsWith",function(p,d){return d=d||0,this.lastIndexOf(p,d)===d}),String.prototype.endsWith||a(String.prototype,"endsWith",function(p,d){var s=this;(d===void 0||d>s.length)&&(d=s.length),d-=p.length;var c=s.indexOf(p,d);return c!==-1&&c===d}),String.prototype.repeat||a(String.prototype,"repeat",function(p){for(var d="",s=this;p>0;)p&1&&(d+=s),(p>>=1)&&(s+=s);return d}),String.prototype.includes||a(String.prototype,"includes",function(p,d){return this.indexOf(p,d)!=-1}),Object.assign||(Object.assign=function(p){if(p==null)throw new TypeError("Cannot convert undefined or null to object");for(var d=Object(p),s=1;s<arguments.length;s++){var c=arguments[s];c!=null&&Object.keys(c).forEach(function(e){d[e]=c[e]})}return d}),Object.values||(Object.values=function(p){return Object.keys(p).map(function(d){return p[d]})}),Array.prototype.find||a(Array.prototype,"find",function(p){for(var d=this.length,s=arguments[1],c=0;c<d;c++){var e=this[c];if(p.call(s,e,c,this))return e}}),Array.prototype.findIndex||a(Array.prototype,"findIndex",function(p){for(var d=this.length,s=arguments[1],c=0;c<d;c++){var e=this[c];if(p.call(s,e,c,this))return c}}),Array.prototype.includes||a(Array.prototype,"includes",function(p,d){return this.indexOf(p,d)!=-1}),Array.prototype.fill||a(Array.prototype,"fill",function(p){for(var d=this,s=d.length>>>0,c=arguments[1],e=c>>0,i=e<0?Math.max(s+e,0):Math.min(e,s),o=arguments[2],h=o===void 0?s:o>>0,r=h<0?Math.max(s+h,0):Math.min(h,s);i<r;)d[i]=p,i++;return d}),Array.of||a(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(n,l,y){n("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(n,l,y){l.deepCopy=function a(p){if(typeof p!="object"||!p)return p;var d;if(Array.isArray(p)){d=[];for(var s=0;s<p.length;s++)d[s]=a(p[s]);return d}if(Object.prototype.toString.call(p)!=="[object Object]")return p;d={};for(var s in p)d[s]=a(p[s]);return d}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(n,l,y){l.last=function(d){return d[d.length-1]},l.stringReverse=function(d){return d.split("").reverse().join("")},l.stringRepeat=function(d,s){for(var c="";s>0;)s&1&&(c+=d),(s>>=1)&&(d+=d);return c};var a=/^\s\s*/,p=/\s\s*$/;l.stringTrimLeft=function(d){return d.replace(a,"")},l.stringTrimRight=function(d){return d.replace(p,"")},l.copyObject=function(d){var s={};for(var c in d)s[c]=d[c];return s},l.copyArray=function(d){for(var s=[],c=0,e=d.length;c<e;c++)d[c]&&typeof d[c]=="object"?s[c]=this.copyObject(d[c]):s[c]=d[c];return s},l.deepCopy=n("./deep_copy").deepCopy,l.arrayToMap=function(d){for(var s={},c=0;c<d.length;c++)s[d[c]]=1;return s},l.createMap=function(d){var s=Object.create(null);for(var c in d)s[c]=d[c];return s},l.arrayRemove=function(d,s){for(var c=0;c<=d.length;c++)s===d[c]&&d.splice(c,1)},l.escapeRegExp=function(d){return d.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},l.escapeHTML=function(d){return(""+d).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},l.getMatchOffsets=function(d,s){var c=[];return d.replace(s,function(e){c.push({offset:arguments[arguments.length-2],length:e.length})}),c},l.deferredCall=function(d){var s=null,c=function(){s=null,d()},e=function(i){return e.cancel(),s=setTimeout(c,i||0),e};return e.schedule=e,e.call=function(){return this.cancel(),d(),e},e.cancel=function(){return clearTimeout(s),s=null,e},e.isPending=function(){return s},e},l.delayedCall=function(d,s){var c=null,e=function(){c=null,d()},i=function(o){c==null&&(c=setTimeout(e,o||s))};return i.delay=function(o){c&&clearTimeout(c),c=setTimeout(e,o||s)},i.schedule=i,i.call=function(){this.cancel(),d()},i.cancel=function(){c&&clearTimeout(c),c=null},i.isPending=function(){return c},i},l.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},l.skipEmptyMatch=function(d,s,c){return c&&d.codePointAt(s)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(n,l,y){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 a=typeof navigator=="object"?navigator:{},p=(/mac|win|linux/i.exec(a.platform)||["other"])[0].toLowerCase(),d=a.userAgent||"",s=a.appName||"";l.isWin=p=="win",l.isMac=p=="mac",l.isLinux=p=="linux",l.isIE=s=="Microsoft Internet Explorer"||s.indexOf("MSAppHost")>=0?parseFloat((d.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((d.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),l.isOldIE=l.isIE&&l.isIE<9,l.isGecko=l.isMozilla=d.match(/ Gecko\/\d+/),l.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",l.isWebKit=parseFloat(d.split("WebKit/")[1])||void 0,l.isChrome=parseFloat(d.split(" Chrome/")[1])||void 0,l.isSafari=parseFloat(d.split(" Safari/")[1])&&!l.isChrome||void 0,l.isEdge=parseFloat(d.split(" Edge/")[1])||void 0,l.isAIR=d.indexOf("AdobeAIR")>=0,l.isAndroid=d.indexOf("Android")>=0,l.isChromeOS=d.indexOf(" CrOS ")>=0,l.isIOS=/iPad|iPhone|iPod/.test(d)&&!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(n,l,y){var a=n("./useragent"),p="http://www.w3.org/1999/xhtml";l.buildDom=function o(h,r,u){if(typeof h=="string"&&h){var f=document.createTextNode(h);return r&&r.appendChild(f),f}if(!Array.isArray(h))return h&&h.appendChild&&r&&r.appendChild(h),h;if(typeof h[0]!="string"||!h[0]){for(var g=[],v=0;v<h.length;v++){var A=o(h[v],r,u);A&&g.push(A)}return g}var E=document.createElement(h[0]),w=h[1],m=1;w&&typeof w=="object"&&!Array.isArray(w)&&(m=2);for(var v=m;v<h.length;v++)o(h[v],E,u);return m==2&&Object.keys(w).forEach(function(S){var k=w[S];S==="class"?E.className=Array.isArray(k)?k.join(" "):k:typeof k=="function"||S=="value"||S[0]=="$"?E[S]=k:S==="ref"?u&&(u[k]=E):S==="style"?typeof k=="string"&&(E.style.cssText=k):k!=null&&E.setAttribute(S,k)}),r&&r.appendChild(E),E},l.getDocumentHead=function(o){return o||(o=document),o.head||o.getElementsByTagName("head")[0]||o.documentElement},l.createElement=function(o,h){return document.createElementNS?document.createElementNS(h||p,o):document.createElement(o)},l.removeChildren=function(o){o.innerHTML=""},l.createTextNode=function(o,h){var r=h?h.ownerDocument:document;return r.createTextNode(o)},l.createFragment=function(o){var h=o?o.ownerDocument:document;return h.createDocumentFragment()},l.hasCssClass=function(o,h){var r=(o.className+"").split(/\s+/g);return r.indexOf(h)!==-1},l.addCssClass=function(o,h){l.hasCssClass(o,h)||(o.className+=" "+h)},l.removeCssClass=function(o,h){for(var r=o.className.split(/\s+/g);;){var u=r.indexOf(h);if(u==-1)break;r.splice(u,1)}o.className=r.join(" ")},l.toggleCssClass=function(o,h){for(var r=o.className.split(/\s+/g),u=!0;;){var f=r.indexOf(h);if(f==-1)break;u=!1,r.splice(f,1)}return u&&r.push(h),o.className=r.join(" "),u},l.setCssClass=function(o,h,r){r?l.addCssClass(o,h):l.removeCssClass(o,h)},l.hasCssString=function(o,h){var r=0,u;if(h=h||document,u=h.querySelectorAll("style")){for(;r<u.length;)if(u[r++].id===o)return!0}},l.removeElementById=function(o,h){h=h||document,h.getElementById(o)&&h.getElementById(o).remove()};var d,s=[];l.useStrictCSP=function(o){d=o,o==!1?c():s||(s=[])};function c(){var o=s;s=null,o&&o.forEach(function(h){e(h[0],h[1])})}function e(o,h,r){if(!(typeof document>"u")){if(s){if(r)c();else if(r===!1)return s.push([o,h])}if(!d){var u=r;!r||!r.getRootNode?u=document:(u=r.getRootNode(),(!u||u==r)&&(u=document));var f=u.ownerDocument||u;if(h&&l.hasCssString(h,u))return null;h&&(o+=`
|
|
16
|
-
/*# sourceURL=ace/css/`+h+" */");var g=l.createElement("style");g.appendChild(f.createTextNode(o)),h&&(g.id=h),u==f&&(u=l.getDocumentHead(f)),u.insertBefore(g,u.firstChild)}}}if(l.importCssString=e,l.importCssStylsheet=function(o,h){l.buildDom(["link",{rel:"stylesheet",href:o}],l.getDocumentHead(h))},l.$fixPositionBug=function(o){var h=o.getBoundingClientRect();if(o.style.left){var r=parseFloat(o.style.left),u=+h.left;Math.abs(r-u)>1&&(o.style.left=2*r-u+"px")}if(o.style.right){var r=parseFloat(o.style.right),u=window.innerWidth-h.right;Math.abs(r-u)>1&&(o.style.right=2*r-u+"px")}if(o.style.top){var r=parseFloat(o.style.top),u=+h.top;Math.abs(r-u)>1&&(o.style.top=2*r-u+"px")}if(o.style.bottom){var r=parseFloat(o.style.bottom),u=window.innerHeight-h.bottom;Math.abs(r-u)>1&&(o.style.bottom=2*r-u+"px")}},l.scrollbarWidth=function(o){var h=l.createElement("ace_inner");h.style.width="100%",h.style.minWidth="0px",h.style.height="200px",h.style.display="block";var r=l.createElement("ace_outer"),u=r.style;u.position="absolute",u.left="-10000px",u.overflow="hidden",u.width="200px",u.minWidth="0px",u.height="150px",u.display="block",r.appendChild(h);var f=o&&o.documentElement||document&&document.documentElement;if(!f)return 0;f.appendChild(r);var g=h.offsetWidth;u.overflow="scroll";var v=h.offsetWidth;return g===v&&(v=r.clientWidth),f.removeChild(r),g-v},l.computedStyle=function(o,h){return window.getComputedStyle(o,"")||{}},l.setStyle=function(o,h,r){o[h]!==r&&(o[h]=r)},l.HAS_CSS_ANIMATION=!1,l.HAS_CSS_TRANSFORMS=!1,l.HI_DPI=a.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,a.isChromeOS&&(l.HI_DPI=!1),typeof document<"u"){var i=document.createElement("div");l.HI_DPI&&i.style.transform!==void 0&&(l.HAS_CSS_TRANSFORMS=!0),!a.isEdge&&typeof i.style.animationName<"u"&&(l.HAS_CSS_ANIMATION=!0),i=null}l.HAS_CSS_TRANSFORMS?l.translate=function(o,h,r){o.style.transform="translate("+Math.round(h)+"px, "+Math.round(r)+"px)"}:l.translate=function(o,h,r){o.style.top=Math.round(r)+"px",o.style.left=Math.round(h)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(n,l,y){/*
|
|
17
|
-
* based on code from:
|
|
18
|
-
*
|
|
19
|
-
* @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
|
|
20
|
-
* Available via the MIT or new BSD license.
|
|
21
|
-
* see: http://github.com/jrburke/requirejs for details
|
|
22
|
-
*/var a=n("./dom");l.get=function(p,d){var s=new XMLHttpRequest;s.open("GET",p,!0),s.onreadystatechange=function(){s.readyState===4&&d(s.responseText)},s.send(null)},l.loadScript=function(p,d){var s=a.getDocumentHead(),c=document.createElement("script");c.src=p,s.appendChild(c),c.onload=c.onreadystatechange=function(e,i){(i||!c.readyState||c.readyState=="loaded"||c.readyState=="complete")&&(c=c.onload=c.onreadystatechange=null,i||d())}},l.qualifyURL=function(p){var d=document.createElement("a");return d.href=p,d.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(n,l,y){l.inherits=function(a,p){a.super_=p,a.prototype=Object.create(p.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})},l.mixin=function(a,p){for(var d in p)a[d]=p[d];return a},l.implement=function(a,p){l.mixin(a,p)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(n,l,y){var a={},p=function(){this.propagationStopped=!0},d=function(){this.defaultPrevented=!0};a._emit=a._dispatchEvent=function(s,c){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var e=this._eventRegistry[s]||[],i=this._defaultHandlers[s];if(!(!e.length&&!i)){(typeof c!="object"||!c)&&(c={}),c.type||(c.type=s),c.stopPropagation||(c.stopPropagation=p),c.preventDefault||(c.preventDefault=d),e=e.slice();for(var o=0;o<e.length&&(e[o](c,this),!c.propagationStopped);o++);if(i&&!c.defaultPrevented)return i(c,this)}},a._signal=function(s,c){var e=(this._eventRegistry||{})[s];if(e){e=e.slice();for(var i=0;i<e.length;i++)e[i](c,this)}},a.once=function(s,c){var e=this;if(this.on(s,function i(){e.off(s,i),c.apply(null,arguments)}),!c)return new Promise(function(i){c=i})},a.setDefaultHandler=function(s,c){var e=this._defaultHandlers;if(e||(e=this._defaultHandlers={_disabled_:{}}),e[s]){var i=e[s],o=e._disabled_[s];o||(e._disabled_[s]=o=[]),o.push(i);var h=o.indexOf(c);h!=-1&&o.splice(h,1)}e[s]=c},a.removeDefaultHandler=function(s,c){var e=this._defaultHandlers;if(e){var i=e._disabled_[s];if(e[s]==c)i&&this.setDefaultHandler(s,i.pop());else if(i){var o=i.indexOf(c);o!=-1&&i.splice(o,1)}}},a.on=a.addEventListener=function(s,c,e){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[s];return i||(i=this._eventRegistry[s]=[]),i.indexOf(c)==-1&&i[e?"unshift":"push"](c),c},a.off=a.removeListener=a.removeEventListener=function(s,c){this._eventRegistry=this._eventRegistry||{};var e=this._eventRegistry[s];if(e){var i=e.indexOf(c);i!==-1&&e.splice(i,1)}},a.removeAllListeners=function(s){s||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[s]=void 0),this._defaultHandlers&&(this._defaultHandlers[s]=void 0)},l.EventEmitter=a}),ace.define("ace/lib/report_error",["require","exports","module"],function(n,l,y){l.reportError=function(p,d){var s=new Error(p);s.data=d,typeof console=="object"&&console.error&&console.error(s),setTimeout(function(){throw s})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(n,l,y){var a={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor gutter","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages","gutter.annotation.aria-label.security":"Security finding, read annotations row $0","gutter.annotation.aria-label.hint":"Suggestion, read annotations row $0","gutter-tooltip.aria-label.security.singular":"security finding","gutter-tooltip.aria-label.security.plural":"security findings","gutter-tooltip.aria-label.hint.singular":"suggestion","gutter-tooltip.aria-label.hint.plural":"suggestions","editor.tooltip.disable-editing":"Editing is disabled"};l.defaultEnglishMessages=a}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(n,l,y){"no use strict";var a=n("./oop"),p=n("./event_emitter").EventEmitter,d=n("./report_error").reportError,s=n("./default_english_messages").defaultEnglishMessages,c={setOptions:function(r){Object.keys(r).forEach(function(u){this.setOption(u,r[u])},this)},getOptions:function(r){var u={};if(r)Array.isArray(r)||(r=Object.keys(r));else{var f=this.$options;r=Object.keys(f).filter(function(g){return!f[g].hidden})}return r.forEach(function(g){u[g]=this.getOption(g)},this),u},setOption:function(r,u){if(this["$"+r]!==u){var f=this.$options[r];if(!f)return e('misspelled option "'+r+'"');if(f.forwardTo)return this[f.forwardTo]&&this[f.forwardTo].setOption(r,u);f.handlesSet||(this["$"+r]=u),f&&f.set&&f.set.call(this,u)}},getOption:function(r){var u=this.$options[r];return u?u.forwardTo?this[u.forwardTo]&&this[u.forwardTo].getOption(r):u&&u.get?u.get.call(this):this["$"+r]:e('misspelled option "'+r+'"')}};function e(r){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var i,o,h=(function(){function r(){this.$defaultOptions={},i=s,o="dollarSigns"}return r.prototype.defineOptions=function(u,f,g){return u.$options||(this.$defaultOptions[f]=u.$options={}),Object.keys(g).forEach(function(v){var A=g[v];typeof A=="string"&&(A={forwardTo:A}),A.name||(A.name=v),u.$options[A.name]=A,"initialValue"in A&&(u["$"+A.name]=A.initialValue)}),a.implement(u,c),this},r.prototype.resetOptions=function(u){Object.keys(u.$options).forEach(function(f){var g=u.$options[f];"value"in g&&u.setOption(f,g.value)})},r.prototype.setDefaultValue=function(u,f,g){if(!u){for(u in this.$defaultOptions)if(this.$defaultOptions[u][f])break;if(!this.$defaultOptions[u][f])return!1}var v=this.$defaultOptions[u]||(this.$defaultOptions[u]={});v[f]&&(v.forwardTo?this.setDefaultValue(v.forwardTo,f,g):v[f].value=g)},r.prototype.setDefaultValues=function(u,f){Object.keys(f).forEach(function(g){this.setDefaultValue(u,g,f[g])},this)},r.prototype.setMessages=function(u,f){i=u,f&&f.placeholders&&(o=f.placeholders)},r.prototype.nls=function(u,f,g){i[u]||(e("No message found for the key '"+u+"' in messages with id "+i.$id+", trying to find a translation for the default string '"+f+"'."),i[f]||e("No message found for the default string '"+f+"' in the provided messages. Falling back to the default English message."));var v=i[u]||i[f]||f;return g&&(o==="dollarSigns"&&(v=v.replace(/\$(\$|[\d]+)/g,function(A,E){return E=="$"?"$":g[E]})),o==="curlyBrackets"&&(v=v.replace(/\{([^\}]+)\}/g,function(A,E){return g[E]}))),v},r})();h.prototype.warn=e,h.prototype.reportError=d,a.implement(h.prototype,p),l.AppConfig=h}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(n,l,y){y.exports=`.ace-tm .ace_gutter {
|
|
23
|
-
background: #f0f0f0;
|
|
24
|
-
color: #333;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.ace-tm .ace_print-margin {
|
|
28
|
-
width: 1px;
|
|
29
|
-
background: #e8e8e8;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.ace-tm .ace_fold {
|
|
33
|
-
background-color: #6B72E6;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.ace-tm {
|
|
37
|
-
background-color: #FFFFFF;
|
|
38
|
-
color: black;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.ace-tm .ace_cursor {
|
|
42
|
-
color: black;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.ace-tm .ace_invisible {
|
|
46
|
-
color: rgb(191, 191, 191);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.ace-tm .ace_storage,
|
|
50
|
-
.ace-tm .ace_keyword {
|
|
51
|
-
color: blue;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.ace-tm .ace_constant {
|
|
55
|
-
color: rgb(197, 6, 11);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.ace-tm .ace_constant.ace_buildin {
|
|
59
|
-
color: rgb(88, 72, 246);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.ace-tm .ace_constant.ace_language {
|
|
63
|
-
color: rgb(88, 92, 246);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.ace-tm .ace_constant.ace_library {
|
|
67
|
-
color: rgb(6, 150, 14);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.ace-tm .ace_invalid {
|
|
71
|
-
background-color: rgba(255, 0, 0, 0.1);
|
|
72
|
-
color: red;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.ace-tm .ace_support.ace_function {
|
|
76
|
-
color: rgb(60, 76, 114);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.ace-tm .ace_support.ace_constant {
|
|
80
|
-
color: rgb(6, 150, 14);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.ace-tm .ace_support.ace_type,
|
|
84
|
-
.ace-tm .ace_support.ace_class {
|
|
85
|
-
color: rgb(109, 121, 222);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.ace-tm .ace_keyword.ace_operator {
|
|
89
|
-
color: rgb(104, 118, 135);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.ace-tm .ace_string {
|
|
93
|
-
color: rgb(3, 106, 7);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.ace-tm .ace_comment {
|
|
97
|
-
color: rgb(76, 136, 107);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.ace-tm .ace_comment.ace_doc {
|
|
101
|
-
color: rgb(0, 102, 255);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.ace-tm .ace_comment.ace_doc.ace_tag {
|
|
105
|
-
color: rgb(128, 159, 191);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.ace-tm .ace_constant.ace_numeric {
|
|
109
|
-
color: rgb(0, 0, 205);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.ace-tm .ace_variable {
|
|
113
|
-
color: rgb(49, 132, 149);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.ace-tm .ace_xml-pe {
|
|
117
|
-
color: rgb(104, 104, 91);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.ace-tm .ace_entity.ace_name.ace_function {
|
|
121
|
-
color: #0000A2;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
.ace-tm .ace_heading {
|
|
126
|
-
color: rgb(12, 7, 255);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.ace-tm .ace_list {
|
|
130
|
-
color:rgb(185, 6, 144);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.ace-tm .ace_meta.ace_tag {
|
|
134
|
-
color:rgb(0, 22, 142);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.ace-tm .ace_string.ace_regex {
|
|
138
|
-
color: rgb(255, 0, 0)
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.ace-tm .ace_marker-layer .ace_selection {
|
|
142
|
-
background: rgb(181, 213, 255);
|
|
143
|
-
}
|
|
144
|
-
.ace-tm.ace_multiselect .ace_selection.ace_start {
|
|
145
|
-
box-shadow: 0 0 3px 0px white;
|
|
146
|
-
}
|
|
147
|
-
.ace-tm .ace_marker-layer .ace_step {
|
|
148
|
-
background: rgb(252, 255, 0);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.ace-tm .ace_marker-layer .ace_stack {
|
|
152
|
-
background: rgb(164, 229, 101);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.ace-tm .ace_marker-layer .ace_bracket {
|
|
156
|
-
margin: -1px 0 0 -1px;
|
|
157
|
-
border: 1px solid rgb(192, 192, 192);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.ace-tm .ace_marker-layer .ace_active-line {
|
|
161
|
-
background: rgba(0, 0, 0, 0.07);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.ace-tm .ace_gutter-active-line {
|
|
165
|
-
background-color : #dcdcdc;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.ace-tm .ace_marker-layer .ace_selected-word {
|
|
169
|
-
background: rgb(250, 250, 255);
|
|
170
|
-
border: 1px solid rgb(200, 200, 250);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.ace-tm .ace_indent-guide {
|
|
174
|
-
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.ace-tm .ace_indent-guide-active {
|
|
178
|
-
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
|
|
179
|
-
}
|
|
180
|
-
`}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(n,l,y){l.isDark=!1,l.cssClass="ace-tm",l.cssText=n("./textmate-css"),l.$id="ace/theme/textmate";var a=n("../lib/dom");a.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(n,l,y){"no use strict";var a=n("./lib/lang"),p=n("./lib/net"),d=n("./lib/dom"),s=n("./lib/app_config").AppConfig;y.exports=l=new s;var c={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};l.get=function(h){if(!c.hasOwnProperty(h))throw new Error("Unknown config key: "+h);return c[h]},l.set=function(h,r){if(c.hasOwnProperty(h))c[h]=r;else if(this.setDefaultValue("",h,r)==!1)throw new Error("Unknown config key: "+h);h=="useStrictCSP"&&d.useStrictCSP(r)},l.all=function(){return a.copyObject(c)},l.$modes={},l.moduleUrl=function(h,r){if(c.$moduleUrls[h])return c.$moduleUrls[h];var u=h.split("/");r=r||u[u.length-2]||"";var f=r=="snippets"?"/":"-",g=u[u.length-1];if(r=="worker"&&f=="-"){var v=new RegExp("^"+r+"[\\-_]|[\\-_]"+r+"$","g");g=g.replace(v,"")}(!g||g==r)&&u.length>1&&(g=u[u.length-2]);var A=c[r+"Path"];return A==null?A=c.basePath:f=="/"&&(r=f=""),A&&A.slice(-1)!="/"&&(A+="/"),A+r+f+g+this.get("suffix")},l.setModuleUrl=function(h,r){return c.$moduleUrls[h]=r};var e=function(h,r){if(h==="ace/theme/textmate"||h==="./theme/textmate")return r(null,n("./theme/textmate"));if(i)return i(h,r);console.error("loader is not configured")},i;l.setLoader=function(h){i=h},l.dynamicModules=Object.create(null),l.$loading={},l.$loaded={},l.loadModule=function(h,r){var u;if(Array.isArray(h))var f=h[0],g=h[1];else if(typeof h=="string")var g=h;var v=function(A){if(A&&!l.$loading[g])return r&&r(A);if(l.$loading[g]||(l.$loading[g]=[]),l.$loading[g].push(r),!(l.$loading[g].length>1)){var E=function(){e(g,function(w,m){m&&(l.$loaded[g]=m),l._emit("load.module",{name:g,module:m});var S=l.$loading[g];l.$loading[g]=null,S.forEach(function(k){k&&k(m)})})};if(!l.get("packaged"))return E();p.loadScript(l.moduleUrl(g,f),E),o()}};if(l.dynamicModules[g])l.dynamicModules[g]().then(function(A){A.default?v(A.default):v(A)});else{try{u=this.$require(g)}catch{}v(u||l.$loaded[g])}},l.$require=function(h){if(typeof y.require=="function"){var r="require";return y[r](h)}},l.setModuleLoader=function(h,r){l.dynamicModules[h]=r};var o=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"),o=function(){})};l.version="1.43.4"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(n,l,y){n("./lib/fixoldbrowsers");var a=n("./config");a.setLoader(function(c,e){n([c],function(i){e(null,i)})});var p=(function(){return this||typeof window<"u"&&window})();y.exports=function(c){a.init=d,a.$require=n,c.require=n},d(!0);function d(c){if(!(!p||!p.document)){a.set("packaged",c||n.packaged||y.packaged||p.define&&(void 0).packaged);var e={},i="",o=document.currentScript||document._currentScript,h=o&&o.ownerDocument||document;o&&o.src&&(i=o.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var r=h.getElementsByTagName("script"),u=0;u<r.length;u++){var f=r[u],g=f.src||f.getAttribute("src");if(g){for(var v=f.attributes,A=0,E=v.length;A<E;A++){var w=v[A];w.name.indexOf("data-ace-")===0&&(e[s(w.name.replace(/^data-ace-/,""))]=w.value)}var m=g.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);m&&(i=m[1])}}i&&(e.base=e.base||i,e.packaged=!0),e.basePath=e.base,e.workerPath=e.workerPath||e.base,e.modePath=e.modePath||e.base,e.themePath=e.themePath||e.base,delete e.base;for(var S in e)typeof e[S]<"u"&&a.set(S,e[S])}}function s(c){return c.replace(/-(.)/g,function(e,i){return i.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(n,l,y){var a=(function(){function p(d,s,c,e){this.start={row:d,column:s},this.end={row:c,column:e}}return p.prototype.isEqual=function(d){return this.start.row===d.start.row&&this.end.row===d.end.row&&this.start.column===d.start.column&&this.end.column===d.end.column},p.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},p.prototype.contains=function(d,s){return this.compare(d,s)==0},p.prototype.compareRange=function(d){var s,c=d.end,e=d.start;return s=this.compare(c.row,c.column),s==1?(s=this.compare(e.row,e.column),s==1?2:s==0?1:0):s==-1?-2:(s=this.compare(e.row,e.column),s==-1?-1:s==1?42:0)},p.prototype.comparePoint=function(d){return this.compare(d.row,d.column)},p.prototype.containsRange=function(d){return this.comparePoint(d.start)==0&&this.comparePoint(d.end)==0},p.prototype.intersects=function(d){var s=this.compareRange(d);return s==-1||s==0||s==1},p.prototype.isEnd=function(d,s){return this.end.row==d&&this.end.column==s},p.prototype.isStart=function(d,s){return this.start.row==d&&this.start.column==s},p.prototype.setStart=function(d,s){typeof d=="object"?(this.start.column=d.column,this.start.row=d.row):(this.start.row=d,this.start.column=s)},p.prototype.setEnd=function(d,s){typeof d=="object"?(this.end.column=d.column,this.end.row=d.row):(this.end.row=d,this.end.column=s)},p.prototype.inside=function(d,s){return this.compare(d,s)==0?!(this.isEnd(d,s)||this.isStart(d,s)):!1},p.prototype.insideStart=function(d,s){return this.compare(d,s)==0?!this.isEnd(d,s):!1},p.prototype.insideEnd=function(d,s){return this.compare(d,s)==0?!this.isStart(d,s):!1},p.prototype.compare=function(d,s){return!this.isMultiLine()&&d===this.start.row?s<this.start.column?-1:s>this.end.column?1:0:d<this.start.row?-1:d>this.end.row?1:this.start.row===d?s>=this.start.column?0:-1:this.end.row===d?s<=this.end.column?0:1:0},p.prototype.compareStart=function(d,s){return this.start.row==d&&this.start.column==s?-1:this.compare(d,s)},p.prototype.compareEnd=function(d,s){return this.end.row==d&&this.end.column==s?1:this.compare(d,s)},p.prototype.compareInside=function(d,s){return this.end.row==d&&this.end.column==s?1:this.start.row==d&&this.start.column==s?-1:this.compare(d,s)},p.prototype.clipRows=function(d,s){if(this.end.row>s)var c={row:s+1,column:0};else if(this.end.row<d)var c={row:d,column:0};if(this.start.row>s)var e={row:s+1,column:0};else if(this.start.row<d)var e={row:d,column:0};return p.fromPoints(e||this.start,c||this.end)},p.prototype.extend=function(d,s){var c=this.compare(d,s);if(c==0)return this;if(c==-1)var e={row:d,column:s};else var i={row:d,column:s};return p.fromPoints(e||this.start,i||this.end)},p.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},p.prototype.isMultiLine=function(){return this.start.row!==this.end.row},p.prototype.clone=function(){return p.fromPoints(this.start,this.end)},p.prototype.collapseRows=function(){return this.end.column==0?new p(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new p(this.start.row,0,this.end.row,0)},p.prototype.toScreenRange=function(d){var s=d.documentToScreenPosition(this.start),c=d.documentToScreenPosition(this.end);return new p(s.row,s.column,c.row,c.column)},p.prototype.moveBy=function(d,s){this.start.row+=d,this.start.column+=s,this.end.row+=d,this.end.column+=s},p})();a.fromPoints=function(p,d){return new a(p.row,p.column,d.row,d.column)},a.comparePoints=function(p,d){return p.row-d.row||p.column-d.column},l.Range=a}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(n,l,y){for(var a=n("./oop"),p={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},d={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},s=0;s<10;s++)d["Digit"+s]=48+s,d["Numpad"+s]=96+s,p.PRINTABLE_KEYS[48+s]=""+s,p.FUNCTION_KEYS[96+s]="Numpad"+s;for(var s=65;s<91;s++){var c=String.fromCharCode(s+32);d["Key"+c.toUpperCase()]=s,p.PRINTABLE_KEYS[s]=c}for(var s=1;s<13;s++)d["F"+s]=111+s,p.FUNCTION_KEYS[111+s]="F"+s;var e={Shift:16,Control:17,Alt:18,Meta:224};for(var i in e)d[i]=d[i+"Left"]=d[i+"Right"]=e[i];l.$codeToKeyCode=d,p.PRINTABLE_KEYS[173]="-";for(var o in p.FUNCTION_KEYS){var h=p.FUNCTION_KEYS[o].toLowerCase();p[h]=parseInt(o,10)}for(var o in p.PRINTABLE_KEYS){var h=p.PRINTABLE_KEYS[o].toLowerCase();p[h]=parseInt(o,10)}a.mixin(p,p.MODIFIER_KEYS),a.mixin(p,p.PRINTABLE_KEYS),a.mixin(p,p.FUNCTION_KEYS),p.enter=p.return,p.escape=p.esc,p.del=p.delete,(function(){for(var r=["cmd","ctrl","alt","shift"],u=Math.pow(2,r.length);u--;)p.KEY_MODS[u]=r.filter(function(f){return u&p.KEY_MODS[f]}).join("-")+"-"})(),p.KEY_MODS[0]="",p.KEY_MODS[-1]="input-",a.mixin(l,p),l.default=l,l.keyCodeToString=function(r){var u=p[r];return typeof u!="string"&&(u=String.fromCharCode(r)),u.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(n,l,y){var a=n("./keys"),p=n("./useragent"),d=null,s=0,c;function e(){c=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return c={passive:!1},!0}})}catch{}}function i(){return c==null&&e(),c}function o(A,E,w){this.elem=A,this.type=E,this.callback=w}o.prototype.destroy=function(){r(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var h=l.addListener=function(A,E,w,m){A.addEventListener(E,w,i()),m&&m.$toDestroy.push(new o(A,E,w))},r=l.removeListener=function(A,E,w){A.removeEventListener(E,w,i())};l.stopEvent=function(A){return l.stopPropagation(A),l.preventDefault(A),!1},l.stopPropagation=function(A){A.stopPropagation&&A.stopPropagation()},l.preventDefault=function(A){A.preventDefault&&A.preventDefault()},l.getButton=function(A){return A.type=="dblclick"?0:A.type=="contextmenu"||p.isMac&&A.ctrlKey&&!A.altKey&&!A.shiftKey?2:A.button},l.capture=function(A,E,w){var m=A&&A.ownerDocument||document;function S(k){E&&E(k),w&&w(k),r(m,"mousemove",E),r(m,"mouseup",S),r(m,"dragstart",S)}return h(m,"mousemove",E),h(m,"mouseup",S),h(m,"dragstart",S),S},l.addMouseWheelListener=function(A,E,w){h(A,"wheel",function(m){var S=.15,k=m.deltaX||0,D=m.deltaY||0;switch(m.deltaMode){case m.DOM_DELTA_PIXEL:m.wheelX=k*S,m.wheelY=D*S;break;case m.DOM_DELTA_LINE:var _=15;m.wheelX=k*_,m.wheelY=D*_;break;case m.DOM_DELTA_PAGE:var F=150;m.wheelX=k*F,m.wheelY=D*F;break}E(m)},w)},l.addMultiMouseDownListener=function(A,E,w,m,S){var k=0,D,_,F,x={2:"dblclick",3:"tripleclick",4:"quadclick"};function $(C){if(l.getButton(C)!==0?k=0:C.detail>1?(k++,k>4&&(k=1)):k=1,p.isIE){var b=Math.abs(C.clientX-D)>5||Math.abs(C.clientY-_)>5;(!F||b)&&(k=1),F&&clearTimeout(F),F=setTimeout(function(){F=null},E[k-1]||600),k==1&&(D=C.clientX,_=C.clientY)}if(C._clicks=k,w[m]("mousedown",C),k>4)k=0;else if(k>1)return w[m](x[k],C)}Array.isArray(A)||(A=[A]),A.forEach(function(C){h(C,"mousedown",$,S)})};function u(A){return 0|(A.ctrlKey?1:0)|(A.altKey?2:0)|(A.shiftKey?4:0)|(A.metaKey?8:0)}l.getModifierString=function(A){return a.KEY_MODS[u(A)]};function f(A,E,w){var m=u(E);if(!w&&E.code&&(w=a.$codeToKeyCode[E.code]||w),!p.isMac&&d){if(E.getModifierState&&(E.getModifierState("OS")||E.getModifierState("Win"))&&(m|=8),d.altGr)if((3&m)!=3)d.altGr=0;else return;if(w===18||w===17){var S=E.location;if(w===17&&S===1)d[w]==1&&(s=E.timeStamp);else if(w===18&&m===3&&S===2){var k=E.timeStamp-s;k<50&&(d.altGr=!0)}}}if(w in a.MODIFIER_KEYS&&(w=-1),!(!m&&w===13&&E.location===3&&(A(E,m,-w),E.defaultPrevented))){if(p.isChromeOS&&m&8){if(A(E,m,w),E.defaultPrevented)return;m&=-9}return!m&&!(w in a.FUNCTION_KEYS)&&!(w in a.PRINTABLE_KEYS)?!1:A(E,m,w)}}l.addCommandKeyListener=function(A,E,w){var m=null;h(A,"keydown",function(S){d[S.keyCode]=(d[S.keyCode]||0)+1;var k=f(E,S,S.keyCode);return m=S.defaultPrevented,k},w),h(A,"keypress",function(S){m&&(S.ctrlKey||S.altKey||S.shiftKey||S.metaKey)&&(l.stopEvent(S),m=null)},w),h(A,"keyup",function(S){d[S.keyCode]=null},w),d||(g(),h(window,"focus",g))};function g(){d=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!p.isOldIE){var v=1;l.nextTick=function(A,E){E=E||window;var w="zero-timeout-message-"+v++,m=function(S){S.data==w&&(l.stopPropagation(S),r(E,"message",m),A())};h(E,"message",m),E.postMessage(w,"*")}}l.$idleBlocked=!1,l.onIdle=function(A,E){return setTimeout(function w(){l.$idleBlocked?setTimeout(w,100):A()},E)},l.$idleBlockId=null,l.blockIdle=function(A){l.$idleBlockId&&clearTimeout(l.$idleBlockId),l.$idleBlocked=!0,l.$idleBlockId=setTimeout(function(){l.$idleBlocked=!1},A||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(A){setTimeout(A,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(n,l,y){var a;y.exports={lineMode:!1,pasteCancelled:function(){return a&&a>Date.now()-50?!0:a=!1},cancel:function(){a=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(n,l,y){var a=n("../lib/event"),p=n("../config").nls,d=n("../lib/useragent"),s=n("../lib/dom"),c=n("../lib/lang"),e=n("../clipboard"),i=d.isChrome<18,o=d.isIE,h=d.isChrome>63,r=400,u=n("../lib/keys"),f=u.KEY_MODS,g=d.isIOS,v=g?/\s/:/\n/,A=d.isMobile,E=(function(){function w(m,S){var k=this;this.host=S,this.text=s.createElement("textarea"),this.text.className="ace_text-input",this.text.setAttribute("wrap","off"),this.text.setAttribute("autocomplete","off"),this.text.setAttribute("autocorrect","off"),this.text.setAttribute("autocapitalize","off"),this.text.setAttribute("spellcheck","false"),this.text.style.opacity="0",m.insertBefore(this.text,m.firstChild),this.copied=!1,this.pasted=!1,this.inComposition=!1,this.sendingText=!1,this.tempStyle="",A||(this.text.style.fontSize="1px"),this.commandMode=!1,this.ignoreFocusEvents=!1,this.lastValue="",this.lastSelectionStart=0,this.lastSelectionEnd=0,this.lastRestoreEnd=0,this.rowStart=Number.MAX_SAFE_INTEGER,this.rowEnd=Number.MIN_SAFE_INTEGER,this.numberOfExtraLines=0;try{this.$isFocused=document.activeElement===this.text}catch{}this.cancelComposition=this.cancelComposition.bind(this),this.setAriaOptions({role:"textbox"}),a.addListener(this.text,"blur",function(D){k.ignoreFocusEvents||(S.onBlur(D),k.$isFocused=!1)},S),a.addListener(this.text,"focus",function(D){if(!k.ignoreFocusEvents){if(k.$isFocused=!0,d.isEdge)try{if(!document.hasFocus())return}catch{}S.onFocus(D),d.isEdge?setTimeout(k.resetSelection.bind(k)):k.resetSelection()}},S),this.$focusScroll=!1,S.on("beforeEndOperation",function(){var D=S.curOp,_=D&&D.command&&D.command.name;if(_!="insertstring"){var F=_&&(D.docChanged||D.selectionChanged);k.inComposition&&F&&(k.lastValue=k.text.value="",k.onCompositionEnd()),k.resetSelection()}}),S.on("changeSelection",this.setAriaLabel.bind(this)),this.resetSelection=g?this.$resetSelectionIOS:this.$resetSelection,this.$isFocused&&S.onFocus(),this.inputHandler=null,this.afterContextMenu=!1,a.addCommandKeyListener(this.text,function(D,_,F){if(!k.inComposition)return S.onCommandKey(D,_,F)},S),a.addListener(this.text,"select",this.onSelect.bind(this),S),a.addListener(this.text,"input",this.onInput.bind(this),S),a.addListener(this.text,"cut",this.onCut.bind(this),S),a.addListener(this.text,"copy",this.onCopy.bind(this),S),a.addListener(this.text,"paste",this.onPaste.bind(this),S),(!("oncut"in this.text)||!("oncopy"in this.text)||!("onpaste"in this.text))&&a.addListener(m,"keydown",function(D){if(!(d.isMac&&!D.metaKey||!D.ctrlKey))switch(D.keyCode){case 67:k.onCopy(D);break;case 86:k.onPaste(D);break;case 88:k.onCut(D);break}},S),this.syncComposition=c.delayedCall(this.onCompositionUpdate.bind(this),50).schedule.bind(null,null),a.addListener(this.text,"compositionstart",this.onCompositionStart.bind(this),S),a.addListener(this.text,"compositionupdate",this.onCompositionUpdate.bind(this),S),a.addListener(this.text,"keyup",this.onKeyup.bind(this),S),a.addListener(this.text,"keydown",this.syncComposition.bind(this),S),a.addListener(this.text,"compositionend",this.onCompositionEnd.bind(this),S),this.closeTimeout,a.addListener(this.text,"mouseup",this.$onContextMenu.bind(this),S),a.addListener(this.text,"mousedown",function(D){D.preventDefault(),k.onContextMenuClose()},S),a.addListener(S.renderer.scroller,"contextmenu",this.$onContextMenu.bind(this),S),a.addListener(this.text,"contextmenu",this.$onContextMenu.bind(this),S),g&&this.addIosSelectionHandler(m,S,this.text)}return w.prototype.addIosSelectionHandler=function(m,S,k){var D=this,_=null,F=!1;k.addEventListener("keydown",function($){_&&clearTimeout(_),F=!0},!0),k.addEventListener("keyup",function($){_=setTimeout(function(){F=!1},100)},!0);var x=function($){if(document.activeElement===k&&!(F||D.inComposition||S.$mouseHandler.isMousePressed)&&!D.copied){var C=k.selectionStart,b=k.selectionEnd,T=null,I=0;if(C==0?T=u.up:C==1?T=u.home:b>D.lastSelectionEnd&&D.lastValue[b]==`
|
|
181
|
-
`?T=u.end:C<D.lastSelectionStart&&D.lastValue[C-1]==" "?(T=u.left,I=f.option):C<D.lastSelectionStart||C==D.lastSelectionStart&&D.lastSelectionEnd!=D.lastSelectionStart&&C==b?T=u.left:b>D.lastSelectionEnd&&D.lastValue.slice(0,b).split(`
|
|
182
|
-
`).length>2?T=u.down:b>D.lastSelectionEnd&&D.lastValue[b-1]==" "?(T=u.right,I=f.option):(b>D.lastSelectionEnd||b==D.lastSelectionEnd&&D.lastSelectionEnd!=D.lastSelectionStart&&C==b)&&(T=u.right),C!==b&&(I|=f.shift),T){var R=S.onCommandKey({},I,T);if(!R&&S.commands){T=u.keyCodeToString(T);var N=S.commands.findKeyCommand(I,T);N&&S.execCommand(N)}D.lastSelectionStart=C,D.lastSelectionEnd=b,D.resetSelection("")}}};document.addEventListener("selectionchange",x),S.on("destroy",function(){document.removeEventListener("selectionchange",x)})},w.prototype.onContextMenuClose=function(){var m=this;clearTimeout(this.closeTimeout),this.closeTimeout=setTimeout(function(){m.tempStyle&&(m.text.style.cssText=m.tempStyle,m.tempStyle=""),m.host.renderer.$isMousePressed=!1,m.host.renderer.$keepTextAreaAtCursor&&m.host.renderer.$moveTextAreaToCursor()},0)},w.prototype.$onContextMenu=function(m){this.host.textInput.onContextMenu(m),this.onContextMenuClose()},w.prototype.onKeyup=function(m){m.keyCode==27&&this.text.value.length<this.text.selectionStart&&(this.inComposition||(this.lastValue=this.text.value),this.lastSelectionStart=this.lastSelectionEnd=-1,this.resetSelection()),this.syncComposition()},w.prototype.cancelComposition=function(){this.ignoreFocusEvents=!0,this.text.blur(),this.text.focus(),this.ignoreFocusEvents=!1},w.prototype.onCompositionStart=function(m){if(!(this.inComposition||!this.host.onCompositionStart||this.host.$readOnly)&&(this.inComposition={},!this.commandMode)){m.data&&(this.inComposition.useTextareaForIME=!1),setTimeout(this.onCompositionUpdate.bind(this),0),this.host._signal("compositionStart"),this.host.on("mousedown",this.cancelComposition);var S=this.host.getSelectionRange();S.end.row=S.start.row,S.end.column=S.start.column,this.inComposition.markerRange=S,this.inComposition.selectionStart=this.lastSelectionStart,this.host.onCompositionStart(this.inComposition),this.inComposition.useTextareaForIME?(this.lastValue=this.text.value="",this.lastSelectionStart=0,this.lastSelectionEnd=0):(this.text.msGetInputContext&&(this.inComposition.context=this.text.msGetInputContext()),this.text.getInputContext&&(this.inComposition.context=this.text.getInputContext()))}},w.prototype.onCompositionUpdate=function(){if(!(!this.inComposition||!this.host.onCompositionUpdate||this.host.$readOnly)){if(this.commandMode)return this.cancelComposition();if(this.inComposition.useTextareaForIME)this.host.onCompositionUpdate(this.text.value);else{var m=this.text.value;this.sendText(m),this.inComposition.markerRange&&(this.inComposition.context&&(this.inComposition.markerRange.start.column=this.inComposition.selectionStart=this.inComposition.context.compositionStartOffset),this.inComposition.markerRange.end.column=this.inComposition.markerRange.start.column+this.lastSelectionEnd-this.inComposition.selectionStart+this.lastRestoreEnd)}}},w.prototype.onCompositionEnd=function(m){!this.host.onCompositionEnd||this.host.$readOnly||(this.inComposition=!1,this.host.onCompositionEnd(),this.host.off("mousedown",this.cancelComposition),m&&this.onInput())},w.prototype.onCut=function(m){this.doCopy(m,!0)},w.prototype.onCopy=function(m){this.doCopy(m,!1)},w.prototype.onPaste=function(m){var S=this.handleClipboardData(m);e.pasteCancelled()||(typeof S=="string"?(S&&this.host.onPaste(S,m),d.isIE&&setTimeout(this.resetSelection),a.preventDefault(m)):(this.text.value="",this.pasted=!0))},w.prototype.doCopy=function(m,S){var k=this,D=this.host.getCopyText();if(!D)return a.preventDefault(m);this.handleClipboardData(m,D)?(g&&(this.resetSelection(D),this.copied=D,setTimeout(function(){k.copied=!1},10)),S?this.host.onCut():this.host.onCopy(),a.preventDefault(m)):(this.copied=!0,this.text.value=D,this.text.select(),setTimeout(function(){k.copied=!1,k.resetSelection(),S?k.host.onCut():k.host.onCopy()}))},w.prototype.handleClipboardData=function(m,S,k){var D=m.clipboardData||window.clipboardData;if(!(!D||i)){var _=o||k?"Text":"text/plain";try{return S?D.setData(_,S)!==!1:D.getData(_)}catch(F){if(!k)return this.handleClipboardData(F,S,!0)}}},w.prototype.onInput=function(m){if(this.inComposition)return this.onCompositionUpdate();if(m&&m.inputType){if(m.inputType=="historyUndo")return this.host.execCommand("undo");if(m.inputType=="historyRedo")return this.host.execCommand("redo")}var S=this.text.value,k=this.sendText(S,!0);(S.length>r+100||v.test(k)||A&&this.lastSelectionStart<1&&this.lastSelectionStart==this.lastSelectionEnd)&&this.resetSelection()},w.prototype.sendText=function(m,S){if(this.afterContextMenu&&(this.afterContextMenu=!1),this.pasted)return this.resetSelection(),m&&this.host.onPaste(m),this.pasted=!1,"";for(var k=this.text.selectionStart,D=this.text.selectionEnd,_=this.lastSelectionStart,F=this.lastValue.length-this.lastSelectionEnd,x=m,$=m.length-k,C=m.length-D,b=0;_>0&&this.lastValue[b]==m[b];)b++,_--;for(x=x.slice(b),b=1;F>0&&this.lastValue.length-b>this.lastSelectionStart-1&&this.lastValue[this.lastValue.length-b]==m[m.length-b];)b++,F--;$-=b-1,C-=b-1;var T=x.length-b+1;if(T<0&&(_=-T,T=0),x=x.slice(0,T),!S&&!x&&!$&&!_&&!F&&!C)return"";this.sendingText=!0;var I=!1;return d.isAndroid&&x==". "&&(x=" ",I=!0),x&&!_&&!F&&!$&&!C||this.commandMode?this.host.onTextInput(x):this.host.onTextInput(x,{extendLeft:_,extendRight:F,restoreStart:$,restoreEnd:C}),this.sendingText=!1,this.lastValue=m,this.lastSelectionStart=k,this.lastSelectionEnd=D,this.lastRestoreEnd=C,I?`
|
|
183
|
-
`:x},w.prototype.onSelect=function(m){var S=this;if(!this.inComposition){var k=function(D){return D.selectionStart===0&&D.selectionEnd>=S.lastValue.length&&D.value===S.lastValue&&S.lastValue&&D.selectionEnd!==S.lastSelectionEnd};this.copied?this.copied=!1:k(this.text)?(this.host.selectAll(),this.resetSelection()):A&&this.text.selectionStart!=this.lastSelectionStart&&this.resetSelection()}},w.prototype.$resetSelectionIOS=function(m){if(!(!this.$isFocused||this.copied&&!m||this.sendingText)){m||(m="");var S=`
|
|
184
|
-
ab`+m+`cde fg
|
|
185
|
-
`;S!=this.text.value&&(this.text.value=this.lastValue=S);var k=4,D=4+(m.length||(this.host.selection.isEmpty()?0:1));(this.lastSelectionStart!=k||this.lastSelectionEnd!=D)&&this.text.setSelectionRange(k,D),this.lastSelectionStart=k,this.lastSelectionEnd=D}},w.prototype.$resetSelection=function(){var m=this;if(!(this.inComposition||this.sendingText)&&!(!this.$isFocused&&!this.afterContextMenu)){this.inComposition=!0;var S=0,k=0,D="",_=function(N,P){for(var B=P,V=1;V<=N-m.rowStart&&V<2*m.numberOfExtraLines+1;V++)B+=m.host.session.getLine(N-V).length+1;return B};if(this.host.session){var F=this.host.selection,x=F.getRange(),$=F.cursor.row;$===this.rowEnd+1?(this.rowStart=this.rowEnd+1,this.rowEnd=this.rowStart+2*this.numberOfExtraLines):$===this.rowStart-1?(this.rowEnd=this.rowStart-1,this.rowStart=this.rowEnd-2*this.numberOfExtraLines):($<this.rowStart-1||$>this.rowEnd+1)&&(this.rowStart=$>this.numberOfExtraLines?$-this.numberOfExtraLines:0,this.rowEnd=$>this.numberOfExtraLines?$+this.numberOfExtraLines:2*this.numberOfExtraLines);for(var C=[],b=this.rowStart;b<=this.rowEnd;b++)C.push(this.host.session.getLine(b));if(D=C.join(`
|
|
186
|
-
`),S=_(x.start.row,x.start.column),k=_(x.end.row,x.end.column),x.start.row<this.rowStart){var T=this.host.session.getLine(this.rowStart-1);S=x.start.row<this.rowStart-1?0:S,k+=T.length+1,D=T+`
|
|
187
|
-
`+D}else if(x.end.row>this.rowEnd){var I=this.host.session.getLine(this.rowEnd+1);k=x.end.row>this.rowEnd+1?I.length:x.end.column,k+=D.length+1,D=D+`
|
|
188
|
-
`+I}else A&&$>0&&(D=`
|
|
189
|
-
`+D,k+=1,S+=1);D.length>r&&(S<r&&k<r?D=D.slice(0,r):(D=`
|
|
190
|
-
`,S==k?S=k=0:(S=0,k=1)));var R=D+`
|
|
191
|
-
|
|
192
|
-
`;R!=this.lastValue&&(this.text.value=this.lastValue=R,this.lastSelectionStart=this.lastSelectionEnd=R.length)}if(this.afterContextMenu&&(this.lastSelectionStart=this.text.selectionStart,this.lastSelectionEnd=this.text.selectionEnd),this.lastSelectionEnd!=k||this.lastSelectionStart!=S||this.text.selectionEnd!=this.lastSelectionEnd)try{this.text.setSelectionRange(S,k),this.lastSelectionStart=S,this.lastSelectionEnd=k}catch{}this.inComposition=!1}},w.prototype.setHost=function(m){this.host=m},w.prototype.setNumberOfExtraLines=function(m){if(this.rowStart=Number.MAX_SAFE_INTEGER,this.rowEnd=Number.MIN_SAFE_INTEGER,m<0){this.numberOfExtraLines=0;return}this.numberOfExtraLines=m},w.prototype.setAriaLabel=function(){var m="";if(this.host.$textInputAriaLabel&&(m+="".concat(this.host.$textInputAriaLabel,", ")),this.host.session){var S=this.host.session.selection.cursor.row;m+=p("text-input.aria-label","Cursor at row $0",[S+1])}this.text.setAttribute("aria-label",m)},w.prototype.setAriaOptions=function(m){m.activeDescendant?(this.text.setAttribute("aria-haspopup","true"),this.text.setAttribute("aria-autocomplete",m.inline?"both":"list"),this.text.setAttribute("aria-activedescendant",m.activeDescendant)):(this.text.setAttribute("aria-haspopup","false"),this.text.setAttribute("aria-autocomplete","both"),this.text.removeAttribute("aria-activedescendant")),m.role&&this.text.setAttribute("role",m.role),m.setLabel&&(this.text.setAttribute("aria-roledescription",p("text-input.aria-roledescription","editor")),this.setAriaLabel())},w.prototype.focus=function(){var m=this;if(this.setAriaOptions({setLabel:this.host.renderer.enableKeyboardAccessibility}),this.tempStyle||h||this.$focusScroll=="browser")return this.text.focus({preventScroll:!0});var S=this.text.style.top;this.text.style.position="fixed",this.text.style.top="0px";try{var k=this.text.getBoundingClientRect().top!=0}catch{return}var D=[];if(k)for(var _=this.text.parentElement;_&&_.nodeType==1;)D.push(_),_.setAttribute("ace_nocontext","true"),!_.parentElement&&_.getRootNode?_=_.getRootNode().host:_=_.parentElement;this.text.focus({preventScroll:!0}),k&&D.forEach(function(F){F.removeAttribute("ace_nocontext")}),setTimeout(function(){m.text.style.position="",m.text.style.top=="0px"&&(m.text.style.top=S)},0)},w.prototype.blur=function(){this.text.blur()},w.prototype.isFocused=function(){return this.$isFocused},w.prototype.setInputHandler=function(m){this.inputHandler=m},w.prototype.getInputHandler=function(){return this.inputHandler},w.prototype.getElement=function(){return this.text},w.prototype.setCommandMode=function(m){this.commandMode=m,this.text.readOnly=!1},w.prototype.setReadOnly=function(m){this.commandMode||(this.text.readOnly=m)},w.prototype.setCopyWithEmptySelection=function(m){},w.prototype.onContextMenu=function(m){this.afterContextMenu=!0,this.resetSelection(),this.host._emit("nativecontextmenu",{target:this.host,domEvent:m}),this.moveToMouse(m,!0)},w.prototype.moveToMouse=function(m,S){var k=this;this.tempStyle||(this.tempStyle=this.text.style.cssText),this.text.style.cssText=(S?"z-index:100000;":"")+(d.isIE?"opacity:0.1;":"")+"text-indent: -"+(this.lastSelectionStart+this.lastSelectionEnd)*this.host.renderer.characterWidth*.5+"px;";var D=this.host.container.getBoundingClientRect(),_=s.computedStyle(this.host.container),F=D.top+(parseInt(_.borderTopWidth)||0),x=D.left+(parseInt(_.borderLeftWidth)||0),$=D.bottom-F-this.text.clientHeight-2,C=function(b){s.translate(k.text,b.clientX-x-2,Math.min(b.clientY-F-2,$))};C(m),m.type=="mousedown"&&(this.host.renderer.$isMousePressed=!0,clearTimeout(this.closeTimeout),d.isWin&&a.capture(this.host.container,C,this.onContextMenuClose.bind(this)))},w.prototype.destroy=function(){this.text.parentElement&&this.text.parentElement.removeChild(this.text)},w})();l.TextInput=E,l.$setUserAgentForTests=function(w,m){A=w,g=m}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(n,l,y){var a=n("../lib/useragent"),p=0,d=550,s=(function(){function i(o){o.$clickSelection=null;var h=o.editor;h.setDefaultHandler("mousedown",this.onMouseDown.bind(o)),h.setDefaultHandler("dblclick",this.onDoubleClick.bind(o)),h.setDefaultHandler("tripleclick",this.onTripleClick.bind(o)),h.setDefaultHandler("quadclick",this.onQuadClick.bind(o)),h.setDefaultHandler("mousewheel",this.onMouseWheel.bind(o));var r=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];r.forEach(function(u){o[u]=this[u]},this),o.selectByLines=this.extendSelectionBy.bind(o,"getLineRange"),o.selectByWords=this.extendSelectionBy.bind(o,"getWordRange")}return i.prototype.onMouseDown=function(o){var h=o.inSelection(),r=o.getDocumentPosition();this.mousedownEvent=o;var u=this.editor,f=o.getButton();if(f!==0){var g=u.getSelectionRange(),v=g.isEmpty();(v||f==1)&&u.selection.moveToPosition(r),f==2&&(u.textInput.onContextMenu(o.domEvent),a.isMozilla||o.preventDefault());return}if(this.mousedownEvent.time=Date.now(),h&&!u.isFocused()&&(u.focus(),this.$focusTimeout&&!this.$clickSelection&&!u.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(o);return}return this.captureMouse(o),this.startSelect(r,o.domEvent._clicks>1),o.preventDefault()},i.prototype.startSelect=function(o,h){o=o||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var r=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?r.selection.selectToPosition(o):h||r.selection.moveToPosition(o),h||this.select(),r.setStyle("ace_selecting"),this.setState("select"))},i.prototype.select=function(){var o,h=this.editor,r=h.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var u=this.$clickSelection.comparePoint(r);if(u==-1)o=this.$clickSelection.end;else if(u==1)o=this.$clickSelection.start;else{var f=e(this.$clickSelection,r,h.session);r=f.cursor,o=f.anchor}h.selection.setSelectionAnchor(o.row,o.column)}h.selection.selectToPosition(r),h.renderer.scrollCursorIntoView()},i.prototype.extendSelectionBy=function(o){var h,r=this.editor,u=r.renderer.screenToTextCoordinates(this.x,this.y),f=r.selection[o](u.row,u.column);if(this.$clickSelection){var g=this.$clickSelection.comparePoint(f.start),v=this.$clickSelection.comparePoint(f.end);if(g==-1&&v<=0)h=this.$clickSelection.end,(f.end.row!=u.row||f.end.column!=u.column)&&(u=f.start);else if(v==1&&g>=0)h=this.$clickSelection.start,(f.start.row!=u.row||f.start.column!=u.column)&&(u=f.end);else if(g==-1&&v==1)u=f.end,h=f.start;else{var A=e(this.$clickSelection,u,r.session);u=A.cursor,h=A.anchor}r.selection.setSelectionAnchor(h.row,h.column)}r.selection.selectToPosition(u),r.renderer.scrollCursorIntoView()},i.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},i.prototype.focusWait=function(){var o=c(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),h=Date.now();(o>p||h-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},i.prototype.onDoubleClick=function(o){var h=o.getDocumentPosition(),r=this.editor,u=r.session,f=u.getBracketRange(h);f?(f.isEmpty()&&(f.start.column--,f.end.column++),this.setState("select")):(f=r.selection.getWordRange(h.row,h.column),this.setState("selectByWords")),this.$clickSelection=f,this.select()},i.prototype.onTripleClick=function(o){var h=o.getDocumentPosition(),r=this.editor;this.setState("selectByLines");var u=r.getSelectionRange();u.isMultiLine()&&u.contains(h.row,h.column)?(this.$clickSelection=r.selection.getLineRange(u.start.row),this.$clickSelection.end=r.selection.getLineRange(u.end.row).end):this.$clickSelection=r.selection.getLineRange(h.row),this.select()},i.prototype.onQuadClick=function(o){var h=this.editor;h.selectAll(),this.$clickSelection=h.getSelectionRange(),this.setState("selectAll")},i.prototype.onMouseWheel=function(o){if(!o.getAccelKey()){o.getShiftKey()&&o.wheelY&&!o.wheelX&&(o.wheelX=o.wheelY,o.wheelY=0);var h=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var r=this.$lastScroll,u=o.domEvent.timeStamp,f=u-r.t,g=f?o.wheelX/f:r.vx,v=f?o.wheelY/f:r.vy;f<d&&(g=(g+r.vx)/2,v=(v+r.vy)/2);var A=Math.abs(g/v),E=!1;if(A>=1&&h.renderer.isScrollableBy(o.wheelX*o.speed,0)&&(E=!0),A<=1&&h.renderer.isScrollableBy(0,o.wheelY*o.speed)&&(E=!0),E)r.allowed=u;else if(u-r.allowed<d){var w=Math.abs(g)<=1.5*Math.abs(r.vx)&&Math.abs(v)<=1.5*Math.abs(r.vy);w?(E=!0,r.allowed=u):r.allowed=0}if(r.t=u,r.vx=g,r.vy=v,E)return h.renderer.scrollBy(o.wheelX*o.speed,o.wheelY*o.speed),o.stop()}},i})();s.prototype.selectEnd=s.prototype.selectByLinesEnd,s.prototype.selectAllEnd=s.prototype.selectByLinesEnd,s.prototype.selectByWordsEnd=s.prototype.selectByLinesEnd,l.DefaultHandlers=s;function c(i,o,h,r){return Math.sqrt(Math.pow(h-i,2)+Math.pow(r-o,2))}function e(i,o,h){if(i.start.row==i.end.row)var r=2*o.column-i.start.column-i.end.column;else if(i.start.row==i.end.row-1&&!i.start.column&&!i.end.column)var r=3*o.column-2*h.getLine(i.start.row).length;else var r=2*o.row-i.start.row-i.end.row;return r<0?{cursor:i.start,anchor:i.end}:{cursor:i.end,anchor:i.start}}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(n,l,y){var a=n("../lib/event"),p=n("../lib/useragent"),d=(function(){function s(c,e){this.speed,this.wheelX,this.wheelY,this.domEvent=c,this.editor=e,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 s.prototype.stopPropagation=function(){a.stopPropagation(this.domEvent),this.propagationStopped=!0},s.prototype.preventDefault=function(){a.preventDefault(this.domEvent),this.defaultPrevented=!0},s.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},s.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},s.prototype.getGutterRow=function(){var c=this.getDocumentPosition().row,e=this.editor.session.documentToScreenRow(c,0),i=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return e-i},s.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var c=this.editor,e=c.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var i=this.getDocumentPosition();this.$inSelection=e.contains(i.row,i.column)}return this.$inSelection},s.prototype.getButton=function(){return a.getButton(this.domEvent)},s.prototype.getShiftKey=function(){return this.domEvent.shiftKey},s.prototype.getAccelKey=function(){return p.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},s})();l.MouseEvent=d}),ace.define("ace/lib/scroll",["require","exports","module"],function(n,l,y){l.preventParentScroll=function(p){p.stopPropagation();var d=p.currentTarget,s=d.scrollHeight>d.clientHeight;s||p.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(n,l,y){var a=this&&this.__extends||(function(){var u=function(f,g){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,A){v.__proto__=A}||function(v,A){for(var E in A)Object.prototype.hasOwnProperty.call(A,E)&&(v[E]=A[E])},u(f,g)};return function(f,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");u(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})(),p=this&&this.__values||function(u){var f=typeof Symbol=="function"&&Symbol.iterator,g=f&&u[f],v=0;if(g)return g.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&v>=u.length&&(u=void 0),{value:u&&u[v++],done:!u}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},d=n("./lib/dom");n("./lib/event");var s=n("./range").Range,c=n("./lib/scroll").preventParentScroll,e="ace_tooltip",i=(function(){function u(f){this.isOpen=!1,this.$element=null,this.$parentNode=f}return u.prototype.$init=function(){return this.$element=d.createElement("div"),this.$element.className=e,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},u.prototype.getElement=function(){return this.$element||this.$init()},u.prototype.setText=function(f){this.getElement().textContent=f},u.prototype.setHtml=function(f){this.getElement().innerHTML=f},u.prototype.setPosition=function(f,g){this.getElement().style.left=f+"px",this.getElement().style.top=g+"px"},u.prototype.setClassName=function(f){d.addCssClass(this.getElement(),f)},u.prototype.setTheme=function(f){this.theme&&(this.theme.isDark&&d.removeCssClass(this.getElement(),"ace_dark"),this.theme.cssClass&&d.removeCssClass(this.getElement(),this.theme.cssClass)),f.isDark&&d.addCssClass(this.getElement(),"ace_dark"),f.cssClass&&d.addCssClass(this.getElement(),f.cssClass),this.theme={isDark:f.isDark,cssClass:f.cssClass}},u.prototype.show=function(f,g,v){f!=null&&this.setText(f),g!=null&&v!=null&&this.setPosition(g,v),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},u.prototype.hide=function(f){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=e,this.isOpen=!1)},u.prototype.getHeight=function(){return this.getElement().offsetHeight},u.prototype.getWidth=function(){return this.getElement().offsetWidth},u.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},u})(),o=(function(){function u(){this.popups=[]}return u.prototype.addPopup=function(f){this.popups.push(f),this.updatePopups()},u.prototype.removePopup=function(f){var g=this.popups.indexOf(f);g!==-1&&(this.popups.splice(g,1),this.updatePopups())},u.prototype.updatePopups=function(){var f,g,v,A;this.popups.sort(function(x,$){return $.priority-x.priority});var E=[];try{for(var w=p(this.popups),m=w.next();!m.done;m=w.next()){var S=m.value,k=!0;try{for(var D=(v=void 0,p(E)),_=D.next();!_.done;_=D.next()){var F=_.value;if(this.doPopupsOverlap(F,S)){k=!1;break}}}catch(x){v={error:x}}finally{try{_&&!_.done&&(A=D.return)&&A.call(D)}finally{if(v)throw v.error}}k?E.push(S):S.hide()}}catch(x){f={error:x}}finally{try{m&&!m.done&&(g=w.return)&&g.call(w)}finally{if(f)throw f.error}}},u.prototype.doPopupsOverlap=function(f,g){var v=f.getElement().getBoundingClientRect(),A=g.getElement().getBoundingClientRect();return v.left<A.right&&v.right>A.left&&v.top<A.bottom&&v.bottom>A.top},u})(),h=new o;l.popupManager=h,l.Tooltip=i;var r=(function(u){a(f,u);function f(g){g===void 0&&(g=document.body);var v=u.call(this,g)||this;v.timeout=void 0,v.lastT=0,v.idleTime=350,v.lastEvent=void 0,v.onMouseOut=v.onMouseOut.bind(v),v.onMouseMove=v.onMouseMove.bind(v),v.waitForHover=v.waitForHover.bind(v),v.hide=v.hide.bind(v);var A=v.getElement();return A.style.whiteSpace="pre-wrap",A.style.pointerEvents="auto",A.addEventListener("mouseout",v.onMouseOut),A.tabIndex=-1,A.addEventListener("blur",function(){A.contains(document.activeElement)||this.hide()}.bind(v)),A.addEventListener("wheel",c),v}return f.prototype.addToEditor=function(g){g.on("mousemove",this.onMouseMove),g.on("mousedown",this.hide);var v=g.renderer.getMouseEventTarget();v&&typeof v.removeEventListener=="function"&&v.addEventListener("mouseout",this.onMouseOut,!0)},f.prototype.removeFromEditor=function(g){g.off("mousemove",this.onMouseMove),g.off("mousedown",this.hide);var v=g.renderer.getMouseEventTarget();v&&typeof v.removeEventListener=="function"&&v.removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},f.prototype.onMouseMove=function(g,v){this.lastEvent=g,this.lastT=Date.now();var A=v.$mouseHandler.isMousePressed;if(this.isOpen){var E=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(E.row,E.column)||A||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||A||(this.lastEvent=g,this.timeout=setTimeout(this.waitForHover,this.idleTime))},f.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var g=Date.now()-this.lastT;if(this.idleTime-g>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-g);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},f.prototype.isOutsideOfText=function(g){var v=g.editor,A=g.getDocumentPosition(),E=v.session.getLine(A.row);if(A.column==E.length){var w=v.renderer.pixelToScreenCoordinates(g.clientX,g.clientY),m=v.session.documentToScreenPosition(A.row,A.column);if(m.column!=w.column||m.row!=w.row)return!0}return!1},f.prototype.setDataProvider=function(g){this.$gatherData=g},f.prototype.showForRange=function(g,v,A,E){if(!(E&&E!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var w=g.renderer;this.isOpen||(h.addPopup(this),this.$registerCloseEvents(),this.setTheme(w.theme)),this.isOpen=!0,this.range=s.fromPoints(v.start,v.end);var m=w.textToScreenCoordinates(v.start.row,v.start.column),S=w.scroller.getBoundingClientRect();m.pageX<S.left&&(m.pageX=S.left);var k=this.getElement();k.innerHTML="",k.appendChild(A),k.style.maxHeight="",k.style.display="block",this.$setPosition(g,m,!0,v),d.$fixPositionBug(k)}},f.prototype.$setPosition=function(g,v,A,E){var w=10;A&&this.addMarker(E,g.session);var m=g.renderer,S=this.getElement(),k=S.offsetHeight,D=S.offsetWidth,_=v.pageY,F=v.pageX,x=window.innerHeight-_-m.lineHeight,$=this.$shouldPlaceAbove(k,_,x-w);S.style.maxHeight=($?_:x)-w+"px",S.style.top=$?"":_+m.lineHeight+"px",S.style.bottom=$?window.innerHeight-_+"px":"",S.style.left=Math.min(F,window.innerWidth-D-w)+"px"},f.prototype.$shouldPlaceAbove=function(g,v,A){return!(v-g<0&&v<A)},f.prototype.addMarker=function(g,v){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=v,this.marker=v&&v.addMarker(g,"ace_highlight-marker","text")},f.prototype.hide=function(g){g&&this.$fromKeyboard&&g.type=="keydown"&&g.code=="Escape"||!g&&document.activeElement==this.getElement()||g&&g.target&&(g.type!="keydown"||g.ctrlKey||g.metaKey)&&this.$element.contains(g.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$fromKeyboard=!1,this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,h.removePopup(this)))},f.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},f.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},f.prototype.onMouseOut=function(g){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!g.relatedTarget||this.getElement().contains(g.relatedTarget)||g&&g.currentTarget.contains(g.relatedTarget)||g.relatedTarget.classList.contains("ace_content")||this.hide())},f})(i);l.HoverTooltip=r}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/mouse/mouse_event","ace/tooltip","ace/config","ace/range"],function(n,l,y){var a=this&&this.__extends||(function(){var r=function(u,f){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,v){g.__proto__=v}||function(g,v){for(var A in v)Object.prototype.hasOwnProperty.call(v,A)&&(g[A]=v[A])},r(u,f)};return function(u,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");r(u,f);function g(){this.constructor=u}u.prototype=f===null?Object.create(f):(g.prototype=f.prototype,new g)}})(),p=this&&this.__values||function(r){var u=typeof Symbol=="function"&&Symbol.iterator,f=u&&r[u],g=0;if(f)return f.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&g>=r.length&&(r=void 0),{value:r&&r[g++],done:!r}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")},d=n("../lib/dom"),s=n("./mouse_event").MouseEvent,c=n("../tooltip").HoverTooltip,e=n("../config").nls,i=n("../range").Range;function o(r){var u=r.editor,f=u.renderer.$gutterLayer;r.$tooltip=new h(u),r.$tooltip.addToEditor(u),r.$tooltip.setDataProvider(function(g,v){var A=g.getDocumentPosition().row;r.$tooltip.showTooltip(A)}),r.editor.setDefaultHandler("guttermousedown",function(g){if(!(!u.isFocused()||g.getButton()!=0)){var v=f.getRegion(g);if(v!="foldWidgets"){var A=g.getDocumentPosition().row,E=u.session.selection;if(g.getShiftKey())E.selectTo(A,0);else{if(g.domEvent.detail==2)return u.selectAll(),g.preventDefault();r.$clickSelection=u.selection.getLineRange(A)}return r.setState("selectByLines"),r.captureMouse(g),g.preventDefault()}}})}l.GutterHandler=o;var h=(function(r){a(u,r);function u(f){var g=r.call(this,f.container)||this;g.id="gt"+ ++u.$uid,g.editor=f,g.visibleTooltipRow;var v=g.getElement();return v.setAttribute("role","tooltip"),v.setAttribute("id",g.id),v.style.pointerEvents="auto",g.idleTime=50,g.onDomMouseMove=g.onDomMouseMove.bind(g),g.onDomMouseOut=g.onDomMouseOut.bind(g),g.setClassName("ace_gutter-tooltip"),g}return u.prototype.onDomMouseMove=function(f){var g=new s(f,this.editor);this.onMouseMove(g,this.editor)},u.prototype.onDomMouseOut=function(f){var g=new s(f,this.editor);this.onMouseOut(g)},u.prototype.addToEditor=function(f){var g=f.renderer.$gutter;g.addEventListener("mousemove",this.onDomMouseMove),g.addEventListener("mouseout",this.onDomMouseOut),r.prototype.addToEditor.call(this,f)},u.prototype.removeFromEditor=function(f){var g=f.renderer.$gutter;g.removeEventListener("mousemove",this.onDomMouseMove),g.removeEventListener("mouseout",this.onDomMouseOut),r.prototype.removeFromEditor.call(this,f)},u.prototype.destroy=function(){this.editor&&this.removeFromEditor(this.editor),r.prototype.destroy.call(this)},Object.defineProperty(u,"annotationLabels",{get:function(){return{error:{singular:e("gutter-tooltip.aria-label.error.singular","error"),plural:e("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:e("gutter-tooltip.aria-label.security.singular","security finding"),plural:e("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:e("gutter-tooltip.aria-label.warning.singular","warning"),plural:e("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:e("gutter-tooltip.aria-label.info.singular","information message"),plural:e("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:e("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:e("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),u.prototype.showTooltip=function(f){var g,v=this.editor.renderer.$gutterLayer,A=v.$annotations[f],E;A?E={displayText:Array.from(A.displayText),type:Array.from(A.type)}:E={displayText:[],type:[]};var w=v.session.getFoldLine(f);if(w&&v.$showFoldedAnnotations){for(var m={error:[],security:[],warning:[],info:[],hint:[]},S={error:1,security:2,warning:3,info:4,hint:5},k,D=f+1;D<=w.end.row;D++)if(v.$annotations[D])for(var _=0;_<v.$annotations[D].text.length;_++){var F=v.$annotations[D].type[_];m[F].push(v.$annotations[D].text[_]),(!k||S[F]<S[k])&&(k=F)}if(["error","security","warning"].includes(k)){var x="".concat(u.annotationsToSummaryString(m)," in folded code.");E.displayText.push(x),E.type.push(k+"_fold")}}if(E.displayText.length===0)return this.hide();for(var $={error:[],security:[],warning:[],info:[],hint:[]},C=v.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",D=0;D<E.displayText.length;D++){var b=d.createElement("span"),T=d.createElement("span");(g=T.classList).add.apply(g,["ace_".concat(E.type[D]),C]),T.setAttribute("aria-label","".concat(u.annotationLabels[E.type[D].replace("_fold","")].singular)),T.setAttribute("role","img"),T.appendChild(d.createTextNode(" ")),b.appendChild(T),b.appendChild(d.createTextNode(E.displayText[D])),b.appendChild(d.createElement("br")),$[E.type[D].replace("_fold","")].push(b)}var I=d.createElement("span");$.error.forEach(function(P){return I.appendChild(P)}),$.security.forEach(function(P){return I.appendChild(P)}),$.warning.forEach(function(P){return I.appendChild(P)}),$.info.forEach(function(P){return I.appendChild(P)}),$.hint.forEach(function(P){return I.appendChild(P)}),I.setAttribute("aria-live","polite");var R=this.$findLinkedAnnotationNode(f);R&&R.setAttribute("aria-describedby",this.id);var N=i.fromPoints({row:f,column:0},{row:f,column:0});this.showForRange(this.editor,N,I),this.visibleTooltipRow=f,this.editor._signal("showGutterTooltip",this)},u.prototype.$setPosition=function(f,g,v,A){var E=this.$findCellByRow(A.start.row);if(E){var w=E&&E.element,m=w&&w.querySelector(".ace_gutter_annotation");if(m){var S=m.getBoundingClientRect();if(S){var k={pageX:S.right,pageY:S.top};return r.prototype.$setPosition.call(this,f,k,!1,A)}}}},u.prototype.$shouldPlaceAbove=function(f,g,v){return v<f},u.prototype.$findLinkedAnnotationNode=function(f){var g=this.$findCellByRow(f);if(g){var v=g.element;if(v.childNodes.length>2)return v.childNodes[2]}},u.prototype.$findCellByRow=function(f){return this.editor.renderer.$gutterLayer.$lines.cells.find(function(g){return g.row===f})},u.prototype.hide=function(f){if(this.isOpen){if(this.$element.removeAttribute("aria-live"),this.visibleTooltipRow!=null){var g=this.$findLinkedAnnotationNode(this.visibleTooltipRow);g&&g.removeAttribute("aria-describedby")}this.visibleTooltipRow=void 0,this.editor._signal("hideGutterTooltip",this),r.prototype.hide.call(this,f)}},u.annotationsToSummaryString=function(f){var g,v,A=[],E=["error","security","warning","info","hint"];try{for(var w=p(E),m=w.next();!m.done;m=w.next()){var S=m.value;if(f[S].length){var k=f[S].length===1?u.annotationLabels[S].singular:u.annotationLabels[S].plural;A.push("".concat(f[S].length," ").concat(k))}}}catch(D){g={error:D}}finally{try{m&&!m.done&&(v=w.return)&&v.call(w)}finally{if(g)throw g.error}}return A.join(", ")},u.prototype.isOutsideOfText=function(f){var g=f.editor,v=g.renderer.$gutter.getBoundingClientRect();return!(f.clientX>=v.left&&f.clientX<=v.right&&f.clientY>=v.top&&f.clientY<=v.bottom)},u})(c);h.$uid=0,l.GutterTooltip=h}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(n,l,y){var a=n("../lib/dom"),p=n("../lib/event"),d=n("../lib/useragent"),s=200,c=200,e=5;function i(h){var r=h.editor,u=a.createElement("div");u.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",u.textContent=" ";var f=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];f.forEach(function(W){h[W]=this[W]},this),r.on("mousedown",this.onMouseDown.bind(h));var g=r.container,v,A,E,w,m,S,k=0,D,_,F,x,$;this.onDragStart=function(W){if(this.cancelDrag||!g.draggable){var z=this;return setTimeout(function(){z.startSelect(),z.captureMouse(W)},0),W.preventDefault()}m=r.getSelectionRange();var U=W.dataTransfer;U.effectAllowed=r.getReadOnly()?"copy":"copyMove",r.container.appendChild(u),U.setDragImage&&U.setDragImage(u,0,0),setTimeout(function(){r.container.removeChild(u)}),U.clearData(),U.setData("Text",r.session.getTextRange()),_=!0,this.setState("drag")},this.onDragEnd=function(W){if(g.draggable=!1,_=!1,this.setState(null),!r.getReadOnly()){var z=W.dataTransfer.dropEffect;!D&&z=="move"&&r.session.remove(r.getSelectionRange()),r.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(W){if(!(r.getReadOnly()||!B(W.dataTransfer)))return A=W.clientX,E=W.clientY,v||I(),k++,W.dataTransfer.dropEffect=D=V(W),p.preventDefault(W)},this.onDragOver=function(W){if(!(r.getReadOnly()||!B(W.dataTransfer)))return A=W.clientX,E=W.clientY,v||(I(),k++),N!==null&&(N=null),W.dataTransfer.dropEffect=D=V(W),p.preventDefault(W)},this.onDragLeave=function(W){if(k--,k<=0&&v)return R(),D=null,p.preventDefault(W)},this.onDrop=function(W){if(S){var z=W.dataTransfer;if(_)switch(D){case"move":m.contains(S.row,S.column)?m={start:S,end:S}:m=r.moveText(m,S);break;case"copy":m=r.moveText(m,S,!0);break}else{var U=z.getData("Text");m={start:S,end:r.session.insert(S,U)},r.focus(),D=null}return R(),p.preventDefault(W)}},p.addListener(g,"dragstart",this.onDragStart.bind(h),r),p.addListener(g,"dragend",this.onDragEnd.bind(h),r),p.addListener(g,"dragenter",this.onDragEnter.bind(h),r),p.addListener(g,"dragover",this.onDragOver.bind(h),r),p.addListener(g,"dragleave",this.onDragLeave.bind(h),r),p.addListener(g,"drop",this.onDrop.bind(h),r);function C(W,z){var U=Date.now(),G=!z||W.row!=z.row,Y=!z||W.column!=z.column;if(!x||G||Y)r.moveCursorToPosition(W),x=U,$={x:A,y:E};else{var Q=o($.x,$.y,A,E);Q>e?x=null:U-x>=c&&(r.renderer.scrollCursorIntoView(),x=null)}}function b(W,z){var U=Date.now(),G=r.renderer.layerConfig.lineHeight,Y=r.renderer.layerConfig.characterWidth,Q=r.renderer.scroller.getBoundingClientRect(),q={x:{left:A-Q.left,right:Q.right-A},y:{top:E-Q.top,bottom:Q.bottom-E}},te=Math.min(q.x.left,q.x.right),re=Math.min(q.y.top,q.y.bottom),ue={row:W.row,column:W.column};te/Y<=2&&(ue.column+=q.x.left<q.x.right?-3:2),re/G<=1&&(ue.row+=q.y.top<q.y.bottom?-1:1);var me=W.row!=ue.row,Ce=W.column!=ue.column,ve=!z||W.row!=z.row;me||Ce&&!ve?F?U-F>=s&&r.renderer.scrollCursorIntoView(ue):F=U:F=null}function T(){var W=S;S=r.renderer.screenToTextCoordinates(A,E),C(S,W),b(S,W)}function I(){m=r.selection.toOrientedRange(),v=r.session.addMarker(m,"ace_selection",r.getSelectionStyle()),r.clearSelection(),r.isFocused()&&r.renderer.$cursorLayer.setBlinking(!1),clearInterval(w),T(),w=setInterval(T,20),k=0,p.addListener(document,"mousemove",P)}function R(){clearInterval(w),r.session.removeMarker(v),v=null,r.selection.fromOrientedRange(m),r.isFocused()&&!_&&r.$resetCursorStyle(),m=null,S=null,k=0,F=null,x=null,p.removeListener(document,"mousemove",P)}var N=null;function P(){N==null&&(N=setTimeout(function(){N!=null&&v&&R()},20))}function B(W){var z=W.types;return!z||Array.prototype.some.call(z,function(U){return U=="text/plain"||U=="Text"})}function V(W){var z=["copy","copymove","all","uninitialized"],U=["move","copymove","linkmove","all","uninitialized"],G=d.isMac?W.altKey:W.ctrlKey,Y="uninitialized";try{Y=W.dataTransfer.effectAllowed.toLowerCase()}catch{}var Q="none";return G&&z.indexOf(Y)>=0?Q="copy":U.indexOf(Y)>=0?Q="move":z.indexOf(Y)>=0&&(Q="copy"),Q}}(function(){this.dragWait=function(){var h=Date.now()-this.mousedownEvent.time;h>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var h=this.editor.container;h.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(h){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var h=this.editor,r=h.container;r.draggable=!0,h.renderer.$cursorLayer.setBlinking(!1),h.setStyle("ace_dragging");var u=d.isWin?"default":"move";h.renderer.setCursorStyle(u),this.setState("dragReady")},this.onMouseDrag=function(h){var r=this.editor.container;if(d.isIE&&this.state=="dragReady"){var u=o(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);u>3&&r.dragDrop()}if(this.state==="dragWait"){var u=o(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);u>0&&(r.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(h){if(this.$dragEnabled){this.mousedownEvent=h;var r=this.editor,u=h.inSelection(),f=h.getButton(),g=h.domEvent.detail||1;if(g===1&&f===0&&u){if(h.editor.inMultiSelectMode&&(h.getAccelKey()||h.getShiftKey()))return;this.mousedownEvent.time=Date.now();var v=h.domEvent.target||h.domEvent.srcElement;if("unselectable"in v&&(v.unselectable="on"),r.getDragDelay()){if(d.isWebKit){this.cancelDrag=!0;var A=r.container;A.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(h,this.onMouseDrag.bind(this)),h.defaultPrevented=!0}}}}).call(i.prototype);function o(h,r,u,f){return Math.sqrt(Math.pow(u-h,2)+Math.pow(f-r,2))}l.DragdropHandler=i}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(n,l,y){var a=n("./mouse_event").MouseEvent,p=n("../lib/event"),d=n("../lib/dom");l.addTouchListeners=function(s,c){var e="scroll",i,o,h,r,u,f,g=0,v,A=0,E=0,w=0,m,S;function k(){var C=window.navigator&&window.navigator.clipboard,b=!1,T=function(){var N=c.getCopyText(),P=c.session.getUndoManager().hasUndo();S.replaceChild(d.buildDom(b?["span",!N&&I("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],N&&I("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],N&&I("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],C&&I("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],P&&I("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],I("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],I("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),S.firstChild)},I=function(N){return c.commands.canExecute(N,c)},R=function(N){var P=N.target.getAttribute("action");if(P=="more"||!b)return b=!b,T();P=="paste"?C.readText().then(function(B){c.execCommand(P,B)}):P&&((P=="cut"||P=="copy")&&(C?C.writeText(c.getCopyText()):document.execCommand("copy")),c.execCommand(P)),S.firstChild.style.display="none",b=!1,P!="openCommandPalette"&&c.focus()};S=d.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(N){e="menu",N.stopPropagation(),N.preventDefault(),c.textInput.focus()},ontouchend:function(N){N.stopPropagation(),N.preventDefault(),R(N)},onclick:R},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],c.container)}function D(){if(!c.getOption("enableMobileMenu")){S&&_();return}S||k();var C=c.selection.cursor,b=c.renderer.textToScreenCoordinates(C.row,C.column),T=c.renderer.textToScreenCoordinates(0,0).pageX,I=c.renderer.scrollLeft,R=c.container.getBoundingClientRect();S.style.top=b.pageY-R.top-3+"px",b.pageX-R.left<R.width-70?(S.style.left="",S.style.right="10px"):(S.style.right="",S.style.left=T+I-R.left+"px"),S.style.display="",S.firstChild.style.display="none",c.on("input",_)}function _(C){S&&(S.style.display="none"),c.off("input",_)}function F(){u=null,clearTimeout(u);var C=c.selection.getRange(),b=C.contains(v.row,v.column);(C.isEmpty()||!b)&&(c.selection.moveToPosition(v),c.selection.selectWord()),e="wait",D()}function x(){u=null,clearTimeout(u),c.selection.moveToPosition(v);var C=A>=2?c.selection.getLineRange(v.row):c.session.getBracketRange(v);C&&!C.isEmpty()?c.selection.setRange(C):c.selection.selectWord(),e="wait"}p.addListener(s,"contextmenu",function(C){if(m){var b=c.textInput.getElement();b.focus()}},c),p.addListener(s,"touchstart",function(C){var b=C.touches;if(u||b.length>1){clearTimeout(u),u=null,h=-1,e="zoom";return}m=c.$mouseHandler.isMousePressed=!0;var T=c.renderer.layerConfig.lineHeight,I=c.renderer.layerConfig.lineHeight,R=C.timeStamp;r=R;var N=b[0],P=N.clientX,B=N.clientY;Math.abs(i-P)+Math.abs(o-B)>T&&(h=-1),i=C.clientX=P,o=C.clientY=B,E=w=0;var V=new a(C,c);if(v=V.getDocumentPosition(),R-h<500&&b.length==1&&!g)A++,C.preventDefault(),C.button=0,x();else{A=0;var W=c.selection.cursor,z=c.selection.isEmpty()?W:c.selection.anchor,U=c.renderer.$cursorLayer.getPixelPosition(W,!0),G=c.renderer.$cursorLayer.getPixelPosition(z,!0),Y=c.renderer.scroller.getBoundingClientRect(),Q=c.renderer.layerConfig.offset,q=c.renderer.scrollLeft,te=function(me,Ce){return me=me/I,Ce=Ce/T-.75,me*me+Ce*Ce};if(C.clientX<Y.left){e="zoom";return}var re=te(C.clientX-Y.left-U.left+q,C.clientY-Y.top-U.top+Q),ue=te(C.clientX-Y.left-G.left+q,C.clientY-Y.top-G.top+Q);re<3.5&&ue<3.5&&(e=re>ue?"cursor":"anchor"),ue<3.5?e="anchor":re<3.5?e="cursor":e="scroll",u=setTimeout(F,450)}h=R},c),p.addListener(s,"touchend",function(C){m=c.$mouseHandler.isMousePressed=!1,f&&clearInterval(f),e=="zoom"?(e="",g=0):u?(c.selection.moveToPosition(v),g=0,D()):e=="scroll"?($(),_()):D(),clearTimeout(u),u=null},c),p.addListener(s,"touchmove",function(C){u&&(clearTimeout(u),u=null);var b=C.touches;if(!(b.length>1||e=="zoom")){var T=b[0],I=i-T.clientX,R=o-T.clientY;if(e=="wait")if(I*I+R*R>4)e="cursor";else return C.preventDefault();i=T.clientX,o=T.clientY,C.clientX=T.clientX,C.clientY=T.clientY;var N=C.timeStamp,P=N-r;if(r=N,e=="scroll"){var B=new a(C,c);B.speed=1,B.wheelX=I,B.wheelY=R,10*Math.abs(I)<Math.abs(R)&&(I=0),10*Math.abs(R)<Math.abs(I)&&(R=0),P!=0&&(E=I/P,w=R/P),c._emit("mousewheel",B),B.propagationStopped||(E=w=0)}else{var V=new a(C,c),W=V.getDocumentPosition();e=="cursor"?c.selection.moveCursorToPosition(W):e=="anchor"&&c.selection.setSelectionAnchor(W.row,W.column),c.renderer.scrollCursorIntoView(W),C.preventDefault()}}},c);function $(){g+=60,f=setInterval(function(){g--<=0&&(clearInterval(f),f=null),Math.abs(E)<.01&&(E=0),Math.abs(w)<.01&&(w=0),g<20&&(E=.9*E),g<20&&(w=.9*w);var C=c.session.getScrollTop();c.renderer.scrollBy(10*E,10*w),C==c.session.getScrollTop()&&(g=0)},10)}}}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(n,l,y){var a=n("../lib/event"),p=n("../lib/useragent"),d=n("./default_handlers").DefaultHandlers,s=n("./default_gutter_handler").GutterHandler,c=n("./mouse_event").MouseEvent,e=n("./dragdrop_handler").DragdropHandler,i=n("./touch_handler").addTouchListeners,o=n("../config"),h=(function(){function r(u){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var f=this;this.editor=u,new d(this),new s(this),new e(this);var g=function(E){var w=!document.hasFocus||!document.hasFocus()||!u.isFocused()&&document.activeElement==(u.textInput&&u.textInput.getElement());w&&window.focus(),u.focus(),setTimeout(function(){u.isFocused()||u.focus()})},v=u.renderer.getMouseEventTarget();a.addListener(v,"click",this.onMouseEvent.bind(this,"click"),u),a.addListener(v,"mousemove",this.onMouseMove.bind(this,"mousemove"),u),a.addMultiMouseDownListener([v,u.renderer.scrollBarV&&u.renderer.scrollBarV.inner,u.renderer.scrollBarH&&u.renderer.scrollBarH.inner,u.textInput&&u.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",u),a.addMouseWheelListener(u.container,this.onMouseWheel.bind(this,"mousewheel"),u),i(u.container,u);var A=u.renderer.$gutter;a.addListener(A,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),u),a.addListener(A,"click",this.onMouseEvent.bind(this,"gutterclick"),u),a.addListener(A,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),u),a.addListener(A,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),u),a.addListener(v,"mousedown",g,u),a.addListener(A,"mousedown",g,u),p.isIE&&u.renderer.scrollBarV&&(a.addListener(u.renderer.scrollBarV.element,"mousedown",g,u),a.addListener(u.renderer.scrollBarH.element,"mousedown",g,u)),u.on("mousemove",function(E){if(!(f.state||f.$dragDelay||!f.$dragEnabled)){var w=u.renderer.screenToTextCoordinates(E.x,E.y),m=u.session.selection.getRange(),S=u.renderer;!m.isEmpty()&&m.insideStart(w.row,w.column)?S.setCursorStyle("default"):S.setCursorStyle("")}},u)}return r.prototype.onMouseEvent=function(u,f){this.editor.session&&this.editor._emit(u,new c(f,this.editor))},r.prototype.onMouseMove=function(u,f){var g=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!g||!g.length||this.editor._emit(u,new c(f,this.editor))},r.prototype.onMouseWheel=function(u,f){var g=new c(f,this.editor);g.speed=this.$scrollSpeed*2,g.wheelX=f.wheelX,g.wheelY=f.wheelY,this.editor._emit(u,g)},r.prototype.setState=function(u){this.state=u},r.prototype.captureMouse=function(u,f){this.x=u.x,this.y=u.y,this.isMousePressed=!0;var g=this.editor,v=this.editor.renderer;v.$isMousePressed=!0;var A=this,E=!0,w=function(_){if(_){if(p.isWebKit&&!_.which&&A.releaseMouse)return A.releaseMouse();A.x=_.clientX,A.y=_.clientY,f&&f(_),A.mouseEvent=new c(_,A.editor),A.$mouseMoved=!0}},m=function(_){g.off("beforeEndOperation",D),E=!1,g.session&&S(),A[A.state+"End"]&&A[A.state+"End"](_),A.state="",A.isMousePressed=v.$isMousePressed=!1,v.$keepTextAreaAtCursor&&v.$moveTextAreaToCursor(),A.$onCaptureMouseMove=A.releaseMouse=null,_&&A.onMouseEvent("mouseup",_),g.endOperation()},S=function(){A[A.state]&&A[A.state](),A.$mouseMoved=!1},k=function(){E&&(S(),a.nextFrame(k))};if(p.isOldIE&&u.domEvent.type=="dblclick")return setTimeout(function(){m(u)});var D=function(_){A.releaseMouse&&g.curOp.command.name&&g.curOp.selectionChanged&&(A[A.state+"End"]&&A[A.state+"End"](),A.state="",A.releaseMouse())};g.on("beforeEndOperation",D),g.startOperation({command:{name:"mouse"}}),A.$onCaptureMouseMove=w,A.releaseMouse=a.capture(this.editor.container,w,m),k()},r.prototype.cancelContextMenu=function(){var u=function(f){f&&f.domEvent&&f.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",u),f&&f.domEvent&&a.stopEvent(f.domEvent))}.bind(this);setTimeout(u,10),this.editor.on("nativecontextmenu",u)},r.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse(),this.$tooltip&&this.$tooltip.destroy()},r})();h.prototype.releaseMouse=null,o.defineOptions(h.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:p.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0}}),l.MouseHandler=h}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(n,l,y){var a=n("../lib/dom"),p=(function(){function d(s){s.on("click",function(c){var e=c.getDocumentPosition(),i=s.session,o=i.getFoldAt(e.row,e.column,1);o&&(c.getAccelKey()?i.removeFold(o):i.expandFold(o),c.stop());var h=c.domEvent&&c.domEvent.target;h&&a.hasCssClass(h,"ace_inline_button")&&a.hasCssClass(h,"ace_toggle_wrap")&&(i.setOption("wrap",!i.getUseWrapMode()),s.renderer.scrollCursorIntoView())}),s.on("gutterclick",function(c){var e=s.renderer.$gutterLayer.getRegion(c);if(e=="foldWidgets"){var i=c.getDocumentPosition().row,o=s.session;o.foldWidgets&&o.foldWidgets[i]&&s.session.onFoldWidgetClick(i,c),s.isFocused()||s.focus(),c.stop()}}),s.on("gutterdblclick",function(c){var e=s.renderer.$gutterLayer.getRegion(c);if(e=="foldWidgets"){var i=c.getDocumentPosition().row,o=s.session,h=o.getParentFoldRangeData(i,!0),r=h.range||h.firstRange;if(r){i=r.start.row;var u=o.getFoldAt(i,o.getLine(i).length,1);u?o.removeFold(u):(o.addFold("...",r),s.renderer.scrollCursorIntoView({row:r.start.row,column:0}))}c.stop()}})}return d})();l.FoldHandler=p}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(n,l,y){var a=n("../lib/keys"),p=n("../lib/event"),d=(function(){function s(c){this.$editor=c,this.$data={editor:c},this.$handlers=[],this.setDefaultHandler(c.commands)}return s.prototype.setDefaultHandler=function(c){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=c,this.addKeyboardHandler(c,0)},s.prototype.setKeyboardHandler=function(c){var e=this.$handlers;if(e[e.length-1]!=c){for(;e[e.length-1]&&e[e.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(e[e.length-1]);this.addKeyboardHandler(c,1)}},s.prototype.addKeyboardHandler=function(c,e){if(c){typeof c=="function"&&!c.handleKeyboard&&(c.handleKeyboard=c);var i=this.$handlers.indexOf(c);i!=-1&&this.$handlers.splice(i,1),e==null?this.$handlers.push(c):this.$handlers.splice(e,0,c),i==-1&&c.attach&&c.attach(this.$editor)}},s.prototype.removeKeyboardHandler=function(c){var e=this.$handlers.indexOf(c);return e==-1?!1:(this.$handlers.splice(e,1),c.detach&&c.detach(this.$editor),!0)},s.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},s.prototype.getStatusText=function(){var c=this.$data,e=c.editor;return this.$handlers.map(function(i){return i.getStatusText&&i.getStatusText(e,c)||""}).filter(Boolean).join(" ")},s.prototype.$callKeyboardHandlers=function(c,e,i,o){for(var h,r=!1,u=this.$editor.commands,f=this.$handlers.length;f--&&(h=this.$handlers[f].handleKeyboard(this.$data,c,e,i,o),!(!(!h||!h.command)&&(h.command=="null"?r=!0:r=u.exec(h.command,this.$editor,h.args,o),r&&o&&c!=-1&&h.passEvent!=!0&&h.command.passEvent!=!0&&p.stopEvent(o),r))););return!r&&c==-1&&(h={command:"insertstring"},r=u.exec("insertstring",this.$editor,e)),r&&this.$editor._signal&&this.$editor._signal("keyboardActivity",h),r},s.prototype.onCommandKey=function(c,e,i){var o=a.keyCodeToString(i);return this.$callKeyboardHandlers(e,o,i,c)},s.prototype.onTextInput=function(c){return this.$callKeyboardHandlers(-1,c)},s})();l.KeyBinding=d}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(n,l,y){var a=0,p=0,d=!1,s=!1,c=!1,e=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],i=[[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]],o=0,h=1,r=0,u=1,f=2,g=3,v=4,A=5,E=6,w=7,m=8,S=9,k=10,D=11,_=12,F=13,x=14,$=15,C=16,b=17,T=18,I=[T,T,T,T,T,T,T,T,T,E,A,E,m,A,T,T,T,T,T,T,T,T,T,T,T,T,T,T,A,A,A,E,m,v,v,D,D,D,v,v,v,v,v,k,S,k,S,S,f,f,f,f,f,f,f,f,f,f,S,v,v,v,v,v,v,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,v,v,v,v,v,v,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,v,v,v,v,T,T,T,T,T,T,A,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,S,v,D,D,D,D,v,v,v,v,r,v,v,T,v,v,D,D,f,f,v,r,v,v,v,f,r,v,v,v,v,v],R=[m,m,m,m,m,m,m,m,m,m,m,T,T,T,r,u,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,m,A,F,x,$,C,b,S,D,D,D,D,D,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,S,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,m];function N(W,z,U,G){var Y=a?i:e,Q=null,q=null,te=null,re=0,ue=null,me=null,Ce=-1,ve=null,$e=null,Lt=[];if(!G)for(ve=0,G=[];ve<U;ve++)G[ve]=V(W[ve]);for(p=a,d=!1,s=!1,c=!1,$e=0;$e<U;$e++){if(Q=re,Lt[$e]=q=B(W,G,Lt,$e),re=Y[Q][q],ue=re&240,re&=15,z[$e]=te=Y[re][5],ue>0)if(ue==16){for(ve=Ce;ve<$e;ve++)z[ve]=1;Ce=-1}else Ce=-1;if(me=Y[re][6],me)Ce==-1&&(Ce=$e);else if(Ce>-1){for(ve=Ce;ve<$e;ve++)z[ve]=te;Ce=-1}G[$e]==A&&(z[$e]=0),p|=te}if(c){for(ve=0;ve<U;ve++)if(G[ve]==E){z[ve]=a;for(var gt=ve-1;gt>=0&&G[gt]==m;gt--)z[gt]=a}}}function P(W,z,U){if(!(p<W)){if(W==1&&a==h&&!s){U.reverse();return}for(var G=U.length,Y=0,Q,q,te,re;Y<G;){if(z[Y]>=W){for(Q=Y+1;Q<G&&z[Q]>=W;)Q++;for(q=Y,te=Q-1;q<te;q++,te--)re=U[q],U[q]=U[te],U[te]=re;Y=Q}Y++}}}function B(W,z,U,G){var Y=z[G],Q,q,te,re;switch(Y){case r:case u:d=!1;case v:case g:return Y;case f:return d?g:f;case w:return d=!0,u;case m:return v;case S:return G<1||G+1>=z.length||(Q=U[G-1])!=f&&Q!=g||(q=z[G+1])!=f&&q!=g?v:(d&&(q=g),q==Q?q:v);case k:return Q=G>0?U[G-1]:A,Q==f&&G+1<z.length&&z[G+1]==f?f:v;case D:if(G>0&&U[G-1]==f)return f;if(d)return v;for(re=G+1,te=z.length;re<te&&z[re]==D;)re++;return re<te&&z[re]==f?f:v;case _:for(te=z.length,re=G+1;re<te&&z[re]==_;)re++;if(re<te){var ue=W[G],me=ue>=1425&&ue<=2303||ue==64286;if(Q=z[re],me&&(Q==u||Q==w))return u}return G<1||(Q=z[G-1])==A?v:U[G-1];case A:return d=!1,s=!0,a;case E:return c=!0,v;case F:case x:case C:case b:case $:d=!1;case T:return v}}function V(W){var z=W.charCodeAt(0),U=z>>8;return U==0?z>191?r:I[z]:U==5?/[\u0591-\u05f4]/.test(W)?u:r:U==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(W)?_:/[\u0660-\u0669\u066b-\u066c]/.test(W)?g:z==1642?D:/[\u06f0-\u06f9]/.test(W)?f:w:U==32&&z<=8287?R[z&255]:U==254&&z>=65136?w:v}l.L=r,l.R=u,l.EN=f,l.ON_R=3,l.AN=4,l.R_H=5,l.B=6,l.RLE=7,l.DOT="·",l.doBidiReorder=function(W,z,U){if(W.length<2)return{};var G=W.split(""),Y=new Array(G.length),Q=new Array(G.length),q=[];a=U?h:o,N(G,q,G.length,z);for(var te=0;te<Y.length;Y[te]=te,te++);P(2,q,Y),P(1,q,Y);for(var te=0;te<Y.length-1;te++)z[te]===g?q[te]=l.AN:q[te]===u&&(z[te]>w&&z[te]<F||z[te]===v||z[te]===T)?q[te]=l.ON_R:te>0&&G[te-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(G[te])&&(q[te-1]=q[te]=l.R_H,te++);G[G.length-1]===l.DOT&&(q[G.length-1]=l.B),G[0]===""&&(q[0]=l.RLE);for(var te=0;te<Y.length;te++)Q[te]=q[Y[te]];return{logicalFromVisual:Y,bidiLevels:Q}},l.hasBidiCharacters=function(W,z){for(var U=!1,G=0;G<W.length;G++)z[G]=V(W.charAt(G)),!U&&(z[G]==u||z[G]==w||z[G]==g)&&(U=!0);return U},l.getVisualFromLogicalIdx=function(W,z){for(var U=0;U<z.logicalFromVisual.length;U++)if(z.logicalFromVisual[U]==W)return U;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(n,l,y){var a=n("./lib/bidiutil"),p=n("./lib/lang"),d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,s=(function(){function c(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=a,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=d.test(e.getValue())}return c.prototype.isBidiRow=function(e,i,o){return this.seenBidi?(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(i,o),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},c.prototype.onChange=function(e){this.seenBidi?this.currentRow=null:e.action=="insert"&&d.test(e.lines.join(`
|
|
193
|
-
`))&&(this.seenBidi=!0,this.currentRow=null)},c.prototype.getDocumentRow=function(){var e=0,i=this.session.$screenRowCache;if(i.length){var o=this.session.$getRowCacheIndex(i,this.currentRow);o>=0&&(e=this.session.$docRowCache[o])}return e},c.prototype.getSplitIndex=function(){var e=0,i=this.session.$screenRowCache;if(i.length)for(var o,h=this.session.$getRowCacheIndex(i,this.currentRow);this.currentRow-e>0&&(o=this.session.$getRowCacheIndex(i,this.currentRow-e-1),o===h);)h=o,e++;else e=this.currentRow;return e},c.prototype.updateRowLine=function(e,i){e===void 0&&(e=this.getDocumentRow());var o=e===this.session.getLength()-1,h=o?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var r=this.session.$wrapData[e];r&&(i===void 0&&(i=this.getSplitIndex()),i>0&&r.length?(this.wrapIndent=r.indent,this.wrapOffset=this.wrapIndent*this.charWidths[a.L],this.line=i<r.length?this.line.substring(r[i-1],r[i]):this.line.substring(r[r.length-1])):this.line=this.line.substring(0,r[i]),i==r.length&&(this.line+=this.showInvisibles?h:a.DOT))}else this.line+=this.showInvisibles?h:a.DOT;var u=this.session,f=0,g;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(v,A){return v===" "||u.isFullWidth(v.charCodeAt(0))?(g=v===" "?u.getScreenTabSize(A+f):2,f+=g-1,p.stringRepeat(a.DOT,g)):v}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==a.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},c.prototype.updateBidiMap=function(){var e=[];a.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=a.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},c.prototype.markAsDirty=function(){this.currentRow=null},c.prototype.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var i=this.characterWidth=e.$characterSize.width,o=e.$measureCharWidth("ה");this.charWidths[a.L]=this.charWidths[a.EN]=this.charWidths[a.ON_R]=i,this.charWidths[a.R]=this.charWidths[a.AN]=o,this.charWidths[a.R_H]=o*.45,this.charWidths[a.B]=this.charWidths[a.RLE]=0,this.currentRow=null}},c.prototype.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},c.prototype.setEolChar=function(e){this.EOL=e},c.prototype.setContentWidth=function(e){this.contentWidth=e},c.prototype.isRtlLine=function(e){return this.$isRtl?!0:e!=null?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir},c.prototype.setRtlDirection=function(e,i){for(var o=e.getCursorPosition(),h=e.selection.getSelectionAnchor().row;h<=o.row;h++)!i&&e.session.getLine(h).charAt(0)===e.session.$bidiHandler.RLE?e.session.doc.removeInLine(h,0,1):i&&e.session.getLine(h).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:h},e.session.$bidiHandler.RLE)},c.prototype.getPosLeft=function(e){e-=this.wrapIndent;var i=this.line.charAt(0)===this.RLE?1:0,o=e>i?this.session.getOverwrite()?e:e-1:i,h=a.getVisualFromLogicalIdx(o,this.bidiMap),r=this.bidiMap.bidiLevels,u=0;!this.session.getOverwrite()&&e<=i&&r[h]%2!==0&&h++;for(var f=0;f<h;f++)u+=this.charWidths[r[f]];return!this.session.getOverwrite()&&e>i&&r[h]%2===0&&(u+=this.charWidths[r[h]]),this.wrapIndent&&(u+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(u+=this.rtlLineOffset),u},c.prototype.getSelections=function(e,i){var o=this.bidiMap,h=o.bidiLevels,r,u=[],f=0,g=Math.min(e,i)-this.wrapIndent,v=Math.max(e,i)-this.wrapIndent,A=!1,E=!1,w=0;this.wrapIndent&&(f+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var m,S=0;S<h.length;S++)m=o.logicalFromVisual[S],r=h[S],A=m>=g&&m<v,A&&!E?w=f:!A&&E&&u.push({left:w,width:f-w}),f+=this.charWidths[r],E=A;if(A&&S===h.length&&u.push({left:w,width:f-w}),this.isRtlDir)for(var k=0;k<u.length;k++)u[k].left+=this.rtlLineOffset;return u},c.prototype.offsetToCol=function(o){this.isRtlDir&&(o-=this.rtlLineOffset);var i=0,o=Math.max(o,0),h=0,r=0,u=this.bidiMap.bidiLevels,f=this.charWidths[u[r]];for(this.wrapIndent&&(o-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);o>h+f/2;){if(h+=f,r===u.length-1){f=0;break}f=this.charWidths[u[++r]]}return r>0&&u[r-1]%2!==0&&u[r]%2===0?(o<h&&r--,i=this.bidiMap.logicalFromVisual[r]):r>0&&u[r-1]%2===0&&u[r]%2!==0?i=1+(o>h?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===u.length-1&&f===0&&u[r-1]%2===0||!this.isRtlDir&&r===0&&u[r]%2!==0?i=1+this.bidiMap.logicalFromVisual[r]:(r>0&&u[r-1]%2!==0&&f!==0&&r--,i=this.bidiMap.logicalFromVisual[r]),i===0&&this.isRtlDir&&i++,i+this.wrapIndent},c})();l.BidiHandler=s}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(n,l,y){var a=n("./lib/oop"),p=n("./lib/lang"),d=n("./lib/event_emitter").EventEmitter,s=n("./range").Range,c=(function(){function e(i){this.session=i,this.doc=i.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var o=this;this.cursor.on("change",function(h){o.$cursorChanged=!0,o.$silent||o._emit("changeCursor"),!o.$isEmpty&&!o.$silent&&o._emit("changeSelection"),!o.$keepDesiredColumnOnChange&&h.old.column!=h.value.column&&(o.$desiredColumn=null)}),this.anchor.on("change",function(){o.$anchorChanged=!0,!o.$isEmpty&&!o.$silent&&o._emit("changeSelection")})}return e.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},e.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},e.prototype.getCursor=function(){return this.lead.getPosition()},e.prototype.setAnchor=function(i,o){this.$isEmpty=!1,this.anchor.setPosition(i,o)},e.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},e.prototype.getSelectionLead=function(){return this.lead.getPosition()},e.prototype.isBackwards=function(){var i=this.anchor,o=this.lead;return i.row>o.row||i.row==o.row&&i.column>o.column},e.prototype.getRange=function(){var i=this.anchor,o=this.lead;return this.$isEmpty?s.fromPoints(o,o):this.isBackwards()?s.fromPoints(o,i):s.fromPoints(i,o)},e.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},e.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},e.prototype.setRange=function(i,o){var h=o?i.end:i.start,r=o?i.start:i.end;this.$setSelection(h.row,h.column,r.row,r.column)},e.prototype.$setSelection=function(i,o,h,r){if(!this.$silent){var u=this.$isEmpty,f=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(i,o),this.cursor.setPosition(h,r),this.$isEmpty=!s.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||u!=this.$isEmpty||f)&&this._emit("changeSelection")}},e.prototype.$moveSelection=function(i){var o=this.lead;this.$isEmpty&&this.setSelectionAnchor(o.row,o.column),i.call(this)},e.prototype.selectTo=function(i,o){this.$moveSelection(function(){this.moveCursorTo(i,o)})},e.prototype.selectToPosition=function(i){this.$moveSelection(function(){this.moveCursorToPosition(i)})},e.prototype.moveTo=function(i,o){this.clearSelection(),this.moveCursorTo(i,o)},e.prototype.moveToPosition=function(i){this.clearSelection(),this.moveCursorToPosition(i)},e.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},e.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},e.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},e.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},e.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},e.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},e.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},e.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},e.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},e.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},e.prototype.getWordRange=function(i,o){if(typeof o>"u"){var h=i||this.lead;i=h.row,o=h.column}return this.session.getWordRange(i,o)},e.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},e.prototype.selectAWord=function(){var i=this.getCursor(),o=this.session.getAWordRange(i.row,i.column);this.setSelectionRange(o)},e.prototype.getLineRange=function(i,o){var h=typeof i=="number"?i:this.lead.row,r,u=this.session.getFoldLine(h);return u?(h=u.start.row,r=u.end.row):r=h,o===!0?new s(h,0,r,this.session.getLine(r).length):new s(h,0,r+1,0)},e.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},e.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},e.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},e.prototype.wouldMoveIntoSoftTab=function(i,o,h){var r=i.column,u=i.column+o;return h<0&&(r=i.column-o,u=i.column),this.session.isTabStop(i)&&this.doc.getLine(i.row).slice(r,u).split(" ").length-1==o},e.prototype.moveCursorLeft=function(){var i=this.lead.getPosition(),o;if(o=this.session.getFoldAt(i.row,i.column,-1))this.moveCursorTo(o.start.row,o.start.column);else if(i.column===0)i.row>0&&this.moveCursorTo(i.row-1,this.doc.getLine(i.row-1).length);else{var h=this.session.getTabSize();this.wouldMoveIntoSoftTab(i,h,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-h):this.moveCursorBy(0,-1)}},e.prototype.moveCursorRight=function(){var i=this.lead.getPosition(),o;if(o=this.session.getFoldAt(i.row,i.column,1))this.moveCursorTo(o.end.row,o.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 h=this.session.getTabSize(),i=this.lead;this.wouldMoveIntoSoftTab(i,h,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,h):this.moveCursorBy(0,1)}},e.prototype.moveCursorLineStart=function(){var i=this.lead.row,o=this.lead.column,h=this.session.documentToScreenRow(i,o),r=this.session.screenToDocumentPosition(h,0),u=this.session.getDisplayLine(i,null,r.row,r.column),f=u.match(/^\s*/);f[0].length!=o&&!this.session.$useEmacsStyleLineStart&&(r.column+=f[0].length),this.moveCursorToPosition(r)},e.prototype.moveCursorLineEnd=function(){var i=this.lead,o=this.session.getDocumentLastRowColumnPosition(i.row,i.column);if(this.lead.column==o.column){var h=this.session.getLine(o.row);if(o.column==h.length){var r=h.search(/\s+$/);r>0&&(o.column=r)}}this.moveCursorTo(o.row,o.column)},e.prototype.moveCursorFileEnd=function(){var i=this.doc.getLength()-1,o=this.doc.getLine(i).length;this.moveCursorTo(i,o)},e.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},e.prototype.moveCursorLongWordRight=function(){var i=this.lead.row,o=this.lead.column,h=this.doc.getLine(i),r=h.substring(o);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var u=this.session.getFoldAt(i,o,1);if(u){this.moveCursorTo(u.end.row,u.end.column);return}if(this.session.nonTokenRe.exec(r)&&(o+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=h.substring(o)),o>=h.length){this.moveCursorTo(i,h.length),this.moveCursorRight(),i<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(r)&&(o+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(i,o)},e.prototype.moveCursorLongWordLeft=function(){var i=this.lead.row,o=this.lead.column,h;if(h=this.session.getFoldAt(i,o,-1)){this.moveCursorTo(h.start.row,h.start.column);return}var r=this.session.getFoldStringAt(i,o,-1);r==null&&(r=this.doc.getLine(i).substring(0,o));var u=p.stringReverse(r);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(u)&&(o-=this.session.nonTokenRe.lastIndex,u=u.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),o<=0){this.moveCursorTo(i,0),this.moveCursorLeft(),i>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(u)&&(o-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(i,o)},e.prototype.$shortWordEndIndex=function(i){var o=0,h,r=/\s/,u=this.session.tokenRe;if(u.lastIndex=0,this.session.tokenRe.exec(i))o=this.session.tokenRe.lastIndex;else{for(;(h=i[o])&&r.test(h);)o++;if(o<1){for(u.lastIndex=0;(h=i[o])&&!u.test(h);)if(u.lastIndex=0,o++,r.test(h))if(o>2){o--;break}else{for(;(h=i[o])&&r.test(h);)o++;if(o>2)break}}}return u.lastIndex=0,o},e.prototype.moveCursorShortWordRight=function(){var i=this.lead.row,o=this.lead.column,h=this.doc.getLine(i),r=h.substring(o),u=this.session.getFoldAt(i,o,1);if(u)return this.moveCursorTo(u.end.row,u.end.column);if(o==h.length){var f=this.doc.getLength();do i++,r=this.doc.getLine(i);while(i<f&&/^\s*$/.test(r));/^\s+/.test(r)||(r=""),o=0}var g=this.$shortWordEndIndex(r);this.moveCursorTo(i,o+g)},e.prototype.moveCursorShortWordLeft=function(){var i=this.lead.row,o=this.lead.column,h;if(h=this.session.getFoldAt(i,o,-1))return this.moveCursorTo(h.start.row,h.start.column);var r=this.session.getLine(i).substring(0,o);if(o===0){do i--,r=this.doc.getLine(i);while(i>0&&/^\s*$/.test(r));o=r.length,/\s+$/.test(r)||(r="")}var u=p.stringReverse(r),f=this.$shortWordEndIndex(u);return this.moveCursorTo(i,o-f)},e.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},e.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},e.prototype.moveCursorBy=function(i,o){var h=this.session.documentToScreenPosition(this.lead.row,this.lead.column),r;if(o===0&&(i!==0&&(this.session.$bidiHandler.isBidiRow(h.row,this.lead.row)?(r=this.session.$bidiHandler.getPosLeft(h.column),h.column=Math.round(r/this.session.$bidiHandler.charWidths[0])):r=h.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?h.column=this.$desiredColumn:this.$desiredColumn=h.column),i!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var u=this.session.lineWidgets[this.lead.row];i<0?i-=u.rowsAbove||0:i>0&&(i+=u.rowCount-(u.rowsAbove||0))}var f=this.session.screenToDocumentPosition(h.row+i,h.column,r);i!==0&&o===0&&f.row===this.lead.row&&(f.column,this.lead.column),this.moveCursorTo(f.row,f.column+o,o===0)},e.prototype.moveCursorToPosition=function(i){this.moveCursorTo(i.row,i.column)},e.prototype.moveCursorTo=function(i,o,h){var r=this.session.getFoldAt(i,o,1);r&&(i=r.start.row,o=r.start.column),this.$keepDesiredColumnOnChange=!0;var u=this.session.getLine(i);/[\uDC00-\uDFFF]/.test(u.charAt(o))&&u.charAt(o-1)&&(this.lead.row==i&&this.lead.column==o+1?o=o-1:o=o+1),this.lead.setPosition(i,o),this.$keepDesiredColumnOnChange=!1,h||(this.$desiredColumn=null)},e.prototype.moveCursorToScreen=function(i,o,h){var r=this.session.screenToDocumentPosition(i,o);this.moveCursorTo(r.row,r.column,h)},e.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},e.prototype.fromOrientedRange=function(i){this.setSelectionRange(i,i.cursor==i.start),this.$desiredColumn=i.desiredColumn||this.$desiredColumn},e.prototype.toOrientedRange=function(i){var o=this.getRange();return i?(i.start.column=o.start.column,i.start.row=o.start.row,i.end.column=o.end.column,i.end.row=o.end.row):i=o,i.cursor=this.isBackwards()?i.start:i.end,i.desiredColumn=this.$desiredColumn,i},e.prototype.getRangeOfMovements=function(i){var o=this.getCursor();try{i(this);var h=this.getCursor();return s.fromPoints(o,h)}catch{return s.fromPoints(o,o)}finally{this.moveCursorToPosition(o)}},e.prototype.toJSON=function(){if(this.rangeCount)var i=this.ranges.map(function(o){var h=o.clone();return h.isBackwards=o.cursor==o.start,h});else{var i=this.getRange();i.isBackwards=this.isBackwards()}return i},e.prototype.fromJSON=function(i){if(i.start==null)if(this.rangeList&&i.length>1){this.toSingleRange(i[0]);for(var o=i.length;o--;){var h=s.fromPoints(i[o].start,i[o].end);i[o].isBackwards&&(h.cursor=h.start),this.addRange(h,!0)}return}else i=i[0];this.rangeList&&this.toSingleRange(i),this.setSelectionRange(i,i.isBackwards)},e.prototype.isEqual=function(i){if((i.length||this.rangeCount)&&i.length!=this.rangeCount)return!1;if(!i.length||!this.ranges)return this.getRange().isEqual(i);for(var o=this.ranges.length;o--;)if(!this.ranges[o].isEqual(i[o]))return!1;return!0},e})();c.prototype.setSelectionAnchor=c.prototype.setAnchor,c.prototype.getSelectionAnchor=c.prototype.getAnchor,c.prototype.setSelectionRange=c.prototype.setRange,a.implement(c.prototype,d),l.Selection=c}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(n,l,y){var a=n("./lib/report_error").reportError,p=2e3,d=(function(){function s(c){this.splitRegex,this.states=c,this.regExps={},this.matchMappings={};for(var e in this.states){for(var i=this.states[e],o=[],h=0,r=this.matchMappings[e]={defaultToken:"text"},u="g",f=[],g=0;g<i.length;g++){var v=i[g];if(v.defaultToken&&(r.defaultToken=v.defaultToken),v.caseInsensitive&&u.indexOf("i")===-1&&(u+="i"),v.unicode&&u.indexOf("u")===-1&&(u+="u"),v.regex!=null){v.regex instanceof RegExp&&(v.regex=v.regex.toString().slice(1,-1));var A=v.regex,E=new RegExp("(?:("+A+")|(.))").exec("a").length-2;Array.isArray(v.token)?v.token.length==1||E==1?v.token=v.token[0]:E-1!=v.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:v,groupCount:E-1}),v.token=v.token[0]):(v.tokenArray=v.token,v.token=null,v.onMatch=this.$arrayTokens):typeof v.token=="function"&&!v.onMatch&&(E>1?v.onMatch=this.$applyToken:v.onMatch=v.token),E>1&&(/\\\d/.test(v.regex)?A=v.regex.replace(/\\([0-9]+)/g,function(w,m){return"\\"+(parseInt(m,10)+h+1)}):(E=1,A=this.removeCapturingGroups(v.regex)),!v.splitRegex&&typeof v.token!="string"&&f.push(v)),r[h]=g,h+=E,o.push(A),v.onMatch||(v.onMatch=null)}}o.length||(r[0]=0,o.push("$")),f.forEach(function(w){w.splitRegex=this.createSplitterRegexp(w.regex,u)},this),this.regExps[e]=new RegExp("("+o.join(")|(")+")|($)",u)}}return s.prototype.$setMaxTokenCount=function(c){p=c|0},s.prototype.$applyToken=function(c){var e=this.splitRegex.exec(c).slice(1),i=this.token.apply(this,e);if(typeof i=="string")return[{type:i,value:c}];for(var o=[],h=0,r=i.length;h<r;h++)e[h]&&(o[o.length]={type:i[h],value:e[h]});return o},s.prototype.$arrayTokens=function(c){if(!c)return[];var e=this.splitRegex.exec(c);if(!e)return"text";for(var i=[],o=this.tokenArray,h=0,r=o.length;h<r;h++)e[h+1]&&(i[i.length]={type:o[h],value:e[h+1]});return i},s.prototype.removeCapturingGroups=function(c){var e=c.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(i,o){return o?"(?:":i});return e},s.prototype.createSplitterRegexp=function(c,e){if(c.indexOf("(?=")!=-1){var i=0,o=!1,h={};c.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(r,u,f,g,v,A){return o?o=v!="]":v?o=!0:g?(i==h.stack&&(h.end=A+1,h.stack=-1),i--):f&&(i++,f.length!=1&&(h.stack=i,h.start=A)),r}),h.end!=null&&/^\)*$/.test(c.substr(h.end))&&(c=c.substring(0,h.start)+c.substr(h.end))}return c.charAt(0)!="^"&&(c="^"+c),c.charAt(c.length-1)!="$"&&(c+="$"),new RegExp(c,(e||"").replace("g",""))},s.prototype.getLineTokens=function(c,e){if(e&&typeof e!="string"){var i=e.slice(0);e=i[0],e==="#tmp"&&(i.shift(),e=i.shift())}else var i=[];var o=e||"start",h=this.states[o];h||(o="start",h=this.states[o]);var r=this.matchMappings[o],u=this.regExps[o];u.lastIndex=0;for(var f,g=[],v=0,A=0,E={type:null,value:""};f=u.exec(c);){var w=r.defaultToken,m=null,S=f[0],k=u.lastIndex;if(k-S.length>v){var D=c.substring(v,k-S.length);E.type==w?E.value+=D:(E.type&&g.push(E),E={type:w,value:D})}for(var _=0;_<f.length-2;_++)if(f[_+1]!==void 0){m=h[r[_]],m.onMatch?w=m.onMatch(S,o,i,c):w=m.token,m.next&&(typeof m.next=="string"?o=m.next:o=m.next(o,i),h=this.states[o],h||(this.reportError("state doesn't exist",o),o="start",h=this.states[o]),r=this.matchMappings[o],v=k,u=this.regExps[o],u.lastIndex=k),m.consumeLineEnd&&(v=k);break}if(S){if(typeof w=="string")(!m||m.merge!==!1)&&E.type===w?E.value+=S:(E.type&&g.push(E),E={type:w,value:S});else if(w){E.type&&g.push(E),E={type:null,value:""};for(var _=0;_<w.length;_++)g.push(w[_])}}if(v==c.length)break;if(v=k,A++>p){for(A>2*c.length&&this.reportError("infinite loop with in ace tokenizer",{startState:e,line:c});v<c.length;)E.type&&g.push(E),E={value:c.substring(v,v+=500),type:"overflow"};o="start",i=[];break}}return E.type&&g.push(E),i.length>1&&i[0]!==o&&i.unshift("#tmp",o),{tokens:g,state:i.length?i:o}},s})();d.prototype.reportError=a,l.Tokenizer=d}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(n,l,y){var a=n("../lib/deep_copy").deepCopy,p;p=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(c,e){if(!e){for(var i in c)this.$rules[i]=c[i];return}for(var i in c){for(var o=c[i],h=0;h<o.length;h++){var r=o[h];(r.next||r.onMatch)&&(typeof r.next=="string"&&r.next.indexOf(e)!==0&&(r.next=e+r.next),r.nextState&&r.nextState.indexOf(e)!==0&&(r.nextState=e+r.nextState))}this.$rules[e+i]=o}},this.getRules=function(){return this.$rules},this.embedRules=function(c,e,i,o,h){var r=typeof c=="function"?new c().getRules():c;if(o)for(var u=0;u<o.length;u++)o[u]=e+o[u];else{o=[];for(var f in r)o.push(e+f)}if(this.addRules(r,e),i)for(var g=Array.prototype[h?"push":"unshift"],u=0;u<o.length;u++)g.apply(this.$rules[o[u]],a(i));this.$embeds||(this.$embeds=[]),this.$embeds.push(e)},this.getEmbeds=function(){return this.$embeds};var d=function(c,e){return(c!="start"||e.length)&&e.unshift(this.nextState,c),this.nextState},s=function(c,e){return e.shift(),e.shift()||"start"};this.normalizeRules=function(){var c=0,e=this.$rules;function i(o){var h=e[o];h.processed=!0;for(var r=0;r<h.length;r++){var u=h[r],f=null;Array.isArray(u)&&(f=u,u={}),!u.regex&&u.start&&(u.regex=u.start,u.next||(u.next=[]),u.next.push({defaultToken:u.token},{token:u.token+".end",regex:u.end||u.start,next:"pop"}),u.token=u.token+".start",u.push=!0);var g=u.next||u.push;if(g&&Array.isArray(g)){var v=u.stateName;v||(v=u.token,typeof v!="string"&&(v=v[0]||""),e[v]&&(v+=c++)),e[v]=g,u.next=v,i(v)}else g=="pop"&&(u.next=s);if(u.push&&(u.nextState=u.next||u.push,u.next=d,delete u.push),u.rules)for(var A in u.rules)e[A]?e[A].push&&e[A].push.apply(e[A],u.rules[A]):e[A]=u.rules[A];var E=typeof u=="string"?u:u.include;if(E&&(E==="$self"&&(E="start"),Array.isArray(E)?f=E.map(function(m){return e[m]}):f=e[E]),f){var w=[r,1].concat(f);u.noEscape&&(w=w.filter(function(m){return!m.next})),h.splice.apply(h,w),r--}u.keywordMap&&(u.token=this.createKeywordMapper(u.keywordMap,u.defaultToken||"text",u.caseInsensitive),delete u.defaultToken)}}Object.keys(e).forEach(i,this)},this.createKeywordMapper=function(c,e,i,o){var h=Object.create(null);return this.$keywordList=[],Object.keys(c).forEach(function(r){for(var u=c[r],f=u.split(o||"|"),g=f.length;g--;){var v=f[g];this.$keywordList.push(v),i&&(v=v.toLowerCase()),h[v]=r}},this),c=null,i?function(r){return h[r.toLowerCase()]||e}:function(r){return h[r]||e}},this.getKeywords=function(){return this.$keywords}}).call(p.prototype),l.TextHighlightRules=p}),ace.define("ace/mode/behaviour",["require","exports","module"],function(n,l,y){var a;a=function(){this.$behaviours={}},(function(){this.add=function(p,d,s){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[p]:this.$behaviours[p]={}}this.$behaviours[p][d]=s},this.addBehaviours=function(p){for(var d in p)for(var s in p[d])this.add(d,s,p[d][s])},this.remove=function(p){this.$behaviours&&this.$behaviours[p]&&delete this.$behaviours[p]},this.inherit=function(p,d){if(typeof p=="function")var s=new p().getBehaviours(d);else var s=p.getBehaviours(d);this.addBehaviours(s)},this.getBehaviours=function(p){if(p){for(var d={},s=0;s<p.length;s++)this.$behaviours[p[s]]&&(d[p[s]]=this.$behaviours[p[s]]);return d}else return this.$behaviours}}).call(a.prototype),l.Behaviour=a}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(n,l,y){var a=n("./range").Range,p=(function(){function d(s,c,e){this.$session=s,this.$row=c,this.$rowTokens=s.getTokens(c);var i=s.getTokenAt(c,e);this.$tokenIndex=i?i.index:-1}return d.prototype.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},d.prototype.stepForward=function(){this.$tokenIndex+=1;for(var s;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,s||(s=this.$session.getLength()),this.$row>=s)return this.$row=s-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},d.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},d.prototype.getCurrentTokenRow=function(){return this.$row},d.prototype.getCurrentTokenColumn=function(){var s=this.$rowTokens,c=this.$tokenIndex,e=s[c].start;if(e!==void 0)return e;for(e=0;c>0;)c-=1,e+=s[c].value.length;return e},d.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},d.prototype.getCurrentTokenRange=function(){var s=this.$rowTokens[this.$tokenIndex],c=this.getCurrentTokenColumn();return new a(this.$row,c,this.$row,c+s.value.length)},d})();l.TokenIterator=p}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(n,l,y){var a=n("../../lib/oop"),p=n("../behaviour").Behaviour,d=n("../../token_iterator").TokenIterator,s=n("../../lib/lang"),c=["text","paren.rparen","rparen","paren","punctuation.operator"],e=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],i,o={},h={'"':'"',"'":"'"},r=function(g){var v=-1;if(g.multiSelect&&(v=g.selection.index,o.rangeCount!=g.multiSelect.rangeCount&&(o={rangeCount:g.multiSelect.rangeCount})),o[v])return i=o[v];i=o[v]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},u=function(g,v,A,E){var w=g.end.row-g.start.row;return{text:A+v+E,selection:[0,g.start.column+1,w,g.end.column+(w?0:1)]}},f;f=function(g){g=g||{},this.add("braces","insertion",function(v,A,E,w,m){var S=E.getCursorPosition(),k=w.doc.getLine(S.row);if(m=="{"){r(E);var D=E.getSelectionRange(),_=w.doc.getTextRange(D),F=w.getTokenAt(S.row,S.column);if(_!==""&&_!=="{"&&E.getWrapBehavioursEnabled())return u(D,_,"{","}");if(F&&/(?:string)\.quasi|\.xml/.test(F.type)){var x=[/tag\-(?:open|name)/,/attribute\-name/];return x.some(function(N){return N.test(F.type)})||/(string)\.quasi/.test(F.type)&&F.value[S.column-F.start-1]!=="$"?void 0:(f.recordAutoInsert(E,w,"}"),{text:"{}",selection:[1,1]})}else if(f.isSaneInsertion(E,w))return/[\]\}\)]/.test(k[S.column])||E.inMultiSelectMode||g.braces?(f.recordAutoInsert(E,w,"}"),{text:"{}",selection:[1,1]}):(f.recordMaybeInsert(E,w,"{"),{text:"{",selection:[1,1]})}else if(m=="}"){r(E);var $=k.substring(S.column,S.column+1);if($=="}"){var C=w.$findOpeningBracket("}",{column:S.column+1,row:S.row});if(C!==null&&f.isAutoInsertedClosing(S,k,m))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(m==`
|
|
194
|
-
`||m==`\r
|
|
195
|
-
`){r(E);var b="";f.isMaybeInsertedClosing(S,k)&&(b=s.stringRepeat("}",i.maybeInsertedBrackets),f.clearMaybeInsertedClosing());var $=k.substring(S.column,S.column+1);if($==="}"){var T=w.findMatchingBracket({row:S.row,column:S.column+1},"}");if(!T)return null;var I=this.$getIndent(w.getLine(T.row))}else if(b)var I=this.$getIndent(k);else{f.clearMaybeInsertedClosing();return}var R=I+w.getTabString();return{text:`
|
|
196
|
-
`+R+`
|
|
197
|
-
`+I+b,selection:[1,R.length,1,R.length]}}else f.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(v,A,E,w,m){var S=w.doc.getTextRange(m);if(!m.isMultiLine()&&S=="{"){r(E);var k=w.doc.getLine(m.start.row),D=k.substring(m.end.column,m.end.column+1);if(D=="}")return m.end.column++,m;i.maybeInsertedBrackets--}}),this.add("parens","insertion",function(v,A,E,w,m){if(m=="("){r(E);var S=E.getSelectionRange(),k=w.doc.getTextRange(S);if(k!==""&&E.getWrapBehavioursEnabled())return u(S,k,"(",")");if(f.isSaneInsertion(E,w))return f.recordAutoInsert(E,w,")"),{text:"()",selection:[1,1]}}else if(m==")"){r(E);var D=E.getCursorPosition(),_=w.doc.getLine(D.row),F=_.substring(D.column,D.column+1);if(F==")"){var x=w.$findOpeningBracket(")",{column:D.column+1,row:D.row});if(x!==null&&f.isAutoInsertedClosing(D,_,m))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(v,A,E,w,m){var S=w.doc.getTextRange(m);if(!m.isMultiLine()&&S=="("){r(E);var k=w.doc.getLine(m.start.row),D=k.substring(m.start.column+1,m.start.column+2);if(D==")")return m.end.column++,m}}),this.add("brackets","insertion",function(v,A,E,w,m){if(m=="["){r(E);var S=E.getSelectionRange(),k=w.doc.getTextRange(S);if(k!==""&&E.getWrapBehavioursEnabled())return u(S,k,"[","]");if(f.isSaneInsertion(E,w))return f.recordAutoInsert(E,w,"]"),{text:"[]",selection:[1,1]}}else if(m=="]"){r(E);var D=E.getCursorPosition(),_=w.doc.getLine(D.row),F=_.substring(D.column,D.column+1);if(F=="]"){var x=w.$findOpeningBracket("]",{column:D.column+1,row:D.row});if(x!==null&&f.isAutoInsertedClosing(D,_,m))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(v,A,E,w,m){var S=w.doc.getTextRange(m);if(!m.isMultiLine()&&S=="["){r(E);var k=w.doc.getLine(m.start.row),D=k.substring(m.start.column+1,m.start.column+2);if(D=="]")return m.end.column++,m}}),this.add("string_dquotes","insertion",function(v,A,E,w,m){var S=w.$mode.$quotes||h;if(m.length==1&&S[m]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(m)!=-1)return;r(E);var k=m,D=E.getSelectionRange(),_=w.doc.getTextRange(D);if(_!==""&&(_.length!=1||!S[_])&&E.getWrapBehavioursEnabled())return u(D,_,k,k);if(!_){var F=E.getCursorPosition(),x=w.doc.getLine(F.row),$=x.substring(F.column-1,F.column),C=x.substring(F.column,F.column+1),b=w.getTokenAt(F.row,F.column),T=w.getTokenAt(F.row,F.column+1);if($=="\\"&&b&&/escape/.test(b.type))return null;var I=b&&/string|escape/.test(b.type),R=!T||/string|escape/.test(T.type),N;if(C==k)N=I!==R,N&&/string\.end/.test(T.type)&&(N=!1);else{if(I&&!R||I&&R)return null;var P=w.$mode.tokenRe;P.lastIndex=0;var B=P.test($);P.lastIndex=0;var V=P.test(C),W=w.$mode.$pairQuotesAfter,z=W&&W[k]&&W[k].test($);if(!z&&B||V||C&&!/[\s;,.})\]\\]/.test(C))return null;var U=x[F.column-2];if($==k&&(U==k||P.test(U)))return null;N=!0}return{text:N?k+k:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(v,A,E,w,m){var S=w.$mode.$quotes||h,k=w.doc.getTextRange(m);if(!m.isMultiLine()&&S.hasOwnProperty(k)){r(E);var D=w.doc.getLine(m.start.row),_=D.substring(m.start.column+1,m.start.column+2);if(_==k)return m.end.column++,m}}),g.closeDocComment!==!1&&this.add("doc comment end","insertion",function(v,A,E,w,m){if(v==="doc-start"&&(m===`
|
|
198
|
-
`||m===`\r
|
|
199
|
-
`)&&E.selection.isEmpty()){var S=E.getCursorPosition();if(S.column===0)return;for(var k=w.doc.getLine(S.row),D=w.doc.getLine(S.row+1),_=w.getTokens(S.row),F=0,x=0;x<_.length;x++){F+=_[x].value.length;var $=_[x];if(F>=S.column){if(F===S.column){if(!/\.doc/.test($.type))return;if(/\*\//.test($.value)){var C=_[x+1];if(!C||!/\.doc/.test(C.type))return}}var b=S.column-(F-$.value.length),T=$.value.indexOf("*/"),I=$.value.indexOf("/**",T>-1?T+2:0);if(I!==-1&&b>I&&b<I+3||T!==-1&&I!==-1&&b>=T&&b<=I||!/\.doc/.test($.type))return;break}}var R=this.$getIndent(k);if(/\s*\*/.test(D))return/^\s*\*/.test(k)?{text:m+R+"* ",selection:[1,2+R.length,1,2+R.length]}:{text:m+R+" * ",selection:[1,3+R.length,1,3+R.length]};if(/\/\*\*/.test(k.substring(0,S.column)))return{text:m+R+" * "+m+" "+R+"*/",selection:[1,4+R.length,1,4+R.length]}}})},f.isSaneInsertion=function(g,v){var A=g.getCursorPosition(),E=new d(v,A.row,A.column);if(!this.$matchTokenType(E.getCurrentToken()||"text",c)){if(/[)}\]]/.test(g.session.getLine(A.row)[A.column]))return!0;var w=new d(v,A.row,A.column+1);if(!this.$matchTokenType(w.getCurrentToken()||"text",c))return!1}return E.stepForward(),E.getCurrentTokenRow()!==A.row||this.$matchTokenType(E.getCurrentToken()||"text",e)},f.$matchTokenType=function(g,v){return v.indexOf(g.type||g)>-1},f.recordAutoInsert=function(g,v,A){var E=g.getCursorPosition(),w=v.doc.getLine(E.row);this.isAutoInsertedClosing(E,w,i.autoInsertedLineEnd[0])||(i.autoInsertedBrackets=0),i.autoInsertedRow=E.row,i.autoInsertedLineEnd=A+w.substr(E.column),i.autoInsertedBrackets++},f.recordMaybeInsert=function(g,v,A){var E=g.getCursorPosition(),w=v.doc.getLine(E.row);this.isMaybeInsertedClosing(E,w)||(i.maybeInsertedBrackets=0),i.maybeInsertedRow=E.row,i.maybeInsertedLineStart=w.substr(0,E.column)+A,i.maybeInsertedLineEnd=w.substr(E.column),i.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(g,v,A){return i.autoInsertedBrackets>0&&g.row===i.autoInsertedRow&&A===i.autoInsertedLineEnd[0]&&v.substr(g.column)===i.autoInsertedLineEnd},f.isMaybeInsertedClosing=function(g,v){return i.maybeInsertedBrackets>0&&g.row===i.maybeInsertedRow&&v.substr(g.column)===i.maybeInsertedLineEnd&&v.substr(0,g.column)==i.maybeInsertedLineStart},f.popAutoInsertedClosing=function(){i.autoInsertedLineEnd=i.autoInsertedLineEnd.substr(1),i.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){i&&(i.maybeInsertedBrackets=0,i.maybeInsertedRow=-1)},a.inherits(f,p),l.CstyleBehaviour=f}),ace.define("ace/unicode",["require","exports","module"],function(n,l,y){for(var a=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],p=0,d=[],s=0;s<a.length;s+=2)d.push(p+=a[s]),a[s+1]&&d.push(45,p+=a[s+1]);l.wordChars=String.fromCharCode.apply(null,d)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(n,l,y){var a=n("../config"),p=n("../tokenizer").Tokenizer,d=n("./text_highlight_rules").TextHighlightRules,s=n("./behaviour/cstyle").CstyleBehaviour,c=n("../unicode"),e=n("../lib/lang"),i=n("../token_iterator").TokenIterator,o=n("../range").Range,h;h=function(){this.HighlightRules=d},(function(){this.$defaultBehaviour=new s,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 p(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(r,u,f,g){var v=u.doc,A=!0,E=!0,w=1/0,m=u.getTabSize(),S=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var _=this.lineCommentStart.map(e.escapeRegExp).join("|"),k=this.lineCommentStart[0];else var _=e.escapeRegExp(this.lineCommentStart),k=this.lineCommentStart;_=new RegExp("^(\\s*)(?:"+_+") ?"),S=u.getUseSoftTabs();var $=function(V,W){var z=V.match(_);if(z){var U=z[1].length,G=z[0].length;!T(V,U,G)&&z[0][G-1]==" "&&G--,v.removeInLine(W,U,G)}},b=k+" ",x=function(V,W){(!A||/\S/.test(V))&&(T(V,w,w)?v.insertInLine({row:W,column:w},b):v.insertInLine({row:W,column:w},k))},C=function(V,W){return _.test(V)},T=function(V,W,z){for(var U=0;W--&&V.charAt(W)==" ";)U++;if(U%m!=0)return!1;for(var U=0;V.charAt(z++)==" ";)U++;return m>2?U%m!=m-1:U%m==0}}else{if(!this.blockComment)return!1;var k=this.blockComment.start,D=this.blockComment.end,_=new RegExp("^(\\s*)(?:"+e.escapeRegExp(k)+")"),F=new RegExp("(?:"+e.escapeRegExp(D)+")\\s*$"),x=function(N,P){C(N,P)||(!A||/\S/.test(N))&&(v.insertInLine({row:P,column:N.length},D),v.insertInLine({row:P,column:w},k))},$=function(N,P){var B;(B=N.match(F))&&v.removeInLine(P,N.length-B[0].length,N.length),(B=N.match(_))&&v.removeInLine(P,B[1].length,B[0].length)},C=function(N,P){if(_.test(N))return!0;for(var B=u.getTokens(P),V=0;V<B.length;V++)if(B[V].type==="comment")return!0}}function I(N){for(var P=f;P<=g;P++)N(v.getLine(P),P)}var R=1/0;I(function(N,P){var B=N.search(/\S/);B!==-1?(B<w&&(w=B),E&&!C(N,P)&&(E=!1)):R>N.length&&(R=N.length)}),w==1/0&&(w=R,A=!1,E=!1),S&&w%m!=0&&(w=Math.floor(w/m)*m),I(E?$:x)},this.toggleBlockComment=function(r,u,f,g){var v=this.blockComment;if(v){!v.start&&v[0]&&(v=v[0]);var A=new i(u,g.row,g.column),E=A.getCurrentToken();u.selection;var w=u.selection.toOrientedRange(),m,S;if(E&&/comment/.test(E.type)){for(var k,D;E&&/comment/.test(E.type);){var _=E.value.indexOf(v.start);if(_!=-1){var F=A.getCurrentTokenRow(),x=A.getCurrentTokenColumn()+_;k=new o(F,x,F,x+v.start.length);break}E=A.stepBackward()}for(var A=new i(u,g.row,g.column),E=A.getCurrentToken();E&&/comment/.test(E.type);){var _=E.value.indexOf(v.end);if(_!=-1){var F=A.getCurrentTokenRow(),x=A.getCurrentTokenColumn()+_;D=new o(F,x,F,x+v.end.length);break}E=A.stepForward()}D&&u.remove(D),k&&(u.remove(k),m=k.start.row,S=-v.start.length)}else S=v.start.length,m=f.start.row,u.insert(f.end,v.end),u.insert(f.start,v.start);w.start.row==m&&(w.start.column+=S),w.end.row==m&&(w.end.column+=S),u.selection.fromOrientedRange(w)}},this.getNextLineIndent=function(r,u,f){return this.$getIndent(u)},this.checkOutdent=function(r,u,f){return!1},this.autoOutdent=function(r,u,f){},this.$getIndent=function(r){return r.match(/^\s*/)[0]},this.createWorker=function(r){return null},this.createModeDelegates=function(r){this.$embeds=[],this.$modes={};for(var u in r)if(r[u]){var f=r[u],g=f.prototype.$id,v=a.$modes[g];v||(a.$modes[g]=v=new f),a.$modes[u]||(a.$modes[u]=v),this.$embeds.push(u),this.$modes[u]=v}for(var A=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],E=function(m){(function(S){var k=A[m],D=S[k];S[A[m]]=function(){return this.$delegator(k,arguments,D)}})(w)},w=this,u=0;u<A.length;u++)E(u)},this.$delegator=function(r,u,f){var g=u[0]||"start";if(typeof g!="string"){if(Array.isArray(g[2])){var v=g[2][g[2].length-1],A=this.$modes[v];if(A)return A[r].apply(A,[g[1]].concat([].slice.call(u,1)))}g=g[0]||"start"}for(var E=0;E<this.$embeds.length;E++)if(this.$modes[this.$embeds[E]]){var w=g.split(this.$embeds[E]);if(!w[0]&&w[1]){u[0]=w[1];var A=this.$modes[this.$embeds[E]];return A[r].apply(A,u)}}var m=f.apply(this,u);return f?m:void 0},this.transformAction=function(r,u,f,g,v){if(this.$behaviour){var A=this.$behaviour.getBehaviours();for(var E in A)if(A[E][u]){var w=A[E][u].apply(this,arguments);if(w)return w}}},this.getKeywords=function(r){if(!this.completionKeywords){var u=this.$tokenizer.rules,f=[];for(var g in u)for(var v=u[g],A=0,E=v.length;A<E;A++)if(typeof v[A].token=="string")/keyword|support|storage/.test(v[A].token)&&f.push(v[A].regex);else if(typeof v[A].token=="object"){for(var w=0,m=v[A].token.length;w<m;w++)if(/keyword|support|storage/.test(v[A].token[w])){var g=v[A].regex.match(/\(.+?\)/g)[w];f.push(g.substr(1,g.length-2))}}this.completionKeywords=f}return r?f.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(r,u,f,g){var v=this.$keywordList||this.$createKeywordList();return v.map(function(A){return{name:A,value:A,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(h.prototype),l.Mode=h}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(n,l,y){var a=n("./lib/dom"),p=(function(){function d(s){this.session=s,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}return d.prototype.getRowLength=function(s){var c;return this.lineWidgets?c=this.lineWidgets[s]&&this.lineWidgets[s].rowCount||0:c=0,!this.$useWrapMode||!this.$wrapData[s]?1+c:this.$wrapData[s].length+1+c},d.prototype.$getWidgetScreenLength=function(){var s=0;return this.lineWidgets.forEach(function(c){c&&c.rowCount&&!c.hidden&&(s+=c.rowCount)}),s},d.prototype.$onChangeEditor=function(s){this.attach(s.editor)},d.prototype.attach=function(s){s&&s.widgetManager&&s.widgetManager!=this&&s.widgetManager.detach(),this.editor!=s&&(this.detach(),this.editor=s,s&&(s.widgetManager=this,s.renderer.on("beforeRender",this.measureWidgets),s.renderer.on("afterRender",this.renderWidgets)))},d.prototype.detach=function(s){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 e=this.session.lineWidgets;e&&e.forEach(function(i){i&&i.el&&i.el.parentNode&&(i._inDocument=!1,i.el.parentNode.removeChild(i.el))})}},d.prototype.updateOnFold=function(s,c){var e=c.lineWidgets;if(!(!e||!s.action)){for(var i=s.data,o=i.start.row,h=i.end.row,r=s.action=="add",u=o+1;u<h;u++)e[u]&&(e[u].hidden=r);e[h]&&(r?e[o]?e[h].hidden=r:e[o]=e[h]:(e[o]==e[h]&&(e[o]=void 0),e[h].hidden=r))}},d.prototype.updateOnChange=function(s){var c=this.session.lineWidgets;if(c){var e=s.start.row,i=s.end.row-e;if(i!==0)if(s.action=="remove"){var o=c.splice(e+1,i);!c[e]&&o[o.length-1]&&(c[e]=o.pop()),o.forEach(function(r){r&&this.removeLineWidget(r)},this),this.$updateRows()}else{var h=new Array(i);c[e]&&c[e].column!=null&&s.start.column>c[e].column&&e++,h.unshift(e,0),c.splice.apply(c,h),this.$updateRows()}}},d.prototype.$updateRows=function(){var s=this.session.lineWidgets;if(s){var c=!0;s.forEach(function(e,i){if(e)for(c=!1,e.row=i;e.$oldWidget;)e.$oldWidget.row=i,e=e.$oldWidget}),c&&(this.session.lineWidgets=null)}},d.prototype.$registerLineWidget=function(s){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var c=this.session.lineWidgets[s.row];return c&&(s.$oldWidget=c,c.el&&c.el.parentNode&&(c.el.parentNode.removeChild(c.el),c._inDocument=!1)),this.session.lineWidgets[s.row]=s,s},d.prototype.addLineWidget=function(s){if(this.$registerLineWidget(s),s.session=this.session,!this.editor)return s;var c=this.editor.renderer;s.html&&!s.el&&(s.el=a.createElement("div"),s.el.innerHTML=s.html),s.text&&!s.el&&(s.el=a.createElement("div"),s.el.textContent=s.text),s.el&&(a.addCssClass(s.el,"ace_lineWidgetContainer"),s.className&&a.addCssClass(s.el,s.className),s.el.style.position="absolute",s.el.style.zIndex="5",c.container.appendChild(s.el),s._inDocument=!0,s.coverGutter||(s.el.style.zIndex="3"),s.pixelHeight==null&&(s.pixelHeight=s.el.offsetHeight)),s.rowCount==null&&(s.rowCount=s.pixelHeight/c.layerConfig.lineHeight);var e=this.session.getFoldAt(s.row,0);if(s.$fold=e,e){var i=this.session.lineWidgets;s.row==e.end.row&&!i[e.start.row]?i[e.start.row]=s:s.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:s.row}}}),this.$updateRows(),this.renderWidgets(null,c),this.onWidgetChanged(s),s},d.prototype.removeLineWidget=function(s){if(s._inDocument=!1,s.session=null,s.el&&s.el.parentNode&&s.el.parentNode.removeChild(s.el),s.editor&&s.editor.destroy)try{s.editor.destroy()}catch{}if(this.session.lineWidgets){var c=this.session.lineWidgets[s.row];if(c==s)this.session.lineWidgets[s.row]=s.$oldWidget,s.$oldWidget&&this.onWidgetChanged(s.$oldWidget);else for(;c;){if(c.$oldWidget==s){c.$oldWidget=s.$oldWidget;break}c=c.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:s.row}}}),this.$updateRows()},d.prototype.getWidgetsAtRow=function(s){for(var c=this.session.lineWidgets,e=c&&c[s],i=[];e;)i.push(e),e=e.$oldWidget;return i},d.prototype.onWidgetChanged=function(s){this.session._changedWidgets.push(s),this.editor&&this.editor.renderer.updateFull()},d.prototype.measureWidgets=function(s,c){var e=this.session._changedWidgets,i=c.layerConfig;if(!(!e||!e.length)){for(var o=1/0,h=0;h<e.length;h++){var r=e[h];if(!(!r||!r.el)&&r.session==this.session){if(!r._inDocument){if(this.session.lineWidgets[r.row]!=r)continue;r._inDocument=!0,c.container.appendChild(r.el)}r.h=r.el.offsetHeight,r.fixedWidth||(r.w=r.el.offsetWidth,r.screenWidth=Math.ceil(r.w/i.characterWidth));var u=r.h/i.lineHeight;r.coverLine&&(u-=this.session.getRowLineCount(r.row),u<0&&(u=0)),r.rowCount!=u&&(r.rowCount=u,r.row<o&&(o=r.row))}}o!=1/0&&(this.session._emit("changeFold",{data:{start:{row:o}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},d.prototype.renderWidgets=function(s,c){var e=c.layerConfig,i=this.session.lineWidgets;if(i){for(var o=Math.min(this.firstRow,e.firstRow),h=Math.max(this.lastRow,e.lastRow,i.length);o>0&&!i[o];)o--;this.firstRow=e.firstRow,this.lastRow=e.lastRow,c.$cursorLayer.config=e;for(var r=o;r<=h;r++){var u=i[r];if(!(!u||!u.el)){if(u.hidden){u.el.style.top=-100-(u.pixelHeight||0)+"px";continue}u._inDocument||(u._inDocument=!0,c.container.appendChild(u.el));var f=c.$cursorLayer.getPixelPosition({row:r,column:0},!0).top;u.coverLine||(f+=e.lineHeight*this.session.getRowLineCount(u.row)),u.el.style.top=f-e.offset+"px";var g=u.coverGutter?0:c.gutterWidth;u.fixedWidth||(g-=c.scrollLeft),u.el.style.left=g+"px",u.fullWidth&&u.screenWidth&&(u.el.style.minWidth=e.width+2*e.padding+"px"),u.fixedWidth?u.el.style.right=c.scrollBar.getWidth()+"px":u.el.style.right=""}}}},d})();l.LineWidgets=p}),ace.define("ace/apply_delta",["require","exports","module"],function(n,l,y){l.applyDelta=function(a,p,d){var s=p.start.row,c=p.start.column,e=a[s]||"";switch(p.action){case"insert":var i=p.lines;if(i.length===1)a[s]=e.substring(0,c)+p.lines[0]+e.substring(c);else{var o=[s,1].concat(p.lines);a.splice.apply(a,o),a[s]=e.substring(0,c)+a[s],a[s+p.lines.length-1]+=e.substring(c)}break;case"remove":var h=p.end.column,r=p.end.row;s===r?a[s]=e.substring(0,c)+e.substring(h):a.splice(s,r-s+1,e.substring(0,c)+a[r].substring(h));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(n,l,y){var a=n("./lib/oop"),p=n("./lib/event_emitter").EventEmitter,d=(function(){function e(i,o,h){this.$onChange=this.onChange.bind(this),this.attach(i),typeof o!="number"?this.setPosition(o.row,o.column):this.setPosition(o,h)}return e.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},e.prototype.getDocument=function(){return this.document},e.prototype.onChange=function(i){if(!(i.start.row==i.end.row&&i.start.row!=this.row)&&!(i.start.row>this.row)){var o=c(i,{row:this.row,column:this.column},this.$insertRight);this.setPosition(o.row,o.column,!0)}},e.prototype.setPosition=function(i,o,h){var r;if(h?r={row:i,column:o}:r=this.$clipPositionToDocument(i,o),!(this.row==r.row&&this.column==r.column)){var u={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:u,value:r})}},e.prototype.detach=function(){this.document.off("change",this.$onChange)},e.prototype.attach=function(i){this.document=i||this.document,this.document.on("change",this.$onChange)},e.prototype.$clipPositionToDocument=function(i,o){var h={};return i>=this.document.getLength()?(h.row=Math.max(0,this.document.getLength()-1),h.column=this.document.getLine(h.row).length):i<0?(h.row=0,h.column=0):(h.row=i,h.column=Math.min(this.document.getLine(h.row).length,Math.max(0,o))),o<0&&(h.column=0),h},e})();d.prototype.$insertRight=!1,a.implement(d.prototype,p);function s(e,i,o){var h=o?e.column<=i.column:e.column<i.column;return e.row<i.row||e.row==i.row&&h}function c(e,i,o){var h=e.action=="insert",r=(h?1:-1)*(e.end.row-e.start.row),u=(h?1:-1)*(e.end.column-e.start.column),f=e.start,g=h?f:e.end;return s(i,f,o)?{row:i.row,column:i.column}:s(g,i,!o)?{row:i.row+r,column:i.column+(i.row==g.row?u:0)}:{row:f.row,column:f.column}}l.Anchor=d}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(n,l,y){var a=n("./lib/oop"),p=n("./apply_delta").applyDelta,d=n("./lib/event_emitter").EventEmitter,s=n("./range").Range,c=n("./anchor").Anchor,e=(function(){function i(o){this.$lines=[""],o.length===0?this.$lines=[""]:Array.isArray(o)?this.insertMergedLines({row:0,column:0},o):this.insert({row:0,column:0},o)}return i.prototype.setValue=function(o){var h=this.getLength()-1;this.remove(new s(0,0,h,this.getLine(h).length)),this.insert({row:0,column:0},o||"")},i.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},i.prototype.createAnchor=function(o,h){return new c(this,o,h)},i.prototype.$detectNewLine=function(o){var h=o.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=h?h[1]:`
|
|
200
|
-
`,this._signal("changeNewLineMode")},i.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
|
|
201
|
-
`;case"unix":return`
|
|
202
|
-
`;default:return this.$autoNewLine||`
|
|
203
|
-
`}},i.prototype.setNewLineMode=function(o){this.$newLineMode!==o&&(this.$newLineMode=o,this._signal("changeNewLineMode"))},i.prototype.getNewLineMode=function(){return this.$newLineMode},i.prototype.isNewLine=function(o){return o==`\r
|
|
204
|
-
`||o=="\r"||o==`
|
|
205
|
-
`},i.prototype.getLine=function(o){return this.$lines[o]||""},i.prototype.getLines=function(o,h){return this.$lines.slice(o,h+1)},i.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},i.prototype.getLength=function(){return this.$lines.length},i.prototype.getTextRange=function(o){return this.getLinesForRange(o).join(this.getNewLineCharacter())},i.prototype.getLinesForRange=function(o){var h;if(o.start.row===o.end.row)h=[this.getLine(o.start.row).substring(o.start.column,o.end.column)];else{h=this.getLines(o.start.row,o.end.row),h[0]=(h[0]||"").substring(o.start.column);var r=h.length-1;o.end.row-o.start.row==r&&(h[r]=h[r].substring(0,o.end.column))}return h},i.prototype.insertLines=function(o,h){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(o,h)},i.prototype.removeLines=function(o,h){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(o,h)},i.prototype.insertNewLine=function(o){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(o,["",""])},i.prototype.insert=function(o,h){return this.getLength()<=1&&this.$detectNewLine(h),this.insertMergedLines(o,this.$split(h))},i.prototype.insertInLine=function(o,h){var r=this.clippedPos(o.row,o.column),u=this.pos(o.row,o.column+h.length);return this.applyDelta({start:r,end:u,action:"insert",lines:[h]},!0),this.clonePos(u)},i.prototype.clippedPos=function(o,h){var r=this.getLength();o===void 0?o=r:o<0?o=0:o>=r&&(o=r-1,h=void 0);var u=this.getLine(o);return h==null&&(h=u.length),h=Math.min(Math.max(h,0),u.length),{row:o,column:h}},i.prototype.clonePos=function(o){return{row:o.row,column:o.column}},i.prototype.pos=function(o,h){return{row:o,column:h}},i.prototype.$clipPosition=function(o){var h=this.getLength();return o.row>=h?(o.row=Math.max(0,h-1),o.column=this.getLine(h-1).length):(o.row=Math.max(0,o.row),o.column=Math.min(Math.max(o.column,0),this.getLine(o.row).length)),o},i.prototype.insertFullLines=function(o,h){o=Math.min(Math.max(o,0),this.getLength());var r=0;o<this.getLength()?(h=h.concat([""]),r=0):(h=[""].concat(h),o--,r=this.$lines[o].length),this.insertMergedLines({row:o,column:r},h)},i.prototype.insertMergedLines=function(o,h){var r=this.clippedPos(o.row,o.column),u={row:r.row+h.length-1,column:(h.length==1?r.column:0)+h[h.length-1].length};return this.applyDelta({start:r,end:u,action:"insert",lines:h}),this.clonePos(u)},i.prototype.remove=function(o){var h=this.clippedPos(o.start.row,o.start.column),r=this.clippedPos(o.end.row,o.end.column);return this.applyDelta({start:h,end:r,action:"remove",lines:this.getLinesForRange({start:h,end:r})}),this.clonePos(h)},i.prototype.removeInLine=function(o,h,r){var u=this.clippedPos(o,h),f=this.clippedPos(o,r);return this.applyDelta({start:u,end:f,action:"remove",lines:this.getLinesForRange({start:u,end:f})},!0),this.clonePos(u)},i.prototype.removeFullLines=function(o,h){o=Math.min(Math.max(0,o),this.getLength()-1),h=Math.min(Math.max(0,h),this.getLength()-1);var r=h==this.getLength()-1&&o>0,u=h<this.getLength()-1,f=r?o-1:o,g=r?this.getLine(f).length:0,v=u?h+1:h,A=u?0:this.getLine(v).length,E=new s(f,g,v,A),w=this.$lines.slice(o,h+1);return this.applyDelta({start:E.start,end:E.end,action:"remove",lines:this.getLinesForRange(E)}),w},i.prototype.removeNewLine=function(o){o<this.getLength()-1&&o>=0&&this.applyDelta({start:this.pos(o,this.getLine(o).length),end:this.pos(o+1,0),action:"remove",lines:["",""]})},i.prototype.replace=function(o,h){if(o instanceof s||(o=s.fromPoints(o.start,o.end)),h.length===0&&o.isEmpty())return o.start;if(h==this.getTextRange(o))return o.end;this.remove(o);var r;return h?r=this.insert(o.start,h):r=o.start,r},i.prototype.applyDeltas=function(o){for(var h=0;h<o.length;h++)this.applyDelta(o[h])},i.prototype.revertDeltas=function(o){for(var h=o.length-1;h>=0;h--)this.revertDelta(o[h])},i.prototype.applyDelta=function(o,h){var r=o.action=="insert";(r?o.lines.length<=1&&!o.lines[0]:!s.comparePoints(o.start,o.end))||(r&&o.lines.length>2e4?this.$splitAndapplyLargeDelta(o,2e4):(p(this.$lines,o,h),this._signal("change",o)))},i.prototype.$safeApplyDelta=function(o){var h=this.$lines.length;(o.action=="remove"&&o.start.row<h&&o.end.row<h||o.action=="insert"&&o.start.row<=h)&&this.applyDelta(o)},i.prototype.$splitAndapplyLargeDelta=function(o,h){for(var r=o.lines,u=r.length-h+1,f=o.start.row,g=o.start.column,v=0,A=0;v<u;v=A){A+=h-1;var E=r.slice(v,A);E.push(""),this.applyDelta({start:this.pos(f+v,g),end:this.pos(f+A,g=0),action:o.action,lines:E},!0)}o.lines=r.slice(v),o.start.row=f+v,o.start.column=g,this.applyDelta(o,!0)},i.prototype.revertDelta=function(o){this.$safeApplyDelta({start:this.clonePos(o.start),end:this.clonePos(o.end),action:o.action=="insert"?"remove":"insert",lines:o.lines.slice()})},i.prototype.indexToPosition=function(o,h){for(var r=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,f=h||0,g=r.length;f<g;f++)if(o-=r[f].length+u,o<0)return{row:f,column:o+r[f].length+u};return{row:g-1,column:o+r[g-1].length+u}},i.prototype.positionToIndex=function(o,h){for(var r=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,f=0,g=Math.min(o.row,r.length),v=h||0;v<g;++v)f+=r[v].length+u;return f+o.column},i.prototype.$split=function(o){return o.split(/\r\n|\r|\n/)},i})();e.prototype.$autoNewLine="",e.prototype.$newLineMode="auto",a.implement(e.prototype,d),l.Document=e}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(n,l,y){var a=n("./lib/oop"),p=n("./lib/event_emitter").EventEmitter,d=(function(){function s(c,e){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=c;var i=this;this.$worker=function(){if(i.running){for(var o=new Date,h=i.currentLine,r=-1,u=i.doc,f=h;i.lines[h];)h++;var g=u.getLength(),v=0;for(i.running=!1;h<g;){i.$tokenizeRow(h),r=h;do h++;while(i.lines[h]);if(v++,v%5===0&&new Date-o>20){i.running=setTimeout(i.$worker,20);break}}i.currentLine=h,r==-1&&(r=h),f<=r&&i.fireUpdateEvent(f,r)}}}return s.prototype.setTokenizer=function(c){this.tokenizer=c,this.lines=[],this.states=[],this.start(0)},s.prototype.setDocument=function(c){this.doc=c,this.lines=[],this.states=[],this.stop()},s.prototype.fireUpdateEvent=function(c,e){var i={first:c,last:e};this._signal("update",{data:i})},s.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)},s.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},s.prototype.$updateOnChange=function(c){var e=c.start.row,i=c.end.row-e;if(i===0)this.lines[e]=null;else if(c.action=="remove")this.lines.splice(e,i+1,null),this.states.splice(e,i+1,null);else{var o=Array(i+1);o.unshift(e,1),this.lines.splice.apply(this.lines,o),this.states.splice.apply(this.states,o)}this.currentLine=Math.min(e,this.currentLine,this.doc.getLength()),this.stop()},s.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},s.prototype.getTokens=function(c){return this.lines[c]||this.$tokenizeRow(c)},s.prototype.getState=function(c){return this.currentLine==c&&this.$tokenizeRow(c),this.states[c]||"start"},s.prototype.$tokenizeRow=function(c){var e=this.doc.getLine(c),i=this.states[c-1],o=this.tokenizer.getLineTokens(e,i,c);return this.states[c]+""!=o.state+""?(this.states[c]=o.state,this.lines[c+1]=null,this.currentLine>c+1&&(this.currentLine=c+1)):this.currentLine==c&&(this.currentLine=c+1),this.lines[c]=o.tokens},s.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},s})();a.implement(d.prototype,p),l.BackgroundTokenizer=d}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(n,l,y){var a=n("./lib/lang"),p=n("./range").Range,d=(function(){function s(c,e,i){i===void 0&&(i="text"),this.setRegexp(c),this.clazz=e,this.type=i,this.docLen=0}return s.prototype.setRegexp=function(c){this.regExp+""!=c+""&&(this.regExp=c,this.cache=[])},s.prototype.update=function(c,e,i,o){if(this.regExp){for(var h=o.firstRow,r=o.lastRow,u={},f=i.$editor&&i.$editor.$search,g=f&&f.$isMultilineSearch(i.$editor.getLastSearchOptions()),v=h;v<=r;v++){var A=this.cache[v];if(A==null||i.getValue().length!=this.docLen){if(g){A=[];var E=f.$multiLineForward(i,this.regExp,v,r);if(E){var w=E.endRow<=r?E.endRow-1:r;w>v&&(v=w),A.push(new p(E.startRow,E.startCol,E.endRow,E.endCol))}A.length>this.MAX_RANGES&&(A=A.slice(0,this.MAX_RANGES))}else A=a.getMatchOffsets(i.getLine(v),this.regExp),A.length>this.MAX_RANGES&&(A=A.slice(0,this.MAX_RANGES)),A=A.map(function(D){return new p(v,D.offset,v,D.offset+D.length)});this.cache[v]=A.length?A:""}if(A.length!==0)for(var m=A.length;m--;){var S=A[m].toScreenRange(i),k=S.toString();u[k]||(u[k]=!0,e.drawSingleLineMarker(c,S,this.clazz,o))}}this.docLen=i.getValue().length}},s})();d.prototype.MAX_RANGES=500,l.SearchHighlight=d}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(n,l,y){var a=(function(){function w(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return w.prototype.addSession=function(m){this.$session=m},w.prototype.add=function(m,S,k){if(!this.$fromUndo&&m!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),S===!1||!this.lastDeltas){this.lastDeltas=[];var D=this.$undoStack.length;D>this.$undoDepth-1&&this.$undoStack.splice(0,D-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),m.id=this.$rev=++this.$maxRev}(m.action=="remove"||m.action=="insert")&&(this.$lastDelta=m),this.lastDeltas.push(m)}},w.prototype.addSelection=function(m,S){this.selections.push({value:m,rev:S||this.$rev})},w.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},w.prototype.markIgnored=function(m,S){S==null&&(S=this.$rev+1);for(var k=this.$undoStack,D=k.length;D--;){var _=k[D][0];if(_.id<=m)break;_.id<S&&(_.ignore=!0)}this.lastDeltas=null},w.prototype.getSelection=function(m,S){for(var k=this.selections,D=k.length;D--;){var _=k[D];if(_.rev<m)return S&&(_=k[D+1]),_}},w.prototype.getRevision=function(){return this.$rev},w.prototype.getDeltas=function(m,S){S==null&&(S=this.$rev+1);for(var k=this.$undoStack,D=null,_=0,F=k.length;F--;){var x=k[F][0];if(x.id<S&&!D&&(D=F+1),x.id<=m){_=F+1;break}}return k.slice(_,D)},w.prototype.getChangedRanges=function(m,S){S==null&&(S=this.$rev+1)},w.prototype.getChangedLines=function(m,S){S==null&&(S=this.$rev+1)},w.prototype.undo=function(m,S){this.lastDeltas=null;var k=this.$undoStack;if(p(k,k.length)){m||(m=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var D=k.pop(),_=null;return D&&(_=m.undoChanges(D,S),this.$redoStack.push(D),this.$syncRev()),this.$fromUndo=!1,_}},w.prototype.redo=function(m,S){if(this.lastDeltas=null,m||(m=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var k=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);E(this.$redoStack,k),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(F){F[0].id=++this.$maxRev},this)}var D=this.$redoStack.pop(),_=null;return D&&(_=m.redoChanges(D,S),this.$undoStack.push(D),this.$syncRev()),this.$fromUndo=!1,_},w.prototype.$syncRev=function(){var m=this.$undoStack,S=m[m.length-1],k=S&&S[0].id||0;this.$redoStackBaseRev=k,this.$rev=k},w.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},w.prototype.canUndo=function(){return this.$undoStack.length>0},w.prototype.canRedo=function(){return this.$redoStack.length>0},w.prototype.bookmark=function(m){m==null&&(m=this.$rev),this.mark=m},w.prototype.isAtBookmark=function(){return this.$rev===this.mark},w.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},w.prototype.fromJSON=function(m){this.reset(),this.$undoStack=m.$undoStack,this.$redoStack=m.$redoStack},w.prototype.$prettyPrint=function(m){return m?i(m):i(this.$undoStack)+`
|
|
206
|
-
---
|
|
207
|
-
`+i(this.$redoStack)},w})();a.prototype.hasUndo=a.prototype.canUndo,a.prototype.hasRedo=a.prototype.canRedo,a.prototype.isClean=a.prototype.isAtBookmark,a.prototype.markClean=a.prototype.bookmark;function p(w,m){for(var S=m;S--;){var k=w[S];if(k&&!k[0].ignore){for(;S<m-1;){var D=r(w[S],w[S+1]);w[S]=D[0],w[S+1]=D[1],S++}return!0}}}var d=n("./range").Range,s=d.comparePoints;d.comparePoints;function c(w){return{row:w.row,column:w.column}}function e(w){return{start:c(w.start),end:c(w.end),action:w.action,lines:w.lines.slice()}}function i(w){if(w=w||this,Array.isArray(w))return w.map(i).join(`
|
|
208
|
-
`);var m="";return w.action?(m=w.action=="insert"?"+":"-",m+="["+w.lines+"]"):w.value&&(Array.isArray(w.value)?m=w.value.map(o).join(`
|
|
209
|
-
`):m=o(w.value)),w.start&&(m+=o(w)),(w.id||w.rev)&&(m+=" ("+(w.id||w.rev)+")"),m}function o(w){return w.start.row+":"+w.start.column+"=>"+w.end.row+":"+w.end.column}function h(w,m){var S=w.action=="insert",k=m.action=="insert";if(S&&k)if(s(m.start,w.end)>=0)f(m,w,-1);else if(s(m.start,w.start)<=0)f(w,m,1);else return null;else if(S&&!k)if(s(m.start,w.end)>=0)f(m,w,-1);else if(s(m.end,w.start)<=0)f(w,m,-1);else return null;else if(!S&&k)if(s(m.start,w.start)>=0)f(m,w,1);else if(s(m.start,w.start)<=0)f(w,m,1);else return null;else if(!S&&!k)if(s(m.start,w.start)>=0)f(m,w,1);else if(s(m.end,w.start)<=0)f(w,m,-1);else return null;return[m,w]}function r(w,m){for(var S=w.length;S--;)for(var k=0;k<m.length;k++)if(!h(w[S],m[k])){for(;S<w.length;){for(;k--;)h(m[k],w[S]);k=m.length,S++}return[w,m]}return w.selectionBefore=m.selectionBefore=w.selectionAfter=m.selectionAfter=null,[m,w]}function u(w,m){var S=w.action=="insert",k=m.action=="insert";if(S&&k)s(w.start,m.start)<0?f(m,w,1):f(w,m,1);else if(S&&!k)s(w.start,m.end)>=0?f(w,m,-1):(s(w.start,m.start)<=0||f(w,d.fromPoints(m.start,w.start),-1),f(m,w,1));else if(!S&&k)s(m.start,w.end)>=0?f(m,w,-1):(s(m.start,w.start)<=0||f(m,d.fromPoints(w.start,m.start),-1),f(w,m,1));else if(!S&&!k)if(s(m.start,w.end)>=0)f(m,w,-1);else if(s(m.end,w.start)<=0)f(w,m,-1);else{var D,_;return s(w.start,m.start)<0&&(D=w,w=v(w,m.start)),s(w.end,m.end)>0&&(_=v(w,m.end)),g(m.end,w.start,w.end,-1),_&&!D&&(w.lines=_.lines,w.start=_.start,w.end=_.end,_=w),[m,D,_].filter(Boolean)}return[m,w]}function f(w,m,S){g(w.start,m.start,m.end,S),g(w.end,m.start,m.end,S)}function g(w,m,S,k){w.row==(k==1?m:S).row&&(w.column+=k*(S.column-m.column)),w.row+=k*(S.row-m.row)}function v(w,m){var S=w.lines,k=w.end;w.end=c(m);var D=w.end.row-w.start.row,_=S.splice(D,S.length),F=D?m.column:m.column-w.start.column;S.push(_[0].substring(0,F)),_[0]=_[0].substr(F);var x={start:c(m),end:k,lines:_,action:w.action};return x}function A(w,m){m=e(m);for(var S=w.length;S--;){for(var k=w[S],D=0;D<k.length;D++){var _=k[D],F=u(_,m);m=F[0],F.length!=2&&(F[2]?(k.splice(D+1,1,F[1],F[2]),D++):F[1]||(k.splice(D,1),D--))}k.length||w.splice(S,1)}return w}function E(w,m){for(var S=0;S<m.length;S++)for(var k=m[S],D=0;D<k.length;D++)A(w,k[D])}l.UndoManager=a}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(n,l,y){var a=n("../range").Range,p=(function(){function d(s,c){this.foldData=s,Array.isArray(c)?this.folds=c:c=this.folds=[c];var e=c[c.length-1];this.range=new a(c[0].start.row,c[0].start.column,e.end.row,e.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(i){i.setFoldLine(this)},this)}return d.prototype.shiftRow=function(s){this.start.row+=s,this.end.row+=s,this.folds.forEach(function(c){c.start.row+=s,c.end.row+=s})},d.prototype.addFold=function(s){if(s.sameRow){if(s.start.row<this.startRow||s.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(s),this.folds.sort(function(c,e){return-c.range.compareEnd(e.start.row,e.start.column)}),this.range.compareEnd(s.start.row,s.start.column)>0?(this.end.row=s.end.row,this.end.column=s.end.column):this.range.compareStart(s.end.row,s.end.column)<0&&(this.start.row=s.start.row,this.start.column=s.start.column)}else if(s.start.row==this.end.row)this.folds.push(s),this.end.row=s.end.row,this.end.column=s.end.column;else if(s.end.row==this.start.row)this.folds.unshift(s),this.start.row=s.start.row,this.start.column=s.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");s.foldLine=this},d.prototype.containsRow=function(s){return s>=this.start.row&&s<=this.end.row},d.prototype.walk=function(s,c,e){var i=0,o=this.folds,h,r,u,f=!0;c==null&&(c=this.end.row,e=this.end.column);for(var g=0;g<o.length;g++){if(h=o[g],r=h.range.compareStart(c,e),r==-1){s(null,c,e,i,f);return}if(u=s(null,h.start.row,h.start.column,i,f),u=!u&&s(h.placeholder,h.start.row,h.start.column,i),u||r===0)return;f=!h.sameRow,i=h.end.column}s(null,c,e,i,f)},d.prototype.getNextFoldTo=function(s,c){for(var e,i,o=0;o<this.folds.length;o++){if(e=this.folds[o],i=e.range.compareEnd(s,c),i==-1)return{fold:e,kind:"after"};if(i===0)return{fold:e,kind:"inside"}}return null},d.prototype.addRemoveChars=function(s,c,e){var i=this.getNextFoldTo(s,c),o,h;if(i){if(o=i.fold,i.kind=="inside"&&o.start.column!=c&&o.start.row!=s)window.console&&window.console.log(s,c,o);else if(o.start.row==s){h=this.folds;var r=h.indexOf(o);for(r===0&&(this.start.column+=e),r;r<h.length;r++){if(o=h[r],o.start.column+=e,!o.sameRow)return;o.end.column+=e}this.end.column+=e}}},d.prototype.split=function(s,c){var e=this.getNextFoldTo(s,c);if(!e||e.kind=="inside")return null;var i=e.fold,o=this.folds,h=this.foldData,r=o.indexOf(i),u=o[r-1];this.end.row=u.end.row,this.end.column=u.end.column,o=o.splice(r,o.length-r);var f=new d(h,o);return h.splice(h.indexOf(this)+1,0,f),f},d.prototype.merge=function(s){for(var c=s.folds,e=0;e<c.length;e++)this.addFold(c[e]);var i=this.foldData;i.splice(i.indexOf(s),1)},d.prototype.toString=function(){var s=[this.range.toString()+": ["];return this.folds.forEach(function(c){s.push(" "+c.toString())}),s.push("]"),s.join(`
|
|
210
|
-
`)},d.prototype.idxToPosition=function(s){for(var c=0,e=0;e<this.folds.length;e++){var i=this.folds[e];if(s-=i.start.column-c,s<0)return{row:i.start.row,column:i.start.column+s};if(s-=i.placeholder.length,s<0)return i.start;c=i.end.column}return{row:this.end.row,column:this.end.column+s}},d})();l.FoldLine=p}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(n,l,y){var a=n("./range").Range,p=a.comparePoints,d=(function(){function s(){this.ranges=[],this.$bias=1}return s.prototype.pointIndex=function(c,e,i){for(var o=this.ranges,h=i||0;h<o.length;h++){var r=o[h],u=p(c,r.end);if(!(u>0)){var f=p(c,r.start);return u===0?e&&f!==0?-h-2:h:f>0||f===0&&!e?h:-h-1}}return-h-1},s.prototype.add=function(c){var e=!c.isEmpty(),i=this.pointIndex(c.start,e);i<0&&(i=-i-1);var o=this.pointIndex(c.end,e,i);return o<0?o=-o-1:o++,this.ranges.splice(i,o-i,c)},s.prototype.addList=function(c){for(var e=[],i=c.length;i--;)e.push.apply(e,this.add(c[i]));return e},s.prototype.substractPoint=function(c){var e=this.pointIndex(c);if(e>=0)return this.ranges.splice(e,1)},s.prototype.merge=function(){var c=[],e=this.ranges;e=e.sort(function(u,f){return p(u.start,f.start)});for(var i=e[0],o,h=1;h<e.length;h++){o=i,i=e[h];var r=p(o.end,i.start);r<0||r==0&&!o.isEmpty()&&!i.isEmpty()||(p(o.end,i.end)<0&&(o.end.row=i.end.row,o.end.column=i.end.column),e.splice(h,1),c.push(i),i=o,h--)}return this.ranges=e,c},s.prototype.contains=function(c,e){return this.pointIndex({row:c,column:e})>=0},s.prototype.containsPoint=function(c){return this.pointIndex(c)>=0},s.prototype.rangeAtPoint=function(c){var e=this.pointIndex(c);if(e>=0)return this.ranges[e]},s.prototype.clipRows=function(c,e){var i=this.ranges;if(i[0].start.row>e||i[i.length-1].start.row<c)return[];var o=this.pointIndex({row:c,column:0});o<0&&(o=-o-1);var h=this.pointIndex({row:e,column:0},o);h<0&&(h=-h-1);for(var r=[],u=o;u<h;u++)r.push(i[u]);return r},s.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},s.prototype.attach=function(c){this.session&&this.detach(),this.session=c,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},s.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},s.prototype.$onChange=function(c){for(var e=c.start,i=c.end,o=e.row,h=i.row,r=this.ranges,u=0,f=r.length;u<f;u++){var g=r[u];if(g.end.row>=o)break}if(c.action=="insert")for(var v=h-o,A=-e.column+i.column;u<f;u++){var g=r[u];if(g.start.row>o)break;if(g.start.row==o&&g.start.column>=e.column&&(g.start.column==e.column&&this.$bias<=0||(g.start.column+=A,g.start.row+=v)),g.end.row==o&&g.end.column>=e.column){if(g.end.column==e.column&&this.$bias<0)continue;g.end.column==e.column&&A>0&&u<f-1&&g.end.column>g.start.column&&g.end.column==r[u+1].start.column&&(g.end.column-=A),g.end.column+=A,g.end.row+=v}}else for(var v=o-h,A=e.column-i.column;u<f;u++){var g=r[u];if(g.start.row>h)break;g.end.row<h&&(o<g.end.row||o==g.end.row&&e.column<g.end.column)?(g.end.row=o,g.end.column=e.column):g.end.row==h?g.end.column<=i.column?(v||g.end.column>e.column)&&(g.end.column=e.column,g.end.row=e.row):(g.end.column+=A,g.end.row+=v):g.end.row>h&&(g.end.row+=v),g.start.row<h&&(o<g.start.row||o==g.start.row&&e.column<g.start.column)?(g.start.row=o,g.start.column=e.column):g.start.row==h?g.start.column<=i.column?(v||g.start.column>e.column)&&(g.start.column=e.column,g.start.row=e.row):(g.start.column+=A,g.start.row+=v):g.start.row>h&&(g.start.row+=v)}if(v!=0&&u<f)for(;u<f;u++){var g=r[u];g.start.row+=v,g.end.row+=v}},s})();d.prototype.comparePoints=p,l.RangeList=d}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(n,l,y){var a=this&&this.__extends||(function(){var o=function(h,r){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(u[g]=f[g])},o(h,r)};return function(h,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");o(h,r);function u(){this.constructor=h}h.prototype=r===null?Object.create(r):(u.prototype=r.prototype,new u)}})(),p=n("../range_list").RangeList,d=(function(o){a(h,o);function h(r,u){var f=o.call(this)||this;return f.foldLine=null,f.placeholder=u,f.range=r,f.start=r.start,f.end=r.end,f.sameRow=r.start.row==r.end.row,f.subFolds=f.ranges=[],f}return h.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},h.prototype.setFoldLine=function(r){this.foldLine=r,this.subFolds.forEach(function(u){u.setFoldLine(r)})},h.prototype.clone=function(){var r=this.range.clone(),u=new h(r,this.placeholder);return this.subFolds.forEach(function(f){u.subFolds.push(f.clone())}),u.collapseChildren=this.collapseChildren,u},h.prototype.addSubFold=function(r){if(!this.range.isEqual(r)){c(r,this.start);for(var A=r.start.row,E=r.start.column,u=0,f=-1;u<this.subFolds.length&&(f=this.subFolds[u].range.compare(A,E),f==1);u++);var g=this.subFolds[u],v=0;if(f==0){if(g.range.containsRange(r))return g.addSubFold(r);v=1}for(var A=r.range.end.row,E=r.range.end.column,w=u,f=-1;w<this.subFolds.length&&(f=this.subFolds[w].range.compare(A,E),f==1);w++);f==0&&w++;for(var m=this.subFolds.splice(u,w-u,r),S=f==0?m.length-1:m.length,k=v;k<S;k++)r.addSubFold(m[k]);return r.setFoldLine(this.foldLine),r}},h.prototype.restoreRange=function(r){return i(r,this.start)},h})(p);function s(o,h){o.row-=h.row,o.row==0&&(o.column-=h.column)}function c(o,h){s(o.start,h),s(o.end,h)}function e(o,h){o.row==0&&(o.column+=h.column),o.row+=h.row}function i(o,h){e(o.start,h),e(o.end,h)}l.Fold=d}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],function(n,l,y){var a=n("../range").Range,p=n("./fold_line").FoldLine,d=n("./fold").Fold,s=n("../token_iterator").TokenIterator,c=n("../mouse/mouse_event").MouseEvent;function e(){this.getFoldAt=function(i,o,h){var r=this.getFoldLine(i);if(!r)return null;for(var u=r.folds,f=0;f<u.length;f++){var g=u[f].range;if(g.contains(i,o)){if(h==1&&g.isEnd(i,o)&&!g.isEmpty())continue;if(h==-1&&g.isStart(i,o)&&!g.isEmpty())continue;return u[f]}}},this.getFoldsInRange=function(i){var o=i.start,h=i.end,r=this.$foldData,u=[];o.column+=1,h.column-=1;for(var f=0;f<r.length;f++){var g=r[f].range.compareRange(i);if(g!=2){if(g==-2)break;for(var v=r[f].folds,A=0;A<v.length;A++){var E=v[A];if(g=E.range.compareRange(i),g==-2)break;if(g==2)continue;if(g==42)break;u.push(E)}}}return o.column-=1,h.column+=1,u},this.getFoldsInRangeList=function(i){if(Array.isArray(i)){var o=[];i.forEach(function(h){o=o.concat(this.getFoldsInRange(h))},this)}else var o=this.getFoldsInRange(i);return o},this.getAllFolds=function(){for(var i=[],o=this.$foldData,h=0;h<o.length;h++)for(var r=0;r<o[h].folds.length;r++)i.push(o[h].folds[r]);return i},this.getFoldStringAt=function(i,o,h,r){if(r=r||this.getFoldLine(i),!r)return null;for(var u={end:{column:0}},f,g,v=0;v<r.folds.length;v++){g=r.folds[v];var A=g.range.compareEnd(i,o);if(A==-1){f=this.getLine(g.start.row).substring(u.end.column,g.start.column);break}else if(A===0)return null;u=g}return f||(f=this.getLine(g.start.row).substring(u.end.column)),h==-1?f.substring(0,o-u.end.column):h==1?f.substring(o-u.end.column):f},this.getFoldLine=function(i,o){var h=this.$foldData,r=0;for(o&&(r=h.indexOf(o)),r==-1&&(r=0),r;r<h.length;r++){var u=h[r];if(u.start.row<=i&&u.end.row>=i)return u;if(u.end.row>i)return null}return null},this.getNextFoldLine=function(i,o){var h=this.$foldData,r=0;for(o&&(r=h.indexOf(o)),r==-1&&(r=0),r;r<h.length;r++){var u=h[r];if(u.end.row>=i)return u}return null},this.getFoldedRowCount=function(i,o){for(var h=this.$foldData,r=o-i+1,u=0;u<h.length;u++){var f=h[u],g=f.end.row,v=f.start.row;if(g>=o){v<o&&(v>=i?r-=o-v:r=0);break}else g>=i&&(v>=i?r-=g-v:r-=g-i+1)}return r},this.$addFoldLine=function(i){return this.$foldData.push(i),this.$foldData.sort(function(o,h){return o.start.row-h.start.row}),i},this.addFold=function(i,o){var h=this.$foldData,r=!1,u;i instanceof d?u=i:(u=new d(o,i),u.collapseChildren=o.collapseChildren),this.$clipRangeToDocument(u.range);var f=u.start.row,g=u.start.column,v=u.end.row,A=u.end.column,E=this.getFoldAt(f,g,1),w=this.getFoldAt(v,A,-1);if(E&&w==E)return E.addSubFold(u);E&&!E.range.isStart(f,g)&&this.removeFold(E),w&&!w.range.isEnd(v,A)&&this.removeFold(w);var m=this.getFoldsInRange(u.range);m.length>0&&(this.removeFolds(m),u.collapseChildren||m.forEach(function(_){u.addSubFold(_)}));for(var S=0;S<h.length;S++){var k=h[S];if(v==k.start.row){k.addFold(u),r=!0;break}else if(f==k.end.row){if(k.addFold(u),r=!0,!u.sameRow){var D=h[S+1];if(D&&D.start.row==v){k.merge(D);break}}break}else if(v<=k.start.row)break}return r||(k=this.$addFoldLine(new p(this.$foldData,u))),this.$useWrapMode?this.$updateWrapData(k.start.row,k.start.row):this.$updateRowLengthCache(k.start.row,k.start.row),this.$modified=!0,this._signal("changeFold",{data:u,action:"add"}),u},this.addFolds=function(i){i.forEach(function(o){this.addFold(o)},this)},this.removeFold=function(i){var o=i.foldLine,h=o.start.row,r=o.end.row,u=this.$foldData,f=o.folds;if(f.length==1)u.splice(u.indexOf(o),1);else if(o.range.isEnd(i.end.row,i.end.column))f.pop(),o.end.row=f[f.length-1].end.row,o.end.column=f[f.length-1].end.column;else if(o.range.isStart(i.start.row,i.start.column))f.shift(),o.start.row=f[0].start.row,o.start.column=f[0].start.column;else if(i.sameRow)f.splice(f.indexOf(i),1);else{var g=o.split(i.start.row,i.start.column);f=g.folds,f.shift(),g.start.row=f[0].start.row,g.start.column=f[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(h,r):this.$updateRowLengthCache(h,r)),this.$modified=!0,this._signal("changeFold",{data:i,action:"remove"})},this.removeFolds=function(i){for(var o=[],h=0;h<i.length;h++)o.push(i[h]);o.forEach(function(r){this.removeFold(r)},this),this.$modified=!0},this.expandFold=function(i){this.removeFold(i),i.subFolds.forEach(function(o){i.restoreRange(o),this.addFold(o)},this),i.collapseChildren>0&&this.foldAll(i.start.row+1,i.end.row,i.collapseChildren-1),i.subFolds=[]},this.expandFolds=function(i){i.forEach(function(o){this.expandFold(o)},this)},this.unfold=function(i,o){var h,r;if(i==null)h=new a(0,0,this.getLength(),0),o==null&&(o=!0);else if(typeof i=="number")h=new a(i,0,i,this.getLine(i).length);else if("row"in i)h=a.fromPoints(i,i);else{if(Array.isArray(i))return r=[],i.forEach(function(f){r=r.concat(this.unfold(f))},this),r;h=i}r=this.getFoldsInRangeList(h);for(var u=r;r.length==1&&a.comparePoints(r[0].start,h.start)<0&&a.comparePoints(r[0].end,h.end)>0;)this.expandFolds(r),r=this.getFoldsInRangeList(h);if(o!=!1?this.removeFolds(r):this.expandFolds(r),u.length)return u},this.isRowFolded=function(i,o){return!!this.getFoldLine(i,o)},this.getRowFoldEnd=function(i,o){var h=this.getFoldLine(i,o);return h?h.end.row:i},this.getRowFoldStart=function(i,o){var h=this.getFoldLine(i,o);return h?h.start.row:i},this.getFoldDisplayLine=function(i,o,h,r,u){r==null&&(r=i.start.row),u==null&&(u=0),o==null&&(o=i.end.row),h==null&&(h=this.getLine(o).length);var f=this.doc,g="";return i.walk(function(v,A,E,w){if(!(A<r)){if(A==r){if(E<u)return;w=Math.max(u,w)}v!=null?g+=v:g+=f.getLine(A).substring(w,E)}},o,h),g},this.getDisplayLine=function(i,o,h,r){var u=this.getFoldLine(i);if(u)return this.getFoldDisplayLine(u,i,o,h,r);var f;return f=this.doc.getLine(i),f.substring(r||0,o||f.length)},this.$cloneFoldData=function(){var i=[];return i=this.$foldData.map(function(o){var h=o.folds.map(function(r){return r.clone()});return new p(i,h)}),i},this.toggleFold=function(i){var o=this.selection,h=o.getRange(),r,u;if(h.isEmpty()){var f=h.start;if(r=this.getFoldAt(f.row,f.column),r){this.expandFold(r);return}else if(i){var g=this.getFoldLine(f.row);g&&this.expandFolds(g.folds);return}else(u=this.findMatchingBracket(f))?h.comparePoint(u)==1?h.end=u:(h.start=u,h.start.column++,h.end.column--):(u=this.findMatchingBracket({row:f.row,column:f.column+1}))?(h.comparePoint(u)==1?h.end=u:h.start=u,h.start.column++):h=this.getCommentFoldRange(f.row,f.column)||h}else{var v=this.getFoldsInRange(h);if(i&&v.length){this.expandFolds(v);return}else v.length==1&&(r=v[0])}if(r||(r=this.getFoldAt(h.start.row,h.start.column)),r&&r.range.toString()==h.toString()){this.expandFold(r);return}var A="...";if(!h.isMultiLine()){if(A=this.getTextRange(h),A.length<4)return;A=A.trim().substring(0,2)+".."}this.addFold(A,h)},this.getCommentFoldRange=function(i,o,h){var r=new s(this,i,o),u=r.getCurrentToken(),f=u&&u.type;if(u&&/^comment|string/.test(f)){f=f.match(/comment|string/)[0],f=="comment"&&(f+="|doc-start|\\.doc");var g=new RegExp(f),v=new a;if(h!=1){do u=r.stepBackward();while(u&&g.test(u.type));u=r.stepForward()}v.start.row=r.getCurrentTokenRow(),v.start.column=r.getCurrentTokenColumn()+u.value.length,r=new s(this,i,o);var A=this.getState(r.$row);if(h!=-1){var E=-1;do if(u=r.stepForward(),E==-1){var w=this.getState(r.$row);A.toString()!==w.toString()&&(E=r.$row)}else if(r.$row>E)break;while(u&&g.test(u.type));u=r.stepBackward()}else u=r.getCurrentToken();return v.end.row=r.getCurrentTokenRow(),v.end.column=r.getCurrentTokenColumn(),v.start.row==v.end.row&&v.start.column>v.end.column?void 0:v}},this.foldAll=function(i,o,h,r){h==null&&(h=1e5);var u=this.foldWidgets;if(u){o=o||this.getLength(),i=i||0;for(var f=i;f<o;f++)if(u[f]==null&&(u[f]=this.getFoldWidget(f)),u[f]=="start"&&!(r&&!r(f))){var g=this.getFoldWidgetRange(f);g&&g.isMultiLine()&&g.end.row<=o&&g.start.row>=i&&(f=g.end.row,g.collapseChildren=h,this.addFold("...",g))}}},this.foldToLevel=function(i){for(this.foldAll();i-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var i=this;this.foldAll(null,null,null,function(o){for(var h=i.getTokens(o),r=0;r<h.length;r++){var u=h[r];if(!(u.type=="text"&&/^\s+$/.test(u.value)))return!!/comment/.test(u.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(i){if(!this.$foldStyles[i])throw new Error("invalid fold style: "+i+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=i){this.$foldStyle=i,i=="manual"&&this.unfold();var o=this.$foldMode;this.$setFolding(null),this.$setFolding(o)}},this.$setFolding=function(i){if(this.$foldMode!=i){if(this.$foldMode=i,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!i||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=i.getFoldWidget.bind(i,this,this.$foldStyle),this.getFoldWidgetRange=i.getFoldWidgetRange.bind(i,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(i,o){var h=this.foldWidgets;if(!h||o&&h[i])return{};for(var r=i-1,u;r>=0;){var f=h[r];if(f==null&&(f=h[r]=this.getFoldWidget(r)),f=="start"){var g=this.getFoldWidgetRange(r);if(u||(u=g),g&&g.end.row>=i)break}r--}return{range:r!==-1&&g,firstRange:u}},this.onFoldWidgetClick=function(i,o){o instanceof c&&(o=o.domEvent);var h={children:o.shiftKey,all:o.ctrlKey||o.metaKey,siblings:o.altKey},r=this.$toggleFoldWidget(i,h);if(!r){var u=o.target||o.srcElement;u&&/ace_fold-widget/.test(u.className)&&(u.className+=" ace_invalid")}},this.$toggleFoldWidget=function(i,o){if(this.getFoldWidget){var h=this.getFoldWidget(i),r=this.getLine(i),u=h==="end"?-1:1,f=this.getFoldAt(i,u===-1?0:r.length,u);if(f)return o.children||o.all?this.removeFold(f):this.expandFold(f),f;var g=this.getFoldWidgetRange(i,!0);if(g&&!g.isMultiLine()&&(f=this.getFoldAt(g.start.row,g.start.column,1),f&&g.isEqual(f.range)))return this.removeFold(f),f;if(o.siblings){var v=this.getParentFoldRangeData(i);if(v.range)var A=v.range.start.row+1,E=v.range.end.row;this.foldAll(A,E,o.all?1e4:0)}else o.children?(E=g?g.end.row:this.getLength(),this.foldAll(i+1,E,o.all?1e4:0)):g&&(o.all&&(g.collapseChildren=1e4),this.addFold("...",g));return g}},this.toggleFoldWidget=function(i){var o=this.selection.getCursor().row;o=this.getRowFoldStart(o);var h=this.$toggleFoldWidget(o,{});if(!h){var r=this.getParentFoldRangeData(o,!0);if(h=r.range||r.firstRange,h){o=h.start.row;var u=this.getFoldAt(o,this.getLine(o).length,1);u?this.removeFold(u):this.addFold("...",h)}}},this.updateFoldWidgets=function(i){var o=i.start.row,h=i.end.row-o;if(h===0)this.foldWidgets[o]=null;else if(i.action=="remove")this.foldWidgets.splice(o,h+1,null);else{var r=Array(h+1);r.unshift(o,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(i){var o=i.data;o.first!=o.last&&this.foldWidgets.length>o.first&&this.foldWidgets.splice(o.first,this.foldWidgets.length)}}l.Folding=e}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(n,l,y){var a=n("../token_iterator").TokenIterator,p=n("../range").Range;function d(){this.findMatchingBracket=function(s,c){if(s.column==0)return null;var e=c||this.getLine(s.row).charAt(s.column-1);if(e=="")return null;var i=e.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],s):this.$findOpeningBracket(i[2],s):null},this.getBracketRange=function(s){var c=this.getLine(s.row),e=!0,i,o=c.charAt(s.column-1),h=o&&o.match(/([\(\[\{])|([\)\]\}])/);if(h||(o=c.charAt(s.column),s={row:s.row,column:s.column+1},h=o&&o.match(/([\(\[\{])|([\)\]\}])/),e=!1),!h)return null;if(h[1]){var r=this.$findClosingBracket(h[1],s);if(!r)return null;i=p.fromPoints(s,r),e||(i.end.column++,i.start.column--),i.cursor=i.end}else{var r=this.$findOpeningBracket(h[2],s);if(!r)return null;i=p.fromPoints(r,s),e||(i.start.column++,i.end.column--),i.cursor=i.start}return i},this.getMatchingBracketRanges=function(s,c){var e=this.getLine(s.row),i=/([\(\[\{])|([\)\]\}])/,o=!c&&e.charAt(s.column-1),h=o&&o.match(i);if(h||(o=(c===void 0||c)&&e.charAt(s.column),s={row:s.row,column:s.column+1},h=o&&o.match(i)),!h)return null;var r=new p(s.row,s.column-1,s.row,s.column),u=h[1]?this.$findClosingBracket(h[1],s):this.$findOpeningBracket(h[2],s);if(!u)return[r];var f=new p(u.row,u.column,u.row,u.column+1);return[r,f]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(s,c,e){var i=this.$brackets[s],o=1,h=new a(this,c.row,c.column),r=h.getCurrentToken();if(r||(r=h.stepForward()),!!r){e||(e=new RegExp("(\\.?"+r.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var u=c.column-h.getCurrentTokenColumn()-2,f=r.value;;){for(;u>=0;){var g=f.charAt(u);if(g==i){if(o-=1,o==0)return{row:h.getCurrentTokenRow(),column:u+h.getCurrentTokenColumn()}}else g==s&&(o+=1);u-=1}do r=h.stepBackward();while(r&&!e.test(r.type));if(r==null)break;f=r.value,u=f.length-1}return null}},this.$findClosingBracket=function(s,c,e){var i=this.$brackets[s],o=1,h=new a(this,c.row,c.column),r=h.getCurrentToken();if(r||(r=h.stepForward()),!!r){e||(e=new RegExp("(\\.?"+r.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var u=c.column-h.getCurrentTokenColumn();;){for(var f=r.value,g=f.length;u<g;){var v=f.charAt(u);if(v==i){if(o-=1,o==0)return{row:h.getCurrentTokenRow(),column:u+h.getCurrentTokenColumn()}}else v==s&&(o+=1);u+=1}do r=h.stepForward();while(r&&!e.test(r.type));if(r==null)break;u=0}return null}},this.getMatchingTags=function(s){var c=new a(this,s.row,s.column),e=this.$findTagName(c);if(e){var i=c.stepBackward();return i.value==="<"?this.$findClosingTag(c,e):this.$findOpeningTag(c,e)}},this.$findTagName=function(s){var c=s.getCurrentToken(),e=!1,i=!1;if(c&&c.type.indexOf("tag-name")===-1)do i?c=s.stepBackward():c=s.stepForward(),c&&(c.value==="/>"?i=!0:c.type.indexOf("tag-name")!==-1&&(e=!0));while(c&&!e);return c},this.$findClosingTag=function(s,c){var e,i=c.value,o=c.value,h=0,r=new p(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);c=s.stepForward();var u=new p(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+c.value.length),f=!1;do{if(e=c,e.type.indexOf("tag-close")!==-1&&!f){var g=new p(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);f=!0}if(c=s.stepForward(),c){if(c.value===">"&&!f){var g=new p(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);f=!0}if(c.type.indexOf("tag-name")!==-1){if(i=c.value,o===i){if(e.value==="<")h++;else if(e.value==="</"&&(h--,h<0)){s.stepBackward();var v=new p(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+2);c=s.stepForward();var A=new p(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+c.value.length);if(c.type.indexOf("tag-close")===-1&&(c=s.stepForward()),c&&c.value===">")var E=new p(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);else return}}}else if(o===i&&c.value==="/>"&&(h--,h<0))var v=new p(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+2),A=v,E=A,g=new p(u.end.row,u.end.column,u.end.row,u.end.column+1)}}while(c&&h>=0);if(r&&g&&v&&E&&u&&A)return{openTag:new p(r.start.row,r.start.column,g.end.row,g.end.column),closeTag:new p(v.start.row,v.start.column,E.end.row,E.end.column),openTagName:u,closeTagName:A}},this.$findOpeningTag=function(s,c){var e=s.getCurrentToken(),i=c.value,o=0,h=s.getCurrentTokenRow(),r=s.getCurrentTokenColumn(),u=r+2,f=new p(h,r,h,u);s.stepForward();var g=new p(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+c.value.length);if(c.type.indexOf("tag-close")===-1&&(c=s.stepForward()),!(!c||c.value!==">")){var v=new p(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);s.stepBackward(),s.stepBackward();do if(c=e,h=s.getCurrentTokenRow(),r=s.getCurrentTokenColumn(),u=r+c.value.length,e=s.stepBackward(),c){if(c.type.indexOf("tag-name")!==-1){if(i===c.value)if(e.value==="<"){if(o++,o>0){var A=new p(h,r,h,u),E=new p(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);do c=s.stepForward();while(c&&c.value!==">");var w=new p(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1)}}else e.value==="</"&&o--}else if(c.value==="/>"){for(var m=0,S=e;S;){if(S.type.indexOf("tag-name")!==-1&&S.value===i){o--;break}else if(S.value==="<")break;S=s.stepBackward(),m++}for(var k=0;k<m;k++)s.stepForward()}}while(e&&o<=0);if(E&&w&&f&&v&&A&&g)return{openTag:new p(E.start.row,E.start.column,w.end.row,w.end.column),closeTag:new p(f.start.row,f.start.column,v.end.row,v.end.column),openTagName:A,closeTagName:g}}}}l.BracketMatch=d}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/line_widgets","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(n,l,y){var a=n("./lib/oop"),p=n("./lib/lang"),d=n("./bidihandler").BidiHandler,s=n("./config"),c=n("./lib/event_emitter").EventEmitter,e=n("./selection").Selection,i=n("./mode/text").Mode,o=n("./range").Range,h=n("./line_widgets").LineWidgets,r=n("./document").Document,u=n("./background_tokenizer").BackgroundTokenizer,f=n("./search_highlight").SearchHighlight,g=n("./undomanager").UndoManager,v=(function(){function x($,C){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$editor=null,this.prevOp={},this.$foldData=[],this.id="session"+ ++x.$uid,this.$foldData.toString=function(){return this.join(`
|
|
211
|
-
`)},this.$gutterCustomWidgets={},this.bgTokenizer=new u(new i().getTokenizer(),this);var b=this;this.bgTokenizer.on("update",function(T){b._signal("tokenizerUpdate",T)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof $!="object"||!$.getLine)&&($=new r($)),this.setDocument($),this.selection=new e(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new d(this),s.resetOptions(this),this.setMode(C),s._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return x.prototype.$initOperationListeners=function(){var $=this;this.curOp=null,this.on("change",function(){$.curOp||($.startOperation(),$.curOp.selectionBefore=$.$lastSel),$.curOp.docChanged=!0},!0),this.on("changeSelection",function(){$.curOp||($.startOperation(),$.curOp.selectionBefore=$.$lastSel),$.curOp.selectionChanged=!0},!0),this.$operationResetTimer=p.delayedCall(this.endOperation.bind(this,!0))},x.prototype.startOperation=function($){if(this.curOp){if(!$||this.curOp.command)return;this.prevOp=this.curOp}$||($={}),this.$operationResetTimer.schedule(),this.curOp={command:$.command||{},args:$.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",$)},x.prototype.endOperation=function($){if(this.curOp){if($&&$.returnValue===!1){this.curOp=null,this._signal("endOperation",$);return}if($==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var C=this.selection.toJSON();this.curOp.selectionAfter=C,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(C),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",$)}},x.prototype.setDocument=function($){this.doc&&this.doc.off("change",this.$onChange),this.doc=$,$.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},x.prototype.getDocument=function(){return this.doc},Object.defineProperty(x.prototype,"widgetManager",{get:function(){var $=new h(this);return this.widgetManager=$,this.$editor&&$.attach(this.$editor),$},set:function($){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:$})},enumerable:!1,configurable:!0}),x.prototype.$resetRowCache=function($){if(!$){this.$docRowCache=[],this.$screenRowCache=[];return}var C=this.$docRowCache.length,b=this.$getRowCacheIndex(this.$docRowCache,$)+1;C>b&&(this.$docRowCache.splice(b,C),this.$screenRowCache.splice(b,C))},x.prototype.$getRowCacheIndex=function($,C){for(var b=0,T=$.length-1;b<=T;){var I=b+T>>1,R=$[I];if(C>R)b=I+1;else if(C<R)T=I-1;else return I}return b-1},x.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},x.prototype.onChangeFold=function($){var C=$.data;this.$resetRowCache(C.start.row)},x.prototype.onChange=function($){this.$modified=!0,this.$bidiHandler.onChange($),this.$resetRowCache($.start.row);var C=this.$updateInternalDataOnChange($);!this.$fromUndo&&this.$undoManager&&(C&&C.length&&(this.$undoManager.add({action:"removeFolds",folds:C},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add($,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange($),this._signal("change",$)},x.prototype.onSelectionChange=function(){this._signal("changeSelection")},x.prototype.setValue=function($){this.doc.setValue($),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},x.fromJSON=function($){typeof $=="string"&&($=JSON.parse($));var C=new g;C.$undoStack=$.history.undo,C.$redoStack=$.history.redo,C.mark=$.history.mark,C.$rev=$.history.rev;var b=new x($.value);return $.folds.forEach(function(T){b.addFold("...",o.fromPoints(T.start,T.end))}),b.setAnnotations($.annotations),b.setBreakpoints($.breakpoints),b.setMode($.mode),b.setScrollLeft($.scrollLeft),b.setScrollTop($.scrollTop),b.setUndoManager(C),b.selection.fromJSON($.selection),b},x.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function($){return $.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},x.prototype.toString=function(){return this.doc.getValue()},x.prototype.getSelection=function(){return this.selection},x.prototype.getState=function($){return this.bgTokenizer.getState($)},x.prototype.getTokens=function($){return this.bgTokenizer.getTokens($)},x.prototype.getTokenAt=function($,C){var b=this.bgTokenizer.getTokens($),T,I=0;if(C==null){var R=b.length-1;I=this.getLine($).length}else for(var R=0;R<b.length&&(I+=b[R].value.length,!(I>=C));R++);return T=b[R],T?(T.index=R,T.start=I-T.value.length,T):null},x.prototype.setUndoManager=function($){if(this.$undoManager=$,this.$informUndoManager&&this.$informUndoManager.cancel(),$){var C=this;$.addSession(this),this.$syncInformUndoManager=function(){C.$informUndoManager.cancel(),C.mergeUndoDeltas=!1},this.$informUndoManager=p.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},x.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},x.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},x.prototype.getTabString=function(){return this.getUseSoftTabs()?p.stringRepeat(" ",this.getTabSize()):" "},x.prototype.setUseSoftTabs=function($){this.setOption("useSoftTabs",$)},x.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},x.prototype.setTabSize=function($){this.setOption("tabSize",$)},x.prototype.getTabSize=function(){return this.$tabSize},x.prototype.isTabStop=function($){return this.$useSoftTabs&&$.column%this.$tabSize===0},x.prototype.setNavigateWithinSoftTabs=function($){this.setOption("navigateWithinSoftTabs",$)},x.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},x.prototype.setOverwrite=function($){this.setOption("overwrite",$)},x.prototype.getOverwrite=function(){return this.$overwrite},x.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},x.prototype.addGutterDecoration=function($,C){this.$decorations[$]||(this.$decorations[$]=""),this.$decorations[$]+=" "+C,this._signal("changeBreakpoint",{})},x.prototype.removeGutterCustomWidget=function($){this.$editor&&this.$editor.renderer.$gutterLayer.$removeCustomWidget($)},x.prototype.addGutterCustomWidget=function($,C){this.$editor&&this.$editor.renderer.$gutterLayer.$addCustomWidget($,C)},x.prototype.removeGutterDecoration=function($,C){this.$decorations[$]=(this.$decorations[$]||"").replace(" "+C,""),this._signal("changeBreakpoint",{})},x.prototype.getBreakpoints=function(){return this.$breakpoints},x.prototype.setBreakpoints=function($){this.$breakpoints=[];for(var C=0;C<$.length;C++)this.$breakpoints[$[C]]="ace_breakpoint";this._signal("changeBreakpoint",{})},x.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},x.prototype.setBreakpoint=function($,C){C===void 0&&(C="ace_breakpoint"),C?this.$breakpoints[$]=C:delete this.$breakpoints[$],this._signal("changeBreakpoint",{})},x.prototype.clearBreakpoint=function($){delete this.$breakpoints[$],this._signal("changeBreakpoint",{})},x.prototype.addMarker=function($,C,b,T){var I=this.$markerId++,R={range:$,type:b||"line",renderer:typeof b=="function"?b:null,clazz:C,inFront:!!T,id:I};return T?(this.$frontMarkers[I]=R,this._signal("changeFrontMarker")):(this.$backMarkers[I]=R,this._signal("changeBackMarker")),I},x.prototype.addDynamicMarker=function($,C){if($.update){var b=this.$markerId++;return $.id=b,$.inFront=!!C,C?(this.$frontMarkers[b]=$,this._signal("changeFrontMarker")):(this.$backMarkers[b]=$,this._signal("changeBackMarker")),$}},x.prototype.removeMarker=function($){var C=this.$frontMarkers[$]||this.$backMarkers[$];if(C){var b=C.inFront?this.$frontMarkers:this.$backMarkers;delete b[$],this._signal(C.inFront?"changeFrontMarker":"changeBackMarker")}},x.prototype.getMarkers=function($){return $?this.$frontMarkers:this.$backMarkers},x.prototype.highlight=function($){if(!this.$searchHighlight){var C=new f(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(C)}this.$searchHighlight.setRegexp($)},x.prototype.highlightLines=function($,C,b,T){typeof C!="number"&&(b=C,C=$),b||(b="ace_step");var I=new o($,0,C,1/0);return I.id=this.addMarker(I,b,"fullLine",T),I},x.prototype.setAnnotations=function($){this.$annotations=$,this._signal("changeAnnotation",{})},x.prototype.getAnnotations=function(){return this.$annotations||[]},x.prototype.clearAnnotations=function(){this.setAnnotations([])},x.prototype.$detectNewLine=function($){var C=$.match(/^.*?(\r?\n)/m);C?this.$autoNewLine=C[1]:this.$autoNewLine=`
|
|
212
|
-
`},x.prototype.getWordRange=function($,C){var b=this.getLine($),T=!1;if(C>0&&(T=!!b.charAt(C-1).match(this.tokenRe)),T||(T=!!b.charAt(C).match(this.tokenRe)),T)var I=this.tokenRe;else if(/^\s+$/.test(b.slice(C-1,C+1)))var I=/\s/;else var I=this.nonTokenRe;var R=C;if(R>0){do R--;while(R>=0&&b.charAt(R).match(I));R++}for(var N=C;N<b.length&&b.charAt(N).match(I);)N++;return new o($,R,$,N)},x.prototype.getAWordRange=function($,C){for(var b=this.getWordRange($,C),T=this.getLine(b.end.row);T.charAt(b.end.column).match(/[ \t]/);)b.end.column+=1;return b},x.prototype.setNewLineMode=function($){this.doc.setNewLineMode($)},x.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},x.prototype.setUseWorker=function($){this.setOption("useWorker",$)},x.prototype.getUseWorker=function(){return this.$useWorker},x.prototype.onReloadTokenizer=function($){var C=$.data;this.bgTokenizer.start(C.first),this._signal("tokenizerUpdate",$)},x.prototype.setMode=function($,C){if($&&typeof $=="object"){if($.getTokenizer)return this.$onChangeMode($);var b=$,T=b.path}else T=$||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new i),this.$modes[T]&&!b){this.$onChangeMode(this.$modes[T]),C&&C();return}this.$modeId=T,s.loadModule(["mode",T],function(I){if(!this.destroyed){if(this.$modeId!==T)return C&&C();this.$modes[T]&&!b?this.$onChangeMode(this.$modes[T]):I&&I.Mode&&(I=new I.Mode(b),b||(this.$modes[T]=I,I.$id=T),this.$onChangeMode(I)),C&&C()}}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},x.prototype.$onChangeMode=function($,C){if(C||(this.$modeId=$.$id),this.$mode!==$){var b=this.$mode;this.$mode=$,this.$stopWorker(),this.$useWorker&&this.$startWorker();var T=$.getTokenizer();if(T.on!==void 0){var I=this.onReloadTokenizer.bind(this);T.on("update",I)}this.bgTokenizer.setTokenizer(T),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=$.tokenRe,this.nonTokenRe=$.nonTokenRe,C||($.attachToSession&&$.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding($.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:b,mode:$}))}},x.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},x.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch($){s.warn("Could not load worker",$),this.$worker=null}},x.prototype.getMode=function(){return this.$mode},x.prototype.setScrollTop=function($){this.$scrollTop===$||isNaN($)||(this.$scrollTop=$,this._signal("changeScrollTop",$))},x.prototype.getScrollTop=function(){return this.$scrollTop},x.prototype.setScrollLeft=function($){this.$scrollLeft===$||isNaN($)||(this.$scrollLeft=$,this._signal("changeScrollLeft",$))},x.prototype.getScrollLeft=function(){return this.$scrollLeft},x.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},x.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var $=0;return this.lineWidgets.forEach(function(C){C&&C.screenWidth>$&&($=C.screenWidth)}),this.lineWidgetWidth=$},x.prototype.$computeWidth=function($){if(this.$modified||$){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var C=this.doc.getAllLines(),b=this.$rowLengthCache,T=0,I=0,R=this.$foldData[I],N=R?R.start.row:1/0,P=C.length,B=0;B<P;B++){if(B>N){if(B=R.end.row+1,B>=P)break;R=this.$foldData[I++],N=R?R.start.row:1/0}b[B]==null&&(b[B]=this.$getStringScreenWidth(C[B])[0]),b[B]>T&&(T=b[B])}this.screenWidth=T}},x.prototype.getLine=function($){return this.doc.getLine($)},x.prototype.getLines=function($,C){return this.doc.getLines($,C)},x.prototype.getLength=function(){return this.doc.getLength()},x.prototype.getTextRange=function($){return this.doc.getTextRange($||this.selection.getRange())},x.prototype.insert=function($,C){return this.doc.insert($,C)},x.prototype.remove=function($){return this.doc.remove($)},x.prototype.removeFullLines=function($,C){return this.doc.removeFullLines($,C)},x.prototype.undoChanges=function($,C){if($.length){this.$fromUndo=!0;for(var b=$.length-1;b!=-1;b--){var T=$[b];T.action=="insert"||T.action=="remove"?this.doc.revertDelta(T):T.folds&&this.addFolds(T.folds)}!C&&this.$undoSelect&&($.selectionBefore?this.selection.fromJSON($.selectionBefore):this.selection.setRange(this.$getUndoSelection($,!0))),this.$fromUndo=!1}},x.prototype.redoChanges=function($,C){if($.length){this.$fromUndo=!0;for(var b=0;b<$.length;b++){var T=$[b];(T.action=="insert"||T.action=="remove")&&this.doc.$safeApplyDelta(T)}!C&&this.$undoSelect&&($.selectionAfter?this.selection.fromJSON($.selectionAfter):this.selection.setRange(this.$getUndoSelection($,!1))),this.$fromUndo=!1}},x.prototype.setUndoSelect=function($){this.$undoSelect=$},x.prototype.$getUndoSelection=function($,C){function b(P){return C?P.action!=="insert":P.action==="insert"}for(var T,I,R=0;R<$.length;R++){var N=$[R];if(N.start){if(!T){b(N)?T=o.fromPoints(N.start,N.end):T=o.fromPoints(N.start,N.start);continue}b(N)?(I=N.start,T.compare(I.row,I.column)==-1&&T.setStart(I),I=N.end,T.compare(I.row,I.column)==1&&T.setEnd(I)):(I=N.start,T.compare(I.row,I.column)==-1&&(T=o.fromPoints(N.start,N.start)))}}return T},x.prototype.replace=function($,C){return this.doc.replace($,C)},x.prototype.moveText=function($,C,b){var T=this.getTextRange($),I=this.getFoldsInRange($),R=o.fromPoints(C,C);if(!b){this.remove($);var N=$.start.row-$.end.row,P=N?-$.end.column:$.start.column-$.end.column;P&&(R.start.row==$.end.row&&R.start.column>$.end.column&&(R.start.column+=P),R.end.row==$.end.row&&R.end.column>$.end.column&&(R.end.column+=P)),N&&R.start.row>=$.end.row&&(R.start.row+=N,R.end.row+=N)}if(R.end=this.insert(R.start,T),I.length){var B=$.start,V=R.start,N=V.row-B.row,P=V.column-B.column;this.addFolds(I.map(function(U){return U=U.clone(),U.start.row==B.row&&(U.start.column+=P),U.end.row==B.row&&(U.end.column+=P),U.start.row+=N,U.end.row+=N,U}))}return R},x.prototype.indentRows=function($,C,b){b=b.replace(/\t/g,this.getTabString());for(var T=$;T<=C;T++)this.doc.insertInLine({row:T,column:0},b)},x.prototype.outdentRows=function($){for(var C=$.collapseRows(),b=new o(0,0,0,0),T=this.getTabSize(),I=C.start.row;I<=C.end.row;++I){var R=this.getLine(I);b.start.row=I,b.end.row=I;for(var N=0;N<T&&R.charAt(N)==" ";++N);N<T&&R.charAt(N)==" "?(b.start.column=N,b.end.column=N+1):(b.start.column=0,b.end.column=N),this.remove(b)}},x.prototype.$moveLines=function($,C,b){if($=this.getRowFoldStart($),C=this.getRowFoldEnd(C),b<0){var T=this.getRowFoldStart($+b);if(T<0)return 0;var I=T-$}else if(b>0){var T=this.getRowFoldEnd(C+b);if(T>this.doc.getLength()-1)return 0;var I=T-C}else{$=this.$clipRowToDocument($),C=this.$clipRowToDocument(C);var I=C-$+1}var R=new o($,0,C,Number.MAX_VALUE),N=this.getFoldsInRange(R).map(function(B){return B=B.clone(),B.start.row+=I,B.end.row+=I,B}),P=b==0?this.doc.getLines($,C):this.doc.removeFullLines($,C);return this.doc.insertFullLines($+I,P),N.length&&this.addFolds(N),I},x.prototype.moveLinesUp=function($,C){return this.$moveLines($,C,-1)},x.prototype.moveLinesDown=function($,C){return this.$moveLines($,C,1)},x.prototype.duplicateLines=function($,C){return this.$moveLines($,C,0)},x.prototype.$clipRowToDocument=function($){return Math.max(0,Math.min($,this.doc.getLength()-1))},x.prototype.$clipColumnToRow=function($,C){return C<0?0:Math.min(this.doc.getLine($).length,C)},x.prototype.$clipPositionToDocument=function($,C){if(C=Math.max(0,C),$<0)$=0,C=0;else{var b=this.doc.getLength();$>=b?($=b-1,C=this.doc.getLine(b-1).length):C=Math.min(this.doc.getLine($).length,C)}return{row:$,column:C}},x.prototype.$clipRangeToDocument=function($){$.start.row<0?($.start.row=0,$.start.column=0):$.start.column=this.$clipColumnToRow($.start.row,$.start.column);var C=this.doc.getLength()-1;return $.end.row>C?($.end.row=C,$.end.column=this.doc.getLine(C).length):$.end.column=this.$clipColumnToRow($.end.row,$.end.column),$},x.prototype.setUseWrapMode=function($){if($!=this.$useWrapMode){if(this.$useWrapMode=$,this.$modified=!0,this.$resetRowCache(0),$){var C=this.getLength();this.$wrapData=Array(C),this.$updateWrapData(0,C-1)}this._signal("changeWrapMode")}},x.prototype.getUseWrapMode=function(){return this.$useWrapMode},x.prototype.setWrapLimitRange=function($,C){(this.$wrapLimitRange.min!==$||this.$wrapLimitRange.max!==C)&&(this.$wrapLimitRange={min:$,max:C},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},x.prototype.adjustWrapLimit=function($,C){var b=this.$wrapLimitRange;b.max<0&&(b={min:C,max:C});var T=this.$constrainWrapLimit($,b.min,b.max);return T!=this.$wrapLimit&&T>1?(this.$wrapLimit=T,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},x.prototype.$constrainWrapLimit=function($,C,b){return C&&($=Math.max(C,$)),b&&($=Math.min(b,$)),$},x.prototype.getWrapLimit=function(){return this.$wrapLimit},x.prototype.setWrapLimit=function($){this.setWrapLimitRange($,$)},x.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},x.prototype.$updateInternalDataOnChange=function($){var C=this.$useWrapMode,b=$.action,T=$.start,I=$.end,R=T.row,N=I.row,P=N-R,B=null;if(this.$updating=!0,P!=0)if(b==="remove"){this[C?"$wrapData":"$rowLengthCache"].splice(R,P);var V=this.$foldData;B=this.getFoldsInRange($),this.removeFolds(B);var W=this.getFoldLine(I.row),z=0;if(W){W.addRemoveChars(I.row,I.column,T.column-I.column),W.shiftRow(-P);var U=this.getFoldLine(R);U&&U!==W&&(U.merge(W),W=U),z=V.indexOf(W)+1}for(z;z<V.length;z++){var W=V[z];W.start.row>=I.row&&W.shiftRow(-P)}N=R}else{var G=Array(P);G.unshift(R,0);var Y=C?this.$wrapData:this.$rowLengthCache;Y.splice.apply(Y,G);var V=this.$foldData,W=this.getFoldLine(R),z=0;if(W){var Q=W.range.compareInside(T.row,T.column);Q==0?(W=W.split(T.row,T.column),W&&(W.shiftRow(P),W.addRemoveChars(N,0,I.column-T.column))):Q==-1&&(W.addRemoveChars(R,0,I.column-T.column),W.shiftRow(P)),z=V.indexOf(W)+1}for(z;z<V.length;z++){var W=V[z];W.start.row>=R&&W.shiftRow(P)}}else{P=Math.abs($.start.column-$.end.column),b==="remove"&&(B=this.getFoldsInRange($),this.removeFolds(B),P=-P);var W=this.getFoldLine(R);W&&W.addRemoveChars(R,T.column,P)}return C&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,C?this.$updateWrapData(R,N):this.$updateRowLengthCache(R,N),B},x.prototype.$updateRowLengthCache=function($,C){this.$rowLengthCache[$]=null,this.$rowLengthCache[C]=null},x.prototype.$updateWrapData=function($,C){var b=this.doc.getAllLines(),T=this.getTabSize(),I=this.$wrapData,R=this.$wrapLimit,N,P,B=$;for(C=Math.min(C,b.length-1);B<=C;)P=this.getFoldLine(B,P),P?(N=[],P.walk(function(V,W,z,U){var G;if(V!=null){G=this.$getDisplayTokens(V,N.length),G[0]=w;for(var Y=1;Y<G.length;Y++)G[Y]=m}else G=this.$getDisplayTokens(b[W].substring(U,z),N.length);N=N.concat(G)}.bind(this),P.end.row,b[P.end.row].length+1),I[P.start.row]=this.$computeWrapSplits(N,R,T),B=P.end.row+1):(N=this.$getDisplayTokens(b[B]),I[B]=this.$computeWrapSplits(N,R,T),B++)},x.prototype.$computeWrapSplits=function($,C,b){if($.length==0)return[];var T=[],I=$.length,R=0,N=0,P=this.$wrapAsCode,B=this.$indentedSoftWrap,V=C<=Math.max(2*b,8)||B===!1?0:Math.floor(C/2);function W(){var Q=0;if(V===0)return Q;if(B)for(var q=0;q<$.length;q++){var te=$[q];if(te==k)Q+=1;else if(te==D)Q+=b;else{if(te==_)continue;break}}return P&&B!==!1&&(Q+=b),Math.min(Q,V)}function z(Q){for(var q=Q-R,te=R;te<Q;te++){var re=$[te];(re===12||re===2)&&(q-=1)}T.length||(U=W(),T.indent=U),N+=q,T.push(N),R=Q}for(var U=0;I-R>C-U;){var G=R+C-U;if($[G-1]>=k&&$[G]>=k){z(G);continue}if($[G]==w||$[G]==m){for(G;G!=R-1&&$[G]!=w;G--);if(G>R){z(G);continue}for(G=R+C,G;G<$.length&&$[G]==m;G++);if(G==$.length)break;z(G);continue}for(var Y=Math.max(G-(C-(C>>2)),R-1);G>Y&&$[G]<w;)G--;if(P){for(;G>Y&&$[G]<w;)G--;for(;G>Y&&$[G]==S;)G--}else for(;G>Y&&$[G]<k;)G--;if(G>Y){z(++G);continue}G=R+C,$[G]==E&&G--,z(G-U)}return T},x.prototype.$getDisplayTokens=function($,C){var b=[],T;C=C||0;for(var I=0;I<$.length;I++){var R=$.charCodeAt(I);if(R==9){T=this.getScreenTabSize(b.length+C),b.push(D);for(var N=1;N<T;N++)b.push(_)}else R==32?b.push(k):R>39&&R<48||R>57&&R<64?b.push(S):R>=4352&&F(R)?b.push(A,E):b.push(A)}return b},x.prototype.$getStringScreenWidth=function($,C,b){if(C==0)return[0,0];C==null&&(C=1/0),b=b||0;var T,I;for(I=0;I<$.length&&(T=$.charCodeAt(I),T==9?b+=this.getScreenTabSize(b):T>=4352&&F(T)?b+=2:b+=1,!(b>C));I++);return[b,I]},x.prototype.getRowLength=function($){var C=1;return this.lineWidgets&&(C+=this.lineWidgets[$]&&this.lineWidgets[$].rowCount||0),!this.$useWrapMode||!this.$wrapData[$]?C:this.$wrapData[$].length+C},x.prototype.getRowLineCount=function($){return!this.$useWrapMode||!this.$wrapData[$]?1:this.$wrapData[$].length+1},x.prototype.getRowWrapIndent=function($){if(this.$useWrapMode){var C=this.screenToDocumentPosition($,Number.MAX_VALUE),b=this.$wrapData[C.row];return b.length&&b[0]<C.column?b.indent:0}else return 0},x.prototype.getScreenLastRowColumn=function($){var C=this.screenToDocumentPosition($,Number.MAX_VALUE);return this.documentToScreenColumn(C.row,C.column)},x.prototype.getDocumentLastRowColumn=function($,C){var b=this.documentToScreenRow($,C);return this.getScreenLastRowColumn(b)},x.prototype.getDocumentLastRowColumnPosition=function($,C){var b=this.documentToScreenRow($,C);return this.screenToDocumentPosition(b,Number.MAX_VALUE/10)},x.prototype.getRowSplitData=function($){if(this.$useWrapMode)return this.$wrapData[$]},x.prototype.getScreenTabSize=function($){return this.$tabSize-($%this.$tabSize|0)},x.prototype.screenToDocumentRow=function($,C){return this.screenToDocumentPosition($,C).row},x.prototype.screenToDocumentColumn=function($,C){return this.screenToDocumentPosition($,C).column},x.prototype.screenToDocumentPosition=function($,C,b){if($<0)return{row:0,column:0};var T,I=0,R=0,N,P=0,B=0,V=this.$screenRowCache,W=this.$getRowCacheIndex(V,$),z=V.length;if(z&&W>=0)var P=V[W],I=this.$docRowCache[W],U=$>V[z-1];else var U=!z;for(var G=this.getLength()-1,Y=this.getNextFoldLine(I),Q=Y?Y.start.row:1/0;P<=$&&(B=this.getRowLength(I),!(P+B>$||I>=G));)P+=B,I++,I>Q&&(I=Y.end.row+1,Y=this.getNextFoldLine(I,Y),Q=Y?Y.start.row:1/0),U&&(this.$docRowCache.push(I),this.$screenRowCache.push(P));if(Y&&Y.start.row<=I)T=this.getFoldDisplayLine(Y),I=Y.start.row;else{if(P+B<=$||I>G)return{row:G,column:this.getLine(G).length};T=this.getLine(I),Y=null}var q=0,te=Math.floor($-P);if(this.$useWrapMode){var re=this.$wrapData[I];re&&(N=re[te],te>0&&re.length&&(q=re.indent,R=re[te-1]||re[re.length-1],T=T.substring(R)))}return b!==void 0&&this.$bidiHandler.isBidiRow(P+te,I,te)&&(C=this.$bidiHandler.offsetToCol(b)),R+=this.$getStringScreenWidth(T,C-q)[1],this.$useWrapMode&&R>=N&&(R=N-1),Y?Y.idxToPosition(R):{row:I,column:R}},x.prototype.documentToScreenPosition=function($,C){if(typeof C>"u")var b=this.$clipPositionToDocument($.row,$.column);else b=this.$clipPositionToDocument($,C);$=b.row,C=b.column;var T=0,I=null,R=null;R=this.getFoldAt($,C,1),R&&($=R.start.row,C=R.start.column);var N,P=0,B=this.$docRowCache,V=this.$getRowCacheIndex(B,$),W=B.length;if(W&&V>=0)var P=B[V],T=this.$screenRowCache[V],z=$>B[W-1];else var z=!W;for(var U=this.getNextFoldLine(P),G=U?U.start.row:1/0;P<$;){if(P>=G){if(N=U.end.row+1,N>$)break;U=this.getNextFoldLine(N,U),G=U?U.start.row:1/0}else N=P+1;T+=this.getRowLength(P),P=N,z&&(this.$docRowCache.push(P),this.$screenRowCache.push(T))}var Y="";U&&P>=G?(Y=this.getFoldDisplayLine(U,$,C),I=U.start.row):(Y=this.getLine($).substring(0,C),I=$);var Q=0;if(this.$useWrapMode){var q=this.$wrapData[I];if(q){for(var te=0;Y.length>=q[te];)T++,te++;Y=Y.substring(q[te-1]||0,Y.length),Q=te>0?q.indent:0}}return this.lineWidgets&&this.lineWidgets[P]&&this.lineWidgets[P].rowsAbove&&(T+=this.lineWidgets[P].rowsAbove),{row:T,column:Q+this.$getStringScreenWidth(Y)[0]}},x.prototype.documentToScreenColumn=function($,C){return this.documentToScreenPosition($,C).column},x.prototype.documentToScreenRow=function($,C){return this.documentToScreenPosition($,C).row},x.prototype.getScreenLength=function(){var $=0,C=null;if(this.$useWrapMode)for(var I=this.$wrapData.length,R=0,T=0,C=this.$foldData[T++],N=C?C.start.row:1/0;R<I;){var P=this.$wrapData[R];$+=P?P.length+1:1,R++,R>N&&(R=C.end.row+1,C=this.$foldData[T++],N=C?C.start.row:1/0)}else{$=this.getLength();for(var b=this.$foldData,T=0;T<b.length;T++)C=b[T],$-=C.end.row-C.start.row}return this.lineWidgets&&($+=this.$getWidgetScreenLength()),$},x.prototype.$setFontMetrics=function($){this.$enableVarChar&&(this.$getStringScreenWidth=function(C,b,T){if(b===0)return[0,0];b||(b=1/0),T=T||0;var I,R;for(R=0;R<C.length&&(I=C.charAt(R),I===" "?T+=this.getScreenTabSize(T):T+=$.getCharacterWidth(I),!(T>b));R++);return[T,R]})},x.prototype.getPrecedingCharacter=function(){var $=this.selection.getCursor();if($.column===0)return $.row===0?"":this.doc.getNewLineCharacter();var C=this.getLine($.row);return C[$.column-1]},x.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.endOperation(),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection&&(this.selection.off("changeCursor",this.$onSelectionChange),this.selection.off("changeSelection",this.$onSelectionChange)),this.selection.detach()},x})();v.$uid=0,v.prototype.$modes=s.$modes,v.prototype.getValue=v.prototype.toString,v.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},v.prototype.$overwrite=!1,v.prototype.$mode=null,v.prototype.$modeId=null,v.prototype.$scrollTop=0,v.prototype.$scrollLeft=0,v.prototype.$wrapLimit=80,v.prototype.$useWrapMode=!1,v.prototype.$wrapLimitRange={min:null,max:null},v.prototype.lineWidgets=null,v.prototype.isFullWidth=F,a.implement(v.prototype,c);var A=1,E=2,w=3,m=4,S=9,k=10,D=11,_=12;function F(x){return x<4352?!1:x>=4352&&x<=4447||x>=4515&&x<=4519||x>=4602&&x<=4607||x>=9001&&x<=9002||x>=11904&&x<=11929||x>=11931&&x<=12019||x>=12032&&x<=12245||x>=12272&&x<=12283||x>=12288&&x<=12350||x>=12353&&x<=12438||x>=12441&&x<=12543||x>=12549&&x<=12589||x>=12593&&x<=12686||x>=12688&&x<=12730||x>=12736&&x<=12771||x>=12784&&x<=12830||x>=12832&&x<=12871||x>=12880&&x<=13054||x>=13056&&x<=19903||x>=19968&&x<=42124||x>=42128&&x<=42182||x>=43360&&x<=43388||x>=44032&&x<=55203||x>=55216&&x<=55238||x>=55243&&x<=55291||x>=63744&&x<=64255||x>=65040&&x<=65049||x>=65072&&x<=65106||x>=65108&&x<=65126||x>=65128&&x<=65131||x>=65281&&x<=65376||x>=65504&&x<=65510}n("./edit_session/folding").Folding.call(v.prototype),n("./edit_session/bracket_match").BracketMatch.call(v.prototype),s.defineOptions(v.prototype,"session",{wrap:{set:function(x){if(!x||x=="off"?x=!1:x=="free"?x=!0:x=="printMargin"?x=-1:typeof x=="string"&&(x=parseInt(x,10)||!1),this.$wrap!=x)if(this.$wrap=x,!x)this.setUseWrapMode(!1);else{var $=typeof x=="number"?x:null;this.setWrapLimitRange($,$),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(x){x=x=="auto"?this.$mode.type!="text":x!="text",x!=this.$wrapAsCode&&(this.$wrapAsCode=x,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(x){this.$useWorker=x,this.$stopWorker(),x&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(x){x=parseInt(x),x>0&&this.$tabSize!==x&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=x,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(x){this.setFoldStyle(x)},handlesSet:!0},overwrite:{set:function(x){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(x){this.doc.setNewLineMode(x)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(x){this.setMode(x)},get:function(){return this.$modeId},handlesSet:!0}}),l.EditSession=v}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(n,l,y){var a=n("./lib/lang"),p=n("./lib/oop"),d=n("./range").Range,s=(function(){function o(){this.$options={}}return o.prototype.set=function(h){return p.mixin(this.$options,h),this},o.prototype.getOptions=function(){return a.copyObject(this.$options)},o.prototype.setOptions=function(h){this.$options=h},o.prototype.find=function(h){var r=this.$options,u=this.$matchIterator(h,r);if(!u)return!1;var f=null;return u.forEach(function(g,v,A,E){return f=new d(g,v,A,E),v==E&&r.start&&r.start.start&&r.skipCurrent!=!1&&f.isEqual(r.start)?(f=null,!1):!0}),f},o.prototype.findAll=function(h){var r=this.$options;if(!r.needle)return[];this.$assembleRegExp(r);var u=r.range,f=u?h.getLines(u.start.row,u.end.row):h.doc.getAllLines(),g=[],v=r.re;if(r.$isMultiLine){var A=v.length,E=f.length-A,w;e:for(var m=v.offset||0;m<=E;m++){for(var S=0;S<A;S++)if(f[m+S].search(v[S])==-1)continue e;var k=f[m],D=f[m+A-1],_=k.length-k.match(v[0])[0].length,F=D.match(v[A-1])[0].length;w&&w.end.row===m&&w.end.column>_||(g.push(w=new d(m,_,m+A-1,F)),A>2&&(m=m+A-2))}}else for(var x,$=0;$<f.length;$++)if(this.$isMultilineSearch(r)){var C=f.length-1;if(x=this.$multiLineForward(h,v,$,C),x){var b=x.endRow<=C?x.endRow-1:C;b>$&&($=b),g.push(new d(x.startRow,x.startCol,x.endRow,x.endCol))}}else{x=a.getMatchOffsets(f[$],v);for(var S=0;S<x.length;S++){var T=x[S];g.push(new d($,T.offset,$,T.offset+T.length))}}if(u){for(var I=u.start.column,R=u.end.column,$=0,S=g.length-1;$<S&&g[$].start.column<I&&g[$].start.row==0;)$++;for(var N=u.end.row-u.start.row;$<S&&g[S].end.column>R&&g[S].end.row==N;)S--;for(g=g.slice($,S+1),$=0,S=g.length;$<S;$++)g[$].start.row+=u.start.row,g[$].end.row+=u.start.row}return g},o.prototype.parseReplaceString=function(h){for(var r={DollarSign:36,Ampersand:38,Digit0:48,Digit1:49,Digit9:57,Backslash:92,n:110,t:116},u="",f=0,g=h.length;f<g;f++){var v=h.charCodeAt(f);if(v===r.Backslash){if(f++,f>=g){u+="\\";break}var A=h.charCodeAt(f);switch(A){case r.Backslash:u+="\\";break;case r.n:u+=`
|
|
213
|
-
`;break;case r.t:u+=" ";break}continue}if(v===r.DollarSign){if(f++,f>=g){u+="$";break}var E=h.charCodeAt(f);if(E===r.DollarSign){u+="$$";continue}if(E===r.Digit0||E===r.Ampersand){u+="$&";continue}if(r.Digit1<=E&&E<=r.Digit9){u+="$"+h[f];continue}}u+=h[f]}return u||h},o.prototype.replace=function(h,r){var u=this.$options,f=this.$assembleRegExp(u);if(u.$isMultiLine)return r;if(f){var g=this.$isMultilineSearch(u);g&&(h=h.replace(/\r\n|\r|\n/g,`
|
|
214
|
-
`));var v=f.exec(h);if(!v||!g&&v[0].length!=h.length)return null;if(r=u.regExp?this.parseReplaceString(r):r.replace(/\$/g,"$$$$"),r=h.replace(f,r),u.preserveCase){r=r.split("");for(var A=Math.min(h.length,h.length);A--;){var E=h[A];E&&E.toLowerCase()!=E?r[A]=r[A].toUpperCase():r[A]=r[A].toLowerCase()}r=r.join("")}return r}},o.prototype.$assembleRegExp=function(h,r){if(h.needle instanceof RegExp)return h.re=h.needle;var u=h.needle;if(!h.needle)return h.re=!1;h.regExp||(u=a.escapeRegExp(u));var f=h.caseSensitive?"gm":"gmi";try{new RegExp(u,"u"),h.$supportsUnicodeFlag=!0,f+="u"}catch{h.$supportsUnicodeFlag=!1}if(h.wholeWord&&(u=c(u,h)),h.$isMultiLine=!r&&/[\n\r]/.test(u),h.$isMultiLine)return h.re=this.$assembleMultilineRegExp(u,f);try{var g=new RegExp(u,f)}catch{g=!1}return h.re=g},o.prototype.$assembleMultilineRegExp=function(h,r){for(var u=h.replace(/\r\n|\r|\n/g,`$
|
|
215
|
-
^`).split(`
|
|
216
|
-
`),f=[],g=0;g<u.length;g++)try{f.push(new RegExp(u[g],r))}catch{return!1}return f},o.prototype.$isMultilineSearch=function(h){return h.re&&/\\r\\n|\\r|\\n/.test(h.re.source)&&h.regExp&&!h.$isMultiLine},o.prototype.$multiLineForward=function(h,r,u,f){for(var g,v=i(h,u),A=u;A<=f;){for(var E=0;E<v&&!(A>f);E++){var w=h.getLine(A++);g=g==null?w:g+`
|
|
217
|
-
`+w}var m=r.exec(g);if(r.lastIndex=0,m){var S=g.slice(0,m.index).split(`
|
|
218
|
-
`),k=m[0].split(`
|
|
219
|
-
`),D=u+S.length-1,_=S[S.length-1].length,F=D+k.length-1,x=k.length==1?_+k[0].length:k[k.length-1].length;return{startRow:D,startCol:_,endRow:F,endCol:x}}}return null},o.prototype.$multiLineBackward=function(h,r,u,f,g){for(var v,A=i(h,f),E=h.getLine(f).length-u,w=f;w>=g;){for(var m=0;m<A&&w>=g;m++){var S=h.getLine(w--);v=v==null?S:S+`
|
|
220
|
-
`+v}var k=e(v,r,E);if(k){var D=v.slice(0,k.index).split(`
|
|
221
|
-
`),_=k[0].split(`
|
|
222
|
-
`),F=w+D.length,x=D[D.length-1].length,$=F+_.length-1,C=_.length==1?x+_[0].length:_[_.length-1].length;return{startRow:F,startCol:x,endRow:$,endCol:C}}}return null},o.prototype.$matchIterator=function(h,r){var u=this.$assembleRegExp(r);if(!u)return!1;var f=this.$isMultilineSearch(r),g=this.$multiLineForward,v=this.$multiLineBackward,A=r.backwards==!0,E=r.skipCurrent!=!1,w=u.unicode,m=r.range,S=r.start;S||(S=m?m[A?"end":"start"]:h.selection.getRange()),S.start&&(S=S[E!=A?"end":"start"]);var k=m?m.start.row:0,D=m?m.end.row:h.getLength()-1;if(A)var _=function($){var C=S.row;if(!x(C,S.column,$)){for(C--;C>=k;C--)if(x(C,Number.MAX_VALUE,$))return;if(r.wrap!=!1){for(C=D,k=S.row;C>=k;C--)if(x(C,Number.MAX_VALUE,$))return}}};else var _=function(C){var b=S.row;if(!x(b,S.column,C)){for(b=b+1;b<=D;b++)if(x(b,0,C))return;if(r.wrap!=!1){for(b=k,D=S.row;b<=D;b++)if(x(b,0,C))return}}};if(r.$isMultiLine)var F=u.length,x=function($,C,b){var T=A?$-F+1:$;if(!(T<0||T+F>h.getLength())){var I=h.getLine(T),R=I.search(u[0]);if(!(!A&&R<C||R===-1)){for(var N=1;N<F;N++)if(I=h.getLine(T+N),I.search(u[N])==-1)return;var P=I.match(u[F-1])[0].length;if(!(A&&P>C)&&b(T,R,T+F-1,P))return!0}}};else if(A)var x=function(C,b,T){if(f){var I=v(h,u,b,C,k);if(!I)return!1;if(T(I.startRow,I.startCol,I.endRow,I.endCol))return!0}else{var R=h.getLine(C),N=[],P,B=0;for(u.lastIndex=0;P=u.exec(R);){var V=P[0].length;if(B=P.index,!V){if(B>=R.length)break;u.lastIndex=B+=a.skipEmptyMatch(R,B,w)}if(P.index+V>b)break;N.push(P.index,V)}for(var W=N.length-1;W>=0;W-=2){var z=N[W-1],V=N[W];if(T(C,z,C,z+V))return!0}}};else var x=function(C,b,T){if(u.lastIndex=b,f){var I=g(h,u,C,D);if(I){var R=I.endRow<=D?I.endRow-1:D;R>C&&(C=R)}if(!I)return!1;if(T(I.startRow,I.startCol,I.endRow,I.endCol))return!0}else for(var N=h.getLine(C),P,B;B=u.exec(N);){var V=B[0].length;if(P=B.index,T(C,P,C,P+V))return!0;if(!V&&(u.lastIndex=P+=a.skipEmptyMatch(N,P,w),P>=N.length))return!1}};return{forEach:_}},o})();function c(o,h){var r=a.supportsLookbehind();function u(A,E){E===void 0&&(E=!0);var w=r&&h.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return w.test(A)||h.regExp?r&&h.$supportsUnicodeFlag?E?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var f=Array.from(o),g=f[0],v=f[f.length-1];return u(g)+o+u(v,!1)}function e(o,h,r){for(var u=null,f=0;f<=o.length;){h.lastIndex=f;var g=h.exec(o);if(!g)break;var v=g.index+g[0].length;if(v>o.length-r)break;(!u||v>u.index+u[0].length)&&(u=g),f=g.index+1}return u}function i(o,h){var r=5e3,u={row:h,column:0},f=o.doc.positionToIndex(u),g=f+r,v=o.doc.indexToPosition(g),A=v.row;return A+1}l.Search=s}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(n,l,y){var a=this&&this.__extends||(function(){var o=function(h,r){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(u[g]=f[g])},o(h,r)};return function(h,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");o(h,r);function u(){this.constructor=h}h.prototype=r===null?Object.create(r):(u.prototype=r.prototype,new u)}})(),p=n("../lib/keys"),d=n("../lib/useragent"),s=p.KEY_MODS,c=(function(){function o(h,r){this.$init(h,r,!1)}return o.prototype.$init=function(h,r,u){this.platform=r||(d.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(h),this.$singleCommand=u},o.prototype.addCommand=function(h){this.commands[h.name]&&this.removeCommand(h),this.commands[h.name]=h,h.bindKey&&this._buildKeyHash(h)},o.prototype.removeCommand=function(h,r){var u=h&&(typeof h=="string"?h:h.name);h=this.commands[u],r||delete this.commands[u];var f=this.commandKeyBinding;for(var g in f){var v=f[g];if(v==h)delete f[g];else if(Array.isArray(v)){var A=v.indexOf(h);A!=-1&&(v.splice(A,1),v.length==1&&(f[g]=v[0]))}}},o.prototype.bindKey=function(h,r,u){if(typeof h=="object"&&h&&(u==null&&(u=h.position),h=h[this.platform]),!!h){if(typeof r=="function")return this.addCommand({exec:r,bindKey:h,name:r.name||h});h.split("|").forEach(function(f){var g="";if(f.indexOf(" ")!=-1){var v=f.split(/\s+/);f=v.pop(),v.forEach(function(w){var m=this.parseKeys(w),S=s[m.hashId]+m.key;g+=(g?" ":"")+S,this._addCommandToBinding(g,"chainKeys")},this),g+=" "}var A=this.parseKeys(f),E=s[A.hashId]+A.key;this._addCommandToBinding(g+E,r,u)},this)}},o.prototype._addCommandToBinding=function(h,r,u){var f=this.commandKeyBinding,g;if(!r)delete f[h];else if(!f[h]||this.$singleCommand)f[h]=r;else{Array.isArray(f[h])?(g=f[h].indexOf(r))!=-1&&f[h].splice(g,1):f[h]=[f[h]],typeof u!="number"&&(u=e(r));var v=f[h];for(g=0;g<v.length;g++){var A=v[g],E=e(A);if(E>u)break}v.splice(g,0,r)}},o.prototype.addCommands=function(h){h&&Object.keys(h).forEach(function(r){var u=h[r];if(u){if(typeof u=="string")return this.bindKey(u,r);typeof u=="function"&&(u={exec:u}),typeof u=="object"&&(u.name||(u.name=r),this.addCommand(u))}},this)},o.prototype.removeCommands=function(h){Object.keys(h).forEach(function(r){this.removeCommand(h[r])},this)},o.prototype.bindKeys=function(h){Object.keys(h).forEach(function(r){this.bindKey(r,h[r])},this)},o.prototype._buildKeyHash=function(h){this.bindKey(h.bindKey,h)},o.prototype.parseKeys=function(h){var r=h.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(E){return E}),u=r.pop(),f=p[u];if(p.FUNCTION_KEYS[f])u=p.FUNCTION_KEYS[f].toLowerCase();else if(r.length){if(r.length==1&&r[0]=="shift")return{key:u.toUpperCase(),hashId:-1}}else return{key:u,hashId:-1};for(var g=0,v=r.length;v--;){var A=p.KEY_MODS[r[v]];if(A==null)return typeof console<"u"&&console.error("invalid modifier "+r[v]+" in "+h),!1;g|=A}return{key:u,hashId:g}},o.prototype.findKeyCommand=function(h,r){var u=s[h]+r;return this.commandKeyBinding[u]},o.prototype.handleKeyboard=function(h,r,u,f){if(!(f<0)){var g=s[r]+u,v=this.commandKeyBinding[g];return h.$keyChain&&(h.$keyChain+=" "+g,v=this.commandKeyBinding[h.$keyChain]||v),v&&(v=="chainKeys"||v[v.length-1]=="chainKeys")?(h.$keyChain=h.$keyChain||g,{command:"null"}):(h.$keyChain&&((!r||r==4)&&u.length==1?h.$keyChain=h.$keyChain.slice(0,-g.length-1):(r==-1||f>0)&&(h.$keyChain="")),{command:v})}},o.prototype.getStatusText=function(h,r){return r.$keyChain||""},o})();function e(o){return typeof o=="object"&&o.bindKey&&o.bindKey.position||(o.isDefault?-100:0)}var i=(function(o){a(h,o);function h(r,u){var f=o.call(this,r,u)||this;return f.$singleCommand=!0,f}return h})(c);i.call=function(o,h,r){c.prototype.$init.call(o,h,r,!0)},c.call=function(o,h,r){c.prototype.$init.call(o,h,r,!1)},l.HashHandler=i,l.MultiHashHandler=c}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(n,l,y){var a=this&&this.__extends||(function(){var e=function(i,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,r){h.__proto__=r}||function(h,r){for(var u in r)Object.prototype.hasOwnProperty.call(r,u)&&(h[u]=r[u])},e(i,o)};return function(i,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");e(i,o);function h(){this.constructor=i}i.prototype=o===null?Object.create(o):(h.prototype=o.prototype,new h)}})(),p=n("../lib/oop"),d=n("../keyboard/hash_handler").MultiHashHandler,s=n("../lib/event_emitter").EventEmitter,c=(function(e){a(i,e);function i(o,h){var r=e.call(this,h,o)||this;return r.byName=r.commands,r.setDefaultHandler("exec",function(u){return u.args?u.command.exec(u.editor,u.args,u.event,!1):u.command.exec(u.editor,{},u.event,!0)}),r}return i.prototype.exec=function(o,h,r){if(Array.isArray(o)){for(var u=o.length;u--;)if(this.exec(o[u],h,r))return!0;return!1}typeof o=="string"&&(o=this.commands[o]);var f={editor:h,command:o,args:r};return this.canExecute(o,h)?(f.returnValue=this._emit("exec",f),this._signal("afterExec",f),f.returnValue!==!1):(this._signal("commandUnavailable",f),!1)},i.prototype.canExecute=function(o,h){return typeof o=="string"&&(o=this.commands[o]),!(!o||h&&h.$readOnly&&!o.readOnly||this.$checkCommandState!=!1&&o.isAvailable&&!o.isAvailable(h))},i.prototype.toggleRecording=function(o){if(!this.$inReplay)return o&&o._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(h){this.macro.push([h.command,h.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},i.prototype.replay=function(o){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(o);try{this.$inReplay=!0,this.macro.forEach(function(h){typeof h=="string"?this.exec(h,o):this.exec(h[0],o,h[1])},this)}finally{this.$inReplay=!1}}},i.prototype.trimMacro=function(o){return o.map(function(h){return typeof h[0]!="string"&&(h[0]=h[0].name),h[1]||(h=h[0]),h})},i})(d);p.implement(c.prototype,s),l.CommandManager=c}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(n,l,y){var a=n("../lib/lang"),p=n("../config"),d=n("../range").Range;function s(e,i){return{win:e,mac:i}}l.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:s("Ctrl-,","Command-,"),exec:function(e){p.loadModule("ace/ext/settings_menu",function(i){i.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:s("Alt-E","F4"),exec:function(e){p.loadModule("ace/ext/error_marker",function(i){i.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:s("Alt-Shift-E","Shift-F4"),exec:function(e){p.loadModule("ace/ext/error_marker",function(i){i.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:s("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:s(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:s("Ctrl-L","Command-L"),exec:function(e,i){typeof i=="number"&&!isNaN(i)&&e.gotoLine(i),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:s("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:s("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:s("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:s("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:s("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:s("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:s("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:s("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:s("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:s("Ctrl-F","Command-F"),exec:function(e){p.loadModule("ace/ext/searchbox",function(i){i.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:s("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:s("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:s("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:s("Up","Up|Ctrl-P"),exec:function(e,i){e.navigateUp(i.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:s("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:s("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:s("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:s("Down","Down|Ctrl-N"),exec:function(e,i){e.navigateDown(i.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:s("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:s("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:s("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:s("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:s("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:s("Left","Left|Ctrl-B"),exec:function(e,i){e.navigateLeft(i.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:s("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:s("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:s("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:s("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:s("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:s("Right","Right|Ctrl-F"),exec:function(e,i){e.navigateRight(i.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:s(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:s("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:s(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:s("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:s("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:s("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:s("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:s("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:s("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:s(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var i=e.$copyWithEmptySelection&&e.selection.isEmpty(),o=i?e.selection.getLineRange():e.selection.getRange();e._emit("cut",o),o.isEmpty()||e.session.remove(o),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,i){e.$handlePaste(i)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:s("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:s("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:s("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(e){p.loadModule("ace/ext/searchbox",function(i){i.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:s("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:s("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:s("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:s("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:s("Shift-Delete",null),exec:function(e){if(e.selection.isEmpty())e.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:s("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:s("Ctrl-Shift-Backspace",null),exec:function(e){var i=e.selection.getRange();i.start.column=0,e.session.remove(i)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:s("Ctrl-Shift-Delete",null),exec:function(e){var i=e.selection.getRange();i.end.column=Number.MAX_VALUE,e.session.remove(i)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:s("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,i){e.insert(i)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,i){e.insert(a.stringRepeat(i.text||"",i.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:s(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:s("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:s(null,null),exec:function(e){e.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:s("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var i=e.selection.getRange();i.start.column=i.end.column=0,i.end.row++,e.selection.setRange(i,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:s("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(e){for(var i=e.selection.isBackwards(),o=i?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),h=i?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),r=e.session.doc.getLine(o.row).length,u=e.session.doc.getTextRange(e.selection.getRange()),f=u.replace(/\n\s*/," ").length,g=e.session.doc.getLine(o.row),v=o.row+1;v<=h.row+1;v++){var A=a.stringTrimLeft(a.stringTrimRight(e.session.doc.getLine(v)));A.length!==0&&(A=" "+A),g+=A}h.row+1<e.session.doc.getLength()-1&&(g+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new d(o.row,0,h.row+2,0),g),f>0?(e.selection.moveCursorTo(o.row,o.column),e.selection.selectTo(o.row,o.column+f)):(r=e.session.doc.getLine(o.row).length>r?r+1:r,e.selection.moveCursorTo(o.row,r))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:s(null,null),exec:function(e){var i=e.session.doc.getLength()-1,o=e.session.doc.getLine(i).length,h=e.selection.rangeList.ranges,r=[];h.length<1&&(h=[e.selection.getRange()]);for(var u=0;u<h.length;u++)u==h.length-1&&(h[u].end.row===i&&h[u].end.column===o||r.push(new d(h[u].end.row,h[u].end.column,i,o))),u===0?h[u].start.row===0&&h[u].start.column===0||r.push(new d(0,0,h[u].start.row,h[u].start.column)):r.push(new d(h[u-1].end.row,h[u-1].end.column,h[u].start.row,h[u].start.column));e.exitMultiSelectMode(),e.clearSelection();for(var u=0;u<r.length;u++)e.selection.addRange(r[u],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(e){e.selection.clearSelection(),e.navigateLineEnd(),e.insert(`
|
|
223
|
-
`)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(e){e.selection.clearSelection();var i=e.getCursorPosition();e.selection.moveTo(i.row-1,Number.MAX_VALUE),e.insert(`
|
|
224
|
-
`),i.row===0&&e.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(e){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),e.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:s("F1","F1"),exec:function(e){e.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:s(null,null),exec:function(e){e.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(e){e.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys"],function(n,l,y){var a=n("../lib/keys"),p=(function(){function s(c){this.editor=c,this.gutterLayer=c.renderer.$gutterLayer,this.element=c.renderer.$gutter,this.lines=c.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=this.editor.$mouseHandler.$tooltip}return s.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))},s.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))},s.prototype.$onGutterKeyDown=function(c){if(this.annotationTooltip.isOpen){c.preventDefault(),c.keyCode===a.escape&&this.annotationTooltip.hide();return}if(c.target===this.element){if(c.keyCode!=a.enter)return;c.preventDefault();var e=this.editor.getCursorPosition().row;this.editor.isRowVisible(e)||this.editor.scrollToLine(e,!0,!0),setTimeout(function(){var i=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),o=this.$findNearestFoldLaneWidget(i),h=this.$findNearestAnnotation(i);if(!(o===null&&h===null)){var r=this.$findClosestNumber(o,h,i);if(r===o)if(this.activeLane="fold",this.activeRowIndex=o,this.$isCustomWidgetVisible(o)){this.$focusCustomWidget(this.activeRowIndex);return}else{this.$focusFoldWidget(this.activeRowIndex);return}else{this.activeRowIndex=h,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}}}.bind(this),10);return}this.$handleGutterKeyboardInteraction(c),setTimeout(function(){this.editor._signal("gutterkeydown",new d(c,this))}.bind(this),10)},s.prototype.$handleGutterKeyboardInteraction=function(c){if(c.keyCode===a.tab){c.preventDefault();return}if(c.keyCode===a.escape){c.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(c.keyCode===a.up){switch(c.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(c.keyCode===a.down){switch(c.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(c.keyCode===a.left){c.preventDefault(),this.$switchLane("annotation");return}if(c.keyCode===a.right){c.preventDefault(),this.$switchLane("fold");return}if(c.keyCode===a.enter||c.keyCode===a.space){switch(c.preventDefault(),this.activeLane){case"fold":var e=this.$rowIndexToRow(this.activeRowIndex),i=this.editor.session.$gutterCustomWidgets[e];if(i)i.callbacks&&i.callbacks.onClick&&i.callbacks.onClick(c,e);else if(this.gutterLayer.session.foldWidgets[e]==="start"){this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),c),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==e&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(e),this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex)),this.annotationTooltip.$fromKeyboard=!0;break}return}},s.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hide()},s.prototype.$isFoldWidgetVisible=function(c){var e=this.editor.isRowFullyVisible(this.$rowIndexToRow(c)),i=this.$getFoldWidget(c).style.display!=="none";return e&&i},s.prototype.$isCustomWidgetVisible=function(c){var e=this.editor.isRowFullyVisible(this.$rowIndexToRow(c)),i=!!this.$getCustomWidget(c);return e&&i},s.prototype.$isAnnotationVisible=function(c){var e=this.editor.isRowFullyVisible(this.$rowIndexToRow(c)),i=this.$getAnnotation(c).style.display!=="none";return e&&i},s.prototype.$getFoldWidget=function(c){var e=this.lines.get(c),i=e.element;return i.childNodes[1]},s.prototype.$getCustomWidget=function(c){var e=this.lines.get(c),i=e.element;return i.childNodes[3]},s.prototype.$getAnnotation=function(c){var e=this.lines.get(c),i=e.element;return i.childNodes[2]},s.prototype.$findNearestFoldLaneWidget=function(c){if(this.$isCustomWidgetVisible(c)||this.$isFoldWidgetVisible(c))return c;for(var e=0;c-e>0||c+e<this.lines.getLength()-1;){if(e++,c-e>=0&&this.$isCustomWidgetVisible(c-e))return c-e;if(c+e<=this.lines.getLength()-1&&this.$isCustomWidgetVisible(c+e))return c+e;if(c-e>=0&&this.$isFoldWidgetVisible(c-e))return c-e;if(c+e<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(c+e))return c+e}return null},s.prototype.$findNearestAnnotation=function(c){if(this.$isAnnotationVisible(c))return c;for(var e=0;c-e>0||c+e<this.lines.getLength()-1;){if(e++,c-e>=0&&this.$isAnnotationVisible(c-e))return c-e;if(c+e<=this.lines.getLength()-1&&this.$isAnnotationVisible(c+e))return c+e}return null},s.prototype.$focusFoldWidget=function(c){if(c!=null){var e=this.$getFoldWidget(c);e.classList.add(this.editor.renderer.keyboardFocusClassName),e.focus()}},s.prototype.$focusCustomWidget=function(c){if(c!=null){var e=this.$getCustomWidget(c);e&&(e.classList.add(this.editor.renderer.keyboardFocusClassName),e.focus())}},s.prototype.$focusAnnotation=function(c){if(c!=null){var e=this.$getAnnotation(c);e.classList.add(this.editor.renderer.keyboardFocusClassName),e.focus()}},s.prototype.$blurFoldWidget=function(c){var e=this.$getFoldWidget(c);e.classList.remove(this.editor.renderer.keyboardFocusClassName),e.blur()},s.prototype.$blurCustomWidget=function(c){var e=this.$getCustomWidget(c);e&&(e.classList.remove(this.editor.renderer.keyboardFocusClassName),e.blur())},s.prototype.$blurAnnotation=function(c){var e=this.$getAnnotation(c);e.classList.remove(this.editor.renderer.keyboardFocusClassName),e.blur()},s.prototype.$moveFoldWidgetUp=function(){for(var c=this.activeRowIndex;c>0;)if(c--,this.$isFoldWidgetVisible(c)||this.$isCustomWidgetVisible(c)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=c,this.$isFoldWidgetVisible(c)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},s.prototype.$moveFoldWidgetDown=function(){for(var c=this.activeRowIndex;c<this.lines.getLength()-1;)if(c++,this.$isFoldWidgetVisible(c)||this.$isCustomWidgetVisible(c)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=c,this.$isFoldWidgetVisible(c)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},s.prototype.$moveAnnotationUp=function(){for(var c=this.activeRowIndex;c>0;)if(c--,this.$isAnnotationVisible(c)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=c,this.$focusAnnotation(this.activeRowIndex);return}},s.prototype.$moveAnnotationDown=function(){for(var c=this.activeRowIndex;c<this.lines.getLength()-1;)if(c++,this.$isAnnotationVisible(c)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=c,this.$focusAnnotation(this.activeRowIndex);return}},s.prototype.$findClosestNumber=function(c,e,i){return c===null?e:e===null||Math.abs(i-c)<=Math.abs(i-e)?c:e},s.prototype.$switchLane=function(c){switch(c){case"annotation":if(this.activeLane==="annotation")break;var e=this.$findNearestAnnotation(this.activeRowIndex);if(e==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=e,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var i=this.$findNearestFoldLaneWidget(this.activeRowIndex);if(i===null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$isCustomWidgetVisible(i)?this.$focusCustomWidget(this.activeRowIndex):this.$focusFoldWidget(this.activeRowIndex);break}},s.prototype.$rowIndexToRow=function(c){var e=this.lines.get(c);return e?e.row:null},s.prototype.$rowToRowIndex=function(c){for(var e=0;e<this.lines.getLength();e++){var i=this.lines.get(e);if(i.row==c)return e}return null},s})();l.GutterKeyboardHandler=p;var d=(function(){function s(c,e){this.gutterKeyboardHandler=e,this.domEvent=c}return s.prototype.getKey=function(){return a.keyCodeToString(this.domEvent.keyCode)},s.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},s.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},s.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},s})();l.GutterKeyboardEvent=d}),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys","ace/lib/event","ace/tooltip"],function(n,l,y){var a=this&&this.__values||function(C){var b=typeof Symbol=="function"&&Symbol.iterator,T=b&&C[b],I=0;if(T)return T.call(C);if(C&&typeof C.length=="number")return{next:function(){return C&&I>=C.length&&(C=void 0),{value:C&&C[I++],done:!C}}};throw new TypeError(b?"Object is not iterable.":"Symbol.iterator is not defined.")},p=n("./lib/oop"),d=n("./lib/dom"),s=n("./lib/lang"),c=n("./lib/useragent"),e=n("./keyboard/textinput").TextInput,i=n("./mouse/mouse_handler").MouseHandler,o=n("./mouse/fold_handler").FoldHandler,h=n("./keyboard/keybinding").KeyBinding,r=n("./edit_session").EditSession,u=n("./search").Search,f=n("./range").Range,g=n("./lib/event_emitter").EventEmitter,v=n("./commands/command_manager").CommandManager,A=n("./commands/default_commands").commands,E=n("./config"),w=n("./token_iterator").TokenIterator,m=n("./keyboard/gutter_handler").GutterKeyboardHandler,S=n("./config").nls,k=n("./clipboard"),D=n("./lib/keys"),_=n("./lib/event"),F=n("./tooltip").HoverTooltip,x=(function(){function C(b,T,I){this.id="editor"+ ++C.$uid,this.session,this.$toDestroy=[];var R=b.getContainerElement();this.container=R,this.renderer=b,this.commands=new v(c.isMac?"mac":"win",A),typeof document=="object"&&(this.textInput=new e(b.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new i(this),new o(this)),this.keyBinding=new h(this),this.$search=new u().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=s.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(N,P){P._$emitInputEvent.schedule(31)}),this.setSession(T||I&&I.session||new r("")),E.resetOptions(this),I&&this.setOptions(I),E._signal("editor",this)}return C.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},C.prototype.startOperation=function(b){this.session.startOperation(b)},C.prototype.endOperation=function(b){this.session.endOperation(b)},C.prototype.onStartOperation=function(b){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,b||(this.previousCommand=null)},C.prototype.onEndOperation=function(b){if(this.curOp&&this.session){if(b&&b.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var T=this.curOp.command,I=T&&T.scrollIntoView;if(I){switch(I){case"center-animate":I="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var R=this.selection.getRange(),N=this.renderer.layerConfig;(R.start.row>=N.lastRow||R.end.row<=N.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}I=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},C.prototype.$historyTracker=function(b){if(this.$mergeUndoDeltas){var T=this.prevOp,I=this.$mergeableCommands,R=T.command&&b.command.name==T.command.name;if(b.command.name=="insertstring"){var N=b.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),R=R&&this.mergeNextCommand&&(!/\s/.test(N)||/\s/.test(T.args)),this.mergeNextCommand=!0}else R=R&&I.indexOf(b.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(R=!1),R?this.session.mergeUndoDeltas=!0:I.indexOf(b.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},C.prototype.setKeyboardHandler=function(b,T){if(b&&typeof b=="string"&&b!="ace"){this.$keybindingId=b;var I=this;E.loadModule(["keybinding",b],function(R){I.$keybindingId==b&&I.keyBinding.setKeyboardHandler(R&&R.handler),T&&T()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(b),T&&T()},C.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},C.prototype.setSession=function(b){if(this.session!=b){this.curOp&&this.endOperation(),this.curOp={};var T=this.session;if(T){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange),this.session.off("startOperation",this.$onStartOperation),this.session.off("endOperation",this.$onEndOperation);var I=this.session.getSelection();I.off("changeCursor",this.$onCursorChange),I.off("changeSelection",this.$onSelectionChange)}this.session=b,b?(this.$onDocumentChange=this.onDocumentChange.bind(this),b.on("change",this.$onDocumentChange),this.renderer.setSession(b),this.$onChangeMode=this.onChangeMode.bind(this),b.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),b.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),b.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),b.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),b.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),b.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=b.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(b)),this._signal("changeSession",{session:b,oldSession:T}),this.curOp=null,T&&T._signal("changeEditor",{oldEditor:this}),T&&(T.$editor=null),b&&b._signal("changeEditor",{editor:this}),b&&(b.$editor=this),b&&!b.destroyed&&b.bgTokenizer.scheduleStart()}},C.prototype.getSession=function(){return this.session},C.prototype.setValue=function(b,T){return this.session.doc.setValue(b),T?T==1?this.navigateFileEnd():T==-1&&this.navigateFileStart():this.selectAll(),b},C.prototype.getValue=function(){return this.session.getValue()},C.prototype.getSelection=function(){return this.selection},C.prototype.resize=function(b){this.renderer.onResize(b)},C.prototype.setTheme=function(b,T){this.renderer.setTheme(b,T)},C.prototype.getTheme=function(){return this.renderer.getTheme()},C.prototype.setStyle=function(b,T){this.renderer.setStyle(b,T)},C.prototype.unsetStyle=function(b){this.renderer.unsetStyle(b)},C.prototype.getFontSize=function(){return this.getOption("fontSize")||d.computedStyle(this.container).fontSize},C.prototype.setFontSize=function(b){this.setOption("fontSize",b)},C.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var b=this;this.$highlightPending=!0,setTimeout(function(){b.$highlightPending=!1;var T=b.session;if(!(!T||T.destroyed)){T.$bracketHighlight&&(T.$bracketHighlight.markerIds.forEach(function(U){T.removeMarker(U)}),T.$bracketHighlight=null);var I=b.getCursorPosition(),R=b.getKeyboardHandler(),N=R&&R.$getDirectionForHighlight&&R.$getDirectionForHighlight(b),P=T.getMatchingBracketRanges(I,N);if(!P){var B=new w(T,I.row,I.column),V=B.getCurrentToken();if(V&&/\b(?:tag-open|tag-name)/.test(V.type)){var W=T.getMatchingTags(I);W&&(P=[W.openTagName.isEmpty()?W.openTag:W.openTagName,W.closeTagName.isEmpty()?W.closeTag:W.closeTagName])}}if(!P&&T.$mode.getMatching&&(P=T.$mode.getMatching(b.session)),!P){b.getHighlightIndentGuides()&&b.renderer.$textLayer.$highlightIndentGuide();return}var z="ace_bracket";Array.isArray(P)?P.length==1&&(z="ace_error_bracket"):P=[P],P.length==2&&(f.comparePoints(P[0].end,P[1].start)==0?P=[f.fromPoints(P[0].start,P[1].end)]:f.comparePoints(P[0].start,P[1].end)==0&&(P=[f.fromPoints(P[1].start,P[0].end)])),T.$bracketHighlight={ranges:P,markerIds:P.map(function(U){return T.addMarker(U,z,"text")})},b.getHighlightIndentGuides()&&b.renderer.$textLayer.$highlightIndentGuide()}},50)}},C.prototype.focus=function(){this.textInput.focus()},C.prototype.isFocused=function(){return this.textInput.isFocused()},C.prototype.blur=function(){this.textInput.blur()},C.prototype.onFocus=function(b){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",b))},C.prototype.onBlur=function(b){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",b))},C.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},C.prototype.onDocumentChange=function(b){var T=this.session.$useWrapMode,I=b.start.row==b.end.row?b.end.row:1/0;this.renderer.updateLines(b.start.row,I,T),this._signal("change",b),this.$cursorChange()},C.prototype.onTokenizerUpdate=function(b){var T=b.data;this.renderer.updateLines(T.first,T.last)},C.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},C.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},C.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},C.prototype.$updateHighlightActiveLine=function(){var b=this.getSession(),T;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(T=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(T=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(T=!1)),b.$highlightLineMarker&&!T)b.removeMarker(b.$highlightLineMarker.id),b.$highlightLineMarker=null;else if(!b.$highlightLineMarker&&T){var I=new f(T.row,T.column,T.row,1/0);I.id=b.addMarker(I,"ace_active-line","screenLine"),b.$highlightLineMarker=I}else T&&(b.$highlightLineMarker.start.row=T.row,b.$highlightLineMarker.end.row=T.row,b.$highlightLineMarker.start.column=T.column,b._signal("changeBackMarker"))},C.prototype.onSelectionChange=function(b){var T=this.session;if(T.$selectionMarker&&T.removeMarker(T.$selectionMarker),T.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var I=this.selection.getRange(),R=this.getSelectionStyle();T.$selectionMarker=T.addMarker(I,"ace_selection",R)}var N=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(N),this._signal("changeSelection")},C.prototype.$getSelectionHighLightRegexp=function(){var b=this.session,T=this.getSelectionRange();if(!(T.isEmpty()||T.isMultiLine())){var I=T.start.column,R=T.end.column,N=b.getLine(T.start.row),P=N.substring(I,R);if(!(P.length>5e3||!/[\w\d]/.test(P))){var B=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:P}),V=N.substring(I-1,R+1);if(B.test(V))return B}}},C.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},C.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},C.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},C.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},C.prototype.onChangeMode=function(b){this.renderer.updateText(),this._emit("changeMode",b)},C.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},C.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},C.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},C.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},C.prototype.getCopyText=function(){var b=this.getSelectedText(),T=this.session.doc.getNewLineCharacter(),I=!1;if(!b&&this.$copyWithEmptySelection){I=!0;for(var R=this.selection.getAllRanges(),N=0;N<R.length;N++){var P=R[N];N&&R[N-1].start.row==P.start.row||(b+=this.session.getLine(P.start.row)+T)}}var B={text:b};return this._signal("copy",B),k.lineMode=I?B.text:!1,B.text},C.prototype.onCopy=function(){this.commands.exec("copy",this)},C.prototype.onCut=function(){this.commands.exec("cut",this)},C.prototype.onPaste=function(b,T){var I={text:b,event:T};this.commands.exec("paste",this,I)},C.prototype.$handlePaste=function(b){typeof b=="string"&&(b={text:b}),this._signal("paste",b);var T=b.text,I=T===k.lineMode,R=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)I?R.insert({row:this.selection.lead.row,column:0},T):this.insert(T);else if(I)this.selection.rangeList.ranges.forEach(function(z){R.insert({row:z.start.row,column:0},T)});else{var N=T.split(/\r\n|\r|\n/),P=this.selection.rangeList.ranges,B=N.length==2&&(!N[0]||!N[1]);if(N.length!=P.length||B)return this.commands.exec("insertstring",this,T);for(var V=P.length;V--;){var W=P[V];W.isEmpty()||R.remove(W),R.insert(W.start,N[V])}}},C.prototype.execCommand=function(b,T){return this.commands.exec(b,this,T)},C.prototype.insert=function(b,T){var I=this.session,R=I.getMode(),N=this.getCursorPosition();if(this.getBehavioursEnabled()&&!T){var P=R.transformAction(I.getState(N.row),"insertion",this,I,b);P&&(b!==P.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),b=P.text)}if(b==" "&&(b=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&b.indexOf(`
|
|
225
|
-
`)==-1){var B=f.fromPoints(N,N);B.end.column+=b.length,this.session.remove(B)}}else{var B=this.getSelectionRange();N=this.session.remove(B),this.clearSelection()}if(b==`
|
|
226
|
-
`||b==`\r
|
|
227
|
-
`){var U=I.getLine(N.row);if(N.column>U.search(/\S|$/)){var V=U.substr(N.column).search(/\S|$/);I.doc.removeInLine(N.row,N.column,N.column+V)}}this.clearSelection();var W=N.column,z=I.getState(N.row),U=I.getLine(N.row),G=R.checkOutdent(z,U,b);if(I.insert(N,b),P&&P.selection&&(P.selection.length==2?this.selection.setSelectionRange(new f(N.row,W+P.selection[0],N.row,W+P.selection[1])):this.selection.setSelectionRange(new f(N.row+P.selection[0],P.selection[1],N.row+P.selection[2],P.selection[3]))),this.$enableAutoIndent){if(I.getDocument().isNewLine(b)){var Y=R.getNextLineIndent(z,U.slice(0,N.column),I.getTabString());I.insert({row:N.row+1,column:0},Y)}G&&R.autoOutdent(z,I,N.row)}},C.prototype.autoIndent=function(){for(var b=this.session,T=b.getMode(),I=this.selection.isEmpty()?[new f(0,0,b.doc.getLength()-1,0)]:this.selection.getAllRanges(),R="",N="",P="",B=b.getTabString(),V=0;V<I.length;V++)for(var W=I[V].start.row,z=I[V].end.row,U=W;U<=z;U++){U>0&&(R=b.getState(U-1),N=b.getLine(U-1),P=T.getNextLineIndent(R,N,B));var G=b.getLine(U),Y=T.$getIndent(G);if(P!==Y){if(Y.length>0){var Q=new f(U,0,U,Y.length);b.remove(Q)}P.length>0&&b.insert({row:U,column:0},P)}T.autoOutdent(R,b,U)}},C.prototype.onTextInput=function(b,T){if(!T)return this.keyBinding.onTextInput(b);this.startOperation({command:{name:"insertstring"}});var I=this.applyComposition.bind(this,b,T);this.selection.rangeCount?this.forEachSelection(I):I(),this.endOperation()},C.prototype.applyComposition=function(b,T){if(T.extendLeft||T.extendRight){var I=this.selection.getRange();I.start.column-=T.extendLeft,I.end.column+=T.extendRight,I.start.column<0&&(I.start.row--,I.start.column+=this.session.getLine(I.start.row).length+1),this.selection.setRange(I),!b&&!I.isEmpty()&&this.remove()}if((b||!this.selection.isEmpty())&&this.insert(b,!0),T.restoreStart||T.restoreEnd){var I=this.selection.getRange();I.start.column-=T.restoreStart,I.end.column-=T.restoreEnd,this.selection.setRange(I)}},C.prototype.onCommandKey=function(b,T,I){return this.keyBinding.onCommandKey(b,T,I)},C.prototype.setOverwrite=function(b){this.session.setOverwrite(b)},C.prototype.getOverwrite=function(){return this.session.getOverwrite()},C.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},C.prototype.setScrollSpeed=function(b){this.setOption("scrollSpeed",b)},C.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},C.prototype.setDragDelay=function(b){this.setOption("dragDelay",b)},C.prototype.getDragDelay=function(){return this.getOption("dragDelay")},C.prototype.setSelectionStyle=function(b){this.setOption("selectionStyle",b)},C.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},C.prototype.setHighlightActiveLine=function(b){this.setOption("highlightActiveLine",b)},C.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},C.prototype.setHighlightGutterLine=function(b){this.setOption("highlightGutterLine",b)},C.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},C.prototype.setHighlightSelectedWord=function(b){this.setOption("highlightSelectedWord",b)},C.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},C.prototype.setAnimatedScroll=function(b){this.renderer.setAnimatedScroll(b)},C.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},C.prototype.setShowInvisibles=function(b){this.renderer.setShowInvisibles(b)},C.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},C.prototype.setDisplayIndentGuides=function(b){this.renderer.setDisplayIndentGuides(b)},C.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},C.prototype.setHighlightIndentGuides=function(b){this.renderer.setHighlightIndentGuides(b)},C.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},C.prototype.setShowPrintMargin=function(b){this.renderer.setShowPrintMargin(b)},C.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},C.prototype.setPrintMarginColumn=function(b){this.renderer.setPrintMarginColumn(b)},C.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},C.prototype.setReadOnly=function(b){this.setOption("readOnly",b)},C.prototype.getReadOnly=function(){return this.getOption("readOnly")},C.prototype.setBehavioursEnabled=function(b){this.setOption("behavioursEnabled",b)},C.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},C.prototype.setWrapBehavioursEnabled=function(b){this.setOption("wrapBehavioursEnabled",b)},C.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},C.prototype.setShowFoldWidgets=function(b){this.setOption("showFoldWidgets",b)},C.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},C.prototype.setFadeFoldWidgets=function(b){this.setOption("fadeFoldWidgets",b)},C.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},C.prototype.remove=function(b){this.selection.isEmpty()&&(b=="left"?this.selection.selectLeft():this.selection.selectRight());var T=this.getSelectionRange();if(this.getBehavioursEnabled()){var I=this.session,R=I.getState(T.start.row),N=I.getMode().transformAction(R,"deletion",this,I,T);if(T.end.column===0){var P=I.getTextRange(T);if(P[P.length-1]==`
|
|
228
|
-
`){var B=I.getLine(T.end.row);/^\s+$/.test(B)&&(T.end.column=B.length)}}N&&(T=N)}this.session.remove(T),this.clearSelection()},C.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},C.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},C.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},C.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var b=this.getSelectionRange();b.start.column==b.end.column&&b.start.row==b.end.row&&(b.end.column=0,b.end.row++),this.session.remove(b),this.clearSelection()},C.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var b=this.getCursorPosition();this.insert(`
|
|
229
|
-
`),this.moveCursorToPosition(b)},C.prototype.setGhostText=function(b,T){this.renderer.setGhostText(b,T)},C.prototype.removeGhostText=function(){this.renderer.removeGhostText()},C.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var b=this.getCursorPosition(),T=b.column;if(T!==0){var I=this.session.getLine(b.row),R,N;T<I.length?(R=I.charAt(T)+I.charAt(T-1),N=new f(b.row,T-1,b.row,T+1)):(R=I.charAt(T-1)+I.charAt(T-2),N=new f(b.row,T-2,b.row,T)),this.session.replace(N,R),this.session.selection.moveToPosition(N.end)}}},C.prototype.toLowerCase=function(){var b=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var T=this.getSelectionRange(),I=this.session.getTextRange(T);this.session.replace(T,I.toLowerCase()),this.selection.setSelectionRange(b)},C.prototype.toUpperCase=function(){var b=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var T=this.getSelectionRange(),I=this.session.getTextRange(T);this.session.replace(T,I.toUpperCase()),this.selection.setSelectionRange(b)},C.prototype.indent=function(){var b=this.session,T=this.getSelectionRange();if(T.start.row<T.end.row){var I=this.$getSelectedRows();b.indentRows(I.first,I.last," ");return}else if(T.start.column<T.end.column){var R=b.getTextRange(T);if(!/^\s+$/.test(R)){var I=this.$getSelectedRows();b.indentRows(I.first,I.last," ");return}}var N=b.getLine(T.start.row),P=T.start,B=b.getTabSize(),V=b.documentToScreenColumn(P.row,P.column);if(this.session.getUseSoftTabs())var W=B-V%B,z=s.stringRepeat(" ",W);else{for(var W=V%B;N[T.start.column-1]==" "&&W;)T.start.column--,W--;this.selection.setSelectionRange(T),z=" "}return this.insert(z)},C.prototype.blockIndent=function(){var b=this.$getSelectedRows();this.session.indentRows(b.first,b.last," ")},C.prototype.blockOutdent=function(){var b=this.session.getSelection();this.session.outdentRows(b.getRange())},C.prototype.sortLines=function(){for(var b=this.$getSelectedRows(),T=this.session,I=[],R=b.first;R<=b.last;R++)I.push(T.getLine(R));I.sort(function(B,V){return B.toLowerCase()<V.toLowerCase()?-1:B.toLowerCase()>V.toLowerCase()?1:0});for(var N=new f(0,0,0,0),R=b.first;R<=b.last;R++){var P=T.getLine(R);N.start.row=R,N.end.row=R,N.end.column=P.length,T.replace(N,I[R-b.first])}},C.prototype.toggleCommentLines=function(){var b=this.session.getState(this.getCursorPosition().row),T=this.$getSelectedRows();this.session.getMode().toggleCommentLines(b,this.session,T.first,T.last)},C.prototype.toggleBlockComment=function(){var b=this.getCursorPosition(),T=this.session.getState(b.row),I=this.getSelectionRange();this.session.getMode().toggleBlockComment(T,this.session,I,b)},C.prototype.getNumberAt=function(b,T){var I=/[\-]?[0-9]+(?:\.[0-9]+)?/g;I.lastIndex=0;for(var R=this.session.getLine(b);I.lastIndex<T;){var N=I.exec(R);if(N.index<=T&&N.index+N[0].length>=T){var P={value:N[0],start:N.index,end:N.index+N[0].length};return P}}return null},C.prototype.modifyNumber=function(b){var T=this.selection.getCursor().row,I=this.selection.getCursor().column,R=new f(T,I-1,T,I),N=this.session.getTextRange(R);if(!isNaN(parseFloat(N))&&isFinite(N)){var P=this.getNumberAt(T,I);if(P){var B=P.value.indexOf(".")>=0?P.start+P.value.indexOf(".")+1:P.end,V=P.start+P.value.length-B,W=parseFloat(P.value);W*=Math.pow(10,V),B!==P.end&&I<B?b*=Math.pow(10,P.end-I-1):b*=Math.pow(10,P.end-I),W+=b,W/=Math.pow(10,V);var z=W.toFixed(V),U=new f(T,P.start,T,P.end);this.session.replace(U,z),this.moveCursorTo(T,Math.max(P.start+1,I+z.length-P.value.length))}}else this.toggleWord()},C.prototype.toggleWord=function(){var b=this.selection.getCursor().row,T=this.selection.getCursor().column;this.selection.selectWord();var I=this.getSelectedText(),R=this.selection.getWordRange().start.column,N=I.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),P=T-R-1;P<0&&(P=0);var B=0,V=0,W=this;I.match(/[A-Za-z0-9_]+/)&&N.forEach(function(ue,me){V=B+ue.length,P>=B&&P<=V&&(I=ue,W.selection.clearSelection(),W.moveCursorTo(b,B+R),W.selection.selectTo(b,V+R)),B=V});for(var z=this.$toggleWordPairs,U,G=0;G<z.length;G++)for(var Y=z[G],Q=0;Q<=1;Q++){var q=+!Q,te=I.match(new RegExp("^\\s?_?("+s.escapeRegExp(Y[Q])+")\\s?$","i"));if(te){var re=I.match(new RegExp("([_]|^|\\s)("+s.escapeRegExp(te[1])+")($|\\s)","g"));re&&(U=I.replace(new RegExp(s.escapeRegExp(Y[Q]),"i"),function(ue){var me=Y[q];return ue.toUpperCase()==ue?me=me.toUpperCase():ue.charAt(0).toUpperCase()==ue.charAt(0)&&(me=me.substr(0,0)+Y[q].charAt(0).toUpperCase()+me.substr(1)),me}),this.insert(U),U="")}}},C.prototype.findLinkAt=function(b,T){var I,R,N=this.session.getLine(b),P=N.split(/((?:https?|ftp):\/\/[\S]+)/),B=T;B<0&&(B=0);var V=0,W=0,z;try{for(var U=a(P),G=U.next();!G.done;G=U.next()){var Y=G.value;if(W=V+Y.length,B>=V&&B<=W&&Y.match(/((?:https?|ftp):\/\/[\S]+)/)){z=Y.replace(/[\s:.,'";}\]]+$/,"");break}V=W}}catch(Q){I={error:Q}}finally{try{G&&!G.done&&(R=U.return)&&R.call(U)}finally{if(I)throw I.error}}return z},C.prototype.openLink=function(){var b=this.selection.getCursor(),T=this.findLinkAt(b.row,b.column);return T&&window.open(T,"_blank"),T!=null},C.prototype.removeLines=function(){var b=this.$getSelectedRows();this.session.removeFullLines(b.first,b.last),this.clearSelection()},C.prototype.duplicateSelection=function(){var b=this.selection,T=this.session,I=b.getRange(),R=b.isBackwards();if(I.isEmpty()){var N=I.start.row;T.duplicateLines(N,N)}else{var P=R?I.start:I.end,B=T.insert(P,T.getTextRange(I));I.start=P,I.end=B,b.setSelectionRange(I,R)}},C.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},C.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},C.prototype.moveText=function(b,T,I){return this.session.moveText(b,T,I)},C.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},C.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},C.prototype.$moveLines=function(b,T){var I,R,N=this.selection;if(!N.inMultiSelectMode||this.inVirtualSelectionMode){var P=N.toOrientedRange();I=this.$getSelectedRows(P),R=this.session.$moveLines(I.first,I.last,T?0:b),T&&b==-1&&(R=0),P.moveBy(R,0),N.fromOrientedRange(P)}else{var B=N.rangeList.ranges;N.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var V=0,W=0,z=B.length,U=0;U<z;U++){var G=U;B[U].moveBy(V,0),I=this.$getSelectedRows(B[U]);for(var Y=I.first,Q=I.last;++U<z;){W&&B[U].moveBy(W,0);var q=this.$getSelectedRows(B[U]);if(T&&q.first!=Q)break;if(!T&&q.first>Q+1)break;Q=q.last}for(U--,V=this.session.$moveLines(Y,Q,T?0:b),T&&b==-1&&(G=U+1);G<=U;)B[G].moveBy(V,0),G++;T||(V=0),W+=V}N.fromOrientedRange(N.ranges[0]),N.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},C.prototype.$getSelectedRows=function(b){return b=(b||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(b.start.row),last:this.session.getRowFoldEnd(b.end.row)}},C.prototype.onCompositionStart=function(b){this.renderer.showComposition(b)},C.prototype.onCompositionUpdate=function(b){this.renderer.setCompositionText(b)},C.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},C.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},C.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},C.prototype.isRowVisible=function(b){return b>=this.getFirstVisibleRow()&&b<=this.getLastVisibleRow()},C.prototype.isRowFullyVisible=function(b){return b>=this.renderer.getFirstFullyVisibleRow()&&b<=this.renderer.getLastFullyVisibleRow()},C.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},C.prototype.$moveByPage=function(b,T){var I=this.renderer,R=this.renderer.layerConfig,N=b*Math.floor(R.height/R.lineHeight);T===!0?this.selection.$moveSelection(function(){this.moveCursorBy(N,0)}):T===!1&&(this.selection.moveCursorBy(N,0),this.selection.clearSelection());var P=I.scrollTop;I.scrollBy(0,N*R.lineHeight),T!=null&&I.scrollCursorIntoView(null,.5),I.animateScrolling(P)},C.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},C.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},C.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},C.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},C.prototype.scrollPageDown=function(){this.$moveByPage(1)},C.prototype.scrollPageUp=function(){this.$moveByPage(-1)},C.prototype.scrollToRow=function(b){this.renderer.scrollToRow(b)},C.prototype.scrollToLine=function(b,T,I,R){this.renderer.scrollToLine(b,T,I,R)},C.prototype.centerSelection=function(){var b=this.getSelectionRange(),T={row:Math.floor(b.start.row+(b.end.row-b.start.row)/2),column:Math.floor(b.start.column+(b.end.column-b.start.column)/2)};this.renderer.alignCursor(T,.5)},C.prototype.getCursorPosition=function(){return this.selection.getCursor()},C.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},C.prototype.getSelectionRange=function(){return this.selection.getRange()},C.prototype.selectAll=function(){this.selection.selectAll()},C.prototype.clearSelection=function(){this.selection.clearSelection()},C.prototype.moveCursorTo=function(b,T){this.selection.moveCursorTo(b,T)},C.prototype.moveCursorToPosition=function(b){this.selection.moveCursorToPosition(b)},C.prototype.jumpToMatching=function(b,T){var I=this.getCursorPosition(),R=new w(this.session,I.row,I.column),N=R.getCurrentToken(),P=0;N&&N.type.indexOf("tag-name")!==-1&&(N=R.stepBackward());var B=N||R.stepForward();if(B){var V,W=!1,z={},U=I.column-B.start,G,Y={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(B.value.match(/[{}()\[\]]/g)){for(;U<B.value.length&&!W;U++)if(Y[B.value[U]])switch(G=Y[B.value[U]]+"."+B.type.replace("rparen","lparen"),isNaN(z[G])&&(z[G]=0),B.value[U]){case"(":case"[":case"{":z[G]++;break;case")":case"]":case"}":z[G]--,z[G]===-1&&(V="bracket",W=!0);break}}else B.type.indexOf("tag-name")!==-1&&(isNaN(z[B.value])&&(z[B.value]=0),N.value==="<"&&P>1?z[B.value]++:N.value==="</"&&z[B.value]--,z[B.value]===-1&&(V="tag",W=!0));W||(N=B,P++,B=R.stepForward(),U=0)}while(B&&!W);if(V){var Q,q;if(V==="bracket")Q=this.session.getBracketRange(I),Q||(Q=new f(R.getCurrentTokenRow(),R.getCurrentTokenColumn()+U-1,R.getCurrentTokenRow(),R.getCurrentTokenColumn()+U-1),q=Q.start,(T||q.row===I.row&&Math.abs(q.column-I.column)<2)&&(Q=this.session.getBracketRange(q)));else if(V==="tag"){if(!B||B.type.indexOf("tag-name")===-1)return;if(Q=new f(R.getCurrentTokenRow(),R.getCurrentTokenColumn()-2,R.getCurrentTokenRow(),R.getCurrentTokenColumn()-2),Q.compare(I.row,I.column)===0){var te=this.session.getMatchingTags(I);te&&(te.openTag.contains(I.row,I.column)?(Q=te.closeTag,q=Q.start):(Q=te.openTag,te.closeTag.start.row===I.row&&te.closeTag.start.column===I.column?q=Q.end:q=Q.start))}q=q||Q.start}q=Q&&Q.cursor||q,q&&(b?Q&&T?this.selection.setRange(Q):Q&&Q.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(q.row,q.column):this.selection.moveTo(q.row,q.column))}}},C.prototype.gotoLine=function(b,T,I){this.selection.clearSelection(),this.session.unfold({row:b-1,column:T||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(b-1,T||0),this.isRowFullyVisible(b-1)||this.scrollToLine(b-1,!0,I)},C.prototype.navigateTo=function(b,T){this.selection.moveTo(b,T)},C.prototype.navigateUp=function(b){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var T=this.selection.anchor.getPosition();return this.moveCursorToPosition(T)}this.selection.clearSelection(),this.selection.moveCursorBy(-b||-1,0)},C.prototype.navigateDown=function(b){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var T=this.selection.anchor.getPosition();return this.moveCursorToPosition(T)}this.selection.clearSelection(),this.selection.moveCursorBy(b||1,0)},C.prototype.navigateLeft=function(b){if(this.selection.isEmpty())for(b=b||1;b--;)this.selection.moveCursorLeft();else{var T=this.getSelectionRange().start;this.moveCursorToPosition(T)}this.clearSelection()},C.prototype.navigateRight=function(b){if(this.selection.isEmpty())for(b=b||1;b--;)this.selection.moveCursorRight();else{var T=this.getSelectionRange().end;this.moveCursorToPosition(T)}this.clearSelection()},C.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},C.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},C.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},C.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},C.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},C.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},C.prototype.replace=function(b,T){T&&this.$search.set(T);var I=this.$search.find(this.session),R=0;return I&&(this.$tryReplace(I,b)&&(R=1),this.selection.setSelectionRange(I),this.renderer.scrollSelectionIntoView(I.start,I.end)),R},C.prototype.replaceAll=function(b,T){T&&this.$search.set(T);var I=this.$search.findAll(this.session),R=0;if(!I.length)return R;var N=this.getSelectionRange();this.selection.moveTo(0,0);for(var P=I.length-1;P>=0;--P)this.$tryReplace(I[P],b)&&R++;return this.selection.setSelectionRange(N),R},C.prototype.$tryReplace=function(b,T){var I=this.session.getTextRange(b);return T=this.$search.replace(I,T),T!==null?(b.end=this.session.replace(b,T),b):null},C.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},C.prototype.find=function(b,T,I){T||(T={}),typeof b=="string"||b instanceof RegExp?T.needle=b:typeof b=="object"&&p.mixin(T,b);var R=this.selection.getRange();T.needle==null&&(b=this.session.getTextRange(R)||this.$search.$options.needle,b||(R=this.session.getWordRange(R.start.row,R.start.column),b=this.session.getTextRange(R)),this.$search.set({needle:b})),this.$search.set(T),T.start||this.$search.set({start:R});var N=this.$search.find(this.session);if(T.preventScroll)return N;if(N)return this.revealRange(N,I),N;T.backwards?R.start=R.end:R.end=R.start,this.selection.setRange(R)},C.prototype.findNext=function(b,T){this.find({skipCurrent:!0,backwards:!1},b,T)},C.prototype.findPrevious=function(b,T){this.find(b,{skipCurrent:!0,backwards:!0},T)},C.prototype.revealRange=function(b,T){this.session.unfold(b),this.selection.setSelectionRange(b);var I=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(b.start,b.end,.5),T!==!1&&this.renderer.animateScrolling(I)},C.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},C.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},C.prototype.destroy=function(){this.destroyed=!0,this.$toDestroy&&(this.$toDestroy.forEach(function(b){b.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()},C.prototype.setAutoScrollEditorIntoView=function(b){if(b){var T,I=this,R=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var N=this.$scrollAnchor;N.style.cssText="position:absolute",this.container.insertBefore(N,this.container.firstChild);var P=this.on("changeSelection",function(){R=!0}),B=this.renderer.on("beforeRender",function(){R&&(T=I.renderer.container.getBoundingClientRect())}),V=this.renderer.on("afterRender",function(){if(R&&T&&(I.isFocused()||I.searchBox&&I.searchBox.isFocused())){var W=I.renderer,z=W.$cursorLayer.$pixelPos,U=W.layerConfig,G=z.top-U.offset;z.top>=0&&G+T.top<0?R=!0:z.top<U.height&&z.top+T.top+U.lineHeight>window.innerHeight?R=!1:R=null,R!=null&&(N.style.top=G+"px",N.style.left=z.left+"px",N.style.height=U.lineHeight+"px",N.scrollIntoView(R)),R=T=null}});this.setAutoScrollEditorIntoView=function(W){W||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",P),this.renderer.off("afterRender",V),this.renderer.off("beforeRender",B))}}},C.prototype.$resetCursorStyle=function(){var b=this.$cursorStyle||"ace",T=this.renderer.$cursorLayer;T&&(T.setSmoothBlinking(/smooth/.test(b)),T.isBlinking=!this.$readOnly&&b!="wide",d.setCssClass(T.element,"ace_slim-cursors",/slim/.test(b)))},C.prototype.prompt=function(b,T,I){var R=this;E.loadModule("ace/ext/prompt",function(N){N.prompt(R,b,T,I)})},C})();x.$uid=0,x.prototype.curOp=null,x.prototype.prevOp={},x.prototype.$mergeableCommands=["backspace","del","insertstring"],x.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],p.implement(x.prototype,g),E.defineOptions(x.prototype,"editor",{selectionStyle:{set:function(C){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:C})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(C){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(C){var b=this;if(this.textInput.setReadOnly(C),!this.destroyed){this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(I){var R=!1;if(I&&I.type=="keydown"){if(I&&I.key&&!I.ctrlKey&&!I.metaKey&&(I.key==" "&&I.preventDefault(),R=I.key.length==1),!R)return}else I&&I.type!=="exec"&&(R=!0);if(R){b.hoverTooltip||(b.hoverTooltip=new F);var N=d.createElement("div");N.textContent=S("editor.tooltip.disable-editing","Editing is disabled"),b.hoverTooltip.isOpen||b.hoverTooltip.showForRange(b,b.getSelectionRange(),N)}else b.hoverTooltip&&b.hoverTooltip.isOpen&&b.hoverTooltip.hide()});var T=this.textInput.getElement();C?(_.addListener(T,"keydown",this.$readOnlyCallback,this),this.commands.on("exec",this.$readOnlyCallback),this.commands.on("commandUnavailable",this.$readOnlyCallback)):(_.removeListener(T,"keydown",this.$readOnlyCallback),this.commands.off("exec",this.$readOnlyCallback),this.commands.off("commandUnavailable",this.$readOnlyCallback),this.hoverTooltip&&(this.hoverTooltip.destroy(),this.hoverTooltip=null))}},initialValue:!1},copyWithEmptySelection:{set:function(C){this.textInput.setCopyWithEmptySelection(C)},initialValue:!1},cursorStyle:{set:function(C){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(C){this.setAutoScrollEditorIntoView(C)}},keyboardHandler:{set:function(C){this.setKeyboardHandler(C)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(C){this.session.setValue(C)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(C){this.setSession(C)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(C){this.renderer.$gutterLayer.setShowLineNumbers(C),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),C&&this.$relativeLineNumbers?$.attach(this):$.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(C){this.$showLineNumbers&&C?$.attach(this):$.detach(this)}},placeholder:{set:function(C){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var b=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(b&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),d.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!b&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),d.addCssClass(this.container,"ace_hasPlaceholder");var T=d.createElement("div");T.className="ace_placeholder",T.textContent=this.$placeholder||"",this.renderer.placeholderNode=T,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!b&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(C){var b={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(R){R.blur(),R.renderer.scroller.focus()},readOnly:!0},T=function(R){if(R.target==this.renderer.scroller&&R.keyCode===D.enter){R.preventDefault();var N=this.getCursorPosition().row;this.isRowVisible(N)||this.scrollToLine(N,!0,!0),this.focus()}},I;C?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(c.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",S("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",S("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",T.bind(this)),this.commands.addCommand(b),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",S("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",S("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),I||(I=new m(this)),I.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",T.bind(this)),this.commands.removeCommand(b),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),I&&I.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(C){this.$textInputAriaLabel=C},initialValue:""},enableMobileMenu:{set:function(C){this.$enableMobileMenu=C},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var $={getText:function(C,b){return(Math.abs(C.selection.lead.row-b)||b+1+(b<9?"·":""))+""},getWidth:function(C,b,T){return Math.max(b.toString().length,(T.lastRow+1).toString().length,2)*T.characterWidth},update:function(C,b){b.renderer.$loop.schedule(b.renderer.CHANGE_GUTTER)},attach:function(C){C.renderer.$gutterLayer.$renderer=this,C.on("changeSelection",this.update),this.update(null,C)},detach:function(C){C.renderer.$gutterLayer.$renderer==this&&(C.renderer.$gutterLayer.$renderer=null),C.off("changeSelection",this.update),this.update(null,C)}};l.Editor=x}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(n,l,y){var a=n("../lib/dom"),p=(function(){function d(s,c){this.element=s,this.canvasHeight=c||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return d.prototype.moveContainer=function(s){a.translate(this.element,0,-(s.firstRowScreen*s.lineHeight%this.canvasHeight)-s.offset*this.$offsetCoefficient)},d.prototype.pageChanged=function(s,c){return Math.floor(s.firstRowScreen*s.lineHeight/this.canvasHeight)!==Math.floor(c.firstRowScreen*c.lineHeight/this.canvasHeight)},d.prototype.computeLineTop=function(s,c,e){var i=c.firstRowScreen*c.lineHeight,o=Math.floor(i/this.canvasHeight),h=e.documentToScreenRow(s,0)*c.lineHeight;return h-o*this.canvasHeight},d.prototype.computeLineHeight=function(s,c,e){return c.lineHeight*e.getRowLineCount(s)},d.prototype.getLength=function(){return this.cells.length},d.prototype.get=function(s){return this.cells[s]},d.prototype.shift=function(){this.$cacheCell(this.cells.shift())},d.prototype.pop=function(){this.$cacheCell(this.cells.pop())},d.prototype.push=function(s){if(Array.isArray(s)){this.cells.push.apply(this.cells,s);for(var c=a.createFragment(this.element),e=0;e<s.length;e++)c.appendChild(s[e].element);this.element.appendChild(c)}else this.cells.push(s),this.element.appendChild(s.element)},d.prototype.unshift=function(s){if(Array.isArray(s)){this.cells.unshift.apply(this.cells,s);for(var c=a.createFragment(this.element),e=0;e<s.length;e++)c.appendChild(s[e].element);this.element.firstChild?this.element.insertBefore(c,this.element.firstChild):this.element.appendChild(c)}else this.cells.unshift(s),this.element.insertAdjacentElement("afterbegin",s.element)},d.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},d.prototype.$cacheCell=function(s){s&&(s.element.remove(),this.cellCache.push(s))},d.prototype.createCell=function(s,c,e,i){var o=this.cellCache.pop();if(!o){var h=a.createElement("div");i&&i(h),this.element.appendChild(h),o={element:h,text:"",row:s}}return o.row=s,o},d})();l.Lines=p}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],function(n,l,y){var a=n("../lib/dom"),p=n("../lib/oop"),d=n("../lib/lang"),s=n("../lib/event_emitter").EventEmitter,c=n("./lines").Lines,e=n("../config").nls,i=(function(){function h(r){this.$showCursorMarker=null,this.element=a.createElement("div"),this.element.className="ace_layer ace_gutter-layer",r.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 h.prototype.setSession=function(r){this.session&&this.session.off("change",this.$updateAnnotations),this.session=r,r&&r.on("change",this.$updateAnnotations)},h.prototype.addGutterDecoration=function(r,u){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(r,u)},h.prototype.removeGutterDecoration=function(r,u){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(r,u)},h.prototype.setAnnotations=function(r){this.$annotations=[];for(var u=0;u<r.length;u++){var f=r[u],g=f.row,v=this.$annotations[g];v||(v=this.$annotations[g]={text:[],type:[],displayText:[]});var A=f.text,E=f.text,w=f.type;A=A?d.escapeHTML(A):f.html||"",E=E||f.html||"",v.text.indexOf(A)===-1&&(v.text.push(A),v.type.push(w),v.displayText.push(E));var m=f.className;m?v.className=m:w==="error"?v.className=" ace_error":w==="security"&&!/\bace_error\b/.test(v.className)?v.className=" ace_security":w==="warning"&&!/\bace_(error|security)\b/.test(v.className)?v.className=" ace_warning":w==="info"&&!v.className?v.className=" ace_info":w==="hint"&&!v.className&&(v.className=" ace_hint")}},h.prototype.$updateAnnotations=function(r){if(this.$annotations.length){var u=r.start.row,f=r.end.row-u;if(f!==0)if(r.action=="remove")this.$annotations.splice(u,f+1,null);else{var g=new Array(f+1);g.unshift(u,1),this.$annotations.splice.apply(this.$annotations,g)}}},h.prototype.update=function(r){this.config=r;var u=this.session,f=r.firstRow,g=Math.min(r.lastRow+r.gutterOffset,u.getLength()-1);this.oldLastRow=g,this.config=r,this.$lines.moveContainer(r),this.$updateCursorRow();for(var v=u.getNextFoldLine(f),A=v?v.start.row:1/0,E=null,w=-1,m=f;;){if(m>A&&(m=v.end.row+1,v=u.getNextFoldLine(m,v),A=v?v.start.row:1/0),m>g){for(;this.$lines.getLength()>w+1;)this.$lines.pop();break}E=this.$lines.get(++w),E?E.row=m:(E=this.$lines.createCell(m,r,this.session,o),this.$lines.push(E)),this.$renderCell(E,r,v,m),m++}this._signal("afterRender"),this.$updateGutterWidth(r),this.$showCursorMarker&&this.$highlightGutterLine&&this.$updateCursorMarker()},h.prototype.$updateGutterWidth=function(r){var u=this.session,f=u.gutterRenderer||this.$renderer,g=u.$firstLineNumber,v=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||u.$useWrapMode)&&(v=u.getLength()+g-1);var A=f?f.getWidth(u,v,r):v.toString().length*r.characterWidth,E=this.$padding||this.$computePadding();A+=E.left+E.right,A!==this.gutterWidth&&!isNaN(A)&&(this.gutterWidth=A,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",A))},h.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var r=this.session.selection.getCursor();this.$cursorRow!==r.row&&(this.$cursorRow=r.row)}},h.prototype.updateLineHighlight=function(){if(this.$showCursorMarker&&this.$updateCursorMarker(),!!this.$highlightGutterLine){var r=this.session.selection.cursor.row;if(this.$cursorRow=r,!(this.$cursorCell&&this.$cursorCell.row==r)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var u=this.$lines.cells;this.$cursorCell=null;for(var f=0;f<u.length;f++){var g=u[f];if(g.row>=this.$cursorRow){if(g.row>this.$cursorRow){var v=this.session.getFoldLine(this.$cursorRow);if(f>0&&v&&v.start.row==u[f-1].row)g=u[f-1];else break}g.element.className="ace_gutter-active-line "+g.element.className,this.$cursorCell=g;break}}}}},h.prototype.$updateCursorMarker=function(){if(this.session){var r=this.session;this.$highlightElement||(this.$highlightElement=a.createElement("div"),this.$highlightElement.className="ace_gutter-cursor",this.$highlightElement.style.pointerEvents="none",this.element.appendChild(this.$highlightElement));var u=r.selection.cursor,f=this.config,g=this.$lines,v=f.firstRowScreen*f.lineHeight,A=Math.floor(v/g.canvasHeight),E=r.documentToScreenRow(u)*f.lineHeight,w=E-A*g.canvasHeight;a.setStyle(this.$highlightElement.style,"height",f.lineHeight+"px"),a.setStyle(this.$highlightElement.style,"top",w+"px")}},h.prototype.scrollLines=function(r){var u=this.config;if(this.config=r,this.$updateCursorRow(),this.$lines.pageChanged(u,r))return this.update(r);this.$lines.moveContainer(r);var f=Math.min(r.lastRow+r.gutterOffset,this.session.getLength()-1),g=this.oldLastRow;if(this.oldLastRow=f,!u||g<r.firstRow)return this.update(r);if(f<u.firstRow)return this.update(r);if(u.firstRow<r.firstRow)for(var v=this.session.getFoldedRowCount(u.firstRow,r.firstRow-1);v>0;v--)this.$lines.shift();if(g>f)for(var v=this.session.getFoldedRowCount(f+1,g);v>0;v--)this.$lines.pop();r.firstRow<u.firstRow&&this.$lines.unshift(this.$renderLines(r,r.firstRow,u.firstRow-1)),f>g&&this.$lines.push(this.$renderLines(r,g+1,f)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(r)},h.prototype.$renderLines=function(r,u,f){for(var g=[],v=u,A=this.session.getNextFoldLine(v),E=A?A.start.row:1/0;v>E&&(v=A.end.row+1,A=this.session.getNextFoldLine(v,A),E=A?A.start.row:1/0),!(v>f);){var w=this.$lines.createCell(v,r,this.session,o);this.$renderCell(w,r,A,v),g.push(w),v++}return g},h.prototype.$renderCell=function(r,u,f,g){var v=r.element,A=this.session,E=v.childNodes[0],w=v.childNodes[1],m=v.childNodes[2],S=v.childNodes[3],k=m.firstChild,D=A.$firstLineNumber,_=A.$breakpoints,F=A.$decorations,x=A.gutterRenderer||this.$renderer,$=this.$showFoldWidgets&&A.foldWidgets,C=f?f.start.row:Number.MAX_VALUE,b=u.lineHeight+"px",T=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",I=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",R=(x?x.getText(A,g):g+D).toString();if(this.$highlightGutterLine&&(g==this.$cursorRow||f&&g<this.$cursorRow&&g>=C&&this.$cursorRow<=f.end.row)&&(T+="ace_gutter-active-line ",this.$cursorCell!=r&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=r)),_[g]&&(T+=_[g]),F[g]&&(T+=F[g]),this.$annotations[g]&&g!==C&&(T+=this.$annotations[g].className),$){var N=$[g];N==null&&(N=$[g]=A.getFoldWidget(g))}if(N){var P="ace_fold-widget ace_"+N,B=N=="start"&&g==C&&g<f.end.row;if(B){P+=" ace_closed";for(var V="",W=!1,z=g+1;z<=f.end.row;z++)if(this.$annotations[z]){if(this.$annotations[z].className===" ace_error"){W=!0,V=" ace_error_fold";break}this.$annotations[z].className===" ace_security"?(W=!0,V=" ace_security_fold"):this.$annotations[z].className===" ace_warning"&&V!==" ace_security_fold"&&(W=!0,V=" ace_warning_fold")}T+=V}else P+=" ace_open";w.className!=P&&(w.className=P),a.setStyle(w.style,"height",b),a.setStyle(w.style,"display","inline-block"),w.setAttribute("role","button"),w.setAttribute("tabindex","-1");var U=A.getFoldWidgetRange(g);U?w.setAttribute("aria-label",e("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[U.start.row+1,U.end.row+1])):f?w.setAttribute("aria-label",e("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[f.start.row+1,f.end.row+1])):w.setAttribute("aria-label",e("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[g+1])),B?(w.setAttribute("aria-expanded","false"),w.setAttribute("title",e("gutter.code-folding.closed.title","Unfold code"))):(w.setAttribute("aria-expanded","true"),w.setAttribute("title",e("gutter.code-folding.open.title","Fold code")))}else w&&(a.setStyle(w.style,"display","none"),w.setAttribute("tabindex","0"),w.removeAttribute("role"),w.removeAttribute("aria-label"));var G=this.session.$gutterCustomWidgets[g];if(G?this.$addCustomWidget(g,G,r):S&&this.$removeCustomWidget(g,r),W&&this.$showFoldedAnnotations){m.className="ace_gutter_annotation",k.className=I,k.className+=V,a.setStyle(k.style,"height",b),a.setStyle(m.style,"display","block"),a.setStyle(m.style,"height",b);var Y;switch(V){case" ace_error_fold":Y=e("gutter.annotation.aria-label.error","Error, read annotations row $0",[R]);break;case" ace_security_fold":Y=e("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[R]);break;case" ace_warning_fold":Y=e("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[R]);break}m.setAttribute("aria-label",Y),m.setAttribute("tabindex","-1"),m.setAttribute("role","button")}else if(this.$annotations[g]){m.className="ace_gutter_annotation",k.className=I,this.$useSvgGutterIcons?k.className+=this.$annotations[g].className:v.classList.add(this.$annotations[g].className.replace(" ","")),a.setStyle(k.style,"height",b),a.setStyle(m.style,"display","block"),a.setStyle(m.style,"height",b);var Y;switch(this.$annotations[g].className){case" ace_error":Y=e("gutter.annotation.aria-label.error","Error, read annotations row $0",[R]);break;case" ace_security":Y=e("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[R]);break;case" ace_warning":Y=e("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[R]);break;case" ace_info":Y=e("gutter.annotation.aria-label.info","Info, read annotations row $0",[R]);break;case" ace_hint":Y=e("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[R]);break}m.setAttribute("aria-label",Y),m.setAttribute("tabindex","-1"),m.setAttribute("role","button")}else a.setStyle(m.style,"display","none"),m.removeAttribute("aria-label"),m.removeAttribute("role"),m.setAttribute("tabindex","0");return R!==E.data&&(E.data=R),v.className!=T&&(v.className=T),a.setStyle(r.element.style,"height",this.$lines.computeLineHeight(g,u,A)+"px"),a.setStyle(r.element.style,"top",this.$lines.computeLineTop(g,u,A)+"px"),r.text=R,m.style.display==="none"&&w.style.display==="none"&&!G?r.element.setAttribute("aria-hidden",!0):r.element.setAttribute("aria-hidden",!1),r},h.prototype.setHighlightGutterLine=function(r){this.$highlightGutterLine=r,!r&&this.$highlightElement&&(this.$highlightElement.remove(),this.$highlightElement=null)},h.prototype.setShowLineNumbers=function(r){this.$renderer=!r&&{getWidth:function(){return 0},getText:function(){return""}}},h.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},h.prototype.setShowFoldWidgets=function(r){r?a.addCssClass(this.element,"ace_folding-enabled"):a.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=r,this.$padding=null},h.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},h.prototype.$hideFoldWidget=function(r,u){var f=u||this.$getGutterCell(r);if(f&&f.element){var g=f.element.childNodes[1];g&&a.setStyle(g.style,"display","none")}},h.prototype.$showFoldWidget=function(r,u){var f=u||this.$getGutterCell(r);if(f&&f.element){var g=f.element.childNodes[1];g&&this.session.foldWidgets&&this.session.foldWidgets[f.row]&&a.setStyle(g.style,"display","inline-block")}},h.prototype.$getGutterCell=function(r){var u=this.$lines.cells,f=0,g=u.length-1;if(!(r<u[0].row||r>u[g].row)){for(;f<=g;){var v=Math.floor((f+g)/2),A=u[v];if(A.row>r)g=v-1;else if(A.row<r)f=v+1;else return A}return A}},h.prototype.$addCustomWidget=function(r,u,f){var g=u.className,v=u.label,A=u.title,E=u.callbacks;this.session.$gutterCustomWidgets[r]={className:g,label:v,title:A,callbacks:E},this.$hideFoldWidget(r,f);var w=f||this.$getGutterCell(r);if(w&&w.element){var m=w.element.querySelector(".ace_custom-widget");m&&m.remove(),m=a.createElement("span"),m.className="ace_custom-widget ".concat(g),m.setAttribute("tabindex","-1"),m.setAttribute("role","button"),m.setAttribute("aria-label",v),m.setAttribute("title",A),a.setStyle(m.style,"display","inline-block"),a.setStyle(m.style,"height","inherit"),E&&E.onClick&&m.addEventListener("click",function(S){E.onClick(S,r),S.stopPropagation()}),w.element.appendChild(m)}},h.prototype.$removeCustomWidget=function(r,u){delete this.session.$gutterCustomWidgets[r],this.$showFoldWidget(r,u);var f=u||this.$getGutterCell(r);if(f&&f.element){var g=f.element.querySelector(".ace_custom-widget");g&&f.element.removeChild(g)}},h.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var r=a.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(r.borderLeftWidth)||0)+(parseInt(r.paddingLeft)||0)+1,this.$padding.right=(parseInt(r.borderRightWidth)||0)+(parseInt(r.paddingRight)||0),this.$padding},h.prototype.getRegion=function(r){var u=this.$padding||this.$computePadding(),f=this.element.getBoundingClientRect();if(r.x<u.left+f.left)return"markers";if(this.$showFoldWidgets&&r.x>f.right-u.right)return"foldWidgets"},h})();i.prototype.$fixedWidth=!1,i.prototype.$highlightGutterLine=!0,i.prototype.$renderer=void 0,i.prototype.$showLineNumbers=!0,i.prototype.$showFoldWidgets=!0,p.implement(i.prototype,s);function o(h){var r=document.createTextNode("");h.appendChild(r);var u=a.createElement("span");h.appendChild(u);var f=a.createElement("span");h.appendChild(f);var g=a.createElement("span");return f.appendChild(g),h}l.Gutter=i}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(n,l,y){var a=n("../range").Range,p=n("../lib/dom"),d=(function(){function c(e){this.element=p.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}return c.prototype.setPadding=function(e){this.$padding=e},c.prototype.setSession=function(e){this.session=e},c.prototype.setMarkers=function(e){this.markers=e},c.prototype.elt=function(e,i){var o=this.i!=-1&&this.element.childNodes[this.i];o?this.i++:(o=document.createElement("div"),this.element.appendChild(o),this.i=-1),o.style.cssText=i,o.className=e},c.prototype.update=function(e){if(e){this.config=e,this.i=0;var i;for(var o in this.markers){var h=this.markers[o];if(!h.range){h.update(i,this,this.session,e);continue}var r=h.range.clipRows(e.firstRow,e.lastRow);if(!r.isEmpty())if(r=r.toScreenRange(this.session),h.renderer){var u=this.$getTop(r.start.row,e),f=this.$padding+r.start.column*e.characterWidth;h.renderer(i,r,f,u,e)}else h.type=="fullLine"?this.drawFullLineMarker(i,r,h.clazz,e):h.type=="screenLine"?this.drawScreenLineMarker(i,r,h.clazz,e):r.isMultiLine()?h.type=="text"?this.drawTextMarker(i,r,h.clazz,e):this.drawMultiLineMarker(i,r,h.clazz,e):this.drawSingleLineMarker(i,r,h.clazz+" ace_start ace_br15",e)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},c.prototype.$getTop=function(e,i){return(e-i.firstRowScreen)*i.lineHeight},c.prototype.drawTextMarker=function(e,i,o,h,r){for(var u=this.session,f=i.start.row,g=i.end.row,v=f,A=0,E=0,w=u.getScreenLastRowColumn(v),m=new a(v,i.start.column,v,E);v<=g;v++)m.start.row=m.end.row=v,m.start.column=v==f?i.start.column:u.getRowWrapIndent(v),m.end.column=w,A=E,E=w,w=v+1<g?u.getScreenLastRowColumn(v+1):v==g?0:i.end.column,this.drawSingleLineMarker(e,m,o+(v==f?" ace_start":"")+" ace_br"+s(v==f||v==f+1&&i.start.column,A<E,E>w,v==g),h,v==g?0:1,r)},c.prototype.drawMultiLineMarker=function(e,i,o,h,r){var u=this.$padding,f=h.lineHeight,g=this.$getTop(i.start.row,h),v=u+i.start.column*h.characterWidth;if(r=r||"",this.session.$bidiHandler.isBidiRow(i.start.row)){var A=i.clone();A.end.row=A.start.row,A.end.column=this.session.getLine(A.start.row).length,this.drawBidiSingleLineMarker(e,A,o+" ace_br1 ace_start",h,null,r)}else this.elt(o+" ace_br1 ace_start","height:"+f+"px;right:"+u+"px;top:"+g+"px;left:"+v+"px;"+(r||""));if(this.session.$bidiHandler.isBidiRow(i.end.row)){var A=i.clone();A.start.row=A.end.row,A.start.column=0,this.drawBidiSingleLineMarker(e,A,o+" ace_br12",h,null,r)}else{g=this.$getTop(i.end.row,h);var E=i.end.column*h.characterWidth;this.elt(o+" ace_br12","height:"+f+"px;width:"+E+"px;top:"+g+"px;left:"+u+"px;"+(r||""))}if(f=(i.end.row-i.start.row-1)*h.lineHeight,!(f<=0)){g=this.$getTop(i.start.row+1,h);var w=(i.start.column?1:0)|(i.end.column?0:8);this.elt(o+(w?" ace_br"+w:""),"height:"+f+"px;right:"+u+"px;top:"+g+"px;left:"+u+"px;"+(r||""))}},c.prototype.drawSingleLineMarker=function(e,i,o,h,r,u){if(this.session.$bidiHandler.isBidiRow(i.start.row))return this.drawBidiSingleLineMarker(e,i,o,h,r,u);var f=h.lineHeight,g=(i.end.column+(r||0)-i.start.column)*h.characterWidth,v=this.$getTop(i.start.row,h),A=this.$padding+i.start.column*h.characterWidth;this.elt(o,"height:"+f+"px;width:"+g+"px;top:"+v+"px;left:"+A+"px;"+(u||""))},c.prototype.drawBidiSingleLineMarker=function(e,i,o,h,r,u){var f=h.lineHeight,g=this.$getTop(i.start.row,h),v=this.$padding,A=this.session.$bidiHandler.getSelections(i.start.column,i.end.column);A.forEach(function(E){this.elt(o,"height:"+f+"px;width:"+(E.width+(r||0))+"px;top:"+g+"px;left:"+(v+E.left)+"px;"+(u||""))},this)},c.prototype.drawFullLineMarker=function(e,i,o,h,r){var u=this.$getTop(i.start.row,h),f=h.lineHeight;i.start.row!=i.end.row&&(f+=this.$getTop(i.end.row,h)-u),this.elt(o,"height:"+f+"px;top:"+u+"px;left:0;right:0;"+(r||""))},c.prototype.drawScreenLineMarker=function(e,i,o,h,r){var u=this.$getTop(i.start.row,h),f=h.lineHeight;this.elt(o,"height:"+f+"px;top:"+u+"px;left:0;right:0;"+(r||""))},c})();d.prototype.$padding=0;function s(c,e,i,o){return(c?1:0)|(e?2:0)|(i?4:0)|(o?8:0)}l.Marker=d}),ace.define("ace/layer/text_util",["require","exports","module"],function(n,l,y){var a=new Set(["text","rparen","lparen"]);l.isTextToken=function(p){return a.has(p)}}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(n,l,y){var a=n("../lib/oop"),p=n("../lib/dom"),d=n("../lib/lang"),s=n("./lines").Lines,c=n("../lib/event_emitter").EventEmitter,e=n("../config").nls,i=n("./text_util").isTextToken,o=(function(){function h(r){this.dom=p,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",r.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new s(this.element)}return h.prototype.$updateEolChar=function(){var r=this.session.doc,u=r.getNewLineCharacter()==`
|
|
230
|
-
`&&r.getNewLineMode()!="windows",f=u?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=f)return this.EOL_CHAR=f,!0},h.prototype.setPadding=function(r){this.$padding=r,this.element.style.margin="0 "+r+"px"},h.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},h.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},h.prototype.$setFontMetrics=function(r){this.$fontMetrics=r,this.$fontMetrics.on("changeCharacterSize",function(u){this._signal("changeCharacterSize",u)}.bind(this)),this.$pollSizeChanges()},h.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},h.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},h.prototype.setSession=function(r){this.session=r,r&&this.$computeTabString()},h.prototype.setShowInvisibles=function(r){return this.showInvisibles==r?!1:(this.showInvisibles=r,typeof r=="string"?(this.showSpaces=/tab/i.test(r),this.showTabs=/space/i.test(r),this.showEOL=/eol/i.test(r)):this.showSpaces=this.showTabs=this.showEOL=r,this.$computeTabString(),!0)},h.prototype.setDisplayIndentGuides=function(r){return this.displayIndentGuides==r?!1:(this.displayIndentGuides=r,this.$computeTabString(),!0)},h.prototype.setHighlightIndentGuides=function(r){return this.$highlightIndentGuides===r?!1:(this.$highlightIndentGuides=r,r)},h.prototype.$computeTabString=function(){var r=this.session.getTabSize();this.tabSize=r;for(var u=this.$tabStrings=[0],f=1;f<r+1;f++)if(this.showTabs){var g=this.dom.createElement("span");g.className="ace_invisible ace_invisible_tab",g.textContent=d.stringRepeat(this.TAB_CHAR,f),u.push(g)}else u.push(this.dom.createTextNode(d.stringRepeat(" ",f),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var v="ace_indent-guide",A=this.showSpaces?" ace_invisible ace_invisible_space":"",E=this.showSpaces?d.stringRepeat(this.SPACE_CHAR,this.tabSize):d.stringRepeat(" ",this.tabSize),w=this.showTabs?" ace_invisible ace_invisible_tab":"",m=this.showTabs?d.stringRepeat(this.TAB_CHAR,this.tabSize):E,g=this.dom.createElement("span");g.className=v+A,g.textContent=E,this.$tabStrings[" "]=g;var g=this.dom.createElement("span");g.className=v+w,g.textContent=m,this.$tabStrings[" "]=g}},h.prototype.updateLines=function(r,u,f){if(this.config.lastRow!=r.lastRow||this.config.firstRow!=r.firstRow)return this.update(r);this.config=r;for(var g=Math.max(u,r.firstRow),v=Math.min(f,r.lastRow),A=this.element.childNodes,E=0,m=r.firstRow;m<g;m++){var S=this.session.getFoldLine(m);if(S)if(S.containsRow(g)){g=S.start.row;break}else m=S.end.row;E++}for(var w=!1,m=g,S=this.session.getNextFoldLine(m),k=S?S.start.row:1/0;m>k&&(m=S.end.row+1,S=this.session.getNextFoldLine(m,S),k=S?S.start.row:1/0),!(m>v);){var D=A[E++];if(D){this.dom.removeChildren(D),this.$renderLine(D,m,m==k?S:!1),w&&(D.style.top=this.$lines.computeLineTop(m,r,this.session)+"px");var _=r.lineHeight*this.session.getRowLength(m)+"px";D.style.height!=_&&(w=!0,D.style.height=_)}m++}if(w)for(;E<this.$lines.cells.length;){var F=this.$lines.cells[E++];F.element.style.top=this.$lines.computeLineTop(F.row,r,this.session)+"px"}},h.prototype.scrollLines=function(r){var u=this.config;if(this.config=r,this.$lines.pageChanged(u,r))return this.update(r);this.$lines.moveContainer(r);var f=r.lastRow,g=u?u.lastRow:-1;if(!u||g<r.firstRow)return this.update(r);if(f<u.firstRow)return this.update(r);if(!u||u.lastRow<r.firstRow)return this.update(r);if(r.lastRow<u.firstRow)return this.update(r);if(u.firstRow<r.firstRow)for(var v=this.session.getFoldedRowCount(u.firstRow,r.firstRow-1);v>0;v--)this.$lines.shift();if(u.lastRow>r.lastRow)for(var v=this.session.getFoldedRowCount(r.lastRow+1,u.lastRow);v>0;v--)this.$lines.pop();r.firstRow<u.firstRow&&this.$lines.unshift(this.$renderLinesFragment(r,r.firstRow,u.firstRow-1)),r.lastRow>u.lastRow&&this.$lines.push(this.$renderLinesFragment(r,u.lastRow+1,r.lastRow)),this.$highlightIndentGuide()},h.prototype.$renderLinesFragment=function(r,u,f){for(var g=[],v=u,A=this.session.getNextFoldLine(v),E=A?A.start.row:1/0;v>E&&(v=A.end.row+1,A=this.session.getNextFoldLine(v,A),E=A?A.start.row:1/0),!(v>f);){var w=this.$lines.createCell(v,r,this.session),m=w.element;this.dom.removeChildren(m),p.setStyle(m.style,"height",this.$lines.computeLineHeight(v,r,this.session)+"px"),p.setStyle(m.style,"top",this.$lines.computeLineTop(v,r,this.session)+"px"),this.$renderLine(m,v,v==E?A:!1),this.$useLineGroups()?m.className="ace_line_group":m.className="ace_line",g.push(w),v++}return g},h.prototype.update=function(r){this.$lines.moveContainer(r),this.config=r;for(var u=r.firstRow,f=r.lastRow,g=this.$lines;g.getLength();)g.pop();g.push(this.$renderLinesFragment(r,u,f))},h.prototype.$renderToken=function(r,u,f,g){for(var v=this,A=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,E=this.dom.createFragment(this.element),w,m=0;w=A.exec(g);){var S=w[1],k=w[2],D=w[3],_=w[4],F=w[5];if(!(!v.showSpaces&&k)){var x=m!=w.index?g.slice(m,w.index):"";if(m=w.index+w[0].length,x&&E.appendChild(this.dom.createTextNode(x,this.element)),S){var $=v.session.getScreenTabSize(u+w.index),C=v.$tabStrings[$].cloneNode(!0);C.charCount=1,E.appendChild(C),u+=$-1}else if(k)if(v.showSpaces){var b=this.dom.createElement("span");b.className="ace_invisible ace_invisible_space",b.textContent=d.stringRepeat(v.SPACE_CHAR,k.length),E.appendChild(b)}else E.appendChild(this.dom.createTextNode(k,this.element));else if(D){var b=this.dom.createElement("span");b.className="ace_invisible ace_invisible_space ace_invalid",b.textContent=d.stringRepeat(v.SPACE_CHAR,D.length),E.appendChild(b)}else if(_){u+=1;var b=this.dom.createElement("span");b.style.width=v.config.characterWidth*2+"px",b.className=v.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",b.textContent=v.showSpaces?v.SPACE_CHAR:_,E.appendChild(b)}else if(F){u+=1;var b=this.dom.createElement("span");b.style.width=v.config.characterWidth*2+"px",b.className="ace_cjk",b.textContent=F,E.appendChild(b)}}}if(E.appendChild(this.dom.createTextNode(m?g.slice(m):g,this.element)),i(f.type))r.appendChild(E);else{var T="ace_"+f.type.replace(/\./g," ace_"),b=this.dom.createElement("span");f.type=="fold"&&(b.style.width=f.value.length*this.config.characterWidth+"px",b.setAttribute("title",e("inline-fold.closed.title","Unfold code"))),b.className=T,b.appendChild(E),r.appendChild(b)}return u+g.length},h.prototype.renderIndentGuide=function(r,u,f){var g=u.search(this.$indentGuideRe);if(g<=0||g>=f)return u;if(u[0]==" "){g-=g%this.tabSize;for(var v=g/this.tabSize,A=0;A<v;A++)r.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(g)}else if(u[0]==" "){for(var A=0;A<g;A++)r.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(g)}return this.$highlightIndentGuide(),u},h.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var r=this.session.doc.$lines;if(r){var u=this.session.selection.getCursor(),f=/^\s*/.exec(this.session.doc.getLine(u.row))[0].length,g=Math.floor(f/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:g,start:u.row};var v=this.session.$bracketHighlight;if(v){for(var A=this.session.$bracketHighlight.ranges,E=0;E<A.length;E++)if(u.row!==A[E].start.row){this.$highlightIndentGuideMarker.end=A[E].start.row+1,u.row>A[E].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&r[u.row]!==""&&u.column===r[u.row].length){this.$highlightIndentGuideMarker.dir=1;for(var E=u.row+1;E<r.length;E++){var w=r[E],m=/^\s*/.exec(w)[0].length;if(w!==""&&(this.$highlightIndentGuideMarker.end=E,m<=f))break}}this.$renderHighlightIndentGuide()}}},h.prototype.$clearActiveIndentGuide=function(){for(var r=this.element.querySelectorAll(".ace_indent-guide-active"),u=0;u<r.length;u++)r[u].classList.remove("ace_indent-guide-active")},h.prototype.$setIndentGuideActive=function(r,u){var f=this.session.doc.getLine(r.row);if(f!==""){var g=r.element;if(r.element.classList&&r.element.classList.contains("ace_line_group"))if(r.element.childNodes.length>0)g=r.element.childNodes[0];else return;var v=g.childNodes;if(v){var A=v[u-1];A&&A.classList&&A.classList.contains("ace_indent-guide")&&A.classList.add("ace_indent-guide-active")}}},h.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var r=this.$lines.cells;this.$clearActiveIndentGuide();var u=this.$highlightIndentGuideMarker.indentLevel;if(u!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var f=0;f<r.length;f++){var g=r[f];if(this.$highlightIndentGuideMarker.end&&g.row>=this.$highlightIndentGuideMarker.start+1){if(g.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(g,u)}}else for(var f=r.length-1;f>=0;f--){var g=r[f];if(this.$highlightIndentGuideMarker.end&&g.row<this.$highlightIndentGuideMarker.start){if(g.row<this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(g,u)}}}},h.prototype.$createLineElement=function(r){var u=this.dom.createElement("div");return u.className="ace_line",u.style.height=this.config.lineHeight+"px",u},h.prototype.$renderWrappedLine=function(r,u,f){var g=0,v=0,A=f[0],E=0,w=this.$createLineElement();r.appendChild(w);for(var m=0;m<u.length;m++){var S=u[m],k=S.value;if(m==0&&this.displayIndentGuides){if(g=k.length,k=this.renderIndentGuide(w,k,A),!k)continue;g-=k.length}if(g+k.length<A)E=this.$renderToken(w,E,S,k),g+=k.length;else{for(;g+k.length>=A;){E=this.$renderToken(w,E,S,k.substring(0,A-g)),k=k.substring(A-g),g=A,w=this.$createLineElement(),r.appendChild(w);var D=this.dom.createTextNode(d.stringRepeat(" ",f.indent),this.element);D.charCount=0,w.appendChild(D),v++,E=0,A=f[v]||Number.MAX_VALUE}k.length!=0&&(g+=k.length,E=this.$renderToken(w,E,S,k))}}f[f.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(w,E,null,"",!0)},h.prototype.$renderSimpleLine=function(r,u){for(var f=0,g=0;g<u.length;g++){var v=u[g],A=v.value;if(!(g==0&&this.displayIndentGuides&&(A=this.renderIndentGuide(r,A),!A))){if(f+A.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(r,f,v,A);f=this.$renderToken(r,f,v,A)}}},h.prototype.$renderOverflowMessage=function(r,u,f,g,v){f&&this.$renderToken(r,u,f,g.slice(0,this.MAX_LINE_LENGTH-u));var A=this.dom.createElement("span");A.className="ace_inline_button ace_keyword ace_toggle_wrap",A.textContent=v?"<hide>":"<click to see more...>",r.appendChild(A)},h.prototype.$renderLine=function(r,u,f){if(!f&&f!=!1&&(f=this.session.getFoldLine(u)),f)var g=this.$getFoldLineTokens(u,f);else var g=this.session.getTokens(u);var v=r;if(g.length){var A=this.session.getRowSplitData(u);if(A&&A.length){this.$renderWrappedLine(r,g,A);var v=r.lastChild}else{var v=r;this.$useLineGroups()&&(v=this.$createLineElement(),r.appendChild(v)),this.$renderSimpleLine(v,g)}}else this.$useLineGroups()&&(v=this.$createLineElement(),r.appendChild(v));if(this.showEOL&&v){f&&(u=f.end.row);var E=this.dom.createElement("span");E.className="ace_invisible ace_invisible_eol",E.textContent=u==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,v.appendChild(E)}},h.prototype.$getFoldLineTokens=function(r,u){var f=this.session,g=[];function v(E,w,m){for(var S=0,k=0;k+E[S].value.length<w;)if(k+=E[S].value.length,S++,S==E.length)return;if(k!=w){var D=E[S].value.substring(w-k);D.length>m-w&&(D=D.substring(0,m-w)),g.push({type:E[S].type,value:D}),k=w+D.length,S+=1}for(;k<m&&S<E.length;){var D=E[S].value;D.length+k>m?g.push({type:E[S].type,value:D.substring(0,m-k)}):g.push(E[S]),k+=D.length,S+=1}}var A=f.getTokens(r);return u.walk(function(E,w,m,S,k){E!=null?g.push({type:"fold",value:E}):(k&&(A=f.getTokens(w)),A.length&&v(A,S,m))},u.end.row,this.session.getLine(u.end.row).length),g},h.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},h})();o.prototype.EOF_CHAR="¶",o.prototype.EOL_CHAR_LF="¬",o.prototype.EOL_CHAR_CRLF="¤",o.prototype.EOL_CHAR=o.prototype.EOL_CHAR_LF,o.prototype.TAB_CHAR="—",o.prototype.SPACE_CHAR="·",o.prototype.$padding=0,o.prototype.MAX_LINE_LENGTH=1e4,o.prototype.showInvisibles=!1,o.prototype.showSpaces=!1,o.prototype.showTabs=!1,o.prototype.showEOL=!1,o.prototype.displayIndentGuides=!0,o.prototype.$highlightIndentGuides=!0,o.prototype.$tabStrings=[],o.prototype.destroy={},o.prototype.onChangeTabSize=o.prototype.$computeTabString,a.implement(o.prototype,c),l.Text=o}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(n,l,y){var a=n("../lib/dom"),p=(function(){function d(s){this.element=a.createElement("div"),this.element.className="ace_layer ace_cursor-layer",s.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),a.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return d.prototype.$updateOpacity=function(s){for(var c=this.cursors,e=c.length;e--;)a.setStyle(c[e].style,"opacity",s?"":"0")},d.prototype.$startCssAnimation=function(){for(var s=this.cursors,c=s.length;c--;)s[c].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&a.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},d.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,a.removeCssClass(this.element,"ace_animate-blinking")},d.prototype.setPadding=function(s){this.$padding=s},d.prototype.setSession=function(s){this.session=s},d.prototype.setBlinking=function(s){s!=this.isBlinking&&(this.isBlinking=s,this.restartTimer())},d.prototype.setBlinkInterval=function(s){s!=this.blinkInterval&&(this.blinkInterval=s,this.restartTimer())},d.prototype.setSmoothBlinking=function(s){s!=this.smoothBlinking&&(this.smoothBlinking=s,a.setCssClass(this.element,"ace_smooth-blinking",s),this.$updateCursors(!0),this.restartTimer())},d.prototype.addCursor=function(){var s=a.createElement("div");return s.className="ace_cursor",this.element.appendChild(s),this.cursors.push(s),s},d.prototype.removeCursor=function(){if(this.cursors.length>1){var s=this.cursors.pop();return s.parentNode.removeChild(s),s}},d.prototype.hideCursor=function(){this.isVisible=!1,a.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},d.prototype.showCursor=function(){this.isVisible=!0,a.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},d.prototype.restartTimer=function(){var s=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,a.removeCssClass(this.element,"ace_smooth-blinking")),s(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&a.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),a.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var c=function(){this.timeoutId=setTimeout(function(){s(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){s(!0),c()},this.blinkInterval),c()}},d.prototype.getPixelPosition=function(s,c){if(!this.config||!this.session)return{left:0,top:0};s||(s=this.session.selection.getCursor());var e=this.session.documentToScreenPosition(s),i=this.$padding+(this.session.$bidiHandler.isBidiRow(e.row,s.row)?this.session.$bidiHandler.getPosLeft(e.column):e.column*this.config.characterWidth),o=(e.row-(c?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:i,top:o}},d.prototype.isCursorInView=function(s,c){return s.top>=0&&s.top<c.maxHeight},d.prototype.update=function(s){this.config=s;var c=this.session.$selectionMarkers,e=0,i=0;(c===void 0||c.length===0)&&(c=[{cursor:null}]);for(var e=0,o=c.length;e<o;e++){var h=this.getPixelPosition(c[e].cursor,!0);if(!((h.top>s.height+s.offset||h.top<0)&&e>1)){var r=this.cursors[i++]||this.addCursor(),u=r.style;this.drawCursor?this.drawCursor(r,h,s,c[e],this.session):this.isCursorInView(h,s)?(a.setStyle(u,"display","block"),a.translate(r,h.left,h.top),a.setStyle(u,"width",Math.round(s.characterWidth)+"px"),a.setStyle(u,"height",s.lineHeight+"px")):a.setStyle(u,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var f=this.session.getOverwrite();this.$setOverwrite(f),this.$pixelPos=h,this.restartTimer()},d.prototype.$setOverwrite=function(s){s!=this.overwrite&&(this.overwrite=s,s?a.addCssClass(this.element,"ace_overwrite-cursors"):a.removeCssClass(this.element,"ace_overwrite-cursors"))},d.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},d})();p.prototype.$padding=0,p.prototype.drawCursor=null,l.Cursor=p}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(n,l,y){var a=this&&this.__extends||(function(){var r=function(u,f){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,v){g.__proto__=v}||function(g,v){for(var A in v)Object.prototype.hasOwnProperty.call(v,A)&&(g[A]=v[A])},r(u,f)};return function(u,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");r(u,f);function g(){this.constructor=u}u.prototype=f===null?Object.create(f):(g.prototype=f.prototype,new g)}})(),p=n("./lib/oop"),d=n("./lib/dom"),s=n("./lib/event"),c=n("./lib/event_emitter").EventEmitter,e=32768,i=(function(){function r(u,f){this.element=d.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+f,this.inner=d.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),u.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)}return r.prototype.setVisible=function(u){this.element.style.display=u?"":"none",this.isVisible=u,this.coeff=1},r})();p.implement(i.prototype,c);var o=(function(r){a(u,r);function u(f,g){var v=r.call(this,f,"-v")||this;return v.scrollTop=0,v.scrollHeight=0,g.$scrollbarWidth=v.width=d.scrollbarWidth(f.ownerDocument),v.inner.style.width=v.element.style.width=(v.width||15)+5+"px",v.$minWidth=0,v}return u.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var f=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-f)/(this.coeff-f)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},u.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},u.prototype.setHeight=function(f){this.element.style.height=f+"px"},u.prototype.setScrollHeight=function(f){this.scrollHeight=f,f>e?(this.coeff=e/f,f=e):this.coeff!=1&&(this.coeff=1),this.inner.style.height=f+"px"},u.prototype.setScrollTop=function(f){this.scrollTop!=f&&(this.skipEvent=!0,this.scrollTop=f,this.element.scrollTop=f*this.coeff)},u})(i);o.prototype.setInnerHeight=o.prototype.setScrollHeight;var h=(function(r){a(u,r);function u(f,g){var v=r.call(this,f,"-h")||this;return v.scrollLeft=0,v.height=g.$scrollbarWidth,v.inner.style.height=v.element.style.height=(v.height||15)+5+"px",v}return u.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},u.prototype.getHeight=function(){return this.isVisible?this.height:0},u.prototype.setWidth=function(f){this.element.style.width=f+"px"},u.prototype.setInnerWidth=function(f){this.inner.style.width=f+"px"},u.prototype.setScrollWidth=function(f){this.inner.style.width=f+"px"},u.prototype.setScrollLeft=function(f){this.scrollLeft!=f&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=f)},u})(i);l.ScrollBar=o,l.ScrollBarV=o,l.ScrollBarH=h,l.VScrollBar=o,l.HScrollBar=h}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(n,l,y){var a=this&&this.__extends||(function(){var h=function(r,u){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)Object.prototype.hasOwnProperty.call(g,v)&&(f[v]=g[v])},h(r,u)};return function(r,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");h(r,u);function f(){this.constructor=r}r.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)}})(),p=n("./lib/oop"),d=n("./lib/dom"),s=n("./lib/event"),c=n("./lib/event_emitter").EventEmitter;d.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
|
|
231
|
-
position: absolute;
|
|
232
|
-
background: rgba(128, 128, 128, 0.6);
|
|
233
|
-
-moz-box-sizing: border-box;
|
|
234
|
-
box-sizing: border-box;
|
|
235
|
-
border: 1px solid #bbb;
|
|
236
|
-
border-radius: 2px;
|
|
237
|
-
z-index: 8;
|
|
238
|
-
}
|
|
239
|
-
.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {
|
|
240
|
-
position: absolute;
|
|
241
|
-
z-index: 6;
|
|
242
|
-
background: none;
|
|
243
|
-
overflow: hidden!important;
|
|
244
|
-
}
|
|
245
|
-
.ace_editor>.ace_sb-v {
|
|
246
|
-
z-index: 6;
|
|
247
|
-
right: 0;
|
|
248
|
-
top: 0;
|
|
249
|
-
width: 12px;
|
|
250
|
-
}
|
|
251
|
-
.ace_editor>.ace_sb-v div {
|
|
252
|
-
z-index: 8;
|
|
253
|
-
right: 0;
|
|
254
|
-
width: 100%;
|
|
255
|
-
}
|
|
256
|
-
.ace_editor>.ace_sb-h {
|
|
257
|
-
bottom: 0;
|
|
258
|
-
left: 0;
|
|
259
|
-
height: 12px;
|
|
260
|
-
}
|
|
261
|
-
.ace_editor>.ace_sb-h div {
|
|
262
|
-
bottom: 0;
|
|
263
|
-
height: 100%;
|
|
264
|
-
}
|
|
265
|
-
.ace_editor>.ace_sb_grabbed {
|
|
266
|
-
z-index: 8;
|
|
267
|
-
background: #000;
|
|
268
|
-
}`,"ace_scrollbar.css",!1);var e=(function(){function h(r,u){this.element=d.createElement("div"),this.element.className="ace_sb"+u,this.inner=d.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,r.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return h.prototype.setVisible=function(r){this.element.style.display=r?"":"none",this.isVisible=r,this.coeff=1},h})();p.implement(e.prototype,c);var i=(function(h){a(r,h);function r(u,f){var g=h.call(this,u,"-v")||this;return g.scrollTop=0,g.scrollHeight=0,g.parent=u,g.width=g.VScrollWidth,g.renderer=f,g.inner.style.width=g.element.style.width=(g.width||15)+"px",g.$minWidth=0,g}return r.prototype.onMouseDown=function(u,f){if(u==="mousedown"&&!(s.getButton(f)!==0||f.detail===2)){if(f.target===this.inner){var g=this,v=f.clientY,A=function(_){v=_.clientY},E=function(){clearInterval(k)},w=f.clientY,m=this.thumbTop,S=function(){if(v!==void 0){var _=g.scrollTopFromThumbTop(m+v-w);_!==g.scrollTop&&g._emit("scroll",{data:_})}};s.capture(this.inner,A,E);var k=setInterval(S,20);return s.preventDefault(f)}var D=f.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(D)}),s.preventDefault(f)}},r.prototype.getHeight=function(){return this.height},r.prototype.scrollTopFromThumbTop=function(u){var f=u*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return f=f>>0,f<0?f=0:f>this.pageHeight-this.viewHeight&&(f=this.pageHeight-this.viewHeight),f},r.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},r.prototype.setHeight=function(u){this.height=Math.max(0,u),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},r.prototype.setScrollHeight=function(u,f){this.pageHeight===u&&!f||(this.pageHeight=u,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})))},r.prototype.setScrollTop=function(u){this.scrollTop=u,u<0&&(u=0),this.thumbTop=u*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},r})(e);i.prototype.setInnerHeight=i.prototype.setScrollHeight;var o=(function(h){a(r,h);function r(u,f){var g=h.call(this,u,"-h")||this;return g.scrollLeft=0,g.scrollWidth=0,g.height=g.HScrollHeight,g.inner.style.height=g.element.style.height=(g.height||12)+"px",g.renderer=f,g}return r.prototype.onMouseDown=function(u,f){if(u==="mousedown"&&!(s.getButton(f)!==0||f.detail===2)){if(f.target===this.inner){var g=this,v=f.clientX,A=function(_){v=_.clientX},E=function(){clearInterval(k)},w=f.clientX,m=this.thumbLeft,S=function(){if(v!==void 0){var _=g.scrollLeftFromThumbLeft(m+v-w);_!==g.scrollLeft&&g._emit("scroll",{data:_})}};s.capture(this.inner,A,E);var k=setInterval(S,20);return s.preventDefault(f)}var D=f.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(D)}),s.preventDefault(f)}},r.prototype.getHeight=function(){return this.isVisible?this.height:0},r.prototype.scrollLeftFromThumbLeft=function(u){var f=u*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return f=f>>0,f<0?f=0:f>this.pageWidth-this.viewWidth&&(f=this.pageWidth-this.viewWidth),f},r.prototype.setWidth=function(u){this.width=Math.max(0,u),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},r.prototype.setScrollWidth=function(u,f){this.pageWidth===u&&!f||(this.pageWidth=u,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})))},r.prototype.setScrollLeft=function(u){this.scrollLeft=u,u<0&&(u=0),this.thumbLeft=u*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},r})(e);o.prototype.setInnerWidth=o.prototype.setScrollWidth,l.ScrollBar=i,l.ScrollBarV=i,l.ScrollBarH=o,l.VScrollBar=i,l.HScrollBar=o}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(n,l,y){var a=n("./lib/event"),p=(function(){function d(s,c){this.onRender=s,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=c||window;var e=this;this._flush=function(i){e.pending=!1;var o=e.changes;if(o&&(a.blockIdle(100),e.changes=0,e.onRender(o)),e.changes){if(e.$recursionLimit--<0)return;e.schedule()}else e.$recursionLimit=2}}return d.prototype.schedule=function(s){this.changes=this.changes|s,this.changes&&!this.pending&&(a.nextFrame(this._flush),this.pending=!0)},d.prototype.clear=function(s){var c=this.changes;return this.changes=0,c},d})();l.RenderLoop=p}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(n,l,y){var a=n("../lib/oop"),p=n("../lib/dom"),d=n("../lib/lang"),s=n("../lib/event"),c=n("../lib/useragent"),e=n("../lib/event_emitter").EventEmitter,i=512,o=typeof ResizeObserver=="function",h=200,r=(function(){function u(f){this.el=p.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=p.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=p.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),f.appendChild(this.el),this.$measureNode.textContent=d.stringRepeat("X",i),this.$characterSize={width:0,height:0},o?this.$addObserver():this.checkForSizeChanges()}return u.prototype.$setMeasureNodeStyles=function(f,g){f.width=f.height="auto",f.left=f.top="0px",f.visibility="hidden",f.position="absolute",f.whiteSpace="pre",c.isIE<8?f["font-family"]="inherit":f.font="inherit",f.overflow=g?"hidden":"visible"},u.prototype.checkForSizeChanges=function(f){if(f===void 0&&(f=this.$measureSizes()),f&&(this.$characterSize.width!==f.width||this.$characterSize.height!==f.height)){this.$measureNode.style.fontWeight="bold";var g=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=f,this.charSizes=Object.create(null),this.allowBoldFonts=g&&g.width===f.width&&g.height===f.height,this._emit("changeCharacterSize",{data:f})}},u.prototype.$addObserver=function(){var f=this;this.$observer=new window.ResizeObserver(function(g){f.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},u.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var f=this;return this.$pollSizeChangesTimer=s.onIdle(function g(){f.checkForSizeChanges(),s.onIdle(g,500)},500)},u.prototype.setPolling=function(f){f?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},u.prototype.$measureSizes=function(f){var g={height:(f||this.$measureNode).clientHeight,width:(f||this.$measureNode).clientWidth/i};return g.width===0||g.height===0?null:g},u.prototype.$measureCharWidth=function(f){this.$main.textContent=d.stringRepeat(f,i);var g=this.$main.getBoundingClientRect();return g.width/i},u.prototype.getCharacterWidth=function(f){var g=this.charSizes[f];return g===void 0&&(g=this.charSizes[f]=this.$measureCharWidth(f)/this.$characterSize.width),g},u.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},u.prototype.$getZoom=function(f){return!f||!f.parentElement?1:(Number(window.getComputedStyle(f).zoom)||1)*this.$getZoom(f.parentElement)},u.prototype.$initTransformMeasureNodes=function(){var f=function(g,v){return["div",{style:"position: absolute;top:"+g+"px;left:"+v+"px;"}]};this.els=p.buildDom([f(0,0),f(h,0),f(0,h),f(h,h)],this.el)},u.prototype.transformCoordinates=function(f,g){if(f){var v=this.$getZoom(this.el);f=m(1/v,f)}function A(P,B,V){var W=P[1]*B[0]-P[0]*B[1];return[(-B[1]*V[0]+B[0]*V[1])/W,(+P[1]*V[0]-P[0]*V[1])/W]}function E(P,B){return[P[0]-B[0],P[1]-B[1]]}function w(P,B){return[P[0]+B[0],P[1]+B[1]]}function m(P,B){return[P*B[0],P*B[1]]}this.els||this.$initTransformMeasureNodes();function S(P){var B=P.getBoundingClientRect();return[B.left,B.top]}var k=S(this.els[0]),D=S(this.els[1]),_=S(this.els[2]),F=S(this.els[3]),x=A(E(F,D),E(F,_),E(w(D,_),w(F,k))),$=m(1+x[0],E(D,k)),C=m(1+x[1],E(_,k));if(g){var b=g,T=x[0]*b[0]/h+x[1]*b[1]/h+1,I=w(m(b[0],$),m(b[1],C));return w(m(1/T/h,I),k)}var R=E(f,k),N=A(E($,m(x[0],R)),E(C,m(x[1],R)),R);return m(h,N)},u})();r.prototype.$characterSize={width:0,height:0},a.implement(r.prototype,e),l.FontMetrics=r}),ace.define("ace/css/editor-css",["require","exports","module"],function(n,l,y){y.exports=`
|
|
269
|
-
.ace_br1 {border-top-left-radius : 3px;}
|
|
270
|
-
.ace_br2 {border-top-right-radius : 3px;}
|
|
271
|
-
.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
|
|
272
|
-
.ace_br4 {border-bottom-right-radius: 3px;}
|
|
273
|
-
.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}
|
|
274
|
-
.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}
|
|
275
|
-
.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}
|
|
276
|
-
.ace_br8 {border-bottom-left-radius : 3px;}
|
|
277
|
-
.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}
|
|
278
|
-
.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}
|
|
279
|
-
.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}
|
|
280
|
-
.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
|
281
|
-
.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
|
282
|
-
.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
|
283
|
-
.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
.ace_editor {
|
|
287
|
-
position: relative;
|
|
288
|
-
overflow: hidden;
|
|
289
|
-
padding: 0;
|
|
290
|
-
font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;
|
|
291
|
-
direction: ltr;
|
|
292
|
-
text-align: left;
|
|
293
|
-
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
294
|
-
forced-color-adjust: none;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.ace_scroller {
|
|
298
|
-
position: absolute;
|
|
299
|
-
overflow: hidden;
|
|
300
|
-
top: 0;
|
|
301
|
-
bottom: 0;
|
|
302
|
-
background-color: inherit;
|
|
303
|
-
-ms-user-select: none;
|
|
304
|
-
-moz-user-select: none;
|
|
305
|
-
-webkit-user-select: none;
|
|
306
|
-
user-select: none;
|
|
307
|
-
cursor: text;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
.ace_content {
|
|
311
|
-
position: absolute;
|
|
312
|
-
box-sizing: border-box;
|
|
313
|
-
min-width: 100%;
|
|
314
|
-
contain: style size layout;
|
|
315
|
-
font-variant-ligatures: no-common-ligatures;
|
|
316
|
-
}
|
|
317
|
-
.ace_invisible {
|
|
318
|
-
font-variant-ligatures: none;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
.ace_keyboard-focus:focus {
|
|
322
|
-
box-shadow: inset 0 0 0 2px #5E9ED6;
|
|
323
|
-
outline: none;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
.ace_dragging .ace_scroller:before{
|
|
327
|
-
position: absolute;
|
|
328
|
-
top: 0;
|
|
329
|
-
left: 0;
|
|
330
|
-
right: 0;
|
|
331
|
-
bottom: 0;
|
|
332
|
-
content: '';
|
|
333
|
-
background: rgba(250, 250, 250, 0.01);
|
|
334
|
-
z-index: 1000;
|
|
335
|
-
}
|
|
336
|
-
.ace_dragging.ace_dark .ace_scroller:before{
|
|
337
|
-
background: rgba(0, 0, 0, 0.01);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.ace_gutter {
|
|
341
|
-
position: absolute;
|
|
342
|
-
overflow : hidden;
|
|
343
|
-
width: auto;
|
|
344
|
-
top: 0;
|
|
345
|
-
bottom: 0;
|
|
346
|
-
left: 0;
|
|
347
|
-
cursor: default;
|
|
348
|
-
z-index: 4;
|
|
349
|
-
-ms-user-select: none;
|
|
350
|
-
-moz-user-select: none;
|
|
351
|
-
-webkit-user-select: none;
|
|
352
|
-
user-select: none;
|
|
353
|
-
contain: style size layout;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
.ace_gutter-active-line {
|
|
357
|
-
position: absolute;
|
|
358
|
-
left: 0;
|
|
359
|
-
right: 0;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
.ace_scroller.ace_scroll-left:after {
|
|
363
|
-
content: "";
|
|
364
|
-
position: absolute;
|
|
365
|
-
top: 0;
|
|
366
|
-
right: 0;
|
|
367
|
-
bottom: 0;
|
|
368
|
-
left: 0;
|
|
369
|
-
box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
|
|
370
|
-
pointer-events: none;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
.ace_gutter-cell, .ace_gutter-cell_svg-icons {
|
|
374
|
-
position: absolute;
|
|
375
|
-
top: 0;
|
|
376
|
-
left: 0;
|
|
377
|
-
right: 0;
|
|
378
|
-
padding-left: 19px;
|
|
379
|
-
padding-right: 6px;
|
|
380
|
-
background-repeat: no-repeat;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
.ace_gutter-cell_svg-icons .ace_gutter_annotation {
|
|
384
|
-
margin-left: -14px;
|
|
385
|
-
float: left;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
.ace_gutter-cell .ace_gutter_annotation {
|
|
389
|
-
margin-left: -19px;
|
|
390
|
-
float: left;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold, .ace_gutter-cell.ace_security, .ace_icon.ace_security, .ace_icon.ace_security_fold {
|
|
394
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");
|
|
395
|
-
background-repeat: no-repeat;
|
|
396
|
-
background-position: 2px center;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {
|
|
400
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");
|
|
401
|
-
background-repeat: no-repeat;
|
|
402
|
-
background-position: 2px center;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
.ace_gutter-cell.ace_info, .ace_icon.ace_info, .ace_gutter-cell.ace_hint, .ace_icon.ace_hint {
|
|
406
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");
|
|
407
|
-
background-repeat: no-repeat;
|
|
408
|
-
background-position: 2px center;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info, .ace_dark .ace_gutter-cell.ace_hint, .ace_dark .ace_icon.ace_hint {
|
|
412
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
.ace_icon_svg.ace_error {
|
|
416
|
-
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");
|
|
417
|
-
background-color: crimson;
|
|
418
|
-
}
|
|
419
|
-
.ace_icon_svg.ace_security {
|
|
420
|
-
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iZGFya29yYW5nZSIgZmlsbD0ibm9uZSIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogICAgICAgIDxwYXRoIGNsYXNzPSJzdHJva2UtbGluZWpvaW4tcm91bmQiIGQ9Ik04IDE0LjgzMDdDOCAxNC44MzA3IDIgMTIuOTA0NyAyIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOEM3Ljk4OTk5IDEuMzQ5MTggMTAuNjkgMy4yNjU0OCAxNCAzLjI2NTQ4VjguMDg5OTJDMTQgMTIuOTA0NyA4IDE0LjgzMDcgOCAxNC44MzA3WiIvPgogICAgICAgIDxwYXRoIGQ9Ik0yIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOCIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMy45OSA4LjA4OTkyVjMuMjY1NDhDMTAuNjggMy4yNjU0OCA4IDEuMzQ5MTggOCAxLjM0OTE4Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggNFY5Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggMTBWMTIiLz4KICAgIDwvZz4KPC9zdmc+");
|
|
421
|
-
background-color: crimson;
|
|
422
|
-
}
|
|
423
|
-
.ace_icon_svg.ace_warning {
|
|
424
|
-
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");
|
|
425
|
-
background-color: darkorange;
|
|
426
|
-
}
|
|
427
|
-
.ace_icon_svg.ace_info {
|
|
428
|
-
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");
|
|
429
|
-
background-color: royalblue;
|
|
430
|
-
}
|
|
431
|
-
.ace_icon_svg.ace_hint {
|
|
432
|
-
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0ic2lsdmVyIiBmaWxsPSJub25lIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTYgMTRIMTAiLz4KICAgICAgICA8cGF0aCBkPSJNOCAxMUg5QzkgOS40NzAwMiAxMiA4LjU0MDAyIDEyIDUuNzYwMDJDMTIuMDIgNC40MDAwMiAxMS4zOSAzLjM2MDAyIDEwLjQzIDIuNjcwMDJDOSAxLjY0MDAyIDcuMDAwMDEgMS42NDAwMiA1LjU3MDAxIDIuNjcwMDJDNC42MTAwMSAzLjM2MDAyIDMuOTggNC40MDAwMiA0IDUuNzYwMDJDNCA4LjU0MDAyIDcuMDAwMDEgOS40NzAwMiA3LjAwMDAxIDExSDhaIi8+CiAgICA8L2c+Cjwvc3ZnPg==");
|
|
433
|
-
background-color: silver;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.ace_icon_svg.ace_error_fold {
|
|
437
|
-
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
|
|
438
|
-
background-color: crimson;
|
|
439
|
-
}
|
|
440
|
-
.ace_icon_svg.ace_security_fold {
|
|
441
|
-
-webkit-mask-image: url("data:image/svg+xml;base64,CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTcgMTQiIGZpbGw9Im5vbmUiPgogICAgPHBhdGggZD0iTTEwLjAwMDEgMTMuNjk5MkMxMC4wMDAxIDEzLjY5OTIgMTEuOTI0MSAxMy40NzYzIDEzIDEyLjY5OTJDMTQuNDEzOSAxMS42NzgxIDE2IDEwLjUgMTYuMTI1MSA2LjgxMTI2VjIuNTg5ODdDMTYuMTI1MSAyLjU0NzY4IDE2LjEyMjEgMi41MDYxOSAxNi4xMTY0IDIuNDY1NTlWMS43MTQ4NUgxNS4yNDE0TDE1LjIzMDcgMS43MTQ4NEwxNC42MjUxIDEuNjk5MjJWNi44MTEyM0MxNC42MjUxIDguNTEwNjEgMTQuNjI1MSA5LjQ2NDYxIDEyLjc4MjQgMTEuNzIxQzEyLjE1ODYgMTIuNDg0OCAxMC4wMDAxIDEzLjY5OTIgMTAuMDAwMSAxMy42OTkyWiIgZmlsbD0iY3JpbXNvbiIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuMzM2MDkgMC4zNjc0NzVDNy4wMzIxNCAwLjE1MjY1MiA2LjYyNTQ4IDAuMTUzNjE0IDYuMzIyNTMgMC4zNjk5OTdMNi4zMDg2OSAwLjM3OTU1NEM2LjI5NTUzIDAuMzg4NTg4IDYuMjczODggMC40MDMyNjYgNi4yNDQxNyAwLjQyMjc4OUM2LjE4NDcxIDAuNDYxODYgNi4wOTMyMSAwLjUyMDE3MSA1Ljk3MzEzIDAuNTkxMzczQzUuNzMyNTEgMC43MzQwNTkgNS4zNzk5IDAuOTI2ODY0IDQuOTQyNzkgMS4xMjAwOUM0LjA2MTQ0IDEuNTA5NyAyLjg3NTQxIDEuODgzNzcgMS41ODk4NCAxLjg4Mzc3SDAuNzE0ODQ0VjIuNzU4NzdWNi45ODAxNUMwLjcxNDg0NCA5LjQ5Mzc0IDIuMjg4NjYgMTEuMTk3MyAzLjcwMjU0IDEyLjIxODVDNC40MTg0NSAxMi43MzU1IDUuMTI4NzQgMTMuMTA1MyA1LjY1NzMzIDEzLjM0NTdDNS45MjI4NCAxMy40NjY0IDYuMTQ1NjYgMTMuNTU1OSA2LjMwNDY1IDEzLjYxNjFDNi4zODQyMyAxMy42NDYyIDYuNDQ4MDUgMTMuNjY5IDYuNDkzNDkgMTMuNjg0OEM2LjUxNjIyIDEzLjY5MjcgNi41MzQzOCAxMy42OTg5IDYuNTQ3NjQgMTMuNzAzM0w2LjU2MzgyIDEzLjcwODdMNi41NjkwOCAxMy43MTA0TDYuNTcwOTkgMTMuNzExTDYuODM5ODQgMTMuNzUzM0w2LjU3MjQyIDEzLjcxMTVDNi43NDYzMyAxMy43NjczIDYuOTMzMzUgMTMuNzY3MyA3LjEwNzI3IDEzLjcxMTVMNy4xMDg3IDEzLjcxMUw3LjExMDYxIDEzLjcxMDRMNy4xMTU4NyAxMy43MDg3TDcuMTMyMDUgMTMuNzAzM0M3LjE0NTMxIDEzLjY5ODkgNy4xNjM0NiAxMy42OTI3IDcuMTg2MTkgMTMuNjg0OEM3LjIzMTY0IDEzLjY2OSA3LjI5NTQ2IDEzLjY0NjIgNy4zNzUwMyAxMy42MTYxQzcuNTM0MDMgMTMuNTU1OSA3Ljc1Njg1IDEzLjQ2NjQgOC4wMjIzNiAxMy4zNDU3QzguNTUwOTUgMTMuMTA1MyA5LjI2MTIzIDEyLjczNTUgOS45NzcxNSAxMi4yMTg1QzExLjM5MSAxMS4xOTczIDEyLjk2NDggOS40OTM3NyAxMi45NjQ4IDYuOTgwMThWMi43NTg4QzEyLjk2NDggMi43MTY2IDEyLjk2MTkgMi42NzUxMSAxMi45NTYxIDIuNjM0NTFWMS44ODM3N0gxMi4wODExQzEyLjA3NzUgMS44ODM3NyAxMi4wNzQgMS44ODM3NyAxMi4wNzA0IDEuODgzNzdDMTAuNzk3OSAxLjg4MDA0IDkuNjE5NjIgMS41MTEwMiA4LjczODk0IDEuMTI0ODZDOC43MzUzNCAxLjEyMzI3IDguNzMxNzQgMS4xMjE2OCA4LjcyODE0IDEuMTIwMDlDOC4yOTEwMyAwLjkyNjg2NCA3LjkzODQyIDAuNzM0MDU5IDcuNjk3NzkgMC41OTEzNzNDNy41Nzc3MiAwLjUyMDE3MSA3LjQ4NjIyIDAuNDYxODYgNy40MjY3NiAwLjQyMjc4OUM3LjM5NzA1IDAuNDAzMjY2IDcuMzc1MzkgMC4zODg1ODggNy4zNjIyNCAwLjM3OTU1NEw3LjM0ODk2IDAuMzcwMzVDNy4zNDg5NiAwLjM3MDM1IDcuMzQ4NDcgMC4zNzAwMiA3LjM0NTYzIDAuMzc0MDU0TDcuMzM3NzkgMC4zNjg2NTlMNy4zMzYwOSAwLjM2NzQ3NVpNOC4wMzQ3MSAyLjcyNjkxQzguODYwNCAzLjA5MDYzIDkuOTYwNjYgMy40NjMwOSAxMS4yMDYxIDMuNTg5MDdWNi45ODAxNUgxMS4yMTQ4QzExLjIxNDggOC42Nzk1MyAxMC4xNjM3IDkuOTI1MDcgOC45NTI1NCAxMC43OTk4QzguMzU1OTUgMTEuMjMwNiA3Ljc1Mzc0IDExLjU0NTQgNy4yOTc5NiAxMS43NTI3QzcuMTE2NzEgMTEuODM1MSA2Ljk2MDYyIDExLjg5OTYgNi44Mzk4NCAxMS45NDY5QzYuNzE5MDYgMTEuODk5NiA2LjU2Mjk3IDExLjgzNTEgNi4zODE3MyAxMS43NTI3QzUuOTI1OTUgMTEuNTQ1NCA1LjMyMzczIDExLjIzMDYgNC43MjcxNSAxMC43OTk4QzMuNTE2MDMgOS45MjUwNyAyLjQ2NDg0IDguNjc5NTUgMi40NjQ4NCA2Ljk4MDE4VjMuNTg5MDlDMy43MTczOCAzLjQ2MjM5IDQuODIzMDggMy4wODYzOSA1LjY1MDMzIDIuNzIwNzFDNi4xNDIyOCAyLjUwMzI0IDYuNTQ0ODUgMi4yODUzNyA2LjgzMjU0IDIuMTE2MjRDNy4xMjE4MSAyLjI4NTM1IDcuNTI3IDIuNTAzNTIgOC4wMjE5NiAyLjcyMTMxQzguMDI2MiAyLjcyMzE3IDguMDMwNDUgMi43MjUwNCA4LjAzNDcxIDIuNzI2OTFaTTUuOTY0ODQgMy40MDE0N1Y3Ljc3NjQ3SDcuNzE0ODRWMy40MDE0N0g1Ljk2NDg0Wk01Ljk2NDg0IDEwLjQwMTVWOC42NTE0N0g3LjcxNDg0VjEwLjQwMTVINS45NjQ4NFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
|
|
442
|
-
background-color: crimson;
|
|
443
|
-
}
|
|
444
|
-
.ace_icon_svg.ace_warning_fold {
|
|
445
|
-
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");
|
|
446
|
-
background-color: darkorange;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
.ace_scrollbar {
|
|
450
|
-
contain: strict;
|
|
451
|
-
position: absolute;
|
|
452
|
-
right: 0;
|
|
453
|
-
bottom: 0;
|
|
454
|
-
z-index: 6;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
.ace_scrollbar-inner {
|
|
458
|
-
position: absolute;
|
|
459
|
-
cursor: text;
|
|
460
|
-
left: 0;
|
|
461
|
-
top: 0;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
.ace_scrollbar-v{
|
|
465
|
-
overflow-x: hidden;
|
|
466
|
-
overflow-y: scroll;
|
|
467
|
-
top: 0;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
.ace_scrollbar-h {
|
|
471
|
-
overflow-x: scroll;
|
|
472
|
-
overflow-y: hidden;
|
|
473
|
-
left: 0;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.ace_print-margin {
|
|
477
|
-
position: absolute;
|
|
478
|
-
height: 100%;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
.ace_text-input {
|
|
482
|
-
position: absolute;
|
|
483
|
-
z-index: 0;
|
|
484
|
-
width: 0.5em;
|
|
485
|
-
height: 1em;
|
|
486
|
-
opacity: 0;
|
|
487
|
-
background: transparent;
|
|
488
|
-
-moz-appearance: none;
|
|
489
|
-
appearance: none;
|
|
490
|
-
border: none;
|
|
491
|
-
resize: none;
|
|
492
|
-
outline: none;
|
|
493
|
-
overflow: hidden;
|
|
494
|
-
font: inherit;
|
|
495
|
-
padding: 0 1px;
|
|
496
|
-
margin: 0 -1px;
|
|
497
|
-
contain: strict;
|
|
498
|
-
-ms-user-select: text;
|
|
499
|
-
-moz-user-select: text;
|
|
500
|
-
-webkit-user-select: text;
|
|
501
|
-
user-select: text;
|
|
502
|
-
/*with \`pre-line\` chrome inserts instead of space*/
|
|
503
|
-
white-space: pre!important;
|
|
504
|
-
}
|
|
505
|
-
.ace_text-input.ace_composition {
|
|
506
|
-
background: transparent;
|
|
507
|
-
color: inherit;
|
|
508
|
-
z-index: 1000;
|
|
509
|
-
opacity: 1;
|
|
510
|
-
}
|
|
511
|
-
.ace_composition_placeholder { color: transparent }
|
|
512
|
-
.ace_composition_marker {
|
|
513
|
-
border-bottom: 1px solid;
|
|
514
|
-
position: absolute;
|
|
515
|
-
border-radius: 0;
|
|
516
|
-
margin-top: 1px;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
[ace_nocontext=true] {
|
|
520
|
-
transform: none!important;
|
|
521
|
-
filter: none!important;
|
|
522
|
-
clip-path: none!important;
|
|
523
|
-
mask : none!important;
|
|
524
|
-
contain: none!important;
|
|
525
|
-
perspective: none!important;
|
|
526
|
-
mix-blend-mode: initial!important;
|
|
527
|
-
z-index: auto;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
.ace_layer {
|
|
531
|
-
z-index: 1;
|
|
532
|
-
position: absolute;
|
|
533
|
-
overflow: hidden;
|
|
534
|
-
/* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
|
|
535
|
-
word-wrap: normal;
|
|
536
|
-
white-space: pre;
|
|
537
|
-
height: 100%;
|
|
538
|
-
width: 100%;
|
|
539
|
-
box-sizing: border-box;
|
|
540
|
-
/* setting pointer-events: auto; on node under the mouse, which changes
|
|
541
|
-
during scroll, will break mouse wheel scrolling in Safari */
|
|
542
|
-
pointer-events: none;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
.ace_gutter-layer {
|
|
546
|
-
position: relative;
|
|
547
|
-
width: auto;
|
|
548
|
-
text-align: right;
|
|
549
|
-
pointer-events: auto;
|
|
550
|
-
height: 1000000px;
|
|
551
|
-
contain: style size layout;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
.ace_text-layer {
|
|
555
|
-
font: inherit !important;
|
|
556
|
-
position: absolute;
|
|
557
|
-
height: 1000000px;
|
|
558
|
-
width: 1000000px;
|
|
559
|
-
contain: style size layout;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {
|
|
563
|
-
contain: style size layout;
|
|
564
|
-
position: absolute;
|
|
565
|
-
top: 0;
|
|
566
|
-
left: 0;
|
|
567
|
-
right: 0;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
.ace_hidpi .ace_text-layer,
|
|
571
|
-
.ace_hidpi .ace_gutter-layer,
|
|
572
|
-
.ace_hidpi .ace_content,
|
|
573
|
-
.ace_hidpi .ace_gutter {
|
|
574
|
-
contain: strict;
|
|
575
|
-
}
|
|
576
|
-
.ace_hidpi .ace_text-layer > .ace_line,
|
|
577
|
-
.ace_hidpi .ace_text-layer > .ace_line_group {
|
|
578
|
-
contain: strict;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
.ace_cjk {
|
|
582
|
-
display: inline-block;
|
|
583
|
-
text-align: center;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
.ace_cursor-layer {
|
|
587
|
-
z-index: 4;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
.ace_cursor {
|
|
591
|
-
z-index: 4;
|
|
592
|
-
position: absolute;
|
|
593
|
-
box-sizing: border-box;
|
|
594
|
-
border-left: 2px solid;
|
|
595
|
-
/* workaround for smooth cursor repaintng whole screen in chrome */
|
|
596
|
-
transform: translatez(0);
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
.ace_multiselect .ace_cursor {
|
|
600
|
-
border-left-width: 1px;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
.ace_slim-cursors .ace_cursor {
|
|
604
|
-
border-left-width: 1px;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
.ace_overwrite-cursors .ace_cursor {
|
|
608
|
-
border-left-width: 0;
|
|
609
|
-
border-bottom: 1px solid;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
.ace_hidden-cursors .ace_cursor {
|
|
613
|
-
opacity: 0.2;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {
|
|
617
|
-
opacity: 0;
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
.ace_smooth-blinking .ace_cursor {
|
|
621
|
-
transition: opacity 0.18s;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
.ace_animate-blinking .ace_cursor {
|
|
625
|
-
animation-duration: 1000ms;
|
|
626
|
-
animation-timing-function: step-end;
|
|
627
|
-
animation-name: blink-ace-animate;
|
|
628
|
-
animation-iteration-count: infinite;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
.ace_animate-blinking.ace_smooth-blinking .ace_cursor {
|
|
632
|
-
animation-duration: 1000ms;
|
|
633
|
-
animation-timing-function: ease-in-out;
|
|
634
|
-
animation-name: blink-ace-animate-smooth;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
@keyframes blink-ace-animate {
|
|
638
|
-
from, to { opacity: 1; }
|
|
639
|
-
60% { opacity: 0; }
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
@keyframes blink-ace-animate-smooth {
|
|
643
|
-
from, to { opacity: 1; }
|
|
644
|
-
45% { opacity: 1; }
|
|
645
|
-
60% { opacity: 0; }
|
|
646
|
-
85% { opacity: 0; }
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {
|
|
650
|
-
position: absolute;
|
|
651
|
-
z-index: 3;
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
.ace_marker-layer .ace_selection {
|
|
655
|
-
position: absolute;
|
|
656
|
-
z-index: 5;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
.ace_marker-layer .ace_bracket {
|
|
660
|
-
position: absolute;
|
|
661
|
-
z-index: 6;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
.ace_marker-layer .ace_error_bracket {
|
|
665
|
-
position: absolute;
|
|
666
|
-
border-bottom: 1px solid #DE5555;
|
|
667
|
-
border-radius: 0;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
.ace_marker-layer .ace_active-line {
|
|
671
|
-
position: absolute;
|
|
672
|
-
z-index: 2;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
.ace_marker-layer .ace_selected-word {
|
|
676
|
-
position: absolute;
|
|
677
|
-
z-index: 4;
|
|
678
|
-
box-sizing: border-box;
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
.ace_line .ace_fold {
|
|
682
|
-
box-sizing: border-box;
|
|
683
|
-
|
|
684
|
-
display: inline-block;
|
|
685
|
-
height: 11px;
|
|
686
|
-
margin-top: -2px;
|
|
687
|
-
vertical-align: middle;
|
|
688
|
-
|
|
689
|
-
background-image:
|
|
690
|
-
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
|
|
691
|
-
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
|
|
692
|
-
background-repeat: no-repeat, repeat-x;
|
|
693
|
-
background-position: center center, top left;
|
|
694
|
-
color: transparent;
|
|
695
|
-
|
|
696
|
-
border: 1px solid black;
|
|
697
|
-
border-radius: 2px;
|
|
698
|
-
|
|
699
|
-
cursor: pointer;
|
|
700
|
-
pointer-events: auto;
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
.ace_dark .ace_fold {
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
.ace_fold:hover{
|
|
707
|
-
background-image:
|
|
708
|
-
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
|
|
709
|
-
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
.ace_tooltip {
|
|
713
|
-
background-color: #f5f5f5;
|
|
714
|
-
border: 1px solid gray;
|
|
715
|
-
border-radius: 1px;
|
|
716
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
|
|
717
|
-
color: black;
|
|
718
|
-
padding: 3px 4px;
|
|
719
|
-
position: fixed;
|
|
720
|
-
z-index: 999999;
|
|
721
|
-
box-sizing: border-box;
|
|
722
|
-
cursor: default;
|
|
723
|
-
white-space: pre-wrap;
|
|
724
|
-
word-wrap: break-word;
|
|
725
|
-
line-height: normal;
|
|
726
|
-
font-style: normal;
|
|
727
|
-
font-weight: normal;
|
|
728
|
-
letter-spacing: normal;
|
|
729
|
-
pointer-events: none;
|
|
730
|
-
overflow: auto;
|
|
731
|
-
max-width: min(33em, 66vw);
|
|
732
|
-
overscroll-behavior: contain;
|
|
733
|
-
}
|
|
734
|
-
.ace_tooltip pre {
|
|
735
|
-
white-space: pre-wrap;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
.ace_tooltip.ace_dark {
|
|
739
|
-
background-color: #636363;
|
|
740
|
-
color: #fff;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
.ace_tooltip:focus {
|
|
744
|
-
outline: 1px solid #5E9ED6;
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
.ace_icon {
|
|
748
|
-
display: inline-block;
|
|
749
|
-
width: 18px;
|
|
750
|
-
vertical-align: top;
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
.ace_icon_svg {
|
|
754
|
-
display: inline-block;
|
|
755
|
-
width: 12px;
|
|
756
|
-
vertical-align: top;
|
|
757
|
-
-webkit-mask-repeat: no-repeat;
|
|
758
|
-
-webkit-mask-size: 12px;
|
|
759
|
-
-webkit-mask-position: center;
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {
|
|
763
|
-
padding-right: 13px;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
.ace_fold-widget, .ace_custom-widget {
|
|
767
|
-
box-sizing: border-box;
|
|
768
|
-
|
|
769
|
-
margin: 0 -12px 0 1px;
|
|
770
|
-
display: none;
|
|
771
|
-
width: 11px;
|
|
772
|
-
vertical-align: top;
|
|
773
|
-
|
|
774
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");
|
|
775
|
-
background-repeat: no-repeat;
|
|
776
|
-
background-position: center;
|
|
777
|
-
|
|
778
|
-
border-radius: 3px;
|
|
779
|
-
|
|
780
|
-
border: 1px solid transparent;
|
|
781
|
-
cursor: pointer;
|
|
782
|
-
pointer-events: auto;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
.ace_custom-widget {
|
|
786
|
-
background: none;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
.ace_folding-enabled .ace_fold-widget {
|
|
790
|
-
display: inline-block;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
.ace_fold-widget.ace_end {
|
|
794
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
.ace_fold-widget.ace_closed {
|
|
798
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
.ace_fold-widget:hover {
|
|
802
|
-
border: 1px solid rgba(0, 0, 0, 0.3);
|
|
803
|
-
background-color: rgba(255, 255, 255, 0.2);
|
|
804
|
-
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
.ace_fold-widget:active {
|
|
808
|
-
border: 1px solid rgba(0, 0, 0, 0.4);
|
|
809
|
-
background-color: rgba(0, 0, 0, 0.05);
|
|
810
|
-
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
|
|
811
|
-
}
|
|
812
|
-
/**
|
|
813
|
-
* Dark version for fold widgets
|
|
814
|
-
*/
|
|
815
|
-
.ace_dark .ace_fold-widget {
|
|
816
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");
|
|
817
|
-
}
|
|
818
|
-
.ace_dark .ace_fold-widget.ace_end {
|
|
819
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");
|
|
820
|
-
}
|
|
821
|
-
.ace_dark .ace_fold-widget.ace_closed {
|
|
822
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");
|
|
823
|
-
}
|
|
824
|
-
.ace_dark .ace_fold-widget:hover {
|
|
825
|
-
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
|
826
|
-
background-color: rgba(255, 255, 255, 0.1);
|
|
827
|
-
}
|
|
828
|
-
.ace_dark .ace_fold-widget:active {
|
|
829
|
-
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
.ace_inline_button {
|
|
833
|
-
border: 1px solid lightgray;
|
|
834
|
-
display: inline-block;
|
|
835
|
-
margin: -1px 8px;
|
|
836
|
-
padding: 0 5px;
|
|
837
|
-
pointer-events: auto;
|
|
838
|
-
cursor: pointer;
|
|
839
|
-
}
|
|
840
|
-
.ace_inline_button:hover {
|
|
841
|
-
border-color: gray;
|
|
842
|
-
background: rgba(200,200,200,0.2);
|
|
843
|
-
display: inline-block;
|
|
844
|
-
pointer-events: auto;
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
.ace_fold-widget.ace_invalid {
|
|
848
|
-
background-color: #FFB4B4;
|
|
849
|
-
border-color: #DE5555;
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
.ace_fade-fold-widgets .ace_fold-widget {
|
|
853
|
-
transition: opacity 0.4s ease 0.05s;
|
|
854
|
-
opacity: 0;
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
.ace_fade-fold-widgets:hover .ace_fold-widget {
|
|
858
|
-
transition: opacity 0.05s ease 0.05s;
|
|
859
|
-
opacity:1;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
.ace_underline {
|
|
863
|
-
text-decoration: underline;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
.ace_bold {
|
|
867
|
-
font-weight: bold;
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
.ace_nobold .ace_bold {
|
|
871
|
-
font-weight: normal;
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
.ace_italic {
|
|
875
|
-
font-style: italic;
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
.ace_error-marker {
|
|
880
|
-
background-color: rgba(255, 0, 0,0.2);
|
|
881
|
-
position: absolute;
|
|
882
|
-
z-index: 9;
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
.ace_highlight-marker {
|
|
886
|
-
background-color: rgba(255, 255, 0,0.2);
|
|
887
|
-
position: absolute;
|
|
888
|
-
z-index: 8;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
.ace_mobile-menu {
|
|
892
|
-
position: absolute;
|
|
893
|
-
line-height: 1.5;
|
|
894
|
-
border-radius: 4px;
|
|
895
|
-
-ms-user-select: none;
|
|
896
|
-
-moz-user-select: none;
|
|
897
|
-
-webkit-user-select: none;
|
|
898
|
-
user-select: none;
|
|
899
|
-
background: white;
|
|
900
|
-
box-shadow: 1px 3px 2px grey;
|
|
901
|
-
border: 1px solid #dcdcdc;
|
|
902
|
-
color: black;
|
|
903
|
-
}
|
|
904
|
-
.ace_dark > .ace_mobile-menu {
|
|
905
|
-
background: #333;
|
|
906
|
-
color: #ccc;
|
|
907
|
-
box-shadow: 1px 3px 2px grey;
|
|
908
|
-
border: 1px solid #444;
|
|
909
|
-
|
|
910
|
-
}
|
|
911
|
-
.ace_mobile-button {
|
|
912
|
-
padding: 2px;
|
|
913
|
-
cursor: pointer;
|
|
914
|
-
overflow: hidden;
|
|
915
|
-
}
|
|
916
|
-
.ace_mobile-button:hover {
|
|
917
|
-
background-color: #eee;
|
|
918
|
-
opacity:1;
|
|
919
|
-
}
|
|
920
|
-
.ace_mobile-button:active {
|
|
921
|
-
background-color: #ddd;
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
.ace_placeholder {
|
|
925
|
-
position: relative;
|
|
926
|
-
font-family: arial;
|
|
927
|
-
transform: scale(0.9);
|
|
928
|
-
transform-origin: left;
|
|
929
|
-
white-space: pre;
|
|
930
|
-
opacity: 0.7;
|
|
931
|
-
margin: 0 10px;
|
|
932
|
-
z-index: 1;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
.ace_ghost_text {
|
|
936
|
-
opacity: 0.5;
|
|
937
|
-
font-style: italic;
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
.ace_ghost_text_container > div {
|
|
941
|
-
white-space: pre;
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
.ghost_text_line_wrapped::after {
|
|
945
|
-
content: "↩";
|
|
946
|
-
position: absolute;
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
.ace_lineWidgetContainer.ace_ghost_text {
|
|
950
|
-
margin: 0px 4px
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
.ace_screenreader-only {
|
|
954
|
-
position:absolute;
|
|
955
|
-
left:-10000px;
|
|
956
|
-
top:auto;
|
|
957
|
-
width:1px;
|
|
958
|
-
height:1px;
|
|
959
|
-
overflow:hidden;
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
.ace_hidden_token {
|
|
963
|
-
display: none;
|
|
964
|
-
}`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(n,l,y){var a=n("../lib/dom"),p=n("../lib/oop"),d=n("../lib/event_emitter").EventEmitter,s=(function(){function c(e,i){this.renderer=i,this.pixelRatio=1,this.maxHeight=i.layerConfig.maxHeight,this.lineHeight=i.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(e)}return c.prototype.$createCanvas=function(){this.canvas=a.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(e){this.$createCanvas(),this.scrollbarV=e,e.element.appendChild(this.canvas),this.setDimensions()},c.prototype.$updateDecorators=function(e){if(typeof this.canvas.getContext!="function")return;var i=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;this.setDimensions(e);var o=this.canvas.getContext("2d");function h($,C){return $.priority<C.priority?-1:$.priority>C.priority?1:0}var r=this.renderer.session.$annotations;if(o.clearRect(0,0,this.canvas.width,this.canvas.height),r){var u={info:1,warning:2,error:3};r.forEach(function($){$.priority=u[$.type]||null}),r=r.sort(h);for(var f=0;f<r.length;f++){var g=r[f].row,v=this.getVerticalOffsetForRow(g),A=v+this.lineHeight,E=Math.round(this.heightRatio*v),w=Math.round(this.heightRatio*A),m=Math.round((E+w)/2),S=w-m;S<this.halfMinDecorationHeight&&(S=this.halfMinDecorationHeight),m-S<0&&(m=S),m+S>this.canvasHeight&&(m=this.canvasHeight-S);var k=m-S,D=m+S,_=D-k;o.fillStyle=i[r[f].type]||null,o.fillRect(0,k,Math.round(this.oneZoneWidth-1),_)}}var F=this.renderer.session.selection.getCursor();if(F){var x=Math.round(this.getVerticalOffsetForRow(F.row)*this.heightRatio);o.fillStyle="rgba(0, 0, 0, 0.5)",o.fillRect(0,x,this.canvasWidth,2)}},c.prototype.getVerticalOffsetForRow=function(e){e=e|0;var i=this.renderer.session.documentToScreenRow(e,0)*this.lineHeight;return i},c.prototype.setDimensions=function(e){e=e||this.renderer.layerConfig,this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.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})();p.implement(s.prototype,d),l.Decorator=s}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(n,l,y){var a=n("./lib/oop"),p=n("./lib/dom"),d=n("./lib/lang"),s=n("./config"),c=n("./layer/gutter").Gutter,e=n("./layer/marker").Marker,i=n("./layer/text").Text,o=n("./layer/cursor").Cursor,h=n("./scrollbar").HScrollBar,r=n("./scrollbar").VScrollBar,u=n("./scrollbar_custom").HScrollBar,f=n("./scrollbar_custom").VScrollBar,g=n("./renderloop").RenderLoop,v=n("./layer/font_metrics").FontMetrics,A=n("./lib/event_emitter").EventEmitter,E=n("./css/editor-css"),w=n("./layer/decorators").Decorator,m=n("./lib/useragent"),S=n("./layer/text_util").isTextToken;p.importCssString(E,"ace_editor.css",!1);var k=(function(){function D(_,F){var x=this;this.container=_||p.createElement("div"),p.addCssClass(this.container,"ace_editor"),p.HI_DPI&&p.addCssClass(this.container,"ace_hidpi"),this.setTheme(F),s.get("useStrictCSP")==null&&s.set("useStrictCSP",!1),this.$gutter=p.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=p.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=p.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 e(this.content);var $=this.$textLayer=new i(this.content);this.canvas=$.element,this.$markerFront=new e(this.content),this.$cursorLayer=new o(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new r(this.container,this),this.scrollBarH=new h(this.container,this),this.scrollBarV.on("scroll",function(C){x.$scrollAnimation||x.session.setScrollTop(C.data-x.scrollMargin.top)}),this.scrollBarH.on("scroll",function(C){x.$scrollAnimation||x.session.setScrollLeft(C.data-x.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new v(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(C){x.updateCharacterSize(),x.onResize(!0,x.gutterWidth,x.$size.width,x.$size.height),x._signal("changeCharacterSize",C)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!m.isIOS,this.$loop=new g(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),s.resetOptions(this),s._signal("renderer",this)}return D.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(),p.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},D.prototype.setSession=function(_){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=_,_&&this.scrollMargin.top&&_.getScrollTop()<=0&&_.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(_),this.$markerBack.setSession(_),this.$markerFront.setSession(_),this.$gutterLayer.setSession(_),this.$textLayer.setSession(_),_&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},D.prototype.updateLines=function(_,F,x){if(F===void 0&&(F=1/0),this.$changedLines?(this.$changedLines.firstRow>_&&(this.$changedLines.firstRow=_),this.$changedLines.lastRow<F&&(this.$changedLines.lastRow=F)):this.$changedLines={firstRow:_,lastRow:F},this.$changedLines.lastRow<this.layerConfig.firstRow)if(x)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},D.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},D.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},D.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},D.prototype.updateFull=function(_){_?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},D.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},D.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},D.prototype.onResize=function(_,F,x,$){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=_?1:0;var C=this.container;$||($=C.clientHeight||C.scrollHeight),!$&&this.$maxLines&&this.lineHeight>1&&(!C.style.height||C.style.height=="0px")&&(C.style.height="1px",$=C.clientHeight||C.scrollHeight),x||(x=C.clientWidth||C.scrollWidth);var b=this.$updateCachedSize(_,F,x,$);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!x&&!$)return this.resizing=0;_&&(this.$gutterLayer.$padding=null),_?this.$renderChanges(b|this.$changes,!0):this.$loop.schedule(b|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},D.prototype.$updateCachedSize=function(_,F,x,$){$-=this.$extraHeight||0;var C=0,b=this.$size,T={width:b.width,height:b.height,scrollerHeight:b.scrollerHeight,scrollerWidth:b.scrollerWidth};if($&&(_||b.height!=$)&&(b.height=$,C|=this.CHANGE_SIZE,b.scrollerHeight=b.height,this.$horizScroll&&(b.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(b.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",C=C|this.CHANGE_SCROLL),x&&(_||b.width!=x)){C|=this.CHANGE_SIZE,b.width=x,F==null&&(F=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=F,p.setStyle(this.scrollBarH.element.style,"left",F+"px"),p.setStyle(this.scroller.style,"left",F+this.margin.left+"px"),b.scrollerWidth=Math.max(0,x-F-this.scrollBarV.getWidth()-this.margin.h),p.setStyle(this.$gutter.style,"left",this.margin.left+"px");var I=this.scrollBarV.getWidth()+"px";p.setStyle(this.scrollBarH.element.style,"right",I),p.setStyle(this.scroller.style,"right",I),p.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(b.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||_)&&(C|=this.CHANGE_FULL)}return b.$dirty=!x||!$,C&&this._signal("resize",T),C},D.prototype.onGutterResize=function(_){var F=this.$showGutter?_:0;F!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,F,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()},D.prototype.adjustWrapLimit=function(){var _=this.$size.scrollerWidth-this.$padding*2,F=Math.floor(_/this.characterWidth);return this.session.adjustWrapLimit(F,this.$showPrintMargin&&this.$printMarginColumn)},D.prototype.setAnimatedScroll=function(_){this.setOption("animatedScroll",_)},D.prototype.getAnimatedScroll=function(){return this.$animatedScroll},D.prototype.setShowInvisibles=function(_){this.setOption("showInvisibles",_),this.session.$bidiHandler.setShowInvisibles(_)},D.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},D.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},D.prototype.setDisplayIndentGuides=function(_){this.setOption("displayIndentGuides",_)},D.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},D.prototype.setHighlightIndentGuides=function(_){this.setOption("highlightIndentGuides",_)},D.prototype.setShowPrintMargin=function(_){this.setOption("showPrintMargin",_)},D.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},D.prototype.setPrintMarginColumn=function(_){this.setOption("printMarginColumn",_)},D.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},D.prototype.getShowGutter=function(){return this.getOption("showGutter")},D.prototype.setShowGutter=function(_){return this.setOption("showGutter",_)},D.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},D.prototype.setFadeFoldWidgets=function(_){this.setOption("fadeFoldWidgets",_)},D.prototype.setHighlightGutterLine=function(_){this.setOption("highlightGutterLine",_)},D.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},D.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var _=p.createElement("div");_.className="ace_layer ace_print-margin-layer",this.$printMarginEl=p.createElement("div"),this.$printMarginEl.className="ace_print-margin",_.appendChild(this.$printMarginEl),this.content.insertBefore(_,this.content.firstChild)}var F=this.$printMarginEl.style;F.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",F.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},D.prototype.getContainerElement=function(){return this.container},D.prototype.getMouseEventTarget=function(){return this.scroller},D.prototype.getTextAreaContainer=function(){return this.container},D.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var _=this.textarea.style,F=this.$composition;if(!this.$keepTextAreaAtCursor&&!F){p.translate(this.textarea,-100,0);return}var x=this.$cursorLayer.$pixelPos;if(x){F&&F.markerRange&&(x=this.$cursorLayer.getPixelPosition(F.markerRange.start,!0));var $=this.layerConfig,C=x.top,b=x.left;C-=$.offset;var T=F&&F.useTextareaForIME||m.isMobile?this.lineHeight:1;if(C<0||C>$.height-T){p.translate(this.textarea,0,0);return}var I=1,R=this.$size.height-T;if(!F)C+=this.lineHeight;else if(F.useTextareaForIME){var N=this.textarea.value;I=this.characterWidth*this.session.$getStringScreenWidth(N)[0]}else C+=this.lineHeight+2;b-=this.scrollLeft,b>this.$size.scrollerWidth-I&&(b=this.$size.scrollerWidth-I),b+=this.gutterWidth+this.margin.left,p.setStyle(_,"height",T+"px"),p.setStyle(_,"width",I+"px"),p.translate(this.textarea,Math.min(b,this.$size.scrollerWidth-I),Math.min(C,R))}}},D.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},D.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},D.prototype.getLastFullyVisibleRow=function(){var _=this.layerConfig,F=_.lastRow,x=this.session.documentToScreenRow(F,0)*_.lineHeight;return x-this.session.getScrollTop()>_.height-_.lineHeight?F-1:F},D.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},D.prototype.setPadding=function(_){this.$padding=_,this.$textLayer.setPadding(_),this.$cursorLayer.setPadding(_),this.$markerFront.setPadding(_),this.$markerBack.setPadding(_),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},D.prototype.setScrollMargin=function(_,F,x,$){var C=this.scrollMargin;C.top=_|0,C.bottom=F|0,C.right=$|0,C.left=x|0,C.v=C.top+C.bottom,C.h=C.left+C.right,C.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-C.top),this.updateFull()},D.prototype.setMargin=function(_,F,x,$){var C=this.margin;C.top=_|0,C.bottom=F|0,C.right=$|0,C.left=x|0,C.v=C.top+C.bottom,C.h=C.left+C.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},D.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},D.prototype.setHScrollBarAlwaysVisible=function(_){this.setOption("hScrollBarAlwaysVisible",_)},D.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},D.prototype.setVScrollBarAlwaysVisible=function(_){this.setOption("vScrollBarAlwaysVisible",_)},D.prototype.$updateScrollBarV=function(){var _=this.layerConfig.maxHeight,F=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(_-=(F-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>_-F&&(_=this.scrollTop+F,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(_+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},D.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},D.prototype.freeze=function(){this.$frozen=!0},D.prototype.unfreeze=function(){this.$frozen=!1},D.prototype.$renderChanges=function(_,F){if(this.$changes&&(_|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!_&&!F){this.$changes|=_;return}if(this.$size.$dirty)return this.$changes|=_,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",_),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var x=this.layerConfig;if(_&this.CHANGE_FULL||_&this.CHANGE_SIZE||_&this.CHANGE_TEXT||_&this.CHANGE_LINES||_&this.CHANGE_SCROLL||_&this.CHANGE_H_SCROLL){if(_|=this.$computeLayerConfig()|this.$loop.clear(),x.firstRow!=this.layerConfig.firstRow&&x.firstRowScreen==this.layerConfig.firstRowScreen){var $=this.scrollTop+(x.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;$>0&&(this.scrollTop=$,_=_|this.CHANGE_SCROLL,_|=this.$computeLayerConfig()|this.$loop.clear())}x=this.layerConfig,this.$updateScrollBarV(),_&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),p.translate(this.content,-this.scrollLeft,-x.offset);var C=x.width+2*this.$padding+"px",b=x.minHeight+"px";p.setStyle(this.content.style,"width",C),p.setStyle(this.content.style,"height",b)}if(_&this.CHANGE_H_SCROLL&&(p.translate(this.content,-this.scrollLeft,-x.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),_&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(x),this.$showGutter&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x),this.$markerBack.update(x),this.$markerFront.update(x),this.$cursorLayer.update(x),this.$moveTextAreaToCursor(),this._signal("afterRender",_);return}if(_&this.CHANGE_SCROLL){this.$changedLines=null,_&this.CHANGE_TEXT||_&this.CHANGE_LINES?this.$textLayer.update(x):this.$textLayer.scrollLines(x),this.$showGutter&&(_&this.CHANGE_GUTTER||_&this.CHANGE_LINES?this.$gutterLayer.update(x):this.$gutterLayer.scrollLines(x)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x),this.$markerBack.update(x),this.$markerFront.update(x),this.$cursorLayer.update(x),this.$moveTextAreaToCursor(),this._signal("afterRender",_);return}_&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(x),this.$showGutter&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)):_&this.CHANGE_LINES?((this.$updateLines()||_&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)):_&this.CHANGE_TEXT||_&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)):_&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)),_&this.CHANGE_CURSOR&&(this.$cursorLayer.update(x),this.$moveTextAreaToCursor()),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(x),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(x),this._signal("afterRender",_)},D.prototype.$autosize=function(){var _=this.session.getScreenLength()*this.lineHeight,F=this.$maxLines*this.lineHeight,x=Math.min(F,Math.max((this.$minLines||1)*this.lineHeight,_))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(x+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&x>this.$maxPixelHeight&&(x=this.$maxPixelHeight);var $=x<=2*this.lineHeight,C=!$&&_>F;if(x!=this.desiredHeight||this.$size.height!=this.desiredHeight||C!=this.$vScroll){C!=this.$vScroll&&(this.$vScroll=C,this.scrollBarV.setVisible(C));var b=this.container.clientWidth;this.container.style.height=x+"px",this.$updateCachedSize(!0,this.$gutterWidth,b,x),this.desiredHeight=x,this._signal("autosize")}},D.prototype.$computeLayerConfig=function(){var _=this.session,F=this.$size,x=F.height<=2*this.lineHeight,$=this.session.getScreenLength(),C=$*this.lineHeight,b=this.$getLongestLine(),T=!x&&(this.$hScrollBarAlwaysVisible||F.scrollerWidth-b-2*this.$padding<0),I=this.$horizScroll!==T;I&&(this.$horizScroll=T,this.scrollBarH.setVisible(T));var R=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),x=F.height<=2*this.lineHeight);var N=F.scrollerHeight+this.lineHeight,P=!this.$maxLines&&this.$scrollPastEnd?(F.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;C+=P;var B=this.scrollMargin;this.session.setScrollTop(Math.max(-B.top,Math.min(this.scrollTop,C-F.scrollerHeight+B.bottom))),this.session.setScrollLeft(Math.max(-B.left,Math.min(this.scrollLeft,b+2*this.$padding-F.scrollerWidth+B.right)));var V=!x&&(this.$vScrollBarAlwaysVisible||F.scrollerHeight-C+P<0||this.scrollTop>B.top),W=R!==V;W&&(this.$vScroll=V,this.scrollBarV.setVisible(V));var z=this.scrollTop%this.lineHeight,U=Math.ceil(N/this.lineHeight)-1,G=Math.max(0,Math.round((this.scrollTop-z)/this.lineHeight)),Y=G+U,Q,q,te=this.lineHeight;G=_.screenToDocumentRow(G,0);var re=_.getFoldLine(G);re&&(G=re.start.row),Q=_.documentToScreenRow(G,0),q=_.getRowLength(G)*te,Y=Math.min(_.screenToDocumentRow(Y,0),_.getLength()-1),N=F.scrollerHeight+_.getRowLength(Y)*te+q,z=this.scrollTop-Q*te,z<0&&Q>0&&(Q=Math.max(0,Q+Math.floor(z/te)),z=this.scrollTop-Q*te);var ue=0;return(this.layerConfig.width!=b||I)&&(ue=this.CHANGE_H_SCROLL),(I||W)&&(ue|=this.$updateCachedSize(!0,this.gutterWidth,F.width,F.height),this._signal("scrollbarVisibilityChanged"),W&&(b=this.$getLongestLine())),this.layerConfig={width:b,padding:this.$padding,firstRow:G,firstRowScreen:Q,lastRow:Y,lineHeight:te,characterWidth:this.characterWidth,minHeight:N,maxHeight:C,offset:z,gutterOffset:te?Math.max(0,Math.ceil((z+F.height-F.scrollerHeight)/te)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(b-this.$padding),ue},D.prototype.$updateLines=function(){if(this.$changedLines){var _=this.$changedLines.firstRow,F=this.$changedLines.lastRow;this.$changedLines=null;var x=this.layerConfig;if(!(_>x.lastRow+1)&&!(F<x.firstRow)){if(F===1/0){this.$showGutter&&this.$gutterLayer.update(x),this.$textLayer.update(x);return}return this.$textLayer.updateLines(x,_,F),!0}}},D.prototype.$getLongestLine=function(){var _=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(_+=1),this.$textLayer&&_>this.$textLayer.MAX_LINE_LENGTH&&(_=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(_*this.characterWidth))},D.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},D.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},D.prototype.addGutterDecoration=function(_,F){this.$gutterLayer.addGutterDecoration(_,F)},D.prototype.removeGutterDecoration=function(_,F){this.$gutterLayer.removeGutterDecoration(_,F)},D.prototype.updateBreakpoints=function(_){this._rows=_,this.$loop.schedule(this.CHANGE_GUTTER)},D.prototype.setAnnotations=function(_){this.$gutterLayer.setAnnotations(_),this.$loop.schedule(this.CHANGE_GUTTER)},D.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},D.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},D.prototype.showCursor=function(){this.$cursorLayer.showCursor()},D.prototype.scrollSelectionIntoView=function(_,F,x){this.scrollCursorIntoView(_,x),this.scrollCursorIntoView(F,x)},D.prototype.scrollCursorIntoView=function(_,F,x){if(this.$size.scrollerHeight!==0){var $=this.$cursorLayer.getPixelPosition(_),C=$.left,b=$.top,T=x&&x.top||0,I=x&&x.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var R=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;R+T>b?(F&&R+T>b+this.lineHeight&&(b-=F*this.$size.scrollerHeight),b===0&&(b=-this.scrollMargin.top),this.session.setScrollTop(b)):R+this.$size.scrollerHeight-I<b+this.lineHeight&&(F&&R+this.$size.scrollerHeight-I<b-this.lineHeight&&(b+=F*this.$size.scrollerHeight),this.session.setScrollTop(b+this.lineHeight+I-this.$size.scrollerHeight));var N=this.scrollLeft,P=2*this.layerConfig.characterWidth;C-P<N?(C-=P,C<this.$padding+P&&(C=-this.scrollMargin.left),this.session.setScrollLeft(C)):(C+=P,N+this.$size.scrollerWidth<C+this.characterWidth?this.session.setScrollLeft(Math.round(C+this.characterWidth-this.$size.scrollerWidth)):N<=this.$padding&&C-N<this.characterWidth&&this.session.setScrollLeft(0))}},D.prototype.getScrollTop=function(){return this.session.getScrollTop()},D.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},D.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},D.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},D.prototype.scrollToRow=function(_){this.session.setScrollTop(_*this.lineHeight)},D.prototype.alignCursor=function(_,F){typeof _=="number"&&(_={row:_,column:0});var x=this.$cursorLayer.getPixelPosition(_),$=this.$size.scrollerHeight-this.lineHeight,C=x.top-$*(F||0);return this.session.setScrollTop(C),C},D.prototype.$calcSteps=function(_,F){var x=0,$=this.STEPS,C=[],b=function(T,I,R){return R*(Math.pow(T-1,3)+1)+I};for(x=0;x<$;++x)C.push(b(x/this.STEPS,_,F-_));return C},D.prototype.scrollToLine=function(_,F,x,$){var C=this.$cursorLayer.getPixelPosition({row:_,column:0}),b=C.top;F&&(b-=this.$size.scrollerHeight/2);var T=this.scrollTop;this.session.setScrollTop(b),x!==!1&&this.animateScrolling(T,$)},D.prototype.animateScrolling=function(_,F){var x=this.scrollTop;if(!this.$animatedScroll)return;var $=this;if(_==x)return;if(this.$scrollAnimation){var C=this.$scrollAnimation.steps;if(C.length&&(_=C[0],_==x))return}var b=$.$calcSteps(_,x);this.$scrollAnimation={from:_,to:x,steps:b},clearInterval(this.$timer),$.session.setScrollTop(b.shift()),$.session.$scrollTop=x;function T(){$.$timer=clearInterval($.$timer),$.$scrollAnimation=null,$.$stopAnimation=!1,F&&F()}this.$timer=setInterval(function(){if($.$stopAnimation){T();return}if(!$.session)return clearInterval($.$timer);b.length?($.session.setScrollTop(b.shift()),$.session.$scrollTop=x):x!=null?($.session.$scrollTop=-1,$.session.setScrollTop(x),x=null):T()},10)},D.prototype.scrollToY=function(_){this.scrollTop!==_&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=_)},D.prototype.scrollToX=function(_){this.scrollLeft!==_&&(this.scrollLeft=_),this.$loop.schedule(this.CHANGE_H_SCROLL)},D.prototype.scrollTo=function(_,F){this.session.setScrollTop(F),this.session.setScrollLeft(_)},D.prototype.scrollBy=function(_,F){F&&this.session.setScrollTop(this.session.getScrollTop()+F),_&&this.session.setScrollLeft(this.session.getScrollLeft()+_)},D.prototype.isScrollableBy=function(_,F){if(F<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||F>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||_<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||_>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},D.prototype.pixelToScreenCoordinates=function(_,F){var x;if(this.$hasCssTransforms){x={top:0,left:0};var $=this.$fontMetrics.transformCoordinates([_,F]);_=$[1]-this.gutterWidth-this.margin.left,F=$[0]}else x=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-x.left-this.$padding,b=C/this.characterWidth,T=Math.floor((F+this.scrollTop-x.top)/this.lineHeight),I=this.$blockCursor?Math.floor(b):Math.round(b);return{row:T,column:I,side:b-I>0?1:-1,offsetX:C}},D.prototype.screenToTextCoordinates=function(_,F){var x;if(this.$hasCssTransforms){x={top:0,left:0};var $=this.$fontMetrics.transformCoordinates([_,F]);_=$[1]-this.gutterWidth-this.margin.left,F=$[0]}else x=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-x.left-this.$padding,b=C/this.characterWidth,T=this.$blockCursor?Math.floor(b):Math.round(b),I=Math.floor((F+this.scrollTop-x.top)/this.lineHeight);return this.session.screenToDocumentPosition(I,Math.max(T,0),C)},D.prototype.textToScreenCoordinates=function(_,F){var x=this.scroller.getBoundingClientRect(),$=this.session.documentToScreenPosition(_,F),C=this.$padding+(this.session.$bidiHandler.isBidiRow($.row,_)?this.session.$bidiHandler.getPosLeft($.column):Math.round($.column*this.characterWidth)),b=$.row*this.lineHeight;return{pageX:x.left+C-this.scrollLeft,pageY:x.top+b-this.scrollTop}},D.prototype.visualizeFocus=function(){p.addCssClass(this.container,"ace_focus")},D.prototype.visualizeBlur=function(){p.removeCssClass(this.container,"ace_focus")},D.prototype.showComposition=function(_){this.$composition=_,_.cssText||(_.cssText=this.textarea.style.cssText),_.useTextareaForIME==null&&(_.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(p.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):_.markerId=this.session.addMarker(_.markerRange,"ace_composition_marker","text")},D.prototype.setCompositionText=function(_){var F=this.session.selection.cursor;this.addToken(_,"composition_placeholder",F.row,F.column),this.$moveTextAreaToCursor()},D.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),p.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var _=this.session.selection.cursor;this.removeExtraToken(_.row,_.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},D.prototype.setGhostText=function(_,F){var x=this.session.selection.cursor,$=F||{row:x.row,column:x.column};this.removeGhostText();var C=this.$calculateWrappedTextChunks(_,$);this.addToken(C[0].text,"ghost_text",$.row,$.column),this.$ghostText={text:_,position:{row:$.row,column:$.column}};var b=p.createElement("div");if(C.length>1){var T=this.hideTokensAfterPosition($.row,$.column),I;C.slice(1).forEach(function(W){var z=p.createElement("div"),U=p.createElement("span");U.className="ace_ghost_text",W.wrapped&&(z.className="ghost_text_line_wrapped"),W.text.length===0&&(W.text=" "),U.appendChild(p.createTextNode(W.text)),z.appendChild(U),b.appendChild(z),I=z}),T.forEach(function(W){var z=p.createElement("span");S(W.type)||(z.className="ace_"+W.type.replace(/\./g," ace_")),z.appendChild(p.createTextNode(W.value)),I.appendChild(z)}),this.$ghostTextWidget={el:b,row:$.row,column:$.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var R=this.$cursorLayer.getPixelPosition($,!0),N=this.container,P=N.getBoundingClientRect().height,B=C.length*this.lineHeight,V=B<P-R.top;if(V)return;B<P?this.scrollBy(0,(C.length-1)*this.lineHeight):this.scrollToRow($.row)}},D.prototype.$calculateWrappedTextChunks=function(_,F){var x=this.$size.scrollerWidth-this.$padding*2,$=Math.floor(x/this.characterWidth)-2;$=$<=0?60:$;for(var C=_.split(/\r?\n/),b=[],T=0;T<C.length;T++){var I=this.session.$getDisplayTokens(C[T],F.column),R=this.session.$computeWrapSplits(I,$,this.session.$tabSize);if(R.length>0){var N=0;R.push(C[T].length);for(var P=0;P<R.length;P++){var B=C[T].slice(N,R[P]);b.push({text:B,wrapped:!0}),N=R[P]}}else b.push({text:C[T],wrapped:!1})}return b},D.prototype.removeGhostText=function(){if(this.$ghostText){var _=this.$ghostText.position;this.removeExtraToken(_.row,_.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},D.prototype.addToken=function(_,F,x,$){var C=this.session;C.bgTokenizer.lines[x]=null;var b={type:F,value:_},T=C.getTokens(x);if($==null||!T.length)T.push(b);else for(var I=0,R=0;R<T.length;R++){var N=T[R];if(I+=N.value.length,$<=I){var P=N.value.length-(I-$),B=N.value.slice(0,P),V=N.value.slice(P);T.splice(R,1,{type:N.type,value:B},b,{type:N.type,value:V});break}}this.updateLines(x,x)},D.prototype.hideTokensAfterPosition=function(_,F){for(var x=this.session.getTokens(_),$=0,C=!1,b=[],T=0;T<x.length;T++){var I=x[T];if($+=I.value.length,I.type!=="ghost_text"){if(C){b.push({type:I.type,value:I.value}),I.type="hidden_token";continue}$===F&&(C=!0)}}return this.updateLines(_,_),b},D.prototype.removeExtraToken=function(_,F){this.session.bgTokenizer.lines[_]=null,this.updateLines(_,_)},D.prototype.setTheme=function(_,F){var x=this;if(this.$themeId=_,x._dispatchEvent("themeChange",{theme:_}),!_||typeof _=="string"){var $=_||this.$options.theme.initialValue;s.loadModule(["theme",$],C)}else C(_);function C(b){if(x.$themeId!=_)return F&&F();if(!b||!b.cssClass)throw new Error("couldn't load module "+_+" or it didn't call define");b.$id&&(x.$themeId=b.$id),p.importCssString(b.cssText,b.cssClass,x.container),x.theme&&p.removeCssClass(x.container,x.theme.cssClass);var T="padding"in b?b.padding:"padding"in(x.theme||{})?4:x.$padding;if(x.$padding&&T!=x.$padding&&x.setPadding(T),x.$gutterLayer){var I=b.$showGutterCursorMarker;I&&!x.$gutterLayer.$showCursorMarker?x.$gutterLayer.$showCursorMarker="theme":!I&&x.$gutterLayer.$showCursorMarker=="theme"&&(x.$gutterLayer.$showCursorMarker=null)}x.$theme=b.cssClass,x.theme=b,p.addCssClass(x.container,b.cssClass),p.setCssClass(x.container,"ace_dark",b.isDark),x.$size&&(x.$size.width=0,x.$updateSizeAsync()),x._dispatchEvent("themeLoaded",{theme:b}),F&&F(),m.isSafari&&x.scroller&&(x.scroller.style.background="red",x.scroller.style.background="")}},D.prototype.getTheme=function(){return this.$themeId},D.prototype.setStyle=function(_,F){p.setCssClass(this.container,_,F!==!1)},D.prototype.unsetStyle=function(_){p.removeCssClass(this.container,_)},D.prototype.setCursorStyle=function(_){p.setStyle(this.scroller.style,"cursor",_)},D.prototype.setMouseCursor=function(_){p.setStyle(this.scroller.style,"cursor",_)},D.prototype.attachToShadowRoot=function(){p.importCssString(E,"ace_editor.css",this.container)},D.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},D.prototype.$updateCustomScrollbar=function(_){var F=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),_===!0?(this.scrollBarV=new f(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(x){F.$scrollAnimation||F.session.setScrollTop(x.data-F.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(x){F.$scrollAnimation||F.session.setScrollLeft(x.data-F.scrollMargin.left)}),this.$scrollDecorator?(this.$scrollDecorator.setScrollBarV(this.scrollBarV),this.$scrollDecorator.$updateDecorators()):(this.$scrollDecorator=new w(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators())):(this.scrollBarV=new r(this.container,this),this.scrollBarH=new h(this.container,this),this.scrollBarV.addEventListener("scroll",function(x){F.$scrollAnimation||F.session.setScrollTop(x.data-F.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(x){F.$scrollAnimation||F.session.setScrollLeft(x.data-F.scrollMargin.left)}))},D.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var _=this;this.$resizeTimer=d.delayedCall(function(){_.destroyed||_.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(F){var x=F[0].contentRect.width,$=F[0].contentRect.height;Math.abs(_.$size.width-x)>1||Math.abs(_.$size.height-$)>1?_.$resizeTimer.delay():_.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},D})();k.prototype.CHANGE_CURSOR=1,k.prototype.CHANGE_MARKER=2,k.prototype.CHANGE_GUTTER=4,k.prototype.CHANGE_SCROLL=8,k.prototype.CHANGE_LINES=16,k.prototype.CHANGE_TEXT=32,k.prototype.CHANGE_SIZE=64,k.prototype.CHANGE_MARKER_BACK=128,k.prototype.CHANGE_MARKER_FRONT=256,k.prototype.CHANGE_FULL=512,k.prototype.CHANGE_H_SCROLL=1024,k.prototype.$changes=0,k.prototype.$padding=null,k.prototype.$frozen=!1,k.prototype.STEPS=8,a.implement(k.prototype,A),s.defineOptions(k.prototype,"renderer",{useResizeObserver:{set:function(D){!D&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):D&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(D){this.$textLayer.setShowInvisibles(D)&&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(D){typeof D=="number"&&(this.$printMarginColumn=D),this.$showPrintMargin=!!D,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(D){this.$gutter.style.display=D?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(D){this.$gutterLayer.$useSvgGutterIcons=D},initialValue:!1},showFoldedAnnotations:{set:function(D){this.$gutterLayer.$showFoldedAnnotations=D},initialValue:!1},fadeFoldWidgets:{set:function(D){p.setCssClass(this.$gutter,"ace_fade-fold-widgets",D)},initialValue:!1},showFoldWidgets:{set:function(D){this.$gutterLayer.setShowFoldWidgets(D),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(D){this.$textLayer.setDisplayIndentGuides(D)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(D){this.$textLayer.setHighlightIndentGuides(D)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(D){this.$gutterLayer.setHighlightGutterLine(D),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(D){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(D){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(D){typeof D=="number"&&(D=D+"px"),this.container.style.fontSize=D,this.updateFontSize()},initialValue:12},fontFamily:{set:function(D){this.container.style.fontFamily=D,this.updateFontSize()}},maxLines:{set:function(D){this.updateFull()}},minLines:{set:function(D){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(D){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(D){D=+D||0,this.$scrollPastEnd!=D&&(this.$scrollPastEnd=D,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(D){this.$gutterLayer.$fixedWidth=!!D,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(D){this.$updateCustomScrollbar(D)},initialValue:!1},theme:{set:function(D){this.setTheme(D)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!m.isMobile&&!m.isIE}}),l.VirtualRenderer=k}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(n,l,y){var a=n("../lib/oop"),p=n("../lib/net"),d=n("../lib/event_emitter").EventEmitter,s=n("../config");function c(h){var r="importScripts('"+p.qualifyURL(h)+"');";try{return new Blob([r],{type:"application/javascript"})}catch{var u=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,f=new u;return f.append(r),f.getBlob("application/javascript")}}function e(h){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(s.get("loadWorkerFromBlob")){var r=c(h),u=window.URL||window.webkitURL,f=u.createObjectURL(r);return new Worker(f)}return new Worker(h)}var i=function(h){h.postMessage||(h=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=h,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){a.implement(this,d),this.$createWorkerFromOldConfig=function(h,r,u,f,g){if(n.nameToUrl&&!n.toUrl&&(n.toUrl=n.nameToUrl),s.get("packaged")||!n.toUrl)f=f||s.moduleUrl(r,"worker");else{var v=this.$normalizePath;f=f||v(n.toUrl("ace/worker/worker.js",null,"_"));var A={};h.forEach(function(E){A[E]=v(n.toUrl(E,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=e(f),g&&this.send("importScripts",g),this.$worker.postMessage({init:!0,tlns:A,module:r,classname:u}),this.$worker},this.onMessage=function(h){var r=h.data;switch(r.type){case"event":this._signal(r.name,{data:r.data});break;case"call":var u=this.callbacks[r.id];u&&(u(r.data),delete this.callbacks[r.id]);break;case"error":this.reportError(r.data);break;case"log":window.console&&console.log&&console.log.apply(console,r.data);break}},this.reportError=function(h){window.console&&console.error&&console.error(h)},this.$normalizePath=function(h){return p.qualifyURL(h)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(h){h.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(h,r){this.$worker.postMessage({command:h,args:r})},this.call=function(h,r,u){if(u){var f=this.callbackId++;this.callbacks[f]=u,r.push(f)}this.send(h,r)},this.emit=function(h,r){try{r.data&&r.data.err&&(r.data.err={message:r.data.err.message,stack:r.data.err.stack,code:r.data.err.code}),this.$worker&&this.$worker.postMessage({event:h,data:{data:r.data}})}catch(u){console.error(u.stack)}},this.attachToDocument=function(h){this.$doc&&this.terminate(),this.$doc=h,this.call("setValue",[h.getValue()]),h.on("change",this.changeListener,!0)},this.changeListener=function(h){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),h.action=="insert"?this.deltaQueue.push(h.start,h.lines):this.deltaQueue.push(h.start,h.end)},this.$sendDeltaQueue=function(){var h=this.deltaQueue;h&&(this.deltaQueue=null,h.length>50&&h.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:h}))}}).call(i.prototype);var o=function(h,r,u){var f=null,g=!1,v=Object.create(d),A=[],E=new i({messageBuffer:A,terminate:function(){},postMessage:function(m){A.push(m),f&&(g?setTimeout(w):w())}});E.setEmitSync=function(m){g=m};var w=function(){var m=A.shift();m.command?f[m.command].apply(f,m.args):m.event&&v._signal(m.event,m.data)};return v.postMessage=function(m){E.onMessage({data:m})},v.callback=function(m,S){this.postMessage({type:"call",id:S,data:m})},v.emit=function(m,S){this.postMessage({type:"event",name:m,data:S})},s.loadModule(["worker",r],function(m){for(f=new m[u](v);A.length;)w()}),E};l.UIWorkerClient=o,l.WorkerClient=i,l.createWorker=e}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(n,l,y){var a=n("./range").Range,p=n("./lib/event_emitter").EventEmitter,d=n("./lib/oop"),s=(function(){function c(e,i,o,h,r,u){var f=this;this.length=i,this.session=e,this.doc=e.getDocument(),this.mainClass=r,this.othersClass=u,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=h,this.$onCursorChange=function(){setTimeout(function(){f.onCursorChange()})},this.$pos=o;var g=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=g.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}return c.prototype.setup=function(){var e=this,i=this.doc,o=this.session;this.selectionBefore=o.selection.toJSON(),o.selection.inMultiSelectMode&&o.selection.toSingleRange(),this.pos=i.createAnchor(this.$pos.row,this.$pos.column);var h=this.pos;h.$insertRight=!0,h.detach(),h.markerId=o.addMarker(new a(h.row,h.column,h.row,h.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(r){var u=i.createAnchor(r.row,r.column);u.$insertRight=!0,u.detach(),e.others.push(u)}),o.setUndoSelect(!1)},c.prototype.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,i=this;this.othersActive=!0,this.others.forEach(function(o){o.markerId=e.addMarker(new a(o.row,o.column,o.row,o.column+i.length),i.othersClass,null,!1)})}},c.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},c.prototype.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var i=e;if(i.start.row===i.end.row&&i.start.row===this.pos.row){this.$updating=!0;var o=e.action==="insert"?i.end.column-i.start.column:i.start.column-i.end.column,h=i.start.column>=this.pos.column&&i.start.column<=this.pos.column+this.length+1,r=i.start.column-this.pos.column;if(this.updateAnchors(e),h&&(this.length+=o),h&&!this.session.$fromUndo){if(e.action==="insert")for(var u=this.others.length-1;u>=0;u--){var f=this.others[u],g={row:f.row,column:f.column+r};this.doc.insertMergedLines(g,e.lines)}else if(e.action==="remove")for(var u=this.others.length-1;u>=0;u--){var f=this.others[u],g={row:f.row,column:f.column+r};this.doc.remove(new a(g.row,g.column,g.row,g.column-o))}}this.$updating=!1,this.updateMarkers()}},c.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var i=this.others.length;i--;)this.others[i].onChange(e);this.updateMarkers()},c.prototype.updateMarkers=function(){if(!this.$updating){var e=this,i=this.session,o=function(r,u){i.removeMarker(r.markerId),r.markerId=i.addMarker(new a(r.row,r.column,r.row,r.column+e.length),u,null,!1)};o(this.pos,this.mainClass);for(var h=this.others.length;h--;)o(this.others[h],this.othersClass)}},c.prototype.onCursorChange=function(e){if(!(this.$updating||!this.session)){var i=this.session.selection.getCursor();i.row===this.pos.row&&i.column>=this.pos.column&&i.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},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 e=this.session.getUndoManager(),i=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,o=0;o<i;o++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},c})();d.implement(s.prototype,p),l.PlaceHolder=s}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(n,l,y){var a=n("../lib/event"),p=n("../lib/useragent");function d(c,e){return c.row==e.row&&c.column==e.column}function s(c){var e=c.domEvent,i=e.altKey,o=e.shiftKey,h=e.ctrlKey,r=c.getAccelKey(),u=c.getButton();if(h&&p.isMac&&(u=e.button),c.editor.inMultiSelectMode&&u==2){c.editor.textInput.onContextMenu(c.domEvent);return}if(!h&&!i&&!r){u===0&&c.editor.inMultiSelectMode&&c.editor.exitMultiSelectMode();return}if(u===0){var f=c.editor,g=f.selection,v=f.inMultiSelectMode,A=c.getDocumentPosition(),E=g.getCursor(),w=c.inSelection()||g.isEmpty()&&d(A,E),m=c.x,S=c.y,k=function(B){m=B.clientX,S=B.clientY},D=f.session,_=f.renderer.pixelToScreenCoordinates(m,S),F=_,x;if(f.$mouseHandler.$enableJumpToDef)h&&i||r&&i?x=o?"block":"add":i&&f.$blockSelectEnabled&&(x="block");else if(r&&!i){if(x="add",!v&&o)return}else i&&f.$blockSelectEnabled&&(x="block");if(x&&p.isMac&&e.ctrlKey&&f.$mouseHandler.cancelContextMenu(),x=="add"){if(!v&&w)return;if(!v){var $=g.toOrientedRange();f.addSelectionMarker($)}var C=g.rangeList.rangeAtPoint(A);f.inVirtualSelectionMode=!0,o&&(C=null,$=g.ranges[0]||$,f.removeSelectionMarker($)),f.once("mouseup",function(){var B=g.toOrientedRange();C&&B.isEmpty()&&d(C.cursor,B.cursor)?g.substractPoint(B.cursor):(o?g.substractPoint($.cursor):$&&(f.removeSelectionMarker($),g.addRange($)),g.addRange(B)),f.inVirtualSelectionMode=!1})}else if(x=="block"){c.stop(),f.inVirtualSelectionMode=!0;var b,T=[],I=function(){var B=f.renderer.pixelToScreenCoordinates(m,S),V=D.screenToDocumentPosition(B.row,B.column,B.offsetX);d(F,B)&&d(V,g.lead)||(F=B,f.selection.moveToPosition(V),f.renderer.scrollCursorIntoView(),f.removeSelectionMarkers(T),T=g.rectangularRangeBlock(F,_),f.$mouseHandler.$clickSelection&&T.length==1&&T[0].isEmpty()&&(T[0]=f.$mouseHandler.$clickSelection.clone()),T.forEach(f.addSelectionMarker,f),f.updateSelectionMarkers())};v&&!r?g.toSingleRange():!v&&r&&(b=g.toOrientedRange(),f.addSelectionMarker(b)),o?_=D.documentToScreenPosition(g.lead):g.moveToPosition(A),F={row:-1,column:-1};var R=function(B){I(),clearInterval(P),f.removeSelectionMarkers(T),T.length||(T=[g.toOrientedRange()]),b&&(f.removeSelectionMarker(b),g.toSingleRange(b));for(var V=0;V<T.length;V++)g.addRange(T[V]);f.inVirtualSelectionMode=!1,f.$mouseHandler.$clickSelection=null},N=I;a.capture(f.container,k,R);var P=setInterval(function(){N()},20);return c.preventDefault()}}}l.onMouseDown=s}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(n,l,y){l.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(p){p.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(p){p.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(p){p.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(p){p.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(p){p.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(p){p.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(p){p.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(p){p.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(p){p.multiSelect.rangeCount>1?p.multiSelect.joinSelections():p.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(p){p.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(p){p.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(p){p.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(p){p.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(p){return p&&p.inMultiSelectMode}}];var a=n("../keyboard/hash_handler").HashHandler;l.keyboardHandler=new a(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(n,l,y){var a=n("./range_list").RangeList,p=n("./range").Range,d=n("./selection").Selection,s=n("./mouse/multi_select_handler").onMouseDown,c=n("./lib/event"),e=n("./lib/lang"),i=n("./commands/multi_select_commands");l.commands=i.defaultCommands.concat(i.multiSelectCommands);var o=n("./search").Search,h=new o;function r(E,w,m){return h.$options.wrap=!0,h.$options.needle=w,h.$options.backwards=m==-1,h.find(E)}var u=n("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(u.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(E,w){if(E){if(!this.inMultiSelectMode&&this.rangeCount===0){var m=this.toOrientedRange();if(this.rangeList.add(m),this.rangeList.add(E),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),w||this.fromOrientedRange(E);this.rangeList.removeAll(),this.rangeList.add(m),this.$onAddRange(m)}E.cursor||(E.cursor=E.end);var S=this.rangeList.add(E);return this.$onAddRange(E),S.length&&this.$onRemoveRange(S),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),w||this.fromOrientedRange(E)}},this.toSingleRange=function(E){E=E||this.ranges[0];var w=this.rangeList.removeAll();w.length&&this.$onRemoveRange(w),E&&this.fromOrientedRange(E)},this.substractPoint=function(E){var w=this.rangeList.substractPoint(E);if(w)return this.$onRemoveRange(w),w[0]},this.mergeOverlappingRanges=function(){var E=this.rangeList.merge();E.length&&this.$onRemoveRange(E)},this.$onAddRange=function(E){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(E),this._signal("addRange",{range:E})},this.$onRemoveRange=function(E){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var w=this.rangeList.ranges.pop();E.push(w),this.rangeCount=0}for(var m=E.length;m--;){var S=this.ranges.indexOf(E[m]);this.ranges.splice(S,1)}this._signal("removeRange",{ranges:E}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),w=w||this.ranges[0],w&&!w.isEqual(this.getRange())&&this.fromOrientedRange(w)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new a,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var E=this.ranges.length?this.ranges:[this.getRange()],w=[],m=0;m<E.length;m++){var S=E[m],k=S.start.row,D=S.end.row;if(k===D)w.push(S.clone());else{for(w.push(new p(k,S.start.column,k,this.session.getLine(k).length));++k<D;)w.push(this.getLineRange(k,!0));w.push(new p(D,0,D,S.end.column))}m==0&&!this.isBackwards()&&(w=w.reverse())}this.toSingleRange();for(var m=w.length;m--;)this.addRange(w[m])},this.joinSelections=function(){var E=this.rangeList.ranges,w=E[E.length-1],m=p.fromPoints(E[0].start,w.end);this.toSingleRange(),this.setSelectionRange(m,w.cursor==w.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var E=this.rangeList.ranges,w=E[E.length-1],m=p.fromPoints(E[0].start,w.end);this.toSingleRange(),this.setSelectionRange(m,w.cursor==w.start)}else{var S=this.session.documentToScreenPosition(this.cursor),k=this.session.documentToScreenPosition(this.anchor),D=this.rectangularRangeBlock(S,k);D.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(E,w,m){var S=[],k=E.column<w.column;if(k)var D=E.column,_=w.column,F=E.offsetX,x=w.offsetX;else var D=w.column,_=E.column,F=w.offsetX,x=E.offsetX;var $=E.row<w.row;if($)var C=E.row,b=w.row;else var C=w.row,b=E.row;D<0&&(D=0),C<0&&(C=0),C==b&&(m=!0);for(var T,I=C;I<=b;I++){var R=p.fromPoints(this.session.screenToDocumentPosition(I,D,F),this.session.screenToDocumentPosition(I,_,x));if(R.isEmpty()){if(T&&g(R.end,T))break;T=R.end}R.cursor=k?R.start:R.end,S.push(R)}if($&&S.reverse(),!m){for(var N=S.length-1;S[N].isEmpty()&&N>0;)N--;if(N>0)for(var P=0;S[P].isEmpty();)P++;for(var B=N;B>=P;B--)S[B].isEmpty()&&S.splice(B,1)}return S}}).call(d.prototype);var f=n("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(E){E.cursor||(E.cursor=E.end);var w=this.getSelectionStyle();return E.marker=this.session.addMarker(E,"ace_selection",w),this.session.$selectionMarkers.push(E),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,E},this.removeSelectionMarker=function(E){if(E.marker){this.session.removeMarker(E.marker);var w=this.session.$selectionMarkers.indexOf(E);w!=-1&&this.session.$selectionMarkers.splice(w,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(E){for(var w=this.session.$selectionMarkers,m=E.length;m--;){var S=E[m];if(S.marker){this.session.removeMarker(S.marker);var k=w.indexOf(S);k!=-1&&w.splice(k,1)}}this.session.selectionMarkerCount=w.length},this.$onAddRange=function(E){this.addSelectionMarker(E.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(E){this.removeSelectionMarkers(E.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(E){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(i.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(E){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(i.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(E){var w=E.command,m=E.editor;if(m.multiSelect){if(w.multiSelectAction)w.multiSelectAction=="forEach"?S=m.forEachSelection(w,E.args):w.multiSelectAction=="forEachLine"?S=m.forEachSelection(w,E.args,!0):w.multiSelectAction=="single"?(m.exitMultiSelectMode(),S=w.exec(m,E.args||{})):S=w.multiSelectAction(m,E.args||{});else{var S=w.exec(m,E.args||{});m.multiSelect.addRange(m.multiSelect.toOrientedRange()),m.multiSelect.mergeOverlappingRanges()}return S}},this.forEachSelection=function(E,w,m){if(!this.inVirtualSelectionMode){var S=m&&m.keepOrder,k=m==!0||m&&m.$byLines,D=this.session,_=this.selection,F=_.rangeList,x=(S?_:F).ranges,$;if(!x.length)return E.exec?E.exec(this,w||{}):E(this,w||{});var C=_._eventRegistry;_._eventRegistry={};var b=new d(D);this.inVirtualSelectionMode=!0;for(var T=x.length;T--;){if(k)for(;T>0&&x[T].start.row==x[T-1].end.row;)T--;b.fromOrientedRange(x[T]),b.index=T,this.selection=D.selection=b;var I=E.exec?E.exec(this,w||{}):E(this,w||{});!$&&I!==void 0&&($=I),b.toOrientedRange(x[T])}b.detach(),this.selection=D.selection=_,this.inVirtualSelectionMode=!1,_._eventRegistry=C,_.mergeOverlappingRanges(),_.ranges[0]&&_.fromOrientedRange(_.ranges[0]);var R=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),R&&R.from==R.to&&this.renderer.animateScrolling(R.from),$}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var E="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var w=this.multiSelect.rangeList.ranges,m=[],S=0;S<w.length;S++)m.push(this.session.getTextRange(w[S]));var k=this.session.getDocument().getNewLineCharacter();E=m.join(k),E.length==(m.length-1)*k.length&&(E="")}else this.selection.isEmpty()||(E=this.session.getTextRange(this.getSelectionRange()));return E},this.$checkMultiselectChange=function(E,w){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var m=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&w==this.multiSelect.anchor)return;var S=w==this.multiSelect.anchor?m.cursor==m.start?m.end:m.start:m.cursor;S.row!=w.row||this.session.$clipPositionToDocument(S.row,S.column).column!=w.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(E,w,m){if(w=w||{},w.needle=E||w.needle,w.needle==null){var S=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();w.needle=this.session.getTextRange(S)}this.$search.set(w);var k=this.$search.findAll(this.session);if(!k.length)return 0;var D=this.multiSelect;m||D.toSingleRange(k[0]);for(var _=k.length;_--;)D.addRange(k[_],!0);return S&&D.rangeList.rangeAtPoint(S.start)&&D.addRange(S,!0),k.length},this.selectMoreLines=function(E,w){var m=this.selection.toOrientedRange(),S=m.cursor==m.end,k=this.session.documentToScreenPosition(m.cursor);this.selection.$desiredColumn&&(k.column=this.selection.$desiredColumn);var D=this.session.screenToDocumentPosition(k.row+E,k.column);if(m.isEmpty())var F=D;else var _=this.session.documentToScreenPosition(S?m.end:m.start),F=this.session.screenToDocumentPosition(_.row+E,_.column);if(S){var x=p.fromPoints(D,F);x.cursor=x.start}else{var x=p.fromPoints(F,D);x.cursor=x.end}if(x.desiredColumn=k.column,!this.selection.inMultiSelectMode)this.selection.addRange(m);else if(w)var $=m.cursor;this.selection.addRange(x),$&&this.selection.substractPoint($)},this.transposeSelections=function(E){for(var w=this.session,m=w.multiSelect,S=m.ranges,k=S.length;k--;){var D=S[k];if(D.isEmpty()){var _=w.getWordRange(D.start.row,D.start.column);D.start.row=_.start.row,D.start.column=_.start.column,D.end.row=_.end.row,D.end.column=_.end.column}}m.mergeOverlappingRanges();for(var F=[],k=S.length;k--;){var D=S[k];F.unshift(w.getTextRange(D))}E<0?F.unshift(F.pop()):F.push(F.shift());for(var k=S.length;k--;){var D=S[k],x=D.clone();w.replace(D,F[k]),D.start.row=x.start.row,D.start.column=x.start.column}m.fromOrientedRange(m.ranges[0])},this.selectMore=function(E,w,m){var S=this.session,k=S.multiSelect,D=k.toOrientedRange();if(!(D.isEmpty()&&(D=S.getWordRange(D.start.row,D.start.column),D.cursor=E==-1?D.start:D.end,this.multiSelect.addRange(D),m))){var _=S.getTextRange(D),F=r(S,_,E);F&&(F.cursor=E==-1?F.start:F.end,this.session.unfold(F),this.multiSelect.addRange(F),this.renderer.scrollCursorIntoView(null,.5)),w&&this.multiSelect.substractPoint(D.cursor)}},this.alignCursors=function(){var E=this.session,w=E.multiSelect,m=w.ranges,S=-1,k=m.filter(function(N){if(N.cursor.row==S)return!0;S=N.cursor.row});if(!m.length||k.length==m.length-1){var D=this.selection.getRange(),_=D.start.row,F=D.end.row,x=_==F;if(x){var $=this.session.getLength(),C;do C=this.session.getLine(F);while(/[=:]/.test(C)&&++F<$);do C=this.session.getLine(_);while(/[=:]/.test(C)&&--_>0);_<0&&(_=0),F>=$&&(F=$-1)}var b=this.session.removeFullLines(_,F);b=this.$reAlignText(b,x),this.session.insert({row:_,column:0},b.join(`
|
|
965
|
-
`)+`
|
|
966
|
-
`),x||(D.start.column=0,D.end.column=b[b.length-1].length),this.selection.setRange(D)}else{k.forEach(function(N){w.substractPoint(N.cursor)});var T=0,I=1/0,R=m.map(function(N){var P=N.cursor,B=E.getLine(P.row),V=B.substr(P.column).search(/\S/g);return V==-1&&(V=0),P.column>T&&(T=P.column),V<I&&(I=V),V});m.forEach(function(N,P){var B=N.cursor,V=T-B.column,W=R[P]-I;V>W?E.insert(B,e.stringRepeat(" ",V-W)):E.remove(new p(B.row,B.column,B.row,B.column-V+W)),N.start.column=N.end.column=T,N.start.row=N.end.row=B.row,N.cursor=N.end}),w.fromOrientedRange(m[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(E,w){var m=!0,S=!0,k,D,_;return E.map(function(b){var T=b.match(/(\s*)(.*?)(\s*)([=:].*)/);return T?k==null?(k=T[1].length,D=T[2].length,_=T[3].length,T):(k+D+_!=T[1].length+T[2].length+T[3].length&&(S=!1),k!=T[1].length&&(m=!1),k>T[1].length&&(k=T[1].length),D<T[2].length&&(D=T[2].length),_>T[3].length&&(_=T[3].length),T):[b]}).map(w?x:m?S?$:x:C);function F(b){return e.stringRepeat(" ",b)}function x(b){return b[2]?F(k)+b[2]+F(D-b[2].length+_)+b[4].replace(/^([=:])\s+/,"$1 "):b[0]}function $(b){return b[2]?F(k+D-b[2].length)+b[2]+F(_)+b[4].replace(/^([=:])\s+/,"$1 "):b[0]}function C(b){return b[2]?F(k)+b[2]+F(_)+b[4].replace(/^([=:])\s+/,"$1 "):b[0]}}}).call(f.prototype);function g(E,w){return E.row==w.row&&E.column==w.column}l.onSessionChange=function(E){var w=E.session;w&&!w.multiSelect&&(w.$selectionMarkers=[],w.selection.$initRangeList(),w.multiSelect=w.selection),this.multiSelect=w&&w.multiSelect;var m=E.oldSession;m&&(m.multiSelect.off("addRange",this.$onAddRange),m.multiSelect.off("removeRange",this.$onRemoveRange),m.multiSelect.off("multiSelect",this.$onMultiSelect),m.multiSelect.off("singleSelect",this.$onSingleSelect),m.multiSelect.lead.off("change",this.$checkMultiselectChange),m.multiSelect.anchor.off("change",this.$checkMultiselectChange)),w&&(w.multiSelect.on("addRange",this.$onAddRange),w.multiSelect.on("removeRange",this.$onRemoveRange),w.multiSelect.on("multiSelect",this.$onMultiSelect),w.multiSelect.on("singleSelect",this.$onSingleSelect),w.multiSelect.lead.on("change",this.$checkMultiselectChange),w.multiSelect.anchor.on("change",this.$checkMultiselectChange)),w&&this.inMultiSelectMode!=w.selection.inMultiSelectMode&&(w.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function v(E){E.$multiselectOnSessionChange||(E.$onAddRange=E.$onAddRange.bind(E),E.$onRemoveRange=E.$onRemoveRange.bind(E),E.$onMultiSelect=E.$onMultiSelect.bind(E),E.$onSingleSelect=E.$onSingleSelect.bind(E),E.$multiselectOnSessionChange=l.onSessionChange.bind(E),E.$checkMultiselectChange=E.$checkMultiselectChange.bind(E),E.$multiselectOnSessionChange(E),E.on("changeSession",E.$multiselectOnSessionChange),E.on("mousedown",s),E.commands.addCommands(i.defaultCommands),A(E))}function A(E){if(!E.textInput)return;var w=E.textInput.getElement(),m=!1;c.addListener(w,"keydown",function(k){var D=k.keyCode==18&&!(k.ctrlKey||k.shiftKey||k.metaKey);E.$blockSelectEnabled&&D?m||(E.renderer.setMouseCursor("crosshair"),m=!0):m&&S()},E),c.addListener(w,"keyup",S,E),c.addListener(w,"blur",S,E);function S(k){m&&(E.renderer.setMouseCursor(""),m=!1)}}l.MultiSelect=v,n("./config").defineOptions(f.prototype,"editor",{enableMultiselect:{set:function(E){v(this),E?this.on("mousedown",s):this.off("mousedown",s)},value:!0},enableBlockSelect:{set:function(E){this.$blockSelectEnabled=E},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(n,l,y){var a=n("../../range").Range,p=l.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(d,s,c){var e=d.getLine(c);return this.foldingStartMarker.test(e)?"start":s=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(e)?"end":""},this.getFoldWidgetRange=function(d,s,c){return null},this.indentationBlock=function(d,s,c){var e=/\S/,i=d.getLine(s),o=i.search(e);if(o!=-1){for(var h=c||i.length,r=d.getLength(),u=s,f=s;++s<r;){var g=d.getLine(s).search(e);if(g!=-1){if(g<=o){var v=d.getTokenAt(s,0);if(!v||v.type!=="string")break}f=s}}if(f>u){var A=d.getLine(f).length;return new a(u,h,f,A)}}},this.openingBracketBlock=function(d,s,c,e,i){var o={row:c,column:e+1},h=d.$findClosingBracket(s,o,i);if(h){var r=d.foldWidgets[h.row];return r==null&&(r=d.getFoldWidget(h.row)),r=="start"&&h.row>o.row&&(h.row--,h.column=d.getLine(h.row).length),a.fromPoints(o,h)}},this.closingBracketBlock=function(d,s,c,e,i){var o={row:c,column:e},h=d.$findOpeningBracket(s,o);if(h)return h.column++,o.column--,a.fromPoints(h,o)}}).call(p.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(n,l,y){var a=n("../lib/dom"),p=n("../range").Range,d=n("../config").nls;function s(e,i,o){for(var h=0,r=e.length-1;h<=r;){var u=h+r>>1,f=o(i,e[u]);if(f>0)h=u+1;else if(f<0)r=u-1;else return u}return-(h+1)}function c(e,i,o){var h=e.getAnnotations().sort(p.comparePoints);if(h.length){var r=s(h,{row:i,column:-1},p.comparePoints);r<0&&(r=-r-1),r>=h.length?r=o>0?0:h.length-1:r===0&&o<0&&(r=h.length-1);var u=h[r];if(!(!u||!o)){if(u.row===i){do u=h[r+=o];while(u&&u.row===i);if(!u)return h.slice()}var f=[];i=u.row;do f[o<0?"unshift":"push"](u),u=h[r+=o];while(u&&u.row==i);return f.length&&f}}}l.showErrorMarker=function(e,i){var o=e.session,h=e.getCursorPosition(),r=h.row,u=o.widgetManager.getWidgetsAtRow(r).filter(function(k){return k.type=="errorMarker"})[0];u?u.destroy():r-=i;var f=c(o,r,i),g;if(f){var v=f[0];h.column=(v.pos&&typeof v.column!="number"?v.pos.sc:v.column)||0,h.row=v.row,g=e.renderer.$gutterLayer.$annotations[h.row]}else{if(u)return;g={displayText:[d("error-marker.good-state","Looks good!")],className:"ace_ok"}}e.session.unfold(h.row),e.selection.moveToPosition(h);var A={row:h.row,fixedWidth:!0,coverGutter:!0,el:a.createElement("div"),type:"errorMarker"},E=A.el.appendChild(a.createElement("div")),w=A.el.appendChild(a.createElement("div"));w.className="error_widget_arrow "+g.className;var m=e.renderer.$cursorLayer.getPixelPosition(h).left;w.style.left=m+e.renderer.gutterWidth-5+"px",A.el.className="error_widget_wrapper",E.className="error_widget "+g.className,g.displayText.forEach(function(k,D){E.appendChild(a.createTextNode(k)),D<g.displayText.length-1&&E.appendChild(a.createElement("br"))}),E.appendChild(a.createElement("div"));var S=function(k,D,_){if(D===0&&(_==="esc"||_==="return"))return A.destroy(),{command:"null"}};A.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(S),o.widgetManager.removeLineWidget(A),e.off("changeSelection",A.destroy),e.off("changeSession",A.destroy),e.off("mouseup",A.destroy),e.off("change",A.destroy))},e.keyBinding.addKeyboardHandler(S),e.on("changeSelection",A.destroy),e.on("changeSession",A.destroy),e.on("mouseup",A.destroy),e.on("change",A.destroy),e.session.widgetManager.addLineWidget(A),A.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:A.el.offsetHeight})},a.importCssString(`
|
|
967
|
-
.error_widget_wrapper {
|
|
968
|
-
background: inherit;
|
|
969
|
-
color: inherit;
|
|
970
|
-
border:none
|
|
971
|
-
}
|
|
972
|
-
.error_widget {
|
|
973
|
-
border-top: solid 2px;
|
|
974
|
-
border-bottom: solid 2px;
|
|
975
|
-
margin: 5px 0;
|
|
976
|
-
padding: 10px 40px;
|
|
977
|
-
white-space: pre-wrap;
|
|
978
|
-
}
|
|
979
|
-
.error_widget.ace_error, .error_widget_arrow.ace_error{
|
|
980
|
-
border-color: #ff5a5a
|
|
981
|
-
}
|
|
982
|
-
.error_widget.ace_warning, .error_widget_arrow.ace_warning{
|
|
983
|
-
border-color: #F1D817
|
|
984
|
-
}
|
|
985
|
-
.error_widget.ace_info, .error_widget_arrow.ace_info{
|
|
986
|
-
border-color: #5a5a5a
|
|
987
|
-
}
|
|
988
|
-
.error_widget.ace_ok, .error_widget_arrow.ace_ok{
|
|
989
|
-
border-color: #5aaa5a
|
|
990
|
-
}
|
|
991
|
-
.error_widget_arrow {
|
|
992
|
-
position: absolute;
|
|
993
|
-
border: solid 5px;
|
|
994
|
-
border-top-color: transparent!important;
|
|
995
|
-
border-right-color: transparent!important;
|
|
996
|
-
border-left-color: transparent!important;
|
|
997
|
-
top: -5px;
|
|
998
|
-
}
|
|
999
|
-
`,"error_marker.css",!1)}),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(n,l,y){n("./loader_build")(l);var a=n("./lib/dom"),p=n("./range").Range,d=n("./editor").Editor,s=n("./edit_session").EditSession,c=n("./undomanager").UndoManager,e=n("./virtual_renderer").VirtualRenderer;n("./worker/worker_client"),n("./keyboard/hash_handler"),n("./placeholder"),n("./multi_select"),n("./mode/folding/fold_mode"),n("./theme/textmate"),n("./ext/error_marker"),l.config=n("./config"),l.edit=function(o,h){if(typeof o=="string"){var r=o;if(o=document.getElementById(r),!o)throw new Error("ace.edit can't find div #"+r)}if(o&&o.env&&o.env.editor instanceof d)return o.env.editor;var u="";if(o&&/input|textarea/i.test(o.tagName)){var f=o;u=f.value,o=a.createElement("pre"),f.parentNode.replaceChild(o,f)}else o&&(u=o.textContent,o.innerHTML="");var g=l.createEditSession(u),v=new d(new e(o),g,h),A={document:g,editor:v,onResize:v.resize.bind(v,null)};return f&&(A.textarea=f),v.on("destroy",function(){A.editor.container.env=null}),v.container.env=v.env=A,v},l.createEditSession=function(o,h){var r=new s(o,h);return r.setUndoManager(new c),r},l.Range=p,l.Editor=d,l.EditSession=s,l.UndoManager=c,l.VirtualRenderer=e;var i=l.config.version;l.version=i}),(function(){ace.require(["ace/ace"],function(n){n&&(n.config.init(!0),n.define=ace.define);var l=(function(){return this})();!l&&typeof window<"u"&&(l=window),!l&&typeof self<"u"&&(l=self),l.ace||(l.ace=n);for(var y in n)n.hasOwnProperty(y)&&(l.ace[y]=n[y]);l.ace.default=l.ace,L&&(L.exports=l.ace)})})()})(Ii);var Zt=Ii.exports,qt={exports:{}};qt.exports;(function(L,t){var n=200,l="__lodash_hash_undefined__",y=1,a=2,p=9007199254740991,d="[object Arguments]",s="[object Array]",c="[object AsyncFunction]",e="[object Boolean]",i="[object Date]",o="[object Error]",h="[object Function]",r="[object GeneratorFunction]",u="[object Map]",f="[object Number]",g="[object Null]",v="[object Object]",A="[object Promise]",E="[object Proxy]",w="[object RegExp]",m="[object Set]",S="[object String]",k="[object Symbol]",D="[object Undefined]",_="[object WeakMap]",F="[object ArrayBuffer]",x="[object DataView]",$="[object Float32Array]",C="[object Float64Array]",b="[object Int8Array]",T="[object Int16Array]",I="[object Int32Array]",R="[object Uint8Array]",N="[object Uint8ClampedArray]",P="[object Uint16Array]",B="[object Uint32Array]",V=/[\\^$.*+?()[\]{}|]/g,W=/^\[object .+?Constructor\]$/,z=/^(?:0|[1-9]\d*)$/,U={};U[$]=U[C]=U[b]=U[T]=U[I]=U[R]=U[N]=U[P]=U[B]=!0,U[d]=U[s]=U[F]=U[e]=U[x]=U[i]=U[o]=U[h]=U[u]=U[f]=U[v]=U[w]=U[m]=U[S]=U[_]=!1;var G=typeof ke=="object"&&ke&&ke.Object===Object&&ke,Y=typeof self=="object"&&self&&self.Object===Object&&self,Q=G||Y||Function("return this")(),q=t&&!t.nodeType&&t,te=q&&!0&&L&&!L.nodeType&&L,re=te&&te.exports===q,ue=re&&G.process,me=(function(){try{return ue&&ue.binding&&ue.binding("util")}catch{}})(),Ce=me&&me.isTypedArray;function ve(H,J){for(var ee=-1,ne=H==null?0:H.length,de=0,ae=[];++ee<ne;){var be=H[ee];J(be,ee,H)&&(ae[de++]=be)}return ae}function $e(H,J){for(var ee=-1,ne=J.length,de=H.length;++ee<ne;)H[de+ee]=J[ee];return H}function Lt(H,J){for(var ee=-1,ne=H==null?0:H.length;++ee<ne;)if(J(H[ee],ee,H))return!0;return!1}function gt(H,J){for(var ee=-1,ne=Array(H);++ee<H;)ne[ee]=J(ee);return ne}function Vi(H){return function(J){return H(J)}}function Ui(H,J){return H.has(J)}function Gi(H,J){return H==null?void 0:H[J]}function Ki(H){var J=-1,ee=Array(H.size);return H.forEach(function(ne,de){ee[++J]=[de,ne]}),ee}function Ji(H,J){return function(ee){return H(J(ee))}}function Yi(H){var J=-1,ee=Array(H.size);return H.forEach(function(ne){ee[++J]=ne}),ee}var Qi=Array.prototype,Xi=Function.prototype,It=Object.prototype,rn=Q["__core-js_shared__"],Rn=Xi.toString,Pe=It.hasOwnProperty,On=(function(){var H=/[^.]+$/.exec(rn&&rn.keys&&rn.keys.IE_PROTO||"");return H?"Symbol(src)_1."+H:""})(),Nn=It.toString,Zi=RegExp("^"+Rn.call(Pe).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bn=re?Q.Buffer:void 0,Ft=Q.Symbol,Pn=Q.Uint8Array,Wn=It.propertyIsEnumerable,qi=Qi.splice,nt=Ft?Ft.toStringTag:void 0,zn=Object.getOwnPropertySymbols,er=Bn?Bn.isBuffer:void 0,tr=Ji(Object.keys,Object),sn=mt(Q,"DataView"),Et=mt(Q,"Map"),on=mt(Q,"Promise"),an=mt(Q,"Set"),ln=mt(Q,"WeakMap"),St=mt(Object,"create"),nr=st(sn),ir=st(Et),rr=st(on),sr=st(an),or=st(ln),Hn=Ft?Ft.prototype:void 0,hn=Hn?Hn.valueOf:void 0;function it(H){var J=-1,ee=H==null?0:H.length;for(this.clear();++J<ee;){var ne=H[J];this.set(ne[0],ne[1])}}function ar(){this.__data__=St?St(null):{},this.size=0}function lr(H){var J=this.has(H)&&delete this.__data__[H];return this.size-=J?1:0,J}function hr(H){var J=this.__data__;if(St){var ee=J[H];return ee===l?void 0:ee}return Pe.call(J,H)?J[H]:void 0}function cr(H){var J=this.__data__;return St?J[H]!==void 0:Pe.call(J,H)}function ur(H,J){var ee=this.__data__;return this.size+=this.has(H)?0:1,ee[H]=St&&J===void 0?l:J,this}it.prototype.clear=ar,it.prototype.delete=lr,it.prototype.get=hr,it.prototype.has=cr,it.prototype.set=ur;function ze(H){var J=-1,ee=H==null?0:H.length;for(this.clear();++J<ee;){var ne=H[J];this.set(ne[0],ne[1])}}function pr(){this.__data__=[],this.size=0}function dr(H){var J=this.__data__,ee=Ot(J,H);if(ee<0)return!1;var ne=J.length-1;return ee==ne?J.pop():qi.call(J,ee,1),--this.size,!0}function fr(H){var J=this.__data__,ee=Ot(J,H);return ee<0?void 0:J[ee][1]}function gr(H){return Ot(this.__data__,H)>-1}function mr(H,J){var ee=this.__data__,ne=Ot(ee,H);return ne<0?(++this.size,ee.push([H,J])):ee[ne][1]=J,this}ze.prototype.clear=pr,ze.prototype.delete=dr,ze.prototype.get=fr,ze.prototype.has=gr,ze.prototype.set=mr;function rt(H){var J=-1,ee=H==null?0:H.length;for(this.clear();++J<ee;){var ne=H[J];this.set(ne[0],ne[1])}}function vr(){this.size=0,this.__data__={hash:new it,map:new(Et||ze),string:new it}}function yr(H){var J=Nt(this,H).delete(H);return this.size-=J?1:0,J}function br(H){return Nt(this,H).get(H)}function wr(H){return Nt(this,H).has(H)}function Cr(H,J){var ee=Nt(this,H),ne=ee.size;return ee.set(H,J),this.size+=ee.size==ne?0:1,this}rt.prototype.clear=vr,rt.prototype.delete=yr,rt.prototype.get=br,rt.prototype.has=wr,rt.prototype.set=Cr;function Rt(H){var J=-1,ee=H==null?0:H.length;for(this.__data__=new rt;++J<ee;)this.add(H[J])}function Er(H){return this.__data__.set(H,l),this}function Sr(H){return this.__data__.has(H)}Rt.prototype.add=Rt.prototype.push=Er,Rt.prototype.has=Sr;function Ke(H){var J=this.__data__=new ze(H);this.size=J.size}function Dr(){this.__data__=new ze,this.size=0}function xr(H){var J=this.__data__,ee=J.delete(H);return this.size=J.size,ee}function Ar(H){return this.__data__.get(H)}function $r(H){return this.__data__.has(H)}function Tr(H,J){var ee=this.__data__;if(ee instanceof ze){var ne=ee.__data__;if(!Et||ne.length<n-1)return ne.push([H,J]),this.size=++ee.size,this;ee=this.__data__=new rt(ne)}return ee.set(H,J),this.size=ee.size,this}Ke.prototype.clear=Dr,Ke.prototype.delete=xr,Ke.prototype.get=Ar,Ke.prototype.has=$r,Ke.prototype.set=Tr;function _r(H,J){var ee=Bt(H),ne=!ee&&Vr(H),de=!ee&&!ne&&cn(H),ae=!ee&&!ne&&!de&&Xn(H),be=ee||ne||de||ae,Ee=be?gt(H.length,String):[],De=Ee.length;for(var ye in H)Pe.call(H,ye)&&!(be&&(ye=="length"||de&&(ye=="offset"||ye=="parent")||ae&&(ye=="buffer"||ye=="byteLength"||ye=="byteOffset")||Pr(ye,De)))&&Ee.push(ye);return Ee}function Ot(H,J){for(var ee=H.length;ee--;)if(Kn(H[ee][0],J))return ee;return-1}function kr(H,J,ee){var ne=J(H);return Bt(H)?ne:$e(ne,ee(H))}function Dt(H){return H==null?H===void 0?D:g:nt&&nt in Object(H)?Nr(H):jr(H)}function jn(H){return xt(H)&&Dt(H)==d}function Vn(H,J,ee,ne,de){return H===J?!0:H==null||J==null||!xt(H)&&!xt(J)?H!==H&&J!==J:Mr(H,J,ee,ne,Vn,de)}function Mr(H,J,ee,ne,de,ae){var be=Bt(H),Ee=Bt(J),De=be?s:Je(H),ye=Ee?s:Je(J);De=De==d?v:De,ye=ye==d?v:ye;var Te=De==v,Fe=ye==v,xe=De==ye;if(xe&&cn(H)){if(!cn(J))return!1;be=!0,Te=!1}if(xe&&!Te)return ae||(ae=new Ke),be||Xn(H)?Un(H,J,ee,ne,de,ae):Rr(H,J,De,ee,ne,de,ae);if(!(ee&y)){var Me=Te&&Pe.call(H,"__wrapped__"),Le=Fe&&Pe.call(J,"__wrapped__");if(Me||Le){var Ye=Me?H.value():H,He=Le?J.value():J;return ae||(ae=new Ke),de(Ye,He,ee,ne,ae)}}return xe?(ae||(ae=new Ke),Or(H,J,ee,ne,de,ae)):!1}function Lr(H){if(!Qn(H)||zr(H))return!1;var J=Jn(H)?Zi:W;return J.test(st(H))}function Ir(H){return xt(H)&&Yn(H.length)&&!!U[Dt(H)]}function Fr(H){if(!Hr(H))return tr(H);var J=[];for(var ee in Object(H))Pe.call(H,ee)&&ee!="constructor"&&J.push(ee);return J}function Un(H,J,ee,ne,de,ae){var be=ee&y,Ee=H.length,De=J.length;if(Ee!=De&&!(be&&De>Ee))return!1;var ye=ae.get(H);if(ye&&ae.get(J))return ye==J;var Te=-1,Fe=!0,xe=ee&a?new Rt:void 0;for(ae.set(H,J),ae.set(J,H);++Te<Ee;){var Me=H[Te],Le=J[Te];if(ne)var Ye=be?ne(Le,Me,Te,J,H,ae):ne(Me,Le,Te,H,J,ae);if(Ye!==void 0){if(Ye)continue;Fe=!1;break}if(xe){if(!Lt(J,function(He,ot){if(!Ui(xe,ot)&&(Me===He||de(Me,He,ee,ne,ae)))return xe.push(ot)})){Fe=!1;break}}else if(!(Me===Le||de(Me,Le,ee,ne,ae))){Fe=!1;break}}return ae.delete(H),ae.delete(J),Fe}function Rr(H,J,ee,ne,de,ae,be){switch(ee){case x:if(H.byteLength!=J.byteLength||H.byteOffset!=J.byteOffset)return!1;H=H.buffer,J=J.buffer;case F:return!(H.byteLength!=J.byteLength||!ae(new Pn(H),new Pn(J)));case e:case i:case f:return Kn(+H,+J);case o:return H.name==J.name&&H.message==J.message;case w:case S:return H==J+"";case u:var Ee=Ki;case m:var De=ne&y;if(Ee||(Ee=Yi),H.size!=J.size&&!De)return!1;var ye=be.get(H);if(ye)return ye==J;ne|=a,be.set(H,J);var Te=Un(Ee(H),Ee(J),ne,de,ae,be);return be.delete(H),Te;case k:if(hn)return hn.call(H)==hn.call(J)}return!1}function Or(H,J,ee,ne,de,ae){var be=ee&y,Ee=Gn(H),De=Ee.length,ye=Gn(J),Te=ye.length;if(De!=Te&&!be)return!1;for(var Fe=De;Fe--;){var xe=Ee[Fe];if(!(be?xe in J:Pe.call(J,xe)))return!1}var Me=ae.get(H);if(Me&&ae.get(J))return Me==J;var Le=!0;ae.set(H,J),ae.set(J,H);for(var Ye=be;++Fe<De;){xe=Ee[Fe];var He=H[xe],ot=J[xe];if(ne)var Zn=be?ne(ot,He,xe,J,H,ae):ne(He,ot,xe,H,J,ae);if(!(Zn===void 0?He===ot||de(He,ot,ee,ne,ae):Zn)){Le=!1;break}Ye||(Ye=xe=="constructor")}if(Le&&!Ye){var Pt=H.constructor,Wt=J.constructor;Pt!=Wt&&"constructor"in H&&"constructor"in J&&!(typeof Pt=="function"&&Pt instanceof Pt&&typeof Wt=="function"&&Wt instanceof Wt)&&(Le=!1)}return ae.delete(H),ae.delete(J),Le}function Gn(H){return kr(H,Kr,Br)}function Nt(H,J){var ee=H.__data__;return Wr(J)?ee[typeof J=="string"?"string":"hash"]:ee.map}function mt(H,J){var ee=Gi(H,J);return Lr(ee)?ee:void 0}function Nr(H){var J=Pe.call(H,nt),ee=H[nt];try{H[nt]=void 0;var ne=!0}catch{}var de=Nn.call(H);return ne&&(J?H[nt]=ee:delete H[nt]),de}var Br=zn?function(H){return H==null?[]:(H=Object(H),ve(zn(H),function(J){return Wn.call(H,J)}))}:Jr,Je=Dt;(sn&&Je(new sn(new ArrayBuffer(1)))!=x||Et&&Je(new Et)!=u||on&&Je(on.resolve())!=A||an&&Je(new an)!=m||ln&&Je(new ln)!=_)&&(Je=function(H){var J=Dt(H),ee=J==v?H.constructor:void 0,ne=ee?st(ee):"";if(ne)switch(ne){case nr:return x;case ir:return u;case rr:return A;case sr:return m;case or:return _}return J});function Pr(H,J){return J=J??p,!!J&&(typeof H=="number"||z.test(H))&&H>-1&&H%1==0&&H<J}function Wr(H){var J=typeof H;return J=="string"||J=="number"||J=="symbol"||J=="boolean"?H!=="__proto__":H===null}function zr(H){return!!On&&On in H}function Hr(H){var J=H&&H.constructor,ee=typeof J=="function"&&J.prototype||It;return H===ee}function jr(H){return Nn.call(H)}function st(H){if(H!=null){try{return Rn.call(H)}catch{}try{return H+""}catch{}}return""}function Kn(H,J){return H===J||H!==H&&J!==J}var Vr=jn((function(){return arguments})())?jn:function(H){return xt(H)&&Pe.call(H,"callee")&&!Wn.call(H,"callee")},Bt=Array.isArray;function Ur(H){return H!=null&&Yn(H.length)&&!Jn(H)}var cn=er||Yr;function Gr(H,J){return Vn(H,J)}function Jn(H){if(!Qn(H))return!1;var J=Dt(H);return J==h||J==r||J==c||J==E}function Yn(H){return typeof H=="number"&&H>-1&&H%1==0&&H<=p}function Qn(H){var J=typeof H;return H!=null&&(J=="object"||J=="function")}function xt(H){return H!=null&&typeof H=="object"}var Xn=Ce?Vi(Ce):Ir;function Kr(H){return Ur(H)?_r(H):Fr(H)}function Jr(){return[]}function Yr(){return!1}L.exports=Gr})(qt,qt.exports);var Fi=qt.exports,Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.getAceInstance=Ne.debounce=Ne.editorEvents=Ne.editorOptions=void 0;var uo=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"];Ne.editorOptions=uo;var po=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"];Ne.editorEvents=po;var fo=function(){var L;return typeof window>"u"?(ke.window={},L=Zt,delete ke.window):window.ace?(L=window.ace,L.acequire=window.ace.require||window.ace.acequire):L=Zt,L};Ne.getAceInstance=fo;var go=function(L,t){var n=null;return function(){var l=this,y=arguments;clearTimeout(n),n=setTimeout(function(){L.apply(l,y)},t)}};Ne.debounce=go;var mo=ut&&ut.__extends||(function(){var L=function(t,n){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,y){l.__proto__=y}||function(l,y){for(var a in y)Object.prototype.hasOwnProperty.call(y,a)&&(l[a]=y[a])},L(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");L(t,n);function l(){this.constructor=t}t.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)}})(),An=ut&&ut.__assign||function(){return An=Object.assign||function(L){for(var t,n=1,l=arguments.length;n<l;n++){t=arguments[n];for(var y in t)Object.prototype.hasOwnProperty.call(t,y)&&(L[y]=t[y])}return L},An.apply(this,arguments)};Object.defineProperty(ut,"__esModule",{value:!0});var vo=Zt,ie=Tn,oi=qe,Vt=Fi,bt=Ne,ai=(0,bt.getAceInstance)(),yo=(function(L){mo(t,L);function t(n){var l=L.call(this,n)||this;return bt.editorEvents.forEach(function(y){l[y]=l[y].bind(l)}),l.debounce=bt.debounce,l}return t.prototype.isInShadow=function(n){for(var l=n&&n.parentNode;l;){if(l.toString()==="[object ShadowRoot]")return!0;l=l.parentNode}return!1},t.prototype.componentDidMount=function(){var n=this,l=this.props,y=l.className,a=l.onBeforeLoad,p=l.onValidate,d=l.mode,s=l.focus,c=l.theme,e=l.fontSize,i=l.lineHeight,o=l.value,h=l.defaultValue,r=l.showGutter,u=l.wrapEnabled,f=l.showPrintMargin,g=l.scrollMargin,v=g===void 0?[0,0,0,0]:g,A=l.keyboardHandler,E=l.onLoad,w=l.commands,m=l.annotations,S=l.markers,k=l.placeholder;this.editor=ai.edit(this.refEditor),a&&a(ai);for(var D=Object.keys(this.props.editorProps),_=0;_<D.length;_++)this.editor[D[_]]=this.props.editorProps[D[_]];this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),this.editor.renderer.setScrollMargin(v[0],v[1],v[2],v[3]),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.getSession().setMode(typeof d=="string"?"ace/mode/".concat(d):d),c&&c!==""&&this.editor.setTheme("ace/theme/".concat(c)),this.editor.setFontSize(typeof e=="number"?"".concat(e,"px"):e),i&&(this.editor.container.style.lineHeight=typeof i=="number"?"".concat(i,"px"):"".concat(i),this.editor.renderer.updateFontSize()),this.editor.getSession().setValue(h||o||""),this.props.navigateToFileEnd&&this.editor.navigateFileEnd(),this.editor.renderer.setShowGutter(r),this.editor.getSession().setUseWrapMode(u),this.editor.setShowPrintMargin(f),this.editor.on("focus",this.onFocus),this.editor.on("blur",this.onBlur),this.editor.on("copy",this.onCopy),this.editor.on("paste",this.onPaste),this.editor.on("change",this.onChange),this.editor.on("input",this.onInput),k&&this.updatePlaceholder(),this.editor.getSession().selection.on("changeSelection",this.onSelectionChange),this.editor.getSession().selection.on("changeCursor",this.onCursorChange),p&&this.editor.getSession().on("changeAnnotation",function(){var x=n.editor.getSession().getAnnotations();n.props.onValidate(x)}),this.editor.session.on("changeScrollTop",this.onScroll),this.editor.getSession().setAnnotations(m||[]),S&&S.length>0&&this.handleMarkers(S);var F=this.editor.$options;bt.editorOptions.forEach(function(x){F.hasOwnProperty(x)?n.editor.setOption(x,n.props[x]):n.props[x]&&console.warn("ReactAce: editor option ".concat(x," was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"))}),this.handleOptions(this.props),Array.isArray(w)&&w.forEach(function(x){typeof x.exec=="string"?n.editor.commands.bindKey(x.bindKey,x.exec):n.editor.commands.addCommand(x)}),A&&this.editor.setKeyboardHandler("ace/keyboard/"+A),y&&(this.refEditor.className+=" "+y),E&&E(this.editor),this.editor.resize(),s&&this.editor.focus()},t.prototype.componentDidUpdate=function(n){for(var l=n,y=this.props,a=0;a<bt.editorOptions.length;a++){var p=bt.editorOptions[a];y[p]!==l[p]&&this.editor.setOption(p,y[p])}if(y.className!==l.className){var d=this.refEditor.className,s=d.trim().split(" "),c=l.className.trim().split(" ");c.forEach(function(o){var h=s.indexOf(o);s.splice(h,1)}),this.refEditor.className=" "+y.className+" "+s.join(" ")}var e=this.editor&&y.value!=null&&this.editor.getValue()!==y.value;if(e){this.silent=!0;var i=this.editor.session.selection.toJSON();this.editor.setValue(y.value,y.cursorStart),this.editor.session.selection.fromJSON(i),this.silent=!1}y.placeholder!==l.placeholder&&this.updatePlaceholder(),y.mode!==l.mode&&this.editor.getSession().setMode(typeof y.mode=="string"?"ace/mode/".concat(y.mode):y.mode),y.theme!==l.theme&&this.editor.setTheme("ace/theme/"+y.theme),y.keyboardHandler!==l.keyboardHandler&&(y.keyboardHandler?this.editor.setKeyboardHandler("ace/keyboard/"+y.keyboardHandler):this.editor.setKeyboardHandler(null)),y.fontSize!==l.fontSize&&this.editor.setFontSize(typeof y.fontSize=="number"?"".concat(y.fontSize,"px"):y.fontSize),y.lineHeight!==l.lineHeight&&(this.editor.container.style.lineHeight=typeof y.lineHeight=="number"?"".concat(y.lineHeight,"px"):y.lineHeight,this.editor.renderer.updateFontSize()),y.wrapEnabled!==l.wrapEnabled&&this.editor.getSession().setUseWrapMode(y.wrapEnabled),y.showPrintMargin!==l.showPrintMargin&&this.editor.setShowPrintMargin(y.showPrintMargin),y.showGutter!==l.showGutter&&this.editor.renderer.setShowGutter(y.showGutter),Vt(y.setOptions,l.setOptions)||this.handleOptions(y),(e||!Vt(y.annotations,l.annotations))&&this.editor.getSession().setAnnotations(y.annotations||[]),!Vt(y.markers,l.markers)&&Array.isArray(y.markers)&&this.handleMarkers(y.markers),Vt(y.scrollMargin,l.scrollMargin)||this.handleScrollMargins(y.scrollMargin),(n.height!==this.props.height||n.width!==this.props.width)&&this.editor.resize(),this.props.focus&&!n.focus&&this.editor.focus()},t.prototype.handleScrollMargins=function(n){n===void 0&&(n=[0,0,0,0]),this.editor.renderer.setScrollMargin(n[0],n[1],n[2],n[3])},t.prototype.componentWillUnmount=function(){this.editor&&(this.editor.destroy(),this.editor=null)},t.prototype.onChange=function(n){if(this.editor&&this.props.onChange&&!this.silent){var l=this.editor.getValue();this.props.onChange(l,n)}},t.prototype.onSelectionChange=function(n){if(this.props.onSelectionChange){var l=this.editor.getSelection();this.props.onSelectionChange(l,n)}},t.prototype.onCursorChange=function(n){if(this.props.onCursorChange){var l=this.editor.getSelection();this.props.onCursorChange(l,n)}},t.prototype.onInput=function(n){this.props.onInput&&this.props.onInput(n),this.props.placeholder&&this.updatePlaceholder()},t.prototype.onFocus=function(n){this.props.onFocus&&this.props.onFocus(n,this.editor)},t.prototype.onBlur=function(n){this.props.onBlur&&this.props.onBlur(n,this.editor)},t.prototype.onCopy=function(n){var l=n.text;this.props.onCopy&&this.props.onCopy(l)},t.prototype.onPaste=function(n){var l=n.text;this.props.onPaste&&this.props.onPaste(l)},t.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},t.prototype.handleOptions=function(n){for(var l=Object.keys(n.setOptions),y=0;y<l.length;y++)this.editor.setOption(l[y],n.setOptions[l[y]])},t.prototype.handleMarkers=function(n){var l=this,y=this.editor.getSession().getMarkers(!0);for(var a in y)y.hasOwnProperty(a)&&this.editor.getSession().removeMarker(y[a].id);y=this.editor.getSession().getMarkers(!1);for(var a in y)y.hasOwnProperty(a)&&y[a].clazz!=="ace_active-line"&&y[a].clazz!=="ace_selected-word"&&this.editor.getSession().removeMarker(y[a].id);n.forEach(function(p){var d=p.startRow,s=p.startCol,c=p.endRow,e=p.endCol,i=p.className,o=p.type,h=p.inFront,r=h===void 0?!1:h,u=new vo.Range(d,s,c,e);l.editor.getSession().addMarker(u,i,o,r)})},t.prototype.updatePlaceholder=function(){var n=this.editor,l=this.props.placeholder,y=!n.session.getValue().length,a=n.renderer.placeholderNode;!y&&a?(n.renderer.scroller.removeChild(n.renderer.placeholderNode),n.renderer.placeholderNode=null):y&&!a?(a=n.renderer.placeholderNode=document.createElement("div"),a.textContent=l||"",a.className="ace_comment ace_placeholder",a.style.padding="0 9px",a.style.position="absolute",a.style.zIndex="3",n.renderer.scroller.appendChild(a)):y&&a&&(a.textContent=l)},t.prototype.updateRef=function(n){this.refEditor=n},t.prototype.render=function(){var n=this.props,l=n.name,y=n.width,a=n.height,p=n.style,d=An({width:y,height:a},p);return oi.createElement("div",{ref:this.updateRef,id:l,style:d})},t.propTypes={mode:ie.oneOfType([ie.string,ie.object]),focus:ie.bool,theme:ie.string,name:ie.string,className:ie.string,height:ie.string,width:ie.string,fontSize:ie.oneOfType([ie.number,ie.string]),lineHeight:ie.oneOfType([ie.number,ie.string]),showGutter:ie.bool,onChange:ie.func,onCopy:ie.func,onPaste:ie.func,onFocus:ie.func,onInput:ie.func,onBlur:ie.func,onScroll:ie.func,value:ie.string,defaultValue:ie.string,onLoad:ie.func,onSelectionChange:ie.func,onCursorChange:ie.func,onBeforeLoad:ie.func,onValidate:ie.func,minLines:ie.number,maxLines:ie.number,readOnly:ie.bool,highlightActiveLine:ie.bool,tabSize:ie.number,showPrintMargin:ie.bool,cursorStart:ie.number,debounceChangePeriod:ie.number,editorProps:ie.object,setOptions:ie.object,style:ie.object,scrollMargin:ie.array,annotations:ie.array,markers:ie.array,keyboardHandler:ie.string,wrapEnabled:ie.bool,enableSnippets:ie.bool,enableBasicAutocompletion:ie.oneOfType([ie.bool,ie.array]),enableLiveAutocompletion:ie.oneOfType([ie.bool,ie.array]),navigateToFileEnd:ie.bool,commands:ie.array,placeholder:ie.string},t.defaultProps={name:"ace-editor",focus:!1,mode:"",theme:"",height:"500px",width:"500px",fontSize:12,enableSnippets:!1,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,placeholder:null,navigateToFileEnd:!0},t})(oi.Component);ut.default=yo;var kt={},tt={},Ri={exports:{}};(function(L,t){ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(n,l,y){var a=n("./lib/oop");n("./lib/lang");var p=n("./lib/event_emitter").EventEmitter,d=n("./editor").Editor,s=n("./virtual_renderer").VirtualRenderer,c=n("./edit_session").EditSession,e;e=function(i,o,h){this.BELOW=1,this.BESIDE=0,this.$container=i,this.$theme=o,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(h||1),this.$cEditor=this.$editors[0],this.on("focus",function(r){this.$cEditor=r}.bind(this))},(function(){a.implement(this,p),this.$createEditor=function(){var i=document.createElement("div");i.className=this.$editorCSS,i.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(i);var o=new d(new s(i,this.$theme));return o.on("focus",function(){this._emit("focus",o)}.bind(this)),this.$editors.push(o),o.setFontSize(this.$fontSize),o},this.setSplits=function(i){var o;if(i<1)throw"The number of splits have to be > 0!";if(i!=this.$splits){if(i>this.$splits){for(;this.$splits<this.$editors.length&&this.$splits<i;)o=this.$editors[this.$splits],this.$container.appendChild(o.container),o.setFontSize(this.$fontSize),this.$splits++;for(;this.$splits<i;)this.$createEditor(),this.$splits++}else for(;this.$splits>i;)o=this.$editors[this.$splits-1],this.$container.removeChild(o.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(i){return this.$editors[i]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(i){this.$editors.forEach(function(o){o.setTheme(i)})},this.setKeyboardHandler=function(i){this.$editors.forEach(function(o){o.setKeyboardHandler(i)})},this.forEach=function(i,o){this.$editors.forEach(i,o)},this.$fontSize="",this.setFontSize=function(i){this.$fontSize=i,this.forEach(function(o){o.setFontSize(i)})},this.$cloneSession=function(i){var o=new c(i.getDocument(),i.getMode()),h=i.getUndoManager();return o.setUndoManager(h),o.setTabSize(i.getTabSize()),o.setUseSoftTabs(i.getUseSoftTabs()),o.setOverwrite(i.getOverwrite()),o.setBreakpoints(i.getBreakpoints()),o.setUseWrapMode(i.getUseWrapMode()),o.setUseWorker(i.getUseWorker()),o.setWrapLimitRange(i.$wrapLimitRange.min,i.$wrapLimitRange.max),o.$foldData=i.$cloneFoldData(),o},this.setSession=function(i,o){var h;o==null?h=this.$cEditor:h=this.$editors[o];var r=this.$editors.some(function(u){return u.session===i});return r&&(i=this.$cloneSession(i)),h.setSession(i),i},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(i){this.$orientation!=i&&(this.$orientation=i,this.resize())},this.resize=function(){var i=this.$container.clientWidth,o=this.$container.clientHeight,h;if(this.$orientation==this.BESIDE)for(var r=i/this.$splits,u=0;u<this.$splits;u++)h=this.$editors[u],h.container.style.width=r+"px",h.container.style.top="0px",h.container.style.left=u*r+"px",h.container.style.height=o+"px",h.resize();else for(var f=o/this.$splits,u=0;u<this.$splits;u++)h=this.$editors[u],h.container.style.width=i+"px",h.container.style.top=u*f+"px",h.container.style.left="0px",h.container.style.height=f+"px",h.resize()}}).call(e.prototype),l.Split=e}),ace.define("ace/ext/split",["require","exports","module","ace/ext/split","ace/split"],function(n,l,y){y.exports=n("../split")}),(function(){ace.require(["ace/ext/split"],function(n){L&&(L.exports=n)})})()})(Ri);var bo=Ri.exports,wo="Expected a function",Oi="__lodash_hash_undefined__",Co="[object Function]",Eo="[object GeneratorFunction]",So="[object Symbol]",Do=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xo=/^\w*$/,Ao=/^\./,$o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,To=/[\\^$.*+?()[\]{}|]/g,_o=/\\(\\)?/g,ko=/^\[object .+?Constructor\]$/,Mo=typeof ke=="object"&&ke&&ke.Object===Object&&ke,Lo=typeof self=="object"&&self&&self.Object===Object&&self,Mn=Mo||Lo||Function("return this")();function Io(L,t){return L==null?void 0:L[t]}function Fo(L){var t=!1;if(L!=null&&typeof L.toString!="function")try{t=!!(L+"")}catch{}return t}var Ro=Array.prototype,Oo=Function.prototype,Ni=Object.prototype,mn=Mn["__core-js_shared__"],li=(function(){var L=/[^.]+$/.exec(mn&&mn.keys&&mn.keys.IE_PROTO||"");return L?"Symbol(src)_1."+L:""})(),Bi=Oo.toString,Ln=Ni.hasOwnProperty,Pi=Ni.toString,No=RegExp("^"+Bi.call(Ln).replace(To,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hi=Mn.Symbol,Bo=Ro.splice,Po=Wi(Mn,"Map"),Mt=Wi(Object,"create"),ci=hi?hi.prototype:void 0,ui=ci?ci.toString:void 0;function pt(L){var t=-1,n=L?L.length:0;for(this.clear();++t<n;){var l=L[t];this.set(l[0],l[1])}}function Wo(){this.__data__=Mt?Mt(null):{}}function zo(L){return this.has(L)&&delete this.__data__[L]}function Ho(L){var t=this.__data__;if(Mt){var n=t[L];return n===Oi?void 0:n}return Ln.call(t,L)?t[L]:void 0}function jo(L){var t=this.__data__;return Mt?t[L]!==void 0:Ln.call(t,L)}function Vo(L,t){var n=this.__data__;return n[L]=Mt&&t===void 0?Oi:t,this}pt.prototype.clear=Wo;pt.prototype.delete=zo;pt.prototype.get=Ho;pt.prototype.has=jo;pt.prototype.set=Vo;function Ct(L){var t=-1,n=L?L.length:0;for(this.clear();++t<n;){var l=L[t];this.set(l[0],l[1])}}function Uo(){this.__data__=[]}function Go(L){var t=this.__data__,n=tn(t,L);if(n<0)return!1;var l=t.length-1;return n==l?t.pop():Bo.call(t,n,1),!0}function Ko(L){var t=this.__data__,n=tn(t,L);return n<0?void 0:t[n][1]}function Jo(L){return tn(this.__data__,L)>-1}function Yo(L,t){var n=this.__data__,l=tn(n,L);return l<0?n.push([L,t]):n[l][1]=t,this}Ct.prototype.clear=Uo;Ct.prototype.delete=Go;Ct.prototype.get=Ko;Ct.prototype.has=Jo;Ct.prototype.set=Yo;function dt(L){var t=-1,n=L?L.length:0;for(this.clear();++t<n;){var l=L[t];this.set(l[0],l[1])}}function Qo(){this.__data__={hash:new pt,map:new(Po||Ct),string:new pt}}function Xo(L){return nn(this,L).delete(L)}function Zo(L){return nn(this,L).get(L)}function qo(L){return nn(this,L).has(L)}function ea(L,t){return nn(this,L).set(L,t),this}dt.prototype.clear=Qo;dt.prototype.delete=Xo;dt.prototype.get=Zo;dt.prototype.has=qo;dt.prototype.set=ea;function tn(L,t){for(var n=L.length;n--;)if(ua(L[n][0],t))return n;return-1}function ta(L,t){t=sa(t,L)?[t]:ra(t);for(var n=0,l=t.length;L!=null&&n<l;)L=L[ha(t[n++])];return n&&n==l?L:void 0}function na(L){if(!Hi(L)||aa(L))return!1;var t=pa(L)||Fo(L)?No:ko;return t.test(ca(L))}function ia(L){if(typeof L=="string")return L;if(Fn(L))return ui?ui.call(L):"";var t=L+"";return t=="0"&&1/L==-1/0?"-0":t}function ra(L){return zi(L)?L:la(L)}function nn(L,t){var n=L.__data__;return oa(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Wi(L,t){var n=Io(L,t);return na(n)?n:void 0}function sa(L,t){if(zi(L))return!1;var n=typeof L;return n=="number"||n=="symbol"||n=="boolean"||L==null||Fn(L)?!0:xo.test(L)||!Do.test(L)||t!=null&&L in Object(t)}function oa(L){var t=typeof L;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?L!=="__proto__":L===null}function aa(L){return!!li&&li in L}var la=In(function(L){L=fa(L);var t=[];return Ao.test(L)&&t.push(""),L.replace($o,function(n,l,y,a){t.push(y?a.replace(_o,"$1"):l||n)}),t});function ha(L){if(typeof L=="string"||Fn(L))return L;var t=L+"";return t=="0"&&1/L==-1/0?"-0":t}function ca(L){if(L!=null){try{return Bi.call(L)}catch{}try{return L+""}catch{}}return""}function In(L,t){if(typeof L!="function"||t&&typeof t!="function")throw new TypeError(wo);var n=function(){var l=arguments,y=t?t.apply(this,l):l[0],a=n.cache;if(a.has(y))return a.get(y);var p=L.apply(this,l);return n.cache=a.set(y,p),p};return n.cache=new(In.Cache||dt),n}In.Cache=dt;function ua(L,t){return L===t||L!==L&&t!==t}var zi=Array.isArray;function pa(L){var t=Hi(L)?Pi.call(L):"";return t==Co||t==Eo}function Hi(L){var t=typeof L;return!!L&&(t=="object"||t=="function")}function da(L){return!!L&&typeof L=="object"}function Fn(L){return typeof L=="symbol"||da(L)&&Pi.call(L)==So}function fa(L){return L==null?"":ia(L)}function ga(L,t,n){var l=L==null?void 0:ta(L,t);return l===void 0?n:l}var ma=ga,va=tt&&tt.__extends||(function(){var L=function(t,n){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,y){l.__proto__=y}||function(l,y){for(var a in y)Object.prototype.hasOwnProperty.call(y,a)&&(l[a]=y[a])},L(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");L(t,n);function l(){this.constructor=t}t.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)}})(),$n=tt&&tt.__assign||function(){return $n=Object.assign||function(L){for(var t,n=1,l=arguments.length;n<l;n++){t=arguments[n];for(var y in t)Object.prototype.hasOwnProperty.call(t,y)&&(L[y]=t[y])}return L},$n.apply(this,arguments)};Object.defineProperty(tt,"__esModule",{value:!0});var ct=Ne,vn=(0,ct.getAceInstance)(),ya=Zt,ba=bo,se=Tn,pi=qe,yn=Fi,je=ma,wa=(function(L){va(t,L);function t(n){var l=L.call(this,n)||this;return ct.editorEvents.forEach(function(y){l[y]=l[y].bind(l)}),l.debounce=ct.debounce,l}return t.prototype.isInShadow=function(n){for(var l=n&&n.parentNode;l;){if(l.toString()==="[object ShadowRoot]")return!0;l=l.parentNode}return!1},t.prototype.componentDidMount=function(){var n=this,l=this.props,y=l.className,a=l.onBeforeLoad,p=l.mode,d=l.focus,s=l.theme,c=l.fontSize,e=l.value,i=l.defaultValue,o=l.cursorStart,h=l.showGutter,r=l.wrapEnabled,u=l.showPrintMargin,f=l.scrollMargin,g=f===void 0?[0,0,0,0]:f,v=l.keyboardHandler,A=l.onLoad,E=l.commands,w=l.annotations,m=l.markers,S=l.splits;this.editor=vn.edit(this.refEditor),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.setTheme("ace/theme/".concat(s)),a&&a(vn);var k=Object.keys(this.props.editorProps),D=new ba.Split(this.editor.container,"ace/theme/".concat(s),S);this.editor.env.split=D,this.splitEditor=D.getEditor(0),this.split=D,this.editor.setShowPrintMargin(!1),this.editor.renderer.setShowGutter(!1);var _=this.splitEditor.$options;this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),D.forEach(function(x,$){for(var C=0;C<k.length;C++)x[k[C]]=n.props.editorProps[k[C]];var b=je(i,$),T=je(e,$,"");x.session.setUndoManager(new vn.UndoManager),x.setTheme("ace/theme/".concat(s)),x.renderer.setScrollMargin(g[0],g[1],g[2],g[3]),x.getSession().setMode("ace/mode/".concat(p)),x.setFontSize(c),x.renderer.setShowGutter(h),x.getSession().setUseWrapMode(r),x.setShowPrintMargin(u),x.on("focus",n.onFocus),x.on("blur",n.onBlur),x.on("input",n.onInput),x.on("copy",n.onCopy),x.on("paste",n.onPaste),x.on("change",n.onChange),x.getSession().selection.on("changeSelection",n.onSelectionChange),x.getSession().selection.on("changeCursor",n.onCursorChange),x.session.on("changeScrollTop",n.onScroll),x.setValue(b===void 0?T:b,o);var I=je(w,$,[]),R=je(m,$,[]);x.getSession().setAnnotations(I),R&&R.length>0&&n.handleMarkers(R,x);for(var C=0;C<ct.editorOptions.length;C++){var N=ct.editorOptions[C];_.hasOwnProperty(N)?x.setOption(N,n.props[N]):n.props[N]&&console.warn("ReaceAce: editor option ".concat(N," was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"))}n.handleOptions(n.props,x),Array.isArray(E)&&E.forEach(function(P){typeof P.exec=="string"?x.commands.bindKey(P.bindKey,P.exec):x.commands.addCommand(P)}),v&&x.setKeyboardHandler("ace/keyboard/"+v)}),y&&(this.refEditor.className+=" "+y),d&&this.splitEditor.focus();var F=this.editor.env.split;F.setOrientation(this.props.orientation==="below"?F.BELOW:F.BESIDE),F.resize(!0),A&&A(F)},t.prototype.componentDidUpdate=function(n){var l=this,y=n,a=this.props,p=this.editor.env.split;if(a.splits!==y.splits&&p.setSplits(a.splits),a.orientation!==y.orientation&&p.setOrientation(a.orientation==="below"?p.BELOW:p.BESIDE),p.forEach(function(e,i){a.mode!==y.mode&&e.getSession().setMode("ace/mode/"+a.mode),a.keyboardHandler!==y.keyboardHandler&&(a.keyboardHandler?e.setKeyboardHandler("ace/keyboard/"+a.keyboardHandler):e.setKeyboardHandler(null)),a.fontSize!==y.fontSize&&e.setFontSize(a.fontSize),a.wrapEnabled!==y.wrapEnabled&&e.getSession().setUseWrapMode(a.wrapEnabled),a.showPrintMargin!==y.showPrintMargin&&e.setShowPrintMargin(a.showPrintMargin),a.showGutter!==y.showGutter&&e.renderer.setShowGutter(a.showGutter);for(var o=0;o<ct.editorOptions.length;o++){var h=ct.editorOptions[o];a[h]!==y[h]&&e.setOption(h,a[h])}yn(a.setOptions,y.setOptions)||l.handleOptions(a,e);var r=je(a.value,i,"");if(e.getValue()!==r){l.silent=!0;var u=e.session.selection.toJSON();e.setValue(r,a.cursorStart),e.session.selection.fromJSON(u),l.silent=!1}var f=je(a.annotations,i,[]),g=je(y.annotations,i,[]);yn(f,g)||e.getSession().setAnnotations(f);var v=je(a.markers,i,[]),A=je(y.markers,i,[]);!yn(v,A)&&Array.isArray(v)&&l.handleMarkers(v,e)}),a.className!==y.className){var d=this.refEditor.className,s=d.trim().split(" "),c=y.className.trim().split(" ");c.forEach(function(e){var i=s.indexOf(e);s.splice(i,1)}),this.refEditor.className=" "+a.className+" "+s.join(" ")}a.theme!==y.theme&&p.setTheme("ace/theme/"+a.theme),a.focus&&!y.focus&&this.splitEditor.focus(),(a.height!==this.props.height||a.width!==this.props.width)&&this.editor.resize()},t.prototype.componentWillUnmount=function(){this.editor.destroy(),this.editor=null},t.prototype.onChange=function(n){if(this.props.onChange&&!this.silent){var l=[];this.editor.env.split.forEach(function(y){l.push(y.getValue())}),this.props.onChange(l,n)}},t.prototype.onSelectionChange=function(n){if(this.props.onSelectionChange){var l=[];this.editor.env.split.forEach(function(y){l.push(y.getSelection())}),this.props.onSelectionChange(l,n)}},t.prototype.onCursorChange=function(n){if(this.props.onCursorChange){var l=[];this.editor.env.split.forEach(function(y){l.push(y.getSelection())}),this.props.onCursorChange(l,n)}},t.prototype.onFocus=function(n){this.props.onFocus&&this.props.onFocus(n)},t.prototype.onInput=function(n){this.props.onInput&&this.props.onInput(n)},t.prototype.onBlur=function(n){this.props.onBlur&&this.props.onBlur(n)},t.prototype.onCopy=function(n){this.props.onCopy&&this.props.onCopy(n)},t.prototype.onPaste=function(n){this.props.onPaste&&this.props.onPaste(n)},t.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},t.prototype.handleOptions=function(n,l){for(var y=Object.keys(n.setOptions),a=0;a<y.length;a++)l.setOption(y[a],n.setOptions[y[a]])},t.prototype.handleMarkers=function(n,l){var y=l.getSession().getMarkers(!0);for(var a in y)y.hasOwnProperty(a)&&l.getSession().removeMarker(y[a].id);y=l.getSession().getMarkers(!1);for(var a in y)y.hasOwnProperty(a)&&l.getSession().removeMarker(y[a].id);n.forEach(function(p){var d=p.startRow,s=p.startCol,c=p.endRow,e=p.endCol,i=p.className,o=p.type,h=p.inFront,r=h===void 0?!1:h,u=new ya.Range(d,s,c,e);l.getSession().addMarker(u,i,o,r)})},t.prototype.updateRef=function(n){this.refEditor=n},t.prototype.render=function(){var n=this.props,l=n.name,y=n.width,a=n.height,p=n.style,d=$n({width:y,height:a},p);return pi.createElement("div",{ref:this.updateRef,id:l,style:d})},t.propTypes={className:se.string,debounceChangePeriod:se.number,defaultValue:se.arrayOf(se.string),focus:se.bool,fontSize:se.oneOfType([se.number,se.string]),height:se.string,mode:se.string,name:se.string,onBlur:se.func,onChange:se.func,onCopy:se.func,onFocus:se.func,onInput:se.func,onLoad:se.func,onPaste:se.func,onScroll:se.func,orientation:se.string,showGutter:se.bool,splits:se.number,theme:se.string,value:se.arrayOf(se.string),width:se.string,onSelectionChange:se.func,onCursorChange:se.func,onBeforeLoad:se.func,minLines:se.number,maxLines:se.number,readOnly:se.bool,highlightActiveLine:se.bool,tabSize:se.number,showPrintMargin:se.bool,cursorStart:se.number,editorProps:se.object,setOptions:se.object,style:se.object,scrollMargin:se.array,annotations:se.array,markers:se.array,keyboardHandler:se.string,wrapEnabled:se.bool,enableBasicAutocompletion:se.oneOfType([se.bool,se.array]),enableLiveAutocompletion:se.oneOfType([se.bool,se.array]),commands:se.array},t.defaultProps={name:"ace-editor",focus:!1,orientation:"beside",splits:2,mode:"",theme:"",height:"500px",width:"500px",value:[],fontSize:12,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1},t})(pi.Component);tt.default=wa;var ji={exports:{}};(function(L){var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},n=-1,l=1,y=0;t.Diff=function(a,p){return[a,p]},t.prototype.diff_main=function(a,p,d,s){typeof s>"u"&&(this.Diff_Timeout<=0?s=Number.MAX_VALUE:s=new Date().getTime()+this.Diff_Timeout*1e3);var c=s;if(a==null||p==null)throw new Error("Null input. (diff_main)");if(a==p)return a?[new t.Diff(y,a)]:[];typeof d>"u"&&(d=!0);var e=d,i=this.diff_commonPrefix(a,p),o=a.substring(0,i);a=a.substring(i),p=p.substring(i),i=this.diff_commonSuffix(a,p);var h=a.substring(a.length-i);a=a.substring(0,a.length-i),p=p.substring(0,p.length-i);var r=this.diff_compute_(a,p,e,c);return o&&r.unshift(new t.Diff(y,o)),h&&r.push(new t.Diff(y,h)),this.diff_cleanupMerge(r),r},t.prototype.diff_compute_=function(a,p,d,s){var c;if(!a)return[new t.Diff(l,p)];if(!p)return[new t.Diff(n,a)];var e=a.length>p.length?a:p,i=a.length>p.length?p:a,o=e.indexOf(i);if(o!=-1)return c=[new t.Diff(l,e.substring(0,o)),new t.Diff(y,i),new t.Diff(l,e.substring(o+i.length))],a.length>p.length&&(c[0][0]=c[2][0]=n),c;if(i.length==1)return[new t.Diff(n,a),new t.Diff(l,p)];var h=this.diff_halfMatch_(a,p);if(h){var r=h[0],u=h[1],f=h[2],g=h[3],v=h[4],A=this.diff_main(r,f,d,s),E=this.diff_main(u,g,d,s);return A.concat([new t.Diff(y,v)],E)}return d&&a.length>100&&p.length>100?this.diff_lineMode_(a,p,s):this.diff_bisect_(a,p,s)},t.prototype.diff_lineMode_=function(a,p,d){var s=this.diff_linesToChars_(a,p);a=s.chars1,p=s.chars2;var c=s.lineArray,e=this.diff_main(a,p,!1,d);this.diff_charsToLines_(e,c),this.diff_cleanupSemantic(e),e.push(new t.Diff(y,""));for(var i=0,o=0,h=0,r="",u="";i<e.length;){switch(e[i][0]){case l:h++,u+=e[i][1];break;case n:o++,r+=e[i][1];break;case y:if(o>=1&&h>=1){e.splice(i-o-h,o+h),i=i-o-h;for(var f=this.diff_main(r,u,!1,d),g=f.length-1;g>=0;g--)e.splice(i,0,f[g]);i=i+f.length}h=0,o=0,r="",u="";break}i++}return e.pop(),e},t.prototype.diff_bisect_=function(a,p,d){for(var s=a.length,c=p.length,e=Math.ceil((s+c)/2),i=e,o=2*e,h=new Array(o),r=new Array(o),u=0;u<o;u++)h[u]=-1,r[u]=-1;h[i+1]=0,r[i+1]=0;for(var f=s-c,g=f%2!=0,v=0,A=0,E=0,w=0,m=0;m<e&&!(new Date().getTime()>d);m++){for(var S=-m+v;S<=m-A;S+=2){var k=i+S,D;S==-m||S!=m&&h[k-1]<h[k+1]?D=h[k+1]:D=h[k-1]+1;for(var _=D-S;D<s&&_<c&&a.charAt(D)==p.charAt(_);)D++,_++;if(h[k]=D,D>s)A+=2;else if(_>c)v+=2;else if(g){var F=i+f-S;if(F>=0&&F<o&&r[F]!=-1){var x=s-r[F];if(D>=x)return this.diff_bisectSplit_(a,p,D,_,d)}}}for(var $=-m+E;$<=m-w;$+=2){var F=i+$,x;$==-m||$!=m&&r[F-1]<r[F+1]?x=r[F+1]:x=r[F-1]+1;for(var C=x-$;x<s&&C<c&&a.charAt(s-x-1)==p.charAt(c-C-1);)x++,C++;if(r[F]=x,x>s)w+=2;else if(C>c)E+=2;else if(!g){var k=i+f-$;if(k>=0&&k<o&&h[k]!=-1){var D=h[k],_=i+D-k;if(x=s-x,D>=x)return this.diff_bisectSplit_(a,p,D,_,d)}}}}return[new t.Diff(n,a),new t.Diff(l,p)]},t.prototype.diff_bisectSplit_=function(a,p,d,s,c){var e=a.substring(0,d),i=p.substring(0,s),o=a.substring(d),h=p.substring(s),r=this.diff_main(e,i,!1,c),u=this.diff_main(o,h,!1,c);return r.concat(u)},t.prototype.diff_linesToChars_=function(a,p){var d=[],s={};d[0]="";function c(h){for(var r="",u=0,f=-1,g=d.length;f<h.length-1;){f=h.indexOf(`
|
|
1000
|
-
`,u),f==-1&&(f=h.length-1);var v=h.substring(u,f+1);(s.hasOwnProperty?s.hasOwnProperty(v):s[v]!==void 0)?r+=String.fromCharCode(s[v]):(g==e&&(v=h.substring(u),f=h.length),r+=String.fromCharCode(g),s[v]=g,d[g++]=v),u=f+1}return r}var e=4e4,i=c(a);e=65535;var o=c(p);return{chars1:i,chars2:o,lineArray:d}},t.prototype.diff_charsToLines_=function(a,p){for(var d=0;d<a.length;d++){for(var s=a[d][1],c=[],e=0;e<s.length;e++)c[e]=p[s.charCodeAt(e)];a[d][1]=c.join("")}},t.prototype.diff_commonPrefix=function(a,p){if(!a||!p||a.charAt(0)!=p.charAt(0))return 0;for(var d=0,s=Math.min(a.length,p.length),c=s,e=0;d<c;)a.substring(e,c)==p.substring(e,c)?(d=c,e=d):s=c,c=Math.floor((s-d)/2+d);return c},t.prototype.diff_commonSuffix=function(a,p){if(!a||!p||a.charAt(a.length-1)!=p.charAt(p.length-1))return 0;for(var d=0,s=Math.min(a.length,p.length),c=s,e=0;d<c;)a.substring(a.length-c,a.length-e)==p.substring(p.length-c,p.length-e)?(d=c,e=d):s=c,c=Math.floor((s-d)/2+d);return c},t.prototype.diff_commonOverlap_=function(a,p){var d=a.length,s=p.length;if(d==0||s==0)return 0;d>s?a=a.substring(d-s):d<s&&(p=p.substring(0,d));var c=Math.min(d,s);if(a==p)return c;for(var e=0,i=1;;){var o=a.substring(c-i),h=p.indexOf(o);if(h==-1)return e;i+=h,(h==0||a.substring(c-i)==p.substring(0,i))&&(e=i,i++)}},t.prototype.diff_halfMatch_=function(a,p){if(this.Diff_Timeout<=0)return null;var d=a.length>p.length?a:p,s=a.length>p.length?p:a;if(d.length<4||s.length*2<d.length)return null;var c=this;function e(A,E,w){for(var m=A.substring(w,w+Math.floor(A.length/4)),S=-1,k="",D,_,F,x;(S=E.indexOf(m,S+1))!=-1;){var $=c.diff_commonPrefix(A.substring(w),E.substring(S)),C=c.diff_commonSuffix(A.substring(0,w),E.substring(0,S));k.length<C+$&&(k=E.substring(S-C,S)+E.substring(S,S+$),D=A.substring(0,w-C),_=A.substring(w+$),F=E.substring(0,S-C),x=E.substring(S+$))}return k.length*2>=A.length?[D,_,F,x,k]:null}var i=e(d,s,Math.ceil(d.length/4)),o=e(d,s,Math.ceil(d.length/2)),h;if(!i&&!o)return null;o?i?h=i[4].length>o[4].length?i:o:h=o:h=i;var r,u,f,g;a.length>p.length?(r=h[0],u=h[1],f=h[2],g=h[3]):(f=h[0],g=h[1],r=h[2],u=h[3]);var v=h[4];return[r,u,f,g,v]},t.prototype.diff_cleanupSemantic=function(a){for(var p=!1,d=[],s=0,c=null,e=0,i=0,o=0,h=0,r=0;e<a.length;)a[e][0]==y?(d[s++]=e,i=h,o=r,h=0,r=0,c=a[e][1]):(a[e][0]==l?h+=a[e][1].length:r+=a[e][1].length,c&&c.length<=Math.max(i,o)&&c.length<=Math.max(h,r)&&(a.splice(d[s-1],0,new t.Diff(n,c)),a[d[s-1]+1][0]=l,s--,s--,e=s>0?d[s-1]:-1,i=0,o=0,h=0,r=0,c=null,p=!0)),e++;for(p&&this.diff_cleanupMerge(a),this.diff_cleanupSemanticLossless(a),e=1;e<a.length;){if(a[e-1][0]==n&&a[e][0]==l){var u=a[e-1][1],f=a[e][1],g=this.diff_commonOverlap_(u,f),v=this.diff_commonOverlap_(f,u);g>=v?(g>=u.length/2||g>=f.length/2)&&(a.splice(e,0,new t.Diff(y,f.substring(0,g))),a[e-1][1]=u.substring(0,u.length-g),a[e+1][1]=f.substring(g),e++):(v>=u.length/2||v>=f.length/2)&&(a.splice(e,0,new t.Diff(y,u.substring(0,v))),a[e-1][0]=l,a[e-1][1]=f.substring(0,f.length-v),a[e+1][0]=n,a[e+1][1]=u.substring(v),e++),e++}e++}},t.prototype.diff_cleanupSemanticLossless=function(a){function p(v,A){if(!v||!A)return 6;var E=v.charAt(v.length-1),w=A.charAt(0),m=E.match(t.nonAlphaNumericRegex_),S=w.match(t.nonAlphaNumericRegex_),k=m&&E.match(t.whitespaceRegex_),D=S&&w.match(t.whitespaceRegex_),_=k&&E.match(t.linebreakRegex_),F=D&&w.match(t.linebreakRegex_),x=_&&v.match(t.blanklineEndRegex_),$=F&&A.match(t.blanklineStartRegex_);return x||$?5:_||F?4:m&&!k&&D?3:k||D?2:m||S?1:0}for(var d=1;d<a.length-1;){if(a[d-1][0]==y&&a[d+1][0]==y){var s=a[d-1][1],c=a[d][1],e=a[d+1][1],i=this.diff_commonSuffix(s,c);if(i){var o=c.substring(c.length-i);s=s.substring(0,s.length-i),c=o+c.substring(0,c.length-i),e=o+e}for(var h=s,r=c,u=e,f=p(s,c)+p(c,e);c.charAt(0)===e.charAt(0);){s+=c.charAt(0),c=c.substring(1)+e.charAt(0),e=e.substring(1);var g=p(s,c)+p(c,e);g>=f&&(f=g,h=s,r=c,u=e)}a[d-1][1]!=h&&(h?a[d-1][1]=h:(a.splice(d-1,1),d--),a[d][1]=r,u?a[d+1][1]=u:(a.splice(d+1,1),d--))}d++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(a){for(var p=!1,d=[],s=0,c=null,e=0,i=!1,o=!1,h=!1,r=!1;e<a.length;)a[e][0]==y?(a[e][1].length<this.Diff_EditCost&&(h||r)?(d[s++]=e,i=h,o=r,c=a[e][1]):(s=0,c=null),h=r=!1):(a[e][0]==n?r=!0:h=!0,c&&(i&&o&&h&&r||c.length<this.Diff_EditCost/2&&i+o+h+r==3)&&(a.splice(d[s-1],0,new t.Diff(n,c)),a[d[s-1]+1][0]=l,s--,c=null,i&&o?(h=r=!0,s=0):(s--,e=s>0?d[s-1]:-1,h=r=!1),p=!0)),e++;p&&this.diff_cleanupMerge(a)},t.prototype.diff_cleanupMerge=function(a){a.push(new t.Diff(y,""));for(var p=0,d=0,s=0,c="",e="",i;p<a.length;)switch(a[p][0]){case l:s++,e+=a[p][1],p++;break;case n:d++,c+=a[p][1],p++;break;case y:d+s>1?(d!==0&&s!==0&&(i=this.diff_commonPrefix(e,c),i!==0&&(p-d-s>0&&a[p-d-s-1][0]==y?a[p-d-s-1][1]+=e.substring(0,i):(a.splice(0,0,new t.Diff(y,e.substring(0,i))),p++),e=e.substring(i),c=c.substring(i)),i=this.diff_commonSuffix(e,c),i!==0&&(a[p][1]=e.substring(e.length-i)+a[p][1],e=e.substring(0,e.length-i),c=c.substring(0,c.length-i))),p-=d+s,a.splice(p,d+s),c.length&&(a.splice(p,0,new t.Diff(n,c)),p++),e.length&&(a.splice(p,0,new t.Diff(l,e)),p++),p++):p!==0&&a[p-1][0]==y?(a[p-1][1]+=a[p][1],a.splice(p,1)):p++,s=0,d=0,c="",e="";break}a[a.length-1][1]===""&&a.pop();var o=!1;for(p=1;p<a.length-1;)a[p-1][0]==y&&a[p+1][0]==y&&(a[p][1].substring(a[p][1].length-a[p-1][1].length)==a[p-1][1]?(a[p][1]=a[p-1][1]+a[p][1].substring(0,a[p][1].length-a[p-1][1].length),a[p+1][1]=a[p-1][1]+a[p+1][1],a.splice(p-1,1),o=!0):a[p][1].substring(0,a[p+1][1].length)==a[p+1][1]&&(a[p-1][1]+=a[p+1][1],a[p][1]=a[p][1].substring(a[p+1][1].length)+a[p+1][1],a.splice(p+1,1),o=!0)),p++;o&&this.diff_cleanupMerge(a)},t.prototype.diff_xIndex=function(a,p){var d=0,s=0,c=0,e=0,i;for(i=0;i<a.length&&(a[i][0]!==l&&(d+=a[i][1].length),a[i][0]!==n&&(s+=a[i][1].length),!(d>p));i++)c=d,e=s;return a.length!=i&&a[i][0]===n?e:e+(p-c)},t.prototype.diff_prettyHtml=function(a){for(var p=[],d=/&/g,s=/</g,c=/>/g,e=/\n/g,i=0;i<a.length;i++){var o=a[i][0],h=a[i][1],r=h.replace(d,"&").replace(s,"<").replace(c,">").replace(e,"¶<br>");switch(o){case l:p[i]='<ins style="background:#e6ffe6;">'+r+"</ins>";break;case n:p[i]='<del style="background:#ffe6e6;">'+r+"</del>";break;case y:p[i]="<span>"+r+"</span>";break}}return p.join("")},t.prototype.diff_text1=function(a){for(var p=[],d=0;d<a.length;d++)a[d][0]!==l&&(p[d]=a[d][1]);return p.join("")},t.prototype.diff_text2=function(a){for(var p=[],d=0;d<a.length;d++)a[d][0]!==n&&(p[d]=a[d][1]);return p.join("")},t.prototype.diff_levenshtein=function(a){for(var p=0,d=0,s=0,c=0;c<a.length;c++){var e=a[c][0],i=a[c][1];switch(e){case l:d+=i.length;break;case n:s+=i.length;break;case y:p+=Math.max(d,s),d=0,s=0;break}}return p+=Math.max(d,s),p},t.prototype.diff_toDelta=function(a){for(var p=[],d=0;d<a.length;d++)switch(a[d][0]){case l:p[d]="+"+encodeURI(a[d][1]);break;case n:p[d]="-"+a[d][1].length;break;case y:p[d]="="+a[d][1].length;break}return p.join(" ").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(a,p){for(var d=[],s=0,c=0,e=p.split(/\t/g),i=0;i<e.length;i++){var o=e[i].substring(1);switch(e[i].charAt(0)){case"+":try{d[s++]=new t.Diff(l,decodeURI(o))}catch{throw new Error("Illegal escape in diff_fromDelta: "+o)}break;case"-":case"=":var h=parseInt(o,10);if(isNaN(h)||h<0)throw new Error("Invalid number in diff_fromDelta: "+o);var r=a.substring(c,c+=h);e[i].charAt(0)=="="?d[s++]=new t.Diff(y,r):d[s++]=new t.Diff(n,r);break;default:if(e[i])throw new Error("Invalid diff operation in diff_fromDelta: "+e[i])}}if(c!=a.length)throw new Error("Delta length ("+c+") does not equal source text length ("+a.length+").");return d},t.prototype.match_main=function(a,p,d){if(a==null||p==null||d==null)throw new Error("Null input. (match_main)");return d=Math.max(0,Math.min(d,a.length)),a==p?0:a.length?a.substring(d,d+p.length)==p?d:this.match_bitap_(a,p,d):-1},t.prototype.match_bitap_=function(a,p,d){if(p.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var s=this.match_alphabet_(p),c=this;function e(D,_){var F=D/p.length,x=Math.abs(d-_);return c.Match_Distance?F+x/c.Match_Distance:x?1:F}var i=this.Match_Threshold,o=a.indexOf(p,d);o!=-1&&(i=Math.min(e(0,o),i),o=a.lastIndexOf(p,d+p.length),o!=-1&&(i=Math.min(e(0,o),i)));var h=1<<p.length-1;o=-1;for(var r,u,f=p.length+a.length,g,v=0;v<p.length;v++){for(r=0,u=f;r<u;)e(v,d+u)<=i?r=u:f=u,u=Math.floor((f-r)/2+r);f=u;var A=Math.max(1,d-u+1),E=Math.min(d+u,a.length)+p.length,w=Array(E+2);w[E+1]=(1<<v)-1;for(var m=E;m>=A;m--){var S=s[a.charAt(m-1)];if(v===0?w[m]=(w[m+1]<<1|1)&S:w[m]=(w[m+1]<<1|1)&S|((g[m+1]|g[m])<<1|1)|g[m+1],w[m]&h){var k=e(v,m-1);if(k<=i)if(i=k,o=m-1,o>d)A=Math.max(1,2*d-o);else break}}if(e(v+1,d)>i)break;g=w}return o},t.prototype.match_alphabet_=function(a){for(var p={},d=0;d<a.length;d++)p[a.charAt(d)]=0;for(var d=0;d<a.length;d++)p[a.charAt(d)]|=1<<a.length-d-1;return p},t.prototype.patch_addContext_=function(a,p){if(p.length!=0){if(a.start2===null)throw Error("patch not initialized");for(var d=p.substring(a.start2,a.start2+a.length1),s=0;p.indexOf(d)!=p.lastIndexOf(d)&&d.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)s+=this.Patch_Margin,d=p.substring(a.start2-s,a.start2+a.length1+s);s+=this.Patch_Margin;var c=p.substring(a.start2-s,a.start2);c&&a.diffs.unshift(new t.Diff(y,c));var e=p.substring(a.start2+a.length1,a.start2+a.length1+s);e&&a.diffs.push(new t.Diff(y,e)),a.start1-=c.length,a.start2-=c.length,a.length1+=c.length+e.length,a.length2+=c.length+e.length}},t.prototype.patch_make=function(a,p,d){var s,c;if(typeof a=="string"&&typeof p=="string"&&typeof d>"u")s=a,c=this.diff_main(s,p,!0),c.length>2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(a&&typeof a=="object"&&typeof p>"u"&&typeof d>"u")c=a,s=this.diff_text1(c);else if(typeof a=="string"&&p&&typeof p=="object"&&typeof d>"u")s=a,c=p;else if(typeof a=="string"&&typeof p=="string"&&d&&typeof d=="object")s=a,c=d;else throw new Error("Unknown call format to patch_make.");if(c.length===0)return[];for(var e=[],i=new t.patch_obj,o=0,h=0,r=0,u=s,f=s,g=0;g<c.length;g++){var v=c[g][0],A=c[g][1];switch(!o&&v!==y&&(i.start1=h,i.start2=r),v){case l:i.diffs[o++]=c[g],i.length2+=A.length,f=f.substring(0,r)+A+f.substring(r);break;case n:i.length1+=A.length,i.diffs[o++]=c[g],f=f.substring(0,r)+f.substring(r+A.length);break;case y:A.length<=2*this.Patch_Margin&&o&&c.length!=g+1?(i.diffs[o++]=c[g],i.length1+=A.length,i.length2+=A.length):A.length>=2*this.Patch_Margin&&o&&(this.patch_addContext_(i,u),e.push(i),i=new t.patch_obj,o=0,u=f,h=r);break}v!==l&&(h+=A.length),v!==n&&(r+=A.length)}return o&&(this.patch_addContext_(i,u),e.push(i)),e},t.prototype.patch_deepCopy=function(a){for(var p=[],d=0;d<a.length;d++){var s=a[d],c=new t.patch_obj;c.diffs=[];for(var e=0;e<s.diffs.length;e++)c.diffs[e]=new t.Diff(s.diffs[e][0],s.diffs[e][1]);c.start1=s.start1,c.start2=s.start2,c.length1=s.length1,c.length2=s.length2,p[d]=c}return p},t.prototype.patch_apply=function(a,p){if(a.length==0)return[p,[]];a=this.patch_deepCopy(a);var d=this.patch_addPadding(a);p=d+p+d,this.patch_splitMax(a);for(var s=0,c=[],e=0;e<a.length;e++){var i=a[e].start2+s,o=this.diff_text1(a[e].diffs),h,r=-1;if(o.length>this.Match_MaxBits?(h=this.match_main(p,o.substring(0,this.Match_MaxBits),i),h!=-1&&(r=this.match_main(p,o.substring(o.length-this.Match_MaxBits),i+o.length-this.Match_MaxBits),(r==-1||h>=r)&&(h=-1))):h=this.match_main(p,o,i),h==-1)c[e]=!1,s-=a[e].length2-a[e].length1;else{c[e]=!0,s=h-i;var u;if(r==-1?u=p.substring(h,h+o.length):u=p.substring(h,r+this.Match_MaxBits),o==u)p=p.substring(0,h)+this.diff_text2(a[e].diffs)+p.substring(h+o.length);else{var f=this.diff_main(o,u,!1);if(o.length>this.Match_MaxBits&&this.diff_levenshtein(f)/o.length>this.Patch_DeleteThreshold)c[e]=!1;else{this.diff_cleanupSemanticLossless(f);for(var g=0,v,A=0;A<a[e].diffs.length;A++){var E=a[e].diffs[A];E[0]!==y&&(v=this.diff_xIndex(f,g)),E[0]===l?p=p.substring(0,h+v)+E[1]+p.substring(h+v):E[0]===n&&(p=p.substring(0,h+v)+p.substring(h+this.diff_xIndex(f,g+E[1].length))),E[0]!==n&&(g+=E[1].length)}}}}}return p=p.substring(d.length,p.length-d.length),[p,c]},t.prototype.patch_addPadding=function(a){for(var p=this.Patch_Margin,d="",s=1;s<=p;s++)d+=String.fromCharCode(s);for(var s=0;s<a.length;s++)a[s].start1+=p,a[s].start2+=p;var c=a[0],e=c.diffs;if(e.length==0||e[0][0]!=y)e.unshift(new t.Diff(y,d)),c.start1-=p,c.start2-=p,c.length1+=p,c.length2+=p;else if(p>e[0][1].length){var i=p-e[0][1].length;e[0][1]=d.substring(e[0][1].length)+e[0][1],c.start1-=i,c.start2-=i,c.length1+=i,c.length2+=i}if(c=a[a.length-1],e=c.diffs,e.length==0||e[e.length-1][0]!=y)e.push(new t.Diff(y,d)),c.length1+=p,c.length2+=p;else if(p>e[e.length-1][1].length){var i=p-e[e.length-1][1].length;e[e.length-1][1]+=d.substring(0,i),c.length1+=i,c.length2+=i}return d},t.prototype.patch_splitMax=function(a){for(var p=this.Match_MaxBits,d=0;d<a.length;d++)if(!(a[d].length1<=p)){var s=a[d];a.splice(d--,1);for(var c=s.start1,e=s.start2,i="";s.diffs.length!==0;){var o=new t.patch_obj,h=!0;for(o.start1=c-i.length,o.start2=e-i.length,i!==""&&(o.length1=o.length2=i.length,o.diffs.push(new t.Diff(y,i)));s.diffs.length!==0&&o.length1<p-this.Patch_Margin;){var r=s.diffs[0][0],u=s.diffs[0][1];r===l?(o.length2+=u.length,e+=u.length,o.diffs.push(s.diffs.shift()),h=!1):r===n&&o.diffs.length==1&&o.diffs[0][0]==y&&u.length>2*p?(o.length1+=u.length,c+=u.length,h=!1,o.diffs.push(new t.Diff(r,u)),s.diffs.shift()):(u=u.substring(0,p-o.length1-this.Patch_Margin),o.length1+=u.length,c+=u.length,r===y?(o.length2+=u.length,e+=u.length):h=!1,o.diffs.push(new t.Diff(r,u)),u==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(u.length))}i=this.diff_text2(o.diffs),i=i.substring(i.length-this.Patch_Margin);var f=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);f!==""&&(o.length1+=f.length,o.length2+=f.length,o.diffs.length!==0&&o.diffs[o.diffs.length-1][0]===y?o.diffs[o.diffs.length-1][1]+=f:o.diffs.push(new t.Diff(y,f))),h||a.splice(++d,0,o)}}},t.prototype.patch_toText=function(a){for(var p=[],d=0;d<a.length;d++)p[d]=a[d];return p.join("")},t.prototype.patch_fromText=function(a){var p=[];if(!a)return p;for(var d=a.split(`
|
|
1001
|
-
`),s=0,c=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<d.length;){var e=d[s].match(c);if(!e)throw new Error("Invalid patch string: "+d[s]);var i=new t.patch_obj;for(p.push(i),i.start1=parseInt(e[1],10),e[2]===""?(i.start1--,i.length1=1):e[2]=="0"?i.length1=0:(i.start1--,i.length1=parseInt(e[2],10)),i.start2=parseInt(e[3],10),e[4]===""?(i.start2--,i.length2=1):e[4]=="0"?i.length2=0:(i.start2--,i.length2=parseInt(e[4],10)),s++;s<d.length;){var o=d[s].charAt(0);try{var h=decodeURI(d[s].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+h)}if(o=="-")i.diffs.push(new t.Diff(n,h));else if(o=="+")i.diffs.push(new t.Diff(l,h));else if(o==" ")i.diffs.push(new t.Diff(y,h));else{if(o=="@")break;if(o!=="")throw new Error('Invalid patch mode "'+o+'" in: '+h)}s++}}return p},t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},t.patch_obj.prototype.toString=function(){var a,p;this.length1===0?a=this.start1+",0":this.length1==1?a=this.start1+1:a=this.start1+1+","+this.length1,this.length2===0?p=this.start2+",0":this.length2==1?p=this.start2+1:p=this.start2+1+","+this.length2;for(var d=["@@ -"+a+" +"+p+` @@
|
|
1002
|
-
`],s,c=0;c<this.diffs.length;c++){switch(this.diffs[c][0]){case l:s="+";break;case n:s="-";break;case y:s=" ";break}d[c+1]=s+encodeURI(this.diffs[c][1])+`
|
|
1003
|
-
`}return d.join("").replace(/%20/g," ")},L.exports=t,L.exports.diff_match_patch=t,L.exports.DIFF_DELETE=n,L.exports.DIFF_INSERT=l,L.exports.DIFF_EQUAL=y})(ji);var Ca=ji.exports,Ea=kt&&kt.__extends||(function(){var L=function(t,n){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,y){l.__proto__=y}||function(l,y){for(var a in y)Object.prototype.hasOwnProperty.call(y,a)&&(l[a]=y[a])},L(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");L(t,n);function l(){this.constructor=t}t.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)}})();Object.defineProperty(kt,"__esModule",{value:!0});var pe=Tn,di=qe,Sa=tt,Da=Ca,xa=(function(L){Ea(t,L);function t(n){var l=L.call(this,n)||this;return l.state={value:l.props.value},l.onChange=l.onChange.bind(l),l.diff=l.diff.bind(l),l}return t.prototype.componentDidUpdate=function(){var n=this.props.value;n!==this.state.value&&this.setState({value:n})},t.prototype.onChange=function(n){this.setState({value:n}),this.props.onChange&&this.props.onChange(n)},t.prototype.diff=function(){var n=new Da,l=this.state.value[0],y=this.state.value[1];if(l.length===0&&y.length===0)return[];var a=n.diff_main(l,y);n.diff_cleanupSemantic(a);var p=this.generateDiffedLines(a),d=this.setCodeMarkers(p);return d},t.prototype.generateDiffedLines=function(n){var l={DIFF_EQUAL:0,DIFF_DELETE:-1,DIFF_INSERT:1},y={left:[],right:[]},a={left:1,right:1};return n.forEach(function(p){var d=p[0],s=p[1],c=s.split(`
|
|
1004
|
-
`).length-1;if(s.length!==0){var e=s[0],i=s[s.length-1],o=0;switch(d){case l.DIFF_EQUAL:a.left+=c,a.right+=c;break;case l.DIFF_DELETE:e===`
|
|
1005
|
-
`&&(a.left++,c--),o=c,o===0&&y.right.push({startLine:a.right,endLine:a.right}),i===`
|
|
1006
|
-
`&&(o-=1),y.left.push({startLine:a.left,endLine:a.left+o}),a.left+=c;break;case l.DIFF_INSERT:e===`
|
|
1007
|
-
`&&(a.right++,c--),o=c,o===0&&y.left.push({startLine:a.left,endLine:a.left}),i===`
|
|
1008
|
-
`&&(o-=1),y.right.push({startLine:a.right,endLine:a.right+o}),a.right+=c;break;default:throw new Error("Diff type was not defined.")}}}),y},t.prototype.setCodeMarkers=function(n){n===void 0&&(n={left:[],right:[]});for(var l=[],y={left:[],right:[]},a=0;a<n.left.length;a++){var p={startRow:n.left[a].startLine-1,endRow:n.left[a].endLine,type:"text",className:"codeMarker"};y.left.push(p)}for(var a=0;a<n.right.length;a++){var p={startRow:n.right[a].startLine-1,endRow:n.right[a].endLine,type:"text",className:"codeMarker"};y.right.push(p)}return l[0]=y.left,l[1]=y.right,l},t.prototype.render=function(){var n=this.diff();return di.createElement(Sa.default,{name:this.props.name,className:this.props.className,focus:this.props.focus,orientation:this.props.orientation,splits:this.props.splits,mode:this.props.mode,theme:this.props.theme,height:this.props.height,width:this.props.width,fontSize:this.props.fontSize,showGutter:this.props.showGutter,onChange:this.onChange,onPaste:this.props.onPaste,onLoad:this.props.onLoad,onScroll:this.props.onScroll,minLines:this.props.minLines,maxLines:this.props.maxLines,readOnly:this.props.readOnly,highlightActiveLine:this.props.highlightActiveLine,showPrintMargin:this.props.showPrintMargin,tabSize:this.props.tabSize,cursorStart:this.props.cursorStart,editorProps:this.props.editorProps,style:this.props.style,scrollMargin:this.props.scrollMargin,setOptions:this.props.setOptions,wrapEnabled:this.props.wrapEnabled,enableBasicAutocompletion:this.props.enableBasicAutocompletion,enableLiveAutocompletion:this.props.enableLiveAutocompletion,value:this.state.value,markers:n})},t.propTypes={cursorStart:pe.number,editorProps:pe.object,enableBasicAutocompletion:pe.bool,enableLiveAutocompletion:pe.bool,focus:pe.bool,fontSize:pe.number,height:pe.string,highlightActiveLine:pe.bool,maxLines:pe.number,minLines:pe.number,mode:pe.string,name:pe.string,className:pe.string,onLoad:pe.func,onPaste:pe.func,onScroll:pe.func,onChange:pe.func,orientation:pe.string,readOnly:pe.bool,scrollMargin:pe.array,setOptions:pe.object,showGutter:pe.bool,showPrintMargin:pe.bool,splits:pe.number,style:pe.object,tabSize:pe.number,theme:pe.string,value:pe.array,width:pe.string,wrapEnabled:pe.bool},t.defaultProps={cursorStart:1,editorProps:{},enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,focus:!1,fontSize:12,height:"500px",highlightActiveLine:!0,maxLines:null,minLines:null,mode:"",name:"ace-editor",onLoad:null,onScroll:null,onPaste:null,onChange:null,orientation:"beside",readOnly:!1,scrollMargin:[0,0,0,0],setOptions:{},showGutter:!0,showPrintMargin:!0,splits:2,style:{},tabSize:4,theme:"github",value:["",""],width:"500px",wrapEnabled:!0},t})(di.Component);kt.default=xa;Object.defineProperty(wt,"__esModule",{value:!0});wt.diff=wt.split=void 0;var Aa=ut,$a=kt;wt.diff=$a.default;var Ta=tt;wt.split=Ta.default;var _a=wt.default=Aa.default,ka={exports:{}};(function(L,t){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(n,l,y){var a=n("../lib/oop"),p=n("./text_highlight_rules").TextHighlightRules,d=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};a.inherits(d,p),l.JsonHighlightRules=d}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(n,l,y){var a=n("../range").Range,p=function(){};(function(){this.checkOutdent=function(d,s){return/^\s+$/.test(d)?/^\s*\}/.test(s):!1},this.autoOutdent=function(d,s){var c=d.getLine(s),e=c.match(/^(\s*\})/);if(!e)return 0;var i=e[1].length,o=d.findMatchingBracket({row:s,column:i});if(!o||o.row==s)return 0;var h=this.$getIndent(d.getLine(o.row));d.replace(new a(s,0,s,i-1),h)},this.$getIndent=function(d){return d.match(/^\s*/)[0]}}).call(p.prototype),l.MatchingBraceOutdent=p}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(n,l,y){var a=n("../../lib/oop"),p=n("../../range").Range,d=n("./fold_mode").FoldMode,s=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)))};a.inherits(s,d),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(c,e,i){var o=c.getLine(i);if(this.singleLineBlockCommentRe.test(o)&&!this.startRegionRe.test(o)&&!this.tripleStarBlockCommentRe.test(o))return"";var h=this._getFoldWidgetBase(c,e,i);return!h&&this.startRegionRe.test(o)?"start":h},this.getFoldWidgetRange=function(c,e,i,o){var h=c.getLine(i);if(this.startRegionRe.test(h))return this.getCommentRegionBlock(c,h,i);var f=h.match(this.foldingStartMarker);if(f){var r=f.index;if(f[1])return this.openingBracketBlock(c,f[1],i,r);var u=c.getCommentFoldRange(i,r+f[0].length,1);return u&&!u.isMultiLine()&&(o?u=this.getSectionRange(c,i):e!="all"&&(u=null)),u}if(e!=="markbegin"){var f=h.match(this.foldingStopMarker);if(f){var r=f.index+f[0].length;return f[1]?this.closingBracketBlock(c,f[1],i,r):c.getCommentFoldRange(i,r,-1)}}},this.getSectionRange=function(c,e){var i=c.getLine(e),o=i.search(/\S/),h=e,r=i.length;e+=1;for(var u=e,f=c.getLength();++e<f;){i=c.getLine(e);var g=i.search(/\S/);if(g!==-1){if(o>g)break;var v=this.getFoldWidgetRange(c,"all",e);if(v){if(v.start.row<=h)break;if(v.isMultiLine())e=v.end.row;else if(o==g)break}u=e}}return new p(h,r,u,c.getLine(u).length)},this.getCommentRegionBlock=function(c,e,i){for(var o=e.search(/\s*$/),h=c.getLength(),r=i,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,f=1;++i<h;){e=c.getLine(i);var g=u.exec(e);if(g&&(g[1]?f--:f++,!f))break}var v=i;if(v>r)return new p(r,o,v,e.length)}}.call(s.prototype)}),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle","ace/worker/worker_client"],function(n,l,y){var a=n("../lib/oop"),p=n("./text").Mode,d=n("./json_highlight_rules").JsonHighlightRules,s=n("./matching_brace_outdent").MatchingBraceOutdent,c=n("./folding/cstyle").FoldMode,e=n("../worker/worker_client").WorkerClient,i=function(){this.HighlightRules=d,this.$outdent=new s,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new c};a.inherits(i,p),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(o,h,r){var u=this.$getIndent(h);if(o=="start"){var f=h.match(/^.*[\{\(\[]\s*$/);f&&(u+=r)}return u},this.checkOutdent=function(o,h,r){return this.$outdent.checkOutdent(h,r)},this.autoOutdent=function(o,h,r){this.$outdent.autoOutdent(h,r)},this.createWorker=function(o){var h=new e(["ace"],"ace/mode/json_worker","JsonWorker");return h.attachToDocument(o.getDocument()),h.on("annotate",function(r){o.setAnnotations(r.data)}),h.on("terminate",function(){o.clearAnnotations()}),h},this.$id="ace/mode/json"}.call(i.prototype),l.Mode=i}),(function(){ace.require(["ace/mode/json"],function(n){L&&(L.exports=n)})})()})(ka);var Ma={exports:{}};(function(L,t){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(n,l,y){var a=n("../lib/oop"),p=n("./text_highlight_rules").TextHighlightRules,d=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};a.inherits(d,p),l.JsonHighlightRules=d}),ace.define("ace/mode/json5_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/json_highlight_rules"],function(n,l,y){var a=n("../lib/oop"),p=n("./json_highlight_rules").JsonHighlightRules,d=function(){p.call(this);var s=[{token:"variable",regex:/[a-zA-Z$_\u00a1-\uffff][\w$\u00a1-\uffff]*\s*(?=:)/},{token:"variable",regex:/['](?:(?:\\.)|(?:[^'\\]))*?[']\s*(?=:)/},{token:"constant.language.boolean",regex:/(?:null)\b/},{token:"string",regex:/'/,next:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,consumeLineEnd:!0},{token:"string",regex:/'|$/,next:"start"},{defaultToken:"string"}]},{token:"string",regex:/"(?![^"]*":)/,next:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,consumeLineEnd:!0},{token:"string",regex:/"|$/,next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:/[+-]?(?:Infinity|NaN)\b/}];for(var c in this.$rules)this.$rules[c].unshift.apply(this.$rules[c],s);this.normalizeRules()};a.inherits(d,p),l.Json5HighlightRules=d}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(n,l,y){var a=n("../range").Range,p=function(){};(function(){this.checkOutdent=function(d,s){return/^\s+$/.test(d)?/^\s*\}/.test(s):!1},this.autoOutdent=function(d,s){var c=d.getLine(s),e=c.match(/^(\s*\})/);if(!e)return 0;var i=e[1].length,o=d.findMatchingBracket({row:s,column:i});if(!o||o.row==s)return 0;var h=this.$getIndent(d.getLine(o.row));d.replace(new a(s,0,s,i-1),h)},this.$getIndent=function(d){return d.match(/^\s*/)[0]}}).call(p.prototype),l.MatchingBraceOutdent=p}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(n,l,y){var a=n("../../lib/oop"),p=n("../../range").Range,d=n("./fold_mode").FoldMode,s=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)))};a.inherits(s,d),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(c,e,i){var o=c.getLine(i);if(this.singleLineBlockCommentRe.test(o)&&!this.startRegionRe.test(o)&&!this.tripleStarBlockCommentRe.test(o))return"";var h=this._getFoldWidgetBase(c,e,i);return!h&&this.startRegionRe.test(o)?"start":h},this.getFoldWidgetRange=function(c,e,i,o){var h=c.getLine(i);if(this.startRegionRe.test(h))return this.getCommentRegionBlock(c,h,i);var f=h.match(this.foldingStartMarker);if(f){var r=f.index;if(f[1])return this.openingBracketBlock(c,f[1],i,r);var u=c.getCommentFoldRange(i,r+f[0].length,1);return u&&!u.isMultiLine()&&(o?u=this.getSectionRange(c,i):e!="all"&&(u=null)),u}if(e!=="markbegin"){var f=h.match(this.foldingStopMarker);if(f){var r=f.index+f[0].length;return f[1]?this.closingBracketBlock(c,f[1],i,r):c.getCommentFoldRange(i,r,-1)}}},this.getSectionRange=function(c,e){var i=c.getLine(e),o=i.search(/\S/),h=e,r=i.length;e+=1;for(var u=e,f=c.getLength();++e<f;){i=c.getLine(e);var g=i.search(/\S/);if(g!==-1){if(o>g)break;var v=this.getFoldWidgetRange(c,"all",e);if(v){if(v.start.row<=h)break;if(v.isMultiLine())e=v.end.row;else if(o==g)break}u=e}}return new p(h,r,u,c.getLine(u).length)},this.getCommentRegionBlock=function(c,e,i){for(var o=e.search(/\s*$/),h=c.getLength(),r=i,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,f=1;++i<h;){e=c.getLine(i);var g=u.exec(e);if(g&&(g[1]?f--:f++,!f))break}var v=i;if(v>r)return new p(r,o,v,e.length)}}.call(s.prototype)}),ace.define("ace/mode/json5",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json5_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"],function(n,l,y){var a=n("../lib/oop"),p=n("./text").Mode,d=n("./json5_highlight_rules").Json5HighlightRules,s=n("./matching_brace_outdent").MatchingBraceOutdent,c=n("./folding/cstyle").FoldMode,e=function(){this.HighlightRules=d,this.$outdent=new s,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new c};a.inherits(e,p),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.checkOutdent=function(i,o,h){return this.$outdent.checkOutdent(o,h)},this.autoOutdent=function(i,o,h){this.$outdent.autoOutdent(o,h)},this.$id="ace/mode/json5"}.call(e.prototype),l.Mode=e}),(function(){ace.require(["ace/mode/json5"],function(n){L&&(L.exports=n)})})()})(Ma);var La={};(function(L){function t(y,a){for(var p=y,d="";p;){var s=a[p];if(typeof s=="string")return s+d;if(s)return s.location.replace(/\/*$/,"/")+(d||s.main||s.name);if(s===!1)return"";var c=p.lastIndexOf("/");if(c===-1)break;d=p.substr(c)+d,p=p.slice(0,c)}return y}if(!(typeof L.window<"u"&&L.document)&&!(L.require&&L.define)){L.console||(L.console=function(){var y=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:y})},L.console.error=L.console.warn=L.console.log=L.console.trace=L.console),L.window=L,L.ace=L,L.onerror=function(y,a,p,d,s){postMessage({type:"error",data:{message:y,data:s&&s.data,file:a,line:p,col:d,stack:s&&s.stack}})},L.normalizeModule=function(y,a){if(a.indexOf("!")!==-1){var p=a.split("!");return L.normalizeModule(y,p[0])+"!"+L.normalizeModule(y,p[1])}if(a.charAt(0)=="."){var d=y.split("/").slice(0,-1).join("/");for(a=(d?d+"/":"")+a;a.indexOf(".")!==-1&&s!=a;){var s=a;a=a.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return a},L.require=function(y,a){if(a||(a=y,y=null),!a.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");a=L.normalizeModule(y,a);var p=L.require.modules[a];if(p)return p.initialized||(p.initialized=!0,p.exports=p.factory().exports),p.exports;if(!L.require.tlns)return console.log("unable to load "+a);var d=t(a,L.require.tlns);return d.slice(-3)!=".js"&&(d+=".js"),L.require.id=a,L.require.modules[a]={},importScripts(d),L.require(y,a)},L.require.modules={},L.require.tlns={},L.define=function(y,a,p){if(arguments.length==2?(p=a,typeof y!="string"&&(a=y,y=L.require.id)):arguments.length==1&&(p=y,a=[],y=L.require.id),typeof p!="function"){L.require.modules[y]={exports:p,initialized:!0};return}a.length||(a=["require","exports","module"]);var d=function(s){return L.require(y,s)};L.require.modules[y]={exports:{},factory:function(){var s=this,c=p.apply(this,a.slice(0,p.length).map(function(e){switch(e){case"require":return d;case"exports":return s.exports;case"module":return s;default:return d(e)}}));return c&&(s.exports=c),s}}},L.define.amd={},L.require.tlns={},L.initBaseUrls=function(y){for(var a in y)this.require.tlns[a]=y[a]},L.initSender=function(){var y=L.require("ace/lib/event_emitter").EventEmitter,a=L.require("ace/lib/oop"),p=function(){};return function(){a.implement(this,y),this.callback=function(d,s){postMessage({type:"call",id:s,data:d})},this.emit=function(d,s){postMessage({type:"event",name:d,data:s})}}.call(p.prototype),new p};var n=L.main=null,l=L.sender=null;L.onmessage=function(y){var a=y.data;if(a.event&&l)l._signal(a.event,a.data);else if(a.command)if(n[a.command])n[a.command].apply(n,a.args);else{if(!L[a.command])throw new Error("Unknown command:"+a.command);L[a.command].apply(L,a.args)}else if(a.init){L.initBaseUrls(a.tlns),l=L.sender=L.initSender();var p=this.require(a.module)[a.classname];n=L.main=new p(l)}}}})(La),ace.define("ace/lib/oop",[],function(L,t,n){t.inherits=function(l,y){l.super_=y,l.prototype=Object.create(y.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(l,y){for(var a in y)l[a]=y[a];return l},t.implement=function(l,y){t.mixin(l,y)}}),ace.define("ace/apply_delta",[],function(L,t,n){t.applyDelta=function(l,y,a){var p=y.start.row,d=y.start.column,s=l[p]||"";switch(y.action){case"insert":var c=y.lines;if(c.length===1)l[p]=s.substring(0,d)+y.lines[0]+s.substring(d);else{var e=[p,1].concat(y.lines);l.splice.apply(l,e),l[p]=s.substring(0,d)+l[p],l[p+y.lines.length-1]+=s.substring(d)}break;case"remove":var i=y.end.column,o=y.end.row;p===o?l[p]=s.substring(0,d)+s.substring(i):l.splice(p,o-p+1,s.substring(0,d)+l[o].substring(i))}}}),ace.define("ace/lib/event_emitter",[],function(L,t,n){var l={},y=function(){this.propagationStopped=!0},a=function(){this.defaultPrevented=!0};l._emit=l._dispatchEvent=function(p,d){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var s=this._eventRegistry[p]||[],c=this._defaultHandlers[p];if(!(!s.length&&!c)){(typeof d!="object"||!d)&&(d={}),d.type||(d.type=p),d.stopPropagation||(d.stopPropagation=y),d.preventDefault||(d.preventDefault=a),s=s.slice();for(var e=0;e<s.length&&(s[e](d,this),!d.propagationStopped);e++);if(c&&!d.defaultPrevented)return c(d,this)}},l._signal=function(p,d){var s=(this._eventRegistry||{})[p];if(s){s=s.slice();for(var c=0;c<s.length;c++)s[c](d,this)}},l.once=function(p,d){var s=this;if(this.on(p,function c(){s.off(p,c),d.apply(null,arguments)}),!d)return new Promise(function(c){d=c})},l.setDefaultHandler=function(p,d){var s=this._defaultHandlers;if(s||(s=this._defaultHandlers={_disabled_:{}}),s[p]){var c=s[p],e=s._disabled_[p];e||(s._disabled_[p]=e=[]),e.push(c);var i=e.indexOf(d);i!=-1&&e.splice(i,1)}s[p]=d},l.removeDefaultHandler=function(p,d){var s=this._defaultHandlers;if(s){var c=s._disabled_[p];if(s[p]==d)c&&this.setDefaultHandler(p,c.pop());else if(c){var e=c.indexOf(d);e!=-1&&c.splice(e,1)}}},l.on=l.addEventListener=function(p,d,s){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[p];return c||(c=this._eventRegistry[p]=[]),c.indexOf(d)==-1&&c[s?"unshift":"push"](d),d},l.off=l.removeListener=l.removeEventListener=function(p,d){this._eventRegistry=this._eventRegistry||{};var s=this._eventRegistry[p];if(s){var c=s.indexOf(d);c!==-1&&s.splice(c,1)}},l.removeAllListeners=function(p){p||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[p]=void 0),this._defaultHandlers&&(this._defaultHandlers[p]=void 0)},t.EventEmitter=l}),ace.define("ace/range",[],function(L,t,n){var l=(function(){function y(a,p,d,s){this.start={row:a,column:p},this.end={row:d,column:s}}return y.prototype.isEqual=function(a){return this.start.row===a.start.row&&this.end.row===a.end.row&&this.start.column===a.start.column&&this.end.column===a.end.column},y.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},y.prototype.contains=function(a,p){return this.compare(a,p)==0},y.prototype.compareRange=function(a){var p,d=a.end,s=a.start;return p=this.compare(d.row,d.column),p==1?(p=this.compare(s.row,s.column),p==1?2:p==0?1:0):p==-1?-2:(p=this.compare(s.row,s.column),p==-1?-1:p==1?42:0)},y.prototype.comparePoint=function(a){return this.compare(a.row,a.column)},y.prototype.containsRange=function(a){return this.comparePoint(a.start)==0&&this.comparePoint(a.end)==0},y.prototype.intersects=function(a){var p=this.compareRange(a);return p==-1||p==0||p==1},y.prototype.isEnd=function(a,p){return this.end.row==a&&this.end.column==p},y.prototype.isStart=function(a,p){return this.start.row==a&&this.start.column==p},y.prototype.setStart=function(a,p){typeof a=="object"?(this.start.column=a.column,this.start.row=a.row):(this.start.row=a,this.start.column=p)},y.prototype.setEnd=function(a,p){typeof a=="object"?(this.end.column=a.column,this.end.row=a.row):(this.end.row=a,this.end.column=p)},y.prototype.inside=function(a,p){return this.compare(a,p)==0?!(this.isEnd(a,p)||this.isStart(a,p)):!1},y.prototype.insideStart=function(a,p){return this.compare(a,p)==0?!this.isEnd(a,p):!1},y.prototype.insideEnd=function(a,p){return this.compare(a,p)==0?!this.isStart(a,p):!1},y.prototype.compare=function(a,p){return!this.isMultiLine()&&a===this.start.row?p<this.start.column?-1:p>this.end.column?1:0:a<this.start.row?-1:a>this.end.row?1:this.start.row===a?p>=this.start.column?0:-1:this.end.row===a?p<=this.end.column?0:1:0},y.prototype.compareStart=function(a,p){return this.start.row==a&&this.start.column==p?-1:this.compare(a,p)},y.prototype.compareEnd=function(a,p){return this.end.row==a&&this.end.column==p?1:this.compare(a,p)},y.prototype.compareInside=function(a,p){return this.end.row==a&&this.end.column==p?1:this.start.row==a&&this.start.column==p?-1:this.compare(a,p)},y.prototype.clipRows=function(a,p){if(this.end.row>p)var d={row:p+1,column:0};else if(this.end.row<a)var d={row:a,column:0};if(this.start.row>p)var s={row:p+1,column:0};else if(this.start.row<a)var s={row:a,column:0};return y.fromPoints(s||this.start,d||this.end)},y.prototype.extend=function(a,p){var d=this.compare(a,p);if(d==0)return this;if(d==-1)var s={row:a,column:p};else var c={row:a,column:p};return y.fromPoints(s||this.start,c||this.end)},y.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},y.prototype.isMultiLine=function(){return this.start.row!==this.end.row},y.prototype.clone=function(){return y.fromPoints(this.start,this.end)},y.prototype.collapseRows=function(){return this.end.column==0?new y(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new y(this.start.row,0,this.end.row,0)},y.prototype.toScreenRange=function(a){var p=a.documentToScreenPosition(this.start),d=a.documentToScreenPosition(this.end);return new y(p.row,p.column,d.row,d.column)},y.prototype.moveBy=function(a,p){this.start.row+=a,this.start.column+=p,this.end.row+=a,this.end.column+=p},y})();l.fromPoints=function(y,a){return new l(y.row,y.column,a.row,a.column)},l.comparePoints=function(y,a){return y.row-a.row||y.column-a.column},t.Range=l}),ace.define("ace/anchor",[],function(L,t,n){function l(s,c,e){var i=e?s.column<=c.column:s.column<c.column;return s.row<c.row||s.row==c.row&&i}function y(s,c,e){var i=s.action=="insert",o=(i?1:-1)*(s.end.row-s.start.row),h=(i?1:-1)*(s.end.column-s.start.column),r=s.start,u=i?r:s.end;return l(c,r,e)?{row:c.row,column:c.column}:l(u,c,!e)?{row:c.row+o,column:c.column+(c.row==u.row?h:0)}:{row:r.row,column:r.column}}var a=L("./lib/oop"),p=L("./lib/event_emitter").EventEmitter,d=(function(){function s(c,e,i){this.$onChange=this.onChange.bind(this),this.attach(c),typeof e!="number"?this.setPosition(e.row,e.column):this.setPosition(e,i)}return s.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},s.prototype.getDocument=function(){return this.document},s.prototype.onChange=function(c){if(!(c.start.row==c.end.row&&c.start.row!=this.row)&&!(c.start.row>this.row)){var e=y(c,{row:this.row,column:this.column},this.$insertRight);this.setPosition(e.row,e.column,!0)}},s.prototype.setPosition=function(c,e,i){var o;if(i?o={row:c,column:e}:o=this.$clipPositionToDocument(c,e),!(this.row==o.row&&this.column==o.column)){var h={row:this.row,column:this.column};this.row=o.row,this.column=o.column,this._signal("change",{old:h,value:o})}},s.prototype.detach=function(){this.document.off("change",this.$onChange)},s.prototype.attach=function(c){this.document=c||this.document,this.document.on("change",this.$onChange)},s.prototype.$clipPositionToDocument=function(c,e){var i={};return c>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):c<0?(i.row=0,i.column=0):(i.row=c,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,e))),e<0&&(i.column=0),i},s})();d.prototype.$insertRight=!1,a.implement(d.prototype,p),t.Anchor=d}),ace.define("ace/document",[],function(L,t,n){var l=L("./lib/oop"),y=L("./apply_delta").applyDelta,a=L("./lib/event_emitter").EventEmitter,p=L("./range").Range,d=L("./anchor").Anchor,s=(function(){function c(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)}return c.prototype.setValue=function(e){var i=this.getLength()-1;this.remove(new p(0,0,i,this.getLine(i).length)),this.insert({row:0,column:0},e||"")},c.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},c.prototype.createAnchor=function(e,i){return new d(this,e,i)},c.prototype.$detectNewLine=function(e){var i=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=i?i[1]:`
|
|
1009
|
-
`,this._signal("changeNewLineMode")},c.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
|
|
1010
|
-
`;case"unix":return`
|
|
1011
|
-
`;default:return this.$autoNewLine||`
|
|
1012
|
-
`}},c.prototype.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},c.prototype.getNewLineMode=function(){return this.$newLineMode},c.prototype.isNewLine=function(e){return e==`\r
|
|
1013
|
-
`||e=="\r"||e==`
|
|
1014
|
-
`},c.prototype.getLine=function(e){return this.$lines[e]||""},c.prototype.getLines=function(e,i){return this.$lines.slice(e,i+1)},c.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},c.prototype.getLength=function(){return this.$lines.length},c.prototype.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},c.prototype.getLinesForRange=function(e){var i;if(e.start.row===e.end.row)i=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{i=this.getLines(e.start.row,e.end.row),i[0]=(i[0]||"").substring(e.start.column);var o=i.length-1;e.end.row-e.start.row==o&&(i[o]=i[o].substring(0,e.end.column))}return i},c.prototype.insertLines=function(e,i){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,i)},c.prototype.removeLines=function(e,i){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,i)},c.prototype.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},c.prototype.insert=function(e,i){return this.getLength()<=1&&this.$detectNewLine(i),this.insertMergedLines(e,this.$split(i))},c.prototype.insertInLine=function(e,i){var o=this.clippedPos(e.row,e.column),h=this.pos(e.row,e.column+i.length);return this.applyDelta({start:o,end:h,action:"insert",lines:[i]},!0),this.clonePos(h)},c.prototype.clippedPos=function(e,i){var o=this.getLength();e===void 0?e=o:e<0?e=0:e>=o&&(e=o-1,i=void 0);var h=this.getLine(e);return i==null&&(i=h.length),i=Math.min(Math.max(i,0),h.length),{row:e,column:i}},c.prototype.clonePos=function(e){return{row:e.row,column:e.column}},c.prototype.pos=function(e,i){return{row:e,column:i}},c.prototype.$clipPosition=function(e){var i=this.getLength();return e.row>=i?(e.row=Math.max(0,i-1),e.column=this.getLine(i-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},c.prototype.insertFullLines=function(e,i){e=Math.min(Math.max(e,0),this.getLength());var o=0;e<this.getLength()?(i=i.concat([""]),o=0):(i=[""].concat(i),e--,o=this.$lines[e].length),this.insertMergedLines({row:e,column:o},i)},c.prototype.insertMergedLines=function(e,i){var o=this.clippedPos(e.row,e.column),h={row:o.row+i.length-1,column:(i.length==1?o.column:0)+i[i.length-1].length};return this.applyDelta({start:o,end:h,action:"insert",lines:i}),this.clonePos(h)},c.prototype.remove=function(e){var i=this.clippedPos(e.start.row,e.start.column),o=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:i,end:o,action:"remove",lines:this.getLinesForRange({start:i,end:o})}),this.clonePos(i)},c.prototype.removeInLine=function(e,i,o){var h=this.clippedPos(e,i),r=this.clippedPos(e,o);return this.applyDelta({start:h,end:r,action:"remove",lines:this.getLinesForRange({start:h,end:r})},!0),this.clonePos(h)},c.prototype.removeFullLines=function(e,i){e=Math.min(Math.max(0,e),this.getLength()-1),i=Math.min(Math.max(0,i),this.getLength()-1);var o=i==this.getLength()-1&&e>0,h=i<this.getLength()-1,r=o?e-1:e,u=o?this.getLine(r).length:0,f=h?i+1:i,g=h?0:this.getLine(f).length,v=new p(r,u,f,g),A=this.$lines.slice(e,i+1);return this.applyDelta({start:v.start,end:v.end,action:"remove",lines:this.getLinesForRange(v)}),A},c.prototype.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},c.prototype.replace=function(e,i){if(e instanceof p||(e=p.fromPoints(e.start,e.end)),i.length===0&&e.isEmpty())return e.start;if(i==this.getTextRange(e))return e.end;this.remove(e);var o;return i?o=this.insert(e.start,i):o=e.start,o},c.prototype.applyDeltas=function(e){for(var i=0;i<e.length;i++)this.applyDelta(e[i])},c.prototype.revertDeltas=function(e){for(var i=e.length-1;i>=0;i--)this.revertDelta(e[i])},c.prototype.applyDelta=function(e,i){var o=e.action=="insert";(o?e.lines.length<=1&&!e.lines[0]:!p.comparePoints(e.start,e.end))||(o&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(y(this.$lines,e,i),this._signal("change",e)))},c.prototype.$safeApplyDelta=function(e){var i=this.$lines.length;(e.action=="remove"&&e.start.row<i&&e.end.row<i||e.action=="insert"&&e.start.row<=i)&&this.applyDelta(e)},c.prototype.$splitAndapplyLargeDelta=function(e,i){for(var o=e.lines,h=o.length-i+1,r=e.start.row,u=e.start.column,f=0,g=0;f<h;f=g){g+=i-1;var v=o.slice(f,g);v.push(""),this.applyDelta({start:this.pos(r+f,u),end:this.pos(r+g,u=0),action:e.action,lines:v},!0)}e.lines=o.slice(f),e.start.row=r+f,e.start.column=u,this.applyDelta(e,!0)},c.prototype.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:e.action=="insert"?"remove":"insert",lines:e.lines.slice()})},c.prototype.indexToPosition=function(e,i){for(var o=this.$lines||this.getAllLines(),h=this.getNewLineCharacter().length,r=i||0,u=o.length;r<u;r++)if(e-=o[r].length+h,e<0)return{row:r,column:e+o[r].length+h};return{row:u-1,column:e+o[u-1].length+h}},c.prototype.positionToIndex=function(e,i){for(var o=this.$lines||this.getAllLines(),h=this.getNewLineCharacter().length,r=0,u=Math.min(e.row,o.length),f=i||0;f<u;++f)r+=o[f].length+h;return r+e.column},c.prototype.$split=function(e){return e.split(/\r\n|\r|\n/)},c})();s.prototype.$autoNewLine="",s.prototype.$newLineMode="auto",l.implement(s.prototype,a),t.Document=s}),ace.define("ace/lib/deep_copy",[],function(L,t,n){t.deepCopy=function l(y){if(typeof y!="object"||!y)return y;var a;if(Array.isArray(y)){a=[];for(var p=0;p<y.length;p++)a[p]=l(y[p]);return a}if(Object.prototype.toString.call(y)!=="[object Object]")return y;a={};for(var p in y)a[p]=l(y[p]);return a}}),ace.define("ace/lib/lang",[],function(L,t,n){t.last=function(a){return a[a.length-1]},t.stringReverse=function(a){return a.split("").reverse().join("")},t.stringRepeat=function(a,p){for(var d="";p>0;)p&1&&(d+=a),(p>>=1)&&(a+=a);return d};var l=/^\s\s*/,y=/\s\s*$/;t.stringTrimLeft=function(a){return a.replace(l,"")},t.stringTrimRight=function(a){return a.replace(y,"")},t.copyObject=function(a){var p={};for(var d in a)p[d]=a[d];return p},t.copyArray=function(a){for(var p=[],d=0,s=a.length;d<s;d++)a[d]&&typeof a[d]=="object"?p[d]=this.copyObject(a[d]):p[d]=a[d];return p},t.deepCopy=L("./deep_copy").deepCopy,t.arrayToMap=function(a){for(var p={},d=0;d<a.length;d++)p[a[d]]=1;return p},t.createMap=function(a){var p=Object.create(null);for(var d in a)p[d]=a[d];return p},t.arrayRemove=function(a,p){for(var d=0;d<=a.length;d++)p===a[d]&&a.splice(d,1)},t.escapeRegExp=function(a){return a.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(a){return(""+a).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},t.getMatchOffsets=function(a,p){var d=[];return a.replace(p,function(s){d.push({offset:arguments[arguments.length-2],length:s.length})}),d},t.deferredCall=function(a){var p=null,d=function(){p=null,a()},s=function(c){return s.cancel(),p=setTimeout(d,c||0),s};return s.schedule=s,s.call=function(){return this.cancel(),a(),s},s.cancel=function(){return clearTimeout(p),p=null,s},s.isPending=function(){return p},s},t.delayedCall=function(a,p){var d=null,s=function(){d=null,a()},c=function(e){d==null&&(d=setTimeout(s,e||p))};return c.delay=function(e){d&&clearTimeout(d),d=setTimeout(s,e||p)},c.schedule=c,c.call=function(){this.cancel(),a()},c.cancel=function(){d&&clearTimeout(d),d=null},c.isPending=function(){return d},c},t.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},t.skipEmptyMatch=function(a,p,d){return d&&a.codePointAt(p)>65535?2:1}}),ace.define("ace/worker/mirror",[],function(L,t,n){var l=L("../document").Document,y=L("../lib/lang"),a=t.Mirror=function(p){this.sender=p;var d=this.doc=new l(""),s=this.deferredUpdate=y.delayedCall(this.onUpdate.bind(this)),c=this;p.on("change",function(e){var i=e.data;if(i[0].start)d.applyDeltas(i);else for(var o=0;o<i.length;o+=2){var h,r;if(Array.isArray(i[o+1])?h={action:"insert",start:i[o],lines:i[o+1]}:h={action:"remove",start:i[o],end:i[o+1]},(h.action=="insert"?h.start:h.end).row>=d.$lines.length)throw r=new Error("Invalid delta"),r.data={path:c.$path,linesLength:d.$lines.length,start:h.start,end:h.end},r;d.applyDelta(h,!0)}if(c.$timeout)return s.schedule(c.$timeout);c.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(p){this.$timeout=p},this.setValue=function(p){this.doc.setValue(p),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(p){this.sender.callback(this.doc.getValue(),p)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(a.prototype)}),ace.define("ace/mode/json/json_parse",[],function(L,t,n){var l,y,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
1015
|
-
`,r:"\r",t:" "},p,d=function(f){throw{name:"SyntaxError",message:f,at:l,text:p}},s=function(f){return f&&f!==y&&d("Expected '"+f+"' instead of '"+y+"'"),y=p.charAt(l),l+=1,y},c=function(){var f,g="";for(y==="-"&&(g="-",s("-"));y>="0"&&y<="9";)g+=y,s();if(y===".")for(g+=".";s()&&y>="0"&&y<="9";)g+=y;if(y==="e"||y==="E")for(g+=y,s(),(y==="-"||y==="+")&&(g+=y,s());y>="0"&&y<="9";)g+=y,s();if(f=+g,!isNaN(f))return f;d("Bad number")},e=function(){var f,g,v="",A;if(y==='"')for(;s();){if(y==='"')return s(),v;if(y==="\\")if(s(),y==="u"){for(A=0,g=0;g<4&&(f=parseInt(s(),16),!!isFinite(f));g+=1)A=A*16+f;v+=String.fromCharCode(A)}else{if(typeof a[y]!="string")break;v+=a[y]}else{if(y==`
|
|
1016
|
-
`||y=="\r")break;v+=y}}d("Bad string")},i=function(){for(;y&&y<=" ";)s()},o=function(){switch(y){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null}d("Unexpected '"+y+"'")},h,r=function(){var f=[];if(y==="["){if(s("["),i(),y==="]")return s("]"),f;for(;y;){if(f.push(h()),i(),y==="]")return s("]"),f;s(","),i()}}d("Bad array")},u=function(){var f,g={};if(y==="{"){if(s("{"),i(),y==="}")return s("}"),g;for(;y;){if(f=e(),i(),s(":"),Object.hasOwnProperty.call(g,f)&&d('Duplicate key "'+f+'"'),g[f]=h(),i(),y==="}")return s("}"),g;s(","),i()}}d("Bad object")};return h=function(){switch(i(),y){case"{":return u();case"[":return r();case'"':return e();case"-":return c();default:return y>="0"&&y<="9"?c():o()}},function(f,g){var v;return p=f,l=0,y=" ",v=h(),i(),y&&d("Syntax error"),typeof g=="function"?(function A(E,w){var m,S,k=E[w];if(k&&typeof k=="object")for(m in k)Object.hasOwnProperty.call(k,m)&&(S=A(k,m),S!==void 0?k[m]=S:delete k[m]);return g.call(E,w,k)})({"":v},""):v}}),ace.define("ace/mode/json_worker",[],function(L,t,n){var l=L("../lib/oop"),y=L("../worker/mirror").Mirror,a=L("./json/json_parse"),p=t.JsonWorker=function(d){y.call(this,d),this.setTimeout(200)};l.inherits(p,y),function(){this.onUpdate=function(){var d=this.doc.getValue(),s=[];try{d&&a(d)}catch(e){var c=this.doc.indexToPosition(e.at-1);s.push({row:c.row,column:c.column,text:e.message,type:"error"})}this.sender.emit("annotate",s)}}.call(p.prototype)});var Ia={exports:{}};(function(L,t){ace.define("ace/theme/clouds_midnight-css",["require","exports","module"],function(n,l,y){y.exports=`.ace-clouds-midnight .ace_gutter {
|
|
1017
|
-
background: #232323;
|
|
1018
|
-
color: #929292
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
.ace-clouds-midnight .ace_print-margin {
|
|
1022
|
-
width: 1px;
|
|
1023
|
-
background: #232323
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
.ace-clouds-midnight {
|
|
1027
|
-
background-color: #191919;
|
|
1028
|
-
color: #929292
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
.ace-clouds-midnight .ace_cursor {
|
|
1032
|
-
color: #7DA5DC
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
.ace-clouds-midnight .ace_marker-layer .ace_selection {
|
|
1036
|
-
background: #000000
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
.ace-clouds-midnight.ace_multiselect .ace_selection.ace_start {
|
|
1040
|
-
box-shadow: 0 0 3px 0px #191919;
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
.ace-clouds-midnight .ace_marker-layer .ace_step {
|
|
1044
|
-
background: rgb(102, 82, 0)
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
.ace-clouds-midnight .ace_marker-layer .ace_bracket {
|
|
1048
|
-
margin: -1px 0 0 -1px;
|
|
1049
|
-
border: 1px solid #BFBFBF
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
.ace-clouds-midnight .ace_marker-layer .ace_active-line {
|
|
1053
|
-
background: rgba(215, 215, 215, 0.031)
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
.ace-clouds-midnight .ace_gutter-active-line {
|
|
1057
|
-
background-color: rgba(215, 215, 215, 0.031)
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
.ace-clouds-midnight .ace_marker-layer .ace_selected-word {
|
|
1061
|
-
border: 1px solid #000000
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
.ace-clouds-midnight .ace_invisible {
|
|
1065
|
-
color: #666
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
.ace-clouds-midnight .ace_keyword,
|
|
1069
|
-
.ace-clouds-midnight .ace_meta,
|
|
1070
|
-
.ace-clouds-midnight .ace_support.ace_constant.ace_property-value {
|
|
1071
|
-
color: #927C5D
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
.ace-clouds-midnight .ace_keyword.ace_operator {
|
|
1075
|
-
color: #4B4B4B
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
.ace-clouds-midnight .ace_keyword.ace_other.ace_unit {
|
|
1079
|
-
color: #366F1A
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
.ace-clouds-midnight .ace_constant.ace_language {
|
|
1083
|
-
color: #39946A
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
.ace-clouds-midnight .ace_constant.ace_numeric {
|
|
1087
|
-
color: #46A609
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
.ace-clouds-midnight .ace_constant.ace_character.ace_entity {
|
|
1091
|
-
color: #A165AC
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
|
-
.ace-clouds-midnight .ace_invalid {
|
|
1095
|
-
color: #FFFFFF;
|
|
1096
|
-
background-color: #E92E2E
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
.ace-clouds-midnight .ace_fold {
|
|
1100
|
-
background-color: #927C5D;
|
|
1101
|
-
border-color: #929292
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
.ace-clouds-midnight .ace_storage,
|
|
1105
|
-
.ace-clouds-midnight .ace_support.ace_class,
|
|
1106
|
-
.ace-clouds-midnight .ace_support.ace_function,
|
|
1107
|
-
.ace-clouds-midnight .ace_support.ace_other,
|
|
1108
|
-
.ace-clouds-midnight .ace_support.ace_type {
|
|
1109
|
-
color: #E92E2E
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
.ace-clouds-midnight .ace_string {
|
|
1113
|
-
color: #5D90CD
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
.ace-clouds-midnight .ace_comment {
|
|
1117
|
-
color: #3C403B
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
.ace-clouds-midnight .ace_entity.ace_name.ace_tag,
|
|
1121
|
-
.ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {
|
|
1122
|
-
color: #606060
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
|
-
.ace-clouds-midnight .ace_indent-guide {
|
|
1126
|
-
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
.ace-clouds-midnight .ace_indent-guide-active {
|
|
1130
|
-
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;
|
|
1131
|
-
}
|
|
1132
|
-
`}),ace.define("ace/theme/clouds_midnight",["require","exports","module","ace/theme/clouds_midnight-css","ace/lib/dom"],function(n,l,y){l.isDark=!0,l.cssClass="ace-clouds-midnight",l.cssText=n("./clouds_midnight-css");var a=n("../lib/dom");a.importCssString(l.cssText,l.cssClass,!1)}),(function(){ace.require(["ace/theme/clouds_midnight"],function(n){L&&(L.exports=n)})})()})(Ia);var Fa={exports:{}};(function(L,t){ace.define("ace/theme/chrome-css",["require","exports","module"],function(n,l,y){y.exports=`.ace-chrome .ace_gutter {
|
|
1133
|
-
background: #ebebeb;
|
|
1134
|
-
color: #333;
|
|
1135
|
-
overflow : hidden;
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
.ace-chrome .ace_print-margin {
|
|
1139
|
-
width: 1px;
|
|
1140
|
-
background: #e8e8e8;
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
.ace-chrome {
|
|
1144
|
-
background-color: #FFFFFF;
|
|
1145
|
-
color: black;
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
|
-
.ace-chrome .ace_cursor {
|
|
1149
|
-
color: black;
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
.ace-chrome .ace_invisible {
|
|
1153
|
-
color: rgb(191, 191, 191);
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
.ace-chrome .ace_constant.ace_buildin {
|
|
1157
|
-
color: rgb(88, 72, 246);
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
.ace-chrome .ace_constant.ace_language {
|
|
1161
|
-
color: rgb(88, 92, 246);
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
.ace-chrome .ace_constant.ace_library {
|
|
1165
|
-
color: rgb(6, 150, 14);
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
.ace-chrome .ace_invalid {
|
|
1169
|
-
background-color: rgb(153, 0, 0);
|
|
1170
|
-
color: white;
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
.ace-chrome .ace_fold {
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
.ace-chrome .ace_support.ace_function {
|
|
1177
|
-
color: rgb(60, 76, 114);
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
.ace-chrome .ace_support.ace_constant {
|
|
1181
|
-
color: rgb(6, 150, 14);
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
.ace-chrome .ace_support.ace_type,
|
|
1185
|
-
.ace-chrome .ace_support.ace_class
|
|
1186
|
-
.ace-chrome .ace_support.ace_other {
|
|
1187
|
-
color: rgb(109, 121, 222);
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
|
-
.ace-chrome .ace_variable.ace_parameter {
|
|
1191
|
-
font-style:italic;
|
|
1192
|
-
color:#FD971F;
|
|
1193
|
-
}
|
|
1194
|
-
.ace-chrome .ace_keyword.ace_operator {
|
|
1195
|
-
color: rgb(104, 118, 135);
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
.ace-chrome .ace_comment {
|
|
1199
|
-
color: #236e24;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
.ace-chrome .ace_comment.ace_doc {
|
|
1203
|
-
color: #236e24;
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
.ace-chrome .ace_comment.ace_doc.ace_tag {
|
|
1207
|
-
color: #236e24;
|
|
1208
|
-
}
|
|
1209
|
-
|
|
1210
|
-
.ace-chrome .ace_constant.ace_numeric {
|
|
1211
|
-
color: rgb(0, 0, 205);
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
.ace-chrome .ace_variable {
|
|
1215
|
-
color: rgb(49, 132, 149);
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
.ace-chrome .ace_xml-pe {
|
|
1219
|
-
color: rgb(104, 104, 91);
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
.ace-chrome .ace_entity.ace_name.ace_function {
|
|
1223
|
-
color: #0000A2;
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
.ace-chrome .ace_heading {
|
|
1228
|
-
color: rgb(12, 7, 255);
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
.ace-chrome .ace_list {
|
|
1232
|
-
color:rgb(185, 6, 144);
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
.ace-chrome .ace_marker-layer .ace_selection {
|
|
1236
|
-
background: rgb(181, 213, 255);
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
.ace-chrome .ace_marker-layer .ace_step {
|
|
1240
|
-
background: rgb(252, 255, 0);
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
.ace-chrome .ace_marker-layer .ace_stack {
|
|
1244
|
-
background: rgb(164, 229, 101);
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
.ace-chrome .ace_marker-layer .ace_bracket {
|
|
1248
|
-
margin: -1px 0 0 -1px;
|
|
1249
|
-
border: 1px solid rgb(192, 192, 192);
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
|
-
.ace-chrome .ace_marker-layer .ace_active-line {
|
|
1253
|
-
background: rgba(0, 0, 0, 0.07);
|
|
1254
|
-
}
|
|
1255
|
-
|
|
1256
|
-
.ace-chrome .ace_gutter-active-line {
|
|
1257
|
-
background-color : #dcdcdc;
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
.ace-chrome .ace_marker-layer .ace_selected-word {
|
|
1261
|
-
background: rgb(250, 250, 255);
|
|
1262
|
-
border: 1px solid rgb(200, 200, 250);
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
.ace-chrome .ace_storage,
|
|
1266
|
-
.ace-chrome .ace_keyword,
|
|
1267
|
-
.ace-chrome .ace_meta.ace_tag {
|
|
1268
|
-
color: rgb(147, 15, 128);
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
.ace-chrome .ace_string.ace_regex {
|
|
1272
|
-
color: rgb(255, 0, 0)
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
.ace-chrome .ace_string {
|
|
1276
|
-
color: #1A1AA6;
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
.ace-chrome .ace_entity.ace_other.ace_attribute-name {
|
|
1280
|
-
color: #994409;
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
.ace-chrome .ace_indent-guide {
|
|
1284
|
-
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
.ace-chrome .ace_indent-guide-active {
|
|
1288
|
-
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
|
|
1289
|
-
}
|
|
1290
|
-
`}),ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(n,l,y){l.isDark=!1,l.cssClass="ace-chrome",l.cssText=n("./chrome-css");var a=n("../lib/dom");a.importCssString(l.cssText,l.cssClass,!1)}),(function(){ace.require(["ace/theme/chrome"],function(n){L&&(L.exports=n)})})()})(Fa);var Ra={exports:{}};(function(L,t){ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],function(n,l,y){function a(m){var S=new Date().toLocaleString("en-us",m);return S.length==1?"0"+S:S}var p=n("./lib/dom"),d=n("./lib/oop"),s=n("./lib/event_emitter").EventEmitter,c=n("./lib/lang"),e=n("./range").Range,i=n("./range_list").RangeList,o=n("./keyboard/hash_handler").HashHandler,h=n("./tokenizer").Tokenizer,r=n("./clipboard"),u={CURRENT_WORD:function(m){return m.session.getTextRange(m.session.getWordRange())},SELECTION:function(m,S,k){var D=m.session.getTextRange();return k?D.replace(/\n\r?([ \t]*\S)/g,`
|
|
1291
|
-
`+k+"$1"):D},CURRENT_LINE:function(m){return m.session.getLine(m.getCursorPosition().row)},PREV_LINE:function(m){return m.session.getLine(m.getCursorPosition().row-1)},LINE_INDEX:function(m){return m.getCursorPosition().row},LINE_NUMBER:function(m){return m.getCursorPosition().row+1},SOFT_TABS:function(m){return m.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(m){return m.session.getTabSize()},CLIPBOARD:function(m){return r.getText&&r.getText()},FILENAME:function(m){return/[^/\\]*$/.exec(this.FILEPATH(m))[0]},FILENAME_BASE:function(m){return/[^/\\]*$/.exec(this.FILEPATH(m))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(m){return this.FILEPATH(m).replace(/[^/\\]*$/,"")},FILEPATH:function(m){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(m){var S=m.session.$mode||{};return S.blockComment&&S.blockComment.start||""},BLOCK_COMMENT_END:function(m){var S=m.session.$mode||{};return S.blockComment&&S.blockComment.end||""},LINE_COMMENT:function(m){var S=m.session.$mode||{};return S.lineCommentStart||""},CURRENT_YEAR:a.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:a.bind(null,{year:"2-digit"}),CURRENT_MONTH:a.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:a.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:a.bind(null,{month:"short"}),CURRENT_DATE:a.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:a.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:a.bind(null,{weekday:"short"}),CURRENT_HOUR:a.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:a.bind(null,{minute:"2-digit"}),CURRENT_SECOND:a.bind(null,{second:"2-digit"})};u.SELECTED_TEXT=u.SELECTION;var f=(function(){function m(){this.snippetMap={},this.snippetNameMap={},this.variables=u}return m.prototype.getTokenizer=function(){return m.$tokenizer||this.createTokenizer()},m.prototype.createTokenizer=function(){function S(_){return _=_.substr(1),/^\d+$/.test(_)?[{tabstopId:parseInt(_,10)}]:[{text:_}]}function k(_){return"(?:[^\\\\"+_+"]|\\\\.)"}var D={regex:"/("+k("/")+"+)/",onMatch:function(_,F,x){var $=x[0];return $.fmtString=!0,$.guard=_.slice(1,-1),$.flag="",""},next:"formatString"};return m.$tokenizer=new h({start:[{regex:/\\./,onMatch:function(_,F,x){var $=_[1];return($=="}"&&x.length||"`$\\".indexOf($)!=-1)&&(_=$),[_]}},{regex:/}/,onMatch:function(_,F,x){return[x.length?x.shift():_]}},{regex:/\$(?:\d+|\w+)/,onMatch:S},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(_,F,x){var $=S(_.substr(1));return x.unshift($[0]),$},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+k("\\|")+"*\\|",onMatch:function(_,F,x){var $=_.slice(1,-1).replace(/\\[,|\\]|,/g,function(C){return C.length==2?C[1]:"\0"}).split("\0").map(function(C){return{value:C}});return x[0].choices=$,[$[0]]},next:"start"},D,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(_,F,x){return x.length&&x[0].expectElse?(x[0].expectElse=!1,x[0].ifEnd={elseEnd:x[0]},[x[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(_,F,x){var $=_[1];return $=="}"&&x.length||"`$\\".indexOf($)!=-1?_=$:$=="n"?_=`
|
|
1292
|
-
`:$=="t"?_=" ":"ulULE".indexOf($)!=-1&&(_={changeCase:$,local:$>"a"}),[_]}},{regex:"/\\w*}",onMatch:function(_,F,x){var $=x.shift();return $&&($.flag=_.slice(1,-1)),this.next=$&&$.tabstopId?"start":"",[$||_]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(_,F,x){return[{text:_.slice(1)}]}},{regex:/\${\w+/,onMatch:function(_,F,x){var $={text:_.slice(2)};return x.unshift($),[$]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(_,F,x){var $=x.shift();return this.next=$&&$.tabstopId?"start":"",[$||_]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(_,F,x){var $=x[0];return $.formatFunction=_.slice(2,-1),[x.shift()]},next:"formatString"},D,{regex:/:[\?\-+]?/,onMatch:function(_,F,x){_[1]=="+"&&(x[0].ifEnd=x[0]),_[1]=="?"&&(x[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),m.$tokenizer},m.prototype.tokenizeTmSnippet=function(S,k){return this.getTokenizer().getLineTokens(S,k).tokens.map(function(D){return D.value||D})},m.prototype.getVariableValue=function(S,k,D){if(/^\d+$/.test(k))return(this.variables.__||{})[k]||"";if(/^[A-Z]\d+$/.test(k))return(this.variables[k[0]+"__"]||{})[k.substr(1)]||"";if(k=k.replace(/^TM_/,""),!this.variables.hasOwnProperty(k))return"";var _=this.variables[k];return typeof _=="function"&&(_=this.variables[k](S,k,D)),_??""},m.prototype.tmStrFormat=function(S,k,D){if(!k.fmt)return S;var _=k.flag||"",F=k.guard;F=new RegExp(F,_.replace(/[^gim]/g,""));var x=typeof k.fmt=="string"?this.tokenizeTmSnippet(k.fmt,"formatString"):k.fmt,$=this,C=S.replace(F,function(){var b=$.variables.__;$.variables.__=[].slice.call(arguments);for(var T=$.resolveVariables(x,D),I="E",R=0;R<T.length;R++){var N=T[R];if(typeof N=="object")if(T[R]="",N.changeCase&&N.local){var P=T[R+1];P&&typeof P=="string"&&(N.changeCase=="u"?T[R]=P[0].toUpperCase():T[R]=P[0].toLowerCase(),T[R+1]=P.substr(1))}else N.changeCase&&(I=N.changeCase);else I=="U"?T[R]=N.toUpperCase():I=="L"&&(T[R]=N.toLowerCase())}return $.variables.__=b,T.join("")});return C},m.prototype.tmFormatFunction=function(S,k,D){return k.formatFunction=="upcase"?S.toUpperCase():k.formatFunction=="downcase"?S.toLowerCase():S},m.prototype.resolveVariables=function(S,k){function D(I){var R=S.indexOf(I,$+1);R!=-1&&($=R)}for(var _=[],F="",x=!0,$=0;$<S.length;$++){var C=S[$];if(typeof C=="string"){_.push(C),C==`
|
|
1293
|
-
`?(x=!0,F=""):x&&(F=/^\t*/.exec(C)[0],x=/\S/.test(C));continue}if(C){if(x=!1,C.fmtString){var b=S.indexOf(C,$+1);b==-1&&(b=S.length),C.fmt=S.slice($+1,b),$=b}if(C.text){var T=this.getVariableValue(k,C.text,F)+"";C.fmtString&&(T=this.tmStrFormat(T,C,k)),C.formatFunction&&(T=this.tmFormatFunction(T,C,k)),T&&!C.ifEnd?(_.push(T),D(C)):!T&&C.ifEnd&&D(C.ifEnd)}else C.elseEnd?D(C.elseEnd):(C.tabstopId!=null||C.changeCase!=null)&&_.push(C)}}return _},m.prototype.getDisplayTextForSnippet=function(S,k){var D=g.call(this,S,k);return D.text},m.prototype.insertSnippetForSelection=function(S,k,D){D===void 0&&(D={});var _=g.call(this,S,k,D),F=S.getSelectionRange(),x=S.session.replace(F,_.text),$=new v(S),C=S.inVirtualSelectionMode&&S.selection.index;$.addTabstops(_.tabstops,F.start,x,C)},m.prototype.insertSnippet=function(S,k,D){D===void 0&&(D={});var _=this;if(S.inVirtualSelectionMode)return _.insertSnippetForSelection(S,k,D);S.forEachSelection(function(){_.insertSnippetForSelection(S,k,D)},null,{keepOrder:!0}),S.tabstopManager&&S.tabstopManager.tabNext()},m.prototype.$getScope=function(S){var k=S.session.$mode.$id||"";if(k=k.split("/").pop(),k==="html"||k==="php"){k==="php"&&!S.session.$mode.inlinePhp&&(k="html");var D=S.getCursorPosition(),_=S.session.getState(D.row);typeof _=="object"&&(_=_[0]),_.substring&&(_.substring(0,3)=="js-"?k="javascript":_.substring(0,4)=="css-"?k="css":_.substring(0,4)=="php-"&&(k="php"))}return k},m.prototype.getActiveScopes=function(S){var k=this.$getScope(S),D=[k],_=this.snippetMap;return _[k]&&_[k].includeScopes&&D.push.apply(D,_[k].includeScopes),D.push("_"),D},m.prototype.expandWithTab=function(S,k){var D=this,_=S.forEachSelection(function(){return D.expandSnippetForSelection(S,k)},null,{keepOrder:!0});return _&&S.tabstopManager&&S.tabstopManager.tabNext(),_},m.prototype.expandSnippetForSelection=function(S,k){var D=S.getCursorPosition(),_=S.session.getLine(D.row),F=_.substring(0,D.column),x=_.substr(D.column),$=this.snippetMap,C;return this.getActiveScopes(S).some(function(b){var T=$[b];return T&&(C=this.findMatchingSnippet(T,F,x)),!!C},this),C?(k&&k.dryRun||(S.session.doc.removeInLine(D.row,D.column-C.replaceBefore.length,D.column+C.replaceAfter.length),this.variables.M__=C.matchBefore,this.variables.T__=C.matchAfter,this.insertSnippetForSelection(S,C.content),this.variables.M__=this.variables.T__=null),!0):!1},m.prototype.findMatchingSnippet=function(S,k,D){for(var _=S.length;_--;){var F=S[_];if(!(F.startRe&&!F.startRe.test(k))&&!(F.endRe&&!F.endRe.test(D))&&!(!F.startRe&&!F.endRe))return F.matchBefore=F.startRe?F.startRe.exec(k):[""],F.matchAfter=F.endRe?F.endRe.exec(D):[""],F.replaceBefore=F.triggerRe?F.triggerRe.exec(k)[0]:"",F.replaceAfter=F.endTriggerRe?F.endTriggerRe.exec(D)[0]:"",F}},m.prototype.register=function(S,k){function D(b){return b&&!/^\^?\(.*\)\$?$|^\\b$/.test(b)&&(b="(?:"+b+")"),b||""}function _(b,T,I){return b=D(b),T=D(T),b=T+b,b&&b[b.length-1]!="$"&&(b+="$"),new RegExp(b)}function F(b){b.scope||(b.scope=k||"_"),k=b.scope,x[k]||(x[k]=[],$[k]={});var T=$[k];if(b.name){var I=T[b.name];I&&C.unregister(I),T[b.name]=b}x[k].push(b),b.prefix&&(b.tabTrigger=b.prefix),!b.content&&b.body&&(b.content=Array.isArray(b.body)?b.body.join(`
|
|
1294
|
-
`):b.body),b.tabTrigger&&!b.trigger&&(!b.guard&&/^\w/.test(b.tabTrigger)&&(b.guard="\\b"),b.trigger=c.escapeRegExp(b.tabTrigger)),!(!b.trigger&&!b.guard&&!b.endTrigger&&!b.endGuard)&&(b.startRe=_(b.trigger,b.guard),b.triggerRe=new RegExp(b.trigger),b.endRe=_(b.endTrigger,b.endGuard),b.endTriggerRe=new RegExp(b.endTrigger))}var x=this.snippetMap,$=this.snippetNameMap,C=this;S||(S=[]),Array.isArray(S)?S.forEach(F):Object.keys(S).forEach(function(b){F(S[b])}),this._signal("registerSnippets",{scope:k})},m.prototype.unregister=function(S,k){function D(x){var $=F[x.scope||k];if($&&$[x.name]){delete $[x.name];var C=_[x.scope||k],b=C&&C.indexOf(x);b>=0&&C.splice(b,1)}}var _=this.snippetMap,F=this.snippetNameMap;S.content?D(S):Array.isArray(S)&&S.forEach(D)},m.prototype.parseSnippetFile=function(S){S=S.replace(/\r/g,"");for(var k=[],D={},_=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,F;F=_.exec(S);){if(F[1])try{D=JSON.parse(F[1]),k.push(D)}catch{}if(F[4])D.content=F[4].replace(/^\t/gm,""),k.push(D),D={};else{var x=F[2],$=F[3];if(x=="regex"){var C=/\/((?:[^\/\\]|\\.)*)|$/g;D.guard=C.exec($)[1],D.trigger=C.exec($)[1],D.endTrigger=C.exec($)[1],D.endGuard=C.exec($)[1]}else x=="snippet"?(D.tabTrigger=$.match(/^\S*/)[0],D.name||(D.name=$)):x&&(D[x]=$)}}return k},m.prototype.getSnippetByName=function(S,k){var D=this.snippetNameMap,_;return this.getActiveScopes(k).some(function(F){var x=D[F];return x&&(_=x[S]),!!_},this),_},m})();d.implement(f.prototype,s);var g=function(m,S,k){function D(G){for(var Y=[],Q=0;Q<G.length;Q++){var q=G[Q];if(typeof q=="object"){if(T[q.tabstopId])continue;var te=G.lastIndexOf(q,Q-1);q=Y[te]||{tabstopId:q.tabstopId}}Y[Q]=q}return Y}k===void 0&&(k={});var _=m.getCursorPosition(),F=m.session.getLine(_.row),x=m.session.getTabString(),$=F.match(/^\s*/)[0];_.column<$.length&&($=$.slice(0,_.column)),S=S.replace(/\r/g,"");var C=this.tokenizeTmSnippet(S);C=this.resolveVariables(C,m),C=C.map(function(G){return G==`
|
|
1295
|
-
`&&!k.excludeExtraIndent?G+$:typeof G=="string"?G.replace(/\t/g,x):G});var b=[];C.forEach(function(G,Y){if(typeof G=="object"){var Q=G.tabstopId,q=b[Q];if(q||(q=b[Q]=[],q.index=Q,q.value="",q.parents={}),q.indexOf(G)===-1){G.choices&&!q.choices&&(q.choices=G.choices),q.push(G);var te=C.indexOf(G,Y+1);if(te!==-1){var re=C.slice(Y+1,te),ue=re.some(function(me){return typeof me=="object"});ue&&!q.value?q.value=re:re.length&&(!q.value||typeof q.value!="string")&&(q.value=re.join(""))}}}}),b.forEach(function(G){G.length=0});for(var T={},I=0;I<C.length;I++){var R=C[I];if(typeof R=="object"){var N=R.tabstopId,P=b[N],B=C.indexOf(R,I+1);if(T[N]){T[N]===R&&(delete T[N],Object.keys(T).forEach(function(G){P.parents[G]=!0}));continue}T[N]=R;var V=P.value;typeof V!="string"?V=D(V):R.fmt&&(V=this.tmStrFormat(V,R,m)),C.splice.apply(C,[I+1,Math.max(0,B-I)].concat(V,R)),P.indexOf(R)===-1&&P.push(R)}}var W=0,z=0,U="";return C.forEach(function(G){if(typeof G=="string"){var Y=G.split(`
|
|
1296
|
-
`);Y.length>1?(z=Y[Y.length-1].length,W+=Y.length-1):z+=G.length,U+=G}else G&&(G.start?G.end={row:W,column:z}:G.start={row:W,column:z})}),{text:U,tabstops:b,tokens:C}},v=(function(){function m(S){if(this.index=0,this.ranges=[],this.tabstops=[],S.tabstopManager)return S.tabstopManager;S.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=c.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(S)}return m.prototype.attach=function(S){this.$openTabstops=null,this.selectedTabstop=null,this.editor=S,this.session=S.session,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},m.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},m.prototype.onChange=function(S){for(var k=S.action[0]=="r",D=this.selectedTabstop||{},_=D.parents||{},F=this.tabstops.slice(),x=0;x<F.length;x++){var $=F[x],C=$==D||_[$.index];if($.rangeList.$bias=C?0:1,S.action=="remove"&&$!==D){var b=$.parents&&$.parents[D.index],T=$.rangeList.pointIndex(S.start,b);T=T<0?-T-1:T+1;var I=$.rangeList.pointIndex(S.end,b);I=I<0?-I-1:I-1;for(var R=$.rangeList.ranges.slice(T,I),N=0;N<R.length;N++)this.removeRange(R[N])}$.rangeList.$onChange(S)}var P=this.session;!this.$inChange&&k&&P.getLength()==1&&!P.getValue()&&this.detach()},m.prototype.updateLinkedFields=function(){var S=this.selectedTabstop;if(!(!S||!S.hasLinkedRanges||!S.firstNonLinked)){this.$inChange=!0;for(var k=this.session,D=k.getTextRange(S.firstNonLinked),_=0;_<S.length;_++){var F=S[_];if(F.linked){var x=F.original,$=l.snippetManager.tmStrFormat(D,x,this.editor);k.replace(F,$)}}this.$inChange=!1}},m.prototype.onAfterExec=function(S){S.command&&!S.command.readOnly&&this.updateLinkedFields()},m.prototype.onChangeSelection=function(){if(this.editor){for(var S=this.editor.selection.lead,k=this.editor.selection.anchor,D=this.editor.selection.isEmpty(),_=0;_<this.ranges.length;_++)if(!this.ranges[_].linked){var F=this.ranges[_].contains(S.row,S.column),x=D||this.ranges[_].contains(k.row,k.column);if(F&&x)return}this.detach()}},m.prototype.onChangeSession=function(){this.detach()},m.prototype.tabNext=function(S){var k=this.tabstops.length,D=this.index+(S||1);D=Math.min(Math.max(D,1),k),D==k&&(D=0),this.selectTabstop(D),this.updateTabstopMarkers(),D===0&&this.detach()},m.prototype.selectTabstop=function(S){this.$openTabstops=null;var k=this.tabstops[this.index];if(k&&this.addTabstopMarkers(k),this.index=S,k=this.tabstops[this.index],!(!k||!k.length)){this.selectedTabstop=k;var D=k.firstNonLinked||k;if(k.choices&&(D.cursor=D.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(D);else{var _=this.editor.multiSelect;_.toSingleRange(D);for(var F=0;F<k.length;F++)k.hasLinkedRanges&&k[F].linked||_.addRange(k[F].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},m.prototype.addTabstops=function(S,k,D){var _=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!S[0]){var F=e.fromPoints(D,D);E(F.start,k),E(F.end,k),S[0]=[F],S[0].index=0}var x=this.index,$=[x+1,0],C=this.ranges,b=this.snippetId=(this.snippetId||0)+1;S.forEach(function(T,I){var R=this.$openTabstops[I]||T;R.snippetId=b;for(var N=0;N<T.length;N++){var P=T[N],B=e.fromPoints(P.start,P.end||P.start);A(B.start,k),A(B.end,k),B.original=P,B.tabstop=R,C.push(B),R!=T?R.unshift(B):R[N]=B,P.fmtString||R.firstNonLinked&&_?(B.linked=!0,R.hasLinkedRanges=!0):R.firstNonLinked||(R.firstNonLinked=B)}R.firstNonLinked||(R.hasLinkedRanges=!1),R===T&&($.push(R),this.$openTabstops[I]=R),this.addTabstopMarkers(R),R.rangeList=R.rangeList||new i,R.rangeList.$bias=0,R.rangeList.addList(R)},this),$.length>2&&(this.tabstops.length&&$.push($.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,$))},m.prototype.addTabstopMarkers=function(S){var k=this.session;S.forEach(function(D){D.markerId||(D.markerId=k.addMarker(D,"ace_snippet-marker","text"))})},m.prototype.removeTabstopMarkers=function(S){var k=this.session;S.forEach(function(D){k.removeMarker(D.markerId),D.markerId=null})},m.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var S=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&S--,this.tabstops.forEach(function(k){k.snippetId===S?this.addTabstopMarkers(k):this.removeTabstopMarkers(k)},this)}},m.prototype.removeRange=function(S){var k=S.tabstop.indexOf(S);k!=-1&&S.tabstop.splice(k,1),k=this.ranges.indexOf(S),k!=-1&&this.ranges.splice(k,1),k=S.tabstop.rangeList.ranges.indexOf(S),k!=-1&&S.tabstop.splice(k,1),this.session.removeMarker(S.markerId),S.tabstop.length||(k=this.tabstops.indexOf(S.tabstop),k!=-1&&this.tabstops.splice(k,1),this.tabstops.length||this.detach())},m})();v.prototype.keyboardHandler=new o,v.prototype.keyboardHandler.bindKeys({Tab:function(m){l.snippetManager&&l.snippetManager.expandWithTab(m)||(m.tabstopManager.tabNext(1),m.renderer.scrollCursorIntoView())},"Shift-Tab":function(m){m.tabstopManager.tabNext(-1),m.renderer.scrollCursorIntoView()},Esc:function(m){m.tabstopManager.detach()}});var A=function(m,S){m.row==0&&(m.column+=S.column),m.row+=S.row},E=function(m,S){m.row==S.row&&(m.column-=S.column),m.row-=S.row};p.importCssString(`
|
|
1297
|
-
.ace_snippet-marker {
|
|
1298
|
-
-moz-box-sizing: border-box;
|
|
1299
|
-
box-sizing: border-box;
|
|
1300
|
-
background: rgba(194, 193, 208, 0.09);
|
|
1301
|
-
border: 1px dotted rgba(211, 208, 235, 0.62);
|
|
1302
|
-
position: absolute;
|
|
1303
|
-
}`,"snippets.css",!1),l.snippetManager=new f;var w=n("./editor").Editor;(function(){this.insertSnippet=function(m,S){return l.snippetManager.insertSnippet(this,m,S)},this.expandSnippet=function(m){return l.snippetManager.expandWithTab(this,m)}}).call(w.prototype)}),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/config","ace/lib/useragent"],function(n,l,y){var a=n("../virtual_renderer").VirtualRenderer,p=n("../editor").Editor,d=n("../range").Range,s=n("../lib/event"),c=n("../lib/lang"),e=n("../lib/dom"),i=n("../config").nls,o=n("./../lib/useragent"),h=function(A){return"suggest-aria-id:".concat(A)},r=o.isSafari?"menu":"listbox",u=o.isSafari?"menuitem":"option",f=o.isSafari?"aria-current":"aria-selected",g=function(A){var E=new a(A);E.$maxLines=4;var w=new p(E);return w.setHighlightActiveLine(!1),w.setShowPrintMargin(!1),w.renderer.setShowGutter(!1),w.renderer.setHighlightGutterLine(!1),w.$mouseHandler.$focusTimeout=0,w.$highlightTagPending=!0,w},v=(function(){function A(E){var w=e.createElement("div"),m=g(w);E&&E.appendChild(w),w.style.display="none",m.renderer.content.style.cursor="default",m.renderer.setStyle("ace_autocomplete"),m.renderer.$textLayer.element.setAttribute("role",r),m.renderer.$textLayer.element.setAttribute("aria-roledescription",i("autocomplete.popup.aria-roledescription","Autocomplete suggestions")),m.renderer.$textLayer.element.setAttribute("aria-label",i("autocomplete.popup.aria-label","Autocomplete suggestions")),m.renderer.textarea.setAttribute("aria-hidden","true"),m.setOption("displayIndentGuides",!1),m.setOption("dragDelay",150);var S=function(){};m.focus=S,m.$isFocused=!0,m.renderer.$cursorLayer.restartTimer=S,m.renderer.$cursorLayer.element.style.opacity="0",m.renderer.$maxLines=8,m.renderer.$keepTextAreaAtCursor=!1,m.setHighlightActiveLine(!1),m.session.highlight(""),m.session.$searchHighlight.clazz="ace_highlight-marker",m.on("mousedown",function(C){var b=C.getDocumentPosition();m.selection.moveToPosition(b),_.start.row=_.end.row=b.row,C.stop()});var k,D=new d(-1,0,-1,1/0),_=new d(-1,0,-1,1/0);_.id=m.session.addMarker(_,"ace_active-line","fullLine"),m.setSelectOnHover=function(C){C?D.id&&(m.session.removeMarker(D.id),D.id=null):D.id=m.session.addMarker(D,"ace_line-hover","fullLine")},m.setSelectOnHover(!1),m.on("mousemove",function(C){if(!k){k=C;return}if(!(k.x==C.x&&k.y==C.y)){k=C,k.scrollTop=m.renderer.scrollTop,m.isMouseOver=!0;var b=k.getDocumentPosition().row;D.start.row!=b&&(D.id||m.setRow(b),x(b))}}),m.renderer.on("beforeRender",function(){if(k&&D.start.row!=-1){k.$pos=null;var C=k.getDocumentPosition().row;D.id||m.setRow(C),x(C,!0)}}),m.renderer.on("afterRender",function(){for(var C=m.renderer.$textLayer,b=C.config.firstRow,T=C.config.lastRow;b<=T;b++){var I=C.element.childNodes[b-C.config.firstRow];I.setAttribute("role",u),I.setAttribute("aria-roledescription",i("autocomplete.popup.item.aria-roledescription","item")),I.setAttribute("aria-setsize",m.data.length),I.setAttribute("aria-describedby","doc-tooltip"),I.setAttribute("aria-posinset",b+1);var R=m.getData(b);if(R){var N="".concat(R.caption||R.value).concat(R.meta?", ".concat(R.meta):"");I.setAttribute("aria-label",N)}var P=I.querySelectorAll(".ace_completion-highlight");P.forEach(function(B){B.setAttribute("role","mark")})}}),m.renderer.on("afterRender",function(){var C=m.getRow(),b=m.renderer.$textLayer,T=b.element.childNodes[C-b.config.firstRow],I=document.activeElement;if(T!==m.selectedNode&&m.selectedNode&&(e.removeCssClass(m.selectedNode,"ace_selected"),m.selectedNode.removeAttribute(f),m.selectedNode.removeAttribute("id")),I.removeAttribute("aria-activedescendant"),m.selectedNode=T,T){var R=h(C);e.addCssClass(T,"ace_selected"),T.id=R,b.element.setAttribute("aria-activedescendant",R),I.setAttribute("aria-activedescendant",R),T.setAttribute(f,"true")}});var F=function(){x(-1)},x=function(C,b){C!==D.start.row&&(D.start.row=D.end.row=C,b||m.session._emit("changeBackMarker"),m._emit("changeHoverMarker"))};m.getHoveredRow=function(){return D.start.row},s.addListener(m.container,"mouseout",function(){m.isMouseOver=!1,F()}),m.on("hide",F),m.on("changeSelection",F),m.session.doc.getLength=function(){return m.data.length},m.session.doc.getLine=function(C){var b=m.data[C];return typeof b=="string"?b:b&&b.value||""};var $=m.session.bgTokenizer;return $.$tokenizeRow=function(C){function b(G,Y){G&&I.push({type:(T.className||"")+(Y||""),value:G})}var T=m.data[C],I=[];if(!T)return I;typeof T=="string"&&(T={value:T});for(var R=T.caption||T.value||T.name,N=R.toLowerCase(),P=(m.filterText||"").toLowerCase(),B=0,V=0,W=0;W<=P.length;W++)if(W!=V&&(T.matchMask&1<<W||W==P.length)){var z=P.slice(V,W);V=W;var U=N.indexOf(z,B);if(U==-1)continue;b(R.slice(B,U),""),B=U+z.length,b(R.slice(U,B),"completion-highlight")}return b(R.slice(B,R.length),""),I.push({type:"completion-spacer",value:" "}),T.meta&&I.push({type:"completion-meta",value:T.meta}),T.message&&I.push({type:"completion-message",value:T.message}),I},$.$updateOnChange=S,$.start=S,m.session.$computeWidth=function(){return this.screenWidth=0},m.isOpen=!1,m.isTopdown=!1,m.autoSelect=!0,m.filterText="",m.isMouseOver=!1,m.data=[],m.setData=function(C,b){m.filterText=b||"",m.setValue(c.stringRepeat(`
|
|
1304
|
-
`,C.length),-1),m.data=C||[],m.setRow(0)},m.getData=function(C){return m.data[C]},m.getRow=function(){return _.start.row},m.setRow=function(C){C=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,C)),_.start.row!=C&&(m.selection.clearSelection(),_.start.row=_.end.row=C||0,m.session._emit("changeBackMarker"),m.moveCursorTo(C||0,0),m.isOpen&&m._signal("select"))},m.on("changeSelection",function(){m.isOpen&&m.setRow(m.selection.lead.row),m.renderer.scrollCursorIntoView()}),m.hide=function(){this.container.style.display="none",m.anchorPos=null,m.anchor=null,m.isOpen&&(m.isOpen=!1,this._signal("hide"))},m.tryShow=function(C,b,T,I){if(!I&&m.isOpen&&m.anchorPos&&m.anchor&&m.anchorPos.top===C.top&&m.anchorPos.left===C.left&&m.anchor===T)return!0;var R=this.container,N=this.renderer.scrollBar.width||10,P=window.innerHeight-N,B=window.innerWidth-N,V=this.renderer,W=V.$maxLines*b*1.4,z={top:0,bottom:0},U=P-C.top-3*this.$borderSize-b,G=C.top-3*this.$borderSize;T||(G<=U||U>=W?T="bottom":T="top"),T==="top"?(z.bottom=C.top-this.$borderSize,z.top=z.bottom-W):T==="bottom"&&(z.top=C.top+b+this.$borderSize,z.bottom=z.top+W);var Y=z.top>=0&&z.bottom<=P;if(!I&&!Y)return!1;Y?V.$maxPixelHeight=null:T==="top"?V.$maxPixelHeight=G:V.$maxPixelHeight=U,T==="top"?(R.style.top="",R.style.bottom=P+N-z.bottom+"px",m.isTopdown=!1):(R.style.top=z.top+"px",R.style.bottom="",m.isTopdown=!0),R.style.display="";var Q=C.left;return Q+R.offsetWidth>B&&(Q=B-R.offsetWidth),R.style.left=Q+"px",R.style.right="",m.isOpen||(m.isOpen=!0,this._signal("show"),k=null),m.anchorPos=C,m.anchor=T,e.$fixPositionBug(R),!0},m.show=function(C,b,T){this.tryShow(C,b,T?"bottom":void 0,!0)},m.goTo=function(C){var b=this.getRow(),T=this.session.getLength()-1;switch(C){case"up":b=b<=0?T:b-1;break;case"down":b=b>=T?-1:b+1;break;case"start":b=0;break;case"end":b=T}this.setRow(b)},m.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},m.$imageSize=0,m.$borderSize=1,m}return A})();e.importCssString(`
|
|
1305
|
-
.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
|
|
1306
|
-
background-color: #CAD6FA;
|
|
1307
|
-
z-index: 1;
|
|
1308
|
-
}
|
|
1309
|
-
.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
|
|
1310
|
-
background-color: #3a674e;
|
|
1311
|
-
}
|
|
1312
|
-
.ace_editor.ace_autocomplete .ace_line-hover {
|
|
1313
|
-
border: 1px solid #abbffe;
|
|
1314
|
-
margin-top: -1px;
|
|
1315
|
-
background: rgba(233,233,253,0.4);
|
|
1316
|
-
position: absolute;
|
|
1317
|
-
z-index: 2;
|
|
1318
|
-
}
|
|
1319
|
-
.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {
|
|
1320
|
-
border: 1px solid rgba(109, 150, 13, 0.8);
|
|
1321
|
-
background: rgba(58, 103, 78, 0.62);
|
|
1322
|
-
}
|
|
1323
|
-
.ace_completion-meta {
|
|
1324
|
-
opacity: 0.5;
|
|
1325
|
-
margin-left: 0.9em;
|
|
1326
|
-
}
|
|
1327
|
-
.ace_completion-message {
|
|
1328
|
-
margin-left: 0.9em;
|
|
1329
|
-
color: blue;
|
|
1330
|
-
}
|
|
1331
|
-
.ace_editor.ace_autocomplete .ace_completion-highlight{
|
|
1332
|
-
color: #2d69c7;
|
|
1333
|
-
}
|
|
1334
|
-
.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{
|
|
1335
|
-
color: #93ca12;
|
|
1336
|
-
}
|
|
1337
|
-
.ace_editor.ace_autocomplete {
|
|
1338
|
-
width: 300px;
|
|
1339
|
-
z-index: 200000;
|
|
1340
|
-
border: 1px lightgray solid;
|
|
1341
|
-
position: fixed;
|
|
1342
|
-
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
1343
|
-
line-height: 1.4;
|
|
1344
|
-
background: #fefefe;
|
|
1345
|
-
color: #111;
|
|
1346
|
-
}
|
|
1347
|
-
.ace_dark.ace_editor.ace_autocomplete {
|
|
1348
|
-
border: 1px #484747 solid;
|
|
1349
|
-
box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);
|
|
1350
|
-
line-height: 1.4;
|
|
1351
|
-
background: #25282c;
|
|
1352
|
-
color: #c1c1c1;
|
|
1353
|
-
}
|
|
1354
|
-
.ace_autocomplete .ace_text-layer {
|
|
1355
|
-
width: calc(100% - 8px);
|
|
1356
|
-
}
|
|
1357
|
-
.ace_autocomplete .ace_line {
|
|
1358
|
-
display: flex;
|
|
1359
|
-
align-items: center;
|
|
1360
|
-
}
|
|
1361
|
-
.ace_autocomplete .ace_line > * {
|
|
1362
|
-
min-width: 0;
|
|
1363
|
-
flex: 0 0 auto;
|
|
1364
|
-
}
|
|
1365
|
-
.ace_autocomplete .ace_line .ace_ {
|
|
1366
|
-
flex: 0 1 auto;
|
|
1367
|
-
overflow: hidden;
|
|
1368
|
-
text-overflow: ellipsis;
|
|
1369
|
-
}
|
|
1370
|
-
.ace_autocomplete .ace_completion-spacer {
|
|
1371
|
-
flex: 1;
|
|
1372
|
-
}
|
|
1373
|
-
.ace_autocomplete.ace_loading:after {
|
|
1374
|
-
content: "";
|
|
1375
|
-
position: absolute;
|
|
1376
|
-
top: 0px;
|
|
1377
|
-
height: 2px;
|
|
1378
|
-
width: 8%;
|
|
1379
|
-
background: blue;
|
|
1380
|
-
z-index: 100;
|
|
1381
|
-
animation: ace_progress 3s infinite linear;
|
|
1382
|
-
animation-delay: 300ms;
|
|
1383
|
-
transform: translateX(-100%) scaleX(1);
|
|
1384
|
-
}
|
|
1385
|
-
@keyframes ace_progress {
|
|
1386
|
-
0% { transform: translateX(-100%) scaleX(1) }
|
|
1387
|
-
50% { transform: translateX(625%) scaleX(2) }
|
|
1388
|
-
100% { transform: translateX(1500%) scaleX(3) }
|
|
1389
|
-
}
|
|
1390
|
-
@media (prefers-reduced-motion) {
|
|
1391
|
-
.ace_autocomplete.ace_loading:after {
|
|
1392
|
-
transform: translateX(625%) scaleX(2);
|
|
1393
|
-
animation: none;
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
`,"autocompletion.css",!1),l.AcePopup=v,l.$singleLineEditor=g,l.getAriaId=h}),ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(n,l,y){var a=(function(){function p(d){this.editor=d,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}return p.prototype.setScreenReaderContent=function(d){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var c=this.popup.getRow(),e=this.popup.renderer.$textLayer,i=e.element.childNodes[c-e.config.firstRow];if(i){for(var o="doc-tooltip ",h=0;h<this._lines.length;h++)o+="ace-inline-screenreader-line-".concat(h," ");i.setAttribute("aria-describedby",o)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=d.split(/\r\n|\r|\n/);var s=this.createCodeBlock();this.screenReaderDiv.appendChild(s)},p.prototype.destroy=function(){this.screenReaderDiv.remove()},p.prototype.createCodeBlock=function(){var d=document.createElement("pre");d.setAttribute("id","ace-inline-screenreader");for(var s=0;s<this._lines.length;s++){var c=document.createElement("code");c.setAttribute("id","ace-inline-screenreader-line-".concat(s));var e=document.createTextNode(this._lines[s]);c.appendChild(e),d.appendChild(c)}return d},p})();l.AceInlineScreenReader=a}),ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],function(n,l,y){var a=n("../snippets").snippetManager,p=n("./inline_screenreader").AceInlineScreenReader,d=(function(){function s(){this.editor=null}return s.prototype.show=function(c,e,i){if(i=i||"",c&&this.editor&&this.editor!==c&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!c||!e)return!1;this.inlineScreenReader||(this.inlineScreenReader=new p(c));var o=e.snippet?a.getDisplayTextForSnippet(c,e.snippet):e.value;return e.hideInlinePreview||!o||!o.startsWith(i)?!1:(this.editor=c,this.inlineScreenReader.setScreenReaderContent(o),o=o.slice(i.length),o===""?c.removeGhostText():c.setGhostText(o),!0)},s.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},s.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},s.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&(this.inlineScreenReader.destroy(),this.inlineScreenReader=null)},s})();l.AceInline=d}),ace.define("ace/autocomplete/util",["require","exports","module"],function(n,l,y){l.parForEach=function(p,d,s){var c=0,e=p.length;e===0&&s();for(var i=0;i<e;i++)d(p[i],function(o,h){c++,c===e&&s(o,h)})};var a=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;l.retrievePrecedingIdentifier=function(p,d,s){s=s||a;for(var c=[],e=d-1;e>=0&&s.test(p[e]);e--)c.push(p[e]);return c.reverse().join("")},l.retrieveFollowingIdentifier=function(p,d,s){s=s||a;for(var c=[],e=d;e<p.length&&s.test(p[e]);e++)c.push(p[e]);return c},l.getCompletionPrefix=function(p){var d=p.getCursorPosition(),s=p.session.getLine(d.row),c;return p.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(i){!c&&i&&(c=this.retrievePrecedingIdentifier(s,d.column,i))}.bind(this))}.bind(this)),c||this.retrievePrecedingIdentifier(s,d.column)},l.triggerAutocomplete=function(p,s){var s=s??p.session.getPrecedingCharacter();return p.completers.some(function(c){if(c.triggerCharacters&&Array.isArray(c.triggerCharacters))return c.triggerCharacters.includes(s)})}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event","ace/lib/scroll"],function(n,l,y){var a=n("./keyboard/hash_handler").HashHandler,p=n("./autocomplete/popup").AcePopup,d=n("./autocomplete/inline").AceInline,s=n("./autocomplete/popup").getAriaId,c=n("./autocomplete/util"),e=n("./lib/lang"),i=n("./lib/dom"),o=n("./snippets").snippetManager,h=n("./config"),r=n("./lib/event"),u=n("./lib/scroll").preventParentScroll,f=function(E,w){w.completer&&w.completer.destroy()},g=(function(){function E(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new a,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=e.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=e.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=e.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=e.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=e.delayedCall(function(){var w=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!w||this.editor.completers.length===0||(this.completions=new A(E.completionsForLoading),this.openPopup(this.editor,w.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0))}.bind(this),this.stickySelectionDelay)}return Object.defineProperty(E,"completionsForLoading",{get:function(){return[{caption:h.nls("autocomplete.loading","Loading..."),value:""}]},enumerable:!1,configurable:!0}),E.prototype.$init=function(){return this.popup=new p(this.parentNode||document.body||document.documentElement),this.popup.on("click",function(w){this.insertMatch(),w.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.$onPopupShow.bind(this)),this.popup.on("hide",this.$onHidePopup.bind(this)),this.popup.on("select",this.$onPopupChange.bind(this)),r.addListener(this.popup.container,"mouseout",this.mouseOutListener.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup.renderer.on("afterRender",this.$onPopupRender.bind(this)),this.popup},E.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new d,this.inlineRenderer},E.prototype.getPopup=function(){return this.popup||this.$init()},E.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1},E.prototype.$seen=function(w){!this.hasSeen.has(w)&&w&&w.completer&&w.completer.onSeen&&typeof w.completer.onSeen=="function"&&(w.completer.onSeen(this.editor,w),this.hasSeen.add(w))},E.prototype.$onPopupChange=function(w){if(this.inlineRenderer&&this.inlineEnabled){var m=w?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(m),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule()}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null)},E.prototype.$updateGhostText=function(w){var m=this.base.row,S=this.base.column,k=this.editor.getCursorPosition().column,D=this.editor.session.getLine(m).slice(S,k);this.inlineRenderer.show(this.editor,w,D)?this.$seen(w):this.inlineRenderer.hide()},E.prototype.$onPopupRender=function(){var w=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var m=this.popup.getFirstVisibleRow();m<=this.popup.getLastVisibleRow();m++){var S=this.popup.getData(m);S&&(!w||S.hideInlinePreview)&&this.$seen(S)}},E.prototype.$onPopupShow=function(w){this.$onPopupChange(w),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},E.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var w=this.editor.container.parentNode,m=[];w;)m.push(w),w.addEventListener("scroll",this.onLayoutChange,{passive:!0}),w=w.parentNode;this.$elements=m}},E.prototype.unObserveLayoutChanges=function(){var w=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(m){m.removeEventListener("scroll",w.onLayoutChange,{passive:!0})}),this.$elements=null},E.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},E.prototype.$updatePopupPosition=function(){var w=this.editor,m=w.renderer,S=m.layerConfig.lineHeight,k=m.$cursorLayer.getPixelPosition(this.base,!0);k.left-=this.popup.getTextLeftOffset();var D=w.container.getBoundingClientRect();k.top+=D.top-m.layerConfig.offset,k.left+=D.left-w.renderer.scrollLeft,k.left+=m.gutterWidth;var _={top:k.top,left:k.left};m.$ghostText&&m.$ghostTextWidget&&this.base.row===m.$ghostText.position.row&&(_.top+=m.$ghostTextWidget.el.offsetHeight);var F=w.container.getBoundingClientRect().bottom-S,x=F<_.top?{top:F,left:_.left}:_;this.popup.tryShow(x,S,"bottom")||this.popup.tryShow(k,S,"top")||this.popup.show(k,S)},E.prototype.openPopup=function(w,m,S){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var k=this.popup.getRow(),D=this.popup.data[k];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:s(this.popup.getRow()),inline:this.inlineEnabled}),w.keyBinding.addKeyboardHandler(this.keyboardHandler);var _;this.stickySelection&&(_=this.popup.data.indexOf(D)),(!_||_===-1)&&(_=0),this.popup.setRow(this.autoSelect?_:-1),_===k&&D!==this.completions.filtered[_]&&this.$onPopupChange();var F=this.inlineRenderer&&this.inlineEnabled;if(_===k&&F){var x=this.popup.getData(this.popup.getRow());this.$updateGhostText(x)}S||(this.popup.setTheme(w.getTheme()),this.popup.setFontSize(w.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},E.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off("afterRender",this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},E.prototype.changeListener=function(w){var m=this.editor.selection.lead;(m.row!=this.base.row||m.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},E.prototype.blurListener=function(w){var m=document.activeElement,S=this.editor.textInput.getElement(),k=w.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(w.relatedTarget),D=this.popup&&this.popup.container;m!=S&&m.parentNode!=D&&!k&&m!=this.tooltipNode&&w.relatedTarget!=S&&this.detach()},E.prototype.mousedownListener=function(w){this.detach()},E.prototype.mousewheelListener=function(w){this.popup&&!this.popup.isMouseOver&&this.detach()},E.prototype.mouseOutListener=function(w){this.popup.isOpen&&this.$updatePopupPosition()},E.prototype.goTo=function(w){this.popup.goTo(w)},E.prototype.insertMatch=function(w,m){if(w||(w=this.popup.getData(this.popup.getRow())),!w)return!1;if(w.value==="")return this.detach();var S=this.completions,k=this.getCompletionProvider().insertMatch(this.editor,w,S.filterText,m);return this.completions==S&&this.detach(),k},E.prototype.showPopup=function(w,m){this.editor&&this.detach(),this.activated=!0,this.editor=w,w.completer!=this&&(w.completer&&w.completer.detach(),w.completer=this),w.on("changeSelection",this.changeListener),w.on("blur",this.blurListener),w.on("mousedown",this.mousedownListener),w.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,m)},E.prototype.getCompletionProvider=function(w){return this.completionProvider||(this.completionProvider=new v(w)),this.completionProvider},E.prototype.gatherCompletions=function(w,m){return this.getCompletionProvider().gatherCompletions(w,m)},E.prototype.updateCompletions=function(w,m){if(w&&this.base&&this.completions){var k=this.editor.getCursorPosition(),D=this.editor.session.getTextRange({start:this.base,end:k});if(D==this.completions.filterText)return;if(this.completions.setFilter(D),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==D&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,D,w);return}if(m&&m.matches){var k=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(k.row,k.column),this.base.$insertRight=!0,this.completions=new A(m.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,"",w)}var S=this.editor.getSession(),k=this.editor.getCursorPosition(),D=c.getCompletionPrefix(this.editor);this.base=S.doc.createAnchor(k.row,k.column-D.length),this.base.$insertRight=!0;var _={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:D,pos:k}).provideCompletions(this.editor,_,function(F,x,$){var C=x.filtered,b=c.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),$){if(!C.length){var T=!this.autoShown&&this.emptyMessage;if(typeof T=="function"&&(T=this.emptyMessage(b)),T){var I=[{caption:T,value:""}];this.completions=new A(I),this.openPopup(this.editor,b,w),this.popup.renderer.setStyle("ace_loading",!1),this.popup.renderer.setStyle("ace_empty-message",!0);return}return this.detach()}if(C.length==1&&C[0].value==b&&!C[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&C.length==1)return this.insertMatch(C[0])}this.completions=!$&&this.showLoadingState?new A(E.completionsForLoading.concat(C),x.filterText):x,this.openPopup(this.editor,b,w),this.popup.renderer.setStyle("ace_empty-message",!1),this.popup.renderer.setStyle("ace_loading",!$)}.bind(this)),this.showLoadingState&&!this.autoShown&&(!this.popup||!this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2)},E.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},E.prototype.updateDocTooltip=function(){var w=this.popup,m=this.completions&&this.completions.filtered,S=m&&(m[w.getHoveredRow()]||m[w.getRow()]),k=null;if(!S||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var D=this.editor.completers.length,_=0;_<D;_++){var F=this.editor.completers[_];if(F.getDocTooltip&&S.completerId===F.id){k=F.getDocTooltip(S);break}}if(!k&&typeof S!="string"&&(k=S),typeof k=="string"&&(k={docText:k}),!k||!k.docHTML&&!k.docText)return this.hideDocTooltip();this.showDocTooltip(k)},E.prototype.showDocTooltip=function(w){this.tooltipNode||(this.tooltipNode=i.createElement("div"),this.tooltipNode.style.margin="0",this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.style.overscrollBehavior="contain",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"),this.tooltipNode.addEventListener("wheel",u));var m=this.editor.renderer.theme;this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(m.isDark?"ace_dark ":"")+(m.cssClass||"");var S=this.tooltipNode;w.docHTML?S.innerHTML=w.docHTML:w.docText&&(S.textContent=w.docText),S.parentNode||this.popup.container.appendChild(this.tooltipNode);var k=this.popup,D=k.container.getBoundingClientRect(),_=400,F=300,x=k.renderer.scrollBar.width||10,$=D.left,C=window.innerWidth-D.right-x,b=k.isTopdown?D.top:window.innerHeight-x-D.bottom,T=[Math.min(C/_,1),Math.min($/_,1),Math.min(b/F*.9)],I=Math.max.apply(Math,T),R=S.style;R.display="block",I==T[0]?(R.left=D.right+1+"px",R.right="",R.maxWidth=_*I+"px",R.top=D.top+"px",R.bottom="",R.maxHeight=Math.min(window.innerHeight-x-D.top,F)+"px"):I==T[1]?(R.right=window.innerWidth-D.left+"px",R.left="",R.maxWidth=_*I+"px",R.top=D.top+"px",R.bottom="",R.maxHeight=Math.min(window.innerHeight-x-D.top,F)+"px"):I==T[2]&&(R.left=window.innerWidth-D.left+"px",R.maxWidth=Math.min(_,window.innerWidth)+"px",k.isTopdown?(R.top=D.bottom+"px",R.left=D.left+"px",R.right="",R.bottom="",R.maxHeight=Math.min(window.innerHeight-x-D.bottom,F)+"px"):(R.top=k.container.offsetTop-S.offsetHeight+"px",R.left=D.left+"px",R.right="",R.bottom="",R.maxHeight=Math.min(k.container.offsetTop,F)+"px"))},E.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var w=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==w&&this.editor.focus(),this.tooltipNode=null,w.parentNode&&w.parentNode.removeChild(w)}},E.prototype.onTooltipClick=function(w){for(var m=w.target;m&&m!=this.tooltipNode;){if(m.nodeName=="A"&&m.href){m.rel="noreferrer",m.target="_blank";break}m=m.parentNode}},E.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var w=this.popup.container;w&&w.parentNode&&w.parentNode.removeChild(w)}this.editor&&this.editor.completer==this&&(this.editor.off("destroy",f),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},E.for=function(w){return w.completer instanceof E||(w.completer&&(w.completer.destroy(),w.completer=null),h.get("sharedPopups")?(E.$sharedInstance||(E.$sharedInstance=new E),w.completer=E.$sharedInstance):(w.completer=new E,w.once("destroy",f))),w.completer},E})();g.prototype.commands={Up:function(E){E.completer.goTo("up")},Down:function(E){E.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(E){E.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(E){E.completer.goTo("end")},Esc:function(E){E.completer.detach()},Return:function(E){return E.completer.insertMatch()},"Shift-Return":function(E){E.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(E){var w=E.completer.insertMatch();if(w||E.tabstopManager)return w;E.completer.goTo("down")},Backspace:function(E){E.execCommand("backspace");var w=c.getCompletionPrefix(E);!w&&E.completer&&E.completer.detach()},PageUp:function(E){E.completer.popup.gotoPageUp()},PageDown:function(E){E.completer.popup.gotoPageDown()}},g.startCommand={name:"startAutocomplete",exec:function(E,w){var m=g.for(E);m.autoInsert=!1,m.autoSelect=!0,m.autoShown=!1,m.showPopup(E,w),m.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var v=(function(){function E(w){this.initialPosition=w,this.active=!0}return E.prototype.insertByIndex=function(w,m,S){return!this.completions||!this.completions.filtered?!1:this.insertMatch(w,this.completions.filtered[m],S)},E.prototype.insertMatch=function(w,m,S){if(!m)return!1;if(w.startOperation({command:{name:"insertMatch"}}),m.completer&&m.completer.insertMatch)m.completer.insertMatch(w,m);else{if(!this.completions)return!1;var k=this.completions.filterText.length,D=0;if(m.range&&m.range.start.row===m.range.end.row&&(k-=this.initialPosition.prefix.length,k+=this.initialPosition.pos.column-m.range.start.column,D+=m.range.end.column-this.initialPosition.pos.column),k||D){var _;w.selection.getAllRanges?_=w.selection.getAllRanges():_=[w.getSelectionRange()];for(var F=0,x;x=_[F];F++)x.start.column-=k,x.end.column+=D,w.session.remove(x)}m.snippet?o.insertSnippet(w,m.snippet):this.$insertString(w,m),m.completer&&m.completer.onInsert&&typeof m.completer.onInsert=="function"&&m.completer.onInsert(w,m),m.command&&m.command==="startAutocomplete"&&w.execCommand(m.command)}return w.endOperation(),!0},E.prototype.$insertString=function(w,m){var S=m.value||m;w.execCommand("insertstring",S)},E.prototype.gatherCompletions=function(w,m){var S=w.getSession(),k=w.getCursorPosition(),D=c.getCompletionPrefix(w),_=[];this.completers=w.completers;var F=w.completers.length;return w.completers.forEach(function(x,$){x.getCompletions(w,S,k,D,function(C,b){x.hideInlinePreview&&(b=b.map(function(T){return Object.assign(T,{hideInlinePreview:x.hideInlinePreview})})),!C&&b&&(_=_.concat(b)),m(null,{prefix:c.getCompletionPrefix(w),matches:_,finished:--F===0})})}),!0},E.prototype.provideCompletions=function(w,m,S){var k=function(x){var $=x.prefix,C=x.matches;this.completions=new A(C),m.exactMatch&&(this.completions.exactMatch=!0),m.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter($),(x.finished||this.completions.filtered.length)&&S(null,this.completions,x.finished)}.bind(this),D=!0,_=null;if(this.gatherCompletions(w,function(x,$){if(this.active){x&&(S(x,[],!0),this.detach());var C=$.prefix;if(C.indexOf($.prefix)===0){if(D){_=$;return}k($)}}}.bind(this)),D=!1,_){var F=_;_=null,k(F)}},E.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(w){typeof w.cancel=="function"&&w.cancel()})},E})(),A=(function(){function E(w,m){this.all=w,this.filtered=w,this.filterText=m||"",this.exactMatch=!1,this.ignoreCaption=!1}return E.prototype.setFilter=function(w){if(w.length>this.filterText&&w.lastIndexOf(this.filterText,0)===0)var m=this.filtered;else var m=this.all;this.filterText=w,m=this.filterCompletions(m,this.filterText),m=m.sort(function(k,D){return D.exactMatch-k.exactMatch||D.$score-k.$score||(k.caption||k.value).localeCompare(D.caption||D.value)});var S=null;m=m.filter(function(k){var D=k.snippet||k.caption||k.value;return D===S?!1:(S=D,!0)}),this.filtered=m},E.prototype.filterCompletions=function(w,m){var S=[],k=m.toUpperCase(),D=m.toLowerCase();e:for(var _=0,F;F=w[_];_++){if(F.skipFilter){F.$score=F.score,S.push(F);continue}var x=!this.ignoreCaption&&F.caption||F.value||F.snippet;if(x){var $=-1,C=0,b=0,T,I;if(this.exactMatch){if(m!==x.substr(0,m.length))continue e}else{var R=x.toLowerCase().indexOf(D);if(R>-1)b=R;else for(var N=0;N<m.length;N++){var P=x.indexOf(D[N],$+1),B=x.indexOf(k[N],$+1);if(T=P>=0&&(B<0||P<B)?P:B,T<0)continue e;I=T-$-1,I>0&&($===-1&&(b+=10),b+=I,C|=1<<N),$=T}}F.matchMask=C,F.exactMatch=b?0:1,F.$score=(F.score||0)-b,S.push(F)}}return S},E})();l.Autocomplete=g,l.CompletionProvider=v,l.FilteredList=A}),ace.define("ace/marker_group",["require","exports","module"],function(n,l,y){var a=(function(){function p(d,s){s&&(this.markerType=s.markerType),this.markers=[],this.session=d,d.addDynamicMarker(this)}return p.prototype.getMarkerAtPosition=function(d){return this.markers.find(function(s){return s.range.contains(d.row,d.column)})},p.prototype.markersComparator=function(d,s){return d.range.start.row-s.range.start.row},p.prototype.setMarkers=function(d){this.markers=d.sort(this.markersComparator).slice(0,this.MAX_MARKERS),this.session._signal("changeBackMarker")},p.prototype.update=function(d,s,c,e){if(!(!this.markers||!this.markers.length))for(var i=e.firstRow,o=e.lastRow,h,r=0,u=0,f=0;f<this.markers.length;f++){var g=this.markers[f];if(!(g.range.end.row<i)&&!(g.range.start.row>o)&&(g.range.start.row===u?r++:(u=g.range.start.row,r=0),!(r>200))){var v=g.range.clipRows(i,o);if(!(v.start.row===v.end.row&&v.start.column===v.end.column)){var A=v.toScreenRange(c);if(A.isEmpty()){h=c.getNextFoldLine(v.end.row,h),h&&h.end.row>v.end.row&&(i=h.end.row);continue}this.markerType==="fullLine"?s.drawFullLineMarker(d,A,g.className,e):A.isMultiLine()?this.markerType==="line"?s.drawMultiLineMarker(d,A,g.className,e):s.drawTextMarker(d,A,g.className,e):s.drawSingleLineMarker(d,A,g.className+" ace_br15",e)}}}},p})();a.prototype.MAX_MARKERS=1e4,l.MarkerGroup=a}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(n,l,y){function a(c,e){var i=c.getTextRange(d.fromPoints({row:0,column:0},e));return i.split(s).length-1}function p(c,e){var i=a(c,e),o=c.getValue().split(s),h=Object.create(null),r=o[i];return o.forEach(function(u,f){if(!(!u||u===r)){var g=Math.abs(i-f),v=o.length-g;h[u]?h[u]=Math.max(v,h[u]):h[u]=v}}),h}var d=n("../range").Range,s=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;l.getCompletions=function(c,e,i,o,h){var r=p(e,i),u=Object.keys(r);h(null,u.map(function(f){return{caption:f,value:f,score:r[f],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/marker_group","ace/autocomplete/text_completer","ace/editor","ace/config"],function(n,l,y){var a=n("../snippets").snippetManager,p=n("../autocomplete").Autocomplete,d=n("../config"),s=n("../lib/lang"),c=n("../autocomplete/util"),e=n("../marker_group").MarkerGroup,i=n("../autocomplete/text_completer"),o={getCompletions:function(D,_,F,x,$){if(_.$mode.completer)return _.$mode.completer.getCompletions(D,_,F,x,$);var C=D.session.getState(F.row),b=_.$mode.getCompletions(C,_,F,x);b=b.map(function(T){return T.completerId=o.id,T}),$(null,b)},id:"keywordCompleter"},h=function(D){var _={};return D.replace(/\${(\d+)(:(.*?))?}/g,function(F,x,$,C){return _[x]=C||""}).replace(/\$(\d+?)/g,function(F,x){return _[x]})},r={getCompletions:function(D,_,F,x,$){var C=[],b=_.getTokenAt(F.row,F.column);b&&b.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?C.push("html-tag"):C=a.getActiveScopes(D);var T=a.snippetMap,I=[];C.forEach(function(R){for(var N=T[R]||[],P=N.length;P--;){var B=N[P],V=B.name||B.tabTrigger;V&&I.push({caption:V,snippet:B.content,meta:B.tabTrigger&&!B.name?B.tabTrigger+"⇥ ":"snippet",completerId:r.id})}},this),$(null,I)},getDocTooltip:function(D){D.snippet&&!D.docHTML&&(D.docHTML=["<b>",s.escapeHTML(D.caption),"</b>","<hr></hr>",s.escapeHTML(h(D.snippet))].join(""))},id:"snippetCompleter"},u=[r,i,o];l.setCompleters=function(D){u.length=0,D&&u.push.apply(u,D)},l.addCompleter=function(D){u.push(D)},l.textCompleter=i,l.keyWordCompleter=o,l.snippetCompleter=r;var f={name:"expandSnippet",exec:function(D){return a.expandWithTab(D)},bindKey:"Tab"},g=function(D,_){v(_.session.$mode)},v=function(D){typeof D=="string"&&(D=d.$modes[D]),D&&(a.files||(a.files={}),A(D.$id,D.snippetFileId),D.modes&&D.modes.forEach(v))},A=function(D,_){!_||!D||a.files[D]||(a.files[D]={},d.loadModule(_,function(F){F&&(a.files[D]=F,!F.snippets&&F.snippetText&&(F.snippets=a.parseSnippetFile(F.snippetText)),a.register(F.snippets||[],F.scope),F.includeScopes&&(a.snippetMap[F.scope].includeScopes=F.includeScopes,F.includeScopes.forEach(function(x){v("ace/mode/"+x)})))}))},E=function(D){var _=D.editor,F=_.completer&&_.completer.activated;if(D.command.name==="backspace")F&&!c.getCompletionPrefix(_)&&_.completer.detach();else if(D.command.name==="insertstring"&&!F){w=D;var x=D.editor.$liveAutocompletionDelay;x?m.delay(x):S(D)}},w,m=s.delayedCall(function(){S(w)},0),S=function(D){var _=D.editor,F=c.getCompletionPrefix(_),x=D.args,$=c.triggerAutocomplete(_,x);if(F&&F.length>=_.$liveAutocompletionThreshold||$){var C=p.for(_);C.autoShown=!0,C.showPopup(_)}},k=n("../editor").Editor;n("../config").defineOptions(k.prototype,"editor",{enableBasicAutocompletion:{set:function(D){D?(p.for(this),this.completers||(this.completers=Array.isArray(D)?D:u),this.commands.addCommand(p.startCommand)):this.commands.removeCommand(p.startCommand)},value:!1},enableLiveAutocompletion:{set:function(D){D?(this.completers||(this.completers=Array.isArray(D)?D:u),this.commands.on("afterExec",E)):this.commands.off("afterExec",E)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(D){D?(this.commands.addCommand(f),this.on("changeMode",g),g(null,this)):(this.commands.removeCommand(f),this.off("changeMode",g))},value:!1}}),l.MarkerGroup=e}),(function(){ace.require(["ace/ext/language_tools"],function(n){L&&(L.exports=n)})})()})(Ra);const fi={jsonError:{border:"1px solid red",minHeight:200},jsonNoError:{border:"1px solid #00000000",minHeight:200}};function Oa(L){return M.createElement(_a,{style:L.error===!0?fi.jsonError:L.error===!1?fi.jsonNoError:void 0,mode:L.mode||"json",width:"100%",height:"100%",showPrintMargin:L.editValueMode,showGutter:L.editValueMode,highlightActiveLine:L.editValueMode,defaultValue:L.defaultValue,theme:L.themeType==="dark"?"clouds_midnight":"chrome",value:L.value,readOnly:!L.onChange,onChange:t=>L.onChange(t),name:L.name||"UNIQUE_ID_OF_DIV1",fontSize:L.fontSize||14,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:L.editValueMode,tabSize:L.editValueMode?2:void 0},editorProps:{$blockScrolling:!0}})}const bn={flex:{display:"flex"},button:{height:48,minWidth:48},wrapper:{width:"calc(100vw - 40px)",height:"calc(100vh - 188px)"}};class Na extends K{componentDidMount(){super.componentDidMount();const{data:t,attr:n}=this.props,l=K.getValue(t,n)||"{}";this.setState({value:l,initialized:!0,jsonError:this.validateJson(l)})}validateJson(t){let n=!1;if(this.props.schema.validateJson!==!1&&(t||!this.props.schema.allowEmpty))try{this.props.schema.json5?Li.parse(t):JSON.parse(t)}catch(l){console.log("Error in JSON",l),n=!0}return n}renderItem(t,n){if(!this.state.initialized)return null;const{schema:l,data:y,attr:a}=this.props,{value:p,showSelectId:d}=this.state;return M.createElement(O.FormControl,{fullWidth:!0,variant:"standard"},M.createElement("div",{style:bn.flex},M.createElement(O.Button,{color:"grey",disabled:n,style:bn.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},j.I18n.t("ra_JSON editor"))),d?M.createElement(co,{title:this.getText(l.label),overflowHidden:!0,applyDisabled:this.state.jsonError&&this.props.schema.doNotApplyWithError,onClose:()=>this.setState({showSelectId:!1,value:K.getValue(y,a)||{}}),onApply:()=>this.setState({showSelectId:!1},()=>this.onChange(a,p))},M.createElement("div",{style:{...bn.wrapper,border:this.state.jsonError?"2px solid red":"2px solid transparent"}},M.createElement(Oa,{mode:this.props.schema.json5?"json5":"json",value:typeof p=="object"?JSON.stringify(p):p,onChange:s=>this.setState({value:s,jsonError:this.validateJson(s)}),name:"ConfigJsonEditor",themeType:this.props.oContext.themeType}))):null,l.help||this.state.jsonError?M.createElement(O.FormHelperText,null,this.state.jsonError?j.I18n.t("ra_Invalid JSON"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Ba=[{value:"en",label:"English"},{value:"de",label:"Deutsch"},{value:"ru",label:"русский"},{value:"pt",label:"Portugues"},{value:"nl",label:"Nederlands"},{value:"fr",label:"français"},{value:"it",label:"Italiano"},{value:"es",label:"Espanol"},{value:"pl",label:"Polski"},{value:"uk",label:"Український"},{value:"zh-cn",label:"简体中文"}];class Pa extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr),n=[...Ba];this.props.schema.system?n.unshift({value:"",label:j.I18n.t("ra_System language")}):n.unshift({value:"",label:j.I18n.t("ra_none")}),this.setState({value:this.props.schema.system?t||"":t||j.I18n.getLanguage(),selectOptions:n})}renderItem(t,n){var y,a;if(!this.state.selectOptions)return null;const l=(y=this.state.selectOptions)==null?void 0:y.find(p=>p.value===this.state.value||!p.value&&!this.state.value);return M.createElement(O.FormControl,{fullWidth:!0,variant:"standard"},this.props.schema.label?M.createElement(O.InputLabel,null,this.getText(this.props.schema.label)):null,M.createElement(O.Select,{variant:"standard",error:!!t,disabled:n,value:this.state.value||"_",renderValue:()=>this.getText(l==null?void 0:l.label,this.props.schema.noTranslation),onChange:p=>{let{value:d}=p.target;d==="_"&&(d=""),this.setState({value:d},()=>{const s=this.onChange(this.props.attr,d);if(s instanceof Promise&&s.catch(c=>console.error(c)),this.props.schema.changeGuiLanguage)if(d){if(d===j.I18n.getLanguage())return;j.I18n.setLanguage(d),this.props.oContext.changeLanguage&&this.props.oContext.changeLanguage()}else this.props.oContext.socket.getSystemConfig().then(c=>{c.common.language!==j.I18n.getLanguage()&&c.common.language&&(j.I18n.setLanguage(c.common.language),this.props.oContext.changeLanguage&&this.props.oContext.changeLanguage())}).catch(c=>console.error(`Cannot read system config: ${c}`))})}},(a=this.state.selectOptions)==null?void 0:a.map(p=>M.createElement(O.MenuItem,{key:p.value,value:p.value},p.label))),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Wa extends K{scrollRef;constructor(t){super(t),this.scrollRef=M.createRef()}scrolledDown(){return this.scrollRef.current?this.scrollRef.current.offsetHeight+this.scrollRef.current.scrollTop>=this.scrollRef.current.scrollHeight:!1}componentDidMount(){super.componentDidMount(),K.getValue(this.props.data,this.props.attr)||(this.props.schema.licenseUrl?(this.setState({showLicenseDialog:!0,loading:!0,scrolledDown:!1}),fetch(this.props.schema.licenseUrl).then(t=>t.text()).then(t=>this.setState({license:t,loading:!1})).catch(t=>this.setState({license:t.toString(),loading:!1,error:!0,scrolledDown:!1}))):this.setState({showLicenseDialog:!0,scrolledDown:!1}),setTimeout(()=>{this.scrollRef.current&&(this.scrolledDown()?this.setState({scrolledDown:!0}):this.scrollRef.current.addEventListener("scroll",()=>{!this.state.scrolledDown&&this.scrolledDown()&&this.setState({scrolledDown:!0})}))},1e3))}renderItem(t,n){return this.state.showLicenseDialog?M.createElement(O.Dialog,{maxWidth:"lg",open:!0,onClose:(l,y)=>{y!=="escapeKeyDown"&&y!=="backdropClick"&&this.setState({showLicenseDialog:!1})}},M.createElement(O.DialogTitle,null,this.props.schema.title?j.I18n.t(this.props.schema.title):j.I18n.t("ra_License agreement")),M.createElement(O.DialogContent,null,this.props.schema.licenseUrl?M.createElement(M.Fragment,null,this.state.loading?M.createElement(O.LinearProgress,null):null,M.createElement("pre",{ref:this.scrollRef,style:{width:"100%",height:"100%",overflowY:"auto",fontSize:14}},this.state.license)):null,!this.props.schema.licenseUrl&&this.props.schema.texts?M.createElement("div",{ref:this.scrollRef,style:{width:"100%",height:"100%",overflowY:"auto",fontSize:14}},this.props.schema.texts.map((l,y)=>this.props.schema.noTranslation?M.createElement("p",{key:y},l):M.createElement("p",{key:y},j.I18n.t(l)))):null),M.createElement(O.DialogActions,null,this.props.schema.checkBox?M.createElement(O.FormControlLabel,{control:M.createElement(O.Checkbox,{disabled:n,checked:!!this.state.licenseChecked,onClick:()=>this.setState({licenseChecked:!this.state.licenseChecked})}),label:j.I18n.t(this.props.schema.checkBox)}):null,M.createElement(O.Button,{disabled:n||this.state.loading||this.state.error||this.props.schema.checkBox&&!this.state.licenseChecked||!this.state.scrolledDown,onClick:()=>{this.setState({showLicenseDialog:!1});const l=this.onChange(this.props.attr,!0);l instanceof Promise&&l.catch(y=>console.error(`Cannot set value: ${y}`))},color:"primary",variant:"contained",startIcon:M.createElement(X.Check,null)},this.props.schema.agreeText?j.I18n.t(this.props.schema.agreeText):j.I18n.t("ra_Accept license")),M.createElement(O.Button,{onClick:()=>{this.setState({showLicenseDialog:!1}),setTimeout(()=>this.setState({showLicenseDialog:!0}),2e3)},color:"grey",variant:"contained",startIcon:M.createElement(X.Close,null)},j.I18n.t("ra_Close")))):null}}const gi={indeterminate:{opacity:.5},control:{flexDirection:"row",width:"100%"}};class za extends K{updateTimeout;componentDidMount(){super.componentDidMount();let t=K.getValue(this.props.data,this.props.attr);if(t==null&&(t=""),Array.isArray(t)&&this.props.oContext.multiEdit){t=K.DIFFERENT_VALUE,this.setState({_value:t,oldValue:t});return}this.setState({_value:t.toString(),oldValue:t.toString()})}static getDerivedStateFromProps(t,n){if(t.schema.min!==void 0&&t.schema.min<0||t.schema.max!==void 0&&t.schema.max<0)return null;const l=K.getValue(t.data,t.attr);return t.oContext.multiEdit&&n._value===K.DIFFERENT_VALUE?{_value:K.DIFFERENT_VALUE}:l==null||n.oldValue===null||n.oldValue===void 0||l.toString()!==parseFloat(n._value).toString()&&l.toString()!==n.oldValue.toString()?{_value:l}:null}checkValue(t){if(t==null)return null;t=t.toString().trim().replace(",",".");const n=t===""?0:parseFloat(t);return t!==""&&Number.isNaN(n)?"ra_Not a number":t!==""&&window.isFinite(n)?this.props.schema.min!==void 0&&n<this.props.schema.min?"ra_Too small":this.props.schema.max!==void 0&&n>this.props.schema.max?"ra_Too big":t===""||t==="-"||Number.isNaN(n)?"ra_Not a number":null:"ra_Not a number"}renderItem(t,n){const l=Array.isArray(this.state._value)||this.state._value===K.DIFFERENT_VALUE;if(this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=void 0,this.setState({oldValue:null})},30)):this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=void 0),l){const y=K.getValue(this.props.data,this.props.attr),a=(y==null?void 0:y.filter(p=>p||p===0).map(p=>({label:p.toString(),value:p})))||[];return a.unshift({label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),M.createElement(O.Autocomplete,{style:gi.indeterminate,fullWidth:!0,freeSolo:!0,value:a[0],getOptionSelected:(p,d)=>p.label===d.label,onChange:(p,d)=>{const s=this.onChange(this.props.attr,d==null?void 0:d.value,()=>{this.setState({_value:d==null?void 0:d.value,oldValue:this.state._value})});s instanceof Promise&&s.catch(c=>console.error(c))},options:a,getOptionLabel:p=>p.label,renderInput:p=>M.createElement(O.TextField,{...p,label:this.getText(this.props.schema.label),variant:"standard",slotProps:{htmlInput:{...p.inputProps,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):void 0}},error:!!t,placeholder:this.getText(this.props.schema.placeholder),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:!!n})})}return!t&&this.state._value!==null&&this.state._value!==void 0&&this.state._value&&(t=this.checkValue(this.state._value),t&&(t=j.I18n.t(t))),M.createElement(O.FormControl,{variant:"standard",style:gi.control},M.createElement(O.TextField,{sx:{"& .up-down":{display:"none"},"&:hover .up-down":{display:"block"}},variant:"standard",type:this.props.schema.min!==void 0&&this.props.schema.min>=0?"number":"text",fullWidth:!0,slotProps:{htmlInput:{min:this.props.schema.min,max:this.props.schema.max,step:this.props.schema.step,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):null}},value:this.state._value===null||this.state._value===void 0?"":this.state._value,error:!!t,disabled:!!n,onChange:y=>{const a=y.target.value,p=this.checkValue(a);p?this.onError(this.props.attr,j.I18n.t(p)):this.onError(this.props.attr),this.setState({_value:a,oldValue:this.state._value},()=>this.onChange(this.props.attr,parseFloat(a.replace(",","."))))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:t&&typeof t=="string"?t:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}))}}class Ha extends K{authWindow;oid;url;constructor(t){super(t),this.state={...this.state,accessTokens:"",success:!1,blocked:!1,running:!1,pressed:!1},this.url=`https://oauth2.iobroker.in/${t.schema.identifier}?redirect=true`,t.schema.scope&&(this.url+=`&scope=${encodeURIComponent(t.schema.scope)}`),this.oid=`${this.props.oContext.adapterName}.${this.props.oContext.instance}.${this.props.schema.saveTokenIn||"oauth2Tokens"}`}async componentDidMount(){super.componentDidMount(),window.addEventListener?window.addEventListener("message",this.onMessage,!1):window.attachEvent("onmessage",this.onMessage,!1),await this.props.oContext.socket.subscribeState(this.oid,this.onTokensUpdated);const t=await this.props.oContext.socket.getState(this.oid);if(t){const n=JSON.parse(t.val);new Date(n.access_token_expires_on).getTime()>Date.now()&&this.setState({accessTokens:t.val})}}onTokensUpdated=(t,n)=>{if(n!=null&&n.val){const l=JSON.parse(n.val);if(new Date(l.access_token_expires_on).getTime()>Date.now()){this.state.accessTokens!==n.val&&this.setState({accessTokens:n.val});return}}this.setState({accessTokens:""})};componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener?window.removeEventListener("message",this.onMessage,!1):window.detachEvent("onmessage",this.onMessage,!1),this.props.oContext.socket.unsubscribeState(this.oid,this.onTokensUpdated)}saveToken(t){try{t&&!t.startsWith("{")&&(t=atob(t));const n=JSON.parse(t);n.access_token&&n.refresh_token&&n.expires_in&&(n.access_token_expires_on||=new Date(Date.now()+n.expires_in*1e3).toISOString(),this.props.oContext.socket.setState(this.oid,JSON.stringify(n),!0).catch(l=>console.log(`Error occurred: ${l.toString()}`)))}catch(n){console.warn(n)}}onMessage=t=>{var n,l,y;if(t.origin==="https://oauth2.iobroker.in"&&(typeof t.data=="string"&&t.data.startsWith(`${this.props.schema.identifier}-authentication:`)||typeof t.message=="string"&&t.message.startsWith(`${this.props.schema.identifier}-authentication:`))){const a=(t.data||t.message).split(":");a[1]==="success"?(this.setState({accessTokens:a[2],success:!0,pressed:!1},()=>this.saveToken(this.state.accessTokens)),(n=this.authWindow)==null||n.postMessage("close",t.origin),this.authWindow=null):(y=(l=this.props).onError)==null||y.call(l,a[2])}};onOpenUrl(){this.authWindow=window.open(this.url,this.props.schema.identifier),!this.authWindow||this.authWindow.closed||typeof this.authWindow.closed>"u"?this.setState({blocked:!0}):this.setState({pressed:!0})}renderItem(){let t="";if(this.state.accessTokens)try{const y=JSON.parse(this.state.accessTokens);t=new Date(y.access_token_expires_on).toLocaleString()}catch{}let n;this.state.accessTokens?n=this.props.schema.refreshLabel?this.getText(this.props.schema.refreshLabel):j.I18n.t("ra_Renew %s access",this.props.schema.identifier[0].toUpperCase()+this.props.schema.identifier.slice(1)):n=this.props.schema.label?this.getText(this.props.schema.label):j.I18n.t("ra_Get %s access",this.props.schema.identifier[0].toUpperCase()+this.props.schema.identifier.slice(1));const l=this.getIcon();return M.createElement("div",{style:{width:"100%",margin:"0 0 1rem 0"}},M.createElement(O.Button,{disabled:this.state.running,endIcon:l||M.createElement(X.CloudUpload,null),variant:"contained",onClick:()=>this.onOpenUrl()},n),this.state.blocked?M.createElement("div",{style:{color:"red",fontSize:16,marginTop:20}},j.I18n.t("ra_Please allow popups in your browser for this page!")):null,this.state.accessTokens?M.createElement("div",{style:{color:"green",fontSize:16,marginTop:20}},this.props.alive?j.I18n.t("ra_Successfully authorized. Token valid till %s and will be automatically renewed.",t):j.I18n.t("ra_Successfully authorized. Token valid till %s but it can expire as the instance is not running.",t)):null,this.state.pressed?M.createElement(M.Fragment,null,M.createElement("div",{style:{width:"100%",margin:"1rem 0 1rem 0"}},M.createElement("span",{style:{marginRight:4}},`${j.I18n.t("ra_If the button above does not work, you can authorize manually this app by visiting this url")}`,":"),M.createElement("br",null),M.createElement("a",{target:this.props.schema.identifier,href:this.url,rel:"noreferrer"},this.url)),M.createElement(O.TextField,{value:this.state.accessTokens,label:j.I18n.t("ra_Enter the code from that page here"),variant:"standard",onChange:y=>{let a=y.target.value;a&&!a.startsWith("{")&&(a=atob(a));try{const p=JSON.parse(a);p.access_token&&(p.access_token_expires_on=new Date(Date.now()+(p.expires_in-10)*1e3).toISOString(),this.setState({accessTokens:JSON.stringify(p)},()=>this.saveToken(this.state.accessTokens)))}catch{}},fullWidth:!0})):null)}}const mi={flex:{display:"flex"},button:{height:48,marginLeft:4,minWidth:48}};class ja extends K{componentDidMount(){super.componentDidMount();const{data:t,attr:n}=this.props,l=K.getValue(t,n)||"";this.setState({value:l,initialized:!0})}renderItem(t,n){if(!this.state.initialized)return null;const l=this.props.oContext.socket,{schema:y,attr:a}=this.props,{value:p,showSelectId:d}=this.state;return M.createElement(O.FormControl,{fullWidth:!0,variant:"standard"},y.label?M.createElement(O.InputLabel,{shrink:!0},this.getText(y.label)):null,M.createElement("div",{style:mi.flex},M.createElement(O.TextField,{variant:"standard",fullWidth:!0,value:p,error:!!t,disabled:n,placeholder:this.getText(y.placeholder),label:this.getText(y.label),helperText:this.renderHelp(y.help,y.helpLink,y.noTranslation),onChange:s=>{const c=s.target.value;this.setState({value:c},()=>this.onChange(a,c))}}),M.createElement(O.Button,{color:"grey",disabled:n,style:mi.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},"...")),d?M.createElement(j.DialogSelectID,{imagePrefix:this.props.oContext.imagePrefix===void 0?"../..":this.props.oContext.imagePrefix,dialogName:`admin.${this.props.oContext.adapterName}`,filterFunc:y.filterFunc,themeType:this.props.oContext.themeType,theme:this.props.oContext.theme,types:y.types?Array.isArray(y.types)?y.types:[y.types]:void 0,customFilter:y.customFilter,filters:y.filters,socket:l,selected:p,root:y.root,onClose:()=>this.setState({showSelectId:!1}),onOk:s=>this.setState({showSelectId:!1,value:s},()=>this.onChange(a,s))}):null)}}const wn={fullWidth:{width:"100%",display:"inline-block"},halfWidth1:{width:"calc(50% - 5px)",display:"inline-block",marginRight:8},halfWidth2:{width:"calc(50% - 5px)",display:"inline-block"}},Ut="____ppp____";class Va extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.setState({_repeat:t?Ut:"",_visible:!1,value:t?Ut:"",_notEqual:!1})}onChangePassword(t,n){t===void 0&&(t=this.state.value),n===void 0&&(n=this.state._repeat);const l=!!this.props.schema.repeat&&n!==t;this.setState({value:t,_repeat:n,_notEqual:l},()=>{if(l)this.onError(this.props.attr,j.I18n.t("ra_Passwords are not equal!"));else{this.onError(this.props.attr);const y=this.onChange(this.props.attr,t);y instanceof Promise&&y.catch(a=>this.onError(this.props.attr,a))}})}renderItem(t,n){if(this.state._notEqual===void 0)return null;const l=M.createElement(O.TextField,{variant:"standard",fullWidth:!0,type:this.state._visible&&this.state.value!==Ut?"text":"password",value:this.state.value,error:!!t||this.state._notEqual,disabled:!!n,onChange:y=>this.onChangePassword(y.target.value),label:this.getText(this.props.schema.label),slotProps:{input:{autoComplete:"new-password",endAdornment:this.state.value&&this.state.value!==Ut&&this.props.schema.visible&&!n&&!this.props.schema.readOnly?M.createElement(O.InputAdornment,{position:"end"},M.createElement(O.IconButton,{size:"large",tabIndex:-1,onClick:y=>{y.preventDefault(),y.stopPropagation(),this.setState({_visible:!this.state._visible})},edge:"end"},this.state._visible?M.createElement(X.VisibilityOff,null):M.createElement(X.Visibility,null))):void 0},htmlInput:{autoComplete:"new-password",form:{autoComplete:"off"},maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1}},helperText:this.state._notEqual?j.I18n.t("ra_Passwords are not equal!"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)});if(this.props.schema.repeat&&!this.props.schema.readOnly){const y=this.state._visible?null:M.createElement(O.TextField,{variant:"standard",fullWidth:!0,type:"password",value:this.state._repeat,error:!!t||this.state._notEqual,disabled:!!n,onChange:a=>this.onChangePassword(void 0,a.target.value),label:`${this.getText(this.props.schema.label)} (${j.I18n.t("ra_repeat")})`,slotProps:{input:{autoComplete:"new-password"},htmlInput:{autoComplete:"new-password",form:{autoComplete:"off"},maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},helperText:this.state._notEqual?j.I18n.t("ra_Passwords are not equal!"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)});return M.createElement("div",{style:wn.fullWidth},M.createElement("div",{style:wn.halfWidth1},l),M.createElement("div",{style:wn.halfWidth2},y))}return l}}class Ua extends K{renderItem(t,n){return M.createElement(O.TextField,{variant:"standard",fullWidth:!0,disabled:!!n,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?M.createElement(O.IconButton,{tabIndex:-1,size:"small",onClick:()=>{j.Utils.copyToClipboard(this.getPattern(this.props.schema.pattern,null,this.props.schema.noTranslation)),window.alert(j.I18n.t("ra_Copied"))}},M.createElement(j.IconCopy,null)):void 0}},value:this.getPattern(this.props.schema.pattern,null,!0),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const Ga={warning:{"& .Mui-error":{color:"orange"}}};class Ka extends K{updateTimeout;async componentDidMount(){super.componentDidMount();let t=K.getValue(this.props.data,this.props.attr);t==null&&(t=""),this.setState({_value:t.toString(),oldValue:t.toString()});const n=await this.props.oContext.socket.getAdapterInstances(),l=`system.adapter.${this.props.oContext.adapterName}.${this.props.oContext.instance}`,y=await this.props.oContext.socket.getObject(l),a=y==null?void 0:y.common.host,p=[];n.forEach(d=>{var c,e,i,o;if(!d||d._id===l||d.common.host!==a||!((c=d.native)!=null&&c.bind))return;if(d!=null&&d.native&&d.native.secure&&d.native.leEnabled&&d.native.leUpdate){const h=parseInt(d.native.leCheckPort||d.native.lePort,10);h&&p.push({name:`${d._id.replace("system.adapter.","")} (LE)`,port:h,v6bind:d.native.bind.includes(":")?d.native.bind:d.native.v6bind,bind:d.native.bind,enabled:!!((e=d.common)!=null&&e.enabled)})}const s=parseInt((i=d==null?void 0:d.native)==null?void 0:i.port,10);s&&p.push({name:d._id.replace("system.adapter.",""),bind:d.native.bind,v6bind:d.native.bind.includes(":")?d.native.bind:d.native.v6bind,port:s,enabled:!!((o=d.common)!=null&&o.enabled)})}),this.setState({ports:p})}static getDerivedStateFromProps(t,n){const l=K.getValue(t.data,t.attr);return l==null||n.oldValue===null||n.oldValue===void 0||l.toString()!==parseInt(n._value,10).toString()&&l.toString()!==n.oldValue.toString()?{_value:l}:null}checkValue(t){if(t==null)return null;const n=this.props.schema.min===void 0?20:this.props.schema.min,l=this.props.schema.max||65535;t=t.toString().trim();const y=t===""?0:parseInt(t,10);return t!==""&&Number.isNaN(y)?"ra_Not a number":t!==""&&window.isFinite(Number(t))?y<n?"ra_Too small":y>l?"ra_Too big":t===""||t==="-"||Number.isNaN(y)?"ra_Not a number":null:"ra_Not a number"}renderItem(t,n){this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=void 0,this.setState({oldValue:null})},30)):this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=void 0);const l=this.props.schema.min===void 0?20:this.props.schema.min,y=this.props.schema.max||65535;let a;if(this.state.ports){const p=parseInt(this.state._value,10);if(p){const d=this.state.ports.filter(c=>!this.props.data.bind||this.props.data.bind===c.bind||this.props.data.bind==="0.0.0.0"||c.bind==="0.0.0.0");let s=d.findIndex(c=>c.port===p&&c.enabled);s!==-1?t=j.I18n.t("ra_Port is already used by %s",this.state.ports[s].name):(s=d.findIndex(c=>c.port===p&&!c.enabled),s!==-1&&(a=!0,t=j.I18n.t("ra_Port could be used by %s",this.state.ports[s].name)))}}return!t&&this.state._value!==null&&this.state._value!==void 0&&(t=this.checkValue(this.state._value),typeof t=="string"&&(t=j.I18n.t(t))),M.createElement(O.TextField,{variant:"standard",type:"number",fullWidth:!0,slotProps:{htmlInput:{min:l,max:y,readOnly:this.props.schema.readOnly||!1}},value:this.state._value===null||this.state._value===void 0?"":this.state._value,error:!!t,disabled:!!n,sx:a?Ga.warning:void 0,onChange:p=>{const d=Number(p.target.value.toString().replace(/[^0-9]/g,"")).toString(),s=this.checkValue(d);s?this.onError(this.props.attr,j.I18n.t(s)):this.onError(this.props.attr),this.setState({_value:d,oldValue:this.state._value},()=>{if(d.trim()===parseInt(d,10).toString()){const c=this.onChange(this.props.attr,parseInt(d,10)||0);c instanceof Promise&&c.catch(e=>{console.error(`Cannot set value for ${this.props.attr}: ${e}`)})}})},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:t&&typeof t=="string"?t:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}class Ja extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums("rooms").then(n=>{const l=Object.keys(n).map(y=>({value:this.props.schema.short?y.replace("enum.rooms.",""):y,label:this.getText(n[y].common.name),obj:n[y]}));this.props.schema.allowDeactivate!==!1&&l.unshift({label:j.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.setState({value:t,selectOptions:l})}).catch(n=>console.error(`Cannot get enums: ${n}`))}renderItem(t,n){if(!this.state.selectOptions)return null;const l=this.state.selectOptions.find(y=>y.value===this.state.value);return M.createElement(O.FormControl,{variant:"standard",fullWidth:!0},this.props.schema.label?M.createElement(O.InputLabel,null,this.getText(this.props.schema.label)):null,M.createElement(O.Select,{variant:"standard",error:!!t,disabled:!!n,value:this.state.value||"_",renderValue:()=>l?l.obj?M.createElement(j.TextWithIcon,{value:l.obj,themeType:this.props.oContext.themeType,lang:j.I18n.getLanguage()}):l.label:"",onChange:y=>{this.setState({value:y.target.value==="_"?"":y.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(y=>M.createElement(O.MenuItem,{key:y.value,value:y.value,style:y.value===K.DIFFERENT_VALUE?{opacity:.5}:{}},y.obj?M.createElement(j.TextWithIcon,{value:y.obj,themeType:this.props.oContext.themeType,lang:j.I18n.getLanguage()}):y.label))),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Ya={noMargin:{"&>div":{marginTop:0}}};class Qa extends K{initialValue="";componentDidMount(){super.componentDidMount();let t=K.getValue(this.props.data,this.props.attr);this.props.schema.multiple&&(typeof t=="string"?t=[t]:t==null&&(t=[]));const n=[];(this.props.schema.options||[]).forEach(l=>{const y=l;Array.isArray(y.items)?(n.push({label:this.getText(l.label,this.props.schema.noTranslation),value:l.value,group:!0,color:l.color}),y.items.forEach(a=>n.push({label:this.getText(a.label,this.props.schema.noTranslation),value:a.value,hidden:a.hidden,color:l.color}))):n.push({label:this.getText(l.label,this.props.schema.noTranslation),value:l.value,hidden:l.hidden,color:l.color})}),Array.isArray(t)&&!this.props.schema.multiple?(this.initialValue=[...t],n.unshift({label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),this.setState({value:K.DIFFERENT_VALUE,selectOptions:n})):this.setState({value:t,selectOptions:n})}_getValue(){let t=this.state.value===null||this.state.value===void 0?K.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof t=="string"?t=[t]:t==null&&(t=[])),t}renderItem(t,n){if(!this.state.selectOptions)return null;const l=(this.state.selectOptions||[]).filter(p=>p.hidden?this.props.custom?!this.executeCustom(p.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!this.execute(p.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!0),y=this._getValue(),a=this.props.schema.multiple?null:l.find(p=>p.value==y);return M.createElement(O.FormControl,{variant:"standard",fullWidth:!0,sx:this.props.table!==void 0&&Ya.noMargin,id:`jsonSelect_${this.props.attr}_${this.props.index||this.props.index===0?this.props.index:""}`},this.props.schema.label?M.createElement(O.InputLabel,null,this.getText(this.props.schema.label)):null,M.createElement(O.Select,{variant:"standard",error:!!t,multiple:this.props.schema.multiple,disabled:!!n,value:y||"_",renderValue:p=>this.props.schema.multiple?M.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:.5}},p.map(d=>{const s=l.find(c=>c.value===d);if(s||this.props.schema.showAllValues!==!1){const c=(s==null?void 0:s.label)||d;return M.createElement(O.Chip,{key:d,label:c})}return null})):a!=null&&a.color?M.createElement("div",{style:{color:a.color}},(a==null?void 0:a.label)===void 0?p:a.label):(a==null?void 0:a.label)===void 0?p:a.label,onChange:p=>{this.setState({value:p.target.value==="_"?"":p.target.value},()=>{let d;this.state.value===K.DIFFERENT_VALUE?d=this.onChange(this.props.attr,this.initialValue):d=this.onChange(this.props.attr,this.state.value),d instanceof Promise&&d.catch(s=>console.error(s))})}},l.map((p,d)=>p.group?M.createElement(O.ListSubheader,{key:d,style:{color:p.color}},p.label):M.createElement(O.MenuItem,{key:d,value:p.value,style:p.value===K.DIFFERENT_VALUE?{opacity:.5}:{}},this.props.schema.multiple?M.createElement(O.Checkbox,{checked:y.includes(p.value),onClick:()=>{const s=JSON.parse(JSON.stringify(this._getValue())),c=y.indexOf(p.value);c!==-1?s.splice(c,1):(s.push(p.value),s.sort()),this.setState({value:s},()=>this.onChange(this.props.attr,s))}}):null,M.createElement(O.ListItemText,{primary:p.label,style:{color:p.color}})))),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Xa={menuPaper:{maxHeight:800}};class Za extends K{initialized=!1;localContext;askInstance(){if(this.props.alive){let t=this.props.schema.data;if(t===void 0&&this.props.schema.jsonData){const n=this.getPattern(this.props.schema.jsonData,null,!0);try{t=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${n}`)}}t===void 0&&(t=null),this.setState({running:!0},()=>{this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",t).then(n=>this.setState({list:n,running:!1})).catch(n=>{console.error(`Cannot send command: ${n}`)})})}else{const t=K.getValue(this.props.data,this.props.attr);this.setState({value:t,running:!1})}}getContext(){const t={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(n=>t[n]=K.getValue(this.props.data,n)),JSON.stringify(t)}_getValue(){let t=this.state.value===null||this.state.value===void 0?K.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof t=="string"?t=[t]:t==null&&(t=[])),t}renderItem(t,n){var p;if(this.props.alive){const d=this.getContext();(d!==this.localContext||!this.initialized)&&(this.localContext=d,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}const l=this._getValue();if(!this.props.alive||!this.state.running&&!((p=this.state.list)!=null&&p.length))return this.props.schema.multiple||this.props.schema.manual===!1?j.I18n.t("ra_Cannot retrieve options, as instance is offline"):M.createElement(O.TextField,{variant:"standard",fullWidth:!0,value:l,error:!!t,disabled:!!n,onChange:d=>{const s=d.target.value;this.setState({value:s},()=>this.onChange(this.props.attr,(s||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),slotProps:{input:{endAdornment:this.state.value&&!this.props.schema.noClearButton?M.createElement(O.InputAdornment,{position:"end"},M.createElement(O.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({value:""},()=>this.onChange(this.props.attr,""))},M.createElement(X.Close,null))):null}}});if(this.state.running)return M.createElement(O.CircularProgress,{size:"24"});const y=this.state.list.filter(d=>d.hidden?this.props.custom?!this.executeCustom(d.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!this.execute(d.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!0),a=y.find(d=>d.value===l);return M.createElement(O.FormControl,{variant:"standard",fullWidth:!0},this.props.schema.label?M.createElement(O.InputLabel,null,this.getText(this.props.schema.label)):null,M.createElement(O.Select,{variant:"standard",error:!!t,multiple:this.props.schema.multiple,disabled:!!n,sx:{"&.MuiSelect-paper":this.props.schema.multiple?Xa.menuPaper:void 0},value:l,renderValue:d=>this.props.schema.multiple?M.createElement(O.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5}},d.map(s=>{const c=y.find(e=>e.value===s);if(c||this.props.schema.showAllValues!==!1){const e=(c==null?void 0:c.label)||s;return M.createElement(O.Chip,{key:s,label:e})}return null})):this.getText((a==null?void 0:a.label)||d,this.props.schema.noTranslation),onChange:d=>{const s=this.onChange(this.props.attr,d.target.value);s instanceof Promise&&s.catch(c=>console.error(`Cannot set value: ${c}`))}},y.map((d,s)=>d.group?M.createElement(O.ListSubheader,{key:s},this.getText(d.label,this.props.schema.noTranslation)):M.createElement(O.MenuItem,{key:s,value:d.value},this.props.schema.multiple?M.createElement(O.Checkbox,{checked:l.includes(d.value),onClick:()=>{const c=JSON.parse(JSON.stringify(this._getValue())),e=l.indexOf(d.value);e!==-1?c.splice(e,1):(c.push(d.value),c.sort()),this.setState({value:c},()=>this.onChange(this.props.attr,c))}}):null,M.createElement(O.ListItemText,{primary:d.label})))),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const vi={fullWidth:{width:"100%"}};function Qe(L){return L.split(".").reduce((t,n)=>(t<<8)+parseInt(n,10),0)>>>0}function qa(L,t){var y,a;const n=(a=(y=L==null?void 0:L.native)==null?void 0:y.hardware)==null?void 0:a.networkInterfaces;if(!n)return null;let l;return Object.keys(n).forEach(p=>n[p].forEach(d=>{d.internal||t.includes(":")&&d.family!=="IPv6"||t.includes(".")&&!t.match(/[^.\d]/)&&d.family!=="IPv4"||(d.family==="IPv4"&&!d.address.startsWith("172")&&(t==="127.0.0.0"||t==="localhost"||t.match(/[^.\d]/))?l=d.address:l||(d.family==="IPv4"&&t.includes(".")&&(Qe(t)&Qe(d.netmask),Qe(d.address)&Qe(d.netmask)),l=d.address))})),l||Object.keys(n).forEach(p=>n[p].forEach(d=>{d.internal||t.includes(":")&&d.family!=="IPv6"||t.includes(".")&&!t.match(/[^.\d]/)&&d.family!=="IPv4"||(d.family==="IPv6"&&(t==="127.0.0.0"||t==="localhost"||t.match(/[^.\d]/))?l=d.address:l||(d.family==="IPv4"&&t.includes(".")&&(Qe(t)&Qe(d.netmask),Qe(d.address)&Qe(d.netmask)),l=d.address))})),l||Object.keys(n).forEach(p=>{n[p].forEach(d=>{d.internal||t.includes(":")&&d.family!=="IPv6"||t.includes(".")&&!t.match(/[^.\d]/)&&d.family!=="IPv4"||(t==="127.0.0.0"||t==="localhost"||t.match(/[^.\d]/),l=d.address)})}),l||Object.keys(n).forEach(p=>{n[p].forEach(d=>{d.internal||(l=d.address)})}),l}class yi extends K{async componentDidMount(){var n;super.componentDidMount();let t=window.location.hostname;if(this.props.schema.openUrl){const l=await this.props.oContext.socket.getCurrentInstance(),y=await this.props.oContext.socket.getObject(`system.adapter.${l}`);if(y){const a=await this.props.oContext.socket.getObject(`system.host.${(n=y==null?void 0:y.common)==null?void 0:n.host}`);if(a){const p=qa(a,window.location.hostname);if(p)t=`${p}:${window.location.port}`;else{console.warn(`Cannot find suitable IP in host ${y.common.host} for ${y._id}`);return}}}}await new Promise(l=>{this.setState({_error:"",_message:"",hostname:t},l)}),this.props.schema.onLoaded&&this._onClick()}renderErrorDialog(){return this.state._error?M.createElement(j.DialogError,{text:this.state._error,onClose:()=>this.setState({_error:""})}):null}renderMessageDialog(){return this.state._message?M.createElement(j.DialogMessage,{text:this.state._message,onClose:()=>this.setState({_message:""})}):null}_onClick(){this.props.oContext.onCommandRunning(!0),this.setState({running:!0});const t=`${window.location.protocol}//${window.location.host}${window.location.pathname.replace(/\/index\.html$/,"")}`,n=`${window.location.protocol}//${this.state.hostname.split(":").length>3?`[${this.state.hostname}]`:this.state.hostname}${window.location.pathname.replace(/\/index\.html$/,"")}`;let l=this.props.schema.data;if(l===void 0&&this.props.schema.jsonData){const a=this.getPattern(this.props.schema.jsonData,{_origin:t,_originIp:n,...this.props.data},!0);try{l=JSON.parse(a)}catch{console.error(`Cannot parse json data: ${a}`)}}l===void 0&&(l=null),this.props.schema.openUrl&&!l&&(l={_origin:t,_originIp:n});let y;this.props.schema.timeout&&(y=setTimeout(()=>{this.props.oContext.onCommandRunning(!1),this.setState({_error:j.I18n.t("ra_Request timed out"),running:!1})},parseInt(this.props.schema.timeout,10)||1e4)),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",l).then(async a=>{var p,d,s,c,e;if(y&&(clearTimeout(y),y=void 0),a!=null&&a.error)if(this.props.schema.error&&this.props.schema.error[a.error]){let i=this.getText(this.props.schema.error[a.error]);(p=a.args)==null||p.forEach(o=>i=i.replace("%s",o)),this.setState({_error:i})}else this.setState({_error:a.error?typeof a.error=="string"?j.I18n.t(a.error):JSON.stringify(a.error):j.I18n.t("ra_Error")});else{if(a!=null&&a.command){(s=(d=this.props.oContext).onBackEndCommand)==null||s.call(d,a.command);return}if(a!=null&&a.reloadBrowser&&this.props.schema.reloadBrowser)window.location.reload();else if(a!=null&&a.openUrl&&this.props.schema.openUrl)window.open(a.openUrl,a.window||this.props.schema.window||"_blank");else if(a!=null&&a.result&&((c=this.props.schema.result)!=null&&c[a.result])){let i=this.getText(this.props.schema.result[a.result]);(e=a.args)==null||e.forEach(o=>i=i.replace("%s",o)),window.alert(i)}if(a!=null&&a.native&&this.props.schema.useNative){for(const[i,o]of Object.entries(a.native))await this.onChangeAsync(i,o);setTimeout(()=>this.props.oContext.forceUpdate(Object.keys(a.native),this.props.data),300)}else a!=null&&a.result?window.alert(typeof a.result=="object"?JSON.stringify(a.result):a.result):window.alert(j.I18n.t("ra_Ok"));a!=null&&a.saveConfig&&this.props.onChange(null,null,null,!0)}}).catch(a=>{this.props.schema.error&&this.props.schema.error[a.toString()]?this.setState({_error:this.getText(this.props.schema.error[a.toString()])}):this.setState({_error:j.I18n.t(a.toString())||j.I18n.t("ra_Error")})}).then(()=>{this.props.oContext.onCommandRunning(!1),this.setState({running:!1})})}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const t=this.state.confirmData||this.props.schema.confirm;let n=null;return t.type==="warning"?n=M.createElement(X.Warning,null):t.type==="error"?n=M.createElement(X.Error,null):t.type==="info"&&(n=M.createElement(X.Info,null)),M.createElement(j.DialogConfirm,{title:this.getText(t.title)||j.I18n.t("ra_Please confirm"),text:this.getText(t.text),ok:this.getText(t.ok)||j.I18n.t("ra_Ok"),cancel:this.getText(t.cancel)||j.I18n.t("ra_Cancel"),icon:n||void 0,onClose:l=>this.setState({confirmDialog:!1},()=>l&&this._onClick())})}renderItem(t,n){const l=this.getIcon();return M.createElement("div",{style:vi.fullWidth},M.createElement(O.Button,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:{...vi.fullWidth,...this.props.schema.controlStyle||void 0},disabled:n||!this.props.alive,startIcon:l,title:this.props.alive?this.getText(this.props.schema.title)||"":j.I18n.t("ra_Instance is not alive"),onClick:()=>{this.props.schema.confirm?this.setState({confirmDialog:!0}):this._onClick()}},this.props.schema.showProcess&&this.state.running?M.createElement(O.CircularProgress,{size:20,style:{marginRight:8}}):null,this.getText(this.props.schema.label,this.props.schema.noTranslation)),this.renderErrorDialog(),this.renderMessageDialog())}}const el={fullWidth:{width:"100%"}};class tl extends K{async _onClick(){var l,y;let t=this.props.schema.val;if(typeof t=="string"&&t.includes("${")){t=this.getPattern(t,null,!0);const a=await this.props.oContext.socket.getObject(this.props.schema.id);((l=a==null?void 0:a.common)==null?void 0:l.type)==="number"?t=parseFloat(t):((y=a==null?void 0:a.common)==null?void 0:y.type)==="boolean"&&(t=t==="true"||t===!0||t==="1"||t===1)}const n=(this.props.schema.id||"").replace(/%INSTANCE%/g,(this.props.oContext.instance||0).toString());try{await this.props.oContext.socket.setState(n,{val:t,ack:!!this.props.schema.ack}),this.props.schema.okText&&window.alert(this.getText(this.props.schema.okText))}catch(a){this.props.schema.error&&this.props.schema.error[a.toString()]?window.alert(this.getText(this.props.schema.error[a.toString()])):window.alert(j.I18n.t(a.toString())||j.I18n.t("ra_Error"))}}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const t=this.state.confirmData||this.props.schema.confirm;let n=null;return t.type==="warning"?n=M.createElement(X.Warning,null):t.type==="error"?n=M.createElement(X.Error,null):t.type==="info"&&(n=M.createElement(X.Info,null)),M.createElement(j.DialogConfirm,{title:this.getText(t.title)||j.I18n.t("ra_Please confirm"),text:this.getText(t.text),ok:this.getText(t.ok)||j.I18n.t("ra_Ok"),cancel:this.getText(t.cancel)||j.I18n.t("ra_Cancel"),icon:n,onClose:l=>this.setState({confirmDialog:!1},()=>l&&this._onClick())})}renderItem(t,n){const l=this.getIcon();return M.createElement(O.Button,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:el.fullWidth,disabled:n,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0}):await this._onClick()},startIcon:l||void 0},this.getText(this.props.schema.label,this.props.schema.noTranslation))}}const bi={fullWidth:{width:"100%"},slider:{marginLeft:10,marginRight:10,width:"calc(100% - 20px)"}};class nl extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.setState({_value:t})}static getDerivedStateFromProps(t,n){if(t.schema.min!==void 0&&t.schema.min<0||t.schema.max!==void 0&&t.schema.max<0)return null;const l=K.getValue(t.data,t.attr);return l==null||l.toString()!==parseFloat(n._value).toString()?{_value:l}:null}renderItem(t,n){const l=this.props.schema.min||0,y=this.props.schema.max||100,a=this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):"",p=[{value:l,label:l+a},{value:y,label:y+a}];return M.createElement(O.Box,{style:bi.fullWidth},this.props.schema.label?M.createElement(O.Typography,{gutterBottom:!0},this.getText(this.props.schema.label)):null,M.createElement(O.Slider,{style:bi.slider,value:this.state._value,getAriaValueText:d=>d+a,step:this.props.schema.step||(y-l)/100,valueLabelDisplay:"auto",marks:p,min:l,max:y,disabled:!!n,onChange:d=>{const s=d.target.value;this.setState({_value:s},()=>this.onChange(this.props.attr,s))}}),this.props.schema.help?M.createElement(O.Typography,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}function Xe(L,t){return L==="edit"||L==="rename"?M.createElement(X.Edit,{style:t}):L==="delete"?M.createElement(X.Delete,{style:t}):L==="refresh"?M.createElement(X.Refresh,{style:t}):L==="newDevice"||L==="new"||L==="add"?M.createElement(X.Add,{style:t}):L==="discover"||L==="search"?M.createElement(X.Search,{style:t}):L==="unpairDevice"||L==="unpair"?M.createElement(X.LinkOff,{style:t}):L==="pairDevice"||L==="pair"?M.createElement(X.Link,{style:t}):L==="identify"?M.createElement(X.NotListedLocation,{style:t}):L==="play"?M.createElement(X.PlayArrow,{style:t}):L==="stop"?M.createElement(X.Stop,{style:t}):L==="pause"?M.createElement(X.Pause,{style:t}):L==="forward"||L==="next"?M.createElement(X.FastForward,{style:t}):L==="rewind"||L==="previous"?M.createElement(X.FastRewind,{style:t}):L==="lamp"||L==="light"?M.createElement(X.Lightbulb,{style:t}):L==="backlight"?M.createElement(X.Fluorescent,{style:t}):L==="dimmer"?M.createElement(X.WbIncandescent,{style:t}):L==="socket"?M.createElement(X.Power,{style:t}):L==="settings"?M.createElement(X.Settings,{style:t}):L==="users"||L==="group"?M.createElement(X.Group,{style:t}):L==="user"?M.createElement(X.Person,{style:t}):L==="qrcode"?M.createElement(X.QrCode,{style:t}):L==="connection"?M.createElement(X.Wifi,{style:t}):L==="no-connection"?M.createElement(X.WifiOff,{style:t}):L==="visible"?M.createElement(X.Visibility,{style:t}):null}function il(L,t){return typeof t=="string"?{"@keyframes newStateAnimationOnceColor":{"0%":{color:t},"100%":{color:L.palette.mode==="dark"?"#fff":"#000"}},animation:"newStateAnimationOnceColor 2s ease-in-out"}:{"@keyframes newStateAnimationOnce":{"0%":{color:"#00f900"},"80%":{color:L.palette.mode==="dark"?"#518851":"#008000"},"100%":{color:L.palette.mode==="dark"?"#fff":"#000"}},animation:"newStateAnimationOnce 2s ease-in-out"}}class rl extends K{controlTimeout=null;delayedUpdate={timer:null,value:null};getObjectID(){let t=this.props.schema.oid;return t.includes("${")&&(t=this.getPattern(t,null,!0)),this.props.schema.foreign?t:`${this.props.schema.system?"system.adapter.":""}${this.props.oContext.adapterName}.${this.props.oContext.instance||0}.${t}`}async componentDidMount(){var l,y;super.componentDidMount();const t=await this.props.oContext.socket.getObject(this.getObjectID());if((l=t==null?void 0:t.common)!=null&&l.states&&!this.props.schema.options){if(Array.isArray((y=t==null?void 0:t.common)==null?void 0:y.states)){const a={};t.common.states.forEach((p,d)=>{a[d.toString()]=p}),t.common.states=a}Object.keys(t.common.states).length||(t.common.states=void 0)}const n=this.props.schema.control||this.detectType(t);try{const a=await this.props.oContext.socket.getState(this.getObjectID());this.setState({stateValue:a?a.val:null,controlType:n,obj:t},async()=>{await this.props.oContext.socket.subscribeState(this.getObjectID(),this.onStateChanged)})}catch(a){console.error(`Cannot get state ${this.getObjectID()}: ${a}`),this.setState({controlType:n,obj:t})}}componentWillUnmount(){super.componentWillUnmount(),this.props.oContext.socket.unsubscribeState(this.getObjectID(),this.onStateChanged),this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null),this.controlTimeout&&(clearTimeout(this.controlTimeout),this.controlTimeout=null,this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!1).catch(t=>console.error(`Cannot control value: ${t.toString()}`)))}onStateChanged=(t,n)=>{let l=n?n.val:null;this.state.controlType==="button"||this.state.controlType==="switch"?(l=!!l,this.state.stateValue!==l&&this.setState({stateValue:l})):l!==null&&(this.state.controlType==="slider"||this.state.controlType==="number")?(l=parseFloat(l),console.log(`${Date.now()} Received new value: ${l}`),l!==this.state.stateValue?(this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null),this.delayedUpdate.value=l,this.delayedUpdate.timer=setTimeout(()=>{this.setState({stateValue:this.delayedUpdate.value})},500)):this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null)):this.state.stateValue.toString()!==l.toString()&&this.setState({stateValue:l})};detectType(t){if(t||={},t.common||={},t.common.type==="boolean"){if(this.props.schema.controlled!==!1){if(t.common.read===!1||this.props.schema.controlled===!0)return"button";if(t.common.write||this.props.schema.controlled===!0)return"switch"}return"text"}return t.common.type==="number"&&this.props.schema.controlled!==!1?t.common.write||this.props.schema.controlled===!0?t.common.states||this.props.schema.options?"select":t.common.max!==void 0?"slider":"input":"text":t.common.write&&this.props.schema.controlled!==!1?t.common.states||this.props.schema.options?"select":"input":"text"}getNormalizedStates(){let t;return this.props.schema.options?t=this.props.schema.options.map(n=>typeof n=="string"?{value:n,label:this.getText(n,this.props.schema.noTranslation)}:{value:n.value,label:this.getText(n.label,this.props.schema.noTranslation),color:n.color}):this.state.obj.common.states?(t=[],Object.keys(this.state.obj.common.states).forEach(n=>{t.push({value:n,label:this.getText(this.state.obj.common.states[n],this.props.schema.noTranslation)})})):t=[],t}renderItem(t,n){var y,a,p,d,s;if(!this.state.obj)return null;let l;if(this.state.controlType==="select"||!this.state.controlType&&(this.state.obj.common.type==="number"||this.state.obj.common.type==="string")&&this.state.obj.common.write!==!1&&(this.props.schema.options||this.state.obj.common.states)){const c=this.getNormalizedStates(),e=c.find(i=>i.value===this.state.stateValue);l=M.createElement(O.FormControl,{fullWidth:!0},M.createElement(O.InputLabel,null,"$",this.getText(this.props.schema.label)),M.createElement(O.Select,{value:this.state.stateValue,disabled:!!this.props.schema.readOnly||n,onChange:i=>{this.setState({stateValue:i.target.value},()=>{let o=this.state.stateValue;this.state.obj.common.type==="number"&&(o=parseFloat(o.toString().replace(",","."))),this.props.oContext.socket.setState(this.getObjectID(),o,!1)})},renderValue:i=>e!=null&&e.color?M.createElement("div",{style:{color:e.color}},e.label):i},c.map(i=>M.createElement(O.MenuItem,{key:(i.value??"").toString(),value:i.value,style:{color:i.color}},"$",i.label))))}else if(this.state.controlType==="button"||!this.state.controlType&&this.state.obj.common.type==="boolean"&&(this.state.obj.common.write&&this.state.obj.common.read===!1||(y=this.state.obj.common.role)!=null&&y.includes("button"))){let c=null;this.props.schema.falseImage&&(c=Xe(this.props.schema.falseImage));const e=this.getText(this.props.schema.falseText||this.props.schema.label,this.props.schema.noTranslation);!e&&c?l=M.createElement(O.IconButton,{style:this.props.schema.falseTextStyle,disabled:!!this.props.schema.readOnly,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async i=>{i&&await this.props.oContext.socket.setState(this.getObjectID(),this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}}):await this.props.oContext.socket.setState(this.getObjectID(),this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}},c):l=M.createElement(O.Button,{variant:this.props.schema.variant||"contained",startIcon:c,style:this.props.schema.falseTextStyle,disabled:n||!!this.props.schema.readOnly,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async i=>{i&&await this.props.oContext.socket.setState(this.getObjectID(),this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}}):await this.props.oContext.socket.setState(this.getObjectID(),this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}},e||this.getObjectID().split(".").pop())}else if(this.state.controlType==="input"||!this.state.controlType&&this.state.obj.common.write&&this.state.obj.common.type==="string")l=M.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",gap:8,alignItems:"baseline"}},M.createElement(O.TextField,{style:{flex:1},value:this.state.stateValue,variant:"standard",disabled:!!this.props.schema.readOnly||n,slotProps:{input:{endAdornment:this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||void 0},htmlInput:{readOnly:!!this.props.schema.readOnly}},onKeyUp:c=>{this.props.schema.setOnEnterKey&&c.key==="Enter"&&this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!1)},onChange:c=>{this.setState({stateValue:c.target.value},()=>{this.props.schema.setOnEnterKey||this.props.schema.showEnterButton||(this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{this.controlTimeout=null;let e=this.state.stateValue;this.state.obj.common.type==="number"&&(e=parseFloat(e.toString().replace(",","."))),await this.props.oContext.socket.setState(this.getObjectID(),e,!1)},this.props.schema.controlDelay||0))})},label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}),this.props.schema.showEnterButton&&!this.props.schema.readOnly&&M.createElement(O.Button,{variant:"outlined",disabled:n,onClick:()=>{this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!1)}},this.getText(typeof this.props.schema.showEnterButton=="string"?this.props.schema.showEnterButton:"Set")));else{let c;this.props.schema.size==="normal"?c=16:this.props.schema.size==="large"?c=20:typeof this.props.schema.size=="number"&&(c=this.props.schema.size);let e=this.getText(this.props.schema.label,this.props.schema.noTranslation);const i={display:"flex",alignItems:"center",fontSize:c||"1rem",gap:8};this.props.schema.narrow||(i.width="100%",i.justifyContent="space-between"),e.trim()&&!e.trim().endsWith(":")&&this.props.schema.addColon&&(e=`${e.trim()}:`);let o;this.props.schema.blinkOnUpdate&&(o=il(this.props.oContext.theme,this.props.schema.blinkOnUpdate));let h;this.props.schema.labelIcon&&(h=M.createElement(j.Icon,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let r;if(e&&h?r=M.createElement("div",{style:{whiteSpace:"nowrap"}},h,e):e?r=M.createElement("div",{style:{whiteSpace:"nowrap"}},e):h&&(r=h),this.state.controlType==="switch"||!this.state.controlType&&this.state.obj.common.type==="boolean"&&(this.state.obj.common.write&&this.state.obj.common.read!==!1||(a=this.state.obj.common.role)!=null&&a.includes("switch"))){let u=null;const f=this.getText(this.props.schema.falseText,this.props.schema.noTranslation);this.props.schema.falseImage&&(u=Xe(this.props.schema.falseImage,f?{marginLeft:8}:void 0));let g=null;const v=this.getText(this.props.schema.trueText,this.props.schema.noTranslation);this.props.schema.trueImage&&(g=Xe(this.props.schema.trueImage,v?{marginRight:8}:void 0)),l=M.createElement(O.Switch,{checked:!!this.state.stateValue,disabled:!!this.props.schema.readOnly||n,onChange:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async A=>{A&&await this.props.oContext.socket.setState(this.getObjectID(),!this.state.stateValue,!1)}}):await this.props.oContext.socket.setState(this.getObjectID(),!this.state.stateValue,!1)}}),(f||u||v||g)&&(l=M.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:14}},M.createElement("span",{style:this.props.schema.falseTextStyle},f,u),l,M.createElement("span",{style:this.props.schema.trueTextStyle},g,v))),r&&(l=M.createElement("div",{style:i},r,l))}else if(this.state.controlType==="slider"||!this.state.controlType&&this.state.obj.common.type==="number"&&(this.state.obj.common.write&&(this.state.obj.common.max!==void 0||this.state.obj.common.unit==="%")||(p=this.state.obj.common.role)!=null&&p.includes("slider")||(d=this.state.obj.common.role)!=null&&d.includes("dimmer")||(s=this.state.obj.common.role)!=null&&s.includes("blind"))){let u=null;const f=this.getText(this.props.schema.falseText,this.props.schema.noTranslation);this.props.schema.falseImage&&(u=Xe(this.props.schema.falseImage,f?{marginLeft:8}:void 0));let g=null;const v=this.getText(this.props.schema.trueText,this.props.schema.noTranslation);this.props.schema.trueImage&&(g=Xe(this.props.schema.trueImage,v?{marginRight:8}:void 0));const A=this.props.schema.min===void 0?this.state.obj.common.min||0:this.props.schema.min,E=this.props.schema.max===void 0?this.state.obj.common.max===void 0?100:this.state.obj.common.max:this.props.schema.max,w=this.props.schema.step===void 0?this.state.obj.common.step||1:this.props.schema.step;l=M.createElement(O.Slider,{style:{width:"100%",flexGrow:1},min:A,max:E,disabled:!!this.props.schema.readOnly||n,step:w,value:this.state.stateValue,valueLabelDisplay:"auto",valueLabelFormat:m=>`${m}${this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||""}`,onChange:(m,S)=>{this.setState({stateValue:S},()=>{this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{console.log(`${Date.now()} Send new value: ${this.state.stateValue}`),this.controlTimeout=null,await this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!1)},this.props.schema.controlDelay||0)})}}),(f||u||v||g)&&(l=M.createElement("div",{style:{display:"flex",width:"100%",flexGrow:1,alignItems:"center"}},M.createElement("span",{style:{marginRight:16,...this.props.schema.falseTextStyle}},f,u),l,M.createElement("span",{style:{marginLeft:16,...this.props.schema.trueTextStyle}},g,v))),r&&(l=M.createElement("div",{style:i},r,l))}else if(this.state.obj.common.type==="number"&&this.state.obj.common.write&&!this.state.controlType){const u=this.props.schema.min===void 0?this.state.obj.common.min===void 0?void 0:this.state.obj.common.min:this.props.schema.min,f=this.props.schema.max===void 0?this.state.obj.common.max===void 0?void 0:this.state.obj.common.max:this.props.schema.max,g=this.props.schema.step===void 0?this.state.obj.common.step===void 0?void 0:this.state.obj.common.step:this.props.schema.step;l=M.createElement(O.TextField,{variant:"standard",style:{width:"100%"},value:this.state.stateValue,type:"number",disabled:!!this.props.schema.readOnly||n,slotProps:{htmlInput:{min:u,max:f,step:g,readOnly:!!this.props.schema.readOnly},input:{endAdornment:this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||void 0}},onChange:v=>{this.setState({stateValue:v.target.value},()=>{this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{this.controlTimeout=null;const A=parseFloat(this.state.stateValue);await this.props.oContext.socket.setState(this.getObjectID(),A,!1)},this.props.schema.controlDelay||0)})},label:this.getText(this.props.schema.label,this.props.schema.noTranslation),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}else if(this.state.obj.common.type==="boolean"){let u=null,f,g;this.state.stateValue?(f=this.getText(this.props.schema.trueText,this.props.schema.noTranslation),this.props.schema.trueImage&&(u=Xe(this.props.schema.falseImage,f?{marginRight:8}:void 0)),g=this.props.schema.trueTextStyle):(f=this.getText(this.props.schema.falseText,this.props.schema.noTranslation),this.props.schema.falseImage&&(u=Xe(this.props.schema.falseImage,f?{marginLeft:8}:void 0)),g=this.props.schema.falseTextStyle),g=Object.assign(i,g),l=M.createElement("div",{style:g},r,M.createElement(O.Box,{style:{display:"flex",alignItems:"center",gap:8},sx:o,key:this.props.schema.blinkOnUpdate?f:void 0},u,f||(this.state.stateValue?j.I18n.t("ra_true"):j.I18n.t("ra_false"))))}else{const u=this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit;let f=this.state.stateValue;if(f!=null&&(this.props.schema.options||this.state.obj.common.states)){const E=this.getNormalizedStates().find(w=>w.value===f);E&&(f=E.label)}let g,v;this.state.controlType==="html"?(v=(f||"").toString(),g=M.createElement("span",{dangerouslySetInnerHTML:{__html:f}})):this.state.stateValue===null?(g="null",v=g):this.state.stateValue===void 0?(g="undefined",v=g):(g=f.toString(),v=g),l=M.createElement("div",{style:i},r,M.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:4}},M.createElement(O.Box,{sx:o,key:this.props.schema.blinkOnUpdate?v:void 0},g),u?M.createElement("span",{style:{opacity:.7,fontSize:"smaller"}},u):null))}}return l}}const Cn={fullWidth:L=>({width:"100%",backgroundColor:L.palette.mode==="dark"?"#FFF":"#000",borderStyle:"hidden"}),primary:L=>({backgroundColor:L.palette.primary.main}),secondary:L=>({backgroundColor:L.palette.secondary.main})};class sl extends K{renderItem(){return M.createElement(O.Box,{component:"hr",sx:j.Utils.getStyle(this.props.oContext.theme,Cn.fullWidth,this.props.schema.color==="primary"?Cn.primary:this.props.schema.color==="secondary"?Cn.secondary:{backgroundColor:this.props.schema.color||(this.props.oContext.themeType==="dark"?"#333":"#ddd")},{height:this.props.schema.color?this.props.schema.height||2:this.props.schema.height||1})})}}const ol={header:L=>({width:"100%",background:L.palette.primary.main,color:L.palette.primary.contrastText,padding:"4px !important",borderRadius:"3px",marginBlockEnd:0,marginBlockStart:0})};class al extends K{renderItem(){let t="h5";switch((this.props.schema.size||5).toString()){case"1":t="h1";break;case"2":t="h2";break;case"3":t="h3";break;case"4":t="h4";break;case"5":default:t="h5";break}return M.createElement(O.Box,{component:t,sx:ol.header},this.getText(this.props.schema.label||this.props.schema.text,this.props.schema.noTranslation))}}class ll extends K{renderItem(){let t=this.props.schema.src;return t&&!t.startsWith(".")&&!t.startsWith("http")&&!t.startsWith(`adapter/${this.props.oContext.adapterName}/`)&&!t.startsWith(`./adapter/${this.props.oContext.adapterName}/`)&&(t=`adapter/${this.props.oContext.adapterName}/${t}`),M.createElement("img",{src:t,style:{cursor:this.props.schema.href?"pointer":void 0,width:"100%",height:"100%"},onClick:this.props.schema.href?()=>this.props.schema.href&&window.open(this.props.schema.href,"_blank"):null,alt:""})}}function wi(L,t,n){return typeof n=="string"?{"@keyframes newValueAnimationOnceColor":{"0%":{color:t?`${n} !important`:n},"100%":{color:L.palette.mode==="dark"?t?"#fff !important":"#fff":t?"#000 !important":"#000"}},animation:"newValueAnimationOnceColor 2s ease-in-out"}:{"@keyframes newValueAnimationOnce":{"0%":{color:t?"#00f900 !important":"#00f900"},"80%":{color:L.palette.mode==="dark"?t?"#518851 !important":"#518851":t?"#008000 !important":"#008000"},"100%":{color:L.palette.mode==="dark"?t?"#fff !important":"#fff":t?"#000 !important":"#000"}},animation:"newValueAnimationOnce 2s ease-in-out"}}function Ci(L,t){return typeof t=="string"?{"@keyframes blinkAnimationColor":{"0%":{color:t},"100%":{color:L.palette.mode==="dark"?"#fff":"#000"}},animation:"blinkAnimationColor 2s ease-in-out infinite"}:{"@keyframes blinkAnimation":{"0%":{color:"#00f900"},"80%":{color:L.palette.mode==="dark"?"#518851":"#008000"},"100%":{color:L.palette.mode==="dark"?"#fff":"#000"}},animation:"blinkAnimation 2s ease-in-out infinite"}}const yt={label:{fontWeight:"bold",whiteSpace:"nowrap"},valueImage:{maxHeight:"100%"},valueAndUnit:{display:"flex",gap:4,alignItems:"baseline"},value:{},unit:{fontSize:"smaller",opacity:.7}};class hl extends K{renderItem(t){let n=this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation);this.props.schema.addColon&&typeof n=="string"&&!n.trim().endsWith(":")&&(n=`${n.trim()}:`),n&&(n.includes("<a ")||n.includes("<br")||n.includes("<b>")||n.includes("<i>"))&&(n=j.Utils.renderTextWithA(n));let l;this.props.schema.size==="normal"?l=16:this.props.schema.size==="large"?l=20:typeof this.props.schema.size=="number"&&(l=this.props.schema.size);const y={width:"100%",height:"100%",display:"flex",alignItems:"center",position:"relative",fontSize:l};this.props.schema.narrow?y.gap=8:y.justifyContent="space-between";let a,p;this.props.schema.data&&typeof this.props.schema.data=="object"&&this.props.schema.data.en?p=this.getText(this.props.schema.data):typeof this.props.schema.data=="object"||this.props.schema.data===void 0||this.props.schema.data===null?p=JSON.stringify(this.props.schema.data):typeof this.props.schema.data=="number"?(p=this.props.schema.data.toString(),this.props.oContext.isFloatComma&&(p=p.replace(".",","))):(!this.props.schema.booleanAsCheckbox||typeof this.props.schema.data!="boolean")&&(p=this.props.schema.data.toString());let d=!1;if(this.props.schema.booleanAsCheckbox&&typeof this.props.schema.data=="boolean")a=M.createElement(O.Checkbox,{checked:!!a,disabled:!0,size:this.props.schema.size==="small"?"small":this.props.schema.size==="large"?"large":void 0});else if(p.startsWith("data:image/"))a=M.createElement("div",{style:{...yt.value,...yt.valueImage,...this.props.schema.styleValue||void 0}},M.createElement(j.Icon,{src:p}));else{const i={...yt.value,...this.props.schema.styleValue||void 0};this.props.schema.html?a=M.createElement("div",{style:i,dangerouslySetInnerHTML:{__html:p}}):Array.isArray(this.props.schema.data)?(d=!0,a=M.createElement("div",{style:i},this.props.schema.data.map((o,h)=>M.createElement("div",{key:h},typeof o=="object"||o===null||o===void 0?JSON.stringify(o):o)))):p.includes(`
|
|
1397
|
-
`)?(d=!0,a=M.createElement("div",{style:i},j.Utils.renderTextWithA(p))):a=M.createElement("div",{style:i},p)}if(this.props.schema.blinkOnUpdate&&this.props.schema.blink){const i=wi(this.props.oContext.theme,!0,this.props.schema.blinkOnUpdate),o=Ci(this.props.oContext.theme,this.props.schema.blink);a=M.createElement(O.Box,{key:p,sx:{...i,...o}},a)}else if(this.props.schema.blinkOnUpdate){const i=wi(this.props.oContext.theme,!1,this.props.schema.blinkOnUpdate);a=M.createElement(O.Box,{key:p,sx:i},a)}else if(this.props.schema.blink){const i=Ci(this.props.oContext.theme,this.props.schema.blink);a=M.createElement(O.Box,{sx:i},a)}this.props.schema.unit&&(a=M.createElement("div",{style:yt.valueAndUnit},a,M.createElement("div",{style:{...yt.unit,...this.props.schema.styleUnit||void 0}},this.getText(this.props.schema.unit,this.props.schema.noTranslation))));let s;this.props.schema.labelIcon&&(s=M.createElement(j.Icon,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let c;this.props.schema.copyToClipboard&&(c=M.createElement(X.ContentCopy,{className:"staticCopyButton",style:{position:"absolute",top:"calc(50% - 12px)",right:0,cursor:"pointer"},onClick:()=>{j.Utils.copyToClipboard(p),window.alert(j.I18n.t("ra_Copied"))}}));const e={"& .staticCopyButton":{display:"none"},"& .staticCopyButton:action":{transform:"scale(0.9)"},"&:hover .staticCopyButton":{display:"block"}};return this.props.schema.highlight&&(e["&:hover"]={backgroundColor:this.props.oContext.themeType==="dark"?"#51515180":"#b8b8b880"}),d&&(y.alignItems="top"),M.createElement(O.Box,{component:"div",style:y,sx:e},M.createElement("div",{style:{...yt.label,...this.props.schema.styleLabel||void 0}},s,n),a,c)}}const Ei={fullWidth:{height:"100%",width:"100%"},link:L=>({textDecoration:"underline",color:L.palette.mode==="dark"?"#4dabf5":"#254e72",cursor:"pointer"})};function Si(L,t,n){let l,y="";L?L.toString().startsWith("#")||L.toString().startsWith("/")?(l=t||"_self",y=L):L.startsWith("http://")||L.startsWith("https://")?(l=t||"_blank",y=L):(y=`#tab-instances/config/${n}/${L}`,l=t||"_self"):(y=`#tab-instances/config/${n}`,l=t||"_self"),l==="_self"?setTimeout(a=>{a.startsWith("#")?window.location.hash=a:a.startsWith("/")?y=`${window.location.protocol}:${window.location.host}${y}`:(a.startsWith("http://")||a.startsWith("https://"))&&(window.location.href=a)},100,y):(y.startsWith("#")?y=`${window.location.protocol}:${window.location.host}${window.location.pathname}${y}`:y.startsWith("/")&&(y=`${window.location.protocol}:${window.location.host}${y}`),window.open(y,l))}class Di extends K{renderItem(t,n){if(this.props.schema.button){const y=this.getIcon();return M.createElement(O.Button,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:{...Ei.fullWidth,...this.props.schema.controlStyle||void 0},disabled:n,startIcon:y,onClick:this.props.schema.href?()=>{const a=this.props.schema.href?this.getText(this.props.schema.href,!0):null;a&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:"link",url:a,target:this.props.schema.target,close:this.props.schema.close}):Si(a,this.props.schema.target,`${this.props.oContext.adapterName}.${this.props.oContext.instance}`))}:null},this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation))}let l=this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation);return l&&(l.includes("<a ")||l.includes("<br")||l.includes("<b>")||l.includes("<i>"))&&(l=j.Utils.renderTextWithA(l)),M.createElement(O.Box,{component:"span",style:{...this.props.schema.controlStyle||void 0},sx:this.props.schema.href?Ei.link:void 0,onClick:this.props.schema.href?()=>{const y=this.props.schema.href?this.getText(this.props.schema.href,!0):null;y&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:"link",url:y,target:this.props.schema.target||"_blank",close:this.props.schema.close}):Si(y,this.props.schema.target||"_blank",`${this.props.oContext.adapterName}.${this.props.oContext.instance}`))}:null},l)}}const En=1024*1024,he={paper:{width:"100%",marginBottom:16,backgroundColor:"rgba(255, 255, 255, 0.1)"},headerText:{width:"100%"},table:{minWidth:750},label:{display:"flex",justifyContent:"space-between"},title:{flex:"1 1 100%"},rootTool:{paddingLeft:16,paddingRight:8},silver:{opacity:.2},flex:{display:"flex",alignItems:"baseline"},filteredOut:{padding:10,display:"flex",textAlign:"center"},buttonEmpty:{width:34,display:"inline-block"},buttonCell:{whiteSpace:"nowrap"},dropZone:{width:"100%",height:100,position:"relative"},dropZoneEmpty:{},uploadDiv:{position:"relative",width:"100%",minHeight:300,opacity:.9,marginTop:30,cursor:"pointer",outline:"none"},uploadDivDragging:{opacity:1,background:"rgba(128,255,128,0.1)"},uploadCenterDiv:{margin:5,border:"3px dashed grey",borderRadius:5,width:"calc(100% - 10px)",height:"calc(100% - 10px)",minHeight:300,position:"relative",display:"flex"},uploadCenterIcon:{paddingTop:10,width:48,height:48},uploadCenterText:{fontSize:16},uploadCenterTextAndIcon:{textAlign:"center",position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},tooltip:{pointerEvents:"none"}};function cl(L,t,n){t=t||"key";const l=[];return Object.keys(L).forEach(y=>{const a={};a[t]=y,n?(a[n]=L[y],l.push(a)):l.push(Object.assign(a,L[y]))}),l}function xi(L,t,n){t=t||"key";const l={};return L.forEach(y=>{let a=y[t];a==null&&(a=""),delete y[t],n?l[a]=y[n]:l[a]=y}),l}function ul(L,t){let n="";for(let l=0;l<t.length;l++)n+=String.fromCharCode(L[l%L.length].charCodeAt(0)^t.charCodeAt(l));return n}function pl(L,t){let n="";for(let l=0;l<t.length;l++)n+=String.fromCharCode(L[l%L.length].charCodeAt(0)^t.charCodeAt(l));return n}class Ie extends K{filterRefs;typingTimer=null;resizeTimeout=null;secret="Zgfr56gFe87jJOM";refDiv;constructor(t){super(t),this.filterRefs={},this.props.schema.items=this.props.schema.items||[],this.props.schema.items.forEach(n=>{n.filter&&(this.filterRefs[n.attr]=qe.createRef())}),this.refDiv=M.createRef()}async componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr)||[];let n;if(this.props.schema.objKeyName?n=cl(t,this.props.schema.objKeyName,this.props.schema.objValueName):n=t,Array.isArray(n)||(n=[]),this.props.schema.encryptedAttributes){const l=await this.props.oContext.socket.getCompactSystemConfig();this.secret=(l==null?void 0:l.native.secret)||this.secret,t.forEach(y=>{this.props.schema.encryptedAttributes.forEach(a=>{y[a]&&(y[a]=pl(this.secret,y[a]))})})}this.setState({value:n,visibleValue:null,orderBy:"",order:"asc",iteration:0,filterOn:[],width:0},()=>this.validateUniqueProps())}componentWillUnmount(){this.typingTimer&&(clearTimeout(this.typingTimer),this.typingTimer=null),this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),super.componentWillUnmount()}itemTable(t,n,l){var d;const{schema:y}=this.props,a=(d=y.items)==null?void 0:d.find(s=>s.attr===t);if(!a)return null;const p={items:{[t]:a}};return M.createElement(ft,{oContext:this.props.oContext,alive:this.props.alive,arrayIndex:l,changed:this.props.changed,common:this.props.common,expertMode:this.props.expertMode,custom:!0,data:n,globalData:this.props.data,index:l+this.state.iteration,onChange:(s,c)=>{const e=JSON.parse(JSON.stringify(this.state.value));e[l][s]=c,this.setState({value:e},()=>{this.validateUniqueProps(),this.onChangeWrapper(e,!0)})},onError:(s,c)=>this.onError(s,c),originalData:this.props.originalData,schema:p,table:!0,themeName:this.props.themeName})}validateUniqueProps(){if(this.props.schema.uniqueColumns)for(const t of this.props.schema.uniqueColumns){const n=[];this.state.value.find(y=>{const a=y[t];return n.includes(a)?(this.onError(t,"is not unique"),this.setState({errorMessage:j.I18n.t('Non-allowed duplicate entry "%s" in column "%s"',a,t)}),!0):(n.push(a),!1)})||(this.onError(t,null),this.setState({errorMessage:""}))}}static descendingComparator(t,n,l){return n[l]<t[l]?-1:n[l]>t[l]?1:0}static getComparator(t,n){return t==="desc"?(l,y)=>Ie.descendingComparator(l,y,n):(l,y)=>-Ie.descendingComparator(l,y,n)}static getFilterValue(t){var n,l,y;return(y=(l=(n=t==null?void 0:t.current)==null?void 0:n.children[0])==null?void 0:l.children[0])==null?void 0:y.value}static setFilterValue(t,n){return t.current.children[0].children[0].value=n}handleRequestSort=(t,n=!1)=>{const{order:l,orderBy:y}=this.state,p=n?l:y===t&&l==="asc"?"desc":"asc",d=this.stableSort(p,t);JSON.stringify(d)!==JSON.stringify(this.state.value)&&this.setState({value:d,order:p,orderBy:t,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,d))};stableSort=(t,n)=>{const{value:l}=this.state,y=Ie.getComparator(t,n),a=l.map((p,d)=>({el:p,index:d}));return a.sort((p,d)=>{const s=y(p.el,d.el);return s!==0?s:p.index-d.index}),a.map(p=>p.el)};renderShowHideFilter(t){return t.filter?M.createElement(O.IconButton,{title:j.I18n.t("ra_Show/hide filter input"),size:"small",onClick:()=>{const n=[...this.state.filterOn],l=this.state.filterOn.indexOf(t.attr);l===-1?n.push(t.attr):n.splice(l,1),this.setState({filterOn:n},()=>{l&&Ie.getFilterValue(this.filterRefs[t.attr])&&(Ie.setFilterValue(this.filterRefs[t.attr],""),this.applyFilter())})}},this.state.filterOn.includes(t.attr)?M.createElement(X.FilterAltOff,null):M.createElement(X.FilterAlt,null)):null}renderImportExportButtons(t){return M.createElement(M.Fragment,null,!t.noDelete&&t.import?M.createElement(O.Tooltip,{title:j.I18n.t("ra_Import data from %s file","CSV"),slotProps:{popper:{sx:he.tooltip}}},M.createElement(O.IconButton,{size:"small",onClick:()=>this.setState({showImportDialog:!0})},M.createElement(X.UploadFile,null))):null,t.export?M.createElement(O.Tooltip,{title:j.I18n.t("ra_Export data to %s file","CSV"),slotProps:{popper:{sx:he.tooltip}}},M.createElement(O.IconButton,{size:"small",onClick:()=>this.onExport()},M.createElement(X.Download,null))):null,t.noDelete?null:M.createElement(O.IconButton,{disabled:!0,size:"small"},M.createElement(X.Delete,null)))}renderAddButton(t){return M.createElement(O.Tooltip,{title:t?j.I18n.t("ra_Cannot add items with set filter"):j.I18n.t("ra_Add row"),slotProps:{popper:{sx:he.tooltip}}},M.createElement("span",null,M.createElement(O.IconButton,{size:"small",color:"primary",disabled:!!t&&!this.props.schema.allowAddByFilter,onClick:this.onAdd},M.createElement(X.Add,null))))}enhancedTableHead(t,n){var p;const{schema:l}=this.props,{order:y,orderBy:a}=this.state;return M.createElement(O.TableHead,null,M.createElement(O.TableRow,null,(p=l.items)==null?void 0:p.map((d,s)=>this.renderOneFilter({schema:l,style:{width:d.width},showAddButton:!s&&!l.noDelete,headCell:d,order:y,orderBy:a,index:s,doAnyFilterSet:n})),!l.noDelete&&M.createElement(O.TableCell,{style:{paddingLeft:20,paddingRight:20,width:t,textAlign:"right"},padding:"checkbox"},this.renderImportExportButtons(l))))}onDelete=t=>()=>{const n=JSON.parse(JSON.stringify(this.state.value));n.splice(t,1),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))};onExport(){const{schema:t}=this.props,{value:n}=this.state,y=[t.items.map(d=>d.attr).join(";")];n.forEach(d=>{const s=[];t.items.forEach(c=>{var e;(e=d[c.attr])!=null&&e.includes(";")?s.push(`"${d[c.attr]}"`):s.push(d[c.attr]===void 0||d[c.attr]===null?"":d[c.attr])}),y.push(s.join(";"))});const a=document.createElement("a");a.setAttribute("href",`data:text/csv;charset=utf-8,${encodeURIComponent(y.join(`
|
|
1398
|
-
`))}`);const p=new Date;a.setAttribute("download",`${p.getFullYear()}_${(p.getMonth()+1).toString().padStart(2,"0")}_${p.getDate().toString().padStart(2,"0")}_${this.props.oContext.adapterName}.${this.props.oContext.instance}_${this.props.attr}.csv`),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)}onImport(t){var p;const n=t.split(`
|
|
1399
|
-
`).map(d=>d.replace("\r","").trim()),{schema:l}=this.props,y=n.shift().split(";").filter(d=>d&&l.items.find(s=>s.attr===d)),a=[];n.forEach(d=>{const s=d.split(";"),c={};for(let e=0;e<s.length;e++){let i=s[e];if(i.startsWith('"')){for(i=i.substring(1);e<s.length&&!i.endsWith('"');)i+=`;${s[++e]}`;i=i.substring(0,i.length-1)}let o=i;if(i==="true")o=!0;else if(i==="false")o=!1;else if(window.isFinite(i)){const h=this.props.schema.items.find(r=>r.attr===y[e]);h&&h.type==="number"?o=parseFloat(i):o=i}else o=i;c[y[e]]=o}a.push(c)}),a.length?(p=this.state.value)!=null&&p.length?this.setState({showTypeOfImportDialog:a,showImportDialog:!1}):this.setState({value:a,showImportDialog:!1}):window.alert("ra_No data found in file")}onClone=t=>()=>{const n=JSON.parse(JSON.stringify(this.state.value)),l=JSON.parse(JSON.stringify(n[t]));if(typeof this.props.schema.clone=="string"&&typeof l[this.props.schema.clone]=="string"){let y=1,a=l[this.props.schema.clone];const p=a.match(/(\d+)$/);for(p?(a=a.replace(p[0],""),y=parseInt(p[0],10)+1):a+="_";n.find(d=>d[this.props.schema.clone]===a+y.toString());)y++;l[this.props.schema.clone]=`${l[this.props.schema.clone]}_${y}`}n.splice(t,0,l),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))};onChangeWrapper=(t,n)=>{this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout((l,y)=>{this.typingTimer=null;let a;if(this.props.schema.encryptedAttributes){const p=JSON.parse(JSON.stringify(l));if(p.forEach(d=>{this.props.schema.encryptedAttributes.forEach(s=>{d[s]&&(d[s]=ul(this.secret,d[s]))})}),this.props.schema.objKeyName){const d=xi(p,this.props.schema.objKeyName,this.props.schema.objValueName);a=this.onChange(this.props.attr,d)}else a=this.onChange(this.props.attr,p)}else if(this.props.schema.objKeyName){const p=xi(JSON.parse(JSON.stringify(l)),this.props.schema.objKeyName,this.props.schema.objValueName);a=this.onChange(this.props.attr,p)}else a=this.onChange(this.props.attr,l);a instanceof Promise&&a.catch(p=>console.error(`Cannot save: ${p}`)),y&&(this.applyFilter(!1,l),this.handleRequestSort(this.state.orderBy,!0))},300,t,n)};onAdd=()=>{var y;const{schema:t}=this.props,n=JSON.parse(JSON.stringify(this.state.value)),l=(y=t.items)==null?void 0:y.reduce((a,p)=>{let d;return p.defaultFunc?this.props.custom?d=p.defaultFunc?this.executeCustom(p.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,n.length,this.props.data):this.props.schema.default:d=p.defaultFunc?this.execute(p.defaultFunc,this.props.schema.default,this.props.data,n.length,this.props.data):this.props.schema.default:d=p.default===void 0?null:p.default,a[p.attr]=d,a},{});n.push(l),this.setState({value:n},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))};isAnyFilterSet(){return!!Object.keys(this.filterRefs).find(t=>Ie.getFilterValue(this.filterRefs[t]))}applyFilter=(t,n,l)=>{n=n||this.state.value;let y=n.map((a,p)=>p);if(Object.keys(this.filterRefs).forEach(a=>{let p=Ie.getFilterValue(this.filterRefs[a]);!t&&p?(p=p.toLowerCase(),y=y.filter(d=>n[d]&&n[d][a]&&n[d][a].toLowerCase().includes(p))):this.filterRefs[a].current&&Ie.setFilterValue(this.filterRefs[a],"")}),y.length===n.length&&(y=null),y===null&&this.state.visibleValue===null){l&&l();return}JSON.stringify(y)!==JSON.stringify(this.state.visibleValue)?this.setState({visibleValue:y},()=>l&&l()):l&&l()};onMoveUp(t){const n=JSON.parse(JSON.stringify(this.state.value)),l=n[t];n.splice(t,1),n.splice(t-1,0,l),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))}onMoveDown(t){const n=JSON.parse(JSON.stringify(this.state.value)),l=n[t];n.splice(t,1),n.splice(t+1,0,l),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))}onDrop(t){const n=t[0],l=new FileReader;l.onabort=()=>console.log("file reading was aborted"),l.onerror=()=>console.log("file reading has failed"),l.onload=()=>{if(n.size>En){window.alert(j.I18n.t("ra_File is too big. Max %sk allowed. Try use SVG.",Math.round(En/1024)));return}const y=new Uint8Array(l.result).reduce((a,p)=>a+String.fromCharCode(p),"");this.onImport(y)},l.readAsArrayBuffer(n)}showTypeOfImportDialog(){return this.state.showTypeOfImportDialog?M.createElement(O.Dialog,{open:!0,onClose:()=>this.setState({showTypeOfImportDialog:!1}),maxWidth:"md"},M.createElement(O.DialogTitle,null,j.I18n.t("ra_Append or replace?")),M.createElement(O.DialogContent,null,j.I18n.t("ra_Append %s entries or replace existing?",this.state.showTypeOfImportDialog.length)),M.createElement(O.DialogActions,null,M.createElement(O.Button,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>{const t=JSON.parse(JSON.stringify(this.state.value));this.state.showTypeOfImportDialog.forEach(n=>t.push(n)),this.setState({value:t,iteration:this.state.iteration+1e4,showTypeOfImportDialog:!1},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))}},j.I18n.t("ra_Append")),M.createElement(O.Button,{variant:"contained",color:"secondary",autoFocus:!0,onClick:()=>{const t=this.state.showTypeOfImportDialog;this.setState({value:t,iteration:this.state.iteration+1e4,showTypeOfImportDialog:!1},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))}},j.I18n.t("ra_Replace")))):null}showImportDialog(){return this.state.showImportDialog?M.createElement(O.Dialog,{open:!0,onClose:()=>this.setState({showImportDialog:!1}),sx:{"& .MuiDialog-paper":{minHeight:500}},maxWidth:"md",fullWidth:!0},M.createElement(O.DialogTitle,null,j.I18n.t("ra_Import from %s","CSV")),M.createElement(O.DialogContent,null,M.createElement(Ti,{multiple:!1,accept:{"text/csv":[".csv"]},maxSize:En,onDragEnter:()=>this.setState({uploadFile:"dragging"}),onDragLeave:()=>this.setState({uploadFile:!0}),onDrop:(t,n)=>{this.setState({uploadFile:!1}),t.length?this.onDrop(t):window.alert(n&&n[0]&&n[0].errors&&n[0].errors[0]&&n[0].errors[0].message||j.I18n.t("ra_Cannot upload"))}},({getRootProps:t,getInputProps:n})=>M.createElement("div",{style:{...he.uploadDiv,...this.state.uploadFile==="dragging"?he.uploadDivDragging:void 0,...he.dropZone,...this.state.icon?void 0:he.dropZoneEmpty},...t()},M.createElement("input",{...n()}),M.createElement("div",{style:he.uploadCenterDiv},M.createElement("div",{style:he.uploadCenterTextAndIcon},M.createElement(X.UploadFile,{style:he.uploadCenterIcon}),M.createElement("div",{style:he.uploadCenterText},this.state.uploadFile==="dragging"?j.I18n.t("ra_Drop file here"):j.I18n.t("ra_Place your files here or click here to open the browse dialog"))))))),M.createElement(O.DialogActions,null,M.createElement(O.Button,{variant:"contained",onClick:()=>this.setState({showImportDialog:!1}),color:"primary",startIcon:M.createElement(X.Close,null)},j.I18n.t("Cancel")))):null}renderOneFilter(t){return M.createElement(O.TableCell,{key:`${t.headCell.attr}_${t.index}`,style:t.style,align:"left",sortDirection:t.orderBy===t.headCell.attr?t.order:!1},M.createElement("div",{style:{...he.flex,...t.schema.showFirstAddOnTop?{flexDirection:"column"}:void 0}},t.showAddButton?this.renderAddButton(t.doAnyFilterSet):null,t.headCell.sort&&M.createElement(O.TableSortLabel,{active:!0,style:t.orderBy!==t.headCell.attr?he.silver:void 0,direction:t.orderBy===t.headCell.attr?t.order:"asc",onClick:()=>this.handleRequestSort(t.headCell.attr)}),t.headCell.filter&&this.state.filterOn.includes(t.headCell.attr)?M.createElement(O.TextField,{variant:"standard",ref:this.filterRefs[t.headCell.attr],onChange:()=>this.applyFilter(),title:j.I18n.t("ra_You can filter entries by entering here some text"),slotProps:{input:{endAdornment:Ie.getFilterValue(this.filterRefs[t.headCell.attr])&&M.createElement(O.InputAdornment,{position:"end"},M.createElement(O.IconButton,{size:"small",tabIndex:-1,onClick:()=>{Ie.setFilterValue(this.filterRefs[t.headCell.attr],""),this.applyFilter()}},M.createElement(X.Close,null)))}},fullWidth:!0,placeholder:this.getText(t.headCell.title)}):M.createElement("span",{style:he.headerText},this.getText(t.headCell.title)),this.renderShowHideFilter(t.headCell)))}enhancedFilterCard(){var p;const{schema:t}=this.props,{order:n,orderBy:l}=this.state;let y;this.props.schema.compact&&(y={paddingTop:1,paddingBottom:1});const a=!t.noDelete&&t.import||t.export;return a||t.items.find(d=>d.sort||d.filter)?M.createElement(O.Grid2,{size:{xs:t.xs||12,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0}},M.createElement(O.Card,null,M.createElement(O.Paper,{style:he.paper},M.createElement(O.Accordion,{style:he.paper},M.createElement(O.AccordionSummary,{expandIcon:M.createElement(X.ExpandMore,null)},M.createElement(O.Typography,null,j.I18n.t("ra_Filter and Data Actions"))),M.createElement(O.AccordionDetails,null,M.createElement(O.Table,null,M.createElement(O.TableBody,null,((p=t.items)==null?void 0:p.find(d=>d.sort||d.filter))&&t.items.map((d,s)=>M.createElement(O.TableRow,{key:`${d.attr}_${s}`},this.renderOneFilter({schema:t,style:y,showAddButton:!1,headCell:d,order:n,orderBy:l,index:s,doAnyFilterSet:!1}))),a?M.createElement(O.TableRow,null,M.createElement(O.TableCell,{align:"left",style:y},M.createElement("span",{style:he.headerText},j.I18n.t("ra_Actions"))),M.createElement(O.TableCell,{style:y},this.renderImportExportButtons(t))):null))))))):null}enhancedBottomCard(){const{schema:t}=this.props;let n;this.props.schema.compact&&(n={paddingTop:1,paddingBottom:1});const l=this.isAnyFilterSet();return M.createElement(O.Grid2,{size:{xs:t.xs||12,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0}},M.createElement(O.Card,null,M.createElement(O.Paper,{style:he.paper},M.createElement(O.Table,null,M.createElement(O.TableBody,null,M.createElement(O.TableRow,null,M.createElement(O.TableCell,{colSpan:t.items.length+1,style:n},this.renderAddButton(l))))))))}renderCards(){const{schema:t}=this.props;let{visibleValue:n}=this.state,l;this.props.schema.compact&&(l={paddingTop:1,paddingBottom:1}),n||=this.state.value.map((a,p)=>p);const y=this.isAnyFilterSet();return M.createElement(O.Grid2,{container:!0},this.showImportDialog(),this.showTypeOfImportDialog(),this.enhancedFilterCard(),n.map((a,p)=>{var d;return M.createElement(O.Grid2,{key:`${a}_${p}`,size:{xs:t.xs||12,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0}},M.createElement(O.Card,null,M.createElement(O.Paper,{style:he.paper},M.createElement(O.Table,null,M.createElement(O.TableBody,null,(d=t.items)==null?void 0:d.map(s=>M.createElement(O.TableRow,{key:`${s.attr}_${a}`},M.createElement(O.TableCell,{align:"left",style:l},M.createElement("span",{style:he.headerText},this.getText(s.title))),M.createElement(O.TableCell,{align:"left",style:l},this.itemTable(s.attr,this.state.value[a],a)))),!t.noDelete&&M.createElement(O.TableRow,null,M.createElement(O.TableCell,{align:"left",style:l},M.createElement("span",{style:he.headerText},this.getText("Actions"))),M.createElement(O.TableCell,{align:"left",style:l},!y&&!this.state.orderBy?M.createElement(O.Tooltip,{title:j.I18n.t("ra_Move up"),slotProps:{popper:{sx:he.tooltip}}},M.createElement("span",null,M.createElement(O.IconButton,{size:"small",onClick:()=>this.onMoveUp(a),disabled:p===0},M.createElement(X.ArrowUpward,null)))):null,!y&&!this.state.orderBy?M.createElement(O.Tooltip,{title:j.I18n.t("ra_Move down"),slotProps:{popper:{sx:he.tooltip}}},M.createElement("span",null,M.createElement(O.IconButton,{size:"small",onClick:()=>this.onMoveDown(a),disabled:p===n.length-1},M.createElement(X.ArrowDownward,null)))):null,M.createElement(O.Tooltip,{title:j.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:he.tooltip}}},M.createElement(O.IconButton,{size:"small",onClick:this.onDelete(a)},M.createElement(X.Delete,null))),this.props.schema.clone?M.createElement(O.Tooltip,{title:j.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:he.tooltip}}},M.createElement(O.IconButton,{size:"small",onClick:this.onClone(a)},M.createElement(X.ContentCopy,null))):null)))))))}),this.enhancedBottomCard())}renderTable(){const{schema:t}=this.props;let{visibleValue:n}=this.state;n=n||this.state.value.map((a,p)=>p);const l=this.isAnyFilterSet();let y;return this.props.schema.compact&&(y={paddingTop:1,paddingBottom:1}),M.createElement(O.Paper,{style:he.paper},this.showImportDialog(),this.showTypeOfImportDialog(),t.label?M.createElement("div",{style:he.label},M.createElement(O.Toolbar,{variant:"dense",style:he.rootTool},M.createElement(O.Typography,{style:he.title,variant:"h6",id:"tableTitle",component:"div"},this.getText(t.label)))):null,M.createElement(O.TableContainer,null,M.createElement(O.Table,{style:he.table,size:"small"},this.enhancedTableHead(!l&&!this.state.orderBy?120:64,l),M.createElement(O.TableBody,null,n.map((a,p)=>{var d;return M.createElement(O.TableRow,{hover:!0,key:`${a}_${p}`},(d=t.items)==null?void 0:d.map(s=>M.createElement(O.TableCell,{key:`${s.attr}_${a}`,align:"left",style:y},this.itemTable(s.attr,this.state.value[a],a))),!t.noDelete&&M.createElement(O.TableCell,{align:"left",style:{...y,...he.buttonCell}},!l&&!this.state.orderBy?p?M.createElement(O.Tooltip,{title:j.I18n.t("ra_Move up"),slotProps:{popper:{sx:he.tooltip}}},M.createElement(O.IconButton,{size:"small",onClick:()=>this.onMoveUp(a)},M.createElement(X.ArrowUpward,null))):M.createElement("div",{style:he.buttonEmpty}):null,!l&&!this.state.orderBy?p<n.length-1?M.createElement(O.Tooltip,{title:j.I18n.t("ra_Move down"),slotProps:{popper:{sx:he.tooltip}}},M.createElement(O.IconButton,{size:"small",onClick:()=>this.onMoveDown(a)},M.createElement(X.ArrowDownward,null))):M.createElement("div",{style:he.buttonEmpty}):null,M.createElement(O.Tooltip,{title:j.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:he.tooltip}}},M.createElement(O.IconButton,{size:"small",onClick:this.onDelete(a)},M.createElement(X.Delete,null))),this.props.schema.clone?M.createElement(O.Tooltip,{title:j.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:he.tooltip}}},M.createElement(O.IconButton,{size:"small",onClick:this.onClone(a)},M.createElement(X.ContentCopy,null))):null))}),!t.noDelete&&n.length>=(t.showSecondAddAt||5)?M.createElement(O.TableRow,null,M.createElement(O.TableCell,{colSpan:t.items.length+1,style:{...y}},this.renderAddButton(l))):null)),!n.length&&this.state.value.length?M.createElement("div",{style:he.filteredOut},M.createElement(O.Typography,{style:he.title,variant:"h6",id:"tableTitle",component:"div"},j.I18n.t("ra_All items are filtered out"),M.createElement(O.IconButton,{size:"small",onClick:()=>this.applyFilter(!0)},M.createElement(X.Close,null)))):null),t.help?M.createElement(O.FormHelperText,{style:{paddingLeft:16}},this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null,this.state.errorMessage?M.createElement("div",{style:{display:"flex",padding:"5px"}},M.createElement(X.Warning,{color:"error"}),M.createElement("span",{style:{color:"red",alignSelf:"center"}},this.state.errorMessage)):null)}componentDidUpdate(){var t;(t=this.refDiv.current)!=null&&t.clientWidth&&this.refDiv.current.clientWidth!==this.state.width&&(this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{var n;this.resizeTimeout=null,this.setState({width:(n=this.refDiv.current)==null?void 0:n.clientWidth})},50))}getCurrentBreakpoint(){return this.state.width?this.state.width<600?"xs":this.state.width<900?"sm":this.state.width<1200?"md":this.state.width<1536?"lg":"xl":"md"}renderItem(){const{schema:t}=this.props;if(!this.state.value||!Array.isArray(this.state.value))return null;const n=this.getCurrentBreakpoint();let l;return n&&(t.useCardFor||["xs"]).includes(n)?l=this.renderCards():l=this.renderTable(),M.createElement("div",{ref:this.refDiv,style:{width:"100%"}},l)}}const Gt={indeterminate:{opacity:.5},label:{width:"100%",fontSize:14,marginBottom:2},helper:{width:"100%",fontSize:12},error:{width:"100%",fontSize:12,color:"#FF0000"}};class dl extends K{updateTimeout=null;componentDidMount(){super.componentDidMount();let t=K.getValue(this.props.data,this.props.attr);if(Array.isArray(t)&&this.props.oContext.multiEdit){t=K.DIFFERENT_VALUE,this.setState({value:t,oldValue:t,jsonError:!1});return}this.setState({value:t,oldValue:t,jsonError:this.validateJson(t)})}validateJson(t){let n=!1;if(this.props.schema.validateJson&&(t||!this.props.schema.allowEmpty))try{JSON.parse(t)}catch(l){console.log("Error in JSON",l),n=!0}return n}static getDerivedStateFromProps(t,n){if(t.oContext.multiEdit&&n.value===K.DIFFERENT_VALUE)return{value:K.DIFFERENT_VALUE};let l=K.getValue(t.data,t.attr);return l!=null&&(l=l.toString()),l==null||l!==n.value&&l!==n.oldValue?{value:l}:null}renderItem(t,n){const l=Array.isArray(this.state.value)||this.state.value===K.DIFFERENT_VALUE;if(this.props.schema.time){let p="";return typeof this.state.value=="number"?this.state.value&&this.state.value<9466596e5?p=new Date(this.state.value*1e3).toLocaleString():p=new Date(this.state.value).toLocaleString():typeof this.state.value=="string"&&(p=new Date(this.state.value).toLocaleString()),M.createElement(O.TextField,{variant:"standard",fullWidth:!0,value:p,error:!!t||!!this.state.jsonError,disabled:!!n,slotProps:{htmlInput:{readOnly:!0}},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}if(this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=null,this.setState({oldValue:null})},30)):this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=null),l){const p=K.getValue(this.props.data,this.props.attr),d=(p==null?void 0:p.filter(s=>s||s===0).map(s=>({label:s.toString()||"",value:s})))||[];return d.unshift({label:j.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),M.createElement(O.Autocomplete,{style:Gt.indeterminate,fullWidth:!0,value:d[0],onChange:(s,c)=>{const e=c?c.value:"",i=this.onChange(this.props.attr,e,()=>{this.setState({value:e,oldValue:e,jsonError:this.validateJson(c)})});i instanceof Promise&&i.catch(o=>console.error(`Cannot set value: ${o}`))},options:d,getOptionLabel:s=>s.label,renderInput:s=>M.createElement(O.TextField,{variant:"standard",...s,error:!!t,placeholder:this.getText(this.props.schema.placeholder),slotProps:{htmlInput:{...s.inputProps,maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1}},label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:!!n})})}let y,a;if((this.props.schema.readOnly||n)&&this.props.schema.copyToClipboard?(this.props.schema.minRows>1&&(a={position:"absolute",right:3,top:20,zIndex:1e3}),y=M.createElement(O.IconButton,{tabIndex:-1,style:a,size:"small",onClick:()=>{j.Utils.copyToClipboard(this.state.value),window.alert(j.I18n.t("ra_Copied"))}},M.createElement(j.IconCopy,null))):!this.props.schema.readOnly&&!n&&this.state.value&&!this.props.schema.noClearButton&&(this.props.schema.minRows>1&&(a={position:"absolute",right:3,top:20,zIndex:1e3}),y=M.createElement(O.IconButton,{style:a,size:"small",tabIndex:-1,onClick:()=>this.setState({value:"",oldValue:this.state.value},()=>this.onChange(this.props.attr,""))},M.createElement(X.Close,null)),this.props.schema.minRows<=1&&(y=M.createElement(O.InputAdornment,{position:"end"},y))),this.props.schema.minRows>1){const p=this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation);return M.createElement("div",{style:{width:"100%",position:"relative"}},this.props.schema.label?M.createElement("div",{style:Gt.label},this.getText(this.props.schema.label)):null,M.createElement(O.TextareaAutosize,{style:{width:"100%",resize:"vertical",backgroundColor:this.props.oContext.themeType==="dark"?"#363636":"#cccccc",color:this.props.oContext.themeType==="dark"?"#fff":"#111"},minRows:this.props.schema.minRows,maxRows:this.props.schema.maxRows,value:this.state.value===null||this.state.value===void 0?"":this.state.value,disabled:!!n,readOnly:this.props.schema.readOnly||!1,onChange:d=>{const s=d.target.value;this.setState({value:s,oldValue:this.state.value,jsonError:this.validateJson(s)},()=>this.onChange(this.props.attr,s||""))},placeholder:this.getText(this.props.schema.placeholder)}),p||t||this.state.jsonError?M.createElement("div",{style:t?Gt.error:Gt.helper},t||(this.state.jsonError?j.I18n.t("ra_Invalid JSON"):p)):null)}return M.createElement(O.TextField,{variant:"standard",fullWidth:!0,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!t||!!this.state.jsonError,disabled:!!n,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:y}},onChange:p=>{const d=p.target.value;this.setState({value:d,oldValue:this.state.value,jsonError:this.validateJson(d)},()=>this.onChange(this.props.attr,d))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.state.jsonError?j.I18n.t("ra_Invalid JSON"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const fl={fullWidth:{width:"100%"}};class gl extends K{initialized=!1;localContext;askInstance(){if(this.props.alive){let t=this.props.schema.data;if(t===void 0&&this.props.schema.jsonData){const n=this.getPattern(this.props.schema.jsonData,null,!0);try{t=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${n}`)}}t===void 0&&(t=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",t).then(n=>{if(typeof n=="object"){const l=n;this.setState({text:l.text||"",style:l.style,icon:l.icon,iconStyle:l.iconStyle})}else typeof n=="string"&&this.setState({text:n||""})}).catch(n=>console.error(`Cannot send command: ${n}`))}}getLocalContext(){const t={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(n=>t[n]=K.getValue(this.props.data,n)),JSON.stringify(t)}renderItem(){if(this.props.alive){const n=this.getLocalContext();(n!==this.localContext||!this.initialized)&&(this.localContext=n,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}if(this.state.text===void 0)return null;let t=null;return this.state.icon&&(t=Xe(this.state.icon,{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}),t||(t=M.createElement(j.Icon,{src:this.state.icon,style:{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}}))),this.props.schema.container==="text"?M.createElement(O.TextField,{variant:"standard",fullWidth:!0,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?M.createElement(O.IconButton,{tabIndex:-1,size:"small",onClick:()=>{j.Utils.copyToClipboard(this.state.text),window.alert(j.I18n.t("ra_Copied"))}},M.createElement(j.IconCopy,null)):void 0}},value:this.state.text,label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}):M.createElement("div",{style:{...fl.fullWidth,...this.state.style||void 0}},t,this.props.schema.container==="html"?M.createElement("span",{dangerouslySetInnerHTML:{__html:this.state.text||""}}):this.state.text)}}class ml extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.setState({value:t})}renderItem(t,n){const l=this.props.schema.returnFormat!=="HH:mm:ss",y=new Date(Date.parse(`Thu, 01 Jan 1970 ${this.state.value||"00:00:00"}`));return M.createElement(_i.TimePicker,{sx:a=>({width:"100%",borderBottom:`1px solid ${a.palette.text.primary}`,"& fieldset":{display:"none"},"& input":{padding:`${a.spacing(1.5)} 0 4px 0`},"& .MuiInputAdornment-root":{marginLeft:0,marginTop:1},"& label":{transform:"translate(0px, -9px) scale(0.75)"}}),ampm:this.props.oContext.systemConfig.dateFormat.includes("/"),timeSteps:this.props.schema.timeSteps||this.props.schema.timesteps||{hours:1,minutes:5,seconds:5},format:this.props.schema.format||"HH:mm:ss",disabled:!!n,value:y,onChange:a=>{let p;p=a instanceof Date?a.toTimeString().split(" ")[0]:a.toTimeString(),l&&(p=p.split(":").slice(0,2).join(":")),this.setState({value:p},()=>this.onChange(this.props.attr,this.state.value))},views:this.props.schema.views||["hours","minutes","seconds"],label:this.getText(this.props.schema.label)})}}function vl(L,t){let n;return t&&L.substring(0,t.length)===t?n=L.substring(t.length+1):n=L,n=n.replace(/\./g,"/").replace(/_/g," "),n}class yl extends K{componentDidMount(){var n;super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);if(!t&&((n=this.props.customObj)!=null&&n._id)){const l=vl(this.props.customObj._id,`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);this.setState({value:l})}else this.setState({value:t||""})}renderItem(t,n){return M.createElement(O.TextField,{variant:"standard",fullWidth:!0,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},value:this.state.value,error:!!t,disabled:n,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),onChange:l=>{const y=l.target.value;this.setState({value:y},()=>this.onChange(this.props.attr,y))}})}}class bl extends K{async componentDidMount(){var n;super.componentDidMount();const t=await this.props.oContext.socket.getObject("system.meta.uuid");this.setState({uuid:((n=t==null?void 0:t.native)==null?void 0:n.uuid)||"unknown"})}renderItem(t,n){return M.createElement(O.TextField,{variant:"standard",fullWidth:!0,error:!!t,disabled:!!n,slotProps:{htmlInput:{readOnly:!0},input:{endAdornment:M.createElement(O.IconButton,{tabIndex:-1,onClick:()=>{j.Utils.copyToClipboard(this.state.uuid),window.alert(j.I18n.t("ra_Copied %s",this.state.uuid))}},M.createElement(X.ContentCopy,null))}},value:this.state.uuid||"",label:this.getText(this.props.schema.label)||j.I18n.t("ra_Serial number (UUID)"),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const Ai={icon:{width:16,height:16,marginRight:8}};class wl extends K{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getUsers().then(t=>{const n={},l=j.I18n.getLanguage();this.props.schema.short?t.forEach(y=>{var a,p;return n[y._id]={color:(a=y.common)==null?void 0:a.color,icon:(p=y.common)==null?void 0:p.icon,name:j.Utils.getObjectNameFromObj(y,l)}}):t.forEach(y=>{var a,p;return n[y._id.replace(/^system\.user\./,"")]={color:(a=y.common)==null?void 0:a.color,icon:(p=y.common)==null?void 0:p.icon,name:j.Utils.getObjectNameFromObj(y,l)}}),this.setState({users:n})}).catch(t=>console.error(`Cannot get users: ${t}`))}renderItem(t,n){var y,a;const l=K.getValue(this.props.data,this.props.attr);return M.createElement(O.FormControl,{variant:"standard",fullWidth:!0},this.state.users&&this.props.schema.label?M.createElement(O.InputLabel,null,this.getText(this.props.schema.label)):null,this.state.users?M.createElement(O.Select,{variant:"standard",error:!!t,disabled:!!n,value:l,renderValue:p=>{var d,s,c;return M.createElement("span",null,this.state.users&&((d=this.state.users[p])!=null&&d.icon)?M.createElement(j.Icon,{src:this.state.users&&((s=this.state.users[p])==null?void 0:s.icon),style:Ai.icon}):null,this.state.users&&((c=this.state.users[p])==null?void 0:c.name)||p||"")},style:{color:this.state.users&&((y=this.state.users[l])==null?void 0:y.color)||void 0,backgroundColor:j.Utils.getInvertedColor(this.state.users&&((a=this.state.users[l])==null?void 0:a.color),this.props.oContext.themeType)},onChange:p=>this.onChange(this.props.attr,p.target.value)},this.state.users&&Object.keys(this.state.users).map(p=>M.createElement(O.MenuItem,{style:{color:this.state.users[p].color||void 0,backgroundColor:j.Utils.getInvertedColor(this.state.users[p].color,this.props.oContext.themeType)},key:p,value:p},this.state.users[p].icon?M.createElement(j.Icon,{src:this.state.users[p].icon,style:Ai.icon}):null,this.state.users[p].name))):M.createElement(O.TextField,{variant:"standard",error:!!t,disabled:!!n,value:l,onChange:p=>this.onChange(this.props.attr,p.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?M.createElement(O.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Cl extends K{async componentDidMount(){super.componentDidMount();const t=await as(()=>import("./index-Dx7rDE4p.js").then(n=>n.i),__vite__mapDeps([0,1,2,3,4]),import.meta.url);this.setState({QRCode:t.default})}renderItem(){const t=this.state.QRCode;return t?M.createElement(t,{value:this.props.schema.data,size:this.props.schema.size,fgColor:this.props.schema.fgColor,bgColor:this.props.schema.bgColor,level:this.props.schema.level}):null}}const El={accordion:_s,alive:ks,autocomplete:Ms,autocompleteSendTo:Ls,certCollection:Os,certificate:Fs,certificates:Rs,checkbox:Ns,checkLicense:Ze,chip:ii,chips:ii,color:Hs,coordinates:js,cron:Is,custom:_t,datePicker:Vs,deviceManager:Us,divider:sl,file:no,fileSelector:en,func:io,header:al,image:oo,imageSendTo:so,infoBox:ao,instance:lo,interface:ho,ip:ro,jsonEditor:Na,language:Pa,license:Wa,number:za,oauth2:Ha,objectId:ja,password:Va,pattern:Ua,port:Ka,qrCode:Cl,room:Ja,select:Qa,selectSendTo:Za,sendto:yi,sendTo:yi,setState:tl,slider:nl,state:rl,staticImage:ll,staticInfo:hl,staticLink:Di,staticText:Di,table:Ie,text:dl,textSendTo:gl,timePicker:ml,topic:yl,uuid:bl,user:wl},We={fullWidth:{width:"100%"},paper:{margin:1,width:"auto !important",overflowY:"auto",paddingBottom:1},paperWithIcons:{height:"calc(100vh - 259px) !important"},paperWithoutIcons:{height:"calc(100vh - 235px) !important"},padding:{padding:"10px"},heading:{},primary:L=>({backgroundColor:L.palette.primary.main,color:L.palette.mode==="dark"?"inherit":"#FFF"}),secondary:L=>({backgroundColor:L.palette.secondary.main})};class ft extends K{componentDidMount(){var t;super.componentDidMount(),(t=this.props.schema)!=null&&t.collapsable&&this.setState({expanded:(window._localStorage||window.localStorage).getItem(`${this.props.oContext.adapterName}.${this.props.attr}`)==="true"})}renderItems(t,n){return t?Object.keys(t).map(l=>{if(this.props.oContext.multiEdit&&t[l].noMultiEdit)return null;const y=t[l].type||"panel";let a,p="Use this.props.oContext.socket!";return y==="custom"?(t[l].url?a=_t:this.props.oContext.customs&&this.props.oContext.customs[t[l].component]?a=this.props.oContext.customs[t[l].component]:(console.error(`Cannot find custom component: ${t[l].component}`),a=K),p=this.props.oContext.socket):y==="panel"?a=ft:a=El[y]||K,M.createElement(a,{socket:p,globalData:this.props.globalData,oContext:this.props.oContext,key:`${l}_${this.props.index===void 0?"":this.props.index}`,index:this.props.index,changed:this.props.changed,arrayIndex:this.props.arrayIndex,expertMode:this.props.expertMode,commandRunning:this.props.commandRunning,style:We.panel,common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:this.props.data,originalData:this.props.originalData,onError:this.props.onError,onChange:this.props.onChange,disabled:n,customObj:this.props.customObj,custom:this.props.custom,schema:t[l],attr:l,table:this.props.table})}):null}render(){const t=this.props.schema;if(!t)return null;const{disabled:n,hidden:l}=this.calculate(t),y=this.props.schema.items,a=this.props.schema.style||{};if(l){if(t.hideOnlyControl){const d=M.createElement(O.Grid2,{size:{xs:t.xs||void 0,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0},sx:j.Utils.getStyle(this.props.oContext.theme,{marginBottom:0,textAlign:"left"},a,this.props.oContext.themeType==="dark"&&t.darkStyle)});return t.newLine?M.createElement(M.Fragment,null,M.createElement("div",{style:{flexBasis:"100%",height:0}}),d):d}return null}if(this.props.table)return this.renderItems(y,n);if(this.props.custom)return M.createElement(O.Grid2,{key:`${this.props.attr}_${this.props.index}`,container:!0,style:We.fullWidth,columnSpacing:2,rowSpacing:1,sx:a},this.renderItems(y,n));let p;if(t.collapsable)p=M.createElement(O.Accordion,{key:`${this.props.attr}_${this.props.index}`,style:We.fullWidth,expanded:!!this.state.expanded,onChange:()=>{(window._localStorage||window.localStorage).setItem(`${this.props.oContext.adapterName}.${this.props.attr}`,this.state.expanded?"false":"true"),this.setState({expanded:!this.state.expanded})}},M.createElement(O.AccordionSummary,{expandIcon:M.createElement(X.ExpandMore,null),sx:j.Utils.getStyle(this.props.oContext.theme,a,this.props.oContext.themeType&&t.darkStyle,t.color==="primary"?We.primary:t.color==="secondary"&&We.secondary,{width:"100%"})},M.createElement(O.Typography,{style:We.heading},this.getText(t.label))),M.createElement(O.AccordionDetails,null,M.createElement(O.Grid2,{container:!0,columnSpacing:2,rowSpacing:1,sx:{...a,width:"100%",padding:"10px"}},this.renderItems(y,n))));else{const d=j.Utils.getStyle(this.props.oContext.theme,this.props.style,a,{width:"100%"},this.props.isParentTab&&We.paper,this.props.isParentTab&&(this.props.withoutSaveButtons?this.props.withIcons?{height:"calc(100% - 88px) !important"}:{height:"calc(100% - 64px) !important"}:this.props.withIcons?We.paperWithIcons:We.paperWithoutIcons));p=M.createElement(O.Box,{component:"div",key:`${this.props.attr}_${this.props.index}`,className:this.props.className,sx:d},M.createElement(O.Grid2,{container:!0,columnSpacing:2,rowSpacing:1,sx:j.Utils.getStyle(this.props.oContext.theme,{width:"100%"},this.props.isParentTab&&We.padding,this.props.schema.innerStyle)},this.renderItems(y,n)))}if(!this.props.isParentTab){const d=M.createElement(O.Grid2,{title:this.getText(t.tooltip),size:{xs:t.xs||void 0,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0},sx:{marginBottom:0,textAlign:"left",...a}},p);return t.newLine?M.createElement(M.Fragment,null,M.createElement("div",{style:{flexBasis:"100%",height:0}}),d):d}return p}}const Kt={tabs:{height:"100%",width:"100%"},panel:{width:"100%",display:"block"},panelWithIcons:{height:"calc(100% - 72px)"},panelWithoutIcons:{height:"calc(100% - 48px)"}};class Sl extends K{resizeTimeout=null;refDiv;constructor(t){super(t);let n;if(this.props.root){const l=(window.location.hash||"").replace(/^#/,"").split("/");if(l.length>=3&&l[1]==="config"){const y=l[3],a=parseInt(y,10);y&&a.toString()===y?a>=0&&a<Object.keys(this.props.schema.items).length&&(n=Object.keys(this.props.schema.items)[a]):y&&Object.keys(this.props.schema.items).includes(y)&&(n=y),window.addEventListener("hashchange",this.onHashTabsChanged,!1)}}n===void 0&&(n=(window._localStorage||window.localStorage).getItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`)||Object.keys(this.props.schema.items)[0],Object.keys(this.props.schema.items).includes(n)||(n=Object.keys(this.props.schema.items)[0])),this.refDiv=M.createRef(),Object.assign(this.state,{tab:n,width:0,openMenu:null})}componentWillUnmount(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),window.removeEventListener("hashchange",this.onHashTabsChanged,!1),super.componentWillUnmount()}onHashTabsChanged=()=>{const t=(window.location.hash||"").replace(/^#/,"").split("/");if(t.length>3&&t[1]==="config"){const n=t[3],l=parseInt(n,10);let y;l.toString()===n?l>=0&&l<Object.keys(this.props.schema.items).length&&(y=Object.keys(this.props.schema.items)[l]):Object.keys(this.props.schema.items).includes(n)&&(y=n),y!==void 0&&y!==this.state.tab&&((window._localStorage||window.localStorage).setItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`,y),this.setState({tab:y}))}};getCurrentBreakpoint(){if(!this.state.width)return"md";if(!this.state.initialBreakpoint){let t;return this.state.width<600?t="xs":this.state.width<900?t="sm":this.state.width<1200?t="md":this.state.width<1536?t="lg":t="xl",setTimeout(()=>{this.setState({initialBreakpoint:t})},50),t}return this.state.initialBreakpoint}componentDidUpdate(){var t;!this.state.initialBreakpoint&&((t=this.refDiv.current)!=null&&t.clientWidth)&&this.refDiv.current.clientWidth!==this.state.width&&(this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{var n;this.resizeTimeout=null,this.setState({width:(n=this.refDiv.current)==null?void 0:n.clientWidth})},50))}onMenuChange(t){(window._localStorage||window.localStorage).setItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`,t),this.setState({tab:t},()=>{if(this.props.root){const n=(window.location.hash||"").split("/");n.length>=3&&n[1]==="config"&&(n[3]=this.state.tab,window.location.hash=n.join("/"))}})}render(){const t=this.props.schema.items;let n=!1;const l=[];Object.keys(t).map(p=>{let d;if(t[p].expertMode&&!this.props.expertMode)return;if(this.props.custom){if(this.executeCustom(t[p].hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData))return;d=this.executeCustom(t[p].disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData)}else{if(this.execute(t[p].hidden,!1,this.props.data,this.props.index,this.props.globalData))return;d=this.execute(t[p].disabled,!1,this.props.data,this.props.index,this.props.globalData)}const s=this.getIcon(t[p].icon);n=n||!!s,l.push({icon:s,disabled:d,label:this.getText(t[p].label),name:p})}),l.find(p=>p.name===this.state.tab)||setTimeout(()=>this.setState({tab:l[0].name}),50);const y=this.getCurrentBreakpoint();let a;return y==="xs"&&l.length>2?a=M.createElement(O.Toolbar,{style:{top:2,backgroundColor:this.props.oContext.themeType==="dark"?"#222":"#DDD"},variant:"dense"},M.createElement(O.IconButton,{onClick:p=>this.setState({openMenu:p.currentTarget})},M.createElement(X.Menu,null)),this.state.openMenu?M.createElement(O.Menu,{open:!0,anchorEl:this.state.openMenu,onClose:()=>this.setState({openMenu:null})},l.map(p=>M.createElement(O.MenuItem,{disabled:p.disabled,key:p.name,onClick:()=>{this.setState({openMenu:null},()=>this.onMenuChange(p.name))},selected:p.name===this.state.tab},n?M.createElement(O.ListItemIcon,null,p.icon):null,p.label))):null):a=M.createElement(O.Tabs,{variant:"scrollable",scrollButtons:"auto",style:this.props.schema.tabsStyle,value:this.state.tab,onChange:(p,d)=>this.onMenuChange(d)},l.map(p=>M.createElement(O.Tab,{id:p.name,wrapped:!0,disabled:p.disabled,key:p.name,value:p.name,iconPosition:this.props.schema.iconPosition||"start",icon:p.icon,label:p.label}))),M.createElement("div",{style:Kt.tabs,ref:this.refDiv},a,M.createElement(ft,{oContext:this.props.oContext,withoutSaveButtons:this.props.withoutSaveButtons,isParentTab:!0,changed:this.props.changed,key:this.state.tab,expertMode:this.props.expertMode,index:1001,arrayIndex:this.props.arrayIndex,globalData:this.props.globalData,commandRunning:this.props.commandRunning,style:{...Kt.panel,...n?Kt.panelWithIcons:Kt.panelWithoutIcons},common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:this.props.data,originalData:this.props.originalData,onChange:this.props.onChange,onError:this.props.onError,customObj:this.props.customObj,custom:this.props.custom,schema:t[this.state.tab],table:this.props.table,withIcons:n}))}}const Dl={root:{width:"100%",height:"100%"}};class Yt extends qe.Component{forceUpdateHandlers;errorTimeout=null;errorCached=null;oContext;constructor(t){super(t),this.state={originalData:JSON.stringify(this.props.data),changed:!1,errors:{},updateData:this.props.updateData||0,systemConfig:null,alive:!1,commandRunning:!1,schema:JSON.parse(JSON.stringify(this.props.schema))},this.forceUpdateHandlers={},this.buildDependencies(this.state.schema),this.readData()}static getDerivedStateFromProps(t,n){return t.updateData!==n.updateData?{updateData:t.updateData,originalData:JSON.stringify(t.data),schema:JSON.parse(JSON.stringify(t.schema))}:null}static async loadI18n(t,n,l){if(n===!0||n&&typeof n=="string"){const y=j.I18n.getLanguage(),a=typeof n=="string"?n:"i18n";let p=await t.fileExists(`${l}.admin`,`${a}/${y}.json`),d;if(p?d=`${a}/${y}.json`:(p=await t.fileExists(`${l}.admin`,`${a}/${y}/translations.json`),p?d=`${a}/${y}/translations.json`:y!=="en"&&(p=await t.fileExists(`${l}.admin`,`${a}/en.json`),p?d=`${a}/en.json`:(p=await t.fileExists(`${l}.admin`,`${a}/en/translations.json`),p&&(d=`${a}/en/translations.json`)))),d){const s=await t.readFile(`${l}.admin`,d);let c;s.file!==void 0?c=s.file:c=s;try{const e=JSON.parse(c);j.I18n.extendTranslations(e,y)}catch(e){return console.error(`Cannot parse language file "${l}.admin/${d}: ${e}`),""}return d}return console.warn(`Cannot find i18n for ${l} / ${d}`),""}return n&&typeof n=="object"&&j.I18n.extendTranslations(n),""}onCommandRunning=t=>this.setState({commandRunning:t});readData(){this.props.socket.getCompactSystemConfig().then(t=>this.props.socket.getState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`).then(n=>this.setState({systemConfig:t.common,alive:!!(n&&n.val)},()=>{this.updateContext(!0),this.props.custom||this.props.socket.subscribeState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,this.onAlive)}))).catch(t=>console.error(`Cannot read system config: ${t}`))}onAlive=(t,n)=>{!!(n!=null&&n.val)!==this.state.alive&&this.setState({alive:!!(n!=null&&n.val)})};onChange=(t,n,l,y)=>{if(this.props.onValueChange)this.props.onValueChange(t,n,y),l&&l();else if(t&&this.props.onChange){const a={changed:JSON.stringify(t)!==this.state.originalData};this.setState(a,()=>{this.props.onChange(t,a.changed,y),l&&l()})}else y&&this.props.onChange(null,null,y)};onError=(t,n)=>{this.errorCached=this.errorCached||JSON.parse(JSON.stringify(this.state.errors));const l=this.errorCached;n?l[t]=n:delete l[t],this.errorTimeout&&clearTimeout(this.errorTimeout),JSON.stringify(l)!==JSON.stringify(this.state.errors)?this.errorTimeout=setTimeout(()=>this.setState({errors:this.errorCached},()=>{this.errorTimeout=null,this.errorCached=null,this.props.onError(!!Object.keys(this.state.errors).length)}),50):this.errorCached=null};flatten(t,n){return n=n||{},t.items&&Object.keys(t.items).forEach(l=>{n[l]=t.items[l],this.flatten(t.items[l],n)}),n}buildDependencies(t){const n=this.flatten(t);Object.keys(n).forEach(l=>{var y,a,p,d,s,c,e,i,o,h;(y=n[l].confirm)!=null&&y.alsoDependsOn&&((a=n[l].confirm)==null||a.alsoDependsOn.forEach(r=>{if(!n[r])console.error(`[JsonConfigComponent] Attribute ${r} does not exist!`),r.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${r.replace(/^data\./,"")}" instead of "${r}"`);else{n[r].confirmDependsOn=n[r].confirmDependsOn||[];const u={...n[l],attr:l};u.confirm&&(u.confirm.cancel="Undo"),n[r].confirmDependsOn.push(u)}})),(p=n[l].onChange)!=null&&p.alsoDependsOn&&((d=n[l].onChange)==null||d.alsoDependsOn.forEach(r=>{if(!n[r])console.error(`[JsonConfigComponent] Attribute ${r} does not exist!`),r.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${r.replace(/^data\./,"")}" instead of "${r}"`);else{n[r].onChangeDependsOn=n[r].onChangeDependsOn||[];const u={...n[l],attr:l};n[r].onChangeDependsOn.push(u)}})),(s=n[l].hidden)!=null&&s.alsoDependsOn&&((c=n[l].hidden)==null||c.alsoDependsOn.forEach(r=>{if(!n[r])console.error(`[JsonConfigComponent] Attribute ${r} does not exist!`),r.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${r.replace(/^data\./,"")}" instead of "${r}"`);else{n[r].hiddenDependsOn=n[r].hiddenDependsOn||[];const u={...n[l],attr:l};n[r].hiddenDependsOn.push(u)}})),(e=n[l].label)!=null&&e.alsoDependsOn&&((i=n[l].label)==null||i.alsoDependsOn.forEach(r=>{if(!n[r])console.error(`[JsonConfigComponent] Attribute ${r} does not exist!`),r.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${r.replace(/^data\./,"")}" instead of "${r}"`);else{n[r].labelDependsOn=n[r].labelDependsOn||[];const u={...n[l],attr:l};n[r].labelDependsOn.push(u)}})),(o=n[l].help)!=null&&o.alsoDependsOn&&((h=n[l].help)==null||h.alsoDependsOn.forEach(r=>{if(!n[r])console.error(`[JsonConfigComponent] Attribute ${r} does not exist!`),r.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${r.replace(/^data\./,"")}" instead of "${r}"`);else{n[r].helpDependsOn=n[r].helpDependsOn||[];const u={...n[l],attr:l};n[r].helpDependsOn.push(u)}}))})}updateContext(t){this.oContext={DeviceManager:this.props.DeviceManager,adapterName:this.props.adapterName,changeLanguage:this.changeLanguage,common:this.props.common,customs:this.props.customs,dateFormat:this.props.dateFormat,embedded:this.props.embedded,forceUpdate:this.forceAttrUpdate,imagePrefix:this.props.imagePrefix,instance:this.props.instance,instanceObj:this.props.instanceObj,isFloatComma:this.props.isFloatComma,multiEdit:this.props.multiEdit,onBackEndCommand:this.props.onBackEndCommand,onCommandRunning:this.onCommandRunning,onValueChange:this.props.onValueChange,registerOnForceUpdate:this.registerOnForceUpdate,socket:this.props.socket,systemConfig:this.state.systemConfig,theme:this.props.theme,themeType:this.props.themeType,_themeName:this.props.themeName,updateData:this.state.updateData},t&&this.forceUpdate()}renderItem(t){return t.type==="tabs"?M.createElement(Sl,{withoutSaveButtons:this.props.withoutSaveButtons,oContext:this.oContext,alive:this.state.alive,changed:this.state.changed,commandRunning:this.state.commandRunning,common:this.props.common,custom:this.props.custom,customObj:this.props.customObj,data:this.props.data,onChange:this.onChange,onError:(n,l)=>this.onError(n,l),originalData:JSON.parse(this.state.originalData),root:!0,schema:t,expertMode:this.props.expertMode,themeName:this.props.themeName}):t.type==="panel"||!t.type?M.createElement(ft,{withoutSaveButtons:this.props.withoutSaveButtons,oContext:this.oContext,alive:this.state.alive,changed:this.state.changed,commandRunning:this.state.commandRunning,common:this.props.common,custom:this.props.custom,customObj:this.props.customObj,data:this.props.data,expertMode:this.props.expertMode,index:1e3,isParentTab:!this.props.embedded&&!this.props.withoutSaveButtons,onChange:this.onChange,onError:(n,l)=>this.onError(n,l),originalData:JSON.parse(this.state.originalData),root:!0,schema:t,themeName:this.props.themeName}):(console.error(`Unknown item type in root: ${JSON.stringify(t)}`),null)}changeLanguage=()=>{this.forceUpdate()};forceAttrUpdate=(t,n)=>{Array.isArray(t)?t.forEach(l=>this.forceUpdateHandlers[l]&&this.forceUpdateHandlers[l](n)):this.forceUpdateHandlers[t]&&this.forceUpdateHandlers[t](n)};registerOnForceUpdate=(t,n)=>{n?this.forceUpdateHandlers[t]=n:this.forceUpdateHandlers[t]&&delete this.forceUpdateHandlers[t]};render(){return!this.state.systemConfig||!this.oContext?M.createElement(O.LinearProgress,null):(this.oContext._themeName!==this.props.themeName&&(this.oContext._themeName=this.props.themeName,setTimeout(()=>this.updateContext(!0),0)),M.createElement("div",{style:{...!this.props.embedded||this.props.withoutSaveButtons?Dl.root:void 0,...this.props.style,...this.state.schema.style}},this.renderItem(this.state.schema)))}}const ht={root:{width:"100%",height:"100%",overflow:"hidden",position:"relative"},scroll:{height:"calc(100% - 48px)",overflowY:"auto"},exportImportButtons:{position:"absolute",top:5,right:0,zIndex:3},button:{marginRight:"5px"},tooltip:{pointerEvents:"none"}};function xl(L,t){let n="";for(let l=0;l<t.length;l++)n+=String.fromCharCode(L[l%L.length].charCodeAt(0)^t.charCodeAt(l));return n}function Al(L,t){let n="";for(let l=0;l<t.length;l++)n+=String.fromCharCode(L[l%L.length].charCodeAt(0)^t.charCodeAt(l));return n}function $l(L,t){if(typeof t!="string")return t;if(!t.startsWith("$/aes-192-cbc:")||!/^[0-9a-f]{48}$/.test(L))return xl(L,t);const n=t.split(":",3),l=window.CryptoJS.enc.Hex.parse(L),y=window.CryptoJS.enc.Hex.parse(n[1]),a=window.CryptoJS.lib.CipherParams.create({ciphertext:window.CryptoJS.enc.Hex.parse(n[2])}),p=window.CryptoJS.AES.decrypt(a,l,{iv:y});return window.CryptoJS.enc.Utf8.stringify(p)}function Tl(L,t,n){if(typeof t!="string")return t;if(!/^[0-9a-f]{48}$/.test(L))return Al(L,t);let l;l=window.CryptoJS.lib.WordArray.random(128/8);const y=window.CryptoJS.enc.Hex.parse(L),a=window.CryptoJS.AES.encrypt(t,y,{iv:l}).ciphertext;return`$/aes-192-cbc:${window.CryptoJS.enc.Hex.stringify(l)}:${a}`}function $i(L,t){var n;return document.getElementById(t)?(n=document.getElementById(t))==null?void 0:n.onload:new Promise(l=>{const y=document.createElement("script");y.setAttribute("id",t),y.onload=l,y.src=L,document.getElementsByTagName("head")[0].appendChild(y)})}let _l=class extends j.Router{fileSubscribed=[];fileLangSubscribed="";secret;constructor(t){super(t),this.state={updateData:0,changed:!1,confirmDialog:!1,theme:j.Theme(t.themeName),saveConfigDialog:!1,hash:"_"},this.secret=t.secret||"",this.getInstanceObject().then(n=>this.getConfigFile().then(l=>Yt.loadI18n(this.props.socket,l==null?void 0:l.i18n,this.props.adapterName).then(y=>{y&&(this.fileLangSubscribed||(this.fileLangSubscribed=y,this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,this.fileLangSubscribed,this.onFileChange))),n?this.setState({schema:l,data:n.native,common:n.common,hash:ti(JSON.stringify(l)).toString()}):window.alert(`Instance system.adapter.${this.props.adapterName}.${this.props.instance} not found!`)})))}componentWillUnmount(){super.componentWillUnmount(),this.fileSubscribed.length&&(this.props.socket.unsubscribeFiles(`${this.props.adapterName}.admin`,this.fileSubscribed,this.onFileChange),this.fileSubscribed=[]),this.fileLangSubscribed&&(this.props.socket.unsubscribeFiles(`${this.props.adapterName}.admin`,this.fileLangSubscribed,this.onFileChange),this.fileLangSubscribed="")}handleFileSelect=t=>{const n=t.target.files[0];if(n){const l=new FileReader;l.onload=y=>{if(!y.target)return;const a=y.target.result;try{const p=JSON.parse(a);this.setState({data:p,changed:JSON.stringify(p)!==JSON.stringify(this.state.originalData)})}catch{window.alert(j.I18n.t("[JsonConfig] Failed to parse JSON file"))}},l.readAsText(n)}else window.alert(j.I18n.t("[JsonConfig] Failed to open JSON File"))};getExportImportButtons(){return M.createElement("div",{style:ht.exportImportButtons},M.createElement(O.Tooltip,{title:this.props.t("Import settings from JSON file"),slotProps:{popper:{sx:ht.tooltip}}},M.createElement(O.Fab,{size:"small",sx:{"&.MuiFab-root":ht.button},onClick:()=>{const t=document.createElement("input");t.setAttribute("type","file"),t.setAttribute("id","files"),t.setAttribute("opacity",0),t.addEventListener("change",n=>this.handleFileSelect(n),!1),t.click()}},M.createElement(X.Publish,null))),M.createElement(O.Tooltip,{title:this.props.t("Export setting to JSON file"),slotProps:{popper:{sx:ht.tooltip}}},M.createElement(O.Fab,{size:"small",sx:{"&.MuiFab-root":ht.button},onClick:()=>{this.state.data&&j.Utils.generateFile(`${this.props.adapterName}.${this.props.instance}.json`,this.state.data)}},M.createElement(X.Publish,{style:{transform:"rotate(180deg)"}}))))}onFileChange=async(t,n,l)=>{var y;if(t===`${this.props.adapterName}.admin`&&l){if(n===this.fileLangSubscribed)try{await Yt.loadI18n(this.props.socket,(y=this.state.schema)==null?void 0:y.i18n,this.props.adapterName),this.setState({hash:`${this.state.hash}1`})}catch{}else if(this.fileSubscribed.includes(n))try{const a=await this.getConfigFile(this.fileSubscribed[0]);this.setState({schema:a,hash:ti(JSON.stringify(a)).toString()})}catch{}}};async getInstanceObject(){var t;try{const n=await this.props.socket.getObject(`system.adapter.${this.props.adapterName}.${this.props.instance}`);if(Array.isArray(n.encryptedNative)){if(!this.secret){const l=await this.props.socket.getSystemConfig();await $i("../../lib/js/crypto-js/crypto-js.js","crypto-js"),this.secret=l.native.secret}return(t=n.encryptedNative)==null||t.forEach(l=>{n.native[l]&&(n.native[l]=$l(this.secret,n.native[l]))}),n}return n}catch(n){window.alert(`[JsonConfig] Cannot read instance object: ${n}`)}return null}renderDialogConfirm(){return this.state.confirmDialog?M.createElement(j.DialogConfirm,{title:j.I18n.t("ra_Please confirm"),text:j.I18n.t("ra_Some data are not stored. Discard?"),ok:j.I18n.t("ra_Discard"),cancel:j.I18n.t("ra_Cancel"),onClose:t=>this.setState({confirmDialog:!1},()=>t&&j.Router.doNavigate(null))}):null}async scanForInclude(t,n){if(typeof t["#include"]=="string"){const y=await this._getConfigFile(t["#include"],[...n]);return delete t["#include"],y&&(t={...t,...y}),t}const l=Object.keys(t);for(let y=0;y<l.length;y++)t[l[y]]&&typeof t[l[y]]=="object"&&(t[l[y]]=await this.scanForInclude(t[l[y]],n));return t}async getConfigFile(t){return this._getConfigFile(t)}async _getConfigFile(t,n){if(t=t||"jsonConfig.json5",n=n||[],n.includes(t))return window.alert(`[JsonConfig] Circular reference in file: ${t} => ${n.join(" => ")}`),null;n.push(t);try{await this.props.socket.fileExists(`${this.props.adapterName}.admin`,t)||(t="jsonConfig.json");const y=await this.props.socket.readFile(`${this.props.adapterName}.admin`,t);let a="",p="";if(y.file!==void 0&&(p=y.file),typeof p=="string")a=p;else if(p.type==="Buffer"){let d="";const s=new Uint8Array(p.data),c=s.byteLength;for(let e=0;e<c;e++)d+=String.fromCharCode(s[e]);a=d}this.fileSubscribed.includes(t)||(this.fileSubscribed.push(t),await this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,t,this.onFileChange));try{return await this.scanForInclude(Li.parse(a),n)}catch(d){window.alert("[JsonConfig] Cannot parse json5 config!"),console.log(d)}}catch(l){this.state.schema||window.alert(`[JsonConfig] Cannot read file "${t}: ${l}`)}return null}renderSaveConfigDialog(){return this.state.saveConfigDialog?M.createElement(j.DialogConfirm,{title:j.I18n.t("ra_Please confirm"),text:j.I18n.t("Save configuration?"),ok:j.I18n.t("ra_Save"),cancel:j.I18n.t("ra_Cancel"),onClose:t=>this.setState({saveConfigDialog:!1},()=>t&&this.onSave(!0))}):null}findAttr(t,n){if(n=n||this.state.schema,n!=null&&n.items){if(t in n.items)return n.items[t];for(const l of Object.values(n.items)){const y=this.findAttr(t,l);if(y)return y}}return null}postProcessing(t,n,l){if(l=l||this.state.schema,!t){console.error(`Data is empty in postProcessing: ${n}, ${JSON.stringify(l)}`);return}const y=t[n];if(l.items)if(l.type==="table"){const a=y;if(!Array.isArray(a))return;for(const p of a)for(const d of l.items)this.postProcessing(p,d.attr,d)}else for(const[a,p]of Object.entries(l.items)){if(p.type==="panel"||p.type==="tabs"||p.type==="accordion")return;this.postProcessing(t,a,p)}else if(n&&typeof y=="string")if(l.type==="text")l.trim!==!1&&(t[n]=y.trim());else if(l.type==="ip")t[n]=y.trim();else if(l.type==="number"){const a=parseFloat(y.toString().replace(",","."));l.min!==void 0&&a<l.min?t[n]=l.min:l.max!==void 0&&a>l.max?t[n]=l.max:t[n]=a}else if(l.type==="port"){const a=parseInt(y.toString(),10);l.min!==void 0&&a<l.min?t[n]=l.min:l.max!==void 0&&a>l.max&&(t[n]=l.max),t[n]!==0&&a<20?t[n]=20:a>65535?t[n]=65535:t[n]=a}else l.type==="checkbox"&&(t[n]=t[n]===!0||t[n]==="true"||t[n]==="on"||t[n]===1||t[n]==="1")}async onSave(t,n){if(t){const l=await this.getInstanceObject();if(!l){console.error("Something went wrong: may be no connection?"),window.alert("Something went wrong: may be no connection?");return}if(!this.state.data||!this.state.schema)return;const y={};for(const p of Object.keys(this.state.data)){const d=this.findAttr(p);(!d||!d.doNotSave||d.type==="state")&&!p.startsWith("_")?K.setValue(l.native,p,this.state.data[p]):(K.setValue(l.native,p,null),y[p]=this.state.data[p])}try{const p=JSON.parse(JSON.stringify(l));if(Array.isArray(p.encryptedNative)){await $i("../../lib/js/crypto-js/crypto-js.js","crypto-js");for(const d of p.encryptedNative)p.native[d]&&(p.native[d]=Tl(this.secret,p.native[d]))}await this.props.socket.setObject(p._id,p)}catch(p){window.alert(`[JsonConfig] Cannot set object: ${p}`)}const a={...l.native,...y};console.log(a),this.setState({changed:!1,data:a,updateData:this.state.updateData+1,originalData:a},()=>n&&j.Router.doNavigate(null))}else this.state.changed?this.setState({confirmDialog:!0}):j.Router.doNavigate(null)}componentDidUpdate(t,n){n.changed!==this.state.changed&&this.props.configStored(!this.state.changed)}async componentDidMount(){const t=`${window.location.protocol}//${window.location.host}${window.location.pathname}validate_config/${this.props.adapterName}`;console.log(`fetch ${t}`),await fetch(t)}render(){return!this.state.data||!this.state.schema?M.createElement(O.LinearProgress,null):M.createElement("div",{style:ht.root},this.renderDialogConfirm(),this.getExportImportButtons(),this.renderSaveConfigDialog(),M.createElement(Yt,{key:this.state.hash,style:ht.scroll,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,adapterName:this.props.adapterName,instance:this.props.instance,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat,schema:this.state.schema,common:this.state.common,expertMode:this.props.expertMode,data:this.state.data,updateData:this.state.updateData,onError:t=>this.setState({error:t}),onChange:(t,n,l)=>{l&&this.state.error&&(window.alert(j.I18n.t("Cannot save configuration because of error in configuration")),l=!1),l&&!this.state.changed&&!n&&(l=!1),t?this.setState({data:t,changed:n,saveConfigDialog:l}):l!==void 0&&this.setState({saveConfigDialog:l})},DeviceManager:this.props.DeviceManager,theme:this.state.theme}),M.createElement(j.SaveCloseButtons,{isIFrame:!1,dense:!0,paddingLeft:0,newReact:!0,theme:this.state.theme,noTextOnButtons:this.props.width==="xs"||this.props.width==="sm"||this.props.width==="md",changed:!!(this.state.error||this.state.changed),error:!!this.state.error,onSave:t=>this.onSave(!0,t),onClose:()=>this.onSave(!1)}))}};export{K as ConfigGeneric,ft as ConfigPanel,_l as JsonConfig,Yt as JsonConfigComponent};
|