@prettier/plugin-php 0.17.3 → 0.18.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/package.json +10 -15
- package/src/.printer.js.swp +0 -0
- package/src/index.js +18 -5
- package/src/needs-parens.js +8 -0
- package/src/printer.js +79 -13
- package/src/util.js +1 -0
- package/standalone.js +1 -1
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 i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=i(e),s={matchST_ATTRIBUTE:function(){var t=0,e=this.input();if(this.is_WHITESPACE()){do{e=this.input()}while(this.is_WHITESPACE());return this.unput(1),null}switch(e){case"]":return 0===t?this.popState():t--,"]";case"(":case")":case":":case"=":return this.consume_TOKEN();case"[":return t++,"[";case",":return",";case'"':return this.ST_DOUBLE_QUOTES();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case"/":if("/"===this._input[this.offset])return this.T_COMMENT();if("*"===this._input[this.offset])return this.input(),this.T_DOC_COMMENT()}if(this.is_LABEL_START()||"\\"===e){for(;this.offset<this.size;){var i=this.input();if(!this.is_LABEL()&&"\\"!==i){i&&this.unput(1);break}}return this.tok.T_STRING}if(this.is_NUM())return this.consume_NUM();throw new Error('Bad terminal sequence "'.concat(e,'" at line ').concat(this.yylineno," (offset ").concat(this.offset,")"))}};s.matchST_ATTRIBUTE;var r={T_COMMENT:function(){for(;this.offset<this.size;){var 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(){var 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())&&"/"===this._input[this.offset]){this.input();break}return e}};r.T_COMMENT,r.T_DOC_COMMENT;var o={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;){var t=this.input();if("<"==t)if("?"==(t=this.ahead(1))){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||"\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}};o.nextINITIAL,o.matchINITIAL;var a={consume_NUM:function(){var t=this.yytext[0],e="."===t;if("0"===t)if("x"===(t=this.input())||"X"===t){if("_"!==(t=this.input())&&this.is_HEX())return this.consume_HNUM();this.unput(t?2:1)}else if("b"===t||"B"===t){if("_"!==(t=this.input())&&"0"===t||"1"===t)return this.consume_BNUM();this.unput(t?2:1)}else this.is_NUM()||t&&this.unput(1);for(;this.offset<this.size;){var i=t;if("_"===(t=this.input())){if("_"===i){this.unput(2);break}if("."===i){this.unput(1);break}if("e"===i||"E"===i){this.unput(2);break}}else{if("."===t){if(e){this.unput(1);break}if("_"===i){this.unput(2);break}e=!0;continue}if("e"===t||"E"===t){if("_"===i){this.unput(1);break}var n=2;if("+"!==(t=this.input())&&"-"!==t||(n=3,t=this.input()),this.is_NUM_START())return this.consume_LNUM(),this.tok.T_DNUMBER;this.unput(t?n:n-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;){var 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;){var t=this.input();if(!this.is_NUM()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_BNUM:function(){for(var t;this.offset<this.size;)if("0"!==(t=this.input())&&"1"!==t&&"_"!==t){t&&this.unput(1);break}return this.tok.T_LNUMBER}};a.consume_NUM,a.consume_HNUM,a.consume_LNUM,a.consume_BNUM;var h={matchST_LOOKING_FOR_PROPERTY:function(){var t=this.input();if("-"===t){if(">"===(t=this.input()))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(){var t=this.input();if(this.popState(),this.begin("ST_IN_SCRIPTING"),this.is_LABEL_START()){if(this.consume_LABEL(),"["===(t=this.input())||"}"===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(){var 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")}};h.matchST_LOOKING_FOR_PROPERTY,h.matchST_LOOKING_FOR_VARNAME,h.matchST_VAR_OFFSET;var l={matchST_IN_SCRIPTING:function(){var t=this.input();switch(t){case" ":case"\t":case"\n":case"\r":case"\r\n":return this.T_WHITESPACE();case"#":return"["===this._input[this.offset]?(this.input(),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();var e=this._input[this.offset];return"\n"!==e&&"\r"!==e||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(),"\n"!==(t=this._input[this.offset])&&"\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;){var t=this.input();if(" "!==t&&"\t"!==t&&"\n"!==t&&"\r"!==t){t&&this.unput(1);break}}return this.tok.T_WHITESPACE}};l.matchST_IN_SCRIPTING,l.T_WHITESPACE;var c=["\n","\r"],u=["\n","\r",";"],_=u.concat(["\t"," ",",","]",")","/","=","!"]),d={T_CONSTANT_ENCAPSED_STRING:function(){for(var t;this.offset<this.size;)if("\\"==(t=this.input()))this.input();else if("'"==t)break;return this.tok.T_CONSTANT_ENCAPSED_STRING},is_HEREDOC:function(){var 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()););var e=this._input[this.offset-1];if("'"===e||'"'===e?this.offset++:e=null,this.is_LABEL_START()){for(var i=this.offset-1;this.offset<this.size&&(this.offset++,this.is_LABEL()););var n=this._input.substring(i,this.offset-1);if((!e||e===this._input[this.offset-1])&&(e&&this.offset++,c.includes(this._input[this.offset-1])))return this.heredoc_label.label=n,this.heredoc_label.length=n.length,this.heredoc_label.finished=!1,i=this.offset-t,this.offset=t,this.consume(i),"'"===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(){for(var t;this.offset<this.size;)if("\\"==(t=this.input()))this.input();else{if('"'==t)break;if("$"==t){if("{"==(t=this.input())||this.is_LABEL_START()){this.unput(2);break}t&&this.unput(1)}else if("{"==t){if("$"==(t=this.input())){this.unput(2);break}t&&this.unput(1)}}if('"'==t)return this.tok.T_CONSTANT_ENCAPSED_STRING;var e=1;return"b"!==this.yytext[0]&&"B"!==this.yytext[0]||(e=2),this.yytext.length>2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-e),this.unput(this.yytext.length-e),this.begin("ST_DOUBLE_QUOTES"),this.yytext},isDOC_MATCH:function(t,e){var i=this._input[t-2];if(!c.includes(i))return!1;var n=!1,s=!1,r=0,o=this._input[t-1];if(this.version>=703){for(;"\t"===o||" "===o;)" "===o?n=!0:"\t"===o&&(s=!0),o=this._input[t+r],r++;if(t+=r,c.includes(this._input[t-1]))return!1}if(this._input.substring(t-1,t-1+this.heredoc_label.length)===this.heredoc_label.label){var a=this._input[t-1+this.heredoc_label.length];if((this.version>=703?_:u).includes(a)){if(e){if(this.consume(r),n&&s)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=n,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;for(var t=this.offset+1;t<this._input.length;){if(this.isDOC_MATCH(t,!1))return;if(!c.includes(this._input[t-1]))for(;!c.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;for(var t=this._input[this.offset-1];this.offset<this.size;)if(c.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(){var 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(),c.includes(t)||(t=this.input())),c.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()))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()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}}else if("{"===t){if("$"===(t=this.input()))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();var 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(){var t=this.input();if("$"===t){if("{"===(t=this.input()))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()))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()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}continue}if("{"===t){if("$"===(t=this.input()))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(){var t=this.input();if("$"===t){if("{"===(t=this.input()))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()))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()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}t&&this.unput(1)}else if("{"===t){if("$"===(t=this.input()))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_CONSTANT_ENCAPSED_STRING,d.is_HEREDOC,d.ST_DOUBLE_QUOTES,d.isDOC_MATCH,d.prematch_ENDOFDOC,d.matchST_NOWDOC,d.matchST_HEREDOC,d.consume_VARIABLE,d.matchST_BACKQUOTE,d.matchST_DOUBLE_QUOTES;var p={T_STRING:function(){var t=this.yytext.toLowerCase(),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){var i=this.input(1);if('"'===i)return this.ST_DOUBLE_QUOTES();if("'"===i)return this.T_CONSTANT_ENCAPSED_STRING();i&&this.unput(1)}return e},consume_TOKEN:function(){var 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(){var 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(){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(){var t=this.offset;if(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this.is_LABEL_START()){var e=this.yytext.length;this.consume_LABEL();var i=this.yytext.substring(e-1).toLowerCase(),n=this.castKeywords[i];if("number"==typeof n&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return n}return this.unput(this.offset-t),"("},"=":function(){var 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(){var 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(2),this.tok.T_NULLSAFE_OBJECT_OPERATOR):"?"},"<":function(){var t=this._input[this.offset];return"<"===t?"="===(t=this._input[this.offset+1])?(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(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):">"===t?"="===(t=this._input[this.offset+1])?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR):">"},"*":function(){var 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(){var 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(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_AND_EQUAL):"&"===t?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|":function(){var 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):"^"}}};p.T_STRING,p.consume_TOKEN,p.tokenTerminals;var f={is_NUM:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||95===t},is_NUM_START:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58},is_LABEL:function(){var 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(){var 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;){var t=this.input();if(!this.is_LABEL()){t&&this.unput(1);break}}return this},is_TOKEN:function(){var t=this._input[this.offset-1];return-1!==";:,.\\[]()|^&+-/*=%!~$<>?@".indexOf(t)},is_WHITESPACE:function(){var t=this._input[this.offset-1];return" "===t||"\t"===t||"\n"===t||"\r"===t},is_TABSPACE:function(){var t=this._input[this.offset-1];return" "===t||"\t"===t},consume_TABSPACE:function(){for(;this.offset<this.size;){var t=this.input();if(!this.is_TABSPACE()){t&&this.unput(1);break}}return this},is_HEX:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||(t>64&&t<71||(t>96&&t<103||95===t))}};f.is_NUM,f.is_NUM_START,f.is_LABEL,f.is_LABEL_START,f.consume_LABEL,f.is_TOKEN,f.is_WHITESPACE,f.is_TABSPACE,f.consume_TABSPACE,f.is_HEX;var T=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=800,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,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},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}};T.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},T.prototype.input=function(){var 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):""},T.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(var e=0;e<this.yytext.length;e++){var i=this.yytext[e];"\r"===i?(i=this.yytext[++e],this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0,"\n"!==i&&("\r"===i?this.yylloc.last_line++:this.yylloc.last_column++)):"\n"===i?(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},T.prototype.tryMatch=function(t){return t===this.ahead(t.length)},T.prototype.tryMatchCaseless=function(t){return t===this.ahead(t.length).toLowerCase()},T.prototype.ahead=function(t){var 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},T.prototype.consume=function(t){for(var e=0;e<t;e++){var i=this._input[this.offset];if(!i)break;this.yytext+=i,this.offset++,"\r"===i&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++,e++),"\n"===i||"\r"===i?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++}return this},T.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}},T.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},T.prototype.appendToken=function(t,e){return this.tokens.push([t,e]),this},T.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;var 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},T.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},T.prototype.popState=function(){var 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},T.prototype.next=function(){var 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?("object"==typeof(t=this.tokens.shift())[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){var e=t;e="number"==typeof e?this.engine.tokens.values[e]:'"'+e+'"';var i=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(i.stack)}return t},[s,r,o,a,h,l,d,p,f].forEach((function(t){for(var e in t)T.prototype[e]=t[e]}));var k=T,E={read_array:function(){var t=null,e=!1,i=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),t=")"):(e=!0,t="]");var n=[];return this.next().token!==t&&(n=this.read_array_pair_list(e)),this.expect(t),this.next(),i(e,n)},read_array_pair_list:function(t){var 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)){if(","===this.token)return this.node("noop")();var e=this.node("entry"),i=null,n=null,s=!1,r=!1;if("&"===this.token)this.next(),s=!0,n=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),"&"===this.token&&this.error(),r=!0,n=this.read_expr();else{var o=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),i=o,"&"===this.token?(this.next(),s=!0,n=this.read_variable(!0,!1)):n=this.read_expr()):n=o}return e(i,n,s,r)}}};function m(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function x(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function y(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?x(Object(i),!0).forEach((function(e){m(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):x(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,s=!1,r=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done)&&(i.push(o.value),!e||i.length!==e);n=!0);}catch(t){s=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(s)throw r}}return i}(t,e)||g(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(t){return function(t){if(Array.isArray(t))return N(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||g(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){if(t){if("string"==typeof t)return N(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?N(t,e):void 0}}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function C(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=g(t))){var e=0,i=function(){};return{s:i,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,s,r=!0,o=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return r=t.done,t},e:function(t){o=!0,s=t},f:function(){try{r||null==n.return||n.return()}finally{if(o)throw s}}}}E.read_array,E.read_array_pair_list,E.read_array_pair;var S={read_class_declaration_statement:function(t){var e=this.node("class"),i=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);var n=this.node("identifier"),s=this.text();this.next(),n=n(s);var r=this.read_extends_from(),o=this.read_implements_list();this.expect("{");var a=e(n,r,o,this.next().read_class_body(),i);return t&&(a.attrGroups=t),a},read_class_modifiers:function(){return[0,0,this.read_class_modifier()]},read_class_modifier:function(){return this.token===this.tok.T_ABSTRACT?(this.next(),1):this.token===this.tok.T_FINAL?(this.next(),2):0},read_class_body:function(){for(var t=[],e=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT)if(this.token!==this.tok.T_USE){this.token===this.tok.T_ATTRIBUTE&&(e=this.read_attr_list());var i=this.read_member_flags(!1);if(this.token!==this.tok.T_CONST)if(this.token===this.tok.T_VAR&&(this.next().expect(this.tok.T_VARIABLE),i[0]=null,i[1]=0),this.token===this.tok.T_FUNCTION)t.push(this.read_function(!1,i,e));else if(this.token===this.tok.T_VARIABLE||this.version>=704&&("?"===this.token||this.token===this.tok.T_CALLABLE||this.token===this.tok.T_ARRAY||this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE)){var n=this.read_variable_list(i,e);e=[],this.expect(";"),this.next(),t=t.concat(n)}else this.error([this.tok.T_CONST,this.tok.T_VARIABLE,this.tok.T_FUNCTION]),this.next();else{var s=this.read_constant_list(i,e);this.expect(";")&&this.next(),t=t.concat(s)}}else t=t.concat(this.read_trait_use_statement());else t.push(this.read_doc_comment());else t.push(this.read_comment());return this.expect("}"),this.next(),t},read_variable_list:function(t,e){var i=this.node("propertystatement"),n=this.read_list((function(){var t=this.node("property"),i=v(this.read_optional_type(),2),n=i[0],s=i[1];this.expect(this.tok.T_VARIABLE);var r=this.node("identifier"),o=this.text().substring(1);return this.next(),r=r(o),";"===this.token||","===this.token?t(r,null,n,s,e||[]):"="===this.token?t(r,this.next().read_expr(),n,s,e||[]):(this.expect([",",";","="]),t(r,null,n,s,e||[]))}),",");return i(null,n,t)},read_constant_list:function(t,e){this.expect(this.tok.T_CONST)&&this.next();var i=this.node("classconstant"),n=this.read_list((function(){var t=this.node("constant"),e=null,i=null;if(this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){e=this.node("identifier");var n=this.text();this.next(),e=e(n)}else this.expect("IDENTIFIER");return this.expect("=")&&(i=this.next().read_expr()),t(e,i)}),",");return i(null,n,t,e||[])},read_member_flags:function(t){var e=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){var i=0,n=0;do{switch(this.token){case this.tok.T_PUBLIC:i=0,n=0;break;case this.tok.T_PROTECTED:i=0,n=1;break;case this.tok.T_PRIVATE:i=0,n=2;break;case this.tok.T_STATIC:i=1,n=1;break;case this.tok.T_ABSTRACT:i=2,n=1;break;case this.tok.T_FINAL:i=2,n=2}t&&(0==i&&2==n?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),n=-1):2==i&&1==n&&(this.error(),n=-1)),-1!==e[i]?this.error():-1!==n&&(e[i]=n)}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(){var t=!1;"?"===this.token&&(t=!0,this.next());var 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();var i=this.read_type();if(!i){this.raiseError("Expecting a type definition");break}e.push(i)}while("|"===this.token)}return[t,e]},read_interface_declaration_statement:function(t){var 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);var i=this.node("identifier"),n=this.text();this.next(),i=i(n);var s=this.read_interface_extends_list();return this.expect("{"),e(i,s,this.next().read_interface_body(),t||[])},read_interface_body:function(){for(var t=[],e=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT){e=this.read_attr_list();var i=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){var n=this.read_constant_list(i,e);this.expect(";")&&this.next(),t=t.concat(n)}else if(this.token===this.tok.T_FUNCTION){var s=this.read_function_declaration(2,i,e);s.parseFlags(i),t.push(s),this.expect(";")&&this.next()}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}else t.push(this.read_doc_comment());else t.push(this.read_comment());return this.expect("}")&&this.next(),t},read_trait_declaration_statement:function(){var 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);var e=this.node("identifier"),i=this.text();return this.next(),e=e(i),this.expect("{"),t(e,this.next().read_class_body())},read_trait_use_statement:function(){var t=this.node("traituse");this.expect(this.tok.T_USE)&&this.next();for(var e=[this.read_namespace_name()],i=null;","===this.token;)e.push(this.next().read_namespace_name());if("{"===this.token){for(i=[];this.next().token!==this.EOF&&"}"!==this.token;)i.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return t(e,i)},read_trait_use_alias:function(){var t,e=this.node(),i=null;if(this.is("IDENTIFIER")){t=this.node("identifier");var n=this.text();this.next(),t=t(n)}else if(t=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")){i=t,t=this.node("identifier");var s=this.text();this.next(),t=t(s)}else this.expect(this.tok.T_STRING);else t=t.name;if(this.token===this.tok.T_INSTEADOF)return e("traitprecedence",i,t,this.next().read_name_list());if(this.token===this.tok.T_AS){var r=null,o=null;if(this.next().is("T_MEMBER_FLAGS")&&(r=this.read_member_flags()),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){o=this.node("identifier");var a=this.text();this.next(),o=o(a)}else!1===r&&this.expect(this.tok.T_STRING);return e("traitalias",i,t,o,r)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),e("traitalias",i,t,null,null)}};S.read_class_declaration_statement,S.read_class_modifiers,S.read_class_modifier,S.read_class_body,S.read_variable_list,S.read_constant_list,S.read_member_flags,S.read_optional_type,S.read_interface_declaration_statement,S.read_interface_body,S.read_trait_declaration_statement,S.read_trait_use_statement,S.read_trait_use_alias;var b={read_comment:function(){var t=this.text(),e=this.ast.prepare("/*"===t.substring(0,2)?"commentblock":"commentline",null,this),i=this.lexer.yylloc.first_offset,n=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),(e=e(t)).offset=i,this.prev=n,e},read_doc_comment:function(){var t=this.ast.prepare("commentblock",null,this),e=this.lexer.yylloc.first_offset,i=this.text(),n=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),(t=t(i)).offset=e,this.prev=n,t}};b.read_comment,b.read_doc_comment;var L={read_expr:function(t){var 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){var i=null;return":"!==this.next().token&&(i=this.read_expr()),this.expect(":")&&this.next(),e("retif",t,i,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(){var t=null;switch(this.token){case this.tok.T_ISSET:t=this.node("isset"),this.next().expect("(")&&this.next();var 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();var i=this.read_expr();this.expect(")")&&this.next(),t=t(i);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();var n=this.read_expr();this.expect(")")&&this.next(),t=t(n);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(){var t=null;return"("===this.token&&(this.next(),t=this.read_optional_expr(")"),this.expect(")")&&this.next()),t},read_expr_item:function(){var t,e,i=[];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()).parenthesizedExpression=!0,this.expect(")")&&this.next(),this.handleDereferencable(e);if("`"===this.token)return this.read_encapsed_string("`");if(this.token===this.tok.T_LIST){var n=null,s=this.innerList;t=this.node("list"),s||(n=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);var r=this.read_array_pair_list(!1);this.expect(")")&&this.next();for(var o=!1,a=0;a<r.length;a++)if(null!==r[a]&&"noop"!==r[a].kind){o=!0;break}return o||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),s?t(r,!1):(this.innerList=!1,this.expect("=")?n(t(r,!1),this.next().read_expr(),"="):t(r,!1))}if(this.token===this.tok.T_ATTRIBUTE&&(i=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:return this.version<800&&this.raiseError("PHP 8+ is required to use throw as an expression"),this.node("throw")(this.next().read_expr());case this.tok.T_EXIT:var h="die"===this.lexer.yytext.toLowerCase();return t=this.node("exit"),this.next(),t(this.read_exit_expr(),h);case this.tok.T_PRINT:return this.node("print")(this.next().read_expr());case this.tok.T_YIELD:var l=null,c=null;return t=this.node("yield"),this.next().is("EXPR")&&(l=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(c=l,l=this.next().read_expr())),t(l,c);case this.tok.T_YIELD_FROM:return(t=this.node("yieldfrom"))(e=this.next().read_expr());case this.tok.T_FN:case this.tok.T_FUNCTION:return this.read_inline_function(void 0,i);case this.tok.T_STATIC:var u=[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],i);this.lexer.tokens.push(u),this.next()}if(this.is("VARIABLE")){t=this.node();var _="identifier"===(e=this.read_variable(!1,!1)).kind||"staticlookup"===e.kind&&"identifier"===e.offset.kind;switch(this.token){case"=":return _&&this.error("VARIABLE"),"&"==this.next().token?this.read_assignref(t,e):t("assign",e,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return _&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"??=");case this.tok.T_INC:return _&&this.error("VARIABLE"),this.next(),t("post","+",e);case this.tok.T_DEC:return _&&this.error("VARIABLE"),this.next(),t("post","-",e);default:t.destroy(e)}}else{if(this.is("SCALAR")){if(t=this.node(),"array"===(e=this.read_scalar()).kind&&e.shortForm&&"="===this.token){var d=this.convertToList(e);return e.loc&&(d.loc=e.loc),t("assign",d,this.next().read_expr(),"=")}return t.destroy(e),this.handleDereferencable(e)}this.error("EXPR"),this.next()}return e},convertToList:function(t){var e=this,i=t.items.map((function(t){return t.value&&"array"===t.value.kind&&t.value.shortForm&&(t.value=e.convertToList(t.value)),t})),n=this.node("list")(i,!0);return t.loc&&(n.loc=t.loc),t.leadingComments&&(n.leadingComments=t.leadingComments),t.trailingComments&&(n.trailingComments=t.trailingComments),n},read_assignref:function(t,e){var i;return this.next(),this.token===this.tok.T_NEW?(this.version>=700&&this.error(),i=this.read_new_expr()):i=this.read_variable(!1,!1),t("assignref",e,i)},read_inline_function:function(t,e){if(this.token===this.tok.T_FUNCTION){var i=this.read_function(!0,t,e);return i.attrGroups=e,i}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");var n=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();var s=this.is_reference();this.expect("(")&&this.next();var r=this.read_parameter_list();this.expect(")")&&this.next();var o=!1,a=null;":"===this.token&&("?"===this.next().token&&(o=!0,this.next()),a=this.read_types()),this.expect(this.tok.T_DOUBLE_ARROW)&&this.next();var h=n(r,s,this.read_expr(),a,o,!!t);return h.attrGroups=e,h},read_match_expression:function(){var 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");var e,i;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),this.expect("{")&&this.next(),i=this.read_match_arms(),this.expect("}")&&this.next(),t(e,i)},read_match_arms:function(){var t=this;return this.read_list((function(){return t.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(){var 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(){var t=this.text(),e=[];return this.next(),"("===this.token&&(e=this.read_argument_list()),this.node("attribute")(t,e)},read_attr_list(){var t=[];if(this.token===this.tok.T_ATTRIBUTE)do{var 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(){var t=this.node("new");this.expect(this.tok.T_NEW)&&this.next();var e=[],i=this.read_attr_list();if(this.token===this.tok.T_CLASS){var n=this.node("class");"("===this.next().token&&(e=this.read_argument_list());var s=this.read_extends_from(),r=this.read_implements_list(),o=null;this.expect("{")&&(o=this.next().read_class_body());var a=n(null,s,r,o,[0,0,0]);return a.attrGroups=i,t(a,e)}var h=this.read_new_class_name();return"("===this.token&&(e=this.read_argument_list()),t(h,e)},read_new_class_name:function(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){var 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}};L.read_expr,L.read_expr_cast,L.read_isset_variable,L.read_isset_variables,L.read_internal_functions_in_yacc,L.read_optional_expr,L.read_exit_expr,L.read_expr_item,L.convertToList,L.read_assignref,L.read_inline_function,L.read_match_expression,L.read_match_arms,L.read_match_arm,L.read_match_arm_conds,L.read_attribute,L.read_attr_list,L.read_new_expr,L.read_new_class_name,L.handleDereferencable;var O={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,i){var n=this.read_function_declaration(t?1:e?2:0,e&&1===e[1],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,i){var n="function";1===t?n="closure":2===t&&(n="method");var s=this.node(n);this.expect(this.tok.T_FUNCTION)&&this.next();var r=this.is_reference(),o=!1,a=[],h=null,l=!1;if(1!==t){var c=this.node("identifier");2===t?this.version>=700?this.token===this.tok.T_STRING||this.is("IDENTIFIER")?(o=this.text(),this.next()):this.version<704&&this.error("IDENTIFIER"):this.token===this.tok.T_STRING?(o=this.text(),this.next()):this.error("IDENTIFIER"):this.version>=700?this.token===this.tok.T_STRING?(o=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)&&(o=this.text()),this.next()),o=c(o)}this.expect("(")&&this.next();var u=this.read_parameter_list();if(this.expect(")")&&this.next(),1===t&&(a=this.read_lexical_vars()),":"===this.token&&("?"===this.next().token&&(l=!0,this.next()),h=this.read_types()),1===t){var _=s(u,r,a,h,l,e);return _.attrGroups=i||[],_}var d=s(o,u,r,h,l);return d.attrGroups=i||[],d},read_lexical_vars:function(){var 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){for(var e=[];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));var t=this.node("variable");this.expect(this.tok.T_VARIABLE);var e=this.text().substring(1);return this.next(),t(e,!1)},read_parameter_list:function(){return")"!=this.token?this.read_list_with_dangling_comma(this.read_parameter.bind(this)):[]},read_parameter:function(){var t,e=this.node("parameter"),i=null,n=null,s=!1,r=[];this.token===this.tok.T_ATTRIBUTE&&(r=this.read_attr_list()),"?"===this.token&&(this.next(),s=!0);var o=this.read_promoted();t=this.read_types(),s&&!t&&this.raiseError("Expecting a type definition combined with nullable operator");var a=this.is_reference(),h=this.is_variadic();if(this.expect(this.tok.T_VARIABLE)){i=this.node("identifier");var l=this.text().substring(1);this.next(),i=i(l)}"="==this.token&&(n=this.next().read_expr());var c=e(i,t,n,a,h,s,o);return r&&(c.attrGroups=r),c},read_types(){var t=[],e=this.node("uniontype"),i=this.read_type();if(!i)return null;for(t.push(i);"|"===this.token;)this.next(),i=this.read_type(),t.push(i);return 1===t.length?t[0]:e(t)},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:function(){var t=[];return this.expect("(")&&this.next(),")"!==this.token&&(t=this.read_non_empty_argument_list()),this.expect(")")&&this.next(),t},read_non_empty_argument_list:function(){var t=!1;return this.read_function_list(function(){var e=this.read_argument();return e&&(t&&this.raiseError("Unexpected argument after a variadic argument"),"variadic"===e.kind&&(t=!0)),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)){var t=this.lexer.getState(),e=this.lexer.lex();if(this.lexer.setState(t),":"===e)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(){var t=this.node();if(this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE){var e=this.text();return this.next(),t("typereference",e.toLowerCase(),e)}if(this.token===this.tok.T_STRING){var i=this.text(),n=[this.token,this.lexer.getState()];return this.next(),this.token!==this.tok.T_NS_SEPARATOR&&this.ast.typereference.types.indexOf(i.toLowerCase())>-1?t("typereference",i.toLowerCase(),i):(this.lexer.tokens.push(n),this.next(),t.destroy(),this.read_namespace_name())}return this.token===this.tok.T_NAMESPACE||this.token===this.tok.T_NS_SEPARATOR?(t.destroy(),this.read_namespace_name()):(t.destroy(),null)}};O.is_reference,O.is_variadic,O.read_function,O.read_function_declaration,O.read_lexical_vars,O.read_list_with_dangling_comma,O.read_lexical_var_list,O.read_lexical_var,O.read_parameter_list,O.read_parameter,O.read_types,O.read_promoted,O.read_argument_list,O.read_non_empty_argument_list,O.read_argument,O.read_type;var I={read_if:function(){var t=this.node("if"),e=this.next().read_if_expr(),i=null,n=null,s=!1;if(":"===this.token){s=!0,this.next(),i=this.node("block");for(var r=[];this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){n=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){n=this.read_else_short();break}r.push(this.read_inner_statement())}i=i(null,r),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else i=this.read_statement(),this.token===this.tok.T_ELSEIF?n=this.read_if():this.token===this.tok.T_ELSE&&(n=this.next().read_statement());return t(e,i,n,s)},read_if_expr:function(){this.expect("(")&&this.next();var t=this.read_expr();return this.expect(")")&&this.next(),t},read_elseif_short:function(){var t=null,e=this.node("if"),i=this.next().read_if_expr();this.expect(":")&&this.next();for(var n=this.node("block"),s=[];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}s.push(this.read_inner_statement())}return e(i,n(null,s),t,!0)},read_else_short:function(){this.next().expect(":")&&this.next();for(var t=this.node("block"),e=[];this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)e.push(this.read_inner_statement());return t(null,e)}};I.read_if,I.read_if_expr,I.read_elseif_short,I.read_else_short;var R={read_while:function(){var t=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();var e,i=null,n=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(n=!0,i=this.read_short_form(this.tok.T_ENDWHILE)):i=this.read_statement(),t(e,i,n)},read_do:function(){var t=this.node("do");this.expect(this.tok.T_DO)&&this.next();var e,i=null;return e=this.read_statement(),this.expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),i=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),t(i,e)},read_for:function(){var t=this.node("for");this.expect(this.tok.T_FOR)&&this.next();var e=[],i=[],n=[],s=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?(i=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),")"!==this.token?(n=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),":"===this.token?(r=!0,s=this.read_short_form(this.tok.T_ENDFOR)):s=this.read_statement(),t(e,i,n,s,r)},read_foreach:function(){var t=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();var e,i=null,n=null,s=null,r=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),n=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(i=n,n=this.next().read_foreach_variable())),i&&"list"===i.kind&&this.raiseError("Fatal Error : Cannot use list as key element"),this.expect(")")&&this.next(),":"===this.token?(r=!0,s=this.read_short_form(this.tok.T_ENDFOREACH)):s=this.read_statement(),t(e,i,n,s,r)},read_foreach_variable:function(){if(this.token===this.tok.T_LIST||"["===this.token){var t="["===this.token,e=this.node("list");this.next(),!t&&this.expect("(")&&this.next();var i=this.read_array_pair_list(t);return this.expect(t?"]":")")&&this.next(),e(i,t)}return this.read_variable(!1,!1)}};R.read_while,R.read_do,R.read_for,R.read_foreach,R.read_foreach_variable;var w={read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}};w.read_start;var D={read_namespace:function(){var t,e,i=this.node("namespace");return this.expect(this.tok.T_NAMESPACE)&&this.next(),e="{"==this.token?{name:[""]}:this.read_namespace_name(),this.currentNamespace=e,";"==this.token?(this.currentNamespace=e,t=this.next().read_top_statements(),this.expect(this.EOF),i(e.name,t,!1)):"{"==this.token?(this.currentNamespace=e,t=this.next().read_top_statements(),this.expect("}")&&this.next(),0===t.length&&this.extractDoc&&this._docs.length>this._docIndex&&t.push(this.node("noop")()),i(e.name,t,!0)):"("===this.token?(e.resolution=this.ast.reference.RELATIVE_NAME,e.name=e.name.substring(1),i.destroy(),this.node("call")(e,this.read_argument_list())):(this.error(["{",";"]),this.currentNamespace=e,t=this.read_top_statements(),this.expect(this.EOF),i(e,t,!1))},read_namespace_name:function(t){var e=this.node(),i=!1;this.token===this.tok.T_NAMESPACE&&(this.next().expect(this.tok.T_NS_SEPARATOR)&&this.next(),i=!0);var n=this.read_list(this.tok.T_STRING,this.tok.T_NS_SEPARATOR,!0);if(!i&&1===n.length&&(t||"("!==this.token)){if("parent"===n[0].toLowerCase())return e("parentreference",n[0]);if("self"===n[0].toLowerCase())return e("selfreference",n[0])}return e("name",n,i)},read_use_statement:function(){var t=this.node("usegroup"),e=[],i=null;this.expect(this.tok.T_USE)&&this.next();var n=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&&(i=e[0].name,e=this.next().read_use_declarations(null===n),this.expect("}")&&this.next()),t=t(i,n,e),this.expect(";")&&this.next(),t},read_class_name_reference:function(){return this.read_variable(!0,!1)},read_use_declaration:function(t){var e=this.node("useitem"),i=null;t&&(i=this.read_use_type());var n=this.read_namespace_name(),s=this.read_use_alias();return e(n.name,s,i)},read_use_declarations:function(t){for(var e=[this.read_use_declaration(t)];","===this.token;){if(this.next(),t){if(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_STRING&&this.token!==this.tok.T_NS_SEPARATOR)break;e.push(this.read_use_declaration(t))}return e},read_use_alias:function(){var t=null;if(this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)){var e=this.node("identifier"),i=this.text();this.next(),t=e(i)}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}};D.read_namespace,D.read_namespace_name,D.read_use_statement,D.read_class_name_reference,D.read_use_declaration,D.read_use_declarations,D.read_use_alias,D.read_use_type;var P={"\\":"\\",$:"$",n:"\n",r:"\r",t:"\t",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)},U={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,(function(t,e,i){return P[e]?P[e]:"x"===e[0]||"X"===e[0]?String.fromCodePoint(parseInt(e.substr(1),16)):"u"===e[0]?String.fromCodePoint(parseInt(i,16)):String.fromCodePoint(parseInt(e,8))})):t.replace(/\\\\/g,"\\").replace(/\\'/g,"'")},remove_heredoc_leading_whitespace_chars:function(t,e,i,n){if(0===e)return t;this.check_heredoc_indentation_level(t,e,i,n);var s=i?" ":"\t",r=new RegExp("\\n".concat(s,"{").concat(e,"}"),"g"),o=new RegExp("^".concat(s,"{").concat(e,"}"));return n&&(t=t.replace(o,"")),t.replace(r,"\n")},check_heredoc_indentation_level:function(t,e,i,n){var s=t.length,r=0,o=0,a=!0,h=i?" ":"\t",l=!1;if(!n){if(-1===(r=t.indexOf("\n")))return;r++}for(;r<s;)a?t[r]===h?o++:l=!0:a=!1,"\n"!==t[r]&&l&&o<e?this.raiseError("Invalid body indentation level (expecting an indentation at least ".concat(e,")")):l=!1,"\n"===t[r]&&(a=!0,o=0),r++},read_dereferencable_scalar:function(){var t=null;switch(this.token){case this.tok.T_CONSTANT_ENCAPSED_STRING:var e=this.node("string"),i=this.text(),n=0;"b"!==i[0]&&"B"!==i[0]||(n=1);var s='"'===i[n];this.next(),e=e(s,this.resolve_special_chars(i.substring(n+1,i.length-1),s),1===n,i),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();var t,e;switch(this.token){case this.tok.T_LNUMBER:case this.tok.T_DNUMBER:var i=this.node("number");return t=this.text(),this.next(),i(t,null);case this.tok.T_START_HEREDOC:if("ST_NOWDOC"===this.lexer.curCondition){var n=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));var s=t[t.length-1];"\n"===s?t="\r"===t[t.length-2]?t.substring(0,t.length-2):t.substring(0,t.length-1):"\r"===s&&(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();var r=this.lexer._input.substring(n,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),r,this.lexer.heredoc_label.label)}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:var o=this.error("SCALAR");return this.next(),o}},read_dereferencable:function(t){var e,i,n=this.node("offsetlookup");return"["===this.token?(i=this.next().read_expr(),this.expect("]")&&this.next(),e=n(t,i)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(e=n(t,i=this.read_encapsed_string_item(!1))),e},read_encapsed_string_item:function(t){var e,i,n,s=this.node("encapsedpart"),r=null,o=!1,a=this.node();if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){var h=this.text();this.next(),a=a("string",!1,this.version>=703&&!this.lexer.heredoc_label.finished?this.remove_heredoc_leading_whitespace_chars(this.resolve_special_chars(h,t),this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node):h,!1,h)}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");var l=this.text();this.next(),"["===this.token?(n=n(l,!1),i=this.node("offsetlookup"),e=this.next().read_expr(),this.expect("]")&&this.next(),a=i(n,e)):a=n(l,!1)}else a=a("variable",this.read_expr(),!1);this.expect("}")&&this.next()}else if(this.token===this.tok.T_CURLY_OPEN)r="complex",a.destroy(),a=this.next().read_variable(!1,!1),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(r="simple",a.destroy(),a=this.read_simple_variable(),"["===this.token&&(i=this.node("offsetlookup"),e=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),a=i(a,e)),this.token===this.tok.T_OBJECT_OPERATOR){i=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);var c=this.node("identifier");n=this.text(),this.next(),a=i(a,c(n))}}else{this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);var u=this.text();this.next(),a.destroy(),a=a("string",!1,u,!1,u)}return this.lexer.heredoc_label.first_encaps_node=!1,s(a,r,o)},read_encapsed_string:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.lexer.yylloc.first_offset,n=this.node("encapsed");this.next();var s=this.lexer.yylloc.prev_offset-(e?1:0),r=[],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){var a=r[r.length-1].expression,h=a.value[a.value.length-1];"\n"===h?"\r"===a.value[a.value.length-2]?a.value=a.value.substring(0,a.value.length-2):a.value=a.value.substring(0,a.value.length-1):"\r"===h&&(a.value=a.value.substring(0,a.value.length-1))}this.expect(t)&&this.next();var l=this.lexer._input.substring("heredoc"===o?i:s-1,this.lexer.yylloc.first_offset);return n=n(r,l,o),t===this.tok.T_END_HEREDOC&&(n.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),n},get_magic_constant:function(){var t=this.node("magic"),e=this.text();return this.next(),t(e.toUpperCase(),e)}};U.resolve_special_chars,U.remove_heredoc_leading_whitespace_chars,U.check_heredoc_indentation_level,U.read_dereferencable_scalar,U.read_scalar,U.read_dereferencable,U.read_encapsed_string_item,U.read_encapsed_string,U.get_magic_constant;var B={read_top_statements:function(){for(var t=[];this.token!==this.EOF&&"}"!==this.token;){var e=this.read_top_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_top_statement:function(){var 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_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_USE:return this.read_use_statement();case this.tok.T_CONST:var e=this.node("constantstatement"),i=this.next().read_const_list();return this.expectEndOfStatement(),e(null,i);case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:var n=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,n(this.lexer._input.substring(this.lexer.offset));default:return this.read_statement()}},read_inner_statements:function(){for(var t=[];this.token!=this.EOF&&"}"!==this.token;){var 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);var t=this.node("constant"),e=this.node("identifier"),i=this.text();return this.next(),e=e(i),this.expect("=")?t(e,this.next().read_expr()):t(e,null)}),",",!1)},read_declare_list:function(){for(var t=[];this.token!=this.EOF&&")"!==this.token;){this.expect(this.tok.T_STRING);var e=this.node("declaredirective"),i=this.node("identifier"),n=this.text();this.next(),i=i(n);var s=null;if(this.expect("=")&&(s=this.next().read_expr()),t.push(e(i,s)),","!==this.token)break;this.next()}return t},read_inner_statement:function(){var t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:var 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_HALT_COMPILER:this.raiseError("__HALT_COMPILER() can only be used from the outermost scope");var i=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),i=i(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),i;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:var t=this.node("return");this.next();var e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e);case this.tok.T_BREAK:case this.tok.T_CONTINUE:var i=this.node(this.token===this.tok.T_CONTINUE?"continue":"break");this.next();var n=this.read_optional_expr(";");return this.expectEndOfStatement(),i(n);case this.tok.T_GLOBAL:var s=this.node("global"),r=this.next().read_list(this.read_simple_variable,",");return this.expectEndOfStatement(),s(r);case this.tok.T_STATIC:var o=[this.token,this.lexer.getState()],a=this.node();if(this.next().token===this.tok.T_DOUBLE_COLON){this.lexer.tokens.push(o);var h=this.next().read_expr();return this.expectEndOfStatement(h),a("expressionstatement",h)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);var l=this.read_variable_declarations();return this.expectEndOfStatement(),a("static",l);case this.tok.T_ECHO:var c=this.node("echo"),u=this.text(),_="<?="===u||"<%="===u,d=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),c(d,_);case this.tok.T_INLINE_HTML:var p=this.text(),f=this.lexer.yylloc.first_offset>0?this.lexer._input[this.lexer.yylloc.first_offset-1]:null,T="\r"===f||"\n"===f;T&&"\n"===f&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(f="\r\n");var k=this.node("inline");return this.next(),k(p,T?f+p:p);case this.tok.T_UNSET:var E=this.node("unset");this.next().expect("(")&&this.next();var m=this.read_function_list(this.read_variable,",");return this.expect(")")&&this.next(),this.expect(";")&&this.next(),E(m);case this.tok.T_DECLARE:var x,y=this.node("declare"),v=[];this.next().expect("(")&&this.next();var A=this.read_declare_list();if(this.expect(")")&&this.next(),":"===this.token){for(this.next();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)v.push(this.read_top_statement());0===v.length&&this.extractDoc&&this._docs.length>this._docIndex&&v.push(this.node("noop")()),this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),x=this.ast.declare.MODE_SHORT}else if("{"===this.token){for(this.next();this.token!=this.EOF&&"}"!==this.token;)v.push(this.read_top_statement());0===v.length&&this.extractDoc&&this._docs.length>this._docIndex&&v.push(this.node("noop")()),this.expect("}")&&this.next(),x=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),x=this.ast.declare.MODE_NONE;return y(A,v,x);case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:var g=this.node("throw"),N=this.next().read_expr();return this.expectEndOfStatement(),g(N);case";":return this.next(),null;case this.tok.T_STRING:var C=this.node(),S=[this.token,this.lexer.getState()],b=this.text(),L=this.node("identifier");if(":"===this.next().token)return L=L(b),this.next(),C("label",L);L.destroy(),C.destroy(),this.lexer.tokens.push(S);var O=this.node("expressionstatement"),I=this.next().read_expr();return this.expectEndOfStatement(I),O(I);case this.tok.T_GOTO:var R=this.node("goto"),w=null;if(this.next().expect(this.tok.T_STRING)){w=this.node("identifier");var D=this.text();this.next(),w=w(D),this.expectEndOfStatement()}return R(w);default:var P=this.node("expressionstatement"),U=this.read_expr();return this.expectEndOfStatement(U),P(U)}},read_code_block:function(t){var e=this.node("block");this.expect("{")&&this.next();var i=t?this.read_top_statements():this.read_inner_statements();return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect("}")&&this.next(),e(null,i)}};B.read_top_statements,B.read_top_statement,B.read_inner_statements,B.read_const_list,B.read_declare_list,B.read_inner_statement,B.read_statement,B.read_code_block;var M={read_switch:function(){var t=this.node("switch");this.expect(this.tok.T_SWITCH)&&this.next(),this.expect("(")&&this.next();var e=this.read_expr();this.expect(")")&&this.next();var i=":"===this.token;return t(e,this.read_switch_case_list(),i)},read_switch_case_list:function(){var t=null,e=this.node("block"),i=[];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;)i.push(this.read_case_list(t));return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect(t)&&this.next(),t===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),e(null,i)},read_case_list:function(t){var e=this.node("case"),i=null;this.token===this.tok.T_CASE?i=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();for(var n=this.node("block"),s=[];this.token!==this.EOF&&this.token!==t&&this.token!==this.tok.T_CASE&&this.token!==this.tok.T_DEFAULT;)s.push(this.read_inner_statement());return e(i,n(null,s))}};M.read_switch,M.read_switch_case_list,M.read_case_list;var F={read_try:function(){this.expect(this.tok.T_TRY);for(var t=this.node("try"),e=null,i=[],n=this.next().read_statement();this.token===this.tok.T_CATCH;){var s=this.node("catch");this.next().expect("(")&&this.next();var r=this.read_list(this.read_namespace_name,"|",!1),o=null;this.token===this.tok.T_VARIABLE&&(o=this.read_variable(!0,!1)),this.expect(")"),i.push(s(this.next().read_statement(),r,o))}return this.token===this.tok.T_FINALLY&&(e=this.next().read_statement()),t(n,i,e)}};F.read_try;var H={read_short_form:function(t){var e=this.node("block"),i=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==t;)i.push(this.read_inner_statement());return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect(t)&&this.next(),this.expectEndOfStatement(),e(null,i)},read_function_list:function(t,e){var i=[];do{if(this.token==e&&this.version>=703&&i.length>0){i.push(this.node("noop")());break}if(i.push(t.apply(this,[])),this.token!=e)break;if(")"==this.next().token&&this.version>=703)break}while(this.token!=this.EOF);return i},read_list:function(t,e,i){var n=[];if(this.token==e&&(i&&n.push("function"==typeof t?this.node("noop")():null),this.next()),"function"==typeof t)do{var s=t.apply(this,[]);if(s&&n.push(s),this.token!=e)break}while(this.next().token!=this.EOF);else{if(!this.expect(t))return[];for(n.push(this.text());this.next().token!=this.EOF&&this.token==e&&this.next().token==t;)n.push(this.text())}return n},read_name_list:function(){return this.read_list(this.read_namespace_name,",",!1)},read_byref:function(t){var e=this.node("byref");this.next(),e=e(null);var i=t();return i&&(this.ast.swapLocations(i,e,i,this),i.byref=!0),i},read_variable_declarations:function(){return this.read_list((function(){var t=this.node("staticvariable"),e=this.node("variable");if(this.expect(this.tok.T_VARIABLE)){var i=this.text().substring(1);this.next(),e=e(i,!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}};H.read_short_form,H.read_function_list,H.read_list,H.read_name_list,H.read_byref,H.read_variable_declarations,H.read_extends_from,H.read_interface_extends_list,H.read_implements_list;var G={read_variable:function(t,e){var i;if("&"===this.token)return this.read_byref(this.read_variable.bind(this,t,e));if(this.is([this.tok.T_VARIABLE,"$"]))i=this.read_reference_variable(e);else if(this.is([this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAMESPACE])){i=this.node();var n=this.read_namespace_name();if(this.token!=this.tok.T_DOUBLE_COLON&&"("!=this.token&&-1===["parentreference","selfreference"].indexOf(n.kind)){var s=n.name.toLowerCase();"true"===s?i=n.destroy(i("boolean",!0,n.name)):"false"===s?i=n.destroy(i("boolean",!1,n.name)):"null"===s?i=n.destroy(i("nullkeyword",n.name)):(i.destroy(n),i=n)}else i.destroy(n),i=n}else if(this.token===this.tok.T_STATIC){i=this.node("staticreference");var r=this.text();this.next(),i=i(r)}else this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(i=this.read_static_getter(i,e)),this.recursive_variable_chain_scan(i,t,e)},read_static_getter:function(t,e){var i,n,s=this.node("staticlookup");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(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=null,i=null;switch(this.next().token){case this.tok.T_STRING:e=this.node("identifier"),i=this.text(),this.next(),e=e(i),t&&this.token===this.tok.T_OBJECT_OPERATOR&&this.error();break;case this.tok.T_VARIABLE:e=this.node("variable"),i=this.text().substring(1),this.next(),e=e(i,!1);break;case"$":e=this.node(),this.next().expect(["$","{",this.tok.T_VARIABLE]),"{"===this.token?(i=this.next().read_expr(),this.expect("}")&&this.next(),e=e("variable",i,!0)):e=e("variable",i=this.read_expr(),!1);break;case"{":e=this.node("encapsedpart"),i=this.next().read_expr(),this.expect("}")&&this.next(),e=e(i,"complex",!1);break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE,"$","{"]),e=this.node("identifier"),i=this.text(),this.next(),e=e(i)}return e},recursive_variable_chain_scan:function(t,e,i){var n,s;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"{":var r="["===this.token;if(n=this.node("offsetlookup"),this.next(),s=!1,i)s=this.read_encaps_var_offset(),this.expect(r?"]":"}")&&this.next();else(r?"]"!==this.token:"}"!==this.token)?(s=this.read_expr(),this.expect(r?"]":"}")&&this.next()):this.next();t=n(t,s);break;case this.tok.T_DOUBLE_COLON:"staticlookup"===t.kind&&"identifier"===t.offset.kind&&this.error(),t=(n=this.node("staticlookup"))(t,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:t=(n=this.node("propertylookup"))(t,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:t=(n=this.node("nullsafepropertylookup"))(t,this.read_what());break;default:break t}return t},read_encaps_var_offset:function(){var t=this.node();if(this.token===this.tok.T_STRING){var e=this.text();this.next(),t=t("identifier",e)}else if(this.token===this.tok.T_NUM_STRING){var i=this.text();this.next(),t=t("number",i,null)}else if("-"===this.token){this.next();var n=-1*this.text();this.expect(this.tok.T_NUM_STRING)&&this.next(),t=t("number",n,null)}else if(this.token===this.tok.T_VARIABLE){var s=this.text().substring(1);this.next(),t=t("variable",s,!1)}else{this.expect([this.tok.T_STRING,this.tok.T_NUM_STRING,"-",this.tok.T_VARIABLE]);var r=this.text();this.next(),t=t("identifier",r)}return t},read_reference_variable:function(t){for(var e,i=this.read_simple_variable();this.token!=this.EOF;){var n=this.node();if("{"!=this.token||t){n.destroy();break}e=this.next().read_expr(),this.expect("}")&&this.next(),i=n("offsetlookup",i,e)}return i},read_simple_variable:function(){var 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"{":var i=this.next().read_expr();this.expect("}")&&this.next(),e=e(i,!0);break;case"$":e=e(this.read_simple_variable(),!1);break;case this.tok.T_VARIABLE:t=this.text().substring(1);var n=this.node("variable");this.next(),e=e(n(t,!1),!1);break;default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),e=e(t,!1)}return e}};function V(t){return"."!=t&&","!=t&&!isNaN(parseFloat(t))&&isFinite(t)}G.read_variable,G.read_static_getter,G.read_what,G.recursive_variable_chain_scan,G.read_encaps_var_offset,G.read_reference_variable,G.read_simple_variable;var W=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=800,this.extractDoc=!1,this.extractTokens=!1,this.suppressErrors=!1;var i=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_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_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(i)),VARIABLE:new Map([this.tok.T_VARIABLE,"$","&",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAMESPACE,this.tok.T_STATIC].map(i)),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(i)),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(i)),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(i)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(i)),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_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(i))}};W.prototype.getTokenName=function(t){return V(t)?t==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[t]:"'"+t+"'"},W.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;var i=this.node("program"),n=[];for(this.next();this.token!=this.EOF;)n.push(this.read_start());0===n.length&&this.extractDoc&&this._docs.length>this._docIndex&&n.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];var s=i(n,this._errors,this._docs,this._tokens);if(this.debug){var r=this.ast.checkNodes();if(r.length>0)throw r.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 s},W.prototype.raiseError=function(t,e,i,n){if(t+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){var s=new SyntaxError(t,this.filename,this.lexer.yylloc.first_line);throw s.lineNumber=this.lexer.yylloc.first_line,s.fileName=this.filename,s.columnNumber=this.lexer.yylloc.first_column,s}var r=this.ast.prepare("error",null,this)(t,n,this.lexer.yylloc.first_line,i);return this._errors.push(r),r},W.prototype.error=function(t){var e="Parse Error : syntax error",i=this.getTokenName(this.token),n="";if(this.token!==this.EOF){if(V(this.token)){var s=this.text();s.length>10&&(s=s.substring(0,7)+"..."),i="'"+s+"' ("+i+")"}e+=", unexpected "+i}return t&&!Array.isArray(t)&&((V(t)||1===t.length)&&(n=", expecting "+this.getTokenName(t)),e+=n),this.raiseError(e,n,t,i)},W.prototype.node=function(t){if(this.extractDoc){var 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)));var i=this.ast.prepare(t,e,this);return i.postBuild=function(t){if(this._docIndex<this._docs.length)if(this._lastNode){for(var e=this.prev[2],i=this._docIndex;i<this._docs.length&&!(this._docs[i].offset>e);i++);i>this._docIndex&&(this._lastNode.setTrailingComments(this._docs.slice(this._docIndex,i)),this._docIndex=i)}else this.token===this.EOF&&(t.setTrailingComments(this._docs.slice(this._docIndex)),this._docIndex=this._docs.length);this._lastNode=t}.bind(this),i}return this.ast.prepare(t,null,this)},W.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};var Q=["parser.next","parser.node","parser.showlog"];W.prototype.showlog=function(){for(var t,e=(new Error).stack.split("\n"),i=2;i<e.length;i++){t=e[i].trim();for(var n=!1,s=0;s<Q.length;s++)if(t.substring(3,3+Q[s].length)===Q[s]){n=!0;break}if(!n)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @--\x3e"+t),this},W.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},W.prototype.text=function(){return this.lexer.yytext},W.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},W.prototype.lex=function(){if(this.extractTokens)do{if(this.token=this.lexer.lex()||this.EOF,this.token===this.EOF)return this;var t=this.lexer.yytext;if(t=this.lexer.engine.tokens.values.hasOwnProperty(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},W.prototype.is=function(t){return Array.isArray(t)?-1!==t.indexOf(this.token):this.entries[t].has(this.token)},[E,S,b,L,O,I,R,w,D,U,B,M,F,H,G].forEach((function(t){for(var e in t){if(W.prototype.hasOwnProperty(e))throw new Error("Function "+e+" is already defined - collision");W.prototype[e]=t[e]}}));var Y=W,j={values:{101:"T_HALT_COMPILER",102:"T_USE",103:"T_ENCAPSED_AND_WHITESPACE",104:"T_OBJECT_OPERATOR",105:"T_STRING",106:"T_DOLLAR_OPEN_CURLY_BRACES",107:"T_STRING_VARNAME",108:"T_CURLY_OPEN",109:"T_NUM_STRING",110:"T_ISSET",111:"T_EMPTY",112:"T_INCLUDE",113:"T_INCLUDE_ONCE",114:"T_EVAL",115:"T_REQUIRE",116:"T_REQUIRE_ONCE",117:"T_NAMESPACE",118:"T_NS_SEPARATOR",119:"T_AS",120:"T_IF",121:"T_ENDIF",122:"T_WHILE",123:"T_DO",124:"T_FOR",125:"T_SWITCH",126:"T_BREAK",127:"T_CONTINUE",128:"T_RETURN",129:"T_GLOBAL",130:"T_STATIC",131:"T_ECHO",132:"T_INLINE_HTML",133:"T_UNSET",134:"T_FOREACH",135:"T_DECLARE",136:"T_TRY",137:"T_THROW",138:"T_GOTO",139:"T_FINALLY",140:"T_CATCH",141:"T_ENDDECLARE",142:"T_LIST",143:"T_CLONE",144:"T_PLUS_EQUAL",145:"T_MINUS_EQUAL",146:"T_MUL_EQUAL",147:"T_DIV_EQUAL",148:"T_CONCAT_EQUAL",149:"T_MOD_EQUAL",150:"T_AND_EQUAL",151:"T_OR_EQUAL",152:"T_XOR_EQUAL",153:"T_SL_EQUAL",154:"T_SR_EQUAL",155:"T_INC",156:"T_DEC",157:"T_BOOLEAN_OR",158:"T_BOOLEAN_AND",159:"T_LOGICAL_OR",160:"T_LOGICAL_AND",161:"T_LOGICAL_XOR",162:"T_SL",163:"T_SR",164:"T_IS_IDENTICAL",165:"T_IS_NOT_IDENTICAL",166:"T_IS_EQUAL",167:"T_IS_NOT_EQUAL",168:"T_IS_SMALLER_OR_EQUAL",169:"T_IS_GREATER_OR_EQUAL",170:"T_INSTANCEOF",171:"T_INT_CAST",172:"T_DOUBLE_CAST",173:"T_STRING_CAST",174:"T_ARRAY_CAST",175:"T_OBJECT_CAST",176:"T_BOOL_CAST",177:"T_UNSET_CAST",178:"T_EXIT",179:"T_PRINT",180:"T_YIELD",181:"T_YIELD_FROM",182:"T_FUNCTION",183:"T_DOUBLE_ARROW",184:"T_DOUBLE_COLON",185:"T_ARRAY",186:"T_CALLABLE",187:"T_CLASS",188:"T_ABSTRACT",189:"T_TRAIT",190:"T_FINAL",191:"T_EXTENDS",192:"T_INTERFACE",193:"T_IMPLEMENTS",194:"T_VAR",195:"T_PUBLIC",196:"T_PROTECTED",197:"T_PRIVATE",198:"T_CONST",199:"T_NEW",200:"T_INSTEADOF",201:"T_ELSEIF",202:"T_ELSE",203:"T_ENDSWITCH",204:"T_CASE",205:"T_DEFAULT",206:"T_ENDFOR",207:"T_ENDFOREACH",208:"T_ENDWHILE",209:"T_CONSTANT_ENCAPSED_STRING",210:"T_LNUMBER",211:"T_DNUMBER",212:"T_LINE",213:"T_FILE",214:"T_DIR",215:"T_TRAIT_C",216:"T_METHOD_C",217:"T_FUNC_C",218:"T_NS_C",219:"T_START_HEREDOC",220:"T_END_HEREDOC",221:"T_CLASS_C",222:"T_VARIABLE",223:"T_OPEN_TAG",224:"T_OPEN_TAG_WITH_ECHO",225:"T_CLOSE_TAG",226:"T_WHITESPACE",227:"T_COMMENT",228:"T_DOC_COMMENT",229:"T_ELLIPSIS",230:"T_COALESCE",231:"T_POW",232:"T_POW_EQUAL",233:"T_SPACESHIP",234:"T_COALESCE_EQUAL",235:"T_FN",236:"T_NULLSAFE_OBJECT_OPERATOR",237:"T_MATCH",238:"T_ATTRIBUTE"},names:{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}},$=function(t,e,i){this.source=t,this.start=e,this.end=i},z=function(t,e,i){this.line=t,this.column=e,this.offset=i},K=function(t,e,i){this.kind=t,e&&(this.leadingComments=e),i&&(this.loc=i)};K.prototype.setTrailingComments=function(t){this.trailingComments=t},K.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},K.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},K.extends=function(t,e){return e.prototype=Object.create(this.prototype),e.extends=this.extends,e.prototype.constructor=e,e.kind=t,e};var X=K,J="expression",q=X.extends(J,(function(t,e,i){X.apply(this,[t||J,e,i])})),Z="array",tt=q.extends(Z,(function(t,e,i,n){q.apply(this,[Z,i,n]),this.items=e,this.shortForm=t})),et="arrowfunc",it=q.extends(et,(function(t,e,i,n,s,r,o,a){q.apply(this,[et,o,a]),this.arguments=t,this.byref=e,this.body=i,this.type=n,this.nullable=s,this.isStatic=r||!1})),nt="assign",st=q.extends(nt,(function(t,e,i,n,s){q.apply(this,[nt,n,s]),this.left=t,this.right=e,this.operator=i})),rt="assignref",ot=q.extends(rt,(function(t,e,i,n){q.apply(this,[rt,i,n]),this.left=t,this.right=e})),at="attribute",ht=X.extends(at,(function(t,e,i,n){X.apply(this,[at,i,n]),this.name=t,this.args=e})),lt="attrgroup",ct=X.extends(lt,(function(t,e,i){X.apply(this,[lt,e,i]),this.attrs=t||[]})),ut="operation",_t=q.extends(ut,(function(t,e,i){q.apply(this,[t||ut,e,i])})),dt=_t.extends("bin",(function(t,e,i,n,s){_t.apply(this,["bin",n,s]),this.type=t,this.left=e,this.right=i})),pt="statement",ft=X.extends(pt,(function(t,e,i){X.apply(this,[t||pt,e,i])})),Tt="block",kt=ft.extends(Tt,(function(t,e,i,n){ft.apply(this,[t||Tt,i,n]),this.children=e.filter(Boolean)})),Et="literal",mt=q.extends(Et,(function(t,e,i,n,s){q.apply(this,[t||Et,n,s]),this.value=e,i&&(this.raw=i)})),xt="boolean",yt=mt.extends(xt,(function(t,e,i,n){mt.apply(this,[xt,t,e,i,n])})),vt="break",At=ft.extends(vt,(function(t,e,i){ft.apply(this,[vt,e,i]),this.level=t})),gt="byref",Nt=q.extends(gt,(function(t,e,i){q.apply(this,[gt,e,i]),this.what=t})),Ct="call",St=q.extends(Ct,(function(t,e,i,n){q.apply(this,[Ct,i,n]),this.what=t,this.arguments=e})),bt="case",Lt=ft.extends(bt,(function(t,e,i,n){ft.apply(this,[bt,i,n]),this.test=t,this.body=e})),Ot="cast",It=_t.extends(Ot,(function(t,e,i,n,s){_t.apply(this,[Ot,n,s]),this.type=t,this.raw=e,this.expr=i})),Rt="catch",wt=ft.extends(Rt,(function(t,e,i,n,s){ft.apply(this,[Rt,n,s]),this.body=t,this.what=e,this.variable=i})),Dt="declaration",Pt=ft.extends(Dt,(function(t,e,i,n){ft.apply(this,[t||Dt,i,n]),this.name=e}));Pt.prototype.parseFlags=function(t){this.isAbstract=1===t[2],this.isFinal=2===t[2],"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 Ut=Pt,Bt="class",Mt=Ut.extends(Bt,(function(t,e,i,n,s,r,o){Ut.apply(this,[Bt,t,r,o]),this.isAnonymous=!t,this.extends=e,this.implements=i,this.body=n,this.attrGroups=[],this.parseFlags(s)})),Ft="constantstatement",Ht=ft.extends(Ft,(function(t,e,i,n){ft.apply(this,[t||Ft,i,n]),this.constants=e})),Gt="classconstant",Vt=Ht.extends(Gt,(function(t,e,i,n,s,r){Ht.apply(this,[t||Gt,e,s,r]),this.parseFlags(i),this.attrGroups=n}));Vt.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")};var Wt=Vt,Qt="clone",Yt=q.extends(Qt,(function(t,e,i){q.apply(this,[Qt,e,i]),this.what=t})),jt="closure",$t=q.extends(jt,(function(t,e,i,n,s,r,o,a){q.apply(this,[jt,o,a]),this.uses=i,this.arguments=t,this.byref=e,this.type=n,this.nullable=s,this.isStatic=r||!1,this.body=null,this.attrGroups=[]})),zt=X.extends("comment",(function(t,e,i,n){X.apply(this,[t,i,n]),this.value=e})),Kt="commentblock",Xt=zt.extends(Kt,(function(t,e,i){zt.apply(this,[Kt,t,e,i])})),Jt="commentline",qt=zt.extends(Jt,(function(t,e,i){zt.apply(this,[Jt,t,e,i])})),Zt="constant",te=X.extends(Zt,(function(t,e,i,n){X.apply(this,[Zt,i,n]),this.name=t,this.value=e})),ee="continue",ie=ft.extends(ee,(function(t,e,i){ft.apply(this,[ee,e,i]),this.level=t})),ne="declare",se=kt.extends(ne,(function(t,e,i,n,s){kt.apply(this,[ne,e,n,s]),this.directives=t,this.mode=i}));se.MODE_SHORT="short",se.MODE_BLOCK="block",se.MODE_NONE="none";var re=se,oe="declaredirective",ae=X.extends(oe,(function(t,e,i,n){X.apply(this,[oe,i,n]),this.key=t,this.value=e})),he=ft.extends("do",(function(t,e,i,n){ft.apply(this,["do",i,n]),this.test=t,this.body=e})),le="echo",ce=ft.extends(le,(function(t,e,i,n){ft.apply(this,[le,i,n]),this.shortForm=e,this.expressions=t})),ue="empty",_e=q.extends(ue,(function(t,e,i){q.apply(this,[ue,e,i]),this.expression=t})),de="encapsed",pe=mt.extends(de,(function(t,e,i,n,s){mt.apply(this,[de,t,e,n,s]),this.type=i}));pe.TYPE_STRING="string",pe.TYPE_SHELL="shell",pe.TYPE_HEREDOC="heredoc",pe.TYPE_OFFSET="offset";var fe=pe,Te="encapsedpart",ke=q.extends(Te,(function(t,e,i,n,s){q.apply(this,[Te,n,s]),this.expression=t,this.syntax=e,this.curly=i})),Ee="entry",me=q.extends(Ee,(function(t,e,i,n,s,r){q.apply(this,[Ee,s,r]),this.key=t,this.value=e,this.byRef=i,this.unpack=n})),xe="error",ye=X.extends(xe,(function(t,e,i,n,s,r){X.apply(this,[xe,s,r]),this.message=t,this.token=e,this.line=i,this.expected=n})),ve="eval",Ae=q.extends(ve,(function(t,e,i){q.apply(this,[ve,e,i]),this.source=t})),ge="exit",Ne=q.extends(ge,(function(t,e,i,n){q.apply(this,[ge,i,n]),this.expression=t,this.useDie=e})),Ce="expressionstatement",Se=ft.extends(Ce,(function(t,e,i){ft.apply(this,[Ce,e,i]),this.expression=t})),be=ft.extends("for",(function(t,e,i,n,s,r,o){ft.apply(this,["for",r,o]),this.init=t,this.test=e,this.increment=i,this.shortForm=s,this.body=n})),Le="foreach",Oe=ft.extends(Le,(function(t,e,i,n,s,r,o){ft.apply(this,[Le,r,o]),this.source=t,this.key=e,this.value=i,this.shortForm=s,this.body=n})),Ie="function",Re=Ut.extends(Ie,(function(t,e,i,n,s,r,o){Ut.apply(this,[Ie,t,r,o]),this.arguments=e,this.byref=i,this.type=n,this.nullable=s,this.body=null,this.attrGroups=[]})),we="global",De=ft.extends(we,(function(t,e,i){ft.apply(this,[we,e,i]),this.items=t})),Pe="goto",Ue=ft.extends(Pe,(function(t,e,i){ft.apply(this,[Pe,e,i]),this.label=t})),Be="halt",Me=ft.extends(Be,(function(t,e,i){ft.apply(this,[Be,e,i]),this.after=t})),Fe="identifier",He=X.extends(Fe,(function(t,e,i){X.apply(this,[Fe,e,i]),this.name=t})),Ge=ft.extends("if",(function(t,e,i,n,s,r){ft.apply(this,["if",s,r]),this.test=t,this.body=e,this.alternate=i,this.shortForm=n})),Ve="include",We=q.extends(Ve,(function(t,e,i,n,s){q.apply(this,[Ve,n,s]),this.once=t,this.require=e,this.target=i})),Qe="inline",Ye=mt.extends(Qe,(function(t,e,i,n){mt.apply(this,[Qe,t,e,i,n])})),je="interface",$e=Ut.extends(je,(function(t,e,i,n,s,r){Ut.apply(this,[je,t,s,r]),this.extends=e,this.body=i,this.attrGroups=n})),ze="isset",Ke=q.extends(ze,(function(t,e,i){q.apply(this,[ze,e,i]),this.variables=t})),Xe="label",Je=ft.extends(Xe,(function(t,e,i){ft.apply(this,[Xe,e,i]),this.name=t})),qe="list",Ze=q.extends(qe,(function(t,e,i,n){q.apply(this,[qe,i,n]),this.items=t,this.shortForm=e})),ti="lookup",ei=q.extends(ti,(function(t,e,i,n,s){q.apply(this,[t||ti,n,s]),this.what=e,this.offset=i})),ii="magic",ni=mt.extends(ii,(function(t,e,i,n){mt.apply(this,[ii,t,e,i,n])})),si="match",ri=q.extends(si,(function(t,e,i,n){q.apply(this,[si,i,n]),this.cond=t,this.arms=e})),oi="matcharm",ai=q.extends(oi,(function(t,e,i,n){q.apply(this,[oi,i,n]),this.conds=t,this.body=e})),hi="method",li=Re.extends(hi,(function(){Re.apply(this,arguments),this.kind=hi})),ci="reference",ui=X.extends(ci,(function(t,e,i){X.apply(this,[t||ci,e,i])})),_i="name",di=ui.extends(_i,(function t(e,i,n,s){ui.apply(this,[_i,n,s]),i?this.resolution=t.RELATIVE_NAME:1===e.length?this.resolution=t.UNQUALIFIED_NAME:e[0]?this.resolution=t.QUALIFIED_NAME:this.resolution=t.FULL_QUALIFIED_NAME,this.name=e.join("\\")}));di.UNQUALIFIED_NAME="uqn",di.QUALIFIED_NAME="qn",di.FULL_QUALIFIED_NAME="fqn",di.RELATIVE_NAME="rn";var pi=di,fi="namespace",Ti=kt.extends(fi,(function(t,e,i,n,s){kt.apply(this,[fi,e,n,s]),this.name=t,this.withBrackets=i||!1})),ki="namedargument",Ei=q.extends(ki,(function(t,e,i,n){q.apply(this,[ki,i,n]),this.name=t,this.value=e})),mi=q.extends("new",(function(t,e,i,n){q.apply(this,["new",i,n]),this.what=t,this.arguments=e})),xi="noop",yi=X.extends(xi,(function(t,e){X.apply(this,[xi,t,e])})),vi="nowdoc",Ai=mt.extends(vi,(function(t,e,i,n,s){mt.apply(this,[vi,t,e,n,s]),this.label=i})),gi="nullkeyword",Ni=X.extends(gi,(function(t,e,i){X.apply(this,[gi,e,i]),this.raw=t})),Ci="nullsafepropertylookup",Si=ei.extends(Ci,(function(t,e,i,n){ei.apply(this,[Ci,t,e,i,n])})),bi="number",Li=mt.extends(bi,(function(t,e,i,n){mt.apply(this,[bi,t,e,i,n])})),Oi="offsetlookup",Ii=ei.extends(Oi,(function(t,e,i,n){ei.apply(this,[Oi,t,e,i,n])})),Ri="parameter",wi=Ut.extends(Ri,(function(t,e,i,n,s,r,o,a,h){Ut.apply(this,[Ri,t,a,h]),this.value=i,this.type=e,this.byref=n,this.variadic=s,this.nullable=r,this.flags=o||0,this.attrGroups=[]})),Di="parentreference",Pi=ui.extends(Di,(function(t,e,i){ui.apply(this,[Di,e,i]),this.raw=t})),Ui="post",Bi=_t.extends(Ui,(function(t,e,i,n){_t.apply(this,[Ui,i,n]),this.type=t,this.what=e})),Mi=_t.extends("pre",(function(t,e,i,n){_t.apply(this,["pre",i,n]),this.type=t,this.what=e})),Fi="print",Hi=q.extends(Fi,(function(t,e,i){q.apply(this,[Fi,e,i]),this.expression=t})),Gi="program",Vi=kt.extends(Gi,(function(t,e,i,n,s,r){kt.apply(this,[Gi,t,s,r]),this.errors=e,i&&(this.comments=i),n&&(this.tokens=n)})),Wi="property",Qi=ft.extends(Wi,(function(t,e,i,n,s,r,o){ft.apply(this,[Wi,r,o]),this.name=t,this.value=e,this.nullable=i,this.type=n,this.attrGroups=s})),Yi="propertylookup",ji=ei.extends(Yi,(function(t,e,i,n){ei.apply(this,[Yi,t,e,i,n])})),$i="propertystatement",zi=ft.extends($i,(function(t,e,i,n,s){ft.apply(this,[$i,n,s]),this.properties=e,this.parseFlags(i)}));zi.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 Ki=zi,Xi="retif",Ji=q.extends(Xi,(function(t,e,i,n,s){q.apply(this,[Xi,n,s]),this.test=t,this.trueExpr=e,this.falseExpr=i})),qi="return",Zi=ft.extends(qi,(function(t,e,i){ft.apply(this,[qi,e,i]),this.expr=t})),tn="selfreference",en=ui.extends(tn,(function(t,e,i){ui.apply(this,[tn,e,i]),this.raw=t})),nn="silent",sn=q.extends(nn,(function(t,e,i){q.apply(this,[nn,e,i]),this.expr=t})),rn="static",on=ft.extends(rn,(function(t,e,i){ft.apply(this,[rn,e,i]),this.variables=t})),an="staticvariable",hn=X.extends(an,(function(t,e,i,n){X.apply(this,[an,i,n]),this.variable=t,this.defaultValue=e})),ln="staticlookup",cn=ei.extends(ln,(function(t,e,i,n){ei.apply(this,[ln,t,e,i,n])})),un="staticreference",_n=ui.extends(un,(function(t,e,i){ui.apply(this,[un,e,i]),this.raw=t})),dn="string",pn=mt.extends(dn,(function(t,e,i,n,s,r){mt.apply(this,[dn,e,n,s,r]),this.unicode=i,this.isDoubleQuote=t})),fn="switch",Tn=ft.extends(fn,(function(t,e,i,n,s){ft.apply(this,[fn,n,s]),this.test=t,this.body=e,this.shortForm=i})),kn="throw",En=ft.extends(kn,(function(t,e,i){ft.apply(this,[kn,e,i]),this.what=t})),mn="trait",xn=Ut.extends(mn,(function(t,e,i,n){Ut.apply(this,[mn,t,i,n]),this.body=e})),yn="traitalias",vn=X.extends(yn,(function(t,e,i,n,s,r){X.apply(this,[yn,s,r]),this.trait=t,this.method=e,this.as=i,this.visibility="",n&&(0===n[0]?this.visibility="public":1===n[0]?this.visibility="protected":2===n[0]&&(this.visibility="private"))})),An="traitprecedence",gn=X.extends(An,(function(t,e,i,n,s){X.apply(this,[An,n,s]),this.trait=t,this.method=e,this.instead=i})),Nn="traituse",Cn=X.extends(Nn,(function(t,e,i,n){X.apply(this,[Nn,i,n]),this.traits=t,this.adaptations=e})),Sn=ft.extends("try",(function(t,e,i,n,s){ft.apply(this,["try",n,s]),this.body=t,this.catches=e,this.always=i})),bn="typereference",Ln=ui.extends(bn,(function(t,e,i,n){ui.apply(this,[bn,i,n]),this.name=t,this.raw=e}));Ln.types=["int","float","string","bool","object","array","callable","iterable","void"];var On=Ln,In="unary",Rn=_t.extends(In,(function(t,e,i,n){_t.apply(this,[In,i,n]),this.type=t,this.what=e})),wn="uniontype",Dn=Ut.extends(wn,(function(t,e,i){Ut.apply(this,[wn,null,e,i]),this.types=t})),Pn="unset",Un=ft.extends(Pn,(function(t,e,i){ft.apply(this,[Pn,e,i]),this.variables=t})),Bn="usegroup",Mn=ft.extends(Bn,(function(t,e,i,n,s){ft.apply(this,[Bn,n,s]),this.name=t,this.type=e,this.items=i})),Fn="useitem",Hn=ft.extends(Fn,(function(t,e,i,n,s){ft.apply(this,[Fn,n,s]),this.name=t,this.alias=e,this.type=i}));Hn.TYPE_CONST="const",Hn.TYPE_FUNCTION="function";var Gn=Hn,Vn="variable",Wn=q.extends(Vn,(function(t,e,i,n){q.apply(this,[Vn,i,n]),this.name=t,this.curly=e||!1})),Qn="variadic",Yn=q.extends(Qn,(function(t,e,i){q.apply(this,[Qn,e,i]),this.what=t})),jn="while",$n=ft.extends(jn,(function(t,e,i,n,s){ft.apply(this,[jn,n,s]),this.test=t,this.body=e,this.shortForm=i})),zn="yield",Kn=q.extends(zn,(function(t,e,i,n){q.apply(this,[zn,i,n]),this.value=t,this.key=e})),Xn="yieldfrom",Jn=q.extends(Xn,(function(t,e,i){q.apply(this,[Xn,e,i]),this.value=t})),qn=function(t,e){this.withPositions=t,this.withSource=e};qn.prototype.position=function(t){return new z(t.lexer.yylloc.first_line,t.lexer.yylloc.first_column,t.lexer.yylloc.first_offset)},qn.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach((function(t,e){t.forEach((function(t){qn.precedence[t]=e+1}))})),qn.prototype.isRightAssociative=function(t){return"**"===t||"??"===t},qn.prototype.swapLocations=function(t,e,i,n){this.withPositions&&(t.loc.start=e.loc.start,t.loc.end=i.loc.end,this.withSource&&(t.loc.source=n.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},qn.prototype.resolveLocations=function(t,e,i,n){this.withPositions&&(t.loc.start.offset>e.loc.start.offset&&(t.loc.start=e.loc.start),t.loc.end.offset<i.loc.end.offset&&(t.loc.end=i.loc.end),this.withSource&&(t.loc.source=n.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},qn.prototype.resolvePrecedence=function(t,e){var i,n,s;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?(n=qn.precedence[t.type],s=qn.precedence[t.right.type],n&&s&&s<=n&&(t.type!==t.right.type||!this.isRightAssociative(t.type))&&(i=t.right,t.right=t.right.left,this.swapLocations(t,t.left,t.right,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i)):"retif"===t.right.kind&&(n=qn.precedence[t.type],s=qn.precedence["?"],n&&s&&s<=n&&(i=t.right,t.right=t.right.test,this.swapLocations(t,t.left,t.right,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i))):"silent"!==t.kind&&"cast"!==t.kind||!t.expr||t.expr.parenthesizedExpression?"unary"===t.kind?t.what&&!t.what.parenthesizedExpression&&("bin"===t.what.kind?(i=t.what,t.what=t.what.left,this.swapLocations(t,t,t.what,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i):"retif"===t.what.kind&&(i=t.what,t.what=t.what.test,this.swapLocations(t,t,t.what,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i)):"retif"===t.kind?t.falseExpr&&"retif"===t.falseExpr.kind&&!t.falseExpr.parenthesizedExpression&&(i=t.falseExpr,t.falseExpr=i.test,this.swapLocations(t,t.test,t.falseExpr,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i):"assign"===t.kind?t.right&&"bin"===t.right.kind&&!t.right.parenthesizedExpression&&(n=qn.precedence["="],s=qn.precedence[t.right.type],n&&s&&s<n&&(i=t.right,t.right=t.right.left,i.left=t,this.swapLocations(i,i.left,t.right,e),t=i)):"expressionstatement"===t.kind&&this.swapLocations(t,t.expression,t,e):"bin"===t.expr.kind?(i=t.expr,t.expr=t.expr.left,this.swapLocations(t,t,t.expr,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i):"retif"===t.expr.kind&&(i=t.expr,t.expr=t.expr.test,this.swapLocations(t,t,t.expr,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i),t},qn.prototype.prepare=function(t,e,i){var n=null;(this.withPositions||this.withSource)&&(n=this.position(i));var s=this,r=function r(){var o=null,a=Array.prototype.slice.call(arguments);if(a.push(e),s.withPositions||s.withSource){var h=null;s.withSource&&(h=i.lexer._input.substring(n.offset,i.prev[2])),o=new $(h,n,new z(i.prev[0],i.prev[1],i.prev[2])),a.push(o)}t||(t=a.shift());var l=s[t];if("function"!=typeof l)throw new Error('Undefined node "'+t+'"');var c=Object.create(l.prototype);return l.apply(c,a),r.instance=c,r.trailingComments&&(c.trailingComments=r.trailingComments),"function"==typeof r.postBuild&&r.postBuild(c),i.debug&&delete qn.stack[r.stackUid],s.resolvePrecedence(c,i)};return i.debug&&(qn.stack||(qn.stack={},qn.stackUid=1),qn.stack[++qn.stackUid]={position:n,stack:(new Error).stack.split("\n").slice(3,5)},r.stackUid=qn.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:i._docIndex=i._docs.length-e.length),i.debug&&delete qn.stack[r.stackUid]},r},qn.prototype.checkNodes=function(){var t=[];for(var e in qn.stack)qn.stack.hasOwnProperty(e)&&t.push(qn.stack[e]);return qn.stack={},t},[tt,it,st,ot,ht,ct,dt,kt,yt,At,Nt,St,Lt,It,wt,Mt,Wt,Yt,$t,zt,Xt,qt,te,Ht,ie,Ut,re,ae,he,ce,_e,fe,ke,me,ye,Ae,Ne,q,Se,be,Oe,Re,De,Ue,Me,He,Ge,We,Ye,$e,Ke,Je,Ze,mt,ei,ni,ri,ai,li,pi,Ti,Ei,mi,X,yi,Ai,Ni,Si,Li,Ii,_t,wi,Pi,Bi,Mi,Hi,Vi,Qi,ji,Ki,ui,Ji,Zi,en,sn,ft,on,hn,cn,_n,pn,Tn,En,xn,vn,gn,Cn,Sn,On,Rn,Dn,Un,Mn,Gn,Wn,Yn,$n,Kn,Jn].forEach((function(t){qn.prototype[t.kind]=t}));var Zn=qn;function ts(t,e){for(var i=Object.keys(t),n=i.length;n--;){var s=i[n],r=t[s];null===r?delete e[s]:"function"==typeof r?e[s]=r.bind(e):Array.isArray(r)?e[s]=Array.isArray(e[s])?e[s].concat(r):r:e[s]="object"==typeof r&&"object"==typeof e[s]?ts(r,e[s]):r}return e}var es=function(t){if("function"==typeof this)return new this(t);if(this.tokens=j,this.lexer=new k(this),this.ast=new Zn,this.parser=new Y(this.lexer,this.ast),t&&"object"==typeof t){if(t.parser&&(t.lexer||(t.lexer={}),t.parser.version)){if("string"==typeof t.parser.version){var 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")}ts(t,this),this.lexer.version=this.parser.version}},is=function(t){return"function"==typeof t.write?t.toString():t};es.create=function(t){return new es(t)},es.parseEval=function(t,e){return new es(e).parseEval(t)},es.prototype.parseEval=function(t){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,t=is(t),this.parser.parse(t,"eval")},es.parseCode=function(t,e,i){return"object"!=typeof e||i||(i=e,e="unknown"),new es(i).parseCode(t,e)},es.prototype.parseCode=function(t,e){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,t=is(t),this.parser.parse(t,e)},es.tokenGetAll=function(t,e){return new es(e).tokenGetAll(t)},es.prototype.tokenGetAll=function(t){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,t=is(t);var e=this.lexer.EOF,i=this.tokens.values;this.lexer.setInput(t);for(var n=this.lexer.lex()||e,s=[];n!=e;){var r=this.lexer.yytext;i.hasOwnProperty(n)&&(r=[i[n],r,this.lexer.yylloc.first_line]),s.push(r),n=this.lexer.lex()||e}return s};var ns=es,ss=j,rs=k,os=Zn,as=Y,hs=ts,ls=es;ns.tokens=ss,ns.lexer=rs,ns.AST=os,ns.parser=as,ns.combine=hs,ns.default=ls;var cs=function(t,e,i){var n=i&&"markdown"===i.parentParser;if(!t&&n)return"";t=t.replace(/\?>\r?\n<\?/g,"?>\n___PSEUDO_INLINE_PLACEHOLDER___<?");var s,r=new ns({parser:{extractDoc:!0},ast:{withPositions:!0,withSource:!0}}),o=-1!==t.indexOf("<?php"),a=n&&!o;try{s=a?r.parseEval(t):r.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 s.extra={parseAsEval:a},s.comments.forEach((function(t){"\r"===t.value[t.value.length-1]&&(t.value=t.value.slice(0,-1),t.loc.end.offset=t.loc.end.offset-1),"\n"===t.value[t.value.length-1]&&(t.value=t.value.slice(0,-1),t.loc.end.offset=t.loc.end.offset-1)})),s},us=n.default.util,_s=us.hasNewline,ds=us.skipEverythingButNewLine,ps=us.skipNewline,fs=us.isNextLineEmpty,Ts=us.isPreviousLineEmpty,ks=us.getNextNonSpaceNonCommentCharacterIndex,Es=n.default.version;function ms(t,e){return parseInt(Es[0])>1?t[e]:t}var xs={};function ys(t){return xs[t]}[["or"],["xor"],["and"],["=","+=","-=","*=","**=","/=",".=","%=","&=","|=","^=","<<=",">>="],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!==","<>","<=>"],["<",">","<=",">="],[">>","<<"],["+","-","."],["*","/","%"],["!"],["instanceof"],["++","--","~"],["**"]].forEach((function(t,e){t.forEach((function(t){xs[t]=e}))}));var vs=["==","!=","===","!==","<>","<=>"],As=["*","/","%"],gs=[">>","<<"];function Ns(t){return["block","program","namespace","class","interface","trait","traituse","declare"].includes(t.kind)}function Cs(t){var e=t.body;return e?("block"===e.kind&&(e=e.children),e[0]):null}function Ss(t){var e=t.children||t.body||t.adaptations;return Array.isArray(e)?e:null}function bs(t){var e=t.getParentNode();return e?Ss(e):null}function Ls(t){return t.length>0?t[t.length-1]:null}function Os(t){var e=t.getValue();if("program"===e.kind){var i=Ss(e);return!(!i||0===i.length)&&"inline"===i[0].kind}if("switch"===e.kind){if(!e.body)return!1;var n=Ss(e.body);if(0===n.length)return!1;var s=v(n,1)[0];if(!s.body)return!1;var r=Ss(s.body);return 0!==r.length&&"inline"===r[0].kind}var o=Cs(e);return!!o&&"inline"===o.kind}var Is=["__construct","__destruct","__call","__callStatic","__get","__set","__isset","__unset","__sleep","__wakeup","__toString","__invoke","__set_state","__clone","__debugInfo"].reduce((function(t,e){return t[e.toLowerCase()]=e,t}),{});var Rs={printNumber:function(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)/,"")},getPrecedence:ys,isBitwiseOperator:function(t){return!!gs[t]||"|"===t||"^"===t||"&"===t},shouldFlatten:function(t,e){return ys(e)===ys(t)&&("**"!==t&&((!vs.includes(t)||!vs.includes(e))&&(!("%"===e&&As.includes(t)||"%"===t&&As.includes(e))&&((e===t||!As.includes(e)||!As.includes(t))&&(!gs.includes(t)||!gs.includes(e))))))},nodeHasStatement:Ns,getNodeListProperty:Ss,getParentNodeListProperty:bs,getLast:Ls,getPenultimate:function(t){return t.length>1?t[t.length-2]:null},isLastStatement:function(t){var e=bs(t);if(!e)return!0;var i=t.getValue();return e[e.length-1]===i},getBodyFirstChild:Cs,lineShouldEndWithSemicolon:function(t){var e=t.getValue(),i=t.getParentNode();if(!i)return!1;if(["for","foreach","while","do","if","switch"].includes(i.kind)&&"block"!==e.kind&&"if"!==e.kind&&(i.body===e||i.alternate===e))return!0;if(!Ns(i))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){var n=t.getParentNode();if(n&&"interface"===n.kind)return!0}return["expressionstatement","do","usegroup","classconstant","propertystatement","traitprecedence","traitalias","goto","constantstatement","global","static","echo","unset","return","break","continue","throw"].includes(e.kind)},fileShouldEndWithHardline:function(t){var e=t.getValue(),i="program"===e.kind,n=e.children&&Ls(e.children);if(!i)return!1;if(n&&["halt","inline"].includes(n.kind))return!1;if(n&&("declare"===n.kind||"namespace"===n.kind)){var s=n.children.length>0&&Ls(n.children);if(s&&["halt","inline"].includes(s.kind))return!1}return!0},maybeStripLeadingSlashFromUse:function(t){var e=t.replace(/^\\/,"");return-1!==e.indexOf("\\")?e:t},hasDanglingComments:function(t){return t.comments&&t.comments.some((function(t){return!t.leading&&!t.trailing}))},hasLeadingComment:function(t){return t.comments&&t.comments.some((function(t){return t.leading}))},hasTrailingComment:function(t){return t.comments&&t.comments.some((function(t){return t.trailing}))},docShouldHaveTrailingNewline:function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.getNode(i),s=e.getNode(i+1),r=e.getNode(i+2);if(!s)return!1;if(r&&["call","new","echo"].includes(r.kind)&&!["call","array"].includes(s.kind)||"parameter"===s.kind){var o=r.arguments.length-1,a=r.arguments.indexOf(s);return a!==o}if(r&&"for"===r.kind){var h=r.init.indexOf(s);if(-1!==h)return h!==r.init.length-1;var l=r.test.indexOf(s);if(-1!==l)return l!==r.test.length-1;var c=r.increment.indexOf(s);if(-1!==c)return c!==r.increment.length-1}if("bin"===s.kind)return s.left===n||t(e,i+1);if("case"===s.kind&&s.test===n)return!0;if("staticvariable"===s.kind){var u=r.variables.length-1,_=r.variables.indexOf(s);return _!==u}if("entry"===s.kind){if(s.key===n)return!0;var d=r.items.length-1,p=r.items.indexOf(s);return p!==d}if(["call","new"].includes(s.kind)){var f=s.arguments.length-1,T=s.arguments.indexOf(n);return T!==f}if("echo"===s.kind){var k=s.expressions.length-1,E=s.expressions.indexOf(n);return E!==k}if("array"===s.kind){var m=s.items.length-1,x=s.items.indexOf(n);return x!==m}return"retif"===s.kind&&t(e,i+1)},isLookupNode:function(t){return"propertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind},isFirstChildrenInlineNode:Os,shouldPrintHardLineAfterStartInControlStructure:function(t){var e=t.getValue();return!["try","catch"].includes(e.kind)&&Os(t)},shouldPrintHardLineBeforeEndInControlStructure:function(t){var e=t.getValue();if(["try","catch"].includes(e.kind))return!0;if("switch"===e.kind){var i=Ss(e.body);if(0===i.length)return!0;var n=Ls(i);if(!n.body)return!0;var s=Ss(n.body);return 0===s.length||"inline"!==s[0].kind}return!Os(t)},getAlignment:function(t){var e=t.split("\n").pop();return e.length-e.trimLeft().length+1},isProgramLikeNode:function(t){return["program","declare","namespace"].includes(t.kind)},isReferenceLikeNode:function(t){return["name","parentreference","selfreference","staticreference"].includes(t.kind)},getNodeKindIncludingLogical:function(t){return"bin"===t.kind&&["||","&&"].includes(t.type)?"logical":t.kind},useDoubleQuote:function(t,e){if(t.isDoubleQuote===e.singleQuote){var i=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?i:!i}return t.isDoubleQuote},hasEmptyBody:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",i=t.getValue();return i[e]&&i[e].children&&0===i[e].children.length&&(!i[e].comments||0===i[e].comments.length)},isNextLineEmptyAfterNamespace:function(t,e,i){var n=i(e);return n=ds(t,n),n=ps(t,n),_s(t,n)},shouldPrintHardlineBeforeTrailingComma:function(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)},isDocNode:function(t){return"nowdoc"===t.kind||"encapsed"===t.kind&&"heredoc"===t.type},getAncestorNode:function(t,e){var i=function(t,e){for(var i,n=[].concat(e),s=-1;i=t.getParentNode(++s);)if(-1!==n.indexOf(i.kind))return s;return-1}(t,e);return-1===i?null:t.getParentNode(i)},getNextNode:function(t,e){var i=t.getParentNode(),n=Ss(i);if(!n)return null;var s=n.indexOf(e);return-1===s?null:i.children[s+1]},normalizeMagicMethodName:function(t){var e=t.toLowerCase();return Is[e]?Is[e]:t},isPreviousLineEmpty:function(t,e,i){return Ts(t,e,ms(i,"locStart"))},isNextLineEmpty:function(t,e,i){return fs(t,e,ms(i,"locEnd"))},getNextNonSpaceNonCommentCharacterIndex:function(t,e,i){return ks(t,e,ms(i,"locEnd"))}},ws=n.default.util,Ds=ws.addLeadingComment,Ps=ws.addDanglingComment,Us=ws.addTrailingComment,Bs=ws.skipNewline,Ms=ws.hasNewline,Fs=ws.hasNewlineInRange,Hs=n.default.doc.builders,Gs=Hs.concat,Vs=Hs.join,Ws=Hs.indent,Qs=Hs.hardline,Ys=Hs.cursor,js=Hs.lineSuffix,$s=Hs.breakParent,zs=Rs.getNextNonSpaceNonCommentCharacterIndex,Ks=Rs.isNextLineEmpty,Xs=Rs.isPreviousLineEmpty,Js=Rs.isLookupNode;function qs(t,e){var i=t.children;0===i.length?Ps(t,e):Ds(i[0],e)}function Zs(t,e){"block"===t.kind?qs(t,e):Ds(t,e)}function tr(t,e,i,n,s,r){var o=zs(t,s,r),a=t.charAt(o);return e&&"identifier"===e.kind&&i&&("function"===i.kind||"method"===i.kind)&&")"===a?(Us(i,s),!0):!(!i||"function"!==i.kind&&"method"!==i.kind||!n||"block"!==n.kind)&&(qs(n,s),!0)}function er(t,e,i,n,s,r){if(!i||"if"!==i.kind||!n)return!1;var o=zs(t,s,r);return")"===t.charAt(o)?(Us(e,s),!0):e===i.body&&n===i.alternate?(Ps(i,s),!0):"if"===n.kind?(Zs(n.body,s),!0):i.body===n&&(Ds(n,s),!0)}function ir(t,e,i){if(t&&["class","interface","trait"].includes(t.kind)){if(e&&t.extends)if(Array.isArray(t.extends)){if(t.extends.some((function(t){if(e&&e===t)return Ps(e,i),!0})))return!0}else if(e===t.extends)return Ps(e,i),!0;if(e&&t.implements&&t.implements.some((function(t){if(e&&e===t)return Ps(e,i),!0})))return!0;if(!(t.body&&t.body.length>0))return Ps(t,i),!0}return!!(e&&"class"===e.kind&&e.isAnonymous&&e.leadingComments&&"commentblock"===i.kind)}function nr(t,e,i,n,s){if(e&&("function"===e.kind||"method"===e.kind)){for(var r=0,o=0;o<e.arguments.length;o++)r=s.locEnd(e.arguments[o])>r?s.locEnd(e.arguments[o]):r;var a=e.body&&s.locStart(n)>r&&s.locEnd(n)<s.locStart(e.body),h=zs(t,n,s);if(e.type&&a&&")"!==t.charAt(h))return s.locEnd(n)<s.locStart(e.type)?(Ps(e.type,n),!0):(Us(e.type,n),!0)}return!1}function sr(t,e,i,n,s){return!(!i||!["function","method","parameter"].includes(i.kind))&&("typereference"===e.kind&&"identifier"===n.kind&&(Us(e,s),!0))}function rr(t,e){return!(!t||!["label","goto"].includes(t.kind))&&(Us(t,e),!0)}function or(t,e,i,n){return i&&"inline"===i.kind?(i.leadingComments||(i.leadingComments=[]),i.leadingComments.includes(n)||i.leadingComments.push(n),!0):!(t||i||!e||"inline"!==e.kind)&&(Ps(e,n),!0)}function ar(t,e,i){return!(!t||"try"!==t.kind||!e)&&("block"===e.kind?(qs(e,i),!0):"try"===e.kind?(Zs(e.always,i),!0):"catch"===e.kind&&(Zs(e.body,i),!0))}function hr(t,e,i,n){return i||e||!t||"namespace"!==t.kind||t.withBrackets?!(e||!t||"namespace"!==t.kind||t.withBrackets)&&(Ps(t,n),!0):(Us(t,n),!0)}function lr(t,e,i,n){return!(!t||"declare"!==t.kind)&&((!e||"noop"!==e.kind)&&(i&&t.directives[0]!==i?!(!i||!e)&&(Ds(i,n),!0):("none"===t.mode?Us(t,n):Ps(t,n),!0)))}function cr(t,e,i,n,s,r){if(!i||"while"!==i.kind||!n)return!1;var o=zs(t,s,r);return")"===t.charAt(o)?(Us(e,s),!0):"block"===n.kind&&(qs(n,s),!0)}function ur(t,e){return t.getValue().printed=!0,e.printer.printComment(t,e)}function _r(t,e,i){return t.getNode()===e.cursorNode&&t.getValue()?Gs([Ys,i,Ys]):i}var dr={handleOwnLineComment:function(t,e,i){var n=t.precedingNode,s=t.enclosingNode,r=t.followingNode;return tr(e,n,s,r,t,i)||function(t,e,i){if(t&&Js(t)&&e&&["identifier","variable","encapsed"].includes(e.kind))return Ds(t,i),!0;return!1}(s,r,t)||er(e,n,s,r,t,i)||cr(e,n,s,r,t,i)||ar(s,r,t)||ir(s,r,t)||sr(e,n,s,r,t)||nr(e,s,r,t,i)||function(t,e,i,n){if(!i&&t&&("for"===t.kind||"foreach"===t.kind))return t.body&&"block"!==t.body.kind?Ds(i,n):Ds(t,n),!0;return!1}(s,0,r,t)||or(s,n,r,t)||lr(s,n,r,t)},handleEndOfLineComment:function(t,e,i){var n=t.precedingNode,s=t.enclosingNode,r=t.followingNode;return function(t,e,i,n,s){if(!e&&!n&&i&&"array"===i.kind)return Us(i,s),!0;return!1}(0,n,s,r,t)||function(t,e,i,n,s){if(i&&"return"===i.kind&&!i.expr)return Us(i,s),!0;return!1}(0,0,s,0,t)||tr(e,n,s,r,t,i)||function(t,e,i,n,s,r){var o=e&&!Fs(s,r.locEnd(e),r.locStart(n));if((!e||!o)&&t&&"retif"===t.kind&&i)return Ds(i,n),!0;return!1}(s,n,r,t,e,i)||er(e,n,s,r,t,i)||cr(e,n,s,r,t,i)||ar(s,r,t)||ir(s,r,t)||sr(e,n,s,r,t)||nr(e,s,r,t,i)||function(t,e){if(t&&"entry"===t.kind)return Ds(t,e),!0;return!1}(s,t)||function(t,e,i){if(e&&"call"===e.kind&&t&&e.what===t&&e.arguments.length>0)return Ds(e.arguments[0],i),!0;return!1}(n,s,t)||function(t,e,i){if(t&&"assign"===t.kind&&e){var n=t.loc.start.offset+t.loc.source.indexOf("=");if(i.loc.start.offset>n)return Ds(e,i),!0}return!1}(s,r,t)||or(s,n,r,t)||hr(s,n,r,t)||lr(s,n,r,t)||rr(s,t)},handleRemainingComment:function(t,e,i){var n=t.precedingNode,s=t.enclosingNode,r=t.followingNode;return er(e,n,s,r,t,i)||cr(e,n,s,r,t,i)||function(t,e,i,n){var s=zs(t,i,n);if(")"!==t.charAt(s))return!1;if(e&&("function"===e.kind||"closure"===e.kind||"method"===e.kind||"call"===e.kind||"new"===e.kind)&&0===e.arguments.length)return Ps(e,i),!0;return!1}(e,s,t,i)||ir(s,r,t)||function(t,e,i){if(t&&"traituse"===t.kind&&t.adaptations&&!t.adaptations.length)return Ps(t,i),!0;return!1}(s,0,t)||sr(e,n,s,r,t)||nr(e,s,r,t,i)||rr(s,t)||function(t,e,i,n){if(e&&"halt"===e.kind)return Ps(e,n),!0;if(t&&"halt"===t.kind)return Ps(t,n),!0;return!1}(n,s,0,t)||function(t,e){if(t&&("continue"===t.kind||"break"===t.kind)&&!t.label)return Us(t,e),!0;return!1}(s,t)||or(s,n,r,t)||hr(s,n,r,t)},getCommentChildNodes:function(t){return"object"!=typeof t?[]:function(t){return Object.keys(t).filter((function(t){return"kind"!==t&&"loc"!==t&&"errors"!==t&&"extra"!==t&&"comments"!==t&&"leadingComments"!==t&&"enclosingNode"!==t&&"precedingNode"!==t&&"followingNode"!==t})).map((function(e){return t[e]}))}(t)},canAttachComment:function(t){return t.kind&&"commentblock"!==t.kind&&"commentline"!==t.kind},isBlockComment:function(t){return"commentblock"===t.kind},printDanglingComments:function(t,e,i,n){var s=[],r=t.getValue();return r&&r.comments?(t.each((function(t){var i=t.getValue();!i||i.leading||i.trailing||n&&!n(i)||s.push(ur(t,e))}),"comments"),0===s.length?"":i?Vs(Qs,s):Ws(Gs([Qs,Vs(Qs,s)]))):""},hasLeadingComment:function(t){return t.comments&&t.comments.some((function(t){return t.leading}))},hasTrailingComment:function(t){return t.comments&&t.comments.some((function(t){return t.trailing}))},hasLeadingOwnLineComment:function(t,e,i){return e.comments&&e.comments.some((function(e){return e.leading&&Ms(t,i.locEnd(e))}))},printComments:function(t,e){var i=[];return t.forEach((function(t,n,s){t.printed=!0;var r=s.length===n+1;i.push(t.value),r||i.push(Qs),Ks(e.originalText,t,e)&&!r&&i.push(Qs)})),Gs(i)},printAllComments:function(t,e,i,n){var s=t.getValue(),r=e(t),o=s&&s.comments;if(!o||0===o.length)return _r(t,i,r);var a=[],h=[n?";":"",r];return t.each((function(t){var e=t.getValue(),n=e.leading,s=e.trailing;if(n){var r=function(t,e,i){var n=t.getValue(),s=ur(t,i);if(!s)return"";var r=i.printer.isBlockComment&&i.printer.isBlockComment(n);return Gs(r?[s,Ms(i.originalText,i.locEnd(n))?Qs:" "]:[s,Qs])}(t,0,i);if(!r)return;a.push(r);var o=i.originalText;Ms(o,Bs(o,i.locEnd(e)))&&a.push(Qs)}else s&&h.push(function(t,e,i){var n=t.getValue(),s=ur(t,i);if(!s)return"";var r=i.printer.isBlockComment&&i.printer.isBlockComment(n);if(Ms(i.originalText,i.locStart(n),{backwards:!0})){var o=Xs(i.originalText,n,i);return js(Gs([Qs,o?Qs:"",s]))}return Gs(r?[" ",s]:[js(Gs([" ",s])),r?"":$s])}(t,0,i))}),"comments"),_r(t,i,Gs(a.concat(h)))}};function pr(){}pr.strictEqual=function(){};var fr=pr,Tr=Rs.getPrecedence,kr=Rs.shouldFlatten,Er=Rs.isBitwiseOperator;var mr=function(t){var e=t.getParentNode();if(!e)return!1;var i=t.getName(),n=t.getNode();if(["program","expressionstatement","namespace","declare","block","include","print","return","echo"].includes(e.kind))return!1;switch(n.kind){case"pre":case"post":if("unary"===e.kind)return"pre"===n.kind&&("+"===n.type&&"+"===e.type||"-"===n.type&&"-"===e.type);case"unary":switch(e.kind){case"unary":return n.type===e.type&&("+"===n.type||"-"===n.type);case"propertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===n;case"bin":return"**"===e.type&&"left"===i;default:return!1}case"bin":switch(e.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"staticlookup":case"offsetlookup":return"what"===i&&e.what===n;case"bin":var s=e.type,r=Tr(s),o=n.type,a=Tr(o);return r>a||("||"===s&&"&&"===o||(r===a&&"right"===i?(fr.strictEqual(e.right,n),!0):r===a&&!kr(s,o)||(r<a&&"%"===o?"+"===s||"-"===s:!!Er(s))));default:return!1}case"propertylookup":case"staticlookup":switch(e.kind){case"call":return"what"===i&&e.what===n&&n.parenthesizedExpression;default:return!1}case"clone":case"new":switch(e.kind){case"propertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===n;default:return!1}case"yield":switch(e.kind){case"propertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===n;case"retif":return e.test===n;default:return!(!n.key&&!n.value)}case"assign":return("for"!==e.kind||!e.init.includes(n)&&!e.increment.includes(n))&&("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"===i&&!e.trueExpr);case"propertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===n;default:return!1}case"closure":switch(e.kind){case"call":return"what"===i&&e.what===n;case"propertylookup":return!0;default:return!1}case"silence":case"cast":return n.parenthesizedExpression;case"string":case"array":switch(e.kind){case"propertylookup":case"staticlookup":case"offsetlookup":case"call":return(!["string","array"].includes(n.kind)||"offsetlookup"!==e.kind)&&("what"===i&&e.what===n);default:return!1}case"print":case"include":return"bin"===e.kind}return!1},xr=n.default.doc.builders,yr=xr.breakParent,vr=xr.concat,Ar=xr.join,gr=xr.line,Nr=xr.lineSuffix,Cr=xr.group,Sr=xr.conditionalGroup,br=xr.indent,Lr=xr.dedent,Or=xr.ifBreak,Ir=xr.hardline,Rr=xr.softline,wr=xr.literalline,Dr=xr.align,Pr=xr.dedentToRoot,Ur=n.default.doc.utils.willBreak,Br=n.default.util,Mr=Br.isNextLineEmptyAfterIndex,Fr=Br.hasNewline,Hr=Br.hasNewlineInRange,Gr=Rs.getLast,Vr=Rs.getPenultimate,Wr=Rs.isLastStatement,Qr=Rs.lineShouldEndWithSemicolon,Yr=Rs.printNumber,jr=Rs.shouldFlatten,$r=Rs.maybeStripLeadingSlashFromUse,zr=Rs.fileShouldEndWithHardline,Kr=Rs.hasDanglingComments,Xr=Rs.hasLeadingComment,Jr=Rs.hasTrailingComment,qr=Rs.docShouldHaveTrailingNewline,Zr=Rs.isLookupNode,to=Rs.isFirstChildrenInlineNode,eo=Rs.shouldPrintHardLineAfterStartInControlStructure,io=Rs.shouldPrintHardLineBeforeEndInControlStructure,no=Rs.getAlignment,so=Rs.isProgramLikeNode,ro=Rs.getNodeKindIncludingLogical,oo=Rs.useDoubleQuote,ao=Rs.hasEmptyBody,ho=Rs.isNextLineEmptyAfterNamespace,lo=Rs.shouldPrintHardlineBeforeTrailingComma,co=Rs.isDocNode,uo=Rs.getAncestorNode,_o=Rs.isReferenceLikeNode,po=Rs.getNextNode,fo=Rs.normalizeMagicMethodName,To=Rs.getNextNonSpaceNonCommentCharacterIndex,ko=Rs.isNextLineEmpty;function Eo(t,e){return parseFloat(t)>=parseFloat(e)}function mo(t,e){return!!t.trailingCommaPHP&&Eo(t.phpVersion,e)}function xo(t){switch(t.braceStyle){case"1tbs":return!1;case"psr-2":default:return!0}}function yo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return vr([n?"?":"","->",t.call(i,"offset")])}function vo(t,e,i){return yo(t,e,i,!0)}function Ao(t,e,i){var n=t.getValue(),s=!["variable","identifier"].includes(n.offset.kind);return vr(["::",s?"{":"",t.call(i,"offset"),s?"}":""])}function go(t,e,i){var n=t.getValue(),s=n.offset&&"number"===n.offset.kind||uo(t,"encapsed");return vr(["[",n.offset?Cr(vr([br(vr([s?"":Rr,t.call(i,"offset")])),s?"":Rr])):"","]"])}function No(t){return"array"===t.kind&&(t.items.length>0||t.comments)||"function"===t.kind||"method"===t.kind||"closure"===t.kind}function Co(t){var e=Gr(t),i=Vr(t);return!Xr(e)&&!Jr(e)&&No(e)&&(!i||i.kind!==e.kind)}function So(t){if(2!==t.length)return!1;var e=v(t,2),i=e[0],n=e[1];return!(i.comments&&i.comments.length||"function"!==i.kind&&"method"!==i.kind&&"closure"!==i.kind||"retif"===n.kind||No(n))}function bo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"arguments",s=t.getValue()[n];if(0===s.length)return vr(["(",dr.printDanglingComments(t,e,!0),")"]);var r=!1,o=!1,a=s.length-1,h=t.map((function(t,n){var s=t.getNode(),h=[i(t)];return n===a||(ko(e.originalText,s,e)?(0===n&&(o=!0),r=!0,h.push(",",Ir,Ir)):h.push(",",gr)),vr(h)}),n),l=t.getValue(),c=Gr(s),u=mo(e,"7.3")&&["call","new","unset","isset"].includes(l.kind)||mo(e,"8.0")&&["function","closure","method","arrowfunc"].includes(l.kind)?br(vr([c&&lo(c)?Ir:"",","])):"";function _(){return Cr(vr(["(",br(vr([gr,vr(h)])),u,gr,")"]),{shouldBreak:!0})}var d=So(s),p=Co(s);if(d||p){var f,T=(d?h.slice(1).some(Ur):h.slice(0,-1).some(Ur))||r,k=0;t.each((function(t){d&&0===k&&(f=[vr([t.call((function(t){return i(t,{expandFirstArg:!0})})),h.length>1?",":"",o?Ir:gr,o?Ir:""])].concat(h.slice(1))),p&&k===s.length-1&&(f=h.slice(0,-1).concat(t.call((function(t){return i(t,{expandLastArg:!0})})))),k++}),n);var E=h.some(Ur),m=vr(["(",vr(f),")"]);return vr([E?yr:"",Sr([E?Or(_(),m):m,vr(d?["(",Cr(f[0],{shouldBreak:!0}),vr(f.slice(1)),")"]:["(",vr(h.slice(0,-1)),Cr(Gr(f),{shouldBreak:!0}),")"]),Cr(vr(["(",br(vr([gr,vr(h)])),Or(u),gr,")"]),{shouldBreak:!0})],{shouldBreak:T})])}return Cr(vr(["(",br(vr([Rr,vr(h)])),Or(u),Rr,")"]),{shouldBreak:h.some(Ur)||r})}function Lo(t){return"array"===t.kind&&0!==t.items.length}function Oo(t){return"array"===t.right.kind&&0!==t.right.items.length}function Io(t,e,i){var n=t.getValue();switch(n.kind){case"propertylookup":return yo(t,e,i);case"nullsafepropertylookup":return vo(t,e,i);case"staticlookup":return Ao(t,0,i);case"offsetlookup":return go(t,0,i);default:return"Have not implemented lookup kind ".concat(n.kind," yet.")}}function Ro(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.opening,n=void 0===i||i;if("heredoc"===t.type)return n?"<<<".concat(t.label):t.label;var s={string:'"',shell:"`"};return s[t.type]?s[t.type]:"Unimplemented encapsed type ".concat(t.type)}function wo(t,e,i){var n=[],s=[];return t.each((function(t){n.push(vr(s)),n.push(Cr(i(t))),s=[",",gr],t.getValue()&&ko(e.originalText,t.getValue(),e)&&s.push(Rr)}),"items"),vr(n)}function Do(t,e){if(0===e.length)return t;var i=0;return e.reduce((function(e,n){var s=n.start,r=n.end,o=n.alignment,a=n.before,h=n.after,l=vr([a||"",vr(t.slice(s,r)),h||""]),c=e.concat(t.slice(i,s),o?Pr(Cr(vr([Dr(new Array(o).join(" "),l)]))):Cr(l),r===t.length-1?t.slice(r):"");return i=r,c}),[])}function Po(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children",s=t.getValue(),r=t.getParentNode(),o=-1,a=[],h=[];t.map((function(l,c){var u=l.getValue(),_="inline"===u.kind,d=i(l),p=s[n],f=p[c+1],T=!Wr(l)&&!_&&(f&&"case"===f.kind?!to(t):f&&"inline"!==f.kind),k=vr([d,T?Ir:"",T&&ko(e.originalText,u,e)?Ir:""]),E=0===c,m=p.length-1===c,x="block"===s.kind&&r&&["function","closure","method","try","catch"].includes(r.kind),y=x&&E?"":" ";if(_||!_&&m&&o>=0){var v=o;if(_&&(o=c),_&&!E||!_&&m){var A=(_?v:o)+1,g=m&&!_?c+1:c,N=p[_?v:o],C=N?no(N.raw):"",S=g-A>1,b=S?x&&!N||so(s)&&0===A?"":Ir:"",L=S&&"halt"!==u.kind?x&&m?"":Ir:"";S&&(y=""),h.push({start:A,end:g,alignment:C,before:b,after:L})}}if(_){var O=f&&"echo"===f.kind&&f.shortForm?"<?=":"<?php",I=u.leadingComments&&u.leadingComments.length?vr([E&&"namespace"!==s.kind&&!x?"<?php":"","namespace"!==s.kind&&x?"":Ir,dr.printComments(u.leadingComments,e),Ir,"?>"]):so(s)&&E&&"namespace"!==s.kind?"":vr([y,"?>"]),R=u.comments&&u.comments.length?vr([O,Ir,dr.printComments(u.comments,e),Ir,"?>"]):so(s)&&m?"":vr([O," "]);k=vr([I,k,R])}a.push(k)}),n);var l=Do(a,h);if("program"===s.kind&&!s.extra.parseAsEval){var c=[],u=v(s.children,1),_=u[0],d=!_||"inline"!==_.kind;if(d){var p=e.originalText.trim().match(/^<\?(php|=)(\s+)?\S/),f=vr([p&&p[2]&&p[2].includes("\n")?vr([Ir,p[2].split("\n").length>2?Ir:""]):" ",s.comments?dr.printComments(s.comments,e):""]),T=_&&"echo"===_.kind&&_.shortForm;c.push(vr([T?"<?=":"<?php",f]))}c.push(vr(l));var k=e.originalText.trim().endsWith("?>");if(k){var E=Gr(s.children),m=E?vr([Hr(e.originalText.trimEnd(),e.locEnd(E),e.locEnd(s))?Ir:" ",ko(e.originalText,E,e)?Ir:""]):s.comments?Ir:"";c.push(Nr(vr([m,"?>"])))}return vr(c)}return vr(l)}function Uo(t,e,i,n){return vr(t.map((function(t){var n=[];return n.push(i(t)),Wr(t)||(n.push(Ir),ko(e.originalText,t.getValue(),e)&&n.push(Ir)),vr(n)}),n))}function Bo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"extends",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:" ",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:" ",o=t.getValue(),a=Kr(o[n])?vr([Ir,t.call((function(t){return dr.printDanglingComments(t,e,!0)}),n),Ir]):s,h=Array.isArray(o[n])?Cr(vr([Ar(",",t.map((function(t){var n=i(t);return Kr(t.getValue())?vr([Ir,dr.printDanglingComments(t,e,!0),Ir,n]):vr([r,n])}),n))])):vr([r,t.call(i,n)]);return br(vr([a,n,Ur(a)?br(h):h]))}function Mo(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"body",s=t.getValue();if(!s[n])return";";var r=t.call(i,n);return vr([s.shortForm?":":" {",br(vr(["block"!==s[n].kind||s[n].children&&s[n].children.length>0||s[n].comments&&s[n].comments.length>0?vr([eo(t)?"switch"===s.kind?" ":"":Ir,r]):""])),"if"===s.kind&&"body"===n?"":vr([io(t)?Ir:"",s.shortForm?vr(["end",s.kind,";"]):"}"])])}function Fo(t,e,i,n,s,r,o){if(!n)return e;var a=Ho(t,n,s,r,o);return Cr(vr([e,i,a]))}function Ho(t,e,i,n,s){var r=n?"&":"";if(dr.hasLeadingOwnLineComment(s.originalText,e,s))return br(vr([Ir,r,i]));var o="cast"===e.kind?e.expr:e;return"bin"===o.kind&&!Oo(o)||"retif"===o.kind&&(!o.trueExpr&&!Lo(o.falseExpr)||"bin"===o.test.kind&&!Oo(o.test))||("variable"===t.kind||"string"===t.kind||Zr(t))&&("string"===o.kind&&!Go(o)||function t(e){return!!Zr(e)&&(!("variable"!==e.what.kind&&!_o(e.what))||t(e.what))}(o))?Cr(br(vr([gr,r,i]))):vr([" ",r,i])}function Go(t){return t.raw.includes("\n")}function Vo(t,e,i){return("string"===t.kind||"encapsed"===t.kind&&("string"===t.type||"shell"===t.type))&&Go(t)&&!Fr(e,i.locStart(t),{backwards:!0})}var Wo=function(t,e,i){var n=t.getValue();if(!n)return"";if("string"==typeof n)return n;var s=function(t,e,i){var n=t.getValue();switch(n.kind){case"program":return Cr(vr([Po(t,e,i),dr.printDanglingComments(t,e,!0,(function(t){return!t.printed}))]));case"expressionstatement":return t.call(i,"expression");case"block":return vr([Po(t,e,i),dr.printDanglingComments(t,e,!0)]);case"declare":var s=function(t){return Ar(", ",t.map((function(t){return vr([i(t)])}),"directives"))};if(["block","short"].includes(n.mode))return vr(["declare(",s(t),")","block"===n.mode?" {":":",n.children.length>0?br(vr([Ir,Po(t,e,i)])):"",dr.printDanglingComments(t,e),Ir,"block"===n.mode?"}":"enddeclare;"]);var r=po(t,n);return vr(["declare(",s(t),")",r&&"inline"===r.kind?"":";"]);case"declaredirective":return vr([t.call(i,"key"),"=",t.call(i,"value")]);case"namespace":return vr(["namespace ",n.name&&"string"==typeof n.name?vr([n.name,n.withBrackets?" ":""]):"",n.withBrackets?"{":";",Kr(n)?vr([" ",dr.printDanglingComments(t,e,!0)]):"",n.children.length>0?n.withBrackets?br(vr([Ir,Po(t,e,i)])):vr(["inline"===n.children[0].kind?"":vr([Ir,ho(e.originalText,n,e.locStart)?Ir:""]),Po(t,e,i)]):"",n.withBrackets?vr([Ir,"}"]):""]);case"usegroup":return Cr(vr(["use ",n.type?vr([n.type," "]):"",br(vr([n.name?vr([$r(n.name),"\\{",Rr]):"",Ar(vr([",",gr]),t.map((function(t){return vr([i(t)])}),"items"))])),n.name?vr([Or(mo(e,"7.2")?",":""),Rr,"}"]):""]));case"useitem":return vr([n.type?vr([n.type," "]):"",$r(n.name),Kr(n)?vr([" ",dr.printDanglingComments(t,e,!0)]):"",n.alias?vr([" as ",t.call(i,"alias")]):""]);case"class":case"interface":case"trait":return function(t,e,i){var n=t.getValue(),s=[];n.isFinal&&s.push("final ");n.isAbstract&&s.push("abstract ");var r="class"===n.kind&&n.isAnonymous;s.push(r?"":n.kind),n.name&&s.push(" ",t.call(i,"name"));n.extends&&n.implements?s.push(Sr([vr([Bo(t,e,i,"extends"),Bo(t,e,i,"implements")]),vr([Bo(t,e,i,"extends"),Bo(t,e,i,"implements"," ",Ir)]),vr([Bo(t,e,i,"extends",Ir," "),Bo(t,e,i,"implements",Ir,n.implements.length>1?Ir:" ")])],{shouldBreak:Kr(n.extends)})):(n.extends&&s.push(Sr([Bo(t,e,i,"extends"),Bo(t,e,i,"extends"," ",Ir),Bo(t,e,i,"extends",Ir,n.extends.length>1?Ir:" ")])),n.implements&&s.push(Sr([Bo(t,e,i,"implements"),Bo(t,e,i,"implements"," ",Ir),Bo(t,e,i,"implements",Ir,n.implements.length>1?Ir:" ")])));var o=Cr(vr([Cr(vr(s)),xo(e)?r?gr:Ir:" "])),a=n.body&&0===n.body.length&&!Kr(n),h=vr(["{",br(vr([a?"":Ir,Uo(t,e,i,"body")])),dr.printDanglingComments(t,e,!0),r&&a?Rr:Ir,"}"]);return vr([o,h])}(t,e,i);case"traitprecedence":return vr([t.call(i,"trait"),"::",t.call(i,"method")," insteadof ",Ar(", ",t.map(i,"instead"))]);case"traitalias":return vr([n.trait?vr([t.call(i,"trait"),"::"]):"",n.method?t.call(i,"method"):""," as ",Ar(" ",[].concat(A(n.visibility?[n.visibility]:[]),A(n.as?[t.call(i,"as")]:[])))]);case"traituse":return Cr(vr(["use ",br(Cr(Ar(vr([",",gr]),t.map(i,"traits")))),n.adaptations?vr([" {",n.adaptations.length>0?vr([br(vr([Ir,Uo(t,e,i,"adaptations")])),Ir]):Kr(n)?vr([gr,dr.printDanglingComments(t,e,!0),gr]):"","}"]):""]));case"function":case"closure":case"method":return function(t,e,i){var n=t.getValue(),s=[];n.isFinal&&s.push("final ");n.isAbstract&&s.push("abstract ");n.visibility&&s.push(n.visibility," ");n.isStatic&&s.push("static ");s.push("function "),n.byref&&s.push("&");n.name&&s.push(t.call(i,"name"));s.push(bo(t,e,i)),n.uses&&n.uses.length>0&&s.push(Cr(vr([" use ",bo(t,e,i,"uses")])));n.type&&s.push(vr([": ",Kr(n.type)?vr([t.call((function(t){return dr.printDanglingComments(t,e,!0)}),"type")," "]):"",n.nullable?"?":"",t.call(i,"type")]));var r=vr(s);if(!n.body)return r;var o="closure"===n.kind,a=vr(["{",br(vr([ao(t)?"":Ir,t.call(i,"body")])),o&&ao(t)?"":Ir,"}"]);if(o)return vr([r," ",a]);if(0===n.arguments.length)return vr([r,xo(e)?Ir:" ",a]);if(s.some(Ur))return vr([r," ",a]);return Sr([vr([r,xo(e)?Ir:" ",a]),vr([r," ",a])])}(t,e,i);case"arrowfunc":return vr([n.isStatic?"static ":"","fn",bo(t,e,i),n.type?vr([": ",n.nullable?"?":"",t.call(i,"type")]):""," => ",t.call(i,"body")]);case"parameter":var o="";1===n.flags?o="public ":2===n.flags?o="protected ":4===n.flags&&(o="private ");var a=vr([o,n.nullable?"?":"",n.type?vr([t.call(i,"type")," "]):"",n.byref?"&":"",n.variadic?"...":"","$",t.call(i,"name")]);return n.value?Cr(vr([a,Kr(n)?" ":"",dr.printDanglingComments(t,e,!0),vr([" =",Ho(n.name,n.value,t.call(i,"value"),!1,e)])])):a;case"variadic":return vr(["...",t.call(i,"what")]);case"property":return Cr(vr([n.type?vr([n.nullable?"?":"",t.call(i,"type")," "]):"","$",t.call(i,"name"),n.value?vr([" =",Ho(n.name,n.value,t.call(i,"value"),!1,e)]):""]));case"propertystatement":var h,l=t.map((function(t){return i(t)}),"properties"),c=n.properties.some((function(t){return t.value}));if(1!==l.length||n.properties[0].comments)l.length>0&&(h=br(l[0]));else h=v(l,1)[0];var u=n.visibility||null===n.visibility;return Cr(vr([u?vr([null===n.visibility?"var":n.visibility,""]):"",n.isStatic?vr([u?" ":"","static"]):"",h?vr([" ",h]):"",br(vr(l.slice(1).map((function(t){return vr([",",c?Ir:gr,t])}))))]));case"if":var _=[],d=Mo(t,e,i,"body"),p=Cr(vr(["if (",Cr(vr([br(vr([Rr,t.call(i,"test")])),Rr])),")",d]));if(_.push(p,to(t)||!n.body?"":Ir),n.alternate){_.push(n.shortForm?"":"} ");var f=Jr(n.body)&&n.body.comments.some((function(t){return t.trailing&&!dr.isBlockComment(t)}))||function(t){if(!t.comments)return!1;var e=Gr(t.comments.filter((function(t){return!t.leading&&!t.trailing})));return e&&!dr.isBlockComment(e)}(n),T=!f;_.push(T?"":Ir),Kr(n)&&_.push(ko(e.originalText,n.body,e)?Ir:"",dr.printDanglingComments(t,e,!0),f?Ir:" "),_.push("else",Cr("if"===n.alternate.kind?t.call(i,"alternate"):Mo(t,e,i,"alternate")))}else _.push(n.body?n.shortForm?"endif;":"}":"");return vr(_);case"do":return vr(["do",Mo(t,e,i,"body")," while (",Cr(vr([br(vr([Rr,t.call(i,"test")])),Rr])),")"]);case"while":case"switch":return Cr(vr([n.kind," (",Cr(vr([br(vr([Rr,t.call(i,"test")])),Rr])),")",Mo(t,e,i,"body")]));case"for":var k=Mo(t,e,i,"body"),E=dr.printDanglingComments(t,e,!0),m=E?vr([E,Rr]):"";return n.init.length||n.test.length||n.increment.length?vr([m,Cr(vr(["for (",Cr(vr([br(vr([Rr,Cr(vr([Ar(vr([",",gr]),t.map(i,"init"))])),";",gr,Cr(vr([Ar(vr([",",gr]),t.map(i,"test"))])),";",gr,Cr(Ar(vr([",",gr]),t.map(i,"increment")))])),Rr])),")",k]))]):vr([m,Cr(vr(["for (;;)",k]))]);case"foreach":var x=Mo(t,e,i,"body"),y=dr.printDanglingComments(t,e,!0),g=y?vr([y,Rr]):"";return vr([g,Cr(vr(["foreach (",Cr(vr([br(vr([Rr,t.call(i,"source"),gr,"as ",Cr(n.key?br(Ar(vr([" =>",gr]),[t.call(i,"key"),t.call(i,"value")])):t.call(i,"value"))])),Rr])),")",x]))]);case"try":var N=[];return N.push("try",Mo(t,e,i,"body")),n.catches&&N.push(vr(t.map(i,"catches"))),n.always&&N.push(" finally",Mo(t,e,i,"always")),vr(N);case"catch":return vr([" catch",n.what?vr([" (",Ar(" | ",t.map(i,"what")),n.variable?vr([" ",t.call(i,"variable")]):"",")"]):"",Mo(t,e,i,"body")]);case"case":return vr([n.test?vr(["case ",n.test.comments?br(t.call(i,"test")):t.call(i,"test"),":"]):"default:",n.body&&n.body.children&&n.body.children.length?br(vr([to(t)?"":Ir,t.call(i,"body")])):""]);case"break":case"continue":return n.level&&("number"===n.level.kind&&"1"!==n.level.value)?vr(["".concat(n.kind," "),t.call(i,"level")]):n.kind;case"call":return 1===n.arguments.length&&Vo(n.arguments[0],e.originalText,e)?vr([t.call(i,"what"),vr(["(",Ar(", ",t.map(i,"arguments")),")"])]):Zr(n.what)?function(t,e,i){var n=[];function s(t){var i=e.originalText,n=To(i,t,e);return")"===i.charAt(n)?Mr(i,n+1,e):ko(i,t,e)}function r(t){var o=t.getValue();if("call"!==o.kind||!Zr(o.what)&&"call"!==o.what.kind)if(Zr(o)){var a=null;a="propertylookup"===o.kind?yo(t,e,i):"nullsafepropertylookup"===o.kind?vo(t,e,i):"staticlookup"===o.kind?Ao(t,e,i):go(t,e,i),n.unshift({node:o,needsParens:mr(t),printed:dr.printAllComments(t,(function(){return a}),e)}),t.call((function(t){return r(t)}),"what")}else n.unshift({node:o,printed:t.call(i)});else n.unshift({node:o,printed:vr([dr.printAllComments(t,(function(){return vr([bo(t,e,i)])}),e),s(o)?Ir:""])}),t.call((function(t){return r(t)}),"what")}var o=t.getValue();n.unshift({node:o,printed:bo(t,e,i)}),t.call((function(t){return r(t)}),"what");for(var a=0;a<n.length;++a)"call"===n[a].node.kind&&n[a-1]&&["propertylookup","staticlookup"].includes(n[a-1].node.kind)&&n[a-1].needsParens&&(n[0].printed=vr(["(",n[0].printed]),n[a-1].printed=vr([n[a-1].printed,")"]));for(var h=[],l=[n[0]],c=1;c<n.length&&("call"===n[c].node.kind||Zr(n[c].node)&&n[c].node.offset&&"number"===n[c].node.offset.kind);++c)l.push(n[c]);if("call"!==n[0].node.kind)for(;c+1<n.length&&(Zr(n[c].node)&&Zr(n[c+1].node));++c)l.push(n[c]);h.push(l),l=[];for(var u=!1;c<n.length;++c){if(u&&Zr(n[c].node)){if("offsetlookup"===n[c].node.kind&&n[c].node.offset&&"number"===n[c].node.offset.kind){l.push(n[c]);continue}h.push(l),l=[],u=!1}"call"===n[c].node.kind&&(u=!0),l.push(n[c]),n[c].node.comments&&dr.hasTrailingComment(n[c].node)&&(h.push(l),l=[],u=!1)}l.length>0&&h.push(l);function _(t){var i=t[1].length&&"offsetlookup"===t[1][0].node.kind;if(1===t[0].length){var n=t[0][0].node;return"variable"===n.kind&&("this"===n.name||d&&s(n.name))||_o(n)}function s(t){return t.length<e.tabWidth}var r=Gr(t[0]).node;return Zr(r)&&("identifier"===r.offset.kind||"variable"===r.offset.kind)&&i}var d="expressionstatement"===t.getParentNode().kind,p=h.length>=2&&!h[1][0].node.comments&&_(h);function f(t){for(var e=[],i=0;i<t.length;i++)t[i+1]&&t[i+1].needsParens?(e.push("(",t[i].printed,t[i+1].printed,")"),i++):e.push(t[i].printed);return vr(e)}function T(t){return 0===t.length?"":br(Cr(vr([Ir,Ar(Ir,t.map(f))])))}var k=h.map(f),E=vr(k),m=p?3:2,x=h.slice(0,m).reduce((function(t,e){return t.concat(e)}),[]),y=x.slice(1,-1).some((function(t){return dr.hasLeadingComment(t.node)}))||x.slice(0,-1).some((function(t){return dr.hasTrailingComment(t.node)}))||h[m]&&dr.hasLeadingComment(h[m][0].node),v=uo(t,"encapsed");if(h.length<=m&&!y||v)return Cr(E);var A=Gr(p?h.slice(1,2)[0]:h[0]).node,g="call"!==A.kind&&s(A),N=vr([f(h[0]),p?vr(h.slice(1,2).map(f)):"",g?Ir:"",T(h.slice(p?2:1))]),C=n.filter((function(t){return"call"===t.node.kind})).length;if(y||C>=3||k.slice(0,-1).some(Ur))return Cr(N);return vr([Ur(E)||g?yr:"",Sr([E,N])])}(t,e,i):vr([t.call(i,"what"),bo(t,e,i)]);case"new":var C=n.what&&"class"===n.what.kind&&n.what.isAnonymous;if(!C&&1===n.arguments.length&&Vo(n.arguments[0],e.originalText,e))return vr(["new ",t.call(i,"what"),"(",Ar(", ",t.map(i,"arguments")),")"]);var S=[];if(S.push("new "),C)S.push(n.what.leadingComments&&"commentblock"===n.what.leadingComments[0].kind?vr([dr.printComments(n.what.leadingComments,e)," "]):"","class",n.arguments.length>0?vr([" ",bo(t,e,i)]):"",Cr(t.call(i,"what")));else{var b=vr([t.call(i,"what"),bo(t,e,i)]);S.push(Xr(n.what)?br(b):b)}return vr(S);case"clone":return vr(["clone ",n.what.comments?br(t.call(i,"what")):t.call(i,"what")]);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":var L,O=t.getParentNode(),I=0;do{L=t.getParentNode(I),I++}while(L&&Zr(L));var R=uo(t,"encapsed")||L&&("new"===L.kind||"assign"===L.kind&&"variable"!==L.left.kind)||"offsetlookup"===n.kind||(_o(n.what)||"variable"===n.what.kind)&&["identifier","variable","encapsedpart"].includes(n.offset.kind)&&O&&!Zr(O);return vr([t.call(i,"what"),R?Io(t,e,i):Cr(br(vr([Rr,Io(t,e,i)])))]);case"exit":return Cr(vr([n.useDie?"die":"exit","(",n.expression?Vo(n.expression,e.originalText,e)?t.call(i,"expression"):vr([br(vr([Rr,t.call(i,"expression")])),Rr]):dr.printDanglingComments(t,e),")"]));case"global":return Cr(vr(["global ",br(vr([Ar(vr([",",gr]),t.map(i,"items"))]))]));case"include":return vr([n.require?"require":"include",n.once?"_once":""," ",n.target.comments?br(t.call(i,"target")):t.call(i,"target")]);case"label":return vr([t.call(i,"name"),":"]);case"goto":return vr(["goto ",t.call(i,"label")]);case"throw":return vr(["throw ",n.what.comments?br(t.call(i,"what")):t.call(i,"what")]);case"silent":return vr(["@",t.call(i,"expr")]);case"halt":return vr([Kr(n)?vr([dr.printDanglingComments(t,e,!0),Ir]):"","__halt_compiler();",n.after]);case"eval":return Cr(vr(["eval(",Vo(n.source,e.originalText,e)?t.call(i,"source"):vr([br(vr([Rr,t.call(i,"source")])),Rr]),")"]));case"echo":var w,D=t.map((function(t){return i(t)}),"expressions");if(1!==D.length||n.expressions[0].comments)D.length>0&&(w=co(n.expressions[0])||n.expressions[0].comments?br(D[0]):Lr(D[0]));else w=v(D,1)[0];return Cr(vr([n.shortForm?"":"echo ",w||"",br(vr(D.slice(1).map((function(t){return vr([",",gr,t])}))))]));case"print":return vr(["print ",n.expression.comments?br(t.call(i,"expression")):t.call(i,"expression")]);case"return":var P=[];if(P.push("return"),n.expr){var U=t.call(i,"expr");P.push(" ",n.expr.comments?br(U):U)}return Kr(n)&&P.push(" ",dr.printDanglingComments(t,e,!0)),vr(P);case"isset":case"unset":return Cr(vr([n.kind,bo(t,e,i,"variables")]));case"empty":return Cr(vr(["empty(",br(vr([Rr,t.call(i,"expression")])),Rr,")"]));case"variable":var B=t.getParentNode(),M=t.getParentNode(1),F="assign"===B.kind?"":n.byref?"&":"",H="encapsedpart"===B.kind&&"simple"===B.syntax&&B.curly||M&&"offsetlookup"===B.kind&&"encapsedpart"===M.kind&&"simple"===M.syntax&&M.curly?"":"$",G=n.curly?"{":"",V=n.curly?"}":"";return vr([F,H,G,t.call(i,"name"),V]);case"constantstatement":case"classconstant":var W,Q=t.map((function(t){return i(t)}),"constants");if(1!==Q.length||n.constants[0].comments)Q.length>0&&(W=br(Q[0]));else W=v(Q,1)[0];return Cr(vr([n.visibility?vr([n.visibility," "]):"","const",W?vr([" ",W]):"",br(vr(Q.slice(1).map((function(t){return vr([",",Ir,t])}))))]));case"constant":return Fo(n.name,t.call(i,"name")," =",n.value,t.call(i,"value"),!1,e);case"static":var Y,j=t.map((function(t){return i(t)}),"variables"),$=n.variables.some((function(t){return t.defaultValue}));if(1!==j.length||n.variables[0].comments)j.length>0&&(Y=br(j[0]));else Y=v(j,1)[0];return Cr(vr(["static",Y?vr([" ",Y]):"",br(vr(j.slice(1).map((function(t){return vr([",",$?Ir:gr,t])}))))]));case"staticvariable":return Fo(n.variable,t.call(i,"variable")," =",n.defaultValue,t.call(i,"defaultValue"),!1,e);case"list":case"array":var z="array"===n.kind&&Eo(e.phpVersion,"5.4")||"list"===n.kind&&(n.shortForm||Eo(e.phpVersion,"7.1")),K=z?"[":vr([n.kind,"("]),X=z?"]":")";if(0===n.items.length)return Kr(n)?Cr(vr([K,dr.printDanglingComments(t,e),Rr,X])):vr([K,X]);var J=Gr(n.items),q=J&&"noop"===J.kind,Z=v(n.items.filter((function(t){return"noop"!==t.kind})).sort((function(t,i){return e.locStart(t)-e.locStart(i)})),1)[0],tt=!(!Z||!Z.key)&&Z&&Hr(e.originalText,e.locStart(n),e.locStart(Z));return Cr(vr([K,br(vr([Rr,wo(t,e,i)])),q?",":"",Or(!q&&mo(e,"5.0")?vr([J&&lo(J)?Ir:"",","]):""),dr.printDanglingComments(t,e,!0),Rr,X]),{shouldBreak:tt});case"entry":var et=n.byRef?"&":"",it=n.unpack?"...":"";return n.key?Fo(n.key,t.call(i,"key")," =>",n.value,t.call(i,"value"),et,e):vr([et,it,t.call(i,"value")]);case"yield":var nt=vr([n.key?vr([t.call(i,"key")," => "]):"",t.call(i,"value")]);return vr(["yield",n.key||n.value?" ":"",n.value&&n.value.comments?br(nt):nt]);case"yieldfrom":return vr(["yield from ",n.value.comments?br(t.call(i,"value")):t.call(i,"value")]);case"unary":return vr([n.type,t.call(i,"what")]);case"pre":return vr([n.type+n.type,t.call(i,"what")]);case"post":return vr([t.call(i,"what"),n.type+n.type]);case"cast":return vr(["(",n.type,") ",n.expr.comments?br(t.call(i,"expr")):t.call(i,"expr")]);case"assignref":case"assign":var st="assignref"===n.kind;return Fo(n.left,t.call(i,"left"),vr([" ",st?"=":n.operator]),n.right,t.call(i,"right"),st,e);case"bin":var rt=t.getParentNode(),ot=t.getParentNode(1),at=n!==rt.body&&("if"===rt.kind||"while"===rt.kind||"switch"===rt.kind||"do"===rt.kind),ht=function t(e,i,n,s,r){var o=[],a=e.getValue();if("bin"===a.kind){jr(a.type,a.left.type)?o=o.concat(e.call((function(e){return t(e,i,n,!0,r)}),"left")):o.push(e.call(i,"left"));var h=Oo(a),l=vr(h?[a.type," ",e.call(i,"right")]:[a.type,gr,e.call(i,"right")]),c=e.getParentNode(),u=!(r&&["||","&&"].includes(a.type))&&ro(c)!==ro(a)&&ro(a.left)!==ro(a)&&ro(a.right)!==ro(a),_=co(a.left)||"bin"===a.left.kind&&co(a.left.right);o.push(_?"":" ",u?Cr(l):l),s&&a.comments&&(o=dr.printAllComments(e,(function(){return vr(o)}),n))}else o.push(e.call(i));return o}(t,i,e,!1,at);if(at)return vr(ht);if("unary"===rt.kind||Zr(rt)&&"offsetlookup"!==rt.kind)return Cr(vr([br(vr([Rr,vr(ht)])),Rr]));var lt=n!==rt.body&&"for"===rt.kind||"retif"===rt.kind&&ot&&"return"!==ot.kind,ct=["assign","property","constant","staticvariable","entry"].includes(rt.kind),ut="bin"===n.left.kind&&jr(n.type,n.left.type);if(lt||Oo(n)&&!ut||!Oo(n)&&ct)return Cr(vr(ht));var _t=vr(ht.slice(1));return Cr(vr([ht.length>0?ht[0]:"",br(_t)]));case"retif":var dt,pt=[],ft=t.getParentNode(),Tt=0;do{dt=t.getParentNode(Tt),Tt++}while(dt&&"retif"===dt.kind);var kt=dt||ft,Et="bin"===n.falseExpr.kind?br(t.call(i,"falseExpr")):t.call(i,"falseExpr"),mt=vr([n.trueExpr?gr:" ","?",n.trueExpr?vr([" ","bin"===n.trueExpr.kind?br(t.call(i,"trueExpr")):t.call(i,"trueExpr"),gr]):"",":",n.trueExpr?vr([" ",Et]):vr([Lo(n.falseExpr)?" ":gr,Et])]);pt.push(mt);var xt=function(t){return ft===kt?Cr(t):t},yt=t.getParentNode(1),vt="cast"===ft.kind&&yt?yt:ft,At=["propertylookup","staticlookup"].includes(vt.kind),gt=t.call(i,"test");if(!n.trueExpr){var Nt=vr([gt,"bin"===vt.kind||["print","echo","return","include"].includes(kt.kind)?br(vr(pt)):vr(pt)]);return"call"===vt.kind&&vt.what===n||"unary"===vt.kind||Zr(vt)&&"offsetlookup"!==vt.kind?Cr(vr([br(vr([Rr,Nt])),Rr])):xt(Nt)}return xt(vr(["retif"===n.test.kind?br(gt):gt,br(vr(pt)),At?Rr:""]));case"boolean":return n.value?"true":"false";case"number":return Yr(n.value);case"string":if("encapsedpart"===t.getParentNode().kind){var Ct=t.getParentNode(1),St=0,bt=Eo(e.phpVersion,"7.3"),Lt=wr;if("heredoc"===Ct.type){Lt=bt?Ir:wr;var Ot=Ct.raw.split(/\r?\n/g);-1===(St=Ot[Ot.length-1].search(/\S/))&&(St=Ot[Ot.length-2].search(/\S/))}return Ar(Lt,n.raw.split(/\r?\n/g).map((function(t,e){return e>0||0===n.loc.start.column?t.substring(St):t})))}var It=oo(n,e)?'"':"'",Rt=n.raw;return"b"===n.raw[0]&&(Rt=Rt.slice(1)),['"',"'"].includes(Rt[0])&&(Rt=Rt.substr(1)),['"',"'"].includes(Rt[Rt.length-1])&&(Rt=Rt.substr(0,Rt.length-1)),vr(["b"===n.raw[0]?"b":"",It,Ar(wr,Rt.split(/\r?\n/g)),It]);case"uniontype":return Cr(vr(t.map((function(e,n){return vr(0===n?[t.call(i)]:["|",t.call(i)])}),"types")));case"encapsedpart":var wt="simple"===n.syntax&&n.curly||"complex"===n.syntax?vr([n.curly?"$":"","{"]):"",Dt="simple"===n.syntax&&n.curly||"complex"===n.syntax?"}":"";return vr([wt,t.call(i,"expression"),Dt]);case"encapsed":switch(n.type){case"string":case"shell":case"heredoc":var Pt=Eo(e.phpVersion,"7.3")?Ir:wr;return vr([Ro(n),"heredoc"===n.type?Pt:"",vr(t.map(i,"value")),Ro(n,{opening:!1}),"heredoc"===n.type&&qr(t)?Ir:""]);default:return"Have not implemented kind ".concat(n.type," yet.")}case"inline":return Ar(wr,n.raw.replace("___PSEUDO_INLINE_PLACEHOLDER___","").split(/\r?\n/g));case"magic":return n.value;case"nowdoc":var Ut=Eo(e.phpVersion,"7.3")?Ir:wr;return vr(["<<<'",n.label,"'",Ut,Ar(Ut,n.value.split(/\r?\n/g)),Ut,n.label,qr(t)?Ir:""]);case"name":return vr(["rn"===n.resolution?"namespace\\":"",n.name]);case"literal":return t.call(i,"value");case"parentreference":return"parent";case"selfreference":return"self";case"staticreference":return"static";case"typereference":return n.name;case"nullkeyword":return"null";case"identifier":return"method"===t.getParentNode().kind&&(n.name=fo(n.name)),t.call(i,"name");case"match":var Bt=t.map((function(t,e){var n=null===t.getValue().conds?"default":vr(t.map((function(t,e){return Cr(vr(e>0?[",",gr,i(t)]:[i(t)]))}),"conds")),s=t.call(i,"body");return vr(e>0?[", ",gr,n," => ",s]:[gr,n," => ",s])}),"arms");return Cr(vr(["match (",Cr(vr([Rr,br(vr([t.call(i,"cond")])),Rr])),") {",br(vr(Bt))," ",Rr,"}"]));case"noop":return n.comments?dr.printComments(t.getValue().comments,e):"";case"namedargument":return vr([n.name,": ",t.call(i,"value")]);case"error":default:return"Have not implemented kind ".concat(n.kind," yet.")}}(t,e,i),r=[],o=mr(t);return o&&r.unshift("("),r.push(s),o&&r.push(")"),Qr(t)&&r.push(";"),zr(t)&&r.push(Ir),vr(r)};var Qo=function(t,e){if(["loc","range","raw","comments","leadingComments","trailingComments","parenthesizedExpression","parent","prev","start","end","tokens","errors","extra"].forEach((function(t){delete e[t]})),"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(/\r\n?|\n/g,"")}if(("continue"===t.kind||"break"===t.kind)&&t.level){var i=e.level;"number"===i.kind&&(e.level="1"===i.value?null:i)}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;if("number"===t.kind&&(e.value=Rs.printNumber(t.value)),["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=Rs.normalizeMagicMethodName(e.name.name)),"noop"===t.kind)return null},Yo="PHP",jo={phpVersion:{since:"0.13.0",category:Yo,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"}]},trailingCommaPHP:{since:"0.0.0",category:Yo,type:"boolean",default:!0,description:"Print trailing commas wherever possible when multi-line."},braceStyle:{since:"0.10.0",category:Yo,type:"choice",default:"psr-2",description:"Print one space or newline for code blocks (classes and functions).",choices:[{value:"psr-2",description:"Use PSR-2 brace style."},{value:"1tbs",description:"Use 1tbs brace style."}]}},$o=function(t,e,i,n){if("length"!==i&&"prototype"!==i&&"arguments"!==i&&"caller"!==i){var s=Object.getOwnPropertyDescriptor(t,i),r=Object.getOwnPropertyDescriptor(e,i);!zo(s,r)&&n||Object.defineProperty(t,i,r)}},zo=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},Ko=function(t,e){var i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)},Xo=function(t,e){return"/* Wrapped ".concat(t,"*/\n").concat(e)},Jo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),qo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Zo=function(t,e,i){var n=""===i?"":"with ".concat(i.trim(),"() "),s=Xo.bind(null,n,e.toString());Object.defineProperty(s,"name",qo),Object.defineProperty(t,"toString",y(y({},Jo),{},{value:s}))},ta=function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=n.ignoreNonConfigurable,r=void 0!==s&&s,o=t.name,a=C(Reflect.ownKeys(e));try{for(a.s();!(i=a.n()).done;){var h=i.value;$o(t,e,h,r)}}catch(t){a.e(t)}finally{a.f()}return Ko(t,e),Zo(t,e,o),t},ea="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ia(t){return t&&t.default||t}var na,sa=function(){var t={};return t.promise=new Promise((function(e,i){t.resolve=e,t.reject=i})),t},ra=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){var i=ea&&ea.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){t.done?s(t.value):new i((function(e){e(t.value)})).then(o,a)}h((n=n.apply(t,e||[])).next())}))},n=ea&&ea.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(sa);function r(t){var e,n,r,o=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"maxAge",h=function(){return i(o,void 0,void 0,regeneratorRuntime.mark((function o(){var h,l,c,u,_=this;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(void 0===e){o.next=2;break}return o.abrupt("return");case 2:h=function(o){return i(_,void 0,void 0,regeneratorRuntime.mark((function i(){var h;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(r=s.default(),!((h=o[1][a]-Date.now())<=0)){i.next=6;break}return t.delete(o[0]),r.resolve(),i.abrupt("return");case 6:return e=o[0],"function"==typeof(n=setTimeout((function(){t.delete(o[0]),r&&r.resolve()}),h)).unref&&n.unref(),i.abrupt("return",r.promise);case 10:case"end":return i.stop()}}),i)})))},o.prev=3,l=C(t),o.prev=5,l.s();case 7:if((c=l.n()).done){o.next=13;break}return u=c.value,o.next=11,h(u);case 11:o.next=7;break;case 13:o.next=18;break;case 15:o.prev=15,o.t0=o.catch(5),l.e(o.t0);case 18:return o.prev=18,l.f(),o.finish(18);case 21:o.next=25;break;case 23:o.prev=23,o.t1=o.catch(3);case 25:e=void 0;case 26:case"end":return o.stop()}}),o,null,[[3,23],[5,15,18,21]])})))},l=function(){e=void 0,void 0!==n&&(clearTimeout(n),n=void 0),void 0!==r&&(r.reject(void 0),r=void 0)},c=t.set.bind(t);return t.set=function(i,n){t.has(i)&&t.delete(i);var s=c(i,n);return e&&e===i&&l(),h(),s},h(),t}e.default=r,t.exports=r,t.exports.default=r}));(na=ra)&&na.__esModule&&Object.prototype.hasOwnProperty.call(na,"default")&&na.default;var oa=new WeakMap,aa=new WeakMap,ha=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.cacheKey,n=e.cache,s=void 0===n?new Map:n,r=e.maxAge;"number"==typeof r&&ra(s);var o=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];var a=i?i(n):n[0],h=s.get(a);if(h)return h.data;var l=t.apply(this,n);return s.set(a,{data:l,maxAge:r?Date.now()+r:Number.POSITIVE_INFINITY}),l};return ta(o,t,{ignoreNonConfigurable:!0}),aa.set(o,s),o};ha.decorator=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,i,n){var s=e[i];if("function"!=typeof s)throw new TypeError("The decorated value must be a function");delete n.value,delete n.writable,n.get=function(){if(!oa.has(this)){var e=ha(s,t);return oa.set(this,e),e}return oa.get(this)}}},ha.clear=function(t){var e=aa.get(t);if(!e)throw new TypeError("Can't clear a function that was not memoized!");if("function"!=typeof e.clear)throw new TypeError("The cache Map can't be cleared!");e.clear()};var la=/@prettier|@format/,ca=ha((function(t){var e=cs(t),i=v(e.children,1)[0],n=v(e.comments.filter((function(t){return"commentblock"===t.kind})),1)[0];if(i&&n&&n.loc.start.line<i.loc.start.line)return n}));var ua=function(t){if(!la.test(t))return!1;var e=ca(t);if(e){var i=e.value;return la.test(i)}return!1},_a=function(t){var e=ca(t);if(e){var i=e.loc,n=i.start.offset,s=i.end.offset,r=t.substring(0,n),o=t.substring(s);return"".concat(r).concat(function(t,e){var i=t.split(/\r?\n/g);if(1===i.length){var n=v(/\/*\*\*(.*)\*\//.exec(i[0]),2)[1];i=["/**"," * ".concat(n.trim())," */"]}var s=i.findIndex((function(t){return/@\S/.test(t)}))||1;return i.splice(s,0," * @format"),i.join(function(t){var e=t.indexOf("\n");return e>=0&&"\r"===t.charAt(e-1)?"\r\n":"\n"}(e))}(e.value,t)).concat(o)}var a="<?php";if(!t.startsWith(a))return t;var h=a.length,l=t.substring(0,h),c=t.substring(h);return"".concat(l,"\n/** \n * @format \n */\n").concat(c)},da="programming",pa="text.html.php",fa="application/x-httpd-php",Ta="#4F5D95",ka=[".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"],Ea=[".php",".php_cs",".php_cs.dist","Phakefile"],ma=["php"],xa=["inc"],ya={name:"PHP",type:da,tmScope:pa,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:fa,color:Ta,extensions:ka,filenames:Ea,interpreters:ma,aliases:xa,languageId:272},va=Object.freeze({__proto__:null,name:"PHP",type:da,tmScope:pa,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:fa,color:Ta,extensions:ka,filenames:Ea,interpreters:ma,aliases:xa,languageId:272,default:ya}),Aa="HTML+PHP",ga="markup",Na="text.html.php",Ca="HTML",Sa=[".phtml"],ba="application/x-httpd-php",La={name:Aa,type:ga,tmScope:Na,group:Ca,extensions:Sa,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:ba,languageId:151},Oa=Object.freeze({__proto__:null,name:Aa,type:ga,tmScope:Na,group:Ca,extensions:Sa,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:ba,languageId:151,default:La}),Ia=ia(va),Ra=ia(Oa),wa=n.default.doc.builders,Da=wa.join,Pa=wa.hardline,Ua=ua,Ba=_a;function Ma(t,e){var i=e.extend,n=e.override,s={};for(var r in t){s["languageId"===r?"linguistLanguageId":r]=t[r]}if(i)for(var o in i)s[o]=(s[o]||[]).concat(i[o]);for(var a in n)s[a]=n[a];return s}var Fa=[Ma(Ia,{override:{parsers:["php"],vscodeLanguageIds:["php"]}}),Ma(Ra,{override:{parsers:["php"],vscodeLanguageIds:["php"]}})],Ha=function(t){return function(e){return e.loc&&e.loc[t]&&e.loc[t].offset}},Ga={php:{parse:cs,astFormat:"php",locStart:Ha("start"),locEnd:Ha("end"),hasPragma:Ua}},Va={languages:Fa,printers:{php:{print:Wo,insertPragma:Ba,massageAstNode:Qo,getCommentChildNodes:dr.getCommentChildNodes,canAttachComment:dr.canAttachComment,isBlockComment:dr.isBlockComment,handleComments:{ownLine:dr.handleOwnLineComment,endOfLine:dr.handleEndOfLineComment,remaining:dr.handleRemainingComment},willPrintOwnComments(t){var e=t.getValue();return e&&"noop"===e.kind},printComment(t){var e=t.getValue();switch(e.kind){case"commentblock":if(!e.value.includes("\n"))return e.value;var i=e.value.split(/\r?\n/g);return i.slice(1,i.length-1).every((function(t){return"*"===t.trim()[0]}))?Da(Pa,i.map((function(t,e){return(e>0?" ":"")+(e<i.length-1?t.trim():t.trimLeft())}))):e.value;case"commentline":return e.value.trimRight();default:throw new Error("Not a comment: ".concat(JSON.stringify(e)))}},hasPrettierIgnore(t){var e=t.getNode();return e&&e.comments&&e.comments.length>0&&e.comments.some((function(t){return t.value.includes("prettier-ignore")&&!t.value.includes("prettier-ignore-start")&&!t.value.includes("prettier-ignore-end")}))}}},parsers:Ga,options:jo,defaultOptions:{tabWidth:4}},Wa=Va.languages,Qa=Va.printers,Ya=Va.parsers,ja=Va.options,$a=Va.defaultOptions;t.default=Va,t.defaultOptions=$a,t.languages=Wa,t.options=ja,t.parsers=Ya,t.printers=Qa,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
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 i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=i(e),n={matchST_ATTRIBUTE:function(){let t=0,e=this.input();if(this.is_WHITESPACE()){do{e=this.input()}while(this.is_WHITESPACE());return this.unput(1),null}switch(e){case"]":return 0===t?this.popState():t--,"]";case"(":case")":case":":case"=":return this.consume_TOKEN();case"[":return t++,"[";case",":return",";case'"':return this.ST_DOUBLE_QUOTES();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case"/":if("/"===this._input[this.offset])return this.T_COMMENT();if("*"===this._input[this.offset])return this.input(),this.T_DOC_COMMENT()}if(this.is_LABEL_START()||"\\"===e){for(;this.offset<this.size;){const t=this.input();if(!this.is_LABEL()&&"\\"!==t){t&&this.unput(1);break}}return this.tok.T_STRING}if(this.is_NUM())return this.consume_NUM();throw new Error('Bad terminal sequence "'.concat(e,'" at line ').concat(this.yylineno," (offset ").concat(this.offset,")"))}};n.matchST_ATTRIBUTE;var r={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}};r.T_COMMENT,r.T_DOC_COMMENT;var o={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}};o.nextINITIAL,o.matchINITIAL;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 this.is_NUM()||t&&this.unput(1);for(;this.offset<this.size;){const i=t;if(t=this.input(),"_"===t){if("_"===i){this.unput(2);break}if("."===i){this.unput(1);break}if("e"===i||"E"===i){this.unput(2);break}}else{if("."===t){if(e){this.unput(1);break}if("_"===i){this.unput(2);break}e=!0;continue}if("e"===t||"E"===t){if("_"===i){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}};h.consume_NUM,h.consume_HNUM,h.consume_LNUM,h.consume_BNUM;var 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")}};a.matchST_LOOKING_FOR_PROPERTY,a.matchST_LOOKING_FOR_VARNAME,a.matchST_VAR_OFFSET;var 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.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}};c.matchST_IN_SCRIPTING,c.T_WHITESPACE;const l=["\n","\r"],_=["\n","\r",";"],u=_.concat(["\t"," ",",","]",")","/","=","!"]);var d={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 i=this.offset-1;for(;this.offset<this.size&&(this.offset++,this.is_LABEL()););const s=this._input.substring(i,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=s,this.heredoc_label.length=s.length,this.heredoc_label.finished=!1,i=this.offset-t,this.offset=t,this.consume(i),"'"===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 i=this._input[t-2];if(!l.includes(i))return!1;let s=!1,n=!1,r=0,o=this._input[t-1];if(this.version>=703){for(;"\t"===o||" "===o;)" "===o?s=!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 i=this._input[t-1+this.heredoc_label.length];if((this.version>=703?u:_).includes(i)){if(e){if(this.consume(r),s&&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=s,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}};d.T_CONSTANT_ENCAPSED_STRING,d.is_HEREDOC,d.ST_DOUBLE_QUOTES,d.isDOC_MATCH,d.prematch_ENDOFDOC,d.matchST_NOWDOC,d.matchST_HEREDOC,d.consume_VARIABLE,d.matchST_BACKQUOTE,d.matchST_DOUBLE_QUOTES;var 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(1);if('"'===t)return this.ST_DOUBLE_QUOTES();if("'"===t)return this.T_CONSTANT_ENCAPSED_STRING();t&&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(){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(),i=this.castKeywords[e];if("number"==typeof i&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return i}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(2),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):"^"}}};p.T_STRING,p.consume_TOKEN,p.tokenTerminals;var f={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))}};f.is_NUM,f.is_NUM_START,f.is_LABEL,f.is_LABEL_START,f.consume_LABEL,f.is_TOKEN,f.is_WHITESPACE,f.is_TABSPACE,f.consume_TABSPACE,f.is_HEX;const T=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=800,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,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},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}};T.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},T.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):""},T.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},T.prototype.tryMatch=function(t){return t===this.ahead(t.length)},T.prototype.tryMatchCaseless=function(t){return t===this.ahead(t.length).toLowerCase()},T.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},T.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},T.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}},T.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},T.prototype.appendToken=function(t,e){return this.tokens.push([t,e]),this},T.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},T.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},T.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},T.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 i=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(i.stack)}return t},[n,r,o,h,a,c,d,p,f].forEach((function(t){for(const e in t)T.prototype[e]=t[e]}));var k=T;var E=function(t,e,i){this.line=t,this.column=e,this.offset=i},m={read_array:function(){let t=null,e=!1;const i=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),t=")"):(e=!0,t="]");let s=[];return this.next().token!==t&&(s=this.read_array_pair_list(e)),this.expect(t),this.next(),i(e,s)},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 i=null,s=null,n=!1,r=!1;if("&"===this.token)this.next(),n=!0,s=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),"&"===this.token&&this.error(),r=!0,s=this.read_expr();else{const t=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),i=t,"&"===this.token?(this.next(),n=!0,s=this.read_variable(!0,!1)):s=this.read_expr()):s=t}return e(i,s,n,r)}};m.read_array,m.read_array_pair_list,m.read_array_pair;var x={read_class_declaration_statement:function(t){const e=this.node("class"),i=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 s=this.node("identifier");const n=this.text();this.next(),s=s(n);const r=this.read_extends_from(),o=this.read_implements_list();this.expect("{");const h=e(s,r,o,this.next().read_class_body(),i);return t&&(h.attrGroups=t),h},read_class_modifiers:function(){return[0,0,this.read_class_modifier()]},read_class_modifier:function(){return this.token===this.tok.T_ABSTRACT?(this.next(),1):this.token===this.tok.T_FINAL?(this.next(),2):0},read_class_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}if(this.token===this.tok.T_USE){t=t.concat(this.read_trait_use_statement());continue}this.token===this.tok.T_ATTRIBUTE&&(e=this.read_attr_list());const i=this.position(),s=this.read_member_flags(!1);if(this.token!==this.tok.T_CONST)if(this.token===this.tok.T_VAR&&(this.next().expect(this.tok.T_VARIABLE),s[0]=null,s[1]=0),this.token===this.tok.T_FUNCTION)t.push(this.read_function(!1,s,e,i)),e=[];else if(this.token===this.tok.T_VARIABLE||this.version>=704&&("?"===this.token||this.token===this.tok.T_CALLABLE||this.token===this.tok.T_ARRAY||this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE)){const i=this.read_variable_list(s,e);e=[],this.expect(";"),this.next(),t=t.concat(i)}else this.error([this.tok.T_CONST,this.tok.T_VARIABLE,this.tok.T_FUNCTION]),this.next();else{const i=this.read_constant_list(s,e);this.expect(";")&&this.next(),t=t.concat(i)}}return this.expect("}"),this.next(),t},read_variable_list:function(t,e){const i=this.node("propertystatement"),s=this.read_list((function(){const t=this.node("property"),[i,s]=this.read_optional_type();this.expect(this.tok.T_VARIABLE);let n=this.node("identifier");const r=this.text().substring(1);return this.next(),n=n(r),";"===this.token||","===this.token?t(n,null,i,s,e||[]):"="===this.token?t(n,this.next().read_expr(),i,s,e||[]):(this.expect([",",";","="]),t(n,null,i,s,e||[]))}),",");return i(null,s,t)},read_constant_list:function(t,e){this.expect(this.tok.T_CONST)&&this.next();const i=this.node("classconstant"),s=this.read_list((function(){const t=this.node("constant");let e=null,i=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("=")&&(i=this.next().read_expr()),t(e,i)}),",");return i(null,s,t,e||[])},read_member_flags:function(t){const e=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){let i=0,s=0;do{switch(this.token){case this.tok.T_PUBLIC:i=0,s=0;break;case this.tok.T_PROTECTED:i=0,s=1;break;case this.tok.T_PRIVATE:i=0,s=2;break;case this.tok.T_STATIC:i=1,s=1;break;case this.tok.T_ABSTRACT:i=2,s=1;break;case this.tok.T_FINAL:i=2,s=2}t&&(0==i&&2==s?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),s=-1):2==i&&1==s&&(this.error(),s=-1)),-1!==e[i]?this.error():-1!==s&&(e[i]=s)}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(){let t=!1;"?"===this.token&&(t=!0,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 i=this.node("identifier");const s=this.text();this.next(),i=i(s);const n=this.read_interface_extends_list();this.expect("{");return e(i,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 i=this.position();e=this.read_attr_list();const s=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){const i=this.read_constant_list(s,e);this.expect(";")&&this.next(),t=t.concat(i),e=[]}else if(this.token===this.tok.T_FUNCTION){const n=this.read_function_declaration(2,s,e,i);n.parseFlags(s),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 i=this.text();this.next(),e=e(i),this.expect("{");return t(e,this.next().read_class_body())},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 i=null;for(;","===this.token;)e.push(this.next().read_namespace_name());if("{"===this.token){for(i=[];this.next().token!==this.EOF&&"}"!==this.token;)i.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return t(e,i)},read_trait_use_alias:function(){const t=this.node();let e,i=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")){i=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",i,e,this.next().read_name_list());if(this.token===this.tok.T_AS){let s=null,n=null;if(this.next().is("T_MEMBER_FLAGS")&&(s=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===s&&this.expect(this.tok.T_STRING);return t("traitalias",i,e,n,s)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),t("traitalias",i,e,null,null)}};x.read_class_declaration_statement,x.read_class_modifiers,x.read_class_modifier,x.read_class_body,x.read_variable_list,x.read_constant_list,x.read_member_flags,x.read_optional_type,x.read_interface_declaration_statement,x.read_interface_body,x.read_trait_declaration_statement,x.read_trait_use_statement,x.read_trait_use_alias;var y={read_comment:function(){const t=this.text();let e=this.ast.prepare("/*"===t.substring(0,2)?"commentblock":"commentline",null,this);const i=this.lexer.yylloc.first_offset,s=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=i,this.prev=s,e},read_doc_comment:function(){let t=this.ast.prepare("commentblock",null,this);const e=this.lexer.yylloc.first_offset,i=this.text(),s=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),t=t(i),t.offset=e,this.prev=s,t}};y.read_comment,y.read_doc_comment;var A={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 i=null;return":"!==this.next().token&&(i=this.read_expr()),this.expect(":")&&this.next(),e("retif",t,i,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,i=[];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 i=this.innerList;t=this.node("list"),i||(e=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);const s=this.read_array_pair_list(!1);this.expect(")")&&this.next();let n=!1;for(let t=0;t<s.length;t++)if(null!==s[t]&&"noop"!==s[t].kind){n=!0;break}return n||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),i?t(s,!1):(this.innerList=!1,this.expect("=")?e(t(s,!1),this.next().read_expr(),"="):t(s,!1))}if(this.token===this.tok.T_ATTRIBUTE&&(i=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,i=null;return t=this.node("yield"),this.next().is("EXPR")&&(e=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(i=e,e=this.next().read_expr())),t(e,i)}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,i);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],i);this.lexer.tokens.push(t),this.next()}}if(this.is("VARIABLE")){t=this.node(),e=this.read_variable(!1,!1);const i="identifier"===e.kind||"staticlookup"===e.kind&&"identifier"===e.offset.kind;switch(this.token){case"=":return i&&this.error("VARIABLE"),"&"==this.next().token?this.read_assignref(t,e):t("assign",e,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return i&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"??=");case this.tok.T_INC:return i&&this.error("VARIABLE"),this.next(),t("post","+",e);case this.tok.T_DEC:return i&&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 i=this.convertToList(e);e.loc&&(i.loc=e.loc);return t("assign",i,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)),i=this.node("list")(e,!0);return t.loc&&(i.loc=t.loc),t.leadingComments&&(i.leadingComments=t.leadingComments),t.trailingComments&&(i.trailingComments=t.trailingComments),i},read_assignref:function(t,e){let i;return this.next(),this.token===this.tok.T_NEW?(this.version>=700&&this.error(),i=this.read_new_expr()):i=this.read_variable(!1,!1),t("assignref",e,i)},read_inline_function:function(t,e){if(this.token===this.tok.T_FUNCTION){const i=this.read_function(!0,t,e);return i.attrGroups=e,i}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");const i=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();const s=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=i(n,s,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,i=[];return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),this.expect("{")&&this.next(),i=this.read_match_arms(),this.expect("}")&&this.next(),t(e,i)},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=[];const i=this.read_attr_list();if(this.token===this.tok.T_CLASS){const s=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());const h=s(null,n,r,o,[0,0,0]);return h.attrGroups=i,t(h,e)}const s=this.read_new_class_name();return"("===this.token&&(e=this.read_argument_list()),t(s,e)},read_new_class_name:function(){if(this.token===this.tok.T_NS_SEPARATOR||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}};A.read_expr,A.read_expr_cast,A.read_isset_variable,A.read_isset_variables,A.read_internal_functions_in_yacc,A.read_optional_expr,A.read_exit_expr,A.read_expr_item,A.convertToList,A.read_assignref,A.read_inline_function,A.read_match_expression,A.read_match_arms,A.read_match_arm,A.read_match_arm_conds,A.read_attribute,A.read_attr_list,A.read_new_expr,A.read_new_class_name,A.handleDereferencable;var g={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,i,s){const n=this.read_function_declaration(t?1:e?2:0,e&&1===e[1],i||[],s);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,i,s){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();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=i||[],s&&t.loc&&(t.loc.start=s,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: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(){return")"!=this.token?this.read_list_with_dangling_comma(this.read_parameter.bind(this)):[]},read_parameter:function(){const t=this.node("parameter");let e=null,i=null,s=null,n=!1,r=[];this.token===this.tok.T_ATTRIBUTE&&(r=this.read_attr_list());const o=this.read_promoted();"?"===this.token&&(this.next(),n=!0),s=this.read_types(),n&&!s&&this.raiseError("Expecting a type definition combined with nullable operator");const h=this.is_reference(),a=this.is_variadic();if(this.expect(this.tok.T_VARIABLE)){e=this.node("identifier");const t=this.text().substring(1);this.next(),e=e(t)}"="==this.token&&(i=this.next().read_expr());const c=t(e,s,i,h,a,n,o);return r&&(c.attrGroups=r),c},read_types(){const t=[],e=this.node("uniontype");let i=this.read_type();if(!i)return null;for(t.push(i);"|"===this.token;)this.next(),i=this.read_type(),t.push(i);return 1===t.length?t[0]:e(t)},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:function(){let t=[];return this.expect("(")&&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();return e&&(t&&this.raiseError("Unexpected argument after a variadic argument"),"variadic"===e.kind&&(t=!0)),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)){const t=this.lexer.getState(),e=this.lexer.lex();if(this.lexer.setState(t),":"===e)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_STRING||this.token===this.tok.T_STATIC){const e=this.text(),i=[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(i),this.next(),t.destroy(),this.read_namespace_name())}return this.token===this.tok.T_NAMESPACE||this.token===this.tok.T_NS_SEPARATOR?(t.destroy(),this.read_namespace_name()):(t.destroy(),null)}};g.is_reference,g.is_variadic,g.read_function,g.read_function_declaration,g.read_lexical_vars,g.read_list_with_dangling_comma,g.read_lexical_var_list,g.read_lexical_var,g.read_parameter_list,g.read_parameter,g.read_types,g.read_promoted,g.read_argument_list,g.read_non_empty_argument_list,g.read_argument,g.read_type;var N={read_if:function(){const t=this.node("if"),e=this.next().read_if_expr();let i=null,s=null,n=!1;if(":"===this.token){n=!0,this.next(),i=this.node("block");const t=[];for(;this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){s=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){s=this.read_else_short();break}t.push(this.read_inner_statement())}i=i(null,t),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else i=this.read_statement(),this.token===this.tok.T_ELSEIF?s=this.read_if():this.token===this.tok.T_ELSE&&(s=this.next().read_statement());return t(e,i,s,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"),i=this.next().read_if_expr();this.expect(":")&&this.next();const s=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(i,s(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)}};N.read_if,N.read_if_expr,N.read_elseif_short,N.read_else_short;var C={read_while:function(){const t=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();let e=null,i=null,s=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(s=!0,i=this.read_short_form(this.tok.T_ENDWHILE)):i=this.read_statement(),t(e,i,s)},read_do:function(){const t=this.node("do");this.expect(this.tok.T_DO)&&this.next();let e=null,i=null;return i=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,i)},read_for:function(){const t=this.node("for");this.expect(this.tok.T_FOR)&&this.next();let e=[],i=[],s=[],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?(i=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?(r=!0,n=this.read_short_form(this.tok.T_ENDFOR)):n=this.read_statement(),t(e,i,s,n,r)},read_foreach:function(){const t=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();let e=null,i=null,s=null,n=null,r=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),s=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(i=s,s=this.next().read_foreach_variable())),i&&"list"===i.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,i,s,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 i=this.read_array_pair_list(t);return this.expect(t?"]":")")&&this.next(),e(i,t)}return this.read_variable(!1,!1)}};C.read_while,C.read_do,C.read_for,C.read_foreach,C.read_foreach_variable;var S={read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}};S.read_start;var L={read_namespace:function(){const t=this.node("namespace");let e,i;return this.expect(this.tok.T_NAMESPACE)&&this.next(),i="{"==this.token?{name:[""]}:this.read_namespace_name(),this.currentNamespace=i,";"==this.token?(this.currentNamespace=i,e=this.next().read_top_statements(),this.expect(this.EOF),t(i.name,e,!1)):"{"==this.token?(this.currentNamespace=i,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(i.name,e,!0)):"("===this.token?(i.resolution=this.ast.reference.RELATIVE_NAME,i.name=i.name.substring(1),t.destroy(),this.node("call")(i,this.read_argument_list())):(this.error(["{",";"]),this.currentNamespace=i,e=this.read_top_statements(),this.expect(this.EOF),t(i,e,!1))},read_namespace_name:function(t){const e=this.node();let i=!1;this.token===this.tok.T_NAMESPACE&&(this.next().expect(this.tok.T_NS_SEPARATOR)&&this.next(),i=!0);const s=this.read_list(this.tok.T_STRING,this.tok.T_NS_SEPARATOR,!0);if(!i&&1===s.length&&(t||"("!==this.token)){if("parent"===s[0].toLowerCase())return e("parentreference",s[0]);if("self"===s[0].toLowerCase())return e("selfreference",s[0])}return e("name",s,i)},read_use_statement:function(){let t=this.node("usegroup"),e=[],i=null;this.expect(this.tok.T_USE)&&this.next();const s=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&&(i=e[0].name,e=this.next().read_use_declarations(null===s),this.expect("}")&&this.next()),t=t(i,s,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 i=null;t&&(i=this.read_use_type());const s=this.read_namespace_name(),n=this.read_use_alias();return e(s.name,n,i)},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_FUNCTION&&this.token!==this.tok.T_CONST&&this.token!==this.tok.T_STRING)break}else if(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"),i=this.text();this.next(),t=e(i)}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}};L.read_namespace,L.read_namespace_name,L.read_use_statement,L.read_class_name_reference,L.read_use_declaration,L.read_use_declarations,L.read_use_alias,L.read_use_type;const O={"\\":"\\",$:"$",n:"\n",r:"\r",t:"\t",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)};var I={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,i)=>O[e]?O[e]:"x"===e[0]||"X"===e[0]?String.fromCodePoint(parseInt(e.substr(1),16)):"u"===e[0]?String.fromCodePoint(parseInt(i,16)):String.fromCodePoint(parseInt(e,8))):t.replace(/\\\\/g,"\\").replace(/\\'/g,"'")},remove_heredoc_leading_whitespace_chars:function(t,e,i,s){if(0===e)return t;this.check_heredoc_indentation_level(t,e,i,s);const n=i?" ":"\t",r=new RegExp("\\n".concat(n,"{").concat(e,"}"),"g"),o=new RegExp("^".concat(n,"{").concat(e,"}"));return s&&(t=t.replace(o,"")),t.replace(r,"\n")},check_heredoc_indentation_level:function(t,e,i,s){const n=t.length;let r=0,o=0,h=!0;const a=i?" ":"\t";let c=!1;if(!s){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 i=this.text();let s=0;"b"!==i[0]&&"B"!==i[0]||(s=1);const n='"'===i[s];this.next();e=e(n,this.resolve_special_chars(i.substring(s+1,i.length-1),n),1===s,i),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 i=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 s=t[t.length-1];"\n"===s?t="\r"===t[t.length-2]?t.substring(0,t.length-2):t.substring(0,t.length-1):"\r"===s&&(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(i,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),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,i;const s=this.node("offsetlookup");return"["===this.token?(i=this.next().read_expr(),this.expect("]")&&this.next(),e=s(t,i)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(i=this.read_encapsed_string_item(!1),e=s(t,i)),e},read_encapsed_string_item:function(t){const e=this.node("encapsedpart");let i,s,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(),"["===this.token?(n=n(t,!1),s=this.node("offsetlookup"),i=this.next().read_expr(),this.expect("]")&&this.next(),h=s(n,i)):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&&(s=this.node("offsetlookup"),i=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),h=s(h,i)),this.token===this.tok.T_OBJECT_OPERATOR){s=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);const t=this.node("identifier");n=this.text(),this.next(),h=s(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 i=this.lexer.yylloc.first_offset;let s=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();const h=this.lexer._input.substring("heredoc"===o?i:n-1,this.lexer.yylloc.first_offset);return s=s(r,h,o),t===this.tok.T_END_HEREDOC&&(s.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),s},get_magic_constant:function(){const t=this.node("magic"),e=this.text();return this.next(),t(e.toUpperCase(),e)}};I.resolve_special_chars,I.remove_heredoc_leading_whitespace_chars,I.check_heredoc_indentation_level,I.read_dereferencable_scalar,I.read_scalar,I.read_dereferencable,I.read_encapsed_string_item,I.read_encapsed_string,I.get_magic_constant;var b={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_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_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 i=this.text();return this.next(),e=e(i),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 i=this.node("identifier");const s=this.text();this.next(),i=i(s);let n=null;if(this.expect("=")&&(n=this.next().read_expr()),t.push(e(i,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_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 i=this.next().read_expr();return this.expectEndOfStatement(i),e("expressionstatement",i)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);const i=this.read_variable_declarations();return this.expectEndOfStatement(),e("static",i)}case this.tok.T_ECHO:{const t=this.node("echo"),e=this.text(),i="<?="===e||"<%="===e,s=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),t(s,i)}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 i="\r"===e||"\n"===e;i&&"\n"===e&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(e="\r\n");const s=this.node("inline");return this.next(),s(t,i?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 i;this.next().expect("(")&&this.next();const s=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(),i=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(),i=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),i=this.ast.declare.MODE_NONE;return t(s,e,i)}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()],i=this.text();let s=this.node("identifier");if(":"===this.next().token)return s=s(i),this.next(),t("label",s);s.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 i=t?this.read_top_statements():this.read_inner_statements();return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect("}")&&this.next(),e(null,i)}};b.read_top_statements,b.read_top_statement,b.read_inner_statements,b.read_const_list,b.read_declare_list,b.read_inner_statement,b.read_statement,b.read_code_block;var R={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 i=":"===this.token;return t(e,this.read_switch_case_list(),i)},read_switch_case_list:function(){let t=null;const e=this.node("block"),i=[];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;)i.push(this.read_case_list(t));return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect(t)&&this.next(),t===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),e(null,i)},read_case_list:function(t){const e=this.node("case");let i=null;this.token===this.tok.T_CASE?i=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 s=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(i,s(null,n))}};R.read_switch,R.read_switch_case_list,R.read_case_list;var v={read_try:function(){this.expect(this.tok.T_TRY);const t=this.node("try");let e=null;const i=[],s=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 s=null;(this.version<800||this.token===this.tok.T_VARIABLE)&&(s=this.read_variable(!0,!1)),this.expect(")"),i.push(t(this.next().read_statement(),e,s))}return this.token===this.tok.T_FINALLY&&(e=this.next().read_statement()),t(s,i,e)}};v.read_try;var w={read_short_form:function(t){const e=this.node("block"),i=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==t;)i.push(this.read_inner_statement());return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect(t)&&this.next(),this.expectEndOfStatement(),e(null,i)},read_function_list:function(t,e){const i=[];do{if(this.token==e&&this.version>=703&&i.length>0){i.push(this.node("noop")());break}if(i.push(t.apply(this,[])),this.token!=e)break;if(")"==this.next().token&&this.version>=703)break}while(this.token!=this.EOF);return i},read_list:function(t,e,i){const s=[];if(this.token==e&&(i&&s.push("function"==typeof t?this.node("noop")():null),this.next()),"function"==typeof t)do{const i=t.apply(this,[]);if(i&&s.push(i),this.token!=e)break}while(this.next().token!=this.EOF);else{if(!this.expect(t))return[];for(s.push(this.text());this.next().token!=this.EOF&&this.token==e&&this.next().token==t;)s.push(this.text())}return s},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 i=t();return i&&(this.ast.swapLocations(i,e,i,this),i.byref=!0),i},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}};w.read_short_form,w.read_function_list,w.read_list,w.read_name_list,w.read_byref,w.read_variable_declarations,w.read_extends_from,w.read_interface_extends_list,w.read_implements_list;var D={read_variable:function(t,e){let i;if("&"===this.token)return this.read_byref(this.read_variable.bind(this,t,e));if(this.is([this.tok.T_VARIABLE,"$"]))i=this.read_reference_variable(e);else if(this.is([this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAMESPACE])){i=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?i=t.destroy(i("boolean",!0,t.name)):"false"===e?i=t.destroy(i("boolean",!1,t.name)):"null"===e?i=t.destroy(i("nullkeyword",t.name)):(i.destroy(t),i=t)}else i.destroy(t),i=t}else if(this.token===this.tok.T_STATIC){i=this.node("staticreference");const t=this.text();this.next(),i=i(t)}else this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(i=this.read_static_getter(i,e)),this.recursive_variable_chain_scan(i,t,e)},read_static_getter:function(t,e){const i=this.node("staticlookup");let s,n;return this.next().is([this.tok.T_VARIABLE,"$"])?s=this.read_reference_variable(e):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(s=this.node("identifier"),n=this.text(),this.next(),s=s(n)):"{"===this.token?(s=this.node("literal"),n=this.next().read_expr(),this.expect("}")&&this.next(),s=s("literal",n,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),s=this.node("identifier"),n=this.text(),this.next(),s=s(n)),i(t,s)},read_what:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=null,i=null;switch(this.next().token){case this.tok.T_STRING:e=this.node("identifier"),i=this.text(),this.next(),e=e(i),t&&this.token===this.tok.T_OBJECT_OPERATOR&&this.error();break;case this.tok.T_VARIABLE:e=this.node("variable"),i=this.text().substring(1),this.next(),e=e(i,!1);break;case"$":e=this.node(),this.next().expect(["$","{",this.tok.T_VARIABLE]),"{"===this.token?(i=this.next().read_expr(),this.expect("}")&&this.next(),e=e("variable",i,!0)):(i=this.read_expr(),e=e("variable",i,!1));break;case"{":e=this.node("encapsedpart"),i=this.next().read_expr(),this.expect("}")&&this.next(),e=e(i,"complex",!1);break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE,"$","{"]),e=this.node("identifier"),i=this.text(),this.next(),e=e(i)}return e},recursive_variable_chain_scan:function(t,e,i){let s,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(s=this.node("offsetlookup"),this.next(),n=!1,i)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=s(t,n);break}case this.tok.T_DOUBLE_COLON:"staticlookup"===t.kind&&"identifier"===t.offset.kind&&this.error(),s=this.node("staticlookup"),t=s(t,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:s=this.node("propertylookup"),t=s(t,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:s=this.node("nullsafepropertylookup"),t=s(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,i=this.read_simple_variable();for(;this.token!=this.EOF;){const s=this.node();if("{"!=this.token||t){s.destroy();break}e=this.next().read_expr(),this.expect("}")&&this.next(),i=s("offsetlookup",i,e)}return i},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 i=this.node("variable");this.next(),e=e(i(t,!1),!1);break}default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),e=e(t,!1)}return e}};function P(t){return"."!=t&&","!=t&&!isNaN(parseFloat(t))&&isFinite(t)}D.read_variable,D.read_static_getter,D.read_what,D.recursive_variable_chain_scan,D.read_encaps_var_offset,D.read_reference_variable,D.read_simple_variable;const U=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=800,this.extractDoc=!1,this.extractTokens=!1,this.suppressErrors=!1;const i=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_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_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(i)),VARIABLE:new Map([this.tok.T_VARIABLE,"$","&",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAMESPACE,this.tok.T_STATIC].map(i)),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(i)),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(i)),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(i)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(i)),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_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(i))}};U.prototype.getTokenName=function(t){return P(t)?t==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[t]:"'"+t+"'"},U.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 i=this.node("program"),s=[];for(this.next();this.token!=this.EOF;)s.push(this.read_start());0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];const n=i(s,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},U.prototype.raiseError=function(t,e,i,s){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,s,this.lexer.yylloc.first_line,i);return this._errors.push(n),n},U.prototype.error=function(t){let e="Parse Error : syntax error",i=this.getTokenName(this.token),s="";if(this.token!==this.EOF){if(P(this.token)){let t=this.text();t.length>10&&(t=t.substring(0,7)+"..."),i="'"+t+"' ("+i+")"}e+=", unexpected "+i}return t&&!Array.isArray(t)&&((P(t)||1===t.length)&&(s=", expecting "+this.getTokenName(t)),e+=s),this.raiseError(e,s,t,i)},U.prototype.position=function(){return new E(this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.yylloc.first_offset)},U.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 i=this.ast.prepare(t,e,this);return i.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),i}return this.ast.prepare(t,null,this)},U.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"];U.prototype.showlog=function(){const t=(new Error).stack.split("\n");let e;for(let i=2;i<t.length;i++){e=t[i].trim();let s=!1;for(let t=0;t<B.length;t++)if(e.substring(3,3+B[t].length)===B[t]){s=!0;break}if(!s)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @--\x3e"+e),this},U.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},U.prototype.text=function(){return this.lexer.yytext},U.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},U.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},U.prototype.is=function(t){return Array.isArray(t)?-1!==t.indexOf(this.token):this.entries[t].has(this.token)},[m,x,y,A,g,N,C,S,L,I,b,R,v,w,D].forEach((function(t){for(const e in t){if(Object.prototype.hasOwnProperty.call(U.prototype,e))throw new Error("Function "+e+" is already defined - collision");U.prototype[e]=t[e]}}));var M=U;var F=Object.freeze({values:{101:"T_HALT_COMPILER",102:"T_USE",103:"T_ENCAPSED_AND_WHITESPACE",104:"T_OBJECT_OPERATOR",105:"T_STRING",106:"T_DOLLAR_OPEN_CURLY_BRACES",107:"T_STRING_VARNAME",108:"T_CURLY_OPEN",109:"T_NUM_STRING",110:"T_ISSET",111:"T_EMPTY",112:"T_INCLUDE",113:"T_INCLUDE_ONCE",114:"T_EVAL",115:"T_REQUIRE",116:"T_REQUIRE_ONCE",117:"T_NAMESPACE",118:"T_NS_SEPARATOR",119:"T_AS",120:"T_IF",121:"T_ENDIF",122:"T_WHILE",123:"T_DO",124:"T_FOR",125:"T_SWITCH",126:"T_BREAK",127:"T_CONTINUE",128:"T_RETURN",129:"T_GLOBAL",130:"T_STATIC",131:"T_ECHO",132:"T_INLINE_HTML",133:"T_UNSET",134:"T_FOREACH",135:"T_DECLARE",136:"T_TRY",137:"T_THROW",138:"T_GOTO",139:"T_FINALLY",140:"T_CATCH",141:"T_ENDDECLARE",142:"T_LIST",143:"T_CLONE",144:"T_PLUS_EQUAL",145:"T_MINUS_EQUAL",146:"T_MUL_EQUAL",147:"T_DIV_EQUAL",148:"T_CONCAT_EQUAL",149:"T_MOD_EQUAL",150:"T_AND_EQUAL",151:"T_OR_EQUAL",152:"T_XOR_EQUAL",153:"T_SL_EQUAL",154:"T_SR_EQUAL",155:"T_INC",156:"T_DEC",157:"T_BOOLEAN_OR",158:"T_BOOLEAN_AND",159:"T_LOGICAL_OR",160:"T_LOGICAL_AND",161:"T_LOGICAL_XOR",162:"T_SL",163:"T_SR",164:"T_IS_IDENTICAL",165:"T_IS_NOT_IDENTICAL",166:"T_IS_EQUAL",167:"T_IS_NOT_EQUAL",168:"T_IS_SMALLER_OR_EQUAL",169:"T_IS_GREATER_OR_EQUAL",170:"T_INSTANCEOF",171:"T_INT_CAST",172:"T_DOUBLE_CAST",173:"T_STRING_CAST",174:"T_ARRAY_CAST",175:"T_OBJECT_CAST",176:"T_BOOL_CAST",177:"T_UNSET_CAST",178:"T_EXIT",179:"T_PRINT",180:"T_YIELD",181:"T_YIELD_FROM",182:"T_FUNCTION",183:"T_DOUBLE_ARROW",184:"T_DOUBLE_COLON",185:"T_ARRAY",186:"T_CALLABLE",187:"T_CLASS",188:"T_ABSTRACT",189:"T_TRAIT",190:"T_FINAL",191:"T_EXTENDS",192:"T_INTERFACE",193:"T_IMPLEMENTS",194:"T_VAR",195:"T_PUBLIC",196:"T_PROTECTED",197:"T_PRIVATE",198:"T_CONST",199:"T_NEW",200:"T_INSTEADOF",201:"T_ELSEIF",202:"T_ELSE",203:"T_ENDSWITCH",204:"T_CASE",205:"T_DEFAULT",206:"T_ENDFOR",207:"T_ENDFOREACH",208:"T_ENDWHILE",209:"T_CONSTANT_ENCAPSED_STRING",210:"T_LNUMBER",211:"T_DNUMBER",212:"T_LINE",213:"T_FILE",214:"T_DIR",215:"T_TRAIT_C",216:"T_METHOD_C",217:"T_FUNC_C",218:"T_NS_C",219:"T_START_HEREDOC",220:"T_END_HEREDOC",221:"T_CLASS_C",222:"T_VARIABLE",223:"T_OPEN_TAG",224:"T_OPEN_TAG_WITH_ECHO",225:"T_CLOSE_TAG",226:"T_WHITESPACE",227:"T_COMMENT",228:"T_DOC_COMMENT",229:"T_ELLIPSIS",230:"T_COALESCE",231:"T_POW",232:"T_POW_EQUAL",233:"T_SPACESHIP",234:"T_COALESCE_EQUAL",235:"T_FN",236:"T_NULLSAFE_OBJECT_OPERATOR",237:"T_MATCH",238:"T_ATTRIBUTE"},names:{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}});var H=function(t,e,i){this.source=t,this.start=e,this.end=i};const G=function(t,e,i){this.kind=t,e&&(this.leadingComments=e),i&&(this.loc=i)};G.prototype.setTrailingComments=function(t){this.trailingComments=t},G.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},G.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},G.extends=function(t,e){return e.prototype=Object.create(this.prototype),e.extends=this.extends,e.prototype.constructor=e,e.kind=t,e};var V=G;const W="expression";var Q=V.extends(W,(function(t,e,i){V.apply(this,[t||W,e,i])}));const Y="array";var j=Q.extends(Y,(function(t,e,i,s){Q.apply(this,[Y,i,s]),this.items=e,this.shortForm=t}));const $="arrowfunc";var z=Q.extends($,(function(t,e,i,s,n,r,o,h){Q.apply(this,[$,o,h]),this.arguments=t,this.byref=e,this.body=i,this.type=s,this.nullable=n,this.isStatic=r||!1}));const K="assign";var X=Q.extends(K,(function(t,e,i,s,n){Q.apply(this,[K,s,n]),this.left=t,this.right=e,this.operator=i}));const J="assignref";var q=Q.extends(J,(function(t,e,i,s){Q.apply(this,[J,i,s]),this.left=t,this.right=e}));const Z="attribute";var tt=V.extends(Z,(function(t,e,i,s){V.apply(this,[Z,i,s]),this.name=t,this.args=e}));const et="attrgroup";var it=V.extends(et,(function(t,e,i){V.apply(this,[et,e,i]),this.attrs=t||[]}));const st="operation";var nt=Q.extends(st,(function(t,e,i){Q.apply(this,[t||st,e,i])}));var rt=nt.extends("bin",(function(t,e,i,s,n){nt.apply(this,["bin",s,n]),this.type=t,this.left=e,this.right=i}));const ot="statement";var ht=V.extends(ot,(function(t,e,i){V.apply(this,[t||ot,e,i])}));const at="block";var ct=ht.extends(at,(function(t,e,i,s){ht.apply(this,[t||at,i,s]),this.children=e.filter(Boolean)}));const lt="literal";var _t=Q.extends(lt,(function(t,e,i,s,n){Q.apply(this,[t||lt,s,n]),this.value=e,i&&(this.raw=i)}));const ut="boolean";var dt=_t.extends(ut,(function(t,e,i,s){_t.apply(this,[ut,t,e,i,s])}));const pt="break";var ft=ht.extends(pt,(function(t,e,i){ht.apply(this,[pt,e,i]),this.level=t}));const Tt="byref";var kt=Q.extends(Tt,(function(t,e,i){Q.apply(this,[Tt,e,i]),this.what=t}));const Et="call";var mt=Q.extends(Et,(function(t,e,i,s){Q.apply(this,[Et,i,s]),this.what=t,this.arguments=e}));const xt="case";var yt=ht.extends(xt,(function(t,e,i,s){ht.apply(this,[xt,i,s]),this.test=t,this.body=e}));const At="cast";var gt=nt.extends(At,(function(t,e,i,s,n){nt.apply(this,[At,s,n]),this.type=t,this.raw=e,this.expr=i}));const Nt="catch";var Ct=ht.extends(Nt,(function(t,e,i,s,n){ht.apply(this,[Nt,s,n]),this.body=t,this.what=e,this.variable=i}));const St="declaration",Lt=ht.extends(St,(function(t,e,i,s){ht.apply(this,[t||St,i,s]),this.name=e}));Lt.prototype.parseFlags=function(t){this.isAbstract=1===t[2],this.isFinal=2===t[2],"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 Ot=Lt;const It="class";var bt=Ot.extends(It,(function(t,e,i,s,n,r,o){Ot.apply(this,[It,t,r,o]),this.isAnonymous=!t,this.extends=e,this.implements=i,this.body=s,this.attrGroups=[],this.parseFlags(n)}));const Rt="constantstatement";var vt=ht.extends(Rt,(function(t,e,i,s){ht.apply(this,[t||Rt,i,s]),this.constants=e}));const wt="classconstant",Dt=vt.extends(wt,(function(t,e,i,s,n,r){vt.apply(this,[t||wt,e,n,r]),this.parseFlags(i),this.attrGroups=s}));Dt.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")};var Pt=Dt;const Ut="clone";var Bt=Q.extends(Ut,(function(t,e,i){Q.apply(this,[Ut,e,i]),this.what=t}));const Mt="closure";var Ft=Q.extends(Mt,(function(t,e,i,s,n,r,o,h){Q.apply(this,[Mt,o,h]),this.uses=i,this.arguments=t,this.byref=e,this.type=s,this.nullable=n,this.isStatic=r||!1,this.body=null,this.attrGroups=[]})),Ht=V.extends("comment",(function(t,e,i,s){V.apply(this,[t,i,s]),this.value=e}));const Gt="commentblock";var Vt=Ht.extends(Gt,(function(t,e,i){Ht.apply(this,[Gt,t,e,i])}));const Wt="commentline";var Qt=Ht.extends(Wt,(function(t,e,i){Ht.apply(this,[Wt,t,e,i])}));const Yt="constant";var jt=V.extends(Yt,(function(t,e,i,s){V.apply(this,[Yt,i,s]),this.name=t,this.value=e}));const $t="continue";var zt=ht.extends($t,(function(t,e,i){ht.apply(this,[$t,e,i]),this.level=t}));const Kt="declare",Xt=ct.extends(Kt,(function(t,e,i,s,n){ct.apply(this,[Kt,e,s,n]),this.directives=t,this.mode=i}));Xt.MODE_SHORT="short",Xt.MODE_BLOCK="block",Xt.MODE_NONE="none";var Jt=Xt;const qt="declaredirective";var Zt=V.extends(qt,(function(t,e,i,s){V.apply(this,[qt,i,s]),this.key=t,this.value=e}));var te=ht.extends("do",(function(t,e,i,s){ht.apply(this,["do",i,s]),this.test=t,this.body=e}));const ee="echo";var ie=ht.extends(ee,(function(t,e,i,s){ht.apply(this,[ee,i,s]),this.shortForm=e,this.expressions=t}));const se="empty";var ne=Q.extends(se,(function(t,e,i){Q.apply(this,[se,e,i]),this.expression=t}));const re="encapsed",oe=_t.extends(re,(function(t,e,i,s,n){_t.apply(this,[re,t,e,s,n]),this.type=i}));oe.TYPE_STRING="string",oe.TYPE_SHELL="shell",oe.TYPE_HEREDOC="heredoc",oe.TYPE_OFFSET="offset";var he=oe;const ae="encapsedpart";var ce=Q.extends(ae,(function(t,e,i,s,n){Q.apply(this,[ae,s,n]),this.expression=t,this.syntax=e,this.curly=i}));const le="entry";var _e=Q.extends(le,(function(t,e,i,s,n,r){Q.apply(this,[le,n,r]),this.key=t,this.value=e,this.byRef=i,this.unpack=s}));const ue="error";var de=V.extends(ue,(function(t,e,i,s,n,r){V.apply(this,[ue,n,r]),this.message=t,this.token=e,this.line=i,this.expected=s}));const pe="eval";var fe=Q.extends(pe,(function(t,e,i){Q.apply(this,[pe,e,i]),this.source=t}));const Te="exit";var ke=Q.extends(Te,(function(t,e,i,s){Q.apply(this,[Te,i,s]),this.expression=t,this.useDie=e}));const Ee="expressionstatement";var me=ht.extends(Ee,(function(t,e,i){ht.apply(this,[Ee,e,i]),this.expression=t}));var xe=ht.extends("for",(function(t,e,i,s,n,r,o){ht.apply(this,["for",r,o]),this.init=t,this.test=e,this.increment=i,this.shortForm=n,this.body=s}));const ye="foreach";var Ae=ht.extends(ye,(function(t,e,i,s,n,r,o){ht.apply(this,[ye,r,o]),this.source=t,this.key=e,this.value=i,this.shortForm=n,this.body=s}));const ge="function";var Ne=Ot.extends(ge,(function(t,e,i,s,n,r,o){Ot.apply(this,[ge,t,r,o]),this.arguments=e,this.byref=i,this.type=s,this.nullable=n,this.body=null,this.attrGroups=[]}));const Ce="global";var Se=ht.extends(Ce,(function(t,e,i){ht.apply(this,[Ce,e,i]),this.items=t}));const Le="goto";var Oe=ht.extends(Le,(function(t,e,i){ht.apply(this,[Le,e,i]),this.label=t}));const Ie="halt";var be=ht.extends(Ie,(function(t,e,i){ht.apply(this,[Ie,e,i]),this.after=t}));const Re="identifier";var ve=V.extends(Re,(function(t,e,i){V.apply(this,[Re,e,i]),this.name=t}));var we=ht.extends("if",(function(t,e,i,s,n,r){ht.apply(this,["if",n,r]),this.test=t,this.body=e,this.alternate=i,this.shortForm=s}));const De="include";var Pe=Q.extends(De,(function(t,e,i,s,n){Q.apply(this,[De,s,n]),this.once=t,this.require=e,this.target=i}));const Ue="inline";var Be=_t.extends(Ue,(function(t,e,i,s){_t.apply(this,[Ue,t,e,i,s])}));const Me="interface";var Fe=Ot.extends(Me,(function(t,e,i,s,n,r){Ot.apply(this,[Me,t,n,r]),this.extends=e,this.body=i,this.attrGroups=s}));const He="isset";var Ge=Q.extends(He,(function(t,e,i){Q.apply(this,[He,e,i]),this.variables=t}));const Ve="label";var We=ht.extends(Ve,(function(t,e,i){ht.apply(this,[Ve,e,i]),this.name=t}));const Qe="list";var Ye=Q.extends(Qe,(function(t,e,i,s){Q.apply(this,[Qe,i,s]),this.items=t,this.shortForm=e}));const je="lookup";var $e=Q.extends(je,(function(t,e,i,s,n){Q.apply(this,[t||je,s,n]),this.what=e,this.offset=i}));const ze="magic";var Ke=_t.extends(ze,(function(t,e,i,s){_t.apply(this,[ze,t,e,i,s])}));const Xe="match";var Je=Q.extends(Xe,(function(t,e,i,s){Q.apply(this,[Xe,i,s]),this.cond=t,this.arms=e}));const qe="matcharm";var Ze=Q.extends(qe,(function(t,e,i,s){Q.apply(this,[qe,i,s]),this.conds=t,this.body=e}));const ti="method";var ei=Ne.extends(ti,(function(){Ne.apply(this,arguments),this.kind=ti}));const ii="reference";var si=V.extends(ii,(function(t,e,i){V.apply(this,[t||ii,e,i])}));const ni="name",ri=si.extends(ni,(function t(e,i,s,n){si.apply(this,[ni,s,n]),i?this.resolution=t.RELATIVE_NAME:1===e.length?this.resolution=t.UNQUALIFIED_NAME:e[0]?this.resolution=t.QUALIFIED_NAME:this.resolution=t.FULL_QUALIFIED_NAME,this.name=e.join("\\")}));ri.UNQUALIFIED_NAME="uqn",ri.QUALIFIED_NAME="qn",ri.FULL_QUALIFIED_NAME="fqn",ri.RELATIVE_NAME="rn";var oi=ri;const hi="namespace";var ai=ct.extends(hi,(function(t,e,i,s,n){ct.apply(this,[hi,e,s,n]),this.name=t,this.withBrackets=i||!1}));const ci="namedargument";var li=Q.extends(ci,(function(t,e,i,s){Q.apply(this,[ci,i,s]),this.name=t,this.value=e}));var _i=Q.extends("new",(function(t,e,i,s){Q.apply(this,["new",i,s]),this.what=t,this.arguments=e}));const ui="noop";var di=V.extends(ui,(function(t,e){V.apply(this,[ui,t,e])}));const pi="nowdoc";var fi=_t.extends(pi,(function(t,e,i,s,n){_t.apply(this,[pi,t,e,s,n]),this.label=i}));const Ti="nullkeyword";var ki=V.extends(Ti,(function(t,e,i){V.apply(this,[Ti,e,i]),this.raw=t}));const Ei="nullsafepropertylookup";var mi=$e.extends(Ei,(function(t,e,i,s){$e.apply(this,[Ei,t,e,i,s])}));const xi="number";var yi=_t.extends(xi,(function(t,e,i,s){_t.apply(this,[xi,t,e,i,s])}));const Ai="offsetlookup";var gi=$e.extends(Ai,(function(t,e,i,s){$e.apply(this,[Ai,t,e,i,s])}));const Ni="parameter";var Ci=Ot.extends(Ni,(function(t,e,i,s,n,r,o,h,a){Ot.apply(this,[Ni,t,h,a]),this.value=i,this.type=e,this.byref=s,this.variadic=n,this.nullable=r,this.flags=o||0,this.attrGroups=[]}));const Si="parentreference";var Li=si.extends(Si,(function(t,e,i){si.apply(this,[Si,e,i]),this.raw=t}));const Oi="post";var Ii=nt.extends(Oi,(function(t,e,i,s){nt.apply(this,[Oi,i,s]),this.type=t,this.what=e}));var bi=nt.extends("pre",(function(t,e,i,s){nt.apply(this,["pre",i,s]),this.type=t,this.what=e}));const Ri="print";var vi=Q.extends(Ri,(function(t,e,i){Q.apply(this,[Ri,e,i]),this.expression=t}));const wi="program";var Di=ct.extends(wi,(function(t,e,i,s,n,r){ct.apply(this,[wi,t,n,r]),this.errors=e,i&&(this.comments=i),s&&(this.tokens=s)}));const Pi="property";var Ui=ht.extends(Pi,(function(t,e,i,s,n,r,o){ht.apply(this,[Pi,r,o]),this.name=t,this.value=e,this.nullable=i,this.type=s,this.attrGroups=n}));const Bi="propertylookup";var Mi=$e.extends(Bi,(function(t,e,i,s){$e.apply(this,[Bi,t,e,i,s])}));const Fi="propertystatement",Hi=ht.extends(Fi,(function(t,e,i,s,n){ht.apply(this,[Fi,s,n]),this.properties=e,this.parseFlags(i)}));Hi.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 Gi=Hi;const Vi="retif";var Wi=Q.extends(Vi,(function(t,e,i,s,n){Q.apply(this,[Vi,s,n]),this.test=t,this.trueExpr=e,this.falseExpr=i}));const Qi="return";var Yi=ht.extends(Qi,(function(t,e,i){ht.apply(this,[Qi,e,i]),this.expr=t}));const ji="selfreference";var $i=si.extends(ji,(function(t,e,i){si.apply(this,[ji,e,i]),this.raw=t}));const zi="silent";var Ki=Q.extends(zi,(function(t,e,i){Q.apply(this,[zi,e,i]),this.expr=t}));const Xi="static";var Ji=ht.extends(Xi,(function(t,e,i){ht.apply(this,[Xi,e,i]),this.variables=t}));const qi="staticvariable";var Zi=V.extends(qi,(function(t,e,i,s){V.apply(this,[qi,i,s]),this.variable=t,this.defaultValue=e}));const ts="staticlookup";var es=$e.extends(ts,(function(t,e,i,s){$e.apply(this,[ts,t,e,i,s])}));const is="staticreference";var ss=si.extends(is,(function(t,e,i){si.apply(this,[is,e,i]),this.raw=t}));const ns="string";var rs=_t.extends(ns,(function(t,e,i,s,n,r){_t.apply(this,[ns,e,s,n,r]),this.unicode=i,this.isDoubleQuote=t}));const os="switch";var hs=ht.extends(os,(function(t,e,i,s,n){ht.apply(this,[os,s,n]),this.test=t,this.body=e,this.shortForm=i}));const as="throw";var cs=ht.extends(as,(function(t,e,i){ht.apply(this,[as,e,i]),this.what=t}));const ls="trait";var _s=Ot.extends(ls,(function(t,e,i,s){Ot.apply(this,[ls,t,i,s]),this.body=e}));const us="traitalias";var ds=V.extends(us,(function(t,e,i,s,n,r){V.apply(this,[us,n,r]),this.trait=t,this.method=e,this.as=i,this.visibility="",s&&(0===s[0]?this.visibility="public":1===s[0]?this.visibility="protected":2===s[0]&&(this.visibility="private"))}));const ps="traitprecedence";var fs=V.extends(ps,(function(t,e,i,s,n){V.apply(this,[ps,s,n]),this.trait=t,this.method=e,this.instead=i}));const Ts="traituse";var ks=V.extends(Ts,(function(t,e,i,s){V.apply(this,[Ts,i,s]),this.traits=t,this.adaptations=e}));var Es=ht.extends("try",(function(t,e,i,s,n){ht.apply(this,["try",s,n]),this.body=t,this.catches=e,this.always=i}));const ms="typereference",xs=si.extends(ms,(function(t,e,i,s){si.apply(this,[ms,i,s]),this.name=t,this.raw=e}));xs.types=["int","float","string","bool","object","array","callable","iterable","void","static"];var ys=xs;const As="unary";var gs=nt.extends(As,(function(t,e,i,s){nt.apply(this,[As,i,s]),this.type=t,this.what=e}));const Ns="uniontype";var Cs=Ot.extends(Ns,(function(t,e,i){Ot.apply(this,[Ns,null,e,i]),this.types=t}));const Ss="unset";var Ls=ht.extends(Ss,(function(t,e,i){ht.apply(this,[Ss,e,i]),this.variables=t}));const Os="usegroup";var Is=ht.extends(Os,(function(t,e,i,s,n){ht.apply(this,[Os,s,n]),this.name=t,this.type=e,this.items=i}));const bs="useitem",Rs=ht.extends(bs,(function(t,e,i,s,n){ht.apply(this,[bs,s,n]),this.name=t,this.alias=e,this.type=i}));Rs.TYPE_CONST="const",Rs.TYPE_FUNCTION="function";var vs=Rs;const ws="variable";var Ds=Q.extends(ws,(function(t,e,i,s){Q.apply(this,[ws,i,s]),this.name=t,this.curly=e||!1}));const Ps="variadic";var Us=Q.extends(Ps,(function(t,e,i){Q.apply(this,[Ps,e,i]),this.what=t}));const Bs="while";var Ms=ht.extends(Bs,(function(t,e,i,s,n){ht.apply(this,[Bs,s,n]),this.test=t,this.body=e,this.shortForm=i}));const Fs="yield";var Hs=Q.extends(Fs,(function(t,e,i,s){Q.apply(this,[Fs,i,s]),this.value=t,this.key=e}));const Gs="yieldfrom";var Vs=Q.extends(Gs,(function(t,e,i){Q.apply(this,[Gs,e,i]),this.value=t}));const Ws=function(t,e){this.withPositions=t,this.withSource=e};Ws.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach((function(t,e){t.forEach((function(t){Ws.precedence[t]=e+1}))})),Ws.prototype.isRightAssociative=function(t){return"**"===t||"??"===t},Ws.prototype.swapLocations=function(t,e,i,s){this.withPositions&&(t.loc.start=e.loc.start,t.loc.end=i.loc.end,this.withSource&&(t.loc.source=s.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},Ws.prototype.resolveLocations=function(t,e,i,s){this.withPositions&&(t.loc.start.offset>e.loc.start.offset&&(t.loc.start=e.loc.start),t.loc.end.offset<i.loc.end.offset&&(t.loc.end=i.loc.end),this.withSource&&(t.loc.source=s.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},Ws.prototype.resolvePrecedence=function(t,e){let i,s,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?(s=Ws.precedence[t.type],n=Ws.precedence[t.right.type],s&&n&&n<=s&&(t.type!==t.right.type||!this.isRightAssociative(t.type))&&(i=t.right,t.right=t.right.left,this.swapLocations(t,t.left,t.right,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i)):"retif"===t.right.kind&&(s=Ws.precedence[t.type],n=Ws.precedence["?"],s&&n&&n<=s&&(i=t.right,t.right=t.right.test,this.swapLocations(t,t.left,t.right,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i))):"silent"!==t.kind&&"cast"!==t.kind||!t.expr||t.expr.parenthesizedExpression?"unary"===t.kind?t.what&&!t.what.parenthesizedExpression&&("bin"===t.what.kind?(i=t.what,t.what=t.what.left,this.swapLocations(t,t,t.what,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i):"retif"===t.what.kind&&(i=t.what,t.what=t.what.test,this.swapLocations(t,t,t.what,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i)):"retif"===t.kind?t.falseExpr&&"retif"===t.falseExpr.kind&&!t.falseExpr.parenthesizedExpression&&(i=t.falseExpr,t.falseExpr=i.test,this.swapLocations(t,t.test,t.falseExpr,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i):"assign"===t.kind?t.right&&"bin"===t.right.kind&&!t.right.parenthesizedExpression&&(s=Ws.precedence["="],n=Ws.precedence[t.right.type],s&&n&&n<s&&(i=t.right,t.right=t.right.left,i.left=t,this.swapLocations(i,i.left,t.right,e),t=i)):"expressionstatement"===t.kind&&this.swapLocations(t,t.expression,t,e):"bin"===t.expr.kind?(i=t.expr,t.expr=t.expr.left,this.swapLocations(t,t,t.expr,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i):"retif"===t.expr.kind&&(i=t.expr,t.expr=t.expr.test,this.swapLocations(t,t,t.expr,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i),t},Ws.prototype.prepare=function(t,e,i){let s=null;(this.withPositions||this.withSource)&&(s=i.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=i.lexer._input.substring(s.offset,i.prev[2])),o=new H(t,s,new E(i.prev[0],i.prev[1],i.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),i.debug&&delete Ws.stack[r.stackUid],n.resolvePrecedence(c,i)};return i.debug&&(Ws.stack||(Ws.stack={},Ws.stackUid=1),Ws.stack[++Ws.stackUid]={position:s,stack:(new Error).stack.split("\n").slice(3,5)},r.stackUid=Ws.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:i._docIndex=i._docs.length-e.length),i.debug&&delete Ws.stack[r.stackUid]},r},Ws.prototype.checkNodes=function(){const t=[];for(const e in Ws.stack)Object.prototype.hasOwnProperty.call(Ws.stack,e)&&t.push(Ws.stack[e]);return Ws.stack={},t},[j,z,X,q,tt,it,rt,ct,dt,ft,kt,mt,yt,gt,Ct,bt,Pt,Bt,Ft,Ht,Vt,Qt,jt,vt,zt,Ot,Jt,Zt,te,ie,ne,he,ce,_e,de,fe,ke,Q,me,xe,Ae,Ne,Se,Oe,be,ve,we,Pe,Be,Fe,Ge,We,Ye,_t,$e,Ke,Je,Ze,ei,oi,ai,li,_i,V,di,fi,ki,mi,yi,gi,nt,Ci,Li,Ii,bi,vi,Di,Ui,Mi,Gi,si,Wi,Yi,$i,Ki,ht,Ji,Zi,es,ss,rs,hs,cs,_s,ds,fs,ks,Es,ys,gs,Cs,Ls,Is,vs,Ds,Us,Ms,Hs,Vs].forEach((function(t){Ws.prototype[t.kind]=t}));var Qs=Ws;function Ys(t,e){const i=Object.keys(t);let s=i.length;for(;s--;){const n=i[s],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]?Ys(r,e[n]):r}return e}const js=function(t){if("function"==typeof this)return new this(t);if(this.tokens=F,this.lexer=new k(this),this.ast=new Qs,this.parser=new M(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")}Ys(t,this),this.lexer.version=this.parser.version}},$s=function(t){return"function"==typeof t.write?t.toString():t};js.create=function(t){return new js(t)},js.parseEval=function(t,e){return new js(e).parseEval(t)},js.prototype.parseEval=function(t){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,t=$s(t),this.parser.parse(t,"eval")},js.parseCode=function(t,e,i){"object"!=typeof e||i||(i=e,e="unknown");return new js(i).parseCode(t,e)},js.prototype.parseCode=function(t,e){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,t=$s(t),this.parser.parse(t,e)},js.tokenGetAll=function(t,e){return new js(e).tokenGetAll(t)},js.prototype.tokenGetAll=function(t){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,t=$s(t);const e=this.lexer.EOF,i=this.tokens.values;this.lexer.setInput(t);let s=this.lexer.lex()||e;const n=[];for(;s!=e;){let t=this.lexer.yytext;Object.prototype.hasOwnProperty.call(i,s)&&(t=[i[s],t,this.lexer.yylloc.first_line]),n.push(t),s=this.lexer.lex()||e}return n};var zs=js,Ks=F,Xs=k,Js=Qs,qs=M,Zs=Ys,tn=js,en=js;zs.tokens=Ks,zs.lexer=Xs,zs.AST=Js,zs.parser=qs,zs.combine=Zs,zs.Engine=tn,zs.default=en;var sn=function(t,e,i){const s=i&&"markdown"===i.parentParser;if(!t&&s)return"";t=t.replace(/\?>\r?\n<\?/g,"?>\n___PSEUDO_INLINE_PLACEHOLDER___<?");const n=new zs({parser:{extractDoc:!0},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=>{"\r"===t.value[t.value.length-1]&&(t.value=t.value.slice(0,-1),t.loc.end.offset=t.loc.end.offset-1),"\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{hasNewline:nn,skipEverythingButNewLine:rn,skipNewline:on,isNextLineEmpty:hn,isPreviousLineEmpty:an,getNextNonSpaceNonCommentCharacterIndex:cn}=s.default.util,ln=s.default.version;function _n(t,e){return parseInt(ln[0])>1?t[e]:t}const un={};function dn(t){return un[t]}[["or"],["xor"],["and"],["=","+=","-=","*=","**=","/=",".=","%=","&=","|=","^=","<<=",">>="],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!==","<>","<=>"],["<",">","<=",">="],[">>","<<"],["+","-","."],["*","/","%"],["!"],["instanceof"],["++","--","~"],["**"]].forEach((t,e)=>{t.forEach(t=>{un[t]=e})});const pn=["==","!=","===","!==","<>","<=>"],fn=["*","/","%"],Tn=[">>","<<"];function kn(t){return["block","program","namespace","class","interface","trait","traituse","declare"].includes(t.kind)}function En(t){let{body:e}=t;return e?("block"===e.kind&&(e=e.children),e[0]):null}function mn(t){const e=t.children||t.body||t.adaptations;return Array.isArray(e)?e:null}function xn(t){const e=t.getParentNode();return e?mn(e):null}function yn(t){return t.length>0?t[t.length-1]:null}function An(t){const e=t.getValue();if("program"===e.kind){const t=mn(e);return!(!t||0===t.length)&&"inline"===t[0].kind}if("switch"===e.kind){if(!e.body)return!1;const t=mn(e.body);if(0===t.length)return!1;const[i]=t;if(!i.body)return!1;const s=mn(i.body);return 0!==s.length&&"inline"===s[0].kind}const i=En(e);return!!i&&"inline"===i.kind}const gn=["__construct","__destruct","__call","__callStatic","__get","__set","__isset","__unset","__sleep","__wakeup","__toString","__invoke","__set_state","__clone","__debugInfo"].reduce((t,e)=>(t[e.toLowerCase()]=e,t),{});var Nn={printNumber:function(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)/,"")},getPrecedence:dn,isBitwiseOperator:function(t){return!!Tn[t]||"|"===t||"^"===t||"&"===t},shouldFlatten:function(t,e){return dn(e)===dn(t)&&("**"!==t&&((!pn.includes(t)||!pn.includes(e))&&(!("%"===e&&fn.includes(t)||"%"===t&&fn.includes(e))&&((e===t||!fn.includes(e)||!fn.includes(t))&&(!Tn.includes(t)||!Tn.includes(e))))))},nodeHasStatement:kn,getNodeListProperty:mn,getParentNodeListProperty:xn,getLast:yn,getPenultimate:function(t){return t.length>1?t[t.length-2]:null},isLastStatement:function(t){const e=xn(t);if(!e)return!0;const i=t.getValue();return e[e.length-1]===i},getBodyFirstChild:En,lineShouldEndWithSemicolon:function(t){const e=t.getValue(),i=t.getParentNode();if(!i)return!1;if(["for","foreach","while","do","if","switch"].includes(i.kind)&&"block"!==e.kind&&"if"!==e.kind&&(i.body===e||i.alternate===e))return!0;if(!kn(i))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 e=t.getParentNode();if(e&&"interface"===e.kind)return!0}return["expressionstatement","do","usegroup","classconstant","propertystatement","traitprecedence","traitalias","goto","constantstatement","global","static","echo","unset","return","break","continue","throw"].includes(e.kind)},fileShouldEndWithHardline:function(t){const e=t.getValue(),i="program"===e.kind,s=e.children&&yn(e.children);if(!i)return!1;if(s&&["halt","inline"].includes(s.kind))return!1;if(s&&("declare"===s.kind||"namespace"===s.kind)){const t=s.children.length>0&&yn(s.children);if(t&&["halt","inline"].includes(t.kind))return!1}return!0},maybeStripLeadingSlashFromUse:function(t){const e=t.replace(/^\\/,"");return-1!==e.indexOf("\\")?e:t},hasDanglingComments:function(t){return t.comments&&t.comments.some(t=>!t.leading&&!t.trailing)},hasLeadingComment:function(t){return t.comments&&t.comments.some(t=>t.leading)},hasTrailingComment:function(t){return t.comments&&t.comments.some(t=>t.trailing)},docShouldHaveTrailingNewline:function t(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const s=e.getNode(i),n=e.getNode(i+1),r=e.getNode(i+2);if(!n)return!1;if(r&&["call","new","echo"].includes(r.kind)&&!["call","array"].includes(n.kind)||"parameter"===n.kind){const t=r.arguments.length-1;return r.arguments.indexOf(n)!==t}if(r&&"for"===r.kind){const t=r.init.indexOf(n);if(-1!==t)return t!==r.init.length-1;const e=r.test.indexOf(n);if(-1!==e)return e!==r.test.length-1;const i=r.increment.indexOf(n);if(-1!==i)return i!==r.increment.length-1}if("bin"===n.kind)return n.left===s||t(e,i+1);if("case"===n.kind&&n.test===s)return!0;if("staticvariable"===n.kind){const t=r.variables.length-1;return r.variables.indexOf(n)!==t}if("entry"===n.kind){if(n.key===s)return!0;const t=r.items.length-1;return r.items.indexOf(n)!==t}if(["call","new"].includes(n.kind)){const t=n.arguments.length-1;return n.arguments.indexOf(s)!==t}if("echo"===n.kind){const t=n.expressions.length-1;return n.expressions.indexOf(s)!==t}if("array"===n.kind){const t=n.items.length-1;return n.items.indexOf(s)!==t}return"retif"===n.kind&&t(e,i+1)},isLookupNode:function(t){return"propertylookup"===t.kind||"nullsafepropertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind},isFirstChildrenInlineNode:An,shouldPrintHardLineAfterStartInControlStructure:function(t){const e=t.getValue();return!["try","catch"].includes(e.kind)&&An(t)},shouldPrintHardLineBeforeEndInControlStructure:function(t){const e=t.getValue();if(["try","catch"].includes(e.kind))return!0;if("switch"===e.kind){const t=mn(e.body);if(0===t.length)return!0;const i=yn(t);if(!i.body)return!0;const s=mn(i.body);return 0===s.length||"inline"!==s[0].kind}return!An(t)},getAlignment:function(t){const e=t.split("\n").pop();return e.length-e.trimLeft().length+1},isProgramLikeNode:function(t){return["program","declare","namespace"].includes(t.kind)},isReferenceLikeNode:function(t){return["name","parentreference","selfreference","staticreference"].includes(t.kind)},getNodeKindIncludingLogical:function(t){return"bin"===t.kind&&["||","&&"].includes(t.type)?"logical":t.kind},useDoubleQuote: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},hasEmptyBody:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";const i=t.getValue();return i[e]&&i[e].children&&0===i[e].children.length&&(!i[e].comments||0===i[e].comments.length)},isNextLineEmptyAfterNamespace:function(t,e,i){let s=i(e);return s=rn(t,s),s=on(t,s),nn(t,s)},shouldPrintHardlineBeforeTrailingComma:function(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)},isDocNode:function(t){return"nowdoc"===t.kind||"encapsed"===t.kind&&"heredoc"===t.type},getAncestorNode:function(t,e){const i=function(t,e){const i=[].concat(e);let s,n=-1;for(;s=t.getParentNode(++n);)if(-1!==i.indexOf(s.kind))return n;return-1}(t,e);return-1===i?null:t.getParentNode(i)},getNextNode:function(t,e){const i=t.getParentNode(),s=mn(i);if(!s)return null;const n=s.indexOf(e);return-1===n?null:i.children[n+1]},normalizeMagicMethodName:function(t){const e=t.toLowerCase();return gn[e]?gn[e]:t},isPreviousLineEmpty:function(t,e,i){return an(t,e,_n(i,"locStart"))},isNextLineEmpty:function(t,e,i){return hn(t,e,_n(i,"locEnd"))},getNextNonSpaceNonCommentCharacterIndex:function(t,e,i){return cn(t,e,_n(i,"locEnd"))}};const{addLeadingComment:Cn,addDanglingComment:Sn,addTrailingComment:Ln,skipNewline:On,hasNewline:In,hasNewlineInRange:bn}=s.default.util,{concat:Rn,join:vn,indent:wn,hardline:Dn,cursor:Pn,lineSuffix:Un,breakParent:Bn}=s.default.doc.builders,{getNextNonSpaceNonCommentCharacterIndex:Mn,isNextLineEmpty:Fn,isPreviousLineEmpty:Hn,isLookupNode:Gn}=Nn;function Vn(t,e){const{children:i}=t;0===i.length?Sn(t,e):Cn(i[0],e)}function Wn(t,e){"block"===t.kind?Vn(t,e):Cn(t,e)}function Qn(t,e,i,s,n,r){const o=Mn(t,n,r),h=t.charAt(o);return e&&"identifier"===e.kind&&i&&("function"===i.kind||"method"===i.kind)&&")"===h?(Ln(i,n),!0):!(!i||"function"!==i.kind&&"method"!==i.kind||!s||"block"!==s.kind)&&(Vn(s,n),!0)}function Yn(t,e,i,s,n,r){if(!i||"if"!==i.kind||!s)return!1;const o=Mn(t,n,r);return")"===t.charAt(o)?(Ln(e,n),!0):e===i.body&&s===i.alternate?(Sn(i,n),!0):"if"===s.kind?(Wn(s.body,n),!0):i.body===s&&(Cn(s,n),!0)}function jn(t,e,i){if(t&&["class","interface","trait"].includes(t.kind)){if(e&&t.extends)if(Array.isArray(t.extends)){if(t.extends.some(t=>{if(e&&e===t)return Sn(e,i),!0}))return!0}else if(e===t.extends)return Sn(e,i),!0;if(e&&t.implements&&t.implements.some(t=>{if(e&&e===t)return Sn(e,i),!0}))return!0;if(!(t.body&&t.body.length>0))return Sn(t,i),!0}return!!(e&&"class"===e.kind&&e.isAnonymous&&e.leadingComments&&"commentblock"===i.kind)}function $n(t,e,i,s,n){if(e&&("function"===e.kind||"method"===e.kind)){let i=0;for(let t=0;t<e.arguments.length;t++)i=n.locEnd(e.arguments[t])>i?n.locEnd(e.arguments[t]):i;const r=e.body&&n.locStart(s)>i&&n.locEnd(s)<n.locStart(e.body),o=Mn(t,s,n);if(e.type&&r&&")"!==t.charAt(o))return n.locEnd(s)<n.locStart(e.type)?(Sn(e.type,s),!0):(Ln(e.type,s),!0)}return!1}function zn(t,e,i,s,n){return!(!i||!["function","method","parameter"].includes(i.kind))&&("typereference"===e.kind&&"identifier"===s.kind&&(Ln(e,n),!0))}function Kn(t,e){return!(!t||!["label","goto"].includes(t.kind))&&(Ln(t,e),!0)}function Xn(t,e,i,s){return i&&"inline"===i.kind?(i.leadingComments||(i.leadingComments=[]),i.leadingComments.includes(s)||i.leadingComments.push(s),!0):!(t||i||!e||"inline"!==e.kind)&&(Sn(e,s),!0)}function Jn(t,e,i){return!(!t||"try"!==t.kind||!e)&&("block"===e.kind?(Vn(e,i),!0):"try"===e.kind?(Wn(e.always,i),!0):"catch"===e.kind&&(Wn(e.body,i),!0))}function qn(t,e,i,s){return i||e||!t||"namespace"!==t.kind||t.withBrackets?!(e||!t||"namespace"!==t.kind||t.withBrackets)&&(Sn(t,s),!0):(Ln(t,s),!0)}function Zn(t,e,i,s){return!(!t||"declare"!==t.kind)&&((!e||"noop"!==e.kind)&&(i&&t.directives[0]!==i?!(!i||!e)&&(Cn(i,s),!0):("none"===t.mode?Ln(t,s):Sn(t,s),!0)))}function tr(t,e,i,s,n,r){if(!i||"while"!==i.kind||!s)return!1;const o=Mn(t,n,r);return")"===t.charAt(o)?(Ln(e,n),!0):"block"===s.kind&&(Vn(s,n),!0)}function er(t,e){return t.getValue().printed=!0,e.printer.printComment(t,e)}function ir(t,e,i){return t.getNode()===e.cursorNode&&t.getValue()?Rn([Pn,i,Pn]):i}var sr={handleOwnLineComment:function(t,e,i){const{precedingNode:s,enclosingNode:n,followingNode:r}=t;return Qn(e,s,n,r,t,i)||function(t,e,i){if(t&&Gn(t)&&e&&["identifier","variable","encapsed"].includes(e.kind))return Cn(t,i),!0;return!1}(n,r,t)||Yn(e,s,n,r,t,i)||tr(e,s,n,r,t,i)||Jn(n,r,t)||jn(n,r,t)||zn(e,s,n,r,t)||$n(e,n,r,t,i)||function(t,e,i,s){if(!i&&t&&("for"===t.kind||"foreach"===t.kind))return t.body&&"block"!==t.body.kind?Cn(i,s):Cn(t,s),!0;return!1}(n,0,r,t)||Xn(n,s,r,t)||Zn(n,s,r,t)},handleEndOfLineComment:function(t,e,i){const{precedingNode:s,enclosingNode:n,followingNode:r}=t;return function(t,e,i,s,n){if(!e&&!s&&i&&"array"===i.kind)return Ln(i,n),!0;return!1}(0,s,n,r,t)||function(t,e,i,s,n){if(i&&"return"===i.kind&&!i.expr)return Ln(i,n),!0;return!1}(0,0,n,0,t)||Qn(e,s,n,r,t,i)||function(t,e,i,s,n,r){const o=e&&!bn(n,r.locEnd(e),r.locStart(s));if((!e||!o)&&t&&"retif"===t.kind&&i)return Cn(i,s),!0;return!1}(n,s,r,t,e,i)||Yn(e,s,n,r,t,i)||tr(e,s,n,r,t,i)||Jn(n,r,t)||jn(n,r,t)||zn(e,s,n,r,t)||$n(e,n,r,t,i)||function(t,e){if(t&&"entry"===t.kind)return Cn(t,e),!0;return!1}(n,t)||function(t,e,i){if(e&&"call"===e.kind&&t&&e.what===t&&e.arguments.length>0)return Cn(e.arguments[0],i),!0;return!1}(s,n,t)||function(t,e,i){if(t&&"assign"===t.kind&&e){const s=t.loc.start.offset+t.loc.source.indexOf("=");if(i.loc.start.offset>s)return Cn(e,i),!0}return!1}(n,r,t)||Xn(n,s,r,t)||qn(n,s,r,t)||Zn(n,s,r,t)||Kn(n,t)},handleRemainingComment:function(t,e,i){const{precedingNode:s,enclosingNode:n,followingNode:r}=t;return Yn(e,s,n,r,t,i)||tr(e,s,n,r,t,i)||function(t,e,i,s){const n=Mn(t,i,s);if(")"!==t.charAt(n))return!1;if(e&&("function"===e.kind||"closure"===e.kind||"method"===e.kind||"call"===e.kind||"new"===e.kind)&&0===e.arguments.length)return Sn(e,i),!0;return!1}(e,n,t,i)||jn(n,r,t)||function(t,e,i){if(t&&"traituse"===t.kind&&t.adaptations&&!t.adaptations.length)return Sn(t,i),!0;return!1}(n,0,t)||zn(e,s,n,r,t)||$n(e,n,r,t,i)||Kn(n,t)||function(t,e,i,s){if(e&&"halt"===e.kind)return Sn(e,s),!0;if(t&&"halt"===t.kind)return Sn(t,s),!0;return!1}(s,n,0,t)||function(t,e){if(t&&("continue"===t.kind||"break"===t.kind)&&!t.label)return Ln(t,e),!0;return!1}(n,t)||Xn(n,s,r,t)||qn(n,s,r,t)},getCommentChildNodes:function(t){return"object"!=typeof t?[]:(t=>Object.keys(t).filter(t=>"kind"!==t&&"loc"!==t&&"errors"!==t&&"extra"!==t&&"comments"!==t&&"leadingComments"!==t&&"enclosingNode"!==t&&"precedingNode"!==t&&"followingNode"!==t).map(e=>t[e]))(t)},canAttachComment:function(t){return t.kind&&"commentblock"!==t.kind&&"commentline"!==t.kind},isBlockComment:function(t){return"commentblock"===t.kind},printDanglingComments:function(t,e,i,s){const n=[],r=t.getValue();return r&&r.comments?(t.each(t=>{const i=t.getValue();!i||i.leading||i.trailing||s&&!s(i)||n.push(er(t,e))},"comments"),0===n.length?"":i?vn(Dn,n):wn(Rn([Dn,vn(Dn,n)]))):""},hasLeadingComment:function(t){return t.comments&&t.comments.some(t=>t.leading)},hasTrailingComment:function(t){return t.comments&&t.comments.some(t=>t.trailing)},hasLeadingOwnLineComment:function(t,e,i){return e.comments&&e.comments.some(e=>e.leading&&In(t,i.locEnd(e)))},printComments:function(t,e){const i=[];return t.forEach((t,s,n)=>{t.printed=!0;const r=n.length===s+1;i.push(t.value),r||i.push(Dn),Fn(e.originalText,t,e)&&!r&&i.push(Dn)}),Rn(i)},printAllComments:function(t,e,i,s){const n=t.getValue(),r=e(t),o=n&&n.comments;if(!o||0===o.length)return ir(t,i,r);const h=[],a=[s?";":"",r];return t.each(t=>{const e=t.getValue(),{leading:s,trailing:n}=e;if(s){const s=function(t,e,i){const s=t.getValue(),n=er(t,i);if(!n)return"";const r=i.printer.isBlockComment&&i.printer.isBlockComment(s);return Rn(r?[n,In(i.originalText,i.locEnd(s))?Dn:" "]:[n,Dn])}(t,0,i);if(!s)return;h.push(s);const n=i.originalText;In(n,On(n,i.locEnd(e)))&&h.push(Dn)}else n&&a.push(function(t,e,i){const s=t.getValue(),n=er(t,i);if(!n)return"";const r=i.printer.isBlockComment&&i.printer.isBlockComment(s);if(In(i.originalText,i.locStart(s),{backwards:!0})){const t=Hn(i.originalText,s,i);return Un(Rn([Dn,t?Dn:"",n]))}return Rn(r?[" ",n]:[Un(Rn([" ",n])),r?"":Bn])}(t,0,i))},"comments"),ir(t,i,Rn(h.concat(a)))}};function nr(){}nr.strictEqual=function(){};var rr=nr;const{getPrecedence:or,shouldFlatten:hr,isBitwiseOperator:ar}=Nn;var cr=function(t){const e=t.getParentNode();if(!e)return!1;const i=t.getName(),s=t.getNode();if(["program","expressionstatement","namespace","declare","block","include","print","return","echo"].includes(e.kind))return!1;switch(s.kind){case"pre":case"post":if("unary"===e.kind)return"pre"===s.kind&&("+"===s.type&&"+"===e.type||"-"===s.type&&"-"===e.type);case"unary":switch(e.kind){case"unary":return s.type===e.type&&("+"===s.type||"-"===s.type);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===s;case"bin":return"**"===e.type&&"left"===i;default:return!1}case"bin":switch(e.kind){case"assign":case"retif":return["and","xor","or"].includes(s.type);case"silent":case"cast":return s.parenthesizedExpression;case"pre":case"post":case"unary":return!0;case"call":case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":return"what"===i&&e.what===s;case"bin":{const t=e.type,n=or(t),r=s.type,o=or(r);return n>o||("||"===t&&"&&"===r||(n===o&&"right"===i?(rr.strictEqual(e.right,s),!0):n===o&&!hr(t,r)||(n<o&&"%"===r?"+"===t||"-"===t:!!ar(t))))}default:return!1}case"propertylookup":case"nullsafepropertylookup":case"staticlookup":switch(e.kind){case"call":return"what"===i&&e.what===s&&s.parenthesizedExpression;default:return!1}case"clone":case"new":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===s;default:return!1}case"yield":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===s;case"retif":return e.test===s;default:return!(!s.key&&!s.value)}case"assign":return("for"!==e.kind||!e.init.includes(s)&&!e.increment.includes(s))&&("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"===i&&!e.trueExpr);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return"what"===i&&e.what===s;default:return!1}case"closure":switch(e.kind){case"call":return"what"===i&&e.what===s;case"propertylookup":case"nullsafepropertylookup":return!0;default:return!1}case"silence":case"cast":return s.parenthesizedExpression;case"string":case"array":switch(e.kind){case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":case"call":return(!["string","array"].includes(s.kind)||"offsetlookup"!==e.kind)&&("what"===i&&e.what===s);default:return!1}case"print":case"include":return"bin"===e.kind}return!1};const{breakParent:lr,concat:_r,join:ur,line:dr,lineSuffix:pr,group:fr,conditionalGroup:Tr,indent:kr,dedent:Er,ifBreak:mr,hardline:xr,softline:yr,literalline:Ar,align:gr,dedentToRoot:Nr}=s.default.doc.builders,{willBreak:Cr}=s.default.doc.utils,{isNextLineEmptyAfterIndex:Sr,hasNewline:Lr,hasNewlineInRange:Or}=s.default.util,{getLast:Ir,getPenultimate:br,isLastStatement:Rr,lineShouldEndWithSemicolon:vr,printNumber:wr,shouldFlatten:Dr,maybeStripLeadingSlashFromUse:Pr,fileShouldEndWithHardline:Ur,hasDanglingComments:Br,hasLeadingComment:Mr,hasTrailingComment:Fr,docShouldHaveTrailingNewline:Hr,isLookupNode:Gr,isFirstChildrenInlineNode:Vr,shouldPrintHardLineAfterStartInControlStructure:Wr,shouldPrintHardLineBeforeEndInControlStructure:Qr,getAlignment:Yr,isProgramLikeNode:jr,getNodeKindIncludingLogical:$r,useDoubleQuote:zr,hasEmptyBody:Kr,isNextLineEmptyAfterNamespace:Xr,shouldPrintHardlineBeforeTrailingComma:Jr,isDocNode:qr,getAncestorNode:Zr,isReferenceLikeNode:to,getNextNode:eo,normalizeMagicMethodName:io,getNextNonSpaceNonCommentCharacterIndex:so,isNextLineEmpty:no}=Nn;function ro(t,e){return parseFloat(t)>=parseFloat(e)}function oo(t,e){return!!t.trailingCommaPHP&&ro(t.phpVersion,e)}function ho(t){switch(t.braceStyle){case"1tbs":return!1;case"psr-2":default:return!0}}function ao(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return _r([s?"?":"","->",t.call(i,"offset")])}function co(t,e,i){return ao(t,e,i,!0)}function lo(t,e,i){const s=t.getValue(),n=!["variable","identifier"].includes(s.offset.kind);return _r(["::",n?"{":"",t.call(i,"offset"),n?"}":""])}function _o(t,e,i){const s=t.getValue(),n=s.offset&&"number"===s.offset.kind||Zr(t,"encapsed");return _r(["[",s.offset?fr(_r([kr(_r([n?"":yr,t.call(i,"offset")])),n?"":yr])):"","]"])}function uo(t){return"array"===t.kind&&(t.items.length>0||t.comments)||"function"===t.kind||"method"===t.kind||"closure"===t.kind}function po(t){const e=Ir(t),i=br(t);return!Mr(e)&&!Fr(e)&&uo(e)&&(!i||i.kind!==e.kind)}function fo(t){if(2!==t.length)return!1;const[e,i]=t;return!(e.comments&&e.comments.length||"function"!==e.kind&&"method"!==e.kind&&"closure"!==e.kind||"retif"===i.kind||uo(i))}function To(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"arguments";const n=t.getValue()[s];if(0===n.length)return _r(["(",sr.printDanglingComments(t,e,!0),")"]);let r=!1,o=!1;const h=n.length-1,a=t.map((t,s)=>{const n=t.getNode(),a=[i(t)];return s===h||(no(e.originalText,n,e)?(0===s&&(o=!0),r=!0,a.push(",",xr,xr)):a.push(",",dr)),_r(a)},s),c=t.getValue(),l=Ir(n),_=oo(e,"7.3")&&["call","new","unset","isset"].includes(c.kind)||oo(e,"8.0")&&["function","closure","method","arrowfunc","attribute"].includes(c.kind)?kr(_r([l&&Jr(l)?xr:"",","])):"";function u(){return fr(_r(["(",kr(_r([dr,_r(a)])),_,dr,")"]),{shouldBreak:!0})}const d=fo(n),p=po(n);if(d||p){const e=(d?a.slice(1).some(Cr):a.slice(0,-1).some(Cr))||r;let h,c=0;t.each(t=>{d&&0===c&&(h=[_r([t.call(t=>i(t,{expandFirstArg:!0})),a.length>1?",":"",o?xr:dr,o?xr:""])].concat(a.slice(1))),p&&c===n.length-1&&(h=a.slice(0,-1).concat(t.call(t=>i(t,{expandLastArg:!0})))),c++},s);const l=a.some(Cr),f=_r(["(",_r(h),")"]);return _r([l?lr:"",Tr([l?mr(u(),f):f,_r(d?["(",fr(h[0],{shouldBreak:!0}),_r(h.slice(1)),")"]:["(",_r(a.slice(0,-1)),fr(Ir(h),{shouldBreak:!0}),")"]),fr(_r(["(",kr(_r([dr,_r(a)])),mr(_),dr,")"]),{shouldBreak:!0})],{shouldBreak:e})])}return fr(_r(["(",kr(_r([yr,_r(a)])),mr(_),yr,")"]),{shouldBreak:a.some(Cr)||r})}function ko(t){return"array"===t.kind&&0!==t.items.length}function Eo(t){return"array"===t.right.kind&&0!==t.right.items.length}function mo(t,e,i){const s=t.getValue();switch(s.kind){case"propertylookup":return ao(t,e,i);case"nullsafepropertylookup":return co(t,e,i);case"staticlookup":return lo(t,0,i);case"offsetlookup":return _o(t,0,i);default:return"Have not implemented lookup kind ".concat(s.kind," yet.")}}function xo(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 i={string:'"',shell:"`"};return i[t.type]?i[t.type]:"Unimplemented encapsed type ".concat(t.type)}function yo(t,e,i){const s=[];let n=[];return t.each(t=>{s.push(_r(n)),s.push(fr(i(t))),n=[",",dr],t.getValue()&&no(e.originalText,t.getValue(),e)&&n.push(yr)},"items"),_r(s)}function Ao(t,e){if(0===e.length)return t;let i=0;return e.reduce((e,s)=>{const{start:n,end:r,alignment:o,before:h,after:a}=s,c=_r([h||"",_r(t.slice(n,r)),a||""]),l=e.concat(t.slice(i,n),o?Nr(fr(_r([gr(new Array(o).join(" "),c)]))):fr(c),r===t.length-1?t.slice(r):"");return i=r,l},[])}function go(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children";const n=t.getValue(),r=t.getParentNode();let o=-1;const h=[],a=[];t.map((c,l)=>{const _=c.getValue(),u="inline"===_.kind,d=i(c),p=n[s],f=p[l+1],T=!Rr(c)&&!u&&(f&&"case"===f.kind?!Vr(t):f&&"inline"!==f.kind);let k=_r([d,T?xr:"",T&&no(e.originalText,_,e)?xr:""]);const E=0===l,m=p.length-1===l,x="block"===n.kind&&r&&["function","closure","method","try","catch"].includes(r.kind);let y=x&&E?"":" ";if(u||!u&&m&&o>=0){const t=o;u&&(o=l);if(u&&!E||!u&&m){const e=(u?t:o)+1,i=m&&!u?l+1:l,s=p[u?t:o],r=s?Yr(s.raw):"",h=i-e>1,c=h?x&&!s||jr(n)&&0===e?"":xr:"",d=h&&"halt"!==_.kind?x&&m?"":xr:"";h&&(y=""),a.push({start:e,end:i,alignment:r,before:c,after:d})}}if(u){const i=f&&"echo"===f.kind&&f.shortForm?"<?=":"<?php",s=_.leadingComments&&_.leadingComments.length?_r([E&&"namespace"!==n.kind&&!x?"<?php":"","namespace"!==n.kind&&x?"":xr,sr.printComments(_.leadingComments,e),xr,"?>"]):jr(n)&&E&&"namespace"!==n.kind?"":_r([y,"?>"]),r=t.getNode(l+1),o=r&&r.children&&r.children.length,h=_.comments&&_.comments.length?_r([i,xr,o?sr.printComments(_.comments,e):"",xr,o?"?>":""]):jr(n)&&m?"":_r([i," "]);k=_r([s,k,h])}h.push(k)},s);const c=Ao(h,a);if("program"===n.kind&&!n.extra.parseAsEval){const t=[],[i]=n.children;if(!i||"inline"!==i.kind){const s=e.originalText.trim().match(/^<\?(php|=)(\s+)?\S/),r=_r([s&&s[2]&&s[2].includes("\n")?_r([xr,s[2].split("\n").length>2?xr:""]):" ",n.comments?sr.printComments(n.comments,e):""]),o=i&&"echo"===i.kind&&i.shortForm;t.push(_r([o?"<?=":"<?php",r]))}t.push(_r(c));if(e.originalText.trim().endsWith("?>")){const i=Ir(n.children),s=i?_r([Or(e.originalText.trimEnd(),e.locEnd(i),e.locEnd(n))?xr:" ",no(e.originalText,i,e)?xr:""]):n.comments?xr:"";t.push(pr(_r([s,"?>"])))}return _r(t)}return _r(c)}function No(t,e,i,s){return _r(t.map(t=>{const s=[];return s.push(i(t)),Rr(t)||(s.push(xr),no(e.originalText,t.getValue(),e)&&s.push(xr)),_r(s)},s))}function Co(t,e,i){let s=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.getValue(),h=Br(o[s])?_r([xr,t.call(t=>sr.printDanglingComments(t,e,!0),s),xr]):n,a=Array.isArray(o[s])?fr(_r([ur(",",t.map(t=>{const s=i(t);return Br(t.getValue())?_r([xr,sr.printDanglingComments(t,e,!0),xr,s]):_r([r,s])},s))])):_r([r,t.call(i,s)]);return kr(_r([h,s,Cr(h)?kr(a):a]))}function So(t,e,i){let{inline:s=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const n=[];return t.getValue().attrGroups?(t.each(t=>{const r=["#["];!s&&n.length>0&&n.push(xr),r.push(yr),t.each(t=>{const s=t.getValue();r.length>2&&r.push(",",dr);const n=[s.name];s.args.length>0&&n.push(To(t,e,i,"args")),r.push(fr(_r(n)))},"attrs"),n.push(fr(_r([kr(_r(r)),mr(oo(e,"8.0")?",":""),yr,"]",s?mr(yr," "):""])))},"attrGroups"),0===n.length?[]:[_r([...n,s?"":xr])]):[]}function Lo(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"body";const n=t.getValue();if(!n[s])return";";const r=t.call(i,s);return _r([n.shortForm?":":" {",kr(_r(["block"!==n[s].kind||n[s].children&&n[s].children.length>0||n[s].comments&&n[s].comments.length>0?_r([Wr(t)?"switch"===n.kind?" ":"":xr,r]):""])),"if"===n.kind&&"body"===s?"":_r([Qr(t)?xr:"",n.shortForm?_r(["end",n.kind,";"]):"}"])])}function Oo(t,e,i,s,n,r,o){if(!s)return e;const h=Io(t,s,n,r,o);return fr(_r([e,i,h]))}function Io(t,e,i,s,n){const r=s?"&":"";if(sr.hasLeadingOwnLineComment(n.originalText,e,n))return kr(_r([xr,r,i]));const o="cast"===e.kind?e.expr:e;return"bin"===o.kind&&!Eo(o)||"retif"===o.kind&&(!o.trueExpr&&!ko(o.falseExpr)||"bin"===o.test.kind&&!Eo(o.test))||("variable"===t.kind||"string"===t.kind||Gr(t))&&("string"===o.kind&&!bo(o)||function t(e){return!!Gr(e)&&(!("variable"!==e.what.kind&&!to(e.what))||t(e.what))}(o))?fr(kr(_r([dr,r,i]))):_r([" ",r,i])}function bo(t){return t.raw.includes("\n")}function Ro(t,e,i){return("string"===t.kind||"encapsed"===t.kind&&("string"===t.type||"shell"===t.type))&&bo(t)&&!Lr(e,i.locStart(t),{backwards:!0})}var vo=function(t,e,i){const s=t.getValue();if(!s)return"";if("string"==typeof s)return s;const n=function(t,e,i){const s=t.getValue();switch(s.kind){case"program":return fr(_r([go(t,e,i),sr.printDanglingComments(t,e,!0,t=>!t.printed)]));case"expressionstatement":return t.call(i,"expression");case"block":return _r([go(t,e,i),sr.printDanglingComments(t,e,!0)]);case"declare":{const n=t=>ur(", ",t.map(t=>_r([i(t)]),"directives"));if(["block","short"].includes(s.mode))return _r(["declare(",n(t),")","block"===s.mode?" {":":",s.children.length>0?kr(_r([xr,go(t,e,i)])):"",sr.printDanglingComments(t,e),xr,"block"===s.mode?"}":"enddeclare;"]);const r=eo(t,s);return _r(["declare(",n(t),")",r&&"inline"===r.kind?"":";"])}case"declaredirective":return _r([t.call(i,"key"),"=",t.call(i,"value")]);case"namespace":return _r(["namespace ",s.name&&"string"==typeof s.name?_r([s.name,s.withBrackets?" ":""]):"",s.withBrackets?"{":";",Br(s)?_r([" ",sr.printDanglingComments(t,e,!0)]):"",s.children.length>0?s.withBrackets?kr(_r([xr,go(t,e,i)])):_r(["inline"===s.children[0].kind?"":_r([xr,Xr(e.originalText,s,e.locStart)?xr:""]),go(t,e,i)]):"",s.withBrackets?_r([xr,"}"]):""]);case"usegroup":return fr(_r(["use ",s.type?_r([s.type," "]):"",kr(_r([s.name?_r([Pr(s.name),"\\{",yr]):"",ur(_r([",",dr]),t.map(t=>_r([i(t)]),"items"))])),s.name?_r([mr(oo(e,"7.2")?",":""),yr,"}"]):""]));case"useitem":return _r([s.type?_r([s.type," "]):"",Pr(s.name),Br(s)?_r([" ",sr.printDanglingComments(t,e,!0)]):"",s.alias?_r([" as ",t.call(i,"alias")]):""]);case"class":case"interface":case"trait":return function(t,e,i){const s=t.getValue(),n="class"===s.kind&&s.isAnonymous,r=So(t,e,i,{inline:n}),o=n?[]:[...r];s.isFinal&&o.push("final ");s.isAbstract&&o.push("abstract ");o.push(n?"":s.kind),s.name&&o.push(" ",t.call(i,"name"));s.extends&&s.implements?o.push(Tr([_r([Co(t,e,i,"extends"),Co(t,e,i,"implements")]),_r([Co(t,e,i,"extends"),Co(t,e,i,"implements"," ",xr)]),_r([Co(t,e,i,"extends",xr," "),Co(t,e,i,"implements",xr,s.implements.length>1?xr:" ")])],{shouldBreak:Br(s.extends)})):(s.extends&&o.push(Tr([Co(t,e,i,"extends"),Co(t,e,i,"extends"," ",xr),Co(t,e,i,"extends",xr,s.extends.length>1?xr:" ")])),s.implements&&o.push(Tr([Co(t,e,i,"implements"),Co(t,e,i,"implements"," ",xr),Co(t,e,i,"implements",xr,s.implements.length>1?xr:" ")])));const h=fr(_r([fr(_r(o)),ho(e)?n?dr:xr:" "])),a=s.body&&0===s.body.length&&!Br(s),c=_r(["{",kr(_r([a?"":xr,No(t,e,i,"body")])),sr.printDanglingComments(t,e,!0),n&&a?yr:xr,"}"]);return _r([h,c])}(t,e,i);case"traitprecedence":return _r([t.call(i,"trait"),"::",t.call(i,"method")," insteadof ",ur(", ",t.map(i,"instead"))]);case"traitalias":return _r([s.trait?_r([t.call(i,"trait"),"::"]):"",s.method?t.call(i,"method"):""," as ",ur(" ",[...s.visibility?[s.visibility]:[],...s.as?[t.call(i,"as")]:[]])]);case"traituse":return fr(_r(["use ",kr(fr(ur(_r([",",dr]),t.map(i,"traits")))),s.adaptations?_r([" {",s.adaptations.length>0?_r([kr(_r([xr,No(t,e,i,"adaptations")])),xr]):Br(s)?_r([dr,sr.printDanglingComments(t,e,!0),dr]):"","}"]):""]));case"function":case"closure":case"method":return function(t,e,i){const s=t.getValue(),n=[...So(t,e,i,{inline:"closure"===s.kind})];s.isFinal&&n.push("final ");s.isAbstract&&n.push("abstract ");s.visibility&&n.push(s.visibility," ");s.isStatic&&n.push("static ");n.push("function "),s.byref&&n.push("&");s.name&&n.push(t.call(i,"name"));n.push(To(t,e,i)),s.uses&&s.uses.length>0&&n.push(fr(_r([" use ",To(t,e,i,"uses")])));s.type&&n.push(_r([": ",Br(s.type)?_r([t.call(t=>sr.printDanglingComments(t,e,!0),"type")," "]):"",s.nullable?"?":"",t.call(i,"type")]));const r=_r(n);if(!s.body)return r;const o="closure"===s.kind,h=_r(["{",kr(_r([Kr(t)?"":xr,t.call(i,"body")])),o&&Kr(t)?"":xr,"}"]);if(o)return _r([r," ",h]);if(0===s.arguments.length)return _r([r,ho(e)?xr:" ",h]);if(n.some(Cr))return _r([r," ",h]);return Tr([_r([r,ho(e)?xr:" ",h]),_r([r," ",h])])}(t,e,i);case"arrowfunc":return _r([...So(t,e,i,{inline:!0}),s.isStatic?"static ":"","fn",To(t,e,i),s.type?_r([": ",s.nullable?"?":"",t.call(i,"type")]):""," => ",t.call(i,"body")]);case"parameter":{let n="";1===s.flags?n="public ":2===s.flags?n="protected ":4===s.flags&&(n="private ");const r=_r([...So(t,e,i,{inline:!0}),n,s.nullable?"?":"",s.type?_r([t.call(i,"type")," "]):"",s.byref?"&":"",s.variadic?"...":"","$",t.call(i,"name")]);return s.value?fr(_r([r,Br(s)?" ":"",sr.printDanglingComments(t,e,!0),_r([" =",Io(s.name,s.value,t.call(i,"value"),!1,e)])])):r}case"variadic":return _r(["...",t.call(i,"what")]);case"property":return fr(_r([s.type?_r([s.nullable?"?":"",t.call(i,"type")," "]):"","$",t.call(i,"name"),s.value?_r([" =",Io(s.name,s.value,t.call(i,"value"),!1,e)]):""]));case"propertystatement":{const n=[];t.map(t=>n.push(...So(t,e,i)),"properties");const r=t.map(t=>i(t),"properties"),o=s.properties.some(t=>t.value);let h;1!==r.length||s.properties[0].comments?r.length>0&&(h=kr(r[0])):[h]=r;const a=s.visibility||null===s.visibility;return fr(_r([...n,a?_r([null===s.visibility?"var":s.visibility,""]):"",s.isStatic?_r([a?" ":"","static"]):"",h?_r([" ",h]):"",kr(_r(r.slice(1).map(t=>_r([",",o?xr:dr,t]))))]))}case"if":{const n=[],r=Lo(t,e,i,"body"),o=fr(_r(["if (",fr(_r([kr(_r([yr,t.call(i,"test")])),yr])),")",r]));if(n.push(o,Vr(t)||!s.body?"":xr),s.alternate){n.push(s.shortForm?"":"} ");const r=Fr(s.body)&&s.body.comments.some(t=>t.trailing&&!sr.isBlockComment(t))||function(t){if(!t.comments)return!1;const e=Ir(t.comments.filter(t=>!t.leading&&!t.trailing));return e&&!sr.isBlockComment(e)}(s),o=!r;n.push(o?"":xr),Br(s)&&n.push(no(e.originalText,s.body,e)?xr:"",sr.printDanglingComments(t,e,!0),r?xr:" "),n.push("else",fr("if"===s.alternate.kind?t.call(i,"alternate"):Lo(t,e,i,"alternate")))}else n.push(s.body?s.shortForm?"endif;":"}":"");return _r(n)}case"do":return _r(["do",Lo(t,e,i,"body")," while (",fr(_r([kr(_r([yr,t.call(i,"test")])),yr])),")"]);case"while":case"switch":return fr(_r([s.kind," (",fr(_r([kr(_r([yr,t.call(i,"test")])),yr])),")",Lo(t,e,i,"body")]));case"for":{const n=Lo(t,e,i,"body"),r=sr.printDanglingComments(t,e,!0),o=r?_r([r,yr]):"";return s.init.length||s.test.length||s.increment.length?_r([o,fr(_r(["for (",fr(_r([kr(_r([yr,fr(_r([ur(_r([",",dr]),t.map(i,"init"))])),";",dr,fr(_r([ur(_r([",",dr]),t.map(i,"test"))])),";",dr,fr(ur(_r([",",dr]),t.map(i,"increment")))])),yr])),")",n]))]):_r([o,fr(_r(["for (;;)",n]))])}case"foreach":{const n=Lo(t,e,i,"body"),r=sr.printDanglingComments(t,e,!0),o=r?_r([r,yr]):"";return _r([o,fr(_r(["foreach (",fr(_r([kr(_r([yr,t.call(i,"source"),dr,"as ",fr(s.key?kr(ur(_r([" =>",dr]),[t.call(i,"key"),t.call(i,"value")])):t.call(i,"value"))])),yr])),")",n]))])}case"try":{const n=[];return n.push("try",Lo(t,e,i,"body")),s.catches&&n.push(_r(t.map(i,"catches"))),s.always&&n.push(" finally",Lo(t,e,i,"always")),_r(n)}case"catch":return _r([" catch",s.what?_r([" (",ur(" | ",t.map(i,"what")),s.variable?_r([" ",t.call(i,"variable")]):"",")"]):"",Lo(t,e,i,"body")]);case"case":return _r([s.test?_r(["case ",s.test.comments?kr(t.call(i,"test")):t.call(i,"test"),":"]):"default:",s.body&&s.body.children&&s.body.children.length?kr(_r([Vr(t)?"":xr,t.call(i,"body")])):""]);case"break":case"continue":return s.level&&("number"===s.level.kind&&"1"!==s.level.value)?_r(["".concat(s.kind," "),t.call(i,"level")]):s.kind;case"call":return 1===s.arguments.length&&Ro(s.arguments[0],e.originalText,e)?_r([t.call(i,"what"),_r(["(",ur(", ",t.map(i,"arguments")),")"])]):Gr(s.what)?function(t,e,i){const s=[];function n(t){const{originalText:i}=e,s=so(i,t,e);return")"===i.charAt(s)?Sr(i,s+1,e):no(i,t,e)}function r(t){const o=t.getValue();if("call"!==o.kind||!Gr(o.what)&&"call"!==o.what.kind)if(Gr(o)){let n=null;n="propertylookup"===o.kind?ao(t,e,i):"nullsafepropertylookup"===o.kind?co(t,e,i):"staticlookup"===o.kind?lo(t,e,i):_o(t,e,i),s.unshift({node:o,needsParens:cr(t),printed:sr.printAllComments(t,()=>n,e)}),t.call(t=>r(t),"what")}else s.unshift({node:o,printed:t.call(i)});else s.unshift({node:o,printed:_r([sr.printAllComments(t,()=>_r([To(t,e,i)]),e),n(o)?xr:""])}),t.call(t=>r(t),"what")}const o=t.getValue();s.unshift({node:o,printed:To(t,e,i)}),t.call(t=>r(t),"what");for(let t=0;t<s.length;++t)"call"===s[t].node.kind&&s[t-1]&&["propertylookup","nullsafepropertylookup","staticlookup"].includes(s[t-1].node.kind)&&s[t-1].needsParens&&(s[0].printed=_r(["(",s[0].printed]),s[t-1].printed=_r([s[t-1].printed,")"]));const h=[];let a=[s[0]],c=1;for(;c<s.length&&("call"===s[c].node.kind||Gr(s[c].node)&&s[c].node.offset&&"number"===s[c].node.offset.kind);++c)a.push(s[c]);if("call"!==s[0].node.kind)for(;c+1<s.length&&(Gr(s[c].node)&&Gr(s[c+1].node));++c)a.push(s[c]);h.push(a),a=[];let l=!1;for(;c<s.length;++c){if(l&&Gr(s[c].node)){if("offsetlookup"===s[c].node.kind&&s[c].node.offset&&"number"===s[c].node.offset.kind){a.push(s[c]);continue}h.push(a),a=[],l=!1}"call"===s[c].node.kind&&(l=!0),a.push(s[c]),s[c].node.comments&&sr.hasTrailingComment(s[c].node)&&(h.push(a),a=[],l=!1)}a.length>0&&h.push(a);function _(t){const i=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&&s(e.name))||to(e)}function s(t){return t.length<e.tabWidth}const n=Ir(t[0]).node;return Gr(n)&&("identifier"===n.offset.kind||"variable"===n.offset.kind)&&i}const u="expressionstatement"===t.getParentNode().kind,d=h.length>=2&&!h[1][0].node.comments&&_(h);function p(t){const e=[];for(let i=0;i<t.length;i++)t[i+1]&&t[i+1].needsParens?(e.push("(",t[i].printed,t[i+1].printed,")"),i++):e.push(t[i].printed);return _r(e)}function f(t){return 0===t.length?"":kr(fr(_r([xr,ur(xr,t.map(p))])))}const T=h.map(p),k=_r(T),E=d?3:2,m=h.slice(0,E).reduce((t,e)=>t.concat(e),[]),x=m.slice(1,-1).some(t=>sr.hasLeadingComment(t.node))||m.slice(0,-1).some(t=>sr.hasTrailingComment(t.node))||h[E]&&sr.hasLeadingComment(h[E][0].node),y=Zr(t,"encapsed");if(h.length<=E&&!x||y)return fr(k);const A=Ir(d?h.slice(1,2)[0]:h[0]).node,g="call"!==A.kind&&n(A),N=_r([p(h[0]),d?_r(h.slice(1,2).map(p)):"",g?xr:"",f(h.slice(d?2:1))]),C=s.filter(t=>"call"===t.node.kind).length;if(x||C>=3||T.slice(0,-1).some(Cr))return fr(N);return _r([Cr(k)||g?lr:"",Tr([k,N])])}(t,e,i):_r([t.call(i,"what"),To(t,e,i)]);case"new":{const n=s.what&&"class"===s.what.kind&&s.what.isAnonymous;if(!n&&1===s.arguments.length&&Ro(s.arguments[0],e.originalText,e))return _r(["new ",...t.call(So,"what"),t.call(i,"what"),"(",ur(", ",t.map(i,"arguments")),")"]);const r=[];if(r.push("new "),n)r.push(s.what.leadingComments&&"commentblock"===s.what.leadingComments[0].kind?_r([sr.printComments(s.what.leadingComments,e)," "]):"",...t.call(t=>So(t,e,i,{inline:!0}),"what"),"class",s.arguments.length>0?_r([" ",To(t,e,i)]):"",fr(t.call(i,"what")));else{const n=_r([t.call(i,"what"),To(t,e,i)]);r.push(Mr(s.what)?kr(n):n)}return _r(r)}case"clone":return _r(["clone ",s.what.comments?kr(t.call(i,"what")):t.call(i,"what")]);case"propertylookup":case"nullsafepropertylookup":case"staticlookup":case"offsetlookup":{const n=t.getParentNode();let r,o=0;do{r=t.getParentNode(o),o++}while(r&&Gr(r));const h=Zr(t,"encapsed")||r&&("new"===r.kind||"assign"===r.kind&&"variable"!==r.left.kind)||"offsetlookup"===s.kind||(to(s.what)||"variable"===s.what.kind)&&["identifier","variable","encapsedpart"].includes(s.offset.kind)&&n&&!Gr(n);return _r([t.call(i,"what"),h?mo(t,e,i):fr(kr(_r([yr,mo(t,e,i)])))])}case"exit":return fr(_r([s.useDie?"die":"exit","(",s.expression?Ro(s.expression,e.originalText,e)?t.call(i,"expression"):_r([kr(_r([yr,t.call(i,"expression")])),yr]):sr.printDanglingComments(t,e),")"]));case"global":return fr(_r(["global ",kr(_r([ur(_r([",",dr]),t.map(i,"items"))]))]));case"include":return _r([s.require?"require":"include",s.once?"_once":""," ",s.target.comments?kr(t.call(i,"target")):t.call(i,"target")]);case"label":return _r([t.call(i,"name"),":"]);case"goto":return _r(["goto ",t.call(i,"label")]);case"throw":return _r(["throw ",s.what.comments?kr(t.call(i,"what")):t.call(i,"what")]);case"silent":return _r(["@",t.call(i,"expr")]);case"halt":return _r([Br(s)?_r([sr.printDanglingComments(t,e,!0),xr]):"","__halt_compiler();",s.after]);case"eval":return fr(_r(["eval(",Ro(s.source,e.originalText,e)?t.call(i,"source"):_r([kr(_r([yr,t.call(i,"source")])),yr]),")"]));case"echo":{const e=t.map(t=>i(t),"expressions");let n;return 1!==e.length||s.expressions[0].comments?e.length>0&&(n=qr(s.expressions[0])||s.expressions[0].comments?kr(e[0]):Er(e[0])):[n]=e,fr(_r([s.shortForm?"":"echo ",n||"",kr(_r(e.slice(1).map(t=>_r([",",dr,t]))))]))}case"print":return _r(["print ",s.expression.comments?kr(t.call(i,"expression")):t.call(i,"expression")]);case"return":{const n=[];if(n.push("return"),s.expr){const e=t.call(i,"expr");n.push(" ",s.expr.comments?kr(e):e)}return Br(s)&&n.push(" ",sr.printDanglingComments(t,e,!0)),_r(n)}case"isset":case"unset":return fr(_r([s.kind,To(t,e,i,"variables")]));case"empty":return fr(_r(["empty(",kr(_r([yr,t.call(i,"expression")])),yr,")"]));case"variable":{const e=t.getParentNode(),n=t.getParentNode(1),r="assign"===e.kind?"":s.byref?"&":"",o="encapsedpart"===e.kind&&"simple"===e.syntax&&e.curly||n&&"offsetlookup"===e.kind&&"encapsedpart"===n.kind&&"simple"===n.syntax&&n.curly?"":"$",h=s.curly?"{":"",a=s.curly?"}":"";return _r([r,o,h,t.call(i,"name"),a])}case"constantstatement":case"classconstant":{const n=So(t,e,i),r=t.map(t=>i(t),"constants");let o;return 1!==r.length||s.constants[0].comments?r.length>0&&(o=kr(r[0])):[o]=r,fr(_r([...n,s.visibility?_r([s.visibility," "]):"","const",o?_r([" ",o]):"",kr(_r(r.slice(1).map(t=>_r([",",xr,t]))))]))}case"constant":return Oo(s.name,t.call(i,"name")," =",s.value,t.call(i,"value"),!1,e);case"static":{const e=t.map(t=>i(t),"variables"),n=s.variables.some(t=>t.defaultValue);let r;return 1!==e.length||s.variables[0].comments?e.length>0&&(r=kr(e[0])):[r]=e,fr(_r(["static",r?_r([" ",r]):"",kr(_r(e.slice(1).map(t=>_r([",",n?xr:dr,t]))))]))}case"staticvariable":return Oo(s.variable,t.call(i,"variable")," =",s.defaultValue,t.call(i,"defaultValue"),!1,e);case"list":case"array":{const n="array"===s.kind&&ro(e.phpVersion,"5.4")||"list"===s.kind&&(s.shortForm||ro(e.phpVersion,"7.1")),r=n?"[":_r([s.kind,"("]),o=n?"]":")";if(0===s.items.length)return Br(s)?fr(_r([r,sr.printDanglingComments(t,e),yr,o])):_r([r,o]);const h=Ir(s.items),a=h&&"noop"===h.kind,[c]=s.items.filter(t=>"noop"!==t.kind).sort((t,i)=>e.locStart(t)-e.locStart(i)),l=!(!c||!c.key)&&c&&Or(e.originalText,e.locStart(s),e.locStart(c));return fr(_r([r,kr(_r([yr,yo(t,e,i)])),a?",":"",mr(!a&&oo(e,"5.0")?_r([h&&Jr(h)?xr:"",","]):""),sr.printDanglingComments(t,e,!0),yr,o]),{shouldBreak:l})}case"entry":{const n=s.byRef?"&":"",r=s.unpack?"...":"";return s.key?Oo(s.key,t.call(i,"key")," =>",s.value,t.call(i,"value"),n,e):_r([n,r,t.call(i,"value")])}case"yield":{const e=_r([s.key?_r([t.call(i,"key")," => "]):"",t.call(i,"value")]);return _r(["yield",s.key||s.value?" ":"",s.value&&s.value.comments?kr(e):e])}case"yieldfrom":return _r(["yield from ",s.value.comments?kr(t.call(i,"value")):t.call(i,"value")]);case"unary":return _r([s.type,t.call(i,"what")]);case"pre":return _r([s.type+s.type,t.call(i,"what")]);case"post":return _r([t.call(i,"what"),s.type+s.type]);case"cast":return _r(["(",s.type,") ",s.expr.comments?kr(t.call(i,"expr")):t.call(i,"expr")]);case"assignref":case"assign":{const n="assignref"===s.kind;return Oo(s.left,t.call(i,"left"),_r([" ",n?"=":s.operator]),s.right,t.call(i,"right"),n,e)}case"bin":{const n=t.getParentNode(),r=t.getParentNode(1),o=s!==n.body&&("if"===n.kind||"while"===n.kind||"switch"===n.kind||"do"===n.kind),h=function t(e,i,s,n,r){let o=[];const h=e.getValue();if("bin"===h.kind){Dr(h.type,h.left.type)?o=o.concat(e.call(e=>t(e,i,s,!0,r),"left")):o.push(e.call(i,"left"));const a=Eo(h),c=_r(a?[h.type," ",e.call(i,"right")]:[h.type,dr,e.call(i,"right")]),l=e.getParentNode(),_=!(r&&["||","&&"].includes(h.type))&&$r(l)!==$r(h)&&$r(h.left)!==$r(h)&&$r(h.right)!==$r(h),u=qr(h.left)||"bin"===h.left.kind&&qr(h.left.right);o.push(u?"":" ",_?fr(c):c),n&&h.comments&&(o=sr.printAllComments(e,()=>_r(o),s))}else o.push(e.call(i));return o}(t,i,e,!1,o);if(o)return _r(h);if("unary"===n.kind||Gr(n)&&"offsetlookup"!==n.kind)return fr(_r([kr(_r([yr,_r(h)])),yr]));const a=s!==n.body&&"for"===n.kind||"retif"===n.kind&&r&&"return"!==r.kind,c=["assign","property","constant","staticvariable","entry"].includes(n.kind),l="bin"===s.left.kind&&Dr(s.type,s.left.type);if(a||Eo(s)&&!l||!Eo(s)&&c)return fr(_r(h));const _=_r(h.slice(1));return fr(_r([h.length>0?h[0]:"",kr(_)]))}case"retif":{const e=[],n=t.getParentNode();let r,o=0;do{r=t.getParentNode(o),o++}while(r&&"retif"===r.kind);const h=r||n,a="bin"===s.falseExpr.kind?kr(t.call(i,"falseExpr")):t.call(i,"falseExpr"),c=_r([s.trueExpr?dr:" ","?",s.trueExpr?_r([" ","bin"===s.trueExpr.kind?kr(t.call(i,"trueExpr")):t.call(i,"trueExpr"),dr]):"",":",s.trueExpr?_r([" ",a]):_r([ko(s.falseExpr)?" ":dr,a])]);e.push(c);const l=t=>n===h?fr(t):t,_=t.getParentNode(1),u="cast"===n.kind&&_?_:n,d=["propertylookup","nullsafepropertylookup","staticlookup"].includes(u.kind),p=t.call(i,"test");if(!s.trueExpr){const t=_r([p,"bin"===u.kind||["print","echo","return","include"].includes(h.kind)?kr(_r(e)):_r(e)]);return"call"===u.kind&&u.what===s||"unary"===u.kind||Gr(u)&&"offsetlookup"!==u.kind?fr(_r([kr(_r([yr,t])),yr])):l(t)}return l(_r(["retif"===s.test.kind?kr(p):p,kr(_r(e)),d?yr:""]))}case"boolean":return s.value?"true":"false";case"number":return wr(s.value);case"string":{if("encapsedpart"===t.getParentNode().kind){const i=t.getParentNode(1);let n=0;const r=ro(e.phpVersion,"7.3");let o=Ar;if("heredoc"===i.type){o=r?xr:Ar;const t=i.raw.split(/\r?\n/g);n=t[t.length-1].search(/\S/),-1===n&&(n=t[t.length-2].search(/\S/))}return ur(o,s.raw.split(/\r?\n/g).map((t,e)=>e>0||0===s.loc.start.column?t.substring(n):t))}const i=zr(s,e)?'"':"'";let n=s.raw;return"b"===s.raw[0]&&(n=n.slice(1)),['"',"'"].includes(n[0])&&(n=n.substr(1)),['"',"'"].includes(n[n.length-1])&&(n=n.substr(0,n.length-1)),_r(["b"===s.raw[0]?"b":"",i,ur(Ar,n.split(/\r?\n/g)),i])}case"uniontype":return fr(_r(t.map((e,s)=>_r(0===s?[t.call(i)]:["|",t.call(i)]),"types")));case"encapsedpart":{const e="simple"===s.syntax&&s.curly||"complex"===s.syntax?_r([s.curly?"$":"","{"]):"",n="simple"===s.syntax&&s.curly||"complex"===s.syntax?"}":"";return _r([e,t.call(i,"expression"),n])}case"encapsed":switch(s.type){case"string":case"shell":case"heredoc":{const n=ro(e.phpVersion,"7.3")?xr:Ar;return _r([xo(s),"heredoc"===s.type?n:"",_r(t.map(i,"value")),xo(s,{opening:!1}),"heredoc"===s.type&&Hr(t)?xr:""])}default:return"Have not implemented kind ".concat(s.type," yet.")}case"inline":return ur(Ar,s.raw.replace("___PSEUDO_INLINE_PLACEHOLDER___","").split(/\r?\n/g));case"magic":return s.value;case"nowdoc":{const i=ro(e.phpVersion,"7.3")?xr:Ar;return _r(["<<<'",s.label,"'",i,ur(i,s.value.split(/\r?\n/g)),i,s.label,Hr(t)?xr:""])}case"name":return _r(["rn"===s.resolution?"namespace\\":"",s.name]);case"literal":return t.call(i,"value");case"parentreference":return"parent";case"selfreference":return"self";case"staticreference":return"static";case"typereference":return s.name;case"nullkeyword":return"null";case"identifier":return"method"===t.getParentNode().kind&&(s.name=io(s.name)),t.call(i,"name");case"match":{const e=t.map((t,e)=>{const s=null===t.getValue().conds?"default":_r(t.map((t,e)=>fr(_r(e>0?[",",dr,i(t)]:[i(t)])),"conds")),n=t.call(i,"body");return _r(e>0?[", ",dr,s," => ",n]:[dr,s," => ",n])},"arms");return fr(_r(["match (",fr(_r([yr,kr(_r([t.call(i,"cond")])),yr])),") {",kr(_r(e))," ",yr,"}"]))}case"noop":return s.comments?sr.printComments(t.getValue().comments,e):"";case"namedargument":return _r([s.name,": ",t.call(i,"value")]);case"error":default:return"Have not implemented kind ".concat(s.kind," yet.")}}(t,e,i),r=[],o=cr(t);return o&&r.unshift("("),r.push(n),o&&r.push(")"),vr(t)&&r.push(";"),Ur(t)&&r.push(xr),_r(r)};var wo=function(t,e){if(["loc","range","raw","comments","leadingComments","trailingComments","parenthesizedExpression","parent","prev","start","end","tokens","errors","extra"].forEach(t=>{delete e[t]}),"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(/\r\n?|\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;if("number"===t.kind&&(e.value=Nn.printNumber(t.value)),["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=Nn.normalizeMagicMethodName(e.name.name)),"noop"===t.kind)return null};const Do="PHP";var Po={phpVersion:{since:"0.13.0",category:Do,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"}]},trailingCommaPHP:{since:"0.0.0",category:Do,type:"boolean",default:!0,description:"Print trailing commas wherever possible when multi-line."},braceStyle:{since:"0.10.0",category:Do,type:"choice",default:"psr-2",description:"Print one space or newline for code blocks (classes and functions).",choices:[{value:"psr-2",description:"Use PSR-2 brace style."},{value:"1tbs",description:"Use 1tbs brace style."}]}};const Uo=(t,e,i,s)=>{if("length"===i||"prototype"===i)return;if("arguments"===i||"caller"===i)return;const n=Object.getOwnPropertyDescriptor(t,i),r=Object.getOwnPropertyDescriptor(e,i);!Bo(n,r)&&s||Object.defineProperty(t,i,r)},Bo=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},Mo=(t,e)=>{const i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)},Fo=(t,e)=>"/* Wrapped ".concat(t,"*/\n").concat(e),Ho=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Go=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Vo=(t,e,i)=>{const s=""===i?"":"with ".concat(i.trim(),"() "),n=Fo.bind(null,s,e.toString());Object.defineProperty(n,"name",Go),Object.defineProperty(t,"toString",{...Ho,value:n})};var Wo=function(t,e){let{ignoreNonConfigurable:i=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{name:s}=t;for(const s of Reflect.ownKeys(e))Uo(t,e,s,i);return Mo(t,e),Vo(t,e,s),t},Qo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Yo(t){return t&&t.default||t}var jo,$o=()=>{const t={};return t.promise=new Promise((e,i)=>{t.resolve=e,t.reject=i}),t},zo=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){var i=Qo&&Qo.__awaiter||function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function o(t){try{a(s.next(t))}catch(t){r(t)}}function h(t){try{a(s.throw(t))}catch(t){r(t)}}function a(t){t.done?n(t.value):new i((function(e){e(t.value)})).then(o,h)}a((s=s.apply(t,e||[])).next())}))},s=Qo&&Qo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const n=s($o);function r(t){let e,s,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"maxAge";const h=()=>i(this,void 0,void 0,(function*(){if(void 0!==e)return;const h=h=>i(this,void 0,void 0,(function*(){r=n.default();const i=h[1][o]-Date.now();return i<=0?(t.delete(h[0]),void r.resolve()):(e=h[0],s=setTimeout(()=>{t.delete(h[0]),r&&r.resolve()},i),"function"==typeof s.unref&&s.unref(),r.promise)}));try{for(const e of t)yield h(e)}catch(t){}e=void 0})),a=()=>{e=void 0,void 0!==s&&(clearTimeout(s),s=void 0),void 0!==r&&(r.reject(void 0),r=void 0)},c=t.set.bind(t);return t.set=(i,s)=>{t.has(i)&&t.delete(i);const n=c(i,s);return e&&e===i&&a(),h(),n},h(),t}e.default=r,t.exports=r,t.exports.default=r}));(jo=zo)&&jo.__esModule&&Object.prototype.hasOwnProperty.call(jo,"default")&&jo.default;var Ko=zo;const Xo=new WeakMap,Jo=new WeakMap,qo=function(t){let{cacheKey:e,cache:i=new Map,maxAge:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"number"==typeof s&&Ko(i);const n=function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];const h=e?e(r):r[0],a=i.get(h);if(a)return a.data;const c=t.apply(this,r);return i.set(h,{data:c,maxAge:s?Date.now()+s:Number.POSITIVE_INFINITY}),c};return Wo(n,t,{ignoreNonConfigurable:!0}),Jo.set(n,i),n};qo.decorator=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e,i,s)=>{const n=e[i];if("function"!=typeof n)throw new TypeError("The decorated value must be a function");delete s.value,delete s.writable,s.get=function(){if(!Xo.has(this)){const e=qo(n,t);return Xo.set(this,e),e}return Xo.get(this)}}},qo.clear=t=>{const e=Jo.get(t);if(!e)throw new TypeError("Can't clear a function that was not memoized!");if("function"!=typeof e.clear)throw new TypeError("The cache Map can't be cleared!");e.clear()};const Zo=/@prettier|@format/,th=qo(t=>{const e=sn(t),[i]=e.children,[s]=e.comments.filter(t=>"commentblock"===t.kind);if(i&&s&&s.loc.start.line<i.loc.start.line)return s});var eh={hasPragma:function(t){if(!Zo.test(t))return!1;const e=th(t);if(e){const{value:t}=e;return Zo.test(t)}return!1},insertPragma:function(t){const e=th(t);if(e){const{start:{offset:i},end:{offset:s}}=e.loc,n=t.substring(0,i),r=t.substring(s);return"".concat(n).concat(function(t,e){let i=t.split(/\r?\n/g);if(1===i.length){const[,t]=/\/*\*\*(.*)\*\//.exec(i[0]);i=["/**"," * ".concat(t.trim())," */"]}const s=i.findIndex(t=>/@\S/.test(t))||1;return i.splice(s,0," * @format"),i.join(function(t){const e=t.indexOf("\n");return e>=0&&"\r"===t.charAt(e-1)?"\r\n":"\n"}(e))}(e.value,t)).concat(r)}const i="<?php";if(!t.startsWith(i))return t;const s=i.length,n=t.substring(0,s),r=t.substring(s);return"".concat(n,"\n/** \n * @format \n */\n").concat(r)}},ih="programming",sh="text.html.php",nh="application/x-httpd-php",rh="#4F5D95",oh=[".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"],hh=[".php",".php_cs",".php_cs.dist","Phakefile"],ah=["php"],ch=["inc"],lh={name:"PHP",type:ih,tmScope:sh,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:nh,color:rh,extensions:oh,filenames:hh,interpreters:ah,aliases:ch,languageId:272},_h=Object.freeze({__proto__:null,name:"PHP",type:ih,tmScope:sh,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:nh,color:rh,extensions:oh,filenames:hh,interpreters:ah,aliases:ch,languageId:272,default:lh}),uh="HTML+PHP",dh="markup",ph="text.html.php",fh="HTML",Th=[".phtml"],kh="application/x-httpd-php",Eh={name:uh,type:dh,tmScope:ph,group:fh,extensions:Th,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:kh,languageId:151},mh=Object.freeze({__proto__:null,name:uh,type:dh,tmScope:ph,group:fh,extensions:Th,aceMode:"php",codemirrorMode:"php",codemirrorMimeType:kh,languageId:151,default:Eh}),xh=Yo(_h),yh=Yo(mh);const{join:Ah,hardline:gh}=s.default.doc.builders,{hasPragma:Nh,insertPragma:Ch}=eh;function Sh(t,e){let{extend:i,override:s}=e;const n={};for(const e in t){n["languageId"===e?"linguistLanguageId":e]=t[e]}if(i)for(const t in i)n[t]=(n[t]||[]).concat(i[t]);for(const t in s)n[t]=s[t];return n}const Lh=[Sh(xh,{override:{parsers:["php"],vscodeLanguageIds:["php"]}}),Sh(yh,{override:{parsers:["php"],vscodeLanguageIds:["php"]}})],Oh=t=>e=>e.loc&&e.loc[t]&&e.loc[t].offset,Ih={php:{parse:sn,astFormat:"php",locStart:Oh("start"),locEnd:Oh("end"),hasPragma:Nh}};var bh={languages:Lh,printers:{php:{print:vo,insertPragma:Ch,massageAstNode:wo,getCommentChildNodes:sr.getCommentChildNodes,canAttachComment:sr.canAttachComment,isBlockComment:sr.isBlockComment,handleComments:{ownLine:sr.handleOwnLineComment,endOfLine:sr.handleEndOfLineComment,remaining:sr.handleRemainingComment},willPrintOwnComments(t){const e=t.getValue();return e&&"noop"===e.kind},printComment(t){const e=t.getValue();switch(e.kind){case"commentblock":{if(!e.value.includes("\n"))return e.value;const t=e.value.split(/\r?\n/g);return t.slice(1,t.length-1).every(t=>"*"===t.trim()[0])?Ah(gh,t.map((e,i)=>(i>0?" ":"")+(i<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"),i=t.getParentNode(),s=t.getNode();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)}}},parsers:Ih,options:Po,defaultOptions:{tabWidth:4}},Rh=bh.languages,vh=bh.printers,wh=bh.parsers,Dh=bh.options,Ph=bh.defaultOptions;t.default=bh,t.defaultOptions=Ph,t.languages=Rh,t.options=Dh,t.parsers=wh,t.printers=vh,Object.defineProperty(t,"__esModule",{value:!0})}));
|