@prettier/plugin-php 0.22.4 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/standalone.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("prettier/standalone")):"function"==typeof define&&define.amd?define(["exports","prettier/standalone"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.php={}),t.prettier)}(this,(function(t,e){"use strict";function s(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var i={name:"PHP",type:"programming",tmScope:"text.html.php",aceMode:"php",codemirrorMode:"php",codemirrorMimeType:"application/x-httpd-php",color:"#4F5D95",extensions:[".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"],interpreters:["php"],aliases:["inc"],languageId:272},n={name:"HTML+PHP",type:"markup",color:"#4f5d95",tmScope:"text.html.php",group:"HTML",extensions:[".phtml"],aceMode:"php",codemirrorMode:"php",codemirrorMimeType:"application/x-httpd-php",languageId:151},r={exports:{}},o={attributeIndex:0,attributeListDepth:{},matchST_ATTRIBUTE:function(){let t=this.input();if(this.is_WHITESPACE()){do{t=this.input()}while(this.is_WHITESPACE());return this.unput(1),null}switch(t){case"]":return 0===this.attributeListDepth[this.attributeIndex]?(delete this.attributeListDepth[this.attributeIndex],this.attributeIndex--,this.popState()):this.attributeListDepth[this.attributeIndex]--,"]";case"(":case")":case":":case"=":case"|":case"&":case"^":case"-":case"+":case"*":case"%":case"~":case"<":case">":case"!":case".":return this.consume_TOKEN();case"[":return this.attributeListDepth[this.attributeIndex]++,"[";case",":return",";case'"':return this.ST_DOUBLE_QUOTES();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN()}if(this.is_LABEL_START()||"\\"===t){for(;this.offset<this.size;){const t=this.input();if(!this.is_LABEL()&&"\\"!==t){t&&this.unput(1);break}}return this.T_STRING()}if(this.is_NUM())return this.consume_NUM();throw new Error('Bad terminal sequence "'.concat(t,'" at line ').concat(this.yylineno," (offset ").concat(this.offset,")"))}};var h={consume_NUM:function(){let t=this.yytext[0],e="."===t;if("0"===t)if(t=this.input(),"x"===t||"X"===t){if(t=this.input(),"_"!==t&&this.is_HEX())return this.consume_HNUM();this.unput(t?2:1)}else if("b"===t||"B"===t){if(t=this.input(),"_"!==t&&"0"===t||"1"===t)return this.consume_BNUM();this.unput(t?2:1)}else if("o"===t||"O"===t){if(t=this.input(),"_"!==t&&this.is_OCTAL())return this.consume_ONUM();this.unput(t?2:1)}else this.is_NUM()||t&&this.unput(1);for(;this.offset<this.size;){const s=t;if(t=this.input(),"_"===t){if("_"===s){this.unput(2);break}if("."===s){this.unput(1);break}if("e"===s||"E"===s){this.unput(2);break}}else{if("."===t){if(e){this.unput(1);break}if("_"===s){this.unput(2);break}e=!0;continue}if("e"===t||"E"===t){if("_"===s){this.unput(1);break}let e=2;if(t=this.input(),"+"!==t&&"-"!==t||(e=3,t=this.input()),this.is_NUM_START())return this.consume_LNUM(),this.tok.T_DNUMBER;this.unput(t?e:e-1);break}}if(!this.is_NUM()){t&&this.unput(1);break}}return e?this.tok.T_DNUMBER:this.yytext.length<9||this.yytext.length<10||10==this.yytext.length&&this.yytext<"2147483648"?this.tok.T_LNUMBER:this.tok.T_DNUMBER},consume_HNUM:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_HEX()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_LNUM:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_NUM()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_BNUM:function(){let t;for(;this.offset<this.size;)if(t=this.input(),"0"!==t&&"1"!==t&&"_"!==t){t&&this.unput(1);break}return this.tok.T_LNUMBER},consume_ONUM:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_OCTAL()){t&&this.unput(1);break}}return this.tok.T_LNUMBER}},a={matchST_LOOKING_FOR_PROPERTY:function(){let t=this.input();if("-"===t){if(t=this.input(),">"===t)return this.tok.T_OBJECT_OPERATOR;t&&this.unput(1)}else{if(this.is_WHITESPACE())return this.tok.T_WHITESPACE;if(this.is_LABEL_START())return this.consume_LABEL(),this.popState(),this.tok.T_STRING}return this.popState(),t&&this.unput(1),!1},matchST_LOOKING_FOR_VARNAME:function(){let t=this.input();if(this.popState(),this.begin("ST_IN_SCRIPTING"),this.is_LABEL_START()){if(this.consume_LABEL(),t=this.input(),"["===t||"}"===t)return this.unput(1),this.tok.T_STRING_VARNAME;this.unput(this.yytext.length)}else t&&this.unput(1);return!1},matchST_VAR_OFFSET:function(){const t=this.input();if(this.is_NUM_START())return this.consume_NUM(),this.tok.T_NUM_STRING;if("]"===t)return this.popState(),"]";if("$"===t){if(this.input(),this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_VARIABLE;throw new Error("Unexpected terminal")}if(this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_STRING;if(this.is_WHITESPACE()||"\\"===t||"'"===t||"#"===t)return this.tok.T_ENCAPSED_AND_WHITESPACE;if("["===t||"{"===t||"}"===t||'"'===t||"`"===t||this.is_TOKEN())return t;throw new Error("Unexpected terminal")}},c={matchST_IN_SCRIPTING:function(){let t=this.input();switch(t){case" ":case"\t":case"\n":case"\r":case"\r\n":return this.T_WHITESPACE();case"#":return this.version>=800&&"["===this._input[this.offset]?(this.input(),this.attributeListDepth[++this.attributeIndex]=0,this.begin("ST_ATTRIBUTE"),this.tok.T_ATTRIBUTE):this.T_COMMENT();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case'"':return this.ST_DOUBLE_QUOTES();case"`":return this.begin("ST_BACKQUOTE"),"`";case"?":if(!this.aspTagMode&&this.tryMatch(">")){this.input();const t=this._input[this.offset];return"\n"!==t&&"\r"!==t||this.input(),this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG}return this.consume_TOKEN();case"%":return this.aspTagMode&&">"===this._input[this.offset]?(this.input(),t=this._input[this.offset],"\n"!==t&&"\r"!==t||this.input(),this.aspTagMode=!1,this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG):this.consume_TOKEN();case"{":return this.begin("ST_IN_SCRIPTING"),"{";case"}":return this.conditionStack.length>2&&this.popState(),"}";default:if("."===t){if(t=this.input(),this.is_NUM_START())return this.consume_NUM();t&&this.unput(1)}if(this.is_NUM_START())return this.consume_NUM();if(this.is_LABEL_START())return this.consume_LABEL().T_STRING();if(this.is_TOKEN())return this.consume_TOKEN()}throw new Error('Bad terminal sequence "'+t+'" at line '+this.yylineno+" (offset "+this.offset+")")},T_WHITESPACE:function(){for(;this.offset<this.size;){const t=this.input();if(" "!==t&&"\t"!==t&&"\n"!==t&&"\r"!==t){t&&this.unput(1);break}}return this.tok.T_WHITESPACE}};const l=["\n","\r"],u=["\n","\r",";"],_=u.concat(["\t"," ",",","]",")","/","=","!"]);var p={T_CONSTANT_ENCAPSED_STRING:function(){let t;for(;this.offset<this.size;)if(t=this.input(),"\\"==t)this.input();else if("'"==t)break;return this.tok.T_CONSTANT_ENCAPSED_STRING},is_HEREDOC:function(){const t=this.offset;if("<"===this._input[this.offset-1]&&"<"===this._input[this.offset]&&"<"===this._input[this.offset+1]){if(this.offset+=3,this.is_TABSPACE())for(;this.offset<this.size&&(this.offset++,this.is_TABSPACE()););let e=this._input[this.offset-1];if("'"===e||'"'===e?this.offset++:e=null,this.is_LABEL_START()){let s=this.offset-1;for(;this.offset<this.size&&(this.offset++,this.is_LABEL()););const i=this._input.substring(s,this.offset-1);if((!e||e===this._input[this.offset-1])&&(e&&this.offset++,l.includes(this._input[this.offset-1])))return this.heredoc_label.label=i,this.heredoc_label.length=i.length,this.heredoc_label.finished=!1,s=this.offset-t,this.offset=t,this.consume(s),"'"===e?this.begin("ST_NOWDOC"):this.begin("ST_HEREDOC"),this.prematch_ENDOFDOC(),this.tok.T_START_HEREDOC}}return this.offset=t,!1},ST_DOUBLE_QUOTES:function(){let t;for(;this.offset<this.size;)if(t=this.input(),"\\"==t)this.input();else{if('"'==t)break;if("$"==t){if(t=this.input(),"{"==t||this.is_LABEL_START()){this.unput(2);break}t&&this.unput(1)}else if("{"==t){if(t=this.input(),"$"==t){this.unput(2);break}t&&this.unput(1)}}if('"'==t)return this.tok.T_CONSTANT_ENCAPSED_STRING;{let t=1;return"b"!==this.yytext[0]&&"B"!==this.yytext[0]||(t=2),this.yytext.length>2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-t),this.unput(this.yytext.length-t),this.begin("ST_DOUBLE_QUOTES"),this.yytext}},isDOC_MATCH:function(t,e){const s=this._input[t-2];if(!l.includes(s))return!1;let i=!1,n=!1,r=0,o=this._input[t-1];if(this.version>=703){for(;"\t"===o||" "===o;)" "===o?i=!0:"\t"===o&&(n=!0),o=this._input[t+r],r++;if(t+=r,l.includes(this._input[t-1]))return!1}if(this._input.substring(t-1,t-1+this.heredoc_label.length)===this.heredoc_label.label){const s=this._input[t-1+this.heredoc_label.length];if((this.version>=703?_:u).includes(s)){if(e){if(this.consume(r),i&&n)throw new Error("Parse error: mixing spaces and tabs in ending marker at line "+this.yylineno+" (offset "+this.offset+")")}else this.heredoc_label.indentation=r,this.heredoc_label.indentation_uses_spaces=i,this.heredoc_label.first_encaps_node=!0;return!0}}return!1},prematch_ENDOFDOC:function(){this.heredoc_label.indentation_uses_spaces=!1,this.heredoc_label.indentation=0,this.heredoc_label.first_encaps_node=!0;let t=this.offset+1;for(;t<this._input.length;){if(this.isDOC_MATCH(t,!1))return;if(!l.includes(this._input[t-1]))for(;!l.includes(this._input[t++])&&t<this._input.length;);t++}},matchST_NOWDOC:function(){if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length),this.popState(),this.tok.T_END_HEREDOC;let t=this._input[this.offset-1];for(;this.offset<this.size;)if(l.includes(t)){if(t=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else t=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_HEREDOC:function(){let t=this.input();if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length-1),this.popState(),this.tok.T_END_HEREDOC;for(;this.offset<this.size;)if("\\"===t&&(t=this.input(),l.includes(t)||(t=this.input())),l.includes(t)){if(t=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){const t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}}else if("{"===t){if(t=this.input(),"$"===t)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN)}else t=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},consume_VARIABLE:function(){this.consume_LABEL();const t=this.input();if("["==t)return this.unput(1),this.begin("ST_VAR_OFFSET"),this.tok.T_VARIABLE;if("-"===t){if(">"===this.input())return this.input(),this.is_LABEL_START()&&this.begin("ST_LOOKING_FOR_PROPERTY"),this.unput(3),this.tok.T_VARIABLE;this.unput(2)}else t&&this.unput(1);return this.tok.T_VARIABLE},matchST_BACKQUOTE:function(){let t=this.input();if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){return this.consume_VARIABLE()}}else if("{"===t){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if("`"===t)return this.popState(),"`";for(;this.offset<this.size;){if("\\"===t)this.input();else{if("`"===t){this.unput(1),this.popState(),this.appendToken("`",1);break}if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){const t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}continue}if("{"===t){if(t=this.input(),"$"===t)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);continue}}t=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_DOUBLE_QUOTES:function(){let t=this.input();if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){return this.consume_VARIABLE()}}else if("{"===t){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if('"'===t)return this.popState(),'"';for(;this.offset<this.size;){if("\\"===t)this.input();else{if('"'===t){this.unput(1),this.popState(),this.appendToken('"',1);break}if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){const t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}t&&this.unput(1)}else if("{"===t){if(t=this.input(),"$"===t)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);t&&this.unput(1)}}t=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE}};var d={is_NUM:function(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||95===t},is_NUM_START:function(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<58},is_LABEL:function(){const t=this._input.charCodeAt(this.offset-1);return t>96&&t<123||t>64&&t<91||95===t||t>47&&t<58||t>126},is_LABEL_START:function(){const t=this._input.charCodeAt(this.offset-1);return t>64&&t<91||(t>96&&t<123||(95===t||t>126))},consume_LABEL:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_LABEL()){t&&this.unput(1);break}}return this},is_TOKEN:function(){const t=this._input[this.offset-1];return-1!==";:,.\\[]()|^&+-/*=%!~$<>?@".indexOf(t)},is_WHITESPACE:function(){const t=this._input[this.offset-1];return" "===t||"\t"===t||"\n"===t||"\r"===t},is_TABSPACE:function(){const t=this._input[this.offset-1];return" "===t||"\t"===t},consume_TABSPACE:function(){for(;this.offset<this.size;){const t=this.input();if(!this.is_TABSPACE()){t&&this.unput(1);break}}return this},is_HEX:function(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||(t>64&&t<71||(t>96&&t<103||95===t))},is_OCTAL:function(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<56||95===t}};const f=function(t){this.engine=t,this.tok=this.engine.tokens.names,this.EOF=1,this.debug=!1,this.all_tokens=!0,this.comment_tokens=!1,this.mode_eval=!1,this.asp_tags=!1,this.short_tags=!1,this.version=801,this.yyprevcol=0,this.keywords={__class__:this.tok.T_CLASS_C,__trait__:this.tok.T_TRAIT_C,__function__:this.tok.T_FUNC_C,__method__:this.tok.T_METHOD_C,__line__:this.tok.T_LINE,__file__:this.tok.T_FILE,__dir__:this.tok.T_DIR,__namespace__:this.tok.T_NS_C,exit:this.tok.T_EXIT,die:this.tok.T_EXIT,function:this.tok.T_FUNCTION,const:this.tok.T_CONST,return:this.tok.T_RETURN,try:this.tok.T_TRY,catch:this.tok.T_CATCH,finally:this.tok.T_FINALLY,throw:this.tok.T_THROW,if:this.tok.T_IF,elseif:this.tok.T_ELSEIF,endif:this.tok.T_ENDIF,else:this.tok.T_ELSE,while:this.tok.T_WHILE,endwhile:this.tok.T_ENDWHILE,do:this.tok.T_DO,for:this.tok.T_FOR,endfor:this.tok.T_ENDFOR,foreach:this.tok.T_FOREACH,endforeach:this.tok.T_ENDFOREACH,declare:this.tok.T_DECLARE,enddeclare:this.tok.T_ENDDECLARE,instanceof:this.tok.T_INSTANCEOF,as:this.tok.T_AS,switch:this.tok.T_SWITCH,endswitch:this.tok.T_ENDSWITCH,case:this.tok.T_CASE,default:this.tok.T_DEFAULT,break:this.tok.T_BREAK,continue:this.tok.T_CONTINUE,goto:this.tok.T_GOTO,echo:this.tok.T_ECHO,print:this.tok.T_PRINT,class:this.tok.T_CLASS,interface:this.tok.T_INTERFACE,trait:this.tok.T_TRAIT,enum:this.tok.T_ENUM,extends:this.tok.T_EXTENDS,implements:this.tok.T_IMPLEMENTS,new:this.tok.T_NEW,clone:this.tok.T_CLONE,var:this.tok.T_VAR,eval:this.tok.T_EVAL,include:this.tok.T_INCLUDE,include_once:this.tok.T_INCLUDE_ONCE,require:this.tok.T_REQUIRE,require_once:this.tok.T_REQUIRE_ONCE,namespace:this.tok.T_NAMESPACE,use:this.tok.T_USE,insteadof:this.tok.T_INSTEADOF,global:this.tok.T_GLOBAL,isset:this.tok.T_ISSET,empty:this.tok.T_EMPTY,__halt_compiler:this.tok.T_HALT_COMPILER,static:this.tok.T_STATIC,abstract:this.tok.T_ABSTRACT,final:this.tok.T_FINAL,private:this.tok.T_PRIVATE,protected:this.tok.T_PROTECTED,public:this.tok.T_PUBLIC,unset:this.tok.T_UNSET,list:this.tok.T_LIST,array:this.tok.T_ARRAY,callable:this.tok.T_CALLABLE,or:this.tok.T_LOGICAL_OR,and:this.tok.T_LOGICAL_AND,xor:this.tok.T_LOGICAL_XOR,match:this.tok.T_MATCH,readonly:this.tok.T_READ_ONLY},this.castKeywords={int:this.tok.T_INT_CAST,integer:this.tok.T_INT_CAST,real:this.tok.T_DOUBLE_CAST,double:this.tok.T_DOUBLE_CAST,float:this.tok.T_DOUBLE_CAST,string:this.tok.T_STRING_CAST,binary:this.tok.T_STRING_CAST,array:this.tok.T_ARRAY_CAST,object:this.tok.T_OBJECT_CAST,bool:this.tok.T_BOOL_CAST,boolean:this.tok.T_BOOL_CAST,unset:this.tok.T_UNSET_CAST}};f.prototype.setInput=function(t){return this._input=t,this.size=t.length,this.yylineno=1,this.offset=0,this.yyprevcol=0,this.yytext="",this.yylloc={first_offset:0,first_line:1,first_column:0,prev_offset:0,prev_line:1,prev_column:0,last_line:1,last_column:0},this.tokens=[],this.version>703?this.keywords.fn=this.tok.T_FN:delete this.keywords.fn,this.done=this.offset>=this.size,!this.all_tokens&&this.mode_eval?(this.conditionStack=["INITIAL"],this.begin("ST_IN_SCRIPTING")):(this.conditionStack=[],this.begin("INITIAL")),this.heredoc_label={label:"",length:0,indentation:0,indentation_uses_spaces:!1,finished:!1,first_encaps_node:!1,toString:function(){this.label}},this},f.prototype.input=function(){const t=this._input[this.offset];return t?(this.yytext+=t,this.offset++,"\r"===t&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++),"\n"===t||"\r"===t?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++,t):""},f.prototype.unput=function(t){if(1===t)this.offset--,"\n"===this._input[this.offset]&&"\r"===this._input[this.offset-1]&&(this.offset--,t++),"\r"===this._input[this.offset]||"\n"===this._input[this.offset]?(this.yylloc.last_line--,this.yylineno--,this.yylloc.last_column=this.yyprevcol):this.yylloc.last_column--,this.yytext=this.yytext.substring(0,this.yytext.length-t);else if(t>0)if(this.offset-=t,t<this.yytext.length){this.yytext=this.yytext.substring(0,this.yytext.length-t),this.yylloc.last_line=this.yylloc.first_line,this.yylloc.last_column=this.yyprevcol=this.yylloc.first_column;for(let t=0;t<this.yytext.length;t++){let e=this.yytext[t];"\r"===e?(e=this.yytext[++t],this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0,"\n"!==e&&("\r"===e?this.yylloc.last_line++:this.yylloc.last_column++)):"\n"===e?(this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0):this.yylloc.last_column++}this.yylineno=this.yylloc.last_line}else this.yytext="",this.yylloc.last_line=this.yylineno=this.yylloc.first_line,this.yylloc.last_column=this.yylloc.first_column;return this},f.prototype.tryMatch=function(t){return t===this.ahead(t.length)},f.prototype.tryMatchCaseless=function(t){return t===this.ahead(t.length).toLowerCase()},f.prototype.ahead=function(t){let e=this._input.substring(this.offset,this.offset+t);return"\r"===e[e.length-1]&&"\n"===this._input[this.offset+t+1]&&(e+="\n"),e},f.prototype.consume=function(t){for(let e=0;e<t;e++){const t=this._input[this.offset];if(!t)break;this.yytext+=t,this.offset++,"\r"===t&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++,e++),"\n"===t||"\r"===t?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++}return this},f.prototype.getState=function(){return{yytext:this.yytext,offset:this.offset,yylineno:this.yylineno,yyprevcol:this.yyprevcol,yylloc:{first_offset:this.yylloc.first_offset,first_line:this.yylloc.first_line,first_column:this.yylloc.first_column,last_line:this.yylloc.last_line,last_column:this.yylloc.last_column},heredoc_label:this.heredoc_label}},f.prototype.setState=function(t){return this.yytext=t.yytext,this.offset=t.offset,this.yylineno=t.yylineno,this.yyprevcol=t.yyprevcol,this.yylloc=t.yylloc,t.heredoc_label&&(this.heredoc_label=t.heredoc_label),this},f.prototype.appendToken=function(t,e){return this.tokens.push([t,e]),this},f.prototype.lex=function(){this.yylloc.prev_offset=this.offset,this.yylloc.prev_line=this.yylloc.last_line,this.yylloc.prev_column=this.yylloc.last_column;let t=this.next()||this.lex();if(!this.all_tokens){for(;t===this.tok.T_WHITESPACE||!this.comment_tokens&&(t===this.tok.T_COMMENT||t===this.tok.T_DOC_COMMENT)||t===this.tok.T_OPEN_TAG;)t=this.next()||this.lex();if(t==this.tok.T_OPEN_TAG_WITH_ECHO)return this.tok.T_ECHO;if(t===this.tok.T_CLOSE_TAG)return";"}return this.yylloc.prev_offset||(this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column),t},f.prototype.begin=function(t){if(this.conditionStack.push(t),this.curCondition=t,this.stateCb=this["match"+t],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+t+'"');return this},f.prototype.popState=function(){const t=this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0];if(this.curCondition=this.conditionStack[this.conditionStack.length-1],this.stateCb=this["match"+this.curCondition],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+this.curCondition+'"');return t},f.prototype.next=function(){let t;if(this._input||(this.done=!0),this.yylloc.first_offset=this.offset,this.yylloc.first_line=this.yylloc.last_line,this.yylloc.first_column=this.yylloc.last_column,this.yytext="",this.done)return this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column,this.EOF;if(this.tokens.length>0?(t=this.tokens.shift(),"object"==typeof t[1]?this.setState(t[1]):this.consume(t[1]),t=t[0]):t=this.stateCb.apply(this,[]),this.offset>=this.size&&0===this.tokens.length&&(this.done=!0),this.debug){let e=t;e="number"==typeof e?this.engine.tokens.values[e]:'"'+e+'"';const s=new Error(e+"\tfrom "+this.yylloc.first_line+","+this.yylloc.first_column+"\t - to "+this.yylloc.last_line+","+this.yylloc.last_column+'\t"'+this.yytext+'"');console.error(s.stack)}return t},[o,{T_COMMENT:function(){for(;this.offset<this.size;){const t=this.input();if("\n"===t||"\r"===t)return this.tok.T_COMMENT;if("?"===t&&!this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT;if("%"===t&&this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT}return this.tok.T_COMMENT},T_DOC_COMMENT:function(){let t=this.input(),e=this.tok.T_COMMENT;if("*"===t){if(t=this.input(),this.is_WHITESPACE()&&(e=this.tok.T_DOC_COMMENT),"/"===t)return e;this.unput(1)}for(;this.offset<this.size;)if(t=this.input(),"*"===t&&"/"===this._input[this.offset]){this.input();break}return e}},{nextINITIAL:function(){return this.conditionStack.length>1&&"INITIAL"===this.conditionStack[this.conditionStack.length-1]?this.popState():this.begin("ST_IN_SCRIPTING"),this},matchINITIAL:function(){for(;this.offset<this.size;){let t=this.input();if("<"==t)if(t=this.ahead(1),"?"==t){if(this.tryMatch("?=")){this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}if(this.tryMatchCaseless("?php")&&(t=this._input[this.offset+4]," "===t||"\t"===t||"\n"===t||"\r"===t)){this.unput(1).appendToken(this.tok.T_OPEN_TAG,6).nextINITIAL();break}if(this.short_tags){this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}else if(this.asp_tags&&"%"==t){if(this.tryMatch("%=")){this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}return this.yytext.length>0&&this.tok.T_INLINE_HTML}},h,a,c,p,{T_STRING:function(){const t=this.yytext.toLowerCase();let e=this.keywords[t];if("number"!=typeof e)if("yield"===t)this.version>=700&&this.tryMatch(" from")?(this.consume(5),e=this.tok.T_YIELD_FROM):e=this.tok.T_YIELD;else if(e=this.tok.T_STRING,"b"===t||"B"===t){const t=this.input();if('"'===t)return this.ST_DOUBLE_QUOTES();if("'"===t)return this.T_CONSTANT_ENCAPSED_STRING();t&&this.unput(1)}if(e===this.tok.T_ENUM){if(this.version<801)return this.tok.T_STRING;const t=this.offset;let e=this.input();for(;" "==e;)e=this.input();let s=!1;if(this.is_LABEL_START()){for(;this.is_LABEL();)e+=this.input();const t=e.slice(0,-1).toLowerCase();s="extends"!==t&&"implements"!==t}return this.unput(this.offset-t),s?this.tok.T_ENUM:this.tok.T_STRING}if(this.offset<this.size&&e!==this.tok.T_YIELD_FROM){let s=this.input();if("\\"===s){e="namespace"===t?this.tok.T_NAME_RELATIVE:this.tok.T_NAME_QUALIFIED;do{if("{"===this._input[this.offset]){this.input();break}this.consume_LABEL(),s=this.input()}while("\\"===s)}s&&this.unput(1)}return e},consume_TOKEN:function(){const t=this._input[this.offset-1],e=this.tokenTerminals[t];return e?e.apply(this,[]):this.yytext},tokenTerminals:{$:function(){return this.offset++,this.is_LABEL_START()?(this.offset--,this.consume_LABEL(),this.tok.T_VARIABLE):(this.offset--,"$")},"-":function(){const t=this._input[this.offset];return">"===t?(this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_OBJECT_OPERATOR):"-"===t?(this.input(),this.tok.T_DEC):"="===t?(this.input(),this.tok.T_MINUS_EQUAL):"-"},"\\":function(){if(this.offset<this.size){if(this.input(),this.is_LABEL_START()){let t;do{if("{"===this._input[this.offset]){this.input();break}this.consume_LABEL(),t=this.input()}while("\\"===t);return this.unput(1),this.tok.T_NAME_FULLY_QUALIFIED}this.unput(1)}return this.tok.T_NS_SEPARATOR},"/":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_DIV_EQUAL):"/"},":":function(){return":"===this._input[this.offset]?(this.input(),this.tok.T_DOUBLE_COLON):":"},"(":function(){const t=this.offset;if(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this.is_LABEL_START()){const t=this.yytext.length;this.consume_LABEL();const e=this.yytext.substring(t-1).toLowerCase(),s=this.castKeywords[e];if("number"==typeof s&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return s}return this.unput(this.offset-t),"("},"=":function(){const t=this._input[this.offset];return">"===t?(this.input(),this.tok.T_DOUBLE_ARROW):"="===t?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_IDENTICAL):(this.input(),this.tok.T_IS_EQUAL):"="},"+":function(){const t=this._input[this.offset];return"+"===t?(this.input(),this.tok.T_INC):"="===t?(this.input(),this.tok.T_PLUS_EQUAL):"+"},"!":function(){return"="===this._input[this.offset]?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_NOT_IDENTICAL):(this.input(),this.tok.T_IS_NOT_EQUAL):"!"},"?":function(){return this.version>=700&&"?"===this._input[this.offset]?this.version>=704&&"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_COALESCE_EQUAL):(this.input(),this.tok.T_COALESCE):this.version>=800&&"-"===this._input[this.offset]&&">"===this._input[this.offset+1]?(this.consume(1),this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_NULLSAFE_OBJECT_OPERATOR):"?"},"<":function(){let t=this._input[this.offset];return"<"===t?(t=this._input[this.offset+1],"="===t?(this.consume(2),this.tok.T_SL_EQUAL):"<"===t&&this.is_HEREDOC()?this.tok.T_START_HEREDOC:(this.input(),this.tok.T_SL)):"="===t?(this.input(),this.version>=700&&">"===this._input[this.offset]?(this.input(),this.tok.T_SPACESHIP):this.tok.T_IS_SMALLER_OR_EQUAL):">"===t?(this.input(),this.tok.T_IS_NOT_EQUAL):"<"},">":function(){let t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):">"===t?(t=this._input[this.offset+1],"="===t?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR)):">"},"*":function(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_MUL_EQUAL):"*"===t?(this.input(),"="===this._input[this.offset]?(this.input(),this.tok.T_POW_EQUAL):this.tok.T_POW):"*"},".":function(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_CONCAT_EQUAL):"."===t&&"."===this._input[this.offset+1]?(this.consume(2),this.tok.T_ELLIPSIS):"."},"%":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_MOD_EQUAL):"%"},"&":function(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_AND_EQUAL):"&"===t?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|":function(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_OR_EQUAL):"|"===t?(this.input(),this.tok.T_BOOLEAN_OR):"|"},"^":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_XOR_EQUAL):"^"}}},d].forEach((function(t){for(const e in t)f.prototype[e]=t[e]}));var k=f;var T=function(t,e,s){this.line=t,this.column=e,this.offset=s},x={read_expr:function(t){const e=this.node();if("@"===this.token)return t||(t=this.next().read_expr()),e("silent",t);if(t||(t=this.read_expr_item()),"|"===this.token)return e("bin","|",t,this.next().read_expr());if("&"===this.token)return e("bin","&",t,this.next().read_expr());if("^"===this.token)return e("bin","^",t,this.next().read_expr());if("."===this.token)return e("bin",".",t,this.next().read_expr());if("+"===this.token)return e("bin","+",t,this.next().read_expr());if("-"===this.token)return e("bin","-",t,this.next().read_expr());if("*"===this.token)return e("bin","*",t,this.next().read_expr());if("/"===this.token)return e("bin","/",t,this.next().read_expr());if("%"===this.token)return e("bin","%",t,this.next().read_expr());if(this.token===this.tok.T_POW)return e("bin","**",t,this.next().read_expr());if(this.token===this.tok.T_SL)return e("bin","<<",t,this.next().read_expr());if(this.token===this.tok.T_SR)return e("bin",">>",t,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_OR)return e("bin","||",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_OR)return e("bin","or",t,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_AND)return e("bin","&&",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_AND)return e("bin","and",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_XOR)return e("bin","xor",t,this.next().read_expr());if(this.token===this.tok.T_IS_IDENTICAL)return e("bin","===",t,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_IDENTICAL)return e("bin","!==",t,this.next().read_expr());if(this.token===this.tok.T_IS_EQUAL)return e("bin","==",t,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_EQUAL)return e("bin","!=",t,this.next().read_expr());if("<"===this.token)return e("bin","<",t,this.next().read_expr());if(">"===this.token)return e("bin",">",t,this.next().read_expr());if(this.token===this.tok.T_IS_SMALLER_OR_EQUAL)return e("bin","<=",t,this.next().read_expr());if(this.token===this.tok.T_IS_GREATER_OR_EQUAL)return e("bin",">=",t,this.next().read_expr());if(this.token===this.tok.T_SPACESHIP)return e("bin","<=>",t,this.next().read_expr());if(this.token===this.tok.T_INSTANCEOF&&(t=e("bin","instanceof",t,this.next().read_class_name_reference()),";"!==this.token&&this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF&&(t=this.read_expr(t))),this.token===this.tok.T_COALESCE)return e("bin","??",t,this.next().read_expr());if("?"===this.token){let s=null;return":"!==this.next().token&&(s=this.read_expr()),this.expect(":")&&this.next(),e("retif",t,s,this.read_expr())}return e.destroy(t),t},read_expr_cast:function(t){return this.node("cast")(t,this.text(),this.next().read_expr())},read_isset_variable:function(){return this.read_expr()},read_isset_variables:function(){return this.read_function_list(this.read_isset_variable,",")},read_internal_functions_in_yacc:function(){let t=null;switch(this.token){case this.tok.T_ISSET:{t=this.node("isset"),this.next().expect("(")&&this.next();const e=this.read_isset_variables();this.expect(")")&&this.next(),t=t(e)}break;case this.tok.T_EMPTY:{t=this.node("empty"),this.next().expect("(")&&this.next();const e=this.read_expr();this.expect(")")&&this.next(),t=t(e)}break;case this.tok.T_INCLUDE:t=this.node("include")(!1,!1,this.next().read_expr());break;case this.tok.T_INCLUDE_ONCE:t=this.node("include")(!0,!1,this.next().read_expr());break;case this.tok.T_EVAL:{t=this.node("eval"),this.next().expect("(")&&this.next();const e=this.read_expr();this.expect(")")&&this.next(),t=t(e)}break;case this.tok.T_REQUIRE:t=this.node("include")(!1,!0,this.next().read_expr());break;case this.tok.T_REQUIRE_ONCE:t=this.node("include")(!0,!0,this.next().read_expr())}return t},read_optional_expr:function(t){return this.token!==t?this.read_expr():null},read_exit_expr:function(){let t=null;return"("===this.token&&(this.next(),t=this.read_optional_expr(")"),this.expect(")")&&this.next()),t},read_expr_item:function(){let t,e,s=[];if("+"===this.token)return this.node("unary")("+",this.next().read_expr());if("-"===this.token)return this.node("unary")("-",this.next().read_expr());if("!"===this.token)return this.node("unary")("!",this.next().read_expr());if("~"===this.token)return this.node("unary")("~",this.next().read_expr());if("("===this.token)return e=this.next().read_expr(),e.parenthesizedExpression=!0,this.expect(")")&&this.next(),this.handleDereferencable(e);if("`"===this.token)return this.read_encapsed_string("`");if(this.token===this.tok.T_LIST){let e=null;const s=this.innerList;t=this.node("list"),s||(e=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);const i=this.read_array_pair_list(!1);this.expect(")")&&this.next();let n=!1;for(let t=0;t<i.length;t++)if(null!==i[t]&&"noop"!==i[t].kind){n=!0;break}return n||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),s?t(i,!1):(this.innerList=!1,this.expect("=")?e(t(i,!1),this.next().read_expr(),"="):t(i,!1))}if(this.token===this.tok.T_ATTRIBUTE&&(s=this.read_attr_list()),this.token===this.tok.T_CLONE)return this.node("clone")(this.next().read_expr());switch(this.token){case this.tok.T_INC:return this.node("pre")("+",this.next().read_variable(!1,!1));case this.tok.T_DEC:return this.node("pre")("-",this.next().read_variable(!1,!1));case this.tok.T_NEW:return this.read_new_expr();case this.tok.T_ISSET:case this.tok.T_EMPTY:case this.tok.T_INCLUDE:case this.tok.T_INCLUDE_ONCE:case this.tok.T_EVAL:case this.tok.T_REQUIRE:case this.tok.T_REQUIRE_ONCE:return this.read_internal_functions_in_yacc();case this.tok.T_MATCH:return this.read_match_expression();case this.tok.T_INT_CAST:return this.read_expr_cast("int");case this.tok.T_DOUBLE_CAST:return this.read_expr_cast("float");case this.tok.T_STRING_CAST:return this.read_expr_cast(-1!==this.text().indexOf("binary")?"binary":"string");case this.tok.T_ARRAY_CAST:return this.read_expr_cast("array");case this.tok.T_OBJECT_CAST:return this.read_expr_cast("object");case this.tok.T_BOOL_CAST:return this.read_expr_cast("bool");case this.tok.T_UNSET_CAST:return this.read_expr_cast("unset");case this.tok.T_THROW:this.version<800&&this.raiseError("PHP 8+ is required to use throw as an expression");return this.node("throw")(this.next().read_expr());case this.tok.T_EXIT:{const e="die"===this.lexer.yytext.toLowerCase();t=this.node("exit"),this.next();return t(this.read_exit_expr(),e)}case this.tok.T_PRINT:return this.node("print")(this.next().read_expr());case this.tok.T_YIELD:{let e=null,s=null;return t=this.node("yield"),this.next().is("EXPR")&&(e=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(s=e,e=this.next().read_expr())),t(e,s)}case this.tok.T_YIELD_FROM:return t=this.node("yieldfrom"),e=this.next().read_expr(),t(e);case this.tok.T_FN:case this.tok.T_FUNCTION:return this.read_inline_function(void 0,s);case this.tok.T_STATIC:{const t=[this.token,this.lexer.getState()];if(this.next(),this.token===this.tok.T_FUNCTION||this.version>=704&&this.token===this.tok.T_FN)return this.read_inline_function([0,1,0],s);this.lexer.tokens.push(t),this.next()}}if(this.is("VARIABLE")){t=this.node(),e=this.read_variable(!1,!1);const s="identifier"===e.kind||"staticlookup"===e.kind&&"identifier"===e.offset.kind;switch(this.token){case"=":return s&&this.error("VARIABLE"),"&"==this.next().token?this.read_assignref(t,e):t("assign",e,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"??=");case this.tok.T_INC:return s&&this.error("VARIABLE"),this.next(),t("post","+",e);case this.tok.T_DEC:return s&&this.error("VARIABLE"),this.next(),t("post","-",e);default:t.destroy(e)}}else{if(this.is("SCALAR")){if(t=this.node(),e=this.read_scalar(),"array"===e.kind&&e.shortForm&&"="===this.token){const s=this.convertToList(e);e.loc&&(s.loc=e.loc);return t("assign",s,this.next().read_expr(),"=")}return t.destroy(e),this.handleDereferencable(e)}this.error("EXPR"),this.next()}return e},convertToList:function(t){const e=t.items.map((t=>(t.value&&"array"===t.value.kind&&t.value.shortForm&&(t.value=this.convertToList(t.value)),t))),s=this.node("list")(e,!0);return t.loc&&(s.loc=t.loc),t.leadingComments&&(s.leadingComments=t.leadingComments),t.trailingComments&&(s.trailingComments=t.trailingComments),s},read_assignref:function(t,e){let s;return this.next(),this.token===this.tok.T_NEW?(this.version>=700&&this.error(),s=this.read_new_expr()):s=this.read_variable(!1,!1),t("assignref",e,s)},read_inline_function:function(t,e){if(this.token===this.tok.T_FUNCTION){const s=this.read_function(!0,t,e);return s.attrGroups=e,s}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");const s=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();const i=this.is_reference();this.expect("(")&&this.next();const n=this.read_parameter_list();this.expect(")")&&this.next();let r=!1,o=null;":"===this.token&&("?"===this.next().token&&(r=!0,this.next()),o=this.read_types()),this.expect(this.tok.T_DOUBLE_ARROW)&&this.next();const h=s(n,i,this.read_expr(),o,r,!!t);return h.attrGroups=e,h},read_match_expression:function(){const t=this.node("match");this.expect(this.tok.T_MATCH)&&this.next(),this.version<800&&this.raiseError("Match statements are not allowed before PHP 8");let e=null,s=[];return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),this.expect("{")&&this.next(),s=this.read_match_arms(),this.expect("}")&&this.next(),t(e,s)},read_match_arms:function(){return this.read_list((()=>this.read_match_arm()),",",!0)},read_match_arm:function(){if("}"!==this.token)return this.node("matcharm")(this.read_match_arm_conds(),this.read_expr())},read_match_arm_conds:function(){let t=[];if(this.token===this.tok.T_DEFAULT)t=null,this.next();else for(t.push(this.read_expr());","===this.token;){if(this.next(),this.token===this.tok.T_DOUBLE_ARROW)return this.next(),t;t.push(this.read_expr())}return this.expect(this.tok.T_DOUBLE_ARROW)&&this.next(),t},read_attribute(){const t=this.text();let e=[];return this.next(),"("===this.token&&(e=this.read_argument_list()),this.node("attribute")(t,e)},read_attr_list(){const t=[];if(this.token===this.tok.T_ATTRIBUTE)do{const e=this.node("attrgroup")([]);for(this.next(),e.attrs.push(this.read_attribute());","===this.token;)this.next(),"]"!==this.token&&e.attrs.push(this.read_attribute());t.push(e),this.expect("]"),this.next()}while(this.token===this.tok.T_ATTRIBUTE);return t},read_new_expr:function(){const t=this.node("new");this.expect(this.tok.T_NEW)&&this.next();let e=[];if("("===this.token){this.next();const s=this.read_expr();return this.expect(")"),this.next(),"("===this.token&&(e=this.read_argument_list()),t(s,e)}const s=this.read_attr_list();if(this.token===this.tok.T_CLASS){const i=this.node("class");"("===this.next().token&&(e=this.read_argument_list());const n=this.read_extends_from(),r=this.read_implements_list();let o=null;this.expect("{")&&(o=this.next().read_class_body(!0,!1));const h=i(null,n,r,o,[0,0,0]);return h.attrGroups=s,t(h,e)}let i=this.read_new_class_name();for(;"["===this.token;){const t=this.node("offsetlookup"),e=this.next().read_encaps_var_offset();this.expect("]")&&this.next(),i=t(i,e)}return"("===this.token&&(e=this.read_argument_list()),t(i,e)},read_new_class_name:function(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){let t=this.read_namespace_name(!0);return this.token===this.tok.T_DOUBLE_COLON&&(t=this.read_static_getter(t)),t}if(this.is("VARIABLE"))return this.read_variable(!0,!1);this.expect([this.tok.T_STRING,"VARIABLE"])},handleDereferencable:function(t){for(;this.token!==this.EOF;)if(this.token===this.tok.T_OBJECT_OPERATOR||this.token===this.tok.T_DOUBLE_COLON)t=this.recursive_variable_chain_scan(t,!1,!1,!0);else if(this.token===this.tok.T_CURLY_OPEN||"["===this.token)t=this.read_dereferencable(t);else{if("("!==this.token)return t;t=this.node("call")(t,this.read_argument_list())}return t}},E={is_reference:function(){return"&"===this.token&&(this.next(),!0)},is_variadic:function(){return this.token===this.tok.T_ELLIPSIS&&(this.next(),!0)},read_function:function(t,e,s,i){const n=this.read_function_declaration(t?1:e?2:0,e&&1===e[1],s||[],i);return e&&1==e[2]?(n.parseFlags(e),this.expect(";")&&this.next()):(this.expect("{")&&(n.body=this.read_code_block(!1),n.loc&&n.body.loc&&(n.loc.end=n.body.loc.end)),!t&&e&&n.parseFlags(e)),n},read_function_declaration:function(t,e,s,i){let n="function";1===t?n="closure":2===t&&(n="method");const r=this.node(n);this.expect(this.tok.T_FUNCTION)&&this.next();const o=this.is_reference();let h=!1,a=[],c=null,l=!1;if(1!==t){const e=this.node("identifier");2===t?this.version>=700?this.token===this.tok.T_STRING||this.is("IDENTIFIER")?(h=this.text(),this.next()):this.version<704&&this.error("IDENTIFIER"):this.token===this.tok.T_STRING?(h=this.text(),this.next()):this.error("IDENTIFIER"):this.version>=700?this.token===this.tok.T_STRING?(h=this.text(),this.next()):this.version>=704?this.expect("(")||this.next():(this.error(this.tok.T_STRING),this.next()):(this.expect(this.tok.T_STRING)&&(h=this.text()),this.next()),h=e(h)}this.expect("(")&&this.next();const u=this.read_parameter_list("__construct"===h.name);this.expect(")")&&this.next(),1===t&&(a=this.read_lexical_vars()),":"===this.token&&("?"===this.next().token&&(l=!0,this.next()),c=this.read_types());const _=t=>(t.attrGroups=s||[],i&&t.loc&&(t.loc.start=i,t.loc.source&&(t.loc.source=this.lexer._input.substr(t.loc.start.offset,t.loc.end.offset-t.loc.start.offset))),t);return _(1===t?r(u,o,a,c,l,e):r(h,u,o,c,l))},read_lexical_vars:function(){let t=[];return this.token===this.tok.T_USE&&(this.next(),this.expect("(")&&this.next(),t=this.read_lexical_var_list(),this.expect(")")&&this.next()),t},read_list_with_dangling_comma:function(t){const e=[];for(;this.token!=this.EOF;){if(e.push(t()),","!=this.token){if(")"==this.token)break;this.error([",",")"]);break}if(this.next(),this.version>=800&&")"===this.token)return e}return e},read_lexical_var_list:function(){return this.read_list_with_dangling_comma(this.read_lexical_var.bind(this))},read_lexical_var:function(){if("&"===this.token)return this.read_byref(this.read_lexical_var.bind(this));const t=this.node("variable");this.expect(this.tok.T_VARIABLE);const e=this.text().substring(1);return this.next(),t(e,!1)},read_parameter_list:function(t){if(")"!==this.token){let e=!1;return this.read_list_with_dangling_comma(function(){const s=this.read_parameter(t);return s&&(e&&this.raiseError("Unexpected parameter after a variadic parameter"),s.variadic&&(e=!0)),s}.bind(this),",")}return[]},read_parameter:function(t){const e=this.node("parameter");let s=null,i=null,n=null,r=!1,o=!1,h=[];this.token===this.tok.T_ATTRIBUTE&&(h=this.read_attr_list()),this.version>=801&&this.token===this.tok.T_READ_ONLY&&(t?(this.next(),o=!0):this.raiseError("readonly properties can be used only on class constructor"));const a=this.read_promoted();!o&&this.version>=801&&this.token===this.tok.T_READ_ONLY&&(t?(this.next(),o=!0):this.raiseError("readonly properties can be used only on class constructor")),"?"===this.token&&(this.next(),r=!0),n=this.read_types(),r&&!n&&this.raiseError("Expecting a type definition combined with nullable operator");const c=this.is_reference(),l=this.is_variadic();if(this.expect(this.tok.T_VARIABLE)){s=this.node("identifier");const t=this.text().substring(1);this.next(),s=s(t)}"="==this.token&&(i=this.next().read_expr());const u=e(s,n,i,c,l,o,r,a);return h&&(u.attrGroups=h),u},read_types:function(){const t="unset",e="union",s="intersection",i=[];let n=t;const r=this.read_type();if(!r)return null;for(i.push(r);"|"===this.token||this.version>=801&&"&"===this.token;){const r=this.peek();if(r===this.tok.T_ELLIPSIS||r===this.tok.T_VARIABLE)break;n===t?n="|"===this.token?e:s:(n===e&&"|"!==this.token||n===s&&"&"!==this.token)&&this.raiseError('Unexpect token "'+this.token+'", "|" and "&" can not be mixed'),this.next(),i.push(this.read_type())}return 1===i.length?i[0]:n===s?this.node("intersectiontype")(i):this.node("uniontype")(i)},read_promoted:function(){return this.token===this.tok.T_PUBLIC?(this.next(),1):this.token===this.tok.T_PROTECTED?(this.next(),2):this.token===this.tok.T_PRIVATE?(this.next(),4):0},read_argument_list:function(){let t=[];return this.expect("(")&&this.next(),this.version>=801&&this.token===this.tok.T_ELLIPSIS&&")"===this.peek()?(t.push(this.node("variadicplaceholder")()),this.next()):")"!==this.token&&(t=this.read_non_empty_argument_list()),this.expect(")")&&this.next(),t},read_non_empty_argument_list:function(){let t=!1;return this.read_function_list(function(){const e=this.read_argument();if(e){const s="variadic"===e.kind;t&&!s&&this.raiseError("Unexpected non-variadic argument after a variadic argument"),s&&(t=!0)}return e}.bind(this),",")},read_argument:function(){if(this.token===this.tok.T_ELLIPSIS)return this.node("variadic")(this.next().read_expr());if(this.token===this.tok.T_STRING||Object.values(this.lexer.keywords).includes(this.token)){if(":"===this.peek())return this.version<800&&this.raiseError("PHP 8+ is required to use named arguments"),this.node("namedargument")(this.text(),this.next().next().read_expr())}return this.read_expr()},read_type:function(){const t=this.node();if(this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE){const e=this.text();return this.next(),t("typereference",e.toLowerCase(),e)}if(this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_STATIC){const e=this.text(),s=[this.token,this.lexer.getState()];return this.next(),this.token!==this.tok.T_NS_SEPARATOR&&this.ast.typereference.types.indexOf(e.toLowerCase())>-1?t("typereference",e.toLowerCase(),e):(this.lexer.tokens.push(s),this.next(),t.destroy(),this.read_namespace_name())}return t.destroy(),null}};const m={"\\":"\\",$:"$",n:"\n",r:"\r",t:"\t",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)};var y={resolve_special_chars:function(t,e){return e?t.replace(/\\"/,'"').replace(/\\([\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})/g,((t,e,s)=>m[e]?m[e]:"x"===e[0]||"X"===e[0]?String.fromCodePoint(parseInt(e.substr(1),16)):"u"===e[0]?String.fromCodePoint(parseInt(s,16)):String.fromCodePoint(parseInt(e,8)))):t.replace(/\\\\/g,"\\").replace(/\\'/g,"'")},remove_heredoc_leading_whitespace_chars:function(t,e,s,i){if(0===e)return t;this.check_heredoc_indentation_level(t,e,s,i);const n=s?" ":"\t",r=new RegExp("\\n".concat(n,"{").concat(e,"}"),"g"),o=new RegExp("^".concat(n,"{").concat(e,"}"));return i&&(t=t.replace(o,"")),t.replace(r,"\n")},check_heredoc_indentation_level:function(t,e,s,i){const n=t.length;let r=0,o=0,h=!0;const a=s?" ":"\t";let c=!1;if(!i){if(r=t.indexOf("\n"),-1===r)return;r++}for(;r<n;)h?t[r]===a?o++:c=!0:h=!1,"\n"!==t[r]&&c&&o<e?this.raiseError("Invalid body indentation level (expecting an indentation at least ".concat(e,")")):c=!1,"\n"===t[r]&&(h=!0,o=0),r++},read_dereferencable_scalar:function(){let t=null;switch(this.token){case this.tok.T_CONSTANT_ENCAPSED_STRING:{let e=this.node("string");const s=this.text();let i=0;"b"!==s[0]&&"B"!==s[0]||(i=1);const n='"'===s[i];this.next();e=e(n,this.resolve_special_chars(s.substring(i+1,s.length-1),n),1===i,s),t=this.token===this.tok.T_DOUBLE_COLON?this.read_static_getter(e):e}break;case this.tok.T_ARRAY:case"[":t=this.read_array()}return t},read_scalar:function(){if(this.is("T_MAGIC_CONST"))return this.get_magic_constant();{let t,e;switch(this.token){case this.tok.T_LNUMBER:case this.tok.T_DNUMBER:{const e=this.node("number");return t=this.text(),this.next(),e(t,null)}case this.tok.T_START_HEREDOC:if("ST_NOWDOC"===this.lexer.curCondition){const s=this.lexer.yylloc.first_offset;e=this.node("nowdoc"),t=this.next().text(),this.lexer.heredoc_label.indentation>0&&(t=t.substring(0,t.length-this.lexer.heredoc_label.indentation));const i=t[t.length-1];"\n"===i?t="\r"===t[t.length-2]?t.substring(0,t.length-2):t.substring(0,t.length-1):"\r"===i&&(t=t.substring(0,t.length-1)),this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE)&&this.next(),this.expect(this.tok.T_END_HEREDOC)&&this.next();const n=this.lexer._input.substring(s,this.lexer.yylloc.first_offset);return e=e(this.remove_heredoc_leading_whitespace_chars(t,this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node),n,this.lexer.heredoc_label.label),this.lexer.heredoc_label.finished=!0,e}return this.read_encapsed_string(this.tok.T_END_HEREDOC);case'"':return this.read_encapsed_string('"');case'b"':case'B"':return this.read_encapsed_string('"',!0);case this.tok.T_CONSTANT_ENCAPSED_STRING:case this.tok.T_ARRAY:case"[":return this.read_dereferencable_scalar();default:{const t=this.error("SCALAR");return this.next(),t}}}},read_dereferencable:function(t){let e,s;const i=this.node("offsetlookup");return"["===this.token?(s=this.next().read_expr(),this.expect("]")&&this.next(),e=i(t,s)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(s=this.read_encapsed_string_item(!1),e=i(t,s)),e},read_encapsed_string_item:function(t){const e=this.node("encapsedpart");let s,i,n,r=null,o=!1,h=this.node();if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){const e=this.text();this.next(),h=h("string",!1,this.version>=703&&!this.lexer.heredoc_label.finished?this.remove_heredoc_leading_whitespace_chars(this.resolve_special_chars(e,t),this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node):e,!1,e)}else if(this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES){if(r="simple",o=!0,n=null,this.next().token===this.tok.T_STRING_VARNAME){n=this.node("variable");const t=this.text();this.next(),h.destroy(),"["===this.token?(n=n(t,!1),i=this.node("offsetlookup"),s=this.next().read_expr(),this.expect("]")&&this.next(),h=i(n,s)):h=n(t,!1)}else h=h("variable",this.read_expr(),!1);this.expect("}")&&this.next()}else if(this.token===this.tok.T_CURLY_OPEN)r="complex",h.destroy(),h=this.next().read_variable(!1,!1),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(r="simple",h.destroy(),h=this.read_simple_variable(),"["===this.token&&(i=this.node("offsetlookup"),s=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),h=i(h,s)),this.token===this.tok.T_OBJECT_OPERATOR){i=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);const t=this.node("identifier");n=this.text(),this.next(),h=i(h,t(n))}}else{this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);const t=this.text();this.next(),h.destroy(),h=h("string",!1,t,!1,t)}return this.lexer.heredoc_label.first_encaps_node=!1,e(h,r,o)},read_encapsed_string:function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=this.lexer.yylloc.first_offset;let i=this.node("encapsed");this.next();const n=this.lexer.yylloc.prev_offset-(e?1:0),r=[];let o=null;for(o="`"===t?this.ast.encapsed.TYPE_SHELL:'"'===t?this.ast.encapsed.TYPE_STRING:this.ast.encapsed.TYPE_HEREDOC;this.token!==t&&this.token!==this.EOF;)r.push(this.read_encapsed_string_item(!0));if(r.length>0&&"encapsedpart"===r[r.length-1].kind&&"string"===r[r.length-1].expression.kind){const t=r[r.length-1].expression,e=t.value[t.value.length-1];"\n"===e?"\r"===t.value[t.value.length-2]?t.value=t.value.substring(0,t.value.length-2):t.value=t.value.substring(0,t.value.length-1):"\r"===e&&(t.value=t.value.substring(0,t.value.length-1))}this.expect(t)&&this.next();return i=i(r,this.lexer._input.substring("heredoc"===o?s:n-1,this.lexer.yylloc.first_offset),o),t===this.tok.T_END_HEREDOC&&(i.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),i},get_magic_constant:function(){const t=this.node("magic"),e=this.text();return this.next(),t(e.toUpperCase(),e)}},A={read_top_statements:function(){let t=[];for(;this.token!==this.EOF&&"}"!==this.token;){const e=this.read_top_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_top_statement:function(){let t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:return this.read_function(!1,!1,t);case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_READ_ONLY:case this.tok.T_CLASS:return this.read_class_declaration_statement(t);case this.tok.T_INTERFACE:return this.read_interface_declaration_statement(t);case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement(t);case this.tok.T_USE:return this.read_use_statement();case this.tok.T_CONST:{const t=this.node("constantstatement"),e=this.next().read_const_list();return this.expectEndOfStatement(),t(null,e)}case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:{const t=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,t(this.lexer._input.substring(this.lexer.offset))}default:return this.read_statement()}},read_inner_statements:function(){let t=[];for(;this.token!=this.EOF&&"}"!==this.token;){const e=this.read_inner_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_const_list:function(){return this.read_list((function(){this.expect(this.tok.T_STRING);const t=this.node("constant");let e=this.node("identifier");const s=this.text();return this.next(),e=e(s),this.expect("=")?t(e,this.next().read_expr()):t(e,null)}),",",!1)},read_declare_list:function(){const t=[];for(;this.token!=this.EOF&&")"!==this.token;){this.expect(this.tok.T_STRING);const e=this.node("declaredirective");let s=this.node("identifier");const i=this.text();this.next(),s=s(i);let n=null;if(this.expect("=")&&(n=this.next().read_expr()),t.push(e(s,n)),","!==this.token)break;this.next()}return t},read_inner_statement:function(){let t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:{const e=this.read_function(!1,!1);return e.attrGroups=t,e}case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_CLASS:return this.read_class_declaration_statement();case this.tok.T_INTERFACE:return this.read_interface_declaration_statement();case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement();case this.tok.T_HALT_COMPILER:{this.raiseError("__HALT_COMPILER() can only be used from the outermost scope");let t=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),t=t(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),t}default:return this.read_statement()}},read_statement:function(){switch(this.token){case"{":return this.read_code_block(!1);case this.tok.T_IF:return this.read_if();case this.tok.T_SWITCH:return this.read_switch();case this.tok.T_FOR:return this.read_for();case this.tok.T_FOREACH:return this.read_foreach();case this.tok.T_WHILE:return this.read_while();case this.tok.T_DO:return this.read_do();case this.tok.T_COMMENT:return this.read_comment();case this.tok.T_DOC_COMMENT:return this.read_doc_comment();case this.tok.T_RETURN:{const t=this.node("return");this.next();const e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e)}case this.tok.T_BREAK:case this.tok.T_CONTINUE:{const t=this.node(this.token===this.tok.T_CONTINUE?"continue":"break");this.next();const e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e)}case this.tok.T_GLOBAL:{const t=this.node("global"),e=this.next().read_list(this.read_simple_variable,",");return this.expectEndOfStatement(),t(e)}case this.tok.T_STATIC:{const t=[this.token,this.lexer.getState()],e=this.node();if(this.next().token===this.tok.T_DOUBLE_COLON){this.lexer.tokens.push(t);const s=this.next().read_expr();return this.expectEndOfStatement(s),e("expressionstatement",s)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);const s=this.read_variable_declarations();return this.expectEndOfStatement(),e("static",s)}case this.tok.T_ECHO:{const t=this.node("echo"),e=this.text(),s="<?="===e||"<%="===e,i=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),t(i,s)}case this.tok.T_INLINE_HTML:{const t=this.text();let e=this.lexer.yylloc.first_offset>0?this.lexer._input[this.lexer.yylloc.first_offset-1]:null;const s="\r"===e||"\n"===e;s&&"\n"===e&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(e="\r\n");const i=this.node("inline");return this.next(),i(t,s?e+t:t)}case this.tok.T_UNSET:{const t=this.node("unset");this.next().expect("(")&&this.next();const e=this.read_function_list(this.read_variable,",");return this.expect(")")&&this.next(),this.expect(";")&&this.next(),t(e)}case this.tok.T_DECLARE:{const t=this.node("declare"),e=[];let s;this.next().expect("(")&&this.next();const i=this.read_declare_list();if(this.expect(")")&&this.next(),":"===this.token){for(this.next();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)e.push(this.read_top_statement());0===e.length&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),s=this.ast.declare.MODE_SHORT}else if("{"===this.token){for(this.next();this.token!=this.EOF&&"}"!==this.token;)e.push(this.read_top_statement());0===e.length&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),this.expect("}")&&this.next(),s=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),s=this.ast.declare.MODE_NONE;return t(i,e,s)}case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:{const t=this.node("throw"),e=this.next().read_expr();return this.expectEndOfStatement(),t(e)}case";":return this.next(),null;case this.tok.T_STRING:{const t=this.node(),e=[this.token,this.lexer.getState()],s=this.text();let i=this.node("identifier");if(":"===this.next().token)return i=i(s),this.next(),t("label",i);i.destroy(),t.destroy(),this.lexer.tokens.push(e);const n=this.node("expressionstatement"),r=this.next().read_expr();return this.expectEndOfStatement(r),n(r)}case this.tok.T_GOTO:{const t=this.node("goto");let e=null;if(this.next().expect(this.tok.T_STRING)){e=this.node("identifier");const t=this.text();this.next(),e=e(t),this.expectEndOfStatement()}return t(e)}default:{const t=this.node("expressionstatement"),e=this.read_expr();return this.expectEndOfStatement(e),t(e)}}},read_code_block:function(t){const e=this.node("block");this.expect("{")&&this.next();const s=t?this.read_top_statements():this.read_inner_statements();return 0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.expect("}")&&this.next(),e(null,s)}},N={read_variable:function(t,e){let s;if("&"===this.token)return this.read_byref(this.read_variable.bind(this,t,e));if(this.is([this.tok.T_VARIABLE,"$"]))s=this.read_reference_variable(e);else if(this.is([this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE])){s=this.node();const t=this.read_namespace_name();if(this.token!=this.tok.T_DOUBLE_COLON&&"("!=this.token&&-1===["parentreference","selfreference"].indexOf(t.kind)){const e=t.name.toLowerCase();"true"===e?s=t.destroy(s("boolean",!0,t.name)):"false"===e?s=t.destroy(s("boolean",!1,t.name)):"null"===e?s=t.destroy(s("nullkeyword",t.name)):(s.destroy(t),s=t)}else s.destroy(t),s=t}else if(this.token===this.tok.T_STATIC){s=this.node("staticreference");const t=this.text();this.next(),s=s(t)}else this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(s=this.read_static_getter(s,e)),this.recursive_variable_chain_scan(s,t,e)},read_static_getter:function(t,e){const s=this.node("staticlookup");let i,n;return this.next().is([this.tok.T_VARIABLE,"$"])?i=this.read_reference_variable(e):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(i=this.node("identifier"),n=this.text(),this.next(),i=i(n)):"{"===this.token?(i=this.node("literal"),n=this.next().read_expr(),this.expect("}")&&this.next(),i=i("literal",n,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),i=this.node("identifier"),n=this.text(),this.next(),i=i(n)),s(t,i)},read_what:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=null,s=null;switch(this.next().token){case this.tok.T_STRING:e=this.node("identifier"),s=this.text(),this.next(),e=e(s),t&&this.token===this.tok.T_OBJECT_OPERATOR&&this.error();break;case this.tok.T_VARIABLE:e=this.node("variable"),s=this.text().substring(1),this.next(),e=e(s,!1);break;case"$":e=this.node(),this.next().expect(["$","{",this.tok.T_VARIABLE]),"{"===this.token?(s=this.next().read_expr(),this.expect("}")&&this.next(),e=e("variable",s,!0)):(s=this.read_expr(),e=e("variable",s,!1));break;case"{":e=this.node("encapsedpart"),s=this.next().read_expr(),this.expect("}")&&this.next(),e=e(s,"complex",!1);break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE,"$","{"]),e=this.node("identifier"),s=this.text(),this.next(),e=e(s)}return e},recursive_variable_chain_scan:function(t,e,s){let i,n;t:for(;this.token!=this.EOF;)switch(this.token){case"(":if(e)return t;t=this.node("call")(t,this.read_argument_list());break;case"[":case"{":{const e="["===this.token;if(i=this.node("offsetlookup"),this.next(),n=!1,s)n=this.read_encaps_var_offset(),this.expect(e?"]":"}")&&this.next();else{(e?"]"!==this.token:"}"!==this.token)?(n=this.read_expr(),this.expect(e?"]":"}")&&this.next()):this.next()}t=i(t,n);break}case this.tok.T_DOUBLE_COLON:"staticlookup"===t.kind&&"identifier"===t.offset.kind&&this.error(),i=this.node("staticlookup"),t=i(t,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:i=this.node("propertylookup"),t=i(t,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:i=this.node("nullsafepropertylookup"),t=i(t,this.read_what());break;default:break t}return t},read_encaps_var_offset:function(){let t=this.node();if(this.token===this.tok.T_STRING){const e=this.text();this.next(),t=t("identifier",e)}else if(this.token===this.tok.T_NUM_STRING){const e=this.text();this.next(),t=t("number",e,null)}else if("-"===this.token){this.next();const e=-1*this.text();this.expect(this.tok.T_NUM_STRING)&&this.next(),t=t("number",e,null)}else if(this.token===this.tok.T_VARIABLE){const e=this.text().substring(1);this.next(),t=t("variable",e,!1)}else{this.expect([this.tok.T_STRING,this.tok.T_NUM_STRING,"-",this.tok.T_VARIABLE]);const e=this.text();this.next(),t=t("identifier",e)}return t},read_reference_variable:function(t){let e,s=this.read_simple_variable();for(;this.token!=this.EOF;){const i=this.node();if("{"!=this.token||t){i.destroy();break}e=this.next().read_expr(),this.expect("}")&&this.next(),s=i("offsetlookup",s,e)}return s},read_simple_variable:function(){let t,e=this.node("variable");if(this.expect([this.tok.T_VARIABLE,"$"])&&this.token===this.tok.T_VARIABLE)t=this.text().substring(1),this.next(),e=e(t,!1);else switch("$"===this.token&&this.next(),this.token){case"{":{const t=this.next().read_expr();this.expect("}")&&this.next(),e=e(t,!0);break}case"$":e=e(this.read_simple_variable(),!1);break;case this.tok.T_VARIABLE:{t=this.text().substring(1);const s=this.node("variable");this.next(),e=e(s(t,!1),!1);break}default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),e=e(t,!1)}return e}};const g=T;function L(t){return"."!=t&&","!=t&&!isNaN(parseFloat(t))&&isFinite(t)}const b=function(t,e){this.lexer=t,this.ast=e,this.tok=t.tok,this.EOF=t.EOF,this.token=null,this.prev=null,this.debug=!1,this.version=801,this.extractDoc=!1,this.extractTokens=!1,this.suppressErrors=!1;const s=function(t){return[t,null]};this.entries={IDENTIFIER:new Map([this.tok.T_ABSTRACT,this.tok.T_ARRAY,this.tok.T_AS,this.tok.T_BREAK,this.tok.T_CALLABLE,this.tok.T_CASE,this.tok.T_CATCH,this.tok.T_CLASS,this.tok.T_CLASS_C,this.tok.T_CLONE,this.tok.T_CONST,this.tok.T_CONTINUE,this.tok.T_DECLARE,this.tok.T_DEFAULT,this.tok.T_DIR,this.tok.T_DO,this.tok.T_ECHO,this.tok.T_ELSE,this.tok.T_ELSEIF,this.tok.T_EMPTY,this.tok.T_ENDDECLARE,this.tok.T_ENDFOR,this.tok.T_ENDFOREACH,this.tok.T_ENDIF,this.tok.T_ENDSWITCH,this.tok.T_ENDWHILE,this.tok.T_ENUM,this.tok.T_EVAL,this.tok.T_EXIT,this.tok.T_EXTENDS,this.tok.T_FILE,this.tok.T_FINAL,this.tok.T_FINALLY,this.tok.T_FN,this.tok.T_FOR,this.tok.T_FOREACH,this.tok.T_FUNC_C,this.tok.T_FUNCTION,this.tok.T_GLOBAL,this.tok.T_GOTO,this.tok.T_IF,this.tok.T_IMPLEMENTS,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_INSTANCEOF,this.tok.T_INSTEADOF,this.tok.T_INTERFACE,this.tok.T_ISSET,this.tok.T_LINE,this.tok.T_LIST,this.tok.T_LOGICAL_AND,this.tok.T_LOGICAL_OR,this.tok.T_LOGICAL_XOR,this.tok.T_MATCH,this.tok.T_METHOD_C,this.tok.T_NAMESPACE,this.tok.T_NEW,this.tok.T_NS_C,this.tok.T_PRINT,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_PUBLIC,this.tok.T_READ_ONLY,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_RETURN,this.tok.T_STATIC,this.tok.T_SWITCH,this.tok.T_THROW,this.tok.T_TRAIT,this.tok.T_TRY,this.tok.T_UNSET,this.tok.T_USE,this.tok.T_VAR,this.tok.T_WHILE,this.tok.T_YIELD].map(s)),VARIABLE:new Map([this.tok.T_VARIABLE,"$","&",this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE,this.tok.T_STATIC].map(s)),SCALAR:new Map([this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(s)),T_MAGIC_CONST:new Map([this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C].map(s)),T_MEMBER_FLAGS:new Map([this.tok.T_PUBLIC,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_STATIC,this.tok.T_ABSTRACT,this.tok.T_FINAL].map(s)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(s)),EXPR:new Map(["@","-","+","!","~","(","`",this.tok.T_LIST,this.tok.T_CLONE,this.tok.T_INC,this.tok.T_DEC,this.tok.T_NEW,this.tok.T_ISSET,this.tok.T_EMPTY,this.tok.T_MATCH,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_EVAL,this.tok.T_INT_CAST,this.tok.T_DOUBLE_CAST,this.tok.T_STRING_CAST,this.tok.T_ARRAY_CAST,this.tok.T_OBJECT_CAST,this.tok.T_BOOL_CAST,this.tok.T_UNSET_CAST,this.tok.T_EXIT,this.tok.T_PRINT,this.tok.T_YIELD,this.tok.T_STATIC,this.tok.T_FUNCTION,this.tok.T_FN,this.tok.T_VARIABLE,"$",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_STRING,this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(s))}};b.prototype.getTokenName=function(t){return L(t)?t==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[t]:"'"+t+"'"},b.prototype.parse=function(t,e){this._errors=[],this.filename=e||"eval",this.currentNamespace=[""],this.extractDoc?this._docs=[]:this._docs=null,this.extractTokens?this._tokens=[]:this._tokens=null,this._docIndex=0,this._lastNode=null,this.lexer.setInput(t),this.lexer.all_tokens=this.extractTokens,this.lexer.comment_tokens=this.extractDoc,this.length=this.lexer._input.length,this.innerList=!1,this.innerListForm=!1;const s=this.node("program"),i=[];for(this.next();this.token!=this.EOF;)i.push(this.read_start());0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];const n=s(i,this._errors,this._docs,this._tokens);if(this.debug){const t=this.ast.checkNodes();if(t.length>0)throw t.forEach((function(t){t.position&&console.log("Node at line "+t.position.line+", column "+t.position.column),console.log(t.stack.join("\n"))})),new Error("Some nodes are not closed")}return n},b.prototype.raiseError=function(t,e,s,i){if(t+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){const e=new SyntaxError(t,this.filename,this.lexer.yylloc.first_line);throw e.lineNumber=this.lexer.yylloc.first_line,e.fileName=this.filename,e.columnNumber=this.lexer.yylloc.first_column,e}const n=this.ast.prepare("error",null,this)(t,i,this.lexer.yylloc.first_line,s);return this._errors.push(n),n},b.prototype.error=function(t){let e="Parse Error : syntax error",s=this.getTokenName(this.token),i="";if(this.token!==this.EOF){if(L(this.token)){let t=this.text();t.length>10&&(t=t.substring(0,7)+"..."),s="'"+t+"' ("+s+")"}e+=", unexpected "+s}return t&&!Array.isArray(t)&&((L(t)||1===t.length)&&(i=", expecting "+this.getTokenName(t)),e+=i),this.raiseError(e,i,t,s)},b.prototype.position=function(){return new g(this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.yylloc.first_offset)},b.prototype.node=function(t){if(this.extractDoc){let e=null;this._docIndex<this._docs.length&&(e=this._docs.slice(this._docIndex),this._docIndex=this._docs.length,this.debug&&(console.log(new Error("Append docs on "+t)),console.log(e)));const s=this.ast.prepare(t,e,this);return s.postBuild=function(t){if(this._docIndex<this._docs.length)if(this._lastNode){const t=this.prev[2];let e=this._docIndex;for(;e<this._docs.length&&!(this._docs[e].offset>t);e++);e>this._docIndex&&(this._lastNode.setTrailingComments(this._docs.slice(this._docIndex,e)),this._docIndex=e)}else this.token===this.EOF&&(t.setTrailingComments(this._docs.slice(this._docIndex)),this._docIndex=this._docs.length);this._lastNode=t}.bind(this),s}return this.ast.prepare(t,null,this)},b.prototype.expectEndOfStatement=function(t){if(";"===this.token)t&&";"===this.lexer.yytext&&t.includeToken(this);else if(this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF)return this.error(";"),!1;return this.next(),!0};const I=["parser.next","parser.node","parser.showlog"];b.prototype.showlog=function(){const t=(new Error).stack.split("\n");let e;for(let s=2;s<t.length;s++){e=t[s].trim();let i=!1;for(let t=0;t<I.length;t++)if(e.substring(3,3+I[t].length)===I[t]){i=!0;break}if(!i)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @--\x3e"+e),this},b.prototype.expect=function(t){if(Array.isArray(t)){if(-1===t.indexOf(this.token))return this.error(t),!1}else if(this.token!=t)return this.error(t),!1;return!0},b.prototype.text=function(){return this.lexer.yytext},b.prototype.next=function(){if(";"===this.token&&";"!==this.lexer.yytext||(this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset]),this.lex(),this.debug&&this.showlog(),this.extractDoc)for(;this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT;)this.token===this.tok.T_COMMENT?this._docs.push(this.read_comment()):this._docs.push(this.read_doc_comment());return this},b.prototype.peek=function(){const t=this.lexer.getState(),e=this.lexer.lex();return this.lexer.setState(t),e},b.prototype.lex=function(){if(this.extractTokens)do{if(this.token=this.lexer.lex()||this.EOF,this.token===this.EOF)return this;let t=this.lexer.yytext;if(t=Object.prototype.hasOwnProperty.call(this.lexer.engine.tokens.values,this.token)?[this.lexer.engine.tokens.values[this.token],t,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset]:[null,t,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset],this._tokens.push(t),this.token===this.tok.T_CLOSE_TAG)return this.token=";",this;if(this.token===this.tok.T_OPEN_TAG_WITH_ECHO)return this.token=this.tok.T_ECHO,this}while(this.token===this.tok.T_WHITESPACE||!this.extractDoc&&(this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT)||this.token===this.tok.T_OPEN_TAG);else this.token=this.lexer.lex()||this.EOF;return this},b.prototype.is=function(t){return Array.isArray(t)?-1!==t.indexOf(this.token):this.entries[t].has(this.token)},[{read_array:function(){let t=null,e=!1;const s=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),t=")"):(e=!0,t="]");let i=[];return this.next().token!==t&&(i=this.read_array_pair_list(e)),this.expect(t),this.next(),s(e,i)},read_array_pair_list:function(t){const e=this;return this.read_list((function(){return e.read_array_pair(t)}),",",!0)},read_array_pair:function(t){if(!t&&")"===this.token||t&&"]"===this.token)return;if(","===this.token)return this.node("noop")();const e=this.node("entry");let s=null,i=null,n=!1,r=!1;if("&"===this.token)this.next(),n=!0,i=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),"&"===this.token&&this.error(),r=!0,i=this.read_expr();else{const t=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),s=t,"&"===this.token?(this.next(),n=!0,i=this.read_variable(!0,!1)):i=this.read_expr()):i=t}return e(s,i,n,r)}},{read_class_declaration_statement:function(t){const e=this.node("class"),s=this.read_class_modifiers();if(this.token!==this.tok.T_CLASS)return this.error(this.tok.T_CLASS),this.next(),null;this.next().expect(this.tok.T_STRING);let i=this.node("identifier");const n=this.text();this.next(),i=i(n);const r=this.read_extends_from(),o=this.read_implements_list();this.expect("{");const h=e(i,r,o,this.next().read_class_body(!0,!1),s);return t&&(h.attrGroups=t),h},read_class_modifiers:function(){const t=this.read_class_modifier({readonly:0,final_or_abstract:0});return[0,0,t.final_or_abstract,t.readonly]},read_class_modifier:function(t){return this.token===this.tok.T_READ_ONLY?(this.next(),t.readonly=1,t=this.read_class_modifier(t)):0===t.final_or_abstract&&this.token===this.tok.T_ABSTRACT?(this.next(),t.final_or_abstract=1,t=this.read_class_modifier(t)):0===t.final_or_abstract&&this.token===this.tok.T_FINAL&&(this.next(),t.final_or_abstract=2,t=this.read_class_modifier(t)),t},read_class_body:function(t,e){let s=[],i=[];for(;this.token!==this.EOF&&"}"!==this.token;){if(this.token===this.tok.T_COMMENT){s.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){s.push(this.read_doc_comment());continue}if(this.token===this.tok.T_USE){s=s.concat(this.read_trait_use_statement());continue}if(e&&this.token===this.tok.T_CASE){const t=this.read_enum_case();this.expect(";")&&this.next(),s=s.concat(t);continue}this.token===this.tok.T_ATTRIBUTE&&(i=this.read_attr_list());const n=this.position(),r=this.read_member_flags(!1);if(this.token!==this.tok.T_CONST)if(t&&this.token===this.tok.T_VAR&&(this.next().expect(this.tok.T_VARIABLE),r[0]=null,r[1]=0),this.token===this.tok.T_FUNCTION)s.push(this.read_function(!1,r,i,n)),i=[];else if(t&&(this.token===this.tok.T_VARIABLE||this.version>=801&&this.token===this.tok.T_READ_ONLY||this.version>=704&&("?"===this.token||this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE||this.token===this.tok.T_NAMESPACE||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING))){const t=this.read_variable_list(r,i);i=[],this.expect(";"),this.next(),s=s.concat(t)}else this.error([this.tok.T_CONST,...t?[this.tok.T_VARIABLE]:[],...e?[this.tok.T_CASE]:[],this.tok.T_FUNCTION]),this.next();else{const t=this.read_constant_list(r,i);this.expect(";")&&this.next(),s=s.concat(t)}}return this.expect("}"),this.next(),s},read_variable_list:function(t,e){const s=this.node("propertystatement"),i=this.read_list((function(){const t=this.node("property");let s=!1;this.token===this.tok.T_READ_ONLY&&(s=!0,this.next());const[i,n]=this.read_optional_type();this.expect(this.tok.T_VARIABLE);let r=this.node("identifier");const o=this.text().substring(1);return this.next(),r=r(o),";"===this.token||","===this.token?t(r,null,s,i,n,e||[]):"="===this.token?t(r,this.next().read_expr(),s,i,n,e||[]):(this.expect([",",";","="]),t(r,null,i,n,e||[]))}),",");return s(null,i,t)},read_constant_list:function(t,e){this.expect(this.tok.T_CONST)&&this.next();const[s,i]=this.version>=830?this.read_optional_type():[!1,null],n=this.node("classconstant"),r=this.read_list((function(){const t=this.node("constant");let e=null,s=null;if(this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){e=this.node("identifier");const t=this.text();this.next(),e=e(t)}else this.expect("IDENTIFIER");return this.expect("=")&&(s=this.next().read_expr()),t(e,s)}),",");return n(null,r,t,s,i,e||[])},read_member_flags:function(t){const e=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){let s=0,i=0;do{switch(this.token){case this.tok.T_PUBLIC:s=0,i=0;break;case this.tok.T_PROTECTED:s=0,i=1;break;case this.tok.T_PRIVATE:s=0,i=2;break;case this.tok.T_STATIC:s=1,i=1;break;case this.tok.T_ABSTRACT:s=2,i=1;break;case this.tok.T_FINAL:s=2,i=2}t&&(0===s&&2===i?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),i=-1):2===s&&1===i&&(this.error(),i=-1)),-1!==e[s]?this.error():-1!==i&&(e[s]=i)}while(this.next().is("T_MEMBER_FLAGS"))}return-1===e[1]&&(e[1]=0),-1===e[2]&&(e[2]=0),e},read_optional_type:function(){const t="?"===this.token;t&&this.next();let e=this.read_types();if(t&&!e&&this.raiseError("Expecting a type definition combined with nullable operator"),!t&&!e)return[!1,null];if("|"===this.token){e=[e];do{this.next();const t=this.read_type();if(!t){this.raiseError("Expecting a type definition");break}e.push(t)}while("|"===this.token)}return[t,e]},read_interface_declaration_statement:function(t){const e=this.node("interface");if(this.token!==this.tok.T_INTERFACE)return this.error(this.tok.T_INTERFACE),this.next(),null;this.next().expect(this.tok.T_STRING);let s=this.node("identifier");const i=this.text();this.next(),s=s(i);const n=this.read_interface_extends_list();this.expect("{");return e(s,n,this.next().read_interface_body(),t||[])},read_interface_body:function(){let t=[],e=[];for(;this.token!==this.EOF&&"}"!==this.token;){if(this.token===this.tok.T_COMMENT){t.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){t.push(this.read_doc_comment());continue}const s=this.position();e=this.read_attr_list();const i=this.read_member_flags(!0);if(this.token===this.tok.T_CONST){const s=this.read_constant_list(i,e);this.expect(";")&&this.next(),t=t.concat(s),e=[]}else if(this.token===this.tok.T_FUNCTION){const n=this.read_function_declaration(2,i,e,s);n.parseFlags(i),t.push(n),this.expect(";")&&this.next(),e=[]}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}return this.expect("}")&&this.next(),t},read_trait_declaration_statement:function(){const t=this.node("trait");if(this.token!==this.tok.T_TRAIT)return this.error(this.tok.T_TRAIT),this.next(),null;this.next().expect(this.tok.T_STRING);let e=this.node("identifier");const s=this.text();this.next(),e=e(s),this.expect("{");return t(e,this.next().read_class_body(!0,!1))},read_trait_use_statement:function(){const t=this.node("traituse");this.expect(this.tok.T_USE)&&this.next();const e=[this.read_namespace_name()];let s=null;for(;","===this.token;)e.push(this.next().read_namespace_name());if("{"===this.token){for(s=[];this.next().token!==this.EOF&&"}"!==this.token;)s.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return t(e,s)},read_trait_use_alias:function(){const t=this.node();let e,s=null;if(this.is("IDENTIFIER")){e=this.node("identifier");const t=this.text();this.next(),e=e(t)}else if(e=this.read_namespace_name(),this.token===this.tok.T_DOUBLE_COLON)if(this.next(),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){s=e,e=this.node("identifier");const t=this.text();this.next(),e=e(t)}else this.expect(this.tok.T_STRING);else e=e.name;if(this.token===this.tok.T_INSTEADOF)return t("traitprecedence",s,e,this.next().read_name_list());if(this.token===this.tok.T_AS){let i=null,n=null;if(this.next().is("T_MEMBER_FLAGS")&&(i=this.read_member_flags()),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){n=this.node("identifier");const t=this.text();this.next(),n=n(t)}else!1===i&&this.expect(this.tok.T_STRING);return t("traitalias",s,e,n,i)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),t("traitalias",s,e,null,null)}},{read_comment:function(){const t=this.text();let e=this.ast.prepare("/*"===t.substring(0,2)?"commentblock":"commentline",null,this);const s=this.lexer.yylloc.first_offset,i=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),e=e(t),e.offset=s,this.prev=i,e},read_doc_comment:function(){let t=this.ast.prepare("commentblock",null,this);const e=this.lexer.yylloc.first_offset,s=this.text(),i=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),t=t(s),t.offset=e,this.prev=i,t}},x,{read_enum_declaration_statement:function(t){const e=this.node("enum");if(!this.expect(this.tok.T_ENUM))return null;this.next().expect(this.tok.T_STRING);let s=this.node("identifier");const i=this.text();this.next(),s=s(i);const n=this.read_enum_value_type(),r=this.read_implements_list();this.expect("{");const o=e(s,n,r,this.next().read_class_body(!1,!0));return t&&(o.attrGroups=t),o},read_enum_value_type:function(){return":"===this.token?this.next().read_namespace_name():null},read_enum_case:function(){this.expect(this.tok.T_CASE);const t=this.node("enumcase");let e=this.node("identifier");const s=this.next().text();this.next(),e=e(s);const i="="===this.token?this.next().read_expr():null;return this.expect(";"),t(e,i)}},E,{read_if:function(){const t=this.node("if"),e=this.next().read_if_expr();let s=null,i=null,n=!1;if(":"===this.token){n=!0,this.next(),s=this.node("block");const t=[];for(;this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){i=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){i=this.read_else_short();break}t.push(this.read_inner_statement())}s=s(null,t),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else s=this.read_statement(),this.token===this.tok.T_ELSEIF?i=this.read_if():this.token===this.tok.T_ELSE&&(i=this.next().read_statement());return t(e,s,i,n)},read_if_expr:function(){this.expect("(")&&this.next();const t=this.read_expr();return this.expect(")")&&this.next(),t},read_elseif_short:function(){let t=null;const e=this.node("if"),s=this.next().read_if_expr();this.expect(":")&&this.next();const i=this.node("block"),n=[];for(;this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){t=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){t=this.read_else_short();break}n.push(this.read_inner_statement())}return e(s,i(null,n),t,!0)},read_else_short:function(){this.next().expect(":")&&this.next();const t=this.node("block"),e=[];for(;this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)e.push(this.read_inner_statement());return t(null,e)}},{read_while:function(){const t=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();let e=null,s=null,i=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(i=!0,s=this.read_short_form(this.tok.T_ENDWHILE)):s=this.read_statement(),t(e,s,i)},read_do:function(){const t=this.node("do");this.expect(this.tok.T_DO)&&this.next();let e=null,s=null;return s=this.read_statement(),this.expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),t(e,s)},read_for:function(){const t=this.node("for");this.expect(this.tok.T_FOR)&&this.next();let e=[],s=[],i=[],n=null,r=!1;return this.expect("(")&&this.next(),";"!==this.token?(e=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),";"!==this.token?(s=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),")"!==this.token?(i=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),":"===this.token?(r=!0,n=this.read_short_form(this.tok.T_ENDFOR)):n=this.read_statement(),t(e,s,i,n,r)},read_foreach:function(){const t=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();let e=null,s=null,i=null,n=null,r=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),i=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(s=i,i=this.next().read_foreach_variable())),s&&"list"===s.kind&&this.raiseError("Fatal Error : Cannot use list as key element"),this.expect(")")&&this.next(),":"===this.token?(r=!0,n=this.read_short_form(this.tok.T_ENDFOREACH)):n=this.read_statement(),t(e,s,i,n,r)},read_foreach_variable:function(){if(this.token===this.tok.T_LIST||"["===this.token){const t="["===this.token,e=this.node("list");this.next(),!t&&this.expect("(")&&this.next();const s=this.read_array_pair_list(t);return this.expect(t?"]":")")&&this.next(),e(s,t)}return this.read_variable(!1,!1)}},{read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}},{read_namespace:function(){const t=this.node("namespace");let e,s;return this.expect(this.tok.T_NAMESPACE)&&this.next(),s="{"===this.token?{name:[""]}:this.read_namespace_name(),this.currentNamespace=s,";"===this.token?(this.currentNamespace=s,e=this.next().read_top_statements(),this.expect(this.EOF),t(s.name,e,!1)):"{"===this.token?(this.currentNamespace=s,e=this.next().read_top_statements(),this.expect("}")&&this.next(),0===e.length&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),t(s.name,e,!0)):(this.error(["{",";"]),this.currentNamespace=s,e=this.read_top_statements(),this.expect(this.EOF),t(s,e,!1))},read_namespace_name:function(t){const e=this.node();let s,i=this.text();switch(this.token){case this.tok.T_NAME_RELATIVE:s=this.ast.name.RELATIVE_NAME,i=i.replace(/^namespace\\/,"");break;case this.tok.T_NAME_QUALIFIED:s=this.ast.name.QUALIFIED_NAME;break;case this.tok.T_NAME_FULLY_QUALIFIED:s=this.ast.name.FULL_QUALIFIED_NAME;break;default:if(s=this.ast.name.UNQUALIFIED_NAME,!this.expect(this.tok.T_STRING))return e("name","",this.ast.name.FULL_QUALIFIED_NAME)}if(this.next(),t||"("!==this.token){if("parent"===i.toLowerCase())return e("parentreference",i);if("self"===i.toLowerCase())return e("selfreference",i)}return e("name",i,s)},read_use_statement:function(){let t=this.node("usegroup"),e=[],s=null;this.expect(this.tok.T_USE)&&this.next();const i=this.read_use_type();return e.push(this.read_use_declaration(!1)),","===this.token?e=e.concat(this.next().read_use_declarations(!1)):"{"===this.token&&(s=e[0].name,e=this.next().read_use_declarations(null===i),this.expect("}")&&this.next()),t=t(s,i,e),this.expect(";")&&this.next(),t},read_class_name_reference:function(){return this.read_variable(!0,!1)},read_use_declaration:function(t){const e=this.node("useitem");let s=null;t&&(s=this.read_use_type());const i=this.read_namespace_name(),n=this.read_use_alias();return e(i.name,n,s)},read_use_declarations:function(t){const e=[this.read_use_declaration(t)];for(;","===this.token;){if(this.next(),t){if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_FUNCTION&&this.token!==this.tok.T_CONST&&this.token!==this.tok.T_STRING)break}else if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_STRING&&this.token!==this.tok.T_NS_SEPARATOR)break;e.push(this.read_use_declaration(t))}return e},read_use_alias:function(){let t=null;if(this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)){const e=this.node("identifier"),s=this.text();this.next(),t=e(s)}return t},read_use_type:function(){return this.token===this.tok.T_FUNCTION?(this.next(),this.ast.useitem.TYPE_FUNCTION):this.token===this.tok.T_CONST?(this.next(),this.ast.useitem.TYPE_CONST):null}},y,A,{read_switch:function(){const t=this.node("switch");this.expect(this.tok.T_SWITCH)&&this.next(),this.expect("(")&&this.next();const e=this.read_expr();this.expect(")")&&this.next();const s=":"===this.token;return t(e,this.read_switch_case_list(),s)},read_switch_case_list:function(){let t=null;const e=this.node("block"),s=[];for("{"===this.token?t="}":":"===this.token?t=this.tok.T_ENDSWITCH:this.expect(["{",":"]),this.next(),";"===this.token&&this.next();this.token!==this.EOF&&this.token!==t;)s.push(this.read_case_list(t));return 0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.expect(t)&&this.next(),t===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),e(null,s)},read_case_list:function(t){const e=this.node("case");let s=null;this.token===this.tok.T_CASE?s=this.next().read_expr():this.token===this.tok.T_DEFAULT?this.next():this.expect([this.tok.T_CASE,this.tok.T_DEFAULT]),this.expect([":",";"])&&this.next();const i=this.node("block"),n=[];for(;this.token!==this.EOF&&this.token!==t&&this.token!==this.tok.T_CASE&&this.token!==this.tok.T_DEFAULT;)n.push(this.read_inner_statement());return e(s,i(null,n))}},{read_try:function(){this.expect(this.tok.T_TRY);const t=this.node("try");let e=null;const s=[],i=this.next().read_statement();for(;this.token===this.tok.T_CATCH;){const t=this.node("catch");this.next().expect("(")&&this.next();const e=this.read_list(this.read_namespace_name,"|",!1);let i=null;(this.version<800||this.token===this.tok.T_VARIABLE)&&(i=this.read_variable(!0,!1)),this.expect(")"),s.push(t(this.next().read_statement(),e,i))}return this.token===this.tok.T_FINALLY&&(e=this.next().read_statement()),t(i,s,e)}},{read_short_form:function(t){const e=this.node("block"),s=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==t;)s.push(this.read_inner_statement());return 0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.expect(t)&&this.next(),this.expectEndOfStatement(),e(null,s)},read_function_list:function(t,e){const s=[];do{if(this.token==e&&this.version>=703&&s.length>0){s.push(this.node("noop")());break}if(s.push(t.apply(this,[])),this.token!=e)break;if(")"==this.next().token&&this.version>=703)break}while(this.token!=this.EOF);return s},read_list:function(t,e,s){const i=[];if(this.token==e&&(s&&i.push("function"==typeof t?this.node("noop")():null),this.next()),"function"==typeof t)do{const s=t.apply(this,[]);if(s&&i.push(s),this.token!=e)break}while(this.next().token!=this.EOF);else{if(!this.expect(t))return[];for(i.push(this.text());this.next().token!=this.EOF&&this.token==e&&this.next().token==t;)i.push(this.text())}return i},read_name_list:function(){return this.read_list(this.read_namespace_name,",",!1)},read_byref:function(t){let e=this.node("byref");this.next(),e=e(null);const s=t();return s&&(this.ast.swapLocations(s,e,s,this),s.byref=!0),s},read_variable_declarations:function(){return this.read_list((function(){const t=this.node("staticvariable");let e=this.node("variable");if(this.expect(this.tok.T_VARIABLE)){const t=this.text().substring(1);this.next(),e=e(t,!1)}else e=e("#ERR",!1);return"="===this.token?t(e,this.next().read_expr()):e}),",")},read_extends_from:function(){return this.token===this.tok.T_EXTENDS?this.next().read_namespace_name():null},read_interface_extends_list:function(){return this.token===this.tok.T_EXTENDS?this.next().read_name_list():null},read_implements_list:function(){return this.token===this.tok.T_IMPLEMENTS?this.next().read_name_list():null}},N].forEach((function(t){for(const e in t){if(Object.prototype.hasOwnProperty.call(b.prototype,e))throw new Error("Function "+e+" is already defined - collision");b.prototype[e]=t[e]}}));var C=b;const S={T_HALT_COMPILER:101,T_USE:102,T_ENCAPSED_AND_WHITESPACE:103,T_OBJECT_OPERATOR:104,T_STRING:105,T_DOLLAR_OPEN_CURLY_BRACES:106,T_STRING_VARNAME:107,T_CURLY_OPEN:108,T_NUM_STRING:109,T_ISSET:110,T_EMPTY:111,T_INCLUDE:112,T_INCLUDE_ONCE:113,T_EVAL:114,T_REQUIRE:115,T_REQUIRE_ONCE:116,T_NAMESPACE:117,T_NS_SEPARATOR:118,T_AS:119,T_IF:120,T_ENDIF:121,T_WHILE:122,T_DO:123,T_FOR:124,T_SWITCH:125,T_BREAK:126,T_CONTINUE:127,T_RETURN:128,T_GLOBAL:129,T_STATIC:130,T_ECHO:131,T_INLINE_HTML:132,T_UNSET:133,T_FOREACH:134,T_DECLARE:135,T_TRY:136,T_THROW:137,T_GOTO:138,T_FINALLY:139,T_CATCH:140,T_ENDDECLARE:141,T_LIST:142,T_CLONE:143,T_PLUS_EQUAL:144,T_MINUS_EQUAL:145,T_MUL_EQUAL:146,T_DIV_EQUAL:147,T_CONCAT_EQUAL:148,T_MOD_EQUAL:149,T_AND_EQUAL:150,T_OR_EQUAL:151,T_XOR_EQUAL:152,T_SL_EQUAL:153,T_SR_EQUAL:154,T_INC:155,T_DEC:156,T_BOOLEAN_OR:157,T_BOOLEAN_AND:158,T_LOGICAL_OR:159,T_LOGICAL_AND:160,T_LOGICAL_XOR:161,T_SL:162,T_SR:163,T_IS_IDENTICAL:164,T_IS_NOT_IDENTICAL:165,T_IS_EQUAL:166,T_IS_NOT_EQUAL:167,T_IS_SMALLER_OR_EQUAL:168,T_IS_GREATER_OR_EQUAL:169,T_INSTANCEOF:170,T_INT_CAST:171,T_DOUBLE_CAST:172,T_STRING_CAST:173,T_ARRAY_CAST:174,T_OBJECT_CAST:175,T_BOOL_CAST:176,T_UNSET_CAST:177,T_EXIT:178,T_PRINT:179,T_YIELD:180,T_YIELD_FROM:181,T_FUNCTION:182,T_DOUBLE_ARROW:183,T_DOUBLE_COLON:184,T_ARRAY:185,T_CALLABLE:186,T_CLASS:187,T_ABSTRACT:188,T_TRAIT:189,T_FINAL:190,T_EXTENDS:191,T_INTERFACE:192,T_IMPLEMENTS:193,T_VAR:194,T_PUBLIC:195,T_PROTECTED:196,T_PRIVATE:197,T_CONST:198,T_NEW:199,T_INSTEADOF:200,T_ELSEIF:201,T_ELSE:202,T_ENDSWITCH:203,T_CASE:204,T_DEFAULT:205,T_ENDFOR:206,T_ENDFOREACH:207,T_ENDWHILE:208,T_CONSTANT_ENCAPSED_STRING:209,T_LNUMBER:210,T_DNUMBER:211,T_LINE:212,T_FILE:213,T_DIR:214,T_TRAIT_C:215,T_METHOD_C:216,T_FUNC_C:217,T_NS_C:218,T_START_HEREDOC:219,T_END_HEREDOC:220,T_CLASS_C:221,T_VARIABLE:222,T_OPEN_TAG:223,T_OPEN_TAG_WITH_ECHO:224,T_CLOSE_TAG:225,T_WHITESPACE:226,T_COMMENT:227,T_DOC_COMMENT:228,T_ELLIPSIS:229,T_COALESCE:230,T_POW:231,T_POW_EQUAL:232,T_SPACESHIP:233,T_COALESCE_EQUAL:234,T_FN:235,T_NULLSAFE_OBJECT_OPERATOR:236,T_MATCH:237,T_ATTRIBUTE:238,T_ENUM:239,T_READ_ONLY:240,T_NAME_RELATIVE:241,T_NAME_QUALIFIED:242,T_NAME_FULLY_QUALIFIED:243},O={values:Object.entries(S).reduce(((t,e)=>{let[s,i]=e;return{...t,[i]:s}}),{}),names:S};var R=Object.freeze(O);var v=function(t,e,s){this.source=t,this.start=e,this.end=s};const w=function(t,e,s){this.kind=t,e&&(this.leadingComments=e),s&&(this.loc=s)};w.prototype.setTrailingComments=function(t){this.trailingComments=t},w.prototype.destroy=function(t){if(!t)throw new Error("Node already initialized, you must swap with another node");return this.leadingComments&&(t.leadingComments?t.leadingComments=Array.concat(this.leadingComments,t.leadingComments):t.leadingComments=this.leadingComments),this.trailingComments&&(t.trailingComments?t.trailingComments=Array.concat(this.trailingComments,t.trailingComments):t.trailingComments=this.trailingComments),t},w.prototype.includeToken=function(t){return this.loc&&(this.loc.end&&(this.loc.end.line=t.lexer.yylloc.last_line,this.loc.end.column=t.lexer.yylloc.last_column,this.loc.end.offset=t.lexer.offset),t.ast.withSource&&(this.loc.source=t.lexer._input.substring(this.loc.start.offset,t.lexer.offset))),this},w.extends=function(t,e){return e.prototype=Object.create(this.prototype),e.extends=this.extends,e.prototype.constructor=e,e.kind=t,e};var D=w;const U=D,P="expression";var F=U.extends(P,(function(t,e,s){U.apply(this,[t||P,e,s])}));const M=F,B="array";var H=M.extends(B,(function(t,e,s,i){M.apply(this,[B,s,i]),this.items=e,this.shortForm=t}));const G=F,V="arrowfunc";var Q=G.extends(V,(function(t,e,s,i,n,r,o,h){G.apply(this,[V,o,h]),this.arguments=t,this.byref=e,this.body=s,this.type=i,this.nullable=n,this.isStatic=r||!1}));const Y=F,W="assign";var $=Y.extends(W,(function(t,e,s,i,n){Y.apply(this,[W,i,n]),this.left=t,this.right=e,this.operator=s}));const z=F,K="assignref";var X=z.extends(K,(function(t,e,s,i){z.apply(this,[K,s,i]),this.left=t,this.right=e}));const j=D,q="attribute";var J=j.extends(q,(function(t,e,s,i){j.apply(this,[q,s,i]),this.name=t,this.args=e}));const Z=D,tt="attrgroup";var et=Z.extends(tt,(function(t,e,s){Z.apply(this,[tt,e,s]),this.attrs=t||[]}));const st=F,it="operation";var nt=st.extends(it,(function(t,e,s){st.apply(this,[t||it,e,s])}));const rt=nt;var ot=rt.extends("bin",(function(t,e,s,i,n){rt.apply(this,["bin",i,n]),this.type=t,this.left=e,this.right=s}));const ht=D,at="statement";var ct=ht.extends(at,(function(t,e,s){ht.apply(this,[t||at,e,s])}));const lt=ct,ut="block";var _t=lt.extends(ut,(function(t,e,s,i){lt.apply(this,[t||ut,s,i]),this.children=e.filter(Boolean)}));const pt=F,dt="literal";var ft=pt.extends(dt,(function(t,e,s,i,n){pt.apply(this,[t||dt,i,n]),this.value=e,s&&(this.raw=s)}));const kt=ft,Tt="boolean";var xt=kt.extends(Tt,(function(t,e,s,i){kt.apply(this,[Tt,t,e,s,i])}));const Et=ct,mt="break";var yt=Et.extends(mt,(function(t,e,s){Et.apply(this,[mt,e,s]),this.level=t}));const At=F,Nt="byref";var gt=At.extends(Nt,(function(t,e,s){At.apply(this,[Nt,e,s]),this.what=t}));const Lt=F,bt="call";var It=Lt.extends(bt,(function(t,e,s,i){Lt.apply(this,[bt,s,i]),this.what=t,this.arguments=e}));const Ct=ct,St="case";var Ot=Ct.extends(St,(function(t,e,s,i){Ct.apply(this,[St,s,i]),this.test=t,this.body=e}));const Rt=nt,vt="cast";var wt=Rt.extends(vt,(function(t,e,s,i,n){Rt.apply(this,[vt,i,n]),this.type=t,this.raw=e,this.expr=s}));const Dt=ct,Ut="catch";var Pt=Dt.extends(Ut,(function(t,e,s,i,n){Dt.apply(this,[Ut,i,n]),this.body=t,this.what=e,this.variable=s}));const Ft=ct,Mt="declaration",Bt=Ft.extends(Mt,(function(t,e,s,i){Ft.apply(this,[t||Mt,s,i]),this.name=e}));Bt.prototype.parseFlags=function(t){this.isAbstract=1===t[2],this.isFinal=2===t[2],this.isReadonly=1===t[3],"class"!==this.kind&&(-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1])};var Ht=Bt;const Gt=Ht,Vt="class";var Qt=Gt.extends(Vt,(function(t,e,s,i,n,r,o){Gt.apply(this,[Vt,t,r,o]),this.isAnonymous=!t,this.extends=e,this.implements=s,this.body=i,this.attrGroups=[],this.parseFlags(n)}));const Yt=ct,Wt="constantstatement";var $t=Yt.extends(Wt,(function(t,e,s,i){Yt.apply(this,[t||Wt,s,i]),this.constants=e}));const zt=$t,Kt="classconstant",Xt=zt.extends(Kt,(function(t,e,s,i,n,r,o,h){zt.apply(this,[t||Kt,e,o,h]),this.parseFlags(s),this.nullable=i,this.type=n,this.attrGroups=r}));Xt.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.final=2===t[2]};var jt=Xt;const qt=F,Jt="clone";var Zt=qt.extends(Jt,(function(t,e,s){qt.apply(this,[Jt,e,s]),this.what=t}));const te=F,ee="closure";var se=te.extends(ee,(function(t,e,s,i,n,r,o,h){te.apply(this,[ee,o,h]),this.uses=s,this.arguments=t,this.byref=e,this.type=i,this.nullable=n,this.isStatic=r||!1,this.body=null,this.attrGroups=[]}));const ie=D;var ne=ie.extends("comment",(function(t,e,s,i){ie.apply(this,[t,s,i]),this.value=e}));const re=ne,oe="commentblock";var he=re.extends(oe,(function(t,e,s){re.apply(this,[oe,t,e,s])}));const ae=ne,ce="commentline";var le=ae.extends(ce,(function(t,e,s){ae.apply(this,[ce,t,e,s])}));const ue=D,_e="constant";var pe=ue.extends(_e,(function(t,e,s,i){ue.apply(this,[_e,s,i]),this.name=t,this.value=e}));const de=ct,fe="continue";var ke=de.extends(fe,(function(t,e,s){de.apply(this,[fe,e,s]),this.level=t}));const Te=_t,xe="declare",Ee=Te.extends(xe,(function(t,e,s,i,n){Te.apply(this,[xe,e,i,n]),this.directives=t,this.mode=s}));Ee.MODE_SHORT="short",Ee.MODE_BLOCK="block",Ee.MODE_NONE="none";var me=Ee;const ye=D,Ae="declaredirective";var Ne=ye.extends(Ae,(function(t,e,s,i){ye.apply(this,[Ae,s,i]),this.key=t,this.value=e}));const ge=ct;var Le=ge.extends("do",(function(t,e,s,i){ge.apply(this,["do",s,i]),this.test=t,this.body=e}));const be=ct,Ie="echo";var Ce=be.extends(Ie,(function(t,e,s,i){be.apply(this,[Ie,s,i]),this.shortForm=e,this.expressions=t}));const Se=F,Oe="empty";var Re=Se.extends(Oe,(function(t,e,s){Se.apply(this,[Oe,e,s]),this.expression=t}));const ve=ft,we="encapsed",De=ve.extends(we,(function(t,e,s,i,n){ve.apply(this,[we,t,e,i,n]),this.type=s}));De.TYPE_STRING="string",De.TYPE_SHELL="shell",De.TYPE_HEREDOC="heredoc",De.TYPE_OFFSET="offset";var Ue=De;const Pe=F,Fe="encapsedpart";var Me=Pe.extends(Fe,(function(t,e,s,i,n){Pe.apply(this,[Fe,i,n]),this.expression=t,this.syntax=e,this.curly=s}));const Be=F,He="entry";var Ge=Be.extends(He,(function(t,e,s,i,n,r){Be.apply(this,[He,n,r]),this.key=t,this.value=e,this.byRef=s,this.unpack=i}));const Ve=Ht,Qe="enum";var Ye=Ve.extends(Qe,(function(t,e,s,i,n,r){Ve.apply(this,[Qe,t,n,r]),this.valueType=e,this.implements=s,this.body=i,this.attrGroups=[]}));const We=D,$e="enumcase";var ze=We.extends($e,(function(t,e,s,i){We.apply(this,[$e,s,i]),this.name=t,this.value=e}));const Ke=D,Xe="error";var je=Ke.extends(Xe,(function(t,e,s,i,n,r){Ke.apply(this,[Xe,n,r]),this.message=t,this.token=e,this.line=s,this.expected=i}));const qe=F,Je="eval";var Ze=qe.extends(Je,(function(t,e,s){qe.apply(this,[Je,e,s]),this.source=t}));const ts=F,es="exit";var ss=ts.extends(es,(function(t,e,s,i){ts.apply(this,[es,s,i]),this.expression=t,this.useDie=e}));const is=ct,ns="expressionstatement";var rs=is.extends(ns,(function(t,e,s){is.apply(this,[ns,e,s]),this.expression=t}));const os=ct;var hs=os.extends("for",(function(t,e,s,i,n,r,o){os.apply(this,["for",r,o]),this.init=t,this.test=e,this.increment=s,this.shortForm=n,this.body=i}));const as=ct,cs="foreach";var ls=as.extends(cs,(function(t,e,s,i,n,r,o){as.apply(this,[cs,r,o]),this.source=t,this.key=e,this.value=s,this.shortForm=n,this.body=i}));const us=Ht,_s="function";var ps=us.extends(_s,(function(t,e,s,i,n,r,o){us.apply(this,[_s,t,r,o]),this.arguments=e,this.byref=s,this.type=i,this.nullable=n,this.body=null,this.attrGroups=[]}));const ds=ct,fs="global";var ks=ds.extends(fs,(function(t,e,s){ds.apply(this,[fs,e,s]),this.items=t}));const Ts=ct,xs="goto";var Es=Ts.extends(xs,(function(t,e,s){Ts.apply(this,[xs,e,s]),this.label=t}));const ms=ct,ys="halt";var As=ms.extends(ys,(function(t,e,s){ms.apply(this,[ys,e,s]),this.after=t}));const Ns=D,gs="identifier",Ls=Ns.extends(gs,(function(t,e,s){Ns.apply(this,[gs,e,s]),this.name=t}));var bs=Ls;const Is=ct;var Cs=Is.extends("if",(function(t,e,s,i,n,r){Is.apply(this,["if",n,r]),this.test=t,this.body=e,this.alternate=s,this.shortForm=i}));const Ss=F,Os="include";var Rs=Ss.extends(Os,(function(t,e,s,i,n){Ss.apply(this,[Os,i,n]),this.once=t,this.require=e,this.target=s}));const vs=ft,ws="inline";var Ds=vs.extends(ws,(function(t,e,s,i){vs.apply(this,[ws,t,e,s,i])}));const Us=Ht,Ps="interface";var Fs=Us.extends(Ps,(function(t,e,s,i,n,r){Us.apply(this,[Ps,t,n,r]),this.extends=e,this.body=s,this.attrGroups=i}));const Ms=Ht,Bs="intersectiontype";var Hs=Ms.extends(Bs,(function(t,e,s){Ms.apply(this,[Bs,null,e,s]),this.types=t}));const Gs=F,Vs="isset";var Qs=Gs.extends(Vs,(function(t,e,s){Gs.apply(this,[Vs,e,s]),this.variables=t}));const Ys=ct,Ws="label";var $s=Ys.extends(Ws,(function(t,e,s){Ys.apply(this,[Ws,e,s]),this.name=t}));const zs=F,Ks="list";var Xs=zs.extends(Ks,(function(t,e,s,i){zs.apply(this,[Ks,s,i]),this.items=t,this.shortForm=e}));const js=F,qs="lookup";var Js=js.extends(qs,(function(t,e,s,i,n){js.apply(this,[t||qs,i,n]),this.what=e,this.offset=s}));const Zs=ft,ti="magic";var ei=Zs.extends(ti,(function(t,e,s,i){Zs.apply(this,[ti,t,e,s,i])}));const si=F,ii="match";var ni=si.extends(ii,(function(t,e,s,i){si.apply(this,[ii,s,i]),this.cond=t,this.arms=e}));const ri=F,oi="matcharm";var hi=ri.extends(oi,(function(t,e,s,i){ri.apply(this,[oi,s,i]),this.conds=t,this.body=e}));const ai=ps,ci="method";var li=ai.extends(ci,(function(){ai.apply(this,arguments),this.kind=ci}));const ui=D,_i="reference",pi=ui.extends(_i,(function(t,e,s){ui.apply(this,[t||_i,e,s])}));var di=pi;const fi=di,ki="name",Ti=fi.extends(ki,(function(t,e,s,i){fi.apply(this,[ki,s,i]),this.name=t.replace(/\\$/,""),this.resolution=e}));Ti.UNQUALIFIED_NAME="uqn",Ti.QUALIFIED_NAME="qn",Ti.FULL_QUALIFIED_NAME="fqn",Ti.RELATIVE_NAME="rn";var xi=Ti;const Ei=_t,mi="namespace";var yi=Ei.extends(mi,(function(t,e,s,i,n){Ei.apply(this,[mi,e,i,n]),this.name=t,this.withBrackets=s||!1}));const Ai=F,Ni="namedargument";var gi=Ai.extends(Ni,(function(t,e,s,i){Ai.apply(this,[Ni,s,i]),this.name=t,this.value=e}));const Li=F;var bi=Li.extends("new",(function(t,e,s,i){Li.apply(this,["new",s,i]),this.what=t,this.arguments=e}));const Ii=D,Ci="noop";var Si=Ii.extends(Ci,(function(t,e){Ii.apply(this,[Ci,t,e])}));const Oi=ft,Ri="nowdoc";var vi=Oi.extends(Ri,(function(t,e,s,i,n){Oi.apply(this,[Ri,t,e,i,n]),this.label=s}));const wi=D,Di="nullkeyword";var Ui=wi.extends(Di,(function(t,e,s){wi.apply(this,[Di,e,s]),this.raw=t}));const Pi=Js,Fi="nullsafepropertylookup";var Mi=Pi.extends(Fi,(function(t,e,s,i){Pi.apply(this,[Fi,t,e,s,i])}));const Bi=ft,Hi="number";var Gi=Bi.extends(Hi,(function(t,e,s,i){Bi.apply(this,[Hi,t,e,s,i])}));const Vi=Js,Qi="offsetlookup";var Yi=Vi.extends(Qi,(function(t,e,s,i){Vi.apply(this,[Qi,t,e,s,i])}));const Wi=Ht,$i="parameter";var zi=Wi.extends($i,(function(t,e,s,i,n,r,o,h,a,c){Wi.apply(this,[$i,t,a,c]),this.value=s,this.type=e,this.byref=i,this.variadic=n,this.readonly=r,this.nullable=o,this.flags=h||0,this.attrGroups=[]}));const Ki=di,Xi="parentreference",ji=Ki.extends(Xi,(function(t,e,s){Ki.apply(this,[Xi,e,s]),this.raw=t}));var qi=ji;const Ji=nt,Zi="post";var tn=Ji.extends(Zi,(function(t,e,s,i){Ji.apply(this,[Zi,s,i]),this.type=t,this.what=e}));const en=nt;var sn=en.extends("pre",(function(t,e,s,i){en.apply(this,["pre",s,i]),this.type=t,this.what=e}));const nn=F,rn="print";var on=nn.extends(rn,(function(t,e,s){nn.apply(this,[rn,e,s]),this.expression=t}));const hn=_t,an="program";var cn=hn.extends(an,(function(t,e,s,i,n,r){hn.apply(this,[an,t,n,r]),this.errors=e,s&&(this.comments=s),i&&(this.tokens=i)}));const ln=ct,un="property";var _n=ln.extends(un,(function(t,e,s,i,n,r,o,h){ln.apply(this,[un,o,h]),this.name=t,this.value=e,this.readonly=s,this.nullable=i,this.type=n,this.attrGroups=r}));const pn=Js,dn="propertylookup";var fn=pn.extends(dn,(function(t,e,s,i){pn.apply(this,[dn,t,e,s,i])}));const kn=ct,Tn="propertystatement",xn=kn.extends(Tn,(function(t,e,s,i,n){kn.apply(this,[Tn,i,n]),this.properties=e,this.parseFlags(s)}));xn.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1]};var En=xn;const mn=F,yn="retif";var An=mn.extends(yn,(function(t,e,s,i,n){mn.apply(this,[yn,i,n]),this.test=t,this.trueExpr=e,this.falseExpr=s}));const Nn=ct,gn="return";var Ln=Nn.extends(gn,(function(t,e,s){Nn.apply(this,[gn,e,s]),this.expr=t}));const bn=di,In="selfreference",Cn=bn.extends(In,(function(t,e,s){bn.apply(this,[In,e,s]),this.raw=t}));var Sn=Cn;const On=F,Rn="silent";var vn=On.extends(Rn,(function(t,e,s){On.apply(this,[Rn,e,s]),this.expr=t}));const wn=ct,Dn="static";var Un=wn.extends(Dn,(function(t,e,s){wn.apply(this,[Dn,e,s]),this.variables=t}));const Pn=D,Fn="staticvariable";var Mn=Pn.extends(Fn,(function(t,e,s,i){Pn.apply(this,[Fn,s,i]),this.variable=t,this.defaultValue=e}));const Bn=Js,Hn="staticlookup";var Gn=Bn.extends(Hn,(function(t,e,s,i){Bn.apply(this,[Hn,t,e,s,i])}));const Vn=di,Qn="staticreference",Yn=Vn.extends(Qn,(function(t,e,s){Vn.apply(this,[Qn,e,s]),this.raw=t}));var Wn=Yn;const $n=ft,zn="string";var Kn=$n.extends(zn,(function(t,e,s,i,n,r){$n.apply(this,[zn,e,i,n,r]),this.unicode=s,this.isDoubleQuote=t}));const Xn=ct,jn="switch";var qn=Xn.extends(jn,(function(t,e,s,i,n){Xn.apply(this,[jn,i,n]),this.test=t,this.body=e,this.shortForm=s}));const Jn=ct,Zn="throw";var tr=Jn.extends(Zn,(function(t,e,s){Jn.apply(this,[Zn,e,s]),this.what=t}));const er=Ht,sr="trait";var ir=er.extends(sr,(function(t,e,s,i){er.apply(this,[sr,t,s,i]),this.body=e}));const nr=D,rr="traitalias";var or=nr.extends(rr,(function(t,e,s,i,n,r){nr.apply(this,[rr,n,r]),this.trait=t,this.method=e,this.as=s,this.visibility="",i&&(0===i[0]?this.visibility="public":1===i[0]?this.visibility="protected":2===i[0]&&(this.visibility="private"))}));const hr=D,ar="traitprecedence";var cr=hr.extends(ar,(function(t,e,s,i,n){hr.apply(this,[ar,i,n]),this.trait=t,this.method=e,this.instead=s}));const lr=D,ur="traituse";var _r=lr.extends(ur,(function(t,e,s,i){lr.apply(this,[ur,s,i]),this.traits=t,this.adaptations=e}));const pr=ct;var dr=pr.extends("try",(function(t,e,s,i,n){pr.apply(this,["try",i,n]),this.body=t,this.catches=e,this.always=s}));const fr=di,kr="typereference",Tr=fr.extends(kr,(function(t,e,s,i){fr.apply(this,[kr,s,i]),this.name=t,this.raw=e}));Tr.types=["int","float","string","bool","object","array","callable","iterable","void","static"];var xr=Tr;const Er=nt,mr="unary";var yr=Er.extends(mr,(function(t,e,s,i){Er.apply(this,[mr,s,i]),this.type=t,this.what=e}));const Ar=Ht,Nr="uniontype";var gr=Ar.extends(Nr,(function(t,e,s){Ar.apply(this,[Nr,null,e,s]),this.types=t}));const Lr=ct,br="unset";var Ir=Lr.extends(br,(function(t,e,s){Lr.apply(this,[br,e,s]),this.variables=t}));const Cr=ct,Sr="usegroup";var Or=Cr.extends(Sr,(function(t,e,s,i,n){Cr.apply(this,[Sr,i,n]),this.name=t,this.type=e,this.items=s}));const Rr=ct,vr="useitem",wr=Rr.extends(vr,(function(t,e,s,i,n){Rr.apply(this,[vr,i,n]),this.name=t,this.alias=e,this.type=s}));wr.TYPE_CONST="const",wr.TYPE_FUNCTION="function";var Dr=wr;const Ur=F,Pr="variable";var Fr=Ur.extends(Pr,(function(t,e,s,i){Ur.apply(this,[Pr,s,i]),this.name=t,this.curly=e||!1}));const Mr=F,Br="variadic";var Hr=Mr.extends(Br,(function(t,e,s){Mr.apply(this,[Br,e,s]),this.what=t}));const Gr=D,Vr="variadicplaceholder";var Qr=Gr.extends(Vr,(function(t,e){Gr.apply(this,[Vr,t,e])}));const Yr=ct,Wr="while";var $r=Yr.extends(Wr,(function(t,e,s,i,n){Yr.apply(this,[Wr,i,n]),this.test=t,this.body=e,this.shortForm=s}));const zr=F,Kr="yield";var Xr=zr.extends(Kr,(function(t,e,s,i){zr.apply(this,[Kr,s,i]),this.value=t,this.key=e}));const jr=F,qr="yieldfrom";var Jr=jr.extends(qr,(function(t,e,s){jr.apply(this,[qr,e,s]),this.value=t}));const Zr=v,to=T,eo=function(t,e){this.withPositions=t,this.withSource=e};eo.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach((function(t,e){t.forEach((function(t){eo.precedence[t]=e+1}))})),eo.prototype.isRightAssociative=function(t){return"**"===t||"??"===t},eo.prototype.swapLocations=function(t,e,s,i){this.withPositions&&(t.loc.start=e.loc.start,t.loc.end=s.loc.end,this.withSource&&(t.loc.source=i.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},eo.prototype.resolveLocations=function(t,e,s,i){this.withPositions&&(t.loc.start.offset>e.loc.start.offset&&(t.loc.start=e.loc.start),t.loc.end.offset<s.loc.end.offset&&(t.loc.end=s.loc.end),this.withSource&&(t.loc.source=i.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},eo.prototype.resolvePrecedence=function(t,e){let s,i,n;return"call"===t.kind?this.resolveLocations(t,t.what,t,e):"propertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind&&t.offset?this.resolveLocations(t,t.what,t.offset,e):"bin"===t.kind?t.right&&!t.right.parenthesizedExpression&&("bin"===t.right.kind?(i=eo.precedence[t.type],n=eo.precedence[t.right.type],i&&n&&n<=i&&(t.type!==t.right.type||!this.isRightAssociative(t.type))&&(s=t.right,t.right=t.right.left,this.swapLocations(t,t.left,t.right,e),s.left=this.resolvePrecedence(t,e),this.swapLocations(s,s.left,s.right,e),t=s)):"retif"===t.right.kind&&(i=eo.precedence[t.type],n=eo.precedence["?"],i&&n&&n<=i&&(s=t.right,t.right=t.right.test,this.swapLocations(t,t.left,t.right,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s))):"silent"!==t.kind&&"cast"!==t.kind||!t.expr||t.expr.parenthesizedExpression?"unary"===t.kind?t.what&&!t.what.parenthesizedExpression&&("bin"===t.what.kind?(s=t.what,t.what=t.what.left,this.swapLocations(t,t,t.what,e),s.left=this.resolvePrecedence(t,e),this.swapLocations(s,s.left,s.right,e),t=s):"retif"===t.what.kind&&(s=t.what,t.what=t.what.test,this.swapLocations(t,t,t.what,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s)):"retif"===t.kind?t.falseExpr&&"retif"===t.falseExpr.kind&&!t.falseExpr.parenthesizedExpression&&(s=t.falseExpr,t.falseExpr=s.test,this.swapLocations(t,t.test,t.falseExpr,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s):"assign"===t.kind?t.right&&"bin"===t.right.kind&&!t.right.parenthesizedExpression&&(i=eo.precedence["="],n=eo.precedence[t.right.type],i&&n&&n<i&&(s=t.right,t.right=t.right.left,s.left=t,this.swapLocations(s,s.left,t.right,e),t=s)):"expressionstatement"===t.kind&&this.swapLocations(t,t.expression,t,e):"bin"===t.expr.kind?(s=t.expr,t.expr=t.expr.left,this.swapLocations(t,t,t.expr,e),s.left=this.resolvePrecedence(t,e),this.swapLocations(s,s.left,s.right,e),t=s):"retif"===t.expr.kind&&(s=t.expr,t.expr=t.expr.test,this.swapLocations(t,t,t.expr,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s),t},eo.prototype.prepare=function(t,e,s){let i=null;(this.withPositions||this.withSource)&&(i=s.position());const n=this,r=function(){let o=null;const h=Array.prototype.slice.call(arguments);if(h.push(e),n.withPositions||n.withSource){let t=null;n.withSource&&(t=s.lexer._input.substring(i.offset,s.prev[2])),o=new Zr(t,i,new to(s.prev[0],s.prev[1],s.prev[2])),h.push(o)}t||(t=h.shift());const a=n[t];if("function"!=typeof a)throw new Error('Undefined node "'+t+'"');const c=Object.create(a.prototype);return a.apply(c,h),r.instance=c,r.trailingComments&&(c.trailingComments=r.trailingComments),"function"==typeof r.postBuild&&r.postBuild(c),s.debug&&delete n.stack[r.stackUid],n.resolvePrecedence(c,s)};return s.debug&&(this.stack||(this.stack={},this.stackUid=1),this.stack[++this.stackUid]={position:i,stack:(new Error).stack.split("\n").slice(3,5)},r.stackUid=this.stackUid),r.setTrailingComments=function(t){r.instance?r.instance.setTrailingComments(t):r.trailingComments=t},r.destroy=function(t){e&&(t?t.leadingComments?t.leadingComments=e.concat(t.leadingComments):t.leadingComments=e:s._docIndex=s._docs.length-e.length),s.debug&&delete n.stack[r.stackUid]},r},eo.prototype.checkNodes=function(){const t=[];for(const e in this.stack)Object.prototype.hasOwnProperty.call(this.stack,e)&&(this.stack[e].key=e,t.push(this.stack[e]));return this.stack={},t},[H,Q,$,X,J,et,ot,_t,xt,yt,gt,It,Ot,wt,Pt,Qt,jt,Zt,se,ne,he,le,pe,$t,ke,Ht,me,Ne,Le,Ce,Re,Ue,Me,Ge,Ye,ze,je,Ze,ss,F,rs,hs,ls,ps,ks,Es,As,bs,Cs,Rs,Ds,Fs,Hs,Qs,$s,Xs,ft,Js,ei,ni,hi,li,xi,yi,gi,bi,D,Si,vi,Ui,Mi,Gi,Yi,nt,zi,qi,tn,sn,on,cn,_n,fn,En,di,An,Ln,Sn,vn,ct,Un,Mn,Gn,Wn,Kn,qn,tr,ir,or,cr,_r,dr,xr,yr,gr,Ir,Or,Dr,Fr,Hr,Qr,$r,Xr,Jr].forEach((function(t){eo.prototype[t.kind]=t}));const so=k,io=C,no=R,ro=eo;function oo(t,e){const s=Object.keys(t);let i=s.length;for(;i--;){const n=s[i],r=t[n];null===r?delete e[n]:"function"==typeof r?e[n]=r.bind(e):Array.isArray(r)?e[n]=Array.isArray(e[n])?e[n].concat(r):r:e[n]="object"==typeof r&&"object"==typeof e[n]?oo(r,e[n]):r}return e}const ho=function(t){if("function"==typeof this)return new this(t);if(this.tokens=no,this.lexer=new so(this),this.ast=new ro,this.parser=new io(this.lexer,this.ast),t&&"object"==typeof t){if(t.parser&&(t.lexer||(t.lexer={}),t.parser.version)){if("string"==typeof t.parser.version){let e=t.parser.version.split(".");if(e=100*parseInt(e[0])+parseInt(e[1]),isNaN(e))throw new Error("Bad version number : "+t.parser.version);t.parser.version=e}else if("number"!=typeof t.parser.version)throw new Error("Expecting a number for version");if(t.parser.version<500||t.parser.version>900)throw new Error("Can only handle versions between 5.x to 8.x")}oo(t,this),this.lexer.version=this.parser.version}},ao=function(t){return"function"==typeof t.write?t.toString():t};ho.create=function(t){return new ho(t)},ho.parseEval=function(t,e){return new ho(e).parseEval(t)},ho.prototype.parseEval=function(t){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,t=ao(t),this.parser.parse(t,"eval")},ho.parseCode=function(t,e,s){"object"!=typeof e||s||(s=e,e="unknown");return new ho(s).parseCode(t,e)},ho.prototype.parseCode=function(t,e){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,t=ao(t),this.parser.parse(t,e)},ho.tokenGetAll=function(t,e){return new ho(e).tokenGetAll(t)},ho.prototype.tokenGetAll=function(t){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,t=ao(t);const e=this.lexer.EOF,s=this.tokens.values;this.lexer.setInput(t);let i=this.lexer.lex()||e;const n=[];for(;i!=e;){let t=this.lexer.yytext;Object.prototype.hasOwnProperty.call(s,i)&&(t=[s[i],t,this.lexer.yylloc.first_line]),n.push(t),i=this.lexer.lex()||e}return n},r.exports=ho,r.exports.tokens=no,r.exports.lexer=so,r.exports.AST=ro,r.exports.parser=io,r.exports.combine=oo,r.exports.Engine=ho,r.exports.default=ho;var co=s(r.exports);function lo(t,e){const s=e&&"markdown"===e.parentParser;if(!t&&s)return"";t=t.replace(/\?>\n<\?/g,"?>\n___PSEUDO_INLINE_PLACEHOLDER___<?");const i=new co({parser:{extractDoc:!0},ast:{withPositions:!0,withSource:!0}}),n=-1!==t.indexOf("<?php"),r=s&&!n;let o;try{o=r?i.parseEval(t):i.parseCode(t)}catch(t){throw t instanceof SyntaxError&&"lineNumber"in t&&(t.loc={start:{line:t.lineNumber,column:t.columnNumber}},delete t.lineNumber,delete t.columnNumber),t}return o.extra={parseAsEval:r},o.comments.forEach((t=>{"\n"===t.value[t.value.length-1]&&(t.value=t.value.slice(0,-1),t.loc.end.offset=t.loc.end.offset-1)})),o}const uo=t=>e=>{var s;return null===(s=e.loc)||void 0===s||null===(s=s[t])||void 0===s?void 0:s.offset},_o=uo("start"),po=uo("end"),{hasNewline:fo,skipEverythingButNewLine:ko,skipNewline:To}=e.util;function xo(t){return t.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(\d)/,"$1$2$3").replace(/^([+-]?[\d.]+)e[+-]?0+$/,"$1").replace(/^([+-])?\./,"$10.").replace(/(\.\d+?)0+(?=e|$)/,"$1").replace(/\.(?=e)/,"")}const Eo=new Map([["or"],["xor"],["and"],["=","+=","-=","*=","**=","/=",".=","%=","&=","|=","^=","<<=",">>="],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!==","<>","<=>"],["<",">","<=",">="],[">>","<<"],["+","-","."],["*","/","%"],["!"],["instanceof"],["++","--","~"],["**"]].flatMap(((t,e)=>t.map((t=>[t,e])))));function mo(t){return Eo.get(t)}const yo=["==","!=","===","!==","<>","<=>"],Ao=["*","/","%"],No=[">>","<<"];function go(t,e){return mo(e)===mo(t)&&("**"!==t&&((!yo.includes(t)||!yo.includes(e))&&(!("%"===e&&Ao.includes(t)||"%"===t&&Ao.includes(e))&&((e===t||!Ao.includes(e)||!Ao.includes(t))&&(!No.includes(t)||!No.includes(e))))))}function Lo(t){const e=t.children||t.body||t.adaptations;return Array.isArray(e)?e:null}function bo(t){return t.length>0?t[t.length-1]:null}function Io(t){const{node:e}=t;if("program"===e.kind){const t=Lo(e);return!(!t||0===t.length)&&"inline"===t[0].kind}if("switch"===e.kind){if(!e.body)return!1;const t=Lo(e.body);if(0===t.length)return!1;const[s]=t;if(!s.body)return!1;const i=Lo(s.body);return 0!==i.length&&"inline"===i[0].kind}const s=function(t){let{body:e}=t;return e?("block"===e.kind&&(e=e.children),e[0]):null}(e);return!!s&&"inline"===s.kind}function Co(t){return"nowdoc"===t.kind||"encapsed"===t.kind&&"heredoc"===t.type}function So(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const s=t.getNode(e),i=t.getNode(e+1),n=t.getNode(e+2);if(!i)return!1;if(n&&["call","new","echo"].includes(n.kind)&&!["call","array"].includes(i.kind)||"parameter"===i.kind){const t=n.arguments.length-1;return n.arguments.indexOf(i)!==t}if(n&&"for"===n.kind){const t=n.init.indexOf(i);if(-1!==t)return t!==n.init.length-1;const e=n.test.indexOf(i);if(-1!==e)return e!==n.test.length-1;const s=n.increment.indexOf(i);if(-1!==s)return s!==n.increment.length-1}if("bin"===i.kind)return i.left===s||So(t,e+1);if("case"===i.kind&&i.test===s)return!0;if("staticvariable"===i.kind){const t=n.variables.length-1;return n.variables.indexOf(i)!==t}if("entry"===i.kind){if(i.key===s)return!0;const t=n.items.length-1;return n.items.indexOf(i)!==t}if(["call","new"].includes(i.kind)){const t=i.arguments.length-1;return i.arguments.indexOf(s)!==t}if("echo"===i.kind){const t=i.expressions.length-1;return i.expressions.indexOf(s)!==t}if("array"===i.kind){const t=i.items.length-1;return i.items.indexOf(s)!==t}return"retif"===i.kind&&So(t,e+1)}function Oo(t){const e=t.replace(/^\\/,"");return-1!==e.indexOf("\\")?e:t}function Ro(t){return t.comments&&t.comments.some((t=>!t.leading&&!t.trailing))}function vo(t){return"propertylookup"===t.kind||"nullsafepropertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind}function wo(t){const{node:e}=t;return!["try","catch"].includes(e.kind)&&Io(t)}function Do(t){const{node:e}=t;if(["try","catch"].includes(e.kind))return!0;if("switch"===e.kind){const t=Lo(e.body);if(0===t.length)return!0;const s=bo(t);if(!s.body)return!0;const i=Lo(s.body);return 0===i.length||"inline"!==i[0].kind}return!Io(t)}function Uo(t){return["program","declare","namespace"].includes(t.kind)}function Po(t){return["name","parentreference","selfreference","staticreference"].includes(t.kind)}function Fo(t){return"bin"===t.kind&&["||","&&"].includes(t.type)?"logical":t.kind}function Mo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";const{node:s}=t;return s[e]&&s[e].children&&0===s[e].children.length&&(!s[e].comments||0===s[e].comments.length)}function Bo(t,e){let s=_o(e);return s=ko(t,s),s=To(t,s),fo(t,s)}function Ho(t){return"nowdoc"===t.kind||"encapsed"===t.kind&&"heredoc"===t.type||"entry"===t.kind&&("nowdoc"===t.value.kind||"encapsed"===t.value.kind&&"heredoc"===t.value.type)}function Go(t,e){const s=function(t,e){const s=[].concat(e);let i,n=-1;for(;i=t.getParentNode(++n);)if(-1!==s.indexOf(i.kind))return n;return-1}(t,e);return-1===s?null:t.getParentNode(s)}const Vo=new Map(["__construct","__destruct","__call","__callStatic","__get","__set","__isset","__unset","__sleep","__wakeup","__toString","__invoke","__set_state","__clone","__debugInfo"].map((t=>[t.toLowerCase(),t])));function Qo(t){const e=t.toLowerCase();return Vo.has(e)?Vo.get(e):t}function Yo(t){const e=new Set(t);return t=>e.has(null==t?void 0:t.kind)}const Wo=Yo(["variadicplaceholder","namedargument","nullkeyword","identifier","parameter","variable","variadic","boolean","literal","number","string","clone","cast"]),$o=Yo(["array"]),zo=Yo(["nullsafepropertylookup","propertylookup","staticlookup","offsetlookup","call","new"]),Ko=Yo(["arrowfunc"]);function Xo(t){const e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return zo(t)&&e.push(t),t.what?Xo(t.what,e):e}function jo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(e<=0)return!1;const s=t=>jo(t,e-1);if(Wo(t))return!0;if($o(t))return t.items.every((t=>null===t||s(t)));if(zo(t)){const i=Xo(t);return i.unshift(),i.length<=e&&i.every((t=>vo(t)?s(t.offset):t.arguments.every(s)))}return!!Ko(t)&&(t.arguments.length<=e&&t.arguments.every(s))}const{addLeadingComment:qo,addDanglingComment:Jo,addTrailingComment:Zo,skipNewline:th,hasNewline:eh,hasNewlineInRange:sh,getNextNonSpaceNonCommentCharacterIndex:ih,isNextLineEmpty:nh,isPreviousLineEmpty:rh}=e.util,{join:oh,indent:hh,hardline:ah,cursor:ch,lineSuffix:lh,breakParent:uh}=e.doc.builders;function _h(t,e){const{children:s}=t;0===s.length?Jo(t,e):qo(s[0],e)}function ph(t,e){"block"===t.kind?_h(t,e):qo(t,e)}function dh(t,e,s,i,n){const r=ih(t,po(n)),o=t.charAt(r);return e&&"identifier"===e.kind&&s&&("function"===s.kind||"method"===s.kind)&&")"===o?(Zo(s,n),!0):!(!s||"function"!==s.kind&&"method"!==s.kind||!i||"block"!==i.kind)&&(_h(i,n),!0)}function fh(t,e,s,i,n){if(!s||"if"!==s.kind||!i)return!1;const r=ih(t,po(n));return")"===t.charAt(r)?(Zo(e,n),!0):e===s.body&&i===s.alternate?(Jo(s,n),!0):"if"===i.kind?(ph(i.body,n),!0):s.body===i&&(qo(i,n),!0)}function kh(t,e,s){if(t&&["class","interface","trait"].includes(t.kind)){var i;if(null!==(i=t.__parent_new_arguments)&&void 0!==i&&i.includes(e))return!1;if(e&&t.extends)if(Array.isArray(t.extends)){if(t.extends.some((t=>{if(e&&e===t)return Jo(e,s),!0})))return!0}else if(e===t.extends)return Jo(e,s),!0;if(e&&t.implements&&t.implements.some((t=>{if(e&&e===t)return Jo(e,s),!0})))return!0;if(!(t.body&&t.body.length>0))return Jo(t,s),!0}return!!(e&&"class"===e.kind&&e.isAnonymous&&e.leadingComments&&"commentblock"===s.kind)}function Th(t,e,s,i){if(e&&("function"===e.kind||"method"===e.kind)){let s=0;for(let t=0;t<e.arguments.length;t++)s=po(e.arguments[t])>s?po(e.arguments[t]):s;const n=e.body&&_o(i)>s&&po(i)<_o(e.body),r=ih(t,po(i));if(e.type&&n&&")"!==t.charAt(r))return po(i)<_o(e.type)?(Jo(e.type,i),!0):(Zo(e.type,i),!0)}return!1}function xh(t,e,s,i,n){return!(!s||!["function","method","parameter"].includes(s.kind))&&("typereference"===e.kind&&"identifier"===i.kind&&(Zo(e,n),!0))}function Eh(t,e){return!(!t||!["label","goto"].includes(t.kind))&&(Zo(t,e),!0)}function mh(t,e,s,i){return s&&"inline"===s.kind?(s.leadingComments||(s.leadingComments=[]),s.leadingComments.includes(i)||s.leadingComments.push(i),!0):!(t||s||!e||"inline"!==e.kind)&&(Jo(e,i),!0)}function yh(t,e,s){return!(!t||"try"!==t.kind||!e)&&("block"===e.kind?(_h(e,s),!0):"try"===e.kind?(ph(e.always,s),!0):"catch"===e.kind&&(ph(e.body,s),!0))}function Ah(t,e,s,i){return s||e||!t||"namespace"!==t.kind||t.withBrackets?!(e||!t||"namespace"!==t.kind||t.withBrackets)&&(Jo(t,i),!0):(Zo(t,i),!0)}function Nh(t,e,s,i){return!(!t||"declare"!==t.kind)&&((!e||"noop"!==e.kind)&&(s&&t.directives[0]!==s?!(!s||!e)&&(qo(s,i),!0):("none"===t.mode?Zo(t,i):Jo(t,i),!0)))}function gh(t,e,s,i,n){if(!s||"while"!==s.kind||!i)return!1;const r=ih(t,po(n));return")"===t.charAt(r)?(Zo(e,n),!0):"block"===i.kind&&(_h(i,n),!0)}function Lh(t,e){return t.node.printed=!0,e.printer.printComment(t,e)}function bh(t,e,s,i){const n=[],r=t.getValue();return r&&r.comments?(t.each((()=>{const s=t.node;!s||s.leading||s.trailing||i&&!i(s)||n.push(Lh(t,e))}),"comments"),0===n.length?"":s?oh(ah,n):hh([ah,oh(ah,n)])):""}function Ih(t){return t.comments&&t.comments.some((t=>t.leading))}function Ch(t){return t.comments&&t.comments.some((t=>t.trailing))}function Sh(t,e){const s=[];return t.forEach(((t,i,n)=>{t.printed=!0;const r=n.length===i+1;s.push(t.value),r||s.push(ah),nh(e.originalText,po(t))&&!r&&s.push(ah)})),s}function Oh(t){return"commentblock"===t.kind}function Rh(t,e,s){const{node:i}=t;return i&&i===e.cursorNode?[ch,s,ch]:s}function vh(t,e,s,i){const{node:n}=t,r=e(t),o=n&&n.comments;if(!o||0===o.length)return Rh(t,s,r);const h=[],a=[i?";":"",r];return t.each((e=>{let{node:i}=e;const{leading:n,trailing:r}=i;if(n){const e=function(t,e,s){const i=Lh(t,s);if(!i)return"";const n=t.node;return s.printer.isBlockComment&&s.printer.isBlockComment(n)?[i,eh(s.originalText,po(n))?ah:" "]:[i,ah]}(t,0,s);if(!e)return;h.push(e);const n=s.originalText;eh(n,th(n,po(i)))&&h.push(ah)}else r&&a.push(function(t,e,s){const i=Lh(t,s);if(!i)return"";const n=t.node,r=s.printer.isBlockComment&&s.printer.isBlockComment(n);if(eh(s.originalText,_o(n),{backwards:!0})){const t=rh(s.originalText,_o(n));return lh([ah,t?ah:"",i])}return r?[" ",i]:[lh([" ",i]),r?"":uh]}(t,0,s))}),"comments"),Rh(t,s,h.concat(a))}function wh(t){const{parent:e}=t;if(!e)return!1;const{key:s,node:i}=t;if(["program","expressionstatement","namespace","declare","block","include","print","return","echo"].includes(e.kind))return!1;switch(i.kind){case"pre":case"post":if("unary"===e.kind)return"pre"===i.kind&&("+"===i.type&&"+"===e.type||"-"===i.type&&"-"===e.type);case"unary":switch(e.kind){case"unary":return i.type===e.type&&("+"===i.type||"-"===i.type);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===s;case"bin":return"**"===e.type&&"left"===s;default:return!1}case"bin":switch(e.kind){case"assign":case"retif":return["and","xor","or"].includes(i.type);case"silent":case"cast":return i.parenthesizedExpression;case"pre":case"post":case"unary":return!0;case"call":case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":return"what"===s;case"bin":{const t=e.type,r=mo(t),o=i.type,h=mo(o);return r>h||("||"===t&&"&&"===o||(r===h&&"right"===s||(r===h&&!go(t,o)||(r<h&&"%"===o?"+"===t||"-"===t:!(!No[n=t]&&"|"!==n&&"^"!==n&&"&"!==n)))))}default:return!1}case"propertylookup":case"nullsafepropertylookup":case"staticlookup":return"call"===e.kind&&("what"===s&&i.parenthesizedExpression);case"clone":case"new":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===s;default:return!1}case"yield":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===s;case"retif":return"test"===s;default:return!(!i.key&&!i.value)}case"assign":return("for"!==e.kind||!e.init.includes(i)&&!e.increment.includes(i))&&("assign"!==e.kind&&("static"!==e.kind&&(!["if","do","while","foreach","switch"].includes(e.kind)&&("silent"!==e.kind&&"call"!==e.kind))));case"retif":switch(e.kind){case"cast":return!0;case"unary":case"bin":case"retif":return!("test"===s&&!e.trueExpr);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===s;default:return!1}case"closure":switch(e.kind){case"call":return"what"===s;case"propertylookup":case"nullsafepropertylookup":return!0;default:return!1}case"silence":case"cast":return i.parenthesizedExpression;case"string":case"array":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return(!["string","array"].includes(i.kind)||"offsetlookup"!==e.kind)&&"what"===s;default:return!1}case"print":case"include":return"bin"===e.kind}var n;return!1}const{breakParent:Dh,join:Uh,line:Ph,lineSuffix:Fh,group:Mh,conditionalGroup:Bh,indent:Hh,dedent:Gh,ifBreak:Vh,hardline:Qh,softline:Yh,literalline:Wh,align:$h,dedentToRoot:zh}=e.doc.builders,{willBreak:Kh}=e.doc.utils,{isNextLineEmptyAfterIndex:Xh,hasNewline:jh,hasNewlineInRange:qh,getNextNonSpaceNonCommentCharacterIndex:Jh,isNextLineEmpty:Zh,isPreviousLineEmpty:ta}=e.util;function ea(t,e){return parseFloat(t)>=parseFloat(e)}function sa(t,e){return!!t.trailingCommaPHP&&ea(t.phpVersion,e)}function ia(t){return"1tbs"!==t.braceStyle}function na(t,e,s){return[arguments.length>3&&void 0!==arguments[3]&&arguments[3]?"?":"","->",s("offset")]}function ra(t,e,s){return na(t,e,s,!0)}function oa(t,e,s){const{node:i}=t,n=!["variable","identifier"].includes(i.offset.kind);return["::",n?"{":"",s("offset"),n?"}":""]}function ha(t,e,s){const{node:i}=t,n=i.offset&&"number"===i.offset.kind||Go(t,"encapsed");return["[",i.offset?Mh([Hh([n?"":Yh,s("offset")]),n?"":Yh]):"","]"]}function aa(t){return"array"===t.kind&&(t.items.length>0||t.comments)||"function"===t.kind||"method"===t.kind||"closure"===t.kind}function ca(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"arguments";const n=t.node[i];if(0===n.length)return["(",bh(t,e,!0),")"];let r=!1,o=!1;const h=t.map((t=>{let{node:i,isLast:n,isFirst:h}=t;const a=[s()];return n||(Zh(e.originalText,po(i))?(h&&(o=!0),r=!0,a.push(",",Qh,Qh)):a.push(",",Ph)),a}),i),{node:a}=t,c=bo(n),l=sa(e,"7.3")&&["call","new","unset","isset"].includes(a.kind)||sa(e,"8.0")&&["function","closure","method","arrowfunc","attribute"].includes(a.kind)?Hh([c&&Ho(c)?Qh:"",","]):"";const u=function(t){if(2!==t.length)return!1;const[e,s]=t;return!(e.comments&&e.comments.length||"function"!==e.kind&&"method"!==e.kind&&"closure"!==e.kind||"retif"===s.kind||aa(s))}(n),_=function(t){const e=bo(t),s=(i=t).length>1?i[i.length-2]:null;var i;return!Ih(e)&&!Ch(e)&&aa(e)&&(!s||s.kind!==e.kind)}(n);if(u||_){const e=(u?h.slice(1).some(Kh):h.slice(0,-1).some(Kh))||r;let n;t.each((t=>{let{isLast:e,isFirst:i}=t;u&&i&&(n=[s([],{expandFirstArg:!0}),h.length>1?",":"",o?Qh:Ph,o?Qh:"",h.slice(1)]),_&&e&&(n=[...h.slice(0,-1),s([],{expandLastArg:!0})])}),i);const a=h.some(Kh),c=["(",...n,")"];return[a?Dh:"",Bh([a?Vh(Mh(["(",Hh([Ph,...h]),l,Ph,")"],{shouldBreak:!0}),c):c,u?["(",Mh(n[0],{shouldBreak:!0}),...n.slice(1),")"]:["(",...h.slice(0,-1),Mh(bo(n),{shouldBreak:!0}),")"],Mh(["(",Hh([Ph,...h]),Vh(l),Ph,")"],{shouldBreak:!0})],{shouldBreak:e})]}return Mh(["(",Hh([Yh,...h]),Vh(l),Yh,")"],{shouldBreak:h.some(Kh)||r})}function la(t){return"array"===t.kind&&0!==t.items.length}function ua(t){return"array"===t.right.kind&&0!==t.right.items.length}function _a(t,e,s,i,n){let r=[];const{node:o}=t;if("bin"===o.kind){go(o.type,o.left.type)?r=r.concat(t.call((()=>_a(t,e,s,!0,n)),"left")):r.push(e("left"));const h=ua(o)?[o.type," ",e("right")]:[o.type,Ph,e("right")],{parent:a}=t,c=!(n&&["||","&&"].includes(o.type))&&Fo(a)!==Fo(o)&&Fo(o.left)!==Fo(o)&&Fo(o.right)!==Fo(o),l=Co(o.left)||"bin"===o.left.kind&&Co(o.left.right);r.push(l?"":" ",c?Mh(h):h),i&&o.comments&&(r=vh(t,(()=>r),s))}else r.push(e());return r}function pa(t,e,s){const{node:i}=t;switch(i.kind){case"propertylookup":return na(t,e,s);case"nullsafepropertylookup":return ra(t,e,s);case"staticlookup":return oa(t,0,s);case"offsetlookup":return ha(t,0,s);default:throw new Error("Have not implemented lookup kind ".concat(i.kind," yet."))}}function da(t){let{opening:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("heredoc"===t.type)return e?"<<<".concat(t.label):t.label;const s={string:'"',shell:"`"};if(s[t.type])return s[t.type];throw new Error("Unimplemented encapsed type ".concat(t.type))}function fa(t,e,s){const i=[];let n=[];return t.each((t=>{let{node:r}=t;i.push(n),i.push(Mh(s())),n=[",",Ph],r&&Zh(e.originalText,po(r))&&n.push(Yh)}),"items"),i}function ka(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children";const{node:n,parent:r}=t;let o=-1;const h=[],a=[];t.map((()=>{const{node:i,next:c,isFirst:l,isLast:u,index:_}=t,p="inline"===i.kind,d=s(),f=!u&&!p&&(c&&"case"===c.kind?!Io(t):c&&"inline"!==c.kind);let k=[d,f?Qh:"",f&&Zh(e.originalText,po(i))?Qh:""];const T="block"===n.kind&&r&&["function","closure","method","try","catch"].includes(r.kind);let x=T&&l?"":" ";if(p||!p&&u&&o>=0){const e=o;p&&(o=_);if(p&&!l||!p&&u){const s=(p?e:o)+1,r=u&&!p?_+1:_,h=t.siblings[p?e:o],c=h?function(t){const e=t.split("\n").pop();return e.length-e.trimLeft().length+1}(h.raw):"",l=r-s>1,d=l?T&&!h||Uo(n)&&0===s?"":Qh:"",f=l&&"halt"!==i.kind?T&&u?"":Qh:"";l&&(x=""),a.push({start:s,end:r,alignment:c,before:d,after:f})}}if(p){const s=c&&"echo"===c.kind&&c.shortForm?"<?=":"<?php",r=i.leadingComments&&i.leadingComments.length?[l&&"namespace"!==n.kind&&!T?"<?php":"","namespace"!==n.kind&&T?"":Qh,Sh(i.leadingComments,e),Qh,"?>"]:Uo(n)&&l&&"namespace"!==n.kind?"":[x,"?>"],o=t.getNode(_+1),h=o&&o.children&&o.children.length;k=[r,k,i.comments&&i.comments.length?[s,Qh,h?Sh(i.comments,e):"",Qh]:Uo(n)&&u?"":[s," "]]}h.push(k)}),i);const c=function(t,e){if(0===e.length)return t;let s=0;return e.reduce(((e,i)=>{const{start:n,end:r,alignment:o,before:h,after:a}=i,c=[h||"",...t.slice(n,r),a||""],l=e.concat(t.slice(s,n),o?zh(Mh($h(new Array(o).join(" "),c))):Mh(c),r===t.length-1?t.slice(r):"");return s=r,l}),[])}(h,a);if("program"===n.kind&&!n.extra.parseAsEval){const t=[],[s]=n.children;if(!s||"inline"!==s.kind){const i=e.originalText.trim().match(/^<\?(php|=)(\s+)?\S/),r=[i&&i[2]&&i[2].includes("\n")?[Qh,i[2].split("\n").length>2?Qh:""]:" ",n.comments?Sh(n.comments,e):""],o=s&&"echo"===s.kind&&s.shortForm;t.push([o?"<?=":"<?php",r])}t.push(c);if(/\?>\n?$/.test(e.originalText)){const s=bo(n.children),i=s?[qh(e.originalText.trimEnd(),po(s),po(n))?"inline"===s.kind&&s.comments&&s.comments.length?"":Qh:" ",Zh(e.originalText,po(s))?Qh:""]:n.comments?Qh:"";t.push(Fh([i,"?>"]))}return t}return c}function Ta(t,e,s,i){return t.map((t=>{let{node:i,isLast:n}=t;const r=[];return r.push(s()),n||(r.push(Qh),Zh(e.originalText,po(i))&&r.push(Qh)),r}),i)}function xa(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"extends",n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:" ",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:" ";const o=t.node[i],h=Ro(o)?[Qh,t.call((()=>bh(t,e,!0)),i),Qh]:n,a=Array.isArray(o)?Mh(Uh(",",t.map((i=>{let{node:n}=i;const o=s();return Ro(n)?[Qh,bh(t,e,!0),Qh,o]:[r,o]}),i))):[r,s(i)];return Hh([h,i,Kh(h)?Hh(a):a])}function Ea(t,e,s){let{inline:i=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const n=[];return t.node.attrGroups?(t.each((()=>{const r=["#["];!i&&n.length>0&&n.push(Qh),r.push(Yh),t.each((()=>{const i=t.node;r.length>2&&r.push(",",Ph);const n=[i.name];i.args.length>0&&n.push(ca(t,e,s,"args")),r.push(Mh(n))}),"attrs"),n.push(Mh([Hh(r),Vh(sa(e,"8.0")?",":""),Yh,"]",i?Vh(Yh," "):""]))}),"attrGroups"),0===n.length?[]:[...n,i?"":Qh]):[]}function ma(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"body";const{node:n}=t;if(!n[i])return";";const r=s(i);return[n.shortForm?":":" {",Hh("block"!==n[i].kind||n[i].children&&n[i].children.length>0||n[i].comments&&n[i].comments.length>0?[wo(t)?"switch"===n.kind?" ":"":Qh,r]:""),"if"===n.kind&&"body"===i?"":[Do(t)?Qh:"",n.shortForm?["end",n.kind,";"]:"}"]]}function ya(t,e,s,i,n,r,o){if(!i)return e;const h=Na(t,i,n,r,o);return Mh([e,s,h])}function Aa(t){return!!vo(t)&&(!("variable"!==t.what.kind&&!Po(t.what))||Aa(t.what))}function Na(t,e,s,i,n){const r=i?"&":"";if(function(t,e){return e.comments&&e.comments.some((e=>e.leading&&eh(t,po(e))))}(n.originalText,e))return Hh([Qh,r,s]);const o="cast"===e.kind?e.expr:e;return"bin"===o.kind&&!ua(o)||"retif"===o.kind&&(!o.trueExpr&&!la(o.falseExpr)||"bin"===o.test.kind&&!ua(o.test))||("variable"===t.kind||"string"===t.kind||vo(t))&&("string"===o.kind&&!ga(o)||Aa(o))?Mh(Hh([Ph,r,s])):[" ",r,s]}function ga(t){return t.raw.includes("\n")}function La(t,e){return("string"===t.kind||"encapsed"===t.kind&&("string"===t.type||"shell"===t.type))&&ga(t)&&!jh(e,_o(t),{backwards:!0})}function ba(t,e,s){return Mh(t.map((t=>{let{isFirst:i}=t;return i?[e()]:[s,e()]}),"types"))}const Ia=new Set(["loc","range","raw","comments","leadingComments","trailingComments","parenthesizedExpression","parent","prev","start","end","tokens","errors","extra"]);function Ca(t,e){if("string"===t.kind&&delete e.isDoubleQuote,["array","list"].includes(t.kind)&&delete e.shortForm,"inline"===t.kind){if(t.value.includes("___PSEUDO_INLINE_PLACEHOLDER___"))return null;e.value=e.value.replace(/\n/g,"")}if(("continue"===t.kind||"break"===t.kind)&&t.level){const{level:t}=e;"number"===t.kind&&(e.level="1"===t.value?null:t)}if("block"===t.kind&&1===t.children.length&&"block"===t.children[0].kind)for(;"block"===e.children[0].kind;)e.children=e.children[0].children;"number"===t.kind&&(e.value=xo(t.value));if(["foreach","for","if","while","do"].includes(t.kind)&&(t.body&&"block"!==t.body.kind?e.body={kind:"block",children:[e.body]}:e.body=e.body?e.body:null,t.alternate&&"block"!==t.alternate.kind?e.alternate={kind:"block",children:[e.alternate]}:e.alternate=e.alternate?e.alternate:null),"usegroup"===t.kind&&"string"==typeof t.name&&(e.name=e.name.replace(/^\\/,"")),"useitem"===t.kind&&(e.name=e.name.replace(/^\\/,"")),"method"===t.kind&&"identifier"===t.name.kind&&(e.name.name=Qo(e.name.name)),"noop"===t.kind)return null}Ca.ignoredProperties=Ia;const Sa="PHP";var Oa={phpVersion:{since:"0.13.0",category:Sa,type:"choice",default:"7.0",description:"Minimum target PHP version.",choices:[{value:"5.0"},{value:"5.1"},{value:"5.2"},{value:"5.3"},{value:"5.4"},{value:"5.5"},{value:"5.6"},{value:"7.0"},{value:"7.1"},{value:"7.2"},{value:"7.3"},{value:"7.4"},{value:"8.0"},{value:"8.1"},{value:"8.2"}]},trailingCommaPHP:{since:"0.0.0",category:Sa,type:"boolean",default:!0,description:"Print trailing commas wherever possible when multi-line."},braceStyle:{since:"0.10.0",category:Sa,type:"choice",default:"per-cs",description:"Print one space or newline for code blocks (classes and functions).",choices:[{value:"psr-2",description:"(deprecated) Use per-cs"},{value:"per-cs",description:"Use the PER Coding Style brace style."},{value:"1tbs",description:"Use 1tbs brace style."}]},singleQuote:{since:"0.0.0",category:Sa,type:"boolean",default:!1,description:"Use single quotes instead of double quotes."}};const Ra=/@prettier|@format/,va=function(t){const e=new Map;return s=>(e.has(s)||e.set(s,t(s)),e.get(s))}((t=>{const e=lo(t),[s]=e.children,[i]=e.comments.filter((t=>"commentblock"===t.kind));if(s&&i&&i.loc.start.line<s.loc.start.line)return i}));const{join:wa,hardline:Da}=e.doc.builders;function Ua(t,e){let{extend:s,override:i}=e;const n={};for(const e in t){n["languageId"===e?"linguistLanguageId":e]=t[e]}if(s)for(const t in s)n[t]=(n[t]||[]).concat(s[t]);for(const t in i)n[t]=i[t];return n}const Pa=[Ua(i,{override:{parsers:["php"],vscodeLanguageIds:["php"]}}),Ua(n,{override:{parsers:["php"],vscodeLanguageIds:["php"]}})],Fa={php:{parse:lo,astFormat:"php",locStart:_o,locEnd:po,hasPragma:function(t){if(!Ra.test(t))return!1;const e=va(t);if(e){const{value:t}=e;return Ra.test(t)}return!1}}},Ma=new Set(["kind","loc","errors","extra","comments","leadingComments","enclosingNode","precedingNode","followingNode"]);const Ba={php:{print:function(t,e,s){const{node:i}=t;if("string"==typeof i)return i;const n=function(t,e,s){const{node:i}=t;switch(i.kind){case"program":return Mh([ka(t,e,s),bh(t,e,!0,(t=>!t.printed))]);case"expressionstatement":return s("expression");case"block":return[ka(t,e,s),bh(t,e,!0)];case"declare":{var n;const r=t=>Uh(", ",t.map(s,"directives"));return["block","short"].includes(i.mode)?["declare(",r(t),")","block"===i.mode?" {":":",i.children.length>0?Hh([Qh,ka(t,e,s)]):"",bh(t,e),Qh,"block"===i.mode?"}":"enddeclare;"]:["declare(",r(t),")","inline"===(null===(n=t.next)||void 0===n?void 0:n.kind)?"":";"]}case"declaredirective":return[s("key"),"=",s("value")];case"namespace":return["namespace ",i.name&&"string"==typeof i.name?[i.name,i.withBrackets?" ":""]:"",i.withBrackets?"{":";",Ro(i)?[" ",bh(t,e,!0)]:"",i.children.length>0?i.withBrackets?Hh([Qh,ka(t,e,s)]):["inline"===i.children[0].kind?"":[Qh,Bo(e.originalText,i)?Qh:""],ka(t,e,s)]:"",i.withBrackets?[Qh,"}"]:""];case"usegroup":return Mh(["use ",i.type?[i.type," "]:"",Hh([i.name?[Oo(i.name),"\\{",Yh]:"",Uh([",",Ph],t.map(s,"items"))]),i.name?[Vh(sa(e,"7.2")?",":""),Yh,"}"]:""]);case"useitem":return[i.type?[i.type," "]:"",Oo(i.name),Ro(i)?[" ",bh(t,e,!0)]:"",i.alias?[" as ",s("alias")]:""];case"class":case"enum":case"interface":case"trait":return function(t,e,s){const{node:i}=t,n="class"===i.kind&&i.isAnonymous,r=Ea(t,e,s,{inline:n}),o=n?[]:[...r];i.isFinal&&o.push("final ");i.isAbstract&&o.push("abstract ");i.isReadonly&&o.push("readonly ");o.push(n?"":i.kind),i.name&&o.push(" ",s("name"));"enum"===i.kind&&i.valueType&&o.push(": ",s("valueType"));i.extends&&i.implements?o.push(Bh([[xa(t,e,s,"extends"),xa(t,e,s,"implements")],[xa(t,e,s,"extends"),xa(t,e,s,"implements"," ",Qh)],[xa(t,e,s,"extends",Qh," "),xa(t,e,s,"implements",Qh,i.implements.length>1?Qh:" ")]],{shouldBreak:Ro(i.extends)})):(i.extends&&o.push(Bh([xa(t,e,s,"extends"),xa(t,e,s,"extends"," ",Qh),xa(t,e,s,"extends",Qh,i.extends.length>1?Qh:" ")])),i.implements&&o.push(Bh([xa(t,e,s,"implements"),xa(t,e,s,"implements"," ",Qh),xa(t,e,s,"implements",Qh,i.implements.length>1?Qh:" ")])));const h=i.body&&0===i.body.length&&!Ro(i),a=Mh([Mh(o),ia(e)&&!h?n?Ph:Qh:" "]),c=["{",Hh([h?"":Qh,Ta(t,e,s,"body")]),bh(t,e,!0),h?"":Qh,"}"];return[a,c]}(t,e,s);case"traitprecedence":return[s("trait"),"::",s("method")," insteadof ",Uh(", ",t.map(s,"instead"))];case"traitalias":return[i.trait?[s("trait"),"::"]:"",i.method?s("method"):""," as ",Uh(" ",[...i.visibility?[i.visibility]:[],...i.as?[s("as")]:[]])];case"traituse":return Mh(["use ",Hh(Mh(Uh([",",Ph],t.map(s,"traits")))),i.adaptations?[" {",i.adaptations.length>0?[Hh([Qh,Ta(t,e,s,"adaptations")]),Qh]:Ro(i)?[Ph,bh(t,e,!0),Ph]:"","}"]:""]);case"function":case"closure":case"method":return function(t,e,s){const{node:i}=t,n=Ea(t,e,s,{inline:"closure"===i.kind}),r=[];i.isFinal&&r.push("final ");i.isAbstract&&r.push("abstract ");i.visibility&&r.push(i.visibility," ");i.isStatic&&r.push("static ");r.push("function "),i.byref&&r.push("&");i.name&&r.push(s("name"));r.push(ca(t,e,s)),i.uses&&i.uses.length>0&&r.push(Mh([" use ",ca(t,e,s,"uses")]));i.type&&r.push([": ",Ro(i.type)?[t.call((()=>bh(t,e,!0)),"type")," "]:"",i.nullable?"?":"",s("type")]);const o=r;if(!i.body)return[...n,o];const h=["{",Hh([Mo(t)?"":Qh,s("body")]),Mo(t)?"":Qh,"}"],a="closure"===i.kind;if(a)return[...n,o," ",h];if(0===i.arguments.length)return[...n,o,ia(e)&&!Mo(t)?Qh:" ",h];const c=r.some(Kh);if(c)return[...n,o," ",h];return[...n,Bh([[o,ia(e)&&!Mo(t)?Qh:" ",h],[o," ",h]])]}(t,e,s);case"arrowfunc":return[i.parenthesizedExpression?"(":"",...Ea(t,e,s,{inline:!0}),i.isStatic?"static ":"","fn",ca(t,e,s),i.type?[": ",i.nullable?"?":"",s("type")]:""," => ",s("body"),i.parenthesizedExpression?")":""];case"parameter":{let n="";1===i.flags?n="public ":2===i.flags?n="protected ":4===i.flags&&(n="private ");const r=[...Ea(t,e,s,{inline:!0}),n,i.readonly?"readonly ":"",i.nullable?"?":"",i.type?[s("type")," "]:"",i.byref?"&":"",i.variadic?"...":"","$",s("name")];return i.value?Mh([r,Ro(i)?" ":"",bh(t,e,!0)," =",Na(i.name,i.value,s("value"),!1,e)]):r}case"variadic":return["...",s("what")];case"property":return Mh([i.readonly?"readonly ":"",i.type?[i.nullable?"?":"",s("type")," "]:"","$",s("name"),i.value?[" =",Na(i.name,i.value,s("value"),!1,e)]:""]);case"propertystatement":{const n=[];t.each((()=>{n.push(...Ea(t,e,s))}),"properties");const r=t.map(s,"properties"),o=i.properties.some((t=>t.value));let h;1!==r.length||i.properties[0].comments?r.length>0&&(h=Hh(r[0])):[h]=r;const a=i.visibility||null===i.visibility;return Mh([...n,a?[null===i.visibility?"var":i.visibility,""]:"",i.isStatic?[a?" ":"","static"]:"",h?[" ",h]:"",Hh(r.slice(1).map((t=>[",",o?Qh:Ph,t])))])}case"if":{const n=[],r=ma(t,e,s,"body"),o=Mh(["if (",Mh([Hh([Yh,s("test")]),Yh]),")",r]);if(n.push(o,Io(t)||!i.body?"":Qh),i.alternate){n.push(i.shortForm?"":"} ");const r=Ch(i.body)&&i.body.comments.some((t=>t.trailing&&!Oh(t)))||function(t){if(!t.comments)return!1;const e=bo(t.comments.filter((t=>!t.leading&&!t.trailing)));return e&&!Oh(e)}(i),o=!r;n.push(o?"":Qh),Ro(i)&&n.push(Zh(e.originalText,po(i.body))?Qh:"",bh(t,e,!0),r?Qh:" "),n.push("else",Mh("if"===i.alternate.kind?s("alternate"):ma(t,e,s,"alternate")))}else n.push(i.body?i.shortForm?"endif;":"}":"");return n}case"do":return["do",ma(t,e,s,"body")," while (",Mh([Hh([Yh,s("test")]),Yh]),")"];case"while":case"switch":return Mh([i.kind," (",Mh([Hh([Yh,s("test")]),Yh]),")",ma(t,e,s,"body")]);case"for":{const n=ma(t,e,s,"body"),r=bh(t,e,!0),o=r?[r,Yh]:"";return i.init.length||i.test.length||i.increment.length?[o,Mh(["for (",Mh([Hh([Yh,Mh(Uh([",",Ph],t.map(s,"init"))),";",Ph,Mh(Uh([",",Ph],t.map(s,"test"))),";",Ph,Mh(Uh([",",Ph],t.map(s,"increment")))]),Yh]),")",n])]:[o,Mh(["for (;;)",n])]}case"foreach":{const n=ma(t,e,s,"body"),r=bh(t,e,!0);return[r?[r,Yh]:"",Mh(["foreach (",Mh([Hh([Yh,s("source"),Ph,"as ",Mh(i.key?Hh(Uh([" =>",Ph],[s("key"),s("value")])):s("value"))]),Yh]),")",n])]}case"try":{const n=[];return n.push("try",ma(t,e,s,"body")),i.catches&&n.push(t.map(s,"catches")),i.always&&n.push(" finally",ma(t,e,s,"always")),n}case"catch":return[" catch",i.what?[" (",Uh(" | ",t.map(s,"what")),i.variable?[" ",s("variable")]:"",")"]:"",ma(t,e,s,"body")];case"case":return[i.test?["case ",i.test.comments?Hh(s("test")):s("test"),":"]:"default:",i.body&&i.body.children&&i.body.children.length?Hh([Io(t)?"":Qh,s("body")]):""];case"break":case"continue":return i.level&&("number"===i.level.kind&&"1"!==i.level.value)?["".concat(i.kind," "),s("level")]:i.kind;case"call":return 1===i.arguments.length&&La(i.arguments[0],e.originalText)?[s("what"),"(",Uh(", ",t.map(s,"arguments")),")"]:vo(i.what)?function(t,e,s){const i=[];function n(t){const{originalText:s}=e,i=Jh(s,po(t));return")"===s.charAt(i)?Xh(s,i+1,e):Zh(s,po(t))}function r(t){const{node:o}=t;if("call"!==o.kind||!vo(o.what)&&"call"!==o.what.kind)if(vo(o)){let n=null;n="propertylookup"===o.kind?na(t,e,s):"nullsafepropertylookup"===o.kind?ra(t,e,s):"staticlookup"===o.kind?oa(t,e,s):ha(t,e,s),i.unshift({node:o,needsParens:wh(t),printed:vh(t,(()=>n),e)}),t.call((t=>r(t)),"what")}else i.unshift({node:o,printed:s()});else i.unshift({node:o,printed:[vh(t,(()=>ca(t,e,s)),e),n(o)?Qh:""]}),t.call((t=>r(t)),"what")}const{node:o}=t;i.unshift({node:o,printed:ca(t,e,s)}),t.call((t=>r(t)),"what");for(let t=0;t<i.length;++t)"call"===i[t].node.kind&&i[t-1]&&["propertylookup","nullsafepropertylookup","staticlookup"].includes(i[t-1].node.kind)&&i[t-1].needsParens&&(i[0].printed=["(",i[0].printed],i[t-1].printed=[i[t-1].printed,")"]);const h=[];let a=[i[0]],c=1;for(;c<i.length&&("call"===i[c].node.kind||vo(i[c].node)&&i[c].node.offset&&"number"===i[c].node.offset.kind);++c)a.push(i[c]);if("call"!==i[0].node.kind)for(;c+1<i.length&&(vo(i[c].node)&&vo(i[c+1].node));++c)a.push(i[c]);h.push(a),a=[];let l=!1;for(;c<i.length;++c){if(l&&vo(i[c].node)){if("offsetlookup"===i[c].node.kind&&i[c].node.offset&&"number"===i[c].node.offset.kind){a.push(i[c]);continue}h.push(a),a=[],l=!1}"call"===i[c].node.kind&&(l=!0),a.push(i[c]),i[c].node.comments&&Ch(i[c].node)&&(h.push(a),a=[],l=!1)}a.length>0&&h.push(a);function u(t){const s=t[1].length&&"offsetlookup"===t[1][0].node.kind;if(1===t[0].length){const e=t[0][0].node;return"variable"===e.kind&&("this"===e.name||_&&i(e.name))||Po(e)}function i(t){return t.length<e.tabWidth}const n=bo(t[0]).node;return vo(n)&&("identifier"===n.offset.kind||"variable"===n.offset.kind)&&s}const _="expressionstatement"===t.parent.kind,p=h.length>=2&&!h[1][0].node.comments&&u(h);function d(t){const e=[];for(let s=0;s<t.length;s++)t[s+1]&&t[s+1].needsParens?(e.push("(",t[s].printed,t[s+1].printed,")"),s++):e.push(t[s].printed);return e}function f(t){return 0===t.length?"":Hh(Mh([Qh,Uh(Qh,t.map(d))]))}const k=h.map(d),T=k,x=p?3:2,E=h.slice(0,x).flat(),m=E.slice(1,-1).some((t=>Ih(t.node)))||E.slice(0,-1).some((t=>Ch(t.node)))||h[x]&&Ih(h[x][0].node),y=Go(t,"encapsed");if(h.length<=x&&!m||y)return Mh(T);const A=bo(p?h.slice(1,2)[0]:h[0]).node,N="call"!==A.kind&&n(A),g=[d(h[0]),p?h.slice(1,2).map(d):"",N?Qh:"",f(h.slice(p?2:1))],L=i.filter((t=>"call"===t.node.kind));if(m||L.length>2&&L.some((t=>!t.node.arguments.every((t=>jo(t)))))||k.slice(0,-1).some(Kh))return Mh(g);return[Kh(T)||N?Dh:"",Bh([T,g])]}(t,e,s):[s("what"),ca(t,e,s)];case"new":{const n=i.what&&"class"===i.what.kind&&i.what.isAnonymous;if(!n&&1===i.arguments.length&&La(i.arguments[0],e.originalText))return["new ",...t.call(Ea,"what"),s("what"),"(",Uh(", ",t.map(s,"arguments")),")"];const r=[];if(r.push("new "),n)r.push(i.what.leadingComments&&"commentblock"===i.what.leadingComments[0].kind?[Sh(i.what.leadingComments,e)," "]:"",...t.call((()=>Ea(t,e,s,{inline:!0})),"what"),"class",i.arguments.length>0?[" ",ca(t,e,s)]:"",Mh(s("what")));else{const n=["call","offsetlookup"].includes(i.what.kind),o=[n?"(":"",s("what"),n?")":"",ca(t,e,s)];r.push(Ih(i.what)?Hh(o):o)}return r}case"clone":return["clone ",i.what.comments?Hh(s("what")):s("what")];case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":{const{parent:n}=t;let r,o=0;do{r=t.getParentNode(o),o++}while(r&&vo(r));const h=Go(t,"encapsed")||r&&("new"===r.kind||"assign"===r.kind&&"variable"!==r.left.kind)||"offsetlookup"===i.kind||(Po(i.what)||"variable"===i.what.kind)&&["identifier","variable","encapsedpart"].includes(i.offset.kind)&&n&&!vo(n);return[s("what"),h?pa(t,e,s):Mh(Hh([Yh,pa(t,e,s)]))]}case"exit":return Mh([i.useDie?"die":"exit","(",i.expression?La(i.expression,e.originalText)?s("expression"):[Hh([Yh,s("expression")]),Yh]:bh(t,e),")"]);case"global":return Mh(["global ",Hh(Uh([",",Ph],t.map(s,"items")))]);case"include":return[i.require?"require":"include",i.once?"_once":""," ",i.target.comments?Hh(s("target")):s("target")];case"label":return[s("name"),":"];case"goto":return["goto ",s("label")];case"throw":return["throw ",i.what.comments?Hh(s("what")):s("what")];case"silent":return["@",s("expr")];case"halt":return[Ro(i)?[bh(t,e,!0),Qh]:"","__halt_compiler();",i.after];case"eval":return Mh(["eval(",La(i.source,e.originalText)?s("source"):[Hh([Yh,s("source")]),Yh],")"]);case"echo":{const e=t.map(s,"expressions");let n;return 1!==e.length||i.expressions[0].comments?e.length>0&&(n=Co(i.expressions[0])||i.expressions[0].comments?Hh(e[0]):Gh(e[0])):[n]=e,Mh([i.shortForm?"":"echo ",n||"",Hh(e.slice(1).map((t=>[",",Ph,t])))])}case"print":return["print ",i.expression.comments?Hh(s("expression")):s("expression")];case"return":{const n=[];if(n.push("return"),i.expr){const t=s("expr");n.push(" ",i.expr.comments?Hh(t):t)}return Ro(i)&&n.push(" ",bh(t,e,!0)),n}case"isset":case"unset":return Mh([i.kind,ca(t,e,s,"variables")]);case"empty":return Mh(["empty(",Hh([Yh,s("expression")]),Yh,")"]);case"variable":{const{parent:e,grandparent:n}=t,r="assign"===e.kind?"":i.byref?"&":"",o="encapsedpart"===e.kind&&"simple"===e.syntax&&e.curly||n&&"offsetlookup"===e.kind&&"encapsedpart"===n.kind&&"simple"===n.syntax&&n.curly?"":"$",h=i.curly?"{":"",a=i.curly?"}":"";return[r,o,h,s("name"),a]}case"constantstatement":case"classconstant":{const n=Ea(t,e,s),r=t.map(s,"constants");let o;return 1!==r.length||i.constants[0].comments?r.length>0&&(o=Hh(r[0])):[o]=r,Mh([...n,i.final?"final ":"",i.visibility?[i.visibility," "]:"","const",o?[" ",o]:"",Hh(r.slice(1).map((t=>[",",Qh,t])))])}case"constant":return ya(i.name,s("name")," =",i.value,s("value"),!1,e);case"static":{const e=t.map(s,"variables"),n=i.variables.some((t=>t.defaultValue));let r;return 1!==e.length||i.variables[0].comments?e.length>0&&(r=Hh(e[0])):[r]=e,Mh(["static",r?[" ",r]:"",Hh(e.slice(1).map((t=>[",",n?Qh:Ph,t])))])}case"staticvariable":return ya(i.variable,s("variable")," =",i.defaultValue,s("defaultValue"),!1,e);case"list":case"array":{const n="array"===i.kind&&ea(e.phpVersion,"5.4")||"list"===i.kind&&(i.shortForm||ea(e.phpVersion,"7.1")),r=n?"[":[i.kind,"("],o=n?"]":")";if(0===i.items.length)return Ro(i)?Mh([r,bh(t,e),Yh,o]):[r,o];const h=bo(i.items),a=h&&"noop"===h.kind,[c]=i.items.filter((t=>"noop"!==t.kind)).sort(((t,e)=>_o(t)-_o(e))),l=!(!c||!c.key)&&c&&qh(e.originalText,_o(i),_o(c));return Mh([r,Hh([Yh,fa(t,e,s)]),a?",":"",Vh(!a&&sa(e,"5.0")?[h&&Ho(h)?Qh:"",","]:""),bh(t,e,!0),Yh,o],{shouldBreak:l})}case"entry":{const t=i.byRef?"&":"",n=i.unpack?"...":"";return i.key?ya(i.key,s("key")," =>",i.value,s("value"),t,e):[t,n,s("value")]}case"yield":{const t=[i.key?[s("key")," => "]:"",s("value")];return["yield",i.key||i.value?" ":"",i.value&&i.value.comments?Hh(t):t]}case"yieldfrom":return["yield from ",i.value.comments?Hh(s("value")):s("value")];case"unary":return[i.type,s("what")];case"pre":return[i.type+i.type,s("what")];case"post":return[s("what"),i.type+i.type];case"cast":return["(",i.type,") ",i.expr.comments?Hh(s("expr")):s("expr")];case"assignref":case"assign":{const t="assignref"===i.kind;return ya(i.left,s("left"),[" ",t?"=":i.operator],i.right,s("right"),t,e)}case"bin":{const{parent:n,grandparent:r}=t,o=i!==n.body&&("if"===n.kind||"while"===n.kind||"switch"===n.kind||"do"===n.kind),h=_a(t,s,e,!1,o);if(o)return h;if("unary"===n.kind||vo(n)&&"offsetlookup"!==n.kind)return Mh([Hh([Yh,...h]),Yh]);const a=i!==n.body&&"for"===n.kind||"retif"===n.kind&&r&&"return"!==r.kind,c=["assign","property","constant","staticvariable","entry"].includes(n.kind),l="bin"===i.left.kind&&go(i.type,i.left.type);if(a||ua(i)&&!l||!ua(i)&&c)return Mh(h);const u=h.slice(1);return Mh([h.length>0?h[0]:"",Hh(u)])}case"retif":{const e=[],{parent:n}=t;let r,o=0;do{r=t.getParentNode(o),o++}while(r&&"retif"===r.kind);const h=r||n,a="bin"===i.falseExpr.kind?Hh(s("falseExpr")):s("falseExpr"),c=[i.trueExpr?Ph:" ","?",i.trueExpr?[" ","bin"===i.trueExpr.kind?Hh(s("trueExpr")):s("trueExpr"),Ph]:"",":",i.trueExpr?[" ",a]:[la(i.falseExpr)?" ":Ph,a]];e.push(c);const l=t=>n===h?Mh(t):t,u=t.grandparent,_="cast"===n.kind&&u?u:n,p=["propertylookup","nullsafepropertylookup","staticlookup"].includes(_.kind),d=s("test");if(!i.trueExpr){const t=[d,"bin"===_.kind||["print","echo","return","include"].includes(h.kind)?Hh(e):e];return"call"===_.kind&&_.what===i||"unary"===_.kind||vo(_)&&"offsetlookup"!==_.kind?Mh([Hh([Yh,t]),Yh]):l(t)}return l(["retif"===i.test.kind?Hh(d):d,Hh(e),p?Yh:""])}case"boolean":return i.value?"true":"false";case"number":return xo(i.value);case"string":{const{parent:s}=t;if("encapsedpart"===s.kind){const s=t.grandparent;let n=0;const r=ea(e.phpVersion,"7.3");let o=Wh;if("heredoc"===s.type){o=r?Qh:Wh;const t=s.raw.split("\n");n=t[t.length-1].search(/\S/),-1===n&&(n=t[t.length-2].search(/\S/))}return Uh(o,i.raw.split("\n").map(((t,e)=>e>0||0===i.loc.start.column?t.substring(n):t)))}const n=function(t,e){if(t.isDoubleQuote===e.singleQuote){const e=t.raw.slice("b"===t.raw[0]?2:1,-1).match(/\\([$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})|\r?\n|'|"|\$/);return t.isDoubleQuote?e:!e}return t.isDoubleQuote}(i,e)?'"':"'";let r=i.raw;return"b"===i.raw[0]&&(r=r.slice(1)),['"',"'"].includes(r[0])&&(r=r.substr(1)),['"',"'"].includes(r[r.length-1])&&(r=r.substr(0,r.length-1)),["b"===i.raw[0]?"b":"",n,Uh(Wh,r.split("\n")),n]}case"intersectiontype":return ba(t,s,"&");case"uniontype":return ba(t,s,"|");case"encapsedpart":{const t="simple"===i.syntax&&i.curly||"complex"===i.syntax?[i.curly?"$":"","{"]:"",e="simple"===i.syntax&&i.curly||"complex"===i.syntax?"}":"";return[t,s("expression"),e]}case"encapsed":switch(i.type){case"string":case"shell":case"heredoc":{const n=ea(e.phpVersion,"7.3")?Qh:Wh;return[da(i),"heredoc"===i.type?n:"",...t.map(s,"value"),da(i,{opening:!1}),"heredoc"===i.type&&So(t)?Qh:""]}default:throw new Error("Have not implemented kind ".concat(i.type," yet."))}case"inline":return Uh(Wh,i.raw.replace("___PSEUDO_INLINE_PLACEHOLDER___","").split("\n"));case"magic":return i.value;case"nowdoc":{const s=ea(e.phpVersion,"7.3")?Qh:Wh;return["<<<'",i.label,"'",s,Uh(s,i.value.split("\n")),s,i.label,So(t)?Qh:""]}case"name":return["rn"===i.resolution?"namespace\\":"",i.name];case"literal":return s("value");case"parentreference":return"parent";case"selfreference":return"self";case"staticreference":return"static";case"typereference":return i.name;case"nullkeyword":return"null";case"identifier":{const{parent:e}=t;return"method"===e.kind&&(i.name=Qo(i.name)),s("name")}case"match":{const i=t.map((()=>{const i=t.node,n=Ih(i)?[Sh(i.leadingComments,e),Qh]:[],r=!t.isLast||e.trailingCommaPHP?",":"",o=Ch(i)?[" ",Sh(i.comments.filter((t=>t.trailing)),e)]:[],h=null===i.conds?"default":t.map((t=>{let{isFirst:e}=t;return[",",Ph,s()].slice(e?2:0)}),"conds"),a=s("body"),c=!t.isFirst&&ta(e.originalText,_o(i))?Qh:"";return["",Qh,c,...n,Mh([Mh([h,Hh(Ph)]),"=> ",a,r,...o])].slice(t.isFirst?1:0)}),"arms");return Mh(["match (",Mh([Hh([Yh,s("cond")]),Yh]),") {",Mh(Hh([...i]))," ",Yh,"}"])}case"noop":return i.comments?Sh(i.comments,e):"";case"namedargument":return[i.name,": ",s("value")];case"enumcase":return Mh(["case ",s("name"),i.value?[" =",Na(i.name,i.value,s("value"),!1,e)]:""]);case"variadicplaceholder":return"...";default:throw new Error("Have not implemented kind '".concat(i.kind,"' yet."))}}(t,e,s),r=[],o=wh(t);return o&&r.unshift("("),r.push(n),o&&r.push(")"),function(t){const{node:e,parent:s}=t;if(!s)return!1;if(["for","foreach","while","do","if","switch"].includes(s.kind)&&"block"!==e.kind&&"if"!==e.kind&&(s.body===e||s.alternate===e))return!0;if(!function(t){return["block","program","namespace","class","enum","interface","trait","traituse","declare"].includes(t.kind)}(s))return!1;if("echo"===e.kind&&e.shortForm)return!1;if("traituse"===e.kind)return!e.adaptations;if("method"===e.kind&&e.isAbstract)return!0;if("method"===e.kind){const{parent:e}=t;if(e&&"interface"===e.kind)return!0}return["expressionstatement","do","usegroup","classconstant","propertystatement","traitprecedence","traitalias","goto","constantstatement","enumcase","global","static","echo","unset","return","break","continue","throw"].includes(e.kind)}(t)&&r.push(";"),function(t){const{node:e}=t,s="program"===e.kind,i=e.children&&bo(e.children);if(!s)return!1;if(i&&["halt","inline"].includes(i.kind))return!1;if(i&&("declare"===i.kind||"namespace"===i.kind)){const t=i.children.length>0&&bo(i.children);if(t&&["halt","inline"].includes(t.kind))return!1}return!0}(t)&&r.push(Qh),r},getVisitorKeys:function(t,e){return Object.keys(t).filter((t=>!e.has(t)&&!Ma.has(t)))},insertPragma:function(t){const e=va(t);if(e){const{start:{offset:s},end:{offset:i}}=e.loc,n=t.substring(0,s),r=t.substring(i);return"".concat(n).concat(function(t){let e=t.split("\n");if(1===e.length){const[,t]=/\/*\*\*(.*)\*\//.exec(e[0]);e=["/**"," * ".concat(t.trim())," */"]}const s=e.findIndex((t=>/@\S/.test(t)))||1;return e.splice(s,0," * @format"),e.join("\n")}(e.value)).concat(r)}const s="<?php";if(!t.startsWith(s))return t;const i=t.substring(0,5),n=t.substring(5);return"".concat(i,"\n/** \n * @format \n */\n").concat(n)},massageAstNode:Ca,getCommentChildNodes:function(t){if("new"===t.kind&&"class"===t.what.kind)return t.what.__parent_new_arguments=[...t.arguments],[t.what]},canAttachComment:function(t){return t.kind&&"commentblock"!==t.kind&&"commentline"!==t.kind},isBlockComment:Oh,handleComments:{ownLine:function(t,e,s){const{precedingNode:i,enclosingNode:n,followingNode:r}=t;return dh(e,i,n,r,t)||function(t,e,s){if(t&&vo(t)&&e&&["identifier","variable","encapsed"].includes(e.kind))return qo(t,s),!0;return!1}(n,r,t)||fh(e,i,n,r,t)||gh(e,i,n,r,t)||yh(n,r,t)||kh(n,r,t)||xh(e,i,n,r,t)||Th(e,n,r,t)||function(t,e,s,i){if(!s&&t&&("for"===t.kind||"foreach"===t.kind))return t.body&&"block"!==t.body.kind?qo(s,i):qo(t,i),!0;return!1}(n,0,r,t)||mh(n,i,r,t)||Nh(n,i,r,t)},endOfLine:function(t,e,s){const{precedingNode:i,enclosingNode:n,followingNode:r}=t;return function(t,e,s,i,n){if(!e&&!i&&s&&"array"===s.kind)return Zo(s,n),!0;return!1}(0,i,n,r,t)||function(t,e,s,i,n){if(s&&"return"===s.kind&&!s.expr)return Zo(s,n),!0;return!1}(0,0,n,0,t)||dh(e,i,n,r,t)||function(t,e,s,i,n){const r=e&&!sh(n,po(e),_o(i));if((!e||!r)&&t&&"retif"===t.kind&&s)return qo(s,i),!0;return!1}(n,i,r,t,e)||fh(e,i,n,r,t)||gh(e,i,n,r,t)||yh(n,r,t)||kh(n,r,t)||xh(e,i,n,r,t)||Th(e,n,r,t)||function(t,e){if(t&&"entry"===t.kind)return qo(t,e),!0;return!1}(n,t)||function(t,e,s){if(e&&"call"===e.kind&&t&&e.what===t&&e.arguments.length>0)return qo(e.arguments[0],s),!0;return!1}(i,n,t)||function(t,e,s){if(t&&"assign"===t.kind&&e){const i=t.loc.start.offset+t.loc.source.indexOf("=");if(s.loc.start.offset>i)return qo(e,s),!0}return!1}(n,r,t)||mh(n,i,r,t)||Ah(n,i,r,t)||Nh(n,i,r,t)||Eh(n,t)},remaining:function(t,e,s){const{precedingNode:i,enclosingNode:n,followingNode:r}=t;return fh(e,i,n,r,t)||gh(e,i,n,r,t)||function(t,e,s){const i=ih(t,po(s));if(")"!==t.charAt(i))return!1;if(e&&("function"===e.kind||"closure"===e.kind||"method"===e.kind||"call"===e.kind||"new"===e.kind)&&0===e.arguments.length)return Jo(e,s),!0;return!1}(e,n,t)||kh(n,r,t)||function(t,e,s){if(t&&"traituse"===t.kind&&t.adaptations&&!t.adaptations.length)return Jo(t,s),!0;return!1}(n,0,t)||xh(e,i,n,r,t)||Th(e,n,r,t)||Eh(n,t)||function(t,e,s,i){if(e&&"halt"===e.kind)return Jo(e,i),!0;if(t&&"halt"===t.kind)return Jo(t,i),!0;return!1}(i,n,0,t)||function(t,e){if(t&&("continue"===t.kind||"break"===t.kind)&&!t.label)return Zo(t,e),!0;return!1}(n,t)||mh(n,i,r,t)||Ah(n,i,r,t)}},willPrintOwnComments(t){const{node:e}=t;return e&&"noop"===e.kind},printComment(t){const e=t.node;switch(e.kind){case"commentblock":{if(!e.value.includes("\n"))return e.value;const t=e.value.split("\n");return t.slice(1,t.length-1).every((t=>"*"===t.trim()[0]))?wa(Da,t.map(((e,s)=>(s>0?" ":"")+(s<t.length-1?e.trim():e.trimLeft())))):e.value}case"commentline":return e.value.trimRight();default:throw new Error("Not a comment: ".concat(JSON.stringify(e)))}},hasPrettierIgnore(t){const e=t=>t.value.includes("prettier-ignore")&&!t.value.includes("prettier-ignore-start")&&!t.value.includes("prettier-ignore-end"),{node:s,parent:i}=t;return s&&"classconstant"!==s.kind&&s.comments&&s.comments.length>0&&s.comments.some(e)||s&&"constant"===s.kind&&i&&"classconstant"===i.kind&&i.comments&&i.comments.length>0&&i.comments.some(e)}}};t.defaultOptions={tabWidth:4},t.languages=Pa,t.options=Oa,t.parsers=Fa,t.printers=Ba}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("prettier/standalone")):"function"==typeof define&&define.amd?define(["exports","prettier/standalone"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.php={}),t.prettier)}(this,(function(t,e){"use strict";function s(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var i={exports:{}},n={attributeIndex:0,attributeListDepth:{},matchST_ATTRIBUTE(){let t=this.input();if(this.is_WHITESPACE()){do{t=this.input()}while(this.is_WHITESPACE());return this.unput(1),null}switch(t){case"]":return 0===this.attributeListDepth[this.attributeIndex]?(delete this.attributeListDepth[this.attributeIndex],this.attributeIndex--,this.popState()):this.attributeListDepth[this.attributeIndex]--,"]";case"(":case")":case":":case"=":case"|":case"&":case"^":case"-":case"+":case"*":case"%":case"~":case"<":case">":case"!":case".":return this.consume_TOKEN();case"[":return this.attributeListDepth[this.attributeIndex]++,"[";case",":return",";case'"':return this.ST_DOUBLE_QUOTES();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN()}if(this.is_LABEL_START()||"\\"===t){for(;this.offset<this.size;){const t=this.input();if(!this.is_LABEL()&&"\\"!==t){t&&this.unput(1);break}}return this.T_STRING()}if(this.is_NUM())return this.consume_NUM();throw new Error(`Bad terminal sequence "${t}" at line ${this.yylineno} (offset ${this.offset})`)}},r={T_COMMENT(){for(;this.offset<this.size;){const t=this.input();if("\n"===t||"\r"===t)return this.tok.T_COMMENT;if("?"===t&&!this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT;if("%"===t&&this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT}return this.tok.T_COMMENT},T_DOC_COMMENT(){let t=this.input(),e=this.tok.T_COMMENT;if("*"===t){if(t=this.input(),this.is_WHITESPACE()&&(e=this.tok.T_DOC_COMMENT),"/"===t)return e;this.unput(1)}for(;this.offset<this.size;)if(t=this.input(),"*"===t&&"/"===this._input[this.offset]){this.input();break}return e}},o={nextINITIAL(){return this.conditionStack.length>1&&"INITIAL"===this.conditionStack[this.conditionStack.length-1]?this.popState():this.begin("ST_IN_SCRIPTING"),this},matchINITIAL(){for(;this.offset<this.size;){let t=this.input();if("<"==t)if(t=this.ahead(1),"?"==t){if(this.tryMatch("?=")){this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}if(this.tryMatchCaseless("?php")&&(t=this._input[this.offset+4]," "===t||"\t"===t||"\n"===t||"\r"===t)){this.unput(1).appendToken(this.tok.T_OPEN_TAG,6).nextINITIAL();break}if(this.short_tags){this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}else if(this.asp_tags&&"%"==t){if(this.tryMatch("%=")){this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}return this.yytext.length>0&&this.tok.T_INLINE_HTML}};var h={consume_NUM(){let t=this.yytext[0],e="."===t;if("0"===t)if(t=this.input(),"x"===t||"X"===t){if(t=this.input(),"_"!==t&&this.is_HEX())return this.consume_HNUM();this.unput(t?2:1)}else if("b"===t||"B"===t){if(t=this.input(),"_"!==t&&"0"===t||"1"===t)return this.consume_BNUM();this.unput(t?2:1)}else if("o"===t||"O"===t){if(t=this.input(),"_"!==t&&this.is_OCTAL())return this.consume_ONUM();this.unput(t?2:1)}else this.is_NUM()||t&&this.unput(1);for(;this.offset<this.size;){const s=t;if(t=this.input(),"_"===t){if("_"===s){this.unput(2);break}if("."===s){this.unput(1);break}if("e"===s||"E"===s){this.unput(2);break}}else{if("."===t){if(e){this.unput(1);break}if("_"===s){this.unput(2);break}e=!0;continue}if("e"===t||"E"===t){if("_"===s){this.unput(1);break}let e=2;if(t=this.input(),"+"!==t&&"-"!==t||(e=3,t=this.input()),this.is_NUM_START())return this.consume_LNUM(),this.tok.T_DNUMBER;this.unput(t?e:e-1);break}}if(!this.is_NUM()){t&&this.unput(1);break}}return e?this.tok.T_DNUMBER:this.yytext.length<9||this.yytext.length<10||10==this.yytext.length&&this.yytext<"2147483648"?this.tok.T_LNUMBER:this.tok.T_DNUMBER},consume_HNUM(){for(;this.offset<this.size;){const t=this.input();if(!this.is_HEX()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_LNUM(){for(;this.offset<this.size;){const t=this.input();if(!this.is_NUM()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_BNUM(){let t;for(;this.offset<this.size;)if(t=this.input(),"0"!==t&&"1"!==t&&"_"!==t){t&&this.unput(1);break}return this.tok.T_LNUMBER},consume_ONUM(){for(;this.offset<this.size;){const t=this.input();if(!this.is_OCTAL()){t&&this.unput(1);break}}return this.tok.T_LNUMBER}},a={matchST_LOOKING_FOR_PROPERTY(){let t=this.input();if("-"===t){if(t=this.input(),">"===t)return this.tok.T_OBJECT_OPERATOR;t&&this.unput(1)}else{if(this.is_WHITESPACE())return this.tok.T_WHITESPACE;if(this.is_LABEL_START())return this.consume_LABEL(),this.popState(),this.tok.T_STRING}return this.popState(),t&&this.unput(1),!1},matchST_LOOKING_FOR_VARNAME(){let t=this.input();if(this.popState(),this.begin("ST_IN_SCRIPTING"),this.is_LABEL_START()){if(this.consume_LABEL(),t=this.input(),"["===t||"}"===t)return this.unput(1),this.tok.T_STRING_VARNAME;this.unput(this.yytext.length)}else t&&this.unput(1);return!1},matchST_VAR_OFFSET(){const t=this.input();if(this.is_NUM_START())return this.consume_NUM(),this.tok.T_NUM_STRING;if("]"===t)return this.popState(),"]";if("$"===t){if(this.input(),this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_VARIABLE;throw new Error("Unexpected terminal")}if(this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_STRING;if(this.is_WHITESPACE()||"\\"===t||"'"===t||"#"===t)return this.tok.T_ENCAPSED_AND_WHITESPACE;if("["===t||"{"===t||"}"===t||'"'===t||"`"===t||this.is_TOKEN())return t;throw new Error("Unexpected terminal")}},c={matchST_IN_SCRIPTING(){let t=this.input();switch(t){case" ":case"\t":case"\n":case"\r":case"\r\n":return this.T_WHITESPACE();case"#":return this.version>=800&&"["===this._input[this.offset]?(this.input(),this.attributeListDepth[++this.attributeIndex]=0,this.begin("ST_ATTRIBUTE"),this.tok.T_ATTRIBUTE):this.T_COMMENT();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case'"':return this.ST_DOUBLE_QUOTES();case"`":return this.begin("ST_BACKQUOTE"),"`";case"?":if(!this.aspTagMode&&this.tryMatch(">")){this.input();const t=this._input[this.offset];return"\n"!==t&&"\r"!==t||this.input(),this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG}return this.consume_TOKEN();case"%":return this.aspTagMode&&">"===this._input[this.offset]?(this.input(),t=this._input[this.offset],"\n"!==t&&"\r"!==t||this.input(),this.aspTagMode=!1,this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG):this.consume_TOKEN();case"{":return this.begin("ST_IN_SCRIPTING"),"{";case"}":return this.conditionStack.length>2&&this.popState(),"}";default:if("."===t){if(t=this.input(),this.is_NUM_START())return this.consume_NUM();t&&this.unput(1)}if(this.is_NUM_START())return this.consume_NUM();if(this.is_LABEL_START())return this.consume_LABEL().T_STRING();if(this.is_TOKEN())return this.consume_TOKEN()}throw new Error('Bad terminal sequence "'+t+'" at line '+this.yylineno+" (offset "+this.offset+")")},T_WHITESPACE(){for(;this.offset<this.size;){const t=this.input();if(" "!==t&&"\t"!==t&&"\n"!==t&&"\r"!==t){t&&this.unput(1);break}}return this.tok.T_WHITESPACE}};const l=["\n","\r"],_=["\n","\r",";"],u=_.concat(["\t"," ",",","]",")","/","=","!","."]);var p={T_CONSTANT_ENCAPSED_STRING(){let t;for(;this.offset<this.size;)if(t=this.input(),"\\"==t)this.input();else if("'"==t)break;return this.tok.T_CONSTANT_ENCAPSED_STRING},is_HEREDOC(){const t=this.offset;if("<"===this._input[this.offset-1]&&"<"===this._input[this.offset]&&"<"===this._input[this.offset+1]){if(this.offset+=3,this.is_TABSPACE())for(;this.offset<this.size&&(this.offset++,this.is_TABSPACE()););let e=this._input[this.offset-1];if("'"===e||'"'===e?this.offset++:e=null,this.is_LABEL_START()){let s=this.offset-1;for(;this.offset<this.size&&(this.offset++,this.is_LABEL()););const i=this._input.substring(s,this.offset-1);if((!e||e===this._input[this.offset-1])&&(e&&this.offset++,l.includes(this._input[this.offset-1])))return this.heredoc_label.label=i,this.heredoc_label.length=i.length,this.heredoc_label.finished=!1,s=this.offset-t,this.offset=t,this.consume(s),"'"===e?this.begin("ST_NOWDOC"):this.begin("ST_HEREDOC"),this.prematch_ENDOFDOC(),this.tok.T_START_HEREDOC}}return this.offset=t,!1},ST_DOUBLE_QUOTES(){let t;for(;this.offset<this.size;)if(t=this.input(),"\\"==t)this.input();else{if('"'==t)break;if("$"==t){if(t=this.input(),"{"==t||this.is_LABEL_START()){this.unput(2);break}t&&this.unput(1)}else if("{"==t){if(t=this.input(),"$"==t){this.unput(2);break}t&&this.unput(1)}}if('"'==t)return this.tok.T_CONSTANT_ENCAPSED_STRING;{let t=1;return"b"!==this.yytext[0]&&"B"!==this.yytext[0]||(t=2),this.yytext.length>2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-t),this.unput(this.yytext.length-t),this.begin("ST_DOUBLE_QUOTES"),this.yytext}},isDOC_MATCH(t,e){const s=this._input[t-2];if(!l.includes(s))return!1;let i=!1,n=!1,r=0,o=this._input[t-1];if(this.version>=703){for(;"\t"===o||" "===o;)" "===o?i=!0:"\t"===o&&(n=!0),o=this._input[t+r],r++;if(t+=r,l.includes(this._input[t-1]))return!1}if(this._input.substring(t-1,t-1+this.heredoc_label.length)===this.heredoc_label.label){const s=this._input[t-1+this.heredoc_label.length];if((this.version>=703?u:_).includes(s)){if(e){if(this.consume(r),i&&n)throw new Error("Parse error: mixing spaces and tabs in ending marker at line "+this.yylineno+" (offset "+this.offset+")")}else this.heredoc_label.indentation=r,this.heredoc_label.indentation_uses_spaces=i,this.heredoc_label.first_encaps_node=!0;return!0}}return!1},prematch_ENDOFDOC(){this.heredoc_label.indentation_uses_spaces=!1,this.heredoc_label.indentation=0,this.heredoc_label.first_encaps_node=!0;let t=this.offset+1;for(;t<this._input.length;){if(this.isDOC_MATCH(t,!1))return;if(!l.includes(this._input[t-1]))for(;!l.includes(this._input[t++])&&t<this._input.length;);t++}},matchST_NOWDOC(){if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length),this.popState(),this.tok.T_END_HEREDOC;let t=this._input[this.offset-1];for(;this.offset<this.size;)if(l.includes(t)){if(t=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else t=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_HEREDOC(){let t=this.input();if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length-1),this.popState(),this.tok.T_END_HEREDOC;for(;this.offset<this.size;)if("\\"===t&&(t=this.input(),l.includes(t)||(t=this.input())),l.includes(t)){if(t=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){const t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}}else if("{"===t){if(t=this.input(),"$"===t)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN)}else t=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},consume_VARIABLE(){this.consume_LABEL();const t=this.input();if("["==t)return this.unput(1),this.begin("ST_VAR_OFFSET"),this.tok.T_VARIABLE;if("-"===t){if(">"===this.input())return this.input(),this.is_LABEL_START()&&this.begin("ST_LOOKING_FOR_PROPERTY"),this.unput(3),this.tok.T_VARIABLE;this.unput(2)}else t&&this.unput(1);return this.tok.T_VARIABLE},matchST_BACKQUOTE(){let t=this.input();if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){return this.consume_VARIABLE()}}else if("{"===t){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if("`"===t)return this.popState(),"`";for(;this.offset<this.size;){if("\\"===t)this.input();else{if("`"===t){this.unput(1),this.popState(),this.appendToken("`",1);break}if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){const t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}continue}if("{"===t){if(t=this.input(),"$"===t)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);continue}}t=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_DOUBLE_QUOTES(){let t=this.input();if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){return this.consume_VARIABLE()}}else if("{"===t){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if('"'===t)return this.popState(),'"';for(;this.offset<this.size;){if("\\"===t)this.input();else{if('"'===t){this.unput(1),this.popState(),this.appendToken('"',1);break}if("$"===t){if(t=this.input(),"{"===t)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){const t=this.offset,e=this.consume_VARIABLE();return this.yytext.length>this.offset-t+2?(this.appendToken(e,this.offset-t+2),this.unput(this.offset-t+2),this.tok.T_ENCAPSED_AND_WHITESPACE):e}t&&this.unput(1)}else if("{"===t){if(t=this.input(),"$"===t)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);t&&this.unput(1)}}t=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE}},d={T_STRING(){const t=this.yytext.toLowerCase();let e=this.keywords[t];if("number"!=typeof e)if("yield"===t)this.version>=700&&this.tryMatch(" from")?(this.consume(5),e=this.tok.T_YIELD_FROM):e=this.tok.T_YIELD;else if(e=this.tok.T_STRING,"b"===t||"B"===t){const t=this.input();if('"'===t)return this.ST_DOUBLE_QUOTES();if("'"===t)return this.T_CONSTANT_ENCAPSED_STRING();t&&this.unput(1)}if(e===this.tok.T_ENUM){if(this.version<801)return this.tok.T_STRING;const t=this.offset;let e=this.input();for(;" "==e;)e=this.input();let s=!1;if(this.is_LABEL_START()){for(;this.is_LABEL();)e+=this.input();const t=e.slice(0,-1).toLowerCase();s="extends"!==t&&"implements"!==t}return this.unput(this.offset-t),s?this.tok.T_ENUM:this.tok.T_STRING}if(this.offset<this.size&&e!==this.tok.T_YIELD_FROM){let s=this.input();if("\\"===s){e="namespace"===t?this.tok.T_NAME_RELATIVE:this.tok.T_NAME_QUALIFIED;do{if("{"===this._input[this.offset]){this.input();break}this.consume_LABEL(),s=this.input()}while("\\"===s)}s&&this.unput(1)}return e},consume_TOKEN(){const t=this._input[this.offset-1],e=this.tokenTerminals[t];return e?e.apply(this,[]):this.yytext},tokenTerminals:{$(){return this.offset++,this.is_LABEL_START()?(this.offset--,this.consume_LABEL(),this.tok.T_VARIABLE):(this.offset--,"$")},"-"(){const t=this._input[this.offset];return">"===t?(this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_OBJECT_OPERATOR):"-"===t?(this.input(),this.tok.T_DEC):"="===t?(this.input(),this.tok.T_MINUS_EQUAL):"-"},"\\"(){if(this.offset<this.size){if(this.input(),this.is_LABEL_START()){let t;do{if("{"===this._input[this.offset]){this.input();break}this.consume_LABEL(),t=this.input()}while("\\"===t);return this.unput(1),this.tok.T_NAME_FULLY_QUALIFIED}this.unput(1)}return this.tok.T_NS_SEPARATOR},"/"(){return"="===this._input[this.offset]?(this.input(),this.tok.T_DIV_EQUAL):"/"},":"(){return":"===this._input[this.offset]?(this.input(),this.tok.T_DOUBLE_COLON):":"},"("(){const t=this.offset;if(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this.is_LABEL_START()){const t=this.yytext.length;this.consume_LABEL();const e=this.yytext.substring(t-1).toLowerCase(),s=this.castKeywords[e];if("number"==typeof s&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return s}return this.unput(this.offset-t),"("},"="(){const t=this._input[this.offset];return">"===t?(this.input(),this.tok.T_DOUBLE_ARROW):"="===t?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_IDENTICAL):(this.input(),this.tok.T_IS_EQUAL):"="},"+"(){const t=this._input[this.offset];return"+"===t?(this.input(),this.tok.T_INC):"="===t?(this.input(),this.tok.T_PLUS_EQUAL):"+"},"!"(){return"="===this._input[this.offset]?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_NOT_IDENTICAL):(this.input(),this.tok.T_IS_NOT_EQUAL):"!"},"?"(){return this.version>=700&&"?"===this._input[this.offset]?this.version>=704&&"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_COALESCE_EQUAL):(this.input(),this.tok.T_COALESCE):this.version>=800&&"-"===this._input[this.offset]&&">"===this._input[this.offset+1]?(this.consume(1),this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_NULLSAFE_OBJECT_OPERATOR):"?"},"<"(){let t=this._input[this.offset];return"<"===t?(t=this._input[this.offset+1],"="===t?(this.consume(2),this.tok.T_SL_EQUAL):"<"===t&&this.is_HEREDOC()?this.tok.T_START_HEREDOC:(this.input(),this.tok.T_SL)):"="===t?(this.input(),this.version>=700&&">"===this._input[this.offset]?(this.input(),this.tok.T_SPACESHIP):this.tok.T_IS_SMALLER_OR_EQUAL):">"===t?(this.input(),this.tok.T_IS_NOT_EQUAL):"<"},">"(){let t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):">"===t?(t=this._input[this.offset+1],"="===t?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR)):">"},"*"(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_MUL_EQUAL):"*"===t?(this.input(),"="===this._input[this.offset]?(this.input(),this.tok.T_POW_EQUAL):this.tok.T_POW):"*"},"."(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_CONCAT_EQUAL):"."===t&&"."===this._input[this.offset+1]?(this.consume(2),this.tok.T_ELLIPSIS):"."},"%"(){return"="===this._input[this.offset]?(this.input(),this.tok.T_MOD_EQUAL):"%"},"&"(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_AND_EQUAL):"&"===t?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|"(){const t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_OR_EQUAL):"|"===t?(this.input(),this.tok.T_BOOLEAN_OR):"|"},"^"(){return"="===this._input[this.offset]?(this.input(),this.tok.T_XOR_EQUAL):"^"}}};var f={is_NUM(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||95===t},is_NUM_START(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<58},is_LABEL(){const t=this._input.charCodeAt(this.offset-1);return t>96&&t<123||t>64&&t<91||95===t||t>47&&t<58||t>126},is_LABEL_START(){const t=this._input.charCodeAt(this.offset-1);return t>64&&t<91||(t>96&&t<123||(95===t||t>126))},consume_LABEL(){for(;this.offset<this.size;){const t=this.input();if(!this.is_LABEL()){t&&this.unput(1);break}}return this},is_TOKEN(){const t=this._input[this.offset-1];return-1!==";:,.\\[]()|^&+-/*=%!~$<>?@".indexOf(t)},is_WHITESPACE(){const t=this._input[this.offset-1];return" "===t||"\t"===t||"\n"===t||"\r"===t},is_TABSPACE(){const t=this._input[this.offset-1];return" "===t||"\t"===t},consume_TABSPACE(){for(;this.offset<this.size;){const t=this.input();if(!this.is_TABSPACE()){t&&this.unput(1);break}}return this},is_HEX(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||(t>64&&t<71||(t>96&&t<103||95===t))},is_OCTAL(){const t=this._input.charCodeAt(this.offset-1);return t>47&&t<56||95===t}};const k=function(t){this.engine=t,this.tok=this.engine.tokens.names,this.EOF=1,this.debug=!1,this.all_tokens=!0,this.comment_tokens=!1,this.mode_eval=!1,this.asp_tags=!1,this.short_tags=!1,this.version=803,this.yyprevcol=0,this.keywords={__class__:this.tok.T_CLASS_C,__trait__:this.tok.T_TRAIT_C,__function__:this.tok.T_FUNC_C,__method__:this.tok.T_METHOD_C,__line__:this.tok.T_LINE,__file__:this.tok.T_FILE,__dir__:this.tok.T_DIR,__namespace__:this.tok.T_NS_C,exit:this.tok.T_EXIT,die:this.tok.T_EXIT,function:this.tok.T_FUNCTION,const:this.tok.T_CONST,return:this.tok.T_RETURN,try:this.tok.T_TRY,catch:this.tok.T_CATCH,finally:this.tok.T_FINALLY,throw:this.tok.T_THROW,if:this.tok.T_IF,elseif:this.tok.T_ELSEIF,endif:this.tok.T_ENDIF,else:this.tok.T_ELSE,while:this.tok.T_WHILE,endwhile:this.tok.T_ENDWHILE,do:this.tok.T_DO,for:this.tok.T_FOR,endfor:this.tok.T_ENDFOR,foreach:this.tok.T_FOREACH,endforeach:this.tok.T_ENDFOREACH,declare:this.tok.T_DECLARE,enddeclare:this.tok.T_ENDDECLARE,instanceof:this.tok.T_INSTANCEOF,as:this.tok.T_AS,switch:this.tok.T_SWITCH,endswitch:this.tok.T_ENDSWITCH,case:this.tok.T_CASE,default:this.tok.T_DEFAULT,break:this.tok.T_BREAK,continue:this.tok.T_CONTINUE,goto:this.tok.T_GOTO,echo:this.tok.T_ECHO,print:this.tok.T_PRINT,class:this.tok.T_CLASS,interface:this.tok.T_INTERFACE,trait:this.tok.T_TRAIT,enum:this.tok.T_ENUM,extends:this.tok.T_EXTENDS,implements:this.tok.T_IMPLEMENTS,new:this.tok.T_NEW,clone:this.tok.T_CLONE,var:this.tok.T_VAR,eval:this.tok.T_EVAL,include:this.tok.T_INCLUDE,include_once:this.tok.T_INCLUDE_ONCE,require:this.tok.T_REQUIRE,require_once:this.tok.T_REQUIRE_ONCE,namespace:this.tok.T_NAMESPACE,use:this.tok.T_USE,insteadof:this.tok.T_INSTEADOF,global:this.tok.T_GLOBAL,isset:this.tok.T_ISSET,empty:this.tok.T_EMPTY,__halt_compiler:this.tok.T_HALT_COMPILER,static:this.tok.T_STATIC,abstract:this.tok.T_ABSTRACT,final:this.tok.T_FINAL,private:this.tok.T_PRIVATE,protected:this.tok.T_PROTECTED,public:this.tok.T_PUBLIC,unset:this.tok.T_UNSET,list:this.tok.T_LIST,array:this.tok.T_ARRAY,callable:this.tok.T_CALLABLE,or:this.tok.T_LOGICAL_OR,and:this.tok.T_LOGICAL_AND,xor:this.tok.T_LOGICAL_XOR,match:this.tok.T_MATCH,readonly:this.tok.T_READ_ONLY},this.castKeywords={int:this.tok.T_INT_CAST,integer:this.tok.T_INT_CAST,real:this.tok.T_DOUBLE_CAST,double:this.tok.T_DOUBLE_CAST,float:this.tok.T_DOUBLE_CAST,string:this.tok.T_STRING_CAST,binary:this.tok.T_STRING_CAST,array:this.tok.T_ARRAY_CAST,object:this.tok.T_OBJECT_CAST,bool:this.tok.T_BOOL_CAST,boolean:this.tok.T_BOOL_CAST,unset:this.tok.T_UNSET_CAST}};k.prototype.setInput=function(t){return this._input=t,this.size=t.length,this.yylineno=1,this.offset=0,this.yyprevcol=0,this.yytext="",this.yylloc={first_offset:0,first_line:1,first_column:0,prev_offset:0,prev_line:1,prev_column:0,last_line:1,last_column:0},this.tokens=[],this.version>703?this.keywords.fn=this.tok.T_FN:delete this.keywords.fn,this.done=this.offset>=this.size,!this.all_tokens&&this.mode_eval?(this.conditionStack=["INITIAL"],this.begin("ST_IN_SCRIPTING")):(this.conditionStack=[],this.begin("INITIAL")),this.heredoc_label={label:"",length:0,indentation:0,indentation_uses_spaces:!1,finished:!1,first_encaps_node:!1,toString(){this.label}},this},k.prototype.input=function(){const t=this._input[this.offset];return t?(this.yytext+=t,this.offset++,"\r"===t&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++),"\n"===t||"\r"===t?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++,t):""},k.prototype.unput=function(t){if(1===t)this.offset--,"\n"===this._input[this.offset]&&"\r"===this._input[this.offset-1]&&(this.offset--,t++),"\r"===this._input[this.offset]||"\n"===this._input[this.offset]?(this.yylloc.last_line--,this.yylineno--,this.yylloc.last_column=this.yyprevcol):this.yylloc.last_column--,this.yytext=this.yytext.substring(0,this.yytext.length-t);else if(t>0)if(this.offset-=t,t<this.yytext.length){this.yytext=this.yytext.substring(0,this.yytext.length-t),this.yylloc.last_line=this.yylloc.first_line,this.yylloc.last_column=this.yyprevcol=this.yylloc.first_column;for(let t=0;t<this.yytext.length;t++){let e=this.yytext[t];"\r"===e?(e=this.yytext[++t],this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0,"\n"!==e&&("\r"===e?this.yylloc.last_line++:this.yylloc.last_column++)):"\n"===e?(this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0):this.yylloc.last_column++}this.yylineno=this.yylloc.last_line}else this.yytext="",this.yylloc.last_line=this.yylineno=this.yylloc.first_line,this.yylloc.last_column=this.yylloc.first_column;return this},k.prototype.tryMatch=function(t){return t===this.ahead(t.length)},k.prototype.tryMatchCaseless=function(t){return t===this.ahead(t.length).toLowerCase()},k.prototype.ahead=function(t){let e=this._input.substring(this.offset,this.offset+t);return"\r"===e[e.length-1]&&"\n"===this._input[this.offset+t+1]&&(e+="\n"),e},k.prototype.consume=function(t){for(let e=0;e<t;e++){const t=this._input[this.offset];if(!t)break;this.yytext+=t,this.offset++,"\r"===t&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++,e++),"\n"===t||"\r"===t?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++}return this},k.prototype.getState=function(){return{yytext:this.yytext,offset:this.offset,yylineno:this.yylineno,yyprevcol:this.yyprevcol,yylloc:{first_offset:this.yylloc.first_offset,first_line:this.yylloc.first_line,first_column:this.yylloc.first_column,last_line:this.yylloc.last_line,last_column:this.yylloc.last_column},heredoc_label:this.heredoc_label}},k.prototype.setState=function(t){return this.yytext=t.yytext,this.offset=t.offset,this.yylineno=t.yylineno,this.yyprevcol=t.yyprevcol,this.yylloc=t.yylloc,t.heredoc_label&&(this.heredoc_label=t.heredoc_label),this},k.prototype.appendToken=function(t,e){return this.tokens.push([t,e]),this},k.prototype.lex=function(){this.yylloc.prev_offset=this.offset,this.yylloc.prev_line=this.yylloc.last_line,this.yylloc.prev_column=this.yylloc.last_column;let t=this.next()||this.lex();if(!this.all_tokens){for(;t===this.tok.T_WHITESPACE||!this.comment_tokens&&(t===this.tok.T_COMMENT||t===this.tok.T_DOC_COMMENT)||t===this.tok.T_OPEN_TAG;)t=this.next()||this.lex();if(t==this.tok.T_OPEN_TAG_WITH_ECHO)return this.tok.T_ECHO;if(t===this.tok.T_CLOSE_TAG)return";"}return this.yylloc.prev_offset||(this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column),t},k.prototype.begin=function(t){if(this.conditionStack.push(t),this.curCondition=t,this.stateCb=this["match"+t],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+t+'"');return this},k.prototype.popState=function(){const t=this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0];if(this.curCondition=this.conditionStack[this.conditionStack.length-1],this.stateCb=this["match"+this.curCondition],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+this.curCondition+'"');return t},k.prototype.next=function(){let t;if(this._input||(this.done=!0),this.yylloc.first_offset=this.offset,this.yylloc.first_line=this.yylloc.last_line,this.yylloc.first_column=this.yylloc.last_column,this.yytext="",this.done)return this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column,this.EOF;if(this.tokens.length>0?(t=this.tokens.shift(),"object"==typeof t[1]?this.setState(t[1]):this.consume(t[1]),t=t[0]):t=this.stateCb.apply(this,[]),this.offset>=this.size&&0===this.tokens.length&&(this.done=!0),this.debug){let e=t;e="number"==typeof e?this.engine.tokens.values[e]:'"'+e+'"';const s=new Error(e+"\tfrom "+this.yylloc.first_line+","+this.yylloc.first_column+"\t - to "+this.yylloc.last_line+","+this.yylloc.last_column+'\t"'+this.yytext+'"');console.error(s.stack)}return t},[n,r,o,h,a,c,p,d,f].forEach((function(t){for(const e in t)k.prototype[e]=t[e]}));var T=k;var x=function(t,e,s){this.line=t,this.column=e,this.offset=s},E={read_array(){let t=null,e=!1;const s=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),t=")"):(e=!0,t="]");let i=[];return this.next().token!==t&&(i=this.read_array_pair_list(e)),this.expect(t),this.next(),s(e,i)},read_array_pair_list(t){const e=this;return this.read_list((function(){return e.read_array_pair(t)}),",",!0)},read_array_pair(t){if(!t&&")"===this.token||t&&"]"===this.token)return;if(","===this.token)return this.node("noop")();const e=this.node("entry");let s=null,i=null,n=!1,r=!1;if("&"===this.token)this.next(),n=!0,i=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),"&"===this.token&&this.error(),r=!0,i=this.read_expr();else{const t=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),s=t,"&"===this.token?(this.next(),n=!0,i=this.read_variable(!0,!1)):i=this.read_expr()):i=t}return e(s,i,n,r)}},m={read_class_declaration_statement(t){const e=this.node("class"),s=this.read_class_modifiers();if(this.token!==this.tok.T_CLASS)return this.error(this.tok.T_CLASS),this.next(),null;this.next().expect(this.tok.T_STRING);let i=this.node("identifier");const n=this.text();this.next(),i=i(n);const r=this.read_extends_from(),o=this.read_implements_list();this.expect("{");const h=e(i,r,o,this.next().read_class_body(!0,!1),s);return t&&(h.attrGroups=t),h},read_class_modifiers(){const t=this.read_class_modifier({readonly:0,final_or_abstract:0});return[0,0,t.final_or_abstract,t.readonly]},read_class_modifier(t){return this.token===this.tok.T_READ_ONLY?(this.next(),t.readonly=1,t=this.read_class_modifier(t)):0===t.final_or_abstract&&this.token===this.tok.T_ABSTRACT?(this.next(),t.final_or_abstract=1,t=this.read_class_modifier(t)):0===t.final_or_abstract&&this.token===this.tok.T_FINAL&&(this.next(),t.final_or_abstract=2,t=this.read_class_modifier(t)),t},read_class_body(t,e){let s=[],i=[];for(;this.token!==this.EOF&&"}"!==this.token;){if(this.token===this.tok.T_COMMENT){s.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){s.push(this.read_doc_comment());continue}if(this.token===this.tok.T_USE){s=s.concat(this.read_trait_use_statement());continue}if(e&&this.token===this.tok.T_CASE){const t=this.read_enum_case();this.expect(";")&&this.next(),s=s.concat(t);continue}this.token===this.tok.T_ATTRIBUTE&&(i=this.read_attr_list());const n=this.position(),r=this.read_member_flags(!1);if(this.token!==this.tok.T_CONST)if(t&&this.token===this.tok.T_VAR&&(this.next().expect(this.tok.T_VARIABLE),r[0]=null,r[1]=0),this.token===this.tok.T_FUNCTION)s.push(this.read_function(!1,r,i,n)),i=[];else if(t&&(this.token===this.tok.T_VARIABLE||this.version>=801&&this.token===this.tok.T_READ_ONLY||this.version>=704&&("?"===this.token||this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE||this.token===this.tok.T_NAMESPACE||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING))){const t=this.read_variable_list(r,i);i=[],this.expect(";"),this.next(),s=s.concat(t)}else this.error([this.tok.T_CONST,...t?[this.tok.T_VARIABLE]:[],...e?[this.tok.T_CASE]:[],this.tok.T_FUNCTION]),this.next();else{const t=this.read_constant_list(r,i);this.expect(";")&&this.next(),s=s.concat(t)}}return this.expect("}"),this.next(),s},read_variable_list(t,e){const s=this.node("propertystatement"),i=this.read_list((function(){const t=this.node("property");let s=!1;this.token===this.tok.T_READ_ONLY&&(s=!0,this.next());const[i,n]=this.read_optional_type();this.expect(this.tok.T_VARIABLE);let r=this.node("identifier");const o=this.text().substring(1);this.next(),r=r(o);let h=null;return this.expect([",",";","="]),"="===this.token&&(h=this.next().read_expr()),t(r,h,s,i,n,e||[])}),",");return s(null,i,t)},read_constant_list(t,e){this.expect(this.tok.T_CONST)&&this.next();const[s,i]=this.version>=803?this.read_optional_type():[!1,null],n=this.node("classconstant"),r=this.read_list((function(){const t=this.node("constant");let e=null,s=null;if(this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){e=this.node("identifier");const t=this.text();this.next(),e=e(t)}else this.expect("IDENTIFIER");return this.expect("=")&&(s=this.next().read_expr()),t(e,s)}),",");return n(null,r,t,s,i,e||[])},read_member_flags(t){const e=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){let s=0,i=0;do{switch(this.token){case this.tok.T_PUBLIC:s=0,i=0;break;case this.tok.T_PROTECTED:s=0,i=1;break;case this.tok.T_PRIVATE:s=0,i=2;break;case this.tok.T_STATIC:s=1,i=1;break;case this.tok.T_ABSTRACT:s=2,i=1;break;case this.tok.T_FINAL:s=2,i=2}t&&(0===s&&2===i?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),i=-1):2===s&&1===i&&(this.error(),i=-1)),-1!==e[s]?this.error():-1!==i&&(e[s]=i)}while(this.next().is("T_MEMBER_FLAGS"))}return-1===e[1]&&(e[1]=0),-1===e[2]&&(e[2]=0),e},read_optional_type(){const t="?"===this.token;if(t&&this.next(),"="===this.peekSkipComments())return[!1,null];let e=this.read_types();if(t&&!e&&this.raiseError("Expecting a type definition combined with nullable operator"),!t&&!e)return[!1,null];if("|"===this.token){e=[e];do{this.next();const t=this.read_type();if(!t){this.raiseError("Expecting a type definition");break}e.push(t)}while("|"===this.token)}return[t,e]},peekSkipComments(){const t=this.lexer.getState();let e;do{e=this.lexer.lex()}while(e===this.tok.T_COMMENT||e===this.tok.T_WHITESPACE);return this.lexer.setState(t),e},read_interface_declaration_statement(t){const e=this.node("interface");if(this.token!==this.tok.T_INTERFACE)return this.error(this.tok.T_INTERFACE),this.next(),null;this.next().expect(this.tok.T_STRING);let s=this.node("identifier");const i=this.text();this.next(),s=s(i);const n=this.read_interface_extends_list();this.expect("{");return e(s,n,this.next().read_interface_body(),t||[])},read_interface_body(){let t=[],e=[];for(;this.token!==this.EOF&&"}"!==this.token;){if(this.token===this.tok.T_COMMENT){t.push(this.read_comment());continue}if(this.token===this.tok.T_DOC_COMMENT){t.push(this.read_doc_comment());continue}const s=this.position();e=this.read_attr_list();const i=this.read_member_flags(!0);if(this.token===this.tok.T_CONST){const s=this.read_constant_list(i,e);this.expect(";")&&this.next(),t=t.concat(s),e=[]}else if(this.token===this.tok.T_FUNCTION){const n=this.read_function_declaration(2,i,e,s);n.parseFlags(i),t.push(n),this.expect(";")&&this.next(),e=[]}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}return this.expect("}")&&this.next(),t},read_trait_declaration_statement(){const t=this.node("trait");if(this.token!==this.tok.T_TRAIT)return this.error(this.tok.T_TRAIT),this.next(),null;this.next().expect(this.tok.T_STRING);let e=this.node("identifier");const s=this.text();this.next(),e=e(s),this.expect("{");return t(e,this.next().read_class_body(!0,!1))},read_trait_use_statement(){const t=this.node("traituse");this.expect(this.tok.T_USE)&&this.next();const e=[this.read_namespace_name()];let s=null;for(;","===this.token;)e.push(this.next().read_namespace_name());if("{"===this.token){for(s=[];this.next().token!==this.EOF&&"}"!==this.token;)s.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return t(e,s)},read_trait_use_alias(){const t=this.node();let e,s=null;if(this.is("IDENTIFIER")){e=this.node("identifier");const t=this.text();this.next(),e=e(t)}else if(e=this.read_namespace_name(),this.token===this.tok.T_DOUBLE_COLON)if(this.next(),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){s=e,e=this.node("identifier");const t=this.text();this.next(),e=e(t)}else this.expect(this.tok.T_STRING);else e=e.name;if(this.token===this.tok.T_INSTEADOF)return t("traitprecedence",s,e,this.next().read_name_list());if(this.token===this.tok.T_AS){let i=null,n=null;if(this.next().is("T_MEMBER_FLAGS")&&(i=this.read_member_flags()),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){n=this.node("identifier");const t=this.text();this.next(),n=n(t)}else!1===i&&this.expect(this.tok.T_STRING);return t("traitalias",s,e,n,i)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),t("traitalias",s,e,null,null)}},y={read_comment(){const t=this.text();let e=this.ast.prepare("/*"===t.substring(0,2)?"commentblock":"commentline",null,this);const s=this.lexer.yylloc.first_offset,i=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),e=e(t),e.offset=s,this.prev=i,e},read_doc_comment(){let t=this.ast.prepare("commentblock",null,this);const e=this.lexer.yylloc.first_offset,s=this.text(),i=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),t=t(s),t.offset=e,this.prev=i,t}},A={read_expr(t){const e=this.node();if("@"===this.token)return t||(t=this.next().read_expr()),e("silent",t);if(t||(t=this.read_expr_item()),"|"===this.token)return e("bin","|",t,this.next().read_expr());if("&"===this.token)return e("bin","&",t,this.next().read_expr());if("^"===this.token)return e("bin","^",t,this.next().read_expr());if("."===this.token)return e("bin",".",t,this.next().read_expr());if("+"===this.token)return e("bin","+",t,this.next().read_expr());if("-"===this.token)return e("bin","-",t,this.next().read_expr());if("*"===this.token)return e("bin","*",t,this.next().read_expr());if("/"===this.token)return e("bin","/",t,this.next().read_expr());if("%"===this.token)return e("bin","%",t,this.next().read_expr());if(this.token===this.tok.T_POW)return e("bin","**",t,this.next().read_expr());if(this.token===this.tok.T_SL)return e("bin","<<",t,this.next().read_expr());if(this.token===this.tok.T_SR)return e("bin",">>",t,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_OR)return e("bin","||",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_OR)return e("bin","or",t,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_AND)return e("bin","&&",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_AND)return e("bin","and",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_XOR)return e("bin","xor",t,this.next().read_expr());if(this.token===this.tok.T_IS_IDENTICAL)return e("bin","===",t,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_IDENTICAL)return e("bin","!==",t,this.next().read_expr());if(this.token===this.tok.T_IS_EQUAL)return e("bin","==",t,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_EQUAL)return e("bin","!=",t,this.next().read_expr());if("<"===this.token)return e("bin","<",t,this.next().read_expr());if(">"===this.token)return e("bin",">",t,this.next().read_expr());if(this.token===this.tok.T_IS_SMALLER_OR_EQUAL)return e("bin","<=",t,this.next().read_expr());if(this.token===this.tok.T_IS_GREATER_OR_EQUAL)return e("bin",">=",t,this.next().read_expr());if(this.token===this.tok.T_SPACESHIP)return e("bin","<=>",t,this.next().read_expr());if(this.token===this.tok.T_INSTANCEOF&&(t=e("bin","instanceof",t,this.next().read_class_name_reference()),";"!==this.token&&this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF&&(t=this.read_expr(t))),this.token===this.tok.T_COALESCE)return e("bin","??",t,this.next().read_expr());if("?"===this.token){let s=null;return":"!==this.next().token&&(s=this.read_expr()),this.expect(":")&&this.next(),e("retif",t,s,this.read_expr())}return e.destroy(t),t},read_expr_cast(t){return this.node("cast")(t,this.text(),this.next().read_expr())},read_isset_variable(){return this.read_expr()},read_isset_variables(){return this.read_function_list(this.read_isset_variable,",")},read_internal_functions_in_yacc(){let t=null;switch(this.token){case this.tok.T_ISSET:{t=this.node("isset"),this.next().expect("(")&&this.next();const e=this.read_isset_variables();this.expect(")")&&this.next(),t=t(e)}break;case this.tok.T_EMPTY:{t=this.node("empty"),this.next().expect("(")&&this.next();const e=this.read_expr();this.expect(")")&&this.next(),t=t(e)}break;case this.tok.T_INCLUDE:t=this.node("include")(!1,!1,this.next().read_expr());break;case this.tok.T_INCLUDE_ONCE:t=this.node("include")(!0,!1,this.next().read_expr());break;case this.tok.T_EVAL:{t=this.node("eval"),this.next().expect("(")&&this.next();const e=this.read_expr();this.expect(")")&&this.next(),t=t(e)}break;case this.tok.T_REQUIRE:t=this.node("include")(!1,!0,this.next().read_expr());break;case this.tok.T_REQUIRE_ONCE:t=this.node("include")(!0,!0,this.next().read_expr())}return t},read_optional_expr(t){return this.token!==t?this.read_expr():null},read_exit_expr(){let t=null;return"("===this.token&&(this.next(),t=this.read_optional_expr(")"),this.expect(")")&&this.next()),t},read_expr_item(){let t,e,s=[];if("+"===this.token)return this.node("unary")("+",this.next().read_expr());if("-"===this.token)return this.node("unary")("-",this.next().read_expr());if("!"===this.token)return this.node("unary")("!",this.next().read_expr());if("~"===this.token)return this.node("unary")("~",this.next().read_expr());if("("===this.token)return e=this.next().read_expr(),e.parenthesizedExpression=!0,this.expect(")")&&this.next(),this.handleDereferencable(e);if("`"===this.token)return this.read_encapsed_string("`");if(this.token===this.tok.T_LIST){let e=null;const s=this.innerList;t=this.node("list"),s||(e=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);const i=this.read_array_pair_list(!1);this.expect(")")&&this.next();let n=!1;for(let t=0;t<i.length;t++)if(null!==i[t]&&"noop"!==i[t].kind){n=!0;break}return n||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),s?t(i,!1):(this.innerList=!1,this.expect("=")?e(t(i,!1),this.next().read_expr(),"="):t(i,!1))}if(this.token===this.tok.T_ATTRIBUTE&&(s=this.read_attr_list()),this.token===this.tok.T_CLONE)return this.node("clone")(this.next().read_expr());switch(this.token){case this.tok.T_INC:return this.node("pre")("+",this.next().read_variable(!1,!1));case this.tok.T_DEC:return this.node("pre")("-",this.next().read_variable(!1,!1));case this.tok.T_NEW:return e=this.read_new_expr(),this.token===this.tok.T_OBJECT_OPERATOR&&this.version<804&&this.raiseError("New without parenthesis is not allowed before PHP 8.4"),this.handleDereferencable(e);case this.tok.T_ISSET:case this.tok.T_EMPTY:case this.tok.T_INCLUDE:case this.tok.T_INCLUDE_ONCE:case this.tok.T_EVAL:case this.tok.T_REQUIRE:case this.tok.T_REQUIRE_ONCE:return this.read_internal_functions_in_yacc();case this.tok.T_MATCH:return this.read_match_expression();case this.tok.T_INT_CAST:return this.read_expr_cast("int");case this.tok.T_DOUBLE_CAST:return this.read_expr_cast("float");case this.tok.T_STRING_CAST:return this.read_expr_cast(-1!==this.text().indexOf("binary")?"binary":"string");case this.tok.T_ARRAY_CAST:return this.read_expr_cast("array");case this.tok.T_OBJECT_CAST:return this.read_expr_cast("object");case this.tok.T_BOOL_CAST:return this.read_expr_cast("bool");case this.tok.T_UNSET_CAST:return this.read_expr_cast("unset");case this.tok.T_THROW:this.version<800&&this.raiseError("PHP 8+ is required to use throw as an expression");return this.node("throw")(this.next().read_expr());case this.tok.T_EXIT:{const e="die"===this.lexer.yytext.toLowerCase();t=this.node("exit"),this.next();return t(this.read_exit_expr(),e)}case this.tok.T_PRINT:return this.node("print")(this.next().read_expr());case this.tok.T_YIELD:{let e=null,s=null;return t=this.node("yield"),this.next().is("EXPR")&&(e=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(s=e,e=this.next().read_expr())),t(e,s)}case this.tok.T_YIELD_FROM:return t=this.node("yieldfrom"),e=this.next().read_expr(),t(e);case this.tok.T_FN:case this.tok.T_FUNCTION:return this.read_inline_function(void 0,s);case this.tok.T_STATIC:{const t=[this.token,this.lexer.getState()];if(this.next(),this.token===this.tok.T_FUNCTION||this.version>=704&&this.token===this.tok.T_FN)return this.read_inline_function([0,1,0],s);this.lexer.tokens.push(t),this.next()}}if(this.is("VARIABLE")){t=this.node(),e=this.read_variable(!1,!1);const s="identifier"===e.kind||"staticlookup"===e.kind&&"identifier"===e.offset.kind;switch(this.token){case"=":return s&&this.error("VARIABLE"),"&"==this.next().token?this.read_assignref(t,e):t("assign",e,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return s&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"??=");case this.tok.T_INC:return s&&this.error("VARIABLE"),this.next(),t("post","+",e);case this.tok.T_DEC:return s&&this.error("VARIABLE"),this.next(),t("post","-",e);default:t.destroy(e)}}else{if(this.is("SCALAR")){if(t=this.node(),e=this.read_scalar(),"array"===e.kind&&e.shortForm&&"="===this.token){const s=this.convertToList(e);e.loc&&(s.loc=e.loc);return t("assign",s,this.next().read_expr(),"=")}return t.destroy(e),this.handleDereferencable(e)}this.error("EXPR"),this.next()}return e},convertToList(t){const e=t.items.map((t=>(t.value&&"array"===t.value.kind&&t.value.shortForm&&(t.value=this.convertToList(t.value)),t))),s=this.node("list")(e,!0);return t.loc&&(s.loc=t.loc),t.leadingComments&&(s.leadingComments=t.leadingComments),t.trailingComments&&(s.trailingComments=t.trailingComments),s},read_assignref(t,e){let s;return this.next(),this.token===this.tok.T_NEW?(this.version>=700&&this.error(),s=this.read_new_expr()):s=this.read_variable(!1,!1),t("assignref",e,s)},read_inline_function(t,e){if(this.token===this.tok.T_FUNCTION){const s=this.read_function(!0,t,e);return s.attrGroups=e,s}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");const s=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();const i=this.is_reference();this.expect("(")&&this.next();const n=this.read_parameter_list();this.expect(")")&&this.next();let r=!1,o=null;":"===this.token&&("?"===this.next().token&&(r=!0,this.next()),o=this.read_types()),this.expect(this.tok.T_DOUBLE_ARROW)&&this.next();const h=s(n,i,this.read_expr(),o,r,!!t);return h.attrGroups=e,h},read_match_expression(){const t=this.node("match");this.expect(this.tok.T_MATCH)&&this.next(),this.version<800&&this.raiseError("Match statements are not allowed before PHP 8");let e=null,s=[];return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),this.expect("{")&&this.next(),s=this.read_match_arms(),this.expect("}")&&this.next(),t(e,s)},read_match_arms(){return this.read_list((()=>this.read_match_arm()),",",!0)},read_match_arm(){if("}"!==this.token)return this.node("matcharm")(this.read_match_arm_conds(),this.read_expr())},read_match_arm_conds(){let t=[];if(this.token===this.tok.T_DEFAULT)t=null,this.next();else for(t.push(this.read_expr());","===this.token;){if(this.next(),this.token===this.tok.T_DOUBLE_ARROW)return this.next(),t;t.push(this.read_expr())}return this.expect(this.tok.T_DOUBLE_ARROW)&&this.next(),t},read_attribute(){const t=this.text();let e=[];return this.next(),"("===this.token&&(e=this.read_argument_list()),this.node("attribute")(t,e)},read_attr_list(){const t=[];if(this.token===this.tok.T_ATTRIBUTE)do{const e=this.node("attrgroup")([]);for(this.next(),e.attrs.push(this.read_attribute());","===this.token;)this.next(),"]"!==this.token&&e.attrs.push(this.read_attribute());t.push(e),this.expect("]"),this.next()}while(this.token===this.tok.T_ATTRIBUTE);return t},read_new_expr(){const t=this.node("new");this.expect(this.tok.T_NEW)&&this.next();let e=[];if("("===this.token){this.next();const s=this.read_expr();return this.expect(")"),this.next(),"("===this.token&&(e=this.read_argument_list()),t(s,e)}const s=this.read_attr_list();if(this.token===this.tok.T_CLASS){const i=this.node("class");"("===this.next().token&&(e=this.read_argument_list());const n=this.read_extends_from(),r=this.read_implements_list();let o=null;this.expect("{")&&(o=this.next().read_class_body(!0,!1));const h=i(null,n,r,o,[0,0,0]);return h.attrGroups=s,t(h,e)}let i=this.read_new_class_name();for(;"["===this.token;){const t=this.node("offsetlookup"),e=this.next().read_encaps_var_offset();this.expect("]")&&this.next(),i=t(i,e)}return"("===this.token&&(e=this.read_argument_list()),t(i,e)},read_new_class_name(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){let t=this.read_namespace_name(!0);return this.token===this.tok.T_DOUBLE_COLON&&(t=this.read_static_getter(t)),t}if(this.is("VARIABLE"))return this.read_variable(!0,!1);this.expect([this.tok.T_STRING,"VARIABLE"])},handleDereferencable(t){for(;this.token!==this.EOF;)if(this.token===this.tok.T_OBJECT_OPERATOR||this.token===this.tok.T_DOUBLE_COLON)t=this.recursive_variable_chain_scan(t,!1,!1,!0);else if(this.token===this.tok.T_CURLY_OPEN||"["===this.token)t=this.read_dereferencable(t);else{if("("!==this.token)return t;t=this.node("call")(t,this.read_argument_list())}return t}},N={read_enum_declaration_statement(t){const e=this.node("enum");if(!this.expect(this.tok.T_ENUM))return null;this.next().expect(this.tok.T_STRING);let s=this.node("identifier");const i=this.text();this.next(),s=s(i);const n=this.read_enum_value_type(),r=this.read_implements_list();this.expect("{");const o=e(s,n,r,this.next().read_class_body(!1,!0));return t&&(o.attrGroups=t),o},read_enum_value_type(){return":"===this.token?this.next().read_namespace_name():null},read_enum_case(){this.expect(this.tok.T_CASE);const t=this.node("enumcase");let e=this.node("identifier");const s=this.next().text();this.next(),e=e(s);const i="="===this.token?this.next().read_expr():null;return this.expect(";"),t(e,i)}},g={is_reference(){return"&"===this.token&&(this.next(),!0)},is_variadic(){return this.token===this.tok.T_ELLIPSIS&&(this.next(),!0)},read_function(t,e,s,i){const n=this.read_function_declaration(t?1:e?2:0,e&&1===e[1],s||[],i);return e&&1==e[2]?(n.parseFlags(e),this.expect(";")&&this.next()):(this.expect("{")&&(n.body=this.read_code_block(!1),n.loc&&n.body.loc&&(n.loc.end=n.body.loc.end)),!t&&e&&n.parseFlags(e)),n},read_function_declaration(t,e,s,i){let n="function";1===t?n="closure":2===t&&(n="method");const r=this.node(n);this.expect(this.tok.T_FUNCTION)&&this.next();const o=this.is_reference();let h=!1,a=[],c=null,l=!1;if(1!==t){const e=this.node("identifier");2===t?this.version>=700?this.token===this.tok.T_STRING||this.is("IDENTIFIER")?(h=this.text(),this.next()):this.version<704&&this.error("IDENTIFIER"):this.token===this.tok.T_STRING?(h=this.text(),this.next()):this.error("IDENTIFIER"):this.version>=700?this.token===this.tok.T_STRING?(h=this.text(),this.next()):this.version>=704?this.expect("(")||this.next():(this.error(this.tok.T_STRING),this.next()):(this.expect(this.tok.T_STRING)&&(h=this.text()),this.next()),h=e(h)}this.expect("(")&&this.next();const _=this.read_parameter_list("__construct"===h.name);this.expect(")")&&this.next(),1===t&&(a=this.read_lexical_vars()),":"===this.token&&("?"===this.next().token&&(l=!0,this.next()),c=this.read_types());const u=t=>(t.attrGroups=s||[],i&&t.loc&&(t.loc.start=i,t.loc.source&&(t.loc.source=this.lexer._input.substr(t.loc.start.offset,t.loc.end.offset-t.loc.start.offset))),t);return u(1===t?r(_,o,a,c,l,e):r(h,_,o,c,l))},read_lexical_vars(){let t=[];return this.token===this.tok.T_USE&&(this.next(),this.expect("(")&&this.next(),t=this.read_lexical_var_list(),this.expect(")")&&this.next()),t},read_list_with_dangling_comma(t){const e=[];for(;this.token!=this.EOF;){if(e.push(t()),","!=this.token){if(")"==this.token)break;this.error([",",")"]);break}if(this.next(),this.version>=800&&")"===this.token)return e}return e},read_lexical_var_list(){return this.read_list_with_dangling_comma(this.read_lexical_var.bind(this))},read_lexical_var(){if("&"===this.token)return this.read_byref(this.read_lexical_var.bind(this));const t=this.node("variable");this.expect(this.tok.T_VARIABLE);const e=this.text().substring(1);return this.next(),t(e,!1)},read_parameter_list(t){if(")"!==this.token){let e=!1;return this.read_list_with_dangling_comma(function(){const s=this.read_parameter(t);return s&&(e&&this.raiseError("Unexpected parameter after a variadic parameter"),s.variadic&&(e=!0)),s}.bind(this),",")}return[]},read_parameter(t){const e=this.node("parameter");let s=null,i=null,n=null,r=!1,o=!1,h=[];this.token===this.tok.T_ATTRIBUTE&&(h=this.read_attr_list()),this.version>=801&&this.token===this.tok.T_READ_ONLY&&(t?(this.next(),o=!0):this.raiseError("readonly properties can be used only on class constructor"));const a=this.read_promoted();!o&&this.version>=801&&this.token===this.tok.T_READ_ONLY&&(t?(this.next(),o=!0):this.raiseError("readonly properties can be used only on class constructor")),"?"===this.token&&(this.next(),r=!0),n=this.read_types(),r&&!n&&this.raiseError("Expecting a type definition combined with nullable operator");const c=this.is_reference(),l=this.is_variadic();if(this.expect(this.tok.T_VARIABLE)){s=this.node("identifier");const t=this.text().substring(1);this.next(),s=s(t)}"="==this.token&&(i=this.next().read_expr());const _=e(s,n,i,c,l,o,r,a);return h&&(_.attrGroups=h),_},read_types(){const t="unset",e="union",s="intersection",i=[];let n=t;const r=this.read_type();if(!r)return null;for(i.push(r);"|"===this.token||this.version>=801&&"&"===this.token;){const r=this.peek();if(r===this.tok.T_ELLIPSIS||r===this.tok.T_VARIABLE)break;n===t?n="|"===this.token?e:s:(n===e&&"|"!==this.token||n===s&&"&"!==this.token)&&this.raiseError('Unexpect token "'+this.token+'", "|" and "&" can not be mixed'),this.next(),i.push(this.read_type())}return 1===i.length?i[0]:n===s?this.node("intersectiontype")(i):this.node("uniontype")(i)},read_promoted(){return this.token===this.tok.T_PUBLIC?(this.next(),1):this.token===this.tok.T_PROTECTED?(this.next(),2):this.token===this.tok.T_PRIVATE?(this.next(),4):0},read_argument_list(){let t=[];return this.expect("(")&&this.next(),this.version>=801&&this.token===this.tok.T_ELLIPSIS&&")"===this.peek()?(t.push(this.node("variadicplaceholder")()),this.next()):")"!==this.token&&(t=this.read_non_empty_argument_list()),this.expect(")")&&this.next(),t},read_non_empty_argument_list(){let t=!1;return this.read_function_list(function(){const e=this.read_argument();if(e){const s="variadic"===e.kind;t&&!s&&this.raiseError("Unexpected non-variadic argument after a variadic argument"),s&&(t=!0)}return e}.bind(this),",")},read_argument(){if(this.token===this.tok.T_ELLIPSIS)return this.node("variadic")(this.next().read_expr());if(this.token===this.tok.T_STRING||Object.values(this.lexer.keywords).includes(this.token)){if(":"===this.peek())return this.version<800&&this.raiseError("PHP 8+ is required to use named arguments"),this.node("namedargument")(this.text(),this.next().next().read_expr())}return this.read_expr()},read_type(){const t=this.node();if(this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE){const e=this.text();return this.next(),t("typereference",e.toLowerCase(),e)}if(this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_STATIC){const e=this.text(),s=[this.token,this.lexer.getState()];return this.next(),this.token!==this.tok.T_NS_SEPARATOR&&this.ast.typereference.types.indexOf(e.toLowerCase())>-1?t("typereference",e.toLowerCase(),e):(this.lexer.tokens.push(s),this.next(),t.destroy(),this.read_namespace_name())}return t.destroy(),null}},L={read_if(){const t=this.node("if"),e=this.next().read_if_expr();let s=null,i=null,n=!1;if(":"===this.token){n=!0,this.next(),s=this.node("block");const t=[];for(;this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){i=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){i=this.read_else_short();break}t.push(this.read_inner_statement())}s=s(null,t),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else s=this.read_statement(),this.token===this.tok.T_ELSEIF?i=this.read_if():this.token===this.tok.T_ELSE&&(i=this.next().read_statement());return t(e,s,i,n)},read_if_expr(){this.expect("(")&&this.next();const t=this.read_expr();return this.expect(")")&&this.next(),t},read_elseif_short(){let t=null;const e=this.node("if"),s=this.next().read_if_expr();this.expect(":")&&this.next();const i=this.node("block"),n=[];for(;this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){t=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){t=this.read_else_short();break}n.push(this.read_inner_statement())}return e(s,i(null,n),t,!0)},read_else_short(){this.next().expect(":")&&this.next();const t=this.node("block"),e=[];for(;this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)e.push(this.read_inner_statement());return t(null,e)}},b={read_while(){const t=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();let e=null,s=null,i=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(i=!0,s=this.read_short_form(this.tok.T_ENDWHILE)):s=this.read_statement(),t(e,s,i)},read_do(){const t=this.node("do");this.expect(this.tok.T_DO)&&this.next();let e=null,s=null;return s=this.read_statement(),this.expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),t(e,s)},read_for(){const t=this.node("for");this.expect(this.tok.T_FOR)&&this.next();let e=[],s=[],i=[],n=null,r=!1;return this.expect("(")&&this.next(),";"!==this.token?(e=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),";"!==this.token?(s=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),")"!==this.token?(i=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),":"===this.token?(r=!0,n=this.read_short_form(this.tok.T_ENDFOR)):n=this.read_statement(),t(e,s,i,n,r)},read_foreach(){const t=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();let e=null,s=null,i=null,n=null,r=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),i=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(s=i,i=this.next().read_foreach_variable())),s&&"list"===s.kind&&this.raiseError("Fatal Error : Cannot use list as key element"),this.expect(")")&&this.next(),":"===this.token?(r=!0,n=this.read_short_form(this.tok.T_ENDFOREACH)):n=this.read_statement(),t(e,s,i,n,r)},read_foreach_variable(){if(this.token===this.tok.T_LIST||"["===this.token){const t="["===this.token,e=this.node("list");this.next(),!t&&this.expect("(")&&this.next();const s=this.read_array_pair_list(t);return this.expect(t?"]":")")&&this.next(),e(s,t)}return this.read_variable(!1,!1)}},I={read_start(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}},C={read_namespace(){const t=this.node("namespace");let e,s;return this.expect(this.tok.T_NAMESPACE)&&this.next(),s="{"===this.token?{name:[""]}:this.read_namespace_name(),this.currentNamespace=s,";"===this.token?(this.currentNamespace=s,e=this.next().read_top_statements(),this.expect(this.EOF),t(s.name,e,!1)):"{"===this.token?(this.currentNamespace=s,e=this.next().read_top_statements(),this.expect("}")&&this.next(),0===e.length&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),t(s.name,e,!0)):(this.error(["{",";"]),this.currentNamespace=s,e=this.read_top_statements(),this.expect(this.EOF),t(s,e,!1))},read_namespace_name(t){const e=this.node();let s,i=this.text();switch(this.token){case this.tok.T_NAME_RELATIVE:s=this.ast.name.RELATIVE_NAME,i=i.replace(/^namespace\\/,"");break;case this.tok.T_NAME_QUALIFIED:s=this.ast.name.QUALIFIED_NAME;break;case this.tok.T_NAME_FULLY_QUALIFIED:s=this.ast.name.FULL_QUALIFIED_NAME;break;default:if(s=this.ast.name.UNQUALIFIED_NAME,!this.expect(this.tok.T_STRING))return e("name","",this.ast.name.FULL_QUALIFIED_NAME)}if(this.next(),t||"("!==this.token){if("parent"===i.toLowerCase())return e("parentreference",i);if("self"===i.toLowerCase())return e("selfreference",i)}return e("name",i,s)},read_use_statement(){let t=this.node("usegroup"),e=[],s=null;this.expect(this.tok.T_USE)&&this.next();const i=this.read_use_type();return e.push(this.read_use_declaration(!1)),","===this.token?e=e.concat(this.next().read_use_declarations(!1)):"{"===this.token&&(s=e[0].name,e=this.next().read_use_declarations(null===i),this.expect("}")&&this.next()),t=t(s,i,e),this.expect(";")&&this.next(),t},read_class_name_reference(){return this.read_variable(!0,!1)},read_use_declaration(t){const e=this.node("useitem");let s=null;t&&(s=this.read_use_type());const i=this.read_namespace_name(),n=this.read_use_alias();return e(i.name,n,s)},read_use_declarations(t){const e=[this.read_use_declaration(t)];for(;","===this.token;){if(this.next(),t){if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_FUNCTION&&this.token!==this.tok.T_CONST&&this.token!==this.tok.T_STRING)break}else if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_STRING&&this.token!==this.tok.T_NS_SEPARATOR)break;e.push(this.read_use_declaration(t))}return e},read_use_alias(){let t=null;if(this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)){const e=this.node("identifier"),s=this.text();this.next(),t=e(s)}return t},read_use_type(){return this.token===this.tok.T_FUNCTION?(this.next(),this.ast.useitem.TYPE_FUNCTION):this.token===this.tok.T_CONST?(this.next(),this.ast.useitem.TYPE_CONST):null}};const S={"\\":"\\",$:"$",n:"\n",r:"\r",t:"\t",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)};var O={resolve_special_chars:(t,e)=>e?t.replace(/\\"/,'"').replace(/\\([\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})/g,((t,e,s)=>S[e]?S[e]:"x"===e[0]||"X"===e[0]?String.fromCodePoint(parseInt(e.substr(1),16)):"u"===e[0]?String.fromCodePoint(parseInt(s,16)):String.fromCodePoint(parseInt(e,8)))):t.replace(/\\\\/g,"\\").replace(/\\'/g,"'"),remove_heredoc_leading_whitespace_chars(t,e,s,i){if(0===e)return t;this.check_heredoc_indentation_level(t,e,s,i);const n=s?" ":"\t",r=new RegExp(`\\n${n}{${e}}`,"g"),o=new RegExp(`^${n}{${e}}`);return i&&(t=t.replace(o,"")),t.replace(r,"\n")},check_heredoc_indentation_level(t,e,s,i){const n=t.length;let r=0,o=0,h=!0;const a=s?" ":"\t";let c=!1;if(!i){if(r=t.indexOf("\n"),-1===r)return;r++}for(;r<n;)h?t[r]===a?o++:c=!0:h=!1,"\n"!==t[r]&&c&&o<e?this.raiseError(`Invalid body indentation level (expecting an indentation at least ${e})`):c=!1,"\n"===t[r]&&(h=!0,o=0),r++},read_dereferencable_scalar(){let t=null;switch(this.token){case this.tok.T_CONSTANT_ENCAPSED_STRING:{let e=this.node("string");const s=this.text();let i=0;"b"!==s[0]&&"B"!==s[0]||(i=1);const n='"'===s[i];this.next();e=e(n,this.resolve_special_chars(s.substring(i+1,s.length-1),n),1===i,s),t=this.token===this.tok.T_DOUBLE_COLON?this.read_static_getter(e):e}break;case this.tok.T_ARRAY:case"[":t=this.read_array()}return t},read_scalar(){if(this.is("T_MAGIC_CONST"))return this.get_magic_constant();{let t,e;switch(this.token){case this.tok.T_LNUMBER:case this.tok.T_DNUMBER:{const e=this.node("number");return t=this.text(),this.next(),e(t,null)}case this.tok.T_START_HEREDOC:if("ST_NOWDOC"===this.lexer.curCondition){const s=this.lexer.yylloc.first_offset;e=this.node("nowdoc"),t=this.next().text(),this.lexer.heredoc_label.indentation>0&&(t=t.substring(0,t.length-this.lexer.heredoc_label.indentation));const i=t[t.length-1];"\n"===i?t="\r"===t[t.length-2]?t.substring(0,t.length-2):t.substring(0,t.length-1):"\r"===i&&(t=t.substring(0,t.length-1)),this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE)&&this.next(),this.expect(this.tok.T_END_HEREDOC)&&this.next();const n=this.lexer._input.substring(s,this.lexer.yylloc.first_offset);return e=e(this.remove_heredoc_leading_whitespace_chars(t,this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node),n,this.lexer.heredoc_label.label),this.lexer.heredoc_label.finished=!0,e}return this.read_encapsed_string(this.tok.T_END_HEREDOC);case'"':return this.read_encapsed_string('"');case'b"':case'B"':return this.read_encapsed_string('"',!0);case this.tok.T_CONSTANT_ENCAPSED_STRING:case this.tok.T_ARRAY:case"[":return this.read_dereferencable_scalar();default:{const t=this.error("SCALAR");return this.next(),t}}}},read_dereferencable(t){let e,s;const i=this.node("offsetlookup");return"["===this.token?(s=this.next().read_expr(),this.expect("]")&&this.next(),e=i(t,s)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(s=this.read_encapsed_string_item(!1),e=i(t,s)),e},read_encapsed_string_item(t){const e=this.node("encapsedpart");let s,i,n,r=null,o=!1,h=this.node();if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){const e=this.text();this.next(),h=h("string",!1,this.version>=703&&!this.lexer.heredoc_label.finished?this.remove_heredoc_leading_whitespace_chars(this.resolve_special_chars(e,t),this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node):e,!1,e)}else if(this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES){if(r="simple",o=!0,n=null,this.next().token===this.tok.T_STRING_VARNAME){n=this.node("variable");const t=this.text();this.next(),h.destroy(),"["===this.token?(n=n(t,!1),i=this.node("offsetlookup"),s=this.next().read_expr(),this.expect("]")&&this.next(),h=i(n,s)):h=n(t,!1)}else h=h("variable",this.read_expr(),!1);this.expect("}")&&this.next()}else if(this.token===this.tok.T_CURLY_OPEN)r="complex",h.destroy(),h=this.next().read_variable(!1,!1),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(r="simple",h.destroy(),h=this.read_simple_variable(),"["===this.token&&(i=this.node("offsetlookup"),s=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),h=i(h,s)),this.token===this.tok.T_OBJECT_OPERATOR){i=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);const t=this.node("identifier");n=this.text(),this.next(),h=i(h,t(n))}}else{this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);const t=this.text();this.next(),h.destroy(),h=h("string",!1,t,!1,t)}return this.lexer.heredoc_label.first_encaps_node=!1,e(h,r,o)},read_encapsed_string(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=this.lexer.yylloc.first_offset;let i=this.node("encapsed");this.next();const n=this.lexer.yylloc.prev_offset-(e?1:0),r=[];let o=null;for(o="`"===t?this.ast.encapsed.TYPE_SHELL:'"'===t?this.ast.encapsed.TYPE_STRING:this.ast.encapsed.TYPE_HEREDOC;this.token!==t&&this.token!==this.EOF;)r.push(this.read_encapsed_string_item(!0));if(r.length>0&&"encapsedpart"===r[r.length-1].kind&&"string"===r[r.length-1].expression.kind){const t=r[r.length-1].expression,e=t.value[t.value.length-1];"\n"===e?"\r"===t.value[t.value.length-2]?t.value=t.value.substring(0,t.value.length-2):t.value=t.value.substring(0,t.value.length-1):"\r"===e&&(t.value=t.value.substring(0,t.value.length-1))}this.expect(t)&&this.next();return i=i(r,this.lexer._input.substring("heredoc"===o?s:n-1,this.lexer.yylloc.first_offset),o),t===this.tok.T_END_HEREDOC&&(i.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),i},get_magic_constant(){const t=this.node("magic"),e=this.text();return this.next(),t(e.toUpperCase(),e)}},R={read_top_statements(){let t=[];for(;this.token!==this.EOF&&"}"!==this.token;){const e=this.read_top_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_top_statement(){let t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:return this.read_function(!1,!1,t);case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_READ_ONLY:case this.tok.T_CLASS:return this.read_class_declaration_statement(t);case this.tok.T_INTERFACE:return this.read_interface_declaration_statement(t);case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement(t);case this.tok.T_USE:return this.read_use_statement();case this.tok.T_CONST:{const t=this.node("constantstatement"),e=this.next().read_const_list();return this.expectEndOfStatement(),t(null,e)}case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:{const t=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,t(this.lexer._input.substring(this.lexer.offset))}default:return this.read_statement()}},read_inner_statements(){let t=[];for(;this.token!=this.EOF&&"}"!==this.token;){const e=this.read_inner_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_const_list(){return this.read_list((function(){this.expect(this.tok.T_STRING);const t=this.node("constant");let e=this.node("identifier");const s=this.text();return this.next(),e=e(s),this.expect("=")?t(e,this.next().read_expr()):t(e,null)}),",",!1)},read_declare_list(){const t=[];for(;this.token!=this.EOF&&")"!==this.token;){this.expect(this.tok.T_STRING);const e=this.node("declaredirective");let s=this.node("identifier");const i=this.text();this.next(),s=s(i);let n=null;if(this.expect("=")&&(n=this.next().read_expr()),t.push(e(s,n)),","!==this.token)break;this.next()}return t},read_inner_statement(){let t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:{const e=this.read_function(!1,!1);return e.attrGroups=t,e}case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_CLASS:return this.read_class_declaration_statement();case this.tok.T_INTERFACE:return this.read_interface_declaration_statement();case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement();case this.tok.T_HALT_COMPILER:{this.raiseError("__HALT_COMPILER() can only be used from the outermost scope");let t=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),t=t(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),t}default:return this.read_statement()}},read_statement(){switch(this.token){case"{":return this.read_code_block(!1);case this.tok.T_IF:return this.read_if();case this.tok.T_SWITCH:return this.read_switch();case this.tok.T_FOR:return this.read_for();case this.tok.T_FOREACH:return this.read_foreach();case this.tok.T_WHILE:return this.read_while();case this.tok.T_DO:return this.read_do();case this.tok.T_COMMENT:return this.read_comment();case this.tok.T_DOC_COMMENT:return this.read_doc_comment();case this.tok.T_RETURN:{const t=this.node("return");this.next();const e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e)}case this.tok.T_BREAK:case this.tok.T_CONTINUE:{const t=this.node(this.token===this.tok.T_CONTINUE?"continue":"break");this.next();const e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e)}case this.tok.T_GLOBAL:{const t=this.node("global"),e=this.next().read_list(this.read_simple_variable,",");return this.expectEndOfStatement(),t(e)}case this.tok.T_STATIC:{const t=[this.token,this.lexer.getState()],e=this.node();if(this.next().token===this.tok.T_DOUBLE_COLON){this.lexer.tokens.push(t);const s=this.next().read_expr();return this.expectEndOfStatement(s),e("expressionstatement",s)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);const s=this.read_variable_declarations();return this.expectEndOfStatement(),e("static",s)}case this.tok.T_ECHO:{const t=this.node("echo"),e=this.text(),s="<?="===e||"<%="===e,i=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),t(i,s)}case this.tok.T_INLINE_HTML:{const t=this.text();let e=this.lexer.yylloc.first_offset>0?this.lexer._input[this.lexer.yylloc.first_offset-1]:null;const s="\r"===e||"\n"===e;s&&"\n"===e&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(e="\r\n");const i=this.node("inline");return this.next(),i(t,s?e+t:t)}case this.tok.T_UNSET:{const t=this.node("unset");this.next().expect("(")&&this.next();const e=this.read_function_list(this.read_variable,",");return this.expect(")")&&this.next(),this.expect(";")&&this.next(),t(e)}case this.tok.T_DECLARE:{const t=this.node("declare"),e=[];let s;this.next().expect("(")&&this.next();const i=this.read_declare_list();if(this.expect(")")&&this.next(),":"===this.token){for(this.next();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)e.push(this.read_top_statement());0===e.length&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),s=this.ast.declare.MODE_SHORT}else if("{"===this.token){for(this.next();this.token!=this.EOF&&"}"!==this.token;)e.push(this.read_top_statement());0===e.length&&this.extractDoc&&this._docs.length>this._docIndex&&e.push(this.node("noop")()),this.expect("}")&&this.next(),s=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),s=this.ast.declare.MODE_NONE;return t(i,e,s)}case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:{const t=this.node("throw"),e=this.next().read_expr();return this.expectEndOfStatement(),t(e)}case";":return this.next(),null;case this.tok.T_STRING:{const t=this.node(),e=[this.token,this.lexer.getState()],s=this.text();let i=this.node("identifier");if(":"===this.next().token)return i=i(s),this.next(),t("label",i);i.destroy(),t.destroy(),this.lexer.tokens.push(e);const n=this.node("expressionstatement"),r=this.next().read_expr();return this.expectEndOfStatement(r),n(r)}case this.tok.T_GOTO:{const t=this.node("goto");let e=null;if(this.next().expect(this.tok.T_STRING)){e=this.node("identifier");const t=this.text();this.next(),e=e(t),this.expectEndOfStatement()}return t(e)}default:{const t=this.node("expressionstatement"),e=this.read_expr();return this.expectEndOfStatement(e),t(e)}}},read_code_block(t){const e=this.node("block");this.expect("{")&&this.next();const s=t?this.read_top_statements():this.read_inner_statements();return 0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.expect("}")&&this.next(),e(null,s)}},v={read_switch(){const t=this.node("switch");this.expect(this.tok.T_SWITCH)&&this.next(),this.expect("(")&&this.next();const e=this.read_expr();this.expect(")")&&this.next();const s=":"===this.token;return t(e,this.read_switch_case_list(),s)},read_switch_case_list(){let t=null;const e=this.node("block"),s=[];for("{"===this.token?t="}":":"===this.token?t=this.tok.T_ENDSWITCH:this.expect(["{",":"]),this.next(),";"===this.token&&this.next();this.token!==this.EOF&&this.token!==t;)s.push(this.read_case_list(t));return 0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.expect(t)&&this.next(),t===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),e(null,s)},read_case_list(t){const e=this.node("case");let s=null;this.token===this.tok.T_CASE?s=this.next().read_expr():this.token===this.tok.T_DEFAULT?this.next():this.expect([this.tok.T_CASE,this.tok.T_DEFAULT]),this.expect([":",";"])&&this.next();const i=this.node("block"),n=[];for(;this.token!==this.EOF&&this.token!==t&&this.token!==this.tok.T_CASE&&this.token!==this.tok.T_DEFAULT;)n.push(this.read_inner_statement());return e(s,i(null,n))}},w={read_try(){this.expect(this.tok.T_TRY);const t=this.node("try");let e=null;const s=[],i=this.next().read_statement();for(;this.token===this.tok.T_CATCH;){const t=this.node("catch");this.next().expect("(")&&this.next();const e=this.read_list(this.read_namespace_name,"|",!1);let i=null;(this.version<800||this.token===this.tok.T_VARIABLE)&&(i=this.read_variable(!0,!1)),this.expect(")"),s.push(t(this.next().read_statement(),e,i))}return this.token===this.tok.T_FINALLY&&(e=this.next().read_statement()),t(i,s,e)}},D={read_short_form(t){const e=this.node("block"),s=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==t;)s.push(this.read_inner_statement());return 0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.expect(t)&&this.next(),this.expectEndOfStatement(),e(null,s)},read_function_list(t,e){const s=[];do{if(this.token==e&&this.version>=703&&s.length>0){s.push(this.node("noop")());break}if(s.push(t.apply(this,[])),this.token!=e)break;if(")"==this.next().token&&this.version>=703)break}while(this.token!=this.EOF);return s},read_list(t,e,s){const i=[];if(this.token==e&&(s&&i.push("function"==typeof t?this.node("noop")():null),this.next()),"function"==typeof t)do{const s=t.apply(this,[]);if(s&&i.push(s),this.token!=e)break}while(this.next().token!=this.EOF);else{if(!this.expect(t))return[];for(i.push(this.text());this.next().token!=this.EOF&&this.token==e&&this.next().token==t;)i.push(this.text())}return i},read_name_list(){return this.read_list(this.read_namespace_name,",",!1)},read_byref(t){let e=this.node("byref");this.next(),e=e(null);const s=t();return s&&(this.ast.swapLocations(s,e,s,this),s.byref=!0),s},read_variable_declarations(){return this.read_list((function(){const t=this.node("staticvariable");let e=this.node("variable");if(this.expect(this.tok.T_VARIABLE)){const t=this.text().substring(1);this.next(),e=e(t,!1)}else e=e("#ERR",!1);return"="===this.token?t(e,this.next().read_expr()):e}),",")},read_extends_from(){return this.token===this.tok.T_EXTENDS?this.next().read_namespace_name():null},read_interface_extends_list(){return this.token===this.tok.T_EXTENDS?this.next().read_name_list():null},read_implements_list(){return this.token===this.tok.T_IMPLEMENTS?this.next().read_name_list():null}},U={read_variable(t,e){let s;if("&"===this.token)return this.read_byref(this.read_variable.bind(this,t,e));if(this.is([this.tok.T_VARIABLE,"$"]))s=this.read_reference_variable(e);else if(this.is([this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE])){s=this.node();const t=this.read_namespace_name();if(this.token!=this.tok.T_DOUBLE_COLON&&"("!=this.token&&-1===["parentreference","selfreference"].indexOf(t.kind)){const e=t.name.toLowerCase();"true"===e?s=t.destroy(s("boolean",!0,t.name)):"false"===e?s=t.destroy(s("boolean",!1,t.name)):"null"===e?s=t.destroy(s("nullkeyword",t.name)):(s.destroy(t),s=t)}else s.destroy(t),s=t}else if(this.token===this.tok.T_STATIC){s=this.node("staticreference");const t=this.text();this.next(),s=s(t)}else this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(s=this.read_static_getter(s,e)),this.recursive_variable_chain_scan(s,t,e)},read_static_getter(t,e){const s=this.node("staticlookup");let i,n;return this.next().is([this.tok.T_VARIABLE,"$"])?i=this.read_reference_variable(e):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(i=this.node("identifier"),n=this.text(),this.next(),i=i(n)):"{"===this.token?(i=this.node("literal"),n=this.next().read_expr(),this.expect("}")&&this.next(),i=i("literal",n,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),i=this.node("identifier"),n=this.text(),this.next(),i=i(n)),s(t,i)},read_what(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=null,s=null;switch(this.next().token){case this.tok.T_STRING:e=this.node("identifier"),s=this.text(),this.next(),e=e(s),t&&this.token===this.tok.T_OBJECT_OPERATOR&&this.error();break;case this.tok.T_VARIABLE:e=this.node("variable"),s=this.text().substring(1),this.next(),e=e(s,!1);break;case"$":e=this.node(),this.next().expect(["$","{",this.tok.T_VARIABLE]),"{"===this.token?(s=this.next().read_expr(),this.expect("}")&&this.next(),e=e("variable",s,!0)):(s=this.read_expr(),e=e("variable",s,!1));break;case"{":e=this.node("encapsedpart"),s=this.next().read_expr(),this.expect("}")&&this.next(),e=e(s,"complex",!1);break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE,"$","{"]),e=this.node("identifier"),s=this.text(),this.next(),e=e(s)}return e},recursive_variable_chain_scan(t,e,s){let i,n;t:for(;this.token!=this.EOF;)switch(this.token){case"(":if(e)return t;t=this.node("call")(t,this.read_argument_list());break;case"[":case"{":{const e="["===this.token;if(i=this.node("offsetlookup"),this.next(),n=!1,s)n=this.read_encaps_var_offset(),this.expect(e?"]":"}")&&this.next();else{(e?"]"!==this.token:"}"!==this.token)?(n=this.read_expr(),this.expect(e?"]":"}")&&this.next()):this.next()}t=i(t,n);break}case this.tok.T_DOUBLE_COLON:"staticlookup"===t.kind&&"identifier"===t.offset.kind&&this.error(),i=this.node("staticlookup"),t=i(t,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:i=this.node("propertylookup"),t=i(t,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:i=this.node("nullsafepropertylookup"),t=i(t,this.read_what());break;default:break t}return t},read_encaps_var_offset(){let t=this.node();if(this.token===this.tok.T_STRING){const e=this.text();this.next(),t=t("identifier",e)}else if(this.token===this.tok.T_NUM_STRING){const e=this.text();this.next(),t=t("number",e,null)}else if("-"===this.token){this.next();const e=-1*this.text();this.expect(this.tok.T_NUM_STRING)&&this.next(),t=t("number",e,null)}else if(this.token===this.tok.T_VARIABLE){const e=this.text().substring(1);this.next(),t=t("variable",e,!1)}else{this.expect([this.tok.T_STRING,this.tok.T_NUM_STRING,"-",this.tok.T_VARIABLE]);const e=this.text();this.next(),t=t("identifier",e)}return t},read_reference_variable(t){let e,s=this.read_simple_variable();for(;this.token!=this.EOF;){const i=this.node();if("{"!=this.token||t){i.destroy();break}e=this.next().read_expr(),this.expect("}")&&this.next(),s=i("offsetlookup",s,e)}return s},read_simple_variable(){let t,e=this.node("variable");if(this.expect([this.tok.T_VARIABLE,"$"])&&this.token===this.tok.T_VARIABLE)t=this.text().substring(1),this.next(),e=e(t,!1);else switch("$"===this.token&&this.next(),this.token){case"{":{const t=this.next().read_expr();this.expect("}")&&this.next(),e=e(t,!0);break}case"$":e=e(this.read_simple_variable(),!1);break;case this.tok.T_VARIABLE:{t=this.text().substring(1);const s=this.node("variable");this.next(),e=e(s(t,!1),!1);break}default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),e=e(t,!1)}return e}};const P=x;function F(t){return"."!=t&&","!=t&&!isNaN(parseFloat(t))&&isFinite(t)}const M=function(t,e){this.lexer=t,this.ast=e,this.tok=t.tok,this.EOF=t.EOF,this.token=null,this.prev=null,this.debug=!1,this.version=803,this.extractDoc=!1,this.extractTokens=!1,this.suppressErrors=!1;const s=function(t){return[t,null]};this.entries={IDENTIFIER:new Map([this.tok.T_ABSTRACT,this.tok.T_ARRAY,this.tok.T_AS,this.tok.T_BREAK,this.tok.T_CALLABLE,this.tok.T_CASE,this.tok.T_CATCH,this.tok.T_CLASS,this.tok.T_CLASS_C,this.tok.T_CLONE,this.tok.T_CONST,this.tok.T_CONTINUE,this.tok.T_DECLARE,this.tok.T_DEFAULT,this.tok.T_DIR,this.tok.T_DO,this.tok.T_ECHO,this.tok.T_ELSE,this.tok.T_ELSEIF,this.tok.T_EMPTY,this.tok.T_ENDDECLARE,this.tok.T_ENDFOR,this.tok.T_ENDFOREACH,this.tok.T_ENDIF,this.tok.T_ENDSWITCH,this.tok.T_ENDWHILE,this.tok.T_ENUM,this.tok.T_EVAL,this.tok.T_EXIT,this.tok.T_EXTENDS,this.tok.T_FILE,this.tok.T_FINAL,this.tok.T_FINALLY,this.tok.T_FN,this.tok.T_FOR,this.tok.T_FOREACH,this.tok.T_FUNC_C,this.tok.T_FUNCTION,this.tok.T_GLOBAL,this.tok.T_GOTO,this.tok.T_IF,this.tok.T_IMPLEMENTS,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_INSTANCEOF,this.tok.T_INSTEADOF,this.tok.T_INTERFACE,this.tok.T_ISSET,this.tok.T_LINE,this.tok.T_LIST,this.tok.T_LOGICAL_AND,this.tok.T_LOGICAL_OR,this.tok.T_LOGICAL_XOR,this.tok.T_MATCH,this.tok.T_METHOD_C,this.tok.T_NAMESPACE,this.tok.T_NEW,this.tok.T_NS_C,this.tok.T_PRINT,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_PUBLIC,this.tok.T_READ_ONLY,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_RETURN,this.tok.T_STATIC,this.tok.T_SWITCH,this.tok.T_THROW,this.tok.T_TRAIT,this.tok.T_TRY,this.tok.T_UNSET,this.tok.T_USE,this.tok.T_VAR,this.tok.T_WHILE,this.tok.T_YIELD].map(s)),VARIABLE:new Map([this.tok.T_VARIABLE,"$","&",this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE,this.tok.T_STATIC].map(s)),SCALAR:new Map([this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(s)),T_MAGIC_CONST:new Map([this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C].map(s)),T_MEMBER_FLAGS:new Map([this.tok.T_PUBLIC,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_STATIC,this.tok.T_ABSTRACT,this.tok.T_FINAL].map(s)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(s)),EXPR:new Map(["@","-","+","!","~","(","`",this.tok.T_LIST,this.tok.T_CLONE,this.tok.T_INC,this.tok.T_DEC,this.tok.T_NEW,this.tok.T_ISSET,this.tok.T_EMPTY,this.tok.T_MATCH,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_EVAL,this.tok.T_INT_CAST,this.tok.T_DOUBLE_CAST,this.tok.T_STRING_CAST,this.tok.T_ARRAY_CAST,this.tok.T_OBJECT_CAST,this.tok.T_BOOL_CAST,this.tok.T_UNSET_CAST,this.tok.T_EXIT,this.tok.T_PRINT,this.tok.T_YIELD,this.tok.T_STATIC,this.tok.T_FUNCTION,this.tok.T_FN,this.tok.T_VARIABLE,"$",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_STRING,this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(s))}};M.prototype.getTokenName=function(t){return F(t)?t==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[t]:"'"+t+"'"},M.prototype.parse=function(t,e){this._errors=[],this.filename=e||"eval",this.currentNamespace=[""],this.extractDoc?this._docs=[]:this._docs=null,this.extractTokens?this._tokens=[]:this._tokens=null,this._docIndex=0,this._lastNode=null,this.lexer.setInput(t),this.lexer.all_tokens=this.extractTokens,this.lexer.comment_tokens=this.extractDoc,this.length=this.lexer._input.length,this.innerList=!1,this.innerListForm=!1;const s=this.node("program"),i=[];for(this.next();this.token!=this.EOF;)i.push(this.read_start());0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];const n=s(i,this._errors,this._docs,this._tokens);if(this.debug){const t=this.ast.checkNodes();if(t.length>0)throw t.forEach((function(t){t.position&&console.log("Node at line "+t.position.line+", column "+t.position.column),console.log(t.stack.join("\n"))})),new Error("Some nodes are not closed")}return n},M.prototype.raiseError=function(t,e,s,i){if(t+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){const e=new SyntaxError(t,this.filename,this.lexer.yylloc.first_line);throw e.lineNumber=this.lexer.yylloc.first_line,e.fileName=this.filename,e.columnNumber=this.lexer.yylloc.first_column,e}const n=this.ast.prepare("error",null,this)(t,i,this.lexer.yylloc.first_line,s);return this._errors.push(n),n},M.prototype.error=function(t){let e="Parse Error : syntax error",s=this.getTokenName(this.token),i="";if(this.token!==this.EOF){if(F(this.token)){let t=this.text();t.length>10&&(t=t.substring(0,7)+"..."),s="'"+t+"' ("+s+")"}e+=", unexpected "+s}return t&&!Array.isArray(t)&&((F(t)||1===t.length)&&(i=", expecting "+this.getTokenName(t)),e+=i),this.raiseError(e,i,t,s)},M.prototype.position=function(){return new P(this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.yylloc.first_offset)},M.prototype.node=function(t){if(this.extractDoc){let e=null;this._docIndex<this._docs.length&&(e=this._docs.slice(this._docIndex),this._docIndex=this._docs.length,this.debug&&(console.log(new Error("Append docs on "+t)),console.log(e)));const s=this.ast.prepare(t,e,this);return s.postBuild=function(t){if(this._docIndex<this._docs.length)if(this._lastNode){const t=this.prev[2];let e=this._docIndex;for(;e<this._docs.length&&!(this._docs[e].offset>t);e++);e>this._docIndex&&(this._lastNode.setTrailingComments(this._docs.slice(this._docIndex,e)),this._docIndex=e)}else this.token===this.EOF&&(t.setTrailingComments(this._docs.slice(this._docIndex)),this._docIndex=this._docs.length);this._lastNode=t}.bind(this),s}return this.ast.prepare(t,null,this)},M.prototype.expectEndOfStatement=function(t){if(";"===this.token)t&&";"===this.lexer.yytext&&t.includeToken(this);else if(this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF)return this.error(";"),!1;return this.next(),!0};const B=["parser.next","parser.node","parser.showlog"];M.prototype.showlog=function(){const t=(new Error).stack.split("\n");let e;for(let s=2;s<t.length;s++){e=t[s].trim();let i=!1;for(let t=0;t<B.length;t++)if(e.substring(3,3+B[t].length)===B[t]){i=!0;break}if(!i)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @--\x3e"+e),this},M.prototype.expect=function(t){if(Array.isArray(t)){if(-1===t.indexOf(this.token))return this.error(t),!1}else if(this.token!=t)return this.error(t),!1;return!0},M.prototype.text=function(){return this.lexer.yytext},M.prototype.next=function(){if(";"===this.token&&";"!==this.lexer.yytext||(this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset]),this.lex(),this.debug&&this.showlog(),this.extractDoc)for(;this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT;)this.token===this.tok.T_COMMENT?this._docs.push(this.read_comment()):this._docs.push(this.read_doc_comment());return this},M.prototype.peek=function(){const t=this.lexer.getState(),e=this.lexer.lex();return this.lexer.setState(t),e},M.prototype.lex=function(){if(this.extractTokens)do{if(this.token=this.lexer.lex()||this.EOF,this.token===this.EOF)return this;let t=this.lexer.yytext;if(t=Object.prototype.hasOwnProperty.call(this.lexer.engine.tokens.values,this.token)?[this.lexer.engine.tokens.values[this.token],t,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset]:[null,t,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset],this._tokens.push(t),this.token===this.tok.T_CLOSE_TAG)return this.token=";",this;if(this.token===this.tok.T_OPEN_TAG_WITH_ECHO)return this.token=this.tok.T_ECHO,this}while(this.token===this.tok.T_WHITESPACE||!this.extractDoc&&(this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT)||this.token===this.tok.T_OPEN_TAG);else this.token=this.lexer.lex()||this.EOF;return this},M.prototype.is=function(t){return Array.isArray(t)?-1!==t.indexOf(this.token):this.entries[t].has(this.token)},[E,m,y,A,N,g,L,b,I,C,O,R,v,w,D,U].forEach((function(t){for(const e in t){if(Object.prototype.hasOwnProperty.call(M.prototype,e))throw new Error("Function "+e+" is already defined - collision");M.prototype[e]=t[e]}}));var H=M;const G={T_HALT_COMPILER:101,T_USE:102,T_ENCAPSED_AND_WHITESPACE:103,T_OBJECT_OPERATOR:104,T_STRING:105,T_DOLLAR_OPEN_CURLY_BRACES:106,T_STRING_VARNAME:107,T_CURLY_OPEN:108,T_NUM_STRING:109,T_ISSET:110,T_EMPTY:111,T_INCLUDE:112,T_INCLUDE_ONCE:113,T_EVAL:114,T_REQUIRE:115,T_REQUIRE_ONCE:116,T_NAMESPACE:117,T_NS_SEPARATOR:118,T_AS:119,T_IF:120,T_ENDIF:121,T_WHILE:122,T_DO:123,T_FOR:124,T_SWITCH:125,T_BREAK:126,T_CONTINUE:127,T_RETURN:128,T_GLOBAL:129,T_STATIC:130,T_ECHO:131,T_INLINE_HTML:132,T_UNSET:133,T_FOREACH:134,T_DECLARE:135,T_TRY:136,T_THROW:137,T_GOTO:138,T_FINALLY:139,T_CATCH:140,T_ENDDECLARE:141,T_LIST:142,T_CLONE:143,T_PLUS_EQUAL:144,T_MINUS_EQUAL:145,T_MUL_EQUAL:146,T_DIV_EQUAL:147,T_CONCAT_EQUAL:148,T_MOD_EQUAL:149,T_AND_EQUAL:150,T_OR_EQUAL:151,T_XOR_EQUAL:152,T_SL_EQUAL:153,T_SR_EQUAL:154,T_INC:155,T_DEC:156,T_BOOLEAN_OR:157,T_BOOLEAN_AND:158,T_LOGICAL_OR:159,T_LOGICAL_AND:160,T_LOGICAL_XOR:161,T_SL:162,T_SR:163,T_IS_IDENTICAL:164,T_IS_NOT_IDENTICAL:165,T_IS_EQUAL:166,T_IS_NOT_EQUAL:167,T_IS_SMALLER_OR_EQUAL:168,T_IS_GREATER_OR_EQUAL:169,T_INSTANCEOF:170,T_INT_CAST:171,T_DOUBLE_CAST:172,T_STRING_CAST:173,T_ARRAY_CAST:174,T_OBJECT_CAST:175,T_BOOL_CAST:176,T_UNSET_CAST:177,T_EXIT:178,T_PRINT:179,T_YIELD:180,T_YIELD_FROM:181,T_FUNCTION:182,T_DOUBLE_ARROW:183,T_DOUBLE_COLON:184,T_ARRAY:185,T_CALLABLE:186,T_CLASS:187,T_ABSTRACT:188,T_TRAIT:189,T_FINAL:190,T_EXTENDS:191,T_INTERFACE:192,T_IMPLEMENTS:193,T_VAR:194,T_PUBLIC:195,T_PROTECTED:196,T_PRIVATE:197,T_CONST:198,T_NEW:199,T_INSTEADOF:200,T_ELSEIF:201,T_ELSE:202,T_ENDSWITCH:203,T_CASE:204,T_DEFAULT:205,T_ENDFOR:206,T_ENDFOREACH:207,T_ENDWHILE:208,T_CONSTANT_ENCAPSED_STRING:209,T_LNUMBER:210,T_DNUMBER:211,T_LINE:212,T_FILE:213,T_DIR:214,T_TRAIT_C:215,T_METHOD_C:216,T_FUNC_C:217,T_NS_C:218,T_START_HEREDOC:219,T_END_HEREDOC:220,T_CLASS_C:221,T_VARIABLE:222,T_OPEN_TAG:223,T_OPEN_TAG_WITH_ECHO:224,T_CLOSE_TAG:225,T_WHITESPACE:226,T_COMMENT:227,T_DOC_COMMENT:228,T_ELLIPSIS:229,T_COALESCE:230,T_POW:231,T_POW_EQUAL:232,T_SPACESHIP:233,T_COALESCE_EQUAL:234,T_FN:235,T_NULLSAFE_OBJECT_OPERATOR:236,T_MATCH:237,T_ATTRIBUTE:238,T_ENUM:239,T_READ_ONLY:240,T_NAME_RELATIVE:241,T_NAME_QUALIFIED:242,T_NAME_FULLY_QUALIFIED:243},V={values:Object.entries(G).reduce(((t,e)=>{let[s,i]=e;return{...t,[i]:s}}),{}),names:G};var Q=Object.freeze(V);var Y=function(t,e,s){this.source=t,this.start=e,this.end=s};const W=function(t,e,s){this.kind=t,e&&(this.leadingComments=e),s&&(this.loc=s)};W.prototype.setTrailingComments=function(t){this.trailingComments=t},W.prototype.destroy=function(t){if(!t)throw new Error("Node already initialized, you must swap with another node");return this.leadingComments&&(t.leadingComments?t.leadingComments=Array.concat(this.leadingComments,t.leadingComments):t.leadingComments=this.leadingComments),this.trailingComments&&(t.trailingComments?t.trailingComments=Array.concat(this.trailingComments,t.trailingComments):t.trailingComments=this.trailingComments),t},W.prototype.includeToken=function(t){return this.loc&&(this.loc.end&&(this.loc.end.line=t.lexer.yylloc.last_line,this.loc.end.column=t.lexer.yylloc.last_column,this.loc.end.offset=t.lexer.offset),t.ast.withSource&&(this.loc.source=t.lexer._input.substring(this.loc.start.offset,t.lexer.offset))),this},W.extends=function(t,e){return e.prototype=Object.create(this.prototype),e.extends=this.extends,e.prototype.constructor=e,e.kind=t,e};var $=W;const z=$,K="expression";var X=z.extends(K,(function(t,e,s){z.apply(this,[t||K,e,s])}));const j=X,J="array";var q=j.extends(J,(function(t,e,s,i){j.apply(this,[J,s,i]),this.items=e,this.shortForm=t}));const Z=X,tt="arrowfunc";var et=Z.extends(tt,(function(t,e,s,i,n,r,o,h){Z.apply(this,[tt,o,h]),this.arguments=t,this.byref=e,this.body=s,this.type=i,this.nullable=n,this.isStatic=r||!1}));const st=X,it="assign";var nt=st.extends(it,(function(t,e,s,i,n){st.apply(this,[it,i,n]),this.left=t,this.right=e,this.operator=s}));const rt=X,ot="assignref";var ht=rt.extends(ot,(function(t,e,s,i){rt.apply(this,[ot,s,i]),this.left=t,this.right=e}));const at=$,ct="attribute";var lt=at.extends(ct,(function(t,e,s,i){at.apply(this,[ct,s,i]),this.name=t,this.args=e}));const _t=$,ut="attrgroup";var pt=_t.extends(ut,(function(t,e,s){_t.apply(this,[ut,e,s]),this.attrs=t||[]}));const dt=X,ft="operation";var kt=dt.extends(ft,(function(t,e,s){dt.apply(this,[t||ft,e,s])}));const Tt=kt;var xt=Tt.extends("bin",(function(t,e,s,i,n){Tt.apply(this,["bin",i,n]),this.type=t,this.left=e,this.right=s}));const Et=$,mt="statement";var yt=Et.extends(mt,(function(t,e,s){Et.apply(this,[t||mt,e,s])}));const At=yt,Nt="block";var gt=At.extends(Nt,(function(t,e,s,i){At.apply(this,[t||Nt,s,i]),this.children=e.filter(Boolean)}));const Lt=X,bt="literal";var It=Lt.extends(bt,(function(t,e,s,i,n){Lt.apply(this,[t||bt,i,n]),this.value=e,s&&(this.raw=s)}));const Ct=It,St="boolean";var Ot=Ct.extends(St,(function(t,e,s,i){Ct.apply(this,[St,t,e,s,i])}));const Rt=yt,vt="break";var wt=Rt.extends(vt,(function(t,e,s){Rt.apply(this,[vt,e,s]),this.level=t}));const Dt=X,Ut="byref";var Pt=Dt.extends(Ut,(function(t,e,s){Dt.apply(this,[Ut,e,s]),this.what=t}));const Ft=X,Mt="call";var Bt=Ft.extends(Mt,(function(t,e,s,i){Ft.apply(this,[Mt,s,i]),this.what=t,this.arguments=e}));const Ht=yt,Gt="case";var Vt=Ht.extends(Gt,(function(t,e,s,i){Ht.apply(this,[Gt,s,i]),this.test=t,this.body=e}));const Qt=kt,Yt="cast";var Wt=Qt.extends(Yt,(function(t,e,s,i,n){Qt.apply(this,[Yt,i,n]),this.type=t,this.raw=e,this.expr=s}));const $t=yt,zt="catch";var Kt=$t.extends(zt,(function(t,e,s,i,n){$t.apply(this,[zt,i,n]),this.body=t,this.what=e,this.variable=s}));const Xt=yt,jt="declaration",Jt=Xt.extends(jt,(function(t,e,s,i){Xt.apply(this,[t||jt,s,i]),this.name=e}));Jt.prototype.parseFlags=function(t){this.isAbstract=1===t[2],this.isFinal=2===t[2],this.isReadonly=1===t[3],"class"!==this.kind&&(-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1])};var qt=Jt;const Zt=qt,te="class";var ee=Zt.extends(te,(function(t,e,s,i,n,r,o){Zt.apply(this,[te,t,r,o]),this.isAnonymous=!t,this.extends=e,this.implements=s,this.body=i,this.attrGroups=[],this.parseFlags(n)}));const se=yt,ie="constantstatement";var ne=se.extends(ie,(function(t,e,s,i){se.apply(this,[t||ie,s,i]),this.constants=e}));const re=ne,oe="classconstant",he=re.extends(oe,(function(t,e,s,i,n,r,o,h){re.apply(this,[t||oe,e,o,h]),this.parseFlags(s),this.nullable=i,this.type=n,this.attrGroups=r}));he.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.final=2===t[2]};var ae=he;const ce=X,le="clone";var _e=ce.extends(le,(function(t,e,s){ce.apply(this,[le,e,s]),this.what=t}));const ue=X,pe="closure";var de=ue.extends(pe,(function(t,e,s,i,n,r,o,h){ue.apply(this,[pe,o,h]),this.uses=s,this.arguments=t,this.byref=e,this.type=i,this.nullable=n,this.isStatic=r||!1,this.body=null,this.attrGroups=[]}));const fe=$;var ke=fe.extends("comment",(function(t,e,s,i){fe.apply(this,[t,s,i]),this.value=e}));const Te=ke,xe="commentblock";var Ee=Te.extends(xe,(function(t,e,s){Te.apply(this,[xe,t,e,s])}));const me=ke,ye="commentline";var Ae=me.extends(ye,(function(t,e,s){me.apply(this,[ye,t,e,s])}));const Ne=$,ge="constant";var Le=Ne.extends(ge,(function(t,e,s,i){Ne.apply(this,[ge,s,i]),this.name=t,this.value=e}));const be=yt,Ie="continue";var Ce=be.extends(Ie,(function(t,e,s){be.apply(this,[Ie,e,s]),this.level=t}));const Se=gt,Oe="declare",Re=Se.extends(Oe,(function(t,e,s,i,n){Se.apply(this,[Oe,e,i,n]),this.directives=t,this.mode=s}));Re.MODE_SHORT="short",Re.MODE_BLOCK="block",Re.MODE_NONE="none";var ve=Re;const we=$,De="declaredirective";var Ue=we.extends(De,(function(t,e,s,i){we.apply(this,[De,s,i]),this.key=t,this.value=e}));const Pe=yt;var Fe=Pe.extends("do",(function(t,e,s,i){Pe.apply(this,["do",s,i]),this.test=t,this.body=e}));const Me=yt,Be="echo";var He=Me.extends(Be,(function(t,e,s,i){Me.apply(this,[Be,s,i]),this.shortForm=e,this.expressions=t}));const Ge=X,Ve="empty";var Qe=Ge.extends(Ve,(function(t,e,s){Ge.apply(this,[Ve,e,s]),this.expression=t}));const Ye=It,We="encapsed",$e=Ye.extends(We,(function(t,e,s,i,n){Ye.apply(this,[We,t,e,i,n]),this.type=s}));$e.TYPE_STRING="string",$e.TYPE_SHELL="shell",$e.TYPE_HEREDOC="heredoc",$e.TYPE_OFFSET="offset";var ze=$e;const Ke=X,Xe="encapsedpart";var je=Ke.extends(Xe,(function(t,e,s,i,n){Ke.apply(this,[Xe,i,n]),this.expression=t,this.syntax=e,this.curly=s}));const Je=X,qe="entry";var Ze=Je.extends(qe,(function(t,e,s,i,n,r){Je.apply(this,[qe,n,r]),this.key=t,this.value=e,this.byRef=s,this.unpack=i}));const ts=qt,es="enum";var ss=ts.extends(es,(function(t,e,s,i,n,r){ts.apply(this,[es,t,n,r]),this.valueType=e,this.implements=s,this.body=i,this.attrGroups=[]}));const is=$,ns="enumcase";var rs=is.extends(ns,(function(t,e,s,i){is.apply(this,[ns,s,i]),this.name=t,this.value=e}));const os=$,hs="error";var as=os.extends(hs,(function(t,e,s,i,n,r){os.apply(this,[hs,n,r]),this.message=t,this.token=e,this.line=s,this.expected=i}));const cs=X,ls="eval";var _s=cs.extends(ls,(function(t,e,s){cs.apply(this,[ls,e,s]),this.source=t}));const us=X,ps="exit";var ds=us.extends(ps,(function(t,e,s,i){us.apply(this,[ps,s,i]),this.expression=t,this.useDie=e}));const fs=yt,ks="expressionstatement";var Ts=fs.extends(ks,(function(t,e,s){fs.apply(this,[ks,e,s]),this.expression=t}));const xs=yt;var Es=xs.extends("for",(function(t,e,s,i,n,r,o){xs.apply(this,["for",r,o]),this.init=t,this.test=e,this.increment=s,this.shortForm=n,this.body=i}));const ms=yt,ys="foreach";var As=ms.extends(ys,(function(t,e,s,i,n,r,o){ms.apply(this,[ys,r,o]),this.source=t,this.key=e,this.value=s,this.shortForm=n,this.body=i}));const Ns=qt,gs="function";var Ls=Ns.extends(gs,(function(t,e,s,i,n,r,o){Ns.apply(this,[gs,t,r,o]),this.arguments=e,this.byref=s,this.type=i,this.nullable=n,this.body=null,this.attrGroups=[]}));const bs=yt,Is="global";var Cs=bs.extends(Is,(function(t,e,s){bs.apply(this,[Is,e,s]),this.items=t}));const Ss=yt,Os="goto";var Rs=Ss.extends(Os,(function(t,e,s){Ss.apply(this,[Os,e,s]),this.label=t}));const vs=yt,ws="halt";var Ds=vs.extends(ws,(function(t,e,s){vs.apply(this,[ws,e,s]),this.after=t}));const Us=$,Ps="identifier",Fs=Us.extends(Ps,(function(t,e,s){Us.apply(this,[Ps,e,s]),this.name=t}));var Ms=Fs;const Bs=yt;var Hs=Bs.extends("if",(function(t,e,s,i,n,r){Bs.apply(this,["if",n,r]),this.test=t,this.body=e,this.alternate=s,this.shortForm=i}));const Gs=X,Vs="include";var Qs=Gs.extends(Vs,(function(t,e,s,i,n){Gs.apply(this,[Vs,i,n]),this.once=t,this.require=e,this.target=s}));const Ys=It,Ws="inline";var $s=Ys.extends(Ws,(function(t,e,s,i){Ys.apply(this,[Ws,t,e,s,i])}));const zs=qt,Ks="interface";var Xs=zs.extends(Ks,(function(t,e,s,i,n,r){zs.apply(this,[Ks,t,n,r]),this.extends=e,this.body=s,this.attrGroups=i}));const js=qt,Js="intersectiontype";var qs=js.extends(Js,(function(t,e,s){js.apply(this,[Js,null,e,s]),this.types=t}));const Zs=X,ti="isset";var ei=Zs.extends(ti,(function(t,e,s){Zs.apply(this,[ti,e,s]),this.variables=t}));const si=yt,ii="label";var ni=si.extends(ii,(function(t,e,s){si.apply(this,[ii,e,s]),this.name=t}));const ri=X,oi="list";var hi=ri.extends(oi,(function(t,e,s,i){ri.apply(this,[oi,s,i]),this.items=t,this.shortForm=e}));const ai=X,ci="lookup";var li=ai.extends(ci,(function(t,e,s,i,n){ai.apply(this,[t||ci,i,n]),this.what=e,this.offset=s}));const _i=It,ui="magic";var pi=_i.extends(ui,(function(t,e,s,i){_i.apply(this,[ui,t,e,s,i])}));const di=X,fi="match";var ki=di.extends(fi,(function(t,e,s,i){di.apply(this,[fi,s,i]),this.cond=t,this.arms=e}));const Ti=X,xi="matcharm";var Ei=Ti.extends(xi,(function(t,e,s,i){Ti.apply(this,[xi,s,i]),this.conds=t,this.body=e}));const mi=Ls,yi="method";var Ai=mi.extends(yi,(function(){mi.apply(this,arguments),this.kind=yi}));const Ni=$,gi="reference",Li=Ni.extends(gi,(function(t,e,s){Ni.apply(this,[t||gi,e,s])}));var bi=Li;const Ii=bi,Ci="name",Si=Ii.extends(Ci,(function(t,e,s,i){Ii.apply(this,[Ci,s,i]),this.name=t.replace(/\\$/,""),this.resolution=e}));Si.UNQUALIFIED_NAME="uqn",Si.QUALIFIED_NAME="qn",Si.FULL_QUALIFIED_NAME="fqn",Si.RELATIVE_NAME="rn";var Oi=Si;const Ri=gt,vi="namespace";var wi=Ri.extends(vi,(function(t,e,s,i,n){Ri.apply(this,[vi,e,i,n]),this.name=t,this.withBrackets=s||!1}));const Di=X,Ui="namedargument";var Pi=Di.extends(Ui,(function(t,e,s,i){Di.apply(this,[Ui,s,i]),this.name=t,this.value=e}));const Fi=X;var Mi=Fi.extends("new",(function(t,e,s,i){Fi.apply(this,["new",s,i]),this.what=t,this.arguments=e}));const Bi=$,Hi="noop";var Gi=Bi.extends(Hi,(function(t,e){Bi.apply(this,[Hi,t,e])}));const Vi=It,Qi="nowdoc";var Yi=Vi.extends(Qi,(function(t,e,s,i,n){Vi.apply(this,[Qi,t,e,i,n]),this.label=s}));const Wi=$,$i="nullkeyword";var zi=Wi.extends($i,(function(t,e,s){Wi.apply(this,[$i,e,s]),this.raw=t}));const Ki=li,Xi="nullsafepropertylookup";var ji=Ki.extends(Xi,(function(t,e,s,i){Ki.apply(this,[Xi,t,e,s,i])}));const Ji=It,qi="number";var Zi=Ji.extends(qi,(function(t,e,s,i){Ji.apply(this,[qi,t,e,s,i])}));const tn=li,en="offsetlookup";var sn=tn.extends(en,(function(t,e,s,i){tn.apply(this,[en,t,e,s,i])}));const nn=qt,rn="parameter";var on=nn.extends(rn,(function(t,e,s,i,n,r,o,h,a,c){nn.apply(this,[rn,t,a,c]),this.value=s,this.type=e,this.byref=i,this.variadic=n,this.readonly=r,this.nullable=o,this.flags=h||0,this.attrGroups=[]}));const hn=bi,an="parentreference",cn=hn.extends(an,(function(t,e,s){hn.apply(this,[an,e,s]),this.raw=t}));var ln=cn;const _n=kt,un="post";var pn=_n.extends(un,(function(t,e,s,i){_n.apply(this,[un,s,i]),this.type=t,this.what=e}));const dn=kt;var fn=dn.extends("pre",(function(t,e,s,i){dn.apply(this,["pre",s,i]),this.type=t,this.what=e}));const kn=X,Tn="print";var xn=kn.extends(Tn,(function(t,e,s){kn.apply(this,[Tn,e,s]),this.expression=t}));const En=gt,mn="program";var yn=En.extends(mn,(function(t,e,s,i,n,r){En.apply(this,[mn,t,n,r]),this.errors=e,s&&(this.comments=s),i&&(this.tokens=i)}));const An=yt,Nn="property";var gn=An.extends(Nn,(function(t,e,s,i,n,r,o,h){An.apply(this,[Nn,o,h]),this.name=t,this.value=e,this.readonly=s,this.nullable=i,this.type=n,this.attrGroups=r}));const Ln=li,bn="propertylookup";var In=Ln.extends(bn,(function(t,e,s,i){Ln.apply(this,[bn,t,e,s,i])}));const Cn=yt,Sn="propertystatement",On=Cn.extends(Sn,(function(t,e,s,i,n){Cn.apply(this,[Sn,i,n]),this.properties=e,this.parseFlags(s)}));On.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1]};var Rn=On;const vn=X,wn="retif";var Dn=vn.extends(wn,(function(t,e,s,i,n){vn.apply(this,[wn,i,n]),this.test=t,this.trueExpr=e,this.falseExpr=s}));const Un=yt,Pn="return";var Fn=Un.extends(Pn,(function(t,e,s){Un.apply(this,[Pn,e,s]),this.expr=t}));const Mn=bi,Bn="selfreference",Hn=Mn.extends(Bn,(function(t,e,s){Mn.apply(this,[Bn,e,s]),this.raw=t}));var Gn=Hn;const Vn=X,Qn="silent";var Yn=Vn.extends(Qn,(function(t,e,s){Vn.apply(this,[Qn,e,s]),this.expr=t}));const Wn=yt,$n="static";var zn=Wn.extends($n,(function(t,e,s){Wn.apply(this,[$n,e,s]),this.variables=t}));const Kn=$,Xn="staticvariable";var jn=Kn.extends(Xn,(function(t,e,s,i){Kn.apply(this,[Xn,s,i]),this.variable=t,this.defaultValue=e}));const Jn=li,qn="staticlookup";var Zn=Jn.extends(qn,(function(t,e,s,i){Jn.apply(this,[qn,t,e,s,i])}));const tr=bi,er="staticreference",sr=tr.extends(er,(function(t,e,s){tr.apply(this,[er,e,s]),this.raw=t}));var ir=sr;const nr=It,rr="string";var or=nr.extends(rr,(function(t,e,s,i,n,r){nr.apply(this,[rr,e,i,n,r]),this.unicode=s,this.isDoubleQuote=t}));const hr=yt,ar="switch";var cr=hr.extends(ar,(function(t,e,s,i,n){hr.apply(this,[ar,i,n]),this.test=t,this.body=e,this.shortForm=s}));const lr=yt,_r="throw";var ur=lr.extends(_r,(function(t,e,s){lr.apply(this,[_r,e,s]),this.what=t}));const pr=qt,dr="trait";var fr=pr.extends(dr,(function(t,e,s,i){pr.apply(this,[dr,t,s,i]),this.body=e}));const kr=$,Tr="traitalias";var xr=kr.extends(Tr,(function(t,e,s,i,n,r){kr.apply(this,[Tr,n,r]),this.trait=t,this.method=e,this.as=s,this.visibility="",i&&(0===i[0]?this.visibility="public":1===i[0]?this.visibility="protected":2===i[0]&&(this.visibility="private"))}));const Er=$,mr="traitprecedence";var yr=Er.extends(mr,(function(t,e,s,i,n){Er.apply(this,[mr,i,n]),this.trait=t,this.method=e,this.instead=s}));const Ar=$,Nr="traituse";var gr=Ar.extends(Nr,(function(t,e,s,i){Ar.apply(this,[Nr,s,i]),this.traits=t,this.adaptations=e}));const Lr=yt;var br=Lr.extends("try",(function(t,e,s,i,n){Lr.apply(this,["try",i,n]),this.body=t,this.catches=e,this.always=s}));const Ir=bi,Cr="typereference",Sr=Ir.extends(Cr,(function(t,e,s,i){Ir.apply(this,[Cr,s,i]),this.name=t,this.raw=e}));Sr.types=["int","float","string","bool","object","array","callable","iterable","void","static"];var Or=Sr;const Rr=kt,vr="unary";var wr=Rr.extends(vr,(function(t,e,s,i){Rr.apply(this,[vr,s,i]),this.type=t,this.what=e}));const Dr=qt,Ur="uniontype";var Pr=Dr.extends(Ur,(function(t,e,s){Dr.apply(this,[Ur,null,e,s]),this.types=t}));const Fr=yt,Mr="unset";var Br=Fr.extends(Mr,(function(t,e,s){Fr.apply(this,[Mr,e,s]),this.variables=t}));const Hr=yt,Gr="usegroup";var Vr=Hr.extends(Gr,(function(t,e,s,i,n){Hr.apply(this,[Gr,i,n]),this.name=t,this.type=e,this.items=s}));const Qr=yt,Yr="useitem",Wr=Qr.extends(Yr,(function(t,e,s,i,n){Qr.apply(this,[Yr,i,n]),this.name=t,this.alias=e,this.type=s}));Wr.TYPE_CONST="const",Wr.TYPE_FUNCTION="function";var $r=Wr;const zr=X,Kr="variable";var Xr=zr.extends(Kr,(function(t,e,s,i){zr.apply(this,[Kr,s,i]),this.name=t,this.curly=e||!1}));const jr=X,Jr="variadic";var qr=jr.extends(Jr,(function(t,e,s){jr.apply(this,[Jr,e,s]),this.what=t}));const Zr=$,to="variadicplaceholder";var eo=Zr.extends(to,(function(t,e){Zr.apply(this,[to,t,e])}));const so=yt,io="while";var no=so.extends(io,(function(t,e,s,i,n){so.apply(this,[io,i,n]),this.test=t,this.body=e,this.shortForm=s}));const ro=X,oo="yield";var ho=ro.extends(oo,(function(t,e,s,i){ro.apply(this,[oo,s,i]),this.value=t,this.key=e}));const ao=X,co="yieldfrom";var lo=ao.extends(co,(function(t,e,s){ao.apply(this,[co,e,s]),this.value=t}));const _o=Y,uo=x,po=function(t,e){this.withPositions=t,this.withSource=e};po.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach((function(t,e){t.forEach((function(t){po.precedence[t]=e+1}))})),po.prototype.isRightAssociative=function(t){return"**"===t||"??"===t},po.prototype.swapLocations=function(t,e,s,i){this.withPositions&&(t.loc.start=e.loc.start,t.loc.end=s.loc.end,this.withSource&&(t.loc.source=i.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},po.prototype.resolveLocations=function(t,e,s,i){this.withPositions&&(t.loc.start.offset>e.loc.start.offset&&(t.loc.start=e.loc.start),t.loc.end.offset<s.loc.end.offset&&(t.loc.end=s.loc.end),this.withSource&&(t.loc.source=i.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},po.prototype.resolvePrecedence=function(t,e){let s,i,n;return"call"===t.kind?this.resolveLocations(t,t.what,t,e):"propertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind&&t.offset?this.resolveLocations(t,t.what,t.offset,e):"bin"===t.kind?t.right&&!t.right.parenthesizedExpression&&("bin"===t.right.kind?(i=po.precedence[t.type],n=po.precedence[t.right.type],i&&n&&n<=i&&(t.type!==t.right.type||!this.isRightAssociative(t.type))&&(s=t.right,t.right=t.right.left,this.swapLocations(t,t.left,t.right,e),s.left=this.resolvePrecedence(t,e),this.swapLocations(s,s.left,s.right,e),t=s)):"retif"===t.right.kind&&(i=po.precedence[t.type],n=po.precedence["?"],i&&n&&n<=i&&(s=t.right,t.right=t.right.test,this.swapLocations(t,t.left,t.right,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s))):"silent"!==t.kind&&"cast"!==t.kind||!t.expr||t.expr.parenthesizedExpression?"unary"===t.kind?t.what&&!t.what.parenthesizedExpression&&("bin"===t.what.kind?(s=t.what,t.what=t.what.left,this.swapLocations(t,t,t.what,e),s.left=this.resolvePrecedence(t,e),this.swapLocations(s,s.left,s.right,e),t=s):"retif"===t.what.kind&&(s=t.what,t.what=t.what.test,this.swapLocations(t,t,t.what,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s)):"retif"===t.kind?t.falseExpr&&"retif"===t.falseExpr.kind&&!t.falseExpr.parenthesizedExpression&&(s=t.falseExpr,t.falseExpr=s.test,this.swapLocations(t,t.test,t.falseExpr,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s):"assign"===t.kind?t.right&&"bin"===t.right.kind&&!t.right.parenthesizedExpression&&(i=po.precedence["="],n=po.precedence[t.right.type],i&&n&&n<i&&(s=t.right,t.right=t.right.left,s.left=t,this.swapLocations(s,s.left,t.right,e),t=s)):"expressionstatement"===t.kind&&this.swapLocations(t,t.expression,t,e):"bin"===t.expr.kind?(s=t.expr,t.expr=t.expr.left,this.swapLocations(t,t,t.expr,e),s.left=this.resolvePrecedence(t,e),this.swapLocations(s,s.left,s.right,e),t=s):"retif"===t.expr.kind&&(s=t.expr,t.expr=t.expr.test,this.swapLocations(t,t,t.expr,e),s.test=this.resolvePrecedence(t,e),this.swapLocations(s,s.test,s.falseExpr,e),t=s),t},po.prototype.prepare=function(t,e,s){let i=null;(this.withPositions||this.withSource)&&(i=s.position());const n=this,r=function(){let o=null;const h=Array.prototype.slice.call(arguments);if(h.push(e),n.withPositions||n.withSource){let t=null;n.withSource&&(t=s.lexer._input.substring(i.offset,s.prev[2])),o=new _o(t,i,new uo(s.prev[0],s.prev[1],s.prev[2])),h.push(o)}t||(t=h.shift());const a=n[t];if("function"!=typeof a)throw new Error('Undefined node "'+t+'"');const c=Object.create(a.prototype);return a.apply(c,h),r.instance=c,r.trailingComments&&(c.trailingComments=r.trailingComments),"function"==typeof r.postBuild&&r.postBuild(c),s.debug&&delete n.stack[r.stackUid],n.resolvePrecedence(c,s)};return s.debug&&(this.stack||(this.stack={},this.stackUid=1),this.stack[++this.stackUid]={position:i,stack:(new Error).stack.split("\n").slice(3,5)},r.stackUid=this.stackUid),r.setTrailingComments=function(t){r.instance?r.instance.setTrailingComments(t):r.trailingComments=t},r.destroy=function(t){e&&(t?t.leadingComments?t.leadingComments=e.concat(t.leadingComments):t.leadingComments=e:s._docIndex=s._docs.length-e.length),s.debug&&delete n.stack[r.stackUid]},r},po.prototype.checkNodes=function(){const t=[];for(const e in this.stack)Object.prototype.hasOwnProperty.call(this.stack,e)&&(this.stack[e].key=e,t.push(this.stack[e]));return this.stack={},t},[q,et,nt,ht,lt,pt,xt,gt,Ot,wt,Pt,Bt,Vt,Wt,Kt,ee,ae,_e,de,ke,Ee,Ae,Le,ne,Ce,qt,ve,Ue,Fe,He,Qe,ze,je,Ze,ss,rs,as,_s,ds,X,Ts,Es,As,Ls,Cs,Rs,Ds,Ms,Hs,Qs,$s,Xs,qs,ei,ni,hi,It,li,pi,ki,Ei,Ai,Oi,wi,Pi,Mi,$,Gi,Yi,zi,ji,Zi,sn,kt,on,ln,pn,fn,xn,yn,gn,In,Rn,bi,Dn,Fn,Gn,Yn,yt,zn,jn,Zn,ir,or,cr,ur,fr,xr,yr,gr,br,Or,wr,Pr,Br,Vr,$r,Xr,qr,eo,no,ho,lo].forEach((function(t){po.prototype[t.kind]=t}));const fo=T,ko=H,To=Q,xo=po;function Eo(t,e){const s=Object.keys(t);let i=s.length;for(;i--;){const n=s[i],r=t[n];null===r?delete e[n]:"function"==typeof r?e[n]=r.bind(e):Array.isArray(r)?e[n]=Array.isArray(e[n])?e[n].concat(r):r:e[n]="object"==typeof r&&"object"==typeof e[n]?Eo(r,e[n]):r}return e}const mo=function(t){if("function"==typeof this)return new this(t);if(this.tokens=To,this.lexer=new fo(this),this.ast=new xo,this.parser=new ko(this.lexer,this.ast),t&&"object"==typeof t){if(t.parser&&(t.lexer||(t.lexer={}),t.parser.version)){if("string"==typeof t.parser.version){let e=t.parser.version.split(".");if(e=100*parseInt(e[0])+parseInt(e[1]),isNaN(e))throw new Error("Bad version number : "+t.parser.version);t.parser.version=e}else if("number"!=typeof t.parser.version)throw new Error("Expecting a number for version");if(t.parser.version<500||t.parser.version>900)throw new Error("Can only handle versions between 5.x to 8.x")}Eo(t,this),this.lexer.version=this.parser.version}},yo=function(t){return"function"==typeof t.write?t.toString():t};mo.create=function(t){return new mo(t)},mo.parseEval=function(t,e){return new mo(e).parseEval(t)},mo.prototype.parseEval=function(t){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,t=yo(t),this.parser.parse(t,"eval")},mo.parseCode=function(t,e,s){"object"!=typeof e||s||(s=e,e="unknown");return new mo(s).parseCode(t,e)},mo.prototype.parseCode=function(t,e){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,t=yo(t),this.parser.parse(t,e)},mo.tokenGetAll=function(t,e){return new mo(e).tokenGetAll(t)},mo.prototype.tokenGetAll=function(t){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,t=yo(t);const e=this.lexer.EOF,s=this.tokens.values;this.lexer.setInput(t);let i=this.lexer.lex()||e;const n=[];for(;i!=e;){let t=this.lexer.yytext;Object.prototype.hasOwnProperty.call(s,i)&&(t=[s[i],t,this.lexer.yylloc.first_line]),n.push(t),i=this.lexer.lex()||e}return n},i.exports=mo,i.exports.tokens=To,i.exports.lexer=fo,i.exports.AST=xo,i.exports.parser=ko,i.exports.combine=Eo,i.exports.Engine=mo,i.exports.default=mo;var Ao=s(i.exports);const No="PHP";var go={phpVersion:{since:"0.13.0",category:No,type:"choice",default:"7.0",description:"Minimum target PHP version.",choices:[{value:"5.0"},{value:"5.1"},{value:"5.2"},{value:"5.3"},{value:"5.4"},{value:"5.5"},{value:"5.6"},{value:"7.0"},{value:"7.1"},{value:"7.2"},{value:"7.3"},{value:"7.4"},{value:"8.0"},{value:"8.1"},{value:"8.2"},{value:"8.3"},{value:"8.4"}]},trailingCommaPHP:{since:"0.0.0",category:No,type:"boolean",default:!0,description:"Print trailing commas wherever possible when multi-line."},braceStyle:{since:"0.10.0",category:No,type:"choice",default:"per-cs",description:"Print one space or newline for code blocks (classes and functions).",choices:[{value:"psr-2",description:"(deprecated) Use per-cs"},{value:"per-cs",description:"Use the PER Coding Style brace style."},{value:"1tbs",description:"Use 1tbs brace style."}]},singleQuote:{since:"0.0.0",category:No,type:"boolean",default:!1,description:"Use single quotes instead of double quotes."}};function Lo(t,e){const s=e&&"markdown"===e.parentParser;if(!t&&s)return"";t=t.replace(/\?>\n<\?/g,"?>\n___PSEUDO_INLINE_PLACEHOLDER___<?");const i=Math.max(...go.phpVersion.choices.map((t=>parseFloat(t.value)))),n=new Ao({parser:{extractDoc:!0,version:`${i}`},ast:{withPositions:!0,withSource:!0}}),r=-1!==t.indexOf("<?php"),o=s&&!r;let h;try{h=o?n.parseEval(t):n.parseCode(t)}catch(t){throw t instanceof SyntaxError&&"lineNumber"in t&&(t.loc={start:{line:t.lineNumber,column:t.columnNumber}},delete t.lineNumber,delete t.columnNumber),t}return h.extra={parseAsEval:o},h.comments.forEach((t=>{"\n"===t.value[t.value.length-1]&&(t.value=t.value.slice(0,-1),t.loc.end.offset=t.loc.end.offset-1)})),h}const bo=t=>e=>e.loc?.[t]?.offset,Io=bo("start"),Co=bo("end"),{hasNewline:So,skipEverythingButNewLine:Oo,skipNewline:Ro}=e.util;function vo(t){return t.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(\d)/,"$1$2$3").replace(/^([+-]?[\d.]+)e[+-]?0+$/,"$1").replace(/^([+-])?\./,"$10.").replace(/(\.\d+?)0+(?=e|$)/,"$1").replace(/\.(?=e)/,"")}const wo=new Map([["or"],["xor"],["and"],["=","+=","-=","*=","**=","/=",".=","%=","&=","|=","^=","<<=",">>="],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!==","<>","<=>"],["<",">","<=",">="],[">>","<<"],["+","-","."],["*","/","%"],["!"],["instanceof"],["++","--","~"],["**"]].flatMap(((t,e)=>t.map((t=>[t,e])))));function Do(t){return wo.get(t)}const Uo=["==","!=","===","!==","<>","<=>"],Po=["*","/","%"],Fo=[">>","<<"];function Mo(t,e){return Do(e)===Do(t)&&("**"!==t&&((!Uo.includes(t)||!Uo.includes(e))&&(!("%"===e&&Po.includes(t)||"%"===t&&Po.includes(e))&&((e===t||!Po.includes(e)||!Po.includes(t))&&(!Fo.includes(t)||!Fo.includes(e))))))}function Bo(t){const e=t.children||t.body||t.adaptations;return Array.isArray(e)?e:null}function Ho(t){return t.length>0?t[t.length-1]:null}function Go(t){const{node:e}=t;if("program"===e.kind){const t=Bo(e);return!(!t||0===t.length)&&"inline"===t[0].kind}if("switch"===e.kind){if(!e.body)return!1;const t=Bo(e.body);if(0===t.length)return!1;const[s]=t;if(!s.body)return!1;const i=Bo(s.body);return 0!==i.length&&"inline"===i[0].kind}const s=function(t){let{body:e}=t;return e?("block"===e.kind&&(e=e.children),e[0]):null}(e);return!!s&&"inline"===s.kind}function Vo(t){return"nowdoc"===t.kind||"encapsed"===t.kind&&"heredoc"===t.type}function Qo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const s=t.getNode(e),i=t.getNode(e+1),n=t.getNode(e+2);if(!i)return!1;if(n&&["call","new","echo"].includes(n.kind)&&!["call","array"].includes(i.kind)||"parameter"===i.kind){const t=n.arguments.length-1;return n.arguments.indexOf(i)!==t}if(n&&"for"===n.kind){const t=n.init.indexOf(i);if(-1!==t)return t!==n.init.length-1;const e=n.test.indexOf(i);if(-1!==e)return e!==n.test.length-1;const s=n.increment.indexOf(i);if(-1!==s)return s!==n.increment.length-1}if("bin"===i.kind)return i.left===s||Qo(t,e+1);if("case"===i.kind&&i.test===s)return!0;if("staticvariable"===i.kind){const t=n.variables.length-1;return n.variables.indexOf(i)!==t}if("entry"===i.kind){if(i.key===s)return!0;const t=n.items.length-1;return n.items.indexOf(i)!==t}if(["call","new"].includes(i.kind)){const t=i.arguments.length-1;return i.arguments.indexOf(s)!==t}if("echo"===i.kind){const t=i.expressions.length-1;return i.expressions.indexOf(s)!==t}if("array"===i.kind){const t=i.items.length-1;return i.items.indexOf(s)!==t}return"retif"===i.kind&&Qo(t,e+1)}function Yo(t){const e=t.replace(/^\\/,"");return-1!==e.indexOf("\\")?e:t}function Wo(t){return t.comments&&t.comments.some((t=>!t.leading&&!t.trailing))}function $o(t){return"propertylookup"===t.kind||"nullsafepropertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind}function zo(t){const{node:e}=t;return!["try","catch"].includes(e.kind)&&Go(t)}function Ko(t){const{node:e}=t;if(["try","catch"].includes(e.kind))return!0;if("switch"===e.kind){const t=Bo(e.body);if(0===t.length)return!0;const s=Ho(t);if(!s.body)return!0;const i=Bo(s.body);return 0===i.length||"inline"!==i[0].kind}return!Go(t)}function Xo(t){return["program","declare","namespace"].includes(t.kind)}function jo(t){return["name","parentreference","selfreference","staticreference"].includes(t.kind)}function Jo(t){return"bin"===t.kind&&["||","&&"].includes(t.type)?"logical":t.kind}function qo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";const{node:s}=t;return s[e]&&s[e].children&&0===s[e].children.length&&(!s[e].comments||0===s[e].comments.length)}function Zo(t,e){let s=Io(e);return s=Oo(t,s),s=Ro(t,s),So(t,s)}function th(t){return"nowdoc"===t.kind||"encapsed"===t.kind&&"heredoc"===t.type||"entry"===t.kind&&("nowdoc"===t.value.kind||"encapsed"===t.value.kind&&"heredoc"===t.value.type)}function eh(t,e){const s=function(t,e){const s=[].concat(e);let i,n=-1;for(;i=t.getParentNode(++n);)if(-1!==s.indexOf(i.kind))return n;return-1}(t,e);return-1===s?null:t.getParentNode(s)}const sh=new Map(["__construct","__destruct","__call","__callStatic","__get","__set","__isset","__unset","__sleep","__wakeup","__toString","__invoke","__set_state","__clone","__debugInfo"].map((t=>[t.toLowerCase(),t])));function ih(t){const e=t.toLowerCase();return sh.has(e)?sh.get(e):t}function nh(t){const e=new Set(t);return t=>e.has(t?.kind)}const rh=nh(["variadicplaceholder","namedargument","nullkeyword","identifier","parameter","variable","variadic","boolean","literal","number","string","clone","cast"]),oh=nh(["array"]),hh=nh(["nullsafepropertylookup","propertylookup","staticlookup","offsetlookup","call","new"]),ah=nh(["arrowfunc"]);function ch(t){const e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return hh(t)&&e.push(t),t.what?ch(t.what,e):e}function lh(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(e<=0)return!1;const s=t=>lh(t,e-1);if(rh(t))return!0;if(oh(t))return t.items.every((t=>null===t||s(t)));if(hh(t)){const i=ch(t);return i.unshift(),i.length<=e&&i.every((t=>$o(t)?s(t.offset):t.arguments.every(s)))}return!!ah(t)&&(t.arguments.length<=e&&t.arguments.every(s))}function _h(t,e){return parseFloat(t)>=parseFloat(e)}const{addLeadingComment:uh,addDanglingComment:ph,addTrailingComment:dh,skipNewline:fh,hasNewline:kh,hasNewlineInRange:Th,getNextNonSpaceNonCommentCharacterIndex:xh,isNextLineEmpty:Eh,isPreviousLineEmpty:mh}=e.util,{join:yh,indent:Ah,hardline:Nh,cursor:gh,lineSuffix:Lh,breakParent:bh}=e.doc.builders;function Ih(t,e){const{children:s}=t;0===s.length?ph(t,e):uh(s[0],e)}function Ch(t,e){"block"===t.kind?Ih(t,e):uh(t,e)}function Sh(t,e,s,i,n){const r=xh(t,Co(n)),o=t.charAt(r);return e&&"identifier"===e.kind&&s&&("function"===s.kind||"method"===s.kind)&&")"===o?(dh(s,n),!0):!(!s||"function"!==s.kind&&"method"!==s.kind||!i||"block"!==i.kind)&&(Ih(i,n),!0)}function Oh(t,e,s,i,n){if(!s||"if"!==s.kind||!i)return!1;const r=xh(t,Co(n));return")"===t.charAt(r)?(dh(e,n),!0):e===s.body&&i===s.alternate?(ph(s,n),!0):"if"===i.kind?(Ch(i.body,n),!0):s.body===i&&(uh(i,n),!0)}function Rh(t,e,s){if(t&&["class","interface","trait"].includes(t.kind)){if(t.__parent_new_arguments?.includes(e))return!1;if(e&&t.extends)if(Array.isArray(t.extends)){if(t.extends.some((t=>{if(e&&e===t)return ph(e,s),!0})))return!0}else if(e===t.extends)return ph(e,s),!0;if(e&&t.implements&&t.implements.some((t=>{if(e&&e===t)return ph(e,s),!0})))return!0;if(!(t.body&&t.body.length>0))return ph(t,s),!0}return!!(e&&"class"===e.kind&&e.isAnonymous&&e.leadingComments&&"commentblock"===s.kind)}function vh(t,e,s,i){if(e&&("function"===e.kind||"method"===e.kind)){let s=0;for(let t=0;t<e.arguments.length;t++)s=Co(e.arguments[t])>s?Co(e.arguments[t]):s;const n=e.body&&Io(i)>s&&Co(i)<Io(e.body),r=xh(t,Co(i));if(e.type&&n&&")"!==t.charAt(r))return Co(i)<Io(e.type)?(ph(e.type,i),!0):(dh(e.type,i),!0)}return!1}function wh(t,e,s,i,n){return!(!s||!["function","method","parameter"].includes(s.kind))&&("typereference"===e.kind&&"identifier"===i.kind&&(dh(e,n),!0))}function Dh(t,e){return!(!t||!["label","goto"].includes(t.kind))&&(dh(t,e),!0)}function Uh(t,e,s,i){return s&&"inline"===s.kind?(s.leadingComments||(s.leadingComments=[]),s.leadingComments.includes(i)||s.leadingComments.push(i),!0):!(t||s||!e||"inline"!==e.kind)&&(ph(e,i),!0)}function Ph(t,e,s){return!(!t||"try"!==t.kind||!e)&&("block"===e.kind?(Ih(e,s),!0):"try"===e.kind?(Ch(e.always,s),!0):"catch"===e.kind&&(Ch(e.body,s),!0))}function Fh(t,e,s,i){return s||e||!t||"namespace"!==t.kind||t.withBrackets?!(e||!t||"namespace"!==t.kind||t.withBrackets)&&(ph(t,i),!0):(dh(t,i),!0)}function Mh(t,e,s,i){return!(!t||"declare"!==t.kind)&&((!e||"noop"!==e.kind)&&(s&&t.directives[0]!==s?!(!s||!e)&&(uh(s,i),!0):("none"===t.mode?dh(t,i):ph(t,i),!0)))}function Bh(t,e,s,i,n){if(!s||"while"!==s.kind||!i)return!1;const r=xh(t,Co(n));return")"===t.charAt(r)?(dh(e,n),!0):"block"===i.kind&&(Ih(i,n),!0)}function Hh(t,e){return t.node.printed=!0,e.printer.printComment(t,e)}function Gh(t,e,s,i){const n=[],r=t.getValue();return r&&r.comments?(t.each((()=>{const s=t.node;!s||s.leading||s.trailing||i&&!i(s)||n.push(Hh(t,e))}),"comments"),0===n.length?"":s?yh(Nh,n):Ah([Nh,yh(Nh,n)])):""}function Vh(t){return t.comments&&t.comments.some((t=>t.leading))}function Qh(t){return t.comments&&t.comments.some((t=>t.trailing))}function Yh(t,e){const s=[];return t.forEach(((t,i,n)=>{t.printed=!0;const r=n.length===i+1;s.push(t.value),r||s.push(Nh),Eh(e.originalText,Co(t))&&!r&&s.push(Nh)})),s}function Wh(t){return"commentblock"===t.kind}function $h(t,e,s){const{node:i}=t;return i&&i===e.cursorNode?[gh,s,gh]:s}function zh(t,e,s,i){const{node:n}=t,r=e(t),o=n&&n.comments;if(!o||0===o.length)return $h(t,s,r);const h=[],a=[i?";":"",r];return t.each((e=>{let{node:i}=e;const{leading:n,trailing:r}=i;if(n){const e=function(t,e,s){const i=Hh(t,s);if(!i)return"";const n=t.node;return s.printer.isBlockComment&&s.printer.isBlockComment(n)?[i,kh(s.originalText,Co(n))?Nh:" "]:[i,Nh]}(t,0,s);if(!e)return;h.push(e);const n=s.originalText;kh(n,fh(n,Co(i)))&&h.push(Nh)}else r&&a.push(function(t,e,s){const i=Hh(t,s);if(!i)return"";const n=t.node,r=s.printer.isBlockComment&&s.printer.isBlockComment(n);if(kh(s.originalText,Io(n),{backwards:!0})){const t=mh(s.originalText,Io(n));return Lh([Nh,t?Nh:"",i])}return r?[" ",i]:[Lh([" ",i]),r?"":bh]}(t,0,s))}),"comments"),$h(t,s,h.concat(a))}function Kh(t,e){const{parent:s}=t;if(!s)return!1;const{key:i,node:n}=t;if(["program","expressionstatement","namespace","declare","block","include","print","return","echo"].includes(s.kind))return!1;switch(n.kind){case"pre":case"post":if("unary"===s.kind)return"pre"===n.kind&&("+"===n.type&&"+"===s.type||"-"===n.type&&"-"===s.type);case"unary":switch(s.kind){case"unary":return n.type===s.type&&("+"===n.type||"-"===n.type);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i;case"bin":return"**"===s.type&&"left"===i;default:return!1}case"bin":switch(s.kind){case"assign":case"retif":return["and","xor","or"].includes(n.type);case"silent":case"cast":return n.parenthesizedExpression;case"pre":case"post":case"unary":return!0;case"call":case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":return"what"===i;case"bin":{const t=s.type,e=Do(t),o=n.type,h=Do(o);return e>h||("||"===t&&"&&"===o||(e===h&&"right"===i||(e===h&&!Mo(t,o)||(e<h&&"%"===o?"+"===t||"-"===t:!(!Fo[r=t]&&"|"!==r&&"^"!==r&&"&"!==r)))))}default:return!1}case"propertylookup":case"nullsafepropertylookup":case"staticlookup":return"call"===s.kind&&("what"===i&&n.parenthesizedExpression);case"clone":case"new":{const t="clone"===n.kind||"new"===n.kind&&!_h(e.phpVersion,"8.4");switch(s.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&t;default:return!1}}case"yield":switch(s.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i;case"retif":return"test"===i;default:return!(!n.key&&!n.value)}case"assign":return("for"!==s.kind||!s.init.includes(n)&&!s.increment.includes(n))&&("assign"!==s.kind&&("static"!==s.kind&&(!["if","do","while","foreach","switch"].includes(s.kind)&&("silent"!==s.kind&&"call"!==s.kind))));case"retif":switch(s.kind){case"cast":return!0;case"unary":case"bin":case"retif":return!("test"===i&&!s.trueExpr);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i;default:return!1}case"closure":switch(s.kind){case"call":return"what"===i;case"propertylookup":case"nullsafepropertylookup":return!0;default:return!1}case"silence":case"cast":return n.parenthesizedExpression;case"string":case"array":switch(s.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return(!["string","array"].includes(n.kind)||"offsetlookup"!==s.kind)&&"what"===i;default:return!1}case"print":case"include":return"bin"===s.kind}var r;return!1}const{breakParent:Xh,join:jh,line:Jh,lineSuffix:qh,group:Zh,conditionalGroup:ta,indent:ea,dedent:sa,ifBreak:ia,hardline:na,softline:ra,literalline:oa,align:ha,dedentToRoot:aa}=e.doc.builders,{willBreak:ca}=e.doc.utils,{isNextLineEmptyAfterIndex:la,hasNewline:_a,hasNewlineInRange:ua,getNextNonSpaceNonCommentCharacterIndex:pa,isNextLineEmpty:da,isPreviousLineEmpty:fa}=e.util;function ka(t,e){return!!t.trailingCommaPHP&&_h(t.phpVersion,e)}function Ta(t){return"1tbs"!==t.braceStyle}function xa(t,e,s){return[arguments.length>3&&void 0!==arguments[3]&&arguments[3]?"?":"","->",s("offset")]}function Ea(t,e,s){return xa(t,e,s,!0)}function ma(t,e,s){const{node:i}=t,n=!["variable","identifier"].includes(i.offset.kind);return["::",n?"{":"",s("offset"),n?"}":""]}function ya(t,e,s){const{node:i}=t,n=i.offset&&"number"===i.offset.kind||eh(t,"encapsed");return["[",i.offset?Zh([ea([n?"":ra,s("offset")]),n?"":ra]):"","]"]}function Aa(t){return"array"===t.kind&&(t.items.length>0||t.comments)||"function"===t.kind||"method"===t.kind||"closure"===t.kind}function Na(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"arguments";const n=t.node[i];if(0===n.length)return["(",Gh(t,e,!0),")"];let r=!1,o=!1;const h=t.map((t=>{let{node:i,isLast:n,isFirst:h}=t;const a=[s()];return n||(da(e.originalText,Co(i))?(h&&(o=!0),r=!0,a.push(",",na,na)):a.push(",",Jh)),a}),i),{node:a}=t,c=Ho(n),l=ka(e,"7.3")&&["call","new","unset","isset"].includes(a.kind)||ka(e,"8.0")&&["function","closure","method","arrowfunc","attribute"].includes(a.kind)?ea([c&&th(c)?na:"",","]):"";const _=function(t){if(2!==t.length)return!1;const[e,s]=t;return!(e.comments&&e.comments.length||"function"!==e.kind&&"method"!==e.kind&&"closure"!==e.kind||"retif"===s.kind||Aa(s))}(n),u=function(t){const e=Ho(t),s=(i=t).length>1?i[i.length-2]:null;var i;return!Vh(e)&&!Qh(e)&&Aa(e)&&(!s||s.kind!==e.kind)}(n);if(_||u){const e=(_?h.slice(1).some(ca):h.slice(0,-1).some(ca))||r;let n;t.each((t=>{let{isLast:e,isFirst:i}=t;_&&i&&(n=[s([],{expandFirstArg:!0}),h.length>1?",":"",o?na:Jh,o?na:"",h.slice(1)]),u&&e&&(n=[...h.slice(0,-1),s([],{expandLastArg:!0})])}),i);const a=h.some(ca),c=["(",...n,")"];return[a?Xh:"",ta([a?ia(Zh(["(",ea([Jh,...h]),l,Jh,")"],{shouldBreak:!0}),c):c,_?["(",Zh(n[0],{shouldBreak:!0}),...n.slice(1),")"]:["(",...h.slice(0,-1),Zh(Ho(n),{shouldBreak:!0}),")"],Zh(["(",ea([Jh,...h]),ia(l),Jh,")"],{shouldBreak:!0})],{shouldBreak:e})]}return Zh(["(",ea([ra,...h]),ia(l),ra,")"],{shouldBreak:h.some(ca)||r})}function ga(t){return"array"===t.kind&&0!==t.items.length}function La(t){return"array"===t.right.kind&&0!==t.right.items.length}function ba(t,e,s,i,n){let r=[];const{node:o}=t;if("bin"===o.kind){Mo(o.type,o.left.type)?r=r.concat(t.call((()=>ba(t,e,s,!0,n)),"left")):r.push(e("left"));const h=La(o)?[o.type," ",e("right")]:[o.type,Jh,e("right")],{parent:a}=t,c=!(n&&["||","&&"].includes(o.type))&&Jo(a)!==Jo(o)&&Jo(o.left)!==Jo(o)&&Jo(o.right)!==Jo(o),l=Vo(o.left)||"bin"===o.left.kind&&Vo(o.left.right);r.push(l?"":" ",c?Zh(h):h),i&&o.comments&&(r=zh(t,(()=>r),s))}else r.push(e());return r}function Ia(t,e,s){const{node:i}=t;switch(i.kind){case"propertylookup":return xa(t,e,s);case"nullsafepropertylookup":return Ea(t,e,s);case"staticlookup":return ma(t,0,s);case"offsetlookup":return ya(t,0,s);default:throw new Error(`Have not implemented lookup kind ${i.kind} yet.`)}}function Ca(t){let{opening:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("heredoc"===t.type)return e?`<<<${t.label}`:t.label;const s={string:'"',shell:"`"};if(s[t.type])return s[t.type];throw new Error(`Unimplemented encapsed type ${t.type}`)}function Sa(t,e,s){const i=[];let n=[];return t.each((t=>{let{node:r}=t;i.push(n),i.push(Zh(s())),n=[",",Jh],r&&da(e.originalText,Co(r))&&n.push(ra)}),"items"),i}function Oa(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children";const{node:n,parent:r}=t;let o=-1;const h=[],a=[];t.map((()=>{const{node:i,next:c,isFirst:l,isLast:_,index:u}=t,p="inline"===i.kind,d=s(),f=!_&&!p&&(c&&"case"===c.kind?!Go(t):c&&"inline"!==c.kind);let k=[d,f?na:"",f&&da(e.originalText,Co(i))?na:""];const T="block"===n.kind&&r&&["function","closure","method","try","catch"].includes(r.kind);let x=T&&l?"":" ";if(p||!p&&_&&o>=0){const e=o;p&&(o=u);if(p&&!l||!p&&_){const s=(p?e:o)+1,r=_&&!p?u+1:u,h=t.siblings[p?e:o],c=h?function(t){const e=t.split("\n").pop();return e.length-e.trimLeft().length+1}(h.raw):"",l=r-s>1,d=l?T&&!h||Xo(n)&&0===s?"":na:"",f=l&&"halt"!==i.kind?T&&_?"":na:"";l&&(x=""),a.push({start:s,end:r,alignment:c,before:d,after:f})}}if(p){const s=c&&"echo"===c.kind&&c.shortForm?"<?=":"<?php",r=i.leadingComments&&i.leadingComments.length?[l&&"namespace"!==n.kind&&!T?"<?php":"","namespace"!==n.kind&&T?"":na,Yh(i.leadingComments,e),na,"?>"]:Xo(n)&&l&&"namespace"!==n.kind?"":[x,"?>"],o=t.getNode(u+1),h=o&&o.children&&o.children.length;k=[r,k,i.comments&&i.comments.length?[s,na,h?Yh(i.comments,e):"",na]:Xo(n)&&_?"":[s," "]]}h.push(k)}),i);const c=function(t,e){if(0===e.length)return t;let s=0;return e.reduce(((e,i)=>{const{start:n,end:r,alignment:o,before:h,after:a}=i,c=[h||"",...t.slice(n,r),a||""],l=e.concat(t.slice(s,n),o?aa(Zh(ha(new Array(o).join(" "),c))):Zh(c),r===t.length-1?t.slice(r):"");return s=r,l}),[])}(h,a);if("program"===n.kind&&!n.extra.parseAsEval){const t=[],[s]=n.children;if(!s||"inline"!==s.kind){const i=e.originalText.trim().match(/^<\?(php|=)(\s+)?\S/),r=[i&&i[2]&&i[2].includes("\n")?[na,i[2].split("\n").length>2?na:""]:" ",n.comments?Yh(n.comments,e):""],o=s&&"echo"===s.kind&&s.shortForm;t.push([o?"<?=":"<?php",r])}t.push(c);if(/\?>\n?$/.test(e.originalText)){const s=Ho(n.children),i=s?[ua(e.originalText.trimEnd(),Co(s),Co(n))?"inline"===s.kind&&s.comments&&s.comments.length?"":na:" ",da(e.originalText,Co(s))?na:""]:n.comments?na:"";t.push(qh([i,"?>"]))}return t}return c}function Ra(t,e,s,i){return t.map((t=>{let{node:i,isLast:n}=t;const r=[];return r.push(s()),n||(r.push(na),da(e.originalText,Co(i))&&r.push(na)),r}),i)}function va(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"extends",n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:" ",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:" ";const o=t.node[i],h=Wo(o)?[na,t.call((()=>Gh(t,e,!0)),i),na]:n,a=Array.isArray(o)?Zh(jh(",",t.map((i=>{let{node:n}=i;const o=s();return Wo(n)?[na,Gh(t,e,!0),na,o]:[r,o]}),i))):[r,s(i)];return ea([h,i,ca(h)?ea(a):a])}function wa(t,e,s){let{inline:i=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const n=[];return t.node.attrGroups?(t.each((()=>{const r=["#["];!i&&n.length>0&&n.push(na),r.push(ra),t.each((()=>{const i=t.node;r.length>2&&r.push(",",Jh);const n=[i.name];i.args.length>0&&n.push(Na(t,e,s,"args")),r.push(Zh(n))}),"attrs"),n.push(Zh([ea(r),ia(ka(e,"8.0")?",":""),ra,"]",i?ia(ra," "):""]))}),"attrGroups"),0===n.length?[]:[...n,i?"":na]):[]}function Da(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"body";const{node:n}=t;if(!n[i])return";";const r=s(i);return[n.shortForm?":":" {",ea("block"!==n[i].kind||n[i].children&&n[i].children.length>0||n[i].comments&&n[i].comments.length>0?[zo(t)?"switch"===n.kind?" ":"":na,r]:""),"if"===n.kind&&"body"===i?"":[Ko(t)?na:"",n.shortForm?["end",n.kind,";"]:"}"]]}function Ua(t,e,s,i,n,r,o){if(!i)return e;const h=Fa(t,i,n,r,o);return Zh([e,s,h])}function Pa(t){return!!$o(t)&&(!("variable"!==t.what.kind&&!jo(t.what))||Pa(t.what))}function Fa(t,e,s,i,n){const r=i?"&":"";if(function(t,e){return e.comments&&e.comments.some((e=>e.leading&&kh(t,Co(e))))}(n.originalText,e))return ea([na,r,s]);const o="cast"===e.kind?e.expr:e;return"bin"===o.kind&&!La(o)||"retif"===o.kind&&(!o.trueExpr&&!ga(o.falseExpr)||"bin"===o.test.kind&&!La(o.test))||("variable"===t.kind||"string"===t.kind||$o(t))&&("string"===o.kind&&!Ma(o)||Pa(o))?Zh(ea([Jh,r,s])):[" ",r,s]}function Ma(t){return t.raw.includes("\n")}function Ba(t,e){return("string"===t.kind||"encapsed"===t.kind&&("string"===t.type||"shell"===t.type))&&Ma(t)&&!_a(e,Io(t),{backwards:!0})}function Ha(t,e,s){return Zh(t.map((t=>{let{isFirst:i}=t;return i?[e()]:[s,e()]}),"types"))}const Ga=new Set(["loc","range","raw","comments","leadingComments","trailingComments","parenthesizedExpression","parent","prev","start","end","tokens","errors","extra"]);function Va(t,e){if("string"===t.kind&&delete e.isDoubleQuote,["array","list"].includes(t.kind)&&delete e.shortForm,"inline"===t.kind){if(t.value.includes("___PSEUDO_INLINE_PLACEHOLDER___"))return null;e.value=e.value.replace(/\n/g,"")}if(("continue"===t.kind||"break"===t.kind)&&t.level){const{level:t}=e;"number"===t.kind&&(e.level="1"===t.value?null:t)}if("block"===t.kind&&1===t.children.length&&"block"===t.children[0].kind)for(;"block"===e.children[0].kind;)e.children=e.children[0].children;"number"===t.kind&&(e.value=vo(t.value));if(["foreach","for","if","while","do"].includes(t.kind)&&(t.body&&"block"!==t.body.kind?e.body={kind:"block",children:[e.body]}:e.body=e.body?e.body:null,t.alternate&&"block"!==t.alternate.kind?e.alternate={kind:"block",children:[e.alternate]}:e.alternate=e.alternate?e.alternate:null),"usegroup"===t.kind&&"string"==typeof t.name&&(e.name=e.name.replace(/^\\/,"")),"useitem"===t.kind&&(e.name=e.name.replace(/^\\/,"")),"method"===t.kind&&"identifier"===t.name.kind&&(e.name.name=ih(e.name.name)),"noop"===t.kind)return null}Va.ignoredProperties=Ga;const Qa=/@prettier|@format/,Ya=function(t){const e=new Map;return s=>(e.has(s)||e.set(s,t(s)),e.get(s))}((t=>{const e=Lo(t),[s]=e.children,[i]=e.comments.filter((t=>"commentblock"===t.kind));if(s&&i&&i.loc.start.line<s.loc.start.line)return i}));const{join:Wa,hardline:$a}=e.doc.builders;function za(t,e){let{extend:s,override:i}=e;const n={};for(const e in t){n["languageId"===e?"linguistLanguageId":e]=t[e]}if(s)for(const t in s)n[t]=(n[t]||[]).concat(s[t]);for(const t in i)n[t]=i[t];return n}const Ka=[za({name:"PHP",type:"programming",color:"#4F5D95",extensions:[".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"],tmScope:"text.html.php",aceMode:"php",languageId:272,aliases:["inc"],codemirrorMode:"php",codemirrorMimeType:"application/x-httpd-php",interpreters:["php"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},{override:{parsers:["php"],vscodeLanguageIds:["php"]}}),za({name:"HTML+PHP",type:"markup",color:"#4f5d95",extensions:[".phtml"],tmScope:"text.html.php",aceMode:"php",languageId:151,codemirrorMode:"php",codemirrorMimeType:"application/x-httpd-php",group:"HTML"},{override:{parsers:["php"],vscodeLanguageIds:["php"]}})],Xa={php:{parse:Lo,astFormat:"php",locStart:Io,locEnd:Co,hasPragma:function(t){if(!Qa.test(t))return!1;const e=Ya(t);if(e){const{value:t}=e;return Qa.test(t)}return!1}}},ja=new Set(["kind","loc","errors","extra","comments","leadingComments","enclosingNode","precedingNode","followingNode"]);const Ja={php:{print:function(t,e,s){const{node:i}=t;if("string"==typeof i)return i;const n=function(t,e,s){const{node:i}=t;switch(i.kind){case"program":return Zh([Oa(t,e,s),Gh(t,e,!0,(t=>!t.printed))]);case"expressionstatement":return s("expression");case"block":return[Oa(t,e,s),Gh(t,e,!0)];case"declare":{const n=t=>jh(", ",t.map(s,"directives"));return["block","short"].includes(i.mode)?["declare(",n(t),")","block"===i.mode?" {":":",i.children.length>0?ea([na,Oa(t,e,s)]):"",Gh(t,e),na,"block"===i.mode?"}":"enddeclare;"]:["declare(",n(t),")","inline"===t.next?.kind?"":";"]}case"declaredirective":return[s("key"),"=",s("value")];case"namespace":return["namespace ",i.name&&"string"==typeof i.name?[i.name,i.withBrackets?" ":""]:"",i.withBrackets?"{":";",Wo(i)?[" ",Gh(t,e,!0)]:"",i.children.length>0?i.withBrackets?ea([na,Oa(t,e,s)]):["inline"===i.children[0].kind?"":[na,Zo(e.originalText,i)?na:""],Oa(t,e,s)]:"",i.withBrackets?[na,"}"]:""];case"usegroup":return Zh(["use ",i.type?[i.type," "]:"",ea([i.name?[Yo(i.name),"\\{",ra]:"",jh([",",Jh],t.map(s,"items"))]),i.name?[ia(ka(e,"7.2")?",":""),ra,"}"]:""]);case"useitem":return[i.type?[i.type," "]:"",Yo(i.name),Wo(i)?[" ",Gh(t,e,!0)]:"",i.alias?[" as ",s("alias")]:""];case"class":case"enum":case"interface":case"trait":return function(t,e,s){const{node:i}=t,n="class"===i.kind&&i.isAnonymous,r=wa(t,e,s,{inline:n}),o=n?[]:[...r];i.isFinal&&o.push("final ");i.isAbstract&&o.push("abstract ");i.isReadonly&&o.push("readonly ");o.push(n?"":i.kind),i.name&&o.push(" ",s("name"));"enum"===i.kind&&i.valueType&&o.push(": ",s("valueType"));i.extends&&i.implements?o.push(ta([[va(t,e,s,"extends"),va(t,e,s,"implements")],[va(t,e,s,"extends"),va(t,e,s,"implements"," ",na)],[va(t,e,s,"extends",na," "),va(t,e,s,"implements",na,i.implements.length>1?na:" ")]],{shouldBreak:Wo(i.extends)})):(i.extends&&o.push(ta([va(t,e,s,"extends"),va(t,e,s,"extends"," ",na),va(t,e,s,"extends",na,i.extends.length>1?na:" ")])),i.implements&&o.push(ta([va(t,e,s,"implements"),va(t,e,s,"implements"," ",na),va(t,e,s,"implements",na,i.implements.length>1?na:" ")])));const h=i.body&&0===i.body.length&&!Wo(i),a=Zh([Zh(o),Ta(e)&&!h?n?Jh:na:" "]),c=["{",ea([h?"":na,Ra(t,e,s,"body")]),Gh(t,e,!0),h?"":na,"}"];return[a,c]}(t,e,s);case"traitprecedence":return[s("trait"),"::",s("method")," insteadof ",jh(", ",t.map(s,"instead"))];case"traitalias":return[i.trait?[s("trait"),"::"]:"",i.method?s("method"):""," as ",jh(" ",[...i.visibility?[i.visibility]:[],...i.as?[s("as")]:[]])];case"traituse":return Zh(["use ",ea(Zh(jh([",",Jh],t.map(s,"traits")))),i.adaptations?[" {",i.adaptations.length>0?[ea([na,Ra(t,e,s,"adaptations")]),na]:Wo(i)?[Jh,Gh(t,e,!0),Jh]:"","}"]:""]);case"function":case"closure":case"method":return function(t,e,s){const{node:i}=t,n=wa(t,e,s,{inline:"closure"===i.kind}),r=[];i.isFinal&&r.push("final ");i.isAbstract&&r.push("abstract ");i.visibility&&r.push(i.visibility," ");i.isStatic&&r.push("static ");r.push("function "),i.byref&&r.push("&");i.name&&r.push(s("name"));r.push(Na(t,e,s)),i.uses&&i.uses.length>0&&r.push(Zh([" use ",Na(t,e,s,"uses")]));i.type&&r.push([": ",Wo(i.type)?[t.call((()=>Gh(t,e,!0)),"type")," "]:"",i.nullable?"?":"",s("type")]);const o=r;if(!i.body)return[...n,o];const h=["{",ea([qo(t)?"":na,s("body")]),qo(t)?"":na,"}"],a="closure"===i.kind;if(a)return[...n,o," ",h];if(0===i.arguments.length)return[...n,o,Ta(e)&&!qo(t)?na:" ",h];const c=r.some(ca);if(c)return[...n,o," ",h];return[...n,ta([[o,Ta(e)&&!qo(t)?na:" ",h],[o," ",h]])]}(t,e,s);case"arrowfunc":return[i.parenthesizedExpression?"(":"",...wa(t,e,s,{inline:!0}),i.isStatic?"static ":"","fn",Na(t,e,s),i.type?[": ",i.nullable?"?":"",s("type")]:""," => ",s("body"),i.parenthesizedExpression?")":""];case"parameter":{let n="";1===i.flags?n="public ":2===i.flags?n="protected ":4===i.flags&&(n="private ");const r=[...wa(t,e,s,{inline:!0}),n,i.readonly?"readonly ":"",i.nullable?"?":"",i.type?[s("type")," "]:"",i.byref?"&":"",i.variadic?"...":"","$",s("name")];return i.value?Zh([r,Wo(i)?" ":"",Gh(t,e,!0)," =",Fa(i.name,i.value,s("value"),!1,e)]):r}case"variadic":return["...",s("what")];case"property":return Zh([i.readonly?"readonly ":"",i.type?[i.nullable?"?":"",s("type")," "]:"","$",s("name"),i.value?[" =",Fa(i.name,i.value,s("value"),!1,e)]:""]);case"propertystatement":{const n=[];t.each((()=>{n.push(...wa(t,e,s))}),"properties");const r=t.map(s,"properties"),o=i.properties.some((t=>t.value));let h;1!==r.length||i.properties[0].comments?r.length>0&&(h=ea(r[0])):[h]=r;const a=i.visibility||null===i.visibility;return Zh([...n,a?[null===i.visibility?"var":i.visibility,""]:"",i.isStatic?[a?" ":"","static"]:"",h?[" ",h]:"",ea(r.slice(1).map((t=>[",",o?na:Jh,t])))])}case"if":{const n=[],r=Da(t,e,s,"body"),o=Zh(["if (",Zh([ea([ra,s("test")]),ra]),")",r]);if(n.push(o,Go(t)||!i.body?"":na),i.alternate){n.push(i.shortForm?"":"} ");const r=Qh(i.body)&&i.body.comments.some((t=>t.trailing&&!Wh(t)))||function(t){if(!t.comments)return!1;const e=Ho(t.comments.filter((t=>!t.leading&&!t.trailing)));return e&&!Wh(e)}(i),o=!r;n.push(o?"":na),Wo(i)&&n.push(da(e.originalText,Co(i.body))?na:"",Gh(t,e,!0),r?na:" "),n.push("else",Zh("if"===i.alternate.kind?s("alternate"):Da(t,e,s,"alternate")))}else n.push(i.body?i.shortForm?"endif;":"}":"");return n}case"do":return["do",Da(t,e,s,"body")," while (",Zh([ea([ra,s("test")]),ra]),")"];case"while":case"switch":return Zh([i.kind," (",Zh([ea([ra,s("test")]),ra]),")",Da(t,e,s,"body")]);case"for":{const n=Da(t,e,s,"body"),r=Gh(t,e,!0),o=r?[r,ra]:"";return i.init.length||i.test.length||i.increment.length?[o,Zh(["for (",Zh([ea([ra,Zh(jh([",",Jh],t.map(s,"init"))),";",Jh,Zh(jh([",",Jh],t.map(s,"test"))),";",Jh,Zh(jh([",",Jh],t.map(s,"increment")))]),ra]),")",n])]:[o,Zh(["for (;;)",n])]}case"foreach":{const n=Da(t,e,s,"body"),r=Gh(t,e,!0);return[r?[r,ra]:"",Zh(["foreach (",Zh([ea([ra,s("source"),Jh,"as ",Zh(i.key?ea(jh([" =>",Jh],[s("key"),s("value")])):s("value"))]),ra]),")",n])]}case"try":{const n=[];return n.push("try",Da(t,e,s,"body")),i.catches&&n.push(t.map(s,"catches")),i.always&&n.push(" finally",Da(t,e,s,"always")),n}case"catch":return[" catch",i.what?[" (",jh(" | ",t.map(s,"what")),i.variable?[" ",s("variable")]:"",")"]:"",Da(t,e,s,"body")];case"case":return[i.test?["case ",i.test.comments?ea(s("test")):s("test"),":"]:"default:",i.body&&i.body.children&&i.body.children.length?ea([Go(t)?"":na,s("body")]):""];case"break":case"continue":return i.level&&("number"===i.level.kind&&"1"!==i.level.value)?[`${i.kind} `,s("level")]:i.kind;case"call":return 1===i.arguments.length&&Ba(i.arguments[0],e.originalText)?[s("what"),"(",jh(", ",t.map(s,"arguments")),")"]:$o(i.what)?function(t,e,s){const i=[];function n(t){const{originalText:s}=e,i=pa(s,Co(t));return")"===s.charAt(i)?la(s,i+1,e):da(s,Co(t))}function r(t){const{node:o}=t;if("call"!==o.kind||!$o(o.what)&&"call"!==o.what.kind)if($o(o)){let n=null;n="propertylookup"===o.kind?xa(t,e,s):"nullsafepropertylookup"===o.kind?Ea(t,e,s):"staticlookup"===o.kind?ma(t,e,s):ya(t,e,s),i.unshift({node:o,needsParens:Kh(t,e),printed:zh(t,(()=>n),e)}),t.call((t=>r(t)),"what")}else i.unshift({node:o,printed:s()});else i.unshift({node:o,printed:[zh(t,(()=>Na(t,e,s)),e),n(o)?na:""]}),t.call((t=>r(t)),"what")}const{node:o}=t;i.unshift({node:o,printed:Na(t,e,s)}),t.call((t=>r(t)),"what");for(let t=0;t<i.length;++t)"call"===i[t].node.kind&&i[t-1]&&["propertylookup","nullsafepropertylookup","staticlookup"].includes(i[t-1].node.kind)&&i[t-1].needsParens&&(i[0].printed=["(",i[0].printed],i[t-1].printed=[i[t-1].printed,")"]);const h=[];let a=[i[0]],c=1;for(;c<i.length&&("call"===i[c].node.kind||$o(i[c].node)&&i[c].node.offset&&"number"===i[c].node.offset.kind);++c)a.push(i[c]);if("call"!==i[0].node.kind)for(;c+1<i.length&&($o(i[c].node)&&$o(i[c+1].node));++c)a.push(i[c]);h.push(a),a=[];let l=!1;for(;c<i.length;++c){if(l&&$o(i[c].node)){if("offsetlookup"===i[c].node.kind&&i[c].node.offset&&"number"===i[c].node.offset.kind){a.push(i[c]);continue}h.push(a),a=[],l=!1}"call"===i[c].node.kind&&(l=!0),a.push(i[c]),i[c].node.comments&&Qh(i[c].node)&&(h.push(a),a=[],l=!1)}a.length>0&&h.push(a);function _(t){const s=t[1].length&&"offsetlookup"===t[1][0].node.kind;if(1===t[0].length){const e=t[0][0].node;return"variable"===e.kind&&("this"===e.name||u&&i(e.name))||jo(e)}function i(t){return t.length<e.tabWidth}const n=Ho(t[0]).node;return $o(n)&&("identifier"===n.offset.kind||"variable"===n.offset.kind)&&s}const u="expressionstatement"===t.parent.kind,p=h.length>=2&&!h[1][0].node.comments&&_(h);function d(t){const e=[];for(let s=0;s<t.length;s++)t[s+1]&&t[s+1].needsParens?(e.push("(",t[s].printed,t[s+1].printed,")"),s++):e.push(t[s].printed);return e}function f(t){return 0===t.length?"":ea(Zh([na,jh(na,t.map(d))]))}const k=h.map(d),T=k,x=p?3:2,E=h.slice(0,x).flat(),m=E.slice(1,-1).some((t=>Vh(t.node)))||E.slice(0,-1).some((t=>Qh(t.node)))||h[x]&&Vh(h[x][0].node),y=eh(t,"encapsed");if(h.length<=x&&!m||y)return Zh(T);const A=Ho(p?h.slice(1,2)[0]:h[0]).node,N="call"!==A.kind&&n(A),g=[d(h[0]),p?h.slice(1,2).map(d):"",N?na:"",f(h.slice(p?2:1))],L=i.filter((t=>"call"===t.node.kind));if(m||L.length>2&&L.some((t=>!t.node.arguments.every((t=>lh(t)))))||k.slice(0,-1).some(ca))return Zh(g);return[ca(T)||N?Xh:"",ta([T,g])]}(t,e,s):[s("what"),Na(t,e,s)];case"new":{const n=i.what&&"class"===i.what.kind&&i.what.isAnonymous;if(!n&&1===i.arguments.length&&Ba(i.arguments[0],e.originalText))return["new ",...t.call(wa,"what"),s("what"),"(",jh(", ",t.map(s,"arguments")),")"];const r=[];if(r.push("new "),n)r.push(i.what.leadingComments&&"commentblock"===i.what.leadingComments[0].kind?[Yh(i.what.leadingComments,e)," "]:"",...t.call((()=>wa(t,e,s,{inline:!0})),"what"),"class",i.arguments.length>0?[" ",Na(t,e,s)]:"",Zh(s("what")));else{const n=["call","offsetlookup"].includes(i.what.kind),o=[n?"(":"",s("what"),n?")":"",Na(t,e,s)];r.push(Vh(i.what)?ea(o):o)}return r}case"clone":return["clone ",i.what.comments?ea(s("what")):s("what")];case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":{const{parent:n}=t;let r,o=0;do{r=t.getParentNode(o),o++}while(r&&$o(r));const h=eh(t,"encapsed")||r&&("new"===r.kind||"assign"===r.kind&&"variable"!==r.left.kind)||"offsetlookup"===i.kind||(jo(i.what)||"variable"===i.what.kind)&&["identifier","variable","encapsedpart"].includes(i.offset.kind)&&n&&!$o(n);return[s("what"),h?Ia(t,e,s):Zh(ea([ra,Ia(t,e,s)]))]}case"exit":return Zh([i.useDie?"die":"exit","(",i.expression?Ba(i.expression,e.originalText)?s("expression"):[ea([ra,s("expression")]),ra]:Gh(t,e),")"]);case"global":return Zh(["global ",ea(jh([",",Jh],t.map(s,"items")))]);case"include":return[i.require?"require":"include",i.once?"_once":""," ",i.target.comments?ea(s("target")):s("target")];case"label":return[s("name"),":"];case"goto":return["goto ",s("label")];case"throw":return["throw ",i.what.comments?ea(s("what")):s("what")];case"silent":return["@",s("expr")];case"halt":return[Wo(i)?[Gh(t,e,!0),na]:"","__halt_compiler();",i.after];case"eval":return Zh(["eval(",Ba(i.source,e.originalText)?s("source"):[ea([ra,s("source")]),ra],")"]);case"echo":{const e=t.map(s,"expressions");let n;return 1!==e.length||i.expressions[0].comments?e.length>0&&(n=Vo(i.expressions[0])||i.expressions[0].comments?ea(e[0]):sa(e[0])):[n]=e,Zh([i.shortForm?"":"echo ",n||"",ea(e.slice(1).map((t=>[",",Jh,t])))])}case"print":return["print ",i.expression.comments?ea(s("expression")):s("expression")];case"return":{const n=[];if(n.push("return"),i.expr){const t=s("expr");n.push(" ",i.expr.comments?ea(t):t)}return Wo(i)&&n.push(" ",Gh(t,e,!0)),n}case"isset":case"unset":return Zh([i.kind,Na(t,e,s,"variables")]);case"empty":return Zh(["empty(",ea([ra,s("expression")]),ra,")"]);case"variable":{const{parent:e,grandparent:n}=t,r="assign"===e.kind?"":i.byref?"&":"",o="encapsedpart"===e.kind&&"simple"===e.syntax&&e.curly||n&&"offsetlookup"===e.kind&&"encapsedpart"===n.kind&&"simple"===n.syntax&&n.curly?"":"$",h=i.curly?"{":"",a=i.curly?"}":"";return[r,o,h,s("name"),a]}case"constantstatement":case"classconstant":{const n=wa(t,e,s),r=t.map(s,"constants");let o;return 1!==r.length||i.constants[0].comments?r.length>0&&(o=ea(r[0])):[o]=r,Zh([...n,i.final?"final ":"",i.visibility?[i.visibility," "]:"","const",i.type?[i.nullable?" ?":" ",s("type")]:"",o?[" ",o]:"",ea(r.slice(1).map((t=>[",",na,t])))])}case"constant":return Ua(i.name,s("name")," =",i.value,s("value"),!1,e);case"static":{const e=t.map(s,"variables"),n=i.variables.some((t=>t.defaultValue));let r;return 1!==e.length||i.variables[0].comments?e.length>0&&(r=ea(e[0])):[r]=e,Zh(["static",r?[" ",r]:"",ea(e.slice(1).map((t=>[",",n?na:Jh,t])))])}case"staticvariable":return Ua(i.variable,s("variable")," =",i.defaultValue,s("defaultValue"),!1,e);case"list":case"array":{const n="array"===i.kind&&_h(e.phpVersion,"5.4")||"list"===i.kind&&(i.shortForm||_h(e.phpVersion,"7.1")),r=n?"[":[i.kind,"("],o=n?"]":")";if(0===i.items.length)return Wo(i)?Zh([r,Gh(t,e),ra,o]):[r,o];const h=Ho(i.items),a=h&&"noop"===h.kind,[c]=i.items.filter((t=>"noop"!==t.kind)).sort(((t,e)=>Io(t)-Io(e))),l=!(!c||!c.key)&&c&&ua(e.originalText,Io(i),Io(c));return Zh([r,ea([ra,Sa(t,e,s)]),a?",":"",ia(!a&&ka(e,"5.0")?[h&&th(h)?na:"",","]:""),Gh(t,e,!0),ra,o],{shouldBreak:l})}case"entry":{const t=i.byRef?"&":"",n=i.unpack?"...":"";return i.key?Ua(i.key,s("key")," =>",i.value,s("value"),t,e):[t,n,s("value")]}case"yield":{const t=[i.key?[s("key")," => "]:"",s("value")];return["yield",i.key||i.value?" ":"",i.value&&i.value.comments?ea(t):t]}case"yieldfrom":return["yield from ",i.value.comments?ea(s("value")):s("value")];case"unary":return[i.type,s("what")];case"pre":return[i.type+i.type,s("what")];case"post":return[s("what"),i.type+i.type];case"cast":return["(",i.type,") ",i.expr.comments?ea(s("expr")):s("expr")];case"assignref":case"assign":{const t="assignref"===i.kind;return Ua(i.left,s("left"),[" ",t?"=":i.operator],i.right,s("right"),t,e)}case"bin":{const{parent:n,grandparent:r}=t,o=i!==n.body&&("if"===n.kind||"while"===n.kind||"switch"===n.kind||"do"===n.kind),h=ba(t,s,e,!1,o);if(o)return h;if("unary"===n.kind||$o(n)&&"offsetlookup"!==n.kind)return Zh([ea([ra,...h]),ra]);const a=i!==n.body&&"for"===n.kind||"retif"===n.kind&&r&&"return"!==r.kind,c=["assign","property","constant","staticvariable","entry"].includes(n.kind),l="bin"===i.left.kind&&Mo(i.type,i.left.type);if(a||La(i)&&!l||!La(i)&&c)return Zh(h);const _=h.slice(1);return Zh([h.length>0?h[0]:"",ea(_)])}case"retif":{const e=[],{parent:n}=t;let r,o=0;do{r=t.getParentNode(o),o++}while(r&&"retif"===r.kind);const h=r||n,a="bin"===i.falseExpr.kind?ea(s("falseExpr")):s("falseExpr"),c=[i.trueExpr?Jh:" ","?",i.trueExpr?[" ","bin"===i.trueExpr.kind?ea(s("trueExpr")):s("trueExpr"),Jh]:"",":",i.trueExpr?[" ",a]:[ga(i.falseExpr)?" ":Jh,a]];e.push(c);const l=t=>n===h?Zh(t):t,_=t.grandparent,u="cast"===n.kind&&_?_:n,p=["propertylookup","nullsafepropertylookup","staticlookup"].includes(u.kind),d=s("test");if(!i.trueExpr){const t=[d,"bin"===u.kind||["print","echo","return","include"].includes(h.kind)?ea(e):e];return"call"===u.kind&&u.what===i||"unary"===u.kind||$o(u)&&"offsetlookup"!==u.kind?Zh([ea([ra,t]),ra]):l(t)}return l(["retif"===i.test.kind?ea(d):d,ea(e),p?ra:""])}case"boolean":return i.value?"true":"false";case"number":return vo(i.value);case"string":{const{parent:s}=t;if("encapsedpart"===s.kind){const s=t.grandparent;let n=0;const r=_h(e.phpVersion,"7.3");let o=oa;if("heredoc"===s.type){o=r?na:oa;const t=s.raw.split("\n");n=t[t.length-1].search(/\S/),-1===n&&(n=t[t.length-2].search(/\S/))}return jh(o,i.raw.split("\n").map(((t,e)=>e>0||0===i.loc.start.column?t.substring(n):t)))}const n=function(t,e){if(t.isDoubleQuote===e.singleQuote){const e=t.raw.slice("b"===t.raw[0]?2:1,-1).match(/\\([$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})|\r?\n|'|"|\$/);return t.isDoubleQuote?e:!e}return t.isDoubleQuote}(i,e)?'"':"'";let r=i.raw;return"b"===i.raw[0]&&(r=r.slice(1)),['"',"'"].includes(r[0])&&(r=r.substr(1)),['"',"'"].includes(r[r.length-1])&&(r=r.substr(0,r.length-1)),["b"===i.raw[0]?"b":"",n,jh(oa,r.split("\n")),n]}case"intersectiontype":return Ha(t,s,"&");case"uniontype":return Ha(t,s,"|");case"encapsedpart":{const t="simple"===i.syntax&&i.curly||"complex"===i.syntax?[i.curly?"$":"","{"]:"",e="simple"===i.syntax&&i.curly||"complex"===i.syntax?"}":"";return[t,s("expression"),e]}case"encapsed":switch(i.type){case"string":case"shell":case"heredoc":{const n=_h(e.phpVersion,"7.3")?na:oa;return[Ca(i),"heredoc"===i.type?n:"",...t.map(s,"value"),Ca(i,{opening:!1}),"heredoc"===i.type&&Qo(t)?na:""]}default:throw new Error(`Have not implemented kind ${i.type} yet.`)}case"inline":return jh(oa,i.raw.replace("___PSEUDO_INLINE_PLACEHOLDER___","").split("\n"));case"magic":return i.value;case"nowdoc":{const s=_h(e.phpVersion,"7.3")?na:oa;return["<<<'",i.label,"'",s,jh(s,i.value.split("\n")),s,i.label,Qo(t)?na:""]}case"name":return["rn"===i.resolution?"namespace\\":"",i.name];case"literal":return s("value");case"parentreference":return"parent";case"selfreference":return"self";case"staticreference":return"static";case"typereference":return i.name;case"nullkeyword":return"null";case"identifier":{const{parent:e}=t;return"method"===e.kind&&(i.name=ih(i.name)),s("name")}case"match":{const i=t.map((()=>{const i=t.node,n=Vh(i)?[Yh(i.leadingComments,e),na]:[],r=!t.isLast||e.trailingCommaPHP?",":"",o=Qh(i)?[" ",Yh(i.comments.filter((t=>t.trailing)),e)]:[],h=null===i.conds?"default":t.map((t=>{let{isFirst:e}=t;return[",",Jh,s()].slice(e?2:0)}),"conds"),a=s("body"),c=!t.isFirst&&fa(e.originalText,Io(i))?na:"";return["",na,c,...n,Zh([Zh([h,ea(Jh)]),"=> ",a,r,...o])].slice(t.isFirst?1:0)}),"arms");return Zh(["match (",Zh([ea([ra,s("cond")]),ra]),") {",Zh(ea([...i]))," ",ra,"}"])}case"noop":return i.comments?Yh(i.comments,e):"";case"namedargument":return[i.name,": ",s("value")];case"enumcase":return Zh(["case ",s("name"),i.value?[" =",Fa(i.name,i.value,s("value"),!1,e)]:""]);case"variadicplaceholder":return"...";default:throw new Error(`Have not implemented kind '${i.kind}' yet.`)}}(t,e,s),r=[],o=Kh(t,e);return o&&r.unshift("("),r.push(n),o&&r.push(")"),function(t){const{node:e,parent:s}=t;if(!s)return!1;if(["for","foreach","while","do","if","switch"].includes(s.kind)&&"block"!==e.kind&&"if"!==e.kind&&(s.body===e||s.alternate===e))return!0;if(!function(t){return["block","program","namespace","class","enum","interface","trait","traituse","declare"].includes(t.kind)}(s))return!1;if("echo"===e.kind&&e.shortForm)return!1;if("traituse"===e.kind)return!e.adaptations;if("method"===e.kind&&e.isAbstract)return!0;if("method"===e.kind){const{parent:e}=t;if(e&&"interface"===e.kind)return!0}return["expressionstatement","do","usegroup","classconstant","propertystatement","traitprecedence","traitalias","goto","constantstatement","enumcase","global","static","echo","unset","return","break","continue","throw"].includes(e.kind)}(t)&&r.push(";"),function(t){const{node:e}=t,s="program"===e.kind,i=e.children&&Ho(e.children);if(!s)return!1;if(i&&["halt","inline"].includes(i.kind))return!1;if(i&&("declare"===i.kind||"namespace"===i.kind)){const t=i.children.length>0&&Ho(i.children);if(t&&["halt","inline"].includes(t.kind))return!1}return!0}(t)&&r.push(na),r},getVisitorKeys:function(t,e){return Object.keys(t).filter((t=>!e.has(t)&&!ja.has(t)))},insertPragma:function(t){const e=Ya(t);if(e){const{start:{offset:s},end:{offset:i}}=e.loc,n=t.substring(0,s),r=t.substring(i);return`${n}${function(t){let e=t.split("\n");if(1===e.length){const[,t]=/\/*\*\*(.*)\*\//.exec(e[0]);e=["/**",` * ${t.trim()}`," */"]}const s=e.findIndex((t=>/@\S/.test(t)))||1;return e.splice(s,0," * @format"),e.join("\n")}(e.value)}${r}`}const s="<?php";return t.startsWith(s)?`${t.substring(0,5)}\n/** \n * @format \n */\n${t.substring(5)}`:t},massageAstNode:Va,getCommentChildNodes:function(t){if("new"===t.kind&&"class"===t.what.kind)return t.what.__parent_new_arguments=[...t.arguments],[t.what]},canAttachComment:function(t){return t.kind&&"commentblock"!==t.kind&&"commentline"!==t.kind},isBlockComment:Wh,handleComments:{ownLine:function(t,e,s){const{precedingNode:i,enclosingNode:n,followingNode:r}=t;return Sh(e,i,n,r,t)||function(t,e,s){if(t&&$o(t)&&e&&["identifier","variable","encapsed"].includes(e.kind))return uh(t,s),!0;return!1}(n,r,t)||Oh(e,i,n,r,t)||Bh(e,i,n,r,t)||Ph(n,r,t)||Rh(n,r,t)||wh(e,i,n,r,t)||vh(e,n,r,t)||function(t,e,s,i){if(!s&&t&&("for"===t.kind||"foreach"===t.kind))return t.body&&"block"!==t.body.kind?uh(s,i):uh(t,i),!0;return!1}(n,0,r,t)||Uh(n,i,r,t)||Mh(n,i,r,t)},endOfLine:function(t,e,s){const{precedingNode:i,enclosingNode:n,followingNode:r}=t;return function(t,e,s,i,n){if(!e&&!i&&s&&"array"===s.kind)return dh(s,n),!0;return!1}(0,i,n,r,t)||function(t,e,s,i,n){if(s&&"return"===s.kind&&!s.expr)return dh(s,n),!0;return!1}(0,0,n,0,t)||Sh(e,i,n,r,t)||function(t,e,s,i,n){const r=e&&!Th(n,Co(e),Io(i));if((!e||!r)&&t&&"retif"===t.kind&&s)return uh(s,i),!0;return!1}(n,i,r,t,e)||Oh(e,i,n,r,t)||Bh(e,i,n,r,t)||Ph(n,r,t)||Rh(n,r,t)||wh(e,i,n,r,t)||vh(e,n,r,t)||function(t,e){if(t&&"entry"===t.kind)return uh(t,e),!0;return!1}(n,t)||function(t,e,s){if(e&&"call"===e.kind&&t&&e.what===t&&e.arguments.length>0)return uh(e.arguments[0],s),!0;return!1}(i,n,t)||function(t,e,s){if(t&&"assign"===t.kind&&e){const i=t.loc.start.offset+t.loc.source.indexOf("=");if(s.loc.start.offset>i)return uh(e,s),!0}return!1}(n,r,t)||Uh(n,i,r,t)||Fh(n,i,r,t)||Mh(n,i,r,t)||Dh(n,t)},remaining:function(t,e,s){const{precedingNode:i,enclosingNode:n,followingNode:r}=t;return Oh(e,i,n,r,t)||Bh(e,i,n,r,t)||function(t,e,s){const i=xh(t,Co(s));if(")"!==t.charAt(i))return!1;if(e&&("function"===e.kind||"closure"===e.kind||"method"===e.kind||"call"===e.kind||"new"===e.kind)&&0===e.arguments.length)return ph(e,s),!0;return!1}(e,n,t)||Rh(n,r,t)||function(t,e,s){if(t&&"traituse"===t.kind&&t.adaptations&&!t.adaptations.length)return ph(t,s),!0;return!1}(n,0,t)||wh(e,i,n,r,t)||vh(e,n,r,t)||Dh(n,t)||function(t,e,s,i){if(e&&"halt"===e.kind)return ph(e,i),!0;if(t&&"halt"===t.kind)return ph(t,i),!0;return!1}(i,n,0,t)||function(t,e){if(t&&("continue"===t.kind||"break"===t.kind)&&!t.label)return dh(t,e),!0;return!1}(n,t)||Uh(n,i,r,t)||Fh(n,i,r,t)}},willPrintOwnComments(t){const{node:e}=t;return e&&"noop"===e.kind},printComment(t){const e=t.node;switch(e.kind){case"commentblock":{if(!e.value.includes("\n"))return e.value;const t=e.value.split("\n");return t.slice(1,t.length-1).every((t=>"*"===t.trim()[0]))?Wa($a,t.map(((e,s)=>(s>0?" ":"")+(s<t.length-1?e.trim():e.trimLeft())))):e.value}case"commentline":return e.value.trimRight();default:throw new Error(`Not a comment: ${JSON.stringify(e)}`)}},hasPrettierIgnore(t){const e=t=>t.value.includes("prettier-ignore")&&!t.value.includes("prettier-ignore-start")&&!t.value.includes("prettier-ignore-end"),{node:s,parent:i}=t;return s&&"classconstant"!==s.kind&&s.comments&&s.comments.length>0&&s.comments.some(e)||s&&"constant"===s.kind&&i&&"classconstant"===i.kind&&i.comments&&i.comments.length>0&&i.comments.some(e)}}};t.defaultOptions={tabWidth:4},t.languages=Ka,t.options=go,t.parsers=Xa,t.printers=Ja}));