diff --git a/index.html b/index.html
index 566549bd..74fdc533 100644
--- a/index.html
+++ b/index.html
@@ -2,9 +2,40 @@
- Title
+ Artisan Renderer
+
+
+
+
+
+
+
+
+
+
+ hello
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda at dolore eaque eos est
+ inventore magnam molestias officia, possimus quae qui quidem similique tenetur unde ut
+ voluptas, voluptates. Fuga, recusandae!
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Debitis facilis hic id modi odit
+ officia. Accusamus asperiores eaque explicabo inventore ipsam nesciunt non numquam
+ perferendis, quia reprehenderit temporibus veritatis voluptatem.
+
+
\ No newline at end of file
diff --git a/mise.toml b/mise.toml
index 1032d16d..e0ffbc08 100644
--- a/mise.toml
+++ b/mise.toml
@@ -4,21 +4,6 @@ node = "latest"
tinymist = "0.15.0"
typst = "0.15.0"
-[tasks.build]
-run = [
- "rm .typ-bundle/*",
- "typst compile main.typ .typ-bundle --format bundle --features bundle,html",
- "vite build",
-]
-sources = ["!dist", "!node_modules", "!.idea", "**/*.typ", "src/**/*"]
-
-[tasks.dev-vite]
-run = "vite dev"
-sources = ["!dist", "!node_modules", "!.idea", "**/*.typ", "src/**/*"]
-
-[tasks.dev-typ]
-run = "typst watch main.typ .typ-bundle --format bundle --features bundle,html --no-serve"
-sources = ["!dist", "!node_modules", "!.idea", "**/*.typ", "src/**/*"]
-
[tasks.dev]
-depends = ["dev-vite", "dev-typ"]
\ No newline at end of file
+run = "vite dev"
+sources = ["!dist", "!devel", "!node_modules", "!.idea", "**/*.typ", "src/**/*"]
\ No newline at end of file
diff --git a/src/beautify.esm.js b/src/beautify.esm.js
new file mode 100644
index 00000000..29780386
--- /dev/null
+++ b/src/beautify.esm.js
@@ -0,0 +1,45 @@
+/**
+ * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.
+ * Original file: /npm/js-beautify@2.0.3/js/index.js
+ *
+ * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
+ */
+var V={exports:{}},D={},I={exports:{}},G={},Q={},dt;function Y(){if(dt)return Q;dt=1;function m(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var e=new m(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},m.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},m.prototype.has_match=function(e){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(e))return!0;return!1},m.prototype.set_indent=function(e,s){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=s||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,e.__items[0]===" "&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(e){this.__items.push(e);var s=e.lastIndexOf(`
+`);s!==-1?this.__character_count=e.length-s:this.__character_count+=e.length},m.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e};function p(e,s){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),s=s||"",e.indent_level>0&&(s=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}p.prototype.get_indent_size=function(e,s){var a=this.__base_string_length;return s=s||0,e<0&&(a=0),a+=e*this.__indent_size,a+=s,a},p.prototype.get_indent_string=function(e,s){var a=this.__base_string;return s=s||0,e<0&&(e=0,a=""),s+=e*this.__indent_size,this.__ensure_cache(s),a+=this.__cache[s],a},p.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var e=this.__cache.length,s=0,a="";this.__indent_size&&e>=this.__indent_size&&(s=Math.floor(e/this.__indent_size),e-=s*this.__indent_size,a=new Array(s+1).join(this.__indent_string)),e&&(a+=new Array(e+1).join(" ")),this.__cache.push(a)};function _(e,s){this.__indent_cache=new p(e,s),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return _.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},_.prototype.get_line_number=function(){return this.__lines.length},_.prototype.get_indent_string=function(e,s){return this.__indent_cache.get_indent_string(e,s)},_.prototype.get_indent_size=function(e,s){return this.__indent_cache.get_indent_size(e,s)},_.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},_.prototype.add_new_line=function(e){return this.is_empty()||!e&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},_.prototype.get_code=function(e){this.trim(!0);var s=this.current_line.pop();s&&(s[s.length-1]===`
+`&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
+`);return e!==`
+`&&(a=a.replace(/[\n]/g,e)),a},_.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},_.prototype.set_indent=function(e,s){return e=e||0,s=s||0,this.next_line.set_indent(e,s),this.__lines.length>1?(this.current_line.set_indent(e,s),!0):(this.current_line.set_indent(),!1)},_.prototype.add_raw_token=function(e){for(var s=0;s1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},_.prototype.just_added_newline=function(){return this.current_line.is_empty()},_.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},_.prototype.ensure_empty_line_above=function(e,s){for(var a=this.__lines.length-2;a>=0;){var f=this.__lines[a];if(f.is_empty())break;if(f.item(0).indexOf(e)!==0&&f.item(-1)!==s){this.__lines.splice(a+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},Q.Output=_,Q}var Z={},gt;function mt(){if(gt)return Z;gt=1;function m(p,_,e,s){this.type=p,this.text=_,this.comments_before=null,this.newlines=e||0,this.whitespace_before=s||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}return Z.Token=m,Z}var J={},bt;function vt(){return bt||(bt=1,(function(m){var p="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",_="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",e="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",s="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",a="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",f="(?:"+a+"|["+p+e+"])",n="(?:"+a+"|["+_+e+s+"])*";m.identifier=new RegExp(f+n,"g"),m.identifierStart=new RegExp(f),m.identifierMatch=new RegExp("(?:"+a+"|["+_+e+s+"])+"),m.newline=/[\n\r\u2028\u2029]/,m.lineBreak=new RegExp(`\r
+|`+m.newline.source),m.allLineBreaks=new RegExp(m.lineBreak.source,"g")})(J)),J}var H={},W={},yt;function tt(){if(yt)return W;yt=1;function m(e,s){this.raw_options=p(e,s),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(e,s){var a=this.raw_options[e],f=s||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(f=a.concat()):typeof a=="string"&&(f=a.split(/[^a-zA-Z0-9_\/\-]+/)),f},m.prototype._get_boolean=function(e,s){var a=this.raw_options[e],f=a===void 0?!!s:!!a;return f},m.prototype._get_characters=function(e,s){var a=this.raw_options[e],f=s||"";return typeof a=="string"&&(f=a.replace(/\\r/,"\r").replace(/\\n/,`
+`).replace(/\\t/," ")),f},m.prototype._get_number=function(e,s){var a=this.raw_options[e];s=parseInt(s,10),isNaN(s)&&(s=0);var f=parseInt(a,10);return isNaN(f)&&(f=s),f},m.prototype._get_selection=function(e,s,a){var f=this._get_selection_list(e,s,a);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+e+`' can only be one of the following values:
+`+s+`
+You passed in: '`+this.raw_options[e]+"'");return f[0]},m.prototype._get_selection_list=function(e,s,a){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[s[0]],!this._is_valid_selection(a,s))throw new Error("Invalid Default Value!");var f=this._get_array(e,a);if(!this._is_valid_selection(f,s))throw new Error("Invalid Option Value: The option '"+e+`' can contain only the following values:
+`+s+`
+You passed in: '`+this.raw_options[e]+"'");return f},m.prototype._is_valid_selection=function(e,s){return e.length&&s.length&&!e.some(function(a){return s.indexOf(a)===-1})};function p(e,s){var a={};e=_(e);var f;for(f in e)f!==s&&(a[f]=e[f]);if(s&&e[s])for(f in e[s])a[f]=e[s][f];return a}function _(e){var s={},a;for(a in e){var f=a.replace(/-/g,"_");s[f]=e[a]}return s}return W.Options=m,W.normalizeOpts=_,W.mergeOpts=p,W}var wt;function xt(){if(wt)return H;wt=1;var m=tt().Options,p=["before-newline","after-newline","preserve-newline"];function _(e){m.call(this,e,"js");var s=this.raw_options.brace_style||null;s==="expand-strict"?this.raw_options.brace_style="expand":s==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var a=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var f=0;f0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position=0&&_=0&&e=_.length&&this.__input.substring(e-_.length,e).toLowerCase()===_},et.InputScanner=p,et}var K={},st={},Et;function Xt(){if(Et)return st;Et=1;function m(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}return m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position=0&&p/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}return _.prototype=new m,_.prototype._create=function(){return new _(this._input,this)},_.prototype._update=function(){this.__set_templated_pattern()},_.prototype.disable=function(e){var s=this._create();return s._disabled[e]=!0,s._update(),s},_.prototype.read_options=function(e){var s=this._create();for(var a in p)s._disabled[a]=e.templating.indexOf(a)===-1;return s._update(),s},_.prototype.exclude=function(e){var s=this._create();return s._excluded[e]=!0,s._update(),s},_.prototype.read=function(){var e="";this._match_pattern?e=this._input.read(this._starting_pattern):e=this._input.read(this._starting_pattern,this.__template_pattern);for(var s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),e+=s,s=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},_.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},_.prototype._read_template=function(){var e="",s=this._input.peek();if(s==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(e=e||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(e=e||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(e=e||this.__patterns.handlebars_comment.read(),e=e||this.__patterns.handlebars_unescaped.read(),e=e||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=e||this.__patterns.django_comment.read(),e=e||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=e||this.__patterns.smarty_comment.read(),e=e||this.__patterns.smarty_literal.read(),e=e||this.__patterns.smarty.read()));return e},ut.TemplatablePattern=_,ut}var Lt;function U(){if(Lt)return B;Lt=1;var m=it().InputScanner,p=z().Tokenizer,_=z().TOKEN,e=rt().Directives,s=vt(),a=M().Pattern,f=Nt().TemplatablePattern;function n(l,g){return g.indexOf(l)!==-1}var u={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:_.START,RAW:_.RAW,EOF:_.EOF},O=new e(/\/\*/,/\*\//),b=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,v=/[0-9]/,y=/[^\d\.]/,S=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),A=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";A=A.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),A="\\?\\.(?!\\d) "+A,A=A.replace(/ /g,"|");var N=new RegExp(A),r="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),i=r.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),o=new RegExp("^(?:"+i.join("|")+")$"),T,w=function(l,g){p.call(this,l,g),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var h=new a(this._input),x=new f(this._input).read_options(this._options);this.__patterns={template:x,identifier:x.starting_with(s.identifier).matching(s.identifierMatch),number:h.matching(b),punct:h.matching(N),comment:h.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:h.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:h.matching(//),include:h.starting_with(/#include/).until_after(s.lineBreak),shebang:h.starting_with(/#!/).until_after(s.lineBreak),xml:h.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:x.until(/['\\\n\r\u2028\u2029]/),double_quote:x.until(/["\\\n\r\u2028\u2029]/),template_text:x.until(/[`\\$]/),template_expression:x.until(/[`}\\]/)}};w.prototype=new p,w.prototype._is_comment=function(l){return l.type===u.COMMENT||l.type===u.BLOCK_COMMENT||l.type===u.UNKNOWN},w.prototype._is_opening=function(l){return l.type===u.START_BLOCK||l.type===u.START_EXPR},w.prototype._is_closing=function(l,g){return(l.type===u.END_BLOCK||l.type===u.END_EXPR)&&g&&(l.text==="]"&&g.text==="["||l.text===")"&&g.text==="("||l.text==="}"&&g.text==="{")},w.prototype._reset=function(){T=!1},w.prototype._get_next_token=function(l,g){var h=null;this._readWhitespace();var x=this._input.peek();return x===null?this._create_token(u.EOF,""):(h=h||this._read_non_javascript(x),h=h||this._read_string(x),h=h||this._read_pair(x,this._input.peek(1)),h=h||this._read_word(l),h=h||this._read_singles(x),h=h||this._read_comment(x),h=h||this._read_regexp(x,l),h=h||this._read_xml(x,l),h=h||this._read_punctuation(),h=h||this._create_token(u.UNKNOWN,this._input.next()),h)},w.prototype._read_word=function(l){var g;if(g=this.__patterns.identifier.read(),g!=="")return g=g.replace(s.allLineBreaks,`
+`),!(l.type===u.DOT||l.type===u.RESERVED&&(l.text==="set"||l.text==="get"))&&o.test(g)?(g==="in"||g==="of")&&(l.type===u.WORD||l.type===u.STRING)?this._create_token(u.OPERATOR,g):this._create_token(u.RESERVED,g):this._create_token(u.WORD,g);if(g=this.__patterns.number.read(),g!=="")return this._create_token(u.WORD,g)},w.prototype._read_singles=function(l){var g=null;return l==="("||l==="["?g=this._create_token(u.START_EXPR,l):l===")"||l==="]"?g=this._create_token(u.END_EXPR,l):l==="{"?g=this._create_token(u.START_BLOCK,l):l==="}"?g=this._create_token(u.END_BLOCK,l):l===";"?g=this._create_token(u.SEMICOLON,l):l==="."&&y.test(this._input.peek(1))?g=this._create_token(u.DOT,l):l===","&&(g=this._create_token(u.COMMA,l)),g&&this._input.next(),g},w.prototype._read_pair=function(l,g){var h=null;return l==="#"&&g==="{"&&(h=this._create_token(u.START_BLOCK,l+g)),h&&(this._input.next(),this._input.next()),h},w.prototype._read_punctuation=function(){var l=this.__patterns.punct.read();if(l!=="")return l==="="?this._create_token(u.EQUALS,l):l==="?."?this._create_token(u.DOT,l):this._create_token(u.OPERATOR,l)},w.prototype._read_non_javascript=function(l){var g="";if(l==="#"){if(this._is_first_token()&&(g=this.__patterns.shebang.read(),g))return this._create_token(u.UNKNOWN,g.trim()+`
+`);if(g=this.__patterns.include.read(),g)return this._create_token(u.UNKNOWN,g.trim()+`
+`);l=this._input.next();var h="#";if(this._input.hasNext()&&this._input.testChar(v)){do l=this._input.next(),h+=l;while(this._input.hasNext()&&l!=="#"&&l!=="=");return l==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(h+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(h+="{}",this._input.next(),this._input.next())),this._create_token(u.WORD,h)}this._input.back()}else if(l==="<"&&this._is_first_token()){if(g=this.__patterns.html_comment_start.read(),g){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)g+=this._input.next();return T=!0,this._create_token(u.COMMENT,g)}}else if(T&&l==="-"&&(g=this.__patterns.html_comment_end.read(),g))return T=!1,this._create_token(u.COMMENT,g);return null},w.prototype._read_comment=function(l){var g=null;if(l==="/"){var h="";if(this._input.peek(1)==="*"){h=this.__patterns.block_comment.read();var x=O.get_directives(h);x&&x.ignore==="start"&&(h+=O.readIgnored(this._input)),h=h.replace(s.allLineBreaks,`
+`),g=this._create_token(u.BLOCK_COMMENT,h),g.directives=x}else this._input.peek(1)==="/"&&(h=this.__patterns.comment.read(),g=this._create_token(u.COMMENT,h))}return g},w.prototype._read_string=function(l){if(l==="`"||l==="'"||l==='"'){var g=this._input.next();return this.has_char_escapes=!1,l==="`"?g+=this._read_string_recursive("`",!0,"${"):g+=this._read_string_recursive(l),this.has_char_escapes&&this._options.unescape_strings&&(g=k(g)),this._input.peek()===l&&(g+=this._input.next()),g=g.replace(s.allLineBreaks,`
+`),this._create_token(u.STRING,g)}return null},w.prototype._allow_regexp_or_xml=function(l){return l.type===u.RESERVED&&n(l.text,["return","case","throw","else","do","typeof","yield"])||l.type===u.END_EXPR&&l.text===")"&&l.opened&&l.opened.previous.type===u.RESERVED&&n(l.opened.previous.text,["if","while","for"])||n(l.type,[u.COMMENT,u.START_EXPR,u.START_BLOCK,u.START,u.END_BLOCK,u.OPERATOR,u.EQUALS,u.EOF,u.SEMICOLON,u.COMMA])},w.prototype._read_regexp=function(l,g){if(l==="/"&&this._allow_regexp_or_xml(g)){for(var h=this._input.next(),x=!1,t=!1;this._input.hasNext()&&(x||t||this._input.peek()!==l)&&!this._input.testChar(s.newline);)h+=this._input.peek(),x?x=!1:(x=this._input.peek()==="\\",this._input.peek()==="["?t=!0:this._input.peek()==="]"&&(t=!1)),this._input.next();return this._input.peek()===l&&(h+=this._input.next(),h+=this._input.read(s.identifier)),this._create_token(u.STRING,h)}return null},w.prototype._read_xml=function(l,g){if(this._options.e4x&&l==="<"&&this._allow_regexp_or_xml(g)){var h="",x=this.__patterns.xml.read_match();if(x){for(var t=x[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),c=t.indexOf("{")===0,d=0;x;){var E=!!x[1],R=x[2],L=!!x[x.length-1]||R.slice(0,8)==="![CDATA[";if(!L&&(R===t||c&&R.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(E?--d:++d),h+=x[0],d<=0)break;x=this.__patterns.xml.read_match()}return x||(h+=this._input.match(/[\s\S]*/g)[0]),h=h.replace(s.allLineBreaks,`
+`),this._create_token(u.STRING,h)}}return null};function k(l){for(var g="",h=0,x=new m(l),t=null;x.hasNext();)if(t=x.match(/([\s]|[^\\]|\\\\)+/g),t&&(g+=t[0]),x.peek()==="\\"){if(x.next(),x.peek()==="x")t=x.match(/x([0-9A-Fa-f]{2})/g);else if(x.peek()==="u")t=x.match(/u([0-9A-Fa-f]{4})/g),t||(t=x.match(/u\{([0-9A-Fa-f]+)\}/g));else{g+="\\",x.hasNext()&&(g+=x.next());continue}if(!t||(h=parseInt(t[1],16),h>126&&h<=255&&t[0].indexOf("x")===0))return l;h>=0&&h<32||h>1114111?g+="\\"+t[0]:h===34||h===39||h===92?g+="\\"+String.fromCharCode(h):g+=String.fromCharCode(h)}return g}return w.prototype._read_string_recursive=function(l,g,h){var x,t;l==="'"?t=this.__patterns.single_quote:l==='"'?t=this.__patterns.double_quote:l==="`"?t=this.__patterns.template_text:l==="}"&&(t=this.__patterns.template_expression);for(var c=t.read(),d="";this._input.hasNext();){if(d=this._input.next(),d===l||!g&&s.newline.test(d)){this._input.back();break}else d==="\\"&&this._input.hasNext()?(x=this._input.peek(),x==="x"||x==="u"?this.has_char_escapes=!0:x==="\r"&&this._input.peek(1)===`
+`&&this._input.next(),d+=this._input.next()):h&&(h==="${"&&d==="$"&&this._input.peek()==="{"&&(d+=this._input.next()),h===d&&(l==="`"?d+=this._read_string_recursive("}",g,"`"):d+=this._read_string_recursive("`",g,"${"),this._input.hasNext()&&(d+=this._input.next())));d+=t.read(),c+=d}return c},B.Tokenizer=w,B.TOKEN=u,B.positionable_operators=S.slice(),B.line_starters=r.slice(),B}var Ct;function Gt(){if(Ct)return G;Ct=1;var m=Y().Output,p=mt().Token,_=vt(),e=xt().Options,s=U().Tokenizer,a=U().line_starters,f=U().positionable_operators,n=U().TOKEN;function u(t,c){return c.indexOf(t)!==-1}function O(t){return t.replace(/^\s+/g,"")}function b(t){for(var c={},d=0;dd&&(d=t.line_indent_level));var E={mode:c,parent:t,last_token:t?t.last_token:new p(n.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:d,alignment:0,line_indent_level:t?t.line_indent_level:d,start_line_index:this._output.get_line_number(),ternary_depth:0};return E},h.prototype._reset=function(t){var c=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,c),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(i.BlockStatement);var d=new s(t,this._options);return this._tokens=d.tokenize(),t},h.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t,c=this._reset(this._source_text),d=this._options.eol;this._options.eol==="auto"&&(d=`
+`,c&&_.lineBreak.test(c||"")&&(d=c.match(_.lineBreak)[0]));for(var E=this._tokens.next();E;)this.handle_token(E),this._last_last_text=this._flags.last_token.text,this._flags.last_token=E,E=this._tokens.next();return t=this._output.get_code(d),t},h.prototype.handle_token=function(t,c){t.type===n.START_EXPR?this.handle_start_expr(t):t.type===n.END_EXPR?this.handle_end_expr(t):t.type===n.START_BLOCK?this.handle_start_block(t):t.type===n.END_BLOCK?this.handle_end_block(t):t.type===n.WORD?this.handle_word(t):t.type===n.RESERVED?this.handle_word(t):t.type===n.SEMICOLON?this.handle_semicolon(t):t.type===n.STRING?this.handle_string(t):t.type===n.EQUALS?this.handle_equals(t):t.type===n.OPERATOR?this.handle_operator(t):t.type===n.COMMA?this.handle_comma(t):t.type===n.BLOCK_COMMENT?this.handle_block_comment(t,c):t.type===n.COMMENT?this.handle_comment(t,c):t.type===n.DOT?this.handle_dot(t):t.type===n.EOF?this.handle_eof(t):t.type===n.UNKNOWN?this.handle_unknown(t,c):this.handle_unknown(t,c)},h.prototype.handle_whitespace_and_comments=function(t,c){var d=t.newlines,E=this._options.keep_array_indentation&&w(this._flags.mode);if(t.comments_before)for(var R=t.comments_before.next();R;)this.handle_whitespace_and_comments(R,c),this.handle_token(R,c),R=t.comments_before.next();if(E)for(var L=0;L0,c);else if(this._options.max_preserve_newlines&&d>this._options.max_preserve_newlines&&(d=this._options.max_preserve_newlines),this._options.preserve_newlines&&d>1){this.print_newline(!1,c);for(var C=1;C0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},h.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},h.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===i.Statement&&o(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},h.prototype.start_of_object_property=function(){return this._flags.parent.mode===i.ObjectLiteral&&this._flags.mode===i.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||y(this._flags.last_token,["get","set"]))},h.prototype.start_of_statement=function(t){var c=!1;return c=c||y(this._flags.last_token,["var","let","const"])&&t.type===n.WORD,c=c||v(this._flags.last_token,"do"),c=c||!(this._flags.parent.mode===i.ObjectLiteral&&this._flags.mode===i.Statement)&&y(this._flags.last_token,x)&&!t.newlines,c=c||v(this._flags.last_token,"else")&&!(v(t,"if")&&!t.comments_before),c=c||this._flags.last_token.type===n.END_EXPR&&(this._previous_flags.mode===i.ForInitializer||this._previous_flags.mode===i.Conditional),c=c||this._flags.last_token.type===n.WORD&&this._flags.mode===i.BlockStatement&&!this._flags.in_case&&!(t.text==="--"||t.text==="++")&&this._last_last_text!=="function"&&t.type!==n.WORD&&t.type!==n.RESERVED,c=c||this._flags.mode===i.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||y(this._flags.last_token,["get","set"])),c?(this.set_mode(i.Statement),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,y(t,["do","for","if","while"])),!0):!1},h.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var c=i.Expression;if(t.text==="["){if(this._flags.last_token.type===n.WORD||this._flags.last_token.text===")"){y(this._flags.last_token,a)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(c),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}c=i.ArrayLiteral,w(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),u(this._flags.last_token.type,[n.START_EXPR,n.END_EXPR,n.WORD,n.OPERATOR,n.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===n.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,c=i.ForInitializer):u(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,c=i.Conditional):u(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&t.whitespace_before===""?this._output.space_before_token=!1:(u(this._flags.last_token.text,a)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===n.WORD){this._output.space_before_token=!1;var d=this._tokens.peek(-3);if(this._options.space_after_named_function&&d){var E=this._tokens.peek(-4);y(d,["async","function"])||d.text==="*"&&y(E,["async","function"])?this._output.space_before_token=!0:this._flags.mode===i.ObjectLiteral?(d.text==="{"||d.text===","||d.text==="*"&&(E.text==="{"||E.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===n.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(u(this._last_last_text,["function","yield"])||this._flags.mode===i.ObjectLiteral&&u(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===n.START_BLOCK?this.print_newline():(this._flags.last_token.type===n.END_EXPR||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===n.COMMA)&&this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(c),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},h.prototype.handle_end_expr=function(t){for(;this._flags.mode===i.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,t.text==="]"&&w(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===n.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(t),this.restore_mode(),o(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===i.Conditional&&(this._previous_flags.mode=i.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},h.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var c=this._tokens.peek(),d=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===n.END_EXPR?(this.set_mode(i.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(i.BlockStatement):d&&(u(d.text,[":",","])&&u(c.type,[n.STRING,n.WORD,n.RESERVED])||u(c.text,["get","set","..."])&&u(d.type,[n.WORD,n.RESERVED]))?u(this._last_last_text,["class","interface"])&&!u(d.text,[":",","])?this.set_mode(i.BlockStatement):this.set_mode(i.ObjectLiteral):this._flags.last_token.type===n.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(i.BlockStatement):u(this._flags.last_token.type,[n.EQUALS,n.START_EXPR,n.COMMA,n.OPERATOR])||y(this._flags.last_token,["return","throw","import","default"])?this.set_mode(i.ObjectLiteral):this.set_mode(i.BlockStatement),this._flags.last_token&&y(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var E=!c.comments_before&&c.text==="}",R=E&&this._flags.last_word==="function"&&this._flags.last_token.type===n.END_EXPR;if(this._options.brace_preserve_inline){var L=0,C=null;this._flags.inline_frame=!0;do if(L+=1,C=this._tokens.peek(L-1),C.newlines){this._flags.inline_frame=!1;break}while(C.type!==n.EOF&&!(C.type===n.END_BLOCK&&C.opened===t))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==n.OPERATOR&&(R||this._flags.last_token.type===n.EQUALS||y(this._flags.last_token,S)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(w(this._previous_flags.mode)&&(this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.COMMA)&&((this._flags.last_token.type===n.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==n.OPERATOR&&this._flags.last_token.type!==n.START_EXPR&&(u(this._flags.last_token.type,[n.START_BLOCK,n.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(t),this.indent(),!E&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},h.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===i.Statement;)this.restore_mode();var c=this._flags.last_token.type===n.START_BLOCK;this._flags.inline_frame&&!c?this._output.space_before_token=!0:this._options.brace_style==="expand"?c||this.print_newline():c||(w(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},h.prototype.handle_word=function(t){if(t.type===n.RESERVED){if(u(t.text,["set","get"])&&this._flags.mode!==i.ObjectLiteral)t.type=n.WORD;else if(t.text==="import"&&u(this._tokens.peek().text,["(","."]))t.type=n.WORD;else if(u(t.text,["as","from"])&&!this._flags.import_block)t.type=n.WORD;else if(this._flags.mode===i.ObjectLiteral){var c=this._tokens.peek();c.text===":"&&(t.type=n.WORD)}}if(this.start_of_statement(t)?y(this._flags.last_token,["var","let","const"])&&t.type===n.WORD&&(this._flags.declaration_statement=!0):t.newlines&&!k(this._flags.mode)&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==n.EQUALS&&(this._options.preserve_newlines||!y(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(t),this.print_newline()):this.handle_whitespace_and_comments(t),this._flags.do_block&&!this._flags.do_while)if(v(t,"while")){this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&v(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===i.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&y(t,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),this._flags.in_case=!0;return}if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)&&!this.start_of_object_property()&&!(u(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===i.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(t),v(t,"function")){(u(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(u(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===n.OPERATOR))&&!this._output.just_added_blankline()&&!t.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD?y(this._flags.last_token,["get","set","new","export"])||y(this._flags.last_token,x)?this._output.space_before_token=!0:v(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===n.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(k(this._flags.mode)||w(this._flags.mode))||this.print_newline(),this.print_token(t),this._flags.last_word=t.text;return}var d="NONE";if(this._flags.last_token.type===n.END_BLOCK?this._previous_flags.inline_frame?d="SPACE":y(t,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&t.newlines?d="NEWLINE":(d="SPACE",this._output.space_before_token=!0):d="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&this._flags.mode===i.BlockStatement?d="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&k(this._flags.mode)?d="SPACE":this._flags.last_token.type===n.STRING?d="NEWLINE":this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.last_token.text==="*"&&(u(this._last_last_text,["function","yield"])||this._flags.mode===i.ObjectLiteral&&u(this._last_last_text,["{",","]))?d="SPACE":this._flags.last_token.type===n.START_BLOCK?this._flags.inline_frame?d="SPACE":d="NEWLINE":this._flags.last_token.type===n.END_EXPR&&(this._output.space_before_token=!0,d="NEWLINE"),y(t,a)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?d="SPACE":d="NEWLINE"),y(t,["else","catch","finally"]))if((!(this._flags.last_token.type===n.END_BLOCK&&this._previous_flags.mode===i.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&t.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var E=this._output.current_line;E.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else d==="NEWLINE"?y(this._flags.last_token,S)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&y(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==n.END_EXPR?(this._flags.last_token.type!==n.START_EXPR||!y(t,["var","let","const"]))&&this._flags.last_token.text!==":"&&(v(t,"if")&&v(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):y(t,a)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&w(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():d==="SPACE"&&(this._output.space_before_token=!0);t.previous&&(t.previous.type===n.WORD||t.previous.type===n.RESERVED)&&(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===n.RESERVED&&(t.text==="do"?this._flags.do_block=!0:t.text==="if"?this._flags.if_block=!0:t.text==="import"?this._flags.import_block=!0:this._flags.import_block&&v(t,"from")&&(this._flags.import_block=!1))},h.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var c=this._tokens.peek();this._flags.mode===i.Statement&&!(this._flags.if_block&&v(c,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},h.prototype.handle_string=function(t){t.text.startsWith("`")&&t.newlines===0&&t.whitespace_before===""&&(t.previous.text===")"||this._flags.last_token.type===n.WORD)||(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):t.text.startsWith("`")&&this._flags.last_token.type===n.END_EXPR&&(t.previous.text==="]"||t.previous.text===")")&&t.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(t)},h.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},h.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(k(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===i.ObjectLiteral||this._flags.mode===i.Statement&&this._flags.parent.mode===i.ObjectLiteral?(this._flags.mode===i.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},h.prototype.handle_operator=function(t){var c=t.text==="*"&&(y(this._flags.last_token,["function","yield"])||u(this._flags.last_token.type,[n.START_BLOCK,n.COMMA,n.END_BLOCK,n.SEMICOLON])),d=u(t.text,["-","+"])&&(u(this._flags.last_token.type,[n.START_BLOCK,n.START_EXPR,n.EQUALS,n.OPERATOR])||u(this._flags.last_token.text,a)||this._flags.last_token.text===",");if(!this.start_of_statement(t)){var E=!c;this.handle_whitespace_and_comments(t,E)}if(t.text==="*"&&this._flags.last_token.type===n.DOT){this.print_token(t);return}if(t.text==="::"){this.print_token(t);return}if(u(t.text,["-","+"])&&this.start_of_object_property()){this.print_token(t);return}if(this._flags.last_token.type===n.OPERATOR&&u(this._options.operator_position,r)&&this.allow_wrap_or_preserved_newline(t),t.text===":"&&this._flags.in_case){this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==n.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var R=!0,L=!0,C=!1;if(t.text===":"?this._flags.ternary_depth===0?R=!1:(this._flags.ternary_depth-=1,C=!0):t.text==="?"&&(this._flags.ternary_depth+=1),!d&&!c&&this._options.preserve_newlines&&u(t.text,f)){var P=t.text===":",j=P&&C,X=P&&!C;switch(this._options.operator_position){case N.before_newline:this._output.space_before_token=!X,this.print_token(t),(!P||j)&&this.allow_wrap_or_preserved_newline(t),this._output.space_before_token=!0;return;case N.after_newline:this._output.space_before_token=!0,!P||j?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),this._output.space_before_token=!0;return;case N.preserve_newline:X||this.allow_wrap_or_preserved_newline(t),R=!(this._output.just_added_newline()||X),this._output.space_before_token=R,this.print_token(t),this._output.space_before_token=!0;return}}if(c){this.allow_wrap_or_preserved_newline(t),R=!1;var ft=this._tokens.peek();L=ft&&u(ft.type,[n.WORD,n.RESERVED])}else if(t.text==="...")this.allow_wrap_or_preserved_newline(t),R=this._flags.last_token.type===n.START_BLOCK,L=!1;else if(u(t.text,["--","++","!","~"])||d){if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR)&&this.allow_wrap_or_preserved_newline(t),R=!1,L=!1,t.newlines&&(t.text==="--"||t.text==="++"||t.text==="~")){var ct=y(this._flags.last_token,S)&&t.newlines;ct&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ct,!0)}this._flags.last_token.text===";"&&k(this._flags.mode)&&(R=!0),this._flags.last_token.type===n.RESERVED?R=!0:this._flags.last_token.type===n.END_EXPR?R=!(this._flags.last_token.text==="]"&&(t.text==="--"||t.text==="++")):this._flags.last_token.type===n.OPERATOR&&(R=u(t.text,["--","-","++","+"])&&u(this._flags.last_token.text,["--","-","++","+"]),u(t.text,["+","-"])&&u(this._flags.last_token.text,["--","++"])&&(L=!0)),(this._flags.mode===i.BlockStatement&&!this._flags.inline_frame||this._flags.mode===i.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||R,this.print_token(t),this._output.space_before_token=L},h.prototype.handle_block_comment=function(t,c){if(this._output.raw){this._output.add_raw_token(t),t.directives&&t.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(t.directives){this.print_newline(!1,c),this.print_token(t),t.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!_.newline.test(t.text)&&!t.newlines){this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0;return}else this.print_block_commment(t,c)},h.prototype.print_block_commment=function(t,c){var d=T(t.text),E,R=!1,L=!1,C=t.whitespace_before,P=C.length;if(this.print_newline(!1,c),this.print_token_line_indentation(t),this._output.add_token(d[0]),this.print_newline(!1,c),d.length>1){for(d=d.slice(1),R=l(d,"*"),L=g(d,C),R&&(this._flags.alignment=1),E=0;E0&&this._indentLevel--},v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y=this._source_text,S=this._options.eol;S==="auto"&&(S=`
+`,y&&a.test(y||"")&&(S=y.match(a)[0])),y=y.replace(f,`
+`);var A=y.match(/^[\t ]*/)[0];this._output=new p(this._options,A),this._input=new _(y),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var N=0,r=!1,i=!1,o=!1,T=!1,w=!1,k=this._ch,l=!1,g,h,x;g=this._input.read(u),h=g!=="",x=k,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),k=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var t=this._input.read(O),c=s.get_directives(t);c&&c.ignore==="start"&&(t+=s.readIgnored(this._input)),this.print_string(t),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(b)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(h),this.print_string(this._ch);var d=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);d.match(/[ :]$/)&&(d=this.eatString(": ").replace(/\s+$/,""),this.print_string(d),this._output.space_before_token=!0),N===0&&d.indexOf(":")!==-1&&(i=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(h),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var E=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);E.match(/[ :]$/)&&(E=this.eatString(": ").replace(/\s+$/,""),this.print_string(E),this._output.space_before_token=!0),N===0&&E.indexOf(":")!==-1?(i=!0,this.indent()):E in this.NESTED_AT_RULE?(this._nestedLevel+=1,E in this.CONDITIONAL_GROUP_RULE&&(o=!0)):N===0&&!i&&(T=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(h),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")i&&(i=!1,this.outdent()),T=!1,o?(o=!1,r=this._indentLevel>=this._nestedLevel):r=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&r&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(x==="("?this._output.space_before_token=!1:x!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),x==="{"&&this._output.trim(!0),i&&(this.outdent(),i=!1),this.print_string(this._ch),r=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var R=0;R"||this._ch==="+"||this._ch==="~")&&!i&&N===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&n.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(h),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),n.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var P=x==='"'||x==="'";this.preserveSingleSpace(P||h),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
+`&&l&&this._output.add_new_line()}var j=this._output.get_code(S);return j},ot.Beautifier=v,ot}var jt;function Zt(){if(jt)return q.exports;jt=1;var m=Yt().Beautifier,p=Dt().Options;function _(e,s){var a=new m(e,s);return a.beautify()}return q.exports=_,q.exports.defaultOptions=function(){return new p},q.exports}var F={exports:{}},lt={},pt={},It;function Kt(){if(It)return pt;It=1;var m=tt().Options;function p(_){m.call(this,_,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return p.prototype=new m,pt.Options=p,pt}var $={},Mt;function zt(){if(Mt)return $;Mt=1;var m=z().Tokenizer,p=z().TOKEN,_=rt().Directives,e=Nt().TemplatablePattern,s=M().Pattern,a={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:p.START,RAW:p.RAW,EOF:p.EOF},f=new _(/<\!--/,/-->/),n=function(u,O){m.call(this,u,O),this._current_tag_name="";var b=new e(this._input).read_options(this._options),v=new s(this._input);if(this.__patterns={word:b.until(/[\n\r\t <]/),word_control_flow_close_excluded:b.until(/[\n\r\t <}]/),single_quote:b.until_after(/'/),double_quote:b.until_after(/"/),attribute:b.until(/[\n\r\t =>]|\/>/),element_name:b.until(/[\n\r\t >\/]/),angular_control_flow_start:v.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:v.starting_with(/{{!--/).until_after(/--}}/),handlebars:v.starting_with(/{{/).until_after(/}}/),handlebars_open:v.until(/[\n\r\t }]/),handlebars_raw_close:v.until(/}}/),comment:v.starting_with(//),cdata:v.starting_with(//),conditional_comment:v.starting_with(//),processing:v.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var y=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=v.matching(y).until_after(y)}};return n.prototype=new m,n.prototype._is_comment=function(u){return!1},n.prototype._is_opening=function(u){return u.type===a.TAG_OPEN||u.type===a.CONTROL_FLOW_OPEN},n.prototype._is_closing=function(u,O){return u.type===a.TAG_CLOSE&&O&&((u.text===">"||u.text==="/>")&&O.text[0]==="<"||u.text==="}}"&&O.text[0]==="{"&&O.text[1]==="{")||u.type===a.CONTROL_FLOW_CLOSE&&u.text==="}"&&O.text.endsWith("{")},n.prototype._reset=function(){this._current_tag_name=""},n.prototype._get_next_token=function(u,O){var b=null;this._readWhitespace();var v=this._input.peek();return v===null?this._create_token(a.EOF,""):(b=b||this._read_open_handlebars(v,O),b=b||this._read_attribute(v,u,O),b=b||this._read_close(v,O),b=b||this._read_script_and_style(v,u),b=b||this._read_control_flows(v,O),b=b||this._read_raw_content(v,u,O),b=b||this._read_content_word(v,O),b=b||this._read_comment_or_cdata(v),b=b||this._read_processing(v),b=b||this._read_open(v,O),b=b||this._create_token(a.UNKNOWN,this._input.next()),b)},n.prototype._read_comment_or_cdata=function(u){var O=null,b=null,v=null;if(u==="<"){var y=this._input.peek(1);y==="!"&&(b=this.__patterns.comment.read(),b?(v=f.get_directives(b),v&&v.ignore==="start"&&(b+=f.readIgnored(this._input))):b=this.__patterns.cdata.read()),b&&(O=this._create_token(a.COMMENT,b),O.directives=v)}return O},n.prototype._read_processing=function(u){var O=null,b=null,v=null;if(u==="<"){var y=this._input.peek(1);(y==="!"||y==="?")&&(b=this.__patterns.conditional_comment.read(),b=b||this.__patterns.processing.read()),b&&(O=this._create_token(a.COMMENT,b),O.directives=v)}return O},n.prototype._read_open=function(u,O){var b=null,v=null;return(!O||O.type===a.CONTROL_FLOW_OPEN)&&u==="<"&&(b=this._input.next(),this._input.peek()==="/"&&(b+=this._input.next()),b+=this.__patterns.element_name.read(),v=this._create_token(a.TAG_OPEN,b)),v},n.prototype._read_open_handlebars=function(u,O){var b=null,v=null;return(!O||O.type===a.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&u==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(b=this.__patterns.handlebars_comment.read(),b=b||this.__patterns.handlebars.read(),v=this._create_token(a.COMMENT,b)):(b=this.__patterns.handlebars_open.read(),v=this._create_token(a.TAG_OPEN,b))),v},n.prototype._read_control_flows=function(u,O){var b="",v=null;if(!this._options.templating.includes("angular"))return v;if(u==="@"){if(b=this.__patterns.angular_control_flow_start.read(),b==="")return v;for(var y=b.endsWith("(")?1:0,S=0;!(b.endsWith("{")&&y===S);){var A=this._input.next();if(A===null)break;A==="("?y++:A===")"&&S++,b+=A}v=this._create_token(a.CONTROL_FLOW_OPEN,b)}else u==="}"&&O&&O.type===a.CONTROL_FLOW_OPEN&&(b=this._input.next(),v=this._create_token(a.CONTROL_FLOW_CLOSE,b));return v},n.prototype._read_close=function(u,O){var b=null,v=null;return O&&O.type===a.TAG_OPEN&&(O.text[0]==="<"&&(u===">"||u==="/"&&this._input.peek(1)===">")?(b=this._input.next(),u==="/"&&(b+=this._input.next()),v=this._create_token(a.TAG_CLOSE,b)):O.text[0]==="{"&&u==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),v=this._create_token(a.TAG_CLOSE,"}}"))),v},n.prototype._read_attribute=function(u,O,b){var v=null,y="";if(b&&b.text[0]==="<")if(u==="=")v=this._create_token(a.EQUALS,this._input.next());else if(u==='"'||u==="'"){var S=this._input.next();u==='"'?S+=this.__patterns.double_quote.read():S+=this.__patterns.single_quote.read(),v=this._create_token(a.VALUE,S)}else y=this.__patterns.attribute.read(),y&&(O.type===a.EQUALS?v=this._create_token(a.VALUE,y):v=this._create_token(a.ATTRIBUTE,y));return v},n.prototype._is_content_unformatted=function(u){return this._options.void_elements.indexOf(u)===-1&&(this._options.content_unformatted.indexOf(u)!==-1||this._options.unformatted.indexOf(u)!==-1)},n.prototype._read_raw_content=function(u,O,b){var v="";if(b&&b.text[0]==="{")v=this.__patterns.handlebars_raw_close.read();else if(O.type===a.TAG_CLOSE&&O.opened.text[0]==="<"&&O.text[0]!=="/"){var y=O.opened.text.substr(1).toLowerCase();this._is_content_unformatted(y)&&(v=this._input.readUntil(new RegExp(""+y+"[\\n\\r\\t ]*?>","ig")))}return v?this._create_token(a.TEXT,v):null},n.prototype._read_script_and_style=function(u,O){if(O.type===a.TAG_CLOSE&&O.opened.text[0]==="<"&&O.text[0]!=="/"){var b=O.opened.text.substr(1).toLowerCase();if(b==="script"||b==="style"){var v=this._read_comment_or_cdata(u);if(v)return v.type=a.TEXT,v;var y=this._input.readUntil(new RegExp(""+b+"[\\n\\r\\t ]*?>","ig"));if(y)return this._create_token(a.TEXT,y)}}return null},n.prototype._read_content_word=function(u,O){var b="";return this._options.unformatted_content_delimiter&&u===this._options.unformatted_content_delimiter[0]&&(b=this.__patterns.unformatted_content_delimiter.read()),b||(b=O&&O.type===a.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),b?this._create_token(a.TEXT,b):null},$.Tokenizer=n,$.TOKEN=a,$}var Ut;function Jt(){if(Ut)return lt;Ut=1;var m=Kt().Options,p=Y().Output,_=zt().Tokenizer,e=zt().TOKEN,s=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,f=function(r,i){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=r.max_preserve_newlines,this.preserve_newlines=r.preserve_newlines,this._output=new p(r,i)};f.prototype.current_line_has_match=function(r){return this._output.current_line.has_match(r)},f.prototype.set_space_before_token=function(r,i){this._output.space_before_token=r,this._output.non_breaking_space=i},f.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},f.prototype.add_raw_token=function(r){this._output.add_raw_token(r)},f.prototype.print_preserved_newlines=function(r){var i=0;r.type!==e.TEXT&&r.previous.type!==e.TEXT&&(i=r.newlines?1:0),this.preserve_newlines&&(i=r.newlines0);return i!==0},f.prototype.traverse_whitespace=function(r){return r.whitespace_before||r.newlines?(this.print_preserved_newlines(r)||(this._output.space_before_token=!0),!0):!1},f.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},f.prototype.print_newline=function(r){this._output.add_new_line(r)},f.prototype.print_token=function(r){r.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(r.text))},f.prototype.indent=function(){this.indent_level++},f.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},f.prototype.get_full_indent=function(r){return r=this.indent_level+(r||0),r<1?"":this._output.get_indent_string(r)};var n=function(r){for(var i=null,o=r.next;o.type!==e.EOF&&r.closed!==o;){if(o.type===e.ATTRIBUTE&&o.text==="type"){o.next&&o.next.type===e.EQUALS&&o.next.next&&o.next.next.type===e.VALUE&&(i=o.next.next.text);break}o=o.next}return i},u=function(r,i){var o=null,T=null;return i.closed?(r==="script"?o="text/javascript":r==="style"&&(o="text/css"),o=n(i)||o,o.search("text/css")>-1?T="css":o.search(/module|importmap|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?T="javascript":o.search(/(text|application|dojo)\/(x-)?(html)/)>-1?T="html":o.search(/test\/null/)>-1&&(T="null"),T):null};function O(r,i){return i.indexOf(r)!==-1}function b(r,i,o){this.parent=r||null,this.tag=i?i.tag_name:"",this.indent_level=o||0,this.parser_token=i||null}function v(r){this._printer=r,this._current_frame=null}v.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},v.prototype.record_tag=function(r){var i=new b(this._current_frame,r,this._printer.indent_level);this._current_frame=i},v.prototype._try_pop_frame=function(r){var i=null;return r&&(i=r.parser_token,this._printer.indent_level=r.indent_level,this._current_frame=r.parent),i},v.prototype._get_frame=function(r,i){for(var o=this._current_frame;o&&r.indexOf(o.tag)===-1;){if(i&&i.indexOf(o.tag)!==-1){o=null;break}o=o.parent}return o},v.prototype.try_pop=function(r,i){var o=this._get_frame([r],i);return this._try_pop_frame(o)},v.prototype.indent_to_tag=function(r){var i=this._get_frame(r);i&&(this._printer.indent_level=i.indent_level)};function y(r,i,o,T){this._source_text=r||"",i=i||{},this._js_beautify=o,this._css_beautify=T,this._tag_stack=null;var w=new m(i,"html");this._options=w,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var r=this._source_text,i=this._options.eol;this._options.eol==="auto"&&(i=`
+`,r&&s.test(r)&&(i=r.match(s)[0])),r=r.replace(a,`
+`);var o=r.match(/^[\t ]*/)[0],T={text:"",type:""},w=new S(this._options),k=new f(this._options,o),l=new _(r,this._options).tokenize();this._tag_stack=new v(k);for(var g=null,h=l.next();h.type!==e.EOF;)h.type===e.TAG_OPEN||h.type===e.COMMENT?(g=this._handle_tag_open(k,h,w,T,l),w=g):h.type===e.ATTRIBUTE||h.type===e.EQUALS||h.type===e.VALUE||h.type===e.TEXT&&!w.tag_complete?g=this._handle_inside_tag(k,h,w,T):h.type===e.TAG_CLOSE?g=this._handle_tag_close(k,h,w):h.type===e.TEXT?g=this._handle_text(k,h,w):h.type===e.CONTROL_FLOW_OPEN?g=this._handle_control_flow_open(k,h):h.type===e.CONTROL_FLOW_CLOSE?g=this._handle_control_flow_close(k,h):k.add_raw_token(h),T=g,h=l.next();var x=k._output.get_code(i);return x},y.prototype._handle_control_flow_open=function(r,i){var o={text:i.text,type:i.type};return r.set_space_before_token(i.newlines||i.whitespace_before!=="",!0),i.newlines?r.print_preserved_newlines(i):r.set_space_before_token(i.newlines||i.whitespace_before!=="",!0),r.print_token(i),r.indent(),o},y.prototype._handle_control_flow_close=function(r,i){var o={text:i.text,type:i.type};return r.deindent(),i.newlines?r.print_preserved_newlines(i):r.set_space_before_token(i.newlines||i.whitespace_before!=="",!0),r.print_token(i),o},y.prototype._handle_tag_close=function(r,i,o){var T={text:i.text,type:i.type};return r.alignment_size=0,o.tag_complete=!0,r.set_space_before_token(i.newlines||i.whitespace_before!=="",!0),o.is_unformatted?r.add_raw_token(i):(o.tag_start_char==="<"&&(r.set_space_before_token(i.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&o.has_wrapped_attrs&&r.print_newline(!1)),r.print_token(i)),o.indent_content&&!(o.is_unformatted||o.is_content_unformatted)&&(r.indent(),o.indent_content=!1),!o.is_inline_element&&!(o.is_unformatted||o.is_content_unformatted)&&r.set_wrap_point(),T},y.prototype._handle_inside_tag=function(r,i,o,T){var w=o.has_wrapped_attrs,k={text:i.text,type:i.type};return r.set_space_before_token(i.newlines||i.whitespace_before!=="",!0),o.is_unformatted?r.add_raw_token(i):o.tag_start_char==="{"&&i.type===e.TEXT?r.print_preserved_newlines(i)?(i.newlines=0,r.add_raw_token(i)):r.print_token(i):(i.type===e.ATTRIBUTE?r.set_space_before_token(!0):(i.type===e.EQUALS||i.type===e.VALUE&&i.previous.type===e.EQUALS)&&r.set_space_before_token(!1),i.type===e.ATTRIBUTE&&o.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(r.traverse_whitespace(i),w=w||i.newlines!==0),this._is_wrap_attributes_force&&o.attr_count>=this._options.wrap_attributes_min_attrs&&(T.type!==e.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(r.print_newline(!1),w=!0)),r.print_token(i),w=w||r.previous_token_wrapped(),o.has_wrapped_attrs=w),k},y.prototype._handle_text=function(r,i,o){var T={text:i.text,type:"TK_CONTENT"};return o.custom_beautifier_name?this._print_custom_beatifier_text(r,i,o):o.is_unformatted||o.is_content_unformatted?r.add_raw_token(i):(r.traverse_whitespace(i),r.print_token(i)),T},y.prototype._print_custom_beatifier_text=function(r,i,o){var T=this;if(i.text!==""){var w=i.text,k,l=1,g="",h="";o.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?k=this._js_beautify:o.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?k=this._css_beautify:o.custom_beautifier_name==="html"&&(k=function(R,L){var C=new y(R,L,T._js_beautify,T._css_beautify);return C.beautify()}),this._options.indent_scripts==="keep"?l=0:this._options.indent_scripts==="separate"&&(l=-r.indent_level);var x=r.get_full_indent(l);if(w=w.replace(/\n[ \t]*$/,""),o.custom_beautifier_name!=="html"&&w[0]==="<"&&w.match(/^(|]]>)$/.exec(w);if(!t){r.add_raw_token(i);return}g=x+t[1]+`
+`,w=t[4],t[5]&&(h=x+t[5]),w=w.replace(/\n[ \t]*$/,""),(t[2]||t[3].indexOf(`
+`)!==-1)&&(t=t[3].match(/[ \t]+$/),t&&(i.whitespace_before=t[0]))}if(w)if(k){var c=function(){this.eol=`
+`};c.prototype=this._options.raw_options;var d=new c;w=k(x+w,d)}else{var E=i.whitespace_before;E&&(w=w.replace(new RegExp(`
+(`+E+")?","g"),`
+`)),w=x+w.replace(/\n/g,`
+`+x)}g&&(w?w=g+w+`
+`+h:w=g+h),r.print_newline(!1),w&&(i.text=w,i.whitespace_before="",i.newlines=0,r.add_raw_token(i),r.print_newline(!0))}},y.prototype._handle_tag_open=function(r,i,o,T,w){var k=this._get_tag_open_token(i);if((o.is_unformatted||o.is_content_unformatted)&&!o.is_empty_element&&i.type===e.TAG_OPEN&&!k.is_start_tag?(r.add_raw_token(i),k.start_tag_token=this._tag_stack.try_pop(k.tag_name)):(r.traverse_whitespace(i),this._set_tag_position(r,i,k,o,T),k.is_inline_element||r.set_wrap_point(),r.print_token(i)),k.is_start_tag&&this._is_wrap_attributes_force){var l=0,g;do g=w.peek(l),g.type===e.ATTRIBUTE&&(k.attr_count+=1),l+=1;while(g.type!==e.EOF&&g.type!==e.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(k.alignment_size=i.text.length+1),!k.tag_complete&&!k.is_unformatted&&(r.alignment_size=k.alignment_size),k};var S=function(r,i,o){if(this.parent=i||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!o)this.tag_complete=!0;else{var T;this.tag_start_char=o.text[0],this.text=o.text,this.tag_start_char==="<"?(T=o.text.match(/^<([^\s>]*)/),this.tag_check=T?T[1]:""):(T=o.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=T?T[1]:"",(o.text.startsWith("{{#>")||o.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&o.next!==null?this.tag_check=o.next.text.split(" ")[0]:this.tag_check=o.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),o.type===e.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||o.closed&&o.closed.text==="/>";var w=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(w=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!r.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(w)))}};y.prototype._get_tag_open_token=function(r){var i=new S(this._options,this._tag_stack.get_parser_token(),r);return i.alignment_size=this._options.wrap_attributes_indent_size,i.is_end_tag=i.is_end_tag||O(i.tag_check,this._options.void_elements),i.is_empty_element=i.tag_complete||i.is_start_tag&&i.is_end_tag,i.is_unformatted=!i.tag_complete&&O(i.tag_check,this._options.unformatted),i.is_content_unformatted=!i.is_empty_element&&O(i.tag_check,this._options.content_unformatted),i.is_inline_element=O(i.tag_name,this._options.inline)||this._options.inline_custom_elements&&i.tag_name.includes("-")||i.tag_start_char==="{",i},y.prototype._set_tag_position=function(r,i,o,T,w){if(o.is_empty_element||(o.is_end_tag?o.start_tag_token=this._tag_stack.try_pop(o.tag_name):(this._do_optional_end_element(o)&&(o.is_inline_element||r.print_newline(!1)),this._tag_stack.record_tag(o),(o.tag_name==="script"||o.tag_name==="style")&&!(o.is_unformatted||o.is_content_unformatted)&&(o.custom_beautifier_name=u(o.tag_check,i)))),O(o.tag_check,this._options.extra_liners)&&(r.print_newline(!1),r._output.just_added_blankline()||r.print_newline(!0)),o.is_empty_element){if(o.tag_start_char==="{"&&o.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),o.indent_content=!0;var k=r.current_line_has_match(/{{#if/);k||r.print_newline(!1)}o.tag_name==="!--"&&w.type===e.TAG_CLOSE&&T.is_end_tag&&o.text.indexOf(`
+`)===-1||(o.is_inline_element||o.is_unformatted||r.print_newline(!1),this._calcluate_parent_multiline(r,o))}else if(o.is_end_tag){var l=!1;l=o.start_tag_token&&o.start_tag_token.multiline_content,l=l||!o.is_inline_element&&!(T.is_inline_element||T.is_unformatted)&&!(w.type===e.TAG_CLOSE&&o.start_tag_token===T)&&w.type!=="TK_CONTENT",(o.is_content_unformatted||o.is_unformatted)&&(l=!1),l&&r.print_newline(!1)}else o.indent_content=!o.custom_beautifier_name,o.tag_start_char==="<"&&(o.tag_name==="html"?o.indent_content=this._options.indent_inner_html:o.tag_name==="head"?o.indent_content=this._options.indent_head_inner_html:o.tag_name==="body"&&(o.indent_content=this._options.indent_body_inner_html)),!(o.is_inline_element||o.is_unformatted)&&(w.type!=="TK_CONTENT"||o.is_content_unformatted)&&r.print_newline(!1),this._calcluate_parent_multiline(r,o)},y.prototype._calcluate_parent_multiline=function(r,i){i.parent&&r._output.just_added_newline()&&!((i.is_inline_element||i.is_unformatted)&&i.parent.is_inline_element)&&(i.parent.multiline_content=!0)};var A=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],N=["a","audio","del","ins","map","noscript","video"];return y.prototype._do_optional_end_element=function(r){var i=null;if(!(r.is_empty_element||!r.is_start_tag||!r.parent)){if(r.tag_name==="body")i=i||this._tag_stack.try_pop("head");else if(r.tag_name==="li")i=i||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(r.tag_name==="dd"||r.tag_name==="dt")i=i||this._tag_stack.try_pop("dt",["dl"]),i=i||this._tag_stack.try_pop("dd",["dl"]);else if(r.parent.tag_name==="p"&&A.indexOf(r.tag_name)!==-1){var o=r.parent.parent;(!o||N.indexOf(o.tag_name)===-1)&&(i=i||this._tag_stack.try_pop("p"))}else r.tag_name==="rp"||r.tag_name==="rt"?(i=i||this._tag_stack.try_pop("rt",["ruby","rtc"]),i=i||this._tag_stack.try_pop("rp",["ruby","rtc"])):r.tag_name==="optgroup"?i=i||this._tag_stack.try_pop("optgroup",["select"]):r.tag_name==="option"?i=i||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):r.tag_name==="colgroup"?i=i||this._tag_stack.try_pop("caption",["table"]):r.tag_name==="thead"?(i=i||this._tag_stack.try_pop("caption",["table"]),i=i||this._tag_stack.try_pop("colgroup",["table"])):r.tag_name==="tbody"||r.tag_name==="tfoot"?(i=i||this._tag_stack.try_pop("caption",["table"]),i=i||this._tag_stack.try_pop("colgroup",["table"]),i=i||this._tag_stack.try_pop("thead",["table"]),i=i||this._tag_stack.try_pop("tbody",["table"])):r.tag_name==="tr"?(i=i||this._tag_stack.try_pop("caption",["table"]),i=i||this._tag_stack.try_pop("colgroup",["table"]),i=i||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(r.tag_name==="th"||r.tag_name==="td")&&(i=i||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),i=i||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return r.parent=this._tag_stack.get_parser_token(),i}},lt.Beautifier=y,lt}var qt;function Ht(){if(qt)return F.exports;qt=1;var m=Jt().Beautifier,p=Kt().Options;function _(e,s,a,f){var n=new m(e,s,a,f);return n.beautify()}return F.exports=_,F.exports.defaultOptions=function(){return new p},F.exports}var Ft;function te(){if(Ft)return D;Ft=1;var m=Qt(),p=Zt(),_=Ht();function e(s,a,f,n){return f=f||m,n=n||p,_(s,a,f,n)}return e.defaultOptions=_.defaultOptions,D.js=m,D.css=p,D.html=e,D}var $t;function ee(){return $t||($t=1,(function(m){function p(_,e,s){var a=function(f,n){return _.js_beautify(f,n)};return a.js=_.js_beautify,a.css=e.css_beautify,a.html=s.html_beautify,a.js_beautify=_.js_beautify,a.css_beautify=e.css_beautify,a.html_beautify=s.html_beautify,a}(function(_){var e=te();e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,_.exports=p(e,e,e)})(m)})(V)),V.exports}var ie=ee();export{ie as default};
+//# sourceMappingURL=/sm/f3f74f7c17498e980a5434b222f4bed078c7281b412ad0d79ce8b2f1a2873cbf.map
\ No newline at end of file
diff --git a/src/minerama.css b/src/minerama.css
new file mode 100644
index 00000000..e69de29b
diff --git a/src/minerama.js b/src/minerama.js
new file mode 100644
index 00000000..4983c58c
--- /dev/null
+++ b/src/minerama.js
@@ -0,0 +1,114 @@
+export class Renderer {
+ constructor() {
+ this.canvas = document.createElement('canvas');
+ this.canvas.style.display = 'none';
+ document.body.appendChild(this.canvas);
+ this.gl = this.canvas.getContext('webgl2', {antialias: false, alpha: true})
+ }
+}
+
+function renderVariantCondition(key) {
+ if (key) {
+ return key.split(',').map(
+ it => it.split("=")
+ ).map(
+ ([n, v]) => `state[${JSON.stringify(n)}] === ${JSON.stringify(v)}`
+ ).join(" && ")
+ } else {
+ return 'true';
+ }
+}
+
+function renderApply(data) {
+ if (Array.isArray(data)) {
+ const parts = [];
+
+ let total = 0.0;
+ for (const {weight = 1.0} of data) total += weight;
+
+ let accum = 0.0;
+ for (const elem of data) {
+ const {weight = 1.0} = elem;
+ accum += weight;
+
+ if (accum === total) {
+ parts.push(JSON.stringify(elem));
+ } else {
+ parts.push(`(hash % ${total}) < ${accum} ? ${JSON.stringify(elem)} : `)
+ }
+ }
+ return parts.join('');
+ } else {
+ return JSON.stringify(data)
+ }
+}
+
+/**
+ * @param {Object} data
+ * @returns {String}
+ */
+function renderBlockstateResolver(data) {
+ const {variants, multipart} = data;
+
+ if (variants) {
+ if (Object.keys(variants).length === 1 && variants[""]) {
+ return `return ${(renderApply(variants[""]))};`;
+ } else {
+ let cases = [];
+ for (const [key, defn] of Object.entries(variants)) {
+ cases.push(`if (${(renderVariantCondition(key))}) return ${(renderApply(defn))};`)
+ }
+ cases.push(`return {"model": ":missing"};`)
+ return cases.join('else ')
+ }
+ } else if (multipart) {
+ return 'console.warn("NOT IMPLEMENTED")'
+ } else {
+ console.warn('invalid blockstate', data)
+ }
+}
+
+/**
+ * @param {String} src
+ * @returns {Promise}
+ */
+async function parse(src) {
+ const lines = src.replace(/#.*?(?:\n|$)/, '\n').trim().split(/(?:\n[ \t]*)+/);
+
+ for (const line of lines) {
+ const args = line.split(/[ \t]+/);
+ const cmd = args[0].toLowerCase();
+
+ if (cmd === 'p') {
+ const block = args[1];
+
+ try {
+ const res = await fetch(`assets/minecraft/blockstates/${block}.json`);
+ let data = await res.json();
+ let resolver_src = renderBlockstateResolver(data);
+ // console.log(beautify.js(`${block} = (state, hash) => {${resolver_src}}`))
+
+ let resolver = new Function("state", "hash", resolver_src);
+ console.log(resolver)
+
+ } catch (ex) {
+ console.warn(`Fetch for ${block} failed:`, ex);
+ }
+ }
+ }
+}
+
+export class MCDioramaElement extends HTMLElement {
+ connectedCallback() {
+ const canvas = document.createElement('canvas');
+ this.appendChild(canvas);
+ const ctx = canvas.getContext('2d');
+
+ setTimeout(() => {
+ const script = this.querySelector('script[type="text/mc-world"]');
+ parse(script.textContent);
+ }, 0)
+ }
+}
+
+customElements.define('mc-diorama', MCDioramaElement);
diff --git a/style.css b/style.css
new file mode 100644
index 00000000..e69de29b