iobroker.admin 7.6.3 → 7.6.4
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 +7 -4
- package/admin/custom/assets/AdminComponentEasyAccessSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-DnBKtZGU.js +1 -0
- package/admin/custom/assets/AdminComponentEasyAccessSet__loadShare__react__loadShare__-CEWlgS6L.js +1 -0
- package/admin/custom/assets/AdminComponentEasyAccessSet__loadShare__react_mf_2_dom__loadShare__-BaTCLP1q.js +1 -0
- package/admin/custom/assets/Components-BGVs6Dmn.js +1 -0
- package/admin/custom/assets/TextField-ChPwodvp.js +109 -0
- package/admin/custom/assets/_commonjsHelpers-D6-XlEtG.js +1 -0
- package/admin/custom/assets/bootstrap-CTERJrgr.js +1 -0
- package/admin/custom/assets/createSvgIcon-D2osie2l.js +7 -0
- package/admin/custom/assets/defaultTheme-CFicWEn0.js +16 -0
- package/admin/custom/assets/hostInit-DAQ2zgXM.js +1 -1
- package/admin/custom/assets/index-BqaC8TTV.js +1397 -0
- package/admin/custom/assets/index-BwCOsmBT.js +31 -0
- package/admin/custom/assets/index-C9L9KccV.js +779 -0
- package/admin/custom/assets/index-CGID5h1b.js +779 -0
- package/{adminWww/assets/index-Di7Jseht.js → admin/custom/assets/index-Co3YA5NW.js} +1 -1
- package/admin/custom/assets/index-DIVai5gZ.js +119 -0
- package/admin/custom/assets/index-DrWcIcrD.js +1 -0
- package/admin/custom/assets/index-IIKn7Ixx.js +1 -0
- package/admin/custom/assets/index-PIXQ0sh_.js +2 -0
- package/admin/custom/assets/index-eQxyhk2m.js +24 -0
- package/admin/custom/assets/jsx-runtime-Bhtgc1Ek.js +9 -0
- package/admin/custom/assets/useTheme-COyz47gO.js +1 -0
- package/admin/custom/assets/virtualExposes-BufY-8i6.js +2 -0
- package/admin/custom/customComponents.js +2 -2
- package/admin/i18n/{de/translations.json → de.json} +35 -34
- package/admin/i18n/{en/translations.json → en.json} +38 -37
- package/admin/i18n/{es/translations.json → es.json} +39 -38
- package/admin/i18n/{fr/translations.json → fr.json} +39 -38
- package/admin/i18n/{it/translations.json → it.json} +39 -38
- package/admin/i18n/{nl/translations.json → nl.json} +39 -38
- package/admin/i18n/{pl/translations.json → pl.json} +39 -38
- package/admin/i18n/{pt/translations.json → pt.json} +39 -38
- package/admin/i18n/{ru/translations.json → ru.json} +39 -38
- package/admin/i18n/{uk/translations.json → uk.json} +7 -6
- package/admin/i18n/{zh-cn/translations.json → zh-cn.json} +39 -38
- package/admin/jsonConfig.json5 +9 -0
- package/adminWww/assets/{AdapterUpdateDialog-CRermRaB.js → AdapterUpdateDialog-D5A35Ofn.js} +1 -1
- package/adminWww/assets/{Adapters-Bs8G-cxo.js → Adapters-QfGvr9Xv.js} +1 -1
- package/adminWww/assets/{Config-Di_mkCPb.js → Config-J_9jPJSh.js} +1 -1
- package/adminWww/assets/{CustomModal-BTTKhEC8.js → CustomModal-_hsT1UfZ.js} +1 -1
- package/adminWww/assets/{CustomTab-D6Mn63bB.js → CustomTab-k0r6if9B.js} +1 -1
- package/adminWww/assets/{DefaultPropsProvider-Beyggw1o.js → DefaultPropsProvider-BrbE0teb.js} +2 -2
- package/adminWww/assets/{EasyMode-DKcbIjJ6.js → EasyMode-BR5t1u_s.js} +1 -1
- package/adminWww/assets/{Enums-uOeKEKzl.js → Enums-DyPrfI2O.js} +1 -1
- package/adminWww/assets/{Fields-TuYhaeX9.js → Fields-Vpif7eQH.js} +1 -1
- package/adminWww/assets/{Files-BhPaQLPw.js → Files-XKQDh_3j.js} +1 -1
- package/adminWww/assets/FilledInput-D-tz8rvg.js +2 -0
- package/adminWww/assets/{Hosts-BNvz1qdC.js → Hosts-Dt3S3r7E.js} +1 -1
- package/adminWww/assets/Instances-Da-mNkXP.js +2 -0
- package/adminWww/assets/{Intro-Dih9urjd.js → Intro-pr1AT7Gn.js} +1 -1
- package/adminWww/assets/{Logs-C8bVKj2s.js → Logs-CoAIXCkZ.js} +1 -1
- package/adminWww/assets/{Objects-CD7n6XMI.js → Objects-CwBnoFN-.js} +1 -1
- package/adminWww/assets/{State-Bs4eLVUn.js → State-XZNqqv8y.js} +1 -1
- package/adminWww/assets/{Tabs-C57_YqtR.js → Tabs-CFvfAcjP.js} +10 -10
- package/adminWww/assets/{Users-DMJv0VQ1.js → Users-y0PgSeFL.js} +1 -1
- package/adminWww/assets/_commonjsHelpers-D6-XlEtG.js +1 -0
- package/adminWww/assets/ace-B1YQ8uqS.js +980 -0
- package/adminWww/assets/blueGrey-B0oIowPK.js +29 -0
- package/adminWww/assets/{bootstrap-DF1rNJUh.js → bootstrap-FVlt-hkS.js} +90 -91
- package/adminWww/assets/{createSvgIcon-DHNqxcCi.js → createSvgIcon-DH-uXnd0.js} +1 -1
- package/adminWww/assets/{emotion-react.browser.esm-DHkeNZGw.js → emotion-react.browser.esm-DApPKwaj.js} +1 -1
- package/adminWww/assets/{emotion-styled.browser.esm-DkldMRyw.js → emotion-styled.browser.esm-Dc05hmeu.js} +1 -1
- package/adminWww/assets/{emotion-utils.browser.esm-CKteYtrd.js → emotion-utils.browser.esm-DOjH6Olm.js} +1 -1
- package/adminWww/assets/{geosearch.module-cgRkjHe4.js → geosearch.module-CWfRtxrN.js} +1 -1
- package/adminWww/assets/{iconBase-CxzgaDaB.js → iconBase-CgxZ5MMC.js} +1 -1
- package/adminWww/assets/{index-ChNtEgbM.js → index-BN8A2xkW.js} +1 -1
- package/adminWww/assets/{index-DGeySK-Q.js → index-BXSb0Ud9.js} +2 -2
- package/adminWww/assets/index-Bj8P5tgE.js +55 -0
- package/adminWww/assets/{index-C3WYIc6x.js → index-Bsv_DXxB.js} +1 -1
- package/adminWww/assets/{index-SuMq84bM.js → index-C1TmeS7j.js} +1 -1
- package/adminWww/assets/{index-BMTRswnc.js → index-CJvbfjSs.js} +1 -1
- package/adminWww/assets/index-Cm4u8yKm.js +7 -0
- package/adminWww/assets/index-Co3YA5NW.js +9 -0
- package/adminWww/assets/{index-DgvYPGcD.js → index-D7Rlw-5R.js} +1 -1
- package/adminWww/assets/{index-BmaLPlND.js → index-DiMYzxTU.js} +1 -1
- package/adminWww/assets/{index-CFcKrkeG.js → index-HOidq_rM.js} +1 -1
- package/adminWww/assets/{index-Dhk9onlg.js → index-gHyOgbGJ.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare__leaflet__loadShare__-FMqZHPyC.js → iobroker_admin__loadShare__leaflet__loadShare__-B1OZ7tj-.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare__prop_mf_2_types__loadShare__-C8Lvs8Es.js → iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BGyJCibC.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare__react__loadShare__-T96CJO0k.js → iobroker_admin__loadShare__react__loadShare__-DtlEM_52.js} +1 -1
- package/adminWww/assets/{leaflet-src-CnimXdd7.js → leaflet-src-A2ZHl6nF.js} +1 -1
- package/adminWww/assets/{sentry-ClQ-PGjf.js → sentry-AXxoSb7Q.js} +1 -1
- package/adminWww/assets/{zh-cn-DrUOm-Ho.js → zh-cn-49uPQVT0.js} +1 -1
- package/adminWww/index.html +1 -1
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/remoteEntry.js +2 -2
- package/build-backend/lib/utils.js +10 -10
- package/build-backend/lib/utils.js.map +1 -1
- package/build-backend/lib/web.js +7 -1
- package/build-backend/lib/web.js.map +1 -1
- package/build-backend/main.js +4 -1
- package/build-backend/main.js.map +1 -1
- package/io-package.json +17 -14
- package/package.json +10 -11
- package/adminWww/assets/FilledInput-Bfz0Aef-.js +0 -2
- package/adminWww/assets/Instances-L7eZoDyM.js +0 -2
- package/adminWww/assets/_commonjsHelpers-BosuxZz1.js +0 -1
- package/adminWww/assets/ace-BAuRYJjv.js +0 -978
- package/adminWww/assets/blueGrey-BKTirx-Z.js +0 -29
- package/adminWww/assets/index-Cmq0Omjs.js +0 -55
- package/adminWww/assets/index-lAM5Xnu_.js +0 -7
|
@@ -0,0 +1,1397 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DrWcIcrD.js","./useTheme-COyz47gO.js","./_commonjsHelpers-D6-XlEtG.js","./AdminComponentEasyAccessSet__loadShare__react__loadShare__-CEWlgS6L.js","./AdminComponentEasyAccessSet__mf_v__runtimeInit__mf_v__-JbSPU0nV.js","./defaultTheme-CFicWEn0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{R as I,A as J}from"./AdminComponentEasyAccessSet__loadShare__react__loadShare__-CEWlgS6L.js";import{a as gl,c as gt,g as vl}from"./_commonjsHelpers-D6-XlEtG.js";import{A as B}from"./AdminComponentEasyAccessSet__loadShare___mf_0_mui_mf_1_material__loadShare__-CyJ0aZA_.js";import{A as oe,C as yl,I as bl,D as qs}from"./index-BwCOsmBT.js";import{A as G,a as wl}from"./AdminComponentEasyAccessSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-DnBKtZGU.js";import{R as Cl}from"./AdminComponentEasyAccessSet__loadShare__react_mf_2_dom__loadShare__-BaTCLP1q.js";import{bG as Dl,bH as Sl,bI as Se,T as xl,al as El,aD as Le,N as Mt,r as Ne,j as Xt,I as Fn,d as pn,l as be,u as Ht,k as Rn,c as ht,ac as eo,av as to,B as Al,ap as no,x as Fi,a6 as Tl,aq as kl,an as $l,am as Ml,az as io,ak as Ri,bJ as ro,U as Ar,a9 as _l,aC as Il,D as tr,P as Ll,m as Fl,af as Yn,ai as Rl,ar as Ol,as as Pl,C as Nl,bK as Oi,ah as Bl,aQ as is,aj as Vl}from"./TextField-ChPwodvp.js";import{b as Wl,D as Ft,e as Hl}from"./defaultTheme-CFicWEn0.js";import{i as gr}from"./AdminComponentEasyAccessSet__mf_v__runtimeInit__mf_v__-JbSPU0nV.js";import{_ as Y,f as qt,g as We,d as He,c as je,e as ge,b as Oe,l as jl}from"./createSvgIcon-D2osie2l.js";import{j as ee}from"./jsx-runtime-Bhtgc1Ek.js";import{P as K,b as so,p as Tr}from"./useTheme-COyz47gO.js";import{_ as zl}from"./preload-helper-C1FmrZbK.js";const Ul=Object.freeze(Object.defineProperty({__proto__:null,get ConfigGeneric(){return X},get ConfigPanel(){return wn},get JsonConfig(){return Yv},get JsonConfigComponent(){return Ti}},Symbol.toStringTag,{value:"Module"})),Pi=K.oneOfType([K.func,K.object]);function Gl(d,e){return d.classList?!!e&&d.classList.contains(e):(" "+(d.className.baseVal||d.className)+" ").indexOf(" "+e+" ")!==-1}function Kl(d,e){d.classList?d.classList.add(e):Gl(d,e)||(typeof d.className=="string"?d.className=d.className+" "+e:d.setAttribute("class",(d.className&&d.className.baseVal||"")+" "+e))}function rs(d,e){return d.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Yl(d,e){d.classList?d.classList.remove(e):typeof d.className=="string"?d.className=rs(d.className,e):d.setAttribute("class",rs(d.className&&d.className.baseVal||"",e))}var Jl=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return Kl(e,n)})},nr=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return Yl(e,n)})},kr=function(d){Dl(e,d);function e(){for(var n,m=arguments.length,i=new Array(m),a=0;a<m;a++)i[a]=arguments[a];return n=d.call.apply(d,[this].concat(i))||this,n.appliedClasses={appear:{},enter:{},exit:{}},n.onEnter=function(p,o){var h=n.resolveArguments(p,o),r=h[0],s=h[1];n.removeClasses(r,"exit"),n.addClass(r,s?"appear":"enter","base"),n.props.onEnter&&n.props.onEnter(p,o)},n.onEntering=function(p,o){var h=n.resolveArguments(p,o),r=h[0],s=h[1],l=s?"appear":"enter";n.addClass(r,l,"active"),n.props.onEntering&&n.props.onEntering(p,o)},n.onEntered=function(p,o){var h=n.resolveArguments(p,o),r=h[0],s=h[1],l=s?"appear":"enter";n.removeClasses(r,l),n.addClass(r,l,"done"),n.props.onEntered&&n.props.onEntered(p,o)},n.onExit=function(p){var o=n.resolveArguments(p),h=o[0];n.removeClasses(h,"appear"),n.removeClasses(h,"enter"),n.addClass(h,"exit","base"),n.props.onExit&&n.props.onExit(p)},n.onExiting=function(p){var o=n.resolveArguments(p),h=o[0];n.addClass(h,"exit","active"),n.props.onExiting&&n.props.onExiting(p)},n.onExited=function(p){var o=n.resolveArguments(p),h=o[0];n.removeClasses(h,"exit"),n.addClass(h,"exit","done"),n.props.onExited&&n.props.onExited(p)},n.resolveArguments=function(p,o){return n.props.nodeRef?[n.props.nodeRef.current,p]:[p,o]},n.getClassNames=function(p){var o=n.props.classNames,h=typeof o=="string",r=h&&o?o+"-":"",s=h?""+r+p:o[p],l=h?s+"-active":o[p+"Active"],u=h?s+"-done":o[p+"Done"];return{baseClassName:s,activeClassName:l,doneClassName:u}},n}var t=e.prototype;return t.addClass=function(m,i,a){var p=this.getClassNames(i)[a+"ClassName"],o=this.getClassNames("enter"),h=o.doneClassName;i==="appear"&&a==="done"&&h&&(p+=" "+h),a==="active"&&m&&Sl(m),p&&(this.appliedClasses[i][a]=p,Jl(m,p))},t.removeClasses=function(m,i){var a=this.appliedClasses[i],p=a.base,o=a.active,h=a.done;this.appliedClasses[i]={},p&&nr(m,p),o&&nr(m,o),h&&nr(m,h)},t.render=function(){var m=this.props;m.classNames;var i=Se(m,["classNames"]);return I.createElement(xl,Y({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(I.Component);kr.defaultProps={classNames:""};kr.propTypes={};var Ql=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Zl=/[\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]/,Xl=/[\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]/,ir={Space_Separator:Ql,ID_Start:Zl,ID_Continue:Xl},tt={isSpaceSeparator(d){return typeof d=="string"&&ir.Space_Separator.test(d)},isIdStartChar(d){return typeof d=="string"&&(d>="a"&&d<="z"||d>="A"&&d<="Z"||d==="$"||d==="_"||ir.ID_Start.test(d))},isIdContinueChar(d){return typeof d=="string"&&(d>="a"&&d<="z"||d>="A"&&d<="Z"||d>="0"&&d<="9"||d==="$"||d==="_"||d===""||d===""||ir.ID_Continue.test(d))},isDigit(d){return typeof d=="string"&&/[0-9]/.test(d)},isHexDigit(d){return typeof d=="string"&&/[0-9A-Fa-f]/.test(d)}};let vr,ut,Bt,ki,Qt,$t,rt,$r,Qn;var ql=function(e,t){vr=String(e),ut="start",Bt=[],ki=0,Qt=1,$t=0,rt=void 0,$r=void 0,Qn=void 0;do rt=ec(),ic[ut]();while(rt.type!=="eof");return typeof t=="function"?yr({"":Qn},"",t):Qn};function yr(d,e,t){const n=d[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let m=0;m<n.length;m++){const i=String(m),a=yr(n,i,t);a===void 0?delete n[i]:Object.defineProperty(n,i,{value:a,writable:!0,enumerable:!0,configurable:!0})}else for(const m in n){const i=yr(n,m,t);i===void 0?delete n[m]:Object.defineProperty(n,m,{value:i,writable:!0,enumerable:!0,configurable:!0})}return t.call(d,e,n)}let Me,Ae,Jn,Nt,Fe;function ec(){for(Me="default",Ae="",Jn=!1,Nt=1;;){Fe=Vt();const d=oo[Me]();if(d)return d}}function Vt(){if(vr[ki])return String.fromCodePoint(vr.codePointAt(ki))}function ce(){const d=Vt();return d===`
|
|
3
|
+
`?(Qt++,$t=0):d?$t+=d.length:$t++,d&&(ki+=d.length),d}const oo={default(){switch(Fe){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
|
|
4
|
+
`:case"\r":case"\u2028":case"\u2029":ce();return;case"/":ce(),Me="comment";return;case void 0:return ce(),Je("eof")}if(tt.isSpaceSeparator(Fe)){ce();return}return oo[ut]()},comment(){switch(Fe){case"*":ce(),Me="multiLineComment";return;case"/":ce(),Me="singleLineComment";return}throw Qe(ce())},multiLineComment(){switch(Fe){case"*":ce(),Me="multiLineCommentAsterisk";return;case void 0:throw Qe(ce())}ce()},multiLineCommentAsterisk(){switch(Fe){case"*":ce();return;case"/":ce(),Me="default";return;case void 0:throw Qe(ce())}ce(),Me="multiLineComment"},singleLineComment(){switch(Fe){case`
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":ce(),Me="default";return;case void 0:return ce(),Je("eof")}ce()},value(){switch(Fe){case"{":case"[":return Je("punctuator",ce());case"n":return ce(),on("ull"),Je("null",null);case"t":return ce(),on("rue"),Je("boolean",!0);case"f":return ce(),on("alse"),Je("boolean",!1);case"-":case"+":ce()==="-"&&(Nt=-1),Me="sign";return;case".":Ae=ce(),Me="decimalPointLeading";return;case"0":Ae=ce(),Me="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":Ae=ce(),Me="decimalInteger";return;case"I":return ce(),on("nfinity"),Je("numeric",1/0);case"N":return ce(),on("aN"),Je("numeric",NaN);case'"':case"'":Jn=ce()==='"',Ae="",Me="string";return}throw Qe(ce())},identifierNameStartEscape(){if(Fe!=="u")throw Qe(ce());ce();const d=br();switch(d){case"$":case"_":break;default:if(!tt.isIdStartChar(d))throw ss();break}Ae+=d,Me="identifierName"},identifierName(){switch(Fe){case"$":case"_":case"":case"":Ae+=ce();return;case"\\":ce(),Me="identifierNameEscape";return}if(tt.isIdContinueChar(Fe)){Ae+=ce();return}return Je("identifier",Ae)},identifierNameEscape(){if(Fe!=="u")throw Qe(ce());ce();const d=br();switch(d){case"$":case"_":case"":case"":break;default:if(!tt.isIdContinueChar(d))throw ss();break}Ae+=d,Me="identifierName"},sign(){switch(Fe){case".":Ae=ce(),Me="decimalPointLeading";return;case"0":Ae=ce(),Me="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":Ae=ce(),Me="decimalInteger";return;case"I":return ce(),on("nfinity"),Je("numeric",Nt*(1/0));case"N":return ce(),on("aN"),Je("numeric",NaN)}throw Qe(ce())},zero(){switch(Fe){case".":Ae+=ce(),Me="decimalPoint";return;case"e":case"E":Ae+=ce(),Me="decimalExponent";return;case"x":case"X":Ae+=ce(),Me="hexadecimal";return}return Je("numeric",Nt*0)},decimalInteger(){switch(Fe){case".":Ae+=ce(),Me="decimalPoint";return;case"e":case"E":Ae+=ce(),Me="decimalExponent";return}if(tt.isDigit(Fe)){Ae+=ce();return}return Je("numeric",Nt*Number(Ae))},decimalPointLeading(){if(tt.isDigit(Fe)){Ae+=ce(),Me="decimalFraction";return}throw Qe(ce())},decimalPoint(){switch(Fe){case"e":case"E":Ae+=ce(),Me="decimalExponent";return}if(tt.isDigit(Fe)){Ae+=ce(),Me="decimalFraction";return}return Je("numeric",Nt*Number(Ae))},decimalFraction(){switch(Fe){case"e":case"E":Ae+=ce(),Me="decimalExponent";return}if(tt.isDigit(Fe)){Ae+=ce();return}return Je("numeric",Nt*Number(Ae))},decimalExponent(){switch(Fe){case"+":case"-":Ae+=ce(),Me="decimalExponentSign";return}if(tt.isDigit(Fe)){Ae+=ce(),Me="decimalExponentInteger";return}throw Qe(ce())},decimalExponentSign(){if(tt.isDigit(Fe)){Ae+=ce(),Me="decimalExponentInteger";return}throw Qe(ce())},decimalExponentInteger(){if(tt.isDigit(Fe)){Ae+=ce();return}return Je("numeric",Nt*Number(Ae))},hexadecimal(){if(tt.isHexDigit(Fe)){Ae+=ce(),Me="hexadecimalInteger";return}throw Qe(ce())},hexadecimalInteger(){if(tt.isHexDigit(Fe)){Ae+=ce();return}return Je("numeric",Nt*Number(Ae))},string(){switch(Fe){case"\\":ce(),Ae+=tc();return;case'"':if(Jn)return ce(),Je("string",Ae);Ae+=ce();return;case"'":if(!Jn)return ce(),Je("string",Ae);Ae+=ce();return;case`
|
|
6
|
+
`:case"\r":throw Qe(ce());case"\u2028":case"\u2029":rc(Fe);break;case void 0:throw Qe(ce())}Ae+=ce()},start(){switch(Fe){case"{":case"[":return Je("punctuator",ce())}Me="value"},beforePropertyName(){switch(Fe){case"$":case"_":Ae=ce(),Me="identifierName";return;case"\\":ce(),Me="identifierNameStartEscape";return;case"}":return Je("punctuator",ce());case'"':case"'":Jn=ce()==='"',Me="string";return}if(tt.isIdStartChar(Fe)){Ae+=ce(),Me="identifierName";return}throw Qe(ce())},afterPropertyName(){if(Fe===":")return Je("punctuator",ce());throw Qe(ce())},beforePropertyValue(){Me="value"},afterPropertyValue(){switch(Fe){case",":case"}":return Je("punctuator",ce())}throw Qe(ce())},beforeArrayValue(){if(Fe==="]")return Je("punctuator",ce());Me="value"},afterArrayValue(){switch(Fe){case",":case"]":return Je("punctuator",ce())}throw Qe(ce())},end(){throw Qe(ce())}};function Je(d,e){return{type:d,value:e,line:Qt,column:$t}}function on(d){for(const e of d){if(Vt()!==e)throw Qe(ce());ce()}}function tc(){switch(Vt()){case"b":return ce(),"\b";case"f":return ce(),"\f";case"n":return ce(),`
|
|
7
|
+
`;case"r":return ce(),"\r";case"t":return ce()," ";case"v":return ce(),"\v";case"0":if(ce(),tt.isDigit(Vt()))throw Qe(ce());return"\0";case"x":return ce(),nc();case"u":return ce(),br();case`
|
|
8
|
+
`:case"\u2028":case"\u2029":return ce(),"";case"\r":return ce(),Vt()===`
|
|
9
|
+
`&&ce(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Qe(ce());case void 0:throw Qe(ce())}return ce()}function nc(){let d="",e=Vt();if(!tt.isHexDigit(e)||(d+=ce(),e=Vt(),!tt.isHexDigit(e)))throw Qe(ce());return d+=ce(),String.fromCodePoint(parseInt(d,16))}function br(){let d="",e=4;for(;e-- >0;){const t=Vt();if(!tt.isHexDigit(t))throw Qe(ce());d+=ce()}return String.fromCodePoint(parseInt(d,16))}const ic={start(){if(rt.type==="eof")throw an();rr()},beforePropertyName(){switch(rt.type){case"identifier":case"string":$r=rt.value,ut="afterPropertyName";return;case"punctuator":gi();return;case"eof":throw an()}},afterPropertyName(){if(rt.type==="eof")throw an();ut="beforePropertyValue"},beforePropertyValue(){if(rt.type==="eof")throw an();rr()},beforeArrayValue(){if(rt.type==="eof")throw an();if(rt.type==="punctuator"&&rt.value==="]"){gi();return}rr()},afterPropertyValue(){if(rt.type==="eof")throw an();switch(rt.value){case",":ut="beforePropertyName";return;case"}":gi()}},afterArrayValue(){if(rt.type==="eof")throw an();switch(rt.value){case",":ut="beforeArrayValue";return;case"]":gi()}},end(){}};function rr(){let d;switch(rt.type){case"punctuator":switch(rt.value){case"{":d={};break;case"[":d=[];break}break;case"null":case"boolean":case"numeric":case"string":d=rt.value;break}if(Qn===void 0)Qn=d;else{const e=Bt[Bt.length-1];Array.isArray(e)?e.push(d):Object.defineProperty(e,$r,{value:d,writable:!0,enumerable:!0,configurable:!0})}if(d!==null&&typeof d=="object")Bt.push(d),Array.isArray(d)?ut="beforeArrayValue":ut="beforePropertyName";else{const e=Bt[Bt.length-1];e==null?ut="end":Array.isArray(e)?ut="afterArrayValue":ut="afterPropertyValue"}}function gi(){Bt.pop();const d=Bt[Bt.length-1];d==null?ut="end":Array.isArray(d)?ut="afterArrayValue":ut="afterPropertyValue"}function Qe(d){return $i(d===void 0?`JSON5: invalid end of input at ${Qt}:${$t}`:`JSON5: invalid character '${ao(d)}' at ${Qt}:${$t}`)}function an(){return $i(`JSON5: invalid end of input at ${Qt}:${$t}`)}function ss(){return $t-=5,$i(`JSON5: invalid identifier character at ${Qt}:${$t}`)}function rc(d){console.warn(`JSON5: '${ao(d)}' in strings is not valid ECMAScript; consider escaping`)}function ao(d){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[d])return e[d];if(d<" "){const t=d.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return d}function $i(d){const e=new SyntaxError(d);return e.lineNumber=Qt,e.columnNumber=$t,e}var sc=function(e,t,n){const m=[];let i="",a,p,o="",h;if(t!=null&&typeof t=="object"&&!Array.isArray(t)&&(n=t.space,h=t.quote,t=t.replacer),typeof t=="function")p=t;else if(Array.isArray(t)){a=[];for(const f of t){let g;typeof f=="string"?g=f:(typeof f=="number"||f instanceof String||f instanceof Number)&&(g=String(f)),g!==void 0&&a.indexOf(g)<0&&a.push(g)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>0&&(n=Math.min(10,Math.floor(n)),o=" ".substr(0,n)):typeof n=="string"&&(o=n.substr(0,10)),r("",{"":e});function r(f,g){let v=g[f];switch(v!=null&&(typeof v.toJSON5=="function"?v=v.toJSON5(f):typeof v.toJSON=="function"&&(v=v.toJSON(f))),p&&(v=p.call(g,f,v)),v instanceof Number?v=Number(v):v instanceof String?v=String(v):v instanceof Boolean&&(v=v.valueOf()),v){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof v=="string")return s(v);if(typeof v=="number")return String(v);if(typeof v=="object")return Array.isArray(v)?c(v):l(v)}function s(f){const g={"'":.1,'"':.2},v={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let b="";for(let x=0;x<f.length;x++){const D=f[x];switch(D){case"'":case'"':g[D]++,b+=D;continue;case"\0":if(tt.isDigit(f[x+1])){b+="\\x00";continue}}if(v[D]){b+=v[D];continue}if(D<" "){let y=D.charCodeAt(0).toString(16);b+="\\x"+("00"+y).substring(y.length);continue}b+=D}const A=h||Object.keys(g).reduce((x,D)=>g[x]<g[D]?x:D);return b=b.replace(new RegExp(A,"g"),v[A]),A+b+A}function l(f){if(m.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");m.push(f);let g=i;i=i+o;let v=a||Object.keys(f),b=[];for(const x of v){const D=r(x,f);if(D!==void 0){let y=u(x)+":";o!==""&&(y+=" "),y+=D,b.push(y)}}let A;if(b.length===0)A="{}";else{let x;if(o==="")x=b.join(","),A="{"+x+"}";else{let D=`,
|
|
10
|
+
`+i;x=b.join(D),A=`{
|
|
11
|
+
`+i+x+`,
|
|
12
|
+
`+g+"}"}}return m.pop(),i=g,A}function u(f){if(f.length===0)return s(f);const g=String.fromCodePoint(f.codePointAt(0));if(!tt.isIdStartChar(g))return s(f);for(let v=g.length;v<f.length;v++)if(!tt.isIdContinueChar(String.fromCodePoint(f.codePointAt(v))))return s(f);return f}function c(f){if(m.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");m.push(f);let g=i;i=i+o;let v=[];for(let A=0;A<f.length;A++){const x=r(String(A),f);v.push(x!==void 0?x:"null")}let b;if(v.length===0)b="[]";else if(o==="")b="["+v.join(",")+"]";else{let A=`,
|
|
13
|
+
`+i,x=v.join(A);b=`[
|
|
14
|
+
`+i+x+`,
|
|
15
|
+
`+g+"]"}return m.pop(),i=g,b}};const oc={parse:ql,stringify:sc};var lo=oc,Mr={exports:{}};function ac(d){throw new Error('Could not dynamically require "'+d+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ai={exports:{}};const lc={},cc=Object.freeze(Object.defineProperty({__proto__:null,default:lc},Symbol.toStringTag,{value:"Module"})),uc=gl(cc);var hc=Ai.exports,os;function dc(){return os||(os=1,function(d,e){(function(t,n){d.exports=n()})(hc,function(){var t=t||function(n,m){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof gt<"u"&>.crypto&&(i=gt.crypto),!i&&typeof ac=="function")try{i=uc}catch{}var a=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},p=Object.create||function(){function b(){}return function(A){var x;return b.prototype=A,x=new b,b.prototype=null,x}}(),o={},h=o.lib={},r=h.Base=function(){return{extend:function(b){var A=p(this);return b&&A.mixIn(b),(!A.hasOwnProperty("init")||this.init===A.init)&&(A.init=function(){A.$super.init.apply(this,arguments)}),A.init.prototype=A,A.$super=this,A},create:function(){var b=this.extend();return b.init.apply(b,arguments),b},init:function(){},mixIn:function(b){for(var A in b)b.hasOwnProperty(A)&&(this[A]=b[A]);b.hasOwnProperty("toString")&&(this.toString=b.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=h.WordArray=r.extend({init:function(b,A){b=this.words=b||[],A!=m?this.sigBytes=A:this.sigBytes=b.length*4},toString:function(b){return(b||u).stringify(this)},concat:function(b){var A=this.words,x=b.words,D=this.sigBytes,y=b.sigBytes;if(this.clamp(),D%4)for(var E=0;E<y;E++){var T=x[E>>>2]>>>24-E%4*8&255;A[D+E>>>2]|=T<<24-(D+E)%4*8}else for(var M=0;M<y;M+=4)A[D+M>>>2]=x[M>>>2];return this.sigBytes+=y,this},clamp:function(){var b=this.words,A=this.sigBytes;b[A>>>2]&=4294967295<<32-A%4*8,b.length=n.ceil(A/4)},clone:function(){var b=r.clone.call(this);return b.words=this.words.slice(0),b},random:function(b){for(var A=[],x=0;x<b;x+=4)A.push(a());return new s.init(A,b)}}),l=o.enc={},u=l.Hex={stringify:function(b){for(var A=b.words,x=b.sigBytes,D=[],y=0;y<x;y++){var E=A[y>>>2]>>>24-y%4*8&255;D.push((E>>>4).toString(16)),D.push((E&15).toString(16))}return D.join("")},parse:function(b){for(var A=b.length,x=[],D=0;D<A;D+=2)x[D>>>3]|=parseInt(b.substr(D,2),16)<<24-D%8*4;return new s.init(x,A/2)}},c=l.Latin1={stringify:function(b){for(var A=b.words,x=b.sigBytes,D=[],y=0;y<x;y++){var E=A[y>>>2]>>>24-y%4*8&255;D.push(String.fromCharCode(E))}return D.join("")},parse:function(b){for(var A=b.length,x=[],D=0;D<A;D++)x[D>>>2]|=(b.charCodeAt(D)&255)<<24-D%4*8;return new s.init(x,A)}},f=l.Utf8={stringify:function(b){try{return decodeURIComponent(escape(c.stringify(b)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(b){return c.parse(unescape(encodeURIComponent(b)))}},g=h.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(b){typeof b=="string"&&(b=f.parse(b)),this._data.concat(b),this._nDataBytes+=b.sigBytes},_process:function(b){var A,x=this._data,D=x.words,y=x.sigBytes,E=this.blockSize,T=E*4,M=y/T;b?M=n.ceil(M):M=n.max((M|0)-this._minBufferSize,0);var $=M*E,L=n.min($*4,y);if($){for(var C=0;C<$;C+=E)this._doProcessBlock(D,C);A=D.splice(0,$),x.sigBytes-=L}return new s.init(A,L)},clone:function(){var b=r.clone.call(this);return b._data=this._data.clone(),b},_minBufferSize:0});h.Hasher=g.extend({cfg:r.extend(),init:function(b){this.cfg=this.cfg.extend(b),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(b){return this._append(b),this._process(),this},finalize:function(b){b&&this._append(b);var A=this._doFinalize();return A},blockSize:16,_createHelper:function(b){return function(A,x){return new b.init(x).finalize(A)}},_createHmacHelper:function(b){return function(A,x){return new v.HMAC.init(b,x).finalize(A)}}});var v=o.algo={};return o}(Math);return t})}(Ai)),Ai.exports}var pc=Mr.exports;(function(d,e){(function(t,n){d.exports=n(dc())})(pc,function(t){return function(n){var m=t,i=m.lib,a=i.WordArray,p=i.Hasher,o=m.algo,h=[];(function(){for(var f=0;f<64;f++)h[f]=n.abs(n.sin(f+1))*4294967296|0})();var r=o.MD5=p.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(f,g){for(var v=0;v<16;v++){var b=g+v,A=f[b];f[b]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}var x=this._hash.words,D=f[g+0],y=f[g+1],E=f[g+2],T=f[g+3],M=f[g+4],$=f[g+5],L=f[g+6],C=f[g+7],w=f[g+8],S=f[g+9],k=f[g+10],_=f[g+11],F=f[g+12],R=f[g+13],O=f[g+14],V=f[g+15],P=x[0],H=x[1],N=x[2],W=x[3];P=s(P,H,N,W,D,7,h[0]),W=s(W,P,H,N,y,12,h[1]),N=s(N,W,P,H,E,17,h[2]),H=s(H,N,W,P,T,22,h[3]),P=s(P,H,N,W,M,7,h[4]),W=s(W,P,H,N,$,12,h[5]),N=s(N,W,P,H,L,17,h[6]),H=s(H,N,W,P,C,22,h[7]),P=s(P,H,N,W,w,7,h[8]),W=s(W,P,H,N,S,12,h[9]),N=s(N,W,P,H,k,17,h[10]),H=s(H,N,W,P,_,22,h[11]),P=s(P,H,N,W,F,7,h[12]),W=s(W,P,H,N,R,12,h[13]),N=s(N,W,P,H,O,17,h[14]),H=s(H,N,W,P,V,22,h[15]),P=l(P,H,N,W,y,5,h[16]),W=l(W,P,H,N,L,9,h[17]),N=l(N,W,P,H,_,14,h[18]),H=l(H,N,W,P,D,20,h[19]),P=l(P,H,N,W,$,5,h[20]),W=l(W,P,H,N,k,9,h[21]),N=l(N,W,P,H,V,14,h[22]),H=l(H,N,W,P,M,20,h[23]),P=l(P,H,N,W,S,5,h[24]),W=l(W,P,H,N,O,9,h[25]),N=l(N,W,P,H,T,14,h[26]),H=l(H,N,W,P,w,20,h[27]),P=l(P,H,N,W,R,5,h[28]),W=l(W,P,H,N,E,9,h[29]),N=l(N,W,P,H,C,14,h[30]),H=l(H,N,W,P,F,20,h[31]),P=u(P,H,N,W,$,4,h[32]),W=u(W,P,H,N,w,11,h[33]),N=u(N,W,P,H,_,16,h[34]),H=u(H,N,W,P,O,23,h[35]),P=u(P,H,N,W,y,4,h[36]),W=u(W,P,H,N,M,11,h[37]),N=u(N,W,P,H,C,16,h[38]),H=u(H,N,W,P,k,23,h[39]),P=u(P,H,N,W,R,4,h[40]),W=u(W,P,H,N,D,11,h[41]),N=u(N,W,P,H,T,16,h[42]),H=u(H,N,W,P,L,23,h[43]),P=u(P,H,N,W,S,4,h[44]),W=u(W,P,H,N,F,11,h[45]),N=u(N,W,P,H,V,16,h[46]),H=u(H,N,W,P,E,23,h[47]),P=c(P,H,N,W,D,6,h[48]),W=c(W,P,H,N,C,10,h[49]),N=c(N,W,P,H,O,15,h[50]),H=c(H,N,W,P,$,21,h[51]),P=c(P,H,N,W,F,6,h[52]),W=c(W,P,H,N,T,10,h[53]),N=c(N,W,P,H,k,15,h[54]),H=c(H,N,W,P,y,21,h[55]),P=c(P,H,N,W,w,6,h[56]),W=c(W,P,H,N,V,10,h[57]),N=c(N,W,P,H,L,15,h[58]),H=c(H,N,W,P,R,21,h[59]),P=c(P,H,N,W,M,6,h[60]),W=c(W,P,H,N,_,10,h[61]),N=c(N,W,P,H,E,15,h[62]),H=c(H,N,W,P,S,21,h[63]),x[0]=x[0]+P|0,x[1]=x[1]+H|0,x[2]=x[2]+N|0,x[3]=x[3]+W|0},_doFinalize:function(){var f=this._data,g=f.words,v=this._nDataBytes*8,b=f.sigBytes*8;g[b>>>5]|=128<<24-b%32;var A=n.floor(v/4294967296),x=v;g[(b+64>>>9<<4)+15]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,g[(b+64>>>9<<4)+14]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,f.sigBytes=(g.length+1)*4,this._process();for(var D=this._hash,y=D.words,E=0;E<4;E++){var T=y[E];y[E]=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360}return D},clone:function(){var f=p.clone.call(this);return f._hash=this._hash.clone(),f}});function s(f,g,v,b,A,x,D){var y=f+(g&v|~g&b)+A+D;return(y<<x|y>>>32-x)+g}function l(f,g,v,b,A,x,D){var y=f+(g&b|v&~b)+A+D;return(y<<x|y>>>32-x)+g}function u(f,g,v,b,A,x,D){var y=f+(g^v^b)+A+D;return(y<<x|y>>>32-x)+g}function c(f,g,v,b,A,x,D){var y=f+(v^(g|~b))+A+D;return(y<<x|y>>>32-x)+g}m.MD5=p._createHelper(r),m.HmacMD5=p._createHmacHelper(r)}(Math),t.MD5})})(Mr);var fc=Mr.exports;const as=vl(fc),mc=window.innerWidth<=600?12:void 0;function sr(d){return Object.prototype.toString.call(d)==="[object Object]"}class X extends J.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(e){super(e),this.state={confirmDialog:!1,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},this.isError={},e.schema&&(e.custom?this.defaultValue=e.schema.defaultFunc?this.executeCustom(e.schema.defaultFunc,e.data,e.customObj,e.oContext.instanceObj,e.arrayIndex,e.globalData):e.schema.default:e.schema.type!=="state"&&(this.defaultValue=e.schema.defaultFunc?this.execute(e.schema.defaultFunc,e.schema.default,e.data,e.arrayIndex,e.globalData):e.schema.default)),this.lang=G.I18n.getLanguage()}componentDidMount(){this.props.oContext.registerOnForceUpdate&&this.props.oContext.registerOnForceUpdate(this.props.attr,this.onUpdate);const e=["select","autocomplete","autocompleteSendTo"];if(this.defaultValue!==void 0){const t=X.getValue(this.props.data,this.props.attr);(t===void 0||e.includes(this.props.schema.type)&&(t===""||t===null))&&setTimeout(()=>{this.props.custom?this.props.onChange(this.props.attr,this.defaultValue,()=>setTimeout(()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data),100)):(X.setValue(this.props.data,this.props.attr,this.defaultValue),this.props.onChange(this.props.data,void 0,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data)))},100)}else this.props.schema.defaultSendTo&&this.sendTo()}sendTo(){if(this.props.alive){this.defaultSendToDone=!0;let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const t=this.getPattern(this.props.schema.jsonData,null,!0);try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${t}`)}}else e={attr:this.props.attr,value:X.getValue(this.props.data,this.props.attr)};e===void 0&&(e=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.defaultSendTo,e).then(t=>{t!=null&&(this.props.custom?this.props.onChange(this.props.attr,t,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data)):(X.setValue(this.props.data,this.props.attr,t),this.props.onChange(this.props.data,void 0,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data))))})}else this.defaultSendToDone=!1,this.props.schema.allowSaveWithError||this.onError(this.props.attr,G.I18n.t("ra_Instance %s is not alive",this.props.oContext.instance.toString()))}componentWillUnmount(){this.props.oContext.registerOnForceUpdate&&this.props.oContext.registerOnForceUpdate(this.props.attr),this.sendToTimeout&&(clearTimeout(this.sendToTimeout),this.sendToTimeout=null)}onUpdate=e=>{const t=X.getValue(e||this.props.data,this.props.attr)||"";this.state.value!==t?this.setState({value:t}):this.forceUpdate()};static getValue(e,t){if(typeof t=="string")return X.getValue(e,t.split("."));if(t.length===1)return e[t[0]];const n=t.shift();if(typeof n=="string"&&typeof e[n]=="object")return X.getValue(e[n],t)}static setValue(e,t,n){if(typeof t=="string"){X.setValue(e,t.split("."),n);return}if(t.length===1)n===null?delete e[t[0]]:e[t[0]]=n;else{const m=t.shift();if(typeof m!="string")return;(!e[m]||typeof e[m]=="object")&&(e[m]=e[m]||{}),X.setValue(e[m],t,n)}}getText(e,t){if(!e)return"";if(typeof e=="string"){const n=t?e:G.I18n.t(e);return n.includes("${")?this.getPattern(n,null,t):n}return sr(e)?e.func?typeof e.func=="object"?this.getPattern(e.func[this.lang]||e.func.en||"",null,!0):this.getPattern(e.func,null,t):e[this.lang]||e.en||"":e.toString()}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const e=this.state.confirmData||this.props.schema.confirm;let t=null;return e.type==="warning"?t=I.createElement(oe.Warning,null):e.type==="error"?t=I.createElement(oe.Error,null):e.type==="info"&&(t=I.createElement(oe.Info,null)),I.createElement(G.DialogConfirm,{title:this.getText(e.title)||G.I18n.t("ra_Please confirm"),text:this.getText(e.text),ok:this.getText(e.ok)||G.I18n.t("ra_Ok"),cancel:this.getText(e.cancel)||G.I18n.t("ra_Cancel"),icon:t||void 0,onClose:n=>this.setState({confirmDialog:!1},()=>{if(n){if(this.state.confirmCallback){const i=this.state.confirmCallback;this.setState({confirmCallback:null},()=>i(!0));return}const m=JSON.parse(JSON.stringify(this.props.data));this.state.confirmDepAttr&&X.setValue(m,this.state.confirmDepAttr,this.state.confirmDepNewValue),X.setValue(m,this.state.confirmAttr,this.state.confirmNewValue),this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null},()=>this.props.onChange(m))}else{const m=this.state.confirmCallback;this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},()=>{m&&m(!1)})}})})}getIcon(e){e=e||this.props.schema.icon;let t=null;return e==="auth"?t=I.createElement(oe.Key,null):e==="send"?t=I.createElement(oe.Send,null):e==="web"?t=I.createElement(oe.Public,null):e==="warning"?t=I.createElement(oe.Warning,null):e==="error"?t=I.createElement(oe.Error,null):e==="info"?t=I.createElement(oe.Info,null):e==="search"?t=I.createElement(oe.Search,null):e==="book"?t=I.createElement(oe.MenuBook,null):e==="help"?t=I.createElement(oe.Help,null):e==="upload"?t=I.createElement(oe.UploadFile,null):e==="edit"?t=I.createElement(oe.Edit,null):e==="user"?t=I.createElement(oe.Person,null):e==="group"?t=I.createElement(oe.Group,null):e==="delete"?t=I.createElement(oe.Delete,null):e==="refresh"?t=I.createElement(oe.Refresh,null):e==="add"?t=I.createElement(oe.Add,null):e==="unpair"?t=I.createElement(oe.LinkOff,null):e==="pair"?t=I.createElement(oe.Link,null):e==="save"?t=I.createElement(oe.Save,null):e==="open"?t=I.createElement(oe.OpenInNew,null):e&&((e.endsWith(".png")||e.endsWith(".svg")||e.endsWith(".jpg"))&&!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`./adapter/${this.props.oContext.adapterName}/${e}`),t=I.createElement(G.Icon,{src:e,style:{width:22,height:22}})),t}onChangeAsync(e,t){return new Promise(n=>{const m=this.onChange(e,t,n);m instanceof Promise&&m.catch(i=>console.error(`Cannot set value: ${i}`))})}onChange(e,t,n){const m=JSON.parse(JSON.stringify(this.props.data));if(X.setValue(m,e,t),this.props.schema.confirm&&this.execute(this.props.schema.confirm.condition,!1,m,this.props.arrayIndex,this.props.globalData))return new Promise(a=>{this.setState({confirmDialog:!0,confirmNewValue:t,confirmAttr:e,confirmData:null},()=>{typeof n=="function"?n():a()})});if(this.props.schema.confirmDependsOn)for(let a=0;a<this.props.schema.confirmDependsOn.length;a++){const p=this.props.schema.confirmDependsOn[a];if(p.confirm){const o=X.getValue(m,p.attr);if(this.execute(p.confirm.condition,!1,m,this.props.arrayIndex,this.props.globalData))return new Promise(h=>{this.setState({confirmDialog:!0,confirmNewValue:t,confirmAttr:e,confirmDepNewValue:o,confirmDepAttr:p.attr,confirmData:p.confirm},()=>{typeof n=="function"?n():h()})})}}const i=[];if(this.props.schema.onChangeDependsOn)for(let a=0;a<this.props.schema.onChangeDependsOn.length;a++){const p=this.props.schema.onChangeDependsOn[a];if(p.onChange){const o=X.getValue(m,p.attr);let h;this.props.custom?h=this.executeCustom(p.onChange.calculateFunc,m,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):h=this.execute(p.onChange.calculateFunc,o,m,this.props.arrayIndex,this.props.globalData),h!==o&&(X.setValue(m,p.attr,h),i.push(p.attr))}}if(this.props.schema.hiddenDependsOn)for(let a=0;a<this.props.schema.hiddenDependsOn.length;a++){const p=this.props.schema.hiddenDependsOn[a];p.hidden&&i.push(p.attr)}if(this.props.schema.labelDependsOn)for(let a=0;a<this.props.schema.labelDependsOn.length;a++){const p=this.props.schema.labelDependsOn[a];p.hidden&&i.push(p.attr)}if(this.props.schema.helpDependsOn)for(let a=0;a<this.props.schema.helpDependsOn.length;a++){const p=this.props.schema.helpDependsOn[a];p.hidden&&i.push(p.attr)}if(this.props.schema.onChange&&!this.props.schema.onChange.ignoreOwnChanges){const a=X.getValue(m,this.props.attr),p=this.props.custom?this.executeCustom(this.props.schema.onChange.calculateFunc,m,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):this.execute(this.props.schema.onChange.calculateFunc,a,m,this.props.arrayIndex,this.props.globalData);p!==a&&X.setValue(m,this.props.attr,p)}return this.props.custom?(this.props.onChange(e,t,()=>n&&n()),i!=null&&i.length&&i.forEach((a,p)=>setTimeout(()=>this.props.onChange(a,X.getValue(m,a)),p*50))):this.props.onChange(m,void 0,()=>{i.length&&this.props.oContext.forceUpdate(i,m),n&&n()}),Promise.resolve()}execute(e,t,n,m,i){let a;if(sr(e))a=e.func;else if(typeof e=="string")a=e;else return e;if(!a)return t;try{return new Function("data","originalData","_system","_alive","_common","_socket","_instance","arrayIndex","globalData","_changed",a.includes("return")?a:`return ${a}`)(n||this.props.data,this.props.originalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.oContext.instance,m,i,this.props.changed)}catch(p){return console.error(`Cannot execute ${JSON.stringify(e)}: ${p}`),t}}executeCustom(e,t,n,m,i,a){let p;if(sr(e))p=e.func;else if(typeof e=="string")p=e;else return e;if(!p)return null;try{return new Function("data","originalData","_system","instanceObj","customObj","_socket","arrayIndex","globalData","_changed",p.includes("return")?p:`return ${p}`)(t||this.props.data,this.props.originalData,this.props.oContext.systemConfig,m,n,this.props.oContext.socket,i,a,this.props.changed)}catch(o){return console.error(`Cannot execute ${p}: ${o}`),null}}calculate(e){let t,n,m,i;return this.props.custom?(t=e.validator?!this.executeCustom(e.validator,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,e.disabled===!0?n=!0:n=e.disabled?this.executeCustom(e.disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,e.hidden===!0?m=!0:m=e.hidden?this.executeCustom(e.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,i=e.defaultFunc?this.executeCustom(e.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):e.default):(t=e.validator?!this.execute(e.validator,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,e.disabled===!0?n=!0:n=e.disabled?this.execute(e.disabled,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,e.hidden===!0?m=!0:m=e.hidden?this.execute(e.hidden,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,i=e.defaultFunc?this.execute(e.defaultFunc,e.default,this.props.data,this.props.arrayIndex,this.props.globalData):e.default),{error:t,disabled:n,hidden:m,defaultValue:i}}onError(e,t){t?this.isError[e]=t:delete this.isError[e],this.props.onError&&this.props.onError(e,t)}renderItem(e,t,n){return this.getText(this.props.schema.label)||this.getText(this.props.schema.text)}renderHelp(e,t,n){return t?I.createElement("a",{href:t,target:"_blank",rel:"noreferrer",style:{color:this.props.oContext.themeType==="dark"?"#a147ff":"#5b238f",textDecoration:"underline"}},this.getText(e,n)):(e=this.getText(e,n)||"",e&&(e.includes("<a ")||e.includes("<br")||e.includes("<b>")||e.includes("<i>"))?G.Utils.renderTextWithA(e):e)}static escapeString(e,t){return typeof e!="string"?"":(e=e.replace(/`/g,"\\`"),e=e.replace(/\${([^}]+)}/g,(n,m)=>{if(m&&typeof m=="string"&&m.startsWith("data.")){const i=X.getValue(t,m.replace(/^data\./,""));if(typeof i=="string"&&i.includes('"'))return`\${${m}.replace(/"/g, '\\\\"')}`}return n}),e)}getPattern(e,t,n){if(t=t||this.props.data,!e)return"";let m;typeof e=="object"?e.func?m=e.func:(console.log(`Object must be stringified: ${JSON.stringify(e)}`),m=JSON.stringify(e)):m=e;try{if(this.props.custom)return new Function("data","originalData","arrayIndex","globalData","_system","instanceObj","customObj","_socket","_changed",`return \`${X.escapeString(m,t)}\``)(t,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.oContext.instanceObj,this.props.customObj,this.props.oContext.socket,this.props.changed);const a=new Function("data","originalData","arrayIndex","globalData","_system","_alive","_common","_socket","_changed",`return \`${X.escapeString(m,t)}\``)(t,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.changed);return n?a:G.I18n.t(a)}catch(i){return console.error(`Cannot execute ${m}: ${i}`),m}}render(){const e=this.props.schema;if(!e||this.props.expertMode===!1&&e.expertMode)return null;this.props.alive&&this.defaultSendToDone===!1&&(this.sendToTimeout=setTimeout(()=>{this.sendToTimeout=null,this.sendTo()},200));const{error:t,disabled:n,hidden:m,defaultValue:i}=this.calculate(e);if(m){if(Object.keys(this.isError).length&&(setTimeout(o=>Object.keys(o).forEach(h=>this.props.onError(h)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}),e.hideOnlyControl){const o=I.createElement(B.Grid2,{size:{xs:e.xs||mc,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0},style:{marginBottom:0,textAlign:"left",...e.style,...this.props.oContext.themeType==="dark"?e.darkStyle:{}}});return e.newLine?I.createElement(I.Fragment,null,I.createElement("div",{style:{flexBasis:"100%",height:0}}),o):o}return null}e.validatorNoSaveOnError&&(t&&!Object.keys(this.isError).length?(this.isError={[this.props.attr]:e.validatorErrorText?G.I18n.t(e.validatorErrorText):!0},setTimeout(o=>Object.keys(o).forEach(h=>this.props.onError(h,o[h])),100,JSON.parse(JSON.stringify(this.isError)))):!t&&Object.keys(this.isError).length&&(setTimeout(o=>Object.keys(o).forEach(h=>this.props.onError(h)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}));const a=this.renderItem(t,n||this.props.commandRunning||this.props.disabled,i);if(this.noPlaceRequired)return a;const p=I.createElement(B.Grid2,{title:this.getText(e.tooltip),size:{xs:e.xs||12,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0},style:{marginBottom:0,textAlign:"left",width:e.type==="divider"||e.type==="header"?e.width||"100%":void 0,...e.style,...this.props.oContext.themeType==="dark"?e.darkStyle:{}}},this.props.schema.defaultSendTo&&this.props.schema.button?I.createElement(B.Grid2,{container:!0,style:{width:"100%"}},I.createElement(B.Grid2,{flex:1},a),I.createElement(B.Grid2,null,I.createElement(B.Button,{disabled:n,variant:"outlined",onClick:()=>this.sendTo(),title:this.props.schema.buttonTooltip?this.getText(this.props.schema.buttonTooltip,this.props.schema.buttonTooltipNoTranslation):G.I18n.t("ra_Request data by instance")},this.getText(this.props.schema.button)))):a);return e.newLine?I.createElement(I.Fragment,null,I.createElement("div",{style:{flexBasis:"100%",height:0}}),this.renderDialogConfirm(),p):this.state.confirmDialog?I.createElement(I.Fragment,null,this.renderDialogConfirm(),p):p}}const xt={fullWidth:{width:"100%"},accordionSummary:d=>({backgroundColor:d.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.08)"}),accordionTitle:{},toolbar:d=>({backgroundColor:d.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.08)",borderRadius:"3px"}),tooltip:{pointerEvents:"none"}};class gc extends X{typingTimer=null;constructor(e){super(e),this.props.schema.items=this.props.schema.items||[]}componentDidMount(){super.componentDidMount();let e=X.getValue(this.props.data,this.props.attr)||[];Array.isArray(e)||(e=[]),this.setState({value:e,activeIndex:-1,iteration:0})}componentWillUnmount(){this.typingTimer&&(clearTimeout(this.typingTimer),this.typingTimer=null),super.componentWillUnmount()}itemAccordion(e,t){const{value:n}=this.state,{schema:m}=this.props,i={type:"panel",items:m.items.reduce((a,p)=>(a[p.attr]=p,a),{}),style:{marginLeft:"-8px",marginTop:"10px",marginBottom:"10px"}};return I.createElement(wn,{oContext:this.props.oContext,index:t+this.state.iteration,arrayIndex:t,changed:this.props.changed,expertMode:this.props.expertMode,globalData:this.props.data,common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:e,custom:!0,schema:i,originalData:this.props.originalData,onChange:(a,p)=>{const o=JSON.parse(JSON.stringify(n));o[t][a]=p,this.setState({value:o},()=>this.onChangeWrapper(o))},onError:(a,p)=>this.onError(a,p),table:this.props.table})}onDelete=e=>()=>{const t=JSON.parse(JSON.stringify(this.state.value));t.splice(e,1),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(t))};onClone=e=>()=>{const t=JSON.parse(JSON.stringify(this.state.value)),n=JSON.parse(JSON.stringify(t[e]));if(typeof this.props.schema.clone=="string"&&typeof n[this.props.schema.clone]=="string"){let m=1,i=n[this.props.schema.clone];const a=i.match(/(\d+)$/);for(a?(i=i.replace(a[0],""),m=parseInt(a[0],10)+1):i+="_";t.find(p=>p[this.props.schema.clone]===i+m.toString());)m++;n[this.props.schema.clone]=`${n[this.props.schema.clone]}_${m}`}t.splice(e,0,n),this.setState({value:t,activeIndex:-1,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(t))};onChangeWrapper=e=>{this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout(t=>{this.typingTimer=null;const n=this.onChange(this.props.attr,t);n instanceof Promise&&n.catch(m=>this.onError(m))},300,e)};onAdd=()=>{const{schema:e}=this.props,t=JSON.parse(JSON.stringify(this.state.value)),n=e.items&&e.items.reduce((m,i)=>{let a;return i.defaultFunc?this.props.custom?a=i.defaultFunc?this.executeCustom(i.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,t.length,this.props.data):this.props.schema.default:a=i.defaultFunc?this.execute(i.defaultFunc,this.props.schema.default,this.props.data,t.length,this.props.data):this.props.schema.default:a=i.default===void 0?null:i.default,m[i.attr]=a,m},{});t.push(n),this.setState({value:t,activeIndex:t.length-1},()=>this.onChangeWrapper(t))};onMoveUp(e){const t=JSON.parse(JSON.stringify(this.state.value)),n=t[e];t.splice(e,1),t.splice(e-1,0,n);const m=this.state.activeIndex-1;this.setState({value:t,activeIndex:m,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(t))}onMoveDown(e){const t=JSON.parse(JSON.stringify(this.state.value)),n=t[e];t.splice(e,1),t.splice(e+1,0,n);const m=this.state.activeIndex+1;this.setState({value:t,activeIndex:m,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(t))}renderItem(){const{schema:e}=this.props,{value:t}=this.state;return t?I.createElement(B.Paper,null,e.label||!e.noDelete?I.createElement(B.Toolbar,{variant:"dense"},e.label?I.createElement(B.Typography,{variant:"h6",id:"tableTitle",component:"div"},this.getText(e.label)):null,e.noDelete?null:I.createElement(B.IconButton,{size:"small",color:"primary",onClick:this.onAdd},I.createElement(oe.Add,null))):null,t.map((n,m)=>I.createElement(B.Accordion,{key:`${n}_${m}`,expanded:this.state.activeIndex===m,onChange:(i,a)=>this.setState({activeIndex:a?m:-1})},I.createElement(B.AccordionSummary,{expandIcon:I.createElement(oe.ExpandMore,null),sx:G.Utils.getStyle(this.props.oContext.theme,xt.fullWidth,xt.accordionSummary)},I.createElement(B.Typography,{style:xt.accordionTitle},n[e.titleAttr])),I.createElement(B.AccordionDetails,{style:{...e.style,...this.props.oContext.themeType?e.darkStyle:void 0}},this.itemAccordion(t[m],m),I.createElement(B.Toolbar,{sx:xt.toolbar},m?I.createElement(B.Tooltip,{title:G.I18n.t("ra_Move up"),slotProps:{popper:{sx:xt.tooltip}}},I.createElement(B.IconButton,{size:"small",onClick:()=>this.onMoveUp(m)},I.createElement(oe.ArrowUpward,null))):I.createElement("div",{style:xt.buttonEmpty}),m<t.length-1?I.createElement(B.Tooltip,{title:G.I18n.t("ra_Move down"),slotProps:{popper:{sx:xt.tooltip}}},I.createElement(B.IconButton,{size:"small",onClick:()=>this.onMoveDown(m)},I.createElement(oe.ArrowDownward,null))):I.createElement("div",{style:xt.buttonEmpty}),e.noDelete?null:I.createElement(B.Tooltip,{title:G.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:xt.tooltip}}},I.createElement(B.IconButton,{size:"small",onClick:this.onDelete(m)},I.createElement(oe.Delete,null))),e.clone?I.createElement(B.Tooltip,{title:G.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:xt.tooltip}}},I.createElement(B.IconButton,{size:"small",onClick:this.onClone(m)},I.createElement(oe.ContentCopy,null))):null)))),!e.noDelete&&t.length>0?I.createElement(B.Toolbar,{variant:"dense",sx:xt.rootTool},I.createElement(B.IconButton,{size:"small",color:"primary",onClick:this.onAdd},I.createElement(oe.Add,null))):null,e.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null):null}}const ls={root:{width:"100%"},notAlive:{color:"#a30000"}};class vc extends X{componentDidMount(){super.componentDidMount();const e=this.getInstance();this.props.oContext.socket.getState(`${e}.alive`).then(t=>this.setState({alive:!!(t&&t.val),instance:e}))}getInstance(){let e=this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`;return e.includes("${")&&(e=this.getPattern(e,null,!0)),e&&!e.startsWith("system.adapter.")&&(e=`system.adapter.${e}`),e}renderItem(){if(this.getInstance()!==this.state.instance&&setTimeout(()=>{const t=this.getInstance();t?this.props.oContext.socket.getState(`${t}.alive`).then(n=>this.setState({alive:!!(n&&n.val),instance:t})):this.setState({alive:null,instance:t})},200),this.state.alive!==!1&&this.state.alive!==!0)return null;const e=this.state.instance.replace(/^system.adapter./,"");return I.createElement("div",{style:{...ls.root,...this.state.alive?void 0:ls.notAlive}},this.state.alive?this.props.schema.textAlive!==void 0?this.props.schema.textAlive?G.I18n.t(this.props.schema.textAlive,e):"":G.I18n.t("ra_Instance %s is alive",e):this.props.schema.textNotAlive!==void 0?this.props.schema.textNotAlive?G.I18n.t(this.props.schema.textNotAlive,e):"":G.I18n.t("ra_Instance %s is not alive",e))}}class yc extends X{componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr),t=this.props.schema.options.map(n=>typeof n=="string"?{label:n,value:n}:JSON.parse(JSON.stringify(n)));Array.isArray(e)?(t.unshift({label:G.I18n.t(X.DIFFERENT_LABEL),value:X.DIFFERENT_VALUE}),this.setState({value:X.DIFFERENT_VALUE,selectOptions:t})):this.setState({value:e,selectOptions:t})}renderItem(e,t){if(!this.state.selectOptions)return null;let n;const m=JSON.parse(JSON.stringify(this.state.selectOptions));return Array.isArray(this.state.value)||this.state.value===X.DIFFERENT_VALUE?([...this.state.value].filter(a=>!m.find(p=>typeof p=="object"?p.value===a:p===a)).forEach(a=>m.push({label:a.toString(),value:a})),n={label:G.I18n.t(X.DIFFERENT_LABEL),value:X.DIFFERENT_VALUE},m.unshift(n)):(n=this.state.value!==null&&this.state.value!==void 0&&m.find(a=>typeof a=="object"?a.value==this.state.value:a==this.state.value),this.state.value!==null&&this.state.value!==void 0&&!n&&this.props.schema.freeSolo&&(n={value:this.state.value,label:this.state.value},m.push(n))),I.createElement(B.Autocomplete,{fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,value:n,options:m,isOptionEqualToValue:(a,p)=>a.value===p.value,filterOptions:(a,p)=>{const o=a.filter(h=>p.inputValue===""?!0:h.label.toLowerCase().includes(p.inputValue.toLowerCase())||h.value.toLowerCase().includes(p.inputValue.toLowerCase()));return this.props.schema.freeSolo&&p.inputValue!==""&&o.push({label:p.inputValue,value:p.inputValue}),o},onInputChange:a=>{if(!a||!this.props.schema.freeSolo)return;const p=a.target.value;p!==this.state.value&&this.setState({value:p},()=>this.onChange(this.props.attr,p))},onChange:(a,p)=>{const o=typeof p=="object"?p?p.value:"":p;o!==this.state.value&&this.setState({value:o},()=>this.onChange(this.props.attr,o))},getOptionLabel:a=>typeof a=="object"?(a==null?void 0:a.label)??"":"",renderInput:a=>I.createElement(B.TextField,{variant:"standard",...a,error:!!e,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:t})})}}class bc extends X{initialized=!1;localContext;askInstance(){const e=X.getValue(this.props.data,this.props.attr),t=this.props.schema.options?this.props.schema.options.map(n=>typeof n=="string"?{label:n,value:n}:JSON.parse(JSON.stringify(n))):[];if(this.props.alive){let n=this.props.schema.data;if(n===void 0&&this.props.schema.jsonData){const m=this.getPattern(this.props.schema.jsonData,null,!0);try{typeof m=="string"&&(n=JSON.parse(m))}catch{console.error(`Cannot parse json data: ${JSON.stringify(n)}`)}}n===void 0&&(n=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",n).then(m=>{m&&Array.isArray(m)&&m.forEach(i=>t.push(typeof i=="string"?{label:i,value:i}:JSON.parse(JSON.stringify(i)))),Array.isArray(e)?(t.unshift({label:G.I18n.t(X.DIFFERENT_LABEL),value:X.DIFFERENT_VALUE}),this.setState({value:X.DIFFERENT_VALUE,selectOptions:t})):this.setState({value:e,selectOptions:t})})}else Array.isArray(e)?(t.unshift({label:G.I18n.t(X.DIFFERENT_LABEL),value:X.DIFFERENT_VALUE}),this.setState({value:X.DIFFERENT_VALUE,selectOptions:t})):this.setState({value:e,selectOptions:t})}getContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=X.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(e,t){if(this.props.alive){const a=this.getContext();(a!==this.localContext||!this.initialized)&&(this.localContext=a,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}let n;const m=this.state.selectOptions?JSON.parse(JSON.stringify(this.state.selectOptions)):[];return Array.isArray(this.state.value)||this.state.value===X.DIFFERENT_LABEL?([...this.state.value].filter(a=>!m.find(p=>p.value===a)).forEach(a=>m.push({label:a.toString(),value:a})),n={label:G.I18n.t(X.DIFFERENT_LABEL),value:X.DIFFERENT_VALUE},m.unshift(n)):(n=this.state.value!==null&&this.state.value!==void 0&&m.find(a=>a.value==this.state.value),this.state.value!==null&&this.state.value!==void 0&&!n&&this.props.schema.freeSolo&&(n={value:this.state.value,label:this.state.value},m.push(n)),n=n||null),m.length?I.createElement(B.Autocomplete,{value:n,fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,options:m,isOptionEqualToValue:(a,p)=>a.value===p.value,filterOptions:(a,p)=>{const o=a.filter(h=>p.inputValue===""?!0:h.label.toLowerCase().includes(p.inputValue.toLowerCase())||h.value.toLowerCase().includes(p.inputValue.toLowerCase()));return this.props.schema.freeSolo&&p.inputValue!==""&&o.push({label:p.inputValue,value:p.inputValue}),o},getOptionLabel:a=>(a==null?void 0:a.label)??"",onInputChange:a=>{if(!a||!this.props.schema.freeSolo)return;const p=a.target.value;p!==this.state.value&&this.setState({value:p},()=>this.onChange(this.props.attr,p))},onChange:(a,p)=>{const o=typeof p=="object"?p?p.value:"":p;o!==this.state.value&&this.setState({value:o},()=>this.onChange(this.props.attr,o))},renderInput:a=>I.createElement(B.TextField,{variant:"standard",...a,error:!!e,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:t})}):I.createElement(B.TextField,{variant:"standard",fullWidth:!0,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!e,disabled:t,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},onChange:a=>{const p=a.target.value;this.setState({value:p},()=>this.onChange(this.props.attr,(p||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const or={fullWidth:{width:"100%"},flex:{display:"flex"},button:{height:48,marginLeft:4,minWidth:48}};class wc extends X{componentDidMount(){super.componentDidMount();const{data:e,attr:t}=this.props,n=X.getValue(e,t)||"";this.setState({value:n,showDialog:!1})}renderItem(e,t){const{schema:n,attr:m}=this.props,{value:i,showDialog:a}=this.state;return I.createElement(B.FormControl,{style:or.fullWidth,variant:"standard"},n.label?I.createElement(B.InputLabel,{shrink:!0},this.getText(n.label)):null,I.createElement("div",{style:or.flex},I.createElement(B.TextField,{variant:"standard",fullWidth:!0,value:i??"",error:!!e,disabled:t,placeholder:this.getText(n.placeholder),label:this.getText(n.label),helperText:this.renderHelp(n.help,n.helpLink,n.noTranslation),onChange:p=>{const o=p.target.value;this.setState({value:o},()=>this.onChange(m,o))}}),I.createElement(B.Button,{color:"grey",disabled:t,style:or.button,size:"small",variant:"outlined",onClick:()=>this.setState({showDialog:!0})},"...")),a?I.createElement(G.DialogCron,{title:G.I18n.t("ra_Define schedule"),simple:n.simple,complex:n.complex,cron:i,onClose:()=>this.setState({showDialog:!1}),cancel:G.I18n.t("ra_Cancel"),ok:G.I18n.t("ra_Ok"),theme:this.props.oContext.theme,onOk:p=>this.setState({showDialog:!1,value:p},()=>this.onChange(m,p))}):null)}}class Cc extends X{async componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr),n=(await this.props.oContext.socket.getCertificates()).filter(m=>{const i=this.props.attr.toLowerCase();return i.includes(m.type)||m.type==="public"&&i.includes("cert")||m.type==="private"&&(i.includes("priv")||i.includes("key"))?!0:!!(m.type==="chained"&&(i.includes("chain")||i.includes("ca")))}).map(m=>({label:m.name,value:m.name}));n.unshift({label:G.I18n.t(X.NONE_LABEL),value:X.NONE_VALUE}),this.setState({value:e,selectOptions:n})}renderItem(e,t){var m,i;if(!this.state.selectOptions)return null;const n=(m=this.state.selectOptions)==null?void 0:m.find(a=>a.value===this.state.value);return I.createElement(B.FormControl,{style:{width:"100%"},variant:"standard"},this.props.schema.label?I.createElement(B.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,I.createElement(B.Select,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:this.state.value,renderValue:()=>this.getText(n==null?void 0:n.label,this.props.schema.noTranslation!==!1),onChange:a=>this.setState({value:a.target.value},()=>this.onChange(this.props.attr,this.state.value))},(i=this.state.selectOptions)==null?void 0:i.map(a=>I.createElement(B.MenuItem,{key:a.value,value:a.value,style:a.value===X.NONE_VALUE?{opacity:.5}:{}},this.getText(a.label,this.props.schema.noTranslation!==!1)))),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Hn={fullWidth:{width:"100%"},leWidth:{width:620,marginBottom:10},certWidth:{width:200,marginRight:10}};class Dc extends X{async componentDidMount(){var p;super.componentDidMount();const e=await this.props.oContext.socket.getCertificates(),t=[],n=[],m=[];let i=[];const a=await this.props.oContext.socket.getObject("system.certificates");(p=a==null?void 0:a.native)!=null&&p.collections?i=Object.keys(a.native.collections):i=null,e.forEach(o=>{o.type==="public"?t.push({label:o.name,value:o.name}):o.type==="private"?n.push({label:o.name,value:o.name}):o.type==="chained"?m.push({label:o.name,value:o.name}):(t.push({label:o.name,value:o.name}),n.push({label:o.name,value:o.name}),m.push({label:o.name,value:o.name}))}),t.unshift({label:G.I18n.t(X.NONE_LABEL),value:X.NONE_VALUE}),n.unshift({label:G.I18n.t(X.NONE_LABEL),value:X.NONE_VALUE}),m.unshift({label:G.I18n.t(X.NONE_LABEL),value:X.NONE_VALUE}),this.setState({certsPublicOptions:t,certsChainOptions:m,certsPrivateOptions:n,collectionsOptions:i})}renderItem(e,t){var r,s,l,u,c,f,g;if(!this.state.certsPublicOptions||!this.state.certsPrivateOptions||!this.state.certsChainOptions)return null;const n=(X.getValue(this.props.data,this.props.schema.leCollectionName||"leCollection")||"false").toString(),m=X.getValue(this.props.data,this.props.schema.certPublicName||"certPublic"),i=X.getValue(this.props.data,this.props.schema.certPrivateName||"certPrivate"),a=X.getValue(this.props.data,this.props.schema.certChainedName||"certChained"),p=(r=this.state.certsPublicOptions)==null?void 0:r.find(v=>v.value===m),o=(s=this.state.certsPrivateOptions)==null?void 0:s.find(v=>v.value===i),h=(l=this.state.certsChainOptions)==null?void 0:l.find(v=>v.value===a);return I.createElement("div",{style:Hn.fullWidth},this.state.collectionsOptions?I.createElement(B.FormControl,{style:Hn.leWidth,variant:"standard"},I.createElement(B.InputLabel,{shrink:!0},"Let's encrypt"),I.createElement(B.Select,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:n,onChange:v=>this.onChange(this.props.schema.leCollectionName||"leCollection",v.target.value==="false"?!1:v.target.value==="true"?!0:v.target.value)},I.createElement(B.MenuItem,{key:"_false",value:"false",style:{fontWeight:"bold"}},G.I18n.t("ra_Do not use let's encrypt")),I.createElement(B.MenuItem,{key:"_true",value:"true",style:{fontWeight:"bold"}},G.I18n.t("ra_Use all available let's encrypt certificates")),(u=this.state.collectionsOptions)==null?void 0:u.map(v=>I.createElement(B.MenuItem,{key:v,value:v},v)))):null,this.state.collectionsOptions?I.createElement("br",null):null,this.state.collectionsOptions&&n!=="false"?I.createElement("div",null,G.I18n.t("ra_Fallback custom certificates")):null,I.createElement(B.FormControl,{style:Hn.certWidth,variant:"standard"},I.createElement(B.InputLabel,{shrink:!0},G.I18n.t("ra_Public certificate")),I.createElement(B.Select,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:m||"",renderValue:()=>this.getText(p==null?void 0:p.label),onChange:v=>this.onChange(this.props.schema.certPublicName||"certPublic",v.target.value)},(c=this.state.certsPublicOptions)==null?void 0:c.map((v,b)=>I.createElement(B.MenuItem,{key:`${v.value}_${b}`,value:v.value,style:v.value===X.NONE_VALUE?{opacity:.5}:{}},this.getText(v.label))))),I.createElement(B.FormControl,{style:Hn.certWidth,variant:"standard"},I.createElement(B.InputLabel,{shrink:!0},G.I18n.t("ra_Private certificate")),I.createElement(B.Select,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:i||"",renderValue:()=>this.getText(o==null?void 0:o.label),onChange:v=>this.onChange(this.props.schema.certPrivateName||"certPrivate",v.target.value)},(f=this.state.certsPrivateOptions)==null?void 0:f.map((v,b)=>I.createElement(B.MenuItem,{key:`${v.value}_${b}`,value:v.value,style:v.value===X.NONE_VALUE?{opacity:.5}:{}},this.getText(v.label))))),I.createElement(B.FormControl,{style:Hn.certWidth,variant:"standard"},I.createElement(B.InputLabel,{shrink:!0},G.I18n.t("ra_Chained certificate")),I.createElement(B.Select,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:a||"",renderValue:()=>this.getText(h==null?void 0:h.label),onChange:v=>this.onChange(this.props.schema.certChainedName||"certChained",v.target.value)},(g=this.state.certsChainOptions)==null?void 0:g.map((v,b)=>I.createElement(B.MenuItem,{key:`${v.value}_${b}`,value:v.value,style:v.value===X.NONE_VALUE?{opacity:.5}:{}},this.getText(v.label))))))}}class Sc extends X{async componentDidMount(){var n;super.componentDidMount();let e;const t=await this.props.oContext.socket.getObject("system.certificates");(n=t==null?void 0:t.native)!=null&&n.collections?e=Object.keys(t.native.collections):e=[],this.setState({collectionsOptions:e})}renderItem(e,t){var m;if(!this.state.collectionsOptions)return null;const n=(X.getValue(this.props.data,this.props.schema.leCollectionName||"leCollection")||"false").toString();return I.createElement(B.FormControl,{style:{width:"100%"},variant:"standard"},this.props.schema.label?I.createElement(B.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,I.createElement(B.Select,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:n,onChange:i=>this.onChange(this.props.schema.leCollectionName||"leCollection",i.target.value==="false"?!1:i.target.value==="true"?!0:i.target.value)},I.createElement(B.MenuItem,{key:"_false",value:"false",style:{fontWeight:"bold"}},G.I18n.t("ra_Do not use let's encrypt")),I.createElement(B.MenuItem,{key:"_true",value:"true",style:{fontWeight:"bold"}},G.I18n.t("ra_Use all available let's encrypt certificates")),(m=this.state.collectionsOptions)==null?void 0:m.map(i=>I.createElement(B.MenuItem,{key:i,value:i},i))),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const mt={fullWidth:{width:"100%"},licLabel:{fontWeight:"bold",minWidth:100,marginRight:10,textTransform:"capitalize",display:"inline-block"},errorTitle:d=>({color:d.palette.mode==="dark"?"#e39191":"#b62020"}),okTitle:d=>({color:d.palette.mode==="dark"?"#6fd56f":"#007c00"}),errorText:d=>({color:d.palette.mode==="dark"?"#e39191":"#b62020",mb:"30px"})};class Yt extends X{componentDidMount(){super.componentDidMount(),this.setState({_error:"",running:!1,showLicenseData:null,foundSuitableLicense:!1,licenseOfflineCheck:!1,result:null,allLicenses:null,askForUpdate:!1,showLinkToProfile:!1})}renderErrorDialog(){if(this.state._error&&!this.state.showLicenseData){let e=this.state._error;return this.state.allLicenses&&(e=[I.createElement("div",{key:"error"},e)],e.push(I.createElement(B.Button,{key:"button",variant:"contained",onClick:()=>window.open("https://iobroker.net/www/account/licenses","_blank")},G.I18n.t("iobroker.net"))),this.state.allLicenses.length?e.push(I.createElement(B.TableContainer,{key:"table"},I.createElement(B.Table,{size:"small"},I.createElement(B.TableHead,null,I.createElement(B.TableRow,null,I.createElement(B.TableCell,null,G.I18n.t("ra_Product")),I.createElement(B.TableCell,null,G.I18n.t("ra_Version")),I.createElement(B.TableCell,null,"UUID"),I.createElement(B.TableCell,null,G.I18n.t("ra_ValidTill")),I.createElement(B.TableCell,null,G.I18n.t("ra_Commercial")),I.createElement(B.TableCell,null,"ID"))),I.createElement(B.TableBody,null,this.state.allLicenses.map(t=>I.createElement(B.TableRow,{key:t.id},I.createElement(B.TableCell,{sx:t.validName?null:mt.errorText},t.license.product),I.createElement(B.TableCell,{sx:t.validVersion?null:mt.errorText},t.license.version),I.createElement(B.TableCell,{sx:t.validUuid?null:mt.errorText},t.license.uuid||"--"),I.createElement(B.TableCell,{sx:t.validTill?null:mt.errorText},t.license.validTill&&t.license.validTill!=="0000-00-00 00:00:00"?new Date(t.license.validTill).toLocaleDateString():"--"),I.createElement(B.TableCell,null,t.license.invoice!=="free"?t.license.invoice==="MANUALLY_CREATED"?"✓":t.license.invoice:"-"),I.createElement(B.TableCell,null,t.id))))))):(e.push(I.createElement("div",{key:"text1"},G.I18n.t("ra_No one license found in license manager"))),e.push(I.createElement("div",{key:"text2"},G.I18n.t("ra_Please create license"))))),I.createElement(B.Dialog,{open:!0,maxWidth:"xl",fullWidth:this.props.fullWidth!==void 0?this.props.fullWidth:!0,onClick:()=>this.setState({_error:"",allLicenses:null})},I.createElement(B.DialogTitle,null,G.I18n.t("ra_Error")),I.createElement(B.DialogContent,null,I.createElement(B.DialogContentText,null,e)),I.createElement(B.DialogActions,null,I.createElement(B.Button,{variant:"contained",onClick:()=>this.setState({_error:"",allLicenses:null}),color:"primary",autoFocus:!0,startIcon:I.createElement(oe.Check,null)},G.I18n.t("ra_Ok"))))}return null}renderMessageDialog(){if(this.state.showLicenseData){const e=[],t=this.state.showLicenseData;return Object.keys(t).forEach(n=>{if(!(t[n]===null||t[n]===void 0))if(typeof t[n]=="object"){const m=t[n];Object.keys(m).forEach(i=>{m[i]!==null&&m[i]!==void 0&&(typeof m[i]=="object"?e.push(I.createElement("div",{key:i},I.createElement("div",{style:mt.licLabel},i,":"),JSON.stringify(m[i],null,2))):e.push(I.createElement("div",{key:i},I.createElement("div",{style:mt.licLabel},n," -",i,":"),m[i].toString())))})}else e.push(I.createElement("div",{key:n},I.createElement("div",{style:mt.licLabel},n.replace(/_/g," "),":"),t[n].toString()))}),e.push(I.createElement("div",{key:"checked"},I.createElement("div",{style:mt.licLabel},G.I18n.t("ra_Checked"),":"),this.state.licenseOfflineCheck?G.I18n.t("ra_locally"):G.I18n.t("ra_via internet"))),I.createElement(B.Dialog,{open:!0,onClose:()=>this.setState({showLicenseData:null})},I.createElement(B.DialogTitle,null,I.createElement(B.Box,{component:"span",sx:this.state.result?mt.okTitle:mt.errorTitle},G.I18n.t("ra_License %s",this.state.result?"OK":"INVALID"))),I.createElement(B.DialogContent,null,this.state.showLinkToProfile?I.createElement(B.Button,{variant:"contained",onClick:()=>window.open("https://iobroker.net/www/account/licenses","_blank")},"https://iobroker.net"):null,this.state._error?I.createElement(B.Box,{component:"div",sx:mt.errorText},this.state._error):null,e),I.createElement(B.DialogActions,null,I.createElement(B.Button,{onClick:()=>this.setState({showLicenseData:null,_error:""}),color:"primary",variant:"contained"},G.I18n.t("ra_Close"))))}return null}static parseJwt(e){const n=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),m=decodeURIComponent(atob(n).split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));try{return JSON.parse(m)}catch{return null}}static isVersionValid(e,t,n,m){if(!t||!e)return!0;let i=!0;const[a]=e.split(".");return t.startsWith(">=")?i=parseInt(a,10)>=parseInt(t.substring(2,10)):t.startsWith("<=")?i=parseInt(a,10)<=parseInt(t.substring(2,10)):t.startsWith(">")?i=parseInt(a,10)>parseInt(t.substring(1,10)):t.startsWith("<")?i=parseInt(a,10)<parseInt(t.substring(1,10)):t.startsWith("=")?i=parseInt(a,10)===parseInt(t.substring(1,10)):t.startsWith("==")?i=parseInt(a,10)===parseInt(t.substring(2,10)):t.startsWith("===")&&(i=parseInt(a,10)===parseInt(t.substring(3,10))),!0}async findInLicenseManager(e){var m,i,a,p;const t=await this.props.oContext.socket.getObject("system.licenses"),n=[];if((i=(m=t==null?void 0:t.native)==null?void 0:m.licenses)!=null&&i.length){let o=null;const h=Date.now();let r;if(this.props.schema.uuid){const l=await this.props.oContext.socket.getObject("system.meta.uuid");r=(a=l==null?void 0:l.native)==null?void 0:a.uuid}let s;if(this.props.schema.version){const l=await this.props.oContext.socket.getObject(`system.adapter.${e}`);s=(p=l==null?void 0:l.common)==null?void 0:p.version}t.native.licenses.forEach(l=>{const u=!l.validTill||l.validTill==="0000-00-00 00:00:00"||new Date(l.validTill).getTime()>h,c=(l.product||"").split("."),f=c[1]===e||e==="vis-2"&&c[1]==="vis",g=!r||!l.uuid||l.uuid===r,v=Yt.isVersionValid(s,l.version,l.invoice,e);(!o||l.invoice!=="free")&&u&&f&&g&&v&&(o=l),n.push({id:l.id,validName:f,validUuid:g,validVersion:v,validTill:u,license:l})}),o&&(n.find(l=>l.id===o.id).used=!0)}return n}async checkLicense(e,t){var p,o,h;let n;if(this.props.schema.uuid){const r=await this.props.oContext.socket.getObject("system.meta.uuid");n=(p=r==null?void 0:r.native)==null?void 0:p.uuid}let m;if(this.props.schema.version){const r=await this.props.oContext.socket.getObject(`system.adapter.${t}`);m=(o=r==null?void 0:r.common)==null?void 0:o.version}const i=new AbortController;let a=setTimeout(()=>{a=null,i.abort()},5e3);try{const r=await window.fetch("https://iobroker.net/api/v1/public/cert/",{method:"POST",body:JSON.stringify({json:e,uuid:n}),headers:{"Content-Type":"text/plain"},signal:i.signal});a&&clearTimeout(a);const s=await r.text();let l;try{l=JSON.parse(s)}catch{}if(l!=null&&l.error)try{const u=Yt.parseJwt(e),c=G.I18n.t(`ra_${u.error||l.error||"Unknown error"}`).replace(/^ra_/,"");return this.setState({_error:c,licenseOfflineCheck:!1,showLicenseData:u,result:!1,running:!1})}catch{return console.log("Cannot parse license"),this.setState({_error:l.error,result:!1,running:!1})}else{let u=null;try{u=Yt.parseJwt(e)}catch{}if(l){const c=l.validTill||l.valid_till;if(c&&c!=="0000-00-00 00:00:00"&&new Date(c).getTime()<Date.now())return this.setState({_error:G.I18n.t("ra_License expired on %s",new Date(c).toLocaleString()),licenseOfflineCheck:!1,showLicenseData:u,result:!1,running:!1});const f=(l.name||"").split(".");return f[1]===t||f[1]==="vis"&&t==="vis-2"?n&&!l.uuid&&t==="vis-2"?this.setState({_error:G.I18n.t("ra_License must be converted",l.uuid),showLinkToProfile:!0,licenseOfflineCheck:!1,showLicenseData:u,result:!1,running:!1}):n&&l.uuid&&l.uuid!==n?this.setState({_error:G.I18n.t('ra_Serial number (UUID) "%s" in license is for other device.',l.uuid),licenseOfflineCheck:!1,showLicenseData:u,result:!1,running:!1}):Yt.isVersionValid(m,l.version,l.invoice,t)?this.setState({licenseOfflineCheck:!1,showLicenseData:u,result:!0,running:!1}):this.setState({_error:G.I18n.t("ra_License is for version %s, but required version is %s",l.version,this.props.schema.version),licenseOfflineCheck:!1,showLicenseData:u,result:!1,running:!1}):this.setState({_error:G.I18n.t('ra_License for other product "%s"',l.name),licenseOfflineCheck:!1,showLicenseData:u,result:!1,running:!1})}throw new Error("ra_Invalid answer from server")}}catch(r){if(((h=r==null?void 0:r.response)==null?void 0:h.status)===404)return this.setState({_error:G.I18n.t("ra_License does not exist"),result:!1,running:!1});try{const s=Yt.parseJwt(e),l=(s.name||"").split(".");return s.valid_till&&s.valid_till!=="0000-00-00 00:00:00"&&new Date(s.valid_till).getTime()<Date.now()?this.setState({_error:G.I18n.t("ra_License expired on %s",new Date(s.valid_till).toLocaleString()),showLicenseData:s,licenseOfflineCheck:!0,running:!1,result:!1}):l[1]===t?n&&s.uuid&&s.uuid!==n?this.setState({_error:G.I18n.t('ra_Serial number (UUID) "%s" in license is for other device.',s.uuid),showLicenseData:s,licenseOfflineCheck:!0,result:!1,running:!1}):Yt.isVersionValid(m,s.version,s.invoice,t)?this.setState({running:!1,result:!0,licenseOfflineCheck:!0,showLicenseData:s}):this.setState({_error:G.I18n.t("ra_License is for version %s, but required version is %s",s.version,this.props.schema.version),licenseOfflineCheck:!0,showLicenseData:s,result:!1,running:!1}):this.setState({_error:G.I18n.t('ra_License for other product "%s"',s.name),licenseOfflineCheck:!0,showLicenseData:s,result:!1,running:!1})}catch{return this.setState({_error:G.I18n.t("ra_Cannot decode license"),result:!1,licenseOfflineCheck:!0,running:!1})}}}renderAskForUpdate(){return this.state.askForUpdate?I.createElement(G.DialogConfirm,{text:G.I18n.t("ra_License not found in license manager. Do you want to read licenses from iobroker.net?"),ok:G.I18n.t("ra_Yes"),onClose:async e=>{if(e){this.setState({askForUpdate:!1});try{await this.props.oContext.socket.updateLicenses(null,null)}catch(t){window.alert(G.I18n.t("ra_Cannot read licenses: %s",t));return}await this._onClick(!0)}else this.setState({askForUpdate:!1,running:!1})}}):null}async _onClick(e){const t=this.props.oContext.adapterName==="vis-2"?"vis":this.props.oContext.adapterName;this.setState({running:!0});let n,m;if(this.props.data.useLicenseManager){if(m=await this.findInLicenseManager(t),n=m.find(i=>i.used),n&&(n=n.license.json),!n&&!e){this.setState({askForUpdate:!0});return}}else n=this.props.data.license;n?await this.checkLicense(n,t):this.props.data.useLicenseManager?this.setState({_error:G.I18n.t("ra_Suitable license not found in license manager"),result:!1,running:!1,allLicenses:m}):this.setState({_error:G.I18n.t("ra_Please enter the license"),result:!1,running:!1})}renderItem(){return I.createElement("div",{style:mt.fullWidth},I.createElement(B.Button,{variant:this.props.schema.variant||"outlined",color:this.props.schema.color||"primary",style:mt.fullWidth,disabled:!this.props.data.license&&!this.props.data.useLicenseManager||this.state.running,startIcon:I.createElement(oe.Send,null),onClick:()=>this._onClick()},this.state.running?I.createElement(B.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 xc extends X{renderItem(e,t){const n=X.getValue(this.props.data,this.props.attr),m=Array.isArray(n);return I.createElement(B.FormControl,{style:{width:"100%"},variant:"standard"},I.createElement(B.FormControlLabel,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),!t){const a=this.onChange(this.props.attr,!n);a instanceof Promise&&a.catch(p=>console.error(`Cannot set value: ${p}`))}},control:I.createElement(B.Checkbox,{indeterminate:m,checked:!!n,onChange:i=>{let a;m?a=this.onChange(this.props.attr,!0):a=this.onChange(this.props.attr,i.target.checked),a instanceof Promise&&a.catch(p=>console.error(`Cannot set value: ${p}`))},disabled:t||this.props.schema.readOnly}),label:this.getText(this.props.schema.label)}),I.createElement(B.FormHelperText,{style:{color:"red"}},e?this.props.schema.validatorErrorText?G.I18n.t(this.props.schema.validatorErrorText):G.I18n.t("ra_Error"):null),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Ec={standard:B.Input,filled:El,outlined:B.OutlinedInput},Ac=d=>{const e=d.palette.mode==="light",t=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return{root:{},inputRoot:{display:"inline-flex",flexWrap:"wrap",flex:1,marginTop:0,minWidth:70,"&.mui-variant-outlined,&.mui-variant-filled":{boxSizing:"border-box"},"&.mui-variant-outlined":{paddingTop:"14px"},"&.mui-variant-filled":{paddingTop:"28px"}},input:{display:"inline-block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",appearance:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",float:"left",flex:1},chipContainer:{display:"flex",flexFlow:"row wrap",alignItems:"center",cursor:"text",marginBottom:"-2px",minHeight:40},outlined:{"& input":{height:16,paddingTop:"4px",paddingBottom:"12px",marginTop:"4px",marginBottom:"4px"}},standard:{marginTop:"18px"},filled:{"& input":{height:22,marginBottom:"4px",marginTop:"4px",paddingTop:0},"$marginDense & input":{height:26}},labeled:{},label:{top:4,"&$outlined&:not($labelShrink)":{top:2,"$marginDense &":{top:5}},"&$filled&:not($labelShrink)":{top:15,"$marginDense &":{top:20}}},labelShrink:{top:0},helperText:{marginBottom:-20},focused:{},disabled:{},underline:{"&:after":{borderBottom:`2px solid ${d.palette.primary[e?"dark":"light"]}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:d.transitions.create("transform",{duration:d.transitions.duration.shorter,easing:d.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:d.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:d.transitions.create("border-bottom-color",{duration:d.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:not($disabled):not($focused):not($error):before":{borderBottom:`2px solid ${d.palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{"&:after":{backgroundColor:d.palette.error.main,transform:"scaleX(1)"}},chip:{margin:"0 8px 8px 0",float:"left"},marginDense:{}}},vi={BACKSPACE:8,DELETE:46,LEFT_ARROW:37,RIGHT_ARROW:39},Tc=({value:d,isFocused:e,isDisabled:t,isReadOnly:n,handleClick:m,handleDelete:i,style:a},p)=>I.createElement(B.Chip,{key:p,style:{...a,pointerEvents:t||n?"none":void 0,backgroundColor:e?Wl[300]:void 0},onClick:m,onDelete:i,label:d});class kc extends I.Component{labelRef;labelNode=null;input;newChipKeyCodes;newChipKeys;actualInput=null;inputBlurTimeout=null;_keyPressed;_preventChipCreation;styles={};styleTheme=null;constructor(e){super(e),this.state={chips:e.defaultValue||[],focusedChip:null,inputValue:"",isFocused:!1,chipsUpdated:!1,prevPropsValue:[],variant:this.props.variant||"standard"},this.newChipKeyCodes=e.newChipKeyCodes||[13],this.newChipKeys=e.newChipKeys||["Enter"],this.labelRef=I.createRef(),this.input=I.createRef()}componentDidMount(){this.state.variant==="outlined"&&(this.labelNode=Cl.findDOMNode(this.labelRef.current),this.forceUpdate())}componentWillUnmount(){this.inputBlurTimeout&&clearTimeout(this.inputBlurTimeout)}static getDerivedStateFromProps(e,t){let n=null;return e.value&&e.value.length!==t.prevPropsValue.length&&(n={prevPropsValue:e.value},e.clearInputValueOnChange&&(n.inputValue="")),e.clearInputValueOnChange&&e.value&&e.value.length!==t.prevPropsValue.length&&(n={prevPropsValue:e.value,inputValue:""}),e.disabled&&(n={...n,focusedChip:null}),!t.chipsUpdated&&e.defaultValue&&(n={...n,chips:e.defaultValue}),n}focus=()=>{var e;(e=this.actualInput)==null||e.focus(),this.state.focusedChip&&this.setState({focusedChip:null})};handleInputBlur=e=>{this.props.onBlur&&this.props.onBlur(e),this.setState({isFocused:!1}),this.state.focusedChip&&this.setState({focusedChip:null});const t=e.target.value;let n;switch(this.props.blurBehavior||"clear"){case"add-or-clear":n={clearInputOnFail:!0};case"add":if(this.props.delayBeforeAdd){const m=(this.props.value||this.state.chips).length;this.inputBlurTimeout=setTimeout(()=>{const i=(this.props.value||this.state.chips).length;m===i?this.handleAddChip(t,n):this.clearInput()},150)}else this.handleAddChip(t,n);break;case"clear":this.clearInput();break}};handleInputFocus=e=>{this.setState({isFocused:!0}),this.props.onFocus&&this.props.onFocus(e)};handleKeyDown=e=>{const{focusedChip:t}=this.state;if(this._keyPressed=!1,this._preventChipCreation=!1,this.props.onKeyDown&&(this.props.onKeyDown(e),e.isDefaultPrevented()))return;const n=this.props.value||this.state.chips;if(this.newChipKeyCodes.includes(e.keyCode)||this.newChipKeys.includes(e.key)){this.handleAddChip(e.target.value)!==!1&&e.preventDefault();return}switch(e.keyCode){case vi.BACKSPACE:e.target.value===""&&(t?(this.handleDeleteChip(n[t],t),t&&this.setState({focusedChip:t-1})):this.setState({focusedChip:n.length-1}));break;case vi.DELETE:e.target.value===""&&t&&(this.handleDeleteChip(n[t],t),t<=n.length-1&&this.setState({focusedChip:t}));break;case vi.LEFT_ARROW:t===null&&e.target.value===""&&n.length?this.setState({focusedChip:n.length-1}):t!==null&&t>0&&this.setState({focusedChip:t-1});break;case vi.RIGHT_ARROW:t!==null&&t<n.length-1?this.setState({focusedChip:t+1}):this.setState({focusedChip:null});break;default:this.setState({focusedChip:null});break}};handleKeyUp=e=>{!this._preventChipCreation&&(this.newChipKeyCodes.includes(e.keyCode)||this.newChipKeys.includes(e.key))&&this._keyPressed?this.clearInput():this.updateInput(e.target.value),this.props.onKeyUp&&this.props.onKeyUp(e)};handleUpdateInput=e=>{(this.props.inputValue===null||this.props.inputValue===void 0)&&this.updateInput(e.target.value),this.props.onUpdateInput&&this.props.onUpdateInput(e)};handleAddChip(e,t){if(this.props.onBeforeAdd&&!this.props.onBeforeAdd(e))return this._preventChipCreation=!0,t&&t.clearInputOnFail&&this.clearInput(),!1;this.clearInput();const n=this.props.value||this.state.chips;return e.trim().length?((this.props.allowDuplicates||!n.includes(e))&&(this.props.value&&this.props.onAdd?this.props.onAdd(e):this.updateChips([...this.state.chips,e])),!0):!1}handleDeleteChip(e,t){if(this.props.value)this.props.onDelete&&this.props.onDelete(e,t);else{const n=this.state.chips.slice();if(n.splice(t,1)){let i=this.state.focusedChip;this.state.focusedChip===t?i=null:this.state.focusedChip>t&&(i=this.state.focusedChip-1),this.updateChips(n,{focusedChip:i})}}}updateChips(e,t={}){this.setState({chips:e,chipsUpdated:!0,...t}),this.props.onChange&&this.props.onChange(e)}clearInput(){this.updateInput("")}updateInput(e){this.setState({inputValue:e})}setActualInputRef=e=>{this.actualInput=e,this.props.inputRef&&this.props.inputRef(e)};render(){const{alwaysShowPlaceholder:e,chipRenderer:t=Tc,className:n,disabled:m,disableUnderline:i,error:a,FormHelperTextProps:p,fullWidth:o,fullWidthInput:h,helperText:r,id:s,InputProps:l={},InputLabelProps:u={},inputValue:c,label:f,placeholder:g,readOnly:v,required:b,rootRef:A,value:x,margin:D}=this.props,y=this.state.variant;this.styleTheme!==this.props.theme.palette.mode&&(this.styleTheme=this.props.theme.palette.mode,this.styles=G.Utils.getStyle(this.props.theme,Ac));let E=x||this.state.chips||[];Array.isArray(E)||(E=(E||"").toString().split(/[,\s]+/).map(S=>S.trim()));const T=c??this.state.inputValue,M=(this.props.value||T).length||T.length,$=typeof u.shrink=="boolean"?u.shrink:f!==null&&(M||this.state.isFocused||E.length),L=E.map((S,k)=>t({value:S,isDisabled:!!m,isReadOnly:v,isFocused:this.state.focusedChip===k,handleClick:()=>this.setState({focusedChip:k}),handleDelete:()=>this.handleDeleteChip(S,k),style:this.styles.chip},k.toString())),C={};y==="outlined"&&(C.notched=!!$,C.labelWidth=$&&this.labelNode&&this.labelNode.offsetWidth||0),y!=="standard"?C.startAdornment=L:l.disableUnderline=!0;const w=Ec[y];return I.createElement(B.FormControl,{ref:A,fullWidth:o,className:n,sx:{...this.styles.root,...D==="dense"?this.styles.marginDense:{}},error:a,required:E.length>0?void 0:b,onClick:this.focus,disabled:m,variant:y,component:"div",margin:D},f&&I.createElement(B.InputLabel,{htmlFor:s,sx:{"&.MuiInputLabel-root":this.styles.label,"&.MuiInputLabel-shrink":this.styles.labelShrink},shrink:!!$,focused:this.state.isFocused,variant:y,ref:this.labelRef,required:b,component:"label",...u},f),I.createElement(B.Box,{component:"div",id:"input-chip-container",sx:{...this.styles[y],...this.styles.chipContainer,...this.state.isFocused?this.styles.focused:void 0,...!i&&y==="standard"?this.styles.underline:void 0,...m?this.styles.disabled:void 0,...f?this.styles.labeled:void 0,...a?this.styles.error:void 0}},y==="standard"&&L,I.createElement(w,{ref:this.input,className:`mui-variant-${this.styles[y]} ${f?"mui-chip-with-label":"mui-chip-no-label"}`,sx:{"&.MuiInputBase-input":{...this.styles.input,...this.styles[y]},"&.MuiInputBase-root":{...this.styles.inputRoot}},id:s,value:T,onChange:this.handleUpdateInput,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,inputRef:this.setActualInputRef,disabled:m,fullWidth:h,placeholder:!M&&($||f===null||f===void 0)||e?g:null,readOnly:v,...l,...C})),r&&I.createElement(B.FormHelperText,{...p,className:p==null?void 0:p.className,style:this.styles.helperText},r))}}class cs extends X{componentDidMount(){super.componentDidMount();const{data:e,attr:t}=this.props,n=X.getValue(e,t);if(this.props.schema.delimiter&&typeof n=="string"){const m=n.split(this.props.schema.delimiter).map(i=>i.trim()).filter(i=>i);this.setState({value:m})}else this.setState({value:n||[]})}renderItem(e,t){const{attr:n,schema:m}=this.props,{value:i}=this.state;return I.createElement(B.FormControl,{fullWidth:!0,variant:"standard"},I.createElement(kc,{value:i,disabled:!!t,label:this.getText(m.label),error:!!e,onAdd:a=>{const p=JSON.parse(JSON.stringify(i));p.push(a),this.setState({value:p},()=>{let o;this.props.schema.delimiter?o=this.onChange(n,p.join(`${this.props.schema.delimiter} `)):o=this.onChange(n,p),o instanceof Promise&&o.catch(h=>console.error(h))})},theme:this.props.oContext.theme,onDelete:(a,p)=>{const o=JSON.parse(JSON.stringify(i));o.splice(p,1),this.setState({value:o},()=>{let h;this.props.schema.delimiter?h=this.onChange(n,o.join(`${this.props.schema.delimiter} `)):h=this.onChange(n,o),h instanceof Promise&&h.catch(r=>console.error(r))})}}),I.createElement(B.FormHelperText,null,G.I18n.t("ra_Press ENTER Key to add new item")),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class $c extends X{renderColorDialog(){return!!this.state.showColorDialog&&I.createElement(B.Dialog,{onClose:()=>this.setState({showColorDialog:!1}),open:this.state.showColorDialog},I.createElement(yl,{color:this.state.colorDialogValue,onChange:e=>this.setState({colorDialogValue:e.hex},()=>this.onChange(this.props.attr,this.state.colorDialogValue))}))}renderItem(e,t){const n=X.getValue(this.props.data,this.props.attr);let m=G.Utils.isUseBright(n,null);return m===null&&(m=void 0),I.createElement(I.Fragment,null,this.renderColorDialog(),I.createElement(B.TextField,{variant:"standard",disabled:!!t,style:{minWidth:100,width:"calc(100% - 8px)"},label:this.getText(this.props.schema.label),value:n||"",onClick:()=>!this.props.schema.readOnly&&this.setState({showColorDialog:!0,colorDialogValue:n||""}),onChange:i=>{const a=i.target.value,p=this.onChange(this.props.attr,a);p instanceof Promise&&p.catch(o=>console.error(`Cannot set value: ${o}`))},slotProps:{htmlInput:{style:{backgroundColor:n,color:m?"#FFF":"#000"},readOnly:this.props.schema.readOnly||!1},input:{endAdornment:!this.props.schema.readOnly&&n&&!this.props.schema.noClearButton?I.createElement(B.IconButton,{tabIndex:-1,size:"small",onClick:i=>{i.stopPropagation();const a=this.onChange(this.props.attr,"");a instanceof Promise&&a.catch(p=>console.error(`Cannot set value: ${p}`))}},I.createElement(oe.Close,null)):void 0},inputLabel:{shrink:!0}}}))}}const ar={width:{width:"calc(100% - 85px)"},width50:{width:120,marginRight:5}};class Mc extends X{componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr);this.setState({value:e});const t={};this.props.schema.useSystemName&&(t.useSystem=!!X.getValue(this.props.data,this.props.schema.useSystemName)),this.props.schema.longitudeName&&this.props.schema.latitudeName?(t.longitude=X.getValue(this.props.data,this.props.schema.longitudeName),t.latitude=X.getValue(this.props.data,this.props.schema.latitudeName),!t.longitude&&!t.latitude&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300)):!X.getValue(this.props.data,this.props.attr)&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300),Object.keys(t).length&&setTimeout(()=>this.setState(t),50)}async getSystemCoordinates(){const e=await this.props.oContext.socket.getCompactSystemConfig();if(e!=null&&e.common&&(e.common.longitude||e.common.latitude))if(window.alert(G.I18n.t("ra_Used system settings")),this.props.schema.longitudeName&&this.props.schema.latitudeName)this.setState({longitude:e.common.longitude,latitude:e.common.latitude},async()=>{await this.onChange(this.props.schema.longitudeName,e.common.longitude),await this.onChange(this.props.schema.latitudeName,e.common.latitude)});else{const t=e.common.latitude+(this.props.schema.divider||",")+e.common.longitude;this.setState({value:t},()=>{const n=this.onChange(this.props.attr,t);n instanceof Promise&&n.catch(m=>console.error(`Cannot set value: ${m}`))})}else window.alert(G.I18n.t("ra_Cannot determine position: System settings are empty and GPS detection is disabled in browser"))}getCoordinates(){navigator.geolocation?navigator.geolocation.getCurrentPosition(async e=>{if(e!=null&&e.coords)if(this.props.schema.longitudeName&&this.props.schema.latitudeName)this.setState({longitude:e.coords.longitude,latitude:e.coords.latitude},async()=>{await this.onChange(this.props.schema.longitudeName,e.coords.longitude||""),await this.onChange(this.props.schema.latitudeName,e.coords.latitude||"")});else{const t=e.coords.latitude+(this.props.schema.divider||",")+e.coords.longitude;this.setState({value:t},()=>{const n=this.onChange(this.props.attr,t);n instanceof Promise&&n.catch(m=>console.error(`Cannot set value: ${m}`))})}else await this.getSystemCoordinates()},async e=>{console.error(`Cannot determine coordinates from browser: ${e.message}`),await this.getSystemCoordinates()}):this.getSystemCoordinates().catch(e=>{console.error(`Cannot determine coordinates: ${e}`)})}renderItem(e,t){return I.createElement(I.Fragment,null,this.props.schema.useSystemName?I.createElement(B.FormControlLabel,{control:I.createElement(B.Checkbox,{checked:!!this.state.useSystem,onChange:n=>{const m=n.target.checked;m&&this.getSystemCoordinates().catch(i=>console.error(`Cannot determine coordinates: ${i}`)),this.setState({useSystem:m},()=>this.onChange(this.props.schema.useSystemName,m))}}),label:G.I18n.t("ra_Use system settings for position")}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?I.createElement(B.TextField,{variant:"standard",style:ar.width50,value:this.state.longitude??"",error:!!e,disabled:this.state.useSystem||!!t,onChange:n=>{const m=n.target.value;this.setState({longitude:m},()=>{const i=this.onChange(this.props.schema.longitudeName,(m||"").trim());i instanceof Promise&&i.catch(a=>console.error(`Cannot set value: ${a}`))})},label:G.I18n.t("ra_Longitude")}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?I.createElement(B.TextField,{variant:"standard",style:ar.width50,value:this.state.latitude??"",error:!!e,disabled:this.state.useSystem||!!t,onChange:n=>{const m=n.target.value;this.setState({latitude:m},()=>this.onChange(this.props.schema.latitudeName,(m||"").trim()))},label:G.I18n.t("ra_Latitude")}):null,!this.props.schema.longitudeName||!this.props.schema.latitudeName?I.createElement(B.TextField,{variant:"standard",style:ar.width,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!e,disabled:!!t,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.state.useSystem}},onChange:n=>{const m=n.target.value;this.setState({value:m},()=>this.onChange(this.props.attr,(m||"").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:I.createElement(B.Fab,{size:"small",onClick:()=>this.getCoordinates(),title:G.I18n.t("ra_Take browser position"),style:{marginRight:4}},I.createElement(oe.LocationOn,null)),this.state.useSystem?null:I.createElement(B.Fab,{size:"small",onClick:()=>this.getSystemCoordinates(),title:G.I18n.t("ra_Take position from system settings")},I.createElement(oe.GpsFixed,null)))}}gr.init({name:"iobroker_admin",shared:{"@iobroker/adapter-react-v5":{lib:()=>wl,version:"*"},"@mui/icons-material":{lib:()=>bl,version:"*"},"@iobroker/json-config":{lib:()=>Ul,version:"*"}},remotes:[]});class qn extends X{static runningLoads={};constructor(e){super(e),Object.assign(this.state,{Component:null,error:""})}async componentDidMount(){if(!this.props.schema.url){console.error("URL is empty. Cannot load custom component!"),this.setState({error:"URL is empty. Cannot load custom component!"});return}let e;this.props.schema.url.startsWith("http:")||this.props.schema.url.startsWith("https:")?e=this.props.schema.url:this.props.schema.url.startsWith("./")?e=`${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\./,"")}`:e=`${window.location.protocol}//${window.location.host}/adapter/${this.props.oContext.adapterName}/${this.props.schema.url}`;const[t,n,...m]=this.props.schema.name.split("/"),i=m.join("/");if(!e){console.error('Cannot find URL for custom component! Please define "url" as "custom/customComponents.js" in the schema');return}if(!t||!n||!i){console.error('Invalid format of "name"! Please define "name" as "ConfigCustomBackItUpSet/Components/AdapterExist" in the schema');return}let a=qn.runningLoads[`${e}!${n}`];if(!(a instanceof Promise)){let p;if(this.props.schema.i18n===!0){const o=e.lastIndexOf("/");let h;o!==-1?h=e.substring(0,o):h=e;const r=G.I18n.getLanguage(),s=`${h}/i18n/${r}.json`;p=fetch(s).then(l=>l.json()).then(l=>G.I18n.extendTranslations(l,r)).catch(l=>{if(r!=="en"){fetch(`${h}/i18n/en.json`).then(u=>u.json()).then(u=>G.I18n.extendTranslations(u,r)).catch(u=>console.log(`Cannot load i18n "${s}": ${u}`));return}console.log(`Cannot load i18n "${s}": ${l}`)})}else if(this.props.schema.i18n&&typeof this.props.schema.i18n=="object")try{G.I18n.extendTranslations(this.props.schema.i18n)}catch(o){console.error(`Cannot import i18n: ${o}`)}try{console.log(e,t,n,i),gr.registerRemotes([{name:t,entry:e,type:this.props.schema.bundlerType||void 0}]),a=gr.loadRemote(`${t}/${n}`),p instanceof Promise&&(a=Promise.all([a,p]).then(o=>o[0])),qn.runningLoads[`${e}!${n}`]=a}catch(o){console.error(o),this.setState({error:`Cannot import from ${this.props.schema.url}: ${o}`})}}try{const p=(await a).default;if(p!=null&&p[i])this.setState({Component:p[i]});else{const o=Object.keys(p||{});console.error("URL is empty. Cannot load custom component!"),this.setState({error:`Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${o.join(", ")}`})}}catch(p){console.error(p),this.setState({error:`Cannot import from ${this.props.schema.url}: ${p}`})}}render(){const e=this.state.Component,t=this.props.schema||{};let n=e?I.createElement(e,{...this.props,socket:this.props.oContext.socket,theme:this.props.oContext.theme,themeType:this.props.oContext.themeType,instance:this.props.oContext.instance,adapterName:this.props.oContext.adapterName,systemConfig:this.props.oContext.systemConfig,forceUpdate:this.props.oContext.forceUpdate}):this.state.error?I.createElement("div",null,this.state.error):I.createElement(B.LinearProgress,null);return t.newLine?I.createElement(I.Fragment,null,I.createElement("div",{style:{flexBasis:"100%",height:0}}),n):n}}const _c=["localeText"],wr=J.createContext(null),Ic=function(e){const{localeText:t}=e,n=Se(e,_c),{utils:m,localeText:i}=J.useContext(wr)??{utils:void 0,localeText:void 0},a=Le({props:n,name:"MuiLocalizationProvider"}),{children:p,dateAdapter:o,dateFormats:h,dateLibInstance:r,adapterLocale:s,localeText:l}=a,u=J.useMemo(()=>Y({},l,i,t),[l,i,t]),c=J.useMemo(()=>{if(!o)return m||null;const v=new o({locale:s,formats:h,instance:r});if(!v.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(`
|
|
16
|
+
`));return v},[o,s,h,r,m]),f=J.useMemo(()=>c?{minDate:c.date("1900-01-01T00:00:00.000"),maxDate:c.date("2099-12-31T00:00:00.000")}:null,[c]),g=J.useMemo(()=>({utils:c,defaultDates:f,localeText:u}),[f,c,u]);return ee.jsx(wr.Provider,{value:g,children:p})},Lc=d=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:Y({},d)}}}}),Ni=d=>{const{utils:e,formatKey:t,contextTranslation:n,propsTranslation:m}=d;return i=>{const a=i!==null&&e.isValid(i)?e.format(i,t):null;return(m??n)(i,e,a)}},co={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:d=>d==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(d,e,t,n)=>`Select ${d}. ${!n&&(e===null||!t.isValid(e))?"No time selected":`Selected time is ${n??t.format(e,"fullTime")}`}`,hoursClockNumberText:d=>`${d} hours`,minutesClockNumberText:d=>`${d} minutes`,secondsClockNumberText:d=>`${d} seconds`,selectViewText:d=>`Select ${d}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:d=>`Week ${d}`,calendarWeekNumberText:d=>`${d}`,openDatePickerDialogue:(d,e,t)=>t||d!==null&&e.isValid(d)?`Choose date, selected date is ${t??e.format(d,"fullDate")}`:"Choose date",openTimePickerDialogue:(d,e,t)=>t||d!==null&&e.isValid(d)?`Choose time, selected time is ${t??e.format(d,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:d=>"Y".repeat(d.digitAmount),fieldMonthPlaceholder:d=>d.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:d=>d.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},Fc=co;Lc(co);const vn=()=>{const d=J.useContext(wr);if(d===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(`
|
|
17
|
+
`));if(d.utils===null)throw new Error(["MUI X: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join(`
|
|
18
|
+
`));const e=J.useMemo(()=>Y({},Fc,d.localeText),[d.localeText]);return J.useMemo(()=>Y({},d,{localeText:e}),[d,e])},Re=()=>vn().utils,oi=()=>vn().defaultDates,yn=d=>{const e=Re(),t=J.useRef(void 0);return t.current===void 0&&(t.current=e.date(void 0,d)),t.current},lt=()=>vn().localeText,Rc=qt(ee.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),Oc=qt(ee.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),Pc=qt(ee.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),Nc=qt(ee.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),Bc=qt(ee.jsxs(J.Fragment,{children:[ee.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),ee.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");qt(ee.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange");qt(ee.jsxs(J.Fragment,{children:[ee.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),ee.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time");const Vc=qt(ee.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");function Wc(d){return We("MuiPickersArrowSwitcher",d)}He("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const Hc=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],jc=["ownerState"],zc=["ownerState"],Uc=ge("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(d,e)=>e.root})({display:"flex"}),Gc=ge("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(d,e)=>e.spacer})(({theme:d})=>({width:d.spacing(3)})),us=ge(Fn,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(d,e)=>e.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),Kc=d=>{const{classes:e}=d;return Oe({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},Wc,e)},uo=J.forwardRef(function(e,t){const n=Mt(),m=Le({props:e,name:"MuiPickersArrowSwitcher"}),{children:i,className:a,slots:p,slotProps:o,isNextDisabled:h,isNextHidden:r,onGoToNext:s,nextLabel:l,isPreviousDisabled:u,isPreviousHidden:c,onGoToPrevious:f,previousLabel:g,labelId:v}=m,b=Se(m,Hc),A=m,x=Kc(A),D={isDisabled:h,isHidden:r,goTo:s,label:l},y={isDisabled:u,isHidden:c,goTo:f,label:g},E=(p==null?void 0:p.previousIconButton)??us,T=Ne({elementType:E,externalSlotProps:o==null?void 0:o.previousIconButton,additionalProps:{size:"medium",title:y.label,"aria-label":y.label,disabled:y.isDisabled,edge:"end",onClick:y.goTo},ownerState:Y({},A,{hidden:y.isHidden}),className:je(x.button,x.previousIconButton)}),M=(p==null?void 0:p.nextIconButton)??us,$=Ne({elementType:M,externalSlotProps:o==null?void 0:o.nextIconButton,additionalProps:{size:"medium",title:D.label,"aria-label":D.label,disabled:D.isDisabled,edge:"start",onClick:D.goTo},ownerState:Y({},A,{hidden:D.isHidden}),className:je(x.button,x.nextIconButton)}),L=(p==null?void 0:p.leftArrowIcon)??Oc,C=Ne({elementType:L,externalSlotProps:o==null?void 0:o.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:A,className:x.leftArrowIcon}),w=Se(C,jc),S=(p==null?void 0:p.rightArrowIcon)??Pc,k=Ne({elementType:S,externalSlotProps:o==null?void 0:o.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:A,className:x.rightArrowIcon}),_=Se(k,zc);return ee.jsxs(Uc,Y({ref:t,className:je(x.root,a),ownerState:A},b,{children:[ee.jsx(E,Y({},T,{children:n?ee.jsx(S,Y({},_)):ee.jsx(L,Y({},w))})),i?ee.jsx(Xt,{variant:"subtitle1",component:"span",id:v,children:i}):ee.jsx(Gc,{className:x.spacer,ownerState:A}),ee.jsx(M,Y({},$,{children:n?ee.jsx(L,Y({},w)):ee.jsx(S,Y({},_))}))]}))}),Lt=(d,e)=>d.length!==e.length?!1:e.every(t=>d.includes(t)),ho=({openTo:d,defaultOpenTo:e,views:t,defaultViews:n})=>{const m=t??n;let i;if(d!=null)i=d;else if(m.includes(e))i=e;else if(m.length>0)i=m[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:m,openTo:i}},po=["hours","minutes","seconds"],ei=d=>po.includes(d),Yc=d=>po.includes(d)||d==="meridiem",Jc=(d,e)=>d?e.getHours(d)>=12?"pm":"am":null,ti=(d,e,t)=>t&&(d>=12?"pm":"am")!==e?e==="am"?d-12:d+12:d,Qc=(d,e,t,n)=>{const m=ti(n.getHours(d),e,t);return n.setHours(d,m)},hs=(d,e)=>e.getHours(d)*3600+e.getMinutes(d)*60+e.getSeconds(d),ai=(d,e)=>(t,n)=>d?e.isAfter(t,n):hs(t,e)>hs(n,e),fo=(d,{format:e,views:t,ampm:n})=>{if(e!=null)return e;const m=d.formats;return Lt(t,["hours"])?n?`${m.hours12h} ${m.meridiem}`:m.hours24h:Lt(t,["minutes"])?m.minutes:Lt(t,["seconds"])?m.seconds:Lt(t,["minutes","seconds"])?`${m.minutes}:${m.seconds}`:Lt(t,["hours","minutes","seconds"])?n?`${m.hours12h}:${m.minutes}:${m.seconds} ${m.meridiem}`:`${m.hours24h}:${m.minutes}:${m.seconds}`:n?`${m.hours12h}:${m.minutes} ${m.meridiem}`:`${m.hours24h}:${m.minutes}`};function li({onChange:d,onViewChange:e,openTo:t,view:n,views:m,autoFocus:i,focusedView:a,onFocusedViewChange:p}){const o=J.useRef(t),h=J.useRef(m),r=J.useRef(m.includes(t)?t:m[0]),[s,l]=pn({name:"useViews",state:"view",controlled:n,default:r.current}),u=J.useRef(i?s:null),[c,f]=pn({name:"useViews",state:"focusedView",controlled:a,default:u.current});J.useEffect(()=>{(o.current&&o.current!==t||h.current&&h.current.some(E=>!m.includes(E)))&&(l(m.includes(t)?t:m[0]),h.current=m,o.current=t)},[t,l,s,m]);const g=m.indexOf(s),v=m[g-1]??null,b=m[g+1]??null,A=be((E,T)=>{f(T?E:M=>E===M?null:M),p==null||p(E,T)}),x=be(E=>{A(E,!0),E!==s&&(l(E),e&&e(E))}),D=be(()=>{b&&x(b)}),y=be((E,T,M)=>{const $=T==="finish",L=M?m.indexOf(M)<m.length-1:!!b;if(d(E,$&&L?"partial":T,M),M&&M!==s){const w=m[m.indexOf(M)+1];w&&x(w)}else $&&D()});return{view:s,setView:x,focusedView:c,setFocusedView:A,nextView:b,previousView:v,defaultView:m.includes(t)?t:m[0],goToNextView:D,setValueAndGoToNextView:y}}function Zc(d,{disableFuture:e,maxDate:t,timezone:n}){const m=Re();return J.useMemo(()=>{const i=m.date(void 0,n),a=m.startOfMonth(e&&m.isBefore(i,t)?i:t);return!m.isAfter(a,d)},[e,t,d,m,n])}function Xc(d,{disablePast:e,minDate:t,timezone:n}){const m=Re();return J.useMemo(()=>{const i=m.date(void 0,n),a=m.startOfMonth(e&&m.isAfter(i,t)?i:t);return!m.isBefore(a,d)},[e,t,d,m,n])}function _r(d,e,t,n){const m=Re(),i=Jc(d,m),a=J.useCallback(p=>{const o=d==null?null:Qc(d,p,!!e,m);t(o,n??"partial")},[e,d,t,n,m]);return{meridiemMode:i,handleMeridiemChange:a}}const ni=36,Bi=2,Vi=320,qc=280,Ir=336,mo=232,eu=48,Wi=ge("div")({overflow:"hidden",width:Vi,maxHeight:Ir,display:"flex",flexDirection:"column",margin:"0 auto"});function tu(d){return We("MuiTimeClock",d)}He("MuiTimeClock",["root","arrowSwitcher"]);const In=220,Wt=36,ii={x:In/2,y:In/2},go={x:ii.x,y:0},nu=go.x-ii.x,iu=go.y-ii.y,ru=d=>d*(180/Math.PI),vo=(d,e,t)=>{const n=e-ii.x,m=t-ii.y,i=Math.atan2(nu,iu)-Math.atan2(n,m);let a=ru(i);a=Math.round(a/d)*d,a%=360;const p=Math.floor(a/d)||0,o=n**2+m**2,h=Math.sqrt(o);return{value:p,distance:h}},su=(d,e,t=1)=>{const n=t*6;let{value:m}=vo(n,d,e);return m=m*t%60,m},ou=(d,e,t)=>{const{value:n,distance:m}=vo(30,d,e);let i=n||12;return t?i%=12:m<In/2-Wt&&(i+=12,i%=24),i};function au(d){return We("MuiClockPointer",d)}He("MuiClockPointer",["root","thumb"]);const lu=["className","hasSelected","isInner","type","viewValue"],cu=d=>{const{classes:e}=d;return Oe({root:["root"],thumb:["thumb"]},au,e)},uu=ge("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(d,e)=>e.root})(({theme:d})=>({width:2,backgroundColor:(d.vars||d).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:d.transitions.create(["transform","height"])}}]})),hu=ge("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(d,e)=>e.thumb})(({theme:d})=>({width:4,height:4,backgroundColor:(d.vars||d).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${Wt/2}px)`,border:`${(Wt-4)/2}px solid ${(d.vars||d).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(d.vars||d).palette.primary.main}}]}));function du(d){const e=Le({props:d,name:"MuiClockPointer"}),{className:t,isInner:n,type:m,viewValue:i}=e,a=Se(e,lu),p=J.useRef(m);J.useEffect(()=>{p.current=m},[m]);const o=Y({},e,{shouldAnimate:p.current!==m}),h=cu(o),r=()=>{let l=360/(m==="hours"?12:60)*i;return m==="hours"&&i>12&&(l-=360),{height:Math.round((n?.26:.4)*In),transform:`rotateZ(${l}deg)`}};return ee.jsx(uu,Y({style:r(),className:je(h.root,t),ownerState:o},a,{children:ee.jsx(hu,{ownerState:o,className:h.thumb})}))}function pu(d){return We("MuiClock",d)}He("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);const Mi=(d,e,t)=>{let n=e;return n=d.setHours(n,d.getHours(t)),n=d.setMinutes(n,d.getMinutes(t)),n=d.setSeconds(n,d.getSeconds(t)),n=d.setMilliseconds(n,d.getMilliseconds(t)),n},Zn=({date:d,disableFuture:e,disablePast:t,maxDate:n,minDate:m,isDateDisabled:i,utils:a,timezone:p})=>{const o=Mi(a,a.date(void 0,p),d);t&&a.isBefore(m,o)&&(m=o),e&&a.isAfter(n,o)&&(n=o);let h=d,r=d;for(a.isBefore(d,m)&&(h=m,r=null),a.isAfter(d,n)&&(r&&(r=n),h=null);h||r;){if(h&&a.isAfter(h,n)&&(h=null),r&&a.isBefore(r,m)&&(r=null),h){if(!i(h))return h;h=a.addDays(h,1)}if(r){if(!i(r))return r;r=a.addDays(r,-1)}}return null},fu=(d,e)=>e==null||!d.isValid(e)?null:e,Dt=(d,e,t)=>e==null||!d.isValid(e)?t:e,mu=(d,e,t)=>!d.isValid(e)&&e!=null&&!d.isValid(t)&&t!=null?!0:d.isEqual(e,t),Lr=(d,e)=>{const n=[d.startOfYear(e)];for(;n.length<12;){const m=n[n.length-1];n.push(d.addMonths(m,1))}return n},Fr=(d,e,t)=>t==="date"?d.startOfDay(d.date(void 0,e)):d.date(void 0,e),Jt=(d,e)=>{const t=d.setHours(d.date(),e==="am"?2:14);return d.format(t,"meridiem")},gu=["year","month","day"],ds=d=>gu.includes(d),Rr=(d,{format:e,views:t},n)=>{if(e!=null)return e;const m=d.formats;return Lt(t,["year"])?m.year:Lt(t,["month"])?m.month:Lt(t,["day"])?m.dayOfMonth:Lt(t,["month","year"])?`${m.month} ${m.year}`:Lt(t,["day","month"])?`${m.month} ${m.dayOfMonth}`:n?/en/.test(d.getCurrentLocaleCode())?m.normalDateWithWeekday:m.normalDate:m.keyboardDate},vu=(d,e)=>{const t=d.startOfWeek(e);return[0,1,2,3,4,5,6].map(n=>d.addDays(t,n))},yu=d=>{const{classes:e,meridiemMode:t}=d;return Oe({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton",t==="am"&&"selected"],pmButton:["pmButton",t==="pm"&&"selected"],meridiemText:["meridiemText"]},pu,e)},bu=ge("div",{name:"MuiClock",slot:"Root",overridesResolver:(d,e)=>e.root})(({theme:d})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:d.spacing(2)})),wu=ge("div",{name:"MuiClock",slot:"Clock",overridesResolver:(d,e)=>e.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),Cu=ge("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(d,e)=>e.wrapper})({"&:focus":{outline:"none"}}),Du=ge("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(d,e)=>e.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),Su=ge("div",{name:"MuiClock",slot:"Pin",overridesResolver:(d,e)=>e.pin})(({theme:d})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(d.vars||d).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),yo=(d,e)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:Wt,variants:[{props:{meridiemMode:e},style:{backgroundColor:(d.vars||d).palette.primary.main,color:(d.vars||d).palette.primary.contrastText,"&:hover":{backgroundColor:(d.vars||d).palette.primary.light}}}]}),xu=ge(Fn,{name:"MuiClock",slot:"AmButton",overridesResolver:(d,e)=>e.amButton})(({theme:d})=>Y({},yo(d,"am"),{position:"absolute",left:8})),Eu=ge(Fn,{name:"MuiClock",slot:"PmButton",overridesResolver:(d,e)=>e.pmButton})(({theme:d})=>Y({},yo(d,"pm"),{position:"absolute",right:8})),ps=ge(Xt,{name:"MuiClock",slot:"meridiemText",overridesResolver:(d,e)=>e.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function Au(d){const e=Le({props:d,name:"MuiClock"}),{ampm:t,ampmInClock:n,autoFocus:m,children:i,value:a,handleMeridiemChange:p,isTimeDisabled:o,meridiemMode:h,minutesStep:r=1,onChange:s,selectedId:l,type:u,viewValue:c,viewRange:[f,g],disabled:v=!1,readOnly:b,className:A}=e,x=e,D=Re(),y=lt(),E=J.useRef(!1),T=yu(x),M=o(c,u),$=!t&&u==="hours"&&(c<1||c>12),L=(N,W)=>{v||b||o(N,u)||s(N,W)},C=(N,W)=>{let{offsetX:z,offsetY:j}=N;if(z===void 0){const Z=N.target.getBoundingClientRect();z=N.changedTouches[0].clientX-Z.left,j=N.changedTouches[0].clientY-Z.top}const Q=u==="seconds"||u==="minutes"?su(z,j,r):ou(z,j,!!t);L(Q,W)},w=N=>{E.current=!0,C(N,"shallow")},S=N=>{E.current&&(C(N,"finish"),E.current=!1),N.preventDefault()},k=N=>{N.buttons>0&&C(N.nativeEvent,"shallow")},_=N=>{E.current&&(E.current=!1),C(N.nativeEvent,"finish")},F=J.useMemo(()=>u==="hours"?!0:c%5===0,[u,c]),R=u==="minutes"?r:1,O=J.useRef(null);Ht(()=>{m&&O.current.focus()},[m]);const V=N=>Math.max(f,Math.min(g,N)),P=N=>(N+(g+1))%(g+1),H=N=>{if(!E.current)switch(N.key){case"Home":L(f,"partial"),N.preventDefault();break;case"End":L(g,"partial"),N.preventDefault();break;case"ArrowUp":L(P(c+R),"partial"),N.preventDefault();break;case"ArrowDown":L(P(c-R),"partial"),N.preventDefault();break;case"PageUp":L(V(c+5),"partial"),N.preventDefault();break;case"PageDown":L(V(c-5),"partial"),N.preventDefault();break;case"Enter":case" ":L(c,"finish"),N.preventDefault();break}};return ee.jsxs(bu,{className:je(T.root,A),children:[ee.jsxs(wu,{className:T.clock,children:[ee.jsx(Du,{onTouchMove:w,onTouchStart:w,onTouchEnd:S,onMouseUp:_,onMouseMove:k,ownerState:{disabled:v},className:T.squareMask}),!M&&ee.jsxs(J.Fragment,{children:[ee.jsx(Su,{className:T.pin}),a!=null&&ee.jsx(du,{type:u,viewValue:c,isInner:$,hasSelected:F})]}),ee.jsx(Cu,{"aria-activedescendant":l,"aria-label":y.clockLabelText(u,a,D,a==null?null:D.format(a,"fullTime")),ref:O,role:"listbox",onKeyDown:H,tabIndex:0,className:T.wrapper,children:i})]}),t&&n&&ee.jsxs(J.Fragment,{children:[ee.jsx(xu,{onClick:b?void 0:()=>p("am"),disabled:v||h===null,ownerState:x,className:T.amButton,title:Jt(D,"am"),children:ee.jsx(ps,{variant:"caption",className:T.meridiemText,children:Jt(D,"am")})}),ee.jsx(Eu,{disabled:v||h===null,onClick:b?void 0:()=>p("pm"),ownerState:x,className:T.pmButton,title:Jt(D,"pm"),children:ee.jsx(ps,{variant:"caption",className:T.meridiemText,children:Jt(D,"pm")})})]})]})}function Tu(d){return We("MuiClockNumber",d)}const yi=He("MuiClockNumber",["root","selected","disabled"]),ku=["className","disabled","index","inner","label","selected"],$u=d=>{const{classes:e,selected:t,disabled:n}=d;return Oe({root:["root",t&&"selected",n&&"disabled"]},Tu,e)},Mu=ge("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(d,e)=>[e.root,{[`&.${yi.disabled}`]:e.disabled},{[`&.${yi.selected}`]:e.selected}]})(({theme:d})=>({height:Wt,width:Wt,position:"absolute",left:`calc((100% - ${Wt}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(d.vars||d).palette.text.primary,fontFamily:d.typography.fontFamily,"&:focused":{backgroundColor:(d.vars||d).palette.background.paper},[`&.${yi.selected}`]:{color:(d.vars||d).palette.primary.contrastText},[`&.${yi.disabled}`]:{pointerEvents:"none",color:(d.vars||d).palette.text.disabled},variants:[{props:{inner:!0},style:Y({},d.typography.body2,{color:(d.vars||d).palette.text.secondary})}]}));function bo(d){const e=Le({props:d,name:"MuiClockNumber"}),{className:t,disabled:n,index:m,inner:i,label:a,selected:p}=e,o=Se(e,ku),h=e,r=$u(h),s=m%12/12*Math.PI*2-Math.PI/2,l=(In-Wt-2)/2*(i?.65:1),u=Math.round(Math.cos(s)*l),c=Math.round(Math.sin(s)*l);return ee.jsx(Mu,Y({className:je(r.root,t),"aria-disabled":n?!0:void 0,"aria-selected":p?!0:void 0,role:"option",style:{transform:`translate(${u}px, ${c+(In-Wt)/2}px`},ownerState:h},o,{children:a}))}const _u=({ampm:d,value:e,getClockNumberText:t,isDisabled:n,selectedId:m,utils:i})=>{const a=e?i.getHours(e):null,p=[],o=d?1:0,h=d?12:23,r=s=>a===null?!1:d?s===12?a===12||a===0:a===s||a-12===s:a===s;for(let s=o;s<=h;s+=1){let l=s.toString();s===0&&(l="00");const u=!d&&(s===0||s>12);l=i.formatNumber(l);const c=r(s);p.push(ee.jsx(bo,{id:c?m:void 0,index:s,inner:u,selected:c,disabled:n(s),label:l,"aria-label":t(l)},s))}return p},fs=({utils:d,value:e,isDisabled:t,getClockNumberText:n,selectedId:m})=>{const i=d.formatNumber;return[[5,i("05")],[10,i("10")],[15,i("15")],[20,i("20")],[25,i("25")],[30,i("30")],[35,i("35")],[40,i("40")],[45,i("45")],[50,i("50")],[55,i("55")],[0,i("00")]].map(([a,p],o)=>{const h=a===e;return ee.jsx(bo,{label:p,id:h?m:void 0,index:o+1,inner:!1,disabled:t(a),selected:h,"aria-label":n(p)},a)})},Or=({timezone:d,value:e,defaultValue:t,referenceDate:n,onChange:m,valueManager:i})=>{const a=Re(),p=J.useRef(t),o=e??p.current??i.emptyValue,h=J.useMemo(()=>i.getTimezone(a,o),[a,i,o]),r=be(c=>h==null?c:i.setTimezone(a,h,c));let s;d?s=d:h?s=h:n?s=a.getTimezone(n):s="default";const l=J.useMemo(()=>i.setTimezone(a,s,o),[i,a,s,o]),u=be((c,...f)=>{const g=r(c);m==null||m(g,...f)});return{value:l,handleValueChange:u,timezone:s}},On=({name:d,timezone:e,value:t,defaultValue:n,referenceDate:m,onChange:i,valueManager:a})=>{const[p,o]=pn({name:d,state:"value",controlled:t,default:n??a.emptyValue}),h=be((r,...s)=>{o(r),i==null||i(r,...s)});return Or({timezone:e,value:p,defaultValue:void 0,referenceDate:m,onChange:h,valueManager:a})},Tt={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},Iu=d=>Math.max(...d.map(e=>Tt[e.type]??1)),jn=(d,e,t)=>{if(e===Tt.year)return d.startOfYear(t);if(e===Tt.month)return d.startOfMonth(t);if(e===Tt.day)return d.startOfDay(t);let n=t;return e<Tt.minutes&&(n=d.setMinutes(n,0)),e<Tt.seconds&&(n=d.setSeconds(n,0)),e<Tt.milliseconds&&(n=d.setMilliseconds(n,0)),n},Lu=({props:d,utils:e,granularity:t,timezone:n,getTodayDate:m})=>{let i=m?m():jn(e,t,Fr(e,n));d.minDate!=null&&e.isAfterDay(d.minDate,i)&&(i=jn(e,t,d.minDate)),d.maxDate!=null&&e.isBeforeDay(d.maxDate,i)&&(i=jn(e,t,d.maxDate));const a=ai(d.disableIgnoringDatePartForTimeValidation??!1,e);return d.minTime!=null&&a(d.minTime,i)&&(i=jn(e,t,d.disableIgnoringDatePartForTimeValidation?d.minTime:Mi(e,i,d.minTime))),d.maxTime!=null&&a(i,d.maxTime)&&(i=jn(e,t,d.disableIgnoringDatePartForTimeValidation?d.maxTime:Mi(e,i,d.maxTime))),i},wo=(d,e)=>{const t=d.formatTokenMap[e];if(t==null)throw new Error([`MUI X: The token "${e}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(`
|
|
19
|
+
`));return typeof t=="string"?{type:t,contentType:t==="meridiem"?"letter":"digit",maxLength:void 0}:{type:t.sectionType,contentType:t.contentType,maxLength:t.maxLength}},Fu=d=>{switch(d){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},Hi=(d,e)=>{const t=[],n=d.date(void 0,"default"),m=d.startOfWeek(n),i=d.endOfWeek(n);let a=m;for(;d.isBefore(a,i);)t.push(a),a=d.addDays(a,1);return t.map(p=>d.formatByString(p,e))},Co=(d,e,t,n)=>{switch(t){case"month":return Lr(d,d.date(void 0,e)).map(m=>d.formatByString(m,n));case"weekDay":return Hi(d,n);case"meridiem":{const m=d.date(void 0,e);return[d.startOfDay(m),d.endOfDay(m)].map(i=>d.formatByString(i,n))}default:return[]}},ms="s",Ru=["0","1","2","3","4","5","6","7","8","9"],Ou=d=>{const e=d.date(void 0);return d.formatByString(d.setSeconds(e,0),ms)==="0"?Ru:Array.from({length:10}).map((n,m)=>d.formatByString(d.setSeconds(e,m),ms))},fn=(d,e)=>{if(e[0]==="0")return d;const t=[];let n="";for(let m=0;m<d.length;m+=1){n+=d[m];const i=e.indexOf(n);i>-1&&(t.push(i.toString()),n="")}return t.join("")},Pr=(d,e)=>e[0]==="0"?d:d.split("").map(t=>e[Number(t)]).join(""),gs=(d,e)=>{const t=fn(d,e);return t!==" "&&!Number.isNaN(Number(t))},Do=(d,e)=>{let t=d;for(t=Number(t).toString();t.length<e;)t=`0${t}`;return t},So=(d,e,t,n,m)=>{if(m.type==="day"&&m.contentType==="digit-with-letter"){const a=d.setDate(t.longestMonth,e);return d.formatByString(a,m.format)}let i=e.toString();return m.hasLeadingZerosInInput&&(i=Do(i,m.maxLength)),Pr(i,n)},Pu=(d,e,t,n,m,i,a,p)=>{const o=Fu(n),h=n==="Home",r=n==="End",s=t.value===""||h||r,l=()=>{const c=m[t.type]({currentDate:a,format:t.format,contentType:t.contentType}),f=A=>So(d,A,c,i,t),g=t.type==="minutes"&&(p!=null&&p.minutesStep)?p.minutesStep:1;let b=parseInt(fn(t.value,i),10)+o*g;if(s){if(t.type==="year"&&!r&&!h)return d.formatByString(d.date(void 0,e),t.format);o>0||h?b=c.minimum:b=c.maximum}return b%g!==0&&((o<0||h)&&(b+=g-(g+b)%g),(o>0||r)&&(b-=b%g)),b>c.maximum?f(c.minimum+(b-c.maximum-1)%(c.maximum-c.minimum+1)):b<c.minimum?f(c.maximum-(c.minimum-b-1)%(c.maximum-c.minimum+1)):f(b)},u=()=>{const c=Co(d,e,t.type,t.format);if(c.length===0)return t.value;if(s)return o>0||h?c[0]:c[c.length-1];const v=((c.indexOf(t.value)+o)%c.length+c.length)%c.length;return c[v]};return t.contentType==="digit"||t.contentType==="digit-with-letter"?l():u()},Nr=(d,e,t)=>{let n=d.value||d.placeholder;const m=e==="non-input"?d.hasLeadingZerosInFormat:d.hasLeadingZerosInInput;return e==="non-input"&&d.hasLeadingZerosInInput&&!d.hasLeadingZerosInFormat&&(n=Number(fn(n,t)).toString()),["input-rtl","input-ltr"].includes(e)&&d.contentType==="digit"&&!m&&n.length===1&&(n=`${n}`),e==="input-rtl"&&(n=`${n}`),n},vs=(d,e,t,n)=>d.formatByString(d.parse(e,t),n),xo=(d,e)=>d.formatByString(d.date(void 0,"system"),e).length===4,Eo=(d,e,t,n)=>{if(e!=="digit")return!1;const m=d.date(void 0,"default");switch(t){case"year":return xo(d,n)?d.formatByString(d.setYear(m,1),n)==="0001":d.formatByString(d.setYear(m,2001),n)==="01";case"month":return d.formatByString(d.startOfYear(m),n).length>1;case"day":return d.formatByString(d.startOfMonth(m),n).length>1;case"weekDay":return d.formatByString(d.startOfWeek(m),n).length>1;case"hours":return d.formatByString(d.setHours(m,1),n).length>1;case"minutes":return d.formatByString(d.setMinutes(m,1),n).length>1;case"seconds":return d.formatByString(d.setSeconds(m,1),n).length>1;default:throw new Error("Invalid section type")}},Nu=(d,e,t)=>{const n=e.some(o=>o.type==="day"),m=[],i=[];for(let o=0;o<e.length;o+=1){const h=e[o];n&&h.type==="weekDay"||(m.push(h.format),i.push(Nr(h,"non-input",t)))}const a=m.join(" "),p=i.join(" ");return d.parse(p,a)},Bu=d=>d.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),Vu=(d,e,t)=>{const m=d.map(i=>{const a=Nr(i,t?"input-rtl":"input-ltr",e);return`${i.startSeparator}${a}${i.endSeparator}`}).join("");return t?`${m}`:m},Wu=(d,e,t)=>{const n=d.date(void 0,t),m=d.endOfYear(n),i=d.endOfDay(n),{maxDaysInMonth:a,longestMonth:p}=Lr(d,n).reduce((o,h)=>{const r=d.getDaysInMonth(h);return r>o.maxDaysInMonth?{maxDaysInMonth:r,longestMonth:h}:o},{maxDaysInMonth:0,longestMonth:null});return{year:({format:o})=>({minimum:0,maximum:xo(d,o)?9999:99}),month:()=>({minimum:1,maximum:d.getMonth(m)+1}),day:({currentDate:o})=>({minimum:1,maximum:o!=null&&d.isValid(o)?d.getDaysInMonth(o):a,longestMonth:p}),weekDay:({format:o,contentType:h})=>{if(h==="digit"){const r=Hi(d,o).map(Number);return{minimum:Math.min(...r),maximum:Math.max(...r)}}return{minimum:1,maximum:7}},hours:({format:o})=>{const h=d.getHours(i);return fn(d.formatByString(d.endOfDay(n),o),e)!==h.toString()?{minimum:1,maximum:Number(fn(d.formatByString(d.startOfDay(n),o),e))}:{minimum:0,maximum:h}},minutes:()=>({minimum:0,maximum:d.getMinutes(i)}),seconds:()=>({minimum:0,maximum:d.getSeconds(i)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},Hu=(d,e,t,n)=>{switch(e.type){case"year":return d.setYear(n,d.getYear(t));case"month":return d.setMonth(n,d.getMonth(t));case"weekDay":{const m=Hi(d,e.format),i=d.formatByString(t,e.format),a=m.indexOf(i),o=m.indexOf(e.value)-a;return d.addDays(t,o)}case"day":return d.setDate(n,d.getDate(t));case"meridiem":{const m=d.getHours(t)<12,i=d.getHours(n);return m&&i>=12?d.addHours(n,-12):!m&&i<12?d.addHours(n,12):n}case"hours":return d.setHours(n,d.getHours(t));case"minutes":return d.setMinutes(n,d.getMinutes(t));case"seconds":return d.setSeconds(n,d.getSeconds(t));default:return n}},ys={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},bs=(d,e,t,n,m)=>[...t].sort((i,a)=>ys[i.type]-ys[a.type]).reduce((i,a)=>!m||a.modified?Hu(d,a,e,i):i,n),ju=()=>navigator.userAgent.toLowerCase().includes("android"),zu=(d,e)=>{const t={};if(!e)return d.forEach((o,h)=>{const r=h===0?null:h-1,s=h===d.length-1?null:h+1;t[h]={leftIndex:r,rightIndex:s}}),{neighbors:t,startIndex:0,endIndex:d.length-1};const n={},m={};let i=0,a=0,p=d.length-1;for(;p>=0;){a=d.findIndex((o,h)=>{var r;return h>=i&&((r=o.endSeparator)==null?void 0:r.includes(" "))&&o.endSeparator!==" / "}),a===-1&&(a=d.length-1);for(let o=a;o>=i;o-=1)m[o]=p,n[p]=o,p-=1;i=a+1}return d.forEach((o,h)=>{const r=m[h],s=r===0?null:n[r-1],l=r===d.length-1?null:n[r+1];t[h]={leftIndex:s,rightIndex:l}}),{neighbors:t,startIndex:n[0],endIndex:n[d.length-1]}},Cr=(d,e)=>{if(d==null)return null;if(d==="all")return"all";if(typeof d=="string"){const t=e.findIndex(n=>n.type===d);return t===-1?null:t}return d},Uu=(d,e)=>{if(d.value)switch(d.type){case"month":{if(d.contentType==="digit")return e.format(e.setMonth(e.date(),Number(d.value)-1),"month");const t=e.parse(d.value,d.format);return t?e.format(t,"month"):void 0}case"day":return d.contentType==="digit"?e.format(e.setDate(e.startOfYear(e.date()),Number(d.value)),"dayOfMonthFull"):d.value;case"weekDay":return;default:return}},Gu=(d,e)=>{if(d.value)switch(d.type){case"weekDay":return d.contentType==="letter"?void 0:Number(d.value);case"meridiem":{const t=e.parse(`01:00 ${d.value}`,`${e.formats.hours12h}:${e.formats.minutes} ${d.format}`);return t?e.getHours(t)>=12?1:0:void 0}case"day":return d.contentType==="digit-with-letter"?parseInt(d.value,10):Number(d.value);case"month":{if(d.contentType==="digit")return Number(d.value);const t=e.parse(d.value,d.format);return t?e.getMonth(t)+1:void 0}default:return d.contentType!=="letter"?Number(d.value):void 0}},Ku=["value","referenceDate"],st={emptyValue:null,getTodayValue:Fr,getInitialReferenceValue:d=>{let{value:e,referenceDate:t}=d,n=Se(d,Ku);return e!=null&&n.utils.isValid(e)?e:t??Lu(n)},cleanValue:fu,areValuesEqual:mu,isSameError:(d,e)=>d===e,hasError:d=>d!=null,defaultErrorState:null,getTimezone:(d,e)=>e==null||!d.isValid(e)?null:d.getTimezone(e),setTimezone:(d,e,t)=>t==null?null:d.setTimezone(t,e)},Ao={updateReferenceValue:(d,e,t)=>e==null||!d.isValid(e)?t:e,getSectionsFromValue:(d,e,t,n)=>!d.isValid(e)&&!!t?t:n(e),getV7HiddenInputValueFromSections:Bu,getV6InputValueFromSections:Vu,getActiveDateManager:(d,e)=>({date:e.value,referenceDate:e.referenceValue,getSections:t=>t,getNewValuesFromNewActiveDate:t=>({value:t,referenceValue:t==null||!d.isValid(t)?e.referenceValue:t})}),parseValueStr:(d,e,t)=>t(d.trim(),e)},Br=({value:d,referenceDate:e,utils:t,props:n,timezone:m})=>{const i=J.useMemo(()=>st.getInitialReferenceValue({value:d,utils:t,props:n,referenceDate:e,granularity:Tt.day,timezone:m,getTodayDate:()=>Fr(t,m,"date")}),[]);return d??i},Yu=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],Ju=d=>{const{classes:e}=d;return Oe({root:["root"],arrowSwitcher:["arrowSwitcher"]},tu,e)},Qu=ge(Wi,{name:"MuiTimeClock",slot:"Root",overridesResolver:(d,e)=>e.root})({display:"flex",flexDirection:"column",position:"relative"}),Zu=ge(uo,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(d,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),Xu=["hours","minutes"],qu=J.forwardRef(function(e,t){const n=Re(),m=Le({props:e,name:"MuiTimeClock"}),{ampm:i=n.is12HourCycleInCurrentLocale(),ampmInClock:a=!1,autoFocus:p,slots:o,slotProps:h,value:r,defaultValue:s,referenceDate:l,disableIgnoringDatePartForTimeValidation:u=!1,maxTime:c,minTime:f,disableFuture:g,disablePast:v,minutesStep:b=1,shouldDisableTime:A,showViewSwitcher:x,onChange:D,view:y,views:E=Xu,openTo:T,onViewChange:M,focusedView:$,onFocusedViewChange:L,className:C,disabled:w,readOnly:S,timezone:k}=m,_=Se(m,Yu),{value:F,handleValueChange:R,timezone:O}=On({name:"TimeClock",timezone:k,value:r,defaultValue:s,referenceDate:l,onChange:D,valueManager:st}),V=Br({value:F,referenceDate:l,utils:n,props:m,timezone:O}),P=lt(),H=yn(O),{view:N,setView:W,previousView:z,nextView:j,setValueAndGoToNextView:Q}=li({view:y,views:E,openTo:T,onViewChange:M,onChange:R,focusedView:$,onFocusedViewChange:L}),{meridiemMode:Z,handleMeridiemChange:q}=_r(V,i,Q),ne=J.useCallback((ue,le)=>{const ae=ai(u,n),fe=le==="hours"||le==="minutes"&&E.includes("seconds"),me=({start:Ee,end:Ge})=>!(f&&ae(f,Ge)||c&&ae(Ee,c)||g&&ae(Ee,H)||v&&ae(H,fe?Ge:Ee)),ve=(Ee,Ge=1)=>{if(Ee%Ge!==0)return!1;if(A)switch(le){case"hours":return!A(n.setHours(V,Ee),"hours");case"minutes":return!A(n.setMinutes(V,Ee),"minutes");case"seconds":return!A(n.setSeconds(V,Ee),"seconds");default:return!1}return!0};switch(le){case"hours":{const Ee=ti(ue,Z,i),Ge=n.setHours(V,Ee);if(n.getHours(Ge)!==Ee)return!0;const nt=n.setSeconds(n.setMinutes(Ge,0),0),dt=n.setSeconds(n.setMinutes(Ge,59),59);return!me({start:nt,end:dt})||!ve(Ee)}case"minutes":{const Ee=n.setMinutes(V,ue),Ge=n.setSeconds(Ee,0),nt=n.setSeconds(Ee,59);return!me({start:Ge,end:nt})||!ve(ue,b)}case"seconds":{const Ee=n.setSeconds(V,ue);return!me({start:Ee,end:Ee})||!ve(ue)}default:throw new Error("not supported")}},[i,V,u,c,Z,f,b,A,n,g,v,H,E]),se=Rn(),pe=J.useMemo(()=>{switch(N){case"hours":{const ue=(fe,me)=>{const ve=ti(fe,Z,i);Q(n.setHours(V,ve),me,"hours")},le=n.getHours(V);let ae;return i?le>12?ae=[12,23]:ae=[0,11]:ae=[0,23],{onChange:ue,viewValue:le,children:_u({value:F,utils:n,ampm:i,getClockNumberText:P.hoursClockNumberText,isDisabled:fe=>w||ne(fe,"hours"),selectedId:se}),viewRange:ae}}case"minutes":{const ue=n.getMinutes(V);return{viewValue:ue,onChange:(ae,fe)=>{Q(n.setMinutes(V,ae),fe,"minutes")},children:fs({utils:n,value:ue,getClockNumberText:P.minutesClockNumberText,isDisabled:ae=>w||ne(ae,"minutes"),selectedId:se}),viewRange:[0,59]}}case"seconds":{const ue=n.getSeconds(V);return{viewValue:ue,onChange:(ae,fe)=>{Q(n.setSeconds(V,ae),fe,"seconds")},children:fs({utils:n,value:ue,getClockNumberText:P.secondsClockNumberText,isDisabled:ae=>w||ne(ae,"seconds"),selectedId:se}),viewRange:[0,59]}}default:throw new Error("You must provide the type for ClockView")}},[N,n,F,i,P.hoursClockNumberText,P.minutesClockNumberText,P.secondsClockNumberText,Z,Q,V,ne,se,w]),ie=m,de=Ju(ie);return ee.jsxs(Qu,Y({ref:t,className:je(de.root,C),ownerState:ie},_,{children:[ee.jsx(Au,Y({autoFocus:p??!!$,ampmInClock:a&&E.includes("hours"),value:F,type:N,ampm:i,minutesStep:b,isTimeDisabled:ne,meridiemMode:Z,handleMeridiemChange:q,selectedId:se,disabled:w,readOnly:S},pe)),x&&ee.jsx(Zu,{className:de.arrowSwitcher,slots:o,slotProps:h,onGoToPrevious:()=>W(z),isPreviousDisabled:!z,previousLabel:P.openPreviousView,onGoToNext:()=>W(j),isNextDisabled:!j,nextLabel:P.openNextView,ownerState:ie})]}))});function eh(d){return We("MuiDigitalClock",d)}He("MuiDigitalClock",["root","list","item"]);function An(d,e){return Array.isArray(e)?e.every(t=>d.indexOf(t)!==-1):d.indexOf(e)!==-1}const th=(d,e)=>t=>{(t.key==="Enter"||t.key===" ")&&(d(t),t.preventDefault(),t.stopPropagation())},ct=(d=document)=>{const e=d.activeElement;return e?e.shadowRoot?ct(e.shadowRoot):e:null},_i=d=>Array.from(d.children).indexOf(ct(document)),To="@media (pointer: fine)",nh=["ampm","timeStep","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","views","skipDisabled","timezone"],ih=d=>{const{classes:e}=d;return Oe({root:["root"],list:["list"],item:["item"]},eh,e)},rh=ge(Wi,{name:"MuiDigitalClock",slot:"Root",overridesResolver:(d,e)=>e.root})({overflowY:"auto",width:"100%","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},maxHeight:mo,variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]}),sh=ge(to,{name:"MuiDigitalClock",slot:"List",overridesResolver:(d,e)=>e.list})({padding:0}),oh=ge(eo,{name:"MuiDigitalClock",slot:"Item",overridesResolver:(d,e)=>e.item})(({theme:d})=>({padding:"8px 16px",margin:"2px 4px","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:d.vars?`rgba(${d.vars.palette.primary.mainChannel} / ${d.vars.palette.action.hoverOpacity})`:Ft(d.palette.primary.main,d.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(d.vars||d).palette.primary.main,color:(d.vars||d).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(d.vars||d).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:d.vars?`rgba(${d.vars.palette.primary.mainChannel} / ${d.vars.palette.action.focusOpacity})`:Ft(d.palette.primary.main,d.palette.action.focusOpacity)}})),ah=J.forwardRef(function(e,t){const n=Re(),m=J.useRef(null),i=ht(t,m),a=J.useRef(null),p=Le({props:e,name:"MuiDigitalClock"}),{ampm:o=n.is12HourCycleInCurrentLocale(),timeStep:h=30,autoFocus:r,slots:s,slotProps:l,value:u,defaultValue:c,referenceDate:f,disableIgnoringDatePartForTimeValidation:g=!1,maxTime:v,minTime:b,disableFuture:A,disablePast:x,minutesStep:D=1,shouldDisableTime:y,onChange:E,view:T,openTo:M,onViewChange:$,focusedView:L,onFocusedViewChange:C,className:w,disabled:S,readOnly:k,views:_=["hours"],skipDisabled:F=!1,timezone:R}=p,O=Se(p,nh),{value:V,handleValueChange:P,timezone:H}=On({name:"DigitalClock",timezone:R,value:u,defaultValue:c,referenceDate:f,onChange:E,valueManager:st}),N=lt(),W=yn(H),z=J.useMemo(()=>Y({},p,{alreadyRendered:!!m.current}),[p]),j=ih(z),Q=(s==null?void 0:s.digitalClockItem)??oh,Z=Ne({elementType:Q,externalSlotProps:l==null?void 0:l.digitalClockItem,ownerState:{},className:j.item}),q=Br({value:V,referenceDate:f,utils:n,props:p,timezone:H}),ne=be(ae=>P(ae,"finish","hours")),{setValueAndGoToNextView:se}=li({view:T,views:_,openTo:M,onViewChange:$,onChange:ne,focusedView:L,onFocusedViewChange:C}),pe=be(ae=>{se(ae,"finish")});J.useEffect(()=>{if(m.current===null)return;const ae=m.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');if(!ae)return;const fe=ae.offsetTop;(r||L)&&ae.focus(),m.current.scrollTop=fe-4});const ie=J.useCallback(ae=>{const fe=ai(g,n),me=()=>!(b&&fe(b,ae)||v&&fe(ae,v)||A&&fe(ae,W)||x&&fe(W,ae)),ve=()=>n.getMinutes(ae)%D!==0?!1:y?!y(ae,"hours"):!0;return!me()||!ve()},[g,n,b,v,A,W,x,D,y]),de=J.useMemo(()=>{const ae=[];let me=n.startOfDay(q);for(;n.isSameDay(q,me);)ae.push(me),me=n.addMinutes(me,h);return ae},[q,h,n]),ue=de.findIndex(ae=>n.isEqual(ae,q)),le=ae=>{switch(ae.key){case"PageUp":{const fe=_i(a.current)-5,me=a.current.children,ve=Math.max(0,fe),Ee=me[ve];Ee&&Ee.focus(),ae.preventDefault();break}case"PageDown":{const fe=_i(a.current)+5,me=a.current.children,ve=Math.min(me.length-1,fe),Ee=me[ve];Ee&&Ee.focus(),ae.preventDefault();break}}};return ee.jsx(rh,Y({ref:i,className:je(j.root,w),ownerState:z},O,{children:ee.jsx(sh,{ref:a,role:"listbox","aria-label":N.timePickerToolbarTitle,className:j.list,onKeyDown:le,children:de.map((ae,fe)=>{if(F&&ie(ae))return null;const me=n.isEqual(ae,V),ve=n.format(ae,o?"fullTime12h":"fullTime24h"),Ee=ue===fe||ue===-1&&fe===0?0:-1;return ee.jsx(Q,Y({onClick:()=>!k&&pe(ae),selected:me,disabled:S||ie(ae),disableRipple:k,role:"option","aria-disabled":k,"aria-selected":me,tabIndex:Ee},Z,{children:ve}),`${ae.valueOf()}-${ve}`)})})}))});function lh(d){return We("MuiMultiSectionDigitalClock",d)}He("MuiMultiSectionDigitalClock",["root"]);function ch(d){return We("MuiMultiSectionDigitalClockSection",d)}He("MuiMultiSectionDigitalClockSection",["root","item"]);const uh=["autoFocus","onChange","className","disabled","readOnly","items","active","slots","slotProps","skipDisabled"],hh=d=>{const{classes:e}=d;return Oe({root:["root"],item:["item"]},ch,e)},dh=ge(to,{name:"MuiMultiSectionDigitalClockSection",slot:"Root",overridesResolver:(d,e)=>e.root})(({theme:d})=>({maxHeight:mo,width:56,padding:0,overflow:"hidden","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},"@media (pointer: fine)":{"&:hover":{overflowY:"auto"}},"@media (pointer: none), (pointer: coarse)":{overflowY:"auto"},"&:not(:first-of-type)":{borderLeft:`1px solid ${(d.vars||d).palette.divider}`},"&::after":{display:"block",content:'""',height:"calc(100% - 40px - 6px)"},variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]})),ph=ge(eo,{name:"MuiMultiSectionDigitalClockSection",slot:"Item",overridesResolver:(d,e)=>e.item})(({theme:d})=>({padding:8,margin:"2px 4px",width:eu,justifyContent:"center","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:d.vars?`rgba(${d.vars.palette.primary.mainChannel} / ${d.vars.palette.action.hoverOpacity})`:Ft(d.palette.primary.main,d.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(d.vars||d).palette.primary.main,color:(d.vars||d).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(d.vars||d).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:d.vars?`rgba(${d.vars.palette.primary.mainChannel} / ${d.vars.palette.action.focusOpacity})`:Ft(d.palette.primary.main,d.palette.action.focusOpacity)}})),fh=J.forwardRef(function(e,t){const n=J.useRef(null),m=ht(t,n),i=J.useRef(null),a=Le({props:e,name:"MuiMultiSectionDigitalClockSection"}),{autoFocus:p,onChange:o,className:h,disabled:r,readOnly:s,items:l,active:u,slots:c,slotProps:f,skipDisabled:g}=a,v=Se(a,uh),b=J.useMemo(()=>Y({},a,{alreadyRendered:!!n.current}),[a]),A=hh(b),x=(c==null?void 0:c.digitalClockSectionItem)??ph;J.useEffect(()=>{if(n.current===null)return;const E=n.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');if(u&&p&&E&&E.focus(),!E||i.current===E)return;i.current=E;const T=E.offsetTop;n.current.scrollTop=T-4});const D=l.findIndex(E=>E.isFocused(E.value)),y=E=>{switch(E.key){case"PageUp":{const T=_i(n.current)-5,M=n.current.children,$=Math.max(0,T),L=M[$];L&&L.focus(),E.preventDefault();break}case"PageDown":{const T=_i(n.current)+5,M=n.current.children,$=Math.min(M.length-1,T),L=M[$];L&&L.focus(),E.preventDefault();break}}};return ee.jsx(dh,Y({ref:m,className:je(A.root,h),ownerState:b,autoFocusItem:p&&u,role:"listbox",onKeyDown:y},v,{children:l.map((E,T)=>{var w;const M=(w=E.isDisabled)==null?void 0:w.call(E,E.value),$=r||M;if(g&&$)return null;const L=E.isSelected(E.value),C=D===T||D===-1&&T===0?0:-1;return ee.jsx(x,Y({onClick:()=>!s&&o(E.value),selected:L,disabled:$,disableRipple:s,role:"option","aria-disabled":s||$||void 0,"aria-label":E.ariaLabel,"aria-selected":L,tabIndex:C,className:A.item},f==null?void 0:f.digitalClockSectionItem,{children:E.label}),E.label)})}))}),mh=({now:d,value:e,utils:t,ampm:n,isDisabled:m,resolveAriaLabel:i,timeStep:a,valueOrReferenceDate:p})=>{const o=e?t.getHours(e):null,h=[],r=(u,c)=>{const f=c??o;return f===null?!1:n?u===12?f===12||f===0:f===u||f-12===u:f===u},s=u=>r(u,t.getHours(p)),l=n?11:23;for(let u=0;u<=l;u+=a){let c=t.format(t.setHours(d,u),n?"hours12h":"hours24h");const f=i(parseInt(c,10).toString());c=t.formatNumber(c),h.push({value:u,label:c,isSelected:r,isDisabled:m,isFocused:s,ariaLabel:f})}return h},ws=({value:d,utils:e,isDisabled:t,timeStep:n,resolveLabel:m,resolveAriaLabel:i,hasValue:a=!0})=>{const p=h=>d===null?!1:a&&d===h,o=h=>d===h;return[...Array.from({length:Math.ceil(60/n)},(h,r)=>{const s=n*r;return{value:s,label:e.formatNumber(m(s)),isDisabled:t,isSelected:p,isFocused:o,ariaLabel:i(s.toString())}})]},gh=["ampm","timeSteps","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","skipDisabled","timezone"],vh=d=>{const{classes:e}=d;return Oe({root:["root"]},lh,e)},yh=ge(Wi,{name:"MuiMultiSectionDigitalClock",slot:"Root",overridesResolver:(d,e)=>e.root})(({theme:d})=>({display:"flex",flexDirection:"row",width:"100%",borderBottom:`1px solid ${(d.vars||d).palette.divider}`})),bh=J.forwardRef(function(e,t){const n=Re(),m=Mt(),i=Le({props:e,name:"MuiMultiSectionDigitalClock"}),{ampm:a=n.is12HourCycleInCurrentLocale(),timeSteps:p,autoFocus:o,slots:h,slotProps:r,value:s,defaultValue:l,referenceDate:u,disableIgnoringDatePartForTimeValidation:c=!1,maxTime:f,minTime:g,disableFuture:v,disablePast:b,minutesStep:A=1,shouldDisableTime:x,onChange:D,view:y,views:E=["hours","minutes"],openTo:T,onViewChange:M,focusedView:$,onFocusedViewChange:L,className:C,disabled:w,readOnly:S,skipDisabled:k=!1,timezone:_}=i,F=Se(i,gh),{value:R,handleValueChange:O,timezone:V}=On({name:"MultiSectionDigitalClock",timezone:_,value:s,defaultValue:l,referenceDate:u,onChange:D,valueManager:st}),P=lt(),H=yn(V),N=J.useMemo(()=>Y({hours:1,minutes:5,seconds:5},p),[p]),W=Br({value:R,referenceDate:u,utils:n,props:i,timezone:V}),z=be((me,ve,Ee)=>O(me,ve,Ee)),j=J.useMemo(()=>!a||!E.includes("hours")||E.includes("meridiem")?E:[...E,"meridiem"],[a,E]),{view:Q,setValueAndGoToNextView:Z,focusedView:q}=li({view:y,views:j,openTo:T,onViewChange:M,onChange:z,focusedView:$,onFocusedViewChange:L}),ne=be(me=>{Z(me,"finish","meridiem")}),{meridiemMode:se,handleMeridiemChange:pe}=_r(W,a,ne,"finish"),ie=J.useCallback((me,ve)=>{const Ee=ai(c,n),Ge=ve==="hours"||ve==="minutes"&&j.includes("seconds"),nt=({start:Ze,end:re})=>!(g&&Ee(g,re)||f&&Ee(Ze,f)||v&&Ee(Ze,H)||b&&Ee(H,Ge?re:Ze)),dt=(Ze,re=1)=>{if(Ze%re!==0)return!1;if(x)switch(ve){case"hours":return!x(n.setHours(W,Ze),"hours");case"minutes":return!x(n.setMinutes(W,Ze),"minutes");case"seconds":return!x(n.setSeconds(W,Ze),"seconds");default:return!1}return!0};switch(ve){case"hours":{const Ze=ti(me,se,a),re=n.setHours(W,Ze);if(n.getHours(re)!==Ze)return!0;const ye=n.setSeconds(n.setMinutes(re,0),0),Ce=n.setSeconds(n.setMinutes(re,59),59);return!nt({start:ye,end:Ce})||!dt(Ze)}case"minutes":{const Ze=n.setMinutes(W,me),re=n.setSeconds(Ze,0),ye=n.setSeconds(Ze,59);return!nt({start:re,end:ye})||!dt(me,A)}case"seconds":{const Ze=n.setSeconds(W,me);return!nt({start:Ze,end:Ze})||!dt(me)}default:throw new Error("not supported")}},[a,W,c,f,se,g,A,x,n,v,b,H,j]),de=J.useCallback(me=>{switch(me){case"hours":return{onChange:ve=>{const Ee=ti(ve,se,a);Z(n.setHours(W,Ee),"finish","hours")},items:mh({now:H,value:R,ampm:a,utils:n,isDisabled:ve=>ie(ve,"hours"),timeStep:N.hours,resolveAriaLabel:P.hoursClockNumberText,valueOrReferenceDate:W})};case"minutes":return{onChange:ve=>{Z(n.setMinutes(W,ve),"finish","minutes")},items:ws({value:n.getMinutes(W),utils:n,isDisabled:ve=>ie(ve,"minutes"),resolveLabel:ve=>n.format(n.setMinutes(H,ve),"minutes"),timeStep:N.minutes,hasValue:!!R,resolveAriaLabel:P.minutesClockNumberText})};case"seconds":return{onChange:ve=>{Z(n.setSeconds(W,ve),"finish","seconds")},items:ws({value:n.getSeconds(W),utils:n,isDisabled:ve=>ie(ve,"seconds"),resolveLabel:ve=>n.format(n.setSeconds(H,ve),"seconds"),timeStep:N.seconds,hasValue:!!R,resolveAriaLabel:P.secondsClockNumberText})};case"meridiem":{const ve=Jt(n,"am"),Ee=Jt(n,"pm");return{onChange:pe,items:[{value:"am",label:ve,isSelected:()=>!!R&&se==="am",isFocused:()=>!!W&&se==="am",ariaLabel:ve},{value:"pm",label:Ee,isSelected:()=>!!R&&se==="pm",isFocused:()=>!!W&&se==="pm",ariaLabel:Ee}]}}default:throw new Error(`Unknown view: ${me} found.`)}},[H,R,a,n,N.hours,N.minutes,N.seconds,P.hoursClockNumberText,P.minutesClockNumberText,P.secondsClockNumberText,se,Z,W,ie,pe]),ue=J.useMemo(()=>{if(!m)return j;const me=j.filter(ve=>ve!=="meridiem");return me.reverse(),j.includes("meridiem")&&me.push("meridiem"),me},[m,j]),le=J.useMemo(()=>j.reduce((me,ve)=>Y({},me,{[ve]:de(ve)}),{}),[j,de]),ae=i,fe=vh(ae);return ee.jsx(yh,Y({ref:t,className:je(fe.root,C),ownerState:ae,role:"group"},F,{children:ue.map(me=>ee.jsx(fh,{items:le[me].items,onChange:le[me].onChange,active:Q===me,autoFocus:o??q===me,disabled:w,readOnly:S,slots:h,slotProps:r,skipDisabled:k,"aria-label":P.selectViewText(me)},me))}))});function wh(d){return We("MuiPickersDay",d)}const ln=He("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),Ch=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],Dh=d=>{const{selected:e,disableMargin:t,disableHighlightToday:n,today:m,disabled:i,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:p,classes:o}=d,h=a&&!p;return Oe({root:["root",e&&!h&&"selected",i&&"disabled",!t&&"dayWithMargin",!n&&m&&"today",a&&p&&"dayOutsideMonth",h&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},wh,o)},ko=({theme:d})=>Y({},d.typography.caption,{width:ni,height:ni,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:d.transitions.create("background-color",{duration:d.transitions.duration.short}),color:(d.vars||d).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:d.vars?`rgba(${d.vars.palette.primary.mainChannel} / ${d.vars.palette.action.hoverOpacity})`:Ft(d.palette.primary.main,d.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:d.vars?`rgba(${d.vars.palette.primary.mainChannel} / ${d.vars.palette.action.focusOpacity})`:Ft(d.palette.primary.main,d.palette.action.focusOpacity),[`&.${ln.selected}`]:{willChange:"background-color",backgroundColor:(d.vars||d).palette.primary.dark}},[`&.${ln.selected}`]:{color:(d.vars||d).palette.primary.contrastText,backgroundColor:(d.vars||d).palette.primary.main,fontWeight:d.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(d.vars||d).palette.primary.dark}},[`&.${ln.disabled}:not(.${ln.selected})`]:{color:(d.vars||d).palette.text.disabled},[`&.${ln.disabled}&.${ln.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${Bi}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(d.vars||d).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${ln.selected})`]:{border:`1px solid ${(d.vars||d).palette.text.secondary}`}}}]}),$o=(d,e)=>{const{ownerState:t}=d;return[e.root,!t.disableMargin&&e.dayWithMargin,!t.disableHighlightToday&&t.today&&e.today,!t.outsideCurrentMonth&&t.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,t.outsideCurrentMonth&&!t.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},Sh=ge(Al,{name:"MuiPickersDay",slot:"Root",overridesResolver:$o})(ko),xh=ge("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:$o})(({theme:d})=>Y({},ko({theme:d}),{opacity:0,pointerEvents:"none"})),zn=()=>{},Eh=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiPickersDay"}),{autoFocus:m=!1,className:i,day:a,disabled:p=!1,disableHighlightToday:o=!1,disableMargin:h=!1,isAnimating:r,onClick:s,onDaySelect:l,onFocus:u=zn,onBlur:c=zn,onKeyDown:f=zn,onMouseDown:g=zn,onMouseEnter:v=zn,outsideCurrentMonth:b,selected:A=!1,showDaysOutsideCurrentMonth:x=!1,children:D,today:y=!1}=n,E=Se(n,Ch),T=Y({},n,{autoFocus:m,disabled:p,disableHighlightToday:o,disableMargin:h,selected:A,showDaysOutsideCurrentMonth:x,today:y}),M=Dh(T),$=Re(),L=J.useRef(null),C=ht(L,t);Ht(()=>{m&&!p&&!r&&!b&&L.current.focus()},[m,p,r,b]);const w=k=>{g(k),b&&k.preventDefault()},S=k=>{p||l(a),b&&k.currentTarget.focus(),s&&s(k)};return b&&!x?ee.jsx(xh,{className:je(M.root,M.hiddenDaySpacingFiller,i),ownerState:T,role:E.role}):ee.jsx(Sh,Y({className:je(M.root,i),ref:C,centerRipple:!0,disabled:p,tabIndex:A?0:-1,onKeyDown:k=>f(k,a),onFocus:k=>u(k,a),onBlur:k=>c(k,a),onMouseEnter:k=>v(k,a),onClick:S,onMouseDown:w},E,{ownerState:T,children:D||$.format(a,"dayOfMonth")}))}),Ah=J.memo(Eh),ci=({props:d,value:e,timezone:t,adapter:n})=>{if(e===null)return null;const{shouldDisableDate:m,shouldDisableMonth:i,shouldDisableYear:a,disablePast:p,disableFuture:o}=d,h=n.utils.date(void 0,t),r=Dt(n.utils,d.minDate,n.defaultDates.minDate),s=Dt(n.utils,d.maxDate,n.defaultDates.maxDate);switch(!0){case!n.utils.isValid(e):return"invalidDate";case!!(m&&m(e)):return"shouldDisableDate";case!!(i&&i(e)):return"shouldDisableMonth";case!!(a&&a(e)):return"shouldDisableYear";case!!(o&&n.utils.isAfterDay(e,h)):return"disableFuture";case!!(p&&n.utils.isBeforeDay(e,h)):return"disablePast";case!!(r&&n.utils.isBeforeDay(e,r)):return"minDate";case!!(s&&n.utils.isAfterDay(e,s)):return"maxDate";default:return null}};ci.valueManager=st;const ji=({adapter:d,value:e,timezone:t,props:n})=>{if(e===null)return null;const{minTime:m,maxTime:i,minutesStep:a,shouldDisableTime:p,disableIgnoringDatePartForTimeValidation:o=!1,disablePast:h,disableFuture:r}=n,s=d.utils.date(void 0,t),l=ai(o,d.utils);switch(!0){case!d.utils.isValid(e):return"invalidDate";case!!(m&&l(m,e)):return"minTime";case!!(i&&l(e,i)):return"maxTime";case!!(r&&d.utils.isAfter(e,s)):return"disableFuture";case!!(h&&d.utils.isBefore(e,s)):return"disablePast";case!!(p&&p(e,"hours")):return"shouldDisableTime-hours";case!!(p&&p(e,"minutes")):return"shouldDisableTime-minutes";case!!(p&&p(e,"seconds")):return"shouldDisableTime-seconds";case!!(a&&d.utils.getMinutes(e)%a!==0):return"minutesStep";default:return null}};ji.valueManager=st;const Dr=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],Sr=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],Mo=["minDateTime","maxDateTime"],Th=[...Dr,...Sr,...Mo],zi=d=>Th.reduce((e,t)=>(d.hasOwnProperty(t)&&(e[t]=d[t]),e),{});function _o(d){const{props:e,validator:t,value:n,timezone:m,onError:i}=d,a=vn(),p=J.useRef(t.valueManager.defaultErrorState),o=t({adapter:a,value:n,timezone:m,props:e}),h=t.valueManager.hasError(o);J.useEffect(()=>{i&&!t.valueManager.isSameError(o,p.current)&&i(o,n),p.current=o},[t,i,o,n]);const r=be(s=>t({adapter:a,value:s,timezone:m,props:e}));return{validationError:o,hasValidationError:h,getValidationErrorForNewValue:r}}const kh=({utils:d,format:e})=>{let t=10,n=e,m=d.expandFormat(e);for(;m!==n;)if(n=m,m=d.expandFormat(n),t-=1,t<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return m},$h=({utils:d,expandedFormat:e})=>{const t=[],{start:n,end:m}=d.escapedCharacters,i=new RegExp(`(\\${n}[^\\${m}]*\\${m})+`,"g");let a=null;for(;a=i.exec(e);)t.push({start:a.index,end:i.lastIndex-1});return t},Mh=(d,e,t,n)=>{switch(t.type){case"year":return e.fieldYearPlaceholder({digitAmount:d.formatByString(d.date(void 0,"default"),n).length,format:n});case"month":return e.fieldMonthPlaceholder({contentType:t.contentType,format:n});case"day":return e.fieldDayPlaceholder({format:n});case"weekDay":return e.fieldWeekDayPlaceholder({contentType:t.contentType,format:n});case"hours":return e.fieldHoursPlaceholder({format:n});case"minutes":return e.fieldMinutesPlaceholder({format:n});case"seconds":return e.fieldSecondsPlaceholder({format:n});case"meridiem":return e.fieldMeridiemPlaceholder({format:n});default:return n}},_h=({utils:d,date:e,shouldRespectLeadingZeros:t,localeText:n,localizedDigits:m,now:i,token:a,startSeparator:p})=>{if(a==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const o=wo(d,a),h=Eo(d,o.contentType,o.type,a),r=t?h:o.contentType==="digit",s=e!=null&&d.isValid(e);let l=s?d.formatByString(e,a):"",u=null;if(r)if(h)u=l===""?d.formatByString(i,a).length:l.length;else{if(o.maxLength==null)throw new Error(`MUI X: The token ${a} should have a 'maxDigitNumber' property on it's adapter`);u=o.maxLength,s&&(l=Pr(Do(fn(l,m),u),m))}return Y({},o,{format:a,maxLength:u,value:l,placeholder:Mh(d,n,o,a),hasLeadingZerosInFormat:h,hasLeadingZerosInInput:r,startSeparator:p,endSeparator:"",modified:!1})},Ih=d=>{var u;const{utils:e,expandedFormat:t,escapedParts:n}=d,m=e.date(void 0),i=[];let a="";const p=Object.keys(e.formatTokenMap).sort((c,f)=>f.length-c.length),o=/^([a-zA-Z]+)/,h=new RegExp(`^(${p.join("|")})*$`),r=new RegExp(`^(${p.join("|")})`),s=c=>n.find(f=>f.start<=c&&f.end>=c);let l=0;for(;l<t.length;){const c=s(l),f=c!=null,g=(u=o.exec(t.slice(l)))==null?void 0:u[1];if(!f&&g!=null&&h.test(g)){let v=g;for(;v.length>0;){const b=r.exec(v)[1];v=v.slice(b.length),i.push(_h(Y({},d,{now:m,token:b,startSeparator:a}))),a=""}l+=g.length}else{const v=t[l];f&&(c==null?void 0:c.start)===l||(c==null?void 0:c.end)===l||(i.length===0?a+=v:i[i.length-1].endSeparator+=v),l+=1}}return i.length===0&&a.length>0&&i.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:a,endSeparator:"",modified:!1}),i},Lh=({isRtl:d,formatDensity:e,sections:t})=>t.map(n=>{const m=i=>{let a=i;return d&&a!==null&&a.includes(" ")&&(a=`${a}`),e==="spacious"&&["/",".","-"].includes(a)&&(a=` ${a} `),a};return n.startSeparator=m(n.startSeparator),n.endSeparator=m(n.endSeparator),n}),Cs=d=>{let e=kh(d);d.isRtl&&d.enableAccessibleFieldDOMStructure&&(e=e.split(" ").reverse().join(" "));const t=$h(Y({},d,{expandedFormat:e})),n=Ih(Y({},d,{expandedFormat:e,escapedParts:t}));return Lh(Y({},d,{sections:n}))},Fh=d=>{const e=Re(),t=lt(),n=vn(),m=Mt(),{valueManager:i,fieldValueManager:a,valueType:p,validator:o,internalProps:h,internalProps:{value:r,defaultValue:s,referenceDate:l,onChange:u,format:c,formatDensity:f="dense",selectedSections:g,onSelectedSectionsChange:v,shouldRespectLeadingZeros:b=!1,timezone:A,enableAccessibleFieldDOMStructure:x=!1}}=d,{timezone:D,value:y,handleValueChange:E}=Or({timezone:A,value:r,defaultValue:s,referenceDate:l,onChange:u,valueManager:i}),T=J.useMemo(()=>Ou(e),[e]),M=J.useMemo(()=>Wu(e,T,D),[e,T,D]),$=J.useCallback((z,j=null)=>a.getSectionsFromValue(e,z,j,Q=>Cs({utils:e,localeText:t,localizedDigits:T,format:c,date:Q,formatDensity:f,shouldRespectLeadingZeros:b,enableAccessibleFieldDOMStructure:x,isRtl:m})),[a,c,t,T,m,b,e,f,x]),[L,C]=J.useState(()=>{const z=$(y),j={sections:z,value:y,referenceValue:i.emptyValue,tempValueStrAndroid:null},Q=Iu(z),Z=i.getInitialReferenceValue({referenceDate:l,value:y,utils:e,props:h,granularity:Q,timezone:D});return Y({},j,{referenceValue:Z})}),[w,S]=pn({controlled:g,default:null,name:"useField",state:"selectedSections"}),k=z=>{S(z),v==null||v(z)},_=J.useMemo(()=>Cr(w,L.sections),[w,L.sections]),F=_==="all"?0:_,R=({value:z,referenceValue:j,sections:Q})=>{if(C(q=>Y({},q,{sections:Q,value:z,referenceValue:j,tempValueStrAndroid:null})),i.areValuesEqual(e,L.value,z))return;const Z={validationError:o({adapter:n,value:z,timezone:D,props:h})};E(z,Z)},O=(z,j)=>{const Q=[...L.sections];return Q[z]=Y({},Q[z],{value:j,modified:!0}),Q},V=()=>{R({value:i.emptyValue,referenceValue:L.referenceValue,sections:$(i.emptyValue)})},P=()=>{if(F==null)return;const z=L.sections[F],j=a.getActiveDateManager(e,L,z),Z=j.getSections(L.sections).filter(pe=>pe.value!=="").length===(z.value===""?0:1),q=O(F,""),ne=Z?null:e.getInvalidDate(),se=j.getNewValuesFromNewActiveDate(ne);R(Y({},se,{sections:q}))},H=z=>{const j=(q,ne)=>{const se=e.parse(q,c);if(se==null||!e.isValid(se))return null;const pe=Cs({utils:e,localeText:t,localizedDigits:T,format:c,date:se,formatDensity:f,shouldRespectLeadingZeros:b,enableAccessibleFieldDOMStructure:x,isRtl:m});return bs(e,se,pe,ne,!1)},Q=a.parseValueStr(z,L.referenceValue,j),Z=a.updateReferenceValue(e,Q,L.referenceValue);R({value:Q,referenceValue:Z,sections:$(Q,L.sections)})},N=({activeSection:z,newSectionValue:j,shouldGoToNextSection:Q})=>{Q&&F<L.sections.length-1&&k(F+1);const Z=a.getActiveDateManager(e,L,z),q=O(F,j),ne=Z.getSections(q),se=Nu(e,ne,T);let pe,ie;if(se!=null&&e.isValid(se)){const de=bs(e,se,ne,Z.referenceDate,!0);pe=Z.getNewValuesFromNewActiveDate(de),ie=!0}else pe=Z.getNewValuesFromNewActiveDate(se),ie=(se!=null&&!e.isValid(se))!=(Z.date!=null&&!e.isValid(Z.date));return ie?R(Y({},pe,{sections:q})):C(de=>Y({},de,pe,{sections:q,tempValueStrAndroid:null}))},W=z=>C(j=>Y({},j,{tempValueStrAndroid:z}));return J.useEffect(()=>{const z=$(L.value);C(j=>Y({},j,{sections:z}))},[c,e.locale,m]),J.useEffect(()=>{let z;i.areValuesEqual(e,L.value,y)?z=i.getTimezone(e,L.value)!==i.getTimezone(e,y):z=!0,z&&C(j=>Y({},j,{value:y,referenceValue:a.updateReferenceValue(e,y,j.referenceValue),sections:$(y)}))},[y]),{state:L,activeSectionIndex:F,parsedSelectedSections:_,setSelectedSections:k,clearValue:V,clearActiveSection:P,updateSectionValue:N,updateValueFromValueStr:H,setTempAndroidValueStr:W,getSectionsFromValue:$,sectionsValueBoundaries:M,localizedDigits:T,timezone:D}},Rh=5e3,Sn=d=>d.saveQuery!=null,Oh=({sections:d,updateSectionValue:e,sectionsValueBoundaries:t,localizedDigits:n,setTempAndroidValueStr:m,timezone:i})=>{const a=Re(),[p,o]=J.useState(null),h=be(()=>o(null));J.useEffect(()=>{var c;p!=null&&((c=d[p.sectionIndex])==null?void 0:c.type)!==p.sectionType&&h()},[d,p,h]),J.useEffect(()=>{if(p!=null){const c=setTimeout(()=>h(),Rh);return()=>{clearTimeout(c)}}return()=>{}},[p,h]);const r=({keyPressed:c,sectionIndex:f},g,v)=>{const b=c.toLowerCase(),A=d[f];if(p!=null&&(!v||v(p.value))&&p.sectionIndex===f){const D=`${p.value}${b}`,y=g(D,A);if(!Sn(y))return o({sectionIndex:f,value:D,sectionType:A.type}),y}const x=g(b,A);return Sn(x)&&!x.saveQuery?(h(),null):(o({sectionIndex:f,value:b,sectionType:A.type}),Sn(x)?null:x)},s=c=>{const f=(b,A,x)=>{const D=A.filter(y=>y.toLowerCase().startsWith(x));return D.length===0?{saveQuery:!1}:{sectionValue:D[0],shouldGoToNextSection:D.length===1}},g=(b,A,x,D)=>{const y=E=>Co(a,i,A.type,E);if(A.contentType==="letter")return f(A.format,y(A.format),b);if(x&&D!=null&&wo(a,x).contentType==="letter"){const E=y(x),T=f(x,E,b);return Sn(T)?{saveQuery:!1}:Y({},T,{sectionValue:D(T.sectionValue,E)})}return{saveQuery:!1}};return r(c,(b,A)=>{switch(A.type){case"month":{const x=D=>vs(a,D,a.formats.month,A.format);return g(b,A,a.formats.month,x)}case"weekDay":{const x=(D,y)=>y.indexOf(D).toString();return g(b,A,a.formats.weekday,x)}case"meridiem":return g(b,A);default:return{saveQuery:!1}}})},l=c=>{const f=(v,b)=>{const A=fn(v,n),x=Number(A),D=t[b.type]({currentDate:null,format:b.format,contentType:b.contentType});if(x>D.maximum)return{saveQuery:!1};if(x<D.minimum)return{saveQuery:!0};const y=x*10>D.maximum||A.length===D.maximum.toString().length;return{sectionValue:So(a,x,D,n,b),shouldGoToNextSection:y}};return r(c,(v,b)=>{if(b.contentType==="digit"||b.contentType==="digit-with-letter")return f(v,b);if(b.type==="month"){Eo(a,"digit","month","MM");const A=f(v,{type:b.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(Sn(A))return A;const x=vs(a,A.sectionValue,"MM",b.format);return Y({},A,{sectionValue:x})}if(b.type==="weekDay"){const A=f(v,b);if(Sn(A))return A;const x=Hi(a,b.format)[Number(A.sectionValue)-1];return Y({},A,{sectionValue:x})}return{saveQuery:!1}},v=>gs(v,n))};return{applyCharacterEditing:be(c=>{const f=d[c.sectionIndex],v=gs(c.keyPressed,n)?l(Y({},c,{keyPressed:Pr(c.keyPressed,n)})):s(c);if(v==null){m(null);return}e({activeSection:f,newSectionValue:v.sectionValue,shouldGoToNextSection:v.shouldGoToNextSection})}),resetCharacterQuery:h}},Ph=d=>{const{internalProps:{disabled:e,readOnly:t=!1},forwardedProps:{sectionListRef:n,onBlur:m,onClick:i,onFocus:a,onInput:p,onPaste:o,focused:h,autoFocus:r=!1},fieldValueManager:s,applyCharacterEditing:l,resetCharacterQuery:u,setSelectedSections:c,parsedSelectedSections:f,state:g,clearActiveSection:v,clearValue:b,updateSectionValue:A,updateValueFromValueStr:x,sectionOrder:D,areAllSectionsEmpty:y,sectionsValueBoundaries:E}=d,T=J.useRef(null),M=ht(n,T),$=lt(),L=Re(),C=Rn(),[w,S]=J.useState(!1),k=J.useMemo(()=>({syncSelectionToDOM:()=>{if(!T.current)return;const ie=document.getSelection();if(!ie)return;if(f==null){ie.rangeCount>0&&T.current.getRoot().contains(ie.getRangeAt(0).startContainer)&&ie.removeAllRanges(),w&&T.current.getRoot().blur();return}if(!T.current.getRoot().contains(ct(document)))return;const de=new window.Range;let ue;f==="all"?ue=T.current.getRoot():g.sections[f].type==="empty"?ue=T.current.getSectionContainer(f):ue=T.current.getSectionContent(f),de.selectNodeContents(ue),ue.focus(),ie.removeAllRanges(),ie.addRange(de)},getActiveSectionIndexFromDOM:()=>{const ie=ct(document);return!ie||!T.current||!T.current.getRoot().contains(ie)?null:T.current.getSectionIndexFromDOMElement(ie)},focusField:(ie=0)=>{if(!T.current||k.getActiveSectionIndexFromDOM()!=null)return;const de=Cr(ie,g.sections);S(!0),T.current.getSectionContent(de).focus()},setSelectedSections:ie=>{if(!T.current)return;const de=Cr(ie,g.sections);S((de==="all"?0:de)!==null),c(ie)},isFieldFocused:()=>{const ie=ct(document);return!!T.current&&T.current.getRoot().contains(ie)}}),[f,c,g.sections,w]),_=be(ie=>{if(!T.current)return;const de=g.sections[ie];T.current.getSectionContent(ie).innerHTML=de.value||de.placeholder,k.syncSelectionToDOM()}),F=be((ie,...de)=>{ie.isDefaultPrevented()||!T.current||(S(!0),i==null||i(ie,...de),f==="all"?setTimeout(()=>{const ue=document.getSelection().getRangeAt(0).startOffset;if(ue===0){c(D.startIndex);return}let le=0,ae=0;for(;ae<ue&&le<g.sections.length;){const fe=g.sections[le];le+=1,ae+=`${fe.startSeparator}${fe.value||fe.placeholder}${fe.endSeparator}`.length}c(le-1)}):w?T.current.getRoot().contains(ie.target)||c(D.startIndex):(S(!0),c(D.startIndex)))}),R=be(ie=>{if(p==null||p(ie),!T.current||f!=="all")return;const ue=ie.target.textContent??"";T.current.getRoot().innerHTML=g.sections.map(le=>`${le.startSeparator}${le.value||le.placeholder}${le.endSeparator}`).join(""),k.syncSelectionToDOM(),ue.length===0||ue.charCodeAt(0)===10?(u(),b(),c("all")):ue.length>1?x(ue):(f==="all"&&c(0),l({keyPressed:ue,sectionIndex:0}))}),O=be(ie=>{if(o==null||o(ie),t||f!=="all"){ie.preventDefault();return}const de=ie.clipboardData.getData("text");ie.preventDefault(),u(),x(de)}),V=be((...ie)=>{if(a==null||a(...ie),w||!T.current)return;S(!0),T.current.getSectionIndexFromDOMElement(ct(document))!=null||c(D.startIndex)}),P=be((...ie)=>{m==null||m(...ie),setTimeout(()=>{if(!T.current)return;const de=ct(document);!T.current.getRoot().contains(de)&&(S(!1),c(null))})}),H=be(ie=>de=>{de.isDefaultPrevented()||c(ie)}),N=be(ie=>{ie.preventDefault()}),W=be(ie=>()=>{c(ie)}),z=be(ie=>{if(ie.preventDefault(),t||e||typeof f!="number")return;const de=g.sections[f],ue=ie.clipboardData.getData("text"),le=/^[a-zA-Z]+$/.test(ue),ae=/^[0-9]+$/.test(ue),fe=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(ue);de.contentType==="letter"&&le||de.contentType==="digit"&&ae||de.contentType==="digit-with-letter"&&fe?(u(),A({activeSection:de,newSectionValue:ue,shouldGoToNextSection:!0})):!le&&!ae&&(u(),x(ue))}),j=be(ie=>{ie.preventDefault(),ie.dataTransfer.dropEffect="none"}),Q=be(ie=>{if(!T.current)return;const de=ie.target,ue=de.textContent??"",le=T.current.getSectionIndexFromDOMElement(de),ae=g.sections[le];if(t||!T.current){_(le);return}if(ue.length===0){if(ae.value===""){_(le);return}const fe=ie.nativeEvent.inputType;if(fe==="insertParagraph"||fe==="insertLineBreak"){_(le);return}u(),v();return}l({keyPressed:ue,sectionIndex:le}),_(le)});Ht(()=>{if(!(!w||!T.current)){if(f==="all")T.current.getRoot().focus();else if(typeof f=="number"){const ie=T.current.getSectionContent(f);ie&&ie.focus()}}},[f,w]);const Z=J.useMemo(()=>g.sections.reduce((ie,de)=>(ie[de.type]=E[de.type]({currentDate:null,contentType:de.contentType,format:de.format}),ie),{}),[E,g.sections]),q=f==="all",ne=J.useMemo(()=>g.sections.map((ie,de)=>{const ue=!q&&!e&&!t;return{container:{"data-sectionindex":de,onClick:H(de)},content:{tabIndex:q||de>0?-1:0,contentEditable:!q&&!e&&!t,role:"spinbutton",id:`${C}-${ie.type}`,"aria-labelledby":`${C}-${ie.type}`,"aria-readonly":t,"aria-valuenow":Gu(ie,L),"aria-valuemin":Z[ie.type].minimum,"aria-valuemax":Z[ie.type].maximum,"aria-valuetext":ie.value?Uu(ie,L):$.empty,"aria-label":$[ie.type],"aria-disabled":e,spellCheck:ue?!1:void 0,autoCapitalize:ue?"off":void 0,autoCorrect:ue?"off":void 0,[parseInt(J.version,10)>=17?"enterKeyHint":"enterkeyhint"]:ue?"next":void 0,children:ie.value||ie.placeholder,onInput:Q,onPaste:z,onFocus:W(de),onDragOver:j,onMouseUp:N,inputMode:ie.contentType==="letter"?"text":"numeric"},before:{children:ie.startSeparator},after:{children:ie.endSeparator}}}),[g.sections,W,z,j,Q,H,N,e,t,q,$,L,Z,C]),se=be(ie=>{x(ie.target.value)}),pe=J.useMemo(()=>y?"":s.getV7HiddenInputValueFromSections(g.sections),[y,g.sections,s]);return J.useEffect(()=>{if(T.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.","","If you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","<DatePicker slots={{ textField: MyCustomTextField }} />","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(`
|
|
20
|
+
`));r&&T.current&&T.current.getSectionContent(D.startIndex).focus()},[]),{interactions:k,returnedValue:{autoFocus:r,readOnly:t,focused:h??w,sectionListRef:M,onBlur:P,onClick:F,onFocus:V,onInput:R,onPaste:O,enableAccessibleFieldDOMStructure:!0,elements:ne,tabIndex:f===0?-1:0,contentEditable:q,value:pe,onChange:se,areAllSectionsEmpty:y}}},kn=d=>d.replace(/[\u2066\u2067\u2068\u2069]/g,""),Nh=(d,e,t)=>{let n=0,m=t?1:0;const i=[];for(let a=0;a<d.length;a+=1){const p=d[a],o=Nr(p,t?"input-rtl":"input-ltr",e),h=`${p.startSeparator}${o}${p.endSeparator}`,r=kn(h).length,s=h.length,l=kn(o),u=m+(l===""?0:o.indexOf(l[0]))+p.startSeparator.length,c=u+l.length;i.push(Y({},p,{start:n,end:n+r,startInInput:u,endInInput:c})),n+=r,m+=s}return i},Bh=d=>{const e=Mt(),t=J.useRef(void 0),n=J.useRef(void 0),{forwardedProps:{onFocus:m,onClick:i,onPaste:a,onBlur:p,inputRef:o,placeholder:h},internalProps:{readOnly:r=!1,disabled:s=!1},parsedSelectedSections:l,activeSectionIndex:u,state:c,fieldValueManager:f,valueManager:g,applyCharacterEditing:v,resetCharacterQuery:b,updateSectionValue:A,updateValueFromValueStr:x,clearActiveSection:D,clearValue:y,setTempAndroidValueStr:E,setSelectedSections:T,getSectionsFromValue:M,areAllSectionsEmpty:$,localizedDigits:L}=d,C=J.useRef(null),w=ht(o,C),S=J.useMemo(()=>Nh(c.sections,L,e),[c.sections,L,e]),k=J.useMemo(()=>({syncSelectionToDOM:()=>{if(!C.current)return;if(l==null){C.current.scrollLeft&&(C.current.scrollLeft=0);return}if(C.current!==ct(document))return;const Q=C.current.scrollTop;if(l==="all")C.current.select();else{const Z=S[l],q=Z.type==="empty"?Z.startInInput-Z.startSeparator.length:Z.startInInput,ne=Z.type==="empty"?Z.endInInput+Z.endSeparator.length:Z.endInInput;(q!==C.current.selectionStart||ne!==C.current.selectionEnd)&&C.current===ct(document)&&C.current.setSelectionRange(q,ne),clearTimeout(n.current),n.current=setTimeout(()=>{C.current&&C.current===ct(document)&&C.current.selectionStart===C.current.selectionEnd&&(C.current.selectionStart!==q||C.current.selectionEnd!==ne)&&k.syncSelectionToDOM()})}C.current.scrollTop=Q},getActiveSectionIndexFromDOM:()=>{const Q=C.current.selectionStart??0,Z=C.current.selectionEnd??0;if(Q===0&&Z===0)return null;const q=Q<=S[0].startInInput?1:S.findIndex(ne=>ne.startInInput-ne.startSeparator.length>Q);return q===-1?S.length-1:q-1},focusField:(Q=0)=>{var Z;ct(document)!==C.current&&((Z=C.current)==null||Z.focus(),T(Q))},setSelectedSections:Q=>T(Q),isFieldFocused:()=>C.current===ct(document)}),[C,l,S,T]),_=()=>{const Q=C.current.selectionStart??0;let Z;Q<=S[0].startInInput||Q>=S[S.length-1].endInInput?Z=1:Z=S.findIndex(ne=>ne.startInInput-ne.startSeparator.length>Q);const q=Z===-1?S.length-1:Z-1;T(q)},F=be((...Q)=>{m==null||m(...Q);const Z=C.current;clearTimeout(t.current),t.current=setTimeout(()=>{!Z||Z!==C.current||u==null&&(Z.value.length&&Number(Z.selectionEnd)-Number(Z.selectionStart)===Z.value.length?T("all"):_())})}),R=be((Q,...Z)=>{Q.isDefaultPrevented()||(i==null||i(Q,...Z),_())}),O=be(Q=>{if(a==null||a(Q),Q.preventDefault(),r||s)return;const Z=Q.clipboardData.getData("text");if(typeof l=="number"){const q=c.sections[l],ne=/^[a-zA-Z]+$/.test(Z),se=/^[0-9]+$/.test(Z),pe=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(Z);if(q.contentType==="letter"&&ne||q.contentType==="digit"&&se||q.contentType==="digit-with-letter"&&pe){b(),A({activeSection:q,newSectionValue:Z,shouldGoToNextSection:!0});return}if(ne||se)return}b(),x(Z)}),V=be((...Q)=>{p==null||p(...Q),T(null)}),P=be(Q=>{if(r)return;const Z=Q.target.value;if(Z===""){b(),y();return}const q=Q.nativeEvent.data,ne=q&&q.length>1,se=ne?q:Z,pe=kn(se);if(l==="all"&&T(u),u==null||ne){x(ne?q:pe);return}let ie;if(l==="all"&&pe.length===1)ie=pe;else{const de=kn(f.getV6InputValueFromSections(S,L,e));let ue=-1,le=-1;for(let ve=0;ve<de.length;ve+=1)ue===-1&&de[ve]!==pe[ve]&&(ue=ve),le===-1&&de[de.length-ve-1]!==pe[pe.length-ve-1]&&(le=ve);const ae=S[u];if(ue<ae.start||de.length-le-1>ae.end)return;const me=pe.length-de.length+ae.end-kn(ae.endSeparator||"").length;ie=pe.slice(ae.start+kn(ae.startSeparator||"").length,me)}if(ie.length===0){ju()&&E(se),b(),D();return}v({keyPressed:ie,sectionIndex:u})}),H=J.useMemo(()=>h!==void 0?h:f.getV6InputValueFromSections(M(g.emptyValue),L,e),[h,f,M,g.emptyValue,L,e]),N=J.useMemo(()=>c.tempValueStrAndroid??f.getV6InputValueFromSections(c.sections,L,e),[c.sections,f,c.tempValueStrAndroid,L,e]);J.useEffect(()=>(C.current&&C.current===ct(document)&&T("all"),()=>{clearTimeout(t.current),clearTimeout(n.current)}),[]);const W=J.useMemo(()=>u==null||c.sections[u].contentType==="letter"?"text":"numeric",[u,c.sections]),j=!(C.current&&C.current===ct(document))&&$;return{interactions:k,returnedValue:{readOnly:r,onBlur:V,onClick:R,onFocus:F,onPaste:O,inputRef:w,enableAccessibleFieldDOMStructure:!1,placeholder:H,inputMode:W,autoComplete:"off",value:j?"":N,onChange:P}}},Io=d=>{const e=Re(),{internalProps:t,internalProps:{unstableFieldRef:n,minutesStep:m,enableAccessibleFieldDOMStructure:i=!1,disabled:a=!1,readOnly:p=!1},forwardedProps:{onKeyDown:o,error:h,clearable:r,onClear:s},fieldValueManager:l,valueManager:u,validator:c}=d,f=Mt(),g=Fh(d),{state:v,activeSectionIndex:b,parsedSelectedSections:A,setSelectedSections:x,clearValue:D,clearActiveSection:y,updateSectionValue:E,setTempAndroidValueStr:T,sectionsValueBoundaries:M,localizedDigits:$,timezone:L}=g,C=Oh({sections:v.sections,updateSectionValue:E,sectionsValueBoundaries:M,localizedDigits:$,setTempAndroidValueStr:T,timezone:L}),{resetCharacterQuery:w}=C,S=u.areValuesEqual(e,v.value,u.emptyValue),k=i?Ph:Bh,_=J.useMemo(()=>zu(v.sections,f&&!i),[v.sections,f,i]),{returnedValue:F,interactions:R}=k(Y({},d,g,C,{areAllSectionsEmpty:S,sectionOrder:_})),O=be(z=>{if(o==null||o(z),!a)switch(!0){case((z.ctrlKey||z.metaKey)&&String.fromCharCode(z.keyCode)==="A"&&!z.shiftKey&&!z.altKey):{z.preventDefault(),x("all");break}case z.key==="ArrowRight":{if(z.preventDefault(),A==null)x(_.startIndex);else if(A==="all")x(_.endIndex);else{const j=_.neighbors[A].rightIndex;j!==null&&x(j)}break}case z.key==="ArrowLeft":{if(z.preventDefault(),A==null)x(_.endIndex);else if(A==="all")x(_.startIndex);else{const j=_.neighbors[A].leftIndex;j!==null&&x(j)}break}case z.key==="Delete":{if(z.preventDefault(),p)break;A==null||A==="all"?D():y(),w();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(z.key):{if(z.preventDefault(),p||b==null)break;A==="all"&&x(b);const j=v.sections[b],Q=l.getActiveDateManager(e,v,j),Z=Pu(e,L,j,z.key,M,$,Q.date,{minutesStep:m});E({activeSection:j,newSectionValue:Z,shouldGoToNextSection:!1});break}}});Ht(()=>{R.syncSelectionToDOM()});const{hasValidationError:V}=_o({props:t,validator:c,timezone:L,value:v.value,onError:t.onError}),P=J.useMemo(()=>h!==void 0?h:V,[V,h]);J.useEffect(()=>{!P&&b==null&&w()},[v.referenceValue,b,P]),J.useEffect(()=>{v.tempValueStrAndroid!=null&&b!=null&&(w(),y())},[v.sections]),J.useImperativeHandle(n,()=>({getSections:()=>v.sections,getActiveSectionIndex:R.getActiveSectionIndexFromDOM,setSelectedSections:R.setSelectedSections,focusField:R.focusField,isFieldFocused:R.isFieldFocused}));const H=be((z,...j)=>{z.preventDefault(),s==null||s(z,...j),D(),R.isFieldFocused()?x(_.startIndex):R.focusField(0)}),N={onKeyDown:O,onClear:H,error:P,clearable:!!(r&&!S&&!p&&!a)},W={disabled:a,readOnly:p};return Y({},d.forwardedProps,N,W,F)},Vh=["clearable","onClear","InputProps","sx","slots","slotProps"],Wh=["ownerState"],Lo=d=>{const e=lt(),{clearable:t,onClear:n,InputProps:m,sx:i,slots:a,slotProps:p}=d,o=Se(d,Vh),h=(a==null?void 0:a.clearButton)??Fn,r=Ne({elementType:h,externalSlotProps:p==null?void 0:p.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:e.fieldClearLabel}}),s=Se(r,Wh),l=(a==null?void 0:a.clearIcon)??Vc,u=Ne({elementType:l,externalSlotProps:p==null?void 0:p.clearIcon,ownerState:{}});return Y({},o,{InputProps:Y({},m,{endAdornment:ee.jsxs(J.Fragment,{children:[t&&ee.jsx(no,{position:"end",sx:{marginRight:m!=null&&m.endAdornment?-1:-1.5},children:ee.jsx(h,Y({},s,{onClick:n,children:ee.jsx(l,Y({fontSize:"small"},u))}))}),m==null?void 0:m.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(i)?i:[i]]})},Hh=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],Fo=(d,e)=>J.useMemo(()=>{const t=Y({},d),n={},m=i=>{t.hasOwnProperty(i)&&(n[i]=t[i],delete t[i])};return Hh.forEach(m),e==="date"?Dr.forEach(m):e==="time"?Sr.forEach(m):e==="date-time"&&(Dr.forEach(m),Sr.forEach(m),Mo.forEach(m)),{forwardedProps:t,internalProps:n}},[d,e]),jh=J.createContext(null);function Ro(d){const{contextValue:e,localeText:t,children:n}=d;return ee.jsx(jh.Provider,{value:e,children:ee.jsx(Ic,{localeText:t,children:n})})}const zh=d=>{const e=Re(),t=oi();return Y({},d,{disablePast:d.disablePast??!1,disableFuture:d.disableFuture??!1,format:d.format??e.formats.keyboardDate,minDate:Dt(e,d.minDate,t.minDate),maxDate:Dt(e,d.maxDate,t.maxDate)})},Uh=d=>{const e=Re(),n=d.ampm??e.is12HourCycleInCurrentLocale()?e.formats.fullTime12h:e.formats.fullTime24h;return Y({},d,{disablePast:d.disablePast??!1,disableFuture:d.disableFuture??!1,format:d.format??n})},Gh=d=>{const e=zh(d),{forwardedProps:t,internalProps:n}=Fo(e,"date");return Io({forwardedProps:t,internalProps:n,valueManager:st,fieldValueManager:Ao,validator:ci,valueType:"date"})};function Kh(d){return We("MuiPickersTextField",d)}He("MuiPickersTextField",["root","focused","disabled","error","required"]);function Yh(d){return We("MuiPickersInputBase",d)}const $n=He("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function Jh(d){return We("MuiPickersSectionList",d)}const Un=He("MuiPickersSectionList",["root","section","sectionContent"]),Qh=["slots","slotProps","elements","sectionListRef"],Oo=ge("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(d,e)=>e.root})({direction:"ltr /*! @noflip */",outline:"none"}),Po=ge("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(d,e)=>e.section})({}),No=ge("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(d,e)=>e.sectionSeparator})({whiteSpace:"pre"}),Bo=ge("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(d,e)=>e.sectionContent})({outline:"none"}),Zh=d=>{const{classes:e}=d;return Oe({root:["root"],section:["section"],sectionContent:["sectionContent"]},Jh,e)};function Xh(d){const{slots:e,slotProps:t,element:n,classes:m}=d,i=(e==null?void 0:e.section)??Po,a=Ne({elementType:i,externalSlotProps:t==null?void 0:t.section,externalForwardedProps:n.container,className:m.section,ownerState:{}}),p=(e==null?void 0:e.sectionContent)??Bo,o=Ne({elementType:p,externalSlotProps:t==null?void 0:t.sectionContent,externalForwardedProps:n.content,additionalProps:{suppressContentEditableWarning:!0},className:m.sectionContent,ownerState:{}}),h=(e==null?void 0:e.sectionSeparator)??No,r=Ne({elementType:h,externalSlotProps:t==null?void 0:t.sectionSeparator,externalForwardedProps:n.before,ownerState:{position:"before"}}),s=Ne({elementType:h,externalSlotProps:t==null?void 0:t.sectionSeparator,externalForwardedProps:n.after,ownerState:{position:"after"}});return ee.jsxs(i,Y({},a,{children:[ee.jsx(h,Y({},r)),ee.jsx(p,Y({},o)),ee.jsx(h,Y({},s))]}))}const qh=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiPickersSectionList"}),{slots:m,slotProps:i,elements:a,sectionListRef:p}=n,o=Se(n,Qh),h=Zh(n),r=J.useRef(null),s=ht(t,r),l=f=>{if(!r.current)throw new Error(`MUI X: Cannot call sectionListRef.${f} before the mount of the component.`);return r.current};J.useImperativeHandle(p,()=>({getRoot(){return l("getRoot")},getSectionContainer(f){return l("getSectionContainer").querySelector(`.${Un.section}[data-sectionindex="${f}"]`)},getSectionContent(f){return l("getSectionContent").querySelector(`.${Un.section}[data-sectionindex="${f}"] .${Un.sectionContent}`)},getSectionIndexFromDOMElement(f){const g=l("getSectionIndexFromDOMElement");if(f==null||!g.contains(f))return null;let v=null;return f.classList.contains(Un.section)?v=f:f.classList.contains(Un.sectionContent)&&(v=f.parentElement),v==null?null:Number(v.dataset.sectionindex)}}));const u=(m==null?void 0:m.root)??Oo,c=Ne({elementType:u,externalSlotProps:i==null?void 0:i.root,externalForwardedProps:o,additionalProps:{ref:s,suppressContentEditableWarning:!0},className:h.root,ownerState:{}});return ee.jsx(u,Y({},c,{children:c.contentEditable?a.map(({content:f,before:g,after:v})=>`${g.children}${f.children}${v.children}`).join(""):ee.jsx(J.Fragment,{children:a.map((f,g)=>ee.jsx(Xh,{slots:m,slotProps:i,element:f,classes:h},g))})}))}),ed=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],td=d=>Math.round(d*1e5)/1e5,Ui=ge("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(d,e)=>e.root})(({theme:d})=>Y({},d.typography.body1,{color:(d.vars||d).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${td(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),Vr=ge(Oo,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(d,e)=>e.sectionsContainer})(({theme:d})=>({padding:"4px 0 5px",fontFamily:d.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:e,focused:t,filled:n,label:m})=>!e&&!t&&!n&&m==null,style:d.vars?{opacity:d.vars.opacity.inputPlaceholder}:{opacity:d.palette.mode==="light"?.42:.5}}]})),nd=ge(Po,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(d,e)=>e.section})(({theme:d})=>({fontFamily:d.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),id=ge(Bo,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(d,e)=>e.content})(({theme:d})=>({fontFamily:d.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),rd=ge(No,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(d,e)=>e.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),sd=ge("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(d,e)=>e.hiddenInput})(Y({},Tl)),od=d=>{const{focused:e,disabled:t,error:n,classes:m,fullWidth:i,readOnly:a,color:p,size:o,endAdornment:h,startAdornment:r}=d,s={root:["root",e&&!t&&"focused",t&&"disabled",a&&"readOnly",n&&"error",i&&"fullWidth",`color${Hl(p)}`,o==="small"&&"inputSizeSmall",!!r&&"adornedStart",!!h&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return Oe(s,Yh,m)},Wr=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiPickersInputBase"}),{elements:m,areAllSectionsEmpty:i,value:a,onChange:p,id:o,endAdornment:h,startAdornment:r,renderSuffix:s,slots:l,slotProps:u,contentEditable:c,tabIndex:f,onInput:g,onPaste:v,onKeyDown:b,name:A,readOnly:x,inputProps:D,inputRef:y,sectionListRef:E}=n,T=Se(n,ed),M=J.useRef(null),$=ht(t,M),L=ht(D==null?void 0:D.ref,y),C=Mt(),w=Fi();if(!w)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const S=V=>{var P;if(w.disabled){V.stopPropagation();return}(P=w.onFocus)==null||P.call(w,V)};J.useEffect(()=>{w&&w.setAdornedStart(!!r)},[w,r]),J.useEffect(()=>{w&&(i?w.onEmpty():w.onFilled())},[w,i]);const k=Y({},n,w,{isRtl:C}),_=od(k),F=(l==null?void 0:l.root)||Ui,R=Ne({elementType:F,externalSlotProps:u==null?void 0:u.root,externalForwardedProps:T,additionalProps:{"aria-invalid":w.error,ref:$},className:_.root,ownerState:k}),O=(l==null?void 0:l.input)||Vr;return ee.jsxs(F,Y({},R,{children:[r,ee.jsx(qh,{sectionListRef:E,elements:m,contentEditable:c,tabIndex:f,className:_.sectionsContainer,onFocus:S,onBlur:w.onBlur,onInput:g,onPaste:v,onKeyDown:b,slots:{root:O,section:nd,sectionContent:id,sectionSeparator:rd},slotProps:{root:{ownerState:k},sectionContent:{className:$n.sectionContent},sectionSeparator:({position:V})=>({className:V==="before"?$n.sectionBefore:$n.sectionAfter})}}),h,s?s(Y({},w)):null,ee.jsx(sd,Y({name:A,className:_.input,value:a,onChange:p,id:o,"aria-hidden":"true",tabIndex:-1,readOnly:x,required:w.required,disabled:w.disabled},D,{ref:L}))]}))});function ad(d){return We("MuiPickersOutlinedInput",d)}const Et=Y({},$n,He("MuiPickersOutlinedInput",["root","notchedOutline","input"])),ld=["children","className","label","notched","shrink"],cd=ge("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(d,e)=>e.notchedOutline})(({theme:d})=>{const e=d.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:d.vars?`rgba(${d.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),Ds=ge("span")(({theme:d})=>({fontFamily:d.typography.fontFamily,fontSize:"inherit"})),ud=ge("legend")(({theme:d})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:d.transitions.create("width",{duration:150,easing:d.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:d.transitions.create("max-width",{duration:50,easing:d.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:d.transitions.create("max-width",{duration:100,easing:d.transitions.easing.easeOut,delay:50})}}]}));function hd(d){const{className:e,label:t}=d,n=Se(d,ld),m=t!=null&&t!=="",i=Y({},d,{withLabel:m});return ee.jsx(cd,Y({"aria-hidden":!0,className:e},n,{ownerState:i,children:ee.jsx(ud,{ownerState:i,children:m?ee.jsx(Ds,{children:t}):ee.jsx(Ds,{className:"notranslate",children:""})})}))}const dd=["label","autoFocus","ownerState","notched"],pd=ge(Ui,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(d,e)=>e.root})(({theme:d})=>{const e=d.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(d.vars||d).shape.borderRadius,[`&:hover .${Et.notchedOutline}`]:{borderColor:(d.vars||d).palette.text.primary},"@media (hover: none)":{[`&:hover .${Et.notchedOutline}`]:{borderColor:d.vars?`rgba(${d.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${Et.focused} .${Et.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Et.disabled}`]:{[`& .${Et.notchedOutline}`]:{borderColor:(d.vars||d).palette.action.disabled},"*":{color:(d.vars||d).palette.action.disabled}},[`&.${Et.error} .${Et.notchedOutline}`]:{borderColor:(d.vars||d).palette.error.main},variants:Object.keys((d.vars??d).palette).filter(t=>{var n;return((n=(d.vars??d).palette[t])==null?void 0:n.main)??!1}).map(t=>({props:{color:t},style:{[`&.${Et.focused}:not(.${Et.error}) .${Et.notchedOutline}`]:{borderColor:(d.vars||d).palette[t].main}}}))}}),fd=ge(Vr,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(d,e)=>e.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),md=d=>{const{classes:e}=d,n=Oe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},ad,e);return Y({},e,n)},Vo=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiPickersOutlinedInput"}),{label:m,ownerState:i,notched:a}=n,p=Se(n,dd),o=Fi(),h=Y({},n,i,o,{color:(o==null?void 0:o.color)||"primary"}),r=md(h);return ee.jsx(Wr,Y({slots:{root:pd,input:fd},renderSuffix:s=>ee.jsx(hd,{shrink:!!(a||s.adornedStart||s.focused||s.filled),notched:!!(a||s.adornedStart||s.focused||s.filled),className:r.notchedOutline,label:m!=null&&m!==""&&(o!=null&&o.required)?ee.jsxs(J.Fragment,{children:[m," ","*"]}):m,ownerState:h})},p,{label:m,classes:r,ref:t}))});Vo.muiName="Input";function gd(d){return We("MuiPickersFilledInput",d)}const cn=Y({},$n,He("MuiPickersFilledInput",["root","underline","input"])),vd=["label","autoFocus","disableUnderline","ownerState"],yd=ge(Ui,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(d,e)=>e.root,shouldForwardProp:d=>jl(d)&&d!=="disableUnderline"})(({theme:d})=>{const e=d.palette.mode==="light",t=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",n=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",m=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:d.vars?d.vars.palette.FilledInput.bg:n,borderTopLeftRadius:(d.vars||d).shape.borderRadius,borderTopRightRadius:(d.vars||d).shape.borderRadius,transition:d.transitions.create("background-color",{duration:d.transitions.duration.shorter,easing:d.transitions.easing.easeOut}),"&:hover":{backgroundColor:d.vars?d.vars.palette.FilledInput.hoverBg:m,"@media (hover: none)":{backgroundColor:d.vars?d.vars.palette.FilledInput.bg:n}},[`&.${cn.focused}`]:{backgroundColor:d.vars?d.vars.palette.FilledInput.bg:n},[`&.${cn.disabled}`]:{backgroundColor:d.vars?d.vars.palette.FilledInput.disabledBg:i},variants:[...Object.keys((d.vars??d).palette).filter(a=>(d.vars??d).palette[a].main).map(a=>{var p;return{props:{color:a,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(p=(d.vars||d).palette[a])==null?void 0:p.main}`}}}}),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:d.transitions.create("transform",{duration:d.transitions.duration.shorter,easing:d.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${cn.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${cn.error}`]:{"&:before, &:after":{borderBottomColor:(d.vars||d).palette.error.main}},"&::before":{borderBottom:`1px solid ${d.vars?`rgba(${d.vars.palette.common.onBackgroundChannel} / ${d.vars.opacity.inputUnderline})`:t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:d.transitions.create("border-bottom-color",{duration:d.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${cn.disabled}, .${cn.error}):before`]:{borderBottom:`1px solid ${(d.vars||d).palette.text.primary}`},[`&.${cn.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:a})=>!!a,style:{paddingLeft:12}},{props:({endAdornment:a})=>!!a,style:{paddingRight:12}}]}}),bd=ge(Vr,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(d,e)=>e.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:d})=>!!d,style:{paddingLeft:0}},{props:({endAdornment:d})=>!!d,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),wd=d=>{const{classes:e,disableUnderline:t}=d,m=Oe({root:["root",!t&&"underline"],input:["input"]},gd,e);return Y({},e,m)},Wo=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiPickersFilledInput"}),{label:m,disableUnderline:i=!1,ownerState:a}=n,p=Se(n,vd),o=Fi(),h=Y({},n,a,o,{color:(o==null?void 0:o.color)||"primary"}),r=wd(h);return ee.jsx(Wr,Y({slots:{root:yd,input:bd},slotProps:{root:{disableUnderline:i}}},p,{label:m,classes:r,ref:t}))});Wo.muiName="Input";function Cd(d){return We("MuiPickersFilledInput",d)}const Gn=Y({},$n,He("MuiPickersInput",["root","input"])),Dd=["label","autoFocus","disableUnderline","ownerState"],Sd=ge(Ui,{name:"MuiPickersInput",slot:"Root",overridesResolver:(d,e)=>e.root})(({theme:d})=>{let t=d.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return d.vars&&(t=`rgba(${d.vars.palette.common.onBackgroundChannel} / ${d.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((d.vars??d).palette).filter(n=>(d.vars??d).palette[n].main).map(n=>({props:{color:n},style:{"&::after":{borderBottom:`2px solid ${(d.vars||d).palette[n].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:d.transitions.create("transform",{duration:d.transitions.duration.shorter,easing:d.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Gn.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Gn.error}`]:{"&:before, &:after":{borderBottomColor:(d.vars||d).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:d.transitions.create("border-bottom-color",{duration:d.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Gn.disabled}, .${Gn.error}):before`]:{borderBottom:`2px solid ${(d.vars||d).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${Gn.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),xd=d=>{const{classes:e,disableUnderline:t}=d,m=Oe({root:["root",!t&&"underline"],input:["input"]},Cd,e);return Y({},e,m)},Ho=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiPickersInput"}),{label:m,disableUnderline:i=!1,ownerState:a}=n,p=Se(n,Dd),o=Fi(),h=Y({},n,a,o,{disableUnderline:i,color:(o==null?void 0:o.color)||"primary"}),r=xd(h);return ee.jsx(Wr,Y({slots:{root:Sd}},p,{label:m,classes:r,ref:t}))});Ho.muiName="Input";const Ed=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],Ad={standard:Ho,filled:Wo,outlined:Vo},Td=ge(Ml,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(d,e)=>e.root})({}),kd=d=>{const{focused:e,disabled:t,classes:n,required:m}=d;return Oe({root:["root",e&&!t&&"focused",t&&"disabled",m&&"required"]},Kh,n)},jo=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiPickersTextField"}),{onFocus:m,onBlur:i,className:a,color:p="primary",disabled:o=!1,error:h=!1,variant:r="outlined",required:s=!1,InputProps:l,inputProps:u,inputRef:c,sectionListRef:f,elements:g,areAllSectionsEmpty:v,onClick:b,onKeyDown:A,onKeyUp:x,onPaste:D,onInput:y,endAdornment:E,startAdornment:T,tabIndex:M,contentEditable:$,focused:L,value:C,onChange:w,fullWidth:S,id:k,name:_,helperText:F,FormHelperTextProps:R,label:O,InputLabelProps:V}=n,P=Se(n,Ed),H=J.useRef(null),N=ht(t,H),W=Rn(k),z=F&&W?`${W}-helper-text`:void 0,j=O&&W?`${W}-label`:void 0,Q=Y({},n,{color:p,disabled:o,error:h,focused:L,required:s,variant:r}),Z=kd(Q),q=Ad[r];return ee.jsxs(Td,Y({className:je(Z.root,a),ref:N,focused:L,onFocus:m,onBlur:i,disabled:o,variant:r,error:h,color:p,fullWidth:S,required:s,ownerState:Q},P,{children:[ee.jsx(kl,Y({htmlFor:W,id:j},V,{children:O})),ee.jsx(q,Y({elements:g,areAllSectionsEmpty:v,onClick:b,onKeyDown:A,onKeyUp:x,onInput:y,onPaste:D,endAdornment:E,startAdornment:T,tabIndex:M,contentEditable:$,value:C,onChange:w,id:W,fullWidth:S,inputProps:u,inputRef:c,sectionListRef:f,label:O,name:_,role:"group","aria-labelledby":j,"aria-describedby":z,"aria-live":z?"polite":void 0},l)),F&&ee.jsx($l,Y({id:z},R,{children:F}))]}))}),$d=["enableAccessibleFieldDOMStructure"],Md=["InputProps","readOnly"],_d=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],zo=d=>{let{enableAccessibleFieldDOMStructure:e}=d,t=Se(d,$d);if(e){const{InputProps:s,readOnly:l}=t,u=Se(t,Md);return Y({},u,{InputProps:Y({},s??{},{readOnly:l})})}const{onPaste:n,onKeyDown:m,inputMode:i,readOnly:a,InputProps:p,inputProps:o,inputRef:h}=t,r=Se(t,_d);return Y({},r,{InputProps:Y({},p??{},{readOnly:a}),inputProps:Y({},o??{},{inputMode:i,onPaste:n,onKeyDown:m,ref:h})})},Id=["slots","slotProps","InputProps","inputProps"],Uo=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiDateField"}),{slots:m,slotProps:i,InputProps:a,inputProps:p}=n,o=Se(n,Id),h=n,r=(m==null?void 0:m.textField)??(e.enableAccessibleFieldDOMStructure?jo:io),s=Ne({elementType:r,externalSlotProps:i==null?void 0:i.textField,externalForwardedProps:o,additionalProps:{ref:t},ownerState:h});s.inputProps=Y({},p,s.inputProps),s.InputProps=Y({},a,s.InputProps);const l=Gh(s),u=zo(l),c=Lo(Y({},u,{slots:m,slotProps:i}));return ee.jsx(r,Y({},c))}),Ld=d=>{const e=Uh(d),{forwardedProps:t,internalProps:n}=Fo(e,"time");return Io({forwardedProps:t,internalProps:n,valueManager:st,fieldValueManager:Ao,validator:ji,valueType:"time"})},Fd=["slots","slotProps","InputProps","inputProps"],Go=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiTimeField"}),{slots:m,slotProps:i,InputProps:a,inputProps:p}=n,o=Se(n,Fd),h=n,r=(m==null?void 0:m.textField)??(e.enableAccessibleFieldDOMStructure?jo:io),s=Ne({elementType:r,externalSlotProps:i==null?void 0:i.textField,externalForwardedProps:o,ownerState:h,additionalProps:{ref:t}});s.inputProps=Y({},p,s.inputProps),s.InputProps=Y({},a,s.InputProps);const l=Ld(s),u=zo(l),c=Lo(Y({},u,{slots:m,slotProps:i}));return ee.jsx(r,Y({},c))}),Ko=({shouldDisableDate:d,shouldDisableMonth:e,shouldDisableYear:t,minDate:n,maxDate:m,disableFuture:i,disablePast:a,timezone:p})=>{const o=vn();return J.useCallback(h=>ci({adapter:o,value:h,timezone:p,props:{shouldDisableDate:d,shouldDisableMonth:e,shouldDisableYear:t,minDate:n,maxDate:m,disableFuture:i,disablePast:a}})!==null,[o,d,e,t,n,m,i,a,p])},Rd=(d,e,t)=>(n,m)=>{switch(m.type){case"changeMonth":return Y({},n,{slideDirection:m.direction,currentMonth:m.newMonth,isMonthSwitchingAnimating:!d});case"changeMonthTimezone":{const i=m.newTimezone;if(t.getTimezone(n.currentMonth)===i)return n;let a=t.setTimezone(n.currentMonth,i);return t.getMonth(a)!==t.getMonth(n.currentMonth)&&(a=t.setMonth(a,t.getMonth(n.currentMonth))),Y({},n,{currentMonth:a})}case"finishMonthSwitchingAnimation":return Y({},n,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(n.focusedDay!=null&&m.focusedDay!=null&&t.isSameDay(m.focusedDay,n.focusedDay))return n;const i=m.focusedDay!=null&&!e&&!t.isSameMonth(n.currentMonth,m.focusedDay);return Y({},n,{focusedDay:m.focusedDay,isMonthSwitchingAnimating:i&&!d&&!m.withoutMonthSwitchingAnimation,currentMonth:i?t.startOfMonth(m.focusedDay):n.currentMonth,slideDirection:m.focusedDay!=null&&t.isAfterDay(m.focusedDay,n.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},Od=d=>{const{value:e,referenceDate:t,disableFuture:n,disablePast:m,disableSwitchToMonthOnDayFocus:i=!1,maxDate:a,minDate:p,onMonthChange:o,reduceAnimations:h,shouldDisableDate:r,timezone:s}=d,l=Re(),u=J.useRef(Rd(!!h,i,l)).current,c=J.useMemo(()=>st.getInitialReferenceValue({value:e,utils:l,timezone:s,props:d,referenceDate:t,granularity:Tt.day}),[t,s]),[f,g]=J.useReducer(u,{isMonthSwitchingAnimating:!1,focusedDay:c,currentMonth:l.startOfMonth(c),slideDirection:"left"});J.useEffect(()=>{g({type:"changeMonthTimezone",newTimezone:l.getTimezone(c)})},[c,l]);const v=J.useCallback(y=>{g(Y({type:"changeMonth"},y)),o&&o(y.newMonth)},[o]),b=J.useCallback(y=>{const E=y;l.isSameMonth(E,f.currentMonth)||v({newMonth:l.startOfMonth(E),direction:l.isAfterDay(E,f.currentMonth)?"left":"right"})},[f.currentMonth,v,l]),A=Ko({shouldDisableDate:r,minDate:p,maxDate:a,disableFuture:n,disablePast:m,timezone:s}),x=J.useCallback(()=>{g({type:"finishMonthSwitchingAnimation"})},[]),D=be((y,E)=>{A(y)||g({type:"changeFocusedDay",focusedDay:y,withoutMonthSwitchingAnimation:E})});return{referenceDate:c,calendarState:f,changeMonth:b,changeFocusedDay:D,isDateDisabled:A,onMonthSwitchingAnimationEnd:x,handleChangeMonth:v}},Pd=d=>We("MuiPickersFadeTransitionGroup",d);He("MuiPickersFadeTransitionGroup",["root"]);const Nd=d=>{const{classes:e}=d;return Oe({root:["root"]},Pd,e)},Bd=ge(ro,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(d,e)=>e.root})({display:"block",position:"relative"});function Yo(d){const e=Le({props:d,name:"MuiPickersFadeTransitionGroup"}),{children:t,className:n,reduceAnimations:m,transKey:i}=e,a=Nd(e),p=so();return m?t:ee.jsx(Bd,{className:je(a.root,n),children:ee.jsx(Ri,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:p.transitions.duration.enteringScreen,enter:p.transitions.duration.enteringScreen,exit:0},children:t},i)})}const Vd=d=>We("MuiPickersSlideTransition",d),wt=He("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),Wd=["children","className","reduceAnimations","slideDirection","transKey","classes"],Hd=d=>{const{classes:e,slideDirection:t}=d,n={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${t}`],exitActive:[`slideExitActiveLeft-${t}`]};return Oe(n,Vd,e)},jd=ge(ro,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(d,e)=>[e.root,{[`.${wt["slideEnter-left"]}`]:e["slideEnter-left"]},{[`.${wt["slideEnter-right"]}`]:e["slideEnter-right"]},{[`.${wt.slideEnterActive}`]:e.slideEnterActive},{[`.${wt.slideExit}`]:e.slideExit},{[`.${wt["slideExitActiveLeft-left"]}`]:e["slideExitActiveLeft-left"]},{[`.${wt["slideExitActiveLeft-right"]}`]:e["slideExitActiveLeft-right"]}]})(({theme:d})=>{const e=d.transitions.create("transform",{duration:d.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${wt["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${wt["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${wt.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${wt.slideExit}`]:{transform:"translate(0%)"},[`& .${wt["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${wt["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}});function zd(d){const e=Le({props:d,name:"MuiPickersSlideTransition"}),{children:t,className:n,reduceAnimations:m,transKey:i}=e,a=Se(e,Wd),p=Hd(e),o=so();if(m)return ee.jsx("div",{className:je(p.root,n),children:t});const h={exit:p.exit,enterActive:p.enterActive,enter:p.enter,exitActive:p.exitActive};return ee.jsx(jd,{className:je(p.root,n),childFactory:r=>J.cloneElement(r,{classNames:h}),role:"presentation",children:ee.jsx(kr,Y({mountOnEnter:!0,unmountOnExit:!0,timeout:o.transitions.duration.complex,classNames:h},a,{children:t}),i)})}const Ud=d=>We("MuiDayCalendar",d);He("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const Gd=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],Kd=["ownerState"],Yd=d=>{const{classes:e}=d;return Oe({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},Ud,e)},Jo=(ni+Bi*2)*6,Jd=ge("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(d,e)=>e.root})({}),Qd=ge("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(d,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),Zd=ge(Xt,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(d,e)=>e.weekDayLabel})(({theme:d})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(d.vars||d).palette.text.secondary})),Xd=ge(Xt,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(d,e)=>e.weekNumberLabel})(({theme:d})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:d.palette.text.disabled})),qd=ge(Xt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(d,e)=>e.weekNumber})(({theme:d})=>Y({},d.typography.caption,{width:ni,height:ni,padding:0,margin:`0 ${Bi}px`,color:d.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),ep=ge("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(d,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:Jo}),tp=ge(zd,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(d,e)=>e.slideTransition})({minHeight:Jo}),np=ge("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(d,e)=>e.monthContainer})({overflow:"hidden"}),ip=ge("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(d,e)=>e.weekContainer})({margin:`${Bi}px 0`,display:"flex",justifyContent:"center"});function rp(d){let{parentProps:e,day:t,focusableDay:n,selectedDays:m,isDateDisabled:i,currentMonthNumber:a,isViewFocused:p}=d,o=Se(d,Gd);const{disabled:h,disableHighlightToday:r,isMonthSwitchingAnimating:s,showDaysOutsideCurrentMonth:l,slots:u,slotProps:c,timezone:f}=e,g=Re(),v=yn(f),b=n!==null&&g.isSameDay(t,n),A=m.some(C=>g.isSameDay(C,t)),x=g.isSameDay(t,v),D=(u==null?void 0:u.day)??Ah,y=Ne({elementType:D,externalSlotProps:c==null?void 0:c.day,additionalProps:Y({disableHighlightToday:r,showDaysOutsideCurrentMonth:l,role:"gridcell",isAnimating:s,"data-timestamp":g.toJsDate(t).valueOf()},o),ownerState:Y({},e,{day:t,selected:A})}),E=Se(y,Kd),T=J.useMemo(()=>h||i(t),[h,i,t]),M=J.useMemo(()=>g.getMonth(t)!==a,[g,t,a]),$=J.useMemo(()=>{const C=g.startOfMonth(g.setMonth(t,a));return l?g.isSameDay(t,g.startOfWeek(C)):g.isSameDay(t,C)},[a,t,l,g]),L=J.useMemo(()=>{const C=g.endOfMonth(g.setMonth(t,a));return l?g.isSameDay(t,g.endOfWeek(C)):g.isSameDay(t,C)},[a,t,l,g]);return ee.jsx(D,Y({},E,{day:t,disabled:T,autoFocus:p&&b,today:x,outsideCurrentMonth:M,isFirstVisibleCell:$,isLastVisibleCell:L,selected:A,tabIndex:b?0:-1,"aria-selected":A,"aria-current":x?"date":void 0}))}function sp(d){const e=Le({props:d,name:"MuiDayCalendar"}),t=Re(),{onFocusedDayChange:n,className:m,currentMonth:i,selectedDays:a,focusedDay:p,loading:o,onSelectedDaysChange:h,onMonthSwitchingAnimationEnd:r,readOnly:s,reduceAnimations:l,renderLoading:u=()=>ee.jsx("span",{children:"..."}),slideDirection:c,TransitionProps:f,disablePast:g,disableFuture:v,minDate:b,maxDate:A,shouldDisableDate:x,shouldDisableMonth:D,shouldDisableYear:y,dayOfWeekFormatter:E=le=>t.format(le,"weekdayShort").charAt(0).toUpperCase(),hasFocus:T,onFocusedViewChange:M,gridLabelId:$,displayWeekNumber:L,fixedWeekNumber:C,autoFocus:w,timezone:S}=e,k=yn(S),_=Yd(e),F=Mt(),R=Ko({shouldDisableDate:x,shouldDisableMonth:D,shouldDisableYear:y,minDate:b,maxDate:A,disablePast:g,disableFuture:v,timezone:S}),O=lt(),[V,P]=pn({name:"DayCalendar",state:"hasFocus",controlled:T,default:w??!1}),[H,N]=J.useState(()=>p||k),W=be(le=>{s||h(le)}),z=le=>{R(le)||(n(le),N(le),M==null||M(!0),P(!0))},j=be((le,ae)=>{switch(le.key){case"ArrowUp":z(t.addDays(ae,-7)),le.preventDefault();break;case"ArrowDown":z(t.addDays(ae,7)),le.preventDefault();break;case"ArrowLeft":{const fe=t.addDays(ae,F?1:-1),me=t.addMonths(ae,F?1:-1),ve=Zn({utils:t,date:fe,minDate:F?fe:t.startOfMonth(me),maxDate:F?t.endOfMonth(me):fe,isDateDisabled:R,timezone:S});z(ve||fe),le.preventDefault();break}case"ArrowRight":{const fe=t.addDays(ae,F?-1:1),me=t.addMonths(ae,F?-1:1),ve=Zn({utils:t,date:fe,minDate:F?t.startOfMonth(me):fe,maxDate:F?fe:t.endOfMonth(me),isDateDisabled:R,timezone:S});z(ve||fe),le.preventDefault();break}case"Home":z(t.startOfWeek(ae)),le.preventDefault();break;case"End":z(t.endOfWeek(ae)),le.preventDefault();break;case"PageUp":z(t.addMonths(ae,1)),le.preventDefault();break;case"PageDown":z(t.addMonths(ae,-1)),le.preventDefault();break}}),Q=be((le,ae)=>z(ae)),Z=be((le,ae)=>{V&&t.isSameDay(H,ae)&&(M==null||M(!1))}),q=t.getMonth(i),ne=t.getYear(i),se=J.useMemo(()=>a.filter(le=>!!le).map(le=>t.startOfDay(le)),[t,a]),pe=`${ne}-${q}`,ie=J.useMemo(()=>J.createRef(),[pe]),de=J.useMemo(()=>{const le=t.startOfMonth(i),ae=t.endOfMonth(i);return R(H)||t.isAfterDay(H,ae)||t.isBeforeDay(H,le)?Zn({utils:t,date:H,minDate:le,maxDate:ae,disablePast:g,disableFuture:v,isDateDisabled:R,timezone:S}):H},[i,v,g,H,R,t,S]),ue=J.useMemo(()=>{const le=t.getWeekArray(i);let ae=t.addMonths(i,1);for(;C&&le.length<C;){const fe=t.getWeekArray(ae),me=t.isSameDay(le[le.length-1][0],fe[0][0]);fe.slice(me?1:0).forEach(ve=>{le.length<C&&le.push(ve)}),ae=t.addMonths(ae,1)}return le},[i,C,t]);return ee.jsxs(Jd,{role:"grid","aria-labelledby":$,className:_.root,children:[ee.jsxs(Qd,{role:"row",className:_.header,children:[L&&ee.jsx(Xd,{variant:"caption",role:"columnheader","aria-label":O.calendarWeekNumberHeaderLabel,className:_.weekNumberLabel,children:O.calendarWeekNumberHeaderText}),vu(t,k).map((le,ae)=>ee.jsx(Zd,{variant:"caption",role:"columnheader","aria-label":t.format(le,"weekday"),className:_.weekDayLabel,children:E(le)},ae.toString()))]}),o?ee.jsx(ep,{className:_.loadingContainer,children:u()}):ee.jsx(tp,Y({transKey:pe,onExited:r,reduceAnimations:l,slideDirection:c,className:je(m,_.slideTransition)},f,{nodeRef:ie,children:ee.jsx(np,{ref:ie,role:"rowgroup",className:_.monthContainer,children:ue.map((le,ae)=>ee.jsxs(ip,{role:"row",className:_.weekContainer,"aria-rowindex":ae+1,children:[L&&ee.jsx(qd,{className:_.weekNumber,role:"rowheader","aria-label":O.calendarWeekNumberAriaLabelText(t.getWeekNumber(le[0])),children:O.calendarWeekNumberText(t.getWeekNumber(le[0]))}),le.map((fe,me)=>ee.jsx(rp,{parentProps:e,day:fe,selectedDays:se,focusableDay:de,onKeyDown:j,onFocus:Q,onBlur:Z,onDaySelect:W,isDateDisabled:R,currentMonthNumber:q,isViewFocused:V,"aria-colindex":me+1},fe.toString()))]},`week-${le[0]}`))})}))]})}function op(d){return We("MuiPickersMonth",d)}const bi=He("MuiPickersMonth",["root","monthButton","disabled","selected"]),ap=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],lp=d=>{const{disabled:e,selected:t,classes:n}=d;return Oe({root:["root"],monthButton:["monthButton",e&&"disabled",t&&"selected"]},op,n)},cp=ge("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(d,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),up=ge("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(d,e)=>[e.monthButton,{[`&.${bi.disabled}`]:e.disabled},{[`&.${bi.selected}`]:e.selected}]})(({theme:d})=>Y({color:"unset",backgroundColor:"transparent",border:0,outline:0},d.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:d.vars?`rgba(${d.vars.palette.action.activeChannel} / ${d.vars.palette.action.hoverOpacity})`:Ft(d.palette.action.active,d.palette.action.hoverOpacity)},"&:hover":{backgroundColor:d.vars?`rgba(${d.vars.palette.action.activeChannel} / ${d.vars.palette.action.hoverOpacity})`:Ft(d.palette.action.active,d.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${bi.disabled}`]:{color:(d.vars||d).palette.text.secondary},[`&.${bi.selected}`]:{color:(d.vars||d).palette.primary.contrastText,backgroundColor:(d.vars||d).palette.primary.main,"&:focus, &:hover":{backgroundColor:(d.vars||d).palette.primary.dark}}})),hp=J.memo(function(e){const t=Le({props:e,name:"MuiPickersMonth"}),{autoFocus:n,className:m,children:i,disabled:a,selected:p,value:o,tabIndex:h,onClick:r,onKeyDown:s,onFocus:l,onBlur:u,"aria-current":c,"aria-label":f,slots:g,slotProps:v}=t,b=Se(t,ap),A=J.useRef(null),x=lp(t);Ht(()=>{var E;n&&((E=A.current)==null||E.focus())},[n]);const D=(g==null?void 0:g.monthButton)??up,y=Ne({elementType:D,externalSlotProps:v==null?void 0:v.monthButton,additionalProps:{children:i,disabled:a,tabIndex:h,ref:A,type:"button",role:"radio","aria-current":c,"aria-checked":p,"aria-label":f,onClick:E=>r(E,o),onKeyDown:E=>s(E,o),onFocus:E=>l(E,o),onBlur:E=>u(E,o)},ownerState:t,className:x.monthButton});return ee.jsx(cp,Y({className:je(x.root,m),ownerState:t},b,{children:ee.jsx(D,Y({},y))}))});function dp(d){return We("MuiMonthCalendar",d)}He("MuiMonthCalendar",["root"]);const pp=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],fp=d=>{const{classes:e}=d;return Oe({root:["root"]},dp,e)};function mp(d,e){const t=Re(),n=oi(),m=Le({props:d,name:e});return Y({disableFuture:!1,disablePast:!1},m,{minDate:Dt(t,m.minDate,n.minDate),maxDate:Dt(t,m.maxDate,n.maxDate)})}const gp=ge("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(d,e)=>e.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:Vi,boxSizing:"border-box"}),vp=J.forwardRef(function(e,t){const n=mp(e,"MuiMonthCalendar"),{className:m,value:i,defaultValue:a,referenceDate:p,disabled:o,disableFuture:h,disablePast:r,maxDate:s,minDate:l,onChange:u,shouldDisableMonth:c,readOnly:f,autoFocus:g=!1,onMonthFocus:v,hasFocus:b,onFocusedViewChange:A,monthsPerRow:x=3,timezone:D,gridLabelId:y,slots:E,slotProps:T}=n,M=Se(n,pp),{value:$,handleValueChange:L,timezone:C}=On({name:"MonthCalendar",timezone:D,value:i,defaultValue:a,referenceDate:p,onChange:u,valueManager:st}),w=yn(C),S=Mt(),k=Re(),_=J.useMemo(()=>st.getInitialReferenceValue({value:$,utils:k,props:n,timezone:C,referenceDate:p,granularity:Tt.month}),[]),F=n,R=fp(F),O=J.useMemo(()=>k.getMonth(w),[k,w]),V=J.useMemo(()=>$!=null?k.getMonth($):null,[$,k]),[P,H]=J.useState(()=>V||k.getMonth(_)),[N,W]=pn({name:"MonthCalendar",state:"hasFocus",controlled:b,default:g??!1}),z=be(pe=>{W(pe),A&&A(pe)}),j=J.useCallback(pe=>{const ie=k.startOfMonth(r&&k.isAfter(w,l)?w:l),de=k.startOfMonth(h&&k.isBefore(w,s)?w:s),ue=k.startOfMonth(pe);return k.isBefore(ue,ie)||k.isAfter(ue,de)?!0:c?c(ue):!1},[h,r,s,l,w,c,k]),Q=be((pe,ie)=>{if(f)return;const de=k.setMonth($??_,ie);L(de)}),Z=be(pe=>{j(k.setMonth($??_,pe))||(H(pe),z(!0),v&&v(pe))});J.useEffect(()=>{H(pe=>V!==null&&pe!==V?V:pe)},[V]);const q=be((pe,ie)=>{switch(pe.key){case"ArrowUp":Z((12+ie-3)%12),pe.preventDefault();break;case"ArrowDown":Z((12+ie+3)%12),pe.preventDefault();break;case"ArrowLeft":Z((12+ie+(S?1:-1))%12),pe.preventDefault();break;case"ArrowRight":Z((12+ie+(S?-1:1))%12),pe.preventDefault();break}}),ne=be((pe,ie)=>{Z(ie)}),se=be((pe,ie)=>{P===ie&&z(!1)});return ee.jsx(gp,Y({ref:t,className:je(R.root,m),ownerState:F,role:"radiogroup","aria-labelledby":y},M,{children:Lr(k,$??_).map(pe=>{const ie=k.getMonth(pe),de=k.format(pe,"monthShort"),ue=k.format(pe,"month"),le=ie===V,ae=o||j(pe);return ee.jsx(hp,{selected:le,value:ie,onClick:Q,onKeyDown:q,autoFocus:N&&ie===P,disabled:ae,tabIndex:ie===P&&!ae?0:-1,onFocus:ne,onBlur:se,"aria-current":O===ie?"date":void 0,"aria-label":ue,monthsPerRow:x,slots:E,slotProps:T,children:de},de)})}))});function yp(d){return We("MuiPickersYear",d)}const wi=He("MuiPickersYear",["root","yearButton","selected","disabled"]),bp=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],wp=d=>{const{disabled:e,selected:t,classes:n}=d;return Oe({root:["root"],yearButton:["yearButton",e&&"disabled",t&&"selected"]},yp,n)},Cp=ge("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(d,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),Dp=ge("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(d,e)=>[e.yearButton,{[`&.${wi.disabled}`]:e.disabled},{[`&.${wi.selected}`]:e.selected}]})(({theme:d})=>Y({color:"unset",backgroundColor:"transparent",border:0,outline:0},d.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:d.vars?`rgba(${d.vars.palette.action.activeChannel} / ${d.vars.palette.action.focusOpacity})`:Ft(d.palette.action.active,d.palette.action.focusOpacity)},"&:hover":{backgroundColor:d.vars?`rgba(${d.vars.palette.action.activeChannel} / ${d.vars.palette.action.hoverOpacity})`:Ft(d.palette.action.active,d.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${wi.disabled}`]:{color:(d.vars||d).palette.text.secondary},[`&.${wi.selected}`]:{color:(d.vars||d).palette.primary.contrastText,backgroundColor:(d.vars||d).palette.primary.main,"&:focus, &:hover":{backgroundColor:(d.vars||d).palette.primary.dark}}})),Sp=J.memo(function(e){const t=Le({props:e,name:"MuiPickersYear"}),{autoFocus:n,className:m,children:i,disabled:a,selected:p,value:o,tabIndex:h,onClick:r,onKeyDown:s,onFocus:l,onBlur:u,"aria-current":c,slots:f,slotProps:g}=t,v=Se(t,bp),b=J.useRef(null),A=wp(t);Ht(()=>{var y;n&&((y=b.current)==null||y.focus())},[n]);const x=(f==null?void 0:f.yearButton)??Dp,D=Ne({elementType:x,externalSlotProps:g==null?void 0:g.yearButton,additionalProps:{children:i,disabled:a,tabIndex:h,ref:b,type:"button",role:"radio","aria-current":c,"aria-checked":p,onClick:y=>r(y,o),onKeyDown:y=>s(y,o),onFocus:y=>l(y,o),onBlur:y=>u(y,o)},ownerState:t,className:A.yearButton});return ee.jsx(Cp,Y({className:je(A.root,m),ownerState:t},v,{children:ee.jsx(x,Y({},D))}))});function xp(d){return We("MuiYearCalendar",d)}He("MuiYearCalendar",["root"]);const Ep=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],Ap=d=>{const{classes:e}=d;return Oe({root:["root"]},xp,e)};function Tp(d,e){const t=Re(),n=oi(),m=Le({props:d,name:e});return Y({disablePast:!1,disableFuture:!1},m,{yearsPerRow:m.yearsPerRow??3,minDate:Dt(t,m.minDate,n.minDate),maxDate:Dt(t,m.maxDate,n.maxDate)})}const kp=ge("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(d,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:Vi,maxHeight:qc,boxSizing:"border-box",position:"relative"}),$p=J.forwardRef(function(e,t){const n=Tp(e,"MuiYearCalendar"),{autoFocus:m,className:i,value:a,defaultValue:p,referenceDate:o,disabled:h,disableFuture:r,disablePast:s,maxDate:l,minDate:u,onChange:c,readOnly:f,shouldDisableYear:g,onYearFocus:v,hasFocus:b,onFocusedViewChange:A,yearsOrder:x="asc",yearsPerRow:D,timezone:y,gridLabelId:E,slots:T,slotProps:M}=n,$=Se(n,Ep),{value:L,handleValueChange:C,timezone:w}=On({name:"YearCalendar",timezone:y,value:a,defaultValue:p,referenceDate:o,onChange:c,valueManager:st}),S=yn(w),k=Mt(),_=Re(),F=J.useMemo(()=>st.getInitialReferenceValue({value:L,utils:_,props:n,timezone:w,referenceDate:o,granularity:Tt.year}),[]),R=n,O=Ap(R),V=J.useMemo(()=>_.getYear(S),[_,S]),P=J.useMemo(()=>L!=null?_.getYear(L):null,[L,_]),[H,N]=J.useState(()=>P||_.getYear(F)),[W,z]=pn({name:"YearCalendar",state:"hasFocus",controlled:b,default:m??!1}),j=be(fe=>{z(fe),A&&A(fe)}),Q=J.useCallback(fe=>{if(s&&_.isBeforeYear(fe,S)||r&&_.isAfterYear(fe,S)||u&&_.isBeforeYear(fe,u)||l&&_.isAfterYear(fe,l))return!0;if(!g)return!1;const me=_.startOfYear(fe);return g(me)},[r,s,l,u,S,g,_]),Z=be((fe,me)=>{if(f)return;const ve=_.setYear(L??F,me);C(ve)}),q=be(fe=>{Q(_.setYear(L??F,fe))||(N(fe),j(!0),v==null||v(fe))});J.useEffect(()=>{N(fe=>P!==null&&fe!==P?P:fe)},[P]);const ne=x!=="desc"?D*1:D*-1,se=k&&x==="asc"||!k&&x==="desc"?-1:1,pe=be((fe,me)=>{switch(fe.key){case"ArrowUp":q(me-ne),fe.preventDefault();break;case"ArrowDown":q(me+ne),fe.preventDefault();break;case"ArrowLeft":q(me-se),fe.preventDefault();break;case"ArrowRight":q(me+se),fe.preventDefault();break}}),ie=be((fe,me)=>{q(me)}),de=be((fe,me)=>{H===me&&j(!1)}),ue=J.useRef(null),le=ht(t,ue);J.useEffect(()=>{if(m||ue.current===null)return;const fe=ue.current.querySelector('[tabindex="0"]');if(!fe)return;const me=fe.offsetHeight,ve=fe.offsetTop,Ee=ue.current.clientHeight,Ge=ue.current.scrollTop,nt=ve+me;me>Ee||ve<Ge||(ue.current.scrollTop=nt-Ee/2-me/2)},[m]);const ae=_.getYearRange([u,l]);return x==="desc"&&ae.reverse(),ee.jsx(kp,Y({ref:le,className:je(O.root,i),ownerState:R,role:"radiogroup","aria-labelledby":E},$,{children:ae.map(fe=>{const me=_.getYear(fe),ve=me===P,Ee=h||Q(fe);return ee.jsx(Sp,{selected:ve,value:me,onClick:Z,onKeyDown:pe,autoFocus:W&&me===H,disabled:Ee,tabIndex:me===H&&!Ee?0:-1,onFocus:ie,onBlur:de,"aria-current":V===me?"date":void 0,yearsPerRow:D,slots:T,slotProps:M,children:_.format(fe,"year")},_.format(fe,"year"))})}))}),Mp=d=>We("MuiPickersCalendarHeader",d),_p=He("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),Ip=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],Lp=["ownerState"],Fp=d=>{const{classes:e}=d;return Oe({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},Mp,e)},Rp=ge("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(d,e)=>e.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),Op=ge("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(d,e)=>e.labelContainer})(({theme:d})=>Y({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},d.typography.body1,{fontWeight:d.typography.fontWeightMedium})),Pp=ge("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(d,e)=>e.label})({marginRight:6}),Np=ge(Fn,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(d,e)=>e.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${_p.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),Bp=ge(Rc,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(d,e)=>e.switchViewIcon})(({theme:d})=>({willChange:"transform",transition:d.transitions.create("transform"),transform:"rotate(0deg)"})),Vp=J.forwardRef(function(e,t){const n=lt(),m=Re(),i=Le({props:e,name:"MuiPickersCalendarHeader"}),{slots:a,slotProps:p,currentMonth:o,disabled:h,disableFuture:r,disablePast:s,maxDate:l,minDate:u,onMonthChange:c,onViewChange:f,view:g,reduceAnimations:v,views:b,labelId:A,className:x,timezone:D,format:y=`${m.formats.month} ${m.formats.year}`}=i,E=Se(i,Ip),T=i,M=Fp(i),$=(a==null?void 0:a.switchViewButton)??Np,L=Ne({elementType:$,externalSlotProps:p==null?void 0:p.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(g)},ownerState:T,className:M.switchViewButton}),C=(a==null?void 0:a.switchViewIcon)??Bp,w=Ne({elementType:C,externalSlotProps:p==null?void 0:p.switchViewIcon,ownerState:T,className:M.switchViewIcon}),S=Se(w,Lp),k=()=>c(m.addMonths(o,1),"left"),_=()=>c(m.addMonths(o,-1),"right"),F=Zc(o,{disableFuture:r,maxDate:l,timezone:D}),R=Xc(o,{disablePast:s,minDate:u,timezone:D}),O=()=>{if(!(b.length===1||!f||h))if(b.length===2)f(b.find(P=>P!==g)||b[0]);else{const P=b.indexOf(g)!==0?0:1;f(b[P])}};if(b.length===1&&b[0]==="year")return null;const V=m.formatByString(o,y);return ee.jsxs(Rp,Y({},E,{ownerState:T,className:je(M.root,x),ref:t,children:[ee.jsxs(Op,{role:"presentation",onClick:O,ownerState:T,"aria-live":"polite",className:M.labelContainer,children:[ee.jsx(Yo,{reduceAnimations:v,transKey:V,children:ee.jsx(Pp,{id:A,ownerState:T,className:M.label,children:V})}),b.length>1&&!h&&ee.jsx($,Y({},L,{children:ee.jsx(C,Y({},S))}))]}),ee.jsx(Ri,{in:g==="day",appear:!v,enter:!v,children:ee.jsx(uo,{slots:a,slotProps:p,onGoToPrevious:_,isPreviousDisabled:R,previousLabel:n.previousMonth,onGoToNext:k,isNextDisabled:F,nextLabel:n.nextMonth})})]}))}),Wp="@media (prefers-reduced-motion: reduce)",Mn=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),Ss=Mn&&Mn[1]?parseInt(Mn[1],10):null,xs=Mn&&Mn[2]?parseInt(Mn[2],10):null,Hp=Ss&&Ss<10||xs&&xs<13||!1,Qo=()=>Ar(Wp,{defaultMatches:!1})||Hp,jp=d=>We("MuiDateCalendar",d);He("MuiDateCalendar",["root","viewTransitionContainer"]);const zp=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],Up=d=>{const{classes:e}=d;return Oe({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},jp,e)};function Gp(d,e){const t=Re(),n=oi(),m=Qo(),i=Le({props:d,name:e});return Y({},i,{loading:i.loading??!1,disablePast:i.disablePast??!1,disableFuture:i.disableFuture??!1,openTo:i.openTo??"day",views:i.views??["year","day"],reduceAnimations:i.reduceAnimations??m,renderLoading:i.renderLoading??(()=>ee.jsx("span",{children:"..."})),minDate:Dt(t,i.minDate,n.minDate),maxDate:Dt(t,i.maxDate,n.maxDate)})}const Kp=ge(Wi,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(d,e)=>e.root})({display:"flex",flexDirection:"column",height:Ir}),Yp=ge(Yo,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(d,e)=>e.viewTransitionContainer})({}),Jp=J.forwardRef(function(e,t){const n=Re(),m=Rn(),i=Gp(e,"MuiDateCalendar"),{autoFocus:a,onViewChange:p,value:o,defaultValue:h,referenceDate:r,disableFuture:s,disablePast:l,onChange:u,onYearChange:c,onMonthChange:f,reduceAnimations:g,shouldDisableDate:v,shouldDisableMonth:b,shouldDisableYear:A,view:x,views:D,openTo:y,className:E,disabled:T,readOnly:M,minDate:$,maxDate:L,disableHighlightToday:C,focusedView:w,onFocusedViewChange:S,showDaysOutsideCurrentMonth:k,fixedWeekNumber:_,dayOfWeekFormatter:F,slots:R,slotProps:O,loading:V,renderLoading:P,displayWeekNumber:H,yearsOrder:N,yearsPerRow:W,monthsPerRow:z,timezone:j}=i,Q=Se(i,zp),{value:Z,handleValueChange:q,timezone:ne}=On({name:"DateCalendar",timezone:j,value:o,defaultValue:h,referenceDate:r,onChange:u,valueManager:st}),{view:se,setView:pe,focusedView:ie,setFocusedView:de,goToNextView:ue,setValueAndGoToNextView:le}=li({view:x,views:D,openTo:y,onChange:q,onViewChange:p,autoFocus:a,focusedView:w,onFocusedViewChange:S}),{referenceDate:ae,calendarState:fe,changeFocusedDay:me,changeMonth:ve,handleChangeMonth:Ee,isDateDisabled:Ge,onMonthSwitchingAnimationEnd:nt}=Od({value:Z,referenceDate:r,reduceAnimations:g,onMonthChange:f,minDate:$,maxDate:L,shouldDisableDate:v,disablePast:l,disableFuture:s,timezone:ne}),dt=T&&Z||$,Ze=T&&Z||L,re=`${m}-grid-label`,ye=ie!==null,Ce=(R==null?void 0:R.calendarHeader)??Vp,ke=Ne({elementType:Ce,externalSlotProps:O==null?void 0:O.calendarHeader,additionalProps:{views:D,view:se,currentMonth:fe.currentMonth,onViewChange:pe,onMonthChange:(Pe,pt)=>Ee({newMonth:Pe,direction:pt}),minDate:dt,maxDate:Ze,disabled:T,disablePast:l,disableFuture:s,reduceAnimations:g,timezone:ne,labelId:re},ownerState:i}),Te=be(Pe=>{const pt=n.startOfMonth(Pe),en=n.endOfMonth(Pe),_t=Ge(Pe)?Zn({utils:n,date:Pe,minDate:n.isBefore($,pt)?pt:$,maxDate:n.isAfter(L,en)?en:L,disablePast:l,disableFuture:s,isDateDisabled:Ge,timezone:ne}):Pe;_t?(le(_t,"finish"),f==null||f(pt)):(ue(),ve(pt)),me(_t,!0)}),Ue=be(Pe=>{const pt=n.startOfYear(Pe),en=n.endOfYear(Pe),_t=Ge(Pe)?Zn({utils:n,date:Pe,minDate:n.isBefore($,pt)?pt:$,maxDate:n.isAfter(L,en)?en:L,disablePast:l,disableFuture:s,isDateDisabled:Ge,timezone:ne}):Pe;_t?(le(_t,"finish"),c==null||c(_t)):(ue(),ve(pt)),me(_t,!0)}),Ke=be(Pe=>q(Pe&&Mi(n,Pe,Z??ae),"finish",se));J.useEffect(()=>{Z!=null&&n.isValid(Z)&&ve(Z)},[Z]);const ze=i,Be=Up(ze),Ie={disablePast:l,disableFuture:s,maxDate:L,minDate:$},et={disableHighlightToday:C,readOnly:M,disabled:T,timezone:ne,gridLabelId:re,slots:R,slotProps:O},vt=J.useRef(se);J.useEffect(()=>{vt.current!==se&&(ie===vt.current&&de(se,!0),vt.current=se)},[ie,de,se]);const Cn=J.useMemo(()=>[Z],[Z]);return ee.jsxs(Kp,Y({ref:t,className:je(Be.root,E),ownerState:ze},Q,{children:[ee.jsx(Ce,Y({},ke,{slots:R,slotProps:O})),ee.jsx(Yp,{reduceAnimations:g,className:Be.viewTransitionContainer,transKey:se,ownerState:ze,children:ee.jsxs("div",{children:[se==="year"&&ee.jsx($p,Y({},Ie,et,{value:Z,onChange:Ue,shouldDisableYear:A,hasFocus:ye,onFocusedViewChange:Pe=>de("year",Pe),yearsOrder:N,yearsPerRow:W,referenceDate:ae})),se==="month"&&ee.jsx(vp,Y({},Ie,et,{hasFocus:ye,className:E,value:Z,onChange:Te,shouldDisableMonth:b,onFocusedViewChange:Pe=>de("month",Pe),monthsPerRow:z,referenceDate:ae})),se==="day"&&ee.jsx(sp,Y({},fe,Ie,et,{onMonthSwitchingAnimationEnd:nt,onFocusedDayChange:me,reduceAnimations:g,selectedDays:Cn,onSelectedDaysChange:Ke,shouldDisableDate:v,shouldDisableMonth:b,shouldDisableYear:A,hasFocus:ye,onFocusedViewChange:Pe=>de("day",Pe),showDaysOutsideCurrentMonth:k,fixedWeekNumber:_,dayOfWeekFormatter:F,displayWeekNumber:H,loading:V,renderLoading:P}))]})})]}))});function Zo(d){return We("MuiPickersToolbar",d)}He("MuiPickersToolbar",["root","content"]);const Qp=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Zp=d=>{const{classes:e}=d;return Oe({root:["root"],content:["content"]},Zo,e)},Xp=ge("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(d,e)=>e.root})(({theme:d})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:d.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),qp=ge("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(d,e)=>e.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),Xo=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiPickersToolbar"}),{children:m,className:i,toolbarTitle:a,hidden:p,titleId:o}=n,h=Se(n,Qp),r=n,s=Zp(r);return p?null:ee.jsxs(Xp,Y({ref:t,className:je(s.root,i),ownerState:r},h,{children:[ee.jsx(Xt,{color:"text.secondary",variant:"overline",id:o,children:a}),ee.jsx(qp,{className:s.content,ownerState:r,children:m})]}))});function ef(d){return We("MuiDatePickerToolbar",d)}He("MuiDatePickerToolbar",["root","title"]);const tf=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views","className","onViewChange","view"],nf=d=>{const{classes:e}=d;return Oe({root:["root"],title:["title"]},ef,e)},rf=ge(Xo,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(d,e)=>e.root})({}),sf=ge(Xt,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(d,e)=>e.title})({variants:[{props:{isLandscape:!0},style:{margin:"auto 16px auto auto"}}]}),of=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiDatePickerToolbar"}),{value:m,isLandscape:i,toolbarFormat:a,toolbarPlaceholder:p="––",views:o,className:h}=n,r=Se(n,tf),s=Re(),l=lt(),u=nf(n),c=J.useMemo(()=>{if(!m)return p;const g=Rr(s,{format:a,views:o},!0);return s.formatByString(m,g)},[m,a,p,s,o]),f=n;return ee.jsx(rf,Y({ref:t,toolbarTitle:l.datePickerToolbarTitle,isLandscape:i,className:je(u.root,h)},r,{children:ee.jsx(sf,{variant:"h4",align:i?"left":"center",ownerState:f,className:u.title,children:c})}))});function qo(d,e){const t=Re(),n=oi(),m=Le({props:d,name:e}),i=J.useMemo(()=>{var a;return((a=m.localeText)==null?void 0:a.toolbarTitle)==null?m.localeText:Y({},m.localeText,{datePickerToolbarTitle:m.localeText.toolbarTitle})},[m.localeText]);return Y({},m,{localeText:i},ho({views:m.views,openTo:m.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:m.disableFuture??!1,disablePast:m.disablePast??!1,minDate:Dt(t,m.minDate,n.minDate),maxDate:Dt(t,m.maxDate,n.maxDate),slots:Y({toolbar:of},m.slots)})}function af(d){return We("MuiPickersPopper",d)}He("MuiPickersPopper",["root","paper"]);const lf=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],cf=d=>{const{classes:e}=d;return Oe({root:["root"],paper:["paper"]},af,e)},uf=ge(Fl,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(d,e)=>e.root})(({theme:d})=>({zIndex:d.zIndex.modal})),hf=ge(Ll,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(d,e)=>e.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:d})=>["top","top-start","top-end"].includes(d),style:{transformOrigin:"bottom center"}}]});function df(d,e){return e.documentElement.clientWidth<d.clientX||e.documentElement.clientHeight<d.clientY}function pf(d,e){const t=J.useRef(!1),n=J.useRef(!1),m=J.useRef(null),i=J.useRef(!1);J.useEffect(()=>{if(!d)return;function o(){i.current=!0}return document.addEventListener("mousedown",o,!0),document.addEventListener("touchstart",o,!0),()=>{document.removeEventListener("mousedown",o,!0),document.removeEventListener("touchstart",o,!0),i.current=!1}},[d]);const a=be(o=>{if(!i.current)return;const h=n.current;n.current=!1;const r=tr(m.current);if(!m.current||"clientX"in o&&df(o,r))return;if(t.current){t.current=!1;return}let s;o.composedPath?s=o.composedPath().indexOf(m.current)>-1:s=!r.documentElement.contains(o.target)||m.current.contains(o.target),!s&&!h&&e(o)}),p=()=>{n.current=!0};return J.useEffect(()=>{if(d){const o=tr(m.current),h=()=>{t.current=!0};return o.addEventListener("touchstart",a),o.addEventListener("touchmove",h),()=>{o.removeEventListener("touchstart",a),o.removeEventListener("touchmove",h)}}},[d,a]),J.useEffect(()=>{if(d){const o=tr(m.current);return o.addEventListener("click",a),()=>{o.removeEventListener("click",a),n.current=!1}}},[d,a]),[m,p,p]}const ff=J.forwardRef((d,e)=>{const{PaperComponent:t,popperPlacement:n,ownerState:m,children:i,paperSlotProps:a,paperClasses:p,onPaperClick:o,onPaperTouchStart:h}=d,r=Se(d,lf),s=Y({},m,{placement:n}),l=Ne({elementType:t,externalSlotProps:a,additionalProps:{tabIndex:-1,elevation:8,ref:e},className:p,ownerState:s});return ee.jsx(t,Y({},r,l,{onClick:u=>{var c;o(u),(c=l.onClick)==null||c.call(l,u)},onTouchStart:u=>{var c;h(u),(c=l.onTouchStart)==null||c.call(l,u)},ownerState:s,children:i}))});function mf(d){const e=Le({props:d,name:"MuiPickersPopper"}),{anchorEl:t,children:n,containerRef:m=null,shouldRestoreFocus:i,onBlur:a,onDismiss:p,open:o,role:h,placement:r,slots:s,slotProps:l,reduceAnimations:u}=e;J.useEffect(()=>{function k(_){o&&_.key==="Escape"&&p()}return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k)}},[p,o]);const c=J.useRef(null);J.useEffect(()=>{h==="tooltip"||i&&!i()||(o?c.current=ct(document):c.current&&c.current instanceof HTMLElement&&setTimeout(()=>{c.current instanceof HTMLElement&&c.current.focus()}))},[o,h,i]);const[f,g,v]=pf(o,a??p),b=J.useRef(null),A=ht(b,m),x=ht(A,f),D=e,y=cf(D),E=Qo(),T=u??E,M=k=>{k.key==="Escape"&&(k.stopPropagation(),p())},$=(s==null?void 0:s.desktopTransition)??T?Ri:_l,L=(s==null?void 0:s.desktopTrapFocus)??Il,C=(s==null?void 0:s.desktopPaper)??hf,w=(s==null?void 0:s.popper)??uf,S=Ne({elementType:w,externalSlotProps:l==null?void 0:l.popper,additionalProps:{transition:!0,role:h,open:o,anchorEl:t,placement:r,onKeyDown:M},className:y.root,ownerState:e});return ee.jsx(w,Y({},S,{children:({TransitionProps:k,placement:_})=>ee.jsx(L,Y({open:o,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:h==="tooltip",isEnabled:()=>!0},l==null?void 0:l.desktopTrapFocus,{children:ee.jsx($,Y({},k,l==null?void 0:l.desktopTransition,{children:ee.jsx(ff,{PaperComponent:C,ownerState:D,popperPlacement:_,ref:x,onPaperClick:g,onPaperTouchStart:v,paperClasses:y.paper,paperSlotProps:l==null?void 0:l.desktopPaper,children:n})}))}))}))}const gf=({open:d,onOpen:e,onClose:t})=>{const n=J.useRef(typeof d=="boolean").current,[m,i]=J.useState(!1);J.useEffect(()=>{if(n){if(typeof d!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(d)}},[n,d]);const a=J.useCallback(p=>{n||i(p),p&&e&&e(),!p&&t&&t()},[n,e,t]);return{isOpen:m,setIsOpen:a}},vf=d=>{const{action:e,hasChanged:t,dateState:n,isControlled:m}=d,i=!m&&!n.hasBeenModifiedSinceMount;return e.name==="setValueFromField"?!0:e.name==="setValueFromAction"?i&&["accept","today","clear"].includes(e.pickerAction)?!0:t(n.lastPublishedValue):e.name==="setValueFromView"&&e.selectionState!=="shallow"||e.name==="setValueFromShortcut"?i?!0:t(n.lastPublishedValue):!1},yf=d=>{const{action:e,hasChanged:t,dateState:n,isControlled:m,closeOnSelect:i}=d,a=!m&&!n.hasBeenModifiedSinceMount;return e.name==="setValueFromAction"?a&&["accept","today","clear"].includes(e.pickerAction)?!0:t(n.lastCommittedValue):e.name==="setValueFromView"&&e.selectionState==="finish"&&i?a?!0:t(n.lastCommittedValue):e.name==="setValueFromShortcut"?e.changeImportance==="accept"&&t(n.lastCommittedValue):!1},bf=d=>{const{action:e,closeOnSelect:t}=d;return e.name==="setValueFromAction"?!0:e.name==="setValueFromView"?e.selectionState==="finish"&&t:e.name==="setValueFromShortcut"?e.changeImportance==="accept":!1},wf=({props:d,valueManager:e,valueType:t,wrapperVariant:n,validator:m})=>{const{onAccept:i,onChange:a,value:p,defaultValue:o,closeOnSelect:h=n==="desktop",timezone:r,referenceDate:s}=d,{current:l}=J.useRef(o),{current:u}=J.useRef(p!==void 0),[c,f]=J.useState(r),g=Re(),v=vn(),{isOpen:b,setIsOpen:A}=gf(d),{timezone:x,value:D,handleValueChange:y}=Or({timezone:r,value:p,defaultValue:l,referenceDate:s,onChange:a,valueManager:e}),[E,T]=J.useState(()=>{let q;return D!==void 0?q=D:l!==void 0?q=l:q=e.emptyValue,{draft:q,lastPublishedValue:q,lastCommittedValue:q,lastControlledValue:p,hasBeenModifiedSinceMount:!1}}),M=e.getTimezone(g,E.draft);c!==r&&(f(r),r&&M&&r!==M&&T(q=>Y({},q,{draft:e.setTimezone(g,r,q.draft)})));const{getValidationErrorForNewValue:$}=_o({props:d,validator:m,timezone:x,value:E.draft,onError:d.onError}),L=be(q=>{const ne={action:q,dateState:E,hasChanged:le=>!e.areValuesEqual(g,q.value,le),isControlled:u,closeOnSelect:h},se=vf(ne),pe=yf(ne),ie=bf(ne);T(le=>Y({},le,{draft:q.value,lastPublishedValue:se?q.value:le.lastPublishedValue,lastCommittedValue:pe?q.value:le.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let de=null;const ue=()=>(de||(de={validationError:q.name==="setValueFromField"?q.context.validationError:$(q.value)},q.name==="setValueFromShortcut"&&(de.shortcut=q.shortcut)),de);se&&y(q.value,ue()),pe&&i&&i(q.value,ue()),ie&&A(!1)});if(E.lastControlledValue!==p){const q=e.areValuesEqual(g,E.draft,D);T(ne=>Y({},ne,{lastControlledValue:p},q?{}:{lastCommittedValue:D,lastPublishedValue:D,draft:D,hasBeenModifiedSinceMount:!0}))}const C=be(()=>{L({value:e.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),w=be(()=>{L({value:E.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),S=be(()=>{L({value:E.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),k=be(()=>{L({value:E.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),_=be(()=>{L({value:e.getTodayValue(g,x,t),name:"setValueFromAction",pickerAction:"today"})}),F=be(q=>{q.preventDefault(),A(!0)}),R=be(q=>{q==null||q.preventDefault(),A(!1)}),O=be((q,ne="partial")=>L({name:"setValueFromView",value:q,selectionState:ne})),V=be((q,ne,se)=>L({name:"setValueFromShortcut",value:q,changeImportance:ne,shortcut:se})),P=be((q,ne)=>L({name:"setValueFromField",value:q,context:ne})),H={onClear:C,onAccept:w,onDismiss:S,onCancel:k,onSetToday:_,onOpen:F,onClose:R},N={value:E.draft,onChange:P},W=J.useMemo(()=>e.cleanValue(g,E.draft),[g,e,E.draft]),z={value:W,onChange:O,onClose:R,open:b},Q=Y({},H,{value:W,onChange:O,onSelectShortcut:V,isValid:q=>{const ne=m({adapter:v,value:q,timezone:x,props:d});return!e.hasError(ne)}}),Z=J.useMemo(()=>({onOpen:F,onClose:R,open:b}),[b,R,F]);return{open:b,fieldProps:N,viewProps:z,layoutProps:Q,actions:H,contextValue:Z}},Cf=["className","sx"],Df=({props:d,propsFromPickerValue:e,additionalViewProps:t,autoFocusView:n,rendererInterceptor:m,fieldRef:i})=>{const{onChange:a,open:p,onClose:o}=e,{view:h,views:r,openTo:s,onViewChange:l,viewRenderers:u,timezone:c}=d,f=Se(d,Cf),{view:g,setView:v,defaultView:b,focusedView:A,setFocusedView:x,setValueAndGoToNextView:D}=li({view:h,views:r,openTo:s,onChange:a,onViewChange:l,autoFocus:n}),{hasUIView:y,viewModeLookup:E}=J.useMemo(()=>r.reduce((S,k)=>{let _;return u[k]!=null?_="UI":_="field",S.viewModeLookup[k]=_,_==="UI"&&(S.hasUIView=!0),S},{hasUIView:!1,viewModeLookup:{}}),[u,r]),T=J.useMemo(()=>r.reduce((S,k)=>u[k]!=null&&ei(k)?S+1:S,0),[u,r]),M=E[g],$=be(()=>M==="UI"),[L,C]=J.useState(M==="UI"?g:null);return L!==g&&E[g]==="UI"&&C(g),Ht(()=>{M==="field"&&p&&(o(),setTimeout(()=>{var S,k;(S=i==null?void 0:i.current)==null||S.setSelectedSections(g),(k=i==null?void 0:i.current)==null||k.focusField(g)}))},[g]),Ht(()=>{if(!p)return;let S=g;M==="field"&&L!=null&&(S=L),S!==b&&E[S]==="UI"&&E[b]==="UI"&&(S=b),S!==g&&v(S),x(S,!0)},[p]),{hasUIView:y,shouldRestoreFocus:$,layoutProps:{views:r,view:L,onViewChange:v},renderCurrentView:()=>{if(L==null)return null;const S=u[L];if(S==null)return null;const k=Y({},f,t,e,{views:r,timezone:c,onChange:D,view:L,onViewChange:v,focusedView:A,onFocusedViewChange:x,showViewSwitcher:T>1,timeViewsCount:T});return m?m(u,L,k):S(k)}}};function Es(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const Sf=(d,e)=>{const[t,n]=J.useState(Es);return Ht(()=>{const i=()=>{n(Es())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),An(d,["hours","minutes","seconds"])?!1:(e||t)==="landscape"},xf=({props:d,propsFromPickerValue:e,propsFromPickerViews:t,wrapperVariant:n})=>{const{orientation:m}=d,i=Sf(t.views,m),a=Mt();return{layoutProps:Y({},t,e,{isLandscape:i,isRtl:a,wrapperVariant:n,disabled:d.disabled,readOnly:d.readOnly})}};function Ef(d){const{props:e,pickerValueResponse:t}=d;return J.useMemo(()=>({value:t.viewProps.value,open:t.open,disabled:e.disabled??!1,readOnly:e.readOnly??!1}),[t.viewProps.value,t.open,e.disabled,e.readOnly])}const ea=({props:d,valueManager:e,valueType:t,wrapperVariant:n,additionalViewProps:m,validator:i,autoFocusView:a,rendererInterceptor:p,fieldRef:o})=>{const h=wf({props:d,valueManager:e,valueType:t,wrapperVariant:n,validator:i}),r=Df({props:d,additionalViewProps:m,autoFocusView:a,fieldRef:o,propsFromPickerValue:h.viewProps,rendererInterceptor:p}),s=xf({props:d,wrapperVariant:n,propsFromPickerValue:h.layoutProps,propsFromPickerViews:r.layoutProps}),l=Ef({props:d,pickerValueResponse:h});return{open:h.open,actions:h.actions,fieldProps:h.fieldProps,renderCurrentView:r.renderCurrentView,hasUIView:r.hasUIView,shouldRestoreFocus:r.shouldRestoreFocus,layoutProps:s.layoutProps,contextValue:h.contextValue,ownerState:l}};function ta(d){return We("MuiPickersLayout",d)}const un=He("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),Af=["onAccept","onClear","onCancel","onSetToday","actions"];function Tf(d){const{onAccept:e,onClear:t,onCancel:n,onSetToday:m,actions:i}=d,a=Se(d,Af),p=lt();if(i==null||i.length===0)return null;const o=i==null?void 0:i.map(h=>{switch(h){case"clear":return ee.jsx(Yn,{onClick:t,children:p.clearButtonLabel},h);case"cancel":return ee.jsx(Yn,{onClick:n,children:p.cancelButtonLabel},h);case"accept":return ee.jsx(Yn,{onClick:e,children:p.okButtonLabel},h);case"today":return ee.jsx(Yn,{onClick:m,children:p.todayButtonLabel},h);default:return null}});return ee.jsx(Rl,Y({},a,{children:o}))}const kf=["items","changeImportance","isLandscape","onChange","isValid"],$f=["getValue"];function Mf(d){const{items:e,changeImportance:t="accept",onChange:n,isValid:m}=d,i=Se(d,kf);if(e==null||e.length===0)return null;const a=e.map(p=>{let{getValue:o}=p,h=Se(p,$f);const r=o({isValid:m});return Y({},h,{label:h.label,onClick:()=>{n(r,t,h)},disabled:!m(r)})});return ee.jsx(Ol,Y({dense:!0,sx:[{maxHeight:Ir,maxWidth:200,overflow:"auto"},...Array.isArray(i.sx)?i.sx:[i.sx]]},i,{children:a.map(p=>ee.jsx(Pl,{children:ee.jsx(Nl,Y({},p))},p.id??p.label))}))}function _f(d){return d.view!==null}const If=d=>{const{classes:e,isLandscape:t}=d;return Oe({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},ta,e)},Lf=d=>{const{wrapperVariant:e,onAccept:t,onClear:n,onCancel:m,onSetToday:i,view:a,views:p,onViewChange:o,value:h,onChange:r,onSelectShortcut:s,isValid:l,isLandscape:u,disabled:c,readOnly:f,children:g,slots:v,slotProps:b}=d,A=If(d),x=(v==null?void 0:v.actionBar)??Tf,D=Ne({elementType:x,externalSlotProps:b==null?void 0:b.actionBar,additionalProps:{onAccept:t,onClear:n,onCancel:m,onSetToday:i,actions:e==="desktop"?[]:["cancel","accept"]},className:A.actionBar,ownerState:Y({},d,{wrapperVariant:e})}),y=ee.jsx(x,Y({},D)),E=v==null?void 0:v.toolbar,T=Ne({elementType:E,externalSlotProps:b==null?void 0:b.toolbar,additionalProps:{isLandscape:u,onChange:r,value:h,view:a,onViewChange:o,views:p,disabled:c,readOnly:f},className:A.toolbar,ownerState:Y({},d,{wrapperVariant:e})}),M=_f(T)&&E?ee.jsx(E,Y({},T)):null,$=g,L=v==null?void 0:v.tabs,C=a&&L?ee.jsx(L,Y({view:a,onViewChange:o,className:A.tabs},b==null?void 0:b.tabs)):null,w=(v==null?void 0:v.shortcuts)??Mf,S=Ne({elementType:w,externalSlotProps:b==null?void 0:b.shortcuts,additionalProps:{isValid:l,isLandscape:u,onChange:s},className:A.shortcuts,ownerState:{isValid:l,isLandscape:u,onChange:s,wrapperVariant:e}}),k=a&&w?ee.jsx(w,Y({},S)):null;return{toolbar:M,content:$,tabs:C,actionBar:y,shortcuts:k}},Ff=d=>{const{isLandscape:e,classes:t}=d;return Oe({root:["root",e&&"landscape"],contentWrapper:["contentWrapper"]},ta,t)},Rf=ge("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(d,e)=>e.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${un.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${un.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${un.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${un.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${un.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${un.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${un.shortcuts}`]:{gridColumn:3}}}]}),Of=ge("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(d,e)=>e.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),na=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiPickersLayout"}),{toolbar:m,content:i,tabs:a,actionBar:p,shortcuts:o}=Lf(n),{sx:h,className:r,isLandscape:s,wrapperVariant:l}=n,u=Ff(n);return ee.jsxs(Rf,{ref:t,sx:h,className:je(u.root,r),ownerState:n,children:[s?o:m,s?m:o,ee.jsx(Of,{className:u.contentWrapper,children:l==="desktop"?ee.jsxs(J.Fragment,{children:[i,a]}):ee.jsxs(J.Fragment,{children:[a,i]})}),p]})}),Pf=["props","getOpenDialogAriaText"],Nf=["ownerState"],Bf=["ownerState"],ia=d=>{var ue;let{props:e,getOpenDialogAriaText:t}=d,n=Se(d,Pf);const{slots:m,slotProps:i,className:a,sx:p,format:o,formatDensity:h,enableAccessibleFieldDOMStructure:r,selectedSections:s,onSelectedSectionsChange:l,timezone:u,name:c,label:f,inputRef:g,readOnly:v,disabled:b,autoFocus:A,localeText:x,reduceAnimations:D}=e,y=J.useRef(null),E=J.useRef(null),T=Rn(),M=((ue=i==null?void 0:i.toolbar)==null?void 0:ue.hidden)??!1,{open:$,actions:L,hasUIView:C,layoutProps:w,renderCurrentView:S,shouldRestoreFocus:k,fieldProps:_,contextValue:F,ownerState:R}=ea(Y({},n,{props:e,fieldRef:E,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),O=m.inputAdornment??no,V=Ne({elementType:O,externalSlotProps:i==null?void 0:i.inputAdornment,additionalProps:{position:"end"},ownerState:e}),P=Se(V,Nf),H=m.openPickerButton??Fn,N=Ne({elementType:H,externalSlotProps:i==null?void 0:i.openPickerButton,additionalProps:{disabled:b||v,onClick:$?L.onClose:L.onOpen,"aria-label":t(_.value),edge:P.position},ownerState:e}),W=Se(N,Bf),z=m.openPickerIcon,j=Ne({elementType:z,externalSlotProps:i==null?void 0:i.openPickerIcon,ownerState:R}),Q=m.field,Z=Ne({elementType:Q,externalSlotProps:i==null?void 0:i.field,additionalProps:Y({},_,M&&{id:T},{readOnly:v,disabled:b,className:a,sx:p,format:o,formatDensity:h,enableAccessibleFieldDOMStructure:r,selectedSections:s,onSelectedSectionsChange:l,timezone:u,label:f,name:c,autoFocus:A&&!e.open,focused:$?!0:void 0},g?{inputRef:g}:{}),ownerState:e});C&&(Z.InputProps=Y({},Z.InputProps,{ref:y},!e.disableOpenPicker&&{[`${P.position}Adornment`]:ee.jsx(O,Y({},P,{children:ee.jsx(H,Y({},W,{children:ee.jsx(z,Y({},j))}))}))}));const q=Y({textField:m.textField,clearIcon:m.clearIcon,clearButton:m.clearButton},Z.slots),ne=m.layout??na;let se=T;M&&(f?se=`${T}-label`:se=void 0);const pe=Y({},i,{toolbar:Y({},i==null?void 0:i.toolbar,{titleId:T}),popper:Y({"aria-labelledby":se},i==null?void 0:i.popper)}),ie=ht(E,Z.unstableFieldRef);return{renderPicker:()=>ee.jsxs(Ro,{contextValue:F,localeText:x,children:[ee.jsx(Q,Y({},Z,{slots:q,slotProps:pe,unstableFieldRef:ie})),ee.jsx(mf,Y({role:"dialog",placement:"bottom-start",anchorEl:y.current},L,{open:$,slots:m,slotProps:pe,shouldRestoreFocus:k,reduceAnimations:D,children:ee.jsx(ne,Y({},w,pe==null?void 0:pe.layout,{slots:m,slotProps:pe,children:S()}))}))]})}},_n=({view:d,onViewChange:e,views:t,focusedView:n,onFocusedViewChange:m,value:i,defaultValue:a,referenceDate:p,onChange:o,className:h,classes:r,disableFuture:s,disablePast:l,minDate:u,maxDate:c,shouldDisableDate:f,shouldDisableMonth:g,shouldDisableYear:v,reduceAnimations:b,onMonthChange:A,monthsPerRow:x,onYearChange:D,yearsOrder:y,yearsPerRow:E,slots:T,slotProps:M,loading:$,renderLoading:L,disableHighlightToday:C,readOnly:w,disabled:S,showDaysOutsideCurrentMonth:k,dayOfWeekFormatter:_,sx:F,autoFocus:R,fixedWeekNumber:O,displayWeekNumber:V,timezone:P})=>ee.jsx(Jp,{view:d,onViewChange:e,views:t.filter(ds),focusedView:n&&ds(n)?n:null,onFocusedViewChange:m,value:i,defaultValue:a,referenceDate:p,onChange:o,className:h,classes:r,disableFuture:s,disablePast:l,minDate:u,maxDate:c,shouldDisableDate:f,shouldDisableMonth:g,shouldDisableYear:v,reduceAnimations:b,onMonthChange:A,monthsPerRow:x,onYearChange:D,yearsOrder:y,yearsPerRow:E,slots:T,slotProps:M,loading:$,renderLoading:L,disableHighlightToday:C,readOnly:w,disabled:S,showDaysOutsideCurrentMonth:k,dayOfWeekFormatter:_,sx:F,autoFocus:R,fixedWeekNumber:O,displayWeekNumber:V,timezone:P}),ra=J.forwardRef(function(e,t){var h,r;const n=lt(),m=Re(),i=qo(e,"MuiDesktopDatePicker"),a=Y({day:_n,month:_n,year:_n},i.viewRenderers),p=Y({},i,{viewRenderers:a,format:Rr(m,i,!1),yearsPerRow:i.yearsPerRow??4,slots:Y({openPickerIcon:Nc,field:Uo},i.slots),slotProps:Y({},i.slotProps,{field:s=>{var l;return Y({},Oi((l=i.slotProps)==null?void 0:l.field,s),zi(i),{ref:t})},toolbar:Y({hidden:!0},(h=i.slotProps)==null?void 0:h.toolbar)})}),{renderPicker:o}=ia({props:p,valueManager:st,valueType:"date",getOpenDialogAriaText:Ni({utils:m,formatKey:"fullDate",contextTranslation:n.openDatePickerDialogue,propsTranslation:(r=p.localeText)==null?void 0:r.openDatePickerDialogue}),validator:ci});return o()});ra.propTypes={autoFocus:K.bool,className:K.string,closeOnSelect:K.bool,dayOfWeekFormatter:K.func,defaultValue:K.object,disabled:K.bool,disableFuture:K.bool,disableHighlightToday:K.bool,disableOpenPicker:K.bool,disablePast:K.bool,displayWeekNumber:K.bool,enableAccessibleFieldDOMStructure:K.any,fixedWeekNumber:K.number,format:K.string,formatDensity:K.oneOf(["dense","spacious"]),inputRef:Pi,label:K.node,loading:K.bool,localeText:K.object,maxDate:K.object,minDate:K.object,monthsPerRow:K.oneOf([3,4]),name:K.string,onAccept:K.func,onChange:K.func,onClose:K.func,onError:K.func,onMonthChange:K.func,onOpen:K.func,onSelectedSectionsChange:K.func,onViewChange:K.func,onYearChange:K.func,open:K.bool,openTo:K.oneOf(["day","month","year"]),orientation:K.oneOf(["landscape","portrait"]),readOnly:K.bool,reduceAnimations:K.bool,referenceDate:K.object,renderLoading:K.func,selectedSections:K.oneOfType([K.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),K.number]),shouldDisableDate:K.func,shouldDisableMonth:K.func,shouldDisableYear:K.func,showDaysOutsideCurrentMonth:K.bool,slotProps:K.object,slots:K.object,sx:K.oneOfType([K.arrayOf(K.oneOfType([K.func,K.object,K.bool])),K.func,K.object]),timezone:K.string,value:K.object,view:K.oneOf(["day","month","year"]),viewRenderers:K.shape({day:K.func,month:K.func,year:K.func}),views:K.arrayOf(K.oneOf(["day","month","year"]).isRequired),yearsOrder:K.oneOf(["asc","desc"]),yearsPerRow:K.oneOf([3,4])};const Vf=ge(Bl)({[`& .${is.container}`]:{outline:0},[`& .${is.paper}`]:{outline:0,minWidth:Vi}}),Wf=ge(Vl)({"&:first-of-type":{padding:0}});function Hf(d){const{children:e,onDismiss:t,open:n,slots:m,slotProps:i}=d,a=(m==null?void 0:m.dialog)??Vf,p=(m==null?void 0:m.mobileTransition)??Ri;return ee.jsx(a,Y({open:n,onClose:t},i==null?void 0:i.dialog,{TransitionComponent:p,TransitionProps:i==null?void 0:i.mobileTransition,PaperComponent:m==null?void 0:m.mobilePaper,PaperProps:i==null?void 0:i.mobilePaper,children:ee.jsx(Wf,{children:e})}))}const jf=["props","getOpenDialogAriaText"],sa=d=>{var P;let{props:e,getOpenDialogAriaText:t}=d,n=Se(d,jf);const{slots:m,slotProps:i,className:a,sx:p,format:o,formatDensity:h,enableAccessibleFieldDOMStructure:r,selectedSections:s,onSelectedSectionsChange:l,timezone:u,name:c,label:f,inputRef:g,readOnly:v,disabled:b,localeText:A}=e,x=J.useRef(null),D=Rn(),y=((P=i==null?void 0:i.toolbar)==null?void 0:P.hidden)??!1,{open:E,actions:T,layoutProps:M,renderCurrentView:$,fieldProps:L,contextValue:C}=ea(Y({},n,{props:e,fieldRef:x,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),w=m.field,S=Ne({elementType:w,externalSlotProps:i==null?void 0:i.field,additionalProps:Y({},L,y&&{id:D},!(b||v)&&{onClick:T.onOpen,onKeyDown:th(T.onOpen)},{readOnly:v??!0,disabled:b,className:a,sx:p,format:o,formatDensity:h,enableAccessibleFieldDOMStructure:r,selectedSections:s,onSelectedSectionsChange:l,timezone:u,label:f,name:c},g?{inputRef:g}:{}),ownerState:e});S.inputProps=Y({},S.inputProps,{"aria-label":t(L.value)});const k=Y({textField:m.textField},S.slots),_=m.layout??na;let F=D;y&&(f?F=`${D}-label`:F=void 0);const R=Y({},i,{toolbar:Y({},i==null?void 0:i.toolbar,{titleId:D}),mobilePaper:Y({"aria-labelledby":F},i==null?void 0:i.mobilePaper)}),O=ht(x,S.unstableFieldRef);return{renderPicker:()=>ee.jsxs(Ro,{contextValue:C,localeText:A,children:[ee.jsx(w,Y({},S,{slots:k,slotProps:R,unstableFieldRef:O})),ee.jsx(Hf,Y({},T,{open:E,slots:m,slotProps:R,children:ee.jsx(_,Y({},M,R==null?void 0:R.layout,{slots:m,slotProps:R,children:$()}))}))]})}},oa=J.forwardRef(function(e,t){var h,r;const n=lt(),m=Re(),i=qo(e,"MuiMobileDatePicker"),a=Y({day:_n,month:_n,year:_n},i.viewRenderers),p=Y({},i,{viewRenderers:a,format:Rr(m,i,!1),slots:Y({field:Uo},i.slots),slotProps:Y({},i.slotProps,{field:s=>{var l;return Y({},Oi((l=i.slotProps)==null?void 0:l.field,s),zi(i),{ref:t})},toolbar:Y({hidden:!1},(h=i.slotProps)==null?void 0:h.toolbar)})}),{renderPicker:o}=sa({props:p,valueManager:st,valueType:"date",getOpenDialogAriaText:Ni({utils:m,formatKey:"fullDate",contextTranslation:n.openDatePickerDialogue,propsTranslation:(r=p.localeText)==null?void 0:r.openDatePickerDialogue}),validator:ci});return o()});oa.propTypes={autoFocus:K.bool,className:K.string,closeOnSelect:K.bool,dayOfWeekFormatter:K.func,defaultValue:K.object,disabled:K.bool,disableFuture:K.bool,disableHighlightToday:K.bool,disableOpenPicker:K.bool,disablePast:K.bool,displayWeekNumber:K.bool,enableAccessibleFieldDOMStructure:K.any,fixedWeekNumber:K.number,format:K.string,formatDensity:K.oneOf(["dense","spacious"]),inputRef:Pi,label:K.node,loading:K.bool,localeText:K.object,maxDate:K.object,minDate:K.object,monthsPerRow:K.oneOf([3,4]),name:K.string,onAccept:K.func,onChange:K.func,onClose:K.func,onError:K.func,onMonthChange:K.func,onOpen:K.func,onSelectedSectionsChange:K.func,onViewChange:K.func,onYearChange:K.func,open:K.bool,openTo:K.oneOf(["day","month","year"]),orientation:K.oneOf(["landscape","portrait"]),readOnly:K.bool,reduceAnimations:K.bool,referenceDate:K.object,renderLoading:K.func,selectedSections:K.oneOfType([K.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),K.number]),shouldDisableDate:K.func,shouldDisableMonth:K.func,shouldDisableYear:K.func,showDaysOutsideCurrentMonth:K.bool,slotProps:K.object,slots:K.object,sx:K.oneOfType([K.arrayOf(K.oneOfType([K.func,K.object,K.bool])),K.func,K.object]),timezone:K.string,value:K.object,view:K.oneOf(["day","month","year"]),viewRenderers:K.shape({day:K.func,month:K.func,year:K.func}),views:K.arrayOf(K.oneOf(["day","month","year"]).isRequired),yearsOrder:K.oneOf(["asc","desc"]),yearsPerRow:K.oneOf([3,4])};const zf=["desktopModeMediaQuery"],Uf=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiDatePicker"}),{desktopModeMediaQuery:m=To}=n,i=Se(n,zf);return Ar(m,{defaultMatches:!0})?ee.jsx(ra,Y({ref:t},i)):ee.jsx(oa,Y({ref:t},i))});function Gf(d){return We("MuiPickersToolbarText",d)}const As=He("MuiPickersToolbarText",["root","selected"]),Kf=["className","selected","value"],Yf=d=>{const{classes:e,selected:t}=d;return Oe({root:["root",t&&"selected"]},Gf,e)},Jf=ge(Xt,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(d,e)=>[e.root,{[`&.${As.selected}`]:e.selected}]})(({theme:d})=>({transition:d.transitions.create("color"),color:(d.vars||d).palette.text.secondary,[`&.${As.selected}`]:{color:(d.vars||d).palette.text.primary}})),aa=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiPickersToolbarText"}),{className:m,value:i}=n,a=Se(n,Kf),p=Yf(n);return ee.jsx(Jf,Y({ref:t,className:je(p.root,m),component:"span"},a,{children:i}))}),Qf=["align","className","selected","typographyClassName","value","variant","width"],Zf=d=>{const{classes:e}=d;return Oe({root:["root"]},Zo,e)},Xf=ge(Yn,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(d,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),Kn=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiPickersToolbarButton"}),{align:m,className:i,selected:a,typographyClassName:p,value:o,variant:h,width:r}=n,s=Se(n,Qf),l=Zf(n);return ee.jsx(Xf,Y({variant:"text",ref:t,className:je(l.root,i)},r?{sx:{width:r}}:{},s,{children:ee.jsx(aa,{align:m,className:p,variant:h,value:o,selected:a})}))});function qf(d){return We("MuiTimePickerToolbar",d)}const Xn=He("MuiTimePickerToolbar",["root","separator","hourMinuteLabel","hourMinuteLabelLandscape","hourMinuteLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),em=["ampm","ampmInClock","value","isLandscape","onChange","view","onViewChange","views","disabled","readOnly","className"],tm=d=>{const{isLandscape:e,classes:t,isRtl:n}=d;return Oe({root:["root"],separator:["separator"],hourMinuteLabel:["hourMinuteLabel",e&&"hourMinuteLabelLandscape",n&&"hourMinuteLabelReverse"],ampmSelection:["ampmSelection",e&&"ampmLandscape"],ampmLabel:["ampmLabel"]},qf,t)},nm=ge(Xo,{name:"MuiTimePickerToolbar",slot:"Root",overridesResolver:(d,e)=>e.root})({}),im=ge(aa,{name:"MuiTimePickerToolbar",slot:"Separator",overridesResolver:(d,e)=>e.separator})({outline:0,margin:"0 4px 0 2px",cursor:"default"}),rm=ge("div",{name:"MuiTimePickerToolbar",slot:"HourMinuteLabel",overridesResolver:(d,e)=>[{[`&.${Xn.hourMinuteLabelLandscape}`]:e.hourMinuteLabelLandscape,[`&.${Xn.hourMinuteLabelReverse}`]:e.hourMinuteLabelReverse},e.hourMinuteLabel]})({display:"flex",justifyContent:"flex-end",alignItems:"flex-end",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{isLandscape:!0},style:{marginTop:"auto"}}]}),sm=ge("div",{name:"MuiTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(d,e)=>[{[`.${Xn.ampmLabel}`]:e.ampmLabel},{[`&.${Xn.ampmLandscape}`]:e.ampmLandscape},e.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${Xn.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",flexBasis:"100%"}}]});function om(d){const e=Le({props:d,name:"MuiTimePickerToolbar"}),{ampm:t,ampmInClock:n,value:m,isLandscape:i,onChange:a,view:p,onViewChange:o,views:h,disabled:r,readOnly:s,className:l}=e,u=Se(e,em),c=Re(),f=lt(),g=Mt(),v=!!(t&&!n&&h.includes("hours")),{meridiemMode:b,handleMeridiemChange:A}=_r(m,t,a),x=T=>t?c.format(T,"hours12h"):c.format(T,"hours24h"),D=Y({},e,{isRtl:g}),y=tm(D),E=ee.jsx(im,{tabIndex:-1,value:":",variant:"h3",selected:!1,className:y.separator});return ee.jsxs(nm,Y({landscapeDirection:"row",toolbarTitle:f.timePickerToolbarTitle,isLandscape:i,ownerState:D,className:je(y.root,l)},u,{children:[ee.jsxs(rm,{className:y.hourMinuteLabel,ownerState:D,children:[An(h,"hours")&&ee.jsx(Kn,{tabIndex:-1,variant:"h3",onClick:()=>o("hours"),selected:p==="hours",value:m?x(m):"--"}),An(h,["hours","minutes"])&&E,An(h,"minutes")&&ee.jsx(Kn,{tabIndex:-1,variant:"h3",onClick:()=>o("minutes"),selected:p==="minutes",value:m?c.format(m,"minutes"):"--"}),An(h,["minutes","seconds"])&&E,An(h,"seconds")&&ee.jsx(Kn,{variant:"h3",onClick:()=>o("seconds"),selected:p==="seconds",value:m?c.format(m,"seconds"):"--"})]}),v&&ee.jsxs(sm,{className:y.ampmSelection,ownerState:D,children:[ee.jsx(Kn,{disableRipple:!0,variant:"subtitle2",selected:b==="am",typographyClassName:y.ampmLabel,value:Jt(c,"am"),onClick:s?void 0:()=>A("am"),disabled:r}),ee.jsx(Kn,{disableRipple:!0,variant:"subtitle2",selected:b==="pm",typographyClassName:y.ampmLabel,value:Jt(c,"pm"),onClick:s?void 0:()=>A("pm"),disabled:r})]})]}))}function la(d,e){var a;const t=Re(),n=Le({props:d,name:e}),m=n.ampm??t.is12HourCycleInCurrentLocale(),i=J.useMemo(()=>{var p;return((p=n.localeText)==null?void 0:p.toolbarTitle)==null?n.localeText:Y({},n.localeText,{timePickerToolbarTitle:n.localeText.toolbarTitle})},[n.localeText]);return Y({},n,{ampm:m,localeText:i},ho({views:n.views,openTo:n.openTo,defaultViews:["hours","minutes"],defaultOpenTo:"hours"}),{disableFuture:n.disableFuture??!1,disablePast:n.disablePast??!1,slots:Y({toolbar:om},n.slots),slotProps:Y({},n.slotProps,{toolbar:Y({ampm:m,ampmInClock:n.ampmInClock},(a=n.slotProps)==null?void 0:a.toolbar)})})}const lr=({view:d,onViewChange:e,focusedView:t,onFocusedViewChange:n,views:m,value:i,defaultValue:a,referenceDate:p,onChange:o,className:h,classes:r,disableFuture:s,disablePast:l,minTime:u,maxTime:c,shouldDisableTime:f,minutesStep:g,ampm:v,ampmInClock:b,slots:A,slotProps:x,readOnly:D,disabled:y,sx:E,autoFocus:T,showViewSwitcher:M,disableIgnoringDatePartForTimeValidation:$,timezone:L})=>ee.jsx(qu,{view:d,onViewChange:e,focusedView:t&&ei(t)?t:null,onFocusedViewChange:n,views:m.filter(ei),value:i,defaultValue:a,referenceDate:p,onChange:o,className:h,classes:r,disableFuture:s,disablePast:l,minTime:u,maxTime:c,shouldDisableTime:f,minutesStep:g,ampm:v,ampmInClock:b,slots:A,slotProps:x,readOnly:D,disabled:y,sx:E,autoFocus:T,showViewSwitcher:M,disableIgnoringDatePartForTimeValidation:$,timezone:L}),am=({view:d,onViewChange:e,focusedView:t,onFocusedViewChange:n,views:m,value:i,defaultValue:a,referenceDate:p,onChange:o,className:h,classes:r,disableFuture:s,disablePast:l,minTime:u,maxTime:c,shouldDisableTime:f,minutesStep:g,ampm:v,slots:b,slotProps:A,readOnly:x,disabled:D,sx:y,autoFocus:E,disableIgnoringDatePartForTimeValidation:T,timeSteps:M,skipDisabled:$,timezone:L})=>ee.jsx(ah,{view:d,onViewChange:e,focusedView:t,onFocusedViewChange:n,views:m.filter(ei),value:i,defaultValue:a,referenceDate:p,onChange:o,className:h,classes:r,disableFuture:s,disablePast:l,minTime:u,maxTime:c,shouldDisableTime:f,minutesStep:g,ampm:v,slots:b,slotProps:A,readOnly:x,disabled:D,sx:y,autoFocus:E,disableIgnoringDatePartForTimeValidation:T,timeStep:M==null?void 0:M.minutes,skipDisabled:$,timezone:L}),Ts=({view:d,onViewChange:e,focusedView:t,onFocusedViewChange:n,views:m,value:i,defaultValue:a,referenceDate:p,onChange:o,className:h,classes:r,disableFuture:s,disablePast:l,minTime:u,maxTime:c,shouldDisableTime:f,minutesStep:g,ampm:v,slots:b,slotProps:A,readOnly:x,disabled:D,sx:y,autoFocus:E,disableIgnoringDatePartForTimeValidation:T,timeSteps:M,skipDisabled:$,timezone:L})=>ee.jsx(bh,{view:d,onViewChange:e,focusedView:t,onFocusedViewChange:n,views:m.filter(ei),value:i,defaultValue:a,referenceDate:p,onChange:o,className:h,classes:r,disableFuture:s,disablePast:l,minTime:u,maxTime:c,shouldDisableTime:f,minutesStep:g,ampm:v,slots:b,slotProps:A,readOnly:x,disabled:D,sx:y,autoFocus:E,disableIgnoringDatePartForTimeValidation:T,timeSteps:M,skipDisabled:$,timezone:L}),lm=(d,e,t)=>t?e.filter(n=>!Yc(n)||n==="hours"):d?[...e,"meridiem"]:e,cm=(d,e)=>24*60/((d.hours??1)*(d.minutes??5))<=e;function um({thresholdToRenderTimeInASingleColumn:d,ampm:e,timeSteps:t,views:n}){const m=d??24,i=Y({hours:1,minutes:5,seconds:5},t),a=cm(i,m);return{thresholdToRenderTimeInASingleColumn:m,timeSteps:i,shouldRenderTimeInASingleColumn:a,views:lm(e,n,a)}}const ca=J.forwardRef(function(e,t){var v,b,A,x;const n=lt(),m=Re(),i=la(e,"MuiDesktopTimePicker"),{shouldRenderTimeInASingleColumn:a,views:p,timeSteps:o}=um(i),h=a?am:Ts,r=Y({hours:h,minutes:h,seconds:h,meridiem:h},i.viewRenderers),s=i.ampmInClock??!0,l=a?[]:["accept"],c=((v=r.hours)==null?void 0:v.name)===Ts.name?p:p.filter(D=>D!=="meridiem"),f=Y({},i,{ampmInClock:s,timeSteps:o,viewRenderers:r,format:fo(m,i),views:a?["hours"]:c,slots:Y({field:Go,openPickerIcon:Bc},i.slots),slotProps:Y({},i.slotProps,{field:D=>{var y;return Y({},Oi((y=i.slotProps)==null?void 0:y.field,D),zi(i),{ref:t})},toolbar:Y({hidden:!0,ampmInClock:s},(b=i.slotProps)==null?void 0:b.toolbar),actionBar:Y({actions:l},(A=i.slotProps)==null?void 0:A.actionBar)})}),{renderPicker:g}=ia({props:f,valueManager:st,valueType:"time",getOpenDialogAriaText:Ni({utils:m,formatKey:"fullTime",contextTranslation:n.openTimePickerDialogue,propsTranslation:(x=f.localeText)==null?void 0:x.openTimePickerDialogue}),validator:ji});return g()});ca.propTypes={ampm:K.bool,ampmInClock:K.bool,autoFocus:K.bool,className:K.string,closeOnSelect:K.bool,defaultValue:K.object,disabled:K.bool,disableFuture:K.bool,disableIgnoringDatePartForTimeValidation:K.bool,disableOpenPicker:K.bool,disablePast:K.bool,enableAccessibleFieldDOMStructure:K.any,format:K.string,formatDensity:K.oneOf(["dense","spacious"]),inputRef:Pi,label:K.node,localeText:K.object,maxTime:K.object,minTime:K.object,minutesStep:K.number,name:K.string,onAccept:K.func,onChange:K.func,onClose:K.func,onError:K.func,onOpen:K.func,onSelectedSectionsChange:K.func,onViewChange:K.func,open:K.bool,openTo:K.oneOf(["hours","meridiem","minutes","seconds"]),orientation:K.oneOf(["landscape","portrait"]),readOnly:K.bool,reduceAnimations:K.bool,referenceDate:K.object,selectedSections:K.oneOfType([K.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),K.number]),shouldDisableTime:K.func,skipDisabled:K.bool,slotProps:K.object,slots:K.object,sx:K.oneOfType([K.arrayOf(K.oneOfType([K.func,K.object,K.bool])),K.func,K.object]),thresholdToRenderTimeInASingleColumn:K.number,timeSteps:K.shape({hours:K.number,minutes:K.number,seconds:K.number}),timezone:K.string,value:K.object,view:K.oneOf(["hours","meridiem","minutes","seconds"]),viewRenderers:K.shape({hours:K.func,meridiem:K.func,minutes:K.func,seconds:K.func}),views:K.arrayOf(K.oneOf(["hours","minutes","seconds"]).isRequired)};const ua=J.forwardRef(function(e,t){var r,s;const n=lt(),m=Re(),i=la(e,"MuiMobileTimePicker"),a=Y({hours:lr,minutes:lr,seconds:lr},i.viewRenderers),p=i.ampmInClock??!1,o=Y({},i,{ampmInClock:p,viewRenderers:a,format:fo(m,i),slots:Y({field:Go},i.slots),slotProps:Y({},i.slotProps,{field:l=>{var u;return Y({},Oi((u=i.slotProps)==null?void 0:u.field,l),zi(i),{ref:t})},toolbar:Y({hidden:!1,ampmInClock:p},(r=i.slotProps)==null?void 0:r.toolbar)})}),{renderPicker:h}=sa({props:o,valueManager:st,valueType:"time",getOpenDialogAriaText:Ni({utils:m,formatKey:"fullTime",contextTranslation:n.openTimePickerDialogue,propsTranslation:(s=o.localeText)==null?void 0:s.openTimePickerDialogue}),validator:ji});return h()});ua.propTypes={ampm:K.bool,ampmInClock:K.bool,autoFocus:K.bool,className:K.string,closeOnSelect:K.bool,defaultValue:K.object,disabled:K.bool,disableFuture:K.bool,disableIgnoringDatePartForTimeValidation:K.bool,disableOpenPicker:K.bool,disablePast:K.bool,enableAccessibleFieldDOMStructure:K.any,format:K.string,formatDensity:K.oneOf(["dense","spacious"]),inputRef:Pi,label:K.node,localeText:K.object,maxTime:K.object,minTime:K.object,minutesStep:K.number,name:K.string,onAccept:K.func,onChange:K.func,onClose:K.func,onError:K.func,onOpen:K.func,onSelectedSectionsChange:K.func,onViewChange:K.func,open:K.bool,openTo:K.oneOf(["hours","minutes","seconds"]),orientation:K.oneOf(["landscape","portrait"]),readOnly:K.bool,reduceAnimations:K.bool,referenceDate:K.object,selectedSections:K.oneOfType([K.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),K.number]),shouldDisableTime:K.func,slotProps:K.object,slots:K.object,sx:K.oneOfType([K.arrayOf(K.oneOfType([K.func,K.object,K.bool])),K.func,K.object]),timezone:K.string,value:K.object,view:K.oneOf(["hours","minutes","seconds"]),viewRenderers:K.shape({hours:K.func,minutes:K.func,seconds:K.func}),views:K.arrayOf(K.oneOf(["hours","minutes","seconds"]).isRequired)};const hm=["desktopModeMediaQuery"],dm=J.forwardRef(function(e,t){const n=Le({props:e,name:"MuiTimePicker"}),{desktopModeMediaQuery:m=To}=n,i=Se(n,hm);return Ar(m,{defaultMatches:!0})?ee.jsx(ca,Y({ref:t},i)):ee.jsx(ua,Y({ref:t},i))});class pm extends X{componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr);this.setState({value:e})}renderItem(e,t){return I.createElement(Uf,{sx:n=>({width:"100%",borderBottom:`1px solid ${n.palette.text.primary}`,"& fieldset":{display:"none"},"& input":{padding:`${n.spacing(1.5)} 0 4px 0`},"& .MuiInputAdornment-root":{marginLeft:0,marginTop:1},"& label":{transform:"translate(0px, -9px) scale(0.75)"}}),format:this.props.oContext.systemConfig.dateFormat.toLowerCase().replace("mm","MM"),disabled:!!t,value:this.state.value,onChange:n=>{this.setState({value:n},()=>this.onChange(this.props.attr,this.state.value))},label:this.getText(this.props.schema.label)})}}class fm extends X{renderItem(){if(!this.props.schema)return null;if(this.props.oContext.DeviceManager){const t=this.props.oContext.DeviceManager;return I.createElement(t,{uploadImagesToInstance:`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,title:this.getText(this.props.schema.label),socket:this.props.oContext.socket,selectedInstance:`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,themeName:this.props.themeName,theme:this.props.oContext.theme,themeType:this.props.oContext.themeType,isFloatComma:this.props.oContext.isFloatComma,dateFormat:this.props.oContext.dateFormat})}return I.createElement("div",null,"DeviceManager not found")}}const At={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}},mm=["jpg","jpeg","svg","png","webp","gif","apng","avif","webp"],gm=["mp3","ogg","wav","aac"],vm=["avi","mp4","mov"],ym=["txt","log","html","htm"],bm=["json","js","ts"];class Gi extends X{dropzoneRef;imagePrefix;objectID;path;constructor(e){super(e),this.dropzoneRef=I.createRef(),this.imagePrefix=this.props.oContext.imagePrefix===void 0?"./files":this.props.oContext.imagePrefix}componentDidMount(){super.componentDidMount(),this.objectID=(this.props.schema.objectID||"0_userdata.0").replace("%INSTANCE%",(this.props.oContext.instance||0).toString()),this.path=this.props.schema.upload,this.path&&(this.path==="/"?this.path="":this.path.endsWith("/")||(this.path=`${this.path}/`)),this.updateFiles().then(()=>{const e=X.getValue(this.props.data,this.props.attr);this.setState({value:e}),this.props.oContext.socket.subscribeFiles(this.objectID,`${this.path}/*`,this.onFolderChanged).catch(t=>console.error(`Cannot subscribe: ${t}`))})}onFolderChanged=(e,t)=>{this.path&&t.startsWith(this.path)&&this.updateFiles().catch(n=>console.error(`Cannot update files: ${n}`))};componentWillUnmount(){this.props.oContext.socket.subscribeFiles(this.objectID,`${this.path}/*`,this.onFolderChanged).catch(e=>console.error(`Cannot subscribe: ${e}`)),super.componentWillUnmount()}async updateFiles(){const e=await this.readFiles(this.props.schema.pattern);await new Promise(t=>this.setState({files:e},t))}async readFolder(e,t,n){try{const m=await this.props.oContext.socket.readDir(this.objectID,e.replace(/^\//,"")||null);for(let i=0;i<m.length;i++){const a=m[i];if(a.isDir)await this.readFolder(`${e+a.file}/`,t,n);else{let p=!1;n==="*.*"&&a.file.includes(".")||!n||n==="*"||n===".*"&&a.file.startsWith(".")?p=!0:p=new RegExp(`^${n.replace(/\./g,"\\.").replace(/\*/g,".*")}$`).test(a.file),p&&t.push({name:e+a.file,size:a.stats?G.Utils.formatBytes(a.stats.size):"--"})}}}catch(m){console.error(`Cannot read "${e}": ${m}`)}return t}async readFiles(e){const t=[];e=e||this.props.schema.pattern,e||(e="**/*.*");let n;const m=e.lastIndexOf("/");if(m===-1?n=e:n=e.substring(m+1),e.startsWith("**"))await this.readFolder("/",t,n);else{const i=e.lastIndexOf("/");if(i===-1)await this.readFolder("/",t,n);else{const a=e.substring(0,i+1);await this.readFolder(a,t,n)}}return t}onDrop(e){const t=e[0],n=new FileReader,m=this.props.schema.maxSize||2*1024*1024;n.onabort=()=>console.log("file reading was aborted"),n.onerror=()=>console.log("file reading has failed"),n.onload=()=>{if(t.size>m){window.alert(G.I18n.t("File is too big. Max %sk allowed. Try use SVG.",Math.round(m/1024)));return}this.props.oContext.socket.writeFile64(this.objectID,this.path+t.name,n.result).then(()=>this.updateFiles()).then(()=>this.setState({value:this.path+t.name},()=>this.onChange(this.props.attr,this.path+t.name))).catch(i=>window.alert(`Cannot upload file: ${i}`))},n.readAsArrayBuffer(t)}renderDeleteDialog(){return this.state.deleteFile?I.createElement(G.DialogConfirm,{title:G.I18n.t("ra_Are you sure?"),text:G.I18n.t("ra_File will be deleted"),ok:G.I18n.t("ra_Delete"),cancel:G.I18n.t("ra_Cancel"),onClose:e=>{const t=this.state.deleteFile;this.setState({deleteFile:""},()=>{e&&this.props.oContext.socket.deleteFile(this.objectID,t).then(()=>this.updateFiles()).catch(n=>window.alert(`Cannot delete file: ${n}`))})}}):null}static base64ToArrayBuffer(e){const t=window.atob(e),n=t.length,m=new Uint8Array(n);for(let i=0;i<n;i++)m[i]=t.charCodeAt(i);return m.buffer}loadFile(){return this.props.oContext.socket.readFile(this.objectID,this.state.value,!0)}play(){this.loadFile().then(e=>{if(typeof AudioContext<"u"){const t=new AudioContext,n=Gi.base64ToArrayBuffer(e.file);t.decodeAudioData(n,m=>{const i=t.createBufferSource();i.buffer=m,i.connect(t.destination),i.start(0)},m=>window.alert(`Cannot play: ${m.message}`))}})}getFileIcon(e){return e!=null&&e.extension?mm.includes(e.extension)?I.createElement("div",{style:{...At.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.objectID}/${e.value})`,backgroundSize:"contain",backgroundRepeat:"no-repeat"}}):gm.includes(e.extension)?I.createElement(oe.MusicNote,null):ym.includes(e.extension)?I.createElement(oe.Article,null):vm.includes(e.extension)?I.createElement(oe.Videocam,null):bm.includes(e.extension)?I.createElement(oe.Code,null):null:null}renderItem(e,t){if(!this.state.files)return null;const n=[];this.props.schema.withFolder||this.state.files.forEach(r=>{const s=r.name.lastIndexOf("/");if(s===-1)n.includes("/")||n.push("/");else{const l=r.name.substring(0,s+1);n.includes(l)||n.push(l)}});const m=this.state.files.map(r=>({value:r.name,label:!this.props.schema.withFolder&&n.length===1?`${r.name.substring(n[0].length)}`:`${r.name}${this.props.schema.noSize?"":`(${r.size})`}`,extension:r.name.toLowerCase().split(".").pop()}));this.props.schema.noNone||m.unshift({label:G.I18n.t("ra_none"),value:""});const i=m.find(r=>r.value===this.state.value);let a=0;this.props.schema.upload&&a++,this.props.schema.refresh&&a++;const p=this.state.value&&(this.state.value.endsWith(".mp3")||this.state.value.endsWith(".ogg")||this.state.value.endsWith(".wav"));p&&a++;const o=I.createElement("div",{style:At.fullWidth},I.createElement(B.FormControl,{variant:"standard",style:{width:`calc(100% - ${a*42}px)`}},this.props.schema.label?I.createElement(B.InputLabel,null,this.getText(this.props.schema.label)):null,I.createElement(B.Select,{variant:"standard",error:!!e,disabled:!!t,value:this.state.value||"_",renderValue:()=>I.createElement(I.Fragment,null,this.getFileIcon(i),I.createElement("span",null,(i==null?void 0:i.label)||"")),onChange:r=>{this.setState({value:r.target.value==="_"?"":r.target.value},()=>this.onChange(this.props.attr,this.state.value))}},m.map(r=>I.createElement(B.MenuItem,{key:r.value,value:r.value},I.createElement(B.ListItemIcon,null,this.getFileIcon(r)),I.createElement(B.ListItemText,null,r.label),this.props.schema.delete&&i.value?I.createElement(B.IconButton,{style:At.deleteButton,size:"small",onClick:()=>this.setState({deleteFile:i.value})},I.createElement(oe.Delete,null)):null))),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null),this.props.schema.refresh&&I.createElement(B.IconButton,{onClick:()=>this.updateFiles()},I.createElement(oe.Refresh,null)),this.props.schema.upload&&I.createElement(B.IconButton,{onClick:()=>{var r;return(r=this.dropzoneRef.current)==null?void 0:r.open()}},I.createElement(oe.UploadFile,null)),p&&I.createElement(B.IconButton,{style:{color:"#00FF00"},onClick:()=>this.play()},I.createElement(oe.PlayArrow,null)));if(!this.props.schema.upload)return I.createElement(I.Fragment,null,o,this.renderDeleteDialog());let h={"*/*":[]};if(this.props.schema.fileTypes==="image"?h={"image/*":[".png",".jpg",".svg",".gif",".apng",".avif",".webp"]}:this.props.schema.fileTypes==="audio"?h={"audio/*":[".mp3",".ogg",".wav",".mp4"]}:this.props.schema.fileTypes==="text"&&(h={"text/plain":[".txt"]}),this.props.schema.pattern){const r=this.props.schema.pattern.split("/").pop().toLowerCase().replace(/.*\./,"");r==="png"||r==="jpg"||r==="svg"||r==="gif"||r==="apng"||r==="avif"||r==="webp"?h={"image/*":[".png",".jpg",".svg",".gif",".apng",".avif",".webp"]}:r==="mp3"||r==="ogg"||r==="wav"?h={"audio/*":[".mp3",".ogg",".wav",".mp4"]}:r==="ics"?h={"text/calendar":[".ics"]}:r==="txt"?h={"text/plain":[".txt"]}:r==="pem"?h={"text/plain":[".pem"]}:h={"*/*":[`.${r}`]}}return I.createElement(qs,{ref:this.dropzoneRef,multiple:!1,accept:h,noKeyboard:!0,noClick:!0,maxSize:this.props.schema.maxSize||2*1024*1024,onDragEnter:()=>{this.setState({uploadFile:"dragging"})},onDragLeave:()=>this.setState({uploadFile:!0}),onDrop:(r,s)=>{var l,u,c;this.setState({uploadFile:!1}),r.length?this.onDrop(r):window.alert(((c=(u=(l=s==null?void 0:s[0])==null?void 0:l.errors)==null?void 0:u[0])==null?void 0:c.message)||G.I18n.t("Cannot upload"))}},({getRootProps:r,getInputProps:s})=>I.createElement("div",{style:{...At.uploadDiv,...this.state.uploadFile==="dragging"?At.uploadDivDragging:void 0,...t?At.disabledOpacity:void 0},...r()},I.createElement("input",{...s()}),this.state.uploadFile==="dragging"?I.createElement("div",{style:{...At.uploadCenterDiv,...this.state.uploadError?At.error:void 0}},I.createElement("div",{style:At.uploadCenterTextAndIcon},I.createElement(oe.UploadFile,{style:At.uploadCenterIcon}),I.createElement("div",{style:At.uploadCenterText},this.state.uploadFile==="dragging"?G.I18n.t("ra_Drop file here"):G.I18n.t("ra_Place your files here or click here to open the browse dialog")))):null,o,this.renderDeleteDialog()))}}const Ci={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}},wm=["jpg","jpeg","svg","png","webp","gif","apng","avif","webp"],Cm=["mp3","ogg","wav","aac"],Dm=["avi","mp4","mov"],Sm=["txt","log","html","htm"],xm=["json","js","ts"];class Em extends X{imagePrefix="../..";componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr);this.imagePrefix=this.props.oContext.imagePrefix===void 0?"./files":this.props.oContext.imagePrefix,this.setState({value:e??""})}static getDerivedStateFromProps(e,t){const n=X.getValue(e.data,e.attr);return n==null||n.toString().trim()!==(t.value||"").toString().trim()?{value:n??""}:null}loadFile(){const e=this.state.value.indexOf("/");if(e!==-1){const t=this.state.value.substring(0,e),n=this.state.value.substring(e+1);return this.props.oContext.socket.readFile(t,n,!0)}return Promise.resolve(null)}play(){this.loadFile().then(e=>{if(typeof AudioContext<"u"&&(e!=null&&e.file)){const t=new AudioContext,n=Gi.base64ToArrayBuffer(e.file);t.decodeAudioData(n,m=>{const i=t.createBufferSource();i.buffer=m,i.connect(t.destination),i.start(0)},m=>window.alert(`Cannot play: ${m.message}`))}})}getIcon(){const e=this.state.value.split(".").pop().toLowerCase();return wm.includes(e)?I.createElement("div",{style:{...Ci.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.state.value})`,backgroundSize:"contain",backgroundRepeat:"no-repeat"}}):Cm.includes(e)?I.createElement(B.IconButton,{style:{color:"#00FF00"},onClick:()=>this.play()},I.createElement(oe.PlayArrow,null)):Sm.includes(e)?I.createElement(oe.Article,null):Dm.includes(e)?I.createElement(oe.Videocam,null):xm.includes(e)?I.createElement(oe.Code,null):null}renderFileBrowser(){return this.state.showFileBrowser?I.createElement(G.DialogSelectFile,{imagePrefix:this.props.oContext.imagePrefix,socket:this.props.oContext.socket,selected:this.state.value,onClose:()=>this.setState({showFileBrowser:!1}),onOk:e=>{const t=Array.isArray(e)?e[0]:e;this.setState({value:t},()=>this.onChange(this.props.attr,this.props.schema.trim===!1?t:(t||"").trim()))},selectOnlyFolders:this.props.schema.selectOnlyFolders,allowUpload:this.props.schema.allowUpload,allowDownload:this.props.schema.allowDownload,allowCreateFolder:this.props.schema.allowCreateFolder,allowView:this.props.schema.allowView,showToolbar:this.props.schema.showToolbar,limitPath:this.props.schema.limitPath,theme:this.props.oContext.theme}):null}renderItem(e,t){const n=this.getIcon();return I.createElement("div",{style:Ci.fullWidth},n,I.createElement(B.TextField,{variant:"standard",style:n?Ci.fullWidthIcon:Ci.fullWidthOneButton,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!e,disabled:!!t,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:!!this.props.schema.disableEdit}},onChange:m=>{const i=m.target.value;this.setState({value:i},()=>this.onChange(this.props.attr,this.props.schema.trim===!1?i:(i||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}),I.createElement(B.Button,{disabled:t,variant:"outlined",onClick:()=>this.setState({showFileBrowser:!0})},"..."),this.renderFileBrowser())}}class Am extends X{componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums("functions").then(t=>{const n=Object.keys(t).map(m=>({value:this.props.schema.short?m.replace("enum.functions.",""):m,label:this.getText(t[m].common.name),obj:t[m]}));this.props.schema.allowDeactivate!==!1&&n.unshift({label:G.I18n.t(X.NONE_LABEL),value:X.NONE_VALUE}),this.setState({value:e,selectOptions:n})})}renderItem(e,t){if(!this.state.selectOptions)return null;const n=this.state.selectOptions.find(m=>m.value===this.state.value);return I.createElement(B.FormControl,{variant:"standard",fullWidth:!0},this.props.schema.label?I.createElement(B.InputLabel,null,this.getText(this.props.schema.label)):null,I.createElement(B.Select,{variant:"standard",error:!!e,disabled:!!t,value:this.state.value||"_",renderValue:()=>n?n.obj?I.createElement(G.TextWithIcon,{value:n.obj,themeType:this.props.oContext.themeType,lang:G.I18n.getLanguage()}):n.label:"",onChange:m=>{this.setState({value:m.target.value==="_"?"":m.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(m=>I.createElement(B.MenuItem,{key:m.value,value:m.value,style:m.value===X.DIFFERENT_VALUE?{opacity:.5}:{}},m.obj?I.createElement(G.TextWithIcon,{value:m.obj,themeType:this.props.oContext.themeType,lang:G.I18n.getLanguage()}):m.label))),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Tm extends X{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getHostByIp(this.props.common.host).then(e=>{this.props.schema.listenOnAllPorts||(e=e.filter(t=>t.address!=="0.0.0.0"&&t.address!=="::")),this.props.schema.onlyIp4?e=e.filter(t=>t.family==="ipv4"):this.props.schema.onlyIp6&&(e=e.filter(t=>t.family==="ipv6")),this.props.schema.noInternal&&(e=e.filter(t=>!t.internal)),e.forEach(t=>{t.address==="0.0.0.0"?t.name=`[IPv4] 0.0.0.0 - ${G.I18n.t("ra_Listen on all IPs")}`:t.address==="::"&&(t.name=`[IPv6] :: - ${G.I18n.t("ra_Listen on all IPs")}`)}),this.setState({ips:e})}).catch(e=>console.error(e))}renderItem(e,t){var i,a;const n=X.getValue(this.props.data,this.props.attr),m=(i=this.state.ips)==null?void 0:i.find(p=>p.address===n);return I.createElement(B.FormControl,{fullWidth:!0,variant:"standard"},this.state.ips&&this.props.schema.label?I.createElement(B.InputLabel,null,this.getText(this.props.schema.label)):null,this.state.ips?I.createElement(B.Select,{variant:"standard",error:!!e,disabled:!!t,value:n,renderValue:p=>(m==null?void 0:m.name)||p,onChange:p=>this.onChange(this.props.attr,p.target.value)},(a=this.state.ips)==null?void 0:a.map((p,o)=>I.createElement(B.MenuItem,{key:o,value:p.address},p.name))):I.createElement(B.TextField,{fullWidth:!0,variant:"standard",error:!!e,disabled:!!t,value:n,onChange:p=>this.onChange(this.props.attr,p.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class km extends X{initialized=!1;localContext;componentDidMount(){super.componentDidMount(),this.askInstance()}askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const t=this.getPattern(this.props.schema.jsonData,null,!0);if(t)try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${JSON.stringify(e)}`)}}e===void 0&&(e=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",e).then(t=>this.setState({image:t||""}))}}getContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=X.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(){if(this.props.alive){const e=this.getContext();(e!==this.localContext||!this.initialized)&&(this.localContext=e,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}return this.state.image===void 0?null:I.createElement("img",{alt:"dynamic content",src:this.state.image,style:{width:this.props.schema.width||"100%",height:this.props.schema.height}})}}class $m extends X{index;constructor(e){super(e),this.index=Date.now()}componentDidMount(){if(super.componentDidMount(),this.props.schema.base64){const e=X.getValue(this.props.data,this.props.attr);this.setState({value:e})}else this.props.oContext.socket.fileExists(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr).then(e=>e&&this.loadImage())}_getUrl(e){e&&(this.index=Date.now());let t=`files/${this.props.oContext.adapterName}.${this.props.oContext.instance}/${this.props.attr}?t=${this.index}`;return window.location.port==="3000"&&(t=`${window.location.protocol}//${window.location.hostname}:8081/${t}`),t}loadImage(){fetch(this._getUrl()).then(e=>e.blob()).then(e=>{const t=new FileReader;t.onload=()=>{this.setState({value:t.result})},t.readAsDataURL(e)}).catch(e=>console.error(e))}renderItem(e,t){return I.createElement(B.FormControl,{fullWidth:!0,variant:"standard"},this.props.schema.label?I.createElement(B.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,I.createElement(G.UploadImage,{error:!!e,disabled:t,accept:this.props.schema.accept,crop:this.props.schema.crop,maxSize:this.props.schema.maxSize||256*1024,icon:this.state.value||void 0,removeIconFunc:()=>this.setState({value:null},()=>{if(this.props.schema.base64){const n=this.onChange(this.props.attr,this.state.value);n instanceof Promise&&n.catch(m=>console.error(`Cannot set value: ${m}`))}else this.props.oContext.socket.deleteFile(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr).catch(n=>console.error(n))}),onChange:n=>this.setState({value:n},()=>{if(this.props.schema.base64){const m=this.onChange(this.props.attr,this.state.value);m instanceof Promise&&m.catch(i=>console.error(`Cannot set value: ${i}`))}else n.startsWith("data")&&(n=n.split(",")[1]);this.props.oContext.socket.writeFile64(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr,n).catch(m=>console.error(m))})}),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const ks={icon:{width:20,height:20,marginRight:4}};class Mm extends X{componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr);let t=this.props.schema.adapter;t==="_dataSources"&&(t=void 0),this.props.oContext.socket.getAdapterInstances(t,!0).then(async n=>{this.props.schema.adapter==="_dataSources"?n=n.filter(i=>{var a;return(a=i==null?void 0:i.common)==null?void 0:a.getHistory}):this.props.schema.adapter?n=n.filter(i=>i==null?void 0:i._id.startsWith(`system.adapter.${this.props.schema.adapter}.`)):this.props.schema.adapters&&Array.isArray(this.props.schema.adapters)&&(n=n.filter(i=>{var a;return this.props.schema.adapters.includes((a=i==null?void 0:i.common)==null?void 0:a.name)})),this.props.schema.onlyEnabled&&(n=n.filter(i=>{var a;return(a=i==null?void 0:i.common)==null?void 0:a.enabled}));const m=n.map(i=>({value:this.props.schema.long?i._id:this.props.schema.short?i._id.split(".").pop():i._id.replace(/^system\.adapter\./,""),label:`${i.common.name} [${i._id.replace(/^system\.adapter\./,"")}]`,icon:`adapter/${i.common.name}/${i.common.icon}`}));m.sort((i,a)=>i.value>a.value?1:i.value<a.value?-1:0),this.props.schema.allowDeactivate!==!1&&m.unshift({label:G.I18n.t(X.NONE_LABEL),value:X.NONE_VALUE}),this.props.schema.all&&m.unshift({label:G.I18n.t("sch_all"),value:"*"}),this.setState({value:e||"",selectOptions:m}),await this.props.oContext.socket.subscribeObject(`system.adapter.${t?`${t}.`:""}*`,this.onInstancesUpdate)}).catch(n=>console.error(`Cannot get instances: ${n}`))}componentWillUnmount(){this.props.oContext.socket.unsubscribeObject("system.adapter.*",this.onInstancesUpdate).then(()=>{}),super.componentWillUnmount()}onInstancesUpdate=(e,t)=>{if(!e.match(/^system\.adapter\.[-_a-z\d]+\.\d+$/))return;const n=this.props.schema.long?e:this.props.schema.short?e.split(".").pop():e.replace(/^system\.adapter\./,""),m=this.state.selectOptions.findIndex(i=>i.value===n);if(t){if(this.props.schema.adapter==="_dataSources"&&(!t.common||!t.common.getHistory))return;if(m===-1){const i=JSON.parse(JSON.stringify(this.state.selectOptions)),a=typeof t.common.name=="object"?t.common.name[G.I18n.getLanguage()]||t.common.name.en:t.common.name;i.push({value:this.props.schema.long?t._id:this.props.schema.short?t._id.split(".").pop():t._id.replace(/^system\.adapter\./,""),label:`${a} [${t._id.replace(/^system\.adapter\./,"")}]`,icon:`adapter/${a}/${t.common.icon}`}),i.sort((p,o)=>p.label>o.label?1:p.label<o.label?-1:0),this.setState({selectOptions:i})}}else if(m!==-1){const i=JSON.parse(JSON.stringify(this.state.selectOptions)),a={};this.state.value===i[m].value&&(a.value=X.NONE_VALUE),i.splice(m,1),a.selectOptions=i,this.setState(a)}};renderItem(e,t){var m;if(!this.state.selectOptions)return null;const n=(m=this.state.selectOptions)==null?void 0:m.find(i=>i.value===this.state.value);return I.createElement(B.FormControl,{fullWidth:!0,key:this.props.attr,variant:"standard"},this.props.schema.label?I.createElement(B.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,I.createElement(B.Select,{variant:"standard",error:!!e,displayEmpty:!0,disabled:!!t,value:this.state.value,renderValue:()=>I.createElement("span",{style:{display:"flex"}},n!=null&&n.icon?I.createElement("img",{src:`./${n.icon}`,alt:n.value,style:ks.icon}):null,this.getText(n==null?void 0:n.label,!0)),onChange:i=>this.setState({value:i.target.value},()=>this.onChange(this.props.attr,this.state.value))},this.state.selectOptions.map(i=>I.createElement(B.MenuItem,{key:i.value,value:i.value,style:i.value===X.NONE_VALUE?{opacity:.5}:{}},i.icon?I.createElement("img",{src:`./${i.icon}`,alt:i.value,style:ks.icon}):null,this.getText(i.label,!0)))),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const $s={address:{fontSize:"smaller",opacity:.5,marginLeft:8}};class _m extends X{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getObject(`system.host.${this.props.common.host}`).then(e=>{var n,m;const t=[];if((m=(n=e==null?void 0:e.native)==null?void 0:n.hardware)!=null&&m.networkInterfaces){const i=e.native.hardware.networkInterfaces;Object.keys(i).forEach(a=>{if(this.props.schema.ignoreInternal&&!i[a].find(o=>!o.internal)||this.props.schema.ignoreLoopback&&i[a].find(o=>o.address==="127.0.0.1"||o.address==="::1"))return;let p=i[a].find(o=>o.family==="IPv4");p=p||i[a].find(o=>o.family==="IPv6"),t.push({value:a,address:p.address})})}this.setState({interfaces:t})}).catch(e=>window.alert(`Cannot read interfaces: ${e}`))}renderItem(e,t){var i,a,p;const n=X.getValue(this.props.data,this.props.attr),m=(i=this.state.interfaces)==null?void 0:i.find(o=>o.value===n);return I.createElement(B.FormControl,{fullWidth:!0,variant:"standard"},(a=this.state.interfaces)!=null&&a.length&&this.props.schema.label?I.createElement(B.InputLabel,null,this.getText(this.props.schema.label)):null,(p=this.state.interfaces)!=null&&p.length?I.createElement(B.Select,{variant:"standard",error:!!e,disabled:!!t,value:n,renderValue:o=>m?I.createElement("span",null,m.value,I.createElement("span",{style:$s.address},m.address)):o,onChange:o=>this.onChange(this.props.attr,o.target.value)},this.state.interfaces.map((o,h)=>I.createElement(B.MenuItem,{key:h,value:o.value},I.createElement("span",null,o.value,I.createElement("span",{style:$s.address},o.address))))):I.createElement(B.TextField,{fullWidth:!0,variant:"standard",error:!!e,disabled:!!t,value:n,onChange:o=>this.onChange(this.props.attr,o.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const xn={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"}},Im=({toggleTranslation:d,noTranslation:e,title:t,fullWidth:n,help:m,maxWidth:i,progress:a,icon:p,applyDisabled:o,applyButton:h,onClose:r,children:s,titleButtonApply:l,titleButtonClose:u,onApply:c,textInput:f,defaultValue:g,overflowHidden:v})=>{const[b,A]=J.useState(g);J.useEffect(()=>{A(g)},[g]);let x=null;return p&&(x=p),I.createElement(B.Dialog,{open:!0,maxWidth:i||"md",fullWidth:!!n,disableEscapeKeyDown:!1,onClose:r,sx:{"& .MuiPaper-root":xn.modalDialog}},t&&I.createElement(B.DialogTitle,null,p?I.createElement(x,{style:xn.titleIcon}):null,t,G.I18n.getLanguage()!=="en"&&d?I.createElement(B.IconButton,{size:"large",style:{...xn.languageButton,...e?xn.languageButtonActive:{}},onClick:()=>d(),title:G.I18n.t("Disable/Enable translation")},I.createElement(oe.Language,null)):null),I.createElement(B.DialogContent,{sx:{...v?xn.overflowHidden:{},...xn.content},style:{paddingTop:8}},f&&I.createElement(B.TextField,{autoComplete:"off",fullWidth:!0,autoFocus:!0,variant:"outlined",size:"medium",multiline:!0,value:b,onChange:D=>A(D.target.value)}),s,m?I.createElement("div",null,m):null),I.createElement(B.DialogActions,null,h!==!1&&I.createElement(B.Button,{startIcon:I.createElement(oe.Check,null),disabled:a||o&&g===b,onClick:()=>c&&c(f?b:""),variant:"contained",color:"primary"},G.I18n.t(l||"Ok")),I.createElement(B.Button,{color:"grey",onClick:()=>r&&r(),disabled:a,variant:"contained",startIcon:I.createElement(oe.Close,null)},G.I18n.t(u||"Cancel"))))};var Ln={},mn={},ha={exports:{}};(function(d,e){(function(){var t="ace",n=function(){return this}();!n&&typeof window<"u"&&(n=window);var m=function(r,s,l){if(typeof r!="string"){m.original?m.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(l=s),m.modules[r]||(m.payloads[r]=l,m.modules[r]=null)};m.modules={},m.payloads={};var i=function(r,s,l){if(typeof s=="string"){var u=o(r,s);if(u!=null)return l&&l(),u}else if(Object.prototype.toString.call(s)==="[object Array]"){for(var c=[],f=0,g=s.length;f<g;++f){var v=o(r,s[f]);if(v==null&&a.original)return;c.push(v)}return l&&l.apply(null,c)||!0}},a=function(r,s){var l=i("",r,s);return l==null&&a.original?a.original.apply(this,arguments):l},p=function(r,s){if(s.indexOf("!")!==-1){var l=s.split("!");return p(r,l[0])+"!"+p(r,l[1])}if(s.charAt(0)=="."){var u=r.split("/").slice(0,-1).join("/");for(s=u+"/"+s;s.indexOf(".")!==-1&&c!=s;){var c=s;s=s.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return s},o=function(r,s){s=p(r,s);var l=m.modules[s];if(!l){if(l=m.payloads[s],typeof l=="function"){var u={},c={id:s,uri:"",exports:u,packaged:!0},f=function(v,b){return i(s,v,b)},g=l(f,u,c);u=g||c.exports,m.modules[s]=u,delete m.payloads[s]}l=m.modules[s]=u||l}return l};function h(r){var s=n;n[r]||(n[r]={}),s=n[r],(!s.define||!s.define.packaged)&&(m.original=s.define,s.define=m,s.define.packaged=!0),(!s.require||!s.require.packaged)&&(a.original=s.require,s.require=a,s.require.packaged=!0)}h(t)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(t,n,m){function i(a,p,o){Object.defineProperty(a,p,{value:o,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||i(String.prototype,"startsWith",function(a,p){return p=p||0,this.lastIndexOf(a,p)===p}),String.prototype.endsWith||i(String.prototype,"endsWith",function(a,p){var o=this;(p===void 0||p>o.length)&&(p=o.length),p-=a.length;var h=o.indexOf(a,p);return h!==-1&&h===p}),String.prototype.repeat||i(String.prototype,"repeat",function(a){for(var p="",o=this;a>0;)a&1&&(p+=o),(a>>=1)&&(o+=o);return p}),String.prototype.includes||i(String.prototype,"includes",function(a,p){return this.indexOf(a,p)!=-1}),Object.assign||(Object.assign=function(a){if(a==null)throw new TypeError("Cannot convert undefined or null to object");for(var p=Object(a),o=1;o<arguments.length;o++){var h=arguments[o];h!=null&&Object.keys(h).forEach(function(r){p[r]=h[r]})}return p}),Object.values||(Object.values=function(a){return Object.keys(a).map(function(p){return a[p]})}),Array.prototype.find||i(Array.prototype,"find",function(a){for(var p=this.length,o=arguments[1],h=0;h<p;h++){var r=this[h];if(a.call(o,r,h,this))return r}}),Array.prototype.findIndex||i(Array.prototype,"findIndex",function(a){for(var p=this.length,o=arguments[1],h=0;h<p;h++){var r=this[h];if(a.call(o,r,h,this))return h}}),Array.prototype.includes||i(Array.prototype,"includes",function(a,p){return this.indexOf(a,p)!=-1}),Array.prototype.fill||i(Array.prototype,"fill",function(a){for(var p=this,o=p.length>>>0,h=arguments[1],r=h>>0,s=r<0?Math.max(o+r,0):Math.min(r,o),l=arguments[2],u=l===void 0?o:l>>0,c=u<0?Math.max(o+u,0):Math.min(u,o);s<c;)p[s]=a,s++;return p}),Array.of||i(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(t,n,m){t("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(t,n,m){n.deepCopy=function i(a){if(typeof a!="object"||!a)return a;var p;if(Array.isArray(a)){p=[];for(var o=0;o<a.length;o++)p[o]=i(a[o]);return p}if(Object.prototype.toString.call(a)!=="[object Object]")return a;p={};for(var o in a)p[o]=i(a[o]);return p}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(t,n,m){n.last=function(p){return p[p.length-1]},n.stringReverse=function(p){return p.split("").reverse().join("")},n.stringRepeat=function(p,o){for(var h="";o>0;)o&1&&(h+=p),(o>>=1)&&(p+=p);return h};var i=/^\s\s*/,a=/\s\s*$/;n.stringTrimLeft=function(p){return p.replace(i,"")},n.stringTrimRight=function(p){return p.replace(a,"")},n.copyObject=function(p){var o={};for(var h in p)o[h]=p[h];return o},n.copyArray=function(p){for(var o=[],h=0,r=p.length;h<r;h++)p[h]&&typeof p[h]=="object"?o[h]=this.copyObject(p[h]):o[h]=p[h];return o},n.deepCopy=t("./deep_copy").deepCopy,n.arrayToMap=function(p){for(var o={},h=0;h<p.length;h++)o[p[h]]=1;return o},n.createMap=function(p){var o=Object.create(null);for(var h in p)o[h]=p[h];return o},n.arrayRemove=function(p,o){for(var h=0;h<=p.length;h++)o===p[h]&&p.splice(h,1)},n.escapeRegExp=function(p){return p.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},n.escapeHTML=function(p){return(""+p).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},n.getMatchOffsets=function(p,o){var h=[];return p.replace(o,function(r){h.push({offset:arguments[arguments.length-2],length:r.length})}),h},n.deferredCall=function(p){var o=null,h=function(){o=null,p()},r=function(s){return r.cancel(),o=setTimeout(h,s||0),r};return r.schedule=r,r.call=function(){return this.cancel(),p(),r},r.cancel=function(){return clearTimeout(o),o=null,r},r.isPending=function(){return o},r},n.delayedCall=function(p,o){var h=null,r=function(){h=null,p()},s=function(l){h==null&&(h=setTimeout(r,l||o))};return s.delay=function(l){h&&clearTimeout(h),h=setTimeout(r,l||o)},s.schedule=s,s.call=function(){this.cancel(),p()},s.cancel=function(){h&&clearTimeout(h),h=null},s.isPending=function(){return h},s},n.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},n.skipEmptyMatch=function(p,o,h){return h&&p.codePointAt(o)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(t,n,m){n.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},n.getOS=function(){return n.isMac?n.OS.MAC:n.isLinux?n.OS.LINUX:n.OS.WINDOWS};var i=typeof navigator=="object"?navigator:{},a=(/mac|win|linux/i.exec(i.platform)||["other"])[0].toLowerCase(),p=i.userAgent||"",o=i.appName||"";n.isWin=a=="win",n.isMac=a=="mac",n.isLinux=a=="linux",n.isIE=o=="Microsoft Internet Explorer"||o.indexOf("MSAppHost")>=0?parseFloat((p.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((p.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),n.isOldIE=n.isIE&&n.isIE<9,n.isGecko=n.isMozilla=p.match(/ Gecko\/\d+/),n.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",n.isWebKit=parseFloat(p.split("WebKit/")[1])||void 0,n.isChrome=parseFloat(p.split(" Chrome/")[1])||void 0,n.isSafari=parseFloat(p.split(" Safari/")[1])&&!n.isChrome||void 0,n.isEdge=parseFloat(p.split(" Edge/")[1])||void 0,n.isAIR=p.indexOf("AdobeAIR")>=0,n.isAndroid=p.indexOf("Android")>=0,n.isChromeOS=p.indexOf(" CrOS ")>=0,n.isIOS=/iPad|iPhone|iPod/.test(p)&&!window.MSStream,n.isIOS&&(n.isMac=!0),n.isMobile=n.isIOS||n.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(t,n,m){var i=t("./useragent"),a="http://www.w3.org/1999/xhtml";n.buildDom=function l(u,c,f){if(typeof u=="string"&&u){var g=document.createTextNode(u);return c&&c.appendChild(g),g}if(!Array.isArray(u))return u&&u.appendChild&&c&&c.appendChild(u),u;if(typeof u[0]!="string"||!u[0]){for(var v=[],b=0;b<u.length;b++){var A=l(u[b],c,f);A&&v.push(A)}return v}var x=document.createElement(u[0]),D=u[1],y=1;D&&typeof D=="object"&&!Array.isArray(D)&&(y=2);for(var b=y;b<u.length;b++)l(u[b],x,f);return y==2&&Object.keys(D).forEach(function(E){var T=D[E];E==="class"?x.className=Array.isArray(T)?T.join(" "):T:typeof T=="function"||E=="value"||E[0]=="$"?x[E]=T:E==="ref"?f&&(f[T]=x):E==="style"?typeof T=="string"&&(x.style.cssText=T):T!=null&&x.setAttribute(E,T)}),c&&c.appendChild(x),x},n.getDocumentHead=function(l){return l||(l=document),l.head||l.getElementsByTagName("head")[0]||l.documentElement},n.createElement=function(l,u){return document.createElementNS?document.createElementNS(u||a,l):document.createElement(l)},n.removeChildren=function(l){l.innerHTML=""},n.createTextNode=function(l,u){var c=u?u.ownerDocument:document;return c.createTextNode(l)},n.createFragment=function(l){var u=l?l.ownerDocument:document;return u.createDocumentFragment()},n.hasCssClass=function(l,u){var c=(l.className+"").split(/\s+/g);return c.indexOf(u)!==-1},n.addCssClass=function(l,u){n.hasCssClass(l,u)||(l.className+=" "+u)},n.removeCssClass=function(l,u){for(var c=l.className.split(/\s+/g);;){var f=c.indexOf(u);if(f==-1)break;c.splice(f,1)}l.className=c.join(" ")},n.toggleCssClass=function(l,u){for(var c=l.className.split(/\s+/g),f=!0;;){var g=c.indexOf(u);if(g==-1)break;f=!1,c.splice(g,1)}return f&&c.push(u),l.className=c.join(" "),f},n.setCssClass=function(l,u,c){c?n.addCssClass(l,u):n.removeCssClass(l,u)},n.hasCssString=function(l,u){var c=0,f;if(u=u||document,f=u.querySelectorAll("style")){for(;c<f.length;)if(f[c++].id===l)return!0}},n.removeElementById=function(l,u){u=u||document,u.getElementById(l)&&u.getElementById(l).remove()};var p,o=[];n.useStrictCSP=function(l){p=l,l==!1?h():o||(o=[])};function h(){var l=o;o=null,l&&l.forEach(function(u){r(u[0],u[1])})}function r(l,u,c){if(!(typeof document>"u")){if(o){if(c)h();else if(c===!1)return o.push([l,u])}if(!p){var f=c;!c||!c.getRootNode?f=document:(f=c.getRootNode(),(!f||f==c)&&(f=document));var g=f.ownerDocument||f;if(u&&n.hasCssString(u,f))return null;u&&(l+=`
|
|
21
|
+
/*# sourceURL=ace/css/`+u+" */");var v=n.createElement("style");v.appendChild(g.createTextNode(l)),u&&(v.id=u),f==g&&(f=n.getDocumentHead(g)),f.insertBefore(v,f.firstChild)}}}if(n.importCssString=r,n.importCssStylsheet=function(l,u){n.buildDom(["link",{rel:"stylesheet",href:l}],n.getDocumentHead(u))},n.scrollbarWidth=function(l){var u=n.createElement("ace_inner");u.style.width="100%",u.style.minWidth="0px",u.style.height="200px",u.style.display="block";var c=n.createElement("ace_outer"),f=c.style;f.position="absolute",f.left="-10000px",f.overflow="hidden",f.width="200px",f.minWidth="0px",f.height="150px",f.display="block",c.appendChild(u);var g=l&&l.documentElement||document&&document.documentElement;if(!g)return 0;g.appendChild(c);var v=u.offsetWidth;f.overflow="scroll";var b=u.offsetWidth;return v===b&&(b=c.clientWidth),g.removeChild(c),v-b},n.computedStyle=function(l,u){return window.getComputedStyle(l,"")||{}},n.setStyle=function(l,u,c){l[u]!==c&&(l[u]=c)},n.HAS_CSS_ANIMATION=!1,n.HAS_CSS_TRANSFORMS=!1,n.HI_DPI=i.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,i.isChromeOS&&(n.HI_DPI=!1),typeof document<"u"){var s=document.createElement("div");n.HI_DPI&&s.style.transform!==void 0&&(n.HAS_CSS_TRANSFORMS=!0),!i.isEdge&&typeof s.style.animationName<"u"&&(n.HAS_CSS_ANIMATION=!0),s=null}n.HAS_CSS_TRANSFORMS?n.translate=function(l,u,c){l.style.transform="translate("+Math.round(u)+"px, "+Math.round(c)+"px)"}:n.translate=function(l,u,c){l.style.top=Math.round(c)+"px",l.style.left=Math.round(u)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(t,n,m){/*
|
|
22
|
+
* based on code from:
|
|
23
|
+
*
|
|
24
|
+
* @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
|
|
25
|
+
* Available via the MIT or new BSD license.
|
|
26
|
+
* see: http://github.com/jrburke/requirejs for details
|
|
27
|
+
*/var i=t("./dom");n.get=function(a,p){var o=new XMLHttpRequest;o.open("GET",a,!0),o.onreadystatechange=function(){o.readyState===4&&p(o.responseText)},o.send(null)},n.loadScript=function(a,p){var o=i.getDocumentHead(),h=document.createElement("script");h.src=a,o.appendChild(h),h.onload=h.onreadystatechange=function(r,s){(s||!h.readyState||h.readyState=="loaded"||h.readyState=="complete")&&(h=h.onload=h.onreadystatechange=null,s||p())}},n.qualifyURL=function(a){var p=document.createElement("a");return p.href=a,p.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(t,n,m){n.inherits=function(i,a){i.super_=a,i.prototype=Object.create(a.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}})},n.mixin=function(i,a){for(var p in a)i[p]=a[p];return i},n.implement=function(i,a){n.mixin(i,a)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(t,n,m){var i={},a=function(){this.propagationStopped=!0},p=function(){this.defaultPrevented=!0};i._emit=i._dispatchEvent=function(o,h){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[o]||[],s=this._defaultHandlers[o];if(!(!r.length&&!s)){(typeof h!="object"||!h)&&(h={}),h.type||(h.type=o),h.stopPropagation||(h.stopPropagation=a),h.preventDefault||(h.preventDefault=p),r=r.slice();for(var l=0;l<r.length&&(r[l](h,this),!h.propagationStopped);l++);if(s&&!h.defaultPrevented)return s(h,this)}},i._signal=function(o,h){var r=(this._eventRegistry||{})[o];if(r){r=r.slice();for(var s=0;s<r.length;s++)r[s](h,this)}},i.once=function(o,h){var r=this;if(this.on(o,function s(){r.off(o,s),h.apply(null,arguments)}),!h)return new Promise(function(s){h=s})},i.setDefaultHandler=function(o,h){var r=this._defaultHandlers;if(r||(r=this._defaultHandlers={_disabled_:{}}),r[o]){var s=r[o],l=r._disabled_[o];l||(r._disabled_[o]=l=[]),l.push(s);var u=l.indexOf(h);u!=-1&&l.splice(u,1)}r[o]=h},i.removeDefaultHandler=function(o,h){var r=this._defaultHandlers;if(r){var s=r._disabled_[o];if(r[o]==h)s&&this.setDefaultHandler(o,s.pop());else if(s){var l=s.indexOf(h);l!=-1&&s.splice(l,1)}}},i.on=i.addEventListener=function(o,h,r){this._eventRegistry=this._eventRegistry||{};var s=this._eventRegistry[o];return s||(s=this._eventRegistry[o]=[]),s.indexOf(h)==-1&&s[r?"unshift":"push"](h),h},i.off=i.removeListener=i.removeEventListener=function(o,h){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[o];if(r){var s=r.indexOf(h);s!==-1&&r.splice(s,1)}},i.removeAllListeners=function(o){o||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[o]=void 0),this._defaultHandlers&&(this._defaultHandlers[o]=void 0)},n.EventEmitter=i}),ace.define("ace/lib/report_error",["require","exports","module"],function(t,n,m){n.reportError=function(a,p){var o=new Error(a);o.data=p,typeof console=="object"&&console.error&&console.error(o),setTimeout(function(){throw o})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(t,n,m){var i={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor gutter","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages","gutter.annotation.aria-label.security":"Security finding, read annotations row $0","gutter.annotation.aria-label.hint":"Suggestion, read annotations row $0","gutter-tooltip.aria-label.security.singular":"security finding","gutter-tooltip.aria-label.security.plural":"security findings","gutter-tooltip.aria-label.hint.singular":"suggestion","gutter-tooltip.aria-label.hint.plural":"suggestions"};n.defaultEnglishMessages=i}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(t,n,m){"no use strict";var i=t("./oop"),a=t("./event_emitter").EventEmitter,p=t("./report_error").reportError,o=t("./default_english_messages").defaultEnglishMessages,h={setOptions:function(c){Object.keys(c).forEach(function(f){this.setOption(f,c[f])},this)},getOptions:function(c){var f={};if(c)Array.isArray(c)||(f=c,c=Object.keys(f));else{var g=this.$options;c=Object.keys(g).filter(function(v){return!g[v].hidden})}return c.forEach(function(v){f[v]=this.getOption(v)},this),f},setOption:function(c,f){if(this["$"+c]!==f){var g=this.$options[c];if(!g)return r('misspelled option "'+c+'"');if(g.forwardTo)return this[g.forwardTo]&&this[g.forwardTo].setOption(c,f);g.handlesSet||(this["$"+c]=f),g&&g.set&&g.set.call(this,f)}},getOption:function(c){var f=this.$options[c];return f?f.forwardTo?this[f.forwardTo]&&this[f.forwardTo].getOption(c):f&&f.get?f.get.call(this):this["$"+c]:r('misspelled option "'+c+'"')}};function r(c){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var s,l,u=function(){function c(){this.$defaultOptions={},s=o,l="dollarSigns"}return c.prototype.defineOptions=function(f,g,v){return f.$options||(this.$defaultOptions[g]=f.$options={}),Object.keys(v).forEach(function(b){var A=v[b];typeof A=="string"&&(A={forwardTo:A}),A.name||(A.name=b),f.$options[A.name]=A,"initialValue"in A&&(f["$"+A.name]=A.initialValue)}),i.implement(f,h),this},c.prototype.resetOptions=function(f){Object.keys(f.$options).forEach(function(g){var v=f.$options[g];"value"in v&&f.setOption(g,v.value)})},c.prototype.setDefaultValue=function(f,g,v){if(!f){for(f in this.$defaultOptions)if(this.$defaultOptions[f][g])break;if(!this.$defaultOptions[f][g])return!1}var b=this.$defaultOptions[f]||(this.$defaultOptions[f]={});b[g]&&(b.forwardTo?this.setDefaultValue(b.forwardTo,g,v):b[g].value=v)},c.prototype.setDefaultValues=function(f,g){Object.keys(g).forEach(function(v){this.setDefaultValue(f,v,g[v])},this)},c.prototype.setMessages=function(f,g){s=f,g&&g.placeholders&&(l=g.placeholders)},c.prototype.nls=function(f,g,v){s[f]||(r("No message found for the key '"+f+"' in messages with id "+s.$id+", trying to find a translation for the default string '"+g+"'."),s[g]||r("No message found for the default string '"+g+"' in the provided messages. Falling back to the default English message."));var b=s[f]||s[g]||g;return v&&(l==="dollarSigns"&&(b=b.replace(/\$(\$|[\d]+)/g,function(A,x){return x=="$"?"$":v[x]})),l==="curlyBrackets"&&(b=b.replace(/\{([^\}]+)\}/g,function(A,x){return v[x]}))),b},c}();u.prototype.warn=r,u.prototype.reportError=p,i.implement(u.prototype,a),n.AppConfig=u}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(t,n,m){m.exports=`.ace-tm .ace_gutter {
|
|
28
|
+
background: #f0f0f0;
|
|
29
|
+
color: #333;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ace-tm .ace_print-margin {
|
|
33
|
+
width: 1px;
|
|
34
|
+
background: #e8e8e8;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ace-tm .ace_fold {
|
|
38
|
+
background-color: #6B72E6;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ace-tm {
|
|
42
|
+
background-color: #FFFFFF;
|
|
43
|
+
color: black;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ace-tm .ace_cursor {
|
|
47
|
+
color: black;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ace-tm .ace_invisible {
|
|
51
|
+
color: rgb(191, 191, 191);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ace-tm .ace_storage,
|
|
55
|
+
.ace-tm .ace_keyword {
|
|
56
|
+
color: blue;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ace-tm .ace_constant {
|
|
60
|
+
color: rgb(197, 6, 11);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ace-tm .ace_constant.ace_buildin {
|
|
64
|
+
color: rgb(88, 72, 246);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ace-tm .ace_constant.ace_language {
|
|
68
|
+
color: rgb(88, 92, 246);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ace-tm .ace_constant.ace_library {
|
|
72
|
+
color: rgb(6, 150, 14);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ace-tm .ace_invalid {
|
|
76
|
+
background-color: rgba(255, 0, 0, 0.1);
|
|
77
|
+
color: red;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ace-tm .ace_support.ace_function {
|
|
81
|
+
color: rgb(60, 76, 114);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ace-tm .ace_support.ace_constant {
|
|
85
|
+
color: rgb(6, 150, 14);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ace-tm .ace_support.ace_type,
|
|
89
|
+
.ace-tm .ace_support.ace_class {
|
|
90
|
+
color: rgb(109, 121, 222);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ace-tm .ace_keyword.ace_operator {
|
|
94
|
+
color: rgb(104, 118, 135);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.ace-tm .ace_string {
|
|
98
|
+
color: rgb(3, 106, 7);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ace-tm .ace_comment {
|
|
102
|
+
color: rgb(76, 136, 107);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ace-tm .ace_comment.ace_doc {
|
|
106
|
+
color: rgb(0, 102, 255);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.ace-tm .ace_comment.ace_doc.ace_tag {
|
|
110
|
+
color: rgb(128, 159, 191);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.ace-tm .ace_constant.ace_numeric {
|
|
114
|
+
color: rgb(0, 0, 205);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.ace-tm .ace_variable {
|
|
118
|
+
color: rgb(49, 132, 149);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.ace-tm .ace_xml-pe {
|
|
122
|
+
color: rgb(104, 104, 91);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ace-tm .ace_entity.ace_name.ace_function {
|
|
126
|
+
color: #0000A2;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
.ace-tm .ace_heading {
|
|
131
|
+
color: rgb(12, 7, 255);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.ace-tm .ace_list {
|
|
135
|
+
color:rgb(185, 6, 144);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.ace-tm .ace_meta.ace_tag {
|
|
139
|
+
color:rgb(0, 22, 142);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.ace-tm .ace_string.ace_regex {
|
|
143
|
+
color: rgb(255, 0, 0)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.ace-tm .ace_marker-layer .ace_selection {
|
|
147
|
+
background: rgb(181, 213, 255);
|
|
148
|
+
}
|
|
149
|
+
.ace-tm.ace_multiselect .ace_selection.ace_start {
|
|
150
|
+
box-shadow: 0 0 3px 0px white;
|
|
151
|
+
}
|
|
152
|
+
.ace-tm .ace_marker-layer .ace_step {
|
|
153
|
+
background: rgb(252, 255, 0);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.ace-tm .ace_marker-layer .ace_stack {
|
|
157
|
+
background: rgb(164, 229, 101);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.ace-tm .ace_marker-layer .ace_bracket {
|
|
161
|
+
margin: -1px 0 0 -1px;
|
|
162
|
+
border: 1px solid rgb(192, 192, 192);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.ace-tm .ace_marker-layer .ace_active-line {
|
|
166
|
+
background: rgba(0, 0, 0, 0.07);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.ace-tm .ace_gutter-active-line {
|
|
170
|
+
background-color : #dcdcdc;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.ace-tm .ace_marker-layer .ace_selected-word {
|
|
174
|
+
background: rgb(250, 250, 255);
|
|
175
|
+
border: 1px solid rgb(200, 200, 250);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.ace-tm .ace_indent-guide {
|
|
179
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.ace-tm .ace_indent-guide-active {
|
|
183
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
|
|
184
|
+
}
|
|
185
|
+
`}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(t,n,m){n.isDark=!1,n.cssClass="ace-tm",n.cssText=t("./textmate-css"),n.$id="ace/theme/textmate";var i=t("../lib/dom");i.importCssString(n.cssText,n.cssClass,!1)}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(t,n,m){"no use strict";var i=t("./lib/lang"),a=t("./lib/net"),p=t("./lib/dom"),o=t("./lib/app_config").AppConfig;m.exports=n=new o;var h={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};n.get=function(u){if(!h.hasOwnProperty(u))throw new Error("Unknown config key: "+u);return h[u]},n.set=function(u,c){if(h.hasOwnProperty(u))h[u]=c;else if(this.setDefaultValue("",u,c)==!1)throw new Error("Unknown config key: "+u);u=="useStrictCSP"&&p.useStrictCSP(c)},n.all=function(){return i.copyObject(h)},n.$modes={},n.moduleUrl=function(u,c){if(h.$moduleUrls[u])return h.$moduleUrls[u];var f=u.split("/");c=c||f[f.length-2]||"";var g=c=="snippets"?"/":"-",v=f[f.length-1];if(c=="worker"&&g=="-"){var b=new RegExp("^"+c+"[\\-_]|[\\-_]"+c+"$","g");v=v.replace(b,"")}(!v||v==c)&&f.length>1&&(v=f[f.length-2]);var A=h[c+"Path"];return A==null?A=h.basePath:g=="/"&&(c=g=""),A&&A.slice(-1)!="/"&&(A+="/"),A+c+g+v+this.get("suffix")},n.setModuleUrl=function(u,c){return h.$moduleUrls[u]=c};var r=function(u,c){if(u==="ace/theme/textmate"||u==="./theme/textmate")return c(null,t("./theme/textmate"));if(s)return s(u,c);console.error("loader is not configured")},s;n.setLoader=function(u){s=u},n.dynamicModules=Object.create(null),n.$loading={},n.$loaded={},n.loadModule=function(u,c){var f;if(Array.isArray(u))var g=u[0],v=u[1];else if(typeof u=="string")var v=u;var b=function(A){if(A&&!n.$loading[v])return c&&c(A);if(n.$loading[v]||(n.$loading[v]=[]),n.$loading[v].push(c),!(n.$loading[v].length>1)){var x=function(){r(v,function(D,y){y&&(n.$loaded[v]=y),n._emit("load.module",{name:v,module:y});var E=n.$loading[v];n.$loading[v]=null,E.forEach(function(T){T&&T(y)})})};if(!n.get("packaged"))return x();a.loadScript(n.moduleUrl(v,g),x),l()}};if(n.dynamicModules[v])n.dynamicModules[v]().then(function(A){A.default?b(A.default):b(A)});else{try{f=this.$require(v)}catch{}b(f||n.$loaded[v])}},n.$require=function(u){if(typeof m.require=="function"){var c="require";return m[c](u)}},n.setModuleLoader=function(u,c){n.dynamicModules[u]=c};var l=function(){!h.basePath&&!h.workerPath&&!h.modePath&&!h.themePath&&!Object.keys(h.$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"),l=function(){})};n.version="1.39.0"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(t,n,m){t("./lib/fixoldbrowsers");var i=t("./config");i.setLoader(function(h,r){t([h],function(s){r(null,s)})});var a=function(){return this||typeof window<"u"&&window}();m.exports=function(h){i.init=p,i.$require=t,h.require=t},p(!0);function p(h){if(!(!a||!a.document)){i.set("packaged",h||t.packaged||m.packaged||a.define&&(void 0).packaged);var r={},s="",l=document.currentScript||document._currentScript,u=l&&l.ownerDocument||document;l&&l.src&&(s=l.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var c=u.getElementsByTagName("script"),f=0;f<c.length;f++){var g=c[f],v=g.src||g.getAttribute("src");if(v){for(var b=g.attributes,A=0,x=b.length;A<x;A++){var D=b[A];D.name.indexOf("data-ace-")===0&&(r[o(D.name.replace(/^data-ace-/,""))]=D.value)}var y=v.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);y&&(s=y[1])}}s&&(r.base=r.base||s,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var E in r)typeof r[E]<"u"&&i.set(E,r[E])}}function o(h){return h.replace(/-(.)/g,function(r,s){return s.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(t,n,m){var i=function(){function a(p,o,h,r){this.start={row:p,column:o},this.end={row:h,column:r}}return a.prototype.isEqual=function(p){return this.start.row===p.start.row&&this.end.row===p.end.row&&this.start.column===p.start.column&&this.end.column===p.end.column},a.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},a.prototype.contains=function(p,o){return this.compare(p,o)==0},a.prototype.compareRange=function(p){var o,h=p.end,r=p.start;return o=this.compare(h.row,h.column),o==1?(o=this.compare(r.row,r.column),o==1?2:o==0?1:0):o==-1?-2:(o=this.compare(r.row,r.column),o==-1?-1:o==1?42:0)},a.prototype.comparePoint=function(p){return this.compare(p.row,p.column)},a.prototype.containsRange=function(p){return this.comparePoint(p.start)==0&&this.comparePoint(p.end)==0},a.prototype.intersects=function(p){var o=this.compareRange(p);return o==-1||o==0||o==1},a.prototype.isEnd=function(p,o){return this.end.row==p&&this.end.column==o},a.prototype.isStart=function(p,o){return this.start.row==p&&this.start.column==o},a.prototype.setStart=function(p,o){typeof p=="object"?(this.start.column=p.column,this.start.row=p.row):(this.start.row=p,this.start.column=o)},a.prototype.setEnd=function(p,o){typeof p=="object"?(this.end.column=p.column,this.end.row=p.row):(this.end.row=p,this.end.column=o)},a.prototype.inside=function(p,o){return this.compare(p,o)==0?!(this.isEnd(p,o)||this.isStart(p,o)):!1},a.prototype.insideStart=function(p,o){return this.compare(p,o)==0?!this.isEnd(p,o):!1},a.prototype.insideEnd=function(p,o){return this.compare(p,o)==0?!this.isStart(p,o):!1},a.prototype.compare=function(p,o){return!this.isMultiLine()&&p===this.start.row?o<this.start.column?-1:o>this.end.column?1:0:p<this.start.row?-1:p>this.end.row?1:this.start.row===p?o>=this.start.column?0:-1:this.end.row===p?o<=this.end.column?0:1:0},a.prototype.compareStart=function(p,o){return this.start.row==p&&this.start.column==o?-1:this.compare(p,o)},a.prototype.compareEnd=function(p,o){return this.end.row==p&&this.end.column==o?1:this.compare(p,o)},a.prototype.compareInside=function(p,o){return this.end.row==p&&this.end.column==o?1:this.start.row==p&&this.start.column==o?-1:this.compare(p,o)},a.prototype.clipRows=function(p,o){if(this.end.row>o)var h={row:o+1,column:0};else if(this.end.row<p)var h={row:p,column:0};if(this.start.row>o)var r={row:o+1,column:0};else if(this.start.row<p)var r={row:p,column:0};return a.fromPoints(r||this.start,h||this.end)},a.prototype.extend=function(p,o){var h=this.compare(p,o);if(h==0)return this;if(h==-1)var r={row:p,column:o};else var s={row:p,column:o};return a.fromPoints(r||this.start,s||this.end)},a.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},a.prototype.isMultiLine=function(){return this.start.row!==this.end.row},a.prototype.clone=function(){return a.fromPoints(this.start,this.end)},a.prototype.collapseRows=function(){return this.end.column==0?new a(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new a(this.start.row,0,this.end.row,0)},a.prototype.toScreenRange=function(p){var o=p.documentToScreenPosition(this.start),h=p.documentToScreenPosition(this.end);return new a(o.row,o.column,h.row,h.column)},a.prototype.moveBy=function(p,o){this.start.row+=p,this.start.column+=o,this.end.row+=p,this.end.column+=o},a}();i.fromPoints=function(a,p){return new i(a.row,a.column,p.row,p.column)},i.comparePoints=function(a,p){return a.row-p.row||a.column-p.column},n.Range=i}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(t,n,m){for(var i=t("./oop"),a={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},p={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},o=0;o<10;o++)p["Digit"+o]=48+o,p["Numpad"+o]=96+o,a.PRINTABLE_KEYS[48+o]=""+o,a.FUNCTION_KEYS[96+o]="Numpad"+o;for(var o=65;o<91;o++){var h=String.fromCharCode(o+32);p["Key"+h.toUpperCase()]=o,a.PRINTABLE_KEYS[o]=h}for(var o=1;o<13;o++)p["F"+o]=111+o,a.FUNCTION_KEYS[111+o]="F"+o;var r={Shift:16,Control:17,Alt:18,Meta:224};for(var s in r)p[s]=p[s+"Left"]=p[s+"Right"]=r[s];n.$codeToKeyCode=p,a.PRINTABLE_KEYS[173]="-";for(var l in a.FUNCTION_KEYS){var u=a.FUNCTION_KEYS[l].toLowerCase();a[u]=parseInt(l,10)}for(var l in a.PRINTABLE_KEYS){var u=a.PRINTABLE_KEYS[l].toLowerCase();a[u]=parseInt(l,10)}i.mixin(a,a.MODIFIER_KEYS),i.mixin(a,a.PRINTABLE_KEYS),i.mixin(a,a.FUNCTION_KEYS),a.enter=a.return,a.escape=a.esc,a.del=a.delete,function(){for(var c=["cmd","ctrl","alt","shift"],f=Math.pow(2,c.length);f--;)a.KEY_MODS[f]=c.filter(function(g){return f&a.KEY_MODS[g]}).join("-")+"-"}(),a.KEY_MODS[0]="",a.KEY_MODS[-1]="input-",i.mixin(n,a),n.default=n,n.keyCodeToString=function(c){var f=a[c];return typeof f!="string"&&(f=String.fromCharCode(c)),f.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,m){var i=t("./keys"),a=t("./useragent"),p=null,o=0,h;function r(){h=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return h={passive:!1},!0}})}catch{}}function s(){return h==null&&r(),h}function l(A,x,D){this.elem=A,this.type=x,this.callback=D}l.prototype.destroy=function(){c(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var u=n.addListener=function(A,x,D,y){A.addEventListener(x,D,s()),y&&y.$toDestroy.push(new l(A,x,D))},c=n.removeListener=function(A,x,D){A.removeEventListener(x,D,s())};n.stopEvent=function(A){return n.stopPropagation(A),n.preventDefault(A),!1},n.stopPropagation=function(A){A.stopPropagation&&A.stopPropagation()},n.preventDefault=function(A){A.preventDefault&&A.preventDefault()},n.getButton=function(A){return A.type=="dblclick"?0:A.type=="contextmenu"||a.isMac&&A.ctrlKey&&!A.altKey&&!A.shiftKey?2:A.button},n.capture=function(A,x,D){var y=A&&A.ownerDocument||document;function E(T){x&&x(T),D&&D(T),c(y,"mousemove",x),c(y,"mouseup",E),c(y,"dragstart",E)}return u(y,"mousemove",x),u(y,"mouseup",E),u(y,"dragstart",E),E},n.addMouseWheelListener=function(A,x,D){u(A,"wheel",function(y){var E=.15,T=y.deltaX||0,M=y.deltaY||0;switch(y.deltaMode){case y.DOM_DELTA_PIXEL:y.wheelX=T*E,y.wheelY=M*E;break;case y.DOM_DELTA_LINE:var $=15;y.wheelX=T*$,y.wheelY=M*$;break;case y.DOM_DELTA_PAGE:var L=150;y.wheelX=T*L,y.wheelY=M*L;break}x(y)},D)},n.addMultiMouseDownListener=function(A,x,D,y,E){var T=0,M,$,L,C={2:"dblclick",3:"tripleclick",4:"quadclick"};function w(S){if(n.getButton(S)!==0?T=0:S.detail>1?(T++,T>4&&(T=1)):T=1,a.isIE){var k=Math.abs(S.clientX-M)>5||Math.abs(S.clientY-$)>5;(!L||k)&&(T=1),L&&clearTimeout(L),L=setTimeout(function(){L=null},x[T-1]||600),T==1&&(M=S.clientX,$=S.clientY)}if(S._clicks=T,D[y]("mousedown",S),T>4)T=0;else if(T>1)return D[y](C[T],S)}Array.isArray(A)||(A=[A]),A.forEach(function(S){u(S,"mousedown",w,E)})};function f(A){return 0|(A.ctrlKey?1:0)|(A.altKey?2:0)|(A.shiftKey?4:0)|(A.metaKey?8:0)}n.getModifierString=function(A){return i.KEY_MODS[f(A)]};function g(A,x,D){var y=f(x);if(!D&&x.code&&(D=i.$codeToKeyCode[x.code]||D),!a.isMac&&p){if(x.getModifierState&&(x.getModifierState("OS")||x.getModifierState("Win"))&&(y|=8),p.altGr)if((3&y)!=3)p.altGr=0;else return;if(D===18||D===17){var E=x.location;if(D===17&&E===1)p[D]==1&&(o=x.timeStamp);else if(D===18&&y===3&&E===2){var T=x.timeStamp-o;T<50&&(p.altGr=!0)}}}if(D in i.MODIFIER_KEYS&&(D=-1),!(!y&&D===13&&x.location===3&&(A(x,y,-D),x.defaultPrevented))){if(a.isChromeOS&&y&8){if(A(x,y,D),x.defaultPrevented)return;y&=-9}return!y&&!(D in i.FUNCTION_KEYS)&&!(D in i.PRINTABLE_KEYS)?!1:A(x,y,D)}}n.addCommandKeyListener=function(A,x,D){var y=null;u(A,"keydown",function(E){p[E.keyCode]=(p[E.keyCode]||0)+1;var T=g(x,E,E.keyCode);return y=E.defaultPrevented,T},D),u(A,"keypress",function(E){y&&(E.ctrlKey||E.altKey||E.shiftKey||E.metaKey)&&(n.stopEvent(E),y=null)},D),u(A,"keyup",function(E){p[E.keyCode]=null},D),p||(v(),u(window,"focus",v))};function v(){p=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!a.isOldIE){var b=1;n.nextTick=function(A,x){x=x||window;var D="zero-timeout-message-"+b++,y=function(E){E.data==D&&(n.stopPropagation(E),c(x,"message",y),A())};u(x,"message",y),x.postMessage(D,"*")}}n.$idleBlocked=!1,n.onIdle=function(A,x){return setTimeout(function D(){n.$idleBlocked?setTimeout(D,100):A()},x)},n.$idleBlockId=null,n.blockIdle=function(A){n.$idleBlockId&&clearTimeout(n.$idleBlockId),n.$idleBlocked=!0,n.$idleBlockId=setTimeout(function(){n.$idleBlocked=!1},A||100)},n.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),n.nextFrame?n.nextFrame=n.nextFrame.bind(window):n.nextFrame=function(A){setTimeout(A,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(t,n,m){var i;m.exports={lineMode:!1,pasteCancelled:function(){return i&&i>Date.now()-50?!0:i=!1},cancel:function(){i=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(t,n,m){var i=t("../lib/event"),a=t("../config").nls,p=t("../lib/useragent"),o=t("../lib/dom"),h=t("../lib/lang"),r=t("../clipboard"),s=p.isChrome<18,l=p.isIE,u=p.isChrome>63,c=400,f=t("../lib/keys"),g=f.KEY_MODS,v=p.isIOS,b=v?/\s/:/\n/,A=p.isMobile,x;x=function(D,y){var E=o.createElement("textarea");E.className="ace_text-input",E.setAttribute("wrap","off"),E.setAttribute("autocorrect","off"),E.setAttribute("autocapitalize","off"),E.setAttribute("spellcheck","false"),E.style.opacity="0",D.insertBefore(E,D.firstChild);var T=!1,M=!1,$=!1,L=!1,C="";A||(E.style.fontSize="1px");var w=!1,S=!1,k="",_=0,F=0,R=0,O=Number.MAX_SAFE_INTEGER,V=Number.MIN_SAFE_INTEGER,P=0;try{var H=document.activeElement===E}catch{}this.setNumberOfExtraLines=function(re){if(O=Number.MAX_SAFE_INTEGER,V=Number.MIN_SAFE_INTEGER,re<0){P=0;return}P=re},this.setAriaLabel=function(){var re="";if(y.$textInputAriaLabel&&(re+="".concat(y.$textInputAriaLabel,", ")),y.session){var ye=y.session.selection.cursor.row;re+=a("text-input.aria-label","Cursor at row $0",[ye+1])}E.setAttribute("aria-label",re)},this.setAriaOptions=function(re){re.activeDescendant?(E.setAttribute("aria-haspopup","true"),E.setAttribute("aria-autocomplete",re.inline?"both":"list"),E.setAttribute("aria-activedescendant",re.activeDescendant)):(E.setAttribute("aria-haspopup","false"),E.setAttribute("aria-autocomplete","both"),E.removeAttribute("aria-activedescendant")),re.role&&E.setAttribute("role",re.role),re.setLabel&&(E.setAttribute("aria-roledescription",a("text-input.aria-roledescription","editor")),this.setAriaLabel())},this.setAriaOptions({role:"textbox"}),i.addListener(E,"blur",function(re){S||(y.onBlur(re),H=!1)},y),i.addListener(E,"focus",function(re){if(!S){if(H=!0,p.isEdge)try{if(!document.hasFocus())return}catch{}y.onFocus(re),p.isEdge?setTimeout(W):W()}},y),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:y.renderer.enableKeyboardAccessibility}),C||u||this.$focusScroll=="browser")return E.focus({preventScroll:!0});var re=E.style.top;E.style.position="fixed",E.style.top="0px";try{var ye=E.getBoundingClientRect().top!=0}catch{return}var Ce=[];if(ye)for(var ke=E.parentElement;ke&&ke.nodeType==1;)Ce.push(ke),ke.setAttribute("ace_nocontext","true"),!ke.parentElement&&ke.getRootNode?ke=ke.getRootNode().host:ke=ke.parentElement;E.focus({preventScroll:!0}),ye&&Ce.forEach(function(Te){Te.removeAttribute("ace_nocontext")}),setTimeout(function(){E.style.position="",E.style.top=="0px"&&(E.style.top=re)},0)},this.blur=function(){E.blur()},this.isFocused=function(){return H},y.on("beforeEndOperation",function(){var re=y.curOp,ye=re&&re.command&&re.command.name;if(ye!="insertstring"){var Ce=ye&&(re.docChanged||re.selectionChanged);$&&Ce&&(k=E.value="",fe()),W()}}),y.on("changeSelection",this.setAriaLabel);var N=function(re,ye){for(var Ce=ye,ke=1;ke<=re-O&&ke<2*P+1;ke++)Ce+=y.session.getLine(re-ke).length+1;return Ce},W=v?function(re){if(!(!H||T&&!re||L)){re||(re="");var ye=`
|
|
186
|
+
ab`+re+`cde fg
|
|
187
|
+
`;ye!=E.value&&(E.value=k=ye);var Ce=4,ke=4+(re.length||(y.selection.isEmpty()?0:1));(_!=Ce||F!=ke)&&E.setSelectionRange(Ce,ke),_=Ce,F=ke}}:function(){if(!($||L)&&!(!H&&!Z)){$=!0;var re=0,ye=0,Ce="";if(y.session){var ke=y.selection,Te=ke.getRange(),Ue=ke.cursor.row;Ue===V+1?(O=V+1,V=O+2*P):Ue===O-1?(V=O-1,O=V-2*P):(Ue<O-1||Ue>V+1)&&(O=Ue>P?Ue-P:0,V=Ue>P?Ue+P:2*P);for(var Ke=[],ze=O;ze<=V;ze++)Ke.push(y.session.getLine(ze));if(Ce=Ke.join(`
|
|
188
|
+
`),re=N(Te.start.row,Te.start.column),ye=N(Te.end.row,Te.end.column),Te.start.row<O){var Be=y.session.getLine(O-1);re=Te.start.row<O-1?0:re,ye+=Be.length+1,Ce=Be+`
|
|
189
|
+
`+Ce}else if(Te.end.row>V){var Ie=y.session.getLine(V+1);ye=Te.end.row>V+1?Ie.length:Te.end.column,ye+=Ce.length+1,Ce=Ce+`
|
|
190
|
+
`+Ie}else A&&Ue>0&&(Ce=`
|
|
191
|
+
`+Ce,ye+=1,re+=1);Ce.length>c&&(re<c&&ye<c?Ce=Ce.slice(0,c):(Ce=`
|
|
192
|
+
`,re==ye?re=ye=0:(re=0,ye=1)));var et=Ce+`
|
|
193
|
+
|
|
194
|
+
`;et!=k&&(E.value=k=et,_=F=et.length)}if(Z&&(_=E.selectionStart,F=E.selectionEnd),F!=ye||_!=re||E.selectionEnd!=F)try{E.setSelectionRange(re,ye),_=re,F=ye}catch{}$=!1}};this.resetSelection=W,H&&y.onFocus();var z=function(re){return re.selectionStart===0&&re.selectionEnd>=k.length&&re.value===k&&k&&re.selectionEnd!==F},j=function(re){$||(T?T=!1:z(E)?(y.selectAll(),W()):A&&E.selectionStart!=_&&W())},Q=null;this.setInputHandler=function(re){Q=re},this.getInputHandler=function(){return Q};var Z=!1,q=function(re,ye){if(Z&&(Z=!1),M)return W(),re&&y.onPaste(re),M=!1,"";for(var Ce=E.selectionStart,ke=E.selectionEnd,Te=_,Ue=k.length-F,Ke=re,ze=re.length-Ce,Be=re.length-ke,Ie=0;Te>0&&k[Ie]==re[Ie];)Ie++,Te--;for(Ke=Ke.slice(Ie),Ie=1;Ue>0&&k.length-Ie>_-1&&k[k.length-Ie]==re[re.length-Ie];)Ie++,Ue--;ze-=Ie-1,Be-=Ie-1;var et=Ke.length-Ie+1;if(et<0&&(Te=-et,et=0),Ke=Ke.slice(0,et),!ye&&!Ke&&!ze&&!Te&&!Ue&&!Be)return"";L=!0;var vt=!1;return p.isAndroid&&Ke==". "&&(Ke=" ",vt=!0),Ke&&!Te&&!Ue&&!ze&&!Be||w?y.onTextInput(Ke):y.onTextInput(Ke,{extendLeft:Te,extendRight:Ue,restoreStart:ze,restoreEnd:Be}),L=!1,k=re,_=Ce,F=ke,R=Be,vt?`
|
|
195
|
+
`:Ke},ne=function(re){if($)return ae();if(re&&re.inputType){if(re.inputType=="historyUndo")return y.execCommand("undo");if(re.inputType=="historyRedo")return y.execCommand("redo")}var ye=E.value,Ce=q(ye,!0);(ye.length>c+100||b.test(Ce)||A&&_<1&&_==F)&&W()},se=function(re,ye,Ce){var ke=re.clipboardData||window.clipboardData;if(!(!ke||s)){var Te=l||Ce?"Text":"text/plain";try{return ye?ke.setData(Te,ye)!==!1:ke.getData(Te)}catch(Ue){if(!Ce)return se(Ue,ye,!0)}}},pe=function(re,ye){var Ce=y.getCopyText();if(!Ce)return i.preventDefault(re);se(re,Ce)?(v&&(W(Ce),T=Ce,setTimeout(function(){T=!1},10)),ye?y.onCut():y.onCopy(),i.preventDefault(re)):(T=!0,E.value=Ce,E.select(),setTimeout(function(){T=!1,W(),ye?y.onCut():y.onCopy()}))},ie=function(re){pe(re,!0)},de=function(re){pe(re,!1)},ue=function(re){var ye=se(re);r.pasteCancelled()||(typeof ye=="string"?(ye&&y.onPaste(ye,re),p.isIE&&setTimeout(W),i.preventDefault(re)):(E.value="",M=!0))};i.addCommandKeyListener(E,function(re,ye,Ce){if(!$)return y.onCommandKey(re,ye,Ce)},y),i.addListener(E,"select",j,y),i.addListener(E,"input",ne,y),i.addListener(E,"cut",ie,y),i.addListener(E,"copy",de,y),i.addListener(E,"paste",ue,y),(!("oncut"in E)||!("oncopy"in E)||!("onpaste"in E))&&i.addListener(D,"keydown",function(re){if(!(p.isMac&&!re.metaKey||!re.ctrlKey))switch(re.keyCode){case 67:de(re);break;case 86:ue(re);break;case 88:ie(re);break}},y);var le=function(re){if(!($||!y.onCompositionStart||y.$readOnly)&&($={},!w)){re.data&&($.useTextareaForIME=!1),setTimeout(ae,0),y._signal("compositionStart"),y.on("mousedown",me);var ye=y.getSelectionRange();ye.end.row=ye.start.row,ye.end.column=ye.start.column,$.markerRange=ye,$.selectionStart=_,y.onCompositionStart($),$.useTextareaForIME?(k=E.value="",_=0,F=0):(E.msGetInputContext&&($.context=E.msGetInputContext()),E.getInputContext&&($.context=E.getInputContext()))}},ae=function(){if(!(!$||!y.onCompositionUpdate||y.$readOnly)){if(w)return me();if($.useTextareaForIME)y.onCompositionUpdate(E.value);else{var re=E.value;q(re),$.markerRange&&($.context&&($.markerRange.start.column=$.selectionStart=$.context.compositionStartOffset),$.markerRange.end.column=$.markerRange.start.column+F-$.selectionStart+R)}}},fe=function(re){!y.onCompositionEnd||y.$readOnly||($=!1,y.onCompositionEnd(),y.off("mousedown",me),re&&ne())};function me(){S=!0,E.blur(),E.focus(),S=!1}var ve=h.delayedCall(ae,50).schedule.bind(null,null);function Ee(re){re.keyCode==27&&E.value.length<E.selectionStart&&($||(k=E.value),_=F=-1,W()),ve()}i.addListener(E,"compositionstart",le,y),i.addListener(E,"compositionupdate",ae,y),i.addListener(E,"keyup",Ee,y),i.addListener(E,"keydown",ve,y),i.addListener(E,"compositionend",fe,y),this.getElement=function(){return E},this.setCommandMode=function(re){w=re,E.readOnly=!1},this.setReadOnly=function(re){w||(E.readOnly=re)},this.setCopyWithEmptySelection=function(re){},this.onContextMenu=function(re){Z=!0,W(),y._emit("nativecontextmenu",{target:y,domEvent:re}),this.moveToMouse(re,!0)},this.moveToMouse=function(re,ye){C||(C=E.style.cssText),E.style.cssText=(ye?"z-index:100000;":"")+(p.isIE?"opacity:0.1;":"")+"text-indent: -"+(_+F)*y.renderer.characterWidth*.5+"px;";var Ce=y.container.getBoundingClientRect(),ke=o.computedStyle(y.container),Te=Ce.top+(parseInt(ke.borderTopWidth)||0),Ue=Ce.left+(parseInt(ke.borderLeftWidth)||0),Ke=Ce.bottom-Te-E.clientHeight-2,ze=function(Be){o.translate(E,Be.clientX-Ue-2,Math.min(Be.clientY-Te-2,Ke))};ze(re),re.type=="mousedown"&&(y.renderer.$isMousePressed=!0,clearTimeout(Ge),p.isWin&&i.capture(y.container,ze,nt))},this.onContextMenuClose=nt;var Ge;function nt(){clearTimeout(Ge),Ge=setTimeout(function(){C&&(E.style.cssText=C,C=""),y.renderer.$isMousePressed=!1,y.renderer.$keepTextAreaAtCursor&&y.renderer.$moveTextAreaToCursor()},0)}var dt=function(re){y.textInput.onContextMenu(re),nt()};i.addListener(E,"mouseup",dt,y),i.addListener(E,"mousedown",function(re){re.preventDefault(),nt()},y),i.addListener(y.renderer.scroller,"contextmenu",dt,y),i.addListener(E,"contextmenu",dt,y),v&&Ze(D,y,E);function Ze(re,ye,Ce){var ke=null,Te=!1;Ce.addEventListener("keydown",function(Ke){ke&&clearTimeout(ke),Te=!0},!0),Ce.addEventListener("keyup",function(Ke){ke=setTimeout(function(){Te=!1},100)},!0);var Ue=function(Ke){if(document.activeElement===Ce&&!(Te||$||ye.$mouseHandler.isMousePressed)&&!T){var ze=Ce.selectionStart,Be=Ce.selectionEnd,Ie=null,et=0;if(ze==0?Ie=f.up:ze==1?Ie=f.home:Be>F&&k[Be]==`
|
|
196
|
+
`?Ie=f.end:ze<_&&k[ze-1]==" "?(Ie=f.left,et=g.option):ze<_||ze==_&&F!=_&&ze==Be?Ie=f.left:Be>F&&k.slice(0,Be).split(`
|
|
197
|
+
`).length>2?Ie=f.down:Be>F&&k[Be-1]==" "?(Ie=f.right,et=g.option):(Be>F||Be==F&&F!=_&&ze==Be)&&(Ie=f.right),ze!==Be&&(et|=g.shift),Ie){var vt=ye.onCommandKey({},et,Ie);if(!vt&&ye.commands){Ie=f.keyCodeToString(Ie);var Cn=ye.commands.findKeyCommand(et,Ie);Cn&&ye.execCommand(Cn)}_=ze,F=Be,W("")}}};document.addEventListener("selectionchange",Ue),ye.on("destroy",function(){document.removeEventListener("selectionchange",Ue)})}this.destroy=function(){E.parentElement&&E.parentElement.removeChild(E)}},n.TextInput=x,n.$setUserAgentForTests=function(D,y){A=D,v=y}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,n,m){var i=t("../lib/useragent"),a=0,p=550,o=function(){function s(l){l.$clickSelection=null;var u=l.editor;u.setDefaultHandler("mousedown",this.onMouseDown.bind(l)),u.setDefaultHandler("dblclick",this.onDoubleClick.bind(l)),u.setDefaultHandler("tripleclick",this.onTripleClick.bind(l)),u.setDefaultHandler("quadclick",this.onQuadClick.bind(l)),u.setDefaultHandler("mousewheel",this.onMouseWheel.bind(l));var c=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];c.forEach(function(f){l[f]=this[f]},this),l.selectByLines=this.extendSelectionBy.bind(l,"getLineRange"),l.selectByWords=this.extendSelectionBy.bind(l,"getWordRange")}return s.prototype.onMouseDown=function(l){var u=l.inSelection(),c=l.getDocumentPosition();this.mousedownEvent=l;var f=this.editor,g=l.getButton();if(g!==0){var v=f.getSelectionRange(),b=v.isEmpty();(b||g==1)&&f.selection.moveToPosition(c),g==2&&(f.textInput.onContextMenu(l.domEvent),i.isMozilla||l.preventDefault());return}if(this.mousedownEvent.time=Date.now(),u&&!f.isFocused()&&(f.focus(),this.$focusTimeout&&!this.$clickSelection&&!f.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(l);return}return this.captureMouse(l),this.startSelect(c,l.domEvent._clicks>1),l.preventDefault()},s.prototype.startSelect=function(l,u){l=l||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var c=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?c.selection.selectToPosition(l):u||c.selection.moveToPosition(l),u||this.select(),c.setStyle("ace_selecting"),this.setState("select"))},s.prototype.select=function(){var l,u=this.editor,c=u.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var f=this.$clickSelection.comparePoint(c);if(f==-1)l=this.$clickSelection.end;else if(f==1)l=this.$clickSelection.start;else{var g=r(this.$clickSelection,c);c=g.cursor,l=g.anchor}u.selection.setSelectionAnchor(l.row,l.column)}u.selection.selectToPosition(c),u.renderer.scrollCursorIntoView()},s.prototype.extendSelectionBy=function(l){var u,c=this.editor,f=c.renderer.screenToTextCoordinates(this.x,this.y),g=c.selection[l](f.row,f.column);if(this.$clickSelection){var v=this.$clickSelection.comparePoint(g.start),b=this.$clickSelection.comparePoint(g.end);if(v==-1&&b<=0)u=this.$clickSelection.end,(g.end.row!=f.row||g.end.column!=f.column)&&(f=g.start);else if(b==1&&v>=0)u=this.$clickSelection.start,(g.start.row!=f.row||g.start.column!=f.column)&&(f=g.end);else if(v==-1&&b==1)f=g.end,u=g.start;else{var A=r(this.$clickSelection,f);f=A.cursor,u=A.anchor}c.selection.setSelectionAnchor(u.row,u.column)}c.selection.selectToPosition(f),c.renderer.scrollCursorIntoView()},s.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},s.prototype.focusWait=function(){var l=h(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),u=Date.now();(l>a||u-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},s.prototype.onDoubleClick=function(l){var u=l.getDocumentPosition(),c=this.editor,f=c.session,g=f.getBracketRange(u);g?(g.isEmpty()&&(g.start.column--,g.end.column++),this.setState("select")):(g=c.selection.getWordRange(u.row,u.column),this.setState("selectByWords")),this.$clickSelection=g,this.select()},s.prototype.onTripleClick=function(l){var u=l.getDocumentPosition(),c=this.editor;this.setState("selectByLines");var f=c.getSelectionRange();f.isMultiLine()&&f.contains(u.row,u.column)?(this.$clickSelection=c.selection.getLineRange(f.start.row),this.$clickSelection.end=c.selection.getLineRange(f.end.row).end):this.$clickSelection=c.selection.getLineRange(u.row),this.select()},s.prototype.onQuadClick=function(l){var u=this.editor;u.selectAll(),this.$clickSelection=u.getSelectionRange(),this.setState("selectAll")},s.prototype.onMouseWheel=function(l){if(!l.getAccelKey()){l.getShiftKey()&&l.wheelY&&!l.wheelX&&(l.wheelX=l.wheelY,l.wheelY=0);var u=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var c=this.$lastScroll,f=l.domEvent.timeStamp,g=f-c.t,v=g?l.wheelX/g:c.vx,b=g?l.wheelY/g:c.vy;g<p&&(v=(v+c.vx)/2,b=(b+c.vy)/2);var A=Math.abs(v/b),x=!1;if(A>=1&&u.renderer.isScrollableBy(l.wheelX*l.speed,0)&&(x=!0),A<=1&&u.renderer.isScrollableBy(0,l.wheelY*l.speed)&&(x=!0),x)c.allowed=f;else if(f-c.allowed<p){var D=Math.abs(v)<=1.5*Math.abs(c.vx)&&Math.abs(b)<=1.5*Math.abs(c.vy);D?(x=!0,c.allowed=f):c.allowed=0}if(c.t=f,c.vx=v,c.vy=b,x)return u.renderer.scrollBy(l.wheelX*l.speed,l.wheelY*l.speed),l.stop()}},s}();o.prototype.selectEnd=o.prototype.selectByLinesEnd,o.prototype.selectAllEnd=o.prototype.selectByLinesEnd,o.prototype.selectByWordsEnd=o.prototype.selectByLinesEnd,n.DefaultHandlers=o;function h(s,l,u,c){return Math.sqrt(Math.pow(u-s,2)+Math.pow(c-l,2))}function r(s,l){if(s.start.row==s.end.row)var u=2*l.column-s.start.column-s.end.column;else if(s.start.row==s.end.row-1&&!s.start.column&&!s.end.column)var u=l.column-4;else var u=2*l.row-s.start.row-s.end.row;return u<0?{cursor:s.start,anchor:s.end}:{cursor:s.end,anchor:s.start}}}),ace.define("ace/lib/scroll",["require","exports","module"],function(t,n,m){n.preventParentScroll=function(a){a.stopPropagation();var p=a.currentTarget,o=p.scrollHeight>p.clientHeight;o||a.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(t,n,m){var i=this&&this.__extends||function(){var f=function(g,v){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,A){b.__proto__=A}||function(b,A){for(var x in A)Object.prototype.hasOwnProperty.call(A,x)&&(b[x]=A[x])},f(g,v)};return function(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");f(g,v);function b(){this.constructor=g}g.prototype=v===null?Object.create(v):(b.prototype=v.prototype,new b)}}(),a=this&&this.__values||function(f){var g=typeof Symbol=="function"&&Symbol.iterator,v=g&&f[g],b=0;if(v)return v.call(f);if(f&&typeof f.length=="number")return{next:function(){return f&&b>=f.length&&(f=void 0),{value:f&&f[b++],done:!f}}};throw new TypeError(g?"Object is not iterable.":"Symbol.iterator is not defined.")},p=t("./lib/dom");t("./lib/event");var o=t("./range").Range,h=t("./lib/scroll").preventParentScroll,r="ace_tooltip",s=function(){function f(g){this.isOpen=!1,this.$element=null,this.$parentNode=g}return f.prototype.$init=function(){return this.$element=p.createElement("div"),this.$element.className=r,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},f.prototype.getElement=function(){return this.$element||this.$init()},f.prototype.setText=function(g){this.getElement().textContent=g},f.prototype.setHtml=function(g){this.getElement().innerHTML=g},f.prototype.setPosition=function(g,v){this.getElement().style.left=g+"px",this.getElement().style.top=v+"px"},f.prototype.setClassName=function(g){p.addCssClass(this.getElement(),g)},f.prototype.setTheme=function(g){this.$element.className=r+" "+(g.isDark?"ace_dark ":"")+(g.cssClass||"")},f.prototype.show=function(g,v,b){g!=null&&this.setText(g),v!=null&&b!=null&&this.setPosition(v,b),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},f.prototype.hide=function(g){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=r,this.isOpen=!1)},f.prototype.getHeight=function(){return this.getElement().offsetHeight},f.prototype.getWidth=function(){return this.getElement().offsetWidth},f.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},f}(),l=function(){function f(){this.popups=[]}return f.prototype.addPopup=function(g){this.popups.push(g),this.updatePopups()},f.prototype.removePopup=function(g){var v=this.popups.indexOf(g);v!==-1&&(this.popups.splice(v,1),this.updatePopups())},f.prototype.updatePopups=function(){var g,v,b,A;this.popups.sort(function(C,w){return w.priority-C.priority});var x=[];try{for(var D=a(this.popups),y=D.next();!y.done;y=D.next()){var E=y.value,T=!0;try{for(var M=(b=void 0,a(x)),$=M.next();!$.done;$=M.next()){var L=$.value;if(this.doPopupsOverlap(L,E)){T=!1;break}}}catch(C){b={error:C}}finally{try{$&&!$.done&&(A=M.return)&&A.call(M)}finally{if(b)throw b.error}}T?x.push(E):E.hide()}}catch(C){g={error:C}}finally{try{y&&!y.done&&(v=D.return)&&v.call(D)}finally{if(g)throw g.error}}},f.prototype.doPopupsOverlap=function(g,v){var b=g.getElement().getBoundingClientRect(),A=v.getElement().getBoundingClientRect();return b.left<A.right&&b.right>A.left&&b.top<A.bottom&&b.bottom>A.top},f}(),u=new l;n.popupManager=u,n.Tooltip=s;var c=function(f){i(g,f);function g(v){v===void 0&&(v=document.body);var b=f.call(this,v)||this;b.timeout=void 0,b.lastT=0,b.idleTime=350,b.lastEvent=void 0,b.onMouseOut=b.onMouseOut.bind(b),b.onMouseMove=b.onMouseMove.bind(b),b.waitForHover=b.waitForHover.bind(b),b.hide=b.hide.bind(b);var A=b.getElement();return A.style.whiteSpace="pre-wrap",A.style.pointerEvents="auto",A.addEventListener("mouseout",b.onMouseOut),A.tabIndex=-1,A.addEventListener("blur",function(){A.contains(document.activeElement)||this.hide()}.bind(b)),A.addEventListener("wheel",h),b}return g.prototype.addToEditor=function(v){v.on("mousemove",this.onMouseMove),v.on("mousedown",this.hide),v.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},g.prototype.removeFromEditor=function(v){v.off("mousemove",this.onMouseMove),v.off("mousedown",this.hide),v.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},g.prototype.onMouseMove=function(v,b){this.lastEvent=v,this.lastT=Date.now();var A=b.$mouseHandler.isMousePressed;if(this.isOpen){var x=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(x.row,x.column)||A||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||A||(this.lastEvent=v,this.timeout=setTimeout(this.waitForHover,this.idleTime))},g.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var v=Date.now()-this.lastT;if(this.idleTime-v>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-v);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},g.prototype.isOutsideOfText=function(v){var b=v.editor,A=v.getDocumentPosition(),x=b.session.getLine(A.row);if(A.column==x.length){var D=b.renderer.pixelToScreenCoordinates(v.clientX,v.clientY),y=b.session.documentToScreenPosition(A.row,A.column);if(y.column!=D.column||y.row!=D.row)return!0}return!1},g.prototype.setDataProvider=function(v){this.$gatherData=v},g.prototype.showForRange=function(v,b,A,x){var D=10;if(!(x&&x!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var y=v.renderer;this.isOpen||(u.addPopup(this),this.$registerCloseEvents(),this.setTheme(y.theme)),this.isOpen=!0,this.addMarker(b,v.session),this.range=o.fromPoints(b.start,b.end);var E=y.textToScreenCoordinates(b.start.row,b.start.column),T=y.scroller.getBoundingClientRect();E.pageX<T.left&&(E.pageX=T.left);var M=this.getElement();M.innerHTML="",M.appendChild(A),M.style.maxHeight="",M.style.display="block";var $=M.clientHeight,L=M.clientWidth,C=window.innerHeight-E.pageY-y.lineHeight,w=!0;E.pageY-$<0&&E.pageY<C&&(w=!1),M.style.maxHeight=(w?E.pageY:C)-D+"px",M.style.top=w?"":E.pageY+y.lineHeight+"px",M.style.bottom=w?window.innerHeight-E.pageY+"px":"",M.style.left=Math.min(E.pageX,window.innerWidth-L-D)+"px"}},g.prototype.addMarker=function(v,b){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=b,this.marker=b&&b.addMarker(v,"ace_highlight-marker","text")},g.prototype.hide=function(v){!v&&document.activeElement==this.getElement()||v&&v.target&&(v.type!="keydown"||v.ctrlKey||v.metaKey)&&this.$element.contains(v.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,u.removePopup(this)))},g.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},g.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},g.prototype.onMouseOut=function(v){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!v.relatedTarget||this.getElement().contains(v.relatedTarget)||v&&v.currentTarget.contains(v.relatedTarget)||v.relatedTarget.classList.contains("ace_content")||this.hide())},g}(s);n.HoverTooltip=c}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config"],function(t,n,m){var i=this&&this.__extends||function(){var f=function(g,v){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,A){b.__proto__=A}||function(b,A){for(var x in A)Object.prototype.hasOwnProperty.call(A,x)&&(b[x]=A[x])},f(g,v)};return function(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");f(g,v);function b(){this.constructor=g}g.prototype=v===null?Object.create(v):(b.prototype=v.prototype,new b)}}(),a=this&&this.__values||function(f){var g=typeof Symbol=="function"&&Symbol.iterator,v=g&&f[g],b=0;if(v)return v.call(f);if(f&&typeof f.length=="number")return{next:function(){return f&&b>=f.length&&(f=void 0),{value:f&&f[b++],done:!f}}};throw new TypeError(g?"Object is not iterable.":"Symbol.iterator is not defined.")},p=t("../lib/dom"),o=t("../lib/event"),h=t("../tooltip").Tooltip,r=t("../config").nls,s=5,l=3;n.GUTTER_TOOLTIP_LEFT_OFFSET=s,n.GUTTER_TOOLTIP_TOP_OFFSET=l;function u(f){var g=f.editor,v=g.renderer.$gutterLayer,b=new c(g,!0);f.editor.setDefaultHandler("guttermousedown",function(T){if(!(!g.isFocused()||T.getButton()!=0)){var M=v.getRegion(T);if(M!="foldWidgets"){var $=T.getDocumentPosition().row,L=g.session.selection;if(T.getShiftKey())L.selectTo($,0);else{if(T.domEvent.detail==2)return g.selectAll(),T.preventDefault();f.$clickSelection=g.selection.getLineRange($)}return f.setState("selectByLines"),f.captureMouse(T),T.preventDefault()}}});var A,x;function D(){var T=x.getDocumentPosition().row,M=g.session.getLength();if(T==M){var $=g.renderer.pixelToScreenCoordinates(0,x.y).row,L=x.$pos;if($>g.session.documentToScreenRow(L.row,L.column))return y()}if(b.showTooltip(T),!!b.isOpen)if(g.on("mousewheel",y),g.on("changeSession",y),window.addEventListener("keydown",y,!0),f.$tooltipFollowsMouse)E(x);else{var C=x.getGutterRow(),w=v.$lines.get(C);if(w){var S=w.element.querySelector(".ace_gutter_annotation"),k=S.getBoundingClientRect(),_=b.getElement().style;_.left=k.right-s+"px",_.top=k.bottom-l+"px"}else E(x)}}function y(T){T&&T.type==="keydown"&&(T.ctrlKey||T.metaKey)||T&&T.type==="mouseout"&&(!T.relatedTarget||b.getElement().contains(T.relatedTarget))||(A&&(A=clearTimeout(A)),b.isOpen&&(b.hideTooltip(),g.off("mousewheel",y),g.off("changeSession",y),window.removeEventListener("keydown",y,!0)))}function E(T){b.setPosition(T.x,T.y)}f.editor.setDefaultHandler("guttermousemove",function(T){var M=T.domEvent.target||T.domEvent.srcElement;if(p.hasCssClass(M,"ace_fold-widget"))return y();b.isOpen&&f.$tooltipFollowsMouse&&E(T),x=T,!A&&(A=setTimeout(function(){A=null,x&&!f.isMousePressed&&D()},50))}),o.addListener(g.renderer.$gutter,"mouseout",function(T){x=null,b.isOpen&&(A=setTimeout(function(){A=null,y(T)},50))},g)}n.GutterHandler=u;var c=function(f){i(g,f);function g(v,b){b===void 0&&(b=!1);var A=f.call(this,v.container)||this;A.editor=v,A.visibleTooltipRow;var x=A.getElement();return x.setAttribute("role","tooltip"),x.style.pointerEvents="auto",b&&(A.onMouseOut=A.onMouseOut.bind(A),x.addEventListener("mouseout",A.onMouseOut)),A}return g.prototype.onMouseOut=function(v){this.isOpen&&(!v.relatedTarget||this.getElement().contains(v.relatedTarget)||v&&v.currentTarget.contains(v.relatedTarget)||this.hideTooltip())},g.prototype.setPosition=function(v,b){var A=window.innerWidth||document.documentElement.clientWidth,x=window.innerHeight||document.documentElement.clientHeight,D=this.getWidth(),y=this.getHeight();v+=15,b+=15,v+D>A&&(v-=v+D-A),b+y>x&&(b-=20+y),h.prototype.setPosition.call(this,v,b)},Object.defineProperty(g,"annotationLabels",{get:function(){return{error:{singular:r("gutter-tooltip.aria-label.error.singular","error"),plural:r("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:r("gutter-tooltip.aria-label.security.singular","security finding"),plural:r("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:r("gutter-tooltip.aria-label.warning.singular","warning"),plural:r("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:r("gutter-tooltip.aria-label.info.singular","information message"),plural:r("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:r("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:r("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),g.prototype.showTooltip=function(v){var b,A=this.editor.renderer.$gutterLayer,x=A.$annotations[v],D;x?D={displayText:Array.from(x.displayText),type:Array.from(x.type)}:D={displayText:[],type:[]};var y=A.session.getFoldLine(v);if(y&&A.$showFoldedAnnotations){for(var E={error:[],security:[],warning:[],info:[],hint:[]},T={error:1,security:2,warning:3,info:4,hint:5},M,$=v+1;$<=y.end.row;$++)if(A.$annotations[$])for(var L=0;L<A.$annotations[$].text.length;L++){var C=A.$annotations[$].type[L];E[C].push(A.$annotations[$].text[L]),(!M||T[C]<T[M])&&(M=C)}if(["error","security","warning"].includes(M)){var w="".concat(g.annotationsToSummaryString(E)," in folded code.");D.displayText.push(w),D.type.push(M+"_fold")}}if(D.displayText.length===0)return this.hideTooltip();for(var S={error:[],security:[],warning:[],info:[],hint:[]},k=A.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",$=0;$<D.displayText.length;$++){var _=p.createElement("span"),F=p.createElement("span");(b=F.classList).add.apply(b,["ace_".concat(D.type[$]),k]),F.setAttribute("aria-label","".concat(g.annotationLabels[D.type[$].replace("_fold","")].singular)),F.setAttribute("role","img"),F.appendChild(p.createTextNode(" ")),_.appendChild(F),_.appendChild(p.createTextNode(D.displayText[$])),_.appendChild(p.createElement("br")),S[D.type[$].replace("_fold","")].push(_)}var R=this.getElement();p.removeChildren(R),S.error.forEach(function(O){return R.appendChild(O)}),S.security.forEach(function(O){return R.appendChild(O)}),S.warning.forEach(function(O){return R.appendChild(O)}),S.info.forEach(function(O){return R.appendChild(O)}),S.hint.forEach(function(O){return R.appendChild(O)}),R.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.visibleTooltipRow=v,this.editor._signal("showGutterTooltip",this)},g.prototype.hideTooltip=function(){this.isOpen&&(this.$element.removeAttribute("aria-live"),this.hide(),this.visibleTooltipRow=void 0,this.editor._signal("hideGutterTooltip",this))},g.annotationsToSummaryString=function(v){var b,A,x=[],D=["error","security","warning","info","hint"];try{for(var y=a(D),E=y.next();!E.done;E=y.next()){var T=E.value;if(v[T].length){var M=v[T].length===1?g.annotationLabels[T].singular:g.annotationLabels[T].plural;x.push("".concat(v[T].length," ").concat(M))}}}catch($){b={error:$}}finally{try{E&&!E.done&&(A=y.return)&&A.call(y)}finally{if(b)throw b.error}}return x.join(", ")},g}(h);n.GutterTooltip=c}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,m){var i=t("../lib/event"),a=t("../lib/useragent"),p=function(){function o(h,r){this.speed,this.wheelX,this.wheelY,this.domEvent=h,this.editor=r,this.x=this.clientX=h.clientX,this.y=this.clientY=h.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return o.prototype.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},o.prototype.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},o.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},o.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},o.prototype.getGutterRow=function(){var h=this.getDocumentPosition().row,r=this.editor.session.documentToScreenRow(h,0),s=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return r-s},o.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var h=this.editor,r=h.getSelectionRange();if(r.isEmpty())this.$inSelection=!1;else{var s=this.getDocumentPosition();this.$inSelection=r.contains(s.row,s.column)}return this.$inSelection},o.prototype.getButton=function(){return i.getButton(this.domEvent)},o.prototype.getShiftKey=function(){return this.domEvent.shiftKey},o.prototype.getAccelKey=function(){return a.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},o}();n.MouseEvent=p}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,n,m){var i=t("../lib/dom"),a=t("../lib/event"),p=t("../lib/useragent"),o=200,h=200,r=5;function s(u){var c=u.editor,f=i.createElement("div");f.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",f.textContent=" ";var g=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];g.forEach(function(N){u[N]=this[N]},this),c.on("mousedown",this.onMouseDown.bind(u));var v=c.container,b,A,x,D,y,E,T=0,M,$,L,C,w;this.onDragStart=function(N){if(this.cancelDrag||!v.draggable){var W=this;return setTimeout(function(){W.startSelect(),W.captureMouse(N)},0),N.preventDefault()}y=c.getSelectionRange();var z=N.dataTransfer;z.effectAllowed=c.getReadOnly()?"copy":"copyMove",c.container.appendChild(f),z.setDragImage&&z.setDragImage(f,0,0),setTimeout(function(){c.container.removeChild(f)}),z.clearData(),z.setData("Text",c.session.getTextRange()),$=!0,this.setState("drag")},this.onDragEnd=function(N){if(v.draggable=!1,$=!1,this.setState(null),!c.getReadOnly()){var W=N.dataTransfer.dropEffect;!M&&W=="move"&&c.session.remove(c.getSelectionRange()),c.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(N){if(!(c.getReadOnly()||!P(N.dataTransfer)))return A=N.clientX,x=N.clientY,b||F(),T++,N.dataTransfer.dropEffect=M=H(N),a.preventDefault(N)},this.onDragOver=function(N){if(!(c.getReadOnly()||!P(N.dataTransfer)))return A=N.clientX,x=N.clientY,b||(F(),T++),O!==null&&(O=null),N.dataTransfer.dropEffect=M=H(N),a.preventDefault(N)},this.onDragLeave=function(N){if(T--,T<=0&&b)return R(),M=null,a.preventDefault(N)},this.onDrop=function(N){if(E){var W=N.dataTransfer;if($)switch(M){case"move":y.contains(E.row,E.column)?y={start:E,end:E}:y=c.moveText(y,E);break;case"copy":y=c.moveText(y,E,!0);break}else{var z=W.getData("Text");y={start:E,end:c.session.insert(E,z)},c.focus(),M=null}return R(),a.preventDefault(N)}},a.addListener(v,"dragstart",this.onDragStart.bind(u),c),a.addListener(v,"dragend",this.onDragEnd.bind(u),c),a.addListener(v,"dragenter",this.onDragEnter.bind(u),c),a.addListener(v,"dragover",this.onDragOver.bind(u),c),a.addListener(v,"dragleave",this.onDragLeave.bind(u),c),a.addListener(v,"drop",this.onDrop.bind(u),c);function S(N,W){var z=Date.now(),j=!W||N.row!=W.row,Q=!W||N.column!=W.column;if(!C||j||Q)c.moveCursorToPosition(N),C=z,w={x:A,y:x};else{var Z=l(w.x,w.y,A,x);Z>r?C=null:z-C>=h&&(c.renderer.scrollCursorIntoView(),C=null)}}function k(N,W){var z=Date.now(),j=c.renderer.layerConfig.lineHeight,Q=c.renderer.layerConfig.characterWidth,Z=c.renderer.scroller.getBoundingClientRect(),q={x:{left:A-Z.left,right:Z.right-A},y:{top:x-Z.top,bottom:Z.bottom-x}},ne=Math.min(q.x.left,q.x.right),se=Math.min(q.y.top,q.y.bottom),pe={row:N.row,column:N.column};ne/Q<=2&&(pe.column+=q.x.left<q.x.right?-3:2),se/j<=1&&(pe.row+=q.y.top<q.y.bottom?-1:1);var ie=N.row!=pe.row,de=N.column!=pe.column,ue=!W||N.row!=W.row;ie||de&&!ue?L?z-L>=o&&c.renderer.scrollCursorIntoView(pe):L=z:L=null}function _(){var N=E;E=c.renderer.screenToTextCoordinates(A,x),S(E,N),k(E,N)}function F(){y=c.selection.toOrientedRange(),b=c.session.addMarker(y,"ace_selection",c.getSelectionStyle()),c.clearSelection(),c.isFocused()&&c.renderer.$cursorLayer.setBlinking(!1),clearInterval(D),_(),D=setInterval(_,20),T=0,a.addListener(document,"mousemove",V)}function R(){clearInterval(D),c.session.removeMarker(b),b=null,c.selection.fromOrientedRange(y),c.isFocused()&&!$&&c.$resetCursorStyle(),y=null,E=null,T=0,L=null,C=null,a.removeListener(document,"mousemove",V)}var O=null;function V(){O==null&&(O=setTimeout(function(){O!=null&&b&&R()},20))}function P(N){var W=N.types;return!W||Array.prototype.some.call(W,function(z){return z=="text/plain"||z=="Text"})}function H(N){var W=["copy","copymove","all","uninitialized"],z=["move","copymove","linkmove","all","uninitialized"],j=p.isMac?N.altKey:N.ctrlKey,Q="uninitialized";try{Q=N.dataTransfer.effectAllowed.toLowerCase()}catch{}var Z="none";return j&&W.indexOf(Q)>=0?Z="copy":z.indexOf(Q)>=0?Z="move":W.indexOf(Q)>=0&&(Z="copy"),Z}}(function(){this.dragWait=function(){var u=Date.now()-this.mousedownEvent.time;u>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var u=this.editor.container;u.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(u){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var u=this.editor,c=u.container;c.draggable=!0,u.renderer.$cursorLayer.setBlinking(!1),u.setStyle("ace_dragging");var f=p.isWin?"default":"move";u.renderer.setCursorStyle(f),this.setState("dragReady")},this.onMouseDrag=function(u){var c=this.editor.container;if(p.isIE&&this.state=="dragReady"){var f=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);f>3&&c.dragDrop()}if(this.state==="dragWait"){var f=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);f>0&&(c.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(u){if(this.$dragEnabled){this.mousedownEvent=u;var c=this.editor,f=u.inSelection(),g=u.getButton(),v=u.domEvent.detail||1;if(v===1&&g===0&&f){if(u.editor.inMultiSelectMode&&(u.getAccelKey()||u.getShiftKey()))return;this.mousedownEvent.time=Date.now();var b=u.domEvent.target||u.domEvent.srcElement;if("unselectable"in b&&(b.unselectable="on"),c.getDragDelay()){if(p.isWebKit){this.cancelDrag=!0;var A=c.container;A.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(u,this.onMouseDrag.bind(this)),u.defaultPrevented=!0}}}}).call(s.prototype);function l(u,c,f,g){return Math.sqrt(Math.pow(f-u,2)+Math.pow(g-c,2))}n.DragdropHandler=s}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(t,n,m){var i=t("./mouse_event").MouseEvent,a=t("../lib/event"),p=t("../lib/dom");n.addTouchListeners=function(o,h){var r="scroll",s,l,u,c,f,g,v=0,b,A=0,x=0,D=0,y,E;function T(){var S=window.navigator&&window.navigator.clipboard,k=!1,_=function(){var O=h.getCopyText(),V=h.session.getUndoManager().hasUndo();E.replaceChild(p.buildDom(k?["span",!O&&F("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],O&&F("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],O&&F("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],S&&F("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],V&&F("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],F("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],F("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),E.firstChild)},F=function(O){return h.commands.canExecute(O,h)},R=function(O){var V=O.target.getAttribute("action");if(V=="more"||!k)return k=!k,_();V=="paste"?S.readText().then(function(P){h.execCommand(V,P)}):V&&((V=="cut"||V=="copy")&&(S?S.writeText(h.getCopyText()):document.execCommand("copy")),h.execCommand(V)),E.firstChild.style.display="none",k=!1,V!="openCommandPalette"&&h.focus()};E=p.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(O){r="menu",O.stopPropagation(),O.preventDefault(),h.textInput.focus()},ontouchend:function(O){O.stopPropagation(),O.preventDefault(),R(O)},onclick:R},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],h.container)}function M(){if(!h.getOption("enableMobileMenu")){E&&$();return}E||T();var S=h.selection.cursor,k=h.renderer.textToScreenCoordinates(S.row,S.column),_=h.renderer.textToScreenCoordinates(0,0).pageX,F=h.renderer.scrollLeft,R=h.container.getBoundingClientRect();E.style.top=k.pageY-R.top-3+"px",k.pageX-R.left<R.width-70?(E.style.left="",E.style.right="10px"):(E.style.right="",E.style.left=_+F-R.left+"px"),E.style.display="",E.firstChild.style.display="none",h.on("input",$)}function $(S){E&&(E.style.display="none"),h.off("input",$)}function L(){f=null,clearTimeout(f);var S=h.selection.getRange(),k=S.contains(b.row,b.column);(S.isEmpty()||!k)&&(h.selection.moveToPosition(b),h.selection.selectWord()),r="wait",M()}function C(){f=null,clearTimeout(f),h.selection.moveToPosition(b);var S=A>=2?h.selection.getLineRange(b.row):h.session.getBracketRange(b);S&&!S.isEmpty()?h.selection.setRange(S):h.selection.selectWord(),r="wait"}a.addListener(o,"contextmenu",function(S){if(y){var k=h.textInput.getElement();k.focus()}},h),a.addListener(o,"touchstart",function(S){var k=S.touches;if(f||k.length>1){clearTimeout(f),f=null,u=-1,r="zoom";return}y=h.$mouseHandler.isMousePressed=!0;var _=h.renderer.layerConfig.lineHeight,F=h.renderer.layerConfig.lineHeight,R=S.timeStamp;c=R;var O=k[0],V=O.clientX,P=O.clientY;Math.abs(s-V)+Math.abs(l-P)>_&&(u=-1),s=S.clientX=V,l=S.clientY=P,x=D=0;var H=new i(S,h);if(b=H.getDocumentPosition(),R-u<500&&k.length==1&&!v)A++,S.preventDefault(),S.button=0,C();else{A=0;var N=h.selection.cursor,W=h.selection.isEmpty()?N:h.selection.anchor,z=h.renderer.$cursorLayer.getPixelPosition(N,!0),j=h.renderer.$cursorLayer.getPixelPosition(W,!0),Q=h.renderer.scroller.getBoundingClientRect(),Z=h.renderer.layerConfig.offset,q=h.renderer.scrollLeft,ne=function(ie,de){return ie=ie/F,de=de/_-.75,ie*ie+de*de};if(S.clientX<Q.left){r="zoom";return}var se=ne(S.clientX-Q.left-z.left+q,S.clientY-Q.top-z.top+Z),pe=ne(S.clientX-Q.left-j.left+q,S.clientY-Q.top-j.top+Z);se<3.5&&pe<3.5&&(r=se>pe?"cursor":"anchor"),pe<3.5?r="anchor":se<3.5?r="cursor":r="scroll",f=setTimeout(L,450)}u=R},h),a.addListener(o,"touchend",function(S){y=h.$mouseHandler.isMousePressed=!1,g&&clearInterval(g),r=="zoom"?(r="",v=0):f?(h.selection.moveToPosition(b),v=0,M()):r=="scroll"?(w(),$()):M(),clearTimeout(f),f=null},h),a.addListener(o,"touchmove",function(S){f&&(clearTimeout(f),f=null);var k=S.touches;if(!(k.length>1||r=="zoom")){var _=k[0],F=s-_.clientX,R=l-_.clientY;if(r=="wait")if(F*F+R*R>4)r="cursor";else return S.preventDefault();s=_.clientX,l=_.clientY,S.clientX=_.clientX,S.clientY=_.clientY;var O=S.timeStamp,V=O-c;if(c=O,r=="scroll"){var P=new i(S,h);P.speed=1,P.wheelX=F,P.wheelY=R,10*Math.abs(F)<Math.abs(R)&&(F=0),10*Math.abs(R)<Math.abs(F)&&(R=0),V!=0&&(x=F/V,D=R/V),h._emit("mousewheel",P),P.propagationStopped||(x=D=0)}else{var H=new i(S,h),N=H.getDocumentPosition();r=="cursor"?h.selection.moveCursorToPosition(N):r=="anchor"&&h.selection.setSelectionAnchor(N.row,N.column),h.renderer.scrollCursorIntoView(N),S.preventDefault()}}},h);function w(){v+=60,g=setInterval(function(){v--<=0&&(clearInterval(g),g=null),Math.abs(x)<.01&&(x=0),Math.abs(D)<.01&&(D=0),v<20&&(x=.9*x),v<20&&(D=.9*D);var S=h.session.getScrollTop();h.renderer.scrollBy(10*x,10*D),S==h.session.getScrollTop()&&(v=0)},10)}}}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(t,n,m){var i=t("../lib/event"),a=t("../lib/useragent"),p=t("./default_handlers").DefaultHandlers,o=t("./default_gutter_handler").GutterHandler,h=t("./mouse_event").MouseEvent,r=t("./dragdrop_handler").DragdropHandler,s=t("./touch_handler").addTouchListeners,l=t("../config"),u=function(){function c(f){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var g=this;this.editor=f,new p(this),new o(this),new r(this);var v=function(x){var D=!document.hasFocus||!document.hasFocus()||!f.isFocused()&&document.activeElement==(f.textInput&&f.textInput.getElement());D&&window.focus(),f.focus(),setTimeout(function(){f.isFocused()||f.focus()})},b=f.renderer.getMouseEventTarget();i.addListener(b,"click",this.onMouseEvent.bind(this,"click"),f),i.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove"),f),i.addMultiMouseDownListener([b,f.renderer.scrollBarV&&f.renderer.scrollBarV.inner,f.renderer.scrollBarH&&f.renderer.scrollBarH.inner,f.textInput&&f.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",f),i.addMouseWheelListener(f.container,this.onMouseWheel.bind(this,"mousewheel"),f),s(f.container,f);var A=f.renderer.$gutter;i.addListener(A,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),f),i.addListener(A,"click",this.onMouseEvent.bind(this,"gutterclick"),f),i.addListener(A,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),f),i.addListener(A,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),f),i.addListener(b,"mousedown",v,f),i.addListener(A,"mousedown",v,f),a.isIE&&f.renderer.scrollBarV&&(i.addListener(f.renderer.scrollBarV.element,"mousedown",v,f),i.addListener(f.renderer.scrollBarH.element,"mousedown",v,f)),f.on("mousemove",function(x){if(!(g.state||g.$dragDelay||!g.$dragEnabled)){var D=f.renderer.screenToTextCoordinates(x.x,x.y),y=f.session.selection.getRange(),E=f.renderer;!y.isEmpty()&&y.insideStart(D.row,D.column)?E.setCursorStyle("default"):E.setCursorStyle("")}},f)}return c.prototype.onMouseEvent=function(f,g){this.editor.session&&this.editor._emit(f,new h(g,this.editor))},c.prototype.onMouseMove=function(f,g){var v=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!v||!v.length||this.editor._emit(f,new h(g,this.editor))},c.prototype.onMouseWheel=function(f,g){var v=new h(g,this.editor);v.speed=this.$scrollSpeed*2,v.wheelX=g.wheelX,v.wheelY=g.wheelY,this.editor._emit(f,v)},c.prototype.setState=function(f){this.state=f},c.prototype.captureMouse=function(f,g){this.x=f.x,this.y=f.y,this.isMousePressed=!0;var v=this.editor,b=this.editor.renderer;b.$isMousePressed=!0;var A=this,x=function(M){if(M){if(a.isWebKit&&!M.which&&A.releaseMouse)return A.releaseMouse();A.x=M.clientX,A.y=M.clientY,g&&g(M),A.mouseEvent=new h(M,A.editor),A.$mouseMoved=!0}},D=function(M){v.off("beforeEndOperation",E),clearInterval(T),v.session&&y(),A[A.state+"End"]&&A[A.state+"End"](M),A.state="",A.isMousePressed=b.$isMousePressed=!1,b.$keepTextAreaAtCursor&&b.$moveTextAreaToCursor(),A.$onCaptureMouseMove=A.releaseMouse=null,M&&A.onMouseEvent("mouseup",M),v.endOperation()},y=function(){A[A.state]&&A[A.state](),A.$mouseMoved=!1};if(a.isOldIE&&f.domEvent.type=="dblclick")return setTimeout(function(){D(f)});var E=function(M){A.releaseMouse&&v.curOp.command.name&&v.curOp.selectionChanged&&(A[A.state+"End"]&&A[A.state+"End"](),A.state="",A.releaseMouse())};v.on("beforeEndOperation",E),v.startOperation({command:{name:"mouse"}}),A.$onCaptureMouseMove=x,A.releaseMouse=i.capture(this.editor.container,x,D);var T=setInterval(y,20)},c.prototype.cancelContextMenu=function(){var f=function(g){g&&g.domEvent&&g.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",f),g&&g.domEvent&&i.stopEvent(g.domEvent))}.bind(this);setTimeout(f,10),this.editor.on("nativecontextmenu",f)},c.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},c}();u.prototype.releaseMouse=null,l.defineOptions(u.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:a.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),n.MouseHandler=u}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(t,n,m){var i=t("../lib/dom"),a=function(){function p(o){o.on("click",function(h){var r=h.getDocumentPosition(),s=o.session,l=s.getFoldAt(r.row,r.column,1);l&&(h.getAccelKey()?s.removeFold(l):s.expandFold(l),h.stop());var u=h.domEvent&&h.domEvent.target;u&&i.hasCssClass(u,"ace_inline_button")&&i.hasCssClass(u,"ace_toggle_wrap")&&(s.setOption("wrap",!s.getUseWrapMode()),o.renderer.scrollCursorIntoView())}),o.on("gutterclick",function(h){var r=o.renderer.$gutterLayer.getRegion(h);if(r=="foldWidgets"){var s=h.getDocumentPosition().row,l=o.session;l.foldWidgets&&l.foldWidgets[s]&&o.session.onFoldWidgetClick(s,h),o.isFocused()||o.focus(),h.stop()}}),o.on("gutterdblclick",function(h){var r=o.renderer.$gutterLayer.getRegion(h);if(r=="foldWidgets"){var s=h.getDocumentPosition().row,l=o.session,u=l.getParentFoldRangeData(s,!0),c=u.range||u.firstRange;if(c){s=c.start.row;var f=l.getFoldAt(s,l.getLine(s).length,1);f?l.removeFold(f):(l.addFold("...",c),o.renderer.scrollCursorIntoView({row:c.start.row,column:0}))}h.stop()}})}return p}();n.FoldHandler=a}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(t,n,m){var i=t("../lib/keys"),a=t("../lib/event"),p=function(){function o(h){this.$editor=h,this.$data={editor:h},this.$handlers=[],this.setDefaultHandler(h.commands)}return o.prototype.setDefaultHandler=function(h){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=h,this.addKeyboardHandler(h,0)},o.prototype.setKeyboardHandler=function(h){var r=this.$handlers;if(r[r.length-1]!=h){for(;r[r.length-1]&&r[r.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(r[r.length-1]);this.addKeyboardHandler(h,1)}},o.prototype.addKeyboardHandler=function(h,r){if(h){typeof h=="function"&&!h.handleKeyboard&&(h.handleKeyboard=h);var s=this.$handlers.indexOf(h);s!=-1&&this.$handlers.splice(s,1),r==null?this.$handlers.push(h):this.$handlers.splice(r,0,h),s==-1&&h.attach&&h.attach(this.$editor)}},o.prototype.removeKeyboardHandler=function(h){var r=this.$handlers.indexOf(h);return r==-1?!1:(this.$handlers.splice(r,1),h.detach&&h.detach(this.$editor),!0)},o.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},o.prototype.getStatusText=function(){var h=this.$data,r=h.editor;return this.$handlers.map(function(s){return s.getStatusText&&s.getStatusText(r,h)||""}).filter(Boolean).join(" ")},o.prototype.$callKeyboardHandlers=function(h,r,s,l){for(var u,c=!1,f=this.$editor.commands,g=this.$handlers.length;g--&&(u=this.$handlers[g].handleKeyboard(this.$data,h,r,s,l),!(!(!u||!u.command)&&(u.command=="null"?c=!0:c=f.exec(u.command,this.$editor,u.args,l),c&&l&&h!=-1&&u.passEvent!=!0&&u.command.passEvent!=!0&&a.stopEvent(l),c))););return!c&&h==-1&&(u={command:"insertstring"},c=f.exec("insertstring",this.$editor,r)),c&&this.$editor._signal&&this.$editor._signal("keyboardActivity",u),c},o.prototype.onCommandKey=function(h,r,s){var l=i.keyCodeToString(s);return this.$callKeyboardHandlers(r,l,s,h)},o.prototype.onTextInput=function(h){return this.$callKeyboardHandlers(-1,h)},o}();n.KeyBinding=p}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(t,n,m){var i=0,a=0,p=!1,o=!1,h=!1,r=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],s=[[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]],l=0,u=1,c=0,f=1,g=2,v=3,b=4,A=5,x=6,D=7,y=8,E=9,T=10,M=11,$=12,L=13,C=14,w=15,S=16,k=17,_=18,F=[_,_,_,_,_,_,_,_,_,x,A,x,y,A,_,_,_,_,_,_,_,_,_,_,_,_,_,_,A,A,A,x,y,b,b,M,M,M,b,b,b,b,b,T,E,T,E,E,g,g,g,g,g,g,g,g,g,g,E,b,b,b,b,b,b,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,b,b,b,b,b,b,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,b,b,b,b,_,_,_,_,_,_,A,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,E,b,M,M,M,M,b,b,b,b,c,b,b,_,b,b,M,M,g,g,b,c,b,b,b,g,c,b,b,b,b,b],R=[y,y,y,y,y,y,y,y,y,y,y,_,_,_,c,f,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,y,A,L,C,w,S,k,E,M,M,M,M,M,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,E,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,y];function O(N,W,z,j){var Q=i?s:r,Z=null,q=null,ne=null,se=0,pe=null,ie=null,de=-1,ue=null,le=null,ae=[];if(!j)for(ue=0,j=[];ue<z;ue++)j[ue]=H(N[ue]);for(a=i,p=!1,o=!1,h=!1,le=0;le<z;le++){if(Z=se,ae[le]=q=P(N,j,ae,le),se=Q[Z][q],pe=se&240,se&=15,W[le]=ne=Q[se][5],pe>0)if(pe==16){for(ue=de;ue<le;ue++)W[ue]=1;de=-1}else de=-1;if(ie=Q[se][6],ie)de==-1&&(de=le);else if(de>-1){for(ue=de;ue<le;ue++)W[ue]=ne;de=-1}j[le]==A&&(W[le]=0),a|=ne}if(h){for(ue=0;ue<z;ue++)if(j[ue]==x){W[ue]=i;for(var fe=ue-1;fe>=0&&j[fe]==y;fe--)W[fe]=i}}}function V(N,W,z){if(!(a<N)){if(N==1&&i==u&&!o){z.reverse();return}for(var j=z.length,Q=0,Z,q,ne,se;Q<j;){if(W[Q]>=N){for(Z=Q+1;Z<j&&W[Z]>=N;)Z++;for(q=Q,ne=Z-1;q<ne;q++,ne--)se=z[q],z[q]=z[ne],z[ne]=se;Q=Z}Q++}}}function P(N,W,z,j){var Q=W[j],Z,q,ne,se;switch(Q){case c:case f:p=!1;case b:case v:return Q;case g:return p?v:g;case D:return p=!0,f;case y:return b;case E:return j<1||j+1>=W.length||(Z=z[j-1])!=g&&Z!=v||(q=W[j+1])!=g&&q!=v?b:(p&&(q=v),q==Z?q:b);case T:return Z=j>0?z[j-1]:A,Z==g&&j+1<W.length&&W[j+1]==g?g:b;case M:if(j>0&&z[j-1]==g)return g;if(p)return b;for(se=j+1,ne=W.length;se<ne&&W[se]==M;)se++;return se<ne&&W[se]==g?g:b;case $:for(ne=W.length,se=j+1;se<ne&&W[se]==$;)se++;if(se<ne){var pe=N[j],ie=pe>=1425&&pe<=2303||pe==64286;if(Z=W[se],ie&&(Z==f||Z==D))return f}return j<1||(Z=W[j-1])==A?b:z[j-1];case A:return p=!1,o=!0,i;case x:return h=!0,b;case L:case C:case S:case k:case w:p=!1;case _:return b}}function H(N){var W=N.charCodeAt(0),z=W>>8;return z==0?W>191?c:F[W]:z==5?/[\u0591-\u05f4]/.test(N)?f:c:z==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(N)?$:/[\u0660-\u0669\u066b-\u066c]/.test(N)?v:W==1642?M:/[\u06f0-\u06f9]/.test(N)?g:D:z==32&&W<=8287?R[W&255]:z==254&&W>=65136?D:b}n.L=c,n.R=f,n.EN=g,n.ON_R=3,n.AN=4,n.R_H=5,n.B=6,n.RLE=7,n.DOT="·",n.doBidiReorder=function(N,W,z){if(N.length<2)return{};var j=N.split(""),Q=new Array(j.length),Z=new Array(j.length),q=[];i=z?u:l,O(j,q,j.length,W);for(var ne=0;ne<Q.length;Q[ne]=ne,ne++);V(2,q,Q),V(1,q,Q);for(var ne=0;ne<Q.length-1;ne++)W[ne]===v?q[ne]=n.AN:q[ne]===f&&(W[ne]>D&&W[ne]<L||W[ne]===b||W[ne]===_)?q[ne]=n.ON_R:ne>0&&j[ne-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(j[ne])&&(q[ne-1]=q[ne]=n.R_H,ne++);j[j.length-1]===n.DOT&&(q[j.length-1]=n.B),j[0]===""&&(q[0]=n.RLE);for(var ne=0;ne<Q.length;ne++)Z[ne]=q[Q[ne]];return{logicalFromVisual:Q,bidiLevels:Z}},n.hasBidiCharacters=function(N,W){for(var z=!1,j=0;j<N.length;j++)W[j]=H(N.charAt(j)),!z&&(W[j]==f||W[j]==D||W[j]==v)&&(z=!0);return z},n.getVisualFromLogicalIdx=function(N,W){for(var z=0;z<W.logicalFromVisual.length;z++)if(W.logicalFromVisual[z]==N)return z;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(t,n,m){var i=t("./lib/bidiutil"),a=t("./lib/lang"),p=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,o=function(){function h(r){this.session=r,this.bidiMap={},this.currentRow=null,this.bidiUtil=i,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=p.test(r.getValue())}return h.prototype.isBidiRow=function(r,s,l){return this.seenBidi?(r!==this.currentRow&&(this.currentRow=r,this.updateRowLine(s,l),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},h.prototype.onChange=function(r){this.seenBidi?this.currentRow=null:r.action=="insert"&&p.test(r.lines.join(`
|
|
198
|
+
`))&&(this.seenBidi=!0,this.currentRow=null)},h.prototype.getDocumentRow=function(){var r=0,s=this.session.$screenRowCache;if(s.length){var l=this.session.$getRowCacheIndex(s,this.currentRow);l>=0&&(r=this.session.$docRowCache[l])}return r},h.prototype.getSplitIndex=function(){var r=0,s=this.session.$screenRowCache;if(s.length)for(var l,u=this.session.$getRowCacheIndex(s,this.currentRow);this.currentRow-r>0&&(l=this.session.$getRowCacheIndex(s,this.currentRow-r-1),l===u);)u=l,r++;else r=this.currentRow;return r},h.prototype.updateRowLine=function(r,s){r===void 0&&(r=this.getDocumentRow());var l=r===this.session.getLength()-1,u=l?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(r),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var c=this.session.$wrapData[r];c&&(s===void 0&&(s=this.getSplitIndex()),s>0&&c.length?(this.wrapIndent=c.indent,this.wrapOffset=this.wrapIndent*this.charWidths[i.L],this.line=s<c.length?this.line.substring(c[s-1],c[s]):this.line.substring(c[c.length-1])):this.line=this.line.substring(0,c[s]),s==c.length&&(this.line+=this.showInvisibles?u:i.DOT))}else this.line+=this.showInvisibles?u:i.DOT;var f=this.session,g=0,v;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(b,A){return b===" "||f.isFullWidth(b.charCodeAt(0))?(v=b===" "?f.getScreenTabSize(A+g):2,g+=v-1,a.stringRepeat(i.DOT,v)):b}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==i.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},h.prototype.updateBidiMap=function(){var r=[];i.hasBidiCharacters(this.line,r)||this.isRtlDir?this.bidiMap=i.doBidiReorder(this.line,r,this.isRtlDir):this.bidiMap={}},h.prototype.markAsDirty=function(){this.currentRow=null},h.prototype.updateCharacterWidths=function(r){if(this.characterWidth!==r.$characterSize.width){this.fontMetrics=r;var s=this.characterWidth=r.$characterSize.width,l=r.$measureCharWidth("ה");this.charWidths[i.L]=this.charWidths[i.EN]=this.charWidths[i.ON_R]=s,this.charWidths[i.R]=this.charWidths[i.AN]=l,this.charWidths[i.R_H]=l*.45,this.charWidths[i.B]=this.charWidths[i.RLE]=0,this.currentRow=null}},h.prototype.setShowInvisibles=function(r){this.showInvisibles=r,this.currentRow=null},h.prototype.setEolChar=function(r){this.EOL=r},h.prototype.setContentWidth=function(r){this.contentWidth=r},h.prototype.isRtlLine=function(r){return this.$isRtl?!0:r!=null?this.session.getLine(r).charAt(0)==this.RLE:this.isRtlDir},h.prototype.setRtlDirection=function(r,s){for(var l=r.getCursorPosition(),u=r.selection.getSelectionAnchor().row;u<=l.row;u++)!s&&r.session.getLine(u).charAt(0)===r.session.$bidiHandler.RLE?r.session.doc.removeInLine(u,0,1):s&&r.session.getLine(u).charAt(0)!==r.session.$bidiHandler.RLE&&r.session.doc.insert({column:0,row:u},r.session.$bidiHandler.RLE)},h.prototype.getPosLeft=function(r){r-=this.wrapIndent;var s=this.line.charAt(0)===this.RLE?1:0,l=r>s?this.session.getOverwrite()?r:r-1:s,u=i.getVisualFromLogicalIdx(l,this.bidiMap),c=this.bidiMap.bidiLevels,f=0;!this.session.getOverwrite()&&r<=s&&c[u]%2!==0&&u++;for(var g=0;g<u;g++)f+=this.charWidths[c[g]];return!this.session.getOverwrite()&&r>s&&c[u]%2===0&&(f+=this.charWidths[c[u]]),this.wrapIndent&&(f+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(f+=this.rtlLineOffset),f},h.prototype.getSelections=function(r,s){var l=this.bidiMap,u=l.bidiLevels,c,f=[],g=0,v=Math.min(r,s)-this.wrapIndent,b=Math.max(r,s)-this.wrapIndent,A=!1,x=!1,D=0;this.wrapIndent&&(g+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var y,E=0;E<u.length;E++)y=l.logicalFromVisual[E],c=u[E],A=y>=v&&y<b,A&&!x?D=g:!A&&x&&f.push({left:D,width:g-D}),g+=this.charWidths[c],x=A;if(A&&E===u.length&&f.push({left:D,width:g-D}),this.isRtlDir)for(var T=0;T<f.length;T++)f[T].left+=this.rtlLineOffset;return f},h.prototype.offsetToCol=function(l){this.isRtlDir&&(l-=this.rtlLineOffset);var s=0,l=Math.max(l,0),u=0,c=0,f=this.bidiMap.bidiLevels,g=this.charWidths[f[c]];for(this.wrapIndent&&(l-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);l>u+g/2;){if(u+=g,c===f.length-1){g=0;break}g=this.charWidths[f[++c]]}return c>0&&f[c-1]%2!==0&&f[c]%2===0?(l<u&&c--,s=this.bidiMap.logicalFromVisual[c]):c>0&&f[c-1]%2===0&&f[c]%2!==0?s=1+(l>u?this.bidiMap.logicalFromVisual[c]:this.bidiMap.logicalFromVisual[c-1]):this.isRtlDir&&c===f.length-1&&g===0&&f[c-1]%2===0||!this.isRtlDir&&c===0&&f[c]%2!==0?s=1+this.bidiMap.logicalFromVisual[c]:(c>0&&f[c-1]%2!==0&&g!==0&&c--,s=this.bidiMap.logicalFromVisual[c]),s===0&&this.isRtlDir&&s++,s+this.wrapIndent},h}();n.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(t,n,m){var i=t("./lib/oop"),a=t("./lib/lang"),p=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,h=function(){function r(s){this.session=s,this.doc=s.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var l=this;this.cursor.on("change",function(u){l.$cursorChanged=!0,l.$silent||l._emit("changeCursor"),!l.$isEmpty&&!l.$silent&&l._emit("changeSelection"),!l.$keepDesiredColumnOnChange&&u.old.column!=u.value.column&&(l.$desiredColumn=null)}),this.anchor.on("change",function(){l.$anchorChanged=!0,!l.$isEmpty&&!l.$silent&&l._emit("changeSelection")})}return r.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},r.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},r.prototype.getCursor=function(){return this.lead.getPosition()},r.prototype.setAnchor=function(s,l){this.$isEmpty=!1,this.anchor.setPosition(s,l)},r.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},r.prototype.getSelectionLead=function(){return this.lead.getPosition()},r.prototype.isBackwards=function(){var s=this.anchor,l=this.lead;return s.row>l.row||s.row==l.row&&s.column>l.column},r.prototype.getRange=function(){var s=this.anchor,l=this.lead;return this.$isEmpty?o.fromPoints(l,l):this.isBackwards()?o.fromPoints(l,s):o.fromPoints(s,l)},r.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},r.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},r.prototype.setRange=function(s,l){var u=l?s.end:s.start,c=l?s.start:s.end;this.$setSelection(u.row,u.column,c.row,c.column)},r.prototype.$setSelection=function(s,l,u,c){if(!this.$silent){var f=this.$isEmpty,g=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(s,l),this.cursor.setPosition(u,c),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||f!=this.$isEmpty||g)&&this._emit("changeSelection")}},r.prototype.$moveSelection=function(s){var l=this.lead;this.$isEmpty&&this.setSelectionAnchor(l.row,l.column),s.call(this)},r.prototype.selectTo=function(s,l){this.$moveSelection(function(){this.moveCursorTo(s,l)})},r.prototype.selectToPosition=function(s){this.$moveSelection(function(){this.moveCursorToPosition(s)})},r.prototype.moveTo=function(s,l){this.clearSelection(),this.moveCursorTo(s,l)},r.prototype.moveToPosition=function(s){this.clearSelection(),this.moveCursorToPosition(s)},r.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},r.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},r.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},r.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},r.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},r.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},r.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},r.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},r.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},r.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},r.prototype.getWordRange=function(s,l){if(typeof l>"u"){var u=s||this.lead;s=u.row,l=u.column}return this.session.getWordRange(s,l)},r.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},r.prototype.selectAWord=function(){var s=this.getCursor(),l=this.session.getAWordRange(s.row,s.column);this.setSelectionRange(l)},r.prototype.getLineRange=function(s,l){var u=typeof s=="number"?s:this.lead.row,c,f=this.session.getFoldLine(u);return f?(u=f.start.row,c=f.end.row):c=u,l===!0?new o(u,0,c,this.session.getLine(c).length):new o(u,0,c+1,0)},r.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},r.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},r.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},r.prototype.wouldMoveIntoSoftTab=function(s,l,u){var c=s.column,f=s.column+l;return u<0&&(c=s.column-l,f=s.column),this.session.isTabStop(s)&&this.doc.getLine(s.row).slice(c,f).split(" ").length-1==l},r.prototype.moveCursorLeft=function(){var s=this.lead.getPosition(),l;if(l=this.session.getFoldAt(s.row,s.column,-1))this.moveCursorTo(l.start.row,l.start.column);else if(s.column===0)s.row>0&&this.moveCursorTo(s.row-1,this.doc.getLine(s.row-1).length);else{var u=this.session.getTabSize();this.wouldMoveIntoSoftTab(s,u,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-u):this.moveCursorBy(0,-1)}},r.prototype.moveCursorRight=function(){var s=this.lead.getPosition(),l;if(l=this.session.getFoldAt(s.row,s.column,1))this.moveCursorTo(l.end.row,l.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var u=this.session.getTabSize(),s=this.lead;this.wouldMoveIntoSoftTab(s,u,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,u):this.moveCursorBy(0,1)}},r.prototype.moveCursorLineStart=function(){var s=this.lead.row,l=this.lead.column,u=this.session.documentToScreenRow(s,l),c=this.session.screenToDocumentPosition(u,0),f=this.session.getDisplayLine(s,null,c.row,c.column),g=f.match(/^\s*/);g[0].length!=l&&!this.session.$useEmacsStyleLineStart&&(c.column+=g[0].length),this.moveCursorToPosition(c)},r.prototype.moveCursorLineEnd=function(){var s=this.lead,l=this.session.getDocumentLastRowColumnPosition(s.row,s.column);if(this.lead.column==l.column){var u=this.session.getLine(l.row);if(l.column==u.length){var c=u.search(/\s+$/);c>0&&(l.column=c)}}this.moveCursorTo(l.row,l.column)},r.prototype.moveCursorFileEnd=function(){var s=this.doc.getLength()-1,l=this.doc.getLine(s).length;this.moveCursorTo(s,l)},r.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},r.prototype.moveCursorLongWordRight=function(){var s=this.lead.row,l=this.lead.column,u=this.doc.getLine(s),c=u.substring(l);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var f=this.session.getFoldAt(s,l,1);if(f){this.moveCursorTo(f.end.row,f.end.column);return}if(this.session.nonTokenRe.exec(c)&&(l+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,c=u.substring(l)),l>=u.length){this.moveCursorTo(s,u.length),this.moveCursorRight(),s<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(c)&&(l+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(s,l)},r.prototype.moveCursorLongWordLeft=function(){var s=this.lead.row,l=this.lead.column,u;if(u=this.session.getFoldAt(s,l,-1)){this.moveCursorTo(u.start.row,u.start.column);return}var c=this.session.getFoldStringAt(s,l,-1);c==null&&(c=this.doc.getLine(s).substring(0,l));var f=a.stringReverse(c);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(f)&&(l-=this.session.nonTokenRe.lastIndex,f=f.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),l<=0){this.moveCursorTo(s,0),this.moveCursorLeft(),s>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(f)&&(l-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(s,l)},r.prototype.$shortWordEndIndex=function(s){var l=0,u,c=/\s/,f=this.session.tokenRe;if(f.lastIndex=0,this.session.tokenRe.exec(s))l=this.session.tokenRe.lastIndex;else{for(;(u=s[l])&&c.test(u);)l++;if(l<1){for(f.lastIndex=0;(u=s[l])&&!f.test(u);)if(f.lastIndex=0,l++,c.test(u))if(l>2){l--;break}else{for(;(u=s[l])&&c.test(u);)l++;if(l>2)break}}}return f.lastIndex=0,l},r.prototype.moveCursorShortWordRight=function(){var s=this.lead.row,l=this.lead.column,u=this.doc.getLine(s),c=u.substring(l),f=this.session.getFoldAt(s,l,1);if(f)return this.moveCursorTo(f.end.row,f.end.column);if(l==u.length){var g=this.doc.getLength();do s++,c=this.doc.getLine(s);while(s<g&&/^\s*$/.test(c));/^\s+/.test(c)||(c=""),l=0}var v=this.$shortWordEndIndex(c);this.moveCursorTo(s,l+v)},r.prototype.moveCursorShortWordLeft=function(){var s=this.lead.row,l=this.lead.column,u;if(u=this.session.getFoldAt(s,l,-1))return this.moveCursorTo(u.start.row,u.start.column);var c=this.session.getLine(s).substring(0,l);if(l===0){do s--,c=this.doc.getLine(s);while(s>0&&/^\s*$/.test(c));l=c.length,/\s+$/.test(c)||(c="")}var f=a.stringReverse(c),g=this.$shortWordEndIndex(f);return this.moveCursorTo(s,l-g)},r.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},r.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},r.prototype.moveCursorBy=function(s,l){var u=this.session.documentToScreenPosition(this.lead.row,this.lead.column),c;if(l===0&&(s!==0&&(this.session.$bidiHandler.isBidiRow(u.row,this.lead.row)?(c=this.session.$bidiHandler.getPosLeft(u.column),u.column=Math.round(c/this.session.$bidiHandler.charWidths[0])):c=u.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?u.column=this.$desiredColumn:this.$desiredColumn=u.column),s!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var f=this.session.lineWidgets[this.lead.row];s<0?s-=f.rowsAbove||0:s>0&&(s+=f.rowCount-(f.rowsAbove||0))}var g=this.session.screenToDocumentPosition(u.row+s,u.column,c);s!==0&&l===0&&g.row===this.lead.row&&(g.column,this.lead.column),this.moveCursorTo(g.row,g.column+l,l===0)},r.prototype.moveCursorToPosition=function(s){this.moveCursorTo(s.row,s.column)},r.prototype.moveCursorTo=function(s,l,u){var c=this.session.getFoldAt(s,l,1);c&&(s=c.start.row,l=c.start.column),this.$keepDesiredColumnOnChange=!0;var f=this.session.getLine(s);/[\uDC00-\uDFFF]/.test(f.charAt(l))&&f.charAt(l-1)&&(this.lead.row==s&&this.lead.column==l+1?l=l-1:l=l+1),this.lead.setPosition(s,l),this.$keepDesiredColumnOnChange=!1,u||(this.$desiredColumn=null)},r.prototype.moveCursorToScreen=function(s,l,u){var c=this.session.screenToDocumentPosition(s,l);this.moveCursorTo(c.row,c.column,u)},r.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},r.prototype.fromOrientedRange=function(s){this.setSelectionRange(s,s.cursor==s.start),this.$desiredColumn=s.desiredColumn||this.$desiredColumn},r.prototype.toOrientedRange=function(s){var l=this.getRange();return s?(s.start.column=l.start.column,s.start.row=l.start.row,s.end.column=l.end.column,s.end.row=l.end.row):s=l,s.cursor=this.isBackwards()?s.start:s.end,s.desiredColumn=this.$desiredColumn,s},r.prototype.getRangeOfMovements=function(s){var l=this.getCursor();try{s(this);var u=this.getCursor();return o.fromPoints(l,u)}catch{return o.fromPoints(l,l)}finally{this.moveCursorToPosition(l)}},r.prototype.toJSON=function(){if(this.rangeCount)var s=this.ranges.map(function(l){var u=l.clone();return u.isBackwards=l.cursor==l.start,u});else{var s=this.getRange();s.isBackwards=this.isBackwards()}return s},r.prototype.fromJSON=function(s){if(s.start==null)if(this.rangeList&&s.length>1){this.toSingleRange(s[0]);for(var l=s.length;l--;){var u=o.fromPoints(s[l].start,s[l].end);s[l].isBackwards&&(u.cursor=u.start),this.addRange(u,!0)}return}else s=s[0];this.rangeList&&this.toSingleRange(s),this.setSelectionRange(s,s.isBackwards)},r.prototype.isEqual=function(s){if((s.length||this.rangeCount)&&s.length!=this.rangeCount)return!1;if(!s.length||!this.ranges)return this.getRange().isEqual(s);for(var l=this.ranges.length;l--;)if(!this.ranges[l].isEqual(s[l]))return!1;return!0},r}();h.prototype.setSelectionAnchor=h.prototype.setAnchor,h.prototype.getSelectionAnchor=h.prototype.getAnchor,h.prototype.setSelectionRange=h.prototype.setRange,i.implement(h.prototype,p),n.Selection=h}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(t,n,m){var i=t("./lib/report_error").reportError,a=2e3,p=function(){function o(h){this.splitRegex,this.states=h,this.regExps={},this.matchMappings={};for(var r in this.states){for(var s=this.states[r],l=[],u=0,c=this.matchMappings[r]={defaultToken:"text"},f="g",g=[],v=0;v<s.length;v++){var b=s[v];if(b.defaultToken&&(c.defaultToken=b.defaultToken),b.caseInsensitive&&f.indexOf("i")===-1&&(f+="i"),b.unicode&&f.indexOf("u")===-1&&(f+="u"),b.regex!=null){b.regex instanceof RegExp&&(b.regex=b.regex.toString().slice(1,-1));var A=b.regex,x=new RegExp("(?:("+A+")|(.))").exec("a").length-2;Array.isArray(b.token)?b.token.length==1||x==1?b.token=b.token[0]:x-1!=b.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:b,groupCount:x-1}),b.token=b.token[0]):(b.tokenArray=b.token,b.token=null,b.onMatch=this.$arrayTokens):typeof b.token=="function"&&!b.onMatch&&(x>1?b.onMatch=this.$applyToken:b.onMatch=b.token),x>1&&(/\\\d/.test(b.regex)?A=b.regex.replace(/\\([0-9]+)/g,function(D,y){return"\\"+(parseInt(y,10)+u+1)}):(x=1,A=this.removeCapturingGroups(b.regex)),!b.splitRegex&&typeof b.token!="string"&&g.push(b)),c[u]=v,u+=x,l.push(A),b.onMatch||(b.onMatch=null)}}l.length||(c[0]=0,l.push("$")),g.forEach(function(D){D.splitRegex=this.createSplitterRegexp(D.regex,f)},this),this.regExps[r]=new RegExp("("+l.join(")|(")+")|($)",f)}}return o.prototype.$setMaxTokenCount=function(h){a=h|0},o.prototype.$applyToken=function(h){var r=this.splitRegex.exec(h).slice(1),s=this.token.apply(this,r);if(typeof s=="string")return[{type:s,value:h}];for(var l=[],u=0,c=s.length;u<c;u++)r[u]&&(l[l.length]={type:s[u],value:r[u]});return l},o.prototype.$arrayTokens=function(h){if(!h)return[];var r=this.splitRegex.exec(h);if(!r)return"text";for(var s=[],l=this.tokenArray,u=0,c=l.length;u<c;u++)r[u+1]&&(s[s.length]={type:l[u],value:r[u+1]});return s},o.prototype.removeCapturingGroups=function(h){var r=h.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(s,l){return l?"(?:":s});return r},o.prototype.createSplitterRegexp=function(h,r){if(h.indexOf("(?=")!=-1){var s=0,l=!1,u={};h.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(c,f,g,v,b,A){return l?l=b!="]":b?l=!0:v?(s==u.stack&&(u.end=A+1,u.stack=-1),s--):g&&(s++,g.length!=1&&(u.stack=s,u.start=A)),c}),u.end!=null&&/^\)*$/.test(h.substr(u.end))&&(h=h.substring(0,u.start)+h.substr(u.end))}return h.charAt(0)!="^"&&(h="^"+h),h.charAt(h.length-1)!="$"&&(h+="$"),new RegExp(h,(r||"").replace("g",""))},o.prototype.getLineTokens=function(h,r){if(r&&typeof r!="string"){var s=r.slice(0);r=s[0],r==="#tmp"&&(s.shift(),r=s.shift())}else var s=[];var l=r||"start",u=this.states[l];u||(l="start",u=this.states[l]);var c=this.matchMappings[l],f=this.regExps[l];f.lastIndex=0;for(var g,v=[],b=0,A=0,x={type:null,value:""};g=f.exec(h);){var D=c.defaultToken,y=null,E=g[0],T=f.lastIndex;if(T-E.length>b){var M=h.substring(b,T-E.length);x.type==D?x.value+=M:(x.type&&v.push(x),x={type:D,value:M})}for(var $=0;$<g.length-2;$++)if(g[$+1]!==void 0){y=u[c[$]],y.onMatch?D=y.onMatch(E,l,s,h):D=y.token,y.next&&(typeof y.next=="string"?l=y.next:l=y.next(l,s),u=this.states[l],u||(this.reportError("state doesn't exist",l),l="start",u=this.states[l]),c=this.matchMappings[l],b=T,f=this.regExps[l],f.lastIndex=T),y.consumeLineEnd&&(b=T);break}if(E){if(typeof D=="string")(!y||y.merge!==!1)&&x.type===D?x.value+=E:(x.type&&v.push(x),x={type:D,value:E});else if(D){x.type&&v.push(x),x={type:null,value:""};for(var $=0;$<D.length;$++)v.push(D[$])}}if(b==h.length)break;if(b=T,A++>a){for(A>2*h.length&&this.reportError("infinite loop with in ace tokenizer",{startState:r,line:h});b<h.length;)x.type&&v.push(x),x={value:h.substring(b,b+=500),type:"overflow"};l="start",s=[];break}}return x.type&&v.push(x),s.length>1&&s[0]!==l&&s.unshift("#tmp",l),{tokens:v,state:s.length?s:l}},o}();p.prototype.reportError=i,n.Tokenizer=p}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(t,n,m){var i=t("../lib/deep_copy").deepCopy,a;a=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},function(){this.addRules=function(h,r){if(!r){for(var s in h)this.$rules[s]=h[s];return}for(var s in h){for(var l=h[s],u=0;u<l.length;u++){var c=l[u];(c.next||c.onMatch)&&(typeof c.next=="string"&&c.next.indexOf(r)!==0&&(c.next=r+c.next),c.nextState&&c.nextState.indexOf(r)!==0&&(c.nextState=r+c.nextState))}this.$rules[r+s]=l}},this.getRules=function(){return this.$rules},this.embedRules=function(h,r,s,l,u){var c=typeof h=="function"?new h().getRules():h;if(l)for(var f=0;f<l.length;f++)l[f]=r+l[f];else{l=[];for(var g in c)l.push(r+g)}if(this.addRules(c,r),s)for(var v=Array.prototype[u?"push":"unshift"],f=0;f<l.length;f++)v.apply(this.$rules[l[f]],i(s));this.$embeds||(this.$embeds=[]),this.$embeds.push(r)},this.getEmbeds=function(){return this.$embeds};var p=function(h,r){return(h!="start"||r.length)&&r.unshift(this.nextState,h),this.nextState},o=function(h,r){return r.shift(),r.shift()||"start"};this.normalizeRules=function(){var h=0,r=this.$rules;function s(l){var u=r[l];u.processed=!0;for(var c=0;c<u.length;c++){var f=u[c],g=null;Array.isArray(f)&&(g=f,f={}),!f.regex&&f.start&&(f.regex=f.start,f.next||(f.next=[]),f.next.push({defaultToken:f.token},{token:f.token+".end",regex:f.end||f.start,next:"pop"}),f.token=f.token+".start",f.push=!0);var v=f.next||f.push;if(v&&Array.isArray(v)){var b=f.stateName;b||(b=f.token,typeof b!="string"&&(b=b[0]||""),r[b]&&(b+=h++)),r[b]=v,f.next=b,s(b)}else v=="pop"&&(f.next=o);if(f.push&&(f.nextState=f.next||f.push,f.next=p,delete f.push),f.rules)for(var A in f.rules)r[A]?r[A].push&&r[A].push.apply(r[A],f.rules[A]):r[A]=f.rules[A];var x=typeof f=="string"?f:f.include;if(x&&(x==="$self"&&(x="start"),Array.isArray(x)?g=x.map(function(y){return r[y]}):g=r[x]),g){var D=[c,1].concat(g);f.noEscape&&(D=D.filter(function(y){return!y.next})),u.splice.apply(u,D),c--}f.keywordMap&&(f.token=this.createKeywordMapper(f.keywordMap,f.defaultToken||"text",f.caseInsensitive),delete f.defaultToken)}}Object.keys(r).forEach(s,this)},this.createKeywordMapper=function(h,r,s,l){var u=Object.create(null);return this.$keywordList=[],Object.keys(h).forEach(function(c){for(var f=h[c],g=f.split(l||"|"),v=g.length;v--;){var b=g[v];this.$keywordList.push(b),s&&(b=b.toLowerCase()),u[b]=c}},this),h=null,s?function(c){return u[c.toLowerCase()]||r}:function(c){return u[c]||r}},this.getKeywords=function(){return this.$keywords}}.call(a.prototype),n.TextHighlightRules=a}),ace.define("ace/mode/behaviour",["require","exports","module"],function(t,n,m){var i;i=function(){this.$behaviours={}},function(){this.add=function(a,p,o){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[a]:this.$behaviours[a]={}}this.$behaviours[a][p]=o},this.addBehaviours=function(a){for(var p in a)for(var o in a[p])this.add(p,o,a[p][o])},this.remove=function(a){this.$behaviours&&this.$behaviours[a]&&delete this.$behaviours[a]},this.inherit=function(a,p){if(typeof a=="function")var o=new a().getBehaviours(p);else var o=a.getBehaviours(p);this.addBehaviours(o)},this.getBehaviours=function(a){if(a){for(var p={},o=0;o<a.length;o++)this.$behaviours[a[o]]&&(p[a[o]]=this.$behaviours[a[o]]);return p}else return this.$behaviours}}.call(i.prototype),n.Behaviour=i}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(t,n,m){var i=t("./range").Range,a=function(){function p(o,h,r){this.$session=o,this.$row=h,this.$rowTokens=o.getTokens(h);var s=o.getTokenAt(h,r);this.$tokenIndex=s?s.index:-1}return p.prototype.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},p.prototype.stepForward=function(){this.$tokenIndex+=1;for(var o;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,o||(o=this.$session.getLength()),this.$row>=o)return this.$row=o-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},p.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},p.prototype.getCurrentTokenRow=function(){return this.$row},p.prototype.getCurrentTokenColumn=function(){var o=this.$rowTokens,h=this.$tokenIndex,r=o[h].start;if(r!==void 0)return r;for(r=0;h>0;)h-=1,r+=o[h].value.length;return r},p.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},p.prototype.getCurrentTokenRange=function(){var o=this.$rowTokens[this.$tokenIndex],h=this.getCurrentTokenColumn();return new i(this.$row,h,this.$row,h+o.value.length)},p}();n.TokenIterator=a}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,n,m){var i=t("../../lib/oop"),a=t("../behaviour").Behaviour,p=t("../../token_iterator").TokenIterator,o=t("../../lib/lang"),h=["text","paren.rparen","rparen","paren","punctuation.operator"],r=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],s,l={},u={'"':'"',"'":"'"},c=function(v){var b=-1;if(v.multiSelect&&(b=v.selection.index,l.rangeCount!=v.multiSelect.rangeCount&&(l={rangeCount:v.multiSelect.rangeCount})),l[b])return s=l[b];s=l[b]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(v,b,A,x){var D=v.end.row-v.start.row;return{text:A+b+x,selection:[0,v.start.column+1,D,v.end.column+(D?0:1)]}},g;g=function(v){v=v||{},this.add("braces","insertion",function(b,A,x,D,y){var E=x.getCursorPosition(),T=D.doc.getLine(E.row);if(y=="{"){c(x);var M=x.getSelectionRange(),$=D.doc.getTextRange(M),L=D.getTokenAt(E.row,E.column);if($!==""&&$!=="{"&&x.getWrapBehavioursEnabled())return f(M,$,"{","}");if(L&&/(?:string)\.quasi|\.xml/.test(L.type)){var C=[/tag\-(?:open|name)/,/attribute\-name/];return C.some(function(O){return O.test(L.type)})||/(string)\.quasi/.test(L.type)&&L.value[E.column-L.start-1]!=="$"?void 0:(g.recordAutoInsert(x,D,"}"),{text:"{}",selection:[1,1]})}else if(g.isSaneInsertion(x,D))return/[\]\}\)]/.test(T[E.column])||x.inMultiSelectMode||v.braces?(g.recordAutoInsert(x,D,"}"),{text:"{}",selection:[1,1]}):(g.recordMaybeInsert(x,D,"{"),{text:"{",selection:[1,1]})}else if(y=="}"){c(x);var w=T.substring(E.column,E.column+1);if(w=="}"){var S=D.$findOpeningBracket("}",{column:E.column+1,row:E.row});if(S!==null&&g.isAutoInsertedClosing(E,T,y))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(y==`
|
|
199
|
+
`||y==`\r
|
|
200
|
+
`){c(x);var k="";g.isMaybeInsertedClosing(E,T)&&(k=o.stringRepeat("}",s.maybeInsertedBrackets),g.clearMaybeInsertedClosing());var w=T.substring(E.column,E.column+1);if(w==="}"){var _=D.findMatchingBracket({row:E.row,column:E.column+1},"}");if(!_)return null;var F=this.$getIndent(D.getLine(_.row))}else if(k)var F=this.$getIndent(T);else{g.clearMaybeInsertedClosing();return}var R=F+D.getTabString();return{text:`
|
|
201
|
+
`+R+`
|
|
202
|
+
`+F+k,selection:[1,R.length,1,R.length]}}else g.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(b,A,x,D,y){var E=D.doc.getTextRange(y);if(!y.isMultiLine()&&E=="{"){c(x);var T=D.doc.getLine(y.start.row),M=T.substring(y.end.column,y.end.column+1);if(M=="}")return y.end.column++,y;s.maybeInsertedBrackets--}}),this.add("parens","insertion",function(b,A,x,D,y){if(y=="("){c(x);var E=x.getSelectionRange(),T=D.doc.getTextRange(E);if(T!==""&&x.getWrapBehavioursEnabled())return f(E,T,"(",")");if(g.isSaneInsertion(x,D))return g.recordAutoInsert(x,D,")"),{text:"()",selection:[1,1]}}else if(y==")"){c(x);var M=x.getCursorPosition(),$=D.doc.getLine(M.row),L=$.substring(M.column,M.column+1);if(L==")"){var C=D.$findOpeningBracket(")",{column:M.column+1,row:M.row});if(C!==null&&g.isAutoInsertedClosing(M,$,y))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(b,A,x,D,y){var E=D.doc.getTextRange(y);if(!y.isMultiLine()&&E=="("){c(x);var T=D.doc.getLine(y.start.row),M=T.substring(y.start.column+1,y.start.column+2);if(M==")")return y.end.column++,y}}),this.add("brackets","insertion",function(b,A,x,D,y){if(y=="["){c(x);var E=x.getSelectionRange(),T=D.doc.getTextRange(E);if(T!==""&&x.getWrapBehavioursEnabled())return f(E,T,"[","]");if(g.isSaneInsertion(x,D))return g.recordAutoInsert(x,D,"]"),{text:"[]",selection:[1,1]}}else if(y=="]"){c(x);var M=x.getCursorPosition(),$=D.doc.getLine(M.row),L=$.substring(M.column,M.column+1);if(L=="]"){var C=D.$findOpeningBracket("]",{column:M.column+1,row:M.row});if(C!==null&&g.isAutoInsertedClosing(M,$,y))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(b,A,x,D,y){var E=D.doc.getTextRange(y);if(!y.isMultiLine()&&E=="["){c(x);var T=D.doc.getLine(y.start.row),M=T.substring(y.start.column+1,y.start.column+2);if(M=="]")return y.end.column++,y}}),this.add("string_dquotes","insertion",function(b,A,x,D,y){var E=D.$mode.$quotes||u;if(y.length==1&&E[y]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(y)!=-1)return;c(x);var T=y,M=x.getSelectionRange(),$=D.doc.getTextRange(M);if($!==""&&($.length!=1||!E[$])&&x.getWrapBehavioursEnabled())return f(M,$,T,T);if(!$){var L=x.getCursorPosition(),C=D.doc.getLine(L.row),w=C.substring(L.column-1,L.column),S=C.substring(L.column,L.column+1),k=D.getTokenAt(L.row,L.column),_=D.getTokenAt(L.row,L.column+1);if(w=="\\"&&k&&/escape/.test(k.type))return null;var F=k&&/string|escape/.test(k.type),R=!_||/string|escape/.test(_.type),O;if(S==T)O=F!==R,O&&/string\.end/.test(_.type)&&(O=!1);else{if(F&&!R||F&&R)return null;var V=D.$mode.tokenRe;V.lastIndex=0;var P=V.test(w);V.lastIndex=0;var H=V.test(S),N=D.$mode.$pairQuotesAfter,W=N&&N[T]&&N[T].test(w);if(!W&&P||H||S&&!/[\s;,.})\]\\]/.test(S))return null;var z=C[L.column-2];if(w==T&&(z==T||V.test(z)))return null;O=!0}return{text:O?T+T:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(b,A,x,D,y){var E=D.$mode.$quotes||u,T=D.doc.getTextRange(y);if(!y.isMultiLine()&&E.hasOwnProperty(T)){c(x);var M=D.doc.getLine(y.start.row),$=M.substring(y.start.column+1,y.start.column+2);if($==T)return y.end.column++,y}}),v.closeDocComment!==!1&&this.add("doc comment end","insertion",function(b,A,x,D,y){if(b==="doc-start"&&(y===`
|
|
203
|
+
`||y===`\r
|
|
204
|
+
`)&&x.selection.isEmpty()){var E=x.getCursorPosition();if(E.column===0)return;for(var T=D.doc.getLine(E.row),M=D.doc.getLine(E.row+1),$=D.getTokens(E.row),L=0,C=0;C<$.length;C++){L+=$[C].value.length;var w=$[C];if(L>=E.column){if(L===E.column){if(!/\.doc/.test(w.type))return;if(/\*\//.test(w.value)){var S=$[C+1];if(!S||!/\.doc/.test(S.type))return}}var k=E.column-(L-w.value.length),_=w.value.indexOf("*/"),F=w.value.indexOf("/**",_>-1?_+2:0);if(F!==-1&&k>F&&k<F+3||_!==-1&&F!==-1&&k>=_&&k<=F||!/\.doc/.test(w.type))return;break}}var R=this.$getIndent(T);if(/\s*\*/.test(M))return/^\s*\*/.test(T)?{text:y+R+"* ",selection:[1,2+R.length,1,2+R.length]}:{text:y+R+" * ",selection:[1,3+R.length,1,3+R.length]};if(/\/\*\*/.test(T.substring(0,E.column)))return{text:y+R+" * "+y+" "+R+"*/",selection:[1,4+R.length,1,4+R.length]}}})},g.isSaneInsertion=function(v,b){var A=v.getCursorPosition(),x=new p(b,A.row,A.column);if(!this.$matchTokenType(x.getCurrentToken()||"text",h)){if(/[)}\]]/.test(v.session.getLine(A.row)[A.column]))return!0;var D=new p(b,A.row,A.column+1);if(!this.$matchTokenType(D.getCurrentToken()||"text",h))return!1}return x.stepForward(),x.getCurrentTokenRow()!==A.row||this.$matchTokenType(x.getCurrentToken()||"text",r)},g.$matchTokenType=function(v,b){return b.indexOf(v.type||v)>-1},g.recordAutoInsert=function(v,b,A){var x=v.getCursorPosition(),D=b.doc.getLine(x.row);this.isAutoInsertedClosing(x,D,s.autoInsertedLineEnd[0])||(s.autoInsertedBrackets=0),s.autoInsertedRow=x.row,s.autoInsertedLineEnd=A+D.substr(x.column),s.autoInsertedBrackets++},g.recordMaybeInsert=function(v,b,A){var x=v.getCursorPosition(),D=b.doc.getLine(x.row);this.isMaybeInsertedClosing(x,D)||(s.maybeInsertedBrackets=0),s.maybeInsertedRow=x.row,s.maybeInsertedLineStart=D.substr(0,x.column)+A,s.maybeInsertedLineEnd=D.substr(x.column),s.maybeInsertedBrackets++},g.isAutoInsertedClosing=function(v,b,A){return s.autoInsertedBrackets>0&&v.row===s.autoInsertedRow&&A===s.autoInsertedLineEnd[0]&&b.substr(v.column)===s.autoInsertedLineEnd},g.isMaybeInsertedClosing=function(v,b){return s.maybeInsertedBrackets>0&&v.row===s.maybeInsertedRow&&b.substr(v.column)===s.maybeInsertedLineEnd&&b.substr(0,v.column)==s.maybeInsertedLineStart},g.popAutoInsertedClosing=function(){s.autoInsertedLineEnd=s.autoInsertedLineEnd.substr(1),s.autoInsertedBrackets--},g.clearMaybeInsertedClosing=function(){s&&(s.maybeInsertedBrackets=0,s.maybeInsertedRow=-1)},i.inherits(g,a),n.CstyleBehaviour=g}),ace.define("ace/unicode",["require","exports","module"],function(t,n,m){for(var i=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],a=0,p=[],o=0;o<i.length;o+=2)p.push(a+=i[o]),i[o+1]&&p.push(45,a+=i[o+1]);n.wordChars=String.fromCharCode.apply(null,p)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(t,n,m){var i=t("../config"),a=t("../tokenizer").Tokenizer,p=t("./text_highlight_rules").TextHighlightRules,o=t("./behaviour/cstyle").CstyleBehaviour,h=t("../unicode"),r=t("../lib/lang"),s=t("../token_iterator").TokenIterator,l=t("../range").Range,u;u=function(){this.HighlightRules=p},function(){this.$defaultBehaviour=new o,this.tokenRe=new RegExp("^["+h.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+h.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new a(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(c,f,g,v){var b=f.doc,A=!0,x=!0,D=1/0,y=f.getTabSize(),E=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var $=this.lineCommentStart.map(r.escapeRegExp).join("|"),T=this.lineCommentStart[0];else var $=r.escapeRegExp(this.lineCommentStart),T=this.lineCommentStart;$=new RegExp("^(\\s*)(?:"+$+") ?"),E=f.getUseSoftTabs();var w=function(H,N){var W=H.match($);if(W){var z=W[1].length,j=W[0].length;!_(H,z,j)&&W[0][j-1]==" "&&j--,b.removeInLine(N,z,j)}},k=T+" ",C=function(H,N){(!A||/\S/.test(H))&&(_(H,D,D)?b.insertInLine({row:N,column:D},k):b.insertInLine({row:N,column:D},T))},S=function(H,N){return $.test(H)},_=function(H,N,W){for(var z=0;N--&&H.charAt(N)==" ";)z++;if(z%y!=0)return!1;for(var z=0;H.charAt(W++)==" ";)z++;return y>2?z%y!=y-1:z%y==0}}else{if(!this.blockComment)return!1;var T=this.blockComment.start,M=this.blockComment.end,$=new RegExp("^(\\s*)(?:"+r.escapeRegExp(T)+")"),L=new RegExp("(?:"+r.escapeRegExp(M)+")\\s*$"),C=function(O,V){S(O,V)||(!A||/\S/.test(O))&&(b.insertInLine({row:V,column:O.length},M),b.insertInLine({row:V,column:D},T))},w=function(O,V){var P;(P=O.match(L))&&b.removeInLine(V,O.length-P[0].length,O.length),(P=O.match($))&&b.removeInLine(V,P[1].length,P[0].length)},S=function(O,V){if($.test(O))return!0;for(var P=f.getTokens(V),H=0;H<P.length;H++)if(P[H].type==="comment")return!0}}function F(O){for(var V=g;V<=v;V++)O(b.getLine(V),V)}var R=1/0;F(function(O,V){var P=O.search(/\S/);P!==-1?(P<D&&(D=P),x&&!S(O,V)&&(x=!1)):R>O.length&&(R=O.length)}),D==1/0&&(D=R,A=!1,x=!1),E&&D%y!=0&&(D=Math.floor(D/y)*y),F(x?w:C)},this.toggleBlockComment=function(c,f,g,v){var b=this.blockComment;if(b){!b.start&&b[0]&&(b=b[0]);var A=new s(f,v.row,v.column),x=A.getCurrentToken();f.selection;var D=f.selection.toOrientedRange(),y,E;if(x&&/comment/.test(x.type)){for(var T,M;x&&/comment/.test(x.type);){var $=x.value.indexOf(b.start);if($!=-1){var L=A.getCurrentTokenRow(),C=A.getCurrentTokenColumn()+$;T=new l(L,C,L,C+b.start.length);break}x=A.stepBackward()}for(var A=new s(f,v.row,v.column),x=A.getCurrentToken();x&&/comment/.test(x.type);){var $=x.value.indexOf(b.end);if($!=-1){var L=A.getCurrentTokenRow(),C=A.getCurrentTokenColumn()+$;M=new l(L,C,L,C+b.end.length);break}x=A.stepForward()}M&&f.remove(M),T&&(f.remove(T),y=T.start.row,E=-b.start.length)}else E=b.start.length,y=g.start.row,f.insert(g.end,b.end),f.insert(g.start,b.start);D.start.row==y&&(D.start.column+=E),D.end.row==y&&(D.end.column+=E),f.selection.fromOrientedRange(D)}},this.getNextLineIndent=function(c,f,g){return this.$getIndent(f)},this.checkOutdent=function(c,f,g){return!1},this.autoOutdent=function(c,f,g){},this.$getIndent=function(c){return c.match(/^\s*/)[0]},this.createWorker=function(c){return null},this.createModeDelegates=function(c){this.$embeds=[],this.$modes={};for(var f in c)if(c[f]){var g=c[f],v=g.prototype.$id,b=i.$modes[v];b||(i.$modes[v]=b=new g),i.$modes[f]||(i.$modes[f]=b),this.$embeds.push(f),this.$modes[f]=b}for(var A=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],x=function(y){(function(E){var T=A[y],M=E[T];E[A[y]]=function(){return this.$delegator(T,arguments,M)}})(D)},D=this,f=0;f<A.length;f++)x(f)},this.$delegator=function(c,f,g){var v=f[0]||"start";if(typeof v!="string"){if(Array.isArray(v[2])){var b=v[2][v[2].length-1],A=this.$modes[b];if(A)return A[c].apply(A,[v[1]].concat([].slice.call(f,1)))}v=v[0]||"start"}for(var x=0;x<this.$embeds.length;x++)if(this.$modes[this.$embeds[x]]){var D=v.split(this.$embeds[x]);if(!D[0]&&D[1]){f[0]=D[1];var A=this.$modes[this.$embeds[x]];return A[c].apply(A,f)}}var y=g.apply(this,f);return g?y:void 0},this.transformAction=function(c,f,g,v,b){if(this.$behaviour){var A=this.$behaviour.getBehaviours();for(var x in A)if(A[x][f]){var D=A[x][f].apply(this,arguments);if(D)return D}}},this.getKeywords=function(c){if(!this.completionKeywords){var f=this.$tokenizer.rules,g=[];for(var v in f)for(var b=f[v],A=0,x=b.length;A<x;A++)if(typeof b[A].token=="string")/keyword|support|storage/.test(b[A].token)&&g.push(b[A].regex);else if(typeof b[A].token=="object"){for(var D=0,y=b[A].token.length;D<y;D++)if(/keyword|support|storage/.test(b[A].token[D])){var v=b[A].regex.match(/\(.+?\)/g)[D];g.push(v.substr(1,v.length-2))}}this.completionKeywords=g}return c?g.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(c,f,g,v){var b=this.$keywordList||this.$createKeywordList();return b.map(function(A){return{name:A,value:A,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}.call(u.prototype),n.Mode=u}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(t,n,m){var i=t("./lib/dom"),a=function(){function p(o){this.session=o,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}return p.prototype.getRowLength=function(o){var h;return this.lineWidgets?h=this.lineWidgets[o]&&this.lineWidgets[o].rowCount||0:h=0,!this.$useWrapMode||!this.$wrapData[o]?1+h:this.$wrapData[o].length+1+h},p.prototype.$getWidgetScreenLength=function(){var o=0;return this.lineWidgets.forEach(function(h){h&&h.rowCount&&!h.hidden&&(o+=h.rowCount)}),o},p.prototype.$onChangeEditor=function(o){this.attach(o.editor)},p.prototype.attach=function(o){o&&o.widgetManager&&o.widgetManager!=this&&o.widgetManager.detach(),this.editor!=o&&(this.detach(),this.editor=o,o&&(o.widgetManager=this,o.renderer.on("beforeRender",this.measureWidgets),o.renderer.on("afterRender",this.renderWidgets)))},p.prototype.detach=function(o){var h=this.editor;if(h){this.editor=null,h.widgetManager=null,h.renderer.off("beforeRender",this.measureWidgets),h.renderer.off("afterRender",this.renderWidgets);var r=this.session.lineWidgets;r&&r.forEach(function(s){s&&s.el&&s.el.parentNode&&(s._inDocument=!1,s.el.parentNode.removeChild(s.el))})}},p.prototype.updateOnFold=function(o,h){var r=h.lineWidgets;if(!(!r||!o.action)){for(var s=o.data,l=s.start.row,u=s.end.row,c=o.action=="add",f=l+1;f<u;f++)r[f]&&(r[f].hidden=c);r[u]&&(c?r[l]?r[u].hidden=c:r[l]=r[u]:(r[l]==r[u]&&(r[l]=void 0),r[u].hidden=c))}},p.prototype.updateOnChange=function(o){var h=this.session.lineWidgets;if(h){var r=o.start.row,s=o.end.row-r;if(s!==0)if(o.action=="remove"){var l=h.splice(r+1,s);!h[r]&&l[l.length-1]&&(h[r]=l.pop()),l.forEach(function(c){c&&this.removeLineWidget(c)},this),this.$updateRows()}else{var u=new Array(s);h[r]&&h[r].column!=null&&o.start.column>h[r].column&&r++,u.unshift(r,0),h.splice.apply(h,u),this.$updateRows()}}},p.prototype.$updateRows=function(){var o=this.session.lineWidgets;if(o){var h=!0;o.forEach(function(r,s){if(r)for(h=!1,r.row=s;r.$oldWidget;)r.$oldWidget.row=s,r=r.$oldWidget}),h&&(this.session.lineWidgets=null)}},p.prototype.$registerLineWidget=function(o){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var h=this.session.lineWidgets[o.row];return h&&(o.$oldWidget=h,h.el&&h.el.parentNode&&(h.el.parentNode.removeChild(h.el),h._inDocument=!1)),this.session.lineWidgets[o.row]=o,o},p.prototype.addLineWidget=function(o){if(this.$registerLineWidget(o),o.session=this.session,!this.editor)return o;var h=this.editor.renderer;o.html&&!o.el&&(o.el=i.createElement("div"),o.el.innerHTML=o.html),o.text&&!o.el&&(o.el=i.createElement("div"),o.el.textContent=o.text),o.el&&(i.addCssClass(o.el,"ace_lineWidgetContainer"),o.className&&i.addCssClass(o.el,o.className),o.el.style.position="absolute",o.el.style.zIndex="5",h.container.appendChild(o.el),o._inDocument=!0,o.coverGutter||(o.el.style.zIndex="3"),o.pixelHeight==null&&(o.pixelHeight=o.el.offsetHeight)),o.rowCount==null&&(o.rowCount=o.pixelHeight/h.layerConfig.lineHeight);var r=this.session.getFoldAt(o.row,0);if(o.$fold=r,r){var s=this.session.lineWidgets;o.row==r.end.row&&!s[r.start.row]?s[r.start.row]=o:o.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:o.row}}}),this.$updateRows(),this.renderWidgets(null,h),this.onWidgetChanged(o),o},p.prototype.removeLineWidget=function(o){if(o._inDocument=!1,o.session=null,o.el&&o.el.parentNode&&o.el.parentNode.removeChild(o.el),o.editor&&o.editor.destroy)try{o.editor.destroy()}catch{}if(this.session.lineWidgets){var h=this.session.lineWidgets[o.row];if(h==o)this.session.lineWidgets[o.row]=o.$oldWidget,o.$oldWidget&&this.onWidgetChanged(o.$oldWidget);else for(;h;){if(h.$oldWidget==o){h.$oldWidget=o.$oldWidget;break}h=h.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:o.row}}}),this.$updateRows()},p.prototype.getWidgetsAtRow=function(o){for(var h=this.session.lineWidgets,r=h&&h[o],s=[];r;)s.push(r),r=r.$oldWidget;return s},p.prototype.onWidgetChanged=function(o){this.session._changedWidgets.push(o),this.editor&&this.editor.renderer.updateFull()},p.prototype.measureWidgets=function(o,h){var r=this.session._changedWidgets,s=h.layerConfig;if(!(!r||!r.length)){for(var l=1/0,u=0;u<r.length;u++){var c=r[u];if(!(!c||!c.el)&&c.session==this.session){if(!c._inDocument){if(this.session.lineWidgets[c.row]!=c)continue;c._inDocument=!0,h.container.appendChild(c.el)}c.h=c.el.offsetHeight,c.fixedWidth||(c.w=c.el.offsetWidth,c.screenWidth=Math.ceil(c.w/s.characterWidth));var f=c.h/s.lineHeight;c.coverLine&&(f-=this.session.getRowLineCount(c.row),f<0&&(f=0)),c.rowCount!=f&&(c.rowCount=f,c.row<l&&(l=c.row))}}l!=1/0&&(this.session._emit("changeFold",{data:{start:{row:l}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},p.prototype.renderWidgets=function(o,h){var r=h.layerConfig,s=this.session.lineWidgets;if(s){for(var l=Math.min(this.firstRow,r.firstRow),u=Math.max(this.lastRow,r.lastRow,s.length);l>0&&!s[l];)l--;this.firstRow=r.firstRow,this.lastRow=r.lastRow,h.$cursorLayer.config=r;for(var c=l;c<=u;c++){var f=s[c];if(!(!f||!f.el)){if(f.hidden){f.el.style.top=-100-(f.pixelHeight||0)+"px";continue}f._inDocument||(f._inDocument=!0,h.container.appendChild(f.el));var g=h.$cursorLayer.getPixelPosition({row:c,column:0},!0).top;f.coverLine||(g+=r.lineHeight*this.session.getRowLineCount(f.row)),f.el.style.top=g-r.offset+"px";var v=f.coverGutter?0:h.gutterWidth;f.fixedWidth||(v-=h.scrollLeft),f.el.style.left=v+"px",f.fullWidth&&f.screenWidth&&(f.el.style.minWidth=r.width+2*r.padding+"px"),f.fixedWidth?f.el.style.right=h.scrollBar.getWidth()+"px":f.el.style.right=""}}}},p}();n.LineWidgets=a}),ace.define("ace/apply_delta",["require","exports","module"],function(t,n,m){n.applyDelta=function(i,a,p){var o=a.start.row,h=a.start.column,r=i[o]||"";switch(a.action){case"insert":var s=a.lines;if(s.length===1)i[o]=r.substring(0,h)+a.lines[0]+r.substring(h);else{var l=[o,1].concat(a.lines);i.splice.apply(i,l),i[o]=r.substring(0,h)+i[o],i[o+a.lines.length-1]+=r.substring(h)}break;case"remove":var u=a.end.column,c=a.end.row;o===c?i[o]=r.substring(0,h)+r.substring(u):i.splice(o,c-o+1,r.substring(0,h)+i[c].substring(u));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,m){var i=t("./lib/oop"),a=t("./lib/event_emitter").EventEmitter,p=function(){function r(s,l,u){this.$onChange=this.onChange.bind(this),this.attach(s),typeof l!="number"?this.setPosition(l.row,l.column):this.setPosition(l,u)}return r.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},r.prototype.getDocument=function(){return this.document},r.prototype.onChange=function(s){if(!(s.start.row==s.end.row&&s.start.row!=this.row)&&!(s.start.row>this.row)){var l=h(s,{row:this.row,column:this.column},this.$insertRight);this.setPosition(l.row,l.column,!0)}},r.prototype.setPosition=function(s,l,u){var c;if(u?c={row:s,column:l}:c=this.$clipPositionToDocument(s,l),!(this.row==c.row&&this.column==c.column)){var f={row:this.row,column:this.column};this.row=c.row,this.column=c.column,this._signal("change",{old:f,value:c})}},r.prototype.detach=function(){this.document.off("change",this.$onChange)},r.prototype.attach=function(s){this.document=s||this.document,this.document.on("change",this.$onChange)},r.prototype.$clipPositionToDocument=function(s,l){var u={};return s>=this.document.getLength()?(u.row=Math.max(0,this.document.getLength()-1),u.column=this.document.getLine(u.row).length):s<0?(u.row=0,u.column=0):(u.row=s,u.column=Math.min(this.document.getLine(u.row).length,Math.max(0,l))),l<0&&(u.column=0),u},r}();p.prototype.$insertRight=!1,i.implement(p.prototype,a);function o(r,s,l){var u=l?r.column<=s.column:r.column<s.column;return r.row<s.row||r.row==s.row&&u}function h(r,s,l){var u=r.action=="insert",c=(u?1:-1)*(r.end.row-r.start.row),f=(u?1:-1)*(r.end.column-r.start.column),g=r.start,v=u?g:r.end;return o(s,g,l)?{row:s.row,column:s.column}:o(v,s,!l)?{row:s.row+c,column:s.column+(s.row==v.row?f:0)}:{row:g.row,column:g.column}}n.Anchor=p}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(t,n,m){var i=t("./lib/oop"),a=t("./apply_delta").applyDelta,p=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,h=t("./anchor").Anchor,r=function(){function s(l){this.$lines=[""],l.length===0?this.$lines=[""]:Array.isArray(l)?this.insertMergedLines({row:0,column:0},l):this.insert({row:0,column:0},l)}return s.prototype.setValue=function(l){var u=this.getLength()-1;this.remove(new o(0,0,u,this.getLine(u).length)),this.insert({row:0,column:0},l||"")},s.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},s.prototype.createAnchor=function(l,u){return new h(this,l,u)},s.prototype.$detectNewLine=function(l){var u=l.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=u?u[1]:`
|
|
205
|
+
`,this._signal("changeNewLineMode")},s.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
|
|
206
|
+
`;case"unix":return`
|
|
207
|
+
`;default:return this.$autoNewLine||`
|
|
208
|
+
`}},s.prototype.setNewLineMode=function(l){this.$newLineMode!==l&&(this.$newLineMode=l,this._signal("changeNewLineMode"))},s.prototype.getNewLineMode=function(){return this.$newLineMode},s.prototype.isNewLine=function(l){return l==`\r
|
|
209
|
+
`||l=="\r"||l==`
|
|
210
|
+
`},s.prototype.getLine=function(l){return this.$lines[l]||""},s.prototype.getLines=function(l,u){return this.$lines.slice(l,u+1)},s.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},s.prototype.getLength=function(){return this.$lines.length},s.prototype.getTextRange=function(l){return this.getLinesForRange(l).join(this.getNewLineCharacter())},s.prototype.getLinesForRange=function(l){var u;if(l.start.row===l.end.row)u=[this.getLine(l.start.row).substring(l.start.column,l.end.column)];else{u=this.getLines(l.start.row,l.end.row),u[0]=(u[0]||"").substring(l.start.column);var c=u.length-1;l.end.row-l.start.row==c&&(u[c]=u[c].substring(0,l.end.column))}return u},s.prototype.insertLines=function(l,u){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(l,u)},s.prototype.removeLines=function(l,u){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(l,u)},s.prototype.insertNewLine=function(l){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(l,["",""])},s.prototype.insert=function(l,u){return this.getLength()<=1&&this.$detectNewLine(u),this.insertMergedLines(l,this.$split(u))},s.prototype.insertInLine=function(l,u){var c=this.clippedPos(l.row,l.column),f=this.pos(l.row,l.column+u.length);return this.applyDelta({start:c,end:f,action:"insert",lines:[u]},!0),this.clonePos(f)},s.prototype.clippedPos=function(l,u){var c=this.getLength();l===void 0?l=c:l<0?l=0:l>=c&&(l=c-1,u=void 0);var f=this.getLine(l);return u==null&&(u=f.length),u=Math.min(Math.max(u,0),f.length),{row:l,column:u}},s.prototype.clonePos=function(l){return{row:l.row,column:l.column}},s.prototype.pos=function(l,u){return{row:l,column:u}},s.prototype.$clipPosition=function(l){var u=this.getLength();return l.row>=u?(l.row=Math.max(0,u-1),l.column=this.getLine(u-1).length):(l.row=Math.max(0,l.row),l.column=Math.min(Math.max(l.column,0),this.getLine(l.row).length)),l},s.prototype.insertFullLines=function(l,u){l=Math.min(Math.max(l,0),this.getLength());var c=0;l<this.getLength()?(u=u.concat([""]),c=0):(u=[""].concat(u),l--,c=this.$lines[l].length),this.insertMergedLines({row:l,column:c},u)},s.prototype.insertMergedLines=function(l,u){var c=this.clippedPos(l.row,l.column),f={row:c.row+u.length-1,column:(u.length==1?c.column:0)+u[u.length-1].length};return this.applyDelta({start:c,end:f,action:"insert",lines:u}),this.clonePos(f)},s.prototype.remove=function(l){var u=this.clippedPos(l.start.row,l.start.column),c=this.clippedPos(l.end.row,l.end.column);return this.applyDelta({start:u,end:c,action:"remove",lines:this.getLinesForRange({start:u,end:c})}),this.clonePos(u)},s.prototype.removeInLine=function(l,u,c){var f=this.clippedPos(l,u),g=this.clippedPos(l,c);return this.applyDelta({start:f,end:g,action:"remove",lines:this.getLinesForRange({start:f,end:g})},!0),this.clonePos(f)},s.prototype.removeFullLines=function(l,u){l=Math.min(Math.max(0,l),this.getLength()-1),u=Math.min(Math.max(0,u),this.getLength()-1);var c=u==this.getLength()-1&&l>0,f=u<this.getLength()-1,g=c?l-1:l,v=c?this.getLine(g).length:0,b=f?u+1:u,A=f?0:this.getLine(b).length,x=new o(g,v,b,A),D=this.$lines.slice(l,u+1);return this.applyDelta({start:x.start,end:x.end,action:"remove",lines:this.getLinesForRange(x)}),D},s.prototype.removeNewLine=function(l){l<this.getLength()-1&&l>=0&&this.applyDelta({start:this.pos(l,this.getLine(l).length),end:this.pos(l+1,0),action:"remove",lines:["",""]})},s.prototype.replace=function(l,u){if(l instanceof o||(l=o.fromPoints(l.start,l.end)),u.length===0&&l.isEmpty())return l.start;if(u==this.getTextRange(l))return l.end;this.remove(l);var c;return u?c=this.insert(l.start,u):c=l.start,c},s.prototype.applyDeltas=function(l){for(var u=0;u<l.length;u++)this.applyDelta(l[u])},s.prototype.revertDeltas=function(l){for(var u=l.length-1;u>=0;u--)this.revertDelta(l[u])},s.prototype.applyDelta=function(l,u){var c=l.action=="insert";(c?l.lines.length<=1&&!l.lines[0]:!o.comparePoints(l.start,l.end))||(c&&l.lines.length>2e4?this.$splitAndapplyLargeDelta(l,2e4):(a(this.$lines,l,u),this._signal("change",l)))},s.prototype.$safeApplyDelta=function(l){var u=this.$lines.length;(l.action=="remove"&&l.start.row<u&&l.end.row<u||l.action=="insert"&&l.start.row<=u)&&this.applyDelta(l)},s.prototype.$splitAndapplyLargeDelta=function(l,u){for(var c=l.lines,f=c.length-u+1,g=l.start.row,v=l.start.column,b=0,A=0;b<f;b=A){A+=u-1;var x=c.slice(b,A);x.push(""),this.applyDelta({start:this.pos(g+b,v),end:this.pos(g+A,v=0),action:l.action,lines:x},!0)}l.lines=c.slice(b),l.start.row=g+b,l.start.column=v,this.applyDelta(l,!0)},s.prototype.revertDelta=function(l){this.$safeApplyDelta({start:this.clonePos(l.start),end:this.clonePos(l.end),action:l.action=="insert"?"remove":"insert",lines:l.lines.slice()})},s.prototype.indexToPosition=function(l,u){for(var c=this.$lines||this.getAllLines(),f=this.getNewLineCharacter().length,g=u||0,v=c.length;g<v;g++)if(l-=c[g].length+f,l<0)return{row:g,column:l+c[g].length+f};return{row:v-1,column:l+c[v-1].length+f}},s.prototype.positionToIndex=function(l,u){for(var c=this.$lines||this.getAllLines(),f=this.getNewLineCharacter().length,g=0,v=Math.min(l.row,c.length),b=u||0;b<v;++b)g+=c[b].length+f;return g+l.column},s.prototype.$split=function(l){return l.split(/\r\n|\r|\n/)},s}();r.prototype.$autoNewLine="",r.prototype.$newLineMode="auto",i.implement(r.prototype,p),n.Document=r}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,m){var i=t("./lib/oop"),a=t("./lib/event_emitter").EventEmitter,p=function(){function o(h,r){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=h;var s=this;this.$worker=function(){if(s.running){for(var l=new Date,u=s.currentLine,c=-1,f=s.doc,g=u;s.lines[u];)u++;var v=f.getLength(),b=0;for(s.running=!1;u<v;){s.$tokenizeRow(u),c=u;do u++;while(s.lines[u]);if(b++,b%5===0&&new Date-l>20){s.running=setTimeout(s.$worker,20);break}}s.currentLine=u,c==-1&&(c=u),g<=c&&s.fireUpdateEvent(g,c)}}}return o.prototype.setTokenizer=function(h){this.tokenizer=h,this.lines=[],this.states=[],this.start(0)},o.prototype.setDocument=function(h){this.doc=h,this.lines=[],this.states=[],this.stop()},o.prototype.fireUpdateEvent=function(h,r){var s={first:h,last:r};this._signal("update",{data:s})},o.prototype.start=function(h){this.currentLine=Math.min(h||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},o.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},o.prototype.$updateOnChange=function(h){var r=h.start.row,s=h.end.row-r;if(s===0)this.lines[r]=null;else if(h.action=="remove")this.lines.splice(r,s+1,null),this.states.splice(r,s+1,null);else{var l=Array(s+1);l.unshift(r,1),this.lines.splice.apply(this.lines,l),this.states.splice.apply(this.states,l)}this.currentLine=Math.min(r,this.currentLine,this.doc.getLength()),this.stop()},o.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},o.prototype.getTokens=function(h){return this.lines[h]||this.$tokenizeRow(h)},o.prototype.getState=function(h){return this.currentLine==h&&this.$tokenizeRow(h),this.states[h]||"start"},o.prototype.$tokenizeRow=function(h){var r=this.doc.getLine(h),s=this.states[h-1],l=this.tokenizer.getLineTokens(r,s,h);return this.states[h]+""!=l.state+""?(this.states[h]=l.state,this.lines[h+1]=null,this.currentLine>h+1&&(this.currentLine=h+1)):this.currentLine==h&&(this.currentLine=h+1),this.lines[h]=l.tokens},o.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},o}();i.implement(p.prototype,a),n.BackgroundTokenizer=p}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(t,n,m){var i=t("./lib/lang"),a=t("./range").Range,p=function(){function o(h,r,s){s===void 0&&(s="text"),this.setRegexp(h),this.clazz=r,this.type=s,this.docLen=0}return o.prototype.setRegexp=function(h){this.regExp+""!=h+""&&(this.regExp=h,this.cache=[])},o.prototype.update=function(h,r,s,l){if(this.regExp){for(var u=l.firstRow,c=l.lastRow,f={},g=s.$editor.$search,v=g.$isMultilineSearch(s.$editor.getLastSearchOptions()),b=u;b<=c;b++){var A=this.cache[b];if(A==null||s.getValue().length!=this.docLen){if(v){A=[];var x=g.$multiLineForward(s,this.regExp,b,c);if(x){var D=x.endRow<=c?x.endRow-1:c;D>b&&(b=D),A.push(new a(x.startRow,x.startCol,x.endRow,x.endCol))}A.length>this.MAX_RANGES&&(A=A.slice(0,this.MAX_RANGES))}else A=i.getMatchOffsets(s.getLine(b),this.regExp),A.length>this.MAX_RANGES&&(A=A.slice(0,this.MAX_RANGES)),A=A.map(function(M){return new a(b,M.offset,b,M.offset+M.length)});this.cache[b]=A.length?A:""}if(A.length!==0)for(var y=A.length;y--;){var E=A[y].toScreenRange(s),T=E.toString();f[T]||(f[T]=!0,r.drawSingleLineMarker(h,E,this.clazz,l))}}this.docLen=s.getValue().length}},o}();p.prototype.MAX_RANGES=500,n.SearchHighlight=p}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,n,m){var i=function(){function D(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return D.prototype.addSession=function(y){this.$session=y},D.prototype.add=function(y,E,T){if(!this.$fromUndo&&y!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),E===!1||!this.lastDeltas){this.lastDeltas=[];var M=this.$undoStack.length;M>this.$undoDepth-1&&this.$undoStack.splice(0,M-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),y.id=this.$rev=++this.$maxRev}(y.action=="remove"||y.action=="insert")&&(this.$lastDelta=y),this.lastDeltas.push(y)}},D.prototype.addSelection=function(y,E){this.selections.push({value:y,rev:E||this.$rev})},D.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},D.prototype.markIgnored=function(y,E){E==null&&(E=this.$rev+1);for(var T=this.$undoStack,M=T.length;M--;){var $=T[M][0];if($.id<=y)break;$.id<E&&($.ignore=!0)}this.lastDeltas=null},D.prototype.getSelection=function(y,E){for(var T=this.selections,M=T.length;M--;){var $=T[M];if($.rev<y)return E&&($=T[M+1]),$}},D.prototype.getRevision=function(){return this.$rev},D.prototype.getDeltas=function(y,E){E==null&&(E=this.$rev+1);for(var T=this.$undoStack,M=null,$=0,L=T.length;L--;){var C=T[L][0];if(C.id<E&&!M&&(M=L+1),C.id<=y){$=L+1;break}}return T.slice($,M)},D.prototype.getChangedRanges=function(y,E){E==null&&(E=this.$rev+1)},D.prototype.getChangedLines=function(y,E){E==null&&(E=this.$rev+1)},D.prototype.undo=function(y,E){this.lastDeltas=null;var T=this.$undoStack;if(a(T,T.length)){y||(y=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var M=T.pop(),$=null;return M&&($=y.undoChanges(M,E),this.$redoStack.push(M),this.$syncRev()),this.$fromUndo=!1,$}},D.prototype.redo=function(y,E){if(this.lastDeltas=null,y||(y=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var T=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);x(this.$redoStack,T),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(L){L[0].id=++this.$maxRev},this)}var M=this.$redoStack.pop(),$=null;return M&&($=y.redoChanges(M,E),this.$undoStack.push(M),this.$syncRev()),this.$fromUndo=!1,$},D.prototype.$syncRev=function(){var y=this.$undoStack,E=y[y.length-1],T=E&&E[0].id||0;this.$redoStackBaseRev=T,this.$rev=T},D.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=[]},D.prototype.canUndo=function(){return this.$undoStack.length>0},D.prototype.canRedo=function(){return this.$redoStack.length>0},D.prototype.bookmark=function(y){y==null&&(y=this.$rev),this.mark=y},D.prototype.isAtBookmark=function(){return this.$rev===this.mark},D.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},D.prototype.fromJSON=function(y){this.reset(),this.$undoStack=y.$undoStack,this.$redoStack=y.$redoStack},D.prototype.$prettyPrint=function(y){return y?s(y):s(this.$undoStack)+`
|
|
211
|
+
---
|
|
212
|
+
`+s(this.$redoStack)},D}();i.prototype.hasUndo=i.prototype.canUndo,i.prototype.hasRedo=i.prototype.canRedo,i.prototype.isClean=i.prototype.isAtBookmark,i.prototype.markClean=i.prototype.bookmark;function a(D,y){for(var E=y;E--;){var T=D[E];if(T&&!T[0].ignore){for(;E<y-1;){var M=c(D[E],D[E+1]);D[E]=M[0],D[E+1]=M[1],E++}return!0}}}var p=t("./range").Range,o=p.comparePoints;p.comparePoints;function h(D){return{row:D.row,column:D.column}}function r(D){return{start:h(D.start),end:h(D.end),action:D.action,lines:D.lines.slice()}}function s(D){if(D=D||this,Array.isArray(D))return D.map(s).join(`
|
|
213
|
+
`);var y="";return D.action?(y=D.action=="insert"?"+":"-",y+="["+D.lines+"]"):D.value&&(Array.isArray(D.value)?y=D.value.map(l).join(`
|
|
214
|
+
`):y=l(D.value)),D.start&&(y+=l(D)),(D.id||D.rev)&&(y+=" ("+(D.id||D.rev)+")"),y}function l(D){return D.start.row+":"+D.start.column+"=>"+D.end.row+":"+D.end.column}function u(D,y){var E=D.action=="insert",T=y.action=="insert";if(E&&T)if(o(y.start,D.end)>=0)g(y,D,-1);else if(o(y.start,D.start)<=0)g(D,y,1);else return null;else if(E&&!T)if(o(y.start,D.end)>=0)g(y,D,-1);else if(o(y.end,D.start)<=0)g(D,y,-1);else return null;else if(!E&&T)if(o(y.start,D.start)>=0)g(y,D,1);else if(o(y.start,D.start)<=0)g(D,y,1);else return null;else if(!E&&!T)if(o(y.start,D.start)>=0)g(y,D,1);else if(o(y.end,D.start)<=0)g(D,y,-1);else return null;return[y,D]}function c(D,y){for(var E=D.length;E--;)for(var T=0;T<y.length;T++)if(!u(D[E],y[T])){for(;E<D.length;){for(;T--;)u(y[T],D[E]);T=y.length,E++}return[D,y]}return D.selectionBefore=y.selectionBefore=D.selectionAfter=y.selectionAfter=null,[y,D]}function f(D,y){var E=D.action=="insert",T=y.action=="insert";if(E&&T)o(D.start,y.start)<0?g(y,D,1):g(D,y,1);else if(E&&!T)o(D.start,y.end)>=0?g(D,y,-1):(o(D.start,y.start)<=0||g(D,p.fromPoints(y.start,D.start),-1),g(y,D,1));else if(!E&&T)o(y.start,D.end)>=0?g(y,D,-1):(o(y.start,D.start)<=0||g(y,p.fromPoints(D.start,y.start),-1),g(D,y,1));else if(!E&&!T)if(o(y.start,D.end)>=0)g(y,D,-1);else if(o(y.end,D.start)<=0)g(D,y,-1);else{var M,$;return o(D.start,y.start)<0&&(M=D,D=b(D,y.start)),o(D.end,y.end)>0&&($=b(D,y.end)),v(y.end,D.start,D.end,-1),$&&!M&&(D.lines=$.lines,D.start=$.start,D.end=$.end,$=D),[y,M,$].filter(Boolean)}return[y,D]}function g(D,y,E){v(D.start,y.start,y.end,E),v(D.end,y.start,y.end,E)}function v(D,y,E,T){D.row==(T==1?y:E).row&&(D.column+=T*(E.column-y.column)),D.row+=T*(E.row-y.row)}function b(D,y){var E=D.lines,T=D.end;D.end=h(y);var M=D.end.row-D.start.row,$=E.splice(M,E.length),L=M?y.column:y.column-D.start.column;E.push($[0].substring(0,L)),$[0]=$[0].substr(L);var C={start:h(y),end:T,lines:$,action:D.action};return C}function A(D,y){y=r(y);for(var E=D.length;E--;){for(var T=D[E],M=0;M<T.length;M++){var $=T[M],L=f($,y);y=L[0],L.length!=2&&(L[2]?(T.splice(M+1,1,L[1],L[2]),M++):L[1]||(T.splice(M,1),M--))}T.length||D.splice(E,1)}return D}function x(D,y){for(var E=0;E<y.length;E++)for(var T=y[E],M=0;M<T.length;M++)A(D,T[M])}n.UndoManager=i}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(t,n,m){var i=t("../range").Range,a=function(){function p(o,h){this.foldData=o,Array.isArray(h)?this.folds=h:h=this.folds=[h];var r=h[h.length-1];this.range=new i(h[0].start.row,h[0].start.column,r.end.row,r.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(s){s.setFoldLine(this)},this)}return p.prototype.shiftRow=function(o){this.start.row+=o,this.end.row+=o,this.folds.forEach(function(h){h.start.row+=o,h.end.row+=o})},p.prototype.addFold=function(o){if(o.sameRow){if(o.start.row<this.startRow||o.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(o),this.folds.sort(function(h,r){return-h.range.compareEnd(r.start.row,r.start.column)}),this.range.compareEnd(o.start.row,o.start.column)>0?(this.end.row=o.end.row,this.end.column=o.end.column):this.range.compareStart(o.end.row,o.end.column)<0&&(this.start.row=o.start.row,this.start.column=o.start.column)}else if(o.start.row==this.end.row)this.folds.push(o),this.end.row=o.end.row,this.end.column=o.end.column;else if(o.end.row==this.start.row)this.folds.unshift(o),this.start.row=o.start.row,this.start.column=o.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");o.foldLine=this},p.prototype.containsRow=function(o){return o>=this.start.row&&o<=this.end.row},p.prototype.walk=function(o,h,r){var s=0,l=this.folds,u,c,f,g=!0;h==null&&(h=this.end.row,r=this.end.column);for(var v=0;v<l.length;v++){if(u=l[v],c=u.range.compareStart(h,r),c==-1){o(null,h,r,s,g);return}if(f=o(null,u.start.row,u.start.column,s,g),f=!f&&o(u.placeholder,u.start.row,u.start.column,s),f||c===0)return;g=!u.sameRow,s=u.end.column}o(null,h,r,s,g)},p.prototype.getNextFoldTo=function(o,h){for(var r,s,l=0;l<this.folds.length;l++){if(r=this.folds[l],s=r.range.compareEnd(o,h),s==-1)return{fold:r,kind:"after"};if(s===0)return{fold:r,kind:"inside"}}return null},p.prototype.addRemoveChars=function(o,h,r){var s=this.getNextFoldTo(o,h),l,u;if(s){if(l=s.fold,s.kind=="inside"&&l.start.column!=h&&l.start.row!=o)window.console&&window.console.log(o,h,l);else if(l.start.row==o){u=this.folds;var c=u.indexOf(l);for(c===0&&(this.start.column+=r),c;c<u.length;c++){if(l=u[c],l.start.column+=r,!l.sameRow)return;l.end.column+=r}this.end.column+=r}}},p.prototype.split=function(o,h){var r=this.getNextFoldTo(o,h);if(!r||r.kind=="inside")return null;var s=r.fold,l=this.folds,u=this.foldData,c=l.indexOf(s),f=l[c-1];this.end.row=f.end.row,this.end.column=f.end.column,l=l.splice(c,l.length-c);var g=new p(u,l);return u.splice(u.indexOf(this)+1,0,g),g},p.prototype.merge=function(o){for(var h=o.folds,r=0;r<h.length;r++)this.addFold(h[r]);var s=this.foldData;s.splice(s.indexOf(o),1)},p.prototype.toString=function(){var o=[this.range.toString()+": ["];return this.folds.forEach(function(h){o.push(" "+h.toString())}),o.push("]"),o.join(`
|
|
215
|
+
`)},p.prototype.idxToPosition=function(o){for(var h=0,r=0;r<this.folds.length;r++){var s=this.folds[r];if(o-=s.start.column-h,o<0)return{row:s.start.row,column:s.start.column+o};if(o-=s.placeholder.length,o<0)return s.start;h=s.end.column}return{row:this.end.row,column:this.end.column+o}},p}();n.FoldLine=a}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(t,n,m){var i=t("./range").Range,a=i.comparePoints,p=function(){function o(){this.ranges=[],this.$bias=1}return o.prototype.pointIndex=function(h,r,s){for(var l=this.ranges,u=s||0;u<l.length;u++){var c=l[u],f=a(h,c.end);if(!(f>0)){var g=a(h,c.start);return f===0?r&&g!==0?-u-2:u:g>0||g===0&&!r?u:-u-1}}return-u-1},o.prototype.add=function(h){var r=!h.isEmpty(),s=this.pointIndex(h.start,r);s<0&&(s=-s-1);var l=this.pointIndex(h.end,r,s);return l<0?l=-l-1:l++,this.ranges.splice(s,l-s,h)},o.prototype.addList=function(h){for(var r=[],s=h.length;s--;)r.push.apply(r,this.add(h[s]));return r},o.prototype.substractPoint=function(h){var r=this.pointIndex(h);if(r>=0)return this.ranges.splice(r,1)},o.prototype.merge=function(){var h=[],r=this.ranges;r=r.sort(function(f,g){return a(f.start,g.start)});for(var s=r[0],l,u=1;u<r.length;u++){l=s,s=r[u];var c=a(l.end,s.start);c<0||c==0&&!l.isEmpty()&&!s.isEmpty()||(a(l.end,s.end)<0&&(l.end.row=s.end.row,l.end.column=s.end.column),r.splice(u,1),h.push(s),s=l,u--)}return this.ranges=r,h},o.prototype.contains=function(h,r){return this.pointIndex({row:h,column:r})>=0},o.prototype.containsPoint=function(h){return this.pointIndex(h)>=0},o.prototype.rangeAtPoint=function(h){var r=this.pointIndex(h);if(r>=0)return this.ranges[r]},o.prototype.clipRows=function(h,r){var s=this.ranges;if(s[0].start.row>r||s[s.length-1].start.row<h)return[];var l=this.pointIndex({row:h,column:0});l<0&&(l=-l-1);var u=this.pointIndex({row:r,column:0},l);u<0&&(u=-u-1);for(var c=[],f=l;f<u;f++)c.push(s[f]);return c},o.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},o.prototype.attach=function(h){this.session&&this.detach(),this.session=h,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},o.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},o.prototype.$onChange=function(h){for(var r=h.start,s=h.end,l=r.row,u=s.row,c=this.ranges,f=0,g=c.length;f<g;f++){var v=c[f];if(v.end.row>=l)break}if(h.action=="insert")for(var b=u-l,A=-r.column+s.column;f<g;f++){var v=c[f];if(v.start.row>l)break;if(v.start.row==l&&v.start.column>=r.column&&(v.start.column==r.column&&this.$bias<=0||(v.start.column+=A,v.start.row+=b)),v.end.row==l&&v.end.column>=r.column){if(v.end.column==r.column&&this.$bias<0)continue;v.end.column==r.column&&A>0&&f<g-1&&v.end.column>v.start.column&&v.end.column==c[f+1].start.column&&(v.end.column-=A),v.end.column+=A,v.end.row+=b}}else for(var b=l-u,A=r.column-s.column;f<g;f++){var v=c[f];if(v.start.row>u)break;v.end.row<u&&(l<v.end.row||l==v.end.row&&r.column<v.end.column)?(v.end.row=l,v.end.column=r.column):v.end.row==u?v.end.column<=s.column?(b||v.end.column>r.column)&&(v.end.column=r.column,v.end.row=r.row):(v.end.column+=A,v.end.row+=b):v.end.row>u&&(v.end.row+=b),v.start.row<u&&(l<v.start.row||l==v.start.row&&r.column<v.start.column)?(v.start.row=l,v.start.column=r.column):v.start.row==u?v.start.column<=s.column?(b||v.start.column>r.column)&&(v.start.column=r.column,v.start.row=r.row):(v.start.column+=A,v.start.row+=b):v.start.row>u&&(v.start.row+=b)}if(b!=0&&f<g)for(;f<g;f++){var v=c[f];v.start.row+=b,v.end.row+=b}},o}();p.prototype.comparePoints=a,n.RangeList=p}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(t,n,m){var i=this&&this.__extends||function(){var l=function(u,c){return l=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])},l(u,c)};return function(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");l(u,c);function f(){this.constructor=u}u.prototype=c===null?Object.create(c):(f.prototype=c.prototype,new f)}}(),a=t("../range_list").RangeList,p=function(l){i(u,l);function u(c,f){var g=l.call(this)||this;return g.foldLine=null,g.placeholder=f,g.range=c,g.start=c.start,g.end=c.end,g.sameRow=c.start.row==c.end.row,g.subFolds=g.ranges=[],g}return u.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},u.prototype.setFoldLine=function(c){this.foldLine=c,this.subFolds.forEach(function(f){f.setFoldLine(c)})},u.prototype.clone=function(){var c=this.range.clone(),f=new u(c,this.placeholder);return this.subFolds.forEach(function(g){f.subFolds.push(g.clone())}),f.collapseChildren=this.collapseChildren,f},u.prototype.addSubFold=function(c){if(!this.range.isEqual(c)){h(c,this.start);for(var A=c.start.row,x=c.start.column,f=0,g=-1;f<this.subFolds.length&&(g=this.subFolds[f].range.compare(A,x),g==1);f++);var v=this.subFolds[f],b=0;if(g==0){if(v.range.containsRange(c))return v.addSubFold(c);b=1}for(var A=c.range.end.row,x=c.range.end.column,D=f,g=-1;D<this.subFolds.length&&(g=this.subFolds[D].range.compare(A,x),g==1);D++);g==0&&D++;for(var y=this.subFolds.splice(f,D-f,c),E=g==0?y.length-1:y.length,T=b;T<E;T++)c.addSubFold(y[T]);return c.setFoldLine(this.foldLine),c}},u.prototype.restoreRange=function(c){return s(c,this.start)},u}(a);function o(l,u){l.row-=u.row,l.row==0&&(l.column-=u.column)}function h(l,u){o(l.start,u),o(l.end,u)}function r(l,u){l.row==0&&(l.column+=u.column),l.row+=u.row}function s(l,u){r(l.start,u),r(l.end,u)}n.Fold=p}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],function(t,n,m){var i=t("../range").Range,a=t("./fold_line").FoldLine,p=t("./fold").Fold,o=t("../token_iterator").TokenIterator,h=t("../mouse/mouse_event").MouseEvent;function r(){this.getFoldAt=function(s,l,u){var c=this.getFoldLine(s);if(!c)return null;for(var f=c.folds,g=0;g<f.length;g++){var v=f[g].range;if(v.contains(s,l)){if(u==1&&v.isEnd(s,l)&&!v.isEmpty())continue;if(u==-1&&v.isStart(s,l)&&!v.isEmpty())continue;return f[g]}}},this.getFoldsInRange=function(s){var l=s.start,u=s.end,c=this.$foldData,f=[];l.column+=1,u.column-=1;for(var g=0;g<c.length;g++){var v=c[g].range.compareRange(s);if(v!=2){if(v==-2)break;for(var b=c[g].folds,A=0;A<b.length;A++){var x=b[A];if(v=x.range.compareRange(s),v==-2)break;if(v==2)continue;if(v==42)break;f.push(x)}}}return l.column-=1,u.column+=1,f},this.getFoldsInRangeList=function(s){if(Array.isArray(s)){var l=[];s.forEach(function(u){l=l.concat(this.getFoldsInRange(u))},this)}else var l=this.getFoldsInRange(s);return l},this.getAllFolds=function(){for(var s=[],l=this.$foldData,u=0;u<l.length;u++)for(var c=0;c<l[u].folds.length;c++)s.push(l[u].folds[c]);return s},this.getFoldStringAt=function(s,l,u,c){if(c=c||this.getFoldLine(s),!c)return null;for(var f={end:{column:0}},g,v,b=0;b<c.folds.length;b++){v=c.folds[b];var A=v.range.compareEnd(s,l);if(A==-1){g=this.getLine(v.start.row).substring(f.end.column,v.start.column);break}else if(A===0)return null;f=v}return g||(g=this.getLine(v.start.row).substring(f.end.column)),u==-1?g.substring(0,l-f.end.column):u==1?g.substring(l-f.end.column):g},this.getFoldLine=function(s,l){var u=this.$foldData,c=0;for(l&&(c=u.indexOf(l)),c==-1&&(c=0),c;c<u.length;c++){var f=u[c];if(f.start.row<=s&&f.end.row>=s)return f;if(f.end.row>s)return null}return null},this.getNextFoldLine=function(s,l){var u=this.$foldData,c=0;for(l&&(c=u.indexOf(l)),c==-1&&(c=0),c;c<u.length;c++){var f=u[c];if(f.end.row>=s)return f}return null},this.getFoldedRowCount=function(s,l){for(var u=this.$foldData,c=l-s+1,f=0;f<u.length;f++){var g=u[f],v=g.end.row,b=g.start.row;if(v>=l){b<l&&(b>=s?c-=l-b:c=0);break}else v>=s&&(b>=s?c-=v-b:c-=v-s+1)}return c},this.$addFoldLine=function(s){return this.$foldData.push(s),this.$foldData.sort(function(l,u){return l.start.row-u.start.row}),s},this.addFold=function(s,l){var u=this.$foldData,c=!1,f;s instanceof p?f=s:(f=new p(l,s),f.collapseChildren=l.collapseChildren),this.$clipRangeToDocument(f.range);var g=f.start.row,v=f.start.column,b=f.end.row,A=f.end.column,x=this.getFoldAt(g,v,1),D=this.getFoldAt(b,A,-1);if(x&&D==x)return x.addSubFold(f);x&&!x.range.isStart(g,v)&&this.removeFold(x),D&&!D.range.isEnd(b,A)&&this.removeFold(D);var y=this.getFoldsInRange(f.range);y.length>0&&(this.removeFolds(y),f.collapseChildren||y.forEach(function($){f.addSubFold($)}));for(var E=0;E<u.length;E++){var T=u[E];if(b==T.start.row){T.addFold(f),c=!0;break}else if(g==T.end.row){if(T.addFold(f),c=!0,!f.sameRow){var M=u[E+1];if(M&&M.start.row==b){T.merge(M);break}}break}else if(b<=T.start.row)break}return c||(T=this.$addFoldLine(new a(this.$foldData,f))),this.$useWrapMode?this.$updateWrapData(T.start.row,T.start.row):this.$updateRowLengthCache(T.start.row,T.start.row),this.$modified=!0,this._signal("changeFold",{data:f,action:"add"}),f},this.addFolds=function(s){s.forEach(function(l){this.addFold(l)},this)},this.removeFold=function(s){var l=s.foldLine,u=l.start.row,c=l.end.row,f=this.$foldData,g=l.folds;if(g.length==1)f.splice(f.indexOf(l),1);else if(l.range.isEnd(s.end.row,s.end.column))g.pop(),l.end.row=g[g.length-1].end.row,l.end.column=g[g.length-1].end.column;else if(l.range.isStart(s.start.row,s.start.column))g.shift(),l.start.row=g[0].start.row,l.start.column=g[0].start.column;else if(s.sameRow)g.splice(g.indexOf(s),1);else{var v=l.split(s.start.row,s.start.column);g=v.folds,g.shift(),v.start.row=g[0].start.row,v.start.column=g[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(u,c):this.$updateRowLengthCache(u,c)),this.$modified=!0,this._signal("changeFold",{data:s,action:"remove"})},this.removeFolds=function(s){for(var l=[],u=0;u<s.length;u++)l.push(s[u]);l.forEach(function(c){this.removeFold(c)},this),this.$modified=!0},this.expandFold=function(s){this.removeFold(s),s.subFolds.forEach(function(l){s.restoreRange(l),this.addFold(l)},this),s.collapseChildren>0&&this.foldAll(s.start.row+1,s.end.row,s.collapseChildren-1),s.subFolds=[]},this.expandFolds=function(s){s.forEach(function(l){this.expandFold(l)},this)},this.unfold=function(s,l){var u,c;if(s==null)u=new i(0,0,this.getLength(),0),l==null&&(l=!0);else if(typeof s=="number")u=new i(s,0,s,this.getLine(s).length);else if("row"in s)u=i.fromPoints(s,s);else{if(Array.isArray(s))return c=[],s.forEach(function(g){c=c.concat(this.unfold(g))},this),c;u=s}c=this.getFoldsInRangeList(u);for(var f=c;c.length==1&&i.comparePoints(c[0].start,u.start)<0&&i.comparePoints(c[0].end,u.end)>0;)this.expandFolds(c),c=this.getFoldsInRangeList(u);if(l!=!1?this.removeFolds(c):this.expandFolds(c),f.length)return f},this.isRowFolded=function(s,l){return!!this.getFoldLine(s,l)},this.getRowFoldEnd=function(s,l){var u=this.getFoldLine(s,l);return u?u.end.row:s},this.getRowFoldStart=function(s,l){var u=this.getFoldLine(s,l);return u?u.start.row:s},this.getFoldDisplayLine=function(s,l,u,c,f){c==null&&(c=s.start.row),f==null&&(f=0),l==null&&(l=s.end.row),u==null&&(u=this.getLine(l).length);var g=this.doc,v="";return s.walk(function(b,A,x,D){if(!(A<c)){if(A==c){if(x<f)return;D=Math.max(f,D)}b!=null?v+=b:v+=g.getLine(A).substring(D,x)}},l,u),v},this.getDisplayLine=function(s,l,u,c){var f=this.getFoldLine(s);if(f)return this.getFoldDisplayLine(f,s,l,u,c);var g;return g=this.doc.getLine(s),g.substring(c||0,l||g.length)},this.$cloneFoldData=function(){var s=[];return s=this.$foldData.map(function(l){var u=l.folds.map(function(c){return c.clone()});return new a(s,u)}),s},this.toggleFold=function(s){var l=this.selection,u=l.getRange(),c,f;if(u.isEmpty()){var g=u.start;if(c=this.getFoldAt(g.row,g.column),c){this.expandFold(c);return}else(f=this.findMatchingBracket(g))?u.comparePoint(f)==1?u.end=f:(u.start=f,u.start.column++,u.end.column--):(f=this.findMatchingBracket({row:g.row,column:g.column+1}))?(u.comparePoint(f)==1?u.end=f:u.start=f,u.start.column++):u=this.getCommentFoldRange(g.row,g.column)||u}else{var v=this.getFoldsInRange(u);if(s&&v.length){this.expandFolds(v);return}else v.length==1&&(c=v[0])}if(c||(c=this.getFoldAt(u.start.row,u.start.column)),c&&c.range.toString()==u.toString()){this.expandFold(c);return}var b="...";if(!u.isMultiLine()){if(b=this.getTextRange(u),b.length<4)return;b=b.trim().substring(0,2)+".."}this.addFold(b,u)},this.getCommentFoldRange=function(s,l,u){var c=new o(this,s,l),f=c.getCurrentToken(),g=f&&f.type;if(f&&/^comment|string/.test(g)){g=g.match(/comment|string/)[0],g=="comment"&&(g+="|doc-start|\\.doc");var v=new RegExp(g),b=new i;if(u!=1){do f=c.stepBackward();while(f&&v.test(f.type));f=c.stepForward()}b.start.row=c.getCurrentTokenRow(),b.start.column=c.getCurrentTokenColumn()+f.value.length,c=new o(this,s,l);var A=this.getState(c.$row);if(u!=-1){var x=-1;do if(f=c.stepForward(),x==-1){var D=this.getState(c.$row);A.toString()!==D.toString()&&(x=c.$row)}else if(c.$row>x)break;while(f&&v.test(f.type));f=c.stepBackward()}else f=c.getCurrentToken();return b.end.row=c.getCurrentTokenRow(),b.end.column=c.getCurrentTokenColumn(),b}},this.foldAll=function(s,l,u,c){u==null&&(u=1e5);var f=this.foldWidgets;if(f){l=l||this.getLength(),s=s||0;for(var g=s;g<l;g++)if(f[g]==null&&(f[g]=this.getFoldWidget(g)),f[g]=="start"&&!(c&&!c(g))){var v=this.getFoldWidgetRange(g);v&&v.isMultiLine()&&v.end.row<=l&&v.start.row>=s&&(g=v.end.row,v.collapseChildren=u,this.addFold("...",v))}}},this.foldToLevel=function(s){for(this.foldAll();s-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var s=this;this.foldAll(null,null,null,function(l){for(var u=s.getTokens(l),c=0;c<u.length;c++){var f=u[c];if(!(f.type=="text"&&/^\s+$/.test(f.value)))return!!/comment/.test(f.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(s){if(!this.$foldStyles[s])throw new Error("invalid fold style: "+s+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=s){this.$foldStyle=s,s=="manual"&&this.unfold();var l=this.$foldMode;this.$setFolding(null),this.$setFolding(l)}},this.$setFolding=function(s){if(this.$foldMode!=s){if(this.$foldMode=s,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!s||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=s.getFoldWidget.bind(s,this,this.$foldStyle),this.getFoldWidgetRange=s.getFoldWidgetRange.bind(s,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(s,l){var u=this.foldWidgets;if(!u||l&&u[s])return{};for(var c=s-1,f;c>=0;){var g=u[c];if(g==null&&(g=u[c]=this.getFoldWidget(c)),g=="start"){var v=this.getFoldWidgetRange(c);if(f||(f=v),v&&v.end.row>=s)break}c--}return{range:c!==-1&&v,firstRange:f}},this.onFoldWidgetClick=function(s,l){l instanceof h&&(l=l.domEvent);var u={children:l.shiftKey,all:l.ctrlKey||l.metaKey,siblings:l.altKey},c=this.$toggleFoldWidget(s,u);if(!c){var f=l.target||l.srcElement;f&&/ace_fold-widget/.test(f.className)&&(f.className+=" ace_invalid")}},this.$toggleFoldWidget=function(s,l){if(this.getFoldWidget){var u=this.getFoldWidget(s),c=this.getLine(s),f=u==="end"?-1:1,g=this.getFoldAt(s,f===-1?0:c.length,f);if(g)return l.children||l.all?this.removeFold(g):this.expandFold(g),g;var v=this.getFoldWidgetRange(s,!0);if(v&&!v.isMultiLine()&&(g=this.getFoldAt(v.start.row,v.start.column,1),g&&v.isEqual(g.range)))return this.removeFold(g),g;if(l.siblings){var b=this.getParentFoldRangeData(s);if(b.range)var A=b.range.start.row+1,x=b.range.end.row;this.foldAll(A,x,l.all?1e4:0)}else l.children?(x=v?v.end.row:this.getLength(),this.foldAll(s+1,x,l.all?1e4:0)):v&&(l.all&&(v.collapseChildren=1e4),this.addFold("...",v));return v}},this.toggleFoldWidget=function(s){var l=this.selection.getCursor().row;l=this.getRowFoldStart(l);var u=this.$toggleFoldWidget(l,{});if(!u){var c=this.getParentFoldRangeData(l,!0);if(u=c.range||c.firstRange,u){l=u.start.row;var f=this.getFoldAt(l,this.getLine(l).length,1);f?this.removeFold(f):this.addFold("...",u)}}},this.updateFoldWidgets=function(s){var l=s.start.row,u=s.end.row-l;if(u===0)this.foldWidgets[l]=null;else if(s.action=="remove")this.foldWidgets.splice(l,u+1,null);else{var c=Array(u+1);c.unshift(l,1),this.foldWidgets.splice.apply(this.foldWidgets,c)}},this.tokenizerUpdateFoldWidgets=function(s){var l=s.data;l.first!=l.last&&this.foldWidgets.length>l.first&&this.foldWidgets.splice(l.first,this.foldWidgets.length)}}n.Folding=r}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,n,m){var i=t("../token_iterator").TokenIterator,a=t("../range").Range;function p(){this.findMatchingBracket=function(o,h){if(o.column==0)return null;var r=h||this.getLine(o.row).charAt(o.column-1);if(r=="")return null;var s=r.match(/([\(\[\{])|([\)\]\}])/);return s?s[1]?this.$findClosingBracket(s[1],o):this.$findOpeningBracket(s[2],o):null},this.getBracketRange=function(o){var h=this.getLine(o.row),r=!0,s,l=h.charAt(o.column-1),u=l&&l.match(/([\(\[\{])|([\)\]\}])/);if(u||(l=h.charAt(o.column),o={row:o.row,column:o.column+1},u=l&&l.match(/([\(\[\{])|([\)\]\}])/),r=!1),!u)return null;if(u[1]){var c=this.$findClosingBracket(u[1],o);if(!c)return null;s=a.fromPoints(o,c),r||(s.end.column++,s.start.column--),s.cursor=s.end}else{var c=this.$findOpeningBracket(u[2],o);if(!c)return null;s=a.fromPoints(c,o),r||(s.start.column++,s.end.column--),s.cursor=s.start}return s},this.getMatchingBracketRanges=function(o,h){var r=this.getLine(o.row),s=/([\(\[\{])|([\)\]\}])/,l=!h&&r.charAt(o.column-1),u=l&&l.match(s);if(u||(l=(h===void 0||h)&&r.charAt(o.column),o={row:o.row,column:o.column+1},u=l&&l.match(s)),!u)return null;var c=new a(o.row,o.column-1,o.row,o.column),f=u[1]?this.$findClosingBracket(u[1],o):this.$findOpeningBracket(u[2],o);if(!f)return[c];var g=new a(f.row,f.column,f.row,f.column+1);return[c,g]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(o,h,r){var s=this.$brackets[o],l=1,u=new i(this,h.row,h.column),c=u.getCurrentToken();if(c||(c=u.stepForward()),!!c){r||(r=new RegExp("(\\.?"+c.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var f=h.column-u.getCurrentTokenColumn()-2,g=c.value;;){for(;f>=0;){var v=g.charAt(f);if(v==s){if(l-=1,l==0)return{row:u.getCurrentTokenRow(),column:f+u.getCurrentTokenColumn()}}else v==o&&(l+=1);f-=1}do c=u.stepBackward();while(c&&!r.test(c.type));if(c==null)break;g=c.value,f=g.length-1}return null}},this.$findClosingBracket=function(o,h,r){var s=this.$brackets[o],l=1,u=new i(this,h.row,h.column),c=u.getCurrentToken();if(c||(c=u.stepForward()),!!c){r||(r=new RegExp("(\\.?"+c.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var f=h.column-u.getCurrentTokenColumn();;){for(var g=c.value,v=g.length;f<v;){var b=g.charAt(f);if(b==s){if(l-=1,l==0)return{row:u.getCurrentTokenRow(),column:f+u.getCurrentTokenColumn()}}else b==o&&(l+=1);f+=1}do c=u.stepForward();while(c&&!r.test(c.type));if(c==null)break;f=0}return null}},this.getMatchingTags=function(o){var h=new i(this,o.row,o.column),r=this.$findTagName(h);if(r){var s=h.stepBackward();return s.value==="<"?this.$findClosingTag(h,r):this.$findOpeningTag(h,r)}},this.$findTagName=function(o){var h=o.getCurrentToken(),r=!1,s=!1;if(h&&h.type.indexOf("tag-name")===-1)do s?h=o.stepBackward():h=o.stepForward(),h&&(h.value==="/>"?s=!0:h.type.indexOf("tag-name")!==-1&&(r=!0));while(h&&!r);return h},this.$findClosingTag=function(o,h){var r,s=h.value,l=h.value,u=0,c=new a(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);h=o.stepForward();var f=new a(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+h.value.length),g=!1;do{if(r=h,r.type.indexOf("tag-close")!==-1&&!g){var v=new a(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);g=!0}if(h=o.stepForward(),h){if(h.value===">"&&!g){var v=new a(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);g=!0}if(h.type.indexOf("tag-name")!==-1){if(s=h.value,l===s){if(r.value==="<")u++;else if(r.value==="</"&&(u--,u<0)){o.stepBackward();var b=new a(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+2);h=o.stepForward();var A=new a(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+h.value.length);if(h.type.indexOf("tag-close")===-1&&(h=o.stepForward()),h&&h.value===">")var x=new a(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);else return}}}else if(l===s&&h.value==="/>"&&(u--,u<0))var b=new a(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+2),A=b,x=A,v=new a(f.end.row,f.end.column,f.end.row,f.end.column+1)}}while(h&&u>=0);if(c&&v&&b&&x&&f&&A)return{openTag:new a(c.start.row,c.start.column,v.end.row,v.end.column),closeTag:new a(b.start.row,b.start.column,x.end.row,x.end.column),openTagName:f,closeTagName:A}},this.$findOpeningTag=function(o,h){var r=o.getCurrentToken(),s=h.value,l=0,u=o.getCurrentTokenRow(),c=o.getCurrentTokenColumn(),f=c+2,g=new a(u,c,u,f);o.stepForward();var v=new a(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+h.value.length);if(h.type.indexOf("tag-close")===-1&&(h=o.stepForward()),!(!h||h.value!==">")){var b=new a(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);o.stepBackward(),o.stepBackward();do if(h=r,u=o.getCurrentTokenRow(),c=o.getCurrentTokenColumn(),f=c+h.value.length,r=o.stepBackward(),h){if(h.type.indexOf("tag-name")!==-1){if(s===h.value)if(r.value==="<"){if(l++,l>0){var A=new a(u,c,u,f),x=new a(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1);do h=o.stepForward();while(h&&h.value!==">");var D=new a(o.getCurrentTokenRow(),o.getCurrentTokenColumn(),o.getCurrentTokenRow(),o.getCurrentTokenColumn()+1)}}else r.value==="</"&&l--}else if(h.value==="/>"){for(var y=0,E=r;E;){if(E.type.indexOf("tag-name")!==-1&&E.value===s){l--;break}else if(E.value==="<")break;E=o.stepBackward(),y++}for(var T=0;T<y;T++)o.stepForward()}}while(r&&l<=0);if(x&&D&&g&&b&&A&&v)return{openTag:new a(x.start.row,x.start.column,D.end.row,D.end.column),closeTag:new a(g.start.row,g.start.column,b.end.row,b.end.column),openTagName:A,closeTagName:v}}}}n.BracketMatch=p}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/line_widgets","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(t,n,m){var i=t("./lib/oop"),a=t("./lib/lang"),p=t("./bidihandler").BidiHandler,o=t("./config"),h=t("./lib/event_emitter").EventEmitter,r=t("./selection").Selection,s=t("./mode/text").Mode,l=t("./range").Range,u=t("./line_widgets").LineWidgets,c=t("./document").Document,f=t("./background_tokenizer").BackgroundTokenizer,g=t("./search_highlight").SearchHighlight,v=t("./undomanager").UndoManager,b=function(){function C(w,S){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$editor=null,this.prevOp={},this.$foldData=[],this.id="session"+ ++C.$uid,this.$foldData.toString=function(){return this.join(`
|
|
216
|
+
`)},this.bgTokenizer=new f(new s().getTokenizer(),this);var k=this;this.bgTokenizer.on("update",function(_){k._signal("tokenizerUpdate",_)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof w!="object"||!w.getLine)&&(w=new c(w)),this.setDocument(w),this.selection=new r(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new p(this),o.resetOptions(this),this.setMode(S),o._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return C.prototype.$initOperationListeners=function(){var w=this;this.curOp=null,this.on("change",function(){w.curOp||(w.startOperation(),w.curOp.selectionBefore=w.$lastSel),w.curOp.docChanged=!0},!0),this.on("changeSelection",function(){w.curOp||(w.startOperation(),w.curOp.selectionBefore=w.$lastSel),w.curOp.selectionChanged=!0},!0),this.$operationResetTimer=a.delayedCall(this.endOperation.bind(this,!0))},C.prototype.startOperation=function(w){if(this.curOp){if(!w||this.curOp.command)return;this.prevOp=this.curOp}w||(w={}),this.$operationResetTimer.schedule(),this.curOp={command:w.command||{},args:w.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",w)},C.prototype.endOperation=function(w){if(this.curOp){if(w&&w.returnValue===!1){this.curOp=null,this._signal("endOperation",w);return}if(w==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var S=this.selection.toJSON();this.curOp.selectionAfter=S,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(S),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",w)}},C.prototype.setDocument=function(w){this.doc&&this.doc.off("change",this.$onChange),this.doc=w,w.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},C.prototype.getDocument=function(){return this.doc},Object.defineProperty(C.prototype,"widgetManager",{get:function(){var w=new u(this);return this.widgetManager=w,this.$editor&&w.attach(this.$editor),w},set:function(w){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:w})},enumerable:!1,configurable:!0}),C.prototype.$resetRowCache=function(w){if(!w){this.$docRowCache=[],this.$screenRowCache=[];return}var S=this.$docRowCache.length,k=this.$getRowCacheIndex(this.$docRowCache,w)+1;S>k&&(this.$docRowCache.splice(k,S),this.$screenRowCache.splice(k,S))},C.prototype.$getRowCacheIndex=function(w,S){for(var k=0,_=w.length-1;k<=_;){var F=k+_>>1,R=w[F];if(S>R)k=F+1;else if(S<R)_=F-1;else return F}return k-1},C.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},C.prototype.onChangeFold=function(w){var S=w.data;this.$resetRowCache(S.start.row)},C.prototype.onChange=function(w){this.$modified=!0,this.$bidiHandler.onChange(w),this.$resetRowCache(w.start.row);var S=this.$updateInternalDataOnChange(w);!this.$fromUndo&&this.$undoManager&&(S&&S.length&&(this.$undoManager.add({action:"removeFolds",folds:S},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(w,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(w),this._signal("change",w)},C.prototype.onSelectionChange=function(){this._signal("changeSelection")},C.prototype.setValue=function(w){this.doc.setValue(w),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},C.fromJSON=function(w){typeof w=="string"&&(w=JSON.parse(w));var S=new v;S.$undoStack=w.history.undo,S.$redoStack=w.history.redo,S.mark=w.history.mark,S.$rev=w.history.rev;var k=new C(w.value);return w.folds.forEach(function(_){k.addFold("...",l.fromPoints(_.start,_.end))}),k.setAnnotations(w.annotations),k.setBreakpoints(w.breakpoints),k.setMode(w.mode),k.setScrollLeft(w.scrollLeft),k.setScrollTop(w.scrollTop),k.setUndoManager(S),k.selection.fromJSON(w.selection),k},C.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(w){return w.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},C.prototype.toString=function(){return this.doc.getValue()},C.prototype.getSelection=function(){return this.selection},C.prototype.getState=function(w){return this.bgTokenizer.getState(w)},C.prototype.getTokens=function(w){return this.bgTokenizer.getTokens(w)},C.prototype.getTokenAt=function(w,S){var k=this.bgTokenizer.getTokens(w),_,F=0;if(S==null){var R=k.length-1;F=this.getLine(w).length}else for(var R=0;R<k.length&&(F+=k[R].value.length,!(F>=S));R++);return _=k[R],_?(_.index=R,_.start=F-_.value.length,_):null},C.prototype.setUndoManager=function(w){if(this.$undoManager=w,this.$informUndoManager&&this.$informUndoManager.cancel(),w){var S=this;w.addSession(this),this.$syncInformUndoManager=function(){S.$informUndoManager.cancel(),S.mergeUndoDeltas=!1},this.$informUndoManager=a.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},C.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},C.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},C.prototype.getTabString=function(){return this.getUseSoftTabs()?a.stringRepeat(" ",this.getTabSize()):" "},C.prototype.setUseSoftTabs=function(w){this.setOption("useSoftTabs",w)},C.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},C.prototype.setTabSize=function(w){this.setOption("tabSize",w)},C.prototype.getTabSize=function(){return this.$tabSize},C.prototype.isTabStop=function(w){return this.$useSoftTabs&&w.column%this.$tabSize===0},C.prototype.setNavigateWithinSoftTabs=function(w){this.setOption("navigateWithinSoftTabs",w)},C.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},C.prototype.setOverwrite=function(w){this.setOption("overwrite",w)},C.prototype.getOverwrite=function(){return this.$overwrite},C.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},C.prototype.addGutterDecoration=function(w,S){this.$decorations[w]||(this.$decorations[w]=""),this.$decorations[w]+=" "+S,this._signal("changeBreakpoint",{})},C.prototype.removeGutterDecoration=function(w,S){this.$decorations[w]=(this.$decorations[w]||"").replace(" "+S,""),this._signal("changeBreakpoint",{})},C.prototype.getBreakpoints=function(){return this.$breakpoints},C.prototype.setBreakpoints=function(w){this.$breakpoints=[];for(var S=0;S<w.length;S++)this.$breakpoints[w[S]]="ace_breakpoint";this._signal("changeBreakpoint",{})},C.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},C.prototype.setBreakpoint=function(w,S){S===void 0&&(S="ace_breakpoint"),S?this.$breakpoints[w]=S:delete this.$breakpoints[w],this._signal("changeBreakpoint",{})},C.prototype.clearBreakpoint=function(w){delete this.$breakpoints[w],this._signal("changeBreakpoint",{})},C.prototype.addMarker=function(w,S,k,_){var F=this.$markerId++,R={range:w,type:k||"line",renderer:typeof k=="function"?k:null,clazz:S,inFront:!!_,id:F};return _?(this.$frontMarkers[F]=R,this._signal("changeFrontMarker")):(this.$backMarkers[F]=R,this._signal("changeBackMarker")),F},C.prototype.addDynamicMarker=function(w,S){if(w.update){var k=this.$markerId++;return w.id=k,w.inFront=!!S,S?(this.$frontMarkers[k]=w,this._signal("changeFrontMarker")):(this.$backMarkers[k]=w,this._signal("changeBackMarker")),w}},C.prototype.removeMarker=function(w){var S=this.$frontMarkers[w]||this.$backMarkers[w];if(S){var k=S.inFront?this.$frontMarkers:this.$backMarkers;delete k[w],this._signal(S.inFront?"changeFrontMarker":"changeBackMarker")}},C.prototype.getMarkers=function(w){return w?this.$frontMarkers:this.$backMarkers},C.prototype.highlight=function(w){if(!this.$searchHighlight){var S=new g(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(S)}this.$searchHighlight.setRegexp(w)},C.prototype.highlightLines=function(w,S,k,_){typeof S!="number"&&(k=S,S=w),k||(k="ace_step");var F=new l(w,0,S,1/0);return F.id=this.addMarker(F,k,"fullLine",_),F},C.prototype.setAnnotations=function(w){this.$annotations=w,this._signal("changeAnnotation",{})},C.prototype.getAnnotations=function(){return this.$annotations||[]},C.prototype.clearAnnotations=function(){this.setAnnotations([])},C.prototype.$detectNewLine=function(w){var S=w.match(/^.*?(\r?\n)/m);S?this.$autoNewLine=S[1]:this.$autoNewLine=`
|
|
217
|
+
`},C.prototype.getWordRange=function(w,S){var k=this.getLine(w),_=!1;if(S>0&&(_=!!k.charAt(S-1).match(this.tokenRe)),_||(_=!!k.charAt(S).match(this.tokenRe)),_)var F=this.tokenRe;else if(/^\s+$/.test(k.slice(S-1,S+1)))var F=/\s/;else var F=this.nonTokenRe;var R=S;if(R>0){do R--;while(R>=0&&k.charAt(R).match(F));R++}for(var O=S;O<k.length&&k.charAt(O).match(F);)O++;return new l(w,R,w,O)},C.prototype.getAWordRange=function(w,S){for(var k=this.getWordRange(w,S),_=this.getLine(k.end.row);_.charAt(k.end.column).match(/[ \t]/);)k.end.column+=1;return k},C.prototype.setNewLineMode=function(w){this.doc.setNewLineMode(w)},C.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},C.prototype.setUseWorker=function(w){this.setOption("useWorker",w)},C.prototype.getUseWorker=function(){return this.$useWorker},C.prototype.onReloadTokenizer=function(w){var S=w.data;this.bgTokenizer.start(S.first),this._signal("tokenizerUpdate",w)},C.prototype.setMode=function(w,S){if(w&&typeof w=="object"){if(w.getTokenizer)return this.$onChangeMode(w);var k=w,_=k.path}else _=w||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new s),this.$modes[_]&&!k){this.$onChangeMode(this.$modes[_]),S&&S();return}this.$modeId=_,o.loadModule(["mode",_],function(F){if(!this.destroyed){if(this.$modeId!==_)return S&&S();this.$modes[_]&&!k?this.$onChangeMode(this.$modes[_]):F&&F.Mode&&(F=new F.Mode(k),k||(this.$modes[_]=F,F.$id=_),this.$onChangeMode(F)),S&&S()}}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},C.prototype.$onChangeMode=function(w,S){if(S||(this.$modeId=w.$id),this.$mode!==w){var k=this.$mode;this.$mode=w,this.$stopWorker(),this.$useWorker&&this.$startWorker();var _=w.getTokenizer();if(_.on!==void 0){var F=this.onReloadTokenizer.bind(this);_.on("update",F)}this.bgTokenizer.setTokenizer(_),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=w.tokenRe,this.nonTokenRe=w.nonTokenRe,S||(w.attachToSession&&w.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(w.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:k,mode:w}))}},C.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},C.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(w){o.warn("Could not load worker",w),this.$worker=null}},C.prototype.getMode=function(){return this.$mode},C.prototype.setScrollTop=function(w){this.$scrollTop===w||isNaN(w)||(this.$scrollTop=w,this._signal("changeScrollTop",w))},C.prototype.getScrollTop=function(){return this.$scrollTop},C.prototype.setScrollLeft=function(w){this.$scrollLeft===w||isNaN(w)||(this.$scrollLeft=w,this._signal("changeScrollLeft",w))},C.prototype.getScrollLeft=function(){return this.$scrollLeft},C.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},C.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var w=0;return this.lineWidgets.forEach(function(S){S&&S.screenWidth>w&&(w=S.screenWidth)}),this.lineWidgetWidth=w},C.prototype.$computeWidth=function(w){if(this.$modified||w){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var S=this.doc.getAllLines(),k=this.$rowLengthCache,_=0,F=0,R=this.$foldData[F],O=R?R.start.row:1/0,V=S.length,P=0;P<V;P++){if(P>O){if(P=R.end.row+1,P>=V)break;R=this.$foldData[F++],O=R?R.start.row:1/0}k[P]==null&&(k[P]=this.$getStringScreenWidth(S[P])[0]),k[P]>_&&(_=k[P])}this.screenWidth=_}},C.prototype.getLine=function(w){return this.doc.getLine(w)},C.prototype.getLines=function(w,S){return this.doc.getLines(w,S)},C.prototype.getLength=function(){return this.doc.getLength()},C.prototype.getTextRange=function(w){return this.doc.getTextRange(w||this.selection.getRange())},C.prototype.insert=function(w,S){return this.doc.insert(w,S)},C.prototype.remove=function(w){return this.doc.remove(w)},C.prototype.removeFullLines=function(w,S){return this.doc.removeFullLines(w,S)},C.prototype.undoChanges=function(w,S){if(w.length){this.$fromUndo=!0;for(var k=w.length-1;k!=-1;k--){var _=w[k];_.action=="insert"||_.action=="remove"?this.doc.revertDelta(_):_.folds&&this.addFolds(_.folds)}!S&&this.$undoSelect&&(w.selectionBefore?this.selection.fromJSON(w.selectionBefore):this.selection.setRange(this.$getUndoSelection(w,!0))),this.$fromUndo=!1}},C.prototype.redoChanges=function(w,S){if(w.length){this.$fromUndo=!0;for(var k=0;k<w.length;k++){var _=w[k];(_.action=="insert"||_.action=="remove")&&this.doc.$safeApplyDelta(_)}!S&&this.$undoSelect&&(w.selectionAfter?this.selection.fromJSON(w.selectionAfter):this.selection.setRange(this.$getUndoSelection(w,!1))),this.$fromUndo=!1}},C.prototype.setUndoSelect=function(w){this.$undoSelect=w},C.prototype.$getUndoSelection=function(w,S){function k(V){return S?V.action!=="insert":V.action==="insert"}for(var _,F,R=0;R<w.length;R++){var O=w[R];if(O.start){if(!_){k(O)?_=l.fromPoints(O.start,O.end):_=l.fromPoints(O.start,O.start);continue}k(O)?(F=O.start,_.compare(F.row,F.column)==-1&&_.setStart(F),F=O.end,_.compare(F.row,F.column)==1&&_.setEnd(F)):(F=O.start,_.compare(F.row,F.column)==-1&&(_=l.fromPoints(O.start,O.start)))}}return _},C.prototype.replace=function(w,S){return this.doc.replace(w,S)},C.prototype.moveText=function(w,S,k){var _=this.getTextRange(w),F=this.getFoldsInRange(w),R=l.fromPoints(S,S);if(!k){this.remove(w);var O=w.start.row-w.end.row,V=O?-w.end.column:w.start.column-w.end.column;V&&(R.start.row==w.end.row&&R.start.column>w.end.column&&(R.start.column+=V),R.end.row==w.end.row&&R.end.column>w.end.column&&(R.end.column+=V)),O&&R.start.row>=w.end.row&&(R.start.row+=O,R.end.row+=O)}if(R.end=this.insert(R.start,_),F.length){var P=w.start,H=R.start,O=H.row-P.row,V=H.column-P.column;this.addFolds(F.map(function(z){return z=z.clone(),z.start.row==P.row&&(z.start.column+=V),z.end.row==P.row&&(z.end.column+=V),z.start.row+=O,z.end.row+=O,z}))}return R},C.prototype.indentRows=function(w,S,k){k=k.replace(/\t/g,this.getTabString());for(var _=w;_<=S;_++)this.doc.insertInLine({row:_,column:0},k)},C.prototype.outdentRows=function(w){for(var S=w.collapseRows(),k=new l(0,0,0,0),_=this.getTabSize(),F=S.start.row;F<=S.end.row;++F){var R=this.getLine(F);k.start.row=F,k.end.row=F;for(var O=0;O<_&&R.charAt(O)==" ";++O);O<_&&R.charAt(O)==" "?(k.start.column=O,k.end.column=O+1):(k.start.column=0,k.end.column=O),this.remove(k)}},C.prototype.$moveLines=function(w,S,k){if(w=this.getRowFoldStart(w),S=this.getRowFoldEnd(S),k<0){var _=this.getRowFoldStart(w+k);if(_<0)return 0;var F=_-w}else if(k>0){var _=this.getRowFoldEnd(S+k);if(_>this.doc.getLength()-1)return 0;var F=_-S}else{w=this.$clipRowToDocument(w),S=this.$clipRowToDocument(S);var F=S-w+1}var R=new l(w,0,S,Number.MAX_VALUE),O=this.getFoldsInRange(R).map(function(P){return P=P.clone(),P.start.row+=F,P.end.row+=F,P}),V=k==0?this.doc.getLines(w,S):this.doc.removeFullLines(w,S);return this.doc.insertFullLines(w+F,V),O.length&&this.addFolds(O),F},C.prototype.moveLinesUp=function(w,S){return this.$moveLines(w,S,-1)},C.prototype.moveLinesDown=function(w,S){return this.$moveLines(w,S,1)},C.prototype.duplicateLines=function(w,S){return this.$moveLines(w,S,0)},C.prototype.$clipRowToDocument=function(w){return Math.max(0,Math.min(w,this.doc.getLength()-1))},C.prototype.$clipColumnToRow=function(w,S){return S<0?0:Math.min(this.doc.getLine(w).length,S)},C.prototype.$clipPositionToDocument=function(w,S){if(S=Math.max(0,S),w<0)w=0,S=0;else{var k=this.doc.getLength();w>=k?(w=k-1,S=this.doc.getLine(k-1).length):S=Math.min(this.doc.getLine(w).length,S)}return{row:w,column:S}},C.prototype.$clipRangeToDocument=function(w){w.start.row<0?(w.start.row=0,w.start.column=0):w.start.column=this.$clipColumnToRow(w.start.row,w.start.column);var S=this.doc.getLength()-1;return w.end.row>S?(w.end.row=S,w.end.column=this.doc.getLine(S).length):w.end.column=this.$clipColumnToRow(w.end.row,w.end.column),w},C.prototype.setUseWrapMode=function(w){if(w!=this.$useWrapMode){if(this.$useWrapMode=w,this.$modified=!0,this.$resetRowCache(0),w){var S=this.getLength();this.$wrapData=Array(S),this.$updateWrapData(0,S-1)}this._signal("changeWrapMode")}},C.prototype.getUseWrapMode=function(){return this.$useWrapMode},C.prototype.setWrapLimitRange=function(w,S){(this.$wrapLimitRange.min!==w||this.$wrapLimitRange.max!==S)&&(this.$wrapLimitRange={min:w,max:S},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},C.prototype.adjustWrapLimit=function(w,S){var k=this.$wrapLimitRange;k.max<0&&(k={min:S,max:S});var _=this.$constrainWrapLimit(w,k.min,k.max);return _!=this.$wrapLimit&&_>1?(this.$wrapLimit=_,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},C.prototype.$constrainWrapLimit=function(w,S,k){return S&&(w=Math.max(S,w)),k&&(w=Math.min(k,w)),w},C.prototype.getWrapLimit=function(){return this.$wrapLimit},C.prototype.setWrapLimit=function(w){this.setWrapLimitRange(w,w)},C.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},C.prototype.$updateInternalDataOnChange=function(w){var S=this.$useWrapMode,k=w.action,_=w.start,F=w.end,R=_.row,O=F.row,V=O-R,P=null;if(this.$updating=!0,V!=0)if(k==="remove"){this[S?"$wrapData":"$rowLengthCache"].splice(R,V);var H=this.$foldData;P=this.getFoldsInRange(w),this.removeFolds(P);var N=this.getFoldLine(F.row),W=0;if(N){N.addRemoveChars(F.row,F.column,_.column-F.column),N.shiftRow(-V);var z=this.getFoldLine(R);z&&z!==N&&(z.merge(N),N=z),W=H.indexOf(N)+1}for(W;W<H.length;W++){var N=H[W];N.start.row>=F.row&&N.shiftRow(-V)}O=R}else{var j=Array(V);j.unshift(R,0);var Q=S?this.$wrapData:this.$rowLengthCache;Q.splice.apply(Q,j);var H=this.$foldData,N=this.getFoldLine(R),W=0;if(N){var Z=N.range.compareInside(_.row,_.column);Z==0?(N=N.split(_.row,_.column),N&&(N.shiftRow(V),N.addRemoveChars(O,0,F.column-_.column))):Z==-1&&(N.addRemoveChars(R,0,F.column-_.column),N.shiftRow(V)),W=H.indexOf(N)+1}for(W;W<H.length;W++){var N=H[W];N.start.row>=R&&N.shiftRow(V)}}else{V=Math.abs(w.start.column-w.end.column),k==="remove"&&(P=this.getFoldsInRange(w),this.removeFolds(P),V=-V);var N=this.getFoldLine(R);N&&N.addRemoveChars(R,_.column,V)}return S&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,S?this.$updateWrapData(R,O):this.$updateRowLengthCache(R,O),P},C.prototype.$updateRowLengthCache=function(w,S){this.$rowLengthCache[w]=null,this.$rowLengthCache[S]=null},C.prototype.$updateWrapData=function(w,S){var k=this.doc.getAllLines(),_=this.getTabSize(),F=this.$wrapData,R=this.$wrapLimit,O,V,P=w;for(S=Math.min(S,k.length-1);P<=S;)V=this.getFoldLine(P,V),V?(O=[],V.walk(function(H,N,W,z){var j;if(H!=null){j=this.$getDisplayTokens(H,O.length),j[0]=D;for(var Q=1;Q<j.length;Q++)j[Q]=y}else j=this.$getDisplayTokens(k[N].substring(z,W),O.length);O=O.concat(j)}.bind(this),V.end.row,k[V.end.row].length+1),F[V.start.row]=this.$computeWrapSplits(O,R,_),P=V.end.row+1):(O=this.$getDisplayTokens(k[P]),F[P]=this.$computeWrapSplits(O,R,_),P++)},C.prototype.$computeWrapSplits=function(w,S,k){if(w.length==0)return[];var _=[],F=w.length,R=0,O=0,V=this.$wrapAsCode,P=this.$indentedSoftWrap,H=S<=Math.max(2*k,8)||P===!1?0:Math.floor(S/2);function N(){var Z=0;if(H===0)return Z;if(P)for(var q=0;q<w.length;q++){var ne=w[q];if(ne==T)Z+=1;else if(ne==M)Z+=k;else{if(ne==$)continue;break}}return V&&P!==!1&&(Z+=k),Math.min(Z,H)}function W(Z){for(var q=Z-R,ne=R;ne<Z;ne++){var se=w[ne];(se===12||se===2)&&(q-=1)}_.length||(z=N(),_.indent=z),O+=q,_.push(O),R=Z}for(var z=0;F-R>S-z;){var j=R+S-z;if(w[j-1]>=T&&w[j]>=T){W(j);continue}if(w[j]==D||w[j]==y){for(j;j!=R-1&&w[j]!=D;j--);if(j>R){W(j);continue}for(j=R+S,j;j<w.length&&w[j]==y;j++);if(j==w.length)break;W(j);continue}for(var Q=Math.max(j-(S-(S>>2)),R-1);j>Q&&w[j]<D;)j--;if(V){for(;j>Q&&w[j]<D;)j--;for(;j>Q&&w[j]==E;)j--}else for(;j>Q&&w[j]<T;)j--;if(j>Q){W(++j);continue}j=R+S,w[j]==x&&j--,W(j-z)}return _},C.prototype.$getDisplayTokens=function(w,S){var k=[],_;S=S||0;for(var F=0;F<w.length;F++){var R=w.charCodeAt(F);if(R==9){_=this.getScreenTabSize(k.length+S),k.push(M);for(var O=1;O<_;O++)k.push($)}else R==32?k.push(T):R>39&&R<48||R>57&&R<64?k.push(E):R>=4352&&L(R)?k.push(A,x):k.push(A)}return k},C.prototype.$getStringScreenWidth=function(w,S,k){if(S==0)return[0,0];S==null&&(S=1/0),k=k||0;var _,F;for(F=0;F<w.length&&(_=w.charCodeAt(F),_==9?k+=this.getScreenTabSize(k):_>=4352&&L(_)?k+=2:k+=1,!(k>S));F++);return[k,F]},C.prototype.getRowLength=function(w){var S=1;return this.lineWidgets&&(S+=this.lineWidgets[w]&&this.lineWidgets[w].rowCount||0),!this.$useWrapMode||!this.$wrapData[w]?S:this.$wrapData[w].length+S},C.prototype.getRowLineCount=function(w){return!this.$useWrapMode||!this.$wrapData[w]?1:this.$wrapData[w].length+1},C.prototype.getRowWrapIndent=function(w){if(this.$useWrapMode){var S=this.screenToDocumentPosition(w,Number.MAX_VALUE),k=this.$wrapData[S.row];return k.length&&k[0]<S.column?k.indent:0}else return 0},C.prototype.getScreenLastRowColumn=function(w){var S=this.screenToDocumentPosition(w,Number.MAX_VALUE);return this.documentToScreenColumn(S.row,S.column)},C.prototype.getDocumentLastRowColumn=function(w,S){var k=this.documentToScreenRow(w,S);return this.getScreenLastRowColumn(k)},C.prototype.getDocumentLastRowColumnPosition=function(w,S){var k=this.documentToScreenRow(w,S);return this.screenToDocumentPosition(k,Number.MAX_VALUE/10)},C.prototype.getRowSplitData=function(w){if(this.$useWrapMode)return this.$wrapData[w]},C.prototype.getScreenTabSize=function(w){return this.$tabSize-(w%this.$tabSize|0)},C.prototype.screenToDocumentRow=function(w,S){return this.screenToDocumentPosition(w,S).row},C.prototype.screenToDocumentColumn=function(w,S){return this.screenToDocumentPosition(w,S).column},C.prototype.screenToDocumentPosition=function(w,S,k){if(w<0)return{row:0,column:0};var _,F=0,R=0,O,V=0,P=0,H=this.$screenRowCache,N=this.$getRowCacheIndex(H,w),W=H.length;if(W&&N>=0)var V=H[N],F=this.$docRowCache[N],z=w>H[W-1];else var z=!W;for(var j=this.getLength()-1,Q=this.getNextFoldLine(F),Z=Q?Q.start.row:1/0;V<=w&&(P=this.getRowLength(F),!(V+P>w||F>=j));)V+=P,F++,F>Z&&(F=Q.end.row+1,Q=this.getNextFoldLine(F,Q),Z=Q?Q.start.row:1/0),z&&(this.$docRowCache.push(F),this.$screenRowCache.push(V));if(Q&&Q.start.row<=F)_=this.getFoldDisplayLine(Q),F=Q.start.row;else{if(V+P<=w||F>j)return{row:j,column:this.getLine(j).length};_=this.getLine(F),Q=null}var q=0,ne=Math.floor(w-V);if(this.$useWrapMode){var se=this.$wrapData[F];se&&(O=se[ne],ne>0&&se.length&&(q=se.indent,R=se[ne-1]||se[se.length-1],_=_.substring(R)))}return k!==void 0&&this.$bidiHandler.isBidiRow(V+ne,F,ne)&&(S=this.$bidiHandler.offsetToCol(k)),R+=this.$getStringScreenWidth(_,S-q)[1],this.$useWrapMode&&R>=O&&(R=O-1),Q?Q.idxToPosition(R):{row:F,column:R}},C.prototype.documentToScreenPosition=function(w,S){if(typeof S>"u")var k=this.$clipPositionToDocument(w.row,w.column);else k=this.$clipPositionToDocument(w,S);w=k.row,S=k.column;var _=0,F=null,R=null;R=this.getFoldAt(w,S,1),R&&(w=R.start.row,S=R.start.column);var O,V=0,P=this.$docRowCache,H=this.$getRowCacheIndex(P,w),N=P.length;if(N&&H>=0)var V=P[H],_=this.$screenRowCache[H],W=w>P[N-1];else var W=!N;for(var z=this.getNextFoldLine(V),j=z?z.start.row:1/0;V<w;){if(V>=j){if(O=z.end.row+1,O>w)break;z=this.getNextFoldLine(O,z),j=z?z.start.row:1/0}else O=V+1;_+=this.getRowLength(V),V=O,W&&(this.$docRowCache.push(V),this.$screenRowCache.push(_))}var Q="";z&&V>=j?(Q=this.getFoldDisplayLine(z,w,S),F=z.start.row):(Q=this.getLine(w).substring(0,S),F=w);var Z=0;if(this.$useWrapMode){var q=this.$wrapData[F];if(q){for(var ne=0;Q.length>=q[ne];)_++,ne++;Q=Q.substring(q[ne-1]||0,Q.length),Z=ne>0?q.indent:0}}return this.lineWidgets&&this.lineWidgets[V]&&this.lineWidgets[V].rowsAbove&&(_+=this.lineWidgets[V].rowsAbove),{row:_,column:Z+this.$getStringScreenWidth(Q)[0]}},C.prototype.documentToScreenColumn=function(w,S){return this.documentToScreenPosition(w,S).column},C.prototype.documentToScreenRow=function(w,S){return this.documentToScreenPosition(w,S).row},C.prototype.getScreenLength=function(){var w=0,S=null;if(this.$useWrapMode)for(var F=this.$wrapData.length,R=0,_=0,S=this.$foldData[_++],O=S?S.start.row:1/0;R<F;){var V=this.$wrapData[R];w+=V?V.length+1:1,R++,R>O&&(R=S.end.row+1,S=this.$foldData[_++],O=S?S.start.row:1/0)}else{w=this.getLength();for(var k=this.$foldData,_=0;_<k.length;_++)S=k[_],w-=S.end.row-S.start.row}return this.lineWidgets&&(w+=this.$getWidgetScreenLength()),w},C.prototype.$setFontMetrics=function(w){this.$enableVarChar&&(this.$getStringScreenWidth=function(S,k,_){if(k===0)return[0,0];k||(k=1/0),_=_||0;var F,R;for(R=0;R<S.length&&(F=S.charAt(R),F===" "?_+=this.getScreenTabSize(_):_+=w.getCharacterWidth(F),!(_>k));R++);return[_,R]})},C.prototype.getPrecedingCharacter=function(){var w=this.selection.getCursor();if(w.column===0)return w.row===0?"":this.doc.getNewLineCharacter();var S=this.getLine(w.row);return S[w.column-1]},C.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()},C}();b.$uid=0,b.prototype.$modes=o.$modes,b.prototype.getValue=b.prototype.toString,b.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},b.prototype.$overwrite=!1,b.prototype.$mode=null,b.prototype.$modeId=null,b.prototype.$scrollTop=0,b.prototype.$scrollLeft=0,b.prototype.$wrapLimit=80,b.prototype.$useWrapMode=!1,b.prototype.$wrapLimitRange={min:null,max:null},b.prototype.lineWidgets=null,b.prototype.isFullWidth=L,i.implement(b.prototype,h);var A=1,x=2,D=3,y=4,E=9,T=10,M=11,$=12;function L(C){return C<4352?!1:C>=4352&&C<=4447||C>=4515&&C<=4519||C>=4602&&C<=4607||C>=9001&&C<=9002||C>=11904&&C<=11929||C>=11931&&C<=12019||C>=12032&&C<=12245||C>=12272&&C<=12283||C>=12288&&C<=12350||C>=12353&&C<=12438||C>=12441&&C<=12543||C>=12549&&C<=12589||C>=12593&&C<=12686||C>=12688&&C<=12730||C>=12736&&C<=12771||C>=12784&&C<=12830||C>=12832&&C<=12871||C>=12880&&C<=13054||C>=13056&&C<=19903||C>=19968&&C<=42124||C>=42128&&C<=42182||C>=43360&&C<=43388||C>=44032&&C<=55203||C>=55216&&C<=55238||C>=55243&&C<=55291||C>=63744&&C<=64255||C>=65040&&C<=65049||C>=65072&&C<=65106||C>=65108&&C<=65126||C>=65128&&C<=65131||C>=65281&&C<=65376||C>=65504&&C<=65510}t("./edit_session/folding").Folding.call(b.prototype),t("./edit_session/bracket_match").BracketMatch.call(b.prototype),o.defineOptions(b.prototype,"session",{wrap:{set:function(C){if(!C||C=="off"?C=!1:C=="free"?C=!0:C=="printMargin"?C=-1:typeof C=="string"&&(C=parseInt(C,10)||!1),this.$wrap!=C)if(this.$wrap=C,!C)this.setUseWrapMode(!1);else{var w=typeof C=="number"?C:null;this.setWrapLimitRange(w,w),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(C){C=C=="auto"?this.$mode.type!="text":C!="text",C!=this.$wrapAsCode&&(this.$wrapAsCode=C,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(C){this.$useWorker=C,this.$stopWorker(),C&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(C){C=parseInt(C),C>0&&this.$tabSize!==C&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=C,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(C){this.setFoldStyle(C)},handlesSet:!0},overwrite:{set:function(C){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(C){this.doc.setNewLineMode(C)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(C){this.setMode(C)},get:function(){return this.$modeId},handlesSet:!0}}),n.EditSession=b}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,n,m){var i=t("./lib/lang"),a=t("./lib/oop"),p=t("./range").Range,o=function(){function l(){this.$options={}}return l.prototype.set=function(u){return a.mixin(this.$options,u),this},l.prototype.getOptions=function(){return i.copyObject(this.$options)},l.prototype.setOptions=function(u){this.$options=u},l.prototype.find=function(u){var c=this.$options,f=this.$matchIterator(u,c);if(!f)return!1;var g=null;return f.forEach(function(v,b,A,x){return g=new p(v,b,A,x),b==x&&c.start&&c.start.start&&c.skipCurrent!=!1&&g.isEqual(c.start)?(g=null,!1):!0}),g},l.prototype.findAll=function(u){var c=this.$options;if(!c.needle)return[];this.$assembleRegExp(c);var f=c.range,g=f?u.getLines(f.start.row,f.end.row):u.doc.getAllLines(),v=[],b=c.re;if(c.$isMultiLine){var A=b.length,x=g.length-A,D;e:for(var y=b.offset||0;y<=x;y++){for(var E=0;E<A;E++)if(g[y+E].search(b[E])==-1)continue e;var T=g[y],M=g[y+A-1],$=T.length-T.match(b[0])[0].length,L=M.match(b[A-1])[0].length;D&&D.end.row===y&&D.end.column>$||(v.push(D=new p(y,$,y+A-1,L)),A>2&&(y=y+A-2))}}else for(var C,w=0;w<g.length;w++)if(this.$isMultilineSearch(c)){var S=g.length-1;if(C=this.$multiLineForward(u,b,w,S),C){var k=C.endRow<=S?C.endRow-1:S;k>w&&(w=k),v.push(new p(C.startRow,C.startCol,C.endRow,C.endCol))}}else{C=i.getMatchOffsets(g[w],b);for(var E=0;E<C.length;E++){var _=C[E];v.push(new p(w,_.offset,w,_.offset+_.length))}}if(f){for(var F=f.start.column,R=f.end.column,w=0,E=v.length-1;w<E&&v[w].start.column<F&&v[w].start.row==0;)w++;for(var O=f.end.row-f.start.row;w<E&&v[E].end.column>R&&v[E].end.row==O;)E--;for(v=v.slice(w,E+1),w=0,E=v.length;w<E;w++)v[w].start.row+=f.start.row,v[w].end.row+=f.start.row}return v},l.prototype.parseReplaceString=function(u){for(var c={DollarSign:36,Ampersand:38,Digit0:48,Digit1:49,Digit9:57,Backslash:92,n:110,t:116},f="",g=0,v=u.length;g<v;g++){var b=u.charCodeAt(g);if(b===c.Backslash){if(g++,g>=v){f+="\\";break}var A=u.charCodeAt(g);switch(A){case c.Backslash:f+="\\";break;case c.n:f+=`
|
|
218
|
+
`;break;case c.t:f+=" ";break}continue}if(b===c.DollarSign){if(g++,g>=v){f+="$";break}var x=u.charCodeAt(g);if(x===c.DollarSign){f+="$$";continue}if(x===c.Digit0||x===c.Ampersand){f+="$&";continue}if(c.Digit1<=x&&x<=c.Digit9){f+="$"+u[g];continue}}f+=u[g]}return f||u},l.prototype.replace=function(u,c){var f=this.$options,g=this.$assembleRegExp(f);if(f.$isMultiLine)return c;if(g){var v=this.$isMultilineSearch(f);v&&(u=u.replace(/\r\n|\r|\n/g,`
|
|
219
|
+
`));var b=g.exec(u);if(!b||!v&&b[0].length!=u.length)return null;if(c=f.regExp?this.parseReplaceString(c):c.replace(/\$/g,"$$$$"),c=u.replace(g,c),f.preserveCase){c=c.split("");for(var A=Math.min(u.length,u.length);A--;){var x=u[A];x&&x.toLowerCase()!=x?c[A]=c[A].toUpperCase():c[A]=c[A].toLowerCase()}c=c.join("")}return c}},l.prototype.$assembleRegExp=function(u,c){if(u.needle instanceof RegExp)return u.re=u.needle;var f=u.needle;if(!u.needle)return u.re=!1;u.regExp||(f=i.escapeRegExp(f));var g=u.caseSensitive?"gm":"gmi";try{new RegExp(f,"u"),u.$supportsUnicodeFlag=!0,g+="u"}catch{u.$supportsUnicodeFlag=!1}if(u.wholeWord&&(f=h(f,u)),u.$isMultiLine=!c&&/[\n\r]/.test(f),u.$isMultiLine)return u.re=this.$assembleMultilineRegExp(f,g);try{var v=new RegExp(f,g)}catch{v=!1}return u.re=v},l.prototype.$assembleMultilineRegExp=function(u,c){for(var f=u.replace(/\r\n|\r|\n/g,`$
|
|
220
|
+
^`).split(`
|
|
221
|
+
`),g=[],v=0;v<f.length;v++)try{g.push(new RegExp(f[v],c))}catch{return!1}return g},l.prototype.$isMultilineSearch=function(u){return u.re&&/\\r\\n|\\r|\\n/.test(u.re.source)&&u.regExp&&!u.$isMultiLine},l.prototype.$multiLineForward=function(u,c,f,g){for(var v,b=s(u,f),A=f;A<=g;){for(var x=0;x<b&&!(A>g);x++){var D=u.getLine(A++);v=v==null?D:v+`
|
|
222
|
+
`+D}var y=c.exec(v);if(c.lastIndex=0,y){var E=v.slice(0,y.index).split(`
|
|
223
|
+
`),T=y[0].split(`
|
|
224
|
+
`),M=f+E.length-1,$=E[E.length-1].length,L=M+T.length-1,C=T.length==1?$+T[0].length:T[T.length-1].length;return{startRow:M,startCol:$,endRow:L,endCol:C}}}return null},l.prototype.$multiLineBackward=function(u,c,f,g,v){for(var b,A=s(u,g),x=u.getLine(g).length-f,D=g;D>=v;){for(var y=0;y<A&&D>=v;y++){var E=u.getLine(D--);b=b==null?E:E+`
|
|
225
|
+
`+b}var T=r(b,c,x);if(T){var M=b.slice(0,T.index).split(`
|
|
226
|
+
`),$=T[0].split(`
|
|
227
|
+
`),L=D+M.length,C=M[M.length-1].length,w=L+$.length-1,S=$.length==1?C+$[0].length:$[$.length-1].length;return{startRow:L,startCol:C,endRow:w,endCol:S}}}return null},l.prototype.$matchIterator=function(u,c){var f=this.$assembleRegExp(c);if(!f)return!1;var g=this.$isMultilineSearch(c),v=this.$multiLineForward,b=this.$multiLineBackward,A=c.backwards==!0,x=c.skipCurrent!=!1,D=f.unicode,y=c.range,E=c.start;E||(E=y?y[A?"end":"start"]:u.selection.getRange()),E.start&&(E=E[x!=A?"end":"start"]);var T=y?y.start.row:0,M=y?y.end.row:u.getLength()-1;if(A)var $=function(w){var S=E.row;if(!C(S,E.column,w)){for(S--;S>=T;S--)if(C(S,Number.MAX_VALUE,w))return;if(c.wrap!=!1){for(S=M,T=E.row;S>=T;S--)if(C(S,Number.MAX_VALUE,w))return}}};else var $=function(S){var k=E.row;if(!C(k,E.column,S)){for(k=k+1;k<=M;k++)if(C(k,0,S))return;if(c.wrap!=!1){for(k=T,M=E.row;k<=M;k++)if(C(k,0,S))return}}};if(c.$isMultiLine)var L=f.length,C=function(w,S,k){var _=A?w-L+1:w;if(!(_<0||_+L>u.getLength())){var F=u.getLine(_),R=F.search(f[0]);if(!(!A&&R<S||R===-1)){for(var O=1;O<L;O++)if(F=u.getLine(_+O),F.search(f[O])==-1)return;var V=F.match(f[L-1])[0].length;if(!(A&&V>S)&&k(_,R,_+L-1,V))return!0}}};else if(A)var C=function(S,k,_){if(g){var F=b(u,f,k,S,T);if(!F)return!1;if(_(F.startRow,F.startCol,F.endRow,F.endCol))return!0}else{var R=u.getLine(S),O=[],V,P=0;for(f.lastIndex=0;V=f.exec(R);){var H=V[0].length;if(P=V.index,!H){if(P>=R.length)break;f.lastIndex=P+=i.skipEmptyMatch(R,P,D)}if(V.index+H>k)break;O.push(V.index,H)}for(var N=O.length-1;N>=0;N-=2){var W=O[N-1],H=O[N];if(_(S,W,S,W+H))return!0}}};else var C=function(S,k,_){if(f.lastIndex=k,g){var F=v(u,f,S,M);if(F){var R=F.endRow<=M?F.endRow-1:M;R>S&&(S=R)}if(!F)return!1;if(_(F.startRow,F.startCol,F.endRow,F.endCol))return!0}else for(var O=u.getLine(S),V,P;P=f.exec(O);){var H=P[0].length;if(V=P.index,_(S,V,S,V+H))return!0;if(!H&&(f.lastIndex=V+=i.skipEmptyMatch(O,V,D),V>=O.length))return!1}};return{forEach:$}},l}();function h(l,u){var c=i.supportsLookbehind();function f(A,x){x===void 0&&(x=!0);var D=c&&u.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return D.test(A)||u.regExp?c&&u.$supportsUnicodeFlag?x?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var g=Array.from(l),v=g[0],b=g[g.length-1];return f(v)+l+f(b,!1)}function r(l,u,c){for(var f=null,g=0;g<=l.length;){u.lastIndex=g;var v=u.exec(l);if(!v)break;var b=v.index+v[0].length;if(b>l.length-c)break;(!f||b>f.index+f[0].length)&&(f=v),g=v.index+1}return f}function s(l,u){var c=5e3,f={row:u,column:0},g=l.doc.positionToIndex(f),v=g+c,b=l.doc.indexToPosition(v),A=b.row;return A+1}n.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,m){var i=this&&this.__extends||function(){var l=function(u,c){return l=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])},l(u,c)};return function(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");l(u,c);function f(){this.constructor=u}u.prototype=c===null?Object.create(c):(f.prototype=c.prototype,new f)}}(),a=t("../lib/keys"),p=t("../lib/useragent"),o=a.KEY_MODS,h=function(){function l(u,c){this.$init(u,c,!1)}return l.prototype.$init=function(u,c,f){this.platform=c||(p.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(u),this.$singleCommand=f},l.prototype.addCommand=function(u){this.commands[u.name]&&this.removeCommand(u),this.commands[u.name]=u,u.bindKey&&this._buildKeyHash(u)},l.prototype.removeCommand=function(u,c){var f=u&&(typeof u=="string"?u:u.name);u=this.commands[f],c||delete this.commands[f];var g=this.commandKeyBinding;for(var v in g){var b=g[v];if(b==u)delete g[v];else if(Array.isArray(b)){var A=b.indexOf(u);A!=-1&&(b.splice(A,1),b.length==1&&(g[v]=b[0]))}}},l.prototype.bindKey=function(u,c,f){if(typeof u=="object"&&u&&(f==null&&(f=u.position),u=u[this.platform]),!!u){if(typeof c=="function")return this.addCommand({exec:c,bindKey:u,name:c.name||u});u.split("|").forEach(function(g){var v="";if(g.indexOf(" ")!=-1){var b=g.split(/\s+/);g=b.pop(),b.forEach(function(D){var y=this.parseKeys(D),E=o[y.hashId]+y.key;v+=(v?" ":"")+E,this._addCommandToBinding(v,"chainKeys")},this),v+=" "}var A=this.parseKeys(g),x=o[A.hashId]+A.key;this._addCommandToBinding(v+x,c,f)},this)}},l.prototype._addCommandToBinding=function(u,c,f){var g=this.commandKeyBinding,v;if(!c)delete g[u];else if(!g[u]||this.$singleCommand)g[u]=c;else{Array.isArray(g[u])?(v=g[u].indexOf(c))!=-1&&g[u].splice(v,1):g[u]=[g[u]],typeof f!="number"&&(f=r(c));var b=g[u];for(v=0;v<b.length;v++){var A=b[v],x=r(A);if(x>f)break}b.splice(v,0,c)}},l.prototype.addCommands=function(u){u&&Object.keys(u).forEach(function(c){var f=u[c];if(f){if(typeof f=="string")return this.bindKey(f,c);typeof f=="function"&&(f={exec:f}),typeof f=="object"&&(f.name||(f.name=c),this.addCommand(f))}},this)},l.prototype.removeCommands=function(u){Object.keys(u).forEach(function(c){this.removeCommand(u[c])},this)},l.prototype.bindKeys=function(u){Object.keys(u).forEach(function(c){this.bindKey(c,u[c])},this)},l.prototype._buildKeyHash=function(u){this.bindKey(u.bindKey,u)},l.prototype.parseKeys=function(u){var c=u.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(x){return x}),f=c.pop(),g=a[f];if(a.FUNCTION_KEYS[g])f=a.FUNCTION_KEYS[g].toLowerCase();else if(c.length){if(c.length==1&&c[0]=="shift")return{key:f.toUpperCase(),hashId:-1}}else return{key:f,hashId:-1};for(var v=0,b=c.length;b--;){var A=a.KEY_MODS[c[b]];if(A==null)return typeof console<"u"&&console.error("invalid modifier "+c[b]+" in "+u),!1;v|=A}return{key:f,hashId:v}},l.prototype.findKeyCommand=function(u,c){var f=o[u]+c;return this.commandKeyBinding[f]},l.prototype.handleKeyboard=function(u,c,f,g){if(!(g<0)){var v=o[c]+f,b=this.commandKeyBinding[v];return u.$keyChain&&(u.$keyChain+=" "+v,b=this.commandKeyBinding[u.$keyChain]||b),b&&(b=="chainKeys"||b[b.length-1]=="chainKeys")?(u.$keyChain=u.$keyChain||v,{command:"null"}):(u.$keyChain&&((!c||c==4)&&f.length==1?u.$keyChain=u.$keyChain.slice(0,-v.length-1):(c==-1||g>0)&&(u.$keyChain="")),{command:b})}},l.prototype.getStatusText=function(u,c){return c.$keyChain||""},l}();function r(l){return typeof l=="object"&&l.bindKey&&l.bindKey.position||(l.isDefault?-100:0)}var s=function(l){i(u,l);function u(c,f){var g=l.call(this,c,f)||this;return g.$singleCommand=!0,g}return u}(h);s.call=function(l,u,c){h.prototype.$init.call(l,u,c,!0)},h.call=function(l,u,c){h.prototype.$init.call(l,u,c,!1)},n.HashHandler=s,n.MultiHashHandler=h}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,n,m){var i=this&&this.__extends||function(){var r=function(s,l){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(u[f]=c[f])},r(s,l)};return function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");r(s,l);function u(){this.constructor=s}s.prototype=l===null?Object.create(l):(u.prototype=l.prototype,new u)}}(),a=t("../lib/oop"),p=t("../keyboard/hash_handler").MultiHashHandler,o=t("../lib/event_emitter").EventEmitter,h=function(r){i(s,r);function s(l,u){var c=r.call(this,u,l)||this;return c.byName=c.commands,c.setDefaultHandler("exec",function(f){return f.args?f.command.exec(f.editor,f.args,f.event,!1):f.command.exec(f.editor,{},f.event,!0)}),c}return s.prototype.exec=function(l,u,c){if(Array.isArray(l)){for(var f=l.length;f--;)if(this.exec(l[f],u,c))return!0;return!1}if(typeof l=="string"&&(l=this.commands[l]),!this.canExecute(l,u))return!1;var g={editor:u,command:l,args:c};return g.returnValue=this._emit("exec",g),this._signal("afterExec",g),g.returnValue!==!1},s.prototype.canExecute=function(l,u){return typeof l=="string"&&(l=this.commands[l]),!(!l||u&&u.$readOnly&&!l.readOnly||this.$checkCommandState!=!1&&l.isAvailable&&!l.isAvailable(u))},s.prototype.toggleRecording=function(l){if(!this.$inReplay)return l&&l._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(u){this.macro.push([u.command,u.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},s.prototype.replay=function(l){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(l);try{this.$inReplay=!0,this.macro.forEach(function(u){typeof u=="string"?this.exec(u,l):this.exec(u[0],l,u[1])},this)}finally{this.$inReplay=!1}}},s.prototype.trimMacro=function(l){return l.map(function(u){return typeof u[0]!="string"&&(u[0]=u[0].name),u[1]||(u=u[0]),u})},s}(p);a.implement(h.prototype,o),n.CommandManager=h}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,n,m){var i=t("../lib/lang"),a=t("../config"),p=t("../range").Range;function o(r,s){return{win:r,mac:s}}n.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:o("Ctrl-,","Command-,"),exec:function(r){a.loadModule("ace/ext/settings_menu",function(s){s.init(r),r.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:o("Alt-E","F4"),exec:function(r){a.loadModule("ace/ext/error_marker",function(s){s.showErrorMarker(r,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(r){a.loadModule("ace/ext/error_marker",function(s){s.showErrorMarker(r,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(r){r.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(r){r.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(r,s){typeof s=="number"&&!isNaN(s)&&r.gotoLine(s),r.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(r){r.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(r){r.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:o("F2","F2"),exec:function(r){r.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:o("Alt-F2","Alt-F2"),exec:function(r){r.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(r){r.session.foldAll(),r.session.unfold(r.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(r){r.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(r){r.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(r){r.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(r){a.loadModule("ace/ext/searchbox",function(s){s.Search(r)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(r){r.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(r){r.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(r){r.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(r){r.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(r,s){r.navigateUp(s.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(r){r.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(r){r.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(r){r.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(r,s){r.navigateDown(s.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(r){r.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(r){r.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(r){r.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(r){r.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(r,s){r.navigateLeft(s.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(r){r.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(r){r.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(r){r.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(r){r.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(r,s){r.navigateRight(s.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(r){r.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(r){r.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(r){r.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(r){r.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(r){r.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(r){r.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(r){r.renderer.scrollBy(0,-2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(r){r.renderer.scrollBy(0,2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(r){r.commands.toggleRecording(r)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(r){r.commands.replay(r)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(r){r.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(r){r.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(r){r.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(r){},readOnly:!0},{name:"cut",description:"Cut",exec:function(r){var s=r.$copyWithEmptySelection&&r.selection.isEmpty(),l=s?r.selection.getLineRange():r.selection.getRange();r._emit("cut",l),l.isEmpty()||r.session.remove(l),r.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(r,s){r.$handlePaste(s)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(r){r.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(r){r.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(r){r.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(r){r.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(r){r.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(r){r.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(r){r.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(r){a.loadModule("ace/ext/searchbox",function(s){s.Search(r,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(r){r.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(r){r.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(r){r.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(r){r.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(r){r.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(r){r.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(r){r.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(r){r.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(r){if(r.selection.isEmpty())r.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(r){r.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(r){r.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(r){var s=r.selection.getRange();s.start.column=0,r.session.remove(s)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(r){var s=r.selection.getRange();s.end.column=Number.MAX_VALUE,r.session.remove(s)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(r){r.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(r){r.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(r){r.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(r){r.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(r){r.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(r){r.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(r,s){r.insert(s)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(r,s){r.insert(i.stringRepeat(s.text||"",s.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(r){r.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(r){r.transposeLetters()},multiSelectAction:function(r){r.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(r){r.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(r){r.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:o(null,null),exec:function(r){r.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(r){var s=r.selection.getRange();s.start.column=s.end.column=0,s.end.row++,r.selection.setRange(s,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:o("Ctrl+F3","F3"),exec:function(r){r.openLink()}},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(r){for(var s=r.selection.isBackwards(),l=s?r.selection.getSelectionLead():r.selection.getSelectionAnchor(),u=s?r.selection.getSelectionAnchor():r.selection.getSelectionLead(),c=r.session.doc.getLine(l.row).length,f=r.session.doc.getTextRange(r.selection.getRange()),g=f.replace(/\n\s*/," ").length,v=r.session.doc.getLine(l.row),b=l.row+1;b<=u.row+1;b++){var A=i.stringTrimLeft(i.stringTrimRight(r.session.doc.getLine(b)));A.length!==0&&(A=" "+A),v+=A}u.row+1<r.session.doc.getLength()-1&&(v+=r.session.doc.getNewLineCharacter()),r.clearSelection(),r.session.doc.replace(new p(l.row,0,u.row+2,0),v),g>0?(r.selection.moveCursorTo(l.row,l.column),r.selection.selectTo(l.row,l.column+g)):(c=r.session.doc.getLine(l.row).length>c?c+1:c,r.selection.moveCursorTo(l.row,c))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(r){var s=r.session.doc.getLength()-1,l=r.session.doc.getLine(s).length,u=r.selection.rangeList.ranges,c=[];u.length<1&&(u=[r.selection.getRange()]);for(var f=0;f<u.length;f++)f==u.length-1&&(u[f].end.row===s&&u[f].end.column===l||c.push(new p(u[f].end.row,u[f].end.column,s,l))),f===0?u[f].start.row===0&&u[f].start.column===0||c.push(new p(0,0,u[f].start.row,u[f].start.column)):c.push(new p(u[f-1].end.row,u[f-1].end.column,u[f].start.row,u[f].start.column));r.exitMultiSelectMode(),r.clearSelection();for(var f=0;f<c.length;f++)r.selection.addRange(c[f],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(r){r.selection.clearSelection(),r.navigateLineEnd(),r.insert(`
|
|
228
|
+
`)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(r){r.selection.clearSelection();var s=r.getCursorPosition();r.selection.moveTo(s.row-1,Number.MAX_VALUE),r.insert(`
|
|
229
|
+
`),s.row===0&&r.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(r){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),r.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:o("F1","F1"),exec:function(r){r.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:o(null,null),exec:function(r){r.prompt({$type:"modes"})},readOnly:!0}];for(var h=1;h<9;h++)n.commands.push({name:"foldToLevel"+h,description:"Fold To Level "+h,level:h,exec:function(r){r.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(t,n,m){var i=t("../lib/keys"),a=t("../mouse/default_gutter_handler").GutterTooltip,p=function(){function h(r){this.editor=r,this.gutterLayer=r.renderer.$gutterLayer,this.element=r.renderer.$gutter,this.lines=r.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new a(this.editor)}return h.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))},h.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))},h.prototype.$onGutterKeyDown=function(r){if(this.annotationTooltip.isOpen){r.preventDefault(),r.keyCode===i.escape&&this.annotationTooltip.hideTooltip();return}if(r.target===this.element){if(r.keyCode!=i.enter)return;r.preventDefault();var s=this.editor.getCursorPosition().row;this.editor.isRowVisible(s)||this.editor.scrollToLine(s,!0,!0),setTimeout(function(){var l=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),u=this.$findNearestFoldWidget(l),c=this.$findNearestAnnotation(l);if(!(u===null&&c===null)){if(u===null&&c!==null){this.activeRowIndex=c,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(u!==null&&c===null){this.activeRowIndex=u,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(c-l)<Math.abs(u-l)){this.activeRowIndex=c,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}else{this.activeRowIndex=u,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}}}.bind(this),10);return}this.$handleGutterKeyboardInteraction(r),setTimeout(function(){this.editor._signal("gutterkeydown",new o(r,this))}.bind(this),10)},h.prototype.$handleGutterKeyboardInteraction=function(r){if(r.keyCode===i.tab){r.preventDefault();return}if(r.keyCode===i.escape){r.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(r.keyCode===i.up){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(r.keyCode===i.down){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(r.keyCode===i.left){r.preventDefault(),this.$switchLane("annotation");return}if(r.keyCode===i.right){r.preventDefault(),this.$switchLane("fold");return}if(r.keyCode===i.enter||r.keyCode===i.space){switch(r.preventDefault(),this.activeLane){case"fold":if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="start"){var s=this.$rowIndexToRow(this.activeRowIndex);this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),r),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==s&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(s),this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var l=this.lines.cells[this.activeRowIndex].element.childNodes[2],u=l.getBoundingClientRect(),c=this.annotationTooltip.getElement().style;c.left=u.right+"px",c.top=u.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},h.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip()},h.prototype.$isFoldWidgetVisible=function(r){var s=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),l=this.$getFoldWidget(r).style.display!=="none";return s&&l},h.prototype.$isAnnotationVisible=function(r){var s=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),l=this.$getAnnotation(r).style.display!=="none";return s&&l},h.prototype.$getFoldWidget=function(r){var s=this.lines.get(r),l=s.element;return l.childNodes[1]},h.prototype.$getAnnotation=function(r){var s=this.lines.get(r),l=s.element;return l.childNodes[2]},h.prototype.$findNearestFoldWidget=function(r){if(this.$isFoldWidgetVisible(r))return r;for(var s=0;r-s>0||r+s<this.lines.getLength()-1;){if(s++,r-s>=0&&this.$isFoldWidgetVisible(r-s))return r-s;if(r+s<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(r+s))return r+s}return null},h.prototype.$findNearestAnnotation=function(r){if(this.$isAnnotationVisible(r))return r;for(var s=0;r-s>0||r+s<this.lines.getLength()-1;){if(s++,r-s>=0&&this.$isAnnotationVisible(r-s))return r-s;if(r+s<=this.lines.getLength()-1&&this.$isAnnotationVisible(r+s))return r+s}return null},h.prototype.$focusFoldWidget=function(r){if(r!=null){var s=this.$getFoldWidget(r);s.classList.add(this.editor.renderer.keyboardFocusClassName),s.focus()}},h.prototype.$focusAnnotation=function(r){if(r!=null){var s=this.$getAnnotation(r);s.classList.add(this.editor.renderer.keyboardFocusClassName),s.focus()}},h.prototype.$blurFoldWidget=function(r){var s=this.$getFoldWidget(r);s.classList.remove(this.editor.renderer.keyboardFocusClassName),s.blur()},h.prototype.$blurAnnotation=function(r){var s=this.$getAnnotation(r);s.classList.remove(this.editor.renderer.keyboardFocusClassName),s.blur()},h.prototype.$moveFoldWidgetUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},h.prototype.$moveFoldWidgetDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},h.prototype.$moveAnnotationUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},h.prototype.$moveAnnotationDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},h.prototype.$switchLane=function(r){switch(r){case"annotation":if(this.activeLane==="annotation")break;var s=this.$findNearestAnnotation(this.activeRowIndex);if(s==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=s,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var l=this.$findNearestFoldWidget(this.activeRowIndex);if(l==null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=l,this.$focusFoldWidget(this.activeRowIndex);break}},h.prototype.$rowIndexToRow=function(r){var s=this.lines.get(r);return s?s.row:null},h.prototype.$rowToRowIndex=function(r){for(var s=0;s<this.lines.getLength();s++){var l=this.lines.get(s);if(l.row==r)return s}return null},h}();n.GutterKeyboardHandler=p;var o=function(){function h(r,s){this.gutterKeyboardHandler=s,this.domEvent=r}return h.prototype.getKey=function(){return i.keyCodeToString(this.domEvent.keyCode)},h.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},h.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},h.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},h}();n.GutterKeyboardEvent=o}),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],function(t,n,m){var i=this&&this.__values||function(C){var w=typeof Symbol=="function"&&Symbol.iterator,S=w&&C[w],k=0;if(S)return S.call(C);if(C&&typeof C.length=="number")return{next:function(){return C&&k>=C.length&&(C=void 0),{value:C&&C[k++],done:!C}}};throw new TypeError(w?"Object is not iterable.":"Symbol.iterator is not defined.")},a=t("./lib/oop"),p=t("./lib/dom"),o=t("./lib/lang"),h=t("./lib/useragent"),r=t("./keyboard/textinput").TextInput,s=t("./mouse/mouse_handler").MouseHandler,l=t("./mouse/fold_handler").FoldHandler,u=t("./keyboard/keybinding").KeyBinding,c=t("./edit_session").EditSession,f=t("./search").Search,g=t("./range").Range,v=t("./lib/event_emitter").EventEmitter,b=t("./commands/command_manager").CommandManager,A=t("./commands/default_commands").commands,x=t("./config"),D=t("./token_iterator").TokenIterator,y=t("./keyboard/gutter_handler").GutterKeyboardHandler,E=t("./config").nls,T=t("./clipboard"),M=t("./lib/keys"),$=function(){function C(w,S,k){this.session,this.$toDestroy=[];var _=w.getContainerElement();this.container=_,this.renderer=w,this.id="editor"+ ++C.$uid,this.commands=new b(h.isMac?"mac":"win",A),typeof document=="object"&&(this.textInput=new r(w.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new s(this),new l(this)),this.keyBinding=new u(this),this.$search=new f().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=o.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(F,R){R._$emitInputEvent.schedule(31)}),this.setSession(S||k&&k.session||new c("")),x.resetOptions(this),k&&this.setOptions(k),x._signal("editor",this)}return C.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},C.prototype.startOperation=function(w){this.session.startOperation(w)},C.prototype.endOperation=function(w){this.session.endOperation(w)},C.prototype.onStartOperation=function(w){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,w||(this.previousCommand=null)},C.prototype.onEndOperation=function(w){if(this.curOp&&this.session){if(w&&w.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var S=this.curOp.command,k=S&&S.scrollIntoView;if(k){switch(k){case"center-animate":k="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var _=this.selection.getRange(),F=this.renderer.layerConfig;(_.start.row>=F.lastRow||_.end.row<=F.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}k=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},C.prototype.$historyTracker=function(w){if(this.$mergeUndoDeltas){var S=this.prevOp,k=this.$mergeableCommands,_=S.command&&w.command.name==S.command.name;if(w.command.name=="insertstring"){var F=w.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),_=_&&this.mergeNextCommand&&(!/\s/.test(F)||/\s/.test(S.args)),this.mergeNextCommand=!0}else _=_&&k.indexOf(w.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(_=!1),_?this.session.mergeUndoDeltas=!0:k.indexOf(w.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},C.prototype.setKeyboardHandler=function(w,S){if(w&&typeof w=="string"&&w!="ace"){this.$keybindingId=w;var k=this;x.loadModule(["keybinding",w],function(_){k.$keybindingId==w&&k.keyBinding.setKeyboardHandler(_&&_.handler),S&&S()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(w),S&&S()},C.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},C.prototype.setSession=function(w){if(this.session!=w){this.curOp&&this.endOperation(),this.curOp={};var S=this.session;if(S){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 k=this.session.getSelection();k.off("changeCursor",this.$onCursorChange),k.off("changeSelection",this.$onSelectionChange)}this.session=w,w?(this.$onDocumentChange=this.onDocumentChange.bind(this),w.on("change",this.$onDocumentChange),this.renderer.setSession(w),this.$onChangeMode=this.onChangeMode.bind(this),w.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),w.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),w.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),w.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),w.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),w.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=w.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.$onStartOperation=this.onStartOperation.bind(this),this.session.on("startOperation",this.$onStartOperation),this.$onEndOperation=this.onEndOperation.bind(this),this.session.on("endOperation",this.$onEndOperation),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(w)),this._signal("changeSession",{session:w,oldSession:S}),this.curOp=null,S&&S._signal("changeEditor",{oldEditor:this}),S&&(S.$editor=null),w&&w._signal("changeEditor",{editor:this}),w&&(w.$editor=this),w&&!w.destroyed&&w.bgTokenizer.scheduleStart()}},C.prototype.getSession=function(){return this.session},C.prototype.setValue=function(w,S){return this.session.doc.setValue(w),S?S==1?this.navigateFileEnd():S==-1&&this.navigateFileStart():this.selectAll(),w},C.prototype.getValue=function(){return this.session.getValue()},C.prototype.getSelection=function(){return this.selection},C.prototype.resize=function(w){this.renderer.onResize(w)},C.prototype.setTheme=function(w,S){this.renderer.setTheme(w,S)},C.prototype.getTheme=function(){return this.renderer.getTheme()},C.prototype.setStyle=function(w){this.renderer.setStyle(w)},C.prototype.unsetStyle=function(w){this.renderer.unsetStyle(w)},C.prototype.getFontSize=function(){return this.getOption("fontSize")||p.computedStyle(this.container).fontSize},C.prototype.setFontSize=function(w){this.setOption("fontSize",w)},C.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var w=this;this.$highlightPending=!0,setTimeout(function(){w.$highlightPending=!1;var S=w.session;if(!(!S||S.destroyed)){S.$bracketHighlight&&(S.$bracketHighlight.markerIds.forEach(function(N){S.removeMarker(N)}),S.$bracketHighlight=null);var k=w.getCursorPosition(),_=w.getKeyboardHandler(),F=_&&_.$getDirectionForHighlight&&_.$getDirectionForHighlight(w),R=S.getMatchingBracketRanges(k,F);if(!R){var O=new D(S,k.row,k.column),V=O.getCurrentToken();if(V&&/\b(?:tag-open|tag-name)/.test(V.type)){var P=S.getMatchingTags(k);P&&(R=[P.openTagName.isEmpty()?P.openTag:P.openTagName,P.closeTagName.isEmpty()?P.closeTag:P.closeTagName])}}if(!R&&S.$mode.getMatching&&(R=S.$mode.getMatching(w.session)),!R){w.getHighlightIndentGuides()&&w.renderer.$textLayer.$highlightIndentGuide();return}var H="ace_bracket";Array.isArray(R)?R.length==1&&(H="ace_error_bracket"):R=[R],R.length==2&&(g.comparePoints(R[0].end,R[1].start)==0?R=[g.fromPoints(R[0].start,R[1].end)]:g.comparePoints(R[0].start,R[1].end)==0&&(R=[g.fromPoints(R[1].start,R[0].end)])),S.$bracketHighlight={ranges:R,markerIds:R.map(function(N){return S.addMarker(N,H,"text")})},w.getHighlightIndentGuides()&&w.renderer.$textLayer.$highlightIndentGuide()}},50)}},C.prototype.focus=function(){this.textInput.focus()},C.prototype.isFocused=function(){return this.textInput.isFocused()},C.prototype.blur=function(){this.textInput.blur()},C.prototype.onFocus=function(w){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",w))},C.prototype.onBlur=function(w){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",w))},C.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},C.prototype.onDocumentChange=function(w){var S=this.session.$useWrapMode,k=w.start.row==w.end.row?w.end.row:1/0;this.renderer.updateLines(w.start.row,k,S),this._signal("change",w),this.$cursorChange()},C.prototype.onTokenizerUpdate=function(w){var S=w.data;this.renderer.updateLines(S.first,S.last)},C.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},C.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},C.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},C.prototype.$updateHighlightActiveLine=function(){var w=this.getSession(),S;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(S=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(S=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(S=!1)),w.$highlightLineMarker&&!S)w.removeMarker(w.$highlightLineMarker.id),w.$highlightLineMarker=null;else if(!w.$highlightLineMarker&&S){var k=new g(S.row,S.column,S.row,1/0);k.id=w.addMarker(k,"ace_active-line","screenLine"),w.$highlightLineMarker=k}else S&&(w.$highlightLineMarker.start.row=S.row,w.$highlightLineMarker.end.row=S.row,w.$highlightLineMarker.start.column=S.column,w._signal("changeBackMarker"))},C.prototype.onSelectionChange=function(w){var S=this.session;if(S.$selectionMarker&&S.removeMarker(S.$selectionMarker),S.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var k=this.selection.getRange(),_=this.getSelectionStyle();S.$selectionMarker=S.addMarker(k,"ace_selection",_)}var F=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(F),this._signal("changeSelection")},C.prototype.$getSelectionHighLightRegexp=function(){var w=this.session,S=this.getSelectionRange();if(!(S.isEmpty()||S.isMultiLine())){var k=S.start.column,_=S.end.column,F=w.getLine(S.start.row),R=F.substring(k,_);if(!(R.length>5e3||!/[\w\d]/.test(R))){var O=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:R}),V=F.substring(k-1,_+1);if(O.test(V))return O}}},C.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},C.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},C.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},C.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},C.prototype.onChangeMode=function(w){this.renderer.updateText(),this._emit("changeMode",w)},C.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},C.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},C.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},C.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},C.prototype.getCopyText=function(){var w=this.getSelectedText(),S=this.session.doc.getNewLineCharacter(),k=!1;if(!w&&this.$copyWithEmptySelection){k=!0;for(var _=this.selection.getAllRanges(),F=0;F<_.length;F++){var R=_[F];F&&_[F-1].start.row==R.start.row||(w+=this.session.getLine(R.start.row)+S)}}var O={text:w};return this._signal("copy",O),T.lineMode=k?O.text:!1,O.text},C.prototype.onCopy=function(){this.commands.exec("copy",this)},C.prototype.onCut=function(){this.commands.exec("cut",this)},C.prototype.onPaste=function(w,S){var k={text:w,event:S};this.commands.exec("paste",this,k)},C.prototype.$handlePaste=function(w){typeof w=="string"&&(w={text:w}),this._signal("paste",w);var S=w.text,k=S===T.lineMode,_=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)k?_.insert({row:this.selection.lead.row,column:0},S):this.insert(S);else if(k)this.selection.rangeList.ranges.forEach(function(H){_.insert({row:H.start.row,column:0},S)});else{var F=S.split(/\r\n|\r|\n/),R=this.selection.rangeList.ranges,O=F.length==2&&(!F[0]||!F[1]);if(F.length!=R.length||O)return this.commands.exec("insertstring",this,S);for(var V=R.length;V--;){var P=R[V];P.isEmpty()||_.remove(P),_.insert(P.start,F[V])}}},C.prototype.execCommand=function(w,S){return this.commands.exec(w,this,S)},C.prototype.insert=function(w,S){var k=this.session,_=k.getMode(),F=this.getCursorPosition();if(this.getBehavioursEnabled()&&!S){var R=_.transformAction(k.getState(F.row),"insertion",this,k,w);R&&(w!==R.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),w=R.text)}if(w==" "&&(w=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&w.indexOf(`
|
|
230
|
+
`)==-1){var O=g.fromPoints(F,F);O.end.column+=w.length,this.session.remove(O)}}else{var O=this.getSelectionRange();F=this.session.remove(O),this.clearSelection()}if(w==`
|
|
231
|
+
`||w==`\r
|
|
232
|
+
`){var N=k.getLine(F.row);if(F.column>N.search(/\S|$/)){var V=N.substr(F.column).search(/\S|$/);k.doc.removeInLine(F.row,F.column,F.column+V)}}this.clearSelection();var P=F.column,H=k.getState(F.row),N=k.getLine(F.row),W=_.checkOutdent(H,N,w);if(k.insert(F,w),R&&R.selection&&(R.selection.length==2?this.selection.setSelectionRange(new g(F.row,P+R.selection[0],F.row,P+R.selection[1])):this.selection.setSelectionRange(new g(F.row+R.selection[0],R.selection[1],F.row+R.selection[2],R.selection[3]))),this.$enableAutoIndent){if(k.getDocument().isNewLine(w)){var z=_.getNextLineIndent(H,N.slice(0,F.column),k.getTabString());k.insert({row:F.row+1,column:0},z)}W&&_.autoOutdent(H,k,F.row)}},C.prototype.autoIndent=function(){for(var w=this.session,S=w.getMode(),k=this.selection.isEmpty()?[new g(0,0,w.doc.getLength()-1,0)]:this.selection.getAllRanges(),_="",F="",R="",O=w.getTabString(),V=0;V<k.length;V++)for(var P=k[V].start.row,H=k[V].end.row,N=P;N<=H;N++){N>0&&(_=w.getState(N-1),F=w.getLine(N-1),R=S.getNextLineIndent(_,F,O));var W=w.getLine(N),z=S.$getIndent(W);if(R!==z){if(z.length>0){var j=new g(N,0,N,z.length);w.remove(j)}R.length>0&&w.insert({row:N,column:0},R)}S.autoOutdent(_,w,N)}},C.prototype.onTextInput=function(w,S){if(!S)return this.keyBinding.onTextInput(w);this.startOperation({command:{name:"insertstring"}});var k=this.applyComposition.bind(this,w,S);this.selection.rangeCount?this.forEachSelection(k):k(),this.endOperation()},C.prototype.applyComposition=function(w,S){if(S.extendLeft||S.extendRight){var k=this.selection.getRange();k.start.column-=S.extendLeft,k.end.column+=S.extendRight,k.start.column<0&&(k.start.row--,k.start.column+=this.session.getLine(k.start.row).length+1),this.selection.setRange(k),!w&&!k.isEmpty()&&this.remove()}if((w||!this.selection.isEmpty())&&this.insert(w,!0),S.restoreStart||S.restoreEnd){var k=this.selection.getRange();k.start.column-=S.restoreStart,k.end.column-=S.restoreEnd,this.selection.setRange(k)}},C.prototype.onCommandKey=function(w,S,k){return this.keyBinding.onCommandKey(w,S,k)},C.prototype.setOverwrite=function(w){this.session.setOverwrite(w)},C.prototype.getOverwrite=function(){return this.session.getOverwrite()},C.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},C.prototype.setScrollSpeed=function(w){this.setOption("scrollSpeed",w)},C.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},C.prototype.setDragDelay=function(w){this.setOption("dragDelay",w)},C.prototype.getDragDelay=function(){return this.getOption("dragDelay")},C.prototype.setSelectionStyle=function(w){this.setOption("selectionStyle",w)},C.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},C.prototype.setHighlightActiveLine=function(w){this.setOption("highlightActiveLine",w)},C.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},C.prototype.setHighlightGutterLine=function(w){this.setOption("highlightGutterLine",w)},C.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},C.prototype.setHighlightSelectedWord=function(w){this.setOption("highlightSelectedWord",w)},C.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},C.prototype.setAnimatedScroll=function(w){this.renderer.setAnimatedScroll(w)},C.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},C.prototype.setShowInvisibles=function(w){this.renderer.setShowInvisibles(w)},C.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},C.prototype.setDisplayIndentGuides=function(w){this.renderer.setDisplayIndentGuides(w)},C.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},C.prototype.setHighlightIndentGuides=function(w){this.renderer.setHighlightIndentGuides(w)},C.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},C.prototype.setShowPrintMargin=function(w){this.renderer.setShowPrintMargin(w)},C.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},C.prototype.setPrintMarginColumn=function(w){this.renderer.setPrintMarginColumn(w)},C.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},C.prototype.setReadOnly=function(w){this.setOption("readOnly",w)},C.prototype.getReadOnly=function(){return this.getOption("readOnly")},C.prototype.setBehavioursEnabled=function(w){this.setOption("behavioursEnabled",w)},C.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},C.prototype.setWrapBehavioursEnabled=function(w){this.setOption("wrapBehavioursEnabled",w)},C.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},C.prototype.setShowFoldWidgets=function(w){this.setOption("showFoldWidgets",w)},C.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},C.prototype.setFadeFoldWidgets=function(w){this.setOption("fadeFoldWidgets",w)},C.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},C.prototype.remove=function(w){this.selection.isEmpty()&&(w=="left"?this.selection.selectLeft():this.selection.selectRight());var S=this.getSelectionRange();if(this.getBehavioursEnabled()){var k=this.session,_=k.getState(S.start.row),F=k.getMode().transformAction(_,"deletion",this,k,S);if(S.end.column===0){var R=k.getTextRange(S);if(R[R.length-1]==`
|
|
233
|
+
`){var O=k.getLine(S.end.row);/^\s+$/.test(O)&&(S.end.column=O.length)}}F&&(S=F)}this.session.remove(S),this.clearSelection()},C.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},C.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},C.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},C.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var w=this.getSelectionRange();w.start.column==w.end.column&&w.start.row==w.end.row&&(w.end.column=0,w.end.row++),this.session.remove(w),this.clearSelection()},C.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var w=this.getCursorPosition();this.insert(`
|
|
234
|
+
`),this.moveCursorToPosition(w)},C.prototype.setGhostText=function(w,S){this.renderer.setGhostText(w,S)},C.prototype.removeGhostText=function(){this.renderer.removeGhostText()},C.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var w=this.getCursorPosition(),S=w.column;if(S!==0){var k=this.session.getLine(w.row),_,F;S<k.length?(_=k.charAt(S)+k.charAt(S-1),F=new g(w.row,S-1,w.row,S+1)):(_=k.charAt(S-1)+k.charAt(S-2),F=new g(w.row,S-2,w.row,S)),this.session.replace(F,_),this.session.selection.moveToPosition(F.end)}}},C.prototype.toLowerCase=function(){var w=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var S=this.getSelectionRange(),k=this.session.getTextRange(S);this.session.replace(S,k.toLowerCase()),this.selection.setSelectionRange(w)},C.prototype.toUpperCase=function(){var w=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var S=this.getSelectionRange(),k=this.session.getTextRange(S);this.session.replace(S,k.toUpperCase()),this.selection.setSelectionRange(w)},C.prototype.indent=function(){var w=this.session,S=this.getSelectionRange();if(S.start.row<S.end.row){var k=this.$getSelectedRows();w.indentRows(k.first,k.last," ");return}else if(S.start.column<S.end.column){var _=w.getTextRange(S);if(!/^\s+$/.test(_)){var k=this.$getSelectedRows();w.indentRows(k.first,k.last," ");return}}var F=w.getLine(S.start.row),R=S.start,O=w.getTabSize(),V=w.documentToScreenColumn(R.row,R.column);if(this.session.getUseSoftTabs())var P=O-V%O,H=o.stringRepeat(" ",P);else{for(var P=V%O;F[S.start.column-1]==" "&&P;)S.start.column--,P--;this.selection.setSelectionRange(S),H=" "}return this.insert(H)},C.prototype.blockIndent=function(){var w=this.$getSelectedRows();this.session.indentRows(w.first,w.last," ")},C.prototype.blockOutdent=function(){var w=this.session.getSelection();this.session.outdentRows(w.getRange())},C.prototype.sortLines=function(){for(var w=this.$getSelectedRows(),S=this.session,k=[],_=w.first;_<=w.last;_++)k.push(S.getLine(_));k.sort(function(O,V){return O.toLowerCase()<V.toLowerCase()?-1:O.toLowerCase()>V.toLowerCase()?1:0});for(var F=new g(0,0,0,0),_=w.first;_<=w.last;_++){var R=S.getLine(_);F.start.row=_,F.end.row=_,F.end.column=R.length,S.replace(F,k[_-w.first])}},C.prototype.toggleCommentLines=function(){var w=this.session.getState(this.getCursorPosition().row),S=this.$getSelectedRows();this.session.getMode().toggleCommentLines(w,this.session,S.first,S.last)},C.prototype.toggleBlockComment=function(){var w=this.getCursorPosition(),S=this.session.getState(w.row),k=this.getSelectionRange();this.session.getMode().toggleBlockComment(S,this.session,k,w)},C.prototype.getNumberAt=function(w,S){var k=/[\-]?[0-9]+(?:\.[0-9]+)?/g;k.lastIndex=0;for(var _=this.session.getLine(w);k.lastIndex<S;){var F=k.exec(_);if(F.index<=S&&F.index+F[0].length>=S){var R={value:F[0],start:F.index,end:F.index+F[0].length};return R}}return null},C.prototype.modifyNumber=function(w){var S=this.selection.getCursor().row,k=this.selection.getCursor().column,_=new g(S,k-1,S,k),F=this.session.getTextRange(_);if(!isNaN(parseFloat(F))&&isFinite(F)){var R=this.getNumberAt(S,k);if(R){var O=R.value.indexOf(".")>=0?R.start+R.value.indexOf(".")+1:R.end,V=R.start+R.value.length-O,P=parseFloat(R.value);P*=Math.pow(10,V),O!==R.end&&k<O?w*=Math.pow(10,R.end-k-1):w*=Math.pow(10,R.end-k),P+=w,P/=Math.pow(10,V);var H=P.toFixed(V),N=new g(S,R.start,S,R.end);this.session.replace(N,H),this.moveCursorTo(S,Math.max(R.start+1,k+H.length-R.value.length))}}else this.toggleWord()},C.prototype.toggleWord=function(){var w=this.selection.getCursor().row,S=this.selection.getCursor().column;this.selection.selectWord();var k=this.getSelectedText(),_=this.selection.getWordRange().start.column,F=k.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),R=S-_-1;R<0&&(R=0);var O=0,V=0,P=this;k.match(/[A-Za-z0-9_]+/)&&F.forEach(function(ne,se){V=O+ne.length,R>=O&&R<=V&&(k=ne,P.selection.clearSelection(),P.moveCursorTo(w,O+_),P.selection.selectTo(w,V+_)),O=V});for(var H=this.$toggleWordPairs,N,W=0;W<H.length;W++)for(var z=H[W],j=0;j<=1;j++){var Q=+!j,Z=k.match(new RegExp("^\\s?_?("+o.escapeRegExp(z[j])+")\\s?$","i"));if(Z){var q=k.match(new RegExp("([_]|^|\\s)("+o.escapeRegExp(Z[1])+")($|\\s)","g"));q&&(N=k.replace(new RegExp(o.escapeRegExp(z[j]),"i"),function(ne){var se=z[Q];return ne.toUpperCase()==ne?se=se.toUpperCase():ne.charAt(0).toUpperCase()==ne.charAt(0)&&(se=se.substr(0,0)+z[Q].charAt(0).toUpperCase()+se.substr(1)),se}),this.insert(N),N="")}}},C.prototype.findLinkAt=function(w,S){var k,_,F=this.session.getLine(w),R=F.split(/((?:https?|ftp):\/\/[\S]+)/),O=S;O<0&&(O=0);var V=0,P=0,H;try{for(var N=i(R),W=N.next();!W.done;W=N.next()){var z=W.value;if(P=V+z.length,O>=V&&O<=P&&z.match(/((?:https?|ftp):\/\/[\S]+)/)){H=z.replace(/[\s:.,'";}\]]+$/,"");break}V=P}}catch(j){k={error:j}}finally{try{W&&!W.done&&(_=N.return)&&_.call(N)}finally{if(k)throw k.error}}return H},C.prototype.openLink=function(){var w=this.selection.getCursor(),S=this.findLinkAt(w.row,w.column);return S&&window.open(S,"_blank"),S!=null},C.prototype.removeLines=function(){var w=this.$getSelectedRows();this.session.removeFullLines(w.first,w.last),this.clearSelection()},C.prototype.duplicateSelection=function(){var w=this.selection,S=this.session,k=w.getRange(),_=w.isBackwards();if(k.isEmpty()){var F=k.start.row;S.duplicateLines(F,F)}else{var R=_?k.start:k.end,O=S.insert(R,S.getTextRange(k));k.start=R,k.end=O,w.setSelectionRange(k,_)}},C.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},C.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},C.prototype.moveText=function(w,S,k){return this.session.moveText(w,S,k)},C.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},C.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},C.prototype.$moveLines=function(w,S){var k,_,F=this.selection;if(!F.inMultiSelectMode||this.inVirtualSelectionMode){var R=F.toOrientedRange();k=this.$getSelectedRows(R),_=this.session.$moveLines(k.first,k.last,S?0:w),S&&w==-1&&(_=0),R.moveBy(_,0),F.fromOrientedRange(R)}else{var O=F.rangeList.ranges;F.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var V=0,P=0,H=O.length,N=0;N<H;N++){var W=N;O[N].moveBy(V,0),k=this.$getSelectedRows(O[N]);for(var z=k.first,j=k.last;++N<H;){P&&O[N].moveBy(P,0);var Q=this.$getSelectedRows(O[N]);if(S&&Q.first!=j)break;if(!S&&Q.first>j+1)break;j=Q.last}for(N--,V=this.session.$moveLines(z,j,S?0:w),S&&w==-1&&(W=N+1);W<=N;)O[W].moveBy(V,0),W++;S||(V=0),P+=V}F.fromOrientedRange(F.ranges[0]),F.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},C.prototype.$getSelectedRows=function(w){return w=(w||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(w.start.row),last:this.session.getRowFoldEnd(w.end.row)}},C.prototype.onCompositionStart=function(w){this.renderer.showComposition(w)},C.prototype.onCompositionUpdate=function(w){this.renderer.setCompositionText(w)},C.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},C.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},C.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},C.prototype.isRowVisible=function(w){return w>=this.getFirstVisibleRow()&&w<=this.getLastVisibleRow()},C.prototype.isRowFullyVisible=function(w){return w>=this.renderer.getFirstFullyVisibleRow()&&w<=this.renderer.getLastFullyVisibleRow()},C.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},C.prototype.$moveByPage=function(w,S){var k=this.renderer,_=this.renderer.layerConfig,F=w*Math.floor(_.height/_.lineHeight);S===!0?this.selection.$moveSelection(function(){this.moveCursorBy(F,0)}):S===!1&&(this.selection.moveCursorBy(F,0),this.selection.clearSelection());var R=k.scrollTop;k.scrollBy(0,F*_.lineHeight),S!=null&&k.scrollCursorIntoView(null,.5),k.animateScrolling(R)},C.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},C.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},C.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},C.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},C.prototype.scrollPageDown=function(){this.$moveByPage(1)},C.prototype.scrollPageUp=function(){this.$moveByPage(-1)},C.prototype.scrollToRow=function(w){this.renderer.scrollToRow(w)},C.prototype.scrollToLine=function(w,S,k,_){this.renderer.scrollToLine(w,S,k,_)},C.prototype.centerSelection=function(){var w=this.getSelectionRange(),S={row:Math.floor(w.start.row+(w.end.row-w.start.row)/2),column:Math.floor(w.start.column+(w.end.column-w.start.column)/2)};this.renderer.alignCursor(S,.5)},C.prototype.getCursorPosition=function(){return this.selection.getCursor()},C.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},C.prototype.getSelectionRange=function(){return this.selection.getRange()},C.prototype.selectAll=function(){this.selection.selectAll()},C.prototype.clearSelection=function(){this.selection.clearSelection()},C.prototype.moveCursorTo=function(w,S){this.selection.moveCursorTo(w,S)},C.prototype.moveCursorToPosition=function(w){this.selection.moveCursorToPosition(w)},C.prototype.jumpToMatching=function(w,S){var k=this.getCursorPosition(),_=new D(this.session,k.row,k.column),F=_.getCurrentToken(),R=0;F&&F.type.indexOf("tag-name")!==-1&&(F=_.stepBackward());var O=F||_.stepForward();if(O){var V,P=!1,H={},N=k.column-O.start,W,z={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(O.value.match(/[{}()\[\]]/g)){for(;N<O.value.length&&!P;N++)if(z[O.value[N]])switch(W=z[O.value[N]]+"."+O.type.replace("rparen","lparen"),isNaN(H[W])&&(H[W]=0),O.value[N]){case"(":case"[":case"{":H[W]++;break;case")":case"]":case"}":H[W]--,H[W]===-1&&(V="bracket",P=!0);break}}else O.type.indexOf("tag-name")!==-1&&(isNaN(H[O.value])&&(H[O.value]=0),F.value==="<"&&R>1?H[O.value]++:F.value==="</"&&H[O.value]--,H[O.value]===-1&&(V="tag",P=!0));P||(F=O,R++,O=_.stepForward(),N=0)}while(O&&!P);if(V){var j,Q;if(V==="bracket")j=this.session.getBracketRange(k),j||(j=new g(_.getCurrentTokenRow(),_.getCurrentTokenColumn()+N-1,_.getCurrentTokenRow(),_.getCurrentTokenColumn()+N-1),Q=j.start,(S||Q.row===k.row&&Math.abs(Q.column-k.column)<2)&&(j=this.session.getBracketRange(Q)));else if(V==="tag"){if(!O||O.type.indexOf("tag-name")===-1)return;if(j=new g(_.getCurrentTokenRow(),_.getCurrentTokenColumn()-2,_.getCurrentTokenRow(),_.getCurrentTokenColumn()-2),j.compare(k.row,k.column)===0){var Z=this.session.getMatchingTags(k);Z&&(Z.openTag.contains(k.row,k.column)?(j=Z.closeTag,Q=j.start):(j=Z.openTag,Z.closeTag.start.row===k.row&&Z.closeTag.start.column===k.column?Q=j.end:Q=j.start))}Q=Q||j.start}Q=j&&j.cursor||Q,Q&&(w?j&&S?this.selection.setRange(j):j&&j.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(Q.row,Q.column):this.selection.moveTo(Q.row,Q.column))}}},C.prototype.gotoLine=function(w,S,k){this.selection.clearSelection(),this.session.unfold({row:w-1,column:S||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(w-1,S||0),this.isRowFullyVisible(w-1)||this.scrollToLine(w-1,!0,k)},C.prototype.navigateTo=function(w,S){this.selection.moveTo(w,S)},C.prototype.navigateUp=function(w){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var S=this.selection.anchor.getPosition();return this.moveCursorToPosition(S)}this.selection.clearSelection(),this.selection.moveCursorBy(-w||-1,0)},C.prototype.navigateDown=function(w){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var S=this.selection.anchor.getPosition();return this.moveCursorToPosition(S)}this.selection.clearSelection(),this.selection.moveCursorBy(w||1,0)},C.prototype.navigateLeft=function(w){if(this.selection.isEmpty())for(w=w||1;w--;)this.selection.moveCursorLeft();else{var S=this.getSelectionRange().start;this.moveCursorToPosition(S)}this.clearSelection()},C.prototype.navigateRight=function(w){if(this.selection.isEmpty())for(w=w||1;w--;)this.selection.moveCursorRight();else{var S=this.getSelectionRange().end;this.moveCursorToPosition(S)}this.clearSelection()},C.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},C.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},C.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},C.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},C.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},C.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},C.prototype.replace=function(w,S){S&&this.$search.set(S);var k=this.$search.find(this.session),_=0;return k&&(this.$tryReplace(k,w)&&(_=1),this.selection.setSelectionRange(k),this.renderer.scrollSelectionIntoView(k.start,k.end)),_},C.prototype.replaceAll=function(w,S){S&&this.$search.set(S);var k=this.$search.findAll(this.session),_=0;if(!k.length)return _;var F=this.getSelectionRange();this.selection.moveTo(0,0);for(var R=k.length-1;R>=0;--R)this.$tryReplace(k[R],w)&&_++;return this.selection.setSelectionRange(F),_},C.prototype.$tryReplace=function(w,S){var k=this.session.getTextRange(w);return S=this.$search.replace(k,S),S!==null?(w.end=this.session.replace(w,S),w):null},C.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},C.prototype.find=function(w,S,k){S||(S={}),typeof w=="string"||w instanceof RegExp?S.needle=w:typeof w=="object"&&a.mixin(S,w);var _=this.selection.getRange();S.needle==null&&(w=this.session.getTextRange(_)||this.$search.$options.needle,w||(_=this.session.getWordRange(_.start.row,_.start.column),w=this.session.getTextRange(_)),this.$search.set({needle:w})),this.$search.set(S),S.start||this.$search.set({start:_});var F=this.$search.find(this.session);if(S.preventScroll)return F;if(F)return this.revealRange(F,k),F;S.backwards?_.start=_.end:_.end=_.start,this.selection.setRange(_)},C.prototype.findNext=function(w,S){this.find({skipCurrent:!0,backwards:!1},w,S)},C.prototype.findPrevious=function(w,S){this.find(w,{skipCurrent:!0,backwards:!0},S)},C.prototype.revealRange=function(w,S){this.session.unfold(w),this.selection.setSelectionRange(w);var k=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(w.start,w.end,.5),S!==!1&&this.renderer.animateScrolling(k)},C.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},C.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},C.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(w){w.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},C.prototype.setAutoScrollEditorIntoView=function(w){if(w){var S,k=this,_=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var F=this.$scrollAnchor;F.style.cssText="position:absolute",this.container.insertBefore(F,this.container.firstChild);var R=this.on("changeSelection",function(){_=!0}),O=this.renderer.on("beforeRender",function(){_&&(S=k.renderer.container.getBoundingClientRect())}),V=this.renderer.on("afterRender",function(){if(_&&S&&(k.isFocused()||k.searchBox&&k.searchBox.isFocused())){var P=k.renderer,H=P.$cursorLayer.$pixelPos,N=P.layerConfig,W=H.top-N.offset;H.top>=0&&W+S.top<0?_=!0:H.top<N.height&&H.top+S.top+N.lineHeight>window.innerHeight?_=!1:_=null,_!=null&&(F.style.top=W+"px",F.style.left=H.left+"px",F.style.height=N.lineHeight+"px",F.scrollIntoView(_)),_=S=null}});this.setAutoScrollEditorIntoView=function(P){P||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",R),this.renderer.off("afterRender",V),this.renderer.off("beforeRender",O))}}},C.prototype.$resetCursorStyle=function(){var w=this.$cursorStyle||"ace",S=this.renderer.$cursorLayer;S&&(S.setSmoothBlinking(/smooth/.test(w)),S.isBlinking=!this.$readOnly&&w!="wide",p.setCssClass(S.element,"ace_slim-cursors",/slim/.test(w)))},C.prototype.prompt=function(w,S,k){var _=this;x.loadModule("ace/ext/prompt",function(F){F.prompt(_,w,S,k)})},C}();$.$uid=0,$.prototype.curOp=null,$.prototype.prevOp={},$.prototype.$mergeableCommands=["backspace","del","insertstring"],$.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],a.implement($.prototype,v),x.defineOptions($.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){this.textInput.setReadOnly(C),this.$resetCursorStyle()},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?L.attach(this):L.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(C){this.$showLineNumbers&&C?L.attach(this):L.detach(this)}},placeholder:{set:function(C){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var w=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(w&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),p.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!w&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),p.addCssClass(this.container,"ace_hasPlaceholder");var S=p.createElement("div");S.className="ace_placeholder",S.textContent=this.$placeholder||"",this.renderer.placeholderNode=S,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!w&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(C){var w={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(_){_.blur(),_.renderer.scroller.focus()},readOnly:!0},S=function(_){if(_.target==this.renderer.scroller&&_.keyCode===M.enter){_.preventDefault();var F=this.getCursorPosition().row;this.isRowVisible(F)||this.scrollToLine(F,!0,!0),this.focus()}},k;C?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(h.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",E("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",E("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",S.bind(this)),this.commands.addCommand(w),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",E("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",E("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),k||(k=new y(this)),k.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",S.bind(this)),this.commands.removeCommand(w),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),k&&k.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(C){this.$textInputAriaLabel=C},initialValue:""},enableMobileMenu:{set:function(C){this.$enableMobileMenu=C},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var L={getText:function(C,w){return(Math.abs(C.selection.lead.row-w)||w+1+(w<9?"·":""))+""},getWidth:function(C,w,S){return Math.max(w.toString().length,(S.lastRow+1).toString().length,2)*S.characterWidth},update:function(C,w){w.renderer.$loop.schedule(w.renderer.CHANGE_GUTTER)},attach:function(C){C.renderer.$gutterLayer.$renderer=this,C.on("changeSelection",this.update),this.update(null,C)},detach:function(C){C.renderer.$gutterLayer.$renderer==this&&(C.renderer.$gutterLayer.$renderer=null),C.off("changeSelection",this.update),this.update(null,C)}};n.Editor=$}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(t,n,m){var i=t("../lib/dom"),a=function(){function p(o,h){this.element=o,this.canvasHeight=h||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return p.prototype.moveContainer=function(o){i.translate(this.element,0,-(o.firstRowScreen*o.lineHeight%this.canvasHeight)-o.offset*this.$offsetCoefficient)},p.prototype.pageChanged=function(o,h){return Math.floor(o.firstRowScreen*o.lineHeight/this.canvasHeight)!==Math.floor(h.firstRowScreen*h.lineHeight/this.canvasHeight)},p.prototype.computeLineTop=function(o,h,r){var s=h.firstRowScreen*h.lineHeight,l=Math.floor(s/this.canvasHeight),u=r.documentToScreenRow(o,0)*h.lineHeight;return u-l*this.canvasHeight},p.prototype.computeLineHeight=function(o,h,r){return h.lineHeight*r.getRowLineCount(o)},p.prototype.getLength=function(){return this.cells.length},p.prototype.get=function(o){return this.cells[o]},p.prototype.shift=function(){this.$cacheCell(this.cells.shift())},p.prototype.pop=function(){this.$cacheCell(this.cells.pop())},p.prototype.push=function(o){if(Array.isArray(o)){this.cells.push.apply(this.cells,o);for(var h=i.createFragment(this.element),r=0;r<o.length;r++)h.appendChild(o[r].element);this.element.appendChild(h)}else this.cells.push(o),this.element.appendChild(o.element)},p.prototype.unshift=function(o){if(Array.isArray(o)){this.cells.unshift.apply(this.cells,o);for(var h=i.createFragment(this.element),r=0;r<o.length;r++)h.appendChild(o[r].element);this.element.firstChild?this.element.insertBefore(h,this.element.firstChild):this.element.appendChild(h)}else this.cells.unshift(o),this.element.insertAdjacentElement("afterbegin",o.element)},p.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},p.prototype.$cacheCell=function(o){o&&(o.element.remove(),this.cellCache.push(o))},p.prototype.createCell=function(o,h,r,s){var l=this.cellCache.pop();if(!l){var u=i.createElement("div");s&&s(u),this.element.appendChild(u),l={element:u,text:"",row:o}}return l.row=o,l},p}();n.Lines=a}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],function(t,n,m){var i=t("../lib/dom"),a=t("../lib/oop"),p=t("../lib/lang"),o=t("../lib/event_emitter").EventEmitter,h=t("./lines").Lines,r=t("../config").nls,s=function(){function u(c){this.element=i.createElement("div"),this.element.className="ace_layer ace_gutter-layer",c.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new h(this.element),this.$lines.$offsetCoefficient=1}return u.prototype.setSession=function(c){this.session&&this.session.off("change",this.$updateAnnotations),this.session=c,c&&c.on("change",this.$updateAnnotations)},u.prototype.addGutterDecoration=function(c,f){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(c,f)},u.prototype.removeGutterDecoration=function(c,f){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(c,f)},u.prototype.setAnnotations=function(c){this.$annotations=[];for(var f=0;f<c.length;f++){var g=c[f],v=g.row,b=this.$annotations[v];b||(b=this.$annotations[v]={text:[],type:[],displayText:[]});var A=g.text,x=g.text,D=g.type;A=A?p.escapeHTML(A):g.html||"",x=x||g.html||"",b.text.indexOf(A)===-1&&(b.text.push(A),b.type.push(D),b.displayText.push(x));var y=g.className;y?b.className=y:D==="error"?b.className=" ace_error":D==="security"&&!/\bace_error\b/.test(b.className)?b.className=" ace_security":D==="warning"&&!/\bace_(error|security)\b/.test(b.className)?b.className=" ace_warning":D==="info"&&!b.className?b.className=" ace_info":D==="hint"&&!b.className&&(b.className=" ace_hint")}},u.prototype.$updateAnnotations=function(c){if(this.$annotations.length){var f=c.start.row,g=c.end.row-f;if(g!==0)if(c.action=="remove")this.$annotations.splice(f,g+1,null);else{var v=new Array(g+1);v.unshift(f,1),this.$annotations.splice.apply(this.$annotations,v)}}},u.prototype.update=function(c){this.config=c;var f=this.session,g=c.firstRow,v=Math.min(c.lastRow+c.gutterOffset,f.getLength()-1);this.oldLastRow=v,this.config=c,this.$lines.moveContainer(c),this.$updateCursorRow();for(var b=f.getNextFoldLine(g),A=b?b.start.row:1/0,x=null,D=-1,y=g;;){if(y>A&&(y=b.end.row+1,b=f.getNextFoldLine(y,b),A=b?b.start.row:1/0),y>v){for(;this.$lines.getLength()>D+1;)this.$lines.pop();break}x=this.$lines.get(++D),x?x.row=y:(x=this.$lines.createCell(y,c,this.session,l),this.$lines.push(x)),this.$renderCell(x,c,b,y),y++}this._signal("afterRender"),this.$updateGutterWidth(c)},u.prototype.$updateGutterWidth=function(c){var f=this.session,g=f.gutterRenderer||this.$renderer,v=f.$firstLineNumber,b=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||f.$useWrapMode)&&(b=f.getLength()+v-1);var A=g?g.getWidth(f,b,c):b.toString().length*c.characterWidth,x=this.$padding||this.$computePadding();A+=x.left+x.right,A!==this.gutterWidth&&!isNaN(A)&&(this.gutterWidth=A,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",A))},u.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var c=this.session.selection.getCursor();this.$cursorRow!==c.row&&(this.$cursorRow=c.row)}},u.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var c=this.session.selection.cursor.row;if(this.$cursorRow=c,!(this.$cursorCell&&this.$cursorCell.row==c)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var f=this.$lines.cells;this.$cursorCell=null;for(var g=0;g<f.length;g++){var v=f[g];if(v.row>=this.$cursorRow){if(v.row>this.$cursorRow){var b=this.session.getFoldLine(this.$cursorRow);if(g>0&&b&&b.start.row==f[g-1].row)v=f[g-1];else break}v.element.className="ace_gutter-active-line "+v.element.className,this.$cursorCell=v;break}}}}},u.prototype.scrollLines=function(c){var f=this.config;if(this.config=c,this.$updateCursorRow(),this.$lines.pageChanged(f,c))return this.update(c);this.$lines.moveContainer(c);var g=Math.min(c.lastRow+c.gutterOffset,this.session.getLength()-1),v=this.oldLastRow;if(this.oldLastRow=g,!f||v<c.firstRow)return this.update(c);if(g<f.firstRow)return this.update(c);if(f.firstRow<c.firstRow)for(var b=this.session.getFoldedRowCount(f.firstRow,c.firstRow-1);b>0;b--)this.$lines.shift();if(v>g)for(var b=this.session.getFoldedRowCount(g+1,v);b>0;b--)this.$lines.pop();c.firstRow<f.firstRow&&this.$lines.unshift(this.$renderLines(c,c.firstRow,f.firstRow-1)),g>v&&this.$lines.push(this.$renderLines(c,v+1,g)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(c)},u.prototype.$renderLines=function(c,f,g){for(var v=[],b=f,A=this.session.getNextFoldLine(b),x=A?A.start.row:1/0;b>x&&(b=A.end.row+1,A=this.session.getNextFoldLine(b,A),x=A?A.start.row:1/0),!(b>g);){var D=this.$lines.createCell(b,c,this.session,l);this.$renderCell(D,c,A,b),v.push(D),b++}return v},u.prototype.$renderCell=function(c,f,g,v){var b=c.element,A=this.session,x=b.childNodes[0],D=b.childNodes[1],y=b.childNodes[2],E=y.firstChild,T=A.$firstLineNumber,M=A.$breakpoints,$=A.$decorations,L=A.gutterRenderer||this.$renderer,C=this.$showFoldWidgets&&A.foldWidgets,w=g?g.start.row:Number.MAX_VALUE,S=f.lineHeight+"px",k=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",_=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",F=(L?L.getText(A,v):v+T).toString();if(this.$highlightGutterLine&&(v==this.$cursorRow||g&&v<this.$cursorRow&&v>=w&&this.$cursorRow<=g.end.row)&&(k+="ace_gutter-active-line ",this.$cursorCell!=c&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=c)),M[v]&&(k+=M[v]),$[v]&&(k+=$[v]),this.$annotations[v]&&v!==w&&(k+=this.$annotations[v].className),C){var R=C[v];R==null&&(R=C[v]=A.getFoldWidget(v))}if(R){var O="ace_fold-widget ace_"+R,V=R=="start"&&v==w&&v<g.end.row;if(V){O+=" ace_closed";for(var P="",H=!1,N=v+1;N<=g.end.row;N++)if(this.$annotations[N]){if(this.$annotations[N].className===" ace_error"){H=!0,P=" ace_error_fold";break}this.$annotations[N].className===" ace_security"?(H=!0,P=" ace_security_fold"):this.$annotations[N].className===" ace_warning"&&P!==" ace_security_fold"&&(H=!0,P=" ace_warning_fold")}k+=P}else O+=" ace_open";D.className!=O&&(D.className=O),i.setStyle(D.style,"height",S),i.setStyle(D.style,"display","inline-block"),D.setAttribute("role","button"),D.setAttribute("tabindex","-1");var W=A.getFoldWidgetRange(v);W?D.setAttribute("aria-label",r("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[W.start.row+1,W.end.row+1])):g?D.setAttribute("aria-label",r("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[g.start.row+1,g.end.row+1])):D.setAttribute("aria-label",r("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[v+1])),V?(D.setAttribute("aria-expanded","false"),D.setAttribute("title",r("gutter.code-folding.closed.title","Unfold code"))):(D.setAttribute("aria-expanded","true"),D.setAttribute("title",r("gutter.code-folding.open.title","Fold code")))}else D&&(i.setStyle(D.style,"display","none"),D.setAttribute("tabindex","0"),D.removeAttribute("role"),D.removeAttribute("aria-label"));if(H&&this.$showFoldedAnnotations){y.className="ace_gutter_annotation",E.className=_,E.className+=P,i.setStyle(E.style,"height",S),i.setStyle(y.style,"display","block"),i.setStyle(y.style,"height",S);var z;switch(P){case" ace_error_fold":z=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[F]);break;case" ace_security_fold":z=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[F]);break;case" ace_warning_fold":z=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[F]);break}y.setAttribute("aria-label",z),y.setAttribute("tabindex","-1"),y.setAttribute("role","button")}else if(this.$annotations[v]){y.className="ace_gutter_annotation",E.className=_,this.$useSvgGutterIcons?E.className+=this.$annotations[v].className:b.classList.add(this.$annotations[v].className.replace(" ","")),i.setStyle(E.style,"height",S),i.setStyle(y.style,"display","block"),i.setStyle(y.style,"height",S);var z;switch(this.$annotations[v].className){case" ace_error":z=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[F]);break;case" ace_security":z=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[F]);break;case" ace_warning":z=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[F]);break;case" ace_info":z=r("gutter.annotation.aria-label.info","Info, read annotations row $0",[F]);break;case" ace_hint":z=r("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[F]);break}y.setAttribute("aria-label",z),y.setAttribute("tabindex","-1"),y.setAttribute("role","button")}else i.setStyle(y.style,"display","none"),y.removeAttribute("aria-label"),y.removeAttribute("role"),y.setAttribute("tabindex","0");return F!==x.data&&(x.data=F),b.className!=k&&(b.className=k),i.setStyle(c.element.style,"height",this.$lines.computeLineHeight(v,f,A)+"px"),i.setStyle(c.element.style,"top",this.$lines.computeLineTop(v,f,A)+"px"),c.text=F,y.style.display==="none"&&D.style.display==="none"?c.element.setAttribute("aria-hidden",!0):c.element.setAttribute("aria-hidden",!1),c},u.prototype.setHighlightGutterLine=function(c){this.$highlightGutterLine=c},u.prototype.setShowLineNumbers=function(c){this.$renderer=!c&&{getWidth:function(){return 0},getText:function(){return""}}},u.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},u.prototype.setShowFoldWidgets=function(c){c?i.addCssClass(this.element,"ace_folding-enabled"):i.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=c,this.$padding=null},u.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},u.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var c=i.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(c.borderLeftWidth)||0)+(parseInt(c.paddingLeft)||0)+1,this.$padding.right=(parseInt(c.borderRightWidth)||0)+(parseInt(c.paddingRight)||0),this.$padding},u.prototype.getRegion=function(c){var f=this.$padding||this.$computePadding(),g=this.element.getBoundingClientRect();if(c.x<f.left+g.left)return"markers";if(this.$showFoldWidgets&&c.x>g.right-f.right)return"foldWidgets"},u}();s.prototype.$fixedWidth=!1,s.prototype.$highlightGutterLine=!0,s.prototype.$renderer="",s.prototype.$showLineNumbers=!0,s.prototype.$showFoldWidgets=!0,a.implement(s.prototype,o);function l(u){var c=document.createTextNode("");u.appendChild(c);var f=i.createElement("span");u.appendChild(f);var g=i.createElement("span");u.appendChild(g);var v=i.createElement("span");return g.appendChild(v),u}n.Gutter=s}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,n,m){var i=t("../range").Range,a=t("../lib/dom"),p=function(){function h(r){this.element=a.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element)}return h.prototype.setPadding=function(r){this.$padding=r},h.prototype.setSession=function(r){this.session=r},h.prototype.setMarkers=function(r){this.markers=r},h.prototype.elt=function(r,s){var l=this.i!=-1&&this.element.childNodes[this.i];l?this.i++:(l=document.createElement("div"),this.element.appendChild(l),this.i=-1),l.style.cssText=s,l.className=r},h.prototype.update=function(r){if(r){this.config=r,this.i=0;var s;for(var l in this.markers){var u=this.markers[l];if(!u.range){u.update(s,this,this.session,r);continue}var c=u.range.clipRows(r.firstRow,r.lastRow);if(!c.isEmpty())if(c=c.toScreenRange(this.session),u.renderer){var f=this.$getTop(c.start.row,r),g=this.$padding+c.start.column*r.characterWidth;u.renderer(s,c,g,f,r)}else u.type=="fullLine"?this.drawFullLineMarker(s,c,u.clazz,r):u.type=="screenLine"?this.drawScreenLineMarker(s,c,u.clazz,r):c.isMultiLine()?u.type=="text"?this.drawTextMarker(s,c,u.clazz,r):this.drawMultiLineMarker(s,c,u.clazz,r):this.drawSingleLineMarker(s,c,u.clazz+" ace_start ace_br15",r)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},h.prototype.$getTop=function(r,s){return(r-s.firstRowScreen)*s.lineHeight},h.prototype.drawTextMarker=function(r,s,l,u,c){for(var f=this.session,g=s.start.row,v=s.end.row,b=g,A=0,x=0,D=f.getScreenLastRowColumn(b),y=new i(b,s.start.column,b,x);b<=v;b++)y.start.row=y.end.row=b,y.start.column=b==g?s.start.column:f.getRowWrapIndent(b),y.end.column=D,A=x,x=D,D=b+1<v?f.getScreenLastRowColumn(b+1):b==v?0:s.end.column,this.drawSingleLineMarker(r,y,l+(b==g?" ace_start":"")+" ace_br"+o(b==g||b==g+1&&s.start.column,A<x,x>D,b==v),u,b==v?0:1,c)},h.prototype.drawMultiLineMarker=function(r,s,l,u,c){var f=this.$padding,g=u.lineHeight,v=this.$getTop(s.start.row,u),b=f+s.start.column*u.characterWidth;if(c=c||"",this.session.$bidiHandler.isBidiRow(s.start.row)){var A=s.clone();A.end.row=A.start.row,A.end.column=this.session.getLine(A.start.row).length,this.drawBidiSingleLineMarker(r,A,l+" ace_br1 ace_start",u,null,c)}else this.elt(l+" ace_br1 ace_start","height:"+g+"px;right:"+f+"px;top:"+v+"px;left:"+b+"px;"+(c||""));if(this.session.$bidiHandler.isBidiRow(s.end.row)){var A=s.clone();A.start.row=A.end.row,A.start.column=0,this.drawBidiSingleLineMarker(r,A,l+" ace_br12",u,null,c)}else{v=this.$getTop(s.end.row,u);var x=s.end.column*u.characterWidth;this.elt(l+" ace_br12","height:"+g+"px;width:"+x+"px;top:"+v+"px;left:"+f+"px;"+(c||""))}if(g=(s.end.row-s.start.row-1)*u.lineHeight,!(g<=0)){v=this.$getTop(s.start.row+1,u);var D=(s.start.column?1:0)|(s.end.column?0:8);this.elt(l+(D?" ace_br"+D:""),"height:"+g+"px;right:"+f+"px;top:"+v+"px;left:"+f+"px;"+(c||""))}},h.prototype.drawSingleLineMarker=function(r,s,l,u,c,f){if(this.session.$bidiHandler.isBidiRow(s.start.row))return this.drawBidiSingleLineMarker(r,s,l,u,c,f);var g=u.lineHeight,v=(s.end.column+(c||0)-s.start.column)*u.characterWidth,b=this.$getTop(s.start.row,u),A=this.$padding+s.start.column*u.characterWidth;this.elt(l,"height:"+g+"px;width:"+v+"px;top:"+b+"px;left:"+A+"px;"+(f||""))},h.prototype.drawBidiSingleLineMarker=function(r,s,l,u,c,f){var g=u.lineHeight,v=this.$getTop(s.start.row,u),b=this.$padding,A=this.session.$bidiHandler.getSelections(s.start.column,s.end.column);A.forEach(function(x){this.elt(l,"height:"+g+"px;width:"+(x.width+(c||0))+"px;top:"+v+"px;left:"+(b+x.left)+"px;"+(f||""))},this)},h.prototype.drawFullLineMarker=function(r,s,l,u,c){var f=this.$getTop(s.start.row,u),g=u.lineHeight;s.start.row!=s.end.row&&(g+=this.$getTop(s.end.row,u)-f),this.elt(l,"height:"+g+"px;top:"+f+"px;left:0;right:0;"+(c||""))},h.prototype.drawScreenLineMarker=function(r,s,l,u,c){var f=this.$getTop(s.start.row,u),g=u.lineHeight;this.elt(l,"height:"+g+"px;top:"+f+"px;left:0;right:0;"+(c||""))},h}();p.prototype.$padding=0;function o(h,r,s,l){return(h?1:0)|(r?2:0)|(s?4:0)|(l?8:0)}n.Marker=p}),ace.define("ace/layer/text_util",["require","exports","module"],function(t,n,m){var i=new Set(["text","rparen","lparen"]);n.isTextToken=function(a){return i.has(a)}}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(t,n,m){var i=t("../lib/oop"),a=t("../lib/dom"),p=t("../lib/lang"),o=t("./lines").Lines,h=t("../lib/event_emitter").EventEmitter,r=t("../config").nls,s=t("./text_util").isTextToken,l=function(){function u(c){this.dom=a,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",c.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)}return u.prototype.$updateEolChar=function(){var c=this.session.doc,f=c.getNewLineCharacter()==`
|
|
235
|
+
`&&c.getNewLineMode()!="windows",g=f?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=g)return this.EOL_CHAR=g,!0},u.prototype.setPadding=function(c){this.$padding=c,this.element.style.margin="0 "+c+"px"},u.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},u.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},u.prototype.$setFontMetrics=function(c){this.$fontMetrics=c,this.$fontMetrics.on("changeCharacterSize",function(f){this._signal("changeCharacterSize",f)}.bind(this)),this.$pollSizeChanges()},u.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},u.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},u.prototype.setSession=function(c){this.session=c,c&&this.$computeTabString()},u.prototype.setShowInvisibles=function(c){return this.showInvisibles==c?!1:(this.showInvisibles=c,typeof c=="string"?(this.showSpaces=/tab/i.test(c),this.showTabs=/space/i.test(c),this.showEOL=/eol/i.test(c)):this.showSpaces=this.showTabs=this.showEOL=c,this.$computeTabString(),!0)},u.prototype.setDisplayIndentGuides=function(c){return this.displayIndentGuides==c?!1:(this.displayIndentGuides=c,this.$computeTabString(),!0)},u.prototype.setHighlightIndentGuides=function(c){return this.$highlightIndentGuides===c?!1:(this.$highlightIndentGuides=c,c)},u.prototype.$computeTabString=function(){var c=this.session.getTabSize();this.tabSize=c;for(var f=this.$tabStrings=[0],g=1;g<c+1;g++)if(this.showTabs){var v=this.dom.createElement("span");v.className="ace_invisible ace_invisible_tab",v.textContent=p.stringRepeat(this.TAB_CHAR,g),f.push(v)}else f.push(this.dom.createTextNode(p.stringRepeat(" ",g),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var b="ace_indent-guide",A=this.showSpaces?" ace_invisible ace_invisible_space":"",x=this.showSpaces?p.stringRepeat(this.SPACE_CHAR,this.tabSize):p.stringRepeat(" ",this.tabSize),D=this.showTabs?" ace_invisible ace_invisible_tab":"",y=this.showTabs?p.stringRepeat(this.TAB_CHAR,this.tabSize):x,v=this.dom.createElement("span");v.className=b+A,v.textContent=x,this.$tabStrings[" "]=v;var v=this.dom.createElement("span");v.className=b+D,v.textContent=y,this.$tabStrings[" "]=v}},u.prototype.updateLines=function(c,f,g){if(this.config.lastRow!=c.lastRow||this.config.firstRow!=c.firstRow)return this.update(c);this.config=c;for(var v=Math.max(f,c.firstRow),b=Math.min(g,c.lastRow),A=this.element.childNodes,x=0,y=c.firstRow;y<v;y++){var E=this.session.getFoldLine(y);if(E)if(E.containsRow(v)){v=E.start.row;break}else y=E.end.row;x++}for(var D=!1,y=v,E=this.session.getNextFoldLine(y),T=E?E.start.row:1/0;y>T&&(y=E.end.row+1,E=this.session.getNextFoldLine(y,E),T=E?E.start.row:1/0),!(y>b);){var M=A[x++];if(M){this.dom.removeChildren(M),this.$renderLine(M,y,y==T?E:!1),D&&(M.style.top=this.$lines.computeLineTop(y,c,this.session)+"px");var $=c.lineHeight*this.session.getRowLength(y)+"px";M.style.height!=$&&(D=!0,M.style.height=$)}y++}if(D)for(;x<this.$lines.cells.length;){var L=this.$lines.cells[x++];L.element.style.top=this.$lines.computeLineTop(L.row,c,this.session)+"px"}},u.prototype.scrollLines=function(c){var f=this.config;if(this.config=c,this.$lines.pageChanged(f,c))return this.update(c);this.$lines.moveContainer(c);var g=c.lastRow,v=f?f.lastRow:-1;if(!f||v<c.firstRow)return this.update(c);if(g<f.firstRow)return this.update(c);if(!f||f.lastRow<c.firstRow)return this.update(c);if(c.lastRow<f.firstRow)return this.update(c);if(f.firstRow<c.firstRow)for(var b=this.session.getFoldedRowCount(f.firstRow,c.firstRow-1);b>0;b--)this.$lines.shift();if(f.lastRow>c.lastRow)for(var b=this.session.getFoldedRowCount(c.lastRow+1,f.lastRow);b>0;b--)this.$lines.pop();c.firstRow<f.firstRow&&this.$lines.unshift(this.$renderLinesFragment(c,c.firstRow,f.firstRow-1)),c.lastRow>f.lastRow&&this.$lines.push(this.$renderLinesFragment(c,f.lastRow+1,c.lastRow)),this.$highlightIndentGuide()},u.prototype.$renderLinesFragment=function(c,f,g){for(var v=[],b=f,A=this.session.getNextFoldLine(b),x=A?A.start.row:1/0;b>x&&(b=A.end.row+1,A=this.session.getNextFoldLine(b,A),x=A?A.start.row:1/0),!(b>g);){var D=this.$lines.createCell(b,c,this.session),y=D.element;this.dom.removeChildren(y),a.setStyle(y.style,"height",this.$lines.computeLineHeight(b,c,this.session)+"px"),a.setStyle(y.style,"top",this.$lines.computeLineTop(b,c,this.session)+"px"),this.$renderLine(y,b,b==x?A:!1),this.$useLineGroups()?y.className="ace_line_group":y.className="ace_line",v.push(D),b++}return v},u.prototype.update=function(c){this.$lines.moveContainer(c),this.config=c;for(var f=c.firstRow,g=c.lastRow,v=this.$lines;v.getLength();)v.pop();v.push(this.$renderLinesFragment(c,f,g))},u.prototype.$renderToken=function(c,f,g,v){for(var b=this,A=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,x=this.dom.createFragment(this.element),D,y=0;D=A.exec(v);){var E=D[1],T=D[2],M=D[3],$=D[4],L=D[5];if(!(!b.showSpaces&&T)){var C=y!=D.index?v.slice(y,D.index):"";if(y=D.index+D[0].length,C&&x.appendChild(this.dom.createTextNode(C,this.element)),E){var w=b.session.getScreenTabSize(f+D.index);x.appendChild(b.$tabStrings[w].cloneNode(!0)),f+=w-1}else if(T)if(b.showSpaces){var S=this.dom.createElement("span");S.className="ace_invisible ace_invisible_space",S.textContent=p.stringRepeat(b.SPACE_CHAR,T.length),x.appendChild(S)}else x.appendChild(this.dom.createTextNode(T,this.element));else if(M){var S=this.dom.createElement("span");S.className="ace_invisible ace_invisible_space ace_invalid",S.textContent=p.stringRepeat(b.SPACE_CHAR,M.length),x.appendChild(S)}else if($){f+=1;var S=this.dom.createElement("span");S.style.width=b.config.characterWidth*2+"px",S.className=b.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",S.textContent=b.showSpaces?b.SPACE_CHAR:$,x.appendChild(S)}else if(L){f+=1;var S=this.dom.createElement("span");S.style.width=b.config.characterWidth*2+"px",S.className="ace_cjk",S.textContent=L,x.appendChild(S)}}}if(x.appendChild(this.dom.createTextNode(y?v.slice(y):v,this.element)),s(g.type))c.appendChild(x);else{var k="ace_"+g.type.replace(/\./g," ace_"),S=this.dom.createElement("span");g.type=="fold"&&(S.style.width=g.value.length*this.config.characterWidth+"px",S.setAttribute("title",r("inline-fold.closed.title","Unfold code"))),S.className=k,S.appendChild(x),c.appendChild(S)}return f+v.length},u.prototype.renderIndentGuide=function(c,f,g){var v=f.search(this.$indentGuideRe);if(v<=0||v>=g)return f;if(f[0]==" "){v-=v%this.tabSize;for(var b=v/this.tabSize,A=0;A<b;A++)c.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),f.substr(v)}else if(f[0]==" "){for(var A=0;A<v;A++)c.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),f.substr(v)}return this.$highlightIndentGuide(),f},u.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var c=this.session.doc.$lines;if(c){var f=this.session.selection.getCursor(),g=/^\s*/.exec(this.session.doc.getLine(f.row))[0].length,v=Math.floor(g/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:v,start:f.row};var b=this.session.$bracketHighlight;if(b){for(var A=this.session.$bracketHighlight.ranges,x=0;x<A.length;x++)if(f.row!==A[x].start.row){this.$highlightIndentGuideMarker.end=A[x].start.row+1,f.row>A[x].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&c[f.row]!==""&&f.column===c[f.row].length){this.$highlightIndentGuideMarker.dir=1;for(var x=f.row+1;x<c.length;x++){var D=c[x],y=/^\s*/.exec(D)[0].length;if(D!==""&&(this.$highlightIndentGuideMarker.end=x,y<=g))break}}this.$renderHighlightIndentGuide()}}},u.prototype.$clearActiveIndentGuide=function(){var c=this.element.querySelectorAll(".ace_indent-guide-active");c.forEach(function(f){f.classList.remove("ace_indent-guide-active")})},u.prototype.$setIndentGuideActive=function(c,f){var g=this.session.doc.getLine(c.row);if(g!==""){var v=c.element;if(c.element.classList&&c.element.classList.contains("ace_line_group"))if(c.element.childNodes.length>0)v=c.element.childNodes[0];else return;var b=v.childNodes;if(b){var A=b[f-1];A&&A.classList&&A.classList.contains("ace_indent-guide")&&A.classList.add("ace_indent-guide-active")}}},u.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var c=this.$lines.cells;this.$clearActiveIndentGuide();var f=this.$highlightIndentGuideMarker.indentLevel;if(f!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var g=0;g<c.length;g++){var v=c[g];if(this.$highlightIndentGuideMarker.end&&v.row>=this.$highlightIndentGuideMarker.start+1){if(v.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(v,f)}}else for(var g=c.length-1;g>=0;g--){var v=c[g];if(this.$highlightIndentGuideMarker.end&&v.row<this.$highlightIndentGuideMarker.start){if(v.row<this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(v,f)}}}},u.prototype.$createLineElement=function(c){var f=this.dom.createElement("div");return f.className="ace_line",f.style.height=this.config.lineHeight+"px",f},u.prototype.$renderWrappedLine=function(c,f,g){var v=0,b=0,A=g[0],x=0,D=this.$createLineElement();c.appendChild(D);for(var y=0;y<f.length;y++){var E=f[y],T=E.value;if(y==0&&this.displayIndentGuides){if(v=T.length,T=this.renderIndentGuide(D,T,A),!T)continue;v-=T.length}if(v+T.length<A)x=this.$renderToken(D,x,E,T),v+=T.length;else{for(;v+T.length>=A;)x=this.$renderToken(D,x,E,T.substring(0,A-v)),T=T.substring(A-v),v=A,D=this.$createLineElement(),c.appendChild(D),D.appendChild(this.dom.createTextNode(p.stringRepeat(" ",g.indent),this.element)),b++,x=0,A=g[b]||Number.MAX_VALUE;T.length!=0&&(v+=T.length,x=this.$renderToken(D,x,E,T))}}g[g.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(D,x,null,"",!0)},u.prototype.$renderSimpleLine=function(c,f){for(var g=0,v=0;v<f.length;v++){var b=f[v],A=b.value;if(!(v==0&&this.displayIndentGuides&&(A=this.renderIndentGuide(c,A),!A))){if(g+A.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(c,g,b,A);g=this.$renderToken(c,g,b,A)}}},u.prototype.$renderOverflowMessage=function(c,f,g,v,b){g&&this.$renderToken(c,f,g,v.slice(0,this.MAX_LINE_LENGTH-f));var A=this.dom.createElement("span");A.className="ace_inline_button ace_keyword ace_toggle_wrap",A.textContent=b?"<hide>":"<click to see more...>",c.appendChild(A)},u.prototype.$renderLine=function(c,f,g){if(!g&&g!=!1&&(g=this.session.getFoldLine(f)),g)var v=this.$getFoldLineTokens(f,g);else var v=this.session.getTokens(f);var b=c;if(v.length){var A=this.session.getRowSplitData(f);if(A&&A.length){this.$renderWrappedLine(c,v,A);var b=c.lastChild}else{var b=c;this.$useLineGroups()&&(b=this.$createLineElement(),c.appendChild(b)),this.$renderSimpleLine(b,v)}}else this.$useLineGroups()&&(b=this.$createLineElement(),c.appendChild(b));if(this.showEOL&&b){g&&(f=g.end.row);var x=this.dom.createElement("span");x.className="ace_invisible ace_invisible_eol",x.textContent=f==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,b.appendChild(x)}},u.prototype.$getFoldLineTokens=function(c,f){var g=this.session,v=[];function b(x,D,y){for(var E=0,T=0;T+x[E].value.length<D;)if(T+=x[E].value.length,E++,E==x.length)return;if(T!=D){var M=x[E].value.substring(D-T);M.length>y-D&&(M=M.substring(0,y-D)),v.push({type:x[E].type,value:M}),T=D+M.length,E+=1}for(;T<y&&E<x.length;){var M=x[E].value;M.length+T>y?v.push({type:x[E].type,value:M.substring(0,y-T)}):v.push(x[E]),T+=M.length,E+=1}}var A=g.getTokens(c);return f.walk(function(x,D,y,E,T){x!=null?v.push({type:"fold",value:x}):(T&&(A=g.getTokens(D)),A.length&&b(A,E,y))},f.end.row,this.session.getLine(f.end.row).length),v},u.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},u}();l.prototype.EOF_CHAR="¶",l.prototype.EOL_CHAR_LF="¬",l.prototype.EOL_CHAR_CRLF="¤",l.prototype.EOL_CHAR=l.prototype.EOL_CHAR_LF,l.prototype.TAB_CHAR="—",l.prototype.SPACE_CHAR="·",l.prototype.$padding=0,l.prototype.MAX_LINE_LENGTH=1e4,l.prototype.showInvisibles=!1,l.prototype.showSpaces=!1,l.prototype.showTabs=!1,l.prototype.showEOL=!1,l.prototype.displayIndentGuides=!0,l.prototype.$highlightIndentGuides=!0,l.prototype.$tabStrings=[],l.prototype.destroy={},l.prototype.onChangeTabSize=l.prototype.$computeTabString,i.implement(l.prototype,h),n.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,n,m){var i=t("../lib/dom"),a=function(){function p(o){this.element=i.createElement("div"),this.element.className="ace_layer ace_cursor-layer",o.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),i.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return p.prototype.$updateOpacity=function(o){for(var h=this.cursors,r=h.length;r--;)i.setStyle(h[r].style,"opacity",o?"":"0")},p.prototype.$startCssAnimation=function(){for(var o=this.cursors,h=o.length;h--;)o[h].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&i.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},p.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,i.removeCssClass(this.element,"ace_animate-blinking")},p.prototype.setPadding=function(o){this.$padding=o},p.prototype.setSession=function(o){this.session=o},p.prototype.setBlinking=function(o){o!=this.isBlinking&&(this.isBlinking=o,this.restartTimer())},p.prototype.setBlinkInterval=function(o){o!=this.blinkInterval&&(this.blinkInterval=o,this.restartTimer())},p.prototype.setSmoothBlinking=function(o){o!=this.smoothBlinking&&(this.smoothBlinking=o,i.setCssClass(this.element,"ace_smooth-blinking",o),this.$updateCursors(!0),this.restartTimer())},p.prototype.addCursor=function(){var o=i.createElement("div");return o.className="ace_cursor",this.element.appendChild(o),this.cursors.push(o),o},p.prototype.removeCursor=function(){if(this.cursors.length>1){var o=this.cursors.pop();return o.parentNode.removeChild(o),o}},p.prototype.hideCursor=function(){this.isVisible=!1,i.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},p.prototype.showCursor=function(){this.isVisible=!0,i.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},p.prototype.restartTimer=function(){var o=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,i.removeCssClass(this.element,"ace_smooth-blinking")),o(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&i.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),i.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var h=function(){this.timeoutId=setTimeout(function(){o(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){o(!0),h()},this.blinkInterval),h()}},p.prototype.getPixelPosition=function(o,h){if(!this.config||!this.session)return{left:0,top:0};o||(o=this.session.selection.getCursor());var r=this.session.documentToScreenPosition(o),s=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,o.row)?this.session.$bidiHandler.getPosLeft(r.column):r.column*this.config.characterWidth),l=(r.row-(h?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:s,top:l}},p.prototype.isCursorInView=function(o,h){return o.top>=0&&o.top<h.maxHeight},p.prototype.update=function(o){this.config=o;var h=this.session.$selectionMarkers,r=0,s=0;(h===void 0||h.length===0)&&(h=[{cursor:null}]);for(var r=0,l=h.length;r<l;r++){var u=this.getPixelPosition(h[r].cursor,!0);if(!((u.top>o.height+o.offset||u.top<0)&&r>1)){var c=this.cursors[s++]||this.addCursor(),f=c.style;this.drawCursor?this.drawCursor(c,u,o,h[r],this.session):this.isCursorInView(u,o)?(i.setStyle(f,"display","block"),i.translate(c,u.left,u.top),i.setStyle(f,"width",Math.round(o.characterWidth)+"px"),i.setStyle(f,"height",o.lineHeight+"px")):i.setStyle(f,"display","none")}}for(;this.cursors.length>s;)this.removeCursor();var g=this.session.getOverwrite();this.$setOverwrite(g),this.$pixelPos=u,this.restartTimer()},p.prototype.$setOverwrite=function(o){o!=this.overwrite&&(this.overwrite=o,o?i.addCssClass(this.element,"ace_overwrite-cursors"):i.removeCssClass(this.element,"ace_overwrite-cursors"))},p.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},p}();a.prototype.$padding=0,a.prototype.drawCursor=null,n.Cursor=a}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,m){var i=this&&this.__extends||function(){var c=function(f,g){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,b){v.__proto__=b}||function(v,b){for(var A in b)Object.prototype.hasOwnProperty.call(b,A)&&(v[A]=b[A])},c(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");c(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),a=t("./lib/oop"),p=t("./lib/dom"),o=t("./lib/event"),h=t("./lib/event_emitter").EventEmitter,r=32768,s=function(){function c(f,g){this.element=p.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+g,this.inner=p.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),f.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addListener(this.element,"scroll",this.onScroll.bind(this)),o.addListener(this.element,"mousedown",o.preventDefault)}return c.prototype.setVisible=function(f){this.element.style.display=f?"":"none",this.isVisible=f,this.coeff=1},c}();a.implement(s.prototype,h);var l=function(c){i(f,c);function f(g,v){var b=c.call(this,g,"-v")||this;return b.scrollTop=0,b.scrollHeight=0,v.$scrollbarWidth=b.width=p.scrollbarWidth(g.ownerDocument),b.inner.style.width=b.element.style.width=(b.width||15)+5+"px",b.$minWidth=0,b}return f.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var g=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-g)/(this.coeff-g)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},f.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},f.prototype.setHeight=function(g){this.element.style.height=g+"px"},f.prototype.setScrollHeight=function(g){this.scrollHeight=g,g>r?(this.coeff=r/g,g=r):this.coeff!=1&&(this.coeff=1),this.inner.style.height=g+"px"},f.prototype.setScrollTop=function(g){this.scrollTop!=g&&(this.skipEvent=!0,this.scrollTop=g,this.element.scrollTop=g*this.coeff)},f}(s);l.prototype.setInnerHeight=l.prototype.setScrollHeight;var u=function(c){i(f,c);function f(g,v){var b=c.call(this,g,"-h")||this;return b.scrollLeft=0,b.height=v.$scrollbarWidth,b.inner.style.height=b.element.style.height=(b.height||15)+5+"px",b}return f.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},f.prototype.getHeight=function(){return this.isVisible?this.height:0},f.prototype.setWidth=function(g){this.element.style.width=g+"px"},f.prototype.setInnerWidth=function(g){this.inner.style.width=g+"px"},f.prototype.setScrollWidth=function(g){this.inner.style.width=g+"px"},f.prototype.setScrollLeft=function(g){this.scrollLeft!=g&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=g)},f}(s);n.ScrollBar=l,n.ScrollBarV=l,n.ScrollBarH=u,n.VScrollBar=l,n.HScrollBar=u}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,m){var i=this&&this.__extends||function(){var u=function(c,f){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,v){g.__proto__=v}||function(g,v){for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(g[b]=v[b])},u(c,f)};return function(c,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");u(c,f);function g(){this.constructor=c}c.prototype=f===null?Object.create(f):(g.prototype=f.prototype,new g)}}(),a=t("./lib/oop"),p=t("./lib/dom"),o=t("./lib/event"),h=t("./lib/event_emitter").EventEmitter;p.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
|
|
236
|
+
position: absolute;
|
|
237
|
+
background: rgba(128, 128, 128, 0.6);
|
|
238
|
+
-moz-box-sizing: border-box;
|
|
239
|
+
box-sizing: border-box;
|
|
240
|
+
border: 1px solid #bbb;
|
|
241
|
+
border-radius: 2px;
|
|
242
|
+
z-index: 8;
|
|
243
|
+
}
|
|
244
|
+
.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {
|
|
245
|
+
position: absolute;
|
|
246
|
+
z-index: 6;
|
|
247
|
+
background: none;
|
|
248
|
+
overflow: hidden!important;
|
|
249
|
+
}
|
|
250
|
+
.ace_editor>.ace_sb-v {
|
|
251
|
+
z-index: 6;
|
|
252
|
+
right: 0;
|
|
253
|
+
top: 0;
|
|
254
|
+
width: 12px;
|
|
255
|
+
}
|
|
256
|
+
.ace_editor>.ace_sb-v div {
|
|
257
|
+
z-index: 8;
|
|
258
|
+
right: 0;
|
|
259
|
+
width: 100%;
|
|
260
|
+
}
|
|
261
|
+
.ace_editor>.ace_sb-h {
|
|
262
|
+
bottom: 0;
|
|
263
|
+
left: 0;
|
|
264
|
+
height: 12px;
|
|
265
|
+
}
|
|
266
|
+
.ace_editor>.ace_sb-h div {
|
|
267
|
+
bottom: 0;
|
|
268
|
+
height: 100%;
|
|
269
|
+
}
|
|
270
|
+
.ace_editor>.ace_sb_grabbed {
|
|
271
|
+
z-index: 8;
|
|
272
|
+
background: #000;
|
|
273
|
+
}`,"ace_scrollbar.css",!1);var r=function(){function u(c,f){this.element=p.createElement("div"),this.element.className="ace_sb"+f,this.inner=p.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,c.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return u.prototype.setVisible=function(c){this.element.style.display=c?"":"none",this.isVisible=c,this.coeff=1},u}();a.implement(r.prototype,h);var s=function(u){i(c,u);function c(f,g){var v=u.call(this,f,"-v")||this;return v.scrollTop=0,v.scrollHeight=0,v.parent=f,v.width=v.VScrollWidth,v.renderer=g,v.inner.style.width=v.element.style.width=(v.width||15)+"px",v.$minWidth=0,v}return c.prototype.onMouseDown=function(f,g){if(f==="mousedown"&&!(o.getButton(g)!==0||g.detail===2)){if(g.target===this.inner){var v=this,b=g.clientY,A=function($){b=$.clientY},x=function(){clearInterval(T)},D=g.clientY,y=this.thumbTop,E=function(){if(b!==void 0){var $=v.scrollTopFromThumbTop(y+b-D);$!==v.scrollTop&&v._emit("scroll",{data:$})}};o.capture(this.inner,A,x);var T=setInterval(E,20);return o.preventDefault(g)}var M=g.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(M)}),o.preventDefault(g)}},c.prototype.getHeight=function(){return this.height},c.prototype.scrollTopFromThumbTop=function(f){var g=f*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return g=g>>0,g<0?g=0:g>this.pageHeight-this.viewHeight&&(g=this.pageHeight-this.viewHeight),g},c.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},c.prototype.setHeight=function(f){this.height=Math.max(0,f),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},c.prototype.setScrollHeight=function(f,g){this.pageHeight===f&&!g||(this.pageHeight=f,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},c.prototype.setScrollTop=function(f){this.scrollTop=f,f<0&&(f=0),this.thumbTop=f*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},c}(r);s.prototype.setInnerHeight=s.prototype.setScrollHeight;var l=function(u){i(c,u);function c(f,g){var v=u.call(this,f,"-h")||this;return v.scrollLeft=0,v.scrollWidth=0,v.height=v.HScrollHeight,v.inner.style.height=v.element.style.height=(v.height||12)+"px",v.renderer=g,v}return c.prototype.onMouseDown=function(f,g){if(f==="mousedown"&&!(o.getButton(g)!==0||g.detail===2)){if(g.target===this.inner){var v=this,b=g.clientX,A=function($){b=$.clientX},x=function(){clearInterval(T)},D=g.clientX,y=this.thumbLeft,E=function(){if(b!==void 0){var $=v.scrollLeftFromThumbLeft(y+b-D);$!==v.scrollLeft&&v._emit("scroll",{data:$})}};o.capture(this.inner,A,x);var T=setInterval(E,20);return o.preventDefault(g)}var M=g.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(M)}),o.preventDefault(g)}},c.prototype.getHeight=function(){return this.isVisible?this.height:0},c.prototype.scrollLeftFromThumbLeft=function(f){var g=f*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return g=g>>0,g<0?g=0:g>this.pageWidth-this.viewWidth&&(g=this.pageWidth-this.viewWidth),g},c.prototype.setWidth=function(f){this.width=Math.max(0,f),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},c.prototype.setScrollWidth=function(f,g){this.pageWidth===f&&!g||(this.pageWidth=f,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},c.prototype.setScrollLeft=function(f){this.scrollLeft=f,f<0&&(f=0),this.thumbLeft=f*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},c}(r);l.prototype.setInnerWidth=l.prototype.setScrollWidth,n.ScrollBar=s,n.ScrollBarV=s,n.ScrollBarH=l,n.VScrollBar=s,n.HScrollBar=l}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,n,m){var i=t("./lib/event"),a=function(){function p(o,h){this.onRender=o,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=h||window;var r=this;this._flush=function(s){r.pending=!1;var l=r.changes;if(l&&(i.blockIdle(100),r.changes=0,r.onRender(l)),r.changes){if(r.$recursionLimit--<0)return;r.schedule()}else r.$recursionLimit=2}}return p.prototype.schedule=function(o){this.changes=this.changes|o,this.changes&&!this.pending&&(i.nextFrame(this._flush),this.pending=!0)},p.prototype.clear=function(o){var h=this.changes;return this.changes=0,h},p}();n.RenderLoop=a}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(t,n,m){var i=t("../lib/oop"),a=t("../lib/dom"),p=t("../lib/lang"),o=t("../lib/event"),h=t("../lib/useragent"),r=t("../lib/event_emitter").EventEmitter,s=512,l=typeof ResizeObserver=="function",u=200,c=function(){function f(g){this.el=a.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=a.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=a.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),g.appendChild(this.el),this.$measureNode.textContent=p.stringRepeat("X",s),this.$characterSize={width:0,height:0},l?this.$addObserver():this.checkForSizeChanges()}return f.prototype.$setMeasureNodeStyles=function(g,v){g.width=g.height="auto",g.left=g.top="0px",g.visibility="hidden",g.position="absolute",g.whiteSpace="pre",h.isIE<8?g["font-family"]="inherit":g.font="inherit",g.overflow=v?"hidden":"visible"},f.prototype.checkForSizeChanges=function(g){if(g===void 0&&(g=this.$measureSizes()),g&&(this.$characterSize.width!==g.width||this.$characterSize.height!==g.height)){this.$measureNode.style.fontWeight="bold";var v=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=g,this.charSizes=Object.create(null),this.allowBoldFonts=v&&v.width===g.width&&v.height===g.height,this._emit("changeCharacterSize",{data:g})}},f.prototype.$addObserver=function(){var g=this;this.$observer=new window.ResizeObserver(function(v){g.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},f.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var g=this;return this.$pollSizeChangesTimer=o.onIdle(function v(){g.checkForSizeChanges(),o.onIdle(v,500)},500)},f.prototype.setPolling=function(g){g?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},f.prototype.$measureSizes=function(g){var v={height:(g||this.$measureNode).clientHeight,width:(g||this.$measureNode).clientWidth/s};return v.width===0||v.height===0?null:v},f.prototype.$measureCharWidth=function(g){this.$main.textContent=p.stringRepeat(g,s);var v=this.$main.getBoundingClientRect();return v.width/s},f.prototype.getCharacterWidth=function(g){var v=this.charSizes[g];return v===void 0&&(v=this.charSizes[g]=this.$measureCharWidth(g)/this.$characterSize.width),v},f.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},f.prototype.$getZoom=function(g){return!g||!g.parentElement?1:(Number(window.getComputedStyle(g).zoom)||1)*this.$getZoom(g.parentElement)},f.prototype.$initTransformMeasureNodes=function(){var g=function(v,b){return["div",{style:"position: absolute;top:"+v+"px;left:"+b+"px;"}]};this.els=a.buildDom([g(0,0),g(u,0),g(0,u),g(u,u)],this.el)},f.prototype.transformCoordinates=function(g,v){if(g){var b=this.$getZoom(this.el);g=y(1/b,g)}function A(V,P,H){var N=V[1]*P[0]-V[0]*P[1];return[(-P[1]*H[0]+P[0]*H[1])/N,(+V[1]*H[0]-V[0]*H[1])/N]}function x(V,P){return[V[0]-P[0],V[1]-P[1]]}function D(V,P){return[V[0]+P[0],V[1]+P[1]]}function y(V,P){return[V*P[0],V*P[1]]}this.els||this.$initTransformMeasureNodes();function E(V){var P=V.getBoundingClientRect();return[P.left,P.top]}var T=E(this.els[0]),M=E(this.els[1]),$=E(this.els[2]),L=E(this.els[3]),C=A(x(L,M),x(L,$),x(D(M,$),D(L,T))),w=y(1+C[0],x(M,T)),S=y(1+C[1],x($,T));if(v){var k=v,_=C[0]*k[0]/u+C[1]*k[1]/u+1,F=D(y(k[0],w),y(k[1],S));return D(y(1/_/u,F),T)}var R=x(g,T),O=A(x(w,y(C[0],R)),x(S,y(C[1],R)),R);return y(u,O)},f}();c.prototype.$characterSize={width:0,height:0},i.implement(c.prototype,r),n.FontMetrics=c}),ace.define("ace/css/editor-css",["require","exports","module"],function(t,n,m){m.exports=`
|
|
274
|
+
.ace_br1 {border-top-left-radius : 3px;}
|
|
275
|
+
.ace_br2 {border-top-right-radius : 3px;}
|
|
276
|
+
.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
|
|
277
|
+
.ace_br4 {border-bottom-right-radius: 3px;}
|
|
278
|
+
.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}
|
|
279
|
+
.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}
|
|
280
|
+
.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}
|
|
281
|
+
.ace_br8 {border-bottom-left-radius : 3px;}
|
|
282
|
+
.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}
|
|
283
|
+
.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}
|
|
284
|
+
.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}
|
|
285
|
+
.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
|
286
|
+
.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
|
287
|
+
.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
|
288
|
+
.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
.ace_editor {
|
|
292
|
+
position: relative;
|
|
293
|
+
overflow: hidden;
|
|
294
|
+
padding: 0;
|
|
295
|
+
font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;
|
|
296
|
+
direction: ltr;
|
|
297
|
+
text-align: left;
|
|
298
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
299
|
+
forced-color-adjust: none;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.ace_scroller {
|
|
303
|
+
position: absolute;
|
|
304
|
+
overflow: hidden;
|
|
305
|
+
top: 0;
|
|
306
|
+
bottom: 0;
|
|
307
|
+
background-color: inherit;
|
|
308
|
+
-ms-user-select: none;
|
|
309
|
+
-moz-user-select: none;
|
|
310
|
+
-webkit-user-select: none;
|
|
311
|
+
user-select: none;
|
|
312
|
+
cursor: text;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.ace_content {
|
|
316
|
+
position: absolute;
|
|
317
|
+
box-sizing: border-box;
|
|
318
|
+
min-width: 100%;
|
|
319
|
+
contain: style size layout;
|
|
320
|
+
font-variant-ligatures: no-common-ligatures;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.ace_keyboard-focus:focus {
|
|
324
|
+
box-shadow: inset 0 0 0 2px #5E9ED6;
|
|
325
|
+
outline: none;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.ace_dragging .ace_scroller:before{
|
|
329
|
+
position: absolute;
|
|
330
|
+
top: 0;
|
|
331
|
+
left: 0;
|
|
332
|
+
right: 0;
|
|
333
|
+
bottom: 0;
|
|
334
|
+
content: '';
|
|
335
|
+
background: rgba(250, 250, 250, 0.01);
|
|
336
|
+
z-index: 1000;
|
|
337
|
+
}
|
|
338
|
+
.ace_dragging.ace_dark .ace_scroller:before{
|
|
339
|
+
background: rgba(0, 0, 0, 0.01);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.ace_gutter {
|
|
343
|
+
position: absolute;
|
|
344
|
+
overflow : hidden;
|
|
345
|
+
width: auto;
|
|
346
|
+
top: 0;
|
|
347
|
+
bottom: 0;
|
|
348
|
+
left: 0;
|
|
349
|
+
cursor: default;
|
|
350
|
+
z-index: 4;
|
|
351
|
+
-ms-user-select: none;
|
|
352
|
+
-moz-user-select: none;
|
|
353
|
+
-webkit-user-select: none;
|
|
354
|
+
user-select: none;
|
|
355
|
+
contain: style size layout;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.ace_gutter-active-line {
|
|
359
|
+
position: absolute;
|
|
360
|
+
left: 0;
|
|
361
|
+
right: 0;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.ace_scroller.ace_scroll-left:after {
|
|
365
|
+
content: "";
|
|
366
|
+
position: absolute;
|
|
367
|
+
top: 0;
|
|
368
|
+
right: 0;
|
|
369
|
+
bottom: 0;
|
|
370
|
+
left: 0;
|
|
371
|
+
box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
|
|
372
|
+
pointer-events: none;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.ace_gutter-cell, .ace_gutter-cell_svg-icons {
|
|
376
|
+
position: absolute;
|
|
377
|
+
top: 0;
|
|
378
|
+
left: 0;
|
|
379
|
+
right: 0;
|
|
380
|
+
padding-left: 19px;
|
|
381
|
+
padding-right: 6px;
|
|
382
|
+
background-repeat: no-repeat;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.ace_gutter-cell_svg-icons .ace_gutter_annotation {
|
|
386
|
+
margin-left: -14px;
|
|
387
|
+
float: left;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.ace_gutter-cell .ace_gutter_annotation {
|
|
391
|
+
margin-left: -19px;
|
|
392
|
+
float: left;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.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 {
|
|
396
|
+
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==");
|
|
397
|
+
background-repeat: no-repeat;
|
|
398
|
+
background-position: 2px center;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {
|
|
402
|
+
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==");
|
|
403
|
+
background-repeat: no-repeat;
|
|
404
|
+
background-position: 2px center;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.ace_gutter-cell.ace_info, .ace_icon.ace_info, .ace_gutter-cell.ace_hint, .ace_icon.ace_hint {
|
|
408
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");
|
|
409
|
+
background-repeat: no-repeat;
|
|
410
|
+
background-position: 2px center;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.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 {
|
|
414
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.ace_icon_svg.ace_error {
|
|
418
|
+
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");
|
|
419
|
+
background-color: crimson;
|
|
420
|
+
}
|
|
421
|
+
.ace_icon_svg.ace_security {
|
|
422
|
+
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iZGFya29yYW5nZSIgZmlsbD0ibm9uZSIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogICAgICAgIDxwYXRoIGNsYXNzPSJzdHJva2UtbGluZWpvaW4tcm91bmQiIGQ9Ik04IDE0LjgzMDdDOCAxNC44MzA3IDIgMTIuOTA0NyAyIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOEM3Ljk4OTk5IDEuMzQ5MTggMTAuNjkgMy4yNjU0OCAxNCAzLjI2NTQ4VjguMDg5OTJDMTQgMTIuOTA0NyA4IDE0LjgzMDcgOCAxNC44MzA3WiIvPgogICAgICAgIDxwYXRoIGQ9Ik0yIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOCIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMy45OSA4LjA4OTkyVjMuMjY1NDhDMTAuNjggMy4yNjU0OCA4IDEuMzQ5MTggOCAxLjM0OTE4Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggNFY5Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggMTBWMTIiLz4KICAgIDwvZz4KPC9zdmc+");
|
|
423
|
+
background-color: crimson;
|
|
424
|
+
}
|
|
425
|
+
.ace_icon_svg.ace_warning {
|
|
426
|
+
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");
|
|
427
|
+
background-color: darkorange;
|
|
428
|
+
}
|
|
429
|
+
.ace_icon_svg.ace_info {
|
|
430
|
+
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");
|
|
431
|
+
background-color: royalblue;
|
|
432
|
+
}
|
|
433
|
+
.ace_icon_svg.ace_hint {
|
|
434
|
+
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0ic2lsdmVyIiBmaWxsPSJub25lIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTYgMTRIMTAiLz4KICAgICAgICA8cGF0aCBkPSJNOCAxMUg5QzkgOS40NzAwMiAxMiA4LjU0MDAyIDEyIDUuNzYwMDJDMTIuMDIgNC40MDAwMiAxMS4zOSAzLjM2MDAyIDEwLjQzIDIuNjcwMDJDOSAxLjY0MDAyIDcuMDAwMDEgMS42NDAwMiA1LjU3MDAxIDIuNjcwMDJDNC42MTAwMSAzLjM2MDAyIDMuOTggNC40MDAwMiA0IDUuNzYwMDJDNCA4LjU0MDAyIDcuMDAwMDEgOS40NzAwMiA3LjAwMDAxIDExSDhaIi8+CiAgICA8L2c+Cjwvc3ZnPg==");
|
|
435
|
+
background-color: silver;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.ace_icon_svg.ace_error_fold {
|
|
439
|
+
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
|
|
440
|
+
background-color: crimson;
|
|
441
|
+
}
|
|
442
|
+
.ace_icon_svg.ace_security_fold {
|
|
443
|
+
-webkit-mask-image: url("data:image/svg+xml;base64,CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTcgMTQiIGZpbGw9Im5vbmUiPgogICAgPHBhdGggZD0iTTEwLjAwMDEgMTMuNjk5MkMxMC4wMDAxIDEzLjY5OTIgMTEuOTI0MSAxMy40NzYzIDEzIDEyLjY5OTJDMTQuNDEzOSAxMS42NzgxIDE2IDEwLjUgMTYuMTI1MSA2LjgxMTI2VjIuNTg5ODdDMTYuMTI1MSAyLjU0NzY4IDE2LjEyMjEgMi41MDYxOSAxNi4xMTY0IDIuNDY1NTlWMS43MTQ4NUgxNS4yNDE0TDE1LjIzMDcgMS43MTQ4NEwxNC42MjUxIDEuNjk5MjJWNi44MTEyM0MxNC42MjUxIDguNTEwNjEgMTQuNjI1MSA5LjQ2NDYxIDEyLjc4MjQgMTEuNzIxQzEyLjE1ODYgMTIuNDg0OCAxMC4wMDAxIDEzLjY5OTIgMTAuMDAwMSAxMy42OTkyWiIgZmlsbD0iY3JpbXNvbiIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuMzM2MDkgMC4zNjc0NzVDNy4wMzIxNCAwLjE1MjY1MiA2LjYyNTQ4IDAuMTUzNjE0IDYuMzIyNTMgMC4zNjk5OTdMNi4zMDg2OSAwLjM3OTU1NEM2LjI5NTUzIDAuMzg4NTg4IDYuMjczODggMC40MDMyNjYgNi4yNDQxNyAwLjQyMjc4OUM2LjE4NDcxIDAuNDYxODYgNi4wOTMyMSAwLjUyMDE3MSA1Ljk3MzEzIDAuNTkxMzczQzUuNzMyNTEgMC43MzQwNTkgNS4zNzk5IDAuOTI2ODY0IDQuOTQyNzkgMS4xMjAwOUM0LjA2MTQ0IDEuNTA5NyAyLjg3NTQxIDEuODgzNzcgMS41ODk4NCAxLjg4Mzc3SDAuNzE0ODQ0VjIuNzU4NzdWNi45ODAxNUMwLjcxNDg0NCA5LjQ5Mzc0IDIuMjg4NjYgMTEuMTk3MyAzLjcwMjU0IDEyLjIxODVDNC40MTg0NSAxMi43MzU1IDUuMTI4NzQgMTMuMTA1MyA1LjY1NzMzIDEzLjM0NTdDNS45MjI4NCAxMy40NjY0IDYuMTQ1NjYgMTMuNTU1OSA2LjMwNDY1IDEzLjYxNjFDNi4zODQyMyAxMy42NDYyIDYuNDQ4MDUgMTMuNjY5IDYuNDkzNDkgMTMuNjg0OEM2LjUxNjIyIDEzLjY5MjcgNi41MzQzOCAxMy42OTg5IDYuNTQ3NjQgMTMuNzAzM0w2LjU2MzgyIDEzLjcwODdMNi41NjkwOCAxMy43MTA0TDYuNTcwOTkgMTMuNzExTDYuODM5ODQgMTMuNzUzM0w2LjU3MjQyIDEzLjcxMTVDNi43NDYzMyAxMy43NjczIDYuOTMzMzUgMTMuNzY3MyA3LjEwNzI3IDEzLjcxMTVMNy4xMDg3IDEzLjcxMUw3LjExMDYxIDEzLjcxMDRMNy4xMTU4NyAxMy43MDg3TDcuMTMyMDUgMTMuNzAzM0M3LjE0NTMxIDEzLjY5ODkgNy4xNjM0NiAxMy42OTI3IDcuMTg2MTkgMTMuNjg0OEM3LjIzMTY0IDEzLjY2OSA3LjI5NTQ2IDEzLjY0NjIgNy4zNzUwMyAxMy42MTYxQzcuNTM0MDMgMTMuNTU1OSA3Ljc1Njg1IDEzLjQ2NjQgOC4wMjIzNiAxMy4zNDU3QzguNTUwOTUgMTMuMTA1MyA5LjI2MTIzIDEyLjczNTUgOS45NzcxNSAxMi4yMTg1QzExLjM5MSAxMS4xOTczIDEyLjk2NDggOS40OTM3NyAxMi45NjQ4IDYuOTgwMThWMi43NTg4QzEyLjk2NDggMi43MTY2IDEyLjk2MTkgMi42NzUxMSAxMi45NTYxIDIuNjM0NTFWMS44ODM3N0gxMi4wODExQzEyLjA3NzUgMS44ODM3NyAxMi4wNzQgMS44ODM3NyAxMi4wNzA0IDEuODgzNzdDMTAuNzk3OSAxLjg4MDA0IDkuNjE5NjIgMS41MTEwMiA4LjczODk0IDEuMTI0ODZDOC43MzUzNCAxLjEyMzI3IDguNzMxNzQgMS4xMjE2OCA4LjcyODE0IDEuMTIwMDlDOC4yOTEwMyAwLjkyNjg2NCA3LjkzODQyIDAuNzM0MDU5IDcuNjk3NzkgMC41OTEzNzNDNy41Nzc3MiAwLjUyMDE3MSA3LjQ4NjIyIDAuNDYxODYgNy40MjY3NiAwLjQyMjc4OUM3LjM5NzA1IDAuNDAzMjY2IDcuMzc1MzkgMC4zODg1ODggNy4zNjIyNCAwLjM3OTU1NEw3LjM0ODk2IDAuMzcwMzVDNy4zNDg5NiAwLjM3MDM1IDcuMzQ4NDcgMC4zNzAwMiA3LjM0NTYzIDAuMzc0MDU0TDcuMzM3NzkgMC4zNjg2NTlMNy4zMzYwOSAwLjM2NzQ3NVpNOC4wMzQ3MSAyLjcyNjkxQzguODYwNCAzLjA5MDYzIDkuOTYwNjYgMy40NjMwOSAxMS4yMDYxIDMuNTg5MDdWNi45ODAxNUgxMS4yMTQ4QzExLjIxNDggOC42Nzk1MyAxMC4xNjM3IDkuOTI1MDcgOC45NTI1NCAxMC43OTk4QzguMzU1OTUgMTEuMjMwNiA3Ljc1Mzc0IDExLjU0NTQgNy4yOTc5NiAxMS43NTI3QzcuMTE2NzEgMTEuODM1MSA2Ljk2MDYyIDExLjg5OTYgNi44Mzk4NCAxMS45NDY5QzYuNzE5MDYgMTEuODk5NiA2LjU2Mjk3IDExLjgzNTEgNi4zODE3MyAxMS43NTI3QzUuOTI1OTUgMTEuNTQ1NCA1LjMyMzczIDExLjIzMDYgNC43MjcxNSAxMC43OTk4QzMuNTE2MDMgOS45MjUwNyAyLjQ2NDg0IDguNjc5NTUgMi40NjQ4NCA2Ljk4MDE4VjMuNTg5MDlDMy43MTczOCAzLjQ2MjM5IDQuODIzMDggMy4wODYzOSA1LjY1MDMzIDIuNzIwNzFDNi4xNDIyOCAyLjUwMzI0IDYuNTQ0ODUgMi4yODUzNyA2LjgzMjU0IDIuMTE2MjRDNy4xMjE4MSAyLjI4NTM1IDcuNTI3IDIuNTAzNTIgOC4wMjE5NiAyLjcyMTMxQzguMDI2MiAyLjcyMzE3IDguMDMwNDUgMi43MjUwNCA4LjAzNDcxIDIuNzI2OTFaTTUuOTY0ODQgMy40MDE0N1Y3Ljc3NjQ3SDcuNzE0ODRWMy40MDE0N0g1Ljk2NDg0Wk01Ljk2NDg0IDEwLjQwMTVWOC42NTE0N0g3LjcxNDg0VjEwLjQwMTVINS45NjQ4NFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
|
|
444
|
+
background-color: crimson;
|
|
445
|
+
}
|
|
446
|
+
.ace_icon_svg.ace_warning_fold {
|
|
447
|
+
-webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");
|
|
448
|
+
background-color: darkorange;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.ace_scrollbar {
|
|
452
|
+
contain: strict;
|
|
453
|
+
position: absolute;
|
|
454
|
+
right: 0;
|
|
455
|
+
bottom: 0;
|
|
456
|
+
z-index: 6;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.ace_scrollbar-inner {
|
|
460
|
+
position: absolute;
|
|
461
|
+
cursor: text;
|
|
462
|
+
left: 0;
|
|
463
|
+
top: 0;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.ace_scrollbar-v{
|
|
467
|
+
overflow-x: hidden;
|
|
468
|
+
overflow-y: scroll;
|
|
469
|
+
top: 0;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.ace_scrollbar-h {
|
|
473
|
+
overflow-x: scroll;
|
|
474
|
+
overflow-y: hidden;
|
|
475
|
+
left: 0;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.ace_print-margin {
|
|
479
|
+
position: absolute;
|
|
480
|
+
height: 100%;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.ace_text-input {
|
|
484
|
+
position: absolute;
|
|
485
|
+
z-index: 0;
|
|
486
|
+
width: 0.5em;
|
|
487
|
+
height: 1em;
|
|
488
|
+
opacity: 0;
|
|
489
|
+
background: transparent;
|
|
490
|
+
-moz-appearance: none;
|
|
491
|
+
appearance: none;
|
|
492
|
+
border: none;
|
|
493
|
+
resize: none;
|
|
494
|
+
outline: none;
|
|
495
|
+
overflow: hidden;
|
|
496
|
+
font: inherit;
|
|
497
|
+
padding: 0 1px;
|
|
498
|
+
margin: 0 -1px;
|
|
499
|
+
contain: strict;
|
|
500
|
+
-ms-user-select: text;
|
|
501
|
+
-moz-user-select: text;
|
|
502
|
+
-webkit-user-select: text;
|
|
503
|
+
user-select: text;
|
|
504
|
+
/*with \`pre-line\` chrome inserts instead of space*/
|
|
505
|
+
white-space: pre!important;
|
|
506
|
+
}
|
|
507
|
+
.ace_text-input.ace_composition {
|
|
508
|
+
background: transparent;
|
|
509
|
+
color: inherit;
|
|
510
|
+
z-index: 1000;
|
|
511
|
+
opacity: 1;
|
|
512
|
+
}
|
|
513
|
+
.ace_composition_placeholder { color: transparent }
|
|
514
|
+
.ace_composition_marker {
|
|
515
|
+
border-bottom: 1px solid;
|
|
516
|
+
position: absolute;
|
|
517
|
+
border-radius: 0;
|
|
518
|
+
margin-top: 1px;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
[ace_nocontext=true] {
|
|
522
|
+
transform: none!important;
|
|
523
|
+
filter: none!important;
|
|
524
|
+
clip-path: none!important;
|
|
525
|
+
mask : none!important;
|
|
526
|
+
contain: none!important;
|
|
527
|
+
perspective: none!important;
|
|
528
|
+
mix-blend-mode: initial!important;
|
|
529
|
+
z-index: auto;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.ace_layer {
|
|
533
|
+
z-index: 1;
|
|
534
|
+
position: absolute;
|
|
535
|
+
overflow: hidden;
|
|
536
|
+
/* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
|
|
537
|
+
word-wrap: normal;
|
|
538
|
+
white-space: pre;
|
|
539
|
+
height: 100%;
|
|
540
|
+
width: 100%;
|
|
541
|
+
box-sizing: border-box;
|
|
542
|
+
/* setting pointer-events: auto; on node under the mouse, which changes
|
|
543
|
+
during scroll, will break mouse wheel scrolling in Safari */
|
|
544
|
+
pointer-events: none;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.ace_gutter-layer {
|
|
548
|
+
position: relative;
|
|
549
|
+
width: auto;
|
|
550
|
+
text-align: right;
|
|
551
|
+
pointer-events: auto;
|
|
552
|
+
height: 1000000px;
|
|
553
|
+
contain: style size layout;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.ace_text-layer {
|
|
557
|
+
font: inherit !important;
|
|
558
|
+
position: absolute;
|
|
559
|
+
height: 1000000px;
|
|
560
|
+
width: 1000000px;
|
|
561
|
+
contain: style size layout;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {
|
|
565
|
+
contain: style size layout;
|
|
566
|
+
position: absolute;
|
|
567
|
+
top: 0;
|
|
568
|
+
left: 0;
|
|
569
|
+
right: 0;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.ace_hidpi .ace_text-layer,
|
|
573
|
+
.ace_hidpi .ace_gutter-layer,
|
|
574
|
+
.ace_hidpi .ace_content,
|
|
575
|
+
.ace_hidpi .ace_gutter {
|
|
576
|
+
contain: strict;
|
|
577
|
+
}
|
|
578
|
+
.ace_hidpi .ace_text-layer > .ace_line,
|
|
579
|
+
.ace_hidpi .ace_text-layer > .ace_line_group {
|
|
580
|
+
contain: strict;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.ace_cjk {
|
|
584
|
+
display: inline-block;
|
|
585
|
+
text-align: center;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.ace_cursor-layer {
|
|
589
|
+
z-index: 4;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.ace_cursor {
|
|
593
|
+
z-index: 4;
|
|
594
|
+
position: absolute;
|
|
595
|
+
box-sizing: border-box;
|
|
596
|
+
border-left: 2px solid;
|
|
597
|
+
/* workaround for smooth cursor repaintng whole screen in chrome */
|
|
598
|
+
transform: translatez(0);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.ace_multiselect .ace_cursor {
|
|
602
|
+
border-left-width: 1px;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.ace_slim-cursors .ace_cursor {
|
|
606
|
+
border-left-width: 1px;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.ace_overwrite-cursors .ace_cursor {
|
|
610
|
+
border-left-width: 0;
|
|
611
|
+
border-bottom: 1px solid;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.ace_hidden-cursors .ace_cursor {
|
|
615
|
+
opacity: 0.2;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {
|
|
619
|
+
opacity: 0;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
.ace_smooth-blinking .ace_cursor {
|
|
623
|
+
transition: opacity 0.18s;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.ace_animate-blinking .ace_cursor {
|
|
627
|
+
animation-duration: 1000ms;
|
|
628
|
+
animation-timing-function: step-end;
|
|
629
|
+
animation-name: blink-ace-animate;
|
|
630
|
+
animation-iteration-count: infinite;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.ace_animate-blinking.ace_smooth-blinking .ace_cursor {
|
|
634
|
+
animation-duration: 1000ms;
|
|
635
|
+
animation-timing-function: ease-in-out;
|
|
636
|
+
animation-name: blink-ace-animate-smooth;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
@keyframes blink-ace-animate {
|
|
640
|
+
from, to { opacity: 1; }
|
|
641
|
+
60% { opacity: 0; }
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
@keyframes blink-ace-animate-smooth {
|
|
645
|
+
from, to { opacity: 1; }
|
|
646
|
+
45% { opacity: 1; }
|
|
647
|
+
60% { opacity: 0; }
|
|
648
|
+
85% { opacity: 0; }
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {
|
|
652
|
+
position: absolute;
|
|
653
|
+
z-index: 3;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
.ace_marker-layer .ace_selection {
|
|
657
|
+
position: absolute;
|
|
658
|
+
z-index: 5;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
.ace_marker-layer .ace_bracket {
|
|
662
|
+
position: absolute;
|
|
663
|
+
z-index: 6;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
.ace_marker-layer .ace_error_bracket {
|
|
667
|
+
position: absolute;
|
|
668
|
+
border-bottom: 1px solid #DE5555;
|
|
669
|
+
border-radius: 0;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.ace_marker-layer .ace_active-line {
|
|
673
|
+
position: absolute;
|
|
674
|
+
z-index: 2;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
.ace_marker-layer .ace_selected-word {
|
|
678
|
+
position: absolute;
|
|
679
|
+
z-index: 4;
|
|
680
|
+
box-sizing: border-box;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
.ace_line .ace_fold {
|
|
684
|
+
box-sizing: border-box;
|
|
685
|
+
|
|
686
|
+
display: inline-block;
|
|
687
|
+
height: 11px;
|
|
688
|
+
margin-top: -2px;
|
|
689
|
+
vertical-align: middle;
|
|
690
|
+
|
|
691
|
+
background-image:
|
|
692
|
+
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
|
|
693
|
+
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
|
|
694
|
+
background-repeat: no-repeat, repeat-x;
|
|
695
|
+
background-position: center center, top left;
|
|
696
|
+
color: transparent;
|
|
697
|
+
|
|
698
|
+
border: 1px solid black;
|
|
699
|
+
border-radius: 2px;
|
|
700
|
+
|
|
701
|
+
cursor: pointer;
|
|
702
|
+
pointer-events: auto;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.ace_dark .ace_fold {
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
.ace_fold:hover{
|
|
709
|
+
background-image:
|
|
710
|
+
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
|
|
711
|
+
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
.ace_tooltip {
|
|
715
|
+
background-color: #f5f5f5;
|
|
716
|
+
border: 1px solid gray;
|
|
717
|
+
border-radius: 1px;
|
|
718
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
|
|
719
|
+
color: black;
|
|
720
|
+
max-width: 100%;
|
|
721
|
+
padding: 3px 4px;
|
|
722
|
+
position: fixed;
|
|
723
|
+
z-index: 999999;
|
|
724
|
+
box-sizing: border-box;
|
|
725
|
+
cursor: default;
|
|
726
|
+
white-space: pre-wrap;
|
|
727
|
+
word-wrap: break-word;
|
|
728
|
+
line-height: normal;
|
|
729
|
+
font-style: normal;
|
|
730
|
+
font-weight: normal;
|
|
731
|
+
letter-spacing: normal;
|
|
732
|
+
pointer-events: none;
|
|
733
|
+
overflow: auto;
|
|
734
|
+
max-width: min(60em, 66vw);
|
|
735
|
+
overscroll-behavior: contain;
|
|
736
|
+
}
|
|
737
|
+
.ace_tooltip pre {
|
|
738
|
+
white-space: pre-wrap;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.ace_tooltip.ace_dark {
|
|
742
|
+
background-color: #636363;
|
|
743
|
+
color: #fff;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.ace_tooltip:focus {
|
|
747
|
+
outline: 1px solid #5E9ED6;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
.ace_icon {
|
|
751
|
+
display: inline-block;
|
|
752
|
+
width: 18px;
|
|
753
|
+
vertical-align: top;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.ace_icon_svg {
|
|
757
|
+
display: inline-block;
|
|
758
|
+
width: 12px;
|
|
759
|
+
vertical-align: top;
|
|
760
|
+
-webkit-mask-repeat: no-repeat;
|
|
761
|
+
-webkit-mask-size: 12px;
|
|
762
|
+
-webkit-mask-position: center;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {
|
|
766
|
+
padding-right: 13px;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.ace_fold-widget {
|
|
770
|
+
box-sizing: border-box;
|
|
771
|
+
|
|
772
|
+
margin: 0 -12px 0 1px;
|
|
773
|
+
display: none;
|
|
774
|
+
width: 11px;
|
|
775
|
+
vertical-align: top;
|
|
776
|
+
|
|
777
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");
|
|
778
|
+
background-repeat: no-repeat;
|
|
779
|
+
background-position: center;
|
|
780
|
+
|
|
781
|
+
border-radius: 3px;
|
|
782
|
+
|
|
783
|
+
border: 1px solid transparent;
|
|
784
|
+
cursor: pointer;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
.ace_folding-enabled .ace_fold-widget {
|
|
788
|
+
display: inline-block;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
.ace_fold-widget.ace_end {
|
|
792
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
.ace_fold-widget.ace_closed {
|
|
796
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
.ace_fold-widget:hover {
|
|
800
|
+
border: 1px solid rgba(0, 0, 0, 0.3);
|
|
801
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
802
|
+
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
.ace_fold-widget:active {
|
|
806
|
+
border: 1px solid rgba(0, 0, 0, 0.4);
|
|
807
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
808
|
+
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Dark version for fold widgets
|
|
812
|
+
*/
|
|
813
|
+
.ace_dark .ace_fold-widget {
|
|
814
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");
|
|
815
|
+
}
|
|
816
|
+
.ace_dark .ace_fold-widget.ace_end {
|
|
817
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");
|
|
818
|
+
}
|
|
819
|
+
.ace_dark .ace_fold-widget.ace_closed {
|
|
820
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");
|
|
821
|
+
}
|
|
822
|
+
.ace_dark .ace_fold-widget:hover {
|
|
823
|
+
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
|
824
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
825
|
+
}
|
|
826
|
+
.ace_dark .ace_fold-widget:active {
|
|
827
|
+
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.ace_inline_button {
|
|
831
|
+
border: 1px solid lightgray;
|
|
832
|
+
display: inline-block;
|
|
833
|
+
margin: -1px 8px;
|
|
834
|
+
padding: 0 5px;
|
|
835
|
+
pointer-events: auto;
|
|
836
|
+
cursor: pointer;
|
|
837
|
+
}
|
|
838
|
+
.ace_inline_button:hover {
|
|
839
|
+
border-color: gray;
|
|
840
|
+
background: rgba(200,200,200,0.2);
|
|
841
|
+
display: inline-block;
|
|
842
|
+
pointer-events: auto;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
.ace_fold-widget.ace_invalid {
|
|
846
|
+
background-color: #FFB4B4;
|
|
847
|
+
border-color: #DE5555;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
.ace_fade-fold-widgets .ace_fold-widget {
|
|
851
|
+
transition: opacity 0.4s ease 0.05s;
|
|
852
|
+
opacity: 0;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
.ace_fade-fold-widgets:hover .ace_fold-widget {
|
|
856
|
+
transition: opacity 0.05s ease 0.05s;
|
|
857
|
+
opacity:1;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
.ace_underline {
|
|
861
|
+
text-decoration: underline;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
.ace_bold {
|
|
865
|
+
font-weight: bold;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
.ace_nobold .ace_bold {
|
|
869
|
+
font-weight: normal;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.ace_italic {
|
|
873
|
+
font-style: italic;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
.ace_error-marker {
|
|
878
|
+
background-color: rgba(255, 0, 0,0.2);
|
|
879
|
+
position: absolute;
|
|
880
|
+
z-index: 9;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.ace_highlight-marker {
|
|
884
|
+
background-color: rgba(255, 255, 0,0.2);
|
|
885
|
+
position: absolute;
|
|
886
|
+
z-index: 8;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.ace_mobile-menu {
|
|
890
|
+
position: absolute;
|
|
891
|
+
line-height: 1.5;
|
|
892
|
+
border-radius: 4px;
|
|
893
|
+
-ms-user-select: none;
|
|
894
|
+
-moz-user-select: none;
|
|
895
|
+
-webkit-user-select: none;
|
|
896
|
+
user-select: none;
|
|
897
|
+
background: white;
|
|
898
|
+
box-shadow: 1px 3px 2px grey;
|
|
899
|
+
border: 1px solid #dcdcdc;
|
|
900
|
+
color: black;
|
|
901
|
+
}
|
|
902
|
+
.ace_dark > .ace_mobile-menu {
|
|
903
|
+
background: #333;
|
|
904
|
+
color: #ccc;
|
|
905
|
+
box-shadow: 1px 3px 2px grey;
|
|
906
|
+
border: 1px solid #444;
|
|
907
|
+
|
|
908
|
+
}
|
|
909
|
+
.ace_mobile-button {
|
|
910
|
+
padding: 2px;
|
|
911
|
+
cursor: pointer;
|
|
912
|
+
overflow: hidden;
|
|
913
|
+
}
|
|
914
|
+
.ace_mobile-button:hover {
|
|
915
|
+
background-color: #eee;
|
|
916
|
+
opacity:1;
|
|
917
|
+
}
|
|
918
|
+
.ace_mobile-button:active {
|
|
919
|
+
background-color: #ddd;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
.ace_placeholder {
|
|
923
|
+
position: relative;
|
|
924
|
+
font-family: arial;
|
|
925
|
+
transform: scale(0.9);
|
|
926
|
+
transform-origin: left;
|
|
927
|
+
white-space: pre;
|
|
928
|
+
opacity: 0.7;
|
|
929
|
+
margin: 0 10px;
|
|
930
|
+
z-index: 1;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
.ace_ghost_text {
|
|
934
|
+
opacity: 0.5;
|
|
935
|
+
font-style: italic;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
.ace_ghost_text_container > div {
|
|
939
|
+
white-space: pre;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
.ghost_text_line_wrapped::after {
|
|
943
|
+
content: "↩";
|
|
944
|
+
position: absolute;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
.ace_lineWidgetContainer.ace_ghost_text {
|
|
948
|
+
margin: 0px 4px
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
.ace_screenreader-only {
|
|
952
|
+
position:absolute;
|
|
953
|
+
left:-10000px;
|
|
954
|
+
top:auto;
|
|
955
|
+
width:1px;
|
|
956
|
+
height:1px;
|
|
957
|
+
overflow:hidden;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
.ace_hidden_token {
|
|
961
|
+
display: none;
|
|
962
|
+
}`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(t,n,m){var i=t("../lib/dom"),a=t("../lib/oop"),p=t("../lib/event_emitter").EventEmitter,o=function(){function h(r,s){this.canvas=i.createElement("canvas"),this.renderer=s,this.pixelRatio=1,this.maxHeight=s.layerConfig.maxHeight,this.lineHeight=s.layerConfig.lineHeight,this.canvasHeight=r.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=r.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},r.element.appendChild(this.canvas)}return h.prototype.$updateDecorators=function(r){var s=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(r){this.maxHeight=r.maxHeight,this.lineHeight=r.lineHeight,this.canvasHeight=r.height;var l=(r.lastRow+1)*this.lineHeight;l<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight}var u=this.canvas.getContext("2d");function c(L,C){return L.priority<C.priority?-1:L.priority>C.priority?1:0}var f=this.renderer.session.$annotations;if(u.clearRect(0,0,this.canvas.width,this.canvas.height),f){var g={info:1,warning:2,error:3};f.forEach(function(L){L.priority=g[L.type]||null}),f=f.sort(c);for(var v=this.renderer.session.$foldData,b=0;b<f.length;b++){var A=f[b].row,x=this.compensateFoldRows(A,v),D=Math.round((A-x)*this.lineHeight*this.heightRatio),y=Math.round((A-x)*this.lineHeight*this.heightRatio),E=Math.round(((A-x)*this.lineHeight+this.lineHeight)*this.heightRatio),T=E-y;if(T<this.minDecorationHeight){var M=(y+E)/2|0;M<this.halfMinDecorationHeight?M=this.halfMinDecorationHeight:M+this.halfMinDecorationHeight>this.canvasHeight&&(M=this.canvasHeight-this.halfMinDecorationHeight),y=Math.round(M-this.halfMinDecorationHeight),E=Math.round(M+this.halfMinDecorationHeight)}u.fillStyle=s[f[b].type]||null,u.fillRect(0,D,this.canvasWidth,E-y)}}var $=this.renderer.session.selection.getCursor();if($){var x=this.compensateFoldRows($.row,v),D=Math.round(($.row-x)*this.lineHeight*this.heightRatio);u.fillStyle="rgba(0, 0, 0, 0.5)",u.fillRect(0,D,this.canvasWidth,2)}},h.prototype.compensateFoldRows=function(r,s){var l=0;if(s&&s.length>0)for(var u=0;u<s.length;u++)r>s[u].start.row&&r<s[u].end.row?l+=r-s[u].start.row:r>=s[u].end.row&&(l+=s[u].end.row-s[u].start.row);return l},h}();a.implement(o.prototype,p),n.Decorator=o}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(t,n,m){var i=t("./lib/oop"),a=t("./lib/dom"),p=t("./lib/lang"),o=t("./config"),h=t("./layer/gutter").Gutter,r=t("./layer/marker").Marker,s=t("./layer/text").Text,l=t("./layer/cursor").Cursor,u=t("./scrollbar").HScrollBar,c=t("./scrollbar").VScrollBar,f=t("./scrollbar_custom").HScrollBar,g=t("./scrollbar_custom").VScrollBar,v=t("./renderloop").RenderLoop,b=t("./layer/font_metrics").FontMetrics,A=t("./lib/event_emitter").EventEmitter,x=t("./css/editor-css"),D=t("./layer/decorators").Decorator,y=t("./lib/useragent"),E=t("./layer/text_util").isTextToken;a.importCssString(x,"ace_editor.css",!1);var T=function(){function M($,L){var C=this;this.container=$||a.createElement("div"),a.addCssClass(this.container,"ace_editor"),a.HI_DPI&&a.addCssClass(this.container,"ace_hidpi"),this.setTheme(L),o.get("useStrictCSP")==null&&o.set("useStrictCSP",!1),this.$gutter=a.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=a.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=a.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new h(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new r(this.content);var w=this.$textLayer=new s(this.content);this.canvas=w.element,this.$markerFront=new r(this.content),this.$cursorLayer=new l(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new c(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.on("scroll",function(S){C.$scrollAnimation||C.session.setScrollTop(S.data-C.scrollMargin.top)}),this.scrollBarH.on("scroll",function(S){C.$scrollAnimation||C.session.setScrollLeft(S.data-C.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new b(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(S){C.updateCharacterSize(),C.onResize(!0,C.gutterWidth,C.$size.width,C.$size.height),C._signal("changeCharacterSize",S)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!y.isIOS,this.$loop=new v(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),o.resetOptions(this),o._signal("renderer",this)}return M.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),a.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},M.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))},M.prototype.updateLines=function($,L,C){if(L===void 0&&(L=1/0),this.$changedLines?(this.$changedLines.firstRow>$&&(this.$changedLines.firstRow=$),this.$changedLines.lastRow<L&&(this.$changedLines.lastRow=L)):this.$changedLines={firstRow:$,lastRow:L},this.$changedLines.lastRow<this.layerConfig.firstRow)if(C)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},M.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},M.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},M.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},M.prototype.updateFull=function($){$?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},M.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},M.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},M.prototype.onResize=function($,L,C,w){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=$?1:0;var S=this.container;w||(w=S.clientHeight||S.scrollHeight),!w&&this.$maxLines&&this.lineHeight>1&&(!S.style.height||S.style.height=="0px")&&(S.style.height="1px",w=S.clientHeight||S.scrollHeight),C||(C=S.clientWidth||S.scrollWidth);var k=this.$updateCachedSize($,L,C,w);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!C&&!w)return this.resizing=0;$&&(this.$gutterLayer.$padding=null),$?this.$renderChanges(k|this.$changes,!0):this.$loop.schedule(k|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},M.prototype.$updateCachedSize=function($,L,C,w){w-=this.$extraHeight||0;var S=0,k=this.$size,_={width:k.width,height:k.height,scrollerHeight:k.scrollerHeight,scrollerWidth:k.scrollerWidth};if(w&&($||k.height!=w)&&(k.height=w,S|=this.CHANGE_SIZE,k.scrollerHeight=k.height,this.$horizScroll&&(k.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(k.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",S=S|this.CHANGE_SCROLL),C&&($||k.width!=C)){S|=this.CHANGE_SIZE,k.width=C,L==null&&(L=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=L,a.setStyle(this.scrollBarH.element.style,"left",L+"px"),a.setStyle(this.scroller.style,"left",L+this.margin.left+"px"),k.scrollerWidth=Math.max(0,C-L-this.scrollBarV.getWidth()-this.margin.h),a.setStyle(this.$gutter.style,"left",this.margin.left+"px");var F=this.scrollBarV.getWidth()+"px";a.setStyle(this.scrollBarH.element.style,"right",F),a.setStyle(this.scroller.style,"right",F),a.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(k.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||$)&&(S|=this.CHANGE_FULL)}return k.$dirty=!C||!w,S&&this._signal("resize",_),S},M.prototype.onGutterResize=function($){var L=this.$showGutter?$:0;L!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,L,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()},M.prototype.adjustWrapLimit=function(){var $=this.$size.scrollerWidth-this.$padding*2,L=Math.floor($/this.characterWidth);return this.session.adjustWrapLimit(L,this.$showPrintMargin&&this.$printMarginColumn)},M.prototype.setAnimatedScroll=function($){this.setOption("animatedScroll",$)},M.prototype.getAnimatedScroll=function(){return this.$animatedScroll},M.prototype.setShowInvisibles=function($){this.setOption("showInvisibles",$),this.session.$bidiHandler.setShowInvisibles($)},M.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},M.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},M.prototype.setDisplayIndentGuides=function($){this.setOption("displayIndentGuides",$)},M.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},M.prototype.setHighlightIndentGuides=function($){this.setOption("highlightIndentGuides",$)},M.prototype.setShowPrintMargin=function($){this.setOption("showPrintMargin",$)},M.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},M.prototype.setPrintMarginColumn=function($){this.setOption("printMarginColumn",$)},M.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},M.prototype.getShowGutter=function(){return this.getOption("showGutter")},M.prototype.setShowGutter=function($){return this.setOption("showGutter",$)},M.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},M.prototype.setFadeFoldWidgets=function($){this.setOption("fadeFoldWidgets",$)},M.prototype.setHighlightGutterLine=function($){this.setOption("highlightGutterLine",$)},M.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},M.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var $=a.createElement("div");$.className="ace_layer ace_print-margin-layer",this.$printMarginEl=a.createElement("div"),this.$printMarginEl.className="ace_print-margin",$.appendChild(this.$printMarginEl),this.content.insertBefore($,this.content.firstChild)}var L=this.$printMarginEl.style;L.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",L.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},M.prototype.getContainerElement=function(){return this.container},M.prototype.getMouseEventTarget=function(){return this.scroller},M.prototype.getTextAreaContainer=function(){return this.container},M.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var $=this.textarea.style,L=this.$composition;if(!this.$keepTextAreaAtCursor&&!L){a.translate(this.textarea,-100,0);return}var C=this.$cursorLayer.$pixelPos;if(C){L&&L.markerRange&&(C=this.$cursorLayer.getPixelPosition(L.markerRange.start,!0));var w=this.layerConfig,S=C.top,k=C.left;S-=w.offset;var _=L&&L.useTextareaForIME||y.isMobile?this.lineHeight:1;if(S<0||S>w.height-_){a.translate(this.textarea,0,0);return}var F=1,R=this.$size.height-_;if(!L)S+=this.lineHeight;else if(L.useTextareaForIME){var O=this.textarea.value;F=this.characterWidth*this.session.$getStringScreenWidth(O)[0]}else S+=this.lineHeight+2;k-=this.scrollLeft,k>this.$size.scrollerWidth-F&&(k=this.$size.scrollerWidth-F),k+=this.gutterWidth+this.margin.left,a.setStyle($,"height",_+"px"),a.setStyle($,"width",F+"px"),a.translate(this.textarea,Math.min(k,this.$size.scrollerWidth-F),Math.min(S,R))}}},M.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},M.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},M.prototype.getLastFullyVisibleRow=function(){var $=this.layerConfig,L=$.lastRow,C=this.session.documentToScreenRow(L,0)*$.lineHeight;return C-this.session.getScrollTop()>$.height-$.lineHeight?L-1:L},M.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},M.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()},M.prototype.setScrollMargin=function($,L,C,w){var S=this.scrollMargin;S.top=$|0,S.bottom=L|0,S.right=w|0,S.left=C|0,S.v=S.top+S.bottom,S.h=S.left+S.right,S.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-S.top),this.updateFull()},M.prototype.setMargin=function($,L,C,w){var S=this.margin;S.top=$|0,S.bottom=L|0,S.right=w|0,S.left=C|0,S.v=S.top+S.bottom,S.h=S.left+S.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},M.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},M.prototype.setHScrollBarAlwaysVisible=function($){this.setOption("hScrollBarAlwaysVisible",$)},M.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},M.prototype.setVScrollBarAlwaysVisible=function($){this.setOption("vScrollBarAlwaysVisible",$)},M.prototype.$updateScrollBarV=function(){var $=this.layerConfig.maxHeight,L=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&($-=(L-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>$-L&&($=this.scrollTop+L,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight($+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},M.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},M.prototype.freeze=function(){this.$frozen=!0},M.prototype.unfreeze=function(){this.$frozen=!1},M.prototype.$renderChanges=function($,L){if(this.$changes&&($|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!$&&!L){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 C=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(),C.firstRow!=this.layerConfig.firstRow&&C.firstRowScreen==this.layerConfig.firstRowScreen){var w=this.scrollTop+(C.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;w>0&&(this.scrollTop=w,$=$|this.CHANGE_SCROLL,$|=this.$computeLayerConfig()|this.$loop.clear())}C=this.layerConfig,this.$updateScrollBarV(),$&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),a.translate(this.content,-this.scrollLeft,-C.offset);var S=C.width+2*this.$padding+"px",k=C.minHeight+"px";a.setStyle(this.content.style,"width",S),a.setStyle(this.content.style,"height",k)}if($&this.CHANGE_H_SCROLL&&(a.translate(this.content,-this.scrollLeft,-C.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(C),this.$showGutter&&this.$gutterLayer.update(C),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(C),this.$markerBack.update(C),this.$markerFront.update(C),this.$cursorLayer.update(C),this.$moveTextAreaToCursor(),this._signal("afterRender",$);return}if($&this.CHANGE_SCROLL){this.$changedLines=null,$&this.CHANGE_TEXT||$&this.CHANGE_LINES?this.$textLayer.update(C):this.$textLayer.scrollLines(C),this.$showGutter&&($&this.CHANGE_GUTTER||$&this.CHANGE_LINES?this.$gutterLayer.update(C):this.$gutterLayer.scrollLines(C)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(C),this.$markerBack.update(C),this.$markerFront.update(C),this.$cursorLayer.update(C),this.$moveTextAreaToCursor(),this._signal("afterRender",$);return}$&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(C),this.$showGutter&&this.$gutterLayer.update(C),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(C)):$&this.CHANGE_LINES?((this.$updateLines()||$&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(C),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(C)):$&this.CHANGE_TEXT||$&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(C),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(C)):$&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(C),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(C)),$&this.CHANGE_CURSOR&&(this.$cursorLayer.update(C),this.$moveTextAreaToCursor()),$&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(C),$&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(C),this._signal("afterRender",$)},M.prototype.$autosize=function(){var $=this.session.getScreenLength()*this.lineHeight,L=this.$maxLines*this.lineHeight,C=Math.min(L,Math.max((this.$minLines||1)*this.lineHeight,$))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(C+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&C>this.$maxPixelHeight&&(C=this.$maxPixelHeight);var w=C<=2*this.lineHeight,S=!w&&$>L;if(C!=this.desiredHeight||this.$size.height!=this.desiredHeight||S!=this.$vScroll){S!=this.$vScroll&&(this.$vScroll=S,this.scrollBarV.setVisible(S));var k=this.container.clientWidth;this.container.style.height=C+"px",this.$updateCachedSize(!0,this.$gutterWidth,k,C),this.desiredHeight=C,this._signal("autosize")}},M.prototype.$computeLayerConfig=function(){var $=this.session,L=this.$size,C=L.height<=2*this.lineHeight,w=this.session.getScreenLength(),S=w*this.lineHeight,k=this.$getLongestLine(),_=!C&&(this.$hScrollBarAlwaysVisible||L.scrollerWidth-k-2*this.$padding<0),F=this.$horizScroll!==_;F&&(this.$horizScroll=_,this.scrollBarH.setVisible(_));var R=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),C=L.height<=2*this.lineHeight);var O=L.scrollerHeight+this.lineHeight,V=!this.$maxLines&&this.$scrollPastEnd?(L.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;S+=V;var P=this.scrollMargin;this.session.setScrollTop(Math.max(-P.top,Math.min(this.scrollTop,S-L.scrollerHeight+P.bottom))),this.session.setScrollLeft(Math.max(-P.left,Math.min(this.scrollLeft,k+2*this.$padding-L.scrollerWidth+P.right)));var H=!C&&(this.$vScrollBarAlwaysVisible||L.scrollerHeight-S+V<0||this.scrollTop>P.top),N=R!==H;N&&(this.$vScroll=H,this.scrollBarV.setVisible(H));var W=this.scrollTop%this.lineHeight,z=Math.ceil(O/this.lineHeight)-1,j=Math.max(0,Math.round((this.scrollTop-W)/this.lineHeight)),Q=j+z,Z,q,ne=this.lineHeight;j=$.screenToDocumentRow(j,0);var se=$.getFoldLine(j);se&&(j=se.start.row),Z=$.documentToScreenRow(j,0),q=$.getRowLength(j)*ne,Q=Math.min($.screenToDocumentRow(Q,0),$.getLength()-1),O=L.scrollerHeight+$.getRowLength(Q)*ne+q,W=this.scrollTop-Z*ne;var pe=0;return(this.layerConfig.width!=k||F)&&(pe=this.CHANGE_H_SCROLL),(F||N)&&(pe|=this.$updateCachedSize(!0,this.gutterWidth,L.width,L.height),this._signal("scrollbarVisibilityChanged"),N&&(k=this.$getLongestLine())),this.layerConfig={width:k,padding:this.$padding,firstRow:j,firstRowScreen:Z,lastRow:Q,lineHeight:ne,characterWidth:this.characterWidth,minHeight:O,maxHeight:S,offset:W,gutterOffset:ne?Math.max(0,Math.ceil((W+L.height-L.scrollerHeight)/ne)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(k-this.$padding),pe},M.prototype.$updateLines=function(){if(this.$changedLines){var $=this.$changedLines.firstRow,L=this.$changedLines.lastRow;this.$changedLines=null;var C=this.layerConfig;if(!($>C.lastRow+1)&&!(L<C.firstRow)){if(L===1/0){this.$showGutter&&this.$gutterLayer.update(C),this.$textLayer.update(C);return}return this.$textLayer.updateLines(C,$,L),!0}}},M.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))},M.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},M.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},M.prototype.addGutterDecoration=function($,L){this.$gutterLayer.addGutterDecoration($,L)},M.prototype.removeGutterDecoration=function($,L){this.$gutterLayer.removeGutterDecoration($,L)},M.prototype.updateBreakpoints=function($){this._rows=$,this.$loop.schedule(this.CHANGE_GUTTER)},M.prototype.setAnnotations=function($){this.$gutterLayer.setAnnotations($),this.$loop.schedule(this.CHANGE_GUTTER)},M.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},M.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},M.prototype.showCursor=function(){this.$cursorLayer.showCursor()},M.prototype.scrollSelectionIntoView=function($,L,C){this.scrollCursorIntoView($,C),this.scrollCursorIntoView(L,C)},M.prototype.scrollCursorIntoView=function($,L,C){if(this.$size.scrollerHeight!==0){var w=this.$cursorLayer.getPixelPosition($),S=w.left,k=w.top,_=C&&C.top||0,F=C&&C.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var R=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;R+_>k?(L&&R+_>k+this.lineHeight&&(k-=L*this.$size.scrollerHeight),k===0&&(k=-this.scrollMargin.top),this.session.setScrollTop(k)):R+this.$size.scrollerHeight-F<k+this.lineHeight&&(L&&R+this.$size.scrollerHeight-F<k-this.lineHeight&&(k+=L*this.$size.scrollerHeight),this.session.setScrollTop(k+this.lineHeight+F-this.$size.scrollerHeight));var O=this.scrollLeft,V=2*this.layerConfig.characterWidth;S-V<O?(S-=V,S<this.$padding+V&&(S=-this.scrollMargin.left),this.session.setScrollLeft(S)):(S+=V,O+this.$size.scrollerWidth<S+this.characterWidth?this.session.setScrollLeft(Math.round(S+this.characterWidth-this.$size.scrollerWidth)):O<=this.$padding&&S-O<this.characterWidth&&this.session.setScrollLeft(0))}},M.prototype.getScrollTop=function(){return this.session.getScrollTop()},M.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},M.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},M.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},M.prototype.scrollToRow=function($){this.session.setScrollTop($*this.lineHeight)},M.prototype.alignCursor=function($,L){typeof $=="number"&&($={row:$,column:0});var C=this.$cursorLayer.getPixelPosition($),w=this.$size.scrollerHeight-this.lineHeight,S=C.top-w*(L||0);return this.session.setScrollTop(S),S},M.prototype.$calcSteps=function($,L){var C=0,w=this.STEPS,S=[],k=function(_,F,R){return R*(Math.pow(_-1,3)+1)+F};for(C=0;C<w;++C)S.push(k(C/this.STEPS,$,L-$));return S},M.prototype.scrollToLine=function($,L,C,w){var S=this.$cursorLayer.getPixelPosition({row:$,column:0}),k=S.top;L&&(k-=this.$size.scrollerHeight/2);var _=this.scrollTop;this.session.setScrollTop(k),C!==!1&&this.animateScrolling(_,w)},M.prototype.animateScrolling=function($,L){var C=this.scrollTop;if(!this.$animatedScroll)return;var w=this;if($==C)return;if(this.$scrollAnimation){var S=this.$scrollAnimation.steps;if(S.length&&($=S[0],$==C))return}var k=w.$calcSteps($,C);this.$scrollAnimation={from:$,to:C,steps:k},clearInterval(this.$timer),w.session.setScrollTop(k.shift()),w.session.$scrollTop=C;function _(){w.$timer=clearInterval(w.$timer),w.$scrollAnimation=null,w.$stopAnimation=!1,L&&L()}this.$timer=setInterval(function(){if(w.$stopAnimation){_();return}if(!w.session)return clearInterval(w.$timer);k.length?(w.session.setScrollTop(k.shift()),w.session.$scrollTop=C):C!=null?(w.session.$scrollTop=-1,w.session.setScrollTop(C),C=null):_()},10)},M.prototype.scrollToY=function($){this.scrollTop!==$&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=$)},M.prototype.scrollToX=function($){this.scrollLeft!==$&&(this.scrollLeft=$),this.$loop.schedule(this.CHANGE_H_SCROLL)},M.prototype.scrollTo=function($,L){this.session.setScrollTop(L),this.session.setScrollLeft($)},M.prototype.scrollBy=function($,L){L&&this.session.setScrollTop(this.session.getScrollTop()+L),$&&this.session.setScrollLeft(this.session.getScrollLeft()+$)},M.prototype.isScrollableBy=function($,L){if(L<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||L>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},M.prototype.pixelToScreenCoordinates=function($,L){var C;if(this.$hasCssTransforms){C={top:0,left:0};var w=this.$fontMetrics.transformCoordinates([$,L]);$=w[1]-this.gutterWidth-this.margin.left,L=w[0]}else C=this.scroller.getBoundingClientRect();var S=$+this.scrollLeft-C.left-this.$padding,k=S/this.characterWidth,_=Math.floor((L+this.scrollTop-C.top)/this.lineHeight),F=this.$blockCursor?Math.floor(k):Math.round(k);return{row:_,column:F,side:k-F>0?1:-1,offsetX:S}},M.prototype.screenToTextCoordinates=function($,L){var C;if(this.$hasCssTransforms){C={top:0,left:0};var w=this.$fontMetrics.transformCoordinates([$,L]);$=w[1]-this.gutterWidth-this.margin.left,L=w[0]}else C=this.scroller.getBoundingClientRect();var S=$+this.scrollLeft-C.left-this.$padding,k=S/this.characterWidth,_=this.$blockCursor?Math.floor(k):Math.round(k),F=Math.floor((L+this.scrollTop-C.top)/this.lineHeight);return this.session.screenToDocumentPosition(F,Math.max(_,0),S)},M.prototype.textToScreenCoordinates=function($,L){var C=this.scroller.getBoundingClientRect(),w=this.session.documentToScreenPosition($,L),S=this.$padding+(this.session.$bidiHandler.isBidiRow(w.row,$)?this.session.$bidiHandler.getPosLeft(w.column):Math.round(w.column*this.characterWidth)),k=w.row*this.lineHeight;return{pageX:C.left+S-this.scrollLeft,pageY:C.top+k-this.scrollTop}},M.prototype.visualizeFocus=function(){a.addCssClass(this.container,"ace_focus")},M.prototype.visualizeBlur=function(){a.removeCssClass(this.container,"ace_focus")},M.prototype.showComposition=function($){this.$composition=$,$.cssText||($.cssText=this.textarea.style.cssText),$.useTextareaForIME==null&&($.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(a.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")},M.prototype.setCompositionText=function($){var L=this.session.selection.cursor;this.addToken($,"composition_placeholder",L.row,L.column),this.$moveTextAreaToCursor()},M.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),a.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var $=this.session.selection.cursor;this.removeExtraToken($.row,$.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},M.prototype.setGhostText=function($,L){var C=this.session.selection.cursor,w=L||{row:C.row,column:C.column};this.removeGhostText();var S=this.$calculateWrappedTextChunks($,w);this.addToken(S[0].text,"ghost_text",w.row,w.column),this.$ghostText={text:$,position:{row:w.row,column:w.column}};var k=a.createElement("div");if(S.length>1){var _=this.hideTokensAfterPosition(w.row,w.column),F;S.slice(1).forEach(function(N){var W=a.createElement("div"),z=a.createElement("span");z.className="ace_ghost_text",N.wrapped&&(W.className="ghost_text_line_wrapped"),N.text.length===0&&(N.text=" "),z.appendChild(a.createTextNode(N.text)),W.appendChild(z),k.appendChild(W),F=W}),_.forEach(function(N){var W=a.createElement("span");E(N.type)||(W.className="ace_"+N.type.replace(/\./g," ace_")),W.appendChild(a.createTextNode(N.value)),F.appendChild(W)}),this.$ghostTextWidget={el:k,row:w.row,column:w.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var R=this.$cursorLayer.getPixelPosition(w,!0),O=this.container,V=O.getBoundingClientRect().height,P=S.length*this.lineHeight,H=P<V-R.top;if(H)return;P<V?this.scrollBy(0,(S.length-1)*this.lineHeight):this.scrollToRow(w.row)}},M.prototype.$calculateWrappedTextChunks=function($,L){var C=this.$size.scrollerWidth-this.$padding*2,w=Math.floor(C/this.characterWidth)-2;w=w<=0?60:w;for(var S=$.split(/\r?\n/),k=[],_=0;_<S.length;_++){var F=this.session.$getDisplayTokens(S[_],L.column),R=this.session.$computeWrapSplits(F,w,this.session.$tabSize);if(R.length>0){var O=0;R.push(S[_].length);for(var V=0;V<R.length;V++){var P=S[_].slice(O,R[V]);k.push({text:P,wrapped:!0}),O=R[V]}}else k.push({text:S[_],wrapped:!1})}return k},M.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}},M.prototype.addToken=function($,L,C,w){var S=this.session;S.bgTokenizer.lines[C]=null;var k={type:L,value:$},_=S.getTokens(C);if(w==null||!_.length)_.push(k);else for(var F=0,R=0;R<_.length;R++){var O=_[R];if(F+=O.value.length,w<=F){var V=O.value.length-(F-w),P=O.value.slice(0,V),H=O.value.slice(V);_.splice(R,1,{type:O.type,value:P},k,{type:O.type,value:H});break}}this.updateLines(C,C)},M.prototype.hideTokensAfterPosition=function($,L){for(var C=this.session.getTokens($),w=0,S=!1,k=[],_=0;_<C.length;_++){var F=C[_];if(w+=F.value.length,F.type!=="ghost_text"){if(S){k.push({type:F.type,value:F.value}),F.type="hidden_token";continue}w===L&&(S=!0)}}return this.updateLines($,$),k},M.prototype.removeExtraToken=function($,L){this.session.bgTokenizer.lines[$]=null,this.updateLines($,$)},M.prototype.setTheme=function($,L){var C=this;if(this.$themeId=$,C._dispatchEvent("themeChange",{theme:$}),!$||typeof $=="string"){var w=$||this.$options.theme.initialValue;o.loadModule(["theme",w],S)}else S($);function S(k){if(C.$themeId!=$)return L&&L();if(!k||!k.cssClass)throw new Error("couldn't load module "+$+" or it didn't call define");k.$id&&(C.$themeId=k.$id),a.importCssString(k.cssText,k.cssClass,C.container),C.theme&&a.removeCssClass(C.container,C.theme.cssClass);var _="padding"in k?k.padding:"padding"in(C.theme||{})?4:C.$padding;C.$padding&&_!=C.$padding&&C.setPadding(_),C.$theme=k.cssClass,C.theme=k,a.addCssClass(C.container,k.cssClass),a.setCssClass(C.container,"ace_dark",k.isDark),C.$size&&(C.$size.width=0,C.$updateSizeAsync()),C._dispatchEvent("themeLoaded",{theme:k}),L&&L(),y.isSafari&&C.scroller&&(C.scroller.style.background="red",C.scroller.style.background="")}},M.prototype.getTheme=function(){return this.$themeId},M.prototype.setStyle=function($,L){a.setCssClass(this.container,$,L!==!1)},M.prototype.unsetStyle=function($){a.removeCssClass(this.container,$)},M.prototype.setCursorStyle=function($){a.setStyle(this.scroller.style,"cursor",$)},M.prototype.setMouseCursor=function($){a.setStyle(this.scroller.style,"cursor",$)},M.prototype.attachToShadowRoot=function(){a.importCssString(x,"ace_editor.css",this.container)},M.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},M.prototype.$updateCustomScrollbar=function($){var L=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,$===!0?(this.scrollBarV=new g(this.container,this),this.scrollBarH=new f(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(C){L.$scrollAnimation||L.session.setScrollTop(C.data-L.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(C){L.$scrollAnimation||L.session.setScrollLeft(C.data-L.scrollMargin.left)}),this.$scrollDecorator=new D(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new c(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.addEventListener("scroll",function(C){L.$scrollAnimation||L.session.setScrollTop(C.data-L.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(C){L.$scrollAnimation||L.session.setScrollLeft(C.data-L.scrollMargin.left)}))},M.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var $=this;this.$resizeTimer=p.delayedCall(function(){$.destroyed||$.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(L){var C=L[0].contentRect.width,w=L[0].contentRect.height;Math.abs($.$size.width-C)>1||Math.abs($.$size.height-w)>1?$.$resizeTimer.delay():$.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},M}();T.prototype.CHANGE_CURSOR=1,T.prototype.CHANGE_MARKER=2,T.prototype.CHANGE_GUTTER=4,T.prototype.CHANGE_SCROLL=8,T.prototype.CHANGE_LINES=16,T.prototype.CHANGE_TEXT=32,T.prototype.CHANGE_SIZE=64,T.prototype.CHANGE_MARKER_BACK=128,T.prototype.CHANGE_MARKER_FRONT=256,T.prototype.CHANGE_FULL=512,T.prototype.CHANGE_H_SCROLL=1024,T.prototype.$changes=0,T.prototype.$padding=null,T.prototype.$frozen=!1,T.prototype.STEPS=8,i.implement(T.prototype,A),o.defineOptions(T.prototype,"renderer",{useResizeObserver:{set:function(M){!M&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):M&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(M){this.$textLayer.setShowInvisibles(M)&&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(M){typeof M=="number"&&(this.$printMarginColumn=M),this.$showPrintMargin=!!M,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(M){this.$gutter.style.display=M?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(M){this.$gutterLayer.$useSvgGutterIcons=M},initialValue:!1},showFoldedAnnotations:{set:function(M){this.$gutterLayer.$showFoldedAnnotations=M},initialValue:!1},fadeFoldWidgets:{set:function(M){a.setCssClass(this.$gutter,"ace_fade-fold-widgets",M)},initialValue:!1},showFoldWidgets:{set:function(M){this.$gutterLayer.setShowFoldWidgets(M),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(M){this.$textLayer.setDisplayIndentGuides(M)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(M){this.$textLayer.setHighlightIndentGuides(M)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(M){this.$gutterLayer.setHighlightGutterLine(M),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(M){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(M){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(M){typeof M=="number"&&(M=M+"px"),this.container.style.fontSize=M,this.updateFontSize()},initialValue:12},fontFamily:{set:function(M){this.container.style.fontFamily=M,this.updateFontSize()}},maxLines:{set:function(M){this.updateFull()}},minLines:{set:function(M){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(M){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(M){M=+M||0,this.$scrollPastEnd!=M&&(this.$scrollPastEnd=M,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(M){this.$gutterLayer.$fixedWidth=!!M,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(M){this.$updateCustomScrollbar(M)},initialValue:!1},theme:{set:function(M){this.setTheme(M)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!y.isMobile&&!y.isIE}}),n.VirtualRenderer=T}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(t,n,m){var i=t("../lib/oop"),a=t("../lib/net"),p=t("../lib/event_emitter").EventEmitter,o=t("../config");function h(u){var c="importScripts('"+a.qualifyURL(u)+"');";try{return new Blob([c],{type:"application/javascript"})}catch{var f=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,g=new f;return g.append(c),g.getBlob("application/javascript")}}function r(u){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(o.get("loadWorkerFromBlob")){var c=h(u),f=window.URL||window.webkitURL,g=f.createObjectURL(c);return new Worker(g)}return new Worker(u)}var s=function(u){u.postMessage||(u=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=u,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){i.implement(this,p),this.$createWorkerFromOldConfig=function(u,c,f,g,v){if(t.nameToUrl&&!t.toUrl&&(t.toUrl=t.nameToUrl),o.get("packaged")||!t.toUrl)g=g||o.moduleUrl(c,"worker");else{var b=this.$normalizePath;g=g||b(t.toUrl("ace/worker/worker.js",null,"_"));var A={};u.forEach(function(x){A[x]=b(t.toUrl(x,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=r(g),v&&this.send("importScripts",v),this.$worker.postMessage({init:!0,tlns:A,module:c,classname:f}),this.$worker},this.onMessage=function(u){var c=u.data;switch(c.type){case"event":this._signal(c.name,{data:c.data});break;case"call":var f=this.callbacks[c.id];f&&(f(c.data),delete this.callbacks[c.id]);break;case"error":this.reportError(c.data);break;case"log":window.console&&console.log&&console.log.apply(console,c.data);break}},this.reportError=function(u){window.console&&console.error&&console.error(u)},this.$normalizePath=function(u){return a.qualifyURL(u)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(u){u.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(u,c){this.$worker.postMessage({command:u,args:c})},this.call=function(u,c,f){if(f){var g=this.callbackId++;this.callbacks[g]=f,c.push(g)}this.send(u,c)},this.emit=function(u,c){try{c.data&&c.data.err&&(c.data.err={message:c.data.err.message,stack:c.data.err.stack,code:c.data.err.code}),this.$worker&&this.$worker.postMessage({event:u,data:{data:c.data}})}catch(f){console.error(f.stack)}},this.attachToDocument=function(u){this.$doc&&this.terminate(),this.$doc=u,this.call("setValue",[u.getValue()]),u.on("change",this.changeListener,!0)},this.changeListener=function(u){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),u.action=="insert"?this.deltaQueue.push(u.start,u.lines):this.deltaQueue.push(u.start,u.end)},this.$sendDeltaQueue=function(){var u=this.deltaQueue;u&&(this.deltaQueue=null,u.length>50&&u.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:u}))}}).call(s.prototype);var l=function(u,c,f){var g=null,v=!1,b=Object.create(p),A=[],x=new s({messageBuffer:A,terminate:function(){},postMessage:function(y){A.push(y),g&&(v?setTimeout(D):D())}});x.setEmitSync=function(y){v=y};var D=function(){var y=A.shift();y.command?g[y.command].apply(g,y.args):y.event&&b._signal(y.event,y.data)};return b.postMessage=function(y){x.onMessage({data:y})},b.callback=function(y,E){this.postMessage({type:"call",id:E,data:y})},b.emit=function(y,E){this.postMessage({type:"event",name:y,data:E})},o.loadModule(["worker",c],function(y){for(g=new y[f](b);A.length;)D()}),x};n.UIWorkerClient=l,n.WorkerClient=s,n.createWorker=r}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,n,m){var i=t("./range").Range,a=t("./lib/event_emitter").EventEmitter,p=t("./lib/oop"),o=function(){function h(r,s,l,u,c,f){var g=this;this.length=s,this.session=r,this.doc=r.getDocument(),this.mainClass=c,this.othersClass=f,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=u,this.$onCursorChange=function(){setTimeout(function(){g.onCursorChange()})},this.$pos=l;var v=r.getUndoManager().$undoStack||r.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=v.length,this.setup(),r.selection.on("changeCursor",this.$onCursorChange)}return h.prototype.setup=function(){var r=this,s=this.doc,l=this.session;this.selectionBefore=l.selection.toJSON(),l.selection.inMultiSelectMode&&l.selection.toSingleRange(),this.pos=s.createAnchor(this.$pos.row,this.$pos.column);var u=this.pos;u.$insertRight=!0,u.detach(),u.markerId=l.addMarker(new i(u.row,u.column,u.row,u.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(c){var f=s.createAnchor(c.row,c.column);f.$insertRight=!0,f.detach(),r.others.push(f)}),l.setUndoSelect(!1)},h.prototype.showOtherMarkers=function(){if(!this.othersActive){var r=this.session,s=this;this.othersActive=!0,this.others.forEach(function(l){l.markerId=r.addMarker(new i(l.row,l.column,l.row,l.column+s.length),s.othersClass,null,!1)})}},h.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var r=0;r<this.others.length;r++)this.session.removeMarker(this.others[r].markerId)}},h.prototype.onUpdate=function(r){if(this.$updating)return this.updateAnchors(r);var s=r;if(s.start.row===s.end.row&&s.start.row===this.pos.row){this.$updating=!0;var l=r.action==="insert"?s.end.column-s.start.column:s.start.column-s.end.column,u=s.start.column>=this.pos.column&&s.start.column<=this.pos.column+this.length+1,c=s.start.column-this.pos.column;if(this.updateAnchors(r),u&&(this.length+=l),u&&!this.session.$fromUndo){if(r.action==="insert")for(var f=this.others.length-1;f>=0;f--){var g=this.others[f],v={row:g.row,column:g.column+c};this.doc.insertMergedLines(v,r.lines)}else if(r.action==="remove")for(var f=this.others.length-1;f>=0;f--){var g=this.others[f],v={row:g.row,column:g.column+c};this.doc.remove(new i(v.row,v.column,v.row,v.column-l))}}this.$updating=!1,this.updateMarkers()}},h.prototype.updateAnchors=function(r){this.pos.onChange(r);for(var s=this.others.length;s--;)this.others[s].onChange(r);this.updateMarkers()},h.prototype.updateMarkers=function(){if(!this.$updating){var r=this,s=this.session,l=function(c,f){s.removeMarker(c.markerId),c.markerId=s.addMarker(new i(c.row,c.column,c.row,c.column+r.length),f,null,!1)};l(this.pos,this.mainClass);for(var u=this.others.length;u--;)l(this.others[u],this.othersClass)}},h.prototype.onCursorChange=function(r){if(!(this.$updating||!this.session)){var s=this.session.selection.getCursor();s.row===this.pos.row&&s.column>=this.pos.column&&s.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",r)):(this.hideOtherMarkers(),this._emit("cursorLeave",r))}},h.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},h.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var r=this.session.getUndoManager(),s=(r.$undoStack||r.$undostack).length-this.$undoStackDepth,l=0;l<s;l++)r.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},h}();p.implement(o.prototype,a),n.PlaceHolder=o}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,m){var i=t("../lib/event"),a=t("../lib/useragent");function p(h,r){return h.row==r.row&&h.column==r.column}function o(h){var r=h.domEvent,s=r.altKey,l=r.shiftKey,u=r.ctrlKey,c=h.getAccelKey(),f=h.getButton();if(u&&a.isMac&&(f=r.button),h.editor.inMultiSelectMode&&f==2){h.editor.textInput.onContextMenu(h.domEvent);return}if(!u&&!s&&!c){f===0&&h.editor.inMultiSelectMode&&h.editor.exitMultiSelectMode();return}if(f===0){var g=h.editor,v=g.selection,b=g.inMultiSelectMode,A=h.getDocumentPosition(),x=v.getCursor(),D=h.inSelection()||v.isEmpty()&&p(A,x),y=h.x,E=h.y,T=function(P){y=P.clientX,E=P.clientY},M=g.session,$=g.renderer.pixelToScreenCoordinates(y,E),L=$,C;if(g.$mouseHandler.$enableJumpToDef)u&&s||c&&s?C=l?"block":"add":s&&g.$blockSelectEnabled&&(C="block");else if(c&&!s){if(C="add",!b&&l)return}else s&&g.$blockSelectEnabled&&(C="block");if(C&&a.isMac&&r.ctrlKey&&g.$mouseHandler.cancelContextMenu(),C=="add"){if(!b&&D)return;if(!b){var w=v.toOrientedRange();g.addSelectionMarker(w)}var S=v.rangeList.rangeAtPoint(A);g.inVirtualSelectionMode=!0,l&&(S=null,w=v.ranges[0]||w,g.removeSelectionMarker(w)),g.once("mouseup",function(){var P=v.toOrientedRange();S&&P.isEmpty()&&p(S.cursor,P.cursor)?v.substractPoint(P.cursor):(l?v.substractPoint(w.cursor):w&&(g.removeSelectionMarker(w),v.addRange(w)),v.addRange(P)),g.inVirtualSelectionMode=!1})}else if(C=="block"){h.stop(),g.inVirtualSelectionMode=!0;var k,_=[],F=function(){var P=g.renderer.pixelToScreenCoordinates(y,E),H=M.screenToDocumentPosition(P.row,P.column,P.offsetX);p(L,P)&&p(H,v.lead)||(L=P,g.selection.moveToPosition(H),g.renderer.scrollCursorIntoView(),g.removeSelectionMarkers(_),_=v.rectangularRangeBlock(L,$),g.$mouseHandler.$clickSelection&&_.length==1&&_[0].isEmpty()&&(_[0]=g.$mouseHandler.$clickSelection.clone()),_.forEach(g.addSelectionMarker,g),g.updateSelectionMarkers())};b&&!c?v.toSingleRange():!b&&c&&(k=v.toOrientedRange(),g.addSelectionMarker(k)),l?$=M.documentToScreenPosition(v.lead):v.moveToPosition(A),L={row:-1,column:-1};var R=function(P){F(),clearInterval(V),g.removeSelectionMarkers(_),_.length||(_=[v.toOrientedRange()]),k&&(g.removeSelectionMarker(k),v.toSingleRange(k));for(var H=0;H<_.length;H++)v.addRange(_[H]);g.inVirtualSelectionMode=!1,g.$mouseHandler.$clickSelection=null},O=F;i.capture(g.container,T,R);var V=setInterval(function(){O()},20);return h.preventDefault()}}}n.onMouseDown=o}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(t,n,m){n.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(a){a.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(a){a.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(a){a.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(a){a.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(a){a.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(a){a.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(a){a.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(a){a.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(a){a.multiSelect.rangeCount>1?a.multiSelect.joinSelections():a.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(a){a.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(a){a.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(a){a.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],n.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(a){a.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(a){return a&&a.inMultiSelectMode}}];var i=t("../keyboard/hash_handler").HashHandler;n.keyboardHandler=new i(n.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(t,n,m){var i=t("./range_list").RangeList,a=t("./range").Range,p=t("./selection").Selection,o=t("./mouse/multi_select_handler").onMouseDown,h=t("./lib/event"),r=t("./lib/lang"),s=t("./commands/multi_select_commands");n.commands=s.defaultCommands.concat(s.multiSelectCommands);var l=t("./search").Search,u=new l;function c(x,D,y){return u.$options.wrap=!0,u.$options.needle=D,u.$options.backwards=y==-1,u.find(x)}var f=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(f.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(x,D){if(x){if(!this.inMultiSelectMode&&this.rangeCount===0){var y=this.toOrientedRange();if(this.rangeList.add(y),this.rangeList.add(x),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),D||this.fromOrientedRange(x);this.rangeList.removeAll(),this.rangeList.add(y),this.$onAddRange(y)}x.cursor||(x.cursor=x.end);var E=this.rangeList.add(x);return this.$onAddRange(x),E.length&&this.$onRemoveRange(E),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),D||this.fromOrientedRange(x)}},this.toSingleRange=function(x){x=x||this.ranges[0];var D=this.rangeList.removeAll();D.length&&this.$onRemoveRange(D),x&&this.fromOrientedRange(x)},this.substractPoint=function(x){var D=this.rangeList.substractPoint(x);if(D)return this.$onRemoveRange(D),D[0]},this.mergeOverlappingRanges=function(){var x=this.rangeList.merge();x.length&&this.$onRemoveRange(x)},this.$onAddRange=function(x){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(x),this._signal("addRange",{range:x})},this.$onRemoveRange=function(x){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var D=this.rangeList.ranges.pop();x.push(D),this.rangeCount=0}for(var y=x.length;y--;){var E=this.ranges.indexOf(x[y]);this.ranges.splice(E,1)}this._signal("removeRange",{ranges:x}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),D=D||this.ranges[0],D&&!D.isEqual(this.getRange())&&this.fromOrientedRange(D)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new i,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var x=this.ranges.length?this.ranges:[this.getRange()],D=[],y=0;y<x.length;y++){var E=x[y],T=E.start.row,M=E.end.row;if(T===M)D.push(E.clone());else{for(D.push(new a(T,E.start.column,T,this.session.getLine(T).length));++T<M;)D.push(this.getLineRange(T,!0));D.push(new a(M,0,M,E.end.column))}y==0&&!this.isBackwards()&&(D=D.reverse())}this.toSingleRange();for(var y=D.length;y--;)this.addRange(D[y])},this.joinSelections=function(){var x=this.rangeList.ranges,D=x[x.length-1],y=a.fromPoints(x[0].start,D.end);this.toSingleRange(),this.setSelectionRange(y,D.cursor==D.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var x=this.rangeList.ranges,D=x[x.length-1],y=a.fromPoints(x[0].start,D.end);this.toSingleRange(),this.setSelectionRange(y,D.cursor==D.start)}else{var E=this.session.documentToScreenPosition(this.cursor),T=this.session.documentToScreenPosition(this.anchor),M=this.rectangularRangeBlock(E,T);M.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(x,D,y){var E=[],T=x.column<D.column;if(T)var M=x.column,$=D.column,L=x.offsetX,C=D.offsetX;else var M=D.column,$=x.column,L=D.offsetX,C=x.offsetX;var w=x.row<D.row;if(w)var S=x.row,k=D.row;else var S=D.row,k=x.row;M<0&&(M=0),S<0&&(S=0),S==k&&(y=!0);for(var _,F=S;F<=k;F++){var R=a.fromPoints(this.session.screenToDocumentPosition(F,M,L),this.session.screenToDocumentPosition(F,$,C));if(R.isEmpty()){if(_&&v(R.end,_))break;_=R.end}R.cursor=T?R.start:R.end,E.push(R)}if(w&&E.reverse(),!y){for(var O=E.length-1;E[O].isEmpty()&&O>0;)O--;if(O>0)for(var V=0;E[V].isEmpty();)V++;for(var P=O;P>=V;P--)E[P].isEmpty()&&E.splice(P,1)}return E}}.call(p.prototype);var g=t("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(x){x.cursor||(x.cursor=x.end);var D=this.getSelectionStyle();return x.marker=this.session.addMarker(x,"ace_selection",D),this.session.$selectionMarkers.push(x),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,x},this.removeSelectionMarker=function(x){if(x.marker){this.session.removeMarker(x.marker);var D=this.session.$selectionMarkers.indexOf(x);D!=-1&&this.session.$selectionMarkers.splice(D,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(x){for(var D=this.session.$selectionMarkers,y=x.length;y--;){var E=x[y];if(E.marker){this.session.removeMarker(E.marker);var T=D.indexOf(E);T!=-1&&D.splice(T,1)}}this.session.selectionMarkerCount=D.length},this.$onAddRange=function(x){this.addSelectionMarker(x.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(x){this.removeSelectionMarkers(x.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(x){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(s.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(x){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(s.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(x){var D=x.command,y=x.editor;if(y.multiSelect){if(D.multiSelectAction)D.multiSelectAction=="forEach"?E=y.forEachSelection(D,x.args):D.multiSelectAction=="forEachLine"?E=y.forEachSelection(D,x.args,!0):D.multiSelectAction=="single"?(y.exitMultiSelectMode(),E=D.exec(y,x.args||{})):E=D.multiSelectAction(y,x.args||{});else{var E=D.exec(y,x.args||{});y.multiSelect.addRange(y.multiSelect.toOrientedRange()),y.multiSelect.mergeOverlappingRanges()}return E}},this.forEachSelection=function(x,D,y){if(!this.inVirtualSelectionMode){var E=y&&y.keepOrder,T=y==!0||y&&y.$byLines,M=this.session,$=this.selection,L=$.rangeList,C=(E?$:L).ranges,w;if(!C.length)return x.exec?x.exec(this,D||{}):x(this,D||{});var S=$._eventRegistry;$._eventRegistry={};var k=new p(M);this.inVirtualSelectionMode=!0;for(var _=C.length;_--;){if(T)for(;_>0&&C[_].start.row==C[_-1].end.row;)_--;k.fromOrientedRange(C[_]),k.index=_,this.selection=M.selection=k;var F=x.exec?x.exec(this,D||{}):x(this,D||{});!w&&F!==void 0&&(w=F),k.toOrientedRange(C[_])}k.detach(),this.selection=M.selection=$,this.inVirtualSelectionMode=!1,$._eventRegistry=S,$.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),w}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var x="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var D=this.multiSelect.rangeList.ranges,y=[],E=0;E<D.length;E++)y.push(this.session.getTextRange(D[E]));var T=this.session.getDocument().getNewLineCharacter();x=y.join(T),x.length==(y.length-1)*T.length&&(x="")}else this.selection.isEmpty()||(x=this.session.getTextRange(this.getSelectionRange()));return x},this.$checkMultiselectChange=function(x,D){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var y=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&D==this.multiSelect.anchor)return;var E=D==this.multiSelect.anchor?y.cursor==y.start?y.end:y.start:y.cursor;E.row!=D.row||this.session.$clipPositionToDocument(E.row,E.column).column!=D.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(x,D,y){if(D=D||{},D.needle=x||D.needle,D.needle==null){var E=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();D.needle=this.session.getTextRange(E)}this.$search.set(D);var T=this.$search.findAll(this.session);if(!T.length)return 0;var M=this.multiSelect;y||M.toSingleRange(T[0]);for(var $=T.length;$--;)M.addRange(T[$],!0);return E&&M.rangeList.rangeAtPoint(E.start)&&M.addRange(E,!0),T.length},this.selectMoreLines=function(x,D){var y=this.selection.toOrientedRange(),E=y.cursor==y.end,T=this.session.documentToScreenPosition(y.cursor);this.selection.$desiredColumn&&(T.column=this.selection.$desiredColumn);var M=this.session.screenToDocumentPosition(T.row+x,T.column);if(y.isEmpty())var L=M;else var $=this.session.documentToScreenPosition(E?y.end:y.start),L=this.session.screenToDocumentPosition($.row+x,$.column);if(E){var C=a.fromPoints(M,L);C.cursor=C.start}else{var C=a.fromPoints(L,M);C.cursor=C.end}if(C.desiredColumn=T.column,!this.selection.inMultiSelectMode)this.selection.addRange(y);else if(D)var w=y.cursor;this.selection.addRange(C),w&&this.selection.substractPoint(w)},this.transposeSelections=function(x){for(var D=this.session,y=D.multiSelect,E=y.ranges,T=E.length;T--;){var M=E[T];if(M.isEmpty()){var $=D.getWordRange(M.start.row,M.start.column);M.start.row=$.start.row,M.start.column=$.start.column,M.end.row=$.end.row,M.end.column=$.end.column}}y.mergeOverlappingRanges();for(var L=[],T=E.length;T--;){var M=E[T];L.unshift(D.getTextRange(M))}x<0?L.unshift(L.pop()):L.push(L.shift());for(var T=E.length;T--;){var M=E[T],C=M.clone();D.replace(M,L[T]),M.start.row=C.start.row,M.start.column=C.start.column}y.fromOrientedRange(y.ranges[0])},this.selectMore=function(x,D,y){var E=this.session,T=E.multiSelect,M=T.toOrientedRange();if(!(M.isEmpty()&&(M=E.getWordRange(M.start.row,M.start.column),M.cursor=x==-1?M.start:M.end,this.multiSelect.addRange(M),y))){var $=E.getTextRange(M),L=c(E,$,x);L&&(L.cursor=x==-1?L.start:L.end,this.session.unfold(L),this.multiSelect.addRange(L),this.renderer.scrollCursorIntoView(null,.5)),D&&this.multiSelect.substractPoint(M.cursor)}},this.alignCursors=function(){var x=this.session,D=x.multiSelect,y=D.ranges,E=-1,T=y.filter(function(O){if(O.cursor.row==E)return!0;E=O.cursor.row});if(!y.length||T.length==y.length-1){var M=this.selection.getRange(),$=M.start.row,L=M.end.row,C=$==L;if(C){var w=this.session.getLength(),S;do S=this.session.getLine(L);while(/[=:]/.test(S)&&++L<w);do S=this.session.getLine($);while(/[=:]/.test(S)&&--$>0);$<0&&($=0),L>=w&&(L=w-1)}var k=this.session.removeFullLines($,L);k=this.$reAlignText(k,C),this.session.insert({row:$,column:0},k.join(`
|
|
963
|
+
`)+`
|
|
964
|
+
`),C||(M.start.column=0,M.end.column=k[k.length-1].length),this.selection.setRange(M)}else{T.forEach(function(O){D.substractPoint(O.cursor)});var _=0,F=1/0,R=y.map(function(O){var V=O.cursor,P=x.getLine(V.row),H=P.substr(V.column).search(/\S/g);return H==-1&&(H=0),V.column>_&&(_=V.column),H<F&&(F=H),H});y.forEach(function(O,V){var P=O.cursor,H=_-P.column,N=R[V]-F;H>N?x.insert(P,r.stringRepeat(" ",H-N)):x.remove(new a(P.row,P.column,P.row,P.column-H+N)),O.start.column=O.end.column=_,O.start.row=O.end.row=P.row,O.cursor=O.end}),D.fromOrientedRange(y[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(x,D){var y=!0,E=!0,T,M,$;return x.map(function(k){var _=k.match(/(\s*)(.*?)(\s*)([=:].*)/);return _?T==null?(T=_[1].length,M=_[2].length,$=_[3].length,_):(T+M+$!=_[1].length+_[2].length+_[3].length&&(E=!1),T!=_[1].length&&(y=!1),T>_[1].length&&(T=_[1].length),M<_[2].length&&(M=_[2].length),$>_[3].length&&($=_[3].length),_):[k]}).map(D?C:y?E?w:C:S);function L(k){return r.stringRepeat(" ",k)}function C(k){return k[2]?L(T)+k[2]+L(M-k[2].length+$)+k[4].replace(/^([=:])\s+/,"$1 "):k[0]}function w(k){return k[2]?L(T+M-k[2].length)+k[2]+L($)+k[4].replace(/^([=:])\s+/,"$1 "):k[0]}function S(k){return k[2]?L(T)+k[2]+L($)+k[4].replace(/^([=:])\s+/,"$1 "):k[0]}}}).call(g.prototype);function v(x,D){return x.row==D.row&&x.column==D.column}n.onSessionChange=function(x){var D=x.session;D&&!D.multiSelect&&(D.$selectionMarkers=[],D.selection.$initRangeList(),D.multiSelect=D.selection),this.multiSelect=D&&D.multiSelect;var y=x.oldSession;y&&(y.multiSelect.off("addRange",this.$onAddRange),y.multiSelect.off("removeRange",this.$onRemoveRange),y.multiSelect.off("multiSelect",this.$onMultiSelect),y.multiSelect.off("singleSelect",this.$onSingleSelect),y.multiSelect.lead.off("change",this.$checkMultiselectChange),y.multiSelect.anchor.off("change",this.$checkMultiselectChange)),D&&(D.multiSelect.on("addRange",this.$onAddRange),D.multiSelect.on("removeRange",this.$onRemoveRange),D.multiSelect.on("multiSelect",this.$onMultiSelect),D.multiSelect.on("singleSelect",this.$onSingleSelect),D.multiSelect.lead.on("change",this.$checkMultiselectChange),D.multiSelect.anchor.on("change",this.$checkMultiselectChange)),D&&this.inMultiSelectMode!=D.selection.inMultiSelectMode&&(D.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function b(x){x.$multiselectOnSessionChange||(x.$onAddRange=x.$onAddRange.bind(x),x.$onRemoveRange=x.$onRemoveRange.bind(x),x.$onMultiSelect=x.$onMultiSelect.bind(x),x.$onSingleSelect=x.$onSingleSelect.bind(x),x.$multiselectOnSessionChange=n.onSessionChange.bind(x),x.$checkMultiselectChange=x.$checkMultiselectChange.bind(x),x.$multiselectOnSessionChange(x),x.on("changeSession",x.$multiselectOnSessionChange),x.on("mousedown",o),x.commands.addCommands(s.defaultCommands),A(x))}function A(x){if(!x.textInput)return;var D=x.textInput.getElement(),y=!1;h.addListener(D,"keydown",function(T){var M=T.keyCode==18&&!(T.ctrlKey||T.shiftKey||T.metaKey);x.$blockSelectEnabled&&M?y||(x.renderer.setMouseCursor("crosshair"),y=!0):y&&E()},x),h.addListener(D,"keyup",E,x),h.addListener(D,"blur",E,x);function E(T){y&&(x.renderer.setMouseCursor(""),y=!1)}}n.MultiSelect=b,t("./config").defineOptions(g.prototype,"editor",{enableMultiselect:{set:function(x){b(this),x?this.on("mousedown",o):this.off("mousedown",o)},value:!0},enableBlockSelect:{set:function(x){this.$blockSelectEnabled=x},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,n,m){var i=t("../../range").Range,a=n.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(p,o,h){var r=p.getLine(h);return this.foldingStartMarker.test(r)?"start":o=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(p,o,h){return null},this.indentationBlock=function(p,o,h){var r=/\S/,s=p.getLine(o),l=s.search(r);if(l!=-1){for(var u=h||s.length,c=p.getLength(),f=o,g=o;++o<c;){var v=p.getLine(o).search(r);if(v!=-1){if(v<=l){var b=p.getTokenAt(o,0);if(!b||b.type!=="string")break}g=o}}if(g>f){var A=p.getLine(g).length;return new i(f,u,g,A)}}},this.openingBracketBlock=function(p,o,h,r,s){var l={row:h,column:r+1},u=p.$findClosingBracket(o,l,s);if(u){var c=p.foldWidgets[u.row];return c==null&&(c=p.getFoldWidget(u.row)),c=="start"&&u.row>l.row&&(u.row--,u.column=p.getLine(u.row).length),i.fromPoints(l,u)}},this.closingBracketBlock=function(p,o,h,r,s){var l={row:h,column:r},u=p.$findOpeningBracket(o,l);if(u)return u.column++,l.column--,i.fromPoints(u,l)}}).call(a.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(t,n,m){var i=t("../lib/dom"),a=t("../range").Range,p=t("../config").nls;function o(r,s,l){for(var u=0,c=r.length-1;u<=c;){var f=u+c>>1,g=l(s,r[f]);if(g>0)u=f+1;else if(g<0)c=f-1;else return f}return-(u+1)}function h(r,s,l){var u=r.getAnnotations().sort(a.comparePoints);if(u.length){var c=o(u,{row:s,column:-1},a.comparePoints);c<0&&(c=-c-1),c>=u.length?c=l>0?0:u.length-1:c===0&&l<0&&(c=u.length-1);var f=u[c];if(!(!f||!l)){if(f.row===s){do f=u[c+=l];while(f&&f.row===s);if(!f)return u.slice()}var g=[];s=f.row;do g[l<0?"unshift":"push"](f),f=u[c+=l];while(f&&f.row==s);return g.length&&g}}}n.showErrorMarker=function(r,s){var l=r.session,u=r.getCursorPosition(),c=u.row,f=l.widgetManager.getWidgetsAtRow(c).filter(function(T){return T.type=="errorMarker"})[0];f?f.destroy():c-=s;var g=h(l,c,s),v;if(g){var b=g[0];u.column=(b.pos&&typeof b.column!="number"?b.pos.sc:b.column)||0,u.row=b.row,v=r.renderer.$gutterLayer.$annotations[u.row]}else{if(f)return;v={displayText:[p("error-marker.good-state","Looks good!")],className:"ace_ok"}}r.session.unfold(u.row),r.selection.moveToPosition(u);var A={row:u.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},x=A.el.appendChild(i.createElement("div")),D=A.el.appendChild(i.createElement("div"));D.className="error_widget_arrow "+v.className;var y=r.renderer.$cursorLayer.getPixelPosition(u).left;D.style.left=y+r.renderer.gutterWidth-5+"px",A.el.className="error_widget_wrapper",x.className="error_widget "+v.className,v.displayText.forEach(function(T,M){x.appendChild(i.createTextNode(T)),M<v.displayText.length-1&&x.appendChild(i.createElement("br"))}),x.appendChild(i.createElement("div"));var E=function(T,M,$){if(M===0&&($==="esc"||$==="return"))return A.destroy(),{command:"null"}};A.destroy=function(){r.$mouseHandler.isMousePressed||(r.keyBinding.removeKeyboardHandler(E),l.widgetManager.removeLineWidget(A),r.off("changeSelection",A.destroy),r.off("changeSession",A.destroy),r.off("mouseup",A.destroy),r.off("change",A.destroy))},r.keyBinding.addKeyboardHandler(E),r.on("changeSelection",A.destroy),r.on("changeSession",A.destroy),r.on("mouseup",A.destroy),r.on("change",A.destroy),r.session.widgetManager.addLineWidget(A),A.el.onmousedown=r.focus.bind(r),r.renderer.scrollCursorIntoView(null,.5,{bottom:A.el.offsetHeight})},i.importCssString(`
|
|
965
|
+
.error_widget_wrapper {
|
|
966
|
+
background: inherit;
|
|
967
|
+
color: inherit;
|
|
968
|
+
border:none
|
|
969
|
+
}
|
|
970
|
+
.error_widget {
|
|
971
|
+
border-top: solid 2px;
|
|
972
|
+
border-bottom: solid 2px;
|
|
973
|
+
margin: 5px 0;
|
|
974
|
+
padding: 10px 40px;
|
|
975
|
+
white-space: pre-wrap;
|
|
976
|
+
}
|
|
977
|
+
.error_widget.ace_error, .error_widget_arrow.ace_error{
|
|
978
|
+
border-color: #ff5a5a
|
|
979
|
+
}
|
|
980
|
+
.error_widget.ace_warning, .error_widget_arrow.ace_warning{
|
|
981
|
+
border-color: #F1D817
|
|
982
|
+
}
|
|
983
|
+
.error_widget.ace_info, .error_widget_arrow.ace_info{
|
|
984
|
+
border-color: #5a5a5a
|
|
985
|
+
}
|
|
986
|
+
.error_widget.ace_ok, .error_widget_arrow.ace_ok{
|
|
987
|
+
border-color: #5aaa5a
|
|
988
|
+
}
|
|
989
|
+
.error_widget_arrow {
|
|
990
|
+
position: absolute;
|
|
991
|
+
border: solid 5px;
|
|
992
|
+
border-top-color: transparent!important;
|
|
993
|
+
border-right-color: transparent!important;
|
|
994
|
+
border-left-color: transparent!important;
|
|
995
|
+
top: -5px;
|
|
996
|
+
}
|
|
997
|
+
`,"error_marker.css",!1)}),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(t,n,m){t("./loader_build")(n);var i=t("./lib/dom"),a=t("./range").Range,p=t("./editor").Editor,o=t("./edit_session").EditSession,h=t("./undomanager").UndoManager,r=t("./virtual_renderer").VirtualRenderer;t("./worker/worker_client"),t("./keyboard/hash_handler"),t("./placeholder"),t("./multi_select"),t("./mode/folding/fold_mode"),t("./theme/textmate"),t("./ext/error_marker"),n.config=t("./config"),n.edit=function(l,u){if(typeof l=="string"){var c=l;if(l=document.getElementById(c),!l)throw new Error("ace.edit can't find div #"+c)}if(l&&l.env&&l.env.editor instanceof p)return l.env.editor;var f="";if(l&&/input|textarea/i.test(l.tagName)){var g=l;f=g.value,l=i.createElement("pre"),g.parentNode.replaceChild(l,g)}else l&&(f=l.textContent,l.innerHTML="");var v=n.createEditSession(f),b=new p(new r(l),v,u),A={document:v,editor:b,onResize:b.resize.bind(b,null)};return g&&(A.textarea=g),b.on("destroy",function(){A.editor.container.env=null}),b.container.env=b.env=A,b},n.createEditSession=function(l,u){var c=new o(l,u);return c.setUndoManager(new h),c},n.Range=a,n.Editor=p,n.EditSession=o,n.UndoManager=h,n.VirtualRenderer=r;var s=n.config.version;n.version=s}),function(){ace.require(["ace/ace"],function(t){t&&(t.config.init(!0),t.define=ace.define);var n=function(){return this}();!n&&typeof window<"u"&&(n=window),!n&&typeof self<"u"&&(n=self),n.ace||(n.ace=t);for(var m in t)t.hasOwnProperty(m)&&(n.ace[m]=t[m]);n.ace.default=n.ace,d&&(d.exports=n.ace)})}()})(ha);var Ii=ha.exports,Li={exports:{}};Li.exports;(function(d,e){var t=200,n="__lodash_hash_undefined__",m=1,i=2,a=9007199254740991,p="[object Arguments]",o="[object Array]",h="[object AsyncFunction]",r="[object Boolean]",s="[object Date]",l="[object Error]",u="[object Function]",c="[object GeneratorFunction]",f="[object Map]",g="[object Number]",v="[object Null]",b="[object Object]",A="[object Promise]",x="[object Proxy]",D="[object RegExp]",y="[object Set]",E="[object String]",T="[object Symbol]",M="[object Undefined]",$="[object WeakMap]",L="[object ArrayBuffer]",C="[object DataView]",w="[object Float32Array]",S="[object Float64Array]",k="[object Int8Array]",_="[object Int16Array]",F="[object Int32Array]",R="[object Uint8Array]",O="[object Uint8ClampedArray]",V="[object Uint16Array]",P="[object Uint32Array]",H=/[\\^$.*+?()[\]{}|]/g,N=/^\[object .+?Constructor\]$/,W=/^(?:0|[1-9]\d*)$/,z={};z[w]=z[S]=z[k]=z[_]=z[F]=z[R]=z[O]=z[V]=z[P]=!0,z[p]=z[o]=z[L]=z[r]=z[C]=z[s]=z[l]=z[u]=z[f]=z[g]=z[b]=z[D]=z[y]=z[E]=z[$]=!1;var j=typeof gt=="object"&>&>.Object===Object&>,Q=typeof self=="object"&&self&&self.Object===Object&&self,Z=j||Q||Function("return this")(),q=e&&!e.nodeType&&e,ne=q&&!0&&d&&!d.nodeType&&d,se=ne&&ne.exports===q,pe=se&&j.process,ie=function(){try{return pe&&pe.binding&&pe.binding("util")}catch{}}(),de=ie&&ie.isTypedArray;function ue(U,te){for(var he=-1,we=U==null?0:U.length,Ye=0,$e=[];++he<we;){var qe=U[he];te(qe,he,U)&&($e[Ye++]=qe)}return $e}function le(U,te){for(var he=-1,we=te.length,Ye=U.length;++he<we;)U[Ye+he]=te[he];return U}function ae(U,te){for(var he=-1,we=U==null?0:U.length;++he<we;)if(te(U[he],he,U))return!0;return!1}function fe(U,te){for(var he=-1,we=Array(U);++he<U;)we[he]=te(he);return we}function me(U){return function(te){return U(te)}}function ve(U,te){return U.has(te)}function Ee(U,te){return U==null?void 0:U[te]}function Ge(U){var te=-1,he=Array(U.size);return U.forEach(function(we,Ye){he[++te]=[Ye,we]}),he}function nt(U,te){return function(he){return U(te(he))}}function dt(U){var te=-1,he=Array(U.size);return U.forEach(function(we){he[++te]=we}),he}var Ze=Array.prototype,re=Function.prototype,ye=Object.prototype,Ce=Z["__core-js_shared__"],ke=re.toString,Te=ye.hasOwnProperty,Ue=function(){var U=/[^.]+$/.exec(Ce&&Ce.keys&&Ce.keys.IE_PROTO||"");return U?"Symbol(src)_1."+U:""}(),Ke=ye.toString,ze=RegExp("^"+ke.call(Te).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=se?Z.Buffer:void 0,Ie=Z.Symbol,et=Z.Uint8Array,vt=ye.propertyIsEnumerable,Cn=Ze.splice,Pe=Ie?Ie.toStringTag:void 0,pt=Object.getOwnPropertySymbols,en=Be?Be.isBuffer:void 0,_t=nt(Object.keys,Object),Ji=Dn(Z,"DataView"),Nn=Dn(Z,"Map"),Qi=Dn(Z,"Promise"),Zi=Dn(Z,"Set"),Xi=Dn(Z,"WeakMap"),Bn=Dn(Object,"create"),Da=rn(Ji),Sa=rn(Nn),xa=rn(Qi),Ea=rn(Zi),Aa=rn(Xi),Gr=Ie?Ie.prototype:void 0,qi=Gr?Gr.valueOf:void 0;function tn(U){var te=-1,he=U==null?0:U.length;for(this.clear();++te<he;){var we=U[te];this.set(we[0],we[1])}}function Ta(){this.__data__=Bn?Bn(null):{},this.size=0}function ka(U){var te=this.has(U)&&delete this.__data__[U];return this.size-=te?1:0,te}function $a(U){var te=this.__data__;if(Bn){var he=te[U];return he===n?void 0:he}return Te.call(te,U)?te[U]:void 0}function Ma(U){var te=this.__data__;return Bn?te[U]!==void 0:Te.call(te,U)}function _a(U,te){var he=this.__data__;return this.size+=this.has(U)?0:1,he[U]=Bn&&te===void 0?n:te,this}tn.prototype.clear=Ta,tn.prototype.delete=ka,tn.prototype.get=$a,tn.prototype.has=Ma,tn.prototype.set=_a;function Rt(U){var te=-1,he=U==null?0:U.length;for(this.clear();++te<he;){var we=U[te];this.set(we[0],we[1])}}function Ia(){this.__data__=[],this.size=0}function La(U){var te=this.__data__,he=hi(te,U);if(he<0)return!1;var we=te.length-1;return he==we?te.pop():Cn.call(te,he,1),--this.size,!0}function Fa(U){var te=this.__data__,he=hi(te,U);return he<0?void 0:te[he][1]}function Ra(U){return hi(this.__data__,U)>-1}function Oa(U,te){var he=this.__data__,we=hi(he,U);return we<0?(++this.size,he.push([U,te])):he[we][1]=te,this}Rt.prototype.clear=Ia,Rt.prototype.delete=La,Rt.prototype.get=Fa,Rt.prototype.has=Ra,Rt.prototype.set=Oa;function nn(U){var te=-1,he=U==null?0:U.length;for(this.clear();++te<he;){var we=U[te];this.set(we[0],we[1])}}function Pa(){this.size=0,this.__data__={hash:new tn,map:new(Nn||Rt),string:new tn}}function Na(U){var te=di(this,U).delete(U);return this.size-=te?1:0,te}function Ba(U){return di(this,U).get(U)}function Va(U){return di(this,U).has(U)}function Wa(U,te){var he=di(this,U),we=he.size;return he.set(U,te),this.size+=he.size==we?0:1,this}nn.prototype.clear=Pa,nn.prototype.delete=Na,nn.prototype.get=Ba,nn.prototype.has=Va,nn.prototype.set=Wa;function ui(U){var te=-1,he=U==null?0:U.length;for(this.__data__=new nn;++te<he;)this.add(U[te])}function Ha(U){return this.__data__.set(U,n),this}function ja(U){return this.__data__.has(U)}ui.prototype.add=ui.prototype.push=Ha,ui.prototype.has=ja;function jt(U){var te=this.__data__=new Rt(U);this.size=te.size}function za(){this.__data__=new Rt,this.size=0}function Ua(U){var te=this.__data__,he=te.delete(U);return this.size=te.size,he}function Ga(U){return this.__data__.get(U)}function Ka(U){return this.__data__.has(U)}function Ya(U,te){var he=this.__data__;if(he instanceof Rt){var we=he.__data__;if(!Nn||we.length<t-1)return we.push([U,te]),this.size=++he.size,this;he=this.__data__=new nn(we)}return he.set(U,te),this.size=he.size,this}jt.prototype.clear=za,jt.prototype.delete=Ua,jt.prototype.get=Ga,jt.prototype.has=Ka,jt.prototype.set=Ya;function Ja(U,te){var he=pi(U),we=!he&&ul(U),Ye=!he&&!we&&er(U),$e=!he&&!we&&!Ye&&ts(U),qe=he||we||Ye||$e,it=qe?fe(U.length,String):[],ot=it.length;for(var Xe in U)Te.call(U,Xe)&&!(qe&&(Xe=="length"||Ye&&(Xe=="offset"||Xe=="parent")||$e&&(Xe=="buffer"||Xe=="byteLength"||Xe=="byteOffset")||sl(Xe,ot)))&&it.push(Xe);return it}function hi(U,te){for(var he=U.length;he--;)if(Zr(U[he][0],te))return he;return-1}function Qa(U,te,he){var we=te(U);return pi(U)?we:le(we,he(U))}function Vn(U){return U==null?U===void 0?M:v:Pe&&Pe in Object(U)?il(U):cl(U)}function Kr(U){return Wn(U)&&Vn(U)==p}function Yr(U,te,he,we,Ye){return U===te?!0:U==null||te==null||!Wn(U)&&!Wn(te)?U!==U&&te!==te:Za(U,te,he,we,Yr,Ye)}function Za(U,te,he,we,Ye,$e){var qe=pi(U),it=pi(te),ot=qe?o:zt(U),Xe=it?o:zt(te);ot=ot==p?b:ot,Xe=Xe==p?b:Xe;var ft=ot==b,St=Xe==b,at=ot==Xe;if(at&&er(U)){if(!er(te))return!1;qe=!0,ft=!1}if(at&&!ft)return $e||($e=new jt),qe||ts(U)?Jr(U,te,he,we,Ye,$e):tl(U,te,ot,he,we,Ye,$e);if(!(he&m)){var yt=ft&&Te.call(U,"__wrapped__"),bt=St&&Te.call(te,"__wrapped__");if(yt||bt){var Ut=yt?U.value():U,Ot=bt?te.value():te;return $e||($e=new jt),Ye(Ut,Ot,he,we,$e)}}return at?($e||($e=new jt),nl(U,te,he,we,Ye,$e)):!1}function Xa(U){if(!es(U)||al(U))return!1;var te=Xr(U)?ze:N;return te.test(rn(U))}function qa(U){return Wn(U)&&qr(U.length)&&!!z[Vn(U)]}function el(U){if(!ll(U))return _t(U);var te=[];for(var he in Object(U))Te.call(U,he)&&he!="constructor"&&te.push(he);return te}function Jr(U,te,he,we,Ye,$e){var qe=he&m,it=U.length,ot=te.length;if(it!=ot&&!(qe&&ot>it))return!1;var Xe=$e.get(U);if(Xe&&$e.get(te))return Xe==te;var ft=-1,St=!0,at=he&i?new ui:void 0;for($e.set(U,te),$e.set(te,U);++ft<it;){var yt=U[ft],bt=te[ft];if(we)var Ut=qe?we(bt,yt,ft,te,U,$e):we(yt,bt,ft,U,te,$e);if(Ut!==void 0){if(Ut)continue;St=!1;break}if(at){if(!ae(te,function(Ot,sn){if(!ve(at,sn)&&(yt===Ot||Ye(yt,Ot,he,we,$e)))return at.push(sn)})){St=!1;break}}else if(!(yt===bt||Ye(yt,bt,he,we,$e))){St=!1;break}}return $e.delete(U),$e.delete(te),St}function tl(U,te,he,we,Ye,$e,qe){switch(he){case C:if(U.byteLength!=te.byteLength||U.byteOffset!=te.byteOffset)return!1;U=U.buffer,te=te.buffer;case L:return!(U.byteLength!=te.byteLength||!$e(new et(U),new et(te)));case r:case s:case g:return Zr(+U,+te);case l:return U.name==te.name&&U.message==te.message;case D:case E:return U==te+"";case f:var it=Ge;case y:var ot=we&m;if(it||(it=dt),U.size!=te.size&&!ot)return!1;var Xe=qe.get(U);if(Xe)return Xe==te;we|=i,qe.set(U,te);var ft=Jr(it(U),it(te),we,Ye,$e,qe);return qe.delete(U),ft;case T:if(qi)return qi.call(U)==qi.call(te)}return!1}function nl(U,te,he,we,Ye,$e){var qe=he&m,it=Qr(U),ot=it.length,Xe=Qr(te),ft=Xe.length;if(ot!=ft&&!qe)return!1;for(var St=ot;St--;){var at=it[St];if(!(qe?at in te:Te.call(te,at)))return!1}var yt=$e.get(U);if(yt&&$e.get(te))return yt==te;var bt=!0;$e.set(U,te),$e.set(te,U);for(var Ut=qe;++St<ot;){at=it[St];var Ot=U[at],sn=te[at];if(we)var ns=qe?we(sn,Ot,at,te,U,$e):we(Ot,sn,at,U,te,$e);if(!(ns===void 0?Ot===sn||Ye(Ot,sn,he,we,$e):ns)){bt=!1;break}Ut||(Ut=at=="constructor")}if(bt&&!Ut){var fi=U.constructor,mi=te.constructor;fi!=mi&&"constructor"in U&&"constructor"in te&&!(typeof fi=="function"&&fi instanceof fi&&typeof mi=="function"&&mi instanceof mi)&&(bt=!1)}return $e.delete(U),$e.delete(te),bt}function Qr(U){return Qa(U,pl,rl)}function di(U,te){var he=U.__data__;return ol(te)?he[typeof te=="string"?"string":"hash"]:he.map}function Dn(U,te){var he=Ee(U,te);return Xa(he)?he:void 0}function il(U){var te=Te.call(U,Pe),he=U[Pe];try{U[Pe]=void 0;var we=!0}catch{}var Ye=Ke.call(U);return we&&(te?U[Pe]=he:delete U[Pe]),Ye}var rl=pt?function(U){return U==null?[]:(U=Object(U),ue(pt(U),function(te){return vt.call(U,te)}))}:fl,zt=Vn;(Ji&&zt(new Ji(new ArrayBuffer(1)))!=C||Nn&&zt(new Nn)!=f||Qi&&zt(Qi.resolve())!=A||Zi&&zt(new Zi)!=y||Xi&&zt(new Xi)!=$)&&(zt=function(U){var te=Vn(U),he=te==b?U.constructor:void 0,we=he?rn(he):"";if(we)switch(we){case Da:return C;case Sa:return f;case xa:return A;case Ea:return y;case Aa:return $}return te});function sl(U,te){return te=te??a,!!te&&(typeof U=="number"||W.test(U))&&U>-1&&U%1==0&&U<te}function ol(U){var te=typeof U;return te=="string"||te=="number"||te=="symbol"||te=="boolean"?U!=="__proto__":U===null}function al(U){return!!Ue&&Ue in U}function ll(U){var te=U&&U.constructor,he=typeof te=="function"&&te.prototype||ye;return U===he}function cl(U){return Ke.call(U)}function rn(U){if(U!=null){try{return ke.call(U)}catch{}try{return U+""}catch{}}return""}function Zr(U,te){return U===te||U!==U&&te!==te}var ul=Kr(function(){return arguments}())?Kr:function(U){return Wn(U)&&Te.call(U,"callee")&&!vt.call(U,"callee")},pi=Array.isArray;function hl(U){return U!=null&&qr(U.length)&&!Xr(U)}var er=en||ml;function dl(U,te){return Yr(U,te)}function Xr(U){if(!es(U))return!1;var te=Vn(U);return te==u||te==c||te==h||te==x}function qr(U){return typeof U=="number"&&U>-1&&U%1==0&&U<=a}function es(U){var te=typeof U;return U!=null&&(te=="object"||te=="function")}function Wn(U){return U!=null&&typeof U=="object"}var ts=de?me(de):qa;function pl(U){return hl(U)?Ja(U):el(U)}function fl(){return[]}function ml(){return!1}d.exports=dl})(Li,Li.exports);var da=Li.exports,kt={};Object.defineProperty(kt,"__esModule",{value:!0});kt.getAceInstance=kt.debounce=kt.editorEvents=kt.editorOptions=void 0;var Lm=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"];kt.editorOptions=Lm;var Fm=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"];kt.editorEvents=Fm;var Rm=function(){var d;return typeof window>"u"?(gt.window={},d=Ii,delete gt.window):window.ace?(d=window.ace,d.acequire=window.ace.require||window.ace.acequire):d=Ii,d};kt.getAceInstance=Rm;var Om=function(d,e){var t=null;return function(){var n=this,m=arguments;clearTimeout(t),t=setTimeout(function(){d.apply(n,m)},e)}};kt.debounce=Om;var Pm=mn&&mn.__extends||function(){var d=function(e,t){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,m){n.__proto__=m}||function(n,m){for(var i in m)Object.prototype.hasOwnProperty.call(m,i)&&(n[i]=m[i])},d(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");d(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),xr=mn&&mn.__assign||function(){return xr=Object.assign||function(d){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var m in e)Object.prototype.hasOwnProperty.call(e,m)&&(d[m]=e[m])}return d},xr.apply(this,arguments)};Object.defineProperty(mn,"__esModule",{value:!0});var Nm=Ii,De=Tr,Ms=J,Di=da,Tn=kt,_s=(0,Tn.getAceInstance)(),Bm=function(d){Pm(e,d);function e(t){var n=d.call(this,t)||this;return Tn.editorEvents.forEach(function(m){n[m]=n[m].bind(n)}),n.debounce=Tn.debounce,n}return e.prototype.isInShadow=function(t){for(var n=t&&t.parentNode;n;){if(n.toString()==="[object ShadowRoot]")return!0;n=n.parentNode}return!1},e.prototype.componentDidMount=function(){var t=this,n=this.props,m=n.className,i=n.onBeforeLoad,a=n.onValidate,p=n.mode,o=n.focus,h=n.theme,r=n.fontSize,s=n.lineHeight,l=n.value,u=n.defaultValue,c=n.showGutter,f=n.wrapEnabled,g=n.showPrintMargin,v=n.scrollMargin,b=v===void 0?[0,0,0,0]:v,A=n.keyboardHandler,x=n.onLoad,D=n.commands,y=n.annotations,E=n.markers,T=n.placeholder;this.editor=_s.edit(this.refEditor),i&&i(_s);for(var M=Object.keys(this.props.editorProps),$=0;$<M.length;$++)this.editor[M[$]]=this.props.editorProps[M[$]];this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),this.editor.renderer.setScrollMargin(b[0],b[1],b[2],b[3]),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.getSession().setMode(typeof p=="string"?"ace/mode/".concat(p):p),h&&h!==""&&this.editor.setTheme("ace/theme/".concat(h)),this.editor.setFontSize(typeof r=="number"?"".concat(r,"px"):r),s&&(this.editor.container.style.lineHeight=typeof s=="number"?"".concat(s,"px"):"".concat(s),this.editor.renderer.updateFontSize()),this.editor.getSession().setValue(u||l||""),this.props.navigateToFileEnd&&this.editor.navigateFileEnd(),this.editor.renderer.setShowGutter(c),this.editor.getSession().setUseWrapMode(f),this.editor.setShowPrintMargin(g),this.editor.on("focus",this.onFocus),this.editor.on("blur",this.onBlur),this.editor.on("copy",this.onCopy),this.editor.on("paste",this.onPaste),this.editor.on("change",this.onChange),this.editor.on("input",this.onInput),T&&this.updatePlaceholder(),this.editor.getSession().selection.on("changeSelection",this.onSelectionChange),this.editor.getSession().selection.on("changeCursor",this.onCursorChange),a&&this.editor.getSession().on("changeAnnotation",function(){var C=t.editor.getSession().getAnnotations();t.props.onValidate(C)}),this.editor.session.on("changeScrollTop",this.onScroll),this.editor.getSession().setAnnotations(y||[]),E&&E.length>0&&this.handleMarkers(E);var L=this.editor.$options;Tn.editorOptions.forEach(function(C){L.hasOwnProperty(C)?t.editor.setOption(C,t.props[C]):t.props[C]&&console.warn("ReactAce: editor option ".concat(C," 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(D)&&D.forEach(function(C){typeof C.exec=="string"?t.editor.commands.bindKey(C.bindKey,C.exec):t.editor.commands.addCommand(C)}),A&&this.editor.setKeyboardHandler("ace/keyboard/"+A),m&&(this.refEditor.className+=" "+m),x&&x(this.editor),this.editor.resize(),o&&this.editor.focus()},e.prototype.componentDidUpdate=function(t){for(var n=t,m=this.props,i=0;i<Tn.editorOptions.length;i++){var a=Tn.editorOptions[i];m[a]!==n[a]&&this.editor.setOption(a,m[a])}if(m.className!==n.className){var p=this.refEditor.className,o=p.trim().split(" "),h=n.className.trim().split(" ");h.forEach(function(l){var u=o.indexOf(l);o.splice(u,1)}),this.refEditor.className=" "+m.className+" "+o.join(" ")}var r=this.editor&&m.value!=null&&this.editor.getValue()!==m.value;if(r){this.silent=!0;var s=this.editor.session.selection.toJSON();this.editor.setValue(m.value,m.cursorStart),this.editor.session.selection.fromJSON(s),this.silent=!1}m.placeholder!==n.placeholder&&this.updatePlaceholder(),m.mode!==n.mode&&this.editor.getSession().setMode(typeof m.mode=="string"?"ace/mode/".concat(m.mode):m.mode),m.theme!==n.theme&&this.editor.setTheme("ace/theme/"+m.theme),m.keyboardHandler!==n.keyboardHandler&&(m.keyboardHandler?this.editor.setKeyboardHandler("ace/keyboard/"+m.keyboardHandler):this.editor.setKeyboardHandler(null)),m.fontSize!==n.fontSize&&this.editor.setFontSize(typeof m.fontSize=="number"?"".concat(m.fontSize,"px"):m.fontSize),m.lineHeight!==n.lineHeight&&(this.editor.container.style.lineHeight=typeof m.lineHeight=="number"?"".concat(m.lineHeight,"px"):m.lineHeight,this.editor.renderer.updateFontSize()),m.wrapEnabled!==n.wrapEnabled&&this.editor.getSession().setUseWrapMode(m.wrapEnabled),m.showPrintMargin!==n.showPrintMargin&&this.editor.setShowPrintMargin(m.showPrintMargin),m.showGutter!==n.showGutter&&this.editor.renderer.setShowGutter(m.showGutter),Di(m.setOptions,n.setOptions)||this.handleOptions(m),(r||!Di(m.annotations,n.annotations))&&this.editor.getSession().setAnnotations(m.annotations||[]),!Di(m.markers,n.markers)&&Array.isArray(m.markers)&&this.handleMarkers(m.markers),Di(m.scrollMargin,n.scrollMargin)||this.handleScrollMargins(m.scrollMargin),(t.height!==this.props.height||t.width!==this.props.width)&&this.editor.resize(),this.props.focus&&!t.focus&&this.editor.focus()},e.prototype.handleScrollMargins=function(t){t===void 0&&(t=[0,0,0,0]),this.editor.renderer.setScrollMargin(t[0],t[1],t[2],t[3])},e.prototype.componentWillUnmount=function(){this.editor&&(this.editor.destroy(),this.editor=null)},e.prototype.onChange=function(t){if(this.editor&&this.props.onChange&&!this.silent){var n=this.editor.getValue();this.props.onChange(n,t)}},e.prototype.onSelectionChange=function(t){if(this.props.onSelectionChange){var n=this.editor.getSelection();this.props.onSelectionChange(n,t)}},e.prototype.onCursorChange=function(t){if(this.props.onCursorChange){var n=this.editor.getSelection();this.props.onCursorChange(n,t)}},e.prototype.onInput=function(t){this.props.onInput&&this.props.onInput(t),this.props.placeholder&&this.updatePlaceholder()},e.prototype.onFocus=function(t){this.props.onFocus&&this.props.onFocus(t,this.editor)},e.prototype.onBlur=function(t){this.props.onBlur&&this.props.onBlur(t,this.editor)},e.prototype.onCopy=function(t){var n=t.text;this.props.onCopy&&this.props.onCopy(n)},e.prototype.onPaste=function(t){var n=t.text;this.props.onPaste&&this.props.onPaste(n)},e.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},e.prototype.handleOptions=function(t){for(var n=Object.keys(t.setOptions),m=0;m<n.length;m++)this.editor.setOption(n[m],t.setOptions[n[m]])},e.prototype.handleMarkers=function(t){var n=this,m=this.editor.getSession().getMarkers(!0);for(var i in m)m.hasOwnProperty(i)&&this.editor.getSession().removeMarker(m[i].id);m=this.editor.getSession().getMarkers(!1);for(var i in m)m.hasOwnProperty(i)&&m[i].clazz!=="ace_active-line"&&m[i].clazz!=="ace_selected-word"&&this.editor.getSession().removeMarker(m[i].id);t.forEach(function(a){var p=a.startRow,o=a.startCol,h=a.endRow,r=a.endCol,s=a.className,l=a.type,u=a.inFront,c=u===void 0?!1:u,f=new Nm.Range(p,o,h,r);n.editor.getSession().addMarker(f,s,l,c)})},e.prototype.updatePlaceholder=function(){var t=this.editor,n=this.props.placeholder,m=!t.session.getValue().length,i=t.renderer.placeholderNode;!m&&i?(t.renderer.scroller.removeChild(t.renderer.placeholderNode),t.renderer.placeholderNode=null):m&&!i?(i=t.renderer.placeholderNode=document.createElement("div"),i.textContent=n||"",i.className="ace_comment ace_placeholder",i.style.padding="0 9px",i.style.position="absolute",i.style.zIndex="3",t.renderer.scroller.appendChild(i)):m&&i&&(i.textContent=n)},e.prototype.updateRef=function(t){this.refEditor=t},e.prototype.render=function(){var t=this.props,n=t.name,m=t.width,i=t.height,a=t.style,p=xr({width:m,height:i},a);return Ms.createElement("div",{ref:this.updateRef,id:n,style:p})},e.propTypes={mode:De.oneOfType([De.string,De.object]),focus:De.bool,theme:De.string,name:De.string,className:De.string,height:De.string,width:De.string,fontSize:De.oneOfType([De.number,De.string]),lineHeight:De.oneOfType([De.number,De.string]),showGutter:De.bool,onChange:De.func,onCopy:De.func,onPaste:De.func,onFocus:De.func,onInput:De.func,onBlur:De.func,onScroll:De.func,value:De.string,defaultValue:De.string,onLoad:De.func,onSelectionChange:De.func,onCursorChange:De.func,onBeforeLoad:De.func,onValidate:De.func,minLines:De.number,maxLines:De.number,readOnly:De.bool,highlightActiveLine:De.bool,tabSize:De.number,showPrintMargin:De.bool,cursorStart:De.number,debounceChangePeriod:De.number,editorProps:De.object,setOptions:De.object,style:De.object,scrollMargin:De.array,annotations:De.array,markers:De.array,keyboardHandler:De.string,wrapEnabled:De.bool,enableSnippets:De.bool,enableBasicAutocompletion:De.oneOfType([De.bool,De.array]),enableLiveAutocompletion:De.oneOfType([De.bool,De.array]),navigateToFileEnd:De.bool,commands:De.array,placeholder:De.string},e.defaultProps={name:"ace-editor",focus:!1,mode:"",theme:"",height:"500px",width:"500px",fontSize:12,enableSnippets:!1,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,placeholder:null,navigateToFileEnd:!0},e}(Ms.Component);mn.default=Bm;var ri={},Zt={},pa={exports:{}};(function(d,e){ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(t,n,m){var i=t("./lib/oop");t("./lib/lang");var a=t("./lib/event_emitter").EventEmitter,p=t("./editor").Editor,o=t("./virtual_renderer").VirtualRenderer,h=t("./edit_session").EditSession,r;r=function(s,l,u){this.BELOW=1,this.BESIDE=0,this.$container=s,this.$theme=l,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(u||1),this.$cEditor=this.$editors[0],this.on("focus",function(c){this.$cEditor=c}.bind(this))},function(){i.implement(this,a),this.$createEditor=function(){var s=document.createElement("div");s.className=this.$editorCSS,s.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(s);var l=new p(new o(s,this.$theme));return l.on("focus",function(){this._emit("focus",l)}.bind(this)),this.$editors.push(l),l.setFontSize(this.$fontSize),l},this.setSplits=function(s){var l;if(s<1)throw"The number of splits have to be > 0!";if(s!=this.$splits){if(s>this.$splits){for(;this.$splits<this.$editors.length&&this.$splits<s;)l=this.$editors[this.$splits],this.$container.appendChild(l.container),l.setFontSize(this.$fontSize),this.$splits++;for(;this.$splits<s;)this.$createEditor(),this.$splits++}else for(;this.$splits>s;)l=this.$editors[this.$splits-1],this.$container.removeChild(l.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(s){return this.$editors[s]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(s){this.$editors.forEach(function(l){l.setTheme(s)})},this.setKeyboardHandler=function(s){this.$editors.forEach(function(l){l.setKeyboardHandler(s)})},this.forEach=function(s,l){this.$editors.forEach(s,l)},this.$fontSize="",this.setFontSize=function(s){this.$fontSize=s,this.forEach(function(l){l.setFontSize(s)})},this.$cloneSession=function(s){var l=new h(s.getDocument(),s.getMode()),u=s.getUndoManager();return l.setUndoManager(u),l.setTabSize(s.getTabSize()),l.setUseSoftTabs(s.getUseSoftTabs()),l.setOverwrite(s.getOverwrite()),l.setBreakpoints(s.getBreakpoints()),l.setUseWrapMode(s.getUseWrapMode()),l.setUseWorker(s.getUseWorker()),l.setWrapLimitRange(s.$wrapLimitRange.min,s.$wrapLimitRange.max),l.$foldData=s.$cloneFoldData(),l},this.setSession=function(s,l){var u;l==null?u=this.$cEditor:u=this.$editors[l];var c=this.$editors.some(function(f){return f.session===s});return c&&(s=this.$cloneSession(s)),u.setSession(s),s},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(s){this.$orientation!=s&&(this.$orientation=s,this.resize())},this.resize=function(){var s=this.$container.clientWidth,l=this.$container.clientHeight,u;if(this.$orientation==this.BESIDE)for(var c=s/this.$splits,f=0;f<this.$splits;f++)u=this.$editors[f],u.container.style.width=c+"px",u.container.style.top="0px",u.container.style.left=f*c+"px",u.container.style.height=l+"px",u.resize();else for(var g=l/this.$splits,f=0;f<this.$splits;f++)u=this.$editors[f],u.container.style.width=s+"px",u.container.style.top=f*g+"px",u.container.style.left="0px",u.container.style.height=g+"px",u.resize()}}.call(r.prototype),n.Split=r}),ace.define("ace/ext/split",["require","exports","module","ace/split"],function(t,n,m){m.exports=t("../split")}),function(){ace.require(["ace/ext/split"],function(t){d&&(d.exports=t)})}()})(pa);var Vm=pa.exports,Wm="Expected a function",fa="__lodash_hash_undefined__",Hm="[object Function]",jm="[object GeneratorFunction]",zm="[object Symbol]",Um=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gm=/^\w*$/,Km=/^\./,Ym=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jm=/[\\^$.*+?()[\]{}|]/g,Qm=/\\(\\)?/g,Zm=/^\[object .+?Constructor\]$/,Xm=typeof gt=="object"&>&>.Object===Object&>,qm=typeof self=="object"&&self&&self.Object===Object&&self,Hr=Xm||qm||Function("return this")();function eg(d,e){return d==null?void 0:d[e]}function tg(d){var e=!1;if(d!=null&&typeof d.toString!="function")try{e=!!(d+"")}catch{}return e}var ng=Array.prototype,ig=Function.prototype,ma=Object.prototype,cr=Hr["__core-js_shared__"],Is=function(){var d=/[^.]+$/.exec(cr&&cr.keys&&cr.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),ga=ig.toString,jr=ma.hasOwnProperty,va=ma.toString,rg=RegExp("^"+ga.call(jr).replace(Jm,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ls=Hr.Symbol,sg=ng.splice,og=ya(Hr,"Map"),si=ya(Object,"create"),Fs=Ls?Ls.prototype:void 0,Rs=Fs?Fs.toString:void 0;function gn(d){var e=-1,t=d?d.length:0;for(this.clear();++e<t;){var n=d[e];this.set(n[0],n[1])}}function ag(){this.__data__=si?si(null):{}}function lg(d){return this.has(d)&&delete this.__data__[d]}function cg(d){var e=this.__data__;if(si){var t=e[d];return t===fa?void 0:t}return jr.call(e,d)?e[d]:void 0}function ug(d){var e=this.__data__;return si?e[d]!==void 0:jr.call(e,d)}function hg(d,e){var t=this.__data__;return t[d]=si&&e===void 0?fa:e,this}gn.prototype.clear=ag;gn.prototype.delete=lg;gn.prototype.get=cg;gn.prototype.has=ug;gn.prototype.set=hg;function Pn(d){var e=-1,t=d?d.length:0;for(this.clear();++e<t;){var n=d[e];this.set(n[0],n[1])}}function dg(){this.__data__=[]}function pg(d){var e=this.__data__,t=Ki(e,d);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():sg.call(e,t,1),!0}function fg(d){var e=this.__data__,t=Ki(e,d);return t<0?void 0:e[t][1]}function mg(d){return Ki(this.__data__,d)>-1}function gg(d,e){var t=this.__data__,n=Ki(t,d);return n<0?t.push([d,e]):t[n][1]=e,this}Pn.prototype.clear=dg;Pn.prototype.delete=pg;Pn.prototype.get=fg;Pn.prototype.has=mg;Pn.prototype.set=gg;function bn(d){var e=-1,t=d?d.length:0;for(this.clear();++e<t;){var n=d[e];this.set(n[0],n[1])}}function vg(){this.__data__={hash:new gn,map:new(og||Pn),string:new gn}}function yg(d){return Yi(this,d).delete(d)}function bg(d){return Yi(this,d).get(d)}function wg(d){return Yi(this,d).has(d)}function Cg(d,e){return Yi(this,d).set(d,e),this}bn.prototype.clear=vg;bn.prototype.delete=yg;bn.prototype.get=bg;bn.prototype.has=wg;bn.prototype.set=Cg;function Ki(d,e){for(var t=d.length;t--;)if(Ig(d[t][0],e))return t;return-1}function Dg(d,e){e=Ag(e,d)?[e]:Eg(e);for(var t=0,n=e.length;d!=null&&t<n;)d=d[Mg(e[t++])];return t&&t==n?d:void 0}function Sg(d){if(!wa(d)||kg(d))return!1;var e=Lg(d)||tg(d)?rg:Zm;return e.test(_g(d))}function xg(d){if(typeof d=="string")return d;if(Ur(d))return Rs?Rs.call(d):"";var e=d+"";return e=="0"&&1/d==-1/0?"-0":e}function Eg(d){return ba(d)?d:$g(d)}function Yi(d,e){var t=d.__data__;return Tg(e)?t[typeof e=="string"?"string":"hash"]:t.map}function ya(d,e){var t=eg(d,e);return Sg(t)?t:void 0}function Ag(d,e){if(ba(d))return!1;var t=typeof d;return t=="number"||t=="symbol"||t=="boolean"||d==null||Ur(d)?!0:Gm.test(d)||!Um.test(d)||e!=null&&d in Object(e)}function Tg(d){var e=typeof d;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?d!=="__proto__":d===null}function kg(d){return!!Is&&Is in d}var $g=zr(function(d){d=Rg(d);var e=[];return Km.test(d)&&e.push(""),d.replace(Ym,function(t,n,m,i){e.push(m?i.replace(Qm,"$1"):n||t)}),e});function Mg(d){if(typeof d=="string"||Ur(d))return d;var e=d+"";return e=="0"&&1/d==-1/0?"-0":e}function _g(d){if(d!=null){try{return ga.call(d)}catch{}try{return d+""}catch{}}return""}function zr(d,e){if(typeof d!="function"||e&&typeof e!="function")throw new TypeError(Wm);var t=function(){var n=arguments,m=e?e.apply(this,n):n[0],i=t.cache;if(i.has(m))return i.get(m);var a=d.apply(this,n);return t.cache=i.set(m,a),a};return t.cache=new(zr.Cache||bn),t}zr.Cache=bn;function Ig(d,e){return d===e||d!==d&&e!==e}var ba=Array.isArray;function Lg(d){var e=wa(d)?va.call(d):"";return e==Hm||e==jm}function wa(d){var e=typeof d;return!!d&&(e=="object"||e=="function")}function Fg(d){return!!d&&typeof d=="object"}function Ur(d){return typeof d=="symbol"||Fg(d)&&va.call(d)==zm}function Rg(d){return d==null?"":xg(d)}function Og(d,e,t){var n=d==null?void 0:Dg(d,e);return n===void 0?t:n}var Pg=Og,Ng=Zt&&Zt.__extends||function(){var d=function(e,t){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,m){n.__proto__=m}||function(n,m){for(var i in m)Object.prototype.hasOwnProperty.call(m,i)&&(n[i]=m[i])},d(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");d(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Er=Zt&&Zt.__assign||function(){return Er=Object.assign||function(d){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var m in e)Object.prototype.hasOwnProperty.call(e,m)&&(d[m]=e[m])}return d},Er.apply(this,arguments)};Object.defineProperty(Zt,"__esModule",{value:!0});var dn=kt,ur=(0,dn.getAceInstance)(),Bg=Ii,Vg=Vm,xe=Tr,Os=J,hr=da,Pt=Pg,Wg=function(d){Ng(e,d);function e(t){var n=d.call(this,t)||this;return dn.editorEvents.forEach(function(m){n[m]=n[m].bind(n)}),n.debounce=dn.debounce,n}return e.prototype.isInShadow=function(t){for(var n=t&&t.parentNode;n;){if(n.toString()==="[object ShadowRoot]")return!0;n=n.parentNode}return!1},e.prototype.componentDidMount=function(){var t=this,n=this.props,m=n.className,i=n.onBeforeLoad,a=n.mode,p=n.focus,o=n.theme,h=n.fontSize,r=n.value,s=n.defaultValue,l=n.cursorStart,u=n.showGutter,c=n.wrapEnabled,f=n.showPrintMargin,g=n.scrollMargin,v=g===void 0?[0,0,0,0]:g,b=n.keyboardHandler,A=n.onLoad,x=n.commands,D=n.annotations,y=n.markers,E=n.splits;this.editor=ur.edit(this.refEditor),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.setTheme("ace/theme/".concat(o)),i&&i(ur);var T=Object.keys(this.props.editorProps),M=new Vg.Split(this.editor.container,"ace/theme/".concat(o),E);this.editor.env.split=M,this.splitEditor=M.getEditor(0),this.split=M,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)),M.forEach(function(C,w){for(var S=0;S<T.length;S++)C[T[S]]=t.props.editorProps[T[S]];var k=Pt(s,w),_=Pt(r,w,"");C.session.setUndoManager(new ur.UndoManager),C.setTheme("ace/theme/".concat(o)),C.renderer.setScrollMargin(v[0],v[1],v[2],v[3]),C.getSession().setMode("ace/mode/".concat(a)),C.setFontSize(h),C.renderer.setShowGutter(u),C.getSession().setUseWrapMode(c),C.setShowPrintMargin(f),C.on("focus",t.onFocus),C.on("blur",t.onBlur),C.on("input",t.onInput),C.on("copy",t.onCopy),C.on("paste",t.onPaste),C.on("change",t.onChange),C.getSession().selection.on("changeSelection",t.onSelectionChange),C.getSession().selection.on("changeCursor",t.onCursorChange),C.session.on("changeScrollTop",t.onScroll),C.setValue(k===void 0?_:k,l);var F=Pt(D,w,[]),R=Pt(y,w,[]);C.getSession().setAnnotations(F),R&&R.length>0&&t.handleMarkers(R,C);for(var S=0;S<dn.editorOptions.length;S++){var O=dn.editorOptions[S];$.hasOwnProperty(O)?C.setOption(O,t.props[O]):t.props[O]&&console.warn("ReaceAce: editor option ".concat(O," was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"))}t.handleOptions(t.props,C),Array.isArray(x)&&x.forEach(function(V){typeof V.exec=="string"?C.commands.bindKey(V.bindKey,V.exec):C.commands.addCommand(V)}),b&&C.setKeyboardHandler("ace/keyboard/"+b)}),m&&(this.refEditor.className+=" "+m),p&&this.splitEditor.focus();var L=this.editor.env.split;L.setOrientation(this.props.orientation==="below"?L.BELOW:L.BESIDE),L.resize(!0),A&&A(L)},e.prototype.componentDidUpdate=function(t){var n=this,m=t,i=this.props,a=this.editor.env.split;if(i.splits!==m.splits&&a.setSplits(i.splits),i.orientation!==m.orientation&&a.setOrientation(i.orientation==="below"?a.BELOW:a.BESIDE),a.forEach(function(r,s){i.mode!==m.mode&&r.getSession().setMode("ace/mode/"+i.mode),i.keyboardHandler!==m.keyboardHandler&&(i.keyboardHandler?r.setKeyboardHandler("ace/keyboard/"+i.keyboardHandler):r.setKeyboardHandler(null)),i.fontSize!==m.fontSize&&r.setFontSize(i.fontSize),i.wrapEnabled!==m.wrapEnabled&&r.getSession().setUseWrapMode(i.wrapEnabled),i.showPrintMargin!==m.showPrintMargin&&r.setShowPrintMargin(i.showPrintMargin),i.showGutter!==m.showGutter&&r.renderer.setShowGutter(i.showGutter);for(var l=0;l<dn.editorOptions.length;l++){var u=dn.editorOptions[l];i[u]!==m[u]&&r.setOption(u,i[u])}hr(i.setOptions,m.setOptions)||n.handleOptions(i,r);var c=Pt(i.value,s,"");if(r.getValue()!==c){n.silent=!0;var f=r.session.selection.toJSON();r.setValue(c,i.cursorStart),r.session.selection.fromJSON(f),n.silent=!1}var g=Pt(i.annotations,s,[]),v=Pt(m.annotations,s,[]);hr(g,v)||r.getSession().setAnnotations(g);var b=Pt(i.markers,s,[]),A=Pt(m.markers,s,[]);!hr(b,A)&&Array.isArray(b)&&n.handleMarkers(b,r)}),i.className!==m.className){var p=this.refEditor.className,o=p.trim().split(" "),h=m.className.trim().split(" ");h.forEach(function(r){var s=o.indexOf(r);o.splice(s,1)}),this.refEditor.className=" "+i.className+" "+o.join(" ")}i.theme!==m.theme&&a.setTheme("ace/theme/"+i.theme),i.focus&&!m.focus&&this.splitEditor.focus(),(i.height!==this.props.height||i.width!==this.props.width)&&this.editor.resize()},e.prototype.componentWillUnmount=function(){this.editor.destroy(),this.editor=null},e.prototype.onChange=function(t){if(this.props.onChange&&!this.silent){var n=[];this.editor.env.split.forEach(function(m){n.push(m.getValue())}),this.props.onChange(n,t)}},e.prototype.onSelectionChange=function(t){if(this.props.onSelectionChange){var n=[];this.editor.env.split.forEach(function(m){n.push(m.getSelection())}),this.props.onSelectionChange(n,t)}},e.prototype.onCursorChange=function(t){if(this.props.onCursorChange){var n=[];this.editor.env.split.forEach(function(m){n.push(m.getSelection())}),this.props.onCursorChange(n,t)}},e.prototype.onFocus=function(t){this.props.onFocus&&this.props.onFocus(t)},e.prototype.onInput=function(t){this.props.onInput&&this.props.onInput(t)},e.prototype.onBlur=function(t){this.props.onBlur&&this.props.onBlur(t)},e.prototype.onCopy=function(t){this.props.onCopy&&this.props.onCopy(t)},e.prototype.onPaste=function(t){this.props.onPaste&&this.props.onPaste(t)},e.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},e.prototype.handleOptions=function(t,n){for(var m=Object.keys(t.setOptions),i=0;i<m.length;i++)n.setOption(m[i],t.setOptions[m[i]])},e.prototype.handleMarkers=function(t,n){var m=n.getSession().getMarkers(!0);for(var i in m)m.hasOwnProperty(i)&&n.getSession().removeMarker(m[i].id);m=n.getSession().getMarkers(!1);for(var i in m)m.hasOwnProperty(i)&&n.getSession().removeMarker(m[i].id);t.forEach(function(a){var p=a.startRow,o=a.startCol,h=a.endRow,r=a.endCol,s=a.className,l=a.type,u=a.inFront,c=u===void 0?!1:u,f=new Bg.Range(p,o,h,r);n.getSession().addMarker(f,s,l,c)})},e.prototype.updateRef=function(t){this.refEditor=t},e.prototype.render=function(){var t=this.props,n=t.name,m=t.width,i=t.height,a=t.style,p=Er({width:m,height:i},a);return Os.createElement("div",{ref:this.updateRef,id:n,style:p})},e.propTypes={className:xe.string,debounceChangePeriod:xe.number,defaultValue:xe.arrayOf(xe.string),focus:xe.bool,fontSize:xe.oneOfType([xe.number,xe.string]),height:xe.string,mode:xe.string,name:xe.string,onBlur:xe.func,onChange:xe.func,onCopy:xe.func,onFocus:xe.func,onInput:xe.func,onLoad:xe.func,onPaste:xe.func,onScroll:xe.func,orientation:xe.string,showGutter:xe.bool,splits:xe.number,theme:xe.string,value:xe.arrayOf(xe.string),width:xe.string,onSelectionChange:xe.func,onCursorChange:xe.func,onBeforeLoad:xe.func,minLines:xe.number,maxLines:xe.number,readOnly:xe.bool,highlightActiveLine:xe.bool,tabSize:xe.number,showPrintMargin:xe.bool,cursorStart:xe.number,editorProps:xe.object,setOptions:xe.object,style:xe.object,scrollMargin:xe.array,annotations:xe.array,markers:xe.array,keyboardHandler:xe.string,wrapEnabled:xe.bool,enableBasicAutocompletion:xe.oneOfType([xe.bool,xe.array]),enableLiveAutocompletion:xe.oneOfType([xe.bool,xe.array]),commands:xe.array},e.defaultProps={name:"ace-editor",focus:!1,orientation:"beside",splits:2,mode:"",theme:"",height:"500px",width:"500px",value:[],fontSize:12,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1},e}(Os.Component);Zt.default=Wg;var Ca={exports:{}};(function(d){var e=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},t=-1,n=1,m=0;e.Diff=function(i,a){return[i,a]},e.prototype.diff_main=function(i,a,p,o){typeof o>"u"&&(this.Diff_Timeout<=0?o=Number.MAX_VALUE:o=new Date().getTime()+this.Diff_Timeout*1e3);var h=o;if(i==null||a==null)throw new Error("Null input. (diff_main)");if(i==a)return i?[new e.Diff(m,i)]:[];typeof p>"u"&&(p=!0);var r=p,s=this.diff_commonPrefix(i,a),l=i.substring(0,s);i=i.substring(s),a=a.substring(s),s=this.diff_commonSuffix(i,a);var u=i.substring(i.length-s);i=i.substring(0,i.length-s),a=a.substring(0,a.length-s);var c=this.diff_compute_(i,a,r,h);return l&&c.unshift(new e.Diff(m,l)),u&&c.push(new e.Diff(m,u)),this.diff_cleanupMerge(c),c},e.prototype.diff_compute_=function(i,a,p,o){var h;if(!i)return[new e.Diff(n,a)];if(!a)return[new e.Diff(t,i)];var r=i.length>a.length?i:a,s=i.length>a.length?a:i,l=r.indexOf(s);if(l!=-1)return h=[new e.Diff(n,r.substring(0,l)),new e.Diff(m,s),new e.Diff(n,r.substring(l+s.length))],i.length>a.length&&(h[0][0]=h[2][0]=t),h;if(s.length==1)return[new e.Diff(t,i),new e.Diff(n,a)];var u=this.diff_halfMatch_(i,a);if(u){var c=u[0],f=u[1],g=u[2],v=u[3],b=u[4],A=this.diff_main(c,g,p,o),x=this.diff_main(f,v,p,o);return A.concat([new e.Diff(m,b)],x)}return p&&i.length>100&&a.length>100?this.diff_lineMode_(i,a,o):this.diff_bisect_(i,a,o)},e.prototype.diff_lineMode_=function(i,a,p){var o=this.diff_linesToChars_(i,a);i=o.chars1,a=o.chars2;var h=o.lineArray,r=this.diff_main(i,a,!1,p);this.diff_charsToLines_(r,h),this.diff_cleanupSemantic(r),r.push(new e.Diff(m,""));for(var s=0,l=0,u=0,c="",f="";s<r.length;){switch(r[s][0]){case n:u++,f+=r[s][1];break;case t:l++,c+=r[s][1];break;case m:if(l>=1&&u>=1){r.splice(s-l-u,l+u),s=s-l-u;for(var g=this.diff_main(c,f,!1,p),v=g.length-1;v>=0;v--)r.splice(s,0,g[v]);s=s+g.length}u=0,l=0,c="",f="";break}s++}return r.pop(),r},e.prototype.diff_bisect_=function(i,a,p){for(var o=i.length,h=a.length,r=Math.ceil((o+h)/2),s=r,l=2*r,u=new Array(l),c=new Array(l),f=0;f<l;f++)u[f]=-1,c[f]=-1;u[s+1]=0,c[s+1]=0;for(var g=o-h,v=g%2!=0,b=0,A=0,x=0,D=0,y=0;y<r&&!(new Date().getTime()>p);y++){for(var E=-y+b;E<=y-A;E+=2){var T=s+E,M;E==-y||E!=y&&u[T-1]<u[T+1]?M=u[T+1]:M=u[T-1]+1;for(var $=M-E;M<o&&$<h&&i.charAt(M)==a.charAt($);)M++,$++;if(u[T]=M,M>o)A+=2;else if($>h)b+=2;else if(v){var L=s+g-E;if(L>=0&&L<l&&c[L]!=-1){var C=o-c[L];if(M>=C)return this.diff_bisectSplit_(i,a,M,$,p)}}}for(var w=-y+x;w<=y-D;w+=2){var L=s+w,C;w==-y||w!=y&&c[L-1]<c[L+1]?C=c[L+1]:C=c[L-1]+1;for(var S=C-w;C<o&&S<h&&i.charAt(o-C-1)==a.charAt(h-S-1);)C++,S++;if(c[L]=C,C>o)D+=2;else if(S>h)x+=2;else if(!v){var T=s+g-w;if(T>=0&&T<l&&u[T]!=-1){var M=u[T],$=s+M-T;if(C=o-C,M>=C)return this.diff_bisectSplit_(i,a,M,$,p)}}}}return[new e.Diff(t,i),new e.Diff(n,a)]},e.prototype.diff_bisectSplit_=function(i,a,p,o,h){var r=i.substring(0,p),s=a.substring(0,o),l=i.substring(p),u=a.substring(o),c=this.diff_main(r,s,!1,h),f=this.diff_main(l,u,!1,h);return c.concat(f)},e.prototype.diff_linesToChars_=function(i,a){var p=[],o={};p[0]="";function h(u){for(var c="",f=0,g=-1,v=p.length;g<u.length-1;){g=u.indexOf(`
|
|
998
|
+
`,f),g==-1&&(g=u.length-1);var b=u.substring(f,g+1);(o.hasOwnProperty?o.hasOwnProperty(b):o[b]!==void 0)?c+=String.fromCharCode(o[b]):(v==r&&(b=u.substring(f),g=u.length),c+=String.fromCharCode(v),o[b]=v,p[v++]=b),f=g+1}return c}var r=4e4,s=h(i);r=65535;var l=h(a);return{chars1:s,chars2:l,lineArray:p}},e.prototype.diff_charsToLines_=function(i,a){for(var p=0;p<i.length;p++){for(var o=i[p][1],h=[],r=0;r<o.length;r++)h[r]=a[o.charCodeAt(r)];i[p][1]=h.join("")}},e.prototype.diff_commonPrefix=function(i,a){if(!i||!a||i.charAt(0)!=a.charAt(0))return 0;for(var p=0,o=Math.min(i.length,a.length),h=o,r=0;p<h;)i.substring(r,h)==a.substring(r,h)?(p=h,r=p):o=h,h=Math.floor((o-p)/2+p);return h},e.prototype.diff_commonSuffix=function(i,a){if(!i||!a||i.charAt(i.length-1)!=a.charAt(a.length-1))return 0;for(var p=0,o=Math.min(i.length,a.length),h=o,r=0;p<h;)i.substring(i.length-h,i.length-r)==a.substring(a.length-h,a.length-r)?(p=h,r=p):o=h,h=Math.floor((o-p)/2+p);return h},e.prototype.diff_commonOverlap_=function(i,a){var p=i.length,o=a.length;if(p==0||o==0)return 0;p>o?i=i.substring(p-o):p<o&&(a=a.substring(0,p));var h=Math.min(p,o);if(i==a)return h;for(var r=0,s=1;;){var l=i.substring(h-s),u=a.indexOf(l);if(u==-1)return r;s+=u,(u==0||i.substring(h-s)==a.substring(0,s))&&(r=s,s++)}},e.prototype.diff_halfMatch_=function(i,a){if(this.Diff_Timeout<=0)return null;var p=i.length>a.length?i:a,o=i.length>a.length?a:i;if(p.length<4||o.length*2<p.length)return null;var h=this;function r(A,x,D){for(var y=A.substring(D,D+Math.floor(A.length/4)),E=-1,T="",M,$,L,C;(E=x.indexOf(y,E+1))!=-1;){var w=h.diff_commonPrefix(A.substring(D),x.substring(E)),S=h.diff_commonSuffix(A.substring(0,D),x.substring(0,E));T.length<S+w&&(T=x.substring(E-S,E)+x.substring(E,E+w),M=A.substring(0,D-S),$=A.substring(D+w),L=x.substring(0,E-S),C=x.substring(E+w))}return T.length*2>=A.length?[M,$,L,C,T]:null}var s=r(p,o,Math.ceil(p.length/4)),l=r(p,o,Math.ceil(p.length/2)),u;if(!s&&!l)return null;l?s?u=s[4].length>l[4].length?s:l:u=l:u=s;var c,f,g,v;i.length>a.length?(c=u[0],f=u[1],g=u[2],v=u[3]):(g=u[0],v=u[1],c=u[2],f=u[3]);var b=u[4];return[c,f,g,v,b]},e.prototype.diff_cleanupSemantic=function(i){for(var a=!1,p=[],o=0,h=null,r=0,s=0,l=0,u=0,c=0;r<i.length;)i[r][0]==m?(p[o++]=r,s=u,l=c,u=0,c=0,h=i[r][1]):(i[r][0]==n?u+=i[r][1].length:c+=i[r][1].length,h&&h.length<=Math.max(s,l)&&h.length<=Math.max(u,c)&&(i.splice(p[o-1],0,new e.Diff(t,h)),i[p[o-1]+1][0]=n,o--,o--,r=o>0?p[o-1]:-1,s=0,l=0,u=0,c=0,h=null,a=!0)),r++;for(a&&this.diff_cleanupMerge(i),this.diff_cleanupSemanticLossless(i),r=1;r<i.length;){if(i[r-1][0]==t&&i[r][0]==n){var f=i[r-1][1],g=i[r][1],v=this.diff_commonOverlap_(f,g),b=this.diff_commonOverlap_(g,f);v>=b?(v>=f.length/2||v>=g.length/2)&&(i.splice(r,0,new e.Diff(m,g.substring(0,v))),i[r-1][1]=f.substring(0,f.length-v),i[r+1][1]=g.substring(v),r++):(b>=f.length/2||b>=g.length/2)&&(i.splice(r,0,new e.Diff(m,f.substring(0,b))),i[r-1][0]=n,i[r-1][1]=g.substring(0,g.length-b),i[r+1][0]=t,i[r+1][1]=f.substring(b),r++),r++}r++}},e.prototype.diff_cleanupSemanticLossless=function(i){function a(b,A){if(!b||!A)return 6;var x=b.charAt(b.length-1),D=A.charAt(0),y=x.match(e.nonAlphaNumericRegex_),E=D.match(e.nonAlphaNumericRegex_),T=y&&x.match(e.whitespaceRegex_),M=E&&D.match(e.whitespaceRegex_),$=T&&x.match(e.linebreakRegex_),L=M&&D.match(e.linebreakRegex_),C=$&&b.match(e.blanklineEndRegex_),w=L&&A.match(e.blanklineStartRegex_);return C||w?5:$||L?4:y&&!T&&M?3:T||M?2:y||E?1:0}for(var p=1;p<i.length-1;){if(i[p-1][0]==m&&i[p+1][0]==m){var o=i[p-1][1],h=i[p][1],r=i[p+1][1],s=this.diff_commonSuffix(o,h);if(s){var l=h.substring(h.length-s);o=o.substring(0,o.length-s),h=l+h.substring(0,h.length-s),r=l+r}for(var u=o,c=h,f=r,g=a(o,h)+a(h,r);h.charAt(0)===r.charAt(0);){o+=h.charAt(0),h=h.substring(1)+r.charAt(0),r=r.substring(1);var v=a(o,h)+a(h,r);v>=g&&(g=v,u=o,c=h,f=r)}i[p-1][1]!=u&&(u?i[p-1][1]=u:(i.splice(p-1,1),p--),i[p][1]=c,f?i[p+1][1]=f:(i.splice(p+1,1),p--))}p++}},e.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,e.whitespaceRegex_=/\s/,e.linebreakRegex_=/[\r\n]/,e.blanklineEndRegex_=/\n\r?\n$/,e.blanklineStartRegex_=/^\r?\n\r?\n/,e.prototype.diff_cleanupEfficiency=function(i){for(var a=!1,p=[],o=0,h=null,r=0,s=!1,l=!1,u=!1,c=!1;r<i.length;)i[r][0]==m?(i[r][1].length<this.Diff_EditCost&&(u||c)?(p[o++]=r,s=u,l=c,h=i[r][1]):(o=0,h=null),u=c=!1):(i[r][0]==t?c=!0:u=!0,h&&(s&&l&&u&&c||h.length<this.Diff_EditCost/2&&s+l+u+c==3)&&(i.splice(p[o-1],0,new e.Diff(t,h)),i[p[o-1]+1][0]=n,o--,h=null,s&&l?(u=c=!0,o=0):(o--,r=o>0?p[o-1]:-1,u=c=!1),a=!0)),r++;a&&this.diff_cleanupMerge(i)},e.prototype.diff_cleanupMerge=function(i){i.push(new e.Diff(m,""));for(var a=0,p=0,o=0,h="",r="",s;a<i.length;)switch(i[a][0]){case n:o++,r+=i[a][1],a++;break;case t:p++,h+=i[a][1],a++;break;case m:p+o>1?(p!==0&&o!==0&&(s=this.diff_commonPrefix(r,h),s!==0&&(a-p-o>0&&i[a-p-o-1][0]==m?i[a-p-o-1][1]+=r.substring(0,s):(i.splice(0,0,new e.Diff(m,r.substring(0,s))),a++),r=r.substring(s),h=h.substring(s)),s=this.diff_commonSuffix(r,h),s!==0&&(i[a][1]=r.substring(r.length-s)+i[a][1],r=r.substring(0,r.length-s),h=h.substring(0,h.length-s))),a-=p+o,i.splice(a,p+o),h.length&&(i.splice(a,0,new e.Diff(t,h)),a++),r.length&&(i.splice(a,0,new e.Diff(n,r)),a++),a++):a!==0&&i[a-1][0]==m?(i[a-1][1]+=i[a][1],i.splice(a,1)):a++,o=0,p=0,h="",r="";break}i[i.length-1][1]===""&&i.pop();var l=!1;for(a=1;a<i.length-1;)i[a-1][0]==m&&i[a+1][0]==m&&(i[a][1].substring(i[a][1].length-i[a-1][1].length)==i[a-1][1]?(i[a][1]=i[a-1][1]+i[a][1].substring(0,i[a][1].length-i[a-1][1].length),i[a+1][1]=i[a-1][1]+i[a+1][1],i.splice(a-1,1),l=!0):i[a][1].substring(0,i[a+1][1].length)==i[a+1][1]&&(i[a-1][1]+=i[a+1][1],i[a][1]=i[a][1].substring(i[a+1][1].length)+i[a+1][1],i.splice(a+1,1),l=!0)),a++;l&&this.diff_cleanupMerge(i)},e.prototype.diff_xIndex=function(i,a){var p=0,o=0,h=0,r=0,s;for(s=0;s<i.length&&(i[s][0]!==n&&(p+=i[s][1].length),i[s][0]!==t&&(o+=i[s][1].length),!(p>a));s++)h=p,r=o;return i.length!=s&&i[s][0]===t?r:r+(a-h)},e.prototype.diff_prettyHtml=function(i){for(var a=[],p=/&/g,o=/</g,h=/>/g,r=/\n/g,s=0;s<i.length;s++){var l=i[s][0],u=i[s][1],c=u.replace(p,"&").replace(o,"<").replace(h,">").replace(r,"¶<br>");switch(l){case n:a[s]='<ins style="background:#e6ffe6;">'+c+"</ins>";break;case t:a[s]='<del style="background:#ffe6e6;">'+c+"</del>";break;case m:a[s]="<span>"+c+"</span>";break}}return a.join("")},e.prototype.diff_text1=function(i){for(var a=[],p=0;p<i.length;p++)i[p][0]!==n&&(a[p]=i[p][1]);return a.join("")},e.prototype.diff_text2=function(i){for(var a=[],p=0;p<i.length;p++)i[p][0]!==t&&(a[p]=i[p][1]);return a.join("")},e.prototype.diff_levenshtein=function(i){for(var a=0,p=0,o=0,h=0;h<i.length;h++){var r=i[h][0],s=i[h][1];switch(r){case n:p+=s.length;break;case t:o+=s.length;break;case m:a+=Math.max(p,o),p=0,o=0;break}}return a+=Math.max(p,o),a},e.prototype.diff_toDelta=function(i){for(var a=[],p=0;p<i.length;p++)switch(i[p][0]){case n:a[p]="+"+encodeURI(i[p][1]);break;case t:a[p]="-"+i[p][1].length;break;case m:a[p]="="+i[p][1].length;break}return a.join(" ").replace(/%20/g," ")},e.prototype.diff_fromDelta=function(i,a){for(var p=[],o=0,h=0,r=a.split(/\t/g),s=0;s<r.length;s++){var l=r[s].substring(1);switch(r[s].charAt(0)){case"+":try{p[o++]=new e.Diff(n,decodeURI(l))}catch{throw new Error("Illegal escape in diff_fromDelta: "+l)}break;case"-":case"=":var u=parseInt(l,10);if(isNaN(u)||u<0)throw new Error("Invalid number in diff_fromDelta: "+l);var c=i.substring(h,h+=u);r[s].charAt(0)=="="?p[o++]=new e.Diff(m,c):p[o++]=new e.Diff(t,c);break;default:if(r[s])throw new Error("Invalid diff operation in diff_fromDelta: "+r[s])}}if(h!=i.length)throw new Error("Delta length ("+h+") does not equal source text length ("+i.length+").");return p},e.prototype.match_main=function(i,a,p){if(i==null||a==null||p==null)throw new Error("Null input. (match_main)");return p=Math.max(0,Math.min(p,i.length)),i==a?0:i.length?i.substring(p,p+a.length)==a?p:this.match_bitap_(i,a,p):-1},e.prototype.match_bitap_=function(i,a,p){if(a.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var o=this.match_alphabet_(a),h=this;function r(M,$){var L=M/a.length,C=Math.abs(p-$);return h.Match_Distance?L+C/h.Match_Distance:C?1:L}var s=this.Match_Threshold,l=i.indexOf(a,p);l!=-1&&(s=Math.min(r(0,l),s),l=i.lastIndexOf(a,p+a.length),l!=-1&&(s=Math.min(r(0,l),s)));var u=1<<a.length-1;l=-1;for(var c,f,g=a.length+i.length,v,b=0;b<a.length;b++){for(c=0,f=g;c<f;)r(b,p+f)<=s?c=f:g=f,f=Math.floor((g-c)/2+c);g=f;var A=Math.max(1,p-f+1),x=Math.min(p+f,i.length)+a.length,D=Array(x+2);D[x+1]=(1<<b)-1;for(var y=x;y>=A;y--){var E=o[i.charAt(y-1)];if(b===0?D[y]=(D[y+1]<<1|1)&E:D[y]=(D[y+1]<<1|1)&E|((v[y+1]|v[y])<<1|1)|v[y+1],D[y]&u){var T=r(b,y-1);if(T<=s)if(s=T,l=y-1,l>p)A=Math.max(1,2*p-l);else break}}if(r(b+1,p)>s)break;v=D}return l},e.prototype.match_alphabet_=function(i){for(var a={},p=0;p<i.length;p++)a[i.charAt(p)]=0;for(var p=0;p<i.length;p++)a[i.charAt(p)]|=1<<i.length-p-1;return a},e.prototype.patch_addContext_=function(i,a){if(a.length!=0){if(i.start2===null)throw Error("patch not initialized");for(var p=a.substring(i.start2,i.start2+i.length1),o=0;a.indexOf(p)!=a.lastIndexOf(p)&&p.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,p=a.substring(i.start2-o,i.start2+i.length1+o);o+=this.Patch_Margin;var h=a.substring(i.start2-o,i.start2);h&&i.diffs.unshift(new e.Diff(m,h));var r=a.substring(i.start2+i.length1,i.start2+i.length1+o);r&&i.diffs.push(new e.Diff(m,r)),i.start1-=h.length,i.start2-=h.length,i.length1+=h.length+r.length,i.length2+=h.length+r.length}},e.prototype.patch_make=function(i,a,p){var o,h;if(typeof i=="string"&&typeof a=="string"&&typeof p>"u")o=i,h=this.diff_main(o,a,!0),h.length>2&&(this.diff_cleanupSemantic(h),this.diff_cleanupEfficiency(h));else if(i&&typeof i=="object"&&typeof a>"u"&&typeof p>"u")h=i,o=this.diff_text1(h);else if(typeof i=="string"&&a&&typeof a=="object"&&typeof p>"u")o=i,h=a;else if(typeof i=="string"&&typeof a=="string"&&p&&typeof p=="object")o=i,h=p;else throw new Error("Unknown call format to patch_make.");if(h.length===0)return[];for(var r=[],s=new e.patch_obj,l=0,u=0,c=0,f=o,g=o,v=0;v<h.length;v++){var b=h[v][0],A=h[v][1];switch(!l&&b!==m&&(s.start1=u,s.start2=c),b){case n:s.diffs[l++]=h[v],s.length2+=A.length,g=g.substring(0,c)+A+g.substring(c);break;case t:s.length1+=A.length,s.diffs[l++]=h[v],g=g.substring(0,c)+g.substring(c+A.length);break;case m:A.length<=2*this.Patch_Margin&&l&&h.length!=v+1?(s.diffs[l++]=h[v],s.length1+=A.length,s.length2+=A.length):A.length>=2*this.Patch_Margin&&l&&(this.patch_addContext_(s,f),r.push(s),s=new e.patch_obj,l=0,f=g,u=c);break}b!==n&&(u+=A.length),b!==t&&(c+=A.length)}return l&&(this.patch_addContext_(s,f),r.push(s)),r},e.prototype.patch_deepCopy=function(i){for(var a=[],p=0;p<i.length;p++){var o=i[p],h=new e.patch_obj;h.diffs=[];for(var r=0;r<o.diffs.length;r++)h.diffs[r]=new e.Diff(o.diffs[r][0],o.diffs[r][1]);h.start1=o.start1,h.start2=o.start2,h.length1=o.length1,h.length2=o.length2,a[p]=h}return a},e.prototype.patch_apply=function(i,a){if(i.length==0)return[a,[]];i=this.patch_deepCopy(i);var p=this.patch_addPadding(i);a=p+a+p,this.patch_splitMax(i);for(var o=0,h=[],r=0;r<i.length;r++){var s=i[r].start2+o,l=this.diff_text1(i[r].diffs),u,c=-1;if(l.length>this.Match_MaxBits?(u=this.match_main(a,l.substring(0,this.Match_MaxBits),s),u!=-1&&(c=this.match_main(a,l.substring(l.length-this.Match_MaxBits),s+l.length-this.Match_MaxBits),(c==-1||u>=c)&&(u=-1))):u=this.match_main(a,l,s),u==-1)h[r]=!1,o-=i[r].length2-i[r].length1;else{h[r]=!0,o=u-s;var f;if(c==-1?f=a.substring(u,u+l.length):f=a.substring(u,c+this.Match_MaxBits),l==f)a=a.substring(0,u)+this.diff_text2(i[r].diffs)+a.substring(u+l.length);else{var g=this.diff_main(l,f,!1);if(l.length>this.Match_MaxBits&&this.diff_levenshtein(g)/l.length>this.Patch_DeleteThreshold)h[r]=!1;else{this.diff_cleanupSemanticLossless(g);for(var v=0,b,A=0;A<i[r].diffs.length;A++){var x=i[r].diffs[A];x[0]!==m&&(b=this.diff_xIndex(g,v)),x[0]===n?a=a.substring(0,u+b)+x[1]+a.substring(u+b):x[0]===t&&(a=a.substring(0,u+b)+a.substring(u+this.diff_xIndex(g,v+x[1].length))),x[0]!==t&&(v+=x[1].length)}}}}}return a=a.substring(p.length,a.length-p.length),[a,h]},e.prototype.patch_addPadding=function(i){for(var a=this.Patch_Margin,p="",o=1;o<=a;o++)p+=String.fromCharCode(o);for(var o=0;o<i.length;o++)i[o].start1+=a,i[o].start2+=a;var h=i[0],r=h.diffs;if(r.length==0||r[0][0]!=m)r.unshift(new e.Diff(m,p)),h.start1-=a,h.start2-=a,h.length1+=a,h.length2+=a;else if(a>r[0][1].length){var s=a-r[0][1].length;r[0][1]=p.substring(r[0][1].length)+r[0][1],h.start1-=s,h.start2-=s,h.length1+=s,h.length2+=s}if(h=i[i.length-1],r=h.diffs,r.length==0||r[r.length-1][0]!=m)r.push(new e.Diff(m,p)),h.length1+=a,h.length2+=a;else if(a>r[r.length-1][1].length){var s=a-r[r.length-1][1].length;r[r.length-1][1]+=p.substring(0,s),h.length1+=s,h.length2+=s}return p},e.prototype.patch_splitMax=function(i){for(var a=this.Match_MaxBits,p=0;p<i.length;p++)if(!(i[p].length1<=a)){var o=i[p];i.splice(p--,1);for(var h=o.start1,r=o.start2,s="";o.diffs.length!==0;){var l=new e.patch_obj,u=!0;for(l.start1=h-s.length,l.start2=r-s.length,s!==""&&(l.length1=l.length2=s.length,l.diffs.push(new e.Diff(m,s)));o.diffs.length!==0&&l.length1<a-this.Patch_Margin;){var c=o.diffs[0][0],f=o.diffs[0][1];c===n?(l.length2+=f.length,r+=f.length,l.diffs.push(o.diffs.shift()),u=!1):c===t&&l.diffs.length==1&&l.diffs[0][0]==m&&f.length>2*a?(l.length1+=f.length,h+=f.length,u=!1,l.diffs.push(new e.Diff(c,f)),o.diffs.shift()):(f=f.substring(0,a-l.length1-this.Patch_Margin),l.length1+=f.length,h+=f.length,c===m?(l.length2+=f.length,r+=f.length):u=!1,l.diffs.push(new e.Diff(c,f)),f==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(f.length))}s=this.diff_text2(l.diffs),s=s.substring(s.length-this.Patch_Margin);var g=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);g!==""&&(l.length1+=g.length,l.length2+=g.length,l.diffs.length!==0&&l.diffs[l.diffs.length-1][0]===m?l.diffs[l.diffs.length-1][1]+=g:l.diffs.push(new e.Diff(m,g))),u||i.splice(++p,0,l)}}},e.prototype.patch_toText=function(i){for(var a=[],p=0;p<i.length;p++)a[p]=i[p];return a.join("")},e.prototype.patch_fromText=function(i){var a=[];if(!i)return a;for(var p=i.split(`
|
|
999
|
+
`),o=0,h=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<p.length;){var r=p[o].match(h);if(!r)throw new Error("Invalid patch string: "+p[o]);var s=new e.patch_obj;for(a.push(s),s.start1=parseInt(r[1],10),r[2]===""?(s.start1--,s.length1=1):r[2]=="0"?s.length1=0:(s.start1--,s.length1=parseInt(r[2],10)),s.start2=parseInt(r[3],10),r[4]===""?(s.start2--,s.length2=1):r[4]=="0"?s.length2=0:(s.start2--,s.length2=parseInt(r[4],10)),o++;o<p.length;){var l=p[o].charAt(0);try{var u=decodeURI(p[o].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+u)}if(l=="-")s.diffs.push(new e.Diff(t,u));else if(l=="+")s.diffs.push(new e.Diff(n,u));else if(l==" ")s.diffs.push(new e.Diff(m,u));else{if(l=="@")break;if(l!=="")throw new Error('Invalid patch mode "'+l+'" in: '+u)}o++}}return a},e.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},e.patch_obj.prototype.toString=function(){var i,a;this.length1===0?i=this.start1+",0":this.length1==1?i=this.start1+1:i=this.start1+1+","+this.length1,this.length2===0?a=this.start2+",0":this.length2==1?a=this.start2+1:a=this.start2+1+","+this.length2;for(var p=["@@ -"+i+" +"+a+` @@
|
|
1000
|
+
`],o,h=0;h<this.diffs.length;h++){switch(this.diffs[h][0]){case n:o="+";break;case t:o="-";break;case m:o=" ";break}p[h+1]=o+encodeURI(this.diffs[h][1])+`
|
|
1001
|
+
`}return p.join("").replace(/%20/g," ")},d.exports=e,d.exports.diff_match_patch=e,d.exports.DIFF_DELETE=t,d.exports.DIFF_INSERT=n,d.exports.DIFF_EQUAL=m})(Ca);var Hg=Ca.exports,jg=ri&&ri.__extends||function(){var d=function(e,t){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,m){n.__proto__=m}||function(n,m){for(var i in m)Object.prototype.hasOwnProperty.call(m,i)&&(n[i]=m[i])},d(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");d(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(ri,"__esModule",{value:!0});var Ve=Tr,Ps=J,zg=Zt,Ug=Hg,Gg=function(d){jg(e,d);function e(t){var n=d.call(this,t)||this;return n.state={value:n.props.value},n.onChange=n.onChange.bind(n),n.diff=n.diff.bind(n),n}return e.prototype.componentDidUpdate=function(){var t=this.props.value;t!==this.state.value&&this.setState({value:t})},e.prototype.onChange=function(t){this.setState({value:t}),this.props.onChange&&this.props.onChange(t)},e.prototype.diff=function(){var t=new Ug,n=this.state.value[0],m=this.state.value[1];if(n.length===0&&m.length===0)return[];var i=t.diff_main(n,m);t.diff_cleanupSemantic(i);var a=this.generateDiffedLines(i),p=this.setCodeMarkers(a);return p},e.prototype.generateDiffedLines=function(t){var n={DIFF_EQUAL:0,DIFF_DELETE:-1,DIFF_INSERT:1},m={left:[],right:[]},i={left:1,right:1};return t.forEach(function(a){var p=a[0],o=a[1],h=o.split(`
|
|
1002
|
+
`).length-1;if(o.length!==0){var r=o[0],s=o[o.length-1],l=0;switch(p){case n.DIFF_EQUAL:i.left+=h,i.right+=h;break;case n.DIFF_DELETE:r===`
|
|
1003
|
+
`&&(i.left++,h--),l=h,l===0&&m.right.push({startLine:i.right,endLine:i.right}),s===`
|
|
1004
|
+
`&&(l-=1),m.left.push({startLine:i.left,endLine:i.left+l}),i.left+=h;break;case n.DIFF_INSERT:r===`
|
|
1005
|
+
`&&(i.right++,h--),l=h,l===0&&m.left.push({startLine:i.left,endLine:i.left}),s===`
|
|
1006
|
+
`&&(l-=1),m.right.push({startLine:i.right,endLine:i.right+l}),i.right+=h;break;default:throw new Error("Diff type was not defined.")}}}),m},e.prototype.setCodeMarkers=function(t){t===void 0&&(t={left:[],right:[]});for(var n=[],m={left:[],right:[]},i=0;i<t.left.length;i++){var a={startRow:t.left[i].startLine-1,endRow:t.left[i].endLine,type:"text",className:"codeMarker"};m.left.push(a)}for(var i=0;i<t.right.length;i++){var a={startRow:t.right[i].startLine-1,endRow:t.right[i].endLine,type:"text",className:"codeMarker"};m.right.push(a)}return n[0]=m.left,n[1]=m.right,n},e.prototype.render=function(){var t=this.diff();return Ps.createElement(zg.default,{name:this.props.name,className:this.props.className,focus:this.props.focus,orientation:this.props.orientation,splits:this.props.splits,mode:this.props.mode,theme:this.props.theme,height:this.props.height,width:this.props.width,fontSize:this.props.fontSize,showGutter:this.props.showGutter,onChange:this.onChange,onPaste:this.props.onPaste,onLoad:this.props.onLoad,onScroll:this.props.onScroll,minLines:this.props.minLines,maxLines:this.props.maxLines,readOnly:this.props.readOnly,highlightActiveLine:this.props.highlightActiveLine,showPrintMargin:this.props.showPrintMargin,tabSize:this.props.tabSize,cursorStart:this.props.cursorStart,editorProps:this.props.editorProps,style:this.props.style,scrollMargin:this.props.scrollMargin,setOptions:this.props.setOptions,wrapEnabled:this.props.wrapEnabled,enableBasicAutocompletion:this.props.enableBasicAutocompletion,enableLiveAutocompletion:this.props.enableLiveAutocompletion,value:this.state.value,markers:t})},e.propTypes={cursorStart:Ve.number,editorProps:Ve.object,enableBasicAutocompletion:Ve.bool,enableLiveAutocompletion:Ve.bool,focus:Ve.bool,fontSize:Ve.number,height:Ve.string,highlightActiveLine:Ve.bool,maxLines:Ve.number,minLines:Ve.number,mode:Ve.string,name:Ve.string,className:Ve.string,onLoad:Ve.func,onPaste:Ve.func,onScroll:Ve.func,onChange:Ve.func,orientation:Ve.string,readOnly:Ve.bool,scrollMargin:Ve.array,setOptions:Ve.object,showGutter:Ve.bool,showPrintMargin:Ve.bool,splits:Ve.number,style:Ve.object,tabSize:Ve.number,theme:Ve.string,value:Ve.array,width:Ve.string,wrapEnabled:Ve.bool},e.defaultProps={cursorStart:1,editorProps:{},enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,focus:!1,fontSize:12,height:"500px",highlightActiveLine:!0,maxLines:null,minLines:null,mode:"",name:"ace-editor",onLoad:null,onScroll:null,onPaste:null,onChange:null,orientation:"beside",readOnly:!1,scrollMargin:[0,0,0,0],setOptions:{},showGutter:!0,showPrintMargin:!0,splits:2,style:{},tabSize:4,theme:"github",value:["",""],width:"500px",wrapEnabled:!0},e}(Ps.Component);ri.default=Gg;Object.defineProperty(Ln,"__esModule",{value:!0});Ln.diff=Ln.split=void 0;var Kg=mn,Yg=ri;Ln.diff=Yg.default;var Jg=Zt;Ln.split=Jg.default;var Qg=Ln.default=Kg.default,Zg={exports:{}};(function(d,e){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(t,n,m){var i=t("../lib/oop"),a=t("./text_highlight_rules").TextHighlightRules,p=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};i.inherits(p,a),n.JsonHighlightRules=p}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(t,n,m){var i=t("../range").Range,a=function(){};(function(){this.checkOutdent=function(p,o){return/^\s+$/.test(p)?/^\s*\}/.test(o):!1},this.autoOutdent=function(p,o){var h=p.getLine(o),r=h.match(/^(\s*\})/);if(!r)return 0;var s=r[1].length,l=p.findMatchingBracket({row:o,column:s});if(!l||l.row==o)return 0;var u=this.$getIndent(p.getLine(l.row));p.replace(new i(o,0,o,s-1),u)},this.$getIndent=function(p){return p.match(/^\s*/)[0]}}).call(a.prototype),n.MatchingBraceOutdent=a}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(t,n,m){var i=t("../../lib/oop"),a=t("../../range").Range,p=t("./fold_mode").FoldMode,o=n.FoldMode=function(h){h&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+h.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+h.end)))};i.inherits(o,p),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(h,r,s){var l=h.getLine(s);if(this.singleLineBlockCommentRe.test(l)&&!this.startRegionRe.test(l)&&!this.tripleStarBlockCommentRe.test(l))return"";var u=this._getFoldWidgetBase(h,r,s);return!u&&this.startRegionRe.test(l)?"start":u},this.getFoldWidgetRange=function(h,r,s,l){var u=h.getLine(s);if(this.startRegionRe.test(u))return this.getCommentRegionBlock(h,u,s);var g=u.match(this.foldingStartMarker);if(g){var c=g.index;if(g[1])return this.openingBracketBlock(h,g[1],s,c);var f=h.getCommentFoldRange(s,c+g[0].length,1);return f&&!f.isMultiLine()&&(l?f=this.getSectionRange(h,s):r!="all"&&(f=null)),f}if(r!=="markbegin"){var g=u.match(this.foldingStopMarker);if(g){var c=g.index+g[0].length;return g[1]?this.closingBracketBlock(h,g[1],s,c):h.getCommentFoldRange(s,c,-1)}}},this.getSectionRange=function(h,r){var s=h.getLine(r),l=s.search(/\S/),u=r,c=s.length;r+=1;for(var f=r,g=h.getLength();++r<g;){s=h.getLine(r);var v=s.search(/\S/);if(v!==-1){if(l>v)break;var b=this.getFoldWidgetRange(h,"all",r);if(b){if(b.start.row<=u)break;if(b.isMultiLine())r=b.end.row;else if(l==v)break}f=r}}return new a(u,c,f,h.getLine(f).length)},this.getCommentRegionBlock=function(h,r,s){for(var l=r.search(/\s*$/),u=h.getLength(),c=s,f=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,g=1;++s<u;){r=h.getLine(s);var v=f.exec(r);if(v&&(v[1]?g--:g++,!g))break}var b=s;if(b>c)return new a(c,l,b,r.length)}}.call(o.prototype)}),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle","ace/worker/worker_client"],function(t,n,m){var i=t("../lib/oop"),a=t("./text").Mode,p=t("./json_highlight_rules").JsonHighlightRules,o=t("./matching_brace_outdent").MatchingBraceOutdent,h=t("./folding/cstyle").FoldMode,r=t("../worker/worker_client").WorkerClient,s=function(){this.HighlightRules=p,this.$outdent=new o,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new h};i.inherits(s,a),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(l,u,c){var f=this.$getIndent(u);if(l=="start"){var g=u.match(/^.*[\{\(\[]\s*$/);g&&(f+=c)}return f},this.checkOutdent=function(l,u,c){return this.$outdent.checkOutdent(u,c)},this.autoOutdent=function(l,u,c){this.$outdent.autoOutdent(u,c)},this.createWorker=function(l){var u=new r(["ace"],"ace/mode/json_worker","JsonWorker");return u.attachToDocument(l.getDocument()),u.on("annotate",function(c){l.setAnnotations(c.data)}),u.on("terminate",function(){l.clearAnnotations()}),u},this.$id="ace/mode/json"}.call(s.prototype),n.Mode=s}),function(){ace.require(["ace/mode/json"],function(t){d&&(d.exports=t)})}()})(Zg);var Xg={exports:{}};(function(d,e){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(t,n,m){var i=t("../lib/oop"),a=t("./text_highlight_rules").TextHighlightRules,p=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};i.inherits(p,a),n.JsonHighlightRules=p}),ace.define("ace/mode/json5_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/json_highlight_rules"],function(t,n,m){var i=t("../lib/oop"),a=t("./json_highlight_rules").JsonHighlightRules,p=function(){a.call(this);var o=[{token:"variable",regex:/[a-zA-Z$_\u00a1-\uffff][\w$\u00a1-\uffff]*\s*(?=:)/},{token:"variable",regex:/['](?:(?:\\.)|(?:[^'\\]))*?[']\s*(?=:)/},{token:"constant.language.boolean",regex:/(?:null)\b/},{token:"string",regex:/'/,next:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,consumeLineEnd:!0},{token:"string",regex:/'|$/,next:"start"},{defaultToken:"string"}]},{token:"string",regex:/"(?![^"]*":)/,next:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,consumeLineEnd:!0},{token:"string",regex:/"|$/,next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:/[+-]?(?:Infinity|NaN)\b/}];for(var h in this.$rules)this.$rules[h].unshift.apply(this.$rules[h],o);this.normalizeRules()};i.inherits(p,a),n.Json5HighlightRules=p}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(t,n,m){var i=t("../range").Range,a=function(){};(function(){this.checkOutdent=function(p,o){return/^\s+$/.test(p)?/^\s*\}/.test(o):!1},this.autoOutdent=function(p,o){var h=p.getLine(o),r=h.match(/^(\s*\})/);if(!r)return 0;var s=r[1].length,l=p.findMatchingBracket({row:o,column:s});if(!l||l.row==o)return 0;var u=this.$getIndent(p.getLine(l.row));p.replace(new i(o,0,o,s-1),u)},this.$getIndent=function(p){return p.match(/^\s*/)[0]}}).call(a.prototype),n.MatchingBraceOutdent=a}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(t,n,m){var i=t("../../lib/oop"),a=t("../../range").Range,p=t("./fold_mode").FoldMode,o=n.FoldMode=function(h){h&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+h.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+h.end)))};i.inherits(o,p),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(h,r,s){var l=h.getLine(s);if(this.singleLineBlockCommentRe.test(l)&&!this.startRegionRe.test(l)&&!this.tripleStarBlockCommentRe.test(l))return"";var u=this._getFoldWidgetBase(h,r,s);return!u&&this.startRegionRe.test(l)?"start":u},this.getFoldWidgetRange=function(h,r,s,l){var u=h.getLine(s);if(this.startRegionRe.test(u))return this.getCommentRegionBlock(h,u,s);var g=u.match(this.foldingStartMarker);if(g){var c=g.index;if(g[1])return this.openingBracketBlock(h,g[1],s,c);var f=h.getCommentFoldRange(s,c+g[0].length,1);return f&&!f.isMultiLine()&&(l?f=this.getSectionRange(h,s):r!="all"&&(f=null)),f}if(r!=="markbegin"){var g=u.match(this.foldingStopMarker);if(g){var c=g.index+g[0].length;return g[1]?this.closingBracketBlock(h,g[1],s,c):h.getCommentFoldRange(s,c,-1)}}},this.getSectionRange=function(h,r){var s=h.getLine(r),l=s.search(/\S/),u=r,c=s.length;r+=1;for(var f=r,g=h.getLength();++r<g;){s=h.getLine(r);var v=s.search(/\S/);if(v!==-1){if(l>v)break;var b=this.getFoldWidgetRange(h,"all",r);if(b){if(b.start.row<=u)break;if(b.isMultiLine())r=b.end.row;else if(l==v)break}f=r}}return new a(u,c,f,h.getLine(f).length)},this.getCommentRegionBlock=function(h,r,s){for(var l=r.search(/\s*$/),u=h.getLength(),c=s,f=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,g=1;++s<u;){r=h.getLine(s);var v=f.exec(r);if(v&&(v[1]?g--:g++,!g))break}var b=s;if(b>c)return new a(c,l,b,r.length)}}.call(o.prototype)}),ace.define("ace/mode/json5",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json5_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"],function(t,n,m){var i=t("../lib/oop"),a=t("./text").Mode,p=t("./json5_highlight_rules").Json5HighlightRules,o=t("./matching_brace_outdent").MatchingBraceOutdent,h=t("./folding/cstyle").FoldMode,r=function(){this.HighlightRules=p,this.$outdent=new o,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new h};i.inherits(r,a),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.checkOutdent=function(s,l,u){return this.$outdent.checkOutdent(l,u)},this.autoOutdent=function(s,l,u){this.$outdent.autoOutdent(l,u)},this.$id="ace/mode/json5"}.call(r.prototype),n.Mode=r}),function(){ace.require(["ace/mode/json5"],function(t){d&&(d.exports=t)})}()})(Xg);var qg={};(function(d){function e(m,i){for(var a=m,p="";a;){var o=i[a];if(typeof o=="string")return o+p;if(o)return o.location.replace(/\/*$/,"/")+(p||o.main||o.name);if(o===!1)return"";var h=a.lastIndexOf("/");if(h===-1)break;p=a.substr(h)+p,a=a.slice(0,h)}return m}if(!(typeof d.window<"u"&&d.document)&&!(d.require&&d.define)){d.console||(d.console=function(){var m=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:m})},d.console.error=d.console.warn=d.console.log=d.console.trace=d.console),d.window=d,d.ace=d,d.onerror=function(m,i,a,p,o){postMessage({type:"error",data:{message:m,data:o&&o.data,file:i,line:a,col:p,stack:o&&o.stack}})},d.normalizeModule=function(m,i){if(i.indexOf("!")!==-1){var a=i.split("!");return d.normalizeModule(m,a[0])+"!"+d.normalizeModule(m,a[1])}if(i.charAt(0)=="."){var p=m.split("/").slice(0,-1).join("/");for(i=(p?p+"/":"")+i;i.indexOf(".")!==-1&&o!=i;){var o=i;i=i.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return i},d.require=function(m,i){if(i||(i=m,m=null),!i.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");i=d.normalizeModule(m,i);var a=d.require.modules[i];if(a)return a.initialized||(a.initialized=!0,a.exports=a.factory().exports),a.exports;if(!d.require.tlns)return console.log("unable to load "+i);var p=e(i,d.require.tlns);return p.slice(-3)!=".js"&&(p+=".js"),d.require.id=i,d.require.modules[i]={},importScripts(p),d.require(m,i)},d.require.modules={},d.require.tlns={},d.define=function(m,i,a){if(arguments.length==2?(a=i,typeof m!="string"&&(i=m,m=d.require.id)):arguments.length==1&&(a=m,i=[],m=d.require.id),typeof a!="function"){d.require.modules[m]={exports:a,initialized:!0};return}i.length||(i=["require","exports","module"]);var p=function(o){return d.require(m,o)};d.require.modules[m]={exports:{},factory:function(){var o=this,h=a.apply(this,i.slice(0,a.length).map(function(r){switch(r){case"require":return p;case"exports":return o.exports;case"module":return o;default:return p(r)}}));return h&&(o.exports=h),o}}},d.define.amd={},d.require.tlns={},d.initBaseUrls=function(m){for(var i in m)this.require.tlns[i]=m[i]},d.initSender=function(){var m=d.require("ace/lib/event_emitter").EventEmitter,i=d.require("ace/lib/oop"),a=function(){};return function(){i.implement(this,m),this.callback=function(p,o){postMessage({type:"call",id:o,data:p})},this.emit=function(p,o){postMessage({type:"event",name:p,data:o})}}.call(a.prototype),new a};var t=d.main=null,n=d.sender=null;d.onmessage=function(m){var i=m.data;if(i.event&&n)n._signal(i.event,i.data);else if(i.command)if(t[i.command])t[i.command].apply(t,i.args);else{if(!d[i.command])throw new Error("Unknown command:"+i.command);d[i.command].apply(d,i.args)}else if(i.init){d.initBaseUrls(i.tlns),n=d.sender=d.initSender();var a=this.require(i.module)[i.classname];t=d.main=new a(n)}}}})(qg),ace.define("ace/lib/oop",[],function(d,e,t){e.inherits=function(n,m){n.super_=m,n.prototype=Object.create(m.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})},e.mixin=function(n,m){for(var i in m)n[i]=m[i];return n},e.implement=function(n,m){e.mixin(n,m)}}),ace.define("ace/apply_delta",[],function(d,e,t){e.applyDelta=function(n,m,i){var a=m.start.row,p=m.start.column,o=n[a]||"";switch(m.action){case"insert":var h=m.lines;if(h.length===1)n[a]=o.substring(0,p)+m.lines[0]+o.substring(p);else{var r=[a,1].concat(m.lines);n.splice.apply(n,r),n[a]=o.substring(0,p)+n[a],n[a+m.lines.length-1]+=o.substring(p)}break;case"remove":var s=m.end.column,l=m.end.row;a===l?n[a]=o.substring(0,p)+o.substring(s):n.splice(a,l-a+1,o.substring(0,p)+n[l].substring(s))}}}),ace.define("ace/lib/event_emitter",[],function(d,e,t){var n={},m=function(){this.propagationStopped=!0},i=function(){this.defaultPrevented=!0};n._emit=n._dispatchEvent=function(a,p){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var o=this._eventRegistry[a]||[],h=this._defaultHandlers[a];if(!(!o.length&&!h)){(typeof p!="object"||!p)&&(p={}),p.type||(p.type=a),p.stopPropagation||(p.stopPropagation=m),p.preventDefault||(p.preventDefault=i),o=o.slice();for(var r=0;r<o.length&&(o[r](p,this),!p.propagationStopped);r++);if(h&&!p.defaultPrevented)return h(p,this)}},n._signal=function(a,p){var o=(this._eventRegistry||{})[a];if(o){o=o.slice();for(var h=0;h<o.length;h++)o[h](p,this)}},n.once=function(a,p){var o=this;if(this.on(a,function h(){o.off(a,h),p.apply(null,arguments)}),!p)return new Promise(function(h){p=h})},n.setDefaultHandler=function(a,p){var o=this._defaultHandlers;if(o||(o=this._defaultHandlers={_disabled_:{}}),o[a]){var h=o[a],r=o._disabled_[a];r||(o._disabled_[a]=r=[]),r.push(h);var s=r.indexOf(p);s!=-1&&r.splice(s,1)}o[a]=p},n.removeDefaultHandler=function(a,p){var o=this._defaultHandlers;if(o){var h=o._disabled_[a];if(o[a]==p)h&&this.setDefaultHandler(a,h.pop());else if(h){var r=h.indexOf(p);r!=-1&&h.splice(r,1)}}},n.on=n.addEventListener=function(a,p,o){this._eventRegistry=this._eventRegistry||{};var h=this._eventRegistry[a];return h||(h=this._eventRegistry[a]=[]),h.indexOf(p)==-1&&h[o?"unshift":"push"](p),p},n.off=n.removeListener=n.removeEventListener=function(a,p){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[a];if(o){var h=o.indexOf(p);h!==-1&&o.splice(h,1)}},n.removeAllListeners=function(a){a||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[a]=void 0),this._defaultHandlers&&(this._defaultHandlers[a]=void 0)},e.EventEmitter=n}),ace.define("ace/range",[],function(d,e,t){var n=function(){function m(i,a,p,o){this.start={row:i,column:a},this.end={row:p,column:o}}return m.prototype.isEqual=function(i){return this.start.row===i.start.row&&this.end.row===i.end.row&&this.start.column===i.start.column&&this.end.column===i.end.column},m.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},m.prototype.contains=function(i,a){return this.compare(i,a)==0},m.prototype.compareRange=function(i){var a,p=i.end,o=i.start;return a=this.compare(p.row,p.column),a==1?(a=this.compare(o.row,o.column),a==1?2:a==0?1:0):a==-1?-2:(a=this.compare(o.row,o.column),a==-1?-1:a==1?42:0)},m.prototype.comparePoint=function(i){return this.compare(i.row,i.column)},m.prototype.containsRange=function(i){return this.comparePoint(i.start)==0&&this.comparePoint(i.end)==0},m.prototype.intersects=function(i){var a=this.compareRange(i);return a==-1||a==0||a==1},m.prototype.isEnd=function(i,a){return this.end.row==i&&this.end.column==a},m.prototype.isStart=function(i,a){return this.start.row==i&&this.start.column==a},m.prototype.setStart=function(i,a){typeof i=="object"?(this.start.column=i.column,this.start.row=i.row):(this.start.row=i,this.start.column=a)},m.prototype.setEnd=function(i,a){typeof i=="object"?(this.end.column=i.column,this.end.row=i.row):(this.end.row=i,this.end.column=a)},m.prototype.inside=function(i,a){return this.compare(i,a)==0?!(this.isEnd(i,a)||this.isStart(i,a)):!1},m.prototype.insideStart=function(i,a){return this.compare(i,a)==0?!this.isEnd(i,a):!1},m.prototype.insideEnd=function(i,a){return this.compare(i,a)==0?!this.isStart(i,a):!1},m.prototype.compare=function(i,a){return!this.isMultiLine()&&i===this.start.row?a<this.start.column?-1:a>this.end.column?1:0:i<this.start.row?-1:i>this.end.row?1:this.start.row===i?a>=this.start.column?0:-1:this.end.row===i?a<=this.end.column?0:1:0},m.prototype.compareStart=function(i,a){return this.start.row==i&&this.start.column==a?-1:this.compare(i,a)},m.prototype.compareEnd=function(i,a){return this.end.row==i&&this.end.column==a?1:this.compare(i,a)},m.prototype.compareInside=function(i,a){return this.end.row==i&&this.end.column==a?1:this.start.row==i&&this.start.column==a?-1:this.compare(i,a)},m.prototype.clipRows=function(i,a){if(this.end.row>a)var p={row:a+1,column:0};else if(this.end.row<i)var p={row:i,column:0};if(this.start.row>a)var o={row:a+1,column:0};else if(this.start.row<i)var o={row:i,column:0};return m.fromPoints(o||this.start,p||this.end)},m.prototype.extend=function(i,a){var p=this.compare(i,a);if(p==0)return this;if(p==-1)var o={row:i,column:a};else var h={row:i,column:a};return m.fromPoints(o||this.start,h||this.end)},m.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},m.prototype.isMultiLine=function(){return this.start.row!==this.end.row},m.prototype.clone=function(){return m.fromPoints(this.start,this.end)},m.prototype.collapseRows=function(){return this.end.column==0?new m(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new m(this.start.row,0,this.end.row,0)},m.prototype.toScreenRange=function(i){var a=i.documentToScreenPosition(this.start),p=i.documentToScreenPosition(this.end);return new m(a.row,a.column,p.row,p.column)},m.prototype.moveBy=function(i,a){this.start.row+=i,this.start.column+=a,this.end.row+=i,this.end.column+=a},m}();n.fromPoints=function(m,i){return new n(m.row,m.column,i.row,i.column)},n.comparePoints=function(m,i){return m.row-i.row||m.column-i.column},e.Range=n}),ace.define("ace/anchor",[],function(d,e,t){function n(o,h,r){var s=r?o.column<=h.column:o.column<h.column;return o.row<h.row||o.row==h.row&&s}function m(o,h,r){var s=o.action=="insert",l=(s?1:-1)*(o.end.row-o.start.row),u=(s?1:-1)*(o.end.column-o.start.column),c=o.start,f=s?c:o.end;return n(h,c,r)?{row:h.row,column:h.column}:n(f,h,!r)?{row:h.row+l,column:h.column+(h.row==f.row?u:0)}:{row:c.row,column:c.column}}var i=d("./lib/oop"),a=d("./lib/event_emitter").EventEmitter,p=function(){function o(h,r,s){this.$onChange=this.onChange.bind(this),this.attach(h),typeof r!="number"?this.setPosition(r.row,r.column):this.setPosition(r,s)}return o.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},o.prototype.getDocument=function(){return this.document},o.prototype.onChange=function(h){if(!(h.start.row==h.end.row&&h.start.row!=this.row)&&!(h.start.row>this.row)){var r=m(h,{row:this.row,column:this.column},this.$insertRight);this.setPosition(r.row,r.column,!0)}},o.prototype.setPosition=function(h,r,s){var l;if(s?l={row:h,column:r}:l=this.$clipPositionToDocument(h,r),!(this.row==l.row&&this.column==l.column)){var u={row:this.row,column:this.column};this.row=l.row,this.column=l.column,this._signal("change",{old:u,value:l})}},o.prototype.detach=function(){this.document.off("change",this.$onChange)},o.prototype.attach=function(h){this.document=h||this.document,this.document.on("change",this.$onChange)},o.prototype.$clipPositionToDocument=function(h,r){var s={};return h>=this.document.getLength()?(s.row=Math.max(0,this.document.getLength()-1),s.column=this.document.getLine(s.row).length):h<0?(s.row=0,s.column=0):(s.row=h,s.column=Math.min(this.document.getLine(s.row).length,Math.max(0,r))),r<0&&(s.column=0),s},o}();p.prototype.$insertRight=!1,i.implement(p.prototype,a),e.Anchor=p}),ace.define("ace/document",[],function(d,e,t){var n=d("./lib/oop"),m=d("./apply_delta").applyDelta,i=d("./lib/event_emitter").EventEmitter,a=d("./range").Range,p=d("./anchor").Anchor,o=function(){function h(r){this.$lines=[""],r.length===0?this.$lines=[""]:Array.isArray(r)?this.insertMergedLines({row:0,column:0},r):this.insert({row:0,column:0},r)}return h.prototype.setValue=function(r){var s=this.getLength()-1;this.remove(new a(0,0,s,this.getLine(s).length)),this.insert({row:0,column:0},r||"")},h.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},h.prototype.createAnchor=function(r,s){return new p(this,r,s)},h.prototype.$detectNewLine=function(r){var s=r.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=s?s[1]:`
|
|
1007
|
+
`,this._signal("changeNewLineMode")},h.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
|
|
1008
|
+
`;case"unix":return`
|
|
1009
|
+
`;default:return this.$autoNewLine||`
|
|
1010
|
+
`}},h.prototype.setNewLineMode=function(r){this.$newLineMode!==r&&(this.$newLineMode=r,this._signal("changeNewLineMode"))},h.prototype.getNewLineMode=function(){return this.$newLineMode},h.prototype.isNewLine=function(r){return r==`\r
|
|
1011
|
+
`||r=="\r"||r==`
|
|
1012
|
+
`},h.prototype.getLine=function(r){return this.$lines[r]||""},h.prototype.getLines=function(r,s){return this.$lines.slice(r,s+1)},h.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},h.prototype.getLength=function(){return this.$lines.length},h.prototype.getTextRange=function(r){return this.getLinesForRange(r).join(this.getNewLineCharacter())},h.prototype.getLinesForRange=function(r){var s;if(r.start.row===r.end.row)s=[this.getLine(r.start.row).substring(r.start.column,r.end.column)];else{s=this.getLines(r.start.row,r.end.row),s[0]=(s[0]||"").substring(r.start.column);var l=s.length-1;r.end.row-r.start.row==l&&(s[l]=s[l].substring(0,r.end.column))}return s},h.prototype.insertLines=function(r,s){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(r,s)},h.prototype.removeLines=function(r,s){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(r,s)},h.prototype.insertNewLine=function(r){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(r,["",""])},h.prototype.insert=function(r,s){return this.getLength()<=1&&this.$detectNewLine(s),this.insertMergedLines(r,this.$split(s))},h.prototype.insertInLine=function(r,s){var l=this.clippedPos(r.row,r.column),u=this.pos(r.row,r.column+s.length);return this.applyDelta({start:l,end:u,action:"insert",lines:[s]},!0),this.clonePos(u)},h.prototype.clippedPos=function(r,s){var l=this.getLength();r===void 0?r=l:r<0?r=0:r>=l&&(r=l-1,s=void 0);var u=this.getLine(r);return s==null&&(s=u.length),s=Math.min(Math.max(s,0),u.length),{row:r,column:s}},h.prototype.clonePos=function(r){return{row:r.row,column:r.column}},h.prototype.pos=function(r,s){return{row:r,column:s}},h.prototype.$clipPosition=function(r){var s=this.getLength();return r.row>=s?(r.row=Math.max(0,s-1),r.column=this.getLine(s-1).length):(r.row=Math.max(0,r.row),r.column=Math.min(Math.max(r.column,0),this.getLine(r.row).length)),r},h.prototype.insertFullLines=function(r,s){r=Math.min(Math.max(r,0),this.getLength());var l=0;r<this.getLength()?(s=s.concat([""]),l=0):(s=[""].concat(s),r--,l=this.$lines[r].length),this.insertMergedLines({row:r,column:l},s)},h.prototype.insertMergedLines=function(r,s){var l=this.clippedPos(r.row,r.column),u={row:l.row+s.length-1,column:(s.length==1?l.column:0)+s[s.length-1].length};return this.applyDelta({start:l,end:u,action:"insert",lines:s}),this.clonePos(u)},h.prototype.remove=function(r){var s=this.clippedPos(r.start.row,r.start.column),l=this.clippedPos(r.end.row,r.end.column);return this.applyDelta({start:s,end:l,action:"remove",lines:this.getLinesForRange({start:s,end:l})}),this.clonePos(s)},h.prototype.removeInLine=function(r,s,l){var u=this.clippedPos(r,s),c=this.clippedPos(r,l);return this.applyDelta({start:u,end:c,action:"remove",lines:this.getLinesForRange({start:u,end:c})},!0),this.clonePos(u)},h.prototype.removeFullLines=function(r,s){r=Math.min(Math.max(0,r),this.getLength()-1),s=Math.min(Math.max(0,s),this.getLength()-1);var l=s==this.getLength()-1&&r>0,u=s<this.getLength()-1,c=l?r-1:r,f=l?this.getLine(c).length:0,g=u?s+1:s,v=u?0:this.getLine(g).length,b=new a(c,f,g,v),A=this.$lines.slice(r,s+1);return this.applyDelta({start:b.start,end:b.end,action:"remove",lines:this.getLinesForRange(b)}),A},h.prototype.removeNewLine=function(r){r<this.getLength()-1&&r>=0&&this.applyDelta({start:this.pos(r,this.getLine(r).length),end:this.pos(r+1,0),action:"remove",lines:["",""]})},h.prototype.replace=function(r,s){if(r instanceof a||(r=a.fromPoints(r.start,r.end)),s.length===0&&r.isEmpty())return r.start;if(s==this.getTextRange(r))return r.end;this.remove(r);var l;return s?l=this.insert(r.start,s):l=r.start,l},h.prototype.applyDeltas=function(r){for(var s=0;s<r.length;s++)this.applyDelta(r[s])},h.prototype.revertDeltas=function(r){for(var s=r.length-1;s>=0;s--)this.revertDelta(r[s])},h.prototype.applyDelta=function(r,s){var l=r.action=="insert";(l?r.lines.length<=1&&!r.lines[0]:!a.comparePoints(r.start,r.end))||(l&&r.lines.length>2e4?this.$splitAndapplyLargeDelta(r,2e4):(m(this.$lines,r,s),this._signal("change",r)))},h.prototype.$safeApplyDelta=function(r){var s=this.$lines.length;(r.action=="remove"&&r.start.row<s&&r.end.row<s||r.action=="insert"&&r.start.row<=s)&&this.applyDelta(r)},h.prototype.$splitAndapplyLargeDelta=function(r,s){for(var l=r.lines,u=l.length-s+1,c=r.start.row,f=r.start.column,g=0,v=0;g<u;g=v){v+=s-1;var b=l.slice(g,v);b.push(""),this.applyDelta({start:this.pos(c+g,f),end:this.pos(c+v,f=0),action:r.action,lines:b},!0)}r.lines=l.slice(g),r.start.row=c+g,r.start.column=f,this.applyDelta(r,!0)},h.prototype.revertDelta=function(r){this.$safeApplyDelta({start:this.clonePos(r.start),end:this.clonePos(r.end),action:r.action=="insert"?"remove":"insert",lines:r.lines.slice()})},h.prototype.indexToPosition=function(r,s){for(var l=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,c=s||0,f=l.length;c<f;c++)if(r-=l[c].length+u,r<0)return{row:c,column:r+l[c].length+u};return{row:f-1,column:r+l[f-1].length+u}},h.prototype.positionToIndex=function(r,s){for(var l=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,c=0,f=Math.min(r.row,l.length),g=s||0;g<f;++g)c+=l[g].length+u;return c+r.column},h.prototype.$split=function(r){return r.split(/\r\n|\r|\n/)},h}();o.prototype.$autoNewLine="",o.prototype.$newLineMode="auto",n.implement(o.prototype,i),e.Document=o}),ace.define("ace/lib/deep_copy",[],function(d,e,t){e.deepCopy=function n(m){if(typeof m!="object"||!m)return m;var i;if(Array.isArray(m)){i=[];for(var a=0;a<m.length;a++)i[a]=n(m[a]);return i}if(Object.prototype.toString.call(m)!=="[object Object]")return m;i={};for(var a in m)i[a]=n(m[a]);return i}}),ace.define("ace/lib/lang",[],function(d,e,t){e.last=function(i){return i[i.length-1]},e.stringReverse=function(i){return i.split("").reverse().join("")},e.stringRepeat=function(i,a){for(var p="";a>0;)a&1&&(p+=i),(a>>=1)&&(i+=i);return p};var n=/^\s\s*/,m=/\s\s*$/;e.stringTrimLeft=function(i){return i.replace(n,"")},e.stringTrimRight=function(i){return i.replace(m,"")},e.copyObject=function(i){var a={};for(var p in i)a[p]=i[p];return a},e.copyArray=function(i){for(var a=[],p=0,o=i.length;p<o;p++)i[p]&&typeof i[p]=="object"?a[p]=this.copyObject(i[p]):a[p]=i[p];return a},e.deepCopy=d("./deep_copy").deepCopy,e.arrayToMap=function(i){for(var a={},p=0;p<i.length;p++)a[i[p]]=1;return a},e.createMap=function(i){var a=Object.create(null);for(var p in i)a[p]=i[p];return a},e.arrayRemove=function(i,a){for(var p=0;p<=i.length;p++)a===i[p]&&i.splice(p,1)},e.escapeRegExp=function(i){return i.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},e.escapeHTML=function(i){return(""+i).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},e.getMatchOffsets=function(i,a){var p=[];return i.replace(a,function(o){p.push({offset:arguments[arguments.length-2],length:o.length})}),p},e.deferredCall=function(i){var a=null,p=function(){a=null,i()},o=function(h){return o.cancel(),a=setTimeout(p,h||0),o};return o.schedule=o,o.call=function(){return this.cancel(),i(),o},o.cancel=function(){return clearTimeout(a),a=null,o},o.isPending=function(){return a},o},e.delayedCall=function(i,a){var p=null,o=function(){p=null,i()},h=function(r){p==null&&(p=setTimeout(o,r||a))};return h.delay=function(r){p&&clearTimeout(p),p=setTimeout(o,r||a)},h.schedule=h,h.call=function(){this.cancel(),i()},h.cancel=function(){p&&clearTimeout(p),p=null},h.isPending=function(){return p},h},e.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},e.skipEmptyMatch=function(i,a,p){return p&&i.codePointAt(a)>65535?2:1}}),ace.define("ace/worker/mirror",[],function(d,e,t){var n=d("../document").Document,m=d("../lib/lang"),i=e.Mirror=function(a){this.sender=a;var p=this.doc=new n(""),o=this.deferredUpdate=m.delayedCall(this.onUpdate.bind(this)),h=this;a.on("change",function(r){var s=r.data;if(s[0].start)p.applyDeltas(s);else for(var l=0;l<s.length;l+=2){var u,c;if(Array.isArray(s[l+1])?u={action:"insert",start:s[l],lines:s[l+1]}:u={action:"remove",start:s[l],end:s[l+1]},(u.action=="insert"?u.start:u.end).row>=p.$lines.length)throw c=new Error("Invalid delta"),c.data={path:h.$path,linesLength:p.$lines.length,start:u.start,end:u.end},c;p.applyDelta(u,!0)}if(h.$timeout)return o.schedule(h.$timeout);h.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(a){this.$timeout=a},this.setValue=function(a){this.doc.setValue(a),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(a){this.sender.callback(this.doc.getValue(),a)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(i.prototype)}),ace.define("ace/mode/json/json_parse",[],function(d,e,t){var n,m,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
1013
|
+
`,r:"\r",t:" "},a,p=function(g){throw{name:"SyntaxError",message:g,at:n,text:a}},o=function(g){return g&&g!==m&&p("Expected '"+g+"' instead of '"+m+"'"),m=a.charAt(n),n+=1,m},h=function(){var g,v="";for(m==="-"&&(v="-",o("-"));m>="0"&&m<="9";)v+=m,o();if(m===".")for(v+=".";o()&&m>="0"&&m<="9";)v+=m;if(m==="e"||m==="E")for(v+=m,o(),(m==="-"||m==="+")&&(v+=m,o());m>="0"&&m<="9";)v+=m,o();if(g=+v,!isNaN(g))return g;p("Bad number")},r=function(){var g,v,b="",A;if(m==='"')for(;o();){if(m==='"')return o(),b;if(m==="\\")if(o(),m==="u"){for(A=0,v=0;v<4&&(g=parseInt(o(),16),!!isFinite(g));v+=1)A=A*16+g;b+=String.fromCharCode(A)}else{if(typeof i[m]!="string")break;b+=i[m]}else{if(m==`
|
|
1014
|
+
`||m=="\r")break;b+=m}}p("Bad string")},s=function(){for(;m&&m<=" ";)o()},l=function(){switch(m){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}p("Unexpected '"+m+"'")},u,c=function(){var g=[];if(m==="["){if(o("["),s(),m==="]")return o("]"),g;for(;m;){if(g.push(u()),s(),m==="]")return o("]"),g;o(","),s()}}p("Bad array")},f=function(){var g,v={};if(m==="{"){if(o("{"),s(),m==="}")return o("}"),v;for(;m;){if(g=r(),s(),o(":"),Object.hasOwnProperty.call(v,g)&&p('Duplicate key "'+g+'"'),v[g]=u(),s(),m==="}")return o("}"),v;o(","),s()}}p("Bad object")};return u=function(){switch(s(),m){case"{":return f();case"[":return c();case'"':return r();case"-":return h();default:return m>="0"&&m<="9"?h():l()}},function(g,v){var b;return a=g,n=0,m=" ",b=u(),s(),m&&p("Syntax error"),typeof v=="function"?function A(x,D){var y,E,T=x[D];if(T&&typeof T=="object")for(y in T)Object.hasOwnProperty.call(T,y)&&(E=A(T,y),E!==void 0?T[y]=E:delete T[y]);return v.call(x,D,T)}({"":b},""):b}}),ace.define("ace/mode/json_worker",[],function(d,e,t){var n=d("../lib/oop"),m=d("../worker/mirror").Mirror,i=d("./json/json_parse"),a=e.JsonWorker=function(p){m.call(this,p),this.setTimeout(200)};n.inherits(a,m),function(){this.onUpdate=function(){var p=this.doc.getValue(),o=[];try{p&&i(p)}catch(r){var h=this.doc.indexToPosition(r.at-1);o.push({row:h.row,column:h.column,text:r.message,type:"error"})}this.sender.emit("annotate",o)}}.call(a.prototype)});var ev={exports:{}};(function(d,e){ace.define("ace/theme/clouds_midnight-css",["require","exports","module"],function(t,n,m){m.exports=`.ace-clouds-midnight .ace_gutter {
|
|
1015
|
+
background: #232323;
|
|
1016
|
+
color: #929292
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
.ace-clouds-midnight .ace_print-margin {
|
|
1020
|
+
width: 1px;
|
|
1021
|
+
background: #232323
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.ace-clouds-midnight {
|
|
1025
|
+
background-color: #191919;
|
|
1026
|
+
color: #929292
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
.ace-clouds-midnight .ace_cursor {
|
|
1030
|
+
color: #7DA5DC
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
.ace-clouds-midnight .ace_marker-layer .ace_selection {
|
|
1034
|
+
background: #000000
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
.ace-clouds-midnight.ace_multiselect .ace_selection.ace_start {
|
|
1038
|
+
box-shadow: 0 0 3px 0px #191919;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
.ace-clouds-midnight .ace_marker-layer .ace_step {
|
|
1042
|
+
background: rgb(102, 82, 0)
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.ace-clouds-midnight .ace_marker-layer .ace_bracket {
|
|
1046
|
+
margin: -1px 0 0 -1px;
|
|
1047
|
+
border: 1px solid #BFBFBF
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
.ace-clouds-midnight .ace_marker-layer .ace_active-line {
|
|
1051
|
+
background: rgba(215, 215, 215, 0.031)
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
.ace-clouds-midnight .ace_gutter-active-line {
|
|
1055
|
+
background-color: rgba(215, 215, 215, 0.031)
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
.ace-clouds-midnight .ace_marker-layer .ace_selected-word {
|
|
1059
|
+
border: 1px solid #000000
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
.ace-clouds-midnight .ace_invisible {
|
|
1063
|
+
color: #666
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
.ace-clouds-midnight .ace_keyword,
|
|
1067
|
+
.ace-clouds-midnight .ace_meta,
|
|
1068
|
+
.ace-clouds-midnight .ace_support.ace_constant.ace_property-value {
|
|
1069
|
+
color: #927C5D
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
.ace-clouds-midnight .ace_keyword.ace_operator {
|
|
1073
|
+
color: #4B4B4B
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
.ace-clouds-midnight .ace_keyword.ace_other.ace_unit {
|
|
1077
|
+
color: #366F1A
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
.ace-clouds-midnight .ace_constant.ace_language {
|
|
1081
|
+
color: #39946A
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
.ace-clouds-midnight .ace_constant.ace_numeric {
|
|
1085
|
+
color: #46A609
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
.ace-clouds-midnight .ace_constant.ace_character.ace_entity {
|
|
1089
|
+
color: #A165AC
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
.ace-clouds-midnight .ace_invalid {
|
|
1093
|
+
color: #FFFFFF;
|
|
1094
|
+
background-color: #E92E2E
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
.ace-clouds-midnight .ace_fold {
|
|
1098
|
+
background-color: #927C5D;
|
|
1099
|
+
border-color: #929292
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
.ace-clouds-midnight .ace_storage,
|
|
1103
|
+
.ace-clouds-midnight .ace_support.ace_class,
|
|
1104
|
+
.ace-clouds-midnight .ace_support.ace_function,
|
|
1105
|
+
.ace-clouds-midnight .ace_support.ace_other,
|
|
1106
|
+
.ace-clouds-midnight .ace_support.ace_type {
|
|
1107
|
+
color: #E92E2E
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
.ace-clouds-midnight .ace_string {
|
|
1111
|
+
color: #5D90CD
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
.ace-clouds-midnight .ace_comment {
|
|
1115
|
+
color: #3C403B
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
.ace-clouds-midnight .ace_entity.ace_name.ace_tag,
|
|
1119
|
+
.ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {
|
|
1120
|
+
color: #606060
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
.ace-clouds-midnight .ace_indent-guide {
|
|
1124
|
+
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
.ace-clouds-midnight .ace_indent-guide-active {
|
|
1128
|
+
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;
|
|
1129
|
+
}
|
|
1130
|
+
`}),ace.define("ace/theme/clouds_midnight",["require","exports","module","ace/theme/clouds_midnight-css","ace/lib/dom"],function(t,n,m){n.isDark=!0,n.cssClass="ace-clouds-midnight",n.cssText=t("./clouds_midnight-css");var i=t("../lib/dom");i.importCssString(n.cssText,n.cssClass,!1)}),function(){ace.require(["ace/theme/clouds_midnight"],function(t){d&&(d.exports=t)})}()})(ev);var tv={exports:{}};(function(d,e){ace.define("ace/theme/chrome-css",["require","exports","module"],function(t,n,m){m.exports=`.ace-chrome .ace_gutter {
|
|
1131
|
+
background: #ebebeb;
|
|
1132
|
+
color: #333;
|
|
1133
|
+
overflow : hidden;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
.ace-chrome .ace_print-margin {
|
|
1137
|
+
width: 1px;
|
|
1138
|
+
background: #e8e8e8;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
.ace-chrome {
|
|
1142
|
+
background-color: #FFFFFF;
|
|
1143
|
+
color: black;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
.ace-chrome .ace_cursor {
|
|
1147
|
+
color: black;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
.ace-chrome .ace_invisible {
|
|
1151
|
+
color: rgb(191, 191, 191);
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
.ace-chrome .ace_constant.ace_buildin {
|
|
1155
|
+
color: rgb(88, 72, 246);
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
.ace-chrome .ace_constant.ace_language {
|
|
1159
|
+
color: rgb(88, 92, 246);
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
.ace-chrome .ace_constant.ace_library {
|
|
1163
|
+
color: rgb(6, 150, 14);
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
.ace-chrome .ace_invalid {
|
|
1167
|
+
background-color: rgb(153, 0, 0);
|
|
1168
|
+
color: white;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
.ace-chrome .ace_fold {
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
.ace-chrome .ace_support.ace_function {
|
|
1175
|
+
color: rgb(60, 76, 114);
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
.ace-chrome .ace_support.ace_constant {
|
|
1179
|
+
color: rgb(6, 150, 14);
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
.ace-chrome .ace_support.ace_type,
|
|
1183
|
+
.ace-chrome .ace_support.ace_class
|
|
1184
|
+
.ace-chrome .ace_support.ace_other {
|
|
1185
|
+
color: rgb(109, 121, 222);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
.ace-chrome .ace_variable.ace_parameter {
|
|
1189
|
+
font-style:italic;
|
|
1190
|
+
color:#FD971F;
|
|
1191
|
+
}
|
|
1192
|
+
.ace-chrome .ace_keyword.ace_operator {
|
|
1193
|
+
color: rgb(104, 118, 135);
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
.ace-chrome .ace_comment {
|
|
1197
|
+
color: #236e24;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
.ace-chrome .ace_comment.ace_doc {
|
|
1201
|
+
color: #236e24;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
.ace-chrome .ace_comment.ace_doc.ace_tag {
|
|
1205
|
+
color: #236e24;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
.ace-chrome .ace_constant.ace_numeric {
|
|
1209
|
+
color: rgb(0, 0, 205);
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
.ace-chrome .ace_variable {
|
|
1213
|
+
color: rgb(49, 132, 149);
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
.ace-chrome .ace_xml-pe {
|
|
1217
|
+
color: rgb(104, 104, 91);
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
.ace-chrome .ace_entity.ace_name.ace_function {
|
|
1221
|
+
color: #0000A2;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
.ace-chrome .ace_heading {
|
|
1226
|
+
color: rgb(12, 7, 255);
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
.ace-chrome .ace_list {
|
|
1230
|
+
color:rgb(185, 6, 144);
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
.ace-chrome .ace_marker-layer .ace_selection {
|
|
1234
|
+
background: rgb(181, 213, 255);
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
.ace-chrome .ace_marker-layer .ace_step {
|
|
1238
|
+
background: rgb(252, 255, 0);
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
.ace-chrome .ace_marker-layer .ace_stack {
|
|
1242
|
+
background: rgb(164, 229, 101);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
.ace-chrome .ace_marker-layer .ace_bracket {
|
|
1246
|
+
margin: -1px 0 0 -1px;
|
|
1247
|
+
border: 1px solid rgb(192, 192, 192);
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
.ace-chrome .ace_marker-layer .ace_active-line {
|
|
1251
|
+
background: rgba(0, 0, 0, 0.07);
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
.ace-chrome .ace_gutter-active-line {
|
|
1255
|
+
background-color : #dcdcdc;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
.ace-chrome .ace_marker-layer .ace_selected-word {
|
|
1259
|
+
background: rgb(250, 250, 255);
|
|
1260
|
+
border: 1px solid rgb(200, 200, 250);
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
.ace-chrome .ace_storage,
|
|
1264
|
+
.ace-chrome .ace_keyword,
|
|
1265
|
+
.ace-chrome .ace_meta.ace_tag {
|
|
1266
|
+
color: rgb(147, 15, 128);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
.ace-chrome .ace_string.ace_regex {
|
|
1270
|
+
color: rgb(255, 0, 0)
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
.ace-chrome .ace_string {
|
|
1274
|
+
color: #1A1AA6;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
.ace-chrome .ace_entity.ace_other.ace_attribute-name {
|
|
1278
|
+
color: #994409;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
.ace-chrome .ace_indent-guide {
|
|
1282
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
.ace-chrome .ace_indent-guide-active {
|
|
1286
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
|
|
1287
|
+
}
|
|
1288
|
+
`}),ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(t,n,m){n.isDark=!1,n.cssClass="ace-chrome",n.cssText=t("./chrome-css");var i=t("../lib/dom");i.importCssString(n.cssText,n.cssClass,!1)}),function(){ace.require(["ace/theme/chrome"],function(t){d&&(d.exports=t)})}()})(tv);var nv={exports:{}};(function(d,e){ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],function(t,n,m){function i(y){var E=new Date().toLocaleString("en-us",y);return E.length==1?"0"+E:E}var a=t("./lib/dom"),p=t("./lib/oop"),o=t("./lib/event_emitter").EventEmitter,h=t("./lib/lang"),r=t("./range").Range,s=t("./range_list").RangeList,l=t("./keyboard/hash_handler").HashHandler,u=t("./tokenizer").Tokenizer,c=t("./clipboard"),f={CURRENT_WORD:function(y){return y.session.getTextRange(y.session.getWordRange())},SELECTION:function(y,E,T){var M=y.session.getTextRange();return T?M.replace(/\n\r?([ \t]*\S)/g,`
|
|
1289
|
+
`+T+"$1"):M},CURRENT_LINE:function(y){return y.session.getLine(y.getCursorPosition().row)},PREV_LINE:function(y){return y.session.getLine(y.getCursorPosition().row-1)},LINE_INDEX:function(y){return y.getCursorPosition().row},LINE_NUMBER:function(y){return y.getCursorPosition().row+1},SOFT_TABS:function(y){return y.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(y){return y.session.getTabSize()},CLIPBOARD:function(y){return c.getText&&c.getText()},FILENAME:function(y){return/[^/\\]*$/.exec(this.FILEPATH(y))[0]},FILENAME_BASE:function(y){return/[^/\\]*$/.exec(this.FILEPATH(y))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(y){return this.FILEPATH(y).replace(/[^/\\]*$/,"")},FILEPATH:function(y){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(y){var E=y.session.$mode||{};return E.blockComment&&E.blockComment.start||""},BLOCK_COMMENT_END:function(y){var E=y.session.$mode||{};return E.blockComment&&E.blockComment.end||""},LINE_COMMENT:function(y){var E=y.session.$mode||{};return E.lineCommentStart||""},CURRENT_YEAR:i.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:i.bind(null,{year:"2-digit"}),CURRENT_MONTH:i.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:i.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:i.bind(null,{month:"short"}),CURRENT_DATE:i.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:i.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:i.bind(null,{weekday:"short"}),CURRENT_HOUR:i.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:i.bind(null,{minute:"2-digit"}),CURRENT_SECOND:i.bind(null,{second:"2-digit"})};f.SELECTED_TEXT=f.SELECTION;var g=function(){function y(){this.snippetMap={},this.snippetNameMap={},this.variables=f}return y.prototype.getTokenizer=function(){return y.$tokenizer||this.createTokenizer()},y.prototype.createTokenizer=function(){function E($){return $=$.substr(1),/^\d+$/.test($)?[{tabstopId:parseInt($,10)}]:[{text:$}]}function T($){return"(?:[^\\\\"+$+"]|\\\\.)"}var M={regex:"/("+T("/")+"+)/",onMatch:function($,L,C){var w=C[0];return w.fmtString=!0,w.guard=$.slice(1,-1),w.flag="",""},next:"formatString"};return y.$tokenizer=new u({start:[{regex:/\\./,onMatch:function($,L,C){var w=$[1];return(w=="}"&&C.length||"`$\\".indexOf(w)!=-1)&&($=w),[$]}},{regex:/}/,onMatch:function($,L,C){return[C.length?C.shift():$]}},{regex:/\$(?:\d+|\w+)/,onMatch:E},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function($,L,C){var w=E($.substr(1));return C.unshift(w[0]),w},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+T("\\|")+"*\\|",onMatch:function($,L,C){var w=$.slice(1,-1).replace(/\\[,|\\]|,/g,function(S){return S.length==2?S[1]:"\0"}).split("\0").map(function(S){return{value:S}});return C[0].choices=w,[w[0]]},next:"start"},M,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function($,L,C){return C.length&&C[0].expectElse?(C[0].expectElse=!1,C[0].ifEnd={elseEnd:C[0]},[C[0].ifEnd]):":"}},{regex:/\\./,onMatch:function($,L,C){var w=$[1];return w=="}"&&C.length||"`$\\".indexOf(w)!=-1?$=w:w=="n"?$=`
|
|
1290
|
+
`:w=="t"?$=" ":"ulULE".indexOf(w)!=-1&&($={changeCase:w,local:w>"a"}),[$]}},{regex:"/\\w*}",onMatch:function($,L,C){var w=C.shift();return w&&(w.flag=$.slice(1,-1)),this.next=w&&w.tabstopId?"start":"",[w||$]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function($,L,C){return[{text:$.slice(1)}]}},{regex:/\${\w+/,onMatch:function($,L,C){var w={text:$.slice(2)};return C.unshift(w),[w]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function($,L,C){var w=C.shift();return this.next=w&&w.tabstopId?"start":"",[w||$]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function($,L,C){var w=C[0];return w.formatFunction=$.slice(2,-1),[C.shift()]},next:"formatString"},M,{regex:/:[\?\-+]?/,onMatch:function($,L,C){$[1]=="+"&&(C[0].ifEnd=C[0]),$[1]=="?"&&(C[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),y.$tokenizer},y.prototype.tokenizeTmSnippet=function(E,T){return this.getTokenizer().getLineTokens(E,T).tokens.map(function(M){return M.value||M})},y.prototype.getVariableValue=function(E,T,M){if(/^\d+$/.test(T))return(this.variables.__||{})[T]||"";if(/^[A-Z]\d+$/.test(T))return(this.variables[T[0]+"__"]||{})[T.substr(1)]||"";if(T=T.replace(/^TM_/,""),!this.variables.hasOwnProperty(T))return"";var $=this.variables[T];return typeof $=="function"&&($=this.variables[T](E,T,M)),$??""},y.prototype.tmStrFormat=function(E,T,M){if(!T.fmt)return E;var $=T.flag||"",L=T.guard;L=new RegExp(L,$.replace(/[^gim]/g,""));var C=typeof T.fmt=="string"?this.tokenizeTmSnippet(T.fmt,"formatString"):T.fmt,w=this,S=E.replace(L,function(){var k=w.variables.__;w.variables.__=[].slice.call(arguments);for(var _=w.resolveVariables(C,M),F="E",R=0;R<_.length;R++){var O=_[R];if(typeof O=="object")if(_[R]="",O.changeCase&&O.local){var V=_[R+1];V&&typeof V=="string"&&(O.changeCase=="u"?_[R]=V[0].toUpperCase():_[R]=V[0].toLowerCase(),_[R+1]=V.substr(1))}else O.changeCase&&(F=O.changeCase);else F=="U"?_[R]=O.toUpperCase():F=="L"&&(_[R]=O.toLowerCase())}return w.variables.__=k,_.join("")});return S},y.prototype.tmFormatFunction=function(E,T,M){return T.formatFunction=="upcase"?E.toUpperCase():T.formatFunction=="downcase"?E.toLowerCase():E},y.prototype.resolveVariables=function(E,T){function M(F){var R=E.indexOf(F,w+1);R!=-1&&(w=R)}for(var $=[],L="",C=!0,w=0;w<E.length;w++){var S=E[w];if(typeof S=="string"){$.push(S),S==`
|
|
1291
|
+
`?(C=!0,L=""):C&&(L=/^\t*/.exec(S)[0],C=/\S/.test(S));continue}if(S){if(C=!1,S.fmtString){var k=E.indexOf(S,w+1);k==-1&&(k=E.length),S.fmt=E.slice(w+1,k),w=k}if(S.text){var _=this.getVariableValue(T,S.text,L)+"";S.fmtString&&(_=this.tmStrFormat(_,S,T)),S.formatFunction&&(_=this.tmFormatFunction(_,S,T)),_&&!S.ifEnd?($.push(_),M(S)):!_&&S.ifEnd&&M(S.ifEnd)}else S.elseEnd?M(S.elseEnd):(S.tabstopId!=null||S.changeCase!=null)&&$.push(S)}}return $},y.prototype.getDisplayTextForSnippet=function(E,T){var M=v.call(this,E,T);return M.text},y.prototype.insertSnippetForSelection=function(E,T,M){M===void 0&&(M={});var $=v.call(this,E,T,M),L=E.getSelectionRange(),C=E.session.replace(L,$.text),w=new b(E),S=E.inVirtualSelectionMode&&E.selection.index;w.addTabstops($.tabstops,L.start,C,S)},y.prototype.insertSnippet=function(E,T,M){M===void 0&&(M={});var $=this;if(E.inVirtualSelectionMode)return $.insertSnippetForSelection(E,T,M);E.forEachSelection(function(){$.insertSnippetForSelection(E,T,M)},null,{keepOrder:!0}),E.tabstopManager&&E.tabstopManager.tabNext()},y.prototype.$getScope=function(E){var T=E.session.$mode.$id||"";if(T=T.split("/").pop(),T==="html"||T==="php"){T==="php"&&!E.session.$mode.inlinePhp&&(T="html");var M=E.getCursorPosition(),$=E.session.getState(M.row);typeof $=="object"&&($=$[0]),$.substring&&($.substring(0,3)=="js-"?T="javascript":$.substring(0,4)=="css-"?T="css":$.substring(0,4)=="php-"&&(T="php"))}return T},y.prototype.getActiveScopes=function(E){var T=this.$getScope(E),M=[T],$=this.snippetMap;return $[T]&&$[T].includeScopes&&M.push.apply(M,$[T].includeScopes),M.push("_"),M},y.prototype.expandWithTab=function(E,T){var M=this,$=E.forEachSelection(function(){return M.expandSnippetForSelection(E,T)},null,{keepOrder:!0});return $&&E.tabstopManager&&E.tabstopManager.tabNext(),$},y.prototype.expandSnippetForSelection=function(E,T){var M=E.getCursorPosition(),$=E.session.getLine(M.row),L=$.substring(0,M.column),C=$.substr(M.column),w=this.snippetMap,S;return this.getActiveScopes(E).some(function(k){var _=w[k];return _&&(S=this.findMatchingSnippet(_,L,C)),!!S},this),S?(T&&T.dryRun||(E.session.doc.removeInLine(M.row,M.column-S.replaceBefore.length,M.column+S.replaceAfter.length),this.variables.M__=S.matchBefore,this.variables.T__=S.matchAfter,this.insertSnippetForSelection(E,S.content),this.variables.M__=this.variables.T__=null),!0):!1},y.prototype.findMatchingSnippet=function(E,T,M){for(var $=E.length;$--;){var L=E[$];if(!(L.startRe&&!L.startRe.test(T))&&!(L.endRe&&!L.endRe.test(M))&&!(!L.startRe&&!L.endRe))return L.matchBefore=L.startRe?L.startRe.exec(T):[""],L.matchAfter=L.endRe?L.endRe.exec(M):[""],L.replaceBefore=L.triggerRe?L.triggerRe.exec(T)[0]:"",L.replaceAfter=L.endTriggerRe?L.endTriggerRe.exec(M)[0]:"",L}},y.prototype.register=function(E,T){function M(k){return k&&!/^\^?\(.*\)\$?$|^\\b$/.test(k)&&(k="(?:"+k+")"),k||""}function $(k,_,F){return k=M(k),_=M(_),k=_+k,k&&k[k.length-1]!="$"&&(k+="$"),new RegExp(k)}function L(k){k.scope||(k.scope=T||"_"),T=k.scope,C[T]||(C[T]=[],w[T]={});var _=w[T];if(k.name){var F=_[k.name];F&&S.unregister(F),_[k.name]=k}C[T].push(k),k.prefix&&(k.tabTrigger=k.prefix),!k.content&&k.body&&(k.content=Array.isArray(k.body)?k.body.join(`
|
|
1292
|
+
`):k.body),k.tabTrigger&&!k.trigger&&(!k.guard&&/^\w/.test(k.tabTrigger)&&(k.guard="\\b"),k.trigger=h.escapeRegExp(k.tabTrigger)),!(!k.trigger&&!k.guard&&!k.endTrigger&&!k.endGuard)&&(k.startRe=$(k.trigger,k.guard),k.triggerRe=new RegExp(k.trigger),k.endRe=$(k.endTrigger,k.endGuard),k.endTriggerRe=new RegExp(k.endTrigger))}var C=this.snippetMap,w=this.snippetNameMap,S=this;E||(E=[]),Array.isArray(E)?E.forEach(L):Object.keys(E).forEach(function(k){L(E[k])}),this._signal("registerSnippets",{scope:T})},y.prototype.unregister=function(E,T){function M(C){var w=L[C.scope||T];if(w&&w[C.name]){delete w[C.name];var S=$[C.scope||T],k=S&&S.indexOf(C);k>=0&&S.splice(k,1)}}var $=this.snippetMap,L=this.snippetNameMap;E.content?M(E):Array.isArray(E)&&E.forEach(M)},y.prototype.parseSnippetFile=function(E){E=E.replace(/\r/g,"");for(var T=[],M={},$=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,L;L=$.exec(E);){if(L[1])try{M=JSON.parse(L[1]),T.push(M)}catch{}if(L[4])M.content=L[4].replace(/^\t/gm,""),T.push(M),M={};else{var C=L[2],w=L[3];if(C=="regex"){var S=/\/((?:[^\/\\]|\\.)*)|$/g;M.guard=S.exec(w)[1],M.trigger=S.exec(w)[1],M.endTrigger=S.exec(w)[1],M.endGuard=S.exec(w)[1]}else C=="snippet"?(M.tabTrigger=w.match(/^\S*/)[0],M.name||(M.name=w)):C&&(M[C]=w)}}return T},y.prototype.getSnippetByName=function(E,T){var M=this.snippetNameMap,$;return this.getActiveScopes(T).some(function(L){var C=M[L];return C&&($=C[E]),!!$},this),$},y}();p.implement(g.prototype,o);var v=function(y,E,T){function M(j){for(var Q=[],Z=0;Z<j.length;Z++){var q=j[Z];if(typeof q=="object"){if(_[q.tabstopId])continue;var ne=j.lastIndexOf(q,Z-1);q=Q[ne]||{tabstopId:q.tabstopId}}Q[Z]=q}return Q}T===void 0&&(T={});var $=y.getCursorPosition(),L=y.session.getLine($.row),C=y.session.getTabString(),w=L.match(/^\s*/)[0];$.column<w.length&&(w=w.slice(0,$.column)),E=E.replace(/\r/g,"");var S=this.tokenizeTmSnippet(E);S=this.resolveVariables(S,y),S=S.map(function(j){return j==`
|
|
1293
|
+
`&&!T.excludeExtraIndent?j+w:typeof j=="string"?j.replace(/\t/g,C):j});var k=[];S.forEach(function(j,Q){if(typeof j=="object"){var Z=j.tabstopId,q=k[Z];if(q||(q=k[Z]=[],q.index=Z,q.value="",q.parents={}),q.indexOf(j)===-1){j.choices&&!q.choices&&(q.choices=j.choices),q.push(j);var ne=S.indexOf(j,Q+1);if(ne!==-1){var se=S.slice(Q+1,ne),pe=se.some(function(ie){return typeof ie=="object"});pe&&!q.value?q.value=se:se.length&&(!q.value||typeof q.value!="string")&&(q.value=se.join(""))}}}}),k.forEach(function(j){j.length=0});for(var _={},F=0;F<S.length;F++){var R=S[F];if(typeof R=="object"){var O=R.tabstopId,V=k[O],P=S.indexOf(R,F+1);if(_[O]){_[O]===R&&(delete _[O],Object.keys(_).forEach(function(j){V.parents[j]=!0}));continue}_[O]=R;var H=V.value;typeof H!="string"?H=M(H):R.fmt&&(H=this.tmStrFormat(H,R,y)),S.splice.apply(S,[F+1,Math.max(0,P-F)].concat(H,R)),V.indexOf(R)===-1&&V.push(R)}}var N=0,W=0,z="";return S.forEach(function(j){if(typeof j=="string"){var Q=j.split(`
|
|
1294
|
+
`);Q.length>1?(W=Q[Q.length-1].length,N+=Q.length-1):W+=j.length,z+=j}else j&&(j.start?j.end={row:N,column:W}:j.start={row:N,column:W})}),{text:z,tabstops:k,tokens:S}},b=function(){function y(E){if(this.index=0,this.ranges=[],this.tabstops=[],E.tabstopManager)return E.tabstopManager;E.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=h.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(E)}return y.prototype.attach=function(E){this.$openTabstops=null,this.selectedTabstop=null,this.editor=E,this.session=E.session,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},y.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},y.prototype.onChange=function(E){for(var T=E.action[0]=="r",M=this.selectedTabstop||{},$=M.parents||{},L=this.tabstops.slice(),C=0;C<L.length;C++){var w=L[C],S=w==M||$[w.index];if(w.rangeList.$bias=S?0:1,E.action=="remove"&&w!==M){var k=w.parents&&w.parents[M.index],_=w.rangeList.pointIndex(E.start,k);_=_<0?-_-1:_+1;var F=w.rangeList.pointIndex(E.end,k);F=F<0?-F-1:F-1;for(var R=w.rangeList.ranges.slice(_,F),O=0;O<R.length;O++)this.removeRange(R[O])}w.rangeList.$onChange(E)}var V=this.session;!this.$inChange&&T&&V.getLength()==1&&!V.getValue()&&this.detach()},y.prototype.updateLinkedFields=function(){var E=this.selectedTabstop;if(!(!E||!E.hasLinkedRanges||!E.firstNonLinked)){this.$inChange=!0;for(var T=this.session,M=T.getTextRange(E.firstNonLinked),$=0;$<E.length;$++){var L=E[$];if(L.linked){var C=L.original,w=n.snippetManager.tmStrFormat(M,C,this.editor);T.replace(L,w)}}this.$inChange=!1}},y.prototype.onAfterExec=function(E){E.command&&!E.command.readOnly&&this.updateLinkedFields()},y.prototype.onChangeSelection=function(){if(this.editor){for(var E=this.editor.selection.lead,T=this.editor.selection.anchor,M=this.editor.selection.isEmpty(),$=0;$<this.ranges.length;$++)if(!this.ranges[$].linked){var L=this.ranges[$].contains(E.row,E.column),C=M||this.ranges[$].contains(T.row,T.column);if(L&&C)return}this.detach()}},y.prototype.onChangeSession=function(){this.detach()},y.prototype.tabNext=function(E){var T=this.tabstops.length,M=this.index+(E||1);M=Math.min(Math.max(M,1),T),M==T&&(M=0),this.selectTabstop(M),this.updateTabstopMarkers(),M===0&&this.detach()},y.prototype.selectTabstop=function(E){this.$openTabstops=null;var T=this.tabstops[this.index];if(T&&this.addTabstopMarkers(T),this.index=E,T=this.tabstops[this.index],!(!T||!T.length)){this.selectedTabstop=T;var M=T.firstNonLinked||T;if(T.choices&&(M.cursor=M.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(M);else{var $=this.editor.multiSelect;$.toSingleRange(M);for(var L=0;L<T.length;L++)T.hasLinkedRanges&&T[L].linked||$.addRange(T[L].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},y.prototype.addTabstops=function(E,T,M){var $=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!E[0]){var L=r.fromPoints(M,M);x(L.start,T),x(L.end,T),E[0]=[L],E[0].index=0}var C=this.index,w=[C+1,0],S=this.ranges,k=this.snippetId=(this.snippetId||0)+1;E.forEach(function(_,F){var R=this.$openTabstops[F]||_;R.snippetId=k;for(var O=0;O<_.length;O++){var V=_[O],P=r.fromPoints(V.start,V.end||V.start);A(P.start,T),A(P.end,T),P.original=V,P.tabstop=R,S.push(P),R!=_?R.unshift(P):R[O]=P,V.fmtString||R.firstNonLinked&&$?(P.linked=!0,R.hasLinkedRanges=!0):R.firstNonLinked||(R.firstNonLinked=P)}R.firstNonLinked||(R.hasLinkedRanges=!1),R===_&&(w.push(R),this.$openTabstops[F]=R),this.addTabstopMarkers(R),R.rangeList=R.rangeList||new s,R.rangeList.$bias=0,R.rangeList.addList(R)},this),w.length>2&&(this.tabstops.length&&w.push(w.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,w))},y.prototype.addTabstopMarkers=function(E){var T=this.session;E.forEach(function(M){M.markerId||(M.markerId=T.addMarker(M,"ace_snippet-marker","text"))})},y.prototype.removeTabstopMarkers=function(E){var T=this.session;E.forEach(function(M){T.removeMarker(M.markerId),M.markerId=null})},y.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var E=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&E--,this.tabstops.forEach(function(T){T.snippetId===E?this.addTabstopMarkers(T):this.removeTabstopMarkers(T)},this)}},y.prototype.removeRange=function(E){var T=E.tabstop.indexOf(E);T!=-1&&E.tabstop.splice(T,1),T=this.ranges.indexOf(E),T!=-1&&this.ranges.splice(T,1),T=E.tabstop.rangeList.ranges.indexOf(E),T!=-1&&E.tabstop.splice(T,1),this.session.removeMarker(E.markerId),E.tabstop.length||(T=this.tabstops.indexOf(E.tabstop),T!=-1&&this.tabstops.splice(T,1),this.tabstops.length||this.detach())},y}();b.prototype.keyboardHandler=new l,b.prototype.keyboardHandler.bindKeys({Tab:function(y){n.snippetManager&&n.snippetManager.expandWithTab(y)||(y.tabstopManager.tabNext(1),y.renderer.scrollCursorIntoView())},"Shift-Tab":function(y){y.tabstopManager.tabNext(-1),y.renderer.scrollCursorIntoView()},Esc:function(y){y.tabstopManager.detach()}});var A=function(y,E){y.row==0&&(y.column+=E.column),y.row+=E.row},x=function(y,E){y.row==E.row&&(y.column-=E.column),y.row-=E.row};a.importCssString(`
|
|
1295
|
+
.ace_snippet-marker {
|
|
1296
|
+
-moz-box-sizing: border-box;
|
|
1297
|
+
box-sizing: border-box;
|
|
1298
|
+
background: rgba(194, 193, 208, 0.09);
|
|
1299
|
+
border: 1px dotted rgba(211, 208, 235, 0.62);
|
|
1300
|
+
position: absolute;
|
|
1301
|
+
}`,"snippets.css",!1),n.snippetManager=new g;var D=t("./editor").Editor;(function(){this.insertSnippet=function(y,E){return n.snippetManager.insertSnippet(this,y,E)},this.expandSnippet=function(y){return n.snippetManager.expandWithTab(this,y)}}).call(D.prototype)}),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/config","ace/lib/useragent"],function(t,n,m){var i=t("../virtual_renderer").VirtualRenderer,a=t("../editor").Editor,p=t("../range").Range,o=t("../lib/event"),h=t("../lib/lang"),r=t("../lib/dom"),s=t("../config").nls,l=t("./../lib/useragent"),u=function(A){return"suggest-aria-id:".concat(A)},c=l.isSafari?"menu":"listbox",f=l.isSafari?"menuitem":"option",g=l.isSafari?"aria-current":"aria-selected",v=function(A){var x=new i(A);x.$maxLines=4;var D=new a(x);return D.setHighlightActiveLine(!1),D.setShowPrintMargin(!1),D.renderer.setShowGutter(!1),D.renderer.setHighlightGutterLine(!1),D.$mouseHandler.$focusTimeout=0,D.$highlightTagPending=!0,D},b=function(){function A(x){var D=r.createElement("div"),y=v(D);x&&x.appendChild(D),D.style.display="none",y.renderer.content.style.cursor="default",y.renderer.setStyle("ace_autocomplete"),y.renderer.$textLayer.element.setAttribute("role",c),y.renderer.$textLayer.element.setAttribute("aria-roledescription",s("autocomplete.popup.aria-roledescription","Autocomplete suggestions")),y.renderer.$textLayer.element.setAttribute("aria-label",s("autocomplete.popup.aria-label","Autocomplete suggestions")),y.renderer.textarea.setAttribute("aria-hidden","true"),y.setOption("displayIndentGuides",!1),y.setOption("dragDelay",150);var E=function(){};y.focus=E,y.$isFocused=!0,y.renderer.$cursorLayer.restartTimer=E,y.renderer.$cursorLayer.element.style.opacity="0",y.renderer.$maxLines=8,y.renderer.$keepTextAreaAtCursor=!1,y.setHighlightActiveLine(!1),y.session.highlight(""),y.session.$searchHighlight.clazz="ace_highlight-marker",y.on("mousedown",function(S){var k=S.getDocumentPosition();y.selection.moveToPosition(k),$.start.row=$.end.row=k.row,S.stop()});var T,M=new p(-1,0,-1,1/0),$=new p(-1,0,-1,1/0);$.id=y.session.addMarker($,"ace_active-line","fullLine"),y.setSelectOnHover=function(S){S?M.id&&(y.session.removeMarker(M.id),M.id=null):M.id=y.session.addMarker(M,"ace_line-hover","fullLine")},y.setSelectOnHover(!1),y.on("mousemove",function(S){if(!T){T=S;return}if(!(T.x==S.x&&T.y==S.y)){T=S,T.scrollTop=y.renderer.scrollTop,y.isMouseOver=!0;var k=T.getDocumentPosition().row;M.start.row!=k&&(M.id||y.setRow(k),C(k))}}),y.renderer.on("beforeRender",function(){if(T&&M.start.row!=-1){T.$pos=null;var S=T.getDocumentPosition().row;M.id||y.setRow(S),C(S,!0)}}),y.renderer.on("afterRender",function(){for(var S=y.renderer.$textLayer,k=S.config.firstRow,_=S.config.lastRow;k<=_;k++){var F=S.element.childNodes[k-S.config.firstRow];F.setAttribute("role",f),F.setAttribute("aria-roledescription",s("autocomplete.popup.item.aria-roledescription","item")),F.setAttribute("aria-setsize",y.data.length),F.setAttribute("aria-describedby","doc-tooltip"),F.setAttribute("aria-posinset",k+1);var R=y.getData(k);if(R){var O="".concat(R.caption||R.value).concat(R.meta?", ".concat(R.meta):"");F.setAttribute("aria-label",O)}var V=F.querySelectorAll(".ace_completion-highlight");V.forEach(function(P){P.setAttribute("role","mark")})}}),y.renderer.on("afterRender",function(){var S=y.getRow(),k=y.renderer.$textLayer,_=k.element.childNodes[S-k.config.firstRow],F=document.activeElement;if(_!==y.selectedNode&&y.selectedNode&&(r.removeCssClass(y.selectedNode,"ace_selected"),y.selectedNode.removeAttribute(g),y.selectedNode.removeAttribute("id")),F.removeAttribute("aria-activedescendant"),y.selectedNode=_,_){var R=u(S);r.addCssClass(_,"ace_selected"),_.id=R,k.element.setAttribute("aria-activedescendant",R),F.setAttribute("aria-activedescendant",R),_.setAttribute(g,"true")}});var L=function(){C(-1)},C=function(S,k){S!==M.start.row&&(M.start.row=M.end.row=S,k||y.session._emit("changeBackMarker"),y._emit("changeHoverMarker"))};y.getHoveredRow=function(){return M.start.row},o.addListener(y.container,"mouseout",function(){y.isMouseOver=!1,L()}),y.on("hide",L),y.on("changeSelection",L),y.session.doc.getLength=function(){return y.data.length},y.session.doc.getLine=function(S){var k=y.data[S];return typeof k=="string"?k:k&&k.value||""};var w=y.session.bgTokenizer;return w.$tokenizeRow=function(S){function k(j,Q){j&&F.push({type:(_.className||"")+(Q||""),value:j})}var _=y.data[S],F=[];if(!_)return F;typeof _=="string"&&(_={value:_});for(var R=_.caption||_.value||_.name,O=R.toLowerCase(),V=(y.filterText||"").toLowerCase(),P=0,H=0,N=0;N<=V.length;N++)if(N!=H&&(_.matchMask&1<<N||N==V.length)){var W=V.slice(H,N);H=N;var z=O.indexOf(W,P);if(z==-1)continue;k(R.slice(P,z),""),P=z+W.length,k(R.slice(z,P),"completion-highlight")}return k(R.slice(P,R.length),""),F.push({type:"completion-spacer",value:" "}),_.meta&&F.push({type:"completion-meta",value:_.meta}),_.message&&F.push({type:"completion-message",value:_.message}),F},w.$updateOnChange=E,w.start=E,y.session.$computeWidth=function(){return this.screenWidth=0},y.isOpen=!1,y.isTopdown=!1,y.autoSelect=!0,y.filterText="",y.isMouseOver=!1,y.data=[],y.setData=function(S,k){y.filterText=k||"",y.setValue(h.stringRepeat(`
|
|
1302
|
+
`,S.length),-1),y.data=S||[],y.setRow(0)},y.getData=function(S){return y.data[S]},y.getRow=function(){return $.start.row},y.setRow=function(S){S=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,S)),$.start.row!=S&&(y.selection.clearSelection(),$.start.row=$.end.row=S||0,y.session._emit("changeBackMarker"),y.moveCursorTo(S||0,0),y.isOpen&&y._signal("select"))},y.on("changeSelection",function(){y.isOpen&&y.setRow(y.selection.lead.row),y.renderer.scrollCursorIntoView()}),y.hide=function(){this.container.style.display="none",y.anchorPos=null,y.anchor=null,y.isOpen&&(y.isOpen=!1,this._signal("hide"))},y.tryShow=function(S,k,_,F){if(!F&&y.isOpen&&y.anchorPos&&y.anchor&&y.anchorPos.top===S.top&&y.anchorPos.left===S.left&&y.anchor===_)return!0;var R=this.container,O=window.innerHeight,V=window.innerWidth,P=this.renderer,H=P.$maxLines*k*1.4,N={top:0,bottom:0},W=O-S.top-3*this.$borderSize-k,z=S.top-3*this.$borderSize;_||(z<=W||W>=H?_="bottom":_="top"),_==="top"?(N.bottom=S.top-this.$borderSize,N.top=N.bottom-H):_==="bottom"&&(N.top=S.top+k+this.$borderSize,N.bottom=N.top+H);var j=N.top>=0&&N.bottom<=O;if(!F&&!j)return!1;j?P.$maxPixelHeight=null:_==="top"?P.$maxPixelHeight=z:P.$maxPixelHeight=W,_==="top"?(R.style.top="",R.style.bottom=O-N.bottom+"px",y.isTopdown=!1):(R.style.top=N.top+"px",R.style.bottom="",y.isTopdown=!0),R.style.display="";var Q=S.left;return Q+R.offsetWidth>V&&(Q=V-R.offsetWidth),R.style.left=Q+"px",R.style.right="",y.isOpen||(y.isOpen=!0,this._signal("show"),T=null),y.anchorPos=S,y.anchor=_,!0},y.show=function(S,k,_){this.tryShow(S,k,_?"bottom":void 0,!0)},y.goTo=function(S){var k=this.getRow(),_=this.session.getLength()-1;switch(S){case"up":k=k<=0?_:k-1;break;case"down":k=k>=_?-1:k+1;break;case"start":k=0;break;case"end":k=_}this.setRow(k)},y.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},y.$imageSize=0,y.$borderSize=1,y}return A}();r.importCssString(`
|
|
1303
|
+
.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
|
|
1304
|
+
background-color: #CAD6FA;
|
|
1305
|
+
z-index: 1;
|
|
1306
|
+
}
|
|
1307
|
+
.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
|
|
1308
|
+
background-color: #3a674e;
|
|
1309
|
+
}
|
|
1310
|
+
.ace_editor.ace_autocomplete .ace_line-hover {
|
|
1311
|
+
border: 1px solid #abbffe;
|
|
1312
|
+
margin-top: -1px;
|
|
1313
|
+
background: rgba(233,233,253,0.4);
|
|
1314
|
+
position: absolute;
|
|
1315
|
+
z-index: 2;
|
|
1316
|
+
}
|
|
1317
|
+
.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {
|
|
1318
|
+
border: 1px solid rgba(109, 150, 13, 0.8);
|
|
1319
|
+
background: rgba(58, 103, 78, 0.62);
|
|
1320
|
+
}
|
|
1321
|
+
.ace_completion-meta {
|
|
1322
|
+
opacity: 0.5;
|
|
1323
|
+
margin-left: 0.9em;
|
|
1324
|
+
}
|
|
1325
|
+
.ace_completion-message {
|
|
1326
|
+
margin-left: 0.9em;
|
|
1327
|
+
color: blue;
|
|
1328
|
+
}
|
|
1329
|
+
.ace_editor.ace_autocomplete .ace_completion-highlight{
|
|
1330
|
+
color: #2d69c7;
|
|
1331
|
+
}
|
|
1332
|
+
.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{
|
|
1333
|
+
color: #93ca12;
|
|
1334
|
+
}
|
|
1335
|
+
.ace_editor.ace_autocomplete {
|
|
1336
|
+
width: 300px;
|
|
1337
|
+
z-index: 200000;
|
|
1338
|
+
border: 1px lightgray solid;
|
|
1339
|
+
position: fixed;
|
|
1340
|
+
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
1341
|
+
line-height: 1.4;
|
|
1342
|
+
background: #fefefe;
|
|
1343
|
+
color: #111;
|
|
1344
|
+
}
|
|
1345
|
+
.ace_dark.ace_editor.ace_autocomplete {
|
|
1346
|
+
border: 1px #484747 solid;
|
|
1347
|
+
box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);
|
|
1348
|
+
line-height: 1.4;
|
|
1349
|
+
background: #25282c;
|
|
1350
|
+
color: #c1c1c1;
|
|
1351
|
+
}
|
|
1352
|
+
.ace_autocomplete .ace_text-layer {
|
|
1353
|
+
width: calc(100% - 8px);
|
|
1354
|
+
}
|
|
1355
|
+
.ace_autocomplete .ace_line {
|
|
1356
|
+
display: flex;
|
|
1357
|
+
align-items: center;
|
|
1358
|
+
}
|
|
1359
|
+
.ace_autocomplete .ace_line > * {
|
|
1360
|
+
min-width: 0;
|
|
1361
|
+
flex: 0 0 auto;
|
|
1362
|
+
}
|
|
1363
|
+
.ace_autocomplete .ace_line .ace_ {
|
|
1364
|
+
flex: 0 1 auto;
|
|
1365
|
+
overflow: hidden;
|
|
1366
|
+
text-overflow: ellipsis;
|
|
1367
|
+
}
|
|
1368
|
+
.ace_autocomplete .ace_completion-spacer {
|
|
1369
|
+
flex: 1;
|
|
1370
|
+
}
|
|
1371
|
+
.ace_autocomplete.ace_loading:after {
|
|
1372
|
+
content: "";
|
|
1373
|
+
position: absolute;
|
|
1374
|
+
top: 0px;
|
|
1375
|
+
height: 2px;
|
|
1376
|
+
width: 8%;
|
|
1377
|
+
background: blue;
|
|
1378
|
+
z-index: 100;
|
|
1379
|
+
animation: ace_progress 3s infinite linear;
|
|
1380
|
+
animation-delay: 300ms;
|
|
1381
|
+
transform: translateX(-100%) scaleX(1);
|
|
1382
|
+
}
|
|
1383
|
+
@keyframes ace_progress {
|
|
1384
|
+
0% { transform: translateX(-100%) scaleX(1) }
|
|
1385
|
+
50% { transform: translateX(625%) scaleX(2) }
|
|
1386
|
+
100% { transform: translateX(1500%) scaleX(3) }
|
|
1387
|
+
}
|
|
1388
|
+
@media (prefers-reduced-motion) {
|
|
1389
|
+
.ace_autocomplete.ace_loading:after {
|
|
1390
|
+
transform: translateX(625%) scaleX(2);
|
|
1391
|
+
animation: none;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
`,"autocompletion.css",!1),n.AcePopup=b,n.$singleLineEditor=v,n.getAriaId=u}),ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(t,n,m){var i=function(){function a(p){this.editor=p,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}return a.prototype.setScreenReaderContent=function(p){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var h=this.popup.getRow(),r=this.popup.renderer.$textLayer,s=r.element.childNodes[h-r.config.firstRow];if(s){for(var l="doc-tooltip ",u=0;u<this._lines.length;u++)l+="ace-inline-screenreader-line-".concat(u," ");s.setAttribute("aria-describedby",l)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=p.split(/\r\n|\r|\n/);var o=this.createCodeBlock();this.screenReaderDiv.appendChild(o)},a.prototype.destroy=function(){this.screenReaderDiv.remove()},a.prototype.createCodeBlock=function(){var p=document.createElement("pre");p.setAttribute("id","ace-inline-screenreader");for(var o=0;o<this._lines.length;o++){var h=document.createElement("code");h.setAttribute("id","ace-inline-screenreader-line-".concat(o));var r=document.createTextNode(this._lines[o]);h.appendChild(r),p.appendChild(h)}return p},a}();n.AceInlineScreenReader=i}),ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],function(t,n,m){var i=t("../snippets").snippetManager,a=t("./inline_screenreader").AceInlineScreenReader,p=function(){function o(){this.editor=null}return o.prototype.show=function(h,r,s){if(s=s||"",h&&this.editor&&this.editor!==h&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!h||!r)return!1;this.inlineScreenReader||(this.inlineScreenReader=new a(h));var l=r.snippet?i.getDisplayTextForSnippet(h,r.snippet):r.value;return r.hideInlinePreview||!l||!l.startsWith(s)?!1:(this.editor=h,this.inlineScreenReader.setScreenReaderContent(l),l=l.slice(s.length),l===""?h.removeGhostText():h.setGhostText(l),!0)},o.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},o.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},o.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&(this.inlineScreenReader.destroy(),this.inlineScreenReader=null)},o}();n.AceInline=p}),ace.define("ace/autocomplete/util",["require","exports","module"],function(t,n,m){n.parForEach=function(a,p,o){var h=0,r=a.length;r===0&&o();for(var s=0;s<r;s++)p(a[s],function(l,u){h++,h===r&&o(l,u)})};var i=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;n.retrievePrecedingIdentifier=function(a,p,o){o=o||i;for(var h=[],r=p-1;r>=0&&o.test(a[r]);r--)h.push(a[r]);return h.reverse().join("")},n.retrieveFollowingIdentifier=function(a,p,o){o=o||i;for(var h=[],r=p;r<a.length&&o.test(a[r]);r++)h.push(a[r]);return h},n.getCompletionPrefix=function(a){var p=a.getCursorPosition(),o=a.session.getLine(p.row),h;return a.completers.forEach(function(r){r.identifierRegexps&&r.identifierRegexps.forEach(function(s){!h&&s&&(h=this.retrievePrecedingIdentifier(o,p.column,s))}.bind(this))}.bind(this)),h||this.retrievePrecedingIdentifier(o,p.column)},n.triggerAutocomplete=function(a,o){var o=o??a.session.getPrecedingCharacter();return a.completers.some(function(h){if(h.triggerCharacters&&Array.isArray(h.triggerCharacters))return h.triggerCharacters.includes(o)})}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event","ace/lib/scroll"],function(t,n,m){var i=t("./keyboard/hash_handler").HashHandler,a=t("./autocomplete/popup").AcePopup,p=t("./autocomplete/inline").AceInline,o=t("./autocomplete/popup").getAriaId,h=t("./autocomplete/util"),r=t("./lib/lang"),s=t("./lib/dom"),l=t("./snippets").snippetManager,u=t("./config"),c=t("./lib/event"),f=t("./lib/scroll").preventParentScroll,g=function(x,D){D.completer&&D.completer.destroy()},v=function(){function x(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new i,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=r.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=r.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=r.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=r.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=r.delayedCall(function(){var D=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!D||this.editor.completers.length===0||(this.completions=new A(x.completionsForLoading),this.openPopup(this.editor,D.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0))}.bind(this),this.stickySelectionDelay)}return Object.defineProperty(x,"completionsForLoading",{get:function(){return[{caption:u.nls("autocomplete.loading","Loading..."),value:""}]},enumerable:!1,configurable:!0}),x.prototype.$init=function(){return this.popup=new a(this.parentNode||document.body||document.documentElement),this.popup.on("click",function(D){this.insertMatch(),D.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)),c.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},x.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new p,this.inlineRenderer},x.prototype.getPopup=function(){return this.popup||this.$init()},x.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1},x.prototype.$seen=function(D){!this.hasSeen.has(D)&&D&&D.completer&&D.completer.onSeen&&typeof D.completer.onSeen=="function"&&(D.completer.onSeen(this.editor,D),this.hasSeen.add(D))},x.prototype.$onPopupChange=function(D){if(this.inlineRenderer&&this.inlineEnabled){var y=D?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(y),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule()}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null)},x.prototype.$updateGhostText=function(D){var y=this.base.row,E=this.base.column,T=this.editor.getCursorPosition().column,M=this.editor.session.getLine(y).slice(E,T);this.inlineRenderer.show(this.editor,D,M)?this.$seen(D):this.inlineRenderer.hide()},x.prototype.$onPopupRender=function(){var D=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var y=this.popup.getFirstVisibleRow();y<=this.popup.getLastVisibleRow();y++){var E=this.popup.getData(y);E&&(!D||E.hideInlinePreview)&&this.$seen(E)}},x.prototype.$onPopupShow=function(D){this.$onPopupChange(D),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},x.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var D=this.editor.container.parentNode,y=[];D;)y.push(D),D.addEventListener("scroll",this.onLayoutChange,{passive:!0}),D=D.parentNode;this.$elements=y}},x.prototype.unObserveLayoutChanges=function(){var D=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(y){y.removeEventListener("scroll",D.onLayoutChange,{passive:!0})}),this.$elements=null},x.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},x.prototype.$updatePopupPosition=function(){var D=this.editor,y=D.renderer,E=y.layerConfig.lineHeight,T=y.$cursorLayer.getPixelPosition(this.base,!0);T.left-=this.popup.getTextLeftOffset();var M=D.container.getBoundingClientRect();T.top+=M.top-y.layerConfig.offset,T.left+=M.left-D.renderer.scrollLeft,T.left+=y.gutterWidth;var $={top:T.top,left:T.left};y.$ghostText&&y.$ghostTextWidget&&this.base.row===y.$ghostText.position.row&&($.top+=y.$ghostTextWidget.el.offsetHeight);var L=D.container.getBoundingClientRect().bottom-E,C=L<$.top?{top:L,left:$.left}:$;this.popup.tryShow(C,E,"bottom")||this.popup.tryShow(T,E,"top")||this.popup.show(T,E)},x.prototype.openPopup=function(D,y,E){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var T=this.popup.getRow(),M=this.popup.data[T];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:o(this.popup.getRow()),inline:this.inlineEnabled}),D.keyBinding.addKeyboardHandler(this.keyboardHandler);var $;this.stickySelection&&($=this.popup.data.indexOf(M)),(!$||$===-1)&&($=0),this.popup.setRow(this.autoSelect?$:-1),$===T&&M!==this.completions.filtered[$]&&this.$onPopupChange();var L=this.inlineRenderer&&this.inlineEnabled;if($===T&&L){var C=this.popup.getData(this.popup.getRow());this.$updateGhostText(C)}E||(this.popup.setTheme(D.getTheme()),this.popup.setFontSize(D.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},x.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()},x.prototype.changeListener=function(D){var y=this.editor.selection.lead;(y.row!=this.base.row||y.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},x.prototype.blurListener=function(D){var y=document.activeElement,E=this.editor.textInput.getElement(),T=D.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(D.relatedTarget),M=this.popup&&this.popup.container;y!=E&&y.parentNode!=M&&!T&&y!=this.tooltipNode&&D.relatedTarget!=E&&this.detach()},x.prototype.mousedownListener=function(D){this.detach()},x.prototype.mousewheelListener=function(D){this.popup&&!this.popup.isMouseOver&&this.detach()},x.prototype.mouseOutListener=function(D){this.popup.isOpen&&this.$updatePopupPosition()},x.prototype.goTo=function(D){this.popup.goTo(D)},x.prototype.insertMatch=function(D,y){if(D||(D=this.popup.getData(this.popup.getRow())),!D)return!1;if(D.value==="")return this.detach();var E=this.completions,T=this.getCompletionProvider().insertMatch(this.editor,D,E.filterText,y);return this.completions==E&&this.detach(),T},x.prototype.showPopup=function(D,y){this.editor&&this.detach(),this.activated=!0,this.editor=D,D.completer!=this&&(D.completer&&D.completer.detach(),D.completer=this),D.on("changeSelection",this.changeListener),D.on("blur",this.blurListener),D.on("mousedown",this.mousedownListener),D.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,y)},x.prototype.getCompletionProvider=function(D){return this.completionProvider||(this.completionProvider=new b(D)),this.completionProvider},x.prototype.gatherCompletions=function(D,y){return this.getCompletionProvider().gatherCompletions(D,y)},x.prototype.updateCompletions=function(D,y){if(D&&this.base&&this.completions){var T=this.editor.getCursorPosition(),M=this.editor.session.getTextRange({start:this.base,end:T});if(M==this.completions.filterText)return;if(this.completions.setFilter(M),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==M&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,M,D);return}if(y&&y.matches){var T=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(T.row,T.column),this.base.$insertRight=!0,this.completions=new A(y.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,"",D)}var E=this.editor.getSession(),T=this.editor.getCursorPosition(),M=h.getCompletionPrefix(this.editor);this.base=E.doc.createAnchor(T.row,T.column-M.length),this.base.$insertRight=!0;var $={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:M,pos:T}).provideCompletions(this.editor,$,function(L,C,w){var S=C.filtered,k=h.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),w){if(!S.length){var _=!this.autoShown&&this.emptyMessage;if(typeof _=="function"&&(_=this.emptyMessage(k)),_){var F=[{caption:_,value:""}];this.completions=new A(F),this.openPopup(this.editor,k,D),this.popup.renderer.setStyle("ace_loading",!1),this.popup.renderer.setStyle("ace_empty-message",!0);return}return this.detach()}if(S.length==1&&S[0].value==k&&!S[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&S.length==1)return this.insertMatch(S[0])}this.completions=!w&&this.showLoadingState?new A(x.completionsForLoading.concat(S),C.filterText):C,this.openPopup(this.editor,k,D),this.popup.renderer.setStyle("ace_empty-message",!1),this.popup.renderer.setStyle("ace_loading",!w)}.bind(this)),this.showLoadingState&&!this.autoShown&&(!this.popup||!this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2)},x.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},x.prototype.updateDocTooltip=function(){var D=this.popup,y=this.completions.filtered,E=y&&(y[D.getHoveredRow()]||y[D.getRow()]),T=null;if(!E||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var M=this.editor.completers.length,$=0;$<M;$++){var L=this.editor.completers[$];if(L.getDocTooltip&&E.completerId===L.id){T=L.getDocTooltip(E);break}}if(!T&&typeof E!="string"&&(T=E),typeof T=="string"&&(T={docText:T}),!T||!T.docHTML&&!T.docText)return this.hideDocTooltip();this.showDocTooltip(T)},x.prototype.showDocTooltip=function(D){this.tooltipNode||(this.tooltipNode=s.createElement("div"),this.tooltipNode.style.margin="0",this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.style.overscrollBehavior="contain",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"),this.tooltipNode.addEventListener("wheel",f));var y=this.editor.renderer.theme;this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(y.isDark?"ace_dark ":"")+(y.cssClass||"");var E=this.tooltipNode;D.docHTML?E.innerHTML=D.docHTML:D.docText&&(E.textContent=D.docText),E.parentNode||this.popup.container.appendChild(this.tooltipNode);var T=this.popup,M=T.container.getBoundingClientRect();E.style.top=T.container.style.top,E.style.bottom=T.container.style.bottom,E.style.display="block",window.innerWidth-M.right<320?M.left<320?T.isTopdown?(E.style.top=M.bottom+"px",E.style.left=M.left+"px",E.style.right="",E.style.bottom=""):(E.style.top=T.container.offsetTop-E.offsetHeight+"px",E.style.left=M.left+"px",E.style.right="",E.style.bottom=""):(E.style.right=window.innerWidth-M.left+"px",E.style.left=""):(E.style.left=M.right+1+"px",E.style.right="")},x.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var D=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==D&&this.editor.focus(),this.tooltipNode=null,D.parentNode&&D.parentNode.removeChild(D)}},x.prototype.onTooltipClick=function(D){for(var y=D.target;y&&y!=this.tooltipNode;){if(y.nodeName=="A"&&y.href){y.rel="noreferrer",y.target="_blank";break}y=y.parentNode}},x.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var D=this.popup.container;D&&D.parentNode&&D.parentNode.removeChild(D)}this.editor&&this.editor.completer==this&&(this.editor.off("destroy",g),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},x.for=function(D){return D.completer instanceof x||(D.completer&&(D.completer.destroy(),D.completer=null),u.get("sharedPopups")?(x.$sharedInstance||(x.$sharedInstance=new x),D.completer=x.$sharedInstance):(D.completer=new x,D.once("destroy",g))),D.completer},x}();v.prototype.commands={Up:function(x){x.completer.goTo("up")},Down:function(x){x.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(x){x.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(x){x.completer.goTo("end")},Esc:function(x){x.completer.detach()},Return:function(x){return x.completer.insertMatch()},"Shift-Return":function(x){x.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(x){var D=x.completer.insertMatch();if(D||x.tabstopManager)return D;x.completer.goTo("down")},Backspace:function(x){x.execCommand("backspace");var D=h.getCompletionPrefix(x);!D&&x.completer&&x.completer.detach()},PageUp:function(x){x.completer.popup.gotoPageUp()},PageDown:function(x){x.completer.popup.gotoPageDown()}},v.startCommand={name:"startAutocomplete",exec:function(x,D){var y=v.for(x);y.autoInsert=!1,y.autoSelect=!0,y.autoShown=!1,y.showPopup(x,D),y.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var b=function(){function x(D){this.initialPosition=D,this.active=!0}return x.prototype.insertByIndex=function(D,y,E){return!this.completions||!this.completions.filtered?!1:this.insertMatch(D,this.completions.filtered[y],E)},x.prototype.insertMatch=function(D,y,E){if(!y)return!1;if(D.startOperation({command:{name:"insertMatch"}}),y.completer&&y.completer.insertMatch)y.completer.insertMatch(D,y);else{if(!this.completions)return!1;var T=this.completions.filterText.length,M=0;if(y.range&&y.range.start.row===y.range.end.row&&(T-=this.initialPosition.prefix.length,T+=this.initialPosition.pos.column-y.range.start.column,M+=y.range.end.column-this.initialPosition.pos.column),T||M){var $;D.selection.getAllRanges?$=D.selection.getAllRanges():$=[D.getSelectionRange()];for(var L=0,C;C=$[L];L++)C.start.column-=T,C.end.column+=M,D.session.remove(C)}y.snippet?l.insertSnippet(D,y.snippet):this.$insertString(D,y),y.completer&&y.completer.onInsert&&typeof y.completer.onInsert=="function"&&y.completer.onInsert(D,y),y.command&&y.command==="startAutocomplete"&&D.execCommand(y.command)}return D.endOperation(),!0},x.prototype.$insertString=function(D,y){var E=y.value||y;D.execCommand("insertstring",E)},x.prototype.gatherCompletions=function(D,y){var E=D.getSession(),T=D.getCursorPosition(),M=h.getCompletionPrefix(D),$=[];this.completers=D.completers;var L=D.completers.length;return D.completers.forEach(function(C,w){C.getCompletions(D,E,T,M,function(S,k){C.hideInlinePreview&&(k=k.map(function(_){return Object.assign(_,{hideInlinePreview:C.hideInlinePreview})})),!S&&k&&($=$.concat(k)),y(null,{prefix:h.getCompletionPrefix(D),matches:$,finished:--L===0})})}),!0},x.prototype.provideCompletions=function(D,y,E){var T=function(C){var w=C.prefix,S=C.matches;this.completions=new A(S),y.exactMatch&&(this.completions.exactMatch=!0),y.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(w),(C.finished||this.completions.filtered.length)&&E(null,this.completions,C.finished)}.bind(this),M=!0,$=null;if(this.gatherCompletions(D,function(C,w){if(this.active){C&&(E(C,[],!0),this.detach());var S=w.prefix;if(S.indexOf(w.prefix)===0){if(M){$=w;return}T(w)}}}.bind(this)),M=!1,$){var L=$;$=null,T(L)}},x.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(D){typeof D.cancel=="function"&&D.cancel()})},x}(),A=function(){function x(D,y){this.all=D,this.filtered=D,this.filterText=y||"",this.exactMatch=!1,this.ignoreCaption=!1}return x.prototype.setFilter=function(D){if(D.length>this.filterText&&D.lastIndexOf(this.filterText,0)===0)var y=this.filtered;else var y=this.all;this.filterText=D,y=this.filterCompletions(y,this.filterText),y=y.sort(function(T,M){return M.exactMatch-T.exactMatch||M.$score-T.$score||(T.caption||T.value).localeCompare(M.caption||M.value)});var E=null;y=y.filter(function(T){var M=T.snippet||T.caption||T.value;return M===E?!1:(E=M,!0)}),this.filtered=y},x.prototype.filterCompletions=function(D,y){var E=[],T=y.toUpperCase(),M=y.toLowerCase();e:for(var $=0,L;L=D[$];$++){if(L.skipFilter){L.$score=L.score,E.push(L);continue}var C=!this.ignoreCaption&&L.caption||L.value||L.snippet;if(C){var w=-1,S=0,k=0,_,F;if(this.exactMatch){if(y!==C.substr(0,y.length))continue e}else{var R=C.toLowerCase().indexOf(M);if(R>-1)k=R;else for(var O=0;O<y.length;O++){var V=C.indexOf(M[O],w+1),P=C.indexOf(T[O],w+1);if(_=V>=0&&(P<0||V<P)?V:P,_<0)continue e;F=_-w-1,F>0&&(w===-1&&(k+=10),k+=F,S|=1<<O),w=_}}L.matchMask=S,L.exactMatch=k?0:1,L.$score=(L.score||0)-k,E.push(L)}}return E},x}();n.Autocomplete=v,n.CompletionProvider=b,n.FilteredList=A}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(t,n,m){function i(h,r){var s=h.getTextRange(p.fromPoints({row:0,column:0},r));return s.split(o).length-1}function a(h,r){var s=i(h,r),l=h.getValue().split(o),u=Object.create(null),c=l[s];return l.forEach(function(f,g){if(!(!f||f===c)){var v=Math.abs(s-g),b=l.length-v;u[f]?u[f]=Math.max(b,u[f]):u[f]=b}}),u}var p=t("../range").Range,o=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;n.getCompletions=function(h,r,s,l,u){var c=a(r,s),f=Object.keys(c);u(null,f.map(function(g){return{caption:g,value:g,score:c[g],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(t,n,m){var i=t("../snippets").snippetManager,a=t("../autocomplete").Autocomplete,p=t("../config"),o=t("../lib/lang"),h=t("../autocomplete/util"),r=t("../autocomplete/text_completer"),s={getCompletions:function(T,M,$,L,C){if(M.$mode.completer)return M.$mode.completer.getCompletions(T,M,$,L,C);var w=T.session.getState($.row),S=M.$mode.getCompletions(w,M,$,L);S=S.map(function(k){return k.completerId=s.id,k}),C(null,S)},id:"keywordCompleter"},l=function(T){var M={};return T.replace(/\${(\d+)(:(.*?))?}/g,function($,L,C,w){return M[L]=w||""}).replace(/\$(\d+?)/g,function($,L){return M[L]})},u={getCompletions:function(T,M,$,L,C){var w=[],S=M.getTokenAt($.row,$.column);S&&S.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?w.push("html-tag"):w=i.getActiveScopes(T);var k=i.snippetMap,_=[];w.forEach(function(F){for(var R=k[F]||[],O=R.length;O--;){var V=R[O],P=V.name||V.tabTrigger;P&&_.push({caption:P,snippet:V.content,meta:V.tabTrigger&&!V.name?V.tabTrigger+"⇥ ":"snippet",completerId:u.id})}},this),C(null,_)},getDocTooltip:function(T){T.snippet&&!T.docHTML&&(T.docHTML=["<b>",o.escapeHTML(T.caption),"</b>","<hr></hr>",o.escapeHTML(l(T.snippet))].join(""))},id:"snippetCompleter"},c=[u,r,s];n.setCompleters=function(T){c.length=0,T&&c.push.apply(c,T)},n.addCompleter=function(T){c.push(T)},n.textCompleter=r,n.keyWordCompleter=s,n.snippetCompleter=u;var f={name:"expandSnippet",exec:function(T){return i.expandWithTab(T)},bindKey:"Tab"},g=function(T,M){v(M.session.$mode)},v=function(T){typeof T=="string"&&(T=p.$modes[T]),T&&(i.files||(i.files={}),b(T.$id,T.snippetFileId),T.modes&&T.modes.forEach(v))},b=function(T,M){!M||!T||i.files[T]||(i.files[T]={},p.loadModule(M,function($){$&&(i.files[T]=$,!$.snippets&&$.snippetText&&($.snippets=i.parseSnippetFile($.snippetText)),i.register($.snippets||[],$.scope),$.includeScopes&&(i.snippetMap[$.scope].includeScopes=$.includeScopes,$.includeScopes.forEach(function(L){v("ace/mode/"+L)})))}))},A=function(T){var M=T.editor,$=M.completer&&M.completer.activated;if(T.command.name==="backspace")$&&!h.getCompletionPrefix(M)&&M.completer.detach();else if(T.command.name==="insertstring"&&!$){x=T;var L=T.editor.$liveAutocompletionDelay;L?D.delay(L):y(T)}},x,D=o.delayedCall(function(){y(x)},0),y=function(T){var M=T.editor,$=h.getCompletionPrefix(M),L=T.args,C=h.triggerAutocomplete(M,L);if($&&$.length>=M.$liveAutocompletionThreshold||C){var w=a.for(M);w.autoShown=!0,w.showPopup(M)}},E=t("../editor").Editor;t("../config").defineOptions(E.prototype,"editor",{enableBasicAutocompletion:{set:function(T){T?(this.completers||(this.completers=Array.isArray(T)?T:c),this.commands.addCommand(a.startCommand)):this.commands.removeCommand(a.startCommand)},value:!1},enableLiveAutocompletion:{set:function(T){T?(this.completers||(this.completers=Array.isArray(T)?T:c),this.commands.on("afterExec",A)):this.commands.off("afterExec",A)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(T){T?(this.commands.addCommand(f),this.on("changeMode",g),g(null,this)):(this.commands.removeCommand(f),this.off("changeMode",g))},value:!1}})}),function(){ace.require(["ace/ext/language_tools"],function(t){d&&(d.exports=t)})}()})(nv);const Ns={jsonError:{border:"1px solid red",minHeight:200},jsonNoError:{border:"1px solid #00000000",minHeight:200}};function iv(d){return I.createElement(Qg,{style:d.error===!0?Ns.jsonError:d.error===!1?Ns.jsonNoError:void 0,mode:d.mode||"json",width:"100%",height:"100%",showPrintMargin:d.editValueMode,showGutter:d.editValueMode,highlightActiveLine:d.editValueMode,defaultValue:d.defaultValue,theme:d.themeType==="dark"?"clouds_midnight":"chrome",value:d.value,readOnly:!d.onChange,onChange:e=>d.onChange(e),name:d.name||"UNIQUE_ID_OF_DIV1",fontSize:d.fontSize||14,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:d.editValueMode,tabSize:d.editValueMode?2:void 0},editorProps:{$blockScrolling:!0}})}const dr={flex:{display:"flex"},button:{height:48,minWidth:48},wrapper:{width:"calc(100vw - 40px)",height:"calc(100vh - 188px)"}};class rv extends X{componentDidMount(){super.componentDidMount();const{data:e,attr:t}=this.props,n=X.getValue(e,t)||"{}";this.setState({value:n,initialized:!0,jsonError:this.validateJson(n)})}validateJson(e){let t=!1;if(this.props.schema.validateJson!==!1&&(e||!this.props.schema.allowEmpty))try{this.props.schema.json5?lo.parse(e):JSON.parse(e)}catch(n){console.log("Error in JSON",n),t=!0}return t}renderItem(e,t){if(!this.state.initialized)return null;const{schema:n,data:m,attr:i}=this.props,{value:a,showSelectId:p}=this.state;return I.createElement(B.FormControl,{fullWidth:!0,variant:"standard"},I.createElement("div",{style:dr.flex},I.createElement(B.Button,{color:"grey",disabled:t,style:dr.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},G.I18n.t("ra_JSON editor"))),p?I.createElement(Im,{title:this.getText(n.label),overflowHidden:!0,applyDisabled:this.state.jsonError&&this.props.schema.doNotApplyWithError,onClose:()=>this.setState({showSelectId:!1,value:X.getValue(m,i)||{}}),onApply:()=>this.setState({showSelectId:!1},()=>this.onChange(i,a))},I.createElement("div",{style:{...dr.wrapper,border:this.state.jsonError?"2px solid red":"2px solid transparent"}},I.createElement(iv,{mode:this.props.schema.json5?"json5":"json",value:typeof a=="object"?JSON.stringify(a):a,onChange:o=>this.setState({value:o,jsonError:this.validateJson(o)}),name:"ConfigJsonEditor",themeType:this.props.oContext.themeType}))):null,n.help||this.state.jsonError?I.createElement(B.FormHelperText,null,this.state.jsonError?G.I18n.t("ra_Invalid JSON"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const sv=[{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 ov extends X{componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr),t=[...sv];this.props.schema.system?t.unshift({value:"",label:G.I18n.t("ra_System language")}):t.unshift({value:"",label:G.I18n.t("ra_none")}),this.setState({value:this.props.schema.system?e||"":e||G.I18n.getLanguage(),selectOptions:t})}renderItem(e,t){var m,i;if(!this.state.selectOptions)return null;const n=(m=this.state.selectOptions)==null?void 0:m.find(a=>a.value===this.state.value||!a.value&&!this.state.value);return I.createElement(B.FormControl,{fullWidth:!0,variant:"standard"},this.props.schema.label?I.createElement(B.InputLabel,null,this.getText(this.props.schema.label)):null,I.createElement(B.Select,{variant:"standard",error:!!e,disabled:t,value:this.state.value||"_",renderValue:()=>this.getText(n==null?void 0:n.label,this.props.schema.noTranslation),onChange:a=>{let{value:p}=a.target;p==="_"&&(p=""),this.setState({value:p},()=>{const o=this.onChange(this.props.attr,p);if(o instanceof Promise&&o.catch(h=>console.error(h)),this.props.schema.changeGuiLanguage)if(p){if(p===G.I18n.getLanguage())return;G.I18n.setLanguage(p),this.props.oContext.changeLanguage&&this.props.oContext.changeLanguage()}else this.props.oContext.socket.getSystemConfig().then(h=>{h.common.language!==G.I18n.getLanguage()&&h.common.language&&(G.I18n.setLanguage(h.common.language),this.props.oContext.changeLanguage&&this.props.oContext.changeLanguage())}).catch(h=>console.error(`Cannot read system config: ${h}`))})}},(i=this.state.selectOptions)==null?void 0:i.map(a=>I.createElement(B.MenuItem,{key:a.value,value:a.value},a.label))),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class av extends X{scrollRef;constructor(e){super(e),this.scrollRef=I.createRef()}scrolledDown(){return this.scrollRef.current?this.scrollRef.current.offsetHeight+this.scrollRef.current.scrollTop>=this.scrollRef.current.scrollHeight:!1}componentDidMount(){super.componentDidMount(),X.getValue(this.props.data,this.props.attr)||(this.props.schema.licenseUrl?(this.setState({showLicenseDialog:!0,loading:!0,scrolledDown:!1}),fetch(this.props.schema.licenseUrl).then(e=>e.text()).then(e=>this.setState({license:e,loading:!1})).catch(e=>this.setState({license:e.toString(),loading:!1,error:!0,scrolledDown:!1}))):this.setState({showLicenseDialog:!0,scrolledDown:!1}),setTimeout(()=>{this.scrollRef.current&&(this.scrolledDown()?this.setState({scrolledDown:!0}):this.scrollRef.current.addEventListener("scroll",()=>{!this.state.scrolledDown&&this.scrolledDown()&&this.setState({scrolledDown:!0})}))},1e3))}renderItem(e,t){return this.state.showLicenseDialog?I.createElement(B.Dialog,{maxWidth:"lg",open:!0,onClose:(n,m)=>{m!=="escapeKeyDown"&&m!=="backdropClick"&&this.setState({showLicenseDialog:!1})}},I.createElement(B.DialogTitle,null,this.props.schema.title?G.I18n.t(this.props.schema.title):G.I18n.t("ra_License agreement")),I.createElement(B.DialogContent,null,this.props.schema.licenseUrl?I.createElement(I.Fragment,null,this.state.loading?I.createElement(B.LinearProgress,null):null,I.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?I.createElement("div",{ref:this.scrollRef,style:{width:"100%",height:"100%",overflowY:"auto",fontSize:14}},this.props.schema.texts.map((n,m)=>this.props.schema.noTranslation?I.createElement("p",{key:m},n):I.createElement("p",{key:m},G.I18n.t(n)))):null),I.createElement(B.DialogActions,null,this.props.schema.checkBox?I.createElement(B.FormControlLabel,{control:I.createElement(B.Checkbox,{disabled:t,checked:!!this.state.licenseChecked,onClick:()=>this.setState({licenseChecked:!this.state.licenseChecked})}),label:G.I18n.t(this.props.schema.checkBox)}):null,I.createElement(B.Button,{disabled:t||this.state.loading||this.state.error||this.props.schema.checkBox&&!this.state.licenseChecked||!this.state.scrolledDown,onClick:()=>{this.setState({showLicenseDialog:!1});const n=this.onChange(this.props.attr,!0);n instanceof Promise&&n.catch(m=>console.error(`Cannot set value: ${m}`))},color:"primary",variant:"contained",startIcon:I.createElement(oe.Check,null)},this.props.schema.agreeText?G.I18n.t(this.props.schema.agreeText):G.I18n.t("ra_Accept license")),I.createElement(B.Button,{onClick:()=>{this.setState({showLicenseDialog:!1}),setTimeout(()=>this.setState({showLicenseDialog:!0}),2e3)},color:"grey",variant:"contained",startIcon:I.createElement(oe.Close,null)},G.I18n.t("ra_Close")))):null}}const Bs={indeterminate:{opacity:.5},control:{flexDirection:"row",width:"100%"}};class lv extends X{updateTimeout;componentDidMount(){super.componentDidMount();let e=X.getValue(this.props.data,this.props.attr);if(e==null&&(e=""),Array.isArray(e)&&this.props.oContext.multiEdit){e=X.DIFFERENT_VALUE,this.setState({_value:e,oldValue:e});return}this.setState({_value:e.toString(),oldValue:e.toString()})}static getDerivedStateFromProps(e,t){if(e.schema.min!==void 0&&e.schema.min<0||e.schema.max!==void 0&&e.schema.max<0)return null;const n=X.getValue(e.data,e.attr);return e.oContext.multiEdit&&t._value===X.DIFFERENT_VALUE?{_value:X.DIFFERENT_VALUE}:n==null||t.oldValue===null||t.oldValue===void 0||n.toString()!==parseFloat(t._value).toString()&&n.toString()!==t.oldValue.toString()?{_value:n}:null}checkValue(e){if(e==null)return null;e=e.toString().trim();const t=e===""?0:parseFloat(e);return e!==""&&Number.isNaN(t)?"ra_Not a number":e!==""&&window.isFinite(t)?this.props.schema.min!==void 0&&t<this.props.schema.min?"ra_Too small":this.props.schema.max!==void 0&&t>this.props.schema.max?"ra_Too big":e===""||e==="-"||Number.isNaN(t)?"ra_Not a number":null:"ra_Not a number"}renderItem(e,t){const n=Array.isArray(this.state._value)||this.state._value===X.DIFFERENT_VALUE;if(this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=void 0,this.setState({oldValue:null})},30)):this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=void 0),n){const m=X.getValue(this.props.data,this.props.attr),i=(m==null?void 0:m.filter(a=>a||a===0).map(a=>({label:a.toString(),value:a})))||[];return i.unshift({label:G.I18n.t(X.DIFFERENT_LABEL),value:X.DIFFERENT_VALUE}),I.createElement(B.Autocomplete,{style:Bs.indeterminate,fullWidth:!0,freeSolo:!0,value:i[0],getOptionSelected:(a,p)=>a.label===p.label,onChange:(a,p)=>{const o=this.onChange(this.props.attr,p==null?void 0:p.value,()=>{this.setState({_value:p==null?void 0:p.value,oldValue:this.state._value})});o instanceof Promise&&o.catch(h=>console.error(h))},options:i,getOptionLabel:a=>a.label,renderInput:a=>I.createElement(B.TextField,{...a,label:this.getText(this.props.schema.label),variant:"standard",slotProps:{htmlInput:{...a.inputProps,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):void 0}},error:!!e,placeholder:this.getText(this.props.schema.placeholder),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:!!t})})}return!e&&this.state._value!==null&&this.state._value!==void 0&&this.state._value&&(e=this.checkValue(this.state._value),e&&(e=G.I18n.t(e))),I.createElement(B.FormControl,{variant:"standard",style:Bs.control},I.createElement(B.TextField,{variant:"standard",type:"number",fullWidth:!0,slotProps:{htmlInput:{min:this.props.schema.min,max:this.props.schema.max,step:this.props.schema.step,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):void 0}},value:this.state._value===null||this.state._value===void 0?"":this.state._value,error:!!e,disabled:!!t,onChange:m=>{const i=m.target.value,a=this.checkValue(i);a?this.onError(this.props.attr,G.I18n.t(a)):this.onError(this.props.attr),this.setState({_value:i,oldValue:this.state._value},()=>this.onChange(this.props.attr,parseFloat(i)))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:e&&typeof e=="string"?e:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}))}}const Vs={flex:{display:"flex"},button:{height:48,marginLeft:4,minWidth:48}};class cv extends X{componentDidMount(){super.componentDidMount();const{data:e,attr:t}=this.props,n=X.getValue(e,t)||"";this.setState({value:n,initialized:!0})}renderItem(e,t){if(!this.state.initialized)return null;const n=this.props.oContext.socket,{schema:m,attr:i}=this.props,{value:a,showSelectId:p}=this.state;return I.createElement(B.FormControl,{fullWidth:!0,variant:"standard"},m.label?I.createElement(B.InputLabel,{shrink:!0},this.getText(m.label)):null,I.createElement("div",{style:Vs.flex},I.createElement(B.TextField,{variant:"standard",fullWidth:!0,value:a,error:!!e,disabled:t,placeholder:this.getText(m.placeholder),label:this.getText(m.label),helperText:this.renderHelp(m.help,m.helpLink,m.noTranslation),onChange:o=>{const h=o.target.value;this.setState({value:h},()=>this.onChange(i,h))}}),I.createElement(B.Button,{color:"grey",disabled:t,style:Vs.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},"...")),p?I.createElement(G.DialogSelectID,{imagePrefix:this.props.oContext.imagePrefix===void 0?"../..":this.props.oContext.imagePrefix,dialogName:`admin.${this.props.oContext.adapterName}`,filterFunc:m.filterFunc,themeType:this.props.oContext.themeType,theme:this.props.oContext.theme,types:m.types?Array.isArray(m.types)?m.types:[m.types]:void 0,customFilter:m.customFilter,filters:m.filters,socket:n,selected:a,root:m.root,onClose:()=>this.setState({showSelectId:!1}),onOk:o=>this.setState({showSelectId:!1,value:o},()=>this.onChange(i,o))}):null)}}const pr={fullWidth:{width:"100%",display:"inline-block"},halfWidth1:{width:"calc(50% - 5px)",display:"inline-block",marginRight:8},halfWidth2:{width:"calc(50% - 5px)",display:"inline-block"}},Si="____ppp____";class uv extends X{componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr);this.setState({_repeat:e?Si:"",_visible:!1,value:e?Si:"",_notEqual:!1})}onChangePassword(e,t){e===void 0&&(e=this.state.value),t===void 0&&(t=this.state._repeat);const n=!!this.props.schema.repeat&&t!==e;this.setState({value:e,_repeat:t,_notEqual:n},()=>{if(n)this.onError(this.props.attr,G.I18n.t("ra_Passwords are not equal!"));else{this.onError(this.props.attr);const m=this.onChange(this.props.attr,e);m instanceof Promise&&m.catch(i=>this.onError(this.props.attr,i))}})}renderItem(e,t){if(this.state._notEqual===void 0)return null;const n=I.createElement(B.TextField,{variant:"standard",fullWidth:!0,type:this.state._visible&&this.state.value!==Si?"text":"password",value:this.state.value,error:!!e||this.state._notEqual,disabled:!!t,onChange:m=>this.onChangePassword(m.target.value),label:this.getText(this.props.schema.label),slotProps:{input:{autoComplete:"new-password",endAdornment:this.state.value&&this.state.value!==Si&&this.props.schema.visible&&!t&&!this.props.schema.readOnly?I.createElement(B.InputAdornment,{position:"end"},I.createElement(B.IconButton,{size:"large",tabIndex:-1,onClick:m=>{m.preventDefault(),m.stopPropagation(),this.setState({_visible:!this.state._visible})},edge:"end"},this.state._visible?I.createElement(oe.VisibilityOff,null):I.createElement(oe.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?G.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 m=this.state._visible?null:I.createElement(B.TextField,{variant:"standard",fullWidth:!0,type:"password",value:this.state._repeat,error:!!e||this.state._notEqual,disabled:!!t,onChange:i=>this.onChangePassword(void 0,i.target.value),label:`${this.getText(this.props.schema.label)} (${G.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?G.I18n.t("ra_Passwords are not equal!"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)});return I.createElement("div",{style:pr.fullWidth},I.createElement("div",{style:pr.halfWidth1},n),I.createElement("div",{style:pr.halfWidth2},m))}return n}}class hv extends X{renderItem(e,t){return I.createElement(B.TextField,{variant:"standard",fullWidth:!0,disabled:!!t,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?I.createElement(B.IconButton,{size:"small",onClick:()=>{G.Utils.copyToClipboard(this.getPattern(this.props.schema.pattern,null,this.props.schema.noTranslation)),window.alert(G.I18n.t("ra_Copied"))}},I.createElement(G.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 dv={warning:{"& .Mui-error":{color:"orange"}}};class pv extends X{updateTimeout;async componentDidMount(){super.componentDidMount();let e=X.getValue(this.props.data,this.props.attr);e==null&&(e=""),this.setState({_value:e.toString(),oldValue:e.toString()});const t=await this.props.oContext.socket.getAdapterInstances(),n=`system.adapter.${this.props.oContext.adapterName}.${this.props.oContext.instance}`,m=await this.props.oContext.socket.getObject(n),i=m==null?void 0:m.common.host,a=[];t.forEach(p=>{var h,r,s,l;if(!p||p._id===n||p.common.host!==i||!((h=p.native)!=null&&h.bind))return;if(p!=null&&p.native&&p.native.secure&&p.native.leEnabled&&p.native.leUpdate){const u=parseInt(p.native.leCheckPort||p.native.lePort,10);u&&a.push({name:`${p._id.replace("system.adapter.","")} (LE)`,port:u,v6bind:p.native.bind.includes(":")?p.native.bind:p.native.v6bind,bind:p.native.bind,enabled:!!((r=p.common)!=null&&r.enabled)})}const o=parseInt((s=p==null?void 0:p.native)==null?void 0:s.port,10);o&&a.push({name:p._id.replace("system.adapter.",""),bind:p.native.bind,v6bind:p.native.bind.includes(":")?p.native.bind:p.native.v6bind,port:o,enabled:!!((l=p.common)!=null&&l.enabled)})}),this.setState({ports:a})}static getDerivedStateFromProps(e,t){const n=X.getValue(e.data,e.attr);return n==null||t.oldValue===null||t.oldValue===void 0||n.toString()!==parseInt(t._value,10).toString()&&n.toString()!==t.oldValue.toString()?{_value:n}:null}checkValue(e){if(e==null)return null;const t=this.props.schema.min===void 0?20:this.props.schema.min,n=this.props.schema.max||65535;e=e.toString().trim();const m=e===""?0:parseInt(e,10);return e!==""&&Number.isNaN(m)?"ra_Not a number":e!==""&&window.isFinite(Number(e))?m<t?"ra_Too small":m>n?"ra_Too big":e===""||e==="-"||Number.isNaN(m)?"ra_Not a number":null:"ra_Not a number"}renderItem(e,t){this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=void 0,this.setState({oldValue:null})},30)):this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=void 0);const n=this.props.schema.min===void 0?20:this.props.schema.min,m=this.props.schema.max||65535;let i;if(this.state.ports){const a=parseInt(this.state._value,10);if(a){const p=this.state.ports.filter(h=>!this.props.data.bind||this.props.data.bind===h.bind||this.props.data.bind==="0.0.0.0"||h.bind==="0.0.0.0");let o=p.findIndex(h=>h.port===a&&h.enabled);o!==-1?e=G.I18n.t("ra_Port is already used by %s",this.state.ports[o].name):(o=p.findIndex(h=>h.port===a&&!h.enabled),o!==-1&&(i=!0,e=G.I18n.t("ra_Port could be used by %s",this.state.ports[o].name)))}}return!e&&this.state._value!==null&&this.state._value!==void 0&&(e=this.checkValue(this.state._value),typeof e=="string"&&(e=G.I18n.t(e))),I.createElement(B.TextField,{variant:"standard",type:"number",fullWidth:!0,slotProps:{htmlInput:{min:n,max:m,readOnly:this.props.schema.readOnly||!1}},value:this.state._value===null||this.state._value===void 0?"":this.state._value,error:!!e,disabled:!!t,sx:i?dv.warning:void 0,onChange:a=>{const p=Number(a.target.value.toString().replace(/[^0-9]/g,"")).toString(),o=this.checkValue(p);o?this.onError(this.props.attr,G.I18n.t(o)):this.onError(this.props.attr),this.setState({_value:p,oldValue:this.state._value},()=>{if(p.trim()===parseInt(p,10).toString()){const h=this.onChange(this.props.attr,parseInt(p,10)||0);h instanceof Promise&&h.catch(r=>{console.error(`Cannot set value for ${this.props.attr}: ${r}`)})}})},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:e&&typeof e=="string"?e:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}class fv extends X{componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums("rooms").then(t=>{const n=Object.keys(t).map(m=>({value:this.props.schema.short?m.replace("enum.rooms.",""):m,label:this.getText(t[m].common.name),obj:t[m]}));this.props.schema.allowDeactivate!==!1&&n.unshift({label:G.I18n.t(X.NONE_LABEL),value:X.NONE_VALUE}),this.setState({value:e,selectOptions:n})}).catch(t=>console.error(`Cannot get enums: ${t}`))}renderItem(e,t){if(!this.state.selectOptions)return null;const n=this.state.selectOptions.find(m=>m.value===this.state.value);return I.createElement(B.FormControl,{variant:"standard",fullWidth:!0},this.props.schema.label?I.createElement(B.InputLabel,null,this.getText(this.props.schema.label)):null,I.createElement(B.Select,{variant:"standard",error:!!e,disabled:!!t,value:this.state.value||"_",renderValue:()=>n?n.obj?I.createElement(G.TextWithIcon,{value:n.obj,themeType:this.props.oContext.themeType,lang:G.I18n.getLanguage()}):n.label:"",onChange:m=>{this.setState({value:m.target.value==="_"?"":m.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(m=>I.createElement(B.MenuItem,{key:m.value,value:m.value,style:m.value===X.DIFFERENT_VALUE?{opacity:.5}:{}},m.obj?I.createElement(G.TextWithIcon,{value:m.obj,themeType:this.props.oContext.themeType,lang:G.I18n.getLanguage()}):m.label))),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const mv={noMargin:{"&>div":{marginTop:0}}};class gv extends X{initialValue="";componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr),t=[];(this.props.schema.options||[]).forEach(n=>{const m=n;Array.isArray(m.items)?(t.push({label:this.getText(n.label,this.props.schema.noTranslation),value:n.value,group:!0}),m.items.forEach(i=>t.push({label:this.getText(i.label,this.props.schema.noTranslation),value:i.value,hidden:i.hidden}))):t.push({label:this.getText(n.label,this.props.schema.noTranslation),value:n.value,hidden:n.hidden})}),Array.isArray(e)?(this.initialValue=[...e],t.unshift({label:G.I18n.t(X.DIFFERENT_LABEL),value:X.DIFFERENT_VALUE}),this.setState({value:X.DIFFERENT_VALUE,selectOptions:t})):this.setState({value:e,selectOptions:t})}renderItem(e,t){if(!this.state.selectOptions)return null;const n=(this.state.selectOptions||[]).filter(i=>i.hidden?this.props.custom?!this.executeCustom(i.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!this.execute(i.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!0),m=n.find(i=>i.value==this.state.value);return I.createElement(B.FormControl,{variant:"standard",fullWidth:!0,sx:this.props.table!==void 0&&mv.noMargin,id:`jsonSelect_${this.props.attr}_${this.props.index||this.props.index===0?this.props.index:""}`},this.props.schema.label?I.createElement(B.InputLabel,null,this.getText(this.props.schema.label)):null,I.createElement(B.Select,{variant:"standard",error:!!e,disabled:!!t,value:this.state.value||"_",renderValue:()=>this.getText(m==null?void 0:m.label,this.props.schema.noTranslation),onChange:i=>{this.setState({value:i.target.value==="_"?"":i.target.value},()=>{let a;this.state.value===X.DIFFERENT_VALUE?a=this.onChange(this.props.attr,this.initialValue):a=this.onChange(this.props.attr,this.state.value),a instanceof Promise&&a.catch(p=>console.error(p))})}},n.map((i,a)=>i.group?I.createElement(B.ListSubheader,{key:a},this.getText(i.label,this.props.schema.noTranslation)):I.createElement(B.MenuItem,{key:a,value:i.value,style:i.value===X.DIFFERENT_VALUE?{opacity:.5}:{}},this.getText(i.label,this.props.schema.noTranslation)))),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const vv={menuPaper:{maxHeight:800}};class yv extends X{initialized=!1;localContext;askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const t=this.getPattern(this.props.schema.jsonData,null,!0);try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${t}`)}}e===void 0&&(e=null),this.setState({running:!0},()=>{this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",e).then(t=>this.setState({list:t,running:!1})).catch(t=>{console.error(`Cannot send command: ${t}`)})})}else{const e=X.getValue(this.props.data,this.props.attr);this.setState({value:e,running:!1})}}getContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=X.getValue(this.props.data,t)),JSON.stringify(e)}_getValue(){let e=this.state.value===null||this.state.value===void 0?X.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof e=="string"?e=[e]:e==null&&(e=[])),e}renderItem(e,t){var a;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)}const n=this._getValue();if(!this.props.alive||!this.state.running&&!((a=this.state.list)!=null&&a.length))return this.props.schema.multiple||this.props.schema.manual===!1?G.I18n.t("ra_Cannot retrieve options, as instance is offline"):I.createElement(B.TextField,{variant:"standard",fullWidth:!0,value:n,error:!!e,disabled:!!t,onChange:p=>{const o=p.target.value;this.setState({value:o},()=>this.onChange(this.props.attr,(o||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),slotProps:{input:{endAdornment:this.state.value&&!this.props.schema.noClearButton?I.createElement(B.InputAdornment,{position:"end"},I.createElement(B.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({value:""},()=>this.onChange(this.props.attr,""))},I.createElement(oe.Close,null))):null}}});if(this.state.running)return I.createElement(B.CircularProgress,{size:"24"});const m=this.state.list.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),i=m.find(p=>p.value===n);return I.createElement(B.FormControl,{variant:"standard",fullWidth:!0},this.props.schema.label?I.createElement(B.InputLabel,null,this.getText(this.props.schema.label)):null,I.createElement(B.Select,{variant:"standard",error:!!e,multiple:this.props.schema.multiple,disabled:!!t,sx:{"&.MuiSelect-paper":this.props.schema.multiple?vv.menuPaper:void 0},value:n,renderValue:p=>this.props.schema.multiple?I.createElement(B.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5}},p.map(o=>{const h=m.find(r=>r.value===o);if(h||this.props.schema.showAllValues!==!1){const r=(h==null?void 0:h.label)||o;return I.createElement(B.Chip,{key:o,label:r})}return null})):(i==null?void 0:i.label)||p,onChange:p=>{const o=this.onChange(this.props.attr,p.target.value);o instanceof Promise&&o.catch(h=>console.error(`Cannot set value: ${h}`))}},m.map((p,o)=>I.createElement(B.MenuItem,{key:o,value:p.value},this.props.schema.multiple?I.createElement(B.Checkbox,{checked:n.includes(p.value),onClick:()=>{const h=JSON.parse(JSON.stringify(this._getValue())),r=n.indexOf(p.value);r!==-1?h.splice(r,1):(h.push(p.value),h.sort()),this.setState({value:h},()=>this.onChange(this.props.attr,h))}}):null,I.createElement(B.ListItemText,{primary:p.label})))),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Ws={fullWidth:{width:"100%"}};function Gt(d){return d.split(".").reduce((e,t)=>(e<<8)+parseInt(t,10),0)>>>0}function bv(d,e){var m,i;const t=(i=(m=d==null?void 0:d.native)==null?void 0:m.hardware)==null?void 0:i.networkInterfaces;if(!t)return null;let n;return Object.keys(t).forEach(a=>t[a].forEach(p=>{p.internal||e.includes(":")&&p.family!=="IPv6"||e.includes(".")&&!e.match(/[^.\d]/)&&p.family!=="IPv4"||(p.family==="IPv4"&&!p.address.startsWith("172")&&(e==="127.0.0.0"||e==="localhost"||e.match(/[^.\d]/))?n=p.address:n||(p.family==="IPv4"&&e.includes(".")&&(Gt(e)&Gt(p.netmask),Gt(p.address)&Gt(p.netmask)),n=p.address))})),n||Object.keys(t).forEach(a=>t[a].forEach(p=>{p.internal||e.includes(":")&&p.family!=="IPv6"||e.includes(".")&&!e.match(/[^.\d]/)&&p.family!=="IPv4"||(p.family==="IPv6"&&(e==="127.0.0.0"||e==="localhost"||e.match(/[^.\d]/))?n=p.address:n||(p.family==="IPv4"&&e.includes(".")&&(Gt(e)&Gt(p.netmask),Gt(p.address)&Gt(p.netmask)),n=p.address))})),n||Object.keys(t).forEach(a=>{t[a].forEach(p=>{p.internal||e.includes(":")&&p.family!=="IPv6"||e.includes(".")&&!e.match(/[^.\d]/)&&p.family!=="IPv4"||(e==="127.0.0.0"||e==="localhost"||e.match(/[^.\d]/),n=p.address)})}),n||Object.keys(t).forEach(a=>{t[a].forEach(p=>{p.internal||(n=p.address)})}),n}class Hs extends X{async componentDidMount(){var t;super.componentDidMount();let e=window.location.hostname;if(this.props.schema.openUrl){const n=await this.props.oContext.socket.getCurrentInstance(),m=await this.props.oContext.socket.getObject(`system.adapter.${n}`);if(m){const i=await this.props.oContext.socket.getObject(`system.host.${(t=m==null?void 0:m.common)==null?void 0:t.host}`);if(i){const a=bv(i,window.location.hostname);if(a)e=`${a}:${window.location.port}`;else{console.warn(`Cannot find suitable IP in host ${m.common.host} for ${m._id}`);return}}}}await new Promise(n=>{this.setState({_error:"",_message:"",hostname:e},n)}),this.props.schema.onLoaded&&this._onClick()}renderErrorDialog(){return this.state._error?I.createElement(G.DialogError,{text:this.state._error,onClose:()=>this.setState({_error:""})}):null}renderMessageDialog(){return this.state._message?I.createElement(G.DialogMessage,{text:this.state._message,onClose:()=>this.setState({_message:""})}):null}_onClick(){this.props.oContext.onCommandRunning(!0),this.setState({running:!0});const e=`${window.location.protocol}//${window.location.host}${window.location.pathname.replace(/\/index\.html$/,"")}`,t=`${window.location.protocol}//${this.state.hostname.split(":").length>3?`[${this.state.hostname}]`:this.state.hostname}${window.location.pathname.replace(/\/index\.html$/,"")}`;let n=this.props.schema.data;if(n===void 0&&this.props.schema.jsonData){const i=this.getPattern(this.props.schema.jsonData,{_origin:e,_originIp:t,...this.props.data},!0);try{n=JSON.parse(i)}catch{console.error(`Cannot parse json data: ${i}`)}}n===void 0&&(n=null),this.props.schema.openUrl&&!n&&(n={_origin:e,_originIp:t});let m;this.props.schema.timeout&&(m=setTimeout(()=>{this.props.oContext.onCommandRunning(!1),this.setState({_error:G.I18n.t("ra_Request timed out"),running:!1})},parseInt(this.props.schema.timeout,10)||1e4)),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",n).then(async i=>{if(m&&(clearTimeout(m),m=void 0),i!=null&&i.error)if(this.props.schema.error&&this.props.schema.error[i.error]){let a=this.getText(this.props.schema.error[i.error]);i.args&&i.args.forEach(p=>a=a.replace("%s",p)),this.setState({_error:a})}else this.setState({_error:i.error?G.I18n.t(i.error):G.I18n.t("ra_Error")});else{if(i!=null&&i.command){this.props.oContext.onBackEndCommand&&this.props.oContext.onBackEndCommand(i.command);return}if(i!=null&&i.reloadBrowser&&this.props.schema.reloadBrowser)window.location.reload();else if(i!=null&&i.openUrl&&this.props.schema.openUrl)window.open(i.openUrl,i.window||this.props.schema.window||"_blank");else if(i!=null&&i.result&&this.props.schema.result&&this.props.schema.result[i.result]){let a=this.getText(this.props.schema.result[i.result]);i.args&&i.args.forEach(p=>a=a.replace("%s",p)),window.alert(a)}if(i!=null&&i.native&&this.props.schema.useNative){for(const[a,p]of Object.entries(i.native))await this.onChangeAsync(a,p);setTimeout(()=>this.props.oContext.forceUpdate(Object.keys(i.native),this.props.data),300)}else i!=null&&i.result?window.alert(typeof i.result=="object"?JSON.stringify(i.result):i.result):window.alert(G.I18n.t("ra_Ok"));i!=null&&i.saveConfig&&this.props.onChange(null,null,null,!0)}}).catch(i=>{this.props.schema.error&&this.props.schema.error[i.toString()]?this.setState({_error:this.getText(this.props.schema.error[i.toString()])}):this.setState({_error:G.I18n.t(i.toString())||G.I18n.t("ra_Error")})}).then(()=>{this.props.oContext.onCommandRunning(!1),this.setState({running:!1})})}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const e=this.state.confirmData||this.props.schema.confirm;let t=null;return e.type==="warning"?t=I.createElement(oe.Warning,null):e.type==="error"?t=I.createElement(oe.Error,null):e.type==="info"&&(t=I.createElement(oe.Info,null)),I.createElement(G.DialogConfirm,{title:this.getText(e.title)||G.I18n.t("ra_Please confirm"),text:this.getText(e.text),ok:this.getText(e.ok)||G.I18n.t("ra_Ok"),cancel:this.getText(e.cancel)||G.I18n.t("ra_Cancel"),icon:t||void 0,onClose:n=>this.setState({confirmDialog:!1},()=>n&&this._onClick())})}renderItem(e,t){const n=this.getIcon();return I.createElement("div",{style:Ws.fullWidth},I.createElement(B.Button,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:{...Ws.fullWidth,...this.props.schema.controlStyle||void 0},disabled:t||!this.props.alive,startIcon:n,title:this.props.alive?this.getText(this.props.schema.title)||"":G.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?I.createElement(B.CircularProgress,{size:20,style:{marginRight:8}}):null,this.getText(this.props.schema.label,this.props.schema.noTranslation)),this.renderErrorDialog(),this.renderMessageDialog())}}const js={fullWidth:{width:"100%"},icon:{width:24,height:24,marginRight:4}};class wv extends X{async _onClick(){var n,m;let e=this.props.schema.val;if(typeof e=="string"&&e.includes("${")){e=this.getPattern(e,null,!0);const i=await this.props.oContext.socket.getObject(this.props.schema.id);((n=i==null?void 0:i.common)==null?void 0:n.type)==="number"?e=parseFloat(e):((m=i==null?void 0:i.common)==null?void 0:m.type)==="boolean"&&(e=e==="true"||e===!0||e==="1"||e===1)}const t=(this.props.schema.id||"").replace(/%INSTANCE%/g,(this.props.oContext.instance||0).toString());try{await this.props.oContext.socket.setState(t,{val:e,ack:!!this.props.schema.ack}),this.props.schema.okText&&window.alert(this.getText(this.props.schema.okText))}catch(i){this.props.schema.error&&this.props.schema.error[i.toString()]?window.alert(this.getText(this.props.schema.error[i.toString()])):window.alert(G.I18n.t(i.toString())||G.I18n.t("ra_Error"))}}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const e=this.state.confirmData||this.props.schema.confirm;let t=null;return e.type==="warning"?t=I.createElement(oe.Warning,null):e.type==="error"?t=I.createElement(oe.Error,null):e.type==="info"&&(t=I.createElement(oe.Info,null)),I.createElement(G.DialogConfirm,{title:this.getText(e.title)||G.I18n.t("ra_Please confirm"),text:this.getText(e.text),ok:this.getText(e.ok)||G.I18n.t("ra_Ok"),cancel:this.getText(e.cancel)||G.I18n.t("ra_Cancel"),icon:t,onClose:n=>this.setState({confirmDialog:!1},()=>n&&this._onClick())})}renderItem(e,t){return I.createElement(B.Button,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:js.fullWidth,disabled:t,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0}):await this._onClick()}},this.props.schema.icon?I.createElement(G.Icon,{src:this.props.schema.icon,style:js.icon}):null,this.getText(this.props.schema.label,this.props.schema.noTranslation))}}const zs={fullWidth:{width:"100%"},slider:{marginLeft:10,marginRight:10,width:"calc(100% - 20px)"}};class Cv extends X{componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr);this.setState({_value:e})}static getDerivedStateFromProps(e,t){if(e.schema.min!==void 0&&e.schema.min<0||e.schema.max!==void 0&&e.schema.max<0)return null;const n=X.getValue(e.data,e.attr);return n==null||n.toString()!==parseFloat(t._value).toString()?{_value:n}:null}renderItem(e,t){const n=this.props.schema.min||0,m=this.props.schema.max||100,i=this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):"",a=[{value:n,label:n+i},{value:m,label:m+i}];return I.createElement(B.Box,{style:zs.fullWidth},this.props.schema.label?I.createElement(B.Typography,{gutterBottom:!0},this.getText(this.props.schema.label)):null,I.createElement(B.Slider,{style:zs.slider,value:this.state._value,getAriaValueText:p=>p+i,step:this.props.schema.step||(m-n)/100,valueLabelDisplay:"auto",marks:a,min:n,max:m,disabled:!!t,onChange:p=>{const o=p.target.value;this.setState({_value:o},()=>this.onChange(this.props.attr,o))}}),this.props.schema.help?I.createElement(B.Typography,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}function Kt(d,e){return d==="edit"||d==="rename"?I.createElement(oe.Edit,{style:e}):d==="delete"?I.createElement(oe.Delete,{style:e}):d==="refresh"?I.createElement(oe.Refresh,{style:e}):d==="newDevice"||d==="new"||d==="add"?I.createElement(oe.Add,{style:e}):d==="discover"||d==="search"?I.createElement(oe.Search,{style:e}):d==="unpairDevice"||d==="unpair"?I.createElement(oe.LinkOff,{style:e}):d==="pairDevice"||d==="pair"?I.createElement(oe.Link,{style:e}):d==="identify"?I.createElement(oe.NotListedLocation,{style:e}):d==="play"?I.createElement(oe.PlayArrow,{style:e}):d==="stop"?I.createElement(oe.Stop,{style:e}):d==="pause"?I.createElement(oe.Pause,{style:e}):d==="forward"||d==="next"?I.createElement(oe.FastForward,{style:e}):d==="rewind"||d==="previous"?I.createElement(oe.FastRewind,{style:e}):d==="lamp"||d==="light"?I.createElement(oe.Lightbulb,{style:e}):d==="backlight"?I.createElement(oe.Fluorescent,{style:e}):d==="dimmer"?I.createElement(oe.WbIncandescent,{style:e}):d==="socket"?I.createElement(oe.Power,{style:e}):d==="settings"?I.createElement(oe.Settings,{style:e}):d==="users"||d==="group"?I.createElement(oe.Group,{style:e}):d==="user"?I.createElement(oe.Person,{style:e}):d==="qrcode"?I.createElement(oe.QrCode,{style:e}):d==="connection"?I.createElement(oe.Wifi,{style:e}):d==="no-connection"?I.createElement(oe.WifiOff,{style:e}):d==="visible"?I.createElement(oe.Visibility,{style:e}):null}function Dv(d,e){return typeof e=="string"?{"@keyframes newStateAnimationOnceColor":{"0%":{color:e},"100%":{color:d.palette.mode==="dark"?"#fff":"#000"}},animation:"newStateAnimationOnceColor 2s ease-in-out"}:{"@keyframes newStateAnimationOnce":{"0%":{color:"#00f900"},"80%":{color:d.palette.mode==="dark"?"#518851":"#008000"},"100%":{color:d.palette.mode==="dark"?"#fff":"#000"}},animation:"newStateAnimationOnce 2s ease-in-out"}}class Sv extends X{controlTimeout=null;delayedUpdate={timer:null,value:null};getObjectID(){let e=this.props.schema.oid;return e.includes("${")&&(e=this.getPattern(e,null,!0)),this.props.schema.foreign?e:`${this.props.schema.system?"system.adapter.":""}${this.props.oContext.adapterName}.${this.props.oContext.instance||0}.${e}`}async componentDidMount(){super.componentDidMount();const e=await this.props.oContext.socket.getObject(this.getObjectID()),t=this.props.schema.control||this.detectType(e);try{const n=await this.props.oContext.socket.getState(this.getObjectID());this.setState({stateValue:n?n.val:null,controlType:t,obj:e},async()=>{await this.props.oContext.socket.subscribeState(this.getObjectID(),this.onStateChanged)})}catch(n){console.error(`Cannot get state ${this.getObjectID()}: ${n}`),this.setState({controlType:t,obj:e})}}componentWillUnmount(){super.componentWillUnmount(),this.props.oContext.socket.unsubscribeState(this.getObjectID(),this.onStateChanged),this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null),this.controlTimeout&&(clearTimeout(this.controlTimeout),this.controlTimeout=null,this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!1).catch(e=>console.error(`Cannot control value: ${e.toString()}`)))}onStateChanged=(e,t)=>{let n=t?t.val:null;this.state.controlType==="button"||this.state.controlType==="switch"?(n=!!n,this.state.stateValue!==n&&this.setState({stateValue:n})):n!==null&&(this.state.controlType==="slider"||this.state.controlType==="number")?(n=parseFloat(n),console.log(`${Date.now()} Received new value: ${n}`),n!==this.state.stateValue?(this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null),this.delayedUpdate.value=n,this.delayedUpdate.timer=setTimeout(()=>{this.setState({stateValue:this.delayedUpdate.value})},500)):this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null)):this.state.stateValue.toString()!==n.toString()&&this.setState({stateValue:n})};detectType(e){if(e=e||{},e.common=e.common||{},e.common.type==="boolean"){if(this.props.schema.controlled!==!1){if(e.common.read===!1||this.props.schema.controlled===!0)return"button";if(e.common.write||this.props.schema.controlled===!0)return"switch"}return"text"}return e.common.type==="number"&&this.props.schema.controlled!==!1?e.common.write||this.props.schema.controlled===!0?e.common.max!==void 0?"slider":"input":"text":e.common.write&&this.props.schema.controlled!==!1?"input":"text"}renderItem(e,t){var m,i,a,p,o;if(!this.state.obj)return null;let n;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||(m=this.state.obj.common.role)!=null&&m.includes("button"))){let h=null;this.props.schema.falseImage&&(h=Kt(this.props.schema.falseImage));const r=this.getText(this.props.schema.falseText||this.props.schema.label,this.props.schema.noTranslation);!r&&h?n=I.createElement(B.IconButton,{style:this.props.schema.falseTextStyle,disabled:!!this.props.schema.readOnly,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async s=>{s&&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)}},h):n=I.createElement(B.Button,{variant:this.props.schema.variant||"contained",startIcon:h,style:this.props.schema.falseTextStyle,disabled:t||!!this.props.schema.readOnly,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async s=>{s&&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)}},r||this.getObjectID().split(".").pop())}else if(this.state.controlType==="input"||!this.state.controlType&&this.state.obj.common.write&&this.state.obj.common.type==="string")n=I.createElement(B.TextField,{style:{width:"100%"},value:this.state.stateValue,variant:"standard",slotProps:{input:{endAdornment:this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||void 0},htmlInput:{readOnly:!!this.props.schema.readOnly}},onChange:h=>{this.setState({stateValue:h.target.value},()=>{this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{this.controlTimeout=null,await this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!1)},this.props.schema.controlDelay||0)})},label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)});else{let h;this.props.schema.size==="normal"?h=16:this.props.schema.size==="large"?h=20:typeof this.props.schema.size=="number"&&(h=this.props.schema.size);let r=this.getText(this.props.schema.label,this.props.schema.noTranslation);const s={display:"flex",alignItems:"center",fontSize:h||"1rem",gap:8};this.props.schema.narrow||(s.width="100%",s.justifyContent="space-between"),r.trim()&&!r.trim().endsWith(":")&&this.props.schema.addColon&&(r=`${r.trim()}:`);let l;this.props.schema.blinkOnUpdate&&(l=Dv(this.props.oContext.theme,this.props.schema.blinkOnUpdate));let u;this.props.schema.labelIcon&&(u=I.createElement(G.Icon,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let c;if(r&&u?c=I.createElement("div",{style:{whiteSpace:"nowrap"}},u,r):r?c=I.createElement("div",{style:{whiteSpace:"nowrap"}},r):u&&(c=u),this.state.controlType==="switch"||!this.state.controlType&&this.state.obj.common.type==="boolean"&&(this.state.obj.common.write&&this.state.obj.common.read!==!1||(i=this.state.obj.common.role)!=null&&i.includes("switch"))){let f=null;const g=this.getText(this.props.schema.falseText,this.props.schema.noTranslation);this.props.schema.falseImage&&(f=Kt(this.props.schema.falseImage,g?{marginLeft:8}:void 0));let v=null;const b=this.getText(this.props.schema.trueText,this.props.schema.noTranslation);this.props.schema.trueImage&&(v=Kt(this.props.schema.trueImage,b?{marginRight:8}:void 0)),n=I.createElement(B.Switch,{checked:!!this.state.stateValue,disabled:!!this.props.schema.readOnly,onChange:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async A=>{A&&await this.props.oContext.socket.setState(this.getObjectID(),!this.state.stateValue,!1)}}):await this.props.oContext.socket.setState(this.getObjectID(),!this.state.stateValue,!1)}}),(g||f||b||v)&&(n=I.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:14}},I.createElement("span",{style:this.props.schema.falseTextStyle},g,f),n,I.createElement("span",{style:this.props.schema.trueTextStyle},v,b))),c&&(n=I.createElement("div",{style:s},c,n))}else if(this.state.controlType==="slider"||!this.state.controlType&&this.state.obj.common.type==="number"&&(this.state.obj.common.write&&(this.state.obj.common.max!==void 0||this.state.obj.common.unit==="%")||(a=this.state.obj.common.role)!=null&&a.includes("slider")||(p=this.state.obj.common.role)!=null&&p.includes("dimmer")||(o=this.state.obj.common.role)!=null&&o.includes("blind"))){let f=null;const g=this.getText(this.props.schema.falseText,this.props.schema.noTranslation);this.props.schema.falseImage&&(f=Kt(this.props.schema.falseImage,g?{marginLeft:8}:void 0));let v=null;const b=this.getText(this.props.schema.trueText,this.props.schema.noTranslation);this.props.schema.trueImage&&(v=Kt(this.props.schema.trueImage,b?{marginRight:8}:void 0));const A=this.props.schema.min===void 0?this.state.obj.common.min||0:this.props.schema.min,x=this.props.schema.max===void 0?this.state.obj.common.max===void 0?100:this.state.obj.common.max:this.props.schema.max,D=this.props.schema.step===void 0?this.state.obj.common.step||1:this.props.schema.step;n=I.createElement(B.Slider,{style:{width:"100%",flexGrow:1},min:A,max:x,disabled:!!this.props.schema.readOnly,step:D,value:this.state.stateValue,valueLabelDisplay:"auto",valueLabelFormat:y=>`${y}${this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||""}`,onChange:(y,E)=>{this.setState({stateValue:E},()=>{this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{console.log(`${Date.now()} Send new value: ${this.state.stateValue}`),this.controlTimeout=null,await this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!1)},this.props.schema.controlDelay||0)})}}),(g||f||b||v)&&(n=I.createElement("div",{style:{display:"flex",width:"100%",flexGrow:1,alignItems:"center"}},I.createElement("span",{style:{marginRight:16,...this.props.schema.falseTextStyle}},g,f),n,I.createElement("span",{style:{marginLeft:16,...this.props.schema.trueTextStyle}},v,b))),c&&(n=I.createElement("div",{style:s},c,n))}else if(this.state.obj.common.type==="number"&&this.state.obj.common.write){const f=this.props.schema.min===void 0?this.state.obj.common.min===void 0?void 0:this.state.obj.common.min:this.props.schema.min,g=this.props.schema.max===void 0?this.state.obj.common.max===void 0?void 0:this.state.obj.common.max:this.props.schema.max,v=this.props.schema.step===void 0?this.state.obj.common.step===void 0?void 0:this.state.obj.common.step:this.props.schema.step;n=I.createElement(B.TextField,{variant:"standard",style:{width:"100%"},value:this.state.stateValue,type:"number",slotProps:{htmlInput:{min:f,max:g,step:v,readOnly:!!this.props.schema.readOnly},input:{endAdornment:this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||void 0}},onChange:b=>{this.setState({stateValue:b.target.value},()=>{this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{this.controlTimeout=null;const A=parseFloat(this.state.stateValue);await this.props.oContext.socket.setState(this.getObjectID(),A,!1)},this.props.schema.controlDelay||0)})},label:this.getText(this.props.schema.label,this.props.schema.noTranslation),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}else if(this.state.obj.common.type==="boolean"){let f=null,g,v;this.state.stateValue?(g=this.getText(this.props.schema.trueText,this.props.schema.noTranslation),this.props.schema.trueImage&&(f=Kt(this.props.schema.falseImage,g?{marginRight:8}:void 0)),v=this.props.schema.trueTextStyle):(g=this.getText(this.props.schema.falseText,this.props.schema.noTranslation),this.props.schema.falseImage&&(f=Kt(this.props.schema.falseImage,g?{marginLeft:8}:void 0)),v=this.props.schema.falseTextStyle),v=Object.assign(s,v),n=I.createElement("div",{style:v},c,I.createElement(B.Box,{style:{display:"flex",alignItems:"center",gap:8},sx:l,key:this.props.schema.blinkOnUpdate?g:void 0},f,g||(this.state.stateValue?G.I18n.t("ra_true"):G.I18n.t("ra_false"))))}else{const f=this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit;let g,v;this.state.controlType==="html"?(v=(this.state.stateValue||"").toString(),g=I.createElement("span",{dangerouslySetInnerHTML:{__html:this.state.stateValue}})):this.state.stateValue===null?(g="null",v=g):this.state.stateValue===void 0?(g="undefined",v=g):(g=this.state.stateValue.toString(),v=g),n=I.createElement("div",{style:s},c,I.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:4}},I.createElement(B.Box,{sx:l,key:this.props.schema.blinkOnUpdate?v:void 0},g),f?I.createElement("span",{style:{opacity:.7,fontSize:"smaller"}},f):null))}}return n}}const fr={fullWidth:d=>({width:"100%",backgroundColor:d.palette.mode==="dark"?"#FFF":"#000",borderStyle:"hidden"}),primary:d=>({backgroundColor:d.palette.primary.main}),secondary:d=>({backgroundColor:d.palette.secondary.main})};class xv extends X{renderItem(){return I.createElement(B.Box,{component:"hr",sx:G.Utils.getStyle(this.props.oContext.theme,fr.fullWidth,this.props.schema.color==="primary"?fr.primary:this.props.schema.color==="secondary"?fr.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 Ev={header:d=>({width:"100%",background:d.palette.primary.main,color:d.palette.primary.contrastText,padding:"4px !important",borderRadius:"3px",marginBlockEnd:0,marginBlockStart:0})};class Av extends X{renderItem(){let e="h5";switch((this.props.schema.size||5).toString()){case"1":e="h1";break;case"2":e="h2";break;case"3":e="h3";break;case"4":e="h4";break;case"5":default:e="h5";break}return I.createElement(B.Box,{component:e,sx:Ev.header},this.getText(this.props.schema.label||this.props.schema.text,this.props.schema.noTranslation))}}class Tv extends X{renderItem(){let e=this.props.schema.src;return e&&!e.startsWith(".")&&!e.startsWith("http")&&!e.startsWith(`adapter/${this.props.oContext.adapterName}/`)&&!e.startsWith(`./adapter/${this.props.oContext.adapterName}/`)&&(e=`adapter/${this.props.oContext.adapterName}/${e}`),I.createElement("img",{src:e,style:{cursor:this.props.schema.href?"pointer":void 0,width:"100%",height:"100%"},onClick:this.props.schema.href?()=>this.props.schema.href&&window.open(this.props.schema.href,"_blank"):null,alt:""})}}function Us(d,e,t){return typeof t=="string"?{"@keyframes newValueAnimationOnceColor":{"0%":{color:e?`${t} !important`:t},"100%":{color:d.palette.mode==="dark"?e?"#fff !important":"#fff":e?"#000 !important":"#000"}},animation:"newValueAnimationOnceColor 2s ease-in-out"}:{"@keyframes newValueAnimationOnce":{"0%":{color:e?"#00f900 !important":"#00f900"},"80%":{color:d.palette.mode==="dark"?e?"#518851 !important":"#518851":e?"#008000 !important":"#008000"},"100%":{color:d.palette.mode==="dark"?e?"#fff !important":"#fff":e?"#000 !important":"#000"}},animation:"newValueAnimationOnce 2s ease-in-out"}}function Gs(d,e){return typeof e=="string"?{"@keyframes blinkAnimationColor":{"0%":{color:e},"100%":{color:d.palette.mode==="dark"?"#fff":"#000"}},animation:"blinkAnimationColor 2s ease-in-out infinite"}:{"@keyframes blinkAnimation":{"0%":{color:"#00f900"},"80%":{color:d.palette.mode==="dark"?"#518851":"#008000"},"100%":{color:d.palette.mode==="dark"?"#fff":"#000"}},animation:"blinkAnimation 2s ease-in-out infinite"}}const En={label:{fontWeight:"bold",whiteSpace:"nowrap"},valueImage:{maxHeight:"100%"},valueAndUnit:{display:"flex",gap:4,alignItems:"baseline"},value:{},unit:{fontSize:"smaller",opacity:.7}};class kv extends X{renderItem(e){let t=this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation);this.props.schema.addColon&&typeof t=="string"&&!t.trim().endsWith(":")&&(t=`${t.trim()}:`),t&&(t.includes("<a ")||t.includes("<br")||t.includes("<b>")||t.includes("<i>"))&&(t=G.Utils.renderTextWithA(t));let n;this.props.schema.size==="normal"?n=16:this.props.schema.size==="large"?n=20:typeof this.props.schema.size=="number"&&(n=this.props.schema.size);const m={width:"100%",height:"100%",display:"flex",alignItems:"center",position:"relative",fontSize:n};this.props.schema.narrow?m.gap=8:m.justifyContent="space-between";let i,a;this.props.schema.data&&typeof this.props.schema.data=="object"&&this.props.schema.data.en?a=this.getText(this.props.schema.data):typeof this.props.schema.data=="object"||this.props.schema.data===void 0||this.props.schema.data===null?a=JSON.stringify(this.props.schema.data):typeof this.props.schema.data=="number"?(a=this.props.schema.data.toString(),this.props.oContext.isFloatComma&&(a=a.replace(".",","))):(!this.props.schema.booleanAsCheckbox||typeof this.props.schema.data!="boolean")&&(a=this.props.schema.data.toString());let p=!1;if(this.props.schema.booleanAsCheckbox&&typeof this.props.schema.data=="boolean")i=I.createElement(B.Checkbox,{checked:!!i,disabled:!0,size:this.props.schema.size==="small"?"small":this.props.schema.size==="large"?"large":void 0});else if(a.startsWith("data:image/"))i=I.createElement("div",{style:{...En.value,...En.valueImage,...this.props.schema.styleValue||void 0}},I.createElement(G.Icon,{src:a}));else{const s={...En.value,...this.props.schema.styleValue||void 0};this.props.schema.html?i=I.createElement("div",{style:s,dangerouslySetInnerHTML:{__html:a}}):Array.isArray(this.props.schema.data)?(p=!0,i=I.createElement("div",{style:s},this.props.schema.data.map((l,u)=>I.createElement("div",{key:u},typeof l=="object"||l===null||l===void 0?JSON.stringify(l):l)))):a.includes(`
|
|
1395
|
+
`)?(p=!0,i=I.createElement("div",{style:s},G.Utils.renderTextWithA(a))):i=I.createElement("div",{style:s},a)}if(this.props.schema.blinkOnUpdate&&this.props.schema.blink){const s=Us(this.props.oContext.theme,!0,this.props.schema.blinkOnUpdate),l=Gs(this.props.oContext.theme,this.props.schema.blink);i=I.createElement(B.Box,{key:a,sx:{...s,...l}},i)}else if(this.props.schema.blinkOnUpdate){const s=Us(this.props.oContext.theme,!1,this.props.schema.blinkOnUpdate);i=I.createElement(B.Box,{key:a,sx:s},i)}else if(this.props.schema.blink){const s=Gs(this.props.oContext.theme,this.props.schema.blink);i=I.createElement(B.Box,{sx:s},i)}this.props.schema.unit&&(i=I.createElement("div",{style:En.valueAndUnit},i,I.createElement("div",{style:{...En.unit,...this.props.schema.styleUnit||void 0}},this.getText(this.props.schema.unit,this.props.schema.noTranslation))));let o;this.props.schema.labelIcon&&(o=I.createElement(G.Icon,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let h;this.props.schema.copyToClipboard&&(h=I.createElement(oe.ContentCopy,{className:"staticCopyButton",style:{position:"absolute",top:"calc(50% - 12px)",right:0,cursor:"pointer"},onClick:()=>{G.Utils.copyToClipboard(a),window.alert(G.I18n.t("ra_Copied"))}}));const r={"& .staticCopyButton":{display:"none"},"& .staticCopyButton:action":{transform:"scale(0.9)"},"&:hover .staticCopyButton":{display:"block"}};return this.props.schema.highlight&&(r["&:hover"]={backgroundColor:this.props.oContext.themeType==="dark"?"#51515180":"#b8b8b880"}),p&&(m.alignItems="top"),I.createElement(B.Box,{component:"div",style:m,sx:r},I.createElement("div",{style:{...En.label,...this.props.schema.styleLabel||void 0}},o,t),i,h)}}const Ks={fullWidth:{height:"100%",width:"100%"},link:d=>({textDecoration:"underline",color:d.palette.mode==="dark"?"#4dabf5":"#254e72",cursor:"pointer"})};function Ys(d,e,t){let n,m="";d?d.toString().startsWith("#")||d.toString().startsWith("/")?(n=e||"_self",m=d):d.startsWith("http://")||d.startsWith("https://")?(n=e||"_blank",m=d):(m=`#tab-instances/config/${t}/${d}`,n=e||"_self"):(m=`#tab-instances/config/${t}`,n=e||"_self"),n==="_self"?setTimeout(i=>{i.startsWith("#")?window.location.hash=i:i.startsWith("/")?m=`${window.location.protocol}:${window.location.host}${m}`:(i.startsWith("http://")||i.startsWith("https://"))&&(window.location.href=i)},100,m):(m.startsWith("#")?m=`${window.location.protocol}:${window.location.host}${window.location.pathname}${m}`:m.startsWith("/")&&(m=`${window.location.protocol}:${window.location.host}${m}`),window.open(m,n))}class Js extends X{renderItem(e,t){if(this.props.schema.button){const m=this.getIcon();return I.createElement(B.Button,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:{...Ks.fullWidth,...this.props.schema.controlStyle||void 0},disabled:t,startIcon:m,onClick:this.props.schema.href?()=>{const i=this.props.schema.href?this.getText(this.props.schema.href,!0):null;i&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:"link",url:i,target:this.props.schema.target,close:this.props.schema.close}):Ys(i,this.props.schema.target,`${this.props.oContext.adapterName}.${this.props.oContext.instance}`))}:null},this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation))}let n=this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation);return n&&(n.includes("<a ")||n.includes("<br")||n.includes("<b>")||n.includes("<i>"))&&(n=G.Utils.renderTextWithA(n)),I.createElement(B.Box,{component:"span",style:{...this.props.schema.controlStyle||void 0},sx:this.props.schema.href?Ks.link:void 0,onClick:this.props.schema.href?()=>{const m=this.props.schema.href?this.getText(this.props.schema.href,!0):null;m&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:"link",url:m,target:this.props.schema.target||"_blank",close:this.props.schema.close}):Ys(m,this.props.schema.target||"_blank",`${this.props.oContext.adapterName}.${this.props.oContext.instance}`))}:null},n)}}const mr=1024*1024,_e={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 $v(d,e,t){e=e||"key";const n=[];return Object.keys(d).forEach(m=>{const i={};i[e]=m,t?(i[t]=d[m],n.push(i)):n.push(Object.assign(i,d[m]))}),n}function Qs(d,e,t){e=e||"key";const n={};return d.forEach(m=>{let i=m[e];i==null&&(i=""),delete m[e],t?n[i]=m[t]:n[i]=m}),n}function Mv(d,e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(d[n%d.length].charCodeAt(0)^e.charCodeAt(n));return t}function _v(d,e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(d[n%d.length].charCodeAt(0)^e.charCodeAt(n));return t}class Ct extends X{filterRefs;typingTimer=null;resizeTimeout=null;secret="Zgfr56gFe87jJOM";refDiv;constructor(e){super(e),this.filterRefs={},this.props.schema.items=this.props.schema.items||[],this.props.schema.items.forEach(t=>{t.filter&&(this.filterRefs[t.attr]=J.createRef())}),this.refDiv=I.createRef()}async componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr)||[];let t;if(this.props.schema.objKeyName?t=$v(e,this.props.schema.objKeyName,this.props.schema.objValueName):t=e,Array.isArray(t)||(t=[]),this.props.schema.encryptedAttributes){const n=await this.props.oContext.socket.getCompactSystemConfig();this.secret=(n==null?void 0:n.native.secret)||this.secret,e.forEach(m=>{this.props.schema.encryptedAttributes.forEach(i=>{m[i]&&(m[i]=_v(this.secret,m[i]))})})}this.setState({value:t,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(e,t,n){var p;const{schema:m}=this.props,i=(p=m.items)==null?void 0:p.find(o=>o.attr===e);if(!i)return null;const a={items:{[e]:i}};return I.createElement(wn,{oContext:this.props.oContext,alive:this.props.alive,arrayIndex:n,changed:this.props.changed,common:this.props.common,expertMode:this.props.expertMode,custom:!0,data:t,globalData:this.props.data,index:n+this.state.iteration,onChange:(o,h)=>{const r=JSON.parse(JSON.stringify(this.state.value));r[n][o]=h,this.setState({value:r},()=>{this.validateUniqueProps(),this.onChangeWrapper(r,!0)})},onError:(o,h)=>this.onError(o,h),originalData:this.props.originalData,schema:a,table:!0,themeName:this.props.themeName})}validateUniqueProps(){if(this.props.schema.uniqueColumns)for(const e of this.props.schema.uniqueColumns){const t=[];this.state.value.find(m=>{const i=m[e];return t.includes(i)?(this.onError(e,"is not unique"),this.setState({errorMessage:G.I18n.t('Non-allowed duplicate entry "%s" in column "%s"',i,e)}),!0):(t.push(i),!1)})||(this.onError(e,null),this.setState({errorMessage:""}))}}static descendingComparator(e,t,n){return t[n]<e[n]?-1:t[n]>e[n]?1:0}static getComparator(e,t){return e==="desc"?(n,m)=>Ct.descendingComparator(n,m,t):(n,m)=>-Ct.descendingComparator(n,m,t)}static getFilterValue(e){var t,n,m;return(m=(n=(t=e==null?void 0:e.current)==null?void 0:t.children[0])==null?void 0:n.children[0])==null?void 0:m.value}static setFilterValue(e,t){return e.current.children[0].children[0].value=t}handleRequestSort=(e,t=!1)=>{const{order:n,orderBy:m}=this.state,a=t?n:m===e&&n==="asc"?"desc":"asc",p=this.stableSort(a,e);JSON.stringify(p)!==JSON.stringify(this.state.value)&&this.setState({value:p,order:a,orderBy:e,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,p))};stableSort=(e,t)=>{const{value:n}=this.state,m=Ct.getComparator(e,t),i=n.map((a,p)=>({el:a,index:p}));return i.sort((a,p)=>{const o=m(a.el,p.el);return o!==0?o:a.index-p.index}),i.map(a=>a.el)};renderShowHideFilter(e){return e.filter?I.createElement(B.IconButton,{title:G.I18n.t("ra_Show/hide filter input"),size:"small",onClick:()=>{const t=[...this.state.filterOn],n=this.state.filterOn.indexOf(e.attr);n===-1?t.push(e.attr):t.splice(n,1),this.setState({filterOn:t},()=>{n&&Ct.getFilterValue(this.filterRefs[e.attr])&&(Ct.setFilterValue(this.filterRefs[e.attr],""),this.applyFilter())})}},this.state.filterOn.includes(e.attr)?I.createElement(oe.FilterAltOff,null):I.createElement(oe.FilterAlt,null)):null}renderImportExportButtons(e){return I.createElement(I.Fragment,null,!e.noDelete&&e.import?I.createElement(B.Tooltip,{title:G.I18n.t("ra_Import data from %s file","CSV"),slotProps:{popper:{sx:_e.tooltip}}},I.createElement(B.IconButton,{size:"small",onClick:()=>this.setState({showImportDialog:!0})},I.createElement(oe.UploadFile,null))):null,e.export?I.createElement(B.Tooltip,{title:G.I18n.t("ra_Export data to %s file","CSV"),slotProps:{popper:{sx:_e.tooltip}}},I.createElement(B.IconButton,{size:"small",onClick:()=>this.onExport()},I.createElement(oe.Download,null))):null,I.createElement(B.IconButton,{disabled:!0,size:"small"},I.createElement(oe.Delete,null)))}renderAddButton(e){return I.createElement(B.Tooltip,{title:e?G.I18n.t("ra_Cannot add items with set filter"):G.I18n.t("ra_Add row"),slotProps:{popper:{sx:_e.tooltip}}},I.createElement("span",null,I.createElement(B.IconButton,{size:"small",color:"primary",disabled:!!e&&!this.props.schema.allowAddByFilter,onClick:this.onAdd},I.createElement(oe.Add,null))))}enhancedTableHead(e,t){var a;const{schema:n}=this.props,{order:m,orderBy:i}=this.state;return I.createElement(B.TableHead,null,I.createElement(B.TableRow,null,(a=n.items)==null?void 0:a.map((p,o)=>this.renderOneFilter({schema:n,style:{width:p.width},showAddButton:!o&&!n.noDelete,headCell:p,order:m,orderBy:i,index:o,doAnyFilterSet:t})),!n.noDelete&&I.createElement(B.TableCell,{style:{paddingLeft:20,paddingRight:20,width:e,textAlign:"right"},padding:"checkbox"},this.renderImportExportButtons(n))))}onDelete=e=>()=>{const t=JSON.parse(JSON.stringify(this.state.value));t.splice(e,1),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))};onExport(){const{schema:e}=this.props,{value:t}=this.state,m=[e.items.map(p=>p.attr).join(";")];t.forEach(p=>{const o=[];e.items.forEach(h=>{var r;(r=p[h.attr])!=null&&r.includes(";")?o.push(`"${p[h.attr]}"`):o.push(p[h.attr]===void 0||p[h.attr]===null?"":p[h.attr])}),m.push(o.join(";"))});const i=document.createElement("a");i.setAttribute("href",`data:text/csv;charset=utf-8,${encodeURIComponent(m.join(`
|
|
1396
|
+
`))}`);const a=new Date;i.setAttribute("download",`${a.getFullYear()}_${(a.getMonth()+1).toString().padStart(2,"0")}_${a.getDate().toString().padStart(2,"0")}_${this.props.oContext.adapterName}.${this.props.oContext.instance}_${this.props.attr}.csv`),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}onImport(e){var a;const t=e.split(`
|
|
1397
|
+
`).map(p=>p.replace("\r","").trim()),{schema:n}=this.props,m=t.shift().split(";").filter(p=>p&&n.items.find(o=>o.attr===p)),i=[];t.forEach(p=>{const o=p.split(";"),h={};for(let r=0;r<o.length;r++){let s=o[r];if(s.startsWith('"')){for(s=s.substring(1);r<o.length&&!s.endsWith('"');)s+=`;${o[++r]}`;s=s.substring(0,s.length-1)}let l=s;if(s==="true")l=!0;else if(s==="false")l=!1;else if(window.isFinite(s)){const u=this.props.schema.items.find(c=>c.attr===m[r]);u&&u.type==="number"?l=parseFloat(s):l=s}else l=s;h[m[r]]=l}i.push(h)}),i.length?(a=this.state.value)!=null&&a.length?this.setState({showTypeOfImportDialog:i,showImportDialog:!1}):this.setState({value:i,showImportDialog:!1}):window.alert("ra_No data found in file")}onClone=e=>()=>{const t=JSON.parse(JSON.stringify(this.state.value)),n=JSON.parse(JSON.stringify(t[e]));if(typeof this.props.schema.clone=="string"&&typeof n[this.props.schema.clone]=="string"){let m=1,i=n[this.props.schema.clone];const a=i.match(/(\d+)$/);for(a?(i=i.replace(a[0],""),m=parseInt(a[0],10)+1):i+="_";t.find(p=>p[this.props.schema.clone]===i+m.toString());)m++;n[this.props.schema.clone]=`${n[this.props.schema.clone]}_${m}`}t.splice(e,0,n),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))};onChangeWrapper=(e,t)=>{this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout((n,m)=>{this.typingTimer=null;let i;if(this.props.schema.encryptedAttributes){const a=JSON.parse(JSON.stringify(n));if(a.forEach(p=>{this.props.schema.encryptedAttributes.forEach(o=>{p[o]&&(p[o]=Mv(this.secret,p[o]))})}),this.props.schema.objKeyName){const p=Qs(a,this.props.schema.objKeyName,this.props.schema.objValueName);i=this.onChange(this.props.attr,p)}else i=this.onChange(this.props.attr,a)}else if(this.props.schema.objKeyName){const a=Qs(JSON.parse(JSON.stringify(n)),this.props.schema.objKeyName,this.props.schema.objValueName);i=this.onChange(this.props.attr,a)}else i=this.onChange(this.props.attr,n);i instanceof Promise&&i.catch(a=>console.error(`Cannot save: ${a}`)),m&&(this.applyFilter(!1,n),this.handleRequestSort(this.state.orderBy,!0))},300,e,t)};onAdd=()=>{var m;const{schema:e}=this.props,t=JSON.parse(JSON.stringify(this.state.value)),n=(m=e.items)==null?void 0:m.reduce((i,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,t.length,this.props.data):this.props.schema.default:p=a.defaultFunc?this.execute(a.defaultFunc,this.props.schema.default,this.props.data,t.length,this.props.data):this.props.schema.default:p=a.default===void 0?null:a.default,i[a.attr]=p,i},{});t.push(n),this.setState({value:t},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))};isAnyFilterSet(){return!!Object.keys(this.filterRefs).find(e=>Ct.getFilterValue(this.filterRefs[e]))}applyFilter=(e,t,n)=>{t=t||this.state.value;let m=t.map((i,a)=>a);if(Object.keys(this.filterRefs).forEach(i=>{let a=Ct.getFilterValue(this.filterRefs[i]);!e&&a?(a=a.toLowerCase(),m=m.filter(p=>t[p]&&t[p][i]&&t[p][i].toLowerCase().includes(a))):this.filterRefs[i].current&&Ct.setFilterValue(this.filterRefs[i],"")}),m.length===t.length&&(m=null),m===null&&this.state.visibleValue===null){n&&n();return}JSON.stringify(m)!==JSON.stringify(this.state.visibleValue)?this.setState({visibleValue:m},()=>n&&n()):n&&n()};onMoveUp(e){const t=JSON.parse(JSON.stringify(this.state.value)),n=t[e];t.splice(e,1),t.splice(e-1,0,n),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))}onMoveDown(e){const t=JSON.parse(JSON.stringify(this.state.value)),n=t[e];t.splice(e,1),t.splice(e+1,0,n),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))}onDrop(e){const t=e[0],n=new FileReader;n.onabort=()=>console.log("file reading was aborted"),n.onerror=()=>console.log("file reading has failed"),n.onload=()=>{if(t.size>mr){window.alert(G.I18n.t("ra_File is too big. Max %sk allowed. Try use SVG.",Math.round(mr/1024)));return}const m=new Uint8Array(n.result).reduce((i,a)=>i+String.fromCharCode(a),"");this.onImport(m)},n.readAsArrayBuffer(t)}showTypeOfImportDialog(){return this.state.showTypeOfImportDialog?I.createElement(B.Dialog,{open:!0,onClose:()=>this.setState({showTypeOfImportDialog:!1}),maxWidth:"md"},I.createElement(B.DialogTitle,null,G.I18n.t("ra_Append or replace?")),I.createElement(B.DialogContent,null,G.I18n.t("ra_Append %s entries or replace existing?",this.state.showTypeOfImportDialog.length)),I.createElement(B.DialogActions,null,I.createElement(B.Button,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>{const e=JSON.parse(JSON.stringify(this.state.value));this.state.showTypeOfImportDialog.forEach(t=>e.push(t)),this.setState({value:e,iteration:this.state.iteration+1e4,showTypeOfImportDialog:!1},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(e)))}},G.I18n.t("ra_Append")),I.createElement(B.Button,{variant:"contained",color:"secondary",autoFocus:!0,onClick:()=>{const e=this.state.showTypeOfImportDialog;this.setState({value:e,iteration:this.state.iteration+1e4,showTypeOfImportDialog:!1},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(e)))}},G.I18n.t("ra_Replace")))):null}showImportDialog(){return this.state.showImportDialog?I.createElement(B.Dialog,{open:!0,onClose:()=>this.setState({showImportDialog:!1}),sx:{"& .MuiDialog-paper":{minHeight:500}},maxWidth:"md",fullWidth:!0},I.createElement(B.DialogTitle,null,G.I18n.t("ra_Import from %s","CSV")),I.createElement(B.DialogContent,null,I.createElement(qs,{multiple:!1,accept:{"text/csv":[".csv"]},maxSize:mr,onDragEnter:()=>this.setState({uploadFile:"dragging"}),onDragLeave:()=>this.setState({uploadFile:!0}),onDrop:(e,t)=>{this.setState({uploadFile:!1}),e.length?this.onDrop(e):window.alert(t&&t[0]&&t[0].errors&&t[0].errors[0]&&t[0].errors[0].message||G.I18n.t("ra_Cannot upload"))}},({getRootProps:e,getInputProps:t})=>I.createElement("div",{style:{..._e.uploadDiv,...this.state.uploadFile==="dragging"?_e.uploadDivDragging:void 0,..._e.dropZone,...this.state.icon?void 0:_e.dropZoneEmpty},...e()},I.createElement("input",{...t()}),I.createElement("div",{style:_e.uploadCenterDiv},I.createElement("div",{style:_e.uploadCenterTextAndIcon},I.createElement(oe.UploadFile,{style:_e.uploadCenterIcon}),I.createElement("div",{style:_e.uploadCenterText},this.state.uploadFile==="dragging"?G.I18n.t("ra_Drop file here"):G.I18n.t("ra_Place your files here or click here to open the browse dialog"))))))),I.createElement(B.DialogActions,null,I.createElement(B.Button,{variant:"contained",onClick:()=>this.setState({showImportDialog:!1}),color:"primary",startIcon:I.createElement(oe.Close,null)},G.I18n.t("Cancel")))):null}renderOneFilter(e){return I.createElement(B.TableCell,{key:`${e.headCell.attr}_${e.index}`,style:e.style,align:"left",sortDirection:e.orderBy===e.headCell.attr?e.order:!1},I.createElement("div",{style:{..._e.flex,...e.schema.showFirstAddOnTop?{flexDirection:"column"}:void 0}},e.showAddButton?this.renderAddButton(e.doAnyFilterSet):null,e.headCell.sort&&I.createElement(B.TableSortLabel,{active:!0,style:e.orderBy!==e.headCell.attr?_e.silver:void 0,direction:e.orderBy===e.headCell.attr?e.order:"asc",onClick:()=>this.handleRequestSort(e.headCell.attr)}),e.headCell.filter&&this.state.filterOn.includes(e.headCell.attr)?I.createElement(B.TextField,{variant:"standard",ref:this.filterRefs[e.headCell.attr],onChange:()=>this.applyFilter(),title:G.I18n.t("ra_You can filter entries by entering here some text"),slotProps:{input:{endAdornment:Ct.getFilterValue(this.filterRefs[e.headCell.attr])&&I.createElement(B.InputAdornment,{position:"end"},I.createElement(B.IconButton,{size:"small",tabIndex:-1,onClick:()=>{Ct.setFilterValue(this.filterRefs[e.headCell.attr],""),this.applyFilter()}},I.createElement(oe.Close,null)))}},fullWidth:!0,placeholder:this.getText(e.headCell.title)}):I.createElement("span",{style:_e.headerText},this.getText(e.headCell.title)),this.renderShowHideFilter(e.headCell)))}enhancedFilterCard(){var i;const{schema:e}=this.props,{order:t,orderBy:n}=this.state;let m;return this.props.schema.compact&&(m={paddingTop:1,paddingBottom:1}),I.createElement(B.Grid2,{size:{xs:e.xs||12,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0}},I.createElement(B.Card,null,I.createElement(B.Paper,{style:_e.paper},I.createElement(B.Accordion,{style:_e.paper},I.createElement(B.AccordionSummary,{expandIcon:I.createElement(oe.ExpandMore,null)},I.createElement(B.Typography,null,G.I18n.t("ra_Filter and Data Actions"))),I.createElement(B.AccordionDetails,null,I.createElement(B.Table,null,I.createElement(B.TableBody,null,(i=e.items)==null?void 0:i.map((a,p)=>I.createElement(B.TableRow,{key:`${a.attr}_${p}`},this.renderOneFilter({schema:e,style:m,showAddButton:!1,headCell:a,order:t,orderBy:n,index:p,doAnyFilterSet:!1}))),I.createElement(B.TableRow,null,I.createElement(B.TableCell,{align:"left",style:m},I.createElement("span",{style:_e.headerText},G.I18n.t("ra_Actions"))),I.createElement(B.TableCell,{style:m},this.renderImportExportButtons(e))))))))))}enhancedBottomCard(){const{schema:e}=this.props;let t;this.props.schema.compact&&(t={paddingTop:1,paddingBottom:1});const n=this.isAnyFilterSet();return I.createElement(B.Grid2,{size:{xs:e.xs||12,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0}},I.createElement(B.Card,null,I.createElement(B.Paper,{style:_e.paper},I.createElement(B.Table,null,I.createElement(B.TableBody,null,I.createElement(B.TableRow,null,I.createElement(B.TableCell,{colSpan:e.items.length+1,style:t},this.renderAddButton(n))))))))}renderCards(){const{schema:e}=this.props;let{visibleValue:t}=this.state,n;this.props.schema.compact&&(n={paddingTop:1,paddingBottom:1}),t=t||this.state.value.map((i,a)=>a);const m=this.isAnyFilterSet();return I.createElement(B.Grid2,{container:!0},this.showImportDialog(),this.showTypeOfImportDialog(),this.enhancedFilterCard(),t.map((i,a)=>{var p;return I.createElement(B.Grid2,{key:`${i}_${a}`,size:{xs:e.xs||12,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0}},I.createElement(B.Card,null,I.createElement(B.Paper,{style:_e.paper},I.createElement(B.Table,null,I.createElement(B.TableBody,null,(p=e.items)==null?void 0:p.map(o=>I.createElement(B.TableRow,{key:`${o.attr}_${i}`},I.createElement(B.TableCell,{align:"left",style:n},I.createElement("span",{style:_e.headerText},this.getText(o.title))),I.createElement(B.TableCell,{align:"left",style:n},this.itemTable(o.attr,this.state.value[i],i)))),I.createElement(B.TableRow,null,I.createElement(B.TableCell,{align:"left",style:n},I.createElement("span",{style:_e.headerText},this.getText("Actions"))),I.createElement(B.TableCell,{align:"left",style:n},!m&&!this.state.orderBy?I.createElement(B.Tooltip,{title:G.I18n.t("ra_Move up"),slotProps:{popper:{sx:_e.tooltip}}},I.createElement("span",null,I.createElement(B.IconButton,{size:"small",onClick:()=>this.onMoveUp(i),disabled:a===0},I.createElement(oe.ArrowUpward,null)))):null,!m&&!this.state.orderBy?I.createElement(B.Tooltip,{title:G.I18n.t("ra_Move down"),slotProps:{popper:{sx:_e.tooltip}}},I.createElement("span",null,I.createElement(B.IconButton,{size:"small",onClick:()=>this.onMoveDown(i),disabled:a===t.length-1},I.createElement(oe.ArrowDownward,null)))):null,I.createElement(B.Tooltip,{title:G.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:_e.tooltip}}},I.createElement(B.IconButton,{size:"small",onClick:this.onDelete(i)},I.createElement(oe.Delete,null))),this.props.schema.clone?I.createElement(B.Tooltip,{title:G.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:_e.tooltip}}},I.createElement(B.IconButton,{size:"small",onClick:this.onClone(i)},I.createElement(oe.ContentCopy,null))):null)))))))}),this.enhancedBottomCard())}renderTable(){const{schema:e}=this.props;let{visibleValue:t}=this.state;t=t||this.state.value.map((i,a)=>a);const n=this.isAnyFilterSet();let m;return this.props.schema.compact&&(m={paddingTop:1,paddingBottom:1}),I.createElement(B.Paper,{style:_e.paper},this.showImportDialog(),this.showTypeOfImportDialog(),e.label?I.createElement("div",{style:_e.label},I.createElement(B.Toolbar,{variant:"dense",style:_e.rootTool},I.createElement(B.Typography,{style:_e.title,variant:"h6",id:"tableTitle",component:"div"},this.getText(e.label)))):null,I.createElement(B.TableContainer,null,I.createElement(B.Table,{style:_e.table,size:"small"},this.enhancedTableHead(!n&&!this.state.orderBy?120:64,n),I.createElement(B.TableBody,null,t.map((i,a)=>{var p;return I.createElement(B.TableRow,{hover:!0,key:`${i}_${a}`},(p=e.items)==null?void 0:p.map(o=>I.createElement(B.TableCell,{key:`${o.attr}_${i}`,align:"left",style:m},this.itemTable(o.attr,this.state.value[i],i))),!e.noDelete&&I.createElement(B.TableCell,{align:"left",style:{...m,..._e.buttonCell}},!n&&!this.state.orderBy?a?I.createElement(B.Tooltip,{title:G.I18n.t("ra_Move up"),slotProps:{popper:{sx:_e.tooltip}}},I.createElement(B.IconButton,{size:"small",onClick:()=>this.onMoveUp(i)},I.createElement(oe.ArrowUpward,null))):I.createElement("div",{style:_e.buttonEmpty}):null,!n&&!this.state.orderBy?a<t.length-1?I.createElement(B.Tooltip,{title:G.I18n.t("ra_Move down"),slotProps:{popper:{sx:_e.tooltip}}},I.createElement(B.IconButton,{size:"small",onClick:()=>this.onMoveDown(i)},I.createElement(oe.ArrowDownward,null))):I.createElement("div",{style:_e.buttonEmpty}):null,I.createElement(B.Tooltip,{title:G.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:_e.tooltip}}},I.createElement(B.IconButton,{size:"small",onClick:this.onDelete(i)},I.createElement(oe.Delete,null))),this.props.schema.clone?I.createElement(B.Tooltip,{title:G.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:_e.tooltip}}},I.createElement(B.IconButton,{size:"small",onClick:this.onClone(i)},I.createElement(oe.ContentCopy,null))):null))}),!e.noDelete&&t.length>=(e.showSecondAddAt||5)?I.createElement(B.TableRow,null,I.createElement(B.TableCell,{colSpan:e.items.length+1,style:{...m}},this.renderAddButton(n))):null)),!t.length&&this.state.value.length?I.createElement("div",{style:_e.filteredOut},I.createElement(B.Typography,{style:_e.title,variant:"h6",id:"tableTitle",component:"div"},G.I18n.t("ra_All items are filtered out"),I.createElement(B.IconButton,{size:"small",onClick:()=>this.applyFilter(!0)},I.createElement(oe.Close,null)))):null),e.help?I.createElement(B.FormHelperText,{style:{paddingLeft:16}},this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null,this.state.errorMessage?I.createElement("div",{style:{display:"flex",padding:"5px"}},I.createElement(oe.Warning,{color:"error"}),I.createElement("span",{style:{color:"red",alignSelf:"center"}},this.state.errorMessage)):null)}componentDidUpdate(){var e;(e=this.refDiv.current)!=null&&e.clientWidth&&this.refDiv.current.clientWidth!==this.state.width&&(this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{var t;this.resizeTimeout=null,this.setState({width:(t=this.refDiv.current)==null?void 0:t.clientWidth})},50))}getCurrentBreakpoint(){return this.state.width?this.state.width<600?"xs":this.state.width<900?"sm":this.state.width<1200?"md":this.state.width<1536?"lg":"xl":"md"}renderItem(){const{schema:e}=this.props;if(!this.state.value||!Array.isArray(this.state.value))return null;const t=this.getCurrentBreakpoint();let n;return t&&(e.useCardFor||["xs"]).includes(t)?n=this.renderCards():n=this.renderTable(),I.createElement("div",{ref:this.refDiv,style:{width:"100%"}},n)}}const xi={indeterminate:{opacity:.5},label:{width:"100%",fontSize:14,marginBottom:2},helper:{width:"100%",fontSize:12},error:{width:"100%",fontSize:12,color:"#FF0000"}};class Iv extends X{updateTimeout=null;componentDidMount(){super.componentDidMount();let e=X.getValue(this.props.data,this.props.attr);if(Array.isArray(e)&&this.props.oContext.multiEdit){e=X.DIFFERENT_VALUE,this.setState({value:e,oldValue:e,jsonError:!1});return}this.setState({value:e,oldValue:e,jsonError:this.validateJson(e)})}validateJson(e){let t=!1;if(this.props.schema.validateJson&&(e||!this.props.schema.allowEmpty))try{JSON.parse(e)}catch(n){console.log("Error in JSON",n),t=!0}return t}static getDerivedStateFromProps(e,t){if(e.oContext.multiEdit&&t.value===X.DIFFERENT_VALUE)return{value:X.DIFFERENT_VALUE};let n=X.getValue(e.data,e.attr);return n!=null&&(n=n.toString()),n==null||n!==t.value&&n!==t.oldValue?{value:n}:null}renderItem(e,t){const n=Array.isArray(this.state.value)||this.state.value===X.DIFFERENT_VALUE;if(this.props.schema.time){let a="";return typeof this.state.value=="number"?this.state.value&&this.state.value<9466596e5?a=new Date(this.state.value*1e3).toLocaleString():a=new Date(this.state.value).toLocaleString():typeof this.state.value=="string"&&(a=new Date(this.state.value).toLocaleString()),I.createElement(B.TextField,{variant:"standard",fullWidth:!0,value:a,error:!!e||!!this.state.jsonError,disabled:!!t,slotProps:{htmlInput:{readOnly:!0}},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}if(this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=null,this.setState({oldValue:null})},30)):this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=null),n){const a=X.getValue(this.props.data,this.props.attr),p=(a==null?void 0:a.filter(o=>o||o===0).map(o=>({label:o.toString()||"",value:o})))||[];return p.unshift({label:G.I18n.t(X.DIFFERENT_LABEL),value:X.DIFFERENT_VALUE}),I.createElement(B.Autocomplete,{style:xi.indeterminate,fullWidth:!0,value:p[0],onChange:(o,h)=>{const r=h?h.value:"",s=this.onChange(this.props.attr,r,()=>{this.setState({value:r,oldValue:r,jsonError:this.validateJson(h)})});s instanceof Promise&&s.catch(l=>console.error(`Cannot set value: ${l}`))},options:p,getOptionLabel:o=>o.label,renderInput:o=>I.createElement(B.TextField,{variant:"standard",...o,error:!!e,placeholder:this.getText(this.props.schema.placeholder),slotProps:{htmlInput:{...o.inputProps,maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1}},label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:!!t})})}let m,i;if((this.props.schema.readOnly||t)&&this.props.schema.copyToClipboard?(this.props.schema.minRows>1&&(i={position:"absolute",right:3,top:20,zIndex:1e3}),m=I.createElement(B.IconButton,{style:i,size:"small",onClick:()=>{G.Utils.copyToClipboard(this.state.value),window.alert(G.I18n.t("ra_Copied"))}},I.createElement(G.IconCopy,null))):!this.props.schema.readOnly&&!t&&this.state.value&&!this.props.schema.noClearButton&&(this.props.schema.minRows>1&&(i={position:"absolute",right:3,top:20,zIndex:1e3}),m=I.createElement(B.IconButton,{style:i,size:"small",tabIndex:-1,onClick:()=>this.setState({value:"",oldValue:this.state.value},()=>this.onChange(this.props.attr,""))},I.createElement(oe.Close,null)),this.props.schema.minRows<=1&&(m=I.createElement(B.InputAdornment,{position:"end"},m))),this.props.schema.minRows>1){const a=this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation);return I.createElement("div",{style:{width:"100%",position:"relative"}},this.props.schema.label?I.createElement("div",{style:xi.label},this.getText(this.props.schema.label)):null,I.createElement(B.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:!!t,readOnly:this.props.schema.readOnly||!1,onChange:p=>{const o=p.target.value;this.setState({value:o,oldValue:this.state.value,jsonError:this.validateJson(o)},()=>this.onChange(this.props.attr,o||""))},placeholder:this.getText(this.props.schema.placeholder)}),a||e||this.state.jsonError?I.createElement("div",{style:e?xi.error:xi.helper},e||(this.state.jsonError?G.I18n.t("ra_Invalid JSON"):a)):null)}return I.createElement(B.TextField,{variant:"standard",fullWidth:!0,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!e||!!this.state.jsonError,disabled:!!t,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:m}},onChange:a=>{const p=a.target.value;this.setState({value:p,oldValue:this.state.value,jsonError:this.validateJson(p)},()=>this.onChange(this.props.attr,p))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.state.jsonError?G.I18n.t("ra_Invalid JSON"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const Lv={fullWidth:{width:"100%"}};class Fv extends X{initialized=!1;localContext;askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){const t=this.getPattern(this.props.schema.jsonData,null,!0);try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${t}`)}}e===void 0&&(e=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",e).then(t=>{if(typeof t=="object"){const n=t;this.setState({text:n.text||"",style:n.style,icon:n.icon,iconStyle:n.iconStyle})}else typeof t=="string"&&this.setState({text:t||""})}).catch(t=>console.error(`Cannot send command: ${t}`))}}getLocalContext(){const e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=X.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(){if(this.props.alive){const t=this.getLocalContext();(t!==this.localContext||!this.initialized)&&(this.localContext=t,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}if(this.state.text===void 0)return null;let e=null;return this.state.icon&&(e=Kt(this.state.icon,{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}),e||(e=I.createElement(G.Icon,{src:this.state.icon,style:{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}}))),this.props.schema.container==="text"?I.createElement(B.TextField,{variant:"standard",fullWidth:!0,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?I.createElement(B.IconButton,{size:"small",onClick:()=>{G.Utils.copyToClipboard(this.state.text),window.alert(G.I18n.t("ra_Copied"))}},I.createElement(G.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)}):I.createElement("div",{style:{...Lv.fullWidth,...this.state.style||void 0}},e,this.props.schema.container==="html"?I.createElement("span",{dangerouslySetInnerHTML:{__html:this.state.text||""}}):this.state.text)}}class Rv extends X{componentDidMount(){super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr);this.setState({value:e})}renderItem(e,t){const n=this.props.schema.returnFormat!=="HH:mm:ss",m=new Date(Date.parse(`Thu, 01 Jan 1970 ${this.state.value||"00:00:00"}`));return I.createElement(dm,{sx:i=>({width:"100%",borderBottom:`1px solid ${i.palette.text.primary}`,"& fieldset":{display:"none"},"& input":{padding:`${i.spacing(1.5)} 0 4px 0`},"& .MuiInputAdornment-root":{marginLeft:0,marginTop:1},"& label":{transform:"translate(0px, -9px) scale(0.75)"}}),ampm:this.props.oContext.systemConfig.dateFormat.includes("/"),timeSteps:this.props.schema.timeSteps||this.props.schema.timesteps||{hours:1,minutes:5,seconds:5},format:this.props.schema.format||"HH:mm:ss",disabled:!!t,value:m,onChange:i=>{let a;a=i instanceof Date?i.toTimeString().split(" ")[0]:i.toTimeString(),n&&(a=a.split(":").slice(0,2).join(":")),this.setState({value:a},()=>this.onChange(this.props.attr,this.state.value))},views:this.props.schema.views||["hours","minutes","seconds"],label:this.getText(this.props.schema.label)})}}function Ov(d,e){let t;return e&&d.substring(0,e.length)===e?t=d.substring(e.length+1):t=d,t=t.replace(/\./g,"/").replace(/_/g," "),t}class Pv extends X{componentDidMount(){var t;super.componentDidMount();const e=X.getValue(this.props.data,this.props.attr);if(!e&&((t=this.props.customObj)!=null&&t._id)){const n=Ov(this.props.customObj._id,`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);this.setState({value:n})}else this.setState({value:e||""})}renderItem(e,t){return I.createElement(B.TextField,{variant:"standard",fullWidth:!0,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},value:this.state.value,error:!!e,disabled:t,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),onChange:n=>{const m=n.target.value;this.setState({value:m},()=>this.onChange(this.props.attr,m))}})}}class Nv extends X{async componentDidMount(){var t;super.componentDidMount();const e=await this.props.oContext.socket.getObject("system.meta.uuid");this.setState({uuid:((t=e==null?void 0:e.native)==null?void 0:t.uuid)||"unknown"})}renderItem(e,t){return I.createElement(B.TextField,{variant:"standard",fullWidth:!0,error:!!e,disabled:!!t,slotProps:{htmlInput:{readOnly:!0},input:{endAdornment:I.createElement(B.IconButton,{onClick:()=>{G.Utils.copyToClipboard(this.state.uuid),window.alert(G.I18n.t("ra_Copied %s",this.state.uuid))}},I.createElement(oe.ContentCopy,null))}},value:this.state.uuid||"",label:this.getText(this.props.schema.label)||G.I18n.t("ra_Serial number (UUID)"),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const Zs={icon:{width:16,height:16,marginRight:8}};class Bv extends X{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getUsers().then(e=>{const t={},n=G.I18n.getLanguage();this.props.schema.short?e.forEach(m=>{var i,a;return t[m._id]={color:(i=m.common)==null?void 0:i.color,icon:(a=m.common)==null?void 0:a.icon,name:G.Utils.getObjectNameFromObj(m,n)}}):e.forEach(m=>{var i,a;return t[m._id.replace(/^system\.user\./,"")]={color:(i=m.common)==null?void 0:i.color,icon:(a=m.common)==null?void 0:a.icon,name:G.Utils.getObjectNameFromObj(m,n)}}),this.setState({users:t})}).catch(e=>console.error(`Cannot get users: ${e}`))}renderItem(e,t){var m,i;const n=X.getValue(this.props.data,this.props.attr);return I.createElement(B.FormControl,{variant:"standard",fullWidth:!0},this.state.users&&this.props.schema.label?I.createElement(B.InputLabel,null,this.getText(this.props.schema.label)):null,this.state.users?I.createElement(B.Select,{variant:"standard",error:!!e,disabled:!!t,value:n,renderValue:a=>{var p,o,h;return I.createElement("span",null,this.state.users&&((p=this.state.users[a])!=null&&p.icon)?I.createElement(G.Icon,{src:this.state.users&&((o=this.state.users[a])==null?void 0:o.icon),style:Zs.icon}):null,this.state.users&&((h=this.state.users[a])==null?void 0:h.name)||a||"")},style:{color:this.state.users&&((m=this.state.users[n])==null?void 0:m.color)||void 0,backgroundColor:G.Utils.getInvertedColor(this.state.users&&((i=this.state.users[n])==null?void 0:i.color),this.props.oContext.themeType)},onChange:a=>this.onChange(this.props.attr,a.target.value)},this.state.users&&Object.keys(this.state.users).map(a=>I.createElement(B.MenuItem,{style:{color:this.state.users[a].color||void 0,backgroundColor:G.Utils.getInvertedColor(this.state.users[a].color,this.props.oContext.themeType)},key:a,value:a},this.state.users[a].icon?I.createElement(G.Icon,{src:this.state.users[a].icon,style:Zs.icon}):null,this.state.users[a].name))):I.createElement(B.TextField,{variant:"standard",error:!!e,disabled:!!t,value:n,onChange:a=>this.onChange(this.props.attr,a.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?I.createElement(B.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Vv extends X{async componentDidMount(){super.componentDidMount();const e=await zl(()=>import("./index-DrWcIcrD.js").then(t=>t.i),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);this.setState({QRCode:e.default})}renderItem(){const e=this.state.QRCode;return e?I.createElement(e,{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 Wv={accordion:gc,alive:vc,autocomplete:yc,autocompleteSendTo:bc,certCollection:Sc,certificate:Cc,certificates:Dc,checkbox:xc,checkLicense:Yt,chip:cs,chips:cs,color:$c,coordinates:Mc,cron:wc,custom:qn,datePicker:pm,deviceManager:fm,divider:xv,file:Em,fileSelector:Gi,func:Am,header:Av,image:$m,imageSendTo:km,instance:Mm,interface:_m,ip:Tm,jsonEditor:rv,language:ov,license:av,number:lv,objectId:cv,password:uv,pattern:hv,port:pv,qrCode:Vv,room:fv,select:gv,selectSendTo:yv,sendto:Hs,sendTo:Hs,setState:wv,slider:Cv,state:Sv,staticImage:Tv,staticInfo:kv,staticLink:Js,staticText:Js,table:Ct,text:Iv,textSendTo:Fv,timePicker:Rv,topic:Pv,uuid:Nv,user:Bv},It={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:d=>({backgroundColor:d.palette.primary.main,color:d.palette.mode==="dark"?"inherit":"#FFF"}),secondary:d=>({backgroundColor:d.palette.secondary.main})};class wn extends X{componentDidMount(){var e;super.componentDidMount(),(e=this.props.schema)!=null&&e.collapsable&&this.setState({expanded:(window._localStorage||window.localStorage).getItem(`${this.props.oContext.adapterName}.${this.props.attr}`)==="true"})}renderItems(e,t){return e?Object.keys(e).map(n=>{if(this.props.oContext.multiEdit&&e[n].noMultiEdit)return null;const m=e[n].type||"panel";let i,a="Use this.props.oContext.socket!";return m==="custom"?(e[n].url?i=qn:this.props.oContext.customs&&this.props.oContext.customs[e[n].component]?i=this.props.oContext.customs[e[n].component]:(console.error(`Cannot find custom component: ${e[n].component}`),i=X),a=this.props.oContext.socket):m==="panel"?i=wn:i=Wv[m]||X,I.createElement(i,{socket:a,globalData:this.props.globalData,oContext:this.props.oContext,key:`${n}_${this.props.index===void 0?"":this.props.index}`,index:this.props.index,changed:this.props.changed,arrayIndex:this.props.arrayIndex,expertMode:this.props.expertMode,commandRunning:this.props.commandRunning,style:It.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:t,customObj:this.props.customObj,custom:this.props.custom,schema:e[n],attr:n,table:this.props.table})}):null}render(){const e=this.props.schema;if(!e)return null;const{disabled:t,hidden:n}=this.calculate(e),m=this.props.schema.items,i=this.props.schema.style||{};if(n){if(e.hideOnlyControl){const p=I.createElement(B.Grid2,{size:{xs:e.xs||void 0,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0},sx:G.Utils.getStyle(this.props.oContext.theme,{marginBottom:0,textAlign:"left"},i,this.props.oContext.themeType==="dark"&&e.darkStyle)});return e.newLine?I.createElement(I.Fragment,null,I.createElement("div",{style:{flexBasis:"100%",height:0}}),p):p}return null}if(this.props.table)return this.renderItems(m,t);if(this.props.custom)return I.createElement(B.Grid2,{key:`${this.props.attr}_${this.props.index}`,container:!0,style:It.fullWidth,columnSpacing:2,rowSpacing:1,sx:i},this.renderItems(m,t));let a;if(e.collapsable)a=I.createElement(B.Accordion,{key:`${this.props.attr}_${this.props.index}`,style:It.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})}},I.createElement(B.AccordionSummary,{expandIcon:I.createElement(oe.ExpandMore,null),sx:G.Utils.getStyle(this.props.oContext.theme,i,this.props.oContext.themeType&&e.darkStyle,e.color==="primary"?It.primary:e.color==="secondary"&&It.secondary,{width:"100%"})},I.createElement(B.Typography,{style:It.heading},this.getText(e.label))),I.createElement(B.AccordionDetails,null,I.createElement(B.Grid2,{container:!0,columnSpacing:2,rowSpacing:1,sx:{...i,width:"100%",padding:"10px"}},this.renderItems(m,t))));else{const p=G.Utils.getStyle(this.props.oContext.theme,this.props.style,i,{width:"100%"},this.props.isParentTab&&It.paper,this.props.isParentTab&&(this.props.withoutSaveButtons?this.props.withIcons?{height:"calc(100% - 88px) !important"}:{height:"calc(100% - 64px) !important"}:this.props.withIcons?It.paperWithIcons:It.paperWithoutIcons));a=I.createElement(B.Box,{component:"div",key:`${this.props.attr}_${this.props.index}`,className:this.props.className,sx:p},I.createElement(B.Grid2,{container:!0,columnSpacing:2,rowSpacing:1,sx:G.Utils.getStyle(this.props.oContext.theme,{width:"100%"},this.props.isParentTab&&It.padding,this.props.schema.innerStyle)},this.renderItems(m,t)))}if(!this.props.isParentTab){const p=I.createElement(B.Grid2,{title:this.getText(e.tooltip),size:{xs:e.xs||void 0,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0},sx:{marginBottom:0,textAlign:"left",...i}},a);return e.newLine?I.createElement(I.Fragment,null,I.createElement("div",{style:{flexBasis:"100%",height:0}}),p):p}return a}}const Ei={tabs:{height:"100%",width:"100%"},panel:{width:"100%",display:"block"},panelWithIcons:{height:"calc(100% - 72px)"},panelWithoutIcons:{height:"calc(100% - 48px)"}};class Hv extends X{resizeTimeout=null;refDiv;constructor(e){super(e);let t;if(this.props.root){const n=(window.location.hash||"").replace(/^#/,"").split("/");if(n.length>=3&&n[1]==="config"){const m=n[3],i=parseInt(m,10);m&&i.toString()===m?i>=0&&i<Object.keys(this.props.schema.items).length&&(t=Object.keys(this.props.schema.items)[i]):m&&Object.keys(this.props.schema.items).includes(m)&&(t=m),window.addEventListener("hashchange",this.onHashTabsChanged,!1)}}t===void 0&&(t=(window._localStorage||window.localStorage).getItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`)||Object.keys(this.props.schema.items)[0],Object.keys(this.props.schema.items).includes(t)||(t=Object.keys(this.props.schema.items)[0])),this.refDiv=I.createRef(),Object.assign(this.state,{tab:t,width:0,openMenu:null})}componentWillUnmount(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),window.removeEventListener("hashchange",this.onHashTabsChanged,!1),super.componentWillUnmount()}onHashTabsChanged=()=>{const e=(window.location.hash||"").replace(/^#/,"").split("/");if(e.length>3&&e[1]==="config"){const t=e[3],n=parseInt(t,10);let m;n.toString()===t?n>=0&&n<Object.keys(this.props.schema.items).length&&(m=Object.keys(this.props.schema.items)[n]):Object.keys(this.props.schema.items).includes(t)&&(m=t),m!==void 0&&m!==this.state.tab&&((window._localStorage||window.localStorage).setItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`,m),this.setState({tab:m}))}};getCurrentBreakpoint(){if(!this.state.width)return"md";if(!this.state.initialBreakpoint){let e;return this.state.width<600?e="xs":this.state.width<900?e="sm":this.state.width<1200?e="md":this.state.width<1536?e="lg":e="xl",setTimeout(()=>{this.setState({initialBreakpoint:e})},50),e}return this.state.initialBreakpoint}componentDidUpdate(){var e;!this.state.initialBreakpoint&&((e=this.refDiv.current)!=null&&e.clientWidth)&&this.refDiv.current.clientWidth!==this.state.width&&(this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{var t;this.resizeTimeout=null,this.setState({width:(t=this.refDiv.current)==null?void 0:t.clientWidth})},50))}onMenuChange(e){(window._localStorage||window.localStorage).setItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`,e),this.setState({tab:e},()=>{if(this.props.root){const t=(window.location.hash||"").split("/");t.length>=3&&t[1]==="config"&&(t[3]=this.state.tab,window.location.hash=t.join("/"))}})}render(){const e=this.props.schema.items;let t=!1;const n=[];Object.keys(e).map(a=>{let p;if(e[a].expertMode&&!this.props.expertMode)return;if(this.props.custom){if(this.executeCustom(e[a].hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData))return;p=this.executeCustom(e[a].disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData)}else{if(this.execute(e[a].hidden,!1,this.props.data,this.props.index,this.props.globalData))return;p=this.execute(e[a].disabled,!1,this.props.data,this.props.index,this.props.globalData)}const o=this.getIcon(e[a].icon);t=t||!!o,n.push({icon:o,disabled:p,label:this.getText(e[a].label),name:a})}),n.find(a=>a.name===this.state.tab)||setTimeout(()=>this.setState({tab:n[0].name}),50);const m=this.getCurrentBreakpoint();let i;return m==="xs"&&n.length>2?i=I.createElement(B.Toolbar,{style:{top:2,backgroundColor:this.props.oContext.themeType==="dark"?"#222":"#DDD"},variant:"dense"},I.createElement(B.IconButton,{onClick:a=>this.setState({openMenu:a.currentTarget})},I.createElement(oe.Menu,null)),this.state.openMenu?I.createElement(B.Menu,{open:!0,anchorEl:this.state.openMenu,onClose:()=>this.setState({openMenu:null})},n.map(a=>I.createElement(B.MenuItem,{disabled:a.disabled,key:a.name,onClick:()=>{this.setState({openMenu:null},()=>this.onMenuChange(a.name))},selected:a.name===this.state.tab},t?I.createElement(B.ListItemIcon,null,a.icon):null,a.label))):null):i=I.createElement(B.Tabs,{variant:"scrollable",scrollButtons:"auto",style:this.props.schema.tabsStyle,value:this.state.tab,onChange:(a,p)=>this.onMenuChange(p)},n.map(a=>I.createElement(B.Tab,{id:a.name,wrapped:!0,disabled:a.disabled,key:a.name,value:a.name,iconPosition:this.props.schema.iconPosition||"start",icon:a.icon,label:a.label}))),I.createElement("div",{style:Ei.tabs,ref:this.refDiv},i,I.createElement(wn,{oContext:this.props.oContext,withoutSaveButtons:this.props.withoutSaveButtons,isParentTab:!0,changed:this.props.changed,key:this.state.tab,expertMode:this.props.expertMode,index:1001,arrayIndex:this.props.arrayIndex,globalData:this.props.globalData,commandRunning:this.props.commandRunning,style:{...Ei.panel,...t?Ei.panelWithIcons:Ei.panelWithoutIcons},common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:this.props.data,originalData:this.props.originalData,onChange:this.props.onChange,onError:this.props.onError,customObj:this.props.customObj,custom:this.props.custom,schema:e[this.state.tab],table:this.props.table,withIcons:t}))}}const jv={root:{width:"100%",height:"100%"}};class Ti extends J.Component{forceUpdateHandlers;errorTimeout=null;errorCached=null;oContext;constructor(e){super(e),this.state={originalData:JSON.stringify(this.props.data),changed:!1,errors:{},updateData:this.props.updateData||0,systemConfig:null,alive:!1,commandRunning:!1,schema:JSON.parse(JSON.stringify(this.props.schema))},this.forceUpdateHandlers={},this.buildDependencies(this.state.schema),this.readData()}static getDerivedStateFromProps(e,t){return e.updateData!==t.updateData?{updateData:e.updateData,originalData:JSON.stringify(e.data),schema:JSON.parse(JSON.stringify(e.schema))}:null}static async loadI18n(e,t,n){if(t===!0||t&&typeof t=="string"){const m=G.I18n.getLanguage(),i=typeof t=="string"?t:"i18n";let a=await e.fileExists(`${n}.admin`,`${i}/${m}.json`),p;if(a?p=`${i}/${m}.json`:(a=await e.fileExists(`${n}.admin`,`${i}/${m}/translations.json`),a?p=`${i}/${m}/translations.json`:m!=="en"&&(a=await e.fileExists(`${n}.admin`,`${i}/en.json`),a?p=`${i}/en.json`:(a=await e.fileExists(`${n}.admin`,`${i}/en/translations.json`),a&&(p=`${i}/en/translations.json`)))),p){const o=await e.readFile(`${n}.admin`,p);let h;o.file!==void 0?h=o.file:h=o;try{const r=JSON.parse(h);G.I18n.extendTranslations(r,m)}catch(r){return console.error(`Cannot parse language file "${n}.admin/${p}: ${r}`),""}return p}return console.warn(`Cannot find i18n for ${n} / ${p}`),""}return t&&typeof t=="object"&&G.I18n.extendTranslations(t),""}onCommandRunning=e=>this.setState({commandRunning:e});readData(){this.props.socket.getCompactSystemConfig().then(e=>this.props.socket.getState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`).then(t=>this.setState({systemConfig:e.common,alive:!!(t&&t.val)},()=>{this.updateContext(!0),this.props.custom||this.props.socket.subscribeState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,this.onAlive)}))).catch(e=>console.error(`Cannot read system config: ${e}`))}onAlive=(e,t)=>{!!(t!=null&&t.val)!==this.state.alive&&this.setState({alive:!!(t!=null&&t.val)})};onChange=(e,t,n,m)=>{if(this.props.onValueChange)this.props.onValueChange(e,t,m),n&&n();else if(e&&this.props.onChange){const i={changed:JSON.stringify(e)!==this.state.originalData};this.setState(i,()=>{this.props.onChange(e,i.changed,m),n&&n()})}else m&&this.props.onChange(null,null,m)};onError=(e,t)=>{this.errorCached=this.errorCached||JSON.parse(JSON.stringify(this.state.errors));const n=this.errorCached;t?n[e]=t:delete n[e],this.errorTimeout&&clearTimeout(this.errorTimeout),JSON.stringify(n)!==JSON.stringify(this.state.errors)?this.errorTimeout=setTimeout(()=>this.setState({errors:this.errorCached},()=>{this.errorTimeout=null,this.errorCached=null,this.props.onError(!!Object.keys(this.state.errors).length)}),50):this.errorCached=null};flatten(e,t){return t=t||{},e.items&&Object.keys(e.items).forEach(n=>{t[n]=e.items[n],this.flatten(e.items[n],t)}),t}buildDependencies(e){const t=this.flatten(e);Object.keys(t).forEach(n=>{var m,i,a,p,o,h,r,s,l,u;(m=t[n].confirm)!=null&&m.alsoDependsOn&&((i=t[n].confirm)==null||i.alsoDependsOn.forEach(c=>{if(!t[c])console.error(`[JsonConfigComponent] Attribute ${c} does not exist!`),c.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${c.replace(/^data\./,"")}" instead of "${c}"`);else{t[c].confirmDependsOn=t[c].confirmDependsOn||[];const f={...t[n],attr:n};f.confirm&&(f.confirm.cancel="Undo"),t[c].confirmDependsOn.push(f)}})),(a=t[n].onChange)!=null&&a.alsoDependsOn&&((p=t[n].onChange)==null||p.alsoDependsOn.forEach(c=>{if(!t[c])console.error(`[JsonConfigComponent] Attribute ${c} does not exist!`),c.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${c.replace(/^data\./,"")}" instead of "${c}"`);else{t[c].onChangeDependsOn=t[c].onChangeDependsOn||[];const f={...t[n],attr:n};t[c].onChangeDependsOn.push(f)}})),(o=t[n].hidden)!=null&&o.alsoDependsOn&&((h=t[n].hidden)==null||h.alsoDependsOn.forEach(c=>{if(!t[c])console.error(`[JsonConfigComponent] Attribute ${c} does not exist!`),c.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${c.replace(/^data\./,"")}" instead of "${c}"`);else{t[c].hiddenDependsOn=t[c].hiddenDependsOn||[];const f={...t[n],attr:n};t[c].hiddenDependsOn.push(f)}})),(r=t[n].label)!=null&&r.alsoDependsOn&&((s=t[n].label)==null||s.alsoDependsOn.forEach(c=>{if(!t[c])console.error(`[JsonConfigComponent] Attribute ${c} does not exist!`),c.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${c.replace(/^data\./,"")}" instead of "${c}"`);else{t[c].labelDependsOn=t[c].labelDependsOn||[];const f={...t[n],attr:n};t[c].labelDependsOn.push(f)}})),(l=t[n].help)!=null&&l.alsoDependsOn&&((u=t[n].help)==null||u.alsoDependsOn.forEach(c=>{if(!t[c])console.error(`[JsonConfigComponent] Attribute ${c} does not exist!`),c.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${c.replace(/^data\./,"")}" instead of "${c}"`);else{t[c].helpDependsOn=t[c].helpDependsOn||[];const f={...t[n],attr:n};t[c].helpDependsOn.push(f)}}))})}updateContext(e){this.oContext={DeviceManager:this.props.DeviceManager,adapterName:this.props.adapterName,changeLanguage:this.changeLanguage,common:this.props.common,customs:this.props.customs,dateFormat:this.props.dateFormat,embedded:this.props.embedded,forceUpdate:this.forceAttrUpdate,imagePrefix:this.props.imagePrefix,instance:this.props.instance,instanceObj:this.props.instanceObj,isFloatComma:this.props.isFloatComma,multiEdit:this.props.multiEdit,onBackEndCommand:this.props.onBackEndCommand,onCommandRunning:this.onCommandRunning,onValueChange:this.props.onValueChange,registerOnForceUpdate:this.registerOnForceUpdate,socket:this.props.socket,systemConfig:this.state.systemConfig,theme:this.props.theme,themeType:this.props.themeType,_themeName:this.props.themeName,updateData:this.state.updateData},e&&this.forceUpdate()}renderItem(e){return e.type==="tabs"?I.createElement(Hv,{withoutSaveButtons:this.props.withoutSaveButtons,oContext:this.oContext,alive:this.state.alive,changed:this.state.changed,commandRunning:this.state.commandRunning,common:this.props.common,custom:this.props.custom,customObj:this.props.customObj,data:this.props.data,onChange:this.onChange,onError:(t,n)=>this.onError(t,n),originalData:JSON.parse(this.state.originalData),root:!0,schema:e,expertMode:this.props.expertMode,themeName:this.props.themeName}):e.type==="panel"||!e.type?I.createElement(wn,{withoutSaveButtons:this.props.withoutSaveButtons,oContext:this.oContext,alive:this.state.alive,changed:this.state.changed,commandRunning:this.state.commandRunning,common:this.props.common,custom:this.props.custom,customObj:this.props.customObj,data:this.props.data,expertMode:this.props.expertMode,index:1e3,isParentTab:!this.props.embedded&&!this.props.withoutSaveButtons,onChange:this.onChange,onError:(t,n)=>this.onError(t,n),originalData:JSON.parse(this.state.originalData),root:!0,schema:e,themeName:this.props.themeName}):(console.error(`Unknown item type in root: ${JSON.stringify(e)}`),null)}changeLanguage=()=>{this.forceUpdate()};forceAttrUpdate=(e,t)=>{Array.isArray(e)?e.forEach(n=>this.forceUpdateHandlers[n]&&this.forceUpdateHandlers[n](t)):this.forceUpdateHandlers[e]&&this.forceUpdateHandlers[e](t)};registerOnForceUpdate=(e,t)=>{t?this.forceUpdateHandlers[e]=t:this.forceUpdateHandlers[e]&&delete this.forceUpdateHandlers[e]};render(){return!this.state.systemConfig||!this.oContext?I.createElement(B.LinearProgress,null):(this.oContext._themeName!==this.props.themeName&&(this.oContext._themeName=this.props.themeName,setTimeout(()=>this.updateContext(!0),0)),I.createElement("div",{style:{...!this.props.embedded||this.props.withoutSaveButtons?jv.root:void 0,...this.props.style,...this.state.schema.style}},this.renderItem(this.state.schema)))}}const hn={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 zv(d,e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(d[n%d.length].charCodeAt(0)^e.charCodeAt(n));return t}function Uv(d,e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(d[n%d.length].charCodeAt(0)^e.charCodeAt(n));return t}function Gv(d,e){if(typeof e!="string")return e;if(!e.startsWith("$/aes-192-cbc:")||!/^[0-9a-f]{48}$/.test(d))return zv(d,e);const t=e.split(":",3),n=window.CryptoJS.enc.Hex.parse(d),m=window.CryptoJS.enc.Hex.parse(t[1]),i=window.CryptoJS.lib.CipherParams.create({ciphertext:window.CryptoJS.enc.Hex.parse(t[2])}),a=window.CryptoJS.AES.decrypt(i,n,{iv:m});return window.CryptoJS.enc.Utf8.stringify(a)}function Kv(d,e,t){if(typeof e!="string")return e;if(!/^[0-9a-f]{48}$/.test(d))return Uv(d,e);let n;n=window.CryptoJS.lib.WordArray.random(128/8);const m=window.CryptoJS.enc.Hex.parse(d),i=window.CryptoJS.AES.encrypt(e,m,{iv:n}).ciphertext;return`$/aes-192-cbc:${window.CryptoJS.enc.Hex.stringify(n)}:${i}`}function Xs(d,e){var t;return document.getElementById(e)?(t=document.getElementById(e))==null?void 0:t.onload:new Promise(n=>{const m=document.createElement("script");m.setAttribute("id",e),m.onload=n,m.src=d,document.getElementsByTagName("head")[0].appendChild(m)})}let Yv=class extends G.Router{fileSubscribed=[];fileLangSubscribed="";secret;constructor(e){super(e),this.state={updateData:0,changed:!1,confirmDialog:!1,theme:G.Theme(e.themeName),saveConfigDialog:!1,hash:"_"},this.secret=e.secret||"",this.getInstanceObject().then(t=>this.getConfigFile().then(n=>Ti.loadI18n(this.props.socket,n==null?void 0:n.i18n,this.props.adapterName).then(m=>{m&&(this.fileLangSubscribed||(this.fileLangSubscribed=m,this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,this.fileLangSubscribed,this.onFileChange))),t?this.setState({schema:n,data:t.native,common:t.common,hash:as(JSON.stringify(n)).toString()}):window.alert(`Instance system.adapter.${this.props.adapterName}.${this.props.instance} not found!`)})))}componentWillUnmount(){super.componentWillUnmount(),this.fileSubscribed.length&&(this.props.socket.unsubscribeFiles(`${this.props.adapterName}.admin`,this.fileSubscribed,this.onFileChange),this.fileSubscribed=[]),this.fileLangSubscribed&&(this.props.socket.unsubscribeFiles(`${this.props.adapterName}.admin`,this.fileLangSubscribed,this.onFileChange),this.fileLangSubscribed="")}handleFileSelect=e=>{const t=e.target.files[0];if(t){const n=new FileReader;n.onload=m=>{if(!m.target)return;const i=m.target.result;try{const a=JSON.parse(i);this.setState({data:a,changed:JSON.stringify(a)!==JSON.stringify(this.state.originalData)})}catch{window.alert(G.I18n.t("[JsonConfig] Failed to parse JSON file"))}},n.readAsText(t)}else window.alert(G.I18n.t("[JsonConfig] Failed to open JSON File"))};getExportImportButtons(){return I.createElement("div",{style:hn.exportImportButtons},I.createElement(B.Tooltip,{title:this.props.t("Import settings from JSON file"),slotProps:{popper:{sx:hn.tooltip}}},I.createElement(B.Fab,{size:"small",sx:{"&.MuiFab-root":hn.button},onClick:()=>{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("id","files"),e.setAttribute("opacity",0),e.addEventListener("change",t=>this.handleFileSelect(t),!1),e.click()}},I.createElement(oe.Publish,null))),I.createElement(B.Tooltip,{title:this.props.t("Export setting to JSON file"),slotProps:{popper:{sx:hn.tooltip}}},I.createElement(B.Fab,{size:"small",sx:{"&.MuiFab-root":hn.button},onClick:()=>{this.state.data&&G.Utils.generateFile(`${this.props.adapterName}.${this.props.instance}.json`,this.state.data)}},I.createElement(oe.Publish,{style:{transform:"rotate(180deg)"}}))))}onFileChange=async(e,t,n)=>{var m;if(e===`${this.props.adapterName}.admin`&&n){if(t===this.fileLangSubscribed)try{await Ti.loadI18n(this.props.socket,(m=this.state.schema)==null?void 0:m.i18n,this.props.adapterName),this.setState({hash:`${this.state.hash}1`})}catch{}else if(this.fileSubscribed.includes(t))try{const i=await this.getConfigFile(this.fileSubscribed[0]);this.setState({schema:i,hash:as(JSON.stringify(i)).toString()})}catch{}}};async getInstanceObject(){var e;try{const t=await this.props.socket.getObject(`system.adapter.${this.props.adapterName}.${this.props.instance}`);if(Array.isArray(t.encryptedNative)){if(!this.secret){const n=await this.props.socket.getSystemConfig();await Xs("../../lib/js/crypto-js/crypto-js.js","crypto-js"),this.secret=n.native.secret}return(e=t.encryptedNative)==null||e.forEach(n=>{t.native[n]&&(t.native[n]=Gv(this.secret,t.native[n]))}),t}return t}catch(t){window.alert(`[JsonConfig] Cannot read instance object: ${t}`)}return null}renderDialogConfirm(){return this.state.confirmDialog?I.createElement(G.DialogConfirm,{title:G.I18n.t("ra_Please confirm"),text:G.I18n.t("ra_Some data are not stored. Discard?"),ok:G.I18n.t("ra_Discard"),cancel:G.I18n.t("ra_Cancel"),onClose:e=>this.setState({confirmDialog:!1},()=>e&&G.Router.doNavigate(null))}):null}async scanForInclude(e,t){if(typeof e["#include"]=="string"){const m=await this._getConfigFile(e["#include"],[...t]);return delete e["#include"],m&&(e={...e,...m}),e}const n=Object.keys(e);for(let m=0;m<n.length;m++)e[n[m]]&&typeof e[n[m]]=="object"&&(e[n[m]]=await this.scanForInclude(e[n[m]],t));return e}async getConfigFile(e){return this._getConfigFile(e)}async _getConfigFile(e,t){if(e=e||"jsonConfig.json5",t=t||[],t.includes(e))return window.alert(`[JsonConfig] Circular reference in file: ${e} => ${t.join(" => ")}`),null;t.push(e);try{await this.props.socket.fileExists(`${this.props.adapterName}.admin`,e)||(e="jsonConfig.json");const m=await this.props.socket.readFile(`${this.props.adapterName}.admin`,e);let i="",a="";if(m.file!==void 0&&(a=m.file),typeof a=="string")i=a;else if(a.type==="Buffer"){let p="";const o=new Uint8Array(a.data),h=o.byteLength;for(let r=0;r<h;r++)p+=String.fromCharCode(o[r]);i=p}this.fileSubscribed.includes(e)||(this.fileSubscribed.push(e),await this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,e,this.onFileChange));try{return await this.scanForInclude(lo.parse(i),t)}catch(p){window.alert("[JsonConfig] Cannot parse json5 config!"),console.log(p)}}catch(n){this.state.schema||window.alert(`[JsonConfig] Cannot read file "${e}: ${n}`)}return null}renderSaveConfigDialog(){return this.state.saveConfigDialog?I.createElement(G.DialogConfirm,{title:G.I18n.t("ra_Please confirm"),text:G.I18n.t("Save configuration?"),ok:G.I18n.t("ra_Save"),cancel:G.I18n.t("ra_Cancel"),onClose:e=>this.setState({saveConfigDialog:!1},()=>e&&this.onSave(!0))}):null}findAttr(e,t){if(t=t||this.state.schema,t!=null&&t.items){if(e in t.items)return t.items[e];for(const n of Object.values(t.items)){const m=this.findAttr(e,n);if(m)return m}}return null}postProcessing(e,t,n){if(n=n||this.state.schema,!e){console.error(`Data is empty in postProcessing: ${t}, ${JSON.stringify(n)}`);return}const m=e[t];if(n.items)if(n.type==="table"){const i=m;if(!Array.isArray(i))return;for(const a of i)for(const p of n.items)this.postProcessing(a,p.attr,p)}else for(const[i,a]of Object.entries(n.items)){if(a.type==="panel"||a.type==="tabs"||a.type==="accordion")return;this.postProcessing(e,i,a)}else if(t&&typeof m=="string")if(n.type==="text")n.trim!==!1&&(e[t]=m.trim());else if(n.type==="ip")e[t]=m.trim();else if(n.type==="number"){const i=parseFloat(m.toString().replace(",","."));n.min!==void 0&&i<n.min?e[t]=n.min:n.max!==void 0&&i>n.max?e[t]=n.max:e[t]=i}else if(n.type==="port"){const i=parseInt(m.toString(),10);n.min!==void 0&&i<n.min?e[t]=n.min:n.max!==void 0&&i>n.max&&(e[t]=n.max),e[t]!==0&&i<20?e[t]=20:i>65535?e[t]=65535:e[t]=i}else n.type==="checkbox"&&(e[t]=e[t]===!0||e[t]==="true"||e[t]==="on"||e[t]===1||e[t]==="1")}async onSave(e,t){if(e){const n=await this.getInstanceObject();if(!n){console.error("Something went wrong: may be no connection?"),window.alert("Something went wrong: may be no connection?");return}if(!this.state.data||!this.state.schema)return;const m={};for(const a of Object.keys(this.state.data)){const p=this.findAttr(a);(!p||!p.doNotSave||p.type==="state")&&!a.startsWith("_")?X.setValue(n.native,a,this.state.data[a]):(X.setValue(n.native,a,null),m[a]=this.state.data[a])}try{const a=JSON.parse(JSON.stringify(n));if(Array.isArray(a.encryptedNative)){await Xs("../../lib/js/crypto-js/crypto-js.js","crypto-js");for(const p of a.encryptedNative)a.native[p]&&(a.native[p]=Kv(this.secret,a.native[p]))}await this.props.socket.setObject(a._id,a)}catch(a){window.alert(`[JsonConfig] Cannot set object: ${a}`)}const i={...n.native,...m};console.log(i),this.setState({changed:!1,data:i,updateData:this.state.updateData+1,originalData:i},()=>t&&G.Router.doNavigate(null))}else this.state.changed?this.setState({confirmDialog:!0}):G.Router.doNavigate(null)}componentDidUpdate(e,t){t.changed!==this.state.changed&&this.props.configStored(!this.state.changed)}async componentDidMount(){const e=`${window.location.protocol}//${window.location.host}${window.location.pathname}validate_config/${this.props.adapterName}`;console.log(`fetch ${e}`),await fetch(e)}render(){return!this.state.data||!this.state.schema?I.createElement(B.LinearProgress,null):I.createElement("div",{style:hn.root},this.renderDialogConfirm(),this.getExportImportButtons(),this.renderSaveConfigDialog(),I.createElement(Ti,{key:this.state.hash,style:hn.scroll,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,adapterName:this.props.adapterName,instance:this.props.instance,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat,schema:this.state.schema,common:this.state.common,expertMode:this.props.expertMode,data:this.state.data,updateData:this.state.updateData,onError:e=>this.setState({error:e}),onChange:(e,t,n)=>{n&&this.state.error&&(window.alert(G.I18n.t("Cannot save configuration because of error in configuration")),n=!1),n&&!this.state.changed&&!t&&(n=!1),e?this.setState({data:e,changed:t,saveConfigDialog:n}):n!==void 0&&this.setState({saveConfigDialog:n})},DeviceManager:this.props.DeviceManager,theme:this.state.theme}),I.createElement(G.SaveCloseButtons,{isIFrame:!1,dense:!0,paddingLeft:0,newReact:!0,theme:this.state.theme,noTextOnButtons:this.props.width==="xs"||this.props.width==="sm"||this.props.width==="md",changed:!!(this.state.error||this.state.changed),error:!!this.state.error,onSave:e=>this.onSave(!0,e),onClose:()=>this.onSave(!1)}))}};export{X as ConfigGeneric,wn as ConfigPanel,Yv as JsonConfig,Ti as JsonConfigComponent};
|