From 5d24717c47a063b5b30fdc1d00b7ca055cf3cbab Mon Sep 17 00:00:00 2001 From: thjaeckle Date: Fri, 17 May 2024 13:43:46 +0000 Subject: [PATCH] deploy: 4c32a5d0ecab13f36ebf2a0ac62e2b19c4c021de --- dist/main.js | 146 +- modules/connections/connections.ts | 12 +- modules/connections/connectionsMonitor.ts | 14 +- modules/environments/environments.ts | 6 +- modules/operations/piggyback.ts | 10 +- modules/operations/servicesLogging.ts | 6 +- modules/operations/templates.ts | 8 +- modules/policies/policies.ts | 4 +- modules/policies/policiesEntries.ts | 6 +- modules/policies/policiesImports.ts | 10 +- modules/policies/policiesResources.ts | 6 +- modules/policies/policiesSubjects.ts | 6 +- modules/things/attributes.ts | 2 +- modules/things/featureMessages.ts | 4 +- modules/things/features.ts | 2 +- modules/things/fields.ts | 8 +- modules/things/messagesIncoming.ts | 4 +- modules/things/searchFilter.ts | 8 +- modules/things/thingMessages.ts | 4 +- modules/things/thingsCRUD.ts | 2 +- modules/things/thingsSearch.ts | 30 +- modules/utils.ts | 45 +- modules/utils/tableFilter.ts | 4 +- node_modules/.package-lock.json | 5 + node_modules/dompurify/LICENSE | 568 ++++++ node_modules/dompurify/README.md | 433 +++++ node_modules/dompurify/dist/purify.cjs.js | 1611 ++++++++++++++++ node_modules/dompurify/dist/purify.cjs.js.map | 1 + node_modules/dompurify/dist/purify.es.mjs | 1609 ++++++++++++++++ node_modules/dompurify/dist/purify.es.mjs.map | 1 + node_modules/dompurify/dist/purify.js | 1617 +++++++++++++++++ node_modules/dompurify/dist/purify.js.map | 1 + node_modules/dompurify/dist/purify.min.js | 3 + node_modules/dompurify/dist/purify.min.js.map | 1 + node_modules/dompurify/package.json | 128 ++ package-lock.json | 6 + package.json | 1 + 37 files changed, 6154 insertions(+), 178 deletions(-) create mode 100644 node_modules/dompurify/LICENSE create mode 100644 node_modules/dompurify/README.md create mode 100644 node_modules/dompurify/dist/purify.cjs.js create mode 100644 node_modules/dompurify/dist/purify.cjs.js.map create mode 100644 node_modules/dompurify/dist/purify.es.mjs create mode 100644 node_modules/dompurify/dist/purify.es.mjs.map create mode 100644 node_modules/dompurify/dist/purify.js create mode 100644 node_modules/dompurify/dist/purify.js.map create mode 100644 node_modules/dompurify/dist/purify.min.js create mode 100644 node_modules/dompurify/dist/purify.min.js.map create mode 100644 node_modules/dompurify/package.json diff --git a/dist/main.js b/dist/main.js index cb791e2558..c8bbf206d6 100644 --- a/dist/main.js +++ b/dist/main.js @@ -1,11 +1,11 @@ -(()=>{var id=Object.create;var Po=Object.defineProperty;var rd=Object.getOwnPropertyDescriptor;var od=Object.getOwnPropertyNames;var sd=Object.getPrototypeOf,ad=Object.prototype.hasOwnProperty;var No=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ld=(t,e)=>{for(var c in e)Po(t,c,{get:e[c],enumerable:!0})},cd=(t,e,c,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of od(e))!ad.call(t,p)&&p!==c&&Po(t,p,{get:()=>e[p],enumerable:!(d=rd(e,p))||d.enumerable});return t};var Fo=(t,e,c)=>(c=t!=null?id(sd(t)):{},cd(e||!t||!t.__esModule?Po(c,"default",{value:t,enumerable:!0}):c,t));var zl=No((Ts,lo)=>{(function(t){"use strict";var e=t.setTimeout,c=t.clearTimeout,d=t.XMLHttpRequest,p=t.XDomainRequest,g=t.ActiveXObject,a=t.EventSource,u=t.document,o=t.Promise,r=t.fetch,n=t.Response,i=t.TextDecoder,s=t.TextEncoder,l=t.AbortController;if(typeof window<"u"&&typeof u<"u"&&!("readyState"in u)&&u.body==null&&(u.readyState="loading",window.addEventListener("load",function(B){u.readyState="complete"},!1)),d==null&&g!=null&&(d=function(){return new g("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(B){function K(){}return K.prototype=B,new K}),Date.now||(Date.now=function(){return new Date().getTime()}),l==null){var h=r;r=function(B,K){var ne=K.signal;return h(B,{headers:K.headers,credentials:K.credentials,cache:K.cache}).then(function(Q){var se=Q.body.getReader();return ne._reader=se,ne._aborted&&ne._reader.cancel(),{status:Q.status,statusText:Q.statusText,headers:Q.headers,body:{getReader:function(){return se}}}})},l=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function f(){this.bitsNeeded=0,this.codePoint=0}f.prototype.decode=function(B){function K(xe,W,G){if(G===1)return xe>=128>>W&&xe<=2048>>W&&xe<=57344>>W&&xe<=65536>>W&&xe<>6>15?3:W>31?2:1;if(xe===6*2)return W>15?3:2;if(xe===6*3)return 3;throw new Error}for(var Q=65533,se="",te=this.bitsNeeded,re=this.codePoint,Se=0;Se191||!K(re<<6|he&63,te-6,ne(te,re)))&&(te=0,re=Q,se+=String.fromCharCode(re)),te===0?(he>=0&&he<=127?(te=0,re=he):he>=192&&he<=223?(te=6*1,re=he&31):he>=224&&he<=239?(te=6*2,re=he&15):he>=240&&he<=247?(te=6*3,re=he&7):(te=0,re=Q),te!==0&&!K(re,te,ne(te,re))&&(te=0,re=Q)):(te-=6,re=re<<6|he&63),te===0&&(re<=65535?se+=String.fromCharCode(re):(se+=String.fromCharCode(55296+(re-65535-1>>10)),se+=String.fromCharCode(56320+(re-65535-1&1023))))}return this.bitsNeeded=te,this.codePoint=re,se};var b=function(){try{return new i().decode(new s().encode("test"),{stream:!0})==="test"}catch(B){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+B)}return!1};(i==null||s==null||!b())&&(i=f);var C=function(){};function w(B){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=C,this.onload=C,this.onerror=C,this.onreadystatechange=C,this._contentType="",this._xhr=B,this._sendTimeout=0,this._abort=C}w.prototype.open=function(B,K){this._abort(!0);var ne=this,Q=this._xhr,se=1,te=0;this._abort=function(G){ne._sendTimeout!==0&&(c(ne._sendTimeout),ne._sendTimeout=0),(se===1||se===2||se===3)&&(se=4,Q.onload=C,Q.onerror=C,Q.onabort=C,Q.onprogress=C,Q.onreadystatechange=C,Q.abort(),te!==0&&(c(te),te=0),G||(ne.readyState=4,ne.onabort(null),ne.onreadystatechange())),se=0};var re=function(){if(se===1){var G=0,q="",ue=void 0;if("contentType"in Q)G=200,q="OK",ue=Q.contentType;else try{G=Q.status,q=Q.statusText,ue=Q.getResponseHeader("Content-Type")}catch{G=0,q="",ue=void 0}G!==0&&(se=2,ne.readyState=2,ne.status=G,ne.statusText=q,ne._contentType=ue,ne.onreadystatechange())}},Se=function(){if(re(),se===2||se===3){se=3;var G="";try{G=Q.responseText}catch{}ne.readyState=3,ne.responseText=G,ne.onprogress()}},he=function(G,q){if((q==null||q.preventDefault==null)&&(q={preventDefault:C}),Se(),se===1||se===2||se===3){if(se=4,te!==0&&(c(te),te=0),ne.readyState=4,G==="load")ne.onload(q);else if(G==="error")ne.onerror(q);else if(G==="abort")ne.onabort(q);else throw new TypeError;ne.onreadystatechange()}},xe=function(G){Q!=null&&(Q.readyState===4?(!("onload"in Q)||!("onerror"in Q)||!("onabort"in Q))&&he(Q.responseText===""?"error":"load",G):Q.readyState===3?"onprogress"in Q||Se():Q.readyState===2&&re())},W=function(){te=e(function(){W()},500),Q.readyState===3&&Se()};"onload"in Q&&(Q.onload=function(G){he("load",G)}),"onerror"in Q&&(Q.onerror=function(G){he("error",G)}),"onabort"in Q&&(Q.onabort=function(G){he("abort",G)}),"onprogress"in Q&&(Q.onprogress=Se),"onreadystatechange"in Q&&(Q.onreadystatechange=function(G){xe(G)}),("contentType"in Q||!("ontimeout"in d.prototype))&&(K+=(K.indexOf("?")===-1?"?":"&")+"padding=true"),Q.open(B,K,!0),"readyState"in Q&&(te=e(function(){W()},0))},w.prototype.abort=function(){this._abort(!1)},w.prototype.getResponseHeader=function(B){return this._contentType},w.prototype.setRequestHeader=function(B,K){var ne=this._xhr;"setRequestHeader"in ne&&ne.setRequestHeader(B,K)},w.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},w.prototype.send=function(){if((!("ontimeout"in d.prototype)||!("sendAsBinary"in d.prototype)&&!("mozAnon"in d.prototype))&&u!=null&&u.readyState!=null&&u.readyState!=="complete"){var B=this;B._sendTimeout=e(function(){B._sendTimeout=0,B.send()},4);return}var K=this._xhr;"withCredentials"in K&&(K.withCredentials=this.withCredentials);try{K.send(void 0)}catch(ne){throw ne}};function x(B){return B.replace(/[A-Z]/g,function(K){return String.fromCharCode(K.charCodeAt(0)+32)})}function A(B){for(var K=Object.create(null),ne=B.split(`\r -`),Q=0;Q"u"?typeof window<"u"?window:typeof self<"u"?self:Ts:globalThis)});var Gl=No((_s,As)=>{var Ss,co;Ss=_s,co=function(){"use strict";function t(_,k){var I=Object.keys(_);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(_);k&&(R=R.filter(function(D){return Object.getOwnPropertyDescriptor(_,D).enumerable})),I.push.apply(I,R)}return I}function e(_){for(var k=1;k_.length)&&(k=_.length);for(var I=0,R=new Array(k);I=j.length?{done:!0}:{done:!1,value:j[X++]}},e:function(de){throw de},f:ee}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Z,pe=!0,ve=!1;return{s:function(){z=z.call(j)},n:function(){var de=z.next();return pe=de.done,de},e:function(de){ve=!0,Z=de},f:function(){try{pe||z.return==null||z.return()}finally{if(ve)throw Z}}}}(I.keys);try{for(U.s();!(F=U.n()).done;)H(F.value)}catch(j){U.e(j)}finally{U.f()}}else H()}),I.filter&&(D=I.filter(D));var O=D.slice(0,k.resultsList.maxResults);k.feedback={query:_,matches:D,results:O},i("results",k)},f="aria-expanded",b="aria-activedescendant",C="aria-selected",w=function(_,k){_.feedback.selection=e({index:k},_.feedback.results[k])},x=function(_){_.isOpen||((_.wrapper||_.input).setAttribute(f,!0),_.list.removeAttribute("hidden"),_.isOpen=!0,i("open",_))},A=function(_){_.isOpen&&((_.wrapper||_.input).setAttribute(f,!1),_.input.setAttribute(b,""),_.list.setAttribute("hidden",""),_.isOpen=!1,i("close",_))},v=function(_,k){var I=k.resultItem,R=k.list.getElementsByTagName(I.tag),D=!!I.selected&&I.selected.split(" ");if(k.isOpen&&R.length){var O,N,P=k.cursor;_>=R.length&&(_=0),_<0&&(_=R.length-1),k.cursor=_,P>-1&&(R[P].removeAttribute(C),D&&(N=R[P].classList).remove.apply(N,p(D))),R[_].setAttribute(C,!0),D&&(O=R[_].classList).add.apply(O,p(D)),k.input.setAttribute(b,R[k.cursor].id),k.list.scrollTop=R[_].offsetTop-k.list.clientHeight+R[_].clientHeight+5,k.feedback.cursor=k.cursor,w(k,_),i("navigate",k)}},E=function(_){v(_.cursor+1,_)},$=function(_){v(_.cursor-1,_)},M=function(_,k,I){(I=I>=0?I:_.cursor)<0||(_.feedback.event=k,w(_,I),i("selection",_),A(_))};function S(_,k){var I=this;return new Promise(function(R,D){var O,N;return O=k||((N=_.input)instanceof HTMLInputElement||N instanceof HTMLTextAreaElement?N.value:N.innerHTML),function(H,F,U){return F?F(H):H.length>=U}(O=_.query?_.query(O):O,_.trigger,_.threshold)?l(_,O).then(function(H){try{return _.feedback instanceof Error?R():(h(O,_),_.resultsList&&function(F){var U=F.resultsList,j=F.list,J=F.resultItem,z=F.feedback,X=z.matches,ee=z.results;if(F.cursor=-1,j.innerHTML="",X.length||U.noResults){var Z=new DocumentFragment;ee.forEach(function(pe,ve){var de=o(J.tag,e({id:"".concat(J.id,"_").concat(ve),role:"option",innerHTML:pe.match,inside:Z},J.class&&{class:J.class}));J.element&&J.element(de,pe)}),j.append(Z),U.element&&U.element(j,z),x(F)}else A(F)}(_),P.call(I))}catch(F){return D(F)}},D):(A(_),P.call(I));function P(){return R()}})}var T=function(_,k){for(var I in _)for(var R in _[I])k(I,R)},y=function(_){var k,I,R,D=_.events,O=(k=function(){return S(_)},I=_.debounce,function(){clearTimeout(R),R=setTimeout(function(){return k()},I)}),N=_.events=e({input:e({},D&&D.input)},_.resultsList&&{list:D?e({},D.list):{}}),P={input:{input:function(){O()},keydown:function(H){(function(F,U){switch(F.keyCode){case 40:case 38:F.preventDefault(),F.keyCode===40?E(U):$(U);break;case 13:U.submit||F.preventDefault(),U.cursor>=0&&M(U,F);break;case 9:U.resultsList.tabSelect&&U.cursor>=0&&M(U,F);break;case 27:U.input.value="",A(U)}})(H,_)},blur:function(){A(_)}},list:{mousedown:function(H){H.preventDefault()},click:function(H){(function(F,U){var j=U.resultItem.tag.toUpperCase(),J=Array.from(U.list.querySelectorAll(j)),z=F.target.closest(j);z&&z.nodeName===j&&M(U,F,J.indexOf(z))})(H,_)}}};T(P,function(H,F){(_.resultsList||F==="input")&&(N[H][F]||(N[H][F]=P[H][F]))}),T(N,function(H,F){_[H].addEventListener(F,N[H][F])})};function m(_){var k=this;return new Promise(function(I,R){var D,O,N;if(D=_.placeHolder,N={role:"combobox","aria-owns":(O=_.resultsList).id,"aria-haspopup":!0,"aria-expanded":!1},o(_.input,e(e({"aria-controls":O.id,"aria-autocomplete":"both"},D&&{placeholder:D}),!_.wrapper&&e({},N))),_.wrapper&&(_.wrapper=o("div",e({around:_.input,class:_.name+"_wrapper"},N))),O&&(_.list=o(O.tag,e({dest:[O.destination,O.position],id:O.id,role:"listbox",hidden:"hidden"},O.class&&{class:O.class}))),y(_),_.data.cache)return l(_).then(function(H){try{return P.call(k)}catch(F){return R(F)}},R);function P(){return i("init",_),I()}return P.call(k)})}function L(_){var k=_.prototype;k.init=function(){m(this)},k.start=function(I){S(this,I)},k.unInit=function(){if(this.wrapper){var I=this.wrapper.parentNode;I.insertBefore(this.input,this.wrapper),I.removeChild(this.wrapper)}var R;T((R=this).events,function(D,O){R[D].removeEventListener(O,R.events[D][O])})},k.open=function(){x(this)},k.close=function(){A(this)},k.goTo=function(I){v(I,this)},k.next=function(){E(this)},k.previous=function(){$(this)},k.select=function(I){M(this,null,I)},k.search=function(I,R,D){return s(I,R,D)}}return function _(k){this.options=k,this.id=_.instances=(_.instances||0)+1,this.name="autoComplete",this.wrapper=1,this.threshold=1,this.debounce=0,this.resultsList={position:"afterend",tag:"ul",maxResults:5},this.resultItem={tag:"li"},function(I){var R=I.name,D=I.options,O=I.resultsList,N=I.resultItem;for(var P in D)if(c(D[P])==="object")for(var H in I[P]||(I[P]={}),D[P])I[P][H]=D[P][H];else I[P]=D[P];I.selector=I.selector||"#"+R,O.destination=O.destination||I.selector,O.id=O.id||R+"_list_"+I.id,N.id=N.id||R+"_result",I.input=u(I.selector)}(this),L.call(this,_),m(this)}},typeof _s=="object"&&typeof As<"u"?As.exports=co():typeof define=="function"&&define.amd?define(co):(Ss=typeof globalThis<"u"?globalThis:Ss||self).autoComplete=co()});var Yl=No((Kl,uo)=>{(function(){var t="ace",e=function(){return this}();if(!e&&typeof window<"u"&&(e=window),!t&&typeof requirejs<"u")return;var c=function(o,r,n){if(typeof o!="string"){c.original?c.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(n=r),c.modules[o]||(c.payloads[o]=n,c.modules[o]=null)};c.modules={},c.payloads={};var d=function(o,r,n){if(typeof r=="string"){var i=a(o,r);if(i!=null)return n&&n(),i}else if(Object.prototype.toString.call(r)==="[object Array]"){for(var s=[],l=0,h=r.length;la.length)&&(g=a.length),g-=p.length;var u=a.indexOf(p,g);return u!==-1&&u===g}),String.prototype.repeat||d(String.prototype,"repeat",function(p){for(var g="",a=this;p>0;)p&1&&(g+=a),(p>>=1)&&(a+=a);return g}),String.prototype.includes||d(String.prototype,"includes",function(p,g){return this.indexOf(p,g)!=-1}),Object.assign||(Object.assign=function(p){if(p==null)throw new TypeError("Cannot convert undefined or null to object");for(var g=Object(p),a=1;a>>0,u=arguments[1],o=u>>0,r=o<0?Math.max(a+o,0):Math.min(o,a),n=arguments[2],i=n===void 0?a:n>>0,s=i<0?Math.max(a+i,0):Math.min(i,a);r0;)a&1&&(u+=g),(a>>=1)&&(g+=g);return u};var d=/^\s\s*/,p=/\s\s*$/;e.stringTrimLeft=function(g){return g.replace(d,"")},e.stringTrimRight=function(g){return g.replace(p,"")},e.copyObject=function(g){var a={};for(var u in g)a[u]=g[u];return a},e.copyArray=function(g){for(var a=[],u=0,o=g.length;u65535?2:1}});ace.define("ace/lib/useragent",["require","exports","module"],function(t,e,c){"use strict";e.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},e.getOS=function(){return e.isMac?e.OS.MAC:e.isLinux?e.OS.LINUX:e.OS.WINDOWS};var d=typeof navigator=="object"?navigator:{},p=(/mac|win|linux/i.exec(d.platform)||["other"])[0].toLowerCase(),g=d.userAgent||"",a=d.appName||"";e.isWin=p=="win",e.isMac=p=="mac",e.isLinux=p=="linux",e.isIE=a=="Microsoft Internet Explorer"||a.indexOf("MSAppHost")>=0?parseFloat((g.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((g.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),e.isOldIE=e.isIE&&e.isIE<9,e.isGecko=e.isMozilla=g.match(/ Gecko\/\d+/),e.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",e.isWebKit=parseFloat(g.split("WebKit/")[1])||void 0,e.isChrome=parseFloat(g.split(" Chrome/")[1])||void 0,e.isSafari=parseFloat(g.split(" Safari/")[1])&&!e.isChrome||void 0,e.isEdge=parseFloat(g.split(" Edge/")[1])||void 0,e.isAIR=g.indexOf("AdobeAIR")>=0,e.isAndroid=g.indexOf("Android")>=0,e.isChromeOS=g.indexOf(" CrOS ")>=0,e.isIOS=/iPad|iPhone|iPod/.test(g)&&!window.MSStream,e.isIOS&&(e.isMac=!0),e.isMobile=e.isIOS||e.isAndroid});ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(t,e,c){"use strict";var d=t("./useragent"),p="http://www.w3.org/1999/xhtml";e.buildDom=function n(i,s,l){if(typeof i=="string"&&i){var h=document.createTextNode(i);return s&&s.appendChild(h),h}if(!Array.isArray(i))return i&&i.appendChild&&s&&s.appendChild(i),i;if(typeof i[0]!="string"||!i[0]){for(var f=[],b=0;b"u")){if(a){if(s)u();else if(s===!1)return a.push([n,i])}if(!g){var l=s;!s||!s.getRootNode?l=document:(l=s.getRootNode(),(!l||l==s)&&(l=document));var h=l.ownerDocument||l;if(i&&e.hasCssString(i,l))return null;i&&(n+=` +(()=>{var Dh=Object.create;var ks=Object.defineProperty;var Ph=Object.getOwnPropertyDescriptor;var Nh=Object.getOwnPropertyNames;var Fh=Object.getPrototypeOf,Hh=Object.prototype.hasOwnProperty;var _o=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Bh=(t,e)=>{for(var c in e)ks(t,c,{get:e[c],enumerable:!0})},Uh=(t,e,c,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of Nh(e))!Hh.call(t,p)&&p!==c&&ks(t,p,{get:()=>e[p],enumerable:!(d=Ph(e,p))||d.enumerable});return t};var Ao=(t,e,c)=>(c=t!=null?Dh(Fh(t)):{},Uh(e||!t||!t.__esModule?ks(c,"default",{value:t,enumerable:!0}):c,t));var pu=_o((ma,Xo)=>{(function(t){"use strict";var e=t.setTimeout,c=t.clearTimeout,d=t.XMLHttpRequest,p=t.XDomainRequest,g=t.ActiveXObject,a=t.EventSource,u=t.document,o=t.Promise,r=t.fetch,n=t.Response,i=t.TextDecoder,s=t.TextEncoder,l=t.AbortController;if(typeof window<"u"&&typeof u<"u"&&!("readyState"in u)&&u.body==null&&(u.readyState="loading",window.addEventListener("load",function(U){u.readyState="complete"},!1)),d==null&&g!=null&&(d=function(){return new g("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(U){function Y(){}return Y.prototype=U,new Y}),Date.now||(Date.now=function(){return new Date().getTime()}),l==null){var h=r;r=function(U,Y){var ae=Y.signal;return h(U,{headers:Y.headers,credentials:Y.credentials,cache:Y.cache}).then(function(te){var de=te.body.getReader();return ae._reader=de,ae._aborted&&ae._reader.cancel(),{status:te.status,statusText:te.statusText,headers:te.headers,body:{getReader:function(){return de}}}})},l=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function f(){this.bitsNeeded=0,this.codePoint=0}f.prototype.decode=function(U){function Y(le,W,G){if(G===1)return le>=128>>W&&le<=2048>>W&&le<=57344>>W&&le<=65536>>W&&le<>6>15?3:W>31?2:1;if(le===6*2)return W>15?3:2;if(le===6*3)return 3;throw new Error}for(var te=65533,de="",se=this.bitsNeeded,Q=this.codePoint,ee=0;ee191||!Y(Q<<6|re&63,se-6,ae(se,Q)))&&(se=0,Q=te,de+=String.fromCharCode(Q)),se===0?(re>=0&&re<=127?(se=0,Q=re):re>=192&&re<=223?(se=6*1,Q=re&31):re>=224&&re<=239?(se=6*2,Q=re&15):re>=240&&re<=247?(se=6*3,Q=re&7):(se=0,Q=te),se!==0&&!Y(Q,se,ae(se,Q))&&(se=0,Q=te)):(se-=6,Q=Q<<6|re&63),se===0&&(Q<=65535?de+=String.fromCharCode(Q):(de+=String.fromCharCode(55296+(Q-65535-1>>10)),de+=String.fromCharCode(56320+(Q-65535-1&1023))))}return this.bitsNeeded=se,this.codePoint=Q,de};var b=function(){try{return new i().decode(new s().encode("test"),{stream:!0})==="test"}catch(U){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+U)}return!1};(i==null||s==null||!b())&&(i=f);var C=function(){};function w(U){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=C,this.onload=C,this.onerror=C,this.onreadystatechange=C,this._contentType="",this._xhr=U,this._sendTimeout=0,this._abort=C}w.prototype.open=function(U,Y){this._abort(!0);var ae=this,te=this._xhr,de=1,se=0;this._abort=function(G){ae._sendTimeout!==0&&(c(ae._sendTimeout),ae._sendTimeout=0),(de===1||de===2||de===3)&&(de=4,te.onload=C,te.onerror=C,te.onabort=C,te.onprogress=C,te.onreadystatechange=C,te.abort(),se!==0&&(c(se),se=0),G||(ae.readyState=4,ae.onabort(null),ae.onreadystatechange())),de=0};var Q=function(){if(de===1){var G=0,ne="",me=void 0;if("contentType"in te)G=200,ne="OK",me=te.contentType;else try{G=te.status,ne=te.statusText,me=te.getResponseHeader("Content-Type")}catch{G=0,ne="",me=void 0}G!==0&&(de=2,ae.readyState=2,ae.status=G,ae.statusText=ne,ae._contentType=me,ae.onreadystatechange())}},ee=function(){if(Q(),de===2||de===3){de=3;var G="";try{G=te.responseText}catch{}ae.readyState=3,ae.responseText=G,ae.onprogress()}},re=function(G,ne){if((ne==null||ne.preventDefault==null)&&(ne={preventDefault:C}),ee(),de===1||de===2||de===3){if(de=4,se!==0&&(c(se),se=0),ae.readyState=4,G==="load")ae.onload(ne);else if(G==="error")ae.onerror(ne);else if(G==="abort")ae.onabort(ne);else throw new TypeError;ae.onreadystatechange()}},le=function(G){te!=null&&(te.readyState===4?(!("onload"in te)||!("onerror"in te)||!("onabort"in te))&&re(te.responseText===""?"error":"load",G):te.readyState===3?"onprogress"in te||ee():te.readyState===2&&Q())},W=function(){se=e(function(){W()},500),te.readyState===3&&ee()};"onload"in te&&(te.onload=function(G){re("load",G)}),"onerror"in te&&(te.onerror=function(G){re("error",G)}),"onabort"in te&&(te.onabort=function(G){re("abort",G)}),"onprogress"in te&&(te.onprogress=ee),"onreadystatechange"in te&&(te.onreadystatechange=function(G){le(G)}),("contentType"in te||!("ontimeout"in d.prototype))&&(Y+=(Y.indexOf("?")===-1?"?":"&")+"padding=true"),te.open(U,Y,!0),"readyState"in te&&(se=e(function(){W()},0))},w.prototype.abort=function(){this._abort(!1)},w.prototype.getResponseHeader=function(U){return this._contentType},w.prototype.setRequestHeader=function(U,Y){var ae=this._xhr;"setRequestHeader"in ae&&ae.setRequestHeader(U,Y)},w.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},w.prototype.send=function(){if((!("ontimeout"in d.prototype)||!("sendAsBinary"in d.prototype)&&!("mozAnon"in d.prototype))&&u!=null&&u.readyState!=null&&u.readyState!=="complete"){var U=this;U._sendTimeout=e(function(){U._sendTimeout=0,U.send()},4);return}var Y=this._xhr;"withCredentials"in Y&&(Y.withCredentials=this.withCredentials);try{Y.send(void 0)}catch(ae){throw ae}};function x(U){return U.replace(/[A-Z]/g,function(Y){return String.fromCharCode(Y.charCodeAt(0)+32)})}function _(U){for(var Y=Object.create(null),ae=U.split(`\r +`),te=0;te"u"?typeof window<"u"?window:typeof self<"u"?self:ma:globalThis)});var gu=_o((ba,ya)=>{var va,Qo;va=ba,Qo=function(){"use strict";function t(A,k){var R=Object.keys(A);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(A);k&&(I=I.filter(function(D){return Object.getOwnPropertyDescriptor(A,D).enumerable})),R.push.apply(R,I)}return R}function e(A){for(var k=1;kA.length)&&(k=A.length);for(var R=0,I=new Array(k);R=z.length?{done:!0}:{done:!1,value:z[q++]}},e:function(be){throw be},f:oe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ie,ye=!0,Ee=!1;return{s:function(){K=K.call(z)},n:function(){var be=K.next();return ye=be.done,be},e:function(be){Ee=!0,ie=be},f:function(){try{ye||K.return==null||K.return()}finally{if(Ee)throw ie}}}}(R.keys);try{for(V.s();!(H=V.n()).done;)B(H.value)}catch(z){V.e(z)}finally{V.f()}}else B()}),R.filter&&(D=R.filter(D));var O=D.slice(0,k.resultsList.maxResults);k.feedback={query:A,matches:D,results:O},i("results",k)},f="aria-expanded",b="aria-activedescendant",C="aria-selected",w=function(A,k){A.feedback.selection=e({index:k},A.feedback.results[k])},x=function(A){A.isOpen||((A.wrapper||A.input).setAttribute(f,!0),A.list.removeAttribute("hidden"),A.isOpen=!0,i("open",A))},_=function(A){A.isOpen&&((A.wrapper||A.input).setAttribute(f,!1),A.input.setAttribute(b,""),A.list.setAttribute("hidden",""),A.isOpen=!1,i("close",A))},v=function(A,k){var R=k.resultItem,I=k.list.getElementsByTagName(R.tag),D=!!R.selected&&R.selected.split(" ");if(k.isOpen&&I.length){var O,N,P=k.cursor;A>=I.length&&(A=0),A<0&&(A=I.length-1),k.cursor=A,P>-1&&(I[P].removeAttribute(C),D&&(N=I[P].classList).remove.apply(N,p(D))),I[A].setAttribute(C,!0),D&&(O=I[A].classList).add.apply(O,p(D)),k.input.setAttribute(b,I[k.cursor].id),k.list.scrollTop=I[A].offsetTop-k.list.clientHeight+I[A].clientHeight+5,k.feedback.cursor=k.cursor,w(k,A),i("navigate",k)}},T=function(A){v(A.cursor+1,A)},L=function(A){v(A.cursor-1,A)},M=function(A,k,R){(R=R>=0?R:A.cursor)<0||(A.feedback.event=k,w(A,R),i("selection",A),_(A))};function E(A,k){var R=this;return new Promise(function(I,D){var O,N;return O=k||((N=A.input)instanceof HTMLInputElement||N instanceof HTMLTextAreaElement?N.value:N.innerHTML),function(B,H,V){return H?H(B):B.length>=V}(O=A.query?A.query(O):O,A.trigger,A.threshold)?l(A,O).then(function(B){try{return A.feedback instanceof Error?I():(h(O,A),A.resultsList&&function(H){var V=H.resultsList,z=H.list,Z=H.resultItem,K=H.feedback,q=K.matches,oe=K.results;if(H.cursor=-1,z.innerHTML="",q.length||V.noResults){var ie=new DocumentFragment;oe.forEach(function(ye,Ee){var be=o(Z.tag,e({id:"".concat(Z.id,"_").concat(Ee),role:"option",innerHTML:ye.match,inside:ie},Z.class&&{class:Z.class}));Z.element&&Z.element(be,ye)}),z.append(ie),V.element&&V.element(z,K),x(H)}else _(H)}(A),P.call(R))}catch(H){return D(H)}},D):(_(A),P.call(R));function P(){return I()}})}var S=function(A,k){for(var R in A)for(var I in A[R])k(R,I)},y=function(A){var k,R,I,D=A.events,O=(k=function(){return E(A)},R=A.debounce,function(){clearTimeout(I),I=setTimeout(function(){return k()},R)}),N=A.events=e({input:e({},D&&D.input)},A.resultsList&&{list:D?e({},D.list):{}}),P={input:{input:function(){O()},keydown:function(B){(function(H,V){switch(H.keyCode){case 40:case 38:H.preventDefault(),H.keyCode===40?T(V):L(V);break;case 13:V.submit||H.preventDefault(),V.cursor>=0&&M(V,H);break;case 9:V.resultsList.tabSelect&&V.cursor>=0&&M(V,H);break;case 27:V.input.value="",_(V)}})(B,A)},blur:function(){_(A)}},list:{mousedown:function(B){B.preventDefault()},click:function(B){(function(H,V){var z=V.resultItem.tag.toUpperCase(),Z=Array.from(V.list.querySelectorAll(z)),K=H.target.closest(z);K&&K.nodeName===z&&M(V,H,Z.indexOf(K))})(B,A)}}};S(P,function(B,H){(A.resultsList||H==="input")&&(N[B][H]||(N[B][H]=P[B][H]))}),S(N,function(B,H){A[B].addEventListener(H,N[B][H])})};function m(A){var k=this;return new Promise(function(R,I){var D,O,N;if(D=A.placeHolder,N={role:"combobox","aria-owns":(O=A.resultsList).id,"aria-haspopup":!0,"aria-expanded":!1},o(A.input,e(e({"aria-controls":O.id,"aria-autocomplete":"both"},D&&{placeholder:D}),!A.wrapper&&e({},N))),A.wrapper&&(A.wrapper=o("div",e({around:A.input,class:A.name+"_wrapper"},N))),O&&(A.list=o(O.tag,e({dest:[O.destination,O.position],id:O.id,role:"listbox",hidden:"hidden"},O.class&&{class:O.class}))),y(A),A.data.cache)return l(A).then(function(B){try{return P.call(k)}catch(H){return I(H)}},I);function P(){return i("init",A),R()}return P.call(k)})}function $(A){var k=A.prototype;k.init=function(){m(this)},k.start=function(R){E(this,R)},k.unInit=function(){if(this.wrapper){var R=this.wrapper.parentNode;R.insertBefore(this.input,this.wrapper),R.removeChild(this.wrapper)}var I;S((I=this).events,function(D,O){I[D].removeEventListener(O,I.events[D][O])})},k.open=function(){x(this)},k.close=function(){_(this)},k.goTo=function(R){v(R,this)},k.next=function(){T(this)},k.previous=function(){L(this)},k.select=function(R){M(this,null,R)},k.search=function(R,I,D){return s(R,I,D)}}return function A(k){this.options=k,this.id=A.instances=(A.instances||0)+1,this.name="autoComplete",this.wrapper=1,this.threshold=1,this.debounce=0,this.resultsList={position:"afterend",tag:"ul",maxResults:5},this.resultItem={tag:"li"},function(R){var I=R.name,D=R.options,O=R.resultsList,N=R.resultItem;for(var P in D)if(c(D[P])==="object")for(var B in R[P]||(R[P]={}),D[P])R[P][B]=D[P][B];else R[P]=D[P];R.selector=R.selector||"#"+I,O.destination=O.destination||R.selector,O.id=O.id||I+"_list_"+R.id,N.id=N.id||I+"_result",R.input=u(R.selector)}(this),$.call(this,A),m(this)}},typeof ba=="object"&&typeof ya<"u"?ya.exports=Qo():typeof define=="function"&&define.amd?define(Qo):(va=typeof globalThis<"u"?globalThis:va||self).autoComplete=Qo()});var vu=_o((mu,Zo)=>{(function(){var t="ace",e=function(){return this}();if(!e&&typeof window<"u"&&(e=window),!t&&typeof requirejs<"u")return;var c=function(o,r,n){if(typeof o!="string"){c.original?c.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(n=r),c.modules[o]||(c.payloads[o]=n,c.modules[o]=null)};c.modules={},c.payloads={};var d=function(o,r,n){if(typeof r=="string"){var i=a(o,r);if(i!=null)return n&&n(),i}else if(Object.prototype.toString.call(r)==="[object Array]"){for(var s=[],l=0,h=r.length;la.length)&&(g=a.length),g-=p.length;var u=a.indexOf(p,g);return u!==-1&&u===g}),String.prototype.repeat||d(String.prototype,"repeat",function(p){for(var g="",a=this;p>0;)p&1&&(g+=a),(p>>=1)&&(a+=a);return g}),String.prototype.includes||d(String.prototype,"includes",function(p,g){return this.indexOf(p,g)!=-1}),Object.assign||(Object.assign=function(p){if(p==null)throw new TypeError("Cannot convert undefined or null to object");for(var g=Object(p),a=1;a>>0,u=arguments[1],o=u>>0,r=o<0?Math.max(a+o,0):Math.min(o,a),n=arguments[2],i=n===void 0?a:n>>0,s=i<0?Math.max(a+i,0):Math.min(i,a);r0;)a&1&&(u+=g),(a>>=1)&&(g+=g);return u};var d=/^\s\s*/,p=/\s\s*$/;e.stringTrimLeft=function(g){return g.replace(d,"")},e.stringTrimRight=function(g){return g.replace(p,"")},e.copyObject=function(g){var a={};for(var u in g)a[u]=g[u];return a},e.copyArray=function(g){for(var a=[],u=0,o=g.length;u65535?2:1}});ace.define("ace/lib/useragent",["require","exports","module"],function(t,e,c){"use strict";e.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},e.getOS=function(){return e.isMac?e.OS.MAC:e.isLinux?e.OS.LINUX:e.OS.WINDOWS};var d=typeof navigator=="object"?navigator:{},p=(/mac|win|linux/i.exec(d.platform)||["other"])[0].toLowerCase(),g=d.userAgent||"",a=d.appName||"";e.isWin=p=="win",e.isMac=p=="mac",e.isLinux=p=="linux",e.isIE=a=="Microsoft Internet Explorer"||a.indexOf("MSAppHost")>=0?parseFloat((g.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((g.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),e.isOldIE=e.isIE&&e.isIE<9,e.isGecko=e.isMozilla=g.match(/ Gecko\/\d+/),e.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",e.isWebKit=parseFloat(g.split("WebKit/")[1])||void 0,e.isChrome=parseFloat(g.split(" Chrome/")[1])||void 0,e.isSafari=parseFloat(g.split(" Safari/")[1])&&!e.isChrome||void 0,e.isEdge=parseFloat(g.split(" Edge/")[1])||void 0,e.isAIR=g.indexOf("AdobeAIR")>=0,e.isAndroid=g.indexOf("Android")>=0,e.isChromeOS=g.indexOf(" CrOS ")>=0,e.isIOS=/iPad|iPhone|iPod/.test(g)&&!window.MSStream,e.isIOS&&(e.isMac=!0),e.isMobile=e.isIOS||e.isAndroid});ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(t,e,c){"use strict";var d=t("./useragent"),p="http://www.w3.org/1999/xhtml";e.buildDom=function n(i,s,l){if(typeof i=="string"&&i){var h=document.createTextNode(i);return s&&s.appendChild(h),h}if(!Array.isArray(i))return i&&i.appendChild&&s&&s.appendChild(i),i;if(typeof i[0]!="string"||!i[0]){for(var f=[],b=0;b"u")){if(a){if(s)u();else if(s===!1)return a.push([n,i])}if(!g){var l=s;!s||!s.getRootNode?l=document:(l=s.getRootNode(),(!l||l==s)&&(l=document));var h=l.ownerDocument||l;if(i&&e.hasCssString(i,l))return null;i&&(n+=` /*# sourceURL=ace/css/`+i+" */");var f=e.createElement("style");f.appendChild(h.createTextNode(n)),i&&(f.id=i),l==h&&(l=e.getDocumentHead(h)),l.insertBefore(f,l.firstChild)}}}if(e.importCssString=o,e.importCssStylsheet=function(n,i){e.buildDom(["link",{rel:"stylesheet",href:n}],e.getDocumentHead(i))},e.scrollbarWidth=function(n){var i=e.createElement("ace_inner");i.style.width="100%",i.style.minWidth="0px",i.style.height="200px",i.style.display="block";var s=e.createElement("ace_outer"),l=s.style;l.position="absolute",l.left="-10000px",l.overflow="hidden",l.width="200px",l.minWidth="0px",l.height="150px",l.display="block",s.appendChild(i);var h=n&&n.documentElement||document&&document.documentElement;if(!h)return 0;h.appendChild(s);var f=i.offsetWidth;l.overflow="scroll";var b=i.offsetWidth;return f===b&&(b=s.clientWidth),h.removeChild(s),f-b},e.computedStyle=function(n,i){return window.getComputedStyle(n,"")||{}},e.setStyle=function(n,i,s){n[i]!==s&&(n[i]=s)},e.HAS_CSS_ANIMATION=!1,e.HAS_CSS_TRANSFORMS=!1,e.HI_DPI=d.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,d.isChromeOS&&(e.HI_DPI=!1),typeof document<"u"){var r=document.createElement("div");e.HI_DPI&&r.style.transform!==void 0&&(e.HAS_CSS_TRANSFORMS=!0),!d.isEdge&&typeof r.style.animationName<"u"&&(e.HAS_CSS_ANIMATION=!0),r=null}e.HAS_CSS_TRANSFORMS?e.translate=function(n,i,s){n.style.transform="translate("+Math.round(i)+"px, "+Math.round(s)+"px)"}:e.translate=function(n,i,s){n.style.top=Math.round(s)+"px",n.style.left=Math.round(i)+"px"}});ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(t,e,c){"use strict";var d=t("./dom");e.get=function(p,g){var a=new XMLHttpRequest;a.open("GET",p,!0),a.onreadystatechange=function(){a.readyState===4&&g(a.responseText)},a.send(null)},e.loadScript=function(p,g){var a=d.getDocumentHead(),u=document.createElement("script");u.src=p,a.appendChild(u),u.onload=u.onreadystatechange=function(o,r){(r||!u.readyState||u.readyState=="loaded"||u.readyState=="complete")&&(u=u.onload=u.onreadystatechange=null,r||g())}},e.qualifyURL=function(p){var g=document.createElement("a");return g.href=p,g.href}});ace.define("ace/lib/oop",["require","exports","module"],function(t,e,c){"use strict";e.inherits=function(d,p){d.super_=p,d.prototype=Object.create(p.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}})},e.mixin=function(d,p){for(var g in p)d[g]=p[g];return d},e.implement=function(d,p){e.mixin(d,p)}});ace.define("ace/lib/event_emitter",["require","exports","module"],function(t,e,c){"use strict";var d={},p=function(){this.propagationStopped=!0},g=function(){this.defaultPrevented=!0};d._emit=d._dispatchEvent=function(a,u){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var o=this._eventRegistry[a]||[],r=this._defaultHandlers[a];if(!(!o.length&&!r)){(typeof u!="object"||!u)&&(u={}),u.type||(u.type=a),u.stopPropagation||(u.stopPropagation=p),u.preventDefault||(u.preventDefault=g),o=o.slice();for(var n=0;n1&&(f=l[l.length-2]);var C=u[s+"Path"];return C==null?C=u.basePath:h=="/"&&(s=h=""),C&&C.slice(-1)!="/"&&(C+="/"),C+s+h+f+this.get("suffix")},e.setModuleUrl=function(i,s){return u.$moduleUrls[i]=s};var o=function(i,s){if(i==="ace/theme/textmate"||i==="./theme/textmate")return s(null,t("./theme/textmate"));if(r)return r(i,s);console.error("loader is not configured")},r;e.setLoader=function(i){r=i},e.dynamicModules=Object.create(null),e.$loading={},e.$loaded={},e.loadModule=function(i,s){var l;if(Array.isArray(i))var h=i[0],f=i[1];else if(typeof i=="string")var f=i;var b=function(C){if(C&&!e.$loading[f])return s&&s(C);if(e.$loading[f]||(e.$loading[f]=[]),e.$loading[f].push(s),!(e.$loading[f].length>1)){var w=function(){o(f,function(x,A){A&&(e.$loaded[f]=A),e._emit("load.module",{name:f,module:A});var v=e.$loading[f];e.$loading[f]=null,v.forEach(function(E){E&&E(A)})})};if(!e.get("packaged"))return w();p.loadScript(e.moduleUrl(f,h),w),n()}};if(e.dynamicModules[f])e.dynamicModules[f]().then(function(C){C.default?b(C.default):b(C)});else{try{l=this.$require(f)}catch{}b(l||e.$loaded[f])}},e.$require=function(i){if(typeof c.require=="function"){var s="require";return c[s](i)}},e.setModuleLoader=function(i,s){e.dynamicModules[i]=s};var n=function(){!u.basePath&&!u.workerPath&&!u.modePath&&!u.themePath&&!Object.keys(u.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),n=function(){})};e.version="1.32.2"});ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(t,e,c){"use strict";t("./lib/fixoldbrowsers");var d=t("./config");d.setLoader(function(u,o){t([u],function(r){o(null,r)})});var p=function(){return this||typeof window<"u"&&window}();c.exports=function(u){d.init=g,d.$require=t,u.require=t,typeof define=="function"&&(u.define=define)},g(!0);function g(u){if(!(!p||!p.document)){d.set("packaged",u||t.packaged||c.packaged||p.define&&define.packaged);var o={},r="",n=document.currentScript||document._currentScript,i=n&&n.ownerDocument||document;n&&n.src&&(r=n.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var s=i.getElementsByTagName("script"),l=0;l ["+this.end.row+"/"+this.end.column+"]"},p.prototype.contains=function(g,a){return this.compare(g,a)==0},p.prototype.compareRange=function(g){var a,u=g.end,o=g.start;return a=this.compare(u.row,u.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)},p.prototype.comparePoint=function(g){return this.compare(g.row,g.column)},p.prototype.containsRange=function(g){return this.comparePoint(g.start)==0&&this.comparePoint(g.end)==0},p.prototype.intersects=function(g){var a=this.compareRange(g);return a==-1||a==0||a==1},p.prototype.isEnd=function(g,a){return this.end.row==g&&this.end.column==a},p.prototype.isStart=function(g,a){return this.start.row==g&&this.start.column==a},p.prototype.setStart=function(g,a){typeof g=="object"?(this.start.column=g.column,this.start.row=g.row):(this.start.row=g,this.start.column=a)},p.prototype.setEnd=function(g,a){typeof g=="object"?(this.end.column=g.column,this.end.row=g.row):(this.end.row=g,this.end.column=a)},p.prototype.inside=function(g,a){return this.compare(g,a)==0?!(this.isEnd(g,a)||this.isStart(g,a)):!1},p.prototype.insideStart=function(g,a){return this.compare(g,a)==0?!this.isEnd(g,a):!1},p.prototype.insideEnd=function(g,a){return this.compare(g,a)==0?!this.isStart(g,a):!1},p.prototype.compare=function(g,a){return!this.isMultiLine()&&g===this.start.row?athis.end.column?1:0:gthis.end.row?1:this.start.row===g?a>=this.start.column?0:-1:this.end.row===g?a<=this.end.column?0:1:0},p.prototype.compareStart=function(g,a){return this.start.row==g&&this.start.column==a?-1:this.compare(g,a)},p.prototype.compareEnd=function(g,a){return this.end.row==g&&this.end.column==a?1:this.compare(g,a)},p.prototype.compareInside=function(g,a){return this.end.row==g&&this.end.column==a?1:this.start.row==g&&this.start.column==a?-1:this.compare(g,a)},p.prototype.clipRows=function(g,a){if(this.end.row>a)var u={row:a+1,column:0};else if(this.end.rowa)var o={row:a+1,column:0};else if(this.start.row1?(E++,E>4&&(E=1)):E=1,p.isIE){var L=Math.abs(m.clientX-$)>5||Math.abs(m.clientY-M)>5;(!S||L)&&(E=1),S&&clearTimeout(S),S=setTimeout(function(){S=null},w[E-1]||600),E==1&&($=m.clientX,M=m.clientY)}if(m._clicks=E,x[A]("mousedown",m),E>4)E=0;else if(E>1)return x[A](T[E],m)}Array.isArray(C)||(C=[C]),C.forEach(function(m){i(m,"mousedown",y,v)})};var l=function(C){return 0|(C.ctrlKey?1:0)|(C.altKey?2:0)|(C.shiftKey?4:0)|(C.metaKey?8:0)};e.getModifierString=function(C){return d.KEY_MODS[l(C)]};function h(C,w,x){var A=l(w);if(!p.isMac&&g){if(w.getModifierState&&(w.getModifierState("OS")||w.getModifierState("Win"))&&(A|=8),g.altGr)if((3&A)!=3)g.altGr=0;else return;if(x===18||x===17){var v="location"in w?w.location:w.keyLocation;if(x===17&&v===1)g[x]==1&&(a=w.timeStamp);else if(x===18&&A===3&&v===2){var E=w.timeStamp-a;E<50&&(g.altGr=!0)}}}if(x in d.MODIFIER_KEYS&&(x=-1),!A&&x===13){var v="location"in w?w.location:w.keyLocation;if(v===3&&(C(w,A,-x),w.defaultPrevented))return}if(p.isChromeOS&&A&8){if(C(w,A,x),w.defaultPrevented)return;A&=-9}return!A&&!(x in d.FUNCTION_KEYS)&&!(x in d.PRINTABLE_KEYS)?!1:C(w,A,x)}e.addCommandKeyListener=function(C,w,x){var A=null;i(C,"keydown",function(v){g[v.keyCode]=(g[v.keyCode]||0)+1;var E=h(w,v,v.keyCode);return A=v.defaultPrevented,E},x),i(C,"keypress",function(v){A&&(v.ctrlKey||v.altKey||v.shiftKey||v.metaKey)&&(e.stopEvent(v),A=null)},x),i(C,"keyup",function(v){g[v.keyCode]=null},x),g||(f(),i(window,"focus",f))};function f(){g=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!p.isOldIE){var b=1;e.nextTick=function(C,w){w=w||window;var x="zero-timeout-message-"+b++,A=function(v){v.data==x&&(e.stopPropagation(v),s(w,"message",A),C())};i(w,"message",A),w.postMessage(x,"*")}}e.$idleBlocked=!1,e.onIdle=function(C,w){return setTimeout(function x(){e.$idleBlocked?setTimeout(x,100):C()},w)},e.$idleBlockId=null,e.blockIdle=function(C){e.$idleBlockId&&clearTimeout(e.$idleBlockId),e.$idleBlocked=!0,e.$idleBlockId=setTimeout(function(){e.$idleBlocked=!1},C||100)},e.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),e.nextFrame?e.nextFrame=e.nextFrame.bind(window):e.nextFrame=function(C){setTimeout(C,17)}});ace.define("ace/clipboard",["require","exports","module"],function(t,e,c){"use strict";var d;c.exports={lineMode:!1,pasteCancelled:function(){return d&&d>Date.now()-50?!0:d=!1},cancel:function(){d=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,e,c){"use strict";var d=t("../lib/event"),p=t("../config").nls,g=t("../lib/useragent"),a=t("../lib/dom"),u=t("../lib/lang"),o=t("../clipboard"),r=g.isChrome<18,n=g.isIE,i=g.isChrome>63,s=400,l=t("../lib/keys"),h=l.KEY_MODS,f=g.isIOS,b=f?/\s/:/\n/,C=g.isMobile,w;w=function(x,A){var v=a.createElement("textarea");v.className="ace_text-input",v.setAttribute("wrap","off"),v.setAttribute("autocorrect","off"),v.setAttribute("autocapitalize","off"),v.setAttribute("spellcheck","false"),v.style.opacity="0",x.insertBefore(v,x.firstChild);var E=!1,$=!1,M=!1,S=!1,T="";C||(v.style.fontSize="1px");var y=!1,m=!1,L="",_=0,k=0,I=0,R=Number.MAX_SAFE_INTEGER,D=Number.MIN_SAFE_INTEGER,O=0;try{var N=document.activeElement===v}catch{}this.setNumberOfExtraLines=function(W){if(R=Number.MAX_SAFE_INTEGER,D=Number.MIN_SAFE_INTEGER,W<0){O=0;return}O=W},this.setAriaOptions=function(W){if(W.activeDescendant?(v.setAttribute("aria-haspopup","true"),v.setAttribute("aria-autocomplete",W.inline?"both":"list"),v.setAttribute("aria-activedescendant",W.activeDescendant)):(v.setAttribute("aria-haspopup","false"),v.setAttribute("aria-autocomplete","both"),v.removeAttribute("aria-activedescendant")),W.role&&v.setAttribute("role",W.role),W.setLabel&&(v.setAttribute("aria-roledescription",p("editor")),A.session)){var G=A.session.selection.cursor.row;v.setAttribute("aria-label",p("Cursor at row $0",[G+1]))}},this.setAriaOptions({role:"textbox"}),d.addListener(v,"blur",function(W){m||(A.onBlur(W),N=!1)},A),d.addListener(v,"focus",function(W){if(!m){if(N=!0,g.isEdge)try{if(!document.hasFocus())return}catch{}A.onFocus(W),g.isEdge?setTimeout(H):H()}},A),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:A.renderer.enableKeyboardAccessibility}),T||i||this.$focusScroll=="browser")return v.focus({preventScroll:!0});var W=v.style.top;v.style.position="fixed",v.style.top="0px";try{var G=v.getBoundingClientRect().top!=0}catch{return}var q=[];if(G)for(var ue=v.parentElement;ue&&ue.nodeType==1;)q.push(ue),ue.setAttribute("ace_nocontext","true"),!ue.parentElement&&ue.getRootNode?ue=ue.getRootNode().host:ue=ue.parentElement;v.focus({preventScroll:!0}),G&&q.forEach(function(Ce){Ce.removeAttribute("ace_nocontext")}),setTimeout(function(){v.style.position="",v.style.top=="0px"&&(v.style.top=W)},0)},this.blur=function(){v.blur()},this.isFocused=function(){return N},A.on("beforeEndOperation",function(){var W=A.curOp,G=W&&W.command&&W.command.name;if(G!="insertstring"){var q=G&&(W.docChanged||W.selectionChanged);M&&q&&(L=v.value="",ne()),H()}});var P=function(W,G){for(var q=G,ue=1;ue<=W-R&&ue<2*O+1;ue++)q+=A.session.getLine(W-ue).length+1;return q},H=f?function(W){if(!(!N||E&&!W||S)){W||(W="");var G=` +`});ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(t,e,c){"use strict";e.isDark=!1,e.cssClass="ace-tm",e.cssText=t("./textmate-css"),e.$id="ace/theme/textmate";var d=t("../lib/dom");d.importCssString(e.cssText,e.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,e,c){"no use strict";var d=t("./lib/lang"),p=t("./lib/net"),g=t("./lib/dom"),a=t("./lib/app_config").AppConfig;c.exports=e=new a;var u={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};e.get=function(i){if(!u.hasOwnProperty(i))throw new Error("Unknown config key: "+i);return u[i]},e.set=function(i,s){if(u.hasOwnProperty(i))u[i]=s;else if(this.setDefaultValue("",i,s)==!1)throw new Error("Unknown config key: "+i);i=="useStrictCSP"&&g.useStrictCSP(s)},e.all=function(){return d.copyObject(u)},e.$modes={},e.moduleUrl=function(i,s){if(u.$moduleUrls[i])return u.$moduleUrls[i];var l=i.split("/");s=s||l[l.length-2]||"";var h=s=="snippets"?"/":"-",f=l[l.length-1];if(s=="worker"&&h=="-"){var b=new RegExp("^"+s+"[\\-_]|[\\-_]"+s+"$","g");f=f.replace(b,"")}(!f||f==s)&&l.length>1&&(f=l[l.length-2]);var C=u[s+"Path"];return C==null?C=u.basePath:h=="/"&&(s=h=""),C&&C.slice(-1)!="/"&&(C+="/"),C+s+h+f+this.get("suffix")},e.setModuleUrl=function(i,s){return u.$moduleUrls[i]=s};var o=function(i,s){if(i==="ace/theme/textmate"||i==="./theme/textmate")return s(null,t("./theme/textmate"));if(r)return r(i,s);console.error("loader is not configured")},r;e.setLoader=function(i){r=i},e.dynamicModules=Object.create(null),e.$loading={},e.$loaded={},e.loadModule=function(i,s){var l;if(Array.isArray(i))var h=i[0],f=i[1];else if(typeof i=="string")var f=i;var b=function(C){if(C&&!e.$loading[f])return s&&s(C);if(e.$loading[f]||(e.$loading[f]=[]),e.$loading[f].push(s),!(e.$loading[f].length>1)){var w=function(){o(f,function(x,_){_&&(e.$loaded[f]=_),e._emit("load.module",{name:f,module:_});var v=e.$loading[f];e.$loading[f]=null,v.forEach(function(T){T&&T(_)})})};if(!e.get("packaged"))return w();p.loadScript(e.moduleUrl(f,h),w),n()}};if(e.dynamicModules[f])e.dynamicModules[f]().then(function(C){C.default?b(C.default):b(C)});else{try{l=this.$require(f)}catch{}b(l||e.$loaded[f])}},e.$require=function(i){if(typeof c.require=="function"){var s="require";return c[s](i)}},e.setModuleLoader=function(i,s){e.dynamicModules[i]=s};var n=function(){!u.basePath&&!u.workerPath&&!u.modePath&&!u.themePath&&!Object.keys(u.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),n=function(){})};e.version="1.32.2"});ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(t,e,c){"use strict";t("./lib/fixoldbrowsers");var d=t("./config");d.setLoader(function(u,o){t([u],function(r){o(null,r)})});var p=function(){return this||typeof window<"u"&&window}();c.exports=function(u){d.init=g,d.$require=t,u.require=t,typeof define=="function"&&(u.define=define)},g(!0);function g(u){if(!(!p||!p.document)){d.set("packaged",u||t.packaged||c.packaged||p.define&&define.packaged);var o={},r="",n=document.currentScript||document._currentScript,i=n&&n.ownerDocument||document;n&&n.src&&(r=n.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var s=i.getElementsByTagName("script"),l=0;l ["+this.end.row+"/"+this.end.column+"]"},p.prototype.contains=function(g,a){return this.compare(g,a)==0},p.prototype.compareRange=function(g){var a,u=g.end,o=g.start;return a=this.compare(u.row,u.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)},p.prototype.comparePoint=function(g){return this.compare(g.row,g.column)},p.prototype.containsRange=function(g){return this.comparePoint(g.start)==0&&this.comparePoint(g.end)==0},p.prototype.intersects=function(g){var a=this.compareRange(g);return a==-1||a==0||a==1},p.prototype.isEnd=function(g,a){return this.end.row==g&&this.end.column==a},p.prototype.isStart=function(g,a){return this.start.row==g&&this.start.column==a},p.prototype.setStart=function(g,a){typeof g=="object"?(this.start.column=g.column,this.start.row=g.row):(this.start.row=g,this.start.column=a)},p.prototype.setEnd=function(g,a){typeof g=="object"?(this.end.column=g.column,this.end.row=g.row):(this.end.row=g,this.end.column=a)},p.prototype.inside=function(g,a){return this.compare(g,a)==0?!(this.isEnd(g,a)||this.isStart(g,a)):!1},p.prototype.insideStart=function(g,a){return this.compare(g,a)==0?!this.isEnd(g,a):!1},p.prototype.insideEnd=function(g,a){return this.compare(g,a)==0?!this.isStart(g,a):!1},p.prototype.compare=function(g,a){return!this.isMultiLine()&&g===this.start.row?athis.end.column?1:0:gthis.end.row?1:this.start.row===g?a>=this.start.column?0:-1:this.end.row===g?a<=this.end.column?0:1:0},p.prototype.compareStart=function(g,a){return this.start.row==g&&this.start.column==a?-1:this.compare(g,a)},p.prototype.compareEnd=function(g,a){return this.end.row==g&&this.end.column==a?1:this.compare(g,a)},p.prototype.compareInside=function(g,a){return this.end.row==g&&this.end.column==a?1:this.start.row==g&&this.start.column==a?-1:this.compare(g,a)},p.prototype.clipRows=function(g,a){if(this.end.row>a)var u={row:a+1,column:0};else if(this.end.rowa)var o={row:a+1,column:0};else if(this.start.row1?(T++,T>4&&(T=1)):T=1,p.isIE){var $=Math.abs(m.clientX-L)>5||Math.abs(m.clientY-M)>5;(!E||$)&&(T=1),E&&clearTimeout(E),E=setTimeout(function(){E=null},w[T-1]||600),T==1&&(L=m.clientX,M=m.clientY)}if(m._clicks=T,x[_]("mousedown",m),T>4)T=0;else if(T>1)return x[_](S[T],m)}Array.isArray(C)||(C=[C]),C.forEach(function(m){i(m,"mousedown",y,v)})};var l=function(C){return 0|(C.ctrlKey?1:0)|(C.altKey?2:0)|(C.shiftKey?4:0)|(C.metaKey?8:0)};e.getModifierString=function(C){return d.KEY_MODS[l(C)]};function h(C,w,x){var _=l(w);if(!p.isMac&&g){if(w.getModifierState&&(w.getModifierState("OS")||w.getModifierState("Win"))&&(_|=8),g.altGr)if((3&_)!=3)g.altGr=0;else return;if(x===18||x===17){var v="location"in w?w.location:w.keyLocation;if(x===17&&v===1)g[x]==1&&(a=w.timeStamp);else if(x===18&&_===3&&v===2){var T=w.timeStamp-a;T<50&&(g.altGr=!0)}}}if(x in d.MODIFIER_KEYS&&(x=-1),!_&&x===13){var v="location"in w?w.location:w.keyLocation;if(v===3&&(C(w,_,-x),w.defaultPrevented))return}if(p.isChromeOS&&_&8){if(C(w,_,x),w.defaultPrevented)return;_&=-9}return!_&&!(x in d.FUNCTION_KEYS)&&!(x in d.PRINTABLE_KEYS)?!1:C(w,_,x)}e.addCommandKeyListener=function(C,w,x){var _=null;i(C,"keydown",function(v){g[v.keyCode]=(g[v.keyCode]||0)+1;var T=h(w,v,v.keyCode);return _=v.defaultPrevented,T},x),i(C,"keypress",function(v){_&&(v.ctrlKey||v.altKey||v.shiftKey||v.metaKey)&&(e.stopEvent(v),_=null)},x),i(C,"keyup",function(v){g[v.keyCode]=null},x),g||(f(),i(window,"focus",f))};function f(){g=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!p.isOldIE){var b=1;e.nextTick=function(C,w){w=w||window;var x="zero-timeout-message-"+b++,_=function(v){v.data==x&&(e.stopPropagation(v),s(w,"message",_),C())};i(w,"message",_),w.postMessage(x,"*")}}e.$idleBlocked=!1,e.onIdle=function(C,w){return setTimeout(function x(){e.$idleBlocked?setTimeout(x,100):C()},w)},e.$idleBlockId=null,e.blockIdle=function(C){e.$idleBlockId&&clearTimeout(e.$idleBlockId),e.$idleBlocked=!0,e.$idleBlockId=setTimeout(function(){e.$idleBlocked=!1},C||100)},e.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),e.nextFrame?e.nextFrame=e.nextFrame.bind(window):e.nextFrame=function(C){setTimeout(C,17)}});ace.define("ace/clipboard",["require","exports","module"],function(t,e,c){"use strict";var d;c.exports={lineMode:!1,pasteCancelled:function(){return d&&d>Date.now()-50?!0:d=!1},cancel:function(){d=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,e,c){"use strict";var d=t("../lib/event"),p=t("../config").nls,g=t("../lib/useragent"),a=t("../lib/dom"),u=t("../lib/lang"),o=t("../clipboard"),r=g.isChrome<18,n=g.isIE,i=g.isChrome>63,s=400,l=t("../lib/keys"),h=l.KEY_MODS,f=g.isIOS,b=f?/\s/:/\n/,C=g.isMobile,w;w=function(x,_){var v=a.createElement("textarea");v.className="ace_text-input",v.setAttribute("wrap","off"),v.setAttribute("autocorrect","off"),v.setAttribute("autocapitalize","off"),v.setAttribute("spellcheck","false"),v.style.opacity="0",x.insertBefore(v,x.firstChild);var T=!1,L=!1,M=!1,E=!1,S="";C||(v.style.fontSize="1px");var y=!1,m=!1,$="",A=0,k=0,R=0,I=Number.MAX_SAFE_INTEGER,D=Number.MIN_SAFE_INTEGER,O=0;try{var N=document.activeElement===v}catch{}this.setNumberOfExtraLines=function(W){if(I=Number.MAX_SAFE_INTEGER,D=Number.MIN_SAFE_INTEGER,W<0){O=0;return}O=W},this.setAriaOptions=function(W){if(W.activeDescendant?(v.setAttribute("aria-haspopup","true"),v.setAttribute("aria-autocomplete",W.inline?"both":"list"),v.setAttribute("aria-activedescendant",W.activeDescendant)):(v.setAttribute("aria-haspopup","false"),v.setAttribute("aria-autocomplete","both"),v.removeAttribute("aria-activedescendant")),W.role&&v.setAttribute("role",W.role),W.setLabel&&(v.setAttribute("aria-roledescription",p("editor")),_.session)){var G=_.session.selection.cursor.row;v.setAttribute("aria-label",p("Cursor at row $0",[G+1]))}},this.setAriaOptions({role:"textbox"}),d.addListener(v,"blur",function(W){m||(_.onBlur(W),N=!1)},_),d.addListener(v,"focus",function(W){if(!m){if(N=!0,g.isEdge)try{if(!document.hasFocus())return}catch{}_.onFocus(W),g.isEdge?setTimeout(B):B()}},_),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:_.renderer.enableKeyboardAccessibility}),S||i||this.$focusScroll=="browser")return v.focus({preventScroll:!0});var W=v.style.top;v.style.position="fixed",v.style.top="0px";try{var G=v.getBoundingClientRect().top!=0}catch{return}var ne=[];if(G)for(var me=v.parentElement;me&&me.nodeType==1;)ne.push(me),me.setAttribute("ace_nocontext","true"),!me.parentElement&&me.getRootNode?me=me.getRootNode().host:me=me.parentElement;v.focus({preventScroll:!0}),G&&ne.forEach(function(_e){_e.removeAttribute("ace_nocontext")}),setTimeout(function(){v.style.position="",v.style.top=="0px"&&(v.style.top=W)},0)},this.blur=function(){v.blur()},this.isFocused=function(){return N},_.on("beforeEndOperation",function(){var W=_.curOp,G=W&&W.command&&W.command.name;if(G!="insertstring"){var ne=G&&(W.docChanged||W.selectionChanged);M&&ne&&($=v.value="",ae()),B()}});var P=function(W,G){for(var ne=G,me=1;me<=W-I&&me<2*O+1;me++)ne+=_.session.getLine(W-me).length+1;return ne},B=f?function(W){if(!(!N||T&&!W||E)){W||(W="");var G=` ab`+W+`cde fg -`;G!=v.value&&(v.value=L=G);var q=4,ue=4+(W.length||(A.selection.isEmpty()?0:1));(_!=q||k!=ue)&&v.setSelectionRange(q,ue),_=q,k=ue}}:function(){if(!(M||S)&&!(!N&&!J)){M=!0;var W=0,G=0,q="";if(A.session){var ue=A.selection,Ce=ue.getRange(),_e=ue.cursor.row;_e===D+1?(R=D+1,D=R+2*O):_e===R-1?(D=R-1,R=D-2*O):(_eD+1)&&(R=_e>O?_e-O:0,D=_e>O?_e+O:2*O);for(var Ae=[],Me=R;Me<=D;Me++)Ae.push(A.session.getLine(Me));if(q=Ae.join(` -`),W=P(Ce.start.row,Ce.start.column),G=P(Ce.end.row,Ce.end.column),Ce.start.rowD){var ke=A.session.getLine(D+1);G=Ce.end.row>D+1?ke.length:Ce.end.column,G+=q.length+1,q=q+` -`+ke}else C&&_e>0&&(q=` -`+q,G+=1,W+=1);q.length>s&&(W=L.length&&W.value===L&&L&&W.selectionEnd!==k},U=function(W){M||(E?E=!1:F(v)?(A.selectAll(),H()):C&&v.selectionStart!=_&&H())},j=null;this.setInputHandler=function(W){j=W},this.getInputHandler=function(){return j};var J=!1,z=function(W,G){if(J&&(J=!1),$)return H(),W&&A.onPaste(W),$=!1,"";for(var q=v.selectionStart,ue=v.selectionEnd,Ce=_,_e=L.length-k,Ae=W,Me=W.length-q,Oe=W.length-ue,ke=0;Ce>0&&L[ke]==W[ke];)ke++,Ce--;for(Ae=Ae.slice(ke),ke=1;_e>0&&L.length-ke>_-1&&L[L.length-ke]==W[W.length-ke];)ke++,_e--;Me-=ke-1,Oe-=ke-1;var ze=Ae.length-ke+1;if(ze<0&&(Ce=-ze,ze=0),Ae=Ae.slice(0,ze),!G&&!Ae&&!Me&&!Ce&&!_e&&!Oe)return"";S=!0;var un=!1;return g.isAndroid&&Ae==". "&&(Ae=" ",un=!0),Ae&&!Ce&&!_e&&!Me&&!Oe||y?A.onTextInput(Ae):A.onTextInput(Ae,{extendLeft:Ce,extendRight:_e,restoreStart:Me,restoreEnd:Oe}),S=!1,L=W,_=q,k=ue,I=Oe,un?` -`:Ae},X=function(W){if(M)return K();if(W&&W.inputType){if(W.inputType=="historyUndo")return A.execCommand("undo");if(W.inputType=="historyRedo")return A.execCommand("redo")}var G=v.value,q=z(G,!0);(G.length>s+100||b.test(q)||C&&_<1&&_==k)&&H()},ee=function(W,G,q){var ue=W.clipboardData||window.clipboardData;if(!(!ue||r)){var Ce=n||q?"Text":"text/plain";try{return G?ue.setData(Ce,G)!==!1:ue.getData(Ce)}catch(_e){if(!q)return ee(_e,G,!0)}}},Z=function(W,G){var q=A.getCopyText();if(!q)return d.preventDefault(W);ee(W,q)?(f&&(H(q),E=q,setTimeout(function(){E=!1},10)),G?A.onCut():A.onCopy(),d.preventDefault(W)):(E=!0,v.value=q,v.select(),setTimeout(function(){E=!1,H(),G?A.onCut():A.onCopy()}))},pe=function(W){Z(W,!0)},ve=function(W){Z(W,!1)},de=function(W){var G=ee(W);o.pasteCancelled()||(typeof G=="string"?(G&&A.onPaste(G,W),g.isIE&&setTimeout(H),d.preventDefault(W)):(v.value="",$=!0))};d.addCommandKeyListener(v,A.onCommandKey.bind(A),A),d.addListener(v,"select",U,A),d.addListener(v,"input",X,A),d.addListener(v,"cut",pe,A),d.addListener(v,"copy",ve,A),d.addListener(v,"paste",de,A),(!("oncut"in v)||!("oncopy"in v)||!("onpaste"in v))&&d.addListener(x,"keydown",function(W){if(!(g.isMac&&!W.metaKey||!W.ctrlKey))switch(W.keyCode){case 67:ve(W);break;case 86:de(W);break;case 88:pe(W);break}},A);var B=function(W){if(!(M||!A.onCompositionStart||A.$readOnly)&&(M={},!y)){W.data&&(M.useTextareaForIME=!1),setTimeout(K,0),A._signal("compositionStart"),A.on("mousedown",Q);var G=A.getSelectionRange();G.end.row=G.start.row,G.end.column=G.start.column,M.markerRange=G,M.selectionStart=_,A.onCompositionStart(M),M.useTextareaForIME?(L=v.value="",_=0,k=0):(v.msGetInputContext&&(M.context=v.msGetInputContext()),v.getInputContext&&(M.context=v.getInputContext()))}},K=function(){if(!(!M||!A.onCompositionUpdate||A.$readOnly)){if(y)return Q();if(M.useTextareaForIME)A.onCompositionUpdate(v.value);else{var W=v.value;z(W),M.markerRange&&(M.context&&(M.markerRange.start.column=M.selectionStart=M.context.compositionStartOffset),M.markerRange.end.column=M.markerRange.start.column+k-M.selectionStart+I)}}},ne=function(W){!A.onCompositionEnd||A.$readOnly||(M=!1,A.onCompositionEnd(),A.off("mousedown",Q),W&&X())};function Q(){m=!0,v.blur(),v.focus(),m=!1}var se=u.delayedCall(K,50).schedule.bind(null,null);function te(W){W.keyCode==27&&v.value.lengthk&&L[Oe]==` -`?ke=l.end:Me<_&&L[Me-1]==" "?(ke=l.left,ze=h.option):Me<_||Me==_&&k!=_&&Me==Oe?ke=l.left:Oe>k&&L.slice(0,Oe).split(` -`).length>2?ke=l.down:Oe>k&&L[Oe-1]==" "?(ke=l.right,ze=h.option):(Oe>k||Oe==k&&k!=_&&Me==Oe)&&(ke=l.right),Me!==Oe&&(ze|=h.shift),ke){var un=G.onCommandKey({},ze,ke);if(!un&&G.commands){ke=l.keyCodeToString(ke);var lt=G.commands.findKeyCommand(ze,ke);lt&&G.execCommand(lt)}_=Me,k=Oe,H("")}}};document.addEventListener("selectionchange",_e),G.on("destroy",function(){document.removeEventListener("selectionchange",_e)})}this.destroy=function(){v.parentElement&&v.parentElement.removeChild(v)}},e.TextInput=w,e.$setUserAgentForTests=function(x,A){C=x,f=A}});ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,e,c){"use strict";var d=t("../lib/useragent"),p=0,g=550,a=function(){function r(n){n.$clickSelection=null;var i=n.editor;i.setDefaultHandler("mousedown",this.onMouseDown.bind(n)),i.setDefaultHandler("dblclick",this.onDoubleClick.bind(n)),i.setDefaultHandler("tripleclick",this.onTripleClick.bind(n)),i.setDefaultHandler("quadclick",this.onQuadClick.bind(n)),i.setDefaultHandler("mousewheel",this.onMouseWheel.bind(n));var s=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];s.forEach(function(l){n[l]=this[l]},this),n.selectByLines=this.extendSelectionBy.bind(n,"getLineRange"),n.selectByWords=this.extendSelectionBy.bind(n,"getWordRange")}return r.prototype.onMouseDown=function(n){var i=n.inSelection(),s=n.getDocumentPosition();this.mousedownEvent=n;var l=this.editor,h=n.getButton();if(h!==0){var f=l.getSelectionRange(),b=f.isEmpty();(b||h==1)&&l.selection.moveToPosition(s),h==2&&(l.textInput.onContextMenu(n.domEvent),d.isMozilla||n.preventDefault());return}if(this.mousedownEvent.time=Date.now(),i&&!l.isFocused()&&(l.focus(),this.$focusTimeout&&!this.$clickSelection&&!l.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(n);return}return this.captureMouse(n),this.startSelect(s,n.domEvent._clicks>1),n.preventDefault()},r.prototype.startSelect=function(n,i){n=n||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var s=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?s.selection.selectToPosition(n):i||s.selection.moveToPosition(n),i||this.select(),s.setStyle("ace_selecting"),this.setState("select"))},r.prototype.select=function(){var n,i=this.editor,s=i.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var l=this.$clickSelection.comparePoint(s);if(l==-1)n=this.$clickSelection.end;else if(l==1)n=this.$clickSelection.start;else{var h=o(this.$clickSelection,s);s=h.cursor,n=h.anchor}i.selection.setSelectionAnchor(n.row,n.column)}i.selection.selectToPosition(s),i.renderer.scrollCursorIntoView()},r.prototype.extendSelectionBy=function(n){var i,s=this.editor,l=s.renderer.screenToTextCoordinates(this.x,this.y),h=s.selection[n](l.row,l.column);if(this.$clickSelection){var f=this.$clickSelection.comparePoint(h.start),b=this.$clickSelection.comparePoint(h.end);if(f==-1&&b<=0)i=this.$clickSelection.end,(h.end.row!=l.row||h.end.column!=l.column)&&(l=h.start);else if(b==1&&f>=0)i=this.$clickSelection.start,(h.start.row!=l.row||h.start.column!=l.column)&&(l=h.end);else if(f==-1&&b==1)l=h.end,i=h.start;else{var C=o(this.$clickSelection,l);l=C.cursor,i=C.anchor}s.selection.setSelectionAnchor(i.row,i.column)}s.selection.selectToPosition(l),s.renderer.scrollCursorIntoView()},r.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},r.prototype.focusWait=function(){var n=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),i=Date.now();(n>p||i-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},r.prototype.onDoubleClick=function(n){var i=n.getDocumentPosition(),s=this.editor,l=s.session,h=l.getBracketRange(i);h?(h.isEmpty()&&(h.start.column--,h.end.column++),this.setState("select")):(h=s.selection.getWordRange(i.row,i.column),this.setState("selectByWords")),this.$clickSelection=h,this.select()},r.prototype.onTripleClick=function(n){var i=n.getDocumentPosition(),s=this.editor;this.setState("selectByLines");var l=s.getSelectionRange();l.isMultiLine()&&l.contains(i.row,i.column)?(this.$clickSelection=s.selection.getLineRange(l.start.row),this.$clickSelection.end=s.selection.getLineRange(l.end.row).end):this.$clickSelection=s.selection.getLineRange(i.row),this.select()},r.prototype.onQuadClick=function(n){var i=this.editor;i.selectAll(),this.$clickSelection=i.getSelectionRange(),this.setState("selectAll")},r.prototype.onMouseWheel=function(n){if(!n.getAccelKey()){n.getShiftKey()&&n.wheelY&&!n.wheelX&&(n.wheelX=n.wheelY,n.wheelY=0);var i=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var s=this.$lastScroll,l=n.domEvent.timeStamp,h=l-s.t,f=h?n.wheelX/h:s.vx,b=h?n.wheelY/h:s.vy;h=1&&i.renderer.isScrollableBy(n.wheelX*n.speed,0)&&(w=!0),C<=1&&i.renderer.isScrollableBy(0,n.wheelY*n.speed)&&(w=!0),w)s.allowed=l;else if(l-s.allowedg.clientHeight;a||p.preventDefault()}});ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(t,e,c){"use strict";var d=this&&this.__extends||function(){var h=function(f,b){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,w){C.__proto__=w}||function(C,w){for(var x in w)Object.prototype.hasOwnProperty.call(w,x)&&(C[x]=w[x])},h(f,b)};return function(f,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");h(f,b);function C(){this.constructor=f}f.prototype=b===null?Object.create(b):(C.prototype=b.prototype,new C)}}(),p=this&&this.__values||function(h){var f=typeof Symbol=="function"&&Symbol.iterator,b=f&&h[f],C=0;if(b)return b.call(h);if(h&&typeof h.length=="number")return{next:function(){return h&&C>=h.length&&(h=void 0),{value:h&&h[C++],done:!h}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},g=t("./lib/dom"),a=t("./lib/event"),u=t("./range").Range,o=t("./lib/scroll").preventParentScroll,r="ace_tooltip",n=function(){function h(f){this.isOpen=!1,this.$element=null,this.$parentNode=f}return h.prototype.$init=function(){return this.$element=g.createElement("div"),this.$element.className=r,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},h.prototype.getElement=function(){return this.$element||this.$init()},h.prototype.setText=function(f){this.getElement().textContent=f},h.prototype.setHtml=function(f){this.getElement().innerHTML=f},h.prototype.setPosition=function(f,b){this.getElement().style.left=f+"px",this.getElement().style.top=b+"px"},h.prototype.setClassName=function(f){g.addCssClass(this.getElement(),f)},h.prototype.setTheme=function(f){this.$element.className=r+" "+(f.isDark?"ace_dark ":"")+(f.cssClass||"")},h.prototype.show=function(f,b,C){f!=null&&this.setText(f),b!=null&&C!=null&&this.setPosition(b,C),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},h.prototype.hide=function(f){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=r,this.isOpen=!1)},h.prototype.getHeight=function(){return this.getElement().offsetHeight},h.prototype.getWidth=function(){return this.getElement().offsetWidth},h.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},h}(),i=function(){function h(){this.popups=[]}return h.prototype.addPopup=function(f){this.popups.push(f),this.updatePopups()},h.prototype.removePopup=function(f){var b=this.popups.indexOf(f);b!==-1&&(this.popups.splice(b,1),this.updatePopups())},h.prototype.updatePopups=function(){var f,b,C,w;this.popups.sort(function(y,m){return m.priority-y.priority});var x=[];try{for(var A=p(this.popups),v=A.next();!v.done;v=A.next()){var E=v.value,$=!0;try{for(var M=(C=void 0,p(x)),S=M.next();!S.done;S=M.next()){var T=S.value;if(this.doPopupsOverlap(T,E)){$=!1;break}}}catch(y){C={error:y}}finally{try{S&&!S.done&&(w=M.return)&&w.call(M)}finally{if(C)throw C.error}}$?x.push(E):E.hide()}}catch(y){f={error:y}}finally{try{v&&!v.done&&(b=A.return)&&b.call(A)}finally{if(f)throw f.error}}},h.prototype.doPopupsOverlap=function(f,b){var C=f.getElement().getBoundingClientRect(),w=b.getElement().getBoundingClientRect();return C.leftw.left&&C.topw.top},h}(),s=new i;e.popupManager=s,e.Tooltip=n;var l=function(h){d(f,h);function f(b){b===void 0&&(b=document.body);var C=h.call(this,b)||this;C.timeout=void 0,C.lastT=0,C.idleTime=350,C.lastEvent=void 0,C.onMouseOut=C.onMouseOut.bind(C),C.onMouseMove=C.onMouseMove.bind(C),C.waitForHover=C.waitForHover.bind(C),C.hide=C.hide.bind(C);var w=C.getElement();return w.style.whiteSpace="pre-wrap",w.style.pointerEvents="auto",w.addEventListener("mouseout",C.onMouseOut),w.tabIndex=-1,w.addEventListener("blur",function(){w.contains(document.activeElement)||this.hide()}.bind(C)),w.addEventListener("wheel",o),C}return f.prototype.addToEditor=function(b){b.on("mousemove",this.onMouseMove),b.on("mousedown",this.hide),b.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},f.prototype.removeFromEditor=function(b){b.off("mousemove",this.onMouseMove),b.off("mousedown",this.hide),b.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},f.prototype.onMouseMove=function(b,C){this.lastEvent=b,this.lastT=Date.now();var w=C.$mouseHandler.isMousePressed;if(this.isOpen){var x=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(x.row,x.column)||w||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||w||(this.lastEvent=b,this.timeout=setTimeout(this.waitForHover,this.idleTime))},f.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var b=Date.now()-this.lastT;if(this.idleTime-b>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-b);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},f.prototype.isOutsideOfText=function(b){var C=b.editor,w=b.getDocumentPosition(),x=C.session.getLine(w.row);if(w.column==x.length){var A=C.renderer.pixelToScreenCoordinates(b.clientX,b.clientY),v=C.session.documentToScreenPosition(w.row,w.column);if(v.column!=A.column||v.row!=A.row)return!0}return!1},f.prototype.setDataProvider=function(b){this.$gatherData=b},f.prototype.showForRange=function(b,C,w,x){var A=10;if(!(x&&x!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var v=b.renderer;this.isOpen||(s.addPopup(this),this.$registerCloseEvents(),this.setTheme(v.theme)),this.isOpen=!0,this.addMarker(C,b.session),this.range=u.fromPoints(C.start,C.end);var E=v.textToScreenCoordinates(C.start.row,C.start.column),$=v.scroller.getBoundingClientRect();E.pageX<$.left&&(E.pageX=$.left);var M=this.getElement();M.innerHTML="",M.appendChild(w),M.style.maxHeight="",M.style.display="block";var S=M.clientHeight,T=M.clientWidth,y=window.innerHeight-E.pageY-v.lineHeight,m=!0;E.pageY-S<0&&E.pageY=i.length&&(i=void 0),{value:i&&i[h++],done:!i}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},g=t("../lib/dom"),a=t("../lib/event"),u=t("../tooltip").Tooltip,o=t("../config").nls;function r(i){var s=i.editor,l=s.renderer.$gutterLayer,h=new n(s);i.editor.setDefaultHandler("guttermousedown",function(A){if(!(!s.isFocused()||A.getButton()!=0)){var v=l.getRegion(A);if(v!="foldWidgets"){var E=A.getDocumentPosition().row,$=s.session.selection;if(A.getShiftKey())$.selectTo(E,0);else{if(A.domEvent.detail==2)return s.selectAll(),A.preventDefault();i.$clickSelection=s.selection.getLineRange(E)}return i.setState("selectByLines"),i.captureMouse(A),A.preventDefault()}}});var f,b;function C(){var A=b.getDocumentPosition().row,v=s.session.getLength();if(A==v){var E=s.renderer.pixelToScreenCoordinates(0,b.y).row,$=b.$pos;if(E>s.session.documentToScreenRow($.row,$.column))return w()}if(h.showTooltip(A),!!h.isOpen)if(s.on("mousewheel",w),i.$tooltipFollowsMouse)x(b);else{var M=b.getGutterRow(),S=l.$lines.get(M);if(S){var T=S.element.querySelector(".ace_gutter_annotation"),y=T.getBoundingClientRect(),m=h.getElement().style;m.left=y.right+"px",m.top=y.bottom+"px"}else x(b)}}function w(){f&&(f=clearTimeout(f)),h.isOpen&&(h.hideTooltip(),s.off("mousewheel",w))}function x(A){h.setPosition(A.x,A.y)}i.editor.setDefaultHandler("guttermousemove",function(A){var v=A.domEvent.target||A.domEvent.srcElement;if(g.hasCssClass(v,"ace_fold-widget"))return w();h.isOpen&&i.$tooltipFollowsMouse&&x(A),b=A,!f&&(f=setTimeout(function(){f=null,b&&!i.isMousePressed?C():w()},50))}),a.addListener(s.renderer.$gutter,"mouseout",function(A){b=null,!(!h.isOpen||f)&&(f=setTimeout(function(){f=null,w()},50))},s),s.on("changeSession",w),s.on("input",w)}e.GutterHandler=r;var n=function(i){d(s,i);function s(l){var h=i.call(this,l.container)||this;return h.editor=l,h}return s.prototype.setPosition=function(l,h){var f=window.innerWidth||document.documentElement.clientWidth,b=window.innerHeight||document.documentElement.clientHeight,C=this.getWidth(),w=this.getHeight();l+=15,h+=15,l+C>f&&(l-=l+C-f),h+w>b&&(h-=20+w),u.prototype.setPosition.call(this,l,h)},Object.defineProperty(s,"annotationLabels",{get:function(){return{error:{singular:o("error"),plural:o("errors")},warning:{singular:o("warning"),plural:o("warnings")},info:{singular:o("information message"),plural:o("information messages")}}},enumerable:!1,configurable:!0}),s.prototype.showTooltip=function(l){var h=this.editor.renderer.$gutterLayer,f=h.$annotations[l],b;f?b={text:Array.from(f.text),type:Array.from(f.type)}:b={text:[],type:[]};var C=h.session.getFoldLine(l);if(C&&h.$showFoldedAnnotations){for(var w={error:[],warning:[],info:[]},x,A=l+1;A<=C.end.row;A++)if(h.$annotations[A])for(var v=0;v ").concat(b.text[A]);M[b.type[A].replace("_fold","")].push(T)}var y=[].concat(M.error,M.warning,M.info).join("
");this.setHtml(y),this.$element.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},s.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},s.annotationsToSummaryString=function(l){var h,f,b=[],C=["error","warning","info"];try{for(var w=p(C),x=w.next();!x.done;x=w.next()){var A=x.value;if(l[A].length){var v=l[A].length===1?s.annotationLabels[A].singular:s.annotationLabels[A].plural;b.push("".concat(l[A].length," ").concat(v))}}}catch(E){h={error:E}}finally{try{x&&!x.done&&(f=w.return)&&f.call(w)}finally{if(h)throw h.error}}return b.join(", ")},s}(u);e.GutterTooltip=n});ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,e,c){"use strict";var d=t("../lib/event"),p=t("../lib/useragent"),g=function(){function a(u,o){this.speed,this.wheelX,this.wheelY,this.domEvent=u,this.editor=o,this.x=this.clientX=u.clientX,this.y=this.clientY=u.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return a.prototype.stopPropagation=function(){d.stopPropagation(this.domEvent),this.propagationStopped=!0},a.prototype.preventDefault=function(){d.preventDefault(this.domEvent),this.defaultPrevented=!0},a.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},a.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},a.prototype.getGutterRow=function(){var u=this.getDocumentPosition().row,o=this.editor.session.documentToScreenRow(u,0),r=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return o-r},a.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var u=this.editor,o=u.getSelectionRange();if(o.isEmpty())this.$inSelection=!1;else{var r=this.getDocumentPosition();this.$inSelection=o.contains(r.row,r.column)}return this.$inSelection},a.prototype.getButton=function(){return d.getButton(this.domEvent)},a.prototype.getShiftKey=function(){return this.domEvent.shiftKey},a.prototype.getAccelKey=function(){return p.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},a}();e.MouseEvent=g});ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,e,c){"use strict";var d=t("../lib/dom"),p=t("../lib/event"),g=t("../lib/useragent"),a=200,u=200,o=5;function r(i){var s=i.editor,l=d.createElement("div");l.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",l.textContent="\xA0";var h=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];h.forEach(function(P){i[P]=this[P]},this),s.on("mousedown",this.onMouseDown.bind(i));var f=s.container,b,C,w,x,A,v,E=0,$,M,S,T,y;this.onDragStart=function(P){if(this.cancelDrag||!f.draggable){var H=this;return setTimeout(function(){H.startSelect(),H.captureMouse(P)},0),P.preventDefault()}A=s.getSelectionRange();var F=P.dataTransfer;F.effectAllowed=s.getReadOnly()?"copy":"copyMove",s.container.appendChild(l),F.setDragImage&&F.setDragImage(l,0,0),setTimeout(function(){s.container.removeChild(l)}),F.clearData(),F.setData("Text",s.session.getTextRange()),M=!0,this.setState("drag")},this.onDragEnd=function(P){if(f.draggable=!1,M=!1,this.setState(null),!s.getReadOnly()){var H=P.dataTransfer.dropEffect;!$&&H=="move"&&s.session.remove(s.getSelectionRange()),s.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(P){if(!(s.getReadOnly()||!O(P.dataTransfer)))return C=P.clientX,w=P.clientY,b||k(),E++,P.dataTransfer.dropEffect=$=N(P),p.preventDefault(P)},this.onDragOver=function(P){if(!(s.getReadOnly()||!O(P.dataTransfer)))return C=P.clientX,w=P.clientY,b||(k(),E++),R!==null&&(R=null),P.dataTransfer.dropEffect=$=N(P),p.preventDefault(P)},this.onDragLeave=function(P){if(E--,E<=0&&b)return I(),$=null,p.preventDefault(P)},this.onDrop=function(P){if(v){var H=P.dataTransfer;if(M)switch($){case"move":A.contains(v.row,v.column)?A={start:v,end:v}:A=s.moveText(A,v);break;case"copy":A=s.moveText(A,v,!0);break}else{var F=H.getData("Text");A={start:v,end:s.session.insert(v,F)},s.focus(),$=null}return I(),p.preventDefault(P)}},p.addListener(f,"dragstart",this.onDragStart.bind(i),s),p.addListener(f,"dragend",this.onDragEnd.bind(i),s),p.addListener(f,"dragenter",this.onDragEnter.bind(i),s),p.addListener(f,"dragover",this.onDragOver.bind(i),s),p.addListener(f,"dragleave",this.onDragLeave.bind(i),s),p.addListener(f,"drop",this.onDrop.bind(i),s);function m(P,H){var F=Date.now(),U=!H||P.row!=H.row,j=!H||P.column!=H.column;if(!T||U||j)s.moveCursorToPosition(P),T=F,y={x:C,y:w};else{var J=n(y.x,y.y,C,w);J>o?T=null:F-T>=u&&(s.renderer.scrollCursorIntoView(),T=null)}}function L(P,H){var F=Date.now(),U=s.renderer.layerConfig.lineHeight,j=s.renderer.layerConfig.characterWidth,J=s.renderer.scroller.getBoundingClientRect(),z={x:{left:C-J.left,right:J.right-C},y:{top:w-J.top,bottom:J.bottom-w}},X=Math.min(z.x.left,z.x.right),ee=Math.min(z.y.top,z.y.bottom),Z={row:P.row,column:P.column};X/j<=2&&(Z.column+=z.x.left=a&&s.renderer.scrollCursorIntoView(Z):S=F:S=null}function _(){var P=v;v=s.renderer.screenToTextCoordinates(C,w),m(v,P),L(v,P)}function k(){A=s.selection.toOrientedRange(),b=s.session.addMarker(A,"ace_selection",s.getSelectionStyle()),s.clearSelection(),s.isFocused()&&s.renderer.$cursorLayer.setBlinking(!1),clearInterval(x),_(),x=setInterval(_,20),E=0,p.addListener(document,"mousemove",D)}function I(){clearInterval(x),s.session.removeMarker(b),b=null,s.selection.fromOrientedRange(A),s.isFocused()&&!M&&s.$resetCursorStyle(),A=null,v=null,E=0,S=null,T=null,p.removeListener(document,"mousemove",D)}var R=null;function D(){R==null&&(R=setTimeout(function(){R!=null&&b&&I()},20))}function O(P){var H=P.types;return!H||Array.prototype.some.call(H,function(F){return F=="text/plain"||F=="Text"})}function N(P){var H=["copy","copymove","all","uninitialized"],F=["move","copymove","linkmove","all","uninitialized"],U=g.isMac?P.altKey:P.ctrlKey,j="uninitialized";try{j=P.dataTransfer.effectAllowed.toLowerCase()}catch{}var J="none";return U&&H.indexOf(j)>=0?J="copy":F.indexOf(j)>=0?J="move":H.indexOf(j)>=0&&(J="copy"),J}}(function(){this.dragWait=function(){var i=Date.now()-this.mousedownEvent.time;i>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var i=this.editor.container;i.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(i){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var i=this.editor,s=i.container;s.draggable=!0,i.renderer.$cursorLayer.setBlinking(!1),i.setStyle("ace_dragging");var l=g.isWin?"default":"move";i.renderer.setCursorStyle(l),this.setState("dragReady")},this.onMouseDrag=function(i){var s=this.editor.container;if(g.isIE&&this.state=="dragReady"){var l=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);l>3&&s.dragDrop()}if(this.state==="dragWait"){var l=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);l>0&&(s.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(i){if(this.$dragEnabled){this.mousedownEvent=i;var s=this.editor,l=i.inSelection(),h=i.getButton(),f=i.domEvent.detail||1;if(f===1&&h===0&&l){if(i.editor.inMultiSelectMode&&(i.getAccelKey()||i.getShiftKey()))return;this.mousedownEvent.time=Date.now();var b=i.domEvent.target||i.domEvent.srcElement;if("unselectable"in b&&(b.unselectable="on"),s.getDragDelay()){if(g.isWebKit){this.cancelDrag=!0;var C=s.container;C.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(i,this.onMouseDrag.bind(this)),i.defaultPrevented=!0}}}}).call(r.prototype);function n(i,s,l,h){return Math.sqrt(Math.pow(l-i,2)+Math.pow(h-s,2))}e.DragdropHandler=r});ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(t,e,c){"use strict";var d=t("./mouse_event").MouseEvent,p=t("../lib/event"),g=t("../lib/dom");e.addTouchListeners=function(a,u){var o="scroll",r,n,i,s,l,h,f=0,b,C=0,w=0,x=0,A,v;function E(){var m=window.navigator&&window.navigator.clipboard,L=!1,_=function(){var I=u.getCopyText(),R=u.session.getUndoManager().hasUndo();v.replaceChild(g.buildDom(L?["span",!I&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],I&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],I&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],m&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],R&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),v.firstChild)},k=function(I){var R=I.target.getAttribute("action");if(R=="more"||!L)return L=!L,_();R=="paste"?m.readText().then(function(D){u.execCommand(R,D)}):R&&((R=="cut"||R=="copy")&&(m?m.writeText(u.getCopyText()):document.execCommand("copy")),u.execCommand(R)),v.firstChild.style.display="none",L=!1,R!="openCommandPalette"&&u.focus()};v=g.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(I){o="menu",I.stopPropagation(),I.preventDefault(),u.textInput.focus()},ontouchend:function(I){I.stopPropagation(),I.preventDefault(),k(I)},onclick:k},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],u.container)}function $(){v||E();var m=u.selection.cursor,L=u.renderer.textToScreenCoordinates(m.row,m.column),_=u.renderer.textToScreenCoordinates(0,0).pageX,k=u.renderer.scrollLeft,I=u.container.getBoundingClientRect();v.style.top=L.pageY-I.top-3+"px",L.pageX-I.left=2?u.selection.getLineRange(b.row):u.session.getBracketRange(b);m&&!m.isEmpty()?u.selection.setRange(m):u.selection.selectWord(),o="wait"}p.addListener(a,"contextmenu",function(m){if(A){var L=u.textInput.getElement();L.focus()}},u),p.addListener(a,"touchstart",function(m){var L=m.touches;if(l||L.length>1){clearTimeout(l),l=null,i=-1,o="zoom";return}A=u.$mouseHandler.isMousePressed=!0;var _=u.renderer.layerConfig.lineHeight,k=u.renderer.layerConfig.lineHeight,I=m.timeStamp;s=I;var R=L[0],D=R.clientX,O=R.clientY;Math.abs(r-D)+Math.abs(n-O)>_&&(i=-1),r=m.clientX=D,n=m.clientY=O,w=x=0;var N=new d(m,u);if(b=N.getDocumentPosition(),I-i<500&&L.length==1&&!f)C++,m.preventDefault(),m.button=0,T();else{C=0;var P=u.selection.cursor,H=u.selection.isEmpty()?P:u.selection.anchor,F=u.renderer.$cursorLayer.getPixelPosition(P,!0),U=u.renderer.$cursorLayer.getPixelPosition(H,!0),j=u.renderer.scroller.getBoundingClientRect(),J=u.renderer.layerConfig.offset,z=u.renderer.scrollLeft,X=function(pe,ve){return pe=pe/k,ve=ve/_-.75,pe*pe+ve*ve};if(m.clientXZ?"cursor":"anchor"),Z<3.5?o="anchor":ee<3.5?o="cursor":o="scroll",l=setTimeout(S,450)}i=I},u),p.addListener(a,"touchend",function(m){A=u.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),o=="zoom"?(o="",f=0):l?(u.selection.moveToPosition(b),f=0,$()):o=="scroll"?(y(),M()):$(),clearTimeout(l),l=null},u),p.addListener(a,"touchmove",function(m){l&&(clearTimeout(l),l=null);var L=m.touches;if(!(L.length>1||o=="zoom")){var _=L[0],k=r-_.clientX,I=n-_.clientY;if(o=="wait")if(k*k+I*I>4)o="cursor";else return m.preventDefault();r=_.clientX,n=_.clientY,m.clientX=_.clientX,m.clientY=_.clientY;var R=m.timeStamp,D=R-s;if(s=R,o=="scroll"){var O=new d(m,u);O.speed=1,O.wheelX=k,O.wheelY=I,10*Math.abs(k)0)if(ne==16){for(te=se;te-1){for(te=se;te=0&&Z[he]==S;he--)X[he]=g}}}function F(z,X,ee){if(!(a=z){for(ve=pe+1;ve=z;)ve++;for(de=pe,B=ve-1;de=X.length||(ve=ee[Z-1])!=x&&ve!=A||(de=X[Z+1])!=x&&de!=A?v:(u&&(de=A),de==ve?de:v);case y:return ve=Z>0?ee[Z-1]:E,ve==x&&Z+10&&ee[Z-1]==x)return x;if(u)return v;for(K=Z+1,B=X.length;K=1425&&ne<=2303||ne==64286;if(ve=X[K],Q&&(ve==w||ve==M))return w}return Z<1||(ve=X[Z-1])==E?v:ee[Z-1];case E:return u=!1,r=!0,g;case $:return n=!0,v;case _:case k:case R:case D:case I:u=!1;case O:return v}}function j(z){var X=z.charCodeAt(0),ee=X>>8;return ee==0?X>191?C:N[X]:ee==5?/[\u0591-\u05f4]/.test(z)?w:C:ee==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(z)?L:/[\u0660-\u0669\u066b-\u066c]/.test(z)?A:X==1642?m:/[\u06f0-\u06f9]/.test(z)?x:M:ee==32&&X<=8287?P[X&255]:ee==254&&X>=65136?M:v}function J(z){return z>="\u064B"&&z<="\u0655"}e.L=C,e.R=w,e.EN=x,e.ON_R=3,e.AN=4,e.R_H=5,e.B=6,e.RLE=7,e.DOT="\xB7",e.doBidiReorder=function(z,X,ee){if(z.length<2)return{};var Z=z.split(""),pe=new Array(Z.length),ve=new Array(Z.length),de=[];g=ee?b:f,H(Z,de,Z.length,X);for(var B=0;BM&&X[B]<_||X[B]===v||X[B]===O)?de[B]=e.ON_R:B>0&&Z[B-1]==="\u0644"&&/\u0622|\u0623|\u0625|\u0627/.test(Z[B])&&(de[B-1]=de[B]=e.R_H,B++);Z[Z.length-1]===e.DOT&&(de[Z.length-1]=e.B),Z[0]==="\u202B"&&(de[0]=e.RLE);for(var B=0;B=0&&(o=this.session.$docRowCache[n])}return o},u.prototype.getSplitIndex=function(){var o=0,r=this.session.$screenRowCache;if(r.length)for(var n,i=this.session.$getRowCacheIndex(r,this.currentRow);this.currentRow-o>0&&(n=this.session.$getRowCacheIndex(r,this.currentRow-o-1),n===i);)i=n,o++;else o=this.currentRow;return o},u.prototype.updateRowLine=function(o,r){o===void 0&&(o=this.getDocumentRow());var n=o===this.session.getLength()-1,i=n?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(o),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[o];s&&(r===void 0&&(r=this.getSplitIndex()),r>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[d.L],this.line=rr?this.session.getOverwrite()?o:o-1:r,i=d.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,l=0;!this.session.getOverwrite()&&o<=r&&s[i]%2!==0&&i++;for(var h=0;hr&&s[i]%2===0&&(l+=this.charWidths[s[i]]),this.wrapIndent&&(l+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(l+=this.rtlLineOffset),l},u.prototype.getSelections=function(o,r){var n=this.bidiMap,i=n.bidiLevels,s,l=[],h=0,f=Math.min(o,r)-this.wrapIndent,b=Math.max(o,r)-this.wrapIndent,C=!1,w=!1,x=0;this.wrapIndent&&(h+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var A,v=0;v=f&&Ai+h/2;){if(i+=h,s===l.length-1){h=0;break}h=this.charWidths[l[++s]]}return s>0&&l[s-1]%2!==0&&l[s]%2===0?(n0&&l[s-1]%2===0&&l[s]%2!==0?r=1+(n>i?this.bidiMap.logicalFromVisual[s]:this.bidiMap.logicalFromVisual[s-1]):this.isRtlDir&&s===l.length-1&&h===0&&l[s-1]%2===0||!this.isRtlDir&&s===0&&l[s]%2!==0?r=1+this.bidiMap.logicalFromVisual[s]:(s>0&&l[s-1]%2!==0&&h!==0&&s--,r=this.bidiMap.logicalFromVisual[s]),r===0&&this.isRtlDir&&r++,r+this.wrapIndent},u}();e.BidiHandler=a});ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(t,e,c){"use strict";var d=t("./lib/oop"),p=t("./lib/lang"),g=t("./lib/event_emitter").EventEmitter,a=t("./range").Range,u=function(){function o(r){this.session=r,this.doc=r.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var n=this;this.cursor.on("change",function(i){n.$cursorChanged=!0,n.$silent||n._emit("changeCursor"),!n.$isEmpty&&!n.$silent&&n._emit("changeSelection"),!n.$keepDesiredColumnOnChange&&i.old.column!=i.value.column&&(n.$desiredColumn=null)}),this.anchor.on("change",function(){n.$anchorChanged=!0,!n.$isEmpty&&!n.$silent&&n._emit("changeSelection")})}return o.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},o.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},o.prototype.getCursor=function(){return this.lead.getPosition()},o.prototype.setAnchor=function(r,n){this.$isEmpty=!1,this.anchor.setPosition(r,n)},o.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},o.prototype.getSelectionLead=function(){return this.lead.getPosition()},o.prototype.isBackwards=function(){var r=this.anchor,n=this.lead;return r.row>n.row||r.row==n.row&&r.column>n.column},o.prototype.getRange=function(){var r=this.anchor,n=this.lead;return this.$isEmpty?a.fromPoints(n,n):this.isBackwards()?a.fromPoints(n,r):a.fromPoints(r,n)},o.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},o.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},o.prototype.setRange=function(r,n){var i=n?r.end:r.start,s=n?r.start:r.end;this.$setSelection(i.row,i.column,s.row,s.column)},o.prototype.$setSelection=function(r,n,i,s){if(!this.$silent){var l=this.$isEmpty,h=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(r,n),this.cursor.setPosition(i,s),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||l!=this.$isEmpty||h)&&this._emit("changeSelection")}},o.prototype.$moveSelection=function(r){var n=this.lead;this.$isEmpty&&this.setSelectionAnchor(n.row,n.column),r.call(this)},o.prototype.selectTo=function(r,n){this.$moveSelection(function(){this.moveCursorTo(r,n)})},o.prototype.selectToPosition=function(r){this.$moveSelection(function(){this.moveCursorToPosition(r)})},o.prototype.moveTo=function(r,n){this.clearSelection(),this.moveCursorTo(r,n)},o.prototype.moveToPosition=function(r){this.clearSelection(),this.moveCursorToPosition(r)},o.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},o.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},o.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},o.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},o.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},o.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},o.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},o.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},o.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},o.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},o.prototype.getWordRange=function(r,n){if(typeof n>"u"){var i=r||this.lead;r=i.row,n=i.column}return this.session.getWordRange(r,n)},o.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},o.prototype.selectAWord=function(){var r=this.getCursor(),n=this.session.getAWordRange(r.row,r.column);this.setSelectionRange(n)},o.prototype.getLineRange=function(r,n){var i=typeof r=="number"?r:this.lead.row,s,l=this.session.getFoldLine(i);return l?(i=l.start.row,s=l.end.row):s=i,n===!0?new a(i,0,s,this.session.getLine(s).length):new a(i,0,s+1,0)},o.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},o.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},o.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},o.prototype.wouldMoveIntoSoftTab=function(r,n,i){var s=r.column,l=r.column+n;return i<0&&(s=r.column-n,l=r.column),this.session.isTabStop(r)&&this.doc.getLine(r.row).slice(s,l).split(" ").length-1==n},o.prototype.moveCursorLeft=function(){var r=this.lead.getPosition(),n;if(n=this.session.getFoldAt(r.row,r.column,-1))this.moveCursorTo(n.start.row,n.start.column);else if(r.column===0)r.row>0&&this.moveCursorTo(r.row-1,this.doc.getLine(r.row-1).length);else{var i=this.session.getTabSize();this.wouldMoveIntoSoftTab(r,i,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},o.prototype.moveCursorRight=function(){var r=this.lead.getPosition(),n;if(n=this.session.getFoldAt(r.row,r.column,1))this.moveCursorTo(n.end.row,n.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(n.column=s)}}this.moveCursorTo(n.row,n.column)},o.prototype.moveCursorFileEnd=function(){var r=this.doc.getLength()-1,n=this.doc.getLine(r).length;this.moveCursorTo(r,n)},o.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},o.prototype.moveCursorLongWordRight=function(){var r=this.lead.row,n=this.lead.column,i=this.doc.getLine(r),s=i.substring(n);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var l=this.session.getFoldAt(r,n,1);if(l){this.moveCursorTo(l.end.row,l.end.column);return}if(this.session.nonTokenRe.exec(s)&&(n+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,s=i.substring(n)),n>=i.length){this.moveCursorTo(r,i.length),this.moveCursorRight(),r0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(l)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(r,n)},o.prototype.$shortWordEndIndex=function(r){var n=0,i,s=/\s/,l=this.session.tokenRe;if(l.lastIndex=0,this.session.tokenRe.exec(r))n=this.session.tokenRe.lastIndex;else{for(;(i=r[n])&&s.test(i);)n++;if(n<1){for(l.lastIndex=0;(i=r[n])&&!l.test(i);)if(l.lastIndex=0,n++,s.test(i))if(n>2){n--;break}else{for(;(i=r[n])&&s.test(i);)n++;if(n>2)break}}}return l.lastIndex=0,n},o.prototype.moveCursorShortWordRight=function(){var r=this.lead.row,n=this.lead.column,i=this.doc.getLine(r),s=i.substring(n),l=this.session.getFoldAt(r,n,1);if(l)return this.moveCursorTo(l.end.row,l.end.column);if(n==i.length){var h=this.doc.getLength();do r++,s=this.doc.getLine(r);while(r0&&/^\s*$/.test(s));n=s.length,/\s+$/.test(s)||(s="")}var l=p.stringReverse(s),h=this.$shortWordEndIndex(l);return this.moveCursorTo(r,n-h)},o.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},o.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},o.prototype.moveCursorBy=function(r,n){var i=this.session.documentToScreenPosition(this.lead.row,this.lead.column),s;if(n===0&&(r!==0&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(s=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(s/this.session.$bidiHandler.charWidths[0])):s=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),r!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var l=this.session.lineWidgets[this.lead.row];r<0?r-=l.rowsAbove||0:r>0&&(r+=l.rowCount-(l.rowsAbove||0))}var h=this.session.screenToDocumentPosition(i.row+r,i.column,s);r!==0&&n===0&&h.row===this.lead.row&&(h.column,this.lead.column),this.moveCursorTo(h.row,h.column+n,n===0)},o.prototype.moveCursorToPosition=function(r){this.moveCursorTo(r.row,r.column)},o.prototype.moveCursorTo=function(r,n,i){var s=this.session.getFoldAt(r,n,1);s&&(r=s.start.row,n=s.start.column),this.$keepDesiredColumnOnChange=!0;var l=this.session.getLine(r);/[\uDC00-\uDFFF]/.test(l.charAt(n))&&l.charAt(n-1)&&(this.lead.row==r&&this.lead.column==n+1?n=n-1:n=n+1),this.lead.setPosition(r,n),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},o.prototype.moveCursorToScreen=function(r,n,i){var s=this.session.screenToDocumentPosition(r,n);this.moveCursorTo(s.row,s.column,i)},o.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},o.prototype.fromOrientedRange=function(r){this.setSelectionRange(r,r.cursor==r.start),this.$desiredColumn=r.desiredColumn||this.$desiredColumn},o.prototype.toOrientedRange=function(r){var n=this.getRange();return r?(r.start.column=n.start.column,r.start.row=n.start.row,r.end.column=n.end.column,r.end.row=n.end.row):r=n,r.cursor=this.isBackwards()?r.start:r.end,r.desiredColumn=this.$desiredColumn,r},o.prototype.getRangeOfMovements=function(r){var n=this.getCursor();try{r(this);var i=this.getCursor();return a.fromPoints(n,i)}catch{return a.fromPoints(n,n)}finally{this.moveCursorToPosition(n)}},o.prototype.toJSON=function(){if(this.rangeCount)var r=this.ranges.map(function(n){var i=n.clone();return i.isBackwards=n.cursor==n.start,i});else{var r=this.getRange();r.isBackwards=this.isBackwards()}return r},o.prototype.fromJSON=function(r){if(r.start==null)if(this.rangeList&&r.length>1){this.toSingleRange(r[0]);for(var n=r.length;n--;){var i=a.fromPoints(r[n].start,r[n].end);r[n].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}else r=r[0];this.rangeList&&this.toSingleRange(r),this.setSelectionRange(r,r.isBackwards)},o.prototype.isEqual=function(r){if((r.length||this.rangeCount)&&r.length!=this.rangeCount)return!1;if(!r.length||!this.ranges)return this.getRange().isEqual(r);for(var n=this.ranges.length;n--;)if(!this.ranges[n].isEqual(r[n]))return!1;return!0},o}();u.prototype.setSelectionAnchor=u.prototype.setAnchor,u.prototype.getSelectionAnchor=u.prototype.getAnchor,u.prototype.setSelectionRange=u.prototype.setRange,d.implement(u.prototype,g),e.Selection=u});ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(t,e,c){"use strict";var d=t("./lib/report_error").reportError,p=2e3,g=function(){function a(u){this.splitRegex,this.states=u,this.regExps={},this.matchMappings={};for(var o in this.states){for(var r=this.states[o],n=[],i=0,s=this.matchMappings[o]={defaultToken:"text"},l="g",h=[],f=0;f1?b.onMatch=this.$applyToken:b.onMatch=b.token),w>1&&(/\\\d/.test(b.regex)?C=b.regex.replace(/\\([0-9]+)/g,function(x,A){return"\\"+(parseInt(A,10)+i+1)}):(w=1,C=this.removeCapturingGroups(b.regex)),!b.splitRegex&&typeof b.token!="string"&&h.push(b)),s[i]=f,i+=w,n.push(C),b.onMatch||(b.onMatch=null)}}n.length||(s[0]=0,n.push("$")),h.forEach(function(x){x.splitRegex=this.createSplitterRegexp(x.regex,l)},this),this.regExps[o]=new RegExp("("+n.join(")|(")+")|($)",l)}}return a.prototype.$setMaxTokenCount=function(u){p=u|0},a.prototype.$applyToken=function(u){var o=this.splitRegex.exec(u).slice(1),r=this.token.apply(this,o);if(typeof r=="string")return[{type:r,value:u}];for(var n=[],i=0,s=r.length;ib){var $=u.substring(b,E-v.length);w.type==x?w.value+=$:(w.type&&f.push(w),w={type:x,value:$})}for(var M=0;Mp){for(C>2*u.length&&this.reportError("infinite loop with in ace tokenizer",{startState:o,line:u});b1&&r[0]!==n&&r.unshift("#tmp",n),{tokens:f,state:r.length?r:n}},a}();g.prototype.reportError=d,e.Tokenizer=g});ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(t,e,c){"use strict";var d=t("../lib/deep_copy").deepCopy,p;p=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},function(){this.addRules=function(u,o){if(!o){for(var r in u)this.$rules[r]=u[r];return}for(var r in u){for(var n=u[r],i=0;i=this.$rowTokens.length;){if(this.$row+=1,a||(a=this.$session.getLength()),this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},g.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},g.prototype.getCurrentTokenRow=function(){return this.$row},g.prototype.getCurrentTokenColumn=function(){var a=this.$rowTokens,u=this.$tokenIndex,o=a[u].start;if(o!==void 0)return o;for(o=0;u>0;)u-=1,o+=a[u].value.length;return o},g.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},g.prototype.getCurrentTokenRange=function(){var a=this.$rowTokens[this.$tokenIndex],u=this.getCurrentTokenColumn();return new d(this.$row,u,this.$row,u+a.value.length)},g}();e.TokenIterator=p});ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,e,c){"use strict";var d=t("../../lib/oop"),p=t("../behaviour").Behaviour,g=t("../../token_iterator").TokenIterator,a=t("../../lib/lang"),u=["text","paren.rparen","rparen","paren","punctuation.operator"],o=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],r,n={},i={'"':'"',"'":"'"},s=function(f){var b=-1;if(f.multiSelect&&(b=f.selection.index,n.rangeCount!=f.multiSelect.rangeCount&&(n={rangeCount:f.multiSelect.rangeCount})),n[b])return r=n[b];r=n[b]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},l=function(f,b,C,w){var x=f.end.row-f.start.row;return{text:C+b+w,selection:[0,f.start.column+1,x,f.end.column+(x?0:1)]}},h;h=function(f){f=f||{},this.add("braces","insertion",function(b,C,w,x,A){var v=w.getCursorPosition(),E=x.doc.getLine(v.row);if(A=="{"){s(w);var $=w.getSelectionRange(),M=x.doc.getTextRange($);if(M!==""&&M!=="{"&&w.getWrapBehavioursEnabled())return l($,M,"{","}");if(h.isSaneInsertion(w,x))return/[\]\}\)]/.test(E[v.column])||w.inMultiSelectMode||f.braces?(h.recordAutoInsert(w,x,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(w,x,"{"),{text:"{",selection:[1,1]})}else if(A=="}"){s(w);var S=E.substring(v.column,v.column+1);if(S=="}"){var T=x.$findOpeningBracket("}",{column:v.column+1,row:v.row});if(T!==null&&h.isAutoInsertedClosing(v,E,A))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(A==` -`||A==`\r -`){s(w);var y="";h.isMaybeInsertedClosing(v,E)&&(y=a.stringRepeat("}",r.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var S=E.substring(v.column,v.column+1);if(S==="}"){var m=x.findMatchingBracket({row:v.row,column:v.column+1},"}");if(!m)return null;var L=this.$getIndent(x.getLine(m.row))}else if(y)var L=this.$getIndent(E);else{h.clearMaybeInsertedClosing();return}var _=L+x.getTabString();return{text:` -`+_+` -`+L+y,selection:[1,_.length,1,_.length]}}else h.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(b,C,w,x,A){var v=x.doc.getTextRange(A);if(!A.isMultiLine()&&v=="{"){s(w);var E=x.doc.getLine(A.start.row),$=E.substring(A.end.column,A.end.column+1);if($=="}")return A.end.column++,A;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(b,C,w,x,A){if(A=="("){s(w);var v=w.getSelectionRange(),E=x.doc.getTextRange(v);if(E!==""&&w.getWrapBehavioursEnabled())return l(v,E,"(",")");if(h.isSaneInsertion(w,x))return h.recordAutoInsert(w,x,")"),{text:"()",selection:[1,1]}}else if(A==")"){s(w);var $=w.getCursorPosition(),M=x.doc.getLine($.row),S=M.substring($.column,$.column+1);if(S==")"){var T=x.$findOpeningBracket(")",{column:$.column+1,row:$.row});if(T!==null&&h.isAutoInsertedClosing($,M,A))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(b,C,w,x,A){var v=x.doc.getTextRange(A);if(!A.isMultiLine()&&v=="("){s(w);var E=x.doc.getLine(A.start.row),$=E.substring(A.start.column+1,A.start.column+2);if($==")")return A.end.column++,A}}),this.add("brackets","insertion",function(b,C,w,x,A){if(A=="["){s(w);var v=w.getSelectionRange(),E=x.doc.getTextRange(v);if(E!==""&&w.getWrapBehavioursEnabled())return l(v,E,"[","]");if(h.isSaneInsertion(w,x))return h.recordAutoInsert(w,x,"]"),{text:"[]",selection:[1,1]}}else if(A=="]"){s(w);var $=w.getCursorPosition(),M=x.doc.getLine($.row),S=M.substring($.column,$.column+1);if(S=="]"){var T=x.$findOpeningBracket("]",{column:$.column+1,row:$.row});if(T!==null&&h.isAutoInsertedClosing($,M,A))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(b,C,w,x,A){var v=x.doc.getTextRange(A);if(!A.isMultiLine()&&v=="["){s(w);var E=x.doc.getLine(A.start.row),$=E.substring(A.start.column+1,A.start.column+2);if($=="]")return A.end.column++,A}}),this.add("string_dquotes","insertion",function(b,C,w,x,A){var v=x.$mode.$quotes||i;if(A.length==1&&v[A]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(A)!=-1)return;s(w);var E=A,$=w.getSelectionRange(),M=x.doc.getTextRange($);if(M!==""&&(M.length!=1||!v[M])&&w.getWrapBehavioursEnabled())return l($,M,E,E);if(!M){var S=w.getCursorPosition(),T=x.doc.getLine(S.row),y=T.substring(S.column-1,S.column),m=T.substring(S.column,S.column+1),L=x.getTokenAt(S.row,S.column),_=x.getTokenAt(S.row,S.column+1);if(y=="\\"&&L&&/escape/.test(L.type))return null;var k=L&&/string|escape/.test(L.type),I=!_||/string|escape/.test(_.type),R;if(m==E)R=k!==I,R&&/string\.end/.test(_.type)&&(R=!1);else{if(k&&!I||k&&I)return null;var D=x.$mode.tokenRe;D.lastIndex=0;var O=D.test(y);D.lastIndex=0;var N=D.test(m),P=x.$mode.$pairQuotesAfter,H=P&&P[E]&&P[E].test(y);if(!H&&O||N||m&&!/[\s;,.})\]\\]/.test(m))return null;var F=T[S.column-2];if(y==E&&(F==E||D.test(F)))return null;R=!0}return{text:R?E+E:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(b,C,w,x,A){var v=x.$mode.$quotes||i,E=x.doc.getTextRange(A);if(!A.isMultiLine()&&v.hasOwnProperty(E)){s(w);var $=x.doc.getLine(A.start.row),M=$.substring(A.start.column+1,A.start.column+2);if(M==E)return A.end.column++,A}}),f.closeDocComment!==!1&&this.add("doc comment end","insertion",function(b,C,w,x,A){if(b==="doc-start"&&(A===` -`||A===`\r -`)&&w.selection.isEmpty()){var v=w.getCursorPosition(),E=x.doc.getLine(v.row),$=x.doc.getLine(v.row+1),M=this.$getIndent(E);if(/\s*\*/.test($))return/^\s*\*/.test(E)?{text:A+M+"* ",selection:[1,3+M.length,1,3+M.length]}:{text:A+M+" * ",selection:[1,3+M.length,1,3+M.length]};if(/\/\*\*/.test(E.substring(0,v.column)))return{text:A+M+" * "+A+" "+M+"*/",selection:[1,4+M.length,1,4+M.length]}}})},h.isSaneInsertion=function(f,b){var C=f.getCursorPosition(),w=new g(b,C.row,C.column);if(!this.$matchTokenType(w.getCurrentToken()||"text",u)){if(/[)}\]]/.test(f.session.getLine(C.row)[C.column]))return!0;var x=new g(b,C.row,C.column+1);if(!this.$matchTokenType(x.getCurrentToken()||"text",u))return!1}return w.stepForward(),w.getCurrentTokenRow()!==C.row||this.$matchTokenType(w.getCurrentToken()||"text",o)},h.$matchTokenType=function(f,b){return b.indexOf(f.type||f)>-1},h.recordAutoInsert=function(f,b,C){var w=f.getCursorPosition(),x=b.doc.getLine(w.row);this.isAutoInsertedClosing(w,x,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=w.row,r.autoInsertedLineEnd=C+x.substr(w.column),r.autoInsertedBrackets++},h.recordMaybeInsert=function(f,b,C){var w=f.getCursorPosition(),x=b.doc.getLine(w.row);this.isMaybeInsertedClosing(w,x)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=w.row,r.maybeInsertedLineStart=x.substr(0,w.column)+C,r.maybeInsertedLineEnd=x.substr(w.column),r.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(f,b,C){return r.autoInsertedBrackets>0&&f.row===r.autoInsertedRow&&C===r.autoInsertedLineEnd[0]&&b.substr(f.column)===r.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(f,b){return r.maybeInsertedBrackets>0&&f.row===r.maybeInsertedRow&&b.substr(f.column)===r.maybeInsertedLineEnd&&b.substr(0,f.column)==r.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},d.inherits(h,p),e.CstyleBehaviour=h});ace.define("ace/unicode",["require","exports","module"],function(t,e,c){"use strict";for(var d=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],p=0,g=[],a=0;a2?F%A!=A-1:F%A==0}}else{if(!this.blockComment)return!1;var E=this.blockComment.start,$=this.blockComment.end,M=new RegExp("^(\\s*)(?:"+o.escapeRegExp(E)+")"),S=new RegExp("(?:"+o.escapeRegExp($)+")\\s*$"),T=function(R,D){m(R,D)||(!C||/\S/.test(R))&&(b.insertInLine({row:D,column:R.length},$),b.insertInLine({row:D,column:x},E))},y=function(R,D){var O;(O=R.match(S))&&b.removeInLine(D,R.length-O[0].length,R.length),(O=R.match(M))&&b.removeInLine(D,O[1].length,O[0].length)},m=function(R,D){if(M.test(R))return!0;for(var O=l.getTokens(D),N=0;NR.length&&(I=R.length)}),x==1/0&&(x=I,C=!1,w=!1),v&&x%A!=0&&(x=Math.floor(x/A)*A),k(w?y:T)},this.toggleBlockComment=function(s,l,h,f){var b=this.blockComment;if(b){!b.start&&b[0]&&(b=b[0]);var C=new r(l,f.row,f.column),w=C.getCurrentToken(),x=l.selection,A=l.selection.toOrientedRange(),v,E;if(w&&/comment/.test(w.type)){for(var $,M;w&&/comment/.test(w.type);){var S=w.value.indexOf(b.start);if(S!=-1){var T=C.getCurrentTokenRow(),y=C.getCurrentTokenColumn()+S;$=new n(T,y,T,y+b.start.length);break}w=C.stepBackward()}for(var C=new r(l,f.row,f.column),w=C.getCurrentToken();w&&/comment/.test(w.type);){var S=w.value.indexOf(b.end);if(S!=-1){var T=C.getCurrentTokenRow(),y=C.getCurrentTokenColumn()+S;M=new n(T,y,T,y+b.end.length);break}w=C.stepForward()}M&&l.remove(M),$&&(l.remove($),v=$.start.row,E=-b.start.length)}else E=b.start.length,v=h.start.row,l.insert(h.end,b.end),l.insert(h.start,b.start);A.start.row==v&&(A.start.column+=E),A.end.row==v&&(A.end.column+=E),l.selection.fromOrientedRange(A)}},this.getNextLineIndent=function(s,l,h){return this.$getIndent(l)},this.checkOutdent=function(s,l,h){return!1},this.autoOutdent=function(s,l,h){},this.$getIndent=function(s){return s.match(/^\s*/)[0]},this.createWorker=function(s){return null},this.createModeDelegates=function(s){this.$embeds=[],this.$modes={};for(var l in s)if(s[l]){var h=s[l],f=h.prototype.$id,b=d.$modes[f];b||(d.$modes[f]=b=new h),d.$modes[l]||(d.$modes[l]=b),this.$embeds.push(l),this.$modes[l]=b}for(var C=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],w=function(A){(function(v){var E=C[A],$=v[E];v[C[A]]=function(){return this.$delegator(E,arguments,$)}})(x)},x=this,l=0;l=0&&u.row=0&&u.column<=a[u.row].length}function g(a,u){u.action!="insert"&&u.action!="remove"&&d(u,"delta.action must be 'insert' or 'remove'"),u.lines instanceof Array||d(u,"delta.lines must be an Array"),(!u.start||!u.end)&&d(u,"delta.start/end must be an present");var o=u.start;p(a,u.start)||d(u,"delta.start must be contained in document");var r=u.end;u.action=="remove"&&!p(a,r)&&d(u,"delta.end must contained in document for 'remove' actions");var n=r.row-o.row,i=r.column-(n==0?o.column:0);(n!=u.lines.length-1||u.lines[n].length!=i)&&d(u,"delta.range must match delta lines")}e.applyDelta=function(a,u,o){var r=u.start.row,n=u.start.column,i=a[r]||"";switch(u.action){case"insert":var s=u.lines;if(s.length===1)a[r]=i.substring(0,n)+u.lines[0]+i.substring(n);else{var l=[r,1].concat(u.lines);a.splice.apply(a,l),a[r]=i.substring(0,n)+a[r],a[r+u.lines.length-1]+=i.substring(n)}break;case"remove":var h=u.end.column,f=u.end.row;r===f?a[r]=i.substring(0,n)+i.substring(h):a.splice(r,f-r+1,i.substring(0,n)+a[f].substring(h));break}}});ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,e,c){"use strict";var d=t("./lib/oop"),p=t("./lib/event_emitter").EventEmitter,g=function(){function o(r,n,i){this.$onChange=this.onChange.bind(this),this.attach(r),typeof n!="number"?this.setPosition(n.row,n.column):this.setPosition(n,i)}return o.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},o.prototype.getDocument=function(){return this.document},o.prototype.onChange=function(r){if(!(r.start.row==r.end.row&&r.start.row!=this.row)&&!(r.start.row>this.row)){var n=u(r,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},o.prototype.setPosition=function(r,n,i){var s;if(i?s={row:r,column:n}:s=this.$clipPositionToDocument(r,n),!(this.row==s.row&&this.column==s.column)){var l={row:this.row,column:this.column};this.row=s.row,this.column=s.column,this._signal("change",{old:l,value:s})}},o.prototype.detach=function(){this.document.off("change",this.$onChange)},o.prototype.attach=function(r){this.document=r||this.document,this.document.on("change",this.$onChange)},o.prototype.$clipPositionToDocument=function(r,n){var i={};return r>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):r<0?(i.row=0,i.column=0):(i.row=r,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,n))),n<0&&(i.column=0),i},o}();g.prototype.$insertRight=!1,d.implement(g.prototype,p);function a(o,r,n){var i=n?o.column<=r.column:o.columnD+1)&&(I=Ce>O?Ce-O:0,D=Ce>O?Ce+O:2*O);for(var Re=[],Oe=I;Oe<=D;Oe++)Re.push(_.session.getLine(Oe));if(ne=Re.join(` +`),W=P(_e.start.row,_e.start.column),G=P(_e.end.row,_e.end.column),_e.start.rowD){var ke=_.session.getLine(D+1);G=_e.end.row>D+1?ke.length:_e.end.column,G+=ne.length+1,ne=ne+` +`+ke}else C&&Ce>0&&(ne=` +`+ne,G+=1,W+=1);ne.length>s&&(W=$.length&&W.value===$&&$&&W.selectionEnd!==k},V=function(W){M||(T?T=!1:H(v)?(_.selectAll(),B()):C&&v.selectionStart!=A&&B())},z=null;this.setInputHandler=function(W){z=W},this.getInputHandler=function(){return z};var Z=!1,K=function(W,G){if(Z&&(Z=!1),L)return B(),W&&_.onPaste(W),L=!1,"";for(var ne=v.selectionStart,me=v.selectionEnd,_e=A,Ce=$.length-k,Re=W,Oe=W.length-ne,Fe=W.length-me,ke=0;_e>0&&$[ke]==W[ke];)ke++,_e--;for(Re=Re.slice(ke),ke=1;Ce>0&&$.length-ke>A-1&&$[$.length-ke]==W[W.length-ke];)ke++,Ce--;Oe-=ke-1,Fe-=ke-1;var We=Re.length-ke+1;if(We<0&&(_e=-We,We=0),Re=Re.slice(0,We),!G&&!Re&&!Oe&&!_e&&!Ce&&!Fe)return"";E=!0;var tn=!1;return g.isAndroid&&Re==". "&&(Re=" ",tn=!0),Re&&!_e&&!Ce&&!Oe&&!Fe||y?_.onTextInput(Re):_.onTextInput(Re,{extendLeft:_e,extendRight:Ce,restoreStart:Oe,restoreEnd:Fe}),E=!1,$=W,A=ne,k=me,R=Fe,tn?` +`:Re},q=function(W){if(M)return Y();if(W&&W.inputType){if(W.inputType=="historyUndo")return _.execCommand("undo");if(W.inputType=="historyRedo")return _.execCommand("redo")}var G=v.value,ne=K(G,!0);(G.length>s+100||b.test(ne)||C&&A<1&&A==k)&&B()},oe=function(W,G,ne){var me=W.clipboardData||window.clipboardData;if(!(!me||r)){var _e=n||ne?"Text":"text/plain";try{return G?me.setData(_e,G)!==!1:me.getData(_e)}catch(Ce){if(!ne)return oe(Ce,G,!0)}}},ie=function(W,G){var ne=_.getCopyText();if(!ne)return d.preventDefault(W);oe(W,ne)?(f&&(B(ne),T=ne,setTimeout(function(){T=!1},10)),G?_.onCut():_.onCopy(),d.preventDefault(W)):(T=!0,v.value=ne,v.select(),setTimeout(function(){T=!1,B(),G?_.onCut():_.onCopy()}))},ye=function(W){ie(W,!0)},Ee=function(W){ie(W,!1)},be=function(W){var G=oe(W);o.pasteCancelled()||(typeof G=="string"?(G&&_.onPaste(G,W),g.isIE&&setTimeout(B),d.preventDefault(W)):(v.value="",L=!0))};d.addCommandKeyListener(v,_.onCommandKey.bind(_),_),d.addListener(v,"select",V,_),d.addListener(v,"input",q,_),d.addListener(v,"cut",ye,_),d.addListener(v,"copy",Ee,_),d.addListener(v,"paste",be,_),(!("oncut"in v)||!("oncopy"in v)||!("onpaste"in v))&&d.addListener(x,"keydown",function(W){if(!(g.isMac&&!W.metaKey||!W.ctrlKey))switch(W.keyCode){case 67:Ee(W);break;case 86:be(W);break;case 88:ye(W);break}},_);var U=function(W){if(!(M||!_.onCompositionStart||_.$readOnly)&&(M={},!y)){W.data&&(M.useTextareaForIME=!1),setTimeout(Y,0),_._signal("compositionStart"),_.on("mousedown",te);var G=_.getSelectionRange();G.end.row=G.start.row,G.end.column=G.start.column,M.markerRange=G,M.selectionStart=A,_.onCompositionStart(M),M.useTextareaForIME?($=v.value="",A=0,k=0):(v.msGetInputContext&&(M.context=v.msGetInputContext()),v.getInputContext&&(M.context=v.getInputContext()))}},Y=function(){if(!(!M||!_.onCompositionUpdate||_.$readOnly)){if(y)return te();if(M.useTextareaForIME)_.onCompositionUpdate(v.value);else{var W=v.value;K(W),M.markerRange&&(M.context&&(M.markerRange.start.column=M.selectionStart=M.context.compositionStartOffset),M.markerRange.end.column=M.markerRange.start.column+k-M.selectionStart+R)}}},ae=function(W){!_.onCompositionEnd||_.$readOnly||(M=!1,_.onCompositionEnd(),_.off("mousedown",te),W&&q())};function te(){m=!0,v.blur(),v.focus(),m=!1}var de=u.delayedCall(Y,50).schedule.bind(null,null);function se(W){W.keyCode==27&&v.value.lengthk&&$[Fe]==` +`?ke=l.end:Oek&&$.slice(0,Fe).split(` +`).length>2?ke=l.down:Fe>k&&$[Fe-1]==" "?(ke=l.right,We=h.option):(Fe>k||Fe==k&&k!=A&&Oe==Fe)&&(ke=l.right),Oe!==Fe&&(We|=h.shift),ke){var tn=G.onCommandKey({},We,ke);if(!tn&&G.commands){ke=l.keyCodeToString(ke);var ht=G.commands.findKeyCommand(We,ke);ht&&G.execCommand(ht)}A=Oe,k=Fe,B("")}}};document.addEventListener("selectionchange",Ce),G.on("destroy",function(){document.removeEventListener("selectionchange",Ce)})}this.destroy=function(){v.parentElement&&v.parentElement.removeChild(v)}},e.TextInput=w,e.$setUserAgentForTests=function(x,_){C=x,f=_}});ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,e,c){"use strict";var d=t("../lib/useragent"),p=0,g=550,a=function(){function r(n){n.$clickSelection=null;var i=n.editor;i.setDefaultHandler("mousedown",this.onMouseDown.bind(n)),i.setDefaultHandler("dblclick",this.onDoubleClick.bind(n)),i.setDefaultHandler("tripleclick",this.onTripleClick.bind(n)),i.setDefaultHandler("quadclick",this.onQuadClick.bind(n)),i.setDefaultHandler("mousewheel",this.onMouseWheel.bind(n));var s=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];s.forEach(function(l){n[l]=this[l]},this),n.selectByLines=this.extendSelectionBy.bind(n,"getLineRange"),n.selectByWords=this.extendSelectionBy.bind(n,"getWordRange")}return r.prototype.onMouseDown=function(n){var i=n.inSelection(),s=n.getDocumentPosition();this.mousedownEvent=n;var l=this.editor,h=n.getButton();if(h!==0){var f=l.getSelectionRange(),b=f.isEmpty();(b||h==1)&&l.selection.moveToPosition(s),h==2&&(l.textInput.onContextMenu(n.domEvent),d.isMozilla||n.preventDefault());return}if(this.mousedownEvent.time=Date.now(),i&&!l.isFocused()&&(l.focus(),this.$focusTimeout&&!this.$clickSelection&&!l.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(n);return}return this.captureMouse(n),this.startSelect(s,n.domEvent._clicks>1),n.preventDefault()},r.prototype.startSelect=function(n,i){n=n||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var s=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?s.selection.selectToPosition(n):i||s.selection.moveToPosition(n),i||this.select(),s.setStyle("ace_selecting"),this.setState("select"))},r.prototype.select=function(){var n,i=this.editor,s=i.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var l=this.$clickSelection.comparePoint(s);if(l==-1)n=this.$clickSelection.end;else if(l==1)n=this.$clickSelection.start;else{var h=o(this.$clickSelection,s);s=h.cursor,n=h.anchor}i.selection.setSelectionAnchor(n.row,n.column)}i.selection.selectToPosition(s),i.renderer.scrollCursorIntoView()},r.prototype.extendSelectionBy=function(n){var i,s=this.editor,l=s.renderer.screenToTextCoordinates(this.x,this.y),h=s.selection[n](l.row,l.column);if(this.$clickSelection){var f=this.$clickSelection.comparePoint(h.start),b=this.$clickSelection.comparePoint(h.end);if(f==-1&&b<=0)i=this.$clickSelection.end,(h.end.row!=l.row||h.end.column!=l.column)&&(l=h.start);else if(b==1&&f>=0)i=this.$clickSelection.start,(h.start.row!=l.row||h.start.column!=l.column)&&(l=h.end);else if(f==-1&&b==1)l=h.end,i=h.start;else{var C=o(this.$clickSelection,l);l=C.cursor,i=C.anchor}s.selection.setSelectionAnchor(i.row,i.column)}s.selection.selectToPosition(l),s.renderer.scrollCursorIntoView()},r.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},r.prototype.focusWait=function(){var n=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),i=Date.now();(n>p||i-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},r.prototype.onDoubleClick=function(n){var i=n.getDocumentPosition(),s=this.editor,l=s.session,h=l.getBracketRange(i);h?(h.isEmpty()&&(h.start.column--,h.end.column++),this.setState("select")):(h=s.selection.getWordRange(i.row,i.column),this.setState("selectByWords")),this.$clickSelection=h,this.select()},r.prototype.onTripleClick=function(n){var i=n.getDocumentPosition(),s=this.editor;this.setState("selectByLines");var l=s.getSelectionRange();l.isMultiLine()&&l.contains(i.row,i.column)?(this.$clickSelection=s.selection.getLineRange(l.start.row),this.$clickSelection.end=s.selection.getLineRange(l.end.row).end):this.$clickSelection=s.selection.getLineRange(i.row),this.select()},r.prototype.onQuadClick=function(n){var i=this.editor;i.selectAll(),this.$clickSelection=i.getSelectionRange(),this.setState("selectAll")},r.prototype.onMouseWheel=function(n){if(!n.getAccelKey()){n.getShiftKey()&&n.wheelY&&!n.wheelX&&(n.wheelX=n.wheelY,n.wheelY=0);var i=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var s=this.$lastScroll,l=n.domEvent.timeStamp,h=l-s.t,f=h?n.wheelX/h:s.vx,b=h?n.wheelY/h:s.vy;h=1&&i.renderer.isScrollableBy(n.wheelX*n.speed,0)&&(w=!0),C<=1&&i.renderer.isScrollableBy(0,n.wheelY*n.speed)&&(w=!0),w)s.allowed=l;else if(l-s.allowedg.clientHeight;a||p.preventDefault()}});ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(t,e,c){"use strict";var d=this&&this.__extends||function(){var h=function(f,b){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,w){C.__proto__=w}||function(C,w){for(var x in w)Object.prototype.hasOwnProperty.call(w,x)&&(C[x]=w[x])},h(f,b)};return function(f,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");h(f,b);function C(){this.constructor=f}f.prototype=b===null?Object.create(b):(C.prototype=b.prototype,new C)}}(),p=this&&this.__values||function(h){var f=typeof Symbol=="function"&&Symbol.iterator,b=f&&h[f],C=0;if(b)return b.call(h);if(h&&typeof h.length=="number")return{next:function(){return h&&C>=h.length&&(h=void 0),{value:h&&h[C++],done:!h}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},g=t("./lib/dom"),a=t("./lib/event"),u=t("./range").Range,o=t("./lib/scroll").preventParentScroll,r="ace_tooltip",n=function(){function h(f){this.isOpen=!1,this.$element=null,this.$parentNode=f}return h.prototype.$init=function(){return this.$element=g.createElement("div"),this.$element.className=r,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},h.prototype.getElement=function(){return this.$element||this.$init()},h.prototype.setText=function(f){this.getElement().textContent=f},h.prototype.setHtml=function(f){this.getElement().innerHTML=f},h.prototype.setPosition=function(f,b){this.getElement().style.left=f+"px",this.getElement().style.top=b+"px"},h.prototype.setClassName=function(f){g.addCssClass(this.getElement(),f)},h.prototype.setTheme=function(f){this.$element.className=r+" "+(f.isDark?"ace_dark ":"")+(f.cssClass||"")},h.prototype.show=function(f,b,C){f!=null&&this.setText(f),b!=null&&C!=null&&this.setPosition(b,C),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},h.prototype.hide=function(f){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=r,this.isOpen=!1)},h.prototype.getHeight=function(){return this.getElement().offsetHeight},h.prototype.getWidth=function(){return this.getElement().offsetWidth},h.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},h}(),i=function(){function h(){this.popups=[]}return h.prototype.addPopup=function(f){this.popups.push(f),this.updatePopups()},h.prototype.removePopup=function(f){var b=this.popups.indexOf(f);b!==-1&&(this.popups.splice(b,1),this.updatePopups())},h.prototype.updatePopups=function(){var f,b,C,w;this.popups.sort(function(y,m){return m.priority-y.priority});var x=[];try{for(var _=p(this.popups),v=_.next();!v.done;v=_.next()){var T=v.value,L=!0;try{for(var M=(C=void 0,p(x)),E=M.next();!E.done;E=M.next()){var S=E.value;if(this.doPopupsOverlap(S,T)){L=!1;break}}}catch(y){C={error:y}}finally{try{E&&!E.done&&(w=M.return)&&w.call(M)}finally{if(C)throw C.error}}L?x.push(T):T.hide()}}catch(y){f={error:y}}finally{try{v&&!v.done&&(b=_.return)&&b.call(_)}finally{if(f)throw f.error}}},h.prototype.doPopupsOverlap=function(f,b){var C=f.getElement().getBoundingClientRect(),w=b.getElement().getBoundingClientRect();return C.leftw.left&&C.topw.top},h}(),s=new i;e.popupManager=s,e.Tooltip=n;var l=function(h){d(f,h);function f(b){b===void 0&&(b=document.body);var C=h.call(this,b)||this;C.timeout=void 0,C.lastT=0,C.idleTime=350,C.lastEvent=void 0,C.onMouseOut=C.onMouseOut.bind(C),C.onMouseMove=C.onMouseMove.bind(C),C.waitForHover=C.waitForHover.bind(C),C.hide=C.hide.bind(C);var w=C.getElement();return w.style.whiteSpace="pre-wrap",w.style.pointerEvents="auto",w.addEventListener("mouseout",C.onMouseOut),w.tabIndex=-1,w.addEventListener("blur",function(){w.contains(document.activeElement)||this.hide()}.bind(C)),w.addEventListener("wheel",o),C}return f.prototype.addToEditor=function(b){b.on("mousemove",this.onMouseMove),b.on("mousedown",this.hide),b.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},f.prototype.removeFromEditor=function(b){b.off("mousemove",this.onMouseMove),b.off("mousedown",this.hide),b.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},f.prototype.onMouseMove=function(b,C){this.lastEvent=b,this.lastT=Date.now();var w=C.$mouseHandler.isMousePressed;if(this.isOpen){var x=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(x.row,x.column)||w||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||w||(this.lastEvent=b,this.timeout=setTimeout(this.waitForHover,this.idleTime))},f.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var b=Date.now()-this.lastT;if(this.idleTime-b>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-b);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},f.prototype.isOutsideOfText=function(b){var C=b.editor,w=b.getDocumentPosition(),x=C.session.getLine(w.row);if(w.column==x.length){var _=C.renderer.pixelToScreenCoordinates(b.clientX,b.clientY),v=C.session.documentToScreenPosition(w.row,w.column);if(v.column!=_.column||v.row!=_.row)return!0}return!1},f.prototype.setDataProvider=function(b){this.$gatherData=b},f.prototype.showForRange=function(b,C,w,x){var _=10;if(!(x&&x!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var v=b.renderer;this.isOpen||(s.addPopup(this),this.$registerCloseEvents(),this.setTheme(v.theme)),this.isOpen=!0,this.addMarker(C,b.session),this.range=u.fromPoints(C.start,C.end);var T=v.textToScreenCoordinates(C.start.row,C.start.column),L=v.scroller.getBoundingClientRect();T.pageX=i.length&&(i=void 0),{value:i&&i[h++],done:!i}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},g=t("../lib/dom"),a=t("../lib/event"),u=t("../tooltip").Tooltip,o=t("../config").nls;function r(i){var s=i.editor,l=s.renderer.$gutterLayer,h=new n(s);i.editor.setDefaultHandler("guttermousedown",function(_){if(!(!s.isFocused()||_.getButton()!=0)){var v=l.getRegion(_);if(v!="foldWidgets"){var T=_.getDocumentPosition().row,L=s.session.selection;if(_.getShiftKey())L.selectTo(T,0);else{if(_.domEvent.detail==2)return s.selectAll(),_.preventDefault();i.$clickSelection=s.selection.getLineRange(T)}return i.setState("selectByLines"),i.captureMouse(_),_.preventDefault()}}});var f,b;function C(){var _=b.getDocumentPosition().row,v=s.session.getLength();if(_==v){var T=s.renderer.pixelToScreenCoordinates(0,b.y).row,L=b.$pos;if(T>s.session.documentToScreenRow(L.row,L.column))return w()}if(h.showTooltip(_),!!h.isOpen)if(s.on("mousewheel",w),i.$tooltipFollowsMouse)x(b);else{var M=b.getGutterRow(),E=l.$lines.get(M);if(E){var S=E.element.querySelector(".ace_gutter_annotation"),y=S.getBoundingClientRect(),m=h.getElement().style;m.left=y.right+"px",m.top=y.bottom+"px"}else x(b)}}function w(){f&&(f=clearTimeout(f)),h.isOpen&&(h.hideTooltip(),s.off("mousewheel",w))}function x(_){h.setPosition(_.x,_.y)}i.editor.setDefaultHandler("guttermousemove",function(_){var v=_.domEvent.target||_.domEvent.srcElement;if(g.hasCssClass(v,"ace_fold-widget"))return w();h.isOpen&&i.$tooltipFollowsMouse&&x(_),b=_,!f&&(f=setTimeout(function(){f=null,b&&!i.isMousePressed?C():w()},50))}),a.addListener(s.renderer.$gutter,"mouseout",function(_){b=null,!(!h.isOpen||f)&&(f=setTimeout(function(){f=null,w()},50))},s),s.on("changeSession",w),s.on("input",w)}e.GutterHandler=r;var n=function(i){d(s,i);function s(l){var h=i.call(this,l.container)||this;return h.editor=l,h}return s.prototype.setPosition=function(l,h){var f=window.innerWidth||document.documentElement.clientWidth,b=window.innerHeight||document.documentElement.clientHeight,C=this.getWidth(),w=this.getHeight();l+=15,h+=15,l+C>f&&(l-=l+C-f),h+w>b&&(h-=20+w),u.prototype.setPosition.call(this,l,h)},Object.defineProperty(s,"annotationLabels",{get:function(){return{error:{singular:o("error"),plural:o("errors")},warning:{singular:o("warning"),plural:o("warnings")},info:{singular:o("information message"),plural:o("information messages")}}},enumerable:!1,configurable:!0}),s.prototype.showTooltip=function(l){var h=this.editor.renderer.$gutterLayer,f=h.$annotations[l],b;f?b={text:Array.from(f.text),type:Array.from(f.type)}:b={text:[],type:[]};var C=h.session.getFoldLine(l);if(C&&h.$showFoldedAnnotations){for(var w={error:[],warning:[],info:[]},x,_=l+1;_<=C.end.row;_++)if(h.$annotations[_])for(var v=0;v ").concat(b.text[_]);M[b.type[_].replace("_fold","")].push(S)}var y=[].concat(M.error,M.warning,M.info).join("
");this.setHtml(y),this.$element.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},s.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},s.annotationsToSummaryString=function(l){var h,f,b=[],C=["error","warning","info"];try{for(var w=p(C),x=w.next();!x.done;x=w.next()){var _=x.value;if(l[_].length){var v=l[_].length===1?s.annotationLabels[_].singular:s.annotationLabels[_].plural;b.push("".concat(l[_].length," ").concat(v))}}}catch(T){h={error:T}}finally{try{x&&!x.done&&(f=w.return)&&f.call(w)}finally{if(h)throw h.error}}return b.join(", ")},s}(u);e.GutterTooltip=n});ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,e,c){"use strict";var d=t("../lib/event"),p=t("../lib/useragent"),g=function(){function a(u,o){this.speed,this.wheelX,this.wheelY,this.domEvent=u,this.editor=o,this.x=this.clientX=u.clientX,this.y=this.clientY=u.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return a.prototype.stopPropagation=function(){d.stopPropagation(this.domEvent),this.propagationStopped=!0},a.prototype.preventDefault=function(){d.preventDefault(this.domEvent),this.defaultPrevented=!0},a.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},a.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},a.prototype.getGutterRow=function(){var u=this.getDocumentPosition().row,o=this.editor.session.documentToScreenRow(u,0),r=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return o-r},a.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var u=this.editor,o=u.getSelectionRange();if(o.isEmpty())this.$inSelection=!1;else{var r=this.getDocumentPosition();this.$inSelection=o.contains(r.row,r.column)}return this.$inSelection},a.prototype.getButton=function(){return d.getButton(this.domEvent)},a.prototype.getShiftKey=function(){return this.domEvent.shiftKey},a.prototype.getAccelKey=function(){return p.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},a}();e.MouseEvent=g});ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,e,c){"use strict";var d=t("../lib/dom"),p=t("../lib/event"),g=t("../lib/useragent"),a=200,u=200,o=5;function r(i){var s=i.editor,l=d.createElement("div");l.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",l.textContent="\xA0";var h=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];h.forEach(function(P){i[P]=this[P]},this),s.on("mousedown",this.onMouseDown.bind(i));var f=s.container,b,C,w,x,_,v,T=0,L,M,E,S,y;this.onDragStart=function(P){if(this.cancelDrag||!f.draggable){var B=this;return setTimeout(function(){B.startSelect(),B.captureMouse(P)},0),P.preventDefault()}_=s.getSelectionRange();var H=P.dataTransfer;H.effectAllowed=s.getReadOnly()?"copy":"copyMove",s.container.appendChild(l),H.setDragImage&&H.setDragImage(l,0,0),setTimeout(function(){s.container.removeChild(l)}),H.clearData(),H.setData("Text",s.session.getTextRange()),M=!0,this.setState("drag")},this.onDragEnd=function(P){if(f.draggable=!1,M=!1,this.setState(null),!s.getReadOnly()){var B=P.dataTransfer.dropEffect;!L&&B=="move"&&s.session.remove(s.getSelectionRange()),s.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(P){if(!(s.getReadOnly()||!O(P.dataTransfer)))return C=P.clientX,w=P.clientY,b||k(),T++,P.dataTransfer.dropEffect=L=N(P),p.preventDefault(P)},this.onDragOver=function(P){if(!(s.getReadOnly()||!O(P.dataTransfer)))return C=P.clientX,w=P.clientY,b||(k(),T++),I!==null&&(I=null),P.dataTransfer.dropEffect=L=N(P),p.preventDefault(P)},this.onDragLeave=function(P){if(T--,T<=0&&b)return R(),L=null,p.preventDefault(P)},this.onDrop=function(P){if(v){var B=P.dataTransfer;if(M)switch(L){case"move":_.contains(v.row,v.column)?_={start:v,end:v}:_=s.moveText(_,v);break;case"copy":_=s.moveText(_,v,!0);break}else{var H=B.getData("Text");_={start:v,end:s.session.insert(v,H)},s.focus(),L=null}return R(),p.preventDefault(P)}},p.addListener(f,"dragstart",this.onDragStart.bind(i),s),p.addListener(f,"dragend",this.onDragEnd.bind(i),s),p.addListener(f,"dragenter",this.onDragEnter.bind(i),s),p.addListener(f,"dragover",this.onDragOver.bind(i),s),p.addListener(f,"dragleave",this.onDragLeave.bind(i),s),p.addListener(f,"drop",this.onDrop.bind(i),s);function m(P,B){var H=Date.now(),V=!B||P.row!=B.row,z=!B||P.column!=B.column;if(!S||V||z)s.moveCursorToPosition(P),S=H,y={x:C,y:w};else{var Z=n(y.x,y.y,C,w);Z>o?S=null:H-S>=u&&(s.renderer.scrollCursorIntoView(),S=null)}}function $(P,B){var H=Date.now(),V=s.renderer.layerConfig.lineHeight,z=s.renderer.layerConfig.characterWidth,Z=s.renderer.scroller.getBoundingClientRect(),K={x:{left:C-Z.left,right:Z.right-C},y:{top:w-Z.top,bottom:Z.bottom-w}},q=Math.min(K.x.left,K.x.right),oe=Math.min(K.y.top,K.y.bottom),ie={row:P.row,column:P.column};q/z<=2&&(ie.column+=K.x.left=a&&s.renderer.scrollCursorIntoView(ie):E=H:E=null}function A(){var P=v;v=s.renderer.screenToTextCoordinates(C,w),m(v,P),$(v,P)}function k(){_=s.selection.toOrientedRange(),b=s.session.addMarker(_,"ace_selection",s.getSelectionStyle()),s.clearSelection(),s.isFocused()&&s.renderer.$cursorLayer.setBlinking(!1),clearInterval(x),A(),x=setInterval(A,20),T=0,p.addListener(document,"mousemove",D)}function R(){clearInterval(x),s.session.removeMarker(b),b=null,s.selection.fromOrientedRange(_),s.isFocused()&&!M&&s.$resetCursorStyle(),_=null,v=null,T=0,E=null,S=null,p.removeListener(document,"mousemove",D)}var I=null;function D(){I==null&&(I=setTimeout(function(){I!=null&&b&&R()},20))}function O(P){var B=P.types;return!B||Array.prototype.some.call(B,function(H){return H=="text/plain"||H=="Text"})}function N(P){var B=["copy","copymove","all","uninitialized"],H=["move","copymove","linkmove","all","uninitialized"],V=g.isMac?P.altKey:P.ctrlKey,z="uninitialized";try{z=P.dataTransfer.effectAllowed.toLowerCase()}catch{}var Z="none";return V&&B.indexOf(z)>=0?Z="copy":H.indexOf(z)>=0?Z="move":B.indexOf(z)>=0&&(Z="copy"),Z}}(function(){this.dragWait=function(){var i=Date.now()-this.mousedownEvent.time;i>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var i=this.editor.container;i.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(i){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var i=this.editor,s=i.container;s.draggable=!0,i.renderer.$cursorLayer.setBlinking(!1),i.setStyle("ace_dragging");var l=g.isWin?"default":"move";i.renderer.setCursorStyle(l),this.setState("dragReady")},this.onMouseDrag=function(i){var s=this.editor.container;if(g.isIE&&this.state=="dragReady"){var l=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);l>3&&s.dragDrop()}if(this.state==="dragWait"){var l=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);l>0&&(s.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(i){if(this.$dragEnabled){this.mousedownEvent=i;var s=this.editor,l=i.inSelection(),h=i.getButton(),f=i.domEvent.detail||1;if(f===1&&h===0&&l){if(i.editor.inMultiSelectMode&&(i.getAccelKey()||i.getShiftKey()))return;this.mousedownEvent.time=Date.now();var b=i.domEvent.target||i.domEvent.srcElement;if("unselectable"in b&&(b.unselectable="on"),s.getDragDelay()){if(g.isWebKit){this.cancelDrag=!0;var C=s.container;C.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(i,this.onMouseDrag.bind(this)),i.defaultPrevented=!0}}}}).call(r.prototype);function n(i,s,l,h){return Math.sqrt(Math.pow(l-i,2)+Math.pow(h-s,2))}e.DragdropHandler=r});ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(t,e,c){"use strict";var d=t("./mouse_event").MouseEvent,p=t("../lib/event"),g=t("../lib/dom");e.addTouchListeners=function(a,u){var o="scroll",r,n,i,s,l,h,f=0,b,C=0,w=0,x=0,_,v;function T(){var m=window.navigator&&window.navigator.clipboard,$=!1,A=function(){var R=u.getCopyText(),I=u.session.getUndoManager().hasUndo();v.replaceChild(g.buildDom($?["span",!R&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],R&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],R&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],m&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],I&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),v.firstChild)},k=function(R){var I=R.target.getAttribute("action");if(I=="more"||!$)return $=!$,A();I=="paste"?m.readText().then(function(D){u.execCommand(I,D)}):I&&((I=="cut"||I=="copy")&&(m?m.writeText(u.getCopyText()):document.execCommand("copy")),u.execCommand(I)),v.firstChild.style.display="none",$=!1,I!="openCommandPalette"&&u.focus()};v=g.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(R){o="menu",R.stopPropagation(),R.preventDefault(),u.textInput.focus()},ontouchend:function(R){R.stopPropagation(),R.preventDefault(),k(R)},onclick:k},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],u.container)}function L(){v||T();var m=u.selection.cursor,$=u.renderer.textToScreenCoordinates(m.row,m.column),A=u.renderer.textToScreenCoordinates(0,0).pageX,k=u.renderer.scrollLeft,R=u.container.getBoundingClientRect();v.style.top=$.pageY-R.top-3+"px",$.pageX-R.left=2?u.selection.getLineRange(b.row):u.session.getBracketRange(b);m&&!m.isEmpty()?u.selection.setRange(m):u.selection.selectWord(),o="wait"}p.addListener(a,"contextmenu",function(m){if(_){var $=u.textInput.getElement();$.focus()}},u),p.addListener(a,"touchstart",function(m){var $=m.touches;if(l||$.length>1){clearTimeout(l),l=null,i=-1,o="zoom";return}_=u.$mouseHandler.isMousePressed=!0;var A=u.renderer.layerConfig.lineHeight,k=u.renderer.layerConfig.lineHeight,R=m.timeStamp;s=R;var I=$[0],D=I.clientX,O=I.clientY;Math.abs(r-D)+Math.abs(n-O)>A&&(i=-1),r=m.clientX=D,n=m.clientY=O,w=x=0;var N=new d(m,u);if(b=N.getDocumentPosition(),R-i<500&&$.length==1&&!f)C++,m.preventDefault(),m.button=0,S();else{C=0;var P=u.selection.cursor,B=u.selection.isEmpty()?P:u.selection.anchor,H=u.renderer.$cursorLayer.getPixelPosition(P,!0),V=u.renderer.$cursorLayer.getPixelPosition(B,!0),z=u.renderer.scroller.getBoundingClientRect(),Z=u.renderer.layerConfig.offset,K=u.renderer.scrollLeft,q=function(ye,Ee){return ye=ye/k,Ee=Ee/A-.75,ye*ye+Ee*Ee};if(m.clientXie?"cursor":"anchor"),ie<3.5?o="anchor":oe<3.5?o="cursor":o="scroll",l=setTimeout(E,450)}i=R},u),p.addListener(a,"touchend",function(m){_=u.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),o=="zoom"?(o="",f=0):l?(u.selection.moveToPosition(b),f=0,L()):o=="scroll"?(y(),M()):L(),clearTimeout(l),l=null},u),p.addListener(a,"touchmove",function(m){l&&(clearTimeout(l),l=null);var $=m.touches;if(!($.length>1||o=="zoom")){var A=$[0],k=r-A.clientX,R=n-A.clientY;if(o=="wait")if(k*k+R*R>4)o="cursor";else return m.preventDefault();r=A.clientX,n=A.clientY,m.clientX=A.clientX,m.clientY=A.clientY;var I=m.timeStamp,D=I-s;if(s=I,o=="scroll"){var O=new d(m,u);O.speed=1,O.wheelX=k,O.wheelY=R,10*Math.abs(k)0)if(ae==16){for(se=de;se-1){for(se=de;se=0&&ie[re]==E;re--)q[re]=g}}}function H(K,q,oe){if(!(a=K){for(Ee=ye+1;Ee=K;)Ee++;for(be=ye,U=Ee-1;be=q.length||(Ee=oe[ie-1])!=x&&Ee!=_||(be=q[ie+1])!=x&&be!=_?v:(u&&(be=_),be==Ee?be:v);case y:return Ee=ie>0?oe[ie-1]:T,Ee==x&&ie+10&&oe[ie-1]==x)return x;if(u)return v;for(Y=ie+1,U=q.length;Y=1425&&ae<=2303||ae==64286;if(Ee=q[Y],te&&(Ee==w||Ee==M))return w}return ie<1||(Ee=q[ie-1])==T?v:oe[ie-1];case T:return u=!1,r=!0,g;case L:return n=!0,v;case A:case k:case I:case D:case R:u=!1;case O:return v}}function z(K){var q=K.charCodeAt(0),oe=q>>8;return oe==0?q>191?C:N[q]:oe==5?/[\u0591-\u05f4]/.test(K)?w:C:oe==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(K)?$:/[\u0660-\u0669\u066b-\u066c]/.test(K)?_:q==1642?m:/[\u06f0-\u06f9]/.test(K)?x:M:oe==32&&q<=8287?P[q&255]:oe==254&&q>=65136?M:v}function Z(K){return K>="\u064B"&&K<="\u0655"}e.L=C,e.R=w,e.EN=x,e.ON_R=3,e.AN=4,e.R_H=5,e.B=6,e.RLE=7,e.DOT="\xB7",e.doBidiReorder=function(K,q,oe){if(K.length<2)return{};var ie=K.split(""),ye=new Array(ie.length),Ee=new Array(ie.length),be=[];g=oe?b:f,B(ie,be,ie.length,q);for(var U=0;UM&&q[U]0&&ie[U-1]==="\u0644"&&/\u0622|\u0623|\u0625|\u0627/.test(ie[U])&&(be[U-1]=be[U]=e.R_H,U++);ie[ie.length-1]===e.DOT&&(be[ie.length-1]=e.B),ie[0]==="\u202B"&&(be[0]=e.RLE);for(var U=0;U=0&&(o=this.session.$docRowCache[n])}return o},u.prototype.getSplitIndex=function(){var o=0,r=this.session.$screenRowCache;if(r.length)for(var n,i=this.session.$getRowCacheIndex(r,this.currentRow);this.currentRow-o>0&&(n=this.session.$getRowCacheIndex(r,this.currentRow-o-1),n===i);)i=n,o++;else o=this.currentRow;return o},u.prototype.updateRowLine=function(o,r){o===void 0&&(o=this.getDocumentRow());var n=o===this.session.getLength()-1,i=n?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(o),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[o];s&&(r===void 0&&(r=this.getSplitIndex()),r>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[d.L],this.line=rr?this.session.getOverwrite()?o:o-1:r,i=d.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,l=0;!this.session.getOverwrite()&&o<=r&&s[i]%2!==0&&i++;for(var h=0;hr&&s[i]%2===0&&(l+=this.charWidths[s[i]]),this.wrapIndent&&(l+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(l+=this.rtlLineOffset),l},u.prototype.getSelections=function(o,r){var n=this.bidiMap,i=n.bidiLevels,s,l=[],h=0,f=Math.min(o,r)-this.wrapIndent,b=Math.max(o,r)-this.wrapIndent,C=!1,w=!1,x=0;this.wrapIndent&&(h+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var _,v=0;v=f&&_i+h/2;){if(i+=h,s===l.length-1){h=0;break}h=this.charWidths[l[++s]]}return s>0&&l[s-1]%2!==0&&l[s]%2===0?(n0&&l[s-1]%2===0&&l[s]%2!==0?r=1+(n>i?this.bidiMap.logicalFromVisual[s]:this.bidiMap.logicalFromVisual[s-1]):this.isRtlDir&&s===l.length-1&&h===0&&l[s-1]%2===0||!this.isRtlDir&&s===0&&l[s]%2!==0?r=1+this.bidiMap.logicalFromVisual[s]:(s>0&&l[s-1]%2!==0&&h!==0&&s--,r=this.bidiMap.logicalFromVisual[s]),r===0&&this.isRtlDir&&r++,r+this.wrapIndent},u}();e.BidiHandler=a});ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(t,e,c){"use strict";var d=t("./lib/oop"),p=t("./lib/lang"),g=t("./lib/event_emitter").EventEmitter,a=t("./range").Range,u=function(){function o(r){this.session=r,this.doc=r.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var n=this;this.cursor.on("change",function(i){n.$cursorChanged=!0,n.$silent||n._emit("changeCursor"),!n.$isEmpty&&!n.$silent&&n._emit("changeSelection"),!n.$keepDesiredColumnOnChange&&i.old.column!=i.value.column&&(n.$desiredColumn=null)}),this.anchor.on("change",function(){n.$anchorChanged=!0,!n.$isEmpty&&!n.$silent&&n._emit("changeSelection")})}return o.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},o.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},o.prototype.getCursor=function(){return this.lead.getPosition()},o.prototype.setAnchor=function(r,n){this.$isEmpty=!1,this.anchor.setPosition(r,n)},o.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},o.prototype.getSelectionLead=function(){return this.lead.getPosition()},o.prototype.isBackwards=function(){var r=this.anchor,n=this.lead;return r.row>n.row||r.row==n.row&&r.column>n.column},o.prototype.getRange=function(){var r=this.anchor,n=this.lead;return this.$isEmpty?a.fromPoints(n,n):this.isBackwards()?a.fromPoints(n,r):a.fromPoints(r,n)},o.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},o.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},o.prototype.setRange=function(r,n){var i=n?r.end:r.start,s=n?r.start:r.end;this.$setSelection(i.row,i.column,s.row,s.column)},o.prototype.$setSelection=function(r,n,i,s){if(!this.$silent){var l=this.$isEmpty,h=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(r,n),this.cursor.setPosition(i,s),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||l!=this.$isEmpty||h)&&this._emit("changeSelection")}},o.prototype.$moveSelection=function(r){var n=this.lead;this.$isEmpty&&this.setSelectionAnchor(n.row,n.column),r.call(this)},o.prototype.selectTo=function(r,n){this.$moveSelection(function(){this.moveCursorTo(r,n)})},o.prototype.selectToPosition=function(r){this.$moveSelection(function(){this.moveCursorToPosition(r)})},o.prototype.moveTo=function(r,n){this.clearSelection(),this.moveCursorTo(r,n)},o.prototype.moveToPosition=function(r){this.clearSelection(),this.moveCursorToPosition(r)},o.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},o.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},o.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},o.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},o.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},o.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},o.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},o.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},o.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},o.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},o.prototype.getWordRange=function(r,n){if(typeof n>"u"){var i=r||this.lead;r=i.row,n=i.column}return this.session.getWordRange(r,n)},o.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},o.prototype.selectAWord=function(){var r=this.getCursor(),n=this.session.getAWordRange(r.row,r.column);this.setSelectionRange(n)},o.prototype.getLineRange=function(r,n){var i=typeof r=="number"?r:this.lead.row,s,l=this.session.getFoldLine(i);return l?(i=l.start.row,s=l.end.row):s=i,n===!0?new a(i,0,s,this.session.getLine(s).length):new a(i,0,s+1,0)},o.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},o.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},o.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},o.prototype.wouldMoveIntoSoftTab=function(r,n,i){var s=r.column,l=r.column+n;return i<0&&(s=r.column-n,l=r.column),this.session.isTabStop(r)&&this.doc.getLine(r.row).slice(s,l).split(" ").length-1==n},o.prototype.moveCursorLeft=function(){var r=this.lead.getPosition(),n;if(n=this.session.getFoldAt(r.row,r.column,-1))this.moveCursorTo(n.start.row,n.start.column);else if(r.column===0)r.row>0&&this.moveCursorTo(r.row-1,this.doc.getLine(r.row-1).length);else{var i=this.session.getTabSize();this.wouldMoveIntoSoftTab(r,i,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},o.prototype.moveCursorRight=function(){var r=this.lead.getPosition(),n;if(n=this.session.getFoldAt(r.row,r.column,1))this.moveCursorTo(n.end.row,n.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(n.column=s)}}this.moveCursorTo(n.row,n.column)},o.prototype.moveCursorFileEnd=function(){var r=this.doc.getLength()-1,n=this.doc.getLine(r).length;this.moveCursorTo(r,n)},o.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},o.prototype.moveCursorLongWordRight=function(){var r=this.lead.row,n=this.lead.column,i=this.doc.getLine(r),s=i.substring(n);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var l=this.session.getFoldAt(r,n,1);if(l){this.moveCursorTo(l.end.row,l.end.column);return}if(this.session.nonTokenRe.exec(s)&&(n+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,s=i.substring(n)),n>=i.length){this.moveCursorTo(r,i.length),this.moveCursorRight(),r0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(l)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(r,n)},o.prototype.$shortWordEndIndex=function(r){var n=0,i,s=/\s/,l=this.session.tokenRe;if(l.lastIndex=0,this.session.tokenRe.exec(r))n=this.session.tokenRe.lastIndex;else{for(;(i=r[n])&&s.test(i);)n++;if(n<1){for(l.lastIndex=0;(i=r[n])&&!l.test(i);)if(l.lastIndex=0,n++,s.test(i))if(n>2){n--;break}else{for(;(i=r[n])&&s.test(i);)n++;if(n>2)break}}}return l.lastIndex=0,n},o.prototype.moveCursorShortWordRight=function(){var r=this.lead.row,n=this.lead.column,i=this.doc.getLine(r),s=i.substring(n),l=this.session.getFoldAt(r,n,1);if(l)return this.moveCursorTo(l.end.row,l.end.column);if(n==i.length){var h=this.doc.getLength();do r++,s=this.doc.getLine(r);while(r0&&/^\s*$/.test(s));n=s.length,/\s+$/.test(s)||(s="")}var l=p.stringReverse(s),h=this.$shortWordEndIndex(l);return this.moveCursorTo(r,n-h)},o.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},o.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},o.prototype.moveCursorBy=function(r,n){var i=this.session.documentToScreenPosition(this.lead.row,this.lead.column),s;if(n===0&&(r!==0&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(s=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(s/this.session.$bidiHandler.charWidths[0])):s=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),r!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var l=this.session.lineWidgets[this.lead.row];r<0?r-=l.rowsAbove||0:r>0&&(r+=l.rowCount-(l.rowsAbove||0))}var h=this.session.screenToDocumentPosition(i.row+r,i.column,s);r!==0&&n===0&&h.row===this.lead.row&&(h.column,this.lead.column),this.moveCursorTo(h.row,h.column+n,n===0)},o.prototype.moveCursorToPosition=function(r){this.moveCursorTo(r.row,r.column)},o.prototype.moveCursorTo=function(r,n,i){var s=this.session.getFoldAt(r,n,1);s&&(r=s.start.row,n=s.start.column),this.$keepDesiredColumnOnChange=!0;var l=this.session.getLine(r);/[\uDC00-\uDFFF]/.test(l.charAt(n))&&l.charAt(n-1)&&(this.lead.row==r&&this.lead.column==n+1?n=n-1:n=n+1),this.lead.setPosition(r,n),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},o.prototype.moveCursorToScreen=function(r,n,i){var s=this.session.screenToDocumentPosition(r,n);this.moveCursorTo(s.row,s.column,i)},o.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},o.prototype.fromOrientedRange=function(r){this.setSelectionRange(r,r.cursor==r.start),this.$desiredColumn=r.desiredColumn||this.$desiredColumn},o.prototype.toOrientedRange=function(r){var n=this.getRange();return r?(r.start.column=n.start.column,r.start.row=n.start.row,r.end.column=n.end.column,r.end.row=n.end.row):r=n,r.cursor=this.isBackwards()?r.start:r.end,r.desiredColumn=this.$desiredColumn,r},o.prototype.getRangeOfMovements=function(r){var n=this.getCursor();try{r(this);var i=this.getCursor();return a.fromPoints(n,i)}catch{return a.fromPoints(n,n)}finally{this.moveCursorToPosition(n)}},o.prototype.toJSON=function(){if(this.rangeCount)var r=this.ranges.map(function(n){var i=n.clone();return i.isBackwards=n.cursor==n.start,i});else{var r=this.getRange();r.isBackwards=this.isBackwards()}return r},o.prototype.fromJSON=function(r){if(r.start==null)if(this.rangeList&&r.length>1){this.toSingleRange(r[0]);for(var n=r.length;n--;){var i=a.fromPoints(r[n].start,r[n].end);r[n].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}else r=r[0];this.rangeList&&this.toSingleRange(r),this.setSelectionRange(r,r.isBackwards)},o.prototype.isEqual=function(r){if((r.length||this.rangeCount)&&r.length!=this.rangeCount)return!1;if(!r.length||!this.ranges)return this.getRange().isEqual(r);for(var n=this.ranges.length;n--;)if(!this.ranges[n].isEqual(r[n]))return!1;return!0},o}();u.prototype.setSelectionAnchor=u.prototype.setAnchor,u.prototype.getSelectionAnchor=u.prototype.getAnchor,u.prototype.setSelectionRange=u.prototype.setRange,d.implement(u.prototype,g),e.Selection=u});ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(t,e,c){"use strict";var d=t("./lib/report_error").reportError,p=2e3,g=function(){function a(u){this.splitRegex,this.states=u,this.regExps={},this.matchMappings={};for(var o in this.states){for(var r=this.states[o],n=[],i=0,s=this.matchMappings[o]={defaultToken:"text"},l="g",h=[],f=0;f1?b.onMatch=this.$applyToken:b.onMatch=b.token),w>1&&(/\\\d/.test(b.regex)?C=b.regex.replace(/\\([0-9]+)/g,function(x,_){return"\\"+(parseInt(_,10)+i+1)}):(w=1,C=this.removeCapturingGroups(b.regex)),!b.splitRegex&&typeof b.token!="string"&&h.push(b)),s[i]=f,i+=w,n.push(C),b.onMatch||(b.onMatch=null)}}n.length||(s[0]=0,n.push("$")),h.forEach(function(x){x.splitRegex=this.createSplitterRegexp(x.regex,l)},this),this.regExps[o]=new RegExp("("+n.join(")|(")+")|($)",l)}}return a.prototype.$setMaxTokenCount=function(u){p=u|0},a.prototype.$applyToken=function(u){var o=this.splitRegex.exec(u).slice(1),r=this.token.apply(this,o);if(typeof r=="string")return[{type:r,value:u}];for(var n=[],i=0,s=r.length;ib){var L=u.substring(b,T-v.length);w.type==x?w.value+=L:(w.type&&f.push(w),w={type:x,value:L})}for(var M=0;Mp){for(C>2*u.length&&this.reportError("infinite loop with in ace tokenizer",{startState:o,line:u});b1&&r[0]!==n&&r.unshift("#tmp",n),{tokens:f,state:r.length?r:n}},a}();g.prototype.reportError=d,e.Tokenizer=g});ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(t,e,c){"use strict";var d=t("../lib/deep_copy").deepCopy,p;p=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},function(){this.addRules=function(u,o){if(!o){for(var r in u)this.$rules[r]=u[r];return}for(var r in u){for(var n=u[r],i=0;i=this.$rowTokens.length;){if(this.$row+=1,a||(a=this.$session.getLength()),this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},g.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},g.prototype.getCurrentTokenRow=function(){return this.$row},g.prototype.getCurrentTokenColumn=function(){var a=this.$rowTokens,u=this.$tokenIndex,o=a[u].start;if(o!==void 0)return o;for(o=0;u>0;)u-=1,o+=a[u].value.length;return o},g.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},g.prototype.getCurrentTokenRange=function(){var a=this.$rowTokens[this.$tokenIndex],u=this.getCurrentTokenColumn();return new d(this.$row,u,this.$row,u+a.value.length)},g}();e.TokenIterator=p});ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,e,c){"use strict";var d=t("../../lib/oop"),p=t("../behaviour").Behaviour,g=t("../../token_iterator").TokenIterator,a=t("../../lib/lang"),u=["text","paren.rparen","rparen","paren","punctuation.operator"],o=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],r,n={},i={'"':'"',"'":"'"},s=function(f){var b=-1;if(f.multiSelect&&(b=f.selection.index,n.rangeCount!=f.multiSelect.rangeCount&&(n={rangeCount:f.multiSelect.rangeCount})),n[b])return r=n[b];r=n[b]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},l=function(f,b,C,w){var x=f.end.row-f.start.row;return{text:C+b+w,selection:[0,f.start.column+1,x,f.end.column+(x?0:1)]}},h;h=function(f){f=f||{},this.add("braces","insertion",function(b,C,w,x,_){var v=w.getCursorPosition(),T=x.doc.getLine(v.row);if(_=="{"){s(w);var L=w.getSelectionRange(),M=x.doc.getTextRange(L);if(M!==""&&M!=="{"&&w.getWrapBehavioursEnabled())return l(L,M,"{","}");if(h.isSaneInsertion(w,x))return/[\]\}\)]/.test(T[v.column])||w.inMultiSelectMode||f.braces?(h.recordAutoInsert(w,x,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(w,x,"{"),{text:"{",selection:[1,1]})}else if(_=="}"){s(w);var E=T.substring(v.column,v.column+1);if(E=="}"){var S=x.$findOpeningBracket("}",{column:v.column+1,row:v.row});if(S!==null&&h.isAutoInsertedClosing(v,T,_))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(_==` +`||_==`\r +`){s(w);var y="";h.isMaybeInsertedClosing(v,T)&&(y=a.stringRepeat("}",r.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var E=T.substring(v.column,v.column+1);if(E==="}"){var m=x.findMatchingBracket({row:v.row,column:v.column+1},"}");if(!m)return null;var $=this.$getIndent(x.getLine(m.row))}else if(y)var $=this.$getIndent(T);else{h.clearMaybeInsertedClosing();return}var A=$+x.getTabString();return{text:` +`+A+` +`+$+y,selection:[1,A.length,1,A.length]}}else h.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(b,C,w,x,_){var v=x.doc.getTextRange(_);if(!_.isMultiLine()&&v=="{"){s(w);var T=x.doc.getLine(_.start.row),L=T.substring(_.end.column,_.end.column+1);if(L=="}")return _.end.column++,_;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(b,C,w,x,_){if(_=="("){s(w);var v=w.getSelectionRange(),T=x.doc.getTextRange(v);if(T!==""&&w.getWrapBehavioursEnabled())return l(v,T,"(",")");if(h.isSaneInsertion(w,x))return h.recordAutoInsert(w,x,")"),{text:"()",selection:[1,1]}}else if(_==")"){s(w);var L=w.getCursorPosition(),M=x.doc.getLine(L.row),E=M.substring(L.column,L.column+1);if(E==")"){var S=x.$findOpeningBracket(")",{column:L.column+1,row:L.row});if(S!==null&&h.isAutoInsertedClosing(L,M,_))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(b,C,w,x,_){var v=x.doc.getTextRange(_);if(!_.isMultiLine()&&v=="("){s(w);var T=x.doc.getLine(_.start.row),L=T.substring(_.start.column+1,_.start.column+2);if(L==")")return _.end.column++,_}}),this.add("brackets","insertion",function(b,C,w,x,_){if(_=="["){s(w);var v=w.getSelectionRange(),T=x.doc.getTextRange(v);if(T!==""&&w.getWrapBehavioursEnabled())return l(v,T,"[","]");if(h.isSaneInsertion(w,x))return h.recordAutoInsert(w,x,"]"),{text:"[]",selection:[1,1]}}else if(_=="]"){s(w);var L=w.getCursorPosition(),M=x.doc.getLine(L.row),E=M.substring(L.column,L.column+1);if(E=="]"){var S=x.$findOpeningBracket("]",{column:L.column+1,row:L.row});if(S!==null&&h.isAutoInsertedClosing(L,M,_))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(b,C,w,x,_){var v=x.doc.getTextRange(_);if(!_.isMultiLine()&&v=="["){s(w);var T=x.doc.getLine(_.start.row),L=T.substring(_.start.column+1,_.start.column+2);if(L=="]")return _.end.column++,_}}),this.add("string_dquotes","insertion",function(b,C,w,x,_){var v=x.$mode.$quotes||i;if(_.length==1&&v[_]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(_)!=-1)return;s(w);var T=_,L=w.getSelectionRange(),M=x.doc.getTextRange(L);if(M!==""&&(M.length!=1||!v[M])&&w.getWrapBehavioursEnabled())return l(L,M,T,T);if(!M){var E=w.getCursorPosition(),S=x.doc.getLine(E.row),y=S.substring(E.column-1,E.column),m=S.substring(E.column,E.column+1),$=x.getTokenAt(E.row,E.column),A=x.getTokenAt(E.row,E.column+1);if(y=="\\"&&$&&/escape/.test($.type))return null;var k=$&&/string|escape/.test($.type),R=!A||/string|escape/.test(A.type),I;if(m==T)I=k!==R,I&&/string\.end/.test(A.type)&&(I=!1);else{if(k&&!R||k&&R)return null;var D=x.$mode.tokenRe;D.lastIndex=0;var O=D.test(y);D.lastIndex=0;var N=D.test(m),P=x.$mode.$pairQuotesAfter,B=P&&P[T]&&P[T].test(y);if(!B&&O||N||m&&!/[\s;,.})\]\\]/.test(m))return null;var H=S[E.column-2];if(y==T&&(H==T||D.test(H)))return null;I=!0}return{text:I?T+T:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(b,C,w,x,_){var v=x.$mode.$quotes||i,T=x.doc.getTextRange(_);if(!_.isMultiLine()&&v.hasOwnProperty(T)){s(w);var L=x.doc.getLine(_.start.row),M=L.substring(_.start.column+1,_.start.column+2);if(M==T)return _.end.column++,_}}),f.closeDocComment!==!1&&this.add("doc comment end","insertion",function(b,C,w,x,_){if(b==="doc-start"&&(_===` +`||_===`\r +`)&&w.selection.isEmpty()){var v=w.getCursorPosition(),T=x.doc.getLine(v.row),L=x.doc.getLine(v.row+1),M=this.$getIndent(T);if(/\s*\*/.test(L))return/^\s*\*/.test(T)?{text:_+M+"* ",selection:[1,3+M.length,1,3+M.length]}:{text:_+M+" * ",selection:[1,3+M.length,1,3+M.length]};if(/\/\*\*/.test(T.substring(0,v.column)))return{text:_+M+" * "+_+" "+M+"*/",selection:[1,4+M.length,1,4+M.length]}}})},h.isSaneInsertion=function(f,b){var C=f.getCursorPosition(),w=new g(b,C.row,C.column);if(!this.$matchTokenType(w.getCurrentToken()||"text",u)){if(/[)}\]]/.test(f.session.getLine(C.row)[C.column]))return!0;var x=new g(b,C.row,C.column+1);if(!this.$matchTokenType(x.getCurrentToken()||"text",u))return!1}return w.stepForward(),w.getCurrentTokenRow()!==C.row||this.$matchTokenType(w.getCurrentToken()||"text",o)},h.$matchTokenType=function(f,b){return b.indexOf(f.type||f)>-1},h.recordAutoInsert=function(f,b,C){var w=f.getCursorPosition(),x=b.doc.getLine(w.row);this.isAutoInsertedClosing(w,x,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=w.row,r.autoInsertedLineEnd=C+x.substr(w.column),r.autoInsertedBrackets++},h.recordMaybeInsert=function(f,b,C){var w=f.getCursorPosition(),x=b.doc.getLine(w.row);this.isMaybeInsertedClosing(w,x)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=w.row,r.maybeInsertedLineStart=x.substr(0,w.column)+C,r.maybeInsertedLineEnd=x.substr(w.column),r.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(f,b,C){return r.autoInsertedBrackets>0&&f.row===r.autoInsertedRow&&C===r.autoInsertedLineEnd[0]&&b.substr(f.column)===r.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(f,b){return r.maybeInsertedBrackets>0&&f.row===r.maybeInsertedRow&&b.substr(f.column)===r.maybeInsertedLineEnd&&b.substr(0,f.column)==r.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},d.inherits(h,p),e.CstyleBehaviour=h});ace.define("ace/unicode",["require","exports","module"],function(t,e,c){"use strict";for(var d=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],p=0,g=[],a=0;a2?H%_!=_-1:H%_==0}}else{if(!this.blockComment)return!1;var T=this.blockComment.start,L=this.blockComment.end,M=new RegExp("^(\\s*)(?:"+o.escapeRegExp(T)+")"),E=new RegExp("(?:"+o.escapeRegExp(L)+")\\s*$"),S=function(I,D){m(I,D)||(!C||/\S/.test(I))&&(b.insertInLine({row:D,column:I.length},L),b.insertInLine({row:D,column:x},T))},y=function(I,D){var O;(O=I.match(E))&&b.removeInLine(D,I.length-O[0].length,I.length),(O=I.match(M))&&b.removeInLine(D,O[1].length,O[0].length)},m=function(I,D){if(M.test(I))return!0;for(var O=l.getTokens(D),N=0;NI.length&&(R=I.length)}),x==1/0&&(x=R,C=!1,w=!1),v&&x%_!=0&&(x=Math.floor(x/_)*_),k(w?y:S)},this.toggleBlockComment=function(s,l,h,f){var b=this.blockComment;if(b){!b.start&&b[0]&&(b=b[0]);var C=new r(l,f.row,f.column),w=C.getCurrentToken(),x=l.selection,_=l.selection.toOrientedRange(),v,T;if(w&&/comment/.test(w.type)){for(var L,M;w&&/comment/.test(w.type);){var E=w.value.indexOf(b.start);if(E!=-1){var S=C.getCurrentTokenRow(),y=C.getCurrentTokenColumn()+E;L=new n(S,y,S,y+b.start.length);break}w=C.stepBackward()}for(var C=new r(l,f.row,f.column),w=C.getCurrentToken();w&&/comment/.test(w.type);){var E=w.value.indexOf(b.end);if(E!=-1){var S=C.getCurrentTokenRow(),y=C.getCurrentTokenColumn()+E;M=new n(S,y,S,y+b.end.length);break}w=C.stepForward()}M&&l.remove(M),L&&(l.remove(L),v=L.start.row,T=-b.start.length)}else T=b.start.length,v=h.start.row,l.insert(h.end,b.end),l.insert(h.start,b.start);_.start.row==v&&(_.start.column+=T),_.end.row==v&&(_.end.column+=T),l.selection.fromOrientedRange(_)}},this.getNextLineIndent=function(s,l,h){return this.$getIndent(l)},this.checkOutdent=function(s,l,h){return!1},this.autoOutdent=function(s,l,h){},this.$getIndent=function(s){return s.match(/^\s*/)[0]},this.createWorker=function(s){return null},this.createModeDelegates=function(s){this.$embeds=[],this.$modes={};for(var l in s)if(s[l]){var h=s[l],f=h.prototype.$id,b=d.$modes[f];b||(d.$modes[f]=b=new h),d.$modes[l]||(d.$modes[l]=b),this.$embeds.push(l),this.$modes[l]=b}for(var C=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],w=function(_){(function(v){var T=C[_],L=v[T];v[C[_]]=function(){return this.$delegator(T,arguments,L)}})(x)},x=this,l=0;l=0&&u.row=0&&u.column<=a[u.row].length}function g(a,u){u.action!="insert"&&u.action!="remove"&&d(u,"delta.action must be 'insert' or 'remove'"),u.lines instanceof Array||d(u,"delta.lines must be an Array"),(!u.start||!u.end)&&d(u,"delta.start/end must be an present");var o=u.start;p(a,u.start)||d(u,"delta.start must be contained in document");var r=u.end;u.action=="remove"&&!p(a,r)&&d(u,"delta.end must contained in document for 'remove' actions");var n=r.row-o.row,i=r.column-(n==0?o.column:0);(n!=u.lines.length-1||u.lines[n].length!=i)&&d(u,"delta.range must match delta lines")}e.applyDelta=function(a,u,o){var r=u.start.row,n=u.start.column,i=a[r]||"";switch(u.action){case"insert":var s=u.lines;if(s.length===1)a[r]=i.substring(0,n)+u.lines[0]+i.substring(n);else{var l=[r,1].concat(u.lines);a.splice.apply(a,l),a[r]=i.substring(0,n)+a[r],a[r+u.lines.length-1]+=i.substring(n)}break;case"remove":var h=u.end.column,f=u.end.row;r===f?a[r]=i.substring(0,n)+i.substring(h):a.splice(r,f-r+1,i.substring(0,n)+a[f].substring(h));break}}});ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,e,c){"use strict";var d=t("./lib/oop"),p=t("./lib/event_emitter").EventEmitter,g=function(){function o(r,n,i){this.$onChange=this.onChange.bind(this),this.attach(r),typeof n!="number"?this.setPosition(n.row,n.column):this.setPosition(n,i)}return o.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},o.prototype.getDocument=function(){return this.document},o.prototype.onChange=function(r){if(!(r.start.row==r.end.row&&r.start.row!=this.row)&&!(r.start.row>this.row)){var n=u(r,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},o.prototype.setPosition=function(r,n,i){var s;if(i?s={row:r,column:n}:s=this.$clipPositionToDocument(r,n),!(this.row==s.row&&this.column==s.column)){var l={row:this.row,column:this.column};this.row=s.row,this.column=s.column,this._signal("change",{old:l,value:s})}},o.prototype.detach=function(){this.document.off("change",this.$onChange)},o.prototype.attach=function(r){this.document=r||this.document,this.document.on("change",this.$onChange)},o.prototype.$clipPositionToDocument=function(r,n){var i={};return r>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):r<0?(i.row=0,i.column=0):(i.row=r,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,n))),n<0&&(i.column=0),i},o}();g.prototype.$insertRight=!1,d.implement(g.prototype,p);function a(o,r,n){var i=n?o.column<=r.column:o.column=s&&(n=s-1,i=void 0);var l=this.getLine(n);return i==null&&(i=l.length),i=Math.min(Math.max(i,0),l.length),{row:n,column:i}},r.prototype.clonePos=function(n){return{row:n.row,column:n.column}},r.prototype.pos=function(n,i){return{row:n,column:i}},r.prototype.$clipPosition=function(n){var i=this.getLength();return n.row>=i?(n.row=Math.max(0,i-1),n.column=this.getLine(i-1).length):(n.row=Math.max(0,n.row),n.column=Math.min(Math.max(n.column,0),this.getLine(n.row).length)),n},r.prototype.insertFullLines=function(n,i){n=Math.min(Math.max(n,0),this.getLength());var s=0;n0,l=i=0&&this.applyDelta({start:this.pos(n,this.getLine(n).length),end:this.pos(n+1,0),action:"remove",lines:["",""]})},r.prototype.replace=function(n,i){if(n instanceof a||(n=a.fromPoints(n.start,n.end)),i.length===0&&n.isEmpty())return n.start;if(i==this.getTextRange(n))return n.end;this.remove(n);var s;return i?s=this.insert(n.start,i):s=n.start,s},r.prototype.applyDeltas=function(n){for(var i=0;i=0;i--)this.revertDelta(n[i])},r.prototype.applyDelta=function(n,i){var s=n.action=="insert";(s?n.lines.length<=1&&!n.lines[0]:!a.comparePoints(n.start,n.end))||(s&&n.lines.length>2e4?this.$splitAndapplyLargeDelta(n,2e4):(p(this.$lines,n,i),this._signal("change",n)))},r.prototype.$safeApplyDelta=function(n){var i=this.$lines.length;(n.action=="remove"&&n.start.row20){r.running=setTimeout(r.$worker,20);break}}r.currentLine=i,s==-1&&(s=i),h<=s&&r.fireUpdateEvent(h,s)}}}return a.prototype.setTokenizer=function(u){this.tokenizer=u,this.lines=[],this.states=[],this.start(0)},a.prototype.setDocument=function(u){this.doc=u,this.lines=[],this.states=[],this.stop()},a.prototype.fireUpdateEvent=function(u,o){var r={first:u,last:o};this._signal("update",{data:r})},a.prototype.start=function(u){this.currentLine=Math.min(u||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},a.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},a.prototype.$updateOnChange=function(u){var o=u.start.row,r=u.end.row-o;if(r===0)this.lines[o]=null;else if(u.action=="remove")this.lines.splice(o,r+1,null),this.states.splice(o,r+1,null);else{var n=Array(r+1);n.unshift(o,1),this.lines.splice.apply(this.lines,n),this.states.splice.apply(this.states,n)}this.currentLine=Math.min(o,this.currentLine,this.doc.getLength()),this.stop()},a.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},a.prototype.getTokens=function(u){return this.lines[u]||this.$tokenizeRow(u)},a.prototype.getState=function(u){return this.currentLine==u&&this.$tokenizeRow(u),this.states[u]||"start"},a.prototype.$tokenizeRow=function(u){var o=this.doc.getLine(u),r=this.states[u-1],n=this.tokenizer.getLineTokens(o,r,u);return this.states[u]+""!=n.state+""?(this.states[u]=n.state,this.lines[u+1]=null,this.currentLine>u+1&&(this.currentLine=u+1)):this.currentLine==u&&(this.currentLine=u+1),this.lines[u]=n.tokens},a.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},a}();d.implement(g.prototype,p),e.BackgroundTokenizer=g});ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(t,e,c){"use strict";var d=t("./lib/lang"),p=t("./range").Range,g=function(){function a(u,o,r){r===void 0&&(r="text"),this.setRegexp(u),this.clazz=o,this.type=r}return a.prototype.setRegexp=function(u){this.regExp+""!=u+""&&(this.regExp=u,this.cache=[])},a.prototype.update=function(u,o,r,n){if(this.regExp)for(var i=n.firstRow,s=n.lastRow,l={},h=i;h<=s;h++){var f=this.cache[h];f==null&&(f=d.getMatchOffsets(r.getLine(h),this.regExp),f.length>this.MAX_RANGES&&(f=f.slice(0,this.MAX_RANGES)),f=f.map(function(x){return new p(h,x.offset,h,x.offset+x.length)}),this.cache[h]=f.length?f:"");for(var b=f.length;b--;){var C=f[b].toScreenRange(r),w=C.toString();l[w]||(l[w]=!0,o.drawSingleLineMarker(u,C,this.clazz,n))}}},a}();g.prototype.MAX_RANGES=500,e.SearchHighlight=g});ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,e,c){"use strict";var d=function(){function v(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return v.prototype.addSession=function(E){this.$session=E},v.prototype.add=function(E,$,M){if(!this.$fromUndo&&E!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),$===!1||!this.lastDeltas){this.lastDeltas=[];var S=this.$undoStack.length;S>this.$undoDepth-1&&this.$undoStack.splice(0,S-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),E.id=this.$rev=++this.$maxRev}(E.action=="remove"||E.action=="insert")&&(this.$lastDelta=E),this.lastDeltas.push(E)}},v.prototype.addSelection=function(E,$){this.selections.push({value:E,rev:$||this.$rev})},v.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},v.prototype.markIgnored=function(E,$){$==null&&($=this.$rev+1);for(var M=this.$undoStack,S=M.length;S--;){var T=M[S][0];if(T.id<=E)break;T.id<$&&(T.ignore=!0)}this.lastDeltas=null},v.prototype.getSelection=function(E,$){for(var M=this.selections,S=M.length;S--;){var T=M[S];if(T.rev0},v.prototype.canRedo=function(){return this.$redoStack.length>0},v.prototype.bookmark=function(E){E==null&&(E=this.$rev),this.mark=E},v.prototype.isAtBookmark=function(){return this.$rev===this.mark},v.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},v.prototype.fromJSON=function(E){this.reset(),this.$undoStack=E.$undoStack,this.$redoStack=E.$redoStack},v.prototype.$prettyPrint=function(E){return E?i(E):i(this.$undoStack)+` +`},r.prototype.getLine=function(n){return this.$lines[n]||""},r.prototype.getLines=function(n,i){return this.$lines.slice(n,i+1)},r.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},r.prototype.getLength=function(){return this.$lines.length},r.prototype.getTextRange=function(n){return this.getLinesForRange(n).join(this.getNewLineCharacter())},r.prototype.getLinesForRange=function(n){var i;if(n.start.row===n.end.row)i=[this.getLine(n.start.row).substring(n.start.column,n.end.column)];else{i=this.getLines(n.start.row,n.end.row),i[0]=(i[0]||"").substring(n.start.column);var s=i.length-1;n.end.row-n.start.row==s&&(i[s]=i[s].substring(0,n.end.column))}return i},r.prototype.insertLines=function(n,i){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(n,i)},r.prototype.removeLines=function(n,i){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(n,i)},r.prototype.insertNewLine=function(n){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(n,["",""])},r.prototype.insert=function(n,i){return this.getLength()<=1&&this.$detectNewLine(i),this.insertMergedLines(n,this.$split(i))},r.prototype.insertInLine=function(n,i){var s=this.clippedPos(n.row,n.column),l=this.pos(n.row,n.column+i.length);return this.applyDelta({start:s,end:l,action:"insert",lines:[i]},!0),this.clonePos(l)},r.prototype.clippedPos=function(n,i){var s=this.getLength();n===void 0?n=s:n<0?n=0:n>=s&&(n=s-1,i=void 0);var l=this.getLine(n);return i==null&&(i=l.length),i=Math.min(Math.max(i,0),l.length),{row:n,column:i}},r.prototype.clonePos=function(n){return{row:n.row,column:n.column}},r.prototype.pos=function(n,i){return{row:n,column:i}},r.prototype.$clipPosition=function(n){var i=this.getLength();return n.row>=i?(n.row=Math.max(0,i-1),n.column=this.getLine(i-1).length):(n.row=Math.max(0,n.row),n.column=Math.min(Math.max(n.column,0),this.getLine(n.row).length)),n},r.prototype.insertFullLines=function(n,i){n=Math.min(Math.max(n,0),this.getLength());var s=0;n0,l=i=0&&this.applyDelta({start:this.pos(n,this.getLine(n).length),end:this.pos(n+1,0),action:"remove",lines:["",""]})},r.prototype.replace=function(n,i){if(n instanceof a||(n=a.fromPoints(n.start,n.end)),i.length===0&&n.isEmpty())return n.start;if(i==this.getTextRange(n))return n.end;this.remove(n);var s;return i?s=this.insert(n.start,i):s=n.start,s},r.prototype.applyDeltas=function(n){for(var i=0;i=0;i--)this.revertDelta(n[i])},r.prototype.applyDelta=function(n,i){var s=n.action=="insert";(s?n.lines.length<=1&&!n.lines[0]:!a.comparePoints(n.start,n.end))||(s&&n.lines.length>2e4?this.$splitAndapplyLargeDelta(n,2e4):(p(this.$lines,n,i),this._signal("change",n)))},r.prototype.$safeApplyDelta=function(n){var i=this.$lines.length;(n.action=="remove"&&n.start.row20){r.running=setTimeout(r.$worker,20);break}}r.currentLine=i,s==-1&&(s=i),h<=s&&r.fireUpdateEvent(h,s)}}}return a.prototype.setTokenizer=function(u){this.tokenizer=u,this.lines=[],this.states=[],this.start(0)},a.prototype.setDocument=function(u){this.doc=u,this.lines=[],this.states=[],this.stop()},a.prototype.fireUpdateEvent=function(u,o){var r={first:u,last:o};this._signal("update",{data:r})},a.prototype.start=function(u){this.currentLine=Math.min(u||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},a.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},a.prototype.$updateOnChange=function(u){var o=u.start.row,r=u.end.row-o;if(r===0)this.lines[o]=null;else if(u.action=="remove")this.lines.splice(o,r+1,null),this.states.splice(o,r+1,null);else{var n=Array(r+1);n.unshift(o,1),this.lines.splice.apply(this.lines,n),this.states.splice.apply(this.states,n)}this.currentLine=Math.min(o,this.currentLine,this.doc.getLength()),this.stop()},a.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},a.prototype.getTokens=function(u){return this.lines[u]||this.$tokenizeRow(u)},a.prototype.getState=function(u){return this.currentLine==u&&this.$tokenizeRow(u),this.states[u]||"start"},a.prototype.$tokenizeRow=function(u){var o=this.doc.getLine(u),r=this.states[u-1],n=this.tokenizer.getLineTokens(o,r,u);return this.states[u]+""!=n.state+""?(this.states[u]=n.state,this.lines[u+1]=null,this.currentLine>u+1&&(this.currentLine=u+1)):this.currentLine==u&&(this.currentLine=u+1),this.lines[u]=n.tokens},a.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},a}();d.implement(g.prototype,p),e.BackgroundTokenizer=g});ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(t,e,c){"use strict";var d=t("./lib/lang"),p=t("./range").Range,g=function(){function a(u,o,r){r===void 0&&(r="text"),this.setRegexp(u),this.clazz=o,this.type=r}return a.prototype.setRegexp=function(u){this.regExp+""!=u+""&&(this.regExp=u,this.cache=[])},a.prototype.update=function(u,o,r,n){if(this.regExp)for(var i=n.firstRow,s=n.lastRow,l={},h=i;h<=s;h++){var f=this.cache[h];f==null&&(f=d.getMatchOffsets(r.getLine(h),this.regExp),f.length>this.MAX_RANGES&&(f=f.slice(0,this.MAX_RANGES)),f=f.map(function(x){return new p(h,x.offset,h,x.offset+x.length)}),this.cache[h]=f.length?f:"");for(var b=f.length;b--;){var C=f[b].toScreenRange(r),w=C.toString();l[w]||(l[w]=!0,o.drawSingleLineMarker(u,C,this.clazz,n))}}},a}();g.prototype.MAX_RANGES=500,e.SearchHighlight=g});ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,e,c){"use strict";var d=function(){function v(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return v.prototype.addSession=function(T){this.$session=T},v.prototype.add=function(T,L,M){if(!this.$fromUndo&&T!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),L===!1||!this.lastDeltas){this.lastDeltas=[];var E=this.$undoStack.length;E>this.$undoDepth-1&&this.$undoStack.splice(0,E-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),T.id=this.$rev=++this.$maxRev}(T.action=="remove"||T.action=="insert")&&(this.$lastDelta=T),this.lastDeltas.push(T)}},v.prototype.addSelection=function(T,L){this.selections.push({value:T,rev:L||this.$rev})},v.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},v.prototype.markIgnored=function(T,L){L==null&&(L=this.$rev+1);for(var M=this.$undoStack,E=M.length;E--;){var S=M[E][0];if(S.id<=T)break;S.id0},v.prototype.canRedo=function(){return this.$redoStack.length>0},v.prototype.bookmark=function(T){T==null&&(T=this.$rev),this.mark=T},v.prototype.isAtBookmark=function(){return this.$rev===this.mark},v.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},v.prototype.fromJSON=function(T){this.reset(),this.$undoStack=T.$undoStack,this.$redoStack=T.$redoStack},v.prototype.$prettyPrint=function(T){return T?i(T):i(this.$undoStack)+` --- -`+i(this.$redoStack)},v}();d.prototype.hasUndo=d.prototype.canUndo,d.prototype.hasRedo=d.prototype.canRedo,d.prototype.isClean=d.prototype.isAtBookmark,d.prototype.markClean=d.prototype.bookmark;function p(v,E){for(var $=E;$--;){var M=v[$];if(M&&!M[0].ignore){for(;$0){m.row+=S,m.column+=m.row==M.row?T:0;continue}!E&&_<=0&&(m.row=$.row,m.column=$.column,_===0&&(m.bias=1))}}}function r(v){return{row:v.row,column:v.column}}function n(v){return{start:r(v.start),end:r(v.end),action:v.action,lines:v.lines.slice()}}function i(v){if(v=v||this,Array.isArray(v))return v.map(i).join(` -`);var E="";return v.action?(E=v.action=="insert"?"+":"-",E+="["+v.lines+"]"):v.value&&(Array.isArray(v.value)?E=v.value.map(s).join(` -`):E=s(v.value)),v.start&&(E+=s(v)),(v.id||v.rev)&&(E+=" ("+(v.id||v.rev)+")"),E}function s(v){return v.start.row+":"+v.start.column+"=>"+v.end.row+":"+v.end.column}function l(v,E){var $=v.action=="insert",M=E.action=="insert";if($&&M)if(a(E.start,v.end)>=0)b(E,v,-1);else if(a(E.start,v.start)<=0)b(v,E,1);else return null;else if($&&!M)if(a(E.start,v.end)>=0)b(E,v,-1);else if(a(E.end,v.start)<=0)b(v,E,-1);else return null;else if(!$&&M)if(a(E.start,v.start)>=0)b(E,v,1);else if(a(E.start,v.start)<=0)b(v,E,1);else return null;else if(!$&&!M)if(a(E.start,v.start)>=0)b(E,v,1);else if(a(E.end,v.start)<=0)b(v,E,-1);else return null;return[E,v]}function h(v,E){for(var $=v.length;$--;)for(var M=0;M=0?b(v,E,-1):(a(v.start,E.start)<=0||b(v,g.fromPoints(E.start,v.start),-1),b(E,v,1));else if(!$&&M)a(E.start,v.end)>=0?b(E,v,-1):(a(E.start,v.start)<=0||b(E,g.fromPoints(v.start,E.start),-1),b(v,E,1));else if(!$&&!M)if(a(E.start,v.end)>=0)b(E,v,-1);else if(a(E.end,v.start)<=0)b(v,E,-1);else{var S,T;return a(v.start,E.start)<0&&(S=v,v=w(v,E.start)),a(v.end,E.end)>0&&(T=w(v,E.end)),C(E.end,v.start,v.end,-1),T&&!S&&(v.lines=T.lines,v.start=T.start,v.end=T.end,T=v),[E,S,T].filter(Boolean)}return[E,v]}function b(v,E,$){C(v.start,E.start,E.end,$),C(v.end,E.start,E.end,$)}function C(v,E,$,M){v.row==(M==1?E:$).row&&(v.column+=M*($.column-E.column)),v.row+=M*($.row-E.row)}function w(v,E){var $=v.lines,M=v.end;v.end=r(E);var S=v.end.row-v.start.row,T=$.splice(S,$.length),y=S?E.column:E.column-v.start.column;$.push(T[0].substring(0,y)),T[0]=T[0].substr(y);var m={start:r(E),end:M,lines:T,action:v.action};return m}function x(v,E){E=n(E);for(var $=v.length;$--;){for(var M=v[$],S=0;Sthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(a),this.folds.sort(function(u,o){return-u.range.compareEnd(o.start.row,o.start.column)}),this.range.compareEnd(a.start.row,a.start.column)>0?(this.end.row=a.end.row,this.end.column=a.end.column):this.range.compareStart(a.end.row,a.end.column)<0&&(this.start.row=a.start.row,this.start.column=a.start.column)}else if(a.start.row==this.end.row)this.folds.push(a),this.end.row=a.end.row,this.end.column=a.end.column;else if(a.end.row==this.start.row)this.folds.unshift(a),this.start.row=a.start.row,this.start.column=a.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");a.foldLine=this},g.prototype.containsRow=function(a){return a>=this.start.row&&a<=this.end.row},g.prototype.walk=function(a,u,o){var r=0,n=this.folds,i,s,l,h=!0;u==null&&(u=this.end.row,o=this.end.column);for(var f=0;f0)){var h=p(u,s.start);return l===0?o&&h!==0?-i-2:i:h>0||h===0&&!o?i:-i-1}}return-i-1},a.prototype.add=function(u){var o=!u.isEmpty(),r=this.pointIndex(u.start,o);r<0&&(r=-r-1);var n=this.pointIndex(u.end,o,r);return n<0?n=-n-1:n++,this.ranges.splice(r,n-r,u)},a.prototype.addList=function(u){for(var o=[],r=u.length;r--;)o.push.apply(o,this.add(u[r]));return o},a.prototype.substractPoint=function(u){var o=this.pointIndex(u);if(o>=0)return this.ranges.splice(o,1)},a.prototype.merge=function(){var u=[],o=this.ranges;o=o.sort(function(l,h){return p(l.start,h.start)});for(var r=o[0],n,i=1;i=0},a.prototype.containsPoint=function(u){return this.pointIndex(u)>=0},a.prototype.rangeAtPoint=function(u){var o=this.pointIndex(u);if(o>=0)return this.ranges[o]},a.prototype.clipRows=function(u,o){var r=this.ranges;if(r[0].start.row>o||r[r.length-1].start.row=n)break}if(u.action=="insert")for(var b=i-n,C=-o.column+r.column;ln)break;if(f.start.row==n&&f.start.column>=o.column&&(f.start.column==o.column&&this.$bias<=0||(f.start.column+=C,f.start.row+=b)),f.end.row==n&&f.end.column>=o.column){if(f.end.column==o.column&&this.$bias<0)continue;f.end.column==o.column&&C>0&&lf.start.column&&f.end.column==s[l+1].start.column&&(f.end.column-=C),f.end.column+=C,f.end.row+=b}}else for(var b=n-i,C=o.column-r.column;li)break;f.end.rowo.column)&&(f.end.column=o.column,f.end.row=o.row):(f.end.column+=C,f.end.row+=b):f.end.row>i&&(f.end.row+=b),f.start.rowo.column)&&(f.start.column=o.column,f.start.row=o.row):(f.start.column+=C,f.start.row+=b):f.start.row>i&&(f.start.row+=b)}if(b!=0&&l=r)return l;if(l.end.row>r)return null}return null},this.getNextFoldLine=function(r,n){var i=this.$foldData,s=0;for(n&&(s=i.indexOf(n)),s==-1&&(s=0),s;s=r)return l}return null},this.getFoldedRowCount=function(r,n){for(var i=this.$foldData,s=n-r+1,l=0;l=n){b=r?s-=n-b:s=0);break}else f>=r&&(b>=r?s-=f-b:s-=f-r+1)}return s},this.$addFoldLine=function(r){return this.$foldData.push(r),this.$foldData.sort(function(n,i){return n.start.row-i.start.row}),r},this.addFold=function(r,n){var i=this.$foldData,s=!1,l;r instanceof g?l=r:(l=new g(n,r),l.collapseChildren=n.collapseChildren),this.$clipRangeToDocument(l.range);var h=l.start.row,f=l.start.column,b=l.end.row,C=l.end.column,w=this.getFoldAt(h,f,1),x=this.getFoldAt(b,C,-1);if(w&&x==w)return w.addSubFold(l);w&&!w.range.isStart(h,f)&&this.removeFold(w),x&&!x.range.isEnd(b,C)&&this.removeFold(x);var A=this.getFoldsInRange(l.range);A.length>0&&(this.removeFolds(A),l.collapseChildren||A.forEach(function(M){l.addSubFold(M)}));for(var v=0;v0&&this.foldAll(r.start.row+1,r.end.row,r.collapseChildren-1),r.subFolds=[]},this.expandFolds=function(r){r.forEach(function(n){this.expandFold(n)},this)},this.unfold=function(r,n){var i,s;if(r==null)i=new d(0,0,this.getLength(),0),n==null&&(n=!0);else if(typeof r=="number")i=new d(r,0,r,this.getLine(r).length);else if("row"in r)i=d.fromPoints(r,r);else{if(Array.isArray(r))return s=[],r.forEach(function(h){s=s.concat(this.unfold(h))},this),s;i=r}s=this.getFoldsInRangeList(i);for(var l=s;s.length==1&&d.comparePoints(s[0].start,i.start)<0&&d.comparePoints(s[0].end,i.end)>0;)this.expandFolds(s),s=this.getFoldsInRangeList(i);if(n!=!1?this.removeFolds(s):this.expandFolds(s),l.length)return l},this.isRowFolded=function(r,n){return!!this.getFoldLine(r,n)},this.getRowFoldEnd=function(r,n){var i=this.getFoldLine(r,n);return i?i.end.row:r},this.getRowFoldStart=function(r,n){var i=this.getFoldLine(r,n);return i?i.start.row:r},this.getFoldDisplayLine=function(r,n,i,s,l){s==null&&(s=r.start.row),l==null&&(l=0),n==null&&(n=r.end.row),i==null&&(i=this.getLine(n).length);var h=this.doc,f="";return r.walk(function(b,C,w,x){if(!(CC)break;while(l&&f.test(l.type)&&!/^comment.start/.test(l.type));l=s.stepBackward()}else l=s.getCurrentToken();return b.end.row=s.getCurrentTokenRow(),b.end.column=s.getCurrentTokenColumn(),/^comment.end/.test(l.type)||(b.end.column+=l.value.length-2),b}},this.foldAll=function(r,n,i,s){i==null&&(i=1e5);var l=this.foldWidgets;if(l){n=n||this.getLength(),r=r||0;for(var h=r;h=r&&(h=f.end.row,f.collapseChildren=i,this.addFold("...",f))}}},this.foldToLevel=function(r){for(this.foldAll();r-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var r=this;this.foldAll(null,null,null,function(n){for(var i=r.getTokens(n),s=0;s=0;){var h=i[s];if(h==null&&(h=i[s]=this.getFoldWidget(s)),h=="start"){var f=this.getFoldWidgetRange(s);if(l||(l=f),f&&f.end.row>=r)break}s--}return{range:s!==-1&&f,firstRange:l}},this.onFoldWidgetClick=function(r,n){n instanceof u&&(n=n.domEvent);var i={children:n.shiftKey,all:n.ctrlKey||n.metaKey,siblings:n.altKey},s=this.$toggleFoldWidget(r,i);if(!s){var l=n.target||n.srcElement;l&&/ace_fold-widget/.test(l.className)&&(l.className+=" ace_invalid")}},this.$toggleFoldWidget=function(r,n){if(this.getFoldWidget){var i=this.getFoldWidget(r),s=this.getLine(r),l=i==="end"?-1:1,h=this.getFoldAt(r,l===-1?0:s.length,l);if(h)return n.children||n.all?this.removeFold(h):this.expandFold(h),h;var f=this.getFoldWidgetRange(r,!0);if(f&&!f.isMultiLine()&&(h=this.getFoldAt(f.start.row,f.start.column,1),h&&f.isEqual(h.range)))return this.removeFold(h),h;if(n.siblings){var b=this.getParentFoldRangeData(r);if(b.range)var C=b.range.start.row+1,w=b.range.end.row;this.foldAll(C,w,n.all?1e4:0)}else n.children?(w=f?f.end.row:this.getLength(),this.foldAll(r+1,w,n.all?1e4:0)):f&&(n.all&&(f.collapseChildren=1e4),this.addFold("...",f));return f}},this.toggleFoldWidget=function(r){var n=this.selection.getCursor().row;n=this.getRowFoldStart(n);var i=this.$toggleFoldWidget(n,{});if(!i){var s=this.getParentFoldRangeData(n,!0);if(i=s.range||s.firstRange,i){n=i.start.row;var l=this.getFoldAt(n,this.getLine(n).length,1);l?this.removeFold(l):this.addFold("...",i)}}},this.updateFoldWidgets=function(r){var n=r.start.row,i=r.end.row-n;if(i===0)this.foldWidgets[n]=null;else if(r.action=="remove")this.foldWidgets.splice(n,i+1,null);else{var s=Array(i+1);s.unshift(n,1),this.foldWidgets.splice.apply(this.foldWidgets,s)}},this.tokenizerUpdateFoldWidgets=function(r){var n=r.data;n.first!=n.last&&this.foldWidgets.length>n.first&&this.foldWidgets.splice(n.first,this.foldWidgets.length)}}e.Folding=o});ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,e,c){"use strict";var d=t("../token_iterator").TokenIterator,p=t("../range").Range;function g(){this.findMatchingBracket=function(a,u){if(a.column==0)return null;var o=u||this.getLine(a.row).charAt(a.column-1);if(o=="")return null;var r=o.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],a):this.$findOpeningBracket(r[2],a):null},this.getBracketRange=function(a){var u=this.getLine(a.row),o=!0,r,n=u.charAt(a.column-1),i=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(i||(n=u.charAt(a.column),a={row:a.row,column:a.column+1},i=n&&n.match(/([\(\[\{])|([\)\]\}])/),o=!1),!i)return null;if(i[1]){var s=this.$findClosingBracket(i[1],a);if(!s)return null;r=p.fromPoints(a,s),o||(r.end.column++,r.start.column--),r.cursor=r.end}else{var s=this.$findOpeningBracket(i[2],a);if(!s)return null;r=p.fromPoints(s,a),o||(r.start.column++,r.end.column--),r.cursor=r.start}return r},this.getMatchingBracketRanges=function(a,u){var o=this.getLine(a.row),r=/([\(\[\{])|([\)\]\}])/,n=!u&&o.charAt(a.column-1),i=n&&n.match(r);if(i||(n=(u===void 0||u)&&o.charAt(a.column),a={row:a.row,column:a.column+1},i=n&&n.match(r)),!i)return null;var s=new p(a.row,a.column-1,a.row,a.column),l=i[1]?this.$findClosingBracket(i[1],a):this.$findOpeningBracket(i[2],a);if(!l)return[s];var h=new p(l.row,l.column,l.row,l.column+1);return[s,h]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(a,u,o){var r=this.$brackets[a],n=1,i=new d(this,u.row,u.column),s=i.getCurrentToken();if(s||(s=i.stepForward()),!!s){o||(o=new RegExp("(\\.?"+s.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var l=u.column-i.getCurrentTokenColumn()-2,h=s.value;;){for(;l>=0;){var f=h.charAt(l);if(f==r){if(n-=1,n==0)return{row:i.getCurrentTokenRow(),column:l+i.getCurrentTokenColumn()}}else f==a&&(n+=1);l-=1}do s=i.stepBackward();while(s&&!o.test(s.type));if(s==null)break;h=s.value,l=h.length-1}return null}},this.$findClosingBracket=function(a,u,o){var r=this.$brackets[a],n=1,i=new d(this,u.row,u.column),s=i.getCurrentToken();if(s||(s=i.stepForward()),!!s){o||(o=new RegExp("(\\.?"+s.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var l=u.column-i.getCurrentTokenColumn();;){for(var h=s.value,f=h.length;l"?r=!0:u.type.indexOf("tag-name")!==-1&&(o=!0));while(u&&!o);return u},this.$findClosingTag=function(a,u){var o,r=u.value,n=u.value,i=0,s=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);u=a.stepForward();var l=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+u.value.length),h=!1;do if(o=u,u=a.stepForward(),u){if(u.value===">"&&!h){var f=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);h=!0}if(u.type.indexOf("tag-name")!==-1){if(r=u.value,n===r){if(o.value==="<")i++;else if(o.value==="")var w=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);else return}}}else if(n===r&&u.value==="/>"&&(i--,i<0))var b=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+2),C=b,w=C,f=new p(l.end.row,l.end.column,l.end.row,l.end.column+1)}while(u&&i>=0);if(s&&f&&b&&w&&l&&C)return{openTag:new p(s.start.row,s.start.column,f.end.row,f.end.column),closeTag:new p(b.start.row,b.start.column,w.end.row,w.end.column),openTagName:l,closeTagName:C}},this.$findOpeningTag=function(a,u){var o=a.getCurrentToken(),r=u.value,n=0,i=a.getCurrentTokenRow(),s=a.getCurrentTokenColumn(),l=s+2,h=new p(i,s,i,l);a.stepForward();var f=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+u.value.length);if(u=a.stepForward(),!(!u||u.value!==">")){var b=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);a.stepBackward(),a.stepBackward();do if(u=o,i=a.getCurrentTokenRow(),s=a.getCurrentTokenColumn(),l=s+u.value.length,o=a.stepBackward(),u){if(u.type.indexOf("tag-name")!==-1){if(r===u.value)if(o.value==="<"){if(n++,n>0){var C=new p(i,s,i,l),w=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);do u=a.stepForward();while(u&&u.value!==">");var x=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1)}}else o.value===""){for(var A=0,v=o;v;){if(v.type.indexOf("tag-name")!==-1&&v.value===r){n--;break}else if(v.value==="<")break;v=a.stepBackward(),A++}for(var E=0;Em&&(this.$docRowCache.splice(m,y),this.$screenRowCache.splice(m,y))},S.prototype.$getRowCacheIndex=function(T,y){for(var m=0,L=T.length-1;m<=L;){var _=m+L>>1,k=T[_];if(y>k)m=_+1;else if(y=y));k++);return L=m[k],L?(L.index=k,L.start=_-L.value.length,L):null},S.prototype.setUndoManager=function(T){if(this.$undoManager=T,this.$informUndoManager&&this.$informUndoManager.cancel(),T){var y=this;T.addSession(this),this.$syncInformUndoManager=function(){y.$informUndoManager.cancel(),y.mergeUndoDeltas=!1},this.$informUndoManager=p.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},S.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},S.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},S.prototype.getTabString=function(){return this.getUseSoftTabs()?p.stringRepeat(" ",this.getTabSize()):" "},S.prototype.setUseSoftTabs=function(T){this.setOption("useSoftTabs",T)},S.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},S.prototype.setTabSize=function(T){this.setOption("tabSize",T)},S.prototype.getTabSize=function(){return this.$tabSize},S.prototype.isTabStop=function(T){return this.$useSoftTabs&&T.column%this.$tabSize===0},S.prototype.setNavigateWithinSoftTabs=function(T){this.setOption("navigateWithinSoftTabs",T)},S.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},S.prototype.setOverwrite=function(T){this.setOption("overwrite",T)},S.prototype.getOverwrite=function(){return this.$overwrite},S.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},S.prototype.addGutterDecoration=function(T,y){this.$decorations[T]||(this.$decorations[T]=""),this.$decorations[T]+=" "+y,this._signal("changeBreakpoint",{})},S.prototype.removeGutterDecoration=function(T,y){this.$decorations[T]=(this.$decorations[T]||"").replace(" "+y,""),this._signal("changeBreakpoint",{})},S.prototype.getBreakpoints=function(){return this.$breakpoints},S.prototype.setBreakpoints=function(T){this.$breakpoints=[];for(var y=0;y0&&(L=!!m.charAt(y-1).match(this.tokenRe)),L||(L=!!m.charAt(y).match(this.tokenRe)),L)var _=this.tokenRe;else if(/^\s+$/.test(m.slice(y-1,y+1)))var _=/\s/;else var _=this.nonTokenRe;var k=y;if(k>0){do k--;while(k>=0&&m.charAt(k).match(_));k++}for(var I=y;IT&&(T=y.screenWidth)}),this.lineWidgetWidth=T},S.prototype.$computeWidth=function(T){if(this.$modified||T){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var y=this.doc.getAllLines(),m=this.$rowLengthCache,L=0,_=0,k=this.$foldData[_],I=k?k.start.row:1/0,R=y.length,D=0;DI){if(D=k.end.row+1,D>=R)break;k=this.$foldData[_++],I=k?k.start.row:1/0}m[D]==null&&(m[D]=this.$getStringScreenWidth(y[D])[0]),m[D]>L&&(L=m[D])}this.screenWidth=L}},S.prototype.getLine=function(T){return this.doc.getLine(T)},S.prototype.getLines=function(T,y){return this.doc.getLines(T,y)},S.prototype.getLength=function(){return this.doc.getLength()},S.prototype.getTextRange=function(T){return this.doc.getTextRange(T||this.selection.getRange())},S.prototype.insert=function(T,y){return this.doc.insert(T,y)},S.prototype.remove=function(T){return this.doc.remove(T)},S.prototype.removeFullLines=function(T,y){return this.doc.removeFullLines(T,y)},S.prototype.undoChanges=function(T,y){if(T.length){this.$fromUndo=!0;for(var m=T.length-1;m!=-1;m--){var L=T[m];L.action=="insert"||L.action=="remove"?this.doc.revertDelta(L):L.folds&&this.addFolds(L.folds)}!y&&this.$undoSelect&&(T.selectionBefore?this.selection.fromJSON(T.selectionBefore):this.selection.setRange(this.$getUndoSelection(T,!0))),this.$fromUndo=!1}},S.prototype.redoChanges=function(T,y){if(T.length){this.$fromUndo=!0;for(var m=0;mT.end.column&&(k.start.column+=R),k.end.row==T.end.row&&k.end.column>T.end.column&&(k.end.column+=R)),I&&k.start.row>=T.end.row&&(k.start.row+=I,k.end.row+=I)}if(k.end=this.insert(k.start,L),_.length){var D=T.start,O=k.start,I=O.row-D.row,R=O.column-D.column;this.addFolds(_.map(function(H){return H=H.clone(),H.start.row==D.row&&(H.start.column+=R),H.end.row==D.row&&(H.end.column+=R),H.start.row+=I,H.end.row+=I,H}))}return k},S.prototype.indentRows=function(T,y,m){m=m.replace(/\t/g,this.getTabString());for(var L=T;L<=y;L++)this.doc.insertInLine({row:L,column:0},m)},S.prototype.outdentRows=function(T){for(var y=T.collapseRows(),m=new n(0,0,0,0),L=this.getTabSize(),_=y.start.row;_<=y.end.row;++_){var k=this.getLine(_);m.start.row=_,m.end.row=_;for(var I=0;I0){var L=this.getRowFoldEnd(y+m);if(L>this.doc.getLength()-1)return 0;var _=L-y}else{T=this.$clipRowToDocument(T),y=this.$clipRowToDocument(y);var _=y-T+1}var k=new n(T,0,y,Number.MAX_VALUE),I=this.getFoldsInRange(k).map(function(D){return D=D.clone(),D.start.row+=_,D.end.row+=_,D}),R=m==0?this.doc.getLines(T,y):this.doc.removeFullLines(T,y);return this.doc.insertFullLines(T+_,R),I.length&&this.addFolds(I),_},S.prototype.moveLinesUp=function(T,y){return this.$moveLines(T,y,-1)},S.prototype.moveLinesDown=function(T,y){return this.$moveLines(T,y,1)},S.prototype.duplicateLines=function(T,y){return this.$moveLines(T,y,0)},S.prototype.$clipRowToDocument=function(T){return Math.max(0,Math.min(T,this.doc.getLength()-1))},S.prototype.$clipColumnToRow=function(T,y){return y<0?0:Math.min(this.doc.getLine(T).length,y)},S.prototype.$clipPositionToDocument=function(T,y){if(y=Math.max(0,y),T<0)T=0,y=0;else{var m=this.doc.getLength();T>=m?(T=m-1,y=this.doc.getLine(m-1).length):y=Math.min(this.doc.getLine(T).length,y)}return{row:T,column:y}},S.prototype.$clipRangeToDocument=function(T){T.start.row<0?(T.start.row=0,T.start.column=0):T.start.column=this.$clipColumnToRow(T.start.row,T.start.column);var y=this.doc.getLength()-1;return T.end.row>y?(T.end.row=y,T.end.column=this.doc.getLine(y).length):T.end.column=this.$clipColumnToRow(T.end.row,T.end.column),T},S.prototype.setUseWrapMode=function(T){if(T!=this.$useWrapMode){if(this.$useWrapMode=T,this.$modified=!0,this.$resetRowCache(0),T){var y=this.getLength();this.$wrapData=Array(y),this.$updateWrapData(0,y-1)}this._signal("changeWrapMode")}},S.prototype.getUseWrapMode=function(){return this.$useWrapMode},S.prototype.setWrapLimitRange=function(T,y){(this.$wrapLimitRange.min!==T||this.$wrapLimitRange.max!==y)&&(this.$wrapLimitRange={min:T,max:y},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},S.prototype.adjustWrapLimit=function(T,y){var m=this.$wrapLimitRange;m.max<0&&(m={min:y,max:y});var L=this.$constrainWrapLimit(T,m.min,m.max);return L!=this.$wrapLimit&&L>1?(this.$wrapLimit=L,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},S.prototype.$constrainWrapLimit=function(T,y,m){return y&&(T=Math.max(y,T)),m&&(T=Math.min(m,T)),T},S.prototype.getWrapLimit=function(){return this.$wrapLimit},S.prototype.setWrapLimit=function(T){this.setWrapLimitRange(T,T)},S.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},S.prototype.$updateInternalDataOnChange=function(T){var y=this.$useWrapMode,m=T.action,L=T.start,_=T.end,k=L.row,I=_.row,R=I-k,D=null;if(this.$updating=!0,R!=0)if(m==="remove"){this[y?"$wrapData":"$rowLengthCache"].splice(k,R);var O=this.$foldData;D=this.getFoldsInRange(T),this.removeFolds(D);var N=this.getFoldLine(_.row),P=0;if(N){N.addRemoveChars(_.row,_.column,L.column-_.column),N.shiftRow(-R);var H=this.getFoldLine(k);H&&H!==N&&(H.merge(N),N=H),P=O.indexOf(N)+1}for(P;P=_.row&&N.shiftRow(-R)}I=k}else{var F=Array(R);F.unshift(k,0);var U=y?this.$wrapData:this.$rowLengthCache;U.splice.apply(U,F);var O=this.$foldData,N=this.getFoldLine(k),P=0;if(N){var j=N.range.compareInside(L.row,L.column);j==0?(N=N.split(L.row,L.column),N&&(N.shiftRow(R),N.addRemoveChars(I,0,_.column-L.column))):j==-1&&(N.addRemoveChars(k,0,_.column-L.column),N.shiftRow(R)),P=O.indexOf(N)+1}for(P;P=k&&N.shiftRow(R)}}else{R=Math.abs(T.start.column-T.end.column),m==="remove"&&(D=this.getFoldsInRange(T),this.removeFolds(D),R=-R);var N=this.getFoldLine(k);N&&N.addRemoveChars(k,L.column,R)}return y&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,y?this.$updateWrapData(k,I):this.$updateRowLengthCache(k,I),D},S.prototype.$updateRowLengthCache=function(T,y){this.$rowLengthCache[T]=null,this.$rowLengthCache[y]=null},S.prototype.$updateWrapData=function(T,y){var m=this.doc.getAllLines(),L=this.getTabSize(),_=this.$wrapData,k=this.$wrapLimit,I,R,D=T;for(y=Math.min(y,m.length-1);D<=y;)R=this.getFoldLine(D,R),R?(I=[],R.walk(function(O,N,P,H){var F;if(O!=null){F=this.$getDisplayTokens(O,I.length),F[0]=w;for(var U=1;Uy-H;){var F=k+y-H;if(T[F-1]>=v&&T[F]>=v){P(F);continue}if(T[F]==w||T[F]==x){for(F;F!=k-1&&T[F]!=w;F--);if(F>k){P(F);continue}for(F=k+y,F;F>2)),k-1);F>U&&T[F]U&&T[F]U&&T[F]==A;)F--}else for(;F>U&&T[F]U){P(++F);continue}F=k+y,T[F]==C&&F--,P(F-H)}return L},S.prototype.$getDisplayTokens=function(T,y){var m=[],L;y=y||0;for(var _=0;_39&&k<48||k>57&&k<64?m.push(A):k>=4352&&M(k)?m.push(b,C):m.push(b)}return m},S.prototype.$getStringScreenWidth=function(T,y,m){if(y==0)return[0,0];y==null&&(y=1/0),m=m||0;var L,_;for(_=0;_=4352&&M(L)?m+=2:m+=1,!(m>y));_++);return[m,_]},S.prototype.getRowLength=function(T){var y=1;return this.lineWidgets&&(y+=this.lineWidgets[T]&&this.lineWidgets[T].rowCount||0),!this.$useWrapMode||!this.$wrapData[T]?y:this.$wrapData[T].length+y},S.prototype.getRowLineCount=function(T){return!this.$useWrapMode||!this.$wrapData[T]?1:this.$wrapData[T].length+1},S.prototype.getRowWrapIndent=function(T){if(this.$useWrapMode){var y=this.screenToDocumentPosition(T,Number.MAX_VALUE),m=this.$wrapData[y.row];return m.length&&m[0]=0)var R=O[N],_=this.$docRowCache[N],H=T>O[P-1];else var H=!P;for(var F=this.getLength()-1,U=this.getNextFoldLine(_),j=U?U.start.row:1/0;R<=T&&(D=this.getRowLength(_),!(R+D>T||_>=F));)R+=D,_++,_>j&&(_=U.end.row+1,U=this.getNextFoldLine(_,U),j=U?U.start.row:1/0),H&&(this.$docRowCache.push(_),this.$screenRowCache.push(R));if(U&&U.start.row<=_)L=this.getFoldDisplayLine(U),_=U.start.row;else{if(R+D<=T||_>F)return{row:F,column:this.getLine(F).length};L=this.getLine(_),U=null}var J=0,z=Math.floor(T-R);if(this.$useWrapMode){var X=this.$wrapData[_];X&&(I=X[z],z>0&&X.length&&(J=X.indent,k=X[z-1]||X[X.length-1],L=L.substring(k)))}return m!==void 0&&this.$bidiHandler.isBidiRow(R+z,_,z)&&(y=this.$bidiHandler.offsetToCol(m)),k+=this.$getStringScreenWidth(L,y-J)[1],this.$useWrapMode&&k>=I&&(k=I-1),U?U.idxToPosition(k):{row:_,column:k}},S.prototype.documentToScreenPosition=function(T,y){if(typeof y>"u")var m=this.$clipPositionToDocument(T.row,T.column);else m=this.$clipPositionToDocument(T,y);T=m.row,y=m.column;var L=0,_=null,k=null;k=this.getFoldAt(T,y,1),k&&(T=k.start.row,y=k.start.column);var I,R=0,D=this.$docRowCache,O=this.$getRowCacheIndex(D,T),N=D.length;if(N&&O>=0)var R=D[O],L=this.$screenRowCache[O],P=T>D[N-1];else var P=!N;for(var H=this.getNextFoldLine(R),F=H?H.start.row:1/0;R=F){if(I=H.end.row+1,I>T)break;H=this.getNextFoldLine(I,H),F=H?H.start.row:1/0}else I=R+1;L+=this.getRowLength(R),R=I,P&&(this.$docRowCache.push(R),this.$screenRowCache.push(L))}var U="";H&&R>=F?(U=this.getFoldDisplayLine(H,T,y),_=H.start.row):(U=this.getLine(T).substring(0,y),_=T);var j=0;if(this.$useWrapMode){var J=this.$wrapData[_];if(J){for(var z=0;U.length>=J[z];)L++,z++;U=U.substring(J[z-1]||0,U.length),j=z>0?J.indent:0}}return this.lineWidgets&&this.lineWidgets[R]&&this.lineWidgets[R].rowsAbove&&(L+=this.lineWidgets[R].rowsAbove),{row:L,column:j+this.$getStringScreenWidth(U)[0]}},S.prototype.documentToScreenColumn=function(T,y){return this.documentToScreenPosition(T,y).column},S.prototype.documentToScreenRow=function(T,y){return this.documentToScreenPosition(T,y).row},S.prototype.getScreenLength=function(){var T=0,y=null;if(this.$useWrapMode)for(var _=this.$wrapData.length,k=0,L=0,y=this.$foldData[L++],I=y?y.start.row:1/0;k<_;){var R=this.$wrapData[k];T+=R?R.length+1:1,k++,k>I&&(k=y.end.row+1,y=this.$foldData[L++],I=y?y.start.row:1/0)}else{T=this.getLength();for(var m=this.$foldData,L=0;Lm));k++);return[L,k]})},S.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},S}();f.$uid=0,f.prototype.$modes=a.$modes,f.prototype.getValue=f.prototype.toString,f.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},f.prototype.$overwrite=!1,f.prototype.$mode=null,f.prototype.$modeId=null,f.prototype.$scrollTop=0,f.prototype.$scrollLeft=0,f.prototype.$wrapLimit=80,f.prototype.$useWrapMode=!1,f.prototype.$wrapLimitRange={min:null,max:null},f.prototype.lineWidgets=null,f.prototype.isFullWidth=M,d.implement(f.prototype,u);var b=1,C=2,w=3,x=4,A=9,v=10,E=11,$=12;function M(S){return S<4352?!1:S>=4352&&S<=4447||S>=4515&&S<=4519||S>=4602&&S<=4607||S>=9001&&S<=9002||S>=11904&&S<=11929||S>=11931&&S<=12019||S>=12032&&S<=12245||S>=12272&&S<=12283||S>=12288&&S<=12350||S>=12353&&S<=12438||S>=12441&&S<=12543||S>=12549&&S<=12589||S>=12593&&S<=12686||S>=12688&&S<=12730||S>=12736&&S<=12771||S>=12784&&S<=12830||S>=12832&&S<=12871||S>=12880&&S<=13054||S>=13056&&S<=19903||S>=19968&&S<=42124||S>=42128&&S<=42182||S>=43360&&S<=43388||S>=44032&&S<=55203||S>=55216&&S<=55238||S>=55243&&S<=55291||S>=63744&&S<=64255||S>=65040&&S<=65049||S>=65072&&S<=65106||S>=65108&&S<=65126||S>=65128&&S<=65131||S>=65281&&S<=65376||S>=65504&&S<=65510}t("./edit_session/folding").Folding.call(f.prototype),t("./edit_session/bracket_match").BracketMatch.call(f.prototype),a.defineOptions(f.prototype,"session",{wrap:{set:function(S){if(!S||S=="off"?S=!1:S=="free"?S=!0:S=="printMargin"?S=-1:typeof S=="string"&&(S=parseInt(S,10)||!1),this.$wrap!=S)if(this.$wrap=S,!S)this.setUseWrapMode(!1);else{var T=typeof S=="number"?S:null;this.setWrapLimitRange(T,T),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(S){S=S=="auto"?this.$mode.type!="text":S!="text",S!=this.$wrapAsCode&&(this.$wrapAsCode=S,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(S){this.$useWorker=S,this.$stopWorker(),S&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(S){S=parseInt(S),S>0&&this.$tabSize!==S&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=S,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(S){this.setFoldStyle(S)},handlesSet:!0},overwrite:{set:function(S){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(S){this.doc.setNewLineMode(S)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(S){this.setMode(S)},get:function(){return this.$modeId},handlesSet:!0}}),e.EditSession=f});ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,e,c){"use strict";var d=t("./lib/lang"),p=t("./lib/oop"),g=t("./range").Range,a=function(){function o(){this.$options={}}return o.prototype.set=function(r){return p.mixin(this.$options,r),this},o.prototype.getOptions=function(){return d.copyObject(this.$options)},o.prototype.setOptions=function(r){this.$options=r},o.prototype.find=function(r){var n=this.$options,i=this.$matchIterator(r,n);if(!i)return!1;var s=null;return i.forEach(function(l,h,f,b){return s=new g(l,h,f,b),h==b&&n.start&&n.start.start&&n.skipCurrent!=!1&&s.isEqual(n.start)?(s=null,!1):!0}),s},o.prototype.findAll=function(r){var n=this.$options;if(!n.needle)return[];this.$assembleRegExp(n);var i=n.range,s=i?r.getLines(i.start.row,i.end.row):r.doc.getAllLines(),l=[],h=n.re;if(n.$isMultiLine){var f=h.length,b=s.length-f,C;e:for(var w=h.offset||0;w<=b;w++){for(var x=0;xE||(l.push(C=new g(w,E,w+f-1,$)),f>2&&(w=w+f-2))}}else for(var M=0;Mm&&l[x].end.row==L;)x--;for(l=l.slice(M,x+1),M=0,x=l.length;M0){m.row+=E,m.column+=m.row==M.row?S:0;continue}!T&&A<=0&&(m.row=L.row,m.column=L.column,A===0&&(m.bias=1))}}}function r(v){return{row:v.row,column:v.column}}function n(v){return{start:r(v.start),end:r(v.end),action:v.action,lines:v.lines.slice()}}function i(v){if(v=v||this,Array.isArray(v))return v.map(i).join(` +`);var T="";return v.action?(T=v.action=="insert"?"+":"-",T+="["+v.lines+"]"):v.value&&(Array.isArray(v.value)?T=v.value.map(s).join(` +`):T=s(v.value)),v.start&&(T+=s(v)),(v.id||v.rev)&&(T+=" ("+(v.id||v.rev)+")"),T}function s(v){return v.start.row+":"+v.start.column+"=>"+v.end.row+":"+v.end.column}function l(v,T){var L=v.action=="insert",M=T.action=="insert";if(L&&M)if(a(T.start,v.end)>=0)b(T,v,-1);else if(a(T.start,v.start)<=0)b(v,T,1);else return null;else if(L&&!M)if(a(T.start,v.end)>=0)b(T,v,-1);else if(a(T.end,v.start)<=0)b(v,T,-1);else return null;else if(!L&&M)if(a(T.start,v.start)>=0)b(T,v,1);else if(a(T.start,v.start)<=0)b(v,T,1);else return null;else if(!L&&!M)if(a(T.start,v.start)>=0)b(T,v,1);else if(a(T.end,v.start)<=0)b(v,T,-1);else return null;return[T,v]}function h(v,T){for(var L=v.length;L--;)for(var M=0;M=0?b(v,T,-1):(a(v.start,T.start)<=0||b(v,g.fromPoints(T.start,v.start),-1),b(T,v,1));else if(!L&&M)a(T.start,v.end)>=0?b(T,v,-1):(a(T.start,v.start)<=0||b(T,g.fromPoints(v.start,T.start),-1),b(v,T,1));else if(!L&&!M)if(a(T.start,v.end)>=0)b(T,v,-1);else if(a(T.end,v.start)<=0)b(v,T,-1);else{var E,S;return a(v.start,T.start)<0&&(E=v,v=w(v,T.start)),a(v.end,T.end)>0&&(S=w(v,T.end)),C(T.end,v.start,v.end,-1),S&&!E&&(v.lines=S.lines,v.start=S.start,v.end=S.end,S=v),[T,E,S].filter(Boolean)}return[T,v]}function b(v,T,L){C(v.start,T.start,T.end,L),C(v.end,T.start,T.end,L)}function C(v,T,L,M){v.row==(M==1?T:L).row&&(v.column+=M*(L.column-T.column)),v.row+=M*(L.row-T.row)}function w(v,T){var L=v.lines,M=v.end;v.end=r(T);var E=v.end.row-v.start.row,S=L.splice(E,L.length),y=E?T.column:T.column-v.start.column;L.push(S[0].substring(0,y)),S[0]=S[0].substr(y);var m={start:r(T),end:M,lines:S,action:v.action};return m}function x(v,T){T=n(T);for(var L=v.length;L--;){for(var M=v[L],E=0;Ethis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(a),this.folds.sort(function(u,o){return-u.range.compareEnd(o.start.row,o.start.column)}),this.range.compareEnd(a.start.row,a.start.column)>0?(this.end.row=a.end.row,this.end.column=a.end.column):this.range.compareStart(a.end.row,a.end.column)<0&&(this.start.row=a.start.row,this.start.column=a.start.column)}else if(a.start.row==this.end.row)this.folds.push(a),this.end.row=a.end.row,this.end.column=a.end.column;else if(a.end.row==this.start.row)this.folds.unshift(a),this.start.row=a.start.row,this.start.column=a.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");a.foldLine=this},g.prototype.containsRow=function(a){return a>=this.start.row&&a<=this.end.row},g.prototype.walk=function(a,u,o){var r=0,n=this.folds,i,s,l,h=!0;u==null&&(u=this.end.row,o=this.end.column);for(var f=0;f0)){var h=p(u,s.start);return l===0?o&&h!==0?-i-2:i:h>0||h===0&&!o?i:-i-1}}return-i-1},a.prototype.add=function(u){var o=!u.isEmpty(),r=this.pointIndex(u.start,o);r<0&&(r=-r-1);var n=this.pointIndex(u.end,o,r);return n<0?n=-n-1:n++,this.ranges.splice(r,n-r,u)},a.prototype.addList=function(u){for(var o=[],r=u.length;r--;)o.push.apply(o,this.add(u[r]));return o},a.prototype.substractPoint=function(u){var o=this.pointIndex(u);if(o>=0)return this.ranges.splice(o,1)},a.prototype.merge=function(){var u=[],o=this.ranges;o=o.sort(function(l,h){return p(l.start,h.start)});for(var r=o[0],n,i=1;i=0},a.prototype.containsPoint=function(u){return this.pointIndex(u)>=0},a.prototype.rangeAtPoint=function(u){var o=this.pointIndex(u);if(o>=0)return this.ranges[o]},a.prototype.clipRows=function(u,o){var r=this.ranges;if(r[0].start.row>o||r[r.length-1].start.row=n)break}if(u.action=="insert")for(var b=i-n,C=-o.column+r.column;ln)break;if(f.start.row==n&&f.start.column>=o.column&&(f.start.column==o.column&&this.$bias<=0||(f.start.column+=C,f.start.row+=b)),f.end.row==n&&f.end.column>=o.column){if(f.end.column==o.column&&this.$bias<0)continue;f.end.column==o.column&&C>0&&lf.start.column&&f.end.column==s[l+1].start.column&&(f.end.column-=C),f.end.column+=C,f.end.row+=b}}else for(var b=n-i,C=o.column-r.column;li)break;f.end.rowo.column)&&(f.end.column=o.column,f.end.row=o.row):(f.end.column+=C,f.end.row+=b):f.end.row>i&&(f.end.row+=b),f.start.rowo.column)&&(f.start.column=o.column,f.start.row=o.row):(f.start.column+=C,f.start.row+=b):f.start.row>i&&(f.start.row+=b)}if(b!=0&&l=r)return l;if(l.end.row>r)return null}return null},this.getNextFoldLine=function(r,n){var i=this.$foldData,s=0;for(n&&(s=i.indexOf(n)),s==-1&&(s=0),s;s=r)return l}return null},this.getFoldedRowCount=function(r,n){for(var i=this.$foldData,s=n-r+1,l=0;l=n){b=r?s-=n-b:s=0);break}else f>=r&&(b>=r?s-=f-b:s-=f-r+1)}return s},this.$addFoldLine=function(r){return this.$foldData.push(r),this.$foldData.sort(function(n,i){return n.start.row-i.start.row}),r},this.addFold=function(r,n){var i=this.$foldData,s=!1,l;r instanceof g?l=r:(l=new g(n,r),l.collapseChildren=n.collapseChildren),this.$clipRangeToDocument(l.range);var h=l.start.row,f=l.start.column,b=l.end.row,C=l.end.column,w=this.getFoldAt(h,f,1),x=this.getFoldAt(b,C,-1);if(w&&x==w)return w.addSubFold(l);w&&!w.range.isStart(h,f)&&this.removeFold(w),x&&!x.range.isEnd(b,C)&&this.removeFold(x);var _=this.getFoldsInRange(l.range);_.length>0&&(this.removeFolds(_),l.collapseChildren||_.forEach(function(M){l.addSubFold(M)}));for(var v=0;v0&&this.foldAll(r.start.row+1,r.end.row,r.collapseChildren-1),r.subFolds=[]},this.expandFolds=function(r){r.forEach(function(n){this.expandFold(n)},this)},this.unfold=function(r,n){var i,s;if(r==null)i=new d(0,0,this.getLength(),0),n==null&&(n=!0);else if(typeof r=="number")i=new d(r,0,r,this.getLine(r).length);else if("row"in r)i=d.fromPoints(r,r);else{if(Array.isArray(r))return s=[],r.forEach(function(h){s=s.concat(this.unfold(h))},this),s;i=r}s=this.getFoldsInRangeList(i);for(var l=s;s.length==1&&d.comparePoints(s[0].start,i.start)<0&&d.comparePoints(s[0].end,i.end)>0;)this.expandFolds(s),s=this.getFoldsInRangeList(i);if(n!=!1?this.removeFolds(s):this.expandFolds(s),l.length)return l},this.isRowFolded=function(r,n){return!!this.getFoldLine(r,n)},this.getRowFoldEnd=function(r,n){var i=this.getFoldLine(r,n);return i?i.end.row:r},this.getRowFoldStart=function(r,n){var i=this.getFoldLine(r,n);return i?i.start.row:r},this.getFoldDisplayLine=function(r,n,i,s,l){s==null&&(s=r.start.row),l==null&&(l=0),n==null&&(n=r.end.row),i==null&&(i=this.getLine(n).length);var h=this.doc,f="";return r.walk(function(b,C,w,x){if(!(CC)break;while(l&&f.test(l.type)&&!/^comment.start/.test(l.type));l=s.stepBackward()}else l=s.getCurrentToken();return b.end.row=s.getCurrentTokenRow(),b.end.column=s.getCurrentTokenColumn(),/^comment.end/.test(l.type)||(b.end.column+=l.value.length-2),b}},this.foldAll=function(r,n,i,s){i==null&&(i=1e5);var l=this.foldWidgets;if(l){n=n||this.getLength(),r=r||0;for(var h=r;h=r&&(h=f.end.row,f.collapseChildren=i,this.addFold("...",f))}}},this.foldToLevel=function(r){for(this.foldAll();r-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var r=this;this.foldAll(null,null,null,function(n){for(var i=r.getTokens(n),s=0;s=0;){var h=i[s];if(h==null&&(h=i[s]=this.getFoldWidget(s)),h=="start"){var f=this.getFoldWidgetRange(s);if(l||(l=f),f&&f.end.row>=r)break}s--}return{range:s!==-1&&f,firstRange:l}},this.onFoldWidgetClick=function(r,n){n instanceof u&&(n=n.domEvent);var i={children:n.shiftKey,all:n.ctrlKey||n.metaKey,siblings:n.altKey},s=this.$toggleFoldWidget(r,i);if(!s){var l=n.target||n.srcElement;l&&/ace_fold-widget/.test(l.className)&&(l.className+=" ace_invalid")}},this.$toggleFoldWidget=function(r,n){if(this.getFoldWidget){var i=this.getFoldWidget(r),s=this.getLine(r),l=i==="end"?-1:1,h=this.getFoldAt(r,l===-1?0:s.length,l);if(h)return n.children||n.all?this.removeFold(h):this.expandFold(h),h;var f=this.getFoldWidgetRange(r,!0);if(f&&!f.isMultiLine()&&(h=this.getFoldAt(f.start.row,f.start.column,1),h&&f.isEqual(h.range)))return this.removeFold(h),h;if(n.siblings){var b=this.getParentFoldRangeData(r);if(b.range)var C=b.range.start.row+1,w=b.range.end.row;this.foldAll(C,w,n.all?1e4:0)}else n.children?(w=f?f.end.row:this.getLength(),this.foldAll(r+1,w,n.all?1e4:0)):f&&(n.all&&(f.collapseChildren=1e4),this.addFold("...",f));return f}},this.toggleFoldWidget=function(r){var n=this.selection.getCursor().row;n=this.getRowFoldStart(n);var i=this.$toggleFoldWidget(n,{});if(!i){var s=this.getParentFoldRangeData(n,!0);if(i=s.range||s.firstRange,i){n=i.start.row;var l=this.getFoldAt(n,this.getLine(n).length,1);l?this.removeFold(l):this.addFold("...",i)}}},this.updateFoldWidgets=function(r){var n=r.start.row,i=r.end.row-n;if(i===0)this.foldWidgets[n]=null;else if(r.action=="remove")this.foldWidgets.splice(n,i+1,null);else{var s=Array(i+1);s.unshift(n,1),this.foldWidgets.splice.apply(this.foldWidgets,s)}},this.tokenizerUpdateFoldWidgets=function(r){var n=r.data;n.first!=n.last&&this.foldWidgets.length>n.first&&this.foldWidgets.splice(n.first,this.foldWidgets.length)}}e.Folding=o});ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,e,c){"use strict";var d=t("../token_iterator").TokenIterator,p=t("../range").Range;function g(){this.findMatchingBracket=function(a,u){if(a.column==0)return null;var o=u||this.getLine(a.row).charAt(a.column-1);if(o=="")return null;var r=o.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],a):this.$findOpeningBracket(r[2],a):null},this.getBracketRange=function(a){var u=this.getLine(a.row),o=!0,r,n=u.charAt(a.column-1),i=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(i||(n=u.charAt(a.column),a={row:a.row,column:a.column+1},i=n&&n.match(/([\(\[\{])|([\)\]\}])/),o=!1),!i)return null;if(i[1]){var s=this.$findClosingBracket(i[1],a);if(!s)return null;r=p.fromPoints(a,s),o||(r.end.column++,r.start.column--),r.cursor=r.end}else{var s=this.$findOpeningBracket(i[2],a);if(!s)return null;r=p.fromPoints(s,a),o||(r.start.column++,r.end.column--),r.cursor=r.start}return r},this.getMatchingBracketRanges=function(a,u){var o=this.getLine(a.row),r=/([\(\[\{])|([\)\]\}])/,n=!u&&o.charAt(a.column-1),i=n&&n.match(r);if(i||(n=(u===void 0||u)&&o.charAt(a.column),a={row:a.row,column:a.column+1},i=n&&n.match(r)),!i)return null;var s=new p(a.row,a.column-1,a.row,a.column),l=i[1]?this.$findClosingBracket(i[1],a):this.$findOpeningBracket(i[2],a);if(!l)return[s];var h=new p(l.row,l.column,l.row,l.column+1);return[s,h]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(a,u,o){var r=this.$brackets[a],n=1,i=new d(this,u.row,u.column),s=i.getCurrentToken();if(s||(s=i.stepForward()),!!s){o||(o=new RegExp("(\\.?"+s.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var l=u.column-i.getCurrentTokenColumn()-2,h=s.value;;){for(;l>=0;){var f=h.charAt(l);if(f==r){if(n-=1,n==0)return{row:i.getCurrentTokenRow(),column:l+i.getCurrentTokenColumn()}}else f==a&&(n+=1);l-=1}do s=i.stepBackward();while(s&&!o.test(s.type));if(s==null)break;h=s.value,l=h.length-1}return null}},this.$findClosingBracket=function(a,u,o){var r=this.$brackets[a],n=1,i=new d(this,u.row,u.column),s=i.getCurrentToken();if(s||(s=i.stepForward()),!!s){o||(o=new RegExp("(\\.?"+s.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var l=u.column-i.getCurrentTokenColumn();;){for(var h=s.value,f=h.length;l"?r=!0:u.type.indexOf("tag-name")!==-1&&(o=!0));while(u&&!o);return u},this.$findClosingTag=function(a,u){var o,r=u.value,n=u.value,i=0,s=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);u=a.stepForward();var l=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+u.value.length),h=!1;do if(o=u,u=a.stepForward(),u){if(u.value===">"&&!h){var f=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);h=!0}if(u.type.indexOf("tag-name")!==-1){if(r=u.value,n===r){if(o.value==="<")i++;else if(o.value==="")var w=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);else return}}}else if(n===r&&u.value==="/>"&&(i--,i<0))var b=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+2),C=b,w=C,f=new p(l.end.row,l.end.column,l.end.row,l.end.column+1)}while(u&&i>=0);if(s&&f&&b&&w&&l&&C)return{openTag:new p(s.start.row,s.start.column,f.end.row,f.end.column),closeTag:new p(b.start.row,b.start.column,w.end.row,w.end.column),openTagName:l,closeTagName:C}},this.$findOpeningTag=function(a,u){var o=a.getCurrentToken(),r=u.value,n=0,i=a.getCurrentTokenRow(),s=a.getCurrentTokenColumn(),l=s+2,h=new p(i,s,i,l);a.stepForward();var f=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+u.value.length);if(u=a.stepForward(),!(!u||u.value!==">")){var b=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);a.stepBackward(),a.stepBackward();do if(u=o,i=a.getCurrentTokenRow(),s=a.getCurrentTokenColumn(),l=s+u.value.length,o=a.stepBackward(),u){if(u.type.indexOf("tag-name")!==-1){if(r===u.value)if(o.value==="<"){if(n++,n>0){var C=new p(i,s,i,l),w=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);do u=a.stepForward();while(u&&u.value!==">");var x=new p(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1)}}else o.value===""){for(var _=0,v=o;v;){if(v.type.indexOf("tag-name")!==-1&&v.value===r){n--;break}else if(v.value==="<")break;v=a.stepBackward(),_++}for(var T=0;T<_;T++)a.stepForward()}}while(o&&n<=0);if(w&&x&&h&&b&&C&&f)return{openTag:new p(w.start.row,w.start.column,x.end.row,x.end.column),closeTag:new p(h.start.row,h.start.column,b.end.row,b.end.column),openTagName:C,closeTagName:f}}}}e.BracketMatch=g});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/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(t,e,c){"use strict";var d=t("./lib/oop"),p=t("./lib/lang"),g=t("./bidihandler").BidiHandler,a=t("./config"),u=t("./lib/event_emitter").EventEmitter,o=t("./selection").Selection,r=t("./mode/text").Mode,n=t("./range").Range,i=t("./document").Document,s=t("./background_tokenizer").BackgroundTokenizer,l=t("./search_highlight").SearchHighlight,h=t("./undomanager").UndoManager,f=function(){function E(S,y){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++E.$uid,this.$foldData.toString=function(){return this.join(` +`)},this.bgTokenizer=new s(new r().getTokenizer(),this);var m=this;this.bgTokenizer.on("update",function($){m._signal("tokenizerUpdate",$)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof S!="object"||!S.getLine)&&(S=new i(S)),this.setDocument(S),this.selection=new o(this),this.$bidiHandler=new g(this),a.resetOptions(this),this.setMode(y),a._signal("session",this),this.destroyed=!1}return E.prototype.setDocument=function(S){this.doc&&this.doc.off("change",this.$onChange),this.doc=S,S.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},E.prototype.getDocument=function(){return this.doc},E.prototype.$resetRowCache=function(S){if(!S){this.$docRowCache=[],this.$screenRowCache=[];return}var y=this.$docRowCache.length,m=this.$getRowCacheIndex(this.$docRowCache,S)+1;y>m&&(this.$docRowCache.splice(m,y),this.$screenRowCache.splice(m,y))},E.prototype.$getRowCacheIndex=function(S,y){for(var m=0,$=S.length-1;m<=$;){var A=m+$>>1,k=S[A];if(y>k)m=A+1;else if(y=y));k++);return $=m[k],$?($.index=k,$.start=A-$.value.length,$):null},E.prototype.setUndoManager=function(S){if(this.$undoManager=S,this.$informUndoManager&&this.$informUndoManager.cancel(),S){var y=this;S.addSession(this),this.$syncInformUndoManager=function(){y.$informUndoManager.cancel(),y.mergeUndoDeltas=!1},this.$informUndoManager=p.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},E.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},E.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},E.prototype.getTabString=function(){return this.getUseSoftTabs()?p.stringRepeat(" ",this.getTabSize()):" "},E.prototype.setUseSoftTabs=function(S){this.setOption("useSoftTabs",S)},E.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},E.prototype.setTabSize=function(S){this.setOption("tabSize",S)},E.prototype.getTabSize=function(){return this.$tabSize},E.prototype.isTabStop=function(S){return this.$useSoftTabs&&S.column%this.$tabSize===0},E.prototype.setNavigateWithinSoftTabs=function(S){this.setOption("navigateWithinSoftTabs",S)},E.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},E.prototype.setOverwrite=function(S){this.setOption("overwrite",S)},E.prototype.getOverwrite=function(){return this.$overwrite},E.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},E.prototype.addGutterDecoration=function(S,y){this.$decorations[S]||(this.$decorations[S]=""),this.$decorations[S]+=" "+y,this._signal("changeBreakpoint",{})},E.prototype.removeGutterDecoration=function(S,y){this.$decorations[S]=(this.$decorations[S]||"").replace(" "+y,""),this._signal("changeBreakpoint",{})},E.prototype.getBreakpoints=function(){return this.$breakpoints},E.prototype.setBreakpoints=function(S){this.$breakpoints=[];for(var y=0;y0&&($=!!m.charAt(y-1).match(this.tokenRe)),$||($=!!m.charAt(y).match(this.tokenRe)),$)var A=this.tokenRe;else if(/^\s+$/.test(m.slice(y-1,y+1)))var A=/\s/;else var A=this.nonTokenRe;var k=y;if(k>0){do k--;while(k>=0&&m.charAt(k).match(A));k++}for(var R=y;RS&&(S=y.screenWidth)}),this.lineWidgetWidth=S},E.prototype.$computeWidth=function(S){if(this.$modified||S){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var y=this.doc.getAllLines(),m=this.$rowLengthCache,$=0,A=0,k=this.$foldData[A],R=k?k.start.row:1/0,I=y.length,D=0;DR){if(D=k.end.row+1,D>=I)break;k=this.$foldData[A++],R=k?k.start.row:1/0}m[D]==null&&(m[D]=this.$getStringScreenWidth(y[D])[0]),m[D]>$&&($=m[D])}this.screenWidth=$}},E.prototype.getLine=function(S){return this.doc.getLine(S)},E.prototype.getLines=function(S,y){return this.doc.getLines(S,y)},E.prototype.getLength=function(){return this.doc.getLength()},E.prototype.getTextRange=function(S){return this.doc.getTextRange(S||this.selection.getRange())},E.prototype.insert=function(S,y){return this.doc.insert(S,y)},E.prototype.remove=function(S){return this.doc.remove(S)},E.prototype.removeFullLines=function(S,y){return this.doc.removeFullLines(S,y)},E.prototype.undoChanges=function(S,y){if(S.length){this.$fromUndo=!0;for(var m=S.length-1;m!=-1;m--){var $=S[m];$.action=="insert"||$.action=="remove"?this.doc.revertDelta($):$.folds&&this.addFolds($.folds)}!y&&this.$undoSelect&&(S.selectionBefore?this.selection.fromJSON(S.selectionBefore):this.selection.setRange(this.$getUndoSelection(S,!0))),this.$fromUndo=!1}},E.prototype.redoChanges=function(S,y){if(S.length){this.$fromUndo=!0;for(var m=0;mS.end.column&&(k.start.column+=I),k.end.row==S.end.row&&k.end.column>S.end.column&&(k.end.column+=I)),R&&k.start.row>=S.end.row&&(k.start.row+=R,k.end.row+=R)}if(k.end=this.insert(k.start,$),A.length){var D=S.start,O=k.start,R=O.row-D.row,I=O.column-D.column;this.addFolds(A.map(function(B){return B=B.clone(),B.start.row==D.row&&(B.start.column+=I),B.end.row==D.row&&(B.end.column+=I),B.start.row+=R,B.end.row+=R,B}))}return k},E.prototype.indentRows=function(S,y,m){m=m.replace(/\t/g,this.getTabString());for(var $=S;$<=y;$++)this.doc.insertInLine({row:$,column:0},m)},E.prototype.outdentRows=function(S){for(var y=S.collapseRows(),m=new n(0,0,0,0),$=this.getTabSize(),A=y.start.row;A<=y.end.row;++A){var k=this.getLine(A);m.start.row=A,m.end.row=A;for(var R=0;R<$&&k.charAt(R)==" ";++R);R<$&&k.charAt(R)==" "?(m.start.column=R,m.end.column=R+1):(m.start.column=0,m.end.column=R),this.remove(m)}},E.prototype.$moveLines=function(S,y,m){if(S=this.getRowFoldStart(S),y=this.getRowFoldEnd(y),m<0){var $=this.getRowFoldStart(S+m);if($<0)return 0;var A=$-S}else if(m>0){var $=this.getRowFoldEnd(y+m);if($>this.doc.getLength()-1)return 0;var A=$-y}else{S=this.$clipRowToDocument(S),y=this.$clipRowToDocument(y);var A=y-S+1}var k=new n(S,0,y,Number.MAX_VALUE),R=this.getFoldsInRange(k).map(function(D){return D=D.clone(),D.start.row+=A,D.end.row+=A,D}),I=m==0?this.doc.getLines(S,y):this.doc.removeFullLines(S,y);return this.doc.insertFullLines(S+A,I),R.length&&this.addFolds(R),A},E.prototype.moveLinesUp=function(S,y){return this.$moveLines(S,y,-1)},E.prototype.moveLinesDown=function(S,y){return this.$moveLines(S,y,1)},E.prototype.duplicateLines=function(S,y){return this.$moveLines(S,y,0)},E.prototype.$clipRowToDocument=function(S){return Math.max(0,Math.min(S,this.doc.getLength()-1))},E.prototype.$clipColumnToRow=function(S,y){return y<0?0:Math.min(this.doc.getLine(S).length,y)},E.prototype.$clipPositionToDocument=function(S,y){if(y=Math.max(0,y),S<0)S=0,y=0;else{var m=this.doc.getLength();S>=m?(S=m-1,y=this.doc.getLine(m-1).length):y=Math.min(this.doc.getLine(S).length,y)}return{row:S,column:y}},E.prototype.$clipRangeToDocument=function(S){S.start.row<0?(S.start.row=0,S.start.column=0):S.start.column=this.$clipColumnToRow(S.start.row,S.start.column);var y=this.doc.getLength()-1;return S.end.row>y?(S.end.row=y,S.end.column=this.doc.getLine(y).length):S.end.column=this.$clipColumnToRow(S.end.row,S.end.column),S},E.prototype.setUseWrapMode=function(S){if(S!=this.$useWrapMode){if(this.$useWrapMode=S,this.$modified=!0,this.$resetRowCache(0),S){var y=this.getLength();this.$wrapData=Array(y),this.$updateWrapData(0,y-1)}this._signal("changeWrapMode")}},E.prototype.getUseWrapMode=function(){return this.$useWrapMode},E.prototype.setWrapLimitRange=function(S,y){(this.$wrapLimitRange.min!==S||this.$wrapLimitRange.max!==y)&&(this.$wrapLimitRange={min:S,max:y},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},E.prototype.adjustWrapLimit=function(S,y){var m=this.$wrapLimitRange;m.max<0&&(m={min:y,max:y});var $=this.$constrainWrapLimit(S,m.min,m.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},E.prototype.$constrainWrapLimit=function(S,y,m){return y&&(S=Math.max(y,S)),m&&(S=Math.min(m,S)),S},E.prototype.getWrapLimit=function(){return this.$wrapLimit},E.prototype.setWrapLimit=function(S){this.setWrapLimitRange(S,S)},E.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},E.prototype.$updateInternalDataOnChange=function(S){var y=this.$useWrapMode,m=S.action,$=S.start,A=S.end,k=$.row,R=A.row,I=R-k,D=null;if(this.$updating=!0,I!=0)if(m==="remove"){this[y?"$wrapData":"$rowLengthCache"].splice(k,I);var O=this.$foldData;D=this.getFoldsInRange(S),this.removeFolds(D);var N=this.getFoldLine(A.row),P=0;if(N){N.addRemoveChars(A.row,A.column,$.column-A.column),N.shiftRow(-I);var B=this.getFoldLine(k);B&&B!==N&&(B.merge(N),N=B),P=O.indexOf(N)+1}for(P;P=A.row&&N.shiftRow(-I)}R=k}else{var H=Array(I);H.unshift(k,0);var V=y?this.$wrapData:this.$rowLengthCache;V.splice.apply(V,H);var O=this.$foldData,N=this.getFoldLine(k),P=0;if(N){var z=N.range.compareInside($.row,$.column);z==0?(N=N.split($.row,$.column),N&&(N.shiftRow(I),N.addRemoveChars(R,0,A.column-$.column))):z==-1&&(N.addRemoveChars(k,0,A.column-$.column),N.shiftRow(I)),P=O.indexOf(N)+1}for(P;P=k&&N.shiftRow(I)}}else{I=Math.abs(S.start.column-S.end.column),m==="remove"&&(D=this.getFoldsInRange(S),this.removeFolds(D),I=-I);var N=this.getFoldLine(k);N&&N.addRemoveChars(k,$.column,I)}return y&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,y?this.$updateWrapData(k,R):this.$updateRowLengthCache(k,R),D},E.prototype.$updateRowLengthCache=function(S,y){this.$rowLengthCache[S]=null,this.$rowLengthCache[y]=null},E.prototype.$updateWrapData=function(S,y){var m=this.doc.getAllLines(),$=this.getTabSize(),A=this.$wrapData,k=this.$wrapLimit,R,I,D=S;for(y=Math.min(y,m.length-1);D<=y;)I=this.getFoldLine(D,I),I?(R=[],I.walk(function(O,N,P,B){var H;if(O!=null){H=this.$getDisplayTokens(O,R.length),H[0]=w;for(var V=1;Vy-B;){var H=k+y-B;if(S[H-1]>=v&&S[H]>=v){P(H);continue}if(S[H]==w||S[H]==x){for(H;H!=k-1&&S[H]!=w;H--);if(H>k){P(H);continue}for(H=k+y,H;H>2)),k-1);H>V&&S[H]V&&S[H]V&&S[H]==_;)H--}else for(;H>V&&S[H]V){P(++H);continue}H=k+y,S[H]==C&&H--,P(H-B)}return $},E.prototype.$getDisplayTokens=function(S,y){var m=[],$;y=y||0;for(var A=0;A39&&k<48||k>57&&k<64?m.push(_):k>=4352&&M(k)?m.push(b,C):m.push(b)}return m},E.prototype.$getStringScreenWidth=function(S,y,m){if(y==0)return[0,0];y==null&&(y=1/0),m=m||0;var $,A;for(A=0;A=4352&&M($)?m+=2:m+=1,!(m>y));A++);return[m,A]},E.prototype.getRowLength=function(S){var y=1;return this.lineWidgets&&(y+=this.lineWidgets[S]&&this.lineWidgets[S].rowCount||0),!this.$useWrapMode||!this.$wrapData[S]?y:this.$wrapData[S].length+y},E.prototype.getRowLineCount=function(S){return!this.$useWrapMode||!this.$wrapData[S]?1:this.$wrapData[S].length+1},E.prototype.getRowWrapIndent=function(S){if(this.$useWrapMode){var y=this.screenToDocumentPosition(S,Number.MAX_VALUE),m=this.$wrapData[y.row];return m.length&&m[0]=0)var I=O[N],A=this.$docRowCache[N],B=S>O[P-1];else var B=!P;for(var H=this.getLength()-1,V=this.getNextFoldLine(A),z=V?V.start.row:1/0;I<=S&&(D=this.getRowLength(A),!(I+D>S||A>=H));)I+=D,A++,A>z&&(A=V.end.row+1,V=this.getNextFoldLine(A,V),z=V?V.start.row:1/0),B&&(this.$docRowCache.push(A),this.$screenRowCache.push(I));if(V&&V.start.row<=A)$=this.getFoldDisplayLine(V),A=V.start.row;else{if(I+D<=S||A>H)return{row:H,column:this.getLine(H).length};$=this.getLine(A),V=null}var Z=0,K=Math.floor(S-I);if(this.$useWrapMode){var q=this.$wrapData[A];q&&(R=q[K],K>0&&q.length&&(Z=q.indent,k=q[K-1]||q[q.length-1],$=$.substring(k)))}return m!==void 0&&this.$bidiHandler.isBidiRow(I+K,A,K)&&(y=this.$bidiHandler.offsetToCol(m)),k+=this.$getStringScreenWidth($,y-Z)[1],this.$useWrapMode&&k>=R&&(k=R-1),V?V.idxToPosition(k):{row:A,column:k}},E.prototype.documentToScreenPosition=function(S,y){if(typeof y>"u")var m=this.$clipPositionToDocument(S.row,S.column);else m=this.$clipPositionToDocument(S,y);S=m.row,y=m.column;var $=0,A=null,k=null;k=this.getFoldAt(S,y,1),k&&(S=k.start.row,y=k.start.column);var R,I=0,D=this.$docRowCache,O=this.$getRowCacheIndex(D,S),N=D.length;if(N&&O>=0)var I=D[O],$=this.$screenRowCache[O],P=S>D[N-1];else var P=!N;for(var B=this.getNextFoldLine(I),H=B?B.start.row:1/0;I=H){if(R=B.end.row+1,R>S)break;B=this.getNextFoldLine(R,B),H=B?B.start.row:1/0}else R=I+1;$+=this.getRowLength(I),I=R,P&&(this.$docRowCache.push(I),this.$screenRowCache.push($))}var V="";B&&I>=H?(V=this.getFoldDisplayLine(B,S,y),A=B.start.row):(V=this.getLine(S).substring(0,y),A=S);var z=0;if(this.$useWrapMode){var Z=this.$wrapData[A];if(Z){for(var K=0;V.length>=Z[K];)$++,K++;V=V.substring(Z[K-1]||0,V.length),z=K>0?Z.indent:0}}return this.lineWidgets&&this.lineWidgets[I]&&this.lineWidgets[I].rowsAbove&&($+=this.lineWidgets[I].rowsAbove),{row:$,column:z+this.$getStringScreenWidth(V)[0]}},E.prototype.documentToScreenColumn=function(S,y){return this.documentToScreenPosition(S,y).column},E.prototype.documentToScreenRow=function(S,y){return this.documentToScreenPosition(S,y).row},E.prototype.getScreenLength=function(){var S=0,y=null;if(this.$useWrapMode)for(var A=this.$wrapData.length,k=0,$=0,y=this.$foldData[$++],R=y?y.start.row:1/0;kR&&(k=y.end.row+1,y=this.$foldData[$++],R=y?y.start.row:1/0)}else{S=this.getLength();for(var m=this.$foldData,$=0;$m));k++);return[$,k]})},E.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},E}();f.$uid=0,f.prototype.$modes=a.$modes,f.prototype.getValue=f.prototype.toString,f.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},f.prototype.$overwrite=!1,f.prototype.$mode=null,f.prototype.$modeId=null,f.prototype.$scrollTop=0,f.prototype.$scrollLeft=0,f.prototype.$wrapLimit=80,f.prototype.$useWrapMode=!1,f.prototype.$wrapLimitRange={min:null,max:null},f.prototype.lineWidgets=null,f.prototype.isFullWidth=M,d.implement(f.prototype,u);var b=1,C=2,w=3,x=4,_=9,v=10,T=11,L=12;function M(E){return E<4352?!1:E>=4352&&E<=4447||E>=4515&&E<=4519||E>=4602&&E<=4607||E>=9001&&E<=9002||E>=11904&&E<=11929||E>=11931&&E<=12019||E>=12032&&E<=12245||E>=12272&&E<=12283||E>=12288&&E<=12350||E>=12353&&E<=12438||E>=12441&&E<=12543||E>=12549&&E<=12589||E>=12593&&E<=12686||E>=12688&&E<=12730||E>=12736&&E<=12771||E>=12784&&E<=12830||E>=12832&&E<=12871||E>=12880&&E<=13054||E>=13056&&E<=19903||E>=19968&&E<=42124||E>=42128&&E<=42182||E>=43360&&E<=43388||E>=44032&&E<=55203||E>=55216&&E<=55238||E>=55243&&E<=55291||E>=63744&&E<=64255||E>=65040&&E<=65049||E>=65072&&E<=65106||E>=65108&&E<=65126||E>=65128&&E<=65131||E>=65281&&E<=65376||E>=65504&&E<=65510}t("./edit_session/folding").Folding.call(f.prototype),t("./edit_session/bracket_match").BracketMatch.call(f.prototype),a.defineOptions(f.prototype,"session",{wrap:{set:function(E){if(!E||E=="off"?E=!1:E=="free"?E=!0:E=="printMargin"?E=-1:typeof E=="string"&&(E=parseInt(E,10)||!1),this.$wrap!=E)if(this.$wrap=E,!E)this.setUseWrapMode(!1);else{var S=typeof E=="number"?E:null;this.setWrapLimitRange(S,S),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(E){E=E=="auto"?this.$mode.type!="text":E!="text",E!=this.$wrapAsCode&&(this.$wrapAsCode=E,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(E){this.$useWorker=E,this.$stopWorker(),E&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(E){E=parseInt(E),E>0&&this.$tabSize!==E&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=E,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(E){this.setFoldStyle(E)},handlesSet:!0},overwrite:{set:function(E){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(E){this.doc.setNewLineMode(E)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(E){this.setMode(E)},get:function(){return this.$modeId},handlesSet:!0}}),e.EditSession=f});ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,e,c){"use strict";var d=t("./lib/lang"),p=t("./lib/oop"),g=t("./range").Range,a=function(){function o(){this.$options={}}return o.prototype.set=function(r){return p.mixin(this.$options,r),this},o.prototype.getOptions=function(){return d.copyObject(this.$options)},o.prototype.setOptions=function(r){this.$options=r},o.prototype.find=function(r){var n=this.$options,i=this.$matchIterator(r,n);if(!i)return!1;var s=null;return i.forEach(function(l,h,f,b){return s=new g(l,h,f,b),h==b&&n.start&&n.start.start&&n.skipCurrent!=!1&&s.isEqual(n.start)?(s=null,!1):!0}),s},o.prototype.findAll=function(r){var n=this.$options;if(!n.needle)return[];this.$assembleRegExp(n);var i=n.range,s=i?r.getLines(i.start.row,i.end.row):r.doc.getAllLines(),l=[],h=n.re;if(n.$isMultiLine){var f=h.length,b=s.length-f,C;e:for(var w=h.offset||0;w<=b;w++){for(var x=0;xT||(l.push(C=new g(w,T,w+f-1,L)),f>2&&(w=w+f-2))}}else for(var M=0;Mm&&l[x].end.row==$;)x--;for(l=l.slice(M,x+1),M=0,x=l.length;M=C;$--)if(v($,Number.MAX_VALUE,E))return;if(n.wrap!=!1){for($=w,C=b.row;$>=C;$--)if(v($,Number.MAX_VALUE,E))return}}};else var x=function($){var M=b.row;if(!v(M,b.column,$)){for(M=M+1;M<=w;M++)if(v(M,0,$))return;if(n.wrap!=!1){for(M=C,w=b.row;M<=w;M++)if(v(M,0,$))return}}};if(n.$isMultiLine)var A=i.length,v=function(E,$,M){var S=s?E-A+1:E;if(!(S<0||S+A>r.getLength())){var T=r.getLine(S),y=T.search(i[0]);if(!(!s&&y<$||y===-1)){for(var m=1;m$)&&M(S,y,S+A-1,L))return!0}}};else if(s)var v=function($,M,S){var T=r.getLine($),y=[],m,L=0;for(i.lastIndex=0;m=i.exec(T);){var _=m[0].length;if(L=m.index,!_){if(L>=T.length)break;i.lastIndex=L+=d.skipEmptyMatch(T,L,h)}if(m.index+_>M)break;y.push(m.index,_)}for(var k=y.length-1;k>=0;k-=2){var I=y[k-1],_=y[k];if(S($,I,$,I+_))return!0}};else var v=function($,M,S){var T=r.getLine($),y,m;for(i.lastIndex=M;m=i.exec(T);){var L=m[0].length;if(y=m.index,S($,y,$,y+L))return!0;if(!L&&(i.lastIndex=y+=d.skipEmptyMatch(T,y,h),y>=T.length))return!1}};return{forEach:x}},o}();function u(o,r){var n=d.supportsLookbehind();function i(f,b){b===void 0&&(b=!0);var C=n&&r.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return C.test(f)||r.regExp?n&&r.$supportsUnicodeFlag?b?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var s=Array.from(o),l=s[0],h=s[s.length-1];return i(l)+o+i(h,!1)}e.Search=a});ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,e,c){"use strict";var d=this&&this.__extends||function(){var n=function(i,s){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,h){l.__proto__=h}||function(l,h){for(var f in h)Object.prototype.hasOwnProperty.call(h,f)&&(l[f]=h[f])},n(i,s)};return function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");n(i,s);function l(){this.constructor=i}i.prototype=s===null?Object.create(s):(l.prototype=s.prototype,new l)}}(),p=t("../lib/keys"),g=t("../lib/useragent"),a=p.KEY_MODS,u=function(){function n(i,s){this.$init(i,s,!1)}return n.prototype.$init=function(i,s,l){this.platform=s||(g.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(i),this.$singleCommand=l},n.prototype.addCommand=function(i){this.commands[i.name]&&this.removeCommand(i),this.commands[i.name]=i,i.bindKey&&this._buildKeyHash(i)},n.prototype.removeCommand=function(i,s){var l=i&&(typeof i=="string"?i:i.name);i=this.commands[l],s||delete this.commands[l];var h=this.commandKeyBinding;for(var f in h){var b=h[f];if(b==i)delete h[f];else if(Array.isArray(b)){var C=b.indexOf(i);C!=-1&&(b.splice(C,1),b.length==1&&(h[f]=b[0]))}}},n.prototype.bindKey=function(i,s,l){if(typeof i=="object"&&i&&(l==null&&(l=i.position),i=i[this.platform]),!!i){if(typeof s=="function")return this.addCommand({exec:s,bindKey:i,name:s.name||i});i.split("|").forEach(function(h){var f="";if(h.indexOf(" ")!=-1){var b=h.split(/\s+/);h=b.pop(),b.forEach(function(x){var A=this.parseKeys(x),v=a[A.hashId]+A.key;f+=(f?" ":"")+v,this._addCommandToBinding(f,"chainKeys")},this),f+=" "}var C=this.parseKeys(h),w=a[C.hashId]+C.key;this._addCommandToBinding(f+w,s,l)},this)}},n.prototype._addCommandToBinding=function(i,s,l){var h=this.commandKeyBinding,f;if(!s)delete h[i];else if(!h[i]||this.$singleCommand)h[i]=s;else{Array.isArray(h[i])?(f=h[i].indexOf(s))!=-1&&h[i].splice(f,1):h[i]=[h[i]],typeof l!="number"&&(l=o(s));var b=h[i];for(f=0;fl)break}b.splice(f,0,s)}},n.prototype.addCommands=function(i){i&&Object.keys(i).forEach(function(s){var l=i[s];if(l){if(typeof l=="string")return this.bindKey(l,s);typeof l=="function"&&(l={exec:l}),typeof l=="object"&&(l.name||(l.name=s),this.addCommand(l))}},this)},n.prototype.removeCommands=function(i){Object.keys(i).forEach(function(s){this.removeCommand(i[s])},this)},n.prototype.bindKeys=function(i){Object.keys(i).forEach(function(s){this.bindKey(s,i[s])},this)},n.prototype._buildKeyHash=function(i){this.bindKey(i.bindKey,i)},n.prototype.parseKeys=function(i){var s=i.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(w){return w}),l=s.pop(),h=p[l];if(p.FUNCTION_KEYS[h])l=p.FUNCTION_KEYS[h].toLowerCase();else if(s.length){if(s.length==1&&s[0]=="shift")return{key:l.toUpperCase(),hashId:-1}}else return{key:l,hashId:-1};for(var f=0,b=s.length;b--;){var C=p.KEY_MODS[s[b]];if(C==null)return typeof console<"u"&&console.error("invalid modifier "+s[b]+" in "+i),!1;f|=C}return{key:l,hashId:f}},n.prototype.findKeyCommand=function(i,s){var l=a[i]+s;return this.commandKeyBinding[l]},n.prototype.handleKeyboard=function(i,s,l,h){if(!(h<0)){var f=a[s]+l,b=this.commandKeyBinding[f];return i.$keyChain&&(i.$keyChain+=" "+f,b=this.commandKeyBinding[i.$keyChain]||b),b&&(b=="chainKeys"||b[b.length-1]=="chainKeys")?(i.$keyChain=i.$keyChain||f,{command:"null"}):(i.$keyChain&&((!s||s==4)&&l.length==1?i.$keyChain=i.$keyChain.slice(0,-f.length-1):(s==-1||h>0)&&(i.$keyChain="")),{command:b})}},n.prototype.getStatusText=function(i,s){return s.$keyChain||""},n}();function o(n){return typeof n=="object"&&n.bindKey&&n.bindKey.position||(n.isDefault?-100:0)}var r=function(n){d(i,n);function i(s,l){var h=n.call(this,s,l)||this;return h.$singleCommand=!0,h}return i}(u);r.call=function(n,i,s){u.prototype.$init.call(n,i,s,!0)},u.call=function(n,i,s){u.prototype.$init.call(n,i,s,!1)},e.HashHandler=r,e.MultiHashHandler=u});ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,e,c){"use strict";var d=this&&this.__extends||function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(i[l]=s[l])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),p=t("../lib/oop"),g=t("../keyboard/hash_handler").MultiHashHandler,a=t("../lib/event_emitter").EventEmitter,u=function(o){d(r,o);function r(n,i){var s=o.call(this,i,n)||this;return s.byName=s.commands,s.setDefaultHandler("exec",function(l){return l.args?l.command.exec(l.editor,l.args,l.event,!1):l.command.exec(l.editor,{},l.event,!0)}),s}return r.prototype.exec=function(n,i,s){if(Array.isArray(n)){for(var l=n.length;l--;)if(this.exec(n[l],i,s))return!0;return!1}if(typeof n=="string"&&(n=this.commands[n]),!n||i&&i.$readOnly&&!n.readOnly||this.$checkCommandState!=!1&&n.isAvailable&&!n.isAvailable(i))return!1;var h={editor:i,command:n,args:s};return h.returnValue=this._emit("exec",h),this._signal("afterExec",h),h.returnValue!==!1},r.prototype.toggleRecording=function(n){if(!this.$inReplay)return n&&n._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(i){this.macro.push([i.command,i.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},r.prototype.replay=function(n){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(n);try{this.$inReplay=!0,this.macro.forEach(function(i){typeof i=="string"?this.exec(i,n):this.exec(i[0],n,i[1])},this)}finally{this.$inReplay=!1}}},r.prototype.trimMacro=function(n){return n.map(function(i){return typeof i[0]!="string"&&(i[0]=i[0].name),i[1]||(i=i[0]),i})},r}(g);p.implement(u.prototype,a),e.CommandManager=u});ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,e,c){"use strict";var d=t("../lib/lang"),p=t("../config"),g=t("../range").Range;function a(o,r){return{win:o,mac:r}}e.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:a("Ctrl-,","Command-,"),exec:function(o){p.loadModule("ace/ext/settings_menu",function(r){r.init(o),o.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:a("Alt-E","F4"),exec:function(o){p.loadModule("ace/ext/error_marker",function(r){r.showErrorMarker(o,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:a("Alt-Shift-E","Shift-F4"),exec:function(o){p.loadModule("ace/ext/error_marker",function(r){r.showErrorMarker(o,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:a("Ctrl-A","Command-A"),exec:function(o){o.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:a(null,"Ctrl-L"),exec:function(o){o.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:a("Ctrl-L","Command-L"),exec:function(o,r){typeof r=="number"&&!isNaN(r)&&o.gotoLine(r),o.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:a("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(o){o.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:a("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(o){o.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:a("F2","F2"),exec:function(o){o.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:a("Alt-F2","Alt-F2"),exec:function(o){o.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(o){o.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(o){o.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:a("Alt-0","Command-Option-0"),exec:function(o){o.session.foldAll(),o.session.unfold(o.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:a("Alt-Shift-0","Command-Option-Shift-0"),exec:function(o){o.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:a("Ctrl-K","Command-G"),exec:function(o){o.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:a("Ctrl-Shift-K","Command-Shift-G"),exec:function(o){o.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:a("Alt-K","Ctrl-G"),exec:function(o){o.selection.isEmpty()?o.selection.selectWord():o.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:a("Alt-Shift-K","Ctrl-Shift-G"),exec:function(o){o.selection.isEmpty()?o.selection.selectWord():o.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:a("Ctrl-F","Command-F"),exec:function(o){p.loadModule("ace/ext/searchbox",function(r){r.Search(o)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(o){o.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:a("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(o){o.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:a("Ctrl-Home","Command-Home|Command-Up"),exec:function(o){o.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:a("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(o){o.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:a("Up","Up|Ctrl-P"),exec:function(o,r){o.navigateUp(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:a("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(o){o.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:a("Ctrl-End","Command-End|Command-Down"),exec:function(o){o.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:a("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(o){o.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:a("Down","Down|Ctrl-N"),exec:function(o,r){o.navigateDown(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:a("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(o){o.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:a("Ctrl-Left","Option-Left"),exec:function(o){o.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:a("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(o){o.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:a("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(o){o.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:a("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(o){o.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:a("Left","Left|Ctrl-B"),exec:function(o,r){o.navigateLeft(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:a("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(o){o.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:a("Ctrl-Right","Option-Right"),exec:function(o){o.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:a("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(o){o.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:a("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(o){o.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:a("Shift-Right","Shift-Right"),exec:function(o){o.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:a("Right","Right|Ctrl-F"),exec:function(o,r){o.navigateRight(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(o){o.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:a(null,"Option-PageDown"),exec:function(o){o.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:a("PageDown","PageDown|Ctrl-V"),exec:function(o){o.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(o){o.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:a(null,"Option-PageUp"),exec:function(o){o.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(o){o.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:a("Ctrl-Up",null),exec:function(o){o.renderer.scrollBy(0,-2*o.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:a("Ctrl-Down",null),exec:function(o){o.renderer.scrollBy(0,2*o.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(o){o.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(o){o.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:a("Ctrl-Alt-E","Command-Option-E"),exec:function(o){o.commands.toggleRecording(o)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:a("Ctrl-Shift-E","Command-Shift-E"),exec:function(o){o.commands.replay(o)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:a("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(o){o.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:a("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(o){o.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:a("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(o){o.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:a(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(o){},readOnly:!0},{name:"cut",description:"Cut",exec:function(o){var r=o.$copyWithEmptySelection&&o.selection.isEmpty(),n=r?o.selection.getLineRange():o.selection.getRange();o._emit("cut",n),n.isEmpty()||o.session.remove(n),o.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(o,r){o.$handlePaste(r)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:a("Ctrl-D","Command-D"),exec:function(o){o.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:a("Ctrl-Shift-D","Command-Shift-D"),exec:function(o){o.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:a("Ctrl-Alt-S","Command-Alt-S"),exec:function(o){o.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:a("Ctrl-/","Command-/"),exec:function(o){o.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:a("Ctrl-Shift-/","Command-Shift-/"),exec:function(o){o.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:a("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(o){o.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:a("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(o){o.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:a("Ctrl-H","Command-Option-F"),exec:function(o){p.loadModule("ace/ext/searchbox",function(r){r.Search(o,!0)})}},{name:"undo",description:"Undo",bindKey:a("Ctrl-Z","Command-Z"),exec:function(o){o.undo()}},{name:"redo",description:"Redo",bindKey:a("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(o){o.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:a("Alt-Shift-Up","Command-Option-Up"),exec:function(o){o.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:a("Alt-Up","Option-Up"),exec:function(o){o.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:a("Alt-Shift-Down","Command-Option-Down"),exec:function(o){o.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:a("Alt-Down","Option-Down"),exec:function(o){o.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:a("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(o){o.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:a("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(o){o.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:a("Shift-Delete",null),exec:function(o){if(o.selection.isEmpty())o.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:a("Alt-Backspace","Command-Backspace"),exec:function(o){o.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:a("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(o){o.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:a("Ctrl-Shift-Backspace",null),exec:function(o){var r=o.selection.getRange();r.start.column=0,o.session.remove(r)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:a("Ctrl-Shift-Delete",null),exec:function(o){var r=o.selection.getRange();r.end.column=Number.MAX_VALUE,o.session.remove(r)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:a("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(o){o.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:a("Ctrl-Delete","Alt-Delete"),exec:function(o){o.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:a("Shift-Tab","Shift-Tab"),exec:function(o){o.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:a("Tab","Tab"),exec:function(o){o.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:a("Ctrl-[","Ctrl-["),exec:function(o){o.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:a("Ctrl-]","Ctrl-]"),exec:function(o){o.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(o,r){o.insert(r)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(o,r){o.insert(d.stringRepeat(r.text||"",r.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:a(null,"Ctrl-O"),exec:function(o){o.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:a("Alt-Shift-X","Ctrl-T"),exec:function(o){o.transposeLetters()},multiSelectAction:function(o){o.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:a("Ctrl-U","Ctrl-U"),exec:function(o){o.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:a("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(o){o.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:a(null,null),exec:function(o){o.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:a("Ctrl-Shift-L","Command-Shift-L"),exec:function(o){var r=o.selection.getRange();r.start.column=r.end.column=0,r.end.row++,o.selection.setRange(r,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:a("Ctrl+F3","F3"),exec:function(o){o.openLink()}},{name:"joinlines",description:"Join lines",bindKey:a(null,null),exec:function(o){for(var r=o.selection.isBackwards(),n=r?o.selection.getSelectionLead():o.selection.getSelectionAnchor(),i=r?o.selection.getSelectionAnchor():o.selection.getSelectionLead(),s=o.session.doc.getLine(n.row).length,l=o.session.doc.getTextRange(o.selection.getRange()),h=l.replace(/\n\s*/," ").length,f=o.session.doc.getLine(n.row),b=n.row+1;b<=i.row+1;b++){var C=d.stringTrimLeft(d.stringTrimRight(o.session.doc.getLine(b)));C.length!==0&&(C=" "+C),f+=C}i.row+10?(o.selection.moveCursorTo(n.row,n.column),o.selection.selectTo(n.row,n.column+h)):(s=o.session.doc.getLine(n.row).length>s?s+1:s,o.selection.moveCursorTo(n.row,s))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:a(null,null),exec:function(o){var r=o.session.doc.getLength()-1,n=o.session.doc.getLine(r).length,i=o.selection.rangeList.ranges,s=[];i.length<1&&(i=[o.selection.getRange()]);for(var l=0;l=C;L--)if(v(L,Number.MAX_VALUE,T))return;if(n.wrap!=!1){for(L=w,C=b.row;L>=C;L--)if(v(L,Number.MAX_VALUE,T))return}}};else var x=function(L){var M=b.row;if(!v(M,b.column,L)){for(M=M+1;M<=w;M++)if(v(M,0,L))return;if(n.wrap!=!1){for(M=C,w=b.row;M<=w;M++)if(v(M,0,L))return}}};if(n.$isMultiLine)var _=i.length,v=function(T,L,M){var E=s?T-_+1:T;if(!(E<0||E+_>r.getLength())){var S=r.getLine(E),y=S.search(i[0]);if(!(!s&&yL)&&M(E,y,E+_-1,$))return!0}}};else if(s)var v=function(L,M,E){var S=r.getLine(L),y=[],m,$=0;for(i.lastIndex=0;m=i.exec(S);){var A=m[0].length;if($=m.index,!A){if($>=S.length)break;i.lastIndex=$+=d.skipEmptyMatch(S,$,h)}if(m.index+A>M)break;y.push(m.index,A)}for(var k=y.length-1;k>=0;k-=2){var R=y[k-1],A=y[k];if(E(L,R,L,R+A))return!0}};else var v=function(L,M,E){var S=r.getLine(L),y,m;for(i.lastIndex=M;m=i.exec(S);){var $=m[0].length;if(y=m.index,E(L,y,L,y+$))return!0;if(!$&&(i.lastIndex=y+=d.skipEmptyMatch(S,y,h),y>=S.length))return!1}};return{forEach:x}},o}();function u(o,r){var n=d.supportsLookbehind();function i(f,b){b===void 0&&(b=!0);var C=n&&r.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return C.test(f)||r.regExp?n&&r.$supportsUnicodeFlag?b?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var s=Array.from(o),l=s[0],h=s[s.length-1];return i(l)+o+i(h,!1)}e.Search=a});ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,e,c){"use strict";var d=this&&this.__extends||function(){var n=function(i,s){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,h){l.__proto__=h}||function(l,h){for(var f in h)Object.prototype.hasOwnProperty.call(h,f)&&(l[f]=h[f])},n(i,s)};return function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");n(i,s);function l(){this.constructor=i}i.prototype=s===null?Object.create(s):(l.prototype=s.prototype,new l)}}(),p=t("../lib/keys"),g=t("../lib/useragent"),a=p.KEY_MODS,u=function(){function n(i,s){this.$init(i,s,!1)}return n.prototype.$init=function(i,s,l){this.platform=s||(g.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(i),this.$singleCommand=l},n.prototype.addCommand=function(i){this.commands[i.name]&&this.removeCommand(i),this.commands[i.name]=i,i.bindKey&&this._buildKeyHash(i)},n.prototype.removeCommand=function(i,s){var l=i&&(typeof i=="string"?i:i.name);i=this.commands[l],s||delete this.commands[l];var h=this.commandKeyBinding;for(var f in h){var b=h[f];if(b==i)delete h[f];else if(Array.isArray(b)){var C=b.indexOf(i);C!=-1&&(b.splice(C,1),b.length==1&&(h[f]=b[0]))}}},n.prototype.bindKey=function(i,s,l){if(typeof i=="object"&&i&&(l==null&&(l=i.position),i=i[this.platform]),!!i){if(typeof s=="function")return this.addCommand({exec:s,bindKey:i,name:s.name||i});i.split("|").forEach(function(h){var f="";if(h.indexOf(" ")!=-1){var b=h.split(/\s+/);h=b.pop(),b.forEach(function(x){var _=this.parseKeys(x),v=a[_.hashId]+_.key;f+=(f?" ":"")+v,this._addCommandToBinding(f,"chainKeys")},this),f+=" "}var C=this.parseKeys(h),w=a[C.hashId]+C.key;this._addCommandToBinding(f+w,s,l)},this)}},n.prototype._addCommandToBinding=function(i,s,l){var h=this.commandKeyBinding,f;if(!s)delete h[i];else if(!h[i]||this.$singleCommand)h[i]=s;else{Array.isArray(h[i])?(f=h[i].indexOf(s))!=-1&&h[i].splice(f,1):h[i]=[h[i]],typeof l!="number"&&(l=o(s));var b=h[i];for(f=0;fl)break}b.splice(f,0,s)}},n.prototype.addCommands=function(i){i&&Object.keys(i).forEach(function(s){var l=i[s];if(l){if(typeof l=="string")return this.bindKey(l,s);typeof l=="function"&&(l={exec:l}),typeof l=="object"&&(l.name||(l.name=s),this.addCommand(l))}},this)},n.prototype.removeCommands=function(i){Object.keys(i).forEach(function(s){this.removeCommand(i[s])},this)},n.prototype.bindKeys=function(i){Object.keys(i).forEach(function(s){this.bindKey(s,i[s])},this)},n.prototype._buildKeyHash=function(i){this.bindKey(i.bindKey,i)},n.prototype.parseKeys=function(i){var s=i.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(w){return w}),l=s.pop(),h=p[l];if(p.FUNCTION_KEYS[h])l=p.FUNCTION_KEYS[h].toLowerCase();else if(s.length){if(s.length==1&&s[0]=="shift")return{key:l.toUpperCase(),hashId:-1}}else return{key:l,hashId:-1};for(var f=0,b=s.length;b--;){var C=p.KEY_MODS[s[b]];if(C==null)return typeof console<"u"&&console.error("invalid modifier "+s[b]+" in "+i),!1;f|=C}return{key:l,hashId:f}},n.prototype.findKeyCommand=function(i,s){var l=a[i]+s;return this.commandKeyBinding[l]},n.prototype.handleKeyboard=function(i,s,l,h){if(!(h<0)){var f=a[s]+l,b=this.commandKeyBinding[f];return i.$keyChain&&(i.$keyChain+=" "+f,b=this.commandKeyBinding[i.$keyChain]||b),b&&(b=="chainKeys"||b[b.length-1]=="chainKeys")?(i.$keyChain=i.$keyChain||f,{command:"null"}):(i.$keyChain&&((!s||s==4)&&l.length==1?i.$keyChain=i.$keyChain.slice(0,-f.length-1):(s==-1||h>0)&&(i.$keyChain="")),{command:b})}},n.prototype.getStatusText=function(i,s){return s.$keyChain||""},n}();function o(n){return typeof n=="object"&&n.bindKey&&n.bindKey.position||(n.isDefault?-100:0)}var r=function(n){d(i,n);function i(s,l){var h=n.call(this,s,l)||this;return h.$singleCommand=!0,h}return i}(u);r.call=function(n,i,s){u.prototype.$init.call(n,i,s,!0)},u.call=function(n,i,s){u.prototype.$init.call(n,i,s,!1)},e.HashHandler=r,e.MultiHashHandler=u});ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,e,c){"use strict";var d=this&&this.__extends||function(){var o=function(r,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(i[l]=s[l])},o(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),p=t("../lib/oop"),g=t("../keyboard/hash_handler").MultiHashHandler,a=t("../lib/event_emitter").EventEmitter,u=function(o){d(r,o);function r(n,i){var s=o.call(this,i,n)||this;return s.byName=s.commands,s.setDefaultHandler("exec",function(l){return l.args?l.command.exec(l.editor,l.args,l.event,!1):l.command.exec(l.editor,{},l.event,!0)}),s}return r.prototype.exec=function(n,i,s){if(Array.isArray(n)){for(var l=n.length;l--;)if(this.exec(n[l],i,s))return!0;return!1}if(typeof n=="string"&&(n=this.commands[n]),!n||i&&i.$readOnly&&!n.readOnly||this.$checkCommandState!=!1&&n.isAvailable&&!n.isAvailable(i))return!1;var h={editor:i,command:n,args:s};return h.returnValue=this._emit("exec",h),this._signal("afterExec",h),h.returnValue!==!1},r.prototype.toggleRecording=function(n){if(!this.$inReplay)return n&&n._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(i){this.macro.push([i.command,i.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},r.prototype.replay=function(n){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(n);try{this.$inReplay=!0,this.macro.forEach(function(i){typeof i=="string"?this.exec(i,n):this.exec(i[0],n,i[1])},this)}finally{this.$inReplay=!1}}},r.prototype.trimMacro=function(n){return n.map(function(i){return typeof i[0]!="string"&&(i[0]=i[0].name),i[1]||(i=i[0]),i})},r}(g);p.implement(u.prototype,a),e.CommandManager=u});ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,e,c){"use strict";var d=t("../lib/lang"),p=t("../config"),g=t("../range").Range;function a(o,r){return{win:o,mac:r}}e.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:a("Ctrl-,","Command-,"),exec:function(o){p.loadModule("ace/ext/settings_menu",function(r){r.init(o),o.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:a("Alt-E","F4"),exec:function(o){p.loadModule("ace/ext/error_marker",function(r){r.showErrorMarker(o,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:a("Alt-Shift-E","Shift-F4"),exec:function(o){p.loadModule("ace/ext/error_marker",function(r){r.showErrorMarker(o,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:a("Ctrl-A","Command-A"),exec:function(o){o.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:a(null,"Ctrl-L"),exec:function(o){o.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:a("Ctrl-L","Command-L"),exec:function(o,r){typeof r=="number"&&!isNaN(r)&&o.gotoLine(r),o.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:a("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(o){o.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:a("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(o){o.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:a("F2","F2"),exec:function(o){o.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:a("Alt-F2","Alt-F2"),exec:function(o){o.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(o){o.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(o){o.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:a("Alt-0","Command-Option-0"),exec:function(o){o.session.foldAll(),o.session.unfold(o.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:a("Alt-Shift-0","Command-Option-Shift-0"),exec:function(o){o.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:a("Ctrl-K","Command-G"),exec:function(o){o.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:a("Ctrl-Shift-K","Command-Shift-G"),exec:function(o){o.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:a("Alt-K","Ctrl-G"),exec:function(o){o.selection.isEmpty()?o.selection.selectWord():o.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:a("Alt-Shift-K","Ctrl-Shift-G"),exec:function(o){o.selection.isEmpty()?o.selection.selectWord():o.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:a("Ctrl-F","Command-F"),exec:function(o){p.loadModule("ace/ext/searchbox",function(r){r.Search(o)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(o){o.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:a("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(o){o.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:a("Ctrl-Home","Command-Home|Command-Up"),exec:function(o){o.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:a("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(o){o.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:a("Up","Up|Ctrl-P"),exec:function(o,r){o.navigateUp(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:a("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(o){o.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:a("Ctrl-End","Command-End|Command-Down"),exec:function(o){o.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:a("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(o){o.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:a("Down","Down|Ctrl-N"),exec:function(o,r){o.navigateDown(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:a("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(o){o.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:a("Ctrl-Left","Option-Left"),exec:function(o){o.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:a("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(o){o.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:a("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(o){o.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:a("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(o){o.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:a("Left","Left|Ctrl-B"),exec:function(o,r){o.navigateLeft(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:a("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(o){o.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:a("Ctrl-Right","Option-Right"),exec:function(o){o.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:a("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(o){o.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:a("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(o){o.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:a("Shift-Right","Shift-Right"),exec:function(o){o.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:a("Right","Right|Ctrl-F"),exec:function(o,r){o.navigateRight(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(o){o.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:a(null,"Option-PageDown"),exec:function(o){o.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:a("PageDown","PageDown|Ctrl-V"),exec:function(o){o.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(o){o.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:a(null,"Option-PageUp"),exec:function(o){o.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(o){o.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:a("Ctrl-Up",null),exec:function(o){o.renderer.scrollBy(0,-2*o.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:a("Ctrl-Down",null),exec:function(o){o.renderer.scrollBy(0,2*o.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(o){o.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(o){o.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:a("Ctrl-Alt-E","Command-Option-E"),exec:function(o){o.commands.toggleRecording(o)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:a("Ctrl-Shift-E","Command-Shift-E"),exec:function(o){o.commands.replay(o)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:a("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(o){o.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:a("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(o){o.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:a("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(o){o.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:a(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(o){},readOnly:!0},{name:"cut",description:"Cut",exec:function(o){var r=o.$copyWithEmptySelection&&o.selection.isEmpty(),n=r?o.selection.getLineRange():o.selection.getRange();o._emit("cut",n),n.isEmpty()||o.session.remove(n),o.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(o,r){o.$handlePaste(r)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:a("Ctrl-D","Command-D"),exec:function(o){o.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:a("Ctrl-Shift-D","Command-Shift-D"),exec:function(o){o.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:a("Ctrl-Alt-S","Command-Alt-S"),exec:function(o){o.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:a("Ctrl-/","Command-/"),exec:function(o){o.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:a("Ctrl-Shift-/","Command-Shift-/"),exec:function(o){o.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:a("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(o){o.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:a("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(o){o.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:a("Ctrl-H","Command-Option-F"),exec:function(o){p.loadModule("ace/ext/searchbox",function(r){r.Search(o,!0)})}},{name:"undo",description:"Undo",bindKey:a("Ctrl-Z","Command-Z"),exec:function(o){o.undo()}},{name:"redo",description:"Redo",bindKey:a("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(o){o.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:a("Alt-Shift-Up","Command-Option-Up"),exec:function(o){o.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:a("Alt-Up","Option-Up"),exec:function(o){o.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:a("Alt-Shift-Down","Command-Option-Down"),exec:function(o){o.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:a("Alt-Down","Option-Down"),exec:function(o){o.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:a("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(o){o.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:a("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(o){o.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:a("Shift-Delete",null),exec:function(o){if(o.selection.isEmpty())o.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:a("Alt-Backspace","Command-Backspace"),exec:function(o){o.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:a("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(o){o.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:a("Ctrl-Shift-Backspace",null),exec:function(o){var r=o.selection.getRange();r.start.column=0,o.session.remove(r)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:a("Ctrl-Shift-Delete",null),exec:function(o){var r=o.selection.getRange();r.end.column=Number.MAX_VALUE,o.session.remove(r)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:a("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(o){o.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:a("Ctrl-Delete","Alt-Delete"),exec:function(o){o.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:a("Shift-Tab","Shift-Tab"),exec:function(o){o.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:a("Tab","Tab"),exec:function(o){o.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:a("Ctrl-[","Ctrl-["),exec:function(o){o.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:a("Ctrl-]","Ctrl-]"),exec:function(o){o.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(o,r){o.insert(r)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(o,r){o.insert(d.stringRepeat(r.text||"",r.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:a(null,"Ctrl-O"),exec:function(o){o.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:a("Alt-Shift-X","Ctrl-T"),exec:function(o){o.transposeLetters()},multiSelectAction:function(o){o.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:a("Ctrl-U","Ctrl-U"),exec:function(o){o.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:a("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(o){o.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:a(null,null),exec:function(o){o.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:a("Ctrl-Shift-L","Command-Shift-L"),exec:function(o){var r=o.selection.getRange();r.start.column=r.end.column=0,r.end.row++,o.selection.setRange(r,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:a("Ctrl+F3","F3"),exec:function(o){o.openLink()}},{name:"joinlines",description:"Join lines",bindKey:a(null,null),exec:function(o){for(var r=o.selection.isBackwards(),n=r?o.selection.getSelectionLead():o.selection.getSelectionAnchor(),i=r?o.selection.getSelectionAnchor():o.selection.getSelectionLead(),s=o.session.doc.getLine(n.row).length,l=o.session.doc.getTextRange(o.selection.getRange()),h=l.replace(/\n\s*/," ").length,f=o.session.doc.getLine(n.row),b=n.row+1;b<=i.row+1;b++){var C=d.stringTrimLeft(d.stringTrimRight(o.session.doc.getLine(b)));C.length!==0&&(C=" "+C),f+=C}i.row+10?(o.selection.moveCursorTo(n.row,n.column),o.selection.selectTo(n.row,n.column+h)):(s=o.session.doc.getLine(n.row).length>s?s+1:s,o.selection.moveCursorTo(n.row,s))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:a(null,null),exec:function(o){var r=o.session.doc.getLength()-1,n=o.session.doc.getLine(r).length,i=o.selection.rangeList.ranges,s=[];i.length<1&&(i=[o.selection.getRange()]);for(var l=0;lu[o].column&&o++,i.unshift(o,0),u.splice.apply(u,i),this.$updateRows()}}},g.prototype.$updateRows=function(){var a=this.session.lineWidgets;if(a){var u=!0;a.forEach(function(o,r){if(o)for(u=!1,o.row=r;o.$oldWidget;)o.$oldWidget.row=r,o=o.$oldWidget}),u&&(this.session.lineWidgets=null)}},g.prototype.$registerLineWidget=function(a){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var u=this.session.lineWidgets[a.row];return u&&(a.$oldWidget=u,u.el&&u.el.parentNode&&(u.el.parentNode.removeChild(u.el),u._inDocument=!1)),this.session.lineWidgets[a.row]=a,a},g.prototype.addLineWidget=function(a){if(this.$registerLineWidget(a),a.session=this.session,!this.editor)return a;var u=this.editor.renderer;a.html&&!a.el&&(a.el=d.createElement("div"),a.el.innerHTML=a.html),a.text&&!a.el&&(a.el=d.createElement("div"),a.el.textContent=a.text),a.el&&(d.addCssClass(a.el,"ace_lineWidgetContainer"),a.className&&d.addCssClass(a.el,a.className),a.el.style.position="absolute",a.el.style.zIndex="5",u.container.appendChild(a.el),a._inDocument=!0,a.coverGutter||(a.el.style.zIndex="3"),a.pixelHeight==null&&(a.pixelHeight=a.el.offsetHeight)),a.rowCount==null&&(a.rowCount=a.pixelHeight/u.layerConfig.lineHeight);var o=this.session.getFoldAt(a.row,0);if(a.$fold=o,o){var r=this.session.lineWidgets;a.row==o.end.row&&!r[o.start.row]?r[o.start.row]=a:a.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows(),this.renderWidgets(null,u),this.onWidgetChanged(a),a},g.prototype.removeLineWidget=function(a){if(a._inDocument=!1,a.session=null,a.el&&a.el.parentNode&&a.el.parentNode.removeChild(a.el),a.editor&&a.editor.destroy)try{a.editor.destroy()}catch{}if(this.session.lineWidgets){var u=this.session.lineWidgets[a.row];if(u==a)this.session.lineWidgets[a.row]=a.$oldWidget,a.$oldWidget&&this.onWidgetChanged(a.$oldWidget);else for(;u;){if(u.$oldWidget==a){u.$oldWidget=a.$oldWidget;break}u=u.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows()},g.prototype.getWidgetsAtRow=function(a){for(var u=this.session.lineWidgets,o=u&&u[a],r=[];o;)r.push(o),o=o.$oldWidget;return r},g.prototype.onWidgetChanged=function(a){this.session._changedWidgets.push(a),this.editor&&this.editor.renderer.updateFull()},g.prototype.measureWidgets=function(a,u){var o=this.session._changedWidgets,r=u.layerConfig;if(!(!o||!o.length)){for(var n=1/0,i=0;i0&&!r[n];)n--;this.firstRow=o.firstRow,this.lastRow=o.lastRow,u.$cursorLayer.config=o;for(var s=n;s<=i;s++){var l=r[s];if(!(!l||!l.el)){if(l.hidden){l.el.style.top=-100-(l.pixelHeight||0)+"px";continue}l._inDocument||(l._inDocument=!0,u.container.appendChild(l.el));var h=u.$cursorLayer.getPixelPosition({row:s,column:0},!0).top;l.coverLine||(h+=o.lineHeight*this.session.getRowLineCount(l.row)),l.el.style.top=h-o.offset+"px";var f=l.coverGutter?0:u.gutterWidth;l.fixedWidth||(f-=u.scrollLeft),l.el.style.left=f+"px",l.fullWidth&&l.screenWidth&&(l.el.style.minWidth=o.width+2*o.padding+"px"),l.fixedWidth?l.el.style.right=u.scrollBar.getWidth()+"px":l.el.style.right=""}}}},g}();e.LineWidgets=p});ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(t,e,c){"use strict";var d=t("../lib/keys"),p=t("../mouse/default_gutter_handler").GutterTooltip,g=function(){function u(o){this.editor=o,this.gutterLayer=o.renderer.$gutterLayer,this.element=o.renderer.$gutter,this.lines=o.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new p(this.editor)}return u.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))},u.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))},u.prototype.$onGutterKeyDown=function(o){if(this.annotationTooltip.isOpen){o.preventDefault(),o.keyCode===d.escape&&this.annotationTooltip.hideTooltip();return}if(o.target===this.element){if(o.keyCode!=d.enter)return;o.preventDefault();var r=this.editor.getCursorPosition().row;this.editor.isRowVisible(r)||this.editor.scrollToLine(r,!0,!0),setTimeout(function(){var n=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),i=this.$findNearestFoldWidget(n),s=this.$findNearestAnnotation(n);if(!(i===null&&s===null)){if(i===null&&s!==null){this.activeRowIndex=s,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(i!==null&&s===null){this.activeRowIndex=i,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(s-n)0||o+r=0&&this.$isFoldWidgetVisible(o-r))return o-r;if(o+r<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(o+r))return o+r}return null},u.prototype.$findNearestAnnotation=function(o){if(this.$isAnnotationVisible(o))return o;for(var r=0;o-r>0||o+r=0&&this.$isAnnotationVisible(o-r))return o-r;if(o+r<=this.lines.getLength()-1&&this.$isAnnotationVisible(o+r))return o+r}return null},u.prototype.$focusFoldWidget=function(o){if(o!=null){var r=this.$getFoldWidget(o);r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus()}},u.prototype.$focusAnnotation=function(o){if(o!=null){var r=this.$getAnnotation(o);r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus()}},u.prototype.$blurFoldWidget=function(o){var r=this.$getFoldWidget(o);r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur()},u.prototype.$blurAnnotation=function(o){var r=this.$getAnnotation(o);r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur()},u.prototype.$moveFoldWidgetUp=function(){for(var o=this.activeRowIndex;o>0;)if(o--,this.$isFoldWidgetVisible(o)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=o,this.$focusFoldWidget(this.activeRowIndex);return}},u.prototype.$moveFoldWidgetDown=function(){for(var o=this.activeRowIndex;o0;)if(o--,this.$isAnnotationVisible(o)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=o,this.$focusAnnotation(this.activeRowIndex);return}},u.prototype.$moveAnnotationDown=function(){for(var o=this.activeRowIndex;o=y.length&&(y=void 0),{value:y&&y[_++],done:!y}}};throw new TypeError(m?"Object is not iterable.":"Symbol.iterator is not defined.")},p=t("./lib/oop"),g=t("./lib/dom"),a=t("./lib/lang"),u=t("./lib/useragent"),o=t("./keyboard/textinput").TextInput,r=t("./mouse/mouse_handler").MouseHandler,n=t("./mouse/fold_handler").FoldHandler,i=t("./keyboard/keybinding").KeyBinding,s=t("./edit_session").EditSession,l=t("./search").Search,h=t("./range").Range,f=t("./lib/event_emitter").EventEmitter,b=t("./commands/command_manager").CommandManager,C=t("./commands/default_commands").commands,w=t("./config"),x=t("./token_iterator").TokenIterator,A=t("./line_widgets").LineWidgets,v=t("./keyboard/gutter_handler").GutterKeyboardHandler,E=t("./config").nls,$=t("./clipboard"),M=t("./lib/keys"),S=function(){function y(m,L,_){this.session,this.$toDestroy=[];var k=m.getContainerElement();this.container=k,this.renderer=m,this.id="editor"+ ++y.$uid,this.commands=new b(u.isMac?"mac":"win",C),typeof document=="object"&&(this.textInput=new o(m.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new r(this),new n(this)),this.keyBinding=new i(this),this.$search=new l().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=a.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(I,R){R._$emitInputEvent.schedule(31)}),this.setSession(L||_&&_.session||new s("")),w.resetOptions(this),_&&this.setOptions(_),w._signal("editor",this)}return y.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=a.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},y.prototype.startOperation=function(m){if(this.curOp){if(!m||this.curOp.command)return;this.prevOp=this.curOp}m||(this.previousCommand=null,m={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:m.command||{},args:m.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},y.prototype.endOperation=function(m){if(this.curOp&&this.session){if(m&&m.returnValue===!1||!this.session)return this.curOp=null;if(m==!0&&this.curOp.command&&this.curOp.command.name=="mouse"||(this._signal("beforeEndOperation"),!this.curOp))return;var L=this.curOp.command,_=L&&L.scrollIntoView;if(_){switch(_){case"center-animate":_="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var k=this.selection.getRange(),I=this.renderer.layerConfig;(k.start.row>=I.lastRow||k.end.row<=I.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;default:break}_=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var R=this.selection.toJSON();this.curOp.selectionAfter=R,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(R),this.prevOp=this.curOp,this.curOp=null}},y.prototype.$historyTracker=function(m){if(this.$mergeUndoDeltas){var L=this.prevOp,_=this.$mergeableCommands,k=L.command&&m.command.name==L.command.name;if(m.command.name=="insertstring"){var I=m.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),k=k&&this.mergeNextCommand&&(!/\s/.test(I)||/\s/.test(L.args)),this.mergeNextCommand=!0}else k=k&&_.indexOf(m.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(k=!1),k?this.session.mergeUndoDeltas=!0:_.indexOf(m.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},y.prototype.setKeyboardHandler=function(m,L){if(m&&typeof m=="string"&&m!="ace"){this.$keybindingId=m;var _=this;w.loadModule(["keybinding",m],function(k){_.$keybindingId==m&&_.keyBinding.setKeyboardHandler(k&&k.handler),L&&L()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(m),L&&L()},y.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},y.prototype.setSession=function(m){if(this.session!=m){this.curOp&&this.endOperation(),this.curOp={};var L=this.session;if(L){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var _=this.session.getSelection();_.off("changeCursor",this.$onCursorChange),_.off("changeSelection",this.$onSelectionChange)}this.session=m,m?(this.$onDocumentChange=this.onDocumentChange.bind(this),m.on("change",this.$onDocumentChange),this.renderer.setSession(m),this.$onChangeMode=this.onChangeMode.bind(this),m.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),m.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),m.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),m.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),m.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),m.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=m.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),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(m)),this._signal("changeSession",{session:m,oldSession:L}),this.curOp=null,L&&L._signal("changeEditor",{oldEditor:this}),m&&m._signal("changeEditor",{editor:this}),m&&!m.destroyed&&m.bgTokenizer.scheduleStart()}},y.prototype.getSession=function(){return this.session},y.prototype.setValue=function(m,L){return this.session.doc.setValue(m),L?L==1?this.navigateFileEnd():L==-1&&this.navigateFileStart():this.selectAll(),m},y.prototype.getValue=function(){return this.session.getValue()},y.prototype.getSelection=function(){return this.selection},y.prototype.resize=function(m){this.renderer.onResize(m)},y.prototype.setTheme=function(m,L){this.renderer.setTheme(m,L)},y.prototype.getTheme=function(){return this.renderer.getTheme()},y.prototype.setStyle=function(m){this.renderer.setStyle(m)},y.prototype.unsetStyle=function(m){this.renderer.unsetStyle(m)},y.prototype.getFontSize=function(){return this.getOption("fontSize")||g.computedStyle(this.container).fontSize},y.prototype.setFontSize=function(m){this.setOption("fontSize",m)},y.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var m=this;this.$highlightPending=!0,setTimeout(function(){m.$highlightPending=!1;var L=m.session;if(!(!L||L.destroyed)){L.$bracketHighlight&&(L.$bracketHighlight.markerIds.forEach(function(H){L.removeMarker(H)}),L.$bracketHighlight=null);var _=m.getCursorPosition(),k=m.getKeyboardHandler(),I=k&&k.$getDirectionForHighlight&&k.$getDirectionForHighlight(m),R=L.getMatchingBracketRanges(_,I);if(!R){var D=new x(L,_.row,_.column),O=D.getCurrentToken();if(O&&/\b(?:tag-open|tag-name)/.test(O.type)){var N=L.getMatchingTags(_);N&&(R=[N.openTagName,N.closeTagName])}}if(!R&&L.$mode.getMatching&&(R=L.$mode.getMatching(m.session)),!R){m.getHighlightIndentGuides()&&m.renderer.$textLayer.$highlightIndentGuide();return}var P="ace_bracket";Array.isArray(R)?R.length==1&&(P="ace_error_bracket"):R=[R],R.length==2&&(h.comparePoints(R[0].end,R[1].start)==0?R=[h.fromPoints(R[0].start,R[1].end)]:h.comparePoints(R[0].start,R[1].end)==0&&(R=[h.fromPoints(R[1].start,R[0].end)])),L.$bracketHighlight={ranges:R,markerIds:R.map(function(H){return L.addMarker(H,P,"text")})},m.getHighlightIndentGuides()&&m.renderer.$textLayer.$highlightIndentGuide()}},50)}},y.prototype.focus=function(){this.textInput.focus()},y.prototype.isFocused=function(){return this.textInput.isFocused()},y.prototype.blur=function(){this.textInput.blur()},y.prototype.onFocus=function(m){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",m))},y.prototype.onBlur=function(m){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",m))},y.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},y.prototype.onDocumentChange=function(m){var L=this.session.$useWrapMode,_=m.start.row==m.end.row?m.end.row:1/0;this.renderer.updateLines(m.start.row,_,L),this._signal("change",m),this.$cursorChange()},y.prototype.onTokenizerUpdate=function(m){var L=m.data;this.renderer.updateLines(L.first,L.last)},y.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},y.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},y.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},y.prototype.$updateHighlightActiveLine=function(){var m=this.getSession(),L;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(L=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(L=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(L=!1)),m.$highlightLineMarker&&!L)m.removeMarker(m.$highlightLineMarker.id),m.$highlightLineMarker=null;else if(!m.$highlightLineMarker&&L){var _=new h(L.row,L.column,L.row,1/0);_.id=m.addMarker(_,"ace_active-line","screenLine"),m.$highlightLineMarker=_}else L&&(m.$highlightLineMarker.start.row=L.row,m.$highlightLineMarker.end.row=L.row,m.$highlightLineMarker.start.column=L.column,m._signal("changeBackMarker"))},y.prototype.onSelectionChange=function(m){var L=this.session;if(L.$selectionMarker&&L.removeMarker(L.$selectionMarker),L.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var _=this.selection.getRange(),k=this.getSelectionStyle();L.$selectionMarker=L.addMarker(_,"ace_selection",k)}var I=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(I),this._signal("changeSelection")},y.prototype.$getSelectionHighLightRegexp=function(){var m=this.session,L=this.getSelectionRange();if(!(L.isEmpty()||L.isMultiLine())){var _=L.start.column,k=L.end.column,I=m.getLine(L.start.row),R=I.substring(_,k);if(!(R.length>5e3||!/[\w\d]/.test(R))){var D=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:R}),O=I.substring(_-1,k+1);if(D.test(O))return D}}},y.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},y.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},y.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},y.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},y.prototype.onChangeMode=function(m){this.renderer.updateText(),this._emit("changeMode",m)},y.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},y.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},y.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},y.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},y.prototype.getCopyText=function(){var m=this.getSelectedText(),L=this.session.doc.getNewLineCharacter(),_=!1;if(!m&&this.$copyWithEmptySelection){_=!0;for(var k=this.selection.getAllRanges(),I=0;Iu[o].column&&o++,i.unshift(o,0),u.splice.apply(u,i),this.$updateRows()}}},g.prototype.$updateRows=function(){var a=this.session.lineWidgets;if(a){var u=!0;a.forEach(function(o,r){if(o)for(u=!1,o.row=r;o.$oldWidget;)o.$oldWidget.row=r,o=o.$oldWidget}),u&&(this.session.lineWidgets=null)}},g.prototype.$registerLineWidget=function(a){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var u=this.session.lineWidgets[a.row];return u&&(a.$oldWidget=u,u.el&&u.el.parentNode&&(u.el.parentNode.removeChild(u.el),u._inDocument=!1)),this.session.lineWidgets[a.row]=a,a},g.prototype.addLineWidget=function(a){if(this.$registerLineWidget(a),a.session=this.session,!this.editor)return a;var u=this.editor.renderer;a.html&&!a.el&&(a.el=d.createElement("div"),a.el.innerHTML=a.html),a.text&&!a.el&&(a.el=d.createElement("div"),a.el.textContent=a.text),a.el&&(d.addCssClass(a.el,"ace_lineWidgetContainer"),a.className&&d.addCssClass(a.el,a.className),a.el.style.position="absolute",a.el.style.zIndex="5",u.container.appendChild(a.el),a._inDocument=!0,a.coverGutter||(a.el.style.zIndex="3"),a.pixelHeight==null&&(a.pixelHeight=a.el.offsetHeight)),a.rowCount==null&&(a.rowCount=a.pixelHeight/u.layerConfig.lineHeight);var o=this.session.getFoldAt(a.row,0);if(a.$fold=o,o){var r=this.session.lineWidgets;a.row==o.end.row&&!r[o.start.row]?r[o.start.row]=a:a.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows(),this.renderWidgets(null,u),this.onWidgetChanged(a),a},g.prototype.removeLineWidget=function(a){if(a._inDocument=!1,a.session=null,a.el&&a.el.parentNode&&a.el.parentNode.removeChild(a.el),a.editor&&a.editor.destroy)try{a.editor.destroy()}catch{}if(this.session.lineWidgets){var u=this.session.lineWidgets[a.row];if(u==a)this.session.lineWidgets[a.row]=a.$oldWidget,a.$oldWidget&&this.onWidgetChanged(a.$oldWidget);else for(;u;){if(u.$oldWidget==a){u.$oldWidget=a.$oldWidget;break}u=u.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows()},g.prototype.getWidgetsAtRow=function(a){for(var u=this.session.lineWidgets,o=u&&u[a],r=[];o;)r.push(o),o=o.$oldWidget;return r},g.prototype.onWidgetChanged=function(a){this.session._changedWidgets.push(a),this.editor&&this.editor.renderer.updateFull()},g.prototype.measureWidgets=function(a,u){var o=this.session._changedWidgets,r=u.layerConfig;if(!(!o||!o.length)){for(var n=1/0,i=0;i0&&!r[n];)n--;this.firstRow=o.firstRow,this.lastRow=o.lastRow,u.$cursorLayer.config=o;for(var s=n;s<=i;s++){var l=r[s];if(!(!l||!l.el)){if(l.hidden){l.el.style.top=-100-(l.pixelHeight||0)+"px";continue}l._inDocument||(l._inDocument=!0,u.container.appendChild(l.el));var h=u.$cursorLayer.getPixelPosition({row:s,column:0},!0).top;l.coverLine||(h+=o.lineHeight*this.session.getRowLineCount(l.row)),l.el.style.top=h-o.offset+"px";var f=l.coverGutter?0:u.gutterWidth;l.fixedWidth||(f-=u.scrollLeft),l.el.style.left=f+"px",l.fullWidth&&l.screenWidth&&(l.el.style.minWidth=o.width+2*o.padding+"px"),l.fixedWidth?l.el.style.right=u.scrollBar.getWidth()+"px":l.el.style.right=""}}}},g}();e.LineWidgets=p});ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(t,e,c){"use strict";var d=t("../lib/keys"),p=t("../mouse/default_gutter_handler").GutterTooltip,g=function(){function u(o){this.editor=o,this.gutterLayer=o.renderer.$gutterLayer,this.element=o.renderer.$gutter,this.lines=o.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new p(this.editor)}return u.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))},u.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))},u.prototype.$onGutterKeyDown=function(o){if(this.annotationTooltip.isOpen){o.preventDefault(),o.keyCode===d.escape&&this.annotationTooltip.hideTooltip();return}if(o.target===this.element){if(o.keyCode!=d.enter)return;o.preventDefault();var r=this.editor.getCursorPosition().row;this.editor.isRowVisible(r)||this.editor.scrollToLine(r,!0,!0),setTimeout(function(){var n=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),i=this.$findNearestFoldWidget(n),s=this.$findNearestAnnotation(n);if(!(i===null&&s===null)){if(i===null&&s!==null){this.activeRowIndex=s,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(i!==null&&s===null){this.activeRowIndex=i,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(s-n)0||o+r=0&&this.$isFoldWidgetVisible(o-r))return o-r;if(o+r<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(o+r))return o+r}return null},u.prototype.$findNearestAnnotation=function(o){if(this.$isAnnotationVisible(o))return o;for(var r=0;o-r>0||o+r=0&&this.$isAnnotationVisible(o-r))return o-r;if(o+r<=this.lines.getLength()-1&&this.$isAnnotationVisible(o+r))return o+r}return null},u.prototype.$focusFoldWidget=function(o){if(o!=null){var r=this.$getFoldWidget(o);r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus()}},u.prototype.$focusAnnotation=function(o){if(o!=null){var r=this.$getAnnotation(o);r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus()}},u.prototype.$blurFoldWidget=function(o){var r=this.$getFoldWidget(o);r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur()},u.prototype.$blurAnnotation=function(o){var r=this.$getAnnotation(o);r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur()},u.prototype.$moveFoldWidgetUp=function(){for(var o=this.activeRowIndex;o>0;)if(o--,this.$isFoldWidgetVisible(o)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=o,this.$focusFoldWidget(this.activeRowIndex);return}},u.prototype.$moveFoldWidgetDown=function(){for(var o=this.activeRowIndex;o0;)if(o--,this.$isAnnotationVisible(o)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=o,this.$focusAnnotation(this.activeRowIndex);return}},u.prototype.$moveAnnotationDown=function(){for(var o=this.activeRowIndex;o=y.length&&(y=void 0),{value:y&&y[A++],done:!y}}};throw new TypeError(m?"Object is not iterable.":"Symbol.iterator is not defined.")},p=t("./lib/oop"),g=t("./lib/dom"),a=t("./lib/lang"),u=t("./lib/useragent"),o=t("./keyboard/textinput").TextInput,r=t("./mouse/mouse_handler").MouseHandler,n=t("./mouse/fold_handler").FoldHandler,i=t("./keyboard/keybinding").KeyBinding,s=t("./edit_session").EditSession,l=t("./search").Search,h=t("./range").Range,f=t("./lib/event_emitter").EventEmitter,b=t("./commands/command_manager").CommandManager,C=t("./commands/default_commands").commands,w=t("./config"),x=t("./token_iterator").TokenIterator,_=t("./line_widgets").LineWidgets,v=t("./keyboard/gutter_handler").GutterKeyboardHandler,T=t("./config").nls,L=t("./clipboard"),M=t("./lib/keys"),E=function(){function y(m,$,A){this.session,this.$toDestroy=[];var k=m.getContainerElement();this.container=k,this.renderer=m,this.id="editor"+ ++y.$uid,this.commands=new b(u.isMac?"mac":"win",C),typeof document=="object"&&(this.textInput=new o(m.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new r(this),new n(this)),this.keyBinding=new i(this),this.$search=new l().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=a.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(R,I){I._$emitInputEvent.schedule(31)}),this.setSession($||A&&A.session||new s("")),w.resetOptions(this),A&&this.setOptions(A),w._signal("editor",this)}return y.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=a.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},y.prototype.startOperation=function(m){if(this.curOp){if(!m||this.curOp.command)return;this.prevOp=this.curOp}m||(this.previousCommand=null,m={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:m.command||{},args:m.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},y.prototype.endOperation=function(m){if(this.curOp&&this.session){if(m&&m.returnValue===!1||!this.session)return this.curOp=null;if(m==!0&&this.curOp.command&&this.curOp.command.name=="mouse"||(this._signal("beforeEndOperation"),!this.curOp))return;var $=this.curOp.command,A=$&&$.scrollIntoView;if(A){switch(A){case"center-animate":A="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var k=this.selection.getRange(),R=this.renderer.layerConfig;(k.start.row>=R.lastRow||k.end.row<=R.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;default:break}A=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var I=this.selection.toJSON();this.curOp.selectionAfter=I,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(I),this.prevOp=this.curOp,this.curOp=null}},y.prototype.$historyTracker=function(m){if(this.$mergeUndoDeltas){var $=this.prevOp,A=this.$mergeableCommands,k=$.command&&m.command.name==$.command.name;if(m.command.name=="insertstring"){var R=m.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),k=k&&this.mergeNextCommand&&(!/\s/.test(R)||/\s/.test($.args)),this.mergeNextCommand=!0}else k=k&&A.indexOf(m.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(k=!1),k?this.session.mergeUndoDeltas=!0:A.indexOf(m.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},y.prototype.setKeyboardHandler=function(m,$){if(m&&typeof m=="string"&&m!="ace"){this.$keybindingId=m;var A=this;w.loadModule(["keybinding",m],function(k){A.$keybindingId==m&&A.keyBinding.setKeyboardHandler(k&&k.handler),$&&$()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(m),$&&$()},y.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},y.prototype.setSession=function(m){if(this.session!=m){this.curOp&&this.endOperation(),this.curOp={};var $=this.session;if($){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var A=this.session.getSelection();A.off("changeCursor",this.$onCursorChange),A.off("changeSelection",this.$onSelectionChange)}this.session=m,m?(this.$onDocumentChange=this.onDocumentChange.bind(this),m.on("change",this.$onDocumentChange),this.renderer.setSession(m),this.$onChangeMode=this.onChangeMode.bind(this),m.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),m.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),m.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),m.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),m.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),m.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=m.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),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(m)),this._signal("changeSession",{session:m,oldSession:$}),this.curOp=null,$&&$._signal("changeEditor",{oldEditor:this}),m&&m._signal("changeEditor",{editor:this}),m&&!m.destroyed&&m.bgTokenizer.scheduleStart()}},y.prototype.getSession=function(){return this.session},y.prototype.setValue=function(m,$){return this.session.doc.setValue(m),$?$==1?this.navigateFileEnd():$==-1&&this.navigateFileStart():this.selectAll(),m},y.prototype.getValue=function(){return this.session.getValue()},y.prototype.getSelection=function(){return this.selection},y.prototype.resize=function(m){this.renderer.onResize(m)},y.prototype.setTheme=function(m,$){this.renderer.setTheme(m,$)},y.prototype.getTheme=function(){return this.renderer.getTheme()},y.prototype.setStyle=function(m){this.renderer.setStyle(m)},y.prototype.unsetStyle=function(m){this.renderer.unsetStyle(m)},y.prototype.getFontSize=function(){return this.getOption("fontSize")||g.computedStyle(this.container).fontSize},y.prototype.setFontSize=function(m){this.setOption("fontSize",m)},y.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var m=this;this.$highlightPending=!0,setTimeout(function(){m.$highlightPending=!1;var $=m.session;if(!(!$||$.destroyed)){$.$bracketHighlight&&($.$bracketHighlight.markerIds.forEach(function(B){$.removeMarker(B)}),$.$bracketHighlight=null);var A=m.getCursorPosition(),k=m.getKeyboardHandler(),R=k&&k.$getDirectionForHighlight&&k.$getDirectionForHighlight(m),I=$.getMatchingBracketRanges(A,R);if(!I){var D=new x($,A.row,A.column),O=D.getCurrentToken();if(O&&/\b(?:tag-open|tag-name)/.test(O.type)){var N=$.getMatchingTags(A);N&&(I=[N.openTagName,N.closeTagName])}}if(!I&&$.$mode.getMatching&&(I=$.$mode.getMatching(m.session)),!I){m.getHighlightIndentGuides()&&m.renderer.$textLayer.$highlightIndentGuide();return}var P="ace_bracket";Array.isArray(I)?I.length==1&&(P="ace_error_bracket"):I=[I],I.length==2&&(h.comparePoints(I[0].end,I[1].start)==0?I=[h.fromPoints(I[0].start,I[1].end)]:h.comparePoints(I[0].start,I[1].end)==0&&(I=[h.fromPoints(I[1].start,I[0].end)])),$.$bracketHighlight={ranges:I,markerIds:I.map(function(B){return $.addMarker(B,P,"text")})},m.getHighlightIndentGuides()&&m.renderer.$textLayer.$highlightIndentGuide()}},50)}},y.prototype.focus=function(){this.textInput.focus()},y.prototype.isFocused=function(){return this.textInput.isFocused()},y.prototype.blur=function(){this.textInput.blur()},y.prototype.onFocus=function(m){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",m))},y.prototype.onBlur=function(m){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",m))},y.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},y.prototype.onDocumentChange=function(m){var $=this.session.$useWrapMode,A=m.start.row==m.end.row?m.end.row:1/0;this.renderer.updateLines(m.start.row,A,$),this._signal("change",m),this.$cursorChange()},y.prototype.onTokenizerUpdate=function(m){var $=m.data;this.renderer.updateLines($.first,$.last)},y.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},y.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},y.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},y.prototype.$updateHighlightActiveLine=function(){var m=this.getSession(),$;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&($=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&($=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&($=!1)),m.$highlightLineMarker&&!$)m.removeMarker(m.$highlightLineMarker.id),m.$highlightLineMarker=null;else if(!m.$highlightLineMarker&&$){var A=new h($.row,$.column,$.row,1/0);A.id=m.addMarker(A,"ace_active-line","screenLine"),m.$highlightLineMarker=A}else $&&(m.$highlightLineMarker.start.row=$.row,m.$highlightLineMarker.end.row=$.row,m.$highlightLineMarker.start.column=$.column,m._signal("changeBackMarker"))},y.prototype.onSelectionChange=function(m){var $=this.session;if($.$selectionMarker&&$.removeMarker($.$selectionMarker),$.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var A=this.selection.getRange(),k=this.getSelectionStyle();$.$selectionMarker=$.addMarker(A,"ace_selection",k)}var R=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(R),this._signal("changeSelection")},y.prototype.$getSelectionHighLightRegexp=function(){var m=this.session,$=this.getSelectionRange();if(!($.isEmpty()||$.isMultiLine())){var A=$.start.column,k=$.end.column,R=m.getLine($.start.row),I=R.substring(A,k);if(!(I.length>5e3||!/[\w\d]/.test(I))){var D=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:I}),O=R.substring(A-1,k+1);if(D.test(O))return D}}},y.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},y.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},y.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},y.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},y.prototype.onChangeMode=function(m){this.renderer.updateText(),this._emit("changeMode",m)},y.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},y.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},y.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},y.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},y.prototype.getCopyText=function(){var m=this.getSelectedText(),$=this.session.doc.getNewLineCharacter(),A=!1;if(!m&&this.$copyWithEmptySelection){A=!0;for(var k=this.selection.getAllRanges(),R=0;RH.search(/\S|$/)){var O=H.substr(I.column).search(/\S|$/);_.doc.removeInLine(I.row,I.column,I.column+O)}}this.clearSelection();var N=I.column,P=_.getState(I.row),H=_.getLine(I.row),F=k.checkOutdent(P,H,m);if(_.insert(I,m),R&&R.selection&&(R.selection.length==2?this.selection.setSelectionRange(new h(I.row,N+R.selection[0],I.row,N+R.selection[1])):this.selection.setSelectionRange(new h(I.row+R.selection[0],R.selection[1],I.row+R.selection[2],R.selection[3]))),this.$enableAutoIndent){if(_.getDocument().isNewLine(m)){var U=k.getNextLineIndent(P,H.slice(0,I.column),_.getTabString());_.insert({row:I.row+1,column:0},U)}F&&k.autoOutdent(P,_,I.row)}},y.prototype.autoIndent=function(){var m=this.session,L=m.getMode(),_,k;if(this.selection.isEmpty())_=0,k=m.doc.getLength()-1;else{var I=this.getSelectionRange();_=I.start.row,k=I.end.row}for(var R="",D="",O="",N,P,H,F=m.getTabString(),U=_;U<=k;U++)U>0&&(R=m.getState(U-1),D=m.getLine(U-1),O=L.getNextLineIndent(R,D,F)),N=m.getLine(U),P=L.$getIndent(N),O!==P&&(P.length>0&&(H=new h(U,0,U,P.length),m.remove(H)),O.length>0&&m.insert({row:U,column:0},O)),L.autoOutdent(R,m,U)},y.prototype.onTextInput=function(m,L){if(!L)return this.keyBinding.onTextInput(m);this.startOperation({command:{name:"insertstring"}});var _=this.applyComposition.bind(this,m,L);this.selection.rangeCount?this.forEachSelection(_):_(),this.endOperation()},y.prototype.applyComposition=function(m,L){if(L.extendLeft||L.extendRight){var _=this.selection.getRange();_.start.column-=L.extendLeft,_.end.column+=L.extendRight,_.start.column<0&&(_.start.row--,_.start.column+=this.session.getLine(_.start.row).length+1),this.selection.setRange(_),!m&&!_.isEmpty()&&this.remove()}if((m||!this.selection.isEmpty())&&this.insert(m,!0),L.restoreStart||L.restoreEnd){var _=this.selection.getRange();_.start.column-=L.restoreStart,_.end.column-=L.restoreEnd,this.selection.setRange(_)}},y.prototype.onCommandKey=function(m,L,_){return this.keyBinding.onCommandKey(m,L,_)},y.prototype.setOverwrite=function(m){this.session.setOverwrite(m)},y.prototype.getOverwrite=function(){return this.session.getOverwrite()},y.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},y.prototype.setScrollSpeed=function(m){this.setOption("scrollSpeed",m)},y.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},y.prototype.setDragDelay=function(m){this.setOption("dragDelay",m)},y.prototype.getDragDelay=function(){return this.getOption("dragDelay")},y.prototype.setSelectionStyle=function(m){this.setOption("selectionStyle",m)},y.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},y.prototype.setHighlightActiveLine=function(m){this.setOption("highlightActiveLine",m)},y.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},y.prototype.setHighlightGutterLine=function(m){this.setOption("highlightGutterLine",m)},y.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},y.prototype.setHighlightSelectedWord=function(m){this.setOption("highlightSelectedWord",m)},y.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},y.prototype.setAnimatedScroll=function(m){this.renderer.setAnimatedScroll(m)},y.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},y.prototype.setShowInvisibles=function(m){this.renderer.setShowInvisibles(m)},y.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},y.prototype.setDisplayIndentGuides=function(m){this.renderer.setDisplayIndentGuides(m)},y.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},y.prototype.setHighlightIndentGuides=function(m){this.renderer.setHighlightIndentGuides(m)},y.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},y.prototype.setShowPrintMargin=function(m){this.renderer.setShowPrintMargin(m)},y.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},y.prototype.setPrintMarginColumn=function(m){this.renderer.setPrintMarginColumn(m)},y.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},y.prototype.setReadOnly=function(m){this.setOption("readOnly",m)},y.prototype.getReadOnly=function(){return this.getOption("readOnly")},y.prototype.setBehavioursEnabled=function(m){this.setOption("behavioursEnabled",m)},y.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},y.prototype.setWrapBehavioursEnabled=function(m){this.setOption("wrapBehavioursEnabled",m)},y.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},y.prototype.setShowFoldWidgets=function(m){this.setOption("showFoldWidgets",m)},y.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},y.prototype.setFadeFoldWidgets=function(m){this.setOption("fadeFoldWidgets",m)},y.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},y.prototype.remove=function(m){this.selection.isEmpty()&&(m=="left"?this.selection.selectLeft():this.selection.selectRight());var L=this.getSelectionRange();if(this.getBehavioursEnabled()){var _=this.session,k=_.getState(L.start.row),I=_.getMode().transformAction(k,"deletion",this,_,L);if(L.end.column===0){var R=_.getTextRange(L);if(R[R.length-1]==` -`){var D=_.getLine(L.end.row);/^\s+$/.test(D)&&(L.end.column=D.length)}}I&&(L=I)}this.session.remove(L),this.clearSelection()},y.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},y.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},y.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},y.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var m=this.getSelectionRange();m.start.column==m.end.column&&m.start.row==m.end.row&&(m.end.column=0,m.end.row++),this.session.remove(m),this.clearSelection()},y.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var m=this.getCursorPosition();this.insert(` -`),this.moveCursorToPosition(m)},y.prototype.setGhostText=function(m,L){this.session.widgetManager||(this.session.widgetManager=new A(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(m,L)},y.prototype.removeGhostText=function(){this.session.widgetManager&&this.renderer.removeGhostText()},y.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var m=this.getCursorPosition(),L=m.column;if(L!==0){var _=this.session.getLine(m.row),k,I;L<_.length?(k=_.charAt(L)+_.charAt(L-1),I=new h(m.row,L-1,m.row,L+1)):(k=_.charAt(L-1)+_.charAt(L-2),I=new h(m.row,L-2,m.row,L)),this.session.replace(I,k),this.session.selection.moveToPosition(I.end)}}},y.prototype.toLowerCase=function(){var m=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var L=this.getSelectionRange(),_=this.session.getTextRange(L);this.session.replace(L,_.toLowerCase()),this.selection.setSelectionRange(m)},y.prototype.toUpperCase=function(){var m=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var L=this.getSelectionRange(),_=this.session.getTextRange(L);this.session.replace(L,_.toUpperCase()),this.selection.setSelectionRange(m)},y.prototype.indent=function(){var m=this.session,L=this.getSelectionRange();if(L.start.rowO.toLowerCase()?1:0});for(var I=new h(0,0,0,0),k=m.first;k<=m.last;k++){var R=L.getLine(k);I.start.row=k,I.end.row=k,I.end.column=R.length,L.replace(I,_[k-m.first])}},y.prototype.toggleCommentLines=function(){var m=this.session.getState(this.getCursorPosition().row),L=this.$getSelectedRows();this.session.getMode().toggleCommentLines(m,this.session,L.first,L.last)},y.prototype.toggleBlockComment=function(){var m=this.getCursorPosition(),L=this.session.getState(m.row),_=this.getSelectionRange();this.session.getMode().toggleBlockComment(L,this.session,_,m)},y.prototype.getNumberAt=function(m,L){var _=/[\-]?[0-9]+(?:\.[0-9]+)?/g;_.lastIndex=0;for(var k=this.session.getLine(m);_.lastIndex=L){var R={value:I[0],start:I.index,end:I.index+I[0].length};return R}}return null},y.prototype.modifyNumber=function(m){var L=this.selection.getCursor().row,_=this.selection.getCursor().column,k=new h(L,_-1,L,_),I=this.session.getTextRange(k);if(!isNaN(parseFloat(I))&&isFinite(I)){var R=this.getNumberAt(L,_);if(R){var D=R.value.indexOf(".")>=0?R.start+R.value.indexOf(".")+1:R.end,O=R.start+R.value.length-D,N=parseFloat(R.value);N*=Math.pow(10,O),D!==R.end&&_=D&&R<=O&&(_=ee,N.selection.clearSelection(),N.moveCursorTo(m,D+k),N.selection.selectTo(m,O+k)),D=O});for(var P=this.$toggleWordPairs,H,F=0;F=O&&D<=N&&U.match(/((?:https?|ftp):\/\/[\S]+)/)){P=U.replace(/[\s:.,'";}\]]+$/,"");break}O=N}}catch(j){_={error:j}}finally{try{F&&!F.done&&(k=H.return)&&k.call(H)}finally{if(_)throw _.error}}return P},y.prototype.openLink=function(){var m=this.selection.getCursor(),L=this.findLinkAt(m.row,m.column);return L&&window.open(L,"_blank"),L!=null},y.prototype.removeLines=function(){var m=this.$getSelectedRows();this.session.removeFullLines(m.first,m.last),this.clearSelection()},y.prototype.duplicateSelection=function(){var m=this.selection,L=this.session,_=m.getRange(),k=m.isBackwards();if(_.isEmpty()){var I=_.start.row;L.duplicateLines(I,I)}else{var R=k?_.start:_.end,D=L.insert(R,L.getTextRange(_));_.start=R,_.end=D,m.setSelectionRange(_,k)}},y.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},y.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},y.prototype.moveText=function(m,L,_){return this.session.moveText(m,L,_)},y.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},y.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},y.prototype.$moveLines=function(m,L){var _,k,I=this.selection;if(!I.inMultiSelectMode||this.inVirtualSelectionMode){var R=I.toOrientedRange();_=this.$getSelectedRows(R),k=this.session.$moveLines(_.first,_.last,L?0:m),L&&m==-1&&(k=0),R.moveBy(k,0),I.fromOrientedRange(R)}else{var D=I.rangeList.ranges;I.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var O=0,N=0,P=D.length,H=0;Hj+1)break;j=J.last}for(H--,O=this.session.$moveLines(U,j,L?0:m),L&&m==-1&&(F=H+1);F<=H;)D[F].moveBy(O,0),F++;L||(O=0),N+=O}I.fromOrientedRange(I.ranges[0]),I.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},y.prototype.$getSelectedRows=function(m){return m=(m||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(m.start.row),last:this.session.getRowFoldEnd(m.end.row)}},y.prototype.onCompositionStart=function(m){this.renderer.showComposition(m)},y.prototype.onCompositionUpdate=function(m){this.renderer.setCompositionText(m)},y.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},y.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},y.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},y.prototype.isRowVisible=function(m){return m>=this.getFirstVisibleRow()&&m<=this.getLastVisibleRow()},y.prototype.isRowFullyVisible=function(m){return m>=this.renderer.getFirstFullyVisibleRow()&&m<=this.renderer.getLastFullyVisibleRow()},y.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},y.prototype.$moveByPage=function(m,L){var _=this.renderer,k=this.renderer.layerConfig,I=m*Math.floor(k.height/k.lineHeight);L===!0?this.selection.$moveSelection(function(){this.moveCursorBy(I,0)}):L===!1&&(this.selection.moveCursorBy(I,0),this.selection.clearSelection());var R=_.scrollTop;_.scrollBy(0,I*k.lineHeight),L!=null&&_.scrollCursorIntoView(null,.5),_.animateScrolling(R)},y.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},y.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},y.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},y.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},y.prototype.scrollPageDown=function(){this.$moveByPage(1)},y.prototype.scrollPageUp=function(){this.$moveByPage(-1)},y.prototype.scrollToRow=function(m){this.renderer.scrollToRow(m)},y.prototype.scrollToLine=function(m,L,_,k){this.renderer.scrollToLine(m,L,_,k)},y.prototype.centerSelection=function(){var m=this.getSelectionRange(),L={row:Math.floor(m.start.row+(m.end.row-m.start.row)/2),column:Math.floor(m.start.column+(m.end.column-m.start.column)/2)};this.renderer.alignCursor(L,.5)},y.prototype.getCursorPosition=function(){return this.selection.getCursor()},y.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},y.prototype.getSelectionRange=function(){return this.selection.getRange()},y.prototype.selectAll=function(){this.selection.selectAll()},y.prototype.clearSelection=function(){this.selection.clearSelection()},y.prototype.moveCursorTo=function(m,L){this.selection.moveCursorTo(m,L)},y.prototype.moveCursorToPosition=function(m){this.selection.moveCursorToPosition(m)},y.prototype.jumpToMatching=function(m,L){var _=this.getCursorPosition(),k=new x(this.session,_.row,_.column),I=k.getCurrentToken(),R=0;I&&I.type.indexOf("tag-name")!==-1&&(I=k.stepBackward());var D=I||k.stepForward();if(D){var O,N=!1,P={},H=_.column-D.start,F,U={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(D.value.match(/[{}()\[\]]/g)){for(;H1?P[D.value]++:I.value==="=0;--R)this.$tryReplace(_[R],m)&&k++;return this.selection.setSelectionRange(I),k},y.prototype.$tryReplace=function(m,L){var _=this.session.getTextRange(m);return L=this.$search.replace(_,L),L!==null?(m.end=this.session.replace(m,L),m):null},y.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},y.prototype.find=function(m,L,_){L||(L={}),typeof m=="string"||m instanceof RegExp?L.needle=m:typeof m=="object"&&p.mixin(L,m);var k=this.selection.getRange();L.needle==null&&(m=this.session.getTextRange(k)||this.$search.$options.needle,m||(k=this.session.getWordRange(k.start.row,k.start.column),m=this.session.getTextRange(k)),this.$search.set({needle:m})),this.$search.set(L),L.start||this.$search.set({start:k});var I=this.$search.find(this.session);if(L.preventScroll)return I;if(I)return this.revealRange(I,_),I;L.backwards?k.start=k.end:k.end=k.start,this.selection.setRange(k)},y.prototype.findNext=function(m,L){this.find({skipCurrent:!0,backwards:!1},m,L)},y.prototype.findPrevious=function(m,L){this.find(m,{skipCurrent:!0,backwards:!0},L)},y.prototype.revealRange=function(m,L){this.session.unfold(m),this.selection.setSelectionRange(m);var _=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(m.start,m.end,.5),L!==!1&&this.renderer.animateScrolling(_)},y.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},y.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},y.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(m){m.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()},y.prototype.setAutoScrollEditorIntoView=function(m){if(m){var L,_=this,k=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var I=this.$scrollAnchor;I.style.cssText="position:absolute",this.container.insertBefore(I,this.container.firstChild);var R=this.on("changeSelection",function(){k=!0}),D=this.renderer.on("beforeRender",function(){k&&(L=_.renderer.container.getBoundingClientRect())}),O=this.renderer.on("afterRender",function(){if(k&&L&&(_.isFocused()||_.searchBox&&_.searchBox.isFocused())){var N=_.renderer,P=N.$cursorLayer.$pixelPos,H=N.layerConfig,F=P.top-H.offset;P.top>=0&&F+L.top<0?k=!0:P.topwindow.innerHeight?k=!1:k=null,k!=null&&(I.style.top=F+"px",I.style.left=P.left+"px",I.style.height=H.lineHeight+"px",I.scrollIntoView(k)),k=L=null}});this.setAutoScrollEditorIntoView=function(N){N||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",R),this.renderer.off("afterRender",O),this.renderer.off("beforeRender",D))}}},y.prototype.$resetCursorStyle=function(){var m=this.$cursorStyle||"ace",L=this.renderer.$cursorLayer;L&&(L.setSmoothBlinking(/smooth/.test(m)),L.isBlinking=!this.$readOnly&&m!="wide",g.setCssClass(L.element,"ace_slim-cursors",/slim/.test(m)))},y.prototype.prompt=function(m,L,_){var k=this;w.loadModule("ace/ext/prompt",function(I){I.prompt(k,m,L,_)})},y}();S.$uid=0,S.prototype.curOp=null,S.prototype.prevOp={},S.prototype.$mergeableCommands=["backspace","del","insertstring"],S.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],p.implement(S.prototype,f),w.defineOptions(S.prototype,"editor",{selectionStyle:{set:function(y){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:y})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(y){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(y){this.textInput.setReadOnly(y),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(y){this.textInput.setCopyWithEmptySelection(y)},initialValue:!1},cursorStyle:{set:function(y){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(y){this.setAutoScrollEditorIntoView(y)}},keyboardHandler:{set:function(y){this.setKeyboardHandler(y)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(y){this.session.setValue(y)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(y){this.setSession(y)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(y){this.renderer.$gutterLayer.setShowLineNumbers(y),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),y&&this.$relativeLineNumbers?T.attach(this):T.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(y){this.$showLineNumbers&&y?T.attach(this):T.detach(this)}},placeholder:{set:function(y){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var m=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(m&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),g.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!m&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),g.addCssClass(this.container,"ace_hasPlaceholder");var L=g.createElement("div");L.className="ace_placeholder",L.textContent=this.$placeholder||"",this.renderer.placeholderNode=L,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!m&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(y){var m={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(k){k.blur(),k.renderer.scroller.focus()},readOnly:!0},L=function(k){if(k.target==this.renderer.scroller&&k.keyCode===M.enter){k.preventDefault();var I=this.getCursorPosition().row;this.isRowVisible(I)||this.scrollToLine(I,!0,!0),this.focus()}},_;y?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(u.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",E("editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",E("Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",L.bind(this)),this.commands.addCommand(m),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")),this.renderer.$gutter.setAttribute("aria-label",E("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),_||(_=new v(this)),_.addListener()):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",L.bind(this)),this.commands.removeCommand(m),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),_&&_.removeListener())},initialValue:!1},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 T={getText:function(y,m){return(Math.abs(y.selection.lead.row-m)||m+1+(m<9?"\xB7":""))+""},getWidth:function(y,m,L){return Math.max(m.toString().length,(L.lastRow+1).toString().length,2)*L.characterWidth},update:function(y,m){m.renderer.$loop.schedule(m.renderer.CHANGE_GUTTER)},attach:function(y){y.renderer.$gutterLayer.$renderer=this,y.on("changeSelection",this.update),this.update(null,y)},detach:function(y){y.renderer.$gutterLayer.$renderer==this&&(y.renderer.$gutterLayer.$renderer=null),y.off("changeSelection",this.update),this.update(null,y)}};e.Editor=S});ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(t,e,c){"use strict";var d=t("../lib/dom"),p=function(){function g(a,u){this.element=a,this.canvasHeight=u||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return g.prototype.moveContainer=function(a){d.translate(this.element,0,-(a.firstRowScreen*a.lineHeight%this.canvasHeight)-a.offset*this.$offsetCoefficient)},g.prototype.pageChanged=function(a,u){return Math.floor(a.firstRowScreen*a.lineHeight/this.canvasHeight)!==Math.floor(u.firstRowScreen*u.lineHeight/this.canvasHeight)},g.prototype.computeLineTop=function(a,u,o){var r=u.firstRowScreen*u.lineHeight,n=Math.floor(r/this.canvasHeight),i=o.documentToScreenRow(a,0)*u.lineHeight;return i-n*this.canvasHeight},g.prototype.computeLineHeight=function(a,u,o){return u.lineHeight*o.getRowLineCount(a)},g.prototype.getLength=function(){return this.cells.length},g.prototype.get=function(a){return this.cells[a]},g.prototype.shift=function(){this.$cacheCell(this.cells.shift())},g.prototype.pop=function(){this.$cacheCell(this.cells.pop())},g.prototype.push=function(a){if(Array.isArray(a)){this.cells.push.apply(this.cells,a);for(var u=d.createFragment(this.element),o=0;oC&&(A=b.end.row+1,b=l.getNextFoldLine(A,b),C=b?b.start.row:1/0),A>f){for(;this.$lines.getLength()>x+1;)this.$lines.pop();break}w=this.$lines.get(++x),w?w.row=A:(w=this.$lines.createCell(A,s,this.session,n),this.$lines.push(w)),this.$renderCell(w,s,b,A),A++}this._signal("afterRender"),this.$updateGutterWidth(s)},i.prototype.$updateGutterWidth=function(s){var l=this.session,h=l.gutterRenderer||this.$renderer,f=l.$firstLineNumber,b=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||l.$useWrapMode)&&(b=l.getLength()+f-1);var C=h?h.getWidth(l,b,s):b.toString().length*s.characterWidth,w=this.$padding||this.$computePadding();C+=w.left+w.right,C!==this.gutterWidth&&!isNaN(C)&&(this.gutterWidth=C,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",C))},i.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var s=this.session.selection.getCursor();this.$cursorRow!==s.row&&(this.$cursorRow=s.row)}},i.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var s=this.session.selection.cursor.row;if(this.$cursorRow=s,!(this.$cursorCell&&this.$cursorCell.row==s)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var l=this.$lines.cells;this.$cursorCell=null;for(var h=0;h=this.$cursorRow){if(f.row>this.$cursorRow){var b=this.session.getFoldLine(this.$cursorRow);if(h>0&&b&&b.start.row==l[h-1].row)f=l[h-1];else break}f.element.className="ace_gutter-active-line "+f.element.className,this.$cursorCell=f;break}}}}},i.prototype.scrollLines=function(s){var l=this.config;if(this.config=s,this.$updateCursorRow(),this.$lines.pageChanged(l,s))return this.update(s);this.$lines.moveContainer(s);var h=Math.min(s.lastRow+s.gutterOffset,this.session.getLength()-1),f=this.oldLastRow;if(this.oldLastRow=h,!l||f0;b--)this.$lines.shift();if(f>h)for(var b=this.session.getFoldedRowCount(h+1,f);b>0;b--)this.$lines.pop();s.firstRowf&&this.$lines.push(this.$renderLines(s,f+1,h)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(s)},i.prototype.$renderLines=function(s,l,h){for(var f=[],b=l,C=this.session.getNextFoldLine(b),w=C?C.start.row:1/0;b>w&&(b=C.end.row+1,C=this.session.getNextFoldLine(b,C),w=C?C.start.row:1/0),!(b>h);){var x=this.$lines.createCell(b,s,this.session,n);this.$renderCell(x,s,C,b),f.push(x),b++}return f},i.prototype.$renderCell=function(s,l,h,f){var b=s.element,C=this.session,w=b.childNodes[0],x=b.childNodes[1],A=b.childNodes[2],v=A.firstChild,E=C.$firstLineNumber,$=C.$breakpoints,M=C.$decorations,S=C.gutterRenderer||this.$renderer,T=this.$showFoldWidgets&&C.foldWidgets,y=h?h.start.row:Number.MAX_VALUE,m=l.lineHeight+"px",L=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",_=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",k=(S?S.getText(C,f):f+E).toString();if(this.$highlightGutterLine&&(f==this.$cursorRow||h&&f=y&&this.$cursorRow<=h.end.row)&&(L+="ace_gutter-active-line ",this.$cursorCell!=s&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=s)),$[f]&&(L+=$[f]),M[f]&&(L+=M[f]),this.$annotations[f]&&f!==y&&(L+=this.$annotations[f].className),T){var I=T[f];I==null&&(I=T[f]=C.getFoldWidget(f))}if(I){var R="ace_fold-widget ace_"+I,D=I=="start"&&f==y&&fh.right-l.right)return"foldWidgets"},i}();r.prototype.$fixedWidth=!1,r.prototype.$highlightGutterLine=!0,r.prototype.$renderer="",r.prototype.$showLineNumbers=!0,r.prototype.$showFoldWidgets=!0,p.implement(r.prototype,a);function n(i){var s=document.createTextNode("");i.appendChild(s);var l=d.createElement("span");i.appendChild(l);var h=d.createElement("span");i.appendChild(h);var f=d.createElement("span");return h.appendChild(f),i}e.Gutter=r});ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,e,c){"use strict";var d=t("../range").Range,p=t("../lib/dom"),g=function(){function u(o){this.element=p.createElement("div"),this.element.className="ace_layer ace_marker-layer",o.appendChild(this.element)}return u.prototype.setPadding=function(o){this.$padding=o},u.prototype.setSession=function(o){this.session=o},u.prototype.setMarkers=function(o){this.markers=o},u.prototype.elt=function(o,r){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=r,n.className=o},u.prototype.update=function(o){if(o){this.config=o,this.i=0;var r;for(var n in this.markers){var i=this.markers[n];if(!i.range){i.update(r,this,this.session,o);continue}var s=i.range.clipRows(o.firstRow,o.lastRow);if(!s.isEmpty())if(s=s.toScreenRange(this.session),i.renderer){var l=this.$getTop(s.start.row,o),h=this.$padding+s.start.column*o.characterWidth;i.renderer(r,s,h,l,o)}else i.type=="fullLine"?this.drawFullLineMarker(r,s,i.clazz,o):i.type=="screenLine"?this.drawScreenLineMarker(r,s,i.clazz,o):s.isMultiLine()?i.type=="text"?this.drawTextMarker(r,s,i.clazz,o):this.drawMultiLineMarker(r,s,i.clazz,o):this.drawSingleLineMarker(r,s,i.clazz+" ace_start ace_br15",o)}if(this.i!=-1)for(;this.ix,b==f),i,b==f?0:1,s)},u.prototype.drawMultiLineMarker=function(o,r,n,i,s){var l=this.$padding,h=i.lineHeight,f=this.$getTop(r.start.row,i),b=l+r.start.column*i.characterWidth;if(s=s||"",this.session.$bidiHandler.isBidiRow(r.start.row)){var C=r.clone();C.end.row=C.start.row,C.end.column=this.session.getLine(C.start.row).length,this.drawBidiSingleLineMarker(o,C,n+" ace_br1 ace_start",i,null,s)}else this.elt(n+" ace_br1 ace_start","height:"+h+"px;right:0;top:"+f+"px;left:"+b+"px;"+(s||""));if(this.session.$bidiHandler.isBidiRow(r.end.row)){var C=r.clone();C.start.row=C.end.row,C.start.column=0,this.drawBidiSingleLineMarker(o,C,n+" ace_br12",i,null,s)}else{f=this.$getTop(r.end.row,i);var w=r.end.column*i.characterWidth;this.elt(n+" ace_br12","height:"+h+"px;width:"+w+"px;top:"+f+"px;left:"+l+"px;"+(s||""))}if(h=(r.end.row-r.start.row-1)*i.lineHeight,!(h<=0)){f=this.$getTop(r.start.row+1,i);var x=(r.start.column?1:0)|(r.end.column?0:8);this.elt(n+(x?" ace_br"+x:""),"height:"+h+"px;right:0;top:"+f+"px;left:"+l+"px;"+(s||""))}},u.prototype.drawSingleLineMarker=function(o,r,n,i,s,l){if(this.session.$bidiHandler.isBidiRow(r.start.row))return this.drawBidiSingleLineMarker(o,r,n,i,s,l);var h=i.lineHeight,f=(r.end.column+(s||0)-r.start.column)*i.characterWidth,b=this.$getTop(r.start.row,i),C=this.$padding+r.start.column*i.characterWidth;this.elt(n,"height:"+h+"px;width:"+f+"px;top:"+b+"px;left:"+C+"px;"+(l||""))},u.prototype.drawBidiSingleLineMarker=function(o,r,n,i,s,l){var h=i.lineHeight,f=this.$getTop(r.start.row,i),b=this.$padding,C=this.session.$bidiHandler.getSelections(r.start.column,r.end.column);C.forEach(function(w){this.elt(n,"height:"+h+"px;width:"+(w.width+(s||0))+"px;top:"+f+"px;left:"+(b+w.left)+"px;"+(l||""))},this)},u.prototype.drawFullLineMarker=function(o,r,n,i,s){var l=this.$getTop(r.start.row,i),h=i.lineHeight;r.start.row!=r.end.row&&(h+=this.$getTop(r.end.row,i)-l),this.elt(n,"height:"+h+"px;top:"+l+"px;left:0;right:0;"+(s||""))},u.prototype.drawScreenLineMarker=function(o,r,n,i,s){var l=this.$getTop(r.start.row,i),h=i.lineHeight;this.elt(n,"height:"+h+"px;top:"+l+"px;left:0;right:0;"+(s||""))},u}();g.prototype.$padding=0;function a(u,o,r,n){return(u?1:0)|(o?2:0)|(r?4:0)|(n?8:0)}e.Marker=g});ace.define("ace/layer/text_util",["require","exports","module"],function(t,e,c){var d=new Set(["text","rparen","lparen"]);e.isTextToken=function(p){return d.has(p)}});ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(t,e,c){"use strict";var d=t("../lib/oop"),p=t("../lib/dom"),g=t("../lib/lang"),a=t("./lines").Lines,u=t("../lib/event_emitter").EventEmitter,o=t("../config").nls,r=t("./text_util").isTextToken,n=function(){function i(s){this.dom=p,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",s.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new a(this.element)}return i.prototype.$updateEolChar=function(){var s=this.session.doc,l=s.getNewLineCharacter()==` -`&&s.getNewLineMode()!="windows",h=l?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=h)return this.EOL_CHAR=h,!0},i.prototype.setPadding=function(s){this.$padding=s,this.element.style.margin="0 "+s+"px"},i.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},i.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},i.prototype.$setFontMetrics=function(s){this.$fontMetrics=s,this.$fontMetrics.on("changeCharacterSize",function(l){this._signal("changeCharacterSize",l)}.bind(this)),this.$pollSizeChanges()},i.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},i.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},i.prototype.setSession=function(s){this.session=s,s&&this.$computeTabString()},i.prototype.setShowInvisibles=function(s){return this.showInvisibles==s?!1:(this.showInvisibles=s,typeof s=="string"?(this.showSpaces=/tab/i.test(s),this.showTabs=/space/i.test(s),this.showEOL=/eol/i.test(s)):this.showSpaces=this.showTabs=this.showEOL=s,this.$computeTabString(),!0)},i.prototype.setDisplayIndentGuides=function(s){return this.displayIndentGuides==s?!1:(this.displayIndentGuides=s,this.$computeTabString(),!0)},i.prototype.setHighlightIndentGuides=function(s){return this.$highlightIndentGuides===s?!1:(this.$highlightIndentGuides=s,s)},i.prototype.$computeTabString=function(){var s=this.session.getTabSize();this.tabSize=s;for(var l=this.$tabStrings=[0],h=1;hE&&(A=v.end.row+1,v=this.session.getNextFoldLine(A,v),E=v?v.start.row:1/0),!(A>b);){var $=C[w++];if($){this.dom.removeChildren($),this.$renderLine($,A,A==E?v:!1),x&&($.style.top=this.$lines.computeLineTop(A,s,this.session)+"px");var M=s.lineHeight*this.session.getRowLength(A)+"px";$.style.height!=M&&(x=!0,$.style.height=M)}A++}if(x)for(;w0;b--)this.$lines.shift();if(l.lastRow>s.lastRow)for(var b=this.session.getFoldedRowCount(s.lastRow+1,l.lastRow);b>0;b--)this.$lines.pop();s.firstRowl.lastRow&&this.$lines.push(this.$renderLinesFragment(s,l.lastRow+1,s.lastRow)),this.$highlightIndentGuide()},i.prototype.$renderLinesFragment=function(s,l,h){for(var f=[],b=l,C=this.session.getNextFoldLine(b),w=C?C.start.row:1/0;b>w&&(b=C.end.row+1,C=this.session.getNextFoldLine(b,C),w=C?C.start.row:1/0),!(b>h);){var x=this.$lines.createCell(b,s,this.session),A=x.element;this.dom.removeChildren(A),p.setStyle(A.style,"height",this.$lines.computeLineHeight(b,s,this.session)+"px"),p.setStyle(A.style,"top",this.$lines.computeLineTop(b,s,this.session)+"px"),this.$renderLine(A,b,b==w?C:!1),this.$useLineGroups()?A.className="ace_line_group":A.className="ace_line",f.push(x),b++}return f},i.prototype.update=function(s){this.$lines.moveContainer(s),this.config=s;for(var l=s.firstRow,h=s.lastRow,f=this.$lines;f.getLength();)f.pop();f.push(this.$renderLinesFragment(s,l,h))},i.prototype.$renderToken=function(s,l,h,f){for(var b=this,C=/(\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]+)|(\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,w=this.dom.createFragment(this.element),x,A=0;x=C.exec(f);){var v=x[1],E=x[2],$=x[3],M=x[4],S=x[5];if(!(!b.showSpaces&&E)){var T=A!=x.index?f.slice(A,x.index):"";if(A=x.index+x[0].length,T&&w.appendChild(this.dom.createTextNode(T,this.element)),v){var y=b.session.getScreenTabSize(l+x.index);w.appendChild(b.$tabStrings[y].cloneNode(!0)),l+=y-1}else if(E)if(b.showSpaces){var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_space",m.textContent=g.stringRepeat(b.SPACE_CHAR,E.length),w.appendChild(m)}else w.appendChild(this.dom.createTextNode(E,this.element));else if($){var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_space ace_invalid",m.textContent=g.stringRepeat(b.SPACE_CHAR,$.length),w.appendChild(m)}else if(M){l+=1;var m=this.dom.createElement("span");m.style.width=b.config.characterWidth*2+"px",m.className=b.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",m.textContent=b.showSpaces?b.SPACE_CHAR:M,w.appendChild(m)}else if(S){l+=1;var m=this.dom.createElement("span");m.style.width=b.config.characterWidth*2+"px",m.className="ace_cjk",m.textContent=S,w.appendChild(m)}}}if(w.appendChild(this.dom.createTextNode(A?f.slice(A):f,this.element)),r(h.type))s.appendChild(w);else{var L="ace_"+h.type.replace(/\./g," ace_"),m=this.dom.createElement("span");h.type=="fold"&&(m.style.width=h.value.length*this.config.characterWidth+"px",m.setAttribute("title",o("Unfold code"))),m.className=L,m.appendChild(w),s.appendChild(m)}return l+f.length},i.prototype.renderIndentGuide=function(s,l,h){var f=l.search(this.$indentGuideRe);if(f<=0||f>=h)return l;if(l[0]==" "){f-=f%this.tabSize;for(var b=f/this.tabSize,C=0;CC[w].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&s[l.row]!==""&&l.column===s[l.row].length){this.$highlightIndentGuideMarker.dir=1;for(var w=l.row+1;w0){for(var b=0;b=this.$highlightIndentGuideMarker.start+1){if(f.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(f,l)}}else for(var h=s.length-1;h>=0;h--){var f=s[h];if(this.$highlightIndentGuideMarker.end&&f.row=C;)w=this.$renderToken(x,w,v,E.substring(0,C-f)),E=E.substring(C-f),f=C,x=this.$createLineElement(),s.appendChild(x),x.appendChild(this.dom.createTextNode(g.stringRepeat("\xA0",h.indent),this.element)),b++,w=0,C=h[b]||Number.MAX_VALUE;E.length!=0&&(f+=E.length,w=this.$renderToken(x,w,v,E))}}h[h.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(x,w,null,"",!0)},i.prototype.$renderSimpleLine=function(s,l){for(var h=0,f=0;fthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(s,h,b,C);h=this.$renderToken(s,h,b,C)}}},i.prototype.$renderOverflowMessage=function(s,l,h,f,b){h&&this.$renderToken(s,l,h,f.slice(0,this.MAX_LINE_LENGTH-l));var C=this.dom.createElement("span");C.className="ace_inline_button ace_keyword ace_toggle_wrap",C.textContent=b?"":"",s.appendChild(C)},i.prototype.$renderLine=function(s,l,h){if(!h&&h!=!1&&(h=this.session.getFoldLine(l)),h)var f=this.$getFoldLineTokens(l,h);else var f=this.session.getTokens(l);var b=s;if(f.length){var C=this.session.getRowSplitData(l);if(C&&C.length){this.$renderWrappedLine(s,f,C);var b=s.lastChild}else{var b=s;this.$useLineGroups()&&(b=this.$createLineElement(),s.appendChild(b)),this.$renderSimpleLine(b,f)}}else this.$useLineGroups()&&(b=this.$createLineElement(),s.appendChild(b));if(this.showEOL&&b){h&&(l=h.end.row);var w=this.dom.createElement("span");w.className="ace_invisible ace_invisible_eol",w.textContent=l==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,b.appendChild(w)}},i.prototype.$getFoldLineTokens=function(s,l){var h=this.session,f=[];function b(w,x,A){for(var v=0,E=0;E+w[v].value.lengthA-x&&($=$.substring(0,A-x)),f.push({type:w[v].type,value:$}),E=x+$.length,v+=1}for(;EA?f.push({type:w[v].type,value:$.substring(0,A-E)}):f.push(w[v]),E+=$.length,v+=1}}var C=h.getTokens(s);return l.walk(function(w,x,A,v,E){w!=null?f.push({type:"fold",value:w}):(E&&(C=h.getTokens(x)),C.length&&b(C,v,A))},l.end.row,this.session.getLine(l.end.row).length),f},i.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},i}();n.prototype.EOF_CHAR="\xB6",n.prototype.EOL_CHAR_LF="\xAC",n.prototype.EOL_CHAR_CRLF="\xA4",n.prototype.EOL_CHAR=n.prototype.EOL_CHAR_LF,n.prototype.TAB_CHAR="\u2014",n.prototype.SPACE_CHAR="\xB7",n.prototype.$padding=0,n.prototype.MAX_LINE_LENGTH=1e4,n.prototype.showInvisibles=!1,n.prototype.showSpaces=!1,n.prototype.showTabs=!1,n.prototype.showEOL=!1,n.prototype.displayIndentGuides=!0,n.prototype.$highlightIndentGuides=!0,n.prototype.$tabStrings=[],n.prototype.destroy={},n.prototype.onChangeTabSize=n.prototype.$computeTabString,d.implement(n.prototype,u),e.Text=n});ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,e,c){"use strict";var d=t("../lib/dom"),p=function(){function g(a){this.element=d.createElement("div"),this.element.className="ace_layer ace_cursor-layer",a.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),d.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return g.prototype.$updateOpacity=function(a){for(var u=this.cursors,o=u.length;o--;)d.setStyle(u[o].style,"opacity",a?"":"0")},g.prototype.$startCssAnimation=function(){for(var a=this.cursors,u=a.length;u--;)a[u].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&d.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},g.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,d.removeCssClass(this.element,"ace_animate-blinking")},g.prototype.setPadding=function(a){this.$padding=a},g.prototype.setSession=function(a){this.session=a},g.prototype.setBlinking=function(a){a!=this.isBlinking&&(this.isBlinking=a,this.restartTimer())},g.prototype.setBlinkInterval=function(a){a!=this.blinkInterval&&(this.blinkInterval=a,this.restartTimer())},g.prototype.setSmoothBlinking=function(a){a!=this.smoothBlinking&&(this.smoothBlinking=a,d.setCssClass(this.element,"ace_smooth-blinking",a),this.$updateCursors(!0),this.restartTimer())},g.prototype.addCursor=function(){var a=d.createElement("div");return a.className="ace_cursor",this.element.appendChild(a),this.cursors.push(a),a},g.prototype.removeCursor=function(){if(this.cursors.length>1){var a=this.cursors.pop();return a.parentNode.removeChild(a),a}},g.prototype.hideCursor=function(){this.isVisible=!1,d.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},g.prototype.showCursor=function(){this.isVisible=!0,d.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},g.prototype.restartTimer=function(){var a=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,d.removeCssClass(this.element,"ace_smooth-blinking")),a(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&d.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),d.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var u=function(){this.timeoutId=setTimeout(function(){a(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){a(!0),u()},this.blinkInterval),u()}},g.prototype.getPixelPosition=function(a,u){if(!this.config||!this.session)return{left:0,top:0};a||(a=this.session.selection.getCursor());var o=this.session.documentToScreenPosition(a),r=this.$padding+(this.session.$bidiHandler.isBidiRow(o.row,a.row)?this.session.$bidiHandler.getPosLeft(o.column):o.column*this.config.characterWidth),n=(o.row-(u?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:r,top:n}},g.prototype.isCursorInView=function(a,u){return a.top>=0&&a.topa.height+a.offset||i.top<0)&&o>1)){var s=this.cursors[r++]||this.addCursor(),l=s.style;this.drawCursor?this.drawCursor(s,i,a,u[o],this.session):this.isCursorInView(i,a)?(d.setStyle(l,"display","block"),d.translate(s,i.left,i.top),d.setStyle(l,"width",Math.round(a.characterWidth)+"px"),d.setStyle(l,"height",a.lineHeight+"px")):d.setStyle(l,"display","none")}}for(;this.cursors.length>r;)this.removeCursor();var h=this.session.getOverwrite();this.$setOverwrite(h),this.$pixelPos=i,this.restartTimer()},g.prototype.$setOverwrite=function(a){a!=this.overwrite&&(this.overwrite=a,a?d.addCssClass(this.element,"ace_overwrite-cursors"):d.removeCssClass(this.element,"ace_overwrite-cursors"))},g.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},g}();p.prototype.$padding=0,p.prototype.drawCursor=null,e.Cursor=p});ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,e,c){"use strict";var d=this&&this.__extends||function(){var s=function(l,h){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,b){f.__proto__=b}||function(f,b){for(var C in b)Object.prototype.hasOwnProperty.call(b,C)&&(f[C]=b[C])},s(l,h)};return function(l,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");s(l,h);function f(){this.constructor=l}l.prototype=h===null?Object.create(h):(f.prototype=h.prototype,new f)}}(),p=t("./lib/oop"),g=t("./lib/dom"),a=t("./lib/event"),u=t("./lib/event_emitter").EventEmitter,o=32768,r=function(){function s(l,h){this.element=g.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+h,this.inner=g.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\xA0",this.element.appendChild(this.inner),l.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addListener(this.element,"scroll",this.onScroll.bind(this)),a.addListener(this.element,"mousedown",a.preventDefault)}return s.prototype.setVisible=function(l){this.element.style.display=l?"":"none",this.isVisible=l,this.coeff=1},s}();p.implement(r.prototype,u);var n=function(s){d(l,s);function l(h,f){var b=s.call(this,h,"-v")||this;return b.scrollTop=0,b.scrollHeight=0,f.$scrollbarWidth=b.width=g.scrollbarWidth(h.ownerDocument),b.inner.style.width=b.element.style.width=(b.width||15)+5+"px",b.$minWidth=0,b}return l.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var h=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-h)/(this.coeff-h)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},l.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},l.prototype.setHeight=function(h){this.element.style.height=h+"px"},l.prototype.setScrollHeight=function(h){this.scrollHeight=h,h>o?(this.coeff=o/h,h=o):this.coeff!=1&&(this.coeff=1),this.inner.style.height=h+"px"},l.prototype.setScrollTop=function(h){this.scrollTop!=h&&(this.skipEvent=!0,this.scrollTop=h,this.element.scrollTop=h*this.coeff)},l}(r);n.prototype.setInnerHeight=n.prototype.setScrollHeight;var i=function(s){d(l,s);function l(h,f){var b=s.call(this,h,"-h")||this;return b.scrollLeft=0,b.height=f.$scrollbarWidth,b.inner.style.height=b.element.style.height=(b.height||15)+5+"px",b}return l.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},l.prototype.getHeight=function(){return this.isVisible?this.height:0},l.prototype.setWidth=function(h){this.element.style.width=h+"px"},l.prototype.setInnerWidth=function(h){this.inner.style.width=h+"px"},l.prototype.setScrollWidth=function(h){this.inner.style.width=h+"px"},l.prototype.setScrollLeft=function(h){this.scrollLeft!=h&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=h)},l}(r);e.ScrollBar=n,e.ScrollBarV=n,e.ScrollBarH=i,e.VScrollBar=n,e.HScrollBar=i});ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,e,c){"use strict";var d=this&&this.__extends||function(){var i=function(s,l){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,f){h.__proto__=f}||function(h,f){for(var b in f)Object.prototype.hasOwnProperty.call(f,b)&&(h[b]=f[b])},i(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");i(s,l);function h(){this.constructor=s}s.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}}(),p=t("./lib/oop"),g=t("./lib/dom"),a=t("./lib/event"),u=t("./lib/event_emitter").EventEmitter;g.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{ +`){var B=A.getLine(R.row);if(R.column>B.search(/\S|$/)){var O=B.substr(R.column).search(/\S|$/);A.doc.removeInLine(R.row,R.column,R.column+O)}}this.clearSelection();var N=R.column,P=A.getState(R.row),B=A.getLine(R.row),H=k.checkOutdent(P,B,m);if(A.insert(R,m),I&&I.selection&&(I.selection.length==2?this.selection.setSelectionRange(new h(R.row,N+I.selection[0],R.row,N+I.selection[1])):this.selection.setSelectionRange(new h(R.row+I.selection[0],I.selection[1],R.row+I.selection[2],I.selection[3]))),this.$enableAutoIndent){if(A.getDocument().isNewLine(m)){var V=k.getNextLineIndent(P,B.slice(0,R.column),A.getTabString());A.insert({row:R.row+1,column:0},V)}H&&k.autoOutdent(P,A,R.row)}},y.prototype.autoIndent=function(){var m=this.session,$=m.getMode(),A,k;if(this.selection.isEmpty())A=0,k=m.doc.getLength()-1;else{var R=this.getSelectionRange();A=R.start.row,k=R.end.row}for(var I="",D="",O="",N,P,B,H=m.getTabString(),V=A;V<=k;V++)V>0&&(I=m.getState(V-1),D=m.getLine(V-1),O=$.getNextLineIndent(I,D,H)),N=m.getLine(V),P=$.$getIndent(N),O!==P&&(P.length>0&&(B=new h(V,0,V,P.length),m.remove(B)),O.length>0&&m.insert({row:V,column:0},O)),$.autoOutdent(I,m,V)},y.prototype.onTextInput=function(m,$){if(!$)return this.keyBinding.onTextInput(m);this.startOperation({command:{name:"insertstring"}});var A=this.applyComposition.bind(this,m,$);this.selection.rangeCount?this.forEachSelection(A):A(),this.endOperation()},y.prototype.applyComposition=function(m,$){if($.extendLeft||$.extendRight){var A=this.selection.getRange();A.start.column-=$.extendLeft,A.end.column+=$.extendRight,A.start.column<0&&(A.start.row--,A.start.column+=this.session.getLine(A.start.row).length+1),this.selection.setRange(A),!m&&!A.isEmpty()&&this.remove()}if((m||!this.selection.isEmpty())&&this.insert(m,!0),$.restoreStart||$.restoreEnd){var A=this.selection.getRange();A.start.column-=$.restoreStart,A.end.column-=$.restoreEnd,this.selection.setRange(A)}},y.prototype.onCommandKey=function(m,$,A){return this.keyBinding.onCommandKey(m,$,A)},y.prototype.setOverwrite=function(m){this.session.setOverwrite(m)},y.prototype.getOverwrite=function(){return this.session.getOverwrite()},y.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},y.prototype.setScrollSpeed=function(m){this.setOption("scrollSpeed",m)},y.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},y.prototype.setDragDelay=function(m){this.setOption("dragDelay",m)},y.prototype.getDragDelay=function(){return this.getOption("dragDelay")},y.prototype.setSelectionStyle=function(m){this.setOption("selectionStyle",m)},y.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},y.prototype.setHighlightActiveLine=function(m){this.setOption("highlightActiveLine",m)},y.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},y.prototype.setHighlightGutterLine=function(m){this.setOption("highlightGutterLine",m)},y.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},y.prototype.setHighlightSelectedWord=function(m){this.setOption("highlightSelectedWord",m)},y.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},y.prototype.setAnimatedScroll=function(m){this.renderer.setAnimatedScroll(m)},y.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},y.prototype.setShowInvisibles=function(m){this.renderer.setShowInvisibles(m)},y.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},y.prototype.setDisplayIndentGuides=function(m){this.renderer.setDisplayIndentGuides(m)},y.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},y.prototype.setHighlightIndentGuides=function(m){this.renderer.setHighlightIndentGuides(m)},y.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},y.prototype.setShowPrintMargin=function(m){this.renderer.setShowPrintMargin(m)},y.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},y.prototype.setPrintMarginColumn=function(m){this.renderer.setPrintMarginColumn(m)},y.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},y.prototype.setReadOnly=function(m){this.setOption("readOnly",m)},y.prototype.getReadOnly=function(){return this.getOption("readOnly")},y.prototype.setBehavioursEnabled=function(m){this.setOption("behavioursEnabled",m)},y.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},y.prototype.setWrapBehavioursEnabled=function(m){this.setOption("wrapBehavioursEnabled",m)},y.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},y.prototype.setShowFoldWidgets=function(m){this.setOption("showFoldWidgets",m)},y.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},y.prototype.setFadeFoldWidgets=function(m){this.setOption("fadeFoldWidgets",m)},y.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},y.prototype.remove=function(m){this.selection.isEmpty()&&(m=="left"?this.selection.selectLeft():this.selection.selectRight());var $=this.getSelectionRange();if(this.getBehavioursEnabled()){var A=this.session,k=A.getState($.start.row),R=A.getMode().transformAction(k,"deletion",this,A,$);if($.end.column===0){var I=A.getTextRange($);if(I[I.length-1]==` +`){var D=A.getLine($.end.row);/^\s+$/.test(D)&&($.end.column=D.length)}}R&&($=R)}this.session.remove($),this.clearSelection()},y.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},y.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},y.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},y.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var m=this.getSelectionRange();m.start.column==m.end.column&&m.start.row==m.end.row&&(m.end.column=0,m.end.row++),this.session.remove(m),this.clearSelection()},y.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var m=this.getCursorPosition();this.insert(` +`),this.moveCursorToPosition(m)},y.prototype.setGhostText=function(m,$){this.session.widgetManager||(this.session.widgetManager=new _(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(m,$)},y.prototype.removeGhostText=function(){this.session.widgetManager&&this.renderer.removeGhostText()},y.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var m=this.getCursorPosition(),$=m.column;if($!==0){var A=this.session.getLine(m.row),k,R;$O.toLowerCase()?1:0});for(var R=new h(0,0,0,0),k=m.first;k<=m.last;k++){var I=$.getLine(k);R.start.row=k,R.end.row=k,R.end.column=I.length,$.replace(R,A[k-m.first])}},y.prototype.toggleCommentLines=function(){var m=this.session.getState(this.getCursorPosition().row),$=this.$getSelectedRows();this.session.getMode().toggleCommentLines(m,this.session,$.first,$.last)},y.prototype.toggleBlockComment=function(){var m=this.getCursorPosition(),$=this.session.getState(m.row),A=this.getSelectionRange();this.session.getMode().toggleBlockComment($,this.session,A,m)},y.prototype.getNumberAt=function(m,$){var A=/[\-]?[0-9]+(?:\.[0-9]+)?/g;A.lastIndex=0;for(var k=this.session.getLine(m);A.lastIndex<$;){var R=A.exec(k);if(R.index<=$&&R.index+R[0].length>=$){var I={value:R[0],start:R.index,end:R.index+R[0].length};return I}}return null},y.prototype.modifyNumber=function(m){var $=this.selection.getCursor().row,A=this.selection.getCursor().column,k=new h($,A-1,$,A),R=this.session.getTextRange(k);if(!isNaN(parseFloat(R))&&isFinite(R)){var I=this.getNumberAt($,A);if(I){var D=I.value.indexOf(".")>=0?I.start+I.value.indexOf(".")+1:I.end,O=I.start+I.value.length-D,N=parseFloat(I.value);N*=Math.pow(10,O),D!==I.end&&A=D&&I<=O&&(A=oe,N.selection.clearSelection(),N.moveCursorTo(m,D+k),N.selection.selectTo(m,O+k)),D=O});for(var P=this.$toggleWordPairs,B,H=0;H=O&&D<=N&&V.match(/((?:https?|ftp):\/\/[\S]+)/)){P=V.replace(/[\s:.,'";}\]]+$/,"");break}O=N}}catch(z){A={error:z}}finally{try{H&&!H.done&&(k=B.return)&&k.call(B)}finally{if(A)throw A.error}}return P},y.prototype.openLink=function(){var m=this.selection.getCursor(),$=this.findLinkAt(m.row,m.column);return $&&window.open($,"_blank"),$!=null},y.prototype.removeLines=function(){var m=this.$getSelectedRows();this.session.removeFullLines(m.first,m.last),this.clearSelection()},y.prototype.duplicateSelection=function(){var m=this.selection,$=this.session,A=m.getRange(),k=m.isBackwards();if(A.isEmpty()){var R=A.start.row;$.duplicateLines(R,R)}else{var I=k?A.start:A.end,D=$.insert(I,$.getTextRange(A));A.start=I,A.end=D,m.setSelectionRange(A,k)}},y.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},y.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},y.prototype.moveText=function(m,$,A){return this.session.moveText(m,$,A)},y.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},y.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},y.prototype.$moveLines=function(m,$){var A,k,R=this.selection;if(!R.inMultiSelectMode||this.inVirtualSelectionMode){var I=R.toOrientedRange();A=this.$getSelectedRows(I),k=this.session.$moveLines(A.first,A.last,$?0:m),$&&m==-1&&(k=0),I.moveBy(k,0),R.fromOrientedRange(I)}else{var D=R.rangeList.ranges;R.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var O=0,N=0,P=D.length,B=0;Bz+1)break;z=Z.last}for(B--,O=this.session.$moveLines(V,z,$?0:m),$&&m==-1&&(H=B+1);H<=B;)D[H].moveBy(O,0),H++;$||(O=0),N+=O}R.fromOrientedRange(R.ranges[0]),R.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},y.prototype.$getSelectedRows=function(m){return m=(m||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(m.start.row),last:this.session.getRowFoldEnd(m.end.row)}},y.prototype.onCompositionStart=function(m){this.renderer.showComposition(m)},y.prototype.onCompositionUpdate=function(m){this.renderer.setCompositionText(m)},y.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},y.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},y.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},y.prototype.isRowVisible=function(m){return m>=this.getFirstVisibleRow()&&m<=this.getLastVisibleRow()},y.prototype.isRowFullyVisible=function(m){return m>=this.renderer.getFirstFullyVisibleRow()&&m<=this.renderer.getLastFullyVisibleRow()},y.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},y.prototype.$moveByPage=function(m,$){var A=this.renderer,k=this.renderer.layerConfig,R=m*Math.floor(k.height/k.lineHeight);$===!0?this.selection.$moveSelection(function(){this.moveCursorBy(R,0)}):$===!1&&(this.selection.moveCursorBy(R,0),this.selection.clearSelection());var I=A.scrollTop;A.scrollBy(0,R*k.lineHeight),$!=null&&A.scrollCursorIntoView(null,.5),A.animateScrolling(I)},y.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},y.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},y.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},y.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},y.prototype.scrollPageDown=function(){this.$moveByPage(1)},y.prototype.scrollPageUp=function(){this.$moveByPage(-1)},y.prototype.scrollToRow=function(m){this.renderer.scrollToRow(m)},y.prototype.scrollToLine=function(m,$,A,k){this.renderer.scrollToLine(m,$,A,k)},y.prototype.centerSelection=function(){var m=this.getSelectionRange(),$={row:Math.floor(m.start.row+(m.end.row-m.start.row)/2),column:Math.floor(m.start.column+(m.end.column-m.start.column)/2)};this.renderer.alignCursor($,.5)},y.prototype.getCursorPosition=function(){return this.selection.getCursor()},y.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},y.prototype.getSelectionRange=function(){return this.selection.getRange()},y.prototype.selectAll=function(){this.selection.selectAll()},y.prototype.clearSelection=function(){this.selection.clearSelection()},y.prototype.moveCursorTo=function(m,$){this.selection.moveCursorTo(m,$)},y.prototype.moveCursorToPosition=function(m){this.selection.moveCursorToPosition(m)},y.prototype.jumpToMatching=function(m,$){var A=this.getCursorPosition(),k=new x(this.session,A.row,A.column),R=k.getCurrentToken(),I=0;R&&R.type.indexOf("tag-name")!==-1&&(R=k.stepBackward());var D=R||k.stepForward();if(D){var O,N=!1,P={},B=A.column-D.start,H,V={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(D.value.match(/[{}()\[\]]/g)){for(;B1?P[D.value]++:R.value==="=0;--I)this.$tryReplace(A[I],m)&&k++;return this.selection.setSelectionRange(R),k},y.prototype.$tryReplace=function(m,$){var A=this.session.getTextRange(m);return $=this.$search.replace(A,$),$!==null?(m.end=this.session.replace(m,$),m):null},y.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},y.prototype.find=function(m,$,A){$||($={}),typeof m=="string"||m instanceof RegExp?$.needle=m:typeof m=="object"&&p.mixin($,m);var k=this.selection.getRange();$.needle==null&&(m=this.session.getTextRange(k)||this.$search.$options.needle,m||(k=this.session.getWordRange(k.start.row,k.start.column),m=this.session.getTextRange(k)),this.$search.set({needle:m})),this.$search.set($),$.start||this.$search.set({start:k});var R=this.$search.find(this.session);if($.preventScroll)return R;if(R)return this.revealRange(R,A),R;$.backwards?k.start=k.end:k.end=k.start,this.selection.setRange(k)},y.prototype.findNext=function(m,$){this.find({skipCurrent:!0,backwards:!1},m,$)},y.prototype.findPrevious=function(m,$){this.find(m,{skipCurrent:!0,backwards:!0},$)},y.prototype.revealRange=function(m,$){this.session.unfold(m),this.selection.setSelectionRange(m);var A=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(m.start,m.end,.5),$!==!1&&this.renderer.animateScrolling(A)},y.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},y.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},y.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(m){m.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()},y.prototype.setAutoScrollEditorIntoView=function(m){if(m){var $,A=this,k=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var R=this.$scrollAnchor;R.style.cssText="position:absolute",this.container.insertBefore(R,this.container.firstChild);var I=this.on("changeSelection",function(){k=!0}),D=this.renderer.on("beforeRender",function(){k&&($=A.renderer.container.getBoundingClientRect())}),O=this.renderer.on("afterRender",function(){if(k&&$&&(A.isFocused()||A.searchBox&&A.searchBox.isFocused())){var N=A.renderer,P=N.$cursorLayer.$pixelPos,B=N.layerConfig,H=P.top-B.offset;P.top>=0&&H+$.top<0?k=!0:P.topwindow.innerHeight?k=!1:k=null,k!=null&&(R.style.top=H+"px",R.style.left=P.left+"px",R.style.height=B.lineHeight+"px",R.scrollIntoView(k)),k=$=null}});this.setAutoScrollEditorIntoView=function(N){N||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",I),this.renderer.off("afterRender",O),this.renderer.off("beforeRender",D))}}},y.prototype.$resetCursorStyle=function(){var m=this.$cursorStyle||"ace",$=this.renderer.$cursorLayer;$&&($.setSmoothBlinking(/smooth/.test(m)),$.isBlinking=!this.$readOnly&&m!="wide",g.setCssClass($.element,"ace_slim-cursors",/slim/.test(m)))},y.prototype.prompt=function(m,$,A){var k=this;w.loadModule("ace/ext/prompt",function(R){R.prompt(k,m,$,A)})},y}();E.$uid=0,E.prototype.curOp=null,E.prototype.prevOp={},E.prototype.$mergeableCommands=["backspace","del","insertstring"],E.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],p.implement(E.prototype,f),w.defineOptions(E.prototype,"editor",{selectionStyle:{set:function(y){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:y})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(y){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(y){this.textInput.setReadOnly(y),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(y){this.textInput.setCopyWithEmptySelection(y)},initialValue:!1},cursorStyle:{set:function(y){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(y){this.setAutoScrollEditorIntoView(y)}},keyboardHandler:{set:function(y){this.setKeyboardHandler(y)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(y){this.session.setValue(y)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(y){this.setSession(y)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(y){this.renderer.$gutterLayer.setShowLineNumbers(y),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),y&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(y){this.$showLineNumbers&&y?S.attach(this):S.detach(this)}},placeholder:{set:function(y){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var m=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(m&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),g.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!m&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),g.addCssClass(this.container,"ace_hasPlaceholder");var $=g.createElement("div");$.className="ace_placeholder",$.textContent=this.$placeholder||"",this.renderer.placeholderNode=$,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!m&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(y){var m={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(k){k.blur(),k.renderer.scroller.focus()},readOnly:!0},$=function(k){if(k.target==this.renderer.scroller&&k.keyCode===M.enter){k.preventDefault();var R=this.getCursorPosition().row;this.isRowVisible(R)||this.scrollToLine(R,!0,!0),this.focus()}},A;y?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(u.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",T("editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",T("Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",$.bind(this)),this.commands.addCommand(m),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",T("editor")),this.renderer.$gutter.setAttribute("aria-label",T("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),A||(A=new v(this)),A.addListener()):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",$.bind(this)),this.commands.removeCommand(m),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),A&&A.removeListener())},initialValue:!1},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 S={getText:function(y,m){return(Math.abs(y.selection.lead.row-m)||m+1+(m<9?"\xB7":""))+""},getWidth:function(y,m,$){return Math.max(m.toString().length,($.lastRow+1).toString().length,2)*$.characterWidth},update:function(y,m){m.renderer.$loop.schedule(m.renderer.CHANGE_GUTTER)},attach:function(y){y.renderer.$gutterLayer.$renderer=this,y.on("changeSelection",this.update),this.update(null,y)},detach:function(y){y.renderer.$gutterLayer.$renderer==this&&(y.renderer.$gutterLayer.$renderer=null),y.off("changeSelection",this.update),this.update(null,y)}};e.Editor=E});ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(t,e,c){"use strict";var d=t("../lib/dom"),p=function(){function g(a,u){this.element=a,this.canvasHeight=u||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return g.prototype.moveContainer=function(a){d.translate(this.element,0,-(a.firstRowScreen*a.lineHeight%this.canvasHeight)-a.offset*this.$offsetCoefficient)},g.prototype.pageChanged=function(a,u){return Math.floor(a.firstRowScreen*a.lineHeight/this.canvasHeight)!==Math.floor(u.firstRowScreen*u.lineHeight/this.canvasHeight)},g.prototype.computeLineTop=function(a,u,o){var r=u.firstRowScreen*u.lineHeight,n=Math.floor(r/this.canvasHeight),i=o.documentToScreenRow(a,0)*u.lineHeight;return i-n*this.canvasHeight},g.prototype.computeLineHeight=function(a,u,o){return u.lineHeight*o.getRowLineCount(a)},g.prototype.getLength=function(){return this.cells.length},g.prototype.get=function(a){return this.cells[a]},g.prototype.shift=function(){this.$cacheCell(this.cells.shift())},g.prototype.pop=function(){this.$cacheCell(this.cells.pop())},g.prototype.push=function(a){if(Array.isArray(a)){this.cells.push.apply(this.cells,a);for(var u=d.createFragment(this.element),o=0;oC&&(_=b.end.row+1,b=l.getNextFoldLine(_,b),C=b?b.start.row:1/0),_>f){for(;this.$lines.getLength()>x+1;)this.$lines.pop();break}w=this.$lines.get(++x),w?w.row=_:(w=this.$lines.createCell(_,s,this.session,n),this.$lines.push(w)),this.$renderCell(w,s,b,_),_++}this._signal("afterRender"),this.$updateGutterWidth(s)},i.prototype.$updateGutterWidth=function(s){var l=this.session,h=l.gutterRenderer||this.$renderer,f=l.$firstLineNumber,b=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||l.$useWrapMode)&&(b=l.getLength()+f-1);var C=h?h.getWidth(l,b,s):b.toString().length*s.characterWidth,w=this.$padding||this.$computePadding();C+=w.left+w.right,C!==this.gutterWidth&&!isNaN(C)&&(this.gutterWidth=C,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",C))},i.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var s=this.session.selection.getCursor();this.$cursorRow!==s.row&&(this.$cursorRow=s.row)}},i.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var s=this.session.selection.cursor.row;if(this.$cursorRow=s,!(this.$cursorCell&&this.$cursorCell.row==s)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var l=this.$lines.cells;this.$cursorCell=null;for(var h=0;h=this.$cursorRow){if(f.row>this.$cursorRow){var b=this.session.getFoldLine(this.$cursorRow);if(h>0&&b&&b.start.row==l[h-1].row)f=l[h-1];else break}f.element.className="ace_gutter-active-line "+f.element.className,this.$cursorCell=f;break}}}}},i.prototype.scrollLines=function(s){var l=this.config;if(this.config=s,this.$updateCursorRow(),this.$lines.pageChanged(l,s))return this.update(s);this.$lines.moveContainer(s);var h=Math.min(s.lastRow+s.gutterOffset,this.session.getLength()-1),f=this.oldLastRow;if(this.oldLastRow=h,!l||f0;b--)this.$lines.shift();if(f>h)for(var b=this.session.getFoldedRowCount(h+1,f);b>0;b--)this.$lines.pop();s.firstRowf&&this.$lines.push(this.$renderLines(s,f+1,h)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(s)},i.prototype.$renderLines=function(s,l,h){for(var f=[],b=l,C=this.session.getNextFoldLine(b),w=C?C.start.row:1/0;b>w&&(b=C.end.row+1,C=this.session.getNextFoldLine(b,C),w=C?C.start.row:1/0),!(b>h);){var x=this.$lines.createCell(b,s,this.session,n);this.$renderCell(x,s,C,b),f.push(x),b++}return f},i.prototype.$renderCell=function(s,l,h,f){var b=s.element,C=this.session,w=b.childNodes[0],x=b.childNodes[1],_=b.childNodes[2],v=_.firstChild,T=C.$firstLineNumber,L=C.$breakpoints,M=C.$decorations,E=C.gutterRenderer||this.$renderer,S=this.$showFoldWidgets&&C.foldWidgets,y=h?h.start.row:Number.MAX_VALUE,m=l.lineHeight+"px",$=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",A=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",k=(E?E.getText(C,f):f+T).toString();if(this.$highlightGutterLine&&(f==this.$cursorRow||h&&f=y&&this.$cursorRow<=h.end.row)&&($+="ace_gutter-active-line ",this.$cursorCell!=s&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=s)),L[f]&&($+=L[f]),M[f]&&($+=M[f]),this.$annotations[f]&&f!==y&&($+=this.$annotations[f].className),S){var R=S[f];R==null&&(R=S[f]=C.getFoldWidget(f))}if(R){var I="ace_fold-widget ace_"+R,D=R=="start"&&f==y&&fh.right-l.right)return"foldWidgets"},i}();r.prototype.$fixedWidth=!1,r.prototype.$highlightGutterLine=!0,r.prototype.$renderer="",r.prototype.$showLineNumbers=!0,r.prototype.$showFoldWidgets=!0,p.implement(r.prototype,a);function n(i){var s=document.createTextNode("");i.appendChild(s);var l=d.createElement("span");i.appendChild(l);var h=d.createElement("span");i.appendChild(h);var f=d.createElement("span");return h.appendChild(f),i}e.Gutter=r});ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,e,c){"use strict";var d=t("../range").Range,p=t("../lib/dom"),g=function(){function u(o){this.element=p.createElement("div"),this.element.className="ace_layer ace_marker-layer",o.appendChild(this.element)}return u.prototype.setPadding=function(o){this.$padding=o},u.prototype.setSession=function(o){this.session=o},u.prototype.setMarkers=function(o){this.markers=o},u.prototype.elt=function(o,r){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=r,n.className=o},u.prototype.update=function(o){if(o){this.config=o,this.i=0;var r;for(var n in this.markers){var i=this.markers[n];if(!i.range){i.update(r,this,this.session,o);continue}var s=i.range.clipRows(o.firstRow,o.lastRow);if(!s.isEmpty())if(s=s.toScreenRange(this.session),i.renderer){var l=this.$getTop(s.start.row,o),h=this.$padding+s.start.column*o.characterWidth;i.renderer(r,s,h,l,o)}else i.type=="fullLine"?this.drawFullLineMarker(r,s,i.clazz,o):i.type=="screenLine"?this.drawScreenLineMarker(r,s,i.clazz,o):s.isMultiLine()?i.type=="text"?this.drawTextMarker(r,s,i.clazz,o):this.drawMultiLineMarker(r,s,i.clazz,o):this.drawSingleLineMarker(r,s,i.clazz+" ace_start ace_br15",o)}if(this.i!=-1)for(;this.ix,b==f),i,b==f?0:1,s)},u.prototype.drawMultiLineMarker=function(o,r,n,i,s){var l=this.$padding,h=i.lineHeight,f=this.$getTop(r.start.row,i),b=l+r.start.column*i.characterWidth;if(s=s||"",this.session.$bidiHandler.isBidiRow(r.start.row)){var C=r.clone();C.end.row=C.start.row,C.end.column=this.session.getLine(C.start.row).length,this.drawBidiSingleLineMarker(o,C,n+" ace_br1 ace_start",i,null,s)}else this.elt(n+" ace_br1 ace_start","height:"+h+"px;right:0;top:"+f+"px;left:"+b+"px;"+(s||""));if(this.session.$bidiHandler.isBidiRow(r.end.row)){var C=r.clone();C.start.row=C.end.row,C.start.column=0,this.drawBidiSingleLineMarker(o,C,n+" ace_br12",i,null,s)}else{f=this.$getTop(r.end.row,i);var w=r.end.column*i.characterWidth;this.elt(n+" ace_br12","height:"+h+"px;width:"+w+"px;top:"+f+"px;left:"+l+"px;"+(s||""))}if(h=(r.end.row-r.start.row-1)*i.lineHeight,!(h<=0)){f=this.$getTop(r.start.row+1,i);var x=(r.start.column?1:0)|(r.end.column?0:8);this.elt(n+(x?" ace_br"+x:""),"height:"+h+"px;right:0;top:"+f+"px;left:"+l+"px;"+(s||""))}},u.prototype.drawSingleLineMarker=function(o,r,n,i,s,l){if(this.session.$bidiHandler.isBidiRow(r.start.row))return this.drawBidiSingleLineMarker(o,r,n,i,s,l);var h=i.lineHeight,f=(r.end.column+(s||0)-r.start.column)*i.characterWidth,b=this.$getTop(r.start.row,i),C=this.$padding+r.start.column*i.characterWidth;this.elt(n,"height:"+h+"px;width:"+f+"px;top:"+b+"px;left:"+C+"px;"+(l||""))},u.prototype.drawBidiSingleLineMarker=function(o,r,n,i,s,l){var h=i.lineHeight,f=this.$getTop(r.start.row,i),b=this.$padding,C=this.session.$bidiHandler.getSelections(r.start.column,r.end.column);C.forEach(function(w){this.elt(n,"height:"+h+"px;width:"+(w.width+(s||0))+"px;top:"+f+"px;left:"+(b+w.left)+"px;"+(l||""))},this)},u.prototype.drawFullLineMarker=function(o,r,n,i,s){var l=this.$getTop(r.start.row,i),h=i.lineHeight;r.start.row!=r.end.row&&(h+=this.$getTop(r.end.row,i)-l),this.elt(n,"height:"+h+"px;top:"+l+"px;left:0;right:0;"+(s||""))},u.prototype.drawScreenLineMarker=function(o,r,n,i,s){var l=this.$getTop(r.start.row,i),h=i.lineHeight;this.elt(n,"height:"+h+"px;top:"+l+"px;left:0;right:0;"+(s||""))},u}();g.prototype.$padding=0;function a(u,o,r,n){return(u?1:0)|(o?2:0)|(r?4:0)|(n?8:0)}e.Marker=g});ace.define("ace/layer/text_util",["require","exports","module"],function(t,e,c){var d=new Set(["text","rparen","lparen"]);e.isTextToken=function(p){return d.has(p)}});ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(t,e,c){"use strict";var d=t("../lib/oop"),p=t("../lib/dom"),g=t("../lib/lang"),a=t("./lines").Lines,u=t("../lib/event_emitter").EventEmitter,o=t("../config").nls,r=t("./text_util").isTextToken,n=function(){function i(s){this.dom=p,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",s.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new a(this.element)}return i.prototype.$updateEolChar=function(){var s=this.session.doc,l=s.getNewLineCharacter()==` +`&&s.getNewLineMode()!="windows",h=l?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=h)return this.EOL_CHAR=h,!0},i.prototype.setPadding=function(s){this.$padding=s,this.element.style.margin="0 "+s+"px"},i.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},i.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},i.prototype.$setFontMetrics=function(s){this.$fontMetrics=s,this.$fontMetrics.on("changeCharacterSize",function(l){this._signal("changeCharacterSize",l)}.bind(this)),this.$pollSizeChanges()},i.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},i.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},i.prototype.setSession=function(s){this.session=s,s&&this.$computeTabString()},i.prototype.setShowInvisibles=function(s){return this.showInvisibles==s?!1:(this.showInvisibles=s,typeof s=="string"?(this.showSpaces=/tab/i.test(s),this.showTabs=/space/i.test(s),this.showEOL=/eol/i.test(s)):this.showSpaces=this.showTabs=this.showEOL=s,this.$computeTabString(),!0)},i.prototype.setDisplayIndentGuides=function(s){return this.displayIndentGuides==s?!1:(this.displayIndentGuides=s,this.$computeTabString(),!0)},i.prototype.setHighlightIndentGuides=function(s){return this.$highlightIndentGuides===s?!1:(this.$highlightIndentGuides=s,s)},i.prototype.$computeTabString=function(){var s=this.session.getTabSize();this.tabSize=s;for(var l=this.$tabStrings=[0],h=1;hT&&(_=v.end.row+1,v=this.session.getNextFoldLine(_,v),T=v?v.start.row:1/0),!(_>b);){var L=C[w++];if(L){this.dom.removeChildren(L),this.$renderLine(L,_,_==T?v:!1),x&&(L.style.top=this.$lines.computeLineTop(_,s,this.session)+"px");var M=s.lineHeight*this.session.getRowLength(_)+"px";L.style.height!=M&&(x=!0,L.style.height=M)}_++}if(x)for(;w0;b--)this.$lines.shift();if(l.lastRow>s.lastRow)for(var b=this.session.getFoldedRowCount(s.lastRow+1,l.lastRow);b>0;b--)this.$lines.pop();s.firstRowl.lastRow&&this.$lines.push(this.$renderLinesFragment(s,l.lastRow+1,s.lastRow)),this.$highlightIndentGuide()},i.prototype.$renderLinesFragment=function(s,l,h){for(var f=[],b=l,C=this.session.getNextFoldLine(b),w=C?C.start.row:1/0;b>w&&(b=C.end.row+1,C=this.session.getNextFoldLine(b,C),w=C?C.start.row:1/0),!(b>h);){var x=this.$lines.createCell(b,s,this.session),_=x.element;this.dom.removeChildren(_),p.setStyle(_.style,"height",this.$lines.computeLineHeight(b,s,this.session)+"px"),p.setStyle(_.style,"top",this.$lines.computeLineTop(b,s,this.session)+"px"),this.$renderLine(_,b,b==w?C:!1),this.$useLineGroups()?_.className="ace_line_group":_.className="ace_line",f.push(x),b++}return f},i.prototype.update=function(s){this.$lines.moveContainer(s),this.config=s;for(var l=s.firstRow,h=s.lastRow,f=this.$lines;f.getLength();)f.pop();f.push(this.$renderLinesFragment(s,l,h))},i.prototype.$renderToken=function(s,l,h,f){for(var b=this,C=/(\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]+)|(\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,w=this.dom.createFragment(this.element),x,_=0;x=C.exec(f);){var v=x[1],T=x[2],L=x[3],M=x[4],E=x[5];if(!(!b.showSpaces&&T)){var S=_!=x.index?f.slice(_,x.index):"";if(_=x.index+x[0].length,S&&w.appendChild(this.dom.createTextNode(S,this.element)),v){var y=b.session.getScreenTabSize(l+x.index);w.appendChild(b.$tabStrings[y].cloneNode(!0)),l+=y-1}else if(T)if(b.showSpaces){var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_space",m.textContent=g.stringRepeat(b.SPACE_CHAR,T.length),w.appendChild(m)}else w.appendChild(this.dom.createTextNode(T,this.element));else if(L){var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_space ace_invalid",m.textContent=g.stringRepeat(b.SPACE_CHAR,L.length),w.appendChild(m)}else if(M){l+=1;var m=this.dom.createElement("span");m.style.width=b.config.characterWidth*2+"px",m.className=b.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",m.textContent=b.showSpaces?b.SPACE_CHAR:M,w.appendChild(m)}else if(E){l+=1;var m=this.dom.createElement("span");m.style.width=b.config.characterWidth*2+"px",m.className="ace_cjk",m.textContent=E,w.appendChild(m)}}}if(w.appendChild(this.dom.createTextNode(_?f.slice(_):f,this.element)),r(h.type))s.appendChild(w);else{var $="ace_"+h.type.replace(/\./g," ace_"),m=this.dom.createElement("span");h.type=="fold"&&(m.style.width=h.value.length*this.config.characterWidth+"px",m.setAttribute("title",o("Unfold code"))),m.className=$,m.appendChild(w),s.appendChild(m)}return l+f.length},i.prototype.renderIndentGuide=function(s,l,h){var f=l.search(this.$indentGuideRe);if(f<=0||f>=h)return l;if(l[0]==" "){f-=f%this.tabSize;for(var b=f/this.tabSize,C=0;CC[w].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&s[l.row]!==""&&l.column===s[l.row].length){this.$highlightIndentGuideMarker.dir=1;for(var w=l.row+1;w0){for(var b=0;b=this.$highlightIndentGuideMarker.start+1){if(f.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(f,l)}}else for(var h=s.length-1;h>=0;h--){var f=s[h];if(this.$highlightIndentGuideMarker.end&&f.row=C;)w=this.$renderToken(x,w,v,T.substring(0,C-f)),T=T.substring(C-f),f=C,x=this.$createLineElement(),s.appendChild(x),x.appendChild(this.dom.createTextNode(g.stringRepeat("\xA0",h.indent),this.element)),b++,w=0,C=h[b]||Number.MAX_VALUE;T.length!=0&&(f+=T.length,w=this.$renderToken(x,w,v,T))}}h[h.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(x,w,null,"",!0)},i.prototype.$renderSimpleLine=function(s,l){for(var h=0,f=0;fthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(s,h,b,C);h=this.$renderToken(s,h,b,C)}}},i.prototype.$renderOverflowMessage=function(s,l,h,f,b){h&&this.$renderToken(s,l,h,f.slice(0,this.MAX_LINE_LENGTH-l));var C=this.dom.createElement("span");C.className="ace_inline_button ace_keyword ace_toggle_wrap",C.textContent=b?"":"",s.appendChild(C)},i.prototype.$renderLine=function(s,l,h){if(!h&&h!=!1&&(h=this.session.getFoldLine(l)),h)var f=this.$getFoldLineTokens(l,h);else var f=this.session.getTokens(l);var b=s;if(f.length){var C=this.session.getRowSplitData(l);if(C&&C.length){this.$renderWrappedLine(s,f,C);var b=s.lastChild}else{var b=s;this.$useLineGroups()&&(b=this.$createLineElement(),s.appendChild(b)),this.$renderSimpleLine(b,f)}}else this.$useLineGroups()&&(b=this.$createLineElement(),s.appendChild(b));if(this.showEOL&&b){h&&(l=h.end.row);var w=this.dom.createElement("span");w.className="ace_invisible ace_invisible_eol",w.textContent=l==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,b.appendChild(w)}},i.prototype.$getFoldLineTokens=function(s,l){var h=this.session,f=[];function b(w,x,_){for(var v=0,T=0;T+w[v].value.length_-x&&(L=L.substring(0,_-x)),f.push({type:w[v].type,value:L}),T=x+L.length,v+=1}for(;T<_&&v_?f.push({type:w[v].type,value:L.substring(0,_-T)}):f.push(w[v]),T+=L.length,v+=1}}var C=h.getTokens(s);return l.walk(function(w,x,_,v,T){w!=null?f.push({type:"fold",value:w}):(T&&(C=h.getTokens(x)),C.length&&b(C,v,_))},l.end.row,this.session.getLine(l.end.row).length),f},i.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},i}();n.prototype.EOF_CHAR="\xB6",n.prototype.EOL_CHAR_LF="\xAC",n.prototype.EOL_CHAR_CRLF="\xA4",n.prototype.EOL_CHAR=n.prototype.EOL_CHAR_LF,n.prototype.TAB_CHAR="\u2014",n.prototype.SPACE_CHAR="\xB7",n.prototype.$padding=0,n.prototype.MAX_LINE_LENGTH=1e4,n.prototype.showInvisibles=!1,n.prototype.showSpaces=!1,n.prototype.showTabs=!1,n.prototype.showEOL=!1,n.prototype.displayIndentGuides=!0,n.prototype.$highlightIndentGuides=!0,n.prototype.$tabStrings=[],n.prototype.destroy={},n.prototype.onChangeTabSize=n.prototype.$computeTabString,d.implement(n.prototype,u),e.Text=n});ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,e,c){"use strict";var d=t("../lib/dom"),p=function(){function g(a){this.element=d.createElement("div"),this.element.className="ace_layer ace_cursor-layer",a.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),d.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return g.prototype.$updateOpacity=function(a){for(var u=this.cursors,o=u.length;o--;)d.setStyle(u[o].style,"opacity",a?"":"0")},g.prototype.$startCssAnimation=function(){for(var a=this.cursors,u=a.length;u--;)a[u].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&d.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},g.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,d.removeCssClass(this.element,"ace_animate-blinking")},g.prototype.setPadding=function(a){this.$padding=a},g.prototype.setSession=function(a){this.session=a},g.prototype.setBlinking=function(a){a!=this.isBlinking&&(this.isBlinking=a,this.restartTimer())},g.prototype.setBlinkInterval=function(a){a!=this.blinkInterval&&(this.blinkInterval=a,this.restartTimer())},g.prototype.setSmoothBlinking=function(a){a!=this.smoothBlinking&&(this.smoothBlinking=a,d.setCssClass(this.element,"ace_smooth-blinking",a),this.$updateCursors(!0),this.restartTimer())},g.prototype.addCursor=function(){var a=d.createElement("div");return a.className="ace_cursor",this.element.appendChild(a),this.cursors.push(a),a},g.prototype.removeCursor=function(){if(this.cursors.length>1){var a=this.cursors.pop();return a.parentNode.removeChild(a),a}},g.prototype.hideCursor=function(){this.isVisible=!1,d.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},g.prototype.showCursor=function(){this.isVisible=!0,d.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},g.prototype.restartTimer=function(){var a=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,d.removeCssClass(this.element,"ace_smooth-blinking")),a(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&d.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),d.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var u=function(){this.timeoutId=setTimeout(function(){a(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){a(!0),u()},this.blinkInterval),u()}},g.prototype.getPixelPosition=function(a,u){if(!this.config||!this.session)return{left:0,top:0};a||(a=this.session.selection.getCursor());var o=this.session.documentToScreenPosition(a),r=this.$padding+(this.session.$bidiHandler.isBidiRow(o.row,a.row)?this.session.$bidiHandler.getPosLeft(o.column):o.column*this.config.characterWidth),n=(o.row-(u?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:r,top:n}},g.prototype.isCursorInView=function(a,u){return a.top>=0&&a.topa.height+a.offset||i.top<0)&&o>1)){var s=this.cursors[r++]||this.addCursor(),l=s.style;this.drawCursor?this.drawCursor(s,i,a,u[o],this.session):this.isCursorInView(i,a)?(d.setStyle(l,"display","block"),d.translate(s,i.left,i.top),d.setStyle(l,"width",Math.round(a.characterWidth)+"px"),d.setStyle(l,"height",a.lineHeight+"px")):d.setStyle(l,"display","none")}}for(;this.cursors.length>r;)this.removeCursor();var h=this.session.getOverwrite();this.$setOverwrite(h),this.$pixelPos=i,this.restartTimer()},g.prototype.$setOverwrite=function(a){a!=this.overwrite&&(this.overwrite=a,a?d.addCssClass(this.element,"ace_overwrite-cursors"):d.removeCssClass(this.element,"ace_overwrite-cursors"))},g.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},g}();p.prototype.$padding=0,p.prototype.drawCursor=null,e.Cursor=p});ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,e,c){"use strict";var d=this&&this.__extends||function(){var s=function(l,h){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,b){f.__proto__=b}||function(f,b){for(var C in b)Object.prototype.hasOwnProperty.call(b,C)&&(f[C]=b[C])},s(l,h)};return function(l,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");s(l,h);function f(){this.constructor=l}l.prototype=h===null?Object.create(h):(f.prototype=h.prototype,new f)}}(),p=t("./lib/oop"),g=t("./lib/dom"),a=t("./lib/event"),u=t("./lib/event_emitter").EventEmitter,o=32768,r=function(){function s(l,h){this.element=g.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+h,this.inner=g.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\xA0",this.element.appendChild(this.inner),l.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addListener(this.element,"scroll",this.onScroll.bind(this)),a.addListener(this.element,"mousedown",a.preventDefault)}return s.prototype.setVisible=function(l){this.element.style.display=l?"":"none",this.isVisible=l,this.coeff=1},s}();p.implement(r.prototype,u);var n=function(s){d(l,s);function l(h,f){var b=s.call(this,h,"-v")||this;return b.scrollTop=0,b.scrollHeight=0,f.$scrollbarWidth=b.width=g.scrollbarWidth(h.ownerDocument),b.inner.style.width=b.element.style.width=(b.width||15)+5+"px",b.$minWidth=0,b}return l.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var h=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-h)/(this.coeff-h)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},l.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},l.prototype.setHeight=function(h){this.element.style.height=h+"px"},l.prototype.setScrollHeight=function(h){this.scrollHeight=h,h>o?(this.coeff=o/h,h=o):this.coeff!=1&&(this.coeff=1),this.inner.style.height=h+"px"},l.prototype.setScrollTop=function(h){this.scrollTop!=h&&(this.skipEvent=!0,this.scrollTop=h,this.element.scrollTop=h*this.coeff)},l}(r);n.prototype.setInnerHeight=n.prototype.setScrollHeight;var i=function(s){d(l,s);function l(h,f){var b=s.call(this,h,"-h")||this;return b.scrollLeft=0,b.height=f.$scrollbarWidth,b.inner.style.height=b.element.style.height=(b.height||15)+5+"px",b}return l.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},l.prototype.getHeight=function(){return this.isVisible?this.height:0},l.prototype.setWidth=function(h){this.element.style.width=h+"px"},l.prototype.setInnerWidth=function(h){this.inner.style.width=h+"px"},l.prototype.setScrollWidth=function(h){this.inner.style.width=h+"px"},l.prototype.setScrollLeft=function(h){this.scrollLeft!=h&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=h)},l}(r);e.ScrollBar=n,e.ScrollBarV=n,e.ScrollBarH=i,e.VScrollBar=n,e.HScrollBar=i});ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,e,c){"use strict";var d=this&&this.__extends||function(){var i=function(s,l){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,f){h.__proto__=f}||function(h,f){for(var b in f)Object.prototype.hasOwnProperty.call(f,b)&&(h[b]=f[b])},i(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");i(s,l);function h(){this.constructor=s}s.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)}}(),p=t("./lib/oop"),g=t("./lib/dom"),a=t("./lib/event"),u=t("./lib/event_emitter").EventEmitter;g.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{ position: absolute; background: rgba(128, 128, 128, 0.6); -moz-box-sizing: border-box; @@ -244,7 +244,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho .ace_editor>.ace_sb_grabbed { z-index: 8; background: #000; -}`,"ace_scrollbar.css",!1);var o=function(){function i(s,l){this.element=g.createElement("div"),this.element.className="ace_sb"+l,this.inner=g.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,s.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return i.prototype.setVisible=function(s){this.element.style.display=s?"":"none",this.isVisible=s,this.coeff=1},i}();p.implement(o.prototype,u);var r=function(i){d(s,i);function s(l,h){var f=i.call(this,l,"-v")||this;return f.scrollTop=0,f.scrollHeight=0,f.parent=l,f.width=f.VScrollWidth,f.renderer=h,f.inner.style.width=f.element.style.width=(f.width||15)+"px",f.$minWidth=0,f}return s.prototype.onMouseDown=function(l,h){if(l==="mousedown"&&!(a.getButton(h)!==0||h.detail===2)){if(h.target===this.inner){var f=this,b=h.clientY,C=function(M){b=M.clientY},w=function(){clearInterval(E)},x=h.clientY,A=this.thumbTop,v=function(){if(b!==void 0){var M=f.scrollTopFromThumbTop(A+b-x);M!==f.scrollTop&&f._emit("scroll",{data:M})}};a.capture(this.inner,C,w);var E=setInterval(v,20);return a.preventDefault(h)}var $=h.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop($)}),a.preventDefault(h)}},s.prototype.getHeight=function(){return this.height},s.prototype.scrollTopFromThumbTop=function(l){var h=l*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return h=h>>0,h<0?h=0:h>this.pageHeight-this.viewHeight&&(h=this.pageHeight-this.viewHeight),h},s.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},s.prototype.setHeight=function(l){this.height=Math.max(0,l),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},s.prototype.setScrollHeight=function(l,h){this.pageHeight===l&&!h||(this.pageHeight=l,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},s.prototype.setScrollTop=function(l){this.scrollTop=l,l<0&&(l=0),this.thumbTop=l*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},s}(o);r.prototype.setInnerHeight=r.prototype.setScrollHeight;var n=function(i){d(s,i);function s(l,h){var f=i.call(this,l,"-h")||this;return f.scrollLeft=0,f.scrollWidth=0,f.height=f.HScrollHeight,f.inner.style.height=f.element.style.height=(f.height||12)+"px",f.renderer=h,f}return s.prototype.onMouseDown=function(l,h){if(l==="mousedown"&&!(a.getButton(h)!==0||h.detail===2)){if(h.target===this.inner){var f=this,b=h.clientX,C=function(M){b=M.clientX},w=function(){clearInterval(E)},x=h.clientX,A=this.thumbLeft,v=function(){if(b!==void 0){var M=f.scrollLeftFromThumbLeft(A+b-x);M!==f.scrollLeft&&f._emit("scroll",{data:M})}};a.capture(this.inner,C,w);var E=setInterval(v,20);return a.preventDefault(h)}var $=h.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft($)}),a.preventDefault(h)}},s.prototype.getHeight=function(){return this.isVisible?this.height:0},s.prototype.scrollLeftFromThumbLeft=function(l){var h=l*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return h=h>>0,h<0?h=0:h>this.pageWidth-this.viewWidth&&(h=this.pageWidth-this.viewWidth),h},s.prototype.setWidth=function(l){this.width=Math.max(0,l),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},s.prototype.setScrollWidth=function(l,h){this.pageWidth===l&&!h||(this.pageWidth=l,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},s.prototype.setScrollLeft=function(l){this.scrollLeft=l,l<0&&(l=0),this.thumbLeft=l*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},s}(o);n.prototype.setInnerWidth=n.prototype.setScrollWidth,e.ScrollBar=r,e.ScrollBarV=r,e.ScrollBarH=n,e.VScrollBar=r,e.HScrollBar=n});ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,e,c){"use strict";var d=t("./lib/event"),p=function(){function g(a,u){this.onRender=a,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=u||window;var o=this;this._flush=function(r){o.pending=!1;var n=o.changes;if(n&&(d.blockIdle(100),o.changes=0,o.onRender(n)),o.changes){if(o.$recursionLimit--<0)return;o.schedule()}else o.$recursionLimit=2}}return g.prototype.schedule=function(a){this.changes=this.changes|a,this.changes&&!this.pending&&(d.nextFrame(this._flush),this.pending=!0)},g.prototype.clear=function(a){var u=this.changes;return this.changes=0,u},g}();e.RenderLoop=p});ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(t,e,c){var d=t("../lib/oop"),p=t("../lib/dom"),g=t("../lib/lang"),a=t("../lib/event"),u=t("../lib/useragent"),o=t("../lib/event_emitter").EventEmitter,r=512,n=typeof ResizeObserver=="function",i=200,s=function(){function l(h){this.el=p.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=p.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=p.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),h.appendChild(this.el),this.$measureNode.textContent=g.stringRepeat("X",r),this.$characterSize={width:0,height:0},n?this.$addObserver():this.checkForSizeChanges()}return l.prototype.$setMeasureNodeStyles=function(h,f){h.width=h.height="auto",h.left=h.top="0px",h.visibility="hidden",h.position="absolute",h.whiteSpace="pre",u.isIE<8?h["font-family"]="inherit":h.font="inherit",h.overflow=f?"hidden":"visible"},l.prototype.checkForSizeChanges=function(h){if(h===void 0&&(h=this.$measureSizes()),h&&(this.$characterSize.width!==h.width||this.$characterSize.height!==h.height)){this.$measureNode.style.fontWeight="bold";var f=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=h,this.charSizes=Object.create(null),this.allowBoldFonts=f&&f.width===h.width&&f.height===h.height,this._emit("changeCharacterSize",{data:h})}},l.prototype.$addObserver=function(){var h=this;this.$observer=new window.ResizeObserver(function(f){h.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},l.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var h=this;return this.$pollSizeChangesTimer=a.onIdle(function f(){h.checkForSizeChanges(),a.onIdle(f,500)},500)},l.prototype.setPolling=function(h){h?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},l.prototype.$measureSizes=function(h){var f={height:(h||this.$measureNode).clientHeight,width:(h||this.$measureNode).clientWidth/r};return f.width===0||f.height===0?null:f},l.prototype.$measureCharWidth=function(h){this.$main.textContent=g.stringRepeat(h,r);var f=this.$main.getBoundingClientRect();return f.width/r},l.prototype.getCharacterWidth=function(h){var f=this.charSizes[h];return f===void 0&&(f=this.charSizes[h]=this.$measureCharWidth(h)/this.$characterSize.width),f},l.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},l.prototype.$getZoom=function(h){return!h||!h.parentElement?1:(window.getComputedStyle(h).zoom||1)*this.$getZoom(h.parentElement)},l.prototype.$initTransformMeasureNodes=function(){var h=function(f,b){return["div",{style:"position: absolute;top:"+f+"px;left:"+b+"px;"}]};this.els=p.buildDom([h(0,0),h(i,0),h(0,i),h(i,i)],this.el)},l.prototype.transformCoordinates=function(h,f){if(h){var b=this.$getZoom(this.el);h=A(1/b,h)}function C(D,O,N){var P=D[1]*O[0]-D[0]*O[1];return[(-O[1]*N[0]+O[0]*N[1])/P,(+D[1]*N[0]-D[0]*N[1])/P]}function w(D,O){return[D[0]-O[0],D[1]-O[1]]}function x(D,O){return[D[0]+O[0],D[1]+O[1]]}function A(D,O){return[D*O[0],D*O[1]]}this.els||this.$initTransformMeasureNodes();function v(D){var O=D.getBoundingClientRect();return[O.left,O.top]}var E=v(this.els[0]),$=v(this.els[1]),M=v(this.els[2]),S=v(this.els[3]),T=C(w(S,$),w(S,M),w(x($,M),x(S,E))),y=A(1+T[0],w($,E)),m=A(1+T[1],w(M,E));if(f){var L=f,_=T[0]*L[0]/i+T[1]*L[1]/i+1,k=x(A(L[0],y),A(L[1],m));return x(A(1/_/i,k),E)}var I=w(h,E),R=C(w(y,A(T[0],I)),w(m,A(T[1],I)),I);return A(i,R)},l}();s.prototype.$characterSize={width:0,height:0},d.implement(s.prototype,o),e.FontMetrics=s});ace.define("ace/css/editor-css",["require","exports","module"],function(t,e,c){c.exports=` +}`,"ace_scrollbar.css",!1);var o=function(){function i(s,l){this.element=g.createElement("div"),this.element.className="ace_sb"+l,this.inner=g.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,s.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return i.prototype.setVisible=function(s){this.element.style.display=s?"":"none",this.isVisible=s,this.coeff=1},i}();p.implement(o.prototype,u);var r=function(i){d(s,i);function s(l,h){var f=i.call(this,l,"-v")||this;return f.scrollTop=0,f.scrollHeight=0,f.parent=l,f.width=f.VScrollWidth,f.renderer=h,f.inner.style.width=f.element.style.width=(f.width||15)+"px",f.$minWidth=0,f}return s.prototype.onMouseDown=function(l,h){if(l==="mousedown"&&!(a.getButton(h)!==0||h.detail===2)){if(h.target===this.inner){var f=this,b=h.clientY,C=function(M){b=M.clientY},w=function(){clearInterval(T)},x=h.clientY,_=this.thumbTop,v=function(){if(b!==void 0){var M=f.scrollTopFromThumbTop(_+b-x);M!==f.scrollTop&&f._emit("scroll",{data:M})}};a.capture(this.inner,C,w);var T=setInterval(v,20);return a.preventDefault(h)}var L=h.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(L)}),a.preventDefault(h)}},s.prototype.getHeight=function(){return this.height},s.prototype.scrollTopFromThumbTop=function(l){var h=l*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return h=h>>0,h<0?h=0:h>this.pageHeight-this.viewHeight&&(h=this.pageHeight-this.viewHeight),h},s.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},s.prototype.setHeight=function(l){this.height=Math.max(0,l),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},s.prototype.setScrollHeight=function(l,h){this.pageHeight===l&&!h||(this.pageHeight=l,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},s.prototype.setScrollTop=function(l){this.scrollTop=l,l<0&&(l=0),this.thumbTop=l*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},s}(o);r.prototype.setInnerHeight=r.prototype.setScrollHeight;var n=function(i){d(s,i);function s(l,h){var f=i.call(this,l,"-h")||this;return f.scrollLeft=0,f.scrollWidth=0,f.height=f.HScrollHeight,f.inner.style.height=f.element.style.height=(f.height||12)+"px",f.renderer=h,f}return s.prototype.onMouseDown=function(l,h){if(l==="mousedown"&&!(a.getButton(h)!==0||h.detail===2)){if(h.target===this.inner){var f=this,b=h.clientX,C=function(M){b=M.clientX},w=function(){clearInterval(T)},x=h.clientX,_=this.thumbLeft,v=function(){if(b!==void 0){var M=f.scrollLeftFromThumbLeft(_+b-x);M!==f.scrollLeft&&f._emit("scroll",{data:M})}};a.capture(this.inner,C,w);var T=setInterval(v,20);return a.preventDefault(h)}var L=h.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(L)}),a.preventDefault(h)}},s.prototype.getHeight=function(){return this.isVisible?this.height:0},s.prototype.scrollLeftFromThumbLeft=function(l){var h=l*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return h=h>>0,h<0?h=0:h>this.pageWidth-this.viewWidth&&(h=this.pageWidth-this.viewWidth),h},s.prototype.setWidth=function(l){this.width=Math.max(0,l),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},s.prototype.setScrollWidth=function(l,h){this.pageWidth===l&&!h||(this.pageWidth=l,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},s.prototype.setScrollLeft=function(l){this.scrollLeft=l,l<0&&(l=0),this.thumbLeft=l*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},s}(o);n.prototype.setInnerWidth=n.prototype.setScrollWidth,e.ScrollBar=r,e.ScrollBarV=r,e.ScrollBarH=n,e.VScrollBar=r,e.HScrollBar=n});ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,e,c){"use strict";var d=t("./lib/event"),p=function(){function g(a,u){this.onRender=a,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=u||window;var o=this;this._flush=function(r){o.pending=!1;var n=o.changes;if(n&&(d.blockIdle(100),o.changes=0,o.onRender(n)),o.changes){if(o.$recursionLimit--<0)return;o.schedule()}else o.$recursionLimit=2}}return g.prototype.schedule=function(a){this.changes=this.changes|a,this.changes&&!this.pending&&(d.nextFrame(this._flush),this.pending=!0)},g.prototype.clear=function(a){var u=this.changes;return this.changes=0,u},g}();e.RenderLoop=p});ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(t,e,c){var d=t("../lib/oop"),p=t("../lib/dom"),g=t("../lib/lang"),a=t("../lib/event"),u=t("../lib/useragent"),o=t("../lib/event_emitter").EventEmitter,r=512,n=typeof ResizeObserver=="function",i=200,s=function(){function l(h){this.el=p.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=p.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=p.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),h.appendChild(this.el),this.$measureNode.textContent=g.stringRepeat("X",r),this.$characterSize={width:0,height:0},n?this.$addObserver():this.checkForSizeChanges()}return l.prototype.$setMeasureNodeStyles=function(h,f){h.width=h.height="auto",h.left=h.top="0px",h.visibility="hidden",h.position="absolute",h.whiteSpace="pre",u.isIE<8?h["font-family"]="inherit":h.font="inherit",h.overflow=f?"hidden":"visible"},l.prototype.checkForSizeChanges=function(h){if(h===void 0&&(h=this.$measureSizes()),h&&(this.$characterSize.width!==h.width||this.$characterSize.height!==h.height)){this.$measureNode.style.fontWeight="bold";var f=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=h,this.charSizes=Object.create(null),this.allowBoldFonts=f&&f.width===h.width&&f.height===h.height,this._emit("changeCharacterSize",{data:h})}},l.prototype.$addObserver=function(){var h=this;this.$observer=new window.ResizeObserver(function(f){h.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},l.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var h=this;return this.$pollSizeChangesTimer=a.onIdle(function f(){h.checkForSizeChanges(),a.onIdle(f,500)},500)},l.prototype.setPolling=function(h){h?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},l.prototype.$measureSizes=function(h){var f={height:(h||this.$measureNode).clientHeight,width:(h||this.$measureNode).clientWidth/r};return f.width===0||f.height===0?null:f},l.prototype.$measureCharWidth=function(h){this.$main.textContent=g.stringRepeat(h,r);var f=this.$main.getBoundingClientRect();return f.width/r},l.prototype.getCharacterWidth=function(h){var f=this.charSizes[h];return f===void 0&&(f=this.charSizes[h]=this.$measureCharWidth(h)/this.$characterSize.width),f},l.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},l.prototype.$getZoom=function(h){return!h||!h.parentElement?1:(window.getComputedStyle(h).zoom||1)*this.$getZoom(h.parentElement)},l.prototype.$initTransformMeasureNodes=function(){var h=function(f,b){return["div",{style:"position: absolute;top:"+f+"px;left:"+b+"px;"}]};this.els=p.buildDom([h(0,0),h(i,0),h(0,i),h(i,i)],this.el)},l.prototype.transformCoordinates=function(h,f){if(h){var b=this.$getZoom(this.el);h=_(1/b,h)}function C(D,O,N){var P=D[1]*O[0]-D[0]*O[1];return[(-O[1]*N[0]+O[0]*N[1])/P,(+D[1]*N[0]-D[0]*N[1])/P]}function w(D,O){return[D[0]-O[0],D[1]-O[1]]}function x(D,O){return[D[0]+O[0],D[1]+O[1]]}function _(D,O){return[D*O[0],D*O[1]]}this.els||this.$initTransformMeasureNodes();function v(D){var O=D.getBoundingClientRect();return[O.left,O.top]}var T=v(this.els[0]),L=v(this.els[1]),M=v(this.els[2]),E=v(this.els[3]),S=C(w(E,L),w(E,M),w(x(L,M),x(E,T))),y=_(1+S[0],w(L,T)),m=_(1+S[1],w(M,T));if(f){var $=f,A=S[0]*$[0]/i+S[1]*$[1]/i+1,k=x(_($[0],y),_($[1],m));return x(_(1/A/i,k),T)}var R=w(h,T),I=C(w(y,_(S[0],R)),w(m,_(S[1],R)),R);return _(i,I)},l}();s.prototype.$characterSize={width:0,height:0},d.implement(s.prototype,o),e.FontMetrics=s});ace.define("ace/css/editor-css",["require","exports","module"],function(t,e,c){c.exports=` .ace_br1 {border-top-left-radius : 3px;} .ace_br2 {border-top-right-radius : 3px;} .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;} @@ -901,11 +901,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho width:1px; height:1px; overflow:hidden; -}`});ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(t,e,c){"use strict";var d=t("../lib/dom"),p=t("../lib/oop"),g=t("../lib/event_emitter").EventEmitter,a=function(){function u(o,r){this.canvas=d.createElement("canvas"),this.renderer=r,this.pixelRatio=1,this.maxHeight=r.layerConfig.maxHeight,this.lineHeight=r.layerConfig.lineHeight,this.canvasHeight=o.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=o.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)"},o.element.appendChild(this.canvas)}return u.prototype.$updateDecorators=function(o){var r=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(o){this.maxHeight=o.maxHeight,this.lineHeight=o.lineHeight,this.canvasHeight=o.height;var n=(o.lastRow+1)*this.lineHeight;nT.priority?1:0}var l=this.renderer.session.$annotations;if(i.clearRect(0,0,this.canvas.width,this.canvas.height),l){var h={info:1,warning:2,error:3};l.forEach(function(S){S.priority=h[S.type]||null}),l=l.sort(s);for(var f=this.renderer.session.$foldData,b=0;bthis.canvasHeight&&($=this.canvasHeight-this.halfMinDecorationHeight),A=Math.round($-this.halfMinDecorationHeight),v=Math.round($+this.halfMinDecorationHeight)}i.fillStyle=r[l[b].type]||null,i.fillRect(0,x,this.canvasWidth,v-A)}}var M=this.renderer.session.selection.getCursor();if(M){var w=this.compensateFoldRows(M.row,f),x=Math.round((M.row-w)*this.lineHeight*this.heightRatio);i.fillStyle="rgba(0, 0, 0, 0.5)",i.fillRect(0,x,this.canvasWidth,2)}},u.prototype.compensateFoldRows=function(o,r){var n=0;if(r&&r.length>0)for(var i=0;ir[i].start.row&&o=r[i].end.row&&(n+=r[i].end.row-r[i].start.row);return n},u}();p.implement(a.prototype,g),e.Decorator=a});ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent"],function(t,e,c){"use strict";var d=t("./lib/oop"),p=t("./lib/dom"),g=t("./lib/lang"),a=t("./config"),u=t("./layer/gutter").Gutter,o=t("./layer/marker").Marker,r=t("./layer/text").Text,n=t("./layer/cursor").Cursor,i=t("./scrollbar").HScrollBar,s=t("./scrollbar").VScrollBar,l=t("./scrollbar_custom").HScrollBar,h=t("./scrollbar_custom").VScrollBar,f=t("./renderloop").RenderLoop,b=t("./layer/font_metrics").FontMetrics,C=t("./lib/event_emitter").EventEmitter,w=t("./css/editor-css"),x=t("./layer/decorators").Decorator,A=t("./lib/useragent");p.importCssString(w,"ace_editor.css",!1);var v=function(){function E($,M){var S=this;this.container=$||p.createElement("div"),p.addCssClass(this.container,"ace_editor"),p.HI_DPI&&p.addCssClass(this.container,"ace_hidpi"),this.setTheme(M),a.get("useStrictCSP")==null&&a.set("useStrictCSP",!1),this.$gutter=p.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=p.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=p.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new u(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new o(this.content);var T=this.$textLayer=new r(this.content);this.canvas=T.element,this.$markerFront=new o(this.content),this.$cursorLayer=new n(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new s(this.container,this),this.scrollBarH=new i(this.container,this),this.scrollBarV.on("scroll",function(y){S.$scrollAnimation||S.session.setScrollTop(y.data-S.scrollMargin.top)}),this.scrollBarH.on("scroll",function(y){S.$scrollAnimation||S.session.setScrollLeft(y.data-S.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(y){S.updateCharacterSize(),S.onResize(!0,S.gutterWidth,S.$size.width,S.$size.height),S._signal("changeCharacterSize",y)}),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=!A.isIOS,this.$loop=new f(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),a.resetOptions(this),a._signal("renderer",this)}return E.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),p.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},E.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))},E.prototype.updateLines=function($,M,S){if(M===void 0&&(M=1/0),this.$changedLines?(this.$changedLines.firstRow>$&&(this.$changedLines.firstRow=$),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},E.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},E.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},E.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},E.prototype.updateFull=function($){$?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},E.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},E.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},E.prototype.onResize=function($,M,S,T){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=$?1:0;var y=this.container;T||(T=y.clientHeight||y.scrollHeight),S||(S=y.clientWidth||y.scrollWidth);var m=this.$updateCachedSize($,M,S,T);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!S&&!T)return this.resizing=0;$&&(this.$gutterLayer.$padding=null),$?this.$renderChanges(m|this.$changes,!0):this.$loop.schedule(m|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},E.prototype.$updateCachedSize=function($,M,S,T){T-=this.$extraHeight||0;var y=0,m=this.$size,L={width:m.width,height:m.height,scrollerHeight:m.scrollerHeight,scrollerWidth:m.scrollerWidth};if(T&&($||m.height!=T)&&(m.height=T,y|=this.CHANGE_SIZE,m.scrollerHeight=m.height,this.$horizScroll&&(m.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(m.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",y=y|this.CHANGE_SCROLL),S&&($||m.width!=S)){y|=this.CHANGE_SIZE,m.width=S,M==null&&(M=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=M,p.setStyle(this.scrollBarH.element.style,"left",M+"px"),p.setStyle(this.scroller.style,"left",M+this.margin.left+"px"),m.scrollerWidth=Math.max(0,S-M-this.scrollBarV.getWidth()-this.margin.h),p.setStyle(this.$gutter.style,"left",this.margin.left+"px");var _=this.scrollBarV.getWidth()+"px";p.setStyle(this.scrollBarH.element.style,"right",_),p.setStyle(this.scroller.style,"right",_),p.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(m.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||$)&&(y|=this.CHANGE_FULL)}return m.$dirty=!S||!T,y&&this._signal("resize",L),y},E.prototype.onGutterResize=function($){var M=this.$showGutter?$:0;M!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,M,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()},E.prototype.adjustWrapLimit=function(){var $=this.$size.scrollerWidth-this.$padding*2,M=Math.floor($/this.characterWidth);return this.session.adjustWrapLimit(M,this.$showPrintMargin&&this.$printMarginColumn)},E.prototype.setAnimatedScroll=function($){this.setOption("animatedScroll",$)},E.prototype.getAnimatedScroll=function(){return this.$animatedScroll},E.prototype.setShowInvisibles=function($){this.setOption("showInvisibles",$),this.session.$bidiHandler.setShowInvisibles($)},E.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},E.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},E.prototype.setDisplayIndentGuides=function($){this.setOption("displayIndentGuides",$)},E.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},E.prototype.setHighlightIndentGuides=function($){this.setOption("highlightIndentGuides",$)},E.prototype.setShowPrintMargin=function($){this.setOption("showPrintMargin",$)},E.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},E.prototype.setPrintMarginColumn=function($){this.setOption("printMarginColumn",$)},E.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},E.prototype.getShowGutter=function(){return this.getOption("showGutter")},E.prototype.setShowGutter=function($){return this.setOption("showGutter",$)},E.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},E.prototype.setFadeFoldWidgets=function($){this.setOption("fadeFoldWidgets",$)},E.prototype.setHighlightGutterLine=function($){this.setOption("highlightGutterLine",$)},E.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},E.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var $=p.createElement("div");$.className="ace_layer ace_print-margin-layer",this.$printMarginEl=p.createElement("div"),this.$printMarginEl.className="ace_print-margin",$.appendChild(this.$printMarginEl),this.content.insertBefore($,this.content.firstChild)}var M=this.$printMarginEl.style;M.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",M.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},E.prototype.getContainerElement=function(){return this.container},E.prototype.getMouseEventTarget=function(){return this.scroller},E.prototype.getTextAreaContainer=function(){return this.container},E.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var $=this.textarea.style,M=this.$composition;if(!this.$keepTextAreaAtCursor&&!M){p.translate(this.textarea,-100,0);return}var S=this.$cursorLayer.$pixelPos;if(S){M&&M.markerRange&&(S=this.$cursorLayer.getPixelPosition(M.markerRange.start,!0));var T=this.layerConfig,y=S.top,m=S.left;y-=T.offset;var L=M&&M.useTextareaForIME||A.isMobile?this.lineHeight:1;if(y<0||y>T.height-L){p.translate(this.textarea,0,0);return}var _=1,k=this.$size.height-L;if(!M)y+=this.lineHeight;else if(M.useTextareaForIME){var I=this.textarea.value;_=this.characterWidth*this.session.$getStringScreenWidth(I)[0]}else y+=this.lineHeight+2;m-=this.scrollLeft,m>this.$size.scrollerWidth-_&&(m=this.$size.scrollerWidth-_),m+=this.gutterWidth+this.margin.left,p.setStyle($,"height",L+"px"),p.setStyle($,"width",_+"px"),p.translate(this.textarea,Math.min(m,this.$size.scrollerWidth-_),Math.min(y,k))}}},E.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},E.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},E.prototype.getLastFullyVisibleRow=function(){var $=this.layerConfig,M=$.lastRow,S=this.session.documentToScreenRow(M,0)*$.lineHeight;return S-this.session.getScrollTop()>$.height-$.lineHeight?M-1:M},E.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},E.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()},E.prototype.setScrollMargin=function($,M,S,T){var y=this.scrollMargin;y.top=$|0,y.bottom=M|0,y.right=T|0,y.left=S|0,y.v=y.top+y.bottom,y.h=y.left+y.right,y.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-y.top),this.updateFull()},E.prototype.setMargin=function($,M,S,T){var y=this.margin;y.top=$|0,y.bottom=M|0,y.right=T|0,y.left=S|0,y.v=y.top+y.bottom,y.h=y.left+y.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},E.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},E.prototype.setHScrollBarAlwaysVisible=function($){this.setOption("hScrollBarAlwaysVisible",$)},E.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},E.prototype.setVScrollBarAlwaysVisible=function($){this.setOption("vScrollBarAlwaysVisible",$)},E.prototype.$updateScrollBarV=function(){var $=this.layerConfig.maxHeight,M=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&($-=(M-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>$-M&&($=this.scrollTop+M,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight($+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},E.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},E.prototype.freeze=function(){this.$frozen=!0},E.prototype.unfreeze=function(){this.$frozen=!1},E.prototype.$renderChanges=function($,M){if(this.$changes&&($|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!$&&!M){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 S=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(),S.firstRow!=this.layerConfig.firstRow&&S.firstRowScreen==this.layerConfig.firstRowScreen){var T=this.scrollTop+(S.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;T>0&&(this.scrollTop=T,$=$|this.CHANGE_SCROLL,$|=this.$computeLayerConfig()|this.$loop.clear())}S=this.layerConfig,this.$updateScrollBarV(),$&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),p.translate(this.content,-this.scrollLeft,-S.offset);var y=S.width+2*this.$padding+"px",m=S.minHeight+"px";p.setStyle(this.content.style,"width",y),p.setStyle(this.content.style,"height",m)}if($&this.CHANGE_H_SCROLL&&(p.translate(this.content,-this.scrollLeft,-S.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(S),this.$showGutter&&this.$gutterLayer.update(S),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(S),this.$markerBack.update(S),this.$markerFront.update(S),this.$cursorLayer.update(S),this.$moveTextAreaToCursor(),this._signal("afterRender",$);return}if($&this.CHANGE_SCROLL){this.$changedLines=null,$&this.CHANGE_TEXT||$&this.CHANGE_LINES?this.$textLayer.update(S):this.$textLayer.scrollLines(S),this.$showGutter&&($&this.CHANGE_GUTTER||$&this.CHANGE_LINES?this.$gutterLayer.update(S):this.$gutterLayer.scrollLines(S)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(S),this.$markerBack.update(S),this.$markerFront.update(S),this.$cursorLayer.update(S),this.$moveTextAreaToCursor(),this._signal("afterRender",$);return}$&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(S),this.$showGutter&&this.$gutterLayer.update(S),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(S)):$&this.CHANGE_LINES?((this.$updateLines()||$&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(S),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(S)):$&this.CHANGE_TEXT||$&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(S),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(S)):$&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(S),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(S)),$&this.CHANGE_CURSOR&&(this.$cursorLayer.update(S),this.$moveTextAreaToCursor()),$&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(S),$&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(S),this._signal("afterRender",$)},E.prototype.$autosize=function(){var $=this.session.getScreenLength()*this.lineHeight,M=this.$maxLines*this.lineHeight,S=Math.min(M,Math.max((this.$minLines||1)*this.lineHeight,$))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(S+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&S>this.$maxPixelHeight&&(S=this.$maxPixelHeight);var T=S<=2*this.lineHeight,y=!T&&$>M;if(S!=this.desiredHeight||this.$size.height!=this.desiredHeight||y!=this.$vScroll){y!=this.$vScroll&&(this.$vScroll=y,this.scrollBarV.setVisible(y));var m=this.container.clientWidth;this.container.style.height=S+"px",this.$updateCachedSize(!0,this.$gutterWidth,m,S),this.desiredHeight=S,this._signal("autosize")}},E.prototype.$computeLayerConfig=function(){var $=this.session,M=this.$size,S=M.height<=2*this.lineHeight,T=this.session.getScreenLength(),y=T*this.lineHeight,m=this.$getLongestLine(),L=!S&&(this.$hScrollBarAlwaysVisible||M.scrollerWidth-m-2*this.$padding<0),_=this.$horizScroll!==L;_&&(this.$horizScroll=L,this.scrollBarH.setVisible(L));var k=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var I=M.scrollerHeight+this.lineHeight,R=!this.$maxLines&&this.$scrollPastEnd?(M.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;y+=R;var D=this.scrollMargin;this.session.setScrollTop(Math.max(-D.top,Math.min(this.scrollTop,y-M.scrollerHeight+D.bottom))),this.session.setScrollLeft(Math.max(-D.left,Math.min(this.scrollLeft,m+2*this.$padding-M.scrollerWidth+D.right)));var O=!S&&(this.$vScrollBarAlwaysVisible||M.scrollerHeight-y+R<0||this.scrollTop>D.top),N=k!==O;N&&(this.$vScroll=O,this.scrollBarV.setVisible(O));var P=this.scrollTop%this.lineHeight,H=Math.ceil(I/this.lineHeight)-1,F=Math.max(0,Math.round((this.scrollTop-P)/this.lineHeight)),U=F+H,j,J,z=this.lineHeight;F=$.screenToDocumentRow(F,0);var X=$.getFoldLine(F);X&&(F=X.start.row),j=$.documentToScreenRow(F,0),J=$.getRowLength(F)*z,U=Math.min($.screenToDocumentRow(U,0),$.getLength()-1),I=M.scrollerHeight+$.getRowLength(U)*z+J,P=this.scrollTop-j*z;var ee=0;return(this.layerConfig.width!=m||_)&&(ee=this.CHANGE_H_SCROLL),(_||N)&&(ee|=this.$updateCachedSize(!0,this.gutterWidth,M.width,M.height),this._signal("scrollbarVisibilityChanged"),N&&(m=this.$getLongestLine())),this.layerConfig={width:m,padding:this.$padding,firstRow:F,firstRowScreen:j,lastRow:U,lineHeight:z,characterWidth:this.characterWidth,minHeight:I,maxHeight:y,offset:P,gutterOffset:z?Math.max(0,Math.ceil((P+M.height-M.scrollerHeight)/z)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(m-this.$padding),ee},E.prototype.$updateLines=function(){if(this.$changedLines){var $=this.$changedLines.firstRow,M=this.$changedLines.lastRow;this.$changedLines=null;var S=this.layerConfig;if(!($>S.lastRow+1)&&!(Mthis.$textLayer.MAX_LINE_LENGTH&&($=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round($*this.characterWidth))},E.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},E.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},E.prototype.addGutterDecoration=function($,M){this.$gutterLayer.addGutterDecoration($,M)},E.prototype.removeGutterDecoration=function($,M){this.$gutterLayer.removeGutterDecoration($,M)},E.prototype.updateBreakpoints=function($){this._rows=$,this.$loop.schedule(this.CHANGE_GUTTER)},E.prototype.setAnnotations=function($){this.$gutterLayer.setAnnotations($),this.$loop.schedule(this.CHANGE_GUTTER)},E.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},E.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},E.prototype.showCursor=function(){this.$cursorLayer.showCursor()},E.prototype.scrollSelectionIntoView=function($,M,S){this.scrollCursorIntoView($,S),this.scrollCursorIntoView(M,S)},E.prototype.scrollCursorIntoView=function($,M,S){if(this.$size.scrollerHeight!==0){var T=this.$cursorLayer.getPixelPosition($),y=T.left,m=T.top,L=S&&S.top||0,_=S&&S.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var k=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;k+L>m?(M&&k+L>m+this.lineHeight&&(m-=M*this.$size.scrollerHeight),m===0&&(m=-this.scrollMargin.top),this.session.setScrollTop(m)):k+this.$size.scrollerHeight-_=1-this.scrollMargin.top||M>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},E.prototype.pixelToScreenCoordinates=function($,M){var S;if(this.$hasCssTransforms){S={top:0,left:0};var T=this.$fontMetrics.transformCoordinates([$,M]);$=T[1]-this.gutterWidth-this.margin.left,M=T[0]}else S=this.scroller.getBoundingClientRect();var y=$+this.scrollLeft-S.left-this.$padding,m=y/this.characterWidth,L=Math.floor((M+this.scrollTop-S.top)/this.lineHeight),_=this.$blockCursor?Math.floor(m):Math.round(m);return{row:L,column:_,side:m-_>0?1:-1,offsetX:y}},E.prototype.screenToTextCoordinates=function($,M){var S;if(this.$hasCssTransforms){S={top:0,left:0};var T=this.$fontMetrics.transformCoordinates([$,M]);$=T[1]-this.gutterWidth-this.margin.left,M=T[0]}else S=this.scroller.getBoundingClientRect();var y=$+this.scrollLeft-S.left-this.$padding,m=y/this.characterWidth,L=this.$blockCursor?Math.floor(m):Math.round(m),_=Math.floor((M+this.scrollTop-S.top)/this.lineHeight);return this.session.screenToDocumentPosition(_,Math.max(L,0),y)},E.prototype.textToScreenCoordinates=function($,M){var S=this.scroller.getBoundingClientRect(),T=this.session.documentToScreenPosition($,M),y=this.$padding+(this.session.$bidiHandler.isBidiRow(T.row,$)?this.session.$bidiHandler.getPosLeft(T.column):Math.round(T.column*this.characterWidth)),m=T.row*this.lineHeight;return{pageX:S.left+y-this.scrollLeft,pageY:S.top+m-this.scrollTop}},E.prototype.visualizeFocus=function(){p.addCssClass(this.container,"ace_focus")},E.prototype.visualizeBlur=function(){p.removeCssClass(this.container,"ace_focus")},E.prototype.showComposition=function($){this.$composition=$,$.cssText||($.cssText=this.textarea.style.cssText),$.useTextareaForIME==null&&($.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(p.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):$.markerId=this.session.addMarker($.markerRange,"ace_composition_marker","text")},E.prototype.setCompositionText=function($){var M=this.session.selection.cursor;this.addToken($,"composition_placeholder",M.row,M.column),this.$moveTextAreaToCursor()},E.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),p.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var $=this.session.selection.cursor;this.removeExtraToken($.row,$.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},E.prototype.setGhostText=function($,M){var S=this.session.selection.cursor,T=M||{row:S.row,column:S.column};this.removeGhostText();var y=$.split(` -`);if(this.addToken(y[0],"ghost_text",T.row,T.column),this.$ghostText={text:$,position:{row:T.row,column:T.column}},y.length>1){this.$ghostTextWidget={text:y.slice(1).join(` -`),row:T.row,column:T.column,className:"ace_ghost_text"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var m=this.$cursorLayer.getPixelPosition(T,!0),L=this.container,_=L.getBoundingClientRect().height,k=y.length*this.lineHeight,I=k<_-m.top;if(I)return;k<_?this.scrollBy(0,(y.length-1)*this.lineHeight):this.scrollBy(0,m.top)}},E.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}},E.prototype.addToken=function($,M,S,T){var y=this.session;y.bgTokenizer.lines[S]=null;var m={type:M,value:$},L=y.getTokens(S);if(T==null||!L.length)L.push(m);else for(var _=0,k=0;k1||Math.abs($.$size.height-T)>1?$.$resizeTimer.delay():$.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},E}();v.prototype.CHANGE_CURSOR=1,v.prototype.CHANGE_MARKER=2,v.prototype.CHANGE_GUTTER=4,v.prototype.CHANGE_SCROLL=8,v.prototype.CHANGE_LINES=16,v.prototype.CHANGE_TEXT=32,v.prototype.CHANGE_SIZE=64,v.prototype.CHANGE_MARKER_BACK=128,v.prototype.CHANGE_MARKER_FRONT=256,v.prototype.CHANGE_FULL=512,v.prototype.CHANGE_H_SCROLL=1024,v.prototype.$changes=0,v.prototype.$padding=null,v.prototype.$frozen=!1,v.prototype.STEPS=8,d.implement(v.prototype,C),a.defineOptions(v.prototype,"renderer",{useResizeObserver:{set:function(E){!E&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):E&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(E){this.$textLayer.setShowInvisibles(E)&&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(E){typeof E=="number"&&(this.$printMarginColumn=E),this.$showPrintMargin=!!E,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(E){this.$gutter.style.display=E?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(E){this.$gutterLayer.$useSvgGutterIcons=E},initialValue:!1},showFoldedAnnotations:{set:function(E){this.$gutterLayer.$showFoldedAnnotations=E},initialValue:!1},fadeFoldWidgets:{set:function(E){p.setCssClass(this.$gutter,"ace_fade-fold-widgets",E)},initialValue:!1},showFoldWidgets:{set:function(E){this.$gutterLayer.setShowFoldWidgets(E),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(E){this.$textLayer.setDisplayIndentGuides(E)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(E){this.$textLayer.setHighlightIndentGuides(E)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(E){this.$gutterLayer.setHighlightGutterLine(E),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(E){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(E){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(E){typeof E=="number"&&(E=E+"px"),this.container.style.fontSize=E,this.updateFontSize()},initialValue:12},fontFamily:{set:function(E){this.container.style.fontFamily=E,this.updateFontSize()}},maxLines:{set:function(E){this.updateFull()}},minLines:{set:function(E){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(E){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(E){E=+E||0,this.$scrollPastEnd!=E&&(this.$scrollPastEnd=E,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(E){this.$gutterLayer.$fixedWidth=!!E,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(E){this.$updateCustomScrollbar(E)},initialValue:!1},theme:{set:function(E){this.setTheme(E)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!A.isMobile&&!A.isIE}}),e.VirtualRenderer=v});ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(t,e,c){"use strict";var d=t("../lib/oop"),p=t("../lib/net"),g=t("../lib/event_emitter").EventEmitter,a=t("../config");function u(i){var s="importScripts('"+p.qualifyURL(i)+"');";try{return new Blob([s],{type:"application/javascript"})}catch{var l=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,h=new l;return h.append(s),h.getBlob("application/javascript")}}function o(i){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(a.get("loadWorkerFromBlob")){var s=u(i),l=window.URL||window.webkitURL,h=l.createObjectURL(s);return new Worker(h)}return new Worker(i)}var r=function(i){i.postMessage||(i=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=i,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(){d.implement(this,g),this.$createWorkerFromOldConfig=function(i,s,l,h,f){if(t.nameToUrl&&!t.toUrl&&(t.toUrl=t.nameToUrl),a.get("packaged")||!t.toUrl)h=h||a.moduleUrl(s,"worker");else{var b=this.$normalizePath;h=h||b(t.toUrl("ace/worker/worker.js",null,"_"));var C={};i.forEach(function(w){C[w]=b(t.toUrl(w,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=o(h),f&&this.send("importScripts",f),this.$worker.postMessage({init:!0,tlns:C,module:s,classname:l}),this.$worker},this.onMessage=function(i){var s=i.data;switch(s.type){case"event":this._signal(s.name,{data:s.data});break;case"call":var l=this.callbacks[s.id];l&&(l(s.data),delete this.callbacks[s.id]);break;case"error":this.reportError(s.data);break;case"log":window.console&&console.log&&console.log.apply(console,s.data);break}},this.reportError=function(i){window.console&&console.error&&console.error(i)},this.$normalizePath=function(i){return p.qualifyURL(i)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(i){i.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(i,s){this.$worker.postMessage({command:i,args:s})},this.call=function(i,s,l){if(l){var h=this.callbackId++;this.callbacks[h]=l,s.push(h)}this.send(i,s)},this.emit=function(i,s){try{s.data&&s.data.err&&(s.data.err={message:s.data.err.message,stack:s.data.err.stack,code:s.data.err.code}),this.$worker&&this.$worker.postMessage({event:i,data:{data:s.data}})}catch(l){console.error(l.stack)}},this.attachToDocument=function(i){this.$doc&&this.terminate(),this.$doc=i,this.call("setValue",[i.getValue()]),i.on("change",this.changeListener,!0)},this.changeListener=function(i){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),i.action=="insert"?this.deltaQueue.push(i.start,i.lines):this.deltaQueue.push(i.start,i.end)},this.$sendDeltaQueue=function(){var i=this.deltaQueue;i&&(this.deltaQueue=null,i.length>50&&i.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:i}))}}).call(r.prototype);var n=function(i,s,l){var h=null,f=!1,b=Object.create(g),C=[],w=new r({messageBuffer:C,terminate:function(){},postMessage:function(A){C.push(A),h&&(f?setTimeout(x):x())}});w.setEmitSync=function(A){f=A};var x=function(){var A=C.shift();A.command?h[A.command].apply(h,A.args):A.event&&b._signal(A.event,A.data)};return b.postMessage=function(A){w.onMessage({data:A})},b.callback=function(A,v){this.postMessage({type:"call",id:v,data:A})},b.emit=function(A,v){this.postMessage({type:"event",name:A,data:v})},a.loadModule(["worker",s],function(A){for(h=new A[l](b);C.length;)x()}),w};e.UIWorkerClient=n,e.WorkerClient=r,e.createWorker=o});ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,e,c){"use strict";var d=t("./range").Range,p=t("./lib/event_emitter").EventEmitter,g=t("./lib/oop"),a=function(){function u(o,r,n,i,s,l){var h=this;this.length=r,this.session=o,this.doc=o.getDocument(),this.mainClass=s,this.othersClass=l,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=i,this.$onCursorChange=function(){setTimeout(function(){h.onCursorChange()})},this.$pos=n;var f=o.getUndoManager().$undoStack||o.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=f.length,this.setup(),o.selection.on("changeCursor",this.$onCursorChange)}return u.prototype.setup=function(){var o=this,r=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=r.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new d(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(s){var l=r.createAnchor(s.row,s.column);l.$insertRight=!0,l.detach(),o.others.push(l)}),n.setUndoSelect(!1)},u.prototype.showOtherMarkers=function(){if(!this.othersActive){var o=this.session,r=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=o.addMarker(new d(n.row,n.column,n.row,n.column+r.length),r.othersClass,null,!1)})}},u.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var o=0;o=this.pos.column&&r.start.column<=this.pos.column+this.length+1,s=r.start.column-this.pos.column;if(this.updateAnchors(o),i&&(this.length+=n),i&&!this.session.$fromUndo){if(o.action==="insert")for(var l=this.others.length-1;l>=0;l--){var h=this.others[l],f={row:h.row,column:h.column+s};this.doc.insertMergedLines(f,o.lines)}else if(o.action==="remove")for(var l=this.others.length-1;l>=0;l--){var h=this.others[l],f={row:h.row,column:h.column+s};this.doc.remove(new d(f.row,f.column,f.row,f.column-n))}}this.$updating=!1,this.updateMarkers()}},u.prototype.updateAnchors=function(o){this.pos.onChange(o);for(var r=this.others.length;r--;)this.others[r].onChange(o);this.updateMarkers()},u.prototype.updateMarkers=function(){if(!this.$updating){var o=this,r=this.session,n=function(s,l){r.removeMarker(s.markerId),s.markerId=r.addMarker(new d(s.row,s.column,s.row,s.column+o.length),l,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},u.prototype.onCursorChange=function(o){if(!(this.$updating||!this.session)){var r=this.session.selection.getCursor();r.row===this.pos.row&&r.column>=this.pos.column&&r.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",o)):(this.hideOtherMarkers(),this._emit("cursorLeave",o))}},u.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},u.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var o=this.session.getUndoManager(),r=(o.$undoStack||o.$undostack).length-this.$undoStackDepth,n=0;n1?p.multiSelect.joinSelections():p.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(p){p.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(p){p.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(p){p.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],e.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(p){p.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(p){return p&&p.inMultiSelectMode}}];var d=t("../keyboard/hash_handler").HashHandler;e.keyboardHandler=new d(e.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,e,c){var d=t("./range_list").RangeList,p=t("./range").Range,g=t("./selection").Selection,a=t("./mouse/multi_select_handler").onMouseDown,u=t("./lib/event"),o=t("./lib/lang"),r=t("./commands/multi_select_commands");e.commands=r.defaultCommands.concat(r.multiSelectCommands);var n=t("./search").Search,i=new n;function s(w,x,A){return i.$options.wrap=!0,i.$options.needle=x,i.$options.backwards=A==-1,i.find(w)}var l=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(l.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(w,x){if(w){if(!this.inMultiSelectMode&&this.rangeCount===0){var A=this.toOrientedRange();if(this.rangeList.add(A),this.rangeList.add(w),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),x||this.fromOrientedRange(w);this.rangeList.removeAll(),this.rangeList.add(A),this.$onAddRange(A)}w.cursor||(w.cursor=w.end);var v=this.rangeList.add(w);return this.$onAddRange(w),v.length&&this.$onRemoveRange(v),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),x||this.fromOrientedRange(w)}},this.toSingleRange=function(w){w=w||this.ranges[0];var x=this.rangeList.removeAll();x.length&&this.$onRemoveRange(x),w&&this.fromOrientedRange(w)},this.substractPoint=function(w){var x=this.rangeList.substractPoint(w);if(x)return this.$onRemoveRange(x),x[0]},this.mergeOverlappingRanges=function(){var w=this.rangeList.merge();w.length&&this.$onRemoveRange(w)},this.$onAddRange=function(w){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(w),this._signal("addRange",{range:w})},this.$onRemoveRange=function(w){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var x=this.rangeList.ranges.pop();w.push(x),this.rangeCount=0}for(var A=w.length;A--;){var v=this.ranges.indexOf(w[A]);this.ranges.splice(v,1)}this._signal("removeRange",{ranges:w}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),x=x||this.ranges[0],x&&!x.isEqual(this.getRange())&&this.fromOrientedRange(x)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new d,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var w=this.ranges.length?this.ranges:[this.getRange()],x=[],A=0;A1){var w=this.rangeList.ranges,x=w[w.length-1],A=p.fromPoints(w[0].start,x.end);this.toSingleRange(),this.setSelectionRange(A,x.cursor==x.start)}else{var v=this.session.documentToScreenPosition(this.cursor),E=this.session.documentToScreenPosition(this.anchor),$=this.rectangularRangeBlock(v,E);$.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(w,x,A){var v=[],E=w.column0;)R--;if(R>0)for(var D=0;v[D].isEmpty();)D++;for(var O=R;O>=D;O--)v[O].isEmpty()&&v.splice(O,1)}return v}}.call(g.prototype);var h=t("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(w){w.cursor||(w.cursor=w.end);var x=this.getSelectionStyle();return w.marker=this.session.addMarker(w,"ace_selection",x),this.session.$selectionMarkers.push(w),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,w},this.removeSelectionMarker=function(w){if(w.marker){this.session.removeMarker(w.marker);var x=this.session.$selectionMarkers.indexOf(w);x!=-1&&this.session.$selectionMarkers.splice(x,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(w){for(var x=this.session.$selectionMarkers,A=w.length;A--;){var v=w[A];if(v.marker){this.session.removeMarker(v.marker);var E=x.indexOf(v);E!=-1&&x.splice(E,1)}}this.session.selectionMarkerCount=x.length},this.$onAddRange=function(w){this.addSelectionMarker(w.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(w){this.removeSelectionMarkers(w.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(w){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(r.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(w){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(r.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(w){var x=w.command,A=w.editor;if(A.multiSelect){if(x.multiSelectAction)x.multiSelectAction=="forEach"?v=A.forEachSelection(x,w.args):x.multiSelectAction=="forEachLine"?v=A.forEachSelection(x,w.args,!0):x.multiSelectAction=="single"?(A.exitMultiSelectMode(),v=x.exec(A,w.args||{})):v=x.multiSelectAction(A,w.args||{});else{var v=x.exec(A,w.args||{});A.multiSelect.addRange(A.multiSelect.toOrientedRange()),A.multiSelect.mergeOverlappingRanges()}return v}},this.forEachSelection=function(w,x,A){if(!this.inVirtualSelectionMode){var v=A&&A.keepOrder,E=A==!0||A&&A.$byLines,$=this.session,M=this.selection,S=M.rangeList,T=(v?M:S).ranges,y;if(!T.length)return w.exec?w.exec(this,x||{}):w(this,x||{});var m=M._eventRegistry;M._eventRegistry={};var L=new g($);this.inVirtualSelectionMode=!0;for(var _=T.length;_--;){if(E)for(;_>0&&T[_].start.row==T[_-1].end.row;)_--;L.fromOrientedRange(T[_]),L.index=_,this.selection=$.selection=L;var k=w.exec?w.exec(this,x||{}):w(this,x||{});!y&&k!==void 0&&(y=k),L.toOrientedRange(T[_])}L.detach(),this.selection=$.selection=M,this.inVirtualSelectionMode=!1,M._eventRegistry=m,M.mergeOverlappingRanges(),M.ranges[0]&&M.fromOrientedRange(M.ranges[0]);var I=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),I&&I.from==I.to&&this.renderer.animateScrolling(I.from),y}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var w="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var x=this.multiSelect.rangeList.ranges,A=[],v=0;v0);M<0&&(M=0),S>=y&&(S=y-1)}var L=this.session.removeFullLines(M,S);L=this.$reAlignText(L,T),this.session.insert({row:M,column:0},L.join(` +}`});ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(t,e,c){"use strict";var d=t("../lib/dom"),p=t("../lib/oop"),g=t("../lib/event_emitter").EventEmitter,a=function(){function u(o,r){this.canvas=d.createElement("canvas"),this.renderer=r,this.pixelRatio=1,this.maxHeight=r.layerConfig.maxHeight,this.lineHeight=r.layerConfig.lineHeight,this.canvasHeight=o.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=o.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)"},o.element.appendChild(this.canvas)}return u.prototype.$updateDecorators=function(o){var r=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(o){this.maxHeight=o.maxHeight,this.lineHeight=o.lineHeight,this.canvasHeight=o.height;var n=(o.lastRow+1)*this.lineHeight;nS.priority?1:0}var l=this.renderer.session.$annotations;if(i.clearRect(0,0,this.canvas.width,this.canvas.height),l){var h={info:1,warning:2,error:3};l.forEach(function(E){E.priority=h[E.type]||null}),l=l.sort(s);for(var f=this.renderer.session.$foldData,b=0;bthis.canvasHeight&&(L=this.canvasHeight-this.halfMinDecorationHeight),_=Math.round(L-this.halfMinDecorationHeight),v=Math.round(L+this.halfMinDecorationHeight)}i.fillStyle=r[l[b].type]||null,i.fillRect(0,x,this.canvasWidth,v-_)}}var M=this.renderer.session.selection.getCursor();if(M){var w=this.compensateFoldRows(M.row,f),x=Math.round((M.row-w)*this.lineHeight*this.heightRatio);i.fillStyle="rgba(0, 0, 0, 0.5)",i.fillRect(0,x,this.canvasWidth,2)}},u.prototype.compensateFoldRows=function(o,r){var n=0;if(r&&r.length>0)for(var i=0;ir[i].start.row&&o=r[i].end.row&&(n+=r[i].end.row-r[i].start.row);return n},u}();p.implement(a.prototype,g),e.Decorator=a});ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent"],function(t,e,c){"use strict";var d=t("./lib/oop"),p=t("./lib/dom"),g=t("./lib/lang"),a=t("./config"),u=t("./layer/gutter").Gutter,o=t("./layer/marker").Marker,r=t("./layer/text").Text,n=t("./layer/cursor").Cursor,i=t("./scrollbar").HScrollBar,s=t("./scrollbar").VScrollBar,l=t("./scrollbar_custom").HScrollBar,h=t("./scrollbar_custom").VScrollBar,f=t("./renderloop").RenderLoop,b=t("./layer/font_metrics").FontMetrics,C=t("./lib/event_emitter").EventEmitter,w=t("./css/editor-css"),x=t("./layer/decorators").Decorator,_=t("./lib/useragent");p.importCssString(w,"ace_editor.css",!1);var v=function(){function T(L,M){var E=this;this.container=L||p.createElement("div"),p.addCssClass(this.container,"ace_editor"),p.HI_DPI&&p.addCssClass(this.container,"ace_hidpi"),this.setTheme(M),a.get("useStrictCSP")==null&&a.set("useStrictCSP",!1),this.$gutter=p.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=p.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=p.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new u(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new o(this.content);var S=this.$textLayer=new r(this.content);this.canvas=S.element,this.$markerFront=new o(this.content),this.$cursorLayer=new n(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new s(this.container,this),this.scrollBarH=new i(this.container,this),this.scrollBarV.on("scroll",function(y){E.$scrollAnimation||E.session.setScrollTop(y.data-E.scrollMargin.top)}),this.scrollBarH.on("scroll",function(y){E.$scrollAnimation||E.session.setScrollLeft(y.data-E.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(y){E.updateCharacterSize(),E.onResize(!0,E.gutterWidth,E.$size.width,E.$size.height),E._signal("changeCharacterSize",y)}),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=!_.isIOS,this.$loop=new f(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),a.resetOptions(this),a._signal("renderer",this)}return T.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),p.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},T.prototype.setSession=function(L){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=L,L&&this.scrollMargin.top&&L.getScrollTop()<=0&&L.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(L),this.$markerBack.setSession(L),this.$markerFront.setSession(L),this.$gutterLayer.setSession(L),this.$textLayer.setSession(L),L&&(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))},T.prototype.updateLines=function(L,M,E){if(M===void 0&&(M=1/0),this.$changedLines?(this.$changedLines.firstRow>L&&(this.$changedLines.firstRow=L),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},T.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},T.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},T.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},T.prototype.updateFull=function(L){L?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},T.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},T.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},T.prototype.onResize=function(L,M,E,S){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=L?1:0;var y=this.container;S||(S=y.clientHeight||y.scrollHeight),E||(E=y.clientWidth||y.scrollWidth);var m=this.$updateCachedSize(L,M,E,S);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!E&&!S)return this.resizing=0;L&&(this.$gutterLayer.$padding=null),L?this.$renderChanges(m|this.$changes,!0):this.$loop.schedule(m|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},T.prototype.$updateCachedSize=function(L,M,E,S){S-=this.$extraHeight||0;var y=0,m=this.$size,$={width:m.width,height:m.height,scrollerHeight:m.scrollerHeight,scrollerWidth:m.scrollerWidth};if(S&&(L||m.height!=S)&&(m.height=S,y|=this.CHANGE_SIZE,m.scrollerHeight=m.height,this.$horizScroll&&(m.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(m.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",y=y|this.CHANGE_SCROLL),E&&(L||m.width!=E)){y|=this.CHANGE_SIZE,m.width=E,M==null&&(M=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=M,p.setStyle(this.scrollBarH.element.style,"left",M+"px"),p.setStyle(this.scroller.style,"left",M+this.margin.left+"px"),m.scrollerWidth=Math.max(0,E-M-this.scrollBarV.getWidth()-this.margin.h),p.setStyle(this.$gutter.style,"left",this.margin.left+"px");var A=this.scrollBarV.getWidth()+"px";p.setStyle(this.scrollBarH.element.style,"right",A),p.setStyle(this.scroller.style,"right",A),p.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(m.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||L)&&(y|=this.CHANGE_FULL)}return m.$dirty=!E||!S,y&&this._signal("resize",$),y},T.prototype.onGutterResize=function(L){var M=this.$showGutter?L:0;M!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,M,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()},T.prototype.adjustWrapLimit=function(){var L=this.$size.scrollerWidth-this.$padding*2,M=Math.floor(L/this.characterWidth);return this.session.adjustWrapLimit(M,this.$showPrintMargin&&this.$printMarginColumn)},T.prototype.setAnimatedScroll=function(L){this.setOption("animatedScroll",L)},T.prototype.getAnimatedScroll=function(){return this.$animatedScroll},T.prototype.setShowInvisibles=function(L){this.setOption("showInvisibles",L),this.session.$bidiHandler.setShowInvisibles(L)},T.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},T.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},T.prototype.setDisplayIndentGuides=function(L){this.setOption("displayIndentGuides",L)},T.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},T.prototype.setHighlightIndentGuides=function(L){this.setOption("highlightIndentGuides",L)},T.prototype.setShowPrintMargin=function(L){this.setOption("showPrintMargin",L)},T.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},T.prototype.setPrintMarginColumn=function(L){this.setOption("printMarginColumn",L)},T.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},T.prototype.getShowGutter=function(){return this.getOption("showGutter")},T.prototype.setShowGutter=function(L){return this.setOption("showGutter",L)},T.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},T.prototype.setFadeFoldWidgets=function(L){this.setOption("fadeFoldWidgets",L)},T.prototype.setHighlightGutterLine=function(L){this.setOption("highlightGutterLine",L)},T.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},T.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var L=p.createElement("div");L.className="ace_layer ace_print-margin-layer",this.$printMarginEl=p.createElement("div"),this.$printMarginEl.className="ace_print-margin",L.appendChild(this.$printMarginEl),this.content.insertBefore(L,this.content.firstChild)}var M=this.$printMarginEl.style;M.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",M.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},T.prototype.getContainerElement=function(){return this.container},T.prototype.getMouseEventTarget=function(){return this.scroller},T.prototype.getTextAreaContainer=function(){return this.container},T.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var L=this.textarea.style,M=this.$composition;if(!this.$keepTextAreaAtCursor&&!M){p.translate(this.textarea,-100,0);return}var E=this.$cursorLayer.$pixelPos;if(E){M&&M.markerRange&&(E=this.$cursorLayer.getPixelPosition(M.markerRange.start,!0));var S=this.layerConfig,y=E.top,m=E.left;y-=S.offset;var $=M&&M.useTextareaForIME||_.isMobile?this.lineHeight:1;if(y<0||y>S.height-$){p.translate(this.textarea,0,0);return}var A=1,k=this.$size.height-$;if(!M)y+=this.lineHeight;else if(M.useTextareaForIME){var R=this.textarea.value;A=this.characterWidth*this.session.$getStringScreenWidth(R)[0]}else y+=this.lineHeight+2;m-=this.scrollLeft,m>this.$size.scrollerWidth-A&&(m=this.$size.scrollerWidth-A),m+=this.gutterWidth+this.margin.left,p.setStyle(L,"height",$+"px"),p.setStyle(L,"width",A+"px"),p.translate(this.textarea,Math.min(m,this.$size.scrollerWidth-A),Math.min(y,k))}}},T.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},T.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},T.prototype.getLastFullyVisibleRow=function(){var L=this.layerConfig,M=L.lastRow,E=this.session.documentToScreenRow(M,0)*L.lineHeight;return E-this.session.getScrollTop()>L.height-L.lineHeight?M-1:M},T.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},T.prototype.setPadding=function(L){this.$padding=L,this.$textLayer.setPadding(L),this.$cursorLayer.setPadding(L),this.$markerFront.setPadding(L),this.$markerBack.setPadding(L),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},T.prototype.setScrollMargin=function(L,M,E,S){var y=this.scrollMargin;y.top=L|0,y.bottom=M|0,y.right=S|0,y.left=E|0,y.v=y.top+y.bottom,y.h=y.left+y.right,y.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-y.top),this.updateFull()},T.prototype.setMargin=function(L,M,E,S){var y=this.margin;y.top=L|0,y.bottom=M|0,y.right=S|0,y.left=E|0,y.v=y.top+y.bottom,y.h=y.left+y.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},T.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},T.prototype.setHScrollBarAlwaysVisible=function(L){this.setOption("hScrollBarAlwaysVisible",L)},T.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},T.prototype.setVScrollBarAlwaysVisible=function(L){this.setOption("vScrollBarAlwaysVisible",L)},T.prototype.$updateScrollBarV=function(){var L=this.layerConfig.maxHeight,M=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(L-=(M-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>L-M&&(L=this.scrollTop+M,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(L+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},T.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},T.prototype.freeze=function(){this.$frozen=!0},T.prototype.unfreeze=function(){this.$frozen=!1},T.prototype.$renderChanges=function(L,M){if(this.$changes&&(L|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!L&&!M){this.$changes|=L;return}if(this.$size.$dirty)return this.$changes|=L,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",L),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var E=this.layerConfig;if(L&this.CHANGE_FULL||L&this.CHANGE_SIZE||L&this.CHANGE_TEXT||L&this.CHANGE_LINES||L&this.CHANGE_SCROLL||L&this.CHANGE_H_SCROLL){if(L|=this.$computeLayerConfig()|this.$loop.clear(),E.firstRow!=this.layerConfig.firstRow&&E.firstRowScreen==this.layerConfig.firstRowScreen){var S=this.scrollTop+(E.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;S>0&&(this.scrollTop=S,L=L|this.CHANGE_SCROLL,L|=this.$computeLayerConfig()|this.$loop.clear())}E=this.layerConfig,this.$updateScrollBarV(),L&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),p.translate(this.content,-this.scrollLeft,-E.offset);var y=E.width+2*this.$padding+"px",m=E.minHeight+"px";p.setStyle(this.content.style,"width",y),p.setStyle(this.content.style,"height",m)}if(L&this.CHANGE_H_SCROLL&&(p.translate(this.content,-this.scrollLeft,-E.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),L&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(E),this.$showGutter&&this.$gutterLayer.update(E),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(E),this.$markerBack.update(E),this.$markerFront.update(E),this.$cursorLayer.update(E),this.$moveTextAreaToCursor(),this._signal("afterRender",L);return}if(L&this.CHANGE_SCROLL){this.$changedLines=null,L&this.CHANGE_TEXT||L&this.CHANGE_LINES?this.$textLayer.update(E):this.$textLayer.scrollLines(E),this.$showGutter&&(L&this.CHANGE_GUTTER||L&this.CHANGE_LINES?this.$gutterLayer.update(E):this.$gutterLayer.scrollLines(E)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(E),this.$markerBack.update(E),this.$markerFront.update(E),this.$cursorLayer.update(E),this.$moveTextAreaToCursor(),this._signal("afterRender",L);return}L&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(E),this.$showGutter&&this.$gutterLayer.update(E),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(E)):L&this.CHANGE_LINES?((this.$updateLines()||L&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(E),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(E)):L&this.CHANGE_TEXT||L&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(E),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(E)):L&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(E),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(E)),L&this.CHANGE_CURSOR&&(this.$cursorLayer.update(E),this.$moveTextAreaToCursor()),L&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(E),L&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(E),this._signal("afterRender",L)},T.prototype.$autosize=function(){var L=this.session.getScreenLength()*this.lineHeight,M=this.$maxLines*this.lineHeight,E=Math.min(M,Math.max((this.$minLines||1)*this.lineHeight,L))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(E+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&E>this.$maxPixelHeight&&(E=this.$maxPixelHeight);var S=E<=2*this.lineHeight,y=!S&&L>M;if(E!=this.desiredHeight||this.$size.height!=this.desiredHeight||y!=this.$vScroll){y!=this.$vScroll&&(this.$vScroll=y,this.scrollBarV.setVisible(y));var m=this.container.clientWidth;this.container.style.height=E+"px",this.$updateCachedSize(!0,this.$gutterWidth,m,E),this.desiredHeight=E,this._signal("autosize")}},T.prototype.$computeLayerConfig=function(){var L=this.session,M=this.$size,E=M.height<=2*this.lineHeight,S=this.session.getScreenLength(),y=S*this.lineHeight,m=this.$getLongestLine(),$=!E&&(this.$hScrollBarAlwaysVisible||M.scrollerWidth-m-2*this.$padding<0),A=this.$horizScroll!==$;A&&(this.$horizScroll=$,this.scrollBarH.setVisible($));var k=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var R=M.scrollerHeight+this.lineHeight,I=!this.$maxLines&&this.$scrollPastEnd?(M.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;y+=I;var D=this.scrollMargin;this.session.setScrollTop(Math.max(-D.top,Math.min(this.scrollTop,y-M.scrollerHeight+D.bottom))),this.session.setScrollLeft(Math.max(-D.left,Math.min(this.scrollLeft,m+2*this.$padding-M.scrollerWidth+D.right)));var O=!E&&(this.$vScrollBarAlwaysVisible||M.scrollerHeight-y+I<0||this.scrollTop>D.top),N=k!==O;N&&(this.$vScroll=O,this.scrollBarV.setVisible(O));var P=this.scrollTop%this.lineHeight,B=Math.ceil(R/this.lineHeight)-1,H=Math.max(0,Math.round((this.scrollTop-P)/this.lineHeight)),V=H+B,z,Z,K=this.lineHeight;H=L.screenToDocumentRow(H,0);var q=L.getFoldLine(H);q&&(H=q.start.row),z=L.documentToScreenRow(H,0),Z=L.getRowLength(H)*K,V=Math.min(L.screenToDocumentRow(V,0),L.getLength()-1),R=M.scrollerHeight+L.getRowLength(V)*K+Z,P=this.scrollTop-z*K;var oe=0;return(this.layerConfig.width!=m||A)&&(oe=this.CHANGE_H_SCROLL),(A||N)&&(oe|=this.$updateCachedSize(!0,this.gutterWidth,M.width,M.height),this._signal("scrollbarVisibilityChanged"),N&&(m=this.$getLongestLine())),this.layerConfig={width:m,padding:this.$padding,firstRow:H,firstRowScreen:z,lastRow:V,lineHeight:K,characterWidth:this.characterWidth,minHeight:R,maxHeight:y,offset:P,gutterOffset:K?Math.max(0,Math.ceil((P+M.height-M.scrollerHeight)/K)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(m-this.$padding),oe},T.prototype.$updateLines=function(){if(this.$changedLines){var L=this.$changedLines.firstRow,M=this.$changedLines.lastRow;this.$changedLines=null;var E=this.layerConfig;if(!(L>E.lastRow+1)&&!(Mthis.$textLayer.MAX_LINE_LENGTH&&(L=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(L*this.characterWidth))},T.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},T.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},T.prototype.addGutterDecoration=function(L,M){this.$gutterLayer.addGutterDecoration(L,M)},T.prototype.removeGutterDecoration=function(L,M){this.$gutterLayer.removeGutterDecoration(L,M)},T.prototype.updateBreakpoints=function(L){this._rows=L,this.$loop.schedule(this.CHANGE_GUTTER)},T.prototype.setAnnotations=function(L){this.$gutterLayer.setAnnotations(L),this.$loop.schedule(this.CHANGE_GUTTER)},T.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},T.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},T.prototype.showCursor=function(){this.$cursorLayer.showCursor()},T.prototype.scrollSelectionIntoView=function(L,M,E){this.scrollCursorIntoView(L,E),this.scrollCursorIntoView(M,E)},T.prototype.scrollCursorIntoView=function(L,M,E){if(this.$size.scrollerHeight!==0){var S=this.$cursorLayer.getPixelPosition(L),y=S.left,m=S.top,$=E&&E.top||0,A=E&&E.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var k=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;k+$>m?(M&&k+$>m+this.lineHeight&&(m-=M*this.$size.scrollerHeight),m===0&&(m=-this.scrollMargin.top),this.session.setScrollTop(m)):k+this.$size.scrollerHeight-A=1-this.scrollMargin.top||M>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||L<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||L>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},T.prototype.pixelToScreenCoordinates=function(L,M){var E;if(this.$hasCssTransforms){E={top:0,left:0};var S=this.$fontMetrics.transformCoordinates([L,M]);L=S[1]-this.gutterWidth-this.margin.left,M=S[0]}else E=this.scroller.getBoundingClientRect();var y=L+this.scrollLeft-E.left-this.$padding,m=y/this.characterWidth,$=Math.floor((M+this.scrollTop-E.top)/this.lineHeight),A=this.$blockCursor?Math.floor(m):Math.round(m);return{row:$,column:A,side:m-A>0?1:-1,offsetX:y}},T.prototype.screenToTextCoordinates=function(L,M){var E;if(this.$hasCssTransforms){E={top:0,left:0};var S=this.$fontMetrics.transformCoordinates([L,M]);L=S[1]-this.gutterWidth-this.margin.left,M=S[0]}else E=this.scroller.getBoundingClientRect();var y=L+this.scrollLeft-E.left-this.$padding,m=y/this.characterWidth,$=this.$blockCursor?Math.floor(m):Math.round(m),A=Math.floor((M+this.scrollTop-E.top)/this.lineHeight);return this.session.screenToDocumentPosition(A,Math.max($,0),y)},T.prototype.textToScreenCoordinates=function(L,M){var E=this.scroller.getBoundingClientRect(),S=this.session.documentToScreenPosition(L,M),y=this.$padding+(this.session.$bidiHandler.isBidiRow(S.row,L)?this.session.$bidiHandler.getPosLeft(S.column):Math.round(S.column*this.characterWidth)),m=S.row*this.lineHeight;return{pageX:E.left+y-this.scrollLeft,pageY:E.top+m-this.scrollTop}},T.prototype.visualizeFocus=function(){p.addCssClass(this.container,"ace_focus")},T.prototype.visualizeBlur=function(){p.removeCssClass(this.container,"ace_focus")},T.prototype.showComposition=function(L){this.$composition=L,L.cssText||(L.cssText=this.textarea.style.cssText),L.useTextareaForIME==null&&(L.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(p.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):L.markerId=this.session.addMarker(L.markerRange,"ace_composition_marker","text")},T.prototype.setCompositionText=function(L){var M=this.session.selection.cursor;this.addToken(L,"composition_placeholder",M.row,M.column),this.$moveTextAreaToCursor()},T.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),p.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var L=this.session.selection.cursor;this.removeExtraToken(L.row,L.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},T.prototype.setGhostText=function(L,M){var E=this.session.selection.cursor,S=M||{row:E.row,column:E.column};this.removeGhostText();var y=L.split(` +`);if(this.addToken(y[0],"ghost_text",S.row,S.column),this.$ghostText={text:L,position:{row:S.row,column:S.column}},y.length>1){this.$ghostTextWidget={text:y.slice(1).join(` +`),row:S.row,column:S.column,className:"ace_ghost_text"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var m=this.$cursorLayer.getPixelPosition(S,!0),$=this.container,A=$.getBoundingClientRect().height,k=y.length*this.lineHeight,R=k1||Math.abs(L.$size.height-S)>1?L.$resizeTimer.delay():L.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},T}();v.prototype.CHANGE_CURSOR=1,v.prototype.CHANGE_MARKER=2,v.prototype.CHANGE_GUTTER=4,v.prototype.CHANGE_SCROLL=8,v.prototype.CHANGE_LINES=16,v.prototype.CHANGE_TEXT=32,v.prototype.CHANGE_SIZE=64,v.prototype.CHANGE_MARKER_BACK=128,v.prototype.CHANGE_MARKER_FRONT=256,v.prototype.CHANGE_FULL=512,v.prototype.CHANGE_H_SCROLL=1024,v.prototype.$changes=0,v.prototype.$padding=null,v.prototype.$frozen=!1,v.prototype.STEPS=8,d.implement(v.prototype,C),a.defineOptions(v.prototype,"renderer",{useResizeObserver:{set:function(T){!T&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):T&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(T){this.$textLayer.setShowInvisibles(T)&&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(T){typeof T=="number"&&(this.$printMarginColumn=T),this.$showPrintMargin=!!T,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(T){this.$gutter.style.display=T?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(T){this.$gutterLayer.$useSvgGutterIcons=T},initialValue:!1},showFoldedAnnotations:{set:function(T){this.$gutterLayer.$showFoldedAnnotations=T},initialValue:!1},fadeFoldWidgets:{set:function(T){p.setCssClass(this.$gutter,"ace_fade-fold-widgets",T)},initialValue:!1},showFoldWidgets:{set:function(T){this.$gutterLayer.setShowFoldWidgets(T),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(T){this.$textLayer.setDisplayIndentGuides(T)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(T){this.$textLayer.setHighlightIndentGuides(T)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(T){this.$gutterLayer.setHighlightGutterLine(T),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(T){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(T){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(T){typeof T=="number"&&(T=T+"px"),this.container.style.fontSize=T,this.updateFontSize()},initialValue:12},fontFamily:{set:function(T){this.container.style.fontFamily=T,this.updateFontSize()}},maxLines:{set:function(T){this.updateFull()}},minLines:{set:function(T){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(T){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(T){T=+T||0,this.$scrollPastEnd!=T&&(this.$scrollPastEnd=T,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(T){this.$gutterLayer.$fixedWidth=!!T,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(T){this.$updateCustomScrollbar(T)},initialValue:!1},theme:{set:function(T){this.setTheme(T)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!_.isMobile&&!_.isIE}}),e.VirtualRenderer=v});ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(t,e,c){"use strict";var d=t("../lib/oop"),p=t("../lib/net"),g=t("../lib/event_emitter").EventEmitter,a=t("../config");function u(i){var s="importScripts('"+p.qualifyURL(i)+"');";try{return new Blob([s],{type:"application/javascript"})}catch{var l=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,h=new l;return h.append(s),h.getBlob("application/javascript")}}function o(i){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(a.get("loadWorkerFromBlob")){var s=u(i),l=window.URL||window.webkitURL,h=l.createObjectURL(s);return new Worker(h)}return new Worker(i)}var r=function(i){i.postMessage||(i=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=i,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(){d.implement(this,g),this.$createWorkerFromOldConfig=function(i,s,l,h,f){if(t.nameToUrl&&!t.toUrl&&(t.toUrl=t.nameToUrl),a.get("packaged")||!t.toUrl)h=h||a.moduleUrl(s,"worker");else{var b=this.$normalizePath;h=h||b(t.toUrl("ace/worker/worker.js",null,"_"));var C={};i.forEach(function(w){C[w]=b(t.toUrl(w,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=o(h),f&&this.send("importScripts",f),this.$worker.postMessage({init:!0,tlns:C,module:s,classname:l}),this.$worker},this.onMessage=function(i){var s=i.data;switch(s.type){case"event":this._signal(s.name,{data:s.data});break;case"call":var l=this.callbacks[s.id];l&&(l(s.data),delete this.callbacks[s.id]);break;case"error":this.reportError(s.data);break;case"log":window.console&&console.log&&console.log.apply(console,s.data);break}},this.reportError=function(i){window.console&&console.error&&console.error(i)},this.$normalizePath=function(i){return p.qualifyURL(i)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(i){i.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(i,s){this.$worker.postMessage({command:i,args:s})},this.call=function(i,s,l){if(l){var h=this.callbackId++;this.callbacks[h]=l,s.push(h)}this.send(i,s)},this.emit=function(i,s){try{s.data&&s.data.err&&(s.data.err={message:s.data.err.message,stack:s.data.err.stack,code:s.data.err.code}),this.$worker&&this.$worker.postMessage({event:i,data:{data:s.data}})}catch(l){console.error(l.stack)}},this.attachToDocument=function(i){this.$doc&&this.terminate(),this.$doc=i,this.call("setValue",[i.getValue()]),i.on("change",this.changeListener,!0)},this.changeListener=function(i){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),i.action=="insert"?this.deltaQueue.push(i.start,i.lines):this.deltaQueue.push(i.start,i.end)},this.$sendDeltaQueue=function(){var i=this.deltaQueue;i&&(this.deltaQueue=null,i.length>50&&i.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:i}))}}).call(r.prototype);var n=function(i,s,l){var h=null,f=!1,b=Object.create(g),C=[],w=new r({messageBuffer:C,terminate:function(){},postMessage:function(_){C.push(_),h&&(f?setTimeout(x):x())}});w.setEmitSync=function(_){f=_};var x=function(){var _=C.shift();_.command?h[_.command].apply(h,_.args):_.event&&b._signal(_.event,_.data)};return b.postMessage=function(_){w.onMessage({data:_})},b.callback=function(_,v){this.postMessage({type:"call",id:v,data:_})},b.emit=function(_,v){this.postMessage({type:"event",name:_,data:v})},a.loadModule(["worker",s],function(_){for(h=new _[l](b);C.length;)x()}),w};e.UIWorkerClient=n,e.WorkerClient=r,e.createWorker=o});ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,e,c){"use strict";var d=t("./range").Range,p=t("./lib/event_emitter").EventEmitter,g=t("./lib/oop"),a=function(){function u(o,r,n,i,s,l){var h=this;this.length=r,this.session=o,this.doc=o.getDocument(),this.mainClass=s,this.othersClass=l,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=i,this.$onCursorChange=function(){setTimeout(function(){h.onCursorChange()})},this.$pos=n;var f=o.getUndoManager().$undoStack||o.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=f.length,this.setup(),o.selection.on("changeCursor",this.$onCursorChange)}return u.prototype.setup=function(){var o=this,r=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=r.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new d(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(s){var l=r.createAnchor(s.row,s.column);l.$insertRight=!0,l.detach(),o.others.push(l)}),n.setUndoSelect(!1)},u.prototype.showOtherMarkers=function(){if(!this.othersActive){var o=this.session,r=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=o.addMarker(new d(n.row,n.column,n.row,n.column+r.length),r.othersClass,null,!1)})}},u.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var o=0;o=this.pos.column&&r.start.column<=this.pos.column+this.length+1,s=r.start.column-this.pos.column;if(this.updateAnchors(o),i&&(this.length+=n),i&&!this.session.$fromUndo){if(o.action==="insert")for(var l=this.others.length-1;l>=0;l--){var h=this.others[l],f={row:h.row,column:h.column+s};this.doc.insertMergedLines(f,o.lines)}else if(o.action==="remove")for(var l=this.others.length-1;l>=0;l--){var h=this.others[l],f={row:h.row,column:h.column+s};this.doc.remove(new d(f.row,f.column,f.row,f.column-n))}}this.$updating=!1,this.updateMarkers()}},u.prototype.updateAnchors=function(o){this.pos.onChange(o);for(var r=this.others.length;r--;)this.others[r].onChange(o);this.updateMarkers()},u.prototype.updateMarkers=function(){if(!this.$updating){var o=this,r=this.session,n=function(s,l){r.removeMarker(s.markerId),s.markerId=r.addMarker(new d(s.row,s.column,s.row,s.column+o.length),l,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},u.prototype.onCursorChange=function(o){if(!(this.$updating||!this.session)){var r=this.session.selection.getCursor();r.row===this.pos.row&&r.column>=this.pos.column&&r.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",o)):(this.hideOtherMarkers(),this._emit("cursorLeave",o))}},u.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},u.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var o=this.session.getUndoManager(),r=(o.$undoStack||o.$undostack).length-this.$undoStackDepth,n=0;n1?p.multiSelect.joinSelections():p.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(p){p.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(p){p.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(p){p.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],e.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(p){p.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(p){return p&&p.inMultiSelectMode}}];var d=t("../keyboard/hash_handler").HashHandler;e.keyboardHandler=new d(e.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,e,c){var d=t("./range_list").RangeList,p=t("./range").Range,g=t("./selection").Selection,a=t("./mouse/multi_select_handler").onMouseDown,u=t("./lib/event"),o=t("./lib/lang"),r=t("./commands/multi_select_commands");e.commands=r.defaultCommands.concat(r.multiSelectCommands);var n=t("./search").Search,i=new n;function s(w,x,_){return i.$options.wrap=!0,i.$options.needle=x,i.$options.backwards=_==-1,i.find(w)}var l=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(l.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(w,x){if(w){if(!this.inMultiSelectMode&&this.rangeCount===0){var _=this.toOrientedRange();if(this.rangeList.add(_),this.rangeList.add(w),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),x||this.fromOrientedRange(w);this.rangeList.removeAll(),this.rangeList.add(_),this.$onAddRange(_)}w.cursor||(w.cursor=w.end);var v=this.rangeList.add(w);return this.$onAddRange(w),v.length&&this.$onRemoveRange(v),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),x||this.fromOrientedRange(w)}},this.toSingleRange=function(w){w=w||this.ranges[0];var x=this.rangeList.removeAll();x.length&&this.$onRemoveRange(x),w&&this.fromOrientedRange(w)},this.substractPoint=function(w){var x=this.rangeList.substractPoint(w);if(x)return this.$onRemoveRange(x),x[0]},this.mergeOverlappingRanges=function(){var w=this.rangeList.merge();w.length&&this.$onRemoveRange(w)},this.$onAddRange=function(w){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(w),this._signal("addRange",{range:w})},this.$onRemoveRange=function(w){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var x=this.rangeList.ranges.pop();w.push(x),this.rangeCount=0}for(var _=w.length;_--;){var v=this.ranges.indexOf(w[_]);this.ranges.splice(v,1)}this._signal("removeRange",{ranges:w}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),x=x||this.ranges[0],x&&!x.isEqual(this.getRange())&&this.fromOrientedRange(x)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new d,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var w=this.ranges.length?this.ranges:[this.getRange()],x=[],_=0;_1){var w=this.rangeList.ranges,x=w[w.length-1],_=p.fromPoints(w[0].start,x.end);this.toSingleRange(),this.setSelectionRange(_,x.cursor==x.start)}else{var v=this.session.documentToScreenPosition(this.cursor),T=this.session.documentToScreenPosition(this.anchor),L=this.rectangularRangeBlock(v,T);L.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(w,x,_){var v=[],T=w.column0;)I--;if(I>0)for(var D=0;v[D].isEmpty();)D++;for(var O=I;O>=D;O--)v[O].isEmpty()&&v.splice(O,1)}return v}}.call(g.prototype);var h=t("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(w){w.cursor||(w.cursor=w.end);var x=this.getSelectionStyle();return w.marker=this.session.addMarker(w,"ace_selection",x),this.session.$selectionMarkers.push(w),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,w},this.removeSelectionMarker=function(w){if(w.marker){this.session.removeMarker(w.marker);var x=this.session.$selectionMarkers.indexOf(w);x!=-1&&this.session.$selectionMarkers.splice(x,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(w){for(var x=this.session.$selectionMarkers,_=w.length;_--;){var v=w[_];if(v.marker){this.session.removeMarker(v.marker);var T=x.indexOf(v);T!=-1&&x.splice(T,1)}}this.session.selectionMarkerCount=x.length},this.$onAddRange=function(w){this.addSelectionMarker(w.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(w){this.removeSelectionMarkers(w.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(w){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(r.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(w){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(r.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(w){var x=w.command,_=w.editor;if(_.multiSelect){if(x.multiSelectAction)x.multiSelectAction=="forEach"?v=_.forEachSelection(x,w.args):x.multiSelectAction=="forEachLine"?v=_.forEachSelection(x,w.args,!0):x.multiSelectAction=="single"?(_.exitMultiSelectMode(),v=x.exec(_,w.args||{})):v=x.multiSelectAction(_,w.args||{});else{var v=x.exec(_,w.args||{});_.multiSelect.addRange(_.multiSelect.toOrientedRange()),_.multiSelect.mergeOverlappingRanges()}return v}},this.forEachSelection=function(w,x,_){if(!this.inVirtualSelectionMode){var v=_&&_.keepOrder,T=_==!0||_&&_.$byLines,L=this.session,M=this.selection,E=M.rangeList,S=(v?M:E).ranges,y;if(!S.length)return w.exec?w.exec(this,x||{}):w(this,x||{});var m=M._eventRegistry;M._eventRegistry={};var $=new g(L);this.inVirtualSelectionMode=!0;for(var A=S.length;A--;){if(T)for(;A>0&&S[A].start.row==S[A-1].end.row;)A--;$.fromOrientedRange(S[A]),$.index=A,this.selection=L.selection=$;var k=w.exec?w.exec(this,x||{}):w(this,x||{});!y&&k!==void 0&&(y=k),$.toOrientedRange(S[A])}$.detach(),this.selection=L.selection=M,this.inVirtualSelectionMode=!1,M._eventRegistry=m,M.mergeOverlappingRanges(),M.ranges[0]&&M.fromOrientedRange(M.ranges[0]);var R=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),R&&R.from==R.to&&this.renderer.animateScrolling(R.from),y}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var w="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var x=this.multiSelect.rangeList.ranges,_=[],v=0;v0);M<0&&(M=0),E>=y&&(E=y-1)}var $=this.session.removeFullLines(M,E);$=this.$reAlignText($,S),this.session.insert({row:M,column:0},$.join(` `)+` -`),T||($.start.column=0,$.end.column=L[L.length-1].length),this.selection.setRange($)}else{E.forEach(function(R){x.substractPoint(R.cursor)});var _=0,k=1/0,I=A.map(function(R){var D=R.cursor,O=w.getLine(D.row),N=O.substr(D.column).search(/\S/g);return N==-1&&(N=0),D.column>_&&(_=D.column),NP?w.insert(O,o.stringRepeat(" ",N-P)):w.remove(new p(O.row,O.column,O.row,O.column-N+P)),R.start.column=R.end.column=_,R.start.row=R.end.row=O.row,R.cursor=R.end}),x.fromOrientedRange(A[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(w,x){var A=!0,v=!0,E,$,M;return w.map(function(L){var _=L.match(/(\s*)(.*?)(\s*)([=:].*)/);return _?E==null?(E=_[1].length,$=_[2].length,M=_[3].length,_):(E+$+M!=_[1].length+_[2].length+_[3].length&&(v=!1),E!=_[1].length&&(A=!1),E>_[1].length&&(E=_[1].length),$<_[2].length&&($=_[2].length),M>_[3].length&&(M=_[3].length),_):[L]}).map(x?T:A?v?y:T:m);function S(L){return o.stringRepeat(" ",L)}function T(L){return L[2]?S(E)+L[2]+S($-L[2].length+M)+L[4].replace(/^([=:])\s+/,"$1 "):L[0]}function y(L){return L[2]?S(E+$-L[2].length)+L[2]+S(M)+L[4].replace(/^([=:])\s+/,"$1 "):L[0]}function m(L){return L[2]?S(E)+L[2]+S(M)+L[4].replace(/^([=:])\s+/,"$1 "):L[0]}}}).call(h.prototype);function f(w,x){return w.row==x.row&&w.column==x.column}e.onSessionChange=function(w){var x=w.session;x&&!x.multiSelect&&(x.$selectionMarkers=[],x.selection.$initRangeList(),x.multiSelect=x.selection),this.multiSelect=x&&x.multiSelect;var A=w.oldSession;A&&(A.multiSelect.off("addRange",this.$onAddRange),A.multiSelect.off("removeRange",this.$onRemoveRange),A.multiSelect.off("multiSelect",this.$onMultiSelect),A.multiSelect.off("singleSelect",this.$onSingleSelect),A.multiSelect.lead.off("change",this.$checkMultiselectChange),A.multiSelect.anchor.off("change",this.$checkMultiselectChange)),x&&(x.multiSelect.on("addRange",this.$onAddRange),x.multiSelect.on("removeRange",this.$onRemoveRange),x.multiSelect.on("multiSelect",this.$onMultiSelect),x.multiSelect.on("singleSelect",this.$onSingleSelect),x.multiSelect.lead.on("change",this.$checkMultiselectChange),x.multiSelect.anchor.on("change",this.$checkMultiselectChange)),x&&this.inMultiSelectMode!=x.selection.inMultiSelectMode&&(x.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function b(w){w.$multiselectOnSessionChange||(w.$onAddRange=w.$onAddRange.bind(w),w.$onRemoveRange=w.$onRemoveRange.bind(w),w.$onMultiSelect=w.$onMultiSelect.bind(w),w.$onSingleSelect=w.$onSingleSelect.bind(w),w.$multiselectOnSessionChange=e.onSessionChange.bind(w),w.$checkMultiselectChange=w.$checkMultiselectChange.bind(w),w.$multiselectOnSessionChange(w),w.on("changeSession",w.$multiselectOnSessionChange),w.on("mousedown",a),w.commands.addCommands(r.defaultCommands),C(w))}function C(w){if(!w.textInput)return;var x=w.textInput.getElement(),A=!1;u.addListener(x,"keydown",function(E){var $=E.keyCode==18&&!(E.ctrlKey||E.shiftKey||E.metaKey);w.$blockSelectEnabled&&$?A||(w.renderer.setMouseCursor("crosshair"),A=!0):A&&v()},w),u.addListener(x,"keyup",v,w),u.addListener(x,"blur",v,w);function v(E){A&&(w.renderer.setMouseCursor(""),A=!1)}}e.MultiSelect=b,t("./config").defineOptions(h.prototype,"editor",{enableMultiselect:{set:function(w){b(this),w?this.on("mousedown",a):this.off("mousedown",a)},value:!0},enableBlockSelect:{set:function(w){this.$blockSelectEnabled=w},value:!0}})});ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,e,c){"use strict";var d=t("../../range").Range,p=e.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(g,a,u){var o=g.getLine(u);return this.foldingStartMarker.test(o)?"start":a=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(o)?"end":""},this.getFoldWidgetRange=function(g,a,u){return null},this.indentationBlock=function(g,a,u){var o=/\S/,r=g.getLine(a),n=r.search(o);if(n!=-1){for(var i=u||r.length,s=g.getLength(),l=a,h=a;++al){var C=g.getLine(h).length;return new d(l,i,h,C)}}},this.openingBracketBlock=function(g,a,u,o,r){var n={row:u,column:o+1},i=g.$findClosingBracket(a,n,r);if(i){var s=g.foldWidgets[i.row];return s==null&&(s=g.getFoldWidget(i.row)),s=="start"&&i.row>n.row&&(i.row--,i.column=g.getLine(i.row).length),d.fromPoints(n,i)}},this.closingBracketBlock=function(g,a,u,o,r){var n={row:u,column:o},i=g.$findOpeningBracket(a,n);if(i)return i.column++,n.column--,d.fromPoints(i,n)}}).call(p.prototype)});ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],function(t,e,c){"use strict";var d=t("../line_widgets").LineWidgets,p=t("../lib/dom"),g=t("../range").Range,a=t("../config").nls;function u(r,n,i){for(var s=0,l=r.length-1;s<=l;){var h=s+l>>1,f=i(n,r[h]);if(f>0)s=h+1;else if(f<0)l=h-1;else return h}return-(s+1)}function o(r,n,i){var s=r.getAnnotations().sort(g.comparePoints);if(s.length){var l=u(s,{row:n,column:-1},g.comparePoints);l<0&&(l=-l-1),l>=s.length?l=i>0?0:s.length-1:l===0&&i<0&&(l=s.length-1);var h=s[l];if(!(!h||!i)){if(h.row===n){do h=s[l+=i];while(h&&h.row===n);if(!h)return s.slice()}var f=[];n=h.row;do f[i<0?"unshift":"push"](h),h=s[l+=i];while(h&&h.row==n);return f.length&&f}}}e.showErrorMarker=function(r,n){var i=r.session;i.widgetManager||(i.widgetManager=new d(i),i.widgetManager.attach(r));var s=r.getCursorPosition(),l=s.row,h=i.widgetManager.getWidgetsAtRow(l).filter(function($){return $.type=="errorMarker"})[0];h?h.destroy():l-=n;var f=o(i,l,n),b;if(f){var C=f[0];s.column=(C.pos&&typeof C.column!="number"?C.pos.sc:C.column)||0,s.row=C.row,b=r.renderer.$gutterLayer.$annotations[s.row]}else{if(h)return;b={text:[a("Looks good!")],className:"ace_ok"}}r.session.unfold(s.row),r.selection.moveToPosition(s);var w={row:s.row,fixedWidth:!0,coverGutter:!0,el:p.createElement("div"),type:"errorMarker"},x=w.el.appendChild(p.createElement("div")),A=w.el.appendChild(p.createElement("div"));A.className="error_widget_arrow "+b.className;var v=r.renderer.$cursorLayer.getPixelPosition(s).left;A.style.left=v+r.renderer.gutterWidth-5+"px",w.el.className="error_widget_wrapper",x.className="error_widget "+b.className,x.innerHTML=b.text.join("
"),x.appendChild(p.createElement("div"));var E=function($,M,S){if(M===0&&(S==="esc"||S==="return"))return w.destroy(),{command:"null"}};w.destroy=function(){r.$mouseHandler.isMousePressed||(r.keyBinding.removeKeyboardHandler(E),i.widgetManager.removeLineWidget(w),r.off("changeSelection",w.destroy),r.off("changeSession",w.destroy),r.off("mouseup",w.destroy),r.off("change",w.destroy))},r.keyBinding.addKeyboardHandler(E),r.on("changeSelection",w.destroy),r.on("changeSession",w.destroy),r.on("mouseup",w.destroy),r.on("change",w.destroy),r.session.widgetManager.addLineWidget(w),w.el.onmousedown=r.focus.bind(r),r.renderer.scrollCursorIntoView(null,.5,{bottom:w.el.offsetHeight})},p.importCssString(` +`),S||(L.start.column=0,L.end.column=$[$.length-1].length),this.selection.setRange(L)}else{T.forEach(function(I){x.substractPoint(I.cursor)});var A=0,k=1/0,R=_.map(function(I){var D=I.cursor,O=w.getLine(D.row),N=O.substr(D.column).search(/\S/g);return N==-1&&(N=0),D.column>A&&(A=D.column),NP?w.insert(O,o.stringRepeat(" ",N-P)):w.remove(new p(O.row,O.column,O.row,O.column-N+P)),I.start.column=I.end.column=A,I.start.row=I.end.row=O.row,I.cursor=I.end}),x.fromOrientedRange(_[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(w,x){var _=!0,v=!0,T,L,M;return w.map(function($){var A=$.match(/(\s*)(.*?)(\s*)([=:].*)/);return A?T==null?(T=A[1].length,L=A[2].length,M=A[3].length,A):(T+L+M!=A[1].length+A[2].length+A[3].length&&(v=!1),T!=A[1].length&&(_=!1),T>A[1].length&&(T=A[1].length),LA[3].length&&(M=A[3].length),A):[$]}).map(x?S:_?v?y:S:m);function E($){return o.stringRepeat(" ",$)}function S($){return $[2]?E(T)+$[2]+E(L-$[2].length+M)+$[4].replace(/^([=:])\s+/,"$1 "):$[0]}function y($){return $[2]?E(T+L-$[2].length)+$[2]+E(M)+$[4].replace(/^([=:])\s+/,"$1 "):$[0]}function m($){return $[2]?E(T)+$[2]+E(M)+$[4].replace(/^([=:])\s+/,"$1 "):$[0]}}}).call(h.prototype);function f(w,x){return w.row==x.row&&w.column==x.column}e.onSessionChange=function(w){var x=w.session;x&&!x.multiSelect&&(x.$selectionMarkers=[],x.selection.$initRangeList(),x.multiSelect=x.selection),this.multiSelect=x&&x.multiSelect;var _=w.oldSession;_&&(_.multiSelect.off("addRange",this.$onAddRange),_.multiSelect.off("removeRange",this.$onRemoveRange),_.multiSelect.off("multiSelect",this.$onMultiSelect),_.multiSelect.off("singleSelect",this.$onSingleSelect),_.multiSelect.lead.off("change",this.$checkMultiselectChange),_.multiSelect.anchor.off("change",this.$checkMultiselectChange)),x&&(x.multiSelect.on("addRange",this.$onAddRange),x.multiSelect.on("removeRange",this.$onRemoveRange),x.multiSelect.on("multiSelect",this.$onMultiSelect),x.multiSelect.on("singleSelect",this.$onSingleSelect),x.multiSelect.lead.on("change",this.$checkMultiselectChange),x.multiSelect.anchor.on("change",this.$checkMultiselectChange)),x&&this.inMultiSelectMode!=x.selection.inMultiSelectMode&&(x.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function b(w){w.$multiselectOnSessionChange||(w.$onAddRange=w.$onAddRange.bind(w),w.$onRemoveRange=w.$onRemoveRange.bind(w),w.$onMultiSelect=w.$onMultiSelect.bind(w),w.$onSingleSelect=w.$onSingleSelect.bind(w),w.$multiselectOnSessionChange=e.onSessionChange.bind(w),w.$checkMultiselectChange=w.$checkMultiselectChange.bind(w),w.$multiselectOnSessionChange(w),w.on("changeSession",w.$multiselectOnSessionChange),w.on("mousedown",a),w.commands.addCommands(r.defaultCommands),C(w))}function C(w){if(!w.textInput)return;var x=w.textInput.getElement(),_=!1;u.addListener(x,"keydown",function(T){var L=T.keyCode==18&&!(T.ctrlKey||T.shiftKey||T.metaKey);w.$blockSelectEnabled&&L?_||(w.renderer.setMouseCursor("crosshair"),_=!0):_&&v()},w),u.addListener(x,"keyup",v,w),u.addListener(x,"blur",v,w);function v(T){_&&(w.renderer.setMouseCursor(""),_=!1)}}e.MultiSelect=b,t("./config").defineOptions(h.prototype,"editor",{enableMultiselect:{set:function(w){b(this),w?this.on("mousedown",a):this.off("mousedown",a)},value:!0},enableBlockSelect:{set:function(w){this.$blockSelectEnabled=w},value:!0}})});ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,e,c){"use strict";var d=t("../../range").Range,p=e.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(g,a,u){var o=g.getLine(u);return this.foldingStartMarker.test(o)?"start":a=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(o)?"end":""},this.getFoldWidgetRange=function(g,a,u){return null},this.indentationBlock=function(g,a,u){var o=/\S/,r=g.getLine(a),n=r.search(o);if(n!=-1){for(var i=u||r.length,s=g.getLength(),l=a,h=a;++al){var C=g.getLine(h).length;return new d(l,i,h,C)}}},this.openingBracketBlock=function(g,a,u,o,r){var n={row:u,column:o+1},i=g.$findClosingBracket(a,n,r);if(i){var s=g.foldWidgets[i.row];return s==null&&(s=g.getFoldWidget(i.row)),s=="start"&&i.row>n.row&&(i.row--,i.column=g.getLine(i.row).length),d.fromPoints(n,i)}},this.closingBracketBlock=function(g,a,u,o,r){var n={row:u,column:o},i=g.$findOpeningBracket(a,n);if(i)return i.column++,n.column--,d.fromPoints(i,n)}}).call(p.prototype)});ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],function(t,e,c){"use strict";var d=t("../line_widgets").LineWidgets,p=t("../lib/dom"),g=t("../range").Range,a=t("../config").nls;function u(r,n,i){for(var s=0,l=r.length-1;s<=l;){var h=s+l>>1,f=i(n,r[h]);if(f>0)s=h+1;else if(f<0)l=h-1;else return h}return-(s+1)}function o(r,n,i){var s=r.getAnnotations().sort(g.comparePoints);if(s.length){var l=u(s,{row:n,column:-1},g.comparePoints);l<0&&(l=-l-1),l>=s.length?l=i>0?0:s.length-1:l===0&&i<0&&(l=s.length-1);var h=s[l];if(!(!h||!i)){if(h.row===n){do h=s[l+=i];while(h&&h.row===n);if(!h)return s.slice()}var f=[];n=h.row;do f[i<0?"unshift":"push"](h),h=s[l+=i];while(h&&h.row==n);return f.length&&f}}}e.showErrorMarker=function(r,n){var i=r.session;i.widgetManager||(i.widgetManager=new d(i),i.widgetManager.attach(r));var s=r.getCursorPosition(),l=s.row,h=i.widgetManager.getWidgetsAtRow(l).filter(function(L){return L.type=="errorMarker"})[0];h?h.destroy():l-=n;var f=o(i,l,n),b;if(f){var C=f[0];s.column=(C.pos&&typeof C.column!="number"?C.pos.sc:C.column)||0,s.row=C.row,b=r.renderer.$gutterLayer.$annotations[s.row]}else{if(h)return;b={text:[a("Looks good!")],className:"ace_ok"}}r.session.unfold(s.row),r.selection.moveToPosition(s);var w={row:s.row,fixedWidth:!0,coverGutter:!0,el:p.createElement("div"),type:"errorMarker"},x=w.el.appendChild(p.createElement("div")),_=w.el.appendChild(p.createElement("div"));_.className="error_widget_arrow "+b.className;var v=r.renderer.$cursorLayer.getPixelPosition(s).left;_.style.left=v+r.renderer.gutterWidth-5+"px",w.el.className="error_widget_wrapper",x.className="error_widget "+b.className,x.innerHTML=b.text.join("
"),x.appendChild(p.createElement("div"));var T=function(L,M,E){if(M===0&&(E==="esc"||E==="return"))return w.destroy(),{command:"null"}};w.destroy=function(){r.$mouseHandler.isMousePressed||(r.keyBinding.removeKeyboardHandler(T),i.widgetManager.removeLineWidget(w),r.off("changeSelection",w.destroy),r.off("changeSession",w.destroy),r.off("mouseup",w.destroy),r.off("change",w.destroy))},r.keyBinding.addKeyboardHandler(T),r.on("changeSelection",w.destroy),r.on("changeSession",w.destroy),r.on("mouseup",w.destroy),r.on("change",w.destroy),r.session.widgetManager.addLineWidget(w),w.el.onmousedown=r.focus.bind(r),r.renderer.scrollCursorIntoView(null,.5,{bottom:w.el.offsetHeight})},p.importCssString(` .error_widget_wrapper { background: inherit; color: inherit; @@ -938,15 +938,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho border-left-color: transparent!important; top: -5px; } -`,"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,e,c){"use strict";t("./loader_build")(e);var d=t("./lib/dom"),p=t("./range").Range,g=t("./editor").Editor,a=t("./edit_session").EditSession,u=t("./undomanager").UndoManager,o=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"),e.config=t("./config"),e.edit=function(r,n){if(typeof r=="string"){var i=r;if(r=document.getElementById(i),!r)throw new Error("ace.edit can't find div #"+i)}if(r&&r.env&&r.env.editor instanceof g)return r.env.editor;var s="";if(r&&/input|textarea/i.test(r.tagName)){var l=r;s=l.value,r=d.createElement("pre"),l.parentNode.replaceChild(r,l)}else r&&(s=r.textContent,r.innerHTML="");var h=e.createEditSession(s),f=new g(new o(r),h,n),b={document:h,editor:f,onResize:f.resize.bind(f,null)};return l&&(b.textarea=l),f.on("destroy",function(){b.editor.container.env=null}),f.container.env=f.env=b,f},e.createEditSession=function(r,n){var i=new a(r,n);return i.setUndoManager(new u),i},e.Range=p,e.Editor=g,e.EditSession=a,e.UndoManager=u,e.VirtualRenderer=o,e.version=e.config.version});(function(){ace.require(["ace/ace"],function(t){t&&(t.config.init(!0),t.define=ace.define);var e=function(){return this}();!e&&typeof window<"u"&&(e=window),!e&&typeof self<"u"&&(e=self),e.ace||(e.ace=t);for(var c in t)t.hasOwnProperty(c)&&(e.ace[c]=t[c]);e.ace.default=e.ace,typeof uo=="object"&&typeof Kl=="object"&&uo&&(uo.exports=e.ace)})})()});var Yr={};ld(Yr,{afterMain:()=>Ma,afterRead:()=>$a,afterWrite:()=>Ra,applyStyles:()=>$i,arrow:()=>Br,auto:()=>ir,basePlacements:()=>En,beforeMain:()=>La,beforeRead:()=>_a,beforeWrite:()=>ka,bottom:()=>it,clippingParents:()=>Ho,computeStyles:()=>xi,createPopper:()=>hr,createPopperBase:()=>Ua,createPopperLite:()=>Va,detectOverflow:()=>Tt,end:()=>Dn,eventListeners:()=>Mi,flip:()=>jr,hide:()=>zr,left:()=>Xe,main:()=>xa,modifierPhases:()=>Wo,offset:()=>Gr,placements:()=>or,popper:()=>Zn,popperGenerator:()=>si,popperOffsets:()=>Ri,preventOverflow:()=>Kr,read:()=>Aa,reference:()=>Bo,right:()=>Qe,start:()=>dn,top:()=>Je,variationPlacements:()=>Hr,viewport:()=>rr,write:()=>Ia});var Je="top",it="bottom",Qe="right",Xe="left",ir="auto",En=[Je,it,Qe,Xe],dn="start",Dn="end",Ho="clippingParents",rr="viewport",Zn="popper",Bo="reference",Hr=En.reduce(function(t,e){return t.concat([e+"-"+dn,e+"-"+Dn])},[]),or=[].concat(En,[ir]).reduce(function(t,e){return t.concat([e,e+"-"+dn,e+"-"+Dn])},[]),_a="beforeRead",Aa="read",$a="afterRead",La="beforeMain",xa="main",Ma="afterMain",ka="beforeWrite",Ia="write",Ra="afterWrite",Wo=[_a,Aa,$a,La,xa,Ma,ka,Ia,Ra];function ut(t){return t?(t.nodeName||"").toLowerCase():null}function Ge(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Ht(t){var e=Ge(t).Element;return t instanceof e||t instanceof Element}function at(t){var e=Ge(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Ai(t){if(typeof ShadowRoot>"u")return!1;var e=Ge(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function ud(t){var e=t.state;Object.keys(e.elements).forEach(function(c){var d=e.styles[c]||{},p=e.attributes[c]||{},g=e.elements[c];!at(g)||!ut(g)||(Object.assign(g.style,d),Object.keys(p).forEach(function(a){var u=p[a];u===!1?g.removeAttribute(a):g.setAttribute(a,u===!0?"":u)}))})}function dd(t){var e=t.state,c={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,c.popper),e.styles=c,e.elements.arrow&&Object.assign(e.elements.arrow.style,c.arrow),function(){Object.keys(e.elements).forEach(function(d){var p=e.elements[d],g=e.attributes[d]||{},a=Object.keys(e.styles.hasOwnProperty(d)?e.styles[d]:c[d]),u=a.reduce(function(o,r){return o[r]="",o},{});!at(p)||!ut(p)||(Object.assign(p.style,u),Object.keys(g).forEach(function(o){p.removeAttribute(o)}))})}}var $i={name:"applyStyles",enabled:!0,phase:"write",fn:ud,effect:dd,requires:["computeStyles"]};function dt(t){return t.split("-")[0]}var Qt=Math.max,qn=Math.min,Cn=Math.round;function Li(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function sr(){return!/^((?!chrome|android).)*safari/i.test(Li())}function Bt(t,e,c){e===void 0&&(e=!1),c===void 0&&(c=!1);var d=t.getBoundingClientRect(),p=1,g=1;e&&at(t)&&(p=t.offsetWidth>0&&Cn(d.width)/t.offsetWidth||1,g=t.offsetHeight>0&&Cn(d.height)/t.offsetHeight||1);var a=Ht(t)?Ge(t):window,u=a.visualViewport,o=!sr()&&c,r=(d.left+(o&&u?u.offsetLeft:0))/p,n=(d.top+(o&&u?u.offsetTop:0))/g,i=d.width/p,s=d.height/g;return{width:i,height:s,top:n,right:r+i,bottom:n+s,left:r,x:r,y:n}}function ei(t){var e=Bt(t),c=t.offsetWidth,d=t.offsetHeight;return Math.abs(e.width-c)<=1&&(c=e.width),Math.abs(e.height-d)<=1&&(d=e.height),{x:t.offsetLeft,y:t.offsetTop,width:c,height:d}}function ar(t,e){var c=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(c&&Ai(c)){var d=e;do{if(d&&t.isSameNode(d))return!0;d=d.parentNode||d.host}while(d)}return!1}function Ct(t){return Ge(t).getComputedStyle(t)}function Uo(t){return["table","td","th"].indexOf(ut(t))>=0}function mt(t){return((Ht(t)?t.ownerDocument:t.document)||window.document).documentElement}function Tn(t){return ut(t)==="html"?t:t.assignedSlot||t.parentNode||(Ai(t)?t.host:null)||mt(t)}function Oa(t){return!at(t)||Ct(t).position==="fixed"?null:t.offsetParent}function hd(t){var e=/firefox/i.test(Li()),c=/Trident/i.test(Li());if(c&&at(t)){var d=Ct(t);if(d.position==="fixed")return null}var p=Tn(t);for(Ai(p)&&(p=p.host);at(p)&&["html","body"].indexOf(ut(p))<0;){var g=Ct(p);if(g.transform!=="none"||g.perspective!=="none"||g.contain==="paint"||["transform","perspective"].indexOf(g.willChange)!==-1||e&&g.willChange==="filter"||e&&g.filter&&g.filter!=="none")return p;p=p.parentNode}return null}function Zt(t){for(var e=Ge(t),c=Oa(t);c&&Uo(c)&&Ct(c).position==="static";)c=Oa(c);return c&&(ut(c)==="html"||ut(c)==="body"&&Ct(c).position==="static")?e:c||hd(t)||e}function ti(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ni(t,e,c){return Qt(t,qn(e,c))}function Da(t,e,c){var d=ni(t,e,c);return d>c?c:d}function lr(){return{top:0,right:0,bottom:0,left:0}}function cr(t){return Object.assign({},lr(),t)}function ur(t,e){return e.reduce(function(c,d){return c[d]=t,c},{})}var fd=function(e,c){return e=typeof e=="function"?e(Object.assign({},c.rects,{placement:c.placement})):e,cr(typeof e!="number"?e:ur(e,En))};function pd(t){var e,c=t.state,d=t.name,p=t.options,g=c.elements.arrow,a=c.modifiersData.popperOffsets,u=dt(c.placement),o=ti(u),r=[Xe,Qe].indexOf(u)>=0,n=r?"height":"width";if(!(!g||!a)){var i=fd(p.padding,c),s=ei(g),l=o==="y"?Je:Xe,h=o==="y"?it:Qe,f=c.rects.reference[n]+c.rects.reference[o]-a[o]-c.rects.popper[n],b=a[o]-c.rects.reference[o],C=Zt(g),w=C?o==="y"?C.clientHeight||0:C.clientWidth||0:0,x=f/2-b/2,A=i[l],v=w-s[n]-i[h],E=w/2-s[n]/2+x,$=ni(A,E,v),M=o;c.modifiersData[d]=(e={},e[M]=$,e.centerOffset=$-E,e)}}function gd(t){var e=t.state,c=t.options,d=c.element,p=d===void 0?"[data-popper-arrow]":d;p!=null&&(typeof p=="string"&&(p=e.elements.popper.querySelector(p),!p)||ar(e.elements.popper,p)&&(e.elements.arrow=p))}var Br={name:"arrow",enabled:!0,phase:"main",fn:pd,effect:gd,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Wt(t){return t.split("-")[1]}var md={top:"auto",right:"auto",bottom:"auto",left:"auto"};function vd(t,e){var c=t.x,d=t.y,p=e.devicePixelRatio||1;return{x:Cn(c*p)/p||0,y:Cn(d*p)/p||0}}function Pa(t){var e,c=t.popper,d=t.popperRect,p=t.placement,g=t.variation,a=t.offsets,u=t.position,o=t.gpuAcceleration,r=t.adaptive,n=t.roundOffsets,i=t.isFixed,s=a.x,l=s===void 0?0:s,h=a.y,f=h===void 0?0:h,b=typeof n=="function"?n({x:l,y:f}):{x:l,y:f};l=b.x,f=b.y;var C=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),x=Xe,A=Je,v=window;if(r){var E=Zt(c),$="clientHeight",M="clientWidth";if(E===Ge(c)&&(E=mt(c),Ct(E).position!=="static"&&u==="absolute"&&($="scrollHeight",M="scrollWidth")),E=E,p===Je||(p===Xe||p===Qe)&&g===Dn){A=it;var S=i&&E===v&&v.visualViewport?v.visualViewport.height:E[$];f-=S-d.height,f*=o?1:-1}if(p===Xe||(p===Je||p===it)&&g===Dn){x=Qe;var T=i&&E===v&&v.visualViewport?v.visualViewport.width:E[M];l-=T-d.width,l*=o?1:-1}}var y=Object.assign({position:u},r&&md),m=n===!0?vd({x:l,y:f},Ge(c)):{x:l,y:f};if(l=m.x,f=m.y,o){var L;return Object.assign({},y,(L={},L[A]=w?"0":"",L[x]=C?"0":"",L.transform=(v.devicePixelRatio||1)<=1?"translate("+l+"px, "+f+"px)":"translate3d("+l+"px, "+f+"px, 0)",L))}return Object.assign({},y,(e={},e[A]=w?f+"px":"",e[x]=C?l+"px":"",e.transform="",e))}function bd(t){var e=t.state,c=t.options,d=c.gpuAcceleration,p=d===void 0?!0:d,g=c.adaptive,a=g===void 0?!0:g,u=c.roundOffsets,o=u===void 0?!0:u,r={placement:dt(e.placement),variation:Wt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:p,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Pa(Object.assign({},r,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:o})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Pa(Object.assign({},r,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var xi={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:bd,data:{}};var Wr={passive:!0};function yd(t){var e=t.state,c=t.instance,d=t.options,p=d.scroll,g=p===void 0?!0:p,a=d.resize,u=a===void 0?!0:a,o=Ge(e.elements.popper),r=[].concat(e.scrollParents.reference,e.scrollParents.popper);return g&&r.forEach(function(n){n.addEventListener("scroll",c.update,Wr)}),u&&o.addEventListener("resize",c.update,Wr),function(){g&&r.forEach(function(n){n.removeEventListener("scroll",c.update,Wr)}),u&&o.removeEventListener("resize",c.update,Wr)}}var Mi={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:yd,data:{}};var wd={left:"right",right:"left",bottom:"top",top:"bottom"};function ki(t){return t.replace(/left|right|bottom|top/g,function(e){return wd[e]})}var Ed={start:"end",end:"start"};function Ur(t){return t.replace(/start|end/g,function(e){return Ed[e]})}function ii(t){var e=Ge(t),c=e.pageXOffset,d=e.pageYOffset;return{scrollLeft:c,scrollTop:d}}function ri(t){return Bt(mt(t)).left+ii(t).scrollLeft}function Vo(t,e){var c=Ge(t),d=mt(t),p=c.visualViewport,g=d.clientWidth,a=d.clientHeight,u=0,o=0;if(p){g=p.width,a=p.height;var r=sr();(r||!r&&e==="fixed")&&(u=p.offsetLeft,o=p.offsetTop)}return{width:g,height:a,x:u+ri(t),y:o}}function jo(t){var e,c=mt(t),d=ii(t),p=(e=t.ownerDocument)==null?void 0:e.body,g=Qt(c.scrollWidth,c.clientWidth,p?p.scrollWidth:0,p?p.clientWidth:0),a=Qt(c.scrollHeight,c.clientHeight,p?p.scrollHeight:0,p?p.clientHeight:0),u=-d.scrollLeft+ri(t),o=-d.scrollTop;return Ct(p||c).direction==="rtl"&&(u+=Qt(c.clientWidth,p?p.clientWidth:0)-g),{width:g,height:a,x:u,y:o}}function oi(t){var e=Ct(t),c=e.overflow,d=e.overflowX,p=e.overflowY;return/auto|scroll|overlay|hidden/.test(c+p+d)}function Vr(t){return["html","body","#document"].indexOf(ut(t))>=0?t.ownerDocument.body:at(t)&&oi(t)?t:Vr(Tn(t))}function Pn(t,e){var c;e===void 0&&(e=[]);var d=Vr(t),p=d===((c=t.ownerDocument)==null?void 0:c.body),g=Ge(d),a=p?[g].concat(g.visualViewport||[],oi(d)?d:[]):d,u=e.concat(a);return p?u:u.concat(Pn(Tn(a)))}function Ii(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Cd(t,e){var c=Bt(t,!1,e==="fixed");return c.top=c.top+t.clientTop,c.left=c.left+t.clientLeft,c.bottom=c.top+t.clientHeight,c.right=c.left+t.clientWidth,c.width=t.clientWidth,c.height=t.clientHeight,c.x=c.left,c.y=c.top,c}function Na(t,e,c){return e===rr?Ii(Vo(t,c)):Ht(e)?Cd(e,c):Ii(jo(mt(t)))}function Td(t){var e=Pn(Tn(t)),c=["absolute","fixed"].indexOf(Ct(t).position)>=0,d=c&&at(t)?Zt(t):t;return Ht(d)?e.filter(function(p){return Ht(p)&&ar(p,d)&&ut(p)!=="body"}):[]}function zo(t,e,c,d){var p=e==="clippingParents"?Td(t):[].concat(e),g=[].concat(p,[c]),a=g[0],u=g.reduce(function(o,r){var n=Na(t,r,d);return o.top=Qt(n.top,o.top),o.right=qn(n.right,o.right),o.bottom=qn(n.bottom,o.bottom),o.left=Qt(n.left,o.left),o},Na(t,a,d));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function dr(t){var e=t.reference,c=t.element,d=t.placement,p=d?dt(d):null,g=d?Wt(d):null,a=e.x+e.width/2-c.width/2,u=e.y+e.height/2-c.height/2,o;switch(p){case Je:o={x:a,y:e.y-c.height};break;case it:o={x:a,y:e.y+e.height};break;case Qe:o={x:e.x+e.width,y:u};break;case Xe:o={x:e.x-c.width,y:u};break;default:o={x:e.x,y:e.y}}var r=p?ti(p):null;if(r!=null){var n=r==="y"?"height":"width";switch(g){case dn:o[r]=o[r]-(e[n]/2-c[n]/2);break;case Dn:o[r]=o[r]+(e[n]/2-c[n]/2);break;default:}}return o}function Tt(t,e){e===void 0&&(e={});var c=e,d=c.placement,p=d===void 0?t.placement:d,g=c.strategy,a=g===void 0?t.strategy:g,u=c.boundary,o=u===void 0?Ho:u,r=c.rootBoundary,n=r===void 0?rr:r,i=c.elementContext,s=i===void 0?Zn:i,l=c.altBoundary,h=l===void 0?!1:l,f=c.padding,b=f===void 0?0:f,C=cr(typeof b!="number"?b:ur(b,En)),w=s===Zn?Bo:Zn,x=t.rects.popper,A=t.elements[h?w:s],v=zo(Ht(A)?A:A.contextElement||mt(t.elements.popper),o,n,a),E=Bt(t.elements.reference),$=dr({reference:E,element:x,strategy:"absolute",placement:p}),M=Ii(Object.assign({},x,$)),S=s===Zn?M:E,T={top:v.top-S.top+C.top,bottom:S.bottom-v.bottom+C.bottom,left:v.left-S.left+C.left,right:S.right-v.right+C.right},y=t.modifiersData.offset;if(s===Zn&&y){var m=y[p];Object.keys(T).forEach(function(L){var _=[Qe,it].indexOf(L)>=0?1:-1,k=[Je,it].indexOf(L)>=0?"y":"x";T[L]+=m[k]*_})}return T}function Go(t,e){e===void 0&&(e={});var c=e,d=c.placement,p=c.boundary,g=c.rootBoundary,a=c.padding,u=c.flipVariations,o=c.allowedAutoPlacements,r=o===void 0?or:o,n=Wt(d),i=n?u?Hr:Hr.filter(function(h){return Wt(h)===n}):En,s=i.filter(function(h){return r.indexOf(h)>=0});s.length===0&&(s=i);var l=s.reduce(function(h,f){return h[f]=Tt(t,{placement:f,boundary:p,rootBoundary:g,padding:a})[dt(f)],h},{});return Object.keys(l).sort(function(h,f){return l[h]-l[f]})}function Sd(t){if(dt(t)===ir)return[];var e=ki(t);return[Ur(t),e,Ur(e)]}function _d(t){var e=t.state,c=t.options,d=t.name;if(!e.modifiersData[d]._skip){for(var p=c.mainAxis,g=p===void 0?!0:p,a=c.altAxis,u=a===void 0?!0:a,o=c.fallbackPlacements,r=c.padding,n=c.boundary,i=c.rootBoundary,s=c.altBoundary,l=c.flipVariations,h=l===void 0?!0:l,f=c.allowedAutoPlacements,b=e.options.placement,C=dt(b),w=C===b,x=o||(w||!h?[ki(b)]:Sd(b)),A=[b].concat(x).reduce(function(U,j){return U.concat(dt(j)===ir?Go(e,{placement:j,boundary:n,rootBoundary:i,padding:r,flipVariations:h,allowedAutoPlacements:f}):j)},[]),v=e.rects.reference,E=e.rects.popper,$=new Map,M=!0,S=A[0],T=0;T=0,k=_?"width":"height",I=Tt(e,{placement:y,boundary:n,rootBoundary:i,altBoundary:s,padding:r}),R=_?L?Qe:Xe:L?it:Je;v[k]>E[k]&&(R=ki(R));var D=ki(R),O=[];if(g&&O.push(I[m]<=0),u&&O.push(I[R]<=0,I[D]<=0),O.every(function(U){return U})){S=y,M=!1;break}$.set(y,O)}if(M)for(var N=h?3:1,P=function(j){var J=A.find(function(z){var X=$.get(z);if(X)return X.slice(0,j).every(function(ee){return ee})});if(J)return S=J,"break"},H=N;H>0;H--){var F=P(H);if(F==="break")break}e.placement!==S&&(e.modifiersData[d]._skip=!0,e.placement=S,e.reset=!0)}}var jr={name:"flip",enabled:!0,phase:"main",fn:_d,requiresIfExists:["offset"],data:{_skip:!1}};function Fa(t,e,c){return c===void 0&&(c={x:0,y:0}),{top:t.top-e.height-c.y,right:t.right-e.width+c.x,bottom:t.bottom-e.height+c.y,left:t.left-e.width-c.x}}function Ha(t){return[Je,Qe,it,Xe].some(function(e){return t[e]>=0})}function Ad(t){var e=t.state,c=t.name,d=e.rects.reference,p=e.rects.popper,g=e.modifiersData.preventOverflow,a=Tt(e,{elementContext:"reference"}),u=Tt(e,{altBoundary:!0}),o=Fa(a,d),r=Fa(u,p,g),n=Ha(o),i=Ha(r);e.modifiersData[c]={referenceClippingOffsets:o,popperEscapeOffsets:r,isReferenceHidden:n,hasPopperEscaped:i},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":n,"data-popper-escaped":i})}var zr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ad};function $d(t,e,c){var d=dt(t),p=[Xe,Je].indexOf(d)>=0?-1:1,g=typeof c=="function"?c(Object.assign({},e,{placement:t})):c,a=g[0],u=g[1];return a=a||0,u=(u||0)*p,[Xe,Qe].indexOf(d)>=0?{x:u,y:a}:{x:a,y:u}}function Ld(t){var e=t.state,c=t.options,d=t.name,p=c.offset,g=p===void 0?[0,0]:p,a=or.reduce(function(n,i){return n[i]=$d(i,e.rects,g),n},{}),u=a[e.placement],o=u.x,r=u.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=o,e.modifiersData.popperOffsets.y+=r),e.modifiersData[d]=a}var Gr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ld};function xd(t){var e=t.state,c=t.name;e.modifiersData[c]=dr({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Ri={name:"popperOffsets",enabled:!0,phase:"read",fn:xd,data:{}};function Ko(t){return t==="x"?"y":"x"}function Md(t){var e=t.state,c=t.options,d=t.name,p=c.mainAxis,g=p===void 0?!0:p,a=c.altAxis,u=a===void 0?!1:a,o=c.boundary,r=c.rootBoundary,n=c.altBoundary,i=c.padding,s=c.tether,l=s===void 0?!0:s,h=c.tetherOffset,f=h===void 0?0:h,b=Tt(e,{boundary:o,rootBoundary:r,padding:i,altBoundary:n}),C=dt(e.placement),w=Wt(e.placement),x=!w,A=ti(C),v=Ko(A),E=e.modifiersData.popperOffsets,$=e.rects.reference,M=e.rects.popper,S=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,T=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),y=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,m={x:0,y:0};if(E){if(g){var L,_=A==="y"?Je:Xe,k=A==="y"?it:Qe,I=A==="y"?"height":"width",R=E[A],D=R+b[_],O=R-b[k],N=l?-M[I]/2:0,P=w===dn?$[I]:M[I],H=w===dn?-M[I]:-$[I],F=e.elements.arrow,U=l&&F?ei(F):{width:0,height:0},j=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:lr(),J=j[_],z=j[k],X=ni(0,$[I],U[I]),ee=x?$[I]/2-N-X-J-T.mainAxis:P-X-J-T.mainAxis,Z=x?-$[I]/2+N+X+z+T.mainAxis:H+X+z+T.mainAxis,pe=e.elements.arrow&&Zt(e.elements.arrow),ve=pe?A==="y"?pe.clientTop||0:pe.clientLeft||0:0,de=(L=y?.[A])!=null?L:0,B=R+ee-de-ve,K=R+Z-de,ne=ni(l?qn(D,B):D,R,l?Qt(O,K):O);E[A]=ne,m[A]=ne-R}if(u){var Q,se=A==="x"?Je:Xe,te=A==="x"?it:Qe,re=E[v],Se=v==="y"?"height":"width",he=re+b[se],xe=re-b[te],W=[Je,Xe].indexOf(C)!==-1,G=(Q=y?.[v])!=null?Q:0,q=W?he:re-$[Se]-M[Se]-G+T.altAxis,ue=W?re+$[Se]+M[Se]-G-T.altAxis:xe,Ce=l&&W?Da(q,re,ue):ni(l?q:he,re,l?ue:xe);E[v]=Ce,m[v]=Ce-re}e.modifiersData[d]=m}}var Kr={name:"preventOverflow",enabled:!0,phase:"main",fn:Md,requiresIfExists:["offset"]};function Yo(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Jo(t){return t===Ge(t)||!at(t)?ii(t):Yo(t)}function kd(t){var e=t.getBoundingClientRect(),c=Cn(e.width)/t.offsetWidth||1,d=Cn(e.height)/t.offsetHeight||1;return c!==1||d!==1}function Xo(t,e,c){c===void 0&&(c=!1);var d=at(e),p=at(e)&&kd(e),g=mt(e),a=Bt(t,p,c),u={scrollLeft:0,scrollTop:0},o={x:0,y:0};return(d||!d&&!c)&&((ut(e)!=="body"||oi(g))&&(u=Jo(e)),at(e)?(o=Bt(e,!0),o.x+=e.clientLeft,o.y+=e.clientTop):g&&(o.x=ri(g))),{x:a.left+u.scrollLeft-o.x,y:a.top+u.scrollTop-o.y,width:a.width,height:a.height}}function Id(t){var e=new Map,c=new Set,d=[];t.forEach(function(g){e.set(g.name,g)});function p(g){c.add(g.name);var a=[].concat(g.requires||[],g.requiresIfExists||[]);a.forEach(function(u){if(!c.has(u)){var o=e.get(u);o&&p(o)}}),d.push(g)}return t.forEach(function(g){c.has(g.name)||p(g)}),d}function Qo(t){var e=Id(t);return Wo.reduce(function(c,d){return c.concat(e.filter(function(p){return p.phase===d}))},[])}function Zo(t){var e;return function(){return e||(e=new Promise(function(c){Promise.resolve().then(function(){e=void 0,c(t())})})),e}}function qo(t){var e=t.reduce(function(c,d){var p=c[d.name];return c[d.name]=p?Object.assign({},p,d,{options:Object.assign({},p.options,d.options),data:Object.assign({},p.data,d.data)}):d,c},{});return Object.keys(e).map(function(c){return e[c]})}var Ba={placement:"bottom",modifiers:[],strategy:"absolute"};function Wa(){for(var t=arguments.length,e=new Array(t),c=0;c(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(e,c)=>`#${CSS.escape(c)}`)),t),Nd=t=>t==null?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),Fd=t=>{do t+=Math.floor(Math.random()*Dd);while(document.getElementById(t));return t},Hd=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:c}=window.getComputedStyle(t),d=Number.parseFloat(e),p=Number.parseFloat(c);return!d&&!p?0:(e=e.split(",")[0],c=c.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(c))*Pd)},yl=t=>{t.dispatchEvent(new Event(gs))},Sn=t=>!t||typeof t!="object"?!1:(typeof t.jquery<"u"&&(t=t[0]),typeof t.nodeType<"u"),Fn=t=>Sn(t)?t.jquery?t[0]:t:typeof t=="string"&&t.length>0?document.querySelector(bl(t)):null,Vi=t=>{if(!Sn(t)||t.getClientRects().length===0)return!1;let e=getComputedStyle(t).getPropertyValue("visibility")==="visible",c=t.closest("details:not([open])");if(!c)return e;if(c!==t){let d=t.closest("summary");if(d&&d.parentNode!==c||d===null)return!1}return e},Hn=t=>!t||t.nodeType!==Node.ELEMENT_NODE||t.classList.contains("disabled")?!0:typeof t.disabled<"u"?t.disabled:t.hasAttribute("disabled")&&t.getAttribute("disabled")!=="false",wl=t=>{if(!document.documentElement.attachShadow)return null;if(typeof t.getRootNode=="function"){let e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?wl(t.parentNode):null},io=()=>{},vr=t=>{t.offsetHeight},El=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,ts=[],Bd=t=>{document.readyState==="loading"?(ts.length||document.addEventListener("DOMContentLoaded",()=>{for(let e of ts)e()}),ts.push(t)):t()},Ut=()=>document.documentElement.dir==="rtl",zt=t=>{Bd(()=>{let e=El();if(e){let c=t.NAME,d=e.fn[c];e.fn[c]=t.jQueryInterface,e.fn[c].Constructor=t,e.fn[c].noConflict=()=>(e.fn[c]=d,t.jQueryInterface)}})},_t=(t,e=[],c=t)=>typeof t=="function"?t(...e):c,Cl=(t,e,c=!0)=>{if(!c){_t(t);return}let d=5,p=Hd(e)+d,g=!1,a=({target:u})=>{u===e&&(g=!0,e.removeEventListener(gs,a),_t(t))};e.addEventListener(gs,a),setTimeout(()=>{g||yl(e)},p)},ys=(t,e,c,d)=>{let p=t.length,g=t.indexOf(e);return g===-1?!c&&d?t[p-1]:t[0]:(g+=c?1:-1,d&&(g=(g+p)%p),t[Math.max(0,Math.min(g,p-1))])},Wd=/[^.]*(?=\..*)\.|.*/,Ud=/\..*/,Vd=/::\d+$/,ns={},ja=1,Tl={mouseenter:"mouseover",mouseleave:"mouseout"},jd=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function Sl(t,e){return e&&`${e}::${ja++}`||t.uidEvent||ja++}function _l(t){let e=Sl(t);return t.uidEvent=e,ns[e]=ns[e]||{},ns[e]}function zd(t,e){return function c(d){return ws(d,{delegateTarget:t}),c.oneOff&&Y.off(t,d.type,e),e.apply(t,[d])}}function Gd(t,e,c){return function d(p){let g=t.querySelectorAll(e);for(let{target:a}=p;a&&a!==this;a=a.parentNode)for(let u of g)if(u===a)return ws(p,{delegateTarget:a}),d.oneOff&&Y.off(t,p.type,e,c),c.apply(a,[p])}}function Al(t,e,c=null){return Object.values(t).find(d=>d.callable===e&&d.delegationSelector===c)}function $l(t,e,c){let d=typeof e=="string",p=d?c:e||c,g=Ll(t);return jd.has(g)||(g=t),[d,p,g]}function za(t,e,c,d,p){if(typeof e!="string"||!t)return;let[g,a,u]=$l(e,c,d);e in Tl&&(a=(h=>function(f){if(!f.relatedTarget||f.relatedTarget!==f.delegateTarget&&!f.delegateTarget.contains(f.relatedTarget))return h.call(this,f)})(a));let o=_l(t),r=o[u]||(o[u]={}),n=Al(r,a,g?c:null);if(n){n.oneOff=n.oneOff&&p;return}let i=Sl(a,e.replace(Wd,"")),s=g?Gd(t,c,a):zd(t,a);s.delegationSelector=g?c:null,s.callable=a,s.oneOff=p,s.uidEvent=i,r[i]=s,t.addEventListener(u,s,g)}function ms(t,e,c,d,p){let g=Al(e[c],d,p);g&&(t.removeEventListener(c,g,!!p),delete e[c][g.uidEvent])}function Kd(t,e,c,d){let p=e[c]||{};for(let[g,a]of Object.entries(p))g.includes(d)&&ms(t,e,c,a.callable,a.delegationSelector)}function Ll(t){return t=t.replace(Ud,""),Tl[t]||t}var Y={on(t,e,c,d){za(t,e,c,d,!1)},one(t,e,c,d){za(t,e,c,d,!0)},off(t,e,c,d){if(typeof e!="string"||!t)return;let[p,g,a]=$l(e,c,d),u=a!==e,o=_l(t),r=o[a]||{},n=e.startsWith(".");if(typeof g<"u"){if(!Object.keys(r).length)return;ms(t,o,a,g,p?c:null);return}if(n)for(let i of Object.keys(o))Kd(t,o,i,e.slice(1));for(let[i,s]of Object.entries(r)){let l=i.replace(Vd,"");(!u||e.includes(l))&&ms(t,o,a,s.callable,s.delegationSelector)}},trigger(t,e,c){if(typeof e!="string"||!t)return null;let d=El(),p=Ll(e),g=e!==p,a=null,u=!0,o=!0,r=!1;g&&d&&(a=d.Event(e,c),d(t).trigger(a),u=!a.isPropagationStopped(),o=!a.isImmediatePropagationStopped(),r=a.isDefaultPrevented());let n=ws(new Event(e,{bubbles:u,cancelable:!0}),c);return r&&n.preventDefault(),o&&t.dispatchEvent(n),n.defaultPrevented&&a&&a.preventDefault(),n}};function ws(t,e={}){for(let[c,d]of Object.entries(e))try{t[c]=d}catch{Object.defineProperty(t,c,{configurable:!0,get(){return d}})}return t}function Ga(t){if(t==="true")return!0;if(t==="false")return!1;if(t===Number(t).toString())return Number(t);if(t===""||t==="null")return null;if(typeof t!="string")return t;try{return JSON.parse(decodeURIComponent(t))}catch{return t}}function is(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}var _n={setDataAttribute(t,e,c){t.setAttribute(`data-bs-${is(e)}`,c)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${is(e)}`)},getDataAttributes(t){if(!t)return{};let e={},c=Object.keys(t.dataset).filter(d=>d.startsWith("bs")&&!d.startsWith("bsConfig"));for(let d of c){let p=d.replace(/^bs/,"");p=p.charAt(0).toLowerCase()+p.slice(1,p.length),e[p]=Ga(t.dataset[d])}return e},getDataAttribute(t,e){return Ga(t.getAttribute(`data-bs-${is(e)}`))}},ci=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,c){let d=Sn(c)?_n.getDataAttribute(c,"config"):{};return{...this.constructor.Default,...typeof d=="object"?d:{},...Sn(c)?_n.getDataAttributes(c):{},...typeof e=="object"?e:{}}}_typeCheckConfig(e,c=this.constructor.DefaultType){for(let[d,p]of Object.entries(c)){let g=e[d],a=Sn(g)?"element":Nd(g);if(!new RegExp(p).test(a))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${d}" provided type "${a}" but expected type "${p}".`)}}},Yd="5.3.2",Ot=class extends ci{constructor(e,c){super(),e=Fn(e),e&&(this._element=e,this._config=this._getConfig(c),es.set(this._element,this.constructor.DATA_KEY,this))}dispose(){es.remove(this._element,this.constructor.DATA_KEY),Y.off(this._element,this.constructor.EVENT_KEY);for(let e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,c,d=!0){Cl(e,c,d)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return es.get(Fn(e),this.DATA_KEY)}static getOrCreateInstance(e,c={}){return this.getInstance(e)||new this(e,typeof c=="object"?c:null)}static get VERSION(){return Yd}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}},rs=t=>{let e=t.getAttribute("data-bs-target");if(!e||e==="#"){let c=t.getAttribute("href");if(!c||!c.includes("#")&&!c.startsWith("."))return null;c.includes("#")&&!c.startsWith("#")&&(c=`#${c.split("#")[1]}`),e=c&&c!=="#"?bl(c.trim()):null}return e},le={find(t,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,t))},findOne(t,e=document.documentElement){return Element.prototype.querySelector.call(e,t)},children(t,e){return[].concat(...t.children).filter(c=>c.matches(e))},parents(t,e){let c=[],d=t.parentNode.closest(e);for(;d;)c.push(d),d=d.parentNode.closest(e);return c},prev(t,e){let c=t.previousElementSibling;for(;c;){if(c.matches(e))return[c];c=c.previousElementSibling}return[]},next(t,e){let c=t.nextElementSibling;for(;c;){if(c.matches(e))return[c];c=c.nextElementSibling}return[]},focusableChildren(t){let e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(c=>`${c}:not([tabindex^="-"])`).join(",");return this.find(e,t).filter(c=>!Hn(c)&&Vi(c))},getSelectorFromElement(t){let e=rs(t);return e&&le.findOne(e)?e:null},getElementFromSelector(t){let e=rs(t);return e?le.findOne(e):null},getMultipleElementsFromSelector(t){let e=rs(t);return e?le.find(e):[]}},ao=(t,e="hide")=>{let c=`click.dismiss${t.EVENT_KEY}`,d=t.NAME;Y.on(document,c,`[data-bs-dismiss="${d}"]`,function(p){if(["A","AREA"].includes(this.tagName)&&p.preventDefault(),Hn(this))return;let g=le.getElementFromSelector(this)||this.closest(`.${d}`);t.getOrCreateInstance(g)[e]()})},Jd="alert",Xd="bs.alert",xl=`.${Xd}`,Qd=`close${xl}`,Zd=`closed${xl}`,qd="fade",eh="show",Hi=class extends Ot{static get NAME(){return Jd}close(){if(Y.trigger(this._element,Qd).defaultPrevented)return;this._element.classList.remove(eh);let c=this._element.classList.contains(qd);this._queueCallback(()=>this._destroyElement(),this._element,c)}_destroyElement(){this._element.remove(),Y.trigger(this._element,Zd),this.dispose()}static jQueryInterface(e){return this.each(function(){let c=Hi.getOrCreateInstance(this);if(typeof e=="string"){if(c[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);c[e](this)}})}};ao(Hi,"close");zt(Hi);var th="button",nh="bs.button",ih=`.${nh}`,rh=".data-api",oh="active",Ka='[data-bs-toggle="button"]',sh=`click${ih}${rh}`,Bi=class extends Ot{static get NAME(){return th}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(oh))}static jQueryInterface(e){return this.each(function(){let c=Bi.getOrCreateInstance(this);e==="toggle"&&c[e]()})}};Y.on(document,sh,Ka,t=>{t.preventDefault();let e=t.target.closest(Ka);Bi.getOrCreateInstance(e).toggle()});zt(Bi);var ah="swipe",ji=".bs.swipe",lh=`touchstart${ji}`,ch=`touchmove${ji}`,uh=`touchend${ji}`,dh=`pointerdown${ji}`,hh=`pointerup${ji}`,fh="touch",ph="pen",gh="pointer-event",mh=40,vh={endCallback:null,leftCallback:null,rightCallback:null},bh={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"},Wi=class extends ci{constructor(e,c){super(),this._element=e,!(!e||!Wi.isSupported())&&(this._config=this._getConfig(c),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return vh}static get DefaultType(){return bh}static get NAME(){return ah}dispose(){Y.off(this._element,ji)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),_t(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){let e=Math.abs(this._deltaX);if(e<=mh)return;let c=e/this._deltaX;this._deltaX=0,c&&_t(c>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(Y.on(this._element,dh,e=>this._start(e)),Y.on(this._element,hh,e=>this._end(e)),this._element.classList.add(gh)):(Y.on(this._element,lh,e=>this._start(e)),Y.on(this._element,ch,e=>this._move(e)),Y.on(this._element,uh,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===ph||e.pointerType===fh)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}},yh="carousel",wh="bs.carousel",Vn=`.${wh}`,Ml=".data-api",Eh="ArrowLeft",Ch="ArrowRight",Th=500,fr="next",Oi="prev",Pi="left",to="right",Sh=`slide${Vn}`,os=`slid${Vn}`,_h=`keydown${Vn}`,Ah=`mouseenter${Vn}`,$h=`mouseleave${Vn}`,Lh=`dragstart${Vn}`,xh=`load${Vn}${Ml}`,Mh=`click${Vn}${Ml}`,kl="carousel",Jr="active",kh="slide",Ih="carousel-item-end",Rh="carousel-item-start",Oh="carousel-item-next",Dh="carousel-item-prev",Il=".active",Rl=".carousel-item",Ph=Il+Rl,Nh=".carousel-item img",Fh=".carousel-indicators",Hh="[data-bs-slide], [data-bs-slide-to]",Bh='[data-bs-ride="carousel"]',Wh={[Eh]:to,[Ch]:Pi},Uh={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Vh={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"},ui=class extends Ot{constructor(e,c){super(e,c),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=le.findOne(Fh,this._element),this._addEventListeners(),this._config.ride===kl&&this.cycle()}static get Default(){return Uh}static get DefaultType(){return Vh}static get NAME(){return yh}next(){this._slide(fr)}nextWhenVisible(){!document.hidden&&Vi(this._element)&&this.next()}prev(){this._slide(Oi)}pause(){this._isSliding&&yl(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){Y.one(this._element,os,()=>this.cycle());return}this.cycle()}}to(e){let c=this._getItems();if(e>c.length-1||e<0)return;if(this._isSliding){Y.one(this._element,os,()=>this.to(e));return}let d=this._getItemIndex(this._getActive());if(d===e)return;let p=e>d?fr:Oi;this._slide(p,c[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&Y.on(this._element,_h,e=>this._keydown(e)),this._config.pause==="hover"&&(Y.on(this._element,Ah,()=>this.pause()),Y.on(this._element,$h,()=>this._maybeEnableCycle())),this._config.touch&&Wi.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(let d of le.find(Nh,this._element))Y.on(d,Lh,p=>p.preventDefault());let c={leftCallback:()=>this._slide(this._directionToOrder(Pi)),rightCallback:()=>this._slide(this._directionToOrder(to)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),Th+this._config.interval))}};this._swipeHelper=new Wi(this._element,c)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;let c=Wh[e.key];c&&(e.preventDefault(),this._slide(this._directionToOrder(c)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;let c=le.findOne(Il,this._indicatorsElement);c.classList.remove(Jr),c.removeAttribute("aria-current");let d=le.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);d&&(d.classList.add(Jr),d.setAttribute("aria-current","true"))}_updateInterval(){let e=this._activeElement||this._getActive();if(!e)return;let c=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=c||this._config.defaultInterval}_slide(e,c=null){if(this._isSliding)return;let d=this._getActive(),p=e===fr,g=c||ys(this._getItems(),d,p,this._config.wrap);if(g===d)return;let a=this._getItemIndex(g),u=l=>Y.trigger(this._element,l,{relatedTarget:g,direction:this._orderToDirection(e),from:this._getItemIndex(d),to:a});if(u(Sh).defaultPrevented||!d||!g)return;let r=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(a),this._activeElement=g;let n=p?Rh:Ih,i=p?Oh:Dh;g.classList.add(i),vr(g),d.classList.add(n),g.classList.add(n);let s=()=>{g.classList.remove(n,i),g.classList.add(Jr),d.classList.remove(Jr,i,n),this._isSliding=!1,u(os)};this._queueCallback(s,d,this._isAnimated()),r&&this.cycle()}_isAnimated(){return this._element.classList.contains(kh)}_getActive(){return le.findOne(Ph,this._element)}_getItems(){return le.find(Rl,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return Ut()?e===Pi?Oi:fr:e===Pi?fr:Oi}_orderToDirection(e){return Ut()?e===Oi?Pi:to:e===Oi?to:Pi}static jQueryInterface(e){return this.each(function(){let c=ui.getOrCreateInstance(this,e);if(typeof e=="number"){c.to(e);return}if(typeof e=="string"){if(c[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);c[e]()}})}};Y.on(document,Mh,Hh,function(t){let e=le.getElementFromSelector(this);if(!e||!e.classList.contains(kl))return;t.preventDefault();let c=ui.getOrCreateInstance(e),d=this.getAttribute("data-bs-slide-to");if(d){c.to(d),c._maybeEnableCycle();return}if(_n.getDataAttribute(this,"slide")==="next"){c.next(),c._maybeEnableCycle();return}c.prev(),c._maybeEnableCycle()});Y.on(window,xh,()=>{let t=le.find(Bh);for(let e of t)ui.getOrCreateInstance(e)});zt(ui);var jh="collapse",zh="bs.collapse",br=`.${zh}`,Gh=".data-api",Kh=`show${br}`,Yh=`shown${br}`,Jh=`hide${br}`,Xh=`hidden${br}`,Qh=`click${br}${Gh}`,ss="show",Fi="collapse",Xr="collapsing",Zh="collapsed",qh=`:scope .${Fi} .${Fi}`,ef="collapse-horizontal",tf="width",nf="height",rf=".collapse.show, .collapse.collapsing",vs='[data-bs-toggle="collapse"]',of={parent:null,toggle:!0},sf={parent:"(null|element)",toggle:"boolean"},di=class extends Ot{constructor(e,c){super(e,c),this._isTransitioning=!1,this._triggerArray=[];let d=le.find(vs);for(let p of d){let g=le.getSelectorFromElement(p),a=le.find(g).filter(u=>u===this._element);g!==null&&a.length&&this._triggerArray.push(p)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return of}static get DefaultType(){return sf}static get NAME(){return jh}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(rf).filter(u=>u!==this._element).map(u=>di.getOrCreateInstance(u,{toggle:!1}))),e.length&&e[0]._isTransitioning||Y.trigger(this._element,Kh).defaultPrevented)return;for(let u of e)u.hide();let d=this._getDimension();this._element.classList.remove(Fi),this._element.classList.add(Xr),this._element.style[d]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;let p=()=>{this._isTransitioning=!1,this._element.classList.remove(Xr),this._element.classList.add(Fi,ss),this._element.style[d]="",Y.trigger(this._element,Yh)},a=`scroll${d[0].toUpperCase()+d.slice(1)}`;this._queueCallback(p,this._element,!0),this._element.style[d]=`${this._element[a]}px`}hide(){if(this._isTransitioning||!this._isShown()||Y.trigger(this._element,Jh).defaultPrevented)return;let c=this._getDimension();this._element.style[c]=`${this._element.getBoundingClientRect()[c]}px`,vr(this._element),this._element.classList.add(Xr),this._element.classList.remove(Fi,ss);for(let p of this._triggerArray){let g=le.getElementFromSelector(p);g&&!this._isShown(g)&&this._addAriaAndCollapsedClass([p],!1)}this._isTransitioning=!0;let d=()=>{this._isTransitioning=!1,this._element.classList.remove(Xr),this._element.classList.add(Fi),Y.trigger(this._element,Xh)};this._element.style[c]="",this._queueCallback(d,this._element,!0)}_isShown(e=this._element){return e.classList.contains(ss)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=Fn(e.parent),e}_getDimension(){return this._element.classList.contains(ef)?tf:nf}_initializeChildren(){if(!this._config.parent)return;let e=this._getFirstLevelChildren(vs);for(let c of e){let d=le.getElementFromSelector(c);d&&this._addAriaAndCollapsedClass([c],this._isShown(d))}}_getFirstLevelChildren(e){let c=le.find(qh,this._config.parent);return le.find(e,this._config.parent).filter(d=>!c.includes(d))}_addAriaAndCollapsedClass(e,c){if(e.length)for(let d of e)d.classList.toggle(Zh,!c),d.setAttribute("aria-expanded",c)}static jQueryInterface(e){let c={};return typeof e=="string"&&/show|hide/.test(e)&&(c.toggle=!1),this.each(function(){let d=di.getOrCreateInstance(this,c);if(typeof e=="string"){if(typeof d[e]>"u")throw new TypeError(`No method named "${e}"`);d[e]()}})}};Y.on(document,Qh,vs,function(t){(t.target.tagName==="A"||t.delegateTarget&&t.delegateTarget.tagName==="A")&&t.preventDefault();for(let e of le.getMultipleElementsFromSelector(this))di.getOrCreateInstance(e,{toggle:!1}).toggle()});zt(di);var Ya="dropdown",af="bs.dropdown",hi=`.${af}`,Es=".data-api",lf="Escape",Ja="Tab",cf="ArrowUp",Xa="ArrowDown",uf=2,df=`hide${hi}`,hf=`hidden${hi}`,ff=`show${hi}`,pf=`shown${hi}`,Ol=`click${hi}${Es}`,Dl=`keydown${hi}${Es}`,gf=`keyup${hi}${Es}`,Ni="show",mf="dropup",vf="dropend",bf="dropstart",yf="dropup-center",wf="dropdown-center",ai='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Ef=`${ai}.${Ni}`,no=".dropdown-menu",Cf=".navbar",Tf=".navbar-nav",Sf=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",_f=Ut()?"top-end":"top-start",Af=Ut()?"top-start":"top-end",$f=Ut()?"bottom-end":"bottom-start",Lf=Ut()?"bottom-start":"bottom-end",xf=Ut()?"left-start":"right-start",Mf=Ut()?"right-start":"left-start",kf="top",If="bottom",Rf={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Of={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"},At=class extends Ot{constructor(e,c){super(e,c),this._popper=null,this._parent=this._element.parentNode,this._menu=le.next(this._element,no)[0]||le.prev(this._element,no)[0]||le.findOne(no,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Rf}static get DefaultType(){return Of}static get NAME(){return Ya}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Hn(this._element)||this._isShown())return;let e={relatedTarget:this._element};if(!Y.trigger(this._element,ff,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(Tf))for(let d of[].concat(...document.body.children))Y.on(d,"mouseover",io);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Ni),this._element.classList.add(Ni),Y.trigger(this._element,pf,e)}}hide(){if(Hn(this._element)||!this._isShown())return;let e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!Y.trigger(this._element,df,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(let d of[].concat(...document.body.children))Y.off(d,"mouseover",io);this._popper&&this._popper.destroy(),this._menu.classList.remove(Ni),this._element.classList.remove(Ni),this._element.setAttribute("aria-expanded","false"),_n.removeDataAttribute(this._menu,"popper"),Y.trigger(this._element,hf,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!Sn(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${Ya.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof Yr>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;this._config.reference==="parent"?e=this._parent:Sn(this._config.reference)?e=Fn(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);let c=this._getPopperConfig();this._popper=hr(e,this._menu,c)}_isShown(){return this._menu.classList.contains(Ni)}_getPlacement(){let e=this._parent;if(e.classList.contains(vf))return xf;if(e.classList.contains(bf))return Mf;if(e.classList.contains(yf))return kf;if(e.classList.contains(wf))return If;let c=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains(mf)?c?Af:_f:c?Lf:$f}_detectNavbar(){return this._element.closest(Cf)!==null}_getOffset(){let{offset:e}=this._config;return typeof e=="string"?e.split(",").map(c=>Number.parseInt(c,10)):typeof e=="function"?c=>e(c,this._element):e}_getPopperConfig(){let e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(_n.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,..._t(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:c}){let d=le.find(Sf,this._menu).filter(p=>Vi(p));d.length&&ys(d,c,e===Xa,!d.includes(c)).focus()}static jQueryInterface(e){return this.each(function(){let c=At.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof c[e]>"u")throw new TypeError(`No method named "${e}"`);c[e]()}})}static clearMenus(e){if(e.button===uf||e.type==="keyup"&&e.key!==Ja)return;let c=le.find(Ef);for(let d of c){let p=At.getInstance(d);if(!p||p._config.autoClose===!1)continue;let g=e.composedPath(),a=g.includes(p._menu);if(g.includes(p._element)||p._config.autoClose==="inside"&&!a||p._config.autoClose==="outside"&&a||p._menu.contains(e.target)&&(e.type==="keyup"&&e.key===Ja||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;let u={relatedTarget:p._element};e.type==="click"&&(u.clickEvent=e),p._completeHide(u)}}static dataApiKeydownHandler(e){let c=/input|textarea/i.test(e.target.tagName),d=e.key===lf,p=[cf,Xa].includes(e.key);if(!p&&!d||c&&!d)return;e.preventDefault();let g=this.matches(ai)?this:le.prev(this,ai)[0]||le.next(this,ai)[0]||le.findOne(ai,e.delegateTarget.parentNode),a=At.getOrCreateInstance(g);if(p){e.stopPropagation(),a.show(),a._selectMenuItem(e);return}a._isShown()&&(e.stopPropagation(),a.hide(),g.focus())}};Y.on(document,Dl,ai,At.dataApiKeydownHandler);Y.on(document,Dl,no,At.dataApiKeydownHandler);Y.on(document,Ol,At.clearMenus);Y.on(document,gf,At.clearMenus);Y.on(document,Ol,ai,function(t){t.preventDefault(),At.getOrCreateInstance(this).toggle()});zt(At);var Pl="backdrop",Df="fade",Qa="show",Za=`mousedown.bs.${Pl}`,Pf={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Nf={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"},ro=class extends ci{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return Pf}static get DefaultType(){return Nf}static get NAME(){return Pl}show(e){if(!this._config.isVisible){_t(e);return}this._append();let c=this._getElement();this._config.isAnimated&&vr(c),c.classList.add(Qa),this._emulateAnimation(()=>{_t(e)})}hide(e){if(!this._config.isVisible){_t(e);return}this._getElement().classList.remove(Qa),this._emulateAnimation(()=>{this.dispose(),_t(e)})}dispose(){this._isAppended&&(Y.off(this._element,Za),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){let e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(Df),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=Fn(e.rootElement),e}_append(){if(this._isAppended)return;let e=this._getElement();this._config.rootElement.append(e),Y.on(e,Za,()=>{_t(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){Cl(e,this._getElement(),this._config.isAnimated)}},Ff="focustrap",Hf="bs.focustrap",oo=`.${Hf}`,Bf=`focusin${oo}`,Wf=`keydown.tab${oo}`,Uf="Tab",Vf="forward",qa="backward",jf={autofocus:!0,trapElement:null},zf={autofocus:"boolean",trapElement:"element"},so=class extends ci{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return jf}static get DefaultType(){return zf}static get NAME(){return Ff}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),Y.off(document,oo),Y.on(document,Bf,e=>this._handleFocusin(e)),Y.on(document,Wf,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,Y.off(document,oo))}_handleFocusin(e){let{trapElement:c}=this._config;if(e.target===document||e.target===c||c.contains(e.target))return;let d=le.focusableChildren(c);d.length===0?c.focus():this._lastTabNavDirection===qa?d[d.length-1].focus():d[0].focus()}_handleKeydown(e){e.key===Uf&&(this._lastTabNavDirection=e.shiftKey?qa:Vf)}},el=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",tl=".sticky-top",Qr="padding-right",nl="margin-right",gr=class{constructor(){this._element=document.body}getWidth(){let e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){let e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Qr,c=>c+e),this._setElementAttributes(el,Qr,c=>c+e),this._setElementAttributes(tl,nl,c=>c-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Qr),this._resetElementAttributes(el,Qr),this._resetElementAttributes(tl,nl)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,c,d){let p=this.getWidth(),g=a=>{if(a!==this._element&&window.innerWidth>a.clientWidth+p)return;this._saveInitialAttribute(a,c);let u=window.getComputedStyle(a).getPropertyValue(c);a.style.setProperty(c,`${d(Number.parseFloat(u))}px`)};this._applyManipulationCallback(e,g)}_saveInitialAttribute(e,c){let d=e.style.getPropertyValue(c);d&&_n.setDataAttribute(e,c,d)}_resetElementAttributes(e,c){let d=p=>{let g=_n.getDataAttribute(p,c);if(g===null){p.style.removeProperty(c);return}_n.removeDataAttribute(p,c),p.style.setProperty(c,g)};this._applyManipulationCallback(e,d)}_applyManipulationCallback(e,c){if(Sn(e)){c(e);return}for(let d of le.find(e,this._element))c(d)}},Gf="modal",Kf="bs.modal",Vt=`.${Kf}`,Yf=".data-api",Jf="Escape",Xf=`hide${Vt}`,Qf=`hidePrevented${Vt}`,Nl=`hidden${Vt}`,Fl=`show${Vt}`,Zf=`shown${Vt}`,qf=`resize${Vt}`,ep=`click.dismiss${Vt}`,tp=`mousedown.dismiss${Vt}`,np=`keydown.dismiss${Vt}`,ip=`click${Vt}${Yf}`,il="modal-open",rp="fade",rl="show",as="modal-static",op=".modal.show",sp=".modal-dialog",ap=".modal-body",lp='[data-bs-toggle="modal"]',cp={backdrop:!0,focus:!0,keyboard:!0},up={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"},jt=class extends Ot{constructor(e,c){super(e,c),this._dialog=le.findOne(sp,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new gr,this._addEventListeners()}static get Default(){return cp}static get DefaultType(){return up}static get NAME(){return Gf}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||Y.trigger(this._element,Fl,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(il),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||Y.trigger(this._element,Xf).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(rl),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){Y.off(window,Vt),Y.off(this._dialog,Vt),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new ro({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new so({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;let c=le.findOne(ap,this._dialog);c&&(c.scrollTop=0),vr(this._element),this._element.classList.add(rl);let d=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,Y.trigger(this._element,Zf,{relatedTarget:e})};this._queueCallback(d,this._dialog,this._isAnimated())}_addEventListeners(){Y.on(this._element,np,e=>{if(e.key===Jf){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),Y.on(window,qf,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),Y.on(this._element,tp,e=>{Y.one(this._element,ep,c=>{if(!(this._element!==e.target||this._element!==c.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(il),this._resetAdjustments(),this._scrollBar.reset(),Y.trigger(this._element,Nl)})}_isAnimated(){return this._element.classList.contains(rp)}_triggerBackdropTransition(){if(Y.trigger(this._element,Qf).defaultPrevented)return;let c=this._element.scrollHeight>document.documentElement.clientHeight,d=this._element.style.overflowY;d==="hidden"||this._element.classList.contains(as)||(c||(this._element.style.overflowY="hidden"),this._element.classList.add(as),this._queueCallback(()=>{this._element.classList.remove(as),this._queueCallback(()=>{this._element.style.overflowY=d},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){let e=this._element.scrollHeight>document.documentElement.clientHeight,c=this._scrollBar.getWidth(),d=c>0;if(d&&!e){let p=Ut()?"paddingLeft":"paddingRight";this._element.style[p]=`${c}px`}if(!d&&e){let p=Ut()?"paddingRight":"paddingLeft";this._element.style[p]=`${c}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,c){return this.each(function(){let d=jt.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof d[e]>"u")throw new TypeError(`No method named "${e}"`);d[e](c)}})}};Y.on(document,ip,lp,function(t){let e=le.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),Y.one(e,Fl,p=>{p.defaultPrevented||Y.one(e,Nl,()=>{Vi(this)&&this.focus()})});let c=le.findOne(op);c&&jt.getInstance(c).hide(),jt.getOrCreateInstance(e).toggle(this)});ao(jt);zt(jt);var dp="offcanvas",hp="bs.offcanvas",An=`.${hp}`,Hl=".data-api",fp=`load${An}${Hl}`,pp="Escape",ol="show",sl="showing",al="hiding",gp="offcanvas-backdrop",Bl=".offcanvas.show",mp=`show${An}`,vp=`shown${An}`,bp=`hide${An}`,ll=`hidePrevented${An}`,Wl=`hidden${An}`,yp=`resize${An}`,wp=`click${An}${Hl}`,Ep=`keydown.dismiss${An}`,Cp='[data-bs-toggle="offcanvas"]',Tp={backdrop:!0,keyboard:!0,scroll:!1},Sp={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"},hn=class extends Ot{constructor(e,c){super(e,c),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Tp}static get DefaultType(){return Sp}static get NAME(){return dp}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||Y.trigger(this._element,mp,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new gr().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(sl);let d=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(ol),this._element.classList.remove(sl),Y.trigger(this._element,vp,{relatedTarget:e})};this._queueCallback(d,this._element,!0)}hide(){if(!this._isShown||Y.trigger(this._element,bp).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(al),this._backdrop.hide();let c=()=>{this._element.classList.remove(ol,al),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new gr().reset(),Y.trigger(this._element,Wl)};this._queueCallback(c,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){let e=()=>{if(this._config.backdrop==="static"){Y.trigger(this._element,ll);return}this.hide()},c=!!this._config.backdrop;return new ro({className:gp,isVisible:c,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:c?e:null})}_initializeFocusTrap(){return new so({trapElement:this._element})}_addEventListeners(){Y.on(this._element,Ep,e=>{if(e.key===pp){if(this._config.keyboard){this.hide();return}Y.trigger(this._element,ll)}})}static jQueryInterface(e){return this.each(function(){let c=hn.getOrCreateInstance(this,e);if(typeof e=="string"){if(c[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);c[e](this)}})}};Y.on(document,wp,Cp,function(t){let e=le.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),Hn(this))return;Y.one(e,Wl,()=>{Vi(this)&&this.focus()});let c=le.findOne(Bl);c&&c!==e&&hn.getInstance(c).hide(),hn.getOrCreateInstance(e).toggle(this)});Y.on(window,fp,()=>{for(let t of le.find(Bl))hn.getOrCreateInstance(t).show()});Y.on(window,yp,()=>{for(let t of le.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(t).position!=="fixed"&&hn.getOrCreateInstance(t).hide()});ao(hn);zt(hn);var _p=/^aria-[\w-]*$/i,Ul={"*":["class","dir","id","lang","role",_p],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Ap=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),$p=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Lp=(t,e)=>{let c=t.nodeName.toLowerCase();return e.includes(c)?Ap.has(c)?!!$p.test(t.nodeValue):!0:e.filter(d=>d instanceof RegExp).some(d=>d.test(c))};function xp(t,e,c){if(!t.length)return t;if(c&&typeof c=="function")return c(t);let p=new window.DOMParser().parseFromString(t,"text/html"),g=[].concat(...p.body.querySelectorAll("*"));for(let a of g){let u=a.nodeName.toLowerCase();if(!Object.keys(e).includes(u)){a.remove();continue}let o=[].concat(...a.attributes),r=[].concat(e["*"]||[],e[u]||[]);for(let n of o)Lp(n,r)||a.removeAttribute(n.nodeName)}return p.body.innerHTML}var Mp="TemplateFactory",kp={allowList:Ul,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},Ip={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Rp={entry:"(string|element|function|null)",selector:"(string|element)"},bs=class extends ci{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return kp}static get DefaultType(){return Ip}static get NAME(){return Mp}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){let e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(let[p,g]of Object.entries(this._config.content))this._setContent(e,g,p);let c=e.children[0],d=this._resolvePossibleFunction(this._config.extraClass);return d&&c.classList.add(...d.split(" ")),c}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(let[c,d]of Object.entries(e))super._typeCheckConfig({selector:c,entry:d},Rp)}_setContent(e,c,d){let p=le.findOne(d,e);if(p){if(c=this._resolvePossibleFunction(c),!c){p.remove();return}if(Sn(c)){this._putElementInTemplate(Fn(c),p);return}if(this._config.html){p.innerHTML=this._maybeSanitize(c);return}p.textContent=c}}_maybeSanitize(e){return this._config.sanitize?xp(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return _t(e,[this])}_putElementInTemplate(e,c){if(this._config.html){c.innerHTML="",c.append(e);return}c.textContent=e.textContent}},Op="tooltip",Dp=new Set(["sanitize","allowList","sanitizeFn"]),ls="fade",Pp="modal",Zr="show",Np=".tooltip-inner",cl=`.${Pp}`,ul="hide.bs.modal",pr="hover",cs="focus",Fp="click",Hp="manual",Bp="hide",Wp="hidden",Up="show",Vp="shown",jp="inserted",zp="click",Gp="focusin",Kp="focusout",Yp="mouseenter",Jp="mouseleave",Xp={AUTO:"auto",TOP:"top",RIGHT:Ut()?"left":"right",BOTTOM:"bottom",LEFT:Ut()?"right":"left"},Qp={allowList:Ul,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},Zp={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"},Bn=class extends Ot{constructor(e,c){if(typeof Yr>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,c),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Qp}static get DefaultType(){return Zp}static get NAME(){return Op}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),Y.off(this._element.closest(cl),ul,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;let e=Y.trigger(this._element,this.constructor.eventName(Up)),d=(wl(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!d)return;this._disposePopper();let p=this._getTipElement();this._element.setAttribute("aria-describedby",p.getAttribute("id"));let{container:g}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(g.append(p),Y.trigger(this._element,this.constructor.eventName(jp))),this._popper=this._createPopper(p),p.classList.add(Zr),"ontouchstart"in document.documentElement)for(let u of[].concat(...document.body.children))Y.on(u,"mouseover",io);let a=()=>{Y.trigger(this._element,this.constructor.eventName(Vp)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(a,this.tip,this._isAnimated())}hide(){if(!this._isShown()||Y.trigger(this._element,this.constructor.eventName(Bp)).defaultPrevented)return;if(this._getTipElement().classList.remove(Zr),"ontouchstart"in document.documentElement)for(let p of[].concat(...document.body.children))Y.off(p,"mouseover",io);this._activeTrigger[Fp]=!1,this._activeTrigger[cs]=!1,this._activeTrigger[pr]=!1,this._isHovered=null;let d=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),Y.trigger(this._element,this.constructor.eventName(Wp)))};this._queueCallback(d,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){let c=this._getTemplateFactory(e).toHtml();if(!c)return null;c.classList.remove(ls,Zr),c.classList.add(`bs-${this.constructor.NAME}-auto`);let d=Fd(this.constructor.NAME).toString();return c.setAttribute("id",d),this._isAnimated()&&c.classList.add(ls),c}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new bs({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Np]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ls)}_isShown(){return this.tip&&this.tip.classList.contains(Zr)}_createPopper(e){let c=_t(this._config.placement,[this,e,this._element]),d=Xp[c.toUpperCase()];return hr(this._element,e,this._getPopperConfig(d))}_getOffset(){let{offset:e}=this._config;return typeof e=="string"?e.split(",").map(c=>Number.parseInt(c,10)):typeof e=="function"?c=>e(c,this._element):e}_resolvePossibleFunction(e){return _t(e,[this._element])}_getPopperConfig(e){let c={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:d=>{this._getTipElement().setAttribute("data-popper-placement",d.state.placement)}}]};return{...c,..._t(this._config.popperConfig,[c])}}_setListeners(){let e=this._config.trigger.split(" ");for(let c of e)if(c==="click")Y.on(this._element,this.constructor.eventName(zp),this._config.selector,d=>{this._initializeOnDelegatedTarget(d).toggle()});else if(c!==Hp){let d=c===pr?this.constructor.eventName(Yp):this.constructor.eventName(Gp),p=c===pr?this.constructor.eventName(Jp):this.constructor.eventName(Kp);Y.on(this._element,d,this._config.selector,g=>{let a=this._initializeOnDelegatedTarget(g);a._activeTrigger[g.type==="focusin"?cs:pr]=!0,a._enter()}),Y.on(this._element,p,this._config.selector,g=>{let a=this._initializeOnDelegatedTarget(g);a._activeTrigger[g.type==="focusout"?cs:pr]=a._element.contains(g.relatedTarget),a._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},Y.on(this._element.closest(cl),ul,this._hideModalHandler)}_fixTitle(){let e=this._element.getAttribute("title");e&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,c){clearTimeout(this._timeout),this._timeout=setTimeout(e,c)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){let c=_n.getDataAttributes(this._element);for(let d of Object.keys(c))Dp.has(d)&&delete c[d];return e={...c,...typeof e=="object"&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:Fn(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){let e={};for(let[c,d]of Object.entries(this._config))this.constructor.Default[c]!==d&&(e[c]=d);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){let c=Bn.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof c[e]>"u")throw new TypeError(`No method named "${e}"`);c[e]()}})}};zt(Bn);var qp="popover",eg=".popover-header",tg=".popover-body",ng={...Bn.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},ig={...Bn.DefaultType,content:"(null|string|element|function)"},mr=class extends Bn{static get Default(){return ng}static get DefaultType(){return ig}static get NAME(){return qp}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[eg]:this._getTitle(),[tg]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){let c=mr.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof c[e]>"u")throw new TypeError(`No method named "${e}"`);c[e]()}})}};zt(mr);var rg="scrollspy",og="bs.scrollspy",Cs=`.${og}`,sg=".data-api",ag=`activate${Cs}`,dl=`click${Cs}`,lg=`load${Cs}${sg}`,cg="dropdown-item",Di="active",ug='[data-bs-spy="scroll"]',us="[href]",dg=".nav, .list-group",hl=".nav-link",hg=".nav-item",fg=".list-group-item",pg=`${hl}, ${hg} > ${hl}, ${fg}`,gg=".dropdown",mg=".dropdown-toggle",vg={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},bg={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"},Ui=class extends Ot{constructor(e,c){super(e,c),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return vg}static get DefaultType(){return bg}static get NAME(){return rg}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(let e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=Fn(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold=="string"&&(e.threshold=e.threshold.split(",").map(c=>Number.parseFloat(c))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(Y.off(this._config.target,dl),Y.on(this._config.target,dl,us,e=>{let c=this._observableSections.get(e.target.hash);if(c){e.preventDefault();let d=this._rootElement||window,p=c.offsetTop-this._element.offsetTop;if(d.scrollTo){d.scrollTo({top:p,behavior:"smooth"});return}d.scrollTop=p}}))}_getNewObserver(){let e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(c=>this._observerCallback(c),e)}_observerCallback(e){let c=a=>this._targetLinks.get(`#${a.target.id}`),d=a=>{this._previousScrollData.visibleEntryTop=a.target.offsetTop,this._process(c(a))},p=(this._rootElement||document.documentElement).scrollTop,g=p>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=p;for(let a of e){if(!a.isIntersecting){this._activeTarget=null,this._clearActiveClass(c(a));continue}let u=a.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(g&&u){if(d(a),!p)return;continue}!g&&!u&&d(a)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;let e=le.find(us,this._config.target);for(let c of e){if(!c.hash||Hn(c))continue;let d=le.findOne(decodeURI(c.hash),this._element);Vi(d)&&(this._targetLinks.set(decodeURI(c.hash),c),this._observableSections.set(c.hash,d))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Di),this._activateParents(e),Y.trigger(this._element,ag,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(cg)){le.findOne(mg,e.closest(gg)).classList.add(Di);return}for(let c of le.parents(e,dg))for(let d of le.prev(c,pg))d.classList.add(Di)}_clearActiveClass(e){e.classList.remove(Di);let c=le.find(`${us}.${Di}`,e);for(let d of c)d.classList.remove(Di)}static jQueryInterface(e){return this.each(function(){let c=Ui.getOrCreateInstance(this,e);if(typeof e=="string"){if(c[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);c[e]()}})}};Y.on(window,lg,()=>{for(let t of le.find(ug))Ui.getOrCreateInstance(t)});zt(Ui);var yg="tab",wg="bs.tab",fi=`.${wg}`,Eg=`hide${fi}`,Cg=`hidden${fi}`,Tg=`show${fi}`,Sg=`shown${fi}`,_g=`click${fi}`,Ag=`keydown${fi}`,$g=`load${fi}`,Lg="ArrowLeft",fl="ArrowRight",xg="ArrowUp",pl="ArrowDown",ds="Home",gl="End",li="active",ml="fade",hs="show",Mg="dropdown",Vl=".dropdown-toggle",kg=".dropdown-menu",fs=`:not(${Vl})`,Ig='.list-group, .nav, [role="tablist"]',Rg=".nav-item, .list-group-item",Og=`.nav-link${fs}, .list-group-item${fs}, [role="tab"]${fs}`,jl='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',ps=`${Og}, ${jl}`,Dg=`.${li}[data-bs-toggle="tab"], .${li}[data-bs-toggle="pill"], .${li}[data-bs-toggle="list"]`,Wn=class extends Ot{constructor(e){super(e),this._parent=this._element.closest(Ig),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),Y.on(this._element,Ag,c=>this._keydown(c)))}static get NAME(){return yg}show(){let e=this._element;if(this._elemIsActive(e))return;let c=this._getActiveElem(),d=c?Y.trigger(c,Eg,{relatedTarget:e}):null;Y.trigger(e,Tg,{relatedTarget:c}).defaultPrevented||d&&d.defaultPrevented||(this._deactivate(c,e),this._activate(e,c))}_activate(e,c){if(!e)return;e.classList.add(li),this._activate(le.getElementFromSelector(e));let d=()=>{if(e.getAttribute("role")!=="tab"){e.classList.add(hs);return}e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),Y.trigger(e,Sg,{relatedTarget:c})};this._queueCallback(d,e,e.classList.contains(ml))}_deactivate(e,c){if(!e)return;e.classList.remove(li),e.blur(),this._deactivate(le.getElementFromSelector(e));let d=()=>{if(e.getAttribute("role")!=="tab"){e.classList.remove(hs);return}e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),Y.trigger(e,Cg,{relatedTarget:c})};this._queueCallback(d,e,e.classList.contains(ml))}_keydown(e){if(![Lg,fl,xg,pl,ds,gl].includes(e.key))return;e.stopPropagation(),e.preventDefault();let c=this._getChildren().filter(p=>!Hn(p)),d;if([ds,gl].includes(e.key))d=c[e.key===ds?0:c.length-1];else{let p=[fl,pl].includes(e.key);d=ys(c,e.target,p,!0)}d&&(d.focus({preventScroll:!0}),Wn.getOrCreateInstance(d).show())}_getChildren(){return le.find(ps,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,c){this._setAttributeIfNotExists(e,"role","tablist");for(let d of c)this._setInitialAttributesOnChild(d)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);let c=this._elemIsActive(e),d=this._getOuterElement(e);e.setAttribute("aria-selected",c),d!==e&&this._setAttributeIfNotExists(d,"role","presentation"),c||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){let c=le.getElementFromSelector(e);c&&(this._setAttributeIfNotExists(c,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(c,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,c){let d=this._getOuterElement(e);if(!d.classList.contains(Mg))return;let p=(g,a)=>{let u=le.findOne(g,d);u&&u.classList.toggle(a,c)};p(Vl,li),p(kg,hs),d.setAttribute("aria-expanded",c)}_setAttributeIfNotExists(e,c,d){e.hasAttribute(c)||e.setAttribute(c,d)}_elemIsActive(e){return e.classList.contains(li)}_getInnerElement(e){return e.matches(ps)?e:le.findOne(ps,e)}_getOuterElement(e){return e.closest(Rg)||e}static jQueryInterface(e){return this.each(function(){let c=Wn.getOrCreateInstance(this);if(typeof e=="string"){if(c[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);c[e]()}})}};Y.on(document,_g,jl,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),!Hn(this)&&Wn.getOrCreateInstance(this).show()});Y.on(window,$g,()=>{for(let t of le.find(Dg))Wn.getOrCreateInstance(t)});zt(Wn);var Pg="toast",Ng="bs.toast",jn=`.${Ng}`,Fg=`mouseover${jn}`,Hg=`mouseout${jn}`,Bg=`focusin${jn}`,Wg=`focusout${jn}`,Ug=`hide${jn}`,Vg=`hidden${jn}`,jg=`show${jn}`,zg=`shown${jn}`,Gg="fade",vl="hide",qr="show",eo="showing",Kg={animation:"boolean",autohide:"boolean",delay:"number"},Yg={animation:!0,autohide:!0,delay:5e3},Un=class extends Ot{constructor(e,c){super(e,c),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Yg}static get DefaultType(){return Kg}static get NAME(){return Pg}show(){if(Y.trigger(this._element,jg).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(Gg);let c=()=>{this._element.classList.remove(eo),Y.trigger(this._element,zg),this._maybeScheduleHide()};this._element.classList.remove(vl),vr(this._element),this._element.classList.add(qr,eo),this._queueCallback(c,this._element,this._config.animation)}hide(){if(!this.isShown()||Y.trigger(this._element,Ug).defaultPrevented)return;let c=()=>{this._element.classList.add(vl),this._element.classList.remove(eo,qr),Y.trigger(this._element,Vg)};this._element.classList.add(eo),this._queueCallback(c,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(qr),super.dispose()}isShown(){return this._element.classList.contains(qr)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,c){switch(e.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=c;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=c;break}}if(c){this._clearTimeout();return}let d=e.relatedTarget;this._element===d||this._element.contains(d)||this._maybeScheduleHide()}_setListeners(){Y.on(this._element,Fg,e=>this._onInteraction(e,!0)),Y.on(this._element,Hg,e=>this._onInteraction(e,!1)),Y.on(this._element,Bg,e=>this._onInteraction(e,!0)),Y.on(this._element,Wg,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){let c=Un.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof c[e]>"u")throw new TypeError(`No method named "${e}"`);c[e](this)}})}};ao(Un);zt(Un);var vc=Fo(zl());var Xl=Fo(Gl()),Ql=Fo(Yl());var wr={modalBodyConfirm:null,buttonConfirmed:null,toastContainer:null};function Zl(){ce(wr)}var De=function(t,e,c,d,...p){let g=t.insertRow();g.id=e,zn(g,e,e,0);let a=e;return p.forEach(u=>{zn(g,u),a=u}),c&&g.classList.add("table-active"),d&&$s(g,Jl,Xg(Jl,Jg,d),"Copy to clipboard"),g};function zi(t,e,c,d=!1,p=null){let g=t.insertCell(0);g.style.verticalAlign="middle",g.style.width="25px";let a=document.createElement("input");return a.classList.add("form-check-input"),a.type="checkbox",a.id=e,a.checked=c,a.disabled=d,p&&(a.onchange=p),g.append(a),a}function zn(t,e,c=null,d=-1){let p=t.insertCell(d);return p.innerHTML=e,p.setAttribute("data-bs-toggle","tooltip"),p.title=c!=null?c:e,p}function $s(t,e,c,d){let p=t.insertCell();p.classList.add("table-action-column");let g=document.createElement("button");g.classList.add("btn"),g.style.padding="0",g.innerHTML=``,d&&(g.title=d),g.onclick=c,p.appendChild(g)}var Jl="bi-copy",Jg="bi-check-lg";function Xg(t,e,c){return d=>{navigator.clipboard.writeText(c);let p=d.currentTarget.querySelector(".bi");p.classList.replace(t,e),setTimeout(()=>p.classList.replace(e,t),500)}}function ho(t,e){let c=document.createElement("th");c.innerHTML=e,t.appendChild(c)}function $t(t,e){t.innerHTML="",e.forEach(c=>{let d=document.createElement("option");d.text=c,t.appendChild(d)})}function Gn(t,e){e.forEach(c=>{pi(t,c)})}function pi(t,e,c=!1,d){let p=document.createElement("li");p.innerHTML=c?``:`${e}`,t.appendChild(p)}function Gi(t,e,c,d,p=null){let g="tab"+Math.random().toString(36).replace("0.",""),a=document.createElement("li");a.classList.add("nav-item"),p&&(a.setAttribute("data-bs-toggle","tooltip"),a.setAttribute("title",p)),a.innerHTML=`${c}`,t.appendChild(a);let u=document.createElement("template");return u.innerHTML=d,u.content.firstElementChild.id=g,e.appendChild(u.content.firstElementChild),g}function ce(t,e=null){Object.keys(t).forEach(c=>{if(t[c]=(e!=null?e:document).getElementById(c),!t[c])throw new Error(`Element ${c} not found.`)})}function qt(t,e="Error",c=""){let d=document.createElement("div");d.classList.add("toast"),d.innerHTML=`
+`,"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,e,c){"use strict";t("./loader_build")(e);var d=t("./lib/dom"),p=t("./range").Range,g=t("./editor").Editor,a=t("./edit_session").EditSession,u=t("./undomanager").UndoManager,o=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"),e.config=t("./config"),e.edit=function(r,n){if(typeof r=="string"){var i=r;if(r=document.getElementById(i),!r)throw new Error("ace.edit can't find div #"+i)}if(r&&r.env&&r.env.editor instanceof g)return r.env.editor;var s="";if(r&&/input|textarea/i.test(r.tagName)){var l=r;s=l.value,r=d.createElement("pre"),l.parentNode.replaceChild(r,l)}else r&&(s=r.textContent,r.innerHTML="");var h=e.createEditSession(s),f=new g(new o(r),h,n),b={document:h,editor:f,onResize:f.resize.bind(f,null)};return l&&(b.textarea=l),f.on("destroy",function(){b.editor.container.env=null}),f.container.env=f.env=b,f},e.createEditSession=function(r,n){var i=new a(r,n);return i.setUndoManager(new u),i},e.Range=p,e.Editor=g,e.EditSession=a,e.UndoManager=u,e.VirtualRenderer=o,e.version=e.config.version});(function(){ace.require(["ace/ace"],function(t){t&&(t.config.init(!0),t.define=ace.define);var e=function(){return this}();!e&&typeof window<"u"&&(e=window),!e&&typeof self<"u"&&(e=self),e.ace||(e.ace=t);for(var c in t)t.hasOwnProperty(c)&&(e.ace[c]=t[c]);e.ace.default=e.ace,typeof Zo=="object"&&typeof mu=="object"&&Zo&&(Zo.exports=e.ace)})})()});var bu=_o((wa,Ea)=>{(function(t,e){typeof wa=="object"&&typeof Ea<"u"?Ea.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.DOMPurify=e())})(wa,function(){"use strict";let{entries:t,setPrototypeOf:e,isFrozen:c,getPrototypeOf:d,getOwnPropertyDescriptor:p}=Object,{freeze:g,seal:a,create:u}=Object,{apply:o,construct:r}=typeof Reflect<"u"&&Reflect;g||(g=function(ee){return ee}),a||(a=function(ee){return ee}),o||(o=function(ee,re,le){return ee.apply(re,le)}),r||(r=function(ee,re){return new ee(...re)});let n=L(Array.prototype.forEach),i=L(Array.prototype.pop),s=L(Array.prototype.push),l=L(String.prototype.toLowerCase),h=L(String.prototype.toString),f=L(String.prototype.match),b=L(String.prototype.replace),C=L(String.prototype.indexOf),w=L(String.prototype.trim),x=L(Object.prototype.hasOwnProperty),_=L(RegExp.prototype.test),v=M(TypeError),T=L(Number.isNaN);function L(Q){return function(ee){for(var re=arguments.length,le=new Array(re>1?re-1:0),W=1;W2&&arguments[2]!==void 0?arguments[2]:l;e&&e(Q,null);let le=ee.length;for(;le--;){let W=ee[le];if(typeof W=="string"){let G=re(W);G!==W&&(c(ee)||(ee[le]=G),W=G)}Q[W]=!0}return Q}function S(Q){for(let ee=0;ee/gm),Z=a(/\${[\w\W]*}/gm),K=a(/^data-[\-\w.\u00B7-\uFFFF]/),q=a(/^aria-[\-\w]+$/),oe=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ie=a(/^(?:\w+script|data):/i),ye=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ee=a(/^html$/i),be=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var U=Object.freeze({__proto__:null,MUSTACHE_EXPR:V,ERB_EXPR:z,TMPLIT_EXPR:Z,DATA_ATTR:K,ARIA_ATTR:q,IS_ALLOWED_URI:oe,IS_SCRIPT_OR_DATA:ie,ATTR_WHITESPACE:ye,DOCTYPE_NAME:Ee,CUSTOM_ELEMENT:be});let Y={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ae=function(){return typeof window>"u"?null:window},te=function(ee,re){if(typeof ee!="object"||typeof ee.createPolicy!="function")return null;let le=null,W="data-tt-policy-suffix";re&&re.hasAttribute(W)&&(le=re.getAttribute(W));let G="dompurify"+(le?"#"+le:"");try{return ee.createPolicy(G,{createHTML(ne){return ne},createScriptURL(ne){return ne}})}catch{return console.warn("TrustedTypes policy "+G+" could not be created."),null}};function de(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ae(),ee=fe=>de(fe);if(ee.version="3.1.3",ee.removed=[],!Q||!Q.document||Q.document.nodeType!==Y.document)return ee.isSupported=!1,ee;let{document:re}=Q,le=re,W=le.currentScript,{DocumentFragment:G,HTMLTemplateElement:ne,Node:me,Element:_e,NodeFilter:Ce,NamedNodeMap:Re=Q.NamedNodeMap||Q.MozNamedAttrMap,HTMLFormElement:Oe,DOMParser:Fe,trustedTypes:ke}=Q,We=_e.prototype,tn=m(We,"cloneNode"),ht=m(We,"nextSibling"),Mr=m(We,"childNodes"),Jt=m(We,"parentNode");if(typeof ne=="function"){let fe=re.createElement("template");fe.content&&fe.content.ownerDocument&&(re=fe.content.ownerDocument)}let Lt,vi="",{implementation:Ki,createNodeIterator:kr,createDocumentFragment:bi,getElementsByTagName:ft}=re,{importNode:it}=le,Qe={};ee.isSupported=typeof t=="function"&&typeof Jt=="function"&&Ki&&Ki.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:$t,ERB_EXPR:vt,TMPLIT_EXPR:rt,DATA_ATTR:mn,ARIA_ATTR:vn,IS_SCRIPT_OR_DATA:ei,ATTR_WHITESPACE:yl,CUSTOM_ELEMENT:Ah}=U,{IS_ALLOWED_URI:wl}=U,yt=null,El=E({},[...$,...A,...k,...I,...O]),wt=null,Tl=E({},[...N,...P,...B,...H]),ot=Object.seal(u(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Rr=null,Es=null,Cl=!0,Ts=!0,Sl=!1,_l=!0,Yi=!1,Cs=!0,yi=!1,Ss=!1,_s=!1,Ji=!1,wo=!1,Eo=!1,Al=!0,Ll=!1,Lh="user-content-",As=!0,Ir=!1,Xi={},Qi=null,$l=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),xl=null,Ml=E({},["audio","video","img","source","image","track"]),Ls=null,kl=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),To="http://www.w3.org/1998/Math/MathML",Co="http://www.w3.org/2000/svg",Fn="http://www.w3.org/1999/xhtml",Zi=Fn,$s=!1,xs=null,$h=E({},[To,Co,Fn],h),Or=null,xh=["application/xhtml+xml","text/html"],Mh="text/html",Et=null,qi=null,Rl=255,kh=re.createElement("form"),Il=function(F){return F instanceof RegExp||F instanceof Function},Ms=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(qi&&qi===F)){if((!F||typeof F!="object")&&(F={}),F=y(F),Or=xh.indexOf(F.PARSER_MEDIA_TYPE)===-1?Mh:F.PARSER_MEDIA_TYPE,Et=Or==="application/xhtml+xml"?h:l,yt=x(F,"ALLOWED_TAGS")?E({},F.ALLOWED_TAGS,Et):El,wt=x(F,"ALLOWED_ATTR")?E({},F.ALLOWED_ATTR,Et):Tl,xs=x(F,"ALLOWED_NAMESPACES")?E({},F.ALLOWED_NAMESPACES,h):$h,Ls=x(F,"ADD_URI_SAFE_ATTR")?E(y(kl),F.ADD_URI_SAFE_ATTR,Et):kl,xl=x(F,"ADD_DATA_URI_TAGS")?E(y(Ml),F.ADD_DATA_URI_TAGS,Et):Ml,Qi=x(F,"FORBID_CONTENTS")?E({},F.FORBID_CONTENTS,Et):$l,Rr=x(F,"FORBID_TAGS")?E({},F.FORBID_TAGS,Et):{},Es=x(F,"FORBID_ATTR")?E({},F.FORBID_ATTR,Et):{},Xi=x(F,"USE_PROFILES")?F.USE_PROFILES:!1,Cl=F.ALLOW_ARIA_ATTR!==!1,Ts=F.ALLOW_DATA_ATTR!==!1,Sl=F.ALLOW_UNKNOWN_PROTOCOLS||!1,_l=F.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Yi=F.SAFE_FOR_TEMPLATES||!1,Cs=F.SAFE_FOR_XML!==!1,yi=F.WHOLE_DOCUMENT||!1,Ji=F.RETURN_DOM||!1,wo=F.RETURN_DOM_FRAGMENT||!1,Eo=F.RETURN_TRUSTED_TYPE||!1,_s=F.FORCE_BODY||!1,Al=F.SANITIZE_DOM!==!1,Ll=F.SANITIZE_NAMED_PROPS||!1,As=F.KEEP_CONTENT!==!1,Ir=F.IN_PLACE||!1,wl=F.ALLOWED_URI_REGEXP||oe,Zi=F.NAMESPACE||Fn,ot=F.CUSTOM_ELEMENT_HANDLING||{},F.CUSTOM_ELEMENT_HANDLING&&Il(F.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ot.tagNameCheck=F.CUSTOM_ELEMENT_HANDLING.tagNameCheck),F.CUSTOM_ELEMENT_HANDLING&&Il(F.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ot.attributeNameCheck=F.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),F.CUSTOM_ELEMENT_HANDLING&&typeof F.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ot.allowCustomizedBuiltInElements=F.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Yi&&(Ts=!1),wo&&(Ji=!0),Xi&&(yt=E({},O),wt=[],Xi.html===!0&&(E(yt,$),E(wt,N)),Xi.svg===!0&&(E(yt,A),E(wt,P),E(wt,H)),Xi.svgFilters===!0&&(E(yt,k),E(wt,P),E(wt,H)),Xi.mathMl===!0&&(E(yt,I),E(wt,B),E(wt,H))),F.ADD_TAGS&&(yt===El&&(yt=y(yt)),E(yt,F.ADD_TAGS,Et)),F.ADD_ATTR&&(wt===Tl&&(wt=y(wt)),E(wt,F.ADD_ATTR,Et)),F.ADD_URI_SAFE_ATTR&&E(Ls,F.ADD_URI_SAFE_ATTR,Et),F.FORBID_CONTENTS&&(Qi===$l&&(Qi=y(Qi)),E(Qi,F.FORBID_CONTENTS,Et)),As&&(yt["#text"]=!0),yi&&E(yt,["html","head","body"]),yt.table&&(E(yt,["tbody"]),delete Rr.tbody),F.TRUSTED_TYPES_POLICY){if(typeof F.TRUSTED_TYPES_POLICY.createHTML!="function")throw v('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof F.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw v('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Lt=F.TRUSTED_TYPES_POLICY,vi=Lt.createHTML("")}else Lt===void 0&&(Lt=te(ke,W)),Lt!==null&&typeof vi=="string"&&(vi=Lt.createHTML(""));g&&g(F),qi=F}},Ol=E({},["mi","mo","mn","ms","mtext"]),Dl=E({},["foreignobject","annotation-xml"]),Rh=E({},["title","style","font","a","script"]),Pl=E({},[...A,...k,...R]),Nl=E({},[...I,...D]),Ih=function(F){let X=Jt(F);(!X||!X.tagName)&&(X={namespaceURI:Zi,tagName:"template"});let ue=l(F.tagName),Ae=l(X.tagName);return xs[F.namespaceURI]?F.namespaceURI===Co?X.namespaceURI===Fn?ue==="svg":X.namespaceURI===To?ue==="svg"&&(Ae==="annotation-xml"||Ol[Ae]):!!Pl[ue]:F.namespaceURI===To?X.namespaceURI===Fn?ue==="math":X.namespaceURI===Co?ue==="math"&&Dl[Ae]:!!Nl[ue]:F.namespaceURI===Fn?X.namespaceURI===Co&&!Dl[Ae]||X.namespaceURI===To&&!Ol[Ae]?!1:!Nl[ue]&&(Rh[ue]||!Pl[ue]):!!(Or==="application/xhtml+xml"&&xs[F.namespaceURI]):!1},nn=function(F){s(ee.removed,{element:F});try{F.parentNode.removeChild(F)}catch{F.remove()}},So=function(F,X){try{s(ee.removed,{attribute:X.getAttributeNode(F),from:X})}catch{s(ee.removed,{attribute:null,from:X})}if(X.removeAttribute(F),F==="is"&&!wt[F])if(Ji||wo)try{nn(X)}catch{}else try{X.setAttribute(F,"")}catch{}},Fl=function(F){let X=null,ue=null;if(_s)F=""+F;else{let xt=f(F,/^[\r\n\t ]+/);ue=xt&&xt[0]}Or==="application/xhtml+xml"&&Zi===Fn&&(F=''+F+"");let Ae=Lt?Lt.createHTML(F):F;if(Zi===Fn)try{X=new Fe().parseFromString(Ae,Or)}catch{}if(!X||!X.documentElement){X=Ki.createDocument(Zi,"template",null);try{X.documentElement.innerHTML=$s?vi:Ae}catch{}}let Rt=X.body||X.documentElement;return F&&ue&&Rt.insertBefore(re.createTextNode(ue),Rt.childNodes[0]||null),Zi===Fn?ft.call(X,yi?"html":"body")[0]:yi?X.documentElement:Rt},Hl=function(F){return kr.call(F.ownerDocument||F,F,Ce.SHOW_ELEMENT|Ce.SHOW_COMMENT|Ce.SHOW_TEXT|Ce.SHOW_PROCESSING_INSTRUCTION|Ce.SHOW_CDATA_SECTION,null)},Bl=function(F){return F instanceof Oe&&(typeof F.__depth<"u"&&typeof F.__depth!="number"||typeof F.__removalCount<"u"&&typeof F.__removalCount!="number"||typeof F.nodeName!="string"||typeof F.textContent!="string"||typeof F.removeChild!="function"||!(F.attributes instanceof Re)||typeof F.removeAttribute!="function"||typeof F.setAttribute!="function"||typeof F.namespaceURI!="string"||typeof F.insertBefore!="function"||typeof F.hasChildNodes!="function")},Ul=function(F){return typeof me=="function"&&F instanceof me},Hn=function(F,X,ue){Qe[F]&&n(Qe[F],Ae=>{Ae.call(ee,X,ue,qi)})},Wl=function(F){let X=null;if(Hn("beforeSanitizeElements",F,null),Bl(F))return nn(F),!0;let ue=Et(F.nodeName);if(Hn("uponSanitizeElement",F,{tagName:ue,allowedTags:yt}),F.hasChildNodes()&&!Ul(F.firstElementChild)&&_(/<[/\w]/g,F.innerHTML)&&_(/<[/\w]/g,F.textContent)||F.nodeType===Y.progressingInstruction||Cs&&F.nodeType===Y.comment&&_(/<[/\w]/g,F.data))return nn(F),!0;if(!yt[ue]||Rr[ue]){if(!Rr[ue]&&zl(ue)&&(ot.tagNameCheck instanceof RegExp&&_(ot.tagNameCheck,ue)||ot.tagNameCheck instanceof Function&&ot.tagNameCheck(ue)))return!1;if(As&&!Qi[ue]){let Ae=Jt(F)||F.parentNode,Rt=Mr(F)||F.childNodes;if(Rt&&Ae){let xt=Rt.length;for(let Bt=xt-1;Bt>=0;--Bt){let Ut=tn(Rt[Bt],!0);Ut.__removalCount=(F.__removalCount||0)+1,Ae.insertBefore(Ut,ht(F))}}}return nn(F),!0}return F instanceof _e&&!Ih(F)||(ue==="noscript"||ue==="noembed"||ue==="noframes")&&_(/<\/no(script|embed|frames)/i,F.innerHTML)?(nn(F),!0):(Yi&&F.nodeType===Y.text&&(X=F.textContent,n([$t,vt,rt],Ae=>{X=b(X,Ae," ")}),F.textContent!==X&&(s(ee.removed,{element:F.cloneNode()}),F.textContent=X)),Hn("afterSanitizeElements",F,null),!1)},Vl=function(F,X,ue){if(Al&&(X==="id"||X==="name")&&(ue in re||ue in kh||ue==="__depth"||ue==="__removalCount"))return!1;if(!(Ts&&!Es[X]&&_(mn,X))){if(!(Cl&&_(vn,X))){if(!wt[X]||Es[X]){if(!(zl(F)&&(ot.tagNameCheck instanceof RegExp&&_(ot.tagNameCheck,F)||ot.tagNameCheck instanceof Function&&ot.tagNameCheck(F))&&(ot.attributeNameCheck instanceof RegExp&&_(ot.attributeNameCheck,X)||ot.attributeNameCheck instanceof Function&&ot.attributeNameCheck(X))||X==="is"&&ot.allowCustomizedBuiltInElements&&(ot.tagNameCheck instanceof RegExp&&_(ot.tagNameCheck,ue)||ot.tagNameCheck instanceof Function&&ot.tagNameCheck(ue))))return!1}else if(!Ls[X]){if(!_(wl,b(ue,yl,""))){if(!((X==="src"||X==="xlink:href"||X==="href")&&F!=="script"&&C(ue,"data:")===0&&xl[F])){if(!(Sl&&!_(ei,b(ue,yl,"")))){if(ue)return!1}}}}}}return!0},zl=function(F){return F!=="annotation-xml"&&f(F,Ah)},jl=function(F){Hn("beforeSanitizeAttributes",F,null);let{attributes:X}=F;if(!X)return;let ue={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:wt},Ae=X.length;for(;Ae--;){let Rt=X[Ae],{name:xt,namespaceURI:Bt,value:Ut}=Rt,Dr=Et(xt),Pt=xt==="value"?Ut:w(Ut);if(ue.attrName=Dr,ue.attrValue=Pt,ue.keepAttr=!0,ue.forceKeepAttr=void 0,Hn("uponSanitizeAttribute",F,ue),Pt=ue.attrValue,ue.forceKeepAttr||(So(xt,F),!ue.keepAttr))continue;if(!_l&&_(/\/>/i,Pt)){So(xt,F);continue}if(Cs&&_(/((--!?|])>)|<\/(style|title)/i,Pt)){So(xt,F);continue}Yi&&n([$t,vt,rt],Kl=>{Pt=b(Pt,Kl," ")});let Gl=Et(F.nodeName);if(Vl(Gl,Dr,Pt)){if(Ll&&(Dr==="id"||Dr==="name")&&(So(xt,F),Pt=Lh+Pt),Lt&&typeof ke=="object"&&typeof ke.getAttributeType=="function"&&!Bt)switch(ke.getAttributeType(Gl,Dr)){case"TrustedHTML":{Pt=Lt.createHTML(Pt);break}case"TrustedScriptURL":{Pt=Lt.createScriptURL(Pt);break}}try{Bt?F.setAttributeNS(Bt,xt,Pt):F.setAttribute(xt,Pt),Bl(F)?nn(F):i(ee.removed)}catch{}}}Hn("afterSanitizeAttributes",F,null)},Oh=function fe(F){let X=null,ue=Hl(F);for(Hn("beforeSanitizeShadowDOM",F,null);X=ue.nextNode();){if(Hn("uponSanitizeShadowNode",X,null),Wl(X))continue;let Ae=Jt(X);X.nodeType===Y.element&&(Ae&&Ae.__depth?X.__depth=(X.__removalCount||0)+Ae.__depth+1:X.__depth=1),(X.__depth>=Rl||X.__depth<0||T(X.__depth))&&nn(X),X.content instanceof G&&(X.content.__depth=X.__depth,fe(X.content)),jl(X)}Hn("afterSanitizeShadowDOM",F,null)};return ee.sanitize=function(fe){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=null,ue=null,Ae=null,Rt=null;if($s=!fe,$s&&(fe=""),typeof fe!="string"&&!Ul(fe))if(typeof fe.toString=="function"){if(fe=fe.toString(),typeof fe!="string")throw v("dirty is not a string, aborting")}else throw v("toString is not a function");if(!ee.isSupported)return fe;if(Ss||Ms(F),ee.removed=[],typeof fe=="string"&&(Ir=!1),Ir){if(fe.nodeName){let Ut=Et(fe.nodeName);if(!yt[Ut]||Rr[Ut])throw v("root node is forbidden and cannot be sanitized in-place")}}else if(fe instanceof me)X=Fl(""),ue=X.ownerDocument.importNode(fe,!0),ue.nodeType===Y.element&&ue.nodeName==="BODY"||ue.nodeName==="HTML"?X=ue:X.appendChild(ue);else{if(!Ji&&!Yi&&!yi&&fe.indexOf("<")===-1)return Lt&&Eo?Lt.createHTML(fe):fe;if(X=Fl(fe),!X)return Ji?null:Eo?vi:""}X&&_s&&nn(X.firstChild);let xt=Hl(Ir?fe:X);for(;Ae=xt.nextNode();){if(Wl(Ae))continue;let Ut=Jt(Ae);Ae.nodeType===Y.element&&(Ut&&Ut.__depth?Ae.__depth=(Ae.__removalCount||0)+Ut.__depth+1:Ae.__depth=1),(Ae.__depth>=Rl||Ae.__depth<0||T(Ae.__depth))&&nn(Ae),Ae.content instanceof G&&(Ae.content.__depth=Ae.__depth,Oh(Ae.content)),jl(Ae)}if(Ir)return fe;if(Ji){if(wo)for(Rt=bi.call(X.ownerDocument);X.firstChild;)Rt.appendChild(X.firstChild);else Rt=X;return(wt.shadowroot||wt.shadowrootmode)&&(Rt=it.call(le,Rt,!0)),Rt}let Bt=yi?X.outerHTML:X.innerHTML;return yi&&yt["!doctype"]&&X.ownerDocument&&X.ownerDocument.doctype&&X.ownerDocument.doctype.name&&_(Ee,X.ownerDocument.doctype.name)&&(Bt=" +`+Bt),Yi&&n([$t,vt,rt],Ut=>{Bt=b(Bt,Ut," ")}),Lt&&Eo?Lt.createHTML(Bt):Bt},ee.setConfig=function(){let fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ms(fe),Ss=!0},ee.clearConfig=function(){qi=null,Ss=!1},ee.isValidAttribute=function(fe,F,X){qi||Ms({});let ue=Et(fe),Ae=Et(F);return Vl(ue,Ae,X)},ee.addHook=function(fe,F){typeof F=="function"&&(Qe[fe]=Qe[fe]||[],s(Qe[fe],F))},ee.removeHook=function(fe){if(Qe[fe])return i(Qe[fe])},ee.removeHooks=function(fe){Qe[fe]&&(Qe[fe]=[])},ee.removeAllHooks=function(){Qe={}},ee}var se=de();return se})});var Po={};Bh(Po,{afterMain:()=>ql,afterRead:()=>Xl,afterWrite:()=>nc,applyStyles:()=>tr,arrow:()=>$o,auto:()=>Pr,basePlacements:()=>Bn,beforeMain:()=>Ql,beforeRead:()=>Yl,beforeWrite:()=>ec,bottom:()=>pt,clippingParents:()=>Rs,computeStyles:()=>ir,createPopper:()=>jr,createPopperBase:()=>dc,createPopperLite:()=>hc,detectOverflow:()=>Ft,end:()=>ti,eventListeners:()=>rr,flip:()=>Ro,hide:()=>Io,left:()=>nt,main:()=>Zl,modifierPhases:()=>Os,offset:()=>Oo,placements:()=>Fr,popper:()=>wi,popperGenerator:()=>$i,popperOffsets:()=>ar,preventOverflow:()=>Do,read:()=>Jl,reference:()=>Is,right:()=>st,start:()=>Mn,top:()=>tt,variationPlacements:()=>Lo,viewport:()=>Nr,write:()=>tc});var tt="top",pt="bottom",st="right",nt="left",Pr="auto",Bn=[tt,pt,st,nt],Mn="start",ti="end",Rs="clippingParents",Nr="viewport",wi="popper",Is="reference",Lo=Bn.reduce(function(t,e){return t.concat([e+"-"+Mn,e+"-"+ti])},[]),Fr=[].concat(Bn,[Pr]).reduce(function(t,e){return t.concat([e,e+"-"+Mn,e+"-"+ti])},[]),Yl="beforeRead",Jl="read",Xl="afterRead",Ql="beforeMain",Zl="main",ql="afterMain",ec="beforeWrite",tc="write",nc="afterWrite",Os=[Yl,Jl,Xl,Ql,Zl,ql,ec,tc,nc];function Tt(t){return t?(t.nodeName||"").toLowerCase():null}function Ze(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function rn(t){var e=Ze(t).Element;return t instanceof e||t instanceof Element}function bt(t){var e=Ze(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function er(t){if(typeof ShadowRoot>"u")return!1;var e=Ze(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Wh(t){var e=t.state;Object.keys(e.elements).forEach(function(c){var d=e.styles[c]||{},p=e.attributes[c]||{},g=e.elements[c];!bt(g)||!Tt(g)||(Object.assign(g.style,d),Object.keys(p).forEach(function(a){var u=p[a];u===!1?g.removeAttribute(a):g.setAttribute(a,u===!0?"":u)}))})}function Vh(t){var e=t.state,c={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,c.popper),e.styles=c,e.elements.arrow&&Object.assign(e.elements.arrow.style,c.arrow),function(){Object.keys(e.elements).forEach(function(d){var p=e.elements[d],g=e.attributes[d]||{},a=Object.keys(e.styles.hasOwnProperty(d)?e.styles[d]:c[d]),u=a.reduce(function(o,r){return o[r]="",o},{});!bt(p)||!Tt(p)||(Object.assign(p.style,u),Object.keys(g).forEach(function(o){p.removeAttribute(o)}))})}}var tr={name:"applyStyles",enabled:!0,phase:"write",fn:Wh,effect:Vh,requires:["computeStyles"]};function Ct(t){return t.split("-")[0]}var bn=Math.max,Ei=Math.min,Un=Math.round;function nr(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Hr(){return!/^((?!chrome|android).)*safari/i.test(nr())}function on(t,e,c){e===void 0&&(e=!1),c===void 0&&(c=!1);var d=t.getBoundingClientRect(),p=1,g=1;e&&bt(t)&&(p=t.offsetWidth>0&&Un(d.width)/t.offsetWidth||1,g=t.offsetHeight>0&&Un(d.height)/t.offsetHeight||1);var a=rn(t)?Ze(t):window,u=a.visualViewport,o=!Hr()&&c,r=(d.left+(o&&u?u.offsetLeft:0))/p,n=(d.top+(o&&u?u.offsetTop:0))/g,i=d.width/p,s=d.height/g;return{width:i,height:s,top:n,right:r+i,bottom:n+s,left:r,x:r,y:n}}function Ti(t){var e=on(t),c=t.offsetWidth,d=t.offsetHeight;return Math.abs(e.width-c)<=1&&(c=e.width),Math.abs(e.height-d)<=1&&(d=e.height),{x:t.offsetLeft,y:t.offsetTop,width:c,height:d}}function Br(t,e){var c=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(c&&er(c)){var d=e;do{if(d&&t.isSameNode(d))return!0;d=d.parentNode||d.host}while(d)}return!1}function Nt(t){return Ze(t).getComputedStyle(t)}function Ds(t){return["table","td","th"].indexOf(Tt(t))>=0}function Mt(t){return((rn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Wn(t){return Tt(t)==="html"?t:t.assignedSlot||t.parentNode||(er(t)?t.host:null)||Mt(t)}function ic(t){return!bt(t)||Nt(t).position==="fixed"?null:t.offsetParent}function zh(t){var e=/firefox/i.test(nr()),c=/Trident/i.test(nr());if(c&&bt(t)){var d=Nt(t);if(d.position==="fixed")return null}var p=Wn(t);for(er(p)&&(p=p.host);bt(p)&&["html","body"].indexOf(Tt(p))<0;){var g=Nt(p);if(g.transform!=="none"||g.perspective!=="none"||g.contain==="paint"||["transform","perspective"].indexOf(g.willChange)!==-1||e&&g.willChange==="filter"||e&&g.filter&&g.filter!=="none")return p;p=p.parentNode}return null}function yn(t){for(var e=Ze(t),c=ic(t);c&&Ds(c)&&Nt(c).position==="static";)c=ic(c);return c&&(Tt(c)==="html"||Tt(c)==="body"&&Nt(c).position==="static")?e:c||zh(t)||e}function Ci(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Si(t,e,c){return bn(t,Ei(e,c))}function rc(t,e,c){var d=Si(t,e,c);return d>c?c:d}function Ur(){return{top:0,right:0,bottom:0,left:0}}function Wr(t){return Object.assign({},Ur(),t)}function Vr(t,e){return e.reduce(function(c,d){return c[d]=t,c},{})}var jh=function(e,c){return e=typeof e=="function"?e(Object.assign({},c.rects,{placement:c.placement})):e,Wr(typeof e!="number"?e:Vr(e,Bn))};function Gh(t){var e,c=t.state,d=t.name,p=t.options,g=c.elements.arrow,a=c.modifiersData.popperOffsets,u=Ct(c.placement),o=Ci(u),r=[nt,st].indexOf(u)>=0,n=r?"height":"width";if(!(!g||!a)){var i=jh(p.padding,c),s=Ti(g),l=o==="y"?tt:nt,h=o==="y"?pt:st,f=c.rects.reference[n]+c.rects.reference[o]-a[o]-c.rects.popper[n],b=a[o]-c.rects.reference[o],C=yn(g),w=C?o==="y"?C.clientHeight||0:C.clientWidth||0:0,x=f/2-b/2,_=i[l],v=w-s[n]-i[h],T=w/2-s[n]/2+x,L=Si(_,T,v),M=o;c.modifiersData[d]=(e={},e[M]=L,e.centerOffset=L-T,e)}}function Kh(t){var e=t.state,c=t.options,d=c.element,p=d===void 0?"[data-popper-arrow]":d;p!=null&&(typeof p=="string"&&(p=e.elements.popper.querySelector(p),!p)||Br(e.elements.popper,p)&&(e.elements.arrow=p))}var $o={name:"arrow",enabled:!0,phase:"main",fn:Gh,effect:Kh,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function sn(t){return t.split("-")[1]}var Yh={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Jh(t,e){var c=t.x,d=t.y,p=e.devicePixelRatio||1;return{x:Un(c*p)/p||0,y:Un(d*p)/p||0}}function oc(t){var e,c=t.popper,d=t.popperRect,p=t.placement,g=t.variation,a=t.offsets,u=t.position,o=t.gpuAcceleration,r=t.adaptive,n=t.roundOffsets,i=t.isFixed,s=a.x,l=s===void 0?0:s,h=a.y,f=h===void 0?0:h,b=typeof n=="function"?n({x:l,y:f}):{x:l,y:f};l=b.x,f=b.y;var C=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),x=nt,_=tt,v=window;if(r){var T=yn(c),L="clientHeight",M="clientWidth";if(T===Ze(c)&&(T=Mt(c),Nt(T).position!=="static"&&u==="absolute"&&(L="scrollHeight",M="scrollWidth")),T=T,p===tt||(p===nt||p===st)&&g===ti){_=pt;var E=i&&T===v&&v.visualViewport?v.visualViewport.height:T[L];f-=E-d.height,f*=o?1:-1}if(p===nt||(p===tt||p===pt)&&g===ti){x=st;var S=i&&T===v&&v.visualViewport?v.visualViewport.width:T[M];l-=S-d.width,l*=o?1:-1}}var y=Object.assign({position:u},r&&Yh),m=n===!0?Jh({x:l,y:f},Ze(c)):{x:l,y:f};if(l=m.x,f=m.y,o){var $;return Object.assign({},y,($={},$[_]=w?"0":"",$[x]=C?"0":"",$.transform=(v.devicePixelRatio||1)<=1?"translate("+l+"px, "+f+"px)":"translate3d("+l+"px, "+f+"px, 0)",$))}return Object.assign({},y,(e={},e[_]=w?f+"px":"",e[x]=C?l+"px":"",e.transform="",e))}function Xh(t){var e=t.state,c=t.options,d=c.gpuAcceleration,p=d===void 0?!0:d,g=c.adaptive,a=g===void 0?!0:g,u=c.roundOffsets,o=u===void 0?!0:u,r={placement:Ct(e.placement),variation:sn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:p,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,oc(Object.assign({},r,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:o})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,oc(Object.assign({},r,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var ir={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Xh,data:{}};var xo={passive:!0};function Qh(t){var e=t.state,c=t.instance,d=t.options,p=d.scroll,g=p===void 0?!0:p,a=d.resize,u=a===void 0?!0:a,o=Ze(e.elements.popper),r=[].concat(e.scrollParents.reference,e.scrollParents.popper);return g&&r.forEach(function(n){n.addEventListener("scroll",c.update,xo)}),u&&o.addEventListener("resize",c.update,xo),function(){g&&r.forEach(function(n){n.removeEventListener("scroll",c.update,xo)}),u&&o.removeEventListener("resize",c.update,xo)}}var rr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Qh,data:{}};var Zh={left:"right",right:"left",bottom:"top",top:"bottom"};function or(t){return t.replace(/left|right|bottom|top/g,function(e){return Zh[e]})}var qh={start:"end",end:"start"};function Mo(t){return t.replace(/start|end/g,function(e){return qh[e]})}function _i(t){var e=Ze(t),c=e.pageXOffset,d=e.pageYOffset;return{scrollLeft:c,scrollTop:d}}function Ai(t){return on(Mt(t)).left+_i(t).scrollLeft}function Ps(t,e){var c=Ze(t),d=Mt(t),p=c.visualViewport,g=d.clientWidth,a=d.clientHeight,u=0,o=0;if(p){g=p.width,a=p.height;var r=Hr();(r||!r&&e==="fixed")&&(u=p.offsetLeft,o=p.offsetTop)}return{width:g,height:a,x:u+Ai(t),y:o}}function Ns(t){var e,c=Mt(t),d=_i(t),p=(e=t.ownerDocument)==null?void 0:e.body,g=bn(c.scrollWidth,c.clientWidth,p?p.scrollWidth:0,p?p.clientWidth:0),a=bn(c.scrollHeight,c.clientHeight,p?p.scrollHeight:0,p?p.clientHeight:0),u=-d.scrollLeft+Ai(t),o=-d.scrollTop;return Nt(p||c).direction==="rtl"&&(u+=bn(c.clientWidth,p?p.clientWidth:0)-g),{width:g,height:a,x:u,y:o}}function Li(t){var e=Nt(t),c=e.overflow,d=e.overflowX,p=e.overflowY;return/auto|scroll|overlay|hidden/.test(c+p+d)}function ko(t){return["html","body","#document"].indexOf(Tt(t))>=0?t.ownerDocument.body:bt(t)&&Li(t)?t:ko(Wn(t))}function ni(t,e){var c;e===void 0&&(e=[]);var d=ko(t),p=d===((c=t.ownerDocument)==null?void 0:c.body),g=Ze(d),a=p?[g].concat(g.visualViewport||[],Li(d)?d:[]):d,u=e.concat(a);return p?u:u.concat(ni(Wn(a)))}function sr(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ef(t,e){var c=on(t,!1,e==="fixed");return c.top=c.top+t.clientTop,c.left=c.left+t.clientLeft,c.bottom=c.top+t.clientHeight,c.right=c.left+t.clientWidth,c.width=t.clientWidth,c.height=t.clientHeight,c.x=c.left,c.y=c.top,c}function sc(t,e,c){return e===Nr?sr(Ps(t,c)):rn(e)?ef(e,c):sr(Ns(Mt(t)))}function tf(t){var e=ni(Wn(t)),c=["absolute","fixed"].indexOf(Nt(t).position)>=0,d=c&&bt(t)?yn(t):t;return rn(d)?e.filter(function(p){return rn(p)&&Br(p,d)&&Tt(p)!=="body"}):[]}function Fs(t,e,c,d){var p=e==="clippingParents"?tf(t):[].concat(e),g=[].concat(p,[c]),a=g[0],u=g.reduce(function(o,r){var n=sc(t,r,d);return o.top=bn(n.top,o.top),o.right=Ei(n.right,o.right),o.bottom=Ei(n.bottom,o.bottom),o.left=bn(n.left,o.left),o},sc(t,a,d));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function zr(t){var e=t.reference,c=t.element,d=t.placement,p=d?Ct(d):null,g=d?sn(d):null,a=e.x+e.width/2-c.width/2,u=e.y+e.height/2-c.height/2,o;switch(p){case tt:o={x:a,y:e.y-c.height};break;case pt:o={x:a,y:e.y+e.height};break;case st:o={x:e.x+e.width,y:u};break;case nt:o={x:e.x-c.width,y:u};break;default:o={x:e.x,y:e.y}}var r=p?Ci(p):null;if(r!=null){var n=r==="y"?"height":"width";switch(g){case Mn:o[r]=o[r]-(e[n]/2-c[n]/2);break;case ti:o[r]=o[r]+(e[n]/2-c[n]/2);break;default:}}return o}function Ft(t,e){e===void 0&&(e={});var c=e,d=c.placement,p=d===void 0?t.placement:d,g=c.strategy,a=g===void 0?t.strategy:g,u=c.boundary,o=u===void 0?Rs:u,r=c.rootBoundary,n=r===void 0?Nr:r,i=c.elementContext,s=i===void 0?wi:i,l=c.altBoundary,h=l===void 0?!1:l,f=c.padding,b=f===void 0?0:f,C=Wr(typeof b!="number"?b:Vr(b,Bn)),w=s===wi?Is:wi,x=t.rects.popper,_=t.elements[h?w:s],v=Fs(rn(_)?_:_.contextElement||Mt(t.elements.popper),o,n,a),T=on(t.elements.reference),L=zr({reference:T,element:x,strategy:"absolute",placement:p}),M=sr(Object.assign({},x,L)),E=s===wi?M:T,S={top:v.top-E.top+C.top,bottom:E.bottom-v.bottom+C.bottom,left:v.left-E.left+C.left,right:E.right-v.right+C.right},y=t.modifiersData.offset;if(s===wi&&y){var m=y[p];Object.keys(S).forEach(function($){var A=[st,pt].indexOf($)>=0?1:-1,k=[tt,pt].indexOf($)>=0?"y":"x";S[$]+=m[k]*A})}return S}function Hs(t,e){e===void 0&&(e={});var c=e,d=c.placement,p=c.boundary,g=c.rootBoundary,a=c.padding,u=c.flipVariations,o=c.allowedAutoPlacements,r=o===void 0?Fr:o,n=sn(d),i=n?u?Lo:Lo.filter(function(h){return sn(h)===n}):Bn,s=i.filter(function(h){return r.indexOf(h)>=0});s.length===0&&(s=i);var l=s.reduce(function(h,f){return h[f]=Ft(t,{placement:f,boundary:p,rootBoundary:g,padding:a})[Ct(f)],h},{});return Object.keys(l).sort(function(h,f){return l[h]-l[f]})}function nf(t){if(Ct(t)===Pr)return[];var e=or(t);return[Mo(t),e,Mo(e)]}function rf(t){var e=t.state,c=t.options,d=t.name;if(!e.modifiersData[d]._skip){for(var p=c.mainAxis,g=p===void 0?!0:p,a=c.altAxis,u=a===void 0?!0:a,o=c.fallbackPlacements,r=c.padding,n=c.boundary,i=c.rootBoundary,s=c.altBoundary,l=c.flipVariations,h=l===void 0?!0:l,f=c.allowedAutoPlacements,b=e.options.placement,C=Ct(b),w=C===b,x=o||(w||!h?[or(b)]:nf(b)),_=[b].concat(x).reduce(function(V,z){return V.concat(Ct(z)===Pr?Hs(e,{placement:z,boundary:n,rootBoundary:i,padding:r,flipVariations:h,allowedAutoPlacements:f}):z)},[]),v=e.rects.reference,T=e.rects.popper,L=new Map,M=!0,E=_[0],S=0;S<_.length;S++){var y=_[S],m=Ct(y),$=sn(y)===Mn,A=[tt,pt].indexOf(m)>=0,k=A?"width":"height",R=Ft(e,{placement:y,boundary:n,rootBoundary:i,altBoundary:s,padding:r}),I=A?$?st:nt:$?pt:tt;v[k]>T[k]&&(I=or(I));var D=or(I),O=[];if(g&&O.push(R[m]<=0),u&&O.push(R[I]<=0,R[D]<=0),O.every(function(V){return V})){E=y,M=!1;break}L.set(y,O)}if(M)for(var N=h?3:1,P=function(z){var Z=_.find(function(K){var q=L.get(K);if(q)return q.slice(0,z).every(function(oe){return oe})});if(Z)return E=Z,"break"},B=N;B>0;B--){var H=P(B);if(H==="break")break}e.placement!==E&&(e.modifiersData[d]._skip=!0,e.placement=E,e.reset=!0)}}var Ro={name:"flip",enabled:!0,phase:"main",fn:rf,requiresIfExists:["offset"],data:{_skip:!1}};function ac(t,e,c){return c===void 0&&(c={x:0,y:0}),{top:t.top-e.height-c.y,right:t.right-e.width+c.x,bottom:t.bottom-e.height+c.y,left:t.left-e.width-c.x}}function lc(t){return[tt,st,pt,nt].some(function(e){return t[e]>=0})}function of(t){var e=t.state,c=t.name,d=e.rects.reference,p=e.rects.popper,g=e.modifiersData.preventOverflow,a=Ft(e,{elementContext:"reference"}),u=Ft(e,{altBoundary:!0}),o=ac(a,d),r=ac(u,p,g),n=lc(o),i=lc(r);e.modifiersData[c]={referenceClippingOffsets:o,popperEscapeOffsets:r,isReferenceHidden:n,hasPopperEscaped:i},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":n,"data-popper-escaped":i})}var Io={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:of};function sf(t,e,c){var d=Ct(t),p=[nt,tt].indexOf(d)>=0?-1:1,g=typeof c=="function"?c(Object.assign({},e,{placement:t})):c,a=g[0],u=g[1];return a=a||0,u=(u||0)*p,[nt,st].indexOf(d)>=0?{x:u,y:a}:{x:a,y:u}}function af(t){var e=t.state,c=t.options,d=t.name,p=c.offset,g=p===void 0?[0,0]:p,a=Fr.reduce(function(n,i){return n[i]=sf(i,e.rects,g),n},{}),u=a[e.placement],o=u.x,r=u.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=o,e.modifiersData.popperOffsets.y+=r),e.modifiersData[d]=a}var Oo={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:af};function lf(t){var e=t.state,c=t.name;e.modifiersData[c]=zr({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var ar={name:"popperOffsets",enabled:!0,phase:"read",fn:lf,data:{}};function Bs(t){return t==="x"?"y":"x"}function cf(t){var e=t.state,c=t.options,d=t.name,p=c.mainAxis,g=p===void 0?!0:p,a=c.altAxis,u=a===void 0?!1:a,o=c.boundary,r=c.rootBoundary,n=c.altBoundary,i=c.padding,s=c.tether,l=s===void 0?!0:s,h=c.tetherOffset,f=h===void 0?0:h,b=Ft(e,{boundary:o,rootBoundary:r,padding:i,altBoundary:n}),C=Ct(e.placement),w=sn(e.placement),x=!w,_=Ci(C),v=Bs(_),T=e.modifiersData.popperOffsets,L=e.rects.reference,M=e.rects.popper,E=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,S=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),y=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,m={x:0,y:0};if(T){if(g){var $,A=_==="y"?tt:nt,k=_==="y"?pt:st,R=_==="y"?"height":"width",I=T[_],D=I+b[A],O=I-b[k],N=l?-M[R]/2:0,P=w===Mn?L[R]:M[R],B=w===Mn?-M[R]:-L[R],H=e.elements.arrow,V=l&&H?Ti(H):{width:0,height:0},z=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Ur(),Z=z[A],K=z[k],q=Si(0,L[R],V[R]),oe=x?L[R]/2-N-q-Z-S.mainAxis:P-q-Z-S.mainAxis,ie=x?-L[R]/2+N+q+K+S.mainAxis:B+q+K+S.mainAxis,ye=e.elements.arrow&&yn(e.elements.arrow),Ee=ye?_==="y"?ye.clientTop||0:ye.clientLeft||0:0,be=($=y?.[_])!=null?$:0,U=I+oe-be-Ee,Y=I+ie-be,ae=Si(l?Ei(D,U):D,I,l?bn(O,Y):O);T[_]=ae,m[_]=ae-I}if(u){var te,de=_==="x"?tt:nt,se=_==="x"?pt:st,Q=T[v],ee=v==="y"?"height":"width",re=Q+b[de],le=Q-b[se],W=[tt,nt].indexOf(C)!==-1,G=(te=y?.[v])!=null?te:0,ne=W?re:Q-L[ee]-M[ee]-G+S.altAxis,me=W?Q+L[ee]+M[ee]-G-S.altAxis:le,_e=l&&W?rc(ne,Q,me):Si(l?ne:re,Q,l?me:le);T[v]=_e,m[v]=_e-Q}e.modifiersData[d]=m}}var Do={name:"preventOverflow",enabled:!0,phase:"main",fn:cf,requiresIfExists:["offset"]};function Us(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ws(t){return t===Ze(t)||!bt(t)?_i(t):Us(t)}function uf(t){var e=t.getBoundingClientRect(),c=Un(e.width)/t.offsetWidth||1,d=Un(e.height)/t.offsetHeight||1;return c!==1||d!==1}function Vs(t,e,c){c===void 0&&(c=!1);var d=bt(e),p=bt(e)&&uf(e),g=Mt(e),a=on(t,p,c),u={scrollLeft:0,scrollTop:0},o={x:0,y:0};return(d||!d&&!c)&&((Tt(e)!=="body"||Li(g))&&(u=Ws(e)),bt(e)?(o=on(e,!0),o.x+=e.clientLeft,o.y+=e.clientTop):g&&(o.x=Ai(g))),{x:a.left+u.scrollLeft-o.x,y:a.top+u.scrollTop-o.y,width:a.width,height:a.height}}function df(t){var e=new Map,c=new Set,d=[];t.forEach(function(g){e.set(g.name,g)});function p(g){c.add(g.name);var a=[].concat(g.requires||[],g.requiresIfExists||[]);a.forEach(function(u){if(!c.has(u)){var o=e.get(u);o&&p(o)}}),d.push(g)}return t.forEach(function(g){c.has(g.name)||p(g)}),d}function zs(t){var e=df(t);return Os.reduce(function(c,d){return c.concat(e.filter(function(p){return p.phase===d}))},[])}function js(t){var e;return function(){return e||(e=new Promise(function(c){Promise.resolve().then(function(){e=void 0,c(t())})})),e}}function Gs(t){var e=t.reduce(function(c,d){var p=c[d.name];return c[d.name]=p?Object.assign({},p,d,{options:Object.assign({},p.options,d.options),data:Object.assign({},p.data,d.data)}):d,c},{});return Object.keys(e).map(function(c){return e[c]})}var cc={placement:"bottom",modifiers:[],strategy:"absolute"};function uc(){for(var t=arguments.length,e=new Array(t),c=0;c(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(e,c)=>`#${CSS.escape(c)}`)),t),mf=t=>t==null?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),vf=t=>{do t+=Math.floor(Math.random()*pf);while(document.getElementById(t));return t},bf=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:c}=window.getComputedStyle(t),d=Number.parseFloat(e),p=Number.parseFloat(c);return!d&&!p?0:(e=e.split(",")[0],c=c.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(c))*gf)},Wc=t=>{t.dispatchEvent(new Event(la))},Vn=t=>!t||typeof t!="object"?!1:(typeof t.jquery<"u"&&(t=t[0]),typeof t.nodeType<"u"),ri=t=>Vn(t)?t.jquery?t[0]:t:typeof t=="string"&&t.length>0?document.querySelector(Uc(t)):null,vr=t=>{if(!Vn(t)||t.getClientRects().length===0)return!1;let e=getComputedStyle(t).getPropertyValue("visibility")==="visible",c=t.closest("details:not([open])");if(!c)return e;if(c!==t){let d=t.closest("summary");if(d&&d.parentNode!==c||d===null)return!1}return e},oi=t=>!t||t.nodeType!==Node.ELEMENT_NODE||t.classList.contains("disabled")?!0:typeof t.disabled<"u"?t.disabled:t.hasAttribute("disabled")&&t.getAttribute("disabled")!=="false",Vc=t=>{if(!document.documentElement.attachShadow)return null;if(typeof t.getRootNode=="function"){let e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?Vc(t.parentNode):null},jo=()=>{},Xr=t=>{t.offsetHeight},zc=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Ys=[],yf=t=>{document.readyState==="loading"?(Ys.length||document.addEventListener("DOMContentLoaded",()=>{for(let e of Ys)e()}),Ys.push(t)):t()},an=()=>document.documentElement.dir==="rtl",un=t=>{yf(()=>{let e=zc();if(e){let c=t.NAME,d=e.fn[c];e.fn[c]=t.jQueryInterface,e.fn[c].Constructor=t,e.fn[c].noConflict=()=>(e.fn[c]=d,t.jQueryInterface)}})},Wt=(t,e=[],c=t)=>typeof t=="function"?t(...e):c,jc=(t,e,c=!0)=>{if(!c){Wt(t);return}let d=5,p=bf(e)+d,g=!1,a=({target:u})=>{u===e&&(g=!0,e.removeEventListener(la,a),Wt(t))};e.addEventListener(la,a),setTimeout(()=>{g||Wc(e)},p)},ha=(t,e,c,d)=>{let p=t.length,g=t.indexOf(e);return g===-1?!c&&d?t[p-1]:t[0]:(g+=c?1:-1,d&&(g=(g+p)%p),t[Math.max(0,Math.min(g,p-1))])},wf=/[^.]*(?=\..*)\.|.*/,Ef=/\..*/,Tf=/::\d+$/,Js={},fc=1,Gc={mouseenter:"mouseover",mouseleave:"mouseout"},Cf=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function Kc(t,e){return e&&`${e}::${fc++}`||t.uidEvent||fc++}function Yc(t){let e=Kc(t);return t.uidEvent=e,Js[e]=Js[e]||{},Js[e]}function Sf(t,e){return function c(d){return fa(d,{delegateTarget:t}),c.oneOff&&J.off(t,d.type,e),e.apply(t,[d])}}function _f(t,e,c){return function d(p){let g=t.querySelectorAll(e);for(let{target:a}=p;a&&a!==this;a=a.parentNode)for(let u of g)if(u===a)return fa(p,{delegateTarget:a}),d.oneOff&&J.off(t,p.type,e,c),c.apply(a,[p])}}function Jc(t,e,c=null){return Object.values(t).find(d=>d.callable===e&&d.delegationSelector===c)}function Xc(t,e,c){let d=typeof e=="string",p=d?c:e||c,g=Qc(t);return Cf.has(g)||(g=t),[d,p,g]}function pc(t,e,c,d,p){if(typeof e!="string"||!t)return;let[g,a,u]=Xc(e,c,d);e in Gc&&(a=(h=>function(f){if(!f.relatedTarget||f.relatedTarget!==f.delegateTarget&&!f.delegateTarget.contains(f.relatedTarget))return h.call(this,f)})(a));let o=Yc(t),r=o[u]||(o[u]={}),n=Jc(r,a,g?c:null);if(n){n.oneOff=n.oneOff&&p;return}let i=Kc(a,e.replace(wf,"")),s=g?_f(t,c,a):Sf(t,a);s.delegationSelector=g?c:null,s.callable=a,s.oneOff=p,s.uidEvent=i,r[i]=s,t.addEventListener(u,s,g)}function ca(t,e,c,d,p){let g=Jc(e[c],d,p);g&&(t.removeEventListener(c,g,!!p),delete e[c][g.uidEvent])}function Af(t,e,c,d){let p=e[c]||{};for(let[g,a]of Object.entries(p))g.includes(d)&&ca(t,e,c,a.callable,a.delegationSelector)}function Qc(t){return t=t.replace(Ef,""),Gc[t]||t}var J={on(t,e,c,d){pc(t,e,c,d,!1)},one(t,e,c,d){pc(t,e,c,d,!0)},off(t,e,c,d){if(typeof e!="string"||!t)return;let[p,g,a]=Xc(e,c,d),u=a!==e,o=Yc(t),r=o[a]||{},n=e.startsWith(".");if(typeof g<"u"){if(!Object.keys(r).length)return;ca(t,o,a,g,p?c:null);return}if(n)for(let i of Object.keys(o))Af(t,o,i,e.slice(1));for(let[i,s]of Object.entries(r)){let l=i.replace(Tf,"");(!u||e.includes(l))&&ca(t,o,a,s.callable,s.delegationSelector)}},trigger(t,e,c){if(typeof e!="string"||!t)return null;let d=zc(),p=Qc(e),g=e!==p,a=null,u=!0,o=!0,r=!1;g&&d&&(a=d.Event(e,c),d(t).trigger(a),u=!a.isPropagationStopped(),o=!a.isImmediatePropagationStopped(),r=a.isDefaultPrevented());let n=fa(new Event(e,{bubbles:u,cancelable:!0}),c);return r&&n.preventDefault(),o&&t.dispatchEvent(n),n.defaultPrevented&&a&&a.preventDefault(),n}};function fa(t,e={}){for(let[c,d]of Object.entries(e))try{t[c]=d}catch{Object.defineProperty(t,c,{configurable:!0,get(){return d}})}return t}function gc(t){if(t==="true")return!0;if(t==="false")return!1;if(t===Number(t).toString())return Number(t);if(t===""||t==="null")return null;if(typeof t!="string")return t;try{return JSON.parse(decodeURIComponent(t))}catch{return t}}function Xs(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}var zn={setDataAttribute(t,e,c){t.setAttribute(`data-bs-${Xs(e)}`,c)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${Xs(e)}`)},getDataAttributes(t){if(!t)return{};let e={},c=Object.keys(t.dataset).filter(d=>d.startsWith("bs")&&!d.startsWith("bsConfig"));for(let d of c){let p=d.replace(/^bs/,"");p=p.charAt(0).toLowerCase()+p.slice(1,p.length),e[p]=gc(t.dataset[d])}return e},getDataAttribute(t,e){return gc(t.getAttribute(`data-bs-${Xs(e)}`))}},ki=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,c){let d=Vn(c)?zn.getDataAttribute(c,"config"):{};return{...this.constructor.Default,...typeof d=="object"?d:{},...Vn(c)?zn.getDataAttributes(c):{},...typeof e=="object"?e:{}}}_typeCheckConfig(e,c=this.constructor.DefaultType){for(let[d,p]of Object.entries(c)){let g=e[d],a=Vn(g)?"element":mf(g);if(!new RegExp(p).test(a))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${d}" provided type "${a}" but expected type "${p}".`)}}},Lf="5.3.2",Xt=class extends ki{constructor(e,c){super(),e=ri(e),e&&(this._element=e,this._config=this._getConfig(c),Ks.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Ks.remove(this._element,this.constructor.DATA_KEY),J.off(this._element,this.constructor.EVENT_KEY);for(let e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,c,d=!0){jc(e,c,d)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Ks.get(ri(e),this.DATA_KEY)}static getOrCreateInstance(e,c={}){return this.getInstance(e)||new this(e,typeof c=="object"?c:null)}static get VERSION(){return Lf}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}},Qs=t=>{let e=t.getAttribute("data-bs-target");if(!e||e==="#"){let c=t.getAttribute("href");if(!c||!c.includes("#")&&!c.startsWith("."))return null;c.includes("#")&&!c.startsWith("#")&&(c=`#${c.split("#")[1]}`),e=c&&c!=="#"?Uc(c.trim()):null}return e},ge={find(t,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,t))},findOne(t,e=document.documentElement){return Element.prototype.querySelector.call(e,t)},children(t,e){return[].concat(...t.children).filter(c=>c.matches(e))},parents(t,e){let c=[],d=t.parentNode.closest(e);for(;d;)c.push(d),d=d.parentNode.closest(e);return c},prev(t,e){let c=t.previousElementSibling;for(;c;){if(c.matches(e))return[c];c=c.previousElementSibling}return[]},next(t,e){let c=t.nextElementSibling;for(;c;){if(c.matches(e))return[c];c=c.nextElementSibling}return[]},focusableChildren(t){let e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(c=>`${c}:not([tabindex^="-"])`).join(",");return this.find(e,t).filter(c=>!oi(c)&&vr(c))},getSelectorFromElement(t){let e=Qs(t);return e&&ge.findOne(e)?e:null},getElementFromSelector(t){let e=Qs(t);return e?ge.findOne(e):null},getMultipleElementsFromSelector(t){let e=Qs(t);return e?ge.find(e):[]}},Jo=(t,e="hide")=>{let c=`click.dismiss${t.EVENT_KEY}`,d=t.NAME;J.on(document,c,`[data-bs-dismiss="${d}"]`,function(p){if(["A","AREA"].includes(this.tagName)&&p.preventDefault(),oi(this))return;let g=ge.getElementFromSelector(this)||this.closest(`.${d}`);t.getOrCreateInstance(g)[e]()})},$f="alert",xf="bs.alert",Zc=`.${xf}`,Mf=`close${Zc}`,kf=`closed${Zc}`,Rf="fade",If="show",fr=class extends Xt{static get NAME(){return $f}close(){if(J.trigger(this._element,Mf).defaultPrevented)return;this._element.classList.remove(If);let c=this._element.classList.contains(Rf);this._queueCallback(()=>this._destroyElement(),this._element,c)}_destroyElement(){this._element.remove(),J.trigger(this._element,kf),this.dispose()}static jQueryInterface(e){return this.each(function(){let c=fr.getOrCreateInstance(this);if(typeof e=="string"){if(c[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);c[e](this)}})}};Jo(fr,"close");un(fr);var Of="button",Df="bs.button",Pf=`.${Df}`,Nf=".data-api",Ff="active",mc='[data-bs-toggle="button"]',Hf=`click${Pf}${Nf}`,pr=class extends Xt{static get NAME(){return Of}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(Ff))}static jQueryInterface(e){return this.each(function(){let c=pr.getOrCreateInstance(this);e==="toggle"&&c[e]()})}};J.on(document,Hf,mc,t=>{t.preventDefault();let e=t.target.closest(mc);pr.getOrCreateInstance(e).toggle()});un(pr);var Bf="swipe",br=".bs.swipe",Uf=`touchstart${br}`,Wf=`touchmove${br}`,Vf=`touchend${br}`,zf=`pointerdown${br}`,jf=`pointerup${br}`,Gf="touch",Kf="pen",Yf="pointer-event",Jf=40,Xf={endCallback:null,leftCallback:null,rightCallback:null},Qf={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"},gr=class extends ki{constructor(e,c){super(),this._element=e,!(!e||!gr.isSupported())&&(this._config=this._getConfig(c),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return Xf}static get DefaultType(){return Qf}static get NAME(){return Bf}dispose(){J.off(this._element,br)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),Wt(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){let e=Math.abs(this._deltaX);if(e<=Jf)return;let c=e/this._deltaX;this._deltaX=0,c&&Wt(c>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(J.on(this._element,zf,e=>this._start(e)),J.on(this._element,jf,e=>this._end(e)),this._element.classList.add(Yf)):(J.on(this._element,Uf,e=>this._start(e)),J.on(this._element,Wf,e=>this._move(e)),J.on(this._element,Vf,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===Kf||e.pointerType===Gf)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}},Zf="carousel",qf="bs.carousel",ci=`.${qf}`,qc=".data-api",ep="ArrowLeft",tp="ArrowRight",np=500,Gr="next",lr="prev",ur="left",Vo="right",ip=`slide${ci}`,Zs=`slid${ci}`,rp=`keydown${ci}`,op=`mouseenter${ci}`,sp=`mouseleave${ci}`,ap=`dragstart${ci}`,lp=`load${ci}${qc}`,cp=`click${ci}${qc}`,eu="carousel",No="active",up="slide",dp="carousel-item-end",hp="carousel-item-start",fp="carousel-item-next",pp="carousel-item-prev",tu=".active",nu=".carousel-item",gp=tu+nu,mp=".carousel-item img",vp=".carousel-indicators",bp="[data-bs-slide], [data-bs-slide-to]",yp='[data-bs-ride="carousel"]',wp={[ep]:Vo,[tp]:ur},Ep={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Tp={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"},Ri=class extends Xt{constructor(e,c){super(e,c),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=ge.findOne(vp,this._element),this._addEventListeners(),this._config.ride===eu&&this.cycle()}static get Default(){return Ep}static get DefaultType(){return Tp}static get NAME(){return Zf}next(){this._slide(Gr)}nextWhenVisible(){!document.hidden&&vr(this._element)&&this.next()}prev(){this._slide(lr)}pause(){this._isSliding&&Wc(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){J.one(this._element,Zs,()=>this.cycle());return}this.cycle()}}to(e){let c=this._getItems();if(e>c.length-1||e<0)return;if(this._isSliding){J.one(this._element,Zs,()=>this.to(e));return}let d=this._getItemIndex(this._getActive());if(d===e)return;let p=e>d?Gr:lr;this._slide(p,c[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&J.on(this._element,rp,e=>this._keydown(e)),this._config.pause==="hover"&&(J.on(this._element,op,()=>this.pause()),J.on(this._element,sp,()=>this._maybeEnableCycle())),this._config.touch&&gr.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(let d of ge.find(mp,this._element))J.on(d,ap,p=>p.preventDefault());let c={leftCallback:()=>this._slide(this._directionToOrder(ur)),rightCallback:()=>this._slide(this._directionToOrder(Vo)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),np+this._config.interval))}};this._swipeHelper=new gr(this._element,c)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;let c=wp[e.key];c&&(e.preventDefault(),this._slide(this._directionToOrder(c)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;let c=ge.findOne(tu,this._indicatorsElement);c.classList.remove(No),c.removeAttribute("aria-current");let d=ge.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);d&&(d.classList.add(No),d.setAttribute("aria-current","true"))}_updateInterval(){let e=this._activeElement||this._getActive();if(!e)return;let c=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=c||this._config.defaultInterval}_slide(e,c=null){if(this._isSliding)return;let d=this._getActive(),p=e===Gr,g=c||ha(this._getItems(),d,p,this._config.wrap);if(g===d)return;let a=this._getItemIndex(g),u=l=>J.trigger(this._element,l,{relatedTarget:g,direction:this._orderToDirection(e),from:this._getItemIndex(d),to:a});if(u(ip).defaultPrevented||!d||!g)return;let r=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(a),this._activeElement=g;let n=p?hp:dp,i=p?fp:pp;g.classList.add(i),Xr(g),d.classList.add(n),g.classList.add(n);let s=()=>{g.classList.remove(n,i),g.classList.add(No),d.classList.remove(No,i,n),this._isSliding=!1,u(Zs)};this._queueCallback(s,d,this._isAnimated()),r&&this.cycle()}_isAnimated(){return this._element.classList.contains(up)}_getActive(){return ge.findOne(gp,this._element)}_getItems(){return ge.find(nu,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return an()?e===ur?lr:Gr:e===ur?Gr:lr}_orderToDirection(e){return an()?e===lr?ur:Vo:e===lr?Vo:ur}static jQueryInterface(e){return this.each(function(){let c=Ri.getOrCreateInstance(this,e);if(typeof e=="number"){c.to(e);return}if(typeof e=="string"){if(c[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);c[e]()}})}};J.on(document,cp,bp,function(t){let e=ge.getElementFromSelector(this);if(!e||!e.classList.contains(eu))return;t.preventDefault();let c=Ri.getOrCreateInstance(e),d=this.getAttribute("data-bs-slide-to");if(d){c.to(d),c._maybeEnableCycle();return}if(zn.getDataAttribute(this,"slide")==="next"){c.next(),c._maybeEnableCycle();return}c.prev(),c._maybeEnableCycle()});J.on(window,lp,()=>{let t=ge.find(yp);for(let e of t)Ri.getOrCreateInstance(e)});un(Ri);var Cp="collapse",Sp="bs.collapse",Qr=`.${Sp}`,_p=".data-api",Ap=`show${Qr}`,Lp=`shown${Qr}`,$p=`hide${Qr}`,xp=`hidden${Qr}`,Mp=`click${Qr}${_p}`,qs="show",hr="collapse",Fo="collapsing",kp="collapsed",Rp=`:scope .${hr} .${hr}`,Ip="collapse-horizontal",Op="width",Dp="height",Pp=".collapse.show, .collapse.collapsing",ua='[data-bs-toggle="collapse"]',Np={parent:null,toggle:!0},Fp={parent:"(null|element)",toggle:"boolean"},Ii=class extends Xt{constructor(e,c){super(e,c),this._isTransitioning=!1,this._triggerArray=[];let d=ge.find(ua);for(let p of d){let g=ge.getSelectorFromElement(p),a=ge.find(g).filter(u=>u===this._element);g!==null&&a.length&&this._triggerArray.push(p)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Np}static get DefaultType(){return Fp}static get NAME(){return Cp}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(Pp).filter(u=>u!==this._element).map(u=>Ii.getOrCreateInstance(u,{toggle:!1}))),e.length&&e[0]._isTransitioning||J.trigger(this._element,Ap).defaultPrevented)return;for(let u of e)u.hide();let d=this._getDimension();this._element.classList.remove(hr),this._element.classList.add(Fo),this._element.style[d]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;let p=()=>{this._isTransitioning=!1,this._element.classList.remove(Fo),this._element.classList.add(hr,qs),this._element.style[d]="",J.trigger(this._element,Lp)},a=`scroll${d[0].toUpperCase()+d.slice(1)}`;this._queueCallback(p,this._element,!0),this._element.style[d]=`${this._element[a]}px`}hide(){if(this._isTransitioning||!this._isShown()||J.trigger(this._element,$p).defaultPrevented)return;let c=this._getDimension();this._element.style[c]=`${this._element.getBoundingClientRect()[c]}px`,Xr(this._element),this._element.classList.add(Fo),this._element.classList.remove(hr,qs);for(let p of this._triggerArray){let g=ge.getElementFromSelector(p);g&&!this._isShown(g)&&this._addAriaAndCollapsedClass([p],!1)}this._isTransitioning=!0;let d=()=>{this._isTransitioning=!1,this._element.classList.remove(Fo),this._element.classList.add(hr),J.trigger(this._element,xp)};this._element.style[c]="",this._queueCallback(d,this._element,!0)}_isShown(e=this._element){return e.classList.contains(qs)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=ri(e.parent),e}_getDimension(){return this._element.classList.contains(Ip)?Op:Dp}_initializeChildren(){if(!this._config.parent)return;let e=this._getFirstLevelChildren(ua);for(let c of e){let d=ge.getElementFromSelector(c);d&&this._addAriaAndCollapsedClass([c],this._isShown(d))}}_getFirstLevelChildren(e){let c=ge.find(Rp,this._config.parent);return ge.find(e,this._config.parent).filter(d=>!c.includes(d))}_addAriaAndCollapsedClass(e,c){if(e.length)for(let d of e)d.classList.toggle(kp,!c),d.setAttribute("aria-expanded",c)}static jQueryInterface(e){let c={};return typeof e=="string"&&/show|hide/.test(e)&&(c.toggle=!1),this.each(function(){let d=Ii.getOrCreateInstance(this,c);if(typeof e=="string"){if(typeof d[e]>"u")throw new TypeError(`No method named "${e}"`);d[e]()}})}};J.on(document,Mp,ua,function(t){(t.target.tagName==="A"||t.delegateTarget&&t.delegateTarget.tagName==="A")&&t.preventDefault();for(let e of ge.getMultipleElementsFromSelector(this))Ii.getOrCreateInstance(e,{toggle:!1}).toggle()});un(Ii);var vc="dropdown",Hp="bs.dropdown",Oi=`.${Hp}`,pa=".data-api",Bp="Escape",bc="Tab",Up="ArrowUp",yc="ArrowDown",Wp=2,Vp=`hide${Oi}`,zp=`hidden${Oi}`,jp=`show${Oi}`,Gp=`shown${Oi}`,iu=`click${Oi}${pa}`,ru=`keydown${Oi}${pa}`,Kp=`keyup${Oi}${pa}`,dr="show",Yp="dropup",Jp="dropend",Xp="dropstart",Qp="dropup-center",Zp="dropdown-center",xi='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',qp=`${xi}.${dr}`,zo=".dropdown-menu",eg=".navbar",tg=".navbar-nav",ng=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",ig=an()?"top-end":"top-start",rg=an()?"top-start":"top-end",og=an()?"bottom-end":"bottom-start",sg=an()?"bottom-start":"bottom-end",ag=an()?"left-start":"right-start",lg=an()?"right-start":"left-start",cg="top",ug="bottom",dg={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},hg={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"},Vt=class extends Xt{constructor(e,c){super(e,c),this._popper=null,this._parent=this._element.parentNode,this._menu=ge.next(this._element,zo)[0]||ge.prev(this._element,zo)[0]||ge.findOne(zo,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return dg}static get DefaultType(){return hg}static get NAME(){return vc}toggle(){return this._isShown()?this.hide():this.show()}show(){if(oi(this._element)||this._isShown())return;let e={relatedTarget:this._element};if(!J.trigger(this._element,jp,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(tg))for(let d of[].concat(...document.body.children))J.on(d,"mouseover",jo);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(dr),this._element.classList.add(dr),J.trigger(this._element,Gp,e)}}hide(){if(oi(this._element)||!this._isShown())return;let e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!J.trigger(this._element,Vp,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(let d of[].concat(...document.body.children))J.off(d,"mouseover",jo);this._popper&&this._popper.destroy(),this._menu.classList.remove(dr),this._element.classList.remove(dr),this._element.setAttribute("aria-expanded","false"),zn.removeDataAttribute(this._menu,"popper"),J.trigger(this._element,zp,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!Vn(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${vc.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof Po>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;this._config.reference==="parent"?e=this._parent:Vn(this._config.reference)?e=ri(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);let c=this._getPopperConfig();this._popper=jr(e,this._menu,c)}_isShown(){return this._menu.classList.contains(dr)}_getPlacement(){let e=this._parent;if(e.classList.contains(Jp))return ag;if(e.classList.contains(Xp))return lg;if(e.classList.contains(Qp))return cg;if(e.classList.contains(Zp))return ug;let c=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains(Yp)?c?rg:ig:c?sg:og}_detectNavbar(){return this._element.closest(eg)!==null}_getOffset(){let{offset:e}=this._config;return typeof e=="string"?e.split(",").map(c=>Number.parseInt(c,10)):typeof e=="function"?c=>e(c,this._element):e}_getPopperConfig(){let e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(zn.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...Wt(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:c}){let d=ge.find(ng,this._menu).filter(p=>vr(p));d.length&&ha(d,c,e===yc,!d.includes(c)).focus()}static jQueryInterface(e){return this.each(function(){let c=Vt.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof c[e]>"u")throw new TypeError(`No method named "${e}"`);c[e]()}})}static clearMenus(e){if(e.button===Wp||e.type==="keyup"&&e.key!==bc)return;let c=ge.find(qp);for(let d of c){let p=Vt.getInstance(d);if(!p||p._config.autoClose===!1)continue;let g=e.composedPath(),a=g.includes(p._menu);if(g.includes(p._element)||p._config.autoClose==="inside"&&!a||p._config.autoClose==="outside"&&a||p._menu.contains(e.target)&&(e.type==="keyup"&&e.key===bc||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;let u={relatedTarget:p._element};e.type==="click"&&(u.clickEvent=e),p._completeHide(u)}}static dataApiKeydownHandler(e){let c=/input|textarea/i.test(e.target.tagName),d=e.key===Bp,p=[Up,yc].includes(e.key);if(!p&&!d||c&&!d)return;e.preventDefault();let g=this.matches(xi)?this:ge.prev(this,xi)[0]||ge.next(this,xi)[0]||ge.findOne(xi,e.delegateTarget.parentNode),a=Vt.getOrCreateInstance(g);if(p){e.stopPropagation(),a.show(),a._selectMenuItem(e);return}a._isShown()&&(e.stopPropagation(),a.hide(),g.focus())}};J.on(document,ru,xi,Vt.dataApiKeydownHandler);J.on(document,ru,zo,Vt.dataApiKeydownHandler);J.on(document,iu,Vt.clearMenus);J.on(document,Kp,Vt.clearMenus);J.on(document,iu,xi,function(t){t.preventDefault(),Vt.getOrCreateInstance(this).toggle()});un(Vt);var ou="backdrop",fg="fade",wc="show",Ec=`mousedown.bs.${ou}`,pg={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},gg={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"},Go=class extends ki{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return pg}static get DefaultType(){return gg}static get NAME(){return ou}show(e){if(!this._config.isVisible){Wt(e);return}this._append();let c=this._getElement();this._config.isAnimated&&Xr(c),c.classList.add(wc),this._emulateAnimation(()=>{Wt(e)})}hide(e){if(!this._config.isVisible){Wt(e);return}this._getElement().classList.remove(wc),this._emulateAnimation(()=>{this.dispose(),Wt(e)})}dispose(){this._isAppended&&(J.off(this._element,Ec),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){let e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(fg),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=ri(e.rootElement),e}_append(){if(this._isAppended)return;let e=this._getElement();this._config.rootElement.append(e),J.on(e,Ec,()=>{Wt(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){jc(e,this._getElement(),this._config.isAnimated)}},mg="focustrap",vg="bs.focustrap",Ko=`.${vg}`,bg=`focusin${Ko}`,yg=`keydown.tab${Ko}`,wg="Tab",Eg="forward",Tc="backward",Tg={autofocus:!0,trapElement:null},Cg={autofocus:"boolean",trapElement:"element"},Yo=class extends ki{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Tg}static get DefaultType(){return Cg}static get NAME(){return mg}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),J.off(document,Ko),J.on(document,bg,e=>this._handleFocusin(e)),J.on(document,yg,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,J.off(document,Ko))}_handleFocusin(e){let{trapElement:c}=this._config;if(e.target===document||e.target===c||c.contains(e.target))return;let d=ge.focusableChildren(c);d.length===0?c.focus():this._lastTabNavDirection===Tc?d[d.length-1].focus():d[0].focus()}_handleKeydown(e){e.key===wg&&(this._lastTabNavDirection=e.shiftKey?Tc:Eg)}},Cc=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Sc=".sticky-top",Ho="padding-right",_c="margin-right",Yr=class{constructor(){this._element=document.body}getWidth(){let e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){let e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Ho,c=>c+e),this._setElementAttributes(Cc,Ho,c=>c+e),this._setElementAttributes(Sc,_c,c=>c-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Ho),this._resetElementAttributes(Cc,Ho),this._resetElementAttributes(Sc,_c)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,c,d){let p=this.getWidth(),g=a=>{if(a!==this._element&&window.innerWidth>a.clientWidth+p)return;this._saveInitialAttribute(a,c);let u=window.getComputedStyle(a).getPropertyValue(c);a.style.setProperty(c,`${d(Number.parseFloat(u))}px`)};this._applyManipulationCallback(e,g)}_saveInitialAttribute(e,c){let d=e.style.getPropertyValue(c);d&&zn.setDataAttribute(e,c,d)}_resetElementAttributes(e,c){let d=p=>{let g=zn.getDataAttribute(p,c);if(g===null){p.style.removeProperty(c);return}zn.removeDataAttribute(p,c),p.style.setProperty(c,g)};this._applyManipulationCallback(e,d)}_applyManipulationCallback(e,c){if(Vn(e)){c(e);return}for(let d of ge.find(e,this._element))c(d)}},Sg="modal",_g="bs.modal",ln=`.${_g}`,Ag=".data-api",Lg="Escape",$g=`hide${ln}`,xg=`hidePrevented${ln}`,su=`hidden${ln}`,au=`show${ln}`,Mg=`shown${ln}`,kg=`resize${ln}`,Rg=`click.dismiss${ln}`,Ig=`mousedown.dismiss${ln}`,Og=`keydown.dismiss${ln}`,Dg=`click${ln}${Ag}`,Ac="modal-open",Pg="fade",Lc="show",ea="modal-static",Ng=".modal.show",Fg=".modal-dialog",Hg=".modal-body",Bg='[data-bs-toggle="modal"]',Ug={backdrop:!0,focus:!0,keyboard:!0},Wg={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"},cn=class extends Xt{constructor(e,c){super(e,c),this._dialog=ge.findOne(Fg,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Yr,this._addEventListeners()}static get Default(){return Ug}static get DefaultType(){return Wg}static get NAME(){return Sg}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||J.trigger(this._element,au,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Ac),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||J.trigger(this._element,$g).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Lc),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){J.off(window,ln),J.off(this._dialog,ln),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Go({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Yo({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;let c=ge.findOne(Hg,this._dialog);c&&(c.scrollTop=0),Xr(this._element),this._element.classList.add(Lc);let d=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,J.trigger(this._element,Mg,{relatedTarget:e})};this._queueCallback(d,this._dialog,this._isAnimated())}_addEventListeners(){J.on(this._element,Og,e=>{if(e.key===Lg){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),J.on(window,kg,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),J.on(this._element,Ig,e=>{J.one(this._element,Rg,c=>{if(!(this._element!==e.target||this._element!==c.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Ac),this._resetAdjustments(),this._scrollBar.reset(),J.trigger(this._element,su)})}_isAnimated(){return this._element.classList.contains(Pg)}_triggerBackdropTransition(){if(J.trigger(this._element,xg).defaultPrevented)return;let c=this._element.scrollHeight>document.documentElement.clientHeight,d=this._element.style.overflowY;d==="hidden"||this._element.classList.contains(ea)||(c||(this._element.style.overflowY="hidden"),this._element.classList.add(ea),this._queueCallback(()=>{this._element.classList.remove(ea),this._queueCallback(()=>{this._element.style.overflowY=d},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){let e=this._element.scrollHeight>document.documentElement.clientHeight,c=this._scrollBar.getWidth(),d=c>0;if(d&&!e){let p=an()?"paddingLeft":"paddingRight";this._element.style[p]=`${c}px`}if(!d&&e){let p=an()?"paddingRight":"paddingLeft";this._element.style[p]=`${c}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,c){return this.each(function(){let d=cn.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof d[e]>"u")throw new TypeError(`No method named "${e}"`);d[e](c)}})}};J.on(document,Dg,Bg,function(t){let e=ge.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),J.one(e,au,p=>{p.defaultPrevented||J.one(e,su,()=>{vr(this)&&this.focus()})});let c=ge.findOne(Ng);c&&cn.getInstance(c).hide(),cn.getOrCreateInstance(e).toggle(this)});Jo(cn);un(cn);var Vg="offcanvas",zg="bs.offcanvas",jn=`.${zg}`,lu=".data-api",jg=`load${jn}${lu}`,Gg="Escape",$c="show",xc="showing",Mc="hiding",Kg="offcanvas-backdrop",cu=".offcanvas.show",Yg=`show${jn}`,Jg=`shown${jn}`,Xg=`hide${jn}`,kc=`hidePrevented${jn}`,uu=`hidden${jn}`,Qg=`resize${jn}`,Zg=`click${jn}${lu}`,qg=`keydown.dismiss${jn}`,em='[data-bs-toggle="offcanvas"]',tm={backdrop:!0,keyboard:!0,scroll:!1},nm={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"},kn=class extends Xt{constructor(e,c){super(e,c),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return tm}static get DefaultType(){return nm}static get NAME(){return Vg}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||J.trigger(this._element,Yg,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new Yr().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(xc);let d=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add($c),this._element.classList.remove(xc),J.trigger(this._element,Jg,{relatedTarget:e})};this._queueCallback(d,this._element,!0)}hide(){if(!this._isShown||J.trigger(this._element,Xg).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Mc),this._backdrop.hide();let c=()=>{this._element.classList.remove($c,Mc),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new Yr().reset(),J.trigger(this._element,uu)};this._queueCallback(c,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){let e=()=>{if(this._config.backdrop==="static"){J.trigger(this._element,kc);return}this.hide()},c=!!this._config.backdrop;return new Go({className:Kg,isVisible:c,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:c?e:null})}_initializeFocusTrap(){return new Yo({trapElement:this._element})}_addEventListeners(){J.on(this._element,qg,e=>{if(e.key===Gg){if(this._config.keyboard){this.hide();return}J.trigger(this._element,kc)}})}static jQueryInterface(e){return this.each(function(){let c=kn.getOrCreateInstance(this,e);if(typeof e=="string"){if(c[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);c[e](this)}})}};J.on(document,Zg,em,function(t){let e=ge.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),oi(this))return;J.one(e,uu,()=>{vr(this)&&this.focus()});let c=ge.findOne(cu);c&&c!==e&&kn.getInstance(c).hide(),kn.getOrCreateInstance(e).toggle(this)});J.on(window,jg,()=>{for(let t of ge.find(cu))kn.getOrCreateInstance(t).show()});J.on(window,Qg,()=>{for(let t of ge.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(t).position!=="fixed"&&kn.getOrCreateInstance(t).hide()});Jo(kn);un(kn);var im=/^aria-[\w-]*$/i,du={"*":["class","dir","id","lang","role",im],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},rm=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),om=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,sm=(t,e)=>{let c=t.nodeName.toLowerCase();return e.includes(c)?rm.has(c)?!!om.test(t.nodeValue):!0:e.filter(d=>d instanceof RegExp).some(d=>d.test(c))};function am(t,e,c){if(!t.length)return t;if(c&&typeof c=="function")return c(t);let p=new window.DOMParser().parseFromString(t,"text/html"),g=[].concat(...p.body.querySelectorAll("*"));for(let a of g){let u=a.nodeName.toLowerCase();if(!Object.keys(e).includes(u)){a.remove();continue}let o=[].concat(...a.attributes),r=[].concat(e["*"]||[],e[u]||[]);for(let n of o)sm(n,r)||a.removeAttribute(n.nodeName)}return p.body.innerHTML}var lm="TemplateFactory",cm={allowList:du,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},um={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},dm={entry:"(string|element|function|null)",selector:"(string|element)"},da=class extends ki{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return cm}static get DefaultType(){return um}static get NAME(){return lm}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){let e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(let[p,g]of Object.entries(this._config.content))this._setContent(e,g,p);let c=e.children[0],d=this._resolvePossibleFunction(this._config.extraClass);return d&&c.classList.add(...d.split(" ")),c}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(let[c,d]of Object.entries(e))super._typeCheckConfig({selector:c,entry:d},dm)}_setContent(e,c,d){let p=ge.findOne(d,e);if(p){if(c=this._resolvePossibleFunction(c),!c){p.remove();return}if(Vn(c)){this._putElementInTemplate(ri(c),p);return}if(this._config.html){p.innerHTML=this._maybeSanitize(c);return}p.textContent=c}}_maybeSanitize(e){return this._config.sanitize?am(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return Wt(e,[this])}_putElementInTemplate(e,c){if(this._config.html){c.innerHTML="",c.append(e);return}c.textContent=e.textContent}},hm="tooltip",fm=new Set(["sanitize","allowList","sanitizeFn"]),ta="fade",pm="modal",Bo="show",gm=".tooltip-inner",Rc=`.${pm}`,Ic="hide.bs.modal",Kr="hover",na="focus",mm="click",vm="manual",bm="hide",ym="hidden",wm="show",Em="shown",Tm="inserted",Cm="click",Sm="focusin",_m="focusout",Am="mouseenter",Lm="mouseleave",$m={AUTO:"auto",TOP:"top",RIGHT:an()?"left":"right",BOTTOM:"bottom",LEFT:an()?"right":"left"},xm={allowList:du,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},Mm={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"},si=class extends Xt{constructor(e,c){if(typeof Po>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,c),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return xm}static get DefaultType(){return Mm}static get NAME(){return hm}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),J.off(this._element.closest(Rc),Ic,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;let e=J.trigger(this._element,this.constructor.eventName(wm)),d=(Vc(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!d)return;this._disposePopper();let p=this._getTipElement();this._element.setAttribute("aria-describedby",p.getAttribute("id"));let{container:g}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(g.append(p),J.trigger(this._element,this.constructor.eventName(Tm))),this._popper=this._createPopper(p),p.classList.add(Bo),"ontouchstart"in document.documentElement)for(let u of[].concat(...document.body.children))J.on(u,"mouseover",jo);let a=()=>{J.trigger(this._element,this.constructor.eventName(Em)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(a,this.tip,this._isAnimated())}hide(){if(!this._isShown()||J.trigger(this._element,this.constructor.eventName(bm)).defaultPrevented)return;if(this._getTipElement().classList.remove(Bo),"ontouchstart"in document.documentElement)for(let p of[].concat(...document.body.children))J.off(p,"mouseover",jo);this._activeTrigger[mm]=!1,this._activeTrigger[na]=!1,this._activeTrigger[Kr]=!1,this._isHovered=null;let d=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),J.trigger(this._element,this.constructor.eventName(ym)))};this._queueCallback(d,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){let c=this._getTemplateFactory(e).toHtml();if(!c)return null;c.classList.remove(ta,Bo),c.classList.add(`bs-${this.constructor.NAME}-auto`);let d=vf(this.constructor.NAME).toString();return c.setAttribute("id",d),this._isAnimated()&&c.classList.add(ta),c}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new da({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[gm]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ta)}_isShown(){return this.tip&&this.tip.classList.contains(Bo)}_createPopper(e){let c=Wt(this._config.placement,[this,e,this._element]),d=$m[c.toUpperCase()];return jr(this._element,e,this._getPopperConfig(d))}_getOffset(){let{offset:e}=this._config;return typeof e=="string"?e.split(",").map(c=>Number.parseInt(c,10)):typeof e=="function"?c=>e(c,this._element):e}_resolvePossibleFunction(e){return Wt(e,[this._element])}_getPopperConfig(e){let c={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:d=>{this._getTipElement().setAttribute("data-popper-placement",d.state.placement)}}]};return{...c,...Wt(this._config.popperConfig,[c])}}_setListeners(){let e=this._config.trigger.split(" ");for(let c of e)if(c==="click")J.on(this._element,this.constructor.eventName(Cm),this._config.selector,d=>{this._initializeOnDelegatedTarget(d).toggle()});else if(c!==vm){let d=c===Kr?this.constructor.eventName(Am):this.constructor.eventName(Sm),p=c===Kr?this.constructor.eventName(Lm):this.constructor.eventName(_m);J.on(this._element,d,this._config.selector,g=>{let a=this._initializeOnDelegatedTarget(g);a._activeTrigger[g.type==="focusin"?na:Kr]=!0,a._enter()}),J.on(this._element,p,this._config.selector,g=>{let a=this._initializeOnDelegatedTarget(g);a._activeTrigger[g.type==="focusout"?na:Kr]=a._element.contains(g.relatedTarget),a._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},J.on(this._element.closest(Rc),Ic,this._hideModalHandler)}_fixTitle(){let e=this._element.getAttribute("title");e&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,c){clearTimeout(this._timeout),this._timeout=setTimeout(e,c)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){let c=zn.getDataAttributes(this._element);for(let d of Object.keys(c))fm.has(d)&&delete c[d];return e={...c,...typeof e=="object"&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:ri(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){let e={};for(let[c,d]of Object.entries(this._config))this.constructor.Default[c]!==d&&(e[c]=d);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){let c=si.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof c[e]>"u")throw new TypeError(`No method named "${e}"`);c[e]()}})}};un(si);var km="popover",Rm=".popover-header",Im=".popover-body",Om={...si.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},Dm={...si.DefaultType,content:"(null|string|element|function)"},Jr=class extends si{static get Default(){return Om}static get DefaultType(){return Dm}static get NAME(){return km}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Rm]:this._getTitle(),[Im]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){let c=Jr.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof c[e]>"u")throw new TypeError(`No method named "${e}"`);c[e]()}})}};un(Jr);var Pm="scrollspy",Nm="bs.scrollspy",ga=`.${Nm}`,Fm=".data-api",Hm=`activate${ga}`,Oc=`click${ga}`,Bm=`load${ga}${Fm}`,Um="dropdown-item",cr="active",Wm='[data-bs-spy="scroll"]',ia="[href]",Vm=".nav, .list-group",Dc=".nav-link",zm=".nav-item",jm=".list-group-item",Gm=`${Dc}, ${zm} > ${Dc}, ${jm}`,Km=".dropdown",Ym=".dropdown-toggle",Jm={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Xm={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"},mr=class extends Xt{constructor(e,c){super(e,c),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Jm}static get DefaultType(){return Xm}static get NAME(){return Pm}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(let e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=ri(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold=="string"&&(e.threshold=e.threshold.split(",").map(c=>Number.parseFloat(c))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(J.off(this._config.target,Oc),J.on(this._config.target,Oc,ia,e=>{let c=this._observableSections.get(e.target.hash);if(c){e.preventDefault();let d=this._rootElement||window,p=c.offsetTop-this._element.offsetTop;if(d.scrollTo){d.scrollTo({top:p,behavior:"smooth"});return}d.scrollTop=p}}))}_getNewObserver(){let e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(c=>this._observerCallback(c),e)}_observerCallback(e){let c=a=>this._targetLinks.get(`#${a.target.id}`),d=a=>{this._previousScrollData.visibleEntryTop=a.target.offsetTop,this._process(c(a))},p=(this._rootElement||document.documentElement).scrollTop,g=p>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=p;for(let a of e){if(!a.isIntersecting){this._activeTarget=null,this._clearActiveClass(c(a));continue}let u=a.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(g&&u){if(d(a),!p)return;continue}!g&&!u&&d(a)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;let e=ge.find(ia,this._config.target);for(let c of e){if(!c.hash||oi(c))continue;let d=ge.findOne(decodeURI(c.hash),this._element);vr(d)&&(this._targetLinks.set(decodeURI(c.hash),c),this._observableSections.set(c.hash,d))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(cr),this._activateParents(e),J.trigger(this._element,Hm,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(Um)){ge.findOne(Ym,e.closest(Km)).classList.add(cr);return}for(let c of ge.parents(e,Vm))for(let d of ge.prev(c,Gm))d.classList.add(cr)}_clearActiveClass(e){e.classList.remove(cr);let c=ge.find(`${ia}.${cr}`,e);for(let d of c)d.classList.remove(cr)}static jQueryInterface(e){return this.each(function(){let c=mr.getOrCreateInstance(this,e);if(typeof e=="string"){if(c[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);c[e]()}})}};J.on(window,Bm,()=>{for(let t of ge.find(Wm))mr.getOrCreateInstance(t)});un(mr);var Qm="tab",Zm="bs.tab",Di=`.${Zm}`,qm=`hide${Di}`,ev=`hidden${Di}`,tv=`show${Di}`,nv=`shown${Di}`,iv=`click${Di}`,rv=`keydown${Di}`,ov=`load${Di}`,sv="ArrowLeft",Pc="ArrowRight",av="ArrowUp",Nc="ArrowDown",ra="Home",Fc="End",Mi="active",Hc="fade",oa="show",lv="dropdown",hu=".dropdown-toggle",cv=".dropdown-menu",sa=`:not(${hu})`,uv='.list-group, .nav, [role="tablist"]',dv=".nav-item, .list-group-item",hv=`.nav-link${sa}, .list-group-item${sa}, [role="tab"]${sa}`,fu='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',aa=`${hv}, ${fu}`,fv=`.${Mi}[data-bs-toggle="tab"], .${Mi}[data-bs-toggle="pill"], .${Mi}[data-bs-toggle="list"]`,ai=class extends Xt{constructor(e){super(e),this._parent=this._element.closest(uv),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),J.on(this._element,rv,c=>this._keydown(c)))}static get NAME(){return Qm}show(){let e=this._element;if(this._elemIsActive(e))return;let c=this._getActiveElem(),d=c?J.trigger(c,qm,{relatedTarget:e}):null;J.trigger(e,tv,{relatedTarget:c}).defaultPrevented||d&&d.defaultPrevented||(this._deactivate(c,e),this._activate(e,c))}_activate(e,c){if(!e)return;e.classList.add(Mi),this._activate(ge.getElementFromSelector(e));let d=()=>{if(e.getAttribute("role")!=="tab"){e.classList.add(oa);return}e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),J.trigger(e,nv,{relatedTarget:c})};this._queueCallback(d,e,e.classList.contains(Hc))}_deactivate(e,c){if(!e)return;e.classList.remove(Mi),e.blur(),this._deactivate(ge.getElementFromSelector(e));let d=()=>{if(e.getAttribute("role")!=="tab"){e.classList.remove(oa);return}e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),J.trigger(e,ev,{relatedTarget:c})};this._queueCallback(d,e,e.classList.contains(Hc))}_keydown(e){if(![sv,Pc,av,Nc,ra,Fc].includes(e.key))return;e.stopPropagation(),e.preventDefault();let c=this._getChildren().filter(p=>!oi(p)),d;if([ra,Fc].includes(e.key))d=c[e.key===ra?0:c.length-1];else{let p=[Pc,Nc].includes(e.key);d=ha(c,e.target,p,!0)}d&&(d.focus({preventScroll:!0}),ai.getOrCreateInstance(d).show())}_getChildren(){return ge.find(aa,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,c){this._setAttributeIfNotExists(e,"role","tablist");for(let d of c)this._setInitialAttributesOnChild(d)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);let c=this._elemIsActive(e),d=this._getOuterElement(e);e.setAttribute("aria-selected",c),d!==e&&this._setAttributeIfNotExists(d,"role","presentation"),c||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){let c=ge.getElementFromSelector(e);c&&(this._setAttributeIfNotExists(c,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(c,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,c){let d=this._getOuterElement(e);if(!d.classList.contains(lv))return;let p=(g,a)=>{let u=ge.findOne(g,d);u&&u.classList.toggle(a,c)};p(hu,Mi),p(cv,oa),d.setAttribute("aria-expanded",c)}_setAttributeIfNotExists(e,c,d){e.hasAttribute(c)||e.setAttribute(c,d)}_elemIsActive(e){return e.classList.contains(Mi)}_getInnerElement(e){return e.matches(aa)?e:ge.findOne(aa,e)}_getOuterElement(e){return e.closest(dv)||e}static jQueryInterface(e){return this.each(function(){let c=ai.getOrCreateInstance(this);if(typeof e=="string"){if(c[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);c[e]()}})}};J.on(document,iv,fu,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),!oi(this)&&ai.getOrCreateInstance(this).show()});J.on(window,ov,()=>{for(let t of ge.find(fv))ai.getOrCreateInstance(t)});un(ai);var pv="toast",gv="bs.toast",ui=`.${gv}`,mv=`mouseover${ui}`,vv=`mouseout${ui}`,bv=`focusin${ui}`,yv=`focusout${ui}`,wv=`hide${ui}`,Ev=`hidden${ui}`,Tv=`show${ui}`,Cv=`shown${ui}`,Sv="fade",Bc="hide",Uo="show",Wo="showing",_v={animation:"boolean",autohide:"boolean",delay:"number"},Av={animation:!0,autohide:!0,delay:5e3},li=class extends Xt{constructor(e,c){super(e,c),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Av}static get DefaultType(){return _v}static get NAME(){return pv}show(){if(J.trigger(this._element,Tv).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(Sv);let c=()=>{this._element.classList.remove(Wo),J.trigger(this._element,Cv),this._maybeScheduleHide()};this._element.classList.remove(Bc),Xr(this._element),this._element.classList.add(Uo,Wo),this._queueCallback(c,this._element,this._config.animation)}hide(){if(!this.isShown()||J.trigger(this._element,wv).defaultPrevented)return;let c=()=>{this._element.classList.add(Bc),this._element.classList.remove(Wo,Uo),J.trigger(this._element,Ev)};this._element.classList.add(Wo),this._queueCallback(c,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Uo),super.dispose()}isShown(){return this._element.classList.contains(Uo)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,c){switch(e.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=c;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=c;break}}if(c){this._clearTimeout();return}let d=e.relatedTarget;this._element===d||this._element.contains(d)||this._maybeScheduleHide()}_setListeners(){J.on(this._element,mv,e=>this._onInteraction(e,!0)),J.on(this._element,vv,e=>this._onInteraction(e,!1)),J.on(this._element,bv,e=>this._onInteraction(e,!0)),J.on(this._element,yv,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){let c=li.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof c[e]>"u")throw new TypeError(`No method named "${e}"`);c[e](this)}})}};Jo(li);un(li);var Wu=Ao(pu());var wu=Ao(gu()),Eu=Ao(vu());var Tu=Ao(bu()),qr={modalBodyConfirm:null,buttonConfirmed:null,toastContainer:null};function Cu(){ve(qr)}var Be=function(t,e,c,d,...p){let g=t.insertRow();g.id=e,di(g,e,e,0);let a=e;return p.forEach(u=>{di(g,u),a=u}),c&&g.classList.add("table-active"),d&&Ta(g,yu,$v(yu,Lv,d),"Copy to clipboard"),g};function yr(t,e,c,d=!1,p=null){let g=t.insertCell(0);g.style.verticalAlign="middle",g.style.width="25px";let a=document.createElement("input");return a.classList.add("form-check-input"),a.type="checkbox",a.id=e,a.checked=c,a.disabled=d,p&&(a.onchange=p),g.append(a),a}function di(t,e,c=null,d=-1){let p=t.insertCell(d);return p.textContent=e,p.setAttribute("data-bs-toggle","tooltip"),p.title=c!=null?c:e,p}function Ta(t,e,c,d){let p=t.insertCell();p.classList.add("table-action-column");let g=document.createElement("button");g.classList.add("btn"),g.style.padding="0",g.innerHTML=``,d&&(g.title=d),g.onclick=c,p.appendChild(g)}var yu="bi-copy",Lv="bi-check-lg";function $v(t,e,c){return d=>{navigator.clipboard.writeText(c);let p=d.currentTarget.querySelector(".bi");p.classList.replace(t,e),setTimeout(()=>p.classList.replace(e,t),500)}}function qo(t,e){let c=document.createElement("th");c.textContent=e,t.appendChild(c)}function zt(t,e){t.textContent="",e.forEach(c=>{let d=document.createElement("option");d.text=c,t.appendChild(d)})}function hi(t,e){e.forEach(c=>{Pi(t,c)})}function Pi(t,e,c=!1,d){let p=document.createElement("li");p.innerHTML=c?``:`${e}`,t.appendChild(p)}function wr(t,e,c,d,p=null){let g="tab"+Math.random().toString(36).replace("0.",""),a=document.createElement("li");a.classList.add("nav-item"),p&&(a.setAttribute("data-bs-toggle","tooltip"),a.setAttribute("title",p)),a.innerHTML=`${c}`,t.appendChild(a);let u=document.createElement("template");return u.innerHTML=d,u.content.firstElementChild.id=g,e.appendChild(u.content.firstElementChild),g}function ve(t,e=null){Object.keys(t).forEach(c=>{if(t[c]=(e!=null?e:document).getElementById(c),!t[c])throw new Error(`Element ${c} not found.`)})}function eo(t){return Tu.sanitize(t)}function wn(t,e="Error",c=""){let d=document.createElement("div");d.classList.add("toast"),d.innerHTML=`
- ${e} + ${eo(e)} ${c}
-
${t}
`,wr.toastContainer.appendChild(d),d.addEventListener("hidden.bs.toast",()=>{d.remove()}),new Un(d).show()}function Qg(t){this.message=t,this.name="UserException"}function ie(t,e,c=null){if(c&&c.classList.remove("is-invalid"),!t)throw c?(c.parentNode.getElementsByClassName("invalid-feedback")[0].innerHTML=e,c.classList.add("is-invalid")):qt(e,"Error"),new Qg(e)}function Er(t,e=!1){return e?t.replace("T"," ").replace("Z","").replace("."," "):t.split(".")[0].replace("T"," ")}var yr;function Lt(t,e,c){yr=yr!=null?yr:new jt("#modalConfirm"),wr.modalBodyConfirm.innerHTML=t,wr.buttonConfirmed.innerText=e,wr.buttonConfirmed.onclick=c,yr.show()}function $e(t,e,c=!1,d=!1){let p=Ql.edit(t);return p.setOption("wrap",d),p.session.setMode(e),c&&(p.setReadOnly(!0),p.renderer.setShowGutter(!1)),p}function ql(t,e,c){return new Xl.default({selector:t,data:{src:e,keys:["label","group"]},placeHolder:c,resultsList:{class:"dropdown-menu show",maxResults:30},resultItem:{class:"dropdown-item",highlight:!0,element:(d,p)=>{d.style="display: flex;",d.innerHTML=`${p.key==="label"?p.match:p.value.label} +
${eo(t)}
`,qr.toastContainer.appendChild(d),d.addEventListener("hidden.bs.toast",()=>{d.remove()}),new li(d).show()}function xv(t){this.message=t,this.name="UserException"}function ce(t,e,c=null){if(c&&c.classList.remove("is-invalid"),!t)throw c?(c.parentNode.getElementsByClassName("invalid-feedback")[0].textContent=e,c.classList.add("is-invalid")):wn(e,"Error"),new xv(e)}function to(t,e=!1){return e?t.replace("T"," ").replace("Z","").replace("."," "):t.split(".")[0].replace("T"," ")}var Zr;function jt(t,e,c){Zr=Zr!=null?Zr:new cn("#modalConfirm"),qr.modalBodyConfirm.textContent=t,qr.buttonConfirmed.innerText=e,qr.buttonConfirmed.onclick=c,Zr.show()}function De(t,e,c=!1,d=!1){let p=Eu.edit(t);return p.setOption("wrap",d),p.session.setMode(e),c&&(p.setReadOnly(!0),p.renderer.setShowGutter(!1)),p}function Su(t,e,c){return new wu.default({selector:t,data:{src:e,keys:["label","group"]},placeHolder:c,resultsList:{class:"dropdown-menu show",maxResults:30},resultItem:{class:"dropdown-item",highlight:!0,element:(d,p)=>{d.style="display: flex;",d.innerHTML=`${eo(p.key==="label"?p.match:p.value.label)} - ${p.key==="group"?p.match:p.value.group}`}},events:{input:{results:()=>{Array.from(document.getElementsByClassName("resizable_pane")).forEach(d=>{d.style.overflow="unset"})},close:()=>{Array.from(document.getElementsByClassName("resizable_pane")).forEach(d=>{d.style.overflow="auto"})}}}})}function Gt(t,e){t.addEventListener("click",()=>{e.classList.remove("is-invalid")})}function ec(t,e){Array.from(t.rows).forEach(c=>{e(c)?c.classList.add("table-active"):c.classList.remove("table-active")})}function be(t){return JSON.stringify(t,null,2)}function tc(t,e){let c=t.value.indexOf(e);return c>=0?(t.focus(),t.setSelectionRange(c,c+e.length),!0):!1}function Cr(t,e,c){!c||c.length===e.length?t.textContent=e.length>0?e.length.toString():"":t.textContent=`${c.length}/${e.length}`}var nc=`'; + } + + /* Stringify, in case dirty is an object */ + if (typeof dirty !== 'string' && !_isNode(dirty)) { + if (typeof dirty.toString === 'function') { + dirty = dirty.toString(); + if (typeof dirty !== 'string') { + throw typeErrorCreate('dirty is not a string, aborting'); + } + } else { + throw typeErrorCreate('toString is not a function'); + } + } + + /* Return dirty HTML if DOMPurify cannot run */ + if (!DOMPurify.isSupported) { + return dirty; + } + + /* Assign config vars */ + if (!SET_CONFIG) { + _parseConfig(cfg); + } + + /* Clean up removed elements */ + DOMPurify.removed = []; + + /* Check if dirty is correctly typed for IN_PLACE */ + if (typeof dirty === 'string') { + IN_PLACE = false; + } + if (IN_PLACE) { + /* Do some early pre-sanitization to avoid unsafe root nodes */ + if (dirty.nodeName) { + const tagName = transformCaseFunc(dirty.nodeName); + if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { + throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place'); + } + } + } else if (dirty instanceof Node) { + /* If dirty is a DOM element, append to an empty document to avoid + elements being stripped by the parser */ + body = _initDocument(''); + importedNode = body.ownerDocument.importNode(dirty, true); + if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') { + /* Node is already a body, use as is */ + body = importedNode; + } else if (importedNode.nodeName === 'HTML') { + body = importedNode; + } else { + // eslint-disable-next-line unicorn/prefer-dom-node-append + body.appendChild(importedNode); + } + } else { + /* Exit directly if we have nothing to do */ + if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && + // eslint-disable-next-line unicorn/prefer-includes + dirty.indexOf('<') === -1) { + return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty; + } + + /* Initialize the document to work on */ + body = _initDocument(dirty); + + /* Check we have a DOM node from the data */ + if (!body) { + return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ''; + } + } + + /* Remove first element node (ours) if FORCE_BODY is set */ + if (body && FORCE_BODY) { + _forceRemove(body.firstChild); + } + + /* Get node iterator */ + const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body); + + /* Now start iterating over the created document */ + while (currentNode = nodeIterator.nextNode()) { + /* Sanitize tags and elements */ + if (_sanitizeElements(currentNode)) { + continue; + } + const parentNode = getParentNode(currentNode); + + /* Set the nesting depth of an element */ + if (currentNode.nodeType === NODE_TYPE.element) { + if (parentNode && parentNode.__depth) { + /* + We want the depth of the node in the original tree, which can + change when it's removed from its parent. + */ + currentNode.__depth = (currentNode.__removalCount || 0) + parentNode.__depth + 1; + } else { + currentNode.__depth = 1; + } + } + + /* + * Remove an element if nested too deeply to avoid mXSS + * or if the __depth might have been tampered with + */ + if (currentNode.__depth >= MAX_NESTING_DEPTH || currentNode.__depth < 0 || numberIsNaN(currentNode.__depth)) { + _forceRemove(currentNode); + } + + /* Shadow DOM detected, sanitize it */ + if (currentNode.content instanceof DocumentFragment) { + currentNode.content.__depth = currentNode.__depth; + _sanitizeShadowDOM(currentNode.content); + } + + /* Check attributes, sanitize if necessary */ + _sanitizeAttributes(currentNode); + } + + /* If we sanitized `dirty` in-place, return it. */ + if (IN_PLACE) { + return dirty; + } + + /* Return sanitized string or DOM */ + if (RETURN_DOM) { + if (RETURN_DOM_FRAGMENT) { + returnNode = createDocumentFragment.call(body.ownerDocument); + while (body.firstChild) { + // eslint-disable-next-line unicorn/prefer-dom-node-append + returnNode.appendChild(body.firstChild); + } + } else { + returnNode = body; + } + if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) { + /* + AdoptNode() is not used because internal state is not reset + (e.g. the past names map of a HTMLFormElement), this is safe + in theory but we would rather not risk another attack vector. + The state that is cloned by importNode() is explicitly defined + by the specs. + */ + returnNode = importNode.call(originalDocument, returnNode, true); + } + return returnNode; + } + let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; + + /* Serialize doctype if allowed */ + if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) { + serializedHTML = '\n' + serializedHTML; + } + + /* Sanitize final string template-safe */ + if (SAFE_FOR_TEMPLATES) { + arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { + serializedHTML = stringReplace(serializedHTML, expr, ' '); + }); + } + return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML; + }; + + /** + * Public method to set the configuration once + * setConfig + * + * @param {Object} cfg configuration object + */ + DOMPurify.setConfig = function () { + let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + _parseConfig(cfg); + SET_CONFIG = true; + }; + + /** + * Public method to remove the configuration + * clearConfig + * + */ + DOMPurify.clearConfig = function () { + CONFIG = null; + SET_CONFIG = false; + }; + + /** + * Public method to check if an attribute value is valid. + * Uses last set config, if any. Otherwise, uses config defaults. + * isValidAttribute + * + * @param {String} tag Tag name of containing element. + * @param {String} attr Attribute name. + * @param {String} value Attribute value. + * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false. + */ + DOMPurify.isValidAttribute = function (tag, attr, value) { + /* Initialize shared config vars if necessary. */ + if (!CONFIG) { + _parseConfig({}); + } + const lcTag = transformCaseFunc(tag); + const lcName = transformCaseFunc(attr); + return _isValidAttribute(lcTag, lcName, value); + }; + + /** + * AddHook + * Public method to add DOMPurify hooks + * + * @param {String} entryPoint entry point for the hook to add + * @param {Function} hookFunction function to execute + */ + DOMPurify.addHook = function (entryPoint, hookFunction) { + if (typeof hookFunction !== 'function') { + return; + } + hooks[entryPoint] = hooks[entryPoint] || []; + arrayPush(hooks[entryPoint], hookFunction); + }; + + /** + * RemoveHook + * Public method to remove a DOMPurify hook at a given entryPoint + * (pops it from the stack of hooks if more are present) + * + * @param {String} entryPoint entry point for the hook to remove + * @return {Function} removed(popped) hook + */ + DOMPurify.removeHook = function (entryPoint) { + if (hooks[entryPoint]) { + return arrayPop(hooks[entryPoint]); + } + }; + + /** + * RemoveHooks + * Public method to remove all DOMPurify hooks at a given entryPoint + * + * @param {String} entryPoint entry point for the hooks to remove + */ + DOMPurify.removeHooks = function (entryPoint) { + if (hooks[entryPoint]) { + hooks[entryPoint] = []; + } + }; + + /** + * RemoveAllHooks + * Public method to remove all DOMPurify hooks + */ + DOMPurify.removeAllHooks = function () { + hooks = {}; + }; + return DOMPurify; +} +var purify = createDOMPurify(); + +module.exports = purify; +//# sourceMappingURL=purify.cjs.js.map diff --git a/node_modules/dompurify/dist/purify.cjs.js.map b/node_modules/dompurify/dist/purify.cjs.js.map new file mode 100644 index 0000000000..843ac87aae --- /dev/null +++ b/node_modules/dompurify/dist/purify.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"purify.cjs.js","sources":["../src/utils.js","../src/tags.js","../src/attrs.js","../src/regexp.js","../src/purify.js"],"sourcesContent":["const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n} = Object;\n\nlet { freeze, seal, create } = Object; // eslint-disable-line import/no-mutable-exports\nlet { apply, construct } = typeof Reflect !== 'undefined' && Reflect;\n\nif (!freeze) {\n freeze = function (x) {\n return x;\n };\n}\n\nif (!seal) {\n seal = function (x) {\n return x;\n };\n}\n\nif (!apply) {\n apply = function (fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\n\nif (!construct) {\n construct = function (Func, args) {\n return new Func(...args);\n };\n}\n\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayIndexOf = unapply(Array.prototype.indexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\n\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\n\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\n\nconst regExpTest = unapply(RegExp.prototype.test);\n\nconst typeErrorCreate = unconstruct(TypeError);\n\nconst numberIsNaN = unapply(Number.isNaN);\n\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return (thisArg, ...args) => apply(func, thisArg, args);\n}\n\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n return (...args) => construct(func, args);\n}\n\n/**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\nfunction addToSet(set, array, transformCaseFunc = stringToLowerCase) {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n}\n\n/**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n\n return array;\n}\n\n/**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (\n value &&\n typeof value === 'object' &&\n value.constructor === Object\n ) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n\n return newObject;\n}\n\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n\n object = getPrototypeOf(object);\n }\n\n function fallbackValue() {\n return null;\n }\n\n return fallbackValue;\n}\n\nexport {\n // Array\n arrayForEach,\n arrayIndexOf,\n arrayPop,\n arrayPush,\n arraySlice,\n // Object\n entries,\n freeze,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n isFrozen,\n setPrototypeOf,\n seal,\n clone,\n create,\n objectHasOwnProperty,\n // RegExp\n regExpTest,\n // String\n stringIndexOf,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringTrim,\n // Number\n numberIsNaN,\n // Errors\n typeErrorCreate,\n // Other\n lookupGetter,\n addToSet,\n // Reflect\n unapply,\n unconstruct,\n};\n","import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'a',\n 'abbr',\n 'acronym',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blink',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'content',\n 'data',\n 'datalist',\n 'dd',\n 'decorator',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'element',\n 'em',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'main',\n 'map',\n 'mark',\n 'marquee',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'nobr',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'section',\n 'select',\n 'shadow',\n 'small',\n 'source',\n 'spacer',\n 'span',\n 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'track',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n]);\n\n// SVG\nexport const svg = freeze([\n 'svg',\n 'a',\n 'altglyph',\n 'altglyphdef',\n 'altglyphitem',\n 'animatecolor',\n 'animatemotion',\n 'animatetransform',\n 'circle',\n 'clippath',\n 'defs',\n 'desc',\n 'ellipse',\n 'filter',\n 'font',\n 'g',\n 'glyph',\n 'glyphref',\n 'hkern',\n 'image',\n 'line',\n 'lineargradient',\n 'marker',\n 'mask',\n 'metadata',\n 'mpath',\n 'path',\n 'pattern',\n 'polygon',\n 'polyline',\n 'radialgradient',\n 'rect',\n 'stop',\n 'style',\n 'switch',\n 'symbol',\n 'text',\n 'textpath',\n 'title',\n 'tref',\n 'tspan',\n 'view',\n 'vkern',\n]);\n\nexport const svgFilters = freeze([\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDistantLight',\n 'feDropShadow',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussianBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n]);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nexport const svgDisallowed = freeze([\n 'animate',\n 'color-profile',\n 'cursor',\n 'discard',\n 'font-face',\n 'font-face-format',\n 'font-face-name',\n 'font-face-src',\n 'font-face-uri',\n 'foreignobject',\n 'hatch',\n 'hatchpath',\n 'mesh',\n 'meshgradient',\n 'meshpatch',\n 'meshrow',\n 'missing-glyph',\n 'script',\n 'set',\n 'solidcolor',\n 'unknown',\n 'use',\n]);\n\nexport const mathMl = freeze([\n 'math',\n 'menclose',\n 'merror',\n 'mfenced',\n 'mfrac',\n 'mglyph',\n 'mi',\n 'mlabeledtr',\n 'mmultiscripts',\n 'mn',\n 'mo',\n 'mover',\n 'mpadded',\n 'mphantom',\n 'mroot',\n 'mrow',\n 'ms',\n 'mspace',\n 'msqrt',\n 'mstyle',\n 'msub',\n 'msup',\n 'msubsup',\n 'mtable',\n 'mtd',\n 'mtext',\n 'mtr',\n 'munder',\n 'munderover',\n 'mprescripts',\n]);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nexport const mathMlDisallowed = freeze([\n 'maction',\n 'maligngroup',\n 'malignmark',\n 'mlongdiv',\n 'mscarries',\n 'mscarry',\n 'msgroup',\n 'mstack',\n 'msline',\n 'msrow',\n 'semantics',\n 'annotation',\n 'annotation-xml',\n 'mprescripts',\n 'none',\n]);\n\nexport const text = freeze(['#text']);\n","import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'accept',\n 'action',\n 'align',\n 'alt',\n 'autocapitalize',\n 'autocomplete',\n 'autopictureinpicture',\n 'autoplay',\n 'background',\n 'bgcolor',\n 'border',\n 'capture',\n 'cellpadding',\n 'cellspacing',\n 'checked',\n 'cite',\n 'class',\n 'clear',\n 'color',\n 'cols',\n 'colspan',\n 'controls',\n 'controlslist',\n 'coords',\n 'crossorigin',\n 'datetime',\n 'decoding',\n 'default',\n 'dir',\n 'disabled',\n 'disablepictureinpicture',\n 'disableremoteplayback',\n 'download',\n 'draggable',\n 'enctype',\n 'enterkeyhint',\n 'face',\n 'for',\n 'headers',\n 'height',\n 'hidden',\n 'high',\n 'href',\n 'hreflang',\n 'id',\n 'inputmode',\n 'integrity',\n 'ismap',\n 'kind',\n 'label',\n 'lang',\n 'list',\n 'loading',\n 'loop',\n 'low',\n 'max',\n 'maxlength',\n 'media',\n 'method',\n 'min',\n 'minlength',\n 'multiple',\n 'muted',\n 'name',\n 'nonce',\n 'noshade',\n 'novalidate',\n 'nowrap',\n 'open',\n 'optimum',\n 'pattern',\n 'placeholder',\n 'playsinline',\n 'poster',\n 'preload',\n 'pubdate',\n 'radiogroup',\n 'readonly',\n 'rel',\n 'required',\n 'rev',\n 'reversed',\n 'role',\n 'rows',\n 'rowspan',\n 'spellcheck',\n 'scope',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'span',\n 'srclang',\n 'start',\n 'src',\n 'srcset',\n 'step',\n 'style',\n 'summary',\n 'tabindex',\n 'title',\n 'translate',\n 'type',\n 'usemap',\n 'valign',\n 'value',\n 'width',\n 'wrap',\n 'xmlns',\n 'slot',\n]);\n\nexport const svg = freeze([\n 'accent-height',\n 'accumulate',\n 'additive',\n 'alignment-baseline',\n 'ascent',\n 'attributename',\n 'attributetype',\n 'azimuth',\n 'basefrequency',\n 'baseline-shift',\n 'begin',\n 'bias',\n 'by',\n 'class',\n 'clip',\n 'clippathunits',\n 'clip-path',\n 'clip-rule',\n 'color',\n 'color-interpolation',\n 'color-interpolation-filters',\n 'color-profile',\n 'color-rendering',\n 'cx',\n 'cy',\n 'd',\n 'dx',\n 'dy',\n 'diffuseconstant',\n 'direction',\n 'display',\n 'divisor',\n 'dur',\n 'edgemode',\n 'elevation',\n 'end',\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'filter',\n 'filterunits',\n 'flood-color',\n 'flood-opacity',\n 'font-family',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'fx',\n 'fy',\n 'g1',\n 'g2',\n 'glyph-name',\n 'glyphref',\n 'gradientunits',\n 'gradienttransform',\n 'height',\n 'href',\n 'id',\n 'image-rendering',\n 'in',\n 'in2',\n 'k',\n 'k1',\n 'k2',\n 'k3',\n 'k4',\n 'kerning',\n 'keypoints',\n 'keysplines',\n 'keytimes',\n 'lang',\n 'lengthadjust',\n 'letter-spacing',\n 'kernelmatrix',\n 'kernelunitlength',\n 'lighting-color',\n 'local',\n 'marker-end',\n 'marker-mid',\n 'marker-start',\n 'markerheight',\n 'markerunits',\n 'markerwidth',\n 'maskcontentunits',\n 'maskunits',\n 'max',\n 'mask',\n 'media',\n 'method',\n 'mode',\n 'min',\n 'name',\n 'numoctaves',\n 'offset',\n 'operator',\n 'opacity',\n 'order',\n 'orient',\n 'orientation',\n 'origin',\n 'overflow',\n 'paint-order',\n 'path',\n 'pathlength',\n 'patterncontentunits',\n 'patterntransform',\n 'patternunits',\n 'points',\n 'preservealpha',\n 'preserveaspectratio',\n 'primitiveunits',\n 'r',\n 'rx',\n 'ry',\n 'radius',\n 'refx',\n 'refy',\n 'repeatcount',\n 'repeatdur',\n 'restart',\n 'result',\n 'rotate',\n 'scale',\n 'seed',\n 'shape-rendering',\n 'specularconstant',\n 'specularexponent',\n 'spreadmethod',\n 'startoffset',\n 'stddeviation',\n 'stitchtiles',\n 'stop-color',\n 'stop-opacity',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-opacity',\n 'stroke',\n 'stroke-width',\n 'style',\n 'surfacescale',\n 'systemlanguage',\n 'tabindex',\n 'targetx',\n 'targety',\n 'transform',\n 'transform-origin',\n 'text-anchor',\n 'text-decoration',\n 'text-rendering',\n 'textlength',\n 'type',\n 'u1',\n 'u2',\n 'unicode',\n 'values',\n 'viewbox',\n 'visibility',\n 'version',\n 'vert-adv-y',\n 'vert-origin-x',\n 'vert-origin-y',\n 'width',\n 'word-spacing',\n 'wrap',\n 'writing-mode',\n 'xchannelselector',\n 'ychannelselector',\n 'x',\n 'x1',\n 'x2',\n 'xmlns',\n 'y',\n 'y1',\n 'y2',\n 'z',\n 'zoomandpan',\n]);\n\nexport const mathMl = freeze([\n 'accent',\n 'accentunder',\n 'align',\n 'bevelled',\n 'close',\n 'columnsalign',\n 'columnlines',\n 'columnspan',\n 'denomalign',\n 'depth',\n 'dir',\n 'display',\n 'displaystyle',\n 'encoding',\n 'fence',\n 'frame',\n 'height',\n 'href',\n 'id',\n 'largeop',\n 'length',\n 'linethickness',\n 'lspace',\n 'lquote',\n 'mathbackground',\n 'mathcolor',\n 'mathsize',\n 'mathvariant',\n 'maxsize',\n 'minsize',\n 'movablelimits',\n 'notation',\n 'numalign',\n 'open',\n 'rowalign',\n 'rowlines',\n 'rowspacing',\n 'rowspan',\n 'rspace',\n 'rquote',\n 'scriptlevel',\n 'scriptminsize',\n 'scriptsizemultiplier',\n 'selection',\n 'separator',\n 'separators',\n 'stretchy',\n 'subscriptshift',\n 'supscriptshift',\n 'symmetric',\n 'voffset',\n 'width',\n 'xmlns',\n]);\n\nexport const xml = freeze([\n 'xlink:href',\n 'xml:id',\n 'xlink:title',\n 'xml:space',\n 'xmlns:xlink',\n]);\n","import { seal } from './utils.js';\n\n// eslint-disable-next-line unicorn/better-regex\nexport const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nexport const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nexport const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\nexport const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\nexport const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nexport const IS_ALLOWED_URI = seal(\n /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nexport const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nexport const ATTR_WHITESPACE = seal(\n /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nexport const DOCTYPE_NAME = seal(/^html$/i);\nexport const CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n","import * as TAGS from './tags.js';\nimport * as ATTRS from './attrs.js';\nimport * as EXPRESSIONS from './regexp.js';\nimport {\n addToSet,\n clone,\n entries,\n freeze,\n arrayForEach,\n arrayPop,\n arrayPush,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringIndexOf,\n stringTrim,\n numberIsNaN,\n regExpTest,\n typeErrorCreate,\n lookupGetter,\n create,\n objectHasOwnProperty,\n} from './utils.js';\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5, // Deprecated\n entityNode: 6, // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12, // Deprecated\n};\n\nconst getGlobal = function () {\n return typeof window === 'undefined' ? null : window;\n};\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function (trustedTypes, purifyHostElement) {\n if (\n typeof trustedTypes !== 'object' ||\n typeof trustedTypes.createPolicy !== 'function'\n ) {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n },\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn(\n 'TrustedTypes policy ' + policyName + ' could not be created.'\n );\n return null;\n }\n};\n\nfunction createDOMPurify(window = getGlobal()) {\n const DOMPurify = (root) => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = VERSION;\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n\n if (\n !window ||\n !window.document ||\n window.document.nodeType !== NODE_TYPE.document\n ) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n\n return DOMPurify;\n }\n\n let { document } = window;\n\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes,\n } = window;\n\n const ElementPrototype = Element.prototype;\n\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n let trustedTypesPolicy;\n let emptyHTML = '';\n\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName,\n } = document;\n const { importNode } = originalDocument;\n\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported =\n typeof entries === 'function' &&\n typeof getParentNode === 'function' &&\n implementation &&\n implementation.createHTMLDocument !== undefined;\n\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT,\n } = EXPRESSIONS;\n\n let { IS_ALLOWED_URI } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [\n ...TAGS.html,\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.mathMl,\n ...TAGS.text,\n ]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [\n ...ATTRS.html,\n ...ATTRS.svg,\n ...ATTRS.mathMl,\n ...ATTRS.xml,\n ]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(\n create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false,\n },\n })\n );\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, [\n 'annotation-xml',\n 'audio',\n 'colgroup',\n 'desc',\n 'foreignobject',\n 'head',\n 'iframe',\n 'math',\n 'mi',\n 'mn',\n 'mo',\n 'ms',\n 'mtext',\n 'noembed',\n 'noframes',\n 'noscript',\n 'plaintext',\n 'script',\n 'style',\n 'svg',\n 'template',\n 'thead',\n 'title',\n 'video',\n 'xmp',\n ]);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, [\n 'audio',\n 'video',\n 'img',\n 'source',\n 'image',\n 'track',\n ]);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n 'alt',\n 'class',\n 'for',\n 'id',\n 'label',\n 'name',\n 'pattern',\n 'placeholder',\n 'role',\n 'summary',\n 'title',\n 'value',\n 'style',\n 'xmlns',\n ]);\n\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet(\n {},\n [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE],\n stringToString\n );\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Specify the maximum element nesting depth to prevent mXSS */\n const MAX_NESTING_DEPTH = 255;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n\n const isRegexOrFunction = function (testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function (cfg = {}) {\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1\n ? DEFAULT_PARSER_MEDIA_TYPE\n : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc =\n PARSER_MEDIA_TYPE === 'application/xhtml+xml'\n ? stringToString\n : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS')\n ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc)\n : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR')\n ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc)\n : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES')\n ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString)\n : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR')\n ? addToSet(\n clone(DEFAULT_URI_SAFE_ATTRIBUTES), // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS')\n ? addToSet(\n clone(DEFAULT_DATA_URI_TAGS), // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS')\n ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc)\n : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS')\n ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc)\n : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR')\n ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc)\n : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES')\n ? cfg.USE_PROFILES\n : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI = cfg.ALLOWED_URI_REGEXP || EXPRESSIONS.IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements ===\n 'boolean'\n ) {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements =\n cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, TAGS.text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, TAGS.html);\n addToSet(ALLOWED_ATTR, ATTRS.html);\n }\n\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, TAGS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, TAGS.svgFilters);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, TAGS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate(\n 'TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.'\n );\n }\n\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate(\n 'TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.'\n );\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(\n trustedTypes,\n currentScript\n );\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [\n 'mi',\n 'mo',\n 'mn',\n 'ms',\n 'mtext',\n ]);\n\n const HTML_INTEGRATION_POINTS = addToSet({}, [\n 'foreignobject',\n 'annotation-xml',\n ]);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n 'title',\n 'style',\n 'font',\n 'a',\n 'script',\n ]);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.svgDisallowed,\n ]);\n const ALL_MATHML_TAGS = addToSet({}, [\n ...TAGS.mathMl,\n ...TAGS.mathMlDisallowed,\n ]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function (element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template',\n };\n }\n\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return (\n tagName === 'svg' &&\n (parentTagName === 'annotation-xml' ||\n MATHML_TEXT_INTEGRATION_POINTS[parentTagName])\n );\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (\n parent.namespaceURI === SVG_NAMESPACE &&\n !HTML_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n if (\n parent.namespaceURI === MATHML_NAMESPACE &&\n !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return (\n !ALL_MATHML_TAGS[tagName] &&\n (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName])\n );\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n ALLOWED_NAMESPACES[element.namespaceURI]\n ) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function (node) {\n arrayPush(DOMPurify.removed, { element: node });\n\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function (name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node,\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node,\n });\n }\n\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function (dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n NAMESPACE === HTML_NAMESPACE\n ) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty =\n '' +\n dirty +\n '';\n }\n\n const dirtyPayload = trustedTypesPolicy\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT\n ? emptyHTML\n : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n\n const body = doc.body || doc.documentElement;\n\n if (dirty && leadingWhitespace) {\n body.insertBefore(\n document.createTextNode(leadingWhitespace),\n body.childNodes[0] || null\n );\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(\n doc,\n WHOLE_DOCUMENT ? 'html' : 'body'\n )[0];\n }\n\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function (root) {\n return createNodeIterator.call(\n root.ownerDocument || root,\n root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT |\n NodeFilter.SHOW_COMMENT |\n NodeFilter.SHOW_TEXT |\n NodeFilter.SHOW_PROCESSING_INSTRUCTION |\n NodeFilter.SHOW_CDATA_SECTION,\n null\n );\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function (elm) {\n return (\n elm instanceof HTMLFormElement &&\n // eslint-disable-next-line unicorn/no-typeof-undefined\n ((typeof elm.__depth !== 'undefined' &&\n typeof elm.__depth !== 'number') ||\n // eslint-disable-next-line unicorn/no-typeof-undefined\n (typeof elm.__removalCount !== 'undefined' &&\n typeof elm.__removalCount !== 'number') ||\n typeof elm.nodeName !== 'string' ||\n typeof elm.textContent !== 'string' ||\n typeof elm.removeChild !== 'function' ||\n !(elm.attributes instanceof NamedNodeMap) ||\n typeof elm.removeAttribute !== 'function' ||\n typeof elm.setAttribute !== 'function' ||\n typeof elm.namespaceURI !== 'string' ||\n typeof elm.insertBefore !== 'function' ||\n typeof elm.hasChildNodes !== 'function')\n );\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function (object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function (entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n\n arrayForEach(hooks[entryPoint], (hook) => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function (currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS,\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (\n currentNode.hasChildNodes() &&\n !_isNode(currentNode.firstElementChild) &&\n regExpTest(/<[/\\w]/g, currentNode.innerHTML) &&\n regExpTest(/<[/\\w]/g, currentNode.textContent)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any ocurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (\n SAFE_FOR_XML &&\n currentNode.nodeType === NODE_TYPE.comment &&\n regExpTest(/<[/\\w]/g, currentNode.data)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)\n ) {\n return false;\n }\n\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)\n ) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if (\n (tagName === 'noscript' ||\n tagName === 'noembed' ||\n tagName === 'noframes') &&\n regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n content = stringReplace(content, expr, ' ');\n });\n\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function (lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (\n SANITIZE_DOM &&\n (lcName === 'id' || lcName === 'name') &&\n (value in document ||\n value in formElement ||\n value === '__depth' ||\n value === '__removalCount')\n ) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (\n ALLOW_DATA_ATTR &&\n !FORBID_ATTR[lcName] &&\n regExpTest(DATA_ATTR, lcName)\n ) {\n // This attribute is safe\n } else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) {\n // This attribute is safe\n /* Otherwise, check the name is permitted */\n } else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n (_isBasicCustomElement(lcTag) &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag))) &&\n ((CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName)) ||\n (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)))) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n (lcName === 'is' &&\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))))\n ) {\n // If user has supplied a regexp or function in CUSTOM_ELEMENT_HANDLING.tagNameCheck, we need to also allow derived custom elements using the same tagName test.\n // Additionally, we need to allow attributes passing the CUSTOM_ELEMENT_HANDLING.attributeNameCheck user has configured, as custom elements can define these at their own discretion.\n } else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) {\n // This attribute is safe\n /* Check no script, data or unknown possibly unsafe URI\n unless we know URI values are safe for that attribute */\n } else if (\n regExpTest(IS_ALLOWED_URI, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Keep image data URIs alive if src/xlink:href is allowed */\n /* Further prevent gadget XSS for dynamically built script tags */\n } else if (\n (lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') &&\n lcTag !== 'script' &&\n stringIndexOf(value, 'data:') === 0 &&\n DATA_URI_TAGS[lcTag]\n ) {\n // This attribute is safe\n /* Allow unknown protocols: This provides support for links that\n are handled by protocol handlers which may be unknown ahead of\n time, e.g. fb:, spotify: */\n } else if (\n ALLOW_UNKNOWN_PROTOCOLS &&\n !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Check for binary attributes */\n } else if (value) {\n return false;\n } else {\n // Binary attributes are safe at this point\n /* Anything else, presume unsafe, do not add it back */\n }\n\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function (tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function (currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n\n const { attributes } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const { name, namespaceURI, value: attrValue } = attr;\n const lcName = transformCaseFunc(name);\n\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (\n trustedTypesPolicy &&\n typeof trustedTypes === 'object' &&\n typeof trustedTypes.getAttributeType === 'function'\n ) {\n if (namespaceURI) {\n /* Namespaces are not yet supported, see https://bugs.chromium.org/p/chromium/issues/detail?id=1305293 */\n } else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML': {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n\n case 'TrustedScriptURL': {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n\n default: {\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function (fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n while ((shadowNode = shadowIterator.nextNode())) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n const parentNode = getParentNode(shadowNode);\n\n /* Set the nesting depth of an element */\n if (shadowNode.nodeType === NODE_TYPE.element) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n shadowNode.__depth =\n (shadowNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n shadowNode.__depth = 1;\n }\n }\n\n /*\n * Remove an element if nested too deeply to avoid mXSS\n * or if the __depth might have been tampered with\n */\n if (\n shadowNode.__depth >= MAX_NESTING_DEPTH ||\n shadowNode.__depth < 0 ||\n numberIsNaN(shadowNode.__depth)\n ) {\n _forceRemove(shadowNode);\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n shadowNode.content.__depth = shadowNode.__depth;\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty, cfg = {}) {\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate(\n 'root node is forbidden and cannot be sanitized in-place'\n );\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (\n importedNode.nodeType === NODE_TYPE.element &&\n importedNode.nodeName === 'BODY'\n ) {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (\n !RETURN_DOM &&\n !SAFE_FOR_TEMPLATES &&\n !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1\n ) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while ((currentNode = nodeIterator.nextNode())) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n const parentNode = getParentNode(currentNode);\n\n /* Set the nesting depth of an element */\n if (currentNode.nodeType === NODE_TYPE.element) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n currentNode.__depth =\n (currentNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n currentNode.__depth = 1;\n }\n }\n\n /*\n * Remove an element if nested too deeply to avoid mXSS\n * or if the __depth might have been tampered with\n */\n if (\n currentNode.__depth >= MAX_NESTING_DEPTH ||\n currentNode.__depth < 0 ||\n numberIsNaN(currentNode.__depth)\n ) {\n _forceRemove(currentNode);\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n currentNode.content.__depth = currentNode.__depth;\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (\n WHOLE_DOCUMENT &&\n ALLOWED_TAGS['!doctype'] &&\n body.ownerDocument &&\n body.ownerDocument.doctype &&\n body.ownerDocument.doctype.name &&\n regExpTest(EXPRESSIONS.DOCTYPE_NAME, body.ownerDocument.doctype.name)\n ) {\n serializedHTML =\n '\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(serializedHTML)\n : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function (cfg = {}) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n\n return DOMPurify;\n}\n\nexport default createDOMPurify();\n"],"names":["entries","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","Object","freeze","seal","create","apply","construct","Reflect","x","fun","thisValue","args","Func","arrayForEach","unapply","Array","prototype","forEach","arrayPop","pop","arrayPush","push","stringToLowerCase","String","toLowerCase","stringToString","toString","stringMatch","match","stringReplace","replace","stringIndexOf","indexOf","stringTrim","trim","objectHasOwnProperty","hasOwnProperty","regExpTest","RegExp","test","typeErrorCreate","unconstruct","TypeError","numberIsNaN","Number","isNaN","func","thisArg","_len","arguments","length","_key","_len2","_key2","addToSet","set","array","transformCaseFunc","undefined","l","element","lcElement","cleanArray","index","isPropertyExist","clone","object","newObject","property","value","isArray","constructor","lookupGetter","prop","desc","get","fallbackValue","html","svg","svgFilters","svgDisallowed","mathMl","mathMlDisallowed","text","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","CUSTOM_ELEMENT","NODE_TYPE","attribute","cdataSection","entityReference","entityNode","progressingInstruction","comment","document","documentType","documentFragment","notation","getGlobal","window","_createTrustedTypesPolicy","trustedTypes","purifyHostElement","createPolicy","suffix","ATTR_NAME","hasAttribute","getAttribute","policyName","createHTML","createScriptURL","scriptUrl","_","console","warn","createDOMPurify","DOMPurify","root","version","VERSION","removed","nodeType","isSupported","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Node","Element","NodeFilter","NamedNodeMap","MozNamedAttrMap","HTMLFormElement","DOMParser","ElementPrototype","cloneNode","getNextSibling","getChildNodes","getParentNode","template","createElement","content","ownerDocument","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","createHTMLDocument","EXPRESSIONS","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","ATTRS","CUSTOM_ELEMENT_HANDLING","tagNameCheck","writable","configurable","enumerable","attributeNameCheck","allowCustomizedBuiltInElements","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","SANITIZE_NAMED_PROPS_PREFIX","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","DEFAULT_PARSER_MEDIA_TYPE","CONFIG","MAX_NESTING_DEPTH","formElement","isRegexOrFunction","testValue","Function","_parseConfig","cfg","ADD_URI_SAFE_ATTR","ADD_DATA_URI_TAGS","ALLOWED_URI_REGEXP","ADD_TAGS","ADD_ATTR","table","tbody","TRUSTED_TYPES_POLICY","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","ALL_SVG_TAGS","ALL_MATHML_TAGS","_checkValidNamespace","parent","tagName","namespaceURI","parentTagName","Boolean","_forceRemove","node","parentNode","removeChild","remove","_removeAttribute","name","getAttributeNode","from","removeAttribute","setAttribute","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","parseFromString","documentElement","createDocument","innerHTML","body","insertBefore","createTextNode","childNodes","call","_createNodeIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","SHOW_PROCESSING_INSTRUCTION","SHOW_CDATA_SECTION","_isClobbered","elm","__depth","__removalCount","nodeName","textContent","attributes","hasChildNodes","_isNode","_executeHook","entryPoint","currentNode","data","hook","_sanitizeElements","allowedTags","firstElementChild","_isBasicCustomElement","childCount","i","childClone","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","attr","forceKeepAttr","getAttributeType","setAttributeNS","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","importedNode","returnNode","appendChild","firstChild","nodeIterator","shadowroot","shadowrootmode","serializedHTML","outerHTML","doctype","setConfig","clearConfig","isValidAttribute","tag","addHook","hookFunction","removeHook","removeHooks","removeAllHoo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/purify.es.mjs b/node_modules/dompurify/dist/purify.es.mjs new file mode 100644 index 0000000000..8d54b1cab4 --- /dev/null +++ b/node_modules/dompurify/dist/purify.es.mjs @@ -0,0 +1,1609 @@ +/*! @license DOMPurify 3.1.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.3/LICENSE */ + +const { + entries, + setPrototypeOf, + isFrozen, + getPrototypeOf, + getOwnPropertyDescriptor +} = Object; +let { + freeze, + seal, + create +} = Object; // eslint-disable-line import/no-mutable-exports +let { + apply, + construct +} = typeof Reflect !== 'undefined' && Reflect; +if (!freeze) { + freeze = function freeze(x) { + return x; + }; +} +if (!seal) { + seal = function seal(x) { + return x; + }; +} +if (!apply) { + apply = function apply(fun, thisValue, args) { + return fun.apply(thisValue, args); + }; +} +if (!construct) { + construct = function construct(Func, args) { + return new Func(...args); + }; +} +const arrayForEach = unapply(Array.prototype.forEach); +const arrayPop = unapply(Array.prototype.pop); +const arrayPush = unapply(Array.prototype.push); +const stringToLowerCase = unapply(String.prototype.toLowerCase); +const stringToString = unapply(String.prototype.toString); +const stringMatch = unapply(String.prototype.match); +const stringReplace = unapply(String.prototype.replace); +const stringIndexOf = unapply(String.prototype.indexOf); +const stringTrim = unapply(String.prototype.trim); +const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty); +const regExpTest = unapply(RegExp.prototype.test); +const typeErrorCreate = unconstruct(TypeError); +const numberIsNaN = unapply(Number.isNaN); + +/** + * Creates a new function that calls the given function with a specified thisArg and arguments. + * + * @param {Function} func - The function to be wrapped and called. + * @returns {Function} A new function that calls the given function with a specified thisArg and arguments. + */ +function unapply(func) { + return function (thisArg) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return apply(func, thisArg, args); + }; +} + +/** + * Creates a new function that constructs an instance of the given constructor function with the provided arguments. + * + * @param {Function} func - The constructor function to be wrapped and called. + * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments. + */ +function unconstruct(func) { + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + return construct(func, args); + }; +} + +/** + * Add properties to a lookup table + * + * @param {Object} set - The set to which elements will be added. + * @param {Array} array - The array containing elements to be added to the set. + * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set. + * @returns {Object} The modified set with added elements. + */ +function addToSet(set, array) { + let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase; + if (setPrototypeOf) { + // Make 'in' and truthy checks like Boolean(set.constructor) + // independent of any properties defined on Object.prototype. + // Prevent prototype setters from intercepting set as a this value. + setPrototypeOf(set, null); + } + let l = array.length; + while (l--) { + let element = array[l]; + if (typeof element === 'string') { + const lcElement = transformCaseFunc(element); + if (lcElement !== element) { + // Config presets (e.g. tags.js, attrs.js) are immutable. + if (!isFrozen(array)) { + array[l] = lcElement; + } + element = lcElement; + } + } + set[element] = true; + } + return set; +} + +/** + * Clean up an array to harden against CSPP + * + * @param {Array} array - The array to be cleaned. + * @returns {Array} The cleaned version of the array + */ +function cleanArray(array) { + for (let index = 0; index < array.length; index++) { + const isPropertyExist = objectHasOwnProperty(array, index); + if (!isPropertyExist) { + array[index] = null; + } + } + return array; +} + +/** + * Shallow clone an object + * + * @param {Object} object - The object to be cloned. + * @returns {Object} A new object that copies the original. + */ +function clone(object) { + const newObject = create(null); + for (const [property, value] of entries(object)) { + const isPropertyExist = objectHasOwnProperty(object, property); + if (isPropertyExist) { + if (Array.isArray(value)) { + newObject[property] = cleanArray(value); + } else if (value && typeof value === 'object' && value.constructor === Object) { + newObject[property] = clone(value); + } else { + newObject[property] = value; + } + } + } + return newObject; +} + +/** + * This method automatically checks if the prop is function or getter and behaves accordingly. + * + * @param {Object} object - The object to look up the getter function in its prototype chain. + * @param {String} prop - The property name for which to find the getter function. + * @returns {Function} The getter function found in the prototype chain or a fallback function. + */ +function lookupGetter(object, prop) { + while (object !== null) { + const desc = getOwnPropertyDescriptor(object, prop); + if (desc) { + if (desc.get) { + return unapply(desc.get); + } + if (typeof desc.value === 'function') { + return unapply(desc.value); + } + } + object = getPrototypeOf(object); + } + function fallbackValue() { + return null; + } + return fallbackValue; +} + +const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); + +// SVG +const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']); +const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); + +// List of SVG elements that are disallowed by default. +// We still need to know them so that we can do namespace +// checks properly in case one wants to add them to +// allow-list. +const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']); +const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']); + +// Similarly to SVG, we want to know all MathML elements, +// even those that we disallow by default. +const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']); +const text = freeze(['#text']); + +const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']); +const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']); +const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']); +const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']); + +// eslint-disable-next-line unicorn/better-regex +const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode +const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm); +const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm); +const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape +const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape +const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape +); + +const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); +const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex +); + +const DOCTYPE_NAME = seal(/^html$/i); +const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i); + +var EXPRESSIONS = /*#__PURE__*/Object.freeze({ + __proto__: null, + MUSTACHE_EXPR: MUSTACHE_EXPR, + ERB_EXPR: ERB_EXPR, + TMPLIT_EXPR: TMPLIT_EXPR, + DATA_ATTR: DATA_ATTR, + ARIA_ATTR: ARIA_ATTR, + IS_ALLOWED_URI: IS_ALLOWED_URI, + IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA, + ATTR_WHITESPACE: ATTR_WHITESPACE, + DOCTYPE_NAME: DOCTYPE_NAME, + CUSTOM_ELEMENT: CUSTOM_ELEMENT +}); + +// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType +const NODE_TYPE = { + element: 1, + attribute: 2, + text: 3, + cdataSection: 4, + entityReference: 5, + // Deprecated + entityNode: 6, + // Deprecated + progressingInstruction: 7, + comment: 8, + document: 9, + documentType: 10, + documentFragment: 11, + notation: 12 // Deprecated +}; + +const getGlobal = function getGlobal() { + return typeof window === 'undefined' ? null : window; +}; + +/** + * Creates a no-op policy for internal use only. + * Don't export this function outside this module! + * @param {TrustedTypePolicyFactory} trustedTypes The policy factory. + * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix). + * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types + * are not supported or creating the policy failed). + */ +const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) { + if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') { + return null; + } + + // Allow the callers to control the unique policy name + // by adding a data-tt-policy-suffix to the script element with the DOMPurify. + // Policy creation with duplicate names throws in Trusted Types. + let suffix = null; + const ATTR_NAME = 'data-tt-policy-suffix'; + if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) { + suffix = purifyHostElement.getAttribute(ATTR_NAME); + } + const policyName = 'dompurify' + (suffix ? '#' + suffix : ''); + try { + return trustedTypes.createPolicy(policyName, { + createHTML(html) { + return html; + }, + createScriptURL(scriptUrl) { + return scriptUrl; + } + }); + } catch (_) { + // Policy creation failed (most likely another DOMPurify script has + // already run). Skip creating the policy, as this will only cause errors + // if TT are enforced. + console.warn('TrustedTypes policy ' + policyName + ' could not be created.'); + return null; + } +}; +function createDOMPurify() { + let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal(); + const DOMPurify = root => createDOMPurify(root); + + /** + * Version label, exposed for easier checks + * if DOMPurify is up to date or not + */ + DOMPurify.version = '3.1.3'; + + /** + * Array of elements that DOMPurify removed during sanitation. + * Empty if nothing was removed. + */ + DOMPurify.removed = []; + if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) { + // Not running in a browser, provide a factory function + // so that you can pass your own Window + DOMPurify.isSupported = false; + return DOMPurify; + } + let { + document + } = window; + const originalDocument = document; + const currentScript = originalDocument.currentScript; + const { + DocumentFragment, + HTMLTemplateElement, + Node, + Element, + NodeFilter, + NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap, + HTMLFormElement, + DOMParser, + trustedTypes + } = window; + const ElementPrototype = Element.prototype; + const cloneNode = lookupGetter(ElementPrototype, 'cloneNode'); + const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling'); + const getChildNodes = lookupGetter(ElementPrototype, 'childNodes'); + const getParentNode = lookupGetter(ElementPrototype, 'parentNode'); + + // As per issue #47, the web-components registry is inherited by a + // new document created via createHTMLDocument. As per the spec + // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries) + // a new empty registry is used when creating a template contents owner + // document, so we use that as our parent document to ensure nothing + // is inherited. + if (typeof HTMLTemplateElement === 'function') { + const template = document.createElement('template'); + if (template.content && template.content.ownerDocument) { + document = template.content.ownerDocument; + } + } + let trustedTypesPolicy; + let emptyHTML = ''; + const { + implementation, + createNodeIterator, + createDocumentFragment, + getElementsByTagName + } = document; + const { + importNode + } = originalDocument; + let hooks = {}; + + /** + * Expose whether this browser supports running the full DOMPurify. + */ + DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined; + const { + MUSTACHE_EXPR, + ERB_EXPR, + TMPLIT_EXPR, + DATA_ATTR, + ARIA_ATTR, + IS_SCRIPT_OR_DATA, + ATTR_WHITESPACE, + CUSTOM_ELEMENT + } = EXPRESSIONS; + let { + IS_ALLOWED_URI: IS_ALLOWED_URI$1 + } = EXPRESSIONS; + + /** + * We consider the elements and attributes below to be safe. Ideally + * don't add any new ones but feel free to remove unwanted ones. + */ + + /* allowed element names */ + let ALLOWED_TAGS = null; + const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]); + + /* Allowed attribute names */ + let ALLOWED_ATTR = null; + const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]); + + /* + * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements. + * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements) + * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list) + * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`. + */ + let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, { + tagNameCheck: { + writable: true, + configurable: false, + enumerable: true, + value: null + }, + attributeNameCheck: { + writable: true, + configurable: false, + enumerable: true, + value: null + }, + allowCustomizedBuiltInElements: { + writable: true, + configurable: false, + enumerable: true, + value: false + } + })); + + /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */ + let FORBID_TAGS = null; + + /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */ + let FORBID_ATTR = null; + + /* Decide if ARIA attributes are okay */ + let ALLOW_ARIA_ATTR = true; + + /* Decide if custom data attributes are okay */ + let ALLOW_DATA_ATTR = true; + + /* Decide if unknown protocols are okay */ + let ALLOW_UNKNOWN_PROTOCOLS = false; + + /* Decide if self-closing tags in attributes are allowed. + * Usually removed due to a mXSS issue in jQuery 3.0 */ + let ALLOW_SELF_CLOSE_IN_ATTR = true; + + /* Output should be safe for common template engines. + * This means, DOMPurify removes data attributes, mustaches and ERB + */ + let SAFE_FOR_TEMPLATES = false; + + /* Output should be safe even for XML used within HTML and alike. + * This means, DOMPurify removes comments when containing risky content. + */ + let SAFE_FOR_XML = true; + + /* Decide if document with ... should be returned */ + let WHOLE_DOCUMENT = false; + + /* Track whether config is already set on this instance of DOMPurify. */ + let SET_CONFIG = false; + + /* Decide if all elements (e.g. style, script) must be children of + * document.body. By default, browsers might move them to document.head */ + let FORCE_BODY = false; + + /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html + * string (or a TrustedHTML object if Trusted Types are supported). + * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead + */ + let RETURN_DOM = false; + + /* Decide if a DOM `DocumentFragment` should be returned, instead of a html + * string (or a TrustedHTML object if Trusted Types are supported) */ + let RETURN_DOM_FRAGMENT = false; + + /* Try to return a Trusted Type object instead of a string, return a string in + * case Trusted Types are not supported */ + let RETURN_TRUSTED_TYPE = false; + + /* Output should be free from DOM clobbering attacks? + * This sanitizes markups named with colliding, clobberable built-in DOM APIs. + */ + let SANITIZE_DOM = true; + + /* Achieve full DOM Clobbering protection by isolating the namespace of named + * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules. + * + * HTML/DOM spec rules that enable DOM Clobbering: + * - Named Access on Window (§7.3.3) + * - DOM Tree Accessors (§3.1.5) + * - Form Element Parent-Child Relations (§4.10.3) + * - Iframe srcdoc / Nested WindowProxies (§4.8.5) + * - HTMLCollection (§4.2.10.2) + * + * Namespace isolation is implemented by prefixing `id` and `name` attributes + * with a constant string, i.e., `user-content-` + */ + let SANITIZE_NAMED_PROPS = false; + const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-'; + + /* Keep element content when removing element? */ + let KEEP_CONTENT = true; + + /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead + * of importing it into a new Document and returning a sanitized copy */ + let IN_PLACE = false; + + /* Allow usage of profiles like html, svg and mathMl */ + let USE_PROFILES = {}; + + /* Tags to ignore content of when KEEP_CONTENT is true */ + let FORBID_CONTENTS = null; + const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']); + + /* Tags that are safe for data: URIs */ + let DATA_URI_TAGS = null; + const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']); + + /* Attributes safe for values like "javascript:" */ + let URI_SAFE_ATTRIBUTES = null; + const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']); + const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; + const SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; + const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; + /* Document namespace */ + let NAMESPACE = HTML_NAMESPACE; + let IS_EMPTY_INPUT = false; + + /* Allowed XHTML+XML namespaces */ + let ALLOWED_NAMESPACES = null; + const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString); + + /* Parsing of strict XHTML documents */ + let PARSER_MEDIA_TYPE = null; + const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html']; + const DEFAULT_PARSER_MEDIA_TYPE = 'text/html'; + let transformCaseFunc = null; + + /* Keep a reference to config to pass to hooks */ + let CONFIG = null; + + /* Specify the maximum element nesting depth to prevent mXSS */ + const MAX_NESTING_DEPTH = 255; + + /* Ideally, do not touch anything below this line */ + /* ______________________________________________ */ + + const formElement = document.createElement('form'); + const isRegexOrFunction = function isRegexOrFunction(testValue) { + return testValue instanceof RegExp || testValue instanceof Function; + }; + + /** + * _parseConfig + * + * @param {Object} cfg optional config literal + */ + // eslint-disable-next-line complexity + const _parseConfig = function _parseConfig() { + let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + if (CONFIG && CONFIG === cfg) { + return; + } + + /* Shield configuration object from tampering */ + if (!cfg || typeof cfg !== 'object') { + cfg = {}; + } + + /* Shield configuration object from prototype pollution */ + cfg = clone(cfg); + PARSER_MEDIA_TYPE = + // eslint-disable-next-line unicorn/prefer-includes + SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE; + + // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is. + transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase; + + /* Set configuration parameters */ + ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS; + ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR; + ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES; + URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), + // eslint-disable-line indent + cfg.ADD_URI_SAFE_ATTR, + // eslint-disable-line indent + transformCaseFunc // eslint-disable-line indent + ) // eslint-disable-line indent + : DEFAULT_URI_SAFE_ATTRIBUTES; + DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), + // eslint-disable-line indent + cfg.ADD_DATA_URI_TAGS, + // eslint-disable-line indent + transformCaseFunc // eslint-disable-line indent + ) // eslint-disable-line indent + : DEFAULT_DATA_URI_TAGS; + FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS; + FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {}; + FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {}; + USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false; + ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true + ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true + ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false + ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true + SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false + SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true + WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false + RETURN_DOM = cfg.RETURN_DOM || false; // Default false + RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false + RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false + FORCE_BODY = cfg.FORCE_BODY || false; // Default false + SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true + SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false + KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true + IN_PLACE = cfg.IN_PLACE || false; // Default false + IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI; + NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE; + CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {}; + if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) { + CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck; + } + if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) { + CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck; + } + if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') { + CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements; + } + if (SAFE_FOR_TEMPLATES) { + ALLOW_DATA_ATTR = false; + } + if (RETURN_DOM_FRAGMENT) { + RETURN_DOM = true; + } + + /* Parse profile info */ + if (USE_PROFILES) { + ALLOWED_TAGS = addToSet({}, text); + ALLOWED_ATTR = []; + if (USE_PROFILES.html === true) { + addToSet(ALLOWED_TAGS, html$1); + addToSet(ALLOWED_ATTR, html); + } + if (USE_PROFILES.svg === true) { + addToSet(ALLOWED_TAGS, svg$1); + addToSet(ALLOWED_ATTR, svg); + addToSet(ALLOWED_ATTR, xml); + } + if (USE_PROFILES.svgFilters === true) { + addToSet(ALLOWED_TAGS, svgFilters); + addToSet(ALLOWED_ATTR, svg); + addToSet(ALLOWED_ATTR, xml); + } + if (USE_PROFILES.mathMl === true) { + addToSet(ALLOWED_TAGS, mathMl$1); + addToSet(ALLOWED_ATTR, mathMl); + addToSet(ALLOWED_ATTR, xml); + } + } + + /* Merge configuration parameters */ + if (cfg.ADD_TAGS) { + if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { + ALLOWED_TAGS = clone(ALLOWED_TAGS); + } + addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); + } + if (cfg.ADD_ATTR) { + if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { + ALLOWED_ATTR = clone(ALLOWED_ATTR); + } + addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); + } + if (cfg.ADD_URI_SAFE_ATTR) { + addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); + } + if (cfg.FORBID_CONTENTS) { + if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { + FORBID_CONTENTS = clone(FORBID_CONTENTS); + } + addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc); + } + + /* Add #text in case KEEP_CONTENT is set to true */ + if (KEEP_CONTENT) { + ALLOWED_TAGS['#text'] = true; + } + + /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */ + if (WHOLE_DOCUMENT) { + addToSet(ALLOWED_TAGS, ['html', 'head', 'body']); + } + + /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */ + if (ALLOWED_TAGS.table) { + addToSet(ALLOWED_TAGS, ['tbody']); + delete FORBID_TAGS.tbody; + } + if (cfg.TRUSTED_TYPES_POLICY) { + if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') { + throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); + } + if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') { + throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); + } + + // Overwrite existing TrustedTypes policy. + trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; + + // Sign local variables required by `sanitize`. + emptyHTML = trustedTypesPolicy.createHTML(''); + } else { + // Uninitialized policy, attempt to initialize the internal dompurify policy. + if (trustedTypesPolicy === undefined) { + trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript); + } + + // If creating the internal policy succeeded sign internal variables. + if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') { + emptyHTML = trustedTypesPolicy.createHTML(''); + } + } + + // Prevent further manipulation of configuration. + // Not available in IE8, Safari 5, etc. + if (freeze) { + freeze(cfg); + } + CONFIG = cfg; + }; + const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']); + const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']); + + // Certain elements are allowed in both SVG and HTML + // namespace. We need to specify them explicitly + // so that they don't get erroneously deleted from + // HTML namespace. + const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']); + + /* Keep track of all possible SVG and MathML tags + * so that we can perform the namespace checks + * correctly. */ + const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); + const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); + + /** + * @param {Element} element a DOM element whose namespace is being checked + * @returns {boolean} Return false if the element has a + * namespace that a spec-compliant parser would never + * return. Return true otherwise. + */ + const _checkValidNamespace = function _checkValidNamespace(element) { + let parent = getParentNode(element); + + // In JSDOM, if we're inside shadow DOM, then parentNode + // can be null. We just simulate parent in this case. + if (!parent || !parent.tagName) { + parent = { + namespaceURI: NAMESPACE, + tagName: 'template' + }; + } + const tagName = stringToLowerCase(element.tagName); + const parentTagName = stringToLowerCase(parent.tagName); + if (!ALLOWED_NAMESPACES[element.namespaceURI]) { + return false; + } + if (element.namespaceURI === SVG_NAMESPACE) { + // The only way to switch from HTML namespace to SVG + // is via . If it happens via any other tag, then + // it should be killed. + if (parent.namespaceURI === HTML_NAMESPACE) { + return tagName === 'svg'; + } + + // The only way to switch from MathML to SVG is via` + // svg if parent is either or MathML + // text integration points. + if (parent.namespaceURI === MATHML_NAMESPACE) { + return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); + } + + // We only allow elements that are defined in SVG + // spec. All others are disallowed in SVG namespace. + return Boolean(ALL_SVG_TAGS[tagName]); + } + if (element.namespaceURI === MATHML_NAMESPACE) { + // The only way to switch from HTML namespace to MathML + // is via . If it happens via any other tag, then + // it should be killed. + if (parent.namespaceURI === HTML_NAMESPACE) { + return tagName === 'math'; + } + + // The only way to switch from SVG to MathML is via + // and HTML integration points + if (parent.namespaceURI === SVG_NAMESPACE) { + return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName]; + } + + // We only allow elements that are defined in MathML + // spec. All others are disallowed in MathML namespace. + return Boolean(ALL_MATHML_TAGS[tagName]); + } + if (element.namespaceURI === HTML_NAMESPACE) { + // The only way to switch from SVG to HTML is via + // HTML integration points, and from MathML to HTML + // is via MathML text integration points + if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { + return false; + } + if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { + return false; + } + + // We disallow tags that are specific for MathML + // or SVG and should never appear in HTML namespace + return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); + } + + // For XHTML and XML documents that support custom namespaces + if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) { + return true; + } + + // The code should never reach this place (this means + // that the element somehow got namespace that is not + // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES). + // Return false just in case. + return false; + }; + + /** + * _forceRemove + * + * @param {Node} node a DOM node + */ + const _forceRemove = function _forceRemove(node) { + arrayPush(DOMPurify.removed, { + element: node + }); + try { + // eslint-disable-next-line unicorn/prefer-dom-node-remove + node.parentNode.removeChild(node); + } catch (_) { + node.remove(); + } + }; + + /** + * _removeAttribute + * + * @param {String} name an Attribute name + * @param {Node} node a DOM node + */ + const _removeAttribute = function _removeAttribute(name, node) { + try { + arrayPush(DOMPurify.removed, { + attribute: node.getAttributeNode(name), + from: node + }); + } catch (_) { + arrayPush(DOMPurify.removed, { + attribute: null, + from: node + }); + } + node.removeAttribute(name); + + // We void attribute values for unremovable "is"" attributes + if (name === 'is' && !ALLOWED_ATTR[name]) { + if (RETURN_DOM || RETURN_DOM_FRAGMENT) { + try { + _forceRemove(node); + } catch (_) {} + } else { + try { + node.setAttribute(name, ''); + } catch (_) {} + } + } + }; + + /** + * _initDocument + * + * @param {String} dirty a string of dirty markup + * @return {Document} a DOM, filled with the dirty markup + */ + const _initDocument = function _initDocument(dirty) { + /* Create a HTML document */ + let doc = null; + let leadingWhitespace = null; + if (FORCE_BODY) { + dirty = '' + dirty; + } else { + /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */ + const matches = stringMatch(dirty, /^[\r\n\t ]+/); + leadingWhitespace = matches && matches[0]; + } + if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) { + // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict) + dirty = '' + dirty + ''; + } + const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; + /* + * Use the DOMParser API by default, fallback later if needs be + * DOMParser not work for svg when has multiple root element. + */ + if (NAMESPACE === HTML_NAMESPACE) { + try { + doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); + } catch (_) {} + } + + /* Use createHTMLDocument in case DOMParser is not available */ + if (!doc || !doc.documentElement) { + doc = implementation.createDocument(NAMESPACE, 'template', null); + try { + doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; + } catch (_) { + // Syntax error if dirtyPayload is invalid xml + } + } + const body = doc.body || doc.documentElement; + if (dirty && leadingWhitespace) { + body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null); + } + + /* Work on whole document or just its body */ + if (NAMESPACE === HTML_NAMESPACE) { + return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0]; + } + return WHOLE_DOCUMENT ? doc.documentElement : body; + }; + + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * + * @param {Node} root The root element or node to start traversing on. + * @return {NodeIterator} The created NodeIterator + */ + const _createNodeIterator = function _createNodeIterator(root) { + return createNodeIterator.call(root.ownerDocument || root, root, + // eslint-disable-next-line no-bitwise + NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null); + }; + + /** + * _isClobbered + * + * @param {Node} elm element to check for clobbering attacks + * @return {Boolean} true if clobbered, false if safe + */ + const _isClobbered = function _isClobbered(elm) { + return elm instanceof HTMLFormElement && ( + // eslint-disable-next-line unicorn/no-typeof-undefined + typeof elm.__depth !== 'undefined' && typeof elm.__depth !== 'number' || + // eslint-disable-next-line unicorn/no-typeof-undefined + typeof elm.__removalCount !== 'undefined' && typeof elm.__removalCount !== 'number' || typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function'); + }; + + /** + * Checks whether the given object is a DOM node. + * + * @param {Node} object object to check whether it's a DOM node + * @return {Boolean} true is object is a DOM node + */ + const _isNode = function _isNode(object) { + return typeof Node === 'function' && object instanceof Node; + }; + + /** + * _executeHook + * Execute user configurable hooks + * + * @param {String} entryPoint Name of the hook's entry point + * @param {Node} currentNode node to work on with the hook + * @param {Object} data additional hook parameters + */ + const _executeHook = function _executeHook(entryPoint, currentNode, data) { + if (!hooks[entryPoint]) { + return; + } + arrayForEach(hooks[entryPoint], hook => { + hook.call(DOMPurify, currentNode, data, CONFIG); + }); + }; + + /** + * _sanitizeElements + * + * @protect nodeName + * @protect textContent + * @protect removeChild + * + * @param {Node} currentNode to check for permission to exist + * @return {Boolean} true if node was killed, false if left alive + */ + const _sanitizeElements = function _sanitizeElements(currentNode) { + let content = null; + + /* Execute a hook if present */ + _executeHook('beforeSanitizeElements', currentNode, null); + + /* Check if element is clobbered or can clobber */ + if (_isClobbered(currentNode)) { + _forceRemove(currentNode); + return true; + } + + /* Now let's check the element's type and name */ + const tagName = transformCaseFunc(currentNode.nodeName); + + /* Execute a hook if present */ + _executeHook('uponSanitizeElement', currentNode, { + tagName, + allowedTags: ALLOWED_TAGS + }); + + /* Detect mXSS attempts abusing namespace confusion */ + if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) { + _forceRemove(currentNode); + return true; + } + + /* Remove any ocurrence of processing instructions */ + if (currentNode.nodeType === NODE_TYPE.progressingInstruction) { + _forceRemove(currentNode); + return true; + } + + /* Remove any kind of possibly harmful comments */ + if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) { + _forceRemove(currentNode); + return true; + } + + /* Remove element if anything forbids its presence */ + if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { + /* Check if we have a custom element to handle */ + if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) { + if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) { + return false; + } + if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) { + return false; + } + } + + /* Keep content except for bad-listed elements */ + if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) { + const parentNode = getParentNode(currentNode) || currentNode.parentNode; + const childNodes = getChildNodes(currentNode) || currentNode.childNodes; + if (childNodes && parentNode) { + const childCount = childNodes.length; + for (let i = childCount - 1; i >= 0; --i) { + const childClone = cloneNode(childNodes[i], true); + childClone.__removalCount = (currentNode.__removalCount || 0) + 1; + parentNode.insertBefore(childClone, getNextSibling(currentNode)); + } + } + } + _forceRemove(currentNode); + return true; + } + + /* Check whether element has a valid namespace */ + if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) { + _forceRemove(currentNode); + return true; + } + + /* Make sure that older browsers don't get fallback-tag mXSS */ + if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) { + _forceRemove(currentNode); + return true; + } + + /* Sanitize element content to be template-safe */ + if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) { + /* Get the element's text content */ + content = currentNode.textContent; + arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { + content = stringReplace(content, expr, ' '); + }); + if (currentNode.textContent !== content) { + arrayPush(DOMPurify.removed, { + element: currentNode.cloneNode() + }); + currentNode.textContent = content; + } + } + + /* Execute a hook if present */ + _executeHook('afterSanitizeElements', currentNode, null); + return false; + }; + + /** + * _isValidAttribute + * + * @param {string} lcTag Lowercase tag name of containing element. + * @param {string} lcName Lowercase attribute name. + * @param {string} value Attribute value. + * @return {Boolean} Returns true if `value` is valid, otherwise false. + */ + // eslint-disable-next-line complexity + const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) { + /* Make sure attribute cannot clobber */ + if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement || value === '__depth' || value === '__removalCount')) { + return false; + } + + /* Allow valid data-* attributes: At least one character after "-" + (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes) + XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804) + We don't need to check the value; it's always URI safe. */ + if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) { + if ( + // First condition does a very basic check if a) it's basically a valid custom element tagname AND + // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck + // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck + _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || + // Alternative, second condition checks if it's an `is`-attribute, AND + // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck + lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else { + return false; + } + /* Check value is safe. First, is attr inert? If so, is safe */ + } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) { + return false; + } else ; + return true; + }; + + /** + * _isBasicCustomElement + * checks if at least one dash is included in tagName, and it's not the first char + * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name + * + * @param {string} tagName name of the tag of the node to sanitize + * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false. + */ + const _isBasicCustomElement = function _isBasicCustomElement(tagName) { + return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT); + }; + + /** + * _sanitizeAttributes + * + * @protect attributes + * @protect nodeName + * @protect removeAttribute + * @protect setAttribute + * + * @param {Node} currentNode to sanitize + */ + const _sanitizeAttributes = function _sanitizeAttributes(currentNode) { + /* Execute a hook if present */ + _executeHook('beforeSanitizeAttributes', currentNode, null); + const { + attributes + } = currentNode; + + /* Check if we have attributes; if not we might have a text node */ + if (!attributes) { + return; + } + const hookEvent = { + attrName: '', + attrValue: '', + keepAttr: true, + allowedAttributes: ALLOWED_ATTR + }; + let l = attributes.length; + + /* Go backwards over all attributes; safely remove bad ones */ + while (l--) { + const attr = attributes[l]; + const { + name, + namespaceURI, + value: attrValue + } = attr; + const lcName = transformCaseFunc(name); + let value = name === 'value' ? attrValue : stringTrim(attrValue); + + /* Execute a hook if present */ + hookEvent.attrName = lcName; + hookEvent.attrValue = value; + hookEvent.keepAttr = true; + hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set + _executeHook('uponSanitizeAttribute', currentNode, hookEvent); + value = hookEvent.attrValue; + /* Did the hooks approve of the attribute? */ + if (hookEvent.forceKeepAttr) { + continue; + } + + /* Remove attribute */ + _removeAttribute(name, currentNode); + + /* Did the hooks approve of the attribute? */ + if (!hookEvent.keepAttr) { + continue; + } + + /* Work around a security issue in jQuery 3.0 */ + if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) { + _removeAttribute(name, currentNode); + continue; + } + + /* Work around a security issue with comments inside attributes */ + if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) { + _removeAttribute(name, currentNode); + continue; + } + + /* Sanitize attribute content to be template-safe */ + if (SAFE_FOR_TEMPLATES) { + arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { + value = stringReplace(value, expr, ' '); + }); + } + + /* Is `value` valid for this attribute? */ + const lcTag = transformCaseFunc(currentNode.nodeName); + if (!_isValidAttribute(lcTag, lcName, value)) { + continue; + } + + /* Full DOM Clobbering protection via namespace isolation, + * Prefix id and name attributes with `user-content-` + */ + if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) { + // Remove the attribute with this value + _removeAttribute(name, currentNode); + + // Prefix the value and later re-create the attribute with the sanitized value + value = SANITIZE_NAMED_PROPS_PREFIX + value; + } + + /* Handle attributes that require Trusted Types */ + if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') { + if (namespaceURI) ; else { + switch (trustedTypes.getAttributeType(lcTag, lcName)) { + case 'TrustedHTML': + { + value = trustedTypesPolicy.createHTML(value); + break; + } + case 'TrustedScriptURL': + { + value = trustedTypesPolicy.createScriptURL(value); + break; + } + } + } + } + + /* Handle invalid data-* attribute set by try-catching it */ + try { + if (namespaceURI) { + currentNode.setAttributeNS(namespaceURI, name, value); + } else { + /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */ + currentNode.setAttribute(name, value); + } + if (_isClobbered(currentNode)) { + _forceRemove(currentNode); + } else { + arrayPop(DOMPurify.removed); + } + } catch (_) {} + } + + /* Execute a hook if present */ + _executeHook('afterSanitizeAttributes', currentNode, null); + }; + + /** + * _sanitizeShadowDOM + * + * @param {DocumentFragment} fragment to iterate over recursively + */ + const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) { + let shadowNode = null; + const shadowIterator = _createNodeIterator(fragment); + + /* Execute a hook if present */ + _executeHook('beforeSanitizeShadowDOM', fragment, null); + while (shadowNode = shadowIterator.nextNode()) { + /* Execute a hook if present */ + _executeHook('uponSanitizeShadowNode', shadowNode, null); + + /* Sanitize tags and elements */ + if (_sanitizeElements(shadowNode)) { + continue; + } + const parentNode = getParentNode(shadowNode); + + /* Set the nesting depth of an element */ + if (shadowNode.nodeType === NODE_TYPE.element) { + if (parentNode && parentNode.__depth) { + /* + We want the depth of the node in the original tree, which can + change when it's removed from its parent. + */ + shadowNode.__depth = (shadowNode.__removalCount || 0) + parentNode.__depth + 1; + } else { + shadowNode.__depth = 1; + } + } + + /* + * Remove an element if nested too deeply to avoid mXSS + * or if the __depth might have been tampered with + */ + if (shadowNode.__depth >= MAX_NESTING_DEPTH || shadowNode.__depth < 0 || numberIsNaN(shadowNode.__depth)) { + _forceRemove(shadowNode); + } + + /* Deep shadow DOM detected */ + if (shadowNode.content instanceof DocumentFragment) { + shadowNode.content.__depth = shadowNode.__depth; + _sanitizeShadowDOM(shadowNode.content); + } + + /* Check attributes, sanitize if necessary */ + _sanitizeAttributes(shadowNode); + } + + /* Execute a hook if present */ + _executeHook('afterSanitizeShadowDOM', fragment, null); + }; + + /** + * Sanitize + * Public method providing core sanitation functionality + * + * @param {String|Node} dirty string or DOM node + * @param {Object} cfg object + */ + // eslint-disable-next-line complexity + DOMPurify.sanitize = function (dirty) { + let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + let body = null; + let importedNode = null; + let currentNode = null; + let returnNode = null; + /* Make sure we have a string to sanitize. + DO NOT return early, as this will return the wrong type if + the user has requested a DOM object rather than a string */ + IS_EMPTY_INPUT = !dirty; + if (IS_EMPTY_INPUT) { + dirty = ''; + } + + /* Stringify, in case dirty is an object */ + if (typeof dirty !== 'string' && !_isNode(dirty)) { + if (typeof dirty.toString === 'function') { + dirty = dirty.toString(); + if (typeof dirty !== 'string') { + throw typeErrorCreate('dirty is not a string, aborting'); + } + } else { + throw typeErrorCreate('toString is not a function'); + } + } + + /* Return dirty HTML if DOMPurify cannot run */ + if (!DOMPurify.isSupported) { + return dirty; + } + + /* Assign config vars */ + if (!SET_CONFIG) { + _parseConfig(cfg); + } + + /* Clean up removed elements */ + DOMPurify.removed = []; + + /* Check if dirty is correctly typed for IN_PLACE */ + if (typeof dirty === 'string') { + IN_PLACE = false; + } + if (IN_PLACE) { + /* Do some early pre-sanitization to avoid unsafe root nodes */ + if (dirty.nodeName) { + const tagName = transformCaseFunc(dirty.nodeName); + if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { + throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place'); + } + } + } else if (dirty instanceof Node) { + /* If dirty is a DOM element, append to an empty document to avoid + elements being stripped by the parser */ + body = _initDocument(''); + importedNode = body.ownerDocument.importNode(dirty, true); + if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') { + /* Node is already a body, use as is */ + body = importedNode; + } else if (importedNode.nodeName === 'HTML') { + body = importedNode; + } else { + // eslint-disable-next-line unicorn/prefer-dom-node-append + body.appendChild(importedNode); + } + } else { + /* Exit directly if we have nothing to do */ + if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && + // eslint-disable-next-line unicorn/prefer-includes + dirty.indexOf('<') === -1) { + return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty; + } + + /* Initialize the document to work on */ + body = _initDocument(dirty); + + /* Check we have a DOM node from the data */ + if (!body) { + return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ''; + } + } + + /* Remove first element node (ours) if FORCE_BODY is set */ + if (body && FORCE_BODY) { + _forceRemove(body.firstChild); + } + + /* Get node iterator */ + const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body); + + /* Now start iterating over the created document */ + while (currentNode = nodeIterator.nextNode()) { + /* Sanitize tags and elements */ + if (_sanitizeElements(currentNode)) { + continue; + } + const parentNode = getParentNode(currentNode); + + /* Set the nesting depth of an element */ + if (currentNode.nodeType === NODE_TYPE.element) { + if (parentNode && parentNode.__depth) { + /* + We want the depth of the node in the original tree, which can + change when it's removed from its parent. + */ + currentNode.__depth = (currentNode.__removalCount || 0) + parentNode.__depth + 1; + } else { + currentNode.__depth = 1; + } + } + + /* + * Remove an element if nested too deeply to avoid mXSS + * or if the __depth might have been tampered with + */ + if (currentNode.__depth >= MAX_NESTING_DEPTH || currentNode.__depth < 0 || numberIsNaN(currentNode.__depth)) { + _forceRemove(currentNode); + } + + /* Shadow DOM detected, sanitize it */ + if (currentNode.content instanceof DocumentFragment) { + currentNode.content.__depth = currentNode.__depth; + _sanitizeShadowDOM(currentNode.content); + } + + /* Check attributes, sanitize if necessary */ + _sanitizeAttributes(currentNode); + } + + /* If we sanitized `dirty` in-place, return it. */ + if (IN_PLACE) { + return dirty; + } + + /* Return sanitized string or DOM */ + if (RETURN_DOM) { + if (RETURN_DOM_FRAGMENT) { + returnNode = createDocumentFragment.call(body.ownerDocument); + while (body.firstChild) { + // eslint-disable-next-line unicorn/prefer-dom-node-append + returnNode.appendChild(body.firstChild); + } + } else { + returnNode = body; + } + if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) { + /* + AdoptNode() is not used because internal state is not reset + (e.g. the past names map of a HTMLFormElement), this is safe + in theory but we would rather not risk another attack vector. + The state that is cloned by importNode() is explicitly defined + by the specs. + */ + returnNode = importNode.call(originalDocument, returnNode, true); + } + return returnNode; + } + let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; + + /* Serialize doctype if allowed */ + if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) { + serializedHTML = '\n' + serializedHTML; + } + + /* Sanitize final string template-safe */ + if (SAFE_FOR_TEMPLATES) { + arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { + serializedHTML = stringReplace(serializedHTML, expr, ' '); + }); + } + return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML; + }; + + /** + * Public method to set the configuration once + * setConfig + * + * @param {Object} cfg configuration object + */ + DOMPurify.setConfig = function () { + let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + _parseConfig(cfg); + SET_CONFIG = true; + }; + + /** + * Public method to remove the configuration + * clearConfig + * + */ + DOMPurify.clearConfig = function () { + CONFIG = null; + SET_CONFIG = false; + }; + + /** + * Public method to check if an attribute value is valid. + * Uses last set config, if any. Otherwise, uses config defaults. + * isValidAttribute + * + * @param {String} tag Tag name of containing element. + * @param {String} attr Attribute name. + * @param {String} value Attribute value. + * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false. + */ + DOMPurify.isValidAttribute = function (tag, attr, value) { + /* Initialize shared config vars if necessary. */ + if (!CONFIG) { + _parseConfig({}); + } + const lcTag = transformCaseFunc(tag); + const lcName = transformCaseFunc(attr); + return _isValidAttribute(lcTag, lcName, value); + }; + + /** + * AddHook + * Public method to add DOMPurify hooks + * + * @param {String} entryPoint entry point for the hook to add + * @param {Function} hookFunction function to execute + */ + DOMPurify.addHook = function (entryPoint, hookFunction) { + if (typeof hookFunction !== 'function') { + return; + } + hooks[entryPoint] = hooks[entryPoint] || []; + arrayPush(hooks[entryPoint], hookFunction); + }; + + /** + * RemoveHook + * Public method to remove a DOMPurify hook at a given entryPoint + * (pops it from the stack of hooks if more are present) + * + * @param {String} entryPoint entry point for the hook to remove + * @return {Function} removed(popped) hook + */ + DOMPurify.removeHook = function (entryPoint) { + if (hooks[entryPoint]) { + return arrayPop(hooks[entryPoint]); + } + }; + + /** + * RemoveHooks + * Public method to remove all DOMPurify hooks at a given entryPoint + * + * @param {String} entryPoint entry point for the hooks to remove + */ + DOMPurify.removeHooks = function (entryPoint) { + if (hooks[entryPoint]) { + hooks[entryPoint] = []; + } + }; + + /** + * RemoveAllHooks + * Public method to remove all DOMPurify hooks + */ + DOMPurify.removeAllHooks = function () { + hooks = {}; + }; + return DOMPurify; +} +var purify = createDOMPurify(); + +export { purify as default }; +//# sourceMappingURL=purify.es.mjs.map diff --git a/node_modules/dompurify/dist/purify.es.mjs.map b/node_modules/dompurify/dist/purify.es.mjs.map new file mode 100644 index 0000000000..a02c248982 --- /dev/null +++ b/node_modules/dompurify/dist/purify.es.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"purify.es.mjs","sources":["../src/utils.js","../src/tags.js","../src/attrs.js","../src/regexp.js","../src/purify.js"],"sourcesContent":["const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n} = Object;\n\nlet { freeze, seal, create } = Object; // eslint-disable-line import/no-mutable-exports\nlet { apply, construct } = typeof Reflect !== 'undefined' && Reflect;\n\nif (!freeze) {\n freeze = function (x) {\n return x;\n };\n}\n\nif (!seal) {\n seal = function (x) {\n return x;\n };\n}\n\nif (!apply) {\n apply = function (fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\n\nif (!construct) {\n construct = function (Func, args) {\n return new Func(...args);\n };\n}\n\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayIndexOf = unapply(Array.prototype.indexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\n\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\n\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\n\nconst regExpTest = unapply(RegExp.prototype.test);\n\nconst typeErrorCreate = unconstruct(TypeError);\n\nconst numberIsNaN = unapply(Number.isNaN);\n\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return (thisArg, ...args) => apply(func, thisArg, args);\n}\n\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n return (...args) => construct(func, args);\n}\n\n/**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\nfunction addToSet(set, array, transformCaseFunc = stringToLowerCase) {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n}\n\n/**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n\n return array;\n}\n\n/**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (\n value &&\n typeof value === 'object' &&\n value.constructor === Object\n ) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n\n return newObject;\n}\n\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n\n object = getPrototypeOf(object);\n }\n\n function fallbackValue() {\n return null;\n }\n\n return fallbackValue;\n}\n\nexport {\n // Array\n arrayForEach,\n arrayIndexOf,\n arrayPop,\n arrayPush,\n arraySlice,\n // Object\n entries,\n freeze,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n isFrozen,\n setPrototypeOf,\n seal,\n clone,\n create,\n objectHasOwnProperty,\n // RegExp\n regExpTest,\n // String\n stringIndexOf,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringTrim,\n // Number\n numberIsNaN,\n // Errors\n typeErrorCreate,\n // Other\n lookupGetter,\n addToSet,\n // Reflect\n unapply,\n unconstruct,\n};\n","import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'a',\n 'abbr',\n 'acronym',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blink',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'content',\n 'data',\n 'datalist',\n 'dd',\n 'decorator',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'element',\n 'em',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'main',\n 'map',\n 'mark',\n 'marquee',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'nobr',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'section',\n 'select',\n 'shadow',\n 'small',\n 'source',\n 'spacer',\n 'span',\n 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'track',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n]);\n\n// SVG\nexport const svg = freeze([\n 'svg',\n 'a',\n 'altglyph',\n 'altglyphdef',\n 'altglyphitem',\n 'animatecolor',\n 'animatemotion',\n 'animatetransform',\n 'circle',\n 'clippath',\n 'defs',\n 'desc',\n 'ellipse',\n 'filter',\n 'font',\n 'g',\n 'glyph',\n 'glyphref',\n 'hkern',\n 'image',\n 'line',\n 'lineargradient',\n 'marker',\n 'mask',\n 'metadata',\n 'mpath',\n 'path',\n 'pattern',\n 'polygon',\n 'polyline',\n 'radialgradient',\n 'rect',\n 'stop',\n 'style',\n 'switch',\n 'symbol',\n 'text',\n 'textpath',\n 'title',\n 'tref',\n 'tspan',\n 'view',\n 'vkern',\n]);\n\nexport const svgFilters = freeze([\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDistantLight',\n 'feDropShadow',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussianBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n]);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nexport const svgDisallowed = freeze([\n 'animate',\n 'color-profile',\n 'cursor',\n 'discard',\n 'font-face',\n 'font-face-format',\n 'font-face-name',\n 'font-face-src',\n 'font-face-uri',\n 'foreignobject',\n 'hatch',\n 'hatchpath',\n 'mesh',\n 'meshgradient',\n 'meshpatch',\n 'meshrow',\n 'missing-glyph',\n 'script',\n 'set',\n 'solidcolor',\n 'unknown',\n 'use',\n]);\n\nexport const mathMl = freeze([\n 'math',\n 'menclose',\n 'merror',\n 'mfenced',\n 'mfrac',\n 'mglyph',\n 'mi',\n 'mlabeledtr',\n 'mmultiscripts',\n 'mn',\n 'mo',\n 'mover',\n 'mpadded',\n 'mphantom',\n 'mroot',\n 'mrow',\n 'ms',\n 'mspace',\n 'msqrt',\n 'mstyle',\n 'msub',\n 'msup',\n 'msubsup',\n 'mtable',\n 'mtd',\n 'mtext',\n 'mtr',\n 'munder',\n 'munderover',\n 'mprescripts',\n]);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nexport const mathMlDisallowed = freeze([\n 'maction',\n 'maligngroup',\n 'malignmark',\n 'mlongdiv',\n 'mscarries',\n 'mscarry',\n 'msgroup',\n 'mstack',\n 'msline',\n 'msrow',\n 'semantics',\n 'annotation',\n 'annotation-xml',\n 'mprescripts',\n 'none',\n]);\n\nexport const text = freeze(['#text']);\n","import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'accept',\n 'action',\n 'align',\n 'alt',\n 'autocapitalize',\n 'autocomplete',\n 'autopictureinpicture',\n 'autoplay',\n 'background',\n 'bgcolor',\n 'border',\n 'capture',\n 'cellpadding',\n 'cellspacing',\n 'checked',\n 'cite',\n 'class',\n 'clear',\n 'color',\n 'cols',\n 'colspan',\n 'controls',\n 'controlslist',\n 'coords',\n 'crossorigin',\n 'datetime',\n 'decoding',\n 'default',\n 'dir',\n 'disabled',\n 'disablepictureinpicture',\n 'disableremoteplayback',\n 'download',\n 'draggable',\n 'enctype',\n 'enterkeyhint',\n 'face',\n 'for',\n 'headers',\n 'height',\n 'hidden',\n 'high',\n 'href',\n 'hreflang',\n 'id',\n 'inputmode',\n 'integrity',\n 'ismap',\n 'kind',\n 'label',\n 'lang',\n 'list',\n 'loading',\n 'loop',\n 'low',\n 'max',\n 'maxlength',\n 'media',\n 'method',\n 'min',\n 'minlength',\n 'multiple',\n 'muted',\n 'name',\n 'nonce',\n 'noshade',\n 'novalidate',\n 'nowrap',\n 'open',\n 'optimum',\n 'pattern',\n 'placeholder',\n 'playsinline',\n 'poster',\n 'preload',\n 'pubdate',\n 'radiogroup',\n 'readonly',\n 'rel',\n 'required',\n 'rev',\n 'reversed',\n 'role',\n 'rows',\n 'rowspan',\n 'spellcheck',\n 'scope',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'span',\n 'srclang',\n 'start',\n 'src',\n 'srcset',\n 'step',\n 'style',\n 'summary',\n 'tabindex',\n 'title',\n 'translate',\n 'type',\n 'usemap',\n 'valign',\n 'value',\n 'width',\n 'wrap',\n 'xmlns',\n 'slot',\n]);\n\nexport const svg = freeze([\n 'accent-height',\n 'accumulate',\n 'additive',\n 'alignment-baseline',\n 'ascent',\n 'attributename',\n 'attributetype',\n 'azimuth',\n 'basefrequency',\n 'baseline-shift',\n 'begin',\n 'bias',\n 'by',\n 'class',\n 'clip',\n 'clippathunits',\n 'clip-path',\n 'clip-rule',\n 'color',\n 'color-interpolation',\n 'color-interpolation-filters',\n 'color-profile',\n 'color-rendering',\n 'cx',\n 'cy',\n 'd',\n 'dx',\n 'dy',\n 'diffuseconstant',\n 'direction',\n 'display',\n 'divisor',\n 'dur',\n 'edgemode',\n 'elevation',\n 'end',\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'filter',\n 'filterunits',\n 'flood-color',\n 'flood-opacity',\n 'font-family',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'fx',\n 'fy',\n 'g1',\n 'g2',\n 'glyph-name',\n 'glyphref',\n 'gradientunits',\n 'gradienttransform',\n 'height',\n 'href',\n 'id',\n 'image-rendering',\n 'in',\n 'in2',\n 'k',\n 'k1',\n 'k2',\n 'k3',\n 'k4',\n 'kerning',\n 'keypoints',\n 'keysplines',\n 'keytimes',\n 'lang',\n 'lengthadjust',\n 'letter-spacing',\n 'kernelmatrix',\n 'kernelunitlength',\n 'lighting-color',\n 'local',\n 'marker-end',\n 'marker-mid',\n 'marker-start',\n 'markerheight',\n 'markerunits',\n 'markerwidth',\n 'maskcontentunits',\n 'maskunits',\n 'max',\n 'mask',\n 'media',\n 'method',\n 'mode',\n 'min',\n 'name',\n 'numoctaves',\n 'offset',\n 'operator',\n 'opacity',\n 'order',\n 'orient',\n 'orientation',\n 'origin',\n 'overflow',\n 'paint-order',\n 'path',\n 'pathlength',\n 'patterncontentunits',\n 'patterntransform',\n 'patternunits',\n 'points',\n 'preservealpha',\n 'preserveaspectratio',\n 'primitiveunits',\n 'r',\n 'rx',\n 'ry',\n 'radius',\n 'refx',\n 'refy',\n 'repeatcount',\n 'repeatdur',\n 'restart',\n 'result',\n 'rotate',\n 'scale',\n 'seed',\n 'shape-rendering',\n 'specularconstant',\n 'specularexponent',\n 'spreadmethod',\n 'startoffset',\n 'stddeviation',\n 'stitchtiles',\n 'stop-color',\n 'stop-opacity',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-opacity',\n 'stroke',\n 'stroke-width',\n 'style',\n 'surfacescale',\n 'systemlanguage',\n 'tabindex',\n 'targetx',\n 'targety',\n 'transform',\n 'transform-origin',\n 'text-anchor',\n 'text-decoration',\n 'text-rendering',\n 'textlength',\n 'type',\n 'u1',\n 'u2',\n 'unicode',\n 'values',\n 'viewbox',\n 'visibility',\n 'version',\n 'vert-adv-y',\n 'vert-origin-x',\n 'vert-origin-y',\n 'width',\n 'word-spacing',\n 'wrap',\n 'writing-mode',\n 'xchannelselector',\n 'ychannelselector',\n 'x',\n 'x1',\n 'x2',\n 'xmlns',\n 'y',\n 'y1',\n 'y2',\n 'z',\n 'zoomandpan',\n]);\n\nexport const mathMl = freeze([\n 'accent',\n 'accentunder',\n 'align',\n 'bevelled',\n 'close',\n 'columnsalign',\n 'columnlines',\n 'columnspan',\n 'denomalign',\n 'depth',\n 'dir',\n 'display',\n 'displaystyle',\n 'encoding',\n 'fence',\n 'frame',\n 'height',\n 'href',\n 'id',\n 'largeop',\n 'length',\n 'linethickness',\n 'lspace',\n 'lquote',\n 'mathbackground',\n 'mathcolor',\n 'mathsize',\n 'mathvariant',\n 'maxsize',\n 'minsize',\n 'movablelimits',\n 'notation',\n 'numalign',\n 'open',\n 'rowalign',\n 'rowlines',\n 'rowspacing',\n 'rowspan',\n 'rspace',\n 'rquote',\n 'scriptlevel',\n 'scriptminsize',\n 'scriptsizemultiplier',\n 'selection',\n 'separator',\n 'separators',\n 'stretchy',\n 'subscriptshift',\n 'supscriptshift',\n 'symmetric',\n 'voffset',\n 'width',\n 'xmlns',\n]);\n\nexport const xml = freeze([\n 'xlink:href',\n 'xml:id',\n 'xlink:title',\n 'xml:space',\n 'xmlns:xlink',\n]);\n","import { seal } from './utils.js';\n\n// eslint-disable-next-line unicorn/better-regex\nexport const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nexport const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nexport const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\nexport const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\nexport const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nexport const IS_ALLOWED_URI = seal(\n /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nexport const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nexport const ATTR_WHITESPACE = seal(\n /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nexport const DOCTYPE_NAME = seal(/^html$/i);\nexport const CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n","import * as TAGS from './tags.js';\nimport * as ATTRS from './attrs.js';\nimport * as EXPRESSIONS from './regexp.js';\nimport {\n addToSet,\n clone,\n entries,\n freeze,\n arrayForEach,\n arrayPop,\n arrayPush,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringIndexOf,\n stringTrim,\n numberIsNaN,\n regExpTest,\n typeErrorCreate,\n lookupGetter,\n create,\n objectHasOwnProperty,\n} from './utils.js';\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5, // Deprecated\n entityNode: 6, // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12, // Deprecated\n};\n\nconst getGlobal = function () {\n return typeof window === 'undefined' ? null : window;\n};\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function (trustedTypes, purifyHostElement) {\n if (\n typeof trustedTypes !== 'object' ||\n typeof trustedTypes.createPolicy !== 'function'\n ) {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n },\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn(\n 'TrustedTypes policy ' + policyName + ' could not be created.'\n );\n return null;\n }\n};\n\nfunction createDOMPurify(window = getGlobal()) {\n const DOMPurify = (root) => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = VERSION;\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n\n if (\n !window ||\n !window.document ||\n window.document.nodeType !== NODE_TYPE.document\n ) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n\n return DOMPurify;\n }\n\n let { document } = window;\n\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes,\n } = window;\n\n const ElementPrototype = Element.prototype;\n\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n let trustedTypesPolicy;\n let emptyHTML = '';\n\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName,\n } = document;\n const { importNode } = originalDocument;\n\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported =\n typeof entries === 'function' &&\n typeof getParentNode === 'function' &&\n implementation &&\n implementation.createHTMLDocument !== undefined;\n\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT,\n } = EXPRESSIONS;\n\n let { IS_ALLOWED_URI } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [\n ...TAGS.html,\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.mathMl,\n ...TAGS.text,\n ]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [\n ...ATTRS.html,\n ...ATTRS.svg,\n ...ATTRS.mathMl,\n ...ATTRS.xml,\n ]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(\n create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false,\n },\n })\n );\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, [\n 'annotation-xml',\n 'audio',\n 'colgroup',\n 'desc',\n 'foreignobject',\n 'head',\n 'iframe',\n 'math',\n 'mi',\n 'mn',\n 'mo',\n 'ms',\n 'mtext',\n 'noembed',\n 'noframes',\n 'noscript',\n 'plaintext',\n 'script',\n 'style',\n 'svg',\n 'template',\n 'thead',\n 'title',\n 'video',\n 'xmp',\n ]);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, [\n 'audio',\n 'video',\n 'img',\n 'source',\n 'image',\n 'track',\n ]);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n 'alt',\n 'class',\n 'for',\n 'id',\n 'label',\n 'name',\n 'pattern',\n 'placeholder',\n 'role',\n 'summary',\n 'title',\n 'value',\n 'style',\n 'xmlns',\n ]);\n\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet(\n {},\n [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE],\n stringToString\n );\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Specify the maximum element nesting depth to prevent mXSS */\n const MAX_NESTING_DEPTH = 255;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n\n const isRegexOrFunction = function (testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function (cfg = {}) {\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1\n ? DEFAULT_PARSER_MEDIA_TYPE\n : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc =\n PARSER_MEDIA_TYPE === 'application/xhtml+xml'\n ? stringToString\n : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS')\n ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc)\n : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR')\n ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc)\n : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES')\n ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString)\n : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR')\n ? addToSet(\n clone(DEFAULT_URI_SAFE_ATTRIBUTES), // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS')\n ? addToSet(\n clone(DEFAULT_DATA_URI_TAGS), // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS')\n ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc)\n : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS')\n ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc)\n : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR')\n ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc)\n : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES')\n ? cfg.USE_PROFILES\n : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI = cfg.ALLOWED_URI_REGEXP || EXPRESSIONS.IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements ===\n 'boolean'\n ) {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements =\n cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, TAGS.text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, TAGS.html);\n addToSet(ALLOWED_ATTR, ATTRS.html);\n }\n\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, TAGS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, TAGS.svgFilters);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, TAGS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate(\n 'TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.'\n );\n }\n\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate(\n 'TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.'\n );\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(\n trustedTypes,\n currentScript\n );\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [\n 'mi',\n 'mo',\n 'mn',\n 'ms',\n 'mtext',\n ]);\n\n const HTML_INTEGRATION_POINTS = addToSet({}, [\n 'foreignobject',\n 'annotation-xml',\n ]);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n 'title',\n 'style',\n 'font',\n 'a',\n 'script',\n ]);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.svgDisallowed,\n ]);\n const ALL_MATHML_TAGS = addToSet({}, [\n ...TAGS.mathMl,\n ...TAGS.mathMlDisallowed,\n ]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function (element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template',\n };\n }\n\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return (\n tagName === 'svg' &&\n (parentTagName === 'annotation-xml' ||\n MATHML_TEXT_INTEGRATION_POINTS[parentTagName])\n );\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (\n parent.namespaceURI === SVG_NAMESPACE &&\n !HTML_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n if (\n parent.namespaceURI === MATHML_NAMESPACE &&\n !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return (\n !ALL_MATHML_TAGS[tagName] &&\n (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName])\n );\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n ALLOWED_NAMESPACES[element.namespaceURI]\n ) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function (node) {\n arrayPush(DOMPurify.removed, { element: node });\n\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function (name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node,\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node,\n });\n }\n\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function (dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n NAMESPACE === HTML_NAMESPACE\n ) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty =\n '' +\n dirty +\n '';\n }\n\n const dirtyPayload = trustedTypesPolicy\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT\n ? emptyHTML\n : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n\n const body = doc.body || doc.documentElement;\n\n if (dirty && leadingWhitespace) {\n body.insertBefore(\n document.createTextNode(leadingWhitespace),\n body.childNodes[0] || null\n );\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(\n doc,\n WHOLE_DOCUMENT ? 'html' : 'body'\n )[0];\n }\n\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function (root) {\n return createNodeIterator.call(\n root.ownerDocument || root,\n root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT |\n NodeFilter.SHOW_COMMENT |\n NodeFilter.SHOW_TEXT |\n NodeFilter.SHOW_PROCESSING_INSTRUCTION |\n NodeFilter.SHOW_CDATA_SECTION,\n null\n );\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function (elm) {\n return (\n elm instanceof HTMLFormElement &&\n // eslint-disable-next-line unicorn/no-typeof-undefined\n ((typeof elm.__depth !== 'undefined' &&\n typeof elm.__depth !== 'number') ||\n // eslint-disable-next-line unicorn/no-typeof-undefined\n (typeof elm.__removalCount !== 'undefined' &&\n typeof elm.__removalCount !== 'number') ||\n typeof elm.nodeName !== 'string' ||\n typeof elm.textContent !== 'string' ||\n typeof elm.removeChild !== 'function' ||\n !(elm.attributes instanceof NamedNodeMap) ||\n typeof elm.removeAttribute !== 'function' ||\n typeof elm.setAttribute !== 'function' ||\n typeof elm.namespaceURI !== 'string' ||\n typeof elm.insertBefore !== 'function' ||\n typeof elm.hasChildNodes !== 'function')\n );\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function (object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function (entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n\n arrayForEach(hooks[entryPoint], (hook) => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function (currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS,\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (\n currentNode.hasChildNodes() &&\n !_isNode(currentNode.firstElementChild) &&\n regExpTest(/<[/\\w]/g, currentNode.innerHTML) &&\n regExpTest(/<[/\\w]/g, currentNode.textContent)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any ocurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (\n SAFE_FOR_XML &&\n currentNode.nodeType === NODE_TYPE.comment &&\n regExpTest(/<[/\\w]/g, currentNode.data)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)\n ) {\n return false;\n }\n\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)\n ) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if (\n (tagName === 'noscript' ||\n tagName === 'noembed' ||\n tagName === 'noframes') &&\n regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n content = stringReplace(content, expr, ' ');\n });\n\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function (lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (\n SANITIZE_DOM &&\n (lcName === 'id' || lcName === 'name') &&\n (value in document ||\n value in formElement ||\n value === '__depth' ||\n value === '__removalCount')\n ) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (\n ALLOW_DATA_ATTR &&\n !FORBID_ATTR[lcName] &&\n regExpTest(DATA_ATTR, lcName)\n ) {\n // This attribute is safe\n } else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) {\n // This attribute is safe\n /* Otherwise, check the name is permitted */\n } else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n (_isBasicCustomElement(lcTag) &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag))) &&\n ((CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName)) ||\n (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)))) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n (lcName === 'is' &&\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))))\n ) {\n // If user has supplied a regexp or function in CUSTOM_ELEMENT_HANDLING.tagNameCheck, we need to also allow derived custom elements using the same tagName test.\n // Additionally, we need to allow attributes passing the CUSTOM_ELEMENT_HANDLING.attributeNameCheck user has configured, as custom elements can define these at their own discretion.\n } else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) {\n // This attribute is safe\n /* Check no script, data or unknown possibly unsafe URI\n unless we know URI values are safe for that attribute */\n } else if (\n regExpTest(IS_ALLOWED_URI, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Keep image data URIs alive if src/xlink:href is allowed */\n /* Further prevent gadget XSS for dynamically built script tags */\n } else if (\n (lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') &&\n lcTag !== 'script' &&\n stringIndexOf(value, 'data:') === 0 &&\n DATA_URI_TAGS[lcTag]\n ) {\n // This attribute is safe\n /* Allow unknown protocols: This provides support for links that\n are handled by protocol handlers which may be unknown ahead of\n time, e.g. fb:, spotify: */\n } else if (\n ALLOW_UNKNOWN_PROTOCOLS &&\n !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Check for binary attributes */\n } else if (value) {\n return false;\n } else {\n // Binary attributes are safe at this point\n /* Anything else, presume unsafe, do not add it back */\n }\n\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function (tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function (currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n\n const { attributes } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const { name, namespaceURI, value: attrValue } = attr;\n const lcName = transformCaseFunc(name);\n\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (\n trustedTypesPolicy &&\n typeof trustedTypes === 'object' &&\n typeof trustedTypes.getAttributeType === 'function'\n ) {\n if (namespaceURI) {\n /* Namespaces are not yet supported, see https://bugs.chromium.org/p/chromium/issues/detail?id=1305293 */\n } else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML': {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n\n case 'TrustedScriptURL': {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n\n default: {\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function (fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n while ((shadowNode = shadowIterator.nextNode())) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n const parentNode = getParentNode(shadowNode);\n\n /* Set the nesting depth of an element */\n if (shadowNode.nodeType === NODE_TYPE.element) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n shadowNode.__depth =\n (shadowNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n shadowNode.__depth = 1;\n }\n }\n\n /*\n * Remove an element if nested too deeply to avoid mXSS\n * or if the __depth might have been tampered with\n */\n if (\n shadowNode.__depth >= MAX_NESTING_DEPTH ||\n shadowNode.__depth < 0 ||\n numberIsNaN(shadowNode.__depth)\n ) {\n _forceRemove(shadowNode);\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n shadowNode.content.__depth = shadowNode.__depth;\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty, cfg = {}) {\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate(\n 'root node is forbidden and cannot be sanitized in-place'\n );\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (\n importedNode.nodeType === NODE_TYPE.element &&\n importedNode.nodeName === 'BODY'\n ) {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (\n !RETURN_DOM &&\n !SAFE_FOR_TEMPLATES &&\n !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1\n ) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while ((currentNode = nodeIterator.nextNode())) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n const parentNode = getParentNode(currentNode);\n\n /* Set the nesting depth of an element */\n if (currentNode.nodeType === NODE_TYPE.element) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n currentNode.__depth =\n (currentNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n currentNode.__depth = 1;\n }\n }\n\n /*\n * Remove an element if nested too deeply to avoid mXSS\n * or if the __depth might have been tampered with\n */\n if (\n currentNode.__depth >= MAX_NESTING_DEPTH ||\n currentNode.__depth < 0 ||\n numberIsNaN(currentNode.__depth)\n ) {\n _forceRemove(currentNode);\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n currentNode.content.__depth = currentNode.__depth;\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (\n WHOLE_DOCUMENT &&\n ALLOWED_TAGS['!doctype'] &&\n body.ownerDocument &&\n body.ownerDocument.doctype &&\n body.ownerDocument.doctype.name &&\n regExpTest(EXPRESSIONS.DOCTYPE_NAME, body.ownerDocument.doctype.name)\n ) {\n serializedHTML =\n '\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(serializedHTML)\n : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function (cfg = {}) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n\n return DOMPurify;\n}\n\nexport default createDOMPurify();\n"],"names":["entries","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","Object","freeze","seal","create","apply","construct","Reflect","x","fun","thisValue","args","Func","arrayForEach","unapply","Array","prototype","forEach","arrayPop","pop","arrayPush","push","stringToLowerCase","String","toLowerCase","stringToString","toString","stringMatch","match","stringReplace","replace","stringIndexOf","indexOf","stringTrim","trim","objectHasOwnProperty","hasOwnProperty","regExpTest","RegExp","test","typeErrorCreate","unconstruct","TypeError","numberIsNaN","Number","isNaN","func","thisArg","_len","arguments","length","_key","_len2","_key2","addToSet","set","array","transformCaseFunc","undefined","l","element","lcElement","cleanArray","index","isPropertyExist","clone","object","newObject","property","value","isArray","constructor","lookupGetter","prop","desc","get","fallbackValue","html","svg","svgFilters","svgDisallowed","mathMl","mathMlDisallowed","text","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","CUSTOM_ELEMENT","NODE_TYPE","attribute","cdataSection","entityReference","entityNode","progressingInstruction","comment","document","documentType","documentFragment","notation","getGlobal","window","_createTrustedTypesPolicy","trustedTypes","purifyHostElement","createPolicy","suffix","ATTR_NAME","hasAttribute","getAttribute","policyName","createHTML","createScriptURL","scriptUrl","_","console","warn","createDOMPurify","DOMPurify","root","version","VERSION","removed","nodeType","isSupported","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Node","Element","NodeFilter","NamedNodeMap","MozNamedAttrMap","HTMLFormElement","DOMParser","ElementPrototype","cloneNode","getNextSibling","getChildNodes","getParentNode","template","createElement","content","ownerDocument","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","createHTMLDocument","EXPRESSIONS","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","ATTRS","CUSTOM_ELEMENT_HANDLING","tagNameCheck","writable","configurable","enumerable","attributeNameCheck","allowCustomizedBuiltInElements","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","SANITIZE_NAMED_PROPS_PREFIX","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","DEFAULT_PARSER_MEDIA_TYPE","CONFIG","MAX_NESTING_DEPTH","formElement","isRegexOrFunction","testValue","Function","_parseConfig","cfg","ADD_URI_SAFE_ATTR","ADD_DATA_URI_TAGS","ALLOWED_URI_REGEXP","ADD_TAGS","ADD_ATTR","table","tbody","TRUSTED_TYPES_POLICY","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","ALL_SVG_TAGS","ALL_MATHML_TAGS","_checkValidNamespace","parent","tagName","namespaceURI","parentTagName","Boolean","_forceRemove","node","parentNode","removeChild","remove","_removeAttribute","name","getAttributeNode","from","removeAttribute","setAttribute","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","parseFromString","documentElement","createDocument","innerHTML","body","insertBefore","createTextNode","childNodes","call","_createNodeIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","SHOW_PROCESSING_INSTRUCTION","SHOW_CDATA_SECTION","_isClobbered","elm","__depth","__removalCount","nodeName","textContent","attributes","hasChildNodes","_isNode","_executeHook","entryPoint","currentNode","data","hook","_sanitizeElements","allowedTags","firstElementChild","_isBasicCustomElement","childCount","i","childClone","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","attr","forceKeepAttr","getAttributeType","setAttributeNS","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","importedNode","returnNode","appendChild","firstChild","nodeIterator","shadowroot","shadowrootmode","serializedHTML","outerHTML","doctype","setConfig","clearConfig","isValidAttribute","tag","addHook","hookFunction","removeHook","removeHooks","removeAllHooks"],"mappings":";;AAAA,MAAM;EACJA,OAAO;EACPC,cAAc;EACdC,QAAQ;EACRC,cAAc;AACdC,EAAAA,wBAAAA;AACF,CAAC,GAAGC,MAAM,CAAA;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MAAM,EAAEhO,KAAK,CAAC,CAAA;GAC/C,CAAA;;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACEuD,EAAAA,SAAS,CAACwM,OAAO,GAAG,UAAU7C,UAAU,EAAE8C,YAAY,EAAE;AACtD,IAAA,IAAI,OAAOA,YAAY,KAAK,UAAU,EAAE;AACtC,MAAA,OAAA;AACF,KAAA;IAEAvK,KAAK,CAACyH,UAAU,CAAC,GAAGzH,KAAK,CAACyH,UAAU,CAAC,IAAI,EAAE,CAAA;AAC3CnQ,IAAAA,SAAS,CAAC0I,KAAK,CAACyH,UAAU,CAAC,EAAE8C,YAAY,CAAC,CAAA;GAC3C,CAAA;;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACEzM,EAAAA,SAAS,CAAC0M,UAAU,GAAG,UAAU/C,UAAU,EAAE;AAC3C,IAAA,IAAIzH,KAAK,CAACyH,UAAU,CAAC,EAAE;AACrB,MAAA,OAAOrQ,QAAQ,CAAC4I,KAAK,CAACyH,UAAU,CAAC,CAAC,CAAA;AACpC,KAAA;GACD,CAAA;;AAED;AACF;AACA;AACA;AACA;AACA;AACE3J,EAAAA,SAAS,CAAC2M,WAAW,GAAG,UAAUhD,UAAU,EAAE;AAC5C,IAAA,IAAIzH,KAAK,CAACyH,UAAU,CAAC,EAAE;AACrBzH,MAAAA,KAAK,CAACyH,UAAU,CAAC,GAAG,EAAE,CAAA;AACxB,KAAA;GACD,CAAA;;AAED;AACF;AACA;AACA;EACE3J,SAAS,CAAC4M,cAAc,GAAG,YAAY;IACrC1K,KAAK,GAAG,EAAE,CAAA;GACX,CAAA;AAED,EAAA,OAAOlC,SAAS,CAAA;AAClB,CAAA;AAEA,aAAeD,eAAe,EAAE;;;;"} \ No newline at end of file diff --git a/node_modules/dompurify/dist/purify.js b/node_modules/dompurify/dist/purify.js new file mode 100644 index 0000000000..8d5b64ac03 --- /dev/null +++ b/node_modules/dompurify/dist/purify.js @@ -0,0 +1,1617 @@ +/*! @license DOMPurify 3.1.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.3/LICENSE */ + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.DOMPurify = factory()); +})(this, (function () { 'use strict'; + + const { + entries, + setPrototypeOf, + isFrozen, + getPrototypeOf, + getOwnPropertyDescriptor + } = Object; + let { + freeze, + seal, + create + } = Object; // eslint-disable-line import/no-mutable-exports + let { + apply, + construct + } = typeof Reflect !== 'undefined' && Reflect; + if (!freeze) { + freeze = function freeze(x) { + return x; + }; + } + if (!seal) { + seal = function seal(x) { + return x; + }; + } + if (!apply) { + apply = function apply(fun, thisValue, args) { + return fun.apply(thisValue, args); + }; + } + if (!construct) { + construct = function construct(Func, args) { + return new Func(...args); + }; + } + const arrayForEach = unapply(Array.prototype.forEach); + const arrayPop = unapply(Array.prototype.pop); + const arrayPush = unapply(Array.prototype.push); + const stringToLowerCase = unapply(String.prototype.toLowerCase); + const stringToString = unapply(String.prototype.toString); + const stringMatch = unapply(String.prototype.match); + const stringReplace = unapply(String.prototype.replace); + const stringIndexOf = unapply(String.prototype.indexOf); + const stringTrim = unapply(String.prototype.trim); + const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty); + const regExpTest = unapply(RegExp.prototype.test); + const typeErrorCreate = unconstruct(TypeError); + const numberIsNaN = unapply(Number.isNaN); + + /** + * Creates a new function that calls the given function with a specified thisArg and arguments. + * + * @param {Function} func - The function to be wrapped and called. + * @returns {Function} A new function that calls the given function with a specified thisArg and arguments. + */ + function unapply(func) { + return function (thisArg) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return apply(func, thisArg, args); + }; + } + + /** + * Creates a new function that constructs an instance of the given constructor function with the provided arguments. + * + * @param {Function} func - The constructor function to be wrapped and called. + * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments. + */ + function unconstruct(func) { + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + return construct(func, args); + }; + } + + /** + * Add properties to a lookup table + * + * @param {Object} set - The set to which elements will be added. + * @param {Array} array - The array containing elements to be added to the set. + * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set. + * @returns {Object} The modified set with added elements. + */ + function addToSet(set, array) { + let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase; + if (setPrototypeOf) { + // Make 'in' and truthy checks like Boolean(set.constructor) + // independent of any properties defined on Object.prototype. + // Prevent prototype setters from intercepting set as a this value. + setPrototypeOf(set, null); + } + let l = array.length; + while (l--) { + let element = array[l]; + if (typeof element === 'string') { + const lcElement = transformCaseFunc(element); + if (lcElement !== element) { + // Config presets (e.g. tags.js, attrs.js) are immutable. + if (!isFrozen(array)) { + array[l] = lcElement; + } + element = lcElement; + } + } + set[element] = true; + } + return set; + } + + /** + * Clean up an array to harden against CSPP + * + * @param {Array} array - The array to be cleaned. + * @returns {Array} The cleaned version of the array + */ + function cleanArray(array) { + for (let index = 0; index < array.length; index++) { + const isPropertyExist = objectHasOwnProperty(array, index); + if (!isPropertyExist) { + array[index] = null; + } + } + return array; + } + + /** + * Shallow clone an object + * + * @param {Object} object - The object to be cloned. + * @returns {Object} A new object that copies the original. + */ + function clone(object) { + const newObject = create(null); + for (const [property, value] of entries(object)) { + const isPropertyExist = objectHasOwnProperty(object, property); + if (isPropertyExist) { + if (Array.isArray(value)) { + newObject[property] = cleanArray(value); + } else if (value && typeof value === 'object' && value.constructor === Object) { + newObject[property] = clone(value); + } else { + newObject[property] = value; + } + } + } + return newObject; + } + + /** + * This method automatically checks if the prop is function or getter and behaves accordingly. + * + * @param {Object} object - The object to look up the getter function in its prototype chain. + * @param {String} prop - The property name for which to find the getter function. + * @returns {Function} The getter function found in the prototype chain or a fallback function. + */ + function lookupGetter(object, prop) { + while (object !== null) { + const desc = getOwnPropertyDescriptor(object, prop); + if (desc) { + if (desc.get) { + return unapply(desc.get); + } + if (typeof desc.value === 'function') { + return unapply(desc.value); + } + } + object = getPrototypeOf(object); + } + function fallbackValue() { + return null; + } + return fallbackValue; + } + + const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); + + // SVG + const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']); + const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); + + // List of SVG elements that are disallowed by default. + // We still need to know them so that we can do namespace + // checks properly in case one wants to add them to + // allow-list. + const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']); + const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']); + + // Similarly to SVG, we want to know all MathML elements, + // even those that we disallow by default. + const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']); + const text = freeze(['#text']); + + const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']); + const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']); + const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']); + const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']); + + // eslint-disable-next-line unicorn/better-regex + const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode + const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm); + const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm); + const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape + const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape + const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape + ); + + const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); + const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex + ); + + const DOCTYPE_NAME = seal(/^html$/i); + const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i); + + var EXPRESSIONS = /*#__PURE__*/Object.freeze({ + __proto__: null, + MUSTACHE_EXPR: MUSTACHE_EXPR, + ERB_EXPR: ERB_EXPR, + TMPLIT_EXPR: TMPLIT_EXPR, + DATA_ATTR: DATA_ATTR, + ARIA_ATTR: ARIA_ATTR, + IS_ALLOWED_URI: IS_ALLOWED_URI, + IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA, + ATTR_WHITESPACE: ATTR_WHITESPACE, + DOCTYPE_NAME: DOCTYPE_NAME, + CUSTOM_ELEMENT: CUSTOM_ELEMENT + }); + + // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType + const NODE_TYPE = { + element: 1, + attribute: 2, + text: 3, + cdataSection: 4, + entityReference: 5, + // Deprecated + entityNode: 6, + // Deprecated + progressingInstruction: 7, + comment: 8, + document: 9, + documentType: 10, + documentFragment: 11, + notation: 12 // Deprecated + }; + + const getGlobal = function getGlobal() { + return typeof window === 'undefined' ? null : window; + }; + + /** + * Creates a no-op policy for internal use only. + * Don't export this function outside this module! + * @param {TrustedTypePolicyFactory} trustedTypes The policy factory. + * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix). + * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types + * are not supported or creating the policy failed). + */ + const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) { + if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') { + return null; + } + + // Allow the callers to control the unique policy name + // by adding a data-tt-policy-suffix to the script element with the DOMPurify. + // Policy creation with duplicate names throws in Trusted Types. + let suffix = null; + const ATTR_NAME = 'data-tt-policy-suffix'; + if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) { + suffix = purifyHostElement.getAttribute(ATTR_NAME); + } + const policyName = 'dompurify' + (suffix ? '#' + suffix : ''); + try { + return trustedTypes.createPolicy(policyName, { + createHTML(html) { + return html; + }, + createScriptURL(scriptUrl) { + return scriptUrl; + } + }); + } catch (_) { + // Policy creation failed (most likely another DOMPurify script has + // already run). Skip creating the policy, as this will only cause errors + // if TT are enforced. + console.warn('TrustedTypes policy ' + policyName + ' could not be created.'); + return null; + } + }; + function createDOMPurify() { + let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal(); + const DOMPurify = root => createDOMPurify(root); + + /** + * Version label, exposed for easier checks + * if DOMPurify is up to date or not + */ + DOMPurify.version = '3.1.3'; + + /** + * Array of elements that DOMPurify removed during sanitation. + * Empty if nothing was removed. + */ + DOMPurify.removed = []; + if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) { + // Not running in a browser, provide a factory function + // so that you can pass your own Window + DOMPurify.isSupported = false; + return DOMPurify; + } + let { + document + } = window; + const originalDocument = document; + const currentScript = originalDocument.currentScript; + const { + DocumentFragment, + HTMLTemplateElement, + Node, + Element, + NodeFilter, + NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap, + HTMLFormElement, + DOMParser, + trustedTypes + } = window; + const ElementPrototype = Element.prototype; + const cloneNode = lookupGetter(ElementPrototype, 'cloneNode'); + const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling'); + const getChildNodes = lookupGetter(ElementPrototype, 'childNodes'); + const getParentNode = lookupGetter(ElementPrototype, 'parentNode'); + + // As per issue #47, the web-components registry is inherited by a + // new document created via createHTMLDocument. As per the spec + // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries) + // a new empty registry is used when creating a template contents owner + // document, so we use that as our parent document to ensure nothing + // is inherited. + if (typeof HTMLTemplateElement === 'function') { + const template = document.createElement('template'); + if (template.content && template.content.ownerDocument) { + document = template.content.ownerDocument; + } + } + let trustedTypesPolicy; + let emptyHTML = ''; + const { + implementation, + createNodeIterator, + createDocumentFragment, + getElementsByTagName + } = document; + const { + importNode + } = originalDocument; + let hooks = {}; + + /** + * Expose whether this browser supports running the full DOMPurify. + */ + DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined; + const { + MUSTACHE_EXPR, + ERB_EXPR, + TMPLIT_EXPR, + DATA_ATTR, + ARIA_ATTR, + IS_SCRIPT_OR_DATA, + ATTR_WHITESPACE, + CUSTOM_ELEMENT + } = EXPRESSIONS; + let { + IS_ALLOWED_URI: IS_ALLOWED_URI$1 + } = EXPRESSIONS; + + /** + * We consider the elements and attributes below to be safe. Ideally + * don't add any new ones but feel free to remove unwanted ones. + */ + + /* allowed element names */ + let ALLOWED_TAGS = null; + const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]); + + /* Allowed attribute names */ + let ALLOWED_ATTR = null; + const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]); + + /* + * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements. + * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements) + * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list) + * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`. + */ + let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, { + tagNameCheck: { + writable: true, + configurable: false, + enumerable: true, + value: null + }, + attributeNameCheck: { + writable: true, + configurable: false, + enumerable: true, + value: null + }, + allowCustomizedBuiltInElements: { + writable: true, + configurable: false, + enumerable: true, + value: false + } + })); + + /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */ + let FORBID_TAGS = null; + + /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */ + let FORBID_ATTR = null; + + /* Decide if ARIA attributes are okay */ + let ALLOW_ARIA_ATTR = true; + + /* Decide if custom data attributes are okay */ + let ALLOW_DATA_ATTR = true; + + /* Decide if unknown protocols are okay */ + let ALLOW_UNKNOWN_PROTOCOLS = false; + + /* Decide if self-closing tags in attributes are allowed. + * Usually removed due to a mXSS issue in jQuery 3.0 */ + let ALLOW_SELF_CLOSE_IN_ATTR = true; + + /* Output should be safe for common template engines. + * This means, DOMPurify removes data attributes, mustaches and ERB + */ + let SAFE_FOR_TEMPLATES = false; + + /* Output should be safe even for XML used within HTML and alike. + * This means, DOMPurify removes comments when containing risky content. + */ + let SAFE_FOR_XML = true; + + /* Decide if document with ... should be returned */ + let WHOLE_DOCUMENT = false; + + /* Track whether config is already set on this instance of DOMPurify. */ + let SET_CONFIG = false; + + /* Decide if all elements (e.g. style, script) must be children of + * document.body. By default, browsers might move them to document.head */ + let FORCE_BODY = false; + + /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html + * string (or a TrustedHTML object if Trusted Types are supported). + * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead + */ + let RETURN_DOM = false; + + /* Decide if a DOM `DocumentFragment` should be returned, instead of a html + * string (or a TrustedHTML object if Trusted Types are supported) */ + let RETURN_DOM_FRAGMENT = false; + + /* Try to return a Trusted Type object instead of a string, return a string in + * case Trusted Types are not supported */ + let RETURN_TRUSTED_TYPE = false; + + /* Output should be free from DOM clobbering attacks? + * This sanitizes markups named with colliding, clobberable built-in DOM APIs. + */ + let SANITIZE_DOM = true; + + /* Achieve full DOM Clobbering protection by isolating the namespace of named + * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules. + * + * HTML/DOM spec rules that enable DOM Clobbering: + * - Named Access on Window (§7.3.3) + * - DOM Tree Accessors (§3.1.5) + * - Form Element Parent-Child Relations (§4.10.3) + * - Iframe srcdoc / Nested WindowProxies (§4.8.5) + * - HTMLCollection (§4.2.10.2) + * + * Namespace isolation is implemented by prefixing `id` and `name` attributes + * with a constant string, i.e., `user-content-` + */ + let SANITIZE_NAMED_PROPS = false; + const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-'; + + /* Keep element content when removing element? */ + let KEEP_CONTENT = true; + + /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead + * of importing it into a new Document and returning a sanitized copy */ + let IN_PLACE = false; + + /* Allow usage of profiles like html, svg and mathMl */ + let USE_PROFILES = {}; + + /* Tags to ignore content of when KEEP_CONTENT is true */ + let FORBID_CONTENTS = null; + const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']); + + /* Tags that are safe for data: URIs */ + let DATA_URI_TAGS = null; + const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']); + + /* Attributes safe for values like "javascript:" */ + let URI_SAFE_ATTRIBUTES = null; + const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']); + const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; + const SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; + const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; + /* Document namespace */ + let NAMESPACE = HTML_NAMESPACE; + let IS_EMPTY_INPUT = false; + + /* Allowed XHTML+XML namespaces */ + let ALLOWED_NAMESPACES = null; + const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString); + + /* Parsing of strict XHTML documents */ + let PARSER_MEDIA_TYPE = null; + const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html']; + const DEFAULT_PARSER_MEDIA_TYPE = 'text/html'; + let transformCaseFunc = null; + + /* Keep a reference to config to pass to hooks */ + let CONFIG = null; + + /* Specify the maximum element nesting depth to prevent mXSS */ + const MAX_NESTING_DEPTH = 255; + + /* Ideally, do not touch anything below this line */ + /* ______________________________________________ */ + + const formElement = document.createElement('form'); + const isRegexOrFunction = function isRegexOrFunction(testValue) { + return testValue instanceof RegExp || testValue instanceof Function; + }; + + /** + * _parseConfig + * + * @param {Object} cfg optional config literal + */ + // eslint-disable-next-line complexity + const _parseConfig = function _parseConfig() { + let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + if (CONFIG && CONFIG === cfg) { + return; + } + + /* Shield configuration object from tampering */ + if (!cfg || typeof cfg !== 'object') { + cfg = {}; + } + + /* Shield configuration object from prototype pollution */ + cfg = clone(cfg); + PARSER_MEDIA_TYPE = + // eslint-disable-next-line unicorn/prefer-includes + SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE; + + // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is. + transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase; + + /* Set configuration parameters */ + ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS; + ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR; + ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES; + URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), + // eslint-disable-line indent + cfg.ADD_URI_SAFE_ATTR, + // eslint-disable-line indent + transformCaseFunc // eslint-disable-line indent + ) // eslint-disable-line indent + : DEFAULT_URI_SAFE_ATTRIBUTES; + DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), + // eslint-disable-line indent + cfg.ADD_DATA_URI_TAGS, + // eslint-disable-line indent + transformCaseFunc // eslint-disable-line indent + ) // eslint-disable-line indent + : DEFAULT_DATA_URI_TAGS; + FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS; + FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {}; + FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {}; + USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false; + ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true + ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true + ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false + ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true + SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false + SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true + WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false + RETURN_DOM = cfg.RETURN_DOM || false; // Default false + RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false + RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false + FORCE_BODY = cfg.FORCE_BODY || false; // Default false + SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true + SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false + KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true + IN_PLACE = cfg.IN_PLACE || false; // Default false + IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI; + NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE; + CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {}; + if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) { + CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck; + } + if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) { + CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck; + } + if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') { + CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements; + } + if (SAFE_FOR_TEMPLATES) { + ALLOW_DATA_ATTR = false; + } + if (RETURN_DOM_FRAGMENT) { + RETURN_DOM = true; + } + + /* Parse profile info */ + if (USE_PROFILES) { + ALLOWED_TAGS = addToSet({}, text); + ALLOWED_ATTR = []; + if (USE_PROFILES.html === true) { + addToSet(ALLOWED_TAGS, html$1); + addToSet(ALLOWED_ATTR, html); + } + if (USE_PROFILES.svg === true) { + addToSet(ALLOWED_TAGS, svg$1); + addToSet(ALLOWED_ATTR, svg); + addToSet(ALLOWED_ATTR, xml); + } + if (USE_PROFILES.svgFilters === true) { + addToSet(ALLOWED_TAGS, svgFilters); + addToSet(ALLOWED_ATTR, svg); + addToSet(ALLOWED_ATTR, xml); + } + if (USE_PROFILES.mathMl === true) { + addToSet(ALLOWED_TAGS, mathMl$1); + addToSet(ALLOWED_ATTR, mathMl); + addToSet(ALLOWED_ATTR, xml); + } + } + + /* Merge configuration parameters */ + if (cfg.ADD_TAGS) { + if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { + ALLOWED_TAGS = clone(ALLOWED_TAGS); + } + addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); + } + if (cfg.ADD_ATTR) { + if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { + ALLOWED_ATTR = clone(ALLOWED_ATTR); + } + addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); + } + if (cfg.ADD_URI_SAFE_ATTR) { + addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); + } + if (cfg.FORBID_CONTENTS) { + if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { + FORBID_CONTENTS = clone(FORBID_CONTENTS); + } + addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc); + } + + /* Add #text in case KEEP_CONTENT is set to true */ + if (KEEP_CONTENT) { + ALLOWED_TAGS['#text'] = true; + } + + /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */ + if (WHOLE_DOCUMENT) { + addToSet(ALLOWED_TAGS, ['html', 'head', 'body']); + } + + /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */ + if (ALLOWED_TAGS.table) { + addToSet(ALLOWED_TAGS, ['tbody']); + delete FORBID_TAGS.tbody; + } + if (cfg.TRUSTED_TYPES_POLICY) { + if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') { + throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); + } + if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') { + throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); + } + + // Overwrite existing TrustedTypes policy. + trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; + + // Sign local variables required by `sanitize`. + emptyHTML = trustedTypesPolicy.createHTML(''); + } else { + // Uninitialized policy, attempt to initialize the internal dompurify policy. + if (trustedTypesPolicy === undefined) { + trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript); + } + + // If creating the internal policy succeeded sign internal variables. + if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') { + emptyHTML = trustedTypesPolicy.createHTML(''); + } + } + + // Prevent further manipulation of configuration. + // Not available in IE8, Safari 5, etc. + if (freeze) { + freeze(cfg); + } + CONFIG = cfg; + }; + const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']); + const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']); + + // Certain elements are allowed in both SVG and HTML + // namespace. We need to specify them explicitly + // so that they don't get erroneously deleted from + // HTML namespace. + const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']); + + /* Keep track of all possible SVG and MathML tags + * so that we can perform the namespace checks + * correctly. */ + const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); + const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); + + /** + * @param {Element} element a DOM element whose namespace is being checked + * @returns {boolean} Return false if the element has a + * namespace that a spec-compliant parser would never + * return. Return true otherwise. + */ + const _checkValidNamespace = function _checkValidNamespace(element) { + let parent = getParentNode(element); + + // In JSDOM, if we're inside shadow DOM, then parentNode + // can be null. We just simulate parent in this case. + if (!parent || !parent.tagName) { + parent = { + namespaceURI: NAMESPACE, + tagName: 'template' + }; + } + const tagName = stringToLowerCase(element.tagName); + const parentTagName = stringToLowerCase(parent.tagName); + if (!ALLOWED_NAMESPACES[element.namespaceURI]) { + return false; + } + if (element.namespaceURI === SVG_NAMESPACE) { + // The only way to switch from HTML namespace to SVG + // is via . If it happens via any other tag, then + // it should be killed. + if (parent.namespaceURI === HTML_NAMESPACE) { + return tagName === 'svg'; + } + + // The only way to switch from MathML to SVG is via` + // svg if parent is either or MathML + // text integration points. + if (parent.namespaceURI === MATHML_NAMESPACE) { + return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); + } + + // We only allow elements that are defined in SVG + // spec. All others are disallowed in SVG namespace. + return Boolean(ALL_SVG_TAGS[tagName]); + } + if (element.namespaceURI === MATHML_NAMESPACE) { + // The only way to switch from HTML namespace to MathML + // is via . If it happens via any other tag, then + // it should be killed. + if (parent.namespaceURI === HTML_NAMESPACE) { + return tagName === 'math'; + } + + // The only way to switch from SVG to MathML is via + // and HTML integration points + if (parent.namespaceURI === SVG_NAMESPACE) { + return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName]; + } + + // We only allow elements that are defined in MathML + // spec. All others are disallowed in MathML namespace. + return Boolean(ALL_MATHML_TAGS[tagName]); + } + if (element.namespaceURI === HTML_NAMESPACE) { + // The only way to switch from SVG to HTML is via + // HTML integration points, and from MathML to HTML + // is via MathML text integration points + if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { + return false; + } + if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { + return false; + } + + // We disallow tags that are specific for MathML + // or SVG and should never appear in HTML namespace + return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); + } + + // For XHTML and XML documents that support custom namespaces + if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) { + return true; + } + + // The code should never reach this place (this means + // that the element somehow got namespace that is not + // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES). + // Return false just in case. + return false; + }; + + /** + * _forceRemove + * + * @param {Node} node a DOM node + */ + const _forceRemove = function _forceRemove(node) { + arrayPush(DOMPurify.removed, { + element: node + }); + try { + // eslint-disable-next-line unicorn/prefer-dom-node-remove + node.parentNode.removeChild(node); + } catch (_) { + node.remove(); + } + }; + + /** + * _removeAttribute + * + * @param {String} name an Attribute name + * @param {Node} node a DOM node + */ + const _removeAttribute = function _removeAttribute(name, node) { + try { + arrayPush(DOMPurify.removed, { + attribute: node.getAttributeNode(name), + from: node + }); + } catch (_) { + arrayPush(DOMPurify.removed, { + attribute: null, + from: node + }); + } + node.removeAttribute(name); + + // We void attribute values for unremovable "is"" attributes + if (name === 'is' && !ALLOWED_ATTR[name]) { + if (RETURN_DOM || RETURN_DOM_FRAGMENT) { + try { + _forceRemove(node); + } catch (_) {} + } else { + try { + node.setAttribute(name, ''); + } catch (_) {} + } + } + }; + + /** + * _initDocument + * + * @param {String} dirty a string of dirty markup + * @return {Document} a DOM, filled with the dirty markup + */ + const _initDocument = function _initDocument(dirty) { + /* Create a HTML document */ + let doc = null; + let leadingWhitespace = null; + if (FORCE_BODY) { + dirty = '' + dirty; + } else { + /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */ + const matches = stringMatch(dirty, /^[\r\n\t ]+/); + leadingWhitespace = matches && matches[0]; + } + if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) { + // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict) + dirty = '' + dirty + ''; + } + const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; + /* + * Use the DOMParser API by default, fallback later if needs be + * DOMParser not work for svg when has multiple root element. + */ + if (NAMESPACE === HTML_NAMESPACE) { + try { + doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); + } catch (_) {} + } + + /* Use createHTMLDocument in case DOMParser is not available */ + if (!doc || !doc.documentElement) { + doc = implementation.createDocument(NAMESPACE, 'template', null); + try { + doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; + } catch (_) { + // Syntax error if dirtyPayload is invalid xml + } + } + const body = doc.body || doc.documentElement; + if (dirty && leadingWhitespace) { + body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null); + } + + /* Work on whole document or just its body */ + if (NAMESPACE === HTML_NAMESPACE) { + return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0]; + } + return WHOLE_DOCUMENT ? doc.documentElement : body; + }; + + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * + * @param {Node} root The root element or node to start traversing on. + * @return {NodeIterator} The created NodeIterator + */ + const _createNodeIterator = function _createNodeIterator(root) { + return createNodeIterator.call(root.ownerDocument || root, root, + // eslint-disable-next-line no-bitwise + NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null); + }; + + /** + * _isClobbered + * + * @param {Node} elm element to check for clobbering attacks + * @return {Boolean} true if clobbered, false if safe + */ + const _isClobbered = function _isClobbered(elm) { + return elm instanceof HTMLFormElement && ( + // eslint-disable-next-line unicorn/no-typeof-undefined + typeof elm.__depth !== 'undefined' && typeof elm.__depth !== 'number' || + // eslint-disable-next-line unicorn/no-typeof-undefined + typeof elm.__removalCount !== 'undefined' && typeof elm.__removalCount !== 'number' || typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function'); + }; + + /** + * Checks whether the given object is a DOM node. + * + * @param {Node} object object to check whether it's a DOM node + * @return {Boolean} true is object is a DOM node + */ + const _isNode = function _isNode(object) { + return typeof Node === 'function' && object instanceof Node; + }; + + /** + * _executeHook + * Execute user configurable hooks + * + * @param {String} entryPoint Name of the hook's entry point + * @param {Node} currentNode node to work on with the hook + * @param {Object} data additional hook parameters + */ + const _executeHook = function _executeHook(entryPoint, currentNode, data) { + if (!hooks[entryPoint]) { + return; + } + arrayForEach(hooks[entryPoint], hook => { + hook.call(DOMPurify, currentNode, data, CONFIG); + }); + }; + + /** + * _sanitizeElements + * + * @protect nodeName + * @protect textContent + * @protect removeChild + * + * @param {Node} currentNode to check for permission to exist + * @return {Boolean} true if node was killed, false if left alive + */ + const _sanitizeElements = function _sanitizeElements(currentNode) { + let content = null; + + /* Execute a hook if present */ + _executeHook('beforeSanitizeElements', currentNode, null); + + /* Check if element is clobbered or can clobber */ + if (_isClobbered(currentNode)) { + _forceRemove(currentNode); + return true; + } + + /* Now let's check the element's type and name */ + const tagName = transformCaseFunc(currentNode.nodeName); + + /* Execute a hook if present */ + _executeHook('uponSanitizeElement', currentNode, { + tagName, + allowedTags: ALLOWED_TAGS + }); + + /* Detect mXSS attempts abusing namespace confusion */ + if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) { + _forceRemove(currentNode); + return true; + } + + /* Remove any ocurrence of processing instructions */ + if (currentNode.nodeType === NODE_TYPE.progressingInstruction) { + _forceRemove(currentNode); + return true; + } + + /* Remove any kind of possibly harmful comments */ + if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) { + _forceRemove(currentNode); + return true; + } + + /* Remove element if anything forbids its presence */ + if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { + /* Check if we have a custom element to handle */ + if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) { + if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) { + return false; + } + if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) { + return false; + } + } + + /* Keep content except for bad-listed elements */ + if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) { + const parentNode = getParentNode(currentNode) || currentNode.parentNode; + const childNodes = getChildNodes(currentNode) || currentNode.childNodes; + if (childNodes && parentNode) { + const childCount = childNodes.length; + for (let i = childCount - 1; i >= 0; --i) { + const childClone = cloneNode(childNodes[i], true); + childClone.__removalCount = (currentNode.__removalCount || 0) + 1; + parentNode.insertBefore(childClone, getNextSibling(currentNode)); + } + } + } + _forceRemove(currentNode); + return true; + } + + /* Check whether element has a valid namespace */ + if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) { + _forceRemove(currentNode); + return true; + } + + /* Make sure that older browsers don't get fallback-tag mXSS */ + if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) { + _forceRemove(currentNode); + return true; + } + + /* Sanitize element content to be template-safe */ + if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) { + /* Get the element's text content */ + content = currentNode.textContent; + arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { + content = stringReplace(content, expr, ' '); + }); + if (currentNode.textContent !== content) { + arrayPush(DOMPurify.removed, { + element: currentNode.cloneNode() + }); + currentNode.textContent = content; + } + } + + /* Execute a hook if present */ + _executeHook('afterSanitizeElements', currentNode, null); + return false; + }; + + /** + * _isValidAttribute + * + * @param {string} lcTag Lowercase tag name of containing element. + * @param {string} lcName Lowercase attribute name. + * @param {string} value Attribute value. + * @return {Boolean} Returns true if `value` is valid, otherwise false. + */ + // eslint-disable-next-line complexity + const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) { + /* Make sure attribute cannot clobber */ + if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement || value === '__depth' || value === '__removalCount')) { + return false; + } + + /* Allow valid data-* attributes: At least one character after "-" + (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes) + XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804) + We don't need to check the value; it's always URI safe. */ + if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) { + if ( + // First condition does a very basic check if a) it's basically a valid custom element tagname AND + // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck + // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck + _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || + // Alternative, second condition checks if it's an `is`-attribute, AND + // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck + lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else { + return false; + } + /* Check value is safe. First, is attr inert? If so, is safe */ + } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) { + return false; + } else ; + return true; + }; + + /** + * _isBasicCustomElement + * checks if at least one dash is included in tagName, and it's not the first char + * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name + * + * @param {string} tagName name of the tag of the node to sanitize + * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false. + */ + const _isBasicCustomElement = function _isBasicCustomElement(tagName) { + return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT); + }; + + /** + * _sanitizeAttributes + * + * @protect attributes + * @protect nodeName + * @protect removeAttribute + * @protect setAttribute + * + * @param {Node} currentNode to sanitize + */ + const _sanitizeAttributes = function _sanitizeAttributes(currentNode) { + /* Execute a hook if present */ + _executeHook('beforeSanitizeAttributes', currentNode, null); + const { + attributes + } = currentNode; + + /* Check if we have attributes; if not we might have a text node */ + if (!attributes) { + return; + } + const hookEvent = { + attrName: '', + attrValue: '', + keepAttr: true, + allowedAttributes: ALLOWED_ATTR + }; + let l = attributes.length; + + /* Go backwards over all attributes; safely remove bad ones */ + while (l--) { + const attr = attributes[l]; + const { + name, + namespaceURI, + value: attrValue + } = attr; + const lcName = transformCaseFunc(name); + let value = name === 'value' ? attrValue : stringTrim(attrValue); + + /* Execute a hook if present */ + hookEvent.attrName = lcName; + hookEvent.attrValue = value; + hookEvent.keepAttr = true; + hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set + _executeHook('uponSanitizeAttribute', currentNode, hookEvent); + value = hookEvent.attrValue; + /* Did the hooks approve of the attribute? */ + if (hookEvent.forceKeepAttr) { + continue; + } + + /* Remove attribute */ + _removeAttribute(name, currentNode); + + /* Did the hooks approve of the attribute? */ + if (!hookEvent.keepAttr) { + continue; + } + + /* Work around a security issue in jQuery 3.0 */ + if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) { + _removeAttribute(name, currentNode); + continue; + } + + /* Work around a security issue with comments inside attributes */ + if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) { + _removeAttribute(name, currentNode); + continue; + } + + /* Sanitize attribute content to be template-safe */ + if (SAFE_FOR_TEMPLATES) { + arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { + value = stringReplace(value, expr, ' '); + }); + } + + /* Is `value` valid for this attribute? */ + const lcTag = transformCaseFunc(currentNode.nodeName); + if (!_isValidAttribute(lcTag, lcName, value)) { + continue; + } + + /* Full DOM Clobbering protection via namespace isolation, + * Prefix id and name attributes with `user-content-` + */ + if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) { + // Remove the attribute with this value + _removeAttribute(name, currentNode); + + // Prefix the value and later re-create the attribute with the sanitized value + value = SANITIZE_NAMED_PROPS_PREFIX + value; + } + + /* Handle attributes that require Trusted Types */ + if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') { + if (namespaceURI) ; else { + switch (trustedTypes.getAttributeType(lcTag, lcName)) { + case 'TrustedHTML': + { + value = trustedTypesPolicy.createHTML(value); + break; + } + case 'TrustedScriptURL': + { + value = trustedTypesPolicy.createScriptURL(value); + break; + } + } + } + } + + /* Handle invalid data-* attribute set by try-catching it */ + try { + if (namespaceURI) { + currentNode.setAttributeNS(namespaceURI, name, value); + } else { + /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */ + currentNode.setAttribute(name, value); + } + if (_isClobbered(currentNode)) { + _forceRemove(currentNode); + } else { + arrayPop(DOMPurify.removed); + } + } catch (_) {} + } + + /* Execute a hook if present */ + _executeHook('afterSanitizeAttributes', currentNode, null); + }; + + /** + * _sanitizeShadowDOM + * + * @param {DocumentFragment} fragment to iterate over recursively + */ + const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) { + let shadowNode = null; + const shadowIterator = _createNodeIterator(fragment); + + /* Execute a hook if present */ + _executeHook('beforeSanitizeShadowDOM', fragment, null); + while (shadowNode = shadowIterator.nextNode()) { + /* Execute a hook if present */ + _executeHook('uponSanitizeShadowNode', shadowNode, null); + + /* Sanitize tags and elements */ + if (_sanitizeElements(shadowNode)) { + continue; + } + const parentNode = getParentNode(shadowNode); + + /* Set the nesting depth of an element */ + if (shadowNode.nodeType === NODE_TYPE.element) { + if (parentNode && parentNode.__depth) { + /* + We want the depth of the node in the original tree, which can + change when it's removed from its parent. + */ + shadowNode.__depth = (shadowNode.__removalCount || 0) + parentNode.__depth + 1; + } else { + shadowNode.__depth = 1; + } + } + + /* + * Remove an element if nested too deeply to avoid mXSS + * or if the __depth might have been tampered with + */ + if (shadowNode.__depth >= MAX_NESTING_DEPTH || shadowNode.__depth < 0 || numberIsNaN(shadowNode.__depth)) { + _forceRemove(shadowNode); + } + + /* Deep shadow DOM detected */ + if (shadowNode.content instanceof DocumentFragment) { + shadowNode.content.__depth = shadowNode.__depth; + _sanitizeShadowDOM(shadowNode.content); + } + + /* Check attributes, sanitize if necessary */ + _sanitizeAttributes(shadowNode); + } + + /* Execute a hook if present */ + _executeHook('afterSanitizeShadowDOM', fragment, null); + }; + + /** + * Sanitize + * Public method providing core sanitation functionality + * + * @param {String|Node} dirty string or DOM node + * @param {Object} cfg object + */ + // eslint-disable-next-line complexity + DOMPurify.sanitize = function (dirty) { + let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + let body = null; + let importedNode = null; + let currentNode = null; + let returnNode = null; + /* Make sure we have a string to sanitize. + DO NOT return early, as this will return the wrong type if + the user has requested a DOM object rather than a string */ + IS_EMPTY_INPUT = !dirty; + if (IS_EMPTY_INPUT) { + dirty = ''; + } + + /* Stringify, in case dirty is an object */ + if (typeof dirty !== 'string' && !_isNode(dirty)) { + if (typeof dirty.toString === 'function') { + dirty = dirty.toString(); + if (typeof dirty !== 'string') { + throw typeErrorCreate('dirty is not a string, aborting'); + } + } else { + throw typeErrorCreate('toString is not a function'); + } + } + + /* Return dirty HTML if DOMPurify cannot run */ + if (!DOMPurify.isSupported) { + return dirty; + } + + /* Assign config vars */ + if (!SET_CONFIG) { + _parseConfig(cfg); + } + + /* Clean up removed elements */ + DOMPurify.removed = []; + + /* Check if dirty is correctly typed for IN_PLACE */ + if (typeof dirty === 'string') { + IN_PLACE = false; + } + if (IN_PLACE) { + /* Do some early pre-sanitization to avoid unsafe root nodes */ + if (dirty.nodeName) { + const tagName = transformCaseFunc(dirty.nodeName); + if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { + throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place'); + } + } + } else if (dirty instanceof Node) { + /* If dirty is a DOM element, append to an empty document to avoid + elements being stripped by the parser */ + body = _initDocument(''); + importedNode = body.ownerDocument.importNode(dirty, true); + if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') { + /* Node is already a body, use as is */ + body = importedNode; + } else if (importedNode.nodeName === 'HTML') { + body = importedNode; + } else { + // eslint-disable-next-line unicorn/prefer-dom-node-append + body.appendChild(importedNode); + } + } else { + /* Exit directly if we have nothing to do */ + if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && + // eslint-disable-next-line unicorn/prefer-includes + dirty.indexOf('<') === -1) { + return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty; + } + + /* Initialize the document to work on */ + body = _initDocument(dirty); + + /* Check we have a DOM node from the data */ + if (!body) { + return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ''; + } + } + + /* Remove first element node (ours) if FORCE_BODY is set */ + if (body && FORCE_BODY) { + _forceRemove(body.firstChild); + } + + /* Get node iterator */ + const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body); + + /* Now start iterating over the created document */ + while (currentNode = nodeIterator.nextNode()) { + /* Sanitize tags and elements */ + if (_sanitizeElements(currentNode)) { + continue; + } + const parentNode = getParentNode(currentNode); + + /* Set the nesting depth of an element */ + if (currentNode.nodeType === NODE_TYPE.element) { + if (parentNode && parentNode.__depth) { + /* + We want the depth of the node in the original tree, which can + change when it's removed from its parent. + */ + currentNode.__depth = (currentNode.__removalCount || 0) + parentNode.__depth + 1; + } else { + currentNode.__depth = 1; + } + } + + /* + * Remove an element if nested too deeply to avoid mXSS + * or if the __depth might have been tampered with + */ + if (currentNode.__depth >= MAX_NESTING_DEPTH || currentNode.__depth < 0 || numberIsNaN(currentNode.__depth)) { + _forceRemove(currentNode); + } + + /* Shadow DOM detected, sanitize it */ + if (currentNode.content instanceof DocumentFragment) { + currentNode.content.__depth = currentNode.__depth; + _sanitizeShadowDOM(currentNode.content); + } + + /* Check attributes, sanitize if necessary */ + _sanitizeAttributes(currentNode); + } + + /* If we sanitized `dirty` in-place, return it. */ + if (IN_PLACE) { + return dirty; + } + + /* Return sanitized string or DOM */ + if (RETURN_DOM) { + if (RETURN_DOM_FRAGMENT) { + returnNode = createDocumentFragment.call(body.ownerDocument); + while (body.firstChild) { + // eslint-disable-next-line unicorn/prefer-dom-node-append + returnNode.appendChild(body.firstChild); + } + } else { + returnNode = body; + } + if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) { + /* + AdoptNode() is not used because internal state is not reset + (e.g. the past names map of a HTMLFormElement), this is safe + in theory but we would rather not risk another attack vector. + The state that is cloned by importNode() is explicitly defined + by the specs. + */ + returnNode = importNode.call(originalDocument, returnNode, true); + } + return returnNode; + } + let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; + + /* Serialize doctype if allowed */ + if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) { + serializedHTML = '\n' + serializedHTML; + } + + /* Sanitize final string template-safe */ + if (SAFE_FOR_TEMPLATES) { + arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { + serializedHTML = stringReplace(serializedHTML, expr, ' '); + }); + } + return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML; + }; + + /** + * Public method to set the configuration once + * setConfig + * + * @param {Object} cfg configuration object + */ + DOMPurify.setConfig = function () { + let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + _parseConfig(cfg); + SET_CONFIG = true; + }; + + /** + * Public method to remove the configuration + * clearConfig + * + */ + DOMPurify.clearConfig = function () { + CONFIG = null; + SET_CONFIG = false; + }; + + /** + * Public method to check if an attribute value is valid. + * Uses last set config, if any. Otherwise, uses config defaults. + * isValidAttribute + * + * @param {String} tag Tag name of containing element. + * @param {String} attr Attribute name. + * @param {String} value Attribute value. + * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false. + */ + DOMPurify.isValidAttribute = function (tag, attr, value) { + /* Initialize shared config vars if necessary. */ + if (!CONFIG) { + _parseConfig({}); + } + const lcTag = transformCaseFunc(tag); + const lcName = transformCaseFunc(attr); + return _isValidAttribute(lcTag, lcName, value); + }; + + /** + * AddHook + * Public method to add DOMPurify hooks + * + * @param {String} entryPoint entry point for the hook to add + * @param {Function} hookFunction function to execute + */ + DOMPurify.addHook = function (entryPoint, hookFunction) { + if (typeof hookFunction !== 'function') { + return; + } + hooks[entryPoint] = hooks[entryPoint] || []; + arrayPush(hooks[entryPoint], hookFunction); + }; + + /** + * RemoveHook + * Public method to remove a DOMPurify hook at a given entryPoint + * (pops it from the stack of hooks if more are present) + * + * @param {String} entryPoint entry point for the hook to remove + * @return {Function} removed(popped) hook + */ + DOMPurify.removeHook = function (entryPoint) { + if (hooks[entryPoint]) { + return arrayPop(hooks[entryPoint]); + } + }; + + /** + * RemoveHooks + * Public method to remove all DOMPurify hooks at a given entryPoint + * + * @param {String} entryPoint entry point for the hooks to remove + */ + DOMPurify.removeHooks = function (entryPoint) { + if (hooks[entryPoint]) { + hooks[entryPoint] = []; + } + }; + + /** + * RemoveAllHooks + * Public method to remove all DOMPurify hooks + */ + DOMPurify.removeAllHooks = function () { + hooks = {}; + }; + return DOMPurify; + } + var purify = createDOMPurify(); + + return purify; + +})); +//# sourceMappingURL=purify.js.map diff --git a/node_modules/dompurify/dist/purify.js.map b/node_modules/dompurify/dist/purify.js.map new file mode 100644 index 0000000000..59c841710b --- /dev/null +++ b/node_modules/dompurify/dist/purify.js.map @@ -0,0 +1 @@ +{"version":3,"file":"purify.js","sources":["../src/utils.js","../src/tags.js","../src/attrs.js","../src/regexp.js","../src/purify.js"],"sourcesContent":["const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n} = Object;\n\nlet { freeze, seal, create } = Object; // eslint-disable-line import/no-mutable-exports\nlet { apply, construct } = typeof Reflect !== 'undefined' && Reflect;\n\nif (!freeze) {\n freeze = function (x) {\n return x;\n };\n}\n\nif (!seal) {\n seal = function (x) {\n return x;\n };\n}\n\nif (!apply) {\n apply = function (fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\n\nif (!construct) {\n construct = function (Func, args) {\n return new Func(...args);\n };\n}\n\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayIndexOf = unapply(Array.prototype.indexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\n\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\n\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\n\nconst regExpTest = unapply(RegExp.prototype.test);\n\nconst typeErrorCreate = unconstruct(TypeError);\n\nconst numberIsNaN = unapply(Number.isNaN);\n\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return (thisArg, ...args) => apply(func, thisArg, args);\n}\n\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n return (...args) => construct(func, args);\n}\n\n/**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\nfunction addToSet(set, array, transformCaseFunc = stringToLowerCase) {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n}\n\n/**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n\n return array;\n}\n\n/**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (\n value &&\n typeof value === 'object' &&\n value.constructor === Object\n ) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n\n return newObject;\n}\n\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n\n object = getPrototypeOf(object);\n }\n\n function fallbackValue() {\n return null;\n }\n\n return fallbackValue;\n}\n\nexport {\n // Array\n arrayForEach,\n arrayIndexOf,\n arrayPop,\n arrayPush,\n arraySlice,\n // Object\n entries,\n freeze,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n isFrozen,\n setPrototypeOf,\n seal,\n clone,\n create,\n objectHasOwnProperty,\n // RegExp\n regExpTest,\n // String\n stringIndexOf,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringTrim,\n // Number\n numberIsNaN,\n // Errors\n typeErrorCreate,\n // Other\n lookupGetter,\n addToSet,\n // Reflect\n unapply,\n unconstruct,\n};\n","import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'a',\n 'abbr',\n 'acronym',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blink',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'content',\n 'data',\n 'datalist',\n 'dd',\n 'decorator',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'element',\n 'em',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'main',\n 'map',\n 'mark',\n 'marquee',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'nobr',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'section',\n 'select',\n 'shadow',\n 'small',\n 'source',\n 'spacer',\n 'span',\n 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'track',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n]);\n\n// SVG\nexport const svg = freeze([\n 'svg',\n 'a',\n 'altglyph',\n 'altglyphdef',\n 'altglyphitem',\n 'animatecolor',\n 'animatemotion',\n 'animatetransform',\n 'circle',\n 'clippath',\n 'defs',\n 'desc',\n 'ellipse',\n 'filter',\n 'font',\n 'g',\n 'glyph',\n 'glyphref',\n 'hkern',\n 'image',\n 'line',\n 'lineargradient',\n 'marker',\n 'mask',\n 'metadata',\n 'mpath',\n 'path',\n 'pattern',\n 'polygon',\n 'polyline',\n 'radialgradient',\n 'rect',\n 'stop',\n 'style',\n 'switch',\n 'symbol',\n 'text',\n 'textpath',\n 'title',\n 'tref',\n 'tspan',\n 'view',\n 'vkern',\n]);\n\nexport const svgFilters = freeze([\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDistantLight',\n 'feDropShadow',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussianBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n]);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nexport const svgDisallowed = freeze([\n 'animate',\n 'color-profile',\n 'cursor',\n 'discard',\n 'font-face',\n 'font-face-format',\n 'font-face-name',\n 'font-face-src',\n 'font-face-uri',\n 'foreignobject',\n 'hatch',\n 'hatchpath',\n 'mesh',\n 'meshgradient',\n 'meshpatch',\n 'meshrow',\n 'missing-glyph',\n 'script',\n 'set',\n 'solidcolor',\n 'unknown',\n 'use',\n]);\n\nexport const mathMl = freeze([\n 'math',\n 'menclose',\n 'merror',\n 'mfenced',\n 'mfrac',\n 'mglyph',\n 'mi',\n 'mlabeledtr',\n 'mmultiscripts',\n 'mn',\n 'mo',\n 'mover',\n 'mpadded',\n 'mphantom',\n 'mroot',\n 'mrow',\n 'ms',\n 'mspace',\n 'msqrt',\n 'mstyle',\n 'msub',\n 'msup',\n 'msubsup',\n 'mtable',\n 'mtd',\n 'mtext',\n 'mtr',\n 'munder',\n 'munderover',\n 'mprescripts',\n]);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nexport const mathMlDisallowed = freeze([\n 'maction',\n 'maligngroup',\n 'malignmark',\n 'mlongdiv',\n 'mscarries',\n 'mscarry',\n 'msgroup',\n 'mstack',\n 'msline',\n 'msrow',\n 'semantics',\n 'annotation',\n 'annotation-xml',\n 'mprescripts',\n 'none',\n]);\n\nexport const text = freeze(['#text']);\n","import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'accept',\n 'action',\n 'align',\n 'alt',\n 'autocapitalize',\n 'autocomplete',\n 'autopictureinpicture',\n 'autoplay',\n 'background',\n 'bgcolor',\n 'border',\n 'capture',\n 'cellpadding',\n 'cellspacing',\n 'checked',\n 'cite',\n 'class',\n 'clear',\n 'color',\n 'cols',\n 'colspan',\n 'controls',\n 'controlslist',\n 'coords',\n 'crossorigin',\n 'datetime',\n 'decoding',\n 'default',\n 'dir',\n 'disabled',\n 'disablepictureinpicture',\n 'disableremoteplayback',\n 'download',\n 'draggable',\n 'enctype',\n 'enterkeyhint',\n 'face',\n 'for',\n 'headers',\n 'height',\n 'hidden',\n 'high',\n 'href',\n 'hreflang',\n 'id',\n 'inputmode',\n 'integrity',\n 'ismap',\n 'kind',\n 'label',\n 'lang',\n 'list',\n 'loading',\n 'loop',\n 'low',\n 'max',\n 'maxlength',\n 'media',\n 'method',\n 'min',\n 'minlength',\n 'multiple',\n 'muted',\n 'name',\n 'nonce',\n 'noshade',\n 'novalidate',\n 'nowrap',\n 'open',\n 'optimum',\n 'pattern',\n 'placeholder',\n 'playsinline',\n 'poster',\n 'preload',\n 'pubdate',\n 'radiogroup',\n 'readonly',\n 'rel',\n 'required',\n 'rev',\n 'reversed',\n 'role',\n 'rows',\n 'rowspan',\n 'spellcheck',\n 'scope',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'span',\n 'srclang',\n 'start',\n 'src',\n 'srcset',\n 'step',\n 'style',\n 'summary',\n 'tabindex',\n 'title',\n 'translate',\n 'type',\n 'usemap',\n 'valign',\n 'value',\n 'width',\n 'wrap',\n 'xmlns',\n 'slot',\n]);\n\nexport const svg = freeze([\n 'accent-height',\n 'accumulate',\n 'additive',\n 'alignment-baseline',\n 'ascent',\n 'attributename',\n 'attributetype',\n 'azimuth',\n 'basefrequency',\n 'baseline-shift',\n 'begin',\n 'bias',\n 'by',\n 'class',\n 'clip',\n 'clippathunits',\n 'clip-path',\n 'clip-rule',\n 'color',\n 'color-interpolation',\n 'color-interpolation-filters',\n 'color-profile',\n 'color-rendering',\n 'cx',\n 'cy',\n 'd',\n 'dx',\n 'dy',\n 'diffuseconstant',\n 'direction',\n 'display',\n 'divisor',\n 'dur',\n 'edgemode',\n 'elevation',\n 'end',\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'filter',\n 'filterunits',\n 'flood-color',\n 'flood-opacity',\n 'font-family',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'fx',\n 'fy',\n 'g1',\n 'g2',\n 'glyph-name',\n 'glyphref',\n 'gradientunits',\n 'gradienttransform',\n 'height',\n 'href',\n 'id',\n 'image-rendering',\n 'in',\n 'in2',\n 'k',\n 'k1',\n 'k2',\n 'k3',\n 'k4',\n 'kerning',\n 'keypoints',\n 'keysplines',\n 'keytimes',\n 'lang',\n 'lengthadjust',\n 'letter-spacing',\n 'kernelmatrix',\n 'kernelunitlength',\n 'lighting-color',\n 'local',\n 'marker-end',\n 'marker-mid',\n 'marker-start',\n 'markerheight',\n 'markerunits',\n 'markerwidth',\n 'maskcontentunits',\n 'maskunits',\n 'max',\n 'mask',\n 'media',\n 'method',\n 'mode',\n 'min',\n 'name',\n 'numoctaves',\n 'offset',\n 'operator',\n 'opacity',\n 'order',\n 'orient',\n 'orientation',\n 'origin',\n 'overflow',\n 'paint-order',\n 'path',\n 'pathlength',\n 'patterncontentunits',\n 'patterntransform',\n 'patternunits',\n 'points',\n 'preservealpha',\n 'preserveaspectratio',\n 'primitiveunits',\n 'r',\n 'rx',\n 'ry',\n 'radius',\n 'refx',\n 'refy',\n 'repeatcount',\n 'repeatdur',\n 'restart',\n 'result',\n 'rotate',\n 'scale',\n 'seed',\n 'shape-rendering',\n 'specularconstant',\n 'specularexponent',\n 'spreadmethod',\n 'startoffset',\n 'stddeviation',\n 'stitchtiles',\n 'stop-color',\n 'stop-opacity',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-opacity',\n 'stroke',\n 'stroke-width',\n 'style',\n 'surfacescale',\n 'systemlanguage',\n 'tabindex',\n 'targetx',\n 'targety',\n 'transform',\n 'transform-origin',\n 'text-anchor',\n 'text-decoration',\n 'text-rendering',\n 'textlength',\n 'type',\n 'u1',\n 'u2',\n 'unicode',\n 'values',\n 'viewbox',\n 'visibility',\n 'version',\n 'vert-adv-y',\n 'vert-origin-x',\n 'vert-origin-y',\n 'width',\n 'word-spacing',\n 'wrap',\n 'writing-mode',\n 'xchannelselector',\n 'ychannelselector',\n 'x',\n 'x1',\n 'x2',\n 'xmlns',\n 'y',\n 'y1',\n 'y2',\n 'z',\n 'zoomandpan',\n]);\n\nexport const mathMl = freeze([\n 'accent',\n 'accentunder',\n 'align',\n 'bevelled',\n 'close',\n 'columnsalign',\n 'columnlines',\n 'columnspan',\n 'denomalign',\n 'depth',\n 'dir',\n 'display',\n 'displaystyle',\n 'encoding',\n 'fence',\n 'frame',\n 'height',\n 'href',\n 'id',\n 'largeop',\n 'length',\n 'linethickness',\n 'lspace',\n 'lquote',\n 'mathbackground',\n 'mathcolor',\n 'mathsize',\n 'mathvariant',\n 'maxsize',\n 'minsize',\n 'movablelimits',\n 'notation',\n 'numalign',\n 'open',\n 'rowalign',\n 'rowlines',\n 'rowspacing',\n 'rowspan',\n 'rspace',\n 'rquote',\n 'scriptlevel',\n 'scriptminsize',\n 'scriptsizemultiplier',\n 'selection',\n 'separator',\n 'separators',\n 'stretchy',\n 'subscriptshift',\n 'supscriptshift',\n 'symmetric',\n 'voffset',\n 'width',\n 'xmlns',\n]);\n\nexport const xml = freeze([\n 'xlink:href',\n 'xml:id',\n 'xlink:title',\n 'xml:space',\n 'xmlns:xlink',\n]);\n","import { seal } from './utils.js';\n\n// eslint-disable-next-line unicorn/better-regex\nexport const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nexport const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nexport const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\nexport const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\nexport const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nexport const IS_ALLOWED_URI = seal(\n /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nexport const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nexport const ATTR_WHITESPACE = seal(\n /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nexport const DOCTYPE_NAME = seal(/^html$/i);\nexport const CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n","import * as TAGS from './tags.js';\nimport * as ATTRS from './attrs.js';\nimport * as EXPRESSIONS from './regexp.js';\nimport {\n addToSet,\n clone,\n entries,\n freeze,\n arrayForEach,\n arrayPop,\n arrayPush,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringIndexOf,\n stringTrim,\n numberIsNaN,\n regExpTest,\n typeErrorCreate,\n lookupGetter,\n create,\n objectHasOwnProperty,\n} from './utils.js';\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5, // Deprecated\n entityNode: 6, // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12, // Deprecated\n};\n\nconst getGlobal = function () {\n return typeof window === 'undefined' ? null : window;\n};\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function (trustedTypes, purifyHostElement) {\n if (\n typeof trustedTypes !== 'object' ||\n typeof trustedTypes.createPolicy !== 'function'\n ) {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n },\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn(\n 'TrustedTypes policy ' + policyName + ' could not be created.'\n );\n return null;\n }\n};\n\nfunction createDOMPurify(window = getGlobal()) {\n const DOMPurify = (root) => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = VERSION;\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n\n if (\n !window ||\n !window.document ||\n window.document.nodeType !== NODE_TYPE.document\n ) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n\n return DOMPurify;\n }\n\n let { document } = window;\n\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes,\n } = window;\n\n const ElementPrototype = Element.prototype;\n\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n let trustedTypesPolicy;\n let emptyHTML = '';\n\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName,\n } = document;\n const { importNode } = originalDocument;\n\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported =\n typeof entries === 'function' &&\n typeof getParentNode === 'function' &&\n implementation &&\n implementation.createHTMLDocument !== undefined;\n\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT,\n } = EXPRESSIONS;\n\n let { IS_ALLOWED_URI } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [\n ...TAGS.html,\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.mathMl,\n ...TAGS.text,\n ]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [\n ...ATTRS.html,\n ...ATTRS.svg,\n ...ATTRS.mathMl,\n ...ATTRS.xml,\n ]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(\n create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false,\n },\n })\n );\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, [\n 'annotation-xml',\n 'audio',\n 'colgroup',\n 'desc',\n 'foreignobject',\n 'head',\n 'iframe',\n 'math',\n 'mi',\n 'mn',\n 'mo',\n 'ms',\n 'mtext',\n 'noembed',\n 'noframes',\n 'noscript',\n 'plaintext',\n 'script',\n 'style',\n 'svg',\n 'template',\n 'thead',\n 'title',\n 'video',\n 'xmp',\n ]);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, [\n 'audio',\n 'video',\n 'img',\n 'source',\n 'image',\n 'track',\n ]);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n 'alt',\n 'class',\n 'for',\n 'id',\n 'label',\n 'name',\n 'pattern',\n 'placeholder',\n 'role',\n 'summary',\n 'title',\n 'value',\n 'style',\n 'xmlns',\n ]);\n\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet(\n {},\n [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE],\n stringToString\n );\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Specify the maximum element nesting depth to prevent mXSS */\n const MAX_NESTING_DEPTH = 255;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n\n const isRegexOrFunction = function (testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function (cfg = {}) {\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1\n ? DEFAULT_PARSER_MEDIA_TYPE\n : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc =\n PARSER_MEDIA_TYPE === 'application/xhtml+xml'\n ? stringToString\n : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS')\n ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc)\n : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR')\n ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc)\n : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES')\n ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString)\n : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR')\n ? addToSet(\n clone(DEFAULT_URI_SAFE_ATTRIBUTES), // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS')\n ? addToSet(\n clone(DEFAULT_DATA_URI_TAGS), // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS')\n ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc)\n : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS')\n ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc)\n : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR')\n ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc)\n : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES')\n ? cfg.USE_PROFILES\n : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI = cfg.ALLOWED_URI_REGEXP || EXPRESSIONS.IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements ===\n 'boolean'\n ) {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements =\n cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, TAGS.text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, TAGS.html);\n addToSet(ALLOWED_ATTR, ATTRS.html);\n }\n\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, TAGS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, TAGS.svgFilters);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, TAGS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate(\n 'TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.'\n );\n }\n\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate(\n 'TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.'\n );\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(\n trustedTypes,\n currentScript\n );\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [\n 'mi',\n 'mo',\n 'mn',\n 'ms',\n 'mtext',\n ]);\n\n const HTML_INTEGRATION_POINTS = addToSet({}, [\n 'foreignobject',\n 'annotation-xml',\n ]);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n 'title',\n 'style',\n 'font',\n 'a',\n 'script',\n ]);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.svgDisallowed,\n ]);\n const ALL_MATHML_TAGS = addToSet({}, [\n ...TAGS.mathMl,\n ...TAGS.mathMlDisallowed,\n ]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function (element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template',\n };\n }\n\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return (\n tagName === 'svg' &&\n (parentTagName === 'annotation-xml' ||\n MATHML_TEXT_INTEGRATION_POINTS[parentTagName])\n );\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (\n parent.namespaceURI === SVG_NAMESPACE &&\n !HTML_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n if (\n parent.namespaceURI === MATHML_NAMESPACE &&\n !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return (\n !ALL_MATHML_TAGS[tagName] &&\n (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName])\n );\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n ALLOWED_NAMESPACES[element.namespaceURI]\n ) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function (node) {\n arrayPush(DOMPurify.removed, { element: node });\n\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function (name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node,\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node,\n });\n }\n\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function (dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n NAMESPACE === HTML_NAMESPACE\n ) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty =\n '' +\n dirty +\n '';\n }\n\n const dirtyPayload = trustedTypesPolicy\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT\n ? emptyHTML\n : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n\n const body = doc.body || doc.documentElement;\n\n if (dirty && leadingWhitespace) {\n body.insertBefore(\n document.createTextNode(leadingWhitespace),\n body.childNodes[0] || null\n );\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(\n doc,\n WHOLE_DOCUMENT ? 'html' : 'body'\n )[0];\n }\n\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function (root) {\n return createNodeIterator.call(\n root.ownerDocument || root,\n root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT |\n NodeFilter.SHOW_COMMENT |\n NodeFilter.SHOW_TEXT |\n NodeFilter.SHOW_PROCESSING_INSTRUCTION |\n NodeFilter.SHOW_CDATA_SECTION,\n null\n );\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function (elm) {\n return (\n elm instanceof HTMLFormElement &&\n // eslint-disable-next-line unicorn/no-typeof-undefined\n ((typeof elm.__depth !== 'undefined' &&\n typeof elm.__depth !== 'number') ||\n // eslint-disable-next-line unicorn/no-typeof-undefined\n (typeof elm.__removalCount !== 'undefined' &&\n typeof elm.__removalCount !== 'number') ||\n typeof elm.nodeName !== 'string' ||\n typeof elm.textContent !== 'string' ||\n typeof elm.removeChild !== 'function' ||\n !(elm.attributes instanceof NamedNodeMap) ||\n typeof elm.removeAttribute !== 'function' ||\n typeof elm.setAttribute !== 'function' ||\n typeof elm.namespaceURI !== 'string' ||\n typeof elm.insertBefore !== 'function' ||\n typeof elm.hasChildNodes !== 'function')\n );\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function (object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function (entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n\n arrayForEach(hooks[entryPoint], (hook) => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function (currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS,\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (\n currentNode.hasChildNodes() &&\n !_isNode(currentNode.firstElementChild) &&\n regExpTest(/<[/\\w]/g, currentNode.innerHTML) &&\n regExpTest(/<[/\\w]/g, currentNode.textContent)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any ocurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (\n SAFE_FOR_XML &&\n currentNode.nodeType === NODE_TYPE.comment &&\n regExpTest(/<[/\\w]/g, currentNode.data)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)\n ) {\n return false;\n }\n\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)\n ) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if (\n (tagName === 'noscript' ||\n tagName === 'noembed' ||\n tagName === 'noframes') &&\n regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n content = stringReplace(content, expr, ' ');\n });\n\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function (lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (\n SANITIZE_DOM &&\n (lcName === 'id' || lcName === 'name') &&\n (value in document ||\n value in formElement ||\n value === '__depth' ||\n value === '__removalCount')\n ) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (\n ALLOW_DATA_ATTR &&\n !FORBID_ATTR[lcName] &&\n regExpTest(DATA_ATTR, lcName)\n ) {\n // This attribute is safe\n } else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) {\n // This attribute is safe\n /* Otherwise, check the name is permitted */\n } else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n (_isBasicCustomElement(lcTag) &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag))) &&\n ((CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName)) ||\n (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)))) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n (lcName === 'is' &&\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))))\n ) {\n // If user has supplied a regexp or function in CUSTOM_ELEMENT_HANDLING.tagNameCheck, we need to also allow derived custom elements using the same tagName test.\n // Additionally, we need to allow attributes passing the CUSTOM_ELEMENT_HANDLING.attributeNameCheck user has configured, as custom elements can define these at their own discretion.\n } else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) {\n // This attribute is safe\n /* Check no script, data or unknown possibly unsafe URI\n unless we know URI values are safe for that attribute */\n } else if (\n regExpTest(IS_ALLOWED_URI, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Keep image data URIs alive if src/xlink:href is allowed */\n /* Further prevent gadget XSS for dynamically built script tags */\n } else if (\n (lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') &&\n lcTag !== 'script' &&\n stringIndexOf(value, 'data:') === 0 &&\n DATA_URI_TAGS[lcTag]\n ) {\n // This attribute is safe\n /* Allow unknown protocols: This provides support for links that\n are handled by protocol handlers which may be unknown ahead of\n time, e.g. fb:, spotify: */\n } else if (\n ALLOW_UNKNOWN_PROTOCOLS &&\n !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Check for binary attributes */\n } else if (value) {\n return false;\n } else {\n // Binary attributes are safe at this point\n /* Anything else, presume unsafe, do not add it back */\n }\n\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function (tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function (currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n\n const { attributes } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const { name, namespaceURI, value: attrValue } = attr;\n const lcName = transformCaseFunc(name);\n\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (\n trustedTypesPolicy &&\n typeof trustedTypes === 'object' &&\n typeof trustedTypes.getAttributeType === 'function'\n ) {\n if (namespaceURI) {\n /* Namespaces are not yet supported, see https://bugs.chromium.org/p/chromium/issues/detail?id=1305293 */\n } else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML': {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n\n case 'TrustedScriptURL': {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n\n default: {\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function (fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n while ((shadowNode = shadowIterator.nextNode())) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n const parentNode = getParentNode(shadowNode);\n\n /* Set the nesting depth of an element */\n if (shadowNode.nodeType === NODE_TYPE.element) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n shadowNode.__depth =\n (shadowNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n shadowNode.__depth = 1;\n }\n }\n\n /*\n * Remove an element if nested too deeply to avoid mXSS\n * or if the __depth might have been tampered with\n */\n if (\n shadowNode.__depth >= MAX_NESTING_DEPTH ||\n shadowNode.__depth < 0 ||\n numberIsNaN(shadowNode.__depth)\n ) {\n _forceRemove(shadowNode);\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n shadowNode.content.__depth = shadowNode.__depth;\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty, cfg = {}) {\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate(\n 'root node is forbidden and cannot be sanitized in-place'\n );\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (\n importedNode.nodeType === NODE_TYPE.element &&\n importedNode.nodeName === 'BODY'\n ) {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (\n !RETURN_DOM &&\n !SAFE_FOR_TEMPLATES &&\n !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1\n ) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while ((currentNode = nodeIterator.nextNode())) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n const parentNode = getParentNode(currentNode);\n\n /* Set the nesting depth of an element */\n if (currentNode.nodeType === NODE_TYPE.element) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n currentNode.__depth =\n (currentNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n currentNode.__depth = 1;\n }\n }\n\n /*\n * Remove an element if nested too deeply to avoid mXSS\n * or if the __depth might have been tampered with\n */\n if (\n currentNode.__depth >= MAX_NESTING_DEPTH ||\n currentNode.__depth < 0 ||\n numberIsNaN(currentNode.__depth)\n ) {\n _forceRemove(currentNode);\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n currentNode.content.__depth = currentNode.__depth;\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (\n WHOLE_DOCUMENT &&\n ALLOWED_TAGS['!doctype'] &&\n body.ownerDocument &&\n body.ownerDocument.doctype &&\n body.ownerDocument.doctype.name &&\n regExpTest(EXPRESSIONS.DOCTYPE_NAME, body.ownerDocument.doctype.name)\n ) {\n serializedHTML =\n '\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(serializedHTML)\n : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function (cfg = {}) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n\n return DOMPurify;\n}\n\nexport default createDOMPurify();\n"],"names":["entries","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","Object","freeze","seal","create","apply","construct","Reflect","x","fun","thisValue","args","Func","arrayForEach","unapply","Array","prototype","forEach","arrayPop","pop","arrayPush","push","stringToLowerCase","String","toLowerCase","stringToString","toString","stringMatch","match","stringReplace","replace","stringIndexOf","indexOf","stringTrim","trim","objectHasOwnProperty","hasOwnProperty","regExpTest","RegExp","test","typeErrorCreate","unconstruct","TypeError","numberIsNaN","Number","isNaN","func","thisArg","_len","arguments","length","_key","_len2","_key2","addToSet","set","array","transformCaseFunc","undefined","l","element","lcElement","cleanArray","index","isPropertyExist","clone","object","newObject","property","value","isArray","constructor","lookupGetter","prop","desc","get","fallbackValue","html","svg","svgFilters","svgDisallowed","mathMl","mathMlDisallowed","text","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","CUSTOM_ELEMENT","NODE_TYPE","attribute","cdataSection","entityReference","entityNode","progressingInstruction","comment","document","documentType","documentFragment","notation","getGlobal","window","_createTrustedTypesPolicy","trustedTypes","purifyHostElement","createPolicy","suffix","ATTR_NAME","hasAttribute","getAttribute","policyName","createHTML","createScriptURL","scriptUrl","_","console","warn","createDOMPurify","DOMPurify","root","version","VERSION","removed","nodeType","isSupported","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Node","Element","NodeFilter","NamedNodeMap","MozNamedAttrMap","HTMLFormElement","DOMParser","ElementPrototype","cloneNode","getNextSibling","getChildNodes","getParentNode","template","createElement","content","ownerDocument","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","createHTMLDocument","EXPRESSIONS","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","ATTRS","CUSTOM_ELEMENT_HANDLING","tagNameCheck","writable","configurable","enumerable","attributeNameCheck","allowCustomizedBuiltInElements","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","SANITIZE_NAMED_PROPS_PREFIX","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","DEFAULT_PARSER_MEDIA_TYPE","CONFIG","MAX_NESTING_DEPTH","formElement","isRegexOrFunction","testValue","Function","_parseConfig","cfg","ADD_URI_SAFE_ATTR","ADD_DATA_URI_TAGS","ALLOWED_URI_REGEXP","ADD_TAGS","ADD_ATTR","table","tbody","TRUSTED_TYPES_POLICY","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","ALL_SVG_TAGS","ALL_MATHML_TAGS","_checkValidNamespace","parent","tagName","namespaceURI","parentTagName","Boolean","_forceRemove","node","parentNode","removeChild","remove","_removeAttribute","name","getAttributeNode","from","removeAttribute","setAttribute","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","parseFromString","documentElement","createDocument","innerHTML","body","insertBefore","createTextNode","childNodes","call","_createNodeIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","SHOW_PROCESSING_INSTRUCTION","SHOW_CDATA_SECTION","_isClobbered","elm","__depth","__removalCount","nodeName","textContent","attributes","hasChildNodes","_isNode","_executeHook","entryPoint","currentNode","data","hook","_sanitizeElements","allowedTags","firstElementChild","_isBasicCustomElement","childCount","i","childClone","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","attr","forceKeepAttr","getAttributeType","setAttributeNS","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","importedNode","returnNode","appendChild","firstChild","nodeIterator","shadowroot","shadowrootmode","serializedHTML","outerHTML","doctype","setConfig","clearConfig","isValidAttribute","tag","addHook","hookFunction","removeHook","removeHooks","removeAllHooks"],"mappings":";;;;;;;;EAAA,MAAM;IACJA,OAAO;IACPC,cAAc;IACdC,QAAQ;IACRC,cAAc;EACdC,EAAAA,wBAAAA;EACF,CAAC,GAAGC,MAAM,CAAA;EAE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M,EAAEhO,KAAK,CAAC,CAAA;KAC/C,CAAA;;EAED;EACF;EACA;EACA;EACA;EACA;EACA;EACEuD,EAAAA,SAAS,CAACwM,OAAO,GAAG,UAAU7C,UAAU,EAAE8C,YAAY,EAAE;EACtD,IAAA,IAAI,OAAOA,YAAY,KAAK,UAAU,EAAE;EACtC,MAAA,OAAA;EACF,KAAA;MAEAvK,KAAK,CAACyH,UAAU,CAAC,GAAGzH,KAAK,CAACyH,UAAU,CAAC,IAAI,EAAE,CAAA;EAC3CnQ,IAAAA,SAAS,CAAC0I,KAAK,CAACyH,UAAU,CAAC,EAAE8C,YAAY,CAAC,CAAA;KAC3C,CAAA;;EAED;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACEzM,EAAAA,SAAS,CAAC0M,UAAU,GAAG,UAAU/C,UAAU,EAAE;EAC3C,IAAA,IAAIzH,KAAK,CAACyH,UAAU,CAAC,EAAE;EACrB,MAAA,OAAOrQ,QAAQ,CAAC4I,KAAK,CAACyH,UAAU,CAAC,CAAC,CAAA;EACpC,KAAA;KACD,CAAA;;EAED;EACF;EACA;EACA;EACA;EACA;EACE3J,EAAAA,SAAS,CAAC2M,WAAW,GAAG,UAAUhD,UAAU,EAAE;EAC5C,IAAA,IAAIzH,KAAK,CAACyH,UAAU,CAAC,EAAE;EACrBzH,MAAAA,KAAK,CAACyH,UAAU,CAAC,GAAG,EAAE,CAAA;EACxB,KAAA;KACD,CAAA;;EAED;EACF;EACA;EACA;IACE3J,SAAS,CAAC4M,cAAc,GAAG,YAAY;MACrC1K,KAAK,GAAG,EAAE,CAAA;KACX,CAAA;EAED,EAAA,OAAOlC,SAAS,CAAA;EAClB,CAAA;AAEA,eAAeD,eAAe,EAAE;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/dompurify/dist/purify.min.js b/node_modules/dompurify/dist/purify.min.js new file mode 100644 index 0000000000..6d61eef088 --- /dev/null +++ b/node_modules/dompurify/dist/purify.min.js @@ -0,0 +1,3 @@ +/*! @license DOMPurify 3.1.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.3/LICENSE */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=S(Array.prototype.forEach),m=S(Array.prototype.pop),p=S(Array.prototype.push),f=S(String.prototype.toLowerCase),d=S(String.prototype.toString),h=S(String.prototype.match),g=S(String.prototype.replace),_=S(String.prototype.indexOf),T=S(String.prototype.trim),y=S(Object.prototype.hasOwnProperty),E=S(RegExp.prototype.test),A=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:f;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function w(e){for(let t=0;t/gm),W=a(/\${[\w\W]*}/gm),G=a(/^data-[\-\w.\u00B7-\uFFFF]/),Y=a(/^aria-[\-\w]+$/),j=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),X=a(/^(?:\w+script|data):/i),q=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$=a(/^html$/i),K=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var V=Object.freeze({__proto__:null,MUSTACHE_EXPR:z,ERB_EXPR:B,TMPLIT_EXPR:W,DATA_ATTR:G,ARIA_ATTR:Y,IS_ALLOWED_URI:j,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:q,DOCTYPE_NAME:$,CUSTOM_ELEMENT:K});const Z=1,J=3,Q=7,ee=8,te=9,ne=function(){return"undefined"==typeof window?null:window},oe=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ne();const o=e=>t(e);if(o.version="3.1.3",o.removed=[],!n||!n.document||n.document.nodeType!==te)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:S,Element:w,NodeFilter:z,NamedNodeMap:B=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:W,DOMParser:G,trustedTypes:Y}=n,X=w.prototype,q=v(X,"cloneNode"),K=v(X,"nextSibling"),re=v(X,"childNodes"),ie=v(X,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let ae,le="";const{implementation:ce,createNodeIterator:se,createDocumentFragment:ue,getElementsByTagName:me}=r,{importNode:pe}=a;let fe={};o.isSupported="function"==typeof e&&"function"==typeof ie&&ce&&void 0!==ce.createHTMLDocument;const{MUSTACHE_EXPR:de,ERB_EXPR:he,TMPLIT_EXPR:ge,DATA_ATTR:_e,ARIA_ATTR:Te,IS_SCRIPT_OR_DATA:ye,ATTR_WHITESPACE:Ee,CUSTOM_ELEMENT:Ae}=V;let{IS_ALLOWED_URI:Ne}=V,be=null;const Se=R({},[...L,...D,...O,...k,...I]);let Re=null;const we=R({},[...U,...P,...F,...H]);let Ce=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,De=!0,Oe=!0,xe=!1,ke=!0,Me=!1,Ie=!0,Ue=!1,Pe=!1,Fe=!1,He=!1,ze=!1,Be=!1,We=!0,Ge=!1;const Ye="user-content-";let je=!0,Xe=!1,qe={},$e=null;const Ke=R({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=R({},["audio","video","img","source","image","track"]);let Je=null;const Qe=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=R({},[et,tt,nt],d);let lt=null;const ct=["application/xhtml+xml","text/html"],st="text/html";let ut=null,mt=null;const pt=255,ft=r.createElement("form"),dt=function(e){return e instanceof RegExp||e instanceof Function},ht=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!mt||mt!==e){if(e&&"object"==typeof e||(e={}),e=C(e),lt=-1===ct.indexOf(e.PARSER_MEDIA_TYPE)?st:e.PARSER_MEDIA_TYPE,ut="application/xhtml+xml"===lt?d:f,be=y(e,"ALLOWED_TAGS")?R({},e.ALLOWED_TAGS,ut):Se,Re=y(e,"ALLOWED_ATTR")?R({},e.ALLOWED_ATTR,ut):we,it=y(e,"ALLOWED_NAMESPACES")?R({},e.ALLOWED_NAMESPACES,d):at,Je=y(e,"ADD_URI_SAFE_ATTR")?R(C(Qe),e.ADD_URI_SAFE_ATTR,ut):Qe,Ve=y(e,"ADD_DATA_URI_TAGS")?R(C(Ze),e.ADD_DATA_URI_TAGS,ut):Ze,$e=y(e,"FORBID_CONTENTS")?R({},e.FORBID_CONTENTS,ut):Ke,ve=y(e,"FORBID_TAGS")?R({},e.FORBID_TAGS,ut):{},Le=y(e,"FORBID_ATTR")?R({},e.FORBID_ATTR,ut):{},qe=!!y(e,"USE_PROFILES")&&e.USE_PROFILES,De=!1!==e.ALLOW_ARIA_ATTR,Oe=!1!==e.ALLOW_DATA_ATTR,xe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Me=e.SAFE_FOR_TEMPLATES||!1,Ie=!1!==e.SAFE_FOR_XML,Ue=e.WHOLE_DOCUMENT||!1,He=e.RETURN_DOM||!1,ze=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,Fe=e.FORCE_BODY||!1,We=!1!==e.SANITIZE_DOM,Ge=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,Ne=e.ALLOWED_URI_REGEXP||j,ot=e.NAMESPACE||nt,Ce=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&dt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ce.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&dt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ce.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ce.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(Oe=!1),ze&&(He=!0),qe&&(be=R({},I),Re=[],!0===qe.html&&(R(be,L),R(Re,U)),!0===qe.svg&&(R(be,D),R(Re,P),R(Re,H)),!0===qe.svgFilters&&(R(be,O),R(Re,P),R(Re,H)),!0===qe.mathMl&&(R(be,k),R(Re,F),R(Re,H))),e.ADD_TAGS&&(be===Se&&(be=C(be)),R(be,e.ADD_TAGS,ut)),e.ADD_ATTR&&(Re===we&&(Re=C(Re)),R(Re,e.ADD_ATTR,ut)),e.ADD_URI_SAFE_ATTR&&R(Je,e.ADD_URI_SAFE_ATTR,ut),e.FORBID_CONTENTS&&($e===Ke&&($e=C($e)),R($e,e.FORBID_CONTENTS,ut)),je&&(be["#text"]=!0),Ue&&R(be,["html","head","body"]),be.table&&(R(be,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ae=e.TRUSTED_TYPES_POLICY,le=ae.createHTML("")}else void 0===ae&&(ae=oe(Y,c)),null!==ae&&"string"==typeof le&&(le=ae.createHTML(""));i&&i(e),mt=e}},gt=R({},["mi","mo","mn","ms","mtext"]),_t=R({},["foreignobject","annotation-xml"]),Tt=R({},["title","style","font","a","script"]),yt=R({},[...D,...O,...x]),Et=R({},[...k,...M]),At=function(e){let t=ie(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=f(e.tagName),o=f(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||gt[o]):Boolean(yt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&_t[o]:Boolean(Et[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!_t[o])&&(!(t.namespaceURI===et&&!gt[o])&&(!Et[n]&&(Tt[n]||!yt[n]))):!("application/xhtml+xml"!==lt||!it[e.namespaceURI]))},Nt=function(e){p(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},bt=function(e,t){try{p(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Re[e])if(He||ze)try{Nt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},St=function(e){let t=null,n=null;if(Fe)e=""+e;else{const t=h(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===lt&&ot===nt&&(e=''+e+"");const o=ae?ae.createHTML(e):e;if(ot===nt)try{t=(new G).parseFromString(o,lt)}catch(e){}if(!t||!t.documentElement){t=ce.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?le:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?me.call(t,Ue?"html":"body")[0]:Ue?t.documentElement:i},Rt=function(e){return se.call(e.ownerDocument||e,e,z.SHOW_ELEMENT|z.SHOW_COMMENT|z.SHOW_TEXT|z.SHOW_PROCESSING_INSTRUCTION|z.SHOW_CDATA_SECTION,null)},wt=function(e){return e instanceof W&&(void 0!==e.__depth&&"number"!=typeof e.__depth||void 0!==e.__removalCount&&"number"!=typeof e.__removalCount||"string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof B)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ct=function(e){return"function"==typeof S&&e instanceof S},vt=function(e,t,n){fe[e]&&u(fe[e],(e=>{e.call(o,t,n,mt)}))},Lt=function(e){let t=null;if(vt("beforeSanitizeElements",e,null),wt(e))return Nt(e),!0;const n=ut(e.nodeName);if(vt("uponSanitizeElement",e,{tagName:n,allowedTags:be}),e.hasChildNodes()&&!Ct(e.firstElementChild)&&E(/<[/\w]/g,e.innerHTML)&&E(/<[/\w]/g,e.textContent))return Nt(e),!0;if(e.nodeType===Q)return Nt(e),!0;if(Ie&&e.nodeType===ee&&E(/<[/\w]/g,e.data))return Nt(e),!0;if(!be[n]||ve[n]){if(!ve[n]&&Ot(n)){if(Ce.tagNameCheck instanceof RegExp&&E(Ce.tagNameCheck,n))return!1;if(Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ie(e)||e.parentNode,n=re(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=q(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,K(e))}}}return Nt(e),!0}return e instanceof w&&!At(e)?(Nt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!E(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&e.nodeType===J&&(t=e.textContent,u([de,he,ge],(e=>{t=g(t,e," ")})),e.textContent!==t&&(p(o.removed,{element:e.cloneNode()}),e.textContent=t)),vt("afterSanitizeElements",e,null),!1):(Nt(e),!0)},Dt=function(e,t,n){if(We&&("id"===t||"name"===t)&&(n in r||n in ft||"__depth"===n||"__removalCount"===n))return!1;if(Oe&&!Le[t]&&E(_e,t));else if(De&&E(Te,t));else if(!Re[t]||Le[t]){if(!(Ot(e)&&(Ce.tagNameCheck instanceof RegExp&&E(Ce.tagNameCheck,e)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(e))&&(Ce.attributeNameCheck instanceof RegExp&&E(Ce.attributeNameCheck,t)||Ce.attributeNameCheck instanceof Function&&Ce.attributeNameCheck(t))||"is"===t&&Ce.allowCustomizedBuiltInElements&&(Ce.tagNameCheck instanceof RegExp&&E(Ce.tagNameCheck,n)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(n))))return!1}else if(Je[t]);else if(E(Ne,g(n,Ee,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==_(n,"data:")||!Ve[e]){if(xe&&!E(ye,g(n,Ee,"")));else if(n)return!1}else;return!0},Ot=function(e){return"annotation-xml"!==e&&h(e,Ae)},xt=function(e){vt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Re};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=ut(a);let p="value"===a?c:T(c);if(n.attrName=s,n.attrValue=p,n.keepAttr=!0,n.forceKeepAttr=void 0,vt("uponSanitizeAttribute",e,n),p=n.attrValue,n.forceKeepAttr)continue;if(bt(a,e),!n.keepAttr)continue;if(!ke&&E(/\/>/i,p)){bt(a,e);continue}if(Ie&&E(/((--!?|])>)|<\/(style|title)/i,p)){bt(a,e);continue}Me&&u([de,he,ge],(e=>{p=g(p,e," ")}));const f=ut(e.nodeName);if(Dt(f,s,p)){if(!Ge||"id"!==s&&"name"!==s||(bt(a,e),p=Ye+p),ae&&"object"==typeof Y&&"function"==typeof Y.getAttributeType)if(l);else switch(Y.getAttributeType(f,s)){case"TrustedHTML":p=ae.createHTML(p);break;case"TrustedScriptURL":p=ae.createScriptURL(p)}try{l?e.setAttributeNS(l,a,p):e.setAttribute(a,p),wt(e)?Nt(e):m(o.removed)}catch(e){}}}vt("afterSanitizeAttributes",e,null)},kt=function e(t){let n=null;const o=Rt(t);for(vt("beforeSanitizeShadowDOM",t,null);n=o.nextNode();){if(vt("uponSanitizeShadowNode",n,null),Lt(n))continue;const t=ie(n);n.nodeType===Z&&(t&&t.__depth?n.__depth=(n.__removalCount||0)+t.__depth+1:n.__depth=1),(n.__depth>=pt||n.__depth<0||b(n.__depth))&&Nt(n),n.content instanceof s&&(n.content.__depth=n.__depth,e(n.content)),xt(n)}vt("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ct(e)){if("function"!=typeof e.toString)throw A("toString is not a function");if("string"!=typeof(e=e.toString()))throw A("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||ht(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=ut(e.nodeName);if(!be[t]||ve[t])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof S)n=St("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===Z&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!He&&!Me&&!Ue&&-1===e.indexOf("<"))return ae&&Be?ae.createHTML(e):e;if(n=St(e),!n)return He?null:Be?le:""}n&&Fe&&Nt(n.firstChild);const c=Rt(Xe?e:n);for(;i=c.nextNode();){if(Lt(i))continue;const e=ie(i);i.nodeType===Z&&(e&&e.__depth?i.__depth=(i.__removalCount||0)+e.__depth+1:i.__depth=1),(i.__depth>=pt||i.__depth<0||b(i.__depth))&&Nt(i),i.content instanceof s&&(i.content.__depth=i.__depth,kt(i.content)),xt(i)}if(Xe)return e;if(He){if(ze)for(l=ue.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Re.shadowroot||Re.shadowrootmode)&&(l=pe.call(a,l,!0)),l}let m=Ue?n.outerHTML:n.innerHTML;return Ue&&be["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&E($,n.ownerDocument.doctype.name)&&(m="\n"+m),Me&&u([de,he,ge],(e=>{m=g(m,e," ")})),ae&&Be?ae.createHTML(m):m},o.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ht(e),Pe=!0},o.clearConfig=function(){mt=null,Pe=!1},o.isValidAttribute=function(e,t,n){mt||ht({});const o=ut(e),r=ut(t);return Dt(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&(fe[e]=fe[e]||[],p(fe[e],t))},o.removeHook=function(e){if(fe[e])return m(fe[e])},o.removeHooks=function(e){fe[e]&&(fe[e]=[])},o.removeAllHooks=function(){fe={}},o}();return re})); +//# sourceMappingURL=purify.min.js.map diff --git a/node_modules/dompurify/dist/purify.min.js.map b/node_modules/dompurify/dist/purify.min.js.map new file mode 100644 index 0000000000..9843eacbd0 --- /dev/null +++ b/node_modules/dompurify/dist/purify.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"purify.min.js","sources":["../src/utils.js","../src/tags.js","../src/attrs.js","../src/regexp.js","../src/purify.js"],"sourcesContent":["const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n} = Object;\n\nlet { freeze, seal, create } = Object; // eslint-disable-line import/no-mutable-exports\nlet { apply, construct } = typeof Reflect !== 'undefined' && Reflect;\n\nif (!freeze) {\n freeze = function (x) {\n return x;\n };\n}\n\nif (!seal) {\n seal = function (x) {\n return x;\n };\n}\n\nif (!apply) {\n apply = function (fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\n\nif (!construct) {\n construct = function (Func, args) {\n return new Func(...args);\n };\n}\n\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayIndexOf = unapply(Array.prototype.indexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\n\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\n\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\n\nconst regExpTest = unapply(RegExp.prototype.test);\n\nconst typeErrorCreate = unconstruct(TypeError);\n\nconst numberIsNaN = unapply(Number.isNaN);\n\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return (thisArg, ...args) => apply(func, thisArg, args);\n}\n\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n return (...args) => construct(func, args);\n}\n\n/**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\nfunction addToSet(set, array, transformCaseFunc = stringToLowerCase) {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n}\n\n/**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n\n return array;\n}\n\n/**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (\n value &&\n typeof value === 'object' &&\n value.constructor === Object\n ) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n\n return newObject;\n}\n\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n\n object = getPrototypeOf(object);\n }\n\n function fallbackValue() {\n return null;\n }\n\n return fallbackValue;\n}\n\nexport {\n // Array\n arrayForEach,\n arrayIndexOf,\n arrayPop,\n arrayPush,\n arraySlice,\n // Object\n entries,\n freeze,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n isFrozen,\n setPrototypeOf,\n seal,\n clone,\n create,\n objectHasOwnProperty,\n // RegExp\n regExpTest,\n // String\n stringIndexOf,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringTrim,\n // Number\n numberIsNaN,\n // Errors\n typeErrorCreate,\n // Other\n lookupGetter,\n addToSet,\n // Reflect\n unapply,\n unconstruct,\n};\n","import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'a',\n 'abbr',\n 'acronym',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blink',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'content',\n 'data',\n 'datalist',\n 'dd',\n 'decorator',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'element',\n 'em',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'main',\n 'map',\n 'mark',\n 'marquee',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'nobr',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'section',\n 'select',\n 'shadow',\n 'small',\n 'source',\n 'spacer',\n 'span',\n 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'track',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n]);\n\n// SVG\nexport const svg = freeze([\n 'svg',\n 'a',\n 'altglyph',\n 'altglyphdef',\n 'altglyphitem',\n 'animatecolor',\n 'animatemotion',\n 'animatetransform',\n 'circle',\n 'clippath',\n 'defs',\n 'desc',\n 'ellipse',\n 'filter',\n 'font',\n 'g',\n 'glyph',\n 'glyphref',\n 'hkern',\n 'image',\n 'line',\n 'lineargradient',\n 'marker',\n 'mask',\n 'metadata',\n 'mpath',\n 'path',\n 'pattern',\n 'polygon',\n 'polyline',\n 'radialgradient',\n 'rect',\n 'stop',\n 'style',\n 'switch',\n 'symbol',\n 'text',\n 'textpath',\n 'title',\n 'tref',\n 'tspan',\n 'view',\n 'vkern',\n]);\n\nexport const svgFilters = freeze([\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDistantLight',\n 'feDropShadow',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussianBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n]);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nexport const svgDisallowed = freeze([\n 'animate',\n 'color-profile',\n 'cursor',\n 'discard',\n 'font-face',\n 'font-face-format',\n 'font-face-name',\n 'font-face-src',\n 'font-face-uri',\n 'foreignobject',\n 'hatch',\n 'hatchpath',\n 'mesh',\n 'meshgradient',\n 'meshpatch',\n 'meshrow',\n 'missing-glyph',\n 'script',\n 'set',\n 'solidcolor',\n 'unknown',\n 'use',\n]);\n\nexport const mathMl = freeze([\n 'math',\n 'menclose',\n 'merror',\n 'mfenced',\n 'mfrac',\n 'mglyph',\n 'mi',\n 'mlabeledtr',\n 'mmultiscripts',\n 'mn',\n 'mo',\n 'mover',\n 'mpadded',\n 'mphantom',\n 'mroot',\n 'mrow',\n 'ms',\n 'mspace',\n 'msqrt',\n 'mstyle',\n 'msub',\n 'msup',\n 'msubsup',\n 'mtable',\n 'mtd',\n 'mtext',\n 'mtr',\n 'munder',\n 'munderover',\n 'mprescripts',\n]);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nexport const mathMlDisallowed = freeze([\n 'maction',\n 'maligngroup',\n 'malignmark',\n 'mlongdiv',\n 'mscarries',\n 'mscarry',\n 'msgroup',\n 'mstack',\n 'msline',\n 'msrow',\n 'semantics',\n 'annotation',\n 'annotation-xml',\n 'mprescripts',\n 'none',\n]);\n\nexport const text = freeze(['#text']);\n","import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'accept',\n 'action',\n 'align',\n 'alt',\n 'autocapitalize',\n 'autocomplete',\n 'autopictureinpicture',\n 'autoplay',\n 'background',\n 'bgcolor',\n 'border',\n 'capture',\n 'cellpadding',\n 'cellspacing',\n 'checked',\n 'cite',\n 'class',\n 'clear',\n 'color',\n 'cols',\n 'colspan',\n 'controls',\n 'controlslist',\n 'coords',\n 'crossorigin',\n 'datetime',\n 'decoding',\n 'default',\n 'dir',\n 'disabled',\n 'disablepictureinpicture',\n 'disableremoteplayback',\n 'download',\n 'draggable',\n 'enctype',\n 'enterkeyhint',\n 'face',\n 'for',\n 'headers',\n 'height',\n 'hidden',\n 'high',\n 'href',\n 'hreflang',\n 'id',\n 'inputmode',\n 'integrity',\n 'ismap',\n 'kind',\n 'label',\n 'lang',\n 'list',\n 'loading',\n 'loop',\n 'low',\n 'max',\n 'maxlength',\n 'media',\n 'method',\n 'min',\n 'minlength',\n 'multiple',\n 'muted',\n 'name',\n 'nonce',\n 'noshade',\n 'novalidate',\n 'nowrap',\n 'open',\n 'optimum',\n 'pattern',\n 'placeholder',\n 'playsinline',\n 'poster',\n 'preload',\n 'pubdate',\n 'radiogroup',\n 'readonly',\n 'rel',\n 'required',\n 'rev',\n 'reversed',\n 'role',\n 'rows',\n 'rowspan',\n 'spellcheck',\n 'scope',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'span',\n 'srclang',\n 'start',\n 'src',\n 'srcset',\n 'step',\n 'style',\n 'summary',\n 'tabindex',\n 'title',\n 'translate',\n 'type',\n 'usemap',\n 'valign',\n 'value',\n 'width',\n 'wrap',\n 'xmlns',\n 'slot',\n]);\n\nexport const svg = freeze([\n 'accent-height',\n 'accumulate',\n 'additive',\n 'alignment-baseline',\n 'ascent',\n 'attributename',\n 'attributetype',\n 'azimuth',\n 'basefrequency',\n 'baseline-shift',\n 'begin',\n 'bias',\n 'by',\n 'class',\n 'clip',\n 'clippathunits',\n 'clip-path',\n 'clip-rule',\n 'color',\n 'color-interpolation',\n 'color-interpolation-filters',\n 'color-profile',\n 'color-rendering',\n 'cx',\n 'cy',\n 'd',\n 'dx',\n 'dy',\n 'diffuseconstant',\n 'direction',\n 'display',\n 'divisor',\n 'dur',\n 'edgemode',\n 'elevation',\n 'end',\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'filter',\n 'filterunits',\n 'flood-color',\n 'flood-opacity',\n 'font-family',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'fx',\n 'fy',\n 'g1',\n 'g2',\n 'glyph-name',\n 'glyphref',\n 'gradientunits',\n 'gradienttransform',\n 'height',\n 'href',\n 'id',\n 'image-rendering',\n 'in',\n 'in2',\n 'k',\n 'k1',\n 'k2',\n 'k3',\n 'k4',\n 'kerning',\n 'keypoints',\n 'keysplines',\n 'keytimes',\n 'lang',\n 'lengthadjust',\n 'letter-spacing',\n 'kernelmatrix',\n 'kernelunitlength',\n 'lighting-color',\n 'local',\n 'marker-end',\n 'marker-mid',\n 'marker-start',\n 'markerheight',\n 'markerunits',\n 'markerwidth',\n 'maskcontentunits',\n 'maskunits',\n 'max',\n 'mask',\n 'media',\n 'method',\n 'mode',\n 'min',\n 'name',\n 'numoctaves',\n 'offset',\n 'operator',\n 'opacity',\n 'order',\n 'orient',\n 'orientation',\n 'origin',\n 'overflow',\n 'paint-order',\n 'path',\n 'pathlength',\n 'patterncontentunits',\n 'patterntransform',\n 'patternunits',\n 'points',\n 'preservealpha',\n 'preserveaspectratio',\n 'primitiveunits',\n 'r',\n 'rx',\n 'ry',\n 'radius',\n 'refx',\n 'refy',\n 'repeatcount',\n 'repeatdur',\n 'restart',\n 'result',\n 'rotate',\n 'scale',\n 'seed',\n 'shape-rendering',\n 'specularconstant',\n 'specularexponent',\n 'spreadmethod',\n 'startoffset',\n 'stddeviation',\n 'stitchtiles',\n 'stop-color',\n 'stop-opacity',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-opacity',\n 'stroke',\n 'stroke-width',\n 'style',\n 'surfacescale',\n 'systemlanguage',\n 'tabindex',\n 'targetx',\n 'targety',\n 'transform',\n 'transform-origin',\n 'text-anchor',\n 'text-decoration',\n 'text-rendering',\n 'textlength',\n 'type',\n 'u1',\n 'u2',\n 'unicode',\n 'values',\n 'viewbox',\n 'visibility',\n 'version',\n 'vert-adv-y',\n 'vert-origin-x',\n 'vert-origin-y',\n 'width',\n 'word-spacing',\n 'wrap',\n 'writing-mode',\n 'xchannelselector',\n 'ychannelselector',\n 'x',\n 'x1',\n 'x2',\n 'xmlns',\n 'y',\n 'y1',\n 'y2',\n 'z',\n 'zoomandpan',\n]);\n\nexport const mathMl = freeze([\n 'accent',\n 'accentunder',\n 'align',\n 'bevelled',\n 'close',\n 'columnsalign',\n 'columnlines',\n 'columnspan',\n 'denomalign',\n 'depth',\n 'dir',\n 'display',\n 'displaystyle',\n 'encoding',\n 'fence',\n 'frame',\n 'height',\n 'href',\n 'id',\n 'largeop',\n 'length',\n 'linethickness',\n 'lspace',\n 'lquote',\n 'mathbackground',\n 'mathcolor',\n 'mathsize',\n 'mathvariant',\n 'maxsize',\n 'minsize',\n 'movablelimits',\n 'notation',\n 'numalign',\n 'open',\n 'rowalign',\n 'rowlines',\n 'rowspacing',\n 'rowspan',\n 'rspace',\n 'rquote',\n 'scriptlevel',\n 'scriptminsize',\n 'scriptsizemultiplier',\n 'selection',\n 'separator',\n 'separators',\n 'stretchy',\n 'subscriptshift',\n 'supscriptshift',\n 'symmetric',\n 'voffset',\n 'width',\n 'xmlns',\n]);\n\nexport const xml = freeze([\n 'xlink:href',\n 'xml:id',\n 'xlink:title',\n 'xml:space',\n 'xmlns:xlink',\n]);\n","import { seal } from './utils.js';\n\n// eslint-disable-next-line unicorn/better-regex\nexport const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nexport const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nexport const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\nexport const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\nexport const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nexport const IS_ALLOWED_URI = seal(\n /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nexport const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nexport const ATTR_WHITESPACE = seal(\n /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nexport const DOCTYPE_NAME = seal(/^html$/i);\nexport const CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n","import * as TAGS from './tags.js';\nimport * as ATTRS from './attrs.js';\nimport * as EXPRESSIONS from './regexp.js';\nimport {\n addToSet,\n clone,\n entries,\n freeze,\n arrayForEach,\n arrayPop,\n arrayPush,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringIndexOf,\n stringTrim,\n numberIsNaN,\n regExpTest,\n typeErrorCreate,\n lookupGetter,\n create,\n objectHasOwnProperty,\n} from './utils.js';\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5, // Deprecated\n entityNode: 6, // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12, // Deprecated\n};\n\nconst getGlobal = function () {\n return typeof window === 'undefined' ? null : window;\n};\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function (trustedTypes, purifyHostElement) {\n if (\n typeof trustedTypes !== 'object' ||\n typeof trustedTypes.createPolicy !== 'function'\n ) {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n },\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn(\n 'TrustedTypes policy ' + policyName + ' could not be created.'\n );\n return null;\n }\n};\n\nfunction createDOMPurify(window = getGlobal()) {\n const DOMPurify = (root) => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = VERSION;\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n\n if (\n !window ||\n !window.document ||\n window.document.nodeType !== NODE_TYPE.document\n ) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n\n return DOMPurify;\n }\n\n let { document } = window;\n\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes,\n } = window;\n\n const ElementPrototype = Element.prototype;\n\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n let trustedTypesPolicy;\n let emptyHTML = '';\n\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName,\n } = document;\n const { importNode } = originalDocument;\n\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported =\n typeof entries === 'function' &&\n typeof getParentNode === 'function' &&\n implementation &&\n implementation.createHTMLDocument !== undefined;\n\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT,\n } = EXPRESSIONS;\n\n let { IS_ALLOWED_URI } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [\n ...TAGS.html,\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.mathMl,\n ...TAGS.text,\n ]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [\n ...ATTRS.html,\n ...ATTRS.svg,\n ...ATTRS.mathMl,\n ...ATTRS.xml,\n ]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(\n create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false,\n },\n })\n );\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, [\n 'annotation-xml',\n 'audio',\n 'colgroup',\n 'desc',\n 'foreignobject',\n 'head',\n 'iframe',\n 'math',\n 'mi',\n 'mn',\n 'mo',\n 'ms',\n 'mtext',\n 'noembed',\n 'noframes',\n 'noscript',\n 'plaintext',\n 'script',\n 'style',\n 'svg',\n 'template',\n 'thead',\n 'title',\n 'video',\n 'xmp',\n ]);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, [\n 'audio',\n 'video',\n 'img',\n 'source',\n 'image',\n 'track',\n ]);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n 'alt',\n 'class',\n 'for',\n 'id',\n 'label',\n 'name',\n 'pattern',\n 'placeholder',\n 'role',\n 'summary',\n 'title',\n 'value',\n 'style',\n 'xmlns',\n ]);\n\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet(\n {},\n [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE],\n stringToString\n );\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Specify the maximum element nesting depth to prevent mXSS */\n const MAX_NESTING_DEPTH = 255;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n\n const isRegexOrFunction = function (testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function (cfg = {}) {\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1\n ? DEFAULT_PARSER_MEDIA_TYPE\n : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc =\n PARSER_MEDIA_TYPE === 'application/xhtml+xml'\n ? stringToString\n : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS')\n ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc)\n : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR')\n ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc)\n : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES')\n ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString)\n : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR')\n ? addToSet(\n clone(DEFAULT_URI_SAFE_ATTRIBUTES), // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS')\n ? addToSet(\n clone(DEFAULT_DATA_URI_TAGS), // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS')\n ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc)\n : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS')\n ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc)\n : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR')\n ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc)\n : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES')\n ? cfg.USE_PROFILES\n : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI = cfg.ALLOWED_URI_REGEXP || EXPRESSIONS.IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements ===\n 'boolean'\n ) {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements =\n cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, TAGS.text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, TAGS.html);\n addToSet(ALLOWED_ATTR, ATTRS.html);\n }\n\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, TAGS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, TAGS.svgFilters);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, TAGS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate(\n 'TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.'\n );\n }\n\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate(\n 'TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.'\n );\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(\n trustedTypes,\n currentScript\n );\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [\n 'mi',\n 'mo',\n 'mn',\n 'ms',\n 'mtext',\n ]);\n\n const HTML_INTEGRATION_POINTS = addToSet({}, [\n 'foreignobject',\n 'annotation-xml',\n ]);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n 'title',\n 'style',\n 'font',\n 'a',\n 'script',\n ]);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.svgDisallowed,\n ]);\n const ALL_MATHML_TAGS = addToSet({}, [\n ...TAGS.mathMl,\n ...TAGS.mathMlDisallowed,\n ]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function (element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template',\n };\n }\n\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return (\n tagName === 'svg' &&\n (parentTagName === 'annotation-xml' ||\n MATHML_TEXT_INTEGRATION_POINTS[parentTagName])\n );\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (\n parent.namespaceURI === SVG_NAMESPACE &&\n !HTML_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n if (\n parent.namespaceURI === MATHML_NAMESPACE &&\n !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return (\n !ALL_MATHML_TAGS[tagName] &&\n (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName])\n );\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n ALLOWED_NAMESPACES[element.namespaceURI]\n ) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function (node) {\n arrayPush(DOMPurify.removed, { element: node });\n\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function (name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node,\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node,\n });\n }\n\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function (dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n NAMESPACE === HTML_NAMESPACE\n ) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty =\n '' +\n dirty +\n '';\n }\n\n const dirtyPayload = trustedTypesPolicy\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT\n ? emptyHTML\n : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n\n const body = doc.body || doc.documentElement;\n\n if (dirty && leadingWhitespace) {\n body.insertBefore(\n document.createTextNode(leadingWhitespace),\n body.childNodes[0] || null\n );\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(\n doc,\n WHOLE_DOCUMENT ? 'html' : 'body'\n )[0];\n }\n\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function (root) {\n return createNodeIterator.call(\n root.ownerDocument || root,\n root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT |\n NodeFilter.SHOW_COMMENT |\n NodeFilter.SHOW_TEXT |\n NodeFilter.SHOW_PROCESSING_INSTRUCTION |\n NodeFilter.SHOW_CDATA_SECTION,\n null\n );\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function (elm) {\n return (\n elm instanceof HTMLFormElement &&\n // eslint-disable-next-line unicorn/no-typeof-undefined\n ((typeof elm.__depth !== 'undefined' &&\n typeof elm.__depth !== 'number') ||\n // eslint-disable-next-line unicorn/no-typeof-undefined\n (typeof elm.__removalCount !== 'undefined' &&\n typeof elm.__removalCount !== 'number') ||\n typeof elm.nodeName !== 'string' ||\n typeof elm.textContent !== 'string' ||\n typeof elm.removeChild !== 'function' ||\n !(elm.attributes instanceof NamedNodeMap) ||\n typeof elm.removeAttribute !== 'function' ||\n typeof elm.setAttribute !== 'function' ||\n typeof elm.namespaceURI !== 'string' ||\n typeof elm.insertBefore !== 'function' ||\n typeof elm.hasChildNodes !== 'function')\n );\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function (object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function (entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n\n arrayForEach(hooks[entryPoint], (hook) => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function (currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS,\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (\n currentNode.hasChildNodes() &&\n !_isNode(currentNode.firstElementChild) &&\n regExpTest(/<[/\\w]/g, currentNode.innerHTML) &&\n regExpTest(/<[/\\w]/g, currentNode.textContent)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any ocurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (\n SAFE_FOR_XML &&\n currentNode.nodeType === NODE_TYPE.comment &&\n regExpTest(/<[/\\w]/g, currentNode.data)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)\n ) {\n return false;\n }\n\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)\n ) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if (\n (tagName === 'noscript' ||\n tagName === 'noembed' ||\n tagName === 'noframes') &&\n regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n content = stringReplace(content, expr, ' ');\n });\n\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function (lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (\n SANITIZE_DOM &&\n (lcName === 'id' || lcName === 'name') &&\n (value in document ||\n value in formElement ||\n value === '__depth' ||\n value === '__removalCount')\n ) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (\n ALLOW_DATA_ATTR &&\n !FORBID_ATTR[lcName] &&\n regExpTest(DATA_ATTR, lcName)\n ) {\n // This attribute is safe\n } else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) {\n // This attribute is safe\n /* Otherwise, check the name is permitted */\n } else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n (_isBasicCustomElement(lcTag) &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag))) &&\n ((CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName)) ||\n (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)))) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n (lcName === 'is' &&\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))))\n ) {\n // If user has supplied a regexp or function in CUSTOM_ELEMENT_HANDLING.tagNameCheck, we need to also allow derived custom elements using the same tagName test.\n // Additionally, we need to allow attributes passing the CUSTOM_ELEMENT_HANDLING.attributeNameCheck user has configured, as custom elements can define these at their own discretion.\n } else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) {\n // This attribute is safe\n /* Check no script, data or unknown possibly unsafe URI\n unless we know URI values are safe for that attribute */\n } else if (\n regExpTest(IS_ALLOWED_URI, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Keep image data URIs alive if src/xlink:href is allowed */\n /* Further prevent gadget XSS for dynamically built script tags */\n } else if (\n (lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') &&\n lcTag !== 'script' &&\n stringIndexOf(value, 'data:') === 0 &&\n DATA_URI_TAGS[lcTag]\n ) {\n // This attribute is safe\n /* Allow unknown protocols: This provides support for links that\n are handled by protocol handlers which may be unknown ahead of\n time, e.g. fb:, spotify: */\n } else if (\n ALLOW_UNKNOWN_PROTOCOLS &&\n !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Check for binary attributes */\n } else if (value) {\n return false;\n } else {\n // Binary attributes are safe at this point\n /* Anything else, presume unsafe, do not add it back */\n }\n\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function (tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function (currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n\n const { attributes } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const { name, namespaceURI, value: attrValue } = attr;\n const lcName = transformCaseFunc(name);\n\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (\n trustedTypesPolicy &&\n typeof trustedTypes === 'object' &&\n typeof trustedTypes.getAttributeType === 'function'\n ) {\n if (namespaceURI) {\n /* Namespaces are not yet supported, see https://bugs.chromium.org/p/chromium/issues/detail?id=1305293 */\n } else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML': {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n\n case 'TrustedScriptURL': {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n\n default: {\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function (fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n while ((shadowNode = shadowIterator.nextNode())) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n const parentNode = getParentNode(shadowNode);\n\n /* Set the nesting depth of an element */\n if (shadowNode.nodeType === NODE_TYPE.element) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n shadowNode.__depth =\n (shadowNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n shadowNode.__depth = 1;\n }\n }\n\n /*\n * Remove an element if nested too deeply to avoid mXSS\n * or if the __depth might have been tampered with\n */\n if (\n shadowNode.__depth >= MAX_NESTING_DEPTH ||\n shadowNode.__depth < 0 ||\n numberIsNaN(shadowNode.__depth)\n ) {\n _forceRemove(shadowNode);\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n shadowNode.content.__depth = shadowNode.__depth;\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty, cfg = {}) {\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate(\n 'root node is forbidden and cannot be sanitized in-place'\n );\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (\n importedNode.nodeType === NODE_TYPE.element &&\n importedNode.nodeName === 'BODY'\n ) {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (\n !RETURN_DOM &&\n !SAFE_FOR_TEMPLATES &&\n !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1\n ) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while ((currentNode = nodeIterator.nextNode())) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n const parentNode = getParentNode(currentNode);\n\n /* Set the nesting depth of an element */\n if (currentNode.nodeType === NODE_TYPE.element) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n currentNode.__depth =\n (currentNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n currentNode.__depth = 1;\n }\n }\n\n /*\n * Remove an element if nested too deeply to avoid mXSS\n * or if the __depth might have been tampered with\n */\n if (\n currentNode.__depth >= MAX_NESTING_DEPTH ||\n currentNode.__depth < 0 ||\n numberIsNaN(currentNode.__depth)\n ) {\n _forceRemove(currentNode);\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n currentNode.content.__depth = currentNode.__depth;\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (\n WHOLE_DOCUMENT &&\n ALLOWED_TAGS['!doctype'] &&\n body.ownerDocument &&\n body.ownerDocument.doctype &&\n body.ownerDocument.doctype.name &&\n regExpTest(EXPRESSIONS.DOCTYPE_NAME, body.ownerDocument.doctype.name)\n ) {\n serializedHTML =\n '\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], (expr) => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(serializedHTML)\n : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function (cfg = {}) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n\n return DOMPurify;\n}\n\nexport default createDOMPurify();\n"],"names":["entries","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","Object","freeze","seal","create","apply","construct","Reflect","x","fun","thisValue","args","Func","arrayForEach","unapply","Array","prototype","forEach","arrayPop","pop","arrayPush","push","stringToLowerCase","String","toLowerCase","stringToString","toString","stringMatch","match","stringReplace","replace","stringIndexOf","indexOf","stringTrim","trim","objectHasOwnProperty","hasOwnProperty","regExpTest","RegExp","test","typeErrorCreate","func","TypeError","_len2","arguments","length","_key2","numberIsNaN","Number","isNaN","thisArg","_len","_key","addToSet","set","array","transformCaseFunc","undefined","l","element","lcElement","cleanArray","index","clone","object","newObject","property","value","isArray","constructor","lookupGetter","prop","desc","get","html","svg","svgFilters","svgDisallowed","mathMl","mathMlDisallowed","text","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","CUSTOM_ELEMENT","NODE_TYPE","getGlobal","window","_createTrustedTypesPolicy","trustedTypes","purifyHostElement","createPolicy","suffix","ATTR_NAME","hasAttribute","getAttribute","policyName","createHTML","createScriptURL","scriptUrl","_","console","warn","purify","createDOMPurify","DOMPurify","root","version","VERSION","removed","document","nodeType","isSupported","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Node","Element","NodeFilter","NamedNodeMap","MozNamedAttrMap","HTMLFormElement","DOMParser","ElementPrototype","cloneNode","getNextSibling","getChildNodes","getParentNode","template","createElement","content","ownerDocument","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","createHTMLDocument","EXPRESSIONS","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","ATTRS","CUSTOM_ELEMENT_HANDLING","tagNameCheck","writable","configurable","enumerable","attributeNameCheck","allowCustomizedBuiltInElements","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","SANITIZE_NAMED_PROPS_PREFIX","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","DEFAULT_PARSER_MEDIA_TYPE","CONFIG","MAX_NESTING_DEPTH","formElement","isRegexOrFunction","testValue","Function","_parseConfig","cfg","ADD_URI_SAFE_ATTR","ADD_DATA_URI_TAGS","ALLOWED_URI_REGEXP","ADD_TAGS","ADD_ATTR","table","tbody","TRUSTED_TYPES_POLICY","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","ALL_SVG_TAGS","ALL_MATHML_TAGS","_checkValidNamespace","parent","tagName","namespaceURI","parentTagName","Boolean","_forceRemove","node","parentNode","removeChild","remove","_removeAttribute","name","attribute","getAttributeNode","from","removeAttribute","setAttribute","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","parseFromString","documentElement","createDocument","innerHTML","body","insertBefore","createTextNode","childNodes","call","_createNodeIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","SHOW_PROCESSING_INSTRUCTION","SHOW_CDATA_SECTION","_isClobbered","elm","__depth","__removalCount","nodeName","textContent","attributes","hasChildNodes","_isNode","_executeHook","entryPoint","currentNode","data","hook","_sanitizeElements","allowedTags","firstElementChild","_isBasicCustomElement","i","childClone","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","attr","forceKeepAttr","getAttributeType","setAttributeNS","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","importedNode","returnNode","appendChild","firstChild","nodeIterator","shadowroot","shadowrootmode","serializedHTML","outerHTML","doctype","setConfig","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MAExB,CAEAH,EAASjE,EAAeiE,EAC1B,CAMA,OAJA,WACE,OAAO,IACT,CAGF,CC5LO,MAAMU,EAAOxE,EAAO,CACzB,IACA,OACA,UACA,UACA,OACA,UACA,QACA,QACA,IACA,MACA,MACA,MACA,QACA,aACA,OACA,KACA,SACA,SACA,UACA,SACA,OACA,OACA,MACA,WACA,UACA,OACA,WACA,KACA,YACA,MACA,UACA,MACA,SACA,MACA,MACA,KACA,KACA,UACA,KACA,WACA,aACA,SACA,OACA,SACA,OACA,KACA,KACA,KACA,KACA,KACA,KACA,OACA,SACA,SACA,KACA,OACA,IACA,MACA,QACA,MACA,MACA,QACA,SACA,KACA,OACA,MACA,OACA,UACA,OACA,WACA,QACA,MACA,OACA,KACA,WACA,SACA,SACA,IACA,UACA,MACA,WACA,IACA,KACA,KACA,OACA,IACA,OACA,UACA,SACA,SACA,QACA,SACA,SACA,OACA,SACA,SACA,QACA,MACA,UACA,MACA,QACA,QACA,KACA,WACA,WACA,QACA,KACA,QACA,OACA,KACA,QACA,KACA,IACA,KACA,MACA,QACA,QAIWyE,EAAMzE,EAAO,CACxB,MACA,IACA,WACA,cACA,eACA,eACA,gBACA,mBACA,SACA,WACA,OACA,OACA,UACA,SACA,OACA,IACA,QACA,WACA,QACA,QACA,OACA,iBACA,SACA,OACA,WACA,QACA,OACA,UACA,UACA,WACA,iBACA,OACA,OACA,QACA,SACA,SACA,OACA,WACA,QACA,OACA,QACA,OACA,UAGW0E,EAAa1E,EAAO,CAC/B,UACA,gBACA,sBACA,cACA,mBACA,oBACA,oBACA,iBACA,eACA,UACA,UACA,UACA,UACA,UACA,iBACA,UACA,UACA,cACA,eACA,WACA,eACA,qBACA,cACA,SACA,iBAOW2E,EAAgB3E,EAAO,CAClC,UACA,gBACA,SACA,UACA,YACA,mBACA,iBACA,gBACA,gBACA,gBACA,QACA,YACA,OACA,eACA,YACA,UACA,gBACA,SACA,MACA,aACA,UACA,QAGW4E,EAAS5E,EAAO,CAC3B,OACA,WACA,SACA,UACA,QACA,SACA,KACA,aACA,gBACA,KACA,KACA,QACA,UACA,WACA,QACA,OACA,KACA,SACA,QACA,SACA,OACA,OACA,UACA,SACA,MACA,QACA,MACA,SACA,aACA,gBAKW6E,EAAmB7E,EAAO,CACrC,UACA,cACA,aACA,WACA,YACA,UACA,UACA,SACA,SACA,QACA,YACA,aACA,iBACA,cACA,SAGW8E,EAAO9E,EAAO,CAAC,UCrRfwE,EAAOxE,EAAO,CACzB,SACA,SACA,QACA,MACA,iBACA,eACA,uBACA,WACA,aACA,UACA,SACA,UACA,cACA,cACA,UACA,OACA,QACA,QACA,QACA,OACA,UACA,WACA,eACA,SACA,cACA,WACA,WACA,UACA,MACA,WACA,0BACA,wBACA,WACA,YACA,UACA,eACA,OACA,MACA,UACA,SACA,SACA,OACA,OACA,WACA,KACA,YACA,YACA,QACA,OACA,QACA,OACA,OACA,UACA,OACA,MACA,MACA,YACA,QACA,SACA,MACA,YACA,WACA,QACA,OACA,QACA,UACA,aACA,SACA,OACA,UACA,UACA,cACA,cACA,SACA,UACA,UACA,aACA,WACA,MACA,WACA,MACA,WACA,OACA,OACA,UACA,aACA,QACA,WACA,QACA,OACA,QACA,OACA,UACA,QACA,MACA,SACA,OACA,QACA,UACA,WACA,QACA,YACA,OACA,SACA,SACA,QACA,QACA,OACA,QACA,SAGWyE,EAAMzE,EAAO,CACxB,gBACA,aACA,WACA,qBACA,SACA,gBACA,gBACA,UACA,gBACA,iBACA,QACA,OACA,KACA,QACA,OACA,gBACA,YACA,YACA,QACA,sBACA,8BACA,gBACA,kBACA,KACA,KACA,IACA,KACA,KACA,kBACA,YACA,UACA,UACA,MACA,WACA,YACA,MACA,OACA,eACA,YACA,SACA,cACA,cACA,gBACA,cACA,YACA,mBACA,eACA,aACA,eACA,cACA,KACA,KACA,KACA,KACA,aACA,WACA,gBACA,oBACA,SACA,OACA,KACA,kBACA,KACA,MACA,IACA,KACA,KACA,KACA,KACA,UACA,YACA,aACA,WACA,OACA,eACA,iBACA,eACA,mBACA,iBACA,QACA,aACA,aACA,eACA,eACA,cACA,cACA,mBACA,YACA,MACA,OACA,QACA,SACA,OACA,MACA,OACA,aACA,SACA,WACA,UACA,QACA,SACA,cACA,SACA,WACA,cACA,OACA,aACA,sBACA,mBACA,eACA,SACA,gBACA,sBACA,iBACA,IACA,KACA,KACA,SACA,OACA,OACA,cACA,YACA,UACA,SACA,SACA,QACA,OACA,kBACA,mBACA,mBACA,eACA,cACA,eACA,cACA,aACA,eACA,mBACA,oBACA,iBACA,kBACA,oBACA,iBACA,SACA,eACA,QACA,eACA,iBACA,WACA,UACA,UACA,YACA,mBACA,cACA,kBACA,iBACA,aACA,OACA,KACA,KACA,UACA,SACA,UACA,aACA,UACA,aACA,gBACA,gBACA,QACA,eACA,OACA,eACA,mBACA,mBACA,IACA,KACA,KACA,QACA,IACA,KACA,KACA,IACA,eAGW4E,EAAS5E,EAAO,CAC3B,SACA,cACA,QACA,WACA,QACA,eACA,cACA,aACA,aACA,QACA,MACA,UACA,eACA,WACA,QACA,QACA,SACA,OACA,KACA,UACA,SACA,gBACA,SACA,SACA,iBACA,YACA,WACA,cACA,UACA,UACA,gBACA,WACA,WACA,OACA,WACA,WACA,aACA,UACA,SACA,SACA,cACA,gBACA,uBACA,YACA,YACA,aACA,WACA,iBACA,iBACA,YACA,UACA,QACA,UAGW+E,EAAM/E,EAAO,CACxB,aACA,SACA,cACA,YACA,gBCtWWgF,EAAgB/E,EAAK,6BACrBgF,EAAWhF,EAAK,yBAChBiF,EAAcjF,EAAK,iBACnBkF,EAAYlF,EAAK,8BACjBmF,EAAYnF,EAAK,kBACjBoF,EAAiBpF,EAC5B,6FAEWqF,EAAoBrF,EAAK,yBACzBsF,EAAkBtF,EAC7B,+DAEWuF,EAAevF,EAAK,WACpBwF,EAAiBxF,EAAK,0NCUnC,MAAMyF,EACK,EADLA,EAGE,EAHFA,EAOoB,EAPpBA,GAQK,EARLA,GASM,EAMNC,GAAY,WAChB,MAAyB,oBAAX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eAAiB,WACzB1K,GAAQ,CAAA,GAGHnC,CACT,CAEeD"} \ No newline at end of file diff --git a/node_modules/dompurify/package.json b/node_modules/dompurify/package.json new file mode 100644 index 0000000000..6bf842bb93 --- /dev/null +++ b/node_modules/dompurify/package.json @@ -0,0 +1,128 @@ +{ + "scripts": { + "lint": "xo src/*.js", + "format": "npm run format:js && npm run format:md", + "format:md": "prettier --write --parser markdown '**/*.md'", + "format:js": "prettier --write '{src,demos,scripts,test,website}/*.js'", + "commit-amend-build": "scripts/commit-amend-build.sh", + "prebuild": "rimraf dist/**", + "dev": "cross-env NODE_ENV=development BABEL_ENV=rollup rollup -w -c -o dist/purify.js", + "build": "rollup -c", + "build:umd": "rollup -c -f umd -o dist/purify.js", + "build:umd:min": "rollup -c -f umd -o dist/purify.min.js -p terser", + "build:es": "rollup -c -f es -o dist/purify.es.mjs", + "build:cjs": "rollup -c -f cjs -o dist/purify.cjs.js", + "test:jsdom": "cross-env NODE_ENV=test BABEL_ENV=rollup node test/jsdom-node-runner --dot", + "test:karma": "cross-env NODE_ENV=test BABEL_ENV=rollup karma start test/karma.conf.js --log-level warn ", + "test:ci": "cross-env NODE_ENV=test BABEL_ENV=rollup npm run test:jsdom && npm run test:karma -- --log-level error --reporters dots --single-run --shouldTestOnBrowserStack=\"${TEST_BROWSERSTACK}\" --shouldProbeOnly=\"${TEST_PROBE_ONLY}\"", + "test": "cross-env NODE_ENV=test BABEL_ENV=rollup npm run lint && npm run test:jsdom && npm run test:karma -- --browsers Chrome" + }, + "main": "./dist/purify.cjs.js", + "module": "./dist/purify.es.mjs", + "browser": "./dist/purify.js", + "production": "./dist/purify.min.js", + "files": [ + "dist" + ], + "pre-commit": [ + "lint", + "build", + "commit-amend-build" + ], + "xo": { + "semicolon": true, + "space": 2, + "extends": [ + "prettier" + ], + "plugins": [ + "prettier" + ], + "rules": { + "import/no-useless-path-segments": 0, + "unicorn/prefer-optional-catch-binding": 0, + "unicorn/prefer-node-remove": 0, + "prettier/prettier": [ + "error", + { + "trailingComma": "es5", + "singleQuote": true + } + ], + "camelcase": [ + "error", + { + "properties": "never" + } + ] + }, + "globals": [ + "window", + "VERSION" + ] + }, + "devDependencies": { + "@babel/core": "^7.17.8", + "@babel/preset-env": "^7.16.11", + "@rollup/plugin-babel": "^5.3.1", + "@rollup/plugin-node-resolve": "^13.1.3", + "@rollup/plugin-replace": "^4.0.0", + "@types/dompurify": "^2.3.3", + "@types/estree": "^1.0.0", + "cross-env": "^7.0.3", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-prettier": "^4.0.0", + "jquery": "^3.6.0", + "jsdom": "^20.0.0", + "karma": "^6.3.17", + "karma-browserstack-launcher": "^1.5.1", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.2", + "karma-qunit": "^4.1.2", + "karma-rollup-preprocessor": "^7.0.8", + "lodash.sample": "^4.2.1", + "minimist": "^1.2.6", + "npm-run-all": "^4.1.5", + "pre-commit": "^1.2.2", + "prettier": "^2.5.1", + "qunit": "^2.4.1", + "qunit-tap": "^1.5.0", + "rimraf": "^3.0.2", + "rollup": "^2.70.1", + "rollup-plugin-includepaths": "^0.2.3", + "rollup-plugin-terser": "^7.0.2", + "xo": "^0.54.1" + }, + "resolutions": { + "natives": "1.1.6" + }, + "name": "dompurify", + "description": "DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. It's written in JavaScript and works in all modern browsers (Safari, Opera (15+), Internet Explorer (10+), Firefox and Chrome - as well as almost anything else using Blink or WebKit). DOMPurify is written by security people who have vast background in web attacks and XSS. Fear not.", + "version": "3.1.3", + "directories": { + "test": "test" + }, + "repository": { + "type": "git", + "url": "git://github.com/cure53/DOMPurify.git" + }, + "keywords": [ + "dom", + "xss", + "html", + "svg", + "mathml", + "security", + "secure", + "sanitizer", + "sanitize", + "filter", + "purify" + ], + "author": "Dr.-Ing. Mario Heiderich, Cure53 (https://cure53.de/)", + "license": "(MPL-2.0 OR Apache-2.0)", + "bugs": { + "url": "https://github.com/cure53/DOMPurify/issues" + }, + "homepage": "https://github.com/cure53/DOMPurify" +} diff --git a/package-lock.json b/package-lock.json index 1f57e16fb0..e92a98936a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "ace-builds": "^1.32.2", "bootstrap": "^5.3.2", "bootstrap-icons": "^1.11.2", + "dompurify": "^3.1.3", "event-source-polyfill": "^1.0.31", "jsonpath-plus": "^7.2.0" }, @@ -2635,6 +2636,11 @@ "node": ">=6.0.0" } }, + "node_modules/dompurify": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.3.tgz", + "integrity": "sha512-5sOWYSNPaxz6o2MUPvtyxTTqR4D3L77pr5rUQoWgD5ROQtVIZQgJkXbo1DLlK3vj11YGw5+LnF4SYti4gZmwng==" + }, "node_modules/electron-to-chromium": { "version": "1.4.616", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.616.tgz", diff --git a/package.json b/package.json index d092580c00..8008d26f58 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "dependencies": { "@popperjs/core": "^2.11.7", "@tarekraafat/autocomplete.js": "^10.2.7", + "dompurify": "^3.1.3", "ace-builds": "^1.32.2", "bootstrap": "^5.3.2", "bootstrap-icons": "^1.11.2",