miniscript-languageserver 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -4
- package/package.json +2 -2
package/index.js
CHANGED
@@ -112,8 +112,8 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
|
|
112
112
|
buildDate: a date in yyyy-mm-dd format, like "2020-05-28"
|
113
113
|
host: a number for the host major and minor version, like 0.9
|
114
114
|
hostName: name of the host application, e.g. "Mini Micro"
|
115
|
-
hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var FA=m((y5,BM)=>{BM.exports={$meta:{description:"Create a `list` with square brackets. Then iterate over the `list` with for, or pull out individual items with a 0-based index in square brackets. A negative index counts from the end. Get a slice (subset) of a `list` with two indices, separated by a colon.",example:["x = [2, 4, 6, 8]","print(x[0]) // get first item from list","print(x[-1]) // get last item from list","print(x[1:3]) // slice items from index 1 to 3","x[2] = 5 // set item at index 2 to 5","print(x)","print(x + [42]) // concatenate two lists"]},remove:{description:"Removes an item from the `list` with the provided index. Due to the removal the `list` will get mutated.",example:["myList = [1, 42, 3]","myList.remove(1)",'print("This list does not contain the answer to everything: " + myList.split(", "))']},insert:{description:"Inserts a value into the `list` at the index provided. Due to the insertion the `list` will get mutated. Returns the mutated `list`.",example:["myList = [1, 3]","myList.insert(1, 42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},push:{description:"Appends a value to the end of the `list`. This operation will mutate the `list`. Additionally, this method will return the updated `list`.",example:["myList = [1, 3]","myList.push(42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},pop:{description:"Returns and removes the last item in the `list`. This operation will mutate the `list`.",example:["myList = [1, 3, 42]","answer = myList.pop",'print("Answer to everything: " + answer)']},pull:{description:"Returns and removes the first item in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},shuffle:{description:"Shuffles all values in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","myList.shuffle",'print("New list order: " + myList.split(", "))']},sum:{description:"Returns sum of all values inside the `list`. Any non-numeric values will be considered a zero.",example:["myList = [42, 1, 3]","sum = myList.sum",'print("Sum of all items in list: " + sum)']},hasIndex:{description:"Returns `true` if the provided index is available in the `list`. Otherwise, this method will return `false`.",example:["myList = [42, 1, 3]","containsIndex = myList.hasIndex(1)","if containsIndex then",' print("List contains index of 1.")',"else",' print("List does not contain index of 1.")',"end if"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `list` a `null` gets returned.",example:["myList = [42, 1, 3]","index = myList.indexOf(42)","if index != null then",' print("The answer for everything is at the following index: " + index)',"else",' print("No answer for everything found.")',"end if"]},sort:{description:"Sort `list` values alphanumerically. This operation will mutate the `list`. Optionally a key can be provided which which is used in case the items are maps. Additionally, this method will return the updated `list`.",example:['myList = [{ "key": 42 }, { "key": 2 }, { "key": 1 }]','myList.sort("key")',"print(myList)"]},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(myList.join(" .-*'*-. "))`]},indexes:{description:"Returns a `list` containing all available indexes.",example:["myList = [42, 1, 3]","for i in myList.indexes"," print(myList[i])","end for"]},len:{description:"Returns a `number` representing the count of values inside the `list`.",example:["myList = [42, 1, 3]",'print("myList contains " + myList.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:["myList = [42, 1, 3]","for v in myList.values"," print(v)","end for"]},replace:{description:"Returns updated `list` where each value matching with the provided replace argument gets replaced. This operation will mutate the `list`.",example:["myList = [1, 2, 2, 7]","myList.replace(2, 3)",'print(myList.join(""))']}}});var $A=m((b5,UM)=>{UM.exports={$meta:{description:"A `map` is a set of values associated with unique keys. Create a `map` with curly braces; get or set a single value with square brackets. Keys and values may be any type.",example:['x = { "test": 123 }',"x.foo = 42 // set property foo to 42","print(x.foo) // get value of property foo",'print(x + { "bar": 2 }) // concatenate two maps']},remove:{description:"Removes an item from the `map` with the provided key. Due to the removal the `map` will get mutated.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.remove("answer")',"print(myMap)"]},push:{description:"Adds the value 1 to the provided key. This operation will mutate the `map`. Additionally, this method will return the updated `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.push("answer")',"print(myMap.answer)"]},pull:{description:"Returns and removes the first item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pull)"]},pop:{description:"Returns and removes the last item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pop)"]},shuffle:{description:"Shuffles all values in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"myMap.shuffle","print(myMap)"]},sum:{description:"Returns sum of all values inside the `map`. Any non-numeric values will be considered a zero.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"sum = myMap.sum",'print("Sum of all items in map: " + sum)']},hasIndex:{description:"Returns `true` if the provided key is available in the `map`. Otherwise, this method will return `false`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','containsIndex = myList.hasIndex("answer")',"if containsIndex then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexOf:{description:"Returns `string` which indicates the key of the provided value inside the `map`. In case the value does not exist inside the `map` a `null` gets returned.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"key = myList.indexOf(42)","if key != null then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexes:{description:"Returns a `list` containing all available keys.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for key in myMap.indexes"," print(myMap[key])","end for"]},len:{description:"Returns a `number` representing the count of items inside the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','print("myMap contains " + myMap.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for value in myMap.values"," print(value)","end for"]},replace:{description:"Returns updated `map` where each value matching with the provided replace argument gets replaced. This operation will mutate the `map`.",example:['myObject = { "answer": 45 }',"myObject.replace(45, 42)","print(myObject.answer)"]}}});var BA=m((_5,HM)=>{HM.exports={$meta:{description:"All numbers are stored in full-precision format. Numbers also represent `true == 1` and `false == 0`.",example:["a = 20","b = 22","print(a + b) // addition","print(a - b) // substraction","print(a / b) // division","print(a * b) // multiply","print(a % b) // modulo","print(a - b) // substraction","print(a ^ b) // power","print(a and b) // logical and","print(a or b) // logical or","print(not a) // logical not","print(a == b) // comparison equal","print(a != b) // comparison unequal","print(a > b) // comparison greater than","print(a < b) // comparison lower than","print(a >= b) // comparison greater equal than","print(a <= b) // comparison lower equal than"]}}});var UA=m((v5,WM)=>{WM.exports={$meta:{description:"Text is stored in strings of Unicode characters. Write strings by surrounding them with quotes. If you need to include a quotation mark in the string, write it twice.",example:['a = "hello"','b = "world"',"print(a + b) // concatinate a and b","print(a * 10) // repeat hello ten times","print(a[0]) // prints h","print(a[1:3]) // prints ell"]},remove:{description:"Returns a new `string` where the provided `string` got removed.",example:['myString = "42 as an answer is wrong"','newString = myString.remove("wrong")','print(newString + "right")']},hasIndex:{description:"Returns `true` if the provided index is available in the `string`. Otherwise, this method will return `false`.",example:['myString = "42 as an answer is wrong"',"containsIndex = myString.hasIndex(1)","if containsIndex then",' print("String contains index of 1.")',"else",' print("String does not contain index of 1.")',"end if"]},insert:{description:"Returns a `string` with the newly inserted `string` at the provided index.",example:['myString = "42 as an answer is wrong"','index = myString.lastIndexOf("w") - 1','newString = myString.insert(index, "not ")',"print(newString)"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `string` a `null` gets returned.",example:['myString = "42 as an answer is wrong"','index = myString.indexOf("wrong")',"if index != null then",' print("Invalid information spotted at: " + index)',"else",' print("Information seems valid.")',"end if"]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = myString.split(" ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Returns a new `string` where the provided `string` got replaced by the second provided `string`.",example:['myString = "42 as an answer is wrong"','newString = myString.replace("wrong", "right")',"print(newString)"]},indexes:{description:"Returns a `list` where each item is a `number` representing all available indexes in the `string`.",example:['myString = "42"',"print(myString.indexes)"]},code:{description:"Returns a `number` representing the Unicode code of the first character of the `string`.",example:['myString = "HELLO WORLD"',"print(myString.code)"]},len:{description:"Returns a `number` representing the length of the `string`.",example:['myString = "HELLO WORLD"','print("Size of string is: " + myString.len)']},lower:{description:"Returns a new `string` in which all characters are transformed into lowercase.",example:['myString = "HELLO WORLD"',"print(myString.lower)"]},upper:{description:"Returns a new `string` in which all characters are transformed into uppercase.",example:['myString = "hello world"',"print(myString.upper)"]},val:{description:"Returns a `number` which is parsed from the `string`. In case the `string` is not numeric it will return a zero.",example:['myString = "1.25"',"print(myString.val + 40.75)"]},values:{description:"Returns a `list` where each item is a `string` representing all available characters in the `string`. Could be compared to using `split` but without any separator.",example:['myString = "hello world"',"print(myString.values)"]}}});var HA=m(Ba=>{"use strict";var co=Ba&&Ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ba,"__esModule",{value:!0});var GM=co(qA()),VM=co(jA()),zM=co(FA()),KM=co($A()),XM=co(BA()),YM=co(UA()),JM={any:GM.default,general:VM.default,list:zM.default,map:KM.default,string:YM.default,number:XM.default};Ba.default=JM});var WA=m((T5,QM)=>{QM.exports={type:"any",definitions:{insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any"]},hasIndex:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},remove:{type:"function",arguments:[{label:"value",type:"any"}],returns:["null"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["map","list","null"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]}}}});var GA=m((w5,ZM)=>{ZM.exports={type:"general",definitions:{hasIndex:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"index",type:"any"}],returns:["number","null"]},print:{type:"function",arguments:[{label:"value",type:"any",default:{type:"string",value:""}},{label:"delimiter",type:"string",opt:!0}],returns:["null"]},indexes:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list","null"]},values:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list"]},indexOf:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"value",type:"any"},{label:"after",type:"any",opt:!0}],returns:["any","null"]},len:{type:"function",arguments:[{label:"self",types:["list","string","map"]}],returns:["number","null"]},shuffle:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["null"]},val:{type:"function",arguments:[{label:"self",type:"any"}],returns:["number","null"]},lower:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},upper:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},sum:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["number"]},pop:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},pull:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},push:{type:"function",arguments:[{label:"self",types:["list","map"]},{label:"value",type:"any"}],returns:["map","list","null"]},sort:{type:"function",arguments:[{label:"self",type:"list"},{label:"byKey",type:"any"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list","null"]},remove:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"key",type:"any"}],returns:["list","map","string"]},wait:{type:"function",arguments:[{label:"seconds",type:"number",default:{type:"number",value:1}}],returns:["null"]},abs:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},acos:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},asin:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},atan:{type:"function",arguments:[{label:"y",type:"number",default:{type:"number",value:0}},{label:"x",type:"number",default:{type:"number",value:1}}],returns:["number"]},tan:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},cos:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},code:{type:"function",arguments:[{label:"value",type:"string"}],returns:["number"]},char:{type:"function",arguments:[{label:"codePoint",type:"number",default:{type:"number",value:65}}],returns:["string"]},sin:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},floor:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},range:{type:"function",arguments:[{label:"start",type:"number",default:{type:"number",value:0}},{label:"end",type:"number",default:{type:"number",value:0}},{label:"inc",type:"number",opt:!0}],returns:[{type:"list",valueType:"number"}]},round:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}},{label:"decimalPlaces",type:"number",default:{type:"number",value:0}}],returns:["number"]},rnd:{type:"function",arguments:[{label:"seed",type:"number",opt:!0}],returns:["number"]},sign:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},sqrt:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},str:{type:"function",arguments:[{label:"value",type:"any"}],returns:["string"]},ceil:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},pi:{type:"function",returns:["number"]},slice:{type:"function",arguments:[{label:"seq",types:["list","string"]},{label:"from",type:"number",default:{type:"number",value:0}},{label:"to",type:"number",opt:!0}],returns:["list","string"]},hash:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},time:{type:"function",returns:["number"]},bitAnd:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitOr:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitXor:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},log:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}},{label:"base",type:"number",default:{type:"number",value:10}}],returns:["number"]},yield:{type:"function",returns:["null"]},insert:{type:"function",arguments:[{label:"self",types:["list","string"]},{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},join:{type:"function",arguments:[{label:"self",type:"list"},{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},split:{type:"function",arguments:[{label:"self",type:"string"},{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"oldval",type:"any"},{label:"newval",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list","map","string"]},funcRef:{type:"function",returns:[{type:"map",keyType:"string"}]},list:{type:"function",returns:[{type:"map",keyType:"string"}]},map:{type:"function",returns:[{type:"map",keyType:"string"}]},number:{type:"function",returns:[{type:"map",keyType:"string"}]},string:{type:"function",returns:[{type:"map",keyType:"string"}]},refEquals:{type:"function",arguments:[{label:"a",type:"any"},{label:"b",type:"any"}],returns:["number"]},stackTrace:{type:"function",returns:[{type:"list",valueType:"string"}]},version:{type:"function",returns:["version"]}}}});var VA=m((E5,eL)=>{eL.exports={type:"list",definitions:{remove:{type:"function",arguments:[{label:"index",type:"number"}],returns:["null"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["list"]},pop:{type:"function",returns:["any"]},pull:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},sort:{type:"function",arguments:[{label:"byKey",type:"string"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list"]},join:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list"]}}}});var zA=m((A5,tL)=>{tL.exports={type:"map",definitions:{remove:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},push:{type:"function",arguments:[{label:"key",type:"string"}],returns:["map"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any","null"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["map"]}}}});var KA=m((x5,nL)=>{nL.exports={type:"number",definitions:{}}});var XA=m((k5,rL)=>{rL.exports={type:"string",definitions:{remove:{type:"function",arguments:[{label:"toDelete",type:"string"}],returns:["string"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"string"}],returns:["string"]},indexOf:{type:"function",arguments:[{label:"value",type:"string"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},split:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"oldVal",type:"string"},{label:"newVal",type:"string"},{label:"maxCount",type:"number",opt:!0}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},code:{type:"function",returns:["number"]},len:{type:"function",returns:["number"]},lower:{type:"function",returns:["string"]},upper:{type:"function",returns:["string"]},val:{type:"function",returns:["number"]},values:{type:"function",returns:[{type:"list",valueType:"string"}]}}}});var YA=m((C5,iL)=>{iL.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var JA=m(fn=>{"use strict";var Ti=fn&&fn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fn,"__esModule",{value:!0});fn.miniscriptMeta=void 0;var sL=$n(),oL=Ti(HA()),aL=Ti(WA()),uL=Ti(GA()),cL=Ti(VA()),lL=Ti(zA()),dL=Ti(KA()),fL=Ti(XA()),pL=Ti(YA());fn.miniscriptMeta=new sL.Container;fn.miniscriptMeta.addTypeSignatureFromPayload(aL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(uL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(cL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(lL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(dL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(fL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(pL.default);fn.miniscriptMeta.addMetaFromPayload("en",oL.default)});var Ua=m(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.lookupBase=nr.lookupIdentifier=void 0;var Br=je(),hL=JA(),mL=$a(),gL=t=>{switch(t.type){case Br.ASTType.CallStatement:return(0,nr.lookupIdentifier)(t.expression);case Br.ASTType.CallExpression:return(0,nr.lookupIdentifier)(t.base);case Br.ASTType.Identifier:return t;case Br.ASTType.MemberExpression:return(0,nr.lookupIdentifier)(t.identifier);case Br.ASTType.IndexExpression:return(0,nr.lookupIdentifier)(t.index);default:return null}};nr.lookupIdentifier=gL;var yL=(t=null)=>{switch(t?.type){case Br.ASTType.MemberExpression:return t.base;case Br.ASTType.IndexExpression:return t.base;case Br.ASTType.CallExpression:return t.base;case Br.ASTType.SliceExpression:return t.base;default:return null}};nr.lookupBase=yL;nr.default=new mL.TypeManager({container:hL.miniscriptMeta})});var fo=m(Un=>{"use strict";var bL=Un&&Un.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),_L=Un&&Un.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZA=Un&&Un.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&bL(e,t,n);return _L(e,t),e};Object.defineProperty(Un,"__esModule",{value:!0});Un.LookupHelper=Un.buildTypeDocument=void 0;var vL=$n(),QA=je(),lo=$a(),SL=ZA(ky()),is=ZA(Ua());async function Oy(t,e,n=new Map){let r=t.uri;if(n.has(r))return n.get(r);let i=is.default.get(r);if(n.set(r,null),!i)return null;let s=[],o=await e.documentManager.get(t).getImports();await Promise.all(o.map(async u=>{let{document:c,textDocument:l}=u;if(!c)return;let d=await Oy(l,e,n);d!==null&&s.push(d)}));let a=i.merge(...s);return n.set(r,a),a}Un.buildTypeDocument=Oy;var Cy=class{constructor(e,n){this.document=e,this.context=n}findAllAssignmentsOfIdentifier(e,n){return is.default.get(this.document.uri).getScopeContext(n).aggregator.resolveAvailableAssignmentsWithQuery(e)}findAllAssignmentsOfItem(e,n){return is.default.get(this.document.uri).getScopeContext(n).aggregator.resolveAvailableAssignments(e)}findAllAvailableIdentifierInRoot(){return is.default.get(this.document.uri).getRootScopeContext().scope.getAllIdentifier()}findAllAvailableIdentifier(e){return is.default.get(this.document.uri).getScopeContext(e).scope.getAllIdentifier()}findAllAvailableIdentifierRelatedToPosition(e){let n=is.default.get(this.document.uri),r=new Map,i=n.getScopeContext(e.scope);i.scope.isSelfAvailable()&&r.set("self",{kind:lo.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:lo.CompletionItemKind.Constant,line:-1});let s=new Map;(0,lo.injectIdentifers)(s,i.scope);let o=Array.from(s.entries()).map(([a,u])=>({identifier:a,...u})).sort((a,u)=>a.line-u.line);for(let a=0;a<o.length;a++){let u=o[a];if(u.line>=e.end.line)break;r.set(u.identifier,{kind:u.kind,line:u.line})}i.scope.locals!==i.scope.globals&&(0,lo.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,lo.injectIdentifers)(r,i.scope.outer);for(let a of n.container.getAllIdentifier(vL.SignatureDefinitionBaseType.General))r.set(...a);return r}lookupAST(e){let n=this,i=this.context.documentManager.get(n.document).document.lines[e.line+1];if(!i)return null;for(let s=0;s<i.length;s++){let o=i[s],a=SL.findEx((c,l)=>{let d=c.start.line-1,p=c.start.character-1,y=c.end.line-1,v=c.end.character-1;return d>e.line?{exit:!0}:d<y?{valid:e.line>d&&e.line<y||e.line===d&&p<=e.character||e.line===y&&v>=e.character}:{valid:d<=e.line&&p<=e.character&&y>=e.line&&v>=e.character}},o),u=a.pop();if(u)return{closest:u,outer:a}}return null}async lookupBasePath(e){let n=await this.buildTypeMap();if(n===null)return null;let r=(0,is.lookupBase)(e);return r?n.resolveNamespace(r):null}async buildTypeMap(){return await Oy(this.document,this.context)}async lookupTypeInfo({closest:e,outer:n}){let r=await this.buildTypeMap();if(r===null)return null;let i=n.length>0?n[n.length-1]:void 0;return i?.type===QA.ASTType.MemberExpression&&e===i.identifier||i?.type===QA.ASTType.IndexExpression&&e===i.index&&(0,lo.isValidIdentifierLiteral)(e)?r.resolveType(i,!0):r.resolveType(e,!0)}lookupType(e){let n=this,r=n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};Un.LookupHelper=Cy});var ex=m(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.AVAILABLE_CONSTANTS=void 0;td.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var tx=m(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.AVAILABLE_KEYWORDS=void 0;var po=Fr(),zt=je();nd.AVAILABLE_KEYWORDS=[zt.Keyword.If,zt.Keyword.In,zt.Keyword.Or,zt.Keyword.And,zt.Keyword.Isa,zt.Keyword.For,zt.Keyword.New,zt.Keyword.Not,zt.Keyword.End,zt.Keyword.Then,zt.Keyword.Else,zt.Keyword.Break,zt.Keyword.While,zt.Keyword.Return,zt.Keyword.Function,zt.Keyword.Continue,po.GreybelKeyword.Envar,po.GreybelKeyword.Import,po.GreybelKeyword.Include,po.GreybelKeyword.Debugger,po.GreybelKeyword.Line,po.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var nx=m(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.AVAILABLE_OPERATORS=void 0;var Ha=ao(),Pt=je();rd.AVAILABLE_OPERATORS=[Pt.Operator.Plus,Pt.Operator.Asterik,Pt.Operator.Minus,Pt.Operator.Slash,Pt.Operator.Power,Pt.Operator.Modulo,Pt.Operator.LessThan,Pt.Operator.GreaterThan,Pt.Operator.LessThanOrEqual,Pt.Operator.GreaterThanOrEqual,Pt.Operator.NotEqual,Pt.Operator.Equal,Pt.Operator.AddShorthand,Pt.Operator.SubtractShorthand,Pt.Operator.MultiplyShorthand,Pt.Operator.DivideShorthand,Ha.Operator.BitwiseAnd,Ha.Operator.BitwiseOr,Ha.Operator.LeftShift,Ha.Operator.RightShift,Ha.Operator.UnsignedRightShift,Pt.Operator.Assign,Pt.Operator.Reference].map(t=>({label:t,kind:24}))});var sx=m(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.activate=Mt.getDefaultCompletionList=Mt.getPropertyCompletionList=Mt.transformToCompletionItems=void 0;var rx=je(),TL=Ay(),ix=fo(),wL=ex(),EL=tx(),AL=nx(),xL=t=>{let e=[];for(let[n,r]of t)e.push({label:n,kind:(0,TL.getCompletionItemKind)(r.kind)});return e};Mt.transformToCompletionItems=xL;var kL=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?[]:(0,Mt.transformToCompletionItems)(n.getAllIdentifier())};Mt.getPropertyCompletionList=kL;var CL=()=>[...EL.AVAILABLE_KEYWORDS,...AL.AVAILABLE_OPERATORS,...wL.AVAILABLE_CONSTANTS];Mt.getDefaultCompletionList=CL;function OL(t){t.connection.onCompletion(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri),r=await t.documentManager.getLatest(n),i=new ix.LookupHelper(r.textDocument,t),s=i.lookupAST(e.position),o=[],a=!1;if(s){let{closest:l}=s;l instanceof rx.ASTMemberExpression?(o.push(...await(0,Mt.getPropertyCompletionList)(i,l)),a=!0):l instanceof rx.ASTIndexExpression?(o.push(...await(0,Mt.getPropertyCompletionList)(i,l)),a=!0):o.push(...(0,Mt.getDefaultCompletionList)())}else o.push(...(0,Mt.getDefaultCompletionList)()),o.push(...(0,Mt.transformToCompletionItems)(i.findAllAvailableIdentifierInRoot()));if(!s||a)return o;let u=new Set([...o.map(l=>l.label)]),c=await r.getImports();for(let l of c){let{document:d}=l;if(!d)continue;let p=new ix.LookupHelper(l.textDocument,t);o.push(...(0,Mt.transformToCompletionItems)(p.findAllAvailableIdentifier(d)).filter(y=>!u.has(y.label)).map(y=>(u.add(y.label),y)))}return o.push(...(0,Mt.transformToCompletionItems)(i.findAllAvailableIdentifierRelatedToPosition(s.closest)).filter(l=>!u.has(l.label))),o}),t.connection.onCompletionResolve(e=>e)}Mt.activate=OL});var ax=m((N5,ox)=>{"use strict";ox.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Ry=m((q5,cx)=>{var Wa=ax(),ux={};for(let t of Object.keys(Wa))ux[Wa[t]]=t;var J={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};cx.exports=J;for(let t of Object.keys(J)){if(!("channels"in J[t]))throw new Error("missing channels property: "+t);if(!("labels"in J[t]))throw new Error("missing channel labels property: "+t);if(J[t].labels.length!==J[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=J[t];delete J[t].channels,delete J[t].labels,Object.defineProperty(J[t],"channels",{value:e}),Object.defineProperty(J[t],"labels",{value:n})}J.rgb.hsl=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=s-i,a,u;s===i?a=0:e===s?a=(n-r)/o:n===s?a=2+(r-e)/o:r===s&&(a=4+(e-n)/o),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+s)/2;return s===i?u=0:c<=.5?u=o/(s+i):u=o/(2-s-i),[a,u*100,c*100]};J.rgb.hsv=function(t){let e,n,r,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(o,a,u),l=c-Math.min(o,a,u),d=function(p){return(c-p)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=d(o),n=d(a),r=d(u),o===c?i=r-n:a===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,c*100]};J.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=J.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,s*100,r*100]};J.rgb.cmyk=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(1-e,1-n,1-r),s=(1-e-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,a=(1-r-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function RL(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}J.rgb.keyword=function(t){let e=ux[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(Wa)){let s=Wa[i],o=RL(t,s);o<n&&(n=o,r=i)}return r};J.keyword.rgb=function(t){return Wa[t]};J.rgb.xyz=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=e*.4124+n*.3576+r*.1805,s=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,s*100,o*100]};J.rgb.lab=function(t){let e=J.rgb.xyz(t),n=e[0],r=e[1],i=e[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,o=500*(n-r),a=200*(r-i);return[s,o,a]};J.hsl.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i,s,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;let a=2*r-i,u=[0,0,0];for(let c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(i-a)*6*s:2*s<1?o=i:3*s<2?o=a+(i-a)*(2/3-s)*6:o=a,u[c]=o*255;return u};J.hsl.hsv=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let o=(r+n)/2,a=r===0?2*i/(s+i):2*n/(r+n);return[e,a*100,o*100]};J.hsv.rgb=function(t){let e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*r*(1-n),a=255*r*(1-n*s),u=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,u,o];case 1:return[a,r,o];case 2:return[o,r,u];case 3:return[o,a,r];case 4:return[u,o,r];case 5:return[r,o,a]}};J.hsv.hsl=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),s,o;o=(2-n)*r;let a=(2-n)*i;return s=n*i,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};J.hwb.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let o=Math.floor(6*e),a=1-r;s=6*e-o,o&1&&(s=1-s);let u=n+s*(a-n),c,l,d;switch(o){default:case 6:case 0:c=a,l=u,d=n;break;case 1:c=u,l=a,d=n;break;case 2:c=n,l=a,d=u;break;case 3:c=n,l=u,d=a;break;case 4:c=u,l=n,d=a;break;case 5:c=a,l=n,d=u;break}return[c*255,l*255,d*255]};J.cmyk.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),a=1-Math.min(1,r*(1-i)+i);return[s*255,o*255,a*255]};J.xyz.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i,s,o;return i=e*3.2406+n*-1.5372+r*-.4986,s=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};J.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(e-n),o=200*(n-r);return[i,s,o]};J.lab.xyz=function(t){let e=t[0],n=t[1],r=t[2],i,s,o;s=(e+16)/116,i=n/500+s,o=s-r/200;let a=s**3,u=i**3,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};J.lab.lch=function(t){let e=t[0],n=t[1],r=t[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(n*n+r*r);return[e,o,i]};J.lch.lab=function(t){let e=t[0],n=t[1],i=t[2]/360*2*Math.PI,s=n*Math.cos(i),o=n*Math.sin(i);return[e,s,o]};J.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?J.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(o+=60),o};J.hsv.ansi16=function(t){return J.rgb.ansi16(J.hsv.rgb(t),t[2])};J.rgb.ansi256=function(t){let e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};J.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,s=(e>>2&1)*n*255;return[r,i,s]};J.ansi256.rgb=function(t){if(t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,n=Math.floor(t/36)/5*255,r=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[n,r,i]};J.rgb.hex=function(t){let n=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};J.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let n=e[0];e[0].length===3&&(n=n.split("").map(a=>a+a).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,o=r&255;return[i,s,o]};J.rgb.hcg=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),s=Math.min(Math.min(e,n),r),o=i-s,a,u;return o<1?a=s/(1-o):a=0,o<=0?u=0:i===e?u=(n-r)/o%6:i===n?u=2+(r-e)/o:u=4+(e-n)/o,u/=6,u%=1,[u*360,o*100,a*100]};J.hsl.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};J.hsv.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};J.hcg.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=e%1*6,o=s%1,a=1-o,u=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-n)*r,[(n*i[0]+u)*255,(n*i[1]+u)*255,(n*i[2]+u)*255]};J.hcg.hsv=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};J.hcg.hsl=function(t){let e=t[1]/100,r=t[2]/100*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};J.hcg.hwb=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};J.hwb.hcg=function(t){let e=t[1]/100,r=1-t[2]/100,i=r-e,s=0;return i<1&&(s=(r-i)/(1-i)),[t[0],i*100,s*100]};J.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};J.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};J.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};J.gray.hsl=function(t){return[0,0,t[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(t){return[0,100,t[0]]};J.gray.cmyk=function(t){return[0,0,0,t[0]]};J.gray.lab=function(t){return[t[0],0,0]};J.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r};J.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var dx=m((j5,lx)=>{var id=Ry();function DL(){let t={},e=Object.keys(id);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function IL(t){let e=DL(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(id[r]);for(let s=i.length,o=0;o<s;o++){let a=i[o],u=e[a];u.distance===-1&&(u.distance=e[r].distance+1,u.parent=r,n.unshift(a))}}return e}function PL(t,e){return function(n){return e(t(n))}}function ML(t,e){let n=[e[t].parent,t],r=id[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=PL(id[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}lx.exports=function(t){let e=IL(t),n={},r=Object.keys(e);for(let i=r.length,s=0;s<i;s++){let o=r[s];e[o].parent!==null&&(n[o]=ML(o,e))}return n}});var px=m((F5,fx)=>{var Dy=Ry(),LL=dx(),ho={},NL=Object.keys(Dy);function qL(t){let e=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function jL(t){let e=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=t(n);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}NL.forEach(t=>{ho[t]={},Object.defineProperty(ho[t],"channels",{value:Dy[t].channels}),Object.defineProperty(ho[t],"labels",{value:Dy[t].labels});let e=LL(t);Object.keys(e).forEach(r=>{let i=e[r];ho[t][r]=jL(i),ho[t][r].raw=qL(i)})});fx.exports=ho});var mx=m(mo=>{"use strict";var FL=mo&&mo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mo,"__esModule",{value:!0});mo.activate=void 0;var Iy=FL(px()),$L=je(),hx;(function(t){t.Black="black",t.Blue="blue",t.Green="green",t.Orange="orange",t.Purple="purple",t.Red="red",t.White="white",t.Yellow="yellow"})(hx||(hx={}));var Py={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},BL=()=>new RegExp(`(?:mark|color)=(${Object.keys(Py).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),UL=Object.prototype.hasOwnProperty;function HL(t){t.connection.onColorPresentation(e=>[{label:`#${Iy.default.rgb.hex(e.color.red*255,e.color.green*255,e.color.blue*255)}`}]),t.connection.onDocumentColor(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri),s=(await t.documentManager.getLatest(n)).document.literals.filter(u=>u.type===$L.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:d,lineIndex:p})=>{let y=u.index+c.indexOf("=")+1,v=y+l.length,x=d.line-1+p,I=y,P=v;return p===0&&(I+=d.character,P+=d.character),{start:{line:x,character:I},end:{line:x,character:P}}};for(let u=0;u<s.length;u++){let c=s[u];if(!c.start)continue;let l=c.start,d=c.value.toString().split(`
|
116
|
-
`);for(let p=0;p<d.length;p++){let y=d[p],v=BL(),x;for(;x=v.exec(y);){let[I,P]=x,w=a({match:x,markup:I,value:P,astPosition:l,lineIndex:p});if(P.startsWith("#")){let[E,_,j]=Iy.default.hex.rgb(P.slice(1));o.push({range:w,color:{red:E/255,green:_/255,blue:j/255,alpha:1}})}else if(UL.call(Py,P)){let[E,_,j]=Iy.default.hex.rgb(Py[P].slice(1));o.push({range:w,color:{red:E/255,green:_/255,blue:j/255,alpha:1}})}else o.push({range:w,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}mo.activate=HL});var bx=m(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.activate=void 0;var WL=je(),gx=fo(),yx=(t,e,n)=>{let r=t.findAllAssignmentsOfItem(e,n),i=[];for(let s of r){if(!s.start||!s.end)continue;let o={line:s.start.line-1,character:s.start.character-1},a={line:s.end.line-1,character:s.end.character-1},u={targetUri:t.document.uri,targetRange:{start:o,end:a},targetSelectionRange:{start:o,end:a}};i.push(u)}return i};function GL(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri)
|
115
|
+
hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var FA=m((y5,BM)=>{BM.exports={$meta:{description:"Create a `list` with square brackets. Then iterate over the `list` with for, or pull out individual items with a 0-based index in square brackets. A negative index counts from the end. Get a slice (subset) of a `list` with two indices, separated by a colon.",example:["x = [2, 4, 6, 8]","print(x[0]) // get first item from list","print(x[-1]) // get last item from list","print(x[1:3]) // slice items from index 1 to 3","x[2] = 5 // set item at index 2 to 5","print(x)","print(x + [42]) // concatenate two lists"]},remove:{description:"Removes an item from the `list` with the provided index. Due to the removal the `list` will get mutated.",example:["myList = [1, 42, 3]","myList.remove(1)",'print("This list does not contain the answer to everything: " + myList.split(", "))']},insert:{description:"Inserts a value into the `list` at the index provided. Due to the insertion the `list` will get mutated. Returns the mutated `list`.",example:["myList = [1, 3]","myList.insert(1, 42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},push:{description:"Appends a value to the end of the `list`. This operation will mutate the `list`. Additionally, this method will return the updated `list`.",example:["myList = [1, 3]","myList.push(42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},pop:{description:"Returns and removes the last item in the `list`. This operation will mutate the `list`.",example:["myList = [1, 3, 42]","answer = myList.pop",'print("Answer to everything: " + answer)']},pull:{description:"Returns and removes the first item in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},shuffle:{description:"Shuffles all values in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","myList.shuffle",'print("New list order: " + myList.split(", "))']},sum:{description:"Returns sum of all values inside the `list`. Any non-numeric values will be considered a zero.",example:["myList = [42, 1, 3]","sum = myList.sum",'print("Sum of all items in list: " + sum)']},hasIndex:{description:"Returns `true` if the provided index is available in the `list`. Otherwise, this method will return `false`.",example:["myList = [42, 1, 3]","containsIndex = myList.hasIndex(1)","if containsIndex then",' print("List contains index of 1.")',"else",' print("List does not contain index of 1.")',"end if"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `list` a `null` gets returned.",example:["myList = [42, 1, 3]","index = myList.indexOf(42)","if index != null then",' print("The answer for everything is at the following index: " + index)',"else",' print("No answer for everything found.")',"end if"]},sort:{description:"Sort `list` values alphanumerically. This operation will mutate the `list`. Optionally a key can be provided which which is used in case the items are maps. Additionally, this method will return the updated `list`.",example:['myList = [{ "key": 42 }, { "key": 2 }, { "key": 1 }]','myList.sort("key")',"print(myList)"]},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(myList.join(" .-*'*-. "))`]},indexes:{description:"Returns a `list` containing all available indexes.",example:["myList = [42, 1, 3]","for i in myList.indexes"," print(myList[i])","end for"]},len:{description:"Returns a `number` representing the count of values inside the `list`.",example:["myList = [42, 1, 3]",'print("myList contains " + myList.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:["myList = [42, 1, 3]","for v in myList.values"," print(v)","end for"]},replace:{description:"Returns updated `list` where each value matching with the provided replace argument gets replaced. This operation will mutate the `list`.",example:["myList = [1, 2, 2, 7]","myList.replace(2, 3)",'print(myList.join(""))']}}});var $A=m((b5,UM)=>{UM.exports={$meta:{description:"A `map` is a set of values associated with unique keys. Create a `map` with curly braces; get or set a single value with square brackets. Keys and values may be any type.",example:['x = { "test": 123 }',"x.foo = 42 // set property foo to 42","print(x.foo) // get value of property foo",'print(x + { "bar": 2 }) // concatenate two maps']},remove:{description:"Removes an item from the `map` with the provided key. Due to the removal the `map` will get mutated.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.remove("answer")',"print(myMap)"]},push:{description:"Adds the value 1 to the provided key. This operation will mutate the `map`. Additionally, this method will return the updated `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.push("answer")',"print(myMap.answer)"]},pull:{description:"Returns and removes the first item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pull)"]},pop:{description:"Returns and removes the last item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pop)"]},shuffle:{description:"Shuffles all values in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"myMap.shuffle","print(myMap)"]},sum:{description:"Returns sum of all values inside the `map`. Any non-numeric values will be considered a zero.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"sum = myMap.sum",'print("Sum of all items in map: " + sum)']},hasIndex:{description:"Returns `true` if the provided key is available in the `map`. Otherwise, this method will return `false`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','containsIndex = myList.hasIndex("answer")',"if containsIndex then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexOf:{description:"Returns `string` which indicates the key of the provided value inside the `map`. In case the value does not exist inside the `map` a `null` gets returned.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"key = myList.indexOf(42)","if key != null then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexes:{description:"Returns a `list` containing all available keys.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for key in myMap.indexes"," print(myMap[key])","end for"]},len:{description:"Returns a `number` representing the count of items inside the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','print("myMap contains " + myMap.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for value in myMap.values"," print(value)","end for"]},replace:{description:"Returns updated `map` where each value matching with the provided replace argument gets replaced. This operation will mutate the `map`.",example:['myObject = { "answer": 45 }',"myObject.replace(45, 42)","print(myObject.answer)"]}}});var BA=m((_5,HM)=>{HM.exports={$meta:{description:"All numbers are stored in full-precision format. Numbers also represent `true == 1` and `false == 0`.",example:["a = 20","b = 22","print(a + b) // addition","print(a - b) // substraction","print(a / b) // division","print(a * b) // multiply","print(a % b) // modulo","print(a - b) // substraction","print(a ^ b) // power","print(a and b) // logical and","print(a or b) // logical or","print(not a) // logical not","print(a == b) // comparison equal","print(a != b) // comparison unequal","print(a > b) // comparison greater than","print(a < b) // comparison lower than","print(a >= b) // comparison greater equal than","print(a <= b) // comparison lower equal than"]}}});var UA=m((v5,WM)=>{WM.exports={$meta:{description:"Text is stored in strings of Unicode characters. Write strings by surrounding them with quotes. If you need to include a quotation mark in the string, write it twice.",example:['a = "hello"','b = "world"',"print(a + b) // concatinate a and b","print(a * 10) // repeat hello ten times","print(a[0]) // prints h","print(a[1:3]) // prints ell"]},remove:{description:"Returns a new `string` where the provided `string` got removed.",example:['myString = "42 as an answer is wrong"','newString = myString.remove("wrong")','print(newString + "right")']},hasIndex:{description:"Returns `true` if the provided index is available in the `string`. Otherwise, this method will return `false`.",example:['myString = "42 as an answer is wrong"',"containsIndex = myString.hasIndex(1)","if containsIndex then",' print("String contains index of 1.")',"else",' print("String does not contain index of 1.")',"end if"]},insert:{description:"Returns a `string` with the newly inserted `string` at the provided index.",example:['myString = "42 as an answer is wrong"','index = myString.lastIndexOf("w") - 1','newString = myString.insert(index, "not ")',"print(newString)"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `string` a `null` gets returned.",example:['myString = "42 as an answer is wrong"','index = myString.indexOf("wrong")',"if index != null then",' print("Invalid information spotted at: " + index)',"else",' print("Information seems valid.")',"end if"]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = myString.split(" ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Returns a new `string` where the provided `string` got replaced by the second provided `string`.",example:['myString = "42 as an answer is wrong"','newString = myString.replace("wrong", "right")',"print(newString)"]},indexes:{description:"Returns a `list` where each item is a `number` representing all available indexes in the `string`.",example:['myString = "42"',"print(myString.indexes)"]},code:{description:"Returns a `number` representing the Unicode code of the first character of the `string`.",example:['myString = "HELLO WORLD"',"print(myString.code)"]},len:{description:"Returns a `number` representing the length of the `string`.",example:['myString = "HELLO WORLD"','print("Size of string is: " + myString.len)']},lower:{description:"Returns a new `string` in which all characters are transformed into lowercase.",example:['myString = "HELLO WORLD"',"print(myString.lower)"]},upper:{description:"Returns a new `string` in which all characters are transformed into uppercase.",example:['myString = "hello world"',"print(myString.upper)"]},val:{description:"Returns a `number` which is parsed from the `string`. In case the `string` is not numeric it will return a zero.",example:['myString = "1.25"',"print(myString.val + 40.75)"]},values:{description:"Returns a `list` where each item is a `string` representing all available characters in the `string`. Could be compared to using `split` but without any separator.",example:['myString = "hello world"',"print(myString.values)"]}}});var HA=m(Ba=>{"use strict";var co=Ba&&Ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ba,"__esModule",{value:!0});var GM=co(qA()),VM=co(jA()),zM=co(FA()),KM=co($A()),XM=co(BA()),YM=co(UA()),JM={any:GM.default,general:VM.default,list:zM.default,map:KM.default,string:YM.default,number:XM.default};Ba.default=JM});var WA=m((T5,QM)=>{QM.exports={type:"any",definitions:{insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any"]},hasIndex:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},remove:{type:"function",arguments:[{label:"value",type:"any"}],returns:["null"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["map","list","null"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]}}}});var GA=m((w5,ZM)=>{ZM.exports={type:"general",definitions:{hasIndex:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"index",type:"any"}],returns:["number","null"]},print:{type:"function",arguments:[{label:"value",type:"any",default:{type:"string",value:""}},{label:"delimiter",type:"string",opt:!0}],returns:["null"]},indexes:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list","null"]},values:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list"]},indexOf:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"value",type:"any"},{label:"after",type:"any",opt:!0}],returns:["any","null"]},len:{type:"function",arguments:[{label:"self",types:["list","string","map"]}],returns:["number","null"]},shuffle:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["null"]},val:{type:"function",arguments:[{label:"self",type:"any"}],returns:["number","null"]},lower:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},upper:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},sum:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["number"]},pop:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},pull:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},push:{type:"function",arguments:[{label:"self",types:["list","map"]},{label:"value",type:"any"}],returns:["map","list","null"]},sort:{type:"function",arguments:[{label:"self",type:"list"},{label:"byKey",type:"any"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list","null"]},remove:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"key",type:"any"}],returns:["list","map","string"]},wait:{type:"function",arguments:[{label:"seconds",type:"number",default:{type:"number",value:1}}],returns:["null"]},abs:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},acos:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},asin:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},atan:{type:"function",arguments:[{label:"y",type:"number",default:{type:"number",value:0}},{label:"x",type:"number",default:{type:"number",value:1}}],returns:["number"]},tan:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},cos:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},code:{type:"function",arguments:[{label:"value",type:"string"}],returns:["number"]},char:{type:"function",arguments:[{label:"codePoint",type:"number",default:{type:"number",value:65}}],returns:["string"]},sin:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},floor:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},range:{type:"function",arguments:[{label:"start",type:"number",default:{type:"number",value:0}},{label:"end",type:"number",default:{type:"number",value:0}},{label:"inc",type:"number",opt:!0}],returns:[{type:"list",valueType:"number"}]},round:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}},{label:"decimalPlaces",type:"number",default:{type:"number",value:0}}],returns:["number"]},rnd:{type:"function",arguments:[{label:"seed",type:"number",opt:!0}],returns:["number"]},sign:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},sqrt:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},str:{type:"function",arguments:[{label:"value",type:"any"}],returns:["string"]},ceil:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},pi:{type:"function",returns:["number"]},slice:{type:"function",arguments:[{label:"seq",types:["list","string"]},{label:"from",type:"number",default:{type:"number",value:0}},{label:"to",type:"number",opt:!0}],returns:["list","string"]},hash:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},time:{type:"function",returns:["number"]},bitAnd:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitOr:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitXor:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},log:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}},{label:"base",type:"number",default:{type:"number",value:10}}],returns:["number"]},yield:{type:"function",returns:["null"]},insert:{type:"function",arguments:[{label:"self",types:["list","string"]},{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},join:{type:"function",arguments:[{label:"self",type:"list"},{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},split:{type:"function",arguments:[{label:"self",type:"string"},{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"oldval",type:"any"},{label:"newval",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list","map","string"]},funcRef:{type:"function",returns:[{type:"map",keyType:"string"}]},list:{type:"function",returns:[{type:"map",keyType:"string"}]},map:{type:"function",returns:[{type:"map",keyType:"string"}]},number:{type:"function",returns:[{type:"map",keyType:"string"}]},string:{type:"function",returns:[{type:"map",keyType:"string"}]},refEquals:{type:"function",arguments:[{label:"a",type:"any"},{label:"b",type:"any"}],returns:["number"]},stackTrace:{type:"function",returns:[{type:"list",valueType:"string"}]},version:{type:"function",returns:["version"]}}}});var VA=m((E5,eL)=>{eL.exports={type:"list",definitions:{remove:{type:"function",arguments:[{label:"index",type:"number"}],returns:["null"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["list"]},pop:{type:"function",returns:["any"]},pull:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},sort:{type:"function",arguments:[{label:"byKey",type:"string"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list"]},join:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list"]}}}});var zA=m((A5,tL)=>{tL.exports={type:"map",definitions:{remove:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},push:{type:"function",arguments:[{label:"key",type:"string"}],returns:["map"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any","null"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["map"]}}}});var KA=m((x5,nL)=>{nL.exports={type:"number",definitions:{}}});var XA=m((k5,rL)=>{rL.exports={type:"string",definitions:{remove:{type:"function",arguments:[{label:"toDelete",type:"string"}],returns:["string"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"string"}],returns:["string"]},indexOf:{type:"function",arguments:[{label:"value",type:"string"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},split:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"oldVal",type:"string"},{label:"newVal",type:"string"},{label:"maxCount",type:"number",opt:!0}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},code:{type:"function",returns:["number"]},len:{type:"function",returns:["number"]},lower:{type:"function",returns:["string"]},upper:{type:"function",returns:["string"]},val:{type:"function",returns:["number"]},values:{type:"function",returns:[{type:"list",valueType:"string"}]}}}});var YA=m((C5,iL)=>{iL.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var JA=m(fn=>{"use strict";var Ti=fn&&fn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fn,"__esModule",{value:!0});fn.miniscriptMeta=void 0;var sL=$n(),oL=Ti(HA()),aL=Ti(WA()),uL=Ti(GA()),cL=Ti(VA()),lL=Ti(zA()),dL=Ti(KA()),fL=Ti(XA()),pL=Ti(YA());fn.miniscriptMeta=new sL.Container;fn.miniscriptMeta.addTypeSignatureFromPayload(aL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(uL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(cL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(lL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(dL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(fL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(pL.default);fn.miniscriptMeta.addMetaFromPayload("en",oL.default)});var Ua=m(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.lookupBase=nr.lookupIdentifier=void 0;var Br=je(),hL=JA(),mL=$a(),gL=t=>{switch(t.type){case Br.ASTType.CallStatement:return(0,nr.lookupIdentifier)(t.expression);case Br.ASTType.CallExpression:return(0,nr.lookupIdentifier)(t.base);case Br.ASTType.Identifier:return t;case Br.ASTType.MemberExpression:return(0,nr.lookupIdentifier)(t.identifier);case Br.ASTType.IndexExpression:return(0,nr.lookupIdentifier)(t.index);default:return null}};nr.lookupIdentifier=gL;var yL=(t=null)=>{switch(t?.type){case Br.ASTType.MemberExpression:return t.base;case Br.ASTType.IndexExpression:return t.base;case Br.ASTType.CallExpression:return t.base;case Br.ASTType.SliceExpression:return t.base;default:return null}};nr.lookupBase=yL;nr.default=new mL.TypeManager({container:hL.miniscriptMeta})});var fo=m(Un=>{"use strict";var bL=Un&&Un.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),_L=Un&&Un.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZA=Un&&Un.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&bL(e,t,n);return _L(e,t),e};Object.defineProperty(Un,"__esModule",{value:!0});Un.LookupHelper=Un.buildTypeDocument=void 0;var vL=$n(),QA=je(),lo=$a(),SL=ZA(ky()),is=ZA(Ua());async function Oy(t,e,n=new Map){let r=t.uri;if(n.has(r))return n.get(r);let i=is.default.get(r);if(n.set(r,null),!i)return null;let s=[],o=await e.documentManager.get(t).getImports();await Promise.all(o.map(async u=>{let{document:c,textDocument:l}=u;if(!c)return;let d=await Oy(l,e,n);d!==null&&s.push(d)}));let a=i.merge(...s);return n.set(r,a),a}Un.buildTypeDocument=Oy;var Cy=class{constructor(e,n){this.document=e,this.context=n}findAllAssignmentsOfIdentifier(e,n){return is.default.get(this.document.uri).getScopeContext(n).aggregator.resolveAvailableAssignmentsWithQuery(e)}findAllAssignmentsOfItem(e,n){return is.default.get(this.document.uri).getScopeContext(n).aggregator.resolveAvailableAssignments(e)}findAllAvailableIdentifierInRoot(){return is.default.get(this.document.uri).getRootScopeContext().scope.getAllIdentifier()}findAllAvailableIdentifier(e){return is.default.get(this.document.uri).getScopeContext(e).scope.getAllIdentifier()}findAllAvailableIdentifierRelatedToPosition(e){let n=is.default.get(this.document.uri),r=new Map,i=n.getScopeContext(e.scope);i.scope.isSelfAvailable()&&r.set("self",{kind:lo.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:lo.CompletionItemKind.Constant,line:-1});let s=new Map;(0,lo.injectIdentifers)(s,i.scope);let o=Array.from(s.entries()).map(([a,u])=>({identifier:a,...u})).sort((a,u)=>a.line-u.line);for(let a=0;a<o.length;a++){let u=o[a];if(u.line>=e.end.line)break;r.set(u.identifier,{kind:u.kind,line:u.line})}i.scope.locals!==i.scope.globals&&(0,lo.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,lo.injectIdentifers)(r,i.scope.outer);for(let a of n.container.getAllIdentifier(vL.SignatureDefinitionBaseType.General))r.set(...a);return r}lookupAST(e){let n=this,i=this.context.documentManager.get(n.document).document.lines[e.line+1];if(!i)return null;for(let s=0;s<i.length;s++){let o=i[s],a=SL.findEx((c,l)=>{let d=c.start.line-1,p=c.start.character-1,y=c.end.line-1,v=c.end.character-1;return d>e.line?{exit:!0}:d<y?{valid:e.line>d&&e.line<y||e.line===d&&p<=e.character||e.line===y&&v>=e.character}:{valid:d<=e.line&&p<=e.character&&y>=e.line&&v>=e.character}},o),u=a.pop();if(u)return{closest:u,outer:a}}return null}async lookupBasePath(e){let n=await this.buildTypeMap();if(n===null)return null;let r=(0,is.lookupBase)(e);return r?n.resolveNamespace(r):null}async buildTypeMap(){return await Oy(this.document,this.context)}async lookupTypeInfo({closest:e,outer:n}){let r=await this.buildTypeMap();if(r===null)return null;let i=n.length>0?n[n.length-1]:void 0;return i?.type===QA.ASTType.MemberExpression&&e===i.identifier||i?.type===QA.ASTType.IndexExpression&&e===i.index&&(0,lo.isValidIdentifierLiteral)(e)?r.resolveType(i,!0):r.resolveType(e,!0)}lookupType(e){let n=this,r=n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};Un.LookupHelper=Cy});var ex=m(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.AVAILABLE_CONSTANTS=void 0;td.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var tx=m(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.AVAILABLE_KEYWORDS=void 0;var po=Fr(),zt=je();nd.AVAILABLE_KEYWORDS=[zt.Keyword.If,zt.Keyword.In,zt.Keyword.Or,zt.Keyword.And,zt.Keyword.Isa,zt.Keyword.For,zt.Keyword.New,zt.Keyword.Not,zt.Keyword.End,zt.Keyword.Then,zt.Keyword.Else,zt.Keyword.Break,zt.Keyword.While,zt.Keyword.Return,zt.Keyword.Function,zt.Keyword.Continue,po.GreybelKeyword.Envar,po.GreybelKeyword.Import,po.GreybelKeyword.Include,po.GreybelKeyword.Debugger,po.GreybelKeyword.Line,po.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var nx=m(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.AVAILABLE_OPERATORS=void 0;var Ha=ao(),Pt=je();rd.AVAILABLE_OPERATORS=[Pt.Operator.Plus,Pt.Operator.Asterik,Pt.Operator.Minus,Pt.Operator.Slash,Pt.Operator.Power,Pt.Operator.Modulo,Pt.Operator.LessThan,Pt.Operator.GreaterThan,Pt.Operator.LessThanOrEqual,Pt.Operator.GreaterThanOrEqual,Pt.Operator.NotEqual,Pt.Operator.Equal,Pt.Operator.AddShorthand,Pt.Operator.SubtractShorthand,Pt.Operator.MultiplyShorthand,Pt.Operator.DivideShorthand,Ha.Operator.BitwiseAnd,Ha.Operator.BitwiseOr,Ha.Operator.LeftShift,Ha.Operator.RightShift,Ha.Operator.UnsignedRightShift,Pt.Operator.Assign,Pt.Operator.Reference].map(t=>({label:t,kind:24}))});var sx=m(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.activate=Mt.getDefaultCompletionList=Mt.getPropertyCompletionList=Mt.transformToCompletionItems=void 0;var rx=je(),TL=Ay(),ix=fo(),wL=ex(),EL=tx(),AL=nx(),xL=t=>{let e=[];for(let[n,r]of t)e.push({label:n,kind:(0,TL.getCompletionItemKind)(r.kind)});return e};Mt.transformToCompletionItems=xL;var kL=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?[]:(0,Mt.transformToCompletionItems)(n.getAllIdentifier())};Mt.getPropertyCompletionList=kL;var CL=()=>[...EL.AVAILABLE_KEYWORDS,...AL.AVAILABLE_OPERATORS,...wL.AVAILABLE_CONSTANTS];Mt.getDefaultCompletionList=CL;function OL(t){t.connection.onCompletion(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n),i=new ix.LookupHelper(r.textDocument,t),s=i.lookupAST(e.position),o=[],a=!1;if(s){let{closest:l}=s;l instanceof rx.ASTMemberExpression?(o.push(...await(0,Mt.getPropertyCompletionList)(i,l)),a=!0):l instanceof rx.ASTIndexExpression?(o.push(...await(0,Mt.getPropertyCompletionList)(i,l)),a=!0):o.push(...(0,Mt.getDefaultCompletionList)())}else o.push(...(0,Mt.getDefaultCompletionList)()),o.push(...(0,Mt.transformToCompletionItems)(i.findAllAvailableIdentifierInRoot()));if(!s||a)return o;let u=new Set([...o.map(l=>l.label)]),c=await r.getImports();for(let l of c){let{document:d}=l;if(!d)continue;let p=new ix.LookupHelper(l.textDocument,t);o.push(...(0,Mt.transformToCompletionItems)(p.findAllAvailableIdentifier(d)).filter(y=>!u.has(y.label)).map(y=>(u.add(y.label),y)))}return o.push(...(0,Mt.transformToCompletionItems)(i.findAllAvailableIdentifierRelatedToPosition(s.closest)).filter(l=>!u.has(l.label))),o}),t.connection.onCompletionResolve(e=>e)}Mt.activate=OL});var ax=m((N5,ox)=>{"use strict";ox.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Ry=m((q5,cx)=>{var Wa=ax(),ux={};for(let t of Object.keys(Wa))ux[Wa[t]]=t;var J={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};cx.exports=J;for(let t of Object.keys(J)){if(!("channels"in J[t]))throw new Error("missing channels property: "+t);if(!("labels"in J[t]))throw new Error("missing channel labels property: "+t);if(J[t].labels.length!==J[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=J[t];delete J[t].channels,delete J[t].labels,Object.defineProperty(J[t],"channels",{value:e}),Object.defineProperty(J[t],"labels",{value:n})}J.rgb.hsl=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=s-i,a,u;s===i?a=0:e===s?a=(n-r)/o:n===s?a=2+(r-e)/o:r===s&&(a=4+(e-n)/o),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+s)/2;return s===i?u=0:c<=.5?u=o/(s+i):u=o/(2-s-i),[a,u*100,c*100]};J.rgb.hsv=function(t){let e,n,r,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(o,a,u),l=c-Math.min(o,a,u),d=function(p){return(c-p)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=d(o),n=d(a),r=d(u),o===c?i=r-n:a===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,c*100]};J.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=J.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,s*100,r*100]};J.rgb.cmyk=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(1-e,1-n,1-r),s=(1-e-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,a=(1-r-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function RL(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}J.rgb.keyword=function(t){let e=ux[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(Wa)){let s=Wa[i],o=RL(t,s);o<n&&(n=o,r=i)}return r};J.keyword.rgb=function(t){return Wa[t]};J.rgb.xyz=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=e*.4124+n*.3576+r*.1805,s=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,s*100,o*100]};J.rgb.lab=function(t){let e=J.rgb.xyz(t),n=e[0],r=e[1],i=e[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,o=500*(n-r),a=200*(r-i);return[s,o,a]};J.hsl.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i,s,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;let a=2*r-i,u=[0,0,0];for(let c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(i-a)*6*s:2*s<1?o=i:3*s<2?o=a+(i-a)*(2/3-s)*6:o=a,u[c]=o*255;return u};J.hsl.hsv=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let o=(r+n)/2,a=r===0?2*i/(s+i):2*n/(r+n);return[e,a*100,o*100]};J.hsv.rgb=function(t){let e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*r*(1-n),a=255*r*(1-n*s),u=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,u,o];case 1:return[a,r,o];case 2:return[o,r,u];case 3:return[o,a,r];case 4:return[u,o,r];case 5:return[r,o,a]}};J.hsv.hsl=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),s,o;o=(2-n)*r;let a=(2-n)*i;return s=n*i,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};J.hwb.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let o=Math.floor(6*e),a=1-r;s=6*e-o,o&1&&(s=1-s);let u=n+s*(a-n),c,l,d;switch(o){default:case 6:case 0:c=a,l=u,d=n;break;case 1:c=u,l=a,d=n;break;case 2:c=n,l=a,d=u;break;case 3:c=n,l=u,d=a;break;case 4:c=u,l=n,d=a;break;case 5:c=a,l=n,d=u;break}return[c*255,l*255,d*255]};J.cmyk.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),a=1-Math.min(1,r*(1-i)+i);return[s*255,o*255,a*255]};J.xyz.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i,s,o;return i=e*3.2406+n*-1.5372+r*-.4986,s=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};J.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(e-n),o=200*(n-r);return[i,s,o]};J.lab.xyz=function(t){let e=t[0],n=t[1],r=t[2],i,s,o;s=(e+16)/116,i=n/500+s,o=s-r/200;let a=s**3,u=i**3,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};J.lab.lch=function(t){let e=t[0],n=t[1],r=t[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(n*n+r*r);return[e,o,i]};J.lch.lab=function(t){let e=t[0],n=t[1],i=t[2]/360*2*Math.PI,s=n*Math.cos(i),o=n*Math.sin(i);return[e,s,o]};J.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?J.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(o+=60),o};J.hsv.ansi16=function(t){return J.rgb.ansi16(J.hsv.rgb(t),t[2])};J.rgb.ansi256=function(t){let e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};J.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,s=(e>>2&1)*n*255;return[r,i,s]};J.ansi256.rgb=function(t){if(t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,n=Math.floor(t/36)/5*255,r=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[n,r,i]};J.rgb.hex=function(t){let n=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};J.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let n=e[0];e[0].length===3&&(n=n.split("").map(a=>a+a).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,o=r&255;return[i,s,o]};J.rgb.hcg=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),s=Math.min(Math.min(e,n),r),o=i-s,a,u;return o<1?a=s/(1-o):a=0,o<=0?u=0:i===e?u=(n-r)/o%6:i===n?u=2+(r-e)/o:u=4+(e-n)/o,u/=6,u%=1,[u*360,o*100,a*100]};J.hsl.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};J.hsv.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};J.hcg.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=e%1*6,o=s%1,a=1-o,u=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-n)*r,[(n*i[0]+u)*255,(n*i[1]+u)*255,(n*i[2]+u)*255]};J.hcg.hsv=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};J.hcg.hsl=function(t){let e=t[1]/100,r=t[2]/100*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};J.hcg.hwb=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};J.hwb.hcg=function(t){let e=t[1]/100,r=1-t[2]/100,i=r-e,s=0;return i<1&&(s=(r-i)/(1-i)),[t[0],i*100,s*100]};J.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};J.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};J.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};J.gray.hsl=function(t){return[0,0,t[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(t){return[0,100,t[0]]};J.gray.cmyk=function(t){return[0,0,0,t[0]]};J.gray.lab=function(t){return[t[0],0,0]};J.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r};J.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var dx=m((j5,lx)=>{var id=Ry();function DL(){let t={},e=Object.keys(id);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function IL(t){let e=DL(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(id[r]);for(let s=i.length,o=0;o<s;o++){let a=i[o],u=e[a];u.distance===-1&&(u.distance=e[r].distance+1,u.parent=r,n.unshift(a))}}return e}function PL(t,e){return function(n){return e(t(n))}}function ML(t,e){let n=[e[t].parent,t],r=id[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=PL(id[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}lx.exports=function(t){let e=IL(t),n={},r=Object.keys(e);for(let i=r.length,s=0;s<i;s++){let o=r[s];e[o].parent!==null&&(n[o]=ML(o,e))}return n}});var px=m((F5,fx)=>{var Dy=Ry(),LL=dx(),ho={},NL=Object.keys(Dy);function qL(t){let e=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function jL(t){let e=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=t(n);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}NL.forEach(t=>{ho[t]={},Object.defineProperty(ho[t],"channels",{value:Dy[t].channels}),Object.defineProperty(ho[t],"labels",{value:Dy[t].labels});let e=LL(t);Object.keys(e).forEach(r=>{let i=e[r];ho[t][r]=jL(i),ho[t][r].raw=qL(i)})});fx.exports=ho});var mx=m(mo=>{"use strict";var FL=mo&&mo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mo,"__esModule",{value:!0});mo.activate=void 0;var Iy=FL(px()),$L=je(),hx;(function(t){t.Black="black",t.Blue="blue",t.Green="green",t.Orange="orange",t.Purple="purple",t.Red="red",t.White="white",t.Yellow="yellow"})(hx||(hx={}));var Py={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},BL=()=>new RegExp(`(?:mark|color)=(${Object.keys(Py).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),UL=Object.prototype.hasOwnProperty;function HL(t){t.connection.onColorPresentation(e=>[{label:`#${Iy.default.rgb.hex(e.color.red*255,e.color.green*255,e.color.blue*255)}`}]),t.connection.onDocumentColor(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let s=(await t.documentManager.getLatest(n)).document.literals.filter(u=>u.type===$L.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:d,lineIndex:p})=>{let y=u.index+c.indexOf("=")+1,v=y+l.length,x=d.line-1+p,I=y,P=v;return p===0&&(I+=d.character,P+=d.character),{start:{line:x,character:I},end:{line:x,character:P}}};for(let u=0;u<s.length;u++){let c=s[u];if(!c.start)continue;let l=c.start,d=c.value.toString().split(`
|
116
|
+
`);for(let p=0;p<d.length;p++){let y=d[p],v=BL(),x;for(;x=v.exec(y);){let[I,P]=x,w=a({match:x,markup:I,value:P,astPosition:l,lineIndex:p});if(P.startsWith("#")){let[E,_,j]=Iy.default.hex.rgb(P.slice(1));o.push({range:w,color:{red:E/255,green:_/255,blue:j/255,alpha:1}})}else if(UL.call(Py,P)){let[E,_,j]=Iy.default.hex.rgb(Py[P].slice(1));o.push({range:w,color:{red:E/255,green:_/255,blue:j/255,alpha:1}})}else o.push({range:w,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}mo.activate=HL});var bx=m(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.activate=void 0;var WL=je(),gx=fo(),yx=(t,e,n)=>{let r=t.findAllAssignmentsOfItem(e,n),i=[];for(let s of r){if(!s.start||!s.end)continue;let o={line:s.start.line-1,character:s.start.character-1},a={line:s.end.line-1,character:s.end.character-1},u={targetUri:t.document.uri,targetRange:{start:o,end:a},targetSelectionRange:{start:o,end:a}};i.push(u)}return i};function GL(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=new gx.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{outer:s,closest:o}=i,a=s.length>0?s[s.length-1]:void 0,u=o;a&&a instanceof WL.ASTMemberExpression&&a.identifier===o&&(u=a);let c=yx(r,u,u.scope),l=await t.documentManager.get(n).getImports();for(let d of l){let{document:p,textDocument:y}=d;if(!p)continue;let v=new gx.LookupHelper(y,t),x=yx(v,u,p);c.push(...x)}return c})}sd.activate=GL});var _x=m(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.activate=void 0;async function VL(t,e){let n=await e.documentManager.getLatest(t);return n.errors.map(r=>{if(r?.range){let i=r.range;return{range:{start:{line:i.start.line-1,character:i.start.character-1},end:{line:i.end.line-1,character:i.end.character-1}},message:r.message,severity:1}}return{range:{start:n.document.start,end:n.document.end},message:r.message,severity:1}})}function zL(t){t.connection.languages.diagnostics.on(async e=>{if(!t.getConfiguration().diagnostic)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await VL(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}od.activate=zL});var vx=m(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.getStringHashCode=void 0;ad.getStringHashCode=function(){let t=new Map,e=n=>{let r,i;for(r=0,i=0;r<n.length;r++)i=Math.imul(31,i)+n.charCodeAt(r)|0;return i};return n=>{if(n.length===0)return 0;let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}()});var Tx=m(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.createExpressionHash=void 0;var ud=je(),Sx=vx(),cd=(t,e)=>t.$$hash=e,KL=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function go(t){let e=KL(t);if(e!==null)return e;let n=(0,Sx.getStringHashCode)(t.type);switch(t.type){case ud.ASTType.ParenthesisExpression:return go(t.expression);case ud.ASTType.MemberExpression:{let r=t;return n^=go(r.base),n^=go(r.identifier),cd(t,n)}case ud.ASTType.IndexExpression:{let r=t;return n^=go(r.base),n^=go(r.index),cd(t,n)}case ud.ASTType.Identifier:{let r=t;return n^=(0,Sx.getStringHashCode)(r.name),cd(t,n)}}return cd(t,n)}function XL(t){return go(t)}ld.createExpressionHash=XL});var dd=m(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.hasEmptyBody=kt.containsMultilineItemInShortcutClauses=kt.getLastComment=kt.unwrap=kt.transformBitOperation=kt.countRightBinaryExpressions=kt.SHORTHAND_OPERATORS=void 0;var pn=je();kt.SHORTHAND_OPERATORS=[pn.Operator.Plus,pn.Operator.Minus,pn.Operator.Asterik,pn.Operator.Slash,pn.Operator.Modulo,pn.Operator.Power];var YL=t=>{if(t=(0,kt.unwrap)(t),t instanceof pn.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof pn.ASTBinaryExpression&&n++,(r instanceof pn.ASTBinaryExpression||r instanceof pn.ASTLogicalExpression||r instanceof pn.ASTIsaExpression)&&(e.push((0,kt.unwrap)(r.left)),e.push((0,kt.unwrap)(r.right)))}return n};kt.countRightBinaryExpressions=YL;var JL=(t,e,n,r)=>{if(r==="|")return"bitOr("+[e,n].join(", ")+")";if(r==="&")return"bitAnd("+[e,n].join(", ")+")";if(r==="<<"||r===">>"||r===">>>")throw new Error("Operators in binary expression are not supported");return t};kt.transformBitOperation=JL;var QL=t=>{for(;t instanceof pn.ASTParenthesisExpression;)t=t.expression;return t};kt.unwrap=QL;var ZL=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===pn.ASTType.Comment)return n}return null};kt.getLastComment=ZL;var eN=(t,e)=>e.some(n=>t.line<n.body[0].end.line);kt.containsMultilineItemInShortcutClauses=eN;var tN=t=>!t.some(e=>!(e instanceof pn.ASTComment));kt.hasEmptyBody=tN});var Ly=m(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.BeautifyContext=os.IndentationType=void 0;var ss=je(),nN=dd(),wx;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})(wx=os.IndentationType||(os.IndentationType={}));var My=class{get indent(){return this._indent}get isMultilineAllowed(){return this._isMultilineAllowed}constructor(e,n){this.transformer=e,this.options=n,this._indent=0,this._isMultilineAllowed=!0,this.chunks=[],this.usedComments=new Set,this.putIndent=n.indentation===wx.Tab?(r,i=0)=>`${" ".repeat(this._indent+i)}${r}`:(r,i=0)=>`${" ".repeat(n.indentationSpaces).repeat(this._indent+i)}${r}`}pushLines(e){this.chunks.push(e)}popLines(){return this.chunks.pop()}getLines(){return this.chunks[this.chunks.length-1]}useComment(e,n=" "){let r=this.getLines()[e.line];if(r==null)return"";let i=(0,nN.getLastComment)(r);return i!=null&&!this.usedComments.has(i)?(this.usedComments.add(i),n+this.transformer.make(i)):""}appendComment(e,n){return n+this.useComment(e)}disableMultiline(){this._isMultilineAllowed=!1}enableMultiline(){this._isMultilineAllowed=!0}incIndent(){this._indent++}decIndent(){this._indent--}getBlockOpenerEndLine(e){return e instanceof ss.ASTIfClause||e instanceof ss.ASTWhileStatement?e.condition.end.line:e instanceof ss.ASTForGenericStatement?e.iterator.end.line:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===ss.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}buildBlock(e){var n;if(e.body.length===0)return[];let r=[...e.body].sort((u,c)=>u.start.line-c.start.line),i=[],s=null;for(let u=0;u<r.length;u++){let c=r[u],l=(n=r[u+1])!==null&&n!==void 0?n:null;if(c.type!==ss.ASTType.Comment&&s?.end.line===c.start.line){let p=this.transformer.make(c,{isCommand:!0});i.push(this.putIndent(this.appendComment(c.end,p))),s=c;continue}if(this.usedComments.has(c)){c.isMultiline&&(s=c);continue}if(c.type===ss.ASTType.Comment&&c.start.line===l?.start.line)continue;let d=Math.max(s?c.start.line-this.getPreviousEndLine(s)-1:c.start.line-this.getBlockOpenerEndLine(e)-1,0);if(d>0&&i.push(...new Array(d).fill("")),c instanceof ss.ASTComment){this.usedComments.add(c);let p=this.transformer.make(c,{isCommand:!0});i.push(this.putIndent(p))}else{let p=this.transformer.make(c,{isCommand:!0});i.push(this.putIndent(this.appendComment(c.end,p)))}s=c}let o=e.body[e.body.length-1],a=Math.max(e.end.line-this.getPreviousEndLine(o)-1,0);return a>0&&i.push(...new Array(a).fill("")),i}};os.BeautifyContext=My});var Ny=m(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.beautifyFactory=void 0;var Ga=je(),rN=require("path"),Ex=Tx(),Ax=Ly(),nn=dd(),iN=t=>{let{keepParentheses:e=!1,indentation:n=Ax.IndentationType.Tab,indentationSpaces:r=2,isDevMode:i=!1}=t.buildOptions,s=new Ax.BeautifyContext(t,{keepParentheses:e,indentation:n,indentationSpaces:r,isDevMode:i});return{ParenthesisExpression:(o,a)=>"("+t.make(o.expression,{hasLogicalIndentActive:a.hasLogicalIndentActive})+")",Comment:(o,a)=>o.isMultiline?i?`/*${o.value}*/`:o.value.split(`
|
117
117
|
`).map(u=>`//${u}`).join(`
|
118
118
|
`):"// "+o.value.trimStart(),AssignmentStatement:(o,a)=>{let u=o.variable,c=o.init,l=t.make(u);if((u instanceof Ga.ASTIdentifier||u instanceof Ga.ASTMemberExpression)&&c instanceof Ga.ASTBinaryExpression&&(c.left instanceof Ga.ASTIdentifier||c.left instanceof Ga.ASTMemberExpression)&&nn.SHORTHAND_OPERATORS.includes(c.operator)&&(0,Ex.createExpressionHash)(u)===(0,Ex.createExpressionHash)(c.left)){let p=t.make((0,nn.unwrap)(c.right));return l+" "+c.operator+"= "+p}let d=t.make(c);return l+" = "+d},MemberExpression:(o,a)=>{let u=t.make(o.identifier);return[t.make(o.base),u].join(o.indexer)},FunctionDeclaration:(o,a)=>{s.disableMultiline();let u=o.parameters.map(p=>t.make(p));s.enableMultiline();let c=s.appendComment(o.start,u.length===0?"function":"function("+u.join(", ")+")"),l=s.putIndent("end function");if((0,nn.hasEmptyBody)(o.body))return c+`
|
119
119
|
`+l;s.incIndent();let d=s.buildBlock(o);return s.decIndent(),c+`
|
@@ -217,10 +217,10 @@ end if`},IfClause:(n,r)=>{let i=t.make(n.condition),s=[],o;for(o of n.body){let
|
|
217
217
|
EXPORTED[r]=module
|
218
218
|
return EXPORTED[r]
|
219
219
|
end function`).parseChunk();Ei.MAIN_BOILERPLATE=new eb.Parser('"$0"').parseChunk()});var Rd=m(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.OutputProcessor=void 0;var Ix=tb(),nb=class{constructor(e,n,{header:r=Ix.HEADER_BOILERPLATE,main:i=Ix.MAIN_BOILERPLATE}={}){this.context=e,this.transformer=n,this.processed=[],this.headerBoilerplate=this.transformer.transform(r),this.mainBoilerplate=this.transformer.transform(i)}addLiteralsOptimization(){let e=this.context,n=Array.from(e.literals.getMapping().values()).filter(i=>i.namespace!=null),r=e.variables.get("globals");return n.length>0&&this.processed.push("globals."+r+"=globals",...n.map(i=>`${r}.${i.namespace}=${i.literal.raw}`)),this}addHeader(){return this.processed.push(this.headerBoilerplate),this}addCode(e,n=!1){if(n){let r=this.mainBoilerplate.replace('"$0"',e);this.processed.push(r)}else this.processed.push(e);return this}build(){return this.processed.join(`
|
220
|
-
`)}};Od.OutputProcessor=nb});var Px=m(bo=>{"use strict";var EN=bo&&bo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bo,"__esModule",{value:!0});bo.DirectTranspiler=void 0;var AN=EN(require("events")),xN=Fr(),Dd=md(),kN=za(),CN=Ad(),ON=Cd(),RN=Sd(),DN=Rd(),IN=Object.prototype.hasOwnProperty,rb=class extends AN.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=IN.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||Dd.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.disableLiteralsOptimization=e.disableLiteralsOptimization||n.buildType!==Dd.BuildType.UGLIFY,n.disableNamespacesOptimization=e.disableNamespacesOptimization||n.buildType!==Dd.BuildType.UGLIFY,n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,Dd.getFactory)(e.buildType),i=new xN.Parser(e.code).parseChunk(),s=(0,RN.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,ON.generateCharsetMap)(e.obfuscation),u=new kN.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});e.disableNamespacesOptimization||new Set(s).forEach(y=>u.variables.createNamespace(y)),e.disableLiteralsOptimization||o.forEach(p=>u.literals.add(p));let c=new CN.Transformer({buildOptions:e.buildOptions,mapFactory:n,context:u,environmentVariables:e.environmentVariables}),l=new DN.OutputProcessor(u,c);e.disableLiteralsOptimization||l.addLiteralsOptimization();let d=c.transform(i);return l.addCode(d),l.build()}};bo.DirectTranspiler=rb});var sb=m(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.ResourceProvider=void 0;var ib=class{getHandler(){let e=require("fs"),n=require("path");return{getTargetRelativeTo:(r,i)=>{let s=n.resolve(r,".."),o=n.resolve(s,i);return Promise.resolve(e.existsSync(o)?o:o+".src")},has:r=>Promise.resolve(e.existsSync(r)),get:r=>Promise.resolve(e.readFileSync(r,"utf8")),resolve:r=>Promise.resolve(n.resolve(r))}}};Id.ResourceProvider=ib});var ab=m(Ai=>{"use strict";var PN=Ai&&Ai.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},MN=Ai&&Ai.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.Target=void 0;var LN=MN(require("events")),NN=Fr(),qN=Yy(),Mx=_d(),ob=class extends LN.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(e){return PN(this,void 0,void 0,function*(){let n=this,r=n.resourceHandler,i=yield r.resolve(n.target);if(!(yield r.has(i)))throw new Error("Target "+i+" does not exist...");let s=n.context,o=yield r.get(i);n.emit("parse-before",i);try{let u=new NN.Parser(o,{filename:i}).parseChunk(),c=new qN.Dependency({target:i,resourceHandler:r,chunk:u,context:s}),{namespaces:l,literals:d}=yield c.findDependencies();if(!e.disableNamespacesOptimization){let p=new Set(l);for(let y of p)s.variables.createNamespace(y)}if(!e.disableLiteralsOptimization)for(let p of d)s.literals.add(p);return{main:{chunk:u,dependency:c}}}catch(a){throw a instanceof Mx.BuildError?a:new Mx.BuildError(a.message,{target:this.target,range:a.range})}})}};Ai.Target=ob});var Lx=m(_o=>{"use strict";var jN=_o&&_o.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(_o,"__esModule",{value:!0});_o.Transpiler=void 0;var FN=cb(),$N=tb(),Pd=md(),BN=za(),UN=sb(),HN=ab(),WN=Ad(),GN=Cd(),VN=Rd(),zN=Object.prototype.hasOwnProperty,ub=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new UN.ResourceProvider().getHandler(),n.obfuscation=zN.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,GN.generateCharsetMap)(n.obfuscation);n.context=new BN.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||Pd.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.disableLiteralsOptimization=e.disableLiteralsOptimization||n.buildType!==Pd.BuildType.UGLIFY,n.disableNamespacesOptimization=e.disableNamespacesOptimization||n.buildType!==Pd.BuildType.UGLIFY,n.environmentVariables=e.environmentVariables||new Map}parse(){return jN(this,void 0,void 0,function*(){let e=this,n=(0,Pd.getFactory)(e.buildType),r=e.context,s=yield new HN.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse({disableLiteralsOptimization:e.disableLiteralsOptimization,disableNamespacesOptimization:e.disableNamespacesOptimization}),o=new WN.Transformer({buildOptions:e.buildOptions,mapFactory:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform($N.MODULE_BOILERPLATE),c=(l,d)=>{let p=r.modules.get(l.getId()),y={},v=0,x=function(w){let E=w.getNamespace();if(!(E in y)){if(E!==p&&w.type===FN.DependencyType.Import){let _=o.transform(w.chunk,w);y[E]=u.replace('"$0"','"'+E+'"').replace('"$1"',_),v++}for(let _ of w.dependencies)x(_)}};x(l);let I=new VN.OutputProcessor(r,o);d&&I.addLiteralsOptimization(),v>0&&I.addHeader(),Object.keys(y).forEach(w=>I.addCode(y[w]));let P=o.transform(l.chunk,l);return I.addCode(P,!0),I.build()};return{[e.target]:c(a.dependency,!e.disableLiteralsOptimization)}})}};_o.Transpiler=ub});var cb=m(ee=>{"use strict";var Nx=ee&&ee.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),KN=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),XN=ee&&ee.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Nx(e,t,n);return KN(e,t),e},YN=ee&&ee.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Nx(e,t,n)};Object.defineProperty(ee,"__esModule",{value:!0});ee.Stack=ee.OutputProcessor=ee.NamespaceGenerator=ee.LiteralsMapper=ee.fetchNamespaces=ee.BuildError=ee.generateCharsetMap=ee.DependencyType=ee.Transpiler=ee.Transformer=ee.Target=ee.DirectTranspiler=ee.Dependency=ee.ContextDataProperty=ee.Context=ee.uglifyFactory=ee.defaultFactory=ee.BeautifyUtils=ee.BeautifyContext=ee.beautifyFactory=ee.getFactory=ee.BuildType=void 0;var qx=md();Object.defineProperty(ee,"BuildType",{enumerable:!0,get:function(){return qx.BuildType}});Object.defineProperty(ee,"getFactory",{enumerable:!0,get:function(){return qx.getFactory}});var JN=Ny();Object.defineProperty(ee,"beautifyFactory",{enumerable:!0,get:function(){return JN.beautifyFactory}});var QN=Ly();Object.defineProperty(ee,"BeautifyContext",{enumerable:!0,get:function(){return QN.BeautifyContext}});ee.BeautifyUtils=XN(dd());var ZN=qy();Object.defineProperty(ee,"defaultFactory",{enumerable:!0,get:function(){return ZN.defaultFactory}});var eq=jy();Object.defineProperty(ee,"uglifyFactory",{enumerable:!0,get:function(){return eq.uglifyFactory}});var jx=za();Object.defineProperty(ee,"Context",{enumerable:!0,get:function(){return jx.Context}});Object.defineProperty(ee,"ContextDataProperty",{enumerable:!0,get:function(){return jx.ContextDataProperty}});var tq=Yy();Object.defineProperty(ee,"Dependency",{enumerable:!0,get:function(){return tq.Dependency}});var nq=Px();Object.defineProperty(ee,"DirectTranspiler",{enumerable:!0,get:function(){return nq.DirectTranspiler}});YN(sb(),ee);var rq=ab();Object.defineProperty(ee,"Target",{enumerable:!0,get:function(){return rq.Target}});var iq=Ad();Object.defineProperty(ee,"Transformer",{enumerable:!0,get:function(){return iq.Transformer}});var sq=Lx();Object.defineProperty(ee,"Transpiler",{enumerable:!0,get:function(){return sq.Transpiler}});var oq=Gy();Object.defineProperty(ee,"DependencyType",{enumerable:!0,get:function(){return oq.DependencyType}});var aq=Cd();Object.defineProperty(ee,"generateCharsetMap",{enumerable:!0,get:function(){return aq.generateCharsetMap}});var uq=_d();Object.defineProperty(ee,"BuildError",{enumerable:!0,get:function(){return uq.BuildError}});var cq=Sd();Object.defineProperty(ee,"fetchNamespaces",{enumerable:!0,get:function(){return cq.fetchNamespaces}});var lq=By();Object.defineProperty(ee,"LiteralsMapper",{enumerable:!0,get:function(){return lq.LiteralsMapper}});var dq=Hy();Object.defineProperty(ee,"NamespaceGenerator",{enumerable:!0,get:function(){return dq.NamespaceGenerator}});var fq=Rd();Object.defineProperty(ee,"OutputProcessor",{enumerable:!0,get:function(){return fq.OutputProcessor}});var pq=Qy();Object.defineProperty(ee,"Stack",{enumerable:!0,get:function(){return pq.Stack}})});var $x=m(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.activate=void 0;var Fx=cb();function hq(t){async function e(n){try{let r=t.getConfiguration();return new Fx.DirectTranspiler({code:n,buildType:Fx.BuildType.BEAUTIFY,buildOptions:{isDevMode:!0,keepParentheses:r.transpiler.beautify.keepParentheses,indentation:r.transpiler.beautify.indentation==="Tab"?0:1,indentationSpaces:r.transpiler.beautify.indentationSpaces}}).parse()}catch{return null}}t.connection.onDocumentFormatting(async n=>{if(!t.getConfiguration().formatter)return;let r=await t.fs.getTextDocument(n.textDocument.uri),i=await t.documentManager.getLatest(r),s=await e(r.getText());return s===null?[]:[{range:{start:{line:0,character:0},end:i.document.end},newText:s}]})}Md.activate=hq});var Ld=m((Xa,lb)=>{(function(t,e){if(typeof Xa=="object"&&typeof lb=="object")lb.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof Xa=="object"?Xa:t)[r]=n[r]}})(Xa,()=>(()=>{"use strict";var t={470:i=>{function s(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function o(u,c){for(var l,d="",p=0,y=-1,v=0,x=0;x<=u.length;++x){if(x<u.length)l=u.charCodeAt(x);else{if(l===47)break;l=47}if(l===47){if(!(y===x-1||v===1))if(y!==x-1&&v===2){if(d.length<2||p!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var I=d.lastIndexOf("/");if(I!==d.length-1){I===-1?(d="",p=0):p=(d=d.slice(0,I)).length-1-d.lastIndexOf("/"),y=x,v=0;continue}}else if(d.length===2||d.length===1){d="",p=0,y=x,v=0;continue}}c&&(d.length>0?d+="/..":d="..",p=2)}else d.length>0?d+="/"+u.slice(y+1,x):d=u.slice(y+1,x),p=x-y-1;y=x,v=0}else l===46&&v!==-1?++v:v=-1}return d}var a={resolve:function(){for(var u,c="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var p;d>=0?p=arguments[d]:(u===void 0&&(u=process.cwd()),p=u),s(p),p.length!==0&&(c=p+"/"+c,l=p.charCodeAt(0)===47)}return c=o(c,!l),l?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(u){if(s(u),u.length===0)return".";var c=u.charCodeAt(0)===47,l=u.charCodeAt(u.length-1)===47;return(u=o(u,!c)).length!==0||c||(u="."),u.length>0&&l&&(u+="/"),c?"/"+u:u},isAbsolute:function(u){return s(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,c=0;c<arguments.length;++c){var l=arguments[c];s(l),l.length>0&&(u===void 0?u=l:u+="/"+l)}return u===void 0?".":a.normalize(u)},relative:function(u,c){if(s(u),s(c),u===c||(u=a.resolve(u))===(c=a.resolve(c)))return"";for(var l=1;l<u.length&&u.charCodeAt(l)===47;++l);for(var d=u.length,p=d-l,y=1;y<c.length&&c.charCodeAt(y)===47;++y);for(var v=c.length-y,x=p<v?p:v,I=-1,P=0;P<=x;++P){if(P===x){if(v>x){if(c.charCodeAt(y+P)===47)return c.slice(y+P+1);if(P===0)return c.slice(y+P)}else p>x&&(u.charCodeAt(l+P)===47?I=P:P===0&&(I=0));break}var w=u.charCodeAt(l+P);if(w!==c.charCodeAt(y+P))break;w===47&&(I=P)}var E="";for(P=l+I+1;P<=d;++P)P!==d&&u.charCodeAt(P)!==47||(E.length===0?E+="..":E+="/..");return E.length>0?E+c.slice(y+I):(y+=I,c.charCodeAt(y)===47&&++y,c.slice(y))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,d=-1,p=!0,y=u.length-1;y>=1;--y)if((c=u.charCodeAt(y))===47){if(!p){d=y;break}}else p=!1;return d===-1?l?"/":".":l&&d===1?"//":u.slice(0,d)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,d=0,p=-1,y=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var v=c.length-1,x=-1;for(l=u.length-1;l>=0;--l){var I=u.charCodeAt(l);if(I===47){if(!y){d=l+1;break}}else x===-1&&(y=!1,x=l+1),v>=0&&(I===c.charCodeAt(v)?--v==-1&&(p=l):(v=-1,p=x))}return d===p?p=x:p===-1&&(p=u.length),u.slice(d,p)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!y){d=l+1;break}}else p===-1&&(y=!1,p=l+1);return p===-1?"":u.slice(d,p)},extname:function(u){s(u);for(var c=-1,l=0,d=-1,p=!0,y=0,v=u.length-1;v>=0;--v){var x=u.charCodeAt(v);if(x!==47)d===-1&&(p=!1,d=v+1),x===46?c===-1?c=v:y!==1&&(y=1):c!==-1&&(y=-1);else if(!p){l=v+1;break}}return c===-1||d===-1||y===0||y===1&&c===d-1&&c===l+1?"":u.slice(c,d)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(c,l){var d=l.dir||l.root,p=l.base||(l.name||"")+(l.ext||"");return d?d===l.root?d+p:d+"/"+p:p}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,d=u.charCodeAt(0),p=d===47;p?(c.root="/",l=1):l=0;for(var y=-1,v=0,x=-1,I=!0,P=u.length-1,w=0;P>=l;--P)if((d=u.charCodeAt(P))!==47)x===-1&&(I=!1,x=P+1),d===46?y===-1?y=P:w!==1&&(w=1):y!==-1&&(w=-1);else if(!I){v=P+1;break}return y===-1||x===-1||w===0||w===1&&y===x-1&&y===v+1?x!==-1&&(c.base=c.name=v===0&&p?u.slice(1,x):u.slice(v,x)):(v===0&&p?(c.name=u.slice(1,y),c.base=u.slice(1,x)):(c.name=u.slice(v,y),c.base=u.slice(v,x)),c.ext=u.slice(y,x)),v>0?c.dir=u.slice(0,v-1):p&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a},674:(i,s)=>{if(Object.defineProperty(s,"__esModule",{value:!0}),s.isWindows=void 0,typeof process=="object")s.isWindows=process.platform==="win32";else if(typeof navigator=="object"){let o=navigator.userAgent;s.isWindows=o.indexOf("Windows")>=0}},796:(i,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.uriToFsPath=s.URI=void 0;let a=o(674),u=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function d(U,k){if(!U.scheme&&k)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${U.authority}", path: "${U.path}", query: "${U.query}", fragment: "${U.fragment}"}`);if(U.scheme&&!u.test(U.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(U.path){if(U.authority){if(!c.test(U.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(U.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let p="",y="/",v=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class x{static isUri(k){return k instanceof x||!!k&&typeof k.authority=="string"&&typeof k.fragment=="string"&&typeof k.path=="string"&&typeof k.query=="string"&&typeof k.scheme=="string"&&typeof k.fsPath=="string"&&typeof k.with=="function"&&typeof k.toString=="function"}scheme;authority;path;query;fragment;constructor(k,M,L,q,ce,ae=!1){typeof k=="object"?(this.scheme=k.scheme||p,this.authority=k.authority||p,this.path=k.path||p,this.query=k.query||p,this.fragment=k.fragment||p):(this.scheme=function(Ct,dt){return Ct||dt?Ct:"file"}(k,ae),this.authority=M||p,this.path=function(Ct,dt){switch(Ct){case"https":case"http":case"file":dt?dt[0]!==y&&(dt=y+dt):dt=y}return dt}(this.scheme,L||p),this.query=q||p,this.fragment=ce||p,d(this,ae))}get fsPath(){return j(this,!1)}with(k){if(!k)return this;let{scheme:M,authority:L,path:q,query:ce,fragment:ae}=k;return M===void 0?M=this.scheme:M===null&&(M=p),L===void 0?L=this.authority:L===null&&(L=p),q===void 0?q=this.path:q===null&&(q=p),ce===void 0?ce=this.query:ce===null&&(ce=p),ae===void 0?ae=this.fragment:ae===null&&(ae=p),M===this.scheme&&L===this.authority&&q===this.path&&ce===this.query&&ae===this.fragment?this:new P(M,L,q,ce,ae)}static parse(k,M=!1){let L=v.exec(k);return L?new P(L[2]||p,fe(L[4]||p),fe(L[5]||p),fe(L[7]||p),fe(L[9]||p),M):new P(p,p,p,p,p)}static file(k){let M=p;if(a.isWindows&&(k=k.replace(/\\/g,y)),k[0]===y&&k[1]===y){let L=k.indexOf(y,2);L===-1?(M=k.substring(2),k=y):(M=k.substring(2,L),k=k.substring(L)||y)}return new P("file",M,k,p,p)}static from(k){let M=new P(k.scheme,k.authority,k.path,k.query,k.fragment);return d(M,!0),M}toString(k=!1){return O(this,k)}toJSON(){return this}static revive(k){if(k){if(k instanceof x)return k;{let M=new P(k);return M._formatted=k.external,M._fsPath=k._sep===I?k.fsPath:null,M}}return k}}s.URI=x;let I=a.isWindows?1:void 0;class P extends x{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=j(this,!1)),this._fsPath}toString(k=!1){return k?O(this,!0):(this._formatted||(this._formatted=O(this,!1)),this._formatted)}toJSON(){let k={$mid:1};return this._fsPath&&(k.fsPath=this._fsPath,k._sep=I),this._formatted&&(k.external=this._formatted),this.path&&(k.path=this.path),this.scheme&&(k.scheme=this.scheme),this.authority&&(k.authority=this.authority),this.query&&(k.query=this.query),this.fragment&&(k.fragment=this.fragment),k}}let w={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function E(U,k,M){let L,q=-1;for(let ce=0;ce<U.length;ce++){let ae=U.charCodeAt(ce);if(ae>=97&&ae<=122||ae>=65&&ae<=90||ae>=48&&ae<=57||ae===45||ae===46||ae===95||ae===126||k&&ae===47||M&&ae===91||M&&ae===93||M&&ae===58)q!==-1&&(L+=encodeURIComponent(U.substring(q,ce)),q=-1),L!==void 0&&(L+=U.charAt(ce));else{L===void 0&&(L=U.substr(0,ce));let Ct=w[ae];Ct!==void 0?(q!==-1&&(L+=encodeURIComponent(U.substring(q,ce)),q=-1),L+=Ct):q===-1&&(q=ce)}}return q!==-1&&(L+=encodeURIComponent(U.substring(q))),L!==void 0?L:U}function _(U){let k;for(let M=0;M<U.length;M++){let L=U.charCodeAt(M);L===35||L===63?(k===void 0&&(k=U.substr(0,M)),k+=w[L]):k!==void 0&&(k+=U[M])}return k!==void 0?k:U}function j(U,k){let M;return M=U.authority&&U.path.length>1&&U.scheme==="file"?`//${U.authority}${U.path}`:U.path.charCodeAt(0)===47&&(U.path.charCodeAt(1)>=65&&U.path.charCodeAt(1)<=90||U.path.charCodeAt(1)>=97&&U.path.charCodeAt(1)<=122)&&U.path.charCodeAt(2)===58?k?U.path.substr(1):U.path[1].toLowerCase()+U.path.substr(2):U.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function O(U,k){let M=k?_:E,L="",{scheme:q,authority:ce,path:ae,query:Ct,fragment:dt}=U;if(q&&(L+=q,L+=":"),(ce||q==="file")&&(L+=y,L+=y),ce){let Pe=ce.indexOf("@");if(Pe!==-1){let rn=ce.substr(0,Pe);ce=ce.substr(Pe+1),Pe=rn.lastIndexOf(":"),Pe===-1?L+=M(rn,!1,!1):(L+=M(rn.substr(0,Pe),!1,!1),L+=":",L+=M(rn.substr(Pe+1),!1,!0)),L+="@"}ce=ce.toLowerCase(),Pe=ce.lastIndexOf(":"),Pe===-1?L+=M(ce,!1,!0):(L+=M(ce.substr(0,Pe),!1,!0),L+=ce.substr(Pe))}if(ae){if(ae.length>=3&&ae.charCodeAt(0)===47&&ae.charCodeAt(2)===58){let Pe=ae.charCodeAt(1);Pe>=65&&Pe<=90&&(ae=`/${String.fromCharCode(Pe+32)}:${ae.substr(3)}`)}else if(ae.length>=2&&ae.charCodeAt(1)===58){let Pe=ae.charCodeAt(0);Pe>=65&&Pe<=90&&(ae=`${String.fromCharCode(Pe+32)}:${ae.substr(2)}`)}L+=M(ae,!0,!1)}return Ct&&(L+="?",L+=M(Ct,!1,!1)),dt&&(L+="#",L+=k?dt:E(dt,!1,!1)),L}function H(U){try{return decodeURIComponent(U)}catch{return U.length>3?U.substr(0,3)+H(U.substr(3)):U}}s.uriToFsPath=j;let re=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function fe(U){return U.match(re)?U.replace(re,k=>H(k)):U}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(v,x,I,P){P===void 0&&(P=I);var w=Object.getOwnPropertyDescriptor(x,I);w&&!("get"in w?!x.__esModule:w.writable||w.configurable)||(w={enumerable:!0,get:function(){return x[I]}}),Object.defineProperty(v,P,w)}:function(v,x,I,P){P===void 0&&(P=I),v[P]=x[I]}),u=this&&this.__setModuleDefault||(Object.create?function(v,x){Object.defineProperty(v,"default",{enumerable:!0,value:x})}:function(v,x){v.default=x}),c=this&&this.__importStar||function(v){if(v&&v.__esModule)return v;var x={};if(v!=null)for(var I in v)I!=="default"&&Object.prototype.hasOwnProperty.call(v,I)&&a(x,v,I);return u(x,v),x};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let l=c(o(470)),d=l.posix||l,p="/";var y;(function(v){v.joinPath=function(x,...I){return x.with({path:d.join(x.path,...I)})},v.resolvePath=function(x,...I){let P=x.path,w=!1;P[0]!==p&&(P=p+P,w=!0);let E=d.resolve(P,...I);return w&&E[0]===p&&!x.authority&&(E=E.substring(1)),x.with({path:E})},v.dirname=function(x){if(x.path.length===0||x.path===p)return x;let I=d.dirname(x.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),x.with({path:I})},v.basename=function(x){return d.basename(x.path)},v.extname=function(x){return d.extname(x.path)}})(y||(s.Utils=y={}))}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.Utils=i.URI=void 0;let s=n(796);Object.defineProperty(i,"URI",{enumerable:!0,get:function(){return s.URI}});let o=n(679);Object.defineProperty(i,"Utils",{enumerable:!0,get:function(){return o.Utils}})})(),r})())});var qd=m(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.MarkdownString=void 0;var db=class{constructor(e=""){this.sanitize=!0,this.value=e}appendText(e){return this.value+=e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,n){return this.value+="\n```",this.value+=e,this.value+=`
|
220
|
+
`)}};Od.OutputProcessor=nb});var Px=m(bo=>{"use strict";var EN=bo&&bo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bo,"__esModule",{value:!0});bo.DirectTranspiler=void 0;var AN=EN(require("events")),xN=Fr(),Dd=md(),kN=za(),CN=Ad(),ON=Cd(),RN=Sd(),DN=Rd(),IN=Object.prototype.hasOwnProperty,rb=class extends AN.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=IN.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||Dd.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.disableLiteralsOptimization=e.disableLiteralsOptimization||n.buildType!==Dd.BuildType.UGLIFY,n.disableNamespacesOptimization=e.disableNamespacesOptimization||n.buildType!==Dd.BuildType.UGLIFY,n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,Dd.getFactory)(e.buildType),i=new xN.Parser(e.code).parseChunk(),s=(0,RN.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,ON.generateCharsetMap)(e.obfuscation),u=new kN.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});e.disableNamespacesOptimization||new Set(s).forEach(y=>u.variables.createNamespace(y)),e.disableLiteralsOptimization||o.forEach(p=>u.literals.add(p));let c=new CN.Transformer({buildOptions:e.buildOptions,mapFactory:n,context:u,environmentVariables:e.environmentVariables}),l=new DN.OutputProcessor(u,c);e.disableLiteralsOptimization||l.addLiteralsOptimization();let d=c.transform(i);return l.addCode(d),l.build()}};bo.DirectTranspiler=rb});var sb=m(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.ResourceProvider=void 0;var ib=class{getHandler(){let e=require("fs"),n=require("path");return{getTargetRelativeTo:(r,i)=>{let s=n.resolve(r,".."),o=n.resolve(s,i);return Promise.resolve(e.existsSync(o)?o:o+".src")},has:r=>Promise.resolve(e.existsSync(r)),get:r=>Promise.resolve(e.readFileSync(r,"utf8")),resolve:r=>Promise.resolve(n.resolve(r))}}};Id.ResourceProvider=ib});var ab=m(Ai=>{"use strict";var PN=Ai&&Ai.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},MN=Ai&&Ai.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.Target=void 0;var LN=MN(require("events")),NN=Fr(),qN=Yy(),Mx=_d(),ob=class extends LN.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(e){return PN(this,void 0,void 0,function*(){let n=this,r=n.resourceHandler,i=yield r.resolve(n.target);if(!(yield r.has(i)))throw new Error("Target "+i+" does not exist...");let s=n.context,o=yield r.get(i);n.emit("parse-before",i);try{let u=new NN.Parser(o,{filename:i}).parseChunk(),c=new qN.Dependency({target:i,resourceHandler:r,chunk:u,context:s}),{namespaces:l,literals:d}=yield c.findDependencies();if(!e.disableNamespacesOptimization){let p=new Set(l);for(let y of p)s.variables.createNamespace(y)}if(!e.disableLiteralsOptimization)for(let p of d)s.literals.add(p);return{main:{chunk:u,dependency:c}}}catch(a){throw a instanceof Mx.BuildError?a:new Mx.BuildError(a.message,{target:this.target,range:a.range})}})}};Ai.Target=ob});var Lx=m(_o=>{"use strict";var jN=_o&&_o.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(_o,"__esModule",{value:!0});_o.Transpiler=void 0;var FN=cb(),$N=tb(),Pd=md(),BN=za(),UN=sb(),HN=ab(),WN=Ad(),GN=Cd(),VN=Rd(),zN=Object.prototype.hasOwnProperty,ub=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new UN.ResourceProvider().getHandler(),n.obfuscation=zN.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,GN.generateCharsetMap)(n.obfuscation);n.context=new BN.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||Pd.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.disableLiteralsOptimization=e.disableLiteralsOptimization||n.buildType!==Pd.BuildType.UGLIFY,n.disableNamespacesOptimization=e.disableNamespacesOptimization||n.buildType!==Pd.BuildType.UGLIFY,n.environmentVariables=e.environmentVariables||new Map}parse(){return jN(this,void 0,void 0,function*(){let e=this,n=(0,Pd.getFactory)(e.buildType),r=e.context,s=yield new HN.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse({disableLiteralsOptimization:e.disableLiteralsOptimization,disableNamespacesOptimization:e.disableNamespacesOptimization}),o=new WN.Transformer({buildOptions:e.buildOptions,mapFactory:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform($N.MODULE_BOILERPLATE),c=(l,d)=>{let p=r.modules.get(l.getId()),y={},v=0,x=function(w){let E=w.getNamespace();if(!(E in y)){if(E!==p&&w.type===FN.DependencyType.Import){let _=o.transform(w.chunk,w);y[E]=u.replace('"$0"','"'+E+'"').replace('"$1"',_),v++}for(let _ of w.dependencies)x(_)}};x(l);let I=new VN.OutputProcessor(r,o);d&&I.addLiteralsOptimization(),v>0&&I.addHeader(),Object.keys(y).forEach(w=>I.addCode(y[w]));let P=o.transform(l.chunk,l);return I.addCode(P,!0),I.build()};return{[e.target]:c(a.dependency,!e.disableLiteralsOptimization)}})}};_o.Transpiler=ub});var cb=m(ee=>{"use strict";var Nx=ee&&ee.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),KN=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),XN=ee&&ee.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Nx(e,t,n);return KN(e,t),e},YN=ee&&ee.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Nx(e,t,n)};Object.defineProperty(ee,"__esModule",{value:!0});ee.Stack=ee.OutputProcessor=ee.NamespaceGenerator=ee.LiteralsMapper=ee.fetchNamespaces=ee.BuildError=ee.generateCharsetMap=ee.DependencyType=ee.Transpiler=ee.Transformer=ee.Target=ee.DirectTranspiler=ee.Dependency=ee.ContextDataProperty=ee.Context=ee.uglifyFactory=ee.defaultFactory=ee.BeautifyUtils=ee.BeautifyContext=ee.beautifyFactory=ee.getFactory=ee.BuildType=void 0;var qx=md();Object.defineProperty(ee,"BuildType",{enumerable:!0,get:function(){return qx.BuildType}});Object.defineProperty(ee,"getFactory",{enumerable:!0,get:function(){return qx.getFactory}});var JN=Ny();Object.defineProperty(ee,"beautifyFactory",{enumerable:!0,get:function(){return JN.beautifyFactory}});var QN=Ly();Object.defineProperty(ee,"BeautifyContext",{enumerable:!0,get:function(){return QN.BeautifyContext}});ee.BeautifyUtils=XN(dd());var ZN=qy();Object.defineProperty(ee,"defaultFactory",{enumerable:!0,get:function(){return ZN.defaultFactory}});var eq=jy();Object.defineProperty(ee,"uglifyFactory",{enumerable:!0,get:function(){return eq.uglifyFactory}});var jx=za();Object.defineProperty(ee,"Context",{enumerable:!0,get:function(){return jx.Context}});Object.defineProperty(ee,"ContextDataProperty",{enumerable:!0,get:function(){return jx.ContextDataProperty}});var tq=Yy();Object.defineProperty(ee,"Dependency",{enumerable:!0,get:function(){return tq.Dependency}});var nq=Px();Object.defineProperty(ee,"DirectTranspiler",{enumerable:!0,get:function(){return nq.DirectTranspiler}});YN(sb(),ee);var rq=ab();Object.defineProperty(ee,"Target",{enumerable:!0,get:function(){return rq.Target}});var iq=Ad();Object.defineProperty(ee,"Transformer",{enumerable:!0,get:function(){return iq.Transformer}});var sq=Lx();Object.defineProperty(ee,"Transpiler",{enumerable:!0,get:function(){return sq.Transpiler}});var oq=Gy();Object.defineProperty(ee,"DependencyType",{enumerable:!0,get:function(){return oq.DependencyType}});var aq=Cd();Object.defineProperty(ee,"generateCharsetMap",{enumerable:!0,get:function(){return aq.generateCharsetMap}});var uq=_d();Object.defineProperty(ee,"BuildError",{enumerable:!0,get:function(){return uq.BuildError}});var cq=Sd();Object.defineProperty(ee,"fetchNamespaces",{enumerable:!0,get:function(){return cq.fetchNamespaces}});var lq=By();Object.defineProperty(ee,"LiteralsMapper",{enumerable:!0,get:function(){return lq.LiteralsMapper}});var dq=Hy();Object.defineProperty(ee,"NamespaceGenerator",{enumerable:!0,get:function(){return dq.NamespaceGenerator}});var fq=Rd();Object.defineProperty(ee,"OutputProcessor",{enumerable:!0,get:function(){return fq.OutputProcessor}});var pq=Qy();Object.defineProperty(ee,"Stack",{enumerable:!0,get:function(){return pq.Stack}})});var $x=m(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.activate=void 0;var Fx=cb();function hq(t){async function e(n){try{let r=t.getConfiguration();return new Fx.DirectTranspiler({code:n,buildType:Fx.BuildType.BEAUTIFY,buildOptions:{isDevMode:!0,keepParentheses:r.transpiler.beautify.keepParentheses,indentation:r.transpiler.beautify.indentation==="Tab"?0:1,indentationSpaces:r.transpiler.beautify.indentationSpaces}}).parse()}catch{return null}}t.connection.onDocumentFormatting(async n=>{if(!t.getConfiguration().formatter)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=await t.documentManager.getLatest(r),s=await e(r.getText());return s===null?[]:[{range:{start:{line:0,character:0},end:i.document.end},newText:s}]})}Md.activate=hq});var Ld=m((Xa,lb)=>{(function(t,e){if(typeof Xa=="object"&&typeof lb=="object")lb.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof Xa=="object"?Xa:t)[r]=n[r]}})(Xa,()=>(()=>{"use strict";var t={470:i=>{function s(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function o(u,c){for(var l,d="",p=0,y=-1,v=0,x=0;x<=u.length;++x){if(x<u.length)l=u.charCodeAt(x);else{if(l===47)break;l=47}if(l===47){if(!(y===x-1||v===1))if(y!==x-1&&v===2){if(d.length<2||p!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var I=d.lastIndexOf("/");if(I!==d.length-1){I===-1?(d="",p=0):p=(d=d.slice(0,I)).length-1-d.lastIndexOf("/"),y=x,v=0;continue}}else if(d.length===2||d.length===1){d="",p=0,y=x,v=0;continue}}c&&(d.length>0?d+="/..":d="..",p=2)}else d.length>0?d+="/"+u.slice(y+1,x):d=u.slice(y+1,x),p=x-y-1;y=x,v=0}else l===46&&v!==-1?++v:v=-1}return d}var a={resolve:function(){for(var u,c="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var p;d>=0?p=arguments[d]:(u===void 0&&(u=process.cwd()),p=u),s(p),p.length!==0&&(c=p+"/"+c,l=p.charCodeAt(0)===47)}return c=o(c,!l),l?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(u){if(s(u),u.length===0)return".";var c=u.charCodeAt(0)===47,l=u.charCodeAt(u.length-1)===47;return(u=o(u,!c)).length!==0||c||(u="."),u.length>0&&l&&(u+="/"),c?"/"+u:u},isAbsolute:function(u){return s(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,c=0;c<arguments.length;++c){var l=arguments[c];s(l),l.length>0&&(u===void 0?u=l:u+="/"+l)}return u===void 0?".":a.normalize(u)},relative:function(u,c){if(s(u),s(c),u===c||(u=a.resolve(u))===(c=a.resolve(c)))return"";for(var l=1;l<u.length&&u.charCodeAt(l)===47;++l);for(var d=u.length,p=d-l,y=1;y<c.length&&c.charCodeAt(y)===47;++y);for(var v=c.length-y,x=p<v?p:v,I=-1,P=0;P<=x;++P){if(P===x){if(v>x){if(c.charCodeAt(y+P)===47)return c.slice(y+P+1);if(P===0)return c.slice(y+P)}else p>x&&(u.charCodeAt(l+P)===47?I=P:P===0&&(I=0));break}var w=u.charCodeAt(l+P);if(w!==c.charCodeAt(y+P))break;w===47&&(I=P)}var E="";for(P=l+I+1;P<=d;++P)P!==d&&u.charCodeAt(P)!==47||(E.length===0?E+="..":E+="/..");return E.length>0?E+c.slice(y+I):(y+=I,c.charCodeAt(y)===47&&++y,c.slice(y))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,d=-1,p=!0,y=u.length-1;y>=1;--y)if((c=u.charCodeAt(y))===47){if(!p){d=y;break}}else p=!1;return d===-1?l?"/":".":l&&d===1?"//":u.slice(0,d)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,d=0,p=-1,y=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var v=c.length-1,x=-1;for(l=u.length-1;l>=0;--l){var I=u.charCodeAt(l);if(I===47){if(!y){d=l+1;break}}else x===-1&&(y=!1,x=l+1),v>=0&&(I===c.charCodeAt(v)?--v==-1&&(p=l):(v=-1,p=x))}return d===p?p=x:p===-1&&(p=u.length),u.slice(d,p)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!y){d=l+1;break}}else p===-1&&(y=!1,p=l+1);return p===-1?"":u.slice(d,p)},extname:function(u){s(u);for(var c=-1,l=0,d=-1,p=!0,y=0,v=u.length-1;v>=0;--v){var x=u.charCodeAt(v);if(x!==47)d===-1&&(p=!1,d=v+1),x===46?c===-1?c=v:y!==1&&(y=1):c!==-1&&(y=-1);else if(!p){l=v+1;break}}return c===-1||d===-1||y===0||y===1&&c===d-1&&c===l+1?"":u.slice(c,d)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(c,l){var d=l.dir||l.root,p=l.base||(l.name||"")+(l.ext||"");return d?d===l.root?d+p:d+"/"+p:p}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,d=u.charCodeAt(0),p=d===47;p?(c.root="/",l=1):l=0;for(var y=-1,v=0,x=-1,I=!0,P=u.length-1,w=0;P>=l;--P)if((d=u.charCodeAt(P))!==47)x===-1&&(I=!1,x=P+1),d===46?y===-1?y=P:w!==1&&(w=1):y!==-1&&(w=-1);else if(!I){v=P+1;break}return y===-1||x===-1||w===0||w===1&&y===x-1&&y===v+1?x!==-1&&(c.base=c.name=v===0&&p?u.slice(1,x):u.slice(v,x)):(v===0&&p?(c.name=u.slice(1,y),c.base=u.slice(1,x)):(c.name=u.slice(v,y),c.base=u.slice(v,x)),c.ext=u.slice(y,x)),v>0?c.dir=u.slice(0,v-1):p&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a},674:(i,s)=>{if(Object.defineProperty(s,"__esModule",{value:!0}),s.isWindows=void 0,typeof process=="object")s.isWindows=process.platform==="win32";else if(typeof navigator=="object"){let o=navigator.userAgent;s.isWindows=o.indexOf("Windows")>=0}},796:(i,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.uriToFsPath=s.URI=void 0;let a=o(674),u=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function d(U,k){if(!U.scheme&&k)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${U.authority}", path: "${U.path}", query: "${U.query}", fragment: "${U.fragment}"}`);if(U.scheme&&!u.test(U.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(U.path){if(U.authority){if(!c.test(U.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(U.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let p="",y="/",v=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class x{static isUri(k){return k instanceof x||!!k&&typeof k.authority=="string"&&typeof k.fragment=="string"&&typeof k.path=="string"&&typeof k.query=="string"&&typeof k.scheme=="string"&&typeof k.fsPath=="string"&&typeof k.with=="function"&&typeof k.toString=="function"}scheme;authority;path;query;fragment;constructor(k,M,L,q,ce,ae=!1){typeof k=="object"?(this.scheme=k.scheme||p,this.authority=k.authority||p,this.path=k.path||p,this.query=k.query||p,this.fragment=k.fragment||p):(this.scheme=function(Ct,dt){return Ct||dt?Ct:"file"}(k,ae),this.authority=M||p,this.path=function(Ct,dt){switch(Ct){case"https":case"http":case"file":dt?dt[0]!==y&&(dt=y+dt):dt=y}return dt}(this.scheme,L||p),this.query=q||p,this.fragment=ce||p,d(this,ae))}get fsPath(){return j(this,!1)}with(k){if(!k)return this;let{scheme:M,authority:L,path:q,query:ce,fragment:ae}=k;return M===void 0?M=this.scheme:M===null&&(M=p),L===void 0?L=this.authority:L===null&&(L=p),q===void 0?q=this.path:q===null&&(q=p),ce===void 0?ce=this.query:ce===null&&(ce=p),ae===void 0?ae=this.fragment:ae===null&&(ae=p),M===this.scheme&&L===this.authority&&q===this.path&&ce===this.query&&ae===this.fragment?this:new P(M,L,q,ce,ae)}static parse(k,M=!1){let L=v.exec(k);return L?new P(L[2]||p,fe(L[4]||p),fe(L[5]||p),fe(L[7]||p),fe(L[9]||p),M):new P(p,p,p,p,p)}static file(k){let M=p;if(a.isWindows&&(k=k.replace(/\\/g,y)),k[0]===y&&k[1]===y){let L=k.indexOf(y,2);L===-1?(M=k.substring(2),k=y):(M=k.substring(2,L),k=k.substring(L)||y)}return new P("file",M,k,p,p)}static from(k){let M=new P(k.scheme,k.authority,k.path,k.query,k.fragment);return d(M,!0),M}toString(k=!1){return O(this,k)}toJSON(){return this}static revive(k){if(k){if(k instanceof x)return k;{let M=new P(k);return M._formatted=k.external,M._fsPath=k._sep===I?k.fsPath:null,M}}return k}}s.URI=x;let I=a.isWindows?1:void 0;class P extends x{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=j(this,!1)),this._fsPath}toString(k=!1){return k?O(this,!0):(this._formatted||(this._formatted=O(this,!1)),this._formatted)}toJSON(){let k={$mid:1};return this._fsPath&&(k.fsPath=this._fsPath,k._sep=I),this._formatted&&(k.external=this._formatted),this.path&&(k.path=this.path),this.scheme&&(k.scheme=this.scheme),this.authority&&(k.authority=this.authority),this.query&&(k.query=this.query),this.fragment&&(k.fragment=this.fragment),k}}let w={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function E(U,k,M){let L,q=-1;for(let ce=0;ce<U.length;ce++){let ae=U.charCodeAt(ce);if(ae>=97&&ae<=122||ae>=65&&ae<=90||ae>=48&&ae<=57||ae===45||ae===46||ae===95||ae===126||k&&ae===47||M&&ae===91||M&&ae===93||M&&ae===58)q!==-1&&(L+=encodeURIComponent(U.substring(q,ce)),q=-1),L!==void 0&&(L+=U.charAt(ce));else{L===void 0&&(L=U.substr(0,ce));let Ct=w[ae];Ct!==void 0?(q!==-1&&(L+=encodeURIComponent(U.substring(q,ce)),q=-1),L+=Ct):q===-1&&(q=ce)}}return q!==-1&&(L+=encodeURIComponent(U.substring(q))),L!==void 0?L:U}function _(U){let k;for(let M=0;M<U.length;M++){let L=U.charCodeAt(M);L===35||L===63?(k===void 0&&(k=U.substr(0,M)),k+=w[L]):k!==void 0&&(k+=U[M])}return k!==void 0?k:U}function j(U,k){let M;return M=U.authority&&U.path.length>1&&U.scheme==="file"?`//${U.authority}${U.path}`:U.path.charCodeAt(0)===47&&(U.path.charCodeAt(1)>=65&&U.path.charCodeAt(1)<=90||U.path.charCodeAt(1)>=97&&U.path.charCodeAt(1)<=122)&&U.path.charCodeAt(2)===58?k?U.path.substr(1):U.path[1].toLowerCase()+U.path.substr(2):U.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function O(U,k){let M=k?_:E,L="",{scheme:q,authority:ce,path:ae,query:Ct,fragment:dt}=U;if(q&&(L+=q,L+=":"),(ce||q==="file")&&(L+=y,L+=y),ce){let Pe=ce.indexOf("@");if(Pe!==-1){let rn=ce.substr(0,Pe);ce=ce.substr(Pe+1),Pe=rn.lastIndexOf(":"),Pe===-1?L+=M(rn,!1,!1):(L+=M(rn.substr(0,Pe),!1,!1),L+=":",L+=M(rn.substr(Pe+1),!1,!0)),L+="@"}ce=ce.toLowerCase(),Pe=ce.lastIndexOf(":"),Pe===-1?L+=M(ce,!1,!0):(L+=M(ce.substr(0,Pe),!1,!0),L+=ce.substr(Pe))}if(ae){if(ae.length>=3&&ae.charCodeAt(0)===47&&ae.charCodeAt(2)===58){let Pe=ae.charCodeAt(1);Pe>=65&&Pe<=90&&(ae=`/${String.fromCharCode(Pe+32)}:${ae.substr(3)}`)}else if(ae.length>=2&&ae.charCodeAt(1)===58){let Pe=ae.charCodeAt(0);Pe>=65&&Pe<=90&&(ae=`${String.fromCharCode(Pe+32)}:${ae.substr(2)}`)}L+=M(ae,!0,!1)}return Ct&&(L+="?",L+=M(Ct,!1,!1)),dt&&(L+="#",L+=k?dt:E(dt,!1,!1)),L}function H(U){try{return decodeURIComponent(U)}catch{return U.length>3?U.substr(0,3)+H(U.substr(3)):U}}s.uriToFsPath=j;let re=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function fe(U){return U.match(re)?U.replace(re,k=>H(k)):U}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(v,x,I,P){P===void 0&&(P=I);var w=Object.getOwnPropertyDescriptor(x,I);w&&!("get"in w?!x.__esModule:w.writable||w.configurable)||(w={enumerable:!0,get:function(){return x[I]}}),Object.defineProperty(v,P,w)}:function(v,x,I,P){P===void 0&&(P=I),v[P]=x[I]}),u=this&&this.__setModuleDefault||(Object.create?function(v,x){Object.defineProperty(v,"default",{enumerable:!0,value:x})}:function(v,x){v.default=x}),c=this&&this.__importStar||function(v){if(v&&v.__esModule)return v;var x={};if(v!=null)for(var I in v)I!=="default"&&Object.prototype.hasOwnProperty.call(v,I)&&a(x,v,I);return u(x,v),x};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let l=c(o(470)),d=l.posix||l,p="/";var y;(function(v){v.joinPath=function(x,...I){return x.with({path:d.join(x.path,...I)})},v.resolvePath=function(x,...I){let P=x.path,w=!1;P[0]!==p&&(P=p+P,w=!0);let E=d.resolve(P,...I);return w&&E[0]===p&&!x.authority&&(E=E.substring(1)),x.with({path:E})},v.dirname=function(x){if(x.path.length===0||x.path===p)return x;let I=d.dirname(x.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),x.with({path:I})},v.basename=function(x){return d.basename(x.path)},v.extname=function(x){return d.extname(x.path)}})(y||(s.Utils=y={}))}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.Utils=i.URI=void 0;let s=n(796);Object.defineProperty(i,"URI",{enumerable:!0,get:function(){return s.URI}});let o=n(679);Object.defineProperty(i,"Utils",{enumerable:!0,get:function(){return o.Utils}})})(),r})())});var qd=m(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.MarkdownString=void 0;var db=class{constructor(e=""){this.sanitize=!0,this.value=e}appendText(e){return this.value+=e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,n){return this.value+="\n```",this.value+=e,this.value+=`
|
221
221
|
`,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};Nd.MarkdownString=db});var jd=m(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.createHover=gt.createSignatureInfo=gt.appendTooltipBody=gt.appendTooltipHeader=gt.createTooltipHeader=gt.formatDefaultValue=gt.formatTypes=void 0;var Bx=qs(),Ux=qd();function fb(t=[]){return t.map(e=>e.toString().replace(",","\u066B")).join(" or ")}gt.formatTypes=fb;function Hx(t){return typeof t=="string"?`"${t}"`:t.toString()}gt.formatDefaultValue=Hx;var mq=(t,e)=>{let n=e.getArguments()||[],r=fb(e.getReturns())||"null";if(n.length===0)return`(${t.kind}) ${t.label} (): ${r}`;let i=n.map(s=>`${s.getLabel()}${s.isOptional()?"?":""}: ${fb(s.getTypes())}${s.getDefault()?` = ${Hx(s.getDefault().value)}`:""}`).join(", ");return`(${t.kind}) ${t.label} (${i}): ${r}`};gt.createTooltipHeader=mq;var gq=(t,e,n)=>{t.appendCodeblock(Bx.LanguageId,(0,gt.createTooltipHeader)(e,n)),t.appendMarkdown(`***
|
222
222
|
`)};gt.appendTooltipHeader=gq;var yq=(t,e)=>{let n=e.getExample()||[];t.appendMarkdown(e.getDescription()+`
|
223
223
|
`),n.length>0&&(t.appendMarkdown(`#### Examples:
|
224
224
|
`),t.appendCodeblock(Bx.LanguageId,n.join(`
|
225
225
|
`)))};gt.appendTooltipBody=yq;var bq=t=>{let e=[];for(let n of t.signatureDefinitions){let r=n,s={label:(0,gt.createTooltipHeader)(t,r)},o=r.getArguments()??[],a=new Ux.MarkdownString("");(0,gt.appendTooltipBody)(a,r),s.parameters=o.map(u=>({label:`${u.getLabel()}${u.isOptional()?"?":""}: ${u.getTypes().join(" or ")}`})),s.documentation=a.toString(),e.push(s)}return e};gt.createSignatureInfo=bq;var _q=t=>{let e=[];for(let n of t.signatureDefinitions){let r=new Ux.MarkdownString(""),i=n;(0,gt.appendTooltipHeader)(r,t,i),(0,gt.appendTooltipBody)(r,i),e.push(r)}return{contents:e.map(n=>n.toString())}};gt.createHover=_q});var Vx=m(vo=>{"use strict";var vq=vo&&vo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vo,"__esModule",{value:!0});vo.activate=void 0;var Wx=Fr(),pb=$n(),Sq=vq(require("path")),Fd=Ld(),Tq=fo(),Gx=qd(),hb=jd(),wq=qs();function Eq(t){async function e(n,r){let i=new Gx.MarkdownString(""),o=r.closest.path,a=await t.fs.getWorkspaceFolderUris(),u=o.startsWith("/")?a[0]:Fd.Utils.joinPath(Fd.URI.parse(n.uri),".."),c=Fd.Utils.joinPath(u,o),l=Fd.Utils.joinPath(u,`${o}`),d=await t.fs.findExistingPath(c.toString(),l.toString()),p=[`[Inserts file "${Sq.default.basename(d)}" inside this code when building](${d.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(p.join(`
|
226
|
-
`)),{contents:i.toString()}}t.connection.onHover(async n=>{if(!t.getConfiguration().hoverdocs)return;let r=await t.fs.getTextDocument(n.textDocument.uri),i=new Tq.LookupHelper(r,t),s=i.lookupAST(n.position);if(!s)return;if(s.closest.type===Wx.ASTType.FeatureImportExpression||s.closest.type===Wx.ASTType.FeatureIncludeExpression)return await e(r,s);let o=await i.lookupTypeInfo(s);if(!o)return;if(o.isCallable())return(0,hb.createHover)(o);let a=new Gx.MarkdownString(""),u=Array.from(o.types).map(pb.SignatureDefinitionTypeMeta.parse),c=`(${o.kind}) ${o.label}: ${(0,hb.formatTypes)(u)}`;if(o.types.has(pb.SignatureDefinitionBaseType.Map)){let l={};for(let[d,p]of o.values){let y=Array.from(p.types).map(pb.SignatureDefinitionTypeMeta.parse);l[d.slice(2)]=(0,hb.formatTypes)(y)}c+=" "+JSON.stringify(l,null,2)}return a.appendCodeblock(wq.LanguageId,c),{contents:a.toString()}})}vo.activate=Eq});var Kx=m($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.activate=void 0;var zx=je(),Aq=fo(),xq=jd(),kq=t=>{if(t.closest.type===zx.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===zx.ASTType.CallExpression)return n}return null};function Cq(t){t.connection.onSignatureHelp(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);await t.documentManager.getLatest(n);let r=new Aq.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{closest:s}=i,o=kq(i);if(o===null)return;let a=await r.lookupTypeInfo({closest:o.base,outer:s.scope?[s.scope]:[]});if(!a||!a.isCallable())return;let c=o.arguments.findIndex(d=>{let p=d.start.character-1,y=d.end.character;return p<=e.position.character&&y>=e.position.character}),l={activeParameter:c===-1?0:c,signatures:[],activeSignature:0};return l.signatures.push(...(0,xq.createSignatureInfo)(a)),l})}$d.activate=Cq});var Yx=m(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.activate=void 0;var Xx=qs();function Oq(t){let e=r=>r.languageId!==Xx.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===Xx.LanguageId&&t.documentManager.clear(r)};t.fs.on("text-document-open",e),t.fs.on("text-document-change",e),t.fs.on("text-document-close",n)}Bd.activate=Oq});var Qx=m(So=>{"use strict";var Rq=So&&So.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(So,"__esModule",{value:!0});So.activate=void 0;var Dq=$a(),Iq=Ay(),Pq=Rq(Ua()),Jx=(t,e)=>{let n=Pq.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){let o=s,a=n.resolveNamespace(o.variable,!0),u=a?.label??(0,Dq.createExpressionId)(s.variable),c=a?.kind?(0,Iq.getSymbolItemKind)(a.kind):13,l={line:o.variable.start.line-1,character:o.variable.start.character-1},d={line:o.variable.end.line-1,character:o.variable.end.character-1};i.push({name:u,containerName:u,kind:c,location:{uri:t.uri,range:{start:l,end:d}}})}return i};function Mq(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);return t.documentManager.get(n).document?Jx(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...Jx(r,e.query));return n})}So.activate=Mq});var vb=m((wU,nk)=>{var Ya=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Lq=typeof AbortController=="function",Ud=Lq?AbortController:class{constructor(){this.signal=new Zx}abort(e=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},Nq=typeof AbortSignal=="function",qq=typeof Ud.AbortSignal=="function",Zx=Nq?AbortSignal:qq?Ud.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},bb=new Set,mb=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;Hd(n)&&_b(n,`${t} option`,`options.${e}`,wo)},gb=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(Hd(n)){let{prototype:r}=wo,{get:i}=Object.getOwnPropertyDescriptor(r,t);_b(n,`${t} method`,`cache.${e}()`,i)}},jq=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(Hd(n)){let{prototype:r}=wo,{get:i}=Object.getOwnPropertyDescriptor(r,t);_b(n,`${t} property`,`cache.${e}`,i)}},ek=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},Hd=t=>!bb.has(t),_b=(t,e,n,r)=>{bb.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;ek(i,"DeprecationWarning",t,r)},xi=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),tk=t=>xi(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?To:null:null,To=class extends Array{constructor(e){super(e),this.fill(0)}},yb=class{constructor(e){if(e===0)return[];let n=tk(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},wo=class t{constructor(e={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,disposeAfter:l,noDisposeOnSet:d,noUpdateTTL:p,maxSize:y=0,maxEntrySize:v=0,sizeCalculation:x,fetchMethod:I,fetchContext:P,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:j,ignoreFetchAbort:O}=e,{length:H,maxAge:re,stale:fe}=e instanceof t?{}:e;if(n!==0&&!xi(n))throw new TypeError("max option must be a nonnegative integer");let U=n?tk(n):Array;if(!U)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=y,this.maxEntrySize=v||this.maxSize,this.sizeCalculation=x||H,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=I||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=P,!this.fetchMethod&&P!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new U(n),this.prev=new U(n),this.head=0,this.tail=0,this.free=new yb(n),this.initialFill=1,this.size=0,typeof c=="function"&&(this.dispose=c),typeof l=="function"?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.maxSize!==0&&!xi(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!xi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!fe,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=xi(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||re||0,this.ttl){if(!xi(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let k="LRU_CACHE_UNBOUNDED";Hd(k)&&(bb.add(k),ek("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",k,t))}fe&&mb("stale","allowStale"),re&&mb("maxAge","ttl"),H&&mb("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new To(this.max),this.starts=new To(this.max),this.setItemTTL=(r,i,s=Ya.now())=>{if(this.starts[r]=i!==0?s:0,this.ttls[r]=i,i!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},i+1);o.unref&&o.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Ya.now():0},this.statusTTL=(r,i)=>{r&&(r.ttl=this.ttls[i],r.start=this.starts[i],r.now=e||n(),r.remainingTTL=r.now+r.ttl-r.start)};let e=0,n=()=>{let r=Ya.now();if(this.ttlResolution>0){e=r;let i=setTimeout(()=>e=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{let i=this.keyMap.get(r);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(e||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(e||n())-this.starts[r]>this.ttls[r]}updateItemAge(e){}statusTTL(e,n){}setItemTTL(e,n,r){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new To(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,r,i)=>{if(this.isBackgroundFetch(n))return 0;if(!xi(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!xi(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.addItemSize=(e,n,r)=>{if(this.sizes[e]=n,this.maxSize){let i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,r,i){if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.keyList[r],this))return this.get(this.keyList[r],n)}}forEach(e,n=this){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}rforEach(e,n=this){for(let r of this.rindexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}get prune(){return gb("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){let e=[];for(let n of this.indexes({allowStale:!0})){let r=this.keyList[n],i=this.valList[n],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s===void 0)continue;let o={value:s};if(this.ttls){o.ttl=this.ttls[n];let a=Ya.now()-this.starts[n];o.start=Math.floor(Date.now()-a)}this.sizes&&(o.size=this.sizes[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Ya.now()-i}this.set(n,r.value,r)}}dispose(e,n,r){}set(e,n,{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:c}={}){if(o=this.requireSize(e,n,o,a),this.maxEntrySize&&o>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=n,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,o,c),c&&(c.set="add"),u=!1;else{this.moveToTail(l);let d=this.valList[l];if(n!==d){if(this.isBackgroundFetch(d)?d.__abortController.abort(new Error("replaced")):s||(this.dispose(d,e,"set"),this.disposeAfter&&this.disposed.push([d,e,"set"])),this.removeItemSize(l),this.valList[l]=n,this.addItemSize(l,o,c),c){c.set="replace";let p=d&&this.isBackgroundFetch(d)?d.__staleWhileFetching:d;p!==void 0&&(c.oldValue=p)}}else c&&(c.set="update")}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(l,r,i),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let n=this.head,r=this.keyList[n],i=this.valList[n];return this.isBackgroundFetch(i)?i.__abortController.abort(new Error("evicted")):(this.dispose(i,r,"evict"),this.disposeAfter&&this.disposed.push([i,r,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas,status:r}={}){let i=this.keyMap.get(e);if(i!==void 0)if(this.isStale(i))r&&(r.has="stale",this.statusTTL(r,i));else return n&&this.updateItemAge(i),r&&(r.has="hit"),this.statusTTL(r,i),!0;else r&&(r.has="miss");return!1}peek(e,{allowStale:n=this.allowStale}={}){let r=this.keyMap.get(e);if(r!==void 0&&(n||!this.isStale(r))){let i=this.valList[r];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(e,n,r,i){let s=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(s))return s;let o=new Ud;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(y,v=!1)=>{let{aborted:x}=o.signal,I=r.ignoreFetchAbort&&y!==void 0;return r.status&&(x&&!v?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,I&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),x&&!I&&!v?l(o.signal.reason):(this.valList[n]===p&&(y===void 0?p.__staleWhileFetching?this.valList[n]=p.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,y,a.options))),y)},c=y=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=y),l(y)),l=y=>{let{aborted:v}=o.signal,x=v&&r.allowStaleOnFetchAbort,I=x||r.allowStaleOnFetchRejection,P=I||r.noDeleteOnFetchRejection;if(this.valList[n]===p&&(!P||p.__staleWhileFetching===void 0?this.delete(e):x||(this.valList[n]=p.__staleWhileFetching)),I)return r.status&&p.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw y},d=(y,v)=>{this.fetchMethod(e,s,a).then(x=>y(x),v),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(y(),r.allowStaleOnFetchAbort&&(y=x=>u(x,!0)))})};r.status&&(r.status.fetchDispatched=!0);let p=new Promise(d).then(u,c);return p.__abortController=o,p.__staleWhileFetching=s,p.__returned=null,n===void 0?(this.set(e,p,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=p,p}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,fetchContext:v=this.fetchContext,forceRefresh:x=!1,status:I,signal:P}={}){if(!this.fetchMethod)return I&&(I.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:I});let w={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:p,status:I,signal:P},E=this.keyMap.get(e);if(E===void 0){I&&(I.fetch="miss");let _=this.backgroundFetch(e,E,w,v);return _.__returned=_}else{let _=this.valList[E];if(this.isBackgroundFetch(_)){let fe=n&&_.__staleWhileFetching!==void 0;return I&&(I.fetch="inflight",fe&&(I.returnedStale=!0)),fe?_.__staleWhileFetching:_.__returned=_}let j=this.isStale(E);if(!x&&!j)return I&&(I.fetch="hit"),this.moveToTail(E),r&&this.updateItemAge(E),this.statusTTL(I,E),_;let O=this.backgroundFetch(e,E,w,v),H=O.__staleWhileFetching!==void 0,re=H&&n;return I&&(I.fetch=H&&j?"stale":"refresh",re&&j&&(I.returnedStale=!0)),re?O.__staleWhileFetching:O.__returned=O}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}={}){let o=this.keyMap.get(e);if(o!==void 0){let a=this.valList[o],u=this.isBackgroundFetch(a);return this.statusTTL(s,o),this.isStale(o)?(s&&(s.get="stale"),u?(s&&(s.returnedStale=n&&a.__staleWhileFetching!==void 0),n?a.__staleWhileFetching:void 0):(i||this.delete(e),s&&(s.returnedStale=n),n?a:void 0)):(s&&(s.get="hit"),u?a.__staleWhileFetching:(this.moveToTail(o),r&&this.updateItemAge(o),a))}else s&&(s.get="miss")}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return gb("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){let r=this.keyMap.get(e);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);let i=this.valList[r];this.isBackgroundFetch(i)?i.__abortController.abort(new Error("deleted")):(this.dispose(i,e,"delete"),this.disposeAfter&&this.disposed.push([i,e,"delete"])),this.keyMap.delete(e),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(let e of this.rindexes({allowStale:!0})){let n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{let r=this.keyList[e];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return gb("reset","clear"),this.clear}get length(){return jq("length","size"),this.size}static get AbortController(){return Ud}static get AbortSignal(){return Zx}};nk.exports=wo});var ck=m((EU,uk)=>{var Eb=Object.defineProperty,Fq=Object.getOwnPropertyDescriptor,$q=Object.getOwnPropertyNames,Bq=Object.prototype.hasOwnProperty,Uq=(t,e)=>{for(var n in e)Eb(t,n,{get:e[n],enumerable:!0})},Hq=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $q(e))!Bq.call(t,i)&&i!==n&&Eb(t,i,{get:()=>e[i],enumerable:!(r=Fq(e,i))||r.enumerable});return t},Wq=t=>Hq(Eb({},"__esModule",{value:!0}),t),rk={};Uq(rk,{ScheduleIntervalHelper:()=>Sb,SchedulePostMessageHelper:()=>Tb,ScheduleSetImmmediateHelper:()=>wb,schedule:()=>zq,scheduleProvider:()=>ak});uk.exports=Wq(rk);var Gq=Promise.prototype.then.bind(Promise.resolve()),Ab=class Wd{constructor(){this.queue=[],this.sleep=0}static{this.SLEEP_LIMIT=512}static{this.QUEUE_LIMIT=1024}static isApplicable(){return!1}static createCallback(){throw new Error("Cannot create callback from base schedule helper!")}tick(){let e=this.queue,n=Math.min(e.length,Wd.QUEUE_LIMIT);this.queue=this.queue.slice(Wd.QUEUE_LIMIT);for(let r=0;r<n;Gq(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Wd.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},Sb=class ik extends Ab{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new ik;return e.add.bind(e)}isTickActive(){return this.timer!==null}startTick(){this.timer=setInterval(this.boundTick,0)}nextTick(){}endTick(){clearInterval(this.timer),this.timer=null}},Vq=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},Tb=class sk extends Ab{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!Vq()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new sk;return e.add.bind(e)}onMessage(e){e.source!==self||e.data!==this.id||this.tick()}isTickActive(){return this.active}startTick(){this.active=!0,self.postMessage(this.id)}nextTick(){self.postMessage(this.id)}endTick(){this.active=!1}},wb=class ok extends Ab{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new ok;return e.add.bind(e)}isTickActive(){return this.immediate!==null}startTick(){this.immediate=setImmediate(this.boundTick)}nextTick(){this.immediate=setImmediate(this.boundTick)}endTick(){clearImmediate(this.immediate),this.immediate=null}};function ak(){if(wb.isApplicable())return wb.createCallback();if(Tb.isApplicable())return Tb.createCallback();if(Sb.isApplicable())return Sb.createCallback();throw new Error("No schedule helper fulfills requirements!")}var zq=ak()});var fk=m(wn=>{"use strict";var Cb=wn&&wn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wn,"__esModule",{value:!0});wn.DocumentManager=wn.PROCESSING_TIMEOUT=wn.ActiveDocument=wn.DocumentURIBuilder=void 0;var Kq=Cb(require("events")),lk=Fr(),Xq=Cb(vb()),xb=ck(),Gd=Ld(),dk=Cb(Ua()),Vd=class{constructor(e,n=null){this.workspaceFolderUri=n,this.rootPath=e}getFromWorkspaceFolder(e){if(this.workspaceFolderUri==null)throw new Error("Workspace folder is not defined!");return Gd.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return Gd.Utils.joinPath(this.rootPath,e).toString()}};wn.DocumentURIBuilder=Vd;var Eo=class{constructor(e){this.documentManager=e.documentManager,this.content=e.content,this.textDocument=e.textDocument,this.document=e.document,this.errors=e.errors}getDirectory(){return Gd.Utils.joinPath(Gd.URI.parse(this.textDocument.uri),"..")}getImportsAndIncludes(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new Vd(r,e),o=a=>a.startsWith("/")?i.fs.findExistingPath(s.getFromWorkspaceFolder(a),s.getFromWorkspaceFolder(`${a}.src`)):i.fs.findExistingPath(s.getFromRootPath(a),s.getFromRootPath(`${a}.src`));return[...n.imports.filter(a=>a.path).map(a=>o(a.path)),...n.includes.filter(a=>a.path).map(a=>o(a.path))]}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUris(),n=this.getImportsAndIncludes(e[0]),r=new Set([...n]);return this.dependencies=Array.from(r),this.dependencies}async getImports(){if(this.document==null)return[];let e=new Set,n=new Set([this.textDocument.uri]),r=async i=>{let s=await i.getDependencies();for(let o of s){if(n.has(o))continue;let a=await this.documentManager.open(o);n.add(o),a!==null&&(e.add(a),a.document!==null&&await r(a))}};return await r(this),Array.from(e)}};wn.ActiveDocument=Eo;wn.PROCESSING_TIMEOUT=100;var kb=class extends Kq.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=wn.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new Xq.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,xb.schedule)(this.tickRef)}tick(){if(this.scheduledItems.size===0){this._timer=null;return}let e=Date.now(),n=Array.from(this.scheduledItems.values());for(let r=0;r<n.length;r++){let i=n[r];e-i.createdAt>this.processingTimeout&&(0,xb.schedule)(()=>this.refresh(i.document))}this._timer=setTimeout(this.tickRef,0)}refresh(e){let n=e.uri;if(!this.scheduledItems.has(n)&&this.results.has(n))return this.results.get(n);let r=this.create(e);return this.results.set(n,r),this.emit("parsed",e,r),this.scheduledItems.delete(n),r}create(e){let n=e.getText(),r=new lk.Parser(n,{unsafe:!0}),i=r.parseChunk();if(i.body?.length>0)return dk.default.analyze(e.uri,i),new Eo({documentManager:this,content:n,textDocument:e,document:i,errors:[...r.lexer.errors,...r.errors]});try{let o=new lk.Parser(e.getText()).parseChunk();return dk.default.analyze(e.uri,o),new Eo({documentManager:this,content:n,textDocument:e,document:o,errors:[]})}catch(s){return new Eo({documentManager:this,content:n,textDocument:e,document:null,errors:[s]})}}schedule(e){let n=e.uri,r=e.getText();return this.results.get(n)?.content===r?!1:(this.scheduledItems.set(n,{document:e,createdAt:Date.now()}),this._timer===null&&(this._timer=setTimeout(this.tickRef,0)),!0)}async open(e){try{let n=await this.context.fs.getTextDocument(e);return this.get(n)}catch{return null}}get(e){return this.results.get(e.uri)||this.refresh(e)}getLatest(e,n=5e3){return new Promise(r=>{(0,xb.schedule)(()=>{if(!this.scheduledItems.has(e.uri))return r(this.get(e));let i=()=>{this.removeListener("parsed",s),r(this.get(e))},s=a=>{a.uri===e.uri&&(this.removeListener("parsed",s),clearTimeout(o),r(this.get(e)))},o=setTimeout(i,n);this.addListener("parsed",s)})})}clear(e){this.results.delete(e.uri),this.emit("cleared",e)}};wn.DocumentManager=kb});var hk=m(Ao=>{"use strict";var Yq=Ao&&Ao.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.CoreContext=void 0;var Jq=Yq(require("events")),Ob=qs();function pk(t){return{formatter:t?.formatter??!0,autocomplete:t?.autocomplete??!0,hoverdocs:t?.hoverdocs??!0,diagnostic:t?.diagnostic??!0,transpiler:{beautify:{keepParentheses:t?.transpiler?.beautify?.keepParentheses??!0,indentation:t?.transpiler?.beautify?.indentation??Ob.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}}}}var Rb=class extends Jq.default{constructor(){super(),this._configuration=pk(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(Ob.ConfigurationNamespace);this._configuration=pk(e)}configureCapabilties(e){this._features.configuration=!!(e.workspace&&e.workspace.configuration),this._features.workspaceFolder=!!(e.workspace&&e.workspace.workspaceFolders)}async onInitialize(e){this.configureCapabilties(e.capabilities);let n={capabilities:{completionProvider:{triggerCharacters:["."],resolveProvider:!0},hoverProvider:!0,colorProvider:!0,definitionProvider:!0,documentFormattingProvider:!0,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:Ob.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},textDocumentSync:2}};return this._features.workspaceFolder&&(n.capabilities.workspace={workspaceFolders:{supported:!0}}),this.emit("ready",this),n}async onInitialized(e){this._features.configuration&&(await this.syncConfiguraton(),this.connection.onDidChangeConfiguration(async()=>{let n=this._configuration;await this.syncConfiguraton(),this.emit("configuration-change",this,this._configuration,n)})),this.emit("loaded",this)}async listen(){this.fs.listen(this.connection),this.connection.onInitialize(this.onInitialize.bind(this)),this.connection.onInitialized(this.onInitialized.bind(this)),this.connection.listen()}};Ao.CoreContext=Rb});var zd=m(K=>{"use strict";var Qq=K&&K.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Zq=K&&K.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ej=K&&K.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Qq(e,t,n);return Zq(e,t),e},tj=K&&K.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(K,"__esModule",{value:!0});K.CoreContext=K.typeAnalyzer=K.lookupBase=K.lookupIdentifier=K.appendTooltipHeader=K.appendTooltipBody=K.formatTypes=K.formatDefaultValue=K.createTooltipHeader=K.createSignatureInfo=K.createHover=K.MarkdownString=K.LookupHelper=K.DocumentManager=K.ActiveDocument=K.ASTScraper=K.activateSymbol=K.activateSubscriptions=K.activateSignature=K.activateHover=K.activateFormatter=K.activateDiagnostic=K.activateDefinition=K.activateColor=K.activateAutocomplete=K.ConfigurationNamespace=K.LanguageId=K.IndentationType=void 0;var Db=qs();Object.defineProperty(K,"IndentationType",{enumerable:!0,get:function(){return Db.IndentationType}});Object.defineProperty(K,"LanguageId",{enumerable:!0,get:function(){return Db.LanguageId}});Object.defineProperty(K,"ConfigurationNamespace",{enumerable:!0,get:function(){return Db.ConfigurationNamespace}});var nj=sx();Object.defineProperty(K,"activateAutocomplete",{enumerable:!0,get:function(){return nj.activate}});var rj=mx();Object.defineProperty(K,"activateColor",{enumerable:!0,get:function(){return rj.activate}});var ij=bx();Object.defineProperty(K,"activateDefinition",{enumerable:!0,get:function(){return ij.activate}});var sj=_x();Object.defineProperty(K,"activateDiagnostic",{enumerable:!0,get:function(){return sj.activate}});var oj=$x();Object.defineProperty(K,"activateFormatter",{enumerable:!0,get:function(){return oj.activate}});var aj=Vx();Object.defineProperty(K,"activateHover",{enumerable:!0,get:function(){return aj.activate}});var uj=Kx();Object.defineProperty(K,"activateSignature",{enumerable:!0,get:function(){return uj.activate}});var cj=Yx();Object.defineProperty(K,"activateSubscriptions",{enumerable:!0,get:function(){return cj.activate}});var lj=Qx();Object.defineProperty(K,"activateSymbol",{enumerable:!0,get:function(){return lj.activate}});K.ASTScraper=ej(ky());var mk=fk();Object.defineProperty(K,"ActiveDocument",{enumerable:!0,get:function(){return mk.ActiveDocument}});Object.defineProperty(K,"DocumentManager",{enumerable:!0,get:function(){return mk.DocumentManager}});var dj=fo();Object.defineProperty(K,"LookupHelper",{enumerable:!0,get:function(){return dj.LookupHelper}});var fj=qd();Object.defineProperty(K,"MarkdownString",{enumerable:!0,get:function(){return fj.MarkdownString}});var cs=jd();Object.defineProperty(K,"createHover",{enumerable:!0,get:function(){return cs.createHover}});Object.defineProperty(K,"createSignatureInfo",{enumerable:!0,get:function(){return cs.createSignatureInfo}});Object.defineProperty(K,"createTooltipHeader",{enumerable:!0,get:function(){return cs.createTooltipHeader}});Object.defineProperty(K,"formatDefaultValue",{enumerable:!0,get:function(){return cs.formatDefaultValue}});Object.defineProperty(K,"formatTypes",{enumerable:!0,get:function(){return cs.formatTypes}});Object.defineProperty(K,"appendTooltipBody",{enumerable:!0,get:function(){return cs.appendTooltipBody}});Object.defineProperty(K,"appendTooltipHeader",{enumerable:!0,get:function(){return cs.appendTooltipHeader}});var Ib=Ua();Object.defineProperty(K,"lookupIdentifier",{enumerable:!0,get:function(){return Ib.lookupIdentifier}});Object.defineProperty(K,"lookupBase",{enumerable:!0,get:function(){return Ib.lookupBase}});Object.defineProperty(K,"typeAnalyzer",{enumerable:!0,get:function(){return tj(Ib).default}});var pj=hk();Object.defineProperty(K,"CoreContext",{enumerable:!0,get:function(){return pj.CoreContext}})});var _k={};Ik(_k,{TextDocument:()=>Pb});function Mb(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Mb(r,e),Mb(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function gk(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);yk(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function yk(t){return t===13||t===10}function bk(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function hj(t){let e=bk(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Kd,Pb,vk=Dk(()=>{"use strict";Kd=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let i=bk(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),u=Math.max(i.end.line,0),c=this._lineOffsets,l=gk(r.text,!1,s);if(u-a===l.length)for(let p=0,y=l.length;p<y;p++)c[p+a+1]=l[p];else l.length<1e4?c.splice(a+1,u-a,...l):this._lineOffsets=c=c.slice(0,a+1).concat(l,c.slice(u+1));let d=r.text.length-(o-s);if(d!==0)for(let p=a+1+l.length,y=c.length;p<y;p++)c[p]=c[p]+d}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=gk(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line];if(e.character<=0)return r;let i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&yk(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}};(function(t){function e(i,s,o,a){return new Kd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Kd)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=Mb(s.map(hj),(l,d)=>{let p=l.range.start.line-d.range.start.line;return p===0?l.range.start.character-d.range.start.character:p}),u=0,c=[];for(let l of a){let d=i.offsetAt(l.range.start);if(d<u)throw new Error("Overlapping edit");d>u&&c.push(o.substring(u,d)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(Pb||(Pb={}))});var Tk=m(xo=>{"use strict";var qb=xo&&xo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xo,"__esModule",{value:!0});xo.FileSystem=void 0;var mj=Yp(),Sk=(vk(),Mk(_k)),gj=qb(require("events")),Lb=Ld(),yj=qb(require("fs")),bj=zd(),_j=qb(vb()),Nb=class extends gj.default{constructor(e){super(),this._context=e,this._textDocumentManager=new mj.TextDocuments(Sk.TextDocument),this._tempTextDocumentCache=new _j.default({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];let e=await this._workspace.getWorkspaceFolders();return Array.from(new Set(e.map(n=>n.uri))).map(n=>Lb.URI.parse(n))}findExistingPath(...e){if(e.length===0)return"";for(let n=0;n<e.length;n++)if(this.getTextDocument(e[n])!=null)return e[n];return e[0]}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=Lb.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await yj.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=Sk.TextDocument.create(e,bj.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(Lb.URI.parse(e).scheme=="file"?await this.fetchTextDocument(e):null)}async readFile(e){return(await this.getTextDocument(e)).getText()}listen(e){this._workspace=e.workspace,this._textDocumentManager.listen(e),this._textDocumentManager.onDidOpen(n=>{this.emit("text-document-open",n.document)}),this._textDocumentManager.onDidChangeContent(n=>{this.emit("text-document-change",n.document)}),this._textDocumentManager.onDidClose(n=>{this.emit("text-document-close",n.document)})}};xo.FileSystem=Nb});var Ak=m(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.NodeContext=void 0;var wk=Yp(),Ek=zd(),vj=Tk(),jb=class extends Ek.CoreContext{constructor(){super(),this.documentManager=new Ek.DocumentManager().setContext(this),this.connection=(0,wk.createConnection)(wk.ProposedFeatures.all),this.fs=new vj.FileSystem(this)}};Xd.NodeContext=jb});Object.defineProperty(exports,"__esModule",{value:!0});var Sj=Ak(),Ur=zd(),xk=new Sj.NodeContext;xk.on("ready",t=>{(0,Ur.activateAutocomplete)(t),(0,Ur.activateColor)(t),(0,Ur.activateDefinition)(t),(0,Ur.activateDiagnostic)(t),(0,Ur.activateFormatter)(t),(0,Ur.activateHover)(t),(0,Ur.activateSignature)(t),(0,Ur.activateSubscriptions)(t),(0,Ur.activateSymbol)(t)});xk.listen();
|
226
|
+
`)),{contents:i.toString()}}t.connection.onHover(async n=>{if(!t.getConfiguration().hoverdocs)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=new Tq.LookupHelper(r,t),s=i.lookupAST(n.position);if(!s)return;if(s.closest.type===Wx.ASTType.FeatureImportExpression||s.closest.type===Wx.ASTType.FeatureIncludeExpression)return await e(r,s);let o=await i.lookupTypeInfo(s);if(!o)return;if(o.isCallable())return(0,hb.createHover)(o);let a=new Gx.MarkdownString(""),u=Array.from(o.types).map(pb.SignatureDefinitionTypeMeta.parse),c=`(${o.kind}) ${o.label}: ${(0,hb.formatTypes)(u)}`;if(o.types.has(pb.SignatureDefinitionBaseType.Map)){let l={};for(let[d,p]of o.values){let y=Array.from(p.types).map(pb.SignatureDefinitionTypeMeta.parse);l[d.slice(2)]=(0,hb.formatTypes)(y)}c+=" "+JSON.stringify(l,null,2)}return a.appendCodeblock(wq.LanguageId,c),{contents:a.toString()}})}vo.activate=Eq});var Kx=m($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.activate=void 0;var zx=je(),Aq=fo(),xq=jd(),kq=t=>{if(t.closest.type===zx.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===zx.ASTType.CallExpression)return n}return null};function Cq(t){t.connection.onSignatureHelp(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;await t.documentManager.getLatest(n);let r=new Aq.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{closest:s}=i,o=kq(i);if(o===null)return;let a=await r.lookupTypeInfo({closest:o.base,outer:s.scope?[s.scope]:[]});if(!a||!a.isCallable())return;let c=o.arguments.findIndex(d=>{let p=d.start.character-1,y=d.end.character;return p<=e.position.character&&y>=e.position.character}),l={activeParameter:c===-1?0:c,signatures:[],activeSignature:0};return l.signatures.push(...(0,xq.createSignatureInfo)(a)),l})}$d.activate=Cq});var Yx=m(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.activate=void 0;var Xx=qs();function Oq(t){let e=r=>r.languageId!==Xx.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===Xx.LanguageId&&t.documentManager.clear(r)};t.fs.on("text-document-open",e),t.fs.on("text-document-change",e),t.fs.on("text-document-close",n)}Bd.activate=Oq});var Qx=m(So=>{"use strict";var Rq=So&&So.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(So,"__esModule",{value:!0});So.activate=void 0;var Dq=$a(),Iq=Ay(),Pq=Rq(Ua()),Jx=(t,e)=>{let n=Pq.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){let o=s,a=n.resolveNamespace(o.variable,!0),u=a?.label??(0,Dq.createExpressionId)(s.variable),c=a?.kind?(0,Iq.getSymbolItemKind)(a.kind):13,l={line:o.variable.start.line-1,character:o.variable.start.character-1},d={line:o.variable.end.line-1,character:o.variable.end.character-1};i.push({name:u,containerName:u,kind:c,location:{uri:t.uri,range:{start:l,end:d}}})}return i};function Mq(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);return n==null?void 0:t.documentManager.get(n).document?Jx(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...Jx(r,e.query));return n})}So.activate=Mq});var vb=m((wU,nk)=>{var Ya=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Lq=typeof AbortController=="function",Ud=Lq?AbortController:class{constructor(){this.signal=new Zx}abort(e=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},Nq=typeof AbortSignal=="function",qq=typeof Ud.AbortSignal=="function",Zx=Nq?AbortSignal:qq?Ud.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},bb=new Set,mb=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;Hd(n)&&_b(n,`${t} option`,`options.${e}`,wo)},gb=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(Hd(n)){let{prototype:r}=wo,{get:i}=Object.getOwnPropertyDescriptor(r,t);_b(n,`${t} method`,`cache.${e}()`,i)}},jq=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(Hd(n)){let{prototype:r}=wo,{get:i}=Object.getOwnPropertyDescriptor(r,t);_b(n,`${t} property`,`cache.${e}`,i)}},ek=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},Hd=t=>!bb.has(t),_b=(t,e,n,r)=>{bb.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;ek(i,"DeprecationWarning",t,r)},xi=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),tk=t=>xi(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?To:null:null,To=class extends Array{constructor(e){super(e),this.fill(0)}},yb=class{constructor(e){if(e===0)return[];let n=tk(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},wo=class t{constructor(e={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,disposeAfter:l,noDisposeOnSet:d,noUpdateTTL:p,maxSize:y=0,maxEntrySize:v=0,sizeCalculation:x,fetchMethod:I,fetchContext:P,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:j,ignoreFetchAbort:O}=e,{length:H,maxAge:re,stale:fe}=e instanceof t?{}:e;if(n!==0&&!xi(n))throw new TypeError("max option must be a nonnegative integer");let U=n?tk(n):Array;if(!U)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=y,this.maxEntrySize=v||this.maxSize,this.sizeCalculation=x||H,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=I||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=P,!this.fetchMethod&&P!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new U(n),this.prev=new U(n),this.head=0,this.tail=0,this.free=new yb(n),this.initialFill=1,this.size=0,typeof c=="function"&&(this.dispose=c),typeof l=="function"?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.maxSize!==0&&!xi(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!xi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!fe,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=xi(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||re||0,this.ttl){if(!xi(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let k="LRU_CACHE_UNBOUNDED";Hd(k)&&(bb.add(k),ek("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",k,t))}fe&&mb("stale","allowStale"),re&&mb("maxAge","ttl"),H&&mb("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new To(this.max),this.starts=new To(this.max),this.setItemTTL=(r,i,s=Ya.now())=>{if(this.starts[r]=i!==0?s:0,this.ttls[r]=i,i!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},i+1);o.unref&&o.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Ya.now():0},this.statusTTL=(r,i)=>{r&&(r.ttl=this.ttls[i],r.start=this.starts[i],r.now=e||n(),r.remainingTTL=r.now+r.ttl-r.start)};let e=0,n=()=>{let r=Ya.now();if(this.ttlResolution>0){e=r;let i=setTimeout(()=>e=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{let i=this.keyMap.get(r);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(e||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(e||n())-this.starts[r]>this.ttls[r]}updateItemAge(e){}statusTTL(e,n){}setItemTTL(e,n,r){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new To(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,r,i)=>{if(this.isBackgroundFetch(n))return 0;if(!xi(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!xi(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.addItemSize=(e,n,r)=>{if(this.sizes[e]=n,this.maxSize){let i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,r,i){if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.keyList[r],this))return this.get(this.keyList[r],n)}}forEach(e,n=this){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}rforEach(e,n=this){for(let r of this.rindexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}get prune(){return gb("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){let e=[];for(let n of this.indexes({allowStale:!0})){let r=this.keyList[n],i=this.valList[n],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s===void 0)continue;let o={value:s};if(this.ttls){o.ttl=this.ttls[n];let a=Ya.now()-this.starts[n];o.start=Math.floor(Date.now()-a)}this.sizes&&(o.size=this.sizes[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Ya.now()-i}this.set(n,r.value,r)}}dispose(e,n,r){}set(e,n,{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:c}={}){if(o=this.requireSize(e,n,o,a),this.maxEntrySize&&o>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=n,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,o,c),c&&(c.set="add"),u=!1;else{this.moveToTail(l);let d=this.valList[l];if(n!==d){if(this.isBackgroundFetch(d)?d.__abortController.abort(new Error("replaced")):s||(this.dispose(d,e,"set"),this.disposeAfter&&this.disposed.push([d,e,"set"])),this.removeItemSize(l),this.valList[l]=n,this.addItemSize(l,o,c),c){c.set="replace";let p=d&&this.isBackgroundFetch(d)?d.__staleWhileFetching:d;p!==void 0&&(c.oldValue=p)}}else c&&(c.set="update")}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(l,r,i),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let n=this.head,r=this.keyList[n],i=this.valList[n];return this.isBackgroundFetch(i)?i.__abortController.abort(new Error("evicted")):(this.dispose(i,r,"evict"),this.disposeAfter&&this.disposed.push([i,r,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas,status:r}={}){let i=this.keyMap.get(e);if(i!==void 0)if(this.isStale(i))r&&(r.has="stale",this.statusTTL(r,i));else return n&&this.updateItemAge(i),r&&(r.has="hit"),this.statusTTL(r,i),!0;else r&&(r.has="miss");return!1}peek(e,{allowStale:n=this.allowStale}={}){let r=this.keyMap.get(e);if(r!==void 0&&(n||!this.isStale(r))){let i=this.valList[r];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(e,n,r,i){let s=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(s))return s;let o=new Ud;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(y,v=!1)=>{let{aborted:x}=o.signal,I=r.ignoreFetchAbort&&y!==void 0;return r.status&&(x&&!v?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,I&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),x&&!I&&!v?l(o.signal.reason):(this.valList[n]===p&&(y===void 0?p.__staleWhileFetching?this.valList[n]=p.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,y,a.options))),y)},c=y=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=y),l(y)),l=y=>{let{aborted:v}=o.signal,x=v&&r.allowStaleOnFetchAbort,I=x||r.allowStaleOnFetchRejection,P=I||r.noDeleteOnFetchRejection;if(this.valList[n]===p&&(!P||p.__staleWhileFetching===void 0?this.delete(e):x||(this.valList[n]=p.__staleWhileFetching)),I)return r.status&&p.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw y},d=(y,v)=>{this.fetchMethod(e,s,a).then(x=>y(x),v),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(y(),r.allowStaleOnFetchAbort&&(y=x=>u(x,!0)))})};r.status&&(r.status.fetchDispatched=!0);let p=new Promise(d).then(u,c);return p.__abortController=o,p.__staleWhileFetching=s,p.__returned=null,n===void 0?(this.set(e,p,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=p,p}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,fetchContext:v=this.fetchContext,forceRefresh:x=!1,status:I,signal:P}={}){if(!this.fetchMethod)return I&&(I.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:I});let w={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:p,status:I,signal:P},E=this.keyMap.get(e);if(E===void 0){I&&(I.fetch="miss");let _=this.backgroundFetch(e,E,w,v);return _.__returned=_}else{let _=this.valList[E];if(this.isBackgroundFetch(_)){let fe=n&&_.__staleWhileFetching!==void 0;return I&&(I.fetch="inflight",fe&&(I.returnedStale=!0)),fe?_.__staleWhileFetching:_.__returned=_}let j=this.isStale(E);if(!x&&!j)return I&&(I.fetch="hit"),this.moveToTail(E),r&&this.updateItemAge(E),this.statusTTL(I,E),_;let O=this.backgroundFetch(e,E,w,v),H=O.__staleWhileFetching!==void 0,re=H&&n;return I&&(I.fetch=H&&j?"stale":"refresh",re&&j&&(I.returnedStale=!0)),re?O.__staleWhileFetching:O.__returned=O}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}={}){let o=this.keyMap.get(e);if(o!==void 0){let a=this.valList[o],u=this.isBackgroundFetch(a);return this.statusTTL(s,o),this.isStale(o)?(s&&(s.get="stale"),u?(s&&(s.returnedStale=n&&a.__staleWhileFetching!==void 0),n?a.__staleWhileFetching:void 0):(i||this.delete(e),s&&(s.returnedStale=n),n?a:void 0)):(s&&(s.get="hit"),u?a.__staleWhileFetching:(this.moveToTail(o),r&&this.updateItemAge(o),a))}else s&&(s.get="miss")}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return gb("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){let r=this.keyMap.get(e);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);let i=this.valList[r];this.isBackgroundFetch(i)?i.__abortController.abort(new Error("deleted")):(this.dispose(i,e,"delete"),this.disposeAfter&&this.disposed.push([i,e,"delete"])),this.keyMap.delete(e),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(let e of this.rindexes({allowStale:!0})){let n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{let r=this.keyList[e];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return gb("reset","clear"),this.clear}get length(){return jq("length","size"),this.size}static get AbortController(){return Ud}static get AbortSignal(){return Zx}};nk.exports=wo});var ck=m((EU,uk)=>{var Eb=Object.defineProperty,Fq=Object.getOwnPropertyDescriptor,$q=Object.getOwnPropertyNames,Bq=Object.prototype.hasOwnProperty,Uq=(t,e)=>{for(var n in e)Eb(t,n,{get:e[n],enumerable:!0})},Hq=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $q(e))!Bq.call(t,i)&&i!==n&&Eb(t,i,{get:()=>e[i],enumerable:!(r=Fq(e,i))||r.enumerable});return t},Wq=t=>Hq(Eb({},"__esModule",{value:!0}),t),rk={};Uq(rk,{ScheduleIntervalHelper:()=>Sb,SchedulePostMessageHelper:()=>Tb,ScheduleSetImmmediateHelper:()=>wb,schedule:()=>zq,scheduleProvider:()=>ak});uk.exports=Wq(rk);var Gq=Promise.prototype.then.bind(Promise.resolve()),Ab=class Wd{constructor(){this.queue=[],this.sleep=0}static{this.SLEEP_LIMIT=512}static{this.QUEUE_LIMIT=1024}static isApplicable(){return!1}static createCallback(){throw new Error("Cannot create callback from base schedule helper!")}tick(){let e=this.queue,n=Math.min(e.length,Wd.QUEUE_LIMIT);this.queue=this.queue.slice(Wd.QUEUE_LIMIT);for(let r=0;r<n;Gq(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Wd.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},Sb=class ik extends Ab{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new ik;return e.add.bind(e)}isTickActive(){return this.timer!==null}startTick(){this.timer=setInterval(this.boundTick,0)}nextTick(){}endTick(){clearInterval(this.timer),this.timer=null}},Vq=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},Tb=class sk extends Ab{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!Vq()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new sk;return e.add.bind(e)}onMessage(e){e.source!==self||e.data!==this.id||this.tick()}isTickActive(){return this.active}startTick(){this.active=!0,self.postMessage(this.id)}nextTick(){self.postMessage(this.id)}endTick(){this.active=!1}},wb=class ok extends Ab{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new ok;return e.add.bind(e)}isTickActive(){return this.immediate!==null}startTick(){this.immediate=setImmediate(this.boundTick)}nextTick(){this.immediate=setImmediate(this.boundTick)}endTick(){clearImmediate(this.immediate),this.immediate=null}};function ak(){if(wb.isApplicable())return wb.createCallback();if(Tb.isApplicable())return Tb.createCallback();if(Sb.isApplicable())return Sb.createCallback();throw new Error("No schedule helper fulfills requirements!")}var zq=ak()});var fk=m(wn=>{"use strict";var Cb=wn&&wn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wn,"__esModule",{value:!0});wn.DocumentManager=wn.PROCESSING_TIMEOUT=wn.ActiveDocument=wn.DocumentURIBuilder=void 0;var Kq=Cb(require("events")),lk=Fr(),Xq=Cb(vb()),xb=ck(),Gd=Ld(),dk=Cb(Ua()),Vd=class{constructor(e,n=null){this.workspaceFolderUri=n,this.rootPath=e}getFromWorkspaceFolder(e){if(this.workspaceFolderUri==null)throw new Error("Workspace folder is not defined!");return Gd.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return Gd.Utils.joinPath(this.rootPath,e).toString()}};wn.DocumentURIBuilder=Vd;var Eo=class{constructor(e){this.documentManager=e.documentManager,this.content=e.content,this.textDocument=e.textDocument,this.document=e.document,this.errors=e.errors}getDirectory(){return Gd.Utils.joinPath(Gd.URI.parse(this.textDocument.uri),"..")}getImportsAndIncludes(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new Vd(r,e),o=a=>a.startsWith("/")?i.fs.findExistingPath(s.getFromWorkspaceFolder(a),s.getFromWorkspaceFolder(`${a}.src`)):i.fs.findExistingPath(s.getFromRootPath(a),s.getFromRootPath(`${a}.src`));return[...n.imports.filter(a=>a.path).map(a=>o(a.path)),...n.includes.filter(a=>a.path).map(a=>o(a.path))]}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUris(),n=this.getImportsAndIncludes(e[0]),r=new Set([...n]);return this.dependencies=Array.from(r),this.dependencies}async getImports(){if(this.document==null)return[];let e=new Set,n=new Set([this.textDocument.uri]),r=async i=>{let s=await i.getDependencies();for(let o of s){if(n.has(o))continue;let a=await this.documentManager.open(o);n.add(o),a!==null&&(e.add(a),a.document!==null&&await r(a))}};return await r(this),Array.from(e)}};wn.ActiveDocument=Eo;wn.PROCESSING_TIMEOUT=100;var kb=class extends Kq.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=wn.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new Xq.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,xb.schedule)(this.tickRef)}tick(){if(this.scheduledItems.size===0){this._timer=null;return}let e=Date.now(),n=Array.from(this.scheduledItems.values());for(let r=0;r<n.length;r++){let i=n[r];e-i.createdAt>this.processingTimeout&&(0,xb.schedule)(()=>this.refresh(i.document))}this._timer=setTimeout(this.tickRef,0)}refresh(e){let n=e.uri;if(!this.scheduledItems.has(n)&&this.results.has(n))return this.results.get(n);let r=this.create(e);return this.results.set(n,r),this.emit("parsed",e,r),this.scheduledItems.delete(n),r}create(e){let n=e.getText(),r=new lk.Parser(n,{unsafe:!0}),i=r.parseChunk();if(i.body?.length>0)return dk.default.analyze(e.uri,i),new Eo({documentManager:this,content:n,textDocument:e,document:i,errors:[...r.lexer.errors,...r.errors]});try{let o=new lk.Parser(e.getText()).parseChunk();return dk.default.analyze(e.uri,o),new Eo({documentManager:this,content:n,textDocument:e,document:o,errors:[]})}catch(s){return new Eo({documentManager:this,content:n,textDocument:e,document:null,errors:[s]})}}schedule(e){let n=e.uri,r=e.getText();return this.results.get(n)?.content===r?!1:(this.scheduledItems.set(n,{document:e,createdAt:Date.now()}),this._timer===null&&(this._timer=setTimeout(this.tickRef,0)),!0)}async open(e){try{let n=await this.context.fs.getTextDocument(e);return n==null?null:this.get(n)}catch{return null}}get(e){return this.results.get(e.uri)||this.refresh(e)}getLatest(e,n=5e3){return new Promise(r=>{(0,xb.schedule)(()=>{if(!this.scheduledItems.has(e.uri))return r(this.get(e));let i=()=>{this.removeListener("parsed",s),r(this.get(e))},s=a=>{a.uri===e.uri&&(this.removeListener("parsed",s),clearTimeout(o),r(this.get(e)))},o=setTimeout(i,n);this.addListener("parsed",s)})})}clear(e){this.results.delete(e.uri),this.emit("cleared",e)}};wn.DocumentManager=kb});var hk=m(Ao=>{"use strict";var Yq=Ao&&Ao.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.CoreContext=void 0;var Jq=Yq(require("events")),Ob=qs();function pk(t){return{formatter:t?.formatter??!0,autocomplete:t?.autocomplete??!0,hoverdocs:t?.hoverdocs??!0,diagnostic:t?.diagnostic??!0,transpiler:{beautify:{keepParentheses:t?.transpiler?.beautify?.keepParentheses??!0,indentation:t?.transpiler?.beautify?.indentation??Ob.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}}}}var Rb=class extends Jq.default{constructor(){super(),this._configuration=pk(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(Ob.ConfigurationNamespace);this._configuration=pk(e)}configureCapabilties(e){this._features.configuration=!!(e.workspace&&e.workspace.configuration),this._features.workspaceFolder=!!(e.workspace&&e.workspace.workspaceFolders)}async onInitialize(e){this.configureCapabilties(e.capabilities);let n={capabilities:{completionProvider:{triggerCharacters:["."],resolveProvider:!0},hoverProvider:!0,colorProvider:!0,definitionProvider:!0,documentFormattingProvider:!0,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:Ob.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},textDocumentSync:2}};return this._features.workspaceFolder&&(n.capabilities.workspace={workspaceFolders:{supported:!0}}),this.emit("ready",this),n}async onInitialized(e){this._features.configuration&&(await this.syncConfiguraton(),this.connection.onDidChangeConfiguration(async()=>{let n=this._configuration;await this.syncConfiguraton(),this.emit("configuration-change",this,this._configuration,n)})),this.emit("loaded",this)}async listen(){this.fs.listen(this.connection),this.connection.onInitialize(this.onInitialize.bind(this)),this.connection.onInitialized(this.onInitialized.bind(this)),this.connection.listen()}};Ao.CoreContext=Rb});var zd=m(K=>{"use strict";var Qq=K&&K.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Zq=K&&K.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ej=K&&K.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Qq(e,t,n);return Zq(e,t),e},tj=K&&K.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(K,"__esModule",{value:!0});K.CoreContext=K.typeAnalyzer=K.lookupBase=K.lookupIdentifier=K.appendTooltipHeader=K.appendTooltipBody=K.formatTypes=K.formatDefaultValue=K.createTooltipHeader=K.createSignatureInfo=K.createHover=K.MarkdownString=K.LookupHelper=K.DocumentManager=K.ActiveDocument=K.ASTScraper=K.activateSymbol=K.activateSubscriptions=K.activateSignature=K.activateHover=K.activateFormatter=K.activateDiagnostic=K.activateDefinition=K.activateColor=K.activateAutocomplete=K.ConfigurationNamespace=K.LanguageId=K.IndentationType=void 0;var Db=qs();Object.defineProperty(K,"IndentationType",{enumerable:!0,get:function(){return Db.IndentationType}});Object.defineProperty(K,"LanguageId",{enumerable:!0,get:function(){return Db.LanguageId}});Object.defineProperty(K,"ConfigurationNamespace",{enumerable:!0,get:function(){return Db.ConfigurationNamespace}});var nj=sx();Object.defineProperty(K,"activateAutocomplete",{enumerable:!0,get:function(){return nj.activate}});var rj=mx();Object.defineProperty(K,"activateColor",{enumerable:!0,get:function(){return rj.activate}});var ij=bx();Object.defineProperty(K,"activateDefinition",{enumerable:!0,get:function(){return ij.activate}});var sj=_x();Object.defineProperty(K,"activateDiagnostic",{enumerable:!0,get:function(){return sj.activate}});var oj=$x();Object.defineProperty(K,"activateFormatter",{enumerable:!0,get:function(){return oj.activate}});var aj=Vx();Object.defineProperty(K,"activateHover",{enumerable:!0,get:function(){return aj.activate}});var uj=Kx();Object.defineProperty(K,"activateSignature",{enumerable:!0,get:function(){return uj.activate}});var cj=Yx();Object.defineProperty(K,"activateSubscriptions",{enumerable:!0,get:function(){return cj.activate}});var lj=Qx();Object.defineProperty(K,"activateSymbol",{enumerable:!0,get:function(){return lj.activate}});K.ASTScraper=ej(ky());var mk=fk();Object.defineProperty(K,"ActiveDocument",{enumerable:!0,get:function(){return mk.ActiveDocument}});Object.defineProperty(K,"DocumentManager",{enumerable:!0,get:function(){return mk.DocumentManager}});var dj=fo();Object.defineProperty(K,"LookupHelper",{enumerable:!0,get:function(){return dj.LookupHelper}});var fj=qd();Object.defineProperty(K,"MarkdownString",{enumerable:!0,get:function(){return fj.MarkdownString}});var cs=jd();Object.defineProperty(K,"createHover",{enumerable:!0,get:function(){return cs.createHover}});Object.defineProperty(K,"createSignatureInfo",{enumerable:!0,get:function(){return cs.createSignatureInfo}});Object.defineProperty(K,"createTooltipHeader",{enumerable:!0,get:function(){return cs.createTooltipHeader}});Object.defineProperty(K,"formatDefaultValue",{enumerable:!0,get:function(){return cs.formatDefaultValue}});Object.defineProperty(K,"formatTypes",{enumerable:!0,get:function(){return cs.formatTypes}});Object.defineProperty(K,"appendTooltipBody",{enumerable:!0,get:function(){return cs.appendTooltipBody}});Object.defineProperty(K,"appendTooltipHeader",{enumerable:!0,get:function(){return cs.appendTooltipHeader}});var Ib=Ua();Object.defineProperty(K,"lookupIdentifier",{enumerable:!0,get:function(){return Ib.lookupIdentifier}});Object.defineProperty(K,"lookupBase",{enumerable:!0,get:function(){return Ib.lookupBase}});Object.defineProperty(K,"typeAnalyzer",{enumerable:!0,get:function(){return tj(Ib).default}});var pj=hk();Object.defineProperty(K,"CoreContext",{enumerable:!0,get:function(){return pj.CoreContext}})});var _k={};Ik(_k,{TextDocument:()=>Pb});function Mb(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Mb(r,e),Mb(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function gk(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);yk(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function yk(t){return t===13||t===10}function bk(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function hj(t){let e=bk(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Kd,Pb,vk=Dk(()=>{"use strict";Kd=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let i=bk(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),u=Math.max(i.end.line,0),c=this._lineOffsets,l=gk(r.text,!1,s);if(u-a===l.length)for(let p=0,y=l.length;p<y;p++)c[p+a+1]=l[p];else l.length<1e4?c.splice(a+1,u-a,...l):this._lineOffsets=c=c.slice(0,a+1).concat(l,c.slice(u+1));let d=r.text.length-(o-s);if(d!==0)for(let p=a+1+l.length,y=c.length;p<y;p++)c[p]=c[p]+d}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=gk(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line];if(e.character<=0)return r;let i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&yk(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}};(function(t){function e(i,s,o,a){return new Kd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Kd)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=Mb(s.map(hj),(l,d)=>{let p=l.range.start.line-d.range.start.line;return p===0?l.range.start.character-d.range.start.character:p}),u=0,c=[];for(let l of a){let d=i.offsetAt(l.range.start);if(d<u)throw new Error("Overlapping edit");d>u&&c.push(o.substring(u,d)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(Pb||(Pb={}))});var Tk=m(xo=>{"use strict";var qb=xo&&xo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xo,"__esModule",{value:!0});xo.FileSystem=void 0;var mj=Yp(),Sk=(vk(),Mk(_k)),gj=qb(require("events")),Lb=Ld(),yj=qb(require("fs")),bj=zd(),_j=qb(vb()),Nb=class extends gj.default{constructor(e){super(),this._context=e,this._textDocumentManager=new mj.TextDocuments(Sk.TextDocument),this._tempTextDocumentCache=new _j.default({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];let e=await this._workspace.getWorkspaceFolders();return Array.from(new Set(e.map(n=>n.uri))).map(n=>Lb.URI.parse(n))}findExistingPath(...e){if(e.length===0)return"";for(let n=0;n<e.length;n++)if(this.getTextDocument(e[n])!=null)return e[n];return e[0]}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=Lb.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await yj.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=Sk.TextDocument.create(e,bj.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(Lb.URI.parse(e).scheme=="file"?await this.fetchTextDocument(e):null)}async readFile(e){return(await this.getTextDocument(e)).getText()}listen(e){this._workspace=e.workspace,this._textDocumentManager.listen(e),this._textDocumentManager.onDidOpen(n=>{this.emit("text-document-open",n.document)}),this._textDocumentManager.onDidChangeContent(n=>{this.emit("text-document-change",n.document)}),this._textDocumentManager.onDidClose(n=>{this.emit("text-document-close",n.document)})}};xo.FileSystem=Nb});var Ak=m(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.NodeContext=void 0;var wk=Yp(),Ek=zd(),vj=Tk(),jb=class extends Ek.CoreContext{constructor(){super(),this.documentManager=new Ek.DocumentManager().setContext(this),this.connection=(0,wk.createConnection)(wk.ProposedFeatures.all),this.fs=new vj.FileSystem(this)}};Xd.NodeContext=jb});Object.defineProperty(exports,"__esModule",{value:!0});var Sj=Ak(),Ur=zd(),xk=new Sj.NodeContext;xk.on("ready",t=>{(0,Ur.activateAutocomplete)(t),(0,Ur.activateColor)(t),(0,Ur.activateDefinition)(t),(0,Ur.activateDiagnostic)(t),(0,Ur.activateFormatter)(t),(0,Ur.activateHover)(t),(0,Ur.activateSignature)(t),(0,Ur.activateSubscriptions)(t),(0,Ur.activateSymbol)(t)});xk.listen();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "miniscript-languageserver",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.2",
|
4
4
|
"description": "Language server for MiniScript",
|
5
5
|
"main": "./index.js",
|
6
6
|
"scripts": {
|
@@ -71,6 +71,6 @@
|
|
71
71
|
"miniscript-meta": "~1.2.3",
|
72
72
|
"greybel-transpiler": "~3.0.9",
|
73
73
|
"miniscript-type-analyzer": "~0.8.2",
|
74
|
-
"miniscript-languageserver-core": "^1.0.
|
74
|
+
"miniscript-languageserver-core": "^1.0.2"
|
75
75
|
}
|
76
76
|
}
|