@willbooster/web-tree-sitter 19.0.2 → 19.1.0

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.
@@ -134,6 +134,11 @@
134
134
  * a parse also returns `null` when memory already exceeds this limit.
135
135
  */
136
136
  maxMemoryBytes?: number;
137
+ /**
138
+ * The maximum number of parse operations allowed during this parse. Exceeding
139
+ * it cancels the parse and resets the parser.
140
+ */
141
+ maxOperations?: number;
137
142
  }
138
143
  /**
139
144
  * A stateful object that is passed into the progress callback {@link ParseOptions#progressCallback}
@@ -167,6 +172,8 @@
167
172
  export class Parser {
168
173
  /** The parser's current language. */
169
174
  language: Language | null;
175
+ /** The number of parse operations executed by the most recent {@link Parser#parse} call. */
176
+ lastParseOperations: number;
170
177
  /**
171
178
  * This must always be called before creating a Parser.
172
179
  *
@@ -206,7 +213,7 @@
206
213
  * @returns A {@link Tree} if parsing succeeded, or `null` if:
207
214
  * - The parser has not yet had a language assigned with {@link Parser#setLanguage}.
208
215
  * - The progress callback returned true.
209
- * - The memory limit was reached.
216
+ * - The memory limit was reached or the operation limit was exceeded.
210
217
  */
211
218
  parse(callback: string | ParseCallback, oldTree?: Tree | null, options?: ParseOptions): Tree | null;
212
219
  /**
@@ -43,6 +43,6 @@
43
43
  null,
44
44
  null
45
45
  ],
46
- "mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAsCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBCjENC,iBAAiBA;;;;;;;;;cCLrBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCgBAC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2CZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;;YAsBhBC,sBAAsBA;;;;;cAWpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WC9GFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCiBRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC1BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCIJC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCNVC,iBAAiBA",
46
+ "mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA;;;;;;;;;cCLrBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCkBAC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiDZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;;YAOhBC,sBAAsBA;;;;;cAqCpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCjIFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC0BRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCnCJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCEJC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCJVC,iBAAiBA",
47
47
  "ignoreList": []
48
48
  }
@@ -134,6 +134,11 @@
134
134
  * a parse also returns `null` when memory already exceeds this limit.
135
135
  */
136
136
  maxMemoryBytes?: number;
137
+ /**
138
+ * The maximum number of parse operations allowed during this parse. Exceeding
139
+ * it cancels the parse and resets the parser.
140
+ */
141
+ maxOperations?: number;
137
142
  }
138
143
  /**
139
144
  * A stateful object that is passed into the progress callback {@link ParseOptions#progressCallback}
@@ -167,6 +172,8 @@
167
172
  export class Parser {
168
173
  /** The parser's current language. */
169
174
  language: Language | null;
175
+ /** The number of parse operations executed by the most recent {@link Parser#parse} call. */
176
+ lastParseOperations: number;
170
177
  /**
171
178
  * This must always be called before creating a Parser.
172
179
  *
@@ -206,7 +213,7 @@
206
213
  * @returns A {@link Tree} if parsing succeeded, or `null` if:
207
214
  * - The parser has not yet had a language assigned with {@link Parser#setLanguage}.
208
215
  * - The progress callback returned true.
209
- * - The memory limit was reached.
216
+ * - The memory limit was reached or the operation limit was exceeded.
210
217
  */
211
218
  parse(callback: string | ParseCallback, oldTree?: Tree | null, options?: ParseOptions): Tree | null;
