D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
usr
/
share
/
grafana
/
public
/
lib
/
monaco
/
min
/
vs
/
language
/
kusto
/
Filename :
kustoMode.js
back
Copy
/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * monaco-kusto version: 7.7.0(4c0354ddfc7103811088dadcb6c4ed9e00f6a34e) * Released under the MIT license * https://https://github.com/Azure/monaco-kusto/blob/master/README.md *-----------------------------------------------------------------------------*/define("vs/language/kusto/kustoMode",["exports","vs/editor/editor.main","./main-f9e3c86a"],function(he,Ke,P){"use strict";function Re(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if(n!=="default"){var u=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,u.get?u:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var E=Re(Ke),qe=["onDidProvideCompletionItems"];function $(t){return $=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$(t)}function We(t,e){if(t==null)return{};var n,u,s=function(h,a){if(h==null)return{};var d,g,w={},y=Object.keys(h);for(g=0;g<y.length;g++)d=y[g],a.indexOf(d)>=0||(w[d]=h[d]);return w}(t,e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(u=0;u<c.length;u++)n=c[u],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}function pe(t,e){for(var n=0;n<e.length;n++){var u=e[n];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(t,ze(u.key),u)}}function ze(t){var e=function(n,u){if($(n)!=="object"||n===null)return n;var s=n[Symbol.toPrimitive];if(s!==void 0){var c=s.call(n,u||"default");if($(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(n)}(t,"string");return $(e)==="symbol"?e:String(e)}var Ge=function(){function t(s,c){var h=this;(function(a,d){if(!(a instanceof d))throw new TypeError("Cannot call a class as a function")})(this,t),this._monacoInstance=s,this._defaults=c,this._worker=null,this._idleCheckInterval=self.setInterval(function(){return h._checkIfIdle()},3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(function(){return h._saveStateAndStopWorker()})}var e,n,u;return e=t,n=[{key:"_stopWorker",value:function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}},{key:"_saveStateAndStopWorker",value:function(){var s=this;this._worker&&this._worker.getProxy().then(function(c){c.getSchema().then(function(h){s._storedState={schema:h},s._stopWorker()})})}},{key:"dispose",value:function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}},{key:"_checkIfIdle",value:function(){if(this._worker){var s=this._defaults.getWorkerMaxIdleTime(),c=Date.now()-this._lastUsedTime;s>0&&c>s&&this._saveStateAndStopWorker()}}},{key:"_getClient",value:function(){var s=this;this._lastUsedTime=Date.now();var c=this._defaults.languageSettings;c.onDidProvideCompletionItems;var h=We(c,qe);return this._client||(this._worker=this._monacoInstance.editor.createWebWorker({moduleId:"vs/language/kusto/kustoWorker",label:"kusto",createData:{languageSettings:h,languageId:"kusto"}}),this._client=this._worker.getProxy().then(function(a){return s._storedState?a.setSchema(s._storedState.schema).then(function(){return a}):a})),this._client}},{key:"getLanguageServiceWorker",value:function(){for(var s,c=this,h=arguments.length,a=new Array(h),d=0;d<h;d++)a[d]=arguments[d];return this._getClient().then(function(g){s=g}).then(function(g){return c._worker.withSyncedResources(a)}).then(function(g){return s})}}],n&&pe(e.prototype,n),u&&pe(e,u),Object.defineProperty(e,"prototype",{writable:!1}),t}(),me={name:"kusto",mimeTypes:["text/kusto"],displayName:"Kusto",defaultToken:"invalid",brackets:[["[","]","delimiter.square"],["(",")","delimiter.parenthesis"]],wordDefinition:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,promotedOperatorCommandTokens:["where","count","extend","join","limit","order","project","project-away","project-rename","project-reorder","project-keep","render","sort","summarize","distinct","take","top","top-nested","top-hitters","union","mv-expand","mv-apply","reduce","evaluate","parse","parse-where","parse-kv","sample","sample-distinct","make-series","getschema","serialize","invoke","as","scan"],operatorCommandTokens:["filter","fork","facet","range","consume","find","search","print","partition","lookup","where","count","extend","join","limit","order","project","project-away","project-rename","project-reorder","project-keep","render","sort","summarize","distinct","take","top","top-nested","top-hitters","union","mv-expand","mv-apply","reduce","evaluate","parse","parse-where","parse-kv","sample","sample-distinct","make-series","getschema","serialize","invoke","as","scan"],keywords:["by","on","contains","notcontains","containscs","notcontainscs","startswith","has","matches","regex","true","false","and","or","typeof","int","string","date","datetime","time","long","real","\u200Bboolean","bool"],operators:["+","-","*","/",">","<","==","<>","<=",">=","~","!~"],builtinFunctions:["countof","bin","extentid","extract","extractjson","floor","iif","isnull","isnotnull","notnull","isempty","isnotempty","notempty","now","re2","strcat","strlen","toupper","tostring","count","cnt","sum","min","max","avg"],tokenizer:{root:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@dqstrings"},{include:"@literals"},{include:"@comments"},[/[;,.]/,"delimiter"],[/[()\[\]]/,"@brackets"],[/[<>=!%&+\-*/|~^]/,"operator"],[/[\w@#\-$]+/,{cases:{"@keywords":"keyword","@promotedOperatorCommandTokens":"operator.sql","@operatorCommandTokens":"keyword","@operators":"operator","@builtinFunctions":"predefined","@default":"identifier"}}]],whitespace:[[/\s+/,"white"]],comments:[["\\/\\/+.*","comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/H'/,{token:"string.quote",bracket:"@open",next:"@string"}],[/h'/,{token:"string.quote",bracket:"@open",next:"@string"}],[/'/,{token:"string.quote",bracket:"@open",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],dqstrings:[[/H"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}],[/h"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}],[/"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}]],dqstring:[[/[^"]+/,"string"],[/""/,"string"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],literals:[[/datetime\(\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}(:\d{2}(\.\d{0,3})?)?)?\)/,"number"],[/time\((\d+(s(ec(onds?)?)?|m(in(utes?)?)?|h(ours?)?|d(ays?)?)|(\s*(('[^']+')|("[^"]+"))\s*))\)/,"number"],[/guid\([\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}\)/,"number"],[/typeof\((int|string|date|datetime|time|long|real|boolean|bool)\)/,"number"]]}};function te(t){return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(t)}function re(t){var e=te(t);return t!=null&&(e=="object"||e=="function")}function ne(t){return ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ne(t)}var Ue=(typeof global>"u"?"undefined":ne(global))=="object"&&global&&global.Object===Object&&global;function oe(t){return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oe(t)}var Be=(typeof self>"u"?"undefined":oe(self))=="object"&&self&&self.Object===Object&&self,ge=Ue||Be||Function("return this")(),ie=function(){return ge.Date.now()},He=/\s/,$e=/^\s+/;function Qe(t){return t&&t.slice(0,function(e){for(var n=e.length;n--&&He.test(e.charAt(n)););return n}(t)+1).replace($e,"")}var Z=ge.Symbol,ve=Object.prototype,Ye=ve.hasOwnProperty,Xe=ve.toString,Q=Z?Z.toStringTag:void 0,Je=Object.prototype.toString,Ze="[object Null]",et="[object Undefined]",ye=Z?Z.toStringTag:void 0;function tt(t){return t==null?t===void 0?et:Ze:ye&&ye in Object(t)?function(e){var n=Ye.call(e,Q),u=e[Q];try{e[Q]=void 0;var s=!0}catch{}var c=Xe.call(e);return s&&(n?e[Q]=u:delete e[Q]),c}(t):function(e){return Je.call(e)}(t)}function ae(t){return ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(t)}function ue(t){return ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ue(t)}var rt="[object Symbol]";function nt(t){return ue(t)=="symbol"||function(e){return e!=null&&ae(e)=="object"}(t)&&tt(t)==rt}var be=NaN,ot=/^[-+]0x[0-9a-f]+$/i,it=/^0b[01]+$/i,at=/^0o[0-7]+$/i,ut=parseInt;function we(t){if(typeof t=="number")return t;if(nt(t))return be;if(re(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=re(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Qe(t);var n=it.test(t);return n||at.test(t)?ut(t.slice(2),n?2:8):ot.test(t)?be:+t}var ct=Math.max,st=Math.min;function ke(t,e,n){var u,s,c,h,a,d,g=0,w=!1,y=!1,f=!0;if(typeof t!="function")throw new TypeError("Expected a function");function m(k){var L=u,I=s;return u=s=void 0,g=k,h=t.apply(I,L)}function v(k){var L=k-d;return d===void 0||L>=e||L<0||y&&k-g>=c}function b(){var k=ie();if(v(k))return C(k);a=setTimeout(b,function(L){var I=e-(L-d);return y?st(I,c-(L-g)):I}(k))}function C(k){return a=void 0,f&&u?m(k):(u=s=void 0,h)}function S(){var k=ie(),L=v(k);if(u=arguments,s=this,d=k,L){if(a===void 0)return function(I){return g=I,a=setTimeout(b,e),w?m(I):h}(d);if(y)return clearTimeout(a),a=setTimeout(b,e),m(d)}return a===void 0&&(a=setTimeout(b,e)),h}return e=we(e)||0,re(n)&&(w=!!n.leading,c=(y="maxWait"in n)?ct(we(n.maxWait)||0,e):c,f="trailing"in n?!!n.trailing:f),S.cancel=function(){a!==void 0&&clearTimeout(a),g=0,u=d=s=a=void 0},S.flush=function(){return a===void 0?h:C(ie())},S}function lt(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ce(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var u=0,s=function(){};return{s,n:function(){return u>=t.length?{done:!0}:{done:!1,value:t[u++]}},e:function(d){throw d},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,h=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var d=n.next();return h=d.done,d},e:function(d){a=!0,c=d},f:function(){try{h||n.return==null||n.return()}finally{if(a)throw c}}}}function ft(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,u){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var c,h,a,d,g=[],w=!0,y=!1;try{if(a=(s=s.call(n)).next,u===0){if(Object(s)!==s)return;w=!1}else for(;!(w=(c=a.call(s)).done)&&(g.push(c.value),g.length!==u);w=!0);}catch(f){y=!0,h=f}finally{try{if(!w&&s.return!=null&&(d=s.return(),Object(d)!==d))return}finally{if(y)throw h}}return g}}(t,e)||ce(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function dt(t){return function(e){if(Array.isArray(e))return se(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||ce(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ce(t,e){if(t){if(typeof t=="string")return se(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?se(t,e):void 0}}function se(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,u=new Array(e);n<e;n++)u[n]=t[n];return u}function G(t){return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G(t)}function U(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */U=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,u=Object.defineProperty||function(o,r,i){o[r]=i.value},s=typeof Symbol=="function"?Symbol:{},c=s.iterator||"@@iterator",h=s.asyncIterator||"@@asyncIterator",a=s.toStringTag||"@@toStringTag";function d(o,r,i){return Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}),o[r]}try{d({},"")}catch{d=function(r,i,p){return r[i]=p}}function g(o,r,i,p){var l=r&&r.prototype instanceof f?r:f,_=Object.create(l.prototype),x=new W(p||[]);return u(_,"_invoke",{value:T(o,i,x)}),_}function w(o,r,i){try{return{type:"normal",arg:o.call(r,i)}}catch(p){return{type:"throw",arg:p}}}t.wrap=g;var y={};function f(){}function m(){}function v(){}var b={};d(b,c,function(){return this});var C=Object.getPrototypeOf,S=C&&C(C(z([])));S&&S!==e&&n.call(S,c)&&(b=S);var k=v.prototype=f.prototype=Object.create(b);function L(o){["next","throw","return"].forEach(function(r){d(o,r,function(i){return this._invoke(r,i)})})}function I(o,r){function i(l,_,x,O){var j=w(o[l],o,_);if(j.type!=="throw"){var F=j.arg,V=F.value;return V&&G(V)=="object"&&n.call(V,"__await")?r.resolve(V.__await).then(function(D){i("next",D,x,O)},function(D){i("throw",D,x,O)}):r.resolve(V).then(function(D){F.value=D,x(F)},function(D){return i("throw",D,x,O)})}O(j.arg)}var p;u(this,"_invoke",{value:function(l,_){function x(){return new r(function(O,j){i(l,_,O,j)})}return p=p?p.then(x,x):x()}})}function T(o,r,i){var p="suspendedStart";return function(l,_){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(l==="throw")throw _;return J()}for(i.method=l,i.arg=_;;){var x=i.delegate;if(x){var O=A(x,i);if(O){if(O===y)continue;return O}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(p==="suspendedStart")throw p="completed",i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);p="executing";var j=w(o,r,i);if(j.type==="normal"){if(p=i.done?"completed":"suspendedYield",j.arg===y)continue;return{value:j.arg,done:i.done}}j.type==="throw"&&(p="completed",i.method="throw",i.arg=j.arg)}}}function A(o,r){var i=r.method,p=o.iterator[i];if(p===void 0)return r.delegate=null,i==="throw"&&o.iterator.return&&(r.method="return",r.arg=void 0,A(o,r),r.method==="throw")||i!=="return"&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=w(p,o.iterator,r.arg);if(l.type==="throw")return r.method="throw",r.arg=l.arg,r.delegate=null,y;var _=l.arg;return _?_.done?(r[o.resultName]=_.value,r.next=o.nextLoc,r.method!=="return"&&(r.method="next",r.arg=void 0),r.delegate=null,y):_:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function q(o){var r={tryLoc:o[0]};1 in o&&(r.catchLoc=o[1]),2 in o&&(r.finallyLoc=o[2],r.afterLoc=o[3]),this.tryEntries.push(r)}function N(o){var r=o.completion||{};r.type="normal",delete r.arg,o.completion=r}function W(o){this.tryEntries=[{tryLoc:"root"}],o.forEach(q,this),this.reset(!0)}function z(o){if(o){var r=o[c];if(r)return r.call(o);if(typeof o.next=="function")return o;if(!isNaN(o.length)){var i=-1,p=function l(){for(;++i<o.length;)if(n.call(o,i))return l.value=o[i],l.done=!1,l;return l.value=void 0,l.done=!0,l};return p.next=p}}return{next:J}}function J(){return{value:void 0,done:!0}}return m.prototype=v,u(k,"constructor",{value:v,configurable:!0}),u(v,"constructor",{value:m,configurable:!0}),m.displayName=d(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(o){var r=typeof o=="function"&&o.constructor;return!!r&&(r===m||(r.displayName||r.name)==="GeneratorFunction")},t.mark=function(o){return Object.setPrototypeOf?Object.setPrototypeOf(o,v):(o.__proto__=v,d(o,a,"GeneratorFunction")),o.prototype=Object.create(k),o},t.awrap=function(o){return{__await:o}},L(I.prototype),d(I.prototype,h,function(){return this}),t.AsyncIterator=I,t.async=function(o,r,i,p,l){l===void 0&&(l=Promise);var _=new I(g(o,r,i,p),l);return t.isGeneratorFunction(r)?_:_.next().then(function(x){return x.done?x.value:_.next()})},L(k),d(k,a,"Generator"),d(k,c,function(){return this}),d(k,"toString",function(){return"[object Generator]"}),t.keys=function(o){var r=Object(o),i=[];for(var p in r)i.push(p);return i.reverse(),function l(){for(;i.length;){var _=i.pop();if(_ in r)return l.value=_,l.done=!1,l}return l.done=!0,l}},t.values=z,W.prototype={constructor:W,reset:function(o){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!o)for(var r in this)r.charAt(0)==="t"&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var o=this.tryEntries[0].completion;if(o.type==="throw")throw o.arg;return this.rval},dispatchException:function(o){if(this.done)throw o;var r=this;function i(j,F){return _.type="throw",_.arg=o,r.next=j,F&&(r.method="next",r.arg=void 0),!!F}for(var p=this.tryEntries.length-1;p>=0;--p){var l=this.tryEntries[p],_=l.completion;if(l.tryLoc==="root")return i("end");if(l.tryLoc<=this.prev){var x=n.call(l,"catchLoc"),O=n.call(l,"finallyLoc");if(x&&O){if(this.prev<l.catchLoc)return i(l.catchLoc,!0);if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else if(x){if(this.prev<l.catchLoc)return i(l.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return i(l.finallyLoc)}}}},abrupt:function(o,r){for(var i=this.tryEntries.length-1;i>=0;--i){var p=this.tryEntries[i];if(p.tryLoc<=this.prev&&n.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var l=p;break}}l&&(o==="break"||o==="continue")&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var _=l?l.completion:{};return _.type=o,_.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(_)},complete:function(o,r){if(o.type==="throw")throw o.arg;return o.type==="break"||o.type==="continue"?this.next=o.arg:o.type==="return"?(this.rval=this.arg=o.arg,this.method="return",this.next="end"):o.type==="normal"&&r&&(this.next=r),y},finish:function(o){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.finallyLoc===o)return this.complete(i.completion,i.afterLoc),N(i),y}},catch:function(o){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc===o){var p=i.completion;if(p.type==="throw"){var l=p.arg;N(i)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(o,r,i){return this.delegate={iterator:z(o),resultName:r,nextLoc:i},this.method==="next"&&(this.arg=void 0),y}},t}function _e(t,e,n,u,s,c,h){try{var a=t[c](h),d=a.value}catch(g){return void n(g)}a.done?e(d):Promise.resolve(d).then(u,s)}function Se(t){return function(){var e=this,n=arguments;return new Promise(function(u,s){var c=t.apply(e,n);function h(d){_e(c,u,s,h,a,"next",d)}function a(d){_e(c,u,s,h,a,"throw",d)}h(void 0)})}}function K(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xe(t,e){for(var n=0;n<e.length;n++){var u=e[n];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(t,Le(u.key),u)}}function R(t,e,n){return e&&xe(t.prototype,e),n&&xe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function M(t,e,n){return(e=Le(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Le(t){var e=function(n,u){if(G(n)!=="object"||n===null)return n;var s=n[Symbol.toPrimitive];if(s!==void 0){var c=s.call(n,u||"default");if(G(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(n)}(t,"string");return G(e)==="symbol"?e:String(e)}var ht=function(){function t(n,u,s,c,h){var a=this;K(this,t),M(this,"_disposables",[]),M(this,"_contentListener",Object.create(null)),M(this,"_configurationListener",Object.create(null)),M(this,"_schemaListener",Object.create(null)),M(this,"_cursorListener",Object.create(null)),M(this,"_debouncedValidations",Object.create(null)),this._monacoInstance=n,this._languageId=u,this._worker=s,this.defaults=c;var d,g=function(f){var m=f.getLanguageId(),v=f.uri.toString();if(m===a._languageId){var b=a.getOrCreateDebouncedValidation(f,m);a._contentListener[v]=f.onDidChangeContent(function(C){var S=Ce(C);b(S)}),a._configurationListener[v]=a.defaults.onDidChange(function(){self.setTimeout(function(){return a._doValidate(f,m,[])},0)}),a._schemaListener[v]=h(function(){self.setTimeout(function(){return a._doValidate(f,m,[])},0)})}},w=function(f){var m=f.getId();a._cursorListener[m]||(f.onDidDispose(function(){var v;(v=a._cursorListener[m])===null||v===void 0||v.dispose(),delete a._cursorListener[m]}),a._cursorListener[m]=f.onDidChangeCursorSelection(function(v){var b=f.getModel(),C=b.getLanguageId();if(C===a._languageId){var S=b.getOffsetAt(v.selection.getPosition());a.getOrCreateDebouncedValidation(b,C)([{start:S,end:S}])}}))},y=function(f){a._monacoInstance.editor.setModelMarkers(f,a._languageId,[]);var m=f.uri.toString(),v=a._contentListener[m];v&&(v.dispose(),delete a._contentListener[m]);var b=a._configurationListener[m];b&&(b.dispose(),delete a._configurationListener[m]);var C=a._schemaListener[m];C&&(C.dispose(),delete a._schemaListener[m]);var S=a._debouncedValidations[m];S&&(S.cancel(),delete a._debouncedValidations[m])};this.defaults.languageSettings.enableQuickFixes&&this._disposables.push(E.languages.registerCodeActionProvider(this._languageId,{provideCodeActions:(d=Se(U().mark(function f(m,v,b,C){var S,k,L,I;return U().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return S=m.getOffsetAt(v.getStartPosition()),k=m.getOffsetAt(v.getEndPosition()),L=b.markers.length>0,T.next=5,a.getMonacoCodeActions(m,S,k,L);case 5:return I=T.sent,T.abrupt("return",{actions:I,dispose:function(){}});case 7:case"end":return T.stop()}},f)})),function(f,m,v,b){return d.apply(this,arguments)})})),this._disposables.push(this._monacoInstance.editor.onDidCreateEditor(w)),this._disposables.push(this._monacoInstance.editor.onDidCreateModel(g)),this._disposables.push(this._monacoInstance.editor.onWillDisposeModel(y)),this._disposables.push(this._monacoInstance.editor.onDidChangeModelLanguage(function(f){y(f.model),g(f.model)})),this._disposables.push({dispose:function(){for(var f in a._contentListener)a._contentListener[f].dispose();for(var m in a._cursorListener)a._cursorListener[m].dispose();for(var v in a._debouncedValidations)a._debouncedValidations[v].cancel()}}),this._monacoInstance.editor.getModels().forEach(g),this._monacoInstance.editor.getEditors().forEach(w)}var e;return R(t,[{key:"getMonacoCodeActions",value:(e=Se(U().mark(function n(u,s,c,h){var a,d,g,w,y,f,m,v=this;return U().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return a=[],b.next=3,this._worker(u.uri);case 3:return d=b.sent,g=u.uri,b.next=7,d.getResultActions(g.toString(),s,c);case 7:w=b.sent,y=U().mark(function C(){var S,k,L,I,T;return U().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(!(k=w[f]).kind.includes("Extract Function")){A.next=3;break}return A.abrupt("return","continue");case 3:if((L=(S=v.defaults.languageSettings.quickFixCodeActions)!==null&&S!==void 0&&S.find(function(q){return k.kind.includes(q)})?"quickfix":"custom")!="quickfix"||h){A.next=6;break}return A.abrupt("return",{v:void 0});case 6:I=k.changes,T=I.map(function(q){var N,W=u.getPositionAt(q.start),z=u.getPositionAt(q.start+q.deleteLength);return{resource:u.uri,textEdit:{range:{startLineNumber:W.lineNumber,startColumn:W.column,endLineNumber:z.lineNumber,endColumn:z.column},text:(N=q.insertText)!==null&&N!==void 0?N:""}}}),a.push({title:k.title,diagnostics:[],kind:L,edit:{edits:dt(T)}});case 9:case"end":return A.stop()}},C)}),f=0;case 10:if(!(f<w.length)){b.next=20;break}return b.delegateYield(y(),"t0",12);case 12:if((m=b.t0)!=="continue"){b.next=15;break}return b.abrupt("continue",17);case 15:if(G(m)!=="object"){b.next=17;break}return b.abrupt("return",m.v);case 17:f++,b.next=10;break;case 20:return b.abrupt("return",a);case 21:case"end":return b.stop()}},n,this)})),function(n,u,s,c){return e.apply(this,arguments)})},{key:"getOrCreateDebouncedValidation",value:function(n,u){var s=this,c=n.uri.toString();return this._debouncedValidations[c]||(this._debouncedValidations[c]=ke(function(h){return s._doValidate(n,u,h)},500)),this._debouncedValidations[c]}},{key:"dispose",value:function(){this._disposables.forEach(function(n){return n&&n.dispose()}),this._disposables=[]}},{key:"_doValidate",value:function(n,u,s){var c=this;if(!n.isDisposed()){var h=n.uri,a=n.getVersionId();this._worker(h).then(function(d){return d.doValidation(h.toString(),s)}).then(function(d){if(c._monacoInstance.editor.getModel(h).getVersionId()===a){var g=d.map(function(k){return I=typeof(L=k).code=="number"?String(L.code):L.code,{severity:pt(L.severity),startLineNumber:L.range.start.line+1,startColumn:L.range.start.character+1,endLineNumber:L.range.end.line+1,endColumn:L.range.end.character+1,message:L.message,code:I,source:L.source};var L,I}),w=c._monacoInstance.editor.getModel(h),y=w.getAllDecorations().filter(function(k){return k.options.className=="squiggly-error"}).map(function(k){return k.id});if(w&&w.getLanguageId()===u){var f=c.defaults.languageSettings.syntaxErrorAsMarkDown;if(f&&f.enableSyntaxErrorAsMarkDown){var m=f.header?"**".concat(f.header,`** `):"",v=f.icon?""):"",b="".concat(v," ").concat(m),C=g.map(function(k){return{range:{startLineNumber:k.startLineNumber,startColumn:k.startColumn,endLineNumber:k.endLineNumber,endColumn:k.endColumn},options:{hoverMessage:{value:b+k.message},className:"squiggly-error",zIndex:100,overviewRuler:{color:"rgb(255, 18, 18, 0.7)",position:E.editor.OverviewRulerLane.Right},minimap:{color:"rgb(255, 18, 18, 0.7)",position:E.editor.MinimapPosition.Inline}}}}),S=E.editor.getModelMarkers({owner:u,resource:h});S&&S.length>0&&(y=[],c._monacoInstance.editor.setModelMarkers(w,u,[])),w.deltaDecorations(y,C)}else w.deltaDecorations(y,[]),c._monacoInstance.editor.setModelMarkers(w,u,g)}}}).then(void 0,function(d){console.error(d)})}}}]),t}();function Ce(t){return t.changes.map(function(e){return{start:e.rangeOffset,end:e.rangeOffset+e.text.length}})}function pt(t){switch(t){case P.DiagnosticSeverity.Error:return E.MarkerSeverity.Error;case P.DiagnosticSeverity.Warning:return E.MarkerSeverity.Warning;case P.DiagnosticSeverity.Information:return E.MarkerSeverity.Info;case P.DiagnosticSeverity.Hint:return E.MarkerSeverity.Hint;default:return E.MarkerSeverity.Info}}for(var Ie={PlainText:0,Comment:1,Punctuation:2,Directive:3,Literal:4,StringLiteral:5,Type:6,Column:7,Table:8,Database:9,Function:10,Parameter:11,Variable:12,Identifier:13,ClientParameter:14,QueryParameter:15,ScalarOperator:16,MathOperator:17,QueryOperator:18,Command:19,Keyword:20,MaterializedView:21,SchemaMember:22,SignatureParameter:23,Option:24},Oe={},le=0,je=Object.entries(Ie);le<je.length;le++){var Pe=ft(je[le],2),mt=Pe[0],gt=Pe[1];Oe[gt]=mt}var Ee={Column:"C71585",Comment:"008000",Database:"C71585",Function:"0000FF",Identifier:"000000",Keyword:"0000FF",Literal:"B22222",ScalarOperator:"0000FF",MaterializedView:"C71585",MathOperator:"000000",Command:"0000FF",Parameter:"2B91AF",PlainText:"000000",Punctuation:"000000",QueryOperator:"CC3700",QueryParameter:"CC3700",StringLiteral:"B22222",Table:"C71585",Type:"0000FF",Variable:"191970",Directive:"9400D3",ClientParameter:"b5cea8",SchemaMember:"C71585",SignatureParameter:"2B91AF",Option:"000000"},vt={Column:"4ec9b0",Comment:"6A9B34",Database:"c586c0",Function:"dcdcaa",Identifier:"d4d4d4",Keyword:"569cd6",Literal:"ce9178",ScalarOperator:"569cd6",MaterializedView:"c586c0",MathOperator:"d4d4d4",Command:"d4d4d4",Parameter:"2B91AF",PlainText:"d4d4d4",Punctuation:"d4d4d4",QueryOperator:"9cdcfe",QueryParameter:"9cdcfe",StringLiteral:"ce9178",Table:"c586c0",Type:"569cd6",Variable:"d7ba7d",Directive:"b5cea8",ClientParameter:"b5cea8",SchemaMember:"4ec9b0",SignatureParameter:"2B91AF",Option:"d4d4d4"},yt=function(){function t(e,n,u,s,c){var h,a,d,g=this;K(this,t),M(this,"_disposables",[]),M(this,"_contentListener",Object.create(null)),M(this,"_configurationListener",Object.create(null)),M(this,"_schemaListener",Object.create(null)),M(this,"decorations",[]),this._monacoInstance=e,this._languageId=n,this._worker=u,h=document.getElementsByTagName("head")[0],(a=document.createElement("style")).type="text/css",a.media="screen",h.appendChild(a),a.innerHTML=(d=Object.keys(Ie).map(function(f){return{classification:f,colorLight:Ee[f],colorDark:vt[f]}}),d).map(function(f){return".vs .".concat(f.classification," {color: #").concat(f.colorLight,";} .vs-dark .").concat(f.classification," {color: #").concat(f.colorDark,";}")}).join(` `);var w=function(f){var m=f.getLanguageId();if(m===g._languageId){var v=ke(function(b){return g._doColorization(f,m,b)},500);g._contentListener[f.uri.toString()]=f.onDidChangeContent(function(b){var C=Ce(b);v(C)}),g._configurationListener[f.uri.toString()]=s.onDidChange(function(){self.setTimeout(function(){return g._doColorization(f,m,[])},0)}),g._schemaListener[f.uri.toString()]=c(function(){self.setTimeout(function(){return g._doColorization(f,m,[])},0)})}},y=function(f){f.deltaDecorations(g.decorations,[]);var m=f.uri.toString(),v=g._contentListener[m];v&&(v.dispose(),delete g._contentListener[m]);var b=g._configurationListener[m];b&&(b.dispose(),delete g._configurationListener[m]);var C=g._configurationListener[m];C&&(C.dispose(),delete g._schemaListener[m])};this._disposables.push(this._monacoInstance.editor.onDidCreateModel(w)),this._disposables.push(this._monacoInstance.editor.onWillDisposeModel(y)),this._disposables.push(this._monacoInstance.editor.onDidChangeModelLanguage(function(f){y(f.model),w(f.model)})),this._disposables.push({dispose:function(){for(var f in g._contentListener)g._contentListener[f].dispose()}}),this._monacoInstance.editor.getModels().forEach(w)}return R(t,[{key:"dispose",value:function(){this._disposables.forEach(function(e){return e&&e.dispose()}),this._disposables=[]}},{key:"_rangeDoesNotIntersectAny",value:function(e,n){return n.every(function(u){return e.startLineNumber>u.lastImpactedLine||e.endLineNumber<u.firstImpactedLine})}},{key:"_doColorization",value:function(e,n,u){var s=this;if(!e.isDisposed()){var c=e.uri,h=e.getVersionId();this._worker(c).then(function(a){return a.doColorization(c.toString(),u)}).then(function(a){if(s._monacoInstance.editor.getModel(e.uri).getVersionId()===h){var d=a.map(function(y){var f=y.classifications.map(function(b){return function(C,S){var k=C.getPositionAt(S.start),L=C.getPositionAt(S.start+S.length),I=new E.Range(k.lineNumber,k.column,L.lineNumber,L.column),T=Oe[S.kind];return{range:I,options:{inlineClassName:T,stickiness:E.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}}(e,b)}).filter(function(b){return b.options.inlineClassName!=="PlainText"&&b.options.inlineClassName!="Identifier"}),m=e.getPositionAt(y.absoluteStart).lineNumber,v=e.getPositionAt(y.absoluteEnd);return{decorations:f,firstImpactedLine:m,lastImpactedLine:v.column==1&&v.lineNumber>1?v.lineNumber-1:v.lineNumber}}),g=d.map(function(y){return e.getLinesDecorations(y.firstImpactedLine,y.lastImpactedLine).filter(function(f){return Ee[f.options.inlineClassName]}).map(function(f){return f.id})}).reduce(function(y,f){return y.concat(f)},[]),w=d.reduce(function(y,f){return y.concat(f.decorations)},[]);e&&e.getLanguageId()===n&&(s.decorations=e.deltaDecorations(g,w))}}).then(void 0,function(a){console.error(a)})}}}]),t}();function B(t){if(t)return{character:t.column-1,line:t.lineNumber-1}}function Y(t){if(t)return new E.Range(t.start.line+1,t.start.character+1,t.end.line+1,t.end.character+1)}function bt(t){var e=E.languages.CompletionItemKind;switch(t){case P.CompletionItemKind.Text:return e.Text;case P.CompletionItemKind.Method:return e.Method;case P.CompletionItemKind.Function:return e.Function;case P.CompletionItemKind.Constructor:return e.Constructor;case P.CompletionItemKind.Field:return e.Field;case P.CompletionItemKind.Variable:return e.Variable;case P.CompletionItemKind.Class:return e.Class;case P.CompletionItemKind.Interface:return e.Interface;case P.CompletionItemKind.Module:return e.Module;case P.CompletionItemKind.Property:return e.Property;case P.CompletionItemKind.Unit:return e.Unit;case P.CompletionItemKind.Value:return e.Value;case P.CompletionItemKind.Enum:return e.Enum;case P.CompletionItemKind.Keyword:return e.Keyword;case P.CompletionItemKind.Snippet:return e.Snippet;case P.CompletionItemKind.Color:return e.Color;case P.CompletionItemKind.File:return e.File;case P.CompletionItemKind.Reference:return e.Reference}return e.Property}function Te(t){if(t)return{range:Y(t.range),text:t.newText}}var wt=function(){function t(e,n){K(this,t),this._worker=e,this.languageSettings=n}return R(t,[{key:"triggerCharacters",get:function(){return[" "]}},{key:"provideCompletionItems",value:function(e,n,u,s){var c=this,h=e.getWordUntilPosition(n),a=new E.Range(n.lineNumber,h.startColumn,n.lineNumber,h.endColumn),d=e.uri,g=this.languageSettings.onDidProvideCompletionItems;return this._worker(d).then(function(w){return w.doComplete(d.toString(),B(n))}).then(function(w){return g?g(w):w}).then(function(w){if(w){var y=w.items.map(function(f){var m,v={label:f.label,insertText:f.insertText,sortText:f.sortText,filterText:f.filterText,documentation:c.formatDocLink((m=f.documentation)===null||m===void 0?void 0:m.value),detail:f.detail,range:a,kind:bt(f.kind)};return f.textEdit&&(v.range=Y(f.textEdit.range),v.insertText=f.textEdit.newText),f.insertTextFormat===P.InsertTextFormat.Snippet&&(v.insertTextRules=E.languages.CompletionItemInsertTextRule.InsertAsSnippet),v});return{isIncomplete:w.isIncomplete,suggestions:y}}})}},{key:"formatDocLink",value:function(e){if(e){var n=this.languageSettings,u=n.documentationBaseUrl,s=u===void 0?"https://learn.microsoft.com/azure/data-explorer/kusto/query":u,c=n.documentationSuffix;return{value:e,isTrusted:!0,uris:new Proxy({},{get:function(h,a,d){var g=a.toString().replace(".md","");g.startsWith("https")||(g="".concat(s,"/").concat(g));var w=E.Uri.parse(g);return c&&(w.toString=function(){return g+c}),w}})}}}}]),t}();function De(t){return typeof t=="string"?{value:t}:(e=t)&&G(e)==="object"&&typeof e.kind=="string"?t.kind==="plaintext"?{value:t.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:t.value}:{value:"```"+t.value+` `+t.value+"\n```\n"};var e}function kt(t){if(t)return Array.isArray(t)?t.map(De):[De(t)]}function Ae(t){return{uri:E.Uri.parse(t.uri),range:Y(t.range)}}var _t=function(){function t(e){K(this,t),this._worker=e}return R(t,[{key:"provideDefinition",value:function(e,n,u){var s=e.uri;return this._worker(s).then(function(c){return c.findDefinition(s.toString(),B(n))}).then(function(c){if(c&&c.length!=0)return[Ae(c[0])]})}}]),t}(),St=function(){function t(e){K(this,t),this._worker=e}return R(t,[{key:"provideReferences",value:function(e,n,u,s){var c=e.uri;return this._worker(c).then(function(h){return h.findReferences(c.toString(),B(n))}).then(function(h){if(h)return h.map(Ae)})}}]),t}(),xt=function(){function t(e){K(this,t),this._worker=e}return R(t,[{key:"provideRenameEdits",value:function(e,n,u,s){var c=e.uri;return this._worker(c).then(function(h){return h.doRename(c.toString(),B(n),u)}).then(function(h){return function(a){if(a&&a.changes){var d=[];for(var g in a.changes){var w,y=E.Uri.parse(g),f=lt(a.changes[g]);try{for(f.s();!(w=f.n()).done;){var m=w.value;d.push({resource:y,textEdit:{range:Y(m.range),text:m.newText},versionId:void 0})}}catch(v){f.e(v)}finally{f.f()}}return{edits:d}}}(h)})}}]),t}(),Lt=function(){function t(e){K(this,t),this._worker=e}return R(t,[{key:"provideDocumentFormattingEdits",value:function(e,n,u){var s=e.uri;return this._worker(s).then(function(c){return c.doDocumentFormat(s.toString()).then(function(h){return h.map(function(a){return Te(a)})})})}}]),t}(),Ct=function(){function t(e){K(this,t),this._worker=e}return R(t,[{key:"provideDocumentRangeFormattingEdits",value:function(e,n,u,s){var c=e.uri;return this._worker(c).then(function(h){return h.doRangeFormat(c.toString(),function(a){if(a)return{start:B(a.getStartPosition()),end:B(a.getEndPosition())}}(n)).then(function(a){return a.map(function(d){return Te(d)})})})}}]),t}(),It=function(){function t(e){K(this,t),this._worker=e}return R(t,[{key:"provideFoldingRanges",value:function(e,n,u){var s=e.uri;return this._worker(s).then(function(c){return c.doFolding(s.toString()).then(function(h){return h.map(function(a){return function(d){return{start:d.startLine+1,end:d.endLine+1,kind:E.languages.FoldingRangeKind.Region}}(a)})})})}}]),t}(),fe,Fe,Ot=function(){function t(e){K(this,t),this._worker=e}return R(t,[{key:"provideHover",value:function(e,n,u){var s=e.uri;return this._worker(s).then(function(c){return c.doHover(s.toString(),B(n))}).then(function(c){if(c)return{range:Y(c.range),contents:kt(c.contents)}})}}]),t}();function H(t){return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(t)}function Me(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);e&&(u=u.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,u)}return n}function ee(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Me(Object(n),!0).forEach(function(u){jt(t,u,n[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Me(Object(n)).forEach(function(u){Object.defineProperty(t,u,Object.getOwnPropertyDescriptor(n,u))})}return t}function jt(t,e,n){return(e=function(u){var s=function(c,h){if(H(c)!=="object"||c===null)return c;var a=c[Symbol.toPrimitive];if(a!==void 0){var d=a.call(c,h||"default");if(H(d)!=="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(c)}(u,"string");return H(s)==="symbol"?s:String(s)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pt(t){return function(e){if(Array.isArray(e))return de(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,n){if(e){if(typeof e=="string")return de(e,n);var u=Object.prototype.toString.call(e).slice(8,-1);if(u==="Object"&&e.constructor&&(u=e.constructor.name),u==="Map"||u==="Set")return Array.from(e);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return de(e,n)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function de(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,u=new Array(e);n<e;n++)u[n]=t[n];return u}function X(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */X=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,u=Object.defineProperty||function(o,r,i){o[r]=i.value},s=typeof Symbol=="function"?Symbol:{},c=s.iterator||"@@iterator",h=s.asyncIterator||"@@asyncIterator",a=s.toStringTag||"@@toStringTag";function d(o,r,i){return Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}),o[r]}try{d({},"")}catch{d=function(r,i,p){return r[i]=p}}function g(o,r,i,p){var l=r&&r.prototype instanceof f?r:f,_=Object.create(l.prototype),x=new W(p||[]);return u(_,"_invoke",{value:T(o,i,x)}),_}function w(o,r,i){try{return{type:"normal",arg:o.call(r,i)}}catch(p){return{type:"throw",arg:p}}}t.wrap=g;var y={};function f(){}function m(){}function v(){}var b={};d(b,c,function(){return this});var C=Object.getPrototypeOf,S=C&&C(C(z([])));S&&S!==e&&n.call(S,c)&&(b=S);var k=v.prototype=f.prototype=Object.create(b);function L(o){["next","throw","return"].forEach(function(r){d(o,r,function(i){return this._invoke(r,i)})})}function I(o,r){function i(l,_,x,O){var j=w(o[l],o,_);if(j.type!=="throw"){var F=j.arg,V=F.value;return V&&H(V)=="object"&&n.call(V,"__await")?r.resolve(V.__await).then(function(D){i("next",D,x,O)},function(D){i("throw",D,x,O)}):r.resolve(V).then(function(D){F.value=D,x(F)},function(D){return i("throw",D,x,O)})}O(j.arg)}var p;u(this,"_invoke",{value:function(l,_){function x(){return new r(function(O,j){i(l,_,O,j)})}return p=p?p.then(x,x):x()}})}function T(o,r,i){var p="suspendedStart";return function(l,_){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(l==="throw")throw _;return J()}for(i.method=l,i.arg=_;;){var x=i.delegate;if(x){var O=A(x,i);if(O){if(O===y)continue;return O}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(p==="suspendedStart")throw p="completed",i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);p="executing";var j=w(o,r,i);if(j.type==="normal"){if(p=i.done?"completed":"suspendedYield",j.arg===y)continue;return{value:j.arg,done:i.done}}j.type==="throw"&&(p="completed",i.method="throw",i.arg=j.arg)}}}function A(o,r){var i=r.method,p=o.iterator[i];if(p===void 0)return r.delegate=null,i==="throw"&&o.iterator.return&&(r.method="return",r.arg=void 0,A(o,r),r.method==="throw")||i!=="return"&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var l=w(p,o.iterator,r.arg);if(l.type==="throw")return r.method="throw",r.arg=l.arg,r.delegate=null,y;var _=l.arg;return _?_.done?(r[o.resultName]=_.value,r.next=o.nextLoc,r.method!=="return"&&(r.method="next",r.arg=void 0),r.delegate=null,y):_:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function q(o){var r={tryLoc:o[0]};1 in o&&(r.catchLoc=o[1]),2 in o&&(r.finallyLoc=o[2],r.afterLoc=o[3]),this.tryEntries.push(r)}function N(o){var r=o.completion||{};r.type="normal",delete r.arg,o.completion=r}function W(o){this.tryEntries=[{tryLoc:"root"}],o.forEach(q,this),this.reset(!0)}function z(o){if(o){var r=o[c];if(r)return r.call(o);if(typeof o.next=="function")return o;if(!isNaN(o.length)){var i=-1,p=function l(){for(;++i<o.length;)if(n.call(o,i))return l.value=o[i],l.done=!1,l;return l.value=void 0,l.done=!0,l};return p.next=p}}return{next:J}}function J(){return{value:void 0,done:!0}}return m.prototype=v,u(k,"constructor",{value:v,configurable:!0}),u(v,"constructor",{value:m,configurable:!0}),m.displayName=d(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(o){var r=typeof o=="function"&&o.constructor;return!!r&&(r===m||(r.displayName||r.name)==="GeneratorFunction")},t.mark=function(o){return Object.setPrototypeOf?Object.setPrototypeOf(o,v):(o.__proto__=v,d(o,a,"GeneratorFunction")),o.prototype=Object.create(k),o},t.awrap=function(o){return{__await:o}},L(I.prototype),d(I.prototype,h,function(){return this}),t.AsyncIterator=I,t.async=function(o,r,i,p,l){l===void 0&&(l=Promise);var _=new I(g(o,r,i,p),l);return t.isGeneratorFunction(r)?_:_.next().then(function(x){return x.done?x.value:_.next()})},L(k),d(k,a,"Generator"),d(k,c,function(){return this}),d(k,"toString",function(){return"[object Generator]"}),t.keys=function(o){var r=Object(o),i=[];for(var p in r)i.push(p);return i.reverse(),function l(){for(;i.length;){var _=i.pop();if(_ in r)return l.value=_,l.done=!1,l}return l.done=!0,l}},t.values=z,W.prototype={constructor:W,reset:function(o){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!o)for(var r in this)r.charAt(0)==="t"&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var o=this.tryEntries[0].completion;if(o.type==="throw")throw o.arg;return this.rval},dispatchException:function(o){if(this.done)throw o;var r=this;function i(j,F){return _.type="throw",_.arg=o,r.next=j,F&&(r.method="next",r.arg=void 0),!!F}for(var p=this.tryEntries.length-1;p>=0;--p){var l=this.tryEntries[p],_=l.completion;if(l.tryLoc==="root")return i("end");if(l.tryLoc<=this.prev){var x=n.call(l,"catchLoc"),O=n.call(l,"finallyLoc");if(x&&O){if(this.prev<l.catchLoc)return i(l.catchLoc,!0);if(this.prev<l.finallyLoc)return i(l.finallyLoc)}else if(x){if(this.prev<l.catchLoc)return i(l.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return i(l.finallyLoc)}}}},abrupt:function(o,r){for(var i=this.tryEntries.length-1;i>=0;--i){var p=this.tryEntries[i];if(p.tryLoc<=this.prev&&n.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var l=p;break}}l&&(o==="break"||o==="continue")&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var _=l?l.completion:{};return _.type=o,_.arg=r,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(_)},complete:function(o,r){if(o.type==="throw")throw o.arg;return o.type==="break"||o.type==="continue"?this.next=o.arg:o.type==="return"?(this.rval=this.arg=o.arg,this.method="return",this.next="end"):o.type==="normal"&&r&&(this.next=r),y},finish:function(o){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.finallyLoc===o)return this.complete(i.completion,i.afterLoc),N(i),y}},catch:function(o){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc===o){var p=i.completion;if(p.type==="throw"){var l=p.arg;N(i)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(o,r,i){return this.delegate={iterator:z(o),resultName:r,nextLoc:i},this.method==="next"&&(this.arg=void 0),y}},t}function Ne(t,e,n,u,s,c,h){try{var a=t[c](h),d=a.value}catch(g){return void n(g)}a.done?e(d):Promise.resolve(d).then(u,s)}function Ve(t){return function(){var e=this,n=arguments;return new Promise(function(u,s){var c=t.apply(e,n);function h(d){Ne(c,u,s,h,a,"next",d)}function a(d){Ne(c,u,s,h,a,"throw",d)}h(void 0)})}}var Et=new Promise(function(t,e){Fe=t});he.getKustoWorker=function(){return Et.then(function(){return fe})},he.setupMode=function(t,e){var n,u=new E.Emitter,s=[],c=new Ge(e,t);s.push(c);var h=function(d){for(var g=function(){var m=Ve(X().mark(function v(b,C){var S;return X().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return S=C.setSchema(b),k.next=3,S.then(function(){u.fire(b)});case 3:case"end":return k.stop()}},v)}));return function(v,b){return m.apply(this,arguments)}}(),w=arguments.length,y=new Array(w>1?w-1:0),f=1;f<w;f++)y[f-1]=arguments[f];return c.getLanguageServiceWorker.apply(c,Pt([d].concat(y))).then(function(m){return ee(ee({},m),{},{setSchema:function(v){return g(v,m)},setSchemaFromShowSchema:function(v,b,C,S,k){return Ve(X().mark(function L(){return X().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,m.normalizeSchema(v,b,C).then(function(T){(S||k)&&(T=ee(ee({},T),{},{globalScalarParameters:S,globalTabularParameters:k})),g(T,m)});case 2:case"end":return I.stop()}},L)}))()}})})},a="kusto";return s.push(e.languages.registerCompletionItemProvider(a,new wt(h,t.languageSettings))),t.languageSettings.useTokenColorization&&(n=e.languages.setMonarchTokensProvider(a,me)),t.onDidChange(function(d){d.languageSettings.useTokenColorization||n===void 0||(n.dispose(),n=void 0),d.languageSettings.useTokenColorization&&n==null&&(n=e.languages.setMonarchTokensProvider(a,me))}),s.push(new ht(e,a,h,t,u.event)),s.push(new yt(e,a,h,t,u.event)),s.push(e.languages.registerDocumentRangeFormattingEditProvider(a,new Ct(h))),s.push(e.languages.registerFoldingRangeProvider(a,new It(h))),s.push(e.languages.registerDefinitionProvider(a,new _t(h))),s.push(e.languages.registerRenameProvider(a,new xt(h))),s.push(e.languages.registerReferenceProvider(a,new St(h))),t.languageSettings.enableHover&&s.push(e.languages.registerHoverProvider(a,new Ot(h))),e.languages.registerDocumentFormattingEditProvider(a,new Lt(h)),fe=h,Fe(h),e.languages.setLanguageConfiguration(a,{folding:{offSide:!1,markers:{start:/^\s*[\r\n]/gm,end:/^\s*[\r\n]/gm}},comments:{lineComment:"//",blockComment:null}}),fe}}); //# sourceMappingURL=kustoMode.js.map