UNPKG

@zazuko/yasqe

Version:

Yet Another SPARQL Query Editor

2 lines 515 kB
/*! For license information please see yasqe.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Yasqe",[],t):"object"==typeof exports?exports.Yasqe=t():e.Yasqe=t()}(self,()=>(()=>{var __webpack_modules__={3111:(e,t,r)=>{"use strict";r.d(t,{wc:()=>a,iQ:()=>c,Mg:()=>l,vy:()=>p});var i=r(2295),n=r(9121),o=r(4758),s=r(5043),a=function(){return(0,o.A)((function e(t){(0,n.A)(this,e),this.namespace=t}),[{key:"set",value:function(e,t,r,i){if(s.enabled&&(this.removeExpiredKeys(),e&&void 0!==t)){t.documentElement&&(t=(new XMLSerializer).serializeToString(t.documentElement));try{s.set(e,{namespace:this.namespace,val:t,exp:r,time:(new Date).getTime()/1e3})}catch(e){if(e instanceof Error){var n=e;if(n.quotaExceeded=function(e){var t=!1;if(e)if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t}(e),!n.quotaExceeded||!i)throw n;i(e)}throw e}}}},{key:"remove",value:function(e){s.enabled&&e&&s.remove(e)}},{key:"removeExpiredKeys",value:function(){var e=this;s.enabled&&s.each((function(t,r){t&&t.exp&&(new Date).getTime()/1e3-t.time>t.exp&&e.remove(r)}))}},{key:"removeAll",value:function(){s.enabled}},{key:"removeNamespace",value:function(){var e=this;s.each((function(t,r){t.namespace&&t.namespace===e.namespace&&e.remove(r)}))}},{key:"get",value:function(e){if(s.enabled&&e&&(this.removeExpiredKeys(),e)){var t=s.get(e);if(!t)return;return t.val}}}])}();i.A.sanitize;function l(e){if(e&&0==e.trim().indexOf("<svg")){var t=(new DOMParser).parseFromString(e,"text/xml").documentElement;t.setAttribute("aria-hidden","true");var r=document.createElement("div");return r.className="svgImg",r.appendChild(t),r}throw new Error("No svg string given. Cannot draw")}function u(e,t){if(e)return e.classList?e.classList.contains(t):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function c(e){if(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];for(var n=0,o=r;n<o.length;n++){var s=o[n];e.classList?e.classList.add(s):u(e,s)||(e.className+=" "+s)}}}function p(e,t){if(e)if(e.classList)e.classList.remove(t);else if(u(e,t)){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(r," ")}}},2928:(e,t,r)=>{"use strict";function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,o,s,a=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=o.call(r)).done)&&(a.push(i.value),a.length!==t);l=!0);}catch(e){u=!0,n=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw n}}return a}}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}var l=r(7781),u=r(160),c=r(8723),p=r(2829);function d(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function h(e,t){return t.encode?t.strict?l(e):encodeURIComponent(e):e}function f(e,t){return t.decode?u(e):e}function E(e){var t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function g(e){var t=(e=E(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function m(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function v(e,t){d((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);var r=function(e){var t;switch(e.arrayFormat){case"index":return function(e,r,i){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===i[e]&&(i[e]={}),i[e][t[1]]=r):i[e]=r};case"bracket":return function(e,r,i){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==i[e]?i[e]=[].concat(i[e],r):i[e]=[r]:i[e]=r};case"comma":case"separator":return function(t,r,i){var n="string"==typeof r&&r.includes(e.arrayFormatSeparator),o="string"==typeof r&&!n&&f(r,e).includes(e.arrayFormatSeparator);r=o?f(r,e):r;var s=n||o?r.split(e.arrayFormatSeparator).map((function(t){return f(t,e)})):null===r?r:f(r,e);i[t]=s};default:return function(e,t,r){void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),o=Object.create(null);if("string"!=typeof e)return o;if(!(e=e.trim().replace(/^[?#&]/,"")))return o;var a,l=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=s(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}(e.split("&"));try{for(l.s();!(a=l.n()).done;){var u=a.value;if(""!==u){var p=i(c(t.decode?u.replace(/\+/g," "):u,"="),2),h=p[0],E=p[1];E=void 0===E?null:["comma","separator"].includes(t.arrayFormat)?E:f(E,t),r(f(h,t),E,o)}}}catch(e){l.e(e)}finally{l.f()}for(var g=0,v=Object.keys(o);g<v.length;g++){var x=v[g],N=o[x];if("object"===n(N)&&null!==N)for(var y=0,A=Object.keys(N);y<A.length;y++){var L=A[y];N[L]=m(N[L],t)}else o[x]=m(N,t)}return!1===t.sort?o:(!0===t.sort?Object.keys(o).sort():Object.keys(o).sort(t.sort)).reduce((function(e,t){var r=o[t];return Boolean(r)&&"object"===n(r)&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"===n(t)?e(Object.keys(t)).sort((function(e,t){return Number(e)-Number(t)})).map((function(e){return t[e]})):t}(r):e[t]=r,e}),Object.create(null))}t.extract=g,t.parse=v,t.stringify=function(e,t){if(!e)return"";d((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);for(var r=function(r){return t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r]},i=function(e){switch(e.arrayFormat){case"index":return function(t){return function(r,i){var n=r.length;return void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:[].concat(o(r),null===i?[[h(t,e),"[",n,"]"].join("")]:[[h(t,e),"[",h(n,e),"]=",h(i,e)].join("")])}};case"bracket":return function(t){return function(r,i){return void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:[].concat(o(r),null===i?[[h(t,e),"[]"].join("")]:[[h(t,e),"[]=",h(i,e)].join("")])}};case"comma":case"separator":return function(t){return function(r,i){return null==i||0===i.length?r:0===r.length?[[h(t,e),"=",h(i,e)].join("")]:[[r,h(i,e)].join(e.arrayFormatSeparator)]}};default:return function(t){return function(r,i){return void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:[].concat(o(r),null===i?[h(t,e)]:[[h(t,e),"=",h(i,e)].join("")])}}}}(t),n={},s=0,a=Object.keys(e);s<a.length;s++){var l=a[s];r(l)||(n[l]=e[l])}var u=Object.keys(n);return!1!==t.sort&&u.sort(t.sort),u.map((function(r){var n=e[r];return void 0===n?"":null===n?h(r,t):Array.isArray(n)?n.reduce(i(r),[]).join("&"):h(r,t)+"="+h(n,t)})).filter((function(e){return e.length>0})).join("&")},t.parseUrl=function(e,t){t=Object.assign({decode:!0},t);var r=i(c(e,"#"),2),n=r[0],o=r[1];return Object.assign({url:n.split("?")[0]||"",query:v(g(e),t)},t&&t.parseFragmentIdentifier&&o?{fragmentIdentifier:f(o,t)}:{})},t.stringifyUrl=function(e,r){r=Object.assign({encode:!0,strict:!0},r);var i=E(e.url).split("?")[0]||"",n=t.extract(e.url),o=t.parse(n,{sort:!1}),s=Object.assign(o,e.query),a=t.stringify(s,r);a&&(a="?".concat(a));var l=function(e){var t="",r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(l="#".concat(h(e.fragmentIdentifier,r))),"".concat(i).concat(a).concat(l)},t.pick=function(e,r,i){i=Object.assign({parseFragmentIdentifier:!0},i);var n=t.parseUrl(e,i),o=n.url,s=n.query,a=n.fragmentIdentifier;return t.stringifyUrl({url:o,query:p(s,r),fragmentIdentifier:a},i)},t.exclude=function(e,r,i){var n=Array.isArray(r)?function(e){return!r.includes(e)}:function(e,t){return!r(e,t)};return t.pick(e,n,i)}},8723:e=>{"use strict";e.exports=function(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];var r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},7781:e=>{"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%".concat(e.charCodeAt(0).toString(16).toUpperCase())}))}},991:(e,t,r)=>{"use strict";r.r(t)},3380:(e,t,r)=>{"use strict";r.r(t)},6824:(e,t,r)=>{"use strict";r.r(t)},2700:(e,t,r)=>{"use strict";r.r(t)},5851:(e,t,r)=>{"use strict";r.r(t)},9436:(e,t,r)=>{"use strict";r.r(t)},8709:(e,t,r)=>{!function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),r=e.Pos,i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function n(e){return e&&e.bracketRegex||/[(){}[\]]/}function o(e,t,o){var a=e.getLineHandle(t.line),l=t.ch-1,u=o&&o.afterCursor;null==u&&(u=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=n(o),p=!u&&l>=0&&c.test(a.text.charAt(l))&&i[a.text.charAt(l)]||c.test(a.text.charAt(l+1))&&i[a.text.charAt(++l)];if(!p)return null;var d=">"==p.charAt(1)?1:-1;if(o&&o.strict&&d>0!=(l==t.ch))return null;var h=e.getTokenTypeAt(r(t.line,l+1)),f=s(e,r(t.line,l+(d>0?1:0)),d,h,o);return null==f?null:{from:r(t.line,l),to:f&&f.pos,match:f&&f.ch==p.charAt(0),forward:d>0}}function s(e,t,o,s,a){for(var l=a&&a.maxScanLineLength||1e4,u=a&&a.maxScanLines||1e3,c=[],p=n(a),d=o>0?Math.min(t.line+u,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-u),h=t.line;h!=d;h+=o){var f=e.getLine(h);if(f){var E=o>0?0:f.length-1,g=o>0?f.length:-1;if(!(f.length>l))for(h==t.line&&(E=t.ch-(o<0?1:0));E!=g;E+=o){var m=f.charAt(E);if(p.test(m)&&(void 0===s||(e.getTokenTypeAt(r(h,E+1))||"")==(s||""))){var v=i[m];if(v&&">"==v.charAt(1)==o>0)c.push(m);else{if(!c.length)return{pos:r(h,E),ch:m};c.pop()}}}}}return h-o!=(o>0?e.lastLine():e.firstLine())&&null}function a(e,i,n){for(var s=e.state.matchBrackets.maxHighlightLineLength||1e3,a=n&&n.highlightNonMatching,l=[],u=e.listSelections(),c=0;c<u.length;c++){var p=u[c].empty()&&o(e,u[c].head,n);if(p&&(p.match||!1!==a)&&e.getLine(p.from.line).length<=s){var d=p.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(e.markText(p.from,r(p.from.line,p.from.ch+1),{className:d})),p.to&&e.getLine(p.to.line).length<=s&&l.push(e.markText(p.to,r(p.to.line,p.to.ch+1),{className:d}))}}if(l.length){t&&e.state.focused&&e.focus();var h=function(){e.operation((function(){for(var e=0;e<l.length;e++)l[e].clear()}))};if(!i)return h;setTimeout(h,800)}}function l(e){e.operation((function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=a(e,!1,e.state.matchBrackets)}))}function u(e){e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)}e.defineOption("matchBrackets",!1,(function(t,r,i){i&&i!=e.Init&&(t.off("cursorActivity",l),t.off("focus",l),t.off("blur",u),u(t)),r&&(t.state.matchBrackets="object"==typeof r?r:{},t.on("cursorActivity",l),t.on("focus",l),t.on("blur",u))})),e.defineExtension("matchBrackets",(function(){a(this,!0)})),e.defineExtension("findMatchingBracket",(function(e,t,r){return(r||"boolean"==typeof t)&&(r?(r.strict=t,t=r):t=t?{strict:!0}:null),o(this,e,t)})),e.defineExtension("scanForBracket",(function(e,t,r,i){return s(this,e,t,r,i)}))}(r(1719))},666:(e,t,r)=>{!function(e){"use strict";function t(t){return function(r,i){var n=i.line,o=r.getLine(n);function s(t){for(var s,a=i.ch,l=0;;){var u=a<=0?-1:o.lastIndexOf(t[0],a-1);if(-1!=u){if(1==l&&u<i.ch)break;if(s=r.getTokenTypeAt(e.Pos(n,u+1)),!/^(comment|string)/.test(s))return{ch:u+1,tokenType:s,pair:t};a=u-1}else{if(1==l)break;l=1,a=o.length}}}function a(t){var i,o,s=1,a=r.lastLine(),l=t.ch;e:for(var u=n;u<=a;++u)for(var c=r.getLine(u),p=u==n?l:0;;){var d=c.indexOf(t.pair[0],p),h=c.indexOf(t.pair[1],p);if(d<0&&(d=c.length),h<0&&(h=c.length),(p=Math.min(d,h))==c.length)break;if(r.getTokenTypeAt(e.Pos(u,p+1))==t.tokenType)if(p==d)++s;else if(!--s){i=u,o=p;break e}++p}return null==i||n==i?null:{from:e.Pos(n,l),to:e.Pos(i,o)}}for(var l=[],u=0;u<t.length;u++){var c=s(t[u]);c&&l.push(c)}for(l.sort((function(e,t){return e.ch-t.ch})),u=0;u<l.length;u++){var p=a(l[u]);if(p)return p}return null}}e.registerHelper("fold","brace",t([["{","}"],["[","]"]])),e.registerHelper("fold","brace-paren",t([["{","}"],["[","]"],["(",")"]])),e.registerHelper("fold","import",(function(t,r){function i(r){if(r<t.firstLine()||r>t.lastLine())return null;var i=t.getTokenAt(e.Pos(r,1));if(/\S/.test(i.string)||(i=t.getTokenAt(e.Pos(r,i.end+1))),"keyword"!=i.type||"import"!=i.string)return null;for(var n=r,o=Math.min(t.lastLine(),r+10);n<=o;++n){var s=t.getLine(n).indexOf(";");if(-1!=s)return{startCh:i.end,end:e.Pos(n,s)}}}var n,o=r.line,s=i(o);if(!s||i(o-1)||(n=i(o-2))&&n.end.line==o-1)return null;for(var a=s.end;;){var l=i(a.line+1);if(null==l)break;a=l.end}return{from:t.clipPos(e.Pos(o,s.startCh+1)),to:a}})),e.registerHelper("fold","include",(function(t,r){function i(r){if(r<t.firstLine()||r>t.lastLine())return null;var i=t.getTokenAt(e.Pos(r,1));return/\S/.test(i.string)||(i=t.getTokenAt(e.Pos(r,i.end+1))),"meta"==i.type&&"#include"==i.string.slice(0,8)?i.start+8:void 0}var n=r.line,o=i(n);if(null==o||null!=i(n-1))return null;for(var s=n;null!=i(s+1);)++s;return{from:e.Pos(n,o+1),to:t.clipPos(e.Pos(s))}}))}(r(1719))},9754:(e,t,r)=>{!function(e){"use strict";function t(t,r,n,o){if(n&&n.call){var s=n;n=null}else s=i(t,n,"rangeFinder");"number"==typeof r&&(r=e.Pos(r,0));var a=i(t,n,"minFoldSize");function l(e){var i=s(t,r);if(!i||i.to.line-i.from.line<a)return null;if("fold"===o)return i;for(var n=t.findMarksAt(i.from),l=0;l<n.length;++l)if(n[l].__isFold){if(!e)return null;i.cleared=!0,n[l].clear()}return i}var u=l(!0);if(i(t,n,"scanUp"))for(;!u&&r.line>t.firstLine();)r=e.Pos(r.line-1,0),u=l(!1);if(u&&!u.cleared&&"unfold"!==o){var c=function(e,t,r){var n=i(e,t,"widget");if("function"==typeof n&&(n=n(r.from,r.to)),"string"==typeof n){var o=document.createTextNode(n);(n=document.createElement("span")).appendChild(o),n.className="CodeMirror-foldmarker"}else n&&(n=n.cloneNode(!0));return n}(t,n,u);e.on(c,"mousedown",(function(t){p.clear(),e.e_preventDefault(t)}));var p=t.markText(u.from,u.to,{replacedWith:c,clearOnEnter:i(t,n,"clearOnEnter"),__isFold:!0});p.on("clear",(function(r,i){e.signal(t,"unfold",t,r,i)})),e.signal(t,"fold",t,u.from,u.to)}}e.newFoldFunction=function(e,r){return function(i,n){t(i,n,{rangeFinder:e,widget:r})}},e.defineExtension("foldCode",(function(e,r,i){t(this,e,r,i)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),r=0;r<t.length;++r)if(t[r].__isFold)return!0})),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),{scanUp:!1},"unfold")},e.commands.foldAll=function(t){t.operation((function(){for(var r=t.firstLine(),i=t.lastLine();r<=i;r++)t.foldCode(e.Pos(r,0),{scanUp:!1},"fold")}))},e.commands.unfoldAll=function(t){t.operation((function(){for(var r=t.firstLine(),i=t.lastLine();r<=i;r++)t.foldCode(e.Pos(r,0),{scanUp:!1},"unfold")}))},e.registerHelper("fold","combine",(function(){var e=Array.prototype.slice.call(arguments,0);return function(t,r){for(var i=0;i<e.length;++i){var n=e[i](t,r);if(n)return n}}})),e.registerHelper("fold","auto",(function(e,t){for(var r=e.getHelpers(t,"fold"),i=0;i<r.length;i++){var n=r[i](e,t);if(n)return n}}));var r={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function i(e,t,i){if(t&&void 0!==t[i])return t[i];var n=e.options.foldOptions;return n&&void 0!==n[i]?n[i]:r[i]}e.defineOption("foldOptions",null),e.defineExtension("foldOption",(function(e,t){return i(this,e,t)}))}(r(1719))},2448:(e,t,r)=>{!function(e){"use strict";e.defineOption("foldGutter",!1,(function(t,i,n){var o;n&&n!=e.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",l),t.off("changes",c),t.off("viewportChange",p),t.off("fold",d),t.off("unfold",d),t.off("swapDoc",c),t.off("optionChange",u)),i&&(t.state.foldGutter=new r((!0===(o=i)&&(o={}),null==o.gutter&&(o.gutter="CodeMirror-foldgutter"),null==o.indicatorOpen&&(o.indicatorOpen="CodeMirror-foldgutter-open"),null==o.indicatorFolded&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o)),a(t),t.on("gutterClick",l),t.on("changes",c),t.on("viewportChange",p),t.on("fold",d),t.on("unfold",d),t.on("swapDoc",c),t.on("optionChange",u))}));var t=e.Pos;function r(e){this.options=e,this.from=this.to=0}function i(e,r){for(var i=e.findMarks(t(r,0),t(r+1,0)),n=0;n<i.length;++n)if(i[n].__isFold){var o=i[n].find(-1);if(o&&o.line===r)return i[n]}}function n(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function o(e,r,o){var a=e.state.foldGutter.options,l=r-1,u=e.foldOption(a,"minFoldSize"),c=e.foldOption(a,"rangeFinder"),p="string"==typeof a.indicatorFolded&&s(a.indicatorFolded),d="string"==typeof a.indicatorOpen&&s(a.indicatorOpen);e.eachLine(r,o,(function(r){++l;var o=null,s=r.gutterMarkers;if(s&&(s=s[a.gutter]),i(e,l)){if(p&&s&&p.test(s.className))return;o=n(a.indicatorFolded)}else{var h=t(l,0),f=c&&c(e,h);if(f&&f.to.line-f.from.line>=u){if(d&&s&&d.test(s.className))return;o=n(a.indicatorOpen)}}(o||s)&&e.setGutterMarker(r,a.gutter,o)}))}function s(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function a(e){var t=e.getViewport(),r=e.state.foldGutter;r&&(e.operation((function(){o(e,t.from,t.to)})),r.from=t.from,r.to=t.to)}function l(e,r,n){var o=e.state.foldGutter;if(o){var s=o.options;if(n==s.gutter){var a=i(e,r);a?a.clear():e.foldCode(t(r,0),s)}}}function u(e,t){"mode"==t&&c(e)}function c(e){var t=e.state.foldGutter;if(t){var r=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){a(e)}),r.foldOnChangeTimeSpan||600)}}function p(e){var t=e.state.foldGutter;if(t){var r=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var r=e.getViewport();t.from==t.to||r.from-t.to>20||t.from-r.to>20?a(e):e.operation((function(){r.from<t.from&&(o(e,r.from,t.from),t.from=r.from),r.to>t.to&&(o(e,t.to,r.to),t.to=r.to)}))}),r.updateViewportTimeSpan||400)}}function d(e,t){var r=e.state.foldGutter;if(r){var i=t.line;i>=r.from&&i<r.to&&o(e,i,i+1)}}}(r(1719),r(9754))},7623:(e,t,r)=>{!function(e){"use strict";var t=e.Pos;function r(e,t){return e.line-t.line||e.ch-t.ch}var i="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=new RegExp("<(/?)(["+i+"]["+i+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(e,t,r,i){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=i?Math.max(i.from,e.firstLine()):e.firstLine(),this.max=i?Math.min(i.to-1,e.lastLine()):e.lastLine()}function s(e,r){var i=e.cm.getTokenTypeAt(t(e.line,r));return i&&/\btag\b/.test(i)}function a(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function l(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function u(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(a(e))continue;return}if(s(e,t+1)){var r=e.text.lastIndexOf("/",t),i=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t+1}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(s(e,t+1)){n.lastIndex=t,e.ch=t;var r=n.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function p(e){for(;;){n.lastIndex=e.ch;var t=n.exec(e.text);if(!t){if(a(e))continue;return}if(s(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(s(e,t+1)){var r=e.text.lastIndexOf("/",t),i=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}function h(e,r){for(var i=[];;){var n,o=p(e),s=e.line,a=e.ch-(o?o[0].length:0);if(!o||!(n=u(e)))return;if("selfClose"!=n)if(o[1]){for(var l=i.length-1;l>=0;--l)if(i[l]==o[2]){i.length=l;break}if(l<0&&(!r||r==o[2]))return{tag:o[2],from:t(s,a),to:t(e.line,e.ch)}}else i.push(o[2])}}function f(e,r){for(var i=[];;){var n=d(e);if(!n)return;if("selfClose"!=n){var o=e.line,s=e.ch,a=c(e);if(!a)return;if(a[1])i.push(a[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==a[2]){i.length=l;break}if(l<0&&(!r||r==a[2]))return{tag:a[2],from:t(e.line,e.ch),to:t(o,s)}}}else c(e)}}e.registerHelper("fold","xml",(function(e,i){for(var n=new o(e,i.line,0);;){var s=p(n);if(!s||n.line!=i.line)return;var a=u(n);if(!a)return;if(!s[1]&&"selfClose"!=a){var l=t(n.line,n.ch),c=h(n,s[2]);return c&&r(c.from,l)>0?{from:l,to:c.from}:null}}})),e.findMatchingTag=function(e,i,n){var s=new o(e,i.line,i.ch,n);if(-1!=s.text.indexOf(">")||-1!=s.text.indexOf("<")){var a=u(s),l=a&&t(s.line,s.ch),p=a&&c(s);if(a&&p&&!(r(s,i)>0)){var d={from:t(s.line,s.ch),to:l,tag:p[2]};return"selfClose"==a?{open:d,close:null,at:"open"}:p[1]?{open:f(s,p[2]),close:d,at:"close"}:{open:d,close:h(s=new o(e,l.line,l.ch,n),p[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,r,i){for(var n=new o(e,t.line,t.ch,r);;){var s=f(n,i);if(!s)break;var a=h(new o(e,t.line,t.ch,r),s.tag);if(a)return{open:s,close:a}}},e.scanForClosingTag=function(e,t,r,i){return h(new o(e,t.line,t.ch,i?{from:0,to:i}:null),r)}}(r(1719))},5397:(e,t,r)=>{!function(e){"use strict";function t(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var r=this;e.on("cursorActivity",this.activityFunc=function(){r.cursorActivity()})}}e.showHint=function(e,t,r){if(!t)return e.showHint(r);r&&r.async&&(t.async=!0);var i={hint:t};if(r)for(var n in r)i[n]=r[n];return e.showHint(i)},e.defineExtension("showHint",(function(r){r=function(e,t,r){var i=e.options.hintOptions,n={};for(var o in l)n[o]=l[o];if(i)for(var o in i)void 0!==i[o]&&(n[o]=i[o]);if(r)for(var o in r)void 0!==r[o]&&(n[o]=r[o]);return n.hint.resolve&&(n.hint=n.hint.resolve(e,t)),n}(this,this.getCursor("start"),r);var i=this.listSelections();if(!(i.length>1)){if(this.somethingSelected()){if(!r.hint.supportsSelection)return;for(var n=0;n<i.length;n++)if(i[n].head.line!=i[n].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var o=this.state.completionActive=new t(this,r);o.options.hint&&(e.signal(this,"startCompletion",this),o.update(!0))}})),e.defineExtension("closeHint",(function(){this.state.completionActive&&this.state.completionActive.close()}));var r=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},i=window.cancelAnimationFrame||clearTimeout;function n(e){return"string"==typeof e?e:e.text}function o(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function s(t,r){this.id="cm-complete-"+Math.floor(Math.random(1e6)),this.completion=t,this.data=r,this.picked=!1;var i=this,s=t.cm,a=s.getInputField().ownerDocument,l=a.defaultView||a.parentWindow,u=this.hints=a.createElement("ul");u.setAttribute("role","listbox"),u.setAttribute("aria-expanded","true"),u.id=this.id;var c=t.cm.options.theme;u.className="CodeMirror-hints "+c,this.selectedHint=r.selectedHint||0;for(var p=r.list,d=0;d<p.length;++d){var h=u.appendChild(a.createElement("li")),f=p[d],E="CodeMirror-hint"+(d!=this.selectedHint?"":" CodeMirror-hint-active");null!=f.className&&(E=f.className+" "+E),h.className=E,d==this.selectedHint&&h.setAttribute("aria-selected","true"),h.id=this.id+"-"+d,h.setAttribute("role","option"),f.render?f.render(h,r,f):h.appendChild(a.createTextNode(f.displayText||n(f))),h.hintId=d}var g=t.options.container||a.body,m=s.cursorCoords(t.options.alignWithWord?r.from:null),v=m.left,x=m.bottom,N=!0,y=0,A=0;if(g!==a.body){var L=-1!==["absolute","relative","fixed"].indexOf(l.getComputedStyle(g).position)?g:g.offsetParent,T=L.getBoundingClientRect(),I=a.body.getBoundingClientRect();y=T.left-I.left-L.scrollLeft,A=T.top-I.top-L.scrollTop}u.style.left=v-y+"px",u.style.top=x-A+"px";var S=l.innerWidth||Math.max(a.body.offsetWidth,a.documentElement.offsetWidth),C=l.innerHeight||Math.max(a.body.offsetHeight,a.documentElement.offsetHeight);g.appendChild(u),s.getInputField().setAttribute("aria-autocomplete","list"),s.getInputField().setAttribute("aria-owns",this.id),s.getInputField().setAttribute("aria-activedescendant",this.id+"-"+this.selectedHint);var R,b=t.options.moveOnOverlap?u.getBoundingClientRect():new DOMRect,O=!!t.options.paddingForScrollbar&&u.scrollHeight>u.clientHeight+1;if(setTimeout((function(){R=s.getScrollInfo()})),b.bottom-C>0){var _=b.bottom-b.top,P=b.top-(m.bottom-m.top)-2;C-b.top<P?(_>P&&(u.style.height=(_=P)+"px"),u.style.top=(x=m.top-_)+A+"px",N=!1):u.style.height=C-b.top-2+"px"}var D,w=b.right-S;if(O&&(w+=s.display.nativeBarWidth),w>0&&(b.right-b.left>S&&(u.style.width=S-5+"px",w-=b.right-b.left-S),u.style.left=(v=Math.max(m.left-w-y,0))+"px"),O)for(var M=u.firstChild;M;M=M.nextSibling)M.style.paddingRight=s.display.nativeBarWidth+"px";s.addKeyMap(this.keyMap=function(e,t){var r={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close};/Mac/.test(navigator.platform)&&(r["Ctrl-P"]=function(){t.moveFocus(-1)},r["Ctrl-N"]=function(){t.moveFocus(1)});var i=e.options.customKeys,n=i?{}:r;function o(e,i){var o;o="string"!=typeof i?function(e){return i(e,t)}:r.hasOwnProperty(i)?r[i]:i,n[e]=o}if(i)for(var s in i)i.hasOwnProperty(s)&&o(s,i[s]);var a=e.options.extraKeys;if(a)for(var s in a)a.hasOwnProperty(s)&&o(s,a[s]);return n}(t,{moveFocus:function(e,t){i.changeActive(i.selectedHint+e,t)},setFocus:function(e){i.changeActive(e)},menuSize:function(){return i.screenAmount()},length:p.length,close:function(){t.close()},pick:function(){i.pick()},data:r})),t.options.closeOnUnfocus&&(s.on("blur",this.onBlur=function(){D=setTimeout((function(){t.close()}),100)}),s.on("focus",this.onFocus=function(){clearTimeout(D)})),s.on("scroll",this.onScroll=function(){var e=s.getScrollInfo(),r=s.getWrapperElement().getBoundingClientRect();R||(R=s.getScrollInfo());var i=x+R.top-e.top,n=i-(l.pageYOffset||(a.documentElement||a.body).scrollTop);if(N||(n+=u.offsetHeight),n<=r.top||n>=r.bottom)return t.close();u.style.top=i+"px",u.style.left=v+R.left-e.left+"px"}),e.on(u,"dblclick",(function(e){var t=o(u,e.target||e.srcElement);t&&null!=t.hintId&&(i.changeActive(t.hintId),i.pick())})),e.on(u,"click",(function(e){var r=o(u,e.target||e.srcElement);r&&null!=r.hintId&&(i.changeActive(r.hintId),t.options.completeOnSingleClick&&i.pick())})),e.on(u,"mousedown",(function(){setTimeout((function(){s.focus()}),20)}));var k=this.getSelectedHintRange();return 0===k.from&&0===k.to||this.scrollToActive(),e.signal(r,"select",p[this.selectedHint],u.childNodes[this.selectedHint]),!0}function a(e,t,r,i){if(e.async)e(t,i,r);else{var n=e(t,r);n&&n.then?n.then(i):i(n)}}t.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,r){var i=t.list[r],o=this;this.cm.operation((function(){i.hint?i.hint(o.cm,t,i):o.cm.replaceRange(n(i),i.from||t.from,i.to||t.to,"complete"),e.signal(t,"pick",i),o.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(i(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),n=this.cm.getLine(t.line);if(t.line!=this.startPos.line||n.length-t.ch!=this.startLen-this.startPos.ch||t.ch<e.ch||this.cm.somethingSelected()||!t.ch||this.options.closeCharacters.test(n.charAt(t.ch-1)))this.close();else{var o=this;this.debounce=r((function(){o.update()})),this.widget&&this.widget.disable()}},update:function(e){if(null!=this.tick){var t=this,r=++this.tick;a(this.options.hint,this.cm,this.options,(function(i){t.tick==r&&t.finishUpdate(i,e)}))}},finishUpdate:function(t,r){this.data&&e.signal(this.data,"update");var i=this.widget&&this.widget.picked||r&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=t,t&&t.list.length&&(i&&1==t.list.length?this.pick(t,0):(this.widget=new s(this,t),e.signal(t,"shown")))}},s.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm.getInputField();e.removeAttribute("aria-activedescendant"),e.removeAttribute("aria-owns");var t=this.completion.cm;this.completion.options.closeOnUnfocus&&(t.off("blur",this.onBlur),t.off("focus",this.onFocus)),t.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var e=this;this.keyMap={Enter:function(){e.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,r){if(t>=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i&&(i.className=i.className.replace(" CodeMirror-hint-active",""),i.removeAttribute("aria-selected")),(i=this.hints.childNodes[this.selectedHint=t]).className+=" CodeMirror-hint-active",i.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",i.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],i)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],r=this.hints.childNodes[e.to],i=this.hints.firstChild;t.offsetTop<this.hints.scrollTop?this.hints.scrollTop=t.offsetTop-i.offsetTop:r.offsetTop+r.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=r.offsetTop+r.offsetHeight-this.hints.clientHeight+i.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},e.registerHelper("hint","auto",{resolve:function(t,r){var i,n=t.getHelpers(r,"hint");if(n.length){var o=function(e,t,r){var i=function(e,t){if(!e.somethingSelected())return t;for(var r=[],i=0;i<t.length;i++)t[i].supportsSelection&&r.push(t[i]);return r}(e,n);!function n(o){if(o==i.length)return t(null);a(i[o],e,r,(function(e){e&&e.list.length>0?t(e):n(o+1)}))}(0)};return o.async=!0,o.supportsSelection=!0,o}return(i=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:i})}:e.hint.anyword?function(t,r){return e.hint.anyword(t,r)}:function(){}}}),e.registerHelper("hint","fromList",(function(t,r){var i,n=t.getCursor(),o=t.getTokenAt(n),s=e.Pos(n.line,o.start),a=n;o.start<n.ch&&/\w/.test(o.string.charAt(n.ch-o.start-1))?i=o.string.substr(0,n.ch-o.start):(i="",s=n);for(var l=[],u=0;u<r.words.length;u++){var c=r.words[u];c.slice(0,i.length)==i&&l.push(c)}if(l.length)return{list:l,from:s,to:a}})),e.commands.autocomplete=e.showHint;var l={hint:e.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(r(1719))},7899:(e,t,r)=>{!function(e){"use strict";e.runMode=function(t,r,i,n){var o=e.getMode(e.defaults,r),s=n&&n.tabSize||e.defaults.tabSize;if(i.appendChild){var a=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9),l=i,u=0;l.textContent="",i=function(e,t){if("\n"==e)return l.appendChild(document.createTextNode(a?"\r":e)),void(u=0);for(var r="",i=0;;){var n=e.indexOf("\t",i);if(-1==n){r+=e.slice(i),u+=e.length-i;break}u+=n-i,r+=e.slice(i,n);var o=s-u%s;u+=o;for(var c=0;c<o;++c)r+=" ";i=n+1}if(t){var p=l.appendChild(document.createElement("span"));p.className="cm-"+t.replace(/ +/g," cm-"),p.appendChild(document.createTextNode(r))}else l.appendChild(document.createTextNode(r))}}for(var c=e.splitLines(t),p=n&&n.state||e.startState(o),d=0,h=c.length;d<h;++d){d&&i("\n");var f=new e.StringStream(c[d],null,{lookAhead:function(e){return c[d+e]},baseToken:function(){}});for(!f.string&&o.blankLine&&o.blankLine(p);!f.eol();){var E=o.token(f,p);i(f.current(),E,d,f.start,p,o),f.start=f.pos}}}}(r(1719))},9298:(e,t,r)=>{!function(e){"use strict";function t(e,t){function r(e){clearTimeout(i.doRedraw),i.doRedraw=setTimeout((function(){i.redraw()}),e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var i=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(i.doUpdate),i.doUpdate=setTimeout((function(){i.computeScale()&&r(20)}),100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),!1!==t.listenForChanges&&e.on("changes",this.changeHandler=function(){r(250)})}e.defineExtension("annotateScrollbar",(function(e){return"string"==typeof e&&(e={className:e}),new t(this,e)})),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/e.getScrollerElement().scrollHeight;if(t!=this.hScale)return this.hScale=t,!0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(e){!1!==e&&this.computeScale();var t=this.cm,r=this.hScale,i=document.createDocumentFragment(),n=this.annotations,o=t.getOption("lineWrapping"),s=o&&1.5*t.defaultTextHeight(),a=null,l=null;function u(e,r){if(a!=e.line){a=e.line,l=t.getLineHandle(e.line);var i=t.getLineHandleVisualStart(l);i!=l&&(a=t.getLineNumber(i),l=i)}return l.widgets&&l.widgets.length||o&&l.height>s?t.charCoords(e,"local")[r?"top":"bottom"]:t.heightAtLine(l,"local")+(r?0:l.height)}var c=t.lastLine();if(t.display.barWidth)for(var p,d=0;d<n.length;d++){var h=n[d];if(!(h.to.line>c)){for(var f=p||u(h.from,!0)*r,E=u(h.to,!1)*r;d<n.length-1&&!(n[d+1].to.line>c)&&!((p=u(n[d+1].from,!0)*r)>E+.9);)E=u((h=n[++d]).to,!1)*r;if(E!=f){var g=Math.max(E-f,3),m=i.appendChild(document.createElement("div"));m.style.cssText="position: absolute; right: 0px; width: "+Math.max(t.display.barWidth-1,2)+"px; top: "+(f+this.buttonHeight)+"px; height: "+g+"px",m.className=this.options.className,h.id&&m.setAttribute("annotation-id",h.id)}}}this.div.textContent="",this.div.appendChild(i)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}}(r(1719))},9082:(e,t,r)=>{!function(e){"use strict";var t={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};function r(e){for(var r in this.options={},t)this.options[r]=(e&&e.hasOwnProperty(r)?e:t)[r];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}function i(e){var t=e.state.matchHighlighter;(t.active||e.hasFocus())&&o(e,t)}function n(e){var t=e.state.matchHighlighter;t.active||(t.active=!0,o(e,t))}function o(e,t){clearTimeout(t.timeout),t.timeout=setTimeout((function(){l(e)}),t.options.delay)}function s(e,t,r,i){var n=e.state.matchHighlighter;if(e.addOverlay(n.overlay=function(e,t,r){return{token:function(i){if(i.match(e)&&(!t||function(e,t){return!(e.start&&t.test(e.string.charAt(e.start-1))||e.pos!=e.string.length&&t.test(e.string.charAt(e.pos)))}(i,t)))return r;i.next(),i.skipTo(e.charAt(0))||i.skipToEnd()}}}(t,r,i)),n.options.annotateScrollbar&&e.showMatchesOnScrollbar){var o=r?new RegExp((/\w/.test(t.charAt(0))?"\\b":"")+t.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+(/\w/.test(t.charAt(t.length-1))?"\\b":"")):t;n.matchesonscroll=e.showMatchesOnScrollbar(o,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function a(e){var t=e.state.matchHighlighter;t.overlay&&(e.removeOverlay(t.overlay),t.overlay=null,t.matchesonscroll&&(t.matchesonscroll.clear(),t.matchesonscroll=null))}function l(e){e.operation((function(){var t=e.state.matchHighlighter;if(a(e),e.somethingSelected()||!t.options.showToken){var r=e.getCursor("from"),i=e.getCursor("to");if(r.line==i.line&&(!t.options.wordsOnly||function(e,t,r){if(null!==e.getRange(t,r).match(/^\w+$/)){if(t.ch>0){var i={line:t.line,ch:t.ch-1};if(null===e.getRange(i,t).match(/\W/))return!1}return!(r.ch<e.getLine(t.line).length&&(i={line:r.line,ch:r.ch+1},null===e.getRange(r,i).match(/\W/)))}return!1}(e,r,i))){var n=e.getRange(r,i);t.options.trim&&(n=n.replace(/^\s+|\s+$/g,"")),n.length>=t.options.minChars&&s(e,n,!1,t.options.style)}}else{for(var o=!0===t.options.showToken?/[\w$]/:t.options.showToken,l=e.getCursor(),u=e.getLine(l.line),c=l.ch,p=c;c&&o.test(u.charAt(c-1));)--c;for(;p<u.length&&o.test(u.charAt(p));)++p;c<p&&s(e,u.slice(c,p),o,t.options.style)}}))}e.defineOption("highlightSelectionMatches",!1,(function(t,o,s){if(s&&s!=e.Init&&(a(t),clearTimeout(t.state.matchHighlighter.timeout),t.state.matchHighlighter=null,t.off("cursorActivity",i),t.off("focus",n)),o){var u=t.state.matchHighlighter=new r(o);t.hasFocus()?(u.active=!0,l(t)):t.on("focus",n),t.on("cursorActivity",i)}}))}(r(1719),r(6583))},6583:(e,t,r)=>{!function(e){"use strict";function t(e,t,r,i){this.cm=e,this.options=i;var n={listenForChanges:!1};for(var o in i)n[o]=i[o];n.className||(n.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(n),this.query=t,this.caseFold=r,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var s=this;e.on("change",this.changeHandler=function(e,t){s.onChange(t)})}function r(e,t,r){return e<=t?e:Math.max(t,e+r)}e.defineExtension("showMatchesOnScrollbar",(function(e,r,i){return"string"==typeof i&&(i={className:i}),i||(i={}),new t(this,e,r,i)})),t.prototype.findMatches=function(){if(this.gap){for(var t=0;t<this.matches.length&&!((n=this.matches[t]).from.line>=this.gap.to);t++)n.to.line>=this.gap.from&&this.matches.splice(t--,1);for(var r=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),{caseFold:this.caseFold,multiline:this.options.multiline}),i=this.options&&this.options.maxMatches||1e3;r.findNext();){var n;if((n={from:r.from(),to:r.to()}).from.line>=this.gap.to)break;if(this.matches.splice(t++,0,n),this.matches.length>i)break}this.gap=null}},t.prototype.onChange=function(t){var i=t.from.line,n=e.changeEnd(t).line,o=n-t.to.line;if(this.gap?(this.gap.from=Math.min(r(this.gap.from,i,o),t.from.line),this.gap.to=Math.max(r(this.gap.to,i,o),t.from.line)):this.gap={from:t.from.line,to:n+1},o)for(var s=0;s<this.matches.length;s++){var a=this.matches[s],l=r(a.from.line,i,o);l!=a.from.line&&(a.from=e.Pos(l,a.from.ch));var u=r(a.to.line,i,o);u!=a.to.line&&(a.to=e.Pos(u,a.to.ch))}clearTimeout(this.update);var c=this;this.update=setTimeout((function(){c.updateAfterChange()}),250)},t.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},t.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}(r(1719),r(404),r(9298))},404:(e,t,r)=>{!function(e){"use strict";var t,r,i=e.Pos;function n(e,t){for(var r=function(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}(e),i=r,n=0;n<t.length;n++)-1==i.indexOf(t.charAt(n))&&(i+=t.charAt(n));return r==i?e:new RegExp(e.source,i)}function o(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function s(e,t,r){t=n(t,"g");for(var o=r.line,s=r.ch,a=e.lastLine();o<=a;o++,s=0){t.lastIndex=s;var l=e.getLine(o),u=t.exec(l);if(u)return{from:i(o,u.index),to:i(o,u.index+u[0].length),match:u}}}function a(e,t,r){if(!o(t))return s(e,t,r);t=n(t,"gm");for(var a,l=1,u=r.line,c=e.lastLine();u<=c;){for(var p=0;p<l&&!(u>c);p++){var d=e.getLine(u++);a=null==a?d:a+"\n"+d}l*=2,t.lastIndex=r.ch;var h=t.exec(a);if(h){var f=a.slice(0,h.index).split("\n"),E=h[0].split("\n"),g=r.line+f.length-1,m=f[f.length-1].length;return{from:i(g,m),to:i(g+E.length-1,1==E.length?m+E[0].length:E[E.length-1].length),match:h}}}}function l(e,t,r){for(var i,n=0;n<=e.length;){t.lastIndex=n;var o=t.exec(e);if(!o)break;var s=o.index+o[0].length;if(s>e.length-r)break;(!i||s>i.index+i[0].length)&&(i=o),n=o.index+1}return i}function u(e,t,r){t=n(t,"g");for(var o=r.line,s=r.ch,a=e.firstLine();o>=a;o--,s=-1){var u=e.getLine(o),c=l(u,t,s<0?0:u.length-s);if(c)return{from:i(o,c.index),to:i(o,c.index+c[0].length),match:c}}}function c(e,t,r){if(!o(t))return u(e,t,r);t=n(t,"gm");for(var s,a=1,c=e.getLine(r.line).length-r.ch,p=r.line,d=e.firstLine();p>=d;){for(var h=0;h<a&&p>=d;h++){var f=e.getLine(p--);s=null==s?f:f+"\n"+s}a*=2;var E=l(s,t,c);if(E){var g=s.slice(0,E.index).split("\n"),m=E[0].split("\n"),v=p+g.length,x=g[g.length-1].length;return{from:i(v,x),to:i(v+m.length-1,1==m.length?x+m[0].length:m[m.length-1].length),match:E}}}}function p(e,t,r,i){if(e.length==t.length)return r;for(var n=0,o=r+Math.max(0,e.length-t.length);;){if(n==o)return n;var s=n+o>>1,a=i(e.slice(0,s)).length;if(a==r)return s;a>r?o=s:n=s+1}}function d(e,n,o,s){if(!n.length)return null;var a=s?t:r,l=a(n).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.lastLine()+1-l.length;u<=d;u++,c=0){var h=e.getLine(u).slice(c),f=a(h);if(1==l.length){var E=f.indexOf(l[0]);if(-1==E)continue e;return o=p(h,f,E,a)+c,{from:i(u,p(h,f,E,a)+c),to:i(u,p(h,f,E+l[0].length,a)+c)}}var g=f.length-l[0].length;if(f.slice(g)==l[0]){for(var m=1;m<l.length-1;m++)if(a(e.getLine(u+m))!=l[m])continue e;var v=e.getLine(u+l.length-1),x=a(v),N=l[l.length-1];if(x.slice(0,N.length)==N)return{from:i(u,p(h,f,g,a)+c),to:i(u+l.length-1,p(v,x,N.length,a))}}}}function h(e,n,o,s){if(!n.length)return null;var a=s?t:r,l=a(n).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.firstLine()-1+l.length;u>=d;u--,c=-1){var h=e.getLine(u);c>-1&&(h=h.slice(0,c));var f=a(h);if(1==l.length){var E=f.lastIndexOf(l[0]);if(-1==E)continue e;return{from:i(u,p(h,f,E,a)),to:i(u,p(h,f,E+l[0].length,a))}}var g=l[l.length-1];if(f.slice(0,g.length)==g){var m=1;for(o=u-l.length+1;m<l.length-1;m++)if(a(e.getLine(o+m))!=l[m])continue e;var v=e.getLine(u+1-l.length),x=a(v);if(x.slice(x.length-l[0].length)==l[0])return{from:i(u+1-l.length,p(v,x,v.length-l[0].length,a)),to:i(u,p(h,f,g.length,a))}}}}function f(e,t,r,o){var l;this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=e,r=r?e.clipPos(r):i(0,0),this.pos={from:r,to:r},"object"==typeof o?l=o.caseFold:(l=o,o=null),"string"==typeof t?(null==l&&(l=!1),this.matches=function(r,i){return(r?h:d)(e,t,i,l)}):(t=n(t,"gm"),o&&!1===o.multiline?this.matches=function(r,i){return(r?u:s)(e,t,i)}:this.matches=function(r,i){return(r?c:a)(e,t,i)})}String.prototype.normalize?(t=function(e){return e.normalize("NFD").toLowerCase()},r=function(e){return e.normalize("NFD")}):(t=function(e){return e.toLowerCase()},r=function(e){return e}),f.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){var r=this.doc.clipPos(t?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(r=i(r.line,r.ch),t?(r.ch--,r.ch<0&&(r.line--,r.ch=(this.doc.getLine(r.line)||"").length)):(r.ch++,r.ch>(this.doc.getLine(r.line)||"").length&&(r.ch=0,r.line++)),0!=e.cmpPos(r,this.doc.clipPos(r))))return this.atOccurrence=!1;var n=this.matches(t,r);if(this.afterEmptyMatch=n&&0==e.cmpPos(n.from,n.to),n)return this.pos=n,this.atOccurrence=!0,this.pos.match||!0;var o=i(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,r){if(this.atOccurrence){var n=e.splitLines(t);this.doc.replaceRange(n,this.pos.from,this.pos.to,r),this.pos.to=i(this.pos.from.line+n.length-1,n[n.length-1].length+(1==n.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,r){return new f(this.doc,e,t,r)})),e.defineDocExtension("getSearchCursor",(function(e,t,r){return new f(this,e,t,r)})),e.defineExtension("selectMatches",(function(t,r){for(var i=[],n=this.getSearchCursor(t,this.getCursor("from"),r);n.findNext()&&!(e.cmpPos(n.to(),this.getCursor("to"))>0);)i.push({anchor:n.from(),head:n.to()});i.length&&this.setSelections(i,0)}))}(r(1719))},1719:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),s=i||n||o,a=s&&(i?document.documentMode||6:+(o||n)[1]),l=!o&&/WebKit\//.test(e),u=l&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\/(\d+)/.exec(e),p=c&&+c[1],d=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),E=/PhantomJS/.test(e),g=h&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),x=g||/Mac/.test(t),N=/\bCrOS\b/.test(e),y=/win/i.test(t),A=d&&e.match(/Version\/(\d*\.\d*)/);A&&(A=Number(A[1])),A&&A>=15&&(d=!1,l=!0);var L=x&&(u||d&&(null==A||A<12.11)),T=r||s&&a>=9;function I(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S,C=function(e,t){var r=e.className,i=I(t).exec(r);if(i){var n=r.slice(i.index+i[0].length);e.className=r.slice(0,i.index)+(n?i[1]+n:"")}};function R(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function b(e,t){return R(e).appendChild(t)}function O(e,t,r,i){var n=document.createElement(e);if(r&&(n.className=r),i&&(n.style.cssText=i),"string"==typeof t)n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)n.appendChild(t[o]);return n}function _(e,t,r,i){var n=O(e,t,r,i);return n.setAttribute("role","presentation"),n}function P(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function D(e){var t,r=e.ownerDocument||e;try{t=e.activeElement}catch(e){t=r.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function w(e,t){var r=e.className;I(t).test(r)||(e.className+=(r?" ":"")+t)}function M(e,t){for(var r=e.split(" "),i=0;i<r.length;i++)r[i]&&!I(r[i]).test(t)&&(t+=" "+r[i]);return t}S=document.createRange?function(e,t,r,i){var n=document.createRange();return n.setEnd(i||e,r),n.setStart(e,t),n}:function(e,t,r){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(e){return i}return i.collapse(!0),i.moveEnd("character",r),i.moveStart("character",t),i};var k=function(e){e.select()};function F(e){return e.display.wrapper.ownerDocument}function G(e){return U(e.display.wrapper)}function U(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function B(e){return F(e).defaultView}function V(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function H(e,t,r){for(var i in t||(t={}),e)!e.hasOwnProperty(i)||!1===r&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function j(e,t,r,i,n){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=i||0,s=n||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return s+(t-o);s+=a-o,s+=r-s%r,o=a+1}}g?k=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(k=functi