212
219
  /**
@@ -43,6 +43,6 @@
43
43
  null,
44
44
  null
45
45
  ],
46
- "mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAsCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBCjENC,iBAAiBA;;;;;;;;;cCLrBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCgBAC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2CZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;;YAsBhBC,sBAAsBA;;;;;cAWpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WC9GFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCiBRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC1BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCIJC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCNVC,iBAAiBA",
46
+ "mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA;;;;;;;;;cCLrBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCkBAC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiDZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;;YAOhBC,sBAAsBA;;;;;cAqCpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCjIFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC0BRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCnCJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCEJC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCJVC,iBAAiBA",
47
47
  "ignoreList": []
48
48
  }
@@ -1,5 +1,5 @@
1
- var Me=Object.defineProperty;var a=(e,t)=>Me(e,"name",{value:t,configurable:!0});var $=class{static{a(this,"Edit")}startPosition;oldEndPosition;newEndPosition;startIndex;oldEndIndex;newEndIndex;constructor({startIndex:t,oldEndIndex:r,newEndIndex:n,startPosition:s,oldEndPosition:o,newEndPosition:l}){this.startIndex=t>>>0,this.oldEndIndex=r>>>0,this.newEndIndex=n>>>0,this.startPosition=s,this.oldEndPosition=o,this.newEndPosition=l}editPoint(t,r){let n=r,s={...t};if(r>=this.oldEndIndex){n=this.newEndIndex+(r-this.oldEndIndex);let o=t.row;s.row=this.newEndPosition.row+(t.row-this.oldEndPosition.row),s.column=o===this.oldEndPosition.row?this.newEndPosition.column+(t.column-this.oldEndPosition.column):t.column}else r>this.startIndex&&(n=this.newEndIndex,s.row=this.newEndPosition.row,s.column=this.newEndPosition.column);return{point:s,index:n}}editRange(t){let r={startIndex:t.startIndex,startPosition:{...t.startPosition},endIndex:t.endIndex,endPosition:{...t.endPosition}};return t.endIndex>=this.oldEndIndex?t.endIndex!==Number.MAX_SAFE_INTEGER&&(r.endIndex=this.newEndIndex+(t.endIndex-this.oldEndIndex),r.endPosition={row:this.newEndPosition.row+(t.endPosition.row-this.oldEndPosition.row),column:t.endPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(t.endPosition.column-this.oldEndPosition.column):t.endPosition.column},r.endIndex<this.newEndIndex&&(r.endIndex=Number.MAX_SAFE_INTEGER,r.endPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):t.endIndex>this.startIndex&&(r.endIndex=this.startIndex,r.endPosition={...this.startPosition}),t.startIndex>=this.oldEndIndex?(r.startIndex=this.newEndIndex+(t.startIndex-this.oldEndIndex),r.startPosition={row:this.newEndPosition.row+(t.startPosition.row-this.oldEndPosition.row),column:t.startPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(t.startPosition.column-this.oldEndPosition.column):t.startPosition.column},r.startIndex<this.newEndIndex&&(r.startIndex=Number.MAX_SAFE_INTEGER,r.startPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):t.startIndex>this.startIndex&&(r.startIndex=this.startIndex,r.startPosition={...this.startPosition}),r}};var X=2,u=4,D=4*u,b=5*u,M=2*u,F=2*u+2*M,K={row:0,column:0},p=Symbol("INTERNAL");function T(e){if(e!==p)throw new Error("Illegal constructor")}a(T,"assertInternal");function L(e){return!!e&&typeof e.row=="number"&&typeof e.column=="number"}a(L,"isPoint");function ee(e){_=e}a(ee,"setModule");var _;function S(e){try{return new FinalizationRegistry(e)}catch(t){console.error("Unsupported FinalizationRegistry:",t);return}}a(S,"newFinalizer");var te=S(e=>{_._ts_lookahead_iterator_delete(e)}),x=class{static{a(this,"LookaheadIterator")}0=0;language;positioned=!1;constructor(t,r,n){T(t),this[0]=r,this.language=n,te?.register(this,r,this)}get currentTypeId(){return this.positioned?_._ts_lookahead_iterator_current_symbol(this[0]):null}get currentType(){let t=this.currentTypeId;return t===null?null:this.language.types[t]??_.UTF8ToString(_._ts_language_symbol_name(this.language[0],t))}delete(){te?.unregister(this),_._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(t,r){return _._ts_lookahead_iterator_reset(this[0],t[0],r)?(this.language=t,this.positioned=!1,!0):!1}resetState(t){return _._ts_lookahead_iterator_reset_state(this[0],t)?(this.positioned=!1,!0):!1}[Symbol.iterator](){return{next:a(()=>{this.positioned=!!_._ts_lookahead_iterator_next(this[0]);let t=this.currentType;return t===null?{done:!0,value:""}:{done:!1,value:t}},"next")}}};function B(e,t,r,n){let s=r-t,o=e.textCallback(t,n);if(o){for(t+=o.length;t<r;){let l=e.textCallback(t,n);if(l&&l.length>0)t+=l.length,o+=l;else break}t>r&&(o=o.slice(0,s))}return o??""}a(B,"getText");var re=S(e=>{_._ts_tree_delete(e)}),C=class e{static{a(this,"Tree")}0=0;textCallback;language;constructor(t,r,n,s){T(t),this[0]=r,this.language=n,this.textCallback=s,re?.register(this,r,this)}copy(){let t=_._ts_tree_copy(this[0]);return new e(p,t,this.language,this.textCallback)}delete(){re?.unregister(this),_._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return _._ts_tree_root_node_wasm(this[0]),h(this)}rootNodeWithOffset(t,r){let n=d+b;return _.setValue(n,t,"i32"),y(n+u,r),_._ts_tree_root_node_with_offset_wasm(this[0]),h(this)}edit(t){_e(t),_._ts_tree_edit_wasm(this[0])}walk(){return this.rootNode.walk()}getChangedRanges(t){if(!(t instanceof e))throw new TypeError("Argument must be a Tree");_._ts_tree_get_changed_ranges_wasm(this[0],t[0]);let r=_.getValue(d,"i32"),n=_.getValue(d+u,"i32"),s=new Array(r);if(r>0){let o=n;for(let l=0;l<r;l++)s[l]=U(o),o+=F;_._ts_free_wasm(n)}return s}getIncludedRanges(){_._ts_tree_included_ranges_wasm(this[0]);let t=_.getValue(d,"i32"),r=_.getValue(d+u,"i32"),n=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)n[o]=U(s),s+=F;_._ts_free_wasm(r)}return n}};var ne=S(e=>{g({handles:e}),_._ts_tree_cursor_delete_wasm(0)}),H=class e{static{a(this,"TreeCursor")}handles=[0,0,0,0];tree;constructor(t,r){T(t),this.tree=r,A(this),ne?.register(this,this.handles,this)}copy(){return g(this),_._ts_tree_cursor_copy_wasm(this.tree[0]),new e(p,this.tree)}delete(){ne?.unregister(this),g(this),_._ts_tree_cursor_delete_wasm(this.tree[0]),this.handles.fill(0)}get currentNode(){return g(this),_._ts_tree_cursor_current_node_wasm(this.tree[0]),h(this.tree)}get currentFieldId(){return g(this),_._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return g(this),_._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return g(this),_._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return g(this),_._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return g(this),_._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return g(this),_._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return g(this),_._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return g(this),_._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){g(this);let t=_._ts_tree_cursor_start_index_wasm(this.tree[0]),r=_._ts_tree_cursor_end_index_wasm(this.tree[0]);_._ts_tree_cursor_start_position_wasm(this.tree[0]);let n=R(d);return B(this.tree,t,r,n)}get startPosition(){return g(this),_._ts_tree_cursor_start_position_wasm(this.tree[0]),R(d)}get endPosition(){return g(this),_._ts_tree_cursor_end_position_wasm(this.tree[0]),R(d)}get startIndex(){return g(this),_._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return g(this),_._ts_tree_cursor_end_index_wasm(this.tree[0])}gotoFirstChild(){g(this);let t=_._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return A(this),t===1}gotoLastChild(){g(this);let t=_._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return A(this),t===1}gotoParent(){g(this);let t=_._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return A(this),t===1}gotoNextSibling(){g(this);let t=_._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return A(this),t===1}gotoPreviousSibling(){g(this);let t=_._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return A(this),t===1}gotoDescendant(t){g(this),_._ts_tree_cursor_goto_descendant_wasm(this.tree[0],t),A(this)}gotoFirstChildForIndex(t){g(this),_.setValue(d+D,t,"i32");let r=_._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return A(this),r===1}gotoFirstChildForPosition(t){g(this),y(d+D,t);let r=_._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return A(this),r===1}reset(t){m(t),g(this,d+b),_._ts_tree_cursor_reset_wasm(t.tree[0]),A(this),this.tree=t.tree}resetTo(t){g(this,d),g(t,d+D),_._ts_tree_cursor_reset_to_wasm(this.tree[0],t.tree[0]),A(this),this.tree=t.tree}};var W=class{static{a(this,"Node")}0=0;_children;_namedChildren;constructor(t,{id:r,tree:n,startIndex:s,startPosition:o,other:l}){T(t),this[0]=l,this.id=r,this.tree=n,this.startIndex=s,this.startPosition=o}id;startIndex;startPosition;tree;get typeId(){return m(this),_._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return m(this),_._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get isNamed(){return m(this),_._ts_node_is_named_wasm(this.tree[0])===1}get isExtra(){return m(this),_._ts_node_is_extra_wasm(this.tree[0])===1}get isError(){return m(this),_._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return m(this),_._ts_node_is_missing_wasm(this.tree[0])===1}get hasChanges(){return m(this),_._ts_node_has_changes_wasm(this.tree[0])===1}get hasError(){return m(this),_._ts_node_has_error_wasm(this.tree[0])===1}get endIndex(){return m(this),_._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return m(this),_._ts_node_end_point_wasm(this.tree[0]),R(d)}get text(){return B(this.tree,this.startIndex,this.endIndex,this.startPosition)}get parseState(){return m(this),_._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return m(this),_._ts_node_next_parse_state_wasm(this.tree[0])}equals(t){return this.tree===t.tree&&this.id===t.id}child(t){return m(this),_._ts_node_child_wasm(this.tree[0],t),h(this.tree)}namedChild(t){return m(this),_._ts_node_named_child_wasm(this.tree[0],t),h(this.tree)}childForFieldId(t){return m(this),_._ts_node_child_by_field_id_wasm(this.tree[0],t),h(this.tree)}childForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1?this.childForFieldId(r):null}fieldNameForChild(t){m(this);let r=_._ts_node_field_name_for_child_wasm(this.tree[0],t);return r?_.AsciiToString(r):null}fieldNameForNamedChild(t){m(this);let r=_._ts_node_field_name_for_named_child_wasm(this.tree[0],t);return r?_.AsciiToString(r):null}childrenForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1&&r!==0?this.childrenForFieldId(r):[]}childrenForFieldId(t){m(this),_._ts_node_children_by_field_id_wasm(this.tree[0],t);let r=_.getValue(d,"i32"),n=_.getValue(d+u,"i32"),s=new Array(r);if(r>0){let o=n;for(let l=0;l<r;l++)s[l]=h(this.tree,o),o+=b;_._ts_free_wasm(n)}return s}firstChildForIndex(t){m(this);let r=d+b;return _.setValue(r,t,"i32"),_._ts_node_first_child_for_byte_wasm(this.tree[0]),h(this.tree)}firstNamedChildForIndex(t){m(this);let r=d+b;return _.setValue(r,t,"i32"),_._ts_node_first_named_child_for_byte_wasm(this.tree[0]),h(this.tree)}get childCount(){return m(this),_._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return m(this),_._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){m(this),_._ts_node_children_wasm(this.tree[0]);let t=_.getValue(d,"i32"),r=_.getValue(d+u,"i32");if(this._children=new Array(t),t>0){let n=r;for(let s=0;s<t;s++)this._children[s]=h(this.tree,n),n+=b;_._free(r)}}return this._children}get namedChildren(){if(!this._namedChildren){m(this),_._ts_node_named_children_wasm(this.tree[0]);let t=_.getValue(d,"i32"),r=_.getValue(d+u,"i32");if(this._namedChildren=new Array(t),t>0){let n=r;for(let s=0;s<t;s++)this._namedChildren[s]=h(this.tree,n),n+=b;_._free(r)}}return this._namedChildren}descendantsOfType(t,r=K,n=K){Array.isArray(t)||(t=[t]);let s=[],o=this.tree.language.types;for(let w=0,v=o.length;w<v;w++)t.includes(o[w])&&s.push(w);t.includes("ERROR")&&s.push(65535);let l=_._malloc(u*s.length);for(let w=0,v=s.length;w<v;w++)_.setValue(l+w*u,s[w],"i32");m(this),_._ts_node_descendants_of_type_wasm(this.tree[0],l,s.length,r.row,r.column,n.row,n.column);let c=_.getValue(d,"i32"),f=_.getValue(d+u,"i32"),E=new Array(c);if(c>0){let w=f;for(let v=0;v<c;v++)E[v]=h(this.tree,w),w+=b}return _._ts_free_wasm(f),_._free(l),E}get nextSibling(){return m(this),_._ts_node_next_sibling_wasm(this.tree[0]),h(this.tree)}get previousSibling(){return m(this),_._ts_node_prev_sibling_wasm(this.tree[0]),h(this.tree)}get nextNamedSibling(){return m(this),_._ts_node_next_named_sibling_wasm(this.tree[0]),h(this.tree)}get previousNamedSibling(){return m(this),_._ts_node_prev_named_sibling_wasm(this.tree[0]),h(this.tree)}get descendantCount(){return m(this),_._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return m(this),_._ts_node_parent_wasm(this.tree[0]),h(this.tree)}childWithDescendant(t){return t.tree!==this.tree?null:(m(this),m(t,1),_._ts_node_child_with_descendant_wasm(this.tree[0]),h(this.tree))}descendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");m(this);let n=d+b;return _.setValue(n,t,"i32"),_.setValue(n+u,r,"i32"),_._ts_node_descendant_for_index_wasm(this.tree[0]),h(this.tree)}namedDescendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");m(this);let n=d+b;return _.setValue(n,t,"i32"),_.setValue(n+u,r,"i32"),_._ts_node_named_descendant_for_index_wasm(this.tree[0]),h(this.tree)}descendantForPosition(t,r=t){if(!L(t)||!L(r))throw new Error("Arguments must be {row, column} objects");m(this);let n=d+b;return y(n,t),y(n+M,r),_._ts_node_descendant_for_position_wasm(this.tree[0]),h(this.tree)}namedDescendantForPosition(t,r=t){if(!L(t)||!L(r))throw new Error("Arguments must be {row, column} objects");m(this);let n=d+b;return y(n,t),y(n+M,r),_._ts_node_named_descendant_for_position_wasm(this.tree[0]),h(this.tree)}walk(){return m(this),_._ts_tree_cursor_new_wasm(this.tree[0]),new H(p,this.tree)}edit(t){let{point:r,index:n}=t.editPoint(this.startPosition,this.startIndex);this.startPosition=r,this.startIndex=n}toString(){m(this);let t=_._ts_node_to_string_wasm(this.tree[0]),r=_.AsciiToString(t);return _._ts_free_wasm(t),r}};function m(e,t=0){let r=d+t*b;_.setValue(r,e.id,"i32"),r+=u,_.setValue(r,e.startIndex,"i32"),r+=u,_.setValue(r,e.startPosition.row,"i32"),r+=u,_.setValue(r,e.startPosition.column,"i32"),r+=u,_.setValue(r,e[0],"i32")}a(m,"marshalNode");function h(e,t=d){let r=_.getValue(t,"i32");if(t+=u,r===0)return null;let n=_.getValue(t,"i32");t+=u;let s=_.getValue(t,"i32");t+=u;let o=_.getValue(t,"i32");t+=u;let l=_.getValue(t,"i32");return new W(p,{id:r,tree:e,startIndex:n,startPosition:{row:s,column:o},other:l})}a(h,"unmarshalNode");function g({handles:e},t=d){_.setValue(t+0*u,e[0],"i32"),_.setValue(t+1*u,e[1],"i32"),_.setValue(t+2*u,e[2],"i32"),_.setValue(t+3*u,e[3],"i32")}a(g,"marshalTreeCursor");function A({handles:e}){e[0]=_.getValue(d+0*u,"i32"),e[1]=_.getValue(d+1*u,"i32"),e[2]=_.getValue(d+2*u,"i32"),e[3]=_.getValue(d+3*u,"i32")}a(A,"unmarshalTreeCursor");function y(e,t){_.setValue(e,t.row,"i32"),_.setValue(e+u,t.column,"i32")}a(y,"marshalPoint");function R(e){return{row:_.getValue(e,"i32")>>>0,column:_.getValue(e+u,"i32")>>>0}}a(R,"unmarshalPoint");function se(e,t){y(e,t.startPosition),e+=M,y(e,t.endPosition),e+=M,_.setValue(e,t.startIndex,"i32"),e+=u,_.setValue(e,t.endIndex,"i32")}a(se,"marshalRange");function U(e){let t={};return t.startPosition=R(e),e+=M,t.endPosition=R(e),e+=M,t.startIndex=_.getValue(e,"i32")>>>0,e+=u,t.endIndex=_.getValue(e,"i32")>>>0,t}a(U,"unmarshalRange");function _e(e,t=d){y(t,e.startPosition),t+=M,y(t,e.oldEndPosition),t+=M,y(t,e.newEndPosition),t+=M,_.setValue(t,e.startIndex,"i32"),t+=u,_.setValue(t,e.oldEndIndex,"i32"),t+=u,_.setValue(t,e.newEndIndex,"i32")}a(_e,"marshalEdit");function ae(e){let t=_.getValue(e,"i32"),r=_.getValue(e+=u,"i32"),n=_.getValue(e+u,"i32");return{major_version:t,minor_version:r,patch_version:n}}a(ae,"unmarshalLanguageMetadata");var Ae=/^tree_sitter_\w+$/,N=class{static{a(this,"Language")}0=0;types;fields;constructor(t,r){T(t),this[0]=r,this.types=new Array(_._ts_language_symbol_count(this[0]));for(let n=0,s=this.types.length;n<s;n++)_._ts_language_symbol_type(this[0],n)<2&&(this.types[n]=_.UTF8ToString(_._ts_language_symbol_name(this[0],n)));this.fields=new Array(_._ts_language_field_count(this[0])+1);for(let n=0,s=this.fields.length;n<s;n++){let o=_._ts_language_field_name_for_id(this[0],n);o!==0?this.fields[n]=_.UTF8ToString(o):this.fields[n]=null}}get name(){let t=_._ts_language_name(this[0]);return t===0?null:_.UTF8ToString(t)}get abiVersion(){return _._ts_language_abi_version(this[0])}get metadata(){return _._ts_language_metadata_wasm(this[0]),_.getValue(d,"i32")===0?null:ae(d+u)}get fieldCount(){return this.fields.length-1}get stateCount(){return _._ts_language_state_count(this[0])}fieldIdForName(t){let r=this.fields.indexOf(t);return r!==-1?r:null}fieldNameForId(t){return this.fields[t]??null}idForNodeType(t,r){let n=_.lengthBytesUTF8(t),s=_._malloc(n+1);_.stringToUTF8(t,s,n+1);let o=_._ts_language_symbol_for_name(this[0],s,n,r?1:0);return _._free(s),o||null}get nodeTypeCount(){return _._ts_language_symbol_count(this[0])}nodeTypeForId(t){let r=_._ts_language_symbol_name(this[0],t);return r?_.UTF8ToString(r):null}nodeTypeIsNamed(t){return!!_._ts_language_type_is_named_wasm(this[0],t)}nodeTypeIsVisible(t){return!!_._ts_language_type_is_visible_wasm(this[0],t)}get supertypes(){_._ts_language_supertypes_wasm(this[0]);let t=_.getValue(d,"i32"),r=_.getValue(d+u,"i32"),n=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)n[o]=_.getValue(s,"i16"),s+=X}return n}subtypes(t){_._ts_language_subtypes_wasm(this[0],t);let r=_.getValue(d,"i32"),n=_.getValue(d+u,"i32"),s=new Array(r);if(r>0){let o=n;for(let l=0;l<r;l++)s[l]=_.getValue(o,"i16"),o+=X}return s}nextState(t,r){return _._ts_language_next_state(this[0],t,r)}lookaheadIterator(t){let r=_._ts_lookahead_iterator_new(this[0],t);return r?new x(p,r,this):null}static async load(t){let r;if(t instanceof Uint8Array||t instanceof WebAssembly.Module)r=t;else if(globalThis.process?.versions.node)r=await(await import("fs/promises")).readFile(t);else{let s=await fetch(t);if(!s.ok){let l=await s.text();throw new Error(`Language.load failed with status ${s.status}.
1
+ var Me=Object.defineProperty;var _=(e,t)=>Me(e,"name",{value:t,configurable:!0});var V=class{static{_(this,"Edit")}startPosition;oldEndPosition;newEndPosition;startIndex;oldEndIndex;newEndIndex;constructor({startIndex:t,oldEndIndex:r,newEndIndex:n,startPosition:a,oldEndPosition:o,newEndPosition:l}){this.startIndex=t>>>0,this.oldEndIndex=r>>>0,this.newEndIndex=n>>>0,this.startPosition=a,this.oldEndPosition=o,this.newEndPosition=l}editPoint(t,r){let n=r,a={...t};if(r>=this.oldEndIndex){n=this.newEndIndex+(r-this.oldEndIndex);let o=t.row;a.row=this.newEndPosition.row+(t.row-this.oldEndPosition.row),a.column=o===this.oldEndPosition.row?this.newEndPosition.column+(t.column-this.oldEndPosition.column):t.column}else r>this.startIndex&&(n=this.newEndIndex,a.row=this.newEndPosition.row,a.column=this.newEndPosition.column);return{point:a,index:n}}editRange(t){let r={startIndex:t.startIndex,startPosition:{...t.startPosition},endIndex:t.endIndex,endPosition:{...t.endPosition}};return t.endIndex>=this.oldEndIndex?t.endIndex!==Number.MAX_SAFE_INTEGER&&(r.endIndex=this.newEndIndex+(t.endIndex-this.oldEndIndex),r.endPosition={row:this.newEndPosition.row+(t.endPosition.row-this.oldEndPosition.row),column:t.endPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(t.endPosition.column-this.oldEndPosition.column):t.endPosition.column},r.endIndex<this.newEndIndex&&(r.endIndex=Number.MAX_SAFE_INTEGER,r.endPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):t.endIndex>this.startIndex&&(r.endIndex=this.startIndex,r.endPosition={...this.startPosition}),t.startIndex>=this.oldEndIndex?(r.startIndex=this.newEndIndex+(t.startIndex-this.oldEndIndex),r.startPosition={row:this.newEndPosition.row+(t.startPosition.row-this.oldEndPosition.row),column:t.startPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(t.startPosition.column-this.oldEndPosition.column):t.startPosition.column},r.startIndex<this.newEndIndex&&(r.startIndex=Number.MAX_SAFE_INTEGER,r.startPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):t.startIndex>this.startIndex&&(r.startIndex=this.startIndex,r.startPosition={...this.startPosition}),r}};var P=4,w=5*P,I=2*P,N=2*P+2*I,$={row:0,column:0},h=Symbol("INTERNAL");function v(e){if(e!==h)throw new Error("Illegal constructor")}_(v,"assertInternal");function x(e){return!!e&&typeof e.row=="number"&&typeof e.column=="number"}_(x,"isPoint");function q(e){s=e}_(q,"setModule");var s;function T(e){try{return new FinalizationRegistry(e)}catch(t){console.error("Unsupported FinalizationRegistry:",t);return}}_(T,"newFinalizer");var Q=T(e=>{s._ts_lookahead_iterator_delete(e)}),F=class{static{_(this,"LookaheadIterator")}0=0;language;positioned=!1;constructor(t,r,n){v(t),this[0]=r,this.language=n,Q?.register(this,r,this)}get currentTypeId(){return this.positioned?s._ts_lookahead_iterator_current_symbol(this[0]):null}get currentType(){let t=this.currentTypeId;return t===null?null:this.language.types[t]??s.UTF8ToString(s._ts_language_symbol_name(this.language[0],t))}delete(){Q?.unregister(this),s._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(t,r){return s._ts_lookahead_iterator_reset(this[0],t[0],r)?(this.language=t,this.positioned=!1,!0):!1}resetState(t){return s._ts_lookahead_iterator_reset_state(this[0],t)?(this.positioned=!1,!0):!1}[Symbol.iterator](){return{next:_(()=>{this.positioned=!!s._ts_lookahead_iterator_next(this[0]);let t=this.currentType;return t===null?{done:!0,value:""}:{done:!1,value:t}},"next")}}};var ee=T(e=>{s._ts_tree_cursor_delete_wasm(e)}),S=class e{static{_(this,"TreeCursor")}0=0;tree;editVersion=-1;_nodeTypeId=0;_fieldId=0;_startIndex=0;_endIndex=0;_flags=0;constructor(t,r,n){v(t),this[0]=n,this.tree=r,this.readNodeCache(),ee?.register(this,n,this)}copy(){let t=s._ts_tree_cursor_copy_wasm(this[0]);return new e(h,this.tree,t)}delete(){ee?.unregister(this),s._ts_tree_cursor_delete_wasm(this[0]),this[0]=0}get currentNode(){return s._ts_tree_cursor_current_node_wasm(this[0]),f(this.tree)}get currentFieldId(){return this._fieldId}get currentFieldName(){return this.tree.language.fields[this._fieldId]}get currentDepth(){return s._ts_tree_cursor_current_depth_wasm(this[0])}get currentDescendantIndex(){return s._ts_tree_cursor_current_descendant_index_wasm(this[0])}get nodeType(){return this.tree.language.types[this._nodeTypeId]||"ERROR"}get nodeTypeId(){return this._nodeTypeId}get nodeStateId(){return s._ts_tree_cursor_current_node_state_id_wasm(this[0])}get nodeId(){return s._ts_tree_cursor_current_node_id_wasm(this[0])}get nodeIsNamed(){return(this._flags&1)!==0}get nodeIsMissing(){return(this._flags&2)!==0}get nodeText(){return this.syncIndices(),B(this.tree,this._startIndex,this._endIndex,()=>this.startPosition)}get startPosition(){return s._ts_tree_cursor_start_position_wasm(this[0]),C(c)}get endPosition(){return s._ts_tree_cursor_end_position_wasm(this[0]),C(c)}get startIndex(){return this.syncIndices(),this._startIndex}get endIndex(){return this.syncIndices(),this._endIndex}gotoFirstChild(){return s._ts_tree_cursor_goto_first_child_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoLastChild(){return s._ts_tree_cursor_goto_last_child_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoParent(){return s._ts_tree_cursor_goto_parent_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoNextSibling(){return s._ts_tree_cursor_goto_next_sibling_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoPreviousSibling(){return s._ts_tree_cursor_goto_previous_sibling_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoDescendant(t){s._ts_tree_cursor_goto_descendant_wasm(this[0],t),this.readNodeCache()}gotoFirstChildForIndex(t){return s._ts_tree_cursor_goto_first_child_for_index_wasm(this[0],t)?(this.readNodeCache(),!0):!1}gotoFirstChildForPosition(t){return b(c,t),s._ts_tree_cursor_goto_first_child_for_position_wasm(this[0])?(this.readNodeCache(),!0):!1}reset(t){u(t),this.tree=t.tree,s._ts_tree_cursor_reset_wasm(this[0],t.tree[0]),this.readNodeCache()}resetTo(t){t!==this&&(this.tree=t.tree,s._ts_tree_cursor_reset_to_wasm(this[0],t[0]),this.readNodeCache())}readNodeCache(){let t=c>>>2,r=s.HEAPU32;this._nodeTypeId=r[t],this._fieldId=r[t+1],this._startIndex=r[t+2],this._endIndex=r[t+3],this._flags=r[t+4],this.editVersion=this.tree.editVersion}syncIndices(){this.editVersion!==this.tree.editVersion&&(this._startIndex=s._ts_tree_cursor_start_index_wasm(this[0])>>>0,this._endIndex=s._ts_tree_cursor_end_index_wasm(this[0])>>>0,this.editVersion=this.tree.editVersion)}};function B(e,t,r,n){if(e.sourceText!==void 0)return e.sourceText.slice(t,r);let a=n(),o=r-t,l=e.textCallback(t,a);if(l){for(t+=l.length;t<r;){let d=e.textCallback(t,a);if(d&&d.length>0)t+=d.length,l+=d;else break}t>r&&(l=l.slice(0,o))}return l??""}_(B,"getText");var te=T(e=>{s._ts_tree_delete(e)}),O=class e{static{_(this,"Tree")}0=0;textCallback;sourceText;editVersion=0;language;constructor(t,r,n,a,o){v(t),this[0]=r,this.language=n,this.textCallback=a,this.sourceText=o,te?.register(this,r,this)}copy(){let t=s._ts_tree_copy(this[0]);return new e(h,t,this.language,this.textCallback,this.sourceText)}delete(){te?.unregister(this),s._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return s._ts_tree_root_node_wasm(this[0]),f(this)}rootNodeWithOffset(t,r){let n=c+w;return s.HEAP32[n>>>2]=t,b(n+P,r),s._ts_tree_root_node_with_offset_wasm(this[0]),f(this)}edit(t){re(t),s._ts_tree_edit_wasm(this[0]),this.editVersion++}walk(){s._ts_tree_root_node_wasm(this[0]);let t=s._ts_tree_cursor_new_wasm(this[0]);return new S(h,this,t)}getChangedRanges(t){if(!(t instanceof e))throw new TypeError("Argument must be a Tree");return s._ts_tree_get_changed_ranges_wasm(this[0],t[0]),U()}getIncludedRanges(){return s._ts_tree_included_ranges_wasm(this[0]),U()}};var W=class{static{_(this,"Node")}0=0;_children;_namedChildren;constructor(t,{id:r,tree:n,startIndex:a,startPosition:o,other:l}){v(t),this[0]=l,this.id=r,this.tree=n,this.startIndex=a,this.startPosition=o}id;startIndex;startPosition;tree;get typeId(){return u(this),s._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return u(this),s._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get isNamed(){return u(this),s._ts_node_is_named_wasm(this.tree[0])===1}get isExtra(){return u(this),s._ts_node_is_extra_wasm(this.tree[0])===1}get isError(){return u(this),s._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return u(this),s._ts_node_is_missing_wasm(this.tree[0])===1}get hasChanges(){return u(this),s._ts_node_has_changes_wasm(this.tree[0])===1}get hasError(){return u(this),s._ts_node_has_error_wasm(this.tree[0])===1}get endIndex(){return u(this),s._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return u(this),s._ts_node_end_point_wasm(this.tree[0]),C(c)}get text(){return B(this.tree,this.startIndex,this.endIndex,()=>this.startPosition)}get parseState(){return u(this),s._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return u(this),s._ts_node_next_parse_state_wasm(this.tree[0])}equals(t){return this.tree===t.tree&&this.id===t.id}child(t){return u(this),s._ts_node_child_wasm(this.tree[0],t),f(this.tree)}namedChild(t){return u(this),s._ts_node_named_child_wasm(this.tree[0],t),f(this.tree)}childForFieldId(t){return u(this),s._ts_node_child_by_field_id_wasm(this.tree[0],t),f(this.tree)}childForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1?this.childForFieldId(r):null}fieldNameForChild(t){u(this);let r=s._ts_node_field_name_for_child_wasm(this.tree[0],t);return r?s.AsciiToString(r):null}fieldNameForNamedChild(t){u(this);let r=s._ts_node_field_name_for_named_child_wasm(this.tree[0],t);return r?s.AsciiToString(r):null}childrenForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1&&r!==0?this.childrenForFieldId(r):[]}childrenForFieldId(t){return u(this),s._ts_node_children_by_field_id_wasm(this.tree[0],t),L(this.tree,!0)}firstChildForIndex(t){u(this);let r=c+w;return s.HEAP32[r>>>2]=t,s._ts_node_first_child_for_byte_wasm(this.tree[0]),f(this.tree)}firstNamedChildForIndex(t){u(this);let r=c+w;return s.HEAP32[r>>>2]=t,s._ts_node_first_named_child_for_byte_wasm(this.tree[0]),f(this.tree)}get childCount(){return u(this),s._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return u(this),s._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){return this._children||(u(this),s._ts_node_children_wasm(this.tree[0]),this._children=L(this.tree)),this._children}get namedChildren(){return this._namedChildren||(u(this),s._ts_node_named_children_wasm(this.tree[0]),this._namedChildren=L(this.tree)),this._namedChildren}descendantsOfType(t,r=$,n=$){Array.isArray(t)||(t=[t]);let a=[],o=this.tree.language.types;for(let g=0,p=o.length;g<p;g++)t.includes(o[g])&&a.push(g);t.includes("ERROR")&&a.push(65535);let l=s._malloc(P*a.length),d=l>>>2;for(let g=0,p=a.length;g<p;g++)s.HEAPU32[d+g]=a[g];u(this),s._ts_node_descendants_of_type_wasm(this.tree[0],l,a.length,r.row,r.column,n.row,n.column);let m=L(this.tree,!0,!0);return s._free(l),m}get nextSibling(){return u(this),s._ts_node_next_sibling_wasm(this.tree[0]),f(this.tree)}get previousSibling(){return u(this),s._ts_node_prev_sibling_wasm(this.tree[0]),f(this.tree)}get nextNamedSibling(){return u(this),s._ts_node_next_named_sibling_wasm(this.tree[0]),f(this.tree)}get previousNamedSibling(){return u(this),s._ts_node_prev_named_sibling_wasm(this.tree[0]),f(this.tree)}get descendantCount(){return u(this),s._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return u(this),s._ts_node_parent_wasm(this.tree[0]),f(this.tree)}childWithDescendant(t){return t.tree!==this.tree?null:(u(this),u(t,1),s._ts_node_child_with_descendant_wasm(this.tree[0]),f(this.tree))}descendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");u(this);let n=c+w>>>2;return s.HEAP32[n]=t,s.HEAP32[n+1]=r,s._ts_node_descendant_for_index_wasm(this.tree[0]),f(this.tree)}namedDescendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");u(this);let n=c+w>>>2;return s.HEAP32[n]=t,s.HEAP32[n+1]=r,s._ts_node_named_descendant_for_index_wasm(this.tree[0]),f(this.tree)}descendantForPosition(t,r=t){if(!x(t)||!x(r))throw new Error("Arguments must be {row, column} objects");u(this);let n=c+w;return b(n,t),b(n+I,r),s._ts_node_descendant_for_position_wasm(this.tree[0]),f(this.tree)}namedDescendantForPosition(t,r=t){if(!x(t)||!x(r))throw new Error("Arguments must be {row, column} objects");u(this);let n=c+w;return b(n,t),b(n+I,r),s._ts_node_named_descendant_for_position_wasm(this.tree[0]),f(this.tree)}walk(){u(this);let t=s._ts_tree_cursor_new_wasm(this.tree[0]);return new S(h,this.tree,t)}edit(t){let{point:r,index:n}=t.editPoint(this.startPosition,this.startIndex);this.startPosition=r,this.startIndex=n}toString(){u(this);let t=s._ts_node_to_string_wasm(this.tree[0]),r=s.AsciiToString(t);return s._ts_free_wasm(t),r}};function u(e,t=0){let r=c+t*w>>>2,n=s.HEAP32;n[r]=e.id,n[r+1]=e.startIndex,n[r+2]=e.startPosition.row,n[r+3]=e.startPosition.column,n[r+4]=e[0]}_(u,"marshalNode");function f(e,t=c){let r=t>>>2,n=s.HEAP32,a=n[r];if(a===0)return null;let o=s.HEAPU32;return new W(h,{id:a,tree:e,startIndex:o[r+1],startPosition:{row:o[r+2],column:o[r+3]},other:n[r+4]})}_(f,"unmarshalNode");function b(e,t){let r=e>>>2,n=s.HEAP32;n[r]=t.row,n[r+1]=t.column}_(b,"marshalPoint");function C(e){let t=e>>>2,r=s.HEAPU32;return{row:r[t],column:r[t+1]}}_(C,"unmarshalPoint");function ne(e,t){let r=e>>>2,n=s.HEAP32;n[r]=t.startPosition.row,n[r+1]=t.startPosition.column,n[r+2]=t.endPosition.row,n[r+3]=t.endPosition.column,n[r+4]=t.startIndex,n[r+5]=t.endIndex}_(ne,"marshalRange");function Pe(e){let t=e>>>2,r=s.HEAPU32;return{startPosition:{row:r[t],column:r[t+1]},endPosition:{row:r[t+2],column:r[t+3]},startIndex:r[t+4],endIndex:r[t+5]}}_(Pe,"unmarshalRange");function re(e,t=c){b(t,e.startPosition),t+=I,b(t,e.oldEndPosition),t+=I,b(t,e.newEndPosition);let r=t+I>>>2,n=s.HEAP32;n[r]=e.startIndex,n[r+1]=e.oldEndIndex,n[r+2]=e.newEndIndex}_(re,"marshalEdit");function se(e){let t=e>>>2,r=s.HEAP32;return{major_version:r[t],minor_version:r[t+1],patch_version:r[t+2]}}_(se,"unmarshalLanguageMetadata");function Z(){let e=c>>>2,t=s.HEAPU32[e],r=s.HEAPU32[e+1],n=new Array(t);if(t>0){let a=r>>>1,o=s.HEAPU16;for(let l=0;l<t;l++)n[l]=o[a+l]}return n}_(Z,"unmarshalSymbols");function U(e=!0){return _e(N,Pe,e,!1)}_(U,"unmarshalRanges");function L(e,t=!1,r=!1){return _e(w,n=>f(e,n),t,r)}_(L,"unmarshalNodeArray");function _e(e,t,r,n){let a=c>>>2,o=s.HEAPU32[a],l=s.HEAP32[a+1],d=new Array(o);for(let m=0,g=l;m<o;m++,g+=e)d[m]=t(g);return(o>0||n)&&(r?s._ts_free_wasm(l):s._free(l)),d}_(_e,"unmarshalArray");var Ie=/^tree_sitter_\w+$/,E=class{static{_(this,"Language")}0=0;types;fields;constructor(t,r){v(t),this[0]=r,this.types=new Array(s._ts_language_symbol_count(this[0]));for(let n=0,a=this.types.length;n<a;n++)s._ts_language_symbol_type(this[0],n)<2&&(this.types[n]=s.UTF8ToString(s._ts_language_symbol_name(this[0],n)));this.fields=new Array(s._ts_language_field_count(this[0])+1);for(let n=0,a=this.fields.length;n<a;n++){let o=s._ts_language_field_name_for_id(this[0],n);o!==0?this.fields[n]=s.UTF8ToString(o):this.fields[n]=null}}get name(){let t=s._ts_language_name(this[0]);return t===0?null:s.UTF8ToString(t)}get abiVersion(){return s._ts_language_abi_version(this[0])}get metadata(){return s._ts_language_metadata_wasm(this[0]),s.HEAP32[c>>>2]===0?null:se(c+P)}get fieldCount(){return this.fields.length-1}get stateCount(){return s._ts_language_state_count(this[0])}fieldIdForName(t){let r=this.fields.indexOf(t);return r!==-1?r:null}fieldNameForId(t){return this.fields[t]??null}idForNodeType(t,r){let n=s.lengthBytesUTF8(t),a=s._malloc(n+1);s.stringToUTF8(t,a,n+1);let o=s._ts_language_symbol_for_name(this[0],a,n,r?1:0);return s._free(a),o||null}get nodeTypeCount(){return s._ts_language_symbol_count(this[0])}nodeTypeForId(t){let r=s._ts_language_symbol_name(this[0],t);return r?s.UTF8ToString(r):null}nodeTypeIsNamed(t){return!!s._ts_language_type_is_named_wasm(this[0],t)}nodeTypeIsVisible(t){return!!s._ts_language_type_is_visible_wasm(this[0],t)}get supertypes(){return s._ts_language_supertypes_wasm(this[0]),Z()}subtypes(t){return s._ts_language_subtypes_wasm(this[0],t),Z()}nextState(t,r){return s._ts_language_next_state(this[0],t,r)}lookaheadIterator(t){let r=s._ts_lookahead_iterator_new(this[0],t);return r?new F(h,r,this):null}static async load(t){let r;if(t instanceof Uint8Array||t instanceof WebAssembly.Module)r=t;else if(globalThis.process?.versions.node)r=await(await import("fs/promises")).readFile(t);else{let a=await fetch(t);if(!a.ok){let l=await a.text();throw new Error(`Language.load failed with status ${a.status}.
2
2
 
3
- ${l}`)}let o=s.clone();try{r=await WebAssembly.compileStreaming(s)}catch(l){console.error("wasm streaming compile failed:",l),console.error("falling back to ArrayBuffer instantiation"),r=new Uint8Array(await o.arrayBuffer())}}let n=await _.loadWebAssemblyModule(r,{loadAsync:!0});return ie(n,{sync:!1})}static loadSync(t){let r=_.loadWebAssemblyModule(t,{loadAsync:!1});return ie(r,{sync:!0})}};function ie(e,{sync:t}){let r=Object.keys(e),n=r.find(o=>Ae.test(o)&&!o.includes("external_scanner_"));if(!n)throw console.log(`Couldn't find language function in Wasm file. Symbols:
4
- ${JSON.stringify(r,null,2)}`),new Error(`Language.${t?"loadSync":"load"} failed: no language function found in Wasm file`);let s=e[n]();return new N(p,s)}a(ie,"loadFromWasmExports");async function Ee(moduleArg={}){var moduleRtn,Module=moduleArg,ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&process.versions?.node&&process.type!="renderer";if(ENVIRONMENT_IS_NODE){let{createRequire:e}=await import("module");var require=e(import.meta.url)}Module.currentProgressCallback=null,Module.currentLogCallback=null,Module.currentParseCallback=null,Module.treeSitterSetMemoryLimit=function(e){return e?wasmMemory.buffer.byteLength>e||Module.treeSitterOriginalMemoryGrow?!1:(Module.treeSitterOriginalMemoryGrow=wasmMemory.grow,wasmMemory.grow=function(t){if(wasmMemory.buffer.byteLength+t*65536>e)throw new RangeError("Parse memory limit exceeded");return Module.treeSitterOriginalMemoryGrow.call(wasmMemory,t)},!0):(Module.treeSitterOriginalMemoryGrow&&(wasmMemory.grow=Module.treeSitterOriginalMemoryGrow,Module.treeSitterOriginalMemoryGrow=null),!0)};var arguments_=[],thisProgram="./this.program",quit_=a((e,t)=>{throw t},"quit_"),_scriptName=import.meta.url,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}a(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");_scriptName.startsWith("file:")&&(scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"),readBinary=a(e=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e);return t},"readBinary"),readAsync=a(async(e,t=!0)=>{e=isFileURI(e)?new URL(e):e;var r=fs.readFileSync(e,t?void 0:"utf8");return r},"readAsync"),process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=a((e,t)=>{throw process.exitCode=e,t},"quit_")}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}ENVIRONMENT_IS_WORKER&&(readBinary=a(e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},"readBinary")),readAsync=a(async e=>{if(isFileURI(e))return new Promise((r,n)=>{var s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="arraybuffer",s.onload=()=>{if(s.status==200||s.status==0&&s.response){r(s.response);return}n(s.status)},s.onerror=n,s.send(null)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)},"readAsync")}var out=console.log.bind(console),err=console.error.bind(console),dynamicLibraries=[],wasmBinary,ABORT=!1,EXITSTATUS,isFileURI=a(e=>e.startsWith("file://"),"isFileURI"),readyPromiseResolve,readyPromiseReject,wasmMemory,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP64,HEAPU64,HEAP_DATA_VIEW,runtimeInitialized=!1;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e),Module.HEAP64=HEAP64=new BigInt64Array(e),Module.HEAPU64=HEAPU64=new BigUint64Array(e),Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(e),LE_HEAP_UPDATE()}a(updateMemoryViews,"updateMemoryViews");function initMemory(){if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var e=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:e/65536,maximum:32768})}updateMemoryViews()}a(initMemory,"initMemory");var __RELOC_FUNCS__=[];function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(onPreRuns)}a(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),wasmExports.__wasm_call_ctors(),callRuntimeCallbacks(onPostCtors)}a(initRuntime,"initRuntime");function preMain(){}a(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(onPostRuns)}a(postRun,"postRun");function abort(e){Module.onAbort?.(e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject?.(t),t}a(abort,"abort");var wasmBinaryFile;function findWasmBinary(){return Module.locateFile?locateFile("web-tree-sitter.wasm"):new URL("web-tree-sitter.wasm",import.meta.url).href}a(findWasmBinary,"findWasmBinary");function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}a(getBinarySync,"getBinarySync");async function getWasmBinary(e){if(!wasmBinary)try{var t=await readAsync(e);return new Uint8Array(t)}catch{}return getBinarySync(e)}a(getWasmBinary,"getWasmBinary");async function instantiateArrayBuffer(e,t){try{var r=await getWasmBinary(e),n=await WebAssembly.instantiate(r,t);return n}catch(s){err(`failed to asynchronously prepare wasm: ${s}`),abort(s)}}a(instantiateArrayBuffer,"instantiateArrayBuffer");async function instantiateAsync(e,t,r){if(!e&&!isFileURI(t)&&!ENVIRONMENT_IS_NODE)try{var n=fetch(t,{credentials:"same-origin"}),s=await WebAssembly.instantiateStreaming(n,r);return s}catch(o){err(`wasm streaming compile failed: ${o}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(t,r)}a(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}a(getWasmImports,"getWasmImports");async function createWasm(){function e(o,l){wasmExports=o.exports,wasmExports=relocateExports(wasmExports,1024);var c=getDylinkMetadata(l);c.neededDynlibs&&(dynamicLibraries=c.neededDynlibs.concat(dynamicLibraries));let f={malloc:wasmExports.ts_scanner_malloc_wasm,calloc:wasmExports.ts_scanner_calloc_wasm,realloc:wasmExports.ts_scanner_realloc_wasm};return Object.assign(wasmImports,f),updateGOT(f,!0),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),assignWasmExports(wasmExports),wasmExports}a(e,"receiveInstance");function t(o){return e(o.instance,o.module)}a(t,"receiveInstantiationResult");var r=getWasmImports();if(Module.instantiateWasm)return new Promise((o,l)=>{Module.instantiateWasm(r,(c,f)=>{o(e(c,f))})});wasmBinaryFile??=findWasmBinary();var n=await instantiateAsync(wasmBinary,wasmBinaryFile,r),s=t(n);return s}a(createWasm,"createWasm");class ExitStatus{static{a(this,"ExitStatus")}name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var r=GOT[t];return r||(r=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(r.required=!0),r}},LE_ATOMICS_NATIVE_BYTE_ORDER=[],LE_HEAP_LOAD_F32=a(e=>HEAP_DATA_VIEW.getFloat32(e,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=a(e=>HEAP_DATA_VIEW.getFloat64(e,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=a(e=>HEAP_DATA_VIEW.getInt16(e,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=a(e=>HEAP_DATA_VIEW.getInt32(e,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_I64=a(e=>HEAP_DATA_VIEW.getBigInt64(e,!0),"LE_HEAP_LOAD_I64"),LE_HEAP_LOAD_U32=a(e=>HEAP_DATA_VIEW.getUint32(e,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=a((e,t)=>HEAP_DATA_VIEW.setFloat32(e,t,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=a((e,t)=>HEAP_DATA_VIEW.setFloat64(e,t,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=a((e,t)=>HEAP_DATA_VIEW.setInt16(e,t,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=a((e,t)=>HEAP_DATA_VIEW.setInt32(e,t,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_I64=a((e,t)=>HEAP_DATA_VIEW.setBigInt64(e,t,!0),"LE_HEAP_STORE_I64"),LE_HEAP_STORE_U32=a((e,t)=>HEAP_DATA_VIEW.setUint32(e,t,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=a(e=>{for(;e.length>0;)e.shift()(Module)},"callRuntimeCallbacks"),onPostRuns=[],addOnPostRun=a(e=>onPostRuns.push(e),"addOnPostRun"),onPreRuns=[],addOnPreRun=a(e=>onPreRuns.push(e),"addOnPreRun"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,findStringEnd=a((e,t,r,n)=>{var s=t+r;if(n)return s;for(;e[t]&&!(t>=s);)++t;return t},"findStringEnd"),UTF8ArrayToString=a((e,t=0,r,n)=>{var s=findStringEnd(e,t,r,n);if(s-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,s));for(var o="";t<s;){var l=e[t++];if(!(l&128)){o+=String.fromCharCode(l);continue}var c=e[t++]&63;if((l&224)==192){o+=String.fromCharCode((l&31)<<6|c);continue}var f=e[t++]&63;if((l&240)==224?l=(l&15)<<12|c<<6|f:l=(l&7)<<18|c<<12|f<<6|e[t++]&63,l<65536)o+=String.fromCharCode(l);else{var E=l-65536;o+=String.fromCharCode(55296|E>>10,56320|E&1023)}}return o},"UTF8ArrayToString"),getDylinkMetadata=a(e=>{var t=0,r=0;function n(){return e[t++]}a(n,"getU8");function s(){for(var I=0,k=1;;){var Q=e[t++];if(I+=(Q&127)*k,k*=128,!(Q&128))break}return I}a(s,"getLEB");function o(){var I=s();return t+=I,UTF8ArrayToString(e,t-I,I)}a(o,"getString");function l(){for(var I=s(),k=[];I--;)k.push(o());return k}a(l,"getStringList");function c(I,k){if(I)throw new Error(k)}if(a(c,"failIf"),e instanceof WebAssembly.Module){var f=WebAssembly.Module.customSections(e,"dylink.0");c(f.length===0,"need dylink section"),e=new Uint8Array(f[0]),r=e.length}else{var E=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),w=E[0]==1836278016||E[0]==6386541;c(!w,"need to see wasm magic number"),c(e[8]!==0,"need the dylink section to be first"),t=9;var v=s();r=t+v;var me=o();c(me!=="dylink.0")}for(var P={neededDynlibs:[],tlsExports:new Set,weakImports:new Set,runtimePaths:[]},ce=1,ge=2,fe=3,he=4,we=5,be=256,pe=3,ye=1;t<r;){var O=n(),ve=s();if(O===ce)P.memorySize=s(),P.memoryAlign=s(),P.tableSize=s(),P.tableAlign=s();else if(O===ge)P.neededDynlibs=l();else if(O===fe)for(var j=s();j--;){var z=o(),Z=s();Z&be&&P.tlsExports.add(z)}else if(O===he)for(var j=s();j--;){var ke=o(),z=o(),Z=s();(Z&pe)==ye&&P.weakImports.add(z)}else O===we?P.runtimePaths=l():t+=ve}return P},"getDylinkMetadata");function getValue(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":return HEAP8[e];case"i8":return HEAP8[e];case"i16":return LE_HEAP_LOAD_I16((e>>1)*2);case"i32":return LE_HEAP_LOAD_I32((e>>2)*4);case"i64":return LE_HEAP_LOAD_I64((e>>3)*8);case"float":return LE_HEAP_LOAD_F32((e>>2)*4);case"double":return LE_HEAP_LOAD_F64((e>>3)*8);case"*":return LE_HEAP_LOAD_U32((e>>2)*4);default:abort(`invalid type for getValue: ${t}`)}}a(getValue,"getValue");var newDSO=a((e,t,r)=>{var n={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=n,t!=null&&(LDSO.loadedLibsByHandle[t]=n),n},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=82672,alignMemory=a((e,t)=>Math.ceil(e/t)*t,"alignMemory"),getMemory=a(e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,r=t+alignMemory(e,16);return ___heap_base=r,GOT.__heap_base.value=r,t},"getMemory"),isInternalSym=a(e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),"isInternalSym"),uleb128EncodeWithLen=a(e=>{let t=e.length;return[t%128|128,t>>7,...e]},"uleb128EncodeWithLen"),wasmTypeCodes={i:127,p:127,j:126,f:125,d:124,e:111},generateTypePack=a(e=>uleb128EncodeWithLen(Array.from(e,t=>{var r=wasmTypeCodes[t];return r})),"generateTypePack"),convertJsFunctionToWasm=a((e,t)=>{var r=Uint8Array.of(0,97,115,109,1,0,0,0,1,...uleb128EncodeWithLen([1,96,...generateTypePack(t.slice(1)),...generateTypePack(t[0]==="v"?"":t[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),n=new WebAssembly.Module(r),s=new WebAssembly.Instance(n,{e:{f:e}}),o=s.exports.f;return o},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:47,element:"anyfunc"}),getWasmTableEntry=a(e=>{var t=wasmTableMirror[e];return t||(wasmTableMirror[e]=t=wasmTable.get(e)),t},"getWasmTableEntry"),updateTableMap=a((e,t)=>{if(functionsInTableMap)for(var r=e;r<e+t;r++){var n=getWasmTableEntry(r);n&&functionsInTableMap.set(n,r)}},"updateTableMap"),functionsInTableMap,getFunctionAddress=a(e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=a(()=>freeTableIndexes.length?freeTableIndexes.pop():wasmTable.grow(1),"getEmptyTableSlot"),setWasmTableEntry=a((e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},"setWasmTableEntry"),addFunction=a((e,t)=>{var r=getFunctionAddress(e);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,e)}catch(o){if(!(o instanceof TypeError))throw o;var s=convertJsFunctionToWasm(e,t);setWasmTableEntry(n,s)}return functionsInTableMap.set(e,n),n},"addFunction"),updateGOT=a((e,t)=>{for(var r in e)if(!isInternalSym(r)){var n=e[r];GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(t||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},"updateGOT"),relocateExports=a((e,t,r)=>{var n={};for(var s in e){var o=e[s];typeof o=="object"&&(o=o.value),typeof o=="number"&&(o+=t),n[s]=o}return updateGOT(n,r),n},"relocateExports"),isSymbolDefined=a(e=>{var t=wasmImports[e];return!(!t||t.stub)},"isSymbolDefined"),dynCall=a((e,t,r=[],n=!1)=>{var s=getWasmTableEntry(t),o=s(...r);function l(c){return c}return a(l,"convert"),o},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(e=>__emscripten_stack_restore(e),"stackRestore"),createInvokeFunction=a(e=>(t,...r)=>{var n=stackSave();try{return dynCall(e,t,r)}catch(s){if(stackRestore(n),s!==s+0)throw s;if(_setThrew(1,0),e[0]=="j")return 0n}},"createInvokeFunction"),resolveGlobalSymbol=a((e,t=!1)=>{var r;return isSymbolDefined(e)?r=wasmImports[e]:e.startsWith("invoke_")&&(r=wasmImports[e]=createInvokeFunction(e.split("_")[1])),{sym:r,name:e}},"resolveGlobalSymbol"),onPostCtors=[],addOnPostCtor=a(e=>onPostCtors.push(e),"addOnPostCtor"),UTF8ToString=a((e,t,r)=>e?UTF8ArrayToString(HEAPU8,e,t,r):"","UTF8ToString"),loadWebAssemblyModule=a((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);function loadModule(){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize)),metadata.tableSize&&wasmTable.grow(metadata.tableSize);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}a(resolveSymbol,"resolveSymbol");var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub){var r=wasmImports[t];return r}if(!(t in e)){var n;e[t]=(...s)=>(n||=resolveSymbol(t),n(...s))}return e[t]}},proxy=new Proxy({},proxyHandler);currentModuleWeakSymbols=metadata.weakImports;var info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(a(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replace("*",""))}}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}a(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():addOnPostCtor(init)),moduleExports}if(a(postInstantiation,"postInstantiation"),flags.loadAsync)return(async()=>{var e;return binary instanceof WebAssembly.Module?e=await WebAssembly.instantiate(binary,info):{module:binary,instance:e}=await WebAssembly.instantiate(binary,info),postInstantiation(binary,e)})();var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return a(loadModule,"loadModule"),flags={...flags,rpath:{parentLibPath:libName,paths:metadata.runtimePaths}},flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=a((e,t)=>{for(var[r,n]of Object.entries(e)){let s=a(l=>{isSymbolDefined(l)||(wasmImports[l]=n)},"setImport");s(r);let o="__main_argc_argv";r=="main"&&s(o),r==o&&s("main")}},"mergeLibSymbols"),asyncLoad=a(async e=>{var t=await readAsync(e);return new Uint8Array(t)},"asyncLoad");function loadDynamicLibrary(e,t={global:!0,nodelete:!0},r,n){var s=LDSO.loadedLibsByName[e];if(s)return t.global?s.global||(s.global=!0,mergeLibSymbols(s.exports,e)):r&&Object.assign(r,s.exports),t.nodelete&&s.refcount!==1/0&&(s.refcount=1/0),s.refcount++,n&&(LDSO.loadedLibsByHandle[n]=s),t.loadAsync?Promise.resolve(!0):!0;s=newDSO(e,n,"loading"),s.refcount=t.nodelete?1/0:1,s.global=t.global;function o(){if(n){var f=LE_HEAP_LOAD_U32((n+28>>2)*4),E=LE_HEAP_LOAD_U32((n+32>>2)*4);if(f&&E){var w=HEAP8.slice(f,f+E);return t.loadAsync?Promise.resolve(w):w}}var v=locateFile(e);if(t.loadAsync)return asyncLoad(v);if(!readBinary)throw new Error(`${v}: file not found, and synchronous loading of external files is not available`);return readBinary(v)}a(o,"loadLibData");function l(){return t.loadAsync?o().then(f=>loadWebAssemblyModule(f,t,e,r,n)):loadWebAssemblyModule(o(),t,e,r,n)}a(l,"getExports");function c(f){s.global?mergeLibSymbols(f,e):r&&Object.assign(r,f),s.exports=f}return a(c,"moduleLoaded"),t.loadAsync?l().then(f=>(c(f),!0)):(c(l()),!0)}a(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=a(()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var r=resolveGlobalSymbol(e,!0).sym;if(!r&&!t.required)continue;if(typeof r=="function")t.value=addFunction(r,r.sig);else if(typeof r=="number")t.value=r;else throw new Error(`bad export type for '${e}': ${typeof r}`)}},"reportUndefinedSymbols"),runDependencies=0,dependenciesFulfilled=null,removeRunDependency=a(e=>{if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&dependenciesFulfilled){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}},"removeRunDependency"),addRunDependency=a(e=>{runDependencies++,Module.monitorRunDependencies?.(runDependencies)},"addRunDependency"),loadDylibs=a(async()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs");for(var e of dynamicLibraries)await loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0});reportUndefinedSymbols(),removeRunDependency("loadDylibs")},"loadDylibs"),noExitRuntime=!0;function setValue(e,t,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":HEAP8[e]=t;break;case"i8":HEAP8[e]=t;break;case"i16":LE_HEAP_STORE_I16((e>>1)*2,t);break;case"i32":LE_HEAP_STORE_I32((e>>2)*4,t);break;case"i64":LE_HEAP_STORE_I64((e>>3)*8,BigInt(t));break;case"float":LE_HEAP_STORE_F32((e>>2)*4,t);break;case"double":LE_HEAP_STORE_F64((e>>3)*8,t);break;case"*":LE_HEAP_STORE_U32((e>>2)*4,t);break;default:abort(`invalid type for setValue: ${r}`)}}a(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=82672,___stack_low=17136,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},82672),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=a(()=>abort(""),"__abort_js");__abort_js.sig="v";var runtimeKeepaliveCounter=0,__emscripten_runtime_keepalive_clear=a(()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0},"__emscripten_runtime_keepalive_clear");__emscripten_runtime_keepalive_clear.sig="v";var __emscripten_throw_longjmp=a(()=>{throw 1/0},"__emscripten_throw_longjmp");__emscripten_throw_longjmp.sig="v";var timers={},handleException=a(e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},"handleException"),keepRuntimeAlive=a(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=a(e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))},"_proc_exit");_proc_exit.sig="vi";var exitJS=a((e,t)=>{EXITSTATUS=e,_proc_exit(e)},"exitJS"),_exit=exitJS;_exit.sig="vi";var maybeExit=a(()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}},"maybeExit"),callUserCallback=a(e=>{if(!ABORT)try{e(),maybeExit()}catch(t){handleException(t)}},"callUserCallback"),_emscripten_get_now=a(()=>performance.now(),"_emscripten_get_now");_emscripten_get_now.sig="d";var __setitimer_js=a((e,t)=>{if(timers[e]&&(clearTimeout(timers[e].id),delete timers[e]),!t)return 0;var r=setTimeout(()=>{delete timers[e],callUserCallback(()=>__emscripten_timeout(e,_emscripten_get_now()))},t);return timers[e]={id:r,timeout_ms:t},0},"__setitimer_js");__setitimer_js.sig="iid";var getHeapMax=a(()=>2147483648,"getHeapMax"),growMemory=a(e=>{var t=wasmMemory.buffer.byteLength,r=(e-t+65535)/65536|0;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=a(e=>{var t=HEAPU8.length;e>>>=0;var r=getHeapMax();if(e>r)return!1;for(var n=1;n<=4;n*=2){var s=t*(1+0/n);s=Math.min(s,e+100663296);var o=Math.min(r,alignMemory(Math.max(e,s),65536)),l=growMemory(o);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";function _tree_sitter_log_callback(e,t){if(Module.currentLogCallback){let r=UTF8ToString(t);Module.currentLogCallback(r,e!==0)}}a(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(e,t,r,n,s){let l=Module.currentParseCallback(t,{row:r,column:n});typeof l=="string"?(setValue(s,l.length,"i32"),stringToUTF16(l,e,10240)):setValue(s,0,"i32")}a(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");function _tree_sitter_progress_callback(e,t){return Module.currentProgressCallback?Module.currentProgressCallback({currentOffset:e,hasError:t!==0})===!0:!1}a(_tree_sitter_progress_callback,"_tree_sitter_progress_callback");var lengthBytesUTF8=a(e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},"lengthBytesUTF8"),stringToUTF8Array=a((e,t,r,n)=>{if(!(n>0))return 0;for(var s=r,o=r+n-1,l=0;l<e.length;++l){var c=e.codePointAt(l);if(c<=127){if(r>=o)break;t[r++]=c}else if(c<=2047){if(r+1>=o)break;t[r++]=192|c>>6,t[r++]=128|c&63}else if(c<=65535){if(r+2>=o)break;t[r++]=224|c>>12,t[r++]=128|c>>6&63,t[r++]=128|c&63}else{if(r+3>=o)break;t[r++]=240|c>>18,t[r++]=128|c>>12&63,t[r++]=128|c>>6&63,t[r++]=128|c&63,l++}}return t[r]=0,r-s},"stringToUTF8Array"),stringToUTF8=a((e,t,r)=>stringToUTF8Array(e,HEAPU8,t,r),"stringToUTF8"),stackAlloc=a(e=>__emscripten_stack_alloc(e),"stackAlloc"),stringToUTF8OnStack=a(e=>{var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8(e,r,t),r},"stringToUTF8OnStack"),AsciiToString=a(e=>{for(var t="";;){var r=HEAPU8[e++];if(!r)return t;t+=String.fromCharCode(r)}},"AsciiToString"),stringToUTF16=a((e,t,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var n=t,s=r<e.length*2?r/2:e.length,o=0;o<s;++o){var l=e.charCodeAt(o);LE_HEAP_STORE_I16((t>>1)*2,l),t+=2}return LE_HEAP_STORE_I16((t>>1)*2,0),t-n},"stringToUTF16");LE_ATOMICS_NATIVE_BYTE_ORDER=new Int8Array(new Int16Array([1]).buffer)[0]===1?[(e=>e),(e=>e),void 0,(e=>e)]:[(e=>e),(e=>((e&65280)<<8|(e&255)<<24)>>16),void 0,(e=>e>>24&255|e>>8&65280|(e&65280)<<8|(e&255)<<24)];function LE_HEAP_UPDATE(){HEAPU16.unsigned=(e=>e&65535),HEAPU32.unsigned=(e=>e>>>0)}if(a(LE_HEAP_UPDATE,"LE_HEAP_UPDATE"),initMemory(),Module.noExitRuntime&&(noExitRuntime=Module.noExitRuntime),Module.print&&(out=Module.print),Module.printErr&&(err=Module.printErr),Module.dynamicLibraries&&(dynamicLibraries=Module.dynamicLibraries),Module.wasmBinary&&(wasmBinary=Module.wasmBinary),Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.shift()();Module.setValue=setValue,Module.getValue=getValue,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,Module.loadWebAssemblyModule=loadWebAssemblyModule,Module.LE_HEAP_STORE_I64=LE_HEAP_STORE_I64;var ASM_CONSTS={},_free,_ts_range_edit,_ts_language_symbol_count,_ts_language_state_count,_ts_language_abi_version,_ts_language_name,_ts_language_field_count,_ts_language_next_state,_ts_language_symbol_name,_ts_language_symbol_for_name,_strncmp,_ts_language_symbol_type,_ts_language_field_name_for_id,_ts_lookahead_iterator_new,_ts_lookahead_iterator_delete,_ts_lookahead_iterator_reset_state,_ts_lookahead_iterator_reset,_ts_lookahead_iterator_next,_ts_lookahead_iterator_current_symbol,_ts_point_edit,_ts_parser_delete,_ts_parser_set_language,_ts_parser_reset,_ts_parser_set_included_ranges,_memcmp,_ts_tree_copy,_ts_tree_delete,_malloc,_calloc,_realloc,_ts_init,_ts_free_wasm,_ts_scanner_malloc_wasm,_ts_scanner_calloc_wasm,_ts_scanner_realloc_wasm,_ts_parser_new_wasm,_ts_parser_enable_logger_wasm,_ts_parser_parse_wasm,_ts_parser_parse_limited_wasm,_ts_parser_abort_limited_wasm,_ts_parser_included_ranges_wasm,_ts_language_type_is_named_wasm,_ts_language_type_is_visible_wasm,_ts_language_metadata_wasm,_ts_language_supertypes_wasm,_ts_language_subtypes_wasm,_ts_tree_root_node_wasm,_ts_tree_root_node_with_offset_wasm,_ts_tree_edit_wasm,_ts_tree_included_ranges_wasm,_ts_tree_get_changed_ranges_wasm,_ts_tree_cursor_new_wasm,_ts_tree_cursor_copy_wasm,_ts_tree_cursor_delete_wasm,_ts_tree_cursor_reset_wasm,_ts_tree_cursor_reset_to_wasm,_ts_tree_cursor_goto_first_child_wasm,_ts_tree_cursor_goto_last_child_wasm,_ts_tree_cursor_goto_first_child_for_index_wasm,_ts_tree_cursor_goto_first_child_for_position_wasm,_ts_tree_cursor_goto_next_sibling_wasm,_ts_tree_cursor_goto_previous_sibling_wasm,_ts_tree_cursor_goto_descendant_wasm,_ts_tree_cursor_goto_parent_wasm,_ts_tree_cursor_current_node_type_id_wasm,_ts_tree_cursor_current_node_state_id_wasm,_ts_tree_cursor_current_node_is_named_wasm,_ts_tree_cursor_current_node_is_missing_wasm,_ts_tree_cursor_current_node_id_wasm,_ts_tree_cursor_start_position_wasm,_ts_tree_cursor_end_position_wasm,_ts_tree_cursor_start_index_wasm,_ts_tree_cursor_end_index_wasm,_ts_tree_cursor_current_field_id_wasm,_ts_tree_cursor_current_depth_wasm,_ts_tree_cursor_current_descendant_index_wasm,_ts_tree_cursor_current_node_wasm,_ts_node_symbol_wasm,_ts_node_field_name_for_child_wasm,_ts_node_field_name_for_named_child_wasm,_ts_node_children_by_field_id_wasm,_ts_node_first_child_for_byte_wasm,_ts_node_first_named_child_for_byte_wasm,_ts_node_grammar_symbol_wasm,_ts_node_child_count_wasm,_ts_node_named_child_count_wasm,_ts_node_child_wasm,_ts_node_named_child_wasm,_ts_node_child_by_field_id_wasm,_ts_node_next_sibling_wasm,_ts_node_prev_sibling_wasm,_ts_node_next_named_sibling_wasm,_ts_node_prev_named_sibling_wasm,_ts_node_descendant_count_wasm,_ts_node_parent_wasm,_ts_node_child_with_descendant_wasm,_ts_node_descendant_for_index_wasm,_ts_node_named_descendant_for_index_wasm,_ts_node_descendant_for_position_wasm,_ts_node_named_descendant_for_position_wasm,_ts_node_start_point_wasm,_ts_node_end_point_wasm,_ts_node_start_index_wasm,_ts_node_end_index_wasm,_ts_node_to_string_wasm,_ts_node_children_wasm,_ts_node_named_children_wasm,_ts_node_descendants_of_type_wasm,_ts_node_is_named_wasm,_ts_node_has_changes_wasm,_ts_node_has_error_wasm,_ts_node_is_error_wasm,_ts_node_is_missing_wasm,_ts_node_is_extra_wasm,_ts_node_parse_state_wasm,_ts_node_next_parse_state_wasm,_memset,_memcpy,_memmove,_iswalnum,_iswalpha,_iswblank,_iswdigit,_iswlower,_iswpunct,_iswspace,_iswupper,_iswxdigit,_memchr,__emscripten_timeout,_strlen,_strcmp,_strncat,_strncpy,_towlower,_towupper,_setThrew,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,___wasm_apply_data_relocs;function assignWasmExports(e){Module._free=_free=e.free,Module._ts_range_edit=_ts_range_edit=e.ts_range_edit,Module._ts_language_symbol_count=_ts_language_symbol_count=e.ts_language_symbol_count,Module._ts_language_state_count=_ts_language_state_count=e.ts_language_state_count,Module._ts_language_abi_version=_ts_language_abi_version=e.ts_language_abi_version,Module._ts_language_name=_ts_language_name=e.ts_language_name,Module._ts_language_field_count=_ts_language_field_count=e.ts_language_field_count,Module._ts_language_next_state=_ts_language_next_state=e.ts_language_next_state,Module._ts_language_symbol_name=_ts_language_symbol_name=e.ts_language_symbol_name,Module._ts_language_symbol_for_name=_ts_language_symbol_for_name=e.ts_language_symbol_for_name,Module._strncmp=_strncmp=e.strncmp,Module._ts_language_symbol_type=_ts_language_symbol_type=e.ts_language_symbol_type,Module._ts_language_field_name_for_id=_ts_language_field_name_for_id=e.ts_language_field_name_for_id,Module._ts_lookahead_iterator_new=_ts_lookahead_iterator_new=e.ts_lookahead_iterator_new,Module._ts_lookahead_iterator_delete=_ts_lookahead_iterator_delete=e.ts_lookahead_iterator_delete,Module._ts_lookahead_iterator_reset_state=_ts_lookahead_iterator_reset_state=e.ts_lookahead_iterator_reset_state,Module._ts_lookahead_iterator_reset=_ts_lookahead_iterator_reset=e.ts_lookahead_iterator_reset,Module._ts_lookahead_iterator_next=_ts_lookahead_iterator_next=e.ts_lookahead_iterator_next,Module._ts_lookahead_iterator_current_symbol=_ts_lookahead_iterator_current_symbol=e.ts_lookahead_iterator_current_symbol,Module._ts_point_edit=_ts_point_edit=e.ts_point_edit,Module._ts_parser_delete=_ts_parser_delete=e.ts_parser_delete,Module._ts_parser_set_language=_ts_parser_set_language=e.ts_parser_set_language,Module._ts_parser_reset=_ts_parser_reset=e.ts_parser_reset,Module._ts_parser_set_included_ranges=_ts_parser_set_included_ranges=e.ts_parser_set_included_ranges,Module._memcmp=_memcmp=e.memcmp,Module._ts_tree_copy=_ts_tree_copy=e.ts_tree_copy,Module._ts_tree_delete=_ts_tree_delete=e.ts_tree_delete,Module._malloc=_malloc=e.malloc,Module._calloc=_calloc=e.calloc,Module._realloc=_realloc=e.realloc,Module._ts_init=_ts_init=e.ts_init,Module._ts_free_wasm=_ts_free_wasm=e.ts_free_wasm,Module._ts_scanner_malloc_wasm=_ts_scanner_malloc_wasm=e.ts_scanner_malloc_wasm,Module._ts_scanner_calloc_wasm=_ts_scanner_calloc_wasm=e.ts_scanner_calloc_wasm,Module._ts_scanner_realloc_wasm=_ts_scanner_realloc_wasm=e.ts_scanner_realloc_wasm,Module._ts_parser_new_wasm=_ts_parser_new_wasm=e.ts_parser_new_wasm,Module._ts_parser_enable_logger_wasm=_ts_parser_enable_logger_wasm=e.ts_parser_enable_logger_wasm,Module._ts_parser_parse_wasm=_ts_parser_parse_wasm=e.ts_parser_parse_wasm,Module._ts_parser_parse_limited_wasm=_ts_parser_parse_limited_wasm=e.ts_parser_parse_limited_wasm,Module._ts_parser_abort_limited_wasm=_ts_parser_abort_limited_wasm=e.ts_parser_abort_limited_wasm,Module._ts_parser_included_ranges_wasm=_ts_parser_included_ranges_wasm=e.ts_parser_included_ranges_wasm,Module._ts_language_type_is_named_wasm=_ts_language_type_is_named_wasm=e.ts_language_type_is_named_wasm,Module._ts_language_type_is_visible_wasm=_ts_language_type_is_visible_wasm=e.ts_language_type_is_visible_wasm,Module._ts_language_metadata_wasm=_ts_language_metadata_wasm=e.ts_language_metadata_wasm,Module._ts_language_supertypes_wasm=_ts_language_supertypes_wasm=e.ts_language_supertypes_wasm,Module._ts_language_subtypes_wasm=_ts_language_subtypes_wasm=e.ts_language_subtypes_wasm,Module._ts_tree_root_node_wasm=_ts_tree_root_node_wasm=e.ts_tree_root_node_wasm,Module._ts_tree_root_node_with_offset_wasm=_ts_tree_root_node_with_offset_wasm=e.ts_tree_root_node_with_offset_wasm,Module._ts_tree_edit_wasm=_ts_tree_edit_wasm=e.ts_tree_edit_wasm,Module._ts_tree_included_ranges_wasm=_ts_tree_included_ranges_wasm=e.ts_tree_included_ranges_wasm,Module._ts_tree_get_changed_ranges_wasm=_ts_tree_get_changed_ranges_wasm=e.ts_tree_get_changed_ranges_wasm,Module._ts_tree_cursor_new_wasm=_ts_tree_cursor_new_wasm=e.ts_tree_cursor_new_wasm,Module._ts_tree_cursor_copy_wasm=_ts_tree_cursor_copy_wasm=e.ts_tree_cursor_copy_wasm,Module._ts_tree_cursor_delete_wasm=_ts_tree_cursor_delete_wasm=e.ts_tree_cursor_delete_wasm,Module._ts_tree_cursor_reset_wasm=_ts_tree_cursor_reset_wasm=e.ts_tree_cursor_reset_wasm,Module._ts_tree_cursor_reset_to_wasm=_ts_tree_cursor_reset_to_wasm=e.ts_tree_cursor_reset_to_wasm,Module._ts_tree_cursor_goto_first_child_wasm=_ts_tree_cursor_goto_first_child_wasm=e.ts_tree_cursor_goto_first_child_wasm,Module._ts_tree_cursor_goto_last_child_wasm=_ts_tree_cursor_goto_last_child_wasm=e.ts_tree_cursor_goto_last_child_wasm,Module._ts_tree_cursor_goto_first_child_for_index_wasm=_ts_tree_cursor_goto_first_child_for_index_wasm=e.ts_tree_cursor_goto_first_child_for_index_wasm,Module._ts_tree_cursor_goto_first_child_for_position_wasm=_ts_tree_cursor_goto_first_child_for_position_wasm=e.ts_tree_cursor_goto_first_child_for_position_wasm,Module._ts_tree_cursor_goto_next_sibling_wasm=_ts_tree_cursor_goto_next_sibling_wasm=e.ts_tree_cursor_goto_next_sibling_wasm,Module._ts_tree_cursor_goto_previous_sibling_wasm=_ts_tree_cursor_goto_previous_sibling_wasm=e.ts_tree_cursor_goto_previous_sibling_wasm,Module._ts_tree_cursor_goto_descendant_wasm=_ts_tree_cursor_goto_descendant_wasm=e.ts_tree_cursor_goto_descendant_wasm,Module._ts_tree_cursor_goto_parent_wasm=_ts_tree_cursor_goto_parent_wasm=e.ts_tree_cursor_goto_parent_wasm,Module._ts_tree_cursor_current_node_type_id_wasm=_ts_tree_cursor_current_node_type_id_wasm=e.ts_tree_cursor_current_node_type_id_wasm,Module._ts_tree_cursor_current_node_state_id_wasm=_ts_tree_cursor_current_node_state_id_wasm=e.ts_tree_cursor_current_node_state_id_wasm,Module._ts_tree_cursor_current_node_is_named_wasm=_ts_tree_cursor_current_node_is_named_wasm=e.ts_tree_cursor_current_node_is_named_wasm,Module._ts_tree_cursor_current_node_is_missing_wasm=_ts_tree_cursor_current_node_is_missing_wasm=e.ts_tree_cursor_current_node_is_missing_wasm,Module._ts_tree_cursor_current_node_id_wasm=_ts_tree_cursor_current_node_id_wasm=e.ts_tree_cursor_current_node_id_wasm,Module._ts_tree_cursor_start_position_wasm=_ts_tree_cursor_start_position_wasm=e.ts_tree_cursor_start_position_wasm,Module._ts_tree_cursor_end_position_wasm=_ts_tree_cursor_end_position_wasm=e.ts_tree_cursor_end_position_wasm,Module._ts_tree_cursor_start_index_wasm=_ts_tree_cursor_start_index_wasm=e.ts_tree_cursor_start_index_wasm,Module._ts_tree_cursor_end_index_wasm=_ts_tree_cursor_end_index_wasm=e.ts_tree_cursor_end_index_wasm,Module._ts_tree_cursor_current_field_id_wasm=_ts_tree_cursor_current_field_id_wasm=e.ts_tree_cursor_current_field_id_wasm,Module._ts_tree_cursor_current_depth_wasm=_ts_tree_cursor_current_depth_wasm=e.ts_tree_cursor_current_depth_wasm,Module._ts_tree_cursor_current_descendant_index_wasm=_ts_tree_cursor_current_descendant_index_wasm=e.ts_tree_cursor_current_descendant_index_wasm,Module._ts_tree_cursor_current_node_wasm=_ts_tree_cursor_current_node_wasm=e.ts_tree_cursor_current_node_wasm,Module._ts_node_symbol_wasm=_ts_node_symbol_wasm=e.ts_node_symbol_wasm,Module._ts_node_field_name_for_child_wasm=_ts_node_field_name_for_child_wasm=e.ts_node_field_name_for_child_wasm,Module._ts_node_field_name_for_named_child_wasm=_ts_node_field_name_for_named_child_wasm=e.ts_node_field_name_for_named_child_wasm,Module._ts_node_children_by_field_id_wasm=_ts_node_children_by_field_id_wasm=e.ts_node_children_by_field_id_wasm,Module._ts_node_first_child_for_byte_wasm=_ts_node_first_child_for_byte_wasm=e.ts_node_first_child_for_byte_wasm,Module._ts_node_first_named_child_for_byte_wasm=_ts_node_first_named_child_for_byte_wasm=e.ts_node_first_named_child_for_byte_wasm,Module._ts_node_grammar_symbol_wasm=_ts_node_grammar_symbol_wasm=e.ts_node_grammar_symbol_wasm,Module._ts_node_child_count_wasm=_ts_node_child_count_wasm=e.ts_node_child_count_wasm,Module._ts_node_named_child_count_wasm=_ts_node_named_child_count_wasm=e.ts_node_named_child_count_wasm,Module._ts_node_child_wasm=_ts_node_child_wasm=e.ts_node_child_wasm,Module._ts_node_named_child_wasm=_ts_node_named_child_wasm=e.ts_node_named_child_wasm,Module._ts_node_child_by_field_id_wasm=_ts_node_child_by_field_id_wasm=e.ts_node_child_by_field_id_wasm,Module._ts_node_next_sibling_wasm=_ts_node_next_sibling_wasm=e.ts_node_next_sibling_wasm,Module._ts_node_prev_sibling_wasm=_ts_node_prev_sibling_wasm=e.ts_node_prev_sibling_wasm,Module._ts_node_next_named_sibling_wasm=_ts_node_next_named_sibling_wasm=e.ts_node_next_named_sibling_wasm,Module._ts_node_prev_named_sibling_wasm=_ts_node_prev_named_sibling_wasm=e.ts_node_prev_named_sibling_wasm,Module._ts_node_descendant_count_wasm=_ts_node_descendant_count_wasm=e.ts_node_descendant_count_wasm,Module._ts_node_parent_wasm=_ts_node_parent_wasm=e.ts_node_parent_wasm,Module._ts_node_child_with_descendant_wasm=_ts_node_child_with_descendant_wasm=e.ts_node_child_with_descendant_wasm,Module._ts_node_descendant_for_index_wasm=_ts_node_descendant_for_index_wasm=e.ts_node_descendant_for_index_wasm,Module._ts_node_named_descendant_for_index_wasm=_ts_node_named_descendant_for_index_wasm=e.ts_node_named_descendant_for_index_wasm,Module._ts_node_descendant_for_position_wasm=_ts_node_descendant_for_position_wasm=e.ts_node_descendant_for_position_wasm,Module._ts_node_named_descendant_for_position_wasm=_ts_node_named_descendant_for_position_wasm=e.ts_node_named_descendant_for_position_wasm,Module._ts_node_start_point_wasm=_ts_node_start_point_wasm=e.ts_node_start_point_wasm,Module._ts_node_end_point_wasm=_ts_node_end_point_wasm=e.ts_node_end_point_wasm,Module._ts_node_start_index_wasm=_ts_node_start_index_wasm=e.ts_node_start_index_wasm,Module._ts_node_end_index_wasm=_ts_node_end_index_wasm=e.ts_node_end_index_wasm,Module._ts_node_to_string_wasm=_ts_node_to_string_wasm=e.ts_node_to_string_wasm,Module._ts_node_children_wasm=_ts_node_children_wasm=e.ts_node_children_wasm,Module._ts_node_named_children_wasm=_ts_node_named_children_wasm=e.ts_node_named_children_wasm,Module._ts_node_descendants_of_type_wasm=_ts_node_descendants_of_type_wasm=e.ts_node_descendants_of_type_wasm,Module._ts_node_is_named_wasm=_ts_node_is_named_wasm=e.ts_node_is_named_wasm,Module._ts_node_has_changes_wasm=_ts_node_has_changes_wasm=e.ts_node_has_changes_wasm,Module._ts_node_has_error_wasm=_ts_node_has_error_wasm=e.ts_node_has_error_wasm,Module._ts_node_is_error_wasm=_ts_node_is_error_wasm=e.ts_node_is_error_wasm,Module._ts_node_is_missing_wasm=_ts_node_is_missing_wasm=e.ts_node_is_missing_wasm,Module._ts_node_is_extra_wasm=_ts_node_is_extra_wasm=e.ts_node_is_extra_wasm,Module._ts_node_parse_state_wasm=_ts_node_parse_state_wasm=e.ts_node_parse_state_wasm,Module._ts_node_next_parse_state_wasm=_ts_node_next_parse_state_wasm=e.ts_node_next_parse_state_wasm,Module._memset=_memset=e.memset,Module._memcpy=_memcpy=e.memcpy,Module._memmove=_memmove=e.memmove,Module._iswalnum=_iswalnum=e.iswalnum,Module._iswalpha=_iswalpha=e.iswalpha,Module._iswblank=_iswblank=e.iswblank,Module._iswdigit=_iswdigit=e.iswdigit,Module._iswlower=_iswlower=e.iswlower,Module._iswpunct=_iswpunct=e.iswpunct,Module._iswspace=_iswspace=e.iswspace,Module._iswupper=_iswupper=e.iswupper,Module._iswxdigit=_iswxdigit=e.iswxdigit,Module._memchr=_memchr=e.memchr,__emscripten_timeout=e._emscripten_timeout,Module._strlen=_strlen=e.strlen,Module._strcmp=_strcmp=e.strcmp,Module._strncat=_strncat=e.strncat,Module._strncpy=_strncpy=e.strncpy,Module._towlower=_towlower=e.towlower,Module._towupper=_towupper=e.towupper,_setThrew=e.setThrew,__emscripten_stack_restore=e._emscripten_stack_restore,__emscripten_stack_alloc=e._emscripten_stack_alloc,_emscripten_stack_get_current=e.emscripten_stack_get_current,___wasm_apply_data_relocs=e.__wasm_apply_data_relocs}a(assignWasmExports,"assignWasmExports");var wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_high:___stack_high,__stack_low:___stack_low,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_setitimer_js:__setitimer_js,emscripten_resize_heap:_emscripten_resize_heap,invoke_i,invoke_iii,invoke_iiiij,invoke_vi,invoke_vii,memory:wasmMemory,proc_exit:_proc_exit,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback,tree_sitter_progress_callback:_tree_sitter_progress_callback};function invoke_vi(e,t){var r=stackSave();try{getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}a(invoke_vi,"invoke_vi");function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}a(invoke_i,"invoke_i");function invoke_iii(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(s){if(stackRestore(n),s!==s+0)throw s;_setThrew(1,0)}}a(invoke_iii,"invoke_iii");function invoke_vii(e,t,r){var n=stackSave();try{getWasmTableEntry(e)(t,r)}catch(s){if(stackRestore(n),s!==s+0)throw s;_setThrew(1,0)}}a(invoke_vii,"invoke_vii");function invoke_iiiij(e,t,r,n,s){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,s)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}a(invoke_iiiij,"invoke_iiiij");function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,n=stackAlloc((r+1)*4),s=n;e.forEach(l=>{LE_HEAP_STORE_U32((s>>2)*4,stringToUTF8OnStack(l)),s+=4}),LE_HEAP_STORE_U32((s>>2)*4,0);try{var o=t(r,n);return exitJS(o,!0),o}catch(l){return handleException(l)}}}a(callMain,"callMain");function run(e=arguments_){if(runDependencies>0){dependenciesFulfilled=run;return}if(preRun(),runDependencies>0){dependenciesFulfilled=run;return}function t(){if(Module.calledRun=!0,!ABORT){initRuntime(),readyPromiseResolve?.(Module),Module.onRuntimeInitialized?.();var r=Module.noInitialRun||!1;r||callMain(e),postRun()}}a(t,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}a(run,"run");var wasmExports;return wasmExports=await createWasm(),run(),runtimeInitialized?moduleRtn=Module:moduleRtn=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),moduleRtn}a(Ee,"Module");var q=Ee;var V=null;async function oe(e){if(V)return V;let{wasmModule:t,...r}=e??{};if(!t)return V??=await q(r);let n=new Promise((s,o)=>{r.instantiateWasm=(l,c)=>(WebAssembly.instantiate(t,l).then(f=>{c(f,t)}).catch(o),{})});return V??=await Promise.race([q(r),n])}a(oe,"initializeBinding");function le(){return!!V}a(le,"checkModule");var d,G;function Ie(e){let t=_._ts_language_abi_version(e[0]);if(t<J||t>G)throw new Error(`Incompatible language version 0x${(t>>>0).toString(16)}. Expected 0x${G.toString(16)}.`)}a(Ie,"assertSupportedLanguage");var J,de=S(e=>{_._ts_parser_delete(e[0]),_._free(e[1])}),Y=class{static{a(this,"Parser")}0=0;1=0;logCallback=null;language=null;static async init(t){ee(await oe(t)),d=_._ts_init(),G=_.getValue(d,"i32"),J=_.getValue(d+u,"i32")}constructor(){this.initialize(),de?.register(this,[this[0],this[1]],this)}initialize(){if(!le())throw new Error("cannot construct a Parser before calling `init()`");_._ts_parser_new_wasm(),this[0]=_.getValue(d,"i32"),this[1]=_.getValue(d+u,"i32")}delete(){de?.unregister(this),_._ts_parser_delete(this[0]),_._free(this[1]),this[0]=0,this[1]=0}setLanguage(t){let r;if(!t)r=0,this.language=null;else if(t.constructor===N)r=t[0],Ie(t),this.language=t;else throw new Error("Argument must be a Language");return _._ts_parser_set_language(this[0],r),this}parse(t,r,n){let s=Te(n?.maxMemoryBytes);if(typeof t=="string")_.currentParseCallback=o=>t.slice(o);else if(typeof t=="function")_.currentParseCallback=t;else throw new Error("Argument must be a string or a function");n?.progressCallback?_.currentProgressCallback=n.progressCallback:_.currentProgressCallback=null,this.logCallback?(_.currentLogCallback=this.logCallback,_._ts_parser_enable_logger_wasm(this[0],1)):(_.currentLogCallback=null,_._ts_parser_enable_logger_wasm(this[0],0));try{let o=s===void 0?Pe(this[0],this[1],r?r[0]:0,n?.includedRanges):Se(this[0],this[1],n?.includedRanges,s);if(!o)return null;if(!this.language)throw new Error("Parser must have a language to parse");return new C(p,o,this.language,_.currentParseCallback)}finally{Re()}}reset(){_._ts_parser_reset(this[0])}getIncludedRanges(){_._ts_parser_included_ranges_wasm(this[0]);let t=_.getValue(d,"i32"),r=_.getValue(d+u,"i32"),n=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)n[o]=U(s),s+=F;_._free(r)}return n}setLogger(t){if(!t)this.logCallback=null;else{if(typeof t!="function")throw new Error("Logger callback must be a function");this.logCallback=t}return this}getLogger(){return this.logCallback}};function Te(e){if(e!==void 0&&(!Number.isSafeInteger(e)||e<=0||e>2147483647))throw new RangeError("maxMemoryBytes must be a positive integer no greater than 2147483647");return e}a(Te,"validateMemoryLimit");function ue(e){if(!e?.length)return[0,0];let t=_._calloc(e.length,F);if(!t)return[0,e.length];let r=t;for(let n of e)se(r,n),r+=F;return[t,e.length]}a(ue,"prepareRanges");function Pe(e,t,r,n){let[s,o]=ue(n);return o&&!s?0:_._ts_parser_parse_wasm(e,t,r,s,o)}a(Pe,"parseOrdinaryWasm");function Se(e,t,r,n){if(!_.treeSitterSetMemoryLimit(n))return 0;let s=0;try{let[o,l]=ue(r);if(s=o,l&&!o)return 0;try{return _._ts_parser_parse_limited_wasm(e,t,o,l)}catch(c){throw _._ts_parser_abort_limited_wasm(),c}}finally{s&&_._free(s),_.treeSitterSetMemoryLimit(0)}}a(Se,"parseLimitedWasm");function Re(){_.currentParseCallback=null,_.currentLogCallback=null,_.currentProgressCallback=null}a(Re,"clearCallbacks");export{$ as Edit,G as LANGUAGE_VERSION,N as Language,x as LookaheadIterator,J as MIN_COMPATIBLE_VERSION,W as Node,Y as Parser,C as Tree,H as TreeCursor};
3
+ ${l}`)}let o=a.clone();try{r=await WebAssembly.compileStreaming(a)}catch(l){console.error("wasm streaming compile failed:",l),console.error("falling back to ArrayBuffer instantiation"),r=new Uint8Array(await o.arrayBuffer())}}let n=await s.loadWebAssemblyModule(r,{loadAsync:!0});return ae(n,{sync:!1})}static loadSync(t){let r=s.loadWebAssemblyModule(t,{loadAsync:!1});return ae(r,{sync:!0})}};function ae(e,{sync:t}){let r=Object.keys(e),n=r.find(o=>Ie.test(o)&&!o.includes("external_scanner_"));if(!n)throw console.log(`Couldn't find language function in Wasm file. Symbols:
4
+ ${JSON.stringify(r,null,2)}`),new Error(`Language.${t?"loadSync":"load"} failed: no language function found in Wasm file`);let a=e[n]();return new E(h,a)}_(ae,"loadFromWasmExports");async function Te(moduleArg={}){var moduleRtn,Module=moduleArg,ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&process.versions?.node&&process.type!="renderer";if(ENVIRONMENT_IS_NODE){let{createRequire:e}=await import("module");var require=e(import.meta.url)}Module.currentProgressCallback=null,Module.currentLogCallback=null,Module.currentParseCallback=null,Module.treeSitterSetMemoryLimit=function(e){return e?wasmMemory.buffer.byteLength>e||Module.treeSitterOriginalMemoryGrow?!1:(Module.treeSitterOriginalMemoryGrow=wasmMemory.grow,wasmMemory.grow=function(t){if(wasmMemory.buffer.byteLength+t*65536>e)throw new RangeError("Parse memory limit exceeded");return Module.treeSitterOriginalMemoryGrow.call(wasmMemory,t)},!0):(Module.treeSitterOriginalMemoryGrow&&(wasmMemory.grow=Module.treeSitterOriginalMemoryGrow,Module.treeSitterOriginalMemoryGrow=null),!0)};var arguments_=[],thisProgram="./this.program",quit_=_((e,t)=>{throw t},"quit_"),_scriptName=import.meta.url,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}_(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");_scriptName.startsWith("file:")&&(scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"),readBinary=_(e=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e);return t},"readBinary"),readAsync=_(async(e,t=!0)=>{e=isFileURI(e)?new URL(e):e;var r=fs.readFileSync(e,t?void 0:"utf8");return r},"readAsync"),process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=_((e,t)=>{throw process.exitCode=e,t},"quit_")}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}ENVIRONMENT_IS_WORKER&&(readBinary=_(e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},"readBinary")),readAsync=_(async e=>{if(isFileURI(e))return new Promise((r,n)=>{var a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="arraybuffer",a.onload=()=>{if(a.status==200||a.status==0&&a.response){r(a.response);return}n(a.status)},a.onerror=n,a.send(null)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)},"readAsync")}var out=console.log.bind(console),err=console.error.bind(console),dynamicLibraries=[],wasmBinary,ABORT=!1,EXITSTATUS,isFileURI=_(e=>e.startsWith("file://"),"isFileURI"),readyPromiseResolve,readyPromiseReject,wasmMemory,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP64,HEAPU64,runtimeInitialized=!1;function updateMemoryViews(){var e=wasmMemory.buffer;HEAP8=new Int8Array(e),HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),HEAPF32=new Float32Array(e),HEAPF64=new Float64Array(e),HEAP64=new BigInt64Array(e),HEAPU64=new BigUint64Array(e)}_(updateMemoryViews,"updateMemoryViews");function initMemory(){if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var e=Module.INITIAL_MEMORY||4194304;wasmMemory=new WebAssembly.Memory({initial:e/65536,maximum:32768})}updateMemoryViews()}_(initMemory,"initMemory");var __RELOC_FUNCS__=[];function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(onPreRuns)}_(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),wasmExports.__wasm_call_ctors(),callRuntimeCallbacks(onPostCtors)}_(initRuntime,"initRuntime");function preMain(){}_(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(onPostRuns)}_(postRun,"postRun");function abort(e){Module.onAbort?.(e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject?.(t),t}_(abort,"abort");var wasmBinaryFile;function findWasmBinary(){return Module.locateFile?locateFile("web-tree-sitter.wasm"):new URL("web-tree-sitter.wasm",import.meta.url).href}_(findWasmBinary,"findWasmBinary");function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}_(getBinarySync,"getBinarySync");async function getWasmBinary(e){if(!wasmBinary)try{var t=await readAsync(e);return new Uint8Array(t)}catch{}return getBinarySync(e)}_(getWasmBinary,"getWasmBinary");async function instantiateArrayBuffer(e,t){try{var r=await getWasmBinary(e),n=await WebAssembly.instantiate(r,t);return n}catch(a){err(`failed to asynchronously prepare wasm: ${a}`),abort(a)}}_(instantiateArrayBuffer,"instantiateArrayBuffer");async function instantiateAsync(e,t,r){if(!e&&!isFileURI(t)&&!ENVIRONMENT_IS_NODE)try{var n=fetch(t,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(o){err(`wasm streaming compile failed: ${o}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(t,r)}_(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}_(getWasmImports,"getWasmImports");async function createWasm(){function e(o,l){wasmExports=o.exports,wasmExports=relocateExports(wasmExports,1024);var d=getDylinkMetadata(l);d.neededDynlibs&&(dynamicLibraries=d.neededDynlibs.concat(dynamicLibraries));let m={malloc:wasmExports.ts_scanner_malloc_wasm,calloc:wasmExports.ts_scanner_calloc_wasm,realloc:wasmExports.ts_scanner_realloc_wasm};return Object.assign(wasmImports,m),updateGOT(m,!0),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),assignWasmExports(wasmExports),wasmExports}_(e,"receiveInstance");function t(o){return e(o.instance,o.module)}_(t,"receiveInstantiationResult");var r=getWasmImports();if(Module.instantiateWasm)return new Promise((o,l)=>{Module.instantiateWasm(r,(d,m)=>{o(e(d,m))})});wasmBinaryFile??=findWasmBinary();var n=await instantiateAsync(wasmBinary,wasmBinaryFile,r),a=t(n);return a}_(createWasm,"createWasm");class ExitStatus{static{_(this,"ExitStatus")}name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var r=GOT[t];return r||(r=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(r.required=!0),r}},callRuntimeCallbacks=_(e=>{for(;e.length>0;)e.shift()(Module)},"callRuntimeCallbacks"),onPostRuns=[],addOnPostRun=_(e=>onPostRuns.push(e),"addOnPostRun"),onPreRuns=[],addOnPreRun=_(e=>onPreRuns.push(e),"addOnPreRun"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,findStringEnd=_((e,t,r,n)=>{var a=t+r;if(n)return a;for(;e[t]&&!(t>=a);)++t;return t},"findStringEnd"),UTF8ArrayToString=_((e,t=0,r,n)=>{var a=findStringEnd(e,t,r,n);if(a-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,a));for(var o="";t<a;){var l=e[t++];if(!(l&128)){o+=String.fromCharCode(l);continue}var d=e[t++]&63;if((l&224)==192){o+=String.fromCharCode((l&31)<<6|d);continue}var m=e[t++]&63;if((l&240)==224?l=(l&15)<<12|d<<6|m:l=(l&7)<<18|d<<12|m<<6|e[t++]&63,l<65536)o+=String.fromCharCode(l);else{var g=l-65536;o+=String.fromCharCode(55296|g>>10,56320|g&1023)}}return o},"UTF8ArrayToString"),getDylinkMetadata=_(e=>{var t=0,r=0;function n(){return e[t++]}_(n,"getU8");function a(){for(var y=0,A=1;;){var J=e[t++];if(y+=(J&127)*A,A*=128,!(J&128))break}return y}_(a,"getLEB");function o(){var y=a();return t+=y,UTF8ArrayToString(e,t-y,y)}_(o,"getString");function l(){for(var y=a(),A=[];y--;)A.push(o());return A}_(l,"getStringList");function d(y,A){if(y)throw new Error(A)}if(_(d,"failIf"),e instanceof WebAssembly.Module){var m=WebAssembly.Module.customSections(e,"dylink.0");d(m.length===0,"need dylink section"),e=new Uint8Array(m[0]),r=e.length}else{var g=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),p=g[0]==1836278016;d(!p,"need to see wasm magic number"),d(e[8]!==0,"need the dylink section to be first"),t=9;var R=a();r=t+R;var me=o();d(me!=="dylink.0")}for(var M={neededDynlibs:[],tlsExports:new Set,weakImports:new Set,runtimePaths:[]},ce=1,ge=2,fe=3,he=4,we=5,be=256,pe=3,ye=1;t<r;){var k=n(),ve=a();if(k===ce)M.memorySize=a(),M.memoryAlign=a(),M.tableSize=a(),M.tableAlign=a();else if(k===ge)M.neededDynlibs=l();else if(k===fe)for(var G=a();G--;){var j=o(),z=a();z&be&&M.tlsExports.add(j)}else if(k===he)for(var G=a();G--;){var Le=o(),j=o(),z=a();(z&pe)==ye&&M.weakImports.add(j)}else k===we?M.runtimePaths=l():t+=ve}return M},"getDylinkMetadata"),newDSO=_((e,t,r)=>{var n={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=n,t!=null&&(LDSO.loadedLibsByHandle[t]=n),n},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=82656,alignMemory=_((e,t)=>Math.ceil(e/t)*t,"alignMemory"),getMemory=_(e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,r=t+alignMemory(e,16);return ___heap_base=r,GOT.__heap_base.value=r,t},"getMemory"),isInternalSym=_(e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),"isInternalSym"),uleb128EncodeWithLen=_(e=>{let t=e.length;return[t%128|128,t>>7,...e]},"uleb128EncodeWithLen"),wasmTypeCodes={i:127,p:127,j:126,f:125,d:124,e:111},generateTypePack=_(e=>uleb128EncodeWithLen(Array.from(e,t=>{var r=wasmTypeCodes[t];return r})),"generateTypePack"),convertJsFunctionToWasm=_((e,t)=>{var r=Uint8Array.of(0,97,115,109,1,0,0,0,1,...uleb128EncodeWithLen([1,96,...generateTypePack(t.slice(1)),...generateTypePack(t[0]==="v"?"":t[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),n=new WebAssembly.Module(r),a=new WebAssembly.Instance(n,{e:{f:e}}),o=a.exports.f;return o},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:50,element:"anyfunc"}),getWasmTableEntry=_(e=>{var t=wasmTableMirror[e];return t||(wasmTableMirror[e]=t=wasmTable.get(e)),t},"getWasmTableEntry"),updateTableMap=_((e,t)=>{if(functionsInTableMap)for(var r=e;r<e+t;r++){var n=getWasmTableEntry(r);n&&functionsInTableMap.set(n,r)}},"updateTableMap"),functionsInTableMap,getFunctionAddress=_(e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=_(()=>freeTableIndexes.length?freeTableIndexes.pop():wasmTable.grow(1),"getEmptyTableSlot"),setWasmTableEntry=_((e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},"setWasmTableEntry"),addFunction=_((e,t)=>{var r=getFunctionAddress(e);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,e)}catch(o){if(!(o instanceof TypeError))throw o;var a=convertJsFunctionToWasm(e,t);setWasmTableEntry(n,a)}return functionsInTableMap.set(e,n),n},"addFunction"),updateGOT=_((e,t)=>{for(var r in e)if(!isInternalSym(r)){var n=e[r];GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(t||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},"updateGOT"),relocateExports=_((e,t,r)=>{var n={};for(var a in e){var o=e[a];typeof o=="object"&&(o=o.value),typeof o=="number"&&(o+=t),n[a]=o}return updateGOT(n,r),n},"relocateExports"),isSymbolDefined=_(e=>{var t=wasmImports[e];return!(!t||t.stub)},"isSymbolDefined"),dynCall=_((e,t,r=[],n=!1)=>{var a=getWasmTableEntry(t),o=a(...r);function l(d){return d}return _(l,"convert"),o},"dynCall"),stackSave=_(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=_(e=>__emscripten_stack_restore(e),"stackRestore"),createInvokeFunction=_(e=>(t,...r)=>{var n=stackSave();try{return dynCall(e,t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;if(_setThrew(1,0),e[0]=="j")return 0n}},"createInvokeFunction"),resolveGlobalSymbol=_((e,t=!1)=>{var r;return isSymbolDefined(e)?r=wasmImports[e]:e.startsWith("invoke_")&&(r=wasmImports[e]=createInvokeFunction(e.split("_")[1])),{sym:r,name:e}},"resolveGlobalSymbol"),onPostCtors=[],addOnPostCtor=_(e=>onPostCtors.push(e),"addOnPostCtor"),UTF8ToString=_((e,t,r)=>e?UTF8ArrayToString(HEAPU8,e,t,r):"","UTF8ToString"),loadWebAssemblyModule=_((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);function loadModule(){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,HEAPU32[handle+12>>2]=memoryBase,HEAP32[handle+16>>2]=metadata.memorySize,HEAPU32[handle+20>>2]=tableBase,HEAP32[handle+24>>2]=metadata.tableSize),metadata.tableSize&&wasmTable.grow(metadata.tableSize);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}_(resolveSymbol,"resolveSymbol");var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub){var r=wasmImports[t];return r}if(!(t in e)){var n;e[t]=(...a)=>(n||=resolveSymbol(t),n(...a))}return e[t]}},proxy=new Proxy({},proxyHandler);currentModuleWeakSymbols=metadata.weakImports;var info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(_(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replace("*",""))}}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}_(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():addOnPostCtor(init)),moduleExports}if(_(postInstantiation,"postInstantiation"),flags.loadAsync)return(async()=>{var e;return binary instanceof WebAssembly.Module?e=await WebAssembly.instantiate(binary,info):{module:binary,instance:e}=await WebAssembly.instantiate(binary,info),postInstantiation(binary,e)})();var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return _(loadModule,"loadModule"),flags={...flags,rpath:{parentLibPath:libName,paths:metadata.runtimePaths}},flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=_((e,t)=>{for(var[r,n]of Object.entries(e)){let a=_(l=>{isSymbolDefined(l)||(wasmImports[l]=n)},"setImport");a(r);let o="__main_argc_argv";r=="main"&&a(o),r==o&&a("main")}},"mergeLibSymbols"),asyncLoad=_(async e=>{var t=await readAsync(e);return new Uint8Array(t)},"asyncLoad");function loadDynamicLibrary(e,t={global:!0,nodelete:!0},r,n){var a=LDSO.loadedLibsByName[e];if(a)return t.global?a.global||(a.global=!0,mergeLibSymbols(a.exports,e)):r&&Object.assign(r,a.exports),t.nodelete&&a.refcount!==1/0&&(a.refcount=1/0),a.refcount++,n&&(LDSO.loadedLibsByHandle[n]=a),t.loadAsync?Promise.resolve(!0):!0;a=newDSO(e,n,"loading"),a.refcount=t.nodelete?1/0:1,a.global=t.global;function o(){if(n){var m=HEAPU32[n+28>>2],g=HEAPU32[n+32>>2];if(m&&g){var p=HEAP8.slice(m,m+g);return t.loadAsync?Promise.resolve(p):p}}var R=locateFile(e);if(t.loadAsync)return asyncLoad(R);if(!readBinary)throw new Error(`${R}: file not found, and synchronous loading of external files is not available`);return readBinary(R)}_(o,"loadLibData");function l(){return t.loadAsync?o().then(m=>loadWebAssemblyModule(m,t,e,r,n)):loadWebAssemblyModule(o(),t,e,r,n)}_(l,"getExports");function d(m){a.global?mergeLibSymbols(m,e):r&&Object.assign(r,m),a.exports=m}return _(d,"moduleLoaded"),t.loadAsync?l().then(m=>(d(m),!0)):(d(l()),!0)}_(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=_(()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var r=resolveGlobalSymbol(e,!0).sym;if(!r&&!t.required)continue;if(typeof r=="function")t.value=addFunction(r,r.sig);else if(typeof r=="number")t.value=r;else throw new Error(`bad export type for '${e}': ${typeof r}`)}},"reportUndefinedSymbols"),runDependencies=0,dependenciesFulfilled=null,removeRunDependency=_(e=>{if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&dependenciesFulfilled){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}},"removeRunDependency"),addRunDependency=_(e=>{runDependencies++,Module.monitorRunDependencies?.(runDependencies)},"addRunDependency"),loadDylibs=_(async()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs");for(var e of dynamicLibraries)await loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0});reportUndefinedSymbols(),removeRunDependency("loadDylibs")},"loadDylibs"),noExitRuntime=!0,___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=82656,___stack_low=17120,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},82656),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=_(()=>abort(""),"__abort_js");__abort_js.sig="v";var runtimeKeepaliveCounter=0,__emscripten_runtime_keepalive_clear=_(()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0},"__emscripten_runtime_keepalive_clear");__emscripten_runtime_keepalive_clear.sig="v";var __emscripten_throw_longjmp=_(()=>{throw 1/0},"__emscripten_throw_longjmp");__emscripten_throw_longjmp.sig="v";var timers={},handleException=_(e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},"handleException"),keepRuntimeAlive=_(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=_(e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))},"_proc_exit");_proc_exit.sig="vi";var exitJS=_((e,t)=>{EXITSTATUS=e,_proc_exit(e)},"exitJS"),_exit=exitJS;_exit.sig="vi";var maybeExit=_(()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}},"maybeExit"),callUserCallback=_(e=>{if(!ABORT)try{e(),maybeExit()}catch(t){handleException(t)}},"callUserCallback"),_emscripten_get_now=_(()=>performance.now(),"_emscripten_get_now");_emscripten_get_now.sig="d";var __setitimer_js=_((e,t)=>{if(timers[e]&&(clearTimeout(timers[e].id),delete timers[e]),!t)return 0;var r=setTimeout(()=>{delete timers[e],callUserCallback(()=>__emscripten_timeout(e,_emscripten_get_now()))},t);return timers[e]={id:r,timeout_ms:t},0},"__setitimer_js");__setitimer_js.sig="iid";var getHeapMax=_(()=>2147483648,"getHeapMax"),growMemory=_(e=>{var t=wasmMemory.buffer.byteLength,r=(e-t+65535)/65536|0;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=_(e=>{var t=HEAPU8.length;e>>>=0;var r=getHeapMax();if(e>r)return!1;for(var n=1;n<=4;n*=2){var a=t*(1+0/n);a=Math.min(a,e+100663296);var o=Math.min(r,alignMemory(Math.max(e,a),65536)),l=growMemory(o);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";function _tree_sitter_log_callback(e,t){if(Module.currentLogCallback){let r=UTF8ToString(t);Module.currentLogCallback(r,e!==0)}}_(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(e,t,r,n,a){let l=Module.currentParseCallback(t,{row:r,column:n});typeof l=="string"?(HEAP32[a>>2]=l.length,stringToUTF16(l,e,10240)):HEAP32[a>>2]=0}_(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");function _tree_sitter_progress_callback(e,t){return Module.currentProgressCallback?Module.currentProgressCallback({currentOffset:e,hasError:t!==0})===!0:!1}_(_tree_sitter_progress_callback,"_tree_sitter_progress_callback");var lengthBytesUTF8=_(e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},"lengthBytesUTF8"),stringToUTF8Array=_((e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,l=0;l<e.length;++l){var d=e.codePointAt(l);if(d<=127){if(r>=o)break;t[r++]=d}else if(d<=2047){if(r+1>=o)break;t[r++]=192|d>>6,t[r++]=128|d&63}else if(d<=65535){if(r+2>=o)break;t[r++]=224|d>>12,t[r++]=128|d>>6&63,t[r++]=128|d&63}else{if(r+3>=o)break;t[r++]=240|d>>18,t[r++]=128|d>>12&63,t[r++]=128|d>>6&63,t[r++]=128|d&63,l++}}return t[r]=0,r-a},"stringToUTF8Array"),stringToUTF8=_((e,t,r)=>stringToUTF8Array(e,HEAPU8,t,r),"stringToUTF8"),stackAlloc=_(e=>__emscripten_stack_alloc(e),"stackAlloc"),stringToUTF8OnStack=_(e=>{var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8(e,r,t),r},"stringToUTF8OnStack"),AsciiToString=_(e=>{for(var t="";;){var r=HEAPU8[e++];if(!r)return t;t+=String.fromCharCode(r)}},"AsciiToString"),stringToUTF16=_((e,t,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var n=t,a=r<e.length*2?r/2:e.length,o=0;o<a;++o){var l=e.charCodeAt(o);HEAP16[t>>1]=l,t+=2}return HEAP16[t>>1]=0,t-n},"stringToUTF16");if(initMemory(),Module.noExitRuntime&&(noExitRuntime=Module.noExitRuntime),Module.print&&(out=Module.print),Module.printErr&&(err=Module.printErr),Module.dynamicLibraries&&(dynamicLibraries=Module.dynamicLibraries),Module.wasmBinary&&(wasmBinary=Module.wasmBinary),Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.shift()();Module.UTF8ToString=UTF8ToString,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,Module.loadWebAssemblyModule=loadWebAssemblyModule;var ASM_CONSTS={},_free,_ts_range_edit,_ts_language_symbol_count,_ts_language_state_count,_ts_language_abi_version,_ts_language_name,_ts_language_field_count,_ts_language_next_state,_ts_language_symbol_name,_ts_language_symbol_for_name,_strncmp,_ts_language_symbol_type,_ts_language_field_name_for_id,_ts_lookahead_iterator_new,_ts_lookahead_iterator_delete,_ts_lookahead_iterator_reset_state,_ts_lookahead_iterator_reset,_ts_lookahead_iterator_next,_ts_lookahead_iterator_current_symbol,_ts_point_edit,_ts_parser_delete,_ts_parser_set_language,_ts_parser_reset,_ts_parser_set_included_ranges,_memcmp,_ts_tree_copy,_ts_tree_delete,_malloc,_calloc,_realloc,_ts_init,_ts_free_wasm,_ts_scanner_malloc_wasm,_ts_scanner_calloc_wasm,_ts_scanner_realloc_wasm,_ts_parser_new_wasm,_ts_parser_enable_logger_wasm,_ts_parser_parse_wasm,_ts_parser_parse_limited_wasm,_ts_parser_last_parse_operations_wasm,_ts_parser_abort_limited_wasm,_ts_parser_included_ranges_wasm,_ts_language_type_is_named_wasm,_ts_language_type_is_visible_wasm,_ts_language_metadata_wasm,_ts_language_supertypes_wasm,_ts_language_subtypes_wasm,_ts_tree_root_node_wasm,_ts_tree_root_node_with_offset_wasm,_ts_tree_edit_wasm,_ts_tree_included_ranges_wasm,_ts_tree_get_changed_ranges_wasm,_ts_tree_cursor_new_wasm,_ts_tree_cursor_copy_wasm,_ts_tree_cursor_delete_wasm,_ts_tree_cursor_reset_wasm,_ts_tree_cursor_reset_to_wasm,_ts_tree_cursor_goto_first_child_wasm,_ts_tree_cursor_goto_last_child_wasm,_ts_tree_cursor_goto_first_child_for_index_wasm,_ts_tree_cursor_goto_first_child_for_position_wasm,_ts_tree_cursor_goto_next_sibling_wasm,_ts_tree_cursor_goto_previous_sibling_wasm,_ts_tree_cursor_goto_descendant_wasm,_ts_tree_cursor_goto_parent_wasm,_ts_tree_cursor_current_node_state_id_wasm,_ts_tree_cursor_current_node_id_wasm,_ts_tree_cursor_start_position_wasm,_ts_tree_cursor_end_position_wasm,_ts_tree_cursor_start_index_wasm,_ts_tree_cursor_end_index_wasm,_ts_tree_cursor_current_depth_wasm,_ts_tree_cursor_current_descendant_index_wasm,_ts_tree_cursor_current_node_wasm,_ts_node_symbol_wasm,_ts_node_field_name_for_child_wasm,_ts_node_field_name_for_named_child_wasm,_ts_node_children_by_field_id_wasm,_ts_node_first_child_for_byte_wasm,_ts_node_first_named_child_for_byte_wasm,_ts_node_grammar_symbol_wasm,_ts_node_child_count_wasm,_ts_node_named_child_count_wasm,_ts_node_child_wasm,_ts_node_named_child_wasm,_ts_node_child_by_field_id_wasm,_ts_node_next_sibling_wasm,_ts_node_prev_sibling_wasm,_ts_node_next_named_sibling_wasm,_ts_node_prev_named_sibling_wasm,_ts_node_descendant_count_wasm,_ts_node_parent_wasm,_ts_node_child_with_descendant_wasm,_ts_node_descendant_for_index_wasm,_ts_node_named_descendant_for_index_wasm,_ts_node_descendant_for_position_wasm,_ts_node_named_descendant_for_position_wasm,_ts_node_start_point_wasm,_ts_node_end_point_wasm,_ts_node_start_index_wasm,_ts_node_end_index_wasm,_ts_node_to_string_wasm,_ts_node_children_wasm,_ts_node_named_children_wasm,_ts_node_descendants_of_type_wasm,_ts_node_is_named_wasm,_ts_node_has_changes_wasm,_ts_node_has_error_wasm,_ts_node_is_error_wasm,_ts_node_is_missing_wasm,_ts_node_is_extra_wasm,_ts_node_parse_state_wasm,_ts_node_next_parse_state_wasm,_memset,_memcpy,_memmove,_iswalnum,_iswalpha,_iswblank,_iswdigit,_iswlower,_iswpunct,_iswspace,_iswupper,_iswxdigit,_memchr,__emscripten_timeout,_strlen,_strcmp,_strncat,_strncpy,_towlower,_towupper,_setThrew,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,___wasm_apply_data_relocs;function assignWasmExports(e){Module._free=_free=e.free,Module._ts_range_edit=_ts_range_edit=e.ts_range_edit,Module._ts_language_symbol_count=_ts_language_symbol_count=e.ts_language_symbol_count,Module._ts_language_state_count=_ts_language_state_count=e.ts_language_state_count,Module._ts_language_abi_version=_ts_language_abi_version=e.ts_language_abi_version,Module._ts_language_name=_ts_language_name=e.ts_language_name,Module._ts_language_field_count=_ts_language_field_count=e.ts_language_field_count,Module._ts_language_next_state=_ts_language_next_state=e.ts_language_next_state,Module._ts_language_symbol_name=_ts_language_symbol_name=e.ts_language_symbol_name,Module._ts_language_symbol_for_name=_ts_language_symbol_for_name=e.ts_language_symbol_for_name,Module._strncmp=_strncmp=e.strncmp,Module._ts_language_symbol_type=_ts_language_symbol_type=e.ts_language_symbol_type,Module._ts_language_field_name_for_id=_ts_language_field_name_for_id=e.ts_language_field_name_for_id,Module._ts_lookahead_iterator_new=_ts_lookahead_iterator_new=e.ts_lookahead_iterator_new,Module._ts_lookahead_iterator_delete=_ts_lookahead_iterator_delete=e.ts_lookahead_iterator_delete,Module._ts_lookahead_iterator_reset_state=_ts_lookahead_iterator_reset_state=e.ts_lookahead_iterator_reset_state,Module._ts_lookahead_iterator_reset=_ts_lookahead_iterator_reset=e.ts_lookahead_iterator_reset,Module._ts_lookahead_iterator_next=_ts_lookahead_iterator_next=e.ts_lookahead_iterator_next,Module._ts_lookahead_iterator_current_symbol=_ts_lookahead_iterator_current_symbol=e.ts_lookahead_iterator_current_symbol,Module._ts_point_edit=_ts_point_edit=e.ts_point_edit,Module._ts_parser_delete=_ts_parser_delete=e.ts_parser_delete,Module._ts_parser_set_language=_ts_parser_set_language=e.ts_parser_set_language,Module._ts_parser_reset=_ts_parser_reset=e.ts_parser_reset,Module._ts_parser_set_included_ranges=_ts_parser_set_included_ranges=e.ts_parser_set_included_ranges,Module._memcmp=_memcmp=e.memcmp,Module._ts_tree_copy=_ts_tree_copy=e.ts_tree_copy,Module._ts_tree_delete=_ts_tree_delete=e.ts_tree_delete,Module._malloc=_malloc=e.malloc,Module._calloc=_calloc=e.calloc,Module._realloc=_realloc=e.realloc,Module._ts_init=_ts_init=e.ts_init,Module._ts_free_wasm=_ts_free_wasm=e.ts_free_wasm,Module._ts_scanner_malloc_wasm=_ts_scanner_malloc_wasm=e.ts_scanner_malloc_wasm,Module._ts_scanner_calloc_wasm=_ts_scanner_calloc_wasm=e.ts_scanner_calloc_wasm,Module._ts_scanner_realloc_wasm=_ts_scanner_realloc_wasm=e.ts_scanner_realloc_wasm,Module._ts_parser_new_wasm=_ts_parser_new_wasm=e.ts_parser_new_wasm,Module._ts_parser_enable_logger_wasm=_ts_parser_enable_logger_wasm=e.ts_parser_enable_logger_wasm,Module._ts_parser_parse_wasm=_ts_parser_parse_wasm=e.ts_parser_parse_wasm,Module._ts_parser_parse_limited_wasm=_ts_parser_parse_limited_wasm=e.ts_parser_parse_limited_wasm,Module._ts_parser_last_parse_operations_wasm=_ts_parser_last_parse_operations_wasm=e.ts_parser_last_parse_operations_wasm,Module._ts_parser_abort_limited_wasm=_ts_parser_abort_limited_wasm=e.ts_parser_abort_limited_wasm,Module._ts_parser_included_ranges_wasm=_ts_parser_included_ranges_wasm=e.ts_parser_included_ranges_wasm,Module._ts_language_type_is_named_wasm=_ts_language_type_is_named_wasm=e.ts_language_type_is_named_wasm,Module._ts_language_type_is_visible_wasm=_ts_language_type_is_visible_wasm=e.ts_language_type_is_visible_wasm,Module._ts_language_metadata_wasm=_ts_language_metadata_wasm=e.ts_language_metadata_wasm,Module._ts_language_supertypes_wasm=_ts_language_supertypes_wasm=e.ts_language_supertypes_wasm,Module._ts_language_subtypes_wasm=_ts_language_subtypes_wasm=e.ts_language_subtypes_wasm,Module._ts_tree_root_node_wasm=_ts_tree_root_node_wasm=e.ts_tree_root_node_wasm,Module._ts_tree_root_node_with_offset_wasm=_ts_tree_root_node_with_offset_wasm=e.ts_tree_root_node_with_offset_wasm,Module._ts_tree_edit_wasm=_ts_tree_edit_wasm=e.ts_tree_edit_wasm,Module._ts_tree_included_ranges_wasm=_ts_tree_included_ranges_wasm=e.ts_tree_included_ranges_wasm,Module._ts_tree_get_changed_ranges_wasm=_ts_tree_get_changed_ranges_wasm=e.ts_tree_get_changed_ranges_wasm,Module._ts_tree_cursor_new_wasm=_ts_tree_cursor_new_wasm=e.ts_tree_cursor_new_wasm,Module._ts_tree_cursor_copy_wasm=_ts_tree_cursor_copy_wasm=e.ts_tree_cursor_copy_wasm,Module._ts_tree_cursor_delete_wasm=_ts_tree_cursor_delete_wasm=e.ts_tree_cursor_delete_wasm,Module._ts_tree_cursor_reset_wasm=_ts_tree_cursor_reset_wasm=e.ts_tree_cursor_reset_wasm,Module._ts_tree_cursor_reset_to_wasm=_ts_tree_cursor_reset_to_wasm=e.ts_tree_cursor_reset_to_wasm,Module._ts_tree_cursor_goto_first_child_wasm=_ts_tree_cursor_goto_first_child_wasm=e.ts_tree_cursor_goto_first_child_wasm,Module._ts_tree_cursor_goto_last_child_wasm=_ts_tree_cursor_goto_last_child_wasm=e.ts_tree_cursor_goto_last_child_wasm,Module._ts_tree_cursor_goto_first_child_for_index_wasm=_ts_tree_cursor_goto_first_child_for_index_wasm=e.ts_tree_cursor_goto_first_child_for_index_wasm,Module._ts_tree_cursor_goto_first_child_for_position_wasm=_ts_tree_cursor_goto_first_child_for_position_wasm=e.ts_tree_cursor_goto_first_child_for_position_wasm,Module._ts_tree_cursor_goto_next_sibling_wasm=_ts_tree_cursor_goto_next_sibling_wasm=e.ts_tree_cursor_goto_next_sibling_wasm,Module._ts_tree_cursor_goto_previous_sibling_wasm=_ts_tree_cursor_goto_previous_sibling_wasm=e.ts_tree_cursor_goto_previous_sibling_wasm,Module._ts_tree_cursor_goto_descendant_wasm=_ts_tree_cursor_goto_descendant_wasm=e.ts_tree_cursor_goto_descendant_wasm,Module._ts_tree_cursor_goto_parent_wasm=_ts_tree_cursor_goto_parent_wasm=e.ts_tree_cursor_goto_parent_wasm,Module._ts_tree_cursor_current_node_state_id_wasm=_ts_tree_cursor_current_node_state_id_wasm=e.ts_tree_cursor_current_node_state_id_wasm,Module._ts_tree_cursor_current_node_id_wasm=_ts_tree_cursor_current_node_id_wasm=e.ts_tree_cursor_current_node_id_wasm,Module._ts_tree_cursor_start_position_wasm=_ts_tree_cursor_start_position_wasm=e.ts_tree_cursor_start_position_wasm,Module._ts_tree_cursor_end_position_wasm=_ts_tree_cursor_end_position_wasm=e.ts_tree_cursor_end_position_wasm,Module._ts_tree_cursor_start_index_wasm=_ts_tree_cursor_start_index_wasm=e.ts_tree_cursor_start_index_wasm,Module._ts_tree_cursor_end_index_wasm=_ts_tree_cursor_end_index_wasm=e.ts_tree_cursor_end_index_wasm,Module._ts_tree_cursor_current_depth_wasm=_ts_tree_cursor_current_depth_wasm=e.ts_tree_cursor_current_depth_wasm,Module._ts_tree_cursor_current_descendant_index_wasm=_ts_tree_cursor_current_descendant_index_wasm=e.ts_tree_cursor_current_descendant_index_wasm,Module._ts_tree_cursor_current_node_wasm=_ts_tree_cursor_current_node_wasm=e.ts_tree_cursor_current_node_wasm,Module._ts_node_symbol_wasm=_ts_node_symbol_wasm=e.ts_node_symbol_wasm,Module._ts_node_field_name_for_child_wasm=_ts_node_field_name_for_child_wasm=e.ts_node_field_name_for_child_wasm,Module._ts_node_field_name_for_named_child_wasm=_ts_node_field_name_for_named_child_wasm=e.ts_node_field_name_for_named_child_wasm,Module._ts_node_children_by_field_id_wasm=_ts_node_children_by_field_id_wasm=e.ts_node_children_by_field_id_wasm,Module._ts_node_first_child_for_byte_wasm=_ts_node_first_child_for_byte_wasm=e.ts_node_first_child_for_byte_wasm,Module._ts_node_first_named_child_for_byte_wasm=_ts_node_first_named_child_for_byte_wasm=e.ts_node_first_named_child_for_byte_wasm,Module._ts_node_grammar_symbol_wasm=_ts_node_grammar_symbol_wasm=e.ts_node_grammar_symbol_wasm,Module._ts_node_child_count_wasm=_ts_node_child_count_wasm=e.ts_node_child_count_wasm,Module._ts_node_named_child_count_wasm=_ts_node_named_child_count_wasm=e.ts_node_named_child_count_wasm,Module._ts_node_child_wasm=_ts_node_child_wasm=e.ts_node_child_wasm,Module._ts_node_named_child_wasm=_ts_node_named_child_wasm=e.ts_node_named_child_wasm,Module._ts_node_child_by_field_id_wasm=_ts_node_child_by_field_id_wasm=e.ts_node_child_by_field_id_wasm,Module._ts_node_next_sibling_wasm=_ts_node_next_sibling_wasm=e.ts_node_next_sibling_wasm,Module._ts_node_prev_sibling_wasm=_ts_node_prev_sibling_wasm=e.ts_node_prev_sibling_wasm,Module._ts_node_next_named_sibling_wasm=_ts_node_next_named_sibling_wasm=e.ts_node_next_named_sibling_wasm,Module._ts_node_prev_named_sibling_wasm=_ts_node_prev_named_sibling_wasm=e.ts_node_prev_named_sibling_wasm,Module._ts_node_descendant_count_wasm=_ts_node_descendant_count_wasm=e.ts_node_descendant_count_wasm,Module._ts_node_parent_wasm=_ts_node_parent_wasm=e.ts_node_parent_wasm,Module._ts_node_child_with_descendant_wasm=_ts_node_child_with_descendant_wasm=e.ts_node_child_with_descendant_wasm,Module._ts_node_descendant_for_index_wasm=_ts_node_descendant_for_index_wasm=e.ts_node_descendant_for_index_wasm,Module._ts_node_named_descendant_for_index_wasm=_ts_node_named_descendant_for_index_wasm=e.ts_node_named_descendant_for_index_wasm,Module._ts_node_descendant_for_position_wasm=_ts_node_descendant_for_position_wasm=e.ts_node_descendant_for_position_wasm,Module._ts_node_named_descendant_for_position_wasm=_ts_node_named_descendant_for_position_wasm=e.ts_node_named_descendant_for_position_wasm,Module._ts_node_start_point_wasm=_ts_node_start_point_wasm=e.ts_node_start_point_wasm,Module._ts_node_end_point_wasm=_ts_node_end_point_wasm=e.ts_node_end_point_wasm,Module._ts_node_start_index_wasm=_ts_node_start_index_wasm=e.ts_node_start_index_wasm,Module._ts_node_end_index_wasm=_ts_node_end_index_wasm=e.ts_node_end_index_wasm,Module._ts_node_to_string_wasm=_ts_node_to_string_wasm=e.ts_node_to_string_wasm,Module._ts_node_children_wasm=_ts_node_children_wasm=e.ts_node_children_wasm,Module._ts_node_named_children_wasm=_ts_node_named_children_wasm=e.ts_node_named_children_wasm,Module._ts_node_descendants_of_type_wasm=_ts_node_descendants_of_type_wasm=e.ts_node_descendants_of_type_wasm,Module._ts_node_is_named_wasm=_ts_node_is_named_wasm=e.ts_node_is_named_wasm,Module._ts_node_has_changes_wasm=_ts_node_has_changes_wasm=e.ts_node_has_changes_wasm,Module._ts_node_has_error_wasm=_ts_node_has_error_wasm=e.ts_node_has_error_wasm,Module._ts_node_is_error_wasm=_ts_node_is_error_wasm=e.ts_node_is_error_wasm,Module._ts_node_is_missing_wasm=_ts_node_is_missing_wasm=e.ts_node_is_missing_wasm,Module._ts_node_is_extra_wasm=_ts_node_is_extra_wasm=e.ts_node_is_extra_wasm,Module._ts_node_parse_state_wasm=_ts_node_parse_state_wasm=e.ts_node_parse_state_wasm,Module._ts_node_next_parse_state_wasm=_ts_node_next_parse_state_wasm=e.ts_node_next_parse_state_wasm,Module._memset=_memset=e.memset,Module._memcpy=_memcpy=e.memcpy,Module._memmove=_memmove=e.memmove,Module._iswalnum=_iswalnum=e.iswalnum,Module._iswalpha=_iswalpha=e.iswalpha,Module._iswblank=_iswblank=e.iswblank,Module._iswdigit=_iswdigit=e.iswdigit,Module._iswlower=_iswlower=e.iswlower,Module._iswpunct=_iswpunct=e.iswpunct,Module._iswspace=_iswspace=e.iswspace,Module._iswupper=_iswupper=e.iswupper,Module._iswxdigit=_iswxdigit=e.iswxdigit,Module._memchr=_memchr=e.memchr,__emscripten_timeout=e._emscripten_timeout,Module._strlen=_strlen=e.strlen,Module._strcmp=_strcmp=e.strcmp,Module._strncat=_strncat=e.strncat,Module._strncpy=_strncpy=e.strncpy,Module._towlower=_towlower=e.towlower,Module._towupper=_towupper=e.towupper,_setThrew=e.setThrew,__emscripten_stack_restore=e._emscripten_stack_restore,__emscripten_stack_alloc=e._emscripten_stack_alloc,_emscripten_stack_get_current=e.emscripten_stack_get_current,___wasm_apply_data_relocs=e.__wasm_apply_data_relocs}_(assignWasmExports,"assignWasmExports");var wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_high:___stack_high,__stack_low:___stack_low,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_setitimer_js:__setitimer_js,emscripten_resize_heap:_emscripten_resize_heap,invoke_i,invoke_iii,invoke_iiiij,invoke_vi,invoke_vii,memory:wasmMemory,proc_exit:_proc_exit,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback,tree_sitter_progress_callback:_tree_sitter_progress_callback};function invoke_iii(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}_(invoke_iii,"invoke_iii");function invoke_vi(e,t){var r=stackSave();try{getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}_(invoke_vi,"invoke_vi");function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}_(invoke_i,"invoke_i");function invoke_vii(e,t,r){var n=stackSave();try{getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(n),a!==a+0)throw a;_setThrew(1,0)}}_(invoke_vii,"invoke_vii");function invoke_iiiij(e,t,r,n,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,a)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}_(invoke_iiiij,"invoke_iiiij");function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,n=stackAlloc((r+1)*4),a=n;e.forEach(l=>{HEAPU32[a>>2]=stringToUTF8OnStack(l),a+=4}),HEAPU32[a>>2]=0;try{var o=t(r,n);return exitJS(o,!0),o}catch(l){return handleException(l)}}}_(callMain,"callMain");function run(e=arguments_){if(runDependencies>0){dependenciesFulfilled=run;return}if(preRun(),runDependencies>0){dependenciesFulfilled=run;return}function t(){if(Module.calledRun=!0,!ABORT){initRuntime(),readyPromiseResolve?.(Module),Module.onRuntimeInitialized?.();var r=Module.noInitialRun||!1;r||callMain(e),postRun()}}_(t,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}_(run,"run");var wasmExports;return wasmExports=await createWasm(),run(),runtimeInitialized?moduleRtn=Module:moduleRtn=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),moduleRtn}_(Te,"Module");var X=Te;var H=null;async function oe(e){if(H)return H;let{wasmModule:t,...r}=e??{};if(!t)return H??=await X(r);let n=new Promise((a,o)=>{r.instantiateWasm=(l,d)=>(WebAssembly.instantiate(t,l).then(m=>{d(m,t)}).catch(o),{})});return H??=await Promise.race([X(r),n])}_(oe,"initializeBinding");function ie(){return!!H}_(ie,"checkModule");var de=4294967296,c,D,Y;function Ae(e){let t=s._ts_language_abi_version(e[0]);if(t<Y||t>D)throw new Error(`Incompatible language version 0x${(t>>>0).toString(16)}. Expected 0x${D.toString(16)}.`)}_(Ae,"assertSupportedLanguage");var le=T(e=>{s._ts_parser_delete(e[0]),s._free(e[1])}),K=class{static{_(this,"Parser")}0=0;1=0;logCallback=null;language=null;lastParseOperations=0;static async init(t){q(await oe(t)),c=s._ts_init();let r=c>>>2;D=s.HEAP32[r],Y=s.HEAP32[r+1]}constructor(){this.initialize(),le?.register(this,[this[0],this[1]],this)}initialize(){if(!ie())throw new Error("cannot construct a Parser before calling `init()`");s._ts_parser_new_wasm();let t=c>>>2;this[0]=s.HEAP32[t],this[1]=s.HEAP32[t+1]}delete(){le?.unregister(this),s._ts_parser_delete(this[0]),s._free(this[1]),this[0]=0,this[1]=0}setLanguage(t){let r;if(!t)r=0,this.language=null;else if(t.constructor===E)r=t[0],Ae(t),this.language=t;else throw new Error("Argument must be a Language");return s._ts_parser_set_language(this[0],r),this}parse(t,r,n){let a=Se(n?.maxMemoryBytes),o=Ee(n?.maxOperations),{sourceText:l,textCallback:d}=Re(t);s.currentParseCallback=l===void 0?d:null,s.currentProgressCallback=n?.progressCallback??null,this.logCallback?(s.currentLogCallback=this.logCallback,s._ts_parser_enable_logger_wasm(this[0],1)):(s.currentLogCallback=null,s._ts_parser_enable_logger_wasm(this[0],0)),this.lastParseOperations=0;let m={parserAddress:this[0],callbackBuffer:this[1],sourceText:l,oldTreeAddress:r?r[0]:0,ranges:n?.includedRanges,maxOperations:o,hasProgressCallback:n?.progressCallback?1:0,onOperations:_(g=>{this.lastParseOperations=g},"onOperations")};try{let g=a===void 0?ke(m):Ne(m,a);if(!g)return null;if(!this.language)throw new Error("Parser must have a language to parse");return new O(h,g,this.language,d,l)}finally{Ue()}}reset(){s._ts_parser_reset(this[0])}getIncludedRanges(){return s._ts_parser_included_ranges_wasm(this[0]),U(!1)}setLogger(t){if(!t)this.logCallback=null;else{if(typeof t!="function")throw new Error("Logger callback must be a function");this.logCallback=t}return this}getLogger(){return this.logCallback}};function Se(e){if(e!==void 0&&(!Number.isSafeInteger(e)||e<=0||e>2147483647))throw new RangeError("maxMemoryBytes must be a positive integer no greater than 2147483647");return e}_(Se,"validateMemoryLimit");function Ee(e){if(e!==void 0&&(!Number.isSafeInteger(e)||e<=0))throw new RangeError("maxOperations must be a positive safe integer");return e}_(Ee,"validateOperationLimit");function Re(e){if(typeof e=="string")return{sourceText:e,textCallback:_(t=>e.slice(t),"textCallback")};if(typeof e=="function")return{sourceText:void 0,textCallback:e};throw new Error("Argument must be a string or a function")}_(Re,"resolveInput");function ke(e){return ue(e,t=>{try{return s._ts_parser_parse_wasm(e.parserAddress,t,e.oldTreeAddress)}catch(r){throw s._ts_parser_last_parse_operations_wasm(e.parserAddress),r}})}_(ke,"parseOrdinaryWasm");function Ne(e,t){if(!s.treeSitterSetMemoryLimit(t))return 0;try{return ue(e,r=>{try{return s._ts_parser_parse_limited_wasm(e.parserAddress,r)}catch(n){throw s._ts_parser_abort_limited_wasm(),n}})}finally{s.treeSitterSetMemoryLimit(0)}}_(Ne,"parseLimitedWasm");function ue(e,t){let r=0,n=0,a=!1;try{let[o,l,d]=xe(e.sourceText);if(r=o,!d)return 0;let[m,g]=Fe(e.ranges);if(n=m,g&&!m)return 0;let p=e.sourceText!==void 0;return Ce(e.maxOperations,l,m,g,p,e.hasProgressCallback),a=!0,t(p?o:e.callbackBuffer)}finally{a&&e.onOperations(Oe()),n&&s._free(n),r&&s._free(r)}}_(ue,"withPreparedParse");function xe(e){if(e===void 0)return[0,0,!0];let t=e.length;if(t===0)return[0,0,!0];if(t>1073741823)return[0,0,!1];let r=t*2,n=s._malloc(r);if(!n)return[0,0,!1];let a=s.HEAPU16,o=n>>>1;for(let l=0;l<t;l++)a[o+l]=e.charCodeAt(l);return[n,r,!0]}_(xe,"prepareSourceBuffer");function Fe(e){if(!e?.length)return[0,0];let t=s._calloc(e.length,N);if(!t)return[0,e.length];let r=t;for(let n of e)ne(r,n),r+=N;return[t,e.length]}_(Fe,"prepareRanges");function Ce(e,t,r,n,a,o){let l=c>>>2,d=s.HEAPU32;d[l]=e===void 0?0:e>>>0,d[l+1]=e===void 0?0:Math.floor(e/de)>>>0,d[l+2]=t,d[l+3]=r,d[l+4]=n,d[l+5]=(a?1:0)|(o?2:0)}_(Ce,"marshalParseInputs");function Oe(){let e=c>>>2,t=s.HEAPU32;return t[e]+t[e+1]*de}_(Oe,"unmarshalOperationCount");function Ue(){s.currentParseCallback=null,s.currentLogCallback=null,s.currentProgressCallback=null}_(Ue,"clearCallbacks");export{V as Edit,D as LANGUAGE_VERSION,E as Language,F as LookaheadIterator,Y as MIN_COMPATIBLE_VERSION,W as Node,K as Parser,O as Tree,S as TreeCursor};
5
5
  //# sourceMappingURL=web-tree-sitter.js.map