@willbooster/web-tree-sitter 15.5.4 → 16.0.1

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.
@@ -31,7 +31,7 @@
31
31
  /**
32
32
  * A callback that receives the parse state during parsing.
33
33
  */
34
- export type ProgressCallback = (progress: ParseState) => boolean;
34
+ export type ProgressCallback = (progress: ParseState) => boolean | void;
35
35
  /**
36
36
  * A callback for logging messages.
37
37
  *
@@ -125,7 +125,7 @@
125
125
  * takes a single argument, which is a {@link ParseState} representing the current
126
126
  * state of the parser.
127
127
  */
128
- progressCallback?: (state: ParseState) => void;
128
+ progressCallback?: (state: ParseState) => boolean | void;
129
129
  }
130
130
  /**
131
131
  * A stateful object that is passed into the progress callback {@link ParseOptions#progressCallback}
@@ -808,13 +808,8 @@
808
808
  * if query execution should be cancelled. You can also use this to instrument query execution
809
809
  * and check where the query is at in the document. The progress callback takes a single argument,
810
810
  * which is a {@link QueryState} representing the current state of the query.
811
- * Return `true` to cancel execution, or `false` or nothing to continue.
812
- * Capture observers may return incidental values; only `true` cancels capture execution.
813
- * For matches, legacy WebAssembly conversion can treat incidental numeric returns, such as
814
- * the length returned by Array.push, as cancellation. Use a block body with no return value
815
- * when observing progress. Nested queries preserve the outer execution and its callback.
816
811
  */
817
- progressCallback?: (state: QueryState) => void;
812
+ progressCallback?: (state: QueryState) => boolean | void;
818
813
  }
819
814
  /**
820
815
  * A stateful object that is passed into the progress callback {@link QueryOptions#progressCallback}
@@ -990,9 +985,9 @@
990
985
  * of in-progress matches.
991
986
  */
992
987
  didExceedMatchLimit(): boolean;
993
- /** Get the index where the given pattern starts in the query's source. */
988
+ /** Get the byte offset where the given pattern starts in the query's source. */
994
989
  startIndexForPattern(patternIndex: number): number;
995
- /** Get the index where the given pattern ends in the query's source. */
990
+ /** Get the byte offset where the given pattern ends in the query's source. */
996
991
  endIndexForPattern(patternIndex: number): number;
997
992
  /** Get the number of patterns in the query. */
998
993
  patternCount(): number;
@@ -1003,12 +998,12 @@
1003
998
  /** Check if a given pattern within a query has a single root node. */
1004
999
  isPatternNonLocal(patternIndex: number): boolean;
1005
1000
  /**
1006
- * Check if the step at the given index in the query's source is 'definite'.
1001
+ * Check if a given step in a query is 'definite'.
1007
1002
  *
1008
1003
  * A query step is 'definite' if its parent pattern will be guaranteed to
1009
1004
  * match successfully once it reaches the step.
1010
1005
  */
1011
- isPatternGuaranteedAtStep(index: number): boolean;
1006
+ isPatternGuaranteedAtStep(byteIndex: number): boolean;
1012
1007
  }
1013
1008
  export class LookaheadIterator implements Iterable<string> {
1014
1009
  /**
@@ -56,6 +56,6 @@
56
56
  null,
57
57
  null
58
58
  ],
59
- "mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAsCVC,aAAaA;;;;aAKbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBChENC,iBAAiBA;;;;;;;cCLrBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCgBAC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmCZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;YAqBhBC,sBAAsBA;;;;;cAWpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCrGFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCiBRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC1BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCIJC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCENC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2EZC,UAAUA;;;;;aAMfC,eAAeA;;;;kBAKVC,cAAcA;;;;;;;;;;kBAYdC,YAAYA;;;;;;;;;;;;;;;kBAqBZC,UAAUA;;;;;;;;;;;;;cA2BfC,iBAAiBA;;;;;;;;aAAjBA,iBAAiBA;;;;;;;;;;;;aAajBC,aAAaA;;;;;;WAORC,oBAAoBA;;;;;;;;;WAOpBC,mBAAmBA;;;;cAmVvBC,KAAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCxgBLC,iBAAiBA",
59
+ "mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAsCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBCjENC,iBAAiBA;;;;;;;cCLrBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCgBAC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoCZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;YAqBhBC,sBAAsBA;;;;;cAWpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCtGFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCiBRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC1BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCIJC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCENC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAuEZC,UAAUA;;;;;aAMfC,eAAeA;;;;kBAKVC,cAAcA;;;;;;;;;;kBAYdC,YAAYA;;;;;;;;;;;;;;;kBAqBZC,UAAUA;;;;;;;;;;;;;cA2BfC,iBAAiBA;;;;;;;;aAAjBA,iBAAiBA;;;;;;;;;;;;aAajBC,aAAaA;;;;;;WAORC,oBAAoBA;;;;;;;;;WAOpBC,mBAAmBA;;;;cAyUvBC,KAAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC1fLC,iBAAiBA",
60
60
  "ignoreList": []
61
61
  }
@@ -31,7 +31,7 @@
31
31
  /**
32
32
  * A callback that receives the parse state during parsing.
33
33
  */
34
- export type ProgressCallback = (progress: ParseState) => boolean;
34
+ export type ProgressCallback = (progress: ParseState) => boolean | void;
35
35
  /**
36
36
  * A callback for logging messages.
37
37
  *
@@ -125,7 +125,7 @@
125
125
  * takes a single argument, which is a {@link ParseState} representing the current
126
126
  * state of the parser.
127
127
  */
128
- progressCallback?: (state: ParseState) => void;
128
+ progressCallback?: (state: ParseState) => boolean | void;
129
129
  }
130
130
  /**
131
131
  * A stateful object that is passed into the progress callback {@link ParseOptions#progressCallback}
@@ -808,13 +808,8 @@
808
808
  * if query execution should be cancelled. You can also use this to instrument query execution
809
809
  * and check where the query is at in the document. The progress callback takes a single argument,
810
810
  * which is a {@link QueryState} representing the current state of the query.
811
- * Return `true` to cancel execution, or `false` or nothing to continue.
812
- * Capture observers may return incidental values; only `true` cancels capture execution.
813
- * For matches, legacy WebAssembly conversion can treat incidental numeric returns, such as
814
- * the length returned by Array.push, as cancellation. Use a block body with no return value
815
- * when observing progress. Nested queries preserve the outer execution and its callback.
816
811
  */
817
- progressCallback?: (state: QueryState) => void;
812
+ progressCallback?: (state: QueryState) => boolean | void;
818
813
  }
819
814
  /**
820
815
  * A stateful object that is passed into the progress callback {@link QueryOptions#progressCallback}
@@ -990,9 +985,9 @@
990
985
  * of in-progress matches.
991
986
  */
992
987
  didExceedMatchLimit(): boolean;
993
- /** Get the index where the given pattern starts in the query's source. */
988
+ /** Get the byte offset where the given pattern starts in the query's source. */
994
989
  startIndexForPattern(patternIndex: number): number;
995
- /** Get the index where the given pattern ends in the query's source. */
990
+ /** Get the byte offset where the given pattern ends in the query's source. */
996
991
  endIndexForPattern(patternIndex: number): number;
997
992
  /** Get the number of patterns in the query. */
998
993
  patternCount(): number;
@@ -1003,12 +998,12 @@
1003
998
  /** Check if a given pattern within a query has a single root node. */
1004
999
  isPatternNonLocal(patternIndex: number): boolean;
1005
1000
  /**
1006
- * Check if the step at the given index in the query's source is 'definite'.
1001
+ * Check if a given step in a query is 'definite'.
1007
1002
  *
1008
1003
  * A query step is 'definite' if its parent pattern will be guaranteed to
1009
1004
  * match successfully once it reaches the step.
1010
1005
  */
1011
- isPatternGuaranteedAtStep(index: number): boolean;
1006
+ isPatternGuaranteedAtStep(byteIndex: number): boolean;
1012
1007
  }
