/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.searchprofiler_bundle_jsonpfunction=window.searchprofiler_bundle_jsonpfunction||[]).push([[1],{24:function(e,t,n){e.exports=n(5)(1801)},25:function(e,t,n){e.exports=n(5)(1466)},26:function(e,t,n){var r;!function(o){var i=/^\s+/,s=/\s+$/,a=0,l=o.round,c=o.min,u=o.max,d=o.random;function p(e,t){if(t=t||{},(e=e||"")instanceof p)return e;if(!(this instanceof p))return new p(e,t);var n=function(e){var t,n,r,a={r:0,g:0,b:0},l=1,d=null,p=null,h=null,f=!1,m=!1;return"string"==typeof e&&(e=function(e){e=e.replace(i,"").replace(s,"").toLowerCase();var t,n=!1;if(P[e])e=P[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=z.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=z.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=z.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=z.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=z.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=z.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=z.hex8.exec(e))?{r:D(t[1]),g:D(t[2]),b:D(t[3]),a:F(t[4]),format:n?"name":"hex8"}:(t=z.hex6.exec(e))?{r:D(t[1]),g:D(t[2]),b:D(t[3]),format:n?"name":"hex"}:(t=z.hex4.exec(e))?{r:D(t[1]+""+t[1]),g:D(t[2]+""+t[2]),b:D(t[3]+""+t[3]),a:F(t[4]+""+t[4]),format:n?"name":"hex8"}:!!(t=z.hex3.exec(e))&&{r:D(t[1]+""+t[1]),g:D(t[2]+""+t[2]),b:D(t[3]+""+t[3]),format:n?"name":"hex"}}(e)),"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(t=e.r,n=e.g,r=e.b,a={r:255*N(t,255),g:255*N(n,255),b:255*N(r,255)},f=!0,m="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(d=I(e.s),p=I(e.v),a=function(e,t,n){e=6*N(e,360),t=N(t,100),n=N(n,100);var r=o.floor(e),i=e-r,s=n*(1-t),a=n*(1-i*t),l=n*(1-(1-i)*t),c=r%6;return{r:255*[n,a,s,s,l,n][c],g:255*[l,n,n,a,s,s][c],b:255*[s,s,l,n,n,a][c]}}(e.h,d,p),f=!0,m="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(d=I(e.s),h=I(e.l),a=function(e,t,n){var r,o,i;function s(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=N(e,360),t=N(t,100),n=N(n,100),0===t)r=o=i=n;else{var a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;r=s(l,a,e+1/3),o=s(l,a,e),i=s(l,a,e-1/3)}return{r:255*r,g:255*o,b:255*i}}(e.h,d,h),f=!0,m="hsl"),e.hasOwnProperty("a")&&(l=e.a)),l=A(l),{ok:f,format:e.format||m,r:c(255,u(a.r,0)),g:c(255,u(a.g,0)),b:c(255,u(a.b,0)),a:l}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=l(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=n.ok,this._tc_id=a++}function h(e,t,n){e=N(e,255),t=N(t,255),n=N(n,255);var r,o,i=u(e,t,n),s=c(e,t,n),a=(i+s)/2;if(i==s)r=o=0;else{var l=i-s;switch(o=a>.5?l/(2-i-s):l/(i+s),i){case e:r=(t-n)/l+(t>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(p(r));return i}function S(e,t){t=t||6;for(var n=p(e).toHsv(),r=n.h,o=n.s,i=n.v,s=[],a=1/t;t--;)s.push(p({h:r,s:o,v:i})),i=(i+a)%1;return s}p.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:o.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:o.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=A(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=l(360*e.h),n=l(100*e.s),r=l(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=h(this._r,this._g,this._b),t=l(360*e.h),n=l(100*e.s),r=l(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return m(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,o){var i=[M(l(e).toString(16)),M(l(t).toString(16)),M(l(n).toString(16)),M(q(r))];return o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*N(this._r,255))+"%",g:l(100*N(this._g,255))+"%",b:l(100*N(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*N(this._r,255))+"%, "+l(100*N(this._g,255))+"%, "+l(100*N(this._b,255))+"%)":"rgba("+l(100*N(this._r,255))+"%, "+l(100*N(this._g,255))+"%, "+l(100*N(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[m(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+g(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var o=p(e);n="#"+g(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return p(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(x,arguments)},darken:function(){return this._applyModification(j,arguments)},desaturate:function(){return this._applyModification(w,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(O,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(R,arguments)},triad:function(){return this._applyCombination(k,arguments)},tetrad:function(){return this._applyCombination(E,arguments)}},p.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:I(e[r]));e=n}return p(e,t)},p.equals=function(e,t){return!(!e||!t)&&p(e).toRgbString()==p(t).toRgbString()},p.random=function(){return p.fromRatio({r:d(),g:d(),b:d()})},p.mix=function(e,t,n){n=0===n?0:n||50;var r=p(e).toRgb(),o=p(t).toRgb(),i=n/100;return p({r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a})},p.readability=function(e,t){var n=p(e),r=p(t);return(o.max(n.getLuminance(),r.getLuminance())+.05)/(o.min(n.getLuminance(),r.getLuminance())+.05)},p.isReadable=function(e,t,n){var r,o,i,s,a,l=p.readability(e,t);switch(o=!1,(i=n,"AA"!==(s=((i=i||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==s&&(s="AA"),"small"!==(a=(i.size||"small").toLowerCase())&&"large"!==a&&(a="small"),r={level:s,size:a}).level+r.size){case"AAsmall":case"AAAlarge":o=l>=4.5;break;case"AAlarge":o=l>=3;break;case"AAAsmall":o=l>=7}return o},p.mostReadable=function(e,t,n){var r,o,i,s,a=null,l=0;o=(n=n||{}).includeFallbackColors,i=n.level,s=n.size;for(var c=0;cl&&(l=r,a=p(t[c]));return p.isReadable(e,a,{level:i,size:s})||!o?a:(n.includeFallbackColors=!1,p.mostReadable(e,["#fff","#000"],n))};var P=p.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},L=p.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(P);function A(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function N(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=c(t,u(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),o.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function C(e){return c(1,u(0,e))}function D(e){return parseInt(e,16)}function M(e){return 1==e.length?"0"+e:""+e}function I(e){return e<=1&&(e=100*e+"%"),e}function q(e){return o.round(255*parseFloat(e)).toString(16)}function F(e){return D(e)/255}var $,B,H,z=(B="[\\s|\\(]+("+($="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+$+")[,|\\s]+("+$+")\\s*\\)?",H="[\\s|\\(]+("+$+")[,|\\s]+("+$+")[,|\\s]+("+$+")[,|\\s]+("+$+")\\s*\\)?",{CSS_UNIT:new RegExp($),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+H),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+H),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+H),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(e){return!!z.CSS_UNIT.exec(e)}e.exports?e.exports=p:void 0===(r=function(){return p}.call(t,n,t,e))||(e.exports=r)}(Math)},27:function(e,t,n){"use strict";function r(e){return e}function o(e){throw new Error("Called `absurd` function which should be uncallable")}Object.defineProperty(t,"__esModule",{value:!0}),t.bindTo_=t.bind_=t.hole=t.pipe=t.untupled=t.tupled=t.absurd=t.decrement=t.increment=t.tuple=t.flow=t.flip=t.constVoid=t.constUndefined=t.constNull=t.constFalse=t.constTrue=t.constant=t.not=t.unsafeCoerce=t.identity=void 0,t.identity=r,t.unsafeCoerce=r,t.not=function(e){return function(t){return!e(t)}},t.constant=function(e){return function(){return e}},t.constTrue=function(){return!0},t.constFalse=function(){return!1},t.constNull=function(){return null},t.constUndefined=function(){},t.constVoid=function(){},t.flip=function(e){return function(t,n){return e(n,t)}},t.flow=function(e,t,n,r,o,i,s,a,l){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return o(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return i(o(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return s(i(o(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return a(s(i(o(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return l(a(s(i(o(r(n(t(e.apply(this,arguments)))))))))}}},t.tuple=function(){for(var e=[],t=0;t>>8,n[2*r+1]=s%256}return n},decompressFromUint8Array:function(t){if(null==t)return i.decompress(t);for(var n=new Array(t.length/2),r=0,o=n.length;r>=1}else{for(o=1,r=0;r>=1}0==--d&&(d=Math.pow(2,h),h++),delete a[u]}else for(o=s[u],r=0;r>=1;0==--d&&(d=Math.pow(2,h),h++),s[c]=p++,u=String(l)}if(""!==u){if(Object.prototype.hasOwnProperty.call(a,u)){if(u.charCodeAt(0)<256){for(r=0;r>=1}else{for(o=1,r=0;r>=1}0==--d&&(d=Math.pow(2,h),h++),delete a[u]}else for(o=s[u],r=0;r>=1;0==--d&&(d=Math.pow(2,h),h++)}for(o=2,r=0;r>=1;for(;;){if(m<<=1,g==t-1){f.push(n(m));break}g++}return f.join("")},decompress:function(e){return null==e?"":""==e?null:i._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(t,n,r){var o,i,s,a,l,c,u,d=[],p=4,h=4,f=3,m="",g=[],w={val:r(0),position:n,index:1};for(o=0;o<3;o+=1)d[o]=o;for(s=0,l=Math.pow(2,2),c=1;c!=l;)a=w.val&w.position,w.position>>=1,0==w.position&&(w.position=n,w.val=r(w.index++)),s|=(a>0?1:0)*c,c<<=1;switch(s){case 0:for(s=0,l=Math.pow(2,8),c=1;c!=l;)a=w.val&w.position,w.position>>=1,0==w.position&&(w.position=n,w.val=r(w.index++)),s|=(a>0?1:0)*c,c<<=1;u=e(s);break;case 1:for(s=0,l=Math.pow(2,16),c=1;c!=l;)a=w.val&w.position,w.position>>=1,0==w.position&&(w.position=n,w.val=r(w.index++)),s|=(a>0?1:0)*c,c<<=1;u=e(s);break;case 2:return""}for(d[3]=u,i=u,g.push(u);;){if(w.index>t)return"";for(s=0,l=Math.pow(2,f),c=1;c!=l;)a=w.val&w.position,w.position>>=1,0==w.position&&(w.position=n,w.val=r(w.index++)),s|=(a>0?1:0)*c,c<<=1;switch(u=s){case 0:for(s=0,l=Math.pow(2,8),c=1;c!=l;)a=w.val&w.position,w.position>>=1,0==w.position&&(w.position=n,w.val=r(w.index++)),s|=(a>0?1:0)*c,c<<=1;d[h++]=e(s),u=h-1,p--;break;case 1:for(s=0,l=Math.pow(2,16),c=1;c!=l;)a=w.val&w.position,w.position>>=1,0==w.position&&(w.position=n,w.val=r(w.index++)),s|=(a>0?1:0)*c,c<<=1;d[h++]=e(s),u=h-1,p--;break;case 2:return g.join("")}if(0==p&&(p=Math.pow(2,f),f++),d[u])m=d[u];else{if(u!==h)return null;m=i+i.charAt(0)}g.push(m),d[h++]=i+m.charAt(0),i=m,0==--p&&(p=Math.pow(2,f),f++)}}};return i}();void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)},29:function(e,t,n){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,t,n){"use strict";var r=e("../lib/oop"),o=e("./text_highlight_rules").TextHighlightRules,i=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};r.inherits(i,o),t.JsonHighlightRules=i})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var r=e("../range").Range,o=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var o=n[1].length,i=e.findMatchingBracket({row:t,column:o});if(!i||i.row==t)return 0;var s=this.$getIndent(e.getLine(i.row));e.replace(new r(t,0,t,o-1),s)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(o.prototype),t.MatchingBraceOutdent=o})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(e,t,n){"use strict";var r=e("../../lib/oop"),o=e("../../range").Range,i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(s,i),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var o=this._getFoldWidgetBase(e,t,n);return!o&&this.startRegionRe.test(r)?"start":o},this.getFoldWidgetRange=function(e,t,n,r){var o,i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);if(o=i.match(this.foldingStartMarker)){var s=o.index;if(o[1])return this.openingBracketBlock(e,o[1],n,s);var a=e.getCommentFoldRange(n,s+o[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(o=i.match(this.foldingStopMarker))?(s=o.index+o[0].length,o[1]?this.closingBracketBlock(e,o[1],n,s):e.getCommentFoldRange(n,s,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),i=t,s=n.length,a=t+=1,l=e.getLength();++tc)break;var u=this.getFoldWidgetRange(e,"all",t);if(u){if(u.start.row<=i)break;if(u.isMultiLine())t=u.end.row;else if(r==c)break}a=t}}return new o(i,s,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),i=e.getLength(),s=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++ns)return new o(s,r,n,t.length)}}.call(s.prototype)})),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"],(function(e,t,r){"use strict";var o=e("../lib/oop"),i=e("./text").Mode,s=e("./json_highlight_rules").JsonHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,l=e("./behaviour/cstyle").CstyleBehaviour,c=e("./folding/cstyle").FoldMode,u=e("../worker/worker_client").WorkerClient,d=function(){this.HighlightRules=s,this.$outdent=new a,this.$behaviour=new l,this.foldingRules=new c};o.inherits(d,i),function(){this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);return"start"==e&&t.match(/^.*[\{\(\[]\s*$/)&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],n(30),"JsonWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",(function(t){e.setAnnotations(t.data)})),t.on("terminate",(function(){e.clearAnnotations()})),t},this.$id="ace/mode/json"}.call(d.prototype),t.Mode=d}))},30:function(e,t){e.exports.id="ace/mode/json_worker",e.exports.src='"no use strict";!function(window){function resolveModuleId(id,paths){for(var testPath=id,tail="";testPath;){var alias=paths[testPath];if("string"==typeof alias)return alias+tail;if(alias)return alias.location.replace(/\\/*$/,"/")+(tail||alias.main||alias.name);if(alias===!1)return"";var i=testPath.lastIndexOf("/");if(-1===i)break;tail=testPath.substr(i)+tail,testPath=testPath.slice(0,i)}return id}if(!(void 0!==window.window&&window.document||window.acequire&&window.define)){window.console||(window.console=function(){var msgs=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:msgs})},window.console.error=window.console.warn=window.console.log=window.console.trace=window.console),window.window=window,window.ace=window,window.onerror=function(message,file,line,col,err){postMessage({type:"error",data:{message:message,data:err.data,file:file,line:line,col:col,stack:err.stack}})},window.normalizeModule=function(parentId,moduleName){if(-1!==moduleName.indexOf("!")){var chunks=moduleName.split("!");return window.normalizeModule(parentId,chunks[0])+"!"+window.normalizeModule(parentId,chunks[1])}if("."==moduleName.charAt(0)){var base=parentId.split("/").slice(0,-1).join("/");for(moduleName=(base?base+"/":"")+moduleName;-1!==moduleName.indexOf(".")&&previous!=moduleName;){var previous=moduleName;moduleName=moduleName.replace(/^\\.\\//,"").replace(/\\/\\.\\//,"/").replace(/[^\\/]+\\/\\.\\.\\//,"")}}return moduleName},window.acequire=function acequire(parentId,id){if(id||(id=parentId,parentId=null),!id.charAt)throw Error("worker.js acequire() accepts only (parentId, id) as arguments");id=window.normalizeModule(parentId,id);var module=window.acequire.modules[id];if(module)return module.initialized||(module.initialized=!0,module.exports=module.factory().exports),module.exports;if(!window.acequire.tlns)return console.log("unable to load "+id);var path=resolveModuleId(id,window.acequire.tlns);return".js"!=path.slice(-3)&&(path+=".js"),window.acequire.id=id,window.acequire.modules[id]={},importScripts(path),window.acequire(parentId,id)},window.acequire.modules={},window.acequire.tlns={},window.define=function(id,deps,factory){if(2==arguments.length?(factory=deps,"string"!=typeof id&&(deps=id,id=window.acequire.id)):1==arguments.length&&(factory=id,deps=[],id=window.acequire.id),"function"!=typeof factory)return window.acequire.modules[id]={exports:factory,initialized:!0},void 0;deps.length||(deps=["require","exports","module"]);var req=function(childId){return window.acequire(id,childId)};window.acequire.modules[id]={exports:{},factory:function(){var module=this,returnExports=factory.apply(this,deps.map(function(dep){switch(dep){case"require":return req;case"exports":return module.exports;case"module":return module;default:return req(dep)}}));return returnExports&&(module.exports=returnExports),module}}},window.define.amd={},acequire.tlns={},window.initBaseUrls=function(topLevelNamespaces){for(var i in topLevelNamespaces)acequire.tlns[i]=topLevelNamespaces[i]},window.initSender=function(){var EventEmitter=window.acequire("ace/lib/event_emitter").EventEmitter,oop=window.acequire("ace/lib/oop"),Sender=function(){};return function(){oop.implement(this,EventEmitter),this.callback=function(data,callbackId){postMessage({type:"call",id:callbackId,data:data})},this.emit=function(name,data){postMessage({type:"event",name:name,data:data})}}.call(Sender.prototype),new Sender};var main=window.main=null,sender=window.sender=null;window.onmessage=function(e){var msg=e.data;if(msg.event&&sender)sender._signal(msg.event,msg.data);else if(msg.command)if(main[msg.command])main[msg.command].apply(main,msg.args);else{if(!window[msg.command])throw Error("Unknown command:"+msg.command);window[msg.command].apply(window,msg.args)}else if(msg.init){window.initBaseUrls(msg.tlns),acequire("ace/lib/es5-shim"),sender=window.sender=window.initSender();var clazz=acequire(msg.module)[msg.classname];main=window.main=new clazz(sender)}}}}(this),ace.define("ace/lib/oop",["require","exports","module"],function(acequire,exports){"use strict";exports.inherits=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})},exports.mixin=function(obj,mixin){for(var key in mixin)obj[key]=mixin[key];return obj},exports.implement=function(proto,mixin){exports.mixin(proto,mixin)}}),ace.define("ace/range",["require","exports","module"],function(acequire,exports){"use strict";var comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},Range=function(startRow,startColumn,endRow,endColumn){this.start={row:startRow,column:startColumn},this.end={row:endRow,column:endColumn}};(function(){this.isEqual=function(range){return this.start.row===range.start.row&&this.end.row===range.end.row&&this.start.column===range.start.column&&this.end.column===range.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(row,column){return 0==this.compare(row,column)},this.compareRange=function(range){var cmp,end=range.end,start=range.start;return cmp=this.compare(end.row,end.column),1==cmp?(cmp=this.compare(start.row,start.column),1==cmp?2:0==cmp?1:0):-1==cmp?-2:(cmp=this.compare(start.row,start.column),-1==cmp?-1:1==cmp?42:0)},this.comparePoint=function(p){return this.compare(p.row,p.column)},this.containsRange=function(range){return 0==this.comparePoint(range.start)&&0==this.comparePoint(range.end)},this.intersects=function(range){var cmp=this.compareRange(range);return-1==cmp||0==cmp||1==cmp},this.isEnd=function(row,column){return this.end.row==row&&this.end.column==column},this.isStart=function(row,column){return this.start.row==row&&this.start.column==column},this.setStart=function(row,column){"object"==typeof row?(this.start.column=row.column,this.start.row=row.row):(this.start.row=row,this.start.column=column)},this.setEnd=function(row,column){"object"==typeof row?(this.end.column=row.column,this.end.row=row.row):(this.end.row=row,this.end.column=column)},this.inside=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)||this.isStart(row,column)?!1:!0:!1},this.insideStart=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)?!1:!0:!1},this.insideEnd=function(row,column){return 0==this.compare(row,column)?this.isStart(row,column)?!1:!0:!1},this.compare=function(row,column){return this.isMultiLine()||row!==this.start.row?this.start.row>row?-1:row>this.end.row?1:this.start.row===row?column>=this.start.column?0:-1:this.end.row===row?this.end.column>=column?0:1:0:this.start.column>column?-1:column>this.end.column?1:0},this.compareStart=function(row,column){return this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.compareEnd=function(row,column){return this.end.row==row&&this.end.column==column?1:this.compare(row,column)},this.compareInside=function(row,column){return this.end.row==row&&this.end.column==column?1:this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.clipRows=function(firstRow,lastRow){if(this.end.row>lastRow)var end={row:lastRow+1,column:0};else if(firstRow>this.end.row)var end={row:firstRow,column:0};if(this.start.row>lastRow)var start={row:lastRow+1,column:0};else if(firstRow>this.start.row)var start={row:firstRow,column:0};return Range.fromPoints(start||this.start,end||this.end)},this.extend=function(row,column){var cmp=this.compare(row,column);if(0==cmp)return this;if(-1==cmp)var start={row:row,column:column};else var end={row:row,column:column};return Range.fromPoints(start||this.start,end||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return Range.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new Range(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new Range(this.start.row,0,this.end.row,0)},this.toScreenRange=function(session){var screenPosStart=session.documentToScreenPosition(this.start),screenPosEnd=session.documentToScreenPosition(this.end);return new Range(screenPosStart.row,screenPosStart.column,screenPosEnd.row,screenPosEnd.column)},this.moveBy=function(row,column){this.start.row+=row,this.start.column+=column,this.end.row+=row,this.end.column+=column}}).call(Range.prototype),Range.fromPoints=function(start,end){return new Range(start.row,start.column,end.row,end.column)},Range.comparePoints=comparePoints,Range.comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},exports.Range=Range}),ace.define("ace/apply_delta",["require","exports","module"],function(acequire,exports){"use strict";exports.applyDelta=function(docLines,delta){var row=delta.start.row,startColumn=delta.start.column,line=docLines[row]||"";switch(delta.action){case"insert":var lines=delta.lines;if(1===lines.length)docLines[row]=line.substring(0,startColumn)+delta.lines[0]+line.substring(startColumn);else{var args=[row,1].concat(delta.lines);docLines.splice.apply(docLines,args),docLines[row]=line.substring(0,startColumn)+docLines[row],docLines[row+delta.lines.length-1]+=line.substring(startColumn)}break;case"remove":var endColumn=delta.end.column,endRow=delta.end.row;row===endRow?docLines[row]=line.substring(0,startColumn)+line.substring(endColumn):docLines.splice(row,endRow-row+1,line.substring(0,startColumn)+docLines[endRow].substring(endColumn))}}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(acequire,exports){"use strict";var EventEmitter={},stopPropagation=function(){this.propagationStopped=!0},preventDefault=function(){this.defaultPrevented=!0};EventEmitter._emit=EventEmitter._dispatchEvent=function(eventName,e){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var listeners=this._eventRegistry[eventName]||[],defaultHandler=this._defaultHandlers[eventName];if(listeners.length||defaultHandler){"object"==typeof e&&e||(e={}),e.type||(e.type=eventName),e.stopPropagation||(e.stopPropagation=stopPropagation),e.preventDefault||(e.preventDefault=preventDefault),listeners=listeners.slice();for(var i=0;listeners.length>i&&(listeners[i](e,this),!e.propagationStopped);i++);return defaultHandler&&!e.defaultPrevented?defaultHandler(e,this):void 0}},EventEmitter._signal=function(eventName,e){var listeners=(this._eventRegistry||{})[eventName];if(listeners){listeners=listeners.slice();for(var i=0;listeners.length>i;i++)listeners[i](e,this)}},EventEmitter.once=function(eventName,callback){var _self=this;callback&&this.addEventListener(eventName,function newCallback(){_self.removeEventListener(eventName,newCallback),callback.apply(null,arguments)})},EventEmitter.setDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers||(handlers=this._defaultHandlers={_disabled_:{}}),handlers[eventName]){var old=handlers[eventName],disabled=handlers._disabled_[eventName];disabled||(handlers._disabled_[eventName]=disabled=[]),disabled.push(old);var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}handlers[eventName]=callback},EventEmitter.removeDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers){var disabled=handlers._disabled_[eventName];if(handlers[eventName]==callback)handlers[eventName],disabled&&this.setDefaultHandler(eventName,disabled.pop());else if(disabled){var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}}},EventEmitter.on=EventEmitter.addEventListener=function(eventName,callback,capturing){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];return listeners||(listeners=this._eventRegistry[eventName]=[]),-1==listeners.indexOf(callback)&&listeners[capturing?"unshift":"push"](callback),callback},EventEmitter.off=EventEmitter.removeListener=EventEmitter.removeEventListener=function(eventName,callback){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];if(listeners){var index=listeners.indexOf(callback);-1!==index&&listeners.splice(index,1)}},EventEmitter.removeAllListeners=function(eventName){this._eventRegistry&&(this._eventRegistry[eventName]=[])},exports.EventEmitter=EventEmitter}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(acequire,exports){"use strict";var oop=acequire("./lib/oop"),EventEmitter=acequire("./lib/event_emitter").EventEmitter,Anchor=exports.Anchor=function(doc,row,column){this.$onChange=this.onChange.bind(this),this.attach(doc),column===void 0?this.setPosition(row.row,row.column):this.setPosition(row,column)};(function(){function $pointsInOrder(point1,point2,equalPointsInOrder){var bColIsAfter=equalPointsInOrder?point1.column<=point2.column:point1.columnthis.row)){var point=$getTransformedPoint(delta,{row:this.row,column:this.column},this.$insertRight);this.setPosition(point.row,point.column,!0)}},this.setPosition=function(row,column,noClip){var pos;if(pos=noClip?{row:row,column:column}:this.$clipPositionToDocument(row,column),this.row!=pos.row||this.column!=pos.column){var old={row:this.row,column:this.column};this.row=pos.row,this.column=pos.column,this._signal("change",{old:old,value:pos})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(doc){this.document=doc||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(row,column){var pos={};return row>=this.document.getLength()?(pos.row=Math.max(0,this.document.getLength()-1),pos.column=this.document.getLine(pos.row).length):0>row?(pos.row=0,pos.column=0):(pos.row=row,pos.column=Math.min(this.document.getLine(pos.row).length,Math.max(0,column))),0>column&&(pos.column=0),pos}}).call(Anchor.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(acequire,exports){"use strict";var oop=acequire("./lib/oop"),applyDelta=acequire("./apply_delta").applyDelta,EventEmitter=acequire("./lib/event_emitter").EventEmitter,Range=acequire("./range").Range,Anchor=acequire("./anchor").Anchor,Document=function(textOrLines){this.$lines=[""],0===textOrLines.length?this.$lines=[""]:Array.isArray(textOrLines)?this.insertMergedLines({row:0,column:0},textOrLines):this.insert({row:0,column:0},textOrLines)};(function(){oop.implement(this,EventEmitter),this.setValue=function(text){var len=this.getLength()-1;this.remove(new Range(0,0,len,this.getLine(len).length)),this.insert({row:0,column:0},text)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(row,column){return new Anchor(this,row,column)},this.$split=0==="aaa".split(/a/).length?function(text){return text.replace(/\\r\\n|\\r/g,"\\n").split("\\n")}:function(text){return text.split(/\\r\\n|\\r|\\n/)},this.$detectNewLine=function(text){var match=text.match(/^.*?(\\r\\n|\\r|\\n)/m);this.$autoNewLine=match?match[1]:"\\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\\r\\n";case"unix":return"\\n";default:return this.$autoNewLine||"\\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(newLineMode){this.$newLineMode!==newLineMode&&(this.$newLineMode=newLineMode,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(text){return"\\r\\n"==text||"\\r"==text||"\\n"==text},this.getLine=function(row){return this.$lines[row]||""},this.getLines=function(firstRow,lastRow){return this.$lines.slice(firstRow,lastRow+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(range){return this.getLinesForRange(range).join(this.getNewLineCharacter())},this.getLinesForRange=function(range){var lines;if(range.start.row===range.end.row)lines=[this.getLine(range.start.row).substring(range.start.column,range.end.column)];else{lines=this.getLines(range.start.row,range.end.row),lines[0]=(lines[0]||"").substring(range.start.column);var l=lines.length-1;range.end.row-range.start.row==l&&(lines[l]=lines[l].substring(0,range.end.column))}return lines},this.insertLines=function(row,lines){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(row,lines)},this.removeLines=function(firstRow,lastRow){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(firstRow,lastRow)},this.insertNewLine=function(position){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\'\', \'\']) instead."),this.insertMergedLines(position,["",""])},this.insert=function(position,text){return 1>=this.getLength()&&this.$detectNewLine(text),this.insertMergedLines(position,this.$split(text))},this.insertInLine=function(position,text){var start=this.clippedPos(position.row,position.column),end=this.pos(position.row,position.column+text.length);return this.applyDelta({start:start,end:end,action:"insert",lines:[text]},!0),this.clonePos(end)},this.clippedPos=function(row,column){var length=this.getLength();void 0===row?row=length:0>row?row=0:row>=length&&(row=length-1,column=void 0);var line=this.getLine(row);return void 0==column&&(column=line.length),column=Math.min(Math.max(column,0),line.length),{row:row,column:column}},this.clonePos=function(pos){return{row:pos.row,column:pos.column}},this.pos=function(row,column){return{row:row,column:column}},this.$clipPosition=function(position){var length=this.getLength();return position.row>=length?(position.row=Math.max(0,length-1),position.column=this.getLine(length-1).length):(position.row=Math.max(0,position.row),position.column=Math.min(Math.max(position.column,0),this.getLine(position.row).length)),position},this.insertFullLines=function(row,lines){row=Math.min(Math.max(row,0),this.getLength());var column=0;this.getLength()>row?(lines=lines.concat([""]),column=0):(lines=[""].concat(lines),row--,column=this.$lines[row].length),this.insertMergedLines({row:row,column:column},lines)},this.insertMergedLines=function(position,lines){var start=this.clippedPos(position.row,position.column),end={row:start.row+lines.length-1,column:(1==lines.length?start.column:0)+lines[lines.length-1].length};return this.applyDelta({start:start,end:end,action:"insert",lines:lines}),this.clonePos(end)},this.remove=function(range){var start=this.clippedPos(range.start.row,range.start.column),end=this.clippedPos(range.end.row,range.end.column);return this.applyDelta({start:start,end:end,action:"remove",lines:this.getLinesForRange({start:start,end:end})}),this.clonePos(start)},this.removeInLine=function(row,startColumn,endColumn){var start=this.clippedPos(row,startColumn),end=this.clippedPos(row,endColumn);return this.applyDelta({start:start,end:end,action:"remove",lines:this.getLinesForRange({start:start,end:end})},!0),this.clonePos(start)},this.removeFullLines=function(firstRow,lastRow){firstRow=Math.min(Math.max(0,firstRow),this.getLength()-1),lastRow=Math.min(Math.max(0,lastRow),this.getLength()-1);var deleteFirstNewLine=lastRow==this.getLength()-1&&firstRow>0,deleteLastNewLine=this.getLength()-1>lastRow,startRow=deleteFirstNewLine?firstRow-1:firstRow,startCol=deleteFirstNewLine?this.getLine(startRow).length:0,endRow=deleteLastNewLine?lastRow+1:lastRow,endCol=deleteLastNewLine?0:this.getLine(endRow).length,range=new Range(startRow,startCol,endRow,endCol),deletedLines=this.$lines.slice(firstRow,lastRow+1);return this.applyDelta({start:range.start,end:range.end,action:"remove",lines:this.getLinesForRange(range)}),deletedLines},this.removeNewLine=function(row){this.getLength()-1>row&&row>=0&&this.applyDelta({start:this.pos(row,this.getLine(row).length),end:this.pos(row+1,0),action:"remove",lines:["",""]})},this.replace=function(range,text){if(range instanceof Range||(range=Range.fromPoints(range.start,range.end)),0===text.length&&range.isEmpty())return range.start;if(text==this.getTextRange(range))return range.end;this.remove(range);var end;return end=text?this.insert(range.start,text):range.start},this.applyDeltas=function(deltas){for(var i=0;deltas.length>i;i++)this.applyDelta(deltas[i])},this.revertDeltas=function(deltas){for(var i=deltas.length-1;i>=0;i--)this.revertDelta(deltas[i])},this.applyDelta=function(delta,doNotValidate){var isInsert="insert"==delta.action;(isInsert?1>=delta.lines.length&&!delta.lines[0]:!Range.comparePoints(delta.start,delta.end))||(isInsert&&delta.lines.length>2e4&&this.$splitAndapplyLargeDelta(delta,2e4),applyDelta(this.$lines,delta,doNotValidate),this._signal("change",delta))},this.$splitAndapplyLargeDelta=function(delta,MAX){for(var lines=delta.lines,l=lines.length,row=delta.start.row,column=delta.start.column,from=0,to=0;;){from=to,to+=MAX-1;var chunk=lines.slice(from,to);if(to>l){delta.lines=chunk,delta.start.row=row+from,delta.start.column=column;break}chunk.push(""),this.applyDelta({start:this.pos(row+from,column),end:this.pos(row+to,column=0),action:delta.action,lines:chunk},!0)}},this.revertDelta=function(delta){this.applyDelta({start:this.clonePos(delta.start),end:this.clonePos(delta.end),action:"insert"==delta.action?"remove":"insert",lines:delta.lines.slice()})},this.indexToPosition=function(index,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,i=startRow||0,l=lines.length;l>i;i++)if(index-=lines[i].length+newlineLength,0>index)return{row:i,column:index+lines[i].length+newlineLength};return{row:l-1,column:lines[l-1].length}},this.positionToIndex=function(pos,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,index=0,row=Math.min(pos.row,lines.length),i=startRow||0;row>i;++i)index+=lines[i].length+newlineLength;return index+pos.column}}).call(Document.prototype),exports.Document=Document}),ace.define("ace/lib/lang",["require","exports","module"],function(acequire,exports){"use strict";exports.last=function(a){return a[a.length-1]},exports.stringReverse=function(string){return string.split("").reverse().join("")},exports.stringRepeat=function(string,count){for(var result="";count>0;)1&count&&(result+=string),(count>>=1)&&(string+=string);return result};var trimBeginRegexp=/^\\s\\s*/,trimEndRegexp=/\\s\\s*$/;exports.stringTrimLeft=function(string){return string.replace(trimBeginRegexp,"")},exports.stringTrimRight=function(string){return string.replace(trimEndRegexp,"")},exports.copyObject=function(obj){var copy={};for(var key in obj)copy[key]=obj[key];return copy},exports.copyArray=function(array){for(var copy=[],i=0,l=array.length;l>i;i++)copy[i]=array[i]&&"object"==typeof array[i]?this.copyObject(array[i]):array[i];return copy},exports.deepCopy=function deepCopy(obj){if("object"!=typeof obj||!obj)return obj;var copy;if(Array.isArray(obj)){copy=[];for(var key=0;obj.length>key;key++)copy[key]=deepCopy(obj[key]);return copy}if("[object Object]"!==Object.prototype.toString.call(obj))return obj;copy={};for(var key in obj)copy[key]=deepCopy(obj[key]);return copy},exports.arrayToMap=function(arr){for(var map={},i=0;arr.length>i;i++)map[arr[i]]=1;return map},exports.createMap=function(props){var map=Object.create(null);for(var i in props)map[i]=props[i];return map},exports.arrayRemove=function(array,value){for(var i=0;array.length>=i;i++)value===array[i]&&array.splice(i,1)},exports.escapeRegExp=function(str){return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g,"\\\\$1")},exports.escapeHTML=function(str){return str.replace(/&/g,"&").replace(/"/g,""").replace(/\'/g,"'").replace(/i;i+=2){if(Array.isArray(data[i+1]))var d={action:"insert",start:data[i],lines:data[i+1]};else var d={action:"remove",start:data[i],end:data[i+1]};doc.applyDelta(d,!0)}return _self.$timeout?deferredUpdate.schedule(_self.$timeout):(_self.onUpdate(),void 0)})};(function(){this.$timeout=500,this.setTimeout=function(timeout){this.$timeout=timeout},this.setValue=function(value){this.doc.setValue(value),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(callbackId){this.sender.callback(this.doc.getValue(),callbackId)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(Mirror.prototype)}),ace.define("ace/mode/json/json_parse",["require","exports","module"],function(){"use strict";var at,ch,text,value,escapee={\'"\':\'"\',"\\\\":"\\\\","/":"/",b:"\\b",f:"\\f",n:"\\n",r:"\\r",t:"\t"},error=function(m){throw{name:"SyntaxError",message:m,at:at,text:text}},next=function(c){return c&&c!==ch&&error("Expected \'"+c+"\' instead of \'"+ch+"\'"),ch=text.charAt(at),at+=1,ch},number=function(){var number,string="";for("-"===ch&&(string="-",next("-"));ch>="0"&&"9">=ch;)string+=ch,next();if("."===ch)for(string+=".";next()&&ch>="0"&&"9">=ch;)string+=ch;if("e"===ch||"E"===ch)for(string+=ch,next(),("-"===ch||"+"===ch)&&(string+=ch,next());ch>="0"&&"9">=ch;)string+=ch,next();return number=+string,isNaN(number)?(error("Bad number"),void 0):number},string=function(){var hex,i,uffff,string="";if(\'"\'===ch)for(;next();){if(\'"\'===ch)return next(),string;if("\\\\"===ch)if(next(),"u"===ch){for(uffff=0,i=0;4>i&&(hex=parseInt(next(),16),isFinite(hex));i+=1)uffff=16*uffff+hex;string+=String.fromCharCode(uffff)}else{if("string"!=typeof escapee[ch])break;string+=escapee[ch]}else string+=ch}error("Bad string")},white=function(){for(;ch&&" ">=ch;)next()},word=function(){switch(ch){case"t":return next("t"),next("r"),next("u"),next("e"),!0;case"f":return next("f"),next("a"),next("l"),next("s"),next("e"),!1;case"n":return next("n"),next("u"),next("l"),next("l"),null}error("Unexpected \'"+ch+"\'")},array=function(){var array=[];if("["===ch){if(next("["),white(),"]"===ch)return next("]"),array;for(;ch;){if(array.push(value()),white(),"]"===ch)return next("]"),array;next(","),white()}}error("Bad array")},object=function(){var key,object={};if("{"===ch){if(next("{"),white(),"}"===ch)return next("}"),object;for(;ch;){if(key=string(),white(),next(":"),Object.hasOwnProperty.call(object,key)&&error(\'Duplicate key "\'+key+\'"\'),object[key]=value(),white(),"}"===ch)return next("}"),object;next(","),white()}}error("Bad object")};return value=function(){switch(white(),ch){case"{":return object();case"[":return array();case\'"\':return string();case"-":return number();default:return ch>="0"&&"9">=ch?number():word()}},function(source,reviver){var result;return text=source,at=0,ch=" ",result=value(),white(),ch&&error("Syntax error"),"function"==typeof reviver?function walk(holder,key){var k,v,value=holder[key];if(value&&"object"==typeof value)for(k in value)Object.hasOwnProperty.call(value,k)&&(v=walk(value,k),void 0!==v?value[k]=v:delete value[k]);return reviver.call(holder,key,value)}({"":result},""):result}}),ace.define("ace/mode/json_worker",["require","exports","module","ace/lib/oop","ace/worker/mirror","ace/mode/json/json_parse"],function(acequire,exports){"use strict";var oop=acequire("../lib/oop"),Mirror=acequire("../worker/mirror").Mirror,parse=acequire("./json/json_parse"),JsonWorker=exports.JsonWorker=function(sender){Mirror.call(this,sender),this.setTimeout(200)};oop.inherits(JsonWorker,Mirror),function(){this.onUpdate=function(){var value=this.doc.getValue(),errors=[];try{value&&parse(value)}catch(e){var pos=this.doc.indexToPosition(e.at-1);errors.push({row:pos.row,column:pos.column,text:e.message,type:"error"})}this.sender.emit("annotate",errors)}}.call(JsonWorker.prototype)}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(){function Empty(){}function doesDefinePropertyWork(object){try{return Object.defineProperty(object,"sentinel",{}),"sentinel"in object}catch(exception){}}function toInteger(n){return n=+n,n!==n?n=0:0!==n&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n))),n}Function.prototype.bind||(Function.prototype.bind=function(that){var target=this;if("function"!=typeof target)throw new TypeError("Function.prototype.bind called on incompatible "+target);var args=slice.call(arguments,1),bound=function(){if(this instanceof bound){var result=target.apply(this,args.concat(slice.call(arguments)));return Object(result)===result?result:this}return target.apply(that,args.concat(slice.call(arguments)))};return target.prototype&&(Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null),bound});var defineGetter,defineSetter,lookupGetter,lookupSetter,supportsAccessors,call=Function.prototype.call,prototypeOfArray=Array.prototype,prototypeOfObject=Object.prototype,slice=prototypeOfArray.slice,_toString=call.bind(prototypeOfObject.toString),owns=call.bind(prototypeOfObject.hasOwnProperty);if((supportsAccessors=owns(prototypeOfObject,"__defineGetter__"))&&(defineGetter=call.bind(prototypeOfObject.__defineGetter__),defineSetter=call.bind(prototypeOfObject.__defineSetter__),lookupGetter=call.bind(prototypeOfObject.__lookupGetter__),lookupSetter=call.bind(prototypeOfObject.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function makeArray(l){var a=Array(l+2);return a[0]=a[1]=0,a}var lengthBefore,array=[];return array.splice.apply(array,makeArray(20)),array.splice.apply(array,makeArray(26)),lengthBefore=array.length,array.splice(5,0,"XXX"),lengthBefore+1==array.length,lengthBefore+1==array.length?!0:void 0\n}()){var array_splice=Array.prototype.splice;Array.prototype.splice=function(start,deleteCount){return arguments.length?array_splice.apply(this,[void 0===start?0:start,void 0===deleteCount?this.length-start:deleteCount].concat(slice.call(arguments,2))):[]}}else Array.prototype.splice=function(pos,removeCount){var length=this.length;pos>0?pos>length&&(pos=length):void 0==pos?pos=0:0>pos&&(pos=Math.max(length+pos,0)),length>pos+removeCount||(removeCount=length-pos);var removed=this.slice(pos,pos+removeCount),insert=slice.call(arguments,2),add=insert.length;if(pos===length)add&&this.push.apply(this,insert);else{var remove=Math.min(removeCount,length-pos),tailOldPos=pos+remove,tailNewPos=tailOldPos+add-remove,tailCount=length-tailOldPos,lengthAfterRemove=length-remove;if(tailOldPos>tailNewPos)for(var i=0;tailCount>i;++i)this[tailNewPos+i]=this[tailOldPos+i];else if(tailNewPos>tailOldPos)for(i=tailCount;i--;)this[tailNewPos+i]=this[tailOldPos+i];if(add&&pos===lengthAfterRemove)this.length=lengthAfterRemove,this.push.apply(this,insert);else for(this.length=lengthAfterRemove+add,i=0;add>i;++i)this[pos+i]=insert[i]}return removed};Array.isArray||(Array.isArray=function(obj){return"[object Array]"==_toString(obj)});var boxedString=Object("a"),splitString="a"!=boxedString[0]||!(0 in boxedString);if(Array.prototype.forEach||(Array.prototype.forEach=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,thisp=arguments[1],i=-1,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError;for(;length>++i;)i in self&&fun.call(thisp,self[i],i,object)}),Array.prototype.map||(Array.prototype.map=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,result=Array(length),thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)i in self&&(result[i]=fun.call(thisp,self[i],i,object));return result}),Array.prototype.filter||(Array.prototype.filter=function(fun){var value,object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,result=[],thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)i in self&&(value=self[i],fun.call(thisp,value,i,object)&&result.push(value));return result}),Array.prototype.every||(Array.prototype.every=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)if(i in self&&!fun.call(thisp,self[i],i,object))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)if(i in self&&fun.call(thisp,self[i],i,object))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");if(!length&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var result,i=0;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i++];break}if(++i>=length)throw new TypeError("reduce of empty array with no initial value")}for(;length>i;i++)i in self&&(result=fun.call(void 0,result,self[i],i,object));return result}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");if(!length&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var result,i=length-1;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i--];break}if(0>--i)throw new TypeError("reduceRight of empty array with no initial value")}do i in this&&(result=fun.call(void 0,result,self[i],i,object));while(i--);return result}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(sought){var self=splitString&&"[object String]"==_toString(this)?this.split(""):toObject(this),length=self.length>>>0;if(!length)return-1;var i=0;for(arguments.length>1&&(i=toInteger(arguments[1])),i=i>=0?i:Math.max(0,length+i);length>i;i++)if(i in self&&self[i]===sought)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(sought){var self=splitString&&"[object String]"==_toString(this)?this.split(""):toObject(this),length=self.length>>>0;if(!length)return-1;var i=length-1;for(arguments.length>1&&(i=Math.min(i,toInteger(arguments[1]))),i=i>=0?i:length-Math.abs(i);i>=0;i--)if(i in self&&sought===self[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(object){return object.__proto__||(object.constructor?object.constructor.prototype:prototypeOfObject)}),!Object.getOwnPropertyDescriptor){var ERR_NON_OBJECT="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(object,property){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT+object);if(owns(object,property)){var descriptor,getter,setter;if(descriptor={enumerable:!0,configurable:!0},supportsAccessors){var prototype=object.__proto__;object.__proto__=prototypeOfObject;var getter=lookupGetter(object,property),setter=lookupSetter(object,property);if(object.__proto__=prototype,getter||setter)return getter&&(descriptor.get=getter),setter&&(descriptor.set=setter),descriptor}return descriptor.value=object[property],descriptor}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(object){return Object.keys(object)}),!Object.create){var createEmpty;createEmpty=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var empty={};for(var i in empty)empty[i]=null;return empty.constructor=empty.hasOwnProperty=empty.propertyIsEnumerable=empty.isPrototypeOf=empty.toLocaleString=empty.toString=empty.valueOf=empty.__proto__=null,empty},Object.create=function(prototype,properties){var object;if(null===prototype)object=createEmpty();else{if("object"!=typeof prototype)throw new TypeError("typeof prototype["+typeof prototype+"] != \'object\'");var Type=function(){};Type.prototype=prototype,object=new Type,object.__proto__=prototype}return void 0!==properties&&Object.defineProperties(object,properties),object}}if(Object.defineProperty){var definePropertyWorksOnObject=doesDefinePropertyWork({}),definePropertyWorksOnDom="undefined"==typeof document||doesDefinePropertyWork(document.createElement("div"));if(!definePropertyWorksOnObject||!definePropertyWorksOnDom)var definePropertyFallback=Object.defineProperty}if(!Object.defineProperty||definePropertyFallback){var ERR_NON_OBJECT_DESCRIPTOR="Property description must be an object: ",ERR_NON_OBJECT_TARGET="Object.defineProperty called on non-object: ",ERR_ACCESSORS_NOT_SUPPORTED="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(object,property,descriptor){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT_TARGET+object);if("object"!=typeof descriptor&&"function"!=typeof descriptor||null===descriptor)throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR+descriptor);if(definePropertyFallback)try{return definePropertyFallback.call(Object,object,property,descriptor)}catch(exception){}if(owns(descriptor,"value"))if(supportsAccessors&&(lookupGetter(object,property)||lookupSetter(object,property))){var prototype=object.__proto__;object.__proto__=prototypeOfObject,delete object[property],object[property]=descriptor.value,object.__proto__=prototype}else object[property]=descriptor.value;else{if(!supportsAccessors)throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);owns(descriptor,"get")&&defineGetter(object,property,descriptor.get),owns(descriptor,"set")&&defineSetter(object,property,descriptor.set)}return object}}Object.defineProperties||(Object.defineProperties=function(object,properties){for(var property in properties)owns(properties,property)&&Object.defineProperty(object,property,properties[property]);return object}),Object.seal||(Object.seal=function(object){return object}),Object.freeze||(Object.freeze=function(object){return object});try{Object.freeze(function(){})}catch(exception){Object.freeze=function(freezeObject){return function(object){return"function"==typeof object?object:freezeObject(object)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(object){return object}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(object){if(Object(object)===object)throw new TypeError;for(var name="";owns(object,name);)name+="?";object[name]=!0;var returnValue=owns(object,name);return delete object[name],returnValue}),!Object.keys){var hasDontEnumBug=!0,dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dontEnumsLength=dontEnums.length;for(var key in{toString:null})hasDontEnumBug=!1;Object.keys=function(object){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError("Object.keys called on a non-object");var keys=[];for(var name in object)owns(object,name)&&keys.push(name);if(hasDontEnumBug)for(var i=0,ii=dontEnumsLength;ii>i;i++){var dontEnum=dontEnums[i];owns(object,dontEnum)&&keys.push(dontEnum)}return keys}}Date.now||(Date.now=function(){return(new Date).getTime()});var ws="\t\\n\v\\f\\r   ᠎              \\u2028\\u2029\ufeff";if(!String.prototype.trim||ws.trim()){ws="["+ws+"]";var trimBeginRegexp=RegExp("^"+ws+ws+"*"),trimEndRegexp=RegExp(ws+ws+"*$");String.prototype.trim=function(){return(this+"").replace(trimBeginRegexp,"").replace(trimEndRegexp,"")}}var toObject=function(o){if(null==o)throw new TypeError("can\'t convert "+o+" to object");return Object(o)}});'},31:function(e,t,n){"use strict";n.r(t),n.d(t,"renderApp",(function(){return Fe}));var r=n(14),o=n.n(r),i=n(20),s=n(18),a=n(19),l=n(25),c=n.n(l),u=n(0),d=n(16),p=n(15);const h=({activeTab:e,activateTab:t,has:n})=>Object(p.jsx)(d.EuiTabs,null,Object(p.jsx)(d.EuiTab,{"data-test-subj":"queryProfileTab",isSelected:"searches"===e,disabled:!n.searches,onClick:()=>t("searches")},u.i18n.translate("xpack.searchProfiler.queryProfileTabTitle",{defaultMessage:"Query Profile"})),Object(p.jsx)(d.EuiTab,{"data-test-subj":"aggregationProfileTab",isSelected:"aggregations"===e,disabled:!n.aggregations,onClick:()=>t("aggregations")},u.i18n.translate("xpack.searchProfiler.aggregationProfileTabTitle",{defaultMessage:"Aggregation Profile"})));var f=n(21);const m=()=>{const e=u.i18n.translate("xpack.searchProfiler.registerLicenseLinkLabel",{defaultMessage:"register a license"}),t=u.i18n.translate("xpack.searchProfiler.trialLicenseTitle",{defaultMessage:"Trial"}),n=u.i18n.translate("xpack.searchProfiler.basicLicenseTitle",{defaultMessage:"Basic"}),r=u.i18n.translate("xpack.searchProfiler.goldLicenseTitle",{defaultMessage:"Gold"}),i=u.i18n.translate("xpack.searchProfiler.platinumLicenseTitle",{defaultMessage:"Platinum"});return Object(p.jsx)("div",{className:"prfDevTool__licenseWarning__container"},Object(p.jsx)(d.EuiCallOut,{title:u.i18n.translate("xpack.searchProfiler.licenseErrorMessageTitle",{defaultMessage:"License error"}),color:"danger",iconType:"warning",style:{padding:"16px"}},Object(p.jsx)(d.EuiText,{size:"s"},Object(p.jsx)("p",null,Object(p.jsx)(f.FormattedMessage,{id:"xpack.searchProfiler.licenseErrorMessageDescription",defaultMessage:"The Profiler Visualization requires an active license ({licenseTypeList} or {platinumLicenseType}), but none were found in your cluster.",values:{licenseTypeList:Object(p.jsx)(o.a.Fragment,null,Object(p.jsx)(d.EuiCode,null,t),", ",Object(p.jsx)(d.EuiCode,null,n),","," ",Object(p.jsx)(d.EuiCode,null,r)),platinumLicenseType:Object(p.jsx)(d.EuiCode,null,i)}})),Object(p.jsx)("p",null,Object(p.jsx)(f.FormattedMessage,{id:"xpack.searchProfiler.registerLicenseDescription",defaultMessage:"Please {registerLicenseLink} to continue using the Search Profiler",values:{registerLicenseLink:Object(p.jsx)(d.EuiLink,{href:"https://www.elastic.co/subscriptions",rel:"noopener"},e)}})))))};var g=n(17),w=n.n(g);function b(e){return Object(g.get)(e,"[0].aggregations",[]).length>0}function v(e){return Object(g.get)(e,"[0].searches",[]).length>0}const{collapseLiteralStrings:y}=s.XJson;function x(e,t){return t||(t=1),(e=Number(e))<1e3?e.toFixed(t)+"ms":(e/=1e3)<60?e.toFixed(t)+"s":(e/=60)<60?e.toFixed(t)+"min":(e/=60)<24?e.toFixed(t)+"hr":(e/=24).toFixed(t)+"d"}const j=({index:e})=>{const{time:t,name:n}=e;return Object(p.jsx)(d.EuiFlexGroup,{justifyContent:"spaceBetween",gutterSize:"none",direction:"row"},Object(p.jsx)(d.EuiFlexItem,{grow:!1},Object(p.jsx)(d.EuiText,{className:"prfDevTool__profileTree__shardDetails"},Object(p.jsx)("h3",null,Object(p.jsx)("b",null,u.i18n.translate("xpack.searchProfiler.profileTree.indexTitle",{defaultMessage:"Index:"}))," "+n))),Object(p.jsx)(d.EuiFlexItem,{grow:!1,className:"prfDevTool__profileTree__indexDetails"},Object(p.jsx)(d.EuiText,{className:"prfDevTool__profileTree__shardDetails--dim"},Object(p.jsx)(d.EuiToolTip,{position:"bottom",content:u.i18n.translate("xpack.searchProfiler.profileTree.cumulativeTimeTooltip",{defaultMessage:"The cumulative time of all shards in the index. Note: this is not wall-clock time, as shards can execute in parallel."})},Object(p.jsx)("small",null,u.i18n.translate("xpack.searchProfiler.profileTree.cumulativeTimeTitle",{defaultMessage:"Cumulative time:"})))," "+x(t,3))))};var _=n(22);const O=Object(r.createContext)(null),k=({children:e,onHighlight:t})=>{const[n,o]=Object(r.useState)("");return Object(p.jsx)(O.Provider,{value:{selectedRow:n,setStore:({id:e,...n})=>{t(n),o(e)}}},e)};var E=n(23),R=n.n(E);const T=({timePercentage:e,label:t,valueType:n="percent"})=>Object(p.jsx)(d.EuiBadge,{className:R()({"prfDevTool__percentBadge__progress--percent":"percent"===n,"prfDevTool__percentBadge__progress--time":"time"===n,"euiTextAlign--center":!0}),style:{"--prfDevToolProgressPercentage":e+"%"}},Object(p.jsx)("span",{className:"prfDevTool__progress--percent-ie",style:{width:e+"%"}}),Object(p.jsx)("span",{className:"prfDevTool__progressText"},t)),S=({operation:e,index:t,shard:n})=>{const[i,s]=Object(r.useState)((({children:e})=>Boolean(e&&e.some((e=>e.visible))))(e)),{highlight:a,isHighlighted:l,id:c}=(()=>{const e=Object(r.useRef)(Object(_.v4)()),{selectedRow:t,setStore:n}=(()=>{const e=Object(r.useContext)(O);if(null==e)throw new Error("useHighlightContext must be called inside HighlightContext");return e})();return{id:e.current,highlight:t=>{n({id:e.current,...t})},isHighlighted:()=>t===e.current}})();return Object(p.jsx)(o.a.Fragment,null,Object(p.jsx)("div",{key:c,className:l()?"prfDevTool__tvRow--last":"",style:{paddingLeft:32*e.depth+"px"}},(f=e,Object(p.jsx)("div",{className:"prfDevTool__profileTree__tvRow"},Object(p.jsx)("div",{className:"prfDevTool__profileTree__cell euiTextAlign--left"},f.hasChildren?Object(p.jsx)(d.EuiLink,{className:"prfDevTool__profileTree__shardDetails",disabled:!f.hasChildren,onClick:()=>s(!i)},Object(p.jsx)(d.EuiIcon,{type:i?"arrowDown":"arrowRight"})," "+f.query_type):Object(p.jsx)(o.a.Fragment,null,Object(p.jsx)(d.EuiIcon,{type:"dot"})," "+f.query_type)),Object(p.jsx)("div",{className:"prfDevTool__profileTree__cell prfDevTool__profileTree__time euiTextAlign--center"},Object(p.jsx)(d.EuiBadge,{className:"prfDevTool__profileTree__badge euiTextAlign--center",style:{backgroundColor:f.absoluteColor}},x(f.selfTime||0,1))),Object(p.jsx)("div",{className:"prfDevTool__profileTree__cell prfDevTool__profileTree__totalTime"},Object(p.jsx)(d.EuiBadge,{className:"prfDevTool__profileTree__badge euiTextAlign--center",style:{backgroundColor:f.absoluteColor}},x(f.time,1))),Object(p.jsx)("div",{className:"prfDevTool__profileTree__cell prfDevTool__profileTree__percentage"},Object(p.jsx)(T,{timePercentage:f.timePercentage,label:f.timePercentage+"%"})))),Object(p.jsx)("div",{className:"prfDevTool__profileTree__tvRow"},Object(p.jsx)("span",{className:"prfDevTool__detail"},Object(p.jsx)(d.EuiCodeBlock,{paddingSize:"none"},(120,`${(h=e.lucene||"").slice(0,120)}${h.length>120?"...":""}`)),Object(p.jsx)(d.EuiLink,{type:"button","data-test-subj":"viewShardDetails",onClick:()=>a({indexName:t.name,operation:e,shard:n})},u.i18n.translate("xpack.searchProfiler.profileTree.body.viewDetailsLabel",{defaultMessage:"View details"}))))),i&&e.hasChildren&&e.children.map(((e,r)=>Object(p.jsx)(S,{key:r,operation:e,index:t,shard:n}))));var h,f},P=({data:e,index:t,shard:n})=>Object(p.jsx)("div",{className:"prfDevTool__profileTree__panelBody"},Object(p.jsx)(d.EuiFlexGroup,{responsive:!1,gutterSize:"none",direction:"column"},Object(p.jsx)(d.EuiFlexItem,{grow:!1},Object(p.jsx)("div",{className:"prfDevTool__profileTree__tvHeader"},Object(p.jsx)(d.EuiText,{size:"s",className:"euiTextAlign--left prfDevTool__profileTree__cell"},u.i18n.translate("xpack.searchProfiler.profileTree.header.typeTitle",{defaultMessage:"Type and description"})),Object(p.jsx)(d.EuiText,{size:"s",className:"prfDevTool__profileTree__cell prfDevTool__profileTree__time"},u.i18n.translate("xpack.searchProfiler.profileTree.header.selfTimeTitle",{defaultMessage:"Self time"})),Object(p.jsx)(d.EuiText,{size:"s",className:"prfDevTool__profileTree__cell prfDevTool__profileTree__time"},u.i18n.translate("xpack.searchProfiler.profileTree.header.totalTimeTitle",{defaultMessage:"Total time"})),Object(p.jsx)("div",{className:"prfDevTool__profileTree__cell prfDevTool__profileTree__percentage"}))),Object(p.jsx)(d.EuiFlexItem,{grow:!1},(e=>{const r=e.treeRoot||e;return Object(p.jsx)(S,{shard:n,index:t,operation:r})})(e)))),L=e=>{for(const n of e){var t;if(n.visible)return!0;if(null!==(t=n.children)&&void 0!==t&&t.length&&L(n.children))return!0}return!1},A=({index:e,shard:t,operations:n})=>{const{relative:i,time:s}=t,[a,l]=Object(r.useState)((()=>L(n.map((e=>{var t;return null!==(t=e.treeRoot)&&void 0!==t?t:e})))));return Object(p.jsx)(o.a.Fragment,null,Object(p.jsx)(d.EuiFlexGroup,{justifyContent:"spaceBetween",gutterSize:"none",direction:"row"},Object(p.jsx)(d.EuiFlexItem,{grow:!1,className:"prfDevTool__profileTree__shard__header-flex-item"},Object(p.jsx)(d.EuiLink,{className:"prfDevTool__profileTree__shardDetails",onClick:()=>l(!a),"data-test-subj":"openCloseShardDetails"},Object(p.jsx)(d.EuiIcon,{type:a?"arrowDown":"arrowRight"}),"[",t.id[0],"][",t.id[2],"]")),Object(p.jsx)(d.EuiFlexItem,{grow:!1,className:"prfDevTool__profileTree__shard__header-flex-item"},Object(p.jsx)(d.EuiText,{className:"prfDevTool__shardDetails--dim"},Object(p.jsx)(T,{timePercentage:String(i),label:x(s,3),valueType:"time"})))),a?n.map(((n,r)=>Object(p.jsx)(P,{key:r,index:e,shard:t,data:n}))):null)};var N=n(27),C=n(26),D=n.n(C);const M=40,I=(e,t)=>et?-1:0;function q(e){switch(e){case"build_scorer":return u.i18n.translate("xpack.searchProfiler.buildScorerTimeDescription",{defaultMessage:"The time taken to create the Scoring object, which is later used to execute the actual scoring of each doc."});case"create_weight":return u.i18n.translate("xpack.searchProfiler.createWeightTimeDescription",{defaultMessage:"The time taken to create the Weight object, which holds temporary information during scoring."});case"next_doc":return u.i18n.translate("xpack.searchProfiler.nextDocTimeDescription",{defaultMessage:"The time taken to advance the iterator to the next matching document."});case"score":return u.i18n.translate("xpack.searchProfiler.scoreTimeDescription",{defaultMessage:"The time taken in actually scoring the document against the query."});case"match":return u.i18n.translate("xpack.searchProfiler.matchTimeDescription",{defaultMessage:"The time taken to execute a secondary, more precise scoring phase (used by phrase queries)."});case"advance":return u.i18n.translate("xpack.searchProfiler.advanceTimeDescription",{defaultMessage:"The time taken to advance the iterator to the next document."});default:return""}}function F(e){return e.time_in_nanos?e.time_in_nanos/1e6:"string"==typeof e.time?Number(e.time.replace("ms","")):Number(e.time)}function $(e,t){let n=0;for(const t of e){n+=F(t),t.breakdown=B(t.breakdown);let e=0;null!=t.children&&0!==t.children.length&&(e=$(t.children,t.id),t.hasChildren=!0),t.selfTime=F(t)-e}return n}function B(e){const t=[],n=Object.keys(e).reduce(((t,n)=>(-1===n.indexOf("_count")&&(t+=e[n]),t)),0);return Object.keys(e).sort().forEach((r=>{let o=0;-1===r.indexOf("_count")&&(o=(e[r]/n*100).toFixed(1)),t.push({key:r,time:e[r],relative:o,color:D.a.mix("#F5F5F5","#FFAFAF",o).toHexString(),tip:q(r)})})),t.sort(((e,t)=>0!==I(e.time,t.time)?I(e.time,t.time):-1*I(e.key,t.key)))}function H(e,t){e.timePercentage=(F(e)/t*100).toFixed(2),e.absoluteColor=D.a.mix("#F5F5F5","#FFAFAF",+e.timePercentage).toHexString()}function z(e,t,n=0,r=null){if(M+1!==n){for(const o of e)o.description||(o.description=o.lucene,o.lucene=null,o.type=o.query_type,o.query_type=null),H(o,t),o.parent=r,o.time=F(o),o.lucene=o.description,o.query_type=o.type.split(".").pop(),o.visible=+o.timePercentage>20,o.depth=n,null!=o.children&&0!==o.children.length&&z(o.children,t,n+1,o);e.sort(((e,t)=>I(F(e),F(t))))}else r&&(r.hasChildren=!1,r.children=[])}const U=e=>{const t=[];for(const n of Object.values(e))t.push(n);return t.sort(((e,t)=>I(e.time,t.time))),t};function G(e){null==e.aggregations&&(e.time=0);let t=0;for(const n of e.aggregations)t+=$([n]);for(const n of e.aggregations)z([n],t),n.treeRoot=n;e.time=t}function W(e){null==e.searches&&(e.time=0),e.rewrite_time=0;let t=0;for(const n of e.searches){e.rewrite_time+=n.rewrite_time;const r=$(n.query);t+=r,z(n.query,r),n.treeRoot=n.query[0],n.query=null}e.time=t}const V=e=>e.map((e=>{const t=(e.id.match(/\[([^\]\[]*?)\]/g)||[]).map((e=>e.replace("[","").replace("]","")));return{...e,id:t,time:0,color:"",relative:0}})),J=e=>{const t={};for(const n of e)t[n.id[1]]||(t[n.id[1]]={shards:[],time:0,name:n.id[1],visible:!1}),t[n.id[1]].shards.push(n),t[n.id[1]].time+=n.time;return t},X=e=>Object(N.flow)(g.cloneDeep,V,(e=>t=>{const n="searches"===e?W:"aggregations"===e?G:null;if(n)for(const e of t)n(e);return t})(e),J,(e=>t=>(function(e,t){let n;"searches"===t?n=(e,t)=>{const n=w.a.sumBy(e.searches,(e=>e.treeRoot.time)),r=w.a.sumBy(t.searches,(e=>e.treeRoot.time));return I(n,r)}:"aggregations"===t&&(n=(e,t)=>{const n=w.a.sumBy(e.aggregations,(e=>e.treeRoot.time)),r=w.a.sumBy(t.aggregations,(e=>e.treeRoot.time));return I(n,r)});for(const t of Object.values(e)){t.shards.sort(n);for(const e of t.shards)e.relative=(e.time/t.time*100).toFixed(2),e.color=D.a.mix("#F5F5F5","#FFAFAF",e.relative).toHexString()}}(t,e),t))(e),U),Y=Object(r.memo)((({data:e,target:t,onHighlight:n,onDataInitError:o})=>{let i=null;if(e&&e.length)try{const o=X(t)(e);i=Object(p.jsx)(k,{onHighlight:n},Object(p.jsx)(d.EuiFlexGroup,{className:"prfDevTool__profileTree__container",gutterSize:"none",direction:"column"},o.map((e=>Object(p.jsx)(d.EuiFlexItem,{key:e.name,grow:!1},Object(p.jsx)(d.EuiFlexGroup,{className:"prfDevTool__profileTree__panel prfDevTool__profileTree__index",gutterSize:"none",key:e.name,direction:"column"},Object(p.jsx)(d.EuiFlexItem,{grow:!1},Object(p.jsx)(j,{index:e})),Object(p.jsx)(d.EuiSpacer,{size:"s"}),Object(p.jsx)(d.EuiFlexItem,{grow:!1},e.shards.map(((n,o)=>Object(p.jsx)(r.Fragment,{key:n.id[1]+`_${o}`},Object(p.jsx)(A,{index:e,shard:n,operations:n[t]}),o{const t=[{name:"Description",render:e=>Object(p.jsx)(d.EuiToolTip,{position:"left",content:e.tip},Object(p.jsx)("span",null,e.key))},{name:"Time",render:e=>Object(p.jsx)(d.EuiBadge,{style:{backgroundColor:e.color}},Object(p.jsx)("span",null,function(e,t){t||(t=1);const n=["ns","µs"];for(const r of n){if(e<1e3)return e.toFixed(t)+r;e/=1e3}return x(e,t)}(e.time,1)))},{name:"Percentage",render:e=>Object(p.jsx)(T,{timePercentage:String(e.relative),label:e.relative+"%"})}];return Object(p.jsx)(d.EuiBasicTable,{items:e,columns:t})},K=({title:e,body:t})=>Object(p.jsx)(o.a.Fragment,null,Object(p.jsx)("dt",null,e),Object(p.jsx)("dd",null,t)),Q=({indexName:e,operation:t,shardName:n,onClose:r})=>Object(p.jsx)(d.EuiFlyout,{className:"prfDevTool__details",onClose:()=>r()},Object(p.jsx)(d.EuiFlyoutHeader,{hasBorder:!0},Object(p.jsx)(d.EuiText,{size:"s"},e),Object(p.jsx)(d.EuiText,null,n)),Object(p.jsx)(d.EuiFlyoutBody,null,Object(p.jsx)(d.EuiText,null,Object(p.jsx)("dl",null,Object(p.jsx)(K,{title:u.i18n.translate("xpack.searchProfiler.highlightDetails.typeTitle",{defaultMessage:"Type"}),body:t.query_type}),Object(p.jsx)(K,{title:u.i18n.translate("xpack.searchProfiler.highlightDetails.descriptionTitle",{defaultMessage:"Description"}),body:Object(p.jsx)(d.EuiCodeBlock,{paddingSize:"s"},t.lucene)}),Object(p.jsx)(K,{title:Object(p.jsx)(o.a.Fragment,null,u.i18n.translate("xpack.searchProfiler.highlightDetails.totalTimeTitle",{defaultMessage:"Total time"})," ",Object(p.jsx)(d.EuiIconTip,{type:"iInCircle",color:"subdued",content:u.i18n.translate("xpack.searchProfiler.highlightDetails.totalTimeTooltip",{defaultMessage:"The total time spent at this query component, inclusive of children"})})),body:x(t.time,3)}),Object(p.jsx)(K,{title:Object(p.jsx)(o.a.Fragment,null,u.i18n.translate("xpack.searchProfiler.highlightDetails.selfTimeTitle",{defaultMessage:"Self time"})," ",Object(p.jsx)(d.EuiIconTip,{type:"iInCircle",color:"subdued",content:u.i18n.translate("xpack.searchProfiler.highlightDetails.selfTimeTooltip",{defaultMessage:"The time spent by this query component alone, exclusive of children"})})),body:x(t.selfTime||0,3)}),Object(p.jsx)(K,{title:u.i18n.translate("xpack.searchProfiler.highlightDetails.timingBreakdownTitle",{defaultMessage:"Timing breakdown"}),body:Object(p.jsx)(Z,{breakdown:t.breakdown})}))))),ee=()=>Object(p.jsx)("div",{className:"prfDevTool__main__emptyTreePlaceholder"},Object(p.jsx)(d.EuiText,{color:"subdued"},Object(p.jsx)("h1",null,u.i18n.translate("xpack.searchProfiler.profilingLoaderText",{defaultMessage:"Loading query profiles..."})))),te=()=>Object(p.jsx)("div",{className:"prfDevTool__main__emptyTreePlaceholder"},Object(p.jsx)(d.EuiText,{color:"subdued"},Object(p.jsx)("h1",null,u.i18n.translate("xpack.searchProfiler.emptyProfileTreeTitle",{defaultMessage:"No queries to profile"})),Object(p.jsx)("p",null,u.i18n.translate("xpack.searchProfiler.emptyProfileTreeDescription",{defaultMessage:"Enter a query, click Profile, and see the results here."}))));var ne=n(28);const re=Object(r.createContext)(null),oe=({children:e,args:{http:t,notifications:n,initialLicenseStatus:o,location:i}})=>{const s=Object(r.useCallback)((()=>o),[o]);return Object(p.jsx)(re.Provider,{value:{http:t,notifications:n,getLicenseStatus:s,location:i}},e)},ie=()=>{const e=Object(r.useContext)(re);if(null==e)throw new Error("useAppContext must be called inside AppContextProvider");return e},se=(e,t)=>{const n={...e};if("setProfiling"===t.type)return n.pristine=!1,n.profiling=t.value,n.profiling&&(n.currentResponse=null,n.highlightDetails=null),n;if("setHighlightDetails"===t.type){if(t.value){const e=t.value,{children:r,parent:o,...i}=e.operation;n.highlightDetails={indexName:e.indexName,operation:Object.freeze(i),shardName:`[${e.shard.id[0]}][${e.shard.id[2]}]`}}else n.highlightDetails=null;return n}if("setActiveTab"===t.type)return n.activeTab=t.value,n;if("setCurrentResponse"===t.type){if(n.currentResponse=t.value,n.currentResponse){const e=b(n.currentResponse),t=v(n.currentResponse);"searches"===n.activeTab&&!t&&e?n.activeTab="aggregations":"aggregations"===n.activeTab&&!e&&t?n.activeTab="searches":n.activeTab||(n.activeTab="searches")}else n.activeTab=null;return n}throw new Error(`Unknown action: ${t}`)},ae={profiling:!1,pristine:!0,highlightDetails:null,activeTab:null,currentResponse:null},le=Object(r.createContext)(null),ce=Object(r.createContext)(null),ue=({children:e})=>{const{dispatch:t,state:n}=(()=>{const[e,t]=Object(r.useReducer)(se,ae);return{state:e,dispatch:t}})();return Object(p.jsx)(le.Provider,{value:n},Object(p.jsx)(ce.Provider,{value:t},e))},de=()=>{const e=Object(r.useContext)(ce);if(null==e)throw new Error("useProfilerActionContext must be called inside ProfilerActionContext");return e};var pe=n(24),he=n.n(pe);const{TextHighlightRules:fe}=he.a.acequire("ace/mode/text_highlight_rules"),me=he.a.acequire("ace/lib/oop"),ge=function(){const e=this.createKeywordMapper({keyword:["describe|between|in|like|not|and|or|desc|select|from|where|having|group|by|orderasc|desc|pivot|for|in|as|show|columns|include|frozen|tables|escape|limit|rlike|all|distinct|is","avg|count|first|first_value|last|last_value|max|min|sum|kurtosis|mad|percentile|percentile_rank|skewness|stddev_pop|sum_of_squares|var_pop|histogram|case|coalesce|greatest|ifnull|iif|isnull|least|nullif|nvl|curdate|current_date|current_time|current_timestamp|curtime|dateadd|datediff|datepart|datetrunc|date_add|date_diff|date_part|date_trunc|day|dayname|dayofmonth|dayofweek|dayofyear|day_name|day_of_month|day_of_week|day_of_year|dom|dow|doy|hour|hour_of_day|idow|isodayofweek|isodow|isoweek|isoweekofyear|iso_day_of_week|iso_week_of_year|iw|iwoy|minute|minute_of_day|minute_of_hour|month|monthname|month_name|month_of_year|now|quarter|second|second_of_minute|timestampadd|timestampdiff|timestamp_add|timestamp_diff|today|week|week_of_year|year|abs|acos|asin|atan|atan2|cbrt|ceil|ceiling|cos|cosh|cot|degrees|e|exp|expm1|floor|log|log10|mod|pi|power|radians|rand|random|round|sign|signum|sin|sinh|sqrt|tan|truncate|ascii|bit_length|char|character_length|char_length|concat|insert|lcase|left|length|locate|ltrim|octet_length|position|repeat|replace|right|rtrim|space|substring|ucase|cast|convert|database|user|st_astext|st_aswkt|st_distance|st_geometrytype|st_geomfromtext|st_wkttosql|st_x|st_y|st_z|score","true|false","null|boolean|byte|short|integer|long|double|float|half_float|scaled_float|keyword|text|binary|date|ip|object|nested|time|interval_year|interval_month|interval_day|interval_hour|interval_minute|interval_second|interval_year_to_monthinteval_day_to_hour|interval_day_to_minute|interval_day_to_second|interval_hour_to_minute|interval_hour_to_secondinterval_minute_to_second|geo_point|geo_shape|shape"].join("|")},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"string",regex:'".*?"'},{token:"constant",regex:"'.*?'"},{token:"string",regex:"`.*?`"},{token:"entity.name.function",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"⇐|<⇒|\\*|\\.|\\:\\:|\\+|\\-|\\/|\\/\\/|%|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules()};me.inherits(ge,fe);const we=he.a.acequire("ace/lib/oop"),{TextHighlightRules:be}=he.a.acequire("ace/mode/text_highlight_rules"),ve="def|int|long|byte|String|float|double|char|null|if|else|while|do|for|continue|break|new|try|catch|throw|this|instanceof|return|ctx";function ye(){this.name="ScriptHighlightRules",this.$rules={start:[{token:"script.comment",regex:"\\/\\/.*$"},{token:"script.string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},{token:"script.string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"script.constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"script.constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"script.constant.language.boolean",regex:"(?:true|false)\\b"},{token:"script.keyword",regex:ve},{token:"script.text",regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"script.keyword.operator",regex:"\\?\\.|\\*\\.|=~|==~|!|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|->|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|typeof|void)"},{token:"script.lparen",regex:"[[({]"},{token:"script.rparen",regex:"[\\])}]"},{token:"script.text",regex:"\\s+"}]}}we.inherits(ye,be),n(29);const{JsonHighlightRules:xe}=he.a.acequire("ace/mode/json_highlight_rules"),je=he.a.acequire("ace/lib/oop"),_e=function(e){const t={},n=[{token:["variable","whitespace","ace.punctuation.colon","whitespace","punctuation.start_triple_quote"],regex:'("(?:[^"]*_)?script"|"inline"|"source")(\\s*?)(:)(\\s*?)(""")',next:"script-start",merge:!1,push:!0},{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"punctuation.start_triple_quote",regex:'"""',next:"string_literal",merge:!1,push:!0},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"invalid.illegal",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"invalid.illegal",regex:"\\/\\/.*$"},{token:"paren.lparen",merge:!1,regex:"{",next:e=e||"json",push:!0},{token:"paren.lparen",merge:!1,regex:"[[(]"},{token:"paren.rparen",merge:!1,regex:"[\\])]"},{token:"paren.rparen",regex:"}",merge:!1,next:"pop"},{token:"punctuation.comma",regex:","},{token:"punctuation.colon",regex:":"},{token:"whitespace",regex:"\\s+"},{token:"text",regex:".+?"}];return t[e]=n,t[e+"-sql"]=[{token:["variable","whitespace","ace.punctuation.colon","whitespace","punctuation.start_triple_quote"],regex:'("query")(\\s*?)(:)(\\s*?)(""")',next:"sql-start",merge:!1,push:!0}].concat(n),t.string_literal=[{token:"punctuation.end_triple_quote",regex:'"""',next:"pop"},{token:"multi_string",regex:"."}],t};function Oe(){this.$rules={..._e("start")},this.embedRules(ye,"script-",[{token:"punctuation.end_triple_quote",regex:'"""',next:"pop"}]),this.embedRules(ge,"sql-",[{token:"punctuation.end_triple_quote",regex:'"""',next:"pop"}])}je.inherits(Oe,xe);const ke={id:"ace/mode/json_worker",src:'/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0 and the Server Side Public License, v 1; you may not use this file except\n * in compliance with, at your election, the Elastic License 2.0 or the Server\n * Side Public License, v 1.\n */\n\n/* @notice\n *\n * This product includes code that is based on Ace editor, which was available\n * under a "BSD" license.\n *\n * Distributed under the BSD license:\n *\n * Copyright (c) 2010, Ajax.org B.V.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * * Neither the name of Ajax.org B.V. nor the\n * names of its contributors may be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* eslint-disable prettier/prettier,no-var,eqeqeq,no-use-before-define,block-scoped-var,no-undef,\n guard-for-in,one-var,strict,no-redeclare,no-sequences,no-proto,new-cap,no-nested-ternary,no-unused-vars,\n prefer-const,no-empty,no-extend-native,camelcase */\n/*\n This file is loaded up as a blob by Brace to hand to Ace to load as Jsonp\n (hence the redefining of everything). It is based on the json\n mode from the brace distro.\n\n It is very likely that this file will be removed in future but for now it enables\n extended JSON parsing, like e.g. """{}""" (triple quotes)\n*/\n// @internal\n// @ts-nocheck\n"no use strict";\n! function(window) {\n function resolveModuleId(id, paths) {\n for (var testPath = id, tail = ""; testPath;) {\n var alias = paths[testPath];\n if ("string" == typeof alias) return alias + tail;\n if (alias) return alias.location.replace(/\\/*$/, "/") + (tail || alias.main || alias.name);\n if (alias === !1) return "";\n var i = testPath.lastIndexOf("/");\n if (-1 === i) break;\n tail = testPath.substr(i) + tail, testPath = testPath.slice(0, i)\n }\n return id\n }\n if (!(void 0 !== window.window && window.document || window.acequire && window.define)) {\n window.console || (window.console = function() {\n var msgs = Array.prototype.slice.call(arguments, 0);\n postMessage({\n type: "log",\n data: msgs\n })\n }, window.console.error = window.console.warn = window.console.log = window.console.trace = window.console), window.window = window, window.ace = window, window.onerror = function(message, file, line, col, err) {\n postMessage({\n type: "error",\n data: {\n message: message,\n data: err.data,\n file: file,\n line: line,\n col: col,\n stack: err.stack\n }\n })\n }, window.normalizeModule = function(parentId, moduleName) {\n if (-1 !== moduleName.indexOf("!")) {\n var chunks = moduleName.split("!");\n return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1])\n }\n if ("." == moduleName.charAt(0)) {\n var base = parentId.split("/").slice(0, -1).join("/");\n for (moduleName = (base ? base + "/" : "") + moduleName; - 1 !== moduleName.indexOf(".") && previous != moduleName;) {\n var previous = moduleName;\n moduleName = moduleName.replace(/^\\.\\//, "").replace(/\\/\\.\\//, "/").replace(/[^\\/]+\\/\\.\\.\\//, "")\n }\n }\n return moduleName\n }, window.acequire = function acequire(parentId, id) {\n if (id || (id = parentId, parentId = null), !id.charAt) throw Error("worker.js acequire() accepts only (parentId, id) as arguments");\n id = window.normalizeModule(parentId, id);\n var module = window.acequire.modules[id];\n if (module) return module.initialized || (module.initialized = !0, module.exports = module.factory().exports), module.exports;\n if (!window.acequire.tlns) return console.log("unable to load " + id);\n var path = resolveModuleId(id, window.acequire.tlns);\n return ".js" != path.slice(-3) && (path += ".js"), window.acequire.id = id, window.acequire.modules[id] = {}, importScripts(path), window.acequire(parentId, id)\n }, window.acequire.modules = {}, window.acequire.tlns = {}, window.define = function(id, deps, factory) {\n if (2 == arguments.length ? (factory = deps, "string" != typeof id && (deps = id, id = window.acequire.id)) : 1 == arguments.length && (factory = id, deps = [], id = window.acequire.id), "function" != typeof factory) return window.acequire.modules[id] = {\n exports: factory,\n initialized: !0\n }, void 0;\n deps.length || (deps = ["require", "exports", "module"]);\n var req = function(childId) {\n return window.acequire(id, childId)\n };\n window.acequire.modules[id] = {\n exports: {},\n factory: function() {\n var module = this,\n returnExports = factory.apply(this, deps.map(function(dep) {\n switch (dep) {\n case "require":\n return req;\n case "exports":\n return module.exports;\n case "module":\n return module;\n default:\n return req(dep)\n }\n }));\n return returnExports && (module.exports = returnExports), module\n }\n }\n }, window.define.amd = {}, acequire.tlns = {}, window.initBaseUrls = function(topLevelNamespaces) {\n for (var i in topLevelNamespaces) acequire.tlns[i] = topLevelNamespaces[i]\n }, window.initSender = function() {\n var EventEmitter = window.acequire("ace/lib/event_emitter").EventEmitter,\n oop = window.acequire("ace/lib/oop"),\n Sender = function() {};\n return function() {\n oop.implement(this, EventEmitter), this.callback = function(data, callbackId) {\n postMessage({\n type: "call",\n id: callbackId,\n data: data\n })\n }, this.emit = function(name, data) {\n postMessage({\n type: "event",\n name: name,\n data: data\n })\n }\n }.call(Sender.prototype), new Sender\n };\n var main = window.main = null,\n sender = window.sender = null;\n window.onmessage = function(e) {\n var msg = e.data;\n if (msg.event && sender) sender._signal(msg.event, msg.data);\n else if (msg.command)\n if (main[msg.command]) main[msg.command].apply(main, msg.args);\n else {\n if (!window[msg.command]) throw Error("Unknown command:" + msg.command);\n window[msg.command].apply(window, msg.args)\n }\n else if (msg.init) {\n window.initBaseUrls(msg.tlns), acequire("ace/lib/es5-shim"), sender = window.sender = window.initSender();\n var clazz = acequire(msg.module)[msg.classname];\n main = window.main = new clazz(sender)\n }\n }\n }\n}(this), ace.define("ace/lib/oop", ["require", "exports", "module"], function(acequire, exports) {\n "use strict";\n exports.inherits = function(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n })\n }, exports.mixin = function(obj, mixin) {\n for (var key in mixin) obj[key] = mixin[key];\n return obj\n }, exports.implement = function(proto, mixin) {\n exports.mixin(proto, mixin)\n }\n}), ace.define("ace/range", ["require", "exports", "module"], function(acequire, exports) {\n "use strict";\n var comparePoints = function(p1, p2) {\n return p1.row - p2.row || p1.column - p2.column\n },\n Range = function(startRow, startColumn, endRow, endColumn) {\n this.start = {\n row: startRow,\n column: startColumn\n }, this.end = {\n row: endRow,\n column: endColumn\n }\n };\n (function() {\n this.isEqual = function(range) {\n return this.start.row === range.start.row && this.end.row === range.end.row && this.start.column === range.start.column && this.end.column === range.end.column\n }, this.toString = function() {\n return "Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]"\n }, this.contains = function(row, column) {\n return 0 == this.compare(row, column)\n }, this.compareRange = function(range) {\n var cmp, end = range.end,\n start = range.start;\n return cmp = this.compare(end.row, end.column), 1 == cmp ? (cmp = this.compare(start.row, start.column), 1 == cmp ? 2 : 0 == cmp ? 1 : 0) : -1 == cmp ? -2 : (cmp = this.compare(start.row, start.column), -1 == cmp ? -1 : 1 == cmp ? 42 : 0)\n }, this.comparePoint = function(p) {\n return this.compare(p.row, p.column)\n }, this.containsRange = function(range) {\n return 0 == this.comparePoint(range.start) && 0 == this.comparePoint(range.end)\n }, this.intersects = function(range) {\n var cmp = this.compareRange(range);\n return -1 == cmp || 0 == cmp || 1 == cmp\n }, this.isEnd = function(row, column) {\n return this.end.row == row && this.end.column == column\n }, this.isStart = function(row, column) {\n return this.start.row == row && this.start.column == column\n }, this.setStart = function(row, column) {\n "object" == typeof row ? (this.start.column = row.column, this.start.row = row.row) : (this.start.row = row, this.start.column = column)\n }, this.setEnd = function(row, column) {\n "object" == typeof row ? (this.end.column = row.column, this.end.row = row.row) : (this.end.row = row, this.end.column = column)\n }, this.inside = function(row, column) {\n return 0 == this.compare(row, column) ? this.isEnd(row, column) || this.isStart(row, column) ? !1 : !0 : !1\n }, this.insideStart = function(row, column) {\n return 0 == this.compare(row, column) ? this.isEnd(row, column) ? !1 : !0 : !1\n }, this.insideEnd = function(row, column) {\n return 0 == this.compare(row, column) ? this.isStart(row, column) ? !1 : !0 : !1\n }, this.compare = function(row, column) {\n return this.isMultiLine() || row !== this.start.row ? this.start.row > row ? -1 : row > this.end.row ? 1 : this.start.row === row ? column >= this.start.column ? 0 : -1 : this.end.row === row ? this.end.column >= column ? 0 : 1 : 0 : this.start.column > column ? -1 : column > this.end.column ? 1 : 0\n }, this.compareStart = function(row, column) {\n return this.start.row == row && this.start.column == column ? -1 : this.compare(row, column)\n }, this.compareEnd = function(row, column) {\n return this.end.row == row && this.end.column == column ? 1 : this.compare(row, column)\n }, this.compareInside = function(row, column) {\n return this.end.row == row && this.end.column == column ? 1 : this.start.row == row && this.start.column == column ? -1 : this.compare(row, column)\n }, this.clipRows = function(firstRow, lastRow) {\n if (this.end.row > lastRow) var end = {\n row: lastRow + 1,\n column: 0\n };\n else if (firstRow > this.end.row) var end = {\n row: firstRow,\n column: 0\n };\n if (this.start.row > lastRow) var start = {\n row: lastRow + 1,\n column: 0\n };\n else if (firstRow > this.start.row) var start = {\n row: firstRow,\n column: 0\n };\n return Range.fromPoints(start || this.start, end || this.end)\n }, this.extend = function(row, column) {\n var cmp = this.compare(row, column);\n if (0 == cmp) return this;\n if (-1 == cmp) var start = {\n row: row,\n column: column\n };\n else var end = {\n row: row,\n column: column\n };\n return Range.fromPoints(start || this.start, end || this.end)\n }, this.isEmpty = function() {\n return this.start.row === this.end.row && this.start.column === this.end.column\n }, this.isMultiLine = function() {\n return this.start.row !== this.end.row\n }, this.clone = function() {\n return Range.fromPoints(this.start, this.end)\n }, this.collapseRows = function() {\n return 0 == this.end.column ? new Range(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0) : new Range(this.start.row, 0, this.end.row, 0)\n }, this.toScreenRange = function(session) {\n var screenPosStart = session.documentToScreenPosition(this.start),\n screenPosEnd = session.documentToScreenPosition(this.end);\n return new Range(screenPosStart.row, screenPosStart.column, screenPosEnd.row, screenPosEnd.column)\n }, this.moveBy = function(row, column) {\n this.start.row += row, this.start.column += column, this.end.row += row, this.end.column += column\n }\n }).call(Range.prototype), Range.fromPoints = function(start, end) {\n return new Range(start.row, start.column, end.row, end.column)\n }, Range.comparePoints = comparePoints, Range.comparePoints = function(p1, p2) {\n return p1.row - p2.row || p1.column - p2.column\n }, exports.Range = Range\n}), ace.define("ace/apply_delta", ["require", "exports", "module"], function(acequire, exports) {\n "use strict";\n exports.applyDelta = function(docLines, delta) {\n var row = delta.start.row,\n startColumn = delta.start.column,\n line = docLines[row] || "";\n switch (delta.action) {\n case "insert":\n var lines = delta.lines;\n if (1 === lines.length) docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);\n else {\n var args = [row, 1].concat(delta.lines);\n docLines.splice.apply(docLines, args), docLines[row] = line.substring(0, startColumn) + docLines[row], docLines[row + delta.lines.length - 1] += line.substring(startColumn)\n }\n break;\n case "remove":\n var endColumn = delta.end.column,\n endRow = delta.end.row;\n row === endRow ? docLines[row] = line.substring(0, startColumn) + line.substring(endColumn) : docLines.splice(row, endRow - row + 1, line.substring(0, startColumn) + docLines[endRow].substring(endColumn))\n }\n }\n}), ace.define("ace/lib/event_emitter", ["require", "exports", "module"], function(acequire, exports) {\n "use strict";\n var EventEmitter = {},\n stopPropagation = function() {\n this.propagationStopped = !0\n },\n preventDefault = function() {\n this.defaultPrevented = !0\n };\n EventEmitter._emit = EventEmitter._dispatchEvent = function(eventName, e) {\n this._eventRegistry || (this._eventRegistry = {}), this._defaultHandlers || (this._defaultHandlers = {});\n var listeners = this._eventRegistry[eventName] || [],\n defaultHandler = this._defaultHandlers[eventName];\n if (listeners.length || defaultHandler) {\n "object" == typeof e && e || (e = {}), e.type || (e.type = eventName), e.stopPropagation || (e.stopPropagation = stopPropagation), e.preventDefault || (e.preventDefault = preventDefault), listeners = listeners.slice();\n for (var i = 0; listeners.length > i && (listeners[i](e, this), !e.propagationStopped); i++);\n return defaultHandler && !e.defaultPrevented ? defaultHandler(e, this) : void 0\n }\n }, EventEmitter._signal = function(eventName, e) {\n var listeners = (this._eventRegistry || {})[eventName];\n if (listeners) {\n listeners = listeners.slice();\n for (var i = 0; listeners.length > i; i++) listeners[i](e, this)\n }\n }, EventEmitter.once = function(eventName, callback) {\n var _self = this;\n callback && this.addEventListener(eventName, function newCallback() {\n _self.removeEventListener(eventName, newCallback), callback.apply(null, arguments)\n })\n }, EventEmitter.setDefaultHandler = function(eventName, callback) {\n var handlers = this._defaultHandlers;\n if (handlers || (handlers = this._defaultHandlers = {\n _disabled_: {}\n }), handlers[eventName]) {\n var old = handlers[eventName],\n disabled = handlers._disabled_[eventName];\n disabled || (handlers._disabled_[eventName] = disabled = []), disabled.push(old);\n var i = disabled.indexOf(callback); - 1 != i && disabled.splice(i, 1)\n }\n handlers[eventName] = callback\n }, EventEmitter.removeDefaultHandler = function(eventName, callback) {\n var handlers = this._defaultHandlers;\n if (handlers) {\n var disabled = handlers._disabled_[eventName];\n if (handlers[eventName] == callback) handlers[eventName], disabled && this.setDefaultHandler(eventName, disabled.pop());\n else if (disabled) {\n var i = disabled.indexOf(callback); - 1 != i && disabled.splice(i, 1)\n }\n }\n }, EventEmitter.on = EventEmitter.addEventListener = function(eventName, callback, capturing) {\n this._eventRegistry = this._eventRegistry || {};\n var listeners = this._eventRegistry[eventName];\n return listeners || (listeners = this._eventRegistry[eventName] = []), -1 == listeners.indexOf(callback) && listeners[capturing ? "unshift" : "push"](callback), callback\n }, EventEmitter.off = EventEmitter.removeListener = EventEmitter.removeEventListener = function(eventName, callback) {\n this._eventRegistry = this._eventRegistry || {};\n var listeners = this._eventRegistry[eventName];\n if (listeners) {\n var index = listeners.indexOf(callback); - 1 !== index && listeners.splice(index, 1)\n }\n }, EventEmitter.removeAllListeners = function(eventName) {\n this._eventRegistry && (this._eventRegistry[eventName] = [])\n }, exports.EventEmitter = EventEmitter\n}), ace.define("ace/anchor", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"], function(acequire, exports) {\n "use strict";\n var oop = acequire("./lib/oop"),\n EventEmitter = acequire("./lib/event_emitter").EventEmitter,\n Anchor = exports.Anchor = function(doc, row, column) {\n this.$onChange = this.onChange.bind(this), this.attach(doc), column === void 0 ? this.setPosition(row.row, row.column) : this.setPosition(row, column)\n };\n (function() {\n function $pointsInOrder(point1, point2, equalPointsInOrder) {\n var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;\n return point1.row < point2.row || point1.row == point2.row && bColIsAfter\n }\n\n function $getTransformedPoint(delta, point, moveIfEqual) {\n var deltaIsInsert = "insert" == delta.action,\n deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row),\n deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column),\n deltaStart = delta.start,\n deltaEnd = deltaIsInsert ? deltaStart : delta.end;\n return $pointsInOrder(point, deltaStart, moveIfEqual) ? {\n row: point.row,\n column: point.column\n } : $pointsInOrder(deltaEnd, point, !moveIfEqual) ? {\n row: point.row + deltaRowShift,\n column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)\n } : {\n row: deltaStart.row,\n column: deltaStart.column\n }\n }\n oop.implement(this, EventEmitter), this.getPosition = function() {\n return this.$clipPositionToDocument(this.row, this.column)\n }, this.getDocument = function() {\n return this.document\n }, this.$insertRight = !1, this.onChange = function(delta) {\n if (!(delta.start.row == delta.end.row && delta.start.row != this.row || delta.start.row > this.row)) {\n var point = $getTransformedPoint(delta, {\n row: this.row,\n column: this.column\n }, this.$insertRight);\n this.setPosition(point.row, point.column, !0)\n }\n }, this.setPosition = function(row, column, noClip) {\n var pos;\n if (pos = noClip ? {\n row: row,\n column: column\n } : this.$clipPositionToDocument(row, column), this.row != pos.row || this.column != pos.column) {\n var old = {\n row: this.row,\n column: this.column\n };\n this.row = pos.row, this.column = pos.column, this._signal("change", {\n old: old,\n value: pos\n })\n }\n }, this.detach = function() {\n this.document.removeEventListener("change", this.$onChange)\n }, this.attach = function(doc) {\n this.document = doc || this.document, this.document.on("change", this.$onChange)\n }, this.$clipPositionToDocument = function(row, column) {\n var pos = {};\n return row >= this.document.getLength() ? (pos.row = Math.max(0, this.document.getLength() - 1), pos.column = this.document.getLine(pos.row).length) : 0 > row ? (pos.row = 0, pos.column = 0) : (pos.row = row, pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column))), 0 > column && (pos.column = 0), pos\n }\n }).call(Anchor.prototype)\n}), ace.define("ace/document", ["require", "exports", "module", "ace/lib/oop", "ace/apply_delta", "ace/lib/event_emitter", "ace/range", "ace/anchor"], function(acequire, exports) {\n "use strict";\n var oop = acequire("./lib/oop"),\n applyDelta = acequire("./apply_delta").applyDelta,\n EventEmitter = acequire("./lib/event_emitter").EventEmitter,\n Range = acequire("./range").Range,\n Anchor = acequire("./anchor").Anchor,\n Document = function(textOrLines) {\n this.$lines = [""], 0 === textOrLines.length ? this.$lines = [""] : Array.isArray(textOrLines) ? this.insertMergedLines({\n row: 0,\n column: 0\n }, textOrLines) : this.insert({\n row: 0,\n column: 0\n }, textOrLines)\n };\n (function() {\n oop.implement(this, EventEmitter), this.setValue = function(text) {\n var len = this.getLength() - 1;\n this.remove(new Range(0, 0, len, this.getLine(len).length)), this.insert({\n row: 0,\n column: 0\n }, text)\n }, this.getValue = function() {\n return this.getAllLines().join(this.getNewLineCharacter())\n }, this.createAnchor = function(row, column) {\n return new Anchor(this, row, column)\n }, this.$split = 0 === "aaa".split(/a/).length ? function(text) {\n return text.replace(/\\r\\n|\\r/g, "\\n").split("\\n")\n } : function(text) {\n return text.split(/\\r\\n|\\r|\\n/)\n }, this.$detectNewLine = function(text) {\n var match = text.match(/^.*?(\\r\\n|\\r|\\n)/m);\n this.$autoNewLine = match ? match[1] : "\\n", this._signal("changeNewLineMode")\n }, this.getNewLineCharacter = function() {\n switch (this.$newLineMode) {\n case "windows":\n return "\\r\\n";\n case "unix":\n return "\\n";\n default:\n return this.$autoNewLine || "\\n"\n }\n }, this.$autoNewLine = "", this.$newLineMode = "auto", this.setNewLineMode = function(newLineMode) {\n this.$newLineMode !== newLineMode && (this.$newLineMode = newLineMode, this._signal("changeNewLineMode"))\n }, this.getNewLineMode = function() {\n return this.$newLineMode\n }, this.isNewLine = function(text) {\n return "\\r\\n" == text || "\\r" == text || "\\n" == text\n }, this.getLine = function(row) {\n return this.$lines[row] || ""\n }, this.getLines = function(firstRow, lastRow) {\n return this.$lines.slice(firstRow, lastRow + 1)\n }, this.getAllLines = function() {\n return this.getLines(0, this.getLength())\n }, this.getLength = function() {\n return this.$lines.length\n }, this.getTextRange = function(range) {\n return this.getLinesForRange(range).join(this.getNewLineCharacter())\n }, this.getLinesForRange = function(range) {\n var lines;\n if (range.start.row === range.end.row) lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];\n else {\n lines = this.getLines(range.start.row, range.end.row), lines[0] = (lines[0] || "").substring(range.start.column);\n var l = lines.length - 1;\n range.end.row - range.start.row == l && (lines[l] = lines[l].substring(0, range.end.column))\n }\n return lines\n }, this.insertLines = function(row, lines) {\n return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."), this.insertFullLines(row, lines)\n }, this.removeLines = function(firstRow, lastRow) {\n return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."), this.removeFullLines(firstRow, lastRow)\n }, this.insertNewLine = function(position) {\n return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\'\', \'\']) instead."), this.insertMergedLines(position, ["", ""])\n }, this.insert = function(position, text) {\n return 1 >= this.getLength() && this.$detectNewLine(text), this.insertMergedLines(position, this.$split(text))\n }, this.insertInLine = function(position, text) {\n var start = this.clippedPos(position.row, position.column),\n end = this.pos(position.row, position.column + text.length);\n return this.applyDelta({\n start: start,\n end: end,\n action: "insert",\n lines: [text]\n }, !0), this.clonePos(end)\n }, this.clippedPos = function(row, column) {\n var length = this.getLength();\n void 0 === row ? row = length : 0 > row ? row = 0 : row >= length && (row = length - 1, column = void 0);\n var line = this.getLine(row);\n return void 0 == column && (column = line.length), column = Math.min(Math.max(column, 0), line.length), {\n row: row,\n column: column\n }\n }, this.clonePos = function(pos) {\n return {\n row: pos.row,\n column: pos.column\n }\n }, this.pos = function(row, column) {\n return {\n row: row,\n column: column\n }\n }, this.$clipPosition = function(position) {\n var length = this.getLength();\n return position.row >= length ? (position.row = Math.max(0, length - 1), position.column = this.getLine(length - 1).length) : (position.row = Math.max(0, position.row), position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length)), position\n }, this.insertFullLines = function(row, lines) {\n row = Math.min(Math.max(row, 0), this.getLength());\n var column = 0;\n this.getLength() > row ? (lines = lines.concat([""]), column = 0) : (lines = [""].concat(lines), row--, column = this.$lines[row].length), this.insertMergedLines({\n row: row,\n column: column\n }, lines)\n }, this.insertMergedLines = function(position, lines) {\n var start = this.clippedPos(position.row, position.column),\n end = {\n row: start.row + lines.length - 1,\n column: (1 == lines.length ? start.column : 0) + lines[lines.length - 1].length\n };\n return this.applyDelta({\n start: start,\n end: end,\n action: "insert",\n lines: lines\n }), this.clonePos(end)\n }, this.remove = function(range) {\n var start = this.clippedPos(range.start.row, range.start.column),\n end = this.clippedPos(range.end.row, range.end.column);\n return this.applyDelta({\n start: start,\n end: end,\n action: "remove",\n lines: this.getLinesForRange({\n start: start,\n end: end\n })\n }), this.clonePos(start)\n }, this.removeInLine = function(row, startColumn, endColumn) {\n var start = this.clippedPos(row, startColumn),\n end = this.clippedPos(row, endColumn);\n return this.applyDelta({\n start: start,\n end: end,\n action: "remove",\n lines: this.getLinesForRange({\n start: start,\n end: end\n })\n }, !0), this.clonePos(start)\n }, this.removeFullLines = function(firstRow, lastRow) {\n firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1), lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1);\n var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0,\n deleteLastNewLine = this.getLength() - 1 > lastRow,\n startRow = deleteFirstNewLine ? firstRow - 1 : firstRow,\n startCol = deleteFirstNewLine ? this.getLine(startRow).length : 0,\n endRow = deleteLastNewLine ? lastRow + 1 : lastRow,\n endCol = deleteLastNewLine ? 0 : this.getLine(endRow).length,\n range = new Range(startRow, startCol, endRow, endCol),\n deletedLines = this.$lines.slice(firstRow, lastRow + 1);\n return this.applyDelta({\n start: range.start,\n end: range.end,\n action: "remove",\n lines: this.getLinesForRange(range)\n }), deletedLines\n }, this.removeNewLine = function(row) {\n this.getLength() - 1 > row && row >= 0 && this.applyDelta({\n start: this.pos(row, this.getLine(row).length),\n end: this.pos(row + 1, 0),\n action: "remove",\n lines: ["", ""]\n })\n }, this.replace = function(range, text) {\n if (range instanceof Range || (range = Range.fromPoints(range.start, range.end)), 0 === text.length && range.isEmpty()) return range.start;\n if (text == this.getTextRange(range)) return range.end;\n this.remove(range);\n var end;\n return end = text ? this.insert(range.start, text) : range.start\n }, this.applyDeltas = function(deltas) {\n for (var i = 0; deltas.length > i; i++) this.applyDelta(deltas[i])\n }, this.revertDeltas = function(deltas) {\n for (var i = deltas.length - 1; i >= 0; i--) this.revertDelta(deltas[i])\n }, this.applyDelta = function(delta, doNotValidate) {\n var isInsert = "insert" == delta.action;\n (isInsert ? 1 >= delta.lines.length && !delta.lines[0] : !Range.comparePoints(delta.start, delta.end)) || (isInsert && delta.lines.length > 2e4 && this.$splitAndapplyLargeDelta(delta, 2e4), applyDelta(this.$lines, delta, doNotValidate), this._signal("change", delta))\n }, this.$splitAndapplyLargeDelta = function(delta, MAX) {\n for (var lines = delta.lines, l = lines.length, row = delta.start.row, column = delta.start.column, from = 0, to = 0;;) {\n from = to, to += MAX - 1;\n var chunk = lines.slice(from, to);\n if (to > l) {\n delta.lines = chunk, delta.start.row = row + from, delta.start.column = column;\n break\n }\n chunk.push(""), this.applyDelta({\n start: this.pos(row + from, column),\n end: this.pos(row + to, column = 0),\n action: delta.action,\n lines: chunk\n }, !0)\n }\n }, this.revertDelta = function(delta) {\n this.applyDelta({\n start: this.clonePos(delta.start),\n end: this.clonePos(delta.end),\n action: "insert" == delta.action ? "remove" : "insert",\n lines: delta.lines.slice()\n })\n }, this.indexToPosition = function(index, startRow) {\n for (var lines = this.$lines || this.getAllLines(), newlineLength = this.getNewLineCharacter().length, i = startRow || 0, l = lines.length; l > i; i++)\n if (index -= lines[i].length + newlineLength, 0 > index) return {\n row: i,\n column: index + lines[i].length + newlineLength\n };\n return {\n row: l - 1,\n column: lines[l - 1].length\n }\n }, this.positionToIndex = function(pos, startRow) {\n for (var lines = this.$lines || this.getAllLines(), newlineLength = this.getNewLineCharacter().length, index = 0, row = Math.min(pos.row, lines.length), i = startRow || 0; row > i; ++i) index += lines[i].length + newlineLength;\n return index + pos.column\n }\n }).call(Document.prototype), exports.Document = Document\n}), ace.define("ace/lib/lang", ["require", "exports", "module"], function(acequire, exports) {\n "use strict";\n exports.last = function(a) {\n return a[a.length - 1]\n }, exports.stringReverse = function(string) {\n return string.split("").reverse().join("")\n }, exports.stringRepeat = function(string, count) {\n for (var result = ""; count > 0;) 1 & count && (result += string), (count >>= 1) && (string += string);\n return result\n };\n var trimBeginRegexp = /^\\s\\s*/,\n trimEndRegexp = /\\s\\s*$/;\n exports.stringTrimLeft = function(string) {\n return string.replace(trimBeginRegexp, "")\n }, exports.stringTrimRight = function(string) {\n return string.replace(trimEndRegexp, "")\n }, exports.copyObject = function(obj) {\n var copy = {};\n for (var key in obj) copy[key] = obj[key];\n return copy\n }, exports.copyArray = function(array) {\n for (var copy = [], i = 0, l = array.length; l > i; i++) copy[i] = array[i] && "object" == typeof array[i] ? this.copyObject(array[i]) : array[i];\n return copy\n }, exports.deepCopy = function deepCopy(obj) {\n if ("object" != typeof obj || !obj) return obj;\n var copy;\n if (Array.isArray(obj)) {\n copy = [];\n for (var key = 0; obj.length > key; key++) copy[key] = deepCopy(obj[key]);\n return copy\n }\n if ("[object Object]" !== Object.prototype.toString.call(obj)) return obj;\n copy = {};\n for (var key in obj) copy[key] = deepCopy(obj[key]);\n return copy\n }, exports.arrayToMap = function(arr) {\n for (var map = {}, i = 0; arr.length > i; i++) map[arr[i]] = 1;\n return map\n }, exports.createMap = function(props) {\n var map = Object.create(null);\n for (var i in props) map[i] = props[i];\n return map\n }, exports.arrayRemove = function(array, value) {\n for (var i = 0; array.length >= i; i++) value === array[i] && array.splice(i, 1)\n }, exports.escapeRegExp = function(str) {\n return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g, "\\\\$1")\n }, exports.escapeHTML = function(str) {\n return str.replace(/&/g, "&").replace(/"/g, """).replace(/\'/g, "'").replace(/ i; i += 2) {\n if (Array.isArray(data[i + 1])) var d = {\n action: "insert",\n start: data[i],\n lines: data[i + 1]\n };\n else var d = {\n action: "remove",\n start: data[i],\n end: data[i + 1]\n };\n doc.applyDelta(d, !0)\n }\n return _self.$timeout ? deferredUpdate.schedule(_self.$timeout) : (_self.onUpdate(), void 0)\n })\n };\n (function() {\n this.$timeout = 500, this.setTimeout = function(timeout) {\n this.$timeout = timeout\n }, this.setValue = function(value) {\n this.doc.setValue(value), this.deferredUpdate.schedule(this.$timeout)\n }, this.getValue = function(callbackId) {\n this.sender.callback(this.doc.getValue(), callbackId)\n }, this.onUpdate = function() {}, this.isPending = function() {\n return this.deferredUpdate.isPending()\n }\n }).call(Mirror.prototype)\n}), ace.define("ace/mode/json/json_parse", ["require", "exports", "module"], function() {\n "use strict";\n var at, ch, text, value, escapee = {\n \'"\': \'"\',\n "\\\\": "\\\\",\n "/": "/",\n b: "\\b",\n f: "\\f",\n n: "\\n",\n r: "\\r",\n t: "\t"\n },\n error = function(m) {\n throw {\n name: "SyntaxError",\n message: m,\n at: at,\n text: text\n }\n },\n reset = function (newAt) {\n ch = text.charAt(newAt);\n at = newAt + 1;\n },\n next = function(c) {\n return c && c !== ch && error("Expected \'" + c + "\' instead of \'" + ch + "\'"), ch = text.charAt(at), at += 1, ch\n },\n nextUpTo = function (upTo, errorMessage) {\n let currentAt = at,\n i = text.indexOf(upTo, currentAt);\n if (i < 0) {\n error(errorMessage || \'Expected \\\'\' + upTo + \'\\\'\');\n }\n reset(i + upTo.length);\n return text.substring(currentAt, i);\n },\n peek = function (c) {\n return text.substr(at, c.length) === c; // nocommit - double check\n },\n number = function() {\n var number, string = "";\n for ("-" === ch && (string = "-", next("-")); ch >= "0" && "9" >= ch;) string += ch, next();\n if ("." === ch)\n for (string += "."; next() && ch >= "0" && "9" >= ch;) string += ch;\n if ("e" === ch || "E" === ch)\n for (string += ch, next(), ("-" === ch || "+" === ch) && (string += ch, next()); ch >= "0" && "9" >= ch;) string += ch, next();\n return number = +string, isNaN(number) ? (error("Bad number"), void 0) : number\n },\n string = function() {\n var hex, i, uffff, string = "";\n if (\'"\' === ch) {\n if (peek(\'""\')) {\n // literal\n next(\'"\');\n next(\'"\');\n return nextUpTo(\'"""\', \'failed to find closing \\\'"""\\\'\');\n } else {\n for (; next();) {\n if (\'"\' === ch) return next(), string;\n if ("\\\\" === ch)\n if (next(), "u" === ch) {\n for (uffff = 0, i = 0; 4 > i && (hex = parseInt(next(), 16), isFinite(hex)); i += 1) uffff = 16 * uffff + hex;\n string += String.fromCharCode(uffff)\n } else {\n if ("string" != typeof escapee[ch]) break;\n string += escapee[ch]\n }\n else string += ch\n }\n }\n }\n error("Bad string")\n },\n white = function() {\n for (; ch && " " >= ch;) next()\n },\n word = function() {\n switch (ch) {\n case "t":\n return next("t"), next("r"), next("u"), next("e"), !0;\n case "f":\n return next("f"), next("a"), next("l"), next("s"), next("e"), !1;\n case "n":\n return next("n"), next("u"), next("l"), next("l"), null\n }\n error("Unexpected \'" + ch + "\'")\n },\n array = function() {\n var array = [];\n if ("[" === ch) {\n if (next("["), white(), "]" === ch) return next("]"), array;\n for (; ch;) {\n if (array.push(value()), white(), "]" === ch) return next("]"), array;\n next(","), white()\n }\n }\n error("Bad array")\n },\n object = function() {\n var key, object = {};\n if ("{" === ch) {\n if (next("{"), white(), "}" === ch) return next("}"), object;\n for (; ch;) {\n if (key = string(), white(), next(":"), Object.hasOwnProperty.call(object, key) && error(\'Duplicate key "\' + key + \'"\'), object[key] = value(), white(), "}" === ch) return next("}"), object;\n next(","), white()\n }\n }\n error("Bad object")\n };\n return value = function() {\n switch (white(), ch) {\n case "{":\n return object();\n case "[":\n return array();\n case \'"\':\n return string();\n case "-":\n return number();\n default:\n return ch >= "0" && "9" >= ch ? number() : word()\n }\n },\n function(source, reviver) {\n var result;\n return text = source, at = 0, ch = " ", result = value(), white(), ch && error("Syntax error"), "function" == typeof reviver ? function walk(holder, key) {\n var k, v, value = holder[key];\n if (value && "object" == typeof value)\n for (k in value) Object.hasOwnProperty.call(value, k) && (v = walk(value, k), void 0 !== v ? value[k] = v : delete value[k]);\n return reviver.call(holder, key, value)\n }({\n "": result\n }, "") : result\n }\n}), ace.define("ace/mode/json_worker", ["require", "exports", "module", "ace/lib/oop", "ace/worker/mirror", "ace/mode/json/json_parse"], function(acequire, exports) {\n "use strict";\n var oop = acequire("../lib/oop"),\n Mirror = acequire("../worker/mirror").Mirror,\n parse = acequire("./json/json_parse"),\n JsonWorker = exports.JsonWorker = function(sender) {\n Mirror.call(this, sender), this.setTimeout(200)\n };\n oop.inherits(JsonWorker, Mirror),\n function() {\n this.onUpdate = function() {\n var value = this.doc.getValue(),\n errors = [];\n try {\n value && parse(value)\n } catch (e) {\n var pos = this.doc.indexToPosition(e.at - 1);\n errors.push({\n row: pos.row,\n column: pos.column,\n text: e.message,\n type: "error"\n })\n }\n this.sender.emit("annotate", errors)\n }\n }.call(JsonWorker.prototype)\n}), ace.define("ace/lib/es5-shim", ["require", "exports", "module"], function() {\n function Empty() {}\n\n function doesDefinePropertyWork(object) {\n try {\n return Object.defineProperty(object, "sentinel", {}), "sentinel" in object\n } catch (exception) {}\n }\n\n function toInteger(n) {\n return n = +n, n !== n ? n = 0 : 0 !== n && n !== 1 / 0 && n !== -(1 / 0) && (n = (n > 0 || -1) * Math.floor(Math.abs(n))), n\n }\n Function.prototype.bind || (Function.prototype.bind = function(that) {\n var target = this;\n if ("function" != typeof target) throw new TypeError("Function.prototype.bind called on incompatible " + target);\n var args = slice.call(arguments, 1),\n bound = function() {\n if (this instanceof bound) {\n var result = target.apply(this, args.concat(slice.call(arguments)));\n return Object(result) === result ? result : this\n }\n return target.apply(that, args.concat(slice.call(arguments)))\n };\n return target.prototype && (Empty.prototype = target.prototype, bound.prototype = new Empty, Empty.prototype = null), bound\n });\n var defineGetter, defineSetter, lookupGetter, lookupSetter, supportsAccessors, call = Function.prototype.call,\n prototypeOfArray = Array.prototype,\n prototypeOfObject = Object.prototype,\n slice = prototypeOfArray.slice,\n _toString = call.bind(prototypeOfObject.toString),\n owns = call.bind(prototypeOfObject.hasOwnProperty);\n if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__")) && (defineGetter = call.bind(prototypeOfObject.__defineGetter__), defineSetter = call.bind(prototypeOfObject.__defineSetter__), lookupGetter = call.bind(prototypeOfObject.__lookupGetter__), lookupSetter = call.bind(prototypeOfObject.__lookupSetter__)), 2 != [1, 2].splice(0).length)\n if (function() {\n function makeArray(l) {\n var a = Array(l + 2);\n return a[0] = a[1] = 0, a\n }\n var lengthBefore, array = [];\n return array.splice.apply(array, makeArray(20)), array.splice.apply(array, makeArray(26)), lengthBefore = array.length, array.splice(5, 0, "XXX"), lengthBefore + 1 == array.length, lengthBefore + 1 == array.length ? !0 : void 0\n }()) {\n var array_splice = Array.prototype.splice;\n Array.prototype.splice = function(start, deleteCount) {\n return arguments.length ? array_splice.apply(this, [void 0 === start ? 0 : start, void 0 === deleteCount ? this.length - start : deleteCount].concat(slice.call(arguments, 2))) : []\n }\n } else Array.prototype.splice = function(pos, removeCount) {\n var length = this.length;\n pos > 0 ? pos > length && (pos = length) : void 0 == pos ? pos = 0 : 0 > pos && (pos = Math.max(length + pos, 0)), length > pos + removeCount || (removeCount = length - pos);\n var removed = this.slice(pos, pos + removeCount),\n insert = slice.call(arguments, 2),\n add = insert.length;\n if (pos === length) add && this.push.apply(this, insert);\n else {\n var remove = Math.min(removeCount, length - pos),\n tailOldPos = pos + remove,\n tailNewPos = tailOldPos + add - remove,\n tailCount = length - tailOldPos,\n lengthAfterRemove = length - remove;\n if (tailOldPos > tailNewPos)\n for (var i = 0; tailCount > i; ++i) this[tailNewPos + i] = this[tailOldPos + i];\n else if (tailNewPos > tailOldPos)\n for (i = tailCount; i--;) this[tailNewPos + i] = this[tailOldPos + i];\n if (add && pos === lengthAfterRemove) this.length = lengthAfterRemove, this.push.apply(this, insert);\n else\n for (this.length = lengthAfterRemove + add, i = 0; add > i; ++i) this[pos + i] = insert[i]\n }\n return removed\n };\n Array.isArray || (Array.isArray = function(obj) {\n return "[object Array]" == _toString(obj)\n });\n var boxedString = Object("a"),\n splitString = "a" != boxedString[0] || !(0 in boxedString);\n if (Array.prototype.forEach || (Array.prototype.forEach = function(fun) {\n var object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n thisp = arguments[1],\n i = -1,\n length = self.length >>> 0;\n if ("[object Function]" != _toString(fun)) throw new TypeError;\n for (; length > ++i;) i in self && fun.call(thisp, self[i], i, object)\n }), Array.prototype.map || (Array.prototype.map = function(fun) {\n var object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n length = self.length >>> 0,\n result = Array(length),\n thisp = arguments[1];\n if ("[object Function]" != _toString(fun)) throw new TypeError(fun + " is not a function");\n for (var i = 0; length > i; i++) i in self && (result[i] = fun.call(thisp, self[i], i, object));\n return result\n }), Array.prototype.filter || (Array.prototype.filter = function(fun) {\n var value, object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n length = self.length >>> 0,\n result = [],\n thisp = arguments[1];\n if ("[object Function]" != _toString(fun)) throw new TypeError(fun + " is not a function");\n for (var i = 0; length > i; i++) i in self && (value = self[i], fun.call(thisp, value, i, object) && result.push(value));\n return result\n }), Array.prototype.every || (Array.prototype.every = function(fun) {\n var object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n length = self.length >>> 0,\n thisp = arguments[1];\n if ("[object Function]" != _toString(fun)) throw new TypeError(fun + " is not a function");\n for (var i = 0; length > i; i++)\n if (i in self && !fun.call(thisp, self[i], i, object)) return !1;\n return !0\n }), Array.prototype.some || (Array.prototype.some = function(fun) {\n var object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n length = self.length >>> 0,\n thisp = arguments[1];\n if ("[object Function]" != _toString(fun)) throw new TypeError(fun + " is not a function");\n for (var i = 0; length > i; i++)\n if (i in self && fun.call(thisp, self[i], i, object)) return !0;\n return !1\n }), Array.prototype.reduce || (Array.prototype.reduce = function(fun) {\n var object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n length = self.length >>> 0;\n if ("[object Function]" != _toString(fun)) throw new TypeError(fun + " is not a function");\n if (!length && 1 == arguments.length) throw new TypeError("reduce of empty array with no initial value");\n var result, i = 0;\n if (arguments.length >= 2) result = arguments[1];\n else\n for (;;) {\n if (i in self) {\n result = self[i++];\n break\n }\n if (++i >= length) throw new TypeError("reduce of empty array with no initial value")\n }\n for (; length > i; i++) i in self && (result = fun.call(void 0, result, self[i], i, object));\n return result\n }), Array.prototype.reduceRight || (Array.prototype.reduceRight = function(fun) {\n var object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n length = self.length >>> 0;\n if ("[object Function]" != _toString(fun)) throw new TypeError(fun + " is not a function");\n if (!length && 1 == arguments.length) throw new TypeError("reduceRight of empty array with no initial value");\n var result, i = length - 1;\n if (arguments.length >= 2) result = arguments[1];\n else\n for (;;) {\n if (i in self) {\n result = self[i--];\n break\n }\n if (0 > --i) throw new TypeError("reduceRight of empty array with no initial value")\n }\n do i in this && (result = fun.call(void 0, result, self[i], i, object)); while (i--);\n return result\n }), Array.prototype.indexOf && -1 == [0, 1].indexOf(1, 2) || (Array.prototype.indexOf = function(sought) {\n var self = splitString && "[object String]" == _toString(this) ? this.split("") : toObject(this),\n length = self.length >>> 0;\n if (!length) return -1;\n var i = 0;\n for (arguments.length > 1 && (i = toInteger(arguments[1])), i = i >= 0 ? i : Math.max(0, length + i); length > i; i++)\n if (i in self && self[i] === sought) return i;\n return -1\n }), Array.prototype.lastIndexOf && -1 == [0, 1].lastIndexOf(0, -3) || (Array.prototype.lastIndexOf = function(sought) {\n var self = splitString && "[object String]" == _toString(this) ? this.split("") : toObject(this),\n length = self.length >>> 0;\n if (!length) return -1;\n var i = length - 1;\n for (arguments.length > 1 && (i = Math.min(i, toInteger(arguments[1]))), i = i >= 0 ? i : length - Math.abs(i); i >= 0; i--)\n if (i in self && sought === self[i]) return i;\n return -1\n }), Object.getPrototypeOf || (Object.getPrototypeOf = function(object) {\n return object.__proto__ || (object.constructor ? object.constructor.prototype : prototypeOfObject)\n }), !Object.getOwnPropertyDescriptor) {\n var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a non-object: ";\n Object.getOwnPropertyDescriptor = function(object, property) {\n if ("object" != typeof object && "function" != typeof object || null === object) throw new TypeError(ERR_NON_OBJECT + object);\n if (owns(object, property)) {\n var descriptor, getter, setter;\n if (descriptor = {\n enumerable: !0,\n configurable: !0\n }, supportsAccessors) {\n var prototype = object.__proto__;\n object.__proto__ = prototypeOfObject;\n var getter = lookupGetter(object, property),\n setter = lookupSetter(object, property);\n if (object.__proto__ = prototype, getter || setter) return getter && (descriptor.get = getter), setter && (descriptor.set = setter), descriptor\n }\n return descriptor.value = object[property], descriptor\n }\n }\n }\n if (Object.getOwnPropertyNames || (Object.getOwnPropertyNames = function(object) {\n return Object.keys(object)\n }), !Object.create) {\n var createEmpty;\n createEmpty = null === Object.prototype.__proto__ ? function() {\n return {\n __proto__: null\n }\n } : function() {\n var empty = {};\n for (var i in empty) empty[i] = null;\n return empty.constructor = empty.hasOwnProperty = empty.propertyIsEnumerable = empty.isPrototypeOf = empty.toLocaleString = empty.toString = empty.valueOf = empty.__proto__ = null, empty\n }, Object.create = function(prototype, properties) {\n var object;\n if (null === prototype) object = createEmpty();\n else {\n if ("object" != typeof prototype) throw new TypeError("typeof prototype[" + typeof prototype + "] != \'object\'");\n var Type = function() {};\n Type.prototype = prototype, object = new Type, object.__proto__ = prototype\n }\n return void 0 !== properties && Object.defineProperties(object, properties), object\n }\n }\n if (Object.defineProperty) {\n var definePropertyWorksOnObject = doesDefinePropertyWork({}),\n definePropertyWorksOnDom = "undefined" == typeof document || doesDefinePropertyWork(document.createElement("div"));\n if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) var definePropertyFallback = Object.defineProperty\n }\n if (!Object.defineProperty || definePropertyFallback) {\n var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: ",\n ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: ",\n ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined on this javascript engine";\n Object.defineProperty = function(object, property, descriptor) {\n if ("object" != typeof object && "function" != typeof object || null === object) throw new TypeError(ERR_NON_OBJECT_TARGET + object);\n if ("object" != typeof descriptor && "function" != typeof descriptor || null === descriptor) throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);\n if (definePropertyFallback) try {\n return definePropertyFallback.call(Object, object, property, descriptor)\n } catch (exception) {}\n if (owns(descriptor, "value"))\n if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) {\n var prototype = object.__proto__;\n object.__proto__ = prototypeOfObject, delete object[property], object[property] = descriptor.value, object.__proto__ = prototype\n } else object[property] = descriptor.value;\n else {\n if (!supportsAccessors) throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);\n owns(descriptor, "get") && defineGetter(object, property, descriptor.get), owns(descriptor, "set") && defineSetter(object, property, descriptor.set)\n }\n return object\n }\n }\n Object.defineProperties || (Object.defineProperties = function(object, properties) {\n for (var property in properties) owns(properties, property) && Object.defineProperty(object, property, properties[property]);\n return object\n }), Object.seal || (Object.seal = function(object) {\n return object\n }), Object.freeze || (Object.freeze = function(object) {\n return object\n });\n try {\n Object.freeze(function() {})\n } catch (exception) {\n Object.freeze = function(freezeObject) {\n return function(object) {\n return "function" == typeof object ? object : freezeObject(object)\n }\n }(Object.freeze)\n }\n if (Object.preventExtensions || (Object.preventExtensions = function(object) {\n return object\n }), Object.isSealed || (Object.isSealed = function() {\n return !1\n }), Object.isFrozen || (Object.isFrozen = function() {\n return !1\n }), Object.isExtensible || (Object.isExtensible = function(object) {\n if (Object(object) === object) throw new TypeError;\n for (var name = ""; owns(object, name);) name += "?";\n object[name] = !0;\n var returnValue = owns(object, name);\n return delete object[name], returnValue\n }), !Object.keys) {\n var hasDontEnumBug = !0,\n dontEnums = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"],\n dontEnumsLength = dontEnums.length;\n for (var key in {\n toString: null\n }) hasDontEnumBug = !1;\n Object.keys = function(object) {\n if ("object" != typeof object && "function" != typeof object || null === object) throw new TypeError("Object.keys called on a non-object");\n var keys = [];\n for (var name in object) owns(object, name) && keys.push(name);\n if (hasDontEnumBug)\n for (var i = 0, ii = dontEnumsLength; ii > i; i++) {\n var dontEnum = dontEnums[i];\n owns(object, dontEnum) && keys.push(dontEnum)\n }\n return keys\n }\n }\n Date.now || (Date.now = function() {\n return (new Date).getTime()\n });\n var ws = "\t\\n\v\\f\\r   ᠎              \\u2028\\u2029\ufeff";\n if (!String.prototype.trim || ws.trim()) {\n ws = "[" + ws + "]";\n var trimBeginRegexp = RegExp("^" + ws + ws + "*"),\n trimEndRegexp = RegExp(ws + ws + "*$");\n String.prototype.trim = function() {\n return (this + "").replace(trimBeginRegexp, "").replace(trimEndRegexp, "")\n }\n }\n var toObject = function(o) {\n if (null == o) throw new TypeError("can\'t convert " + o + " to object");\n return Object(o)\n }\n});\n'},{WorkerClient:Ee}=he.a.acequire("ace/worker/worker_client"),Re=he.a.acequire("ace/lib/oop"),{Mode:Te}=he.a.acequire("ace/mode/json"),{Tokenizer:Se}=he.a.acequire("ace/tokenizer"),{MatchingBraceOutdent:Pe}=he.a.acequire("ace/mode/matching_brace_outdent"),{CstyleBehaviour:Le}=he.a.acequire("ace/mode/behaviour/cstyle"),{FoldMode:Ae}=he.a.acequire("ace/mode/folding/cstyle"),Ne=function(){const e=new Oe;e.normalizeRules(),this.$tokenizer=new Se(e.getRules()),this.$outdent=new Pe,this.$behaviour=new Le,this.foldingRules=new Ae};Re.inherits(Ne,Te),Ne.prototype.createWorker=function(e){const t=new Ee(["ace"],ke,"JsonWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",(function(t){e.setAnnotations(t.data)})),t.on("terminate",(function(){e.clearAnnotations()})),t};const{useUIAceKeyboardMode:Ce}=s.ace,De="SearchProfilerTextArea",Me=Object(r.memo)((({licenseEnabled:e,initialValue:t,onEditorReady:n})=>{const i=Object(r.useRef)(null),s=Object(r.useRef)(null),[a,l]=Object(r.useState)(null);return Ce(a),Object(r.useEffect)((()=>{const r=i.current;s.current=function({el:e,licenseEnabled:t}){const n=he.a.acequire("ace/ace").edit(e);if(function(e){e.getSession().setMode(new Ne)}(n),n.$blockScrolling=1/0,!t){n.setReadOnly(!0),n.container.style.pointerEvents="none",n.container.style.opacity="0.5";const e=n.container.querySelector("textarea");e&&e.setAttribute("tabindex","-1"),n.renderer.setStyle("disabled"),n.blur()}return n}({el:r,licenseEnabled:e}),s.current.setValue(t,1);const o=r.querySelector("textarea");var a;return o&&o.setAttribute("id",De),l(e?i.current.querySelector("textarea"):null),n((a=s.current,{getValue:()=>a.getValue(),focus(){a.focus()}})),()=>{s.current&&s.current.destroy()}}),[t,n,e]),Object(p.jsx)(o.a.Fragment,null,Object(p.jsx)(d.EuiScreenReaderOnly,null,Object(p.jsx)("label",{htmlFor:De},u.i18n.translate("xpack.searchProfiler.editorElementLabel",{defaultMessage:"Dev Tools Search Profiler editor"}))),Object(p.jsx)("div",{"data-test-subj":"searchProfilerEditor",ref:i}))})),Ie=Object(r.memo)((()=>{const e=Object(r.useRef)(null),t=Object(r.useRef)(null),n=de(),{getLicenseStatus:o,notifications:i,location:s}=ie(),a=new URLSearchParams(s.search),l=a.get("index"),c=a.get("load_from"),h=c&&Object(ne.decompressFromEncodedURIComponent)(c.replace(/^data:text\/plain,/,"")),f=(()=>{const{http:e,notifications:t,getLicenseStatus:n}=ie(),r=n().valid;return async({query:n,index:o})=>{if(!r)return{data:null};const{error:i,parsed:s}=function(e){const t=y(e);try{return{parsed:JSON.parse(t),error:null}}catch(e){return{error:e,parsed:null}}}(n);if(i)return t.addError(i,{title:u.i18n.translate("xpack.searchProfiler.errorToastTitle",{defaultMessage:"JSON parse error"})}),{data:null};if(s.profile&&s.profile.shards)return{data:s.profile.shards};const a={query:s};a.index=null==o||""===o?"_all":o;try{const n=await e.post("../api/searchprofiler/profile",{body:JSON.stringify(a),headers:{"Content-Type":"application/json"}});return n.ok?0===n.resp._shards.total?(t.addDanger({"data-test-subj":"noShardsNotification",title:u.i18n.translate("xpack.searchProfiler.errorNoShardsTitle",{defaultMessage:"Unable to profile"}),text:u.i18n.translate("xpack.searchProfiler.errorNoShardsDescription",{defaultMessage:"Verify your index input matches a valid index"})}),{data:null}):{data:n.resp.profile.shards}:{data:null,error:n.err.msg}}catch(e){const n=(e=>{var t,n,r,o;if(null!==(t=e.body)&&void 0!==t&&null!==(n=t.attributes)&&void 0!==n&&null!==(r=n.error)&&void 0!==r&&r.reason){const{reason:t,line:n,col:r}=e.body.attributes.error;if("number"==typeof n&&"number"==typeof r)return`${t} at line: ${n-1} col: ${r}`}if(null!==(o=e.body)&&void 0!==o&&o.message)return e.body.message})(e);return n?t.addError(e,{title:e.message,toastMessage:n}):t.addError(e,{title:u.i18n.translate("xpack.searchProfiler.errorSomethingWentWrongTitle",{defaultMessage:"Something went wrong"})}),{data:null}}}})(),m=Object(r.useCallback)((t=>e.current=t),[]),g=o().valid;return Object(p.jsx)(d.EuiFlexGroup,{responsive:!1,className:"prfDevTool__sense",gutterSize:"none",direction:"column"},Object(p.jsx)(d.EuiFlexItem,{grow:!1},Object(p.jsx)(d.EuiForm,null,Object(p.jsx)(d.EuiFlexGroup,{direction:"row",gutterSize:"s"},Object(p.jsx)(d.EuiFlexItem,null,Object(p.jsx)(d.EuiFormRow,{label:u.i18n.translate("xpack.searchProfiler.formIndexLabel",{defaultMessage:"Index"})},Object(p.jsx)(d.EuiFieldText,{"data-test-subj":"indexName",disabled:!g,inputRef:e=>{e&&(t.current=e,e.value=l||"_all")}})))))),Object(p.jsx)(d.EuiFlexItem,{grow:10},Object(p.jsx)(Me,{onEditorReady:m,licenseEnabled:g,initialValue:h||'{\n "query":{\n "match_all" : {}\n }\n}'})),Object(p.jsx)(d.EuiFlexItem,{grow:!1},Object(p.jsx)(d.EuiFlexGroup,{className:"prfDevTool__profileButtonContainer",gutterSize:"none",direction:"row"},Object(p.jsx)(d.EuiFlexItem,{grow:5},Object(p.jsx)(d.EuiSpacer,{size:"s"})),Object(p.jsx)(d.EuiFlexItem,{grow:5},Object(p.jsx)(d.EuiButton,{"data-test-subj":"profileButton",fill:!0,disabled:!g,onClick:()=>(async()=>{n({type:"setProfiling",value:!0});try{const{current:r}=e,{data:o,error:s}=await f({query:e.current.getValue(),index:t.current.value});if(s)return i.addDanger(s),void r.focus();if(null===o)return;n({type:"setCurrentResponse",value:o})}finally{n({type:"setProfiling",value:!1})}})()},Object(p.jsx)(d.EuiText,null,u.i18n.translate("xpack.searchProfiler.formProfileButtonLabel",{defaultMessage:"Profile"})))))))})),qe=()=>{const{getLicenseStatus:e,notifications:t}=ie(),{activeTab:n,currentResponse:i,highlightDetails:s,pristine:a,profiling:l}=(()=>{const e=Object(r.useContext)(le);if(null==e)throw new Error("useProfilerReadContext must be called inside ProfilerReadContext");return e})(),f=de(),g=Object(r.useCallback)((e=>f({type:"setActiveTab",value:e})),[f]),w=Object(r.useCallback)((e=>f({type:"setHighlightDetails",value:e})),[f]);return Object(p.jsx)(o.a.Fragment,null,Object(p.jsx)(d.EuiPage,{className:"prfDevTool__page appRoot"},Object(p.jsx)(d.EuiPageBody,{className:"prfDevTool__page__pageBody"},e().valid?null:Object(p.jsx)(o.a.Fragment,null,Object(p.jsx)(m,null),Object(p.jsx)(d.EuiSpacer,{size:"s"})),Object(p.jsx)(d.EuiPageContent_Deprecated,{className:"prfDevTool__page__pageBodyContent"},Object(p.jsx)(d.EuiPageContentBody_Deprecated,{className:"prfDevTool__page__pageBodyContentBody"},Object(p.jsx)(d.EuiFlexGroup,{responsive:!1,gutterSize:"s",direction:"row",className:"prfDevTool__page__bodyGroup"},Object(p.jsx)(d.EuiFlexItem,null,Object(p.jsx)(Ie,null)),Object(p.jsx)(d.EuiFlexItem,{grow:3},Object(p.jsx)(d.EuiFlexGroup,{className:"prfDevTool__main",gutterSize:"none",direction:"column"},Object(p.jsx)(h,{activeTab:n,activateTab:g,has:{aggregations:Boolean(i&&b(i)),searches:Boolean(i&&v(i))}}),l?Object(p.jsx)(ee,null):n?Object(p.jsx)(Y,{onDataInitError:e=>{t.addError(e,{title:u.i18n.translate("xpack.searchProfiler.profileTreeErrorRenderTitle",{defaultMessage:"Profile data cannot be parsed."})})},onHighlight:w,target:n,data:i}):e().valid&&a?Object(p.jsx)(te,null):null))),s?Object(p.jsx)(Q,c()({},s,{onClose:()=>f({type:"setHighlightDetails",value:null})})):null)))))},Fe=({el:e,http:t,I18nContext:n,notifications:r,initialLicenseStatus:o,theme$:s,location:l})=>(Object(i.render)(Object(p.jsx)(n,null,Object(p.jsx)(a.KibanaThemeProvider,{theme$:s},Object(p.jsx)(oe,{args:{initialLicenseStatus:o,notifications:r,http:t,location:l}},Object(p.jsx)(ue,null,Object(p.jsx)(qe,null))))),e),()=>Object(i.unmountComponentAtNode)(e))}}]);