1013
1008
  export class LookaheadIterator implements Iterable<string> {
1014
1009
  /**
@@ -56,6 +56,6 @@
56
56
  null,
57
57
  null
58
58
  ],
59
- "mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAsCVC,aAAaA;;;;aAKbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBChENC,iBAAiBA;;;;;;;cCLrBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCgBAC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmCZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;YAqBhBC,sBAAsBA;;;;;cAWpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCrGFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCiBRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC1BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCIJC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCENC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2EZC,UAAUA;;;;;aAMfC,eAAeA;;;;kBAKVC,cAAcA;;;;;;;;;;kBAYdC,YAAYA;;;;;;;;;;;;;;;kBAqBZC,UAAUA;;;;;;;;;;;;;cA2BfC,iBAAiBA;;;;;;;;aAAjBA,iBAAiBA;;;;;;;;;;;;aAajBC,aAAaA;;;;;;WAORC,oBAAoBA;;;;;;;;;WAOpBC,mBAAmBA;;;;cAmVvBC,KAAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCxgBLC,iBAAiBA",
59
+ "mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAsCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBCjENC,iBAAiBA;;;;;;;cCLrBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCgBAC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoCZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;YAqBhBC,sBAAsBA;;;;;cAWpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCtGFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCiBRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC1BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCIJC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCENC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAuEZC,UAAUA;;;;;aAMfC,eAAeA;;;;kBAKVC,cAAcA;;;;;;;;;;kBAYdC,YAAYA;;;;;;;;;;;;;;;kBAqBZC,UAAUA;;;;;;;;;;;;;cA2BfC,iBAAiBA;;;;;;;;aAAjBA,iBAAiBA;;;;;;;;;;;;aAajBC,aAAaA;;;;;;WAORC,oBAAoBA;;;;;;;;;WAOpBC,mBAAmBA;;;;cAyUvBC,KAAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC1fLC,iBAAiBA",
60
60
  "ignoreList": []
61
61
  }
@@ -1,6 +1,6 @@
1
- var xe=Object.defineProperty;var a=(e,t)=>xe(e,"name",{value:t,configurable:!0});var ae=class{static{a(this,"Edit")}startPosition;oldEndPosition;newEndPosition;startIndex;oldEndIndex;newEndIndex;constructor({startIndex:t,oldEndIndex:r,newEndIndex:_,startPosition:s,oldEndPosition:o,newEndPosition:u}){this.startIndex=t>>>0,this.oldEndIndex=r>>>0,this.newEndIndex=_>>>0,this.startPosition=s,this.oldEndPosition=o,this.newEndPosition=u}editPoint(t,r){let _=r,s={...t};if(r>=this.oldEndIndex){_=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&&(_=this.newEndIndex,s.row=this.newEndPosition.row,s.column=this.newEndPosition.column);return{point:s,index:_}}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 oe=2,m=4,re=4*m,T=5*m,L=2*m,G=2*m+2*L,q={row:0,column:0},F=Symbol("INTERNAL");function D(e){if(e!==F)throw new Error("Illegal constructor")}a(D,"assertInternal");function Z(e){return!!e&&typeof e.row=="number"&&typeof e.column=="number"}a(Z,"isPoint");function fe(e){n=e}a(fe,"setModule");var n;function H(e){try{return new FinalizationRegistry(e)}catch(t){console.error("Unsupported FinalizationRegistry:",t);return}}a(H,"newFinalizer");var he=H(e=>{n._ts_lookahead_iterator_delete(e)}),K=class{static{a(this,"LookaheadIterator")}0=0;language;positioned=!1;constructor(t,r,_){D(t),this[0]=r,this.language=_,he?.register(this,r,this)}get currentTypeId(){return this.positioned?n._ts_lookahead_iterator_current_symbol(this[0]):null}get currentType(){let t=this.currentTypeId;return t===null?null:this.language.types[t]??n.UTF8ToString(n._ts_language_symbol_name(this.language[0],t))}delete(){he?.unregister(this),n._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(t,r){return n._ts_lookahead_iterator_reset(this[0],t[0],r)?(this.language=t,this.positioned=!1,!0):!1}resetState(t){return n._ts_lookahead_iterator_reset_state(this[0],t)?(this.positioned=!1,!0):!1}[Symbol.iterator](){return{next:a(()=>{this.positioned=!!n._ts_lookahead_iterator_next(this[0]);let t=this.currentType;return t===null?{done:!0,value:""}:{done:!1,value:t}},"next")}}};function ne(e,t,r,_){let s=r-t,o=e.textCallback(t,_);if(o){for(t+=o.length;t<r;){let u=e.textCallback(t,_);if(u&&u.length>0)t+=u.length,o+=u;else break}t>r&&(o=o.slice(0,s))}return o??""}a(ne,"getText");var pe=H(e=>{n._ts_tree_delete(e)}),X=class e{static{a(this,"Tree")}0=0;textCallback;language;constructor(t,r,_,s){D(t),this[0]=r,this.language=_,this.textCallback=s,pe?.register(this,r,this)}copy(){let t=n._ts_tree_copy(this[0]);return new e(F,t,this.language,this.textCallback)}delete(){pe?.unregister(this),n._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return n._ts_tree_root_node_wasm(this[0]),M(this)}rootNodeWithOffset(t,r){let _=c+T;return n.setValue(_,t,"i32"),k(_+m,r),n._ts_tree_root_node_with_offset_wasm(this[0]),M(this)}edit(t){ye(t),n._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");n._ts_tree_get_changed_ranges_wasm(this[0],t[0]);let r=n.getValue(c,"i32"),_=n.getValue(c+m,"i32"),s=new Array(r);if(r>0){let o=_;for(let u=0;u<r;u++)s[u]=Y(o),o+=G;n._free(_)}return s}getIncludedRanges(){n._ts_tree_included_ranges_wasm(this[0]);let t=n.getValue(c,"i32"),r=n.getValue(c+m,"i32"),_=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)_[o]=Y(s),s+=G;n._free(r)}return _}};var we=H(e=>{b({handles:e}),n._ts_tree_cursor_delete_wasm(0)}),J=class e{static{a(this,"TreeCursor")}handles=[0,0,0,0];tree;constructor(t,r){D(t),this.tree=r,O(this),we?.register(this,this.handles,this)}copy(){return b(this),n._ts_tree_cursor_copy_wasm(this.tree[0]),new e(F,this.tree)}delete(){we?.unregister(this),b(this),n._ts_tree_cursor_delete_wasm(this.tree[0]),this.handles.fill(0)}get currentNode(){return b(this),n._ts_tree_cursor_current_node_wasm(this.tree[0]),M(this.tree)}get currentFieldId(){return b(this),n._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return b(this),n._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return b(this),n._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return b(this),n._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return b(this),n._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return b(this),n._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return b(this),n._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return b(this),n._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){b(this);let t=n._ts_tree_cursor_start_index_wasm(this.tree[0]),r=n._ts_tree_cursor_end_index_wasm(this.tree[0]);n._ts_tree_cursor_start_position_wasm(this.tree[0]);let _=Q(c);return ne(this.tree,t,r,_)}get startPosition(){return b(this),n._ts_tree_cursor_start_position_wasm(this.tree[0]),Q(c)}get endPosition(){return b(this),n._ts_tree_cursor_end_position_wasm(this.tree[0]),Q(c)}get startIndex(){return b(this),n._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return b(this),n._ts_tree_cursor_end_index_wasm(this.tree[0])}gotoFirstChild(){b(this);let t=n._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return O(this),t===1}gotoLastChild(){b(this);let t=n._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return O(this),t===1}gotoParent(){b(this);let t=n._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return O(this),t===1}gotoNextSibling(){b(this);let t=n._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return O(this),t===1}gotoPreviousSibling(){b(this);let t=n._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return O(this),t===1}gotoDescendant(t){b(this),n._ts_tree_cursor_goto_descendant_wasm(this.tree[0],t),O(this)}gotoFirstChildForIndex(t){b(this),n.setValue(c+re,t,"i32");let r=n._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return O(this),r===1}gotoFirstChildForPosition(t){b(this),k(c+re,t);let r=n._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return O(this),r===1}reset(t){h(t),b(this,c+T),n._ts_tree_cursor_reset_wasm(t.tree[0]),O(this),this.tree=t.tree}resetTo(t){b(this,c),b(t,c+re),n._ts_tree_cursor_reset_to_wasm(this.tree[0],t.tree[0]),O(this),this.tree=t.tree}};var ee=class{static{a(this,"Node")}0=0;_children;_namedChildren;constructor(t,{id:r,tree:_,startIndex:s,startPosition:o,other:u}){D(t),this[0]=u,this.id=r,this.tree=_,this.startIndex=s,this.startPosition=o}id;startIndex;startPosition;tree;get typeId(){return h(this),n._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return h(this),n._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 h(this),n._ts_node_is_named_wasm(this.tree[0])===1}get isExtra(){return h(this),n._ts_node_is_extra_wasm(this.tree[0])===1}get isError(){return h(this),n._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return h(this),n._ts_node_is_missing_wasm(this.tree[0])===1}get hasChanges(){return h(this),n._ts_node_has_changes_wasm(this.tree[0])===1}get hasError(){return h(this),n._ts_node_has_error_wasm(this.tree[0])===1}get endIndex(){return h(this),n._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return h(this),n._ts_node_end_point_wasm(this.tree[0]),Q(c)}get text(){return ne(this.tree,this.startIndex,this.endIndex,this.startPosition)}get parseState(){return h(this),n._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return h(this),n._ts_node_next_parse_state_wasm(this.tree[0])}equals(t){return this.tree===t.tree&&this.id===t.id}child(t){return h(this),n._ts_node_child_wasm(this.tree[0],t),M(this.tree)}namedChild(t){return h(this),n._ts_node_named_child_wasm(this.tree[0],t),M(this.tree)}childForFieldId(t){return h(this),n._ts_node_child_by_field_id_wasm(this.tree[0],t),M(this.tree)}childForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1?this.childForFieldId(r):null}fieldNameForChild(t){h(this);let r=n._ts_node_field_name_for_child_wasm(this.tree[0],t);return r?n.AsciiToString(r):null}fieldNameForNamedChild(t){h(this);let r=n._ts_node_field_name_for_named_child_wasm(this.tree[0],t);return r?n.AsciiToString(r):null}childrenForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1&&r!==0?this.childrenForFieldId(r):[]}childrenForFieldId(t){h(this),n._ts_node_children_by_field_id_wasm(this.tree[0],t);let r=n.getValue(c,"i32"),_=n.getValue(c+m,"i32"),s=new Array(r);if(r>0){let o=_;for(let u=0;u<r;u++)s[u]=M(this.tree,o),o+=T;n._free(_)}return s}firstChildForIndex(t){h(this);let r=c+T;return n.setValue(r,t,"i32"),n._ts_node_first_child_for_byte_wasm(this.tree[0]),M(this.tree)}firstNamedChildForIndex(t){h(this);let r=c+T;return n.setValue(r,t,"i32"),n._ts_node_first_named_child_for_byte_wasm(this.tree[0]),M(this.tree)}get childCount(){return h(this),n._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return h(this),n._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){h(this),n._ts_node_children_wasm(this.tree[0]);let t=n.getValue(c,"i32"),r=n.getValue(c+m,"i32");if(this._children=new Array(t),t>0){let _=r;for(let s=0;s<t;s++)this._children[s]=M(this.tree,_),_+=T;n._free(r)}}return this._children}get namedChildren(){if(!this._namedChildren){h(this),n._ts_node_named_children_wasm(this.tree[0]);let t=n.getValue(c,"i32"),r=n.getValue(c+m,"i32");if(this._namedChildren=new Array(t),t>0){let _=r;for(let s=0;s<t;s++)this._namedChildren[s]=M(this.tree,_),_+=T;n._free(r)}}return this._namedChildren}descendantsOfType(t,r=q,_=q){Array.isArray(t)||(t=[t]);let s=[],o=this.tree.language.types;for(let f=0,g=o.length;f<g;f++)t.includes(o[f])&&s.push(f);t.includes("ERROR")&&s.push(65535);let u=n._malloc(m*s.length);for(let f=0,g=s.length;f<g;f++)n.setValue(u+f*m,s[f],"i32");h(this),n._ts_node_descendants_of_type_wasm(this.tree[0],u,s.length,r.row,r.column,_.row,_.column);let l=n.getValue(c,"i32"),d=n.getValue(c+m,"i32"),p=new Array(l);if(l>0){let f=d;for(let g=0;g<l;g++)p[g]=M(this.tree,f),f+=T}return n._free(d),n._free(u),p}get nextSibling(){return h(this),n._ts_node_next_sibling_wasm(this.tree[0]),M(this.tree)}get previousSibling(){return h(this),n._ts_node_prev_sibling_wasm(this.tree[0]),M(this.tree)}get nextNamedSibling(){return h(this),n._ts_node_next_named_sibling_wasm(this.tree[0]),M(this.tree)}get previousNamedSibling(){return h(this),n._ts_node_prev_named_sibling_wasm(this.tree[0]),M(this.tree)}get descendantCount(){return h(this),n._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return h(this),n._ts_node_parent_wasm(this.tree[0]),M(this.tree)}childWithDescendant(t){return t.tree!==this.tree?null:(h(this),h(t,1),n._ts_node_child_with_descendant_wasm(this.tree[0]),M(this.tree))}descendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");h(this);let _=c+T;return n.setValue(_,t,"i32"),n.setValue(_+m,r,"i32"),n._ts_node_descendant_for_index_wasm(this.tree[0]),M(this.tree)}namedDescendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");h(this);let _=c+T;return n.setValue(_,t,"i32"),n.setValue(_+m,r,"i32"),n._ts_node_named_descendant_for_index_wasm(this.tree[0]),M(this.tree)}descendantForPosition(t,r=t){if(!Z(t)||!Z(r))throw new Error("Arguments must be {row, column} objects");h(this);let _=c+T;return k(_,t),k(_+L,r),n._ts_node_descendant_for_position_wasm(this.tree[0]),M(this.tree)}namedDescendantForPosition(t,r=t){if(!Z(t)||!Z(r))throw new Error("Arguments must be {row, column} objects");h(this);let _=c+T;return k(_,t),k(_+L,r),n._ts_node_named_descendant_for_position_wasm(this.tree[0]),M(this.tree)}walk(){return h(this),n._ts_tree_cursor_new_wasm(this.tree[0]),new J(F,this.tree)}edit(t){let{point:r,index:_}=t.editPoint(this.startPosition,this.startIndex);this.startPosition=r,this.startIndex=_}toString(){h(this);let t=n._ts_node_to_string_wasm(this.tree[0]),r=n.AsciiToString(t);return n._free(t),r}};function ie(e,t,r,_,s){for(let o=0,u=s.length;o<u;o++){let l=n.getValue(r,"i32");r+=m;let d=M(t,r);r+=T,s[o]={patternIndex:_,name:e.captureNames[l],node:d}}return r}a(ie,"unmarshalCaptures");function h(e,t=0){let r=c+t*T;n.setValue(r,e.id,"i32"),r+=m,n.setValue(r,e.startIndex,"i32"),r+=m,n.setValue(r,e.startPosition.row,"i32"),r+=m,n.setValue(r,e.startPosition.column,"i32"),r+=m,n.setValue(r,e[0],"i32")}a(h,"marshalNode");function M(e,t=c){let r=n.getValue(t,"i32");if(t+=m,r===0)return null;let _=n.getValue(t,"i32");t+=m;let s=n.getValue(t,"i32");t+=m;let o=n.getValue(t,"i32");t+=m;let u=n.getValue(t,"i32");return new ee(F,{id:r,tree:e,startIndex:_,startPosition:{row:s,column:o},other:u})}a(M,"unmarshalNode");function b({handles:e},t=c){n.setValue(t+0*m,e[0],"i32"),n.setValue(t+1*m,e[1],"i32"),n.setValue(t+2*m,e[2],"i32"),n.setValue(t+3*m,e[3],"i32")}a(b,"marshalTreeCursor");function O({handles:e}){e[0]=n.getValue(c+0*m,"i32"),e[1]=n.getValue(c+1*m,"i32"),e[2]=n.getValue(c+2*m,"i32"),e[3]=n.getValue(c+3*m,"i32")}a(O,"unmarshalTreeCursor");function k(e,t){n.setValue(e,t.row,"i32"),n.setValue(e+m,t.column,"i32")}a(k,"marshalPoint");function Q(e){return{row:n.getValue(e,"i32")>>>0,column:n.getValue(e+m,"i32")>>>0}}a(Q,"unmarshalPoint");function be(e,t){k(e,t.startPosition),e+=L,k(e,t.endPosition),e+=L,n.setValue(e,t.startIndex,"i32"),e+=m,n.setValue(e,t.endIndex,"i32")}a(be,"marshalRange");function Y(e){let t={};return t.startPosition=Q(e),e+=L,t.endPosition=Q(e),e+=L,t.startIndex=n.getValue(e,"i32")>>>0,e+=m,t.endIndex=n.getValue(e,"i32")>>>0,t}a(Y,"unmarshalRange");function ye(e,t=c){k(t,e.startPosition),t+=L,k(t,e.oldEndPosition),t+=L,k(t,e.newEndPosition),t+=L,n.setValue(t,e.startIndex,"i32"),t+=m,n.setValue(t,e.oldEndIndex,"i32"),t+=m,n.setValue(t,e.newEndIndex,"i32")}a(ye,"marshalEdit");function Pe(e){let t=n.getValue(e,"i32"),r=n.getValue(e+=m,"i32"),_=n.getValue(e+m,"i32");return{major_version:t,minor_version:r,patch_version:_}}a(Pe,"unmarshalLanguageMetadata");var Fe=/^tree_sitter_\w+$/,j=class{static{a(this,"Language")}0=0;types;fields;constructor(t,r){D(t),this[0]=r,this.types=new Array(n._ts_language_symbol_count(this[0]));for(let _=0,s=this.types.length;_<s;_++)n._ts_language_symbol_type(this[0],_)<2&&(this.types[_]=n.UTF8ToString(n._ts_language_symbol_name(this[0],_)));this.fields=new Array(n._ts_language_field_count(this[0])+1);for(let _=0,s=this.fields.length;_<s;_++){let o=n._ts_language_field_name_for_id(this[0],_);o!==0?this.fields[_]=n.UTF8ToString(o):this.fields[_]=null}}get name(){let t=n._ts_language_name(this[0]);return t===0?null:n.UTF8ToString(t)}get abiVersion(){return n._ts_language_abi_version(this[0])}get metadata(){return n._ts_language_metadata_wasm(this[0]),n.getValue(c,"i32")===0?null:Pe(c+m)}get fieldCount(){return this.fields.length-1}get stateCount(){return n._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=n._malloc(_+1);n.stringToUTF8(t,s,_+1);let o=n._ts_language_symbol_for_name(this[0],s,_,r?1:0);return n._free(s),o||null}get nodeTypeCount(){return n._ts_language_symbol_count(this[0])}nodeTypeForId(t){let r=n._ts_language_symbol_name(this[0],t);return r?n.UTF8ToString(r):null}nodeTypeIsNamed(t){return!!n._ts_language_type_is_named_wasm(this[0],t)}nodeTypeIsVisible(t){return!!n._ts_language_type_is_visible_wasm(this[0],t)}get supertypes(){n._ts_language_supertypes_wasm(this[0]);let t=n.getValue(c,"i32"),r=n.getValue(c+m,"i32"),_=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)_[o]=n.getValue(s,"i16"),s+=oe}return _}subtypes(t){n._ts_language_subtypes_wasm(this[0],t);let r=n.getValue(c,"i32"),_=n.getValue(c+m,"i32"),s=new Array(r);if(r>0){let o=_;for(let u=0;u<r;u++)s[u]=n.getValue(o,"i16"),o+=oe}return s}nextState(t,r){return n._ts_language_next_state(this[0],t,r)}lookaheadIterator(t){let r=n._ts_lookahead_iterator_new(this[0],t);return r?new K(F,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 u=await s.text();throw new Error(`Language.load failed with status ${s.status}.
1
+ var Fe=Object.defineProperty;var a=(e,t)=>Fe(e,"name",{value:t,configurable:!0});var ae=class{static{a(this,"Edit")}startPosition;oldEndPosition;newEndPosition;startIndex;oldEndIndex;newEndIndex;constructor({startIndex:t,oldEndIndex:r,newEndIndex:_,startPosition:s,oldEndPosition:o,newEndPosition:u}){this.startIndex=t>>>0,this.oldEndIndex=r>>>0,this.newEndIndex=_>>>0,this.startPosition=s,this.oldEndPosition=o,this.newEndPosition=u}editPoint(t,r){let _=r,s={...t};if(r>=this.oldEndIndex){_=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&&(_=this.newEndIndex,s.row=this.newEndPosition.row,s.column=this.newEndPosition.column);return{point:s,index:_}}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 oe=2,m=4,ne=4*m,I=5*m,k=2*m,j=2*m+2*k,S={row:0,column:0},F=Symbol("INTERNAL");function D(e){if(e!==F)throw new Error("Illegal constructor")}a(D,"assertInternal");function K(e){return!!e&&typeof e.row=="number"&&typeof e.column=="number"}a(K,"isPoint");function he(e){n=e}a(he,"setModule");var n;function H(e){try{return new FinalizationRegistry(e)}catch(t){console.error("Unsupported FinalizationRegistry:",t);return}}a(H,"newFinalizer");var pe=H(e=>{n._ts_lookahead_iterator_delete(e)}),X=class{static{a(this,"LookaheadIterator")}0=0;language;positioned=!1;constructor(t,r,_){D(t),this[0]=r,this.language=_,pe?.register(this,r,this)}get currentTypeId(){return this.positioned?n._ts_lookahead_iterator_current_symbol(this[0]):null}get currentType(){let t=this.currentTypeId;return t===null?null:this.language.types[t]??n.UTF8ToString(n._ts_language_symbol_name(this.language[0],t))}delete(){pe?.unregister(this),n._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(t,r){return n._ts_lookahead_iterator_reset(this[0],t[0],r)?(this.language=t,this.positioned=!1,!0):!1}resetState(t){return n._ts_lookahead_iterator_reset_state(this[0],t)?(this.positioned=!1,!0):!1}[Symbol.iterator](){return{next:a(()=>{this.positioned=!!n._ts_lookahead_iterator_next(this[0]);let t=this.currentType;return t===null?{done:!0,value:""}:{done:!1,value:t}},"next")}}};function _e(e,t,r,_){let s=r-t,o=e.textCallback(t,_);if(o){for(t+=o.length;t<r;){let u=e.textCallback(t,_);if(u&&u.length>0)t+=u.length,o+=u;else break}t>r&&(o=o.slice(0,s))}return o??""}a(_e,"getText");var we=H(e=>{n._ts_tree_delete(e)}),Y=class e{static{a(this,"Tree")}0=0;textCallback;language;constructor(t,r,_,s){D(t),this[0]=r,this.language=_,this.textCallback=s,we?.register(this,r,this)}copy(){let t=n._ts_tree_copy(this[0]);return new e(F,t,this.language,this.textCallback)}delete(){we?.unregister(this),n._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return n._ts_tree_root_node_wasm(this[0]),E(this)}rootNodeWithOffset(t,r){let _=d+I;return n.setValue(_,t,"i32"),C(_+m,r),n._ts_tree_root_node_with_offset_wasm(this[0]),E(this)}edit(t){ye(t),n._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");n._ts_tree_get_changed_ranges_wasm(this[0],t[0]);let r=n.getValue(d,"i32"),_=n.getValue(d+m,"i32"),s=new Array(r);if(r>0){let o=_;for(let u=0;u<r;u++)s[u]=J(o),o+=j;n._free(_)}return s}getIncludedRanges(){n._ts_tree_included_ranges_wasm(this[0]);let t=n.getValue(d,"i32"),r=n.getValue(d+m,"i32"),_=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)_[o]=J(s),s+=j;n._free(r)}return _}};var be=H(e=>{P({handles:e}),n._ts_tree_cursor_delete_wasm(0)}),ee=class e{static{a(this,"TreeCursor")}handles=[0,0,0,0];tree;constructor(t,r){D(t),this.tree=r,O(this),be?.register(this,this.handles,this)}copy(){return P(this),n._ts_tree_cursor_copy_wasm(this.tree[0]),new e(F,this.tree)}delete(){be?.unregister(this),P(this),n._ts_tree_cursor_delete_wasm(this.tree[0]),this.handles.fill(0)}get currentNode(){return P(this),n._ts_tree_cursor_current_node_wasm(this.tree[0]),E(this.tree)}get currentFieldId(){return P(this),n._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return P(this),n._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return P(this),n._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return P(this),n._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return P(this),n._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return P(this),n._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return P(this),n._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return P(this),n._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){P(this);let t=n._ts_tree_cursor_start_index_wasm(this.tree[0]),r=n._ts_tree_cursor_end_index_wasm(this.tree[0]);n._ts_tree_cursor_start_position_wasm(this.tree[0]);let _=B(d);return _e(this.tree,t,r,_)}get startPosition(){return P(this),n._ts_tree_cursor_start_position_wasm(this.tree[0]),B(d)}get endPosition(){return P(this),n._ts_tree_cursor_end_position_wasm(this.tree[0]),B(d)}get startIndex(){return P(this),n._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return P(this),n._ts_tree_cursor_end_index_wasm(this.tree[0])}gotoFirstChild(){P(this);let t=n._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return O(this),t===1}gotoLastChild(){P(this);let t=n._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return O(this),t===1}gotoParent(){P(this);let t=n._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return O(this),t===1}gotoNextSibling(){P(this);let t=n._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return O(this),t===1}gotoPreviousSibling(){P(this);let t=n._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return O(this),t===1}gotoDescendant(t){P(this),n._ts_tree_cursor_goto_descendant_wasm(this.tree[0],t),O(this)}gotoFirstChildForIndex(t){P(this),n.setValue(d+ne,t,"i32");let r=n._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return O(this),r===1}gotoFirstChildForPosition(t){P(this),C(d+ne,t);let r=n._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return O(this),r===1}reset(t){h(t),P(this,d+I),n._ts_tree_cursor_reset_wasm(t.tree[0]),O(this),this.tree=t.tree}resetTo(t){P(this,d),P(t,d+ne),n._ts_tree_cursor_reset_to_wasm(this.tree[0],t.tree[0]),O(this),this.tree=t.tree}};var te=class{static{a(this,"Node")}0=0;_children;_namedChildren;constructor(t,{id:r,tree:_,startIndex:s,startPosition:o,other:u}){D(t),this[0]=u,this.id=r,this.tree=_,this.startIndex=s,this.startPosition=o}id;startIndex;startPosition;tree;get typeId(){return h(this),n._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return h(this),n._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 h(this),n._ts_node_is_named_wasm(this.tree[0])===1}get isExtra(){return h(this),n._ts_node_is_extra_wasm(this.tree[0])===1}get isError(){return h(this),n._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return h(this),n._ts_node_is_missing_wasm(this.tree[0])===1}get hasChanges(){return h(this),n._ts_node_has_changes_wasm(this.tree[0])===1}get hasError(){return h(this),n._ts_node_has_error_wasm(this.tree[0])===1}get endIndex(){return h(this),n._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return h(this),n._ts_node_end_point_wasm(this.tree[0]),B(d)}get text(){return _e(this.tree,this.startIndex,this.endIndex,this.startPosition)}get parseState(){return h(this),n._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return h(this),n._ts_node_next_parse_state_wasm(this.tree[0])}equals(t){return this.tree===t.tree&&this.id===t.id}child(t){return h(this),n._ts_node_child_wasm(this.tree[0],t),E(this.tree)}namedChild(t){return h(this),n._ts_node_named_child_wasm(this.tree[0],t),E(this.tree)}childForFieldId(t){return h(this),n._ts_node_child_by_field_id_wasm(this.tree[0],t),E(this.tree)}childForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1?this.childForFieldId(r):null}fieldNameForChild(t){h(this);let r=n._ts_node_field_name_for_child_wasm(this.tree[0],t);return r?n.AsciiToString(r):null}fieldNameForNamedChild(t){h(this);let r=n._ts_node_field_name_for_named_child_wasm(this.tree[0],t);return r?n.AsciiToString(r):null}childrenForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1&&r!==0?this.childrenForFieldId(r):[]}childrenForFieldId(t){h(this),n._ts_node_children_by_field_id_wasm(this.tree[0],t);let r=n.getValue(d,"i32"),_=n.getValue(d+m,"i32"),s=new Array(r);if(r>0){let o=_;for(let u=0;u<r;u++)s[u]=E(this.tree,o),o+=I;n._free(_)}return s}firstChildForIndex(t){h(this);let r=d+I;return n.setValue(r,t,"i32"),n._ts_node_first_child_for_byte_wasm(this.tree[0]),E(this.tree)}firstNamedChildForIndex(t){h(this);let r=d+I;return n.setValue(r,t,"i32"),n._ts_node_first_named_child_for_byte_wasm(this.tree[0]),E(this.tree)}get childCount(){return h(this),n._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return h(this),n._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){h(this),n._ts_node_children_wasm(this.tree[0]);let t=n.getValue(d,"i32"),r=n.getValue(d+m,"i32");if(this._children=new Array(t),t>0){let _=r;for(let s=0;s<t;s++)this._children[s]=E(this.tree,_),_+=I;n._free(r)}}return this._children}get namedChildren(){if(!this._namedChildren){h(this),n._ts_node_named_children_wasm(this.tree[0]);let t=n.getValue(d,"i32"),r=n.getValue(d+m,"i32");if(this._namedChildren=new Array(t),t>0){let _=r;for(let s=0;s<t;s++)this._namedChildren[s]=E(this.tree,_),_+=I;n._free(r)}}return this._namedChildren}descendantsOfType(t,r=S,_=S){Array.isArray(t)||(t=[t]);let s=[],o=this.tree.language.types;for(let f=0,g=o.length;f<g;f++)t.includes(o[f])&&s.push(f);t.includes("ERROR")&&s.push(65535);let u=n._malloc(m*s.length);for(let f=0,g=s.length;f<g;f++)n.setValue(u+f*m,s[f],"i32");h(this),n._ts_node_descendants_of_type_wasm(this.tree[0],u,s.length,r.row,r.column,_.row,_.column);let l=n.getValue(d,"i32"),c=n.getValue(d+m,"i32"),w=new Array(l);if(l>0){let f=c;for(let g=0;g<l;g++)w[g]=E(this.tree,f),f+=I}return n._free(c),n._free(u),w}get nextSibling(){return h(this),n._ts_node_next_sibling_wasm(this.tree[0]),E(this.tree)}get previousSibling(){return h(this),n._ts_node_prev_sibling_wasm(this.tree[0]),E(this.tree)}get nextNamedSibling(){return h(this),n._ts_node_next_named_sibling_wasm(this.tree[0]),E(this.tree)}get previousNamedSibling(){return h(this),n._ts_node_prev_named_sibling_wasm(this.tree[0]),E(this.tree)}get descendantCount(){return h(this),n._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return h(this),n._ts_node_parent_wasm(this.tree[0]),E(this.tree)}childWithDescendant(t){return t.tree!==this.tree?null:(h(this),h(t,1),n._ts_node_child_with_descendant_wasm(this.tree[0]),E(this.tree))}descendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");h(this);let _=d+I;return n.setValue(_,t,"i32"),n.setValue(_+m,r,"i32"),n._ts_node_descendant_for_index_wasm(this.tree[0]),E(this.tree)}namedDescendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");h(this);let _=d+I;return n.setValue(_,t,"i32"),n.setValue(_+m,r,"i32"),n._ts_node_named_descendant_for_index_wasm(this.tree[0]),E(this.tree)}descendantForPosition(t,r=t){if(!K(t)||!K(r))throw new Error("Arguments must be {row, column} objects");h(this);let _=d+I;return C(_,t),C(_+k,r),n._ts_node_descendant_for_position_wasm(this.tree[0]),E(this.tree)}namedDescendantForPosition(t,r=t){if(!K(t)||!K(r))throw new Error("Arguments must be {row, column} objects");h(this);let _=d+I;return C(_,t),C(_+k,r),n._ts_node_named_descendant_for_position_wasm(this.tree[0]),E(this.tree)}walk(){return h(this),n._ts_tree_cursor_new_wasm(this.tree[0]),new ee(F,this.tree)}edit(t){let{point:r,index:_}=t.editPoint(this.startPosition,this.startIndex);this.startPosition=r,this.startIndex=_}toString(){h(this);let t=n._ts_node_to_string_wasm(this.tree[0]),r=n.AsciiToString(t);return n._free(t),r}};function ie(e,t,r,_,s){for(let o=0,u=s.length;o<u;o++){let l=n.getValue(r,"i32");r+=m;let c=E(t,r);r+=I,s[o]={patternIndex:_,name:e.captureNames[l],node:c}}return r}a(ie,"unmarshalCaptures");function h(e,t=0){let r=d+t*I;n.setValue(r,e.id,"i32"),r+=m,n.setValue(r,e.startIndex,"i32"),r+=m,n.setValue(r,e.startPosition.row,"i32"),r+=m,n.setValue(r,e.startPosition.column,"i32"),r+=m,n.setValue(r,e[0],"i32")}a(h,"marshalNode");function E(e,t=d){let r=n.getValue(t,"i32");if(t+=m,r===0)return null;let _=n.getValue(t,"i32");t+=m;let s=n.getValue(t,"i32");t+=m;let o=n.getValue(t,"i32");t+=m;let u=n.getValue(t,"i32");return new te(F,{id:r,tree:e,startIndex:_,startPosition:{row:s,column:o},other:u})}a(E,"unmarshalNode");function P({handles:e},t=d){n.setValue(t+0*m,e[0],"i32"),n.setValue(t+1*m,e[1],"i32"),n.setValue(t+2*m,e[2],"i32"),n.setValue(t+3*m,e[3],"i32")}a(P,"marshalTreeCursor");function O({handles:e}){e[0]=n.getValue(d+0*m,"i32"),e[1]=n.getValue(d+1*m,"i32"),e[2]=n.getValue(d+2*m,"i32"),e[3]=n.getValue(d+3*m,"i32")}a(O,"unmarshalTreeCursor");function C(e,t){n.setValue(e,t.row,"i32"),n.setValue(e+m,t.column,"i32")}a(C,"marshalPoint");function B(e){return{row:n.getValue(e,"i32")>>>0,column:n.getValue(e+m,"i32")>>>0}}a(B,"unmarshalPoint");function Pe(e,t){C(e,t.startPosition),e+=k,C(e,t.endPosition),e+=k,n.setValue(e,t.startIndex,"i32"),e+=m,n.setValue(e,t.endIndex,"i32")}a(Pe,"marshalRange");function J(e){let t={};return t.startPosition=B(e),e+=k,t.endPosition=B(e),e+=k,t.startIndex=n.getValue(e,"i32")>>>0,e+=m,t.endIndex=n.getValue(e,"i32")>>>0,t}a(J,"unmarshalRange");function ye(e,t=d){C(t,e.startPosition),t+=k,C(t,e.oldEndPosition),t+=k,C(t,e.newEndPosition),t+=k,n.setValue(t,e.startIndex,"i32"),t+=m,n.setValue(t,e.oldEndIndex,"i32"),t+=m,n.setValue(t,e.newEndIndex,"i32")}a(ye,"marshalEdit");function ve(e){let t=n.getValue(e,"i32"),r=n.getValue(e+=m,"i32"),_=n.getValue(e+m,"i32");return{major_version:t,minor_version:r,patch_version:_}}a(ve,"unmarshalLanguageMetadata");var Ce=/^tree_sitter_\w+$/,Z=class{static{a(this,"Language")}0=0;types;fields;constructor(t,r){D(t),this[0]=r,this.types=new Array(n._ts_language_symbol_count(this[0]));for(let _=0,s=this.types.length;_<s;_++)n._ts_language_symbol_type(this[0],_)<2&&(this.types[_]=n.UTF8ToString(n._ts_language_symbol_name(this[0],_)));this.fields=new Array(n._ts_language_field_count(this[0])+1);for(let _=0,s=this.fields.length;_<s;_++){let o=n._ts_language_field_name_for_id(this[0],_);o!==0?this.fields[_]=n.UTF8ToString(o):this.fields[_]=null}}get name(){let t=n._ts_language_name(this[0]);return t===0?null:n.UTF8ToString(t)}get abiVersion(){return n._ts_language_abi_version(this[0])}get metadata(){return n._ts_language_metadata_wasm(this[0]),n.getValue(d,"i32")===0?null:ve(d+m)}get fieldCount(){return this.fields.length-1}get stateCount(){return n._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=n._malloc(_+1);n.stringToUTF8(t,s,_+1);let o=n._ts_language_symbol_for_name(this[0],s,_,r?1:0);return n._free(s),o||null}get nodeTypeCount(){return n._ts_language_symbol_count(this[0])}nodeTypeForId(t){let r=n._ts_language_symbol_name(this[0],t);return r?n.UTF8ToString(r):null}nodeTypeIsNamed(t){return!!n._ts_language_type_is_named_wasm(this[0],t)}nodeTypeIsVisible(t){return!!n._ts_language_type_is_visible_wasm(this[0],t)}get supertypes(){n._ts_language_supertypes_wasm(this[0]);let t=n.getValue(d,"i32"),r=n.getValue(d+m,"i32"),_=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)_[o]=n.getValue(s,"i16"),s+=oe}return _}subtypes(t){n._ts_language_subtypes_wasm(this[0],t);let r=n.getValue(d,"i32"),_=n.getValue(d+m,"i32"),s=new Array(r);if(r>0){let o=_;for(let u=0;u<r;u++)s[u]=n.getValue(o,"i16"),o+=oe}return s}nextState(t,r){return n._ts_language_next_state(this[0],t,r)}lookaheadIterator(t){let r=n._ts_lookahead_iterator_new(this[0],t);return r?new X(F,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 u=await s.text();throw new Error(`Language.load failed with status ${s.status}.
2
2
 
3
- ${u}`)}let o=s.clone();try{r=await WebAssembly.compileStreaming(s)}catch(u){console.error("wasm streaming compile failed:",u),console.error("falling back to ArrayBuffer instantiation"),r=new Uint8Array(await o.arrayBuffer())}}let _=await n.loadWebAssemblyModule(r,{loadAsync:!0});return ve(_,{sync:!1})}static loadSync(t){let r=n.loadWebAssemblyModule(t,{loadAsync:!1});return ve(r,{sync:!0})}};function ve(e,{sync:t}){let r=Object.keys(e),_=r.find(o=>Fe.test(o)&&!o.includes("external_scanner_"));if(!_)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[_]();return new j(F,s)}a(ve,"loadFromWasmExports");async function ke(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.currentQueryProgressCallback=null,Module.currentProgressCallback=null,Module.currentLogCallback=null,Module.currentParseCallback=null;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,_)=>{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}_(s.status)},s.onerror=_,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),_=await WebAssembly.instantiate(r,t);return _}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 _=fetch(t,{credentials:"same-origin"}),s=await WebAssembly.instantiateStreaming(_,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,u){wasmExports=o.exports,wasmExports=relocateExports(wasmExports,1024);var l=getDylinkMetadata(u);return l.neededDynlibs&&(dynamicLibraries=l.neededDynlibs.concat(dynamicLibraries)),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,u)=>{Module.instantiateWasm(r,(l,d)=>{o(e(l,d))})});wasmBinaryFile??=findWasmBinary();var _=await instantiateAsync(wasmBinary,wasmBinaryFile,r),s=t(_);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,_)=>{var s=t+r;if(_)return s;for(;e[t]&&!(t>=s);)++t;return t},"findStringEnd"),UTF8ArrayToString=a((e,t=0,r,_)=>{var s=findStringEnd(e,t,r,_);if(s-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,s));for(var o="";t<s;){var u=e[t++];if(!(u&128)){o+=String.fromCharCode(u);continue}var l=e[t++]&63;if((u&224)==192){o+=String.fromCharCode((u&31)<<6|l);continue}var d=e[t++]&63;if((u&240)==224?u=(u&15)<<12|l<<6|d:u=(u&7)<<18|l<<12|d<<6|e[t++]&63,u<65536)o+=String.fromCharCode(u);else{var p=u-65536;o+=String.fromCharCode(55296|p>>10,56320|p&1023)}}return o},"UTF8ArrayToString"),getDylinkMetadata=a(e=>{var t=0,r=0;function _(){return e[t++]}a(_,"getU8");function s(){for(var V=0,B=1;;){var ge=e[t++];if(V+=(ge&127)*B,B*=128,!(ge&128))break}return V}a(s,"getLEB");function o(){var V=s();return t+=V,UTF8ArrayToString(e,t-V,V)}a(o,"getString");function u(){for(var V=s(),B=[];V--;)B.push(o());return B}a(u,"getStringList");function l(V,B){if(V)throw new Error(B)}if(a(l,"failIf"),e instanceof WebAssembly.Module){var d=WebAssembly.Module.customSections(e,"dylink.0");l(d.length===0,"need dylink section"),e=new Uint8Array(d[0]),r=e.length}else{var p=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),f=p[0]==1836278016||p[0]==6386541;l(!f,"need to see wasm magic number"),l(e[8]!==0,"need the dylink section to be first"),t=9;var g=s();r=t+g;var v=o();l(v!=="dylink.0")}for(var P={neededDynlibs:[],tlsExports:new Set,weakImports:new Set,runtimePaths:[]},S=1,C=2,R=3,y=4,A=5,w=256,I=3,E=1;t<r;){var N=_(),W=s();if(N===S)P.memorySize=s(),P.memoryAlign=s(),P.tableSize=s(),P.tableAlign=s();else if(N===C)P.neededDynlibs=u();else if(N===R)for(var x=s();x--;){var z=o(),se=s();se&w&&P.tlsExports.add(z)}else if(N===y)for(var x=s();x--;){var Ge=o(),z=o(),se=s();(se&I)==E&&P.weakImports.add(z)}else N===A?P.runtimePaths=u():t+=W}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 _={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=_,t!=null&&(LDSO.loadedLibsByHandle[t]=_),_},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=82496,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),_=new WebAssembly.Module(r),s=new WebAssembly.Instance(_,{e:{f:e}}),o=s.exports.f;return o},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:39,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 _=getWasmTableEntry(r);_&&functionsInTableMap.set(_,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 _=getEmptyTableSlot();try{setWasmTableEntry(_,e)}catch(o){if(!(o instanceof TypeError))throw o;var s=convertJsFunctionToWasm(e,t);setWasmTableEntry(_,s)}return functionsInTableMap.set(e,_),_},"addFunction"),updateGOT=a((e,t)=>{for(var r in e)if(!isInternalSym(r)){var _=e[r];GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(t||GOT[r].value==0)&&(typeof _=="function"?GOT[r].value=addFunction(_):typeof _=="number"?GOT[r].value=_:err(`unhandled export type for '${r}': ${typeof _}`))}},"updateGOT"),relocateExports=a((e,t,r)=>{var _={};for(var s in e){var o=e[s];typeof o=="object"&&(o=o.value),typeof o=="number"&&(o+=t),_[s]=o}return updateGOT(_,r),_},"relocateExports"),isSymbolDefined=a(e=>{var t=wasmImports[e];return!(!t||t.stub)},"isSymbolDefined"),dynCall=a((e,t,r=[],_=!1)=>{var s=getWasmTableEntry(t),o=s(...r);function u(l){return l}return a(u,"convert"),o},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(e=>__emscripten_stack_restore(e),"stackRestore"),createInvokeFunction=a(e=>(t,...r)=>{var _=stackSave();try{return dynCall(e,t,r)}catch(s){if(stackRestore(_),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 _;e[t]=(...s)=>(_||=resolveSymbol(t),_(...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,_]of Object.entries(e)){let s=a(u=>{isSymbolDefined(u)||(wasmImports[u]=_)},"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,_){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++,_&&(LDSO.loadedLibsByHandle[_]=s),t.loadAsync?Promise.resolve(!0):!0;s=newDSO(e,_,"loading"),s.refcount=t.nodelete?1/0:1,s.global=t.global;function o(){if(_){var d=LE_HEAP_LOAD_U32((_+28>>2)*4),p=LE_HEAP_LOAD_U32((_+32>>2)*4);if(d&&p){var f=HEAP8.slice(d,d+p);return t.loadAsync?Promise.resolve(f):f}}var g=locateFile(e);if(t.loadAsync)return asyncLoad(g);if(!readBinary)throw new Error(`${g}: file not found, and synchronous loading of external files is not available`);return readBinary(g)}a(o,"loadLibData");function u(){return t.loadAsync?o().then(d=>loadWebAssemblyModule(d,t,e,r,_)):loadWebAssemblyModule(o(),t,e,r,_)}a(u,"getExports");function l(d){s.global?mergeLibSymbols(d,e):r&&Object.assign(r,d),s.exports=d}return a(l,"moduleLoaded"),t.loadAsync?u().then(d=>(l(d),!0)):(l(u()),!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=82496,___stack_low=16960,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},82496),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=a(()=>abort(""),"__abort_js");__abort_js.sig="v";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 _=1;_<=4;_*=2){var s=t*(1+.2/_);s=Math.min(s,e+100663296);var o=Math.min(r,alignMemory(Math.max(e,s),65536)),u=growMemory(o);if(u)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=a(e=>52,"_fd_close");_fd_close.sig="ii";var INT53_MAX=9007199254740992,INT53_MIN=-9007199254740992,bigintToI53Checked=a(e=>e<INT53_MIN||e>INT53_MAX?NaN:Number(e),"bigintToI53Checked");function _fd_seek(e,t,r,_){return t=bigintToI53Checked(t),70}a(_fd_seek,"_fd_seek"),_fd_seek.sig="iijip";var printCharBuffers=[null,[],[]],printChar=a((e,t)=>{var r=printCharBuffers[e];t===0||t===10?((e===1?out:err)(UTF8ArrayToString(r)),r.length=0):r.push(t)},"printChar"),_fd_write=a((e,t,r,_)=>{for(var s=0,o=0;o<r;o++){var u=LE_HEAP_LOAD_U32((t>>2)*4),l=LE_HEAP_LOAD_U32((t+4>>2)*4);t+=8;for(var d=0;d<l;d++)printChar(e,HEAPU8[u+d]);s+=l}return LE_HEAP_STORE_U32((_>>2)*4,s),0},"_fd_write");_fd_write.sig="iippp";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,_,s){let u=Module.currentParseCallback(t,{row:r,column:_});typeof u=="string"?(setValue(s,u.length,"i32"),stringToUTF16(u,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}):!1}a(_tree_sitter_progress_callback,"_tree_sitter_progress_callback");function _tree_sitter_query_progress_callback(e){return Module.currentQueryProgressCallback?Module.currentQueryProgressCallback({currentOffset:e}):!1}a(_tree_sitter_query_progress_callback,"_tree_sitter_query_progress_callback");var runtimeKeepaliveCounter=0,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"),handleException=a(e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},"handleException"),lengthBytesUTF8=a(e=>{for(var t=0,r=0;r<e.length;++r){var _=e.charCodeAt(r);_<=127?t++:_<=2047?t+=2:_>=55296&&_<=57343?(t+=4,++r):t+=3}return t},"lengthBytesUTF8"),stringToUTF8Array=a((e,t,r,_)=>{if(!(_>0))return 0;for(var s=r,o=r+_-1,u=0;u<e.length;++u){var l=e.codePointAt(u);if(l<=127){if(r>=o)break;t[r++]=l}else if(l<=2047){if(r+1>=o)break;t[r++]=192|l>>6,t[r++]=128|l&63}else if(l<=65535){if(r+2>=o)break;t[r++]=224|l>>12,t[r++]=128|l>>6&63,t[r++]=128|l&63}else{if(r+3>=o)break;t[r++]=240|l>>18,t[r++]=128|l>>12&63,t[r++]=128|l>>6&63,t[r++]=128|l&63,u++}}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 _=t,s=r<e.length*2?r/2:e.length,o=0;o<s;++o){var u=e.charCodeAt(o);LE_HEAP_STORE_I16((t>>1)*2,u),t+=2}return LE_HEAP_STORE_I16((t>>1)*2,0),t-_},"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={},_malloc,_calloc,_realloc,_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_reset,_ts_parser_set_language,_ts_parser_set_included_ranges,_memcmp,_ts_query_new,_ts_query_delete,_iswspace,_iswalnum,_ts_query_copy,_ts_query_pattern_count,_ts_query_capture_count,_ts_query_string_count,_ts_query_capture_name_for_id,_ts_query_capture_quantifier_for_id,_ts_query_string_value_for_id,_ts_query_predicates_for_pattern,_ts_query_start_byte_for_pattern,_ts_query_end_byte_for_pattern,_ts_query_is_pattern_rooted,_ts_query_is_pattern_non_local,_ts_query_is_pattern_guaranteed_at_step,_ts_query_disable_capture,_ts_query_disable_pattern,_ts_tree_copy,_ts_tree_delete,_ts_init,_ts_parser_new_wasm,_ts_parser_enable_logger_wasm,_ts_parser_parse_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,_ts_query_matches_wasm,_ts_query_captures_wasm,_memset,_memcpy,_memmove,_iswalpha,_iswblank,_iswdigit,_iswlower,_iswpunct,_iswupper,_iswxdigit,_memchr,_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._malloc=_malloc=e.malloc,Module._calloc=_calloc=e.calloc,Module._realloc=_realloc=e.realloc,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_reset=_ts_parser_reset=e.ts_parser_reset,Module._ts_parser_set_language=_ts_parser_set_language=e.ts_parser_set_language,Module._ts_parser_set_included_ranges=_ts_parser_set_included_ranges=e.ts_parser_set_included_ranges,Module._memcmp=_memcmp=e.memcmp,Module._ts_query_new=_ts_query_new=e.ts_query_new,Module._ts_query_delete=_ts_query_delete=e.ts_query_delete,Module._iswspace=_iswspace=e.iswspace,Module._iswalnum=_iswalnum=e.iswalnum,Module._ts_query_copy=_ts_query_copy=e.ts_query_copy,Module._ts_query_pattern_count=_ts_query_pattern_count=e.ts_query_pattern_count,Module._ts_query_capture_count=_ts_query_capture_count=e.ts_query_capture_count,Module._ts_query_string_count=_ts_query_string_count=e.ts_query_string_count,Module._ts_query_capture_name_for_id=_ts_query_capture_name_for_id=e.ts_query_capture_name_for_id,Module._ts_query_capture_quantifier_for_id=_ts_query_capture_quantifier_for_id=e.ts_query_capture_quantifier_for_id,Module._ts_query_string_value_for_id=_ts_query_string_value_for_id=e.ts_query_string_value_for_id,Module._ts_query_predicates_for_pattern=_ts_query_predicates_for_pattern=e.ts_query_predicates_for_pattern,Module._ts_query_start_byte_for_pattern=_ts_query_start_byte_for_pattern=e.ts_query_start_byte_for_pattern,Module._ts_query_end_byte_for_pattern=_ts_query_end_byte_for_pattern=e.ts_query_end_byte_for_pattern,Module._ts_query_is_pattern_rooted=_ts_query_is_pattern_rooted=e.ts_query_is_pattern_rooted,Module._ts_query_is_pattern_non_local=_ts_query_is_pattern_non_local=e.ts_query_is_pattern_non_local,Module._ts_query_is_pattern_guaranteed_at_step=_ts_query_is_pattern_guaranteed_at_step=e.ts_query_is_pattern_guaranteed_at_step,Module._ts_query_disable_capture=_ts_query_disable_capture=e.ts_query_disable_capture,Module._ts_query_disable_pattern=_ts_query_disable_pattern=e.ts_query_disable_pattern,Module._ts_tree_copy=_ts_tree_copy=e.ts_tree_copy,Module._ts_tree_delete=_ts_tree_delete=e.ts_tree_delete,Module._ts_init=_ts_init=e.ts_init,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_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._ts_query_matches_wasm=_ts_query_matches_wasm=e.ts_query_matches_wasm,Module._ts_query_captures_wasm=_ts_query_captures_wasm=e.ts_query_captures_wasm,Module._memset=_memset=e.memset,Module._memcpy=_memcpy=e.memcpy,Module._memmove=_memmove=e.memmove,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._iswupper=_iswupper=e.iswupper,Module._iswxdigit=_iswxdigit=e.iswxdigit,Module._memchr=_memchr=e.memchr,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_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback,tree_sitter_progress_callback:_tree_sitter_progress_callback,tree_sitter_query_progress_callback:_tree_sitter_query_progress_callback};function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,_=stackAlloc((r+1)*4),s=_;e.forEach(u=>{LE_HEAP_STORE_U32((s>>2)*4,stringToUTF8OnStack(u)),s+=4}),LE_HEAP_STORE_U32((s>>2)*4,0);try{var o=t(r,_);return exitJS(o,!0),o}catch(u){return handleException(u)}}}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(ke,"Module");var ue=ke;var te=null;async function Me(e){if(te)return te;let{wasmModule:t,...r}=e??{};if(!t)return te??=await ue(r);let _=new Promise((s,o)=>{r.instantiateWasm=(u,l)=>(WebAssembly.instantiate(t,u).then(d=>{l(d,t)}).catch(o),{})});return te??=await Promise.race([ue(r),_])}a(Me,"initializeBinding");function Ae(){return!!te}a(Ae,"checkModule");var c,_e;function de(e){let t=n._ts_language_abi_version(e[0]);if(t!==_e)throw new Error(`Incompatible language version 0x${(t>>>0).toString(16)}. Expected 0x${_e.toString(16)}.`)}a(de,"assertSupportedLanguage");var Ie,Ee=H(e=>{n._ts_parser_delete(e[0]),n._free(e[1])}),le=class{static{a(this,"Parser")}0=0;1=0;logCallback=null;language=null;static async init(t){fe(await Me(t)),c=n._ts_init(),_e=n.getValue(c,"i32"),Ie=n.getValue(c+m,"i32")}constructor(){this.initialize(),Ee?.register(this,[this[0],this[1]],this)}initialize(){if(!Ae())throw new Error("cannot construct a Parser before calling `init()`");n._ts_parser_new_wasm(),this[0]=n.getValue(c,"i32"),this[1]=n.getValue(c+m,"i32")}delete(){Ee?.unregister(this),n._ts_parser_delete(this[0]),n._free(this[1]),this[0]=0,this[1]=0}setLanguage(t){let r;if(!t)r=0,this.language=null;else if(t.constructor===j)r=t[0],de(t),this.language=t;else throw new Error("Argument must be a Language");return n._ts_parser_set_language(this[0],r),this}parse(t,r,_){if(typeof t=="string")n.currentParseCallback=d=>t.slice(d);else if(typeof t=="function")n.currentParseCallback=t;else throw new Error("Argument must be a string or a function");_?.progressCallback?n.currentProgressCallback=_.progressCallback:n.currentProgressCallback=null,this.logCallback?(n.currentLogCallback=this.logCallback,n._ts_parser_enable_logger_wasm(this[0],1)):(n.currentLogCallback=null,n._ts_parser_enable_logger_wasm(this[0],0));let s=0,o=0;if(_?.includedRanges){s=_.includedRanges.length,o=n._calloc(s,G);let d=o;for(let p=0;p<s;p++)be(d,_.includedRanges[p]),d+=G}let u=n._ts_parser_parse_wasm(this[0],this[1],r?r[0]:0,o,s);if(!u)return n.currentParseCallback=null,n.currentLogCallback=null,n.currentProgressCallback=null,null;if(!this.language)throw new Error("Parser must have a language to parse");let l=new X(F,u,this.language,n.currentParseCallback);return n.currentParseCallback=null,n.currentLogCallback=null,n.currentProgressCallback=null,l}reset(){n._ts_parser_reset(this[0])}getIncludedRanges(){n._ts_parser_included_ranges_wasm(this[0]);let t=n.getValue(c,"i32"),r=n.getValue(c+m,"i32"),_=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)_[o]=Y(s),s+=G;n._free(r)}return _}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}};var Le=1,Oe=2,Ue=/[\w-]+/g,Ve={Zero:0,ZeroOrOne:1,ZeroOrMore:2,One:3,OneOrMore:4},Te=a(e=>e.type==="capture","isCaptureStep"),me=a(e=>e.type==="string","isStringStep"),U={Syntax:1,NodeName:2,FieldName:3,CaptureName:4,PatternStructure:5},$=class e extends Error{constructor(r,_,s,o){super(e.formatMessage(r,_));this.kind=r;this.info=_;this.index=s;this.length=o;this.name="QueryError"}kind;info;index;length;static{a(this,"QueryError")}static formatMessage(r,_){switch(r){case U.NodeName:return`Bad node name '${_.word}'`;case U.FieldName:return`Bad field name '${_.word}'`;case U.CaptureName:return`Bad capture name @${_.word}`;case U.PatternStructure:return`Bad pattern structure at offset ${_.suffix}`;case U.Syntax:return`Bad syntax at offset ${_.suffix}`}}};function qe(e,t,r,_){if(e.length!==3)throw new Error(`Wrong number of arguments to \`#${r}\` predicate. Expected 2, got ${e.length-1}`);if(!Te(e[1]))throw new Error(`First argument of \`#${r}\` predicate must be a capture. Got "${e[1].value}"`);let s=r==="eq?"||r==="any-eq?",o=!r.startsWith("any-");if(Te(e[2])){let u=e[1].name,l=e[2].name;_[t].push(d=>{let p=[],f=[];for(let v of d)v.name===u&&p.push(v.node),v.name===l&&f.push(v.node);let g=a((v,P,S)=>S?v.text===P.text:v.text!==P.text,"compare");return o?p.every(v=>f.some(P=>g(v,P,s))):p.some(v=>f.some(P=>g(v,P,s)))})}else{let u=e[1].name,l=e[2].value,d=a(f=>f.text===l,"matches"),p=a(f=>f.text!==l,"doesNotMatch");_[t].push(f=>{let g=[];for(let P of f)P.name===u&&g.push(P.node);let v=s?d:p;return o?g.every(v):g.some(v)})}}a(qe,"parseAnyPredicate");function De(e,t,r,_){if(e.length!==3)throw new Error(`Wrong number of arguments to \`#${r}\` predicate. Expected 2, got ${e.length-1}.`);if(e[1].type!=="capture")throw new Error(`First argument of \`#${r}\` predicate must be a capture. Got "${e[1].value}".`);if(e[2].type!=="string")throw new Error(`Second argument of \`#${r}\` predicate must be a string. Got @${e[2].name}.`);let s=r==="match?"||r==="any-match?",o=!r.startsWith("any-"),u=e[1].name,l=new RegExp(e[2].value);_[t].push(d=>{let p=[];for(let g of d)g.name===u&&p.push(g.node.text);let f=a((g,v)=>v?l.test(g):!l.test(g),"test");return p.length===0?!s:o?p.every(g=>f(g,s)):p.some(g=>f(g,s))})}a(De,"parseMatchPredicate");function He(e,t,r,_){if(e.length<2)throw new Error(`Wrong number of arguments to \`#${r}\` predicate. Expected at least 1. Got ${e.length-1}.`);if(e[1].type!=="capture")throw new Error(`First argument of \`#${r}\` predicate must be a capture. Got "${e[1].value}".`);let s=r==="any-of?",o=e[1].name,u=e.slice(2);if(!u.every(me))throw new Error(`Arguments to \`#${r}\` predicate must be strings.".`);let l=u.map(d=>d.value);_[t].push(d=>{let p=[];for(let f of d)f.name===o&&p.push(f.node.text);return p.length===0?!s:p.every(f=>l.includes(f))===s})}a(He,"parseAnyOfPredicate");function We(e,t,r,_,s){if(e.length<2||e.length>3)throw new Error(`Wrong number of arguments to \`#${r}\` predicate. Expected 1 or 2. Got ${e.length-1}.`);if(!e.every(me))throw new Error(`Arguments to \`#${r}\` predicate must be strings.".`);let o=r==="is?"?_:s;o[t]||(o[t]={}),o[t][e[1].value]=e[2]?.value??null}a(We,"parseIsPredicate");function Qe(e,t,r){if(e.length<2||e.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${e.length-1}.`);if(!e.every(me))throw new Error('Arguments to `#set!` predicate must be strings.".');r[t]||(r[t]={}),r[t][e[1].value]=e[2]?.value??null}a(Qe,"parseSetDirective");function Be(e,t,r,_,s,o,u,l,d,p,f){if(t===Le){let g=_[r];o.push({type:"capture",name:g})}else if(t===Oe)o.push({type:"string",value:s[r]});else if(o.length>0){if(o[0].type!=="string")throw new Error("Predicates must begin with a literal value");let g=o[0].value;switch(g){case"any-not-eq?":case"not-eq?":case"any-eq?":case"eq?":qe(o,e,g,u);break;case"any-not-match?":case"not-match?":case"any-match?":case"match?":De(o,e,g,u);break;case"not-any-of?":case"any-of?":He(o,e,g,u);break;case"is?":case"is-not?":We(o,e,g,p,f);break;case"set!":Qe(o,e,d);break;default:l[e].push({operator:g,operands:o.slice(1)})}o.length=0}}a(Be,"parsePattern");function Se(e,t){return new TextEncoder().encodeInto(e,new Uint8Array(t)).read}a(Se,"indexForByteOffset");var Re=H(e=>{n._ts_query_delete(e)}),ce=class{static{a(this,"Query")}0=0;exceededMatchLimit;textPredicates;source;captureNames;captureQuantifiers;predicates;setProperties;assertedProperties;refutedProperties;matchLimit;constructor(t,r){de(t);let _=n.lengthBytesUTF8(r),s=n._malloc(_+1);n.stringToUTF8(r,s,_+1);let o=n._ts_query_new(t[0],s,_,c,c+m);if(!o){let y=n.getValue(c+m,"i32"),A=n.getValue(c,"i32"),w=n.UTF8ToString(s,A).length,I=r.slice(w,w+100).split(`
5
- `)[0],E=I.match(Ue)?.[0]??"";switch(n._free(s),y){case U.Syntax:throw new $(U.Syntax,{suffix:`${w}: '${I}'...`},w,0);case U.NodeName:throw new $(y,{word:E},w,E.length);case U.FieldName:throw new $(y,{word:E},w,E.length);case U.CaptureName:throw new $(y,{word:E},w,E.length);case U.PatternStructure:throw new $(y,{suffix:`${w}: '${I}'...`},w,0)}}let u=n._ts_query_string_count(o),l=n._ts_query_capture_count(o),d=n._ts_query_pattern_count(o),p=new Array(l),f=new Array(d),g=new Array(u);for(let y=0;y<l;y++){let A=n._ts_query_capture_name_for_id(o,y,c),w=n.getValue(c,"i32");p[y]=n.UTF8ToString(A,w)}for(let y=0;y<d;y++){let A=new Array(l);for(let w=0;w<l;w++){let I=n._ts_query_capture_quantifier_for_id(o,y,w);A[w]=I}f[y]=A}for(let y=0;y<u;y++){let A=n._ts_query_string_value_for_id(o,y,c),w=n.getValue(c,"i32");g[y]=n.UTF8ToString(A,w)}let v=new Array(d),P=new Array(d),S=new Array(d),C=new Array(d),R=new Array(d);for(let y=0;y<d;y++){let A=n._ts_query_predicates_for_pattern(o,y,c),w=n.getValue(c,"i32");C[y]=[],R[y]=[];let I=new Array,E=A;for(let N=0;N<w;N++){let W=n.getValue(E,"i32");E+=m;let x=n.getValue(E,"i32");E+=m,Be(y,W,x,p,g,I,R,C,v,P,S)}Object.freeze(R[y]),Object.freeze(C[y]),Object.freeze(v[y]),Object.freeze(P[y]),Object.freeze(S[y])}n._free(s),this[0]=o,this.captureNames=p,this.captureQuantifiers=f,this.textPredicates=R,this.source=r,this.predicates=C,this.setProperties=v,this.assertedProperties=P,this.refutedProperties=S,this.exceededMatchLimit=!1,Re?.register(this,o,this)}delete(){Re?.unregister(this),n._ts_query_delete(this[0]),this[0]=0}matches(t,r={}){let{startPosition:_,endPosition:s,startIndex:o,endIndex:u,startContainingPosition:l,endContainingPosition:d,startContainingIndex:p,endContainingIndex:f,matchLimit:g,maxStartDepth:v,progressCallback:P}=Ce(this,r);return Ne(P,()=>{h(t),n._ts_query_matches_wasm(this[0],t.tree[0],_.row,_.column,s.row,s.column,o,u,l.row,l.column,d.row,d.column,p,f,g,v)},S=>{this.matchLimit=g,this.exceededMatchLimit=S},(S,C)=>{let R=new Array(S),y=0,A=C;for(let w=0;w<S;w++){let I=n.getValue(A,"i32");A+=m;let E=n.getValue(A,"i32");A+=m;let N=new Array(E);if(A=ie(this,t.tree,A,I,N),this.textPredicates[I].every(W=>W(N))){R[y]={patternIndex:I,captures:N};let W=this.setProperties[I];R[y].setProperties=W;let x=this.assertedProperties[I];R[y].assertedProperties=x;let z=this.refutedProperties[I];R[y].refutedProperties=z,y++}}return R.length=y,R})}captures(t,r={}){let{startPosition:_,endPosition:s,startIndex:o,endIndex:u,startContainingPosition:l,endContainingPosition:d,startContainingIndex:p,endContainingIndex:f,matchLimit:g,maxStartDepth:v,progressCallback:P}=Ce(this,r),S=P;return Ne(S?C=>S(C)===!0:void 0,()=>{h(t),n._ts_query_captures_wasm(this[0],t.tree[0],_.row,_.column,s.row,s.column,o,u,l.row,l.column,d.row,d.column,p,f,g,v)},C=>{this.matchLimit=g,this.exceededMatchLimit=C},(C,R)=>{let y=new Array,A=new Array,w=R;for(let I=0;I<C;I++){let E=n.getValue(w,"i32");w+=m;let N=n.getValue(w,"i32");w+=m;let W=n.getValue(w,"i32");if(w+=m,A.length=N,w=ie(this,t.tree,w,E,A),this.textPredicates[E].every(x=>x(A))){let x=A[W];x.setProperties=this.setProperties[E],x.assertedProperties=this.assertedProperties[E],x.refutedProperties=this.refutedProperties[E],y.push(x)}}return y})}predicatesForPattern(t){return this.predicates[t]}disableCapture(t){let r=n.lengthBytesUTF8(t),_=n._malloc(r+1);n.stringToUTF8(t,_,r+1),n._ts_query_disable_capture(this[0],_,r),n._free(_)}disablePattern(t){if(t>=this.predicates.length)throw new Error(`Pattern index is ${t} but the pattern count is ${this.predicates.length}`);n._ts_query_disable_pattern(this[0],t)}didExceedMatchLimit(){return this.exceededMatchLimit}startIndexForPattern(t){if(t>=this.predicates.length)throw new Error(`Pattern index is ${t} but the pattern count is ${this.predicates.length}`);let r=n._ts_query_start_byte_for_pattern(this[0],t);return Se(this.source,r)}endIndexForPattern(t){if(t>=this.predicates.length)throw new Error(`Pattern index is ${t} but the pattern count is ${this.predicates.length}`);let r=n._ts_query_end_byte_for_pattern(this[0],t);return Se(this.source,r)}patternCount(){return n._ts_query_pattern_count(this[0])}captureIndexForName(t){return this.captureNames.indexOf(t)}isPatternRooted(t){return n._ts_query_is_pattern_rooted(this[0],t)===1}isPatternNonLocal(t){return n._ts_query_is_pattern_non_local(this[0],t)===1}isPatternGuaranteedAtStep(t){let r=n.lengthBytesUTF8(this.source.slice(0,t));return n._ts_query_is_pattern_guaranteed_at_step(this[0],r)===1}};function Ce(e,t){let r={startPosition:t.startPosition??q,endPosition:t.endPosition??q,startIndex:t.startIndex??0,endIndex:t.endIndex??0,startContainingPosition:t.startContainingPosition??q,endContainingPosition:t.endContainingPosition??q,startContainingIndex:t.startContainingIndex??0,endContainingIndex:t.endContainingIndex??0,matchLimit:t.matchLimit??4294967295,maxStartDepth:t.maxStartDepth??4294967295,progressCallback:t.progressCallback},{startPosition:_,endPosition:s,startIndex:o,endIndex:u,startContainingPosition:l,endContainingPosition:d,startContainingIndex:p,endContainingIndex:f,matchLimit:g}=r;if(typeof g!="number")throw new Error("Arguments must be numbers");if(e.matchLimit=g,u!==0&&o>u)throw new Error("`startIndex` cannot be greater than `endIndex`");if(s!==q&&(_.row>s.row||_.row===s.row&&_.column>s.column))throw new Error("`startPosition` cannot be greater than `endPosition`");if(f!==0&&p>f)throw new Error("`startContainingIndex` cannot be greater than `endContainingIndex`");if(d!==q&&(l.row>d.row||l.row===d.row&&l.column>d.column))throw new Error("`startContainingPosition` cannot be greater than `endContainingPosition`");return r}a(Ce,"prepareQuery");function Ne(e,t,r,_){let s=n.currentQueryProgressCallback,o;n.currentQueryProgressCallback=e?p=>{try{return e(p)}catch(f){return o={error:f},!0}}:null;try{t()}finally{n.currentQueryProgressCallback=s}let u=n.getValue(c,"i32"),l=n.getValue(c+m,"i32"),d=!!n.getValue(c+2*m,"i32");try{if(r(d),o)throw o.error;return _(u,l)}finally{n._free(l),r(d)}}a(Ne,"executeQuery");export{Ve as CaptureQuantifier,ae as Edit,_e as LANGUAGE_VERSION,j as Language,K as LookaheadIterator,Ie as MIN_COMPATIBLE_VERSION,ee as Node,le as Parser,ce as Query,X as Tree,J as TreeCursor};
3
+ ${u}`)}let o=s.clone();try{r=await WebAssembly.compileStreaming(s)}catch(u){console.error("wasm streaming compile failed:",u),console.error("falling back to ArrayBuffer instantiation"),r=new Uint8Array(await o.arrayBuffer())}}let _=await n.loadWebAssemblyModule(r,{loadAsync:!0});return Me(_,{sync:!1})}static loadSync(t){let r=n.loadWebAssemblyModule(t,{loadAsync:!1});return Me(r,{sync:!0})}};function Me(e,{sync:t}){let r=Object.keys(e),_=r.find(o=>Ce.test(o)&&!o.includes("external_scanner_"));if(!_)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[_]();return new Z(F,s)}a(Me,"loadFromWasmExports");async function Ne(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.currentQueryProgressCallback=null,Module.currentProgressCallback=null,Module.currentLogCallback=null,Module.currentParseCallback=null;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,_)=>{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}_(s.status)},s.onerror=_,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),_=await WebAssembly.instantiate(r,t);return _}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 _=fetch(t,{credentials:"same-origin"}),s=await WebAssembly.instantiateStreaming(_,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,u){wasmExports=o.exports,wasmExports=relocateExports(wasmExports,1024);var l=getDylinkMetadata(u);return l.neededDynlibs&&(dynamicLibraries=l.neededDynlibs.concat(dynamicLibraries)),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,u)=>{Module.instantiateWasm(r,(l,c)=>{o(e(l,c))})});wasmBinaryFile??=findWasmBinary();var _=await instantiateAsync(wasmBinary,wasmBinaryFile,r),s=t(_);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,_)=>{var s=t+r;if(_)return s;for(;e[t]&&!(t>=s);)++t;return t},"findStringEnd"),UTF8ArrayToString=a((e,t=0,r,_)=>{var s=findStringEnd(e,t,r,_);if(s-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,s));for(var o="";t<s;){var u=e[t++];if(!(u&128)){o+=String.fromCharCode(u);continue}var l=e[t++]&63;if((u&224)==192){o+=String.fromCharCode((u&31)<<6|l);continue}var c=e[t++]&63;if((u&240)==224?u=(u&15)<<12|l<<6|c:u=(u&7)<<18|l<<12|c<<6|e[t++]&63,u<65536)o+=String.fromCharCode(u);else{var w=u-65536;o+=String.fromCharCode(55296|w>>10,56320|w&1023)}}return o},"UTF8ArrayToString"),getDylinkMetadata=a(e=>{var t=0,r=0;function _(){return e[t++]}a(_,"getU8");function s(){for(var q=0,$=1;;){var fe=e[t++];if(q+=(fe&127)*$,$*=128,!(fe&128))break}return q}a(s,"getLEB");function o(){var q=s();return t+=q,UTF8ArrayToString(e,t-q,q)}a(o,"getString");function u(){for(var q=s(),$=[];q--;)$.push(o());return $}a(u,"getStringList");function l(q,$){if(q)throw new Error($)}if(a(l,"failIf"),e instanceof WebAssembly.Module){var c=WebAssembly.Module.customSections(e,"dylink.0");l(c.length===0,"need dylink section"),e=new Uint8Array(c[0]),r=e.length}else{var w=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),f=w[0]==1836278016||w[0]==6386541;l(!f,"need to see wasm magic number"),l(e[8]!==0,"need the dylink section to be first"),t=9;var g=s();r=t+g;var v=o();l(v!=="dylink.0")}for(var b={neededDynlibs:[],tlsExports:new Set,weakImports:new Set,runtimePaths:[]},N=1,x=2,V=3,p=4,A=5,y=256,R=3,M=1;t<r;){var L=_(),W=s();if(L===N)b.memorySize=s(),b.memoryAlign=s(),b.tableSize=s(),b.tableAlign=s();else if(L===x)b.neededDynlibs=u();else if(L===V)for(var T=s();T--;){var Q=o(),G=s();G&y&&b.tlsExports.add(Q)}else if(L===p)for(var T=s();T--;){var ge=o(),Q=o(),G=s();(G&R)==M&&b.weakImports.add(Q)}else L===A?b.runtimePaths=u():t+=W}return b},"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 _={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=_,t!=null&&(LDSO.loadedLibsByHandle[t]=_),_},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=82496,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),_=new WebAssembly.Module(r),s=new WebAssembly.Instance(_,{e:{f:e}}),o=s.exports.f;return o},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:39,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 _=getWasmTableEntry(r);_&&functionsInTableMap.set(_,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 _=getEmptyTableSlot();try{setWasmTableEntry(_,e)}catch(o){if(!(o instanceof TypeError))throw o;var s=convertJsFunctionToWasm(e,t);setWasmTableEntry(_,s)}return functionsInTableMap.set(e,_),_},"addFunction"),updateGOT=a((e,t)=>{for(var r in e)if(!isInternalSym(r)){var _=e[r];GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(t||GOT[r].value==0)&&(typeof _=="function"?GOT[r].value=addFunction(_):typeof _=="number"?GOT[r].value=_:err(`unhandled export type for '${r}': ${typeof _}`))}},"updateGOT"),relocateExports=a((e,t,r)=>{var _={};for(var s in e){var o=e[s];typeof o=="object"&&(o=o.value),typeof o=="number"&&(o+=t),_[s]=o}return updateGOT(_,r),_},"relocateExports"),isSymbolDefined=a(e=>{var t=wasmImports[e];return!(!t||t.stub)},"isSymbolDefined"),dynCall=a((e,t,r=[],_=!1)=>{var s=getWasmTableEntry(t),o=s(...r);function u(l){return l}return a(u,"convert"),o},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(e=>__emscripten_stack_restore(e),"stackRestore"),createInvokeFunction=a(e=>(t,...r)=>{var _=stackSave();try{return dynCall(e,t,r)}catch(s){if(stackRestore(_),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 _;e[t]=(...s)=>(_||=resolveSymbol(t),_(...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,_]of Object.entries(e)){let s=a(u=>{isSymbolDefined(u)||(wasmImports[u]=_)},"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,_){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++,_&&(LDSO.loadedLibsByHandle[_]=s),t.loadAsync?Promise.resolve(!0):!0;s=newDSO(e,_,"loading"),s.refcount=t.nodelete?1/0:1,s.global=t.global;function o(){if(_){var c=LE_HEAP_LOAD_U32((_+28>>2)*4),w=LE_HEAP_LOAD_U32((_+32>>2)*4);if(c&&w){var f=HEAP8.slice(c,c+w);return t.loadAsync?Promise.resolve(f):f}}var g=locateFile(e);if(t.loadAsync)return asyncLoad(g);if(!readBinary)throw new Error(`${g}: file not found, and synchronous loading of external files is not available`);return readBinary(g)}a(o,"loadLibData");function u(){return t.loadAsync?o().then(c=>loadWebAssemblyModule(c,t,e,r,_)):loadWebAssemblyModule(o(),t,e,r,_)}a(u,"getExports");function l(c){s.global?mergeLibSymbols(c,e):r&&Object.assign(r,c),s.exports=c}return a(l,"moduleLoaded"),t.loadAsync?u().then(c=>(l(c),!0)):(l(u()),!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=82496,___stack_low=16960,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},82496),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=a(()=>abort(""),"__abort_js");__abort_js.sig="v";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 _=1;_<=4;_*=2){var s=t*(1+.2/_);s=Math.min(s,e+100663296);var o=Math.min(r,alignMemory(Math.max(e,s),65536)),u=growMemory(o);if(u)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=a(e=>52,"_fd_close");_fd_close.sig="ii";var INT53_MAX=9007199254740992,INT53_MIN=-9007199254740992,bigintToI53Checked=a(e=>e<INT53_MIN||e>INT53_MAX?NaN:Number(e),"bigintToI53Checked");function _fd_seek(e,t,r,_){return t=bigintToI53Checked(t),70}a(_fd_seek,"_fd_seek"),_fd_seek.sig="iijip";var printCharBuffers=[null,[],[]],printChar=a((e,t)=>{var r=printCharBuffers[e];t===0||t===10?((e===1?out:err)(UTF8ArrayToString(r)),r.length=0):r.push(t)},"printChar"),_fd_write=a((e,t,r,_)=>{for(var s=0,o=0;o<r;o++){var u=LE_HEAP_LOAD_U32((t>>2)*4),l=LE_HEAP_LOAD_U32((t+4>>2)*4);t+=8;for(var c=0;c<l;c++)printChar(e,HEAPU8[u+c]);s+=l}return LE_HEAP_STORE_U32((_>>2)*4,s),0},"_fd_write");_fd_write.sig="iippp";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,_,s){let u=Module.currentParseCallback(t,{row:r,column:_});typeof u=="string"?(setValue(s,u.length,"i32"),stringToUTF16(u,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");function _tree_sitter_query_progress_callback(e){return Module.currentQueryProgressCallback?Module.currentQueryProgressCallback({currentOffset:e})===!0:!1}a(_tree_sitter_query_progress_callback,"_tree_sitter_query_progress_callback");var runtimeKeepaliveCounter=0,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"),handleException=a(e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},"handleException"),lengthBytesUTF8=a(e=>{for(var t=0,r=0;r<e.length;++r){var _=e.charCodeAt(r);_<=127?t++:_<=2047?t+=2:_>=55296&&_<=57343?(t+=4,++r):t+=3}return t},"lengthBytesUTF8"),stringToUTF8Array=a((e,t,r,_)=>{if(!(_>0))return 0;for(var s=r,o=r+_-1,u=0;u<e.length;++u){var l=e.codePointAt(u);if(l<=127){if(r>=o)break;t[r++]=l}else if(l<=2047){if(r+1>=o)break;t[r++]=192|l>>6,t[r++]=128|l&63}else if(l<=65535){if(r+2>=o)break;t[r++]=224|l>>12,t[r++]=128|l>>6&63,t[r++]=128|l&63}else{if(r+3>=o)break;t[r++]=240|l>>18,t[r++]=128|l>>12&63,t[r++]=128|l>>6&63,t[r++]=128|l&63,u++}}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 _=t,s=r<e.length*2?r/2:e.length,o=0;o<s;++o){var u=e.charCodeAt(o);LE_HEAP_STORE_I16((t>>1)*2,u),t+=2}return LE_HEAP_STORE_I16((t>>1)*2,0),t-_},"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={},_malloc,_calloc,_realloc,_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_reset,_ts_parser_set_language,_ts_parser_set_included_ranges,_memcmp,_ts_query_new,_ts_query_delete,_iswspace,_iswalnum,_ts_query_copy,_ts_query_pattern_count,_ts_query_capture_count,_ts_query_string_count,_ts_query_capture_name_for_id,_ts_query_capture_quantifier_for_id,_ts_query_string_value_for_id,_ts_query_predicates_for_pattern,_ts_query_start_byte_for_pattern,_ts_query_end_byte_for_pattern,_ts_query_is_pattern_rooted,_ts_query_is_pattern_non_local,_ts_query_is_pattern_guaranteed_at_step,_ts_query_disable_capture,_ts_query_disable_pattern,_ts_tree_copy,_ts_tree_delete,_ts_init,_ts_parser_new_wasm,_ts_parser_enable_logger_wasm,_ts_parser_parse_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,_ts_query_matches_wasm,_ts_query_captures_wasm,_memset,_memcpy,_memmove,_iswalpha,_iswblank,_iswdigit,_iswlower,_iswpunct,_iswupper,_iswxdigit,_memchr,_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._malloc=_malloc=e.malloc,Module._calloc=_calloc=e.calloc,Module._realloc=_realloc=e.realloc,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_reset=_ts_parser_reset=e.ts_parser_reset,Module._ts_parser_set_language=_ts_parser_set_language=e.ts_parser_set_language,Module._ts_parser_set_included_ranges=_ts_parser_set_included_ranges=e.ts_parser_set_included_ranges,Module._memcmp=_memcmp=e.memcmp,Module._ts_query_new=_ts_query_new=e.ts_query_new,Module._ts_query_delete=_ts_query_delete=e.ts_query_delete,Module._iswspace=_iswspace=e.iswspace,Module._iswalnum=_iswalnum=e.iswalnum,Module._ts_query_copy=_ts_query_copy=e.ts_query_copy,Module._ts_query_pattern_count=_ts_query_pattern_count=e.ts_query_pattern_count,Module._ts_query_capture_count=_ts_query_capture_count=e.ts_query_capture_count,Module._ts_query_string_count=_ts_query_string_count=e.ts_query_string_count,Module._ts_query_capture_name_for_id=_ts_query_capture_name_for_id=e.ts_query_capture_name_for_id,Module._ts_query_capture_quantifier_for_id=_ts_query_capture_quantifier_for_id=e.ts_query_capture_quantifier_for_id,Module._ts_query_string_value_for_id=_ts_query_string_value_for_id=e.ts_query_string_value_for_id,Module._ts_query_predicates_for_pattern=_ts_query_predicates_for_pattern=e.ts_query_predicates_for_pattern,Module._ts_query_start_byte_for_pattern=_ts_query_start_byte_for_pattern=e.ts_query_start_byte_for_pattern,Module._ts_query_end_byte_for_pattern=_ts_query_end_byte_for_pattern=e.ts_query_end_byte_for_pattern,Module._ts_query_is_pattern_rooted=_ts_query_is_pattern_rooted=e.ts_query_is_pattern_rooted,Module._ts_query_is_pattern_non_local=_ts_query_is_pattern_non_local=e.ts_query_is_pattern_non_local,Module._ts_query_is_pattern_guaranteed_at_step=_ts_query_is_pattern_guaranteed_at_step=e.ts_query_is_pattern_guaranteed_at_step,Module._ts_query_disable_capture=_ts_query_disable_capture=e.ts_query_disable_capture,Module._ts_query_disable_pattern=_ts_query_disable_pattern=e.ts_query_disable_pattern,Module._ts_tree_copy=_ts_tree_copy=e.ts_tree_copy,Module._ts_tree_delete=_ts_tree_delete=e.ts_tree_delete,Module._ts_init=_ts_init=e.ts_init,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_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._ts_query_matches_wasm=_ts_query_matches_wasm=e.ts_query_matches_wasm,Module._ts_query_captures_wasm=_ts_query_captures_wasm=e.ts_query_captures_wasm,Module._memset=_memset=e.memset,Module._memcpy=_memcpy=e.memcpy,Module._memmove=_memmove=e.memmove,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._iswupper=_iswupper=e.iswupper,Module._iswxdigit=_iswxdigit=e.iswxdigit,Module._memchr=_memchr=e.memchr,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_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback,tree_sitter_progress_callback:_tree_sitter_progress_callback,tree_sitter_query_progress_callback:_tree_sitter_query_progress_callback};function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,_=stackAlloc((r+1)*4),s=_;e.forEach(u=>{LE_HEAP_STORE_U32((s>>2)*4,stringToUTF8OnStack(u)),s+=4}),LE_HEAP_STORE_U32((s>>2)*4,0);try{var o=t(r,_);return exitJS(o,!0),o}catch(u){return handleException(u)}}}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(Ne,"Module");var ue=Ne;var re=null;async function Ee(e){if(re)return re;let{wasmModule:t,...r}=e??{};if(!t)return re??=await ue(r);let _=new Promise((s,o)=>{r.instantiateWasm=(u,l)=>(WebAssembly.instantiate(t,u).then(c=>{l(c,t)}).catch(o),{})});return re??=await Promise.race([ue(r),_])}a(Ee,"initializeBinding");function Ae(){return!!re}a(Ae,"checkModule");var d,se;function de(e){let t=n._ts_language_abi_version(e[0]);if(t!==se)throw new Error(`Incompatible language version 0x${(t>>>0).toString(16)}. Expected 0x${se.toString(16)}.`)}a(de,"assertSupportedLanguage");var Te,Ie=H(e=>{n._ts_parser_delete(e[0]),n._free(e[1])}),le=class{static{a(this,"Parser")}0=0;1=0;logCallback=null;language=null;static async init(t){he(await Ee(t)),d=n._ts_init(),se=n.getValue(d,"i32"),Te=n.getValue(d+m,"i32")}constructor(){this.initialize(),Ie?.register(this,[this[0],this[1]],this)}initialize(){if(!Ae())throw new Error("cannot construct a Parser before calling `init()`");n._ts_parser_new_wasm(),this[0]=n.getValue(d,"i32"),this[1]=n.getValue(d+m,"i32")}delete(){Ie?.unregister(this),n._ts_parser_delete(this[0]),n._free(this[1]),this[0]=0,this[1]=0}setLanguage(t){let r;if(!t)r=0,this.language=null;else if(t.constructor===Z)r=t[0],de(t),this.language=t;else throw new Error("Argument must be a Language");return n._ts_parser_set_language(this[0],r),this}parse(t,r,_){if(typeof t=="string")n.currentParseCallback=c=>t.slice(c);else if(typeof t=="function")n.currentParseCallback=t;else throw new Error("Argument must be a string or a function");_?.progressCallback?n.currentProgressCallback=_.progressCallback:n.currentProgressCallback=null,this.logCallback?(n.currentLogCallback=this.logCallback,n._ts_parser_enable_logger_wasm(this[0],1)):(n.currentLogCallback=null,n._ts_parser_enable_logger_wasm(this[0],0));let s=0,o=0;if(_?.includedRanges){s=_.includedRanges.length,o=n._calloc(s,j);let c=o;for(let w=0;w<s;w++)Pe(c,_.includedRanges[w]),c+=j}let u=n._ts_parser_parse_wasm(this[0],this[1],r?r[0]:0,o,s);if(!u)return n.currentParseCallback=null,n.currentLogCallback=null,n.currentProgressCallback=null,null;if(!this.language)throw new Error("Parser must have a language to parse");let l=new Y(F,u,this.language,n.currentParseCallback);return n.currentParseCallback=null,n.currentLogCallback=null,n.currentProgressCallback=null,l}reset(){n._ts_parser_reset(this[0])}getIncludedRanges(){n._ts_parser_included_ranges_wasm(this[0]);let t=n.getValue(d,"i32"),r=n.getValue(d+m,"i32"),_=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)_[o]=J(s),s+=j;n._free(r)}return _}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}};var xe=1,Le=2,ke=/[\w-]+/g,Oe={Zero:0,ZeroOrOne:1,ZeroOrMore:2,One:3,OneOrMore:4},Se=a(e=>e.type==="capture","isCaptureStep"),me=a(e=>e.type==="string","isStringStep"),U={Syntax:1,NodeName:2,FieldName:3,CaptureName:4,PatternStructure:5},z=class e extends Error{constructor(r,_,s,o){super(e.formatMessage(r,_));this.kind=r;this.info=_;this.index=s;this.length=o;this.name="QueryError"}kind;info;index;length;static{a(this,"QueryError")}static formatMessage(r,_){switch(r){case U.NodeName:return`Bad node name '${_.word}'`;case U.FieldName:return`Bad field name '${_.word}'`;case U.CaptureName:return`Bad capture name @${_.word}`;case U.PatternStructure:return`Bad pattern structure at offset ${_.suffix}`;case U.Syntax:return`Bad syntax at offset ${_.suffix}`}}};function Ue(e,t,r,_){if(e.length!==3)throw new Error(`Wrong number of arguments to \`#${r}\` predicate. Expected 2, got ${e.length-1}`);if(!Se(e[1]))throw new Error(`First argument of \`#${r}\` predicate must be a capture. Got "${e[1].value}"`);let s=r==="eq?"||r==="any-eq?",o=!r.startsWith("any-");if(Se(e[2])){let u=e[1].name,l=e[2].name;_[t].push(c=>{let w=[],f=[];for(let v of c)v.name===u&&w.push(v.node),v.name===l&&f.push(v.node);let g=a((v,b,N)=>N?v.text===b.text:v.text!==b.text,"compare");return o?w.every(v=>f.some(b=>g(v,b,s))):w.some(v=>f.some(b=>g(v,b,s)))})}else{let u=e[1].name,l=e[2].value,c=a(f=>f.text===l,"matches"),w=a(f=>f.text!==l,"doesNotMatch");_[t].push(f=>{let g=[];for(let b of f)b.name===u&&g.push(b.node);let v=s?c:w;return o?g.every(v):g.some(v)})}}a(Ue,"parseAnyPredicate");function Ve(e,t,r,_){if(e.length!==3)throw new Error(`Wrong number of arguments to \`#${r}\` predicate. Expected 2, got ${e.length-1}.`);if(e[1].type!=="capture")throw new Error(`First argument of \`#${r}\` predicate must be a capture. Got "${e[1].value}".`);if(e[2].type!=="string")throw new Error(`Second argument of \`#${r}\` predicate must be a string. Got @${e[2].name}.`);let s=r==="match?"||r==="any-match?",o=!r.startsWith("any-"),u=e[1].name,l=new RegExp(e[2].value);_[t].push(c=>{let w=[];for(let g of c)g.name===u&&w.push(g.node.text);let f=a((g,v)=>v?l.test(g):!l.test(g),"test");return w.length===0?!s:o?w.every(g=>f(g,s)):w.some(g=>f(g,s))})}a(Ve,"parseMatchPredicate");function qe(e,t,r,_){if(e.length<2)throw new Error(`Wrong number of arguments to \`#${r}\` predicate. Expected at least 1. Got ${e.length-1}.`);if(e[1].type!=="capture")throw new Error(`First argument of \`#${r}\` predicate must be a capture. Got "${e[1].value}".`);let s=r==="any-of?",o=e[1].name,u=e.slice(2);if(!u.every(me))throw new Error(`Arguments to \`#${r}\` predicate must be strings.".`);let l=u.map(c=>c.value);_[t].push(c=>{let w=[];for(let f of c)f.name===o&&w.push(f.node.text);return w.length===0?!s:w.every(f=>l.includes(f))===s})}a(qe,"parseAnyOfPredicate");function De(e,t,r,_,s){if(e.length<2||e.length>3)throw new Error(`Wrong number of arguments to \`#${r}\` predicate. Expected 1 or 2. Got ${e.length-1}.`);if(!e.every(me))throw new Error(`Arguments to \`#${r}\` predicate must be strings.".`);let o=r==="is?"?_:s;o[t]||(o[t]={}),o[t][e[1].value]=e[2]?.value??null}a(De,"parseIsPredicate");function He(e,t,r){if(e.length<2||e.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${e.length-1}.`);if(!e.every(me))throw new Error('Arguments to `#set!` predicate must be strings.".');r[t]||(r[t]={}),r[t][e[1].value]=e[2]?.value??null}a(He,"parseSetDirective");function We(e,t,r,_,s,o,u,l,c,w,f){if(t===xe){let g=_[r];o.push({type:"capture",name:g})}else if(t===Le)o.push({type:"string",value:s[r]});else if(o.length>0){if(o[0].type!=="string")throw new Error("Predicates must begin with a literal value");let g=o[0].value;switch(g){case"any-not-eq?":case"not-eq?":case"any-eq?":case"eq?":Ue(o,e,g,u);break;case"any-not-match?":case"not-match?":case"any-match?":case"match?":Ve(o,e,g,u);break;case"not-any-of?":case"any-of?":qe(o,e,g,u);break;case"is?":case"is-not?":De(o,e,g,w,f);break;case"set!":He(o,e,c);break;default:l[e].push({operator:g,operands:o.slice(1)})}o.length=0}}a(We,"parsePattern");var Re=H(e=>{n._ts_query_delete(e)}),ce=class{static{a(this,"Query")}0=0;exceededMatchLimit;textPredicates;captureNames;captureQuantifiers;predicates;setProperties;assertedProperties;refutedProperties;matchLimit;constructor(t,r){de(t);let _=n.lengthBytesUTF8(r),s=n._malloc(_+1);n.stringToUTF8(r,s,_+1);let o=n._ts_query_new(t[0],s,_,d,d+m);if(!o){let p=n.getValue(d+m,"i32"),A=n.getValue(d,"i32"),y=n.UTF8ToString(s,A).length,R=r.slice(y,y+100).split(`
5
+ `)[0],M=R.match(ke)?.[0]??"";switch(n._free(s),p){case U.Syntax:throw new z(U.Syntax,{suffix:`${y}: '${R}'...`},y,0);case U.NodeName:throw new z(p,{word:M},y,M.length);case U.FieldName:throw new z(p,{word:M},y,M.length);case U.CaptureName:throw new z(p,{word:M},y,M.length);case U.PatternStructure:throw new z(p,{suffix:`${y}: '${R}'...`},y,0)}}let u=n._ts_query_string_count(o),l=n._ts_query_capture_count(o),c=n._ts_query_pattern_count(o),w=new Array(l),f=new Array(c),g=new Array(u);for(let p=0;p<l;p++){let A=n._ts_query_capture_name_for_id(o,p,d),y=n.getValue(d,"i32");w[p]=n.UTF8ToString(A,y)}for(let p=0;p<c;p++){let A=new Array(l);for(let y=0;y<l;y++){let R=n._ts_query_capture_quantifier_for_id(o,p,y);A[y]=R}f[p]=A}for(let p=0;p<u;p++){let A=n._ts_query_string_value_for_id(o,p,d),y=n.getValue(d,"i32");g[p]=n.UTF8ToString(A,y)}let v=new Array(c),b=new Array(c),N=new Array(c),x=new Array(c),V=new Array(c);for(let p=0;p<c;p++){let A=n._ts_query_predicates_for_pattern(o,p,d),y=n.getValue(d,"i32");x[p]=[],V[p]=[];let R=new Array,M=A;for(let L=0;L<y;L++){let W=n.getValue(M,"i32");M+=m;let T=n.getValue(M,"i32");M+=m,We(p,W,T,w,g,R,V,x,v,b,N)}Object.freeze(V[p]),Object.freeze(x[p]),Object.freeze(v[p]),Object.freeze(b[p]),Object.freeze(N[p])}n._free(s),this[0]=o,this.captureNames=w,this.captureQuantifiers=f,this.textPredicates=V,this.predicates=x,this.setProperties=v,this.assertedProperties=b,this.refutedProperties=N,this.exceededMatchLimit=!1,Re?.register(this,o,this)}delete(){Re?.unregister(this),n._ts_query_delete(this[0]),this[0]=0}matches(t,r={}){let _=r.startPosition??S,s=r.endPosition??S,o=r.startIndex??0,u=r.endIndex??0,l=r.startContainingPosition??S,c=r.endContainingPosition??S,w=r.startContainingIndex??0,f=r.endContainingIndex??0,g=r.matchLimit??4294967295,v=r.maxStartDepth??4294967295,b=r.progressCallback;if(typeof g!="number")throw new Error("Arguments must be numbers");if(this.matchLimit=g,u!==0&&o>u)throw new Error("`startIndex` cannot be greater than `endIndex`");if(s!==S&&(_.row>s.row||_.row===s.row&&_.column>s.column))throw new Error("`startPosition` cannot be greater than `endPosition`");if(f!==0&&w>f)throw new Error("`startContainingIndex` cannot be greater than `endContainingIndex`");if(c!==S&&(l.row>c.row||l.row===c.row&&l.column>c.column))throw new Error("`startContainingPosition` cannot be greater than `endContainingPosition`");b&&(n.currentQueryProgressCallback=b),h(t),n._ts_query_matches_wasm(this[0],t.tree[0],_.row,_.column,s.row,s.column,o,u,l.row,l.column,c.row,c.column,w,f,g,v);let N=n.getValue(d,"i32"),x=n.getValue(d+m,"i32"),V=n.getValue(d+2*m,"i32"),p=new Array(N);this.exceededMatchLimit=!!V;let A=0,y=x;for(let R=0;R<N;R++){let M=n.getValue(y,"i32");y+=m;let L=n.getValue(y,"i32");y+=m;let W=new Array(L);if(y=ie(this,t.tree,y,M,W),this.textPredicates[M].every(T=>T(W))){p[A]={patternIndex:M,captures:W};let T=this.setProperties[M];p[A].setProperties=T;let Q=this.assertedProperties[M];p[A].assertedProperties=Q;let G=this.refutedProperties[M];p[A].refutedProperties=G,A++}}return p.length=A,n._free(x),n.currentQueryProgressCallback=null,p}captures(t,r={}){let _=r.startPosition??S,s=r.endPosition??S,o=r.startIndex??0,u=r.endIndex??0,l=r.startContainingPosition??S,c=r.endContainingPosition??S,w=r.startContainingIndex??0,f=r.endContainingIndex??0,g=r.matchLimit??4294967295,v=r.maxStartDepth??4294967295,b=r.progressCallback;if(typeof g!="number")throw new Error("Arguments must be numbers");if(this.matchLimit=g,u!==0&&o>u)throw new Error("`startIndex` cannot be greater than `endIndex`");if(s!==S&&(_.row>s.row||_.row===s.row&&_.column>s.column))throw new Error("`startPosition` cannot be greater than `endPosition`");if(f!==0&&w>f)throw new Error("`startContainingIndex` cannot be greater than `endContainingIndex`");if(c!==S&&(l.row>c.row||l.row===c.row&&l.column>c.column))throw new Error("`startContainingPosition` cannot be greater than `endContainingPosition`");b&&(n.currentQueryProgressCallback=b),h(t),n._ts_query_captures_wasm(this[0],t.tree[0],_.row,_.column,s.row,s.column,o,u,l.row,l.column,c.row,c.column,w,f,g,v);let N=n.getValue(d,"i32"),x=n.getValue(d+m,"i32"),V=n.getValue(d+2*m,"i32"),p=new Array;this.exceededMatchLimit=!!V;let A=new Array,y=x;for(let R=0;R<N;R++){let M=n.getValue(y,"i32");y+=m;let L=n.getValue(y,"i32");y+=m;let W=n.getValue(y,"i32");if(y+=m,A.length=L,y=ie(this,t.tree,y,M,A),this.textPredicates[M].every(T=>T(A))){let T=A[W],Q=this.setProperties[M];T.setProperties=Q;let G=this.assertedProperties[M];T.assertedProperties=G;let ge=this.refutedProperties[M];T.refutedProperties=ge,p.push(T)}}return n._free(x),n.currentQueryProgressCallback=null,p}predicatesForPattern(t){return this.predicates[t]}disableCapture(t){let r=n.lengthBytesUTF8(t),_=n._malloc(r+1);n.stringToUTF8(t,_,r+1),n._ts_query_disable_capture(this[0],_,r),n._free(_)}disablePattern(t){if(t>=this.predicates.length)throw new Error(`Pattern index is ${t} but the pattern count is ${this.predicates.length}`);n._ts_query_disable_pattern(this[0],t)}didExceedMatchLimit(){return this.exceededMatchLimit}startIndexForPattern(t){if(t>=this.predicates.length)throw new Error(`Pattern index is ${t} but the pattern count is ${this.predicates.length}`);return n._ts_query_start_byte_for_pattern(this[0],t)}endIndexForPattern(t){if(t>=this.predicates.length)throw new Error(`Pattern index is ${t} but the pattern count is ${this.predicates.length}`);return n._ts_query_end_byte_for_pattern(this[0],t)}patternCount(){return n._ts_query_pattern_count(this[0])}captureIndexForName(t){return this.captureNames.indexOf(t)}isPatternRooted(t){return n._ts_query_is_pattern_rooted(this[0],t)===1}isPatternNonLocal(t){return n._ts_query_is_pattern_non_local(this[0],t)===1}isPatternGuaranteedAtStep(t){return n._ts_query_is_pattern_guaranteed_at_step(this[0],t)===1}};export{Oe as CaptureQuantifier,ae as Edit,se as LANGUAGE_VERSION,Z as Language,X as LookaheadIterator,Te as MIN_COMPATIBLE_VERSION,te as Node,le as Parser,ce as Query,Y as Tree,ee as TreeCursor};
6
6
  //# sourceMappingURL=web-tree-sitter.js